instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>I'm thinking that the reason I can't do this is because it might be a huge security hole, but here goes...</p> <p>I want to have a bookmark on my browser (FF3, preferably) that is only a snippet of javascript code. It would merely construct a URL based on the current date and then do a window.location = on that UR...
<p>What you want is a <a href="http://en.wikipedia.org/wiki/Bookmarklet" rel="noreferrer">bookmarklet</a> they are easy to create and should work in most major browsers.</p> <p>Edit: Stack overflow seems not to allow creating bookmarklets in the context of the site, basically you can create a new bookmark and type the...
<p>Well, I just created a bookmark in FF3, went back and updated it and added the following test:</p> <pre><code>javascript:alert('Wacky%20test%20yo'); </code></pre> <p>Low and behold, after I saved and loaded, I was able to get my alert.</p> <p>I'm sure you can work up something similar for your needs.</p>
3,057
<p>After reading <a href="https://stackoverflow.com/questions/63668/confessions-of-your-worst-wtf-moment-what-not-to-do#63730">this answer</a>, I wonder if there's a way to get a "testing" credit card number. One that you can experiment with but that doesn't actually charge anything.</p>
<pre><code>MasterCard: 5431111111111111 Amex: 341111111111111 Discover: 6011601160116611 American Express (15 digits) 378282246310005 American Express (15 digits) 371449635398431 American Express Corporate (15 digits) 378734493671000 Diners Club (14 digits) 30569309025904 Diners Club (14 digits) 38520000023237 Disc...
<p>Most payment processors provide either a testing number (PayPal does this) or the ability to go into testing mode (in which no transactions actually get processed). Consult the documentation.</p>
9,242
<p>I am going to be using C/C++, and would like to know the best way to talk to a MySQL server. Should I use the library that comes with the server installation? Are they any good libraries I should consider other than the official one?</p>
<p><a href="http://tangentsoft.net/mysql++/" rel="nofollow noreferrer">MySQL++</a></p>
<p>That depends a bit on what you want to do.</p> <p>First, check out libraries that provide connectivity to more than on DBMS platform. For example, Qt makes it very easy to connect to MySQL, MS SQL Server and a bunch of others, and change the database driver (connection type) at runtime - with just a few lines of co...
4,291
<p>I have a library I created,</p> <h3>File <em>mylib.c:</em></h3> <pre><code>#include &lt;mylib.h&gt; int testlib() { printf(&quot;Hello, World!\n&quot;); return (0); } </code></pre> <h3>File <em>mylib.h:</em></h3> <pre><code>#include &lt;stdio.h&gt; extern int testlib(); </code></pre> <p>In my program, I've ...
<p>In C <code>int foo()</code> and <code>int foo(void)</code> are different functions. <code>int foo()</code> accepts an arbitrary number of arguments, while <code>int foo(void)</code> accepts 0 arguments. In C++ they mean the same thing. I suggest that you use <code>void</code> consistently when you mean no arguments....
<p>Try:</p> <pre><code>extern int testlib(void); </code></pre>
6,351
<p>I'm using two different libraries in my project, and both of them supply a basic rectangle <code>struct</code>. The problem with this is that there seems to be no way to insert a conversion between the types, so I can't call a function in one library with the result from a function in the other. If I was the author ...
<p>If you can't modify the structures then you have no alternative to writing a manual conversion function because overloading conversion operators only works within the class body. There's no other way.</p>
<p>Maybe you could try it with operator overloading ? (Maybe a = operator which is not a method of your class) ?</p> <p>Rect operator= (const Rect&amp;,const rectangle&amp;)</p> <p>More about this in the C++ programming language by Bjarne Stroustrup or maybe on this page: <a href="http://www.cs.caltech.edu/courses/cs...
4,786
<p>In C# documentation tags allow you to produce output similar to MSDN. What are a list of allowable tags for use inside the /// (triple slash) comment area above classes, methods, and properties?</p>
<p>Check out <a href="http://web.archive.org/web/20100118163744/http://thoughtpad.net/alan-dean/cs-xml-documentation.html" rel="noreferrer">Great documentation on the various C# XML documentation tags.</a> (Go to the bottom to see the tags)</p>
<p>Look inside the docs for <a href="http://blogs.msdn.com/sandcastle/" rel="nofollow noreferrer">Sandcastle</a>. This is the new documentation standard for .NET.</p>
9,160
<p>How do I tell Subversion (svn) to treat a file as a binary file?</p>
<p>It is possible to manually identify a file located within a repository as <em>binary</em> by using:</p> <pre><code>svn propset svn:mime-type application/octet-stream &lt;filename&gt; </code></pre> <p>This is generally not necessary, as Subversion will attempt to determine whether a file is binary when the file is ...
<p>It usually does this by default for you, but if it isn't you need to look into file properties and propset. </p>
9,950
<p>We've got a page with a ton of jQuery (approximately 2000 lines) that we want to trim down b/c it is a maintenance nightmare, and it might be easier to maintain on the server. We've thought about using UpdatePanel for this. However, we don't like the fact that the UpdatePanel is sending the whole page back to the ...
<p>Don't move to UpdatePanels. After coming from jQuery, <a href="http://encosia.com/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/" rel="noreferrer">the drop in performance</a> would be untenable. Especially on a page as complex as yours sounds.</p> <p>If you have 2,000 lines of JavaScript code, the solutio...
<p>Using UpdatePanel force you to use ScriptManager that added tons of scripts in your webpages. UpdatePanel provides you partial postback and not real ajax. If your will run only on a LAN and not internet that's ok, but if your target is internet try refractoring your codes and compress them with some tools before pub...
4,249
<p>So basically I'm building an app for my company and it NEEDS to be built using MS Access and it needs to be built on SQL Server.</p> <p>I've drawn up most of the plans but am having a hard time figuring out a way to handle the auditing system.</p> <p>Since it is being used internally only and you won't even be abl...
<p>Does this work for you?</p> <pre><code> select user_name(),suser_sname() </code></pre> <hr> <p>Doh! I forgot to escape my code.</p>
<p>How many users of the app will there be? Is there possibility of using windows integrated authentication for SQL authentication?</p> <p><strong>Updated</strong>: If you can give each user a SQL login (windows integrated) then you can pickup the logged on user using the SYSTEM_USER function. </p>
3,371
<p>I have string like this</p> <pre><code> /c SomeText\MoreText "Some Text\More Text\Lol" SomeText </code></pre> <p>I want to tokenize it, however I can't just split on the spaces. I've come up with somewhat ugly parser that works, but I'm wondering if anyone has a more elegant design.</p> <p>This is in C# btw.</p> ...
<p>The computer term for what you're doing is <a href="http://en.wikipedia.org/wiki/Lexical_analysis" rel="nofollow noreferrer">lexical analysis</a>; read that for a good summary of this common task.</p> <p>Based on your example, I'm guessing that you want whitespace to separate your words, but stuff in quotation mark...
<p><a href="https://stackoverflow.com/questions/54866/best-way-to-parse-space-seperated-text#54880">Craig</a> is right &#8212; use regular expressions. <a href="http://msdn.microsoft.com/en-us/library/8yttk7sy.aspx" rel="nofollow noreferrer">Regex.Split</a> may be more concise for your needs.</p>
7,851
<p>I am writing some software to identify tracking numbers (in the same way that Google identifies FedEx or UPS numbers when you search for them). Most couriers use a system, such as a "weighted average mod system" which can be used to identify if a number is a valid tracking number. Does anyone know if TNT consignment...
<p>OK, so it's three months since you asked but I stumbled across this as I'm writing a similar piece of software. As far as we know TNT uses the <a href="http://en.wikipedia.org/wiki/S10_(UPU_standard)" rel="nofollow noreferrer">S10</a> tracking number system. Which means that their numbers will be of the type AA#####...
<p>As far as I can tell, there isn't one. Sorry.</p> <p>I take it you're trying to validate the tracking number entered to make sure it was entered properly?</p> <p>-- Kevin Fairchild</p>
8,124
<p>What are some real world places that call for delegates? I'm curious what situations or patterns are present where this method is the best solution. No code required.</p>
<p>As stated in <a href="http://msdn.microsoft.com/en-us/library/orm-9780596521066-01-17.aspx" rel="noreferrer">&quot;Learning C# 3.0: Master the fundamentals of C# 3.0&quot;</a></p> <blockquote> <p><strong>General Scenario:</strong> When a head of state dies, the President of the United States typically does not hav...
<p>A quick google search came up with this <a href="http://en.wikipedia.org/wiki/Delegation_pattern" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Delegation_pattern</a> . Basically, anytime that you use an object that forwards it's calls to another object then you are delegating.</p>
5,145
<p>Is there a terminal program that shows the difference between input, standard output, error output, the prompt, and user-entered commands? It should also show when standard input is needed vs. running a command.</p> <p>One way would be to highlight each differently. The cursor could change color depending on if i...
<p><a href="http://hotwire-shell.org/" rel="nofollow noreferrer">Hotwire</a> could be a good candidate, but it's not doing that out of the box, AFAIK</p>
<p>For now it appears that there is no such program.</p>
9,036
<p>After my web form is submitted, a regex will be applied to user input on the server side (via PHP). I'd like to have the identical regex running in real-time on the client side to show the user what the real input will be. This will be pretty much the same as the Preview section on the Ask Question pages on Stack Ov...
<p>Hehe this was sort of asked moments ago and Jeff pointed out:<br> <a href="http://www.regular-expressions.info/refflavors.html" rel="noreferrer">http://www.regular-expressions.info/refflavors.html</a>.</p> <p>There is a comparison of regular expression capabilities across tools and languages.</p>
<p>Both JavaScript's regex and PHP's preg_match are based on Perl, so there shouldn't be any porting problems. Do note, however, that Javascript only supports a subset of modifiers that Perl supports.</p> <p>For more info for comparing the two:</p> <ul> <li><a href="http://www.regular-expressions.info/javascript.html" ...
4,999
<p>What algorithm taught you the most about programming or a specific language feature?</p> <p>We have all had those moments where all of a sudden we know, just know, we have learned an important lesson for the future based on finally understanding an algorithm written by a programmer a couple of steps up the evolutio...
<p>"To iterate is human, to recurse divine" - quoted in 1989 at college. </p> <p>P.S. Posted by Woodgnome while waiting for invite to join</p>
<p>For me, the simple swap in Kelly &amp; Pohl's <em>A Book on C</em> to demonstrate call-by-reference flipped me out when I first saw it. I looked at that, and pointers snapped into place. Verbatim. . .</p> <pre><code>void swap(int *p, int *q) { int temp; temp = *p; *p = *q; *q = temp; } </code></pre>
4,587
<p>I've got an Anycubic Predator (aka Anycubic D). I followed the official instructions and leveled my printer. </p> <p>The first annoying problem I ran into is that after the auto-leveling, the level test printing shows that the printer wasn't leveled at all. I tried about 4-5 times, and finally leveled the printer (...
<p>A wide line works if there is something below it to squeeze the filament against, but if you don't have a full layer below it, it will stay thinner and it will droop. I would not use extreme ratios on overhangs. Still, do a parametric test: a overhang tower (a compact one) at different line widths and layer heights....
<p>In terms of Cura's model for showing overhangs, I'm nearly sure it's just the ratio - rise over run, or rather run over rise. And indeed that's what makes sense mathematically:</p> <p>At least some portion of the wall extrusion in layer N+1 needs to sit on top of the corresponding wall extrusion in layer N. For a g...
1,664
<p>By default each row of a Gridview maps to each row in a datatable or dataset attached to its datasource. But what if I want to display these rows in multiple columns. For example if it has 10 rows, 5 rows each should be displayed in 2 columns side by side. Also can I do this with the Infragistics grid. Is this possi...
<p>You can use a <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist.aspx" rel="noreferrer"><code>DataList</code></a> control instead. It has a <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist.repeatcolumns.aspx" rel="noreferrer"><code>RepeatColumns</co...
<p>Can't you just put two identical bound columns one after the other?</p>
4,019
<p>Syntax aside, what is the difference between</p> <pre><code>try { } catch() { } finally { x = 3; } </code></pre> <p>and </p> <pre><code>try { } catch() { } x = 3; </code></pre> <p>edit: in .NET 2.0?</p> <hr> <p>so</p> <pre><code>try { throw something maybe x = 3 } catch (...) { x = 3 } </code...
<p>Depends on the language as there might be some slight semantic differences, but the idea is that it will execute (almost) always, even if the code in the try block threw an exception.</p> <p>In the second example, if the code in the catch block returns or quits, the x = 3 will not be executed. In the first it will....
<p>So you can clean up any open connections, etc. initialized in the try block. If you opened a connection and then an exception occurred, that exception would not be properly closed. This type of scenario is what the finally block is for.</p>
7,343
<p>I have ASP.NET web pages for which I want to build automated tests (using WatiN &amp; MBUnit). How do I start the ASP.Net Development Server from my code? I do not want to use IIS.</p>
<p>From what I know, you can fire up the dev server from the command prompt with the following path/syntax:</p> <pre><code>C:\Windows\Microsoft.NET\Framework\v2.0.50727\Webdev.WebServer.exe /port:[PORT NUMBER] /path: [PATH TO ROOT] </code></pre> <p>...so I could imagine you could easily use Process.Start() to launch ...
<p>You can easily use <strong>Process Explorer</strong> to find complete command line options needed for manually start it. Start Process Explorer while debugging your website. For VS2012, expand 'devenv.exe' node. Right-click on 'WebDev.WebServer20.exe' and from there you can see Path and Command Line values.</p>
8,129
<p>How do you capture the mouse events, move and click over top of a Shockwave Director Object (not flash) in Firefox, via JavaScript. The code works in IE but not in FF. </p> <p>The script works on the document body of both IE and Moz, but mouse events do not fire when mouse is over a shockwave director object embed....
<p>You could also catch the mouse event within Director (That never fails) and then call your JS functions from there, using gotoNetPage "javascript:function('" &amp; argument &amp; "')"</p> <p>ej:</p> <pre><code>on mouseDown me gotoNetPage "javascript:function('" &amp; argument &amp; "')" end </code></pre> <p>Th...
<p>Just an idea.</p> <p>Try overlaying the shockwave object with a div with opacity 0, then you can capture events on the div itself.</p>
7,341
<p>The default shell in Mac OS X is <code>bash</code>, which I'm generally happy to be using. I just take it for granted. It would be really nice if it auto-completed <em>more stuff</em>, though, and I've heard good things about <code>zsh</code> in this regard. But I don't really have the inclination to spend hours fid...
<p>For casual use you are probably better off sticking with bash and just installing bash completion. </p> <p>Installing it is pretty easy, grab the bash-completion-20060301.tar.gz from <a href="http://www.caliban.org/bash/index.shtml#completion" rel="noreferrer">http://www.caliban.org/bash/index.shtml#completion</a> ...
<p>Staale is talking about a wizard like program (CUI) which autoruns the first time you run zsh. Just answer some questions, view/change the defaults and its configured for you.</p> <p>IBM developerWorks has great resources on zsh.</p> <p>I have not used very advanced features and so far I have not come across serio...
6,493
<p>We have several wizard style form applications on our website where we capture information from the user on each page and then submit to a backend process using a web service.</p> <p>Unfortunately we can't submit the information in chunks during each form submission so we have to store it the users session until th...
<p>Assuming the information is not sensitive then you could store the information in a cookie which would reduce the amount of information required to be stored server side. This would also allow you to access the information via JavaScript. </p> <p>Alternatively you could use the viewstate to store the information al...
<p>If you use a traditional HTTP model (i.e. don't use runat="server") you can post the data to another asp page and place the posted data into hidden form elements, you can do this for however many pages you need thus avoiding placing anything in a session variable. </p>
9,863
<p>I'm coming from the open source world, and interested in giving ASP.NET a spin. But I'm having a little trouble separating the tools from the platform itself in regards to the licensing. I've downloaded Visual Web Developer 2008 Express, but not sure how different this is from one of the full-featured Visual Studio ...
<p>All of .net is available in the .net SDK, so in theory you will not need Visual Studio at all.</p> <p>Now, there are some things that Express will not do. For example, the Database Designer is not very comprehensive and adding different remote databases is not or only very hardly possible. Still, in code you can con...
<p>Visual Studio is just the IDE. You could theoretically create every file in Notepad and compile manually with just the .net framework.</p> <p>IIS is an operating system feature, and SQL Server has different flavors with different capabilites.</p>
7,572
<p>How do you iterate through every file/directory recursively in standard C++?</p>
<p>In standard C++, technically there is no way to do this since standard C++ has no conception of directories. If you want to expand your net a little bit, you might like to look at using <a href="http://www.boost.org/doc/libs/1_36_0/libs/filesystem/doc/index.htm" rel="noreferrer">Boost.FileSystem</a>. This has been a...
<p>File tree walk <code>ftw</code> is a recursive way to wall the whole directory tree in the path. More details are <a href="https://linux.die.net/man/3/ftw" rel="nofollow noreferrer">here</a>.</p> <p>NOTE : You can also use <code>fts</code> that can skip hidden files like <code>.</code> or <code>..</code> or <code>.b...
9,284
<p>Does anyone know if it is possible to restart a J2EE application (from the application)? If so, how?</p> <p>I would like to be able to do it in an app-server-agnostic way, if it is possible.</p> <p>The application will be run on many different app servers-- basically whatever the client prefers.</p> <p>If it isn...
<p>I would suggest that you're unlikely to find an appserver agnostic way. And while I don't pretend to know your requirements, I might question a design that requires the application to restart itself, other than an installer that is deploying a new version. Finally, I would suggest that for any nontrivial purpose "a...
<p>Most application servers provide a JMX interface, so you could invoke that.</p>
6,871
<p>I see a number of people writing "CURA", when I have always called it "Cura". So I started to wonder if CURA was a <em>capitalised</em> acronym, like LiDAR or NATO (but not like radar or laser).</p> <p>I had a look and the Wikipedia entry, <a href="https://en.wikipedia.org/wiki/Cura_(software)" rel="nofollow norefe...
<p>As of version 4 the splash screen has changed, also the branding/naming of the product throughout Ultimaker's website.</p> <p><a href="https://i.stack.imgur.com/1eX3U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1eX3U.png" alt="enter image description here" /></a></p> <p>Technically it is not <...
<p>Actually, it's neither:</p> <p><a href="https://i.stack.imgur.com/H7bOQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H7bOQ.png" alt="enter image description here"></a></p> <p>If you wanna believe this image, it's: Ultimaker <strong>cura</strong> ... all lower case.</p>
55
<p>I am trying to publish an Asp.net MVC web application locally using the NAnt and MSBuild. This is what I am using for my NAnt target;</p> <pre><code>&lt;target name="publish-artifacts-to-build"&gt; &lt;msbuild project="my-solution.sln" target="Publish"&gt; &lt;property name="Configuration" value="debug" /...
<p>The "Publish" target you are trying to invoke is for "OneClick" deployment, not for publishing a website... This is why you are getting the seemingly bizarre message. You would want to use the AspNetCompiler task, rather than the MSBuild task. See <a href="http://msdn2.microsoft.com/en-us/library/ms164291.aspx" r...
<p>I came up with such solution, works great for me:</p> <pre><code>msbuild /t:ResolveReferences;_WPPCopyWebApplication /p:BuildingProject=true;OutDir=C:\Temp\buidl\ Test.csproj </code></pre> <p>Secret sauce is _WPPCopyWebApplication target.</p>
7,101
<p>One of the CAD programs I use is called <a href="http://www.tinkercad.com" rel="noreferrer">TinkerCAD</a>, which lets you export your design in either STL or OBJ form. What is the difference between these two file types? And which one is better to use?</p>
<p><strong>STL is the <em>de facto</em> standard in consumer-grade 3D printing</strong>. It is a bare-bone format that describes the shape of the object by defining the coordinates of all the vertices of all triangles that a surface may be subdivided into.</p> <p>This means that in STL any curved surface is represent...
<p>While the STL-format can only describe your object aproximatively by those well known triangles, OBJ-files can describe parts of your object parametrically by curves. This can lead to a higher precision and be a huge advance with regard to scalability. Which data format to choose depends, as always, on the applicati...
841
<p>The question is how to scale an existing mesh without changing the thickness of the walls? </p> <p>I am using Blender to create STL files for 3D printing. Let's say I create a shell for a model railroad car. Since 1/87th is the most common scale I make the walls of the shell just thick enough to make it rigid in 1...
<p>Your question falls into two different categories, here at 3D Printing SE and there, at <a href="https://blender.stackexchange.com/">Blender SE</a>. </p> <p>I would consider that your objective would best be solved using some form of parametric modeling, an aspect that is rarely embraced by Blender. Even though the...
<p>The minimum scale of your model The modeling of your 3D file doesn’t necessarily require that you work with a given unit or scale. It’s particularly true with software like Blender in which you’re able to give proportion but no unit. This job will be done after the modeling phase when you send your model to a 3D pri...
528
<p>I've never built a 3D printer before, but I understand dynamical systems and control theory, and I imagine a lot of the distortion/inaccuracy that happens during the FDM process (especially at high speeds) is due to position inaccuracies because of inertia. For example, a heavy print head moving fast enough might ov...
<p>Stepper motors &quot;want&quot; to keep their position as they are told to by the firmware, therefore they do whatever it's needed (accelerate and brake) to follow the orders they received.</p> <p>The question is: is the firmware telling them to move/accelerate/brake faster/harder than they can? if yes, they won't k...
<h1>Inertia is not what you think it is</h1> <p>Inertia is technically speaking something that in physics is not what you commonly understand under the term. There is no mysterious &quot;Inertia Force&quot; that slows your actions on a setup. Inertia is not what makes you overshoot a print's endpoint.</p> <p>Inertia is...
1,864
<p>Is there a free or open source library to read Excel files (.xls) directly from a C# program? </p> <p>It does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've been using Export to Unicode text function of Excel, and parsing the resulting (tab-delimited) file, but I'd l...
<pre><code>var fileName = string.Format("{0}\\fileNameHere", Directory.GetCurrentDirectory()); var connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; data source={0}; Extended Properties=Excel 8.0;", fileName); var adapter = new OleDbDataAdapter("SELECT * FROM [workSheetNameHere$]", connectionString);...
<p>I just used <a href="http://code.google.com/p/excellibrary/" rel="nofollow noreferrer">ExcelLibrary</a> to load an .xls spreadsheet into a DataSet. Worked great for me.</p>
3,664
<p>What is a good, simple encryption scheme for protecting passwords in a database? I don't necessarily need anything that's hyper-secure nor do I need anything that's lightning fast, but those things would be nice. Primarily, I just want something that's easy to implement without being terribly slow or insecure.</p>...
<p>As mk says, <s>SHA1 or MD5 are the standard ones, along with SHA2</s>.</p> <hr /> <p>Update: As processors have gotten faster over the years, hashes have gotten more brute-forceable. It's now recommended you use <a href="https://en.wikipedia.org/wiki/Bcrypt" rel="nofollow noreferrer"><code>bcrypt</code></a>.</p> <p>...
<p>If you're using SQL Server, there's the HashBytes function: </p> <p><a href="http://msdn.microsoft.com/en-us/library/ms174415.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms174415.aspx</a></p>
5,079
<p>I am ready to start using SVN, but I have NO (as in the money required for free beer) experience with source control. I have installed subversion on my server (that was easy, 'apt-get install subversion') but now I don't know what to do, how to configure it, or how to use it.<br /><br />What suggestions do you have...
<p>Eric Sink has an <a href="http://www.ericsink.com/scm/source_control.html" rel="noreferrer">excellent series</a> on source code control aimed at beginners. For Subversion specifics, including setting up and administering a server, the <a href="http://svnbook.red-bean.com/" rel="noreferrer">Subversion book</a> is a g...
<p>I recommend using SVN with apache on Linux, svn as a linux client, and TortioseSVN on windows (It does great MS Office diffs).</p> <p>I have lots of stuff on my svn, and I would hate not using it.</p>
5,621
<p>Over the past year or so my production platform has been plagued by an odd TCP/IP issue. I've spent zillions of hours working with competent &amp; knowledgeable sysadmins, scouring the net, reading source code, been jerked around by RH's pathetic support, and <strong>crying tears of blood</strong>! To no avail. (...
<p>Dave Miller (person in charge of networking in the linux kernel) and their fellow henchmen all inhabit the lkml or <a href="http://lkml.org" rel="noreferrer">Linux Kernel Mailing List</a>. If you can provide a reasonably decent bug report they'll get you a reasonable answer. </p> <p>On the other hand if you tell th...
<p>The linux-net mailing list might interest you. There should be more details <a href="http://vger.kernel.org/vger-lists.html" rel="nofollow noreferrer">here</a>.</p>
7,268
<p>I have an Anycubic Chiron printer and use Ultimaker Cura for slicing. Recently I printed a simple clip, had no problems whatsoever.</p> <p>I have since upgraded Cura to the latest version, and now the PLA will not stick to the build plate. The printer will make 3 passes whilst printing the brim, then it all collec...
<p>I don't think it's because of Cura. You can try if it still works with the older version.</p> <p>Otherwise, clean your print bed with isopropanol before printing to remove residues or level again. Without pictures of the condition of the print bed or the first layer, it is difficult to help.</p>
<p>Have tried all the possible answers and found the older version of Cura works better with the Chiron. The printer is 3 months old, bed is cleaned after each print.</p> <p>I then tried the new Cura version again but with glue for adhesion, that works. It seems that it is changing the bed temperature, and using a l...
2,099
<p>I have a database in ISO-8859-2 format, but I need to create XML in UTF-8. This means that I must encode the database before prinitng in UTF-8. I know very little about ASP.Net, so I'm hoping someone can help.</p> <p>In PHP I would do something like this:</p> <pre><code>db_connect(); mysql_query("SET NAMES 'UTF8'...
<p>Assuming you have a value string in <code>str</code>, this is the pure-.NET way of doing this.</p> <pre><code>var encoding = System.Text.Encoding.GetEncoding("iso-8859-2"); var bytes = System.Text.Encoding.Convert(encoding, System.Text.Encoding.Default, encoding.GetBytes(str)); var newString = System.Text.Encodin...
<p>The .NET Framework's internal string type is UTF-16. All database access will convert to UTF-16 so that you can view the data appropriately: the database, or the OLE DB provider, will convert to UTF-16.</p> <p>The XML writer classes (you <em>are</em> using XmlDocument or XmlWriter, right?) will then convert to UTF-...
9,710
<p>PLA has a heat capacity of <a href="https://www.sd3d.com/wp-content/uploads/2017/06/MaterialTDS-PLA_01.pdf" rel="nofollow noreferrer">1.8-2.1 J/g-K</a>, while <a href="http://www.matweb.com/search/datasheet_print.aspx?matguid=4de1c85bb946406a86c52b688e3810d0" rel="nofollow noreferrer">PETG 1.1-1.3 J/g-K</a>. This me...
<p>I'm adding this answer to somewhat challenge the findings of my original answer, and the premise of the question: PETG does not need lower print speeds, and can even be printed at higher speeds than PLA under some conditions due to reduced need for cooling. You can see this from some of the &quot;#speedboatrace&quot...
<p>The density of PLA is around 1.25 g/cm³ and the density of PETG is around 1.38 g/cm³. When you're talking about the amount of energy needed to melt a particular <em>volume</em> (which is what your extrusion units are) rather than mass, you need to scale the heat capacities (with units of <span class="math-container"...
1,633
<p>I want to rename a database, but keep getting the error that 'couldn't get exclusive lock' on the database, which implies there is some connection(s) still active.</p> <p>How can I kill all the connections to the database so that I can rename it?</p>
<p>The reason that the approach that <a href="https://stackoverflow.com/questions/11620/how-do-you-kill-all-current-connections-to-a-sql-server-2005-database/11627#11627">Adam suggested</a> won't work is that during the time that you are looping over the active connections new one can be established, and you'll miss th...
<p>You can Use SP_Who command and kill all process that use your database and then rename your database.</p>
3,271
<p>I printed parts for a Harry Potter wand with HatchBox Wood PLA, now I want to apply stain. I intended to try MinWax PolyShades wood stain, then noticed Varathane water-based wood stain is available at my local Rona hardware store. This seems a "healthier" option, maybe not as fussy to apply as PolyShades, anyone had...
<p>I ended up using Saman brand water-based wood stain, also from Rona hardware (a brand of Lowe's Canada). The selection of colours for Saman stains was greater than the Varathane stains. </p> <p>I applied a single coat of colour #117 "Chamois" to the stem portion of the wand, and two coats of colour #120 "Dark Walnu...
<p>Wood stains (as opposed to dyes, paints, etc.) work by having large particles that become lodged in the grain of the wood, yielding a result that varies in intensity with the grain of the wood and thereby brings out its beauty. It's unlikely that they will do what you want, or anything reasonable, on PLA that has wo...
1,309
<p>I have a need to convert images from CMYK to RGB - not necessarily back again, but hey, if it can be done...</p> <p>With the release of ColdFusion 8, we got the <a href="http://cfquickdocs.com/cf8/?getDoc=cfimage" rel="nofollow noreferrer">CFImage</a> tag, but it doesn't support this conversion; and nor does <a hre...
<p>A very simple formula for converting from CMYK to RGB ignoring all color profiles is:</p> <pre> R = ( (255-C)*(255-K) ) / 255; G = ( (255-M)*(255-K) ) / 255; B = ( (255-Y)*(255-K) ) / 255; </pre> <p>This code requires CMYK values to be in rage of 0-255. If you have 0 to 100 or 0.0 to 1.0 you'll have to...
<p>I know that this question is old, but I still encounter problems with CMYK images &amp; ColdFusion. However, I just read a CMYK JPEG image using ColdFusion 10 and resaved it. The saved image was able to to be read using ColdFusion 9 (which is only capable of reading RGB JPEGs.) I'm not sure if this conversion is ...
4,242
<p>Greetings, I'm trying to find a way to 'unbind' a socket from a particular IP/Port combination. My pseudocode looks like this:</p> <pre><code>ClassA a = new ClassA(); //(class A instantiates socket and binds it to 127.0.0.1:4567) //do something //...much later, a has been garbage-collected away. ClassA aa = ne...
<p>(this is what finally got everything to work for me)</p> <p>Make sure EVERY socket that the socket in A connects to has </p> <pre><code>socket.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.ReuseAddress, true); </code></pre> <p>set upon being initiated. </p>
<p>you can't rely on object being garbage collected in C# (i assume you're using c#, based on tagging) if it holds resources like being bound to the network resource like in your example, or holding some other kind of stream, a file stream would be a common example.</p> <p>you have to assure to release the resources t...
7,078
<p>To minimize retractions and travel when printing several objects, some slicers produce gcode for sequential deposition when each object is built in a traditional manner bottom up layer by layer before starting a new object. Of course, there are limitations caused by the hotend geometry <a href="https://i.stack.imgur...
<p>The site is not well-suited to crowd-sourced invention, but the drawbacks to your suggestion are (I think) on topic.</p> <p>The hotend has two main tasks. Accurate control of extrusion, and maintaining the desired volumetric melt rate. One factor which influences extrusion quality is the size of the melt-zone - gen...
<p>Yes, using a needle to extrude will result in a smaller diameter extrusion. All that is needed is to find a one with a suitable bore size. The problem however is in generating enough hydraulic pressure, needed to extrude hot plastic through a nozzle of that size. If you can form an extruder that can, then go for it....
1,375
<p>For instance, my query is like the following using SQL Server 2005:</p> <pre><code>SELECT * FROM Table WHERE FREETEXT(SearchField, 'c#') </code></pre> <p>I have a full text index defined to use the column SearchField which returns results when using:</p> <pre><code>SELECT * FROM Table WHERE SearchField LIKE '%c#...
<p>The # char is indexed as punctuation and therefore ignored, so it looks like we'll remove the letter C from our word indexing ignore lists.</p> <p>Tested it locally after doing that and rebuilding the indexes and I get results!</p> <p>Looking at using a different word breaker language on the indexed column, so tha...
<p>Quoting a much-replicated help page about Indexing Service query language:</p> <blockquote> <p>To use specially treated characters such as &amp;, |, ^, #, @, $, (, ), in a query, enclose your query in quotation marks (“).</p> </blockquote> <p>As far as I know, full text search in <code>MSSQL</code> is also done ...
2,347
<p>My current preferred C++ environment is the free and largely excellent Microsoft Visual Studio 2005 Express edition. From time to time I have sent release .exe files to other people with pleasing results. However recently I made the disturbing discovery that the pleasing results were based on more luck that I would ...
<p>For the C-runtime go to the project settings, choose C/C++ then 'Code Generation'. Change the 'runtime library' setting to 'multithreaded' instead of 'multithreaded dll'.</p> <p>If you are using any other libraries you may need to tell the linker to ignore the dynamically linked CRT explicitly.</p>
<p>In regards Jared's response, having Windows 2000 or better will not necessarily fix the issue at hand. Rob's response does work, however it is possible that this fix introduces security issues, as Windows updates will not be able to patch applications built as such.</p> <p>In another post, Nick Guerrera suggests pa...
5,809
<p>Whenever I run rspec tests for my Rails application it takes forever and a day of overhead before it actually starts running tests. Why is rspec so slow? Is there a way to speed up Rails' initial load or single out the part of my Rails app I need (e.g. ActiveRecord stuff only) so it doesn't load absolutely everyth...
<p>You should be able to to speed up your <code>script/spec</code> calls by running <code>script/spec_server</code> in a separate terminal window, then adding the additional <code>-X</code> parameter to your spec calls.</p>
<p>If you are on a Windows environment then there is probably little you can do as Rails seems to startup really slowly under Windows. I had the same experience on Windows and had to move my setup to a Linux VM to make it really zippy (I was also using autotest).</p>
9,231
<p>We are currently storing plain text passwords for a web app that we have. </p> <p>I keep advocating moving to a password hash but another developer said that this would be less secure -- more passwords could match the hash and a dictionary/hash attack would be faster.</p> <p>Is there any truth to this argument? ...
<p>Absolutely none. But it doesn't matter. I've posted a similar response before:</p> <p>It's unfortunate, but people, even programmers, are just too emotional to be easily be swayed by argument. Once he's invested in his position (and, if you're posting here, he is) you're not likely to convince him with facts alo...
<blockquote> <p>more passwords could match the hash and a dictionary/hash attack would be faster.</p> </blockquote> <p>Yes and no. Use a modern hashing algorithm, like an SHA variant, and that argument gets very, very week. Do you really need to be worried if that brute force attack is going to take only 352 years...
8,349
<p>I have an extender (IExtenderProvider) which extends certain types of controls with additional properties. For one of these properties, I have written a UITypeEditor. So far, all works just fine.</p> <p>The extender also has a couple of properties itself, which I am trying to use as a sort of default for the UIT...
<p>Could you read the attribute yourself?</p> <pre><code>DefaultValueAttribute att = context. PropertyDescriptor.Attributes. OfType&lt;DefaultValueAttribute&gt;(). FirstOrDefault(); object myDefault = null; if ( att != null ) myDefault = att.Value; </code></pre> <p>I've used Linq to simplify the code,...
<p>Have you considered adding the DefaultValue as a static property of the ExtenderProvider, then you can access it without requiring an instance of the provider?</p>
4,636
<p>When designing for 3d FDM printing, I'm wondering what is best practice for items with large overhangs which cannot have (or would be fairly impractical) support structures. Consider my following design:</p> <p><a href="https://i.stack.imgur.com/Rfmyd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.co...
<p>When constructing a model intended to be 3D printed, your approach is sound. Overhangs and the required supports can be a severe problem and I believe your assessment is accurate.</p> <p>The complexity of the upper portion would make printed supports an inappropriate path for the reasons you've provided, while your ...
<p>If your end product allows it, one possible solution would be to remodel your part so that instead of having a square channel in the center, the channel had sloping or curved sides so that the overhand was removed, and then to print out an infill piece that could be clotted into the channel to square it off.</p> <p>...
2,227
<p>I have a network C++ program in Windows that I'd like to test for network disconnects at various times. What are my options?</p> <p>Currently I am:</p> <ol> <li>Actually disconnecting the network wire from the back of my computer</li> <li>using ipconfig /release</li> <li>Using the <a href="http://www.nirsoft.net/...
<p>You might want to abstract the network layer, and then you can have unit tests that inject interesting failure events at appropriate points.</p>
<p>You can subclass whatever library class you are using to manage your sockets (presumably CAsyncSocket or CSocket if you are using MFC), override the methods whose failure you want to test, and insert appropriate test code in your overrides.</p>
8,677
<p>My goal is to 3D print a 5 liter miniature barrel with a side stand, similar to <a href="http://rads.stackoverflow.com/amzn/click/B009K5DSJG" rel="noreferrer">this wooden one on Amazon</a>. I want it to have a removable top so that a boxed wine bladder may be put inside, and there should be a hole on the top as well...
<p>Your question begins in an inappropriate format for StackExchange, but you've ended it with one more appropriate by asking if Blender would work.</p> <p>If you are willing to take the time to learn Blender, you are certain to discover that it will do as you require, and much much more. Your referenced model could be...
<p>To the people saying 123design. I can only say I have been a blender user way before 3D printing was a thing and just cant get around learning 123design. It just feels so limited as it only have a few tools. Yes blender might have a hard learning curve but it does pay off in the future as you wont be limited to 3D p...
366
<p>I use TortoiseSVN to access file based local repo. In all my commits an author is my Windows login name. Is it possible to use different name?</p> <p>I know how to change author after commit but how to change before? Installing apache/svnserver is not an option. </p>
<p>Yes, it's possible.</p> <p><em>TortoiseSVN</em> and the <a href="http://subversion.tigris.org/" rel="noreferrer"><em>svn</em></a> command line client share the same settings location in your profile folder. So you may simply checkout one version using <em>svn.exe</em>:</p> <pre><code>$ svn co --username different_...
<p>As far as I know, TortoiseSVN does not offer any way to do this.</p> <p>Presumably it's not seen as a big issue, since file based access is not practical for multi-user scenarios, and for single-user the author-name is of lesser importance.</p> <p>A possible workaround would be to create another Windows username w...
6,758
<p>Let's say I have a web site for hosting community generated content that targets a very specific set of users. Now, let's say in the interest of fostering a better community I have an off-topic area where community members can post or talk about anything they want, regardless of the site's main theme.</p> <p>Now, ...
<p>This will work for all well-behaving search engines, just add it to the <code>&lt;head&gt;</code>:</p> <pre><code>&lt;meta name="robots" content="noindex, nofollow" /&gt; </code></pre>
<p>You can disallow search engines to read or index your content by restricting robot meta tags. In this way, spider will consider your instructions and will index only such pages that you want.</p>
6,560
<p>Does Server Core 2008 support asp.net? I see references online saying that it isn't supported, but they are all old references from CTPs.</p>
<p>No.</p> <p>Answer here: <a href="http://www.microsoft.com/windowsserver2008/en/us/compare-core-installation.aspx" rel="nofollow noreferrer">http://www.microsoft.com/windowsserver2008/en/us/compare-core-installation.aspx</a></p> <p>"ASP.NET is not available with Server Core installation option in any edition"</p>
<p><a href="http://www.microsoft.com/windowsserver2008/en/us/compare-core-installation.aspx" rel="nofollow noreferrer">No</a></p>
9,102
<p><strong>Question</strong></p> <p>How would you go adding automated testing to a game?</p> <p>I believe you can unit test a lot of the game engine's functionality (networking, object creation, memory management, etc), but is it possible to automate test the actual game itself?</p> <p>I'm not talking about gameplay...
<p><a href="http://gamesfromwithin.com/?p=97" rel="noreferrer">This post</a> at <a href="http://gamesfromwithin.com" rel="noreferrer">Games From Within</a> might be relevant/interesting. </p>
<p>This doesn't really answer your question but I was listening to a podcast on <a href="http://research.microsoft.com/pex/" rel="nofollow noreferrer">Pex from microsoft</a> which does a similar thing to the solution you're proposing and when I was listening to it I remember thinking that it would be really interesting...
3,493
<p>I have a line color property in my custom grid control. I want it to default to <code>Drawing.SystemColors.InactiveBorder</code>. I tried:</p> <pre><code>[DefaultValue(typeof(System.Drawing.SystemColors), "InactiveBorder")] public Color LineColor { get; set; } </code></pre> <p>But it doesn't seem to work. How do I...
<p>You need to change first argument from <code>SystemColors</code> to <code>Color</code>.<br> It seems that there is no type converter for the <code>SystemColors</code> type, only for the <code>Color</code> type.</p> <pre><code>[DefaultValue(typeof(Color),"InactiveBorder")] </code></pre>
<p>According to the link Matt posted, the DefaultValue attribute doesn't set the default value of the property, it just lets the form designer know that the property <em>has</em> a default value. If you change a property from the default value it is shown as bold in the properties window.</p> <p>You can't set a defaul...
6,529
<p>My firm have a talented and smart operations staff who are working very hard. I'd like to give them a SQL-execution tool that helps them avoid common, easily-detected SQL mistakes that are easy to make when they are in a hurry. Can anyone suggest such a tool? Details follow.</p> <p>Part of the operations team remit...
<p>If your people are using the mysql(1) program to run queries, you can use the <a href="http://dev.mysql.com/doc/refman/5.1/en/mysql-tips.html" rel="nofollow noreferrer">safe-updates</a> option (aka i-am-a-dummy) to get you part of what you need. Its name is somewhat misleading; it not only prevents UPDATE and DELET...
<p>You might find <a href="http://www.red-gate.com/Products/SQL_Prompt/index.htm" rel="nofollow noreferrer">SQL Prompt</a> from redgate useful. I'm not sure what database engine you're using, as it's only for MSSQL Server</p>
3,623
<p>So as the title said my heated bed stopped heating mid print. </p> <p>I'm pretty confident the bed itself is not the problem as I've ran continuity tests from the wires and a resistance check (which showed a total resistance of about 1.5 ohms, which is where it should be). I've done voltage checks across the input ...
<p>First you should check if the bed still works when applying 12V directly. You can then also check the voltage over the 12V output terminals to measure the power supply unit while it is powering the bed. It is unclear whether you measured the voltage of the PSU while it was powering a large load.</p> <p>It is also a...
<p>you can swap pins in Marlin firmware. When you download it from GitHub, there is a file called <a href="https://github.com/prusa3d/Prusa-Firmware/blob/MK3/Firmware/pins.h" rel="nofollow noreferrer">pins.h</a> (please be aware that this file is an example), and you can play with your setup to skip the broken mosfet.<...
930
<p>What do I need to add to my <code>.spec</code> file to create the desktop shortcut and assign an icon to the shortcut during install of my <code>.rpm</code>? If a script is required, an example would be very helpful.</p>
<p>You use a .desktop file for icons under linux. Where to put the icon depends on what distribution and what desktop environment you are using. Since I'm currently running Gnome on Fedora 9, I will answer it in those terms.</p> <p>An example foo.desktop file would be:</p> <pre><code>[Desktop Entry] Encoding=UTF-8 Ge...
<p>To create a desktop icon to an application follow the two steps below.</p> <ol> <li><p>In an Editor create a new file.</p> <pre><code>gedit ~/.local/share/applications/NameYouWantForApplication.desktop </code></pre></li> <li><p>Place this section within the file and save it.</p> <pre><code>[Desktop Entry] Type=Ap...
9,964
<p>I am trying to create a query string of variable assignments separated by the <code>&amp;</code> symbol (ex: <code>"var1=x&amp;var2=y&amp;..."</code>). I plan to pass this string into an embedded flash file.</p> <p>I am having trouble getting an <code>&amp;</code> symbol to show up in XSLT. If I just type <code>&am...
<p>You can combine <code>disable-output-escaping</code> with a <code>CDATA</code> section. Try this:</p> <pre><code>&lt;xsl:text disable-output-escaping="yes"&gt;&lt;![CDATA[&amp;]]&gt;&lt;/xsl:text&gt; </code></pre>
<p>try: &lt;xsl:value-of select="&amp;amp;" disable-output-escaping="yes"/></p> <p>Sorry if the formatting is messed up.</p>
9,341
<p>What is the <strong>complete</strong> and correct syntax for the SQL Case expression?</p>
<p>The <strong>complete</strong> syntax depends on the database engine you're working with:</p> <p>For SQL Server:</p> <pre><code>CASE case-expression WHEN when-expression-1 THEN value-1 [ WHEN when-expression-n THEN value-n ... ] [ ELSE else-value ] END </code></pre> <p>or:</p> <pre><code>CASE WHEN boo...
<p>Case statement syntax in SQL SERVER:</p> <pre><code>CASE column WHEN value1 THEN 1 WHEN value3 THEN 2 WHEN value3 THEN 3 WHEN value1 THEN 4 ELSE '' END </code></pre> <p>And we can use like below also:</p> <pre><code>CASE WHEN column=value1 THEN 1 WHEN column=value3 THEN 2 WHEN column=valu...
2,661
<p>I am doing profiling of a C code in Microsoft VS 2005 on a Intel Core-2Duo platform. I measure the time(secs:millisecs) counsumed by my function. But i have some doubts about the accuracy of this measurement as the operating system will not continuously run my application, but instead schedule others apps/services ...
<p>@Kogus: Even if i run outside debugger(standalone app. from a command prompt) it still could be preempted by OS and cause a incorrect measurement of the time consumed by my app.</p> <p>Is'nt it?</p> <p>-AD</p>
<p><strong>Suggestion</strong></p> <p>Try run on multi CPU systems. </p>
7,511
<p>I'm implementing a tagging system for a website. There are multiple tags per object and multiple objects per tag. This is accomplished by maintaining a table with two values per record, one for the ids of the object and the tag.</p> <p>I'm looking to write a query to find the objects that match a given set of tags....
<p>Given:</p> <ul> <li>object table (primary key id)</li> <li>objecttags table (foreign keys objectId, tagid)</li> <li><p>tags table (primary key id)</p> <pre><code>SELECT distinct o.* from object o join objecttags ot on o.Id = ot.objectid join tags t on ot.tagid = t.id where t.Name = 'fruit' or t....
<p>I'd suggest making your table have 1 tag per record, like this:</p> <pre><code> apple -&gt; fruit apple -&gt; red apple -&gt; food banana -&gt; fruit banana -&gt; yellow banana -&gt; food </code></pre> <p>Then you could just</p> <pre><code> SELECT object WHERE tag = 'fruit' OR tag = 'food'; </code></pre> <p...
4,436
<p>I'm displaying a set of images as an overlay using Google Maps. Displaying these images should be in an endless loop but most most browsers detect this, and display a warning. </p> <p>Is there a way to make a endless loop in JavaScript so that it isn't stopped or warned against by the browser?</p>
<p>Try <a href="https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval" rel="nofollow noreferrer">setInterval</a> or <a href="https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/settimeout" rel="nofollow noreferrer">setTimeout</a>.</p> <p>Here is an example:</p> ...
<p>Perhaps try using a timer which retrieves the next image each time it ticks, unfortunately i don't know any JavaScript so I can't provide a code sample</p>
8,855
<p>What do I need to look at to see whether I'm on Windows or Unix, etc?</p>
<pre><code>&gt;&gt;&gt; import os &gt;&gt;&gt; os.name 'posix' &gt;&gt;&gt; import platform &gt;&gt;&gt; platform.system() 'Linux' &gt;&gt;&gt; platform.release() '2.6.22-15-generic' </code></pre> <p>The output of <a href="https://docs.python.org/library/platform.html#platform.system" rel="noreferrer"><code>platform.s...
<p>How about a simple Enum implementation like the following? No need for external libs!</p> <pre><code>import platform from enum import Enum class OS(Enum): def checkPlatform(osName): return osName.lower()== platform.system().lower() MAC = checkPlatform("darwin") LINUX = checkPlatform("linux") ...
2,412
<p>I have a relationship between two entities (e1 and e2) and e1 has a collection of e2, however I have a similar relationship set up between (e2 and e3), yet e2 does not contain a collection of e3's, any reason why this would happen? Anything I can post to make this easier to figure out?</p> <p>Edit: I just noticed t...
<p><strong>Using this setup, everything worked.</strong> </p> <p><em>1) LINQ to SQL Query, 2) DB Tables, 3) LINQ to SQL Data Model in VS.NET 2008</em></p> <p><strong>1 - LINQ to SQL Query</strong></p> <pre><code>DataClasses1DataContext db = new DataClasses1DataContext(); var results = from threes in db.tableThrees...
<p>the FK_Contraints are set up like this:</p> <p>ALTER TABLE [dbo].[e2] WITH CHECK ADD CONSTRAINT [FK_e2_e1] FOREIGN KEY([E1Id]) REFERENCES [dbo].[e1] ([Id])</p> <p>ALTER TABLE [dbo].[e3] WITH CHECK ADD CONSTRAINT [FK_e3_e2] FOREIGN KEY([E2Id]) REFERENCES [dbo].[e2] ([Id])</p> <p>is this what you were asking for?</...
7,369
<p>In Firefox you can enter the following into the awesome bar and hit enter:</p> <pre><code>javascript:self.resizeTo(1024,768); </code></pre> <p>How do you do the same thing in IE?</p>
<pre><code>javascript:resizeTo(1024,768); vbscript:resizeto(1024,768)</code></pre> <p>Will work in IE7, But consider using something like</p> <pre><code>javascript:moveTo(0,0);resizeTo(1024,768);</code></pre> <p>because IE7 doesn't allow the window to "resize" beyond the screen borders. If you work on a 1024,768 des...
<p>It works in IE6, but I think IE7 added some security around this?</p>
8,480
<p>Our investigations have shown us that not all browsers respect the HTTP cache directives in a uniform manner.</p> <p>For security reasons we do not want certain pages in our application to be cached, <strong>ever,</strong> by the web browser. This must work for at least the following browsers:</p> <ul> <li>Interne...
<h1>Introduction</h1> <p>The correct minimum set of headers that works across all mentioned clients (and proxies):</p> <pre><code>Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: 0 </code></pre> <p>The <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9" rel="noreferrer">...
<p>you can use location block for set individual file instead of whole app get caching in IIS </p> <pre><code> &lt;location path="index.html"&gt; &lt;system.webServer&gt; &lt;httpProtocol&gt; &lt;customHeaders&gt; &lt;add name="Cache-Control" value="no-cache" /&gt; &lt;/customH...
7,215
<p>Has anyone successfully talked <a href="http://www.profibus.com/" rel="noreferrer">profibus</a> from a .NET application?</p> <p>If you did, what device/card did you use to accomplish this, what was the application, and did you use any kind of preexisting or available code?</p>
<p>We've not used Profibus, but have used <strong>DeviceNET</strong> (another CAN based protocol), <strong>Ethernet/IP</strong> and <strong>ControlNet</strong> which all have similar challenges.</p> <p>We've been doing this since the late 1990's and therefore rely mainly on our own generated code using off-the-shelf h...
<p>Try this: <a href="http://libnodave.sourceforge.net" rel="nofollow noreferrer">http://libnodave.sourceforge.net</a></p>
9,220
<p>I believe the application has some parts that target .NET, and some that don't. I'm particularly interested in looking at the resource files, if there are any.</p>
<p>If you want to disassemble native x86/64 app use <a href="http://www.idapro.ru" rel="nofollow noreferrer">IDA</a>, .NET exe/dll can be disassembled using Reflector. There are <a href="http://www.google.ru/search?complete=1&amp;hl=en&amp;newwindow=1&amp;client=firefox-a&amp;rls=org.mozilla%3Aen-US%3Aofficial&amp;hs=v...
<p>Looking at the resource files isn't really "disassembling" (not really) and if that's all you want to do you can just open the .exe or .dll inside Visual Studio or a similar tool and it will give you a resources view.</p>
8,617
<p>In the ContainsIngredients method in the following code, is it possible to cache the <em>p.Ingredients</em> value instead of explicitly referencing it several times? This is a fairly trivial example that I just cooked up for illustrative purposes, but the code I'm working on references values deep inside <em>p</em>...
<p>Can't you simply write your boolean expression in a separate static function which you call from your lambda - passing p.Ingredients as a parameter...</p> <pre><code>private static bool IsIngredientPresent(IngredientBag i, string ingredientType, string ingredient) { return i != null &amp;&amp; i.Contains(ingred...
<p>I would say no in this case. I assume that the compiler can figure out that it uses the <code>p.Ingredients</code> variable 3 times and will keep the variable closeby on the stack or the registers or whatever it uses.</p>
9,189
<p>Currently my app uses just Direct3D9 for graphics, however in the future I' m planning to extend this to D3D10 and possibly OpenGL. The question is how can I do this in a tidy way?</p> <p>At present there are various Render methods in my code</p> <pre><code>void Render(boost::function&lt;void()&gt; &amp;Call) { ...
<p>Define an interface that is sufficient for your application's graphic output demands. Then implement this interface for every renderer you want to support.</p> <pre><code>class IRenderer { public: virtual ~IRenderer() {} virtual void RenderModel(CModel* model) = 0; virtual void DrawScreenQuad(int x1, ...
<p>I'd say if you want a really complete the answer, go look at the source code for <code>Ogre3D</code>. They have both <code>D3D</code> and <code>OpenGL</code> back ends. Look at : <a href="http://www.ogre3d.org" rel="nofollow noreferrer">http://www.ogre3d.org</a> Basically their API kind of forces you into working ...
8,573
<p>Using reflection, I need to load 2 different versions of the same assembly. Can I load the 2 versions in 2 different AppDomains in the same process? </p> <p>I need to do some data migration from the old version of the app to the new version. Please let me know if this is possible or should I use 2 separate process...
<p>If you are doing it at design time (which you indicate you are not) this should help you: </p> <p><a href="http://blogs.msdn.com/abhinaba/archive/2005/11/30/498278.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/abhinaba/archive/2005/11/30/498278.aspx</a></p> <p>If you are doing it dynamically through reflec...
<p>If you are doing it at design time (which you indicate you are not) this should help you: </p> <p><a href="http://blogs.msdn.com/abhinaba/archive/2005/11/30/498278.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/abhinaba/archive/2005/11/30/498278.aspx</a></p> <p>If you are doing it dynamically through reflec...
8,248
<p>I have a table with an XML column. This column is storing some values I keep for configuring my application. I created it to have a more flexible schema. I can't find a way to update this column directly from the table view in SQL Management Studio. Other (INT or Varchar for example) columns are editable. I know I c...
<p>This is an old question, but I needed to do this today. The best I can come up with is to write a query that generates SQL code that can be edited in the query editor - it's sort of lame but it saves you copy/pasting stuff.</p> <p>Note: you may need to go into Tools > Options > Query Results > Results to Text and s...
<p>I do not think you can use the Management Studio GUI to update XML-columns without writing the UPDATE-command yourself.</p> <p>One way you could let users update xml-data is to write a simple .net based program (winforms or asp.net) and then select/update the data from there. This way you can also sanitize the data...
7,640
<p><strong>Is there anything built into the core C# libraries that can give me an immutable Dictionary?</strong> </p> <p>Something along the lines of <em>Java's</em>:</p> <pre><code>Collections.unmodifiableMap(myMap); </code></pre> <p>And just to clarify, I am not looking to stop the keys / values themselves from b...
<p>No, but a wrapper is rather trivial:</p> <pre><code>public class ReadOnlyDictionary&lt;TKey, TValue&gt; : IDictionary&lt;TKey, TValue&gt; { IDictionary&lt;TKey, TValue&gt; _dict; public ReadOnlyDictionary(IDictionary&lt;TKey, TValue&gt; backingDict) { _dict = backingDict; } public void...
<p>There's also another alternative as I have described at:</p> <p><a href="http://www.softwarerockstar.com/2010/10/readonlydictionary-tkey-tvalue/" rel="nofollow">http://www.softwarerockstar.com/2010/10/readonlydictionary-tkey-tvalue/</a></p> <p>Essentially it's a subclass of ReadOnlyCollection>, which gets the work...
5,542
<p>I print a lot of stuff, and I was thinking I could get several magnetic bed-plates and when 1 print is done simply have my wife pull the plate off and stick on clean plate and start the print again. But a friend of mine says that won't work. Because even if the plates are made by the same manufacturer you can't guar...
<p>It is a question of quality:</p> <p>You better make sure that your plates are the same thickness evenly, and level very similarly. If that can be assured, they can be swapped easily.</p> <p>In case you have a bed leveling sensor of some sort, you might include a whole bed-leveling cycle in front of every print and e...
<p>Yes ,I was also facing the same problem couples of month ago and to solution I had buyed extra plates and <strong>It works perfectly</strong> . Go for the extra beds and buy only from the same manufacturer.</p> <p>Hope your get your answer</p>
2,104
<p>I'm going to be starting a project soon that requires support for large-ish binary files. I'd like to use Ruby on Rails for the webapp, but I'm concerned with the BLOB support. In my experience with other languages, frameworks, and databases, BLOBs are often overlooked and thus have poor, difficult, and/or buggy fun...
<p>+1 for attachment_fu</p> <p>I use attachment_fu in one of my apps and MUST store files in the DB (for annoying reasons which are outside the scope of this convo).</p> <p>The (one?) tricky thing dealing w/BLOB's I've found is that you need a separate code path to send the data to the user -- you can't simply in-lin...
<p>Look into the plugin, <a href="http://john.guen.in/rdoc/x_send_file/" rel="nofollow noreferrer">x_send_file</a> too. </p> <p>"The XSendFile plugin provides a simple interface for sending files via the X-Sendfile HTTP header. This enables your web server to serve the file directly from disk, instead of streaming it ...
8,130
<p>How do I create a button control (with <code>CreateWindow</code> of a <code>BUTTON</code> window class) that has a standard system-wide size (especially height) that's consistent with the rest of Windows applications? I should of course take DPI into account and probably other settings.</p> <blockquote> <p><stron...
<h2>In the perfect, hassle-free world...</h2> <p>To create a standard size button we would have to do this:</p> <pre><code>LONG units = GetDialogBaseUnits(); m_hButton = CreateWindow(TEXT("BUTTON"), TEXT("Close"), WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 0, 0, MulDiv(LOWORD(units)...
<p>@macbirdie: you should NOT use GetDialogBaseUnits(), it is based on the default system font (Ugly bitmap font). You should use MapDialogRect()</p>
8,301
<p>I would like to test a function with a tuple from a set of fringe cases and normal values. For example, while testing a function which returns <code>true</code> whenever given three lengths that form a valid triangle, I would have specific cases, negative / small / large numbers, values close-to being overflowed, et...
<p>Absolutely, especially dealing with lots of these permutations/combinations I can definitely see that the first pass would be an issue.</p> <p>Interesting implementation in python, though I wrote a nice one in C and Ocaml based on "Algorithm 515" (see below). He wrote his in Fortran as it was common back then for a...
<p>While it's possible to create lots of test data and see what happens, it's more efficient to try to minimize the data being used.</p> <p>From a typical QA perspective, you would want to identify different classifications of inputs. Produce a set of input values for each classification and determine the appropriate ...
2,297
<p>When working with large and/or many Javascript and CSS files, what's the best way to reduce the file sizes?</p>
<p>In addition to using server side compression, using intelligent coding is the best way to keep bandwidth costs low. You can always use tools like <a href="http://dean.edwards.name/download/#packer" rel="nofollow noreferrer">Dean Edward's Javascript Packer</a>, but for CSS, take the time to learn <a href="http://www....
<p>I'd give a test-drive to the new runtime optimizers in ASP.Net published on <a href="http://www.codeplex.com/NCOptimizer" rel="nofollow noreferrer">http://www.codeplex.com/NCOptimizer</a></p>
9,123
<p>I want to get the MD5 Hash of a string value in SQL Server 2005. I do this with the following command:</p> <pre><code>SELECT HashBytes('MD5', 'HelloWorld') </code></pre> <p>However, this returns a VarBinary instead of a VarChar value. If I attempt to convert <code>0x68E109F0F40CA72A15E05CC22786F8E6</code> into a V...
<p>I have found the solution else where:</p> <pre><code>SELECT SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5', 'HelloWorld')), 3, 32) </code></pre>
<p>Changing the datatype to varbinary seems to work the best for me.</p>
2,430
<p>I am looking for some JavaScript plugin (preferably jQuery) to be able to scroll through an image, in the same way that <a href="http://maps.google.com" rel="noreferrer">Google Maps</a> works.</p> <p>I can make the image draggable but then I see the whole image while dragging even if the parent div is <code>overflo...
<p>I may be a little late to the party, but I was just looking for the same thing. What I stumbled upon is <a href="http://code.google.com/p/jquery-scrollview/" rel="nofollow noreferrer">scrollview</a> for jquery, it works perfect and does exactly this google maps-like drag-to-scroll for overflowed divs.</p>
<p>Google Maps uses images sliced into blocks which are dynamically loaded as the user pans in different directions. The <a href="http://www.casa.ucl.ac.uk/software/googlemapimagecutter.asp" rel="nofollow noreferrer">Google Maps Image Cutter</a> Paul Dixon mentions is the tool you want for this.</p> <p>If you just wan...
9,216
<p>Using SQL Server, how do I split a string so I can access item x?</p> <p>Take a string "Hello John Smith". How can I split the string by space and access the item at index 1 which should return "John"?</p>
<p>You may find the solution in <em><a href="http://www.codeproject.com/KB/database/SQL_UDF_to_Parse_a_String.aspx" rel="noreferrer">SQL User Defined Function to Parse a Delimited String</a></em> helpful (from <a href="http://en.wikipedia.org/wiki/The_Code_Project" rel="noreferrer">The Code Project</a>).</p> <p>You ca...
<p>Well, mine isn't all that simpler, but here is the code I use to split a comma-delimited input variable into individual values, and put it into a table variable. I'm sure you could modify this slightly to split based on a space and then to do a basic SELECT query against that table variable to get your results.</p> ...
2,475
<p>In my simple OpenGL program I get the following error about exit redefinition:</p> <pre><code>1&gt;c:\program files\microsoft visual studio 8\vc\include\stdlib.h(406) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs 1&gt; c:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\...
<p><strong>Cause:</strong></p> <p>The <strong>stdlib.h</strong> which ships with the recent versions of Visual Studio has a different (and conflicting) definition of the <strong>exit()</strong> function. It clashes with the definition in <strong>glut.h</strong>.</p> <p><strong>Solution:</strong></p> <p>Override the ...
<p>or this... To fix the error, right click on the project name in the Solution Explorer tab and select Properties -> C/C++ -> Preprocessor -> Preprocessor definitions and append GLUT_BUILDING_LIB to the existing definitions, seperated by semicolons. </p>
3,521
<p>I use this tool called <a href="http://www.lazycplusplus.com/" rel="nofollow noreferrer">Lazy C++</a> which breaks a single C++ .lzz file into a .h and .cpp file. I want <a href="http://makepp.sourceforge.net/" rel="nofollow noreferrer">Makepp</a> to expect both of these files to exist after my rule for building .lz...
<p>I've never used Makepp personally, but since it's a drop-in replacement for GNU Make, you should be able to do something like:</p> <pre><code>build: foo.h foo.cpp g++ $(CFLAGS) foo.cpp -o $(LFLAGS) foo foo.h foo.cpp: foo.lzz lzz foo.lzz </code></pre> <p>Also not sure about the lzz invocation there, but that...
<p>Lzz is amazing! This is just what I was looking for <a href="http://groups.google.com/group/comp.lang.c++/browse_thread/thread/c50de73b70a6a957/f3f47fcdcfb6bc09" rel="nofollow noreferrer">http://groups.google.com/group/comp.lang.c++/browse_thread/thread/c50de73b70a6a957/f3f47fcdcfb6bc09</a></p> <p>Actually all you...
5,608
<p>Is anyone using Elmah to send exceptions via email? I've got Elmah logging set up via SQL Server, and can view the errors page via the Elmah.axd page, but I am unable to get the email component working. The idea here is to get the email notification so we can react more quickly to exceptions. Here is my web.config (...
<p>You need the ErrorMail httpModule.</p> <p>add this line inside the &lt;httpModules&gt; section</p> <pre><code>&lt;add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /&gt; </code></pre> <p>If you're using a remote SMTP server (which it looks like you are) you don't need SMTP on the server.</p>
<p>I have used Elmah myself in this configuration and I had to setup the server with SMTP locally. It is a straight-forward install on you local IIS server. This should do the trick.</p> <p>Good point above, you need the errorMail module BUT if you are not using a remote SMTP server you need SMTP locally, just to cl...
5,464
<p>This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this?</p>
<p>What you are looking for is a pseudo-element that doesn't exist. There is <code>:first-letter</code> and <code>:first-line</code>, but no <code>:first-word</code>.</p> <p>You can of course do this with JavaScript. Here's some code I found that does this: <a href="http://www.dynamicsitesolutions.com/javascript/first-...
<p>Insert Span Tag in your paragraph text. For Example- <code>&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;My Name Is Dot&lt;/p</code> and then style the first letter.</p>
7,943
<p>What is a good setup for .hgignore file when working with Visual Studio 2008?</p> <p>I mostly develop on my own, only occasionly I clone the repository for somebody else to work on it.</p> <p>I'm thinking about obj folders, .suo, .sln, .user files etc.. Can they just be included or are there file I shouldn't inclu...
<p>Here's my standard .hgignore file for use with VS2008 that was originally modified from a Git ignore file:</p> <pre><code># Ignore file for Visual Studio 2008 # use glob syntax syntax: glob # Ignore Visual Studio 2008 files *.obj *.exe *.pdb *.user *.aps *.pch *.vspscc *_i.c *_p.c *.ncb *.suo *.tlb *.tlh *.bak *....
<p>some others I use:</p> <pre><code>output PrecompiledWeb _UpgradeReport_Files #Guidance Automation Toolkit *.gpState #patches *.patch </code></pre>
5,514
<p>Any hints or suggestions (filament type? suggested settings? model sources?) for 3D printing minis to use in Dungeons &amp; Dragons?</p> <p>I've done a couple where the support structures were difficult to break off without breaking off a hand or something.</p> <p>I have a Lulzbot Mini (1), single-extruder if that m...
<p>There are adequate demonstration videos on YouTube showing that it is possible to print very acceptable 28 mm scale miniatures with FDM printers, easily rivaling the quality of resin printers from only a few years ago.</p> <p>There are a couple of key requirements to get optimum quality for small, highly detailed pa...
<p>Buckle up, this is going to be rough:</p> <p>FDM printers are not the best choice for printing figurines in the 25 to 40 mm scale that is typical for wargaming and D&amp;D games. Resolution-wise, that's the area of <em>resin</em> printers.</p> <p>But there are ways to get some partially decent prints made:</p> <ul> ...
1,931
<p>Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters that belong to a stored procedure on a SQL Server before I actually execute it?</p> <p>I have an a "multi-environment" scenario where there are multiple versions of the same database schema. Examples of environments might be "Develo...
<p>You can use SqlCommandBuilder.DeriveParameters() (see <a href="https://web.archive.org/web/20110304121600/http://www.davidhayden.com/blog/dave/archive/2006/11/01/SqlCommandBuilderDeriveParameters.aspx" rel="nofollow noreferrer">SqlCommandBuilder.DeriveParameters - Get Parameter Information for a Stored Procedure - A...
<p>All of these ADO.NET solutions are are asking the code library to query the database's metadata on your behalf. If you are going to take that performance hit anyhow, maybe you should just write some helper functions that call </p> <pre><code>Select count(*) from information_schema.parameters where ...(proc name =....
5,385
<p>Does anybody know if it's possible, and how, to programmatically send a <strong>SMS</strong> from the <code>iPhone</code>, with the official SDK / Cocoa Touch?</p>
<h3>Restrictions</h3> <p>If you could send an SMS within a program on the iPhone, you'll be able to write games that spam people in the background. I'm sure you really want to have spams from your friends, "Try out this new game! It roxxers my boxxers, and yours will be too! roxxersboxxers.com!!!! If you sign up now...
<p>You need to use the <strong>MFMessageComposeViewController</strong> if you want to show creating and sending the message in your own app.</p> <p>Otherwise, you can use the <strong>sharedApplication</strong> method.</p>
3,201
<p>I have something that is driving me absolutely crazy...</p> <pre><code> Public Function GetAccountGroups() As IList(Of AccountGroup) Dim raw_account_groups As IList(Of AccountGroup) raw_account_groups = _repository.GetAccountGroups().ToList() Dim parents = (From ag In raw_account_groups _...
<p>Lambda's in VB.Net have to return a value, so your equal sign ('=') is being intepreted as a comparison (so that the lambda returns a boolean), rather than an assignment.</p>
<p>I haven't used VB.NET since moving to C# 3.0, but it seems like it could be a type inference issue. The error is a bit odd since List implements IList, so the assignment should work. You can say "p.ID = 123" for the lambda and things seem to work. </p> <p>For anyone else interested in looking into it, here is code ...
9,346
<p>I'm trying to build a C# console application to automate grabbing certain files from our website, mostly to save myself clicks and - frankly - just to have done it. But I've hit a snag that for which I've been unable to find a working solution.</p> <p>The website I'm trying to which I'm trying to connect uses ASP....
<pre><code>&lt;?php /* Resizes an image and converts it to PNG returning the PNG data as a string */ function imageToPng($srcFile, $maxSize = 100) { list($width_orig, $height_orig, $type) = getimagesize($srcFile); // Get the aspect ratio $ratio_orig =...
<p><a href="http://www.phpit.net/article/image-manipulation-php-gd-part2/" rel="nofollow noreferrer">This article</a> seems like it would fit what you want. You'll need to change the saving imagejpeg() function to imagepng() and have it save the file to a string rather than output it to the page, but other than that i...
4,225
<p>I'm using <kbd>Ctrl</kbd>+<kbd>Left</kbd> / <kbd>Ctrl</kbd>+<kbd>Right</kbd> in a GreaseMonkey script as a hotkey to turn back / forward pages. It seems to works fine, but I want to disable this behavior if I'm in a text edit area. I'm trying to use document.activeElement to get the page active element and test if i...
<p>document.activeElement works for me in FF3 but the following also works</p> <pre><code>(function() { var myActiveElement; document.onkeypress = function(event) { if ((myActiveElement || document.activeElement || {}).tagName != 'INPUT') // do your magic }; if (!document.activeElement) { var elements...
<p>element.activeElement is part of HTML5 spec but is not supported by most browsers. It was first introduced by IE.</p>
6,434
<p>I bricked my Tevo Tarantula's controller board, and I've decided to just replace it rather than unbrick it because they are relatively cheap. I recently bought a new MKS GEN L v1.0 board, but I've been unable to flash new firmware onto it. Every time I go to upload the firmware, I get an error just as it begins to u...
<p>Your motherboard is not an MKS GEN L v1.0, it's a <a href="https://github.com/makerbase-mks/Datasheet/blob/master/English%20datasheet/MKS%20SGen%20Datasheet.pdf" rel="nofollow noreferrer">MKS SGEN L</a> - unfortunately, a very very naming scheme.</p> <p>Your board is actually a <strong>32-bit board</strong>, and mus...
<p>Your new board may have a counterfeit FT232R USB-to-serial interface chip, and the Windows update channel has installed hobbled FTDI drivers that won't work with counterfeit chips. The use of counterfeit FT232R chips is very common with budget 3D printer controllers, and FTDI are trying to discourage their use. Beca...
1,775
<p>The following SQL:</p> <pre><code>SELECT notes + 'SomeText' FROM NotesTable a </code></pre> <p>Give the error:</p> <blockquote> <p>The data types nvarchar and text are incompatible in the add operator.</p> </blockquote>
<p>The only way would be to convert your text field into an nvarchar field.</p> <pre><code>Select Cast(notes as nvarchar(4000)) + 'SomeText' From NotesTable a </code></pre> <p>Otherwise, I suggest doing the concatenation in your application.</p>
<p>If you are using SQL Server 2005 (or greater) you might want to consider switching to NVARCHAR(MAX) in your table definition; TEXT, NTEXT, and IMAGE data types of SQL Server 2000 will be deprecated in future versions of SQL Server. SQL Server 2005 provides backward compatibility to data types, but you should probabl...
7,795
<p>Usually it will either will rip the tape, or break the print somehow. Currently using ABS on a taped glass bed with a layer of hairspray for adhesion.</p>
<p>I moved to a plain glass heated bed with a brush applied acetone and ABS mixture. Using an old emptied nail polish bottle with brush, I added some acetone and then threw in ABS pieces until it reached a brush-able consistency. I then brush it on the glass build plate where I believe the print will occur, and it work...
<p>I have had best results with ABS on a heated printbed (untaped) with a thin coat of UHU Stic. It can be a little tricky to remove but minimizes damage.</p>
142
<p>I have some Ruby code which takes dates on the command line in the format:</p> <pre><code>-d 20080101,20080201..20080229,20080301 </code></pre> <p>I want to run for all dates between <code>20080201</code> and <code>20080229</code> inclusive and the other dates present in the list.</p> <p>I can get the string <cod...
<p>But then just do </p> <pre><code>ends = '20080201..20080229'.split('..').map{|d| Integer(d)} ends[0]..ends[1] </code></pre> <p>anyway I don't recommend eval, for security reasons</p>
<p>Combining @Purfideas answer with another answer somewhere on StackOverflow, I solved this by also surrounding the code with an input check, so the only thing used is a valid enumerable </p> <pre><code>if !value[/^[0-9]+\.\.[0-9]+$/].nil? ends = value.split('..').map{|d| Integer(d)} value = ends[0]..ends[1] ...
7,692
<p>I have built a 3D printer with Marlin bugfix-2.0.x forked from github.</p> <p>I am attempting to set the default value for junction deviation so that I don't have to change it through the printer's screen/interface every time I power cycle the printer, but what I thought would set it properly isn't doing the trick....
<p>I've bought an SKR Pro V1.1 which is suffering from the same problem. It has actually to do with a shortcoming or design flaw (of the "HAL" or "Hardware Abstraction Layer" addressing of SPI devices) of Marlin and access to the SD card; I <a href="https://github.com/MarlinFirmware/Marlin/pull/16260" rel="nofollow nor...
<p>For the SKR, to store the new Marlin definitions it is necessary to send the comand <code>M502</code> to restore to the factory settings (will use the configuration on the SD card) and send the comand <code>M500</code> to save the configurations.</p>
1,497
<p>I am using <a href="http://www.hibernate.org/" rel="noreferrer">Hibernate</a> in a Java application to access my Database and it works pretty well with MS-SQL and MySQL. But some of the data I have to show on some forms has to come from Text files, and by Text files I mean Human-Readable files, they can be CSV, Tab-...
<p>Hibernate is written against the JDBC API. So, you need a JDBC driver that works with the file format you are interested in. Obviously, even for read-only access, this isn't going to perform well, but it might still be useful if that's not a high priority. On a Windows system, you can set up ODBC datasources for del...
<p>Like erickson said, your only hope is in finding a JDBC driver for that task. There is maybe <del><a href="https://xlsql.dev.java.net/" rel="nofollow noreferrer">xlsql</a></del> (CSV, XML and Excel driver) which could fit the task. After that, you just have to either find or write the most simple Hibernate Dialect w...
5,347
<p>I recently discovered the org-mode in emacs and it works very well for me. I also like www.RememberTheMilk.com. I would like to be able to sync my org-mode file and RTM list. I know that RTM has its API exposed as web services. I am currently looking for a HTTP library that I could use to write my script. I found a ...
<p>Emacs ships with url.el and url-http.el. Although http-get.el, http-post.el and http-cookies.el are in vogue today. Here's the GitHub link where you can get it from.</p> <p><a href="http://github.com/wfarr/dotfiles/tree/master/.elisp" rel="nofollow noreferrer">http://github.com/wfarr/dotfiles/tree/master/.elisp</a><...
<p>If I were to work on this, I'd use <a href="http://pymacs.progiciels-bpi.ca/" rel="nofollow noreferrer">Pymacs</a> to interface Emacs to Python and then use the existing <a href="http://repo.or.cz/w/pyrtm.git" rel="nofollow noreferrer">Python API kit</a> for Remember the Milk. Why re-implement all the HTTP crud your...
2,747