instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>I'm importing some data from a <code>CSV</code> file, and numbers that are larger than <code>1000</code> get turned into <code>1,100</code> etc. </p> <p>What's a good way to remove both the quotes and the comma from this so I can put it into an <code>int</code> field?</p> <p><strong>Edit:</strong> </p> <p>The dat...
<p>My guess here is that because the data was able to import that the field is actually a varchar or some character field, because importing to a numeric field might have failed. Here was a test case I ran purely a MySQL, SQL solution.</p> <ol> <li><p>The table is just a single column (alpha) that is a varchar.</p> ...
<p>Daniel's and Eldila's answer have one problem: They remove all quotes and commas in the whole file.</p> <p>What I usually do when I have to do something like this is to first replace all separating quotes and (usually) semicolons by tabs. </p> <ul> <li><em>Search:</em> ";"</li> <li><em>Replace:</em> \t</li> </ul> ...
2,947
<p>I'm integrating .NET support into our C++ application.<br /> It's an old-school MFC application, with 1 extra file compiled with the "/clr" option that references a CWinFormsControl.</p> <p>I'm not allowed to remove the linker flag "/NODEFAULTLIB".<br /> (We have our own build management system, not Visual Studio's...
<p>I would also suggest checking out the SharePoint Content Deployment Wizard by Chris O'Brien. <a href="http://www.codeplex.com/SPDeploymentWizard" rel="nofollow noreferrer">http://www.codeplex.com/SPDeploymentWizard</a> </p> <p>Should help smooth the process you describe, and it's a nice tool for your kitbag regardl...
<p>We have a BizTalk 2006 with Web Application and Several WebServices that need to go from Dev to UAT to Live.</p> <p>We use MSBuild right from within VS to build, run tests, dependent on test result, complie, zip and ship to servers.</p> <p>Small MSBuild script on server to unzip, move the files, install clean web ...
3,094
<p>I read that PTFE starts to deteriorate past 260&nbsp;&deg;C. Does that mean heating to 250&nbsp;&deg;C is no problem at all, or will that destroy the PTFE material over time to?</p>
<p>Degradation starts at 260&nbsp;&deg;C and shifts towards full blown decomposition towards 350&nbsp;&deg;C. 250&nbsp;&deg;C is technically fine, but you should keep in mind that you've got little to no wiggle room for error at that temperature. Your thermistor and board may not be accurate enough to guarantee you'll ...
<p>High temperature rated PTFE tape is rated for up to 288°C (550°F).</p>
1,337
<p>Assuming you have a high quality printer with a fast processor, will you see a noticeable improvement by upgrading from 16X/32X microstepping drivers to 64X/128X microstepping drivers? (e.g. smoother surface finish). In what ways do they perform differently from the more common 16X or 32X stepper drivers. I'm thin...
<p>You will likely not see a noticeable improvement by upgrading from a 16x or 32x to a 64x or 128x microstepping driver. Depending on the motors you're driving and the size of the load you could actually see a decrease in quality.</p> <p>Although microstepping increases theoretical resolution it does not necessarily ...
<p>Prints benefit from higher microstepping in two ways:</p> <p><strong>Noise level</strong></p> <p>Using microstepping reduces noise from your printer's operation.</p> <p><strong>Print quality</strong></p> <p>Using higher resolution microstepping does not increase the physical accuracy of your prints meaningfully,...
112
<p>I'm trying to find a way to validate a large XML file against an XSD. I saw the question <a href="https://stackoverflow.com/questions/15732/whats-the-best-way-to-validate-an-xml-file-against-an-xsd-file">...best way to validate an XML...</a> but the answers all pointed to using the Xerces library for validation. The...
<p>Instead of using a DOMParser, use a SAXParser. This reads from an input stream or reader so you can keep the XML on disk instead of loading it all into memory.</p> <pre><code>SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(true); factory.setNamespaceAware(true); SAXParser parser =...
<p>SAX and libXML will help, as already mentioned. You could also try increasing the maximum heap size for the JVM using the -Xmx option. E.g. to set the maximum heap size to 512MB: <code>java -Xmx512m com.foo.MyClass</code></p>
6,189
<p>We have a Windows Service written in C#. The service spawns a thread that does this: </p> <pre><code>private void ThreadWorkerFunction() { while(false == _stop) // stop flag set by other thread { try { openConnection(); doStuff(); closeConnection(); } catch (Exception ex) ...
<p>Dig in and find out? Stick a debugger on that bastard!</p> <p>I can see at least the following possibilities:</p> <ol> <li>the logging system hangs;</li> <li>the thread exited just fine but the service is still running because some other part has a logic error.</li> </ol> <p>And maybe, but almost certainly not, t...
<p>Have you tried using <a href="http://msdn.microsoft.com/en-us/library/system.threading.monitor.pulse.aspx" rel="nofollow noreferrer">Monitor.Pulse</a> (ensure your thread is using thread management before running this) to get the thread to do something? If that works, then you're going to have to look a bit more in...
4,965
<p>Some electronics come as a single PCB. They have CPU and everything on just one board.</p> <p>Other electronics are a shield for an Arduino. So these are always two boards. The Arduino and the other PCB.</p> <p>You probably don't want to exchange the Arduino unless it is broken. Does it break that often or are the...
<p>Many 3d printer motherboards are based on Arduino/Atmega microcontroller and just add some stepper motor drivers, MOSFETs and such in a single board. That explains why you use the Arduino IDE to update or modify their firmware.</p> <p>Now why you would want to use an Arduino + an Arduino shield board like RAMPS? We...
<p>There isn't really a big advantage to one solution or the other. The approach of having separate boards means it is more modular and broken parts can be replaced more easily, but electronics don't break on their own: it is almost always user error. If you are even a tiny bit careful when assembling your electronics,...
189
<p>I am aware that in <a href="http://en.wikipedia.org/wiki/.NET_Framework" rel="noreferrer">.NET</a> there are three timer types (see <em><a href="http://msdn.microsoft.com/en-us/magazine/cc164015.aspx" rel="noreferrer">Comparing the Timer Classes in the .NET Framework Class Library</a></em>). I have chosen a threaded...
<p>You can use something like <code>Console.ReadLine()</code> to block the main thread, so other background threads (like timer threads) will still work. You may also use an <a href="https://learn.microsoft.com/en-us/dotnet/api/system.threading.autoresetevent" rel="noreferrer">AutoResetEvent</a> to block the execution,...
<p>According to <a href="https://learn.microsoft.com/en-us/dotnet/api/system.threading.timer?view=net-5.0" rel="nofollow noreferrer">MSDN</a> and the other answers, a minimal working example of a Console application using a System.Threading.Timer without exiting immediately :</p> <pre><code>private static void Main() {...
2,243
<p>Looking for a string to pass to String#matches(String) that will match IPv4, and another to match IPv6.</p>
<pre><code>public static final String IPV4_REGEX = "\\A(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\z"; public static final String IPV6_HEX4DECCOMPRESSED_REGEX = "\\A((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?) ::((?:[0-9A-Fa-f]{1,4}:)*)(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4...
<p>The regex allows the use of leading zeros in the IPv4 parts.</p> <p>Some Unix and Mac distros convert those segments into octals.</p> <p>I suggest using <code>25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d</code> as an IPv4 segment.</p>
6,819
<p>I have a Tomcat Filter that delegates requests to the a handling object depending on the URL. This is the only filter in the <code>FilterChain</code>. I have an Ajax app that hammers this filter with lots of requests.</p> <p>Recently I noticed an issue where the filter's <code>doFilter</code> method is often called...
<p>I have tried using Tomcat 6.16 and 6.18. This is definitely is the only filter in the chain.</p> <p>It seems that something is keeping a reference to the servlet outputStream. I wrapped the ServletOutputStream in my own OutputStream and then made sure the reference is destroyed. This fixed the issue so that I no lo...
<p>What version of Tomcat are you using? To me this sounds like a bug in Tomcat, I can't think of any reason why your doFilter method should be called with a response that's already been committed (if that filter is the only one in the chain, are you sure about this?). </p>
6,721
<p>From the <em>Immediate Window</em> in Visual Studio: </p> <pre><code>&gt; Path.Combine(@"C:\x", "y") "C:\\x\\y" &gt; Path.Combine(@"C:\x", @"\y") "\\y" </code></pre> <p>It seems that they should both be the same. </p> <p>The old FileSystemObject.BuildPath() didn't work this way...</p>
<p>This is kind of a philosophical question (which perhaps only Microsoft can truly answer), since it's doing exactly what the documentation says.</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.io.path.combine.aspx" rel="noreferrer">System.IO.Path.Combine</a></p> <p>"If path2 contains an absolute path...
<p>This \ means "the root directory of the current drive". In your example it means the "test" folder in the current drive's root directory. So, this can be equal to "c:\test".</p>
7,652
<p>I have a tree structure in memory that I would like to render in HTML using a Django template. </p> <pre><code>class Node(): name = "node name" children = [] </code></pre> <p>There will be some object <code>root</code> that is a <code>Node</code>, and <code>children</code> is a list of <code>Node</code>s. <cod...
<p>I think the canonical answer is: "Don't".</p> <p>What you should probably do instead is unravel the thing in your <em>view</em> code, so it's just a matter of iterating over (in|de)dents in the template. I think I'd do it by appending indents and dedents to a list while recursing through the tree and then sending t...
<p>I had a similar issue, however I had first implemented the solution using JavaScript, and just afterwards considered how I would have done the same thing in django templates.</p> <p>I used the serializer utility to turn a list off models into json, and used the json data as a basis for my hierarchy.</p>
5,200
<p>Here's the thing I want to print.</p> <p><a href="https://i.stack.imgur.com/4bgNK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4bgNK.png" alt="enter image description here"></a></p> <p>The red ring is 3.5&nbsp;mm above the bottom of the orange cylinder. The red ring is 1cm thick. I'd prefer n...
<p>You can print the support as a separate piece, then when the time is right pause the print, insert the support part into the ring and the resume printing. I guess you might have to use PVA glue on the support to ensure that it comes off easily when the time is right, but I'll leave that experimentation up to you. No...
<p>Assuming that the red flange needs to be flat on both sides, your best approach for printing in two parts may be a 45 degree conical cut through the flange. This will allow both parts to be printed flat on the bed, and (assuming a low layer height) should give a tolerable overhang result.</p>
1,422
<p>I want to use the functions exposed under the OpenGL extensions. I'm on Windows, how do I do this?</p>
<p><strong>Easy solution</strong>: Use <a href="http://glew.sourceforge.net/" rel="nofollow noreferrer">GLEW</a>. See how <a href="https://stackoverflow.com/questions/17370/using-glew-to-use-opengl-extensions-under-windows">here</a>.</p> <p><strong>Hard solution</strong>: If you have a <strong>really strong reason</st...
<p>@Kronikarz: From the looks of it, <strong>GLEW</strong> seems to be the way of the future. NVIDIA already ships it along with its <strong><a href="http://developer.nvidia.com/object/sdk_home.html" rel="nofollow noreferrer">OpenGL SDK</a></strong>. And its latest release was in 2007 compared to GLEE which was in 2006...
3,523
<p>I want to run a weekly batch process in an asp.net page. How can that be done?</p> <p>Thanks</p>
<blockquote> <p>Is there any known drawbacks with the solution?</p> </blockquote> <p><a href="https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/">Here is the blog post</a> in which Jeff Atwood discusses this approach. As with most of Jeff's post, the meat is in the comments where the pros and cons ...
<p>Develop a Windows Service and schedule it to run weekly once.</p>
3,465
<p>What is a good way to perform animation using .NET?</p> <p>I would prefer not to use Flash if possible, so am looking for suggestions of ways which will work to implement different types of animation on a new site I am producing.</p> <p>The new site is for a magician, so I want to provide animated buttons (Cards t...
<p><a href="http://silverlight.net/Default.aspx" rel="nofollow noreferrer">Silverlight</a> springs to mind as an obvious choice if you want to do animation using .NET on the web. It may not cover all platforms but will work in IE and FireFox and on the Mac.</p>
<p>JavaScript is probably the way to go if you want to avoid Flash. Check this: <a href="http://www.webreference.com/programming/javascript/java_anim/" rel="nofollow noreferrer">http://www.webreference.com/programming/javascript/java_anim/</a></p> <p>It won't work for embedded video, though, so you're stuck with Flash...
2,878
<p>We have a recurring problem at my company with build breaks in our Flex projects. The problem primarily occurs because the build that the developers do on their local machines is fundamentally different from the build that occurs on the build machine. The devs are building the projects using <code>FlexBuilder/eclips...
<ul> <li><p><code>__declspec(dllexport)</code> tells the linker that you want this object to be made available for other DLL's to import. It is used when creating a DLL that others can link to.</p></li> <li><p><code>__declspec(dllimport)</code> imports the implementation from a DLL so your application can use it.</p></...
<p>Dllexport is used to mark a function as exported. You implement the function in your DLL and export it so it becomes available to anyone using your DLL.</p> <p>Dllimport is the opposite: it marks a function as being imported from a DLL. In this case you only declare the function's signature and link your code with ...
8,245
<p>Has anyone used Mono, the open source .NET implementation on a large or medium sized project? I'm wondering if it's ready for real world, production environments. Is it stable, fast, compatible, ... enough to use? Does it take a lot of effort to port projects to the Mono runtime, or is it really, <em>really</em> com...
<p>There are a couple of scenarios to consider: (a) if you are porting an existing application and wondering if Mono is good enough for this task; (b) you are starting to write some new code, and you want to know if Mono is mature enough.</p> <p>For the first case, you can use the <a href="http://mono-project.com/Mo...
<p>It really depends on the namespaces and classes that you are using from the .NET framework. I had interest in converting one of my windows services to run on my email server, which is Suse, but we ran into several hard roadblocks with APIs that had not been completely implemented. There is a chart somewhere on the...
3,904
<p>Is it possible to convert an image image to STL file format? </p> <p><img src="https://i.stack.imgur.com/Y6SYj.png" alt="png image"></p> <p>E.g. I don't need the coloring, I need the lines.</p>
<p>I suggest your objective can best be accomplished by converting the image to a single color vector file. You can do this with Inkscape (free, Linux, Windows, Mac) by combining the built-in bitmap tracing feature with some manual editing. I attempted to do so, but the coarseness of the image would result in excessive...
<p>For things like a coat of arms, you do not require a full 3D conversion, essentially all you need is a lithograph-like effect. The best program I've found for such conversions is 3D Builder which is a free Microsoft download for windows users (yes, I was surprised too). It can use either color or degrees of greyscal...
1,590
<pre><code>- Unit Testing - Mocking - Inversion of Control - Refactoring - Object Relational Mapping - Others? </code></pre> <p>I have found <a href="http://www.lastcraft.com/simple_test.php" rel="nofollow noreferrer">simpletest</a> for unit testing and mocking and, though it leaves much to be desired, it k...
<p><a href="http://www.phpundercontrol.org/" rel="nofollow noreferrer">phpUnderControl</a> - continuous integration.</p> <p>Don't forget about version control (e.g. using <a href="http://www.nongnu.org/cvs/" rel="nofollow noreferrer">CVS</a> or <a href="http://subversion.tigris.org/" rel="nofollow noreferrer">Subversi...
<p>Unit Testing - PHPUnit <a href="http://www.phpunit.de/" rel="nofollow noreferrer">phpunit.de</a></p> <p>ORM - Doctrine <a href="http://www.phpdoctrine.org/" rel="nofollow noreferrer">phpdoctrine.org</a>, Propel <a href="http://propel.phpdb.org/" rel="nofollow noreferrer">propel.phpdb.org</a></p>
7,311
<p>I recently purchased a spool of PETG to try working with it. I have managed to dial in most of the settings in Prusaslicer but one, in particular, is giving me a problem. As seen in the photo, the clip I printed has extra extrusion on the inside and outside. I have noticed that the nozzle will pause at the seam for ...
<p>After checking several places online, I finally got an answer in a Discord chat.</p> <p>The solution was to turn off the <strong>Power-loss recovery</strong> setting on the printer itself.</p> <p>After that was done, the print came out beautifully.</p>
<p>Looks like <strong>Retract at layer change</strong> is causing this. Disable that and see. This will help you to improve the quality a lot.</p> <p>It will be under retraction settings:</p> <p><a href="https://i.stack.imgur.com/tdYOm.png" rel="nofollow noreferrer" title="Screenshot of retraction settings"><img src="h...
2,189
<p>Do you use a formal event to get people talking in your IT department? Like a <strong>monthly meetup</strong> in a social place, a <strong>internal wiki/chat</strong> space or just a regular "information market" with some <strong>presentations about technology or projects</strong> made by your staff for your staff? ...
<p>Knowledge Transfer and Knowledge Management have one drawback. They seem to cost an aweful lot: if everybody knows what I know, am I still needed? All the time I use to bring others up to speed, what do I gain from it?</p> <p>The best way to go about this is to be an example. Share your knowledge; in a wiki, blog a...
<p>One word: Lunch</p>
7,440
<p>In a LotusScript Agent that is being run via WebQueryOpen, how do you get the name of the current server?</p>
<pre><code>Set s = New NotesSession Set db = s.CurrentDatabase If db.Server &lt;&gt; "" Then Set sName = New NotesName(db.Server) Else Set sName = New NotesName(s.Username) End If </code></pre>
<pre><code>'initialize event of a WebQueryOpen agent Dim s As New notessession Dim servername As String servername = s.UserName </code></pre>
8,436
<p>If I open a solution in Visual Studio 2008 and run a unit test then VS creates a new .vsmdi file in the Solution Items folder and gives it the next number available e.g. My Solution2.vsmdi.</p> <p>Any idea why VS is doing this and how I can get it to stop doing this?</p>
<p>It appears that the <a href="http://web.archive.org/web/20080302162715/http://blogs.vertigosoftware.com/teamsystem/archive/2006/06/23/Beware_the_Team_Test_VSMDI_file.aspx" rel="nofollow noreferrer">VSMDI problem is a known bug and has been around since VS2005 Team System</a> but it has no clear fix as yet. Another r...
<p>An <a href="http://blogs.vertigosoftware.com/teamsystem/archive/2006/06/23/Beware_the_Team_Test_VSMDI_file.aspx" rel="nofollow noreferrer">old post but</a> vsmdi is a meta data file created by the test system.</p>
4,782
<p>How do I find out which sound files the user has configured in the control panel?</p> <p>Example: I want to play the sound for "Device connected".</p> <p>Which API can be used to query the control panel sound settings?</p> <p>I see that there are some custom entries made by third party programs in the control pan...
<p><a href="https://learn.microsoft.com/en-us/previous-versions/ms712879(v=vs.85)" rel="nofollow noreferrer"><code>PlaySound</code></a> is the API.</p> <p>Also see <a href="https://learn.microsoft.com/en-us/windows/win32/multimedia/using-playsound-to-play-system-sounds" rel="nofollow noreferrer">Play System Sounds</a>....
<p>Not Win32, but for .net anyway, you can do this using the following in C#:</p> <pre><code>System.Media.SystemSounds.Asterisk.Play(); // Plays the Asterisk sound (used for Information (i)) // Also available: // Exclamation (Warning /!\) // Hand (aka Critical Stop - Error (X)) // Question (?) // Beep (aka Default Bee...
9,777
<p>Having a heckuva time with this one, though I feel I'm missing something obvious. I have a control that inherits from <code>System.Web.UI.WebControls.Button</code>, and then implements an interface that I have set up. So think...</p> <pre><code>public class Button : System.Web.UI.WebControls.Button, IMyButtonInterf...
<p>Longhorn213 almost has the right answer, but as as Sean Chambers and bdukes say, you should use </p> <pre><code>ctrl is IInterfaceToFind </code></pre> <p>instead of </p> <pre><code>ctrl.GetType() == aTypeVariable </code></pre> <p>The reason why is that if you use <code>.GetType()</code> you will get the true...
<p>If you're going to do some work on it if it is of that type, then TryCast is what I'd use.</p> <pre><code>Dim c as IInterface = TryCast(obj, IInterface) If c IsNot Nothing 'do work End if </code></pre>
4,825
<p>Another easy one hopefully.</p> <p>Let's say I have a collection like this:</p> <pre><code>List&lt;DateTime&gt; allDates; </code></pre> <p>I want to turn that into </p> <pre><code>List&lt;List&lt;DateTime&gt;&gt; dividedDates; </code></pre> <p>where each List in 'dividedDates' contains all of the dates in 'allD...
<pre><code>var q = from date in allDates group date by date.Year into datesByYear select datesByYear.ToList(); q.ToList(); //returns List&lt;List&lt;DateTime&gt;&gt; </code></pre>
<p>Here's the methods form.</p> <pre> allDates .GroupBy(d => d.Year) .Select(g => g.ToList()) .ToList(); </pre>
9,514
<p>What is the minimum set of HTTP verbs that a server should allow for a web service to be classed as RESTful? </p> <p>What if my hoster doesn't permit <strong><em>PUT</em></strong> and <strong><em>DELETE</em></strong>?</p> <p>Is this actually important, can I live happily ever after with just <strong><em>GET</em></...
<p>Yes, you can live without PUT and DELETE. </p> <p>This article tells you why: <a href="http://www.artima.com/lejava/articles/why_put_and_delete.html" rel="noreferrer">http://www.artima.com/lejava/articles/why_put_and_delete.html</a></p> <p>While to true RESTafrians this may be heresy, in the real world you do what...
<p>Today's web browsers only handle GETS + POSTS. In Rails, for example, PUTS + DELETES are "faked" through hidden form fields.</p> <p>Unless your framework has some workaround to "support" PUTS + DELETES, don't worry about them for now.</p>
4,376
<p>We have an encryption service that we've exposed over net. tcp. Most of the time, the service is used to encrypt/decrypt strings. However, every now and then, we the need to encrypt large documents (pdf, JPG, bmp, etc.).</p> <p>What are the best endpoint settings for a scenario like this? Should I accept/return a s...
<p>MSDN describes <a href="http://msdn.microsoft.com/en-us/library/ms789010.aspx" rel="nofollow noreferrer">how to enable streaming over WCF</a> rather well. </p> <p>Note, if the link between client and server needs to be encrypted, then you'll need to "roll your own" encryption mechanism. The default <code>net.tcp</c...
<p>One pattern you could follow is to have an asynchronous service that works on files on a shared file system location:</p> <ol> <li>Place the file to be encrypted on a shared location</li> <li>Call the service and tell it to encrypt the file, passing both the location and name of the file, and the addres of a callba...
6,832
<p>I'm looking for some examples or samples of routing for the following sort of scenario:</p> <p>The general example of doing things is: {controller}/{action}/{id}</p> <p>So in the scenario of doing a product search for a store you'd have:</p> <pre><code>public class ProductsController: Controller { public Acti...
<p>I actually found it not even by searching, but by scanning through the ASP .NET forums in <a href="http://forums.asp.net/t/1296928.aspx?PageIndex=1" rel="nofollow noreferrer">this question</a>.</p> <p>Using this you can have the controllers of the same name under any part of the namespace, so long as you qualify wh...
<p>The best way to do this without any compromises would be to implement your own ControllerFactory by inheriting off of IControllerFactory. The CreateController method that you will implement handles creating the controller instance to handle the request by the RouteHandler and the ControllerActionInvoker. The conve...
6,479
<p>Is it possible to print toothbrush bristles using a common FDM 3D printer? I am particularly interested in the width of bristles, closeness together of each bristle, and the flexibility of each particular bristle.</p>
<p>Actually last year a group did use a normal FDM printer to 3d print hair, brushed, etc. See the press release from Carnegie Mellon University</p> <p><a href="https://www.engadget.com/2015/10/29/3d-printing-hair-is-as-easy-as-using-a-hot-glue-gun/" rel="noreferrer">https://www.engadget.com/2015/10/29/3d-printing-hai...
<p>I have had a go at doing something for a <a href="http://www.thingiverse.com/thing:552770" rel="nofollow">christmass tree</a> using a drop loop technique. You could use the same method or somthing similar to try and create something that looks like toothbrush bristles, but I don't think you would want to try cleanin...
317
<p>I am part of a high school robotics team, and there is some debate about which language to use to program our robot. We are choosing between C (or maybe C++) and LabVIEW. There are pros for each language.</p> <p>C(++):</p> <ul> <li>Widely used</li> <li>Good preparation for the future (most programming positions ...
<p>Before I arrived, our group (PhD scientists, with little programming background) had been trying to implement a LabVIEW application on-and-off for nearly a year. The code was untidy, too complex (front and back-end) and most importantly, did not work. I am a keen programmer but had never used LabVIEW. With a little...
<p>It seems that if you are trying to prepare our team for a future in programming that C(++) ma be the better route. The promise of general programming languages that are built with visual building blocks has never seemed to materialize and I am beginning to wonder if they ever will. It seems that while it can be done...
3,461
<p>If I get an error code result from a Cocoa function, is there any easy way to figure out what it means (other than by grepping through all the .h files in the framework bundles)?</p>
<p>You should look at the <code>&lt;Framework/FrameworkErrors.h&gt;</code> header for whatever framework the method you're using that's returning an error comes from.</p> <p>For example, an <code>NSError</code> in the Cocoa domain that you get from a method in the Foundation framework will have its <code>code</code> p...
<p>For NSError errors add a line of code:</p> <pre><code>NSError *error; // ... Some code that returns an error // Get the error as a string NSString *s = [error localizedDescription]; // Observe the code for yourself or display to the user. </code></pre>
5,927
<p>Related to an issue I had in <a href="https://3dprinting.stackexchange.com/questions/1205/increased-issues-with-filament-grinding">this question</a>, where the PTFE tube feeding my filament to the metal tip of the extruder clogged and became discolored: what are the advantages and disadvantages of changing out my ex...
<p>This is a good question to make a comparison table. All-metal hotends Vs. PTFE liner hotends.</p> <p>All metal:</p> <ul> <li>Works well for high (+250ºC) temperatures filaments like nylon or PC.</li> <li>No need to replace the PTFE liner (pretty obvious).</li> <li>Retraction performs worse.</li> <li>Plastic can ge...
<p>My Tevo Tarantula had an all metal hotend included and I never ran into any issues only printing PLA and PETG, most of the time I was even able to pull out the filament while the printer was cold.</p> <p>After I upgraded to an E3Dv6 clone with PTFE lined heatbreak I started to have issues because of the filament ge...
359
<p>I am developing an application in using Ruby on Rails, mostly as an excuse to learn the language.</p> <p>This is not intended to be a web-based application - and perhaps I have chosen the wrong language, but...</p> <p>My understanding is, that in order to run an instance of this application on somebody else's comp...
<p>I have personally never needed to do this. But, I have ran across this tutorial <a href="http://www.erikveen.dds.nl/distributingrubyapplications/rails.html" rel="noreferrer">http://www.erikveen.dds.nl/distributingrubyapplications/rails.html</a> that I think will be helpful. The tutorial covers how to actually conv...
<p>You do not specifically say whether it is supposed to be a GUI application or not. From the other answers, I would guess so. </p> <p>Therefore, you need to clarify what your goals are. RoR is a specialized framework for web applications. If your goal is to learn RoR, I'd say to get yourself some inexpensive web ho...
7,953
<p>For example I have a situation where I have something like this (contrived) example:</p> <pre><code>&lt;div id="outer" style="margin: auto&gt; &lt;div id="inner1" style="float: left"&gt;content&lt;/div&gt; &lt;div id="inner2" style="float: left"&gt;content&lt;/div&gt; &lt;div id="inner3" style="float: l...
<p>Try the <a href="https://addons.mozilla.org/en-US/firefox/addon/60" rel="nofollow noreferrer">Web Developer Plugin</a> for Firefox. Specifically, the <strong>Information -> Display Block Size</strong> and <strong>Outline -> Outline Block Level Elements</strong> options. This will allow to see the borders of your e...
<p>In Firebug's CSS tab, you can see what style rules apply to a selected elements in the cascading order. This may or may not help you in your problem.</p> <p>My guess would be that something about the content of #inner3 is causing it to wrap below the first line, and the #outer is just getting sized to accommodate t...
6,664
<p>I have some code that uses SMO to populate a list of available SQL Servers and databases. While we no longer support SQL Server 2000, it's possible that the code could get run on a machine that SQL Server 2000 and not have the SMO library installed. I would perfer to check for SMO first and degrade the functionali...
<p>I had a look at the SharedManagementObjects.msi from the SQL2008 R2 feature pack and my Windows Registry (SQL2008 R2 Dev is installed on this machine) and I believe these are the reg keys one should use to detect SMO (All under HKLM):</p> <p>SOFTWARE\Microsoft\Microsoft SQL Server\SharedManagementObjects\CurrentVer...
<p>Just a quick note: HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\SharedManagementObjects\CurrentVersion\Version doesn't represent the current version that is installed, because there could be several versions installed.</p> <p>The registry key above is being updated when you install a version, so if you've installe...
6,391
<p>Say I have an interface IFoo which I am mocking. There are 3 methods on this interface. I need to test that the system under test calls at least one of the three methods. I don't care how many times, or with what arguments it does call, but the case where it ignores all the methods and does not touch the IFoo mock i...
<p>You can give rhino mocks a lambda to run when a function get's called. This lambda can then increment a counter. Assert the counter > 1 and you're done.</p> <p>Commented by Don Kirkby: I believe Mendelt is referring to the Do method.</p>
<p>Not sure this answers your question but I've found that if I need to do anything like that with Rhino (or any similiar framework/library), anything that I didn't know how to do upfront, then I'm better just creating a manual mock. </p> <p>Creating a class that implements the interface and sets a public boolean fiel...
7,721
<p>Is a GUID unique 100% of the time?</p> <p>Will it stay unique over multiple threads?</p>
<blockquote> <p>While each generated GUID is not guaranteed to be unique, the total number of unique keys (2<sup>128</sup> or 3.4×10<sup>38</sup>) is so large that the probability of the same number being generated twice is very small. For example, consider the observable universe, which contains about 5×10<sup>22</sup...
<p>Enough GUIDs to assign one to each and every hypothetical grain of sand on every hypothetical planet around each and every star in the visible universe.</p> <p>Enough so that if every computer in the world generates 1000 GUIDs a second for 200 years, there might (MIGHT) be a collision.</p> <p>Given the number of cur...
6,093
<p>I've seen SaaS applications hosted in many different ways. Is it a good idea to split features and modules across multiple databases? For example, putting things like the User table on one DB and feature/app specific tables on another DB and perhaps other commonly shared tables in another DB?</p>
<p>Start with one database. Split data/functionality when project requires it.</p> <p>Here is what we can learn from LinkedIn:</p> <ul> <li>A single database does not work</li> <li>Referential integrity will not be possible</li> <li>Any data loss is a problem</li> <li>Caching is good even when it's modestly effective...
<p>Keep it a natural design (denormalize as much as needed, normalize as less as required). Split the DB Model into its modules and keep the service oriented principles in mind by fronting data with a service (that owns the data). </p>
9,460
<p>When choosing which filament to use for a particular print does the color of the filament have any impact on it's performance, or is it purely a cosmetic choice?</p> <p>For example, are there any side-by-side comparisons available that demonstrate that differences do\don't exist between different color filaments fro...
<p>Depending on the pigment size and other additions, the melting temperature and crystalline/amorphous structure of prints vary vastly.</p> <p>Titanium white, the most common white pigment in the industry, needs to be applied in large doses to get a good coloration. This means that the brighter the white, the larger t...
<p>Yes in some cases it does.</p> <p>It is widely known in communities which are pickier about properties that white filament requires a percentage of pigments much higher than other colours, therefore white filaments are typically weaker (or significantly weaker) than most other colours.</p> <p>Another exception is bl...
2,060
<p>By looking at our <code>DB's</code> error log, we found that there was a constant stream of almost successful SQL injection attacks. Some quick coding avoided that, but how could I have setup a monitor for both the DB and Web server (including POST requests) to check for this? By this I mean if there are off the sh...
<p>Funnily enough, Scott Hanselman had a <a href="http://www.hanselman.com/blog/HackedAndIDidntLikeItURLScanIsStepZero.aspx" rel="nofollow noreferrer">post on UrlScan</a> today which is one thing you could do to help monitor and minimize potential threats. It's a pretty interesting read.</p>
<p>Monitoring web and DB access logs should alert you to things like this, but if you want a more fully featured alert system I would suggest some kind of IDS/IPS. You'll need a spare machine though, and a switch that can do port mirroring. If you have those then an IDS is a cheap way of monitoring your traffic for ma...
2,995
<p>I'm using <code>ColdFusion</code> to populate a template that includes HTML unordered lists (<code>&lt;ul&gt;</code>s).</p> <p>Most of these aren't that long, but a few have ridiculously long lengths and could really stand to be in 2-3 columns.</p> <p>Is there an HTML, ColdFusion or perhaps JavaScript (I'm accepti...
<p>So I dug up this article from A List Apart <a href="http://www.alistapart.com/articles/multicolumnlists" rel="noreferrer">CSS Swag: Multi-Column Lists</a>. I ended up using the first solution, it's not the best but the others require either using complex HTML that can't be generated dynamically, or creating a lot o...
<p>To output the list into multiple grouped tag you can loop in this fashion.</p> <pre><code>&lt;cfset list="1,2,3,4,5,6,7,8,9,10,11,12,13,14"&gt; &lt;cfset numberOfColumns = "3"&gt; &lt;cfoutput&gt; &lt;cfloop from="1" to="#numberOfColumns#" index="col"&gt; &lt;ul&gt; &lt;cfloop from="#col#" to="#listLen(list)#"...
2,692
<p>So for e.g. 0110 has bits 1 and 2 set, 1000 has bit 3 set 1111 has bits 0,1,2,3 set</p>
<p>If there are really only 4 bits, then the fastest method would certainly involve a lookup table. There are only 16 different possibilities after all.</p>
<p>Depends on what you mean by fastest. </p> <p>If you mean "simple to code", in .NET you can use the BitArray class and refer to each bit as a boolean true/false.</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.collections.bitarray.aspx" rel="nofollow noreferrer">BitArray Class</a></p>
9,440
<p>I changed the filament, and to adjust filament temperature, I printed a test model and it looked good: </p> <p><a href="https://i.stack.imgur.com/90rop.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/90rop.jpg" alt="enter image description here"></a></p> <p>But printing another part did not go s...
<p>It definitely looks like the temperature is too high</p> <p>but it can also mean that </p> <ul> <li>the speed is too low and/or</li> <li>the cooling fan is not driven correctly and/or</li> <li>over extrusion could play a role here</li> </ul> <p>this is the scenario with all these issues together</p> <p>too high ...
<p>From third picture - moisture!</p> <p>Is new filament cheap? I guess it was too long on stash and/or bad package.</p> <p>Look for <a href="https://www.youtube.com/channel/UCxQbYGpbdrh-b2ND-AfIybg" rel="nofollow noreferrer">Maker's Muse</a>'s video on Youtube about this topic. </p>
1,279
<p>Looking at the following code, from <a href="https://github.com/JimBrown/MarlinTarantula/blob/2ce73937f3c57aac28a8d5f11a6ed9135a27cdca/Marlin/pins_RAMPS.h#L139" rel="nofollow noreferrer">Line 139</a>, <a href="https://github.com/JimBrown/MarlinTarantula/blob/2ce73937f3c57aac28a8d5f11a6ed9135a27cdca/Marlin/pins_RAMPS...
<p>At first it was unclear from where the snippet you posted is taken from as it was not stated in the question (<em>this has now been addressed by a moderator edit</em>).</p> <p>Depending on the value of <code>EXTRUDER_USE_E1</code> (and where and how it is set) the underlying code of the if statement will be carried...
<p>I simply swapped the pins </p> <pre><code>#define E1_STEP_PIN 26 //swapping to E1 FRED #define E1_DIR_PIN 28 #define E1_ENABLE_PIN 24 #ifndef E1_CS_PIN #define E1_CS_PIN 42 #endif #define E0_STEP_PIN 36 //swapping to E0 FRED #define E0_DIR_PIN 34 #define E0_ENABLE_PIN ...
900
<p>From <a href="https://stackoverflow.com/questions/60419/do-i-really-need-to-use-transactions-in-stored-procedures-mssql-2005">this post</a>. One obvious problem is scalability/performance. What are the other problems that transactions use will provoke?</p> <p>Could you say there are two sets of problems, one for lo...
<p>It depends a lot on the transactional implementation inside your database and may also depend on the transaction isolation level you use. I'm assuming "repeatable read" or higher here. Holding transactions open for a long time (even ones which haven't modified anything) forces the database to hold on to deleted or u...
<p>I think the major issue is at the design level. At what level or levels within my application do I utilise transactions.</p> <p>For example I could:</p> <ul> <li>Create transactions within stored procedures, </li> <li>Use the data access API (ADO.NET) to control transactions </li> <li>Use some form of implicit ro...
8,542
<p>I recently had a print failure/crash, where the print stuck to the nozzle and forced molten filament back into the print head, fans, and heater block.</p> <p>I changed the nozzle for a new 0.4mm same as existing. I shortened the bowden tube by ~8mm to remove some crispiness, and the push-lock connector on top of th...
<p>I'm a fan of OpenSCAD and have used the method suggested in the first answer. For non-OpenSCAD users, another option exists, which I've also used.</p> <p>PrusaSlicer is a free 3D printer slicing program. One can configure layer heights as desired for the material thickness, even though it's not likely one will find ...
<p>With OpenSCAD, you can <code>import</code> the STL file and apply <code>projection</code> with <code>cut=true</code> at successive Z-axis <code>translate</code> operations, and write out the result as SVG. This can all be automated from the command line to product a series of SVG files for your layers to &quot;2D pr...
2,151
<p>This is related to the <a href="https://stackoverflow.com/questions/24468/running-partially-trusted-net-assemblies-from-a-network-share">this question</a> and the answer maybe the same but I'll ask anyways.</p> <p>I understand that we can start managed executables from the network from .NET 3.5 SP1 but what about a...
<p>You have been able to load Assemblies from the network at leasst from .NET 2.0. I have used this on a previous project. The only thing to watch is the size of the assembly and the number and size of the dependancies that it is loading.</p> <p>If you are using a seperate AppDomain, then you will need to take special...
<p>My understanding is yes, you're trying to load an untrusted module into your local app domain.</p>
8,616
<p>I am trying to write a formula in ActionScript 3 that will give me var "z" (please see image below) in degrees, which I will then convert to radians.</p> <p>I will already know the value of vars "x" and "y". Using trigonometry, how can I calculate the length of the hypotenuse and therefore the variable angle of var...
<p>What you need is this:</p> <pre><code>var h:Number = Math.sqrt(x*x + y*y); var z:Number = Math.atan2(y, x); </code></pre> <p>That should give you the angle in radians, you might need to swap x/y and possibly add or remove 90 degrees but it should do the trick! (Note that you don't even need <strong>h</strong> to g...
<p>What @Patrick said, also the hypotenuse is <code>sqrt(x^2 + y^2)</code>.</p>
8,002
<p>Consider the following setup: A windows PC with a LAN interface and a WiFi interface (the standard for any new laptop). Each of the interfaces might be connected or disconnected from a network. I need a way to determine which one of the adapters is the one connected to the internet - specifically, in case they are b...
<p>Technically, there is no "connected to the Internet". The real question is, which interface is routeable to a desired address. Right now, you're querying for the "default route" - the one that applies if no specific route to destination exists. But, you're ignoring any specific routes.</p> <p>Fortunately, for 99.9%...
<p>Ping google.com though each NIC.</p>
5,985
<p>When developing whether its Web or Desktop at which point should a developer switch from SQLite, MySQL, MS SQL, etc</p>
<p>It depends on what you are doing. You might switch if:</p> <ul> <li>You need more scalability or better performance - say from SQLite to SQL Server or Oracle.</li> <li>You need access to more specific datatypes.</li> <li>You need to support a customer that only runs a particular database.</li> <li>You need better D...
<p>BrianLy hit the nail on the head, but I'd also add that you may end up using different databases at different levels of development. It's not uncommon for developers to use SQLite on their workstation when they're coding against their personal development server, and then have the staging and/or production sites usi...
2,688
<p>Does anyone known of a a good reference for canonical CS problems?</p> <p>I'm thinking of things like "the sorting problem", "the bin packing problem", "the travailing salesman problem" and what not.</p> <p><strong>edit:</strong> websites preferred</p>
<p>You can probably find the best in an algorithms textbook like <a href="https://rads.stackoverflow.com/amzn/click/com/0262032937" rel="nofollow noreferrer" rel="nofollow noreferrer">Introduction to Algorithms</a>. Though I've never read that particular book, it's quite renowned for being thorough and would probably c...
<p>@rcreswick those sound like good references but fall a bit shy of what I'm thinking of. (However, for all I know, it's the best there is)</p> <p>I'm going to not mark anything as accepted in hopes people might find a better reference.</p> <p>Meanwhile, I'm going to list a few problems here, fell free to add more</...
5,603
<pre><code>#include &lt;iostream&gt; using namespace std; int main() { double u = 0; double w = -u; cout &lt;&lt; w &lt;&lt; endl; return 0; } </code></pre> <p>Why does this great piece of code output <code>-0</code> and not <code>0</code>, as one would expect?</p>
<p>The IEEE 754 standard for floating-point numbers has the sign bit separate from the mantissa, which allows for zero to be negative. <a href="http://en.wikipedia.org/wiki/IEEE_754" rel="nofollow noreferrer">Wikipedia</a> should be able to help explain this.</p>
<p>Because "negative zero" is a valid number!</p> <p><a href="http://en.wikipedia.org/wiki/%E2%88%920_(number)" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/%E2%88%920_(number)</a></p>
9,942
<p>How do you turn a Visual Studio build that you'd perform in the IDE into a script that you can run from the command line?</p>
<p>With VS2008 you can do this:</p> <pre><code>devenv solution.sln /build configuration </code></pre>
<p>A more simple way is to change VS 2015 Projects &amp; Solutions configuration: Go to the Tools tab -> Options -> Projects and Solutions -> Build and Run -> On Run, when projects are out of date (choose Always build). VOILA! </p> <p>Now your IDE will automatically build your project when you run (F5) it. Hope this h...
4,421
<p>I just received my new Creality Ender 3. I was going through and checking/adjusting everything for alignment, and I noticed that when you &quot;auto home&quot; the print head, the nozzle stops off the front of the print bed by 5-10 mm.</p> <p>Is that normal?</p> <p>Is it perhaps by design to allow purging the nozzle...
<p>Yes, this is the &quot;intended&quot; behavior, as the home in relation to the physical limit position is not placed correctly about 7.5 mm into the bed in both X and Y.</p> <p>to correct this, please look at the <a href="https://3dprinting.stackexchange.com/questions/6399/recalibrating-home-position">Recalibrating ...
<p>It is intentional for the head to start slightly off the build plate. </p> <p>If it did start on the build plate you could crash the nozzle when the bed is not levelled. Note the level varies with temperature and build plate type. If you switch from PLA to ABS etc you should relevel the bed. </p> <p>Having just ha...
999
<p>Many times I have seen Visual Studio solutions which have multiple projects that share source files. These common source files are usually out in a common directory and in the solution explorer their icon shows up with a link arrow in the bottom left.</p> <p>However, any time I try to add a source file to the proj...
<p>Right click on a project, select <strong>Add->Existing Item->Add as link</strong> (press on small arrow on Add button)</p>
<p>Thanks @aku!</p> <p>I knew this could be done, but I didn't know how to do this from Visual Studio. It shows up as a shortcut to the file and the csproj file generates the resulting XML like this:</p> <pre><code>&lt;Compile Include="..\CommonAssemblyInfo.cs"&gt; &lt;Link&gt;CommonAssemblyInfo.cs&lt;/Link&gt; &lt...
6,763
<p>I'm /relatively/ new to 3d printing (I'm getting pretty good prints from my Wanhao di3 plus, but haven't done any DIY kits or anything) and materials engineering is probably the furthest thing from my area of expertise so I thought I would pose this to more experienced makers:</p> <p>If I'm building a large scale p...
<p>With a well-insulated and well distributed (or perhaps well-mixed is a better term - even heating) enclosure you should have a veritable heated bed by dint of heating the enclosure (with the bed in it), unless the bed needs to be hotter than the enclosure. I think that would be bit more elaborate than "a couple of ...
<p>If it is yours first DIY 3D printer try building smaller version first with just one silicone heat pad. 400^2 mm^2 is good enough.</p> <p>From my experience:</p> <ol> <li><p>I used 500W silicon heater with SSR (AC mains) and it heats as fast as hotend (on DC 12V).</p></li> <li><p>I also recommend tooling plate (CN...
672
<p>If you want to use a queuing product for durable messaging under Windows, running .NET 2.0 and above, which alternatives to MSMQ exist today? I know of ActiveMQ (<a href="http://activemq.apache.org/" rel="noreferrer">http://activemq.apache.org/</a>), and I've seen references to WSMQ (pointing to <a href="http://wsmq...
<p>I can't begin to say enough good things about Tibco EMS - an implementation of the Java JMS messaging spec. Tibco EMS has superb support for .NET clients - including Compact Framework .NET on WinCE. (They also have C client libraries too.)</p> <p>So if you're building a heterogeneous distributed application involvi...
<p>If high availability is important Amazon SQS is worth looking at. There's not much additional overhead if messages come from different physical locations. Cheap and scalable!</p>
5,833
<p>I'm about to start a project for a customer who wants CMS-like functionality. They want users to be able to log in, modify a profile, and a basic forum. They also wish to be able to submit things to a front page.</p> <p>Is there a framework or barebones CMS that I could expand on or tailor to my needs? I don't need...
<p><a href="http://tinycms.sourceforge.net/" rel="nofollow noreferrer">tinyCMS</a> is about as barebones as you can get. (<strong>edit</strong>: fixed link, I had gotten a little click happy and linked to the wrong thing)</p> <p>@modesty, I would definitely NOT use SharePoint, as it is anything <strong>but</strong> ba...
<p>Might want to check out <a href="http://drupal.org/" rel="nofollow noreferrer">Drupal</a>. </p> <p>Here are the details of the <a href="http://drupal.org/node/176052" rel="nofollow noreferrer">technology stack</a> that it uses. </p> <p>I have never used it so I can't vouch for the quality etc but definitely wort...
2,616
<p>Is there a rake task for backing up the data in your database? </p> <p>I already have my schema backed up, but I want to make a backup of the data. It's a small MySQL database. </p>
<p>The below script is a simplified version taken from <a href="http://github.com/engineyard/eycap/tree/master" rel="nofollow noreferrer">eycap</a>, specifically from <a href="http://github.com/engineyard/eycap/tree/master/lib/eycap/recipes/database.rb" rel="nofollow noreferrer">this file</a>.</p> <pre><code>set :dbus...
<p>Make sure to add the "--routines" parameter to mysqldump if you have any stored procs in your database so it backs them up too.</p>
4,704
<p>When I downloaded Skype, I noticed that, in place of a normal "disk image" icon, there was a custom icon, and when I double clicked on the icon, the window used a colorful image as the background, prompting me to drag the skype icon into the applications folder.</p> <p>How can I do that with my applications?</p> <...
<p>Let me add to the other answers <a href="http://www.jwz.org/blog/2006/03/setting-view-options-on-dmg-files/" rel="nofollow noreferrer">jwz's howto</a> on setting view options on .dmg files. This is the simplest one that I got to work with no problems.</p> <p>Also, to change the icon from the default .dmg icon: </p>...
<p>If you’re interested in a commercial solution, there are a number of DMG designer apps available, including the following I gleaned from a <a href="http://www.macupdate.com/search.php?starget=google&amp;keywords=dmg" rel="nofollow noreferrer">MacUpdate search</a>:</p> <ul> <li><a href="http://freespace.virgin.net/j...
8,686
<p>I am using <code>&lt;input type="file" id="fileUpload" runat="server"&gt;</code> to upload a file in an ASP.NET application. I would like to limit the file type of the upload (example: limit to .xls or .xlsx file extensions). </p> <p>Both JavaScript or server-side validation are OK (as long as the server side valid...
<p>Seems like you are going to have limited options since you want the check to occur before the upload. I think the best you are going to get is to use javascript to validate the extension of the file. You could build a hash of valid extensions and then look to see if the extension of the file being uploaded existed...
<p>Your only option seems to be client-side validation, because server side means the file was already uploaded. Also the MIME type is usually dictated by the file extension. </p> <p>use a JavaScript Framework like jQuery to overload the onsubmit event of the form. Then check the extension. This will limit most at...
9,749
<p>I'm having a problem running a T4 template using TextTransform.exe on my build server. On my dev machine the template works perfectly. The error message is as follows.</p> <blockquote> <p>error : Running transformation: System.TypeLoadException: Could not instantiate type System.Xml.Linq.XDocument</p> </blockquot...
<p>Some syntax sugar</p> <pre><code>1 in [1,2,3] </code></pre>
<p>You can also use matches with regular expression like this:</p> <pre><code>boolean bool = List.matches(&quot;(?i).*SOME STRING HERE.*&quot;) </code></pre>
7,515
<p>What techniques can be applied to detect <a href="http://en.wikipedia.org/wiki/Computer_virus#Polymorphic_code" rel="nofollow noreferrer">Polymorphic</a> and <a href="http://en.wikipedia.org/wiki/Computer_virus#Metamorphic_code" rel="nofollow noreferrer">Metamorphic</a> viruses?</p> <p>How difficult is to implement...
<p>I thought most of the virus scanners nowadays use <a href="http://www.norman.com/Virus/Sandbox/20374/en" rel="nofollow noreferrer"><em>sandbox techniques</em></a> to check for "bad" behavior. Therefore the polymorphic virusses will also be detected.<br> of course these detection techniques are also known to virus cr...
<p>It's impossiable to detect all known poly/metamorphic bad-code. White lists verification is the only provable technique. It's not always possiable, especially if your infrastructure/computer has not been maintainedd very well. Which is a good reason why signature, heuristic, emulation based detection is still val...
5,637
<p>Is there any efficiency difference in an explicit vs implicit inner join? For example:</p> <pre><code>SELECT * FROM table a INNER JOIN table b ON a.id = b.id; </code></pre> <p>vs.</p> <pre><code>SELECT a.*, b.* FROM table a, table b WHERE a.id = b.id; </code></pre>
<p>Performance wise, they are exactly the same (at least in SQL Server).</p> <p>PS: Be aware that the <code>IMPLICIT OUTER JOIN</code> syntax is deprecated since SQL Server 2005. (The <code>IMPLICIT INNER JOIN</code> syntax as used in the question is still supported)</p> <p><a href="https://learn.microsoft.com/en-us/...
<p>In my experience, using the cross-join-with-a-where-clause syntax often produces a brain damaged execution plan, especially if you are using a Microsoft SQL product. The way that SQL Server attempts to estimate table row counts, for instance, is savagely horrible. Using the inner join syntax gives you some control...
6,670
<p>I got a new MKS 1.4 controller board and it came with A4988 driver chips. But I can't figure out which way they install. I found something saying to match the printing on the back of the chip to that on the board. But I don't see anything that matches. Suggestions?</p> <p><a href="https://i.stack.imgur.com/dQer...
<p>From <a href="https://www.pololu.com/product/1182" rel="nofollow noreferrer">A4988 Stepper Motor Driver Carrier</a>, the rear of the breakout board, is identical to yours:</p> <p><a href="https://i.stack.imgur.com/8xpCF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8xpCF.jpg" alt="A4988 Breakou...
<p>The below image was taken from <a href="https://www.aliexpress.com/store/product/3D-printer-control-board-motherboard-MKS-Gen-V1-1-RepRap-Ramps1-4-compatible/1047297_2030818114.html" rel="nofollow noreferrer">their AliExpress shop page</a>.</p> <p>Unfortunately, I don't manage to find the datasheet or schematic to ...
496
<p>I've been wondering what exactly are the principles of how the two properties work. I know the second one is universal and basically doesn't deal with time zones, but can someone explain in detail how they work and which one should be used in what scenario?</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.datetime.utcnow.aspx" rel="noreferrer">DateTime.UtcNow</a> tells you the date and time as it would be in Coordinated Universal Time, which is also called the Greenwich Mean Time time zone - basically like it would be if you were in London England, but not durin...
<p>When you need a local time for the machine your application runs at (like CEST for Europe), use Now. If you want a universal time - UtcNow. It's just matter of your preferences - probably making a local website / standalone application you'd want to use the time user has - so affected by his/her timezone setting - D...
8,751
<p>I've implemented an image/video transformation technique called discrete cosine transform. This technique is used in MPEG video encoding. I based my algorithm on the ideas presented at the following URL:</p> <p><a href="http://vsr.informatik.tu-chemnitz.de/~jan/MPEG/HTML/mpeg_tech.html" rel="noreferrer"><a href="...
<p>The result of a DCT is a transformation of the original source into the frequency domain. The top left entry stores the "amplitude" the "base" frequency and frequency increases both along the horizontal and vertical axes. The outcome of the DCT is usually a collection of amplitudes at the more usual lower frequencie...
<p>If I remember correctly, this matrix allows you to save the data to a file with compression.</p> <p>If you read further down, you'll find the zig-zag pattern of data to read from that final matrix. The most important data are in the top left corner, and least important in the bottom right corner. As such, if you st...
2,657
<p>I am recently in charge of an older app written in <code>C#</code> using <code>asp.net 1.1</code>. </p> <ol> <li>Are there any resources to guide me in converting the application to a newer version of of the <code>.NET Framework</code>. <em>My main pause is that there are ton's of customized <code>DataGrids</code...
<p>I had a similar experience, and the only thing that we had to replace was a third-party control that we were using in the 1.1 app, and the vendor had gone out of business an never released a version that worked with .NET 2.0. We ended up replacing it fairly easily with an AJAX Control Toolkit control.</p> <p>Othe...
<p>Regarding DataGrids - I don't think you have too much to worry about, DataGrids still work in current versions. It's just that going forward, you should use GridViews.</p> <p>I am sure there are other things you may want to check into though, deeper framework issues. But I don't know enough about those things to sp...
6,449
<p>I got an Anet A8 and want to build an enclosure for it. Since I'm currently only printing PLA, I would do it mainly for noise cancelling, because I have to run it in my room. I however want to have the possibility to upgrade it later with, say, an air filter etc., for example for ABS.</p> <ul> <li>What do I have to...
<p>Sort of related, see the answers to:</p> <ul> <li><a href="https://3dprinting.stackexchange.com/questions/3771/commercially-available-3d-printer-fume-and-ufp-extractor">Commercially available 3D printer fume and UFP extractor</a>, and;</li> <li><a href="https://3dprinting.stackexchange.com/questions/513/what-are-th...
<p>For ABS, if you are using an air filter, you do NOT want ventilation, because ABS prints are better quality if the ambient temperature is up at 50°C (or even warmer), and ventilation will reduce your chamber temperature. Whatever has been helping for noise cancelling now should work in the future.</p>
622
<p>FCKeditor has InsertHtml API (<a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API" rel="nofollow noreferrer">JavaScript API document</a>) that inserts HTML in the current cursor position. How do I insert at the very end of the document?</p> <p>Do I need to start browser sniffing with so...
<p>It looks like you could use a combination of GetHTML and SetHTML to get the current contents, append your html and reinsert everything into the editor. Although it does say </p> <blockquote> <p>Note that when using this method, you will lose any listener that you may have previously registered on the editor.Edito...
<pre><code>var oEditor = FCKeditorAPI.GetInstance('Editor_instance') ; OldText=oEditor.GetXHTML( true ); oEditor.SetData( OldText+"Your text"); </code></pre>
4,487
<p>When using Linq to SQL and stored procedures, the class generated to describe the proc's result set uses char properties to represent char(1) columns in the SQL proc. I'd rather these be strings - is there any easy way to make this happen?</p>
<p>You could modify the {database}.designer.cs file. I don't have one handy to check, but I believe it's fairly straight forward --- you'll just have to plow through a lot of code, and remember to re-apply the change if you ever regenerate it.</p> <p>Alternately, you could create your own class and handle it in the s...
<p>Not sure why you'd want to do that. The underlying data type can't store more than one char, by representing it as a string variable you introduce the need to check lengths before committing to the db, where as if you leave it as is you can just call ToString() on the char to get a string</p>
9,889
<p>Right now I am working on a solution to archive older data from a big working database to a separate archive database with the same schema. I move the data using SQL scripts and SQL Server Management Objects (SMO) from a .Net executable written in C#.</p> <p>The archived data should still be accessible and even (oc...
<p>I think if you still want/need the data to be accessible, then partitioning some of your biggest or most-used tables could be an option.</p>
<p>We are in a similar situation. For regulatory reasons we cannot delete data for a set period of time, but many of our tables grow very large and unwieldy and realistically much of the data that is older than a month can be removed with few day-to-day problems. </p> <p>We currently programatically prune the tables,...
5,185
<p>I'm using NHibernate on a project and I need to do data auditing. I found <a href="http://www.codeproject.com/KB/cs/NHibernate_IInterceptor.aspx" rel="nofollow noreferrer">this article</a> on codeproject which discusses the IInterceptor interface.</p> <p>What is your preferred way of auditing data? Do you use dat...
<p>For NHibernate 2.0, you should also look at <a href="http://knol.google.com/k/fabio-maulo/nhibernate-chapter-11/1nr4enxv3dpeq/14#view" rel="noreferrer">Event Listeners</a>. These are the evolution of the IInterceptor interface and we use them successfully for auditing.</p>
<p>I prefer the CodeProject approach you mentioned.</p> <p>One problem with database triggers is that it leaves you no choice but to use Integrated Security coupled with ActiveDirectory as access to your SQL Server. The reason for that is that your connection should inherit the identity of the user who triggered the c...
3,671
<p>I have a database with two tables (<code>Table1</code> and <code>Table2</code>). They both have a common column <code>[ColumnA]</code> which is an <code>nvarchar</code>. </p> <p>How can I select this column from both tables and return it as a single column in my result set?</p> <p>So I'm looking for something like...
<pre><code>SELECT ColumnA FROM Table1 UNION Select ColumnB FROM Table2 ORDER BY 1 </code></pre> <p>Also, if you know the contents of Table1 and Table2 will <strong>NEVER</strong> overlap, you can use UNION ALL in place of UNION instead. Saves a little bit of resources that way.</p> <p>-- Kevin Fairchild</p>
<p>You can use a union select: </p> <pre><code>Select columnA from table1 union select columnA from table2 </code></pre>
6,588
<p>I have an <a href="https://smile.amazon.com/gp/product/B01GD8LCFO/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&amp;psc=1" rel="nofollow noreferrer">all-metal V6 hotend clone</a> that has worked in the past, but recently will clog very easily.</p> <p>I've tried the following to address it:</p> <ul> <li>Clean/replace the...
<p>Since I have been unable to find a way to fix the E3D V6 clone hotend I have instead replaced it with a Creality Mk 8 that I had on-hand, which has so far worked flawlessly.</p> <p>I am assuming that the improved performance is related to the use of a shorter nozzle and/or the Bowden tube butting directly against th...
<p>I had issues with my all metal hot-end where I got heat creep. I ended up doing e-steps, PID tune, and ensuring my speed wasn't too slow either. Is your printer in an enclosure? I found that mine being in an enclosure caused the hotend to not cool sufficiently, so I had to lower the hot bed temp by 10 degrees and th...
2,169
<p>I'm not sure if it's my system, although I haven't done anything unusual with it, but I've started noticing incorrectly rendered characters popping up in web pages, text-files, <a href="http://ejohn.org/blog/html5-doctype/" rel="nofollow noreferrer">like this</a>:</p> <p><a href="http://www.kbssource.com/strange-ch...
<p>It appears that for this particular author, the text was edited in some editor that assumed it wasn't UTF8, and then re-wrote it out in UTF8. I'm basing this off the fact that if I tell my browser to interpret the page as different common encodings, none make it display correctly. This tells me that some conversion ...
<p>I'm fairly positive it's nothing you can do. I've seen this on the front page of digg alot recently. It more than likely has to do with a character being encoded improperly. Not necessarily a factor of the font, just a mistake made somewhere in translation.</p>
2,754
<p>I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set.</p> <p>Something like:</p> <pre><code>Record.find(:all).date.unique.count </code></pre> <p>but of course, that doesn't seem to work.</p>
<p>What you're going for is the following SQL:</p> <pre><code>SELECT COUNT(DISTINCT date) FROM records </code></pre> <p>ActiveRecord has this built in:</p> <pre><code>Record.count('date', :distinct =&gt; true) </code></pre>
<p>Also, make sure you have an index on the field in your db, or else that query will quickly become sloooow.</p> <p>(It's much better to do this in SQL, otherwise you pull the entire db table into memory just to answer the count.)</p>
5,722
<p>Drawing a parallelgram is nicely supported with Graphics.DrawImage:</p> <pre><code>Bitmap destImage = new Bitmap(srcImage.Width, srcImage.Height); using (Graphics gr = new Graphics.FromImage(destImage)) { Point[] destPts = new Point[] { new PointF(x1, y1), new PointF(x2, y2), new PointF(x4, y4)}; g...
<p>Normally you would do this with a 3x3 Matrix, but the Matrix class only lets you specify 6 values instead of 9. You might be able to do this in Direct X.</p>
<p>Closest I can find is <a href="http://vckicks.110mb.com/image-distortion.html" rel="nofollow noreferrer">this information</a>, which is extremely laggy.</p>
5,922
<p>If I have a </p> <pre><code>&lt;input id="uploadFile" type="file" /&gt; </code></pre> <p>tag, and a submit button, how do I determine, in IE6 (and above) if a file has been selected by the user.</p> <p>In FF, I just do:</p> <pre><code>var selected = document.getElementById("uploadBox").files.length &gt; 0; </cod...
<p>This works in IE (and FF, I believe):</p> <pre><code>if(document.getElementById("uploadBox").value != "") { // you have a file } </code></pre>
<p>The accepted answer is correct to check with &quot;ID&quot;</p> <p>But, those who are here to check file with <strong>class-name</strong>,</p> <p>here is the code:</p> <pre><code>var elements = document.getElementsByClassName('uploadFile_ClassName'); for (var i = 0; i &lt; elements.length; ++i) { if(elements[i]....
6,827
<blockquote> <p>This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, <strong>so please do not use it as evidence that you can ask similar questions here.</strong></p> <p>More info: <a href="https://stackoverflow.com/faq">https:/...
<p>If you place a file named <strong><em>app_offline.htm</em></strong> in the root of a web application directory, ASP.NET 2.0+ will shut-down the application and stop normal processing any new incoming requests for that application, showing only the contents of the app_offline.htm file <em>for all new requests</em>.</...
<p>This seems like a huge, vague question... But I will throw in Reflection, as it has allowed me to do some incredibly powerful things like pluggable DALs and such.</p>
7,859
<p>I know this site is written using ASP.Net MVC and I do not see "/Home" in the url. This proves to me that it can be done. What special route and do I need?</p>
<p>Just change "Home" to an empty string.</p> <pre><code>routes.MapRoute( "Home", "", new { action = Index, controller = Home } ); </code></pre>
<p>In IIS 7, you can simply delete the Default.aspx file that comes with ASP.NET MVC (assuming you're running on Preview 3 or higher). That file was needed due to an issue with Cassini that was fixed in .NET 3.5 SP1.</p> <p>For more details check out:</p> <p><a href="http://haacked.com/archive/2008/04/10/upcoming-cha...
3,627
<p>What's the best framework for writing modules -- <a href="http://search.cpan.org/perldoc/ExtUtils::MakeMaker" rel="noreferrer">ExtUtils::MakeMaker</a> (h2xs) or <a href="http://search.cpan.org/perldoc/Module::Build" rel="noreferrer">Module::Build</a>?</p>
<p><strong>NOTE</strong> This advice is out of date. <a href="http://www.dagolden.com/index.php/2140/paying-respect-to-modulebuild/" rel="nofollow noreferrer">Module::Build has been removed from the Perl core</a> but lives on as a CPAN module. The pros and cons still stand, and my opinions about MakeMaker still stand...
<p>EU::MM still seems to be the most widely supported and popular one, but Module::Build is catching up. Also, check out <a href="http://search.cpan.org/dist/Module-Starter/" rel="nofollow noreferrer">Module::Starter</a> for a module that will help you get started.</p>
9,958
<p>My LCD rotates. The software that comes with my ATI card to rotate the desktop just crashes (<em>I've uninstalled, reinstalled and rolled them back, still crashes</em>). Is there any other way to rotate a Windows XP Desktop by 90 degree increments? I am looking for either software or code (any language is fine.) ...
<p>IRotate: <a href="http://www.entechtaiwan.net/util/irotate.shtm" rel="nofollow noreferrer">http://www.entechtaiwan.net/util/irotate.shtm</a>.<br> Have not used it but heard good things.</p> <p>Same people that make Powerstrip <a href="http://www.entechtaiwan.net/util/ps.shtm" rel="nofollow noreferrer">http://www.en...
<p>I hate to give you the answer you probably already know, but yeah this is a video card driver software thing and if the ATI software crashes then it's either corrupted or buggy or your Windows install has gone rotten.</p> <p>I've done this before on my NVidia-based cards without issue. I've never owned an ATI card....
6,917
<p>Yesterday I wanted to add a boolean field to an Oracle table. However, there isn't actually a boolean data type in Oracle. Does anyone here know the best way to simulate a boolean? Googling the subject discovered several approaches</p> <ol> <li><p>Use an integer and just don't bother assigning anything other tha...
<p>I found <a href="http://www.techrepublic.com/article/oracle-tip-choosing-an-efficient-design-for-boolean-column-values/" rel="noreferrer">this</a> link useful.</p> <p>Here is the paragraph highlighting some of the pros/cons of each approach.</p> <blockquote> <p>The most commonly seen design is to imitate the man...
<p>In our databases we use an enum that ensures we pass it either TRUE or FALSE. If you do it either of the first two ways it is too easy to either start adding new meaning to the integer without going through a proper design, or ending up with that char field having Y, y, N, n, T, t, F, f values and having to remembe...
4,991
<p>The <a href="http://en.wikipedia.org/wiki/ANSI_C" rel="noreferrer">Wikipedia article on ANSI C</a> says:</p> <blockquote> <p>One of the aims of the ANSI C standardization process was to produce a superset of K&amp;R C (the first published standard), incorporating many of the unofficial features subsequently intro...
<p>There may be some confusion here about what "K&amp;R C" is. The term refers to the language as documented in the first edition of "The C Programming Language." Roughly speaking: the input language of the Bell Labs C compiler circa 1978.</p> <p>Kernighan and Ritchie were involved in the ANSI standardization process....
<p>Despite all the claims to the contary K&amp;R was and is quite capable of providing any sort of stuff from low down close to the hardware on up. The problem now is to find a compiler (preferably free) that can give a clean compile on a couple of millions of lines of K&amp;R C without out having to mess with it.And r...
4,253
<p>I am writing a few extensions to mimic the map and reduce functions in Lisp.</p> <pre><code>public delegate R ReduceFunction&lt;T,R&gt;(T t, R previous); public delegate void TransformFunction&lt;T&gt;(T t, params object[] args); public static R Reduce&lt;T,R&gt;(this List&lt;T&gt; list, ReduceFunction&lt;T,R&gt; ...
<p>These look very similar to extensions in Linq already:</p> <pre><code>//takes a function that matches the Func&lt;T,R&gt; delegate listInstance.Aggregate( startingValue, (x, y) =&gt; /* aggregate two subsequent values */ ); //takes a function that matches the Action&lt;T&gt; delegate listInstance.ForEach...
<p>You might want to add a way to do a map but return a new list, instead of working on the list passed in (and returning the list can prove useful to chain other operations)... perhaps an overloaded version with a boolean that indicates if you want to return a new list or not, as such:</p> <pre><code>public static Li...
6,127
<p>We created several custom web parts for SharePoint 2007. They work fine. However whenever they are loaded, we get an error in the event log saying:</p> <blockquote> <p>error initializing safe control - Assembly: ...</p> </blockquote> <p>The assembly actually loads fine. Additionally, it is correctly listed in th...
<p>You need to add a safecontrol entry to the web,config file, have a look at the following:</p> <pre><code>&lt;SafeControls&gt; &lt;SafeControl Assembly = "Text" Namespace = "Text" Safe = "TRUE" | "FALSE" TypeName = "Text"/&gt; ... &lt;/SafeControls&gt; </code></pre> <p><a href="http://msdn.micro...
<p>This is because of the amount of list items in the lists. Your server takes to much time to migrate all the list items and it fails, try deleiting the list items or configuring the server.</p> <p>Regards, Mariano.</p>
4,546
<p>I'm currently working on a project that requires encrypted data be passed between WCF hosts. As I understand it there are only 2 ways to ensure that data passed over WCF is secure. </p> <ol> <li>Using Certificates</li> <li>Using a Domain (or having the same username and password on every machine on the network)</li...
<p>Encryption requires a key. Keys are usually implemented as certificates. If you own both sides of the communication, you can create your own certificate for free without having to go buy one from a trusted root authority.</p>
<p>If you are using a http endpoint, you can use a secure transport such as https.</p>
7,345
<p>I wrote an application that currently runs against a local instance of MySql. I would like to centralize the DB somewhere on the Net, and share my application.</p> <p>But, I'm cheap, and don't want to pay for it. Does anyone know of a free on-line relational DB service that I could connect to via C#?</p>
<p>What about <a href="http://www.freesql.org" rel="nofollow noreferrer">http://www.freesql.org</a> ? Seems like you can't be too picky when you're asking for free, and this seems to offer something.</p>
<p>Sounds like you need <a href="http://www.amazon.com/SimpleDB-AWS-Service-Pricing/b?ie=UTF8&amp;node=342335011" rel="nofollow noreferrer">Amazon SimpleDB</a>...</p> <p>It's not free, but pricing looks pretty good. I've not used it myself, but when I've got a bit of spare time I might use it for a project I'm working...
3,037
<p>I'm running PHP, Apache, and Windows. I do not have a domain setup, so I would like my website's forms-based authentication to use the local user accounts database built in to Windows (I think it's called SAM).</p> <p>I know that if Active Directory is setup, you can use the PHP LDAP module to connect and authenti...
<p>I haven't found a simple solution either. There are examples using CreateObject and the WinNT ADSI provider. But eventually they all bump into <a href="http://support.microsoft.com/kb/218497" rel="nofollow noreferrer"> User authentication issues with the Active Directory Service Interfaces WinNT provider</a>. I'm no...
<p>Good Question!</p> <p>I've given this some thought... and I can't think of a good solution. What I can think of is a horrible horrible hack that just might work. After seeing that no one has posted an answer to this question for nearly a day, I figured a bad, but working answer would be ok. </p> <p>The SAM file ...
8,550
<p>E3D hotends use a thermistor whose legs are insulated with glass fiber sleeving and clamped down with a screw and washer:</p> <p><a href="https://i.stack.imgur.com/IAJDy.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/IAJDy.jpg" alt="enter image description here"></a></p> <p>This solution enables the pri...
<p>I like the mounting method on my Mk9 extruder: there's a small hole drilled into the heat block, parallel to the heater hole. B3 Innovations sells a thermistor packaged into a small spring. The whole assembly goes in the hole, and a setscrew (gently!) secures it. You could just as well put a bare thermistor into a s...
<p>I have now purchased a hot-end block from <a href="https://www.3dprinterspares.eu/heat-block-upgrade-kit-for-prusa-i3--compatiable-3d-printers-73-p.asp" rel="nofollow noreferrer">here</a>, that has a "cartridge style" cylindrical thermistor that fits into a drilled hole of the hot-end block, and is fixed by an addit...
149
<p>I have a Chiron from Anycubic and I have had some leveling issues in the last few weeks, however, I believe that I have sorted that. The layers attached to the base plate or the raft now come out very weird and I am uncertain why. I heard that this is caused by the extruder being too cold but I have turned up the te...
<p>Not sure what the other answers are talking about. From the picture, your nozzle is just way too far from the bed and the extruded material is just barely making contact. Adjust it so that, when moved to position Z=0.2, there is exactly 0.2 mm between the nozzle tip and the bed. Then fine-tune with single-layer test...
<p>What software do you use? Your nozzle diameter seems to be selected incorrectly or you have a slightly enlarged nozzle. Buy an unused nozzle and make your bed adjustments again.</p> <p>Select correct a nozzle diameter (such as 0.4 mm, 0.6 mm) and slice your print again. For PLA, I suggest using 200-215 °C for better...
2,050
<p>How do you use network sockets in Pascal? ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>
<p>Here's an example taken from <a href="http://www.bastisoft.de/programmierung/pascal/pasinet.html" rel="nofollow noreferrer">http://www.bastisoft.de/programmierung/pascal/pasinet.html</a></p> <pre><code>program daytime; { Simple client program } uses sockets, inetaux, myerror; const RemotePort : Word = 13; ...
<p>If you are using Delphi, I highly recommend <a href="http://www.indyproject.org/index.en.aspx" rel="nofollow noreferrer">Indy</a> sockets, a set of classes for easy manipulation of sockets and many other internet protocols (HTTP, FTP, NTP, POP3 etc.)</p>
3,775
<p>Is there an easy way to set the zoom level for a windows form in C#? In VBA there was a zoom property of the form.</p>
<p>I had the same problem and I solved it this way in c#. Code goes on Form load</p> <pre><code>float scaleX = ((float)Screen.PrimaryScreen.WorkingArea.Width / 1024); float scaleY = ((float)Screen.PrimaryScreen.WorkingArea.Height / 768); SizeF aSf = new SizeF(scaleX, scaleY); this.Scale(aSf); </code></pre> <p>This "m...
<p>There is no way (that I know of) to do what you ask with typical WinForms.</p> <p>If you're doing custom painting/drawing, you can zoom that by using a zoom transform, but so far as I know there is no "Zoom" property for the form in the entire world of .NET and native Windows/C++ APIs combined.</p> <p>You could pr...
5,605
<p>How do you create your own custom moniker (or URL Protocol) on Windows systems?</p> <p>Examples:</p> <ul> <li>http:</li> <li>mailto:</li> <li>service:</li> </ul>
<p>Take a look at <a href="http://msdn.microsoft.com/en-us/library/aa741006(VS.85).aspx" rel="nofollow noreferrer">Creating and Using URL Monikers</a> , <a href="http://msdn.microsoft.com/en-us/library/aa767916(VS.85).aspx" rel="nofollow noreferrer">About Asynchronous Pluggable Protocols</a> and <a href="http://msdn.mi...
<p><em>Inside OLE</em> from Craig Brockschmidt probably has the best coverage on monikers. If you want to dig a little deeper into this topic, I'd recommend getting this book. It is also contained on the MSDN disk that came along with VS 6.0, in case you still have that.</p>
2,665
<p>Questions #1 through #4 on the <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" rel="nofollow noreferrer">Joel Test</a> in my opinion are all about the development tools being used and the support system in place for developers:</p> <ol> <li>Do you use source control? </li> <li>Can you make a bui...
<ol> <li>source control: <a href="http://subversion.tigris.org/" rel="nofollow noreferrer">Subversion</a> or <a href="http://www.selenic.com/mercurial/wiki/" rel="nofollow noreferrer">Mercurial</a> or <a href="http://git-scm.com/" rel="nofollow noreferrer">Git</a></li> <li>build automation: <a href="http://nant.sourcef...
<p>A good issue tracker that was relatively inexpensive was <a href="http://axosoft.com/products/ontime.aspx" rel="nofollow noreferrer">axoSoft OnTime</a>. I used it for years before getting MS TFS.</p> <p><a href="http://nant.sourceforge.net/" rel="nofollow noreferrer">Nant</a> and <a href="http://confluence.public.t...
3,579
<p>We have a client that has Oracle <em>Standard</em>, and a project that would be ten times easier addressed using OLAP. However, Oracle only supports OLAP in the <em>Enterprise</em> version.</p> <p>Migration to enterprise is <strong>not</strong> possible</p> <p>I'm thinking of doing some manual simulation of OLAP, ...
<p>You can simulate OLAP functionality using client side tools pointed at a relational database.</p> <p>Personally I think the best tool for the job is probably <a href="http://www.tableausoftware.com/" rel="noreferrer">Tableau Desktop</a>. This is an amazingly sophisticated front end analytics tool that will make you...
<p>Whilst MS SQL Server offers OLAP, you'll need an Enterprise licence to use a cube in a live environment that is web-facing.</p>
6,398
<p>A question related to <a href="https://stackoverflow.com/questions/28002">Regular cast vs. static_cast vs. dynamic_cast</a>:</p> <p>What cast syntax style do you prefer in C++?</p> <ul> <li>C-style cast syntax: <code>(int)foo</code></li> <li>C++-style cast syntax: <code>static_cast&lt;int&gt;(foo)</code></li> <li>...
<p>It's best practice <em>never</em> to use C-style casts for three main reasons:</p> <ul> <li>as already mentioned, no checking is performed here. The programmer simply cannot know which of the various casts is used which weakens strong typing</li> <li>the new casts are intentionally visually striking. Since casts of...
<p>C-style cast syntax, do not error check. C++-style cast syntax, does some checking. When using static_cast, even if it doesn't do checking, at least you know you should be carefull here.</p>
5,210