instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>For many years I have used two great tools <a href="http://www.compuware.com/products/devpartner/visualc.htm" rel="noreferrer">BoundsChecker</a> &amp; <a href="http://www-01.ibm.com/software/awdtools/purify/win/" rel="noreferrer">Purify</a>, but the developers of these applications have let me down, they no longer p...
<p>Viva64 (<a href="http://www.viva64.com/viva64-tool/" rel="noreferrer">http://www.viva64.com/viva64-tool/</a>) tool provides detection of errors typical of 64-bit Windows applications. Viva64 is a lint-like static analyzer of C/C++ code. Viva64 integrates into Visual Studio 2005/2008 environment and provides user-fri...
<p>I've used bounds checking and other dynamic analysis tools, and while the architectures are different it's the code that you're checking - in theory you could run bounds checking on any backend and the result would be the same - the code either steps outside its bounds or it does not.</p> <p>The only complications ...
7,225
<p>I absolutely need to use an IoC container for decoupling dependencies in an ever increasingly complex system of enterprise services. The issue I am facing is one related to configuration (a.k.a. registration). We currently have 4 different environments -- development to production and in between. These environmen...
<p>I use <a href="http://www.ninject.org/" rel="nofollow noreferrer">Ninject</a>. I like the fact that I don't have to use Xml to configure the dependencies. I can just use straight up C# code. There are <a href="http://kohari.org/2008/06/08/attributes-we-dont-need-no-stinkin-attributes/" rel="nofollow noreferrer">m...
<p>I'm not sure whether it will suit your particular case, you didn't mention what platform you're working in, but I've had great success with <a href="http://www.castleproject.org/container/index.html" rel="nofollow noreferrer">Castle Windsor's IOC framework</a>. The dependencies are setup in the config file (it's a ....
6,701
<p>I want to convert a number that is in <a href="https://en.wikipedia.org/wiki/Netscape_Portable_Runtime#Time" rel="nofollow noreferrer">PRTime</a> format (a 64-bit integer representing the number of microseconds since midnight (00:00:00) 1 January 1970 Coordinated Universal Time (UTC)) to a <code>DateTime</code>.</p>...
<pre><code>Dim prTimeInMillis As UInt64 prTimeInMillis = prTime/1000 Dim prDateTime As New DateTime(1970, 1, 1) prDateTime = prDateTime.AddMilliseconds(prTimeInMillis) </code></pre>
<p>DateTime has a constructor that takes Ticks (which are 100 nanoseconds).</p> <p>So take your prTime, multiply it by 10 and add it to the number of ticks representing the Epoch time and you have your conversion.</p> <pre><code>private static DateTime epoch = new DateTime(1970, 1, 1); private static DateTime ConvertP...
8,060
<p>Hello is there a way to prevent bend on print with M3D printer? </p> <p><a href="https://i.stack.imgur.com/j2IRe.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j2IRe.jpg" alt="enter image description here"></a></p>
<p>You can to print a brim, a thin layer on the bottom connected to the model. This will help hold it in place. Since it is thin (one or two layers) it will not warp itself.</p> <p>The brim is not the same thing as a raft. A raft is under the model. The brim is on the same layer as the models bottom layer but outside ...
<p>Try using an adhesive before you print. This could be <a href="http://airwolf3d.com/shop/wolfbite-prevents-3d-printed-parts-from-warping" rel="nofollow noreferrer">http://airwolf3d.com/shop/wolfbite-prevents-3d-printed-parts-from-warping</a> ... What is the temperature of the room you are printing in like?</p>
469
<p>Sometimes I need to quickly extract some arbitrary data from XML files to put into a CSV format. What's your best practices for doing this in the Unix terminal? I would love some code examples, so for instance how can I get the following problem solved?</p> <p>Example XML input:</p> <pre class="lang-html prettyprint...
<p>If you just want the name attributes of any element, here is a quick but incomplete solution.</p> <p>(Your example text is in the file <em>example</em>)</p> <blockquote> <p>grep "name" example | cut -d"\"" -f2,2 | xargs -I{} echo "{},"</p> </blockquote>
<p><a href="https://mikefarah.gitbook.io/yq/" rel="nofollow noreferrer">yq</a> can be used for XML parsing.</p> <p>It is a lightweight and portable command-line YAML processor and can also deal with XML. The syntax is similar to <a href="https://stedolan.github.io/jq/" rel="nofollow noreferrer">jq</a></p> <p><strong>In...
4,867
<p>I understand how I can change the <code>dns</code> settings for my domains by editing my bind configs, when I run my own name-servers. I know that I can define the name-servers with my registrar via their online control panels. But I have no idea how that part works...</p> <p>How does my registrar store the data ab...
<p>The registrar is responsible for setting the Root DNS entry that says, "When someone asks for stackoverflow.com, tell them that the authoritative DNS is xxx.xxx.xxx.xxx". They have an interface that allows them to make changes to the records they own.</p> <p>Then the requester must go to the authoritative DNS (Whi...
<p>Sorry I can't help toooooo much, but go to <a href="http://twit.tv" rel="nofollow noreferrer">http://twit.tv</a>, and find the Security Now podcast - they did one a couple of weeks ago on DNS - get the first one. It has a good explanation of how it works etc (which may help).</p> <p>The second one on that site is a...
6,839
<p>I have a list of integers, <code>List&lt;Integer&gt;</code> and I'd like to convert all the integer objects into Strings, thus finishing up with a new <code>List&lt;String&gt;</code>.</p> <p>Naturally, I could create a new <code>List&lt;String&gt;</code> and loop through the list calling <code>String.valueOf()</cod...
<p>As far as I know, iterate and instantiate is the only way to do this. Something like (for others potential help, since I'm sure you know how to do this):</p> <pre><code>List&lt;Integer&gt; oldList = ... /* Specify the size of the list up front to prevent resizing. */ List&lt;String&gt; newList = new ArrayList&lt;&...
<p>I just wanted to chime in with an object oriented solution to the problem.</p> <p>If you model domain objects, then the solution is in the domain objects. The domain here is a List of integers for which we want string values.</p> <p>The easiest way would be to not convert the list at all.</p> <p>That being said, in...
3,908
<p>I'm new in the 3D priting and I bought a BIQU B1 printer :-)</p> <p>I printed the Pokemon with the white filament that come as a sample with the printer (PLA) and after that I bought the Inland PLA+ and PETG+ from Microcenter. The first thing that my son asked me to print is the toaster. Well, I tried to print three...
<blockquote> <p>What is this called</p> </blockquote> <p>This is called <strong>warping</strong>.</p> <p>Warping of prints occurs frequently when you use a filament that shrinks. If the model would shrink uniformly, it will become smaller, like in a scaled version (unfortunately, the print is attached somewhere, which ...
<p>You are getting warping. It's unusual in this case, as your overall model is relatively low profile. It's the taller stuff that likes to warp.</p> <p>Consider to edit your post to include the layer heights and also the filament type and filament and bed temperatures. My first instinct is that your bed temperature is...
2,206
<p>I've been looking for a <em>simple</em> Java algorithm to generate a pseudo-random alpha-numeric string. In my situation it would be used as a unique session/key identifier that would "likely" be unique over <code>500K+</code> generation (my needs don't really require anything much more sophisticated). </p> <p>Id...
<h2>Algorithm</h2> <p>To generate a random string, concatenate characters drawn randomly from the set of acceptable symbols until the string reaches the desired length.</p> <h2>Implementation</h2> <p>Here's some fairly simple and very flexible code for generating random identifiers. <em>Read the information that follow...
<p>Yet another solution...</p> <pre><code>public static String generatePassword(int passwordLength) { int asciiFirst = 33; int asciiLast = 126; Integer[] exceptions = { 34, 39, 96 }; List&lt;Integer&gt; exceptionsList = Arrays.asList(exceptions); SecureRandom random = new SecureRandom(); String...
6,239
<p>I lost my MySQL username and password. How do I retrieve it?</p>
<blockquote> <p>Stop the MySQL process.</p> <p>Start the MySQL process with the --skip-grant-tables option.</p> <p>Start the MySQL console client with the -u root option.</p> </blockquote> <p>List all the users;</p> <pre><code>SELECT * FROM mysql.user; </code></pre> <p>Reset password;</p> <pre><code>UPDATE mysql.user S...
<p>Although a strict, logical, computer science'ish interpretation of the op's question would be to require <strong>both</strong> "How do I retrieve my MySQL username" <strong>and</strong> "password" - I thought It might be useful to someone to also address the <strong>OR</strong> interpretation. In other words ...</p>...
2,639
<p>I'm using Windows and I'm trying to get ANT to work.</p> <p>When I do an ant build from the command line, I get: <code>C:\dev\Projects\springapp\${%ANT_HOME%}\lib not found.</code></p> <p>I look into the <code>build.xml</code> file and I find: <code>appserver.home=${user.home}/apache-tomcat-6.0.14</code> (which I ...
<p>Change it to </p> <pre><code>appserver.home="C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0" </code></pre>
<p>In addition to escaping the windows directory separator also make sure that all paths that you type in should be with correct capitalisation, Windows is not case sensitive but case presrving, while Ant is case sensitive.</p>
7,913
<p>OK, I know there have already been questions about <a href="https://stackoverflow.com/questions/4303/why-should-i-practice-test-driven-development-and-how-should-i-start">getting started with TDD</a>.. However, I guess I kind of know the general concensus is to <em>just do it</em> , However, I seem to have the follo...
<p>First, it is alright and normal to feel frustrated when you first start trying to use TDD in your coding style. Just don't get discouraged and quit, you will need to give it some time. It is a major paradigm shift in how we think about solving a problem in code. I like to think of it like when we switched from pr...
<p>I am no expert at TDD, by any means, but here is my view:</p> <ul> <li>If it is completely trivial (getters/setters etc) do not test it, unless you don't have confidence in the code for some reason.</li> <li>If it is a quite simple, but non-trivial method, test it. The test is probably easy to write anyway.</li> <l...
4,462
<p>I'm looking for a way to give out preview or demo versions of our software to our customers as easy as possible.</p> <p>The software we are currently developing is a pretty big project. It consists of a client environment, an application server, various databases, web services host etc. The project is developed inc...
<p>Since you're looking at an entire application stack, you'll need to virtualize the entire server to provide your customers with a realistic demo experience. Thinstall is great for single apps, but not an entire stack....</p> <p>Microsoft have licensing schemes for this type of situation, since it's only been used f...
<blockquote> <p>Thinstall is great for single apps, but not an entire stack....</p> </blockquote> <p>I didn't try it yet, but with the new version of thinstall you are able to let different thinstalled application communicate. But I guess you're right a vm-ware image would be easier</p>
4,955
<p>The CodePlex team has a <a href="https://rads.stackoverflow.com/amzn/click/com/0767907698" rel="noreferrer" rel="nofollow noreferrer">Slack</a> time policy, and it's worked out very well for them.</p> <ul> <li>Jim Newkirk and myself used it to work on the <a href="http://www.codeplex.com/xunit" rel="noreferrer">xUn...
<p>I just want to mention Google's policy on the subject.<br> 20% of the day should be used for private projects and research. </p> <p>I think it is time for managers to face the fact that most good developers are a bit lazy. If they weren't, we wouldn't have concepts like code reuse.<br> If this laziness can be focu...
<p>I've never worked anywhere that had a formalized policy, but practically every manager I've ever had has allowed me to spend some time on things that weren't directly related to the current project or fighting a fire.</p> <p>I think the key is to talk about the things you'd like to try. Most managers want their te...
3,434
<p>We have a junior programmer that simply doesn't write enough tests.<br> I have to nag him every two hours, "have you written tests?"<br> We've tried:</p> <ul> <li>Showing that the design becomes simpler</li> <li>Showing it prevents defects</li> <li>Making it an ego thing saying only bad programmers don't</li> <li>T...
<p>This is one of <em>the hardest things</em> to do. Getting your people to <em>get it</em>.</p> <p>Sometimes one of the best ways to help junior level programmers 'get it' and learn the right techniques from the seniors is to do a bit of pair programming.</p> <p>Try this: on an upcoming project, pair the junior guy...
<p>Based on your comment, "Showing that the design becomes simpler" I'm assuming you guys practice TDD. Doing a code review after the fact is not going to work. The whole thing about TDD is that it's a design and not a testing philosophy. If he didn't write the tests as part of the design, you aren't going to get a ...
2,888
<p>How do you perform a CROSS JOIN with LINQ to SQL?</p>
<p>A cross-join is simply the Cartesian product of two sets. There's no explicit join operator for it.</p> <pre> var combo = from p in people from c in cars select new { p.Name, c.Make, c.Model, c.Colour }; ...
<p>Extension Method:</p> <pre><code>public static IEnumerable&lt;Tuple&lt;T1, T2&gt;&gt; CrossJoin&lt;T1, T2&gt;(this IEnumerable&lt;T1&gt; sequence1, IEnumerable&lt;T2&gt; sequence2) { return sequence1.SelectMany(t1 =&gt; sequence2.Select(t2 =&gt; Tuple.Create(t1, t2))); } </code></pre> <p>And use like:</p> <pr...
8,049
<p>I want to define something like this in <em>php</em>:</p> <pre><code>$EL = "\n&lt;br /&gt;\n"; </code></pre> <p>and then use that variable as an "endline" marker all over my site, like this:</p> <pre><code>echo "Blah blah blah{$EL}"; </code></pre> <p>How do I define $EL once (in only 1 file), include it on every...
<p>Most PHP sites should have a file (I call it a header) that you include on every single page of the site. If you put that first line of code in the header file, then include it like this on every page:</p> <pre><code> include 'header.php'; </code></pre> <p>you won't have to use the global keyword or anything, the ...
<p>IIRC a common solution is a plain file that contains your declarations, that you include in every source file, something like '<em>constants.inc.php</em>'. There you can define a bunch of application-wide variables that are then imported in every file.</p> <p>Still, you have to provide the include directive in <str...
3,405
<p>earlier today someone asked about free/cheap component libraries for winforms. I'm interested in the same thing, but for asp.net. There are some great commercial libraries like Telerik and DevExpress, but are there any great free/cheap alternatives?</p>
<p>I am not sure what you constitute as cheap, but the Peter Blum ASP.NET controls are a good buy.</p> <p><a href="http://www.peterblum.com/Home.aspx" rel="nofollow noreferrer">peterblum.com</a></p>
<p>Try this free custom web controls : <a href="http://www.eworldui.net/" rel="nofollow noreferrer">Excentrics World .NET</a></p>
8,458
<p>We have the standard Subversion trunk/branches/tags layout. We have several branches for medium- and long-term projects, but none so far for a release. This is approaching fast.</p> <p>Should we:</p> <ol> <li>Mix release branches and project branches together?</li> <li>Create a releases folder? If so, is there a b...
<p>I recommend the following layout, for two reasons: - all stuff related to a given project is within the same part of the tree; makes it easier for people to grasp - permissions handling may be easier this way</p> <p>And by the way: It's a good idea with few repositories, instead of many, because change history...
<p>Releases is the same as tags... Have you got multiple projects inside your trunk? In that case, I would copy the same folders inside tags</p> <p>So</p> <pre><code>trunk fooapp stuff... barapp stuff... tags fooapp 1.0.0 1.0.1 barapp 1.0.0 </code></pr...
7,188
<p>First off, this is a question about a desktop application using Windows Forms, not an <a href="http://en.wikipedia.org/wiki/ASP.NET" rel="nofollow noreferrer">ASP.NET</a> question.</p> <p>I need to interact with controls on other forms. I am trying to access the controls by using, for example, the following...</p> ...
<p>Instead of making the control public, you can create a property that controls its visibility:</p> <pre><code>public bool ControlIsVisible { get { return control.Visible; } set { control.Visible = value; } } </code></pre> <p>This creates a proper accessor to that control that won't expose the control's wh...
<p>Do your child forms really need to be Forms? Could they be user controls instead? This way, they could easily raise events for the main form to handle and you could better encapsulate their logic into a single class (at least, logically, they are after all classes already).</p> <p>@Lars: You are right here. Thi...
3,001
<p>I have a web application that sometimes just hangs over heavy load. To make it come back I have to kill the "dllhost.exe" process. <strong>Does someone know what to do?</strong></p> <p>This is an Classic ASP (VBScript) app with lots of COM+ objects.</p> <p>The server has the following configuration:</p> <ul> <li>...
<p>Sounds like dodgy COM objects causing the problem .. do you load them into the "Application", if you do then are they threadsafe; or are they used and discarded on each request?</p> <p>Yes, recycling every few hours would help 'hide' the problem, but they ought to be debugged and fixed properly ... have you tried d...
<p>There is probably some errors in your eventlog under the Application and System categories. Try to find the origin of these errors or post them here we'll see what we can do :)</p> <p>Edit : @Daniel Silveira A memory leak is probable. What COM+ object do you use? I had some issues with Excel with an application I ...
3,970
<p>I am trying to print a tank to be used with my RC engine. The material that I have to use needs to have the following properties:</p> <ul> <li>It needs to be possible to seal the final print so that it is not leaking any fluid</li> <li>It needs to resist methanol, nitromethane (a solvent like Acetone) and lubricatin...
<p>Most commercial blow-molded fuel tanks for model airplane fuel (methanol or ethanol, nitromethane or nitroethane, and some combination of castor, mineral, or synthetic lubricating oil) are made from HDPE. This material isn't commonly seen as filament, in my limited experience, but it ought to be possible to arrive ...
<p>As a supplement to the answer (doesn't fit well in the comments). This site <a href="https://www.filamentive.com/chemical-resistance-of-3d-printing-filament/" rel="nofollow noreferrer">https://www.filamentive.com/chemical-resistance-of-3d-printing-filament/</a> lists PETG has have a very high restance to alcohol, a...
1,948
<p>Why are pointers such a leading factor of confusion for many new, and even old, college level students in C or C++? Are there any tools or thought processes that helped you understand how pointers work at the variable, function, and beyond level?</p> <p>What are some good practice things that can be done to bring ...
<p>Pointers is a concept that for many can be confusing at first, in particular when it comes to copying pointer values around and still referencing the same memory block.</p> <p>I've found that the best analogy is to consider the pointer as a piece of paper with a house address on it, and the memory block it referenc...
<p>I don't see what is so confusing about pointers. They point to a location in memory, that is it stores the memory address. In C/C++ you can specify the type the pointer points to. For example:</p> <pre><code>int* my_int_pointer; </code></pre> <p>Says that my_int_pointer contains the address to a location that cont...
2,758
<p>How would you create a database in Microsoft Access that is searchable only by certain fields and controlled by only a few (necessary) text boxes and check boxes on a form so it is easy to use - no difficult queries?</p> <p>Example: You have several text boxes and several corresponding check boxes on a form, and w...
<p>My own solution is to add a "filter" control in the header part of the form for each of the columns I want to be able to filter on (usually all ...). Each time such a "filter" control is updated, a procedure will run to update the active filter of the form, using the "BuildCriteria" function available in Access VBA....
<p>For a question that vague, all that I can answer is open MS Access, and click the mouse a few times.</p> <p>On second thought:<br> Use the "WhereCondition" argument of the "OpenForm" method</p>
9,811
<p>I got an Anycubic Predator last month, and after resolving a few mechanical problems, I was able to get it printing decently well. The only significant modification I've made so far is a set of 8-diode TL Smoothers, and I'm now mostly operating it via Octoprint.</p> <p>However, during the last few prints, I've noti...
<h2>Safety First</h2> <p>Let's look at the graphs. First: you should swap firmware for one that has <a href="https://3dprinting.stackexchange.com/questions/8466/what-is-thermal-runaway-protection">Thermal Runaway</a>, as, as it is, running about 15 minutes with 28 K less than the printer is ordered to work at is a clea...
<p>The rise times are quicker than the fall times, which is not what I expected. Maybe a fan is turning on and off, but I'd expect to see the heater struggling to heat up. On both graphs, the rise times look like good heating and not much interference. </p> <p>It seems to me that power to the hotend is the problem, bu...
1,560
<p>Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good?</p>
<p>Python has several testing frameworks, including <code>unittest</code>, <code>doctest</code>, and <code>nose</code>. The most xUnit-like is <code>unittest</code>, which is documented on Python.org.</p> <ul> <li><a href="https://docs.python.org/3/library/unittest.html" rel="nofollow noreferrer"><code>unittest</code>...
<p>There is also <a href="http://pyunit.sourceforge.net/" rel="nofollow noreferrer">PyUnit</a> which might be what you're looking for.</p>
5,726
<p>How to get a file's creation date or file size, for example this Hello.jpg at <a href="http://www.mywebsite.com/now/Hello.jpg(note" rel="nofollow noreferrer">http://www.mywebsite.com/now/Hello.jpg(note</a>: This URL does not exist)? The purpose of this question is to make my application re-download the files from th...
<p>If you use the HEAD request it will send the headers for the resource, there you can check the cache control headers which will tell you if the resource has been modified, last modification time, size (content-length) and date. </p> <pre><code>$ telnet www.google.com 80 Trying 216.239.59.103... Connected to www.l.g...
<p>The webserver might send a last-modified and/or etag header for that purpose. And you might send an if-modified-since header in your request.</p> <p>see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" rel="nofollow noreferrer">http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html</a> sections 14.1...
9,627
<p>What is your favorite technique for launching a windbg user-mode remote debugging session? Why is do you prefer this technique over other techniques? (pros/cons)</p> <p>There are at least four different ways to do user-mode remote debug using windbg, as documented in the "Remote Debugging" section of the debugging ...
<p>There is no "the best" solution. Each of the possibilities has advantages and disadvantages and it's good to understand all of them. It depends on several factors like:</p> <ul> <li>where are the symbols located</li> <li>which PC has access to the Internet to download the OS symbols</li> <li>what amount of data may...
<p>Option 1 is my favourite because it is the simplest. I get to launch the app in the normal way without worry about getting WinDbg to set the right working directory, pass any command line arguments, etc.</p> <p>Fortunately I've not run into any cases where this hasn't worked!</p>
7,620
<p>How do I call a function, using a string with the function's name? For example:</p> <pre><code>import foo func_name = &quot;bar&quot; call(foo, func_name) # calls foo.bar() </code></pre>
<p>Given a module <code>foo</code> with method <code>bar</code>:</p> <pre><code>import foo bar = getattr(foo, 'bar') result = bar() </code></pre> <p><a href="https://docs.python.org/library/functions.html#getattr" rel="noreferrer"><code>getattr</code></a> can similarly be used on class instance bound methods, module-le...
<p>This is a simple answer, this will allow you to clear the screen for example. There are two examples below, with eval and exec, that will print 0 at the top after cleaning (if you're using Windows, change <code>clear</code> to <code>cls</code>, Linux and Mac users leave as is for example) or just execute it, respect...
2,522
<p>I have a webapp development problem that I've developed one solution for, but am trying to find other ideas that might get around some performance issues I'm seeing.</p> <p>problem statement: </p> <ul> <li>a user enters several keywords/tokens</li> <li>the application searches for matches to the tokens</li> <li>ne...
<p>you could achive this in one query using 'UNION ALL' in MySQL.</p> <p>Just loop through the tokens in PHP creating a UNION ALL for each token:</p> <p>e.g if the tokens are 'x', 'y' and 'z' your query may look something like this</p> <pre><code>SELECT * FROM `entries` WHERE token like "%x%" union all SELECT ...
<p>You'll probably get much better performance if you used a data structure designed for search tasks rather than a database. For example, you might try looking at building an <a href="http://en.wikipedia.org/wiki/Inverted_index" rel="nofollow noreferrer">inverted index</a>. Rather than writing it youself, however, you...
7,002
<p>Is there any way to change Firefox system icon (the one on the left top of the window)? </p> <p>Precision : I want to change the icon of a bundled version of Firefox with apache/php and my application. So manual operation on each computer is not a solution. I try Resource Hacker and it's the good solution. The add ...
<p>Resource hacker does the job of swapping application icons in Windows (up to XP, not tested with Vista yet).</p> <p>Available at: <a href="http://www.angusj.com/resourcehacker/" rel="nofollow noreferrer">http://www.angusj.com/resourcehacker/</a></p>
<p>I think you mean the system icon, not the site icon as someone else thought. On a Mac, you can hold-Click -> Get Info on Firefox.app, then drag or paste an image on top of the icon.</p> <p>I'm not sure about Windows, but I think you may need to compile from source to change it.</p>
8,966
<p>We are currently looking to adopt some type of "standard" developer framework and have looked into using the Enterprise Library. Would you recommend using these blocks as the foundation for software development, or should we do something <em>home grown</em>?</p>
<p>Like all good answers to architecture and programming questions, the answer is "it depends".</p> <p>It depends on how unique your data access and object design needs are. It may also depend on how you plan on supporting your application in the long term. Finally, it greatly depends on the skill level of your deve...
<p>It really depends on what you need to do. Generally speaking, the bigger the niche is that your company is in, the better chance that you'll find a framework to properly support you. For smaller niches, you'll more than likely need to roll your own.</p> <p>The company I work for has several apps all geared twoard...
7,647
<p>I'm currently working on putting together a fairly simple ORM tool to serve as a framework for various web projects for a client. Most of the projects are internal and will not require massive amounts of concurrency and all will go against SQL Server. I've suggested that they go with ORM tools like SubSonic, NHibe...
<p>For the love of all that's holy (and the women and the children), do everything possible to convince them not to go with a custom O/RM solution. Why are people wanting to re-invent the wheel when there are perfectly-good, open-source wheels already in existence?!?!</p>
<p>No-one has mentioned it yet; but go with <a href="http://www.llblgen.com/" rel="nofollow noreferrer">LLBLGen</a>. You may customise the template as you like, and you may also, obviously, write your own custom code in the generated classes. Buy it. You will never look back, and you will be saying "Thank you silky!" w...
7,316
<p>How can you find out what are the long running queries are on Informix database server? I have a query that is using up the CPU and want to find out what the query is.</p>
<p>If the query is currently running watch the <strong>onstat -g act -r 1</strong> output and look for items with an <strong><em>rstcb</em></strong> that is not 0</p> <pre><code>Running threads: tid tcb rstcb prty status vp-class name 106 c0000000d4860950 0 ...
<pre><code>SELECT ELAPSED_TIME_MIN,SUBSTR(AUTHID,1,10) AS AUTH_ID, AGENT_ID, APPL_STATUS,SUBSTR(STMT_TEXT,1,20) AS SQL_TEXT FROM SYSIBMADM.LONG_RUNNING_SQL WHERE ELAPSED_TIME_MIN &gt; 0 ORDER BY ELAPSED_TIME_MIN DESC </code></pre> <p>Credit: <a href="http://it.toolbox.com/blogs/db2luw/sql-to-view-long-running-queries...
7,426
<p>Is there some way I can use URLs like: </p> <p><em><a href="http://www.blog.com/team-spirit/" rel="nofollow noreferrer">http://www.blog.com/team-spirit/</a></em></p> <p>instead of</p> <p><em><a href="http://www.blog.com/?p=122" rel="nofollow noreferrer">http://www.blog.com/?p=122</a></em></p> <p>in a Windows hos...
<p>This is how I did it with WordPress on IIS 6.0</p> <p><a href="http://www.coderjournal.com/2008/02/url-rewriter-reverse-proxy-iis-wordpress/" rel="nofollow noreferrer">http://www.coderjournal.com/2008/02/url-rewriter-reverse-proxy-iis-wordpress/</a></p> <p>However it all depends on what version of IIS you are usin...
<p>We use the free version of <a href="http://www.isapirewrite.com/" rel="nofollow noreferrer">ISAPI_Rewrite</a>. It uses similar syntax to mod_rewrite, so if you're familiar with that you may have an easier time getting started.</p> <p>There used to be a (syntax-compatible) port of mod_rewrite for IIS, but I can't f...
5,252
<p>I know that the .NET framework looks for referenced DLLs in several locations</p> <ul> <li>Global assembly cache (GAC)</li> <li>Any private paths added to the AppDomain</li> <li>The current directory of the executing assembly</li> </ul> <p>What order are those locations searched? Is the search for a DLL ceased if ...
<p>Assembly loading is a rather elaborate process which depends on lots of different factors like configuration files, publisher policies, appdomain settings, CLR hosts, partial or full assembly names, etc.</p> <p>The simple version is that the GAC is first, then the private paths. %PATH% is never used.</p> <p>It is be...
<blockquote> <p>No longer is the current directory searched first when loading DLLs! This change was also made in Windows XP SP1. The default behavior now is to look in all the system locations first, then the current directory, and finally any user-defined paths.</p> </blockquote> <p>(ref. <a href="http://weblogs.asp....
7,261
<p>I'd like to hear from people who are using distributed version control (aka distributed revision control, decentralized version control) and how they are finding it. What are you using, Mercurial, Darcs, Git, Bazaar? Are you still using it? If you've used client/server rcs in the past, are you finding it better, wor...
<p>I've been using Mercurial both at work and in my own personal projects, and I am really happy with it. The advantages I see are:</p> <ol> <li><strong>Local version control.</strong> Sometimes I'm working on something, and I want to keep a version history on it, but I'm not ready to push it to the central repositor...
<blockquote> <p>Using Subversion</p> </blockquote> <p>Subversion isn't distributed, so that makes me think I need a wikipedia link in case people aren't sure what I'm talking about :)</p>
4,647
<p>I'm a student in software engineering in Montreal. For the last 3 years I've had a few interships (once per year). The first two (in the same company) were mostly sysadmin jobs, but I did get to do a few Perl programs (mostly log file analysing and statistics generation).</p> <p>My other intership was in the IT sec...
<p>no offense, but from your description it would appear that you're not really qualified for a 'real' OO programming job. Academic classes are a good introduction to a language but no substitute for solving real problems with fluctuating deadlines, finicky users, cholicky managers, et al ;-)</p> <p>this leaves three ...
<p>Contribute patches to some <a href="http://search.cpan.org" rel="nofollow noreferrer">CPAN</a> distribution. This will show that you: 1) use CPAN - managers love peoples that can write code faster 2) can read and modify someones code.</p> <p>Study <a href="http://search.cpan.org/dist/Moose" rel="nofollow noreferrer...
9,404
<p>Has anyone encountered this oddity?</p> <p>I'm checking for the existence of a number of directories in one of my unit tests. <code>is_dir</code> is reporting true (1) in spite of the folder not existing at the time it is called. The code looks like this (with a few extraneous intermediate vars to ease debugging):<...
<p>I don't think this would cause your problem, but $path does have the trailing slash, correct?</p>
<pre><code>$path = trim($base . '/' . $uf); </code></pre> <p>That could be causing it. I'm assuming $base is some sort of root folder you are searching, so if $uf is something like '', '.', or '../' that could return true. We would have to see what values you are using in your foreach to know anything further.</p> <p...
7,597
<p>I thought I am not bad at Google, but simply I am unable to find a G-code for doing circular motion for nozzle cleaning. It is possible to write a simple circular motion in G-code?</p>
<p>To draw a circle, you need to approximate the circle as a sufficient number of line segments. This requires computing or using a table of sine and cosine values for each angle step. Then you just emit a sequence of <code>G1</code> commands.</p> <p>Some printer firmware also supports arc drawing commands you could us...
<p>While many 3D printers support using G2 and G3 for circles and arcs, most people are not used to them because the STL files consist entirely of flat triangles (straight lines).</p> <p>If you want a simple 2D circle, see the following for help:</p> <p><a href="https://marlinfw.org/docs/gcode/G002-G003.html" rel="nofo...
2,056
<p>While cross-site scripting is generally regarded as negative, I've run into several situations where it's necessary.</p> <p>I was recently working within the confines of a very limiting content management system. I needed to include database code within the page, but the hosting server didn't have anything usable ...
<p>You've got three choices:</p> <ol> <li>Create a <a href="http://developer.yahoo.com/javascript/howto-proxy.html" rel="noreferrer">server side proxy script</a>.</li> <li><p>Create a remote script to read in remote dynamic HTML. Use a library like <a href="http://www.jquery.com" rel="noreferrer">jQuery</a> to make th...
<p>I've come across that <a href="http://developer.yahoo.com/javascript/howto-proxy.html" rel="nofollow noreferrer">YDN server side proxy script</a> before. It says it's built to work with Yahoo's Search APIs. </p> <p>Will it work with any domain, if you simply trim the Yahoo API code out? Or do you need to replace...
7,588
<p>I have modified my Prusa i3 MK2 printer so that the existing extruder motor has now been attached to a 5mm lead screw with a 1mm pitch. What is the easiest way to control the extruding of the printer now.</p> <p>For example is it possible to change the settings in slic3er at all for the extruder? or would I have to...
<p>The firmware of the printer reads the g-code, in this instance, for z-axis movement. The g-code provides only (primarily) millimeters of movement and direction, along with speed.</p> <p>The firmware reads those figures, figuratively speaking, and knows from the values stored in the firmware, how many steps to rotat...
<p>You can set the 'steps per mm' for the extruder (and the other axes) by sending GCODE to the printer, and store this in the internal memory. Re-flashing the firmware only affects the 'factory reset' configuration of the printer parameters.</p> <p>To see how to calibrate your extruder, you're probably best looking f...
835
<p>Can't get to my site. Apache gives the following error message: </p> <blockquote> <p>[Fri Sep 05 08:47:42 2008] [error] (OS 10060)A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond....
<p>Can you connect to the proxied host (10.10.10.1) directly? Is it functioning normally?</p>
<p><a href="http://www.checkupdown.com/status/E503.html" rel="nofollow noreferrer">http://www.checkupdown.com/status/E503.html</a></p> <blockquote> <p>Your Web server is effectively 'closed for repair'. It is still functioning minimally because it can at least respond with a 503 status code, but full service is impo...
6,774
<p><code>celsius = (5.0/9.0) * (fahr-32.0);</code></p> <p>Is it just a development choice that the C developers decided upon or is there a reason to this? I believe a float is smaller than a double, so it might be to prevent overflows caused by not knowing what decimal format to use. Is that the reason, or am I overlo...
<pre><code>celsius = (5.0/9.0) * (fahr-32.0); </code></pre> <p>In this expression, <code>5.0</code>, <code>9.0</code>, and <code>32.0</code> are <code>double</code>s. That's the default type for a floating-point constant - if you wanted them to be <code>float</code>s, then you would use the <code>F</code> suffix:</p> ...
<p>Floating point constants should have the available highest precision. The result can be assigned to a float without undue trouble.</p>
5,912
<p>Have been trying out the new Dynamic Data site create tool that shipped with .NET 3.5. The tool uses LINQ Datasources to get the data from the database using a .dmbl context file for a reference. I am interseted in customizing a data grid but I need to show data from more than one table. Does anyone know how to do...
<p>If the tables are connected by a foreign key, you can easily reference both tables as they will be joined by linq automatically (you can see easily if you look in your dbml and there is an arrow connecting the tables) - if not, see if you can add one.</p> <p>To do that, you can just use something like this:</p> <p...
<p>You cannot put more than one object/datasource on a datagrid. You will have to build a single ConceptObject that combines the exposed properties of the part Entities. Try to use DB -> L2S Entities -> ConceptObject. You must be very contrived if the DB model matches the ConceptObject field-for-field.</p>
9,175
<p>The current system that I am working on makes use of Castle Activerecord to provide ORM (Object Relational Mapping) between the Domain objects and the database. This is all well and good and at most times actually works well!</p> <p>The problem comes about with Castle Activerecords support for asynchronous executio...
<p>I solved a problem very similar to this where I copied the data out of a lot of older web service contracts into WCF data contracts. I created a number of methods that had signatures like this:</p> <pre><code>public static T ChangeType&lt;S, T&gt;(this S source) where T : class, new() </code></pre> <p>The first t...
<p>My apologies for not really putting the details in here, but a basic OO approach would be to make the DTO a member of the ActiveRecord class and have the ActiveRecord delegate the accessors and mutators to the DTO. You could use code generation or refactoring tools to build the DTO classes pretty quickly from the Ac...
6,296
<p>It is slow to load anything other than a small project. It is slow to quit; it can sometimes take minutes. It can be slow to open new files. The record macro feature used to be useful. It is now so slow to start up it's almost always quicker to do it manually!</p> <hr> <blockquote> <p>More info would be helpful....
<p>it might be that you have a plugin that is misbehaving. Try the <a href="http://msdn.microsoft.com/en-us/library/xee0c8y7(VS.80).aspx" rel="nofollow noreferrer">safemode</a> switch to see if this improves performance </p>
<p>here's ya problem:</p> <blockquote> <p>3.2GHz P4 Hyperthreaded, 2GB RAM</p> </blockquote> <p>Hypertheaded means "doesn't actually have two CPU's, but it fakes it". If you have a process with just one thread running, then you get bad performance. It was a good short-term measure, but compared to having two REAL C...
6,513
<p>I have an Asset object that has a property AssignedSoftware, which is a collection. </p> <p>I want to make sure that the same piece of Software is not assigned to an Asset more than once. In Add method I check to see if the Software already exist, and if it does, I want to throw an exception. </p> <p>Is there a ...
<p>From the Class Library design guidelines for errors (<a href="http://msdn.microsoft.com/en-us/library/8ey5ey87(VS.71).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/8ey5ey87(VS.71).aspx</a>):</p> <blockquote> <p>In most cases, use the predefined exception types. Only define new exception types for pr...
<p>Well, if you really want an collection with unique items, you might want to take a look at the <a href="http://msdn.microsoft.com/en-us/library/bb359438.aspx" rel="nofollow noreferrer">HashSet object</a> (available in C# 3.0).</p> <p>Otherwise, there are two approaches that you can take:</p> <ul> <li>Create a cust...
7,840
<p>I have a Mini Kossel and I am going through calibration.</p> <p>I can home carriages and find the bed with paper-test getting some Z value with <code>M114</code>. Then I run the effector almost full height <strong>up and then down</strong> - and now <strong>Z value for the bed is greater</strong>!</p> <p>If I repe...
<p>After some more testing I checked that the problem shows up only on Z tower and is not related with current. Examining the tower I found very dumb mistake. Pulley on the motor didn't have a setscrew! Don't know how could I missed that. The fact that it could somehow run is even more amazing. Thanks @tom-van-der-zand...
<p>According to discussions in comments, I'm pretty sure the problem lies in too low current. </p> <p>Please review <a href="https://3dprinting.stackexchange.com/questions/1480/how-do-you-make-sure-you-have-the-right-voltage-on-the-timpots-on-a-a4988-steppe/1483#1483">this answer</a> to <a href="https://3dprinting.sta...
371
<p>In coding a traditional MVC application, what is the best practice for coding server-side form validations? Does the code belong in the controller, or the model layer? And why?</p>
<p>From Wikipedia:</p> <blockquote> <p><a href="http://en.wikipedia.org/wiki/Model_View_Controller" rel="nofollow noreferrer">Model-view-controller</a> (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting i...
<p>My experience with MVC thus far consists of entirely rails.</p> <p>Rails does it's validation 100% in the Model.<br> For the most part this works very well. I'd say 9 out of 10 times it's all you need.</p> <p>There are some areas however where what you're submitting from a form doesn't match up with your model pro...
4,530
<p>I have a table in an access table which contains Product entries, one of the columns has a jpg image stored as an OLE Object. I am trying to import this table to MySQL but nothing seems to work. I have tried the MySQL migration tool but that has a known issue with Access and OLE Objects. (The issue being it does...
<p>Ok so in the interests of airing my dirty code in public here what i came up with.<br> Note : this is a hack designed to be used once and then thrown away.</p> <p>This Method takes in a datarowview containing 1 row of data from the access table. The Images are wrapped in OLE serialization, im not entirely famili...
<p>There's also <a href="https://github.com/shamrin/olefield" rel="nofollow">olefield</a> - Python module to extract data out of OLE object fields in Access. I successfully extracted BMP files with it. It could probably work with jpeg images, but I haven't tried it.</p>
6,293
<p>Recently our site has been deluged with the resurgence of the <a href="https://en.wikipedia.org/wiki/Asprox_botnet" rel="noreferrer">Asprox botnet</a> <a href="http://en.wikipedia.org/wiki/SQL_injection" rel="noreferrer">SQL injection</a> attack. Without going into details, the attack attempts to execute SQL code by...
<p>I went back to Michael's post, did some more poking and realized that I did need to do a double conversion, and eventually worked out this little nugget:</p> <pre><code>Convert.ToString(Convert.ToChar(Int32.Parse(EncodedString.Substring(intParseIndex, 2), System.Globalization.NumberStyles.HexNumber))); </code></pre...
<p>Try removing the <code>0x</code> first and then call <code>Encoding.UTF8.GetString</code>. I think that may work.</p> <p>Essentially: 0x44004500</p> <p>Remove the 0x, and then always two bytes are one character:</p> <pre><code>44 00 = D 45 00 = E 6F 00 = o 72 00 = r </code></pre> <p>So it's definitely a Unico...
2,256
<p>I've been using <a href="https://web.archive.org/web/20200229173754/http://tortoisesvn.tigris.org/" rel="noreferrer">TortoiseSVN </a> in a Windows environment for quite some time. It seems very feature-complete and nicely integrated into the Windows shell, and more importantly, it's fairly painless to teach to coll...
<p>I have been using the 64Bit version of TortoiseSVN for ages and I have never had issues with it on Windows 64Bit or Vista 64Bit. I am currently not aware of any other similiar SVN clients that do work on Vista. Is it possible the problem could lie within the configuration of TortoiseSVN or even the installation of V...
<p>I'll second Diago's answer. I use TortoiseSVN on Vista x64 pretty heavily.</p> <p>I did upgrade directly from an older version to 1.5.2 though, and never used 1.5.1. Have you tried 1.5.2?</p>
2,255
<p>When I try to precompile a *.pc file that contains a #warning directive I recieve the following error:</p> <blockquote> <p>PCC-S-02014, Encountered the symbol "warning" when expecting one of the following: (bla bla bla).</p> </blockquote> <p>Can I somehow convince Pro*C to ignore the thing if it doesn't know wha...
<p>According to the <em>Pro*C/C++ Programmer's Guide</em> (chapter 5 "Advanced Topics"), Pro*C silently ignores a number of preprocessor directives including #error and #pragma, but sadly not #warning. Since your warning directives are included in a header file, you might be able to use the ORA_PROC macro:</p> <pre><...
<p>Remove below two lines from /usr/include/standards.h</p> <h1>warning The -qdfp option is required to process DFP code in headers.</h1> <h1>else</h1>
3,549
<p>I'm developing a website. I'm using a single-page web-app style, so all of the different parts of the site are AJAX'd into index.php. When a user logs in and tells Firefox to remember his username and password, all input boxes on the site get auto-filled with that username and password. This is a problem on the form...
<p>From Mozilla's documentation </p> <pre><code>&lt;form name="form1" id="form1" method="post" autocomplete="off" action="http://www.example.com/form.cgi"&gt; [...] &lt;/form&gt; </code></pre> <p><a href="http://developer.mozilla.org/en/How_to_Turn_Off_Form_Autocompletion" rel="noreferrer">http://developer.mozilla....
<p>are all your input boxes set to type=password? That would do it. One of the things you can do, and I'm not at all sure that this is the best answer is to leave input box as an input type and just use javascript and onkeydown event to place stars in the input box instead of having the browser render it. Firefox won...
7,307
<p>Tomcat fails to start even if i remove all my applications from the WEBAPPS directory leaving everything just like after the OS installation.</p> <p>The log (catalina.out) says:</p> <pre><code>Using CATALINA_BASE: /usr/share/tomcat5 Using CATALINA_HOME: /usr/share/tomcat5 Using CATALINA_TMPDIR: /usr/share/tomc...
<p>Seems like you've implemented a JMX service and tried to install it on your server.xml file but forgot to add the apache commons modeler jar to the server/lib directory (therefore the <code>ClassNotFoundException</code> for <code>org.apache.commons.modeler.Registry</code>). Check your server.xml file for anything yo...
<p>This screams class path issue, to me. Where exactly is your tomcat installed? (Give us command line printouts of where the home directory is.) Also, how are you starting it?</p>
8,788
<p>What are the differences, and pros &amp; cons, between 3D printers with varying layouts for moving head vs. moving build plate?</p> <p>Example layouts would include:</p> <ul> <li>X Head; YZ Bed; </li> <li>XY Head; Z Bed; </li> <li>XYZ Head; </li> <li>etc.</li> </ul> <p>In particular, what are their respective...
<p>Without going into too much detail, since this is a very exhaustive topic, I'll write some pro's of each down from the top of my head:</p> <p>Cartesian XZ hotend, Y bed (eg. Prusa Mendel):</p> <ul> <li>easy to build (relatively)</li> <li>easy to maintain</li> <li>easy to modify</li> <li>understandable kinematics</...
<p>I think this is simple, breaking it into simple parts... It is much easier to calibrate a machine where each axis does one thing. For instance, the Ultimaker; one of the few XY-on-the-same-axis printers... It has such a crazy complicated pulley system. If one thing gets out of whack, everything will start binding. T...
319
<p>Is there a programmatic way to build <em>htpasswd</em> files, without depending on OS specific functions (i.e. <code>exec()</code>, <code>passthru()</code>)?</p>
<p>.httpasswd files are just text files with a specific format depending on the hash function specified. If you are using MD5 they look like this:</p> <pre><code>foo:$apr1$y1cXxW5l$3vapv2yyCXaYz8zGoXj241 </code></pre> <p>That's the login, a colon, ,$apr1$, the salt and 1000 times md5 encoded as base64. If you select ...
<p><a href="http://trac.edgewall.org" rel="nofollow noreferrer">Trac</a> ships with a Python replacement for htpasswd, which I'm sure you could port to your language of choice: <a href="http://trac.edgewall.org/browser/trunk/contrib/htpasswd.py" rel="nofollow noreferrer">htpasswd.py</a>.</p>
6,111
<p>When sockets are created or files are opened/created in C, is the file descriptor that's assigned to the socket/file guaranteed to be the lowest-valued descriptor available? What does the C spec say about file descriptor assignment in this regard, if anything?</p>
<p>It's not guaranteed to be the lowest, and is implementation dependent <em>(1)</em>. In general, however, the routine that assigns open file descriptors uses a method that gives you the first open on. It could be that immediately after several lower ones free, leaving you with a higher descriptor than you might exp...
<p>Steve M is right; C has no notion of sockets, and its file I/O functions use a [pointer to a] FILE object, not a descriptor.</p>
7,479
<p>I need to display an error message on rejecting a drop in my application.</p> <p>I tried this in the <code>OnDrop()</code> but then the source application hangs until my message box is dismissed.</p> <p>How can I do that?</p>
<p>You can always call PostMessage with a private message in the WM_APP range and in the message handler show the error.</p> <p>That way you show the error after the drag and drop operation is really over and there is no danger of messing up anything.</p>
<p>You're right. But all the data I need to report in the message box is in the OnDrop.</p>
7,164
<p>We were offered to <a href="https://3dprinting.meta.stackexchange.com/questions/314/can-we-get-mathjax-enabled">get MathJax enabled</a>.</p> <p>Now, we need to decide on which character to have text between them parsed into MathJax! So please either add your suggestion or cast your vote!</p>
<p>Let's stay with the classic $.</p> <p>Example: \$\$\frac{1 \times 2}{2} = 1\$\$</p> <hr> <p><em>Now that MathJax is enabled, it renders to: $$\frac{1 \times 2}{2} = 1$$</em></p>
<p>An alternative character could be the Tilde <code>~</code>.</p>
59
<p>I have a console app that needs to display the state of items, but rather than having text scroll by like mad I'd rather see the current status keep showing up on the same lines. For the sake of example:</p> <blockquote> <p><code>Running... nn% complete</code><br> <code>Buffer size: bbbb bytes</code></p> </bl...
<p>You can use <a href="http://msdn.microsoft.com/en-us/library/ms686025.aspx" rel="noreferrer">SetConsoleCursorPosition</a>. You'll need to call <a href="http://msdn.microsoft.com/en-us/library/ms683231.aspx" rel="noreferrer">GetStdHandle</a> to get a handle to the output buffer.</p>
<p>In Linux, you can accomplish this by printing \b and/or \r to stderr. You might need to experiment to find the right combination of things in Windows.</p>
6,713
<p>For a science project, I'm 3D-printing some custom pipes and tubes to regulate the flow of gas (a combination of ethyl alcohol and water vapor) through an apparatus. They need to be pretty small, as the entire experiment is designed on a small scale. I'd also like the use a little filament as possible.</p> <p>How t...
<p>The thinnest wall your printer can print is determined by its nozzle size, and will be a little thicker than that nozzle size.</p> <p>A great challenge when dealing with thin, hollow cylinders is that the cross-section has very little surface area and it can delaminate easily, especially if the tube is long.</p> <...
<p>This is difficult to give a definitive answer, but I have some thoughts.</p> <p>For a vertical wall, the minimum thickness is determined by your nozzle size, typically 0.4mm. If you are able to print entirely in a vertical orientation (a pipe standing on end), you may consider using "vase mode" with no top or botto...
135
<p>This is a question I asked on another forum which received some decent answers, but I wanted to see if anyone here has more insight.</p> <p>The problem is that you have one of your pages in a web application timing out when it gets to a stored procedure call, so you use Sql Profiler, or your application trace logs,...
<p>This is what I've learned so far from my research.</p> <p>.NET sends in connection settings that are not the same as what you get when you log in to management studio. Here is what you see if you sniff the connection with Sql Profiler:</p> <pre><code>-- network protocol: TCP/IP set quoted_identifier off set a...
<p>Try changing the SelectCommand timeout value:</p> <pre><code>DataAdapter.SelectCommand.CommandTimeout = 120; </code></pre>
3,127
<p><strong>Update:</strong> Check out this follow-up question: <a href="https://stackoverflow.com/questions/134581/gem-update-on-windows-is-it-broken"><strong>Gem Update on Windows - is it broken?</strong></a></p> <hr> <p>On Windows, when I do this:</p> <pre><code>gem install sqlite3-ruby </code></pre> <p>I get the...
<p>As Nathan suggests, this does appear to be related to the fact that the latest versions of the sqlite3-ruby and hpricot gems don't appear to have Windows versions. Here's what to do when faced with this situation (note, the name of the gem is automatically wildcarded, so you can type just <em>sql</em> and get a list...
<p>I also ran into this problem. It's worth knowing that the difference between 1.2.3 and 1.2.4 is not significant. Here are the 1.2.4. release notes:</p> <blockquote> <p><strong>Release Name: 1.2.4</strong></p> <p>Notes: This release only updates the generated C file to reflect the compatibility changes...
6,537
<p>How do I convert the value of a PHP variable to string?</p> <p>I was looking for something better than concatenating with an empty string:</p> <pre><code>$myText = $myVar . ''; </code></pre> <p>Like the <code>ToString()</code> method in Java or .NET.</p>
<p>You can use the <a href="http://us3.php.net/manual/en/language.types.type-juggling.php" rel="noreferrer">casting operators</a>:</p> <pre><code>$myText = (string)$myVar; </code></pre> <p>There are more details for string casting and conversion in the <a href="http://us3.php.net/manual/en/language.types.string.php#l...
<p>I use <a href="https://github.com/lingtalfi/VariableToString" rel="nofollow noreferrer">variableToString</a>. It handles every PHP type and is flexible (you can extend it if you want).</p>
4,775
<p>When a script is saved as a bundle, it can use the <code>localized string</code> command to find the appropriate string, e.g. in <code>Contents/Resources/English.lproj/Localizable.strings</code>. If this is a format string, what is the best way to fill in the placeholders? In other words, what is the AppleScript equ...
<p><a href="https://developer.apple.com/library/content/releasenotes/AppleScript/RN-AppleScript/RN-10_10/RN-10_10.html" rel="nofollow noreferrer">Since OS X 10.10</a>, it’s been possible for any AppleScript script to use Objective-C. There are a few ways to call Objective-C methods from within AppleScript, as detailed ...
<p>As ugly as it is, calling out to <code>printf(1)</code> is the common solution.</p> <p>A cleaner, though somewhat more complex, solution is to use AppleScript Studio, which allows you to call into Objective-C objects/classes from your AppleScript code with the <code>call method</code> syntax documented <a href="htt...
8,963
<p>On linux, it's possible to create a tun interface using a tun driver which provides a "network interface psuedo-device" that can be treated as a regular network interface. Is there a way to do this programmatically on windows? Is there a way to do this without writing my own driver? </p>
<p>You can do this on XP with the <a href="https://web.archive.org/web/20150217152013/http://support.microsoft.com/kb/839013" rel="nofollow noreferrer">Microsoft Loopback Adapter</a> which is a driver for a virtual network card.</p> <p>On newer Windows version: <a href="https://support.microsoft.com/en-gb/help/2777200...
<p>In the Singularity project, Microsoft research communicates with the singularity VM through a "loopback" adapter. Maybe that'd help? </p> <p>Running it is easy so it may be something fun to do anyway. :)</p> <p><a href="http://research.microsoft.com/os/Singularity/" rel="nofollow noreferrer">http://research.micros...
7,015
<p>I am attempting to set an asp.net textbox to a SQL 2005 money data type field, the initial result displayed to the user is 40.0000 instead of 40.00. In my asp.net textbox control I would like to only display the first 2 numbers after the decimal point e.g. 40.00</p> <p>What would be the best way to do this? My code...
<pre><code>this.txtPayment.Text = string.Format("{0:c}", dr[Payment"].ToString()); </code></pre>
<p>Use the <em>ToString</em> method with "c" to format it as currency.</p> <pre><code>this.txtPayment.Text = dr["Payment"].ToString("c"); </code></pre> <p><a href="http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx" rel="nofollow noreferrer">Standard Numeric Format Strings</a></p>
5,951
<p>I'm writing an app that will need to make use of <code>Timer</code>s, but potentially very many of them. How scalable is the <code>System.Threading.Timer</code> class? The documentation merely say it's "lightweight", but doesn't explain further. Do these timers get sucked into a single thread (or very small threa...
<p>I say this in response to a lot of questions: Don't forget that the (managed) source code to the framework is available. You can use this tool to get it all: <a href="http://www.codeplex.com/NetMassDownloader" rel="noreferrer">http://www.codeplex.com/NetMassDownloader</a></p> <p>Unfortunately, in this specific ca...
<p>^^ as DannySmurf says : Consolidate them. Create a timer service and ask that for the timers. It will only need to keep 1 active timer (for the next due call) and a history of all the timer requests and recalculate this on AddTimer() / RemoveTimer().</p>
5,154
<p>I'm working on a windows forms application (C#) where a user is entering data in a form. At any point while editing the data in the form the user can click one of the buttons on the form to perform certain actions. By default the focus goes to the clicked button so the user has to click back on to the control they...
<p>For a bit of 'simplicity' maybe try.</p> <pre><code>public Form1() { InitializeComponent(); foreach (Control ctrl in Controls) { if (ctrl is TextBox) { ctrl.Enter += delegate(object sender, EventArgs e) { ...
<p>Your implementation looks good enough -- what I do want to know is why you want to do this in the first place? Won't it be preferrable for the focus to cycle back to the first entry? Is the data in the last text box so malleable that once they click the button it is "remembered"? Or do you have some sort of operatio...
5,797
<p>Ok, do you do <code>Business.Name</code> or <code>Business.BusinessName</code> <code>SubCategory.ID</code> or <code>SubCategory.SubCategoryID</code></p> <p>What about in your database?</p> <p>Why?</p> <p>I'm torn with both. Would love there to be a "right answer"</p>
<p>The only "right" answer is to be consistent. Decide upfront which one you will be using in a project, and stick to it.</p>
<p>For very common properties like "Name" and "ID", the convention I have used is to not put the entity name in the field. For more unusual properties, I do put the entity name.</p> <p>This is a naming convention decision, but I have not regretted projects where this is the convention, if you put the name of the enti...
6,626
<p>I would like to sort an array in ascending order using <code>C/C++</code>. The outcome is an array containing element indexes. Each index is corespondent to the element location in the sorted array.</p> <p><strong>Example</strong></p> <pre><code>Input: 1, 3, 4, 9, 6 Output: 1, 2, 3, 5, 4 </code></pre> <p><strong>Ed...
<p>Since you're using C++, I would do it something like this. The <code>SortIntPointers</code> function can be any sort algorithm, the important part is that it sorts the array of pointers based on the <code>int</code> that they are pointing to. Once that is done, you can go through the array of pointers and assign the...
<p>Well, there's a trival n^2 solution.</p> <p>In python:</p> <pre><code>newArray = sorted(oldArray) blankArray = [0] * len(oldArray) for i in xrange(len(newArray)): dex = oldArray.index(newArray[i]) blankArray[dex] = i </code></pre> <p>Depending on how large your list is, this may work. If your list is very lo...
3,441
<p>I found a story about someone <a href="http://www.fablabamersfoort.nl/en/node/534">3D-printing equipment for their Lego minifig</a>, using an Ultimaker. (Article is in Dutch, but accompanied by photographs).</p> <p>I noticed that what they made weren't the actual connecting bricks, but the tools used by the minifig...
<p>It's really more about calibration than resolution -- a poorly calibrated printer will have dimension errors that prevent mating with true LEGO bricks or other printed bricks. </p> <p>Also, "resolution" is an incredibly loaded term for 3d printers, because it can mean a lot of different things. But we don't need to...
<p>I have notes about printing Lego bricks here:</p> <blockquote> <p><a href="https://www.thingiverse.com/thing:3424550" rel="nofollow noreferrer">https://www.thingiverse.com/thing:3424550</a></p> </blockquote> <p>The upshot is, you want to align the wall thickness of your brick model edges to match an exact multip...
159
<p>I'm quite new to 3D CAD and printing. I own a Dremel 3D45 and I use FreeCad / Ultimaker Cura as softwares.</p> <p>My question is pretty simple. Say you have to make one object with a pin and another with a hole. They should be coupled together. Of course if you set the diameters of the pin and the hole equal the won...
<blockquote> <p>I guess this tolerance (0.4 mm in my example) depends on a lot of variables: 3D printer settings, material, etc... so it may change using different setup.</p> </blockquote> <p>Tolerances required <strong>depend on the geometry you're printing</strong>. A hole that is horizontal, vertical, or diagonal wi...
<blockquote> <p>I guess this tolerance (0.4 mm in my example) depends on a lot of variables: 3D printer settings, material, etc... so it may change using different setup.</p> </blockquote> <p>Yes, this is true, you need to find out for yourself on your rig. Fine tune the printer. Note that filament also shrinks, althou...
2,182
<p>I have a large database of normalized order data that is becoming very slow to query for reporting. Many of the queries that I use in reports join five or six tables and are having to examine tens or hundreds of thousands of lines.</p> <p>There are lots of queries and most have been optimized as much as possible t...
<p>I know more about mssql that mysql, but I don't think the number of joins or number of rows you are talking about should cause you too many problems with the correct indexes in place. Have you analyzed the query plan to see if you are missing any?</p> <p><a href="http://dev.mysql.com/doc/refman/5.0/en/explain.html...
<p>You might also want to consider selecting into a temporary table and then performing queries on that temporary table. This would avoid the need to rejoin your tables for every single query you issue (assuming that you can use the temporary table for numerous queries, of course). This basically gives you denormaliz...
3,396
<p>We're working on a Log Viewer. The use will have the option to filter by user, severity, etc. In the Sql days I'd add to the query string, but I want to do it with Linq. How can I conditionally add where-clauses?</p>
<p>if you want to only filter if certain criteria is passed, do something like this</p> <pre><code>var logs = from log in context.Logs select log; if (filterBySeverity) logs = logs.Where(p =&gt; p.Severity == severity); if (filterByUser) logs = logs.Where(p =&gt; p.User == user); </code></pre> <p...
<p>Just use C#'s &amp;&amp; operator:</p> <pre><code>var items = dc.Users.Where(l =&gt; l.Date == DateTime.Today &amp;&amp; l.Severity == "Critical") </code></pre> <p>Edit: Ah, need to read more carefully. You wanted to know how to <em>conditionally</em> add additional clauses. In that case, I have no idea. :) What I...
3,235
<p>In a web application, is it acceptable to use HTML in your code (non-scripted languages, Java, .NET)?</p> <p>There are two major sub questions:</p> <ol> <li>Should you use code to print HTML, or otherwise directly create HTML that is displayed?</li> <li>Should you mix code within your HTML pages?</li> </ol>
<p>Generally, it's better to keep presentation (HTML) separate from logic ("back-end" code). Your code is decoupled and easier to maintain this way.</p>
<p>Its fugly, and not type safe. But people do it without consequence. I'd prefer using a DOM or, at a minimum, classes designed to write HTML using type safe semantics. Also, its not all that good to mix UI with logic...</p>
9,035
<p>Looking for something to smooth out a PLA print. Would Mod Podge be a good solution? Will it stick? </p>
<p>From what I've read about Mod Podge, it is an adhesive with a vinyl acetate base. As such it is similar to both PVA (used for wash-away support) and ordinary white glue. One of the more common references to the product refers to it not being water proof, although the outdoor version of the product presents as being ...
<p>I have used Ponal Express, a woodglue, as a smoothing layer inbetween a somewhat sanded PLA and an acrylic paint. It had a good result to get it almost perfectly smooth. It stuck quite well, no problem with it getting off under painting. DO note though, that sanding the glue layer can tear of larger pieces of the fi...
1,567
<p>What resources or methods would OpenSCAD users suggest to piece together disparate STL files?</p> <p>I'd like to take an existing STL model-library of STL parts (head, torso, arms, legs) and make it a Thingiverse OpenSTL maker, similar to the castle generator and/or the puzzle generators available.</p> <p>This way...
<p>Cura prior to version 2.5 does not take G-code as an input. I'm not sure what you mean by "print only using Cura." Don't you have a SD slot on your control board? For that matter, why can't you drive the USB port from Slic3r? </p> <p>Remember: G-code is the equivalent of "compiled code," the raw commands which dri...
<p>Cura prior to version 2.5 does not take G-code as an input. I'm not sure what you mean by "print only using Cura." Don't you have a SD slot on your control board? For that matter, why can't you drive the USB port from Slic3r? </p> <p>Remember: G-code is the equivalent of "compiled code," the raw commands which dri...
449
<p>I am using jQuery and trying to find a cross browser way to get the pixel coordinates of the caret in <code>&lt;textarea&gt;</code>s and <code>input</code> boxes such that I can place an absolutely positioned div around this location.</p> <p>Is there some jQuery plugin? Or JavaScript snippet to do just that?</p>
<p>I've looked for a textarea caret coordinates plugin for <a href="https://github.com/mizzao/meteor-autocomplete" rel="noreferrer">meteor-autocomplete</a>, so I've evaluated all the 8 plugins on GitHub. The winner is, by far, <a href="https://github.com/component/textarea-caret-position" rel="noreferrer">textarea-care...
<p>Note: this answer describes how to get the <strong>character co-ordinates</strong> of the text-cursor/caret. To find the pixel-co-ordinates, you'll need to extend this further.</p> <p>The first thing to remember is that the cursor can be in three states</p> <ul> <li>a regular insertion cursor at a specific positio...
4,946
<p>I am running a MakerBot Replicator 2. During the print, the printer just stops executing and I am running out of ways to troubleshoot.</p> <p>After restarting, I can load and extrude filament.</p> <p>I have replaced the SD card, and even borrowed one from another working replicator, and the freeze still occurs.</p...
<p>There are a few options. First your board could be overheating etc. That is harder to verify without some overpriced replacements. So to start lets take everything apart (photo and labeling is Strongly recommended). Then simply put it back together. Hopefully it is just a loose connection.</p>
<p>Seems like others have had similar issues: <a href="https://www.thingiverse.com/groups/engineering/topic:3849" rel="nofollow noreferrer">https://www.thingiverse.com/groups/engineering/topic:3849</a>. Their issue was a bit more mechanical than firmware, though. I hope this helps!</p> <p>You might also want to check ...
474
<p>What tools, preferably open source, are recommended for driving an automated test suite on a FLEX based web application? The same tool also having built in capabilities to drive Web Services would be nice.</p>
<p>Adobe distributes a test framework themselves: <a href="http://opensource.adobe.com/wiki/display/flexunit/FlexUnit" rel="noreferrer">FlexUnit</a>.</p>
<p>My preferred tool is Selenium Remote Control. There is a plug-in I discovered a few months ago:</p> <p><a href="http://code.google.com/p/flash-selenium/" rel="nofollow noreferrer">http://code.google.com/p/flash-selenium/</a></p> <p>This required 'hooks' to be written on the server side (ActionScript/Flex). Once ...
9,807
<p>Is there a mod_rewrite equivalent for IIS 7.0 that's </p> <p>a) more or less complete </p> <p>b) suitable for a production environment, i.e. battle-tested/dependable/secure</p> <p>Do you have an experience-based recommendation?</p>
<p>Check out the <a href="http://www.iis.net/downloads/microsoft/url-rewrite" rel="noreferrer">URL Rewrite Module for IIS 7</a> created by Microsoft</p>
<p><a href="http://www.isapirewrite.com/" rel="nofollow noreferrer">ISAPI Rewrite</a> is suitable for IIS 5 or 6. There's a Lite version available for free, or you can pay for the full version to get more features, such as proxying capabilities. It's been a while since I've used it, but it worked fine at the time.</p>
8,590
<p>I have the FlashForge Dreamer NX which prints with good quality on small models. However, when the model is taller than 2 cm or 2.5 cm (around 0.8 or 1 inch), it really loses quality.</p> <p>Here there is a picture so you can understand what I mean. Which setting do I have to change? Have a look the the base is very...
<p>The cause of the meshing is under-extrusion. When under-extrusion happens, several problems can cause this. E.g. heat creep (probably not the issue here because heat creep is usually not recoverable, but not unimaginable since this is an enclosed printer, you could try printing at a lower temperature and look into l...
<p>That looks horribly familiar; I call it meshing.</p> <p>It's underextrusion, which can be caused by lots of things.</p> <p>I cleaned, then replaced the hot end, Bowden tube, and both couplers trying to solve the problem, but then the Z axis was binding. Tried a couple things for that, what seems to have worked was ...
2,012
<p>Is there a method (other than trial and error) I can use to find unused image files? How about CSS declarations for ID's and Classes that don't even exist in the site?</p> <p>It seems like there might be a way to write a script that scans the site, profile it, and see which images and styles are never loaded.</p>
<p>You don't have to pay any web service or search for an addon, you already have this in Google Chrome under F12 <code>(Inspector)-&gt;Audits-&gt;Remove unused CSS rules</code></p> <p>Screenshot:<img src="https://i.stack.imgur.com/Soozt.png" alt="Screenshot"></p> <p><strong>Update: 30 Jun, 2017</strong></p> <p>Now ...
<p>This little tool gives you a list of the css rules in use by some html.</p> <p>Here it is on <a href="http://codepen.io/tmorrow-hyphensolutions/pen/GprdRQ" rel="nofollow">Code Pen</a></p> <p>Click on <kbd>Run code snippet</kbd>, then click on <kbd>Full page</kbd> to get in to it. Then follow the instructions in th...
5,326
<p>I am printing small mechanical pieces in ABS:</p> <ul> <li>100 ºC bed temperature</li> <li>70 ºC Room temperature</li> <li>250 ºC nozzle temperature</li> <li>0.4 mm nozzle, at 0.15 mm per layer.</li> <li>100.8 % scale to compensate ABS dimensional innacuracy.</li> </ul> <p>The first layer is printed correctly, but l...
<p>The up-curling of overhangs is frequently seen when printing PLA or PETG when the just deposited layer hasn't been cooled enough. The residual heat will allow the curling as the plastic has not been fully set (above the so called glass temperature) because of insufficient part cooling.</p> <p>Knowing that ABS doesn'...
<p>We usually stick the masking tape on the printer's bottom plate, so that the model is formed on the side of the masking tape which without glue, which looks good. When there is no masking tape, we sometimes manually adjust the height of the bottom plate to make the nozzle appress to the bottom plate when printing th...
1,719
<p>Exceptions in C++ don't need to be caught (no compile time errors) by the calling function. So it's up to developer's judgment whether to catch them using try/catch (unlike in Java).</p> <p>Is there a way one can ensure that the exceptions thrown are always caught using try/catch by the calling function?</p>
<p>No.</p> <p>See <a href="http://www.gotw.ca/publications/mill22.htm" rel="noreferrer">A Pragmatic Look at Exception Specifications</a> for reasons why not. </p> <p>The only way you can "help" this is to document the exceptions your function can throw, say as a comment in the header file declaring it. This is not en...
<p>Or you could start throwing critical exceptions. Surely, an access violation exception will <em>catch</em> your users' attention.</p>
2,353
<p>Is there a simple way, in a pretty standard UNIX environment with bash, to run a command to delete all but the most recent X files from a directory?</p> <p>To give a bit more of a concrete example, imagine some cron job writing out a file (say, a log file or a tar-ed up backup) to a directory every hour. I'd like a...
<p>The problems with the existing answers:</p> <ul> <li>inability to handle filenames with embedded spaces or newlines. <ul> <li>in the case of solutions that invoke <code>rm</code> directly on an unquoted command substitution (<code>rm `...`</code>), there's an added risk of unintended globbing.</li> </ul> </li> <li>i...
<pre><code>leaveCount=5 fileCount=$(ls -1 *.log | wc -l) tailCount=$((fileCount - leaveCount)) # avoid negative tail argument [[ $tailCount &lt; 0 ]] &amp;&amp; tailCount=0 ls -t *.log | tail -$tailCount | xargs rm -f </code></pre>
4,538
<p>I have been using Castle MonoRail for the last two years, but in a new job I am going to be the one to bring in ASP.NET MVC with me. <br /></p> <p>I understand the basics of views, actions and the like. <br />I just need a good sample for someone with MVC experience. <br /> Any good links besides Scott's Northwind ...
<p><a href="http://code.google.com/p/codecampserver/" rel="noreferrer">CodeCampServer</a> - Built with ASP.NET MVC, pretty light and small project. No cruft at all.</p> <p>@lomaxx - Just FYI, most of what Troy Goode wrote is now part of <a href="http://weblogs.asp.net/scottgu/archive/2008/07/14/asp-net-mvc-preview-4-...
<p>Check out some of these:</p> <ul> <li><a href="http://www.codeplex.com/mvcpress" rel="nofollow noreferrer">MVCPress/Blog</a></li> <li><a href="http://www.codeplex.com/CarTrackr/Release/ProjectReleases.aspx?ReleaseId=18356" rel="nofollow noreferrer">CarTrackr</a></li> <li><a href="http://haacked.com/archive/2008/11/...
5,133
<p>Marlin has a <a href="http://marlinfw.org/tools/lin_advance/k-factor.html" rel="nofollow noreferrer">Linear Advance calibration pattern generator</a>, but I find it's hard to use because:</p> <ul> <li>It only prints the initial layer on the bed, where bed irregularities interfere with accurate reading of it.</li> <...
<p>I measured mine with a thread gauge and it says the pitch is <strong>0.7 mm</strong>.</p> <p>So, as the stock adjustment wheels have 14 bumps around their circumference, turning by one of those is an adjustment of exactly 0.05 mm (assuming no backlash).</p> <p>I can't speak for anyone else's, but due to the availabi...
<p>I don't know what the value is, but there are a few ways to find out. It is very hard to measure this with a caliper, but it can be done, mark the upper and bottom of e.g. 10 windings and measure this with a caliper. Alternatively measure how much the screw drops after 10 full turns. </p> <p>There are special tools...
1,572
<p>I'm having trouble getting a rotary encoder to work properly with AVR micro controllers. The encoder is a mechanical <a href="http://no.farnell.com/1520815/passives/product.us0?sku=alps-ec12d1524401" rel="noreferrer">ALPS encoder</a>, and I'm using <a href="http://www.atmel.com/dyn/resources/prod_documents/doc2545.p...
<p>I have a webpage about <a href="http://www.ubasics.com/adam/electronics/doc/rotryenc.shtml" rel="nofollow noreferrer">rotary encoders and how to use them</a>, which you might find useful.</p> <p>Unfortunately without more information I can't troubleshoot your particular problem. </p> <p>Which microcontroller pins ...
<p>What exactly are you having problems with? I assume you've been able to hook the pins of the encoder to your PIC as per the technical specifications linked on the Farnell page you gave, so is the problem with reading the data? Do you not get any data from the encoder? Do you not know how to interpret the data you're...
5,512
<p>What recommendations can you give for a system which must do the following:</p> <p>Load Plugins (and eventually execute them) but have 2 methods of loading these plugins:</p> <ul> <li>Load only authorized plugins (developed by the owner of the software) </li> <li>Load all plugins</li> </ul> <p>And we need to be ...
<p>This is all described in <a href="http://livedocs.adobe.com/flex/3/progAS_flex3.pdf" rel="nofollow noreferrer">The Adobe Flex 3 Programming ActionScript 3 PDF</a> on page 550 (Chapter 27: Flash Player Security / Cross-scripting):</p> <blockquote> <p>If two SWF files written with ActionScript 3.0 are served from d...
<p>Mayhaps <a href="http://livedocs.adobe.com/flex/15/flex_docs_en/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flex_Documentation&amp;file=00001750.htm" rel="nofollow noreferrer" title="Flex Documentation: System.Security.allowDomain">System.Security.allowDomain</a> is what you need?</p>
3,512
<p>If I'm adding a column to a table in Microsoft SQL Server, can I control where the column is displayed logically in queries?</p> <p>I don't want to mess with the physical layout of columns on disk, but I would like to logically group columns together when possible so that tools like SQL Server Management Studio lis...
<p>You can not do this programatically (in a safe way that is) without creating a new table. </p> <p>What Enterprise Manager does when you commit a reordering is to create a new table, move the data and then delete the old table and rename the new table to the existing name. </p> <p>If you want your columns in a p...
<p>It can be done using SQL, by modifying the system tables directly. For example, look here:</p> <p><a href="http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=58912" rel="nofollow noreferrer">Alter table - Add new column in between</a></p> <p>However, I would not recommend playing with system tables, unless it's abso...
2,394
<p>I just saw <a href="http://www.codeplex.com/CloneDetectiveVS" rel="nofollow noreferrer">Clone Detective</a> linked on YCombinator news, and the idea heavily appeals to me. It seems like it would be useful for many languages, not just C#, but I haven't seen anything similar elsewhere.</p> <p>Edit: For those who don'...
<p>I don't think this is a concern.</p> <p>Yes, the mythical "somebody" can replace the implementation of MD5 with something insecure. But in order to do that, the mythical somebody must actually be able to get his code into the Ruby process. And if he can do that, then he presumably could also inject his code into a ...
<p>If someone monkeypatched an object or a module, then you need to look at 2 cases: He added a new method. If he is the only one adding this meyhod (which is very likely), then no problems arise. If he is not the only one, you need to see if both methods do the same and tell the library developer about this severe pr...
5,224
<p><a href="https://i.stack.imgur.com/rtG5C.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rtG5C.jpg" alt="enter image description here"></a> <a href="https://i.stack.imgur.com/i1oaO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i1oaO.jpg" alt="enter image description here"></a>...
<p>In Ultimaker Cura you can select only one of the the build plate adhesion options skirt, brim or raft. You cannot select multiple options. </p> <p>There is no option available in Ultimaker Cura to increase the outline count of the raft bed adhesion structure. Basically the raft exists of a line support structure as...
<p>It's not necessarily the case that the apparent underextrusion of a small portion of your raft is the root cause. ABS is notorious for shrinkage and peeling. As a start, you should have a full enclosure so as to maintain a warm environment while printing. </p> <p>It's also quite possible that your bed is slight...
1,084
<p>In my web app, I submit some form fields with jQuery's <code>$.getJSON()</code> method. I am having some problems with the encoding. The character-set of my app is <code>charset=ISO-8859-1</code>, but I think these fields are submitted with <code>UTF-8</code>. </p> <p>How I can set encoding used in <code>$.getJSON<...
<p>I think that you'll probably have to use <a href="http://docs.jquery.com/Ajax/jQuery.ajax#options" rel="noreferrer"><code>$.ajax()</code></a> if you want to change the encoding, see the <code>contentType</code> param below (the <code>success</code> and <code>error</code> callbacks assume you have <code>&lt;div id="s...
<p>Use this function to regain the utf-8 characters</p> <pre><code>function decode_utf8(s) { return decodeURIComponent(escape(s)); } </code></pre> <p>Example: var new_Str=decode_utf8(str);</p>
4,617
<p>I am getting the below error and call stack at the same time everyday after several hours of application use. Can anyone shed some light on what is happening?</p> <pre><code>System.InvalidOperationException: BufferedGraphicsContext cannot be disposed of because a buffer operation is currently in progress. at Syste...
<p>There is a very long MSDN forums discussion of this error <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=200483&amp;SiteID=1" rel="nofollow noreferrer">here</a>. In most cases the error is apparently associated with either:</p> <ol> <li>An underlying OutOfMemory problem, which manifests as the Buffe...
<p>a shot in the dark - are you painting from multiple threads? If you are doing painting related work, do it on the GUI thread or synchronize your code carefully.</p>
8,216
<p>How can I go about storing a vb.net user defined object in a sql database. I am not trying to replicate the properties with columns. I mean something along the lines of converting or encoding my object to a byte array and then storing that in a field in the db. Like when you store an instance of an object in session...
<p>You can use <a href="http://msdn.microsoft.com/en-us/library/ms973893.aspx" rel="nofollow noreferrer">serialization</a> - it allows you to store your object at least in 3 forms: binary (suitable for BLOBs), XML (take advantage of MSSQL's XML data type) or just plain text (store in varchar or text column) </p>
<p>@aku, lomaxx and bdukes - your solutions are what I was looking for. </p> <p>@1800 INFORMATION - while i appreciate your stance on the matter, this is a special case of data that I get from a webservice that gets refreshed only about once a month. I dont need the data persisted in db form because thats what the web...
6,216
<p>It may not be best practice but are there ways of removing unsused classes from a third party's jar files. Something that looks at the way in which my classes are using the library and does some kind of coverage analysis, then spits out another jar with all of the untouched classes removed.</p> <p>Obviously there ...
<p>There is a way.</p> <p>The JarJar project does this AFAIR. The first goal of the JarJar project is to allow one to embed third party libraries in your own jar, changing the package structure if necessary. Doing so it can strip out the classes that are not needed.</p> <p>Check it out at <a href="http://code.google....
<p>jar is just a zip file, so I guess you can. If you could get to the source, it's cleaner. Maybe try disassembling the class?</p>
5,921