instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>I'm working in VS 2008 and have three projects in one solution. I'm debugging by attaching to a .net process invoked by a third party app (SalesLogix, a CRM app). </p>
<p>Once it has attached to the process and I attempt to set a breakpoint in one of the projects, it doesn't set a breakpoint in that file. It act... | <p>I saw this functionality in older versions of VS.Net (2003 I think). It may still exist in current versions, but I haven't encountered it. Seems that files with the same name, even in different directories confuse VS.Net, and it ends up setting a break point in a file with the same name. May only happen if the cl... | <p>Kibbee, you were right! It was two files with the same name in different folders. I was setting the breakpoint in the correct file on line 58 - it was putting the breakpoint on the other file at line 58. I was finally able to set a breakpoint by using the "Debug-->New Breakpoint-->Break at Function Name" menu opt... | 5,134 |
<p>I'm customizing a SugarCRM 5, and in my <strong>SugarCRM database</strong> I have all invoices which were imported from our ERP. Now, I would like to know if it is possible to create a new sub-panel in the Accounts Panel <strong>without editing the original SugarCRM files</strong>, so that my client invoices index a... | <p>Last time I checked, you could use the <a href="http://developers.sugarcrm.com/tutorials/Customizing_Sugar/4/" rel="nofollow noreferrer">module builder</a> to extend the interface. From 5.0 (or maybe 4.x) on, Sugar added all those APIs, which should enable you to extend SugarCRM without hacking it in and losing it w... | <p>Basically, the Account name should be a related field in your new invoices module (base the module creation on something like QUOTES that has similar fields. Once you create the module (so simple you can almost guess your way through it in the ADMIN section) and the fields you like (using Studio) just add the RELATE... | 5,855 |
<p>How can you get the version information from a <code>.dll</code> or <code>.exe</code> file in PowerShell?</p>
<p>I am specifically interested in <code>File Version</code>, though other version information (that is, <code>Company</code>, <code>Language</code>, <code>Product Name</code>, etc.) would be helpful as wel... | <p>Since PowerShell can call <a href="https://en.wikipedia.org/wiki/.NET_Framework" rel="noreferrer">.NET</a> classes, you could do the following:</p>
<pre><code>[System.Diagnostics.FileVersionInfo]::GetVersionInfo("somefilepath").FileVersion
</code></pre>
<p>Or as <a href="https://web.archive.org/web/20081004113553/... | <p>Here an alternative method. It uses Get-WmiObject CIM_DATAFILE to select the version.</p>
<pre><code>(Get-WmiObject -Class CIM_DataFile -Filter "Name='C:\\Windows\\explorer.exe'" | Select-Object Version).Version
</code></pre>
| 5,055 |
<p>Is there any commonly printed plastic which I can buy that might be transparent to UV light? </p>
<p>I wish to print a mould, then pour in my plastic which requires a UV light to activate the curing process. </p>
| <p>Have you tried printing with Form labs clear resin ? </p>
<p>( This is assuming you have access to a desktop SLA like the Form2+ or Form 1 )</p>
<p>The printed part itself gets hardened after exposure to uv light and actually can increase the life time of your mould .</p>
<p>I have been using the Form labs Form 2... | <p>This is more of a Chemistry question, but seeing as we love 3D printing with exotics, here are a few.</p>
<p><a href="https://topas.com/uv-transmission?gclid=Cj0KCQjwy9LVBRDOARIsAGqoVnuAAAiwiHetZN76JqaRFnq7KKy6br9e6MLDQA4Zlrt01Ceh8GfQrzIaAu7xEALw_wcB" rel="nofollow noreferrer">Topas</a> olefin copolymer</p>
<p>From ... | 856 |
<p>Java has <a href="http://www.scala-lang.org/" rel="noreferrer">Scala</a> and .NET has <a href="http://research.microsoft.com/fsharp/" rel="noreferrer">F#</a>. Both of these languages are very highly integrated into the respective Java and .NET platforms. Classes can be written in Scala then extended in Java for ex... | <p>C++ doesn't have an ecosystem in the sense of Java or .NET. There's no virtual machine, no runtime environment even, there's only a highly specialized standard library that by design doesn't operate well in a purely functional environment. C++ doesn't even have an <a href="http://en.wikipedia.org/wiki/Application_bi... | <p>C++ may not be a pure functional language, but parts of STL are certainly functional.</p>
<p>See <a href="http://www.research.att.com/~bs/bs_faq.html" rel="nofollow noreferrer">Bjarne Stroustrup FAQ</a> (the inventor of the c++)</p>
| 4,465 |
<p>I'm looking at Rails development as a backend to a Flex application and am trying to figure out the communication layer between the Rails app and the Flash Player. All of the things I am finding suggest using SOAP web services to communicate.</p>
<p>However, Flash supports AMF which is nice and fast (and native). ... | <p>There is <a href="http://www.themidnightcoders.com/weborb/rubyonrails/" rel="nofollow noreferrer">WebORB</a> or <a href="http://code.google.com/p/rubyamf/" rel="nofollow noreferrer">RubyAMF</a> which you can use to respond in AMF from Rails, the approaches are a bit different for each one so it depends on your needs... | <p>There's a Rails plugin called <a href="http://www.themidnightcoders.com/weborb/rubyonrails/index.htm" rel="nofollow noreferrer">WebORB for Ruby on Rails</a> which uses remoting with AMF. </p>
| 9,593 |
<p>I have had many problems with my heat shrink for the thermostat on my Anet A8 melting from the heat block. </p>
<p>Is there a way I can insulate my wires from heat but still have enough room to put the thermistor into the block?</p>
| <p>For an illustration of how to employ the Kapton tape, that is mentioned in the answers from Harvey Lim and Howler, watch <a href="https://www.youtube.com/watch?v=0EIFIAWiPdU&t=1290" rel="nofollow noreferrer">How to build a RepRap Prusa i3 (Assembly 7)</a> at 21:30:</p>
<p><a href="https://i.stack.imgur.com/IEr... | <p>You could use Kapton tape to tape the thermistor. It is usually the best option for sticking something onto the hotend or on the heat block. You will also have less trouble since it is very thin.</p>
<p>Note that if you use Kapton tape, you should use several layers of it for added insulation.</p>
| 593 |
<p>When writing production-quality VC++ code, is the use of recursion acceptable? Why or why not?</p>
| <blockquote>
<p>Is there a way to determine at what point I would encounter a stack overflow?</p>
</blockquote>
<p>Not really. A stack overflow happens when you exhaust the stack space - however...</p>
<ul>
<li>The initial stack size can be changed programatically and may default to different amounts depending on y... | <p>Sure - e.g. if you want to traverse a tree structure what else would you use ? </p>
<p>Maybe you would like to have something like a maximum depth to be sure you're not writing an infinite loop. (if this makes sense in your example)</p>
| 5,822 |
<p>I have a Monoprice Maker Select V2.1 (rebadged Wanhao Di3) with a microswiss all metal hot-end and machined lever and extruder plate. It had been printing very consistently for months with this set up - through 5 or 6 kg of filament - until a couple of weeks ago when it has started to under-extrude and then stop par... | <p>Time to check things that usually don't need checking. At this point I would check the power split. </p>
<p>Check the power supply voltage (+12V or maybe +24V, I don't know the printer) at the controller before and after the extrusion stops or sputters. Assure that the voltage stays the same. If it drops you h... | <p>Have you checked your computers power saving settings, the USB port setting in particular, to see if your computer is turning off the USB port, the hard drive, or some other hardware vital to printing?</p>
| 1,345 |
<p>While printing a simple model, my printer starts to layer-shift the build in a direction suddenly. I used the default setting for ultimaker Cura 3.4.1. It has done this same thing for multiple different prints. I would guess it is the software. </p>
<p>How do I fix the issue?
<a href="https://i.stack.imgur.com/xVXO... | <p>You have a case of layer shift. Layer shifts happened to me in 3 ways:</p>
<ol>
<li>The movement of the axis is hindered. Check if all cables run freely and without any chance to catch! improper cable chains can cause binding and stop the printhead or bed in movement and thus induce a shift.</li>
<li>The accelerati... | <p>You have a case of layer shift. Layer shifts happened to me in 3 ways:</p>
<ol>
<li>The movement of the axis is hindered. Check if all cables run freely and without any chance to catch! improper cable chains can cause binding and stop the printhead or bed in movement and thus induce a shift.</li>
<li>The accelerati... | 1,135 |
<h3>Background:</h3>
<p>Some time ago, I built a system for recording and categorizing application crashes for one of our internal programs. At the time, I used a combination of frequency and aggregated lost time (the time between the program launch and the crash) for prioritizing types of crashes. It worked reasonably... | <p>I've not seen any studies, but a reasonable heuristic would be something like :</p>
<p>( Time since last application save when crash occurred + Time to restart application ) * Average hourly rate of application operator.</p>
<p>The estimation gets more complex if the crashes have some impact on external customers ... | <p>It depends...</p>
<p>In terms of cost, the <em>only</em> thing that matters is the <strong>business impact</strong> of the crash, so it rather depends on the type of application.</p>
<p>For may applications, it may not be possible to determine business impact. For others, there may be meaninful measures.</p>
<p>D... | 7,933 |
<p>I'm using <code>ColdFusion</code> to return a result set from a SQL database and turn it into a list.</p>
<p>I need some way to generate an alphabetical navigation bar for that list. I have ColdFusion and the jQuery library available.</p>
<p>I'm looking to generate something like this:</p>
<pre><code>A | B | C |... | <p>To generate the navigation bar, you could do something like this:</p>
<pre><code><cfoutput>
<cfloop from="#asc('A')#" to="#asc('Z')#" index="i">
<a href="###chr(i)#">#chr(i)#</a>
<cfif asc('Z') neq i>|</cfif>
</cfloop>
</cfoutput>
</code></pre>
<p>(CFLOOP doe... | <p>This question was posted quite a long time ago, but there is now an open source vanilla JavaScript plugin available that will alphabetically filter any HTML list with alphabetical navigation</p>
<p>It's called <a href="https://elliottprogrammer.github.io/alphaListNav.js/" rel="nofollow noreferrer">AlphaListNav.js</... | 3,718 |
<p>I'm trying out ASP.NET MVC routing and have of course stumbled across a problem. I have a section, /Admin/Pages/, and this is also accessible through /Pages/, which it shouldn't. What could I be missing?</p>
<p>The routing code in global.asax:</p>
<pre><code>public static void RegisterRoutes(RouteCollection routes... | <p>I'd suggest adding an explicit route for /Pages/ at the beginning.</p>
<p>The problem is that it's being handled by the Default route and deriving:</p>
<p>controller = "Pages"
action = "Index"
id = ""</p>
<p>which are exactly the same as the parameters for your Admin route.</p>
| <p>You have in you first route {action} token/parameter which gets in conflict with setting of default action. Try changing parameter name in your route, or remove default action name.</p>
| 9,573 |
<p>The questions so far are pretty strongly geared towards hobbyist/consumer FFF machines. That's not necessarily bad, since that's where most legit questions will come from. (Not much reason to ask questions about a plug-and-play industrial machine.) But it's a pretty important scope distinction. So far, askers are no... | <p>I think all additive manufacturing techniques should be in scope. Given their popularity with consumers, most questions will naturally be regarding FDM printers. I don't see why that should rule out other techniques though: SLA machines are becoming increasingly accessible, and I think there's a $5000 SLS machine on... | <p>On the question/answer trajectory we're currently following, the group would be best titled "Consumer/Hobbyist FFF 3D Printing" and not just a generic "3D Printing" group. I think some pretty aggressive moderation / self-policing will be required to make people add the necessary tags to clarify this. </p>
<p>Edit: ... | 14 |
<p><em>First off if you're unaware, samba or smb == Windows file sharing, \\computer\share etc.</em></p>
<p>I have a bunch of different files on a bunch of different computers. It's mostly media and there is quite a bit of it. I'm looking into various ways of consolidating this into something more manageable.</p>
<p>... | <p>Hmm, protocol handlers look interesting.</p>
<p>As <a href="https://stackoverflow.com/questions/37804/link-to-samba-shares-in-html#38258">Mark</a> said, in Windows protocol handlers can be dealt with at the OS level</p>
<p>Protocol handlers can also be done at the browser level (which is preferred, as it is cross ... | <p>To make the links work cross platform you could look at the User Agent either in a CGI script or in JavaScript and update your URLs appropriately.</p>
<p>Alternatively, if you want to consolidate SMB shares you could try using <a href="http://en.wikipedia.org/wiki/Distributed_File_System_(Microsoft)" rel="nofollow ... | 5,860 |
<p>When should I choose one or the other? What are the implications regarding space and (full-text) indexing?</p>
<p>BTW: I'm currently using SQL Server 2005 planing to upgrade to 2008 in the following months.</p>
<p>Thanks</p>
| <p>The new (max) fields make it a lot easier to deal with the data from .NET code. With <code>varbinary(max)</code>, you simply set the value of a <code>SqlParameter</code> to a byte array and you are done. WIth the image field, you need to write a few hundred lines of code to stream the data into and out of the fiel... | <p>Once you put it in the blob, it's going to be difficult to be used for normal SQL comparison. See <a href="http://msdn.microsoft.com/en-us/library/ms178158.aspx" rel="nofollow noreferrer">Using Large-Value Data Types</a>.</p>
| 6,939 |
<p>I know I must be missing something, but in a <code>while</code> statement how does the variable hold the data, when it finishes the first pass and goes into the second pass?</p>
<hr>
<p>{</p>
<pre><code>int num1 = 0 ;
int num2 = 0;
int num3 = 0;
while (num1 < 10)
{cout << "enter your first number: ... | <p>Is num1 the variable you're having trouble with? This line:</p>
<pre><code>cin >> num1;
</code></pre>
<p>is setting num1 to the value input by the user. So the value calculated for it in the previous run through the loop is being overwritten each time by the new input.</p>
| <p>I'm not sure I understand your question. In C any data that's not overwritten is carried over into the next iteration of the loop, and imagine that C++ works much the same way.</p>
| 5,679 |
<p>Navision is also known as Microsoft Dynamics NAV.</p>
| <p>Navision's application logic is written using a proprietary language called C/AL, which is loosely based on Pascal. It currently offers both a native database option as well as MS SQL Server.</p>
<p>The next version (NAV 2009) will use .NET assemblies served via IIS. C/AL logic will be translated to C# code and d... | <p>NAV 2009 is indeed using generated .Net assemblies, but it is WCF based. It is not required to use IIS. NAV 2009 does not support interfaces into their server code apart from the (web) services.</p>
<p>NAV 2009 includes both the new Role-Tailored Client, which uses the Service Tier and the old Classic Client, which... | 8,708 |
<p>A very niche problem:</p>
<p>I sometimes (30% of the time) get an 'undefined handler' javascript error on line 3877 of the prototype.js library (version 1.6.0.2 from google: <a href="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/p... | <p>I just found out this error also occurs if you accidentally leave on the parenthesis on your observer call:</p>
<pre><code>Event.observe(document, 'myapp:application_ready', myapp.MyClass.initApp());
</code></pre>
<p>instead of</p>
<pre><code>Event.observe(document, 'myapp:application_ready', myapp.MyClass.initAp... | <blockquote>
<p>I switched to a local version of prototypejs and added some debugging
in the offending method (createWraper) but the debugging never appears
before the error...</p>
</blockquote>
<p>Actually the offending function being called when the error occurs is "wrapper" which is created inside createWrapp... | 6,519 |
<p>If I create a class <code>A</code> as follows:</p>
<pre><code>class A:
def __init__(self):
self.name = 'A'
</code></pre>
<p>Inspecting the <code>__dict__</code> member looks like <code>{'name': 'A'}</code></p>
<p>If however I create a class <code>B</code>:</p>
<pre><code>class B:
name = 'B'
</cod... | <p><code>B.name</code> is a class attribute, not an instance attribute. It shows up in <code>B.__dict__</code>, but not in <code>b = B(); b.__dict__</code>.</p>
<p>The distinction is obscured somewhat because when you access an attribute on an instance, the class dict is a fallback. So in the above example, <code>b.... | <pre><code>class A:
def _ _init_ _(self):
self.name = 'A'
a = A()
</code></pre>
<p>Creates an attribute on the object instance a of type A and it can therefore be found in: <code>a.__dict__</code></p>
<pre><code>class B:
name = 'B'
b = B()
</code></pre>
<p>Creates an attribute on the class B and the ... | 5,638 |
<p>My application has a need to let the user choose a date from a list of dates conforming to a certain pattern. For instance, they may need to choose a monday from a list Monday's for a month. Is there a way to get a <code>UIDatePicker</code> to limit date choices to a certain subset or should I just use a <code>UIPic... | <p>You cannot limit which dates are selectable in a <code>UIDatePicker</code>. You could change the date when the value changed event is sent, but since the user cannot tell which dates are "good" and which are not, it's a bad UI choice to do so.</p>
<p>Use a <code>UIPickerView</code> of your own making instead.</p>
| <p><code>UIDatePicker</code> has <code>minimumDate</code> and <code>maximumDate</code> properties for this purpose. No need to use <code>UIPickerView</code> just for this reason.</p>
| 8,096 |
<p>This might be a bit on the silly side of things but I need to send the contents of a DataTable (unknown columns, unknown contents) via a text e-mail. Basic idea is to loop over rows and columns and output all cell contents into a StringBuilder using .ToString(). </p>
<p>Formatting is a big issue though. Any tips/id... | <p>Would converting the datatable to a HTML-table and sending HTML-mail be an alternative? That would make it much nicer on the receiving end if their client supports it.</p>
| <p>You can do smth like this (if VB):</p>
<pre><code>Dim Str As String = ""
'Create File if doesn't exist
Dim FILE_NAME As String = "C:\temp\Custom.txt"
If System.IO.File.Exists(FILE_NAME) = False Then
System.IO.File.Create(FILE_NAME)
End If
Dim objWriter As System.IO.S... | 7,719 |
<p>Has anyone used both FogBugz and Axosoft's OnTime and care to offer an opinion? AxoSoft has a big <a href="http://web.archive.org/web/20090522134148/http://www.axosoft.com:80/products/ontime_competition.aspx" rel="nofollow noreferrer">feature comparison chart</a> but I'm also interested in more subjective thoughts ... | <p>I actually encouraged the company I work for to begin tracking bugs with software (specifically FogBugz) and have been very pleased with FogBugz. </p>
<p>We blindly let our customers send bug requests into FogBugz through email, which has it's advantages and disadvantages. But we really haven't had any problems in... | <p>I haven't worked with FogBugz, although I recently recommended our company goes with that.
OnTime is what the company decided to use and I personally don't like OnTime because of slowness and badly organized GUI. We opted to host it ourselves, but I don't think the machine is slow. The web app doesn't really look li... | 3,059 |
<p>I have several tables whose only unique data is a uniqueidentifier (a Guid) column. Because guids are non-sequential (and they're client-side generated so I can't use newsequentialid()), I have made a non-primary, non-clustered index on this ID field rather than giving the tables a clustered primary key.</p>
<p>I'm... | <p>When dealing with indexes, you have to determine what your table is going to be used for. If you are primarily inserting 1000 rows a second and not doing any querying, then a clustered index is a hit to performance. If you are doing 1000 queries a second, then not having an index will lead to very bad performance.... | <p>I too have always heard having an auto-incrementing int is good for performance even if you don't actually use it.</p>
| 2,746 |
<p>From my understanding of FFF 3D printing, the glass state is usually used to heat the bed for better first layer adhesion. Other than that, does the extruder keep ex:PLA in a glass state for any reason?</p>
<p>Is the transition of the filament straight from solid to liquid for extrusion without any real regard for t... | <p><em>Note that the extruder feeds filament it doesn't heat anything, you don't want heat in the extruder. The hot end is the part that adds heat well over the glass temperature.</em></p>
<p>The <a href="https://en.m.wikipedia.org/wiki/Glass_transition" rel="nofollow noreferrer">glass transition temperature</a>, the t... | <p>The transition from solid to liquid is the important part.</p>
<p>The bed is heated for adhesion and kept heated for the same reason, but the extruder is a lot hotter and just performs the task of solid to liquid, the fans and ambient temperature cool it to solid.</p>
<p>Once a layer is solid it will heat up again w... | 2,220 |
<p>I work in a teaching hospital and we have a research project we're interested in pursuing. We'd like to 3D Print tubes we'd implant into rats to help with nerve regeneration. We're interested in the shape of the tubes right now, more so than what material it is or whether it's biocompatible etc.. </p>
<p>So thi... | <p>This is an interesting question. A good thing to note when we start talking about SLA and other jewelry grade 3d printing, that you will have to factor in the materials toxicity when we start talking about medical applications. You can also look into DLP 3d printers but they will not have as good quality. </p>
<p>W... | <p>FDM/FF printers can#t achieve those resolutions due to several constraints. The biggest problems are wall thickness and resolution:</p>
<p>The print needs to be made from walls that are at least one nozzle wide. Commonly available nozzles go down to the 0.15 to 0.2 mm area, so the thinnest wall has to be at least th... | 1,284 |
<p>I'm using Marlin 1.1.0RC8 to control an MPCNC, using a RAMPS1.4. We've just added a touch-plate to do Z-probing, which works nicely for a single probe (I just want calibrated height for variant bit-lengths, not bed-leveling, but I think it amounts to the same thing). I've set it up in Marlin as <em>FIX_MOUNTED_PROBE... | <p>I believe <code>G30</code> is a carry-over from CNC (G-code originated for CNC not printers)
I believe it is for going to a secondary reference (home) position and includes an optional by-way-of address that can be included in the command.</p>
<p>Looking at Marlin 1.1.0-1 (latest release), it seems to do what you s... | <p>I’ve recently had a need to use Z-probe touch
plate on my MPCNC + Ramps 1.4 + Marlin 1.1.5 setup.</p>
<p>Thought I’d share what ended up working for me.</p>
<p>In Marlin <code>Configuration.h</code>, I made the changes to enable Z-probe:</p>
<pre><code>#define USE_ZMIN_PLUG
#define Z_MIN_ENDSTOP_INVERTING tr... | 590 |
<p>I have this in a page :</p>
<pre><code><textarea id="taEditableContent" runat="server" rows="5"></textarea>
<ajaxToolkit:DynamicPopulateExtender ID="dpeEditPopulate" runat="server" TargetControlID="taEditableContent"
ClearContentsDuringUpdate="true" PopulateTriggerControlID="hLink" ServicePat... | <p>The problem is that the white space is ignored by default when the XML is processed. Try to add the <code>xml:space="preserve"</code> attribute to the string element. You'll also need to define the xml prefix as <code>xmlns:xml="http://www.w3.org/XML/1998/namespace"</code>.</p>
| <p>Try to add the following style on textarea: <strong>style="white-space: pre"</strong></p>
| 8,533 |
<p>Anyone have any idea how much power it takes to run a Creality Ender 3 3D printer every day for several hours at a time? Like what does it eat up per hour? A rough estimate of power use per hour would be nice, then I can figure out how much it costs me. Can anyone help me?</p>
| <p>If it is really important to you to know how much you are spending per any given print, your best bet is not to guess, <em>but to know</em> how much power you're using. To that end, you could purchase a power meter which monitors your power usage. Given the right one, it can even calculate the cost of the power usag... | <p>Other answers include good estimates, and show that for one printer the electricity costs are not very significant. If you are using many printers and want a concrete answer, then it would be wise to purchase a power monitor (for continuous monitoring) or multimeter with clamp.</p>
<p>With a clamp-on multimeter, you... | 1,268 |
<p>I have a WCF service that I have to reference from a .net 2.0 project.</p>
<p>I have tried to reference it using the "<strong>add web reference</strong>" method but it messes up the params. </p>
<p>For example, I have a method in the service that expects a <code>char[]</code> to be passed in, but when I add the w... | <p>One of those instances that you need to edit the WSDL. For a start a useful tool</p>
<p><a href="http://codeplex.com/storm" rel="nofollow noreferrer">http://codeplex.com/storm</a></p>
| <p>Thanks for the resource. It certainly helped me test out the webservice, but it didn't much help with using the WCF service in my .net 2.0 application.</p>
<p>What I eventually ended up doing was going back to the architects and explaining that the 3.0 dll's that I needed to reference got compiled back to run on th... | 3,088 |
<p>When a template is added using the add-template stsadm command, it becomes available to everyone when creating a subsite. Is there any way to make it only available when a site collection is being created?</p>
| <p>go to site actions -> Site Settings -> view all site settings -> site templates and page layouts and remove the site template from the list of allowed items.</p>
<p>Gary Lapointe may also have made an stsadm extenstion for it; check <a href="http://stsadm.blogspot.com" rel="nofollow noreferrer">stsadm.blogspot.com<... | <p>The url to the blog post mentioned above, for hiding the stp templates using the stsadm extention, is <a href="http://stsadm.blogspot.com/2007/08/set-available-site-templates.html" rel="nofollow noreferrer">http://stsadm.blogspot.com/2007/08/set-available-site-templates.html</a></p>
<blockquote>
<p>Here’s an exam... | 7,418 |
<p>Suddenly, my printer has started producing prints that have a very pronounced layering. Normally, the alignment between layers is very good, and the prints look very smooth. Suddenly, the prints have become much worse and the layers are misaligned with respect to each other.</p>
<p><a href="https://i.stack.imgur.co... | <p>It appears the heatbreak of my E3D nozzle had worked itself loose from the heatsink, allowing the nozzle to wobble around a bit. Because the nozzle was still tight against the heatbreak I didn't experience any issues with my hotend, but because the heatbreak was slightly loose the nozzle wasn't properly constrained ... | <p>Have you recently leveled your print bed? By placing the nozzle too close to the bed on the first layer the first layer will seem over extruded. If there are no infill layers after the first layer, these layers will seem over extruded as well since the extra filament will have nowhere to go. </p>
<p>A typical sign ... | 115 |
<p>I don't like the AutoSize property of the Label control. I have a custom Label that draws a fancy rounded border among other things. I'm placing a <code>AutoSize = false</code> in my constructor, however, when I place it in design mode, the property always is True. </p>
<p>I have overridden other properties with su... | <p>I've seen similar behaviour when setting certain properties of controls in the constructor of the form itself. They seem to revert back to their design-time defaults.</p>
<p>I notice you're already overriding the OnLoad method. Have you tried setting AutoSize = false there? Or are you mainly concerned with providin... | <p>I don't see <code>this.AutoSize = false</code> in your constructor. Your class is marked as partial -- perhaps you have a constructor in another file with that line. The visual studio designer will call that parameterless constructor you've got there.</p>
| 4,483 |
<p>Background: I have a little video playing app with a UI inspired by the venerable Sasami2k, just updated to use VMR9 (i.e. Direct3D9 with DirectShow) and be less unstable. Currently, it's a C++ app using raw Win32, through necessity: none of the various toolkits are worth a damn. WPF, in particular, was not possib... | <blockquote>
<p>And I seem to be completely overlooking where the system tells me about resizes. Likewise the hit testing.</p>
</blockquote>
<p>For the resizing you're indeed missing the <a href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.sizechanged.aspx" rel="nofollow noreferrer">SizeChan... | <p>Can you perhaps override the ArrangeOverride and/or MeasureOverride to make up for those missing resize events? Measure is the first pass, and occurs when a layout needs to adjust for a new size, so it's kind of like a size changing event.</p>
| 4,738 |
<p>I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl:</p>
<pre><code>DrawFrameControl(dc, &rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO);
</code></pre>
<p>I've never been able to figure out a sure fire... | <p>It has been a while since I worked on this, so what I am describing is what I did, and not necessarily a direct answer to the question.</p>
<p>I happen to use bit maps 13 x 13 rather than 12 x 12. The bitmap part of the check box seems to be passed in the WM_DRAWITEM. However, I had also set up WM_MEASUREITEM an... | <p>It has been a while since I worked on this, so what I am describing is what I did, and not necessarily a direct answer to the question.</p>
<p>I happen to use bit maps 13 x 13 rather than 12 x 12. The bitmap part of the check box seems to be passed in the WM_DRAWITEM. However, I had also set up WM_MEASUREITEM an... | 8,703 |
<p>I am printing Benchies at high speed, I successfully printed one at 300 mm/s. If I set the speed to 400 mm/s, the Y axis begins shifting around. This is usually accompanied by a banging sound.</p>
<p>In addition, the extruder motor occasionally clicks. When it clicks, the filament shoots back out a little bit.</p>
<... | <p>TL;DR: Don't do that.</p>
<p>Detailed answer: You need motion limit parameters that actually make physical sense, and firmware capable of executing a motion plan according to them. Your jerk and acceleration settings absolutely don't. Marlin's whole implementation of jerk is wacky (note: modern Marlin versions don't... | <p>Ok, so you are having multiple problems, lets break it down:</p>
<p>At the speed you are pushing, it would not be weird to have the Y belt slipping around. Also inertia comes into play, so please, dont do that.</p>
<p>What you are mentioning about the filament going out a bit, also makes sense. You are exceeding the... | 2,028 |
<p>I've got a problem here with an MSI deployment that I'm working on (using <a href="http://en.wikipedia.org/wiki/InstallShield" rel="nofollow noreferrer">InstallShield</a>). We have a program running in the background that needs to run per-user, and it needs to start automatically without user intervention.</p>
<p>T... | <p>You can use the <a href="http://msdn.microsoft.com/en-us/library/aa369780(VS.85).aspx" rel="noreferrer">LogonUser</a> property of Windows Installer as a condition to the action launching the EXE.</p>
| <p>AHA! I knew there had to be a cleaner solution... the code I was working on was starting to look something like this:</p>
<pre class="lang-vb prettyprint-override"><code>On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strCompu... | 4,953 |
<p>Although somewhat related to <a href="https://stackoverflow.com/questions/4409/is-the-desktop-app-dead">this question</a>, I have what I think is a different take on it.</p>
<p>Is a desktop app that has no connections to the "cloud" dead? I believe that some things are going to continue to be on the machine (operat... | <p>10 years or more ago this would have been, "Are non-internet applications dead?"</p>
<p>There's things the cloud does better than desktop applications, and in those places I'm sure non-cloud applications will become increasingly rare. But there's plenty of applications where you might not want to use the cloud, th... | <p>I personally will never leave my stuff on the web under someone else's control. All of my photos and e-mails I keep on local hard drives that I control. </p>
<p>I prefer to make my own stuff available to me through the web on my own hardware. The only way to have reasonable performance and be productive when off... | 7,576 |
<p>I am using a .NET Windows Forms DataGridView and I need to edit a DataBound column (that binds on a boolean DataTable column). For this I specify the cell template like this:</p>
<p>DataGridViewColumn column = new DataGridViewColumn(new DataGridViewCheckBoxCell());</p>
<p>You see that I need a CheckBox cell templa... | <p>Well, after more than 4 hours of debugging, I have found that the DataGridView row height was too small for the checkbox to be painted, so it was not displayed at all. I have found this after an accidental row height resizing.</p>
<p>As a solution, you can set the AutoSizeRowsMode to AllCells.</p>
<p><code>richDat... | <p>Create a TemplateField and bound the id to it, something like this:</p>
<pre><code><asp:TemplateField HeaderText="Whatever" SortExpression="fieldname" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="rowCheck" key='<%# Eval("id") %>' />
<... | 9,670 |
<p>I have an application on which I am implementing localization.</p>
<p>I now need to dynamically reference a name in the resouce file.</p>
<p>assume I have a resource file called Login.resx, an a number of strings: foo="hello", bar="cruel" and baz="world"</p>
<p>normally, I will refer as:
String result =Login.foo... | <p>You'll need to instance a <a href="http://msdn.microsoft.com/en-us/library/aa984408%28VS.71%29.aspx" rel="noreferrer"><code>ResourceManager</code></a> for the <code>Login.resx</code>:</p>
<pre><code>var resman = new System.Resources.ResourceManager(
"RootNamespace.Login",
System.Reflection.Assembly.GetExecu... | <p>If you put your Resource file in the App_GlobalResources folder like I did, you need to use</p>
<blockquote>
<p>global::System.Resources.ResourceManager
temp = new
global::System.Resources.ResourceManager("RootNamespace.Login",
global::System.Reflection.Assembly.Load("App_GlobalResources"));</p>
</blockquot... | 4,966 |
<p>In Visual Basic, is there a performance difference when using the <code>IIf</code> function instead of the <code>If</code> statement?</p>
| <p>VB has the following <code>If</code> statement which the question refers to, I think:</p>
<pre><code>' Usage 1
Dim result = If(a > 5, "World", "Hello")
' Usage 2
Dim foo = If(result, "Alternative")
</code></pre>
<p>The first is basically C#'s ternary conditional operator and the second is its coalesce operator ... | <p>Those functions are different! Perhaps you only need to use IF statement.
IIF will always be slower, because it will do both functions plus it will do standard IF statement.</p>
<p>If you are wondering why there is IIF function, maybe this will be explanation:</p>
<pre><code>Sub main()
counter = 0
bln = Tr... | 4,803 |
<p>Why is <code>Array.Length</code> an int, and not a <code>uint</code>. This bothers me (just a bit) because a length value can never be negative. </p>
<p>This also forced me to use an int for a length-property on my own class, because when you
specify an int-value, this needs to be cast explicitly...</p>
<p>So the... | <p>Unsigned int isn't CLS compliant and would therefore restrict usage of the property to those languages that do implement a <code>UInt</code>. </p>
<p>See here:</p>
<p>Framework 1.1</p>
<blockquote>
<p><a href="http://msdn.microsoft.com/en-us/library/hfa3fa08(VS.71).aspx" rel="noreferrer">Introduction to the .NE... | <p>Typically, integer values are signed, unless you explicitly need an unsigned value. It's just the way they are used. I may not agree with that choice, but that's just the way it is.</p>
<p>For the time being, with todays typical memory constraints, if your array or similar data structure needs an UInt32 length, you... | 2,806 |
<p>I have a <code>DataTable</code> with a <code>Name</code> column. I want to generate a collection of the unique names ordered alphabetically. The following query ignores the <em>order by</em> clause.</p>
<pre><code>var names =
(from DataRow dr in dataTable.Rows
orderby (string)dr["Name"]
select (string)d... | <p><strong>The problem is that the Distinct
operator does not grant that it will
maintain the original order of
values.</strong></p>
<p>So your query will need to work like this</p>
<pre><code>var names = (from DataRow dr in dataTable.Rows
select (string)dr["Name"]).Distinct().OrderBy( name => name... | <p>Try the following</p>
<pre><code>var names = (from dr in dataTable.Rows
select (string)dr["Name"]).Distinct().OrderBy(name => name);
</code></pre>
<p>this should work for what you need.</p>
| 2,246 |
<p>I am currently trying to print a company logo on another part I have printed in a different colour. To try and maximise the strength of the part, I need to print the part on a different orientation to what I intend on printing the logo on. As a result I need to in a sense re-adhere the part to the bed so I can print... | <p>I have not done this, but I believe this is the best method and I want to test it at some point soon:</p>
<p>Model a negative for the footprint of the part you want to adhere to the bed, in the orientation you want to adhere it, with just a few mm of height, and clearance suitable for your printer (probably around 0... | <p>Adherence is the 3D printer's worst enemy.</p>
<p>I use painter's tape, but I heard that you can if you need to remove and re-stick it back, heat the part lightly with a lighter and re-stick it back to the bed. Never tried but I'm guessing you would need to cool the bed, heat the part, and stick it back then reheat ... | 1,922 |
<p>I am trying to automate functional testing of a server using a realistic frequency distribution of requests. (sort of load testing, sort of simulation)</p>
<p>I've chosen the <a href="http://en.wikipedia.org/wiki/Weibull_distribution" rel="nofollow noreferrer">Weibull</a> distribution as it "sort of" matches the di... | <p>This is quick and probably not that accurate, but if you calculate the PDF yourself, then at least you make it easier to lay several smaller/larger ones on a single timeline. <code>dev</code> is the std deviation in the Guassian noise, which controls the roughness. Note that this is <em>not</em> the 'right' way to g... | <p>Instead of giving the number of requests as a fixed value, why not use a scaling factor instead? At the moment, you're treating requests as a limited quantity, and randomising the days on which those requests fall. It would seem more reasonable to treat your requests-per-day as independent.</p>
<pre><code>from date... | 7,732 |
<p>Does any one know how do I get the current open windows or process of a local machine using Java? </p>
<p>What I'm trying to do is: list the current open task, windows or process open, like in Windows Taskmanager, but using a multi-platform approach - using only Java if it's possible.</p>
| <p>This is another approach to parse the the process list from the command "<strong>ps -e</strong>":</p>
<pre><code>try {
String line;
Process p = Runtime.getRuntime().exec("ps -e");
BufferedReader input =
new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = input.r... | <pre><code>package com.vipul;
import java.applet.Applet;
import java.awt.Checkbox;
import java.awt.Choice;
import java.awt.Font;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Batc... | 7,828 |
<p>How can I request a random row (or as close to truly random as is possible) in pure SQL?</p>
| <p>See this post: <a href="http://www.petefreitag.com/item/466.cfm" rel="noreferrer">SQL to Select a random row from a database table</a>. It goes through methods for doing this in MySQL, PostgreSQL, Microsoft SQL Server, IBM DB2 and Oracle (the following is copied from that link):</p>
<p>Select a random row with MySQ... | <p>I have to agree with CD-MaN: Using "ORDER BY RAND()" will work nicely for small tables or when you do your SELECT only a few times.</p>
<p>I also use the "num_value >= RAND() * ..." technique, and if I really want to have random results I have a special "random" column in the table that I update once a day or so. T... | 3,985 |
<p>In a database-centric application that is designed for multiple clients, I've always thought it was "better" to use a single database for ALL clients - associating records with proper indexes and keys. In listening to the Stack Overflow podcast, I heard Joel mention that FogBugz uses one database per client (so if ... | <p>Assume there's no scaling penalty for storing all the clients in one database; for most people, and well configured databases/queries, this will be fairly true these days. If you're not one of these people, well, then the benefit of a single database is obvious.</p>
<p>In this situation, benefits come from the enca... | <p>There are a couple of meanings of "database"</p>
<ul>
<li>the hardware box</li>
<li>the running software (e.g. "the oracle")</li>
<li>the particular set of data files</li>
<li>the particular login or schema</li>
</ul>
<p>It's likely Joel means one of the lower layers. In this case, it's just a matter of software ... | 3,430 |
<p>if you uses Mono Remoting on Linux, what's your work-around for DateTime marshalling incompatibility between Mono and .NET Remoting?</p>
<p>i'm using WinForms on Windows using .NET 2.0 runtime, using Remoting on Linux using Mono. i cannot yet use Mono runtime on both ends as Mono's DataGridView isn't yet working.<... | <p>I think a much better solution would be refactoring the code, so instead of the (yet under-supported) remoting, use web services. XML serialization of most basic data types are IIRC fully supported; and in certain circumstances, fits the architecture much better (especially server-client architectures).</p>
| <p>I think a much better solution would be refactoring the code, so instead of the (yet under-supported) remoting, use web services. XML serialization of most basic data types are IIRC fully supported; and in certain circumstances, fits the architecture much better (especially server-client architectures).</p>
| 9,589 |
<p>I'd like to be able to track file read/writes of specific program invocations. No information about the actual transactions is required, just the file names involved.</p>
<p>Is there a cross platform solution to this? <br />
What are various platform specific methods? <br />
On Linux I know there's strace/ptrace... | <p>The short answer is no. There are plenty of platform specific solutions which all probably have similar interfaces, but they aren't inherently cross platform since file systems tend to be platform specific.</p>
<hr>
<blockquote>
<p>How do I do it well on each platform?</p>
</blockquote>
<p>Again, it will depend... | <p>On Windows you can use the command line tool <a href="http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx" rel="nofollow noreferrer" title="Handle">Handle</a> or the GUI version <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="nofollow noreferrer" title="Process Explorer">Proces... | 4,122 |
<p>I'm trying to create a Zip file from .Net that can be read from Java code.</p>
<p>I've used SharpZipLib to create the Zip file but also if the file generated is valid according to the CheckZip function of the #ZipLib library and can be successfully uncompressed via WinZip or WinRar I always get an error when trying... | <p>I have used <a href="http://www.codeplex.com/DotNetZip" rel="noreferrer">DotNetZip library</a> and it seems to work properly. Typical code:</p>
<pre><code>using (ZipFile zipFile = new ZipFile())
{
zipFile.AddDirectory(sourceFolderPath);
zipFile.Save(archiveFolderName);
}
</code></pre>
| <p>To judge whether it's really a conformant ZIP file, see PKZIP's <a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT" rel="nofollow noreferrer">.ZIP File Format Specification</a>.</p>
<p>For what it's worth I have had no trouble using SharpZipLib to create ZIPs on a Windows Mobile device and open them w... | 9,643 |
<p>I would like to create a stored procedure in MySQL that took a list as argument. For example, say that I would like to be able to set multiple tags for an item in one call, then what I want to do is to define a procedure that takes the ID of the item and a list of tags to set. However, I can't seem to find any way t... | <p><a href="http://forums.mysql.com/read.php?98,50521,50521#msg-50521" rel="noreferrer">This</a> article has some good discussion on the problem of parsing an array to a stored procedure since stored procedures only allow valid table column data-types as parameters.</p>
<p>There are some neat things you can do with th... | <p>Not sure if these will work specifically in a SP, but there are ENUM and SET datatypes in MySQL 5 which may do what you need.
<a href="http://dev.mysql.com/doc/refman/5.0/en/enum.html" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.0/en/enum.html</a>
<a href="http://dev.mysql.com/doc/refman/5.0/en/set.h... | 3,029 |
<p>What is the easiest way to extract the original exception from an exception returned via Apache's implementation of XML-RPC?</p>
| <p>It turns out that getting the cause exception from the Apache exception is the right one. </p>
<pre><code>} catch (XmlRpcException rpce) {
Throwable cause = rpce.getCause();
if(cause != null) {
if(cause instanceof ExceptionYouCanHandleException) {
handler(cause);
}
else ... | <p>According to the <a href="http://www.xmlrpc.com/spec" rel="nofollow noreferrer">XML-RPC Spec</a> it returns the "fault" in the xml.</p>
<p>Is this the "Exception" you are referring to or are you refering to a Java Exception generated while making the XML-RPC call?</p>
<p><strong>Fault example</strong></p>
<pre><c... | 7,476 |
<p>I want to consolidate all the loose information of the company I work for into a knowledge base. A wiki seems to be the way to go, but most of the relevant information is buried inside PST files, and it would take ages to convince people to manually translate their emails one by one (including attachments) into wiki... | <p>Both Jotspot and MediaWiki allow you to do this. The latter has support for a lot of plugins, of which this is one. The format is essentially PageTitle@something. Jotspot is a hosted solution where you get your own email address, MediaWiki is self-hosted and you give it a mailbox to monitor for incoming.</p>
<p>Art... | <p>I don't know if this is exactly what you're looking for, but I know many of 37 Signals' products support adding data through email. I use Highrise to keep track of some of my business correspondence, and I'm able to CC or forward emails to Highrise and they get added to the appropriate contact.</p>
| 3,269 |
<p>I know that I can do something like</p>
<pre><code>$int = (int)99; //(int) has a maximum or 99
</code></pre>
<p>To set the variable <code>$int</code> to an integer and give it a value of <code>99</code>. </p>
<p>Is there a way to set the type to something like <code>LongBlob</code> in MySQL for <code>LARGE</code>... | <p>No. PHP does what is called automatic type conversion.</p>
<p>In your example</p>
<pre><code>$int = (int)123;
</code></pre>
<p>the "(int)" just assures that at that exact moment 123 will be handled as an int.</p>
<p>I think your best bet would be to use a class to provide some sort of type safety.</p>
| <p>No, the type LongBlob is specific to MySQL. In PHP it is seen as binary data (usually characters), if you tried to convert it to an int it would take the first 32 bits of data (platform dependent) and push that into the variable.</p>
| 6,490 |
<p>I realize that CHAR is recommended if all my values are fixed-width. But, so what? Why not just pick VARCHAR for all text fields just to be safe.</p>
| <p>The general rule is to pick <strong>CHAR</strong> if all rows will have close to the <em>same length</em>. Pick <strong>VARCHAR</strong> (or <em>NVARCHAR</em>) when the <em>length varies</em> significantly. CHAR may also be a bit faster because all the rows are of the same length.</p>
<p>It varies by DB implementa... | <p>In some SQL databases, VARCHAR will be padded out to its maximum size in order to optimize the offsets, This is to speed up full table scans and indexes. </p>
<p>Because of this, you do not have any space savings by using a VARCHAR(200) compared to a CHAR(200)</p>
| 8,433 |
<p>I'm researching and experimenting more with Groovy and I'm trying to wrap my mind around the pros and cons of implementing things in Groovy that I can't/don't do in Java. Dynamic programming is still just a concept to me since I've been deeply steeped static and strongly typed languages. </p>
<p>Groovy gives me t... | <p>A lot of the comments for duck typing don't really substantiate the claims. Not "having to worry" about a type is not sustainable for maintenance or making an application extendable. I've really had a good opportunity to see Grails in action over my last contract and its quite funny to watch really. Everyone is h... | <p>It's not that duck typing is more productive than static typing as much as it is simply different. With static typing you always have to worry that your data is the correct type and in Java it shows up through casting to the right type. With duck typing the type doesn't matter as long as it has the right method, so ... | 7,031 |
<p>I have a prusa 13 that's shipping in the mail, and I intend to make good use of it, one also own a da vinci jr. and the one time it got so clogged that the extruder itself was filled with pla, with that said I replace the extruder, for the da vinci, but besides that, as for my a prusa, what should I do if the extrud... | <p>From an electrical standpoint, a two-phase stepper motors (what most 3D printers use) works the same backwards and forwards, the phase just reverses. If you are stalling on only one direction, I would look to see if you have a mechanical bind in that direction. Generally a wiring issue will cause the motor to eith... | <p>Sounds like you are configured for NC switches but are using NO switches, causing them to invert their reported state. Issue a <strong>M119</strong> command and see if the endstop statuses are correct when none are triggered.</p>
| 776 |
<p>How do I perform an <code>IF...THEN</code> in an <code>SQL SELECT</code> statement?</p>
<p>For example:</p>
<pre><code>SELECT IF(Obsolete = 'N' OR InStock = 'Y' ? 1 : 0) AS Saleable, * FROM Product
</code></pre>
| <p>The <code>CASE</code> statement is the closest to IF in SQL and is supported on all versions of SQL Server.</p>
<pre><code>SELECT CAST(
CASE
WHEN Obsolete = 'N' or InStock = 'Y'
THEN 1
ELSE 0
END AS bit) as Saleable, *
FROM Product
</... | <p>There are multiple conditions.</p>
<pre><code>SELECT
(CASE
WHEN RIGHT((LEFT(POSID,5)),4) LIKE '1001' THEN 'DM'
WHEN RIGHT((LEFT(POSID,5)),4) LIKE '1002' THEN 'GS'
WHEN RIGHT((LEFT(POSID,5)),4) LIKE '1003' THEN 'MB'
WHEN RIGHT((LEFT(POSID,5)),4) LIKE '1004' THEN 'MP'
WHEN RIGHT((LEFT(POSID,5)),4) LIKE '1005' THEN 'P... | 8,892 |
<p>I'm learning objective-C and Cocoa. In the Apple tutorial I'm working through there's a side note that says: </p>
<blockquote>
<p><code>IBOutlet</code> is a null-defined macro, which the C preprocessor removes at compile time.</p>
</blockquote>
<p>I'm curious - what's a null-defined macro?</p>
| <pre><code>#define IBOutlet
</code></pre>
<p>Whenever IBOutlet is used in program text, it will be replaced with nothing at all.</p>
| <p>Also - if you're unsure how anything is defined - command double-click it and Xcode will open the definition in the original source file.</p>
| 4,203 |
<p>I am working on a large C++ project in Visual Studio 2008, and there are a lot of files with unnecessary <code>#include</code> directives. Sometimes the <code>#include</code>s are just artifacts and everything will compile fine with them removed, and in other cases classes could be forward declared and the #include ... | <p>While it won't reveal unneeded include files, Visual studio has a setting <code>/showIncludes</code> (right click on a <code>.cpp</code> file, <code>Properties->C/C++->Advanced</code>) that will output a tree of all included files at compile time. This can help in identifying files that shouldn't need to be i... | <p>Some of the existing answers state that it's hard. That's indeed true, because you need a full compiler to detect the cases in which a forward declaration would be appropriate. You cant parse C++ without knowing what the symbols mean; the grammar is simply too ambiguous for that. You must know whether a certain name... | 9,997 |
<p>Is it possible to order results in SQL Server 2005 by the relevance of a freetext match? In MySQL you can use the (roughly equivalent) MATCH function in the ORDER BY section, but I haven't found any equivalence in SQL Server.</p>
<p>From the <a href="http://dev.mysql.com/doc/refman/5.0/en/fulltext-natural-language.... | <p>If you are using <code>FREETEXTTABLE</code> then it returns a column name <code>Rank</code>, so <code>order by Rank</code> should work. I don't know if other freetext search methods are also returning this value or not. You can have a try.</p>
| <p>Both <code>FREETEXTTABLE</code> and <code>CONTAINSTABLE</code> will return the <code>[RANK]</code> column, but make sure you are using either the correct variation or union both of them to get all appropriate results.</p>
| 7,704 |
<p>I'm working on an application where users have to make a call and type a verification number with the keypad of their phone.</p>
<p>I would like to be able to detect if the number they type is correct or not. The phone system does not have access to a list of valid numbers, but instead, it will validate the number ... | <p>After some research, I think I'll go with the <strong>ISO 7064 Mod 97,10</strong> formula. It seems pretty solid as it is used to validate IBAN (International Bank Account Number).</p>
<p>The formula is very simple:</p>
<ol>
<li>Take a number : <code>123456</code></li>
<li>Apply the following formula to obtain the... | <blockquote>
<ul>
<li>I must have a reasonnable number of possible combinations (let's say 1M)</li>
<li>The code must be as short as possible, to avoid errors from the user</li>
</ul>
</blockquote>
<p>Well, if you want it to have at least one million combinations, then you need at least six digits. Is that sh... | 6,829 |
<p>I wonder what type of servers for internal usage you virtualize in the last -say- 6 months. Here's what we got virtual so far:</p>
<ul>
<li>mediawiki</li>
<li>bugtracker (mantis)</li>
<li>subversion</li>
</ul>
<p>We didn't virtualize spezialized desktop PCs which are running a certain software product, that is onl... | <p>My standard answer to questions like this is, "virtualization is great; be aware of its limitations".</p>
<p>I would never rely on a purely-virtual implementation of anything that's an infrastructure-level service (eg the authoritative DNS server for your site; management and monitoring tools). </p>
<p>I work for ... | <p>Our build machine running FinalBuilder runs on a Windows XP Virtual Machine running in VMWare Server on Linux.</p>
<p>It is very practical to move it and also to backup, we just stop the Virtual Machine and copy the disk image.</p>
<p>Some days ago we needed to change the host pc, it took less than 2 hours to have... | 3,112 |
<p>I am storing a PNG as an embedded resource in an assembly. From within the same assembly I have some code like this:</p>
<pre><code>Bitmap image = new Bitmap(typeof(MyClass), "Resources.file.png");
</code></pre>
<p>The file, named "file.png" is stored in the "Resources" folder (within Visual Studio), and is marke... | <p>This will get you a string array of all the resources:</p>
<pre><code>System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
</code></pre>
| <p>The name of the resource is the name space plus the "pseudo" name space of the path to the file. The "pseudo" name space is made by the sub folder structure using \ (backslashes) instead of . (dots).</p>
<pre><code>public static Stream GetResourceFileStream(String nameSpace, String filePath)
{
String pseduoName... | 4,742 |
<p>In order to know how many times a pattern exists in current buffer, I do:</p>
<pre><code>:%s/pattern-here/pattern-here/g
</code></pre>
<p>It gives the number of occurrences of the pattern, but is obviously cumbersome and also has the side-effect of setting the 'changed' status.</p>
<p>Is there a more elegant way ... | <p>To avoid the substitution, leave the second pattern empty, and add the “n” flag:</p>
<pre><code>:%s/pattern-here//gn
</code></pre>
<p>This is described as <a href="http://vimdoc.sourceforge.net/htmldoc/tips.html#count-items" rel="noreferrer">an official tip</a>.</p>
| <p>vimgrep is your friend here:</p>
<pre><code>vimgrep pattern %
</code></pre>
<p>Shows:</p>
<pre><code>(1 of 37)
</code></pre>
| 9,595 |
<p>I'm starting to learn how to use PHPUnit to test the website I'm working on. The problem I'm running into is that I have five different user types defined and I need to be able to test every class with the different types. I currently have a user class and I would like to pass this to each function but I can't fig... | <p>If your various user classes inherit from a parent user class, then I recommend you use the same inheritance structure for your test case classes.</p>
<p>Consider the following sample classes:</p>
<pre><code>class User
{
public function commonFunctionality()
{
return 'Something';
}
public ... | <p>If you're looking to test the actual UI, you could try using something like Selenium (www.openqa.org). It lets you write the code in PHP (which I'm assuming would work with phpUnit) to drive the browser..</p>
<p>Another approach would be to have a common method that could be called by each test for your different u... | 8,342 |
<p>I am trying to determine the best time efficient algorithm to accomplish the task described below.</p>
<p>I have a set of records. For this set of records I have connection data which indicates how pairs of records from this set connect to one another. This basically represents an undirected graph, with the records... | <p>It appears that this can be accomplished with a depth-first search of the graph. <strong>The depth-first search will find all non-cyclical paths between two nodes.</strong> This algorithm should be very fast and scale to large graphs (The graph data structure is sparse so it only uses as much memory as it needs to).... | <p>Here's a thought off the top of my head:</p>
<ol>
<li>Find one connection. (Depth-first search is probably a good algorithm for this, since the path length doesn't matter.)</li>
<li>Disable the last segment.</li>
<li>Try to find another connection from the last node before the previously disabled connection.</li>
<... | 8,268 |
<p>I need to draw some simple network topology charts, suggestions of some good tools appreciated. </p>
<p>Edit: love freeware :-)</p>
| <p>Try <a href="http://live.gnome.org/Dia" rel="nofollow noreferrer">Dia</a> - it's open source and cross platform.</p>
| <p>NetworkNotepad is a useful, if quirky, programme.</p>
| 9,704 |
<p>I have designed database tables (normalised, on an MS SQL server) and created a standalone windows front end for an application that will be used by a handful of users to add and edit information. We will add a web interface to allow searching accross our production area at a later date.</p>
<p>I am concerned that ... | <p>If you expect infrequent collisions, <a href="http://msdn.microsoft.com/en-us/library/aa0416cz.aspx" rel="noreferrer">Optimistic Concurrency</a> is probably your best bet.</p>
<p>Scott Mitchell wrote a comprehensive tutorial on implementing that pattern:<br>
<a href="http://www.asp.net/Learn/data-access/tutorial-21... | <p>The database will do this for you. Look at "select ... for update", which is designed just for this kind of thing. It will give you a write lock on the selected rows, which you can then commit or roll back.</p>
| 2,326 |
<p>I'm working on a internal web based tool for my company. Part of this tool is another application (The Cruise Control Dashboard) that runs in its own Virtual Directory under my root application.</p>
<p>I wanted to limit access to this internal application by setting up Forms Authentication on it, and having a login... | <blockquote>
<p>You might also need to put path="/" in the
</blockquote>
<p>That was it!</p>
<p>So, Summary, inorder todo this;</p>
<p>In root web.config add:</p>
<pre><code><machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
</code></pre>
<p>This must be done becaus... | <p>you are allowing all unauthenticated. You might be looking for something like this</p>
<pre><code><deny users="?"/>
</code></pre>
| 3,969 |
<p>We are currently using a somewhat complicated deployment setup that involves a remote SVN server, 3 SVN branches for DEV, STAGE, and PROD, promoting code between them through patches, etc. I wonder what do you use for deployment in a small dev team situation?</p>
| <p>trunk for development, and a branch (production) for the production stuff.</p>
<p>On my local machine, I have a VirtualHost that points to the trunk branch, to test my changes.</p>
<p>Any commit to trunk triggers a commit hook that does an svn export and sync to the online server's dev URL - so if the site is stac... | <p>We use release branching - this seems to be more efficient for us than the feature branching we were doing. </p>
<p>Don't make different branches for the different environments.</p>
| 2,574 |
<p>My thermoplastic FDM printer has a heated bed and uses glass as the printing surface. Sometimes the glass will chip or break entirely when I'm removing my print. This happens most often when the print has a large area in contact with the glass.</p>
<p>What can I do to keep this from happening?</p>
| <p>Some things I've tried that have helped:</p>
<p>Lay down a layer of masking tape. Most people who do this use blue painter's tape. The plastic should stick nicely during printing, yet release reasonably easily when you remove the print from the heated bed.</p>
<p>Lay down a later of Kapton tape. The principle is t... | <p>I have 2 suggestions.</p>
<p>First, get better glass. high quality <a href="https://en.wikipedia.org/wiki/Borosilicate_glass" rel="nofollow noreferrer">borosilicate plate glass</a> at least 3 mm thick should shrug off even scraping with a razor. </p>
<p>Second, don't scrape it with a razor, put the whole thin... | 134 |
<p>So I have a self build Mendel Reprap style 3d printer.</p>
<p>I've not used it in sometime after moving house but I'm looking to use it again. What should I pay attention to before calibrating and running it again?</p>
| <p>Increase nozzle temperature. When the filament is new it will print easier, requiring less heat to print well. So if you didn't store your filament properly to begin with, increasing print temperature will make it jam less and increase layer bonding. </p>
<p>The reason for this is because the moisture that accumula... | <p>PLA absorbs moisture, so keeping the filament dry is a key factor. Aside from that, PLA is naturally more brittle than other plastics like ABS and Nylon Sorry, tried to find a graph to prove it, but couldn't find one.</p>
<p>There's a good <a href="https://groups.google.com/forum/#!topic/makerbot/Rdx2ZnJeQzs">Googl... | 326 |
<p>I recently got started in 3D printing but here's an issue I can't seem to find a solution for (I don't know what exactly to look for).</p>
<p>Here's what I did:</p>
<ul>
<li>I used InkScape to convert an emoji in to a svg and imported it in to Blender</li>
<li>Used the Solidify modifier to make the curve a solid a... | <p>here is just a addenum to Tom van der Zanden's answer</p>
<p>this is (an example of) what you may design - nice object with virtual outline, and virtual fill
so this is what you see (and what you potentially expect)</p>
<p><a href="https://i.stack.imgur.com/61gRm.png" rel="noreferrer"><img src="https://i.stack.img... | <p>This is likely not a problem with your mesh. It's a problem in the slicer software.</p>
<p>Because your 3D printer prints with a (for example) 0.4mm nozzle, it lays down lines of plastic that are around (for example) 0.5mm wide. The slicer has to create a pattern, consisting of 0.5mm wide lines, that fills in your ... | 718 |
<p>I need to be able to manipulate a large (10^7 nodes) graph in python. The data corresponding to each node/edge is minimal, say, a small number of strings. What is the most efficient, in terms of <strong><em>memory and speed</em></strong>, way of doing this? </p>
<p>A dict of dicts is more flexible and simpler to im... | <p>I would strongly advocate you look at <a href="http://networkx.github.com/" rel="noreferrer">NetworkX</a>. It's a battle-tested war horse and the first tool most 'research' types reach for when they need to do analysis of network based data. I have manipulated graphs with 100s of thousands of edges without problem o... | <p>No doubt NetworkX is the best data structure till now for graph. It comes with utilities like Helper Functions, Data Structures and Algorithms, Random Sequence Generators, Decorators, Cuthill-Mckee Ordering, Context Managers</p>
<p>NetworkX is great because it wowrs for graphs, digraphs, and multigraphs. It can wri... | 2,359 |
<p>I'm printing part for a chess board from a set on Thingiverse, expanded a little to 50 mm square.
After the 3<sup>rd</sup> layer, I'm seeing what looks like raised ripples, and you can feel them with a finger too. I didn't see this when printing just 4 pieces earlier.
PLA at ~200 °C, bed is PEX/flex s... | <p>Printing some more parts tonight. Looks like solution is better bed "leveling" (tramming, or basically squareness between X, Y, and Z axis). Getting it dialed in to the correct height, 1/4 turn of a bed leveling screw at a time.</p>
<p>Also ordered some metal (stainless steel) shims so we can get and check the bed... | <p>It looks like over-extrusion. When layers are printed with 100% infill, excess material has nowhere to go and these characteristic ripples form.</p>
<p>Always calibrate your extruder. 3D Hubs have a good article on the topic:</p>
<p><a href="https://www.3dhubs.com/talk/t/howto-calibrate-tune-and-fine-tune-your-pri... | 1,387 |
<p>How can you <strong>cascade</strong> filter the attributes of more dimensions in a SSAS cube, viewed in Excel 2007.</p>
<p>For example, if we have a cube <em>Sales</em> with the dimension <em>Time</em> and dimension <em>Client</em>, once the dimension <em>Time</em> is filtered to show only the sales from a particul... | <p>Take a look at <a href="http://www.clicksoft.ro" rel="nofollow noreferrer">www.clicksoft.ro</a> </p>
<p>The product named QuickCubeFiltrator is a wizard like addin for excel 2007 that does cascade filtering. Might be what you need.</p>
| <p>I have tried this before and haven't had much luck. Not sure you can really do it easily. You can try using named sets and calculated members but most of the time it depends on your data and hierarchies. You can also look at reporting services, and how it does it behind the scenes in MDX, but I don't know what good ... | 8,981 |
<p>I'm a bit perplexed by drag and drop in wxPython (but perhaps this questions pertains to drag and drop in other GUI frameworks as well). The frameworks provides a couple of callbacks (OnEnter and OnDragOver) that purportedly allow me to inform the system whether the current mouse position is a valid place to drop wh... | <p>@Geoff- </p>
<p>The system, which has been in production for 8+ years, was architected to use PL/SQL for the CRUDs and <em>most</em> of the business logic. The PL/SQL also generates 90% of the presentation layer (HTML/JavaScript), using <a href="http://www.orafaq.com/wiki/Mod_plsql_FAQ" rel="nofollow noreferrer">... | <p>I wonder why you don't want to bring the data from Oracle into some application code and make JSON there?</p>
| 4,624 |
<p>When designing LINQ classes using the LINQ to SQL designer I've sometimes needed to reorder the classes for the purposes of having the resultant columns in a DataGridView appear in a different order. Unfortunately this seems to be exceedingly difficult; you need to cut and paste properties about, or delete them and ... | <p>Using Linq-to-Sql, you can have columns in the DataGridView appear different than in the original table by:</p>
<ol>
<li>In your Linq query, extract the columns that you want, in the order than you want, and store them in a var. Then the autogenerate columns should show them in that order in the DataGridView</li>
<... | <p>If you are in the scenario where you have reordered the columns in the database, and you now want to have this new order be reflected in the designer, I think that you have to delete the table from the designer and then put it in again. Or if you use <a href="http://msdn.microsoft.com/en-us/library/bb386987.aspx" re... | 5,872 |
<p>I'm working on a C#/ASP.NET project that has all the javascript files in a /Javascript folder. If I refer to the JS file using this syntax: src="/Javascript/jsfile.js" then the file is correctly picked up if the project is deployed to the root of the URL.</p>
<p>However, if this "web site" is deployed to a sub-fold... | <p>If you reference the JS-file in a section that is "runat=server" you could write src="~/Javascript/jsfile.js" and it will always work.</p>
<p>You could also do this in your Page_Load (In your masterpage):</p>
<pre><code>Page.ClientScript.RegisterClientScriptInclude("myJsFile", Page.ResolveClientUrl("~/Javascript/j... | <p>@Jared: IE needs that /script . FF doesn't care.</p>
| 6,481 |
<p>I really enjoy Chrome, and the sheer exercise of helping a port would boost my knowledge-base.</p>
<p>Where do I start?</p>
<p>What are the fundamental similarities and differences between the code which will operated under Windows and Linux?</p>
<p>What skills and software do I need?</p>
<hr />
<h3>Note:</h3>
<p>Th... | <p>EDIT: (2/6/10)</p>
<p>A Beta version of Chrome has been released for Linux. Although it is labeled beta, it works great on my Ubuntu box. You can download it from Google:</p>
<p><a href="http://www.google.com/chrome?platform=linux" rel="nofollow noreferrer">http://www.google.com/chrome?platform=linux</a></p>
<p>E... | <p>Read this article on Chrome and Open Source on Linux:</p>
<p><a href="http://arstechnica.com/journals/linux.ars/2008/09/02/google-unveils-chrome-source-code-and-linux-port" rel="noreferrer">http://arstechnica.com/journals/linux.ars/2008/09/02/google-unveils-chrome-source-code-and-linux-port</a></p>
<p>The Google V... | 7,060 |
<p>I use solr to search for documents and when trying to search for documents using this query "<code>id:*</code>", I get this query parser exception telling that it cannot parse the query with * or ? as the first character. </p>
<pre><code>HTTP Status 400 - org.apache.lucene.queryParser.ParseException: Cannot parse '... | <p>If you want all documents, do a query on *:*</p>
<p>If you want all documents with a certain field (e.g. id) try id:[* TO *]</p>
| <p>I'm assuming with id:* you're just trying to match all documents, right?</p>
<p>I've never used solr before, but in my Lucene experience, when ingesting data, we've added a hidden field to every document, then when we need to return every record we do a search for the string constant in that field that's the same f... | 3,674 |
<p>After being told by at least 10 people on SO that version control was a good thing even if it's just me I now have a followup question.</p>
<p>What is the difference between all the different types of version control and is there a guide that anybody knows of for version control that's very simple and easy to under... | <p>Eric Sink has a <a href="http://www.ericsink.com/scm/source_control.html" rel="nofollow noreferrer">good overview of source control</a>. There are also some <a href="https://stackoverflow.com/questions/871/why-is-git-better-than-subversion">existing</a> <a href="https://stackoverflow.com/questions/2658/version-contr... | <p>Just start using source control, no matter what type you use. What you use doesn't matter; it's the use of it that is important</p>
| 2,590 |
<p>If I use the following code I lose the ability to right click on variables in the code behind and refactor (rename in this case) them</p>
<pre><code><a href='<%# "/Admin/Content/EditResource.aspx?ResourceId=" + Eval("Id").ToString() %>'>Edit</a>
</code></pre>
<p>I see this practice everywhere but... | <p>I wouldnt call it bad practice (some would disagree, but why did they give us that option in the first place?), but I would say that you'll improve overall readability and maintainability if you do not submit to this practice. You already conveyed out a good point, and that is IDE feature limitation (i.e., design ti... | <p>It's up to you. Sometimes "spagehetti" code is easier to maintain than building/using a full on templating system for something simple, but once you get fairly complicated pages, or more specifically, once you start including a lot of logic into the page itself, it can get dirty really quickly. </p>
| 9,399 |
<p>I made a simple logo using Inkscape, after saving as an svg file, but when I export that file into Fusion 360 something strange happened.</p>
<p>Multiple times I convert some images (png, svg) to svg file. The process I use is this:</p>
<ol>
<li>Scan logo image (scanner or smartphone)</li>
<li>Open image with Inksca... | <h1>read first</h1>
<p>When you use painters tape, you need to level your printer <strong>with</strong> the tape applied. You need to relevel if you change the tape type.</p>
<h1>Basics</h1>
<p>It's not <em>any</em> blue tape that printers love. There are basically two factors that make a tape useful:</p>
<ul>
<li>It h... | <p>The second image isn't exactly painter's tape. Both images are types of masking tape, but the common manila/cream-colored masking tape vs the blue or green painter's tape <em>typically</em> has three features that make it less desirable for bed adhesion:</p>
<ol>
<li>Stronger glue holding the tape to the bed, that ... | 1,319 |
<p>I have a prusa i3 with Mendel firmware and a RAMPS board. Recently it has been randomly stopping during prints. The LCD screen will lock up, the print will stop, and the heating elements will turn off. Pressing the reset button on the RAMPS restarts the system and it works fine.</p>
<p>In addition to stopping du... | <p>It could be several things.</p>
<p>Your ramps board is overheating or has to much load on it. If you're not cooling the ramps board adding a fan may help the issue. </p>
<p>I know Robo3D had this issue and started shipping with a fan to cool the ramps board.</p>
<p>The ramps/arduino board could be faulty, the fir... | <p>I had the same thing, the printer was not heating the nozzle anymore after starting the print. I fixed this by reinstalling the firmware.</p>
<p>It could also be that your stepper drivers are overheating. you can add a fan to cool them.</p>
<p>The SD card could be bad, maybe try an other card or another .gcode fi... | 257 |
<p>I need to execute a large set of SQL statements (creating a bunch of tables, views and stored procedures) from within a C# program.</p>
<p>These statements need to be separated by <code>GO</code> statements, but <code>SqlCommand.ExecuteNonQuery()</code> does not like <code>GO</code> statements. My solution, which I... | <p>Use SQL Server Management Objects (SMO) which understands GO separators. See my blog post here: <a href="http://weblogs.asp.net/jgalloway/archive/2006/11/07/Handling-_2200_GO_2200_-Separators-in-SQL-Scripts-_2D00_-the-easy-way.aspx" rel="noreferrer">http://weblogs.asp.net/jongalloway/Handling-_2200_GO_2200_-Separato... | <p>Too difficult :)</p>
<p>Create array of strings str[] replacing GO with ",@" :</p>
<pre><code> string[] str ={
@"
USE master;
",@"
CREATE DATABASE " +con_str_initdir+ @";
",@"
-- Verify the database files and sizes
--SELECT name, size, size*1.0/128 AS [Size in MBs]
--SELECT name
--F... | 6,208 |
<p>Anyone who writes client-side JavaScript is familiar with the DOM - the tree structure that your browser references in memory, generated from the HTML it got from the server. JavaScript can add, remove and modify nodes on the DOM tree to make changes to the page. I find it very nice to work with (browser bugs aside)... | <p>You're describing <a href="http://www.youtube.com/watch?v=1QD9XQm_Jd4" rel="nofollow noreferrer">Rhino on Rails</a>, which is not out but will be soon.
Similarly, <a href="http://www.aptana.com/jaxer/" rel="nofollow noreferrer">Aptana Jaxer</a>, however RnR will include an actual framework (Rails) whereas Jaxer is ... | <p>I see where you're coming from but it's all a bit moot isn't it. You can't send anything but rendered content to the browser, and you have to do it all in one go (AJAX aside). There's no value from what you are suggesting (from what I can see) as even if you build it tree-like, you're still only building a page whic... | 3,569 |
<p>I have problems with layer widths and uneven outer walls on my 3D prints. Sometimes layers are squeezed and sometimes pushed outside. I noticed that these problems happen when there are retractions on layers. I don't have problems with round and simple objects without changes on layers or where all layers are identi... | <p>You can do this provided the part releases consistently after cooling. Your filament choice may cause problems, though. ABS is prone to warping and a fan constantly blowing on the part would make it worse. The second thing to consider would be the release agent. I assume you are using gluestick or something similar ... | <p>In theory you could knock the item off the build plate and into a bin by positioning the print head behind the part and then pushing.</p>
<p>However your build plate would need to have a smooth front edge, so no clips in the way.</p>
<p>You'd also want to have some delay to let the bed cool down before attempting th... | 2,027 |
<p>...instead of using the Atom syndication format?</p>
<p>Atom is a <a href="http://www.atomenabled.org/developers/syndication/" rel="noreferrer">well-defined</a>, general-purpose XML syndication format. RSS is fractured into four different versions. All the major feed readers have supported Atom for as long as I can... | <p>The fundamental thing that the Atom creators didn't understand (and that the Atom supporters still don't understand), is that Atom isn't somehow separate from RSS. There's this idea that RSS fractured, and that somehow Atom fixes that problem. But it doesn't. Atom is just another RSS splinter. A new name doesn't... | <p>There are a lot of RSS feed readers out there that people are used to using, and most importantly, RSS is very well known and has been around much longer. Why mess with something if it works?</p>
| 3,353 |
<p>My Ender 5 Plus (original) does not perform leveling.</p>
<p>After the self-leveling command, the Z axis only descends.
I have already exchanged the BLTouch three times, and the problem remains unchanged.</p>
<p>I bought my E5P in December, in America, to bring it to Brazil, I had to completely dismantle it.</p>
<p>... | <p>I had the same problem with my Ender 5 Plus.</p>
<p>There is a small set screw at the top of the BLTouch you will need to tighten this in to adjust the location of the sensor pin. Keep screwing it more and more until you see it initialize reliably that is it should move out and back twice to initialize.</p>
<p>When ... | <p>I had the same issue. The probe for the BL touch was just stuck.</p>
<p>I manually pulled it out and tightened the screw and then the problem was fixed.</p>
| 1,930 |
<p>Let me preface this with me being quite a newbie to 3D printing, however, I am an engineer and coder, so tinkering with stuff like this is quite the norm for me. Don't be afraid to be too technical, knowledge is power!</p>
<p>I recently purchased a new Creality Ender 3 V2 based on a friend's recommendation and with... | <p>Okay, so after yet another frustrating night of troubleshooting. I believe I have identified the specific problem. I reduced the G-code file to about 100 lines of code, that 100% reproduced the issue on the BIQU H2 stepper. With the original 4042 stepper, the problem was intermittent, but did occur from time to t... | <p>Check your retraction and run some experiments with it. I just had a very similar problem, when I switched from 0.6 mm retraction to 0.8 mm filament tended to get stuck between rolers and the cooler on layer change.
I don't have and never had linear advance enabled, so it's not the issue.
Unless I've misunderstood a... | 1,997 |
<p>I'm trying to write a page that calls PHP that's stored in a MySQL database. The page that is stored in the MySQL database contains PHP (and HTML) code which I want to run on page load.</p>
<p>How could I go about doing this?</p>
| <p>You can use the <a href="http://php.net/manual/en/function.eval.php" rel="nofollow noreferrer">eval</a> command for this. <strong>I would recommend against this though, because there's a lot of pitfalls using this approach.</strong> Debugging is hard(er), it implies some security risks (bad content in the DB gets ex... | <p>How I did this is to have a field in the database that identified something unique about the block of code needing to be executed. That one word is in the file name of that code. I put the strings together to point to the php file to be included. example:</p>
<pre><code>$lookFor = $row['page'];
include("resourc... | 6,269 |
<p>I have written a Silverlight 2 application communicating with a WCF service (BasicHttpBinding). The site hosting the Silverlight content is protected using a ASP.NET Membership Provider. I can access the current user using HttpContext.Current.User.Identity.Name from my WCF service, and I have turned on AspNetCompati... | <p>I finally found a way to make this work. For authentication I'm using the "<a href="http://msdn.microsoft.com/en-us/library/bb386582.aspx" rel="noreferrer">WCF Authentication Service</a>". When authenticating the service will try to set an authentication cookie. I need to get this cookie out of the response, and add... | <p>It is possible to hide much of the extra code behind a custom message inspector & behavior so you don't need to take care of tinkering with the OperationContextScope yourself.</p>
<p>I'll try to mock something later and send it to you.</p>
<p>--larsw</p>
| 8,001 |
<p>I would like to know how to infer coercions (a.k.a. implicit conversions) during type inference. I am using the type inference scheme described in <a href="http://people.cs.uu.nl/bastiaan/phdthesis/index.html" rel="noreferrer">Top Quality Type Error Messages</a> by Bastiaan Heeren, but I'd assume that the general id... | <p>I hope you get some good answers to this.</p>
<p>I haven't yet read the paper you link to but it sounds interesting. Have you looked at all how ad-hoc polymorphism (basically overloading) works in Haskell? Haskell's type system is H-M plus some other goodies. One of those goodies is type classes. Type classes p... | <p>Could you give a little more clarification as to what exactly it is you're asking?</p>
<p>I have a slight idea, and if my idea is right then this answer should suffice as my answer. I believe you're talking about this from the perspective of someone who's creating a language, in which case you can look at a languag... | 9,507 |
<p>So the SMEs at my current place of employment want to try and disable the back button for certain pages. We have a page where the user makes some selections and submits them to be processed. In some instances they have to enter a comment on another page. </p>
<p>What the users have figured out is that they don't... | <p>Don't do this, just don't. It's bad interface design and forces the user's browser to behave in a way that they don't expect.</p>
<p>I would regard any script that successfully stopped my back button from working to be a hack, and I would expect the IE team to release a security-fix for it.</p>
<p>The back button ... | <p>There simply is no reliable way to do this. You cannot guarantee that 100% of the time you can stop the user from doing this.</p>
<p>With that in mind, is it worth going to extremely exotic solutions to disable "most" of the time? That's for you to decide.</p>
<p>Good luck.</p>
| 7,815 |
<p>I need to script the creation of app pools and websites on IIS 6.0. I have been able to create these using adsutil.vbs and iisweb.vbs, but don't know how to set the version of ASP.NET for the sites I have just created to 2.0.50727.0.</p>
<p>Ideally I would like to adsutil.vbs to update the metabase. How do I do thi... | <p>@<a href="https://stackoverflow.com/questions/20923/vbscriptiis-how-do-i-automatically-set-aspnet-version-for-a-particular-website#20953">Chris</a> beat me to the punch on the ADSI way</p>
<p>You can do this using the aspnet_regiis.exe tool. There is one of these tools per version of ASP.NET installed on the machin... | <p>I found the following script <a href="http://www.diablopup.net/post/Set-an-IIS-Object%27s-ASPNET-Version-Using-VBScript.aspx" rel="nofollow noreferrer">posted</a> on Diablo Pup's blog. It uses ADSI automation.</p>
<pre><code>'*****************************************************************************************... | 4,129 |
<p>In C#, what is the difference (if any) between these two lines of code?</p>
<pre><code>tmrMain.Elapsed += new ElapsedEventHandler(tmrMain_Tick);
</code></pre>
<p>and</p>
<pre><code>tmrMain.Elapsed += tmrMain_Tick;
</code></pre>
<p>Both appear to work exactly the same. Does C# just assume you mean the former when... | <p>I did this</p>
<pre><code>static void Hook1()
{
someEvent += new EventHandler( Program_someEvent );
}
static void Hook2()
{
someEvent += Program_someEvent;
}
</code></pre>
<p>And then ran ildasm over the code.<br>
The generated MSIL was exactly the same.</p>
<p>So to answer your question, yes they are th... | <p>I think the one way to really tell would be to look at the MSIL produced for the code.. Tends to be a good acid test..</p>
<p>I have funny concerns that it may somehow mess with GC.. Seems odd that there would be all the overhead of declaring the new delegate type if it never needed to be done this way, you know?</... | 4,653 |
<p>Is accessing a <strong>bool</strong> field atomic in C#? In particular, do I need to put a lock around:</p>
<pre><code>class Foo
{
private bool _bar;
//... in some function on any thread (or many threads)
_bar = true;
//... same for a read
if (_bar) { ... }
}
</code></pre>
| <p><strong>Yes.</strong></p>
<blockquote>
<p>Reads and writes of the following data types are atomic: bool, char, byte, sbyte, short, ushort, uint, int, float, and reference types. </p>
</blockquote>
<p>as found in <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/va... | <p>the approach I have used, and I think is correct, is</p>
<pre><code>volatile bool b = false;
.. rarely signal an update with a large state change...
lock b_lock
{
b = true;
//other;
}
... another thread ...
if(b)
{
lock b_lock
{
if(b)
{
//other stuff
b = false;
... | 8,398 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.