instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>In terms of performance and optimizations:</p> <ul> <li>When constructing a table in SQL Server, does it matter what order I put the columns in?</li> <li>Does it matter if my primary key is the first column?</li> <li>When constructing a multi-field index, does it matter if the columns are adjacent?</li> <li>Using A...
<p>In SQL Server 2005, placement of nullable variable length columns has a space impact - placing nullable variable size columns at the end of the definition can result in less space consumption.</p> <p>SQL Server 2008 adds the &quot;SPARSE&quot; column feature which negates this difference.</p> <p>See <a href="https:/...
<p>For the first bullet:</p> <p><strong>Yes</strong>, column order <em>does</em> matter, at least if you are using the deprecated BLOBs <code>image</code>, <code>text</code>, or <code>ntext</code>, and using SQL Server &lt;= 2005.</p> <p>In those cases, you should have those columns at the 'end' of the table, and the...
5,520
<p>I'm looking to the equivalent of Windows <a href="http://msdn.microsoft.com/fr-fr/library/yeby3zcb.aspx" rel="noreferrer"><code>_wfopen()</code></a> under Mac OS X. Any idea?</p> <p>I need this in order to port a Windows library that uses <code>wchar*</code> for its File interface. As this is intended to be a cross...
<p>POSIX API in Mac OS X are usable with UTF-8 strings. In order to convert a wchar_t string to UTF-8, it is possible to use the CoreFoundation framework from Mac OS X. </p> <p>Here is a class that will wrap an UTF-8 generated string from a wchar_t string.</p> <pre><code>class Utf8 { public: Utf8(const wchar_t* w...
<p>If you're using Cocoa it's fairly easy with NSString. Just load the UTF16 data in using -initWithBytes:length:encoding: (or perhaps -initWithCString:encoding:) and then get a UTF8 version by calling UTF8String on the result. Then, just call fopen with your new UTF8 string as the param.</p> <p>You can definitely ca...
3,337
<p>I have some SQL Server DTS packages that import data from a FoxPro database. This was working fine until recently. Now the script that imports data from one of the FoxPro tables bombs out about 470,000 records into the import. I'm just pulling the data into a table with nullable varchar fields so I'm thinking it ...
<p><a href="http://www.cmstory.com/_cm/CMrepair.zip" rel="nofollow noreferrer">Cmrepair</a> is an excellent freeware utility to repair corrupted .DBF files.</p>
<p>@Lance:</p> <p>if you have access to Visual FoxPro command line window, type:</p> <pre><code>SET TABLEVALIDATE 11 USE "YourTable" EXCLUSIVE &amp;&amp; If the table is damaged VFP must display an error here PACK &amp;&amp; To reindex the table and deleted "marked" records PACK MEMO &amp;&amp; If you have m...
3,151
<p>Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct application/viewer.</p> <p>Assumption: The browser figures out which application/viewer to use by the mime-type (content-type?) h...
<p>The python-magic method suggested by <a href="https://stackoverflow.com/a/2133843/5337834">toivotuo</a> is outdated. <a href="http://github.com/ahupp/python-magic" rel="noreferrer">Python-magic's</a> current trunk is at Github and based on the readme there, finding the MIME-type, is done like this.</p> <pre><code># ...
<p>I 've tried a lot of examples but with Django <a href="http://mutagen.readthedocs.io" rel="nofollow noreferrer">mutagen</a> plays nicely. </p> <p>Example checking if files is <code>mp3</code> </p> <pre><code>from mutagen.mp3 import MP3, HeaderNotFoundError try: audio = MP3(file) except HeaderNotFoundError...
6,518
<p>In .Net you can read a string value into another data type using either <code>&lt;datatype&gt;.parse</code> or <code>Convert.To&lt;DataType&gt;</code>. </p> <p>I'm not familiar with the fundamentals of parse versus convert so I am always at a loss when asked which one is better/faster/more appropriate. </p> <p>So ...
<p>The <code>Convert.ToXXX()</code> methods are for objects that might be of the correct or similar type, while <code>.Parse()</code> and <code>.TryParse()</code> are specifically for strings:</p> <pre><code>//o is actually a boxed int object o = 12345; //unboxes it int castVal = (int) 12345; //o is a boxed enum obj...
<p>There is also the DirectCast method which you should use only if you are sure what the type of the object is. It is faster, but doesn't do any proper checks. I use DirectCast when I'm extracting values from a loosely typed DataTable when I know the type for each column.</p>
3,906
<p>How stable is WPF not in terms of stability of a WPF program, but in terms of the 'stability' of the API itself. </p> <p>Let me explain: </p> <p>Microsoft is notorious for changing its whole methodology around with new technology. Like with the move from silverlight 1 to silverlight 2. With WPF, I know that MS c...
<p>MS do have a history of "fire and movement" with regards to introducing new technology into their development stack, but they also have a strong history of maintaining support for the older stuff, and backwards-compatibility. WPF seems to be getting stuff added to it with each new release of the framework but the th...
<p>WPF is pretty stable as far as changes go. Silverlight is still in flux. Though you may watch out since silverlight brought the concept of the state manager(instead of implementing triggers) which may get adopted in wpf... </p> <p>If that happens there will be multiple ways to defining control templates and behav...
5,142
<p>Can you use CMFCVisualManager with a dialog based application to change the applications appearance? If so how is it done?</p> <p>The idea is to change the shape, colour etc. of controls such as push buttons using the MFC Feature Pack released with MSVC 2008.</p>
<p>No, can't be done, at least not if you're talking about the Feature Pack version. Version 10 of the BCGSoft libraries do have this functionality, see for example: <a href="http://www.bcgsoft.com/bcgcontrolbarpro-versions.htm" rel="nofollow noreferrer">http://www.bcgsoft.com/bcgcontrolbarpro-versions.htm</a> and <a h...
<p>You need to add the Common Controls manifest to your project resources. Here is the code for the manifest file:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt; &lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&gt; &lt;assemblyIdentity version="1.0.0.0" proces...
9,820
<p>I'm developing some cross platform software targeting Mono under Visual Studio and would like to be able to build the installers for Windows and Linux (Ubuntu specifically) with a single button click. I figure I could do it by calling cygwin from a post-build event, but I was hoping for at best a Visual Studio plugi...
<p>I am not aware of any plugin that does it natively, especially since Mono users seem to prefer <a href="http://www.monodevelop.com/Main_Page" rel="nofollow noreferrer">MonoDevelop</a>.</p> <p>However, it should be possible to use Cygwin and a custom MSBuild Task or Batch file in order to achieve that by using the n...
<p>If you don't mind using Java tools it's possible to build Debian packages with <a href="https://github.com/tcurdt/jdeb" rel="nofollow">jdeb</a> in an Ant script. That's probably lighter than relying on Cygwin.</p>
2,526
<p>I'd like to write a script/batch that will bunch up my daily IIS logs and zip them up by month.</p> <p>ex080801.log which is in the format of ex<em>yymmdd</em>.log</p> <p>ex080801.log - ex080831.log gets zipped up and the log files deleted.</p> <p>The reason we do this is because on a heavy site a log file for on...
<p>You'll need a command line tool to zip up the files. I recommend <a href="http://www.7-zip.org/download.html" rel="noreferrer">7-Zip</a> which is free and easy to use. The self-contained command line version (7za.exe) is the most portable choice.</p> <p>Here's a two-line batch file that would zip the log files and ...
<p>Regex will do the trick... create a perl/python/php script to do the job for you..<br> I'm pretty sure windows batch file can't do regex.</p>
4,914
<p>My users are having an intermittent error when using a Windows Forms application built in VB.NET 3.5. Apparently when they click on the form and the form re-paints, a red 'X' will be painted over the MenuStrip control and the app will crash with the following error. </p> <p>Has anyone seen this before? Can someone ...
<p>First rule of working with Visual Studio:</p> <ul> <li><strong>Install <a href="http://www.jetbrains.com/resharper/" rel="noreferrer">ReSharper</a></strong></li> </ul>
<p>I have a tip regarding the "Track Active Item" option mentioned above, for when working with big projects. It's posted here:</p> <p><a href="https://stackoverflow.com/questions/31163/forcing-the-solution-explorer-to-select-the-file-in-the-editor-in-visual-studio#46193">Forcing the Solution Explorer to select the fi...
6,794
<p>I have a FlashForge CreatorX (MakerBot clone) that's been working fine for about 15 months. Int he past month, I started noticing "thin" layers in some of my ABS prints. I finally tracked the issue down to the extruder gear grinding the filament (after a while, enough filament had ground off that the gear teeth were...
<p>Usually there is no need to clean the hotend, as filament sticks well to itself rather than to the inside of the hotend. If there are remains - the simplest way to clean it up is to extrude 5-10 cm of new filament, which will gather all remainings clean the hotend.</p> <p>The above concerns changing filament in the...
<p>Or you can use atomic nozle clianning!It woks fine for me :) <a href="https://www.youtube.com/watch?v=04T8zdgyh3E" rel="nofollow">https://www.youtube.com/watch?v=04T8zdgyh3E</a></p>
293
<p>I've got two models: Message and Attachment. Each attachment is attached to a specific message, using a ForeignKey on the Attachment model. Both models have an auto_now DateTimeField called updated. I'm trying to make it so that when any attachment is saved, it also sets the updated field on the associated message t...
<p>You would also need to then save the message. Then it that should work.</p>
<p>DateTime fields with auto_now are automatically updated upon calling <code>save()</code>, so you do not need to update them manually. Django will do this work for you.</p>
4,131
<p>I've read that it is possible to add a method to an existing object (i.e., not in the class definition) in Python. </p> <p>I understand that it's not always good to do so. But how might one do this?</p>
<p>In Python, there is a difference between functions and bound methods.</p> <pre><code>&gt;&gt;&gt; def foo(): ... print &quot;foo&quot; ... &gt;&gt;&gt; class A: ... def bar( self ): ... print &quot;bar&quot; ... &gt;&gt;&gt; a = A() &gt;&gt;&gt; foo &lt;function foo at 0x00A98D70&gt; &gt;&gt;&gt; a.b...
<p>Apart from what others said, I found that <code>__repr__</code> and <code>__str__</code> methods can't be monkeypatched on object level, because <code>repr()</code> and <code>str()</code> use class-methods, not locally-bounded object methods:</p> <pre><code># Instance monkeypatch [ins] In [55]: x.__str__ = show.__ge...
2,339
<p>We have a custom-built Flash-based video player that I maintain, and it needs to support preroll ads and ideally both progressive video playback and streaming depending on a server switch.</p> <p>I've been working with the flvPlayback component but am finding myself a little out of my depth. Are there any good tuto...
<p>I would definitely have a look at the JW Flash Media Player:</p> <p><a href="http://www.jeroenwijering.com/?item=JW_FLV_Player" rel="nofollow noreferrer">http://www.jeroenwijering.com/?item=JW_FLV_Player</a></p> <p>It's Open Source, and I found the Source quite clean and easy to understand, it also supports playli...
<p>I don't really like the flvPlayback-component, it's hard to handle both implementation wise and somewhat tricky to skin nicely and it's also quite bloated. So I'd opt to use either the JW Flash Media Player as recommended by Michael above or rolling my own entirely. </p>
2,926
<p>What are the steps required to enable Hibernate's second-level cache, when using the Java Persistence API (annotated entities)? How do I check that it's working? I'm using JBoss 4.2.2.GA.</p> <p>From the Hibernate documentation, it seems that I need to enable the cache and specify a cache provider in <em>persistenc...
<p>I believe you need to add the cache annotations to tell hibernate how to use the second-level cache (read-only, read-write, etc). This was the case in my app (using spring / traditional hibernate and ehcache, so your mileage may vary). Once the caches were indicated, I started seeing messages that they were in use f...
<p>Follow-up: in the end, after adding annotations, I have it working with EhCache, i.e.</p> <pre><code>&lt;property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.EhCacheProvider" /&gt; </code></pre>
7,707
<p>I've been interested in 3D printing for the past month however, I have noticed that it's sort of a "reserved" topic. Meaning that everyone who talks about it, has already some basic knowledge about the topic. What are some good resources for someone who wants to start learning from zero? My main goal is to acquire e...
<p>You can learn a lot just by reading the forums. I'll just list a few that are quite popular...</p> <p><a href="http://forums.reprap.org/" rel="nofollow">Reprap Forums</a> - Has a ton of information on DIY printers including build logs and posts dealing with many issues.</p> <p><a href="http://www.soliforum.com" r...
<p>ADDITIVE MANUFACTURING TECHNOLOGIES 3D Printing, Rapid Prototyping, and Direct Digital Manufacturing</p> <p>Springer</p> <p>I think its a perfect book. A lot of details to all technologies. *Beware there is math and physics involved.</p> <p><a href="https://i.stack.imgur.com/52f1O.jpg" rel="nofollow noreferrer"><...
271
<p>What is the best way to get and set the meta data for mp3, mp4, avi files etc. with .NET?</p>
<p>I use <a href="http://mediainfo.sourceforge.net/en" rel="noreferrer">MediaInfo</a> with my C# apps, gives you a lot of information about media files.</p>
<p>Looks like MediaInfo is read-only at this point, by the way: <a href="http://sourceforge.net/forum/message.php?msg_id=4241318&amp;abmode=1" rel="nofollow noreferrer">http://sourceforge.net/forum/message.php?msg_id=4241318&amp;abmode=1</a></p> <p>Very cool project, though. It's fun finding out about all this cool st...
3,056
<p>It seems that Silverlight/WPF are the long term future for user interface development with .NET. This is great because as I can see the advantage of reusing XAML skills on both the client and web development sides. But looking at WPF/XAML/Silverlight they seem very large technologies and so where is the best place t...
<p>Should you learn ASP.NET or Winforms first? ASP or MFC? HTML or VB? C# or VB? </p> <p>Set aside the idea that there is a logical progression through what has become a highly complex interwoven set of technologies, and take a step back and ask yourself a series of questions:</p> <ul> <li>What are your goals; how do...
<p>Some tips at <a href="https://stackoverflow.com/questions/60620/getting-started-with-silverlight-development">Getting started with Silverlight Development</a></p>
8,647
<p>Starting a new project and would like to use one of the MVC framworks. <a href="http://www.asp.net/mvc/" rel="nofollow noreferrer">ASP.NET MVC</a> is still in preview but <a href="http://springframework.net/" rel="nofollow noreferrer">Spring.net</a> is in production and has a history with Java. I'd like to know th...
<p>I am a little confused by the question. Spring.Net is a dependency injection framework that you can use in ASP.NET MVC. I kind of based my answer off what you are actually asking though. The difference between ASP.NET MVC and another MVC framework that runs in ASP.NET.</p> <p>If you are worried about using ASP.N...
<p>I have an impression that Spring.NET never really took off, or at least not as much as <a href="http://www.castleproject.org/MonoRail/" rel="nofollow noreferrer">Castle Project Monorail</a>. </p> <p>From what I understand, Spring.NET has also departed from Java Spring's implementation, so there will a steeper than ...
6,463
<p>I'm using Castle Windsor to do some dependency injection, specifically I've abstracted the DAL layer to interfaces that are now being loaded by DI.</p> <p>Once the project is developed &amp; deployed all the .bin files will be in the same location, but for while I'm developing in Visual Studio, the only ways I can ...
<p>Could you set the build output path of the concrete DAL project to be the bin folder of the dependent project? </p>
<p>Mike: Didn't think of that, that could work, have to remember to turn off copy-local for any libraries / projects that are common between them</p>
5,156
<p>My company is going to be storing sensitive data for our customers, and will be encrypting data using one of the managed .NET encryption algorithm classes. Most of the work is done, but we haven't figured out how/where to store the key. I've done some light searching and reading, and it seems like a hardware solutio...
<p>There only two real solutions for (the technical aspect of) this problem. Assuming it's only the application itself that needs access the key...</p> <ol> <li><p>Hardware Security Module (HSM) - usually pretty expensive, and not simple to implement. Can be dedicated appliance (e.g. nCipher) or specific token (e.g. ...
<p><a href="http://www.microsoft.com/rms" rel="nofollow noreferrer">Microsoft Rights Management Server (RMS)</a> has a similar problem. It just solves it by encrypting its configuration with a master password. ...A password on a password, if you will.</p>
7,280
<p>I have about 150 000 rows of data written to a database everyday. These row represent outgoing articles for example. Now I need to <strong>show a graph using <a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/2005ssrs.mspx" rel="nofollow noreferrer">SSRS</a> that show the average number of articles per d...
<p>The neat thing with SSAS is that you can get those indicators that you talk about quite easily either by creating calculated measures or by using KPIs.</p> <p>I started with <a href="https://rads.stackoverflow.com/amzn/click/com/0072260904" rel="nofollow noreferrer" rel="nofollow noreferrer">Delivering Business Int...
<p>SSAS is an <a href="http://en.wikipedia.org/wiki/Extract,_transform,_load" rel="nofollow noreferrer">ETL</a> tool. Basically you get data from somewhere (your outgoing articles), do something to it (aggregate), and put it somewhere else (your aggregates table, data warehouse, etc). Check the link for details. </p> ...
4,938
<p>Why does the following code sometimes causes an Exception with the contents "CLIPBRD_E_CANT_OPEN":</p> <pre><code>Clipboard.SetText(str); </code></pre> <p>This usually occurs the first time the Clipboard is used in the application and not after that.</p>
<p>Actually, I think this is the <a href="https://cloudblogs.microsoft.com/enterprisemobility/2006/11/20/why-does-my-shared-clipboard-not-work-part-2/" rel="noreferrer">fault of the Win32 API</a>.</p> <p>To set data in the clipboard, you have to <a href="http://msdn.microsoft.com/en-us/library/ms649048(VS.85).aspx" re...
<p>The difference between Cliboard.SetText and Cliboard.SetDataObject in WPF is that the text is not copied to the clipboard, only the pointer. I checked the source code. If we call SetDataObject(data, true) Clipoard.Flush() will also be called. Thanks to this, text or data is available even after closing the applicati...
9,423
<p>I know this is still gray territory and it is asked so many times within the 3D printing and maker community but I'm curious about the limits of 3D models and were it touches on Free Use and infringement. I'm not trying to push the envelope, I just want to be clear on the matter.</p> <p>Is it legal if a design is r...
<p>Whether or not you sell, distribute, release, license, profit from, claim ownership, etc... of something does not matter for copyright law. Copyright prohibits the very act of well, <em>copying</em>. Specifically, if a work is protected by copyright, you can't (among other things)</p> <blockquote> <ul> <li><p>make a...
<p>Well I think it's a good question, but like what was already stated this question is extremely broad. I am however curious as well. If I take what has already been said literally and apply it to a 3D model of a palm tree, for example. From what y'all are saying, everyone that has ever made a 3D model after the first...
547
<p>I'm trying to call a 3rd party vendor's C DLL from vb.net 2005 and am getting <code>P/Invoke</code> errors. I'm successfully calling other methods but have hit a bottle-neck on one of the more complex. The structures involved are horrendous and in an attempt to simplify the troubleshooting I'd like to create a C++...
<p>Try using the <a href="http://msdn.microsoft.com/en-us/library/3y1sfaz2.aspx" rel="nofollow noreferrer">__decspec(dllexport)</a> magic pixie dust in your C++ function declaration. This declaration sets up several things that you need to successfully export a function from a DLL. You may also need to use WINAPI or so...
<p>You can try to look at the exported functions (through DumpBin or Dependency Walker) and see if the names are mangled.</p>
6,009
<p>Ruby has two different exceptions mechanisms: Throw/Catch and Raise/Rescue.</p> <p>Why do we have two?</p> <p>When should you use one and not the other? </p>
<p>I think <a href="http://hasno.info/ruby-gotchas-and-caveats" rel="noreferrer">http://hasno.info/ruby-gotchas-and-caveats</a> has a decent explanation of the difference:</p> <blockquote> <p>catch/throw are not the same as raise/rescue. catch/throw allows you to quickly exit blocks back to a point where a catch is ...
<p><a href="https://coderwall.com/p/lhkkug/don-t-confuse-ruby-s-throw-statement-with-raise" rel="noreferrer">https://coderwall.com/p/lhkkug/don-t-confuse-ruby-s-throw-statement-with-raise</a> offers an excellent explanation that I doubt I can improve on. To summarize, nicking some code samples from the blog post as I g...
7,387
<p>Say I have a Student table, it's got an int ID. I have a fixed set of 10 multiple choice questions with 5 possible answers. I have a normalized answer table that has the question id, the Student.answer (1-5) and the Student.ID</p> <p>I'm trying to write a single query that will return all scores over a certain pe...
<p>If I understand your schema and question correctly, how about something like this:</p> <pre><code>select student_name, score from students join (select student_answers.student_id, count(*) as score from student_answers, answer_key group by student_id where student_answers.question_id = ans...
<p>The architecture you are talking about could become very cumbersome in the long run, and if you need to change the questions it means more changes to the UDF you are using.</p> <p>I would think you could probably do your analysis in code without necessarily de-normalizing your database. De-normalization could also...
4,243
<p>I'm creating an application that will store a hierarchical collection of items in an XML file and I'm wondering about the industry standard for storing collections in XML. Which of the following two formats is preferred? (If there is another option I'm not seeing, please advise.)</p> <p><strong>Option A</strong></p...
<p>I'm no XML expert, but I find Option B to be more human readable, and I think it's just as machine readable as Option A. I believe that XML is designed to be both human and machine readable, so I would go for Option B myself.</p> <hr> <p>I just realized something else after Ryan Farley's post. If the Students or C...
<p><strong>Definitely - Option B.</strong> </p> <p>I wouldn't mix students and classes in the XML just the same way that I wouldn't mix students and classes in the same table in a database. </p>
4,304
<p>Is there an IE6/PNG fix that is officially developed by the jQuery team?</p> <p>If not which of the available plugins should I use?</p>
<p>I'm using <a href="http://jquery.andreaseberhard.de/pngFix/" rel="nofollow noreferrer">jquery.pngFix.js</a>. I don't know if it's officially sanctioned or not, I do know that it works. I chose it because it was the plugin included with FancyBox, no other reason. </p>
<p>Hey guys, just wanted to toss this one in. I was digging around for it again and it has one specific advantage over the rest: repeatable backgrounds, as well as background-position (the one thats flagged as the best answer here actually just scales the background image). </p> <p><a href="http://www.dillerdesign.co...
8,572
<p>I've seen projects where the classes in the DB layer have just static functions in them and other projects where those classes need to be instantiated to get access to the member functions. </p> <blockquote> <p>Which is "better" and why?</p> </blockquote>
<p>I like a single object to be correlated to a single record in the database, i.e. an object must be instantiated. This is your basic <a href="http://martinfowler.com/eaaCatalog/activeRecord.html" rel="nofollow noreferrer">ActiveRecord</a> pattern. In my experience, the one-object-to-one-row approach creates a much ...
<p>It depends which model you subscribe to. ORM (Object Relational Model) or Interface Model. ORM is very popular right now because of frameworks like nhibernate, LINQ to SQL, Entity Framework, and many others. The ORM lets you customize some business constraints around your object model and pass it around with out ...
3,702
<p>100 (or some even number 2N :-) ) prisoners are in a room A. They are numbered from 1 to 100.</p> <p>One by one (from prisoner #1 to prisoner #100, in order), they will be let into a room B in which 100 boxes (numbered from 1 to 100) await them. Inside the (closed) boxes are numbers from 1 to 100 (the numbers insid...
<p>This puzzle is explained at <a href="https://web.archive.org/web/20090616153244/http://www.math.princeton.edu/~wwong/blog/blog200608191813.shtml" rel="nofollow noreferrer">http://www.math.princeton.edu/~wwong/blog/blog200608191813.shtml</a> and that person does a much better job of explaining the problem.</p> <p>Th...
<p>Maybe I'm not reading it right, but the question seems to be badly constructed or missing information.</p> <blockquote> <p>If he finds the number that was assigned to him in one of these 50 boxes, the prisoner gets to walk into a room C and all boxes are closed again before the next one walks into room ...
5,456
<p>I want to generate a thumbnail preview of videos in Java. I'm mostly JMF and video manipulation alienated. </p> <ul> <li>Is there an easy way to do it?</li> <li>What about codecs? Will I have to deal with it?</li> <li>Any video type is suported? (including Quicktime)</li> </ul>
<p>There seems to be a few examples out there that are far better than <a href="http://code.google.com/p/vitalopensource/source/browse/trunk/src/com/vtls/opensource/image/VideoImageSource.java" rel="noreferrer">what I was going to send you.</a></p> <p>See <a href="http://krishnabhargav.blogspot.com/2008/02/processing-...
<p>There is a relatively newer option called JThumbnailer that you find here: <a href="https://github.com/makbn/JThumbnail" rel="nofollow noreferrer">https://github.com/makbn/JThumbnail</a></p> <blockquote> <p>JThumbnail is a Java library for creating Thumbnails of common types of file including .doc, .docx, .pdf , .mp...
7,055
<p>Using <strong>NSURLRequest</strong>, I am trying to access a web site that has an expired certificate. When I send the request, my <strong>connection:didFailWithError</strong> delegate method is invoked with the following info:</p> <pre><code>-1203, NSURLErrorDomain, bad server certificate </code></pre> <p>My sear...
<p>The supported way of doing this requires using CFNetwork. You have to do is attach a kCFStreamPropertySSLSettings to the stream that specifies kCFStreamSSLValidatesCertificateChain == kCFBooleanFalse. Below is some quick code that does it, minus checking for valid results add cleaning up. Once you have done this You...
<p>Another option would be to use an alternate connection library.</p> <p>I am a huge fan of AsyncSocket and it has support for self signed certs</p> <p><a href="http://code.google.com/p/cocoaasyncsocket/" rel="nofollow noreferrer">http://code.google.com/p/cocoaasyncsocket/</a></p> <p>Take a look, I think it is way ...
3,608
<p>I am developing a web app which requires a username and password to be stored in the web.Config, it also refers to some URLs which will be requested by the web app itself and never the client.</p> <p>I know the .Net framework will not allow a web.config file to be served, however I still think its bad practice to l...
<ul> <li><a href="http://msdn.microsoft.com/en-us/library/zhhddkxy.aspx" rel="noreferrer">Encrypting and Decrypting Configuration Sections</a> (ASP.NET) on MSDN</li> <li><a href="http://weblogs.asp.net/scottgu/archive/2006/01/09/434893.aspx" rel="noreferrer">Encrypting Web.Config Values in ASP.NET 2.0</a> on ScottGu's ...
<p>Use aspnet_setreg.exe <a href="http://support.microsoft.com/kb/329290" rel="nofollow noreferrer">http://support.microsoft.com/kb/329290</a></p>
7,781
<p>I have this <a href="https://www.tme.eu/en/details/mf50151vx-a99/dc12v-fans/sunon/mf50151vx-b00u-a99/" rel="noreferrer">fan model</a>, it is a SUNON model number <a href="https://www.tme.eu/en/Document/b30ea71fee61d11101012e50df6ac0ad/MF50151VX-A99-DTE.pdf" rel="noreferrer">MF50151VX-B00U-A99</a> and it is a blower ...
<p>As discussed in the comments...</p> <p>The problem with the fan seems to be its flimsy attachment to the printer head. The fact the fan chassis is not firmly kept in place allows for it to act as a soundboard, amplyfing whatever vibration nomally occurs in the motor.</p> <p>You could probably get a fan that is mo...
<p>In response to Answer from MAC above. The Sunon Maglev Fan is actually an exceptional fan that is superior in all aspects from static pressure, CFM, Decibels... far superior to that of a radial fan like a Noctua. </p> <p><a href="http://www.sunon.com/index2/uFiles/file/03_products/08-catalog%20download/Sunon%20DC%2...
843
<p>What is the difference between <strong><code>const</code></strong> and <strong><code>readonly</code></strong> in C#? </p> <p>When would you use one over the other?</p>
<p>Apart from the apparent difference of</p> <ul> <li>having to declare the value at the time of a definition for a <code>const</code> VS <code>readonly</code> values can be computed dynamically but need to be assigned before the constructor exits. After that it is frozen.</li> <li><code>const</code>'s are implicitly <...
<p>One thing to add to what people have said above. If you have an assembly containing a readonly value (e.g. readonly MaxFooCount = 4; ), you can change the value that calling assemblies see by shipping a new version of that assembly with a different value (e.g. readonly MaxFooCount = 5;)</p> <p>But with a const, it...
7,986
<p>How would you make the contents of Flex RIA applications accessible to Google, so that Google can index the content and shows links to the right items in your Flex RIA. Consider a online shop, created in Flex, where the offered items shall be indexed by Google. Then a link on Google should open the corresponding pro...
<p>Currently the best technique for making an RIA indexable by search engines is called <a href="http://en.wikipedia.org/wiki/Progressive_enhancement" rel="nofollow noreferrer">progressive enhancement</a> (or graceful degradation, depending on which way you see it). Basically you create a simple HTML version of the app...
<p>There is a massive thread available here:</p> <p><a href="http://tech.groups.yahoo.com/group/flexcoders/message/58926" rel="nofollow noreferrer">http://tech.groups.yahoo.com/group/flexcoders/message/58926</a></p> <p>But essentially, google already indexes .SWF files (you can test this out yourself by restricting s...
8,877
<p>I want to draw kossel delta corner in fusion 360 for 2040 aluminium extrusion like on picture below, but cant find a way to actualy start, I draw 3 side polygon and 20x40mm rectangle but cant go from there, so do you have any suggestion?</p> <p><a href="https://i.stack.imgur.com/hxAR4.jpg" rel="nofollow noreferrer"...
<p>I attempted to create your drawing but discovered that an important set of parameters is missing. You have to have either the intersection point of the legs (73.34) from each side or the angle between the legs (73.34) and the base (106.41) to create construction lines. Once you have either of those items, you can co...
<p>I attempted to create your drawing but discovered that an important set of parameters is missing. You have to have either the intersection point of the legs (73.34) from each side or the angle between the legs (73.34) and the base (106.41) to create construction lines. Once you have either of those items, you can co...
702
<p><a href="http://resharper.blogspot.com/2008/03/varification-using-implicitly-typed.html" rel="noreferrer">Resharper</a> certainly thinks so, and out of the box it will nag you to convert</p> <pre><code>Dooberry dooberry = new Dooberry(); </code></pre> <p>to</p> <pre><code>var dooberry = new Dooberry(); </code></p...
<p>It's of course a matter of style, but I agree with Dare: <a href="http://www.25hoursaday.com/weblog/2008/05/21/C30ImplicitTypeDeclarationsToVarOrNotToVar.aspx" rel="noreferrer">C# 3.0 Implicit Type Declarations: To var or not to var?</a>. I think using var instead of an explicit type makes your code less readable.In...
<p>"Best style" is subjective and varies depending on context.</p> <p>Sometimes it is way easier to use 'var' instead of typing out some hugely long class name, or if you're unsure of the return type of a given function. I find I use 'var' more when mucking about with Linq, or in for loop declarations.</p> <p>Other t...
3,774
<p>Often, I find myself wanting to write a unit test for a portion of code that accesses HTTP resources as part of its normal function. Have you found any good ways to write these kinds of tests?</p>
<p>Extract the part that accesses the HTTP resources out of your main code. Create an interface for that new component, In your test, mock the interface and return data that you can control reliably.</p> <p>You can test the HTTP access as an integration test.</p>
<p>This is typically a function I would mock out for the tests... I don't like my tests depending on anything external... even worse if it is an external resource I have no control over (such as a 3rd party website).</p> <p>Databases is one of the few external resources I often won't mock... I use DBUnit instead.</p>
9,411
<p>I need to launch a server on the remote machine and retrieve the port number that the server process is lsitening on. When invoked, the server will listen on a random port and output the port number on stderr.</p> <p>I want to automate the process of logging on to the remote machine, launching the process, and ret...
<blockquote> <pre><code>s = p.stderr.readline() </code></pre> </blockquote> <p>I suspect it's the above line. When you invoke a command directly through ssh, you don't get your full pty (assuming Linux), and thus no stderr to read from.</p> <p>When you log in interactively, stdin, stdout, and stderr are set up for y...
<p>what if you do the following:</p> <h2><code>ssh &lt;remote host&gt; '&lt;your command&gt; ;&lt;your regexp using awk or something&gt;'</code></h2> <p>For example</p> <h2><code>ssh &lt;remote host&gt; '&lt;your program&gt;; ps aux | awk \'/root/ {print $2}\''</code></h2> <p>This will connect to , execute and the...
5,354
<p>I am planing on printing something that will make contact with PCB boards. The print will be most likely to be in PLA. I don't want to fry the PCB board so I want to know if 3D printed PLA objects are conductive.</p> <p>I googled and found out about special non-conductive PLA and conductive PLA. But what about the ...
<p>Normal PLA is non-conductive. You can take an <span class="math-container">$\Omega$</span>-meter to a test part if you're really concerned somehow you have some PLA that is conductive.</p> <p>There is a caveat that your color may include metal flake or graphite of some kind. Depending on the density it may be conduc...
<p>It's non-conductive, but I would check to make sure with any colored filament. Black may have iron oxide or carbon black which may give it minor conductance. </p>
505
<p><a href="http://www.djangoproject.com/" rel="noreferrer">Django</a> view points to a function, which can be a problem if you want to change only a bit of functionality. Yes, I could have million keyword arguments and even more if statements in the function, but I was thinking more of an object oriented approach.</p>...
<p>I've created and used my own generic view classes, defining <strong><code>__call__</code></strong> so an instance of the class is callable. I really like it; while Django's generic views allow some customization through keyword arguments, OO generic views (if their behavior is split into a number of separate method...
<p>Sounds to me like you're trying to combine things that shouldn't be combined. If you need to do different processing in your view depending on if it's a User or Group object you're trying to look at then you should use two different view functions.</p> <p>On the other hand there can be common idioms you'd want to ...
2,315
<p>Can someone shed some light in why FDM (Fuse Deposition Modelling) is not possible with metals?</p> <p>Has anyone attempted any experiments with it?</p>
<p>Yes, it is possible and it's done all the time. It's more commonly known as welding.</p> <p>We did TIG welding on our Hyrel printers back in 2017.</p> <p><div class="youtube-embed"><div> <iframe width="640px" height="395px" src="https://www.youtube.com/embed/azFY-IqDB_0?start=0"></iframe> ...
<p>For many metals you would need to run the hotend around 1000 °C. Aluminum melts at a lower temperature but needs to be in an inert atmosphere, such as argon. Solder melts at the right temperature, but tends to stick to most metal nozzles. It would start dissolving a brass nozzle thus enlarging the nozzle opening....
2,219
<p>How does Google Chrome command and control multiple cross platform processes and provide a shared window / rendering area?</p> <p>Any insights?</p>
<p>The source code is online <a href="https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/" rel="nofollow noreferrer">here</a> ...</p>
<p>The source code is online <a href="https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/" rel="nofollow noreferrer">here</a> ...</p>
6,353
<p>How can I combine multiple PDFs into one PDF without a 3rd party component?</p>
<p>I don't think you can. Opensource component PDFSharp has that functionality, and a nice <a href="http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&amp;task=view&amp;id=24&amp;Itemid=35" rel="noreferrer" title="source sample">source code sample on file combining</a></p>
<p>Although it has already been said, you can't manipulate PDFs with the built-in libraries of the .NET Framework. I can however recommend <a href="http://itextsharp.sourceforge.net/" rel="nofollow noreferrer">iTextSharp</a>, which is a .NET port of the Java iText. I have played around with it, and found it to be a v...
9,966
<p>We have the requirement to take a form submission and save some data, then redirect the user to a page offsite, but in redirecting, we need to "submit" a form with POST, not GET.</p> <p>I was hoping there was an easy way to accomplish this, but I'm starting to think there isn't. I think I must now create a simple ...
<p>Doing this requires understanding how HTTP redirects work. When you use <code>Response.Redirect()</code>, you send a response (to the browser that made the request) with <a href="http://en.wikipedia.org/wiki/HTTP_302" rel="noreferrer">HTTP Status Code 302</a>, which tells the browser where to go next. By definitio...
<p>Typically, all you'll ever need is to carry some state between these two requests. There's actually a really funky way to do this which doesn't rely on JavaScript (think &lt;noscript/>).</p> <pre><code>Set-Cookie: name=value; Max-Age=120; Path=/redirect.html </code></pre> <p>With that cookie there, you can in the ...
6,874
<p>Does anyone know of a way to declare a date constant that is compatible with international dates?</p> <p>I've tried:</p> <pre><code>' not international compatible public const ADate as Date = #12/31/04# ' breaking change if you have an optional parameter that defaults to this value ' because it isnt constant. pub...
<p>If you look at the IL generated by the statement</p> <pre><code>public const ADate as Date = #12/31/04# </code></pre> <p>You'll see this:</p> <pre><code>.field public static initonly valuetype [mscorlib]System.DateTime ADate .custom instance void [mscorlib]System.Runtime.CompilerServices.DateTimeConstantAttribute...
<p>OK, I am unsure what you are trying to do here:</p> <ul> <li>The code you are posting is <strong>NOT</strong> .NET, are you trying to port?</li> <li>DateTime's cannot be declared as constants.</li> <li>DateTime's are a data type, so once init'ed, the format that they were init'ed from is irrelevant.</li> <li>If you...
8,174
<p>I'm on the lookout for tools to migrate from ClearCase to SVN. </p> <p>Ideally would like to get all history information, or as much as can be acquired.</p> <p>Incremental merges would be very beneficial but isn't required.</p>
<p><a href="http://www.polarion.org/index.php?page=download&amp;project=svnimporter" rel="nofollow noreferrer">This</a> looks about the best. Polarion's business is SVN, so I guess they have a vested interest in <a href="http://www.polarion.org/index.php?page=features&amp;project=svnimporter" rel="nofollow noreferrer">...
<p>The migration from clearcase is not an easy task. The polarion importer does a job to support you, however, the history and speed for large clearcase repositories is difficult to estimate.</p> <p>The history will only import all files from main and will not take into account any directory versioning. The problem is...
8,176
<p>I've just changed the motherboard on my Ender 3 Pro with a MKS GEN_L v1.0 and flashed the latest Marlin version on it.</p> <p>I've calibrated my bed manually using the default XY and Z auto home commands on OctoPrint and a piece of paper.</p> <p>I'm happy with the calibration, however whenever I launch a print the Z...
<p>I've actually found what the issue was. It turns out that my Z steps were way out of whack (i.e. 4000 steps/mm instead of 400). Apparently, that's the default value in GitHub for version 2.0 of Marlin. Not sure if that's a typo or a valid value, anyhow setting it to 400 fixed it.</p>
<p>If you are already sure that homing is performed correctly and in valid position, then there are few reasons why printer may start printing in unexpected position.</p> <p>Do the following checks to narrow down the actual one:</p> <ul> <li><p><strong>steps/mm</strong>: use <a href="https://marlinfw.org/docs/gcode/M50...
1,851
<p>With the rise of multicore CPUs on the desktop, multithreading skills will become a valuable asset for programmers. Can you recommend some good resources (books, tutorials, websites, etc.) for a programmer who is looking to learn about threaded programming?</p>
<p>Take a look at Herb Sutter's "<a href="http://www.gotw.ca/publications/concurrency-ddj.htm" rel="noreferrer">The Free Lunch Is Over</a>" and then his series of articles on <a href="http://herbsutter.wordpress.com/2008/07/31/effective-concurrency-the-many-faces-of-deadlock/" rel="noreferrer">Effective Concurrency</a>...
<p>If you work with C#, the book "C# 2008 and 2005 threaded programming", by Gaston C. Hillar - Packt Publishing - <a href="http://www.packtpub.com/beginners-guide-for-C-sharp-2008-and-2005-threaded-programming/book" rel="nofollow noreferrer">http://www.packtpub.com/beginners-guide-for-C-sharp-2008-and-2005-threaded-pr...
2,457
<p>As the printer ages, the constant motion of the print head wears out the conductors inside the cable. Creating all sorts of fun debugging scenarios.</p> <p>Is there such a thing as a bundled cable, with all the necessary wires, for the stepper motor (in the case of direct drives), hot end, thermistor, etc... and whe...
<p>People have used parallel port cables (DB25) for a while. They are cheap enough and have enough pins for most uses.</p> <p><a href="https://i.stack.imgur.com/6LaNG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6LaNG.jpg" alt="enter image description here" /></a></p> <p>Obviously you will need to...
<p>Have you thought of using a ribbon cable? I have/ have had similar issues with a large print area CoreXY. I'm not sure if the ribbon cable can handle the motor current or heater current but pairing up wires may help. One other issue you may have is electrical interference if you have bed leveling that uses a servo...
2,112
<p>I've been having trouble uploading the TH3DUF_R2 firmware to my CR-10. I've already successfully flashed the bootloader using my Arduino, but when I try to upload the bootloader I get this error:</p> <p><code>avrdude: ser_open(): can't set com-state for "\\.\COM4"</code></p> <p>Things I've tried:</p> <ul> <li>C...
<p>You should not look at the relative dimensional differences, you should be looking at the absolute differences. Multiplying the undersized dimensions in percentage with the cylinder diameter gives you a value of 0.4 &nbsp;mm for each cylinder give or take a few hundreds. So, basically your printer works very consist...
<p>This problem seems to have mostly gone away - at least any remaining error is within a margin explainable by my cheap/low-quality digital caliper. Since asking the question, I've made a lot of changes that could contribute, but the biggest factor was probably the loose X-axis timing belt and <a href="https://3dprint...
1,267
<p>I'm trying to convert old QuickTime framework code to the 64-bit Cocoa-based QTKit on OS X, which means that I can't drop down to the straight C function calls at any time. Specifically, I'm trying to find a way to write QuickTime VR movies with QTKit, as they require some special metadata to set the display contro...
<p>If you <em>have</em> to delve down into the C APIs, you might tackle the limitation to 32-bit builds by moving the QuickTime specific code into a separate, 32-bit process. We do this on Windows and it works quite well ...</p>
<p>As far as I can tell from the QTKit Documentation there is not way to do this in straight QTKit cocoa calls. You'll need to <a href="http://www.cocoadev.com/index.pl?QTKitAddMetaData" rel="nofollow noreferrer">do this using the Quicktime-C APIs</a>, which of course aren't available to 64-bit applications.</p> <p>I...
9,217
<p>This is not a question with a precise answer (strictly speaking the answer would be best captured by a poll, but that functionality is not available), but I am genuinely interested in the answer, so I will ask it anyway.</p> <p>Over the course of your career, how much time have you spent on <a href="http://en.wikip...
<p>I think it's typical for professionals who deal with customers to spend more time in brownfield development. The reason is that customers typically aren't willing to throw out their existing software to adopt the "latest and greatest" (green) software.</p> <p>Developers in research or academics, however, may be mo...
<p>Over the past decade or so, I've always worked on software that was used as the center of my company's business. (Both SaaS and a software product.) And while I've always come into the with an existing system (so brownfield), we've usually put out a ground-up redesign/rewrite (so greenfield.) So, to break to down...
6,201
<p>Have any well-documented or open source projects targeted <code>iPhone</code>, <code>Blackberry</code>, and <code>Android</code> ? Are there other platforms which are better-suited to such an endeavor ? Note that I am particularly asking about client-side software, not web apps, though any information about the dif...
<p>The HTML5 standard has support for releasing stand-alone <em>HTML5</em> apps. Essentially a <em>HTML5</em> app is a bundle of <em>HTML5</em>, <em>JavaScript</em> and <em>CSS</em> files that will run stand-alone in the browser of the desktop or device. You can distribute them like any other program, including selli...
<p><em>S60 on Symbian OS</em> has alot of interesting projects happening relating to desktop/server languages to move applications mobile. Some interesting ones:-</p> <p>Python: <a href="http://sourceforge.net/projects/pys60" rel="nofollow noreferrer">sourceforge</a> <BR> Ruby: <a href="http://sourceforge.net/projects...
7,522
<p>What grease to use on linear rails to make them stick as little as possible? I've tried so far: </p> <ul> <li>WD40 (let’s not start a discussion about that please), </li> <li>silicon spray and </li> <li>some bearing grease called ‘motorex’, </li> </ul> <p>but with all of them the rails stick quite much and don’t s...
<p><strong>Don't use grease</strong>, it is better to use a <strong>light oil</strong> to lubricate the rods. A light oil will help flush out any dust and filament debris, grease will trap it.</p> <p>I've used both light machine oil (like used for sewing machines) and PTFE based spray (Teflon). Grease is thick and wi...
<p>I have (what I thought was Silicon) spray that was given to me by the garage door installer to lube the rollers for my garage doors. I spray some on a paper towel and wipe the X, Y and Z bars with that. It is called Zep 70. </p> <p><a href="https://www.zep.com/product/zepcorporate/zep-70" rel="nofollow noreferrer"...
1,347
<p>I have a script that checks responses from HTTP servers using the PEAR HTTP classes. However, I've recently found that the script fails on FTP servers (and probably anything that's not HTTP or HTTPS). I tried Google, but didn't see any scripts or code that returned the server status code from servers other than HTTP...
<p>HTTP works slightly differently than FTP though unfortunately. Although both may look the same in your browser, HTTP works off the basis of URI (i.e. to access resource A, you have an identifier which tells you how to access that).</p> <p>FTP is very old school server driven. Even anonymous FTP is a bit of a hack, ...
<p>Wouldn't it be simpler to use the built-in PHP FTP* functionality than trying to roll your own? If the URI is coming from a source outside your control, you would need to check the protocal definition (http:// or ftp://, etc) in order to determine which functionality to use, but that is fairly trivial. If there is...
3,021
<p>I'm using SQL Server 2000 to print out some values from a table using <code>PRINT</code>. With most non-string data, I can cast to nvarchar to be able to print it, but binary values attempt to convert using the bit representation of characters. For example:</p> <pre><code>DECLARE @binvalue binary(4) SET @binvalue...
<p>If you were on Sql Server 2005 you could use this:</p> <pre><code>print master.sys.fn_varbintohexstr(@binvalue) </code></pre> <p>I don't think that exists on 2000, though, so you might have to roll your own.</p>
<p>Really too much of tl;dr in the topic :( Will try to fix it following <a href="https://stackoverflow.com/a/12549880/10815638">this answer</a>.</p> <pre><code>with sq1 as (select '41424344' as v), -- this is 'ABCD' -- Need binary size, otherwise it sets binary(30) in my case sq2 as (select v, convert(binary(4), v, 2...
9,424
<p>I'm currently using the module <code>URI::URL</code> to generate a full URL from a relative URL; however, it isn't running as fast as I'd like it to be. Does anyone know another way to do this that may be faster?</p>
<p>The following code should work.</p> <pre><code>$uri = URI-&gt;new_abs( $str, $base_uri ) </code></pre> <p>You should also take a look at <a href="http://search.cpan.org/dist/URI/URI.pm" rel="nofollow noreferrer">the URI page on search.cpan.org</a>.</p>
<p>Perhaps I got the wrong end of the stick but wouldn't,</p> <pre><code>$full_url = $base_url . $relative_url</code></pre> <p>work? IIRC Perl text processing is pretty quick.</p> <p><i>@lennysan</i> Ah sure yes of course. Sorry I can't help, my Perl is pretty rusty.</p>
4,649
<p>Here is the issue I am having: I have a large query that needs to compare datetimes in the where clause to see if two dates are on the same day. My current solution, which sucks, is to send the datetimes into a UDF to convert them to midnight of the same day, and then check those dates for equality. When it comes ...
<p>This is much more concise:</p> <pre><code>where datediff(day, date1, date2) = 0 </code></pre>
<p>I would use the dayofyear function of datepart:</p> <pre><code> Select * from mytable where datepart(dy,date1) = datepart(dy,date2) and year(date1) = year(date2) --assuming you want the same year too </code></pre> <p>See the datepart reference <a href="http://www.tizag.com/sqlTutorial/sqldatepart.php" rel="nofollo...
4,261
<p>I constantly hear how bad reflection is to use. While I generally avoid reflection and rarely find situations where it is impossible to solve my problem without it, I was wondering... </p> <p>For those who have used reflection in applications, have you measured performance hits and, is it really so bad?</p>
<p>It is. But that depends on what you're trying to do. </p> <p>I use reflection to dynamically load assemblies (plugins) and its performance "penalty" is not a problem, since the operation is something I do during startup of the application.</p> <p>However, if you're reflecting inside a series of nested loops with r...
<p>I think you will find that the answer is, it depends. It's not a big deal if you want to put it in your task-list application. It is a big deal if you want to put it in Facebook's persistence library.</p>
4,509
<p>I am looking for an open source project that uses EJB3 as backend and JSF as frontend. It should <em>not</em> be a tutorial but a real application that real people are using.</p> <p>The application should be data-driven, i.e. the following aspects are fundamental and make 80% or more of the application.</p> <ul> <...
<p>Seam examples are quite good. They are stand-alone projects, that you may deploy out of the box. </p>
<p>I am not sure is it 100% what your looking for, <strong>but check out the built in example that comes packaged with NetBeans 6.1</strong>. It uses JSF/EJB3/ApacheDerby. I played around with it for like 20 minutes and thought it was pretty cool as a simple/starter JavaEE application to learn from.</p>
5,908
<p>I have a rather complex page that dynamically builds user controls inside of a repeater. This repeater must be bound during the Init page event before <code>ViewState</code> is initialized or the dynamically created user controls will not retain their state.</p> <p>This creates an interesting Catch-22 because the o...
<p>The LoadViewState method on the page is definitely the answer. Here's the general idea:</p> <pre><code>protected override void LoadViewState( object savedState ) { var savedStateArray = (object[])savedState; // Get repeaterData from view state before the normal view state restoration occurs. repeaterData = s...
<p>1) there's probably a way to get it to work... you just have to make sure to add your controls to the tree at the right moment. Too soon and you don't get ViewState. Too late and you don't get ViewState.</p> <p>2) If you can't figure it out, maybe you can turn off viewstate for the hole page and then rely only...
6,699
<p>I'd like to store a properties file as XML. Is there a way to sort the keys when doing this so that the generated XML file will be in alphabetical order? </p> <pre><code>String propFile = "/path/to/file"; Properties props = new Properties(); /*set some properties here*/ try { FileOutputStream xmlStream = new ...
<p>Here's a quick and dirty way to do it:</p> <pre><code>String propFile = "/path/to/file"; Properties props = new Properties(); /* Set some properties here */ Properties tmp = new Properties() { @Override public Set&lt;Object&gt; keySet() { return Collections.unmodifiableSet(new TreeSet&lt;Object&gt;(super....
<p>Why do you want the XML file to be sorted in the first place? Presumably, there is another piece of code that reads the file and puts the data in another Properties object. Do you want to do this so you can manually find and edit entries in the XML file?</p>
7,792
<p>I have a web page that I have hooked up to a <a href="http://en.wikipedia.org/wiki/Stored_procedure" rel="nofollow noreferrer">stored procedure</a>. In this SQL data source, I have a parameter that I'm passing back to the stored procedure of type int. </p> <p><a href="http://en.wikipedia.org/wiki/ASP.NET" rel="nof...
<p>Would something like this work?</p> <pre><code>from random import randint mcworks = [] for n in xrange(NUM_ITERATIONS): mctest = [randint(0, 100) for i in xrange(5)] if sum(mctest[:3])/3 == mcavg[2]: mcworks.append(mctest) # mcavg is real data </code></pre> <p>In the end, you are left with a li...
<p>A neat way to do it is to use a list of lists in combination with Pandas. Then you are able to create a 3-day rolling average. This makes it easy to search through the results by just adding the real ones as another column, and using the loc function for finding which ones that match.</p> <pre><code>rand_vals = [r...
8,429
<p>I am creating a small modal form that is used in Winforms application. It is basically a progress bar of sorts. But I would like the user to be able to click anywhere in the form and drag it to move it around on the desktop while it is still being displayed.</p> <p>How can I implement this behavior?</p>
<p><a href="http://support.microsoft.com/kb/320687" rel="nofollow noreferrer" title="KB Article 320687">Microsoft KB Article 320687</a> has a detailed answer to this question.</p> <p>Basically, you override the WndProc method to return HTCAPTION to the WM_NCHITTEST message when the point being tested is in the client ...
<p>VC++ 2010 Version (of FlySwat's):</p> <pre><code>#include &lt;Windows.h&gt; namespace DragWithoutTitleBar { using namespace System; using namespace System::Windows::Forms; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Data; using names...
5,007
<p>Hello I have a Prusa I3 I am currently able to get press fit parts with my current settings. I am using Ramps 1.4 hardware and repetier software and cura as my slicer. I am printing with a .2 mm layer height right now but would like to get a better number such as .1 or .09. When I try to print with say .1mm layer he...
<p>There are no settings that you should need to change. Rather, it seems like you are suffering from another issue that is not directly related to layer height.</p> <p>It is possible that your hotend's heat sink is not being cooled enough, causing heat to migrate up and soften plastic in the heat sink, ultimately jam...
<p>I agree with Tom's answer, it seems that temperature slowly makes it's way up your heat sink and softens the plastic which causes the jam. </p> <p>Even though you should first check your hardware to make sure that hotend cooling is installed correctly, <strong>to directly address your original question</strong> as ...
356
<p>I have a "showall" query string parameter in the url, the parameter is being added dynamically when "Show All/Show Pages" button is clicked. </p> <p>I want the ability to toggle "showall" query string parameter value depending on user clicking the "Show All/Show Pages" button.</p> <p>I'm doing some nested "if's" a...
<p>Just to elaborate on Toran's answer:</p> <p>Use:<br> <code>&lt;asp:HiddenField ID="ShowAll" Value="False" runat="server" /&gt;</code></p> <p>To toggle your state:</p> <pre><code>protected void ToggleState(object sender, EventArgs e) { //parse string as boolean, invert, and convert back to string ShowA...
<p>Another dirty alternative could be just to use a hidden input and set that on/off instead of manipulating the url.</p>
6,679
<p>I usually store my connectionstring in web.config or in the application settings of my Visual Studio project. The application I'm currently working on makes a lot of trips to the database which means it will look up the connectionstring every time. Should I be putting the connectionstring in the cache or should I be...
<p>I wouldn't cache the connection object, that will defeat the built-in connection pooling -- ADO.NET will handle connections (assuming you instantiate and close them) efficiently by itself.</p> <p>As far as the connection string itself, you shouldn't need to cache it if you load it from connection -- the connection ...
<p>Keep it in a configuration file. Use a robust data access strategy provided by tools like NHibernate or Linq to Sql.</p>
6,235
<p>I don't remember whether I was dreaming or not but I seem to recall there being a function which allowed something like,</p> <pre><code>foo in iter_attr(array of python objects, attribute name)</code></pre> <p>I've looked over the docs but this kind of thing doesn't fall under any obvious listed headers</p>
<p>Using a list comprehension would build a temporary list, which could eat all your memory if the sequence being searched is large. Even if the sequence is not large, building the list means iterating over the whole of the sequence before <code>in</code> could start its search.</p> <p>The temporary list can be avoidi...
<p>I think:</p> <pre><code>#!/bin/python bar in dict(Foo) </code></pre> <p>Is what you are thinking of. When trying to see if a certain key exists within a dictionary in python (python's version of a hash table) there are two ways to check. First is the <strong><code>has_key()</code></strong> method attached to the...
2,310
<p>Recently I started looking on pressure advance and how it works and I'm a bit confused about where it is usually implemented.</p> <p>My Idea of 3D printer was that its firmware is fairly dumb and only replays GCode, not knowing anything about the object being printed, material used, or even the printer itself.</p> <...
<blockquote> <p>In addition the E axis is no longer controlled directly by the GCode, but it's motion is almost independently determined by the firmware.</p> </blockquote> <p>This is the case even without linear advance. G-code does not directly control the movement of any of the axes. G-code only specifies the path th...
<p>This is a really good question that sheds a lot of light on 3D printer software/firmware architecture, and Tom already said a lot of the things I wanted to say before getting a chance to write an answer. The basic problem is that, to do pressure advance accurately (and in a way that doesn't get it horribly wrong whe...
1,796
<p>When exporting an STL from Fusion 360, one must select an STL refinement level to use for calculating the maximum triangle count. </p> <p>For FDM printing (<em>0.05mm and above layer heights</em>), where is the point of diminishing returns on STL refinement level when printing PLA and PETG on an Ender 3 with a 0.4m...
<p>I don't know that this can be definitively answered for a specific printer and all arbitrary designs.</p> <p>The refinement level basically determines how smooth a curved surface will turn out. The STL file format can only express an object in terms of triangular-shaped surfaces, so Fusion 360 will need to approxi...
<p>If you print for example a thin wall cylinder vertically you cannot turn the refinement high enough to not see the flats on the surface. My triangle counts are 524 for Low, 828 for Medium, 2206 for High, and if you select custom and pull the surface deviation slider all the way to the left you get 6572 triangles. ...
1,058
<p>I have to read data from some files and insert the data into different tables in a database. Is Unix shell script powerful enough to do the job?</p> <p>Is it easy to do the job in shell script or should I go about doing this in Java?</p>
<p>If the data you are trying to import is in a reasonable format -- comma-delimited, for example -- and your database server has reasonable command line utilities, this should be no problem. MySQL has the "mysqlimport" command-line tool that will accept various arguments describing the format of the file:</p> <pre cl...
<p>Shell scripting (Bash or similar) primary intention is not to deal with databases. Go for Java or even better, ride this opportunity to learn the basics of a scripting language like Python or Ruby.</p>
9,731
<p>I'm working on an email solution in SQL Server ONLY that will use Database Mail to send out HTML formatted emails. The catch is that the images in the HTML need to be embedded in the outgoing email. This wouldn't be a problem if I were using a .net app to generate &amp; send the emails but, unfortunately, all I hav...
<p>Yes, what you need to do is include the images as attachments and then they can be referenced within the HTML.</p> <p>Use the <code>@file_attachment</code> parameter of <code>sp_send_dbmail</code></p>
<p>You could try to encode the image as base64 and reference it directly in an img tag within the email ( <code>&lt;img src="data:image/png;base64[your encoded image here...]</code> ) but i think most email clients correlate this technique with spam. I think you're better off referencing hosted images or simply attachi...
5,658
<p>Is there any type of software in which you can animate the way the .stl object will be printed? </p> <p>I'm not talking about what the end result looks like. I'm talking about a tool which acts like it's printing the given object as an animation.</p> <p>I know it somehow depends on your printer but is there anythi...
<p>You may wish to consider <a href="https://craftunique.com/craftware" rel="nofollow">Craftware</a> for your purposes. It's a free program in beta form that does provide a tool-path animation for printing the layers. It is not so much specific to a printer as it is configurable for your own requirements. <a href="http...
<p>I'm using <a href="http://www.mattercontrol.com" rel="nofollow">MatterControl</a> and it has such visualization. User can see synchronized animation which shows how the object is actually printed and user is able to see each path of filament put onto the layer.</p> <p>It's possible to control starting and ending po...
269
<p>I'm trying to run powershell commands through a web interface (ASP.NET/C#) in order to create mailboxes/etc on Exchange 2007. When I run the page using Visual Studio (Cassini), the page loads up correctly. However, when I run it on IIS (v5.1), I get the error "unknown user name or bad password". The biggest problem ...
<p>Here is a class that I use to impersonate a user.</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.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; namespace orr....
<p>You might need a patch.</p> <p>From: <a href="http://support.microsoft.com/kb/943937" rel="nofollow noreferrer">http://support.microsoft.com/kb/943937</a></p> <blockquote> <p><strong>An application cannot impersonate a user and then run Windows PowerShell commands in an Exchange Server 2007 environment</st...
3,292
<p>When writing a T-SQL script that I plan on re-running, often times I use temporary tables to store temporary data. Since the temp table is created on the fly, I'd like to be able to drop that table only if it exists (before I create it).</p> <p>I'll post the method that I use, but I'd like to see if there is a bet...
<pre><code>IF Object_Id('TempDB..#TempTable') IS NOT NULL BEGIN DROP TABLE #TempTable END </code></pre>
<pre><code>SELECT name FROM sysobjects WHERE type = 'U' AND name = 'TempTable' </code></pre>
2,476
<p>I have searched the internet and found various 3D printers with different advantages and materials which they can print - some even multi color. </p> <p>However, I cannot seem to find a printer that can print multiple material with different properties; for instance, simultaneously printing PLA and metal. Is there...
<p>Yes and no.</p> <blockquote> <p>for instance simultanious printing of plas plastic and lets say metal. Is such a printer available or in development ?</p> </blockquote> <p>Practically speaking, no. Metal printing requires significantly higher temperatures than plastic, and the two processes are so incompatible ...
<p>For the most part, you can achieve this with a dual extruding printer. However, dual extrusion is best for either multi-color printing or printing with support material. For example, printing the part with PLA and all support material with water soluble PVA.</p> <p>In practice, printing two completely different mat...
182
<p>I have made a temperature ⨉ fan speed tower which needed 3x9-1 ChangeAtZ post processing scripts and it took me quite much time to configure them all (and check it twice). Is there a way to save this, so that I wouldn't need to make them all again if something went wrong and I needed to start over or if I wanted to ...
<p>The UK uses 230&nbsp;V mains voltage. The 220&nbsp;V designation is from the past, Europe is now using 230&nbsp;V. You do not have to worry about the frequency.</p> <p>You should place the switch to 220&nbsp;V and plug the cord into the socket. The printer should start immediately booting (cycling) the printer firm...
<p>@Oscar was correct, so long as the switch is set at 220 V, the printer will turn on. I am adding this answer to help anyone else who has a similar problem.</p> <p>I strongly recommend that you buy a multimeter if you have any power supply issues, as this helped me to figure out what was wrong.</p> <p>There were th...
1,552
<p>I'm looking for an answer in MS VC++.</p> <p>When debugging a large C++ application, which unfortunately has a very extensive usage of C++ exceptions. Sometimes I catch an exception a little later than I actually want.</p> <p>Example in pseudo code:</p> <pre><code>FunctionB() { ... throw e; ... } Fun...
<p>If you are just interested in where the exception came from, you could just write a simple macro like</p> <pre><code>#define throwException(message) \ { \ std::ostringstream oss; \ oss &lt;&lt; __FILE __ &lt;&lt; " " &lt;&lt; __LINE__ &lt;&lt; " " \ &lt;&lt;...
<p>Other languages? Well, in Java you call e.printStackTrace(); It doesn't get much simpler than that.</p>
5,671
<p>Does anyone know an easy way to import a raw, XML RSS feed into C#? Am looking for an easy way to get the XML as a string so I can parse it with a Regex.</p> <p>Thanks, -Greg</p>
<p>If you're on .NET 3.5 you now got built-in support for syndication feeds (RSS and ATOM). Check out this <a href="http://msdn.microsoft.com/en-us/magazine/cc135976.aspx" rel="noreferrer">MSDN Magazine Article for a good introduction</a>.</p> <p>If you really want to parse the string using regex (and parsing XML is n...
<p>XmlDocument (located in System.Xml, you will need to add a reference to the dll if it isn't added for you) is what you would use for getting the xml into C#. At that point, just call the InnerXml property which gives the inner Xml in string format then parse with the Regex.</p>
9,348
<p>I'm not talking about how to indent here. I'm looking for suggestions about the best way of organizing the chunks of code in a source file.</p> <p>Do you arrange methods alphabetically? In the order you wrote them? Thematically? In some kind of 'didactic' order?</p> <p>What organizing principles do you follow? Why...
<p>i normally order by the following</p> <ol> <li>constructors</li> <li>destructors</li> <li>getters</li> <li>setters</li> <li>any 'magic' methods </li> <li>methods for changing the persisted state of reciever (save() etc)</li> <li>behaviors</li> <li>public helper methods</li> <li>private/protected helper methods</li>...
<p>I group them based on what there doing, and then in the order I wrote them (alphabetically would probs be better though)</p> <p>eg in texture.cpp I have:</p> <pre><code>//====(DE)CONSTRUCTOR==== ... //====LOAD FUNCTIONS==== ... //====SAVE FUNCTIONS==== ... //====RESOURCE MANGEMENT FUNCTIONS==== //(preventing multi...
9,870
<p>When executing SubmitChanges to the DataContext after updating a couple properties with a LINQ to SQL connection (against SQL Server Compact Edition) I get a "Row not found or changed." ChangeConflictException.</p> <pre><code>var ctx = new Data.MobileServerDataDataContext(Common.DatabasePath); var deviceSessionReco...
<p>Thats nasty, but simple:</p> <p>Check if the data types for all fields in the O/R-Designer match the data types in your SQL table. <strong>Double check for nullable!</strong> A column should be either nullable in both the O/R-Designer and SQL, or not nullable in both.</p> <p>For example, a NVARCHAR column "title" ...
<p>I know this question has long since been answered but here I have spent the last few hours banging my head against a wall and I just wanted to share my solution which turned out not to be related to any of the items in this thread:</p> <h2>Caching!</h2> <p>The select() part of my data object was using caching. Whe...
6,685
<p>I am very new in the 3D printing scene. After a lot of searching for my specific problem (and didn't find any answers, of course) I decided to reach out.</p> <p>I bought a Creality Ender 3 Pro in November and after a few days of lovely prints I decided to upgrade the printer with a glass bed and &quot;Aluminum Dual...
<p>This is an older Ender 3 Pro, they at one point came with these press-fit gears, these are not intended to be removed which is a poor design decision. I would recommend buying a new motor than going through the hassle of removing it.</p>
<p>Same problem here. I removed it by force using a pliers and a hammer, then drill a spot on the shaft using ikea drill. Everything works fine so far.</p>
1,811
<p>I bought new yellow PLA filament from XYZ (1.75&nbsp;mm). </p> <p>Over the past I have printed many objects with my da Vinci 1.0 (ABS only). I found that while the brim is being printing (using default configuration of XYZWare; the da Vinci machines give the user very little control over print parameters, if I reme...
<p>The answer to this specific instance appeared in the comments:</p> <blockquote> <p>Also, <a href="https://3dprinting.stackexchange.com/a/6092/">a thorough cleaning of the nozzle/hotend</a> might also be a good idea to get rid of all the stuck ABS residue inside. – 0scar Mar 26 at 8:44</p> <p>The problem solv...
<p>That looks pretty bad for a number of reasons. If you've got an all-metal hotend, you can be pretty sure that your PLA issues are probably at least partially cooling-related. I'd recommend you try and find a better fan duct design for your hotend, if possible, and possibly upgrade to a better fan.</p> <p>You can te...
1,259
<p>Is it in best interests of the software development industry for one framework, browser or language to <strong>win the war</strong> and become the de facto standard? On one side it takes away the challenges of cross platform, but it opens it up for a single point of failure. Would it also result in a stagnation of...
<p>Defacto standards are bad because they are usually controlled by a single party. What is best for the industry is for there to be a foundation of open standards on top of which everyone can compete. </p> <p>The web is a perfect example. When IE won the browser war, it stagnated for <em>years</em>, and is only just ...
<p>No. Competition is good. It may make a web developers job easier, but I think it's bad for the industry. I personally prefer having choices. </p> <p>I believe Joel Spolsky's technique of creating his own language (Wasabi) to insulate his company from being platform specific is a good one. I also believe it is...
3,401
<p>I was wondering if anyone tried migrating between TS and SVN/CC. What I mean by migrating is importing and exporting the repository between source control systems without losing the history.</p> <p>How good are the tools to migrate to and from VSTS? </p> <p>I am also interested in knowing any opinion regarding us...
<p>Try tfs2svn... worked great for a project with 1200 TFS changesets. It was a bit fussy to setup when svn authentication is enabled, but otherwise great.</p> <p><a href="http://sourceforge.net/projects/tfs2svn/" rel="nofollow noreferrer">http://sourceforge.net/projects/tfs2svn/</a></p>
<p>In a <a href="http://www.dotnetrocks.com/default.aspx?showNum=373" rel="nofollow noreferrer">recent episode of DotNetRocks!</a> Brian Randell and Martin Woodward are of the opinion that in adopting a new Source Control / SCM system you're probably better off starting from a clean slate (begin with the most recent re...
9,728
<p>I am trying to join together several audio files into one mp4/m4a file containing chapter metadata.</p> <p>I am currently using QTKit to do this but unfortunately when QTKit exports to m4a format the metadata is all stripped out (this has been confirmed as a bug by Apple) see <a href="http://files.shinydevelopment....
<p><a href="http://audiobookmaker.sourceforge.net/" rel="nofollow noreferrer">Audiobook Maker</a> does something like this, and I believe it uses ffmpeg under the hood. It's open source, so maybe its worth a look?</p>
<p>Depending on where the bug is, you could try going straight to the QuickTime C APIs to write the movie file. You might also try adding the chapters track using the C APIs. </p> <p>Any word on when Apple will fix the bug? I am planning to create enhanced podcasts with QTKit, and need this to work. </p>
7,724
<p>I would like to make custom cake molds. </p> <p>I've asked about this in a few stores that specialize in cooking equipment, they said this wasn't possible. </p> <p>I wonder if 3D printing makes it possible. It would require a material that is food-safe, as per <a href="https://3dprinting.stackexchange.com/question...
<p>For <a href="http://3dprintingfromscratch.com/common/types-of-3d-printers-or-3d-printing-technologies-overview/#fdm" rel="nofollow noreferrer">FDM</a> printing: </p> <p>Both Cura and Makerbot Desktop (and perhaps others I'm not as familiar with) will give you a preview of both the length and weight of your print, i...
<p>I recently faced the problem of calculating the cost of my printed 3D models. I wanted to know what their real value had to be counted in Excel. It was really inconvenient. Then I found a program for counting, it turned out really great, even takes into account the electricity. This is not an advertisement just thr...
130
<p>first time here.</p> <p>I recently bought an Anycubic Mega S and I'm venturing in the 3D world. Lots to learn for sure. I have printed a few items so far and all went pretty well.</p> <p>My question is about something that caught my attention while browsing on Thingiverse. I was looking for an organizer for a board ...
<p>Thingieverse does respect the orientation an item was designed in, just like most slicers will. Designers will often choose any one of the three planes (XY, YZ, ZX) as their first by preference, then work out the other parts in relation to the first. This does often not take into account the actual print orientation...
<p>When I design parts in CAD software I pick a starting plane and go from there. And that starting plane doesn't correspond to how the part is designed to be printed. That usually comes later.</p>
1,724
<p>In my application I have <code>TextBox</code> in a <code>FormView</code> bound to a <code>LinqDataSource</code> like so:</p> <pre><code>&lt;asp:TextBox ID="MyTextBox" runat="server" Text='&lt;%# Bind("MyValue") %&gt;' AutoPostBack="True" ontextchanged="MyTextBox_TextChanged" /&gt; prote...
<p>There was an interesting discussion of Technical Debt based on your definition of done on HanselMinutes a couple of weeks ago -- <a href="http://www.hanselminutes.com/default.aspx?showID=137" rel="nofollow noreferrer">What is Done</a>. The basics of the show were that if you re-define 'Done' to increase perceived v...
<p>That's why it's always easier to write nice "acadamic papers" talking about how Agile development is good, what are the "best practices" and so on.</p> <p>That's why you find a lot of "suited engineers" making up new software engineering techniques.</p> <p>Process is important, keeping best practices is cool but o...
8,596
<p>A question that occasionally arises is what is the best way to determine the changelist that you last synced to in Perforce. This is often needed for things like injecting the changelist number into the revision info by the automatic build system.</p>
<p>I recommend the opposite for automatic build systems: you should first get the latest changelist from the server using:</p> <pre><code>p4 changes -s submitted -m1 </code></pre> <p>then sync to that change and record it in the revision info. The reason is as follows. Although <a href="https://portal.perforce.com/s/...
<p>I am not sure if you got the answer you needed but I had a similar problem. The goal was to write in our logger the specific version of the project. The problem was that while we are making our own makefile, the overall build system is controlled by our configuration management. This means that all the solutions whi...
6,920
<p>I'm currently building a Java app that could end up being run on many different platforms, but primarily variants of Solaris, Linux and Windows.</p> <p>Has anyone been able to successfully extract information such as the current disk space used, CPU utilisation and memory used in the underlying OS? What about just ...
<p>You can get some limited memory information from the Runtime class. It really isn't exactly what you are looking for, but I thought I would provide it for the sake of completeness. Here is a small example. Edit: You can also get disk usage information from the java.io.File class. The disk space usage stuff requires ...
<p>Not exactly what you asked for, but I'd recommend checking out <a href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/ArchUtils.html" rel="nofollow noreferrer">ArchUtils</a> and <a href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/SystemUtils.html...
4,518
<p>Inspired by this CodingHorror article, "<a href="http://www.codinghorror.com/blog/archives/001167.html" rel="noreferrer">Protecting Your Cookies: HttpOnly</a>"</p> <p>How do you set this property? Somewhere in the web config?</p>
<p>If you're using ASP.NET 2.0 or greater, you can turn it on in the Web.config file. In the &lt;system.web&gt; section, add the following line:</p> <pre><code>&lt;httpCookies httpOnlyCookies="true"/&gt; </code></pre>
<p>Interestingly putting <code>&lt;httpCookies httpOnlyCookies="false"/&gt;</code> doesn't seem to disable <code>httpOnlyCookies</code> in ASP.NET 2.0. Check this article about <a href="http://nerd.steveferson.com/2007/09/14/act-sessionid-and-login-problems-with-asp-net-20/" rel="nofollow noreferrer">SessionID and Logi...
5,362
<p>If so how? </p> <p>Did you roll your own with jQuery or use the Microsoft AJAX toolkit?</p> <p>Did you create a webservice or call an action?</p> <hr> <p><strong>EDIT</strong> : Please note that this question was asked before Microsoft announced that they were going to bundle jQuery in with VS/ASP.NET MVC. I t...
<p>jQuery, action, return JSON.</p> <p><a href="http://devlicio.us/blogs/mike_nichols/archive/2008/05/25/jquery-cascade-cascading-values-from-forms.aspx" rel="nofollow noreferrer">http://devlicio.us/blogs/mike_nichols/archive/2008/05/25/jquery-cascade-cascading-values-from-forms.aspx</a></p>
<p><a href="http://blog.noma.li/2010/03/autopostback-and-cascading-drop-downs-in-asp-net-mvc-and-jquery/" rel="nofollow noreferrer">http://blog.noma.li/2010/03/autopostback-and-cascading-drop-downs-in-asp-net-mvc-and-jquery/</a></p>
6,086
<p>I'd like to know the standard way to benchmark a SQL Sever Query, preferably I'd like to know about the tools that come with SQL Server rather than 3rd Party tools.</p>
<p>set showplan_text on will show you the execution plan (to see it graphically use <kbd>CTRL</kbd> + <kbd>K</kbd> (sql 2000) or <kbd>CTRL</kbd> + <kbd>M</kbd> (sql 2005 +)</p> <p>set statistics IO on will show you the reads</p> <p>set statistics time on will show you the elapsed time</p>
<p>+1 on the execution plan. From here you can see where all the time is being spent in your particular query. Eg. 85% of the time is spent table scanning a particular table, can you put an index on that table to improve it? etc etc.</p>
5,523
<p><img src="https://i.stack.imgur.com/xE1dA.gif" alt="enter image description here"></p> <p>This is what is happening to my motor. Any suggestions would help. 1. I have tried adjusting the trimpot. 2. Rewire the connector to match the one on the motherboard. 3. Anything else I found on the internet.</p>
<p>If the one in your question is your <em>complete</em> code, a possibility is that your computer is just buffering the output for the serial port, withholding it in memory. Try to add</p> <pre><code>ser.flush() </code></pre> <p>after your last line. This command will... well... <em>flush</em> anything into the bu...
<p>Sorry for the late answer, but with Repetrel v3 and later, we have the option for you to configure a secondary COM port, and relay G- or M-Code commands from your other source through the Repetrel software to the printer. Please contact us for assistance.</p> <p>Note: I work for Hyrel 3D.</p>
802
<p>I'm looking for secure ways to pass data between a client running Flash and a server. The data in question will be generated BY the Flash app, which in this case is your score after finishing a game. I want to verify the data is untampered on the server. What are some good methods of getting this done?</p> <p>On...
<p>Encrypt the data with a public key stored in the binary. This will raise the barrier of entry for an attack. In addition to that, sanity check the data as it arrives on the server. This could be as simple as calculating the maximum number of points that could realistically be earned per time unit of play, or tran...
<p>As long as people can get at the executable - which, unless you want to run the game on a locked kiosk, is always the case - there's no perfectly secure way of doing this.</p> <p>The music and movie industries spent tens of millions on DRM that got cracked by home hobbyists in days/weeks. If they can't protect <em...
6,855
<p>I'm not going to be too surprised if I get shot-down for asking a "non programming" question, but maybe somebody knows ...</p> <p>I was zipping the contents of my subversion sandbox using WinXP's inbuilt "Send to Compressed (zipped) Folder" capability and was surprised to find that the .zip file created did not con...
<p>Send to zipped Folder does not traverse into folders without names before dot (like ".svn"). If you had other folders that begin with dots, those would not be included either. Files without names are not excluded. Hidden attribute does not come into play.</p> <p>Might be a bug, might be by design. Remember that Win...
<p>A compressed folder doesn't mean that it will be a .ZIP file, only the contents of the folder are compressed and to you it will look like a normal folder</p>
5,002