instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>What fonts do you use for programming, and for what language/IDE? I use <a href="http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&amp;displaylang=en" rel="nofollow noreferrer" title="Consolas">Consolas</a> for all my Visual Studio work, any other recommendations?</p>
<p>Either Consolas <a href="http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&amp;displaylang=en">(download)</a> or Andale Mono <a href="http://prdownloads.sourceforge.net/corefonts/andale32.exe?download">(download)</a>. I mostly use Andale Mono. I wrote an article about prog...
<p>Any sans-serif.</p>
2,672
<p>I have a very simple WPF application in which I am using data binding to allow editing of some custom CLR objects. I am now wanting to put some input validation in when the user clicks save. However, all the WPF books I have read don't really devote any space to this issue. I see that you can create custom Validatio...
<p>I think the new preferred way might be to use IDataErrorInfo</p> <p>Read more <a href="http://blogs.msdn.com/wpfsdk/archive/2007/10/02/data-validation-in-3-5.aspx" rel="noreferrer">here</a></p>
<p>If your business class is directly used by your UI is preferrable to use IDataErrorInfo because it put logic closer to their owner.</p> <p>If your business class is a stub class created by a reference to an WCF/XmlWeb service then you can not/must not use IDataErrorInfo nor throw Exception for use with ExceptionVal...
8,905
<p>We know from <a href="https://3dprinting.stackexchange.com/a/183/11242">this answer</a>, 3d printed materials continue to outgas after printing and being cured. My question relates to this:</p> <ul> <li>How much does heating the printed object after printing (or being cured) affect out-gassing? </li> <li>Does the c...
<p>This is not an answer to your question, but it relates to outgassing so I am sharing it here. </p> <p>I have used the acetone vapor method of smoothing the surface of ABS prints. It works really well, and the surface becomes much smoother and glassy. I printed a large coffee mug (lets, for the moment, ignore foo...
<p>The effect of temperature on outgas rates is a subject for Engineering.SE . As to continued outgassing - depends on the material in question. To pick an extreme example, solid CO2 (dry ice) will outgas until it's gone. But stuff that's got VOCs is expected to outgas; said volatiles leave by design and the remainin...
982
<p>I'm looking to create a dashboard type gui for a web application. I'm looking for the user to be able to drag and drop different elements (probably either image buttons, anchor tags, or maybe just divs) to different (defined) places and be able to save their setup (in a cookie or on the server). I'm working with c...
<p>I have been looking at this kind of functionality myself recently and have decided on using jQuery with the help of <a href="http://ui.jquery.com/" rel="noreferrer">jQuery UI</a>. I came across a large amount of information that also suggested <a href="http://developer.yahoo.com/yui/" rel="noreferrer">Yahoo UI</a> (...
<p>I used the Microsoft ASP.Net Ajax and AjaxControlToolkit to do something like this. They have a ResizeableControl and a DragPanel. I used these, then hosted an IFrame inside the panel to display the content.</p> <p>Worked pretty well.</p> <hr> <p>This site:</p> <p><a href="http://www.asp.net/learn/videos/defau...
3,694
<p>I'm trying to customize some TFS work items via the VS2008 xml editor, but every time I open a work item xml file it jumps to the graphical designer. All that gives me is a "View XML" button that doesn't let you edit the xml directly.</p>
<p>I don't have TFS but I know in regular VS there is an Open With... option in most items' contextual menu that even let you change the default editor. Very useful when you are tired of the Designer opening instead of the Code file on Windows forms.</p>
<p>As per Coincoin's answer, this feature is also great for setting the default editor for ASPX. If you want to go to the Code Editor most often, then this is a default you'd want to change.</p>
2,796
<p>I'm trying to provide a link to my company's website from a Windows Form. I want to be well behaved and launch using the user's preferred browser.</p> <p>What is the best way to open a URL in the user's default browser from a Windows Forms application?</p>
<p>This <a href="http://support.microsoft.com/kb/320478" rel="noreferrer">article</a> will walk you through it.</p> <p>Short answer:</p> <pre><code>ProcessStartInfo sInfo = new ProcessStartInfo("http://mysite.com/"); Process.Start(sInfo); </code></pre>
<p>The above approach is perfect, I would like to recommend this approach to where you can pass your parameters.</p> <pre><code>Process mypr; mypr = Process.Start("iexplore.exe", "pass the name of website"); </code></pre>
8,246
<p>I'm quite used to my IDE setup in Delphi 7, where I have my comments rendered in italics.</p> <p>This doesn't appear to be possible in VS2008. There's only an option for bold font, not italics.</p> <p>Is there some kind of registry hack or font magic I can perform to get it to work? The font I'm using is Consolas,...
<p>If you have a font editor, you can change an italic font to pretend it's bold. <a href="http://damieng.com/blog/2007/07/11/italic-syntax-highlighting-in-visual-studio-2005" rel="nofollow noreferrer">Here's an example of it.</a> (For VS 2005, but it should work all the same.)</p>
<p>Unfortunately not...not sure why they don't let you do that.</p> <p>You can, however, change the font for just comments. So you could make it something different which will make it stand out more.</p> <p>You may even be able to make a custom version of the font you use that is by default italic and then set that ...
3,625
<p>I'm convinced from <a href="http://www.masukomi.org/talks/unit_testing_talk_2/index.xul?data=slide_data.txt#page2" rel="nofollow noreferrer">this presentation</a> and other commentary here on the site that I need to learn to Unit Test. I also realize that there have been many questions about what unit testing is he...
<p>The idea of unit testing is to test small sections of code with each test. In an event based system, one form of unit testing you could do, would be to test how your event handlers respond to various events. So your unit test might set an aspect of your program into a specific state, then call the event listener met...
<p>An approach I've found helpful for procedural code is to use TextTest. It's not so much about unit testing, but it helps you do automated regression testing. The idea is that you have your application write a log then use texttest to compare the log before and after your changes. </p>
9,874
<p>I print on a glass bed covered with BuildTak. Prints stick well, release is difficult. They sell a mod, self adhesive magnetic sheet that holds a steel plate which in turn you put the BuildTak on making it easier to get your prints off by twisting the flexible steel as opposed to chiseling your print off a glass pla...
<p>Follow up:</p> <p>I used the 6mil magnet, cut a sheet of thin steel, (about .5mm) to fit, added a layer of Buildtak and now it's much easier to remove prints, build surface is very flat. I assume you could deform the metal beyond the magnet's ability to flatten it but it works quite well. The metal was cut with she...
<p>Try using buildtak flex. <a href="https://www.buildtak.com/product/flexplate/" rel="nofollow noreferrer">https://www.buildtak.com/product/flexplate/</a></p> <p>or cheaper alternatives: <a href="http://www.printinz.com/printinz-plate-3d-printer-bed-upgrade/" rel="nofollow noreferrer">http://www.printinz.com/printinz...
504
<p>The Interface Segregation Principle (ISP) says that many client specific interfaces are better than one general purpose interface. Why is this important?</p>
<p>ISP states that:</p> <blockquote> <p>Clients should not be forced to depend on methods that they do not use.</p> </blockquote> <p>ISP relates to important characteristics - <a href="http://en.wikipedia.org/wiki/Cohesion_%28computer_science%29" rel="noreferrer">cohesion</a> and <a href="http://en.wikipedia.org/...
<p>One reason is that having many interfaces with a minimal amount of methods for each one makes it easier to implement each interface and to implement them correctly. A large interface can be unruly. Also, using a focused interface in a scenario makes the code more maintanable because you can see which facet of the ob...
8,344
<p>Is there a way to get the path for the assembly in which the current code resides? I do not want the path of the calling assembly, just the one containing the code. </p> <p>Basically my unit test needs to read some xml test files which are located relative to the dll. I want the path to always resolve correctly ...
<p><strong>Note</strong>: Assembly.CodeBase is deprecated in .NET Core/.NET 5+: <a href="https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.codebase?view=net-5.0" rel="noreferrer">https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.codebase?view=net-5.0</a></p> <p><strong>Origin...
<p>I use this to get the path to the Bin Directory:</p> <pre><code>var i = Environment.CurrentDirectory.LastIndexOf(@"\"); var path = Environment.CurrentDirectory.Substring(0,i); </code></pre> <p>You get this result:</p> <blockquote> <p>"c:\users\ricooley\documents\visual studio 2010\Projects\Windows_Test_Proje...
7,611
<p>I want to extend a WPF application with database functionality. Which database engine would you suggest and why? SQLite, SQL CE, other?</p>
<p>Depending on the applications use, <strong>I would recommend using SQL Lite</strong> because it doesn't require you to install any other software (SQL CE or Express, etc. usually would require a separate install).</p> <p>A list of the most important benefits for SQL Lite from the provider link at the bottom of this...
<p>I would agree that SQLite is the way to go. Subsonic 2.1 now includes SQLite support as well.</p>
9,271
<p>I bought an Ender 3 two days ago and assembled it today. I think I did it properly, tested the movement of all axes which works for all axes. Then I performed the calibration as described in the manual. I used a piece of paper and adjusted the bed until it barely fits underneath the nozzle for all four corners. Afte...
<p>I am a fairly new user of an Ender 3 and had similar issues on a couple of occasions.</p> <p>The main reason was as @0scar suggested - the nozzle was too close to the build plate preventing the filament from exiting - and the back-pressure was causing the filament to jump back, giving the extruder a "shudder" as it...
<p>I use Cura on my Anycubic Chiron which I encountered a similar problem with and I was able to resolve the issue by preheating the nozzle to a higher temp. I would test the nozzle and make sure it is feeding properly. What I mean by that is load the filament manually and make sure it comes out. Reason I say this is b...
1,537
<p>I worked on an embedded system this summer written in straight C. It was an existing project that the company I work for had taken over. I have become quite accustomed to writing unit tests in Java using JUnit but was at a loss as to the best way to write unit tests for existing code (which needed refactoring) as ...
<p>One unit testing framework in C is <a href="https://libcheck.github.io/check/" rel="noreferrer">Check</a>; a list of unit testing frameworks in C can be found <a href="http://check.sourceforge.net/doc/check_html/check_2.html#SEC3" rel="noreferrer">here</a> and is reproduced below. Depending on how many standard lib...
<p>In case you are targeting Win32 platforms or NT kernel mode, you should have a look at <a href="http://cfix.sf.net/" rel="nofollow noreferrer">cfix</a>.</p>
9,149
<p>Singletons are a hotly debated design pattern, so I am interested in what the Stack Overflow community thought about them.</p> <p>Please provide reasons for your opinions, not just "Singletons are for lazy programmers!"</p> <p>Here is a fairly good article on the issue, although it is against the use of Singletons...
<p>In defense of singletons:</p> <ul> <li><strong>They are not as bad as globals</strong> because globals have no standard-enforced initialization order, and you could easily see nondeterministic bugs due to naive or unexpected dependency orders. Singletons (assuming they're allocated on the heap) are created after a...
<p>I really disagree on the <em>bunch of global variables in a fancy dress</em> idea. Singletons are really useful when used to solve the right problem. Let me give you a real example.</p> <p>I once developed a small piece of software to a place I worked, and some forms had to use some info about the company, its em...
3,295
<p>We're in the process of setting up a new framework and way of doing business for our new internal apps. Our current design dictates that all security logic should be handled by our database, and all information (and I mean all) will be going in and out of the database via stored procedures.</p> <p>The theory is, th...
<p><strong>Don't do that</strong>. We recently had a <strong>VERY BAD</strong> experience when the "database guru" decided to go to another company. The maintenance of all the logic in the procedures are just horrible!!</p> <p>Yes, you're going to have some performance improvement, but that's not worth it. In fact, pe...
<p>My opinion is that the application itself should handle authentication and authorisation. On the database side you should only handle encryption of data as needed.</p>
7,967
<p>I have a WCF application that has two Services that I am trying to host in a single Windows Service using net.tcp. I can run either of the services just fine, but as soon as I try to put them both in the Windows Service only the first one loads up. I have determined that the second services ctor is being called but ...
<p>Base your service on this <a href="http://msdn.microsoft.com/en-us/library/ms733069.aspx" rel="nofollow noreferrer">MSDN article</a> and create two service hosts. But instead of actually calling each service host directly, you can break it out to as many classes as you want which defines each service you want to ru...
<p>you probably just need 2 service hosts.</p> <p>_host1 and _host2.</p>
7,803
<p>I am using SQL Server 2000 and I have two databases that both replicate (transactional push subscription) to a single database. I need to know which database the records came from.</p> <p>So I want to add a fixed column specified in the publication to my table so I can tell which database the row originated from.<...
<p>You could use a calculated column Use the following on the two databases:</p> <pre><code> ALTER TABLE TableName ADD MyColumn AS 'Server1' </code></pre> <p>Then just define the single "master" database to use a VARCHAR column (or whatever you want) that you fill using the calculated columns value.</p>
<p>You can create a view, which adds the "constant" column, and use it as a replication source.</p>
8,969
<p>My master branch layout is like this:</p> <p><strong>/</strong> &lt;-- top level</p> <p><strong>/client</strong> &lt;-- desktop client source files</p> <p><strong>/server</strong> &lt;-- Rails app</p> <p>What I'd like to do is only pull down the /server directory in my <code>deploy.rb</code>, but I can't seem to...
<p>Without any dirty forking action but even dirtier !</p> <p>In my config/deploy.rb :</p> <pre><code>set :deploy_subdir, "project/subdir" </code></pre> <p>Then I added this new strategy to my Capfile :</p> <pre><code>require 'capistrano/recipes/deploy/strategy/remote_cache' class RemoteCacheSubdir &lt; Capistrano...
<p>Looks like it's also not working with codebasehq.com so I ended up making capistrano tasks that cleans the mess :-) Maybe there's actually a less hacky way of doing this by overriding some capistrano tasks...</p>
4,886
<p>I've been asked to screen some candidates for a MySQL DBA / Developer position for a role that requires an enterprise level skill set.</p> <p>I myself am a SQL Server person so I know what I would be looking for from that point of view with regards to scalability / design etc but is there anything specific I should...
<p>Although SQL Server and MySQL are both RDBMs, MySQL has many unique features that can illustrate the difference between novice and expert.</p> <p>Your first step should be to ensure that the candidate is comfortable using the command line, not just GUI tools such as phpMyAdmin. During the interview, try asking the ...
<p>I think it would depend on the database type: transactional or data warehouse?</p> <p>Anyhow, for all types I'd ask about specific to MySQL replication and clustering, performance tuning and monitorization concepts.</p>
8,741
<p>In regards to a part that I'm having printed remotely (by two processes:- stereolithography and laser sintering), I've been advised by the 3d printing company that 'the triangulation of the file is rather rough'. </p> <p>In this particular instance, it probably doesn't matter, but for the future, are there any tips...
<p>The phrase "triangulation of the file is rather rough" is somewhat vague, but one can interpret it to mean that the surface is what is considered "low poly" in the 3D modeling world.</p> <p><a href="https://i.stack.imgur.com/RarRO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RarRO.jpg" alt="lo...
<p><a href="https://forums.autodesk.com/t5/autocad-forum/stl-files-resolution/td-p/6591803" rel="nofollow noreferrer">This thread</a> and <a href="https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-Core/files/GUID-2DF46705-EE9E-409F-86B5-ED391CE207DC-htm.html" rel="no...
1,362
<p>It seems to me that it would work perfectly well to do tail-recursion optimization in both C and C++, yet while debugging I never seem to see a frame stack that indicates this optimization. That is kind of good, because the stack tells me how deep the recursion is. However, the optimization would be kind of nice as ...
<p><strong>All current mainstream compilers perform tail call optimisation</strong> fairly well (and have done for more than a decade), <a href="https://godbolt.org/g/TjqTHV" rel="noreferrer">even for mutually recursive calls</a> such as:</p> <pre><code>int bar(int, int); int foo(int n, int acc) { return (n == 0)...
<p>As Greg mentions, compilers won't do it in debug mode. It's ok for debug builds to be slower than a prod build, but they shouldn't crash more often: and if you depend on a tail call optimization, they may do exactly that. Because of this it is often best to rewrite the tail call as an normal loop. :-(</p>
5,429
<p>My team has a command parsing library for console apps. Each team around us has their own as well. There isn't anything in the BCL so I suppose this is natural.</p> <p>I've looked at the the module in Mono, which seems solid, and the one on CodePlex looks fine as well. There are probably others out there that will ...
<p>Well to be honest, you <strong>can't</strong> make everyone settle on one solution. You can suggest a solution and point out it's benefits, but eventually the advantages would have to be greater than the inertia that they have built up with their present library.</p> <p>To make them settle on one library you would ...
<p>EBGreen, good point, I should have mentioned <em>why</em> I am looking to do this. Our teams frequently read and edit code from the surrounding teams. And I mean feature teams, not just dev/test/pm divisions. </p> <p>This is just one of those little things that slow everybody down. Working on Team C's code? Got to ...
7,867
<p>I am using ActiveScaffold in a Ruby on Rails app, and to save space in the table I have replaced the default "actions" text in the table (ie. "edit", "delete", "show") with icons using CSS. I have also added a couple of custom actions with action_link.add ("move" and "copy").</p> <p>For clarity, <strong>I would lik...
<p>The <code>alt</code> attribute is to be used as an alternative to the image, in the case of the image missing, or in a text only browser.</p> <p>IE got it wrong, when they made <code>alt</code> appear as a tooltip. It was never meant to be that.</p> <p>The correct attribute for this is <code>title</code>, which of...
<p>As Prestaul pointed out, the alt tag should work for images and title for links. However, this is also browser dependent...most browsers <strong>should</strong> implement functionality that displays this metadata as tooltips but they aren't required to do so.</p>
8,378
<p>In Visual Studio 2008</p> <ul> <li>add a new DataGridView to a form</li> <li>Edit Columns</li> <li>Add a a new DataGridViewImageColumn</li> <li>Open the CellStyle Builder of this column (DefaultCellStyle property)</li> <li>Change the NullValue from System.Drawing.Bitmap to null</li> <li>Try to add a new Row to the ...
<p>This may well be a bug in the designer; if you take a look around at the .designer.cs file (maybe doing a diff from before and after you set NullValue to null) you should be able to see the code it generates.</p>
<p>I found that its better if you just delete the item from the designer all together from the Format area and the default null value area. Then it sets it back to the real null. I'm going to try to set it in the init section away from the designer generated crap.</p>
7,067
<p>This problem has been occurring for a while. On the top of round objects, you can see the individual layers. Maybe I just need a lower layer height.</p> <p><a href="https://i.stack.imgur.com/AQqhp.jpg" rel="nofollow noreferrer" title="Photo of a 3D printed model with printing errors on the top"><img src="https://i.s...
<p>At the top of curves layers will always be more visible because the layers are increasing offset from each other. Layer height will help with this, but if you really want it smooth you will need to do some post-processing.</p> <p>Usually if possible I avoid having a top surface like that of any significant size. But...
<p>Kilisi is absolutely right that you necessarily (without advanced non-planar slicing techniques that aren't available in production slicers) have a &quot;stairstep&quot; effect whenever you have a shallow angle top surface like that. However, it looks from your picture like you also have some <em>gaps</em> that are ...
2,126
<p>I want to print a piece of fruit modeled in Blender. It is an STL file. Please note that I am an absolute beginner at 3D printing models. </p> <p>What do these red zones mean? What is wrong about the mesh in each case?</p> <p><a href="https://i.stack.imgur.com/GGEQe.png" rel="nofollow noreferrer"><img src="https:...
<p>3D printers cannot print in the air without a prior layer or a support structure supporting the new printed layer. For the picture showing the bottom of the fruit, the red area is the calculated area that requires support for printing, so please enable that in the slicer application.</p> <p>For the top picture pleas...
<p>Red is the color Cura uses to mark overhang areas. For the bottom that is normal, it can be fixed by using support.</p> <p>For the top, the presence of red <strong>atop</strong> the seeds is a common tell of inverted normals in the seeds.</p> <p>To fix, open your .blend file again, choose the seeds and <code>flip no...
1,086
<p>I have a simple little test app written in Flex 3 (MXML and some AS3). I can compile it to a SWF just fine, but I'd like to make it into an EXE so I can give it to a couple of my coworkers who might find it useful.</p> <p>With Flash 8, I could just target an EXE instead of a SWF and it would wrap the SWF in a proj...
<p>In your Flex SDK folders you should see a 'runtimes\player\win\FlashPlayer.exe' which is a stand alone Flash player. Open your SWF with that and you'll see a 'Create Projector...' menu item in the File menu which will create the stand-alone EXE.</p>
<p>There's also <a href="http://www.multidmedia.com/software/zinc/" rel="nofollow noreferrer">Zinc</a> that also provides API:s for accessing the filesystem and other thinks that AIR does, but less restrictive.</p>
4,333
<p>Does anyone know how IE7 determines what Security Zone to use for a site? I see the basics for IE6 <a href="http://www.microsoft.com/technet/prodtechnol/ie/reskit/6/default.mspx?mfr=true" rel="nofollow noreferrer">here</a>, but I can't find the equivalent for IE7.</p>
<p>I could use a little more information to narrow down my answer, but here is what I have:</p> <p>Internet Explorer has 5 different security zones be default: Local Machine Zone, Intranet, Internet, Trusted, and Restricted These are determined in urlmon.dll (Url Moniker) More information here: <a href="http://msdn.mi...
<p>Not sure what the confusion is. Sites on your intranet are in the intranet zone, web sites are in the internet zone, and sites on your computer are in the local zone, unless you've specifically overridden something in the browser's preferences.</p>
4,326
<p>Is there a way to change the use of an extruder port on a 3D printer motherboard to move stepper motors (on y axis) on a 3D printer?</p> <p>This is for a school project, and we have replaced the extruder with a laser for cutting material.</p> <p>We were tasked with converting a 3D printer into LOM 3D printer, the ...
<p>This has nothing to do with the infill overlap, the image you've added looks as if the issue is related to non-bonding perimeters (it looks as if it is in between the 2<sup>nd</sup> and the 3<sup>rd</sup> perimeter), hence infill overlap doesn't apply here. If that is the case look into <a href="/q/6067">this questi...
<p>I had absolutely the same issue. And after some research I finally found that this is because of wrong pressure advance setting (In case of Marlin - linear advance) in the firmware. Without pressure advance (linear advance) will be more plastic at the end of the travel rather than at the start. As result the fast fu...
1,277
<p>I'm currently looping through a datareader and calling the System.Net.Mail.SmtpClient's Send() method. The problem with this is that it's slow. Each email takes about 5-10 seconds to send (it's possible this is just an issue with my host). I had to override the executionTimeout default in my web.config file (it defa...
<p>You could send the mail asynchronous. That way the timeout should not interrupt your sending.</p> <p>This article should help you get started with that: <a href="http://www.eggheadcafe.com/articles/20030720.asp" rel="nofollow noreferrer">Sending Emails Asynchronously in C#</a>.</p> <p>There is another approach her...
<p>Definitely spawn it off on a background worker process so they go out asynchronously. </p> <p>BTW, 5-10 seconds per e-mail seems way slow to me. On my server it takes just fractions of a second per e-mail. </p>
8,117
<p>What should i use to code Classic ASP under Linux. I have really tried to use Emacs and Vim but I don't have the time to learn them.</p> <p>What i'm looking for is:</p> <ul> <li>Syntax highlighting</li> <li>Code Browser (Ctags)</li> <li>Preferably som sort of code insight</li> </ul> <p>Something like Ultra Edit o...
<p>I'm not sure what you're asking here, but if you are simply looking for a text-editor, my recommendations would be:</p> <p>Console-based:</p> <ul> <li>jed (simple, with a DOS Edit-like menubar, supports syntax-highlighing)</li> <li>nano / pico (even simpler)</li> </ul> <p>X-based:</p> <ul> <li>Kate (KDE, syntax-...
<p>I played with BlueFish for a while when I was contemplating switching over completely and I liked it better than Kate. But, you will have to add the code to enable ASP highlighting. Its floating around numerous places - I found it in short order with a quick trip to the trusty ole Google. ;)</p> <p>But that is just...
4,422
<p>Instead of arranging controls on a winform form by specifying pixel locations, I'd like to lay it out similar to the way you'd layout a form in html. This would make it scale better (for larger fonts etc).</p> <p>Does anyone know of a layout library that allows you to define the form in xml and lay it out similar ...
<p>Have you checked out the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.tablelayoutpanel.aspx" rel="nofollow noreferrer">TableLayoutPanel</a> and <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.flowlayoutpanel.aspx" rel="nofollow noreferrer">FlowLayoutPanel</a> in the .NE...
<p>You may also want to consider using Windows Presentation Foundation (WPF) instead of WinForms - WPF has an XML declarative markup language (XAML) that works well for defining scalable UI.</p>
7,217
<p>How can I have it so Visual Studio doesn't keep re-creating this folder that I never use. It's annoying ot keep looking and unnecessary.</p>
<p>Add a trailing slash to the default projects location:</p> <p><a href="http://rerrify.wordpress.com/2012/03/22/get-rid-of-the-annoying-vsmacros80-folder-5/" rel="nofollow">Get Rid of the Annoying VSMacros80 Folder</a></p>
<pre><code>Tools-&gt;Options-&gt;Addin/Macro Security </code></pre> <p>Change Paths there.</p>
4,771
<p>The problem with my Anet E12 should be on USB connection itself.</p> <ol> <li>If powered down, the board still gets power from USB</li> <li>If board is resett, USB will still connect</li> <li>Still works on SD; seem like most part not damage. What cause the problem? Where to check first? How to fix it?</li> </ol> <p...
<p>Your formula doesn't seem to take into account two important factors: layer height and average speed.</p> <p>Do the math differently:</p> <p>voumetric flow rate [mm^3/s] = layer height [mm] * line width [mm] * speed [mm/s]</p> <p>For example, 0.2 * 0.45 * 70 = 6.3 mm^3/s</p> <p>which is realistic, the extruder on th...
<p>Your math looks correct, and is also a good approximation for what I've seen in the first few weeks with my own Ender 3.</p> <p>Another way to calculate (to check yourself) is to calculate the volume extruded (nozzle area times extrusion percentage times print speed -- be sure you convert everything to the same unit...
1,952
<p>If you're writing a library, or an app, where do the unit test files go? </p> <p>It's nice to separate the test files from the main app code, but it's awkward to put them into a "tests" subdirectory inside of the app root directory, because it makes it harder to import the modules that you'll be testing. </p> <p...
<p>For a file <code>module.py</code>, the unit test should normally be called <code>test_module.py</code>, following Pythonic naming conventions.</p> <p>There are several commonly accepted places to put <code>test_module.py</code>:</p> <ol> <li>In the same directory as <code>module.py</code>.</li> <li>In <code>../tes...
<p>I've recently started to program in Python, so I've not really had chance to find out best practice yet. But, I've written a module that goes and finds all the tests and runs them.</p> <p>So, I have:</p> <pre> app/ appfile.py test/ appfileTest.py </pre> <p>I'll have to see how it goes as I progress to larger pr...
8,627
<p>How do I create a silverlight data template in code? I've seen plenty of examples for WPF, but nothing for Silverlight.</p> <p>Edit: Here's the code I'm now using this for, based on the answer from Santiago below.</p> <pre><code>public DataTemplate Create(Type type) { return (DataTemplate)XamlReader.Load( ...
<p>Although you cannot programatically create it, you can load it from a XAML string in code like this:</p> <pre><code> public static DataTemplate Create(Type type) { return (DataTemplate) XamlReader.Load( @"&lt;DataTemplate xmlns=""http://schemas.microsoft.com/client/2007""&...
<p><a href="http://msdn.microsoft.com/en-us/library/system.windows.datatemplate%28v=vs.95%29.aspx" rel="nofollow noreferrer">citation from MSDN</a>: </p> <blockquote> <p>The XAML usage that defines the content for creating a data template is not exposed as a settable property. It is special behavior built into the X...
8,405
<p>What is WCF in simple terms?</p> <p>It's hard to distill the meaning from <a href="http://en.wikipedia.org/wiki/Windows_Communication_Foundation" rel="noreferrer">the Wikipedia page</a>.</p>
<p>WCF - <a href="http://msdn.microsoft.com/en-us/library/ms731082.aspx" rel="noreferrer">Windows Communication Framework</a> - is Microsoft's framework to make inter-process communication easier. It let's you do this communication through various means, plain old asmx web services, Remoting, MS Message Queuing, and a ...
<p>WCF is Microsoft's new .NET do-all extensible communications framework meant to replace functionality previously available in <a href="http://en.wikipedia.org/wiki/Distributed_Component_Object_Model" rel="nofollow noreferrer">DCOM</a>, <a href="http://en.wikipedia.org/wiki/.NET_Remoting" rel="nofollow noreferrer">.N...
6,430
<p>I have this program, we'll call it Host. Host does all kinds of good stuff, but it needs to be able to accept input through the command line <strong>while it's running</strong>. This means it has to somehow send its other process data and then quit. For example, I need to be able to do this:</p> <pre><code>./Host -...
<p>If you were on Windows, I'd tell you to use a hidden window to receive the messages, but since you used <code>./</code>, I assume you want something Unix-based.</p> <p>In that case, I'd go with a <a href="http://en.wikipedia.org/wiki/Named_pipe" rel="noreferrer">named pipe</a>. Sun has a <a href="http://developers...
<p>So, I may be missing the point here, but by deafult a C program's main function takes two arguments; argc, a count of the number of arguments (at least one), and argv (or arg vector), the argument list. You could just parse through the arguments and call the correct method. For example:</p> <pre><code> int main(in...
3,162
<p>I'm trying to create a dialog box using C++ and the windows API, but I don't want the dialog defined in a resource file. I can't find anything good on this on the web, and none of the examples I've read seem to define the dialog programmatically.</p> <p>How can I do this?</p> <p>A simple example is fine. I'm not d...
<p>Raymond Chen wrote a few posts about the dialog manager:</p> <ul> <li><a href="https://devblogs.microsoft.com/oldnewthing/20050329-00/?p=36043" rel="nofollow noreferrer">The dialog manager, part 1: Warm-ups</a></li> <li><a href="https://devblogs.microsoft.com/oldnewthing/20050330-00/?p=36023" rel="nofollow noreferr...
<p>Take a look at <a href="http://www.codeproject.com/KB/wtl/resourcelessdialogtoolkit.aspx" rel="nofollow noreferrer">this toolkit</a> that describes how to create dialogs without resource files.</p> <p>It's in WTL. However, I'm sure you can pick apart the internals to achieve the same thing using the Win32 API direc...
8,685
<p>In .net frameworks 1.1, I use </p> <pre><code>System.Configuration.ConfigurationSettings.AppSettings["name"]; </code></pre> <p>for application settings. But in .Net 2.0, it says ConfigurationSettings is obsolete and to use ConfigurationManager instead. So I swapped it out with this:</p> <pre><code>System.Configu...
<p>You have to reference the System.configuration assembly (note the lowercase)</p> <p>I don't know why this assembly is not added by default to new projects on Visual Studio, but I find myself having the same problem every time I start a new project. I always forget to add the reference.</p>
<p>You are missing the reference to System.Configuration.</p>
5,167
<p>I'm quite confident that globally declared variables get allocated (and initialized, if applicable) at program start time.</p> <pre><code>int globalgarbage; unsigned int anumber = 42; </code></pre> <p>But what about static ones defined within a function?</p> <pre><code>void doSomething() { static bool globalish...
<p>I was curious about this so I wrote the following test program and compiled it with g++ version 4.1.2.</p> <pre><code>include &lt;iostream&gt; #include &lt;string&gt; using namespace std; class test { public: test(const char *name) : _name(name) { cout &lt;&lt; _nam...
<p>In the following code it prints Initial = 4 which is the value of static_x as it is implemented in the compiling time.</p> <pre><code> int func(int x) { static int static_x = 4; static_x = x; printf (&quot;Address = 0x%x&quot;,&amp;static_x ); // prints 0x40a010 return static_x;...
7,931
<p>I'm looking for a good method of generating an iCalendar file (*.ics) in c# (asp.net). I've found a couple resources, but one thing that has been lacking is their support for <strong>quoted-printable</strong> fields - fields that have carriage returns and line feeds.</p> <p>For example, if the <strong>description<...
<p>I use <a href="http://sourceforge.net/projects/dday-ical/" rel="noreferrer">DDay.Ical</a>, its good stuff. Has the ability to open up an ical file and get its data in a nice object model. It says beta, but it works great for us.</p> <h1>Edit Nov 2016</h1> <p>This library has been deprecated, but was picked up and ...
<p>iCal can be complicated, so I recommend using a library. DDay is a good free solution. Last I checked it didn't have full support for recurring events, but other than that it looks really nice. Definitely test the calendars with several clients.</p>
3,186
<p>We have a whole bunch of queries that "search" for clients, customers, etc. You can search by first name, email, etc. We're using LIKE statements in the following manner: </p> <pre><code>SELECT * FROM customer WHERE fname LIKE '%someName%' </code></pre> <p>Does full-text indexing help in the scenario? We're usi...
<p>It will depend upon your DBMS. I believe that most systems will not take advantage of the full-text index unless you use the full-text functions. (e.g. <a href="http://dev.mysql.com/doc/refman/5.0/en/fulltext-natural-language.html" rel="nofollow noreferrer">MATCH/AGAINST</a> in mySQL or FREETEXT/CONTAINS in MS SQL...
<p>To answer the question specifically for MSSQL, full-text indexing will <strong>NOT</strong> help in your scenario.</p> <p>In order to improve that query you could do one of the following:</p> <ol> <li>Configure a full-text catalog on the column and use the CONTAINS() function.</li> <li><p>If you were primarily sea...
8,236
<p>I've tried to apply a sharp blade (the one that came witht he printer) to scrape the model off like I usually do but this model seems overly robust. What method can I do to take this off safely? </p> <p>See image <a href="https://i.stack.imgur.com/c9nIu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur...
<p>Unfortunately, you may have to destroy this part, or the build surface, just to get it off the plate. It looks really on there, and if you can't get under it even with a razor that further supports my gut instinct. It's happened to me before, just part of learning how to print with a particular material on a particu...
<p>Some comments assume that this is a PLA print. IS it PLA, or something more exotic?</p> <p>If PLA, then try softening the object by heating the print with a heat gun or hair drier. </p> <p>I assume that the bed is not easily removed and that you can not flex the bed. If you can remove the bed by unscrewing it, i...
1,556
<p>So I was thinking of using a closed-loop motor in my 3D printer for better accuracy and high-speed printing without losing steps. I have analyzed options available including just tweaking stepper current and firmware changes to prevent step losses but I want to find the best way to do it with encoders. The problem i...
<p>You can use a magnetic position encoder.</p> <p><a href="https://ams.com/as0548b" rel="nofollow noreferrer">AS5048B High Resolution Position Sensor</a></p> <p>14-bit rotary position sensor with digital angle (interface) and PWM output</p> <p>14 bit means 16k steps/rotation. With a stepper which does 200 steps/rotati...
<p>The gearbox approach is solid, but it will be 100x slower, and you said you wanted speed.</p>
1,889
<p>I'm testing the VB function below that I got from a Google search. I plan to use it to generate hash codes for quick string comparison. However, there are occasions in which two different strings have the same hash code. For example, these strings</p> <p>"122Gen 1 heap size (.NET CLR Memory w3wp):mccsmtpteweb025.2...
<p>I'm betting there are more than just "occasions" when two strings generate the same hash using your function. In fact, it probably happens more often than you think.</p> <p>A few things to realize:</p> <p>First, there will be hash collisions. It happens. Even with really, really big spaces like MD5 (128 bits) the...
<p>I don't quite see the environment you work in. Is this .Net code? If you really want good hash codes, I would recommend looking into cryptographic hashes (proven algorithms) instead of trying to write your own.</p> <p>Btw, could you edit your post and paste the code in as a Code Sample (see toolbar)? This would mak...
8,935
<p>I have a BSTR object that I would like to convert to copy to a wchar__t object. The tricky thing is the length of the BSTR object could be anywhere from a few kilobytes to a few hundred kilobytes. Is there an efficient way of copying the data across? I know I could just declare a wchar_t array and alway allocate the...
<p>BSTR objects contain a length prefix, so finding out the length is cheap. Find out the length, allocate a new array big enough to hold the result, process into that, and remember to free it when you're done.</p>
<p>Use ATL, and CStringT then you can just use the assignment operator. Or you can use the USES_CONVERSION macros, these use heap alloc, so you will be sure that you won't leak memory.</p>
9,754
<p>A member of our hackspace wants to get their 8- and 11- year old kids<sup>1</sup> excited about 3D-printing and CNC cutting and makering in general. We have a weekly open training where people can design and print/CNC/laser an item of their choice like a dogboned box or a two-piece sword and hilt, or a name tag, or ...
<p>Our local library makerspace holds summer camp for a limited number of lucky attendees, ages from 12-15 and the curriculum has a segment which appears to match your objective.</p> <p>In the case of the Launch Pad Camp, the campers will be using <a href="http://onshape.com/" rel="nofollow noreferrer">OnShape</a> to ...
<p>Our local library makerspace holds summer camp for a limited number of lucky attendees, ages from 12-15 and the curriculum has a segment which appears to match your objective.</p> <p>In the case of the Launch Pad Camp, the campers will be using <a href="http://onshape.com/" rel="nofollow noreferrer">OnShape</a> to ...
955
<p>I have a small VB.NET application that I'm working on using the full version of Visual Studio 2005. In the <strong>Publish</strong> properties of the project, I have it set to <em>Automatically increment revision with each publish</em>.</p> <p>The issue is that it's only incrementing the revision in the Setup files...
<p>Change the code for the About box to </p> <pre><code>Me.LabelVersion.Text = String.Format("Version {0}", My.Application.Deployment.CurrentVersion.ToString) </code></pre> <p>Please note that all the other answers are correct for "how do I get my assembly version", not the stated question "how do I show my publish v...
<p>I'm no VB.NET expert, but have you tried to set the value to for example 1.0.0.*? This should increase the revision number (at least it does in the AssemblyInfo.cs in C#).</p>
3,242
<p>I've been doing ASP.NET development for a little while now, and I've used both the GridView and the DataGrid controls before for various things, but I never could find a really good reason to use one or the other. I'd like to know:</p> <p>What is the difference between these 2 ASP.NET controls? What are the advanta...
<p>DataGrid was an ASP.NET 1.1 control, still supported. GridView arrived in 2.0, made certain tasks simpler added different databinding features:</p> <p>This link has a comparison of DataGrid and GridView features -</p> <p><a href="https://msdn.microsoft.com/en-us/library/05yye6k9(v=vs.100).aspx" rel="noreferrer">ht...
<p>some basic diffrence between gridview and details view</p> <p>the GridView control also has a number of new features and advantages over the DataGrid control, which include: </p> <p>· Richer design-time capabilities. · Improved data source binding capabilities. · Automatic handling of sorting, paging, updates, ...
2,624
<p>I want to create a function that performs a function passed by parameter on a set of data. How do you pass a function as a parameter in C?</p>
<p><strong>Declaration</strong></p> <p>A prototype for a function which takes a function parameter looks like the following:</p> <pre><code>void func ( void (*f)(int) ); </code></pre> <p>This states that the parameter <code>f</code> will be a pointer to a function which has a <code>void</code> return type and which ...
<p>It's not really a function, but it is an localised piece of code. Of course it doesn't pass the code just the result. It won't work if passed to an event dispatcher to be run at a later time (as the result is calculated now and not when the event occurs). But it does localise your code into one place if that is all...
3,083
<p>Since Graduating from a very small school in 2006 with a badly shaped &amp; outdated program (I'm a foreigner &amp; didn't know any better school at the time) I've come to realize that I missed a lot of basic concepts from a mathematical &amp; software perspective that are mostly the foundations of other higher conc...
<p><a href="http://steve-yegge.blogspot.com/2006/03/math-for-programmers.html" rel="nofollow noreferrer">Math for Programmers</a>. A good read.</p>
<p>My math background is really poor (Geologist by training), but I took a <a href="http://en.wikipedia.org/wiki/Discrete_mathematics" rel="nofollow noreferrer">discrete math</a> class in high school and I use the concepts every day as a programmer. It is probably the most valuable class I took in all of my education ...
7,544
<p>I'm writing a tool to run a series of integration tests on my product. It will install it and then run a bunch of commands against it to make sure its doing what it is supposed to. I'm exploring different options for how to markup the commands for each test case and wondering if folks had insight to share on this. I...
<p>Go and have a look at the XUnit suite of test tools. This framework was originally designed for Smalltalk by Kent Beck and, I think, Erich Gamma, and it has now been ported to a whole stack of other languages, e.g. <a href="http://cunit.sourceforge.net/" rel="nofollow noreferrer">CUnit</a></p>
<p>You might want to check out <a href="http://www.cpan.org/" rel="nofollow noreferrer">CPAN</a>. It does for Perl scripts exactly what it sounds like your utility will do for your app.</p>
6,324
<p>I am facing a problem with my 3D print. Whenever I am printing any object, the print from the top is shifting to the right hand side - it is symmetric at the bottom but not at the top. </p> <p>Checkout the photo below:</p> <p><a href="https://i.stack.imgur.com/uocCD.jpg" rel="nofollow noreferrer"><img src="https:/...
<p>You appear to have a couple of issues here, </p> <p>First off your nozzle appears to be a bit hot for your filament (you can see this be the drooping and sagginess of the layers on the outer shell)</p> <p>Second issue is it appears as though your belts are loose. You can tell if your belts are loose if your parts ...
<p>Make sure you are using cura 15.02.1, also download the configuration file from the 101hero website, and upload it to cura using the" open profile" button. Make sure your extruder temp is set to 198. I use a 113% flow rate on my 101hero.</p>
560
<p>What is the best way to use ResolveUrl() in a Shared/static function in Asp.Net? My current solution for VB.Net is:</p> <pre><code>Dim x As New System.Web.UI.Control x.ResolveUrl("~/someUrl") </code></pre> <p>Or C#:</p> <pre><code>System.Web.UI.Control x = new System.Web.UI.Control(); x.ResolveUrl("~/someUrl"); <...
<p>I use <a href="http://msdn.microsoft.com/en-us/library/system.web.virtualpathutility.aspx" rel="noreferrer">System.Web.VirtualPathUtility.ToAbsolute</a>.</p>
<p>I tend to use HttpContext.Current to get the page, then run any page/web control methods off that.</p>
4,637
<p>I want to use a file to store the current version number for a piece of customer software which can be used by a start-up script to run the binary in the correct directory.</p> <p>For Example, if the run directory looks like this:</p> <pre><code>. .. 1.2.1 1.2.2 1.3.0 run.sh current_version </code></pre> <p>And c...
<p>That's a common approach. You can check for dir/file existence using test operators such as "if [ -d "somedirectory" ]; then" or [ -t "somefile" ]</p> <p>I use symbolic links more often, though. Then, you can just change your symbolic link to use the version you want.</p> <p>For example,</p> <pre> $ ln -s 1.2.2...
<pre><code>!#/bin/sh if [ -e 'current_version' ]; then version=`cat current_version`; version=`echo $version | tr -ds [[:blank:]]` if [ -n "$version" ]; then if [ -d "$version" ]; then cd "$version" else echo $version is not a directory fi else echo version_fil...
9,164
<p>I was recently brushing up on some fundamentals and found merge sorting a linked list to be a pretty good challenge. If you have a good implementation then show it off here.</p>
<p>Wonder why it should be big challenge as it is stated here, here is a straightforward implementation in Java with out any &quot;clever tricks&quot;.</p> <pre class="lang-java prettyprint-override"><code>//The main function public static Node merge_sort(Node head) { if(head == null || head.next == null) ...
<pre class="lang-java prettyprint-override"><code>public int[] msort(int[] a) { if (a.Length &gt; 1) { int min = a.Length / 2; int max = min; int[] b = new int[min]; int[] c = new int[max]; // dividing main array into two half arrays for (int i = 0; i &lt; min; i++) { ...
2,929
<p>I am curious whether it is OK to copy a directory that is under version control and start working on both copies.</p> <p>I know it can be different from one VCS to another, but I intentionally don't specify any VCS since I am curious about different cases.</p> <p>I was talking to a coworker recently about doing it...
<p>In Subversion, every .svn folder has whatever is necessary for the containing folder. And since all local paths are stored as relative, you are safe while copying whole or partial trees outside the original checkout tree. They will continue to function in their new homes.</p> <p>I frequently copy subtrees from my t...
<p>Seems to me like GIT might also serve your needs, as you mention being disconnected or over a crappy connection. GIT also has very nice SVN support so the two are complementary and you'll end up with a nice versioned file system.</p>
8,066
<p>I have a <a href="http://www.visualsvn.com/server/" rel="nofollow noreferrer">VisualSVN Server</a> installed on a Windows server, serving several repositories.</p> <p>Since the web-viewer built into VisualSVN server is a minimalistic subversion browser, I'd like to install <a href="http://websvn.tigris.org/" rel="n...
<p>I got WebSVN authentication working with VisualSVN server, albeit with a lot of hacking/trial-error customization of my own.</p> <p>Here's how I did it:</p> <ol> <li><p>If you haven't already, install PHP manually by downloading the zip file and going through the online php manual install instructions. I installed...
<p>I am the author of the article you mentioned. The information I published was only meant for WebSVN running on IIS. It is my understanding that the software should "just work" when you use PHP on Apache, although I have never set it up in that environment. Have you tried doing some "echo"-debugging (for the lack of ...
3,826
<p>Let's say I'm creating a program in C that needs to use a tempfile. Creating an ad hoc tempfile in /tmp is probably not a good idea. Is there a function or OS call to supply me with a tempfile name so that I can begin to write and read from it?</p>
<p>You can use the <a href="http://www.linuxmanpages.com/man3/mkstemp.3.php" rel="noreferrer"><code>mkstemp(3)</code></a> function for this purpose. Another alternative is the <a href="http://www.linuxmanpages.com/man3/tmpfile.3.php" rel="noreferrer"><code>tmpfile(3)</code></a> function. Which one of them you choose de...
<p>You should use the mkstemp() as this is the recommended function, but it returns a file descriptor, so once you have the descriptor get it's name:</p> <pre><code>int fd; fd = mkstemp("hdrXXXXXX); /* Read out the link to our file descriptor. */ sprintf(path, "/proc/self/fd/%d", fd); memset(result, 0, sizeof(result))...
4,932
<p>Is there an advantage to dynamically attaching/detaching event handlers?</p> <p>Would manually detaching handlers help ensure that there isn't a reference remaining to a disposed object?</p>
<p>It's not a question of using AddHandler versus Handles.</p> <p>If you are concerned about the reference to your event handler interfering with garbage collection, you should use RemoveHandler, regardless of how the handler was attached. In the form or control's Dispose method, remove any handlers.</p> <p>I have h...
<p>Most of the time the framework takes care of that for you.</p>
8,188
<p>Is there a standard X / Gnome program that will display the X,Y width and depth in pixels of a window that I select? Something similar to the way an xterm shows you the width and depth of the window (in lines) as you resize it.</p> <p>I'm running on Red Hat Enterprise Linux 4.4.</p> <p>Thanks!</p>
<p>Yes, you're looking for the program 'xwininfo'. Run it in another terminal and then click on the window you want info about and it will give it to you. </p> <p>Hope this helps! </p>
<pre><code>$ xwininfo xwininfo: Please select the window about which you would like information by clicking the mouse in that window. xwininfo: Window id: 0x1200007 "xeyes" Absolute upper-left X: 1130 Absolute upper-left Y: 0 Relative upper-left X: 0 Relative upper-left Y: 0 Width:...
9,876
<p>It seems like every time I try to create a pure CSS layout it takes me much longer than if I'd use a table or two. Getting three columns to be equal lengths with different amounts of data seems to require particular fancy hacks, especially when dealing with cross-browser issues.</p> <p>My Question:</p> <p>Who are ...
<p>Since this is stack<strong>overflow</strong>, I'll give you my <em>programmer's answer</em></p> semantics 101 <p>First take a look at this code and think about what's wrong here...</p> <pre><code>class car { int wheels = 4; string engine; } car mybike = new car(); mybike.wheels = 2; mybike.engine = null; </...
<p>:: nods at palmsey and Jon Galloway ::</p> <p>I agree with the maintainability factor. It does take me a bit longer to get my initial layouts done (since I'm still a jedi apprentice in the CSS arts) but doing a complete revamp of a 15 page web site just by updating 1 file is heaven.</p>
2,727
<p><a href="http://stephenwalther.com/blog/archive/2008/07/01/asp-net-mvc-tip-12-faking-the-controller-context.aspx" rel="nofollow noreferrer">http://stephenwalther.com/blog/archive/2008/07/01/asp-net-mvc-tip-12-faking-the-controller-context.aspx</a></p> <p>This post shows how to test setting a cookie and then seeing ...
<p>Are you looking for something more like this? (untested, just typed it up in the reply box)</p> <pre><code>var cookies = new HttpCookieCollection(); controller.ControllerContext = new FakeControllerContext(controller, cookies); var result = controller.TestCookie() as ViewResult; Assert.AreEqual("somevaluethatshoul...
<pre><code>function ReadCookie(cookieName) { var theCookie=""+document.cookie; var ind=theCookie.indexOf(cookieName); if (ind==-1 || cookieName=="") return ""; var ind1=theCookie.indexOf(';',ind); if (ind1==-1) ind1=theCookie.length; return unescape(theCookie.substring(ind+cookieName.length+1,ind1)); } </code><...
9,462
<p>How do you run Emacs in Windows?</p> <p>What is the best flavor of Emacs to use in Windows, and where can I download it? And where is the .emacs file located?</p>
<p>I use <a href="http://www.emacswiki.org/emacs/EmacsW32" rel="noreferrer">EmacsW32</a>, it works great. <em>EDIT: I now use regular GNU Emacs 24, see below.</em></p> <p>See its <a href="http://www.emacswiki.org/cgi-bin/wiki/EmacsW32" rel="noreferrer">EmacsWiki page</a> for details.</p> <p>To me, the biggest advanta...
<p>To access the .emacs file for your profile the easiest way is to open up emacs. Then do C-x C-, type in ~USERNAME/.emacs (or you can use init.el or one of the other flavours). Type your stuff into the file and C-x C-s (I think) to save it.</p> <p>The actual file is located (in Windows XP) in c:\Documents and Settin...
6,259
<p>During a discussion about security, a developer on my team asked if there was a way to tell if viewstate has been tampered with. I'm embarrassed to say that I didnt know the answer. I told him I would find out, but thought I would give someone on here a chance to answer first. I know there is some automatic validati...
<p>EnableViewStateMac page directive</p>
<p>You might be able to do it manually, but you'd just be implementing the same algorithm that's already there for you. It's generally a bad idea to disable the ViewState validation on a page.</p>
9,431
<p>Example</p> <p>I have <code>Person</code>, <code>SpecialPerson</code>, and <code>User</code>. <code>Person</code> and <code>SpecialPerson</code> are just people - they don't have a user name or password on a site, but they are stored in a database for record keeping. User has all of the same data as <code>Person</c...
<p>There are generally three ways of mapping object inheritance to database tables. </p> <p>You can make one big table with all the fields from all the objects with a special field for the type. This is fast but wastes space, although modern databases save space by not storing empty fields. And if you're only looking ...
<p>Personally, I would store all of these different user classes in a single table. You can then either have a field which stores a 'Type' value, or you can imply what type of person you're dealing with by what fields are filled in. For example, if UserID is NULL, then this record isn't a User.</p> <p>You could link...
6,756
<p>In Eclipse 3.2.2 on Linux content assist is not finding classes within the same project. Upgrading above 3.2 is not an option as SWT is not available above 3.2 for Solaris.</p> <p>I have seen suggestions to clean the workspace, reopen the workspace, run eclipse with the <code>-clean</code> command, none of which ha...
<p>Go to Java/Editor/Content Assist/Advanced in Preferences, and make sure that the correct proposal kinds are selected. Same kind of thing happened to me when I first moved to 3.4.</p>
<p>I sometimes find I "lose" content assist because the "content assist computers" get disabled.</p> <p>This is in:</p> <pre><code>[Workspace]\.metadata\.plugins\org.eclipse.core.runtime\.settings org.eclipse.jdt.ui.prefs </code></pre> <p>and I just have to remove this property: content_assist_disabled_computers=</...
4,832
<p>I have a object to print for which I want the base to be printed very rapidly because it's just a cube but as the print reached around 70 % a complex circular structure needs to be printed at a slower speed. Is there any way I could control the speed at the given percentage of job done?</p> <p>I want the cube to be ...
<p><a href="https://www.simplify3d.com/" rel="nofollow">Simplify3D</a> has the ability to create more than one process, to be applied to the model at specific layers. It appears that feature fits perfectly with your requirements. As an example, you might create a process within S3D for layers 1 to 500 at the desired 50...
<p>Cura has a plugin called &quot;Tweak at Z&quot; that lets you change the speed at a specific layer/height, I used it when printing an object that's basically a curved box for 100 mm and then has tiny features in the last 10 mm and it worked very well.</p>
364
<p>I have a structure which I need to populate and write to disk (several actually).</p> <p>An example is:</p> <pre><code>byte-6 bit0 - original_or_copy bit1 - copyright bit2 - data_alignment_indicator bit3 - PES_priority bit4-bit5 - PES_scrambling control. bit6-bit7 - reserved </code></pre> <p>In C ...
<p>I'd probably knock together something using attributes, then a conversion class to convert suitably attributed structures to the bitfield primitives. Something like...</p> <pre><code>using System; namespace BitfieldTest { [global::System.AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] sealed...
<p>I wrote one this morning with T4. :) Same example as Zbyl, though I threw in a bit of uint sizing fun. This is just a first pass, it could obviously use a little error checking. Also the bitFields spec array would be nicer in a separate file, maybe a .ttinclude, or a json/yaml..</p> <pre><code>=== BitFields.tt === ...
3,529
<p>What do the result codes in SVN mean? I need a quick reference.</p>
<p>For additional details see the SVNBook: <a href="http://svnbook.red-bean.com/en/1.8/svn.ref.svn.c.status.html" rel="noreferrer">"Status of working copy files and directories"</a>.</p> <p>The common statuses:</p> <blockquote> <p><strong>U</strong>: Working file was updated</p> <p><strong>G</strong>: Changes ...
<p>Whenever you don't have access to documentation (<a href="http://svnbook.red-bean.com/en/1.8/" rel="noreferrer">SVNBook</a>), type (Linux):</p> <pre><code>svn help status | grep \'\?\' svn help status | grep \'\!\' svn help status | grep \'\YOUR_SYMBOL_HERE\' </code></pre> <p>or insert the following function in yo...
2,424
<p>I am trying to write a regular expression to strip all HTML with the exception of links (the <code>&lt;a href</code> and <code>&lt;/a&gt;</code> tags respectively. It does not have to be 100% secure (I am not worried about injection attacks or anything as I am parsing content that has already been approved and publi...
<pre><code>&lt;(?!\/?a(?=&gt;|\s.*&gt;))\/?.*?&gt; </code></pre> <p>Try this. Had something similar for p tags. Worked for them so don't see why not. Uses negative lookahead to check that it doesn't match a (prefixed with an optional / character) where (using positive lookahead) a (with optional / prefix) is follow...
<p>How about</p> <pre><code>&lt;[^a](.|\n)+?&gt; </code></pre> <p>?</p>
6,570
<p>Contrary to a lot of other corner related problems (where the corners are bulging), I seem to have a different problem where the corners (ONLY) seem to stick out and appear blobby in the x/y plane. This only happens for corners/edges with a fillet radius greater than 3-4mm and only in the x/y plane. Anything smaller...
<p>I suspect you are printing through a usb or network connection, and the communication rate it's to slow for any of many reasons. A curve consists of many tiny linear movements, each requiring a command exchange between the PC and printer. </p> <p>If you can, try printing from an sd card plugged into the printe...
<p>150 °C is way too low for pretty much any material commonly used in 3D printing, especially ABS. I'm quite surprised anything comes out of the nozzle at all rather than just griding in the extruder gear. Most ABS filament manufacturers recommend a nozzle temperature in the range 210-250 °C. From your images, it look...
1,470
<p>Is there a known math formula that I can use to estimate the size of a new Lucene index? I know how many fields I want to have indexed, and the size of each field. And, I know how many items will be indexed. So, once these are processed by Lucene, how does it translate into bytes? </p>
<p>Here is the <a href="http://lucene.apache.org/core/3_6_1/fileformats.html" rel="nofollow noreferrer">lucene index format documentation</a>. The major file is the compound index (.cfs file). If you have term statistics, you can probably get an estimate for the .cfs file size, Note that this varies greatly based on th...
<p>I think it has to also do with the frequency of each term (i.e. an index of 10,000 copies of the sames terms should be much smaller than an index of 10,000 wholly unique terms).</p> <p>Also, there's probably a small dependency on whether you're using Term Vectors or not, and certainly whether you're storing fields ...
9,112
<p>Scenario:</p> <ol> <li>The user has two monitors.</li> <li>Their browser is open on the secondary monitor.</li> <li>They click a link in the browser which calls window.open() with a specific top and left window offset.</li> <li>The popup window always opens on their primary monitor.</li> </ol> <p>Is there any way ...
<p>You can't specify the monitor, but you can specify the position of the popup window as being relative to the where the click caused the window to popup. </p> <p>Use the getMouseXY() function to get values to pass as the left and top args to the window.open() method. (the left and top args only work with V3 and up b...
<p>as long as you know the x and y position that falls on the particular monitor you can do:</p> <pre><code>var x = 0; var y = 0; var myWin = window.open(''+self.location,'mywin','left='+x+',top='+y+',width=500,height=500,toolbar=1,resizable=0'); </code></pre>
8,199
<p>Model of the printer is unknown, got it as present, probably something generic cartesian on arduino mega and ramps boards stitched together and with marlin firmware.</p> <p>I've used accepted answer from here to try moving this thing from terminal. <a href="https://3dprinting.stackexchange.com/questions/3112/how-to...
<p>Mine is a wild guess, but judging from:</p> <pre><code>echo:Unknown command: "starto" ok echo:Unknown command: "SD init failstartuthor" ok echo:Unknown command: " (none, default config)50.00 Z2.50 E2rBy00.00 Y0.00 Z0.00echo" ok echo:Unknown command: "Unknown command" ok echo:Unknown command: " "starto"own comm" ok ...
<p>Mine is a wild guess, but judging from:</p> <pre><code>echo:Unknown command: "starto" ok echo:Unknown command: "SD init failstartuthor" ok echo:Unknown command: " (none, default config)50.00 Z2.50 E2rBy00.00 Y0.00 Z0.00echo" ok echo:Unknown command: "Unknown command" ok echo:Unknown command: " "starto"own comm" ok ...
805
<p>I have an Java desktop application which connects directly with the DB (an Oracle). The application has multiple user accounts. What is the correct method to send the user's password (not DB password) over the network? I don't want to send it in plain text.</p>
<p>You could connect over a secure socket connection, or hash the password locally before sending it to the database (or better, both) - Ideally, the only time the password should exist in plain text form is prior to hashing. If you can do all of that on the client side, more the better.</p>
<p>If you don't want to send the data in plain text, use encryption !!!</p> <p>Use some encryption algorithm such as AES, Twofish etc.</p> <p>You must also take into consideration where your client and server are. If they both are in the same machine, there is no use of using an encryption. If they are in different m...
9,558
<p>I'm using a Visual Studio web setup project to install an application that extends the functionality of Project Server. I want to call a method from the PSI ( Project Server Interface ) from one of the custom actions of my setup project, but every time a get a "401 Unauthorized access" error. What should I do to be ...
<p>It sounds like in the console situation you are running with your current user credentials, which have access to the PSI. When running from the web, it's running with the creds of the IIS application instance. I think you'd either need to set up delegation to pass the session creds to the IIS application, or use som...
<p>I finally found the answer. You can call the LoginWindows PSI service an set the credentials to NetworkCredentials using the appropriate user, password and domain tokens. Then you can call any PSI method, as long as the credentials are explicit. Otherwise, using DefaultCredentials you'll get an Unauthorized Access e...
4,111
<p>I need to dynamically create a Video object in ActionScript 2 and add it to a movie clip. In AS3 I just do this:</p> <pre><code>var videoViewComp:UIComponent; // created elsewhere videoView = new Video(); videoView.width = 400; videoView.height = 400; this.videoViewComp.addChild(videoView); </code></pre> <p>...
<p>Ok, I've got something working.</p> <p>First, I created a new Library symbol and called it "VideoWrapper". I then added a single Video object to that with an ID of "video".</p> <p>Now, any time I need to dynamically add a Video to my state I can use MovieClip.attachMovie() to add a new copy of the Video object.</...
<p>I recommend you create a single instance of the Video object, leave it invisible (i.e., <code>videoview.visible = false</code>), and load the clip when you need it, displaying it at the appropriate time. You can also use <code>swapDepth()</code> if it becomes necessary.</p> <p>Video handling in AS2 is not the best ...
7,603
<p>I am having trouble with IE7. I have a header, which is an IMG. Under it I have a div that represents a menu, they have to be attached to each other without space in between. Both are 1000px width. In Opera and FireFox the header and the menu are neatly attached to each other. However, in IE7, there is a small space...
<p>Try the IE Developer Toolbar, which will let you inspect what is going on with the elements and give you outlines of the areas covered. It might give you a better understanding of the problem.</p>
<p>The solution: </p> <pre><code>img { padding: 0px; margin: 0px; display: block; } </code></pre> <p>display: block</p>
3,478
<p>I was going to ask a question here about whether or not my design for some users/roles database tables was acceptable, but after some research I came across this question:</p> <p><a href="/questions/1451/what-is-the-best-way-to-handle-multiple-permission-types">What is the best way to handle multiple permission typ...
<p>You use bitwise operations. The pseudo-code would be something like:</p> <pre><code>bool HasPermission(User user, Permission permission) { return (user.Permission &amp; permission) != 0; } void SetPermission(User user, Permission permission) { user.Permission |= permission; } void ClearPermission(User us...
<p>Actually, this is how we determine authority within a fairly large web application that I'm the DBA for. </p> <p>If you are going to do something like this, you'll really benefit from having a <a href="http://snippets.dzone.com/posts/show/1184" rel="nofollow noreferrer">numbers table</a>. It will make your calcula...
8,503
<p>When I try to do any svn command and supply the <code>--username</code> and/or <code>--password</code> options, it prompts me for my password anyways, and always will attempt to use my current user instead of the one specified by <code>--username</code>. Neither <code>--no-auth-cache</code> nor <code>--non-interacti...
<p>Do you actually have the single quotes in your command? I don't think they are necessary. Plus, I think you also need <code>--no-auth-cache</code> and <code>--non-interactive</code></p> <p>Here is what I use (no single quotes)</p> <pre> --non-interactive --no-auth-cache --username XXXX --password YYYY </pre> <p>S...
<p>Best I can give you is a "works for me" on SVN 1.5. You may try adding <code>--no-auth-cache</code> to your <code>svn update</code> to see if that lets you override more easily.</p> <p>If you want to permanently switch from user2 to user1, head into ~/.subversion/auth/ on *nix and delete the auth cache file for do...
5,501
<p>We have a program that produces several SWF files, some CSS and XML files, all of which need to be deployed for the thing to work.</p> <p>Is there a program or technique out there for wrapping all these files together into a single SWF file?</p>
<p>If you use the Flex compiler (<code>mxmlc</code> or FlexBuilder) you can embed SWF files and create them at runtime, more or less like you would create any display object:</p> <pre><code>package { public class Assets { [Embed(source="another.swf")] public var another : Class; } } </code></pre> <p>...
<p>I think you can just drag them into the library of your main swf and make references to them. At least the other SWFs you can, not sure about the CSS and XML.</p>
9,391
<p>Store everything in GMT?</p> <p>Store everything the way it was entered with an embedded offset?</p> <p>Do the math everytime you render?</p> <p>Display relative Times "1 minutes ago"?</p>
<p>You have to store in UTC - if you don't, your historic reporting and behaviour during things like Daylight Savings goes... funny. GMT is a local time, subject to Daylight Savings relative to UTC (which is not).</p> <p>Presentation to users in different time-zones can be a real bastard if you're storing local time....
<p>I like storing in GMT and showing only relative ("about 10 seconds ago", "5 months ago"). Users don't need to see actual timestamps for most use cases.</p> <p>There are certainly exceptions, and an individual application might have many of them, so it can't be a 'one-true-way' answer. Things that need strong audi...
3,309
<p>In <a href="http://channel9.msdn.com/posts/Dan/Countdown-to-PDC2008-By-Developers-for-Developers-Don-Box-and-Chris-Anderson/" rel="nofollow noreferrer">today's channel9.msdn.com video</a>, the PDC guys posted a challenge to decipher this code:</p> <pre><code>2973853263233233753482843823642933243283 6434928432937228...
<p>Well, based on the 332 pattern you pointed out and the fact that the number of numbers is divisible by 3, and that several of the first 3 digit groups have matches... it might be that each 3 digits represent a character. Get a distribution of the number matches for all the 3 digit groups, then see if that distribut...
<p>I wrote some C# code to scan the cipher and give me some stats back. Here are some interesting results:</p> <p>With a chunk size of 3, </p> <ul> <li><p>There are 236 chunks.</p></li> <li><p>There are 172 duplicates.</p></li> <li><p>The 323 code shows up a whopping total of 29 times!</p></li> <li><p>The 333 code sh...
5,695
<p>I have a ContextMenu that is displayed after a user right clicks on a ComboBox. When the user selects an item in the context menu, a form is brought up using the <code>ShowDialog()</code> method. </p> <pre><code>If frmOptions.ShowDialog() = Windows.Forms.DialogResult.Cancel Then LoadComboBoxes() End If </code>...
<p>One way to handle this would be to use the context menu's Popup event to grab the selected index of the combobox launching the menu. When the dialog form closes reset the selected index.</p>
<p>I figured it out.</p> <p>I created a method that passed the <strong>ContextMenu.SourceControl()</strong> property by reference so I could manipulate the control that called the ContextMenu. In the beginning of the method, I got the <strong>SelectedValue</strong> of the ComboBox and the reloaded the data in the Com...
7,336
<p>I would like to log each line of G-code to the serial port as it is processed.</p> <p><strong>Steps to achieve</strong>:</p> <ul> <li>the printer reads a file from the SD card</li> <li>each line it reads will be serial logged (this I can't figure out)</li> <li>those lines can then read via the serial monitor on a la...
<p>If you have the hardware at hand, you can use OctoPrint to collect the data you require. It's common for users to create an OctoPrint server on a Raspberry Pi, but it can be installed easily on a Windows or Linux machine as well. Once in place, logging is available for various types of information.</p> <p>From the <...
<p>If you have the hardware at hand, you can use OctoPrint to collect the data you require. It's common for users to create an OctoPrint server on a Raspberry Pi, but it can be installed easily on a Windows or Linux machine as well. Once in place, logging is available for various types of information.</p> <p>From the <...
1,798
<p>I'm trying to locate an open source business rules engine that has a decent interface for building the rules.</p> <p>OR at least one that works well on the .Net platform and has been updated sometime in the past 12 months. </p> <p>Thanks,</p>
<p>NxBRE is one option. </p> <p><a href="http://sourceforge.net/projects/nxbre/#item3rd-5" rel="noreferrer">http://sourceforge.net/projects/nxbre/#item3rd-5</a></p>
<p>I'm going to throw one more piece of software I ran across: <a href="http://ncalc.codeplex.com/" rel="nofollow">ncalc</a>.</p> <p>It's not exactly a "rules" engine; but it does do dynamic calculations where you can give it the expression to evaluate and all of the variables necessary. This was pretty much exactly...
4,187
<p>A while ago I read the <a href="http://www.martinfowler.com/articles/mocksArentStubs.html" rel="nofollow noreferrer">Mocks Aren't Stubs</a> article by Martin Fowler and I must admit I'm a bit scared of external dependencies with regards to added complexity so I would like to ask:</p> <p>What is the best method to u...
<p>As the mantra goes 'Go with the simplest thing that can possibly work.'</p> <ol> <li>If fake classes can get the job done, go with them. </li> <li>If you need an interface with multiple methods to be mocked, go with a mock framework.</li> </ol> <p>Avoid using mocks <em>always</em> because they make tests brittle. ...
<p>Read Luke Kanies' discussion of exactly this question in <a href="http://www.madstop.com/ruby/jay_and_i_converge_on_testing.html" rel="nofollow noreferrer">this blog post</a>. He references <a href="http://blog.jayfields.com/2008/05/using-stubs-to-capture-test-essence.html" rel="nofollow noreferrer">a post from Jay ...
7,000
<p>Lasty, I tried to implements an hybrid structure in Java, something that looks like:</p> <pre><code>public class MapOfSet&lt;K, V extends HasKey&lt;K&gt;&gt; implements Set&lt;V&gt;, Map&lt;K, Set&lt;V&gt;&gt; </code></pre> <p>Where HasKey is the following interface:</p> <pre><code>public interface HasKey&lt;K&gt...
<p>What are you trying to accomplish? <code>Map</code> already exposes its keys as a <code>Set</code> via its [keySet()](<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html#keySet())" rel="nofollow noreferrer">http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html#keySet())</a> method. If you want a...
<p>I would say that something that is meant to be sometimes used as a Map and sometimes as a Set should implement Map, since that can be viewed as a set of keys or values as well as a mapping between keys and values. That is what the Map.containsKey() and Map.containsValue() methods are for.</p>
9,617
<p>This is a sql 2000 database that I am working with.</p> <p>I have what I call a staging table that is a raw data dump of data, so everything is ntext or nvarchar(255). </p> <p>I need to cast/convert all of this data into the appropriate data types (ie int, decimal, nvarchar, etc.)</p> <p>The way I was going to do...
<p>Generally I don't like "loop through the record" solutions as they tend to be slow and you end up writing a lot of custom code.</p> <p>So...</p> <p>Depending on how many records are in your staging table, you could post process the data with a series of SQL statements that test the columns for correctness and mark...
<p>It looks like you are doomed. See <a href="http://www.sommarskog.se/error-handling-I.html#whathappens" rel="nofollow noreferrer">this</a> document.</p> <p>TL/DR: A data conversion error always causes the whole batch to be aborted - your sql script will not continue to execute no matter what you do. Transactions won...
5,374
<p>I have 12 parts for a model I want to print but I would like to know if I can put all of them in a single G-code file and print that on its own. Would this affect the model in any way?</p> <p>I’m using PLA on my Ender 3 Pro</p>
<blockquote> <p>I have 12 parts for a model I want to print but I would like to know if I can put all of them in a single G-code file and print that on its own.</p> </blockquote> <p>You certainly can. The printer doesn't care how many parts there are. Many single parts, like those with holes, will have layers that have...
<p>This answer assumes FDM printing -- for resin printers, as I understand it, as long as there's flow space between parts, if they fit on the build plate, they'll print.</p> <p>For FDM, generally, you'll get better print quality printing a single part, because layers don't cool while you print the same layer for each ...
2,188
<p>In a ColdFusion Component (CFC), is it necessary to use fully qualified names for variables-scoped variables?</p> <p>Am I going to get myself into trouble if I change this:</p> <pre><code>&lt;cfcomponent&gt; &lt;cfset variables.foo = "a private instance variable"&gt; &lt;cffunction name = "doSomething"&gt...
<p>It won't matter to specify "variables" when you create the variable, because foo will be placed in the variables scope by default; but it will matter when you access the variable.</p> <pre><code>&lt;cfcomponent&gt; &lt;cfset foo = "a private instance variable"&gt; &lt;cffunction name="doSomething"&gt; ...
<p>After reading your answers here's what I'm thinking:</p> <p><strong>Yes, it's safe. In general, it's not necessary or useful to explicitly specify the variables scope. It just adds clutter to an already verbose language.</strong></p> <p>Granted, there is one minor exception, as <a href="https://stackoverflow.com/u...
8,394
<p>Maybe this is a dumb question, but is there any way to convert a boolean value to a string such that 1 turns to "true" and 0 turns to "false"? I could just use an if statement, but it would be nice to know if there is a way to do that with the language or standard libraries. Plus, I'm a pedant. :)</p>
<p>How about using the C++ language itself?</p> <pre><code>bool t = true; bool f = false; std::cout &lt;&lt; std::noboolalpha &lt;&lt; t &lt;&lt; " == " &lt;&lt; std::boolalpha &lt;&lt; t &lt;&lt; std::endl; std::cout &lt;&lt; std::noboolalpha &lt;&lt; f &lt;&lt; " == " &lt;&lt; std::boolalpha &lt;&lt; f &lt;&...
<p>I agree that a macro might be the best fit. I just whipped up a test case (believe me I'm no good with C/C++ but this sounded fun):</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdarg.h&gt; #define BOOL_STR(b) (b?"true":"false") int main (int argc, char const *argv[]) { bool alpha = true; printf(...
4,903
<p>I found the ad on this site to Krypton controls (<a href="https://github.com/ComponentFactory/Krypton" rel="nofollow noreferrer">and here's another one!</a>) and was wondering if any of you using vs.net 05 or 08 are using them and how that's working out. If you're answering, please specify which parts you're using (...
<p>I have been using the <strong>Krypton Controls ToolKit for over 3 years</strong> with <strong>Visual Studio 2005 and 2008</strong> in <strong>.NET 2.0, 3.0, 3.5, and 3.5 SP1</strong>. I have <strong>only used the free ToolKit</strong> and not the Ribbon or Tab controls. I have used it <strong>only in C</strong>#.<...
<p>I'm using it. It's quite okay.</p>
9,183
<p>I'm facing weird "pillars" of underextrusion on outer walls of my XYZ test cube.</p> <p>On the pictures below I`ve printed PLA test cubes with a 0.4&nbsp;mm nozzle, 0.2&nbsp;mm height and 210/50&nbsp;&deg;C hotends/bed temperature.</p> <p>Gaps are appearing in walls parallel to both X and Y sides. The pictured sid...
<p>Localized underextrusion usually means you're oozing material somewhere it wasn't supposed to go. Since you have Marlin 2.0, linear advance might help solve that, and in general right retraction amount is important and turning off combing may be needed (combing over infill allows material to ooze).</p> <p>Also ther...
<p>Well, I could not track the problem and it lasted till two major updates:</p> <ol> <li>I have changed rods for ones with proper lenght</li> <li>I have reset all Cura settings to default</li> </ol>
1,591
<p>When designing a REST API or service are there any established best practices for dealing with security (Authentication, Authorization, Identity Management) ?</p> <p>When building a SOAP API you have WS-Security as a guide and much literature exists on the topic. I have found less information about securing REST en...
<p>As tweakt said, Amazon S3 is a good model to work with. Their request signatures do have some features (such as incorporating a timestamp) that help guard against both accidental and malicious request replaying.</p> <p>The nice thing about HTTP Basic is that virtually all HTTP libraries support it. You will, of cou...
<p>REST itself offers no security standards, but things like OAuth and SAML are rapidly becoming the standards in this space. However, authentication and authorization are only a small part of what you need to consider. Many of the known vulnerabilities relating to web applications apply very much to REST apis. You ...
2,910
<p>Is there an easy way to iterate over an associative array of this structure in PHP:</p> <p>The array <code>$searches</code> has a numbered index, with between 4 and 5 associative parts. So I not only need to iterate over <code>$searches[0]</code> through <code>$searches[n]</code>, but also <code>$searches[0]["part0...
<p>Nest two <a href="http://php.net/foreach" rel="noreferrer"><code>foreach</code> loops</a>:</p> <pre><code>foreach ($array as $i =&gt; $values) { print "$i {\n"; foreach ($values as $key =&gt; $value) { print " $key =&gt; $value\n"; } print "}\n"; } </code></pre>
<p>Can you just loop over all of the "part[n]" items and use isset to see if they actually exist or not?</p>
4,559
<p>Why does the default IntelliJ default class javadoc comment use non-standard syntax? Instead of creating a line with "User: jstauffer" it could create a line with "@author jstauffer". The other lines that it creates (Date and Time) probably don't have javadoc syntax to use but why not use the javadoc syntax when ava...
<p>I'm not sure why Idea doesn't use the <code>@author</code> tag by default. </p> <p>But you can change this behavior by going to <code>File -&gt; Settings -&gt; File Templates</code> and editing the <code>File Header</code> entry in the <code>Includes</code> tab.</p> <p>As of IDEA 14 it's: <code>File -&gt; Settings...
<p>It is likely that the header snippet you show is older than javadoc and was just borrowed from some coding standard document, probably written for C++.</p>
8,912