instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>Wrote the following in PowersHell as a quick iTunes demonstration:</p>
<pre><code>$iTunes = New-Object -ComObject iTunes.Application
$LibrarySource = $iTunes.LibrarySource
foreach ($PList in $LibrarySource.Playlists)
{
write-host $PList.name
}
</code></pre>
<p>This works well and pulls back a list of playlist na... | <p>Here is one thing that I did on my a Powershell script that adds podcasts to iTunes. I use Juice on a server to download all the podcasts that I listen to. The script uses .Net methods to release the COM objects. When I wrote my iTunes script I had read a couple of articles that stated you should release your COM ... | <p>You should be able to set $itunes to $null. Alternatively, $itunes should have a quit method you can call. $itunes.quit()</p>
| 7,551 |
<p>What is the "<em>best</em>" way to store international addresses in a database? Answer in the form of a schema and an explanation of the reasons why you chose to normalize (or not) the way you did. Also explain why you chose the type and length of each field.</p>
<p><strong>Note: You decide what fields you think ar... | <p>Plain freeform text.</p>
<p>Validating all the world's post/zip codes is too hard; a fixed list of countries is too politically sensitive; mandatory state/region/other administrative subdivision is just plain inappropriate (all too often I'm asked which county I live in--when I don't, because Greater London is not ... | <p>You need to provide a bit more details about how you are planning to use the data. For example, fields like City, State, Country can either be text in the single table, or be codes which are linked to a separate table with a Foreign Key.</p>
<p>Simplest would be</p>
<p>Address_Line_01 (Required, Non blank)
Address... | 4,409 |
<p>I have been getting clogs and believe that it may be due to a damaged PTFE tube inside my hot end. I have a replacement (it came with my printer), but I can't seem to fit the tube into the nozzle.</p>
<p>I also tried to turn the original PTFE tube around, and I can't get the other end to fit into the nozzle either... | <p>Yes, with the proper equipment.</p>
<p>Printing wax filament (at 51 seconds): <a href="https://youtu.be/tibkVZB_n9c?t=51s" rel="noreferrer">https://youtu.be/tibkVZB_n9c?t=51s</a></p>
<p>There are also options for melting wax, filling a heated reservoir head, and printing with that. I recommend doing this with a co... | <p>Just make a silicone mold of any of your prints and pour you wax in the silicone,you silicone putty is pretty cheap so is wax ,no need to break the bank as printers have become less expensive and can do a pretty good job </p>
| 633 |
<p>I like putting shortcuts of the form "g - google.lnk" in my start menu so google is two keystrokes away. Win, g.</p>
<p>My eight or so most frequent applications go there.</p>
<p>I also make links to my solution files I am always opening "x - Popular Project.lnk"</p>
<p>Are there any better ways to automate openi... | <p><a href="http://www.autohotkey.com/" rel="nofollow noreferrer">AutoHotkey</a> is a reasonably good program for implementing windows key shortcuts. You might instead define WIN + G to be "open browser to google" which gives you a better response time (don't have to wait for start menu to popup, etc)</p>
<p>There ar... | <p>For shortcuts I use <strong>Launchy</strong></p>
<p>For macros I use <strong>AutoHotKey</strong></p>
<p>Others will suggest <strong>SlickRun</strong> for shortcuts also.</p>
| 6,608 |
<p>I intend and would like to print a transparent hemisphere. I have a Taulman T-Glase clear 1.75 mm filament and I have XTC-3D.</p>
<p>You can read this interesting page, <a href="http://taulman3d.com/t-glase-optics.html" rel="nofollow noreferrer">Hacking t-glase to look more like glass!</a></p>
<p>First question, w... | <p>First I would hedge your expectations.. I am very familiar with t-glase. It is very translucent but it is not clear and no amount of post treatment will make it 100% clear. Their example is the only exception where you have a simple print where it has only a single layer. By applying the clear coating they have norm... | <p>You will not get perfectly clear prints with FDM because of the mechanics of FDM printing there will always be tiny gaps. But, you can get pretty close as demonstrated by a <a href="https://learn.colorfabb.com/lets-make-something-clear/" rel="nofollow noreferrer">ColorFabb tutorial</a>.</p>
<p>A clear filament and ... | 506 |
<p>I have been looking into IKVMing Apache's FOP project to use with our .NET app. It's a commercial product, and looking into licensing, IKVM runs into some sticky areas because of its use of GNU Classpath. From what I've seen, no one can say for sure if this stuff can be used in a commercial product. Has anyone us... | <p>There are multiple issues here as ikvm is currently being transitioned away from the GNU classpath system to Sun's OpenJDK. Both are licensed as GPL+Exceptions to state explicitly that applications which merely use the OpenJDK libraries will not be considered derived works.</p>
<p>Generally speaking, applications ... | <p>I'm not a lawyer but all licenses mentioned are okay to be used in commercial products as long as you don't make any changes and claim the code is yours. </p>
<p>I think if you don't wanna risk anything you should consult a lawyer.</p>
| 3,217 |
<p>I am new to the <code>.Net</code> Compact Framework and have been unable to find an answer via Google. Gasp! Yes, it's true, but that is part of why StackOverflow is here, right?</p>
<p>I have a form that is longer than the screen, so a vertical scroll-bar appears as expected. However, this appears to force a horiz... | <p>Place your controls within a panel or equivalent and then reduce the width of the panel by the size of a vertical scrollbar. That means that when the vertical scrollbar appears then it will no longer require the horizontal scrollbar to make up for the lost width that the vertical scrollbar took.</p>
| <p>Yes - I've got experience with that - unfortunately it was no different from your own. I've generally avoided scrolling forms and used paging wherever possible on .Net CF. If this is an option for you, I'd recommend it.</p>
<p>I'd assume the scroll bar issue is to do with the form size being fixed to the width of t... | 5,115 |
<p>It's not just a capture I'm looking to do here. I want to first capture the packet, then in real time, check the payload for specific data, remove it, inject a signature and reinject the packet into the stack to be sent on as before.</p>
<p>I had a read of the ipfw divert sockets using IPFW and it looks very promis... | <p>See divert sockets: <a href="http://www.faqs.org/docs/Linux-mini/Divert-Sockets-mini-HOWTO.html" rel="nofollow noreferrer">Divert Sockets mini HOWTO</a>.</p>
<p>They work by passing traffic matching a certain ipfw rule to a special raw socket that can then reinject altered traffic into the network layers.</p>
| <p>If you're just looking for packet capture, libpcap is very popular. It's used in basic tools such as tcpdump and ethereal. As far as "hooking into the stack", unless you plan on fundamentally changing the way the way the networking is implemented (i.e. add your own layer or alter the behavior of TCP), your idea of u... | 8,873 |
<p>I'm about to build a <a href="https://toms3d.org/2017/02/23/building-cheapest-possible-prusa-i3-mk2/" rel="noreferrer">Prusa i3 dolly</a>. I am confused whether to use RAMPS 1.4 or 1.5 or 1.6.</p>
<p>What is the big difference? Is it only the MOSFETs and the poly-fuses? If that is the case, would it be advisable to... | <p>One of the thermistor wires had come loose from the crimp ferrules. I re-crimped it and it works fine now. </p>
| <p>This can come from several sources:</p>
<h1>Hardware</h1>
<p>The thermistor or its connections might be damaged, and the fault is only observable when the hotend is hot or moved to a certain area. Start by checking the wiring! You may be able to repair a bad connection easily, but depending what was broken, you may ... | 845 |
<p>Is it possible to create a trigger that will not be in a transaction? </p>
<p>I want to update data on a linked server with a trigger but due to firewall issues we can't create a distributed transaction between the two servers.</p>
| <p>What you probably want is a combination of a queue that contains updates for the linked server and a process that reads data from the queue and updates the remote server. The trigger will then insert a message into the queue as part of the normal transaction. This data will be read by the separate process and used... | <p>I know it's not helpful, so I'll probably get downvoted for this, but really, the solution is to fix the firewall problem.</p>
<p>I think if you use remote (not linked) servers (which are not the preferred option these days) then you can use SET REMOTE_PROC_TRANSACTIONS OFF to prevent the use of DTC for remote tran... | 4,012 |
<p>I like how SQLite library can be included into an application and the application has a full-fledged database to use.</p>
<p>Similarly, is there an open source versioning library that I can include into my application so that I can save versions of files as well as do diffs and merges?</p>
| <p>SVN doesn't require any prerequisites on end user machine. You can embed SVN right into you app. To learn more on subversion integration, visit "<a href="http://www.svnforum.org/2017/viewforum.php?f=17&sid=643adb11d5f8edd09544aa435b6f5732" rel="nofollow noreferrer">Application Integration/Embedding</a>" thread o... | <p>In my opinion <a href="http://www.firebirdsql.org/" rel="nofollow noreferrer">Firebird</a> is one of the best choices for embedded DB scenarios.<br>
Also <a href="http://www.microsoft.com/sql/editions/compact/default.mspx" rel="nofollow noreferrer">Microsoft SQL Server Compact</a> (closed source, but free) might be ... | 6,956 |
<p>Thanks to a Q&A on stackoverflow. I just found out how to determine the installed version on my hosting provider's server. Now I need to know what that number means.</p>
<p>Using <code><%=Environment.Version%></code> on my local machine returns 2.0.50727.3053.</p>
<p>Can someone give me a list of the ver... | <p><a href="https://en.wikipedia.org/wiki/.NET_Framework_version_history" rel="nofollow noreferrer">List of .NET Framework versions</a>.</p>
| <p>When you refer to a given .NET framework then all below can have different version at a given point of time:</p>
<ul>
<li>.NET Framework</li>
<li>Common Language Run-time(CLR): Virtual Execution Environment of a process running a .NET EXE</li>
<li>C#: The programming language you're using to write code</li>
<li>ASP... | 5,821 |
<p>I've got a web application working using VB and Ajax. I'm using updatepanels to avoid the irritating "flicker" on postbacks to the server. </p>
<p>I would like to have a button control defined within the updatepanel itself (tried moving it outside and got some catastrophic error, so left it there) that makes the c... | <p>If you get rid of the UpdatePanels do things work as expected with PostBacks? Chances are something in your Page_Load or other event higher up the chain are "resetting" things in some way before it gets to your click event. Could this be the case?</p>
| <p>I have run into this before and resolved it, I just can't remember how. I will try to find my old code and get back to you. one thought, do you have EnablePartialRendering enabled in your scriptmanager? maybe try wrapping both containers in a third panel.</p>
| 6,621 |
<p>input: phrase 1, phrase 2</p>
<p>output: semantic similarity value (between 0 and 1), or the probability these two phrases are talking about the same thing</p>
| <hr>
<p>You might want to check out this paper:</p>
<p><a href="http://ants.iis.sinica.edu.tw/3BkMJ9lTeWXTSrrvNoKNFDxRm3zFwRR/55/Sentence%20Similarity%20Based%20on%20Semantic%20Nets%20and%20corpus%20statistics.pdf" rel="noreferrer">Sentence similarity based on semantic nets and corpus statistics (PDF)</a></p>
<p>I'v... | <p>Take a look at <a href="http://mkusner.github.io/publications/WMD.pdf" rel="nofollow noreferrer">http://mkusner.github.io/publications/WMD.pdf</a> This paper describes an algorithm called Word Mover distance that tries to uncover semantic similarity. It relies on the similarity scores as dictated by word2vec. Integr... | 8,771 |
<p>I'm currently evaluating the <code>MSF for CMMI</code> process template under <strong>TFS</strong> for use on my development team, and I'm having trouble understanding the need for separate bug and change request work item types.</p>
<p>I understand that it is beneficial to be able to differentiate between bugs (er... | <p>@Luke</p>
<p>I don't disagree with you, but this difference is typically the explanation given for why there is two different processes available for handling the two types of issues.</p>
<p>I'd say that if the color of the home page was originally designed to be red, and for some reason it is blue, that's easily ... | <p>Is my assumption incorrect then that change requests should be generated from bugs? I'm confused because I don't think all bugs should be automatically approved for implementation -- they may be trivial and at least in our case will go through the same review process as a change request before being assigned to a d... | 2,729 |
<p>I have heard that the Liskov Substitution Principle (LSP) is a fundamental principle of object oriented design. What is it and what are some examples of its use?</p>
| <p>A great example illustrating LSP (given by Uncle Bob in a podcast I heard recently) was how sometimes something that sounds right in natural language doesn't quite work in code.</p>
<p>In mathematics, a <code>Square</code> is a <code>Rectangle</code>. Indeed it is a specialization of a rectangle. The "is a"... | <p>Let me try, consider an interface: </p>
<pre><code>interface Planet{
}
</code></pre>
<p>This is implemented by class:</p>
<pre><code>class Earth implements Planet {
public $radius;
public function construct($radius) {
$this->radius = $radius;
}
}
</code></pre>
<p>You will use Earth as:</p>... | 8,097 |
<p>I've done <em>some</em> research on this matter however I cannot find any clear answers. </p>
<p>How does a SolidWorks CAD file get 'converted' into a file format suitable for 3D printing, in detail?</p>
| <p>Any and all CAD files can be converted to STL (Standard Triangle Language). In this file format, surfaces are parsed to be combinations of triangles. For example a flat rectangular surface gets represented as two triangles in the same plane. </p>
<p>As the complexity of the solid increases more triangles are requir... | <p>When you convert it to, let's say, a .stl (3d object file) file, I believe it converts the geometry of the parts into binary and saves the sets. These matrices can be used by the software of 3d printer in order to give the appropriate Trajectory for the extruder. And then the motion of the extruder is 'divided' amon... | 577 |
<p>How can I get programmatic access to the call stack?</p>
| <p>Try <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.stacktrace.aspx" rel="noreferrer">System.Diagnostics.StackTrace</a>.</p>
| <p>The right way is to use the <code>StackTrace</code> and <code>StackFrame</code> classes. Throwing an exception just to get the stack trace is completely misusing exceptions.</p>
| 3,436 |
<p>I'm trying to get a webservice up and running that actually requires to check whois databases. What I'm doing right now is ugly and I'd like to avoid it as much as I can: I call gwhois command and parse its output. Ugly.</p>
<p>I did some search to try to find a pythonic way to do this task. Generally I got quite m... | <p>There's nothing wrong with using a command line utility to do what you want. If you put a nice wrapper around the service, you can implement the internals however you want! For example:</p>
<pre><code>class Whois(object):
_whois_by_query_cache = {}
def __init__(self, query):
"""Initializes the inst... | <pre><code>import socket
socket.gethostbyname_ex('url.com')
</code></pre>
<p>if it returns a gaierror you know know it's not registered with any DNS</p>
| 7,319 |
<p>I get the concept of automatic bed leveling...the printer moves around the bed and uses a sensor to identify high and low spots, then "software compensates for differences". </p>
<p>But what exactly does "compensates" mean? </p>
<p>It is extruding more material in the low spots to build them up and thinning out th... | <p>Last first: use of a raft has nothing to do with bed levelling. It depends only on the features/shape/etc of the object being printed.</p>
<p>Now, as to what the auto-levelling does: the answer is, sadly "it depends." A simple algorithm will just find the Z-height of the four corners and apply a bilinear correcti... | <p>A probe or even manual (e.g. through LCD panel) leveling results in either a reference plane or mesh. This depends on the firmware and the options set in the firmware. Basically, this process maps the geometry of your build plate. Once it knows this geometry, printing an object results in the head following the heig... | 1,017 |
<p>After a long time tweaking my new 3D printer I solved all the unexpected errors and I can print succesful pieces but I am facing a "problem", they are over sized, I found this problem trying to print a Raspberry Pi Case and an smartphone case, the printed pieces are bigger than the objects. </p>
<p>Here some relate... | <p>You have to know:</p>
<ul>
<li>distance between belt teeth (usually 2mm)</li>
<li>number of teeth on pulley</li>
<li>motor step angle 1.8 deg?</li>
<li>microstepping count, probably 16?</li>
</ul>
<p>Then you can enter all these numbers info the calculator here:
<a href="https://www.prusaprinters.org/calculator/" ... | <p>I finally solved it by manually adjusting the <code>steps per unit</code> in the printer firmware. </p>
<p>The process is easy just move the extruder to one position and draw two marks, one at the extruder position and another one 10 cm in the X axis from the extruder position then with Repetier or with the the pri... | 784 |
<p>Looking at the C# project templates in VS2008 and the offerings are WPF User Control Library, WPF Custom Control Library and Windows Forms Control Library. Which of these would you use if you wanted to move a legacy active control written in c++ into the world of C# and .NET?</p>
| <p>It sounds like you are trying to do several different things all at once:</p>
<ol>
<li>Migrate your code to building in a newer version of visual studio.</li>
<li>Migrate your use of technology to a newer technology (ActiveX to .net)</li>
<li>Migrate your language (c++ to c#).</li>
</ol>
<p>If you have a small cod... | <p>There is no project template that will do this for you. You might as well read up and start with a usercontrol.</p>
| 7,924 |
<p>I've made many different seperate parts of a GUI system for the Nintendo DS, like buttons and textboxes and select boxes, but I need a way of containing these classes in one Gui class, so that I can draw everything to the screen all at once, and check all the buttons at once to check if any are being pressed. My que... | <p>This question is very similar to one I was going to post, only mine is for Sony PSP programming.</p>
<p>I've been toying with something for a while, I've consulted some books and <a href="http://www.3dbuzz.com/xcart/product.php?productid=30&cat=12&page=1" rel="nofollow noreferrer">VTMs</a>, and so far this ... | <p>One useful strategy to keep in mind might be the <a href="http://en.wikipedia.org/wiki/Composite_pattern" rel="nofollow noreferrer">composite pattern</a>. At a low level, it might allow you to treat all GUI objects (and collections of objects) more easily once built. But I have no idea what's involved in GUI framewo... | 2,902 |
<p>I'd like to make some custom MenuHeaders in WPF so I can have (for example), an icon and text in a menu item.</p>
<p>Normally using MenuItems, if you populate the Header field with straight text, you can add an accelerator by using an underscore. eg, _File</p>
<p>However, if I wanted to put in a UserControl, I bel... | <p>I think the Icon property fits your needs.<br>
However to answer the original question, it is possible to retain the Accelerator functionality when you compose the content of your menuitem. <strong>If you have nested content in a MenuItem you need to define the AccessText property explicitly</strong> like in the fir... | <p>@a7an: Ah, I didn't notice the Icon property before. That's a good start.</p>
<p>However, specifically I wanted to add an extra 'button' to some MenuItems so I could have a 'Pin' feature (see the recently loaded Documents list in Office 2007 for the feature idea).</p>
<p>Since there needs to be code as well, will ... | 8,406 |
<p>What is the proper way to give printer settings to CuraEngine? Is it possible to put all these settings into a file (like Json formatted)?</p>
<pre><code>CuraEngine.exe -v -o "c:\3d\test.gcode" "c:\3d\test.stl"
</code></pre>
| <p>I'm not sure if it's possible, but on github is code for setting CuraEngine up. Maybe you'll find this link, <a href="https://github.com/Ultimaker/CuraEngine/blob/master/src/settings/settings.cpp" rel="nofollow noreferrer"> CuraEngine/src/settings/settings.cpp</a> helpful. </p>
<p>The latest release has more speed ... | <p>I'm not sure if it's possible, but on github is code for setting CuraEngine up. Maybe you'll find this link, <a href="https://github.com/Ultimaker/CuraEngine/blob/master/src/settings/settings.cpp" rel="nofollow noreferrer"> CuraEngine/src/settings/settings.cpp</a> helpful. </p>
<p>The latest release has more speed ... | 213 |
<p>What Python libraries do folks use for querying Amazon product data? (Amazon Associates Web Service - used to be called E-Commerce API, or something along those lines).</p>
<p>Based on my research, <a href="http://pyaws.sourceforge.net/" rel="noreferrer">PyAWS</a> seems okay, but still pretty raw (and hasn't been u... | <p>I'm using <a href="https://github.com/aurorasoftware/bottlenose">Bottlenose</a>, Dan Loewenherz's "super awesome Python wrapper for the Amazon Product Advertising API". It doesn't parse the XML, so I'm using <a href="http://codespeak.net/lxml/objectify.html">lxml.objectify</a>:</p>
<pre><code>ACCESS_KEY_ID = "..."
... | <p>pyaws is the best in my opinion. The most available version is 0.2.0, but there is also a version 0.3.0 that is somewhat harder to find. The best maintained version of it that I have found though, which is based on 0.3.0, is on <a href="http://bitbucket.org/johnpaulett/pyaws/overview/" rel="nofollow noreferrer">bi... | 7,130 |
<p>The company I work for has an old Access 2000 application that was using a SQL Server 2000 back-end. We were tasked with moving the back-end to a SQL Server 2005 database on a new server. Unfortunately, the application was not functioning correctly while trying to do any inserts or updates. My research has found ... | <p>I've had a similar problem before when using ODBC linked tables to connect to an Sql Server. The solution was to relink the tables and specify the primary key to the table. If Access doesn't know the primary key it cannot perform inserts or updates.</p>
<p>I haven't any experience with ADPs but it could be a simila... | <p>I'd say check the VBA in the Macros to see how it is doing it. It is probably using some form of VB connection to the Database in the back. I love the fact a Database is contacting a Database for it's data... :)</p>
| 3,588 |
<p>What is the best way to localise a date format descriptor?</p>
<p>As anyone from a culture which does not use the mm/dd/yyyy format knows, it is annoying to have to enter dates in this format. The .NET framework provides some very good localisation support, so it's trivial to parse dates according to the users cult... | <p>Here is my current method. Any suggestions?</p>
<pre><code>Regex singleMToDoubleRegex = new Regex("(?<!m)m(?!m)");
Regex singleDToDoubleRegex = new Regex("(?<!d)d(?!d)");
CultureInfo currentCulture = CultureInfo.CurrentUICulture;
// If the culture is netural there is no date pattern to use, so use the defaul... | <p><strong>Best option</strong>: I would instead recommend to use a standard date picker.</p>
<p><strong>Alternative</strong>: every time the content of the edit control changes, parse it and display (in a separate control?) the long format of the date (ie: input "03/04/09" display "Your input: March 4, 2009")</p>
| 2,318 |
<p>I fired up my printer again last night to print something (Printrbot LC that I have customized), and happened to notice the Octopi instance still had a file that I printed ~5 years ago. Also, I noticed i had files from ~2013 when I got started. My printer is from that time, so keep that in mind.</p>
<p>I've noticed ... | <p>This is clearly overextrusion relative to the volume the material is being deposited into, but that doesn't necessarily mean your extrusion rate is wrong. It could be:</p>
<ul>
<li>Nozzle smashed down into the bed (bed way too high) but somehow still extruding</li>
<li>Problem in Z axis movement preventing the head... | <p>Bad filament is my answer. I bought PRLine and both print terrible like your picture. Suspect 2 factors, one is that the line is less than 1.75, so they underextrude and so you see those lines and in some cases gaps, second is the material itself is slippery suggesting to me that it has florinated additives.</p>
| 1,623 |
<p>I've noticed that after my Anet A8 completes a print, the right hand Z mount ends up 1-2 mm lower than the left, even though I make sure both the left and right hand Z mounts of the X-axis are at the same height before switching on the printer.</p>
<p>Does anyone know what the cause of this might be?</p>
<p>I... | <p>My guess is your Z guides are not strictly parallel because there's no instruction how to install X guides correctly. When you install X guides, you can easily make horizontal distance between two Z-mounts either too small or too large, which puts extra stress on one of the Z motors. Move your extruder to home posit... | <p>Try winding the Z axis all the up and down a few times using the front panel controls. Does it still go out of alignment? Is it out of alignment at the top? Does it come back into alignment when you wind it back down?</p>
<p>The principle is: if you have a dodgy motor drive chip, or a mechanical fault, it will skip... | 619 |
<p>I need to test a serial port application on Linux, however, my test machine only has one serial port. </p>
<p>Is there a way to add a virtual serial port to Linux and test my application by emulating a device through a shell or script?</p>
<p>Note: I cannot remap the port, it hard coded on ttys2 and I need to test... | <p>Complementing the @slonik's answer.</p>
<p>You can test socat to create Virtual Serial Port doing the following procedure (tested on Ubuntu 12.04):</p>
<p><strong>Open a terminal (let's call it Terminal 0) and execute it:</strong></p>
<pre><code>socat -d -d pty,raw,echo=0 pty,raw,echo=0
</code></pre>
<p><strong>... | <p>Combining all other amazingly useful answers, I found the below command to be VERY useful for testing on different types of Linux distros where there's no guarantee you're <a href="https://unix.stackexchange.com/questions/590302/getting-the-virtual-comport-addr-from-socat-command-with-grep?newreg=03ecb0aa86ea426d84... | 7,545 |
<p>Is it "taboo" to programatically create system restore points? I would be doing this before I perform a software update. If there is a better method to create a restore point with just my software's files and data, please let me know.</p>
<p>I would like a means by which I can get the user back to a known working... | <blockquote>
<p>Is it "taboo" to programatically create system restore points?</p>
</blockquote>
<p>No. That's why the API is there; so that you can have pseudo-atomic updates of the system.</p>
| <p>I don't think a complete system restore would be a good plan. Two reasons that quickly come to mind:</p>
<ul>
<li>Wasted disk space</li>
<li>Unintended consequences from a rollback</li>
</ul>
| 5,284 |
<p>I know this sounds like a point-whoring question but let me explain where I'm coming from.</p>
<p>Out of college I got a job at a PHP shop. I worked there for a year and a half and thought that I had learned all there was to learn about programming.</p>
<p>Then I got a job as a one-man internal development shop a... | <p><strong>Documentation</strong>. The <a href="http://www.php.net/manual/en/" rel="noreferrer">documentation</a> gets my vote. I haven't encountered a more thorough online documentation for a programming language - everything else I have to piece together from various websites and man pages.</p>
| <p>Boolean casting, which is particularly helpful for redwall_hp's first example, above.</p>
<p>Instead of:</p>
<pre><code>$var = ($_POST['my_checkbox']=='checked') ? TRUE : FALSE;
</code></pre>
<p>You can type:</p>
<pre><code>$var = !!($_POST['my_checkbox']=='checked');
</code></pre>
| 8,661 |
<p>Imagine an object you are working with has a collection of other objects associated with it, for example, the Controls collection on a WinForm. You want to check for a certain object in the collection, but the collection doesn't have a <code>Contains()</code> method. There are several ways of dealing with this.</p... | <p>I would have to say that this is pretty bad practice. Whilst some people might be happy to say that looping through the collection is less efficient to throwing an exception, there is an overhead to throwing an exception. I would also question why you are using a collection to access an item by key when you would be... | <p>The latter is an acceptable solution. Although I would definitely catch on the specific exception (ElementNotFound?) that the collection throws in that case.</p>
<p>Speedwise, it depends on the common case. If you're more likely to find the element than not, the exception solution will be faster. If you're more lik... | 2,977 |
<p>I discovered <a href="http://en.wikipedia.org/wiki/Template_metaprogramming" rel="noreferrer">template metaprogramming</a> more than 5 years ago and got a huge kick out of reading <a href="https://rads.stackoverflow.com/amzn/click/com/0201704315" rel="noreferrer" rel="nofollow noreferrer">Modern C++ Design</a> but I... | <p>I once used template metaprogramming in C++ to implement a technique called "symbolic perturbation" for dealing with degenerate input in geometric algorithms. By representing arithmetic expressions as nested templates (i.e. basically by writing out the parse trees by hand) I was able to hand off all the expression ... | <p>Many programmers don't use templates much because of the poor compiler support up until recently. However, while templates have had a lot of issues in the pas, newer compilers have much better support. I write code that has to work with GCC on Mac and Linux as well as Microsoft Visual C++ and it's only with GCC 4 a... | 8,895 |
<p>I'm looking for a post processing method for increasing the functional strength of a 3d printed part originally made by FDM. I've tried printing my part with solid infill but the layer separation is still the primary failure point. I'm looking for a way to get something closer to a cast or injection molded part. Obv... | <p>Recognizing that the posting party feels that FDM constructed parts are of insufficient strength for his purpose and allowing for proper layer bonding, one can understand that the model can be perfectly constructed and not reach the strength objective.</p>
<p>Filling a model with an epoxy or a casting resin will pr... | <p>Layer separation will always be the primary failure point of FDM. So your best action would be to design parts in such a way that forces are applied across the Z axis, not along it. </p>
<p>If layer bonding is too weak, this is a problem that should be solved during printing. Possible reasons are: </p>
<ul>
<li>No... | 544 |
<p>I am using Apache Axis to connect my Java app to a web server. I used wsdl2java to create the stubs for me, but when I try to use the stubs, I get the following exception:</p>
<blockquote>
<p>org.apache.axis.ConfigurationException: No service named <code><web service name></code> is available</p>
</blockquo... | <p>According to the <a href="http://wiki.apache.org/ws/FrontPage/Axis/DealingWithCommonExceptions">documentation</a> linked to by @arnonym, this exception is somewhat misleading. In the first attempt to find the service a ConfigurationException is thrown and caught. It is logged at DEBUG level by the ConfigurationExcep... | <p>This is what my code looks like. It seems to work fine.
Are you using a service locator or just creating your service?</p>
<pre><code>SomeServiceLocator locator = new SomeServiceLocator();
SomeService service = null;
try
{
service = locator.getSomeServiceImplPort();
}
catch (ServiceException e)
{
e.printSta... | 9,107 |
<p>I have had my Ender 3 v2 for just over two months and have had a blast working with it. I have printed some mods to personalize it.</p>
<p>One of the things that I have done to help mitigate the vibrational noise is to place my Ender 3 on a concrete paver that sits on top of 3 inches of upholstery foam. This has mad... | <p>There are companies making fans with blade design based on owl wings to make the blades quieter. Here's an example <a href="https://www.moduflow.co.uk/owlet-fans/" rel="nofollow noreferrer">https://www.moduflow.co.uk/owlet-fans/</a> and I've seen other designs. I don't know which design ended up being the quietest.... | <p>Fans driven by brushless (BLDC or BL) motors<sup>1</sup> are the quieter option (when compared to cheaper brushed motors).</p>
<p>Mounting the fans using rubber anti-vibration standoffs/mounts<sup>2</sup>, instead of bolts, would also reduce vibration (and hence noise).</p>
<p><a href="https://i.stack.imgur.com/rRS7... | 1,873 |
<p>Using C# and ASP.NET I want to programmatically fill in some values (4 text boxes) on a web page (form) and then 'POST' those values. How do I do this?</p>
<p>Edit: Clarification: There is a service (www.stopforumspam.com) where you can submit ip, username and email address on their 'add' page. I want to be able to... | <p>The code will look something like this: </p>
<pre><code>WebRequest req = WebRequest.Create("http://mysite/myform.aspx");
string postData = "item1=11111&item2=22222&Item3=33333";
byte[] send = Encoding.Default.GetBytes(postData);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
r... | <p>I had a situation where I needed to post free text from a html textarea programmatically and I had issues where I was getting <code><br /></code> in my param list i was building.</p>
<p>My solution was a replace of the br tags with linebreak characters and htmlencoding just to be safe.</p>
<pre><code>Regex.R... | 4,650 |
<p>When I want to make a copy of a database, I always create a new empty database, and then restore a backup of the existing database into it. However, I'm wondering if this is really the least error-prone, least complicated, and most efficient way to do this?</p>
| <p>It is possible to skip the step of creating the empty database. You can create the new database as part of the restore process.</p>
<p>This is actually the easiest and best way I know of to clone a database. You can eliminate errors by scripting the backup and restore process rather than running it through the SQL ... | <p>The <strong>Publish to Provider</strong> functionality has worked great for me. See <a href="http://weblogs.asp.net/scottgu/archive/2006/12/22/recipe-deploying-a-sql-database-to-a-remote-hosting-environment-part-1.aspx" rel="nofollow noreferrer">Scott Gu's Blog Entry</a>.</p>
<p>If you need something really robust... | 2,392 |
<p>I've never gotten a 3D printer, nor do I know very much about them, but I'm thinking of buying a delta 3D printer kit for around $450. When I looked online of some disadvantages of Delta printers I found that they typically don't have Bowden extruders. I'm wondering what are the advantages of a Bowden extruder and s... | <p>My FLSUN Kossel 3D Delta printer ($224) has a bowden extruder. It works really well too.</p>
<p>The main advantage of having one is that it reduces the mass of the hot end. That means less inertia, and it's easier on the driver motors as well. All this leads to (hopefully) greater and more precise control at the ex... | <p>The only advantage of Bowden extruder is a reduced mass of moving parts attached to the effector.</p>
<p>All other differences from direct extruder are to the Bowden's disadvantages. Generally speaking, Bowden-type extruder has much worse control of filament extrusion than direct one.</p>
<p>Since most of the mode... | 561 |
<p>I have a very specific problem using C# and a Windows MDI Form application. I want to display two (or more) images to the user, a 'left' and a 'right' image. The names of the images are concealed from the user, and then the user selects which image they prefer (this is part of a study involving medical image quali... | <p>Why are you using an MDI interface? Surely a single window with a TableLayoutPanel or similar providing layout would be more suitable. The only reason you'd want to use a MDI layout is to allow the users to move the windows, which as far as I can tell from your description of the problem isn't desirable anyway?</p>
| <p>Could you avoid this problem by (before displaying the images) you:</p>
<ol>
<li><p>Put the image references in a structure (array or similar).</p></li>
<li><p>Have a recursive function build a reverse order structure (or reorder the original).</p></li>
<li><p>Use the new reversed order structure to build your chil... | 8,950 |
<p>More out of interest than anything else, but can you compile a DirectX app under linux?</p>
<p>Obviously there's no official SDK, but I was thinking it might be possible with wine.</p>
<p>Presumably wine has an implementation of the DirectX interface in order to run games? Is it possible to link against that? (edi... | <p>I've had some luck with this. I've managed to compile <a href="http://www.directxtutorial.com/Tutorial9/B-Direct3DBasics/dx9B5.aspx" rel="nofollow noreferrer">this simple Direct3D example</a>.</p>
<p>I used winelib for this (wine-dev package on Ubuntu). Thanks to <a href="https://stackoverflow.com/users/9554/alasta... | <p>There is currently no way to compile DirectX code to directly target Linux. You would build your application like you normally would, then run it using a compatibility layer like Wine/Cedega.</p>
| 7,032 |
<p>I have a bunch of servlets running under the Tomcat servlet container. I would like to separate test code from production code, so I considered using a test framework.
JUnit is nicely integrated into Eclipse, but I failed to make it run servlets using a running Tomcat server. Could you please recommend a unit testin... | <p>Check out <a href="http://httpunit.sourceforge.net/doc/servletunit-intro.html" rel="noreferrer">ServletUnit</a>, which is part of HttpUnit. In a nutshell, ServletUnit provides a library of mocks and utilities you can use in ordinary JUnit tests to mock out a servlet container and other servlet-related objects like ... | <p>Updated Feb 2018: <a href="https://closingbraces.net/openbrace/" rel="nofollow noreferrer">OpenBrace Limited has closed down</a>, and its ObMimic product is no longer supported.</p>
<p>If you want a newer alternative to ServletUnit for JUnit testing of Servlets, you might find my company's <a href="http://www.openb... | 7,703 |
<p>Is there a way to find the name of the program that is running in Java? The class of the main method would be good enough.</p>
| <p>Try this:</p>
<pre><code> StackTraceElement[] stack = Thread.currentThread ().getStackTrace ();
StackTraceElement main = stack[stack.length - 1];
String mainClass = main.getClassName ();
</code></pre>
<p>Of course, this only works if you're running from the main thread. Unfortunately I don't think ther... | <p>Or you could just use getClass(). You can do something like:</p>
<pre><code>public class Foo
{
public static final String PROGNAME = new Foo().getClass().getName();
}
</code></pre>
<p>And then PROGNAME will be available anywhere inside Foo. If you're not in a static context, it gets easier as you could use t... | 6,329 |
<p>When exchanging the mainboard of my Ultimaker Original, I found the new (unoriginal) mainboard to have a condensator that is quite a little higher than on the original, which means the fan duct doesn't fit any more.</p>
<p>I read somewhere that those A4988 stepper motor drivers don't have to be actively cooled, but... | <p>This may not be your cuppa tea, but if you're willing to learn to use <a href="http://www.openscad.org/" rel="nofollow noreferrer">OpenSCAD</a> or already know how, there's a <a href="https://www.thingiverse.com/thing:1668883/" rel="nofollow noreferrer">Thingiverse</a> post that appears to directly address your obje... | <p>This is the best and simplest way I've found to transform a flat design into a 3D object that you can then save as an STL file: <a href="https://www.youtube.com/watch?v=ows2QTiMRPg" rel="nofollow noreferrer">Blender-Converting 2D Image to 3D Object</a></p>
<p>This solution requires you to use <a href="https://www.b... | 1,032 |
<p>Is there a way?</p>
<p>I need all types that implement a specific interface to have a parameterless constructor, can it be done?</p>
<p>I am developing the base code for other developers in my company to use in a specific project.</p>
<p>There's a proccess which will create instances of types (in different thread... | <p>Not to be too blunt, but you've misunderstood the purpose of interfaces.</p>
<p>An interface means that several people can implement it in their own classes, and then pass instances of those classes to other classes to be used. Creation creates an unnecessary strong coupling.</p>
<p>It sounds like you really need ... | <p>I don't think so. </p>
<p>You also can't use an abstract class for this.</p>
| 4,657 |
<p>I've recently been working with a MySQL database, and using MySQL workbench to design the Database.</p>
<p>When I use the export to SQL function, so I can actually get the layout in to the Database, I get:</p>
<blockquote>
<p>"Error 1005: Cannot create table"</p>
</blockquote>
<p>This appears to be related to F... | <p>When you get this (and other errors out of the InnoDB engine) issue:</p>
<pre><code>SHOW ENGINE INNODB STATUS;
</code></pre>
<p>It will give a more detailed reason why the operation couldn't be completed. Make sure to run that from something that'll allow you to scroll or copy the data, as the response is quite l... | <p>I ran into this situation recently when I attempted (in InnoDB tables) to make a foreign key reference to a column that had a different data type.</p>
<p><a href="http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html" rel="nofollow noreferrer">MySQL 5.1 Documentation</a></p>
| 5,488 |
<p>I am completely new to 3D printing. I need to build a calibration plate, which I was told can be built using vero back plastic and a 3d printer. But I am afraid I need to know more if I give this to someone for fabrication. In particular, I am wondering how to get the white dots on the surfaces. My question is prob... | <p>The photo is too small to be clear about the entire objective and there are no dimensions provided. A quick google search returns nothing 3d printer related to "black vera plastics" other than a reference to vera bradley, vera wang and an obscure reference to a woven black carpet with white spots of increasing size.... | <p>What are the characteristics of the white dots? (That is, are the dots small raised bumps, do they denote where a hole will be drilled, are they integral to a piece-to-piece connection, etc...) </p>
<p>If these are small bumps that need to be added to the top of the black surfaces, your most time-effective solution... | 435 |
<p>I'm using <code>M80</code> and <code>M81</code> G-codes to power on/off power supply. </p>
<p>Is there a G-code to know the actual state of the power supply?</p>
| <p>I don't have this specific printer but this used to happen to me as well on my D-Bot. The reason being bed not being leveled properly. Ensure that your bed is leveled such that the distance between the nozzle and bed is about 0.2mm after homing. Also coat your bed with something sticky like glue or hairspray. You wo... | <p>I've cleaned the heated bed as suggested using ethanol,
then I've tested the Z distance of the nozzle from the bed with a paper sheet and it was ok. Lastly, I tried to raise the temperature of the extruder for the first layer to 215°C. I think that this did the trick.</p>
| 592 |
<p>In SQL Server I have a <code>DATETIME</code> column which includes a time element.</p>
<p>Example: </p>
<pre><code>'14 AUG 2008 14:23:019'
</code></pre>
<p>What is the <strong>best</strong> method to only select the records for a particular day, ignoring the time part?</p>
<p>Example: (Not safe, as it does no... | <p>Technique 1:</p>
<pre><code> DECLARE @p_date DATETIME
SET @p_date = CONVERT( DATETIME, '14 AUG 2008', 106 )
SELECT *
FROM table1
WHERE column_datetime >= @p_date
AND column_datetime < DATEADD(d, 1, @p_date)
</code></pre>
<p>The advantage of this is that it will use any index on 'column_da... | <p>In sqlserver</p>
<pre><code>DECLARE @p_date DATE
SELECT *
FROM table1
WHERE column_dateTime=@p_date
</code></pre>
<p>In C#
Pass the short string of date value using ToShortDateString() function.
sample:
DateVariable.ToShortDateString();</p>
| 3,200 |
<p>Before it stopped working, the stepper motor worked very well and didn't show any problem. I experienced this after I fixed a filament problem. The filament got stuck soI retracted to pull the filament out of the heat nozzle. But when I finished this, the extruder didn't work anymore...</p>
<p>I restarted the syste... | <p>I have found an answer. So dumb♂️♂️. It need to heat up nozzle before use extrude or retract command</p>
| <p>When you pulled the filament out of the extruder you most likely induced a voltage back into the stepper driver which fried it.</p>
| 1,642 |
<p>For a project I'm working on. I need to look for an executable on the filesystem. For UNIX derivatives, I assume the user has the file in the mighty $PATH variable, but there is no such thing on Windows.</p>
<p>I can safely assume the file is at most 2 levels deep into the filesystem, but I don't know on what drive... | <p><a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html#listRoots()" rel="noreferrer">http://docs.oracle.com/javase/7/docs/api/java/io/File.html#listRoots()</a></p>
<pre><code>File[] roots = File.listRoots();
for(int i = 0; i < roots.length ; i++)
System.out.println("Root["+i+"]:" + roots[i]);
</... | <p>Of course there is a <code>PATH</code> environment variable <a href="http://en.wikipedia.org/wiki/Environment_variable#System_path_variables" rel="nofollow noreferrer">in Windows</a>.</p>
<blockquote>
<blockquote>
<p><code>%PATH%</code>
This variable contains a semicolon-delimited list of directories in w... | 7,436 |
<p>I know that there is no official API for Google Analytics but is there a way to access Google Analytics Reports with C#?</p>
| <p><strong>Update</strong>: Google launched a Google Analytics API today.
<a href="http://analytics.blogspot.com/2009/04/attention-developers-google-analytics.html" rel="noreferrer">Google Analytics Blog - API Launched</a></p>
| <p>Yet another analytics API for C#
<a href="https://github.com/igooana/igooana" rel="nofollow">https://github.com/igooana/igooana</a></p>
<p>This project is aimed at C# 5 and uses <code>async/await</code> and <code>dynamic</code> extensively.
I tried to make this API as simple as possible and maximum type-safe.</p>
| 3,657 |
<p>I often have trouble with prints being especially difficult to remove from the build plate on my Micro3D printer. My wife suggested using a hair dryer on the underside of the plate. I was initially appalled at the idea, but now I think she may be on to something. Is this safe? Good idea? Bad idea? Heresay?</p>
| <p>Typically, people <em>cool down</em> their build plates to get parts to release, rather than heat them up. That said, I doubt a hair drier will get hot enough to do any damage to the build plate. You could try it with no harm done.</p>
| <p>cold wind can help to acceleratory cool down and dry the build plates to make it easy to part them.</p>
| 352 |
<p>We currently deploy web applications by creating a database and running SQL scripts through query analyzer. Then we copy the output from "publish website" and set up that website in IIS.</p>
<p>We have seen websetup in visual studio, but that part seems to be thinly documented. For example, we are not clear how t... | <p>Avoid Visual Studio deployment, and automate as much as possible. Web Deployment Projects and NAnt can be your friends! </p>
<p>Briefly, our deployment setup:</p>
<ol>
<li><p>We use RedGate SQL to script differences between dev and live database.</p></li>
<li><p>An NAnt build file which calls MSBUILD to build the ... | <p>I deploy mostly ASP.NET apps to Linux servers. Here is my standard workflow:</p>
<ul>
<li>I use a source code repository (like Subversion)</li>
<li>On the server, I have a bash script that does the following:
<ul>
<li>Checks out the latest code</li>
<li>Does a build (creates the DLLs)</li>
<li>Filters the files do... | 8,832 |
<p>When installing subversion as a service, I used this command:</p>
<pre><code>c:\>svnservice -install --daemon --root "c:\documents and settings\my_repository"
</code></pre>
<p>And then I got this error:</p>
<pre><code>Could not create service in service control manager.
</code></pre>
<p>After looking at some ... | <p><a href="http://www.visualsvn.com/server" rel="nofollow noreferrer">VisualSVN Server</a> installs as a Windows service. It is free, includes Apache, OpenSSL, and a repository / permission management tool. It can also integrate with Active Directory for user authentication. I highly recommend it for hosting SVN on Wi... | <p>I've never used the command line installer for this. I assume you are downloading the latest from:</p>
<p><a href="http://svnservice.tigris.org/" rel="nofollow noreferrer">http://svnservice.tigris.org/</a></p>
<p>I run the installer, and then use the configuration tool (in the Start Menu, SVN Service, SVN Service... | 3,383 |
<p>I have been using an Anycubic i3 Mega for about a month now and it worked fine. But when I designed a simple model in Fusion 360 and sliced it with Cura it started to have issues sticking to the bed. I thought the problem was the model so I tried to print a Benchy, but the same problem occurred. I readjusted the bed... | <p>The proper answer could be not related to Fusion, as you already noticed.</p>
<p>I suppose the issue is that the Ultrabase surface (or any other glass surface you have installed) was <strong>not cleaned during the first month</strong>? So it should be cleaned from grease and possibly dust. The general cleaning metho... | <p>A "hack" I used was to print with a raft. I decreased the width of the raft in Cura so I'm not printing with excess plastic and the raft ensures my print always sticks.</p>
<p>Another thing to look at is to look at the print speed, a slightly slower speed might help with the build plate adhesion. This is s... | 1,883 |
<p>Is there a simple way of getting a HTML textarea and an input type="text" to render with (approximately) equal width (in pixels), that works in different browsers?</p>
<p>A CSS/HTML solution would be brilliant. I would prefer not to have to use Javascript.</p>
<p>Thanks
/Erik</p>
| <p>You should be able to use</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.mywidth {
width: 100px;
}</code></pre>
<pre class="snippet-code-html lang-html prettypri... | <p>you can also use the following
CSS: </p>
<pre><code>.mywidth{
width:100px;
}
textarea{
width:100px;
}
</code></pre>
<p>HTML:</p>
<pre><code><input class="mywidth" >
<textarea></textarea>
</code></pre>
| 4,833 |
<p>Do you refactor your SQL first? Your architecture? or your code base?
Do you change languages? Do you throw everything away and start from scratch? [Not refactoring]</p>
| <p>I'm adding unit testing to a large, legacy spaghetti codebase. </p>
<p>My approach is, when asked to solve a problem, I try to create a new wrapper around the part of the code-base which is relevant to my current task. This new wrapper is developed using TTD (writing the test first). Some of the time calling <em>in... | <p>This really depends on the state of the codebase... are there massive classes? one class with mega-methods? Are the classes tightly coupled? is configuration a burden?</p>
<p>Considering this, I suggest reading <a href="https://rads.stackoverflow.com/amzn/click/com/0131177052" rel="nofollow noreferrer" rel="nofollo... | 9,187 |
<p>I'm new to 3D printing and I recently got a LulzBot Taz 6 printer.</p>
<p>I'm interested in doing dual extrusion printing (especially with dissolvable supports), but I'm also interested in doing single extrusion prints. In particular, I would like to experiment with printing flexible filament.</p>
<p>The <a href="... | <p>Not an expert by any means but I can’t see any reason you couldn’t use one half of a dual extruder. The benefits of not using one though would be decreased extruder weight. Especially given that this is a direct drive so there will be two stepper motors I believe. Reduced weight means faster print times and a reduct... | <p>This may be too late to help, but I wanted to describe my own experience with the Lulzbot Taz Dual Extruder v3. It was...<a href="https://www.amazon.com/gp/customer-reviews/R259P3UB6DJYQ3?ref=pf_ov_at_pdctrvw_srp" rel="nofollow noreferrer">not good</a>.</p>
<p>In terms of your question, I spent a fair amount of ti... | 808 |
<p>I'm looking to find alternatives to <a href="http://lucene.apache.org/solr/" rel="noreferrer">Solr</a> from the Apache Software Foundation. </p>
<p>For those that don't know, Solr is an enterprise search server. A client application uses a web-services like interface to submit documents for indexing and also to per... | <p>I wrote a long post about my experiences and features of all the engines I listed below but I scrapped it because formatting is a pita. But quite simply if you don't want to shell out money Solr/Lucene or Fast (now MSSE) is really about the best you can do.</p>
<p>Excluded because I have no experience of this produc... | <p><a href="http://omnifind.ibm.yahoo.net/" rel="nofollow noreferrer">IBM Omnifind Yahoo Edition</a> is an Enterprise search server which uses <a href="http://lucene.apache.org/" rel="nofollow noreferrer">Apache Lucene</a> for indexing. It is simple, easy to install and administer. It also has a built in Open Search AP... | 9,250 |
<p>I want to create a draggable and resizable window in JavaScript for cross browser use, but I want to try and avoid using a framework if I can.</p>
<p>Has anyone got a link or some code that I can use?</p>
| <p>JQuery is more focused on a lot of nice utility functions, and makes DOM manipulation a whole lot easier. Basically, I consider it to be Javascript as it should have been. It's a supremely helpful addition to the Javascript language itself.</p>
<p>ExtJS is a suite of GUI components with specific APIs... Use it if y... | <p>Avoiding a framework altogether will leave you with lots of code and a bunch of tedious browser-testing.</p>
<p>If you would consider a framework I'd suggest jQuery with the <a href="http://dev.iceburg.net/jquery/jqDnR/" rel="nofollow noreferrer">jqDnR</a> plugin. I think it will solve your problem or perhaps you c... | 5,057 |
<p>What is the Java analogue of .NET's XML serialization?</p>
| <p><strong>2008 Answer</strong>
The "Official" Java API for this is now JAXB - Java API for XML Binding. See <a href="http://docs.oracle.com/javase/tutorial/jaxb/TOC.html" rel="noreferrer">Tutorial by Oracle</a>. The reference implementation lives at <a href="http://jaxb.java.net/" rel="noreferrer">http://jaxb.java.net... | <pre><code>public static String genXmlTag(String tagName, String innerXml, String properties )
{
return String.format("<%s %s>%s</%s>", tagName, properties, innerXml, tagName);
}
public static String genXmlTag(String tagName, String innerXml )
{
return genXmlTag(tagName, innerXml, "");
}
public st... | 5,636 |
<p>I have a rails application where each user has a separate database. (taking Joel Spolsky's advice on this). I want to run DB migrations from the rails application to create a new database and tables for this user. </p>
<p>What is the easiest way to do this? </p>
<p>Maybe the db migration is not the best for this t... | <p>To answer part of your question, here's how you'd run a rake task from inside Rails code:</p>
<pre><code>require 'rake'
load 'path/to/task.rake'
Rake::Task['foo:bar:baz'].invoke
</code></pre>
<p>Mind you, I have no idea how (or why) you could have one database per user.</p>
| <p>Actually I have discovered a good way to run DB migrations from an application:</p>
<blockquote>
<p>ActiveRecord::Migrator.migrate("db/migrate/")</p>
</blockquote>
| 5,992 |
<p>I want to use a specific foreign language font for a Blackberry application. How is such a font created and loaded onto the Blackberry device?</p>
<p>For example: ਪੰਜਾਬੀ </p>
| <p>A quick google search shows that the same thing has been asked at <a href="http://www.blackberryforums.com/developer-forum/100107-using-custom-fonts.html" rel="nofollow noreferrer">blackberry forums</a>.</p>
<p>The solution they came up with is a class for loading the font from a <a href="http://www.fileinfo.net/ex... | <p>A quick google search shows that the same thing has been asked at <a href="http://www.blackberryforums.com/developer-forum/100107-using-custom-fonts.html" rel="nofollow noreferrer">blackberry forums</a>.</p>
<p>The solution they came up with is a class for loading the font from a <a href="http://www.fileinfo.net/ex... | 9,887 |
<p>Just last night the heat bed stopped working. It was fine up to 75 % of the print, then when it was done the bed was not on anymore. The display said it was set to 50 °C, but it was at 18 °C. I did try moving the pins, and that is not loose (very simple thing to try). </p>
<p>I want to know w... | <p>This is a shot in the dark, but the vast majority of problems with a heating bed stopping to work is usually at the cables/connectors interface.</p>
<p>This is because in printers like the A6, the cable/connector is subject to constant mechanical stress, and - since <a href="https://en.m.wikipedia.org/wiki/Metal_Fa... | <p>The bed stopped working yesterday. I used the multimeter on the bed plug. The bed heater reads 1.7-1.8 Ohm.</p>
<p>There was no 12 V supplied from the mainboard and I read its terminals. There were 12 V there. I tightened the screws and the plug received 12 V.</p>
<p>The bed heated for one prin... | 822 |
<p>I have the following situation: I built an Access form with a subform (which records are linked to the records of main form via certain key). When I try to delete any record in the subform, I get the following message: “Access has suspended the action because you and another user tried to change the data” (approxima... | <p>If you are currently 'editing' the current form then it will not allow the action. Editing a record can sometimes be triggered by simply clicking inside a field, or other simple actions you wouldn't normally consider 'editing'.</p>
<p>This is usually avoided in Access by using the RunCommand method to undo any edit... | <p>Also check the "row locking mechanism" that you have. I haven't used Access in a while but I remember that you could use set that in the table properties. You can access those properties clicking in the famous "dot" in the upper left corner of the table to bring up its properties. Well if you're using Access, you kn... | 5,435 |
<p>How can I get a user-defined function to re-evaluate itself based on changed data in the spreadsheet?</p>
<p>I tried <strong><kbd>F9</kbd></strong> and <strong><kbd>Shift</kbd>+<kbd>F9</kbd></strong>.</p>
<p>The only thing that seems to work is editing the cell with the function call and then pressing Enter.</p>
| <p>You should use <code>Application.Volatile</code> in the top of your function:</p>
<pre><code>Function doubleMe(d)
Application.Volatile
doubleMe = d * 2
End Function
</code></pre>
<p>It will then reevaluate whenever the workbook changes (if your calculation is set to automatic).</p>
| <pre><code>Public Sub UpdateMyFunctions()
Dim myRange As Range
Dim rng As Range
'Considering The Functions are in Range A1:B10
Set myRange = ActiveSheet.Range("A1:B10")
For Each rng In myRange
rng.Formula = rng.Formula
Next
End Sub
</code></pre>
| 3,223 |
<p>How do I escape the underscore character?</p>
<p>I am writing something like the following where clause and want to be able to find actual entries with _d at the end.</p>
<pre><code>Where Username Like '%_d'
</code></pre>
| <p><a href="https://learn.microsoft.com/en-us/sql/t-sql/language-elements/like-transact-sql?view=sql-server-ver15#using-wildcard-characters-as-literals" rel="noreferrer">T-SQL Reference for LIKE</a>:</p>
<blockquote>
<p>You can use the wildcard pattern matching characters as literal characters. To use a wildcard cha... | <p>Adding to <a href="https://stackoverflow.com/a/10415670/12221876">Gerardo Lima's answer</a>, I was having problems when trying to use backslash as my escape character for the ESCAPE clause. This caused issues:</p>
<pre><code>SELECT * FROM table WHERE email LIKE '%@%\_%' ESCAPE '\'
</code></pre>
<p>It was resolved by... | 2,765 |
<p>What are in your opinion big differences between areas of usage for "Astoria" (ADO.NET data services) and SQL Server Data Services?</p>
| <p>They are similiar but very different technologies. Astoria or what is now called at <a href="http://msdn.microsoft.com/en-us/data/bb931106.aspx" rel="nofollow noreferrer">Microsoft ADO.NET Data Services</a> is a programming library that will allow data to be passed through RESTful web services. You develop these we... | <p>I'm pretty sure you can call both Astoria and SQL Data Services with the same code in your app. So it depends on where you want your data - on your servers or in the cloud.</p>
| 9,510 |
<p>Is there a Regular Expression that can detect SQL in a string? Does anyone have a sample of something that they have used before to share?</p>
| <p>Don't do it. You're practically guaranteed to fail. Use <code>PreparedStatement</code> (or its equivalent) instead.</p>
| <p>I don't have a regex but my understanding is that the most important thing is to detect the single quote. All the injection attacks start from there. They probably have the -- in there too to comment out and other SQL that might be after the string.</p>
| 6,690 |
<p>Using the Windows API, how can I get a list of domains on my network?</p>
| <p>Answered my own question:</p>
<p>Use the <a href="http://msdn.microsoft.com/en-us/library/aa370623(VS.85).aspx" rel="nofollow noreferrer">NetServerEnum</a> function, passing in the <code>SV_TYPE_DOMAIN_ENUM</code> constant for the "servertype" argument.</p>
<p>In Delphi, the code looks like this:</p>
<pre><code>&... | <p>Answered my own question:</p>
<p>Use the <a href="http://msdn.microsoft.com/en-us/library/aa370623(VS.85).aspx" rel="nofollow noreferrer">NetServerEnum</a> function, passing in the <code>SV_TYPE_DOMAIN_ENUM</code> constant for the "servertype" argument.</p>
<p>In Delphi, the code looks like this:</p>
<pre><code>&... | 3,036 |
<p>In evaluating different systems integration strategies, I've come across some words of encouragement, but also some words of frustration over BizTalk Server. </p>
<p>What are some pros and cons to using BizTalk Server (both from a developer standpoint and a business user), and should companies also consider open so... | <p>My experience with BizTalk was basically a frustrating waste of time.</p>
<p>There are so many edge cases and weird little business logic tweaks you have to make when you are doing B2B data integration (which is probably the hardest part of any enterprise application) that you just need to roll your own solution.</... | <p>I have no direct experience with JitterBit, but I have heard very good things from coworkers.</p>
| 8,666 |
<p>First, a little background. A couple of years ago, I was researching making my own candy, and I came across this page: <a href="http://www.instructables.com/id/LeGummies-brick-shaped-gummy-candies/" rel="nofollow">Lego brick shaped gummy candies</a>, describing how to use real Lego bricks as a positive to make silic... | <p>In principle, ABS is safe for contact with (cold or room-temperature) food. The two main concerns specific to 3D printing are, assuming you start with a filament that is not itself contaminated:</p>
<ol>
<li><p>Pores and holes in the printed part which may harbor bacteria</p></li>
<li><p>Impurities introduced into ... | <p>The plastic is not quite your main concern (though it still can be). You should worry about the cracks and crevices in FDM prints. Bacteria loves to hide there. For most people, this is the first concern when it comes to "Is X 3D printed food-safe?" If the end product is a hard material, you should sand or smooth yo... | 308 |
<p>Can you have a multicolumn listview control where one of the columns is a checkbox? Example code or links would be greatly appreciated.</p>
<p>I am using visual studio 2005</p>
| <p>Better use grid view control, but if you want <strong>only</strong> one column with checkboxes and that column is the <strong>first</strong> one you can just write: </p>
<pre><code>this.listView1.CheckBoxes = true;
</code></pre>
| <p>You can try <a href="http://www.codeproject.com/KB/tree/treeviewadv.aspx" rel="nofollow noreferrer">TreeViewAdv</a>. It is open source and hosted on sourceforge.</p>
| 8,567 |
<p>I've had some trouble forking of processes from a Perl CGI script when running on Windows. The main issue seems to be that 'fork' is emulated when running on windows, and doesn't actually seem to create a new process (just another thread in the current one). This means that web servers (like IIS) which are waiting f... | <p>If you want to do this in a platform independent way, <a href="http://search.cpan.org/~bzajac/Proc-Background/lib/Proc/Background.pm" rel="nofollow noreferrer">Proc::Background</a> is probably the best way.</p>
| <p><a href="http://www.xav.com/perl/lib/Pod/perlfork.html" rel="nofollow noreferrer">perlfork</a>:</p>
<blockquote>
<p>Perl provides a fork() keyword that
corresponds to the Unix system call of
the same name. On most Unix-like
platforms where the fork() system call
is available, Perl's fork() simply
calls ... | 6,779 |
<p>Is there a tool that allows one to monitor GDI calls?</p>
| <p>Tools like <a href="http://www.automatedqa.com/products/aqtime/index.asp" rel="nofollow noreferrer">AutomatedQA AQTime</a> can help you diagnose GDI usage. A much simpler, but free tool one can be found <a href="http://msdn.microsoft.com/en-us/magazine/cc188782.aspx" rel="nofollow noreferrer">here</a>.</p>
| <p>Good advice, Lars. I've had a similar problem. Now use deleaker and do not worry;) GDI do not lose!</p>
| 6,887 |
<p>I want to show a chromeless modal window with a close button in the upper right corner.
Is this possible?</p>
| <p>You'll pretty much have to roll your own Close button, but you can hide the window chrome completely using the WindowStyle attribute, like this:</p>
<pre><code><Window WindowStyle="None">
</code></pre>
<p>That will still have a resize border. If you want to make the window non-resizable then add ResizeMode="... | <pre><code><Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" WindowStyle="None" ResizeMode="NoResize">
<Button HorizontalAlignment="Right" Na... | 5,868 |
<p>What is the best way to start developing Windows Mobile Professional applications in Python? Is there a reasonable SDK including an emulator? Is it even possible without doing excessive amount of underlaying Windows API calls for UI for instance?</p>
| <p><H2>Python CE</H2>
Python port for Windows CE (Pocket PC) devices. Intended to be as close to desktop version as possible (console, current directory support, testsuite passed). </p>
<p><a href="http://pythonce.sourceforge.net/" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NQmKI.jpg" alt="Python CE... | <p>Just found this: <a href="http://ejr44.blogspot.com/2008/05/python-for-windows-mobile-cab.html" rel="nofollow noreferrer">http://ejr44.blogspot.com/2008/05/python-for-windows-mobile-cab.html</a></p>
<p>Looks like a complete set of .CAB files to provide Python on Windows Mobile.</p>
| 8,531 |
<p>I changed the filament (PLA) in my Wanhao Duplicator I3+. I ended the first try to print when I saw that the 'lines' were too thin. I re-sliced with a higher temperature (195°C instead of 190°C). Now the print started without a problem but after about 25% no more filament came out of the extruder. What can be the re... | <p>I redid the print in order to reply to some questions posed in the answer of @kdtop. The print started but the output was not consistent and sometimes stopped. The temperature is 195°C and sometimes 'drop' to 194°C. First I pushed the new real so that the extruder did not need to pull so much. When this did not solv... | <p>My slicer (Cura-lulzbot) has a setting for initial printing temp, and then printing temp after the first few layers. Is it possible that your temp is initially OK, but then drops too low? Does your printer have a readout that shows the current temp? Is the temp still OK when it stops?</p>
<p>It sounds like you a... | 926 |
<p>I have a little routine that's run under Linux and Windows written in C and displays output on the console. I'm not linking in any form of curses or anything like that.</p>
<p>Currently I clear the screen using</p>
<pre><code>#ifdef __WIN32
system( "cls" );
#else
system( "clear" );
#endif
</code></pre>
<p>The... | <p>Looks like I may have found a windows specific way of doing it <a href="http://msdn.microsoft.com/en-us/library/ms686025(VS.85).aspx" rel="nofollow noreferrer">SetConsoleCursorPosition</a></p>
<p>Ansi escape sequence \033[0;0H for Linux - just printf that to the console.</p>
| <p>Yes, for unix platforms, curses (or ncurses, these days) is the way to go. And there are versions that work under windows, so you could do it the same way on both systems.</p>
| 8,021 |
<p>So I am really fed up with inductive probes. The one I am using keeps getting shifted slightly every time I switch nozzles or run an oozy print. That means I have to autolevel again, then manually set a Z-offset (as I would have anyway if I didn't have an inductive probe).</p>
<p>On my Lulzbot Mini there is a diffe... | <p>Aluminium is conductive, but aluminium oxide is not, which is just so what there (unavoidably, since aluminium rapidly oxidises in air) happens to be a thin layer of on top of your bed. The coating is very thin, but it might foul your plans. It would work better with a sharp probe (that can puncture the layer) than ... | <p>This will not work reliably.</p>
<p>I know, I have tried it, for a couple of years, with poor consistency.</p>
<p>Now, I will tell you that it worked better than the parallax IR sensors. It worked better than trying to slam the head into the bed and listen for the click.</p>
<p>I used the brass nozzle and the al... | 1,409 |
<p>I'm wondering what the best practice is for handling the problem with having to "include" so many files in my PHP scripts in order to ensure that all the classes I need to use are accessible to my script. </p>
<p>Currently, I'm just using <a href="http://php.net/manual/en/function.include-once.php" rel="nofollow no... | <p>I my applications I usually have <code>setup.php</code> file that includes all core classes (i.e. framework and accompanying libraries). My custom classes are loaded using autoloader aided by directory layout map.</p>
<p>Each time new class is added I run command line builder script that scans whole directory tree ... | <p><code>__autoload</code> works well if you have a consistent naming convention for your classes that tell the function where they're found inside the directory tree. MVC lends itself particularly well for this kind of thing because you can easily split the classes into models, views and controllers.</p>
<p>Alternati... | 4,365 |
<p>I am messing around with <a href="http://code.google.com/p/zemscript/" rel="noreferrer">a toy interpreter in Java</a> and I was considering trying to write a simple compiler that can generate bytecode for the Java Virtual Machine. Which got me thinking, how much optimization needs to be done by compilers that target... | <p>I'm just gonna add two links which explain <a href="http://www.ibm.com/developerworks/ibm/library/it-haggar_bytecode/" rel="nofollow noreferrer">Java's bytecode</a> pretty well and some of the <a href="http://www.ibm.com/developerworks/java/library/j-benchmark1.html" rel="nofollow noreferrer">various optimization</a... | <p>Optimising bytecode is probably an oxymoron in most cases. Unless you control the VM, you have no idea what it does to speed up code execution, if anything. The compiler would need to know the details of the VM in order to generate optimised code.</p>
| 4,047 |
<p>How does one <strong>reliably</strong> determine a file's type? File extension analysis is not acceptable. There must be a rubyesque tool similar to the UNIX file(1) command?</p>
<p>This is regarding MIME or content type, not file system classifications, such as directory, file, or socket.</p>
| <p>There is a ruby binding to <code>libmagic</code> that does what you need. It is available as a gem named <a href="https://rubygems.org/gems/ruby-filemagic/versions/0.7.1" rel="noreferrer">ruby-filemagic</a>:</p>
<pre><code>gem install ruby-filemagic
</code></pre>
<p>Require <code>libmagic-dev</code>.</p>
<p>The d... | <p>You could give a go with <a href="http://mime-types.rubyforge.org/" rel="nofollow noreferrer">MIME::Types for Ruby</a>.</p>
<blockquote>
<p>This library allows for the identification of a file’s likely MIME content type. The identification of MIME content type is based on a file’s filename extensions.</p>
</block... | 7,469 |
<p>I'm currently updating a legacy system which allows users to dictate part of the schema of one of its tables. Users can create and remove columns from the table through this interface. This legacy system is using ADO 2.8, and is using SQL Server 2005 as its database (you don't even WANT to know what database it wa... | <p>The code is using a server-side cursor, that's what those calls are for. The first set of calls is preparing/opening the cursor. Then fetching rows from the cursor. Finally closing the cursor. Those sprocs are analogous to the OPEN CURSOR, FETCH NEXT, CLOSE CURSOR T-SQL statements.</p>
<p>I'd have to take a clo... | <p>The behavior you describe is allowed. How is the code making the schema changes? Building SQL on the fly and executing through an ADO Command? Or using ADOX?</p>
<p>If you have access to the database server, try running a SQL Profiler trace while testing the scenario you outlined. See if the trace logs any erro... | 8,235 |
<p>I've been banging my head against <code>SQL Server 2005</code> trying to get a lot of data out. I've been given a database with nearly 300 tables in it and I need to turn this into a MySQL database. My first call was to use bcp but unfortunately it doesn't produce valid CSV - strings aren't encapsulated, so you ca... | <p>The best way that I have found is the <a href="http://www.mysql.com/products/tools/migration-toolkit/" rel="noreferrer">MySQL Migration Toolkit</a> provided by MySQL. I have used it successfully for some large migration projects.</p>
| <p>Rolling your own PHP solution will certainly work though I'm not sure if there is a good way to automatically duplicate the schema from one DB to the other (maybe this was your question).</p>
<p>If you are just copying data, and/or you need custom code anyway to convert between modified schemas between the two DB's... | 2,259 |
<p>Has anyone been able to get an NHibernate-based project up and running on a shared web host?</p>
<p>NHibernate does a whole lot of fancy stuff with reflection behind the scenes but the host that I'm using at the moment only allows applications to run in medium trust, which limits what you can do with reflection, an... | <p>I have had no issues with running NHibernate based apps on WebHost4Life, although I don't like them.</p>
<p>Getting NHibernate to run on medium trust is possible. A full description on how this can be done is found here:</p>
<p><a href="http://blechie.com/WPierce/archive/2008/02/17/Lazy-Loading-with-nHibernate-Und... | <p>I'm using a Finnish host called <a href="http://www.nebula.fi" rel="nofollow noreferrer">Nebula</a> that happily runs my NHibernate-leveraging applications. I had an issue once with trust levels; the machine.config on the host was configured to deny reflection but I successfully overrode it in the web.config.</p>
| 8,684 |
<p>I have an incoming project and the only 3D printer available to me is the TronXY X1. </p>
<p>So the question is: Can it handle at least four days of continuous load or should I search for an alternate solution? </p>
<p><em>I don't want to damage (my only) 3D printer for this project.</em></p>
| <p>I have the same Printer - a TronXY X1, and I feel confident that with a little upgrade here and there, it can handle long prints without problems.</p>
<p>The most needed upgrade is a quality power brick. Mine died after some month. For replacement I have chosen a 12 V/10 A output one of a reputable suppli... | <p>I know that this is a bit <em>wishy-washy</em> but some can, some can't.</p>
<p>The TronXY has a bit of an issue with the power supply to start with. The <em>power brick</em> is a (<em>reportedly</em>) bit suspect, for long jobs, see <a href="https://3dprinting.stackexchange.com/questions/5798/ramps-1-4-with-a-powe... | 949 |
<p>I have started printing about a month ago on an Ender 5 (using mostly PLA but recently also PETG) and it seems it's about time to give the print bed a more thorough cleaning than what I usually do after most prints. I'm using the flexible magnetic mat that came with the printer which has a slightly rough surface, bu... | <p>I have the WhamBam system which uses a PEX layer over flex steel (which sticks to a magnetic sheet on the printer bed). To clean old material off, I use a "brass sponge" intended for cleaning soldering iron tips to remove the old plastic, then give it a wipe with a paper towel with some isopropyl alchohol (I have 99... | <p>I have the WhamBam system which uses a PEX layer over flex steel (which sticks to a magnetic sheet on the printer bed). To clean old material off, I use a "brass sponge" intended for cleaning soldering iron tips to remove the old plastic, then give it a wipe with a paper towel with some isopropyl alchohol (I have 99... | 1,396 |
<p>I see <code>__all__</code> in <code>__init__.py</code> files. What does it do?</p>
| <p>It's a list of public objects of that module, as interpreted by <code>import *</code>. It overrides the default of hiding everything that begins with an underscore.</p>
| <p>This is defined in PEP8 <a href="https://www.python.org/dev/peps/pep-0008/#global-variable-names" rel="nofollow noreferrer">here</a>:</p>
<blockquote>
<p>Global Variable Names</p>
<p>(Let's hope that these variables are meant for use inside one module only.) The conventions are about the same as those for functions.... | 6,662 |
<p>So, in Java, the first line of your constructor HAS to be a call to super... be it implicitly calling super(), or explicitly calling another constructor. What I want to know is, why can't I put a try block around that?</p>
<p>My specific case is that I have a mock class for a test. There is no default constructor... | <p>Unfortunately, compilers can't work on theoretical principles, and even though you may know that it is safe in your case, if they allowed it, it would have to be safe for all cases.</p>
<p>In other words, the compiler isn't stopping just you, it's stopping everyone, including all those that don't know that it is un... | <p>One way to get around it is by calling a private static function. The try-catch can then be placed in the function body.</p>
<pre><code>public class Test {
public Test() {
this(Test.getObjectThatMightThrowException());
}
public Test(Object o) {
//...
}
private static final Object getObjectTha... | 2,728 |
<p>I'm trying to install some Ruby Gems so I can use Ruby to notify me when I get twitter messages. However, after doing a <code>gem update --system</code>, I now get a zlib error every time I try and do a <code>gem install</code> of anything. below is the console output I get when trying to install ruby gems. (along w... | <p>I just started getting this tonight as well. Googling turned up a bunch of suggestions that didn't deliver results</p>
<pre><code>gem update --system
</code></pre>
<p>and some paste in code from jamis that is supposed to replace a function in package.rb but the original it is supposed to replace is nowhere to be... | <p>Try updating <a href="http://gnuwin32.sourceforge.net/packages/zlib.htm" rel="nofollow noreferrer">ZLib</a> before you do anything else. I had a similar problem on OS X and updating <a href="http://search.cpan.org/~pmqs/IO-Compress-2.020/lib/Compress/Zlib.pm" rel="nofollow noreferrer">Compress::Zlib</a> (a Perl inte... | 4,791 |
<p>We are currently using the ExtJS tree view in an application - a requirement has arisen requiring a user to select multiple nodes (which the tree view supports currently through a pluggable selection model) - but you can not then drag the multiple selections to another part of the tree.</p>
<p>Does anyone know of a... | <p>Check out this post in the ExtJS forum that details how you can enable multi-select in a Javascript tree.</p>
<p><a href="http://extjs.com/forum/showthread.php?t=28115" rel="nofollow noreferrer">http://extjs.com/forum/showthread.php?t=28115</a></p>
| <p>Ha i just asked the exact same question in their forum... want to acheive the goal without using the Custom User-Extension tough.</p>
<p><a href="http://www.extjs.com/forum/showthread.php?97463-3.2.0-Treepanel-MultiSelectionModel-and-Dragdrop&p=459962" rel="nofollow noreferrer">http://www.extjs.com/forum/showth... | 6,926 |
<p>With respect to <a href="https://3dprinting.stackexchange.com/questions/7172/dual-extruder-clogging-problem#comment11340_7172">Himanshu's comment</a> about applying a lubricant to PLA filament, and then having read the Reddit thread, <a href="https://www.reddit.com/r/3Dprinting/comments/52xjcg/seasoning_allmetal_hot... | <p>I'm gonna go out on a limb here and say this is probably not a good idea in any capacity.</p>
<p>First off, if you take a look at <a href="https://en.wikipedia.org/wiki/Template:Smoke_point_of_cooking_oils" rel="noreferrer">this list</a> of cooking oils, you'll notice that pretty much all of them have smoke points ... | <p>W.R.T <a href="https://3dprinting.stackexchange.com/a/10247/4762">Nach0z's answer</a>:</p>
<blockquote>
<p>Third, the process of seasoning cast iron works because the surface of the cast iron should be smooth for minimal food sticking, and any kind of rusting causes pits and porosity in the metal.</p>
</blockquote>
... | 1,072 |
<p>I'm using SQL Server 2005, and I would like to know how to access different result sets from within transact-sql. The following stored procedure returns two result sets, how do I access them from, for example, another stored procedure?</p>
<pre><code>CREATE PROCEDURE getOrder (@orderId as numeric) AS
BEGIN
s... | <p>The short answer is: you can't do it.</p>
<p>From T-SQL there is no way to access multiple results of a nested stored procedure call, without changing the stored procedure as others have suggested.</p>
<p>To be complete, if the procedure were returning a single result, you could insert it into a temp table or tabl... | <p>You could select them into temp tables or write table valued functions to return result sets. Are asking how to iterate through the result sets?</p>
| 8,341 |
<p>I'm quite new to 3D-printing. I need to build a curved piece with a hole pattern and I was wondering whether it was possible to print such a hole pattern accurately, with such a thin (3 mm) thickness of the piece. In the past, when I tried printing thinner pieces with holes, the piece warped and holes were not print... | <p>People like PLA for dimensional accuracy. It's disadvantage is it becomes brittle, which can be an issue especially with thin prints if the application tends to bend it (applying force). Working with settings and with a 0.4 mm nozzle, typical for most printers using PLA, you can print walls as thin as 1 mm, but st... | <p>That depends on the printer, the print material and your experience level (and maybe print orientation, but that depends on the load case), but, the depicted part should be printed very well at a thickness of 3 mm (that is not really "thin"). PLA will be easier than higher temp materials like ABS and PETG,... | 1,863 |
<p>I'd like to render to svg data in a swf at runtime (not in Flex - not using degrafa) - how would I go about doing that?</p>
| <p>The Ajaxian blog had a post about this today.</p>
<p><a href="http://ajaxian.com/archives/the-state-of-svg-browser-support-using-flash-for-svg-in-internet-explorer" rel="nofollow noreferrer">http://ajaxian.com/archives/the-state-of-svg-browser-support-using-flash-for-svg-in-internet-explorer</a></p>
| <p>The Ajaxian blog had a post about this today.</p>
<p><a href="http://ajaxian.com/archives/the-state-of-svg-browser-support-using-flash-for-svg-in-internet-explorer" rel="nofollow noreferrer">http://ajaxian.com/archives/the-state-of-svg-browser-support-using-flash-for-svg-in-internet-explorer</a></p>
| 5,291 |
<p>I've created a script that runs every night on my Linux server that uses <code>mysqldump</code> to back up each of my MySQL databases to .sql files and packages them together as a compressed .tar file. The next step I want to accomplish is to send that tar file through email to a remote email server for safekeeping.... | <p>None of the mutt ones worked for me. It was thinking the email address was part of the attachment. Had to do:</p>
<pre><code>echo "This is the message body" | mutt -a "/path/to/file.to.attach" -s "subject of message" -- recipient@domain.example
</code></pre>
| <p>If mutt is not working or not installed,try this-</p>
<pre><code>*#!/bin/sh
FilePath=$1
FileName=$2
Message=$3
MailList=$4
cd $FilePath
Rec_count=$(wc -l < $FileName)
if [ $Rec_count -gt 0 ]
then
(echo "The attachment contains $Message" ; uuencode $FileName $FileName.csv ) | mailx -s "$Message" $MailList
fi*
... | 3,802 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.