instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>So I'm getting a new job working with databases (Microsoft SQL Server to be precise). I know nothing about SQL much less SQL Server. They said they'd train me, but I want to take some initiative to learn about it on my own to be ahead. Where's the best place to start (tutorials, books, etc)? I want to learn more... | <p>If you're planning on coding against a sql database using .NET, skip ADO and go directly to Linq. You will NOT miss anything.</p>
<p>Oh, also, Joe Celko. If you see his name on an article or a book about SQL, read it.</p>
| <p>Yikes...first I'd say "Best of luck to ya!"</p>
<p>Then secondly if you are really serious that you have no experiences with SQL I'd say find one of the SAMS "Teach Yourself SQL in 34 nanoseconds" books. Normally I'd never recommend a SAMS book, but if you are the stalwart type to accept a job you know nothing abo... | 3,879 |
<p>I want to know how to fully uninstall <code>MSSQL 2005</code>. </p>
<p>I've been using the Trial version of SQL Server Reporting Services for a while now. My company finally purchased the software from an online distributor, and for support of Oracle, we needed to upgrade to MSSQL 2005 SP2. Anyway, the "full" v... | <p>@Mark Struzinski</p>
<p>I actually discovered that it was a problem with the installer, when installing the "Full Version". I discovered, since the product was downloaded, instead of delivered on CD/DVD, that the installer was looking for information in a path that was not correct. There was a MS Knowledge Bas... | <p>I had the exact same problem, and this article helped me clean up all the related files from my system and do a fresh install of both Visual Studio and the SQL client components. Give it a try and let me know if it helps you out:</p>
<p><a href="http://support.citrix.com/article/CTX115270" rel="nofollow noreferrer"... | 3,639 |
<p>I have a bunch of legacy documents that are HTML-like. As in, they look like HTML, but have additional made up tags that aren't a part of HTML</p>
<pre><code><strong>This is an example of a <pseud-template>fake tag</pseud-template></strong>
</code></pre>
<p>I need to parse these files. PHP... | <p>You can suppress warnings with <a href="http://www.php.net/manual/en/function.libxml-use-internal-errors.php" rel="noreferrer"><code>libxml_use_internal_errors</code></a>, while loading the document. Eg.:</p>
<pre><code>libxml_use_internal_errors(true);
$doc = new DomDocument();
$doc->loadHTML("<strong>Thi... | <p>My quick and dirty solution to this problem was to run a loop that matches my list of custom tags with a regular expression. The regexp doesn't catch tags that have another inner custom tag inside them. </p>
<p>When there is a match, a function to process that tag is called and returns the "processed HTML". If that... | 9,223 |
<p>Anyone know a good book or post about how to start in EF? I have seen the DnrTV any other place?</p>
| <p>Mike Taulty's Blog: <a href="http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/category/1024.aspx" rel="noreferrer">http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/category/1024.aspx</a></p>
<p>A great EF intro deck: <a href="http://mtaulty.com/CommunityServer/blogs/mike_taultys_... | <p><a href="http://blogs.msdn.com/alexj/" rel="nofollow noreferrer">Alex James, Program Manager on the ADO.Net team</a> at microsoft also has the odd good post on EF especially around Metadata.</p>
| 6,442 |
<p>I am a 3D printing beginner but wanted to get stuck in straight away and design my own 3D objects. I used Sketchup to design a badge of one of my logos. I make sure that all faces of my object are not inside out and show a white face in Sketchup. I also make my entire object a component before exporting into a .stl ... | <p>A red surface coloring is normal for the bottom when viewed in Ultimaker Cura, nothing to worry about that (e.i. when that face is touching the build plate; if it is unsupported, you should add support structures but a raft is generally not necessary for PLA).</p>
<p>Rafts are useful when you print high temperature... | <p>Note: This answer is curently wrong because I mentally reversed your "with raft" and "without raft" columns. I'll attempt to fix it soon.</p>
<p>This doesn't look like a problem with your model, but rather a problem with your bed height or slicer settings (possibly both) that may be affecting your particular model ... | 1,391 |
<p>What is the best way to make a delphi application (delphi 2007 for win32 here) go completely full screen, removing the application border and covering windows task bar ?</p>
<p>I am looking for something similar to what IE does when you hit F11.</p>
<p>I wish this to be a run time option for the user not a design ... | <p>Well, this has always worked for me. Seems a bit simpler...</p>
<pre><code>procedure TForm52.Button1Click(Sender: TObject);
begin
BorderStyle := bsNone;
WindowState := wsMaximized;
end;
</code></pre>
| <p>You need to make sure Form position is poDefaultPosOnly.</p>
<pre><code>Form1.Position := poDefaultPosOnly;
Form1.FormStyle := fsStayOnTop;
Form1.BorderStyle := bsNone;
Form1.Left := 0;
Form1.Top := 0;
Form1.Width := Screen.Width;
Form1.Height := Screen.Height;
</code></pre>
<p>Tested and works on Win7 x64.</p>
| 3,527 |
<p>How do I get Asterisk to forward incoming calls based on matching the incoming call number with a number to forward to? Both numbers are stored in a MySQL database.</p>
| <p>Sorry for the long code sample, but more than half of it is debugging code to help you get it set up.</p>
<p>I'm assuming your server already has a modern version of PHP (at <code>/usr/bin/php</code>) with the PDO library, and that you have a database table named <code>fwd_table</code> with columns <code>caller_id<... | <p><a href="http://scottstuff.net/blog/articles/2004/08/09/database-driven-call-forwarding-with-asterisk" rel="nofollow noreferrer">This article</a> should do the trick. It's about 3 lines of code and some simple queries to add and remove forwarding rules.</p>
| 9,502 |
<p>I just found /n softwares free Powershell NetCmdlets, and after playing with them I love the functionality they bring to the command line. So it raises the question what are your favorite Cmdlets, and how do you use them?</p>
| <p>As a programmer/hacker, <code>Get-Member</code> and <code>Get-Command</code> are the ones I use more than any others, but the ones I use to show off are <code>Select-Control</code> and <code>Send-Keys</code> from <a href="http://CodePlex.com/WASP" rel="nofollow noreferrer">WASP</a>, the <a href="http://PowerGadgets.... | <p>While semi-related to your question, it does not entirely fit the Powershell NetCmdlets motif. But I wanted to post it anyhow as I use it daily and it may help others. Simply making shift-control-c key combo into displaying the visual studio command prompt.</p>
| 2,473 |
<p>I am printing ABS on an Ender 3 printer at a temperature of 240 °C on the nozzle and 110 °C on the bed. I am getting the following result:</p>
<p><a href="https://i.stack.imgur.com/FnLuQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FnLuQ.jpg" alt="enter image description here" /></a></p>
<p>Is ... | <p>I think that your bed is too hot because the bubbling is only on the bottom layer, if it was through out the entire print, I would say that it is your nozzle temp and you should do a temp tower, but because that isn't the case try lowering your bed temp</p>
| <p>I had a similiar issue. First 2 to 4 layers looked god, than a trouble zone with 5 to 10 layers, and after that good again.
In my case the z-layer screws were not tight. During moving up I lost some steps due to the lose screws ...</p>
| 1,940 |
<p>I know 'best' is subjective, so according to you, what is the best solution for the following problem:</p>
<p>Given a string of length n (say "abc"), generate all proper subsets of the string. So, for our example, the output would be {}, {a}, {b}, {c}, {ab}, {bc}, {ac}. {abc}.</p>
<p>What do you think?</p>
| <p>You want the <a href="http://en.wikipedia.org/wiki/Power_set" rel="noreferrer">power set</a>. It can be calculated <a href="http://en.wikipedia.org/wiki/Power_set#Algorithms" rel="noreferrer">recursively and inductively</a>. ;-)</p>
| <pre><code>def subsets(s):
r = []
a = [False] * len(s)
while True:
r.append("".join([s[i] for i in range(len(s)) if a[i]]))
j = 0
while a[j]:
a[j] = False
j += 1
if j >= len(s):
return r
a[j] = True
print subsets("abc")
... | 6,505 |
<p>Today I ran into an issue with the filament not sticking to the build plate. However, the strange part is, that this only happens with one filament color (both PLA, khaki, black works just fine) and only in the main print. The test line on the side of the bed and the brim all stick without a problem. I already relev... | <p>Yes you can edit many parameters in Cura that may help with your problem.</p>
<p>However, I believe an easier fix to this problem may be to either apply some glue or masking tape to the bed before you try to change Cura settings since the problem only occurs with just one filament type..</p>
| <p>Your temperatures look pretty good. You could try raising both bed temperatures by 5°C.</p>
<p>You could try Elmer's glue stick or hair spray.</p>
<p>Make sure your Z height is still OK as well as your bed being level after you loaded the different filament.</p>
| 1,936 |
<p>Is there some way to do multi-threading in JavaScript?</p>
| <p>See <a href="http://caniuse.com/#search=worker" rel="nofollow noreferrer">http://caniuse.com/#search=worker</a> for the most up-to-date support info.</p>
<p>The following was the state of support circa 2009.</p>
<hr />
<p>The words you want to google for are <a href="http://www.google.com/search?q=JavaScript+worker+... | <p>With HTML5 <a href="https://www.w3.org/TR/workers/" rel="nofollow noreferrer">specification</a> you do not need to write too much JS for the same or find some hacks.</p>
<p>One of the feature introduced in HTML5 is <a href="http://www.w3schools.com/html/html5_webworkers.asp" rel="nofollow noreferrer">Web Workers</a... | 4,988 |
<p>I would like to know how to write PHPUnit tests with Zend_Test and in general with PHP.</p>
| <p>I'm using Zend_Test to completely test all controllers. It's quite simple to set up, as you only have to set up your bootstrap file (the bootstrap file itself should NOT dispatch the front controller!). My base test-case class looks like this:</p>
<pre><code>abstract class Controller_TestCase extends Zend_Test_PHPU... | <p>I haven't used Zend_Test but I have written tests against apps using Zend_MVC and the like. The biggest part is getting enough of your bootstrap code in your test setup.</p>
| 9,138 |
<p>Recently I had to develop a SharePoint workflow, and I found the experience quite honestly the most painful programming task I've ever had to tackle. One big problem I had was the problems I encountered when I had to step through it in the debugger.</p>
<p>There's an article on how to debug a SharePoint workflow <a... | <p>The SharePoint team is currently working on MOSS extensions for VS 2008 which will allow this type of functionality. This was available in VS 2005 with MOSS extensions, but has to be run off Windows Server with a full MOSS installation and the correct permissions set.</p>
| <p>Check out <a href="http://www.codeplex.com/stsdev" rel="nofollow noreferrer">STSDev</a> on CodePlex by SharePoint MVPs like Ted Pattison, Andrew Connell, Scot Hillier, and more.</p>
<blockquote>
<p>STSDEV is a proof-of-concept utility application which demonstrates how to generate Visual Studio project files and ... | 2,877 |
<p>Is there a reasonable way to extract plain text from a Word file that doesn't depend on COM automation? (This is a a feature for a web app deployed on a non-Windows platform - that's non-negotiable in this case.)</p>
<p>Antiword seems like it might be a reasonable option, but it seems like it might be abandoned.</... | <p>I use catdoc or antiword for this, whatever gives the result that is the easiest to parse. I have embedded this in python functions, so it is easy to use from the parsing system (which is written in python).</p>
<pre><code>import os
def doc_to_text_catdoc(filename):
(fi, fo, fe) = os.popen3('catdoc -w "%s"' % ... | <p>Honestly <strong>don't use "pip install tika</strong>", this has been developed for mono-user (one developper working on his laptop) and not for multi-users (multi-developpers).</p>
<p>The small class TikaWrapper.py bellow which uses Tika in command line is widely enough to meet our needs.</p>
<p>You just ... | 6,397 |
<p>I have an Ender 3, I got a new glass bed, the bed comes with glue on the back.</p>
<p>Should I stick the glass bed to the aluminium base? or just use it with the clips?
I saw other people just use the clips, but my glass seems to have a sticky back...</p>
<p><a href="https://i.stack.imgur.com/iq7WD.jpg" rel="nofol... | <p>This is opinion-based, but the volcano has drawbacks that affect print quality, mine is oozier and sloppier than a V6 with the shorter, more precise melt zone. It isn’t a slam dunk upgrade, more of a special applications part. I think there is no point to using a Volcano unless you’re running big nozzles fast, like ... | <p>Yes, the Volcano or the Super Volcano allow for larger flow rate (typically when using larger nozzles), that is where they were designed for. Just the nozzle will not help you, you need this larger nozzle shaft to be inside a Volcano heater block, else you cannot transfer the heat.</p>
<p>According to measurements f... | 1,652 |
<p>I have a bunch of files (TV episodes, although that is fairly arbitrary) that I want to check match a specific naming/organisation scheme..</p>
<p>Currently: I have three arrays of regex, one for valid filenames, one for files missing an episode name, and one for valid paths.</p>
<p>Then, I loop though each valid-... | <blockquote>
<p>I want to add a rule that checks for
the presence of a folder.jpg file in
each directory, but to add this would
make the code substantially more messy
in it's current state..</p>
</blockquote>
<p>This doesn't look bad. In fact your current code does it very nicely, and Sven mentioned a good ... | <p>maybe you should take the approach of defaulting to: "the filename is correct" and work from there to disprove that statement:</p>
<p>with the fact that you only allow filenames with: 'show name', 'season number x episode number' and 'episode name', you know for certain that these items should be separated by a "-"... | 3,953 |
<p>Convert a .doc or .pdf to an image and display a thumbnail in Ruby?<br>
Does anyone know how to generate document thumbnails in Ruby (or C, python...)</p>
| <p>A simple RMagick example to convert a PDF to a PNG would be:</p>
<pre><code>require 'RMagick'
pdf = Magick::ImageList.new("doc.pdf")
thumb = pdf.scale(300, 300)
thumb.write "doc.png"
</code></pre>
<p>To convert a MS Word document, it won't be as easy. Your best option may be to first convert it to a PDF before ge... | <p>Not sure about .doc support in any open source library but ImageMagick (and the RMagick gem) can be compiled with pdf support (I think it's on by default)</p>
| 9,101 |
<p>At work we are being asked to create XML files to pass data to another offline application that will then create a second XML file to pass back in order to update some of our data. During the process we have been discussing with the team of the other application about the structure of the XML file. </p>
<p>The samp... | <p>I use this rule of thumb:</p>
<ol>
<li>An Attribute is something that is self-contained, i.e., a color, an ID, a name.</li>
<li>An Element is something that does or could have attributes of its own or contain other elements.</li>
</ol>
<p>So yours is close. I would have done something like:</p>
<p><strong>EDIT</s... | <p>I agree with feenster. Stay away from attributes if you can. Elements are evolution friendly and more interoperable between web service toolkits. You'd never find these toolkits serializing your request/response messages using attributes. This also makes sense since our messages are data (not metadata) for a web ser... | 5,383 |
<p>Can you provide a good example of rule definition language written in C#.<br>
Java guys have <a href="http://herzberg.ca.sandia.gov/" rel="noreferrer">JESS</a>, is there anything good for C#?</p>
| <p>This page shows some examples of open-source rules engines in C#: <a href="http://csharp-source.net/open-source/rule-engines" rel="noreferrer">http://csharp-source.net/open-source/rule-engines</a></p>
| <p>There is the Microsoft Business Rules Engine: <a href="http://msdn.microsoft.com/en-us/library/aa561216.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa561216.aspx</a>. Not sure if it can only be used inside Biztalk - it does says it is a .Net Class Library.</p>
| 6,540 |
<p>Is there an easy way to produce MSDN-style documentation from the Visual Studio XML output?<br>
I'm not patient enough to set up a good xslt for it because I know I'm not the first person to cross this bridge. </p>
<p>Also, I tried setting up sandcastle recently, but it really made my eyes cross. Either I was mis... | <p>You're looking for Sandcastle</p>
<p>Project Page: <a href="http://www.codeplex.com/Sandcastle/Release/ProjectReleases.aspx" rel="noreferrer">Sandcastle Releases</a></p>
<p>Blog: <a href="http://blogs.msdn.com/sandcastle/default.aspx" rel="noreferrer">Sandcastle Blog</a></p>
<p><a href="http://ndoc.sourceforge.ne... | <p>Follow <a href="http://saftsack.fs.uni-bayreuth.de/~dun3/archives/integrate-xml-code-comments-into-visual-studio-20052008-using-sandcastle-and-html-help-20/150.html" rel="nofollow noreferrer">this simple 5 step article</a> and you are pretty much done. As a bonus you can use <a href="http://www.helpware.net/mshelp2/... | 2,329 |
<p>I have the following tables in my database that have a many-to-many relationship, which is expressed by a connecting table that has foreign keys to the primary keys of each of the main tables:</p>
<ul>
<li>Widget: WidgetID (PK), Title, Price </li>
<li>User: UserID (PK), FirstName, LastName</li>
</ul>
<p>Assume th... | <p>You only have one primary key in either case. The second one is what's called a compound key. There's no good reason for introducing a new column. In practise, you will have to keep a unique index on all candidate keys. Adding a new column buys you nothing but maintenance overhead.</p>
<p>Go with option 2.</p>
| <p>Since each User-Widget combination is unique, you should represent that in your table by making the combination unique. In other words, go with option 2. Otherwise you may have two entries with the same widget and user IDs but different user-widget IDs.</p>
| 5,986 |
<p>Does anyone have any recommendations of tools that can be of assistance with moving literal values into resource files for localization?</p>
<p>I've used a resharper plugin called RGreatX but was wondering if there is anything else out there.</p>
<p>It's one heck of a long manual process for moving the strings acr... | <p>Here's one:</p>
<p><a href="http://www.codeplex.com/ResourceRefactoring" rel="noreferrer">http://www.codeplex.com/ResourceRefactoring</a></p>
<p>It'a actually a Microsoft "open source" Visual Studio(2005 and up) tool that integrates with the IDE. You can easily replace every occurence of a string with a ressource... | <p>Try <a href="https://visuallocalizer.codeplex.com" rel="nofollow">Visual Localizer</a> - you can batch-process whole code, select which strings may be localized and the tool will add them to a resource file and create a reference instead. Many other features easing localization are included.</p>
| 3,591 |
<p>Once I have my renamed files I need to add them to my project's wiki page. This is a fairly repetitive manual task, so I guess I could script it but I don't know where to start.</p>
<p>The process is:</p>
<pre><code>Got to appropriate page on the wiki
for each team member (DeveloperA, DeveloperB, DeveloperC)
{
... | <p>Check if the wiki you mean to talk to supports <a href="http://www.jspwiki.org/wiki/WikiRPCInterface2" rel="nofollow noreferrer">XMLRPC</a>, because if it does it should be a snap. I wrote a tool called <a href="http://trac.gargoyle.ath.cx/trac/wiki/WikiUp" rel="nofollow noreferrer">WikiUp</a> to solve a similar pro... | <p>If you're writing in C#, the WebClient classes might be a good place to start. I bet people could give more specific advice if you mentioned which wiki platform you are using, and whether it requires authentication, though.</p>
<p>I'd probably start by downloading fiddler and watching the http requests from doing ... | 3,347 |
<p>I've got a Monoprice Mini Select (15365) and it takes FOREVER for me to manually spin the dial to get the printhead to raise all the way up so that I can perform maintenance (clear blockages in the nozzle or apply new tape to the bed, etc).</p>
<p>So, I was thinking about writing a snippet of gcode that I could jus... | <p>Yes, on machines which will execute "standard" gcode, this will do what you request. Some good resources are <a href="http://reprap.org/wiki/G-code">http://reprap.org/wiki/G-code</a> and <a href="https://en.wikipedia.org/wiki/G-code">https://en.wikipedia.org/wiki/G-code</a></p>
| <p>It really depends on whether you currently have something half printed on the bed when you need to do maintenance.
For example, you may have a blockage mid-print or need to reprime the nozzle. </p>
<p>So with that in mind, personally I would separate the line that does the move into two different lines. </p>
<p>M... | 494 |
<p>I'm experimenting with creating an add-in for Infopath 2007. The documentation is very skimpy. What I'm trying to determine is what kind of actions an add-in can take while designing a form. Most of the discussion and samples are for when the user is filling out the form. Can I, for example, add a new field to the f... | <p>What are you hoping to end up with at the end? The body, the subject, the sender, an attachment? You should spend some time with <a href="http://www.faqs.org/rfcs/rfc2822.html" rel="noreferrer">RFC2822</a> to understand the format of the mail, but here's the simplest rules for well formed email:</p>
<pre><code>HE... | <p>yeah, ive been able to write a basic parser, based off that rfc and some other basic tutorials. but its the multipart mime nested boundaries that keep messing me up.</p>
<p>i found out that MMS (not SMS) messages sent from my phone are just standard emails, so i have a system that reads the incoming email, checks t... | 3,398 |
<p>I have a page results page (you get there after submitting your search query elsewhere) whit a whole bunch of gridviews for different type of data objects.</p>
<p>Obviously, some of the queries take longer than the others. How can I make each gridview render as soon as it has the data it needs?</p>
<p>This has bee... | <p>@Gareth Jenkins</p>
<p>The page will execute all of the queries before returning even the first update panel, so he won't save any time there.</p>
<p>The trick to do this is to move each of your complex gridviews into a user control, in the user control, get rid of the Object DataSource crap, and do your binding i... | <p>Could you put the DataGrids inside panels that have their visibility set to false, then call a client-side javascript function from the body's onload event that calls a server side function that sets the visibility of the panels to true?</p>
<p>If you combined this with an asp:updateProgress control and wrapped the... | 8,425 |
<p>I recently got an Ender 3 Pro for my birthday, and I am having some problems with elephant's foot (as the title suggests). I have tried several fixes; lowering the print speed, changing the print micron size (quality) in my slicer, and I have also tried the masking tape trick (it definitely does not work). I want to... | <p>Elephant's foot can be caused by different causes.</p>
<ul>
<li>Incorrect leveling or incorrect nozzle to bed distance<br><a href="https://3dprinting.stackexchange.com/a/15993/">This answer</a> describes that it can be caused by a too low nozzle to bed distance.</li>
<li>Bed temperature<br>A too high bed temperature... | <p>Elephant foot on an FDM machine is typically caused by more material (filament) being present in that layer than it has space for.</p>
<p>The most common cause of this is your z-zero is too low, so for the first layer the nozzle starts too close to the bed and the filament gets "squeezed" laterally. You ca... | 1,908 |
<p>I have a Tevo Tarantula with a MKS Base 1.5 board and dual extruders. I am running Marlin RC8 Tevo Community build for the dual extruder, large bed and SN04 sensor. </p>
<p>All temperature sensors work and give accurate reading but <code>E1</code> when activated runs at 100% until the overtemps kicks in and shuts... | <p>I am not sure what the hardware config is for the <strong>Tevo Tarantula</strong></p>
<p>Make sure your <code>configuration.h</code> file is setup for your hardware.
The extruder defines are describe in <a href="https://github.com/JimBrown/MarlinTarantula/blob/bugfix-1.1.x/Marlin/Conditionals_LCD.h" rel="nofollow n... | <p>So, following on from <a href="https://3dprinting.stackexchange.com/questions/4177/dual-extruder-setup-in-marlin/4179#4179">Mark's answer</a>, in <a href="https://github.com/JimBrown/MarlinTarantula/blob/bugfix-1.1.x/Marlin/Conditionals_LCD.h#L298" rel="nofollow noreferrer">line 298</a> of <a href="https://github.co... | 616 |
<p><strong><em>Edit:</em></strong> This question had been tagged "Tolstoy" in appreciation of the quality and length of my writing:) Just reading the first and the last paragraph should be enough:) If you tend to select and move code with the mouse, the stuff in middle could be interesting to you.</p>
<p>This questio... | <p>In Emacs:</p>
<ul>
<li>kill-line C-k </li>
<li>transpose-lines C-x C-t</li>
</ul>
<p>C-a C-k C-k -- kill whole line including newline (or <code>kill-whole-line</code> by C-S-backspace).</p>
<p>C-u <number> C-k -- kill <number> of lines (including newlines).</p>
<p>C-y -- yank back the most recently killed ... | <p>Using the <strong>Brief</strong> keyboard mapping this is done using the <strong><kbd>Alt</kbd>+<kbd>L</kbd></strong> to mark the line and the <strong><kbd>-</kbd></strong> key on the numeric keypad (or <strong><kbd>Alt</kbd>+<kbd>D</kbd></strong>) to cut the line to clipboard. The cut will remove the line entirely,... | 8,568 |
<p>I have a function where I need to do something to a string. I need the function to return a boolean indicating whether or not the operation succeeded, and I also need to return the modified string. </p>
<p>In C#, I would use an out parameter for the string, but there is no equivalent in Python. I'm still very ne... | <pre><code>def f(in_str):
out_str = in_str.upper()
return True, out_str # Creates tuple automatically
succeeded, b = f("a") # Automatic tuple unpacking
</code></pre>
| <p>You can use return statement with multiple expressions</p>
| 5,941 |
<p>I'm trying to fetch Wikipedia pages using <a href="http://search.cpan.org/dist/libwww-perl" rel="noreferrer">LWP::Simple</a>, but they're not coming back. This code:</p>
<pre><code>#!/usr/bin/perl
use strict;
use LWP::Simple;
print get("http://en.wikipedia.org/wiki/Stack_overflow");
</code></pre>
<p>doesn't print... | <p>Apparently Wikipedia blocks LWP::Simple requests: <a href="http://www.perlmonks.org/?node_id=695886" rel="noreferrer">http://www.perlmonks.org/?node_id=695886</a></p>
<p>The following works instead:</p>
<pre><code>#!/usr/bin/perl
use strict;
use LWP::UserAgent;
my $url = "http://en.wikipedia.org/wiki/Stack_overfl... | <p>Because Wikipedia is blocking the HTTP user-agent string used by LWP::Simple.</p>
<p>You will get a "403 Forbidden"-response if you try using it.</p>
<p>Try the LWP::UserAgent module to work around this, setting the agent-attribute.</p>
| 4,417 |
<p>I am trying to slice a model that is half a mm less than max width, but not successful.</p>
<p><a href="https://i.stack.imgur.com/puSzw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/puSzw.png" alt="enter image description here"></a></p>
<p>What am I missing? Is there some minimum value less th... | <p>Take a look at this post: <a href="https://community.ultimaker.com/topic/15588-cura-23-not-using-full-print-area/" rel="nofollow noreferrer">https://community.ultimaker.com/topic/15588-cura-23-not-using-full-print-area/</a>. As the raft/skirt/brim will fall outside of the build volume, Cura is not able to slice it. ... | <p><a href="/a/10566">This answer</a> already addresses that Ultimaker Cura "eats up" platform space for e.g. skirt, brim, raft, dual extruder, deposition of priming blob, prime towers, etc. Disabling those features will reclaim platform space so you can print larger prints. <strong><em>However, that will only work whe... | 1,406 |
<p>I am printing using an Ender3 Pro with eSUN PLA+ 215/45 and I am getting this issue on two corners, the other two corners look fine.</p>
<p>Any idea on what can be causing this?</p>
<p>The bad corners</p>
<p><a href="https://i.stack.imgur.com/kr4VD.jpg" rel="noreferrer" title="Bad corners"><img src="https://i.sta... | <p>This has nothing to do with speed, temperature, adhesion, and whatever you do, <strong>DO NOT</strong> extrude more material per line (increase flow rate), as this will make the problem that much worse. </p>
<p>This is a fairly simple problem with an even simpler fix: you're over extruding. Reduce your flow rate ... | <p>Looks like it treated those corners a bit differently in the slice routine. Normally something like this different treatment would be too slight to matter, but (probably due to the slight overhang?) it appears to have caused some layers to not adhere to the bottom ones and get pulled along to a different shape (red... | 1,489 |
<p>I now own the Prusa3D MMU2. The benefits, costs, and experience others have had is well documented. I am interested in rebuilding my large, home-designed delta machine to be multi-material, and don't want to overlook strategies I haven't considered.</p>
<p>My original implementation used an E3D Kraken as the hot-... | <p>Let's look at various methods:</p>
<h2>Multiple Hotends</h2>
<p>The oldest version and one of the best to print materials at vastly different print temperatures (like printing a cheaper PLA infill into a Polycarbonate shell - the print temperature difference is 60-100 °C) is to have 2 or more hotends. This way als... | <p>Another way to combine the simpler geometry of a single nozzle, and to get the reduced mass of a single extrusion tool would be to make it like a CNC machine with a tool changer. One material is printed, then the hot end, extruder, and feed tube are swapped out for another which is primed and ready with the next ma... | 1,334 |
<p>I'm getting an error whenever I load Management Studio or open a folder in the server explorer, etc. Additionally, If I try to create a new database it constantly is updating and does not finish. I have attached a screenshot of the error. Please let me know what I can do to fix this because it's really aggravating.<... | <p>From MSDN forum <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=120476&SiteID=1" rel="nofollow noreferrer">http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=120476&SiteID=1</a></p>
| <p>My first guess would be Client Tool corruption.</p>
<p>I've occasionally had to uninstall my client tools and reinstall them. Boot after uninstall.</p>
| 8,488 |
<p>I have findbugs plugin for eclipse which when run on my project will show results in Bugs explorer clubbed by the type of bug.</p>
<p>I need to be able to do two things:</p>
<ul>
<li>Export all these to excel sheet</li>
<li>Find out the bugs reported in a set of files (and be able to do it recursively w/o running ... | <p>Findbugs dumps its results into an XML file in your workspace's .metadata folder. Look for the subfolder that's named something like findbugs.</p>
<p>You can also download a standalone version of Findbugs that will save the results wherever you like.</p>
<p>Once you have the results file, you might be able to impo... | <p>I had the same problem with findbugs some versions ago.</p>
<p>I updated the plugin today to version 1.3.8 and found out that you can now export and even import reports as XML directly. </p>
<p>All you have to do is right-click on a project either in the package explorer or in the findbugs "Bug explorer" and selec... | 6,853 |
<p>It looks interesting and I've played around with it some --- but the development IDE in a web browser seems to be nightmare eventually.</p>
<p>Does anyone have experience using it and what are your thoughts?</p>
| <p>We evaluated GI a few months ago for a project but didn't end up selecting it.</p>
<p>The IDE-in-a-browser (which is itself build with GI) actually works surprisingly well, though there are some features you normally expect from an editor that it lacks, most notably (and irritatingly) an Undo command. It's also imp... | <p>Kieron does a good job of summarizing GI. It's really for enterprise web applications, not consumer-y widgets. The overhead of loading the entire GI framework and waiting a second or two for it to load doesn;t seem like much if you're firing up a call center or an employee provisioning application you're going to ... | 3,357 |
<p>How do you make your application multithreaded ?
Do you use asynch functions ?
or do you spawn a new thread ?
I think that asynch functions are already spawning a thread so if your job is doing just some file reading, being lazy and just spawning your job on a thread would just "waste" ressources...
So is there some... | <p>Spawning threads is only going to waste resources if you start spawning tons of them, one or two extra threads isn't going to effect the platforms proformance, infact System currently has over 70 threads for me, and msn is using 32 (I really have no idea how a messenger can use that many threads, exspecialy when its... | <p>The use of threads makes you think more about the way your application needs threading and can in the long run make it easier to improve / control your performance.<br>
Async methods are faster to use but they are a bit magic - a lot of things happen to make them possible - so it's probable that at some point you wi... | 8,651 |
<p>I have been wondering about 3D metal printing (steel, aluminium), but after a short research on google I found only too expensive printers (markforged, desktop metal and a few other industrial ones). Is there any less expensive printer that is able to print metal parts on the market ?</p>
| <p>Anzalone and friends published <a href="https://ieeexplore.ieee.org/document/6678531/" rel="noreferrer">A Low-Cost Open-Source Metal 3-D Printer</a> in <em>IEEE Access</em>:</p>
<blockquote>
<p>This paper reports on the development of a open-source metal 3-D printer. The metal 3-D printer is controlled with an op... | <p>You can do lost-PLA investment casting, the actual gear to do it is kind of pricey unless you're willing to create your own DIY forge for melting aluminum.</p>
<p>Check it out though, you don't need a special printer to do it.</p>
<p>There's also a way to coat your prints with metal it would require an electric cu... | 983 |
<p>What kinds of considerations are there for migrating an application from <strong>NHibernate</strong> 1.2 to 2.0? What are breaking changes vs. recommended changes? </p>
<p>Are there mapping issues?</p>
| <p><a href="http://forum.hibernate.org/viewtopic.php?t=985289" rel="noreferrer">Breaking changes in NHibernate 2.0</a></p>
<p><strong>If you have good test coverage it's busywork.</strong></p>
<p>Edit: We upgraded this morning. There is nothing major. You have to Flush() the session after you delete. The Expressio... | <p>I found the answer here:</p>
<p><a href="http://blog.domaindotnet.com/2008/08/24/nhibernate-20-gold-released-must-wait-for-linq-to-nhibernate/" rel="nofollow noreferrer">http://blog.domaindotnet.com/2008/08/24/nhibernate-20-gold-released-must-wait-for-linq-to-nhibernate/</a></p>
<h1>gold release 2.0.0.GA</h1>
<h2... | 4,688 |
<p>I have recently purchased an Anet A8 but have been wondering why the prints look squished and have tiny balls on them. </p>
<p>I am using 1.75 mm cheap PLA bought from eBay and have also had problems of filament oozing out of the print block. </p>
<p><img src="https://i.stack.imgur.com/9bEPO.jpg" alt="Photos ... | <p>It could be that cheap filament has inconsistent diameter, or your calibration is over extruding, or you have something loose that needs to be tight. It's hard for me to tell precisely from just these images. In your shoes, I would print 20mm x 20mm x 10mm, 100% infill boxes until I got it dialed in so that it is ... | <p>You may be having an over-extrusion issue, you should check the flow rate in whatever slicer you use. </p>
<p>You should also check to make sure that the filament diameter you are using matches that of the diameter setting in your slicer.</p>
| 587 |
<p>Are there any free (non-GPL) libraries for .NET that provide IMAP4 server side functionality?</p>
<p>E.g. handles the socket level and message handshaking so that an IMAP4 client (such as outlook) can retrieve, read, edit and/or delete messages. </p>
<p>I am not trying to connect to an IMAP4 server, I'd like the ... | <p>I know I'm answering my own question, but after yet more searching I think I may have found something matching my needs:</p>
<p><a href="http://nmailserver.sourceforge.net/index.php/Main_Page" rel="nofollow noreferrer">NMail</a></p>
<p>Features</p>
<ul>
<li>NMail is a 100% .net application.</li>
<li>A Windows ins... | <p>I'm not sure if you have tried Indy (previously a set of Delphi components) - although I am not sure if they do IMAP4 as their web page is a bit blank, as is their CodePlex hub. Go to <a href="http://indy-project.org" rel="nofollow noreferrer">their website</a>. Other than that I'm not sure - even <a href="http://go... | 9,227 |
<p>I am using cura with M3D entry level printer.</p>
<p>When I print things more than 6-7cm/2.5-3inches, at the end of the print, the hot end sink back into the print then gets stuck as it tries to return to idle position.</p>
<p>Please see the attached photo. Has anyone had this problem? Thank you<a href="https://... | <p>As Oscar commented, check the tail end of your gcode files. Most slicing software includes commands to move the head to x=0,y=0 at the very least. I am a bit surprised that your files don't appear to have this, since Cura does apply said code. </p>
<p>Possiblly there's something lacking in your printer's firmware... | <p>As Oscar commented, check the tail end of your gcode files. Most slicing software includes commands to move the head to x=0,y=0 at the very least. I am a bit surprised that your files don't appear to have this, since Cura does apply said code. </p>
<p>Possiblly there's something lacking in your printer's firmware... | 1,033 |
<p>I'm sure there is a good (or at least decent) reason for this. What is it?</p>
| <blockquote>
<p>I think this is a brilliant question -
and I think there is need of a better
answer.</p>
<p>Surely the only reason is that there
is something in a framework somewhere
that isn't very thread-safe. </p>
</blockquote>
<p>That "something" is almost every single instance member on every singl... | <p>Hmm I'm not pretty sure but I think that when we have a progress controls like waiting bars, progress bars we can update their values from another thread and everything works great without any glitches. </p>
| 3,158 |
<p>Even though chrome runs tabs as different processes it appears to not support this... any ideas or documentation I might have missed?</p>
| <p>Try two different incognito windows.</p>
| <p>If you want to stay logged in for a period of time, the best thing to do is to create a new profile for each set of credentials. Click the face icon in the top right-hand corner and select "new user."</p>
<p><img src="https://i.stack.imgur.com/SoVNQ.png" alt="creating a new profile"></p>
<p>If you just want to log... | 6,226 |
<p>If I have: </p>
<pre><code>signed char * p;
</code></pre>
<p>and I do a comparison:</p>
<pre><code>if ( *p == 0xFF )
break;
</code></pre>
<p>it will never catch 0XFF, but if I replace it with -1 it will:</p>
<pre><code>if ( *p == (signed char)0xFF )
break;
</code></pre>
<p>How can this happen? Is it some... | <p>The value <code>0xFF</code> is a signed int value. C will promote the <code>*p</code> to an <code>int</code> when doing the comparison, so the first if statement is equivalent to:</p>
<pre><code>if( -1 == 255 ) break;
</code></pre>
<p>which is of course false. By using <code>(signed char)0xFF</code> the statement ... | <p>0xff will be seen as an integer constant, with the value of 255. You should always pay attention to these kind of comparison between different types. If you want to be sure that the compiler will generate the right code, you should use the typecast:</p>
<pre>
if( *p == (signed char)0xFF ) break;
</pre>
<p>Anyway, ... | 8,637 |
<p>Is it possible to access the iSight camera on a macbook programmatically? By this I mean I would like to be able to just grab still frames from the iSight camera on command and then do something with them. If so, is it only accessible using objective c, or could other languages be used as well? </p>
| <p>You should check out the <a href="http://developer.apple.com/documentation/QuickTime/Conceptual/QTKitCaptureProgrammingGuide/Introduction/chapter_1_section_1.html#//apple_ref/doc/uid/TP40004574-CH1-DontLinkElementID_41" rel="nofollow noreferrer">QTKit Capture documentation</a>.</p>
<p>On Leopard, you can get at all... | <p>Aside from ObjC, you can use the PyObjC or RubyCocoa bindings to access it also. If you're not picky about which language, I'd say use Ruby, as PyObjC is horribly badly documented (even the official Apple page on it refers to the old version, not the one that came with OS X Leopard)</p>
<p>Quartz Composer is probab... | 3,045 |
<p>I have developed a COM component (dll) that implements an Edit() method displaying a WTL modal dialog.</p>
<p>The complete interface to this COM component corresponds to a software standard used in the chemical process industry (CAPE-OPEN) and as a result this COM component is supposed to be usable by a range of 3r... | <p>Are you using a parent for the Dialog? e.g.</p>
<pre><code>MyDialog dialog(pParent);
dialog.DoModal();
</code></pre>
<p>If you are, try removing the parent. Especially if the parent is the desktop window.</p>
| <p>Whatever you do, <strong>do not</strong> use the desktop window as the parent for your modal dialog box.</p>
<p>See here for explanation: <a href="http://blogs.msdn.com/b/oldnewthing/archive/2004/02/24/79212.aspx" rel="nofollow">http://blogs.msdn.com/b/oldnewthing/archive/2004/02/24/79212.aspx</a></p>
<p>To quote ... | 5,875 |
<p>I am new to 3D printing. I have just put together my own 3D printer with some help.</p>
<p>I was advised I shouldn't print directly onto the aluminium plate - I assume it's aluminium.</p>
<ol>
<li><p>The manufacturer did give me a piece of matrix board (i.e. no cooper at all) to print on. Will this work well?</p><... | <p>Obviously being in a rush can limit your options, but here are a few thoughts:</p>
<p><strong>Quick solutions:</strong></p>
<ul>
<li><strong>Blue painters tape</strong> (as Carl mentioned) will work directly on your heated bed...assuming it's a flat piece of aluminum with the heating element under it. Your surfac... | <p>I have been printing for over 2 years directly onto the 3 mm Aluminum heated bed platform using a touch of PVA based print adhesion spray 3DLAC or Dimafix (see e.g. <a href="https://3dprinting.stackexchange.com/a/6861/">this answer</a> on question "<a href="https://3dprinting.stackexchange.com/questions/3710/should-... | 400 |
<p>Let's say that I want to have a table that logs the date and the number of columns in some other table (or really any sort of math / string concat etc).</p>
<pre><code>CREATE TABLE `log` (
`id` INTEGER NOT NULL AUTO_INCREMENT ,
`date` DATETIME NOT NULL ,
`count` INTEGER NOT NULL ,
PRIMARY KEY (`id`)
);
</code></pre... | <p>Triggers are the best tool for annotating data when a table is changed by insert, update or delete.</p>
<p>To automatically set the date column of a new row in the log with the current date, you'd create a trigger that looked something like this:</p>
<pre><code>create trigger log_date before insert on log
for eac... | <p>Why don't you use information_schema.TABLES?</p>
| 6,722 |
<p>There are many ASP.MVC blog post bits and pieces scattered over different web sites, as well as couple of resource questions here - <a href="https://stackoverflow.com/questions/14599/aspnet-model-view-controller-mvc-where-do-i-start-from">ASP.NET Model-view-controller (MVC) - where do I start from?</a> and <a href="... | <p>Have you looked at <a href="http://www.codeplex.com/mvcsamples" rel="noreferrer">MVC Samples</a> on CodePlex? Rob Conery has some screencasts that go along with the creation of the site at <a href="http://blog.wekeroad.com/mvc-storefront/" rel="noreferrer"><a href="http://blog.wekeroad.com/mvc-storefront/" rel="nore... | <p>In addition to the above mentioned:</p>
<ul>
<li><a href="http://weblogs.asp.net/stephenwalther" rel="nofollow noreferrer">http://weblogs.asp.net/stephenwalther</a></li>
<li><a href="http://www.manning.com/palermo/" rel="nofollow noreferrer">Asp.net MVC in Action</a> looks to be a good book.</li>
</ul>
| 7,591 |
<p>My only functional computer at the moment is a raspberry pi, and I was wondering if there was any software that supported it. My printer is a Newmatter mod-t, but I might be able to modify other software to support it</p>
| <h2>Safety first</h2>
<p>I suggest the following handling of resins, some basic stuff first:</p>
<ul>
<li><strong>ALWAYS</strong> wear disposable, one-use gloves when handling resin.</li>
<li>Respirators are highly advised to be worn.</li>
<li>Work in a well-ventilated area.</li>
<li>Tools dedicated to resin handling a... | <p>Considerations for storing resin include using a light-tight bottle, preventing stray ultraviolet radiation from prematurely curing the resin.</p>
<p>You'll also note that users will filter the resin through a fine mesh filter. I've seen some videos in which the user pours through coffee filters to remove as many pa... | 1,753 |
<p>I have done Java and JSP programming in the past, but I am new to Java Server Faces and want to know if there's a set of best practices for JSF development. </p>
| <p>Some tips:
Understand the JSF request <a href="http://www.java-samples.com/showtutorial.php?tutorialid=470" rel="nofollow noreferrer">lifecycle</a> and where your various pieces of code fit in it. Especially find out why your model values will not be updated if there are validation errors.</p>
<p>Choose a tag libra... | <p>Select a good component library .Do not use richfaces , i suggest you dont use jsf , use spring mvc,jquery fro view and json in a rest architecture. but if you have to ,use primefaces it easy to use and has enough components.</p>
| 5,188 |
<p>Is there any way to prevent Visual Studio from creating a VSMacros80 folder in my default project directory?</p>
| <p>I just found it out myself: If you add a trailing backslash to the <em>Project Folder</em> setting e.g. changing it from <code>C:\dev</code> to <code>C:\dev\</code>, the <code>VSMacros80</code> directory will no longer be created. </p>
<p>I tested it with Visual Studio 2005 SP1, with all windows updates installed.<... | <p>I could not find the previous thread, because I was searching for "vsmacros" instead of "vsmacros80".</p>
<p>There are currently 5 different entries in <code>Tools->Options->Addin/Macro Security</code></p>
<pre><code>%ALLUSERSPROFILE%\Application Data\Microsoft\MsEnvShared\Addins
%APPDATA%\Microsoft\MsEnvSha... | 9,574 |
<p>Does anyone have time to take a look at it? </p>
<p>I've read a bit and it promises a lot, if it's half what they say, it'll change web Development a lot</p>
| <p>I have compared Mozilla Firefox 3.0.1 and Google Chrome 0.2.149.27 on <a href="http://www2.webkit.org/perf/sunspider-0.9/sunspider.html" rel="noreferrer">SunSpider JavaScript Benchmark</a> with the following results:</p>
<ul>
<li>Firefox - total: 2900.0ms +/- 1.8%</li>
<li>Chrome - total: <strong>1549.2ms +/- 1.7%<... | <p>It's really speedy. Visibly so. I was pretty impressed with its performance compared with Firefox 3. Already made it my default browser.</p>
| 6,227 |
<p>I have a web service that I created in C# and a test harness that was provided by my client. Unfortunately my web service doesn't seem to be parsing the objects created by the test harness. I believe the problem lies with serializing the soap packet. </p>
<p>Using TCPTrace I was able to get the soap packet passed t... | <p>A somewhat manual process would be to use the <a href="http://code.google.com/p/poster-extension/" rel="nofollow noreferrer">Poster</a> add-in for Firefox. There is also a java utility called <a href="http://sourceforge.net/project/showfiles.php?group_id=136013&package_id=163662&release_id=500134" rel="nofo... | <p>Same as palehorse, use soapUI or directly the specific component for that feature: <a href="http://ws.apache.org/commons/tcpmon/" rel="nofollow noreferrer">TCPMon</a>.</p>
| 4,827 |
<p>What culprits are the most likely to cause a <code>404 resource not found</code> error when a page in a given .WAR, autocreated by Sun's J2EE <code>deploytool</code>, is trying to load a Servlet in the same .WAR file?
<br/>
Eg:</p>
<blockquote>
<p> <h1>HTTP Status 404 - /MyServlet/MyServlet</h1><p><b>type</b> Sta... | <p>Is there a valid <servlet-mapping> for 'MyServlet' in your web.xml? That's been my number one culprit in the past</p>
| <p>I just spent about an hour pulling my hair out on this very problem. Tomcat 5.5.27 on OSX was working just fine until I'd added another servlet and servlet-mapping at which point <em>everything</em> was returning a 404. I hadn't realized it, but when I'd added a new servlet/servlet-mapping pair I'd put the servlet-m... | 9,230 |
<p>The reason I ask is that Stack Overflow has been <a href="http://slashdot.org/firehose.pl?op=view&id=1170403" rel="nofollow noreferrer">Slashdotted</a>, and <a href="http://www.reddit.com/r/programming/comments/71i4v/stack_overflow_launched_into_public/" rel="nofollow noreferrer">Redditted</a>.</p>
<p>First, wh... | <p>Unfortunately, if you haven't planned for this before it happens, it's probably too late and your users will have a poor experience. </p>
<p>Scalability is your first immediate concern. You may start getting more hits per second than you were getting per month. Your first line of defense is good programming and d... | <p>The app designer needs to think about scaling up (larger machines with more cores and higher performance) and/or scaling out (distributing workload across multiple systems). The IT guy needs to work out how to best support that. The network is what you look at first, because obviously everything rides on top of it.... | 8,780 |
<p>I did my homework reading similar questions, like <a href="https://3dprinting.stackexchange.com/questions/8296/petg-sticking-to-nozzle">this</a>, <a href="https://3dprinting.stackexchange.com/questions/7122/petg-filament-doesnt-stick-reliably-to-fake-buildtak-surface">this</a> and <a href="https://3dprinting.stackex... | <p>Your nozzle is very much too high to properly print just about any filament. If the filament sticks to the nozzle after it is positioned closer to the bed, you have two problems. The first is the initial layer position, sometimes called z-offset. The second is bed adhesion.</p>
<p>While the bed is cool, clean it car... | <p>With one brand of PETG I used 110 degrees on the build plate and 240 for the nozzle. Couldn't get a decent first layer before that.</p>
| 2,190 |
<p>In MS Access 2003 (I know, I know), I'm using the OLE Object data type to persist the sate of some objects that are marked as serializable (just using a IO.BinaryFormatter to serialize to a MemoryStream, and then saving that to the db as a Byte array). Does this work pretty much like a varbinary, or a blob? Are th... | <p>In access I never figured out how to properly use the OLE object data type without real performance problems (and structural too -- lots of compact and repair jobs). The solution path I've always taken (mind you I haven't used Access in anger now for <strong><em>years</em></strong>) is to just store the blogs onto ... | <p>I can't answer your specific question, but you might want to look at the GetChunk and AppendChunk methods in Access help, since those are the methods used for writing and manipulating data in binary fields.</p>
| 5,170 |
<p>How do you convert between hexadecimal numbers and decimal numbers in C#?</p>
| <p>To convert from decimal to hex do...</p>
<pre><code>string hexValue = decValue.ToString("X");
</code></pre>
<p>To convert from hex to decimal do either...</p>
<pre><code>int decValue = int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber);
</code></pre>
<p>or </p>
<pre><code>int decValue = Convert.T... | <p>An extension method for converting a byte array into a hex representation. This pads each byte with leading zeros.</p>
<pre><code> /// <summary>
/// Turns the byte array into its Hex representation.
/// </summary>
public static string ToHex(this byte[] y)
{
StringBuilder sb = ... | 9,984 |
<p>I currently use a BLtouch 3.1, which is known to stop operating at about 35-40 °C. In fact, when I preheat the bed at 100 °C close to the probe, I sometimes get issues with the pin not retracting correctly.</p>
<p>I would like in the future to enclose and heat the printer chamber, therefore I need a probe capable of... | <p>Have you considered using or adapting Prusa’s P.I.N.D.A. V2 or SuperPINDA? Seems that within some bounds they’ve solved the temperature compensation issue.</p>
<p>The older P.I.N.D.A. V1 sensor seems to be temperature-sensitive. See more information in <a href="https://help.prusa3d.com/en/article/p-i-n-d-a-superpind... | <p>There are various designs which can be made to work at 100 °C.</p>
<p>For example this <a href="https://www.thingiverse.com/thing:4390007" rel="nofollow noreferrer">solenoid probe</a> uses a solenoid to lift a plunger during print, letting it drop during probing. The design uses a rare earth magnet which usually los... | 1,860 |
<p>I like the XMLReader class for it's simplicity and speed. But I like the xml_parse associated functions as it better allows for error recovery. It would be nice if the XMLReader class would throw exceptions for things like invalid entity refs instead of just issuinng a warning.</p>
| <p>I'd avoid SimpleXML if you can. Though it looks very tempting by getting to avoid a lot of "ugly" code, it's just what the name suggests: simple. For example, it can't handle this:</p>
<pre><code><p>
Here is <strong>a very simple</strong> XML document.
</p>
</code></pre>
<p>Bite the bul... | <p>I mostly stick to SimpleXML, at least whenever PHP5 is available for me.</p>
<p><a href="http://www.php.net/simplexml" rel="nofollow noreferrer">http://www.php.net/simplexml</a></p>
| 9,406 |
<p>We are using the Board SKR 1.3 with the following pins:</p>
<pre><code>/**
* Trinamic Stallguard pins
*/
#define X_DIAG_PIN P1_29 // X-
#define Y_DIAG_PIN P1_27 // Y-
#define Z_DIAG_PIN P1_25 // Z-
#define E0_DIAG_PIN P1_28 // X+
#define E1_DIAG_PIN P1_26 ... | <p>I second the previous answer if running second Z motor in parallel, just split wires or buy adapter consisting of two females to one male, Z motor on most printers don't draw huge current (or at least in smaller less frequent intervals to give things time to cool). </p>
<p>Erm I extruder with two temperature zones,... | <p>Unfortunately, I faced the same problem. The heated chamber will not be accurate enough due to lack of PID tuning. As a result, the temp will differ up to 10 degrees celsius when the heater is on. Is a big difference that will either not dry your filament enough or in the worst scenario will melt it. You will need t... | 1,608 |
<p>I'm currently designing a program that will involve some physics (nothing too fancy, a few balls crashing to each other)</p>
<p>What's the most exact datatype I can use to represent position (without a feeling of discrete jumps) in c#?</p>
<p>Also, what's the smallest ammount of time I can get between t and t+1? O... | <p>In .Net a <code>decimal</code> will be the most precise datatype that you could use for position. I would just write a class for the position:</p>
<pre><code>public class Position
{
decimal x;
decimal y;
decimal z;
}
</code></pre>
<p>As for time, your processor can't give you anything smaller than one... | <p>I'm not sure I understand your last question, could you please clarify?</p>
<p>Edit:</p>
<p>I might still not understand, but you can use any type you want (for example, doubles) to represent time (if what you actually want is to represent the discretization of time for your physics problem, in which case the tick... | 4,855 |
<p>I have had problems with items sticking on the build plate, especially when they were big (as they didn't stick well, they corners warped -> all kind of problems).</p>
<p>I also wanted to upgrade my printer (Scratch XYCore-Bowden) to have the ability to use flexible filament so first I modified my extruder motor/co... | <p>If your print is sticking too well, try printing directly onto the glass.<br>
If then, your print isn't sticking well enough, try using something like a glue stick instead.
Most people use a paint scraper (<a href="https://mobileimages.lowes.com/product/converted/820909/820909561316.jpg" rel="noreferrer">a small one... | <p>Technology has come to the rescue here. New printing surfaces are available that release PLA very easily. I am using the WhamBam system. A magnet is stuck to the AL bed. A flex steel sheet is placed on the magnet. The flexsteel has a PEX sheet stuck to it.</p>
<p>After levelling the bed, a print is done normally.... | 914 |
<p>Printer: Monoprice Select V2.</p>
<p>I've done several prints already and swapped out filaments many times but in my most recent swap, I can't feed my PLA through any more.</p>
<p>I first preheat my extruder for PLA temps (185 °C). Then I press the plastic thingy to allow me to push as much of the filamen... | <p>I figured out the issue. I think I was shoving it in the wrong hole.</p>
<p>I took apart my extruder component. There's a good video on it <a href="https://youtu.be/37df_c2hqYE?t=194" rel="nofollow noreferrer">here</a>.
But basically, you just have to loosen the two bottom screws on the side fan like this:
<a href=... | <p>Maybe some PLA is stuck in the throat above the heat break. Can you feed a very small wire all the way through it, or see light through the filament path?</p>
<p>185 is a little on the cold side. I would suggest trying to feed at 195 before taking more drastic measures.</p>
| 1,183 |
<p>I bought an Anet A8 over christmas. When I bought my printer from Gearbest, I also bought the inductive sensor that they <a href="http://www.gearbest.com/3d-printer-parts/pp_591321.html" rel="nofollow noreferrer">sell</a>.</p>
<p>It doesn't seem to work, and I think it might be broken. However, I have no idea how I... | <p>I am not entirely familiar with the ANET A8 electronics, but it's very unlikely it's any different from how any other mainboard works, so any instructions that work for RAMPS should work for your board as well.</p>
<p>The sensor you linked to has an operating voltage range of "6V to 36V". However, the ends... | <p>You will have to:</p>
<ol>
<li><p>Find and print something on Thingiverse to mount sensor;</p></li>
<li><p>Change firmware to Skynet and change the offset values accordingly, in order for the new sensor to recognize the bed.</p></li>
</ol>
<p>There is official Facebook page of Anet A8 printers as well as Skynet fi... | 480 |
<p>I have a large application that uses EJB 2.x entity beans (BMP). This is well-known to be a horrible persistence strategy (I can elaborate if necessary).</p>
<p>I'd like to start migrating this application to use a much more expressive, transparent, and non-invasive persistence strategy, and given my company's prev... | <p>The table cell needs the text-align: center.</p>
| <p>The <code>text-align: center</code> should be sufficient, since you're centering the text inside a block element (h2) - adjusting the margins will change the position of the block, not the text.</p>
<p>I wonder if it's just that IE is having a dummy-spit at that <code>font</code> declaration you've got there?</p>
| 9,414 |
<p>It is generally accepted that the use of cursors in stored procedures should be avoided where possible (replaced with set based logic etc). If you take the cases where you need to iterate over some data, and can do in a read only manner, are fast forward (read only forward) cursor more or less inefficient than say w... | <p>While a fast forward cursor does have some optimizations in Sql Server 2005, it is <em>not</em> true that they are anywhere close to a set based query in terms of performance. There are very few situations where cursor logic cannot be replaced by a set-based query. Cursors will always be inherently slower, due in ... | <p>The 'Best Practice' of avoiding cursors in SQL Server dates back to SQL Server 2000 and earlier versions. The rewrite of the engine in SQL 2005 addressed most of the issues related to the problems of cursors, particularly with the introduction of the fast forward option. Cursors are not neccessarily worse than set... | 5,765 |
<p>I have a database that contains a date and we are using the MaskedEditExtender (MEE) and MaskedEditValidator to make sure the dates are appropriate. However, we want the Admins to be able to go in and change the data (specifically the date) if necessary. </p>
<p>How can I have the MEE field pre-populate with the ... | <p>We found out this morning why our code was mishandling the extender. Since the db was handling the date as a date/time it was returning the date in this format 99/99/9999 99:99:99 but we had the extender mask looking for this format 99/99/9999 99:99 </p>
<pre><code>Mask="99/99/9999 99:99:99"</code></pre>
<p>the ... | <p>Are you referring to the asp.Net Ajax toolkit extensions at:</p>
<p><a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/MaskedEdit/MaskedEdit.aspx" rel="nofollow noreferrer">http://www.asp.net/AJAX/AjaxControlToolkit/Samples/MaskedEdit/MaskedEdit.aspx</a></p>
<p>If so have you checked that your data is com... | 3,328 |
<p>I'm seeing strange errors when my C++ code has min() or max() calls. I'm using Visual C++ compilers.</p>
| <p>Check if your code is including the <strong>windows.h</strong> header file and either your code or other third-party headers have their own <strong>min()</strong>/<strong>max()</strong> definitions. If yes, then prepend your <strong>windows.h</strong> inclusion with a definition of <strong>NOMINMAX</strong> like thi... | <p>Honestly, when it comes to min/max, I find it best to just define my own:</p>
<pre><code>#define min(a,b) ((a) < (b) ? (a) : (b))
#define max(a,b) ((a) >= (b) ? (a) : (b))
</code></pre>
| 3,499 |
<p>I'm creating an app that holds loads of loads of user data in memory, and it's mostly keeping it all in List<T> structures (and some Dictionary<T,T> when I need lookup).</p>
<p>And I'm wondering...</p>
<p>How efficient are Lists?
How much memory overhead do I get for each of them? (that is, memory spac... | <p>Lists are arrays underneath, so the performance hit of adding an item, unless it is at the end, will be very costly.</p>
<p>Otherwise they will be basically as fast as an array.</p>
| <p>The .Net List doesn't use a linked list. It is an array, it starts with 4 positions by default and I think it doubles in size as you add things. So performance can vary a bit depending on how you use it.</p>
<hr>
<p>If your using VS 2008 run the profiler before you get too far down this rat hole. When we starte... | 5,344 |
<p>I am writing a program that needs to send out an email every hour on the hour, but at a time local to the user.</p>
<p>Say I have 2 users in different time zones. John is in New York and Fred is in Los Angeles. The server is in Chicago. If I want to send an email at 6 PM local to each user, I'd have to send the ema... | <p>If you access an intranet Web site by using an IP address or a fully qualified domain name , or a url with a dot in it the Web site may be identified as in the Internet zone instead of in the Local intranet zone.</p>
<p><a href="http://support.microsoft.com/kb/303650" rel="nofollow noreferrer">http://support.micros... | <p>If you access an intranet Web site by using an IP address or a fully qualified domain name , or a url with a dot in it the Web site may be identified as in the Internet zone instead of in the Local intranet zone.</p>
<p><a href="http://support.microsoft.com/kb/303650" rel="nofollow noreferrer">http://support.micros... | 4,230 |
<p>My question concerns c# and how to access Static members ... Well I don't really know how to explain it (which kind of is bad for a question isn't it?) I will just give you some sample code:</p>
<pre><code>Class test<T>{
int method1(Obj Parameter1){
//in here I want to do something which I would ... | <p>The problem is that TryParse isn't defined on an interface or base class anywhere, so you can't make an assumption that the type passed into your class will have that function. Unless you can contrain T in some way, you'll run into this a lot.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/d5x73970.aspx" ... | <p>That is not how statics work. You have to think of statics as sort of in a Global class even if they are are spread across a whole bunch of types. My recommendation is to make it a property inside the T instance that can access the necessary static method.</p>
<p>Also T is an actual instance of something, and jus... | 4,023 |
<p>I need to write a program that can sift through specially-formatted text files (essentially CSV files with a fixed set of column types that have different delimiters for some columns ... comma in most places, colons in others) to search for formatting errors. I figure regular expressions will be the way to go.</p>
... | <p>Use the Regex COM component built into Windows. You can find a step by step on referencing and using it in your project at: <a href="http://www.regular-expressions.info/vb.html" rel="nofollow noreferrer">http://www.regular-expressions.info/vb.html</a></p>
| <p>Use the Regex COM component built into Windows. You can find a step by step on referencing and using it in your project at: <a href="http://www.regular-expressions.info/vb.html" rel="nofollow noreferrer">http://www.regular-expressions.info/vb.html</a></p>
| 6,643 |
<p>What are the fundamentals to accomplish data encryption with exactly two keys (which could be password-based), but needing only one (either one) of the two keys to decrypt the data?</p>
<p>For example, data is encrypted with a user's password and his company's password, and then he or his company can decrypt the da... | <p>The way this is customarily done is to generate a single symmetric key to encrypt the data. Then you encrypt the symmetric key with each recipient's key or password to that they can decrypt it on their own. S/MIME (actually the Cryptographic Message Syntax on which S/MIME is based) uses this technique.</p>
<p>This ... | <p>I think I thought of a solution that would work:</p>
<pre><code>D = data to encrypt
h1 = hash(userpassword)
h2 = hash(companyPassword)
k = h1 concat h2
E = function to encrypt
//C is the encrypted data
C = E_h1(h2) concat E_h2(h1) concat E_k(D)
</code></pre>
<p>Then either person can decrypt the hash of the other... | 5,983 |
<p>In my code behind I wire up my events like so:</p>
<pre><code>protected override void OnInit(EventArgs e)
{
base.OnInit(e);
btnUpdateUser.Click += btnUpateUserClick;
}
</code></pre>
<p>I've done it this way because that's what I've seen in examples. </p>
<ul>
<li>Does the base.OnInit() method need to be c... | <p>I should clarify:</p>
<p>The guidelines recommend that firing an event should involve calling a virtual "On<em>EventName</em>" method, but they also say that if a derived class overrides that method and forgets to call the base method, the event should still fire.</p>
<p>See the "Important Note" about halfway down... | <p>In this case, if you don't call the base OnInit, then the Init even will not fire.</p>
<p>In general, it is best practice to ALWAYS call the base method, unless you specifically know that you do not want the base behaviour to occur.</p>
<p>Whether its called at the start or the end depends on how you want things t... | 3,972 |
<p>When running <a href="https://github.com/MarlinFirmware/Marlin" rel="nofollow noreferrer">Marlin Firmware</a>, is it possible to run <a href="https://reprap.org/wiki/G-code" rel="nofollow noreferrer">G-code</a> scripts/series of commands automatically when you insert the SD card?</p>
<hr>
<p>I'm running Marlin on ... | <p>I am not <em>entirely sure</em> if this is what you are after, or if it will work, but from <a href="https://github.com/MarlinFirmware/Marlin/issues/2891#issuecomment-180980733" rel="nofollow noreferrer">this post</a> on <a href="https://github.com/MarlinFirmware/Marlin/issues/2891" rel="nofollow noreferrer">Printi... | <p>I don't know what you would like to achieve.</p>
<p>As @typo mentioned there is similar functionality which triggers at printer startup: <a href="https://github.com/MarlinFirmware/Marlin/wiki/Autostart" rel="nofollow noreferrer">https://github.com/MarlinFirmware/Marlin/wiki/Autostart</a></p>
<p>I found in Marlin's... | 1,021 |
<p>I often run into the following problem.</p>
<p>I work on some changes to a project that require new tables or columns in the database. I make the database modifications and continue my work. Usually, I remember to write down the changes so that they can be replicated on the live system. However, I don't always reme... | <p>In Ruby on Rails, there's a concept of a <a href="http://wiki.rubyonrails.org/rails/pages/UnderstandingMigrations" rel="noreferrer">migration</a> -- a quick script to change the database.</p>
<p>You generate a migration file, which has rules to increase the db version (such as adding a column) and rules to downgrad... | <p>In the absence of a VCS for table changes I've been logging them in a wiki. At least then I can see when and why it was changed. It's far from perfect as not everyone is doing it and we have multiple product versions in use, but better than nothing.</p>
| 2,280 |
<p>I'm in the process of building my own head unit / stereo prototype for a car, which will have a 3D-printed enclosure.</p>
<p>My concern is that cars can get quite hot in the sun, and even more so if you live in hot climates. Some estimations put the interior of cars getting up to 50-60 °C, sometimes even in on... | <p>No, PLA cannot be used in cars standing in the sun. Temperatures can locally get over 50 °C (122 °F).</p>
<p>I have printed sun visor hinge pins from PLA for a car (not exposed to direct sunlight either), but after one day in the sun (it usually doesn't get over 29 °C or about 85 ˚F here too) the pin deformed (only ... | <p>If you put PLA parts in a sealed plastic bag (or two to keep it dry) and simmer in water (212 °F or 100 °C), the part "anneals". The time taken varies with the part shape, but for small parts should be about 15-30 minutes. You can simmer longer if unsure, but it provides no additional benefit... | 925 |
<p>I have a C# singleton class that multiple classes use. Is access through <code>Instance</code> to the <code>Toggle()</code> method thread-safe? If yes, by what assumptions, rules, etc. If no, why <em>and</em> how can I fix it?</p>
<pre><code>public class MyClass
{
private static readonly MyClass instance = new ... | <blockquote>
<p>Is access through 'Instance' to the 'Toggle()' class threadsafe? If yes, by what assumptions, rules, etc. If no, why and how can I fix it?</p>
</blockquote>
<p>No, it's not threadsafe.</p>
<p>Basically, both threads can run the <code>Toggle</code> function at the same time, so this could happen</p>
... | <p>Well, I actually don't know C# that well... but I am ok at Java, so I will give the answer for that, and hopefully the two are similar enough that it will be useful. If not, I apologize.</p>
<p>The answer is, no, it's not safe. One thread could call Toggle() at the same time as the other, and it is possible, althou... | 6,402 |
<p>I have been working with Struts for some time, but for a project I am finishing I was asked to separate Templates (velocity .vm files), configs (struts.xml, persistence.xml) from main WAR file.</p>
<p>I have all in default structure like: </p>
<pre>
application
|-- <i><b>META-INF</b></i> -- Some... | <p>If I understood your question about Struts config files right, they are specified in web.xml. Find the Struts servlet config param. The param-value can be a list of comma separated list of XML files to load. Eg:</p>
<pre><code><servlet>
<servlet-name>action</servlet-name>
<servlet-class... | <p>For <em>persistence.xml</em>, specifically, you can put a persistence unit in a separate JAR, which you can deploy separately from your web application WAR, or both together in an EAR archive, depending on what your application server supports. For example, the JBoss manual describes this as <a href="http://www.jbos... | 5,602 |
<p>I'd like to redirect the stdout of process proc1 to two processes proc2 and proc3:</p>
<pre><code> proc2 -> stdout
/
proc1
\
proc3 -> stdout
</code></pre>
<p>I tried</p>
<pre><code> proc1 | (proc2 & proc3)
</code></pre>
<p>but it doesn't seem to work, i.e.</p>
<pre><co... | <p><sup><em>Editor's note</em>:<br>
- <code>>(…)</code> is a <a href="http://mywiki.wooledge.org/ProcessSubstitution" rel="noreferrer"><em>process substitution</em></a> that is a <em>nonstandard shell feature</em> of <em>some</em> POSIX-compatible shells: <code>bash</code>, <code>ksh</code>, <code>zsh</code>.<br>
... | <p>another way to do would be,</p>
<pre><code> eval `echo '&& echo 123 |'{'tr 1 a','tr 1 b'} | sed -n 's/^&&//gp'`
</code></pre>
<p>output:</p>
<pre><code>a23
b23
</code></pre>
<p>no need to create a subshell here</p>
| 8,604 |
<p>I would like to debug my separately running JSP/Struts/Tomcat/Hibernate application stack using the Eclipse IDE debugger. How do I setup the java JVM and eclipse so that I can set breakpoints, monitor variable values, and see the code that is currently executing?</p>
| <p>I just Googled it. :)</p>
<p><a href="http://bugs.sakaiproject.org/confluence/display/BOOT/Setting+Up+Tomcat+For+Remote+Debugging" rel="noreferrer">http://bugs.sakaiproject.org/confluence/display/BOOT/Setting+Up+Tomcat+For+Remote+Debugging</a></p>
<p>Many more on google.</p>
<p>Effectively, set your JPDA setting... | <p>Follow these steps:</p>
<ol>
<li><p>Add the following arguments to the <code>java</code> command that is used to launch Tomcat (on Windows, I think this is in TOMCAT\bin\catalina.bat)</p>
<p>-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n</p></li>
<li><p>In Eclipse, create a 'Remote Java Appl... | 9,337 |
<p>I have a long running SQL statement that I want to run, and no matter what I put in the "timeout=" clause of my connection string, it always seems to end after 30 seconds. </p>
<p>I'm just using <code>SqlHelper.ExecuteNonQuery()</code> to execute it, and letting it take care of opening connections, etc.</p>
<p>Is... | <p>What are you using to set the timeout in your connection string? From memory that's "ConnectionTimeout" and only affects the time it takes to actually <em>connect</em> to the server.</p>
<p>Each individual command has a separate "CommandTimeout" which would be what you're looking for. Not sure how SqlHelper impleme... | <p><s>In addition to timeout in connection string,</s> try using the timeout property of the SQL command. Below is a C# sample, using the SqlCommand class. Its equivalent should be applicable to what you are using.</p>
<pre><code>SqlCommand command = new SqlCommand(sqlQuery, _Database.Connection);
command.CommandTimeo... | 4,706 |
<p>In E (specman) I want to declare variables that are lists, and I want to fix their lengths.</p>
<p>It's easy to do for a member of a struct:</p>
<pre><code>thread[2] : list of thread_t;
</code></pre>
<p>while for a "regular" variable in a function the above doesn't work, and I have to do something like:</p>
<pre... | <p>A hard keep like you have is only going to fix the size at initialization but elements could still be added or dropped later, are you trying to guard against this condition? The only way I can think of to guarantee that elements aren't added or dropped later is emitting an event synced on the size != the predetermi... | <p>I know nothing of specman, but a fixed sized list is an array, so that might point you somewhere.</p>
| 4,102 |
<p>We're looking for a package to help identify and automatically rotate faxed TIFF images based on a watermark or logo. </p>
<p>We use libtiff for rotation currently, but don't know of any other libraries or packages I can use for detecting this logo and determining how to rotate the images.</p>
<p>I have done som... | <p>You are in the right place using OpenCV, it is an excellent utility. For example, <a href="http://www.nashruddin.com/template-matching-in-opencv-with-example.html" rel="nofollow noreferrer">this guy</a> used it for template matching, which is fairly similar to what you need to do. Also, the link Roddy specified look... | <p>The Intel Performance Primitives (IPP) library has a lot of very efficient algorithms that help with this kind of a task. The library is callable from C/C++ and we have found it to be very fast. I should also note that it's not limited to just Intel hardware.</p>
| 5,263 |
<p>Is there a web service of some sort (or any other way) to pull a current time zone settings for a (US) city. For the parts of the country that don't follow the Daylight Saving Time and basically jump timezones when everyone else is switching summer/winter time... I don't fancy creating own database of the places tha... | <p>earthtools.org provides a free web service to get the time zone from a city here:</p>
<p><a href="http://www.earthtools.org/webservices.htm#timezone" rel="noreferrer">http://www.earthtools.org/webservices.htm#timezone</a></p>
<p>You just pass in the long/lat values like this: (This is for New York)</p>
<p><a href... | <p>I know this is answered, but I am posting this answer as people might still find it useful - The selected answer does not work successfuly right now.</p>
<p>Google have their own service, which is very reliable and easy to use, and outputs info in JSON format. It even allows for specifying a custom time, e.g get t... | 7,975 |
<p>Is it possible at runtime to programmatically check the name of the Thread that is holding the lock of a given object?</p>
| <p>You can only tell whether the current thread holds a normal lock (<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#holdsLock%28java.lang.Object%29" rel="noreferrer"><code>Thread.holdsLock(Object)</code></a>). You can't get a reference to the thread that has the lock without native code.</p>
<... | <p>You can use a variable to hold the current thread when you take the lock, then print it if someone else is trying to use it.</p>
<pre><code>Thread holderOfLock = null;
Object theLock = new Object();
public void doStuff()
{
if(holderOfLock != null)
{
//get and print name of holderOfLock-thread or get... | 7,335 |
<p>EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters</p>
<p>Our business uses the WebMethods integration server to handle most of our outbound communications, and its FTP functionality leaves something to be desired. We are having a problem that may be specific to WebMethods, but if anyone c... | <p>I tried this in WebMethods IS Version 6.5 Updates WmPRT_6-5-1_SP1, IS_6-5_SP3.</p>
<p>It worked perfectly first time.</p>
<p>I turned on debugging on the FTP server (Debian's default ftpd). WebMethods' NLST honours the active/passive parameter passed to it.</p>
<p>There's nothing special about the NLST command, n... | <p>I'm going to run some new tests with the settings to passive tomorrow when maintenance is done here, but I'm not sure that's the issue. We are able to get a directory listing if there are files or subdirectories in that directory. It only fails when the directory we're NLST-ing on is empty.</p>
<p>Would the activ... | 8,140 |
<p>What is the best algorithm to take array like below:</p>
<p><code>A {0,1,2,3}</code></p>
<p>I expected to order it like array below:</p>
<p><code>B {3,1,0,2}</code> </p>
<p>Any ideas?</p>
| <p>So if you have two arrays and they hold the same data just in different order then just do this:</p>
<p>A = B</p>
<p>I suspect that is not your situation so I think we need more info.</p>
| <p>In the example you gave (an array of numbers), there would be no point in re-ordering A, since you could just use B.</p>
<p>So, presumably these are arrays of objects which you want ordered by one of their properties.</p>
<p>Then, you will need a way to look up items in A based on the property in question (like a ... | 6,599 |
<p>How can I retrieve the page title of a webpage (title html tag) using Python?</p>
| <p>I'll always use <a href="http://lxml.de/" rel="nofollow noreferrer">lxml</a> for such tasks. You could use <a href="http://www.crummy.com/software/BeautifulSoup/" rel="nofollow noreferrer">beautifulsoup</a> as well.</p>
<pre><code>import lxml.html
t = lxml.html.parse(url)
print(t.find(".//title").text)
</c... | <p>Using lxml...</p>
<p>Getting it from page meta tagged according to the Facebook opengraph protocol:</p>
<pre><code>import lxml.html.parse
html_doc = lxml.html.parse(some_url)
t = html_doc.xpath('//meta[@property="og:title"]/@content')[0]
</code></pre>
<p>or using .xpath with lxml:</p>
<pre><code>t = html_doc.xp... | 7,423 |
<p>The heater cartridge on my CR10 V2 broke so I ordered a new one(12V). After replacing it the new one heats of very quickly past the target temperature and the slowly decreases to the target. Once it hits the target temp it goes up and down by 10 °C or so during prints. During the prints there is under extru... | <p>This sounds as if you have bought an incorrect heater element, e.g. one for 12 V instead of 24 V. The CR-10 uses 24 V. The 12 V cartridge has a lower resistance, so when powered by 24 V, the current is much higher and therefore also the heating power (<span class="math-container">$ {(\frac{2... | <p>funny I have the opposite worry, I have a CR10s5 and relaxed the whole hot end with the CR10v2 one and now I get a thermal error at 170 degrees and it shuts off, should I just replace the cartridge, or do I need to replace the fans tooo</p>
| 1,636 |
<p>The only thing I've found has been;</p>
<pre class="lang-css prettyprint-override"><code>.hang {
text-indent: -3em;
margin-left: 3em;
}
</code></pre>
<p>The only way for this to work is putting text in a paragraph, which causes those horribly unsightly extra lines. I'd much rather just have them in a <cod... | <p><code><span></code> is an inline element. The term <em>hanging indent</em> is meaningless unless you're talking about a paragraph (which generally means a block element). You can, of course, change the margins on <code><p></code> or <code><div></code> or any other block element to get rid of extra ... | <p>ysth's answer is best with one debatable exception; the unit of measure should correspond to the size of the font.</p>
<pre class="lang-css prettyprint-override"><code>p {
text-indent: -2en;
padding-left: 2en;
}
</code></pre>
<p>"3" would also work adequately well; "em" is not recommended as it is wider than ... | 3,293 |
<p>I'm really interested to hear what you think about Model-driven Software Development for Java and/or .NET.</p>
<p>Does it save time? Does it improve quality?</p>
| <p>I am using MDSD in a project with IBM Rational Rhapsody for C++. The model is pretty close to UML, so there we do not really have a Domain-Specific-Language. But still I would claim to use MDSD. From my experience, there are many benefits with MDSD:</p>
<p>a) Using MDSD helps to bring a SW architecture to a sophist... | <p>MDA usually make difficult to integrate the business rules inside the server side layer, as the model view mapping is handled by generated code and functional hooks are provided as event responders. </p>
<p>Still I've not seen a MDA tool as powerful as Forté (or UDS, now dead) + Express were. I imagine that a MDA w... | 9,626 |
<p>Usually the hardness of the material is considered primary for nozzles used with abrasive filaments. Has friction between between nozzle material and abrasive filaments been considered? It seems that friction as well as hardness would play a roll in how long the nozzle lasts. Perhaps, this is considered with ruby ... | <p>I think I found the problem. I think there was some crosstalk between the BLTouch wires and the other wires it was tied together leading to the hotend. When I moved the BLTouch wires away from the others the problem went away.</p>
<p>I will be added a sheild to the cable in the future like in this <a href="https://w... | <p>The OP already found the problem and <a href="/a/16632/">answered</a> the question hinting to shielding of the cable. If this is the actual problem, of fiddling with the cables might have caused this, an alternative solution is presented as I've experienced similar behavior.</p>
<p>If one side of the bed is higher t... | 1,970 |
<p>For personal usage, indoor, I'm doing some experiments with following lamp (v0.1):</p>
<p><a href="https://i.stack.imgur.com/SrEhy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SrEhy.jpg" alt="enter image description here"></a></p>
<p>Lamp is a led bulb enclosed in a methacrylate tube and with... | <p><a href="https://3dprinting.stackexchange.com/a/4488/5740">EvilTeach's</a> answer is correct, ABS is a more reliable plastic for any kind of work which may get above what feels "hot to the touch." </p>
<p>Just to elaborate on the why: the property you're looking for in the thermoplastic (which will determine the co... | <p>I had a PLA print that would weaken and deform when sitting in the car on a hot day. I think you should try it with ABS.</p>
| 666 |
<p>Suppose I have a table called Companies that has a DepartmentID column. There's also a Departaments table that has as EmployeeID column. Of course I have an Employee table as well. The problem is that I want to delete a company, so first i have to delete all the employees for every departament and then all the depar... | <p>I'm not sure why you need nested transactions here. You only need one actual transaction:</p>
<pre><code>BEGIN TRAN
DELETE FROM Employee
FROM Employee
INNER JOIN Department ON Employee.DepartmentID = Department.DepartmentID
INNER JOIN Company ON Department.CompanyID = Company.CompanyID
WHERE Compa... | <p>I'm not answering your question, but foreign Keys <em>is</em> the way to go, why is it not an option?</p>
<p>As for nested transactions they are:</p>
<pre><code>BEGIN
delete from Employee where departmentId = 1;
BEGIN
delete from Department where companyId = 2;
BEGIN
delete from Company where... | 8,336 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.