instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>I have a site running in a Windows shared hosting environment. In their control panel for the shared hosting account I have it set to use ASP.NET version 3.0 but it doesn't say 3.5 SP1 specifically.</p>
<p>How can I view the installed version running on the server where my website is hosted in an asp.net page?</p>
| <p>Thanks!</p>
<p>I just dropped <%=Environment.Version%> on a page and got 2.0.50727.3053</p>
| <p>The hint from Brian Boatright by putting the <code><%=Environment.Version%></code> on a page, and save it in DotNetVersion.aspx, upload it, at testing on the right URL, world great.</p>
<p>Sadly it was an too old version for me: 1.1.4322.2443</p>
| 5,814 |
<p>It's a bit difficult to implement a deep object copy function. What steps you take to ensure the original object and the cloned one share no reference? </p>
| <p>A safe way is to serialize the object, then deserialize. This ensures everything is a brand new reference.</p>
<p><a href="http://javatechniques.com/blog/low-memory-deep-copy-technique-for-java-objects/" rel="noreferrer">Here's an article</a> about how to do this efficiently.</p>
<p>Caveats: It's possible for class... | <p>Here is an easy example on how to deep clone any object:
Implement serializable first</p>
<pre><code>public class CSVTable implements Serializable{
Table<Integer, Integer, String> table;
public CSVTable() {
this.table = HashBasedTable.create();
}
public CSVTable deepClone() {
... | 8,952 |
<p>When I do:</p>
<pre><code>$ find /
</code></pre>
<p>It searches the entire system.<br>
How do I prevent that?</p>
<p>(This question comes from an "<a href="https://stackoverflow.com/questions/18836/why-doesnt-find-find-anything#26182">answer</a>" to another question.)</p>
| <p>Consider:</p>
<pre><code>-maxdepth n
True if the depth of the current file into the tree is less than
or equal to n.
-mindepth n
True if the depth of the current file into the tree is greater
than or equal to n.
</code></pre>
| <p>Use the <strong>-prune</strong> option.</p>
| 4,673 |
<p>I have a DataGrid, populated with objects in an ArrayCollection. After updating one of the objects' fields, I want the screen to update. The data source is not bindable, because I'm constructing it at runtime (and I don't understand how to make it bindable on the fly yet -- that's another question).</p>
<p>In thi... | <p>invalidateList tells the component that the data has changed, and it needs to reload it and re-render it.</p>
<p>invalidateDisplayList tells the component that it needs to redraw itself (but not necessarily reload its data).</p>
| <p>invalidateDisplayList() merely sets a flag so that updateDisplayList() can be called later during a screen update. invalidateList() is what you want. </p>
<p><a href="http://livedocs.adobe.com/flex/2/langref/mx/core/UIComponent.html#invalidateDisplayList()" rel="nofollow noreferrer">http://livedocs.adobe.com/flex/2... | 9,995 |
<p>I frequently work with multiple instances of Visual Studio, often working on different branches of the same solution.</p>
<p><a href="https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Strictly_32-bit_versions" rel="noreferrer">Visual C++ 6.0</a> used to display the full path of the current source file in its t... | <p>There is not a native way to do it, but you can achieve it with a macro. The details are described here in full: <em><a href="https://www.helixoft.com/blog/how-to-show-full-file-path-or-anything-else-in-vs-2005-title-bar.html" rel="nofollow noreferrer">How To Show Full File Path (or Anything Else) in VS 2005 Title B... | <p>File > Preferences > Settings >> Window:Title</p>
<p>I just changed ${activeEditorShort} => ${activeEditorLong}</p>
<p>within the setting:
${dirty}${activeEditorLong}${separator}${rootName}${separator}${appName}</p>
<p>Worked immediately when I clicked a file.</p>
<p>Great help right in the setting ..... | 5,038 |
<p>Sometimes IE6 will render the text of a <code><ul></code> list the same color as the background color. If you select it, they show back up, or if you scroll the page up and back down.</p>
<p>It is obviously a rendering bug, but I was wondering if anyone knows of a workaround to make it reliable?</p>
| <p>try giving it hasLayout with</p>
<pre class="lang-css prettyprint-override"><code>zoom: 1
</code></pre>
| <p>Have you tried explicitly setting a line-height? For some reason this seems to be the solution to a great many IE6 rendering bugs!</p>
<p>e.g.</p>
<pre class="lang-css prettyprint-override"><code>.mylist {
line-height: 1.6em;
}
</code></pre>
| 6,378 |
<p>If I'm running a signed Java applet. Can I load additional classes from remote sources, in the same domain or maybe even the same host, and run them?</p>
<p>I'd like to do this without changing pages or even stopping the current applet. Of course, the total size of all classes is too large to load them all at once.... | <p>I think classes are lazy loaded in applets. being loaded on demand.</p>
<p>Anyway, if the classes are outside of a jar you can simply use the applet classloader and load them by name. Ex:</p>
<pre><code>ClassLoader loader = this.getClass().getClassLoader();
Class clazz = loader.loadClass("acme.AppletAddon");
</cod... | <p>Sounds like it should be possible (but I've never done it). Have you already had a look at Remote Method Invocation (<a href="http://java.sun.com/javase/technologies/core/basic/rmi/index.jsp" rel="nofollow noreferrer">RMI</a>)?</p>
| 8,536 |
<p>For this directory structure:</p>
<pre><code>.
|-- README.txt
|-- firstlevel.rb
`-- lib
|-- models
| |-- foo
| | `-- fourthlevel.rb
| `-- thirdlevel.rb
`-- secondlevel.rb
3 directories, 5 files
</code></pre>
<p>The glob would match: </p>
<pre><code>firstlevel.rb
lib/secondlevel.rb
l... | <p>Apologies if I've missed the real point of the question but, if I was using sh/bash/etc., then I would probably use <em>find</em> to do the job:</p>
<pre><code>find . -name '*.rb' -type f
</code></pre>
<p>Globs can get a bit nasty when used from within a script and <em>find</em> is much more flexible.</p>
| <p>Looks like it can't be done from <code>bash</code></p>
<p>If you using <code>zsh</code> then</p>
<pre><code>ls **/*.rb
</code></pre>
<p>will produce the correct result. </p>
<p>Otherwise you can hijack the <code>ruby</code> interpreter (and probably those of other languages) </p>
<pre><code>ruby -e "puts Dir.gl... | 6,625 |
<p>I talked to a few friends who say that Drupal is amazing, and it is a way better than Joomla. What are the major differences/advantages?</p>
| <p>The general consensus is that programmers prefer Drupal whereas mere mortals prefer Joomla. Joomla is praised for having a simpler user interface. (I personally don't agree with that; I think Joomla's UI is pretty painful to use. But then again, I'm looking at it with a programmer's eye.) Drupal, on the other hand, ... | <p>What I like about Drupal is the plugin model: you have your core of drupal, and you can customize it however you want it by creating your own seperate template directory and modules (the plugins).</p>
<p>For a complete technical overview you can also tick Drupal and Joomla in <a href="http://www.cmsmatrix.org/matri... | 8,924 |
<p>I'm wondering if there's any way to write CSS specifically for Safari using only CSS. I know there has to be something out there, but I haven't found it yet.</p>
| <p>I think the question is valid. I agree with the other responses, but it doesn't mean it's a terrible question. I've only ever had to use a Safari CSS hack once as a temporary solution and later got rid of it. I agree that you shouldn't have to target just Safari, but no harm in knowing how to do it.</p>
<p>FYI, thi... | <p>This really depends on what you are trying to do. Are you trying to do something special just in safari using some of the CSS3 features included or are you trying to make a site cross browser compliant?</p>
<p>If you are trying to make a site cross browser compliant I'd recommend writing the site to look good in sa... | 9,481 |
<p>I'm currently looking at the Python framework Django for future db-based web apps as well as for a port of some apps currently written in PHP. One of the nastier issues during my last years was keeping track of database schema changes and deploying these changes to productive systems. I haven't dared asking for bein... | <p>There are at least two third party utilities to handle DB schema migrations, <a href="http://aeracode.org/projects/south/" rel="noreferrer">South</a> and <a href="http://code.google.com/p/django-evolution/" rel="noreferrer">Django Evolution</a>. I haven't tried either one, but I have heard some good things about Sou... | <p>And now there's also <a href="http://code.google.com/p/dmigrations/" rel="nofollow noreferrer">dmigrations</a>. From <a href="http://simonwillison.net/2008/Sep/3/dmigrations/" rel="nofollow noreferrer">announcement</a>:</p>
<blockquote>
<p>django-evolution attempts to address this problem the clever way, by detectin... | 4,035 |
<p>I need to add some simple image renders of STL files to a document. I currently open the STL files in Preview or one of the slicers and grab a screen shot.</p>
<p>Is there an easier or automatic way to generate PNG images from STL files on a Mac?</p>
| <p>If you have <a href="http://www.openscad.org" rel="noreferrer">OpenSCAD</a> installed, this shell script will generate 100x100 pixel PNG images for each STL file in your current directory.</p>
<pre><code>for i in *.stl; do
T=__tmp__<span class="math-container">$i
b=`basename $</span>i`
echo import\(\"<span cl... | <p>You can use OpenSCAD, as stated in the accepted answer.
Here is a version of that script that works for Windows for anyone who needs it, as I did.</p>
<pre><code># Change height and width to the desired output image dimensions, in pixels.
# The path to openscad.exe may also have to be adjusted based on your instal... | 915 |
<p>I have a blogengine.net install that requires privatization.</p>
<p>I'm doing research work at the moment, but I have to keep my blog/journal private until certain conditions are met.</p>
<p>How can I privatize my blogEngine.net install so that readers must log in to read my posts?</p>
| <p>I use this extension. Just save the file as RequireLogin.cs in your App_Code\Extensions folder and make sure the extension is activated.</p>
<pre><code>using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControl... | <p>I would think it's possible to do this in the web config file by doing something like the following:</p>
<pre><code><system.web>
<authorization>
<allow roles="Admin" />
<deny users="*" />
</authorization>
</system.web>
</code></pre>
| 3,806 |
<p>I need to generate a random integer between 1 and n (where n is a positive whole number) to use for a unit test. I don't need something overly complicated to ensure true randomness - just an old-fashioned random number.</p>
<p>How would I do that?</p>
| <p>To get a random integer value between 1 and N (inclusive) you can use the following.</p>
<pre><code>CInt(Math.Ceiling(Rnd() * n)) + 1
</code></pre>
| <pre><code>Function xrand() As Long
Dim r1 As Long = Now.Day & Now.Month & Now.Year & Now.Hour & Now.Minute & Now.Second & Now.Millisecond
Dim RAND As Long = Math.Max(r1, r1 * 2)
Return RAND
End Function
</code></pre>
<p>[BBOYSE]
This its the best way, from scratch :P</p... | 3,922 |
<p>My GPS logger occassionally leaves "unfinished" lines at the end of the log files. I think they're only at the end, but I want to check all lines just in case. </p>
<p>A sample complete sentence looks like:</p>
<pre><code>$GPRMC,005727.000,A,3751.9418,S,14502.2569,E,0.00,339.17,210808,,,A*76
</code></pre>
<p>The... | <p>The minimum of testing shows that this should do it:</p>
<pre><code>grep -Ev "^\$.*\*[0-9A-Fa-f]{2}$" a.txt | grep -v ADVER
</code></pre>
<ul>
<li>-E use extended regexp</li>
<li>-v Show lines that do <strong>not</strong> match</li>
<li>^ starts with</li>
<li>.* anything</li>
<li>\* an asterisk </li>
<li>[0-9A-Fa-... | <p>@Motti: Combining the <code>grep</code>s isn't working, it's having no effect.</p>
<p>I understand that without the trailing <code>$</code> something else may folow the checksum & still match, but it didn't work at all with it so I had no choice...</p>
<p>GNU grep 2.5.3 and GNU bash 3.2.39(1) if that makes any... | 5,735 |
<p>I'm new to MVC (and ASP.Net routing). I'm trying to map <code>*.aspx</code> to a controller called <code>PageController</code>. </p>
<pre><code>routes.MapRoute(
"Page",
"{name}.aspx",
new { controller = "Page", action = "Index", id = "" }
);
</code></pre>
<p>Wouldn't the code above map *.aspx to <code>P... | <blockquote>
<p>I just answered my own question. I had
the routes backwards (Default was
above page).</p>
</blockquote>
<p>Yeah, you have to put all custom routes above the Default route.</p>
<blockquote>
<p>So this brings up the next question...
how does the "Default" route match (I
assume they use regul... | <p>Not sure how your controller looks, the error seems to be pointing to the fact that it can't find the controller. Did you inherit off of Controller after creating the PageController class? Is the PageController located in the Controllers directory?</p>
<p>Here is my route in the Global.asax.cs</p>
<pre><code>rou... | 3,304 |
<p>Our library system just put a 3D printer in one of the branches. I have used SketchUp on the library computers for a number of years just to do artsy things. Suddenly, I have the opportunity to actually print something. (I'm really not sure why the libraries have SketchUp installed. But, I have enjoyed using it.)</p... | <p>Here is what I suggest you try. If you have a file that you can view/edit in blender I would export it as both STL and OBJ formats. Then take those files and upload them to Netfabb (<a href="https://netfabb.azurewebsites.net/" rel="nofollow">https://netfabb.azurewebsites.net/</a>) and get a "repaired" file. Have the... | <p>Makerbot will accept obj files also.
Is there an error while importing the obj file?
Also you can see errors of your imported file in your makerbot
It will be marked in black.</p>
<p><a href="https://i.stack.imgur.com/pggIz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pggIz.png" alt="enter im... | 201 |
<p>If you were to write an GUI application that runs locally and calls a webservice, to be cross platform, can you do it with .Net, what tools would you recommend?</p>
<p>I was considering Java as it would be relatively easy to pick up due to its C# similarity and then I could use the JVM.</p>
| <p>You should get familiar with the <a href="http://www.mono-project.com/Main_Page" rel="noreferrer">Mono project</a> and <a href="http://www.monodevelop.com/Main_Page" rel="noreferrer">MonoDevelop</a>; the express purpose of those projects is to allow building and running .NET code on a variety of platforms, including... | <p>Honestly I would evaluate your customer base and your existing skills. If you've got a 50/50 split, or even a 70/30 split of Windows to non-Windows, you'd likely be better off with Java or some other cross-platform toolkit. </p>
<p>Mono is a decent platform (See <a href="https://stackoverflow.com/questions/42627/be... | 7,988 |
<p>As the title says, is there a way to run the same Adobe AIR app more than once? I have a little widget I wrote that shows thumbnails from a couple of photo streams, and I'd like to fix it so I can look at more than one stream at a time. Thanks!</p>
| <p>It seems that this is not possible. From the <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=app_launch_1.html" rel="nofollow noreferrer">documentation</a>:</p>
<blockquote>
<p>Only one instance of an AIR application is started. When an already running application is invoked again, AIR dispatches... | <p>Last time I checked, an AIR app can only run a single instance. You could open multiple windows, but your app itself would have to support that. I hope they change this soon.</p>
| 6,121 |
<p>I'm sure many readers on SO have used <a href="https://www.lutzroeder.com/dotnet/" rel="nofollow noreferrer">Lutz Roeder</a>'s <a href="http://www.reflector.net/" rel="nofollow noreferrer">.NET reflector</a> to decompile their .NET code.
I was amazed just how accurately our source code could be recontructed from ou... | <p>I wouldn't worry about it too much. I'd rather focus on putting out an awesome product, getting a good user base, and treating your customers right than worry about the minimal percentage of users concerned with stealing your code or looking at the source.</p>
| <p>Obsfucation is limited in it's effectiveness, it might keep the casual guy away. The most effective obsfucation is making only the smallest amount of code available to the user. If you can, make your app run depend heavily on a fat server.</p>
| 3,316 |
<p>Has anyone used the <a href="http://cmusphinx.sourceforge.net/html/cmusphinx.php" rel="nofollow noreferrer">Sphinx</a> speech recognition stack to build IVR applications? I am looking for open source alternatives to the expensive and somewhat limiting choices from MSFT and others. I have not been able to find a co... | <p>You could try integrating Sphinx with <a href="http://www.asterisk.org/" rel="nofollow noreferrer">Asterisk</a>:</p>
<ul>
<li><a href="http://www.syednetworks.com/asterisk-integration-with-sphinx-voice-recognition-system" rel="nofollow noreferrer">http://www.syednetworks.com/asterisk-integration-with-sphinx-voice-r... | <p>You could try integrating Sphinx with <a href="http://www.asterisk.org/" rel="nofollow noreferrer">Asterisk</a>:</p>
<ul>
<li><a href="http://www.syednetworks.com/asterisk-integration-with-sphinx-voice-recognition-system" rel="nofollow noreferrer">http://www.syednetworks.com/asterisk-integration-with-sphinx-voice-r... | 5,667 |
<p>I've printed mostly ABS in the past and encountered <a href="https://www.google.com/#q=3d+printing+layer+delamination">delamination</a> between layers many times. I've ensured the following conditions regularly:</p>
<ul>
<li>Build plate is level</li>
<li>Base of print isn't warped (using ABS slurry)</li>
<li>Preven... | <p>Cool environmental conditions are the single biggest contributor to ABS delamination. Delamination or edge/corner cracking is caused by warping stresses when the first layer adhesion is stronger than the interlayer bonding. Or it happens when the heated build plate allows a strong non-warping foundation to be built ... | <p>wall size and filling are also parameters.
If wall size is too thin delamination is more visible</p>
| 273 |
<p>I've gone on quite a few sites (thingiverse, grabcad, etc) in search for a coiled tube, but I have yet to find anything suitable. There are a few coils ("springs") but no coiled tubes (i.e. the springs are hollow). Maybe my searching hasn't been good enough! But I was wondering if this is a limitation to 3D printing... | <p>I managed to do it in the end using AutoDesk 123D.</p>
<p><a href="https://i.stack.imgur.com/izeeR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/izeeR.png" alt="enter image description here"></a></p>
<p>Did it by making two coils of differing radius, then subtracting the smaller from the large... | <p>No, this is not a limitation. You should be able to create a coiled tube in almost every 3D design software package. However, how to do this depends on the specific 3D design software in use.</p>
<p>You'd generally do so by creating a cross-sectional profile (i.e. a hollow circle) and then sweeping it along a helic... | 644 |
<p>(I'll begin by making it clear, I am not a .NET developer and am not tied to any other environment.)</p>
<p>Recently, I heard that the London Stock Exchange went down for an entire day. I've also heard that the software was written in .NET. Up to this point they would experience performance hits on busy days. Peopl... | <p>Honestly, I think it boils down to code optimization, apart from just the infrastructure.</p>
<p>In <a href="https://blog.stackoverflow.com/2008/08/podcast-19/">StackOverflow Podcast 19</a>, Jeff discussed about how they had to tweak SQL Server to handle the kinds of loads StackOverflow has; notice that it was not .... | <p>It really bothers me when people say .NET is a platform of choice because 'its scalable', its no more or less scalable than any other platform: PHP, ColdFusion, JSP or native compiled apps with C++/Delphi etc... Scalability isn't a feature of the framework, it's a feature of the application design.</p>
<p>MySpace ... | 7,850 |
<p>Has anyone tried installing SQL Server 2008 Developer on a machine that already has 2005 Developer installed?</p>
<p>I am unsure if I should do this, and I need to keep 2005 on this machine for the foreseeable future in order to test our application easily. Since I sometimes need to take backup files of databases a... | <p>Yes this is possible. You will have to create a named instance not used by another version of SQL Server as per the previous answer and version 3.5 of .Net installed. Works great!!</p>
<p>Here the list of prerequisites:</p>
<ul>
<li>.NET Framework 3.5 SP1</li>
<li>Windows Installer 4.5</li>
<li>Windows PowerShell... | <p>Unfortunately, it seems SQL Server 2008 Client Tools requires Visual Studio 2008 SP1, and I'm loath to install a beta of this on my main development machine.</p>
<p>I'll wait until SP1 is RTM before I move on.</p>
<p><strong>Edit</strong>: Yes, I do have Visual Studio 2008 on this machine, but I'd like to avoid be... | 2,651 |
<p>What is the best approach to calculating the largest prime factor of a number?</p>
<p>I'm thinking the most efficient would be the following:</p>
<ol>
<li>Find lowest prime number that divides cleanly</li>
<li>Check if result of division is prime</li>
<li>If not, find next lowest</li>
<li>Go to 2.</li>
</ol>
<p>I... | <p>Actually there are several more efficient ways to find factors of big numbers (for smaller ones trial division works reasonably well). </p>
<p>One method which is very fast if the input number has two factors very close to its square root is known as <a href="http://en.wikipedia.org/wiki/Fermat's_factorization_... | <p>I think it would be good to store somewhere all possible primes smaller then n and just iterate through them to find the biggest divisior. You can get primes from <a href="http://www.prime-numbers.org/" rel="nofollow noreferrer">prime-numbers.org</a>.</p>
<p>Of course I assume that your number isn't too big :)</p>
| 4,328 |
<p>What guidelines do you follow to improve the general quality of your code? Many people have rules about how to write C++ code that (supposedly) make it harder to make mistakes. I've seen people <em>insist</em> that every <code>if</code> statement is followed by a brace block (<code>{...}</code>).</p>
<p>I'm interes... | <p>A few of my personal favorites:</p>
<p>Strive to write code that is <a href="http://www.parashift.com/c++-faq-lite/const-correctness.html" rel="noreferrer">const correct</a>. You will enlist the compiler to help weed out easy to fix but sometimes painful bugs. Your code will also tell a story of what you had in m... | <p>make sure you indent properly</p>
| 8,565 |
<p>Occasionally, I find that while debugging an ASP.Net application (written in visual studio 2008, running on Vista 64-bit) the local ASP.Net development server (i.e. 'Cassini') stops responding.</p>
<p>A message often comes up telling me that "Data Execution Prevention (DEP)" has killed WebDev.WebServer.exe</p>
<p>... | <p>The only way to know for sure would be to dig through the Cassini source and see if there are any areas where it generates code on the heap and then executes it without clearing the NX flag.</p>
<p>However, instead of doing that, why not use IIS?</p>
<p>EDIT:</p>
<p>The danger of disabling DEP is that you open up... | <p>Thanks for the answers. I guess I developed such an aversion to IIS in the .net 1.x era that I've refused to consider re-using it -- until now.</p>
<p><em>aside: when choosing between two equally acceptable answers from ChanChan and Jonathan, I arbitrarily marked Jonathan's as 'accepted' because a) he got in first ... | 3,978 |
<p>We have a SharePoint WSS site and some of our users on on the Mac OSX platform. Are there any tips or tricks to get a similar experience to Windows with document shares and calendars on the Mac?</p>
<p>Edit: Browsing a SharePoint WSS site on a Mac, whether using Firefox or Safari, has a very similar look and feel ... | <p>Unfortunately, the "full" Sharepoint Experience is limited to running Internet Explorer 6/7 and Office 2007.</p>
<p>On the Mac, I recommend using Firefox (Camino?) which seems to work a bit better than Safari.</p>
<p>Edit: When you say "Similar experience", what exactly are you missing? I don't have any Mac here, ... | <p>ActiveX is used to enable the bridge between MOSS and Office, and as ActiveX is only on Windows, you will find that you cannot get the full experience if you do not use Windows as your OS.</p>
| 3,041 |
<p>I'm using <a href="http://www.helicontech.com/isapi_rewrite/" rel="nofollow noreferrer">Helicon's ISAPI Rewrite 3</a>, which basically enables .htaccess in IIS. I need to redirect a non-www URL to the www version, i.e. example.com should redirect to www.example.com. I used the following rule from the examples but ... | <p>Append the following RewriteCond:</p>
<pre><code>RewriteCond %{HTTP:Host} ^[^.]+\.[a-z]{2,5}$ [NC]
</code></pre>
<p>That way it'll only apply the rule to nondottedsomething.uptofiveletters as you can see, subdomain.domain.com will not match the condition and thus will not be rewritten.</p>
<p>You can change [a-z]... | <p>Can't you adjust the RewriteCond to only operate on example.com?</p>
<pre><code>RewriteCond %{HTTP:Host} ^example\.com(.*) [NC]
</code></pre>
| 7,374 |
<p>A Sprint cellular modem plugs into a laptop - often the PCMCIA slot. To connect, the user opens a program called the Connection Manager. This program has a menu option to display the serial number and phone number of the modem that's currently inserted.</p>
<p>Does that imply that the serial/phone number of the mod... | <p>You could send the mail asynchronous. That way the timeout should not interrupt your sending.</p>
<p>This article should help you get started with that: <a href="http://www.eggheadcafe.com/articles/20030720.asp" rel="nofollow noreferrer">Sending Emails Asynchronously in C#</a>.</p>
<p>There is another approach her... | <p>Definitely spawn it off on a background worker process so they go out asynchronously. </p>
<p>BTW, 5-10 seconds per e-mail seems way slow to me. On my server it takes just fractions of a second per e-mail. </p>
| 8,118 |
<p>I'm tearing my hair out with this one. If I start a block comment <code>/*</code> in VS.NET 2005+ then carriage return, Visual Studio insists that I have another asterisk <code>*</code>. I know there's an option to turn this off but I just can't find it. Anyone know how to turn this feature off?</p>
| <p><strong>Update: this setting was changed in VS 2015 update 2. See <a href="https://stackoverflow.com/a/36319097/4294399">this answer</a>.</strong></p>
<p><a href="http://forums.msdn.microsoft.com/en-US/csharpide/thread/a41e3652-efe2-4f81-ad3e-94994974fcb2/" rel="nofollow noreferrer">This post</a> addresses your ques... | <p>Try this:</p>
<pre><code>#if false
whatever you want here
and here
#endif
</code></pre>
| 7,415 |
<p>I develop C++ applications in a Linux environment. The tools I use every day include Eclipse with the CDT plugin, gdb and valgrind.<br>
What tools do other people use? Is there anything out there for Linux that rivals the slickness of Microsoft Visual Studio?</p>
| <p>I use a bunch of terminal windows. I have vim running on interesting source files, make and g++ output on another for compiler errors or a gdb session for runtime errors. If I need help finding definitions I run cscope and use vim's cscope support to jump around.</p>
<p>Eclipse CDT is my second choice. It's nice ... | <p><a href="http://anjuta.sourceforge.net/" rel="nofollow noreferrer">Anjuta</a> is a nice idea that makes Linux C++ dev quite enjoyable as well.</p>
| 3,792 |
<p>I'm using Cura to slice my prints. I've noticed that when printing the bottom layer (and also the top layer, if it's flat), it first prints three walls, then fills in the middle by moving back and forth in straight lines.</p>
<p>I've noticed that for my parts, the walls look much nicer than the zig-zag pattern in t... | <p>I found the answer myself just after posting - I'm posting it because it might be helpful to other Cura novices.</p>
<p>There is a setting for this, it's just that it's not shown by default. In print settings, you have to click on the three lines next to the search box, and select "Show All Settings". Then you can ... | <p>The latest Cura that I have (4.2.1) includes "Ironing" in its options. When I enabled this, it prints the top layer twice. The first time with extrusion and the second time with just a little bit of extrusion (default is 10%) at 90 degrees to the first one. This effectively "irons out" the zig-zag pattern giving ... | 1,490 |
<p>I need to decrement a Javascript date by 1 day, so that it rolls back across months/years correctly. That is, if I have a date of 'Today', I want to get the date for 'Yesterday'.</p>
<p>It always seems to take more code than necessary when I do this, so I'm wondering if there's any simpler way. </p>
<p>What's th... | <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var d = new Date();
d.setDate(d.getDate() - 1);
console.log(d);</code></pre>
</div>
</div>
</p>
| <p><code>setDate(dayValue)</code></p>
<p><code>dayValue</code> is an integer from 1 to 31, representing the day of the month.</p>
<p>from <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setDate" rel="nofollow noreferrer">https://developer.mozilla.org/en/Core_JavaScript_1.5_... | 5,190 |
<p>In the vein of <em>programming questions</em>: suppose there's a collection of objects that can be compared to each other and sorted. What's the most efficient way to keep track of the smallest element in the collection as objects are added and the current smallest occasionally removed?</p>
| <p>Using a min-heap is the best way.</p>
<p><a href="http://en.wikipedia.org/wiki/Heap_(data_structure)" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Heap_(data_structure)</a></p>
<p>It is tailor made for this application.</p>
| <blockquote>
<p>If you need random insert and removal,
the best way is probably a sorted
array. Inserts and removals should be
O(log(n)).</p>
</blockquote>
<p>Yes, but you will need to re-sort on each insert and (maybe) each deletion, which, as you stated, is O(log(n)). </p>
<p>With the solution proposed by ... | 5,414 |
<p>Could you use a 3D printer to make a 3D printer's parts? What is the most of a 3D printer that can be made this way? Could parts that break be replaced this way?</p>
| <p>Yes, you can print most of the parts (electronics, linear guide rails, ball bearings and nuts and bolts, etc cannot be printed). Actually this was exactly the purpose of <a href="https://reprap.org/wiki/RepRap" rel="noreferrer">RepRap.org</a>:</p>
<blockquote>
<p>RepRap is humanity's first general-purpose self-re... | <p>You can print some of it but not all, as 3d printers can't print metal or silicon to make the boards and frame.</p>
| 1,154 |
<p>I have a custom installer action that updates the PATH environment, and creates an additional environment variable. Appending a directory to the existing path variable is working fine, but for some reason my attempts to create a new environment variable have been unsuccessful. The code I am using is:</p>
<pre><code... | <p>Is there any reason that you have to do it through the registry?</p>
<p>If not, you can use Environment.SetEnvironmentVariable() since .NET 2.0. It allows you to set on a machine, process or user basis.</p>
| <p>It turns out there was another problem that was preventing the code in my question from being called. However, I was using the Win32 assembly because the example code I was following was written before the Environment assembly became available. So Thanks Peter for pointing out the Environment API.</p>
| 6,210 |
<p>I am considering converting a project that I've inherited from .net 1.1 to .net 2.0. The main warning I'm concerned about is that it wants me to switch from <code>System.Web.Mail</code> to using <code>System.Net.Mail</code>.</p>
<p>I'm not ready to re-write all the components using the obsolete <code>System.Web.Ma... | <p>System.Web.Mail is not a full .NET native implementation of the SMTP protocol. Instead, it uses the pre-existing COM functionality in CDONTS. System.Net.Mail, in contrast, is a fully managed implementation of an SMTP client.</p>
<p>I've had far fewer problems with System.Net.Mail as it avoids COM hell.</p>
| <p>Yes, we had the same issue, and we decided not to upgrade either. We haven't seen any problems, so you're OK ignoring the warnings.</p>
| 9,017 |
<p>I sometimes need to modify OSS code or other peoples' code (usually C-based, but sometimes C++/Java) and find myself "grep"ing headers for types, function declarations etc. as I follow code flow and try to understand the system. Is there a good tool that exists to aid in code browsing. I'd love to be able to click... | <p>You can't get anything better than <a href="http://www.sourceinsight.com" rel="noreferrer">SourceInsight</a>.</p>
| <p>IntelliJ is pretty good as a source browser under Linux. It's got really good support for jumping between source and function declarations. Haven't tried it with C/C++ code, but it works well with Ruby and Java. </p>
| 9,376 |
<p>This is a nasty one for me... I'm a PHP guy working in Java on a JSP project. I know how to do what I'm attempting through too much code and a complete lack of finesse. </p>
<p>I'd prefer to do it right. Here is the situation:</p>
<p>I'm writing a small display to show customers what days they can water their ... | <p>You could do essentially the same code with Hashtables (or some other Map):</p>
<pre><code>Hashtable<String, Hashtable<String, String>> schedule
= new Hashtable<String, Hashtable<String, String>>();
schedule.put("A", new Hashtable<String, String>());
schedule.put("B", new Hashtable... | <p>There is no pretty solution. Java just doesn't do things like this well. Mike's solution is pretty much the way to do it if you want strings as the indices (keys). Another option if the hash-of-hashes setup is too ugly is to append the strings together (shamelessly stolen from Mike and modified):</p>
<pre><code>... | 3,394 |
<p>I'm not sure if many people know about this text-editor?</p>
<p>jEdit was kinda big in 2004, but now, Notepad++ seems to have taken the lead(on Windows)
Many of the plugins haven't been updated since 2003 and the overal layout and usage is confusing...</p>
<p>I'm sure jEdit has many nifty features, but I'll be dam... | <p>I've been using jEdit for a few years now, mainly on windows, but also on Ubuntu.
I use it for: SQL, awk, batch files, html, xml, javascript...
Just about everything except .NET stuff (for which I use Visual Studio).<br />
I love it.</p>
<h2>summary</h2>
<p>I use jEdit because it has the right balance for me of <str... | <p>I had to use during my vocational education for XML and XSLT. It had a lot of bugs and didn't work always. I couldn't get to like it, but if I had to test some XSLT I'd give it another shot. I found Notepad++ and I am more than happy with it for what I need.</p>
<p>To your question: Did you take a look at <a href="... | 9,684 |
<p>I would love to start a small engraving business without having to purchase expensive hardware. </p>
<p>Using scrap parts at home, or parts from broken CD players, are there any ways to make a laser engraver at home? My cousin managed to make one of his own from scraps.</p>
| <p>I have a printer and a diode laser head which will etch aluminum for under $4k, but you're going to have to manage potentially noxious fumes based on what material you're lasering. It's safe if used safely: the focal distance is 15-20mm from the lens, but all present should wear PPE.</p>
<p>Note: I work for Hyrel3D... | <p>If you do not have knowledge about the electronics then consider buying a cheap etching machine instead.</p>
<h1>Build</h1>
<p>Take a look on <a href="https://hackaday.com/" rel="nofollow noreferrer">https://hackaday.com/</a> and search for laser engravers.</p>
<p>I have found following articles in few seconds:</... | 1,004 |
<p>How do I assign a method's output to a textbox value without code behind?</p>
<pre><code><%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Public TextFromString As String =... | <p>There's a couple of different expression types in .ASPX files. There's:</p>
<pre><code><%= TextFromMethod %>
</code></pre>
<p>which simply reserves a literal control, and outputs the text at render time.</p>
<p>and then there's:</p>
<pre><code><%# TextFromMethod %>
</code></pre>
<p>which is a databi... | <p>Have you tried using an HTML control instead of the server control? Does it also cause a compilation error?</p>
<pre><code><input type="text" id="TextBox4" runat="server" value="<%=TextFromString%>" />
</code></pre>
| 5,665 |
<p>I am working with both <a href="http://activemq.apache.org/ajax.html" rel="nofollow noreferrer">amq.js</a> (ActiveMQ) and <a href="http://code.google.com/apis/maps/documentation/reference.html" rel="nofollow noreferrer">Google Maps</a>. I load my scripts in this order</p>
<pre><code><head>
<meta http-e... | <blockquote>
<p><strong>Is there a way to make sure both scripts load before I use them in my application.js?</strong></p>
</blockquote>
<p>JavaScript files should load sequentially <em>and block</em> so unless the scripts you are depending on are doing something unusual all you should need to do is load application... | <p>You can also use the built in SharePoint javascript method to control the execution of your scripts;</p>
<pre><code>_spBodyOnLoadFunctionNames.push("yourFunction");
</code></pre>
| 3,954 |
<p>I am re-factoring some code and am wondering about the use of a <code>lock</code> in the instance constructor.</p>
<pre><code>public class MyClass {
private static Int32 counter = 0;
private Int32 myCount;
public MyClass() {
lock(this) {
counter++;
myCount = counter;
... | <p>If you are only incrementing a number, there is a special class (Interlocked) for just that...</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.threading.interlocked.increment.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.threading.interlocked.increment.aspx</a></p>
<blockquote>... | <p>I think if you modify the <a href="http://en.wikipedia.org/wiki/Singleton_pattern#C.23" rel="nofollow noreferrer">Singleton Pattern</a> to include a count (obviously using the thread-safe method), you will be fine :)</p>
<h3>Edit</h3>
<p>Crap I accidentally deleted!</p>
<p>I am not sure if instance constructors <em>... | 6,318 |
<p>I'm trying to print the following model:</p>
<p><a href="https://i.stack.imgur.com/b8cSN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b8cSN.jpg" alt="View 1" /></a></p>
<p><a href="https://i.stack.imgur.com/HGgi3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HGgi3.jpg" alt=... | <p>You may be getting shrinking due to cooling on the non-top and non-bottom layers. Sixty percent infill is rather substantial. I'm printing 20 hour pieces in ABS at 100 °C / 250 °C using ten percent infill and getting nothing like what your image shows.</p>
<p>Can you do with a lower infill? More isn't always stronge... | <p>If your object doesn't need to be flexible and can tolerate a more brittle material, PLA has better dimensional accuracy. Thus, it would be easier to get your desired shape.</p>
<p>Try two perimeter shells, but slow down the print speed of the perimeter.</p>
| 1,928 |
<p>I am using CCNET on a sample project with SVN as my source control. CCNET is configured to create a build on every check in. CCNET uses MSBuild to build the source code.</p>
<p>I would like to use the latest revision number to generate <code>AssemblyInfo.cs</code> while compiling.
How can I retrieve the latest revi... | <p>CruiseControl.Net 1.4.4 has now an <a href="http://confluence.public.thoughtworks.org/display/CCNET/Assembly+Version+Labeller" rel="noreferrer">Assembly Version Labeller</a>, which generates version numbers compatible with .Net assembly properties.</p>
<p>In my project I have it configured as:</p>
<pre><code><l... | <p>Be careful. The structure used for build numbers is only a short so you have a ceiling on how high your revision can go.</p>
<p>In our case, we've already exceeded the limit.</p>
<p>If you attempt to put in the build number 99.99.99.599999, the file version property will actually come out as 99.99.99.10175.</p>
| 2,358 |
<p>Repetier-host has a setting to specify the "print area". That's roughly the size of the bed.</p>
<p>Note that the printer head can go out of those bounds, in my case my bed is very undersized compared to the printer frame, but this would also be an issue if you had clips or some obstacles in the bed.</p>
<... | <p>The print area settings would be in the Preferences > Printers. Select the particular printer on the left side pane, then click the "Machine Settings" button.</p>
<p><a href="https://i.stack.imgur.com/86dAH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/86dAH.jpg" alt="enter image de... | <p>I am not sure this is the "official" solution for this, but I was able to define the "disallowed areas" in a custom printer definition.</p>
<p>I created a json file under C:\Program Files\Ultimaker Cura 4.8.0\resources\definitions for the printer, and added the machine_disallowed_areas section to... | 1,859 |
<p>We're looking for a Transformation library or engine which can read any input (EDIfact files, CSV, XML, stuff like that. So files (or webservices results) that contain data which must be transformed to a known business object structure.) This data should be transformed this to a existing business object using cust... | <p>If you think that XSLT is too difficult for you, I think you can try LINQ to XML for parsing XML files. It is integrated in the .NET framework, and you can use C# (or, if you use VB.NET 9.0, better because of the XML literals) instead of learning another language. You can integrate it with the existing application w... | <p><a href="http://www.microsoft.com/biztalk/en/us/default.aspx" rel="nofollow noreferrer">Microsoft BizTalk Server</a> does a very good job of this.</p>
| 8,742 |
<p>When it comes to web-design, I am horrible at producing anything remotely good looking. Thankfully there are a lot of free <a href="http://www.mantisatemplates.com/web-templates.php" rel="noreferrer">sources</a> for <a href="http://www.freecsstemplates.org/" rel="noreferrer">design</a> <a href="http://www.oswd.org/"... | <p>Check out the <a href="http://developer.yahoo.com/yui/grids/" rel="nofollow noreferrer">Grids framework</a> from YUI. Particularly awesome is the <a href="http://developer.yahoo.com/yui/grids/builder/" rel="nofollow noreferrer">Grid Builder</a>. Also, they have a set of reset, base, and font CSS files that will give... | <p><a href="http://www.blueprintcss.org/" rel="nofollow noreferrer">BluePrintCSS</a> was, from what I know, the first CSS framework.
As YUI CSS Framework, It's help you to handle layout.</p>
<p>That kind of framework will help you to build multiple CSS for your site.</p>
<p>BluePrintCSS is a quite mature project so I... | 6,501 |
<p>Does anybody have links to site or pre built report running on the SQL Analysis Service provided by TFS2008?</p>
<p>Creating a meaningful Excel report or a new report sometime is a very boring and difficult taks, maybe finding a way to share reports could be a good idea?</p>
| <p>Try this download: <a href="http://www.microsoft.com/downloads/details.aspx?familyid=a74486b2-f7db-4a85-97bd-46bf478bda60&displaylang=en" rel="nofollow noreferrer">Creating and Customizing TFS Reports</a>, it includes a few samples and some guidance. <a href="http://msdn.microsoft.com/en-us/library/cc487893.aspx... | <p>If you are using SCRUM, this has Sprint reports and Product Burndown reports:</p>
<p><a href="http://www.scrumforteamsystem.com/en/default.aspx" rel="nofollow noreferrer">http://www.scrumforteamsystem.com/en/default.aspx</a></p>
| 9,873 |
<p>I am using <a href="http://msdn.microsoft.com/en-us/library/aa387410(VS.85).aspx" rel="nofollow noreferrer">Windows Media Format SDK</a> to capture the desktop in real time and save it in a WMV file (actually this is an oversimplification of my project, but this is the relevant part). For encoding, I am using the <a... | <p>The source to CamStudio, a GPL'd screencasting app that's been around for years (commercially and then open-srcd later) might be useful?</p>
<p><a href="http://sourceforge.net/project/showfiles.php?group_id=131922" rel="nofollow noreferrer">http://sourceforge.net/project/showfiles.php?group_id=131922</a></p>
<p>I'... | <p>It's been ages since I've done any Win32 coding, but AFAIK, WMF as a format is basically a list of GDI commands and their parameters which would explain why it is much more efficient to encode...</p>
<p>You'd probably need to hook into the top level GDI context (just as Remote Desktop does, I guess) and capture the... | 8,900 |
<p>What's the simplest SQL statement that will return the duplicate values for a given column and the count of their occurrences in an Oracle database table?</p>
<p>For example: I have a <code>JOBS</code> table with the column <code>JOB_NUMBER</code>. How can I find out if I have any duplicate <code>JOB_NUMBER</code>... | <p>Aggregate the column by COUNT, then use a HAVING clause to find values that appear greater than one time.</p>
<pre><code>SELECT column_name, COUNT(column_name)
FROM table_name
GROUP BY column_name
HAVING COUNT(column_name) > 1;
</code></pre>
| <p>Also u can try something like this to list all duplicate values in a table say reqitem</p>
<pre><code>SELECT count(poid)
FROM poitem
WHERE poid = 50
AND rownum < any (SELECT count(*) FROM poitem WHERE poid = 50)
GROUP BY poid
MINUS
SELECT count(poid)
FROM poitem
WHERE poid in (50)
GROUP BY poid
HAVING ... | 8,379 |
<p>I've bought a new type of filament (GreenTEC Pro Natural) for my Anycubic Mega i3 to print some food-safe cookie cutters. Now I have changed the print settings to an extruder temperature of 210 °C and a heated bed temperture of 60 °C and everything works well.</p>
<p>But when I look at the print, ... | <p>Check your retraction settings.. It's either too far or one of your priming/wipe settings is off, some slicers call it priming or extra restart distance. </p>
<p>Your linear advance "k" might be set wrong if you're using linear advance. </p>
<p>I see a bit of under-extrusion on the between walls and center, your... | <p>I think there's a retraction issue(had the same issue). You need to change retraction and check whether there are any improvements. Some times different filament types need slight filament setting calibration.</p>
| 1,525 |
<p>Given our successful private beta, soon after we go public it will be time for us to get our first crop of moderators, as explained in the <a href="http://blog.stackoverflow.com/2010/07/moderator-pro-tempore/">“Moderator Pro Tempore” blog post</a>:</p>
<blockquote>
<p>About a week into the public beta, we will se... | <p>I would like to nominate myself, <a href="https://stackexchange.com/users/526476/matt-clark">Matt Clark</a>.</p>
<p><a href="http://stackexchange.com/users/526476/matt-clark"><img src="http://stackexchange.com/users/flair/526476.png" width="208" height="58" alt="profile for Matt Clark on Stack Exchange, a network o... | <p>I would like to nominate myself for a moderator, I think I'd be up for the job.</p>
<p><a href="http://stackexchange.com/users/6668626/chase-cromwell">http://stackexchange.com/users/6668626/chase-cromwell</a></p>
<p>I'm probably not the best candidate and I'm not super active in meta or Stack Exchange, but I'm bec... | 4 |
<p>I have the ISO week and year but how do I correctly convert that into two dates representing the start and end of that week?</p>
| <p><code>ffmpeg</code> is a general purpose (de)muxer/transcoder. <code>MP4Box</code> is a (de)muxer/transcoder from <a href="http://gpac.wp.institut-telecom.fr/mp4box/" rel="nofollow noreferrer">GPAC</a>, a package dedicated to MP4 related software tech. Right now it seems wiser to use MP4Box because it writes the moo... | <p>Just use any mp4-Muxer like Yamb to create an <code>mp4</code>-file with only the <code>aac</code> audio track in it, then change the file extension to <code>m4a</code>.</p>
| 9,592 |
<p>I've got a div that uses overflow:auto to keep the contents inside the div as it is resized and dragged around the page. I'm using some ajax to retrieve lines of text from the server, then append them to the end of the div, so the content is growing downwards. Every time this happens, I'd like to use JS to scroll th... | <p><code>scrollHeight</code> should be the total height of content. <code>scrollTop</code> specifies the pixel offset into that content to be displayed at the top of the element's client area.</p>
<p>So you really want (still using jQuery):</p>
<pre><code>$("#thediv").each( function()
{
// certain browsers have a... | <p>I had a div wrapping 3 divs that were floating left, and whose contents were being resized. It helps to turn funky-colored borders/background on for the div-wrapper when you try to resolve this. The problem was that the resized div-content was overflowing outside the div-wrapper (and bled to underneath the area of... | 3,432 |
<p>I've recently switched from being an employee of a small consulting company to being an independent consultant and as time goes on I will need to upgrade Windows and Visual Studio. So what is the most affordable way to go about this for a small time developer?</p>
<p>My previous boss suggested I get a TechNet Plus ... | <p>I recommend that if VS Express is not good enough, use Professional. Standard is missing some really useful features, like a Remote Debugger. Here is a detailed comparison:</p>
<p><a href="http://msdn.microsoft.com/en-us/vs2008/products/cc149003.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/vs2008... | <p>I think that Visual Studio Professional with MSDN Subscription doesn't offer much value compared to just purchasing Visual Studio 2010 Pro. You get testing licenses for Windows Server and MSSQL, but that's it. And you can get by just fine without those 90% of the time.</p>
<p>But Visual Studio Premium with MSDN is ... | 4,385 |
<p>For example, <a href="http://developer.apple.com/cocoa/pyobjc.html" rel="nofollow noreferrer">http://developer.apple.com/cocoa/pyobjc.html</a> is still for OS X 10.4 Tiger, not 10.5 Leopard.. And that's the official Apple documentation for it..</p>
<p>The official PyObjC page is equally bad, <a href="http://pyobjc.... | <p>I agree that that tutorial is flawed, throwing random, unexplained code right in front of your eyes. It introduces concepts such as the autorelease pool and user defaults without explaining why you would want them ("Autorelease pool for memory management" is hardly an explanation).</p>
<p>That said…</p>
<blockquot... | <p>This answer isn't going to be very helpful but, as a developer I hate doing documentation. This being a opensource project, it's hard to find people to do documentation.</p>
| 3,524 |
<p>What is the best way to refactor the attached code to accommodate multiple email addresses?</p>
<p>The attached HTML/jQuery is complete and works for the first email address. I can setup the other two by copy/pasting and changing the code. But I would like to just refactor the existing code to handle multiple email... | <p>Instead of using IDs for your email fields, you can give them each a class:</p>
<pre><code><div>
<label for="Email_Address_1">Friend #1</label></div>
<input type="text" class="email">
<span></span>
</div>
<div>
<label for="Email_Address_2">... | <p>Thanks! Here is the completed refactor with your suggested changes.</p>
<pre><code><script language="javascript">
$(document).ready(function() {
$('#Email_Address_1').keyup(function(){Update_Email_Validate_Status(this)});
$('#Email_Address_2').keyup(function() { Update_Email_Va... | 9,456 |
<p>I am on the hunt for CAD packages which can perform some level of slicing as an inherent model feature, instead of either exporting to STL and then importing into the slicer (a la OnShape) or directly opening the slicer from within the software (a la Fusion 360). I would like this because I want to model directly fo... | <p>Blender has a CNC slicer plugin, it's not exactly what you're asking for but it can perform some of the tasks that you're asking for.</p>
<p><a href="https://sourceforge.net/projects/cnc-slicer-blender-plugin/" rel="nofollow noreferrer">CNC slicer for Blender</a></p>
| <p>Microsoft 3d builder will do it. It's far from the best CAD or Printing software though. Works very well for what it is.</p>
| 2,172 |
<p>Now, before you say it: I <strong>did</strong> Google and my <code>hbm.xml</code> file <strong>is</strong> an Embedded Resource. </p>
<p>Here is the code I am calling:</p>
<pre><code>ISession session = GetCurrentSession();
var returnObject = session.Get<T>(Id);
</code></pre>
<p>Here is my mapping file for ... | <p>Sounds like you forgot to add a mapping assembly to the session factory configuration..</p>
<p>If you're using app.config...</p>
<pre><code>.
.
<property name="show_sql">true</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<mapping ... | <p>Had a similar problem when find an object by id...
All i did was to use the fully qualified name in the class name. That is
Before it was :</p>
<pre><code>find("Class",id)
</code></pre>
<p>Object so it became like this : </p>
<pre><code>find("assemblyName.Class",id)
</code></pre>
| 8,222 |
<p>Has anybody experience in building a custom style in Qt? What I have in my mind is a complete new style that affects all kind of widgets. I have seen some examples in the web for a custom combo box. But I have no idea how much time and code it takes to build a "complete" new custom style ... maybe someone can give m... | <p>Check out the <a href="http://doc.qt.io/qt-4.8/stylesheet.html" rel="nofollow noreferrer">Stylesheets</a> facility in Qt 4. While it's still a hassle, it's way easier than doing a full-on custom style. You can just adjust one visual facet at a time and try it out.</p>
<p>It pays attention to inheritance. So if y... | <p>If you don't need to radically change the widget style, you might want to try using widget style sheets:</p>
<pre><code> http://doc.qt.digia.com/4.4/stylesheet.html
</code></pre>
| 9,236 |
<p>Is there a way to run a regexp-string replace on the current line in the bash?</p>
<p>I find myself rather often in the situation, where I have typed a long commandline and then realize, that I would like to change a word somewhere in the line.</p>
<p>My current approach is to finish the line, press <kbd>Ctrl</kbd... | <p>G'day,</p>
<p>What about using vi mode instead? Just enter set -o vi</p>
<p>Then you can go to the word you want to change and just do a cw or cW depending on what's in the word?</p>
<p>Oops, forgot to add you enter a ESC k to o to the previous line in the command history.</p>
<p>What do you normally use for an... | <p>G'day,</p>
<p>What about using vi mode instead? Just enter set -o vi</p>
<p>Then you can go to the word you want to change and just do a cw or cW depending on what's in the word?</p>
<p>Oops, forgot to add you enter a ESC k to o to the previous line in the command history.</p>
<p>What do you normally use for an... | 4,788 |
<p>Winform on CF is a bit heavy, initialising a lot of windows handles takes serious time and memory. Another issue is the lack of inbuilt double buffering and lack of control you have over the UI rendering means that during processor intensive operations the UI might leave the user staring at a half rendered screen. N... | <p>I ran across this the other day, which might be helpful at least as a starting point: <a href="http://fluid.codeplex.com/" rel="nofollow noreferrer">Fuild - Windows Mobile .NET Touch Controls</a>. The look and feel is nice, but there is no design time support. I don't know too much about memory footprint, etc but ev... | <p>Actually, you can override the paint event.</p>
<p>And the idea is that you offload long-running operations to a separate thread. That's no different from any other event-driven framework, really. <em>Anything</em> that relies on a handling a Paint event is going to be susceptible to that.</p>
<p>Also, there's n... | 5,322 |
<p>I've been trying to come up with a way to create a 3 column web design where the center column has a constant width and is always centered. The columns to the left and right are variable. This is trivial in tables, but not correct semantically. </p>
<p>I haven't been able to get this working properly in all curr... | <p>Use <a href="http://matthewjamestaylor.com/blog/perfect-3-column.htm" rel="nofollow noreferrer">this technique</a>, and simply specify a fixed width for the centre column.</p>
| <p>I think you'd need to start off with initial (fixed) widths for both sidebar columns and then, when the page loads, use javascript to get the window width and calculate the new width of the sidebars.</p>
<p>sidebar width = (window width - center column width) / 2</p>
<p>You could then reapply the javascript if the... | 9,875 |
<p>Bought a new printer. When this problem has happened anywhere from the third to the twentieth layer up. An excess of filament suddenly exits the nozzle, often pulling the print from the bed when the nozzle moves away. The only advice I've found so far is that the nozzle or hotend may have damage, but I didn't find a... | <p>For casings I use a combination of TPU and PETG or PLA. PETG shell gives it rigidity and TPU gives it a bit of impact protection. So corners and inside layers of TPU within a hard PETG or PLA shell (shell has no corners).</p>
<p>I haven't had a problem with either but obviously PLA won't withstand heat very well, so... | <p>If you just cared about impact resistance of the housing itself, the clear choice would be TPU, which would be basically indestructible. However, the housing is there to protect what's inside - not only from impact, but from stresses (e.g. bending) that could break it. This means you need a material that both provid... | 2,140 |
<p>I am coding a client-server application using Eclipse's RCP.
We are having trouble testing the interaction between the two sides
as they both contain a lot of GUI and provide no command-line or other
remote API.</p>
<p>Got any ideas?</p>
| <p>I have about 1.5 years worth of experience with the RCP framework, I really liked it. We simply JUnit for testing...</p>
<p>It's sort of cliche to say, but if it's not easy to test, maybe the design needs some refactoring?</p>
<p>Java and the RCP framework provide great facilities for keeping GUI code and logic co... | <p>Separate your client-server communication into a pure logic module (or package). Test this separately - either have a test server, or use mock objects.</p>
<p>Then, have your UI actions invoke the communications layer. Also, have a look at the <a href="http://en.wikipedia.org/wiki/Command_pattern" rel="nofollow nor... | 5,157 |
<p>How do I multiply 10 to an <code>Integer</code> object and get back the <code>Integer</code> object?</p>
<p>I am looking for the neatest way of doing this.</p>
<p>I would probably do it this way:
Get int from <code>Integer</code> object, multiply it with the other int and create another Integer object with this in... | <p>With Java 5's <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html" rel="nofollow noreferrer">autoboxing</a>, you can simply do:</p>
<pre><code>Integer a = new Integer(2); // or even just Integer a = 2;
a *= 10;
System.out.println(a);
</code></pre>
| <p>toolkit's answer above is correct and the best way, but it doesn't give a full explanation of what is happening.
Assuming Java 5 or later:</p>
<pre><code>Integer a = new Integer(2); // or even just Integer a = 2;
a *= 10;
System.out.println(a); // will output 20
</code></pre>
<p>What you need to know is that this ... | 6,799 |
<p>I'm currently writing a TYPO3 extension which is configured with a list of <code>tt_content</code> UID's.
These point to content elements of type "text" and i want to render them by my extension.</p>
<p>Because of TYPO3s special way of transforming the text you enter in the rich text editing when it enters the data... | <p>I had the same problem a couple of months ago. Now I must say that I am no typo3 developer, so I don't know if this is the right solution.</p>
<p>But I used something like this:</p>
<p><code>$output .= $this->pi_RTEcssText( $contentFromDb );</code></p>
<p>in my extension and it works.</p>
| <h2>PHP</h2>
<p>That works for me; it renders any content element with the given ID:</p>
<pre><code>function getCE($id)
{
$conf['tables'] = 'tt_content';
$conf['source'] = $id;
$conf['dontCheckPid'] = 1;
return $GLOBALS['TSFE']->cObj->cObjGetSingle('RECORDS', $conf);
}
</code></pre>
<p>See <a h... | 9,669 |
<p>Are there any statistics regarding how many units each manufacturer has sold, e.g. in 2019?</p>
<p><a href="https://3dprinterchat.com/top-selling-3d-printers/" rel="nofollow noreferrer">An article</a> from 2016 claims Monoprice to have led the market back then - but all of the printers in that article have become o... | <p>Getting this data is not easy. Many companies that make 3D printers are either private companies that do not report results or are larger companies where 3D printers are one of many products they manufacture. Some companies study this information through mining public sources and surveying users for their opinions... | <p>For sales figures of the smaller companies; it is very difficult because they don't publish (esp the Chinese brands). For the larger organizations there is </p>
<p>The Wholler's Report <a href="https://wohlersassociates.com/2019report.htm" rel="nofollow noreferrer">https://wohlersassociates.com/2019report.htm</a></... | 1,557 |
<p>I'm trying to connect my PC to my Anet A8 through <a href="https://www.pronterface.com/" rel="nofollow noreferrer">Pronterface</a> on Ubuntu.</p>
<p>But when I'm clicking on the "connect" button in Pronterface, all I see is "<em>Connecting ...</em>".</p>
<p>What I did so far</p>
<ul>
<li>added my... | <p>I have this printer and used this board many times over USB.</p>
<p>The genuine Arduino boards use the FTDI FT232RL to convert USB signals to UART signals.</p>
<p>The problem with these Arduino based clone boards is that they do not use the FTDI chips as these are too expensive. These boards use a CH340G chip which ... | <p>You may need to install a device driver for the USB interface chip that your printer uses. I'm guessing that the Anet A8 uses a clone of the FTDI FT232RL chip (which was and may still be common with cheap Chinese printers).</p>
<p>If this is the case, you will need to install the appropriate driver from this site: <... | 1,749 |
<p>For debugging and testing I'm searching for a JavaScript shell with auto completion and if possible object introspection (like ipython). The online <a href="http://www.squarefree.com/shell/" rel="nofollow noreferrer">JavaScript Shell</a> is really nice, but I'm looking for something local, without the need for an br... | <p>Rhino Shell since 1.7R2 has support for completion as well. You can find more information <a href="http://blog.norrisboyd.com/2009/03/rhino-17-r2-released.html" rel="noreferrer">here</a>.</p>
| <p><a href="http://code.google.com/p/jslibs/" rel="nofollow">jslibs</a> (a standalone javascript runtime) could also be suitable for this purpose.</p>
| 6,250 |
<p>Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of data on a web-page with XSL over ASP.NET MVC?</p>
<p>The two alternatives are:</p>
<ol>
<li><p><strong>ASP.NET (MVC/WebForms) with XSL</strong><br/>
Getting the data from the database and transforming it to XML which is then d... | <p>I can see the main benefit of employing XSLT to transform your data and display it to the user would be the following:</p>
<ul>
<li>The data is already in an XML format</li>
<li>The data follows a well defined schema (this makes using tools like XMLSpy much easier).</li>
<li>The data needs to be transformed into a ... | <p>If you only going to display data from DB XSL templates may be convenient solution, but if you gonna handle user interaction. Hm... I don't think it'll be maintainable at all.</p>
| 6,043 |
<p>We create new sites in IIS 6 (Windows Server 2003) using IIS Manager. When these sites are created in IIS 6, the ASP.NET version defaults to ASP.NET 1.1. We would like it to default to ASP.NET 2.0. The reason this is a problem for us is that when you take any site on the server and switch the ASP.NET version from... | <p>As already mentioned by another, I reference this <a href="http://weblogs.asp.net/owscott/archive/2006/05/30/ASPNet_5F00_regiis.exe-tool_2C00_-setting-the-default-version-without-forcing-an-upgrade-on-all-sites.aspx" rel="noreferrer">post</a> whenever I need to change the .NET settings for a site.</p>
<p>As for you... | <p>Simple answer: Open IIS Manager. In navigation pane, find the .NET2 web site and right click on it. Select "Properties". Then select "ASP.NET" tab. First dropdown on that screen gives you option to select a different version of .NET.</p>
<p>Please be aware -- when I did this, all of the web sites on the web se... | 8,979 |
<p>So we've discussed logging in passing at my place of work and I was wondering if some of you guys here could give me some ideas of your approaches?</p>
<p>Typically our scenario is, no logging really at all, and mostly .NET apps, winforms/WPF clients talking through web services or direct to a db.</p>
<p>So, the r... | <p>The key thing for logging is good planning. I would suggest that you look into the enterprise library exception and logging application block (<a href="http://msdn.microsoft.com/en-us/library/cc467894.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/cc467894.aspx</a>). There is a wee bit of a ... | <p>Thanks guys, lot of good info, but Martin has given me a bit more detail on how to proceed. I'll give him the answer, as it seems like now we're off the front few pages answers will drop off.</p>
| 5,644 |
<p>Anet A8 printer, Github Marlin, Repetier Host, Cura slicer</p>
<p>Just setting up printer and printed 20mm calibration cube from Thingiverse. X,Y,Z & E not too far off but not quite right (centre hole was oval not round) X19.5mm, Y19.5mm & Z20mm.</p>
<p>Followed Youtube calibration help and updated firmwar... | <p>If you have a stock printer, your calibration values should be stock - i.e. 100 steps/mm for X/Y. Also, as an extra hint, X and Y steps should be identical since the mechanics are identical (unless you swapped out one of the motors or drive gears).</p>
<p>It sounds like you have Y correct, but something wrong with ... | <p>There could be a number of issues causing this.</p>
<p>Since you just set it up here is a list of questions for you to go through:</p>
<ul>
<li>Are your belts tightened? (With an additional belt tightener)</li>
<li>Are your carriages are sliding smoothly?</li>
</ul>
<p>Both might cause some irregular movements ex... | 799 |
<p>So I'm interested in hearing different thoughts about what is the best way to go about unit testing XNA Game/Applications. Astute googlers can probably figure out why I'm asking, but I didn't want to bias the topic :-)</p>
| <p>I would that this question is geared more toward the approach of <strong>unit testing in game development</strong>. I mean, XNA is a framework. Plug in <a href="http://www.nunit.org/index.php" rel="nofollow noreferrer">NUnit</a>, and begin writing test cases while you develop. </p>
<p><a href="https://stackoverfl... | <p>I know this is an old post, but for other people wondering how to best go about testing their XNA Games, there is another option. The built-in testing in Visual Studio is definitely great, but is not well suited for games. Everytime a value is needed, you have to pause the game, and then either hover over the variab... | 5,283 |
<p>My end goal is getting high quality dash footage from a 6 month road trip I'm going on. From my research, very few dash cams support 4k 30fps filming, and the ones that do overwrite their own footage really quick, so instead of that I'd like to use my iPhone. I have a wide angle lens for it, and I figure I can mount... | <p>You'd <a href="https://3dprinting.stackexchange.com/questions/6119/can-you-put-pla-parts-in-your-car-in-the-sun">need to print in a heat resistant material</a> - ASA for example - and design the part for your needs, but this project is certainly feasible and doable with 3D printing. If that isn't enough for you, you... | <p>Why not try a GoPro camera? They now have 4K, image stabilized camera with all kinds of accessory mounts.</p>
<p><a href="https://shop.gopro.com/cameras/hero7-silver/CHDHC-601-master.html" rel="nofollow noreferrer">https://shop.gopro.com/cameras/hero7-silver/CHDHC-601-master.html</a></p>
| 1,398 |
<p>I'm hearing more and more about domain specific languages being thrown about and how they change the way you treat business logic, and I've seen <a href="http://ayende.com/blog/tags/domain-specific-languages" rel="noreferrer">Ayende's blog posts</a> and things, but I've never really gotten exactly why I would take m... | <p>DSL's are good in situations where you need to give some aspect of the system's control over to someone else. I've used them in Rules Engines, where you create a simple language that is easier for less-technical folks to use to express themselves- particularly in workflows.</p>
<p>In other words, instead of making ... | <p>DSL is basically creating your own small sublanguage to solve a specific domain problem. This is solved using method chaining. Languages where dots and parentheses are optional help make these expression seem more natural. It can also be similar to a builder pattern.
DSL aren't languages themselves, but rather a pat... | 6,312 |
<p>Maybe this is a silly question, but I've always assumed each number delineated by a period represented a single component of the software. If that's true, do they ever represent something different? I'd like to start assigning versions to the different builds of my software, but I'm not really sure how it should be... | <p>In version <em>1.9.0.1</em>:</p>
<ul>
<li><p><strong>1</strong>: Major revision (new UI, lots of new features, conceptual change, etc.)</p></li>
<li><p><strong>9</strong>: Minor revision (maybe a change to a search box, 1 feature added, collection of bug fixes)</p></li>
<li><p><strong>0</strong>: Bug fix release</p... | <p>A combination of major, minor, patch, build, security patch, etc.</p>
<p>The first two are major & minor-- the rest will depend on the project, company and sometimes community. In OS's like FreeBSD, you will have 1.9.0.1_number to represent a security patch.</p>
| 9,142 |
<p>I'm early in development on a web application built in VS2008. I have both a desktop PC (where most of the work gets done) and a laptop (for occasional portability) on which I use AnkhSVN to keep the project code synced. What's the best way to keep my development database (SQL Server Express) synced up as well?</p>
... | <p>There are obviously a number of ways to approach this, so I am going to list a number of links that should provide a better foundation to build on. These are the links that I've referenced in the past when trying to get others on the bandwagon.</p>
<ul>
<li><a href="https://web.archive.org/web/20210513230815/http:/... | <p>We use a combo of, taking backups from higher environments down.<br>
As well as using ApexSql to handle initial setup of schema.<br>
Recently been using Subsonic migrations, as a coded, source controlled, run through CI way to get change scripts in, there is also "tarantino" project developed by headspring out of te... | 6,222 |
<p>In a project that I'm about to wrap up, I've written and implemented an object-relational mapping solution for PHP. Before the doubters and dreamers cry out "how on earth?", relax -- I haven't found a way to make late static binding work -- I'm just working around it in the best way that I possibly can.</p>
<p>Anyw... | <p>In PHP you can pass a variable number of arguments to a function or method by using <a href="http://www.php.net/call_user_func_array" rel="noreferrer"><code>call_user_func_array</code></a>. An example for a method would be:</p>
<pre><code>call_user_func_array(array(&$stmt, 'bindparams'), $array_of_params);
</co... | <p>I am not allowed to edit, but I believe in the code</p>
<pre><code>call_user_func_array(array(&$stmt, 'bindparams'), $array_of_params);
</code></pre>
<p>The reference in front of $stmt is not necessary. Since <code>$stmt</code> is the object and <code>bindparams</code> is the method in that object, the refere... | 3,374 |
<p>Now that I know <code>C++</code> I want to get into desktop application that have a UI instead of <code>Command Prompt</code> stuff, where should I start?, and what are some good <strong>online</strong> resources?</p>
| <p><a href="http://www.wxwidgets.org/" rel="nofollow noreferrer">wxWidgets</a> is a cross platform GUI library for C++ (and other languages). The main site should have enough pointers to resources to get going.</p>
<p>You might also want to check out <a href="https://stackoverflow.com/questions/4347/where-is-a-good-pl... | <p>On Linux and maybe Windows, you can use <a href="http://gtk.org" rel="nofollow noreferrer">Gtk+</a> with <a href="http://glade.gnome.org/" rel="nofollow noreferrer">Glade</a>. Gtk+ is the GUI toolkit. Glade is a GUI drag and drop GUI editor. If you came from Windows or Java and thought GUI programming is hard, this ... | 7,071 |
<p>I'm trying to construct a find command to process a bunch of files in a directory using two different executables. Unfortunately, <code>-exec</code> on find doesn't allow to use pipe or even <code>\|</code> because the shell interprets that character first. </p>
<p>Here is specifically what I'm trying to do (whic... | <p>Try this</p>
<pre><code>find /path/to/jpgs -type f -exec sh -c 'jhead -v {} | grep 123' \; -print
</code></pre>
<p>Alternatively you could try to embed your exec statement inside a sh script and then do:</p>
<pre><code>find -exec some_script {} \;
</code></pre>
| <p>There is kind of another way you can do it but it is also pretty ghetto.</p>
<p>Using the shell option extquote you can do something similar to this in order to make find exec stuff and then pipe it to sh.</p>
<pre><code>root@ifrit findtest # find -type f -exec echo ls $"|" cat \;|sh
filename
</code></pre>
<p><br... | 8,739 |
<p>A basic problem I run into quite often, but ever found a clean solution to, is one where you want to code behaviour for interaction between different objects of a common base class or interface. To make it a bit concrete, I'll throw in an example;</p>
<p><em>Bob has been coding on a strategy game which supports "co... | <p>Terrain has-a Terrain Attribute </p>
<p>Terrain Attributes are multidimensional. </p>
<p>Units has-a Propulsion.</p>
<p>Propulsion is compatible able with Terrain Attributes.</p>
<p>Units move by a Terrain visit with Propulsion as an argument.
That gets delegated to the Propulsion.</p>
<p>Units <em>may</em> get... | <p>Old idea:</p>
<blockquote>
<p>Make a class iTerrain and another
class iUnit which accepts an argument
which is the terrain type including a
method for affecting each unit type</p>
<p>example:</p>
<pre> <code> boat = new
iUnit("watercraft") field = new
iTerrain("grass")
field.effects(boat)</code></pre>... | 9,401 |
<p>I'm working with a large (270+ project) VS.Net solution. Yes, I know this is pushing the friendship with VS but it's inherited and blah blah. Anyway, to speed up the solution load and compile time I've removed all projects that I'm not currently working on... which in turn has removed those project references from... | <p>These solutions come to my mind:</p>
<ul>
<li>You can try to use <a href="http://www.dependencywalker.com" rel="nofollow noreferrer">Dependency Walker</a> or similar program to analyze dependecies.</li>
<li>Parse MSBuild files (*.csproject) to get list of dependencies</li>
</ul>
<p><strong>EDIT:</strong><br>
Just ... | <p>One thing you can try is opening up the old .csproj file in notepad and replacing the ProjectReference tags with Reference tags. If you can write a parser, feel free to share. :)</p>
<p>Entry in .csproj file if it is a project reference</p>
<pre><code> <ItemGroup>
<ProjectReference Include="..\Window... | 7,753 |
<p>Is there a maintained package I can use to retrieve and set MP3 ID3 metadata using Python?</p>
| <p>I used <a href="http://eyed3.nicfit.net/" rel="noreferrer">eyeD3</a> the other day with a lot of success. I found that it could add artwork to the ID3 tag which the other modules I looked at couldn't. You'll have to install using pip or download the tar and execute <code>python setup.py install</code> from the sou... | <p>It can depend on exactly what you want to do in addition to reading the metadata. If it is just simply the bitrate / name etc. that you need, and nothing else, something lightweight is probably best.</p>
<p>If you're manipulating the mp3 past that PyMedia may be suitable.</p>
<p>There are quite a few, whatever you... | 3,040 |
<p>I have an if statement with two conditions (separated by an OR operator), one of the conditions covers +70% of situations and takes far less time to process/execute than the second condition, so in the interests of speed I only want the second condition to be processed if the first condition evaluates to false.</p>
... | <p>For C, C++, C#, Java and other .NET languages boolean expressions are optimised so that as soon as enough is known nothing else is evaluated.</p>
<p>An old trick for doing obfuscated code was to use this to create if statements, such as:</p>
<pre><code>a || b();
</code></pre>
<p>if "a" is true, "b()" would never ... | <p>Since this is tagged language agnostic I'll chime in. For Perl at least, the first option is sufficient, I'm not familiar with PHP. It evaluates left to right and drops out as soon as the condition is met.</p>
| 5,534 |
<p>When designing parts that should either fit with external objects or other printed parts, what measures can one take to ensure that the dimensions of the final print are accurate and fit the other object?</p>
<p>To my knowledge, you at least have two options to account for printer inaccuracy and shrinkage:</p>
<ul... | <p>I think the best way to go about this would be to calibrate your printer and slicer as best you can. One of my pet peeves is when people upload STLs that have been adjusted to fit their printer/material. There are many suppliers of material that vary in quality as well as many materials and different printers that... | <p>A few suggestions I haven't seen explicitly stated in the other answers.</p>
<h1>Export resolution</h1>
<p>When you export your STL files you can increase the resolution. If dimensional accuracy is extremely critical, you'll want to confirm that the STL conversion process hasn't altered the dimensions of curved surf... | 154 |
<p>How can I create an empty one-dimensional string array?</p>
| <p>Dim strEmpty(-1) As String</p>
| <p>try this
Dim Arraystr() as String ={}</p>
| 6,645 |
<p>Is there anything special for printing TPU material e.g extruder or temperature?</p>
<p>It's my first time printing TPU material, so if you have any photos, it would be great if you can share them.</p>
| <p>Elastomers do much better on direct-drive heads (pulled to the head by the motor) than on Bowden designs (where the material is pushed to the head by a motor). This is because the flexible TPU or TPE can bend in the guide tube, causing lag during advance/retract changes, and sometimes even bind up during delivery.</... | <p>Flexible materials cause lot of issues if there is any space between extruder gear and PTFE tube. Since it is flexible it refuses to follow the path and starts bending around the opening. There are parts in Thingiverse that you can print to remove that distance. Additionally make sure that your extruder fan is worki... | 691 |
<p>The ones that stick out and make life usefull.</p>
| <p>Here is one for a testClass with Nunit support.</p>
<pre><code>
Imports Nunit.FrameWork
Namespace $NAMESPACE$
'''
''' A TestClass
'''
'''
_
Public Class $CLASSNAME$
#Region " Setup and TearDown "
'''
''' Sets up the Tests
'''
'''
_
... | <p>MSTest testclass. I like my testclass basic. Not like the one that is created by VS.</p>
<pre><code>Imports Microsoft.VisualStudio.TestTools.UnitTesting
<TestClass()> _
Public Class $ClassName$
$END$
End Class
</code></pre>
<p><code>$Classname</code> is "Current file name without extension" macro.</p>
| 4,714 |
<p>I want to write a little "DBQuery" function in perl so I can have one-liners which send an SQL statement and receive back and an array of hashes, i.e. a recordset. However, I'm running into an issue with Perl syntax (and probably some odd pointer/reference issue) which is preventing me from packing out the informati... | <p>The nested data structure contains a hash <em>reference</em>, not a hash.</p>
<pre><code># Will work (the -> dereferences the reference)
$row = $records[$index];
print "This will work: ", $row->{firstName}, "\n";
# This will also work, by promoting the hash reference into a hash
%row = %{ $records[$index] };... | <p>Also note a good perl idiom to use is</p>
<pre>for my $rowHR ( @records ) {
my %row = %$rowHR;
#or whatever...
}</pre>
<p>to iterate through the list.</p>
| 7,417 |
<p>How to successfully pause 3D printing and turn off the printer and the next day, continue to print the model?</p>
| <p>If you enable <code>M413</code> in Marlin firmware, the printer will write a resume printing file to SD card e.g. every layer.</p>
<p>From <a href="http://marlinfw.org/docs/gcode/M413.html" rel="nofollow noreferrer">M413 - Power-loss Recovery documentation</a> I quote:</p>
<blockquote>
<p>Enable or disable the Power... | <p>1) Cut the model up in several parts and print one each day. Remove each part every day and in the end, glue them all together.</p>
<p>2) Cut the model up in several parts and each day, add a G-code to the file to be printed so it lowers the heat-bed and thus starts to print on top of yesterdays print. This cannot ... | 1,404 |
<p>I found a bug in the Contains statement in Linq (not sure if it is really in Linq or Linq to SQL) and want to know if anyone else has seen this and if there is a fix or workaround.</p>
<p>If the querysource you do the contains with has more than 10 items in it, it does not pass the items correctly to the SQL query.... | <p>The more I look at it, and after running more tests, I'm thinking the bug may be in the Sql Server Query Visualizer plugin for Visual Studio, not actually in Linq to SQL itself. So it is not nearly as bad a situation as I thought - the query will return the right results, but you can't trust what the Visualizer is s... | <p>Try actually looking at the output from your datacontext before you pass judgement.</p>
<p>DataContext.Log() will give you the generated SQL.</p>
| 8,460 |
<p>I wanted some of those spiffy rounded corners for a web project that I'm currently working on.</p>
<p>I thought I'd try to accomplish it using javascript and not CSS in an effort to keep the requests for image files to a minimum (yes, I know that it's possible to combine all required rounded corner shapes into one ... | <p>How about this?</p>
<pre><code>var mozborderAvailable = false;
try {
if (typeof(document.body.style.MozBorderRadius) !== "undefined") {
mozborderAvailable = true;
}
} catch(err) {}
</code></pre>
<p>I tested it in Firefox 3 (true) and false in: Safari, IE7, and Opera.</p>
<p>(Edit: better undefined test)</... | <p>Apply CSS unconditionally and check <code>element.style.MozBorderRadius</code> in the script?</p>
| 3,868 |
<p>How can you import a foxpro DBF file in SQL Server?</p>
| <p>Use a linked server or use openrowset, example</p>
<pre><code>SELECT * into SomeTable
FROM OPENROWSET('MSDASQL', 'Driver=Microsoft Visual FoxPro Driver;
SourceDB=\\SomeServer\SomePath\;
SourceType=DBF',
'SELECT * FROM SomeDBF')
</code></pre>
| <p>This tools allows you to import to and from SQL Server.</p>
<ul>
<li><a href="http://www.download3000.com/download_17933.html" rel="nofollow noreferrer">http://www.download3000.com/download_17933.html</a></li>
</ul>
| 7,615 |
<p>In the Windows applications I work on, we have a custom framework that sits directly above Win32 (don't ask). When we create a window, our normal practice is to put <code>this</code> in the window's user data area via <code>SetWindowLong(hwnd, GWL_USERDATA, this)</code>, which allows us to have an MFC-like callback... | <p><a href="http://msdn.microsoft.com/en-us/library/ms644898%28VS.85%29.aspx" rel="noreferrer">SetWindowLongPtr</a> was created to replace <a href="http://msdn.microsoft.com/en-us/library/ms633591%28VS.85%29.aspx" rel="noreferrer">SetWindowLong</a> in these instances. It's LONG_PTR parameter allows you to store a poin... | <p>The other alternative is SetProp/RemoveProp (When you are subclassing a window that already uses GWLP_USERDATA)</p>
<p>Another good alternative is ATL style thunking of the WNDPROC, for more info on that, see</p>
<ul>
<li><a href="http://www.ragestorm.net/blogs/?cat=20" rel="noreferrer">http://www.ragestorm.net/bl... | 4,307 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.