instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>We use QuickBooks for financial management, and feed it from a variety of sources. I now need to hook it up to BizTalk, and I'd hate to reinvent the wheel. I've done searches, and as far as I can tell there's no QuickBooks adapter for BizTalk. Does anyone know of anything that'll do the job, preferably something tha... | <p>Quickbooks talks .NET quite easily. You'll need the QuickBooks SDK 7.0 and a copy of Visual Studio.NET, but after that it's very easy to do anything with Quickbooks. </p>
<pre><code>Imports QBFC7Lib
Sub AttachToDB()
If isAttachedtoQB Then Exit Sub
Lasterror = "Unknown QuickBooks Error"
Try
QbS... | <p>Unfortunately it does. It also asks you to authorise any application you've built. (at least once.) </p>
<p>I don't know any way around it. </p>
| 6,765 |
<p>There are thousands of <code>vi</code> tutorials on the web, most of them generically listing all the commands. There are even videos on youtube which show basic functionality.</p>
<p>But does anyone know of a vi tutorial which focuses on the <strong>needs of programmers</strong>? </p>
<p>For example when I progra... | <p>A nice collection of <a href="http://rayninfo.co.uk/vimtips.html" rel="noreferrer">vimtips</a>.</p>
<p>And the best Vim <a href="http://www.cheat-sheets.org/saved-copy/vimqrc.pdf" rel="noreferrer">cheatsheet</a> around.</p>
| <p>I just ended up reading the vim manual a few times, over the years, picking up useful features on each iteration.</p>
<p>One thing that really made vim work for me as a perl IDE was starting to use tags, as explained here: <a href="http://www.vim.org/tips/tip.php?tip_id=94" rel="nofollow noreferrer">http://www.vim.... | 6,935 |
<p>What would be the best way to fill a C# struct from a byte[] array where the data was from a C/C++ struct? The C struct would look something like this (my C is very rusty):</p>
<pre><code>typedef OldStuff {
CHAR Name[8];
UInt32 User;
CHAR Location[8];
UInt32 TimeStamp;
UInt32 Sequence;
CHAR... | <p>From what I can see in that context, you don't need to copy <code>SomeByteArray</code> into a buffer. You simply need to get the handle from <code>SomeByteArray</code>, pin it, copy the <code>IntPtr</code> data using <code>PtrToStructure</code> and then release. No need for a copy.</p>
<p>That would be:</p>
<pre><... | <p>If you have a byte[] you should be able to use the BinaryReader class and set values on NewStuff using the available ReadX methods.</p>
| 2,500 |
<p>I have to write an applet that brings up a password dialog. The problem is that dialog is set to be always on top but when user clicks on IE window dialog gets hidden behind IE window nevertheless. And since dialog is modal and holds <strong>all</strong> IE threads IE pane does not refresh and dialog window is still... | <p>What argument are you using for the parent?</p>
<p>You may have better luck if you use the parent of the Applet.</p>
<pre><code>javax.swing.SwingUtilities.getWindowAncestor(theApplet)
</code></pre>
<p>Using the getWindowAncestor will skip the applet parents (getRoot(component) will return applets). In at least s... | <p>You might try launching a modal from JavaScript using the JavaScript integration (see <a href="http://www.raditha.com/java/mayscript.php" rel="nofollow noreferrer">http://www.raditha.com/java/mayscript.php</a> for an example). </p>
<p>The JavaScript you would need would be something like:</p>
<pre><code>function g... | 9,862 |
<p>Now that <code>LINQ</code> to <code>SQL</code> is a little more mature, I'd like to know of any techniques people are using to create an <strong>n-tiered solution</strong> using the technology, because it does not seem that obvious to me.</p>
| <p>LINQ to SQL doesn't really have a n-tier story that I've seen, since the objects that it creates are created in the class with the rest of it, you don't really have an assembly that you can nicely reference through something like Web Services, etc.</p>
<p>The only way I'd really consider it is using the datacontext... | <blockquote>
<p>Seriously speaking, LINQ to SQL had it's support for n-tier architecture see DataContext.Update method</p>
</blockquote>
<p>Some of what I've read suggests that the business logic wraps the DataContext - in other words you wrap the update in the way that you suggest. </p>
<p>The way i traditionally... | 5,888 |
<p>Of course I am aware of Ajax, but the problem with Ajax is that the browser should poll the server frequently to find whether there is new data. This increases server load.</p>
<p>Is there any better method (even using Ajax) other than polling the server frequently?</p>
| <p>Yes, what you're looking for is COMET <a href="http://en.wikipedia.org/wiki/Comet_(programming)" rel="noreferrer">http://en.wikipedia.org/wiki/Comet_(programming)</a>. Other good Google terms to search for are AJAX-push and reverse-ajax.</p>
| <p>You can also look into <a href="http://www.pushlets.com/" rel="nofollow noreferrer">Java Pushlets</a> if you are using jsp pages.</p>
| 4,033 |
<p>Where can I find a guide for integrating JavaScript and JMS (Java Messaging Service)?</p>
<p>I would like a best practice or established technology that allows me to directly or indirectly receive messages from a topic and update a site based on the message. I was thinking of creating two components, a servlet for ... | <p>I think <a href="http://activemq.apache.org/ajax.html" rel="nofollow noreferrer">this</a> is your answer. Looks like it is baked in to ActiveMQ. I tried the examples and they seem to work.</p>
<p><a href="http://activemq.apache.org/ajax.html" rel="nofollow noreferrer">http://activemq.apache.org/ajax.html</a></p>
| <p>You'll find some references to the Dojo/Bayeux approach here<br>
<a href="http://www.pathf.com/blogs/2006/08/bayeux_a_json_p/" rel="nofollow noreferrer">http://www.pathf.com/blogs/2006/08/bayeux_a_json_p/</a></p>
<p>If you're using WebSphere 6.0 or higher then the Web 2.0 Feature Pack includes an implementation.</p... | 9,239 |
<p>I have the next function:</p>
<pre><code>function setImagesWidth(id,width) {
var images = document.getElementById(id).getElementsByTagName("img");
for(var i = 0; i < images.length;i++) {
// If the real width is bigger than width parameter
images[i].style.width=width;
//} ... | <p>Here is, hopefully, enough sample code to give you what you want:</p>
<pre><code>var myImage = document.getElementById("myImagesId");
var imageWidth = myImage.offsetWidth;
var imageHeight = myImage.offsetHeight;
</code></pre>
<p>That should give you the numbers you need to derive the solution you want. I think you... | <p>Careful, it looks like you might rather want <code>clientWidth</code>:</p>
<p><a href="http://developer.mozilla.org/en/Determining_the_dimensions_of_elements" rel="nofollow noreferrer">http://developer.mozilla.org/en/Determining_the_dimensions_of_elements</a></p>
| 6,376 |
<p>I am consistently getting these strings in the overhangs on models that folks say they are printing without supports. Can anyone tell me what is causing them and what I can do to fix them?</p>
<p>I've attached a picture mid-way during a <a href="https://www.thingiverse.com/thing:3232347" rel="nofollow noreferrer">... | <p>While this looks a lot like stringing, it's not what I would call stringing. I usually reserve that term for material that should never have left the nozzle to begin with, due to insufficient or missing retraction or excessive compression of the filament between the extruder and the nozzle. The "strings" you've show... | <p>You did print overhangs without supports. I have printed a Thermal Detonator for StarWars day (May the 4th be with you!), which is pretty much an empty pair of domes. To ensure that the upper layers stay up, I have activated support starting at 40°, and it came out perfectly fine. Without support, the lines would ha... | 1,300 |
<p>Here's a wierd one. I'm reusing a code base that unfortunately must not be updated. This code makes a call to <code>HttpContext.Current.Request.QueryString</code>. Ideally, I need to push a value into this collection with every request that is made. Is this possible - perhaps in an HTTP Module?</p>
| <p>Without using reflection, the simplest way to do it would be to use the RewritePath function on the current HttpContext object in order to modify the querystring. </p>
<p>Using an <a href="http://msdn.microsoft.com/en-us/library/system.web.ihttpmodule.aspx" rel="noreferrer">IHttpModule</a>, it might look something ... | <p>Ditto Espo's answer and I would like to add that usually in medium trust (specific to many shared hostings) you will not have access to reflection so ... RewritePath will remain your probably only choice.</p>
| 5,458 |
<p>I have two elements:</p>
<pre><code><input a>
<input b onclick="...">
</code></pre>
<p>When b is clicked, I want to access a and manipulate some of its data. A does not have a globally unique name, so <code>document.getElementsByName</code> is out. Looking into the event object, I thought <code>event.t... | <p>If <code>a</code> and <code>b</code> are next to each other and have the same parent, you can use the <code>prevSibling</code> property of <code>b</code> to find <code>a</code>.</p>
| <p>Leave your plain vanilla JavaScript behind. Get JQuery--it will save you a ton of time.</p>
<p><a href="http://docs.jquery.com/Selectors" rel="nofollow noreferrer">http://docs.jquery.com/Selectors</a></p>
| 7,668 |
<p>Simple question, but one that I've been curious about...is there a functional difference between the following two commands?</p>
<pre><code>String::class
String.class
</code></pre>
<p>They both do what I expect -- that is to say they return <code>Class</code> -- but what is the difference between using the <code>:... | <p>The <code>.</code> operator basically says "send this message to the object". In your example it is calling that particular member. The <code>::</code> operator "drills down" to the scope defined to the left of the operator, and then calls the member defined on the right side of operator.</p>
<p>When you use <code>... | <p>Actually, auto-completion does work for <code>.</code>. The completion options are found by calling <code>#methods</code> on the object. You can see this for yourself by overriding <code>Object.methods</code>:</p>
<pre><code>>> def Object.methods; ["foo", "bar"]; end
=> nil
>> Object.[TAB]
Object.f... | 6,473 |
<p>I'm trying to make the case for click-once and smart client development but my network support team wants to keep with web development for everything.</p>
<p>What is the best way to convince them that click-once and smart client development have a place in the business?</p>
| <p>We use ClickOnce where I work; in terms of comparison to a web release I would base the case around the need for providing users with a rich client app, otherwise it might well actually be better to use web applications.</p>
<p>In terms of releasing a rich client app ClickOnce is fantastic; you can set it up to enf... | <p>They have a place in the Windows environment but not in any other environment and so if you intend on writing applications for external clients, then your probably best sticking with Web based development.</p>
<p>I heard this "Write Once, Run Many" before from Microsoft when Asp.net 1.1 was released, it never happe... | 5,887 |
<p>I've switched over to a Mac recently and, although things have been going quite well, the very different text-editing behaviours across applications is driving me insane.</p>
<p><kbd>Home</kbd>, <kbd>End</kbd>, <kbd>Page Up</kbd>, <kbd>Page Down</kbd>, <kbd>Apple-arrow</kbd>, <kbd>Ctrl-arrow</kbd>, <kbd>alt-arrow</... | <p>There are standards, but they are not based around what you're used to from windows. It drove me mad until I got over myself and decided to learn what the actual standards were. Since then I've been sold.</p>
<p>The ones I use:</p>
<ul>
<li><kbd>Command</kbd>-<kbd>Left</kbd>/<kbd>Right</kbd> - Jump to start/end of... | <p>And what's funny (and frustrating!) is that the Microsoft <strong>OS X</strong> apps (e.g. Entourage) use the <strong>Windows</strong> standards.</p>
<p>I develop on WinXP during the day but have an iMac at home, so it's confusing enough trying to switch modes between work and home. But then I have to remember if ... | 5,413 |
<p>I know in ASP.NET I can get an item from a DropDownList by using</p>
<pre><code>DropDownList1.Items.FindByText
</code></pre>
<p>Is there a similar method I can use in WPF for a ComboBox?</p>
<p>Here's the scenario.</p>
<p>I have a table called RestrictionFormat that contains a column called RestrictionType, the ... | <p>Can you use ItemContainerGenerator?</p>
<p>ItemContainerGenerator contains a ContainerFromItem method that takes an object parameter. If you have a reference to the full object that your comboBox contains (or a way to reconstruct it), you can use the following:</p>
<pre><code>ComboBoxItem item =
(ComboBoxIte... | <p>You can retrieve combobox items in two ways:</p>
<p>By item:</p>
<pre><code>ComboBoxItem item = (ComboBoxItem) control.ItemContainerGenerator.ContainerFromItem(control.SelectedItem);
</code></pre>
<p>By index:</p>
<pre><code>ComboBoxItem item = (ComboBoxItem) control.ItemContainerGenerator.ContainerFromIndex(1);... | 6,260 |
<p>I am making a bed for my 3D printer. I have bought a silicon heater (31x31 cm) and I want to glue it to my custom aluminum bed. The tape that it had from factory was bad, so I removed it. I want to glue it to the aluminum and I don't know what type of adhesive to use, I was thinking gasket glue with silicon, but I t... | <p>Heat Transfer PAste will not work as a gluing agent. What you need is a high-temperature glue that bonds Aluminium and a silicone rubber. The benchmark temperature that the glue needs to withstand is about 100 °C or approximately 200 °F.</p>
<p><a href="https://www.mcmaster.com/glue/for-use-on%7Ealuminum/for-joining... | <p>Heat Transfer PAste will not work as a gluing agent. What you need is a high-temperature glue that bonds Aluminium and a silicone rubber. The benchmark temperature that the glue needs to withstand is about 100 °C or approximately 200 °F.</p>
<p><a href="https://www.mcmaster.com/glue/for-use-on%7Ealuminum/for-joining... | 1,790 |
<p>When a previous Vim session crashed, you are greeted with the "Swap file ... already exists!" for each and every file that was open in the previous session.</p>
<p>Can you make this Vim recovery prompt smarter? (Without switching off recovery!) Specifically, I'm thinking of:</p>
<ul>
<li>If the swapped version doe... | <p>I have vim store my swap files in a single local directory, by having this in my .vimrc:</p>
<pre><code>set directory=~/.vim/swap,.
</code></pre>
<p>Among other benefits, this makes the swap files easy to find all at once.
Now when my laptop loses power or whatever and I start back up with a bunch of swap files la... | <p>I prefer to not set my VIM working directory in the .vimrc. Here's a modification of chouser's script that copies the swap files to the swap path on demand checking for duplicates and then reconciles them. This was written rushed, make sure to evaluate it before putting it to practical use.</p>
<pre><code>#!/bin/ba... | 8,864 |
<p>I think I might be missing something here. Here is the relevant part of the trigger:</p>
<pre><code> CURSOR columnNames (inTableName IN VARCHAR2) IS
SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = inTableName;
/* Removed for brevity */
OPEN columnNames('TEMP');
</code></pre>
<p>And her... | <p>To clarify the cause of the issue. As you state </p>
<p><strong>OPEN columnNames('TEMP');</strong> </p>
<p>worked while </p>
<p><strong>FOR columnName IN columnNames LOOP</strong></p>
<p>did not. The FOR statement would work fine if it also included the parameter like so:</p>
<p><strong>FOR columnName IN column... | <p>Works fine for me.</p>
<pre><code>create or replace procedure so_test_procedure as
CURSOR columnNames (inTableName IN VARCHAR2) IS
SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = inTableName;
BEGIN
OPEN columnNames('TEMP');
CLOSE columnNames;
END;
procedure so_test_procedure Compiled.
ex... | 6,546 |
<p>What's the best way to convert a string to an enumeration value in C#?</p>
<p>I have an HTML select tag containing the values of an enumeration. When the page is posted, I want to pick up the value (which will be in the form of a string) and convert it to the corresponding enumeration value.</p>
<p>In an ideal world... | <p>In .NET Core and .NET Framework ≥4.0 <a href="https://msdn.microsoft.com/en-us/library/dd783499%28v=vs.110%29.aspx" rel="noreferrer">there is a generic parse method</a>:</p>
<pre><code>Enum.TryParse("Active", out StatusEnum myStatus);
</code></pre>
<p>This also includes C#7's new inline <code>out</code> va... | <p>First of all, you need to decorate your enum, like this:</p>
<pre><code> public enum Store : short
{
[Description("Rio Big Store")]
Rio = 1
}
</code></pre>
<p>in .net 5, i create this extension method:</p>
<pre><code>//The class also needs to be static, ok?
public static string GetDescription(th... | 3,682 |
<p>I'm attaching a picture to show my issue. I'm hoping might be an easy settings fix, or at least maybe someone has a couple suggestions I can try. I'm using an Ender 3, and the program Cura. The print on the left was printed with the opening facing up. The print on the right with the hole facing down. The support lea... | <p>There's only so much you can do about this without a multi-material printer that can utilize dissolvable material or material that doesn't bond to the print material, and print the supports at zero distance from the model. So expect it to be ugly. But not quite that ugly.</p>
<p>Slicers, including Cura, have options... | <p>You cannot print into the air (hot filament will sag when not supported). Do remember that even with support enabled, you are printing into air. This is because there is always a gap between the print object and the support structure, the option is called <code>Z distance</code>. If there wasn't a gap, the print obj... | 2,197 |
<p>I have an object graph serialized to xaml. A rough sample of what it looks like is:</p>
<pre><code><MyObject xmlns.... >
<MyObject.TheCollection>
<PolymorphicObjectOne .../>
<HiImPolymorphic ... />
</MyObject.TheCollection>
</MyObject>
</code></pre>
<p>I... | <p>I am using the <code>GacInstall</code> to publish my assemblies, however once installed into the gac, I sometimes delete my ‘temporary’ copy of the assemblies.</p>
<p>And then, if I ever wanted to uninstall the assemblies from the gac I do not have the files at the original path. This is causing a problem since I c... | <p>I am not exactly sure about it but I believe GacRemove should do the same thing as gacutil /u. So, it should be the path of your DLL. However it doesn't have to be the same DLL file. Copy of the original should suffice since what counts is the uniqueID of the DLL.</p>
| 6,773 |
<p>I'm currently attempting to make a repstrap using paper printed parts, like this guy : <a href="http://www.mariolukas.de/2012/05/repstrap-3d-drucker-aus-computerschrott-teil-1/" rel="nofollow noreferrer">http://www.mariolukas.de/2012/05/repstrap-3d-drucker-aus-computerschrott-teil-1/</a>
I replaced the DC motor in ... | <p>Axis should definitely be at proper position. Otherwise you will get at least 2 issues.</p>
<ol>
<li>Carriage will be pulled up which will cause stresses on rollers or slides and it will stress your belt</li>
<li>The way the carriage will go will change but because carriage itself is fixed then it will change the s... | <p>A rotation of the stepper motor 90 degrees clockwise or counter-clockwise would move it more to the center. You would only need lengthen or shorten the belt.</p>
| 365 |
<p>I have seen <a href="https://stackoverflow.com/questions/4046/can-someone-give-me-a-working-example-of-a-buildxml-for-an-ear-that-deploys-in">this question</a> about deploying to WebSphere using the WAS ant tasks.</p>
<p>Is there a simpler way to do this? In the past I have deployed to Tomcat by dropping a war fil... | <p>There is the concept of <a href="http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.etools.wrd.freeform.doc/topics/cwrdrapid.html" rel="nofollow noreferrer">WebSphere Rapid Deployment</a>. It's supposed to be the same experience as what you describe for Tomcat.</p>
| <p>WAS does provide a client jar containing some custom ant tasks. However they seem to be extremely bugy and dont work with remote servers.</p>
<p><a href="http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.javadoc.doc/public_html/api/com/ibm/websphere/ant/tasks/InstallApplicatio... | 8,150 |
<p>I have some HTML that is generated via a Rich Text Editor outside of my Flex application but would like to display it inside Flex. </p>
<p>The HTML is simple HTML tags, things like styles, anchors, and possibly image tags, is there a control that would let me render this HTML in flex or am I going to have to roll u... | <p>If the HTML is <em>really</em> simple, you can display it in a normal label or textarea component, If it is more complex, I'll quote what I answered <a href="https://stackoverflow.com/questions/22909/is-there-some-way-to-show-html-content-inside-flash">in this question</a>. The discussion there also has a little mor... | <p>@mmattax</p>
<p>Indeed you can display images in a TextArea component. The approach <a href="http://aralbalkan.com/239" rel="nofollow noreferrer">is not entirely without problems though</a>...</p>
| 7,384 |
<p>Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I'm on the following URL:</p>
<p><code>http://www.mywebsite.com:80/pages/page1.aspx</code></p>
<p>I need to return:</p>
<p><code>http://www.mywebsite.com:80</code></p>
<p>I know I can use <code>Request.Url.Absolute... | <p>The following (C#) code should do the trick</p>
<pre><code>Uri uri = new Uri("http://www.mywebsite.com:80/pages/page1.aspx");
string requested = uri.Scheme + Uri.SchemeDelimiter + uri.Host + ":" + uri.Port;
</code></pre>
| <p>In my case</p>
<pre><code>Uri uri = new Uri("http://www.mywebsite.com:80/pages/page1.aspx");
string requested = uri.Scheme + Uri.SchemeDelimiter + uri.Authority;
</code></pre>
<p>works to get</p>
<p><a href="https://www.mywebsite.com:80" rel="nofollow noreferrer">https://www.mywebsite.com:80</a></p>
| 4,176 |
<p>I'd like my program to be able to email me error reports. How can I do this without hard-coding a username/password/SMTP server/etc. into the code? (Doing so would allow users to decompile the program and take over this email account.)</p>
<p>I've been told you could do some stuff with telneting to port 25, but I'm... | <p>As long as your account is on gmail.com, set up <strong>gmail-smtp-in.l.google.com</strong> as the outgoing SMTP-server in your program. You do not need to provide a password to send email to gmail-accounts when using that server.</p>
| <pre><code>MailMessage msg = new MailMessage("someone@foo.com", "someoneelse@bar.com");
msg.Subject = "Check it out!";
msg.Body = "Visit stackoverflow.com!";
SmtpClient client = new SmtpClient("some.smtp.server", 25);
client.Send(msg);
</code></pre>
| 4,981 |
<p>I'm working on an internal project for my company, and part of the project is to be able to parse various "Tasks" from an XML file into a collection of tasks to be ran later.</p>
<p>Because each type of Task has a multitude of different associated fields, I decided it would be best to represent each type of Task wi... | <p>I use reflection to do this.
You can make a factory that basically expands without you having to add any extra code.</p>
<p>make sure you have "using System.Reflection", place the following code in your instantiation method.</p>
<pre><code>public Task CreateTask(XmlElement elem)
{
if (elem != null)
{
... | <p>@ChanChan</p>
<p>I like the idea of reflection, yet at the same time I've always been shy to use reflection. It's always struck me as a "hack" to work around something that should be easier. I did consider that approach, and then figured a switch statement would be faster for the same amount of code smell.</p>
<p>... | 4,696 |
<p>I have a (HIC) version of the Prusa i3. I have recently installed the E3D v6 hotend and titan extruder. After fixing some other issues, I noticed that there is no filament being extruded. In addition, the gear looked like it was going in the wrong direction. How can I fix this?</p>
| <p>You can either flip the connector for the motor around (i.e. plug it in backwards) or (if you are using Marlin firmware) look for the following line in configuration.h: (using the Arduino editor open the Marlin file For your 3D Printer, one of the tabs is labelled "configuration.h" click on that tab to bring it to... | <p>Reverse the plug for the motor on the board. Or do firmware. Doesn't matter. *** assuming you have ramps and a standard stepper.. </p>
| 320 |
<p>Just as the title says. I feel like I have tried everything. I am compiling the firmware for Marlin on a Megatronics board from RepRap. That shouldn't be relevant, because I have validated that it is a firmware issue (and not a pin assignment/hardware issue).</p>
<p>When I turn it on, the Y-axis is active and just c... | <p>I did a simple search at <a href="http://www.huski.ai" rel="nofollow noreferrer">www.huski.ai</a>, and found 11 trademarks with the mark word "FabLab".</p>
<p><a href="https://i.stack.imgur.com/PXPXU.png" rel="nofollow noreferrer" title="Screenshot of search"><img src="https://i.stack.imgur.com/PXPXU.png" ... | <p>Sorry, I needed to learn to use the site. This site shows Fablab as a word mark, the same way it shows Apple: <a href="https://www.trademarkengine.com/free-trademark-search/trademark-search" rel="nofollow noreferrer">https://www.trademarkengine.com/free-trademark-search/trademark-search</a></p>
| 1,868 |
<p>I am new to 3D printing and have an Ender 5 Pro.</p>
<p>I have manually leveled the bed by setting the nozzle gap to 0.1 mm (via feeler gauges) and then printing a calibration print and manually adjusting the bed height as it prints. I can get perfect calibration prints using both a glass bed and a PEI bed, printing... | <p>Well I got a perfect print as follows:</p>
<ol>
<li>Loaded the .stl file.</li>
<li>Set Cura to use the 'Good' profile downloaded from CHEPCLUB
(recommended by a friend).</li>
<li>Used <strike>Pritt-stick</strike> Scotch (glue stick) on the bed.</li>
</ol>
<p>I was quite loath to use glue stick, as I thought heated b... | <p>For a good adhesion the print bed should be free of any oil or fat. Wipe the print bed with pure alcohol just befor the start of printing.</p>
| 2,040 |
<p>I bought a few new nozzles expecting them to come with that little tube that comes out of the nozzle. They didn't come with them after all, so I tried to reuse the tube I originally had in the printer. Turns out my old tube is 4mm OD and 2mm ID, but the new nozzles have 2mm holes for the tube to go in. I use 1.75mm ... | <p>To answer your question directly, the PTFE tube (or a separate thin walled PTFE tube for the bottom part of the heatbreak) <em>generally</em> always is outside the nozzle, so yes (unless you have an all-metal hotend, then there is no PTFE tube up to the nozzle). But as read from your question, your setup has the tub... | <p>Yes, you can use a direct drive hotend with a bowden tube, but it won't just plug together. You just need a way to secure the end of the bowden tube to be centered above and as close the the hotend mouth as possible. In a pinch, you can spin a 4mm nut onto the tube and secure it down against the hotend mount with zi... | 1,104 |
<p>We all know T-SQL's string manipulation capabilities sometimes leaves much to be desired...</p>
<p>I have a numeric field that needs to be output in T-SQL as a right-aligned text column. Example:</p>
<pre><code>Value
----------
143.55
3532.13
1.75
</code></pre>
<p>How would you go about that? A good sol... | <p>The <a href="http://msdn.microsoft.com/en-us/library/ms189527.aspx" rel="noreferrer">STR function</a> has an optional length argument as well as a number-of-decimals one.</p>
<pre><code>SELECT STR(123.45, 6, 1)
------
123.5
(1 row(s) affected)
</code></pre>
| <p>If you MUST do this in SQL you can use the folowing code (This code assumes that you have no numerics that are bigger than 40 chars):</p>
<pre><code>SELECT REPLICATE(' ', 40 - LEN(CAST(numColumn as varchar(40)))) +
CAST(numColumn AS varchar(40)) FROM YourTable
</code></pre>
| 8,112 |
<p>A database application that I'm currently working on, stores all sorts of settings in the database. Most of those settings are there to customize certain business rules, but there's also some other stuff in there.</p>
<p>The app contains objects that specifically do a certain task, e.g., a certain complicated calcu... | <p>You could use Martin Fowlers ServiceLocator pattern. In php it could look like this:</p>
<pre><code>class ServiceLocator {
private static $soleInstance;
private $globalSettings;
public static function load($locator) {
self::$soleInstance = $locator;
}
public static function globalSettings() {
if... | <p>Usually this is handled by an ini file or XML configuration file. Then you just have a class that reads the setting when neeed.</p>
<p>.NET has this built in with the ConfigurationManager classes, but it's quite easy to implement, just read text files, or load XML into DOM or parse them by hand in code.</p>
<p>Hav... | 3,322 |
<p>I'm having a little trouble figuring out exactly how const applies in a specific case. Here's the code I have:</p>
<pre><code>struct Widget
{
Widget():x(0), y(0), z(0){}
int x, y, z;
};
struct WidgetHolder //Just a simple struct to hold four Widgets.
{
WidgetHolder(Widget a, Widget b, Widget c, Widget... | <p>This compiles because although the WidgetHolder is a const object, this const-ness does not automatically apply to objects pointed to (referenced by) the WidgetHolder. Think of it at a machine level - if the WidgetHolder object itself were held in read-only memory, you could still write to things that were pointed t... | <p>EDIT: he deleted his answer, making me look a bit foolish :)</p>
<p>The answer by Flame is dangerously wrong. His WidgetHolder takes a reference to a value object in the constructor. As soon as the constructor returns, that passed-by-value object will be destroyed and so you'll hold a reference to a destroyed objec... | 8,155 |
<p>As I get more and more namespaces in my solution, the list of using statements at the top of my files grows longer and longer. This is especially the case in my unit tests where for each component that might be called I need to include the using for the interface, the IoC container, and the concrete type. </p>
<p... | <p>Some people enjoy hiding the usings in a <code>#region</code>. Otherwise, I think you're out of luck. Unless you want to put the namespace on all your referents.</p>
| <p>Resharper - the add-in for Visual Studio - has a feature that strips unsued Using's from a file, but I don't know anything that does quite what you describe.</p>
| 8,757 |
<p>I made a tea bowl, but it leaked when making it in PLA...</p>
<p>What are the key points to keep in mind when designing and printing an object that is intended to hold water using an FDM printer? </p>
| <p>I've found that a double-walled base seems to give better results than trying to make the base very thick. Any imperfections in the print, or cracking caused by removing the print can lead to leaks - but if there is layer/infill/layer, the result seems to turn out better for me.</p>
<p>Vase mode can be effective (a... | <p>When designing the object, you should make sure your object is completely enclosed (obviously). When printing, try increasing the print temperature so that the layers stick to each other well. The most important thing is the print temperature, because if the layers don't adhere to each other well, you will get a lea... | 677 |
<p>I'm working on some code that uses the System.Diagnostics.Trace class and I'm wondering how to monitor what is written via calls to Trace.WriteLine() both when running in debug mode in Visual Studio and when running outside the debugger.</p>
| <p>Try <a href="http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx" rel="nofollow noreferrer">Debug View</a>. It works quite nicely.</p>
| <p>I use a simple little program called '<a href="http://www.baremetalsoft.com/baretail/" rel="nofollow noreferrer">BareTail</a>' which displays plain text files, updating it's display as the file gets written to and follows (or wraps) to the bottom of the file.</p>
<p>When running outside the debugger you'll need to ... | 7,846 |
<p>I am using 2 extruders. Is it possible to use them both at the same time.
Now I can use one at a time but not both at the same time.
Is there a gcode that supports this action?</p>
| <p>To print with 2 extruders simultaneously you need a firmware that supports that. Luckily, there is a firmware called Sailfish that is able to do that. The feature you are looking for is called <code>Ditto</code> printing.</p>
<p>Sailfish firmware is found <a href="http://www.sailfishfirmware.com" rel="nofollow nore... | <p>If you want a ditto printing is not mandatory to have a specific firmware (or g-code), you only need to add extruder to your end effector and - because of electrical power requirements - add further stepper driver for further stepper motor.
Please note that the maximum footprint of your printed object is less than ... | 912 |
<p>I'm currently in the process of fine-tuning my cheap CTC i3 clone. I'm using Cura 3.1 for slicing.</p>
<p>After calibrating the extruder steps, I wanted to optimize the line width and flow compensation parameters. I am using a 0.4 mm nozzle and therefore set the line width parameter to 0.4 mm in Cura. I then printe... | <p>That is very bizarre. Since GCODE describe each movement of the printing head (so, the printer does not get to decide anything in terms of printing strategy, it just executes), I can only see three possibilities that would explain what's going on.</p>
<p><strong>The print is being scaled up at printer level</stron... | <p>Cura does not adjust line width to account for lower flow (aka extrusion multiplier), they are independent settings. Therefore, if you have to reduce extrusion to get the correct wall thickness, then as you said, the lines may not be close enough together to fuse properly and you'll have a weak part. Try reducing th... | 826 |
<p>So I'm working on a Rails app to get the feeling for the whole thing. I've got a <code>Product</code> model that's a standard ActiveRecord model. However, I also want to get some additional product info from Amazon ECS. So my complete model gets some of its info from the database and some from the web service. My qu... | <p>As with most things: it depends. Each of your ideas have merit. If it were me, I'd start out this way: </p>
<pre><code> class Product < ActiveRecord::Base
has_one :aws_item
end
class AWSItem
belongs_to :product
end
</code></pre>
<p>The key questions you want to ask yourself are: </p>
<p><str... | <p>You can use the <code>composed_of</code> relationship in ActiveRecord. You make a regular class with all the attributes that you manage through AWS and specify that your Product-class is composed_of this class. ActiveRecord will handle the delegation of the mapped attributes to and from this class.</p>
<p>See <a hr... | 9,578 |
<p>Is there a simple way to cache <code>MySQL queries</code> in <code>PHP</code> or failing that, is there a small class set that someone has written and made available that will do it? I can cache a whole page but that won't work as some data changes but some do not, I want to cache the part that does not.</p>
| <p>This is a great overview of how to cache queries in MySQL:</p>
<ul>
<li><a href="http://www.petefreitag.com/item/390.cfm" rel="noreferrer">The MySQL Query Cache</a></li>
</ul>
| <p>I would recommend the whole page caching route. If some of the data changes, simply place tokens/placeholders in place of the dynamic data. Cache the entire page with those tokens in place, then post process the tokens for the cached data for the tokens. Thus you now have a cached page that contains dynamic content.... | 5,784 |
<p>I am using a perl script to POST to Google Appengine application. I post a text file containing some XML using the -F option.</p>
<p><a href="http://www.cpan.org/authors/id/E/EL/ELIJAH/bget-1.1" rel="nofollow noreferrer">http://www.cpan.org/authors/id/E/EL/ELIJAH/bget-1.1</a></p>
<p>There is a version 1.2, already... | <p>Is the number of extra bytes you need equal to the number of lines in the file? I ask because perhaps its possible that somehow carriage-returns are being introduced but not counted.</p>
| <p>How are you getting the number of bytes? .. By looking at the size of the file on the filesystem?</p>
<p>You can use "-s" to get the size of the file.</p>
<p>Or, if you want to do more, you may use <a href="http://search.cpan.org/~rgarcia/perl-5.10.0/lib/File/stat.pm" rel="nofollow noreferrer">File::Stat</a></p>
| 6,852 |
<p>Are there any good recommendations anyone can provide for a good Javascript editor on Windows? </p>
<p>I currently use combinations of FireBug and TextPad but would hate to miss out on the party if there are better options out there. </p>
<p>Thanks.</p>
| <p>I know <a href="https://stackoverflow.com/questions/26897/recommendations-for-javascript-editor-on-windows#26905">jsight</a> already mentioned this, but <a href="http://aptana.com/" rel="nofollow noreferrer"><strong>Aptana Studio</strong></a> really is a great, free editor for JavaScript if you find yourself doing a... | <p><a href="http://editra.org/index.php" rel="nofollow noreferrer">Editra</a> may be worth a look, the code colouring isn't bad, and I believe it has plugins to enable script execution.. Although I have <strong>not</strong> used this myself.</p>
| 4,656 |
<p>In <code>C</code> can I <strong>pass a multidimensional array</strong> to a function <strong>as a single argument</strong> when I don't know what the dimensions of the array are going to be?</p>
<p>Besides, my multidimensional array may contain types other than strings.</p>
| <p>You can do this with any data type. Simply make it a pointer-to-pointer:</p>
<pre><code>typedef struct {
int myint;
char* mystring;
} data;
data** array;
</code></pre>
<p>But don't forget you still have to malloc the variable, and it does get a bit complex:</p>
<pre><code>//initialize
int x,y,w,h;
w = 10; //... | <pre><code>int matmax(int **p, int dim) // p- matrix , dim- dimension of the matrix
{
return p[0][0];
}
int main()
{
int *u[5]; // will be a 5x5 matrix
for(int i = 0; i < 5; i++)
u[i] = new int[5];
u[0][0] = 1; // initialize u[0][0] - not mandatory
// put data in u[][]
printf("%d", ... | 2,606 |
<p><a href="http://en.wikipedia.org/wiki/SHA-1" rel="noreferrer">SHA Hash functions</a></p>
| <pre><code>require 'digest/sha1'
Digest::SHA1.hexdigest 'foo'
</code></pre>
| <p>Where 'serialize' is some user function defined elsewhere.</p>
<pre><code> def generateKey(data)
return Digest::SHA1.hexdigest ("#{serialize(data)}")
end
</code></pre>
| 5,473 |
<p>I would like to use a component that exposes the datasource property, but instead of supplying the datasource with whole list of objects, I would like to use only simple object. Is there any way to do this ?</p>
<p>The mentioned component is DevExpress.XtraDataLayout.DataLayoutControl - this is fairly irrelevant to... | <p>Databinding expects an IEnumerable object, because it enumorates over it just like a foreach loop does.</p>
<p>So to do this, just wrap your single object in an IEnumerable.</p>
<p>Even this would work:</p>
<pre><code>DataBindObject.DataSource = new List<YourObject>().Add(YourObjectInstance);
</code></pre>
| <p>Using this in my formView:</p>
<pre><code>databoundControl.DataSource = new [] { singleObject };
databoundControl.DataBind();
</code></pre>
| 7,099 |
<p>I'm trying to replace each <code>,</code> in the current file by a new line:</p>
<pre><code>:%s/,/\n/g
</code></pre>
<p>But it inserts what looks like a <code>^@</code> instead of an actual newline. The file is not in DOS mode or anything.</p>
<p>What should I do?</p>
<p>If you are curious, like me, check the q... | <h2>Use <code>\r</code> instead of <code>\n</code>.</h2>
<p>Substituting by <code>\n</code> inserts a null character into the text. To get a newline, use <code>\r</code>. When <em>searching</em> for a newline, you’d still use <code>\n</code>, however. This asymmetry is due to the fact that <code>\n</code> and <code>\r<... | <p>in vim editor the following command successfully replaced \n with new line</p>
<pre><code>:%s/\\n/\r/g
</code></pre>
| 9,681 |
<p>I have long since forgotten the password for the root user on one of my boxes. Is there a way I can change it without having to log in to the instance, or will I have to reinstall?</p>
| <p><strong>Step 1</strong></p>
<p>Stop database:</p>
<pre><code>shell> /etc/init.d/mysql stop
</code></pre>
<p><strong>Step 2</strong></p>
<p>Restart database</p>
<ul>
<li>without password autentification</li>
<li>without connection to the network</li>
</ul>
<p>Access to database is only possible through it's ... | <p>If you are running an Ubuntu server (possibly also Debian?) you can easily reset. </p>
<p>If you are on 12.04:</p>
<pre><code>sudo dpkg-reconfigure mysql-server-5.5
</code></pre>
<p>If you are on 10.04:</p>
<pre><code>sudo dpkg-reconfigure mysql-server-5.1
</code></pre>
<p>If you are not sure which mysql-server... | 7,696 |
<p>After multiple jams from bulging filaments on two spools I'm getting frustrated. One, right before a job was done.</p>
<p>Is there something I can do to prevent these bulges in filaments from ruining jobs?</p>
<p>What can I do to prevent this from happening in the future before it's a disaster?</p>
<p>He's a pic... | <p>How to catch <em>and</em> fix these on the fly? That would be difficult..</p>
<p>But this is an issue you really should not have.</p>
<p><a href="https://3dprinting.stackexchange.com/q/84/47">Could it be an issue with filament storage?</a></p>
<p>Or is it coming from the manufacturer with these bulges? If so, I w... | <p><strong>Bottom line: <em>The easiest way to prevent this is to avoid cheap filament.</em></strong></p>
<p>You can get mid-grade filament for a few dollars more than the ultra cheap stuff. </p>
<p>In other words I tried out some 10$ stuff from ebay, and while it might print for a little while it notoriously clogged... | 137 |
<p>Is it worth learning the convention or is it a bane to readability and maintainability?</p>
| <p>Considering that most people that use <em>Hungarian Notation</em> is following the misunderstood version of it, I'd say it's pretty pointless.</p>
<p>If you want to use the original definition of it, it might make more sense, but other than that it is mostly syntactic sugar.</p>
<p>If you read the <a href="http://... | <p>I've been working for IBM for the past 6 months and I haven't seen it anywhere (thank god because I hate it.) I see either camelCase or c_style.</p>
<pre><code>thisMethodIsPrettyCool()
this_method_is_pretty_cool()
</code></pre>
| 2,734 |
<p>We get the following error;</p>
<pre><code>The request was aborted: Could not create SSL/TLS secure channel
</code></pre>
<p>while using a <code>WebRequest</code> object to make an <code>HTTPS</code> request. The funny thing is that this only happens after a while, and is temporarily fixed when the application is ... | <p>I seem to recall having this problem last year. I suspect that you aren't closing your WebRequest objects properly, which is why after a certain amount of use it won't allow you to create any new connections.</p>
| <p>It looks like it may be a Conenction: Keep-alive thing: <a href="http://blogs.x2line.com/al/archive/2005/01/04/759.aspx#780" rel="nofollow noreferrer">http://blogs.x2line.com/al/archive/2005/01/04/759.aspx#780</a></p>
| 6,365 |
<p>The problem: I have a class which contains a template method <code>execute</code> which calls another method <code>_execute</code>. Subclasses are supposed to overwrite <code>_execute</code> to implement some specific functionality. This functionality should be documented in the docstring of <code>_execute</code>.
... | <p>Well, if you don't mind copying the original method in the subclass, you can use the following technique.</p>
<pre><code>import new
def copyfunc(func):
return new.function(func.func_code, func.func_globals, func.func_name,
func.func_defaults, func.func_closure)
class Metaclass(type):
... | <p>Well the doc-string is stored in <code>__doc__</code> so it wouldn't be too hard to re-assign it based on the doc-string of <code>_execute</code> after the fact.</p>
<p>Basically:</p>
<p><code></p>
<pre>
class MyClass(object):
def execute(self):
'''original doc-string'''
self._execute()
class... | 9,737 |
<p>I see a lot of talk on here about functional languages and stuff. Why would you use one over a "traditional" language? What do they do better? What are they worse at? What's the ideal functional programming application?</p>
| <p>Functional languages use a different paradigm than imperative and object-oriented languages. They use side-effect-free functions as a basic building block in the language. This enables lots of things and makes a lot of things more difficult (or in most cases different from what people are used to).</p>
<p>One of th... | <p>I don't think that functional languages will solve anything, and that this is just a hype that management is trying to sell, remember the only truth:</p>
<p>There is no silver bullet.</p>
<p>All the rest, is bullshit, also they've said that OO would solve our problems, that Web Services would solve our problems, t... | 5,710 |
<p>Lucene has quite poor support for Russian language.</p>
<p>RussianAnalyzer (part of lucene-contrib) is of very low quality.</p>
<p>RussianStemmer module for Snowball is even worse. It does not recognize Russian text in Unicode strings, apparently assuming that some bizarre mix of Unicode and KOI8-R must be used in... | <p>If all else fails, use <a href="http://www.sphinxsearch.com/" rel="nofollow noreferrer">Sphinx</a></p>
| <p>That's the beauty of open source. You have the source code, so if the current implementations don't work for you, you can always create your own or even better, extend the existing ones.
A good start would be the "Lucene in Action" book.</p>
| 8,934 |
<p>I added a custom boot screen to marlin by adding <code>_Bootscreen.h</code> to the project root folder and it works fine. The problem is that the custom screen shows quickly and disappear then the marlin boot screen is then displayed for a longer time.
I want to remove the marlin boot screen.</p>
<p>I dug around in... | <p>So after some search:</p>
<ol>
<li><p>You can't (at least should not) remove the marlin bootscreen according to this issue <a href="https://github.com/MarlinFirmware/Marlin/issues/8186" rel="nofollow noreferrer">SHOW_CUSTOM_BOOTSCREEN hides Marlin logo</a>, quote:</p>
<blockquote>
<p>We wanted an additional logo... | <p>So after some search:</p>
<ol>
<li><p>You can't (at least should not) remove the marlin bootscreen according to this issue <a href="https://github.com/MarlinFirmware/Marlin/issues/8186" rel="nofollow noreferrer">SHOW_CUSTOM_BOOTSCREEN hides Marlin logo</a>, quote:</p>
<blockquote>
<p>We wanted an additional logo... | 777 |
<p>I'm looking for a way to slice up a 3D model and then get the profiles of each individual layer. I need to 2D print the different layers (with the layer height that I define) for a Styrofoam craft.</p>
<p>Thank you very much!</p>
| <p>I'm a fan of OpenSCAD and have used the method suggested in the first answer. For non-OpenSCAD users, another option exists, which I've also used.</p>
<p>PrusaSlicer is a free 3D printer slicing program. One can configure layer heights as desired for the material thickness, even though it's not likely one will find ... | <p>With OpenSCAD, you can <code>import</code> the STL file and apply <code>projection</code> with <code>cut=true</code> at successive Z-axis <code>translate</code> operations, and write out the result as SVG. This can all be automated from the command line to product a series of SVG files for your layers to "2D pr... | 2,150 |
<p>After upgrading to the latest version of TortoiseSVN (1.5.2.13595), it's context menu is no longer available.</p>
<p>When attempting to run it manually, I get this error:</p>
<pre><code>The application has failed to start because its side-by-side configuration is incorrect.
Please see the application event log for... | <p>I remembered I'd seen this thing before just after posting to SO</p>
<p>It seems that later versions of TortoiseSVN are built with Visual Studio 2008 SP1 (hence the 9.0.30411.0 build number)</p>
<p>Installing the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2... | <p>Confirmed working on windows 7 x64.</p>
| 3,955 |
<p>Is there a performance hit if we use a loop instead of recursion or vice versa in algorithms where both can serve the same purpose? Eg: Check if the given string is a palindrome.
I have seen many programmers using recursion as a means to show off when a simple iteration algorithm can fit the bill.
Does the compiler ... | <p>It is possible that recursion will be more expensive, depending on if the recursive function is <a href="http://en.wikipedia.org/wiki/Tail_recursion" rel="noreferrer">tail recursive</a> (the last line is recursive call). Tail recursion <em>should</em> be recognized by the compiler and optimized to its iterative cou... | <p>I'm going to answer your question by designing a Haskell data structure by "induction", which is a sort of "dual" to recursion. And then I will show how this duality leads to nice things.</p>
<p>We introduce a type for a simple tree:</p>
<pre><code>data Tree a = Branch (Tree a) (Tree a)
| Leaf a
... | 9,783 |
<p>I am thinking to use closed-loop stepper motors to prevent step loss and make the machine more accurate. What options (preferably low cost) are there for:</p>
<p><code>stepper motor + driver + encoder + microcontoller</code></p>
<p>Is building it from scratch worth it? E.g. Arduino Mega 2560 + RAMPS 1.4/1.5/1.6 + ... | <p>A number of options exist, but keep in mind that cost will be a limiting factor.</p>
<p><em>(Small sidenote: cost depends on persective, financial cost does not equal mental cost. The tradeoff between buy or make depends also on your willingness to persist when things don't work right away.)</em></p>
<p><strong>Be... | <p>So, I am one of those who has implemented this on my big scale heavily modified cr-10 S5. </p>
<p>Why?</p>
<p>Well with bigger prints, the risk of crashing into itself because of a small blob is very real. Possibly ruining a 100$ worth of filament and missing deadlines. (We are using this professionally.) Blobs wi... | 1,598 |
<p>I have a Java application that launches another java application. The launcher has a watchdog timer and receives periodic notifications from the second VM. However, if no notifications are received then the second virtual machine should be killed and the launcher will perform some additional clean-up activities.</... | <p>I may be missing something but can't you call the <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Process.html#destroy()" rel="noreferrer"><code>destroy()</code></a> method on the <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Process.html" rel="noreferrer"><code>Process</code></a> object retu... | <p>You should be able to do that <code>java.lang.Runtime.exec</code> and shell commands.</p>
| 8,919 |
<p>Given:</p>
<pre><code>e = 'a' + 'b' + 'c' + 'd'
</code></pre>
<p>How do I write the above in two lines?</p>
<pre><code>e = 'a' + 'b' +
'c' + 'd'
</code></pre>
| <p>What is the line? You can just have arguments on the next line without any problems:</p>
<pre><code>a = dostuff(blahblah1, blahblah2, blahblah3, blahblah4, blahblah5,
blahblah6, blahblah7)
</code></pre>
<p>Otherwise you can do something like this:</p>
<pre><code>if (a == True and
b == False):
</cod... | <p>Taken from The Hitchhiker's Guide to Python (<a href="https://docs.python-guide.org/writing/style/#line-continuations" rel="nofollow noreferrer">Line Continuation</a>):</p>
<blockquote>
<p>When a logical line of code is longer than the accepted limit, you need to split it over multiple physical lines. The Python int... | 7,660 |
<p>I ordered an <a href="http://rads.stackoverflow.com/amzn/click/B007KG0ZYI" rel="nofollow">OEM Power Supply</a> and I intend to hook up with <a href="http://rads.stackoverflow.com/amzn/click/B00511QVVK" rel="nofollow">this rocker switch</a> I believe it's like the one specified in the <a href="http://reprap.org/wiki/... | <p>According to the RepRap.org <a href="http://reprap.org/wiki/G-code" rel="nofollow noreferrer">list of G-Code commands</a>, see <strong><a href="http://reprap.org/wiki/G-code#G0_.26_G1:_Move" rel="nofollow noreferrer">G0 & G1: Move</a></strong>:</p>
<blockquote>
<p>The <code>Ennn</code> command is <em>The amou... | <p>Is the hotend temperature set correctly? If you only preheat the hotend but then turn it off, it will behave exactly as you described (while you're above <code>EXTRUDE_MINTEMP</code> it will behave normally, but once the temperature drops too low it will continue doing the XYZ-moves, but stop extruding). Perhaps you... | 233 |
<p>We are getting new dev machines and moving up to Vista 64 Ultimate to take advantage of our 8gb ram. Our manager wants us to do all dev in 32bit virtual machines to make sure there will be no problems with our code moving into production. </p>
<p>Is there any way to guarantee the resultant programs will work on 3... | <p>I do development on 64 bit machines for 32 bit Windows. It's not a problem. You should make sure that your projects are set to compile in x86 mode in order to be conservative. You'll want to go through each project in the solution and double check this. You could also use the AnyCPU setting but that's a little ri... | <p>yeah, like adam was saying. There's 3 options: MSIL (default), x64, and x86. You can target x64 and it will generate dll's specifically for 64-bit systems, or you can do x86 which will run on 32-bit and 64-bit, but will have the same restrictions as 32-bit on a 64-bit system.</p>
<p>MSIL will basically let the JITe... | 5,043 |
<p>I need to learn ADO.NET to build applications based on MS Office. I have read a good deal about ADO.NET in the MSDN Library, but everything seems rather messy to me.</p>
<p>What are the basics one must figure out when using ADO.NET? I think a few key words will suffice to let me organize my learning.</p>
| <p>There are three key components (assuming ur using SQL server):</p>
<ul>
<li><code>SQLConnection</code></li>
<li><code>SqlCommand</code></li>
<li><code>SqlDataReader</code></li>
</ul>
<p>(if you're using something else, replace <code>Sql</code> with "Something", like <code>MySqlConnection</code>, <code>OracleComman... | <p>Another way of getting a command object is to call <code>connection.CreateCommand()</code>. </p>
<p>That way you shouldn't have to set the <code>Connection</code> property on the command object. </p>
| 2,618 |
<p>I see there was already a meta question regarding this but it was back during the private beta. The site is now in the public beta and still not very healthy with only 2.1 questions per day and a very low 219 visits per day compared to the recommended 1,500...</p>
<p>I'm not sure what happens once the beta ends bu... | <p>Tag excerpts should at least try and give a concise definition as to the subject, and provided any usage guidance <em>if necessary.</em></p>
<p>Therefore, you need to make sure to address a set of key points:</p>
<ul>
<li>Is the tag name ambiguous? Will an amateur be able to understand the subject without having t... | <p>For reference, I would like to propose a copy-paste solution for tags.</p>
<p><strong>Usage Guidance</strong></p>
<p><code>For questions regarding {insert list of applicable topics} of {Tag Name}.</code></p>
<p><strong>Details</strong></p>
<pre><code>{Tag name, unabbreviated}: {Definition}
Examples:
- What is ... | 23 |
<p>Is it possible to deploy a native Delphi application with ClickOnce without a stub C# exe that would be used to launch the Delphi application?</p>
<p>The same question applies to VB6, C++ and other native Windows applications.</p>
| <p>Personally, I build my own mechanism to kick off self update process when my application timestamp is out of sync with the server. Not too difficult, but it's not a simple task.</p>
<p>By the way, for Delphi you can use some thirdparty help:</p>
<p><a href="http://www.tmssoftware.com/site/wupdate.asp" rel="nofollo... | <p>I'm not 100% sure if this can be accomplished without the stub, but this article may provide some insight:</p>
<p><a href="http://blogs.msdn.com/g/archive/2008/06/06/sample-demonstrating-clickonce-deployment-of-com-component-implemented-in-managed-assembly-without-using-gac-or-registry-and-without-requiring-admin-r... | 7,489 |
<p>I actually have an answer to my question but it is not parallelized so I am interested in ways to improve the algorithm. Anyway it might be useful as-is for some people.</p>
<pre><code>int Until = 20000000;
BitArray PrimeBits = new BitArray(Until, true);
/*
* Sieve of Eratosthenes
* PrimeBits is a simple BitArra... | <p>You might save some time by cross-referencing your bit array with a doubly-linked list, so you can more quickly advance to the next prime.</p>
<p>Also, in eliminating later composites once you hit a new prime p for the first time - the first composite multiple of p remaining will be p*p, since everything before tha... | <pre><code> void PrimeNumber(long number)
{
bool IsprimeNumber = true;
long value = Convert.ToInt32(Math.Sqrt(number));
if (number % 2 == 0)
{
IsprimeNumber = false;
MessageBox.Show("No It is not a Prime NUmber");
return;
}
for ... | 5,073 |
<p>Is there a C# equivalent for the VB.NET <code>FormatNumber</code> function? </p>
<p>I.e.:</p>
<pre><code>JSArrayString += "^" + (String)FormatNumber(inv.RRP * oCountry.ExchangeRate, 2);
</code></pre>
| <p>In both C# and VB.NET you can use either the <a href="http://www.java2s.com/Code/CSharp/Development-Class/UseToStringtoformatvalues.htm" rel="nofollow noreferrer">.ToString()</a> function or the <a href="http://www.java2s.com/Code/CSharp/Development-Class/UseStringFormattoformatavalue.htm" rel="nofollow noreferrer">... | <p>While I would recommend using ToString in this case, always keep in mind you can use ANY VB.Net function or class from C# just by referencing Microsoft.VisalBasic.dll.</p>
| 7,205 |
<p>I have a long 8 mm smooth steel rod of about 55 cm long. This rods bend easily due to the length. If I replace them with 8mm solid carbon fiber rods, will the bending reduce? Will the bearings wear off the carbon fiber rod? I couldn't find too much information about this.</p>
| <p>Steel is the best material for a linear rod when you have a fixed cross-section. It will have the least flex of any rod (aside from some exotic metals) of the same size. </p>
<p>Carbon fiber's material properties might seem superior at first sight, but the stiffness is very anisotropic -- it's very stiff along the ... | <p>I agree that steel is the best material for rails but the info provided on carbon fiber is just wrong.</p>
<p>When making a carbon fiber part, whether a tube or any other shape, you lay the fabric in the orientation you need for the direction of the forces. If multi-directional strength and stiffness is needed then... | 242 |
<p>I would like to start tagging my deployed binaries with the latest SVN revision number.</p>
<p>However, because SVN is file-based and not directory/project-based, I need to scan through all the directory's and subdirectory's files in order to determine the highest revision number.</p>
<p>Using <code>svn info</code... | <p>One way. When you check out the code, look at the last line of svn output:</p>
<pre><code>$ svn up
...stuff...
Updated to revision 66593.
</code></pre>
<p>A more direct way:</p>
<pre><code>$ svn info
Path: .
URL: https://svn.example.com/svn/myproject/trunk
Repository Root: https://svn.example.com/svn/
Repository ... | <p>This is ridiculous but <code>svn info</code> or <code>svnversion</code> wont take into consideration subdirectories; it's a feature called working 'Mixed Revisions' - I call it torture. I just needed to find the latest 'revision' of the live codebase and the hacked way below worked for me - it might take a while to ... | 8,011 |
<p>I have my nozzle close to the substrate that I am printing on, so that a piece of paper can just about slide underneath it freely, without catching.</p>
<p>Is this the right way to do it?</p>
| <p>Traditionally, using a piece of paper (about 0.004" thick) gets you close to your appropriate standoff. However, if you adjust your layer thickness, your standoff should reflect this. Ideally, you will set your standoff <strong>roughly</strong> with a piece of paper or other type of shim stock, then "fine-tune" the ... | <p>Using a piece of paper won't guarantee you get exactly the "correct" height (because different papers have different thicknesses, and it's hard to determine exactly when it no longer catches on the nozzle) but it gets the bed level and the distance will be close to correct.</p>
<p>You can then further adjust the he... | 405 |
<pre><code><xsl:for-each select="./node [position() &lt;= (count(*) div 2)]">
<li>foo</li>
</xsl:for-each>
<xsl:for-each select="./node [count(*) div 2 &lt; position()]">
<li>bar</li>
</xsl:for-each>
</code></pre>
<p>My list has 12 nodes, but the second l... | <p>When you do <code>count(*)</code>, the current node is the <code>node</code> element being processed. You want either <code>count(current()/node)</code> or <code>last()</code> (preferable), or just calculate the midpoint to a variable for better performance and clearer code:</p>
<pre><code><xsl:variable name="no... | <p>I'm not at all sure, but it seems to me that <code>count(*)</code> is not doing what you think it is. That counts the number of children of the current node, not the size of the current node list. Could you print it out to check that it's 8 or 9 instead of 12?</p>
<p>Use <code>last()</code> to get the context siz... | 5,425 |
<p>I have 2 hosts and I would like to point a subdomain on host one to a subdomain on host two:</p>
<pre><code>subdomain.hostone.com --> subdomain.hosttwo.com
</code></pre>
<p>I added a CNAME record to host one that points to subdomain.hosttwo.com but all I get is a '<strong>400 Bad Request</strong>' Error.</p>
<... | <p>Try changing it to "subdomain -> subdomain.hosttwo.com"</p>
<p>The <code>CNAME</code> is an alias for a certain domain, so when you go to the control panel for hostone.com, you shouldn't have to enter the whole name into the <code>CNAME</code> alias.</p>
<p>As far as the error you are getting, can you log onto sub... | <p>It's probably best/easiest to set up a <a href="http://www.webconfs.com/how-to-redirect-a-webpage.php" rel="nofollow noreferrer">301 redirect</a>. No DNS hacking required.</p>
| 3,699 |
<p>I have a 3D printed object that I'd like to print on. Adhesive stickers are an option, but as the surface is rounded it's difficult to get a good film to stick well. </p>
<p>Is there any system to print on a 3D object (e.g. ink jet). I need at least 300dpi. Black in the first instance, but color would be nice for f... | <p>Rather than post a series of links for various services and vendors, consider to use as a search term "hydrographic film at home" to find results to suit your purpose. The first search results I found excluded "at home" and indicated it was not suited for home/hobbyist use, but the modification resulted in vendors s... | <p>There are printer types that can print images into the material as it's being printed. SLA and SLS type printers are capable of this but I believe Polyjet printers are the best suited.</p>
<p>At 300 dpi though you might be pushing the edge of what is capable. to get that fine of detail your best option may be to loo... | 582 |
<p>I have a website that plays mp3s in a flash player. If a user clicks 'play' the flash player automatically downloads an mp3 and starts playing it. </p>
<p>Is there an easy way to track how many times a particular song clip (or any binary file) has been downloaded?</p>
<hr>
<blockquote>
<p>Is the play link a lin... | <p>The funny thing is I wrote a php media gallery for all my musics 2 days ago. I had a similar problem. I'm using <a href="http://musicplayer.sourceforge.net/" rel="nofollow noreferrer">http://musicplayer.sourceforge.net/</a> for the player. And the playlist is built via php. All music requests go to a script called ... | <p>Is there a database for your music library? If there is any server code that runs when downloading the mp3 then you can add extra code there to increment the play count. You could also have javascript make a second request to increment the play count, but this could lead to people/robots falsely incrementing counts.... | 2,261 |
<p>I was testing on a customer's box this afternoon which has Windows Vista (He had home, but I am testing on a Business Edition with same results).</p>
<p>We make use of a .DLL that gets the Hardware ID of the computer. It's usage is very simple and the sample program I have created works. The Dll is <a href="http://... | <p>@<a href="https://stackoverflow.com/questions/29284/windows-vista-unable-to-load-dll-xdll-invalid-access-to-memory-location-dllnotf#29400">Martín</a></p>
<p>The reason you were not getting the UAC prompt is because UAC can only change how a process is <strong>started</strong>, once the process is running it must st... | <p>Have you made a support request to the vendor? Perhaps there's something about the MacBook Pro hardware that prevents the product from working.</p>
| 4,893 |
<p>When using Slic3r I noticed that <code>Slice now</code> and <code>Export G-Code</code> do different things. While <code>Slice now</code> is nice, it does not show any tool paths etc. </p>
<p>Is there an actual way to generate and visualize the G-code in Slic3r without saving the exported G-Code first? When aligning... | <p>Using Repetier Host V2.1.2 and slicing with Slic3r (or with CuraEngine), there is an "edit Gcode" button under the Print Preview tab. It is located at the top right of the screen. With that button you can access, examine and change the Gcode of the project you are working on.</p>
| <p>After you use the Slice Now button (and the slicing progress bar shows completed), select the preview tab. To the right of the window you will see a pair of vertical sliders. Each slider changes the start and finish locations for the filament layers.</p>
<p>You can slide the left one to the bottom, which will "empt... | 943 |
<p>Say you want a simple maze on an N by M grid, with one path through, and a good number of dead ends, but that looks "right" (i.e. like someone made it by hand without too many little tiny dead ends and all that). Is there a known way to do this?</p>
| <p>From <a href="http://www.astrolog.org/labyrnth/algrithm.htm" rel="noreferrer">http://www.astrolog.org/labyrnth/algrithm.htm</a></p>
<blockquote>
<p>Recursive backtracker: This is somewhat related to the recursive backtracker solving method described below, and requires stack up to the size of the Maze. When carvi... | <p>Here's the DFS algorithm written as pseudocode: </p>
<p>create a CellStack (LIFO) to hold a list of cell locations<br>
set TotalCells = number of cells in grid<br>
choose a cell at random and call it CurrentCell<br>
set VisitedCells = 1 </p>
<p>while VisitedCells < TotalCells
find all neighbors of CurrentCell... | 5,940 |
<p>I'm working on a big .NET 1.1 project, and there exists a wish to upgrade this, majorily to be able to use better tools like Visual Studio 2008, but also because of the new features and smaller amount of bugs in the .NET 2.0 framework.</p>
<p>The project consist for the bigger part of VB.NET, but there are also par... | <p>We're looking at doing the same migration right now Tobi. First, you can get a good idea of what to expect by making a copy of your project (or a portion of it) and give it a "dry run" through the .NET 2.0 compiler. My experience with this was that the 2.0 compiler gives more warnings about bad programming practic... | <p>You probably won't have any <strong>breaking</strong> issues, though you may get some deprecated method warnings. The compiler should generally tell you what the replacement is though. I know that some of the System.Configuration things were updated.</p>
| 8,167 |
<p>What is the difference between the <code>EXISTS</code> and <code>IN</code> clause in SQL?</p>
<p>When should we use <code>EXISTS</code>, and when should we use <code>IN</code>?</p>
| <p>The <code>exists</code> keyword can be used in that way, but really it's intended as a way to avoid counting:</p>
<pre class="lang-sql prettyprint-override"><code>--this statement needs to check the entire table
select count(*) from [table] where ...
--this statement is true as soon as one match is found
exists ... | <p>If you are using the IN operator, the SQL engine will scan all records fetched from the inner query. On the other hand if we are using EXISTS, the SQL engine will stop the scanning process as soon as it found a match. </p>
| 4,456 |
<p>My current place of employment is currently in a transition, new ownership has taken over, things are finally getting standardized and proper guidelines are being enforced. </p>
<p>But we are still using VSS, there really isn't any reason for using it other then that's what whats initially setup. We don't use Visu... | <p>VSS totally relies on the clients to manage the database. If a client drops connection in the middle of a write over the network at just the wrong time, your file is trashed on the server. Not just the tip, but all the history. Hope you have a good backup. I've been through it. It's bad news.</p>
<p>VSS usage over ... | <p>Even if it ain't broke, there's a potential benefit to migrating from VSS. First and most trivially, you won't have to buy new VSS licenses. Second, there are many examples of deficiencies in the VSS product (some also acknowledged by MS). The learning curve for SVN is at least as low as for VSS, and if you have ... | 6,636 |
<p>We're having problem with a huge number of legacy stored procedures at work. Do you guys recommend any tool the can help better understand those procedures? Some kind of reverse engineering that indentifies inter-procedure dependencies and/or procedure vs. tables dependencies. Can be a free or commercial tool.</p>
... | <p>Redgate has a rather expensive product called <a href="http://www.red-gate.com/products/SQL_Dependency_Tracker/" rel="nofollow noreferrer">SQL Dependency Tracker</a> that seems to fulfill the requirements.</p>
| <p>The single best tool for reverse engineering is by APEX. Its amazing. It can even trace into .NET assemblies and tell you where the procs are used. Its by far the deepest product of its kind. RedGate has great other tools but not in this case. </p>
| 9,533 |
<p>I want to allow my users to embed their own Flash animations in their posts. Usually the actual file is hosted on some free image hosting site. I wouldn't actually load the flash unless the user clicked a button to play (so that nothing auto-plays on page load). I know people can make some really annoying crap in... | <p>Flash has some neat security measures in place. Allowing users to upload swf's to your site and embedding them is unsafe, you're basically setting yourself up for an XSS attack.</p>
<p>However, allowing them to hotlink should not be a problem. The swf will be locked to the domain that is hosting it and is not allow... | <p>Yes, it's unsafe.</p>
<p>There's no easy way of allowing it. You could have a domain whitelist that allowed YouTube, Hulu, etc. through, but whitelisting is inherently painstaking - you'd be constantly updating.</p>
| 6,561 |
<p>When I first started using revision control systems like <a href="http://en.wikipedia.org/wiki/Concurrent_Versions_System" rel="nofollow noreferrer">CVS</a> and <a href="http://en.wikipedia.org/wiki/Apache_Subversion" rel="nofollow noreferrer">SVN</a>, I didn't really understand the concepts of the "trunk", branchin... | <p>See these two questions on SO for more information:</p>
<ul>
<li><a href="https://stackoverflow.com/questions/16142/what-does-branch-tag-and-trunk-really-mean">What does branch, tag and trunk really mean?</a></li>
<li><a href="https://stackoverflow.com/questions/15621/subversion-question">Subversion question</a></l... | <p>Eric has an excellent series of articles on Source Control use and organisational best practices.
<a href="http://www.ericsink.com/scm/scm_branches.html" rel="nofollow noreferrer">Chapter 7 deals with branches</a> (and yes, it recommends the /trunk/ and /branches/ directories you suggest).</p>
| 3,833 |
<p>This is about practicality. I'm hearing that people are using their BLTouch not to adjust the Z offset, but as the limit switch for the machine! Why is this so? What are the pros and cons of using a BLTouch (or any touch sensor for that matter) in lieu of a physical limit switch?</p>
<p>(NB: I'm looking for objectiv... | <p>Touch sensors (or inductive or capacitive sensors) are generally used to probe the bed to determine the bed shape. For metallic beds that are not perfectly straight this works excellent. But, if your bed is straight and level (e.g. when you are using a straight slate of glass), you do not need to probe the surface a... | <p>One other way a bed sensor may be preferable over a common limit switch: it automatically adjusts when you change out the build surface.</p>
<p>Most glass build surfaces are anywhere from three to five millimeters thick, while the surface they replace (texture coated or uncoated fiberglass/resin, magnetic sheet, etc... | 1,487 |
<p>I have the following tables, the <code>groups</code> table which contains hierarchically ordered groups and <code>group_member</code> which stores which groups a user belongs to. </p>
<pre><code>groups
---------
id
parent_id
name
group_member
---------
id
group_id
user_id
ID PARENT_ID NAME
-------------------... | <p>Two things come to mind:</p>
<p><strong>1 -</strong> You can repeatedly outer-join the table to itself to recursively walk up your tree, as in:</p>
<pre><code>SELECT *
FROM
MY_GROUPS MG1
,MY_GROUPS MG2
,MY_GROUPS MG3
,MY_GROUPS MG4
,MY_GROUPS MG5
,MY_GROUP_MEMBERS MGM
WHERE MG1.PARENT_ID = MG2.UNIQID (+)
... | <p><del>There's no way to do this in the SQL standard, but you can usually find vendor-specific extensions, e.g., <code>CONNECT BY</code> in Oracle.</del></p>
<p>UPDATE: As the comments point out, this was added in SQL 99.</p>
| 8,417 |
<p>This is something I've pseudo-solved many times and have never quite found a solution for.</p>
<p>The problem is to come up with a way to generate <code>N</code> colors, that are as distinguishable as possible where <code>N</code> is a parameter.</p>
| <p>My first thought on this is "how to generate N vectors in a space that maximize distance from each other."</p>
<p>You can see that the RGB (or any other scale you use that forms a basis in color space) are just vectors. Take a look at <a href="http://mathworld.wolfram.com/topics/RandomPointPicking.html" rel="norefe... | <p>I've read somewhere the human eye can't distinguish between less than 4 values apart. so This is something to keep in mind. The following algorithm does not compensate for this.</p>
<p>I'm not sure this is exactly what you want, but this is one way to randomly generate non-repeating color values:</p>
<p>(beware, i... | 2,268 |
<p>Looking for a good approach to keep track of a Breadth-First traversal between two nodes, without knowing anything about the graph. Versus Depth-First (where you can throw away the path if it doesn't pan out) you may have quite a few "open" possibilities during the traversal.</p>
| <p>The naive approach is to build a tree with the source node as the root and all its connections as its children. Depending on the amount of space you have, you might need to eliminate cycles as you go. You can do that with a bitmap where each bit corresponds to a distinct node in the graph. When you reach the target ... | <p>If you are using .NET 3.5 consider using the <a href="http://msdn.microsoft.com/en-us/library/bb359438.aspx" rel="nofollow noreferrer">Hashset</a> to prevent duplicate nodes from being expanded, this happens when there is cycles in your graph. If you have any knowledge about the contents of the graph consider implem... | 8,170 |
<p>I've been seeing the 330 m and 110 m length estimates for 1.75 and 3.0 mm spools (of PLA, presumably). But a moment's thought staring at that will raise an obvious question.</p>
<p>Using πr², we get the area of the filament in square millimeters (rounding to two decimal points)</p>
<p>For 1.75 it's 2.41 mm²</p>
<... | <p>Let's go about this scientific:</p>
<p>$A_r=\pi{r}^{2}=\pi{\frac{d}{2}}^{2}$</p>
<p>As a result the crossections are $A_{3}=7.06858\text{mm}^2=0.0707\text{cm}^2$, $A_{2.85}=6.3794\text{mm}^2=0.0638\text{cm}^2$ and $A_{1.75}=2.40528\text{mm}^2=0.024\text{cm}^2$.</p>
<p>Volume of a cylinder is $V_{A_d,l}=\times {A_... | <p>Let's go about this scientific:</p>
<p>$A_r=\pi{r}^{2}=\pi{\frac{d}{2}}^{2}$</p>
<p>As a result the crossections are $A_{3}=7.06858\text{mm}^2=0.0707\text{cm}^2$, $A_{2.85}=6.3794\text{mm}^2=0.0638\text{cm}^2$ and $A_{1.75}=2.40528\text{mm}^2=0.024\text{cm}^2$.</p>
<p>Volume of a cylinder is $V_{A_d,l}=\times {A_... | 986 |
<p>How would you determine the column name (e.g. "AQ" or "BH") of the nth column in Excel?</p>
<p>Edit: A language-agnostic algorithm to determine this is the main goal here.</p>
| <p>I once wrote this function to perform that exact task:</p>
<pre><code>public static string Column(int column)
{
column--;
if (column >= 0 && column < 26)
return ((char)('A' + column)).ToString();
else if (column > 25)
return Column(column / 26) + Column(column % 26 + 1);... | <p>I currently use this, but I have a feeling that it can be optimized.</p>
<pre><code>private String GetNthExcelColName(int n)
{
String firstLetter = "";
//if number is under 26, it has a single letter name
// otherwise, it is 'A' for 27-52, 'B' for 53-78, etc
if(n > 26)
{
//the Conve... | 4,275 |
<p>At what level of complexity is it mandatory to switch to an existing framework for web development?</p>
<p>What measurement of complexity is practical for web development? Code length? Feature list? Database Size?</p>
| <p>If you work on several different sites then by using a common framework across all of them you can spend time working on the code rather than trying to remember what is located where and why.</p>
<p>I'd always use a framework of some sort, even if it's your own, as the uniformity will help you structure your projec... | <p>All factors matter. You should measure how much time you can save using 3rd party framework and compare it to the risks of using other's code</p>
| 9,385 |
<p>I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are project/assembly specific?</p>
<hr>
<p><em>Edit: If you are interested t... | <p>We're using a global file called GlobalAssemblyInfo.cs and a local one called AssemblyInfo.cs. The global file contains the following attributes:</p>
<pre><code> [assembly: AssemblyProduct("Your Product Name")]
[assembly: AssemblyCompany("Your Company")]
[assembly: AssemblyCopyright("Copyright © 2008 ...")]
[as... | <p>Using a single AseemblyInfo.cs file for multiple projects is not recommended.
The AssemblyInfo file includes information that might be relevant only for that specific assembly. The two most obvious pieces of information are the <code>AssemblyTitle</code> and <code>AssemblyVersion</code>.</p>
<p>A better solution mi... | 8,774 |
<p>Scenario: You have an ASP.Net webpage that should display the next image in a series of images. If 1.jpg is currently loaded, the refresh should load 2.jpg.<br>
Assuming I would use this code, where do you get the current images name.</p>
<pre><code>string currImage = MainPic.ImageUrl.Replace(".jpg", "");
currIma... | <pre><code>int num = 1;
if(Session["ImageNumber"] != null)
{
num = Convert.ToInt32(Session["ImageNumber"]) + 1;
}
Session["ImageNumber"] = num;
</code></pre>
| <p>You'll have to hide the last value in a HiddenField or ViewState or somewhere like that...</p>
| 6,655 |
<p>Ive been experimenting will multiple color filament but the colors a more or less blended. Is there are filament that goes from one color directly to another without having transition color ex. red to green immediately.</p>
<p>I've been tinkering with <a href="https://www.filamenthub.com" rel="nofollow noreferrer">F... | <p>It takes at least a few cm of extrusion to purge the old color before switching to a new one due to mixing in the melt zone, and possibly much more depending on the particular pigments. If the old color is something bright like red and the new one is white or something close, it can even take many tens of cm before ... | <p>When calling for a <strong>manual</strong> color change, Marlin is set up to allow to extrude extra filament. This is to ensure that the new filament is in the hotend, but it also allows to "purge" the old color from the hotend by extruding till no mixed color comes out anymore.</p>
| 1,917 |
<p>As someone who hasn't used either technology on real-world projects I wonder if anyone knows how these two complement each other and how much their functionalities overlap?</p>
| <p>LINQ to SQL forces you to use the table-per-class pattern. The benefits of using this pattern are that it's quick and easy to implement and it takes very little effort to get your domain running based on an existing database structure. For simple applications, this is perfectly acceptable (and oftentimes even pref... | <p>Or you could use the Castle ActiveRecords project. I've been using that for a short time to ramp up some new code for a legacy project. It uses NHibernate and works on the active record pattern (surprising given its name I know). I haven't tried, but I assume that once you've used it, if you feel the need to drop... | 4,661 |
<p>We have a few very large Excel workbooks (dozens of tabs, over a MB each, very complex calculations) with many dozens, perhaps hundreds of formulas that use the dreaded INDIRECT function. These formulas are spread out throughout the workbook, and target several tables of data to look-up for values.</p>
<p>Now I nee... | <p>You could iterate over the entire Workbook using vba (i've included the code from @PabloG and @euro-micelli ):</p>
<pre><code>Sub iterateOverWorkbook()
For Each i In ThisWorkbook.Worksheets
Set rRng = i.UsedRange
For Each j In rRng
If (Not IsEmpty(j)) Then
If (j.HasFormula) Then
... | <p>You can use something like this in VBA:</p>
<pre><code>Sub ListIndirectRef()
Dim rRng As Range
Dim oSh As Worksheet
Dim oCell As Range
For Each oSh In ThisWorkbook.Worksheets
Set rRng = oSh.UsedRange
For Each oCell In rRng
If InStr(oCell.Formula, "INDIRECT") Then
Debug.Print oCell.Addr... | 5,474 |
<p>I want to print a lemon squeezer and I would prefer to use PET-G. I don't know if it is safe to use, because lemons contain lots of citric acid. Does it dissolve PETG? I haven't found an answer anywhere on the Internet. There are generally few things that dissolve PETG. These are aromatic compounds like toluene, phe... | <p>According to <a href="http://kmac-plastics.net/data/chemical/petg-chemical.htm#.XV7Vokd7m4o" rel="nofollow noreferrer">kmac-plastics</a>, PETG is stable at temperatures below 50°C specifically for citric acid (also acetic acid) and others on the linked list. It is also safe with diesel oil and many alcohols. The lis... | <p>The PETG is food safe (plastic water bottles are made of them), however the colour additives may not be a) stable, or b) food safe. If you are going to make a lemon squeezer then I would suggest that you use a virgin material that is just pet-g with no additives.</p>
<p>However, you could only ever use it one. Any ... | 1,444 |
<p>I have a 3D printer at home, the Colido Compact, and for some reason when I 3D print big flat surfaces a really weird thing happens. I'm using some PLA from Colido too I think</p>
<p><a href="https://i.stack.imgur.com/QOMPF.jpg" rel="nofollow noreferrer" title="Weeeird surface artefacts"><img src="https://i.stack.i... | <p>The oozing is due to hot-end getting hot before the bed leveling procedure: if you move the hot-end warm up command <strong>after</strong> the <code>G29</code> line you avoid that oozing</p>
<pre><code>; Ender 3 Custom Start G-code
M104 S{material_print_temperature_layer_0} ; Set Extruder temperature
M140 S{materia... | <p>The best solution would be to heat the bed, but not the nozzle at startup. If you level with a cold bed, your ABL mesh is going to be off, since the aluminum heated bed plate expands considerably once the heat is applied. </p>
<p>You could also issue a retract command before leveling, and then add a counteracting... | 1,142 |
<p>I just got <a href="http://smile.amazon.com/Stronghero3D-Printing-Filaments-Accuracy-0-05mm/dp/B07HDZ9K22/" rel="noreferrer">my first spool of PETG</a> and tried to calibrate an Ultimaker Cura profile for it on my Ender 3 today with limited success. </p>
<p>I've had severe issues with the filament not sticking to t... | <p>I have printed kilometers of PETG and found the sweet-spot for my brand to be 240 °C for the hotend and 70 °C for the build plate (for my Ultimaker 3 that is, the extruder temp is 5 °C higher for my home build HyperCube Evolution). The reason for the 70 °C is that the glass temperature of PETG is aro... | <p>Thanks to the magic of r/3Dprinting, I have a solution. <a href="https://www.reddit.com/r/3Dprinting/comments/9ltni1/petg_filament_doesnt_stick_reliably_to_ender_3/e79nq20" rel="nofollow noreferrer">u/Lhelge helped me out with a tip</a>:</p>
<blockquote>
<p>I would suggest a higher bed temperature. I print PETG a... | 1,056 |
<p>What is the difference between a <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.group.aspx" rel="nofollow noreferrer">Group</a> and a <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.match.aspx" rel="nofollow noreferrer">Match</a> in .NET's RegEx?</p>
| <p>A <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.match.aspx" rel="noreferrer">Match</a> is an object that indicates a particular regular expression matched (a portion of) the target text. A <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.group.aspx" re... | <p>A Match is a part of a string that matches the regular expression, and there could therefore be multiple matches within a string.</p>
<p>Inside a Match you can define groups, either anonymous or named, to make it easier to split up a match. A simple example is to create a regex to search for URLs, and then use grou... | 4,875 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.