instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>We have an SVN repository running on a Windows server, and I want to link internal documentation, feature changes, bugs and so on to code changes.</p>
<p>We've found WebSVN to be amazingly slow - the repository is too large for it (I think).</p>
<p>The team using it is primarily coding in C#, and while some have e... | <p>Have a look at <a href="http://warehouseapp.com" rel="nofollow noreferrer">http://warehouseapp.com</a></p>
<p>It's Mongrel/Ruby/MySQL stack (should work on Windows though)</p>
<blockquote>
<p>but I'm looking to avoid installing
MySQL and Ruby on the server.</p>
</blockquote>
<p>I know (also using C# stack mys... | <p>Not web-based but if your team is using TortoiseSVN there's a great repository browser there. Just right click on your local checkout and select TortoiseSVN / Repo-Browser.</p>
| 3,214 |
<p>I want to bring up a file dialog in Java that defaults to the application installation directory.</p>
<p>What's the best way to get that information programmatically?</p>
| <pre><code>System.getProperty("user.dir")
</code></pre>
<p>gets the directory the Java VM was started from.</p>
| <pre><code>System.getProperty("user.dir");
</code></pre>
<p>The above method gets the user's working directory when the application was launched. This is fine if the application is launched by a script or shortcut that ensures that this is the case.</p>
<p>However, if the app is launched from somewhere else (entirely... | 4,807 |
<p><a href="https://www.youtube.com/watch?v=WIkT8asT90A" rel="nofollow noreferrer">This video</a> brought to my attention the 8 mm lead of the Ender 3's Z axis screw, which seems like an exceedingly bad choice from a standpoint of accuracy with respect to common grid alignments in the Z direction. In particular, with t... | <p>I've not seen trapezoid lead screws with 5 mm lead, you can get 5 mm lead ball screws though.</p>
<p>On one printer I use 4 mm lead screws to get native 0.02 mm resolution (so 5 full steps for 0.1 mm, 10 for 0.2 mm, etc.). I also geared down 8 mm lead screws with a 2:1 ratio (e.g.... | <p>You are delving into the darker recesses of 3D printing here!</p>
<p>ACME threads, anti-backlash nuts, ball-screws, etc. will ALL follow...</p>
<p>The simple answer is that the Z-axis screw on all the cheaper 3D printers are pure crap! They use 8mm With triangular threads because it they are cheap and most softwar... | 1,363 |
<p>I have read that the iPhone SDK (part of Xcode 3) is restricted to Mac's with the intel chipset. Does this restriction apply to only the simulator part of the SDK or the complete shebang?</p>
<p>I have a Powerbook G4 running Leopard and would very much like to do dev on it rather than fork out for a new machine.</p... | <p>As things have moved on since the original post on 3by9.com, here are the steps that I had to follow to get the environment working on my PowerBook G4.</p>
<p><strong>BTW, I would like to say that I realise that this is not a supported environment and I share this for purely pedagogic rea</strong>sons.</p>
<ol>
<l... | <blockquote>
<p>I have a Powerbook G4 running Leopard and would very much like to do dev on it </p>
</blockquote>
<p>Not sure what sort of application you are developing, but if you jailbreak your iPhone, you can:</p>
<ul>
<li>develop applications using Ruby/Python/Java which won't require compiling at all</li>
<li... | 5,866 |
<p>For those of us who use standard shared hosting packages, such as GoDaddy or Network Solutions, how do you handle datetime conversions when your hosting server (PHP) and MySQL server are in different time zones?</p>
<p>Also, does anybody have some best practice advice for determining what time zone a visitor to you... | <p>As of PHP 5.1.0 you can use <a href="http://www.php.net/manual/en/function.date-default-timezone-set.php" rel="noreferrer"><em>date_default_timezone_set()</em></a> function to set the default timezone used by all date/time functions in a script. </p>
<p>For MySql (quoted from <a href="http://dev.mysql.com/doc/refma... | <p>I save all my dates as a bigint due to having had issues with the dateTime type before. I save the result of the time() PHP function into it, now they count as being in the same timezone :)</p>
| 3,903 |
<p>I want to create a Java application bundle for Mac without using Mac.</p>
<p>According to <a href="http://developer.apple.com/documentation/Java/Conceptual/Java14Development/03-JavaDeployment/JavaDeployment.html#//apple_ref/doc/uid/TP40001885-208447-TPXREF120" rel="noreferrer">Java Deployment Options for Mac OS X</... | <p>A Java application bundle on OS X is nothing more than a directory containing your .jars and a number of configuration files. The SetFile tool sets a custom HFS filesystem property on the directory to tell finder that it is an app, but giving it a ".app" extension serves the same purpose. I don't think there's any... | <p>One way is to generate a zip file with the App using for example Ant. In ant you can specify that the file in Contents/MacOS should have execute-permissions using something like filemode="755".</p>
| 6,026 |
<p>What are the other types of database systems out there. I've recently came across couchDB that handles data in a non relational way. It got me thinking about what other models are other people is using.</p>
<p>So, I want to know what other types of data model is out there. (I'm not looking for any specifics, just w... | <p><a href="http://www.db4o.com" rel="nofollow noreferrer">db4o</a></p>
<p>Quote from the "about" page:</p>
<blockquote>
<p>db4o is the open source object database that enables Java and .NET developers to store and retrieve any application object with only one line of code, eliminating the need to predefine or main... | <h1>4. Navigational. Includes Tree/Hierarchy and Graph/Network.</h1>
<p>File systems, the semantic web, XML, Object databases, CODASYL, and many others all fit into this category.</p>
<p>Those 4 are pretty much it.</p>
| 7,389 |
<p>I would like to use something like CLR Profiles on .Net 2.0 to see what objects are taking more space in the heap at any given time (of an ASP.Net worker process).</p>
<p>However, the CLR Profiler only lets me START an app, not attach to an existing one. I assume this is because it tracks allocations and GC too, bu... | <p><a href="http://memprofiler.com/" rel="nofollow noreferrer">.Net Memory Profiler</a> is exactly what you need. It's not free but there's a trial version. Actually I used the trial to find leaks on our last project. One notable feature is:</p>
<blockquote>
<p>Easily identify memory leaks by
collecting and compar... | <p><a href="http://memprofiler.com/" rel="nofollow noreferrer">.Net Memory Profiler</a> is exactly what you need. It's not free but there's a trial version. Actually I used the trial to find leaks on our last project. One notable feature is:</p>
<blockquote>
<p>Easily identify memory leaks by
collecting and compar... | 5,379 |
<p>We have a few projects that involve building an application that is composed of maybe 50% custom functionality, but then pulls in, say, a wiki, a forum, and other components that are "wheels" that have already been invented that we do not wish to re-write from scratch.</p>
<p>These third-party applications usually ... | <p>Make sure that the interface between your application and the third-party application or library is such that you can replace it easily with something else just in case. In some cases the third-party software may just be an implementation of an standard API (Java does this a lot with JDBC, JMS, JNDI, ...). In othe... | <p>Donald Knuth said that even better then reusable code is modifiable code, so if there is no API, you should seek for an open source app that is written well and therefore possible to customize. </p>
<p>As for databases and login systems and other programming parts (i don't see how e.g. theming could benefit), you c... | 7,074 |
<p>as it is currently, there are several <a href="https://3dprinting.stackexchange.com/questions/tagged/diy-3d-printer" class="post-tag" title="show questions tagged 'diy-3d-printer'" rel="tag">diy-3d-printer</a> questions that gave info about a specific printer. While I tried to add the appropriate names for t... | <p>To me, the dividing line between "DIY" and "not DIY" is who you deal with if a part is defective when you get it.</p>
<p>If you're contacting different vendors for a jammed bearing, a miswired stepper motor, or a dead controller board, it's DIY. If you talk to the same person regardless of which part is defective ... | <p>It got too long to fit in a comment:</p>
<p>That does seem sort of reasonable. A DIY printer should be one that has been sourced from various parts. Or should that also include (or be exclusively) DIY designs? I mean, DIY means Do It Yourself, so a commercial kit, is literally a DIY printer, even though it is follo... | 50 |
<p>Comparing trends show that 3D printing stepped over to another level around 2012~2013. Why?</p>
<p><a href="https://i.stack.imgur.com/9tFj9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9tFj9.png" alt="3D printing vs 3D scanning" /></a></p>
<p><a href="https://i.stack.imgur.com/N488f.png" rel="n... | <p>A great story on the history of 3D printing is published by <a href="https://www.3dsourced.com/guides/history-of-3d-printing/" rel="noreferrer">3DSOURCED</a>. It shows that the patents for FDM and SLA expired a few years earlier and the <a href="https://reprap.org/wiki/RepRap" rel="noreferrer">RepRap</a> 3D printer ... | <p>Another opinion received:</p>
<blockquote>
<p>That’s the result of MakerBot and others promoting the tech to the general public for the first time after the patents expired. They were just running up stock prices to make a lot of money</p>
</blockquote>
| 1,884 |
<p>Hey everyone, I'm using Virtual PC and working with a virtual hard disk (*.vhd) that is only sized at 8.2 GB. I would like to double the size to something like 16-20GB. I see options for compacting the VHD but nothing to expand it. It's set to "dynamically expand" but I'm installing some software and it doesn't seem... | <p><a href="http://vmtoolkit.com/files/folders/converters/entry87.aspx" rel="nofollow noreferrer">VHD Resizer</a></p>
| <p>Never worked with Virtual PC but from other virtualization software I know I guess that dynamically expand means that initially the .vhd file will take less space in the HD than the specified and will dynamically grow as you keep installing programs or adding files into the virtual drive UP TO the specified size.</p... | 4,859 |
<p>Anyone using WPF for real LOB applications?</p>
<p>We have all seen the clever demos of WPF showing videos mapped onto 3D elements. These look great but what about the real world of line-of-business applications that make up the majority of developers efforts. Is WPF just for nice eye candy?</p>
| <p>While we discussing it, smart guys are building amazing apps:</p>
<p><a href="http://channel9.msdn.com/shows/Continuum/LawsonSmartOffice/" rel="nofollow noreferrer">Lawson Smart Office brings WPF goodness to the enterprise</a></p>
<p><a href="http://windowsclient.net/learn/video.aspx?v=48556" rel="nofollow norefer... | <p>I feel the eye candy demos are targeted mostly towards designers. Having said that, there is a huge potential in improving usability of LOB apps using WPF. <a href="http://www.ddj.com/windows/210300284" rel="nofollow noreferrer">Check this article about the potential of Silverlight</a>.</p>
<p><em>Line-of-business ... | 8,716 |
<p>I know this is pretty exotic, but I want to deploy a Ruby web application (not Rails, but Rack based, so it plugs into most Ruby servers just fine) using JRuby. Google and friends give me a few success stories, but mostly rails related and if not, no details on the deployment are provided. The framework I'm using is... | <p>In my opinion, running a Rack based application with a rackup script is the real Ruby way. And I wanted to apply the same for JRuby too. That is why I've written jetty-rackup <a href="http://github.com/geekq/jetty-rackup" rel="nofollow noreferrer">http://github.com/geekq/jetty-rackup</a></p>
<p>We are using it for ... | <p>This is the "just works" gem for me: <a href="https://github.com/matadon/mizuno" rel="nofollow">https://github.com/matadon/mizuno</a></p>
| 3,768 |
<p>If I have the following:</p>
<pre><code>Public Class Product
Public Id As Integer
Public Name As String
Public AvailableColours As List(Of Colour)
Public AvailableSizes As List(Of Size)
End Class
</code></pre>
<p>and I want to get a list of products from the database and display them on a page alon... | <p>You're probably best off benchmarking both and finding out. I've seen situations where just doing multiple queries (MySQL likes this) is faster than JOINs and one big slow query that takes a lot memory and causes the DB server to thrash. I say benchmark because it's going to depend on your database server, how much ... | <p>Personally, I'd get more data from the database through fewer methods and then bind the UI against only those parts of the data set that I currently want to display. Managing lots of small methods that get out specific chunks of data is harder than getting out large chunks and using only those parts you need.</p>
| 9,708 |
<p>In my <a href="https://stackoverflow.com/questions/39371/database-exception-handling-best-practices">previous question</a>, most commenters agreed that having validation logic both at client & server sides is a good thing.</p>
<p>However there is a problem - you need to keep your validation rules in sync between... | <p>As mentioned in one of the answers to the other post, if you are going to keep your layers separated, there is no good way to avoid duplicating the validation logic in each layer. If you use something to automatically tie them together, you have introduced a sort of coupling between the layers that might hinder you... | <p>If you're using ASP.Net there are a number of validation controls you can use. These controls are written in a very generic way, such that most of them automatically duplicate your validation logic between the client and server, even though you only set options for the control in one place. </p>
<p>You are also f... | 6,072 |
<p>What is the best way to determine duplicate records in a SQL Server table?</p>
<p>For instance, I want to find the last duplicate email received in a table (table has primary key, receiveddate and email fields).</p>
<p>Sample data:</p>
<pre><code>1 01/01/2008 stuff@stuff.com
2 02/01/2008 stuff@stuff.com
3 01/1... | <p>something like this</p>
<pre><code>select email ,max(receiveddate) as MaxDate
from YourTable
group by email
having count(email) > 1
</code></pre>
| <p>Couldn't you join the list on the e-mail field and then see what nulls you get in your result?</p>
<p>Or better yet, count the instances of each e-mail address? And only return the ones with count > 1</p>
<p>Or even take the email and id fields. And return the entries where the e-mail is the same, and the IDs are ... | 6,900 |
<p>First off, I understand the reasons why an interface or abstract class (in the .NET/C# terminology) cannot have abstract static methods. My question is then more focused on the best design solution.</p>
<p>What I want is a set of "helper" classes that all have their own static methods such that if I get objects A,... | <p>Looking at <a href="https://stackoverflow.com/questions/14614/static-methods-in-an-interfaceabstract-class#14655">your response</a> I am thinking along the following lines:</p>
<ul>
<li>You could just have a static method that takes a type parameter and performs the expected logic based on the type.</li>
<li>You co... | <p>How do I post feedback on Stack Overflow? Edit my original post or post an "answer"? Anyway, I thought it might help to give an example of what is going on in AHelper.RetrieveByID() and BHelper.RetreiveByID()</p>
<p>Basically, both of these methods are going up against a third party webservice that returns variou... | 3,541 |
<p>I need to create a historical timeline starting from 1600's to the present day. I also need to have some way of showing events on the timeline so that they do not appear cluttered when many events are close together.</p>
<p>I have tried using Visio 2007 as well as Excel 2007 Radar Charts, but I could not get the re... | <p>SIMILIE Timeline would probably suit your needs.
<a href="http://simile.mit.edu/timeline/" rel="noreferrer">http://simile.mit.edu/timeline/</a></p>
<p>Timeline .NET: <a href="http://www.codeplex.com/timelinenet" rel="noreferrer">http://www.codeplex.com/timelinenet</a></p>
<p>Oh, i guess i should ask... for persona... | <p>@Pascal this page? <a href="http://tools.mscorlib.com/timeline/Default.aspx" rel="nofollow noreferrer">http://tools.mscorlib.com/timeline/Default.aspx</a>. If it's looking like ascii maybe look for a js error, but that renders on my system fine. If all else fails, it's a decent js library by the MIT team as it is, s... | 3,333 |
<p>When I am working with ASP.NET, I find that there are always unexpected things I run into that take forever to debug. I figure that having a consolidated list of these would be great for those "weird error" circumstances, plus to expand our knowledge of oddness in the platform.</p>
<p>So: answer with one of your "G... | <p>Don't dynamically add controls after the page init event as it will screw up the viewstate tree.</p>
| <p>(VB.NET) If you send an Object via a Property's Get accessor into a function with a ByRef keyword, it will actually attempt to update the object using the Set accessor for the Property.</p>
<p>Ex:</p>
<p><code>UpdateName(ByRef aName as String)</code></p>
<p><code>UpdateName(Employee.Name)</code> will attempt to u... | 9,178 |
<p>One of the things I'd like to do in my browser-based application is allow the user to select some text (not in a <textarea>, just plain ol' text!), and have my application pop up a small toolbar that then can interact with the next (in my case, add annotations).</p>
<p>I've found a lot of stuff on google that... | <p>Have a look at <a href="http://jquery.com" rel="noreferrer">jQuery</a> and the <a href="http://plugins.jquery.com/project/wrapSelection" rel="noreferrer">wrapSelection plugin</a>. It may be what you are looking for.</p>
| <p>The behaviour of individual browsers with regard to selection is <a href="http://quirksmode.org/dom/w3c_range.html" rel="nofollow noreferrer">outlined here</a>.</p>
| 3,167 |
<p>Before the print has actually started I have set up Auto Bed Leveling using a BLTouch sensor, during the period that this runs I find that material leaks out of the nozzle and curls back onto itself and by the time it finishes it is substantial enough to cause problems when the nozzle is primed drawing the line to ... | <p>The oozing is due to hot-end getting hot before the bed leveling procedure: if you move the hot-end warm up command <strong>after</strong> the <code>G29</code> line you avoid that oozing</p>
<pre><code>; Ender 3 Custom Start G-code
M104 S{material_print_temperature_layer_0} ; Set Extruder temperature
M140 S{materia... | <p>The best solution would be to heat the bed, but not the nozzle at startup. If you level with a cold bed, your ABL mesh is going to be off, since the aluminum heated bed plate expands considerably once the heat is applied. </p>
<p>You could also issue a retract command before leveling, and then add a counteracting... | 1,141 |
<p>Brand new to Slic3r, I've been using Cura for a while, so not sure is happening. I tried to load <a href="https://www.shapeways.com/product/YDCPJF8KV/knight" rel="nofollow noreferrer">this Knight model</a> into Slic3er (v1.2.9 running on OS X), and it's reporting "Manifold: auto-repaired (11430 errors)", and the mo... | <p>Dimensional accuracy is not as important as dimensional uniformity. I can print with undersized (or oversized) filament, adjusting the flow appropriately, provided the filament has a consistent diameter. When creating filament in-house, without expensive equipment, it is difficult to maintain the same diameter throu... | <p>Put it simply: they say 1.75 mm with a ± error of 0.05 mm. Which means your flow may vary ±2.9 % while you are printing creating blobs and such. </p>
<p>The smaller the filament tolerance, the more expensive the production costs.</p>
| 501 |
<p>This should be simple. I'm trying to import data from Access into SQL Server. I don't have direct access to the SQL Server database - it's on GoDaddy and they only allow web access. So I can't use the Management Studio tools, or other third-party Access upsizing programs that require remote access to the database.</... | <p>Try using the <a href="http://blog.godaddyhosting.com/2007/07/20/presentingdrum-roll-please-the-ms-sql-backuprestore-feature.aspx" rel="nofollow noreferrer">GoDaddy SQL backup/restore tool</a> to get a local copy of the database. At that point, use the <a href="http://www.microsoft.com/technet/prodtechnol/sql/2000/d... | <p>It's never advisable to loop through records when a SQL Update can be used.</p>
<p>It's not clear from your question what database interface layer you are using, but it is possible with the right interfaces to insert data from a source outside a database <em>if</em> the interface being used supports both types of d... | 9,158 |
<p>Given an absolute or relative path (in a Unix-like system), I would like to determine the full path of the target after resolving any intermediate symlinks. Bonus points for also resolving ~username notation at the same time.</p>
<p>If the target is a directory, it might be possible to chdir() into the directory an... | <pre><code>readlink -f "$path"
</code></pre>
<p><sup>Editor's note: The above works with <em>GNU</em> <code>readlink</code> and <em>FreeBSD/PC-BSD/OpenBSD</em> <code>readlink</code>, but <em>not</em> on OS X as of 10.11.<br>
<em>GNU</em> <code>readlink</code> offers additional, related options, such as <code>-m</code>... | <p>Here I present what I believe to be a cross-platform (Linux and macOS at least) solution to the answer that is working well for me currently.</p>
<pre><code>crosspath()
{
local ref="$1"
if [ -x "$(which realpath)" ]; then
path="$(realpath "$ref")"
else
path="$(readlink -f "$ref" 2> /d... | 2,925 |
<p>I am creating a 3D printed part which will act as an attachment between a plate (actually a strain gauge) with two M2.5 bolts and a 2kg load with a single M4 bolt. I wouldn't be happy with tapping a screw thread into the print itself so I want to try embedding the nuts into the print itself - so I'll pause the print... | <p>It could depend on how well your printer-filament type combination can bridge. If you can generate bridges wider than the washer diameter, then print not only the hex recess but a disc recess for the washer, then print over both.</p>
<p>However, my preference would be to redesign the part so that the washer&h... | <p>If your nut will be exposed, you can simply insert it into the printed cavity and then seat it in place by heating it with a soldering iron.</p>
| 572 |
<p>How do I make a user's browser blink/flash/highlight in the task bar using JavaScript? For example, if I make an AJAX request every 10 seconds to see if the user has any new messages on the server, I want the user to know it right away, even if he is using another application at the time.</p>
<p><em>Edit: These use... | <p>this won't make the taskbar button flash in changing colours, but the title will blink on and off until they move the mouse. This should work cross platform, and even if they just have it in a different tab.</p>
<pre><code>newExcitingAlerts = (function () {
var oldTitle = document.title;
var msg = "New!";
... | <blockquote>
<p><i>These users do want to be distracted when a new message arrives.</i></p>
</blockquote>
<p>It sounds like you're writing an app for an internal company project. </p>
<p>You might want to investigate writing a small windows app in .net which adds a notify icon and can then do fancy popups or balloo... | 5,782 |
<p>I am looking for a plastic which is transparent to radio waves. I want to place my transmitter in a cylinder. That cylinder would be placed in a big RC plane ( whose body is made up of cardboard). I want the plane to be both telemetry, and RC controlled. That cylinder should allow the signals, should be strong a... | <p>For the kind of application you are looking for, transparency to radio signal shouldn't really be an issue, so you are more or less free to choose whatever suits your taste better.</p>
<p>Looking at the 3d printed drone community, the 3 most common materials I see being used there are:</p>
<ul>
<li>impact-resisten... | <p>To second @mac, </p>
<p>For drone usage, ABS will be your pal*. Both tough-PLA and PETG are relatively heavy, which is a disadvantage for flying saucers. Unless you power up and don't care!</p>
<ul>
<li>And I say this as someone who does not recommend ABS for general printing and I don't like printing ABS myself b... | 797 |
<p>I am writing my own slicer and wonder if there is a mathematical proof that proves that the intersection of the slicing plane with the STL file will only produce closed-loop polygons for every given slicing plane?</p>
<p>Thanks!</p>
| <p>You can't prove that because it isn't true. An STL file is just a collection of triangles. There is no guarantee that an intersection with the slicing plane will consist of closed-loop polygons. To be suitable for 3D printing an STL file should represent one or more closed, disjoint polyhedra (which would yield clos... | <p>I am also trying to write my own slicer and so I would just like to offer some additional information. </p>
<p>What you will find is that .stl files just store triangles and don't validate that the triangles assemble to create a printable model so a lot if not most .stl files are going to have data that isn't exact... | 767 |
<p>How does a virtual machine generate native machine code on the fly and execute it?</p>
<p>Assuming you can figure out what are the native machine op-codes you want to emit, how do you go about actually running it?</p>
<p>Is it something as hacky as mapping the mnemonic instructions to binary codes, stuffing it int... | <p>You can just make the <a href="http://en.wikipedia.org/wiki/Program_counter" rel="noreferrer">program counter</a> point to the code you want to execute. Remember that data can be data or code. On x86 the program counter is the EIP register. The IP part of EIP stands for instruction pointer. The JMP instruction is ca... | <p>As far as i know it compiles everything in memory because it has to run some heuristics to to optimize the code (i.e.: inlining over time) but you can have a look at the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8c09fd61-3f26-4555-ae17-3121b4f51d4d&displaylang=en" rel="nofollow norefer... | 6,728 |
<p>I'm trying to find the latitude and longitude of the corners of my map while in birdseye view. I want to be able to plot pins on the map, but I have hundreds of thousands of addresses that I want to be able to limit to the ones that need to show on the map.</p>
<p>In normal view, VEMap.GetMapView().TopLeftLatLong ... | <p>Here's the code for getting the Center Lat/Long point of the map. This method works in both Road/Aerial and Birdseye/Oblique map styles.</p>
<pre><code>function GetCenterLatLong()
{
//Check if in Birdseye or Oblique Map Style
if (map.GetMapStyle() == VEMapStyle.Birdseye || map.GetMap... | <p>According to <a href="http://dev.live.com/virtualearth/sdk/" rel="nofollow noreferrer">http://dev.live.com/virtualearth/sdk/</a> this should do the trick:</p>
<pre><code>function GetInfo()
{
alert('The latitude,longitude at the center of the map is: '+map.GetCenter());
}
</code></pre>
| 5,258 |
<p>This link describes an exploit into my app using fckEditor:
<a href="http://knitinr.blogspot.com/2008/07/script-exploit-via-fckeditor.html" rel="nofollow noreferrer">http://knitinr.blogspot.com/2008/07/script-exploit-via-fckeditor.html</a></p>
<p>How do I make my app secure while still using fckEditor? Is it an f... | <p>Sanitize html server-side, no other choice. For PHP it would be <a href="http://htmlpurifier.org" rel="nofollow noreferrer">HTML Purifier</a>, for .NET I don't know. It's tricky to sanitize HTML - it's not sufficient to strip script tags, you also have to watch out for on* event handlers and even more, thanks to stu... | <blockquote>
<p>I understand the DONTS. I'm lacking a DO.</p>
</blockquote>
<p>Is use of FCKEditor a requirement, or can you use a different editor/markup language? I advise using Markdown and WMD Editor, the same language used by StackOverflow. The Markdown library for .NET should have an option to escape all HTML ... | 9,144 |
<p>I have an xPC target application that talks to a device over RS-232. I am using the xPC serial block for this.<br>
To talk to this device I first have to start at a default speed, say, 9600 bps, request a change of speed to, say 57600 bps, then change the speed on my side to match it.<br>
The problem with the xPC bl... | <p>Here is my take so far. I don't think it can be done using existing Simulink blocks. I think I am going to have to take the xpcserial C code that comes with Matlab, take the code that sets the RS-232 speed, and wrap it in my own S-function.</p>
| <p>Ian,</p>
<p>What I've done before on this stuff is just modify the registers behind XPC target's back. It's ugly, but xPCTarget is ugly in the first place. </p>
<p>Try modify Line Control Register and set the divisors directly -- all you need is the serial port IO address, and you know that.</p>
<p>It's worth a... | 6,480 |
<p>I would like to monitor a log file that is being written to by an application. I want to process the file line by line as, or shortly after, it is written. I have not found a way of detecting that a file has been extended after reaching eof.</p>
<p>The code needs to work on Mac and PC, and can be in any language, t... | <p>In Perl, the <a href="http://search.cpan.org/dist/File-Tail/" rel="noreferrer">File::Tail</a> module does exactly what you need.</p>
| <p>I'd have thought outputting the actions via tee, and thence tail'ing (or using the loop <a href="https://stackoverflow.com/questions/62832#63446">above</a>) the file created by tee some use.</p>
| 8,833 |
<p>My coworker and I have encountered a nasty situation where we have to use an active X control to manipulate a web camera on a page. </p>
<p>Is it possible to assign a javascript event handler to a button in the active x control so that it would fire an action on the page when clicked, or do we have to create a butt... | <p><em>Please</em> just use an existing ActiveX control. Like Flash or Silverlight. Flash has built-in webcam support and is controllable via JavaScript. Silverlight doesn't have built-in camera support, but it's JavaScript integration is fantastic.</p>
<p>If you must write your own then fret not, it is trivial to get... | <p>Yes! You can throw events in C++/ActiveX land which makes the JavaScript code run an event handler function. I was even able to make an entire invisible ActiveX control (same color as page background) with no buttons or visual feedback that did all of its GUI work through JavaScript and CSS.</p>
<p>edit: Frank's ad... | 4,608 |
<p>This is related to <a href="https://stackoverflow.com/questions/43324/can-i-put-an-aspnet-session-id-in-a-hidden-form-field">another question I asked</a>. In summary, I have a special case of a URL where, when a form is POSTed to it, I can't rely on cookies for authentication or to maintain the user's session, but I... | <p>If you hash in a time-stamp along with the user name and password, you can close the window for replay attacks to within a couple of seconds. I don't know if this meets your needs, but it is at least a partial solution.</p>
| <p>If you only accept each key once (say, make the key a GUID, and then check when it comes back), that would prevent replays. Of course, if the attacker responds <em>first</em>, then you have a new problem...</p>
| 6,615 |
<p>I'm writing some data acquisition software and need a gui plotting library that is fast enough to do realtime updated graphs. I've been using Nplot which is pretty good for a free library, but I'm wondering if there are any better libraries (preferably free or cheap).</p>
| <p>There's a good post about this <a href="http://weblogs.asp.net/gbarnett/archive/2008/06/03/visualising-data.aspx" rel="nofollow noreferrer">here</a> and <a href="http://weblogs.asp.net/gbarnett/archive/2008/03/23/free-graphing-libraries-for-net-my-thoughts.aspx" rel="nofollow noreferrer">here</a>. I have also used N... | <p>You might want to take a look at <a href="http://teethgrinder.co.uk/open-flash-chart/" rel="nofollow noreferrer">Open Flash Chart</a>. It's an open source graphing tool built in flash and can be dynamically updated.</p>
<p>Check out the <a href="http://teethgrinder.co.uk/open-flash-chart/gallery-js-2.php" rel="nofo... | 2,760 |
<p>I'm using <a href="http://www.zend.com/en/products/studio/" rel="nofollow noreferrer">Zend Studio</a> to do remote debugging of my php scripts on a dev server. It works great for web code, but can I make it work with command line scripts?</p>
<p>I have several helper apps to make my application run. It would be rea... | <p>I was able to get <a href="http://thenazg.blogspot.com/2008/12/remote-cli-debugging-via-eclipse-pdt.html" rel="nofollow noreferrer">remote CLI debugging working in Eclipse</a>, using xdebug, though I've not tried it with the zend debugger. I would assume this should work the same with ZSfE, if that's the "Zend Stud... | <p>Haven't tried, but you can set the QUERY_STRING environment variable to the one that toggles the Zend debugger on.</p>
<p>Per <a href="http://greg.chiaraquartet.net/archives/16-Incredible-Zend-ZDE-debugging-trick-for-debugging-CLI-apps.html" rel="nofollow noreferrer">this article</a>.</p>
<pre><code>export QUERY_S... | 4,489 |
<p>I have observed some occasional delamination in horizontal layers of my resin prints — see two examples:</p>
<p><a href="https://i.stack.imgur.com/DxGPD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DxGPD.png" alt="downward" /></a>
<a href="https://i.stack.imgur.com/BZEoF.png" rel="nofollow nore... | <p>With the information provided my thought is that your layers are underexposed for their thickness. Each layer is just barely bonding to the layer above it. After being pulled on by layers below eventually one of the layers fails. This is especially likely to happen on a thin part of the print any may need more suppo... | <p><a href="https://3dprinting.stackexchange.com/a/14947/8884">Besides the options of underexposure or bad FEP film</a>, there's also the option of the print being in a bad orientation for printing. Often, the quality gets better if you tilt the model some degrees. You do have to clean up some places, but the stresses ... | 1,780 |
<p>What's the best way to extend the User model (bundled with Django's authentication app) with custom fields? I would also possibly like to use the email as the username (for authentication purposes).</p>
<p>I've already seen a <a href="http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inhe... | <p>The least painful and indeed Django-recommended way of doing this is through a <code>OneToOneField(User)</code> property.</p>
<blockquote>
<h2><a href="https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model" rel="noreferrer">Extending the existing User model</a></h2>
<p>…</p... | <p>Currently as of Django 2.2, the recommended way when starting a new project is to create a custom user model that inherits from AbstractUser, then point AUTH_USER_MODEL to the model.</p>
<p>Source: <a href="https://docs.djangoproject.com/en/2.2/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-proj... | 6,577 |
<p>Need to parse some basic XML (one root element, 3-4 subelements, 1-3 attributes each) from a ksh script (ideally stick to ksh, given the script already exists and it's just trying to read some extra configuration created in XML by another program).</p>
<p>I know I can use sed and do pattern matching, but it's not f... | <p>You might want to take a look at this <a href="http://www.linuxfromscratch.org/pipermail/alfs-discuss/2006-January/007537.html" rel="nofollow noreferrer">pure bash implementation</a>, if keeping it all in shell script is that important.</p>
<p>That said, other scripting languages such as Python and Perl are also hi... | <p>Can't do it entirely in ksh, but try python xml?</p>
<p>If you want lightweight, you might try libxml2 and a small C program.</p>
| 8,802 |
<p>I'm looking for shell scripts files installed on my system, but <strong>find</strong> doesn't work:</p>
<pre><code>$ find /usr -name *.sh
</code></pre>
<p>But I know there are a ton of scripts out there. For instance:</p>
<pre><code>$ ls /usr/local/lib/*.sh
/usr/local/lib/tclConfig.sh
/usr/local/lib/tkConfig.s... | <p>Try quoting the wildcard:</p>
<pre><code>$ find /usr -name \*.sh
</code></pre>
<p>or:</p>
<pre><code>$ find /usr -name '*.sh'
</code></pre>
<p>If you happen to have a file that matches <strong>*.sh</strong> in the current working directory, the wildcard will be expanded before find sees it. If you happen to hav... | <p>For finding files on your disks, lean to use "locate" instead that is instantaneous
(looks into a daily built index)
you example would be:</p>
<pre><code>locate '/usr*.sh'
</code></pre>
| 3,936 |
<p>Let’s say I'm developing a helpdesk application that will be used by multiple departments. Every URL in the application will include a key indicating the specific department. The key will always be the first parameter of every action in the system. For example</p>
<pre><code>http://helpdesk/HR/Members
http://helpde... | <p>I have a similar scenario in one of my projects, and I'd tend to use a ModelBinder rather than using a separate inheritance hierarchy. You can make a ModelBinder attribute to fetch the entity/entites from the RouteData:</p>
<pre><code>public class HelpdeskDepartmentBinder : CustomModelBinderAttribute, IModelBinder ... | <p><em>Disclaimer: I'm currently running MVC Preview 5, so some of this may be new.</em></p>
<p>The best-practices way: Just implement a static utility class that provides a method that does the model look-up, taking the RouteData from the action as a parameter. Then, call this method from all actions that require th... | 9,373 |
<p>We created a tool which converts a language called P2, a language similar to assembly which I think exists only in Japan, to C#. There are at least a hundred modules written in P2 and we want to verify if the conversion to C# is right? How can we test this?</p>
| <p>You don't test the converter, you test the final code. </p>
<p>If the code doesn't compile, clearly your converter is failing. If the code compiles and your functionality tests fail, then you can tweak the code so that it passes the test. If you are fairly successful you should see that you only need to fix the mod... | <p>Short of a formal mathematical proof (which I imagine would be difficult), the proof of the pudding is in the unit tests. You have to find a way to wrap the converted C# snippets, compile the and run them under a similar environment, then compare the output against the original. Unless you're rigorous in your testin... | 3,808 |
<p>I am looking at printing a fair amount of text, ideally using some custom fonts. I quite like <a href="https://pixelify.net/download/free-fonts/script-handwritten/stay-classy-font-free/" rel="nofollow noreferrer">Stay Classy</a> but will likely have to consider change if it causes issues.</p>
<p>I am a little stuck ... | <p>I think @Trish answered your question more specifically, but an alternate route (that I think its simpler assuming you don't mind the learning curve) is using Blender.</p>
<p>Rather than creating an svg in a different software and having to go from something like photoshop to inkscape to tinkercad to your printer so... | <p>Fonts are not saved in a format that is .svg compatible. However, text that is written in a font and saved as a black-and-white picture can be turned into a .svg by software. This .svg can be imported by Tinkercad then.</p>
<h1>Step 1: Text Picture</h1>
<p>Use any software to create a .png or .jpg or something simil... | 1,842 |
<p>I need to produce a calculation trace file containing tabular data showing intermediate results. I am currently using a combination of the standard ascii pipe symbols (|) and dashes (-) to draw the table lines:</p>
<p>E.g. </p>
<pre><code>Numerator | Denominator | Result
----------|-------------|-------
6 ... | <p>There are <a href="http://www.unicode.org/charts/symbols.html" rel="nofollow noreferrer">Unicode box drawing characters</a> (look for Box Drawing under Geometrical Symbols - the <a href="http://www.unicode.org/charts/PDF/U2500.pdf" rel="nofollow noreferrer">chart itself</a> is a PDF). I don't have any idea how widel... | <p>You should look at this <a href="https://marklodato.github.io/js-boxdrawing/" rel="nofollow noreferrer"><strong>Javascript Box Drawing Demo</strong></a>. This is a JavaScript Unicode box drawing tool whose purpose is to make it easy for users to draw <strong>Unicode box art in HTML textareas</strong>. There you will... | 5,635 |
<p>For example, if passed the following:</p>
<pre><code>a = []
</code></pre>
<p>How do I check to see if <code>a</code> is empty?</p>
| <pre><code>if not a:
print("List is empty")
</code></pre>
<p>Using the <a href="https://docs.python.org/library/stdtypes.html#truth-value-testing" rel="noreferrer">implicit booleanness</a> of the empty <code>list</code> is quite Pythonic.</p>
| <p>Simply use is_empty() or make function like:- </p>
<pre><code>def is_empty(any_structure):
if any_structure:
print('Structure is not empty.')
return True
else:
print('Structure is empty.')
return False
</code></pre>
<p>It can be used for any data_structure like a list,tupl... | 7,701 |
<p>In SQL Server 2005, we can create temp tables one of two ways:</p>
<pre><code>declare @tmp table (Col1 int, Col2 int);
</code></pre>
<p>or</p>
<pre><code>create table #tmp (Col1 int, Col2 int);
</code></pre>
<p>What are the differences between these two? I have read conflicting opinions on whether @tmp still us... | <p>There are a few differences between Temporary Tables (#tmp) and Table Variables (@tmp), although using tempdb isn't one of them, as spelt out in the MSDN link below.</p>
<p>As a rule of thumb, for small to medium volumes of data and simple usage scenarios you should use table variables. (This is an overly broad gui... | <p>In SQL the Temporary tables are stored in the TempDB and the local temporary tables are only visible in the current session and it will not be visible in another session. This can be shared between nested stored procedure calls. The Global temporary tables are visible to all other sessions and they are destroyed whe... | 4,755 |
<p>I use Eclipse, Maven, and Java in my development. I use Maven to download dependencies (jar files and javadoc when available) and Maven's eclipse plug-in to generate the .project and .classpath files for Eclipse. When the dependency downloaded does not have attached javadoc I manually add a link for the javadoc in t... | <p>From the Maven Eclipse Plugin <a href="http://maven.apache.org/plugins/maven-eclipse-plugin/examples/attach-library-sources.html" rel="noreferrer">FAQ</a></p>
<blockquote>
<p>The following example shows how to do
this in the command-line:</p>
<pre><code>mvn eclipse:eclipse -DdownloadSources=true -DdownloadJav... | <p>Would having the sources for the dependency help? You can tell the eclipse plugin to download those (and refer to them in the .classpath) with <code>-DdownloadSources=true</code></p>
| 6,617 |
<p>I have created a database report generator in Excel. I am trying to create a dialog box that displays status information as the program runs.</p>
<p>When I generate the report, although the dialog box appears, I cannot refresh/update the information it displays. Most of the time, the dialog box only partially appea... | <p>I have used Excel's own status bar (in bottom left of window) to display progress information for a similar application I developed in the past.</p>
<p>It works out very well if you just want to display textual updates on progress, and avoids the need for an updating dialog at all.</p>
<p>Ok @JonnyGold, here's an ... | <p>The dialog box is also running on the same UI thread. So, it is too busy to repaint itself. Not sure if VBA has good multi-threading capabilities.</p>
| 7,516 |
<p>In GWT I have to specify what locales are supported in my application. The code get compiled in various files, one for each locale (beside other versions), but I have to give my clients one only URL. This URL is supposed to be a page that should be displayed according to the locale preferred by the browser.
I dont't... | <p>I had the same problem as you, but as I really need to know the current locale (I'm requesting a second server for data that I want to be localizable) I found this class:
<code>com.google.gwt.i18n.client.LocaleInfo#getCurrentLocale()</code>. That should give you what GWT uses currently.</p>
| <p>Unless I am reading the documentation incorrectly I don't think you have to do anything.</p>
<p><a href="http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Internationalization.html#SpecifyingLocale" rel="nofollow noreferrer">GWT and Locale</a></p>
<blockquote>
<p>By making locale ... | 3,742 |
<p>How do I Unit Test a MVC redirection?</p>
<pre><code>public ActionResult Create(Product product)
{
_productTask.Save(product);
return RedirectToAction("Success");
}
public ActionResult Success()
{
return View();
}
</code></pre>
<p>Is <a href="http://www.ayende.com/Blog/archive/2007/12/13/Dont-lik... | <pre><code>[TestFixture]
public class RedirectTester
{
[Test]
public void Should_redirect_to_success_action()
{
var controller = new RedirectController();
var result = controller.Index() as RedirectToRouteResult;
Assert.That(result, Is.Not.Null);
Assert.That(result.Values["ac... | <p>You can assert on the ActionResult that is returned, you'll need to cast it to the appropriate type but it does allow you to use state-based testing. A search on the Web should find some useful links, here's <a href="http://sebastienlachance.com/2008/05/06/testing-controllers-in-aspnet-mvc-aka-actionresult/" rel="no... | 8,286 |
<p>I recently downloaded ndepend and ran an analysis on an open source project I participate in.</p>
<p>I did not now where to look next - a bit of visual and information overload and it turned out I don't even know where to start.</p>
<p>Can anyone suggest starting points?</p>
<ul>
<li>What information should I loo... | <p>Scott Hanselman / Stuart Celarier / Patrick Cauldwell's <a href="http://www.hanselman.com/blog/EducatingProgrammersWithPlacematsNDependStaticAnalysisPoster.aspx" rel="noreferrer">poster</a> with ndepend metrics has some useful information on it. Rather than trying to break down all the heuristics being used I'd focu... | <p>Excellent pair of web casts (30 minute videos) where Patrick Smacchia and Filip Ekberg talk through some of the features of nDepend and how to use them:</p>
<p><a href="http://codebetter.com/patricksmacchia/2012/10/31/two-screencasts-on-how-to-demystify-spaghetti-code/" rel="nofollow">http://codebetter.com/patricks... | 6,640 |
<p>I want to prevent XSS attacks in my web application. I found that HTML Encoding the output can really prevent XSS attacks. Now the problem is that how do I HTML encode every single output in my application? I there a way to automate this?</p>
<p>I appreciate answers for JSP, ASP.net and PHP.</p>
| <p>You don't want to encode all HTML, you only want to HTML-encode any user input that you're outputting. </p>
<p>For PHP: <a href="http://us.php.net/htmlentities" rel="nofollow noreferrer">htmlentities</a> and <a href="http://us.php.net/manual/en/function.htmlspecialchars.php" rel="nofollow noreferrer">htmlspecialcha... | <p>If you do actually HTML encode every single output, the user will see plain text of &lt;html&gt; instead of a functioning web app.</p>
<p>EDIT: If you HTML encode every single input, you'll have problem accepting external password containing < etc..</p>
| 8,311 |
<p>I've got to get a directory listing that contains about 2 million files, but when I do an <code>ls</code> command on it nothing comes back. I've waited 3 hours. I've tried <code>ls | tee directory.txt</code>, but that seems to hang forever. </p>
<p>I assume the server is doing a lot of inode sorting. Is there any w... | <pre><code>ls -U
</code></pre>
<p>will do the ls without sorting.</p>
<p>Another source of slowness is <code>--color</code>. On some linux machines, there is a convenience alias which adds <code>--color=auto'</code> to the ls call, making it look up file attributes for each file found (slow), to color the display. This... | <p>Lots of other good solutions here, but in the interest of completeness:</p>
<pre><code>echo *
</code></pre>
| 6,142 |
<p>I am new to 3d printing having only recieved it for christmas. The filament is jammed somewhere in the extruder of my Wanhao Duplicator i3 Plus. I have tried removing it with the included hook but was unsuccessful. Is there anything else I should try before I before I dismantle the extruder, which i very much want t... | <p>Try to preheat your printer, the temperature should be above 180°C then push the filament to come out from the nozzle just 4 to 7 mm, then take out the filament from the extruder. With this step the plastic lump will get soft and will release the filament.</p>
<p>Then use the tool to clean the nozzle pushing the re... | <p>Try to preheat your printer, the temperature should be above 180°C then push the filament to come out from the nozzle just 4 to 7 mm, then take out the filament from the extruder. With this step the plastic lump will get soft and will release the filament.</p>
<p>Then use the tool to clean the nozzle pushing the re... | 778 |
<p>I am looking to 3D print some small molds that will allow wood glue to dry but <em><strong>not</strong></em> stick.</p>
<p>Is there a recommended filament that is known to <em><strong>resist</strong></em> binding to simple wood glue?</p>
<p>Alternately, is there an inexpensive adhesive (like wood glue) I could use i... | <p>You are looking for a filament that does not bond to wood glue, or as weak as possible. You misunderstand how wood glue "bonds" to plastics:</p>
<p>Wood glue is typically PVA. It <em>bonds</em> to wood and paper by seeping into them before curing and hardening. The mesh of the glue entangles fibers of the ... | <p>You are looking for a filament that does not bond to wood glue, or as weak as possible. You misunderstand how wood glue "bonds" to plastics:</p>
<p>Wood glue is typically PVA. It <em>bonds</em> to wood and paper by seeping into them before curing and hardening. The mesh of the glue entangles fibers of the ... | 1,837 |
<p>Is there an existing application or library in <em>Java</em> which will allow me to convert a <code>CSV</code> data file to <code>XML</code> file? </p>
<p>The <code>XML</code> tags would be provided through possibly the first row containing column headings.</p>
| <p>Maybe this might help: <a href="http://jsefa.sourceforge.net/quick-tutorial.html" rel="noreferrer">JSefa</a></p>
<p>You can read CSV file with this tool and serialize it to XML.</p>
| <p>This may be too basic or limited of a solution, but couldn't you do a <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split(java.lang.String)" rel="nofollow noreferrer"><code>String.split()</code></a> on each line of the file, remembering the result array of the first line to generate the XM... | 2,257 |
<p>In the code below</p>
<pre><code>For i = LBound(arr) To UBound(arr)
</code></pre>
<p>What is the point in asking using <code>LBound</code>? Surely that is always 0.</p>
| <p>Why not use <code>For Each</code>? That way you don't need to care what the <code>LBound</code> and <code>UBound</code> are.</p>
<pre><code>Dim x, y, z
x = Array(1, 2, 3)
For Each y In x
z = DoSomethingWith(y)
Next
</code></pre>
| <p>This is my approach:</p>
<pre><code>dim arrFormaA(15)
arrFormaA( 0 ) = "formaA_01.txt"
arrFormaA( 1 ) = "formaA_02.txt"
arrFormaA( 2 ) = "formaA_03.txt"
arrFormaA( 3 ) = "formaA_04.txt"
arrFormaA( 4 ) = "formaA_05.txt"
arrFormaA( 5 ) = "formaA_06.txt"
arrFormaA( 6 ) = "formaA_07.txt"
arrFormaA( 7 ) = "formaA_08.txt... | 2,450 |
<p>I had a Z probe installed but the wires came out of the header so I am trying to use software endstops, but any time I <code>G28</code> the nozzle will always ram into the bed. I am using Marlin Firmware. Which I am relatively new with. I'm used to having hardware endstops, but,</p>
<p><strong>I don't have a hardwa... | <p>If you want to mirror the print to get the top to the bottom, and visa versa, you just need to rotate the part using the XYZ rotation tool. Mirroring is used to make a mirror image in the X-Z or Y-Z plane, not the X-Y plane. </p>
<p>You might just caught a bug, you could post that of their forum.</p>
<p>Update: <... | <p>If you want to mirror the print to get the top to the bottom, and visa versa, you just need to rotate the part using the XYZ rotation tool. Mirroring is used to make a mirror image in the X-Z or Y-Z plane, not the X-Y plane. </p>
<p>You might just caught a bug, you could post that of their forum.</p>
<p>Update: <... | 978 |
<p>What actually happens to the file system when you do a Subclipse Share Project on an Eclipse project that was externally checked out from Subversion? All the .svn folders are already in place. I get an error when I try to Share Project the right way, and I'd rather not delete and re-checkout the projects from the ... | <p>Dunno exactly what happens within eclipse, I presume it does some funky stuff in the .metadata directory of the workspace. That said, I would recommend the following to get eclipse to learn about the svn settings of the project:</p>
<ul>
<li>Delete the project from the workspace (keep "Delete project contents on d... | <p>I'm not sure what version of Eclipse you are using or whether this will apply since I'm using Subversive instead of Subclipse. When I use the share project feature to commit the project into svn when I already have all of the .svn directories in place, I get a choice of like "Use current project settings" and then ... | 6,650 |
<p>I've been using Window Home Server for my backups here at home for most of a year now, and I'm really pleased with it. It's far better than the software I was using previously (Acronis). I'm thinking about a backup strategy for my work machine and I'd like to know how WHS compares with Vista's built-in backup and ... | <p>Chris, </p>
<p>They're different beasts. WHS backup is pretty much automatic and uses deltas - Vista's is manual and I don't believe offers incremental updates.</p>
<p>While your solution (Vista + network copy) would preserve your data it has two problems I an see;</p>
<ol>
<li>Your documents will only have the l... | <p>WHS is such a quick, simple, robust way to get your stuff backed up. Plug it in to the network; install the client software; done. I'd hate to live without it.</p>
<p>However, as a programmer, I also set up scripts to run each night and back up my pending changes to another machine. For example, when using TFS, ... | 5,620 |
<p>I am having trouble integrating two products, one of which is mine and they appear not to be talking. So I want to make sure they are communicating correctly. I had a look around for network monitor and found TCP Spy. This works but only shows 1 side of the conversation at a time (it has to run locally) I would idea... | <p><a href="http://www.wireshark.org/" rel="noreferrer">Wireshark</a> is a really good and mature network sniffer. It's been around for years.</p>
<ul>
<li>Deep inspection of hundreds of protocols, with more being added all the time</li>
<li>Live capture and offline analysis </li>
<li>Decryption support for many proto... | <p>Strange that I did not see WireShark when I visited SourceForge. The top result of the 60 returned was a bizarre german thing.</p>
| 4,798 |
<p>I try to use the Forms-Based authentication within an embedded Jetty 6.1.7 project.</p>
<p>That's why I need to serve servlets and html (login.html) under the same context
to make authentication work. I don't want to secure the hole application since
different context should need different roles. The jetty javadoc ... | <p>Finally I got it right, solution is to use latest jetty 6.1.12 rc2.
I didn't check out what they changed - I'm just happy that it works now.</p>
| <p>Use the web application descriptor:</p>
<p>Paste this in to your web.xml:</p>
<pre><code><login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<role-name>MySiteRole</role-name>
</security-role>
<security-constraint>
<di... | 9,866 |
<p>I have a wcf application hosted in a windows service running a local windows account. Do I need to set an SPN for this account? If so, what's the protocol the SPN needs to be set under? I know how to do this for services over HTTP, but have never done it for net.tcp.</p>
| <p>By default (i.e. out of the box) net.tcp services are unsecured and don't perform any authentication at all. So you won't need (and in fact can't) set a service principal name. </p>
<p>If you need to authenticate, then check the <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.nettcpsecurity.asp... | <p>By default (i.e. out of the box) net.tcp services are unsecured and don't perform any authentication at all. So you won't need (and in fact can't) set a service principal name. </p>
<p>If you need to authenticate, then check the <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.nettcpsecurity.asp... | 5,974 |
<p>I'm updating some of our legacy C++ code to use the "MFC feature pack" that Microsoft released for Visual Studio 2008. We've used the new classes to derive our application from CFrameWndEx, and are applying the Office 2007 styles to give our application a more modern appearance. This gives us gradient filled window ... | <p>Have you looked in the MFC source code, which you'll find in something like</p>
<p>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc</p>
| <p>Have you tried: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=19E3BF38-434B-4DDD-9592-3749F6647105&displaylang=en" rel="nofollow noreferrer">2007 Office System Document: UI Style Guide for Solutions and Add Ins</a>
?</p>
| 3,026 |
<p>Example:</p>
<pre><code>select ename from emp where hiredate = todate('01/05/81','dd/mm/yy')
</code></pre>
<p>and </p>
<pre><code>select ename from emp where hiredate = todate('01/05/81','dd/mm/rr')
</code></pre>
<p>return different results</p>
| <p><a href="http://oracle.ittoolbox.com/groups/technical-functional/oracle-dev-l/difference-between-yyyy-and-rrrr-format-519525" rel="noreferrer">http://oracle.ittoolbox.com/groups/technical-functional/oracle-dev-l/difference-between-yyyy-and-rrrr-format-519525</a></p>
<blockquote>
<p>YY allows you to retrieve just ... | <p>RR stands for after 1990 and yy assumes 90 as 2090....as we are in the current yr,...</p>
| 3,956 |
<p>I have a XULRunner application that needs to copy image data to the clipboard. I have figured out how to handle copying text to the clipboard, and I can paste PNG data from the clipboard. What I can't figure out is how to get data from a data URL into the clipboard so that it can be pasted into other applications.</... | <p>Here's a workaround that I ended up using that solves the problem pretty well. The variable <code>dataURL</code> is the image I was trying to get to the clipboard in the first place.</p>
<pre><code>var newImg=document.createElement('img');
newImg.src=dataURL;
document.popupNode=newImg;
var command='cmd_copyImageC... | <p>Neal Deakin has an <a href="http://developer.mozilla.org/en/Using_the_Clipboard" rel="nofollow noreferrer">article on manipulating the clipboard</a> in xulrunner. I'm not sure if it answers your question specifically, but it's definitely worth checking out.</p>
| 9,360 |
<p><strong>Is there a way to utilise the GCC compiler whilst still being able to develop via the Visual Studio IDE?</strong></p>
<p>Our project is cross-platform, and I quite frequently get into trouble from my <a href="https://stackoverflow.com/users/912/jkp">colleague</a> because I'm checking in code that's not stan... | <p>What I am about to suggest would still require a makefile, so I am partially repeating the advice from an earlier reply. Or, as was also mentioned earlier, maybe you already have a makefile, in which case you will have even fewer steps in order to accomplish what I am about to describe.</p>
<p>Once you know your s... | <p>I had to maintain separate makefiles for compiling with gcc. There's an upfront cost associated with learning make, but you'll benefit from the intimate knowledge of your code and the differences between VS C++ and gcc. When I did this, I was using VC 6, so there may be a better way now with VS 2005.</p>
| 8,841 |
<p>I use TFS 2008. We run unit tests as part of our continuous integration build and integration tests nightly.</p>
<p>What other types of testing do you automate and include in your build process? what technologies do you use to do so? </p>
<p>I'm thinking about smoke tests, performance tests, load tests but don'... | <p>First, we have check-in (smoke) tests that must run before code can be checked in. It's done automatically by running a job that runs the tests and then makes the check-in to source control upon successful test completion. Second, cruise control kicks off build and regression tests. The product is built then several... | <p>Integrating load testing during you build process is a bad idea, just do your normal unit testing to make sure that all your codes work as expected. Load and performance testing should be done separately.</p>
| 5,451 |
<p>Does a filament exist that can resist ozone (like certain silicone tubing's can). Most glass bottles come with tin or plastic screw hard tops and I would like to replace the screw caps with something that is more resistant to ozone.</p>
<p>The reason for this is I make my own homemade ozonated oil in glass bottles ... | <p>If making your own caps ends up being the best solution, TPU (thermoplastic polyurethane) is probably your best bet. I don't have specific information on printed TPU filament and ozone, but TPU is widely regarded as one of the most chemical-resistant materials you can easily print with, and <a href="https://ozonesol... | <p>According to <a href="https://www.calpaclab.com/polyetherether-ketone-peek-chemical-compatibility-chart/" rel="nofollow noreferrer">https://www.calpaclab.com/polyetherether-ketone-peek-chemical-compatibility-chart/</a> and <a href="https://www.polyfluor.nl/en/chemical-resistance/peek/" rel="nofollow noreferrer">http... | 1,638 |
<p>I'm using the .NETCF (Windows Mobile) <code>Graphics</code> class and the <code>DrawString()</code> method to render a single character to the screen.</p>
<p>The problem is that I can't seem to get it centred properly. No matter what I set for the Y coordinate of the location of the string render, it always comes o... | <p>I'd like to add another vote for the StringFormat object.
You can use this simply to specify "center, center" and the text will be drawn centrally in the rectangle or points provided:</p>
<pre><code>StringFormat format = new StringFormat();
format.LineAlignment = StringAlignment.Center;
format.Alignment = StringAli... | <p>You can use an instance of the <code>StringFormat</code> object passed into the <code>DrawString</code> method to center the text.</p>
<p>See <a href="http://msdn.microsoft.com/en-us/library/21kdfbzs.aspx" rel="nofollow noreferrer">Graphics.DrawString Method</a> and <a href="http://msdn.microsoft.com/en-us/library/... | 2,954 |
<p>I want to test the web pages I create in all the modern versions of Internet Explorer (6, 7 and 8 beta) but I work mainly on a Mac and often don't have direct access to a PC.</p>
| <p><strong>Update:</strong> Microsoft now provide virtual machine images for various versions of IE that are ready to use on all of the major OS X virtualisation platforms (<a href="https://www.virtualbox.org" rel="nofollow noreferrer">VirtualBox</a>, <a href="http://www.vmware.com/products/fusion/overview.html" rel="n... | <p>If this is a business web site (or a serious site where it is important that it actually works on IE), then don't take the cheap route - invest in a Windows machine or two. Your customers will thank you.</p>
<p>Otherwise, virtualize.</p>
| 7,939 |
<p>Working on a project at the moment and we have to implement soft deletion for the majority of users (user roles). We decided to add an <code>is_deleted='0'</code> field on each table in the database and set it to <code>'1'</code> if particular user roles hit a delete button on a specific record.</p>
<p>For future m... | <p>You could perform all of your queries against a view that contains the <code>WHERE IS_DELETED='0'</code> clause.</p>
| <pre><code>@AdditionalCriteria("this.status <> 'deleted'")
</code></pre>
<p>put this on top of your <code>@entity</code></p>
<p><a href="http://wiki.eclipse.org/EclipseLink/Examples/JPA/SoftDelete" rel="nofollow noreferrer">http://wiki.eclipse.org/EclipseLink/Examples/JPA/SoftDelete</a></p>
| 9,382 |
<p>I use Prusa i3 with one extruder for some years and I would like to print from one material in two colors or from different materials for one model. Therefore I'm lookig for new printer with dual extruder.</p>
<p>Is there some way how to measure and/or compare quality of printers with dual extruder on the market?</... | <p>As you suggest yourself, ordering test prints of some model is one way to do it. </p>
<p><a href="https://www.3dhubs.com">3D Hubs</a> and <a href="https://www.makexyz.com/">MakeXYZ</a> allows you to get your model printed by hobbyists and small businesses for a fair price. Both sites also allow you to order prints ... | <p>"Make" Magazine compares 3-D printers in a way that is as scientific as possible to help determine the strengths/weaknesses of each 3-D printer compared to others. The link to the November 2015 comparison test is available here: <a href="http://makezine.com/comparison/3dprinters/" rel="nofollow">http://makezine.com/... | 288 |
<p>I recently upgraded my Ender 3 Pro with a <a href="https://printermods.com/products/direct-drive-mod-for-creality-ender-3-cr-10" rel="nofollow noreferrer">direct drive kit</a>, primarily so I can print soft materials like TPU. I bought a spool of <a href="https://rads.stackoverflow.com/amzn/click/com/B07VBKDM74" rel... | <p>That depends very much on what your goal is with the box. If it needs to be hollow and you don't need any access to the inside (and also prefer it to be printed in one piece) than the answer provided by user77232 would probably be the best.</p>
<p>Alternatively, if you need access to the inside of the box you would ... | <ol>
<li>Print it as a whole object</li>
<li>Use 20% infill.</li>
<li>Profit!</li>
</ol>
| 1,739 |
<p>I need to calculate <code>Math.exp()</code> from java very frequently, is it possible to get a native version to run faster than <strong>java</strong>'s <code>Math.exp()</code>??</p>
<p>I tried just jni + C, but it's slower than just plain <strong>java</strong>.</p>
| <p>+1 to writing your own exp() implementation. That is, if this is <em>really</em> a bottle-neck in your application. If you can deal with a little inaccuracy, there are a number of extremely efficient exponent estimation algorithms out there, some of them dating back centuries. As I understand it, Java's exp() imp... | <p>Since the Java code will get compiled to native code with the just-in-time (JIT) compiler, there's really no reason to use JNI to call native code.</p>
<p>Also, you shouldn't cache the results of a method where the input parameters are floating-point real numbers. The gains obtained in time will be very much lost ... | 9,191 |
<p>I've created an assembly and referenced it in my Reporting Services report. I've tested the report locally (works), and I then uploaded the report to a report server (doesn't work).</p>
<p>Here is the error that is thrown by the custom code I've written.</p>
<blockquote>
<p>System.Security.SecurityException:
R... | <p>This is how I was able to solve the issue:</p>
<ul>
<li>strongly sign the custom assembly in question</li>
<li><p>modify the rssrvpolicy.config file to add permissions for the assembly</p>
<pre><code> <CodeGroup
class="UnionCodeGroup"
version="1... | <p>Run your service in administrator mode</p>
| 5,236 |
<p>Anyone know this compiler feature? It seems GCC support that. How does it work? What is the potential gain? In which case it's good? Inner loops?</p>
<p>(this question is specific, not about optimization in general, thanks)</p>
| <p>It works by placing extra code to count the number of times each codepath is taken. When you compile a second time the compiler uses the knowledge gained about execution of your program that it could only guess at before. There are a couple things PGO can work toward:</p>
<ul>
<li>Deciding which functions should be... | <p>The fun thing about optimization is that speed gains are found in the unlikeliest of places.</p>
<p>It's also the reason you need a profiler, rather than guessing where the speed problems are.</p>
<p>I recommend starting with a profiler (<code>gperf</code> if you're using GCC) and just start poking around the resu... | 7,578 |
<p>I'm thinking of another extruder on my printer, and I'm curious about this one....</p>
<p>Is it necessary to have both hot ends on same height? Why yes / why not? (if there is not)</p>
| <p>I have a dual extruder Replicator 1 and having the nozzles at the same height is a must and albeit a bit of a struggle otherwise. At one point, I had to disassemble my extruder head and the nozzles didn't line up quite right. There after, printing with the lower one obviously didn't have any troubles, however, print... | <p>To add to the above answers, besides the obvious point that one hotend might collide with something another hotend positioned lower than it has printed, you also want both hotends to be positioned X microns above the bed at minimum height so your filament will stick to the bed properly. Position one a bit higher tha... | 181 |
<p>How do I implement some logic that will allow me to reproduce on Windows the functionality that I have on Linux with the <code>fork()</code> system call, using Python?</p>
<p>I'm specifically trying to execute a method on the SAPI Com component, while continuing the other logic in the main thread without blocking o... | <p>Use the python <a href="http://docs.python.org/library/multiprocessing.html" rel="noreferrer">multiprocessing module</a> which will work everywhere.</p>
<p>Here is a <a href="http://www.ibm.com/developerworks/aix/library/au-multiprocessing/" rel="noreferrer">IBM developerWords article</a> that shows how to convert ... | <p>Possibly a version of spawn() for python? <a href="http://en.wikipedia.org/wiki/Spawn_(operating_system)" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Spawn_(operating_system)</a></p>
| 4,337 |
<p>How can I find the last row that contains data in a specific column and on a specific sheet?</p>
| <p>How about:</p>
<pre><code>Function GetLastRow(strSheet, strColumn) As Long
Dim MyRange As Range
Set MyRange = Worksheets(strSheet).Range(strColumn & "1")
GetLastRow = Cells(Rows.Count, MyRange.Column).End(xlUp).Row
End Function
</code></pre>
<p>Regarding a comment, this will return the row number ... | <pre><code>Function LastRow(rng As Range) As Long
Dim iRowN As Long
Dim iRowI As Long
Dim iColN As Integer
Dim iColI As Integer
iRowN = 0
iColN = rng.Columns.count
For iColI = 1 To iColN
iRowI = rng.Columns(iColI).Offset(65536 - rng.Row, 0).End(xlUp).Row
If iRowI > iRowN T... | 9,663 |
<p>Does anyone have the secret formula to resizing transparent images (mainly GIFs) <em>without</em> ANY quality loss - what so ever?</p>
<p>I've tried a bunch of stuff, the closest I get is not good enough.</p>
<p>Take a look at my main image:</p>
<p><a href="http://www.thewallcompany.dk/test/main.gif" rel="norefer... | <p>If there's no requirement on preserving file type after scaling I'd recommend the following approach.</p>
<pre><code>using (Image src = Image.FromFile("main.gif"))
using (Bitmap dst = new Bitmap(100, 129))
using (Graphics g = Graphics.FromImage(dst))
{
g.SmoothingMode = SmoothingMode.AntiAlias;
g.Interpolatio... | <p>While PNG is definitely better that GIF, occasionally there is a use case for needing to stay in GIF format. </p>
<p>With GIF or 8-bit PNG, you have to address the problem of quantization.</p>
<p>Quantization is where you choose which 256 (or fewer) colors will best preserve and represent the image, and then turn ... | 5,046 |
<p>It is open season for posting ads on other sites. It might be a good idea to take advantage of this to help 3dPrinting.SE grow. I'm wondering what everyone might think about it?</p>
<p>If it does interest you, please post up an answer to this question with where you might think would be a good place to advertise. U... | <p>Considering 3D printing needs 3D models, I think it would be natural to advertise on <a href="https://blender.meta.stackexchange.com/q/2580/13218">Blender.SE</a>, perhaps with a catchphrase like "Want to print your Blender model?"</p>
<p><a href="https://graphicdesign.meta.stackexchange.com/q/3573/30985">GraphicDes... | <p>Sounds like a great idea. StackOverflow is by for the most populated site (and the one I came from).</p>
<p>3D printing interests nerdy-trendy folks like those the in SO, that's where I can from.</p>
<p>Prehaps woodworking SE sites would work as well.</p>
| 64 |
<p>Are there any good oracle podcasts around? The only ones I've found is produced by oracle corp, and as such are little more than advertising pieces pushing their technology of the moment.</p>
<p>I'm specifically interested in Database technologies.</p>
| <h2>Oracle Podcast Center</h2>
<hr>
<p><a href="http://www.oracle.com/applications/podcasts-sustainability.html" rel="nofollow noreferrer">Green Enterprise Podcasts</a></p>
<p>Host: Paul Salinger, VP Marketing</p>
<p>Listen to discussions with customers, partners, and Oracle green experts, exploring topics that can... | <p>Asking for an "Oracle podcast" that isn't going to be a product marketing focused is too broad. It's almost like asking for a "Microsoft Podcast." Anything you get is going to be broad and shallow. An introduction, nothing in depth.</p>
<p>What are you looking for? DB, Middleware, Linux/OS, ERP, CRM, BI, Informatio... | 6,950 |
<p>Is there a fast and clean way of returning a JSON hash back from any node in a Ruby on Rails' acts_as_nested_set without using recursion?</p>
<p>Here's the recursive solution for reference:</p>
<pre><code>class Node < ActiveRecord::Base
has_many :products
def json_hash
if children.size > 0
chil... | <p>There is a <a href="http://en.wikipedia.org/wiki/Tree_traversal" rel="nofollow noreferrer">wikipedia article</a> on tree traversal which shows different alternatives to the recursive solution you are using. It may be tricky to use them in your specific case, but it should be possible.</p>
<p>However, my question t... | <p>JSONifier!</p>
<pre><code>node.to_json(:include=>{:products=>{:include=>:product_parts}})
</code></pre>
| 6,249 |
<p>I see 2 main ways to set events in JavaScript:</p>
<ol>
<li><p>Add an event directly inside the tag like this:</p>
<p><code><a href="" onclick="doFoo()">do foo</a></code></p></li>
<li><p>Set them by JavaScript like this:</p>
<p><code><a id="bar" href="">do bar</a></code></p></li>
</ol>
<p... | <blockquote>
<p>I think the first method is easier to read and maintain</p>
</blockquote>
<p>I've found the opposite to be true. Bear in mind that sometimes more than one event handler will be bound to a given control.</p>
<p>Declaring all events in one central place helps to organize the actions taking place on th... | <p>Libraries like YUI and jQuery provide methods to add events only once the DOM is ready, which can be before window.onload. They also ensure that you can add multiple event handlers so that you can use scripts from different sources without the different event handlers overwriting each other.</p>
<p>So your practica... | 5,430 |
<p>How do I take a set of polygons which contain arbitrary values and create a corresponding bitmap where each pixel contains the value of the polygon at that location?</p>
<p>To put the question into context, my polygons contain information about the average number of people per square kilometre within the polygon. I... | <p>What GIS software are you using? ArcGIS offers the Polygon to Raster tool in ArcGIS 9.2 or later, which is scriptable as the PolygonToRaster_conversion function.</p>
<pre><code>PolygonToRaster_conversion (in_features, value_field, out_raster_dataset, cell_assignment, priority_field, cellsize)
</code></pre>
| <p>ImageMagick can convert from svg to png, maybe you can take a look at the code, or simply create svg and use IM for the conversion? <a href="http://scruffy.rubyforge.org/" rel="nofollow noreferrer" title="Scruffy">Scruffy</a> does that.</p>
| 8,306 |
<p>For example,
Look at the code that calculates the n-th Fibonacci number:</p>
<pre><code>fib(int n)
{
if(n==0 || n==1)
return 1;
return fib(n-1) + fib(n-2);
}
</code></pre>
<p>The problem with this code is that it will generate stack overflow error for any number greater than 15 (in most computers).... | <p>Yes your insight is correct.
This is called <a href="http://en.wikipedia.org/wiki/Dynamic_programming" rel="nofollow noreferrer">dynamic programming</a>. It is usually a common memory runtime trade-off.</p>
<p>In the case of fibo, you don't even need to cache everything :</p>
<p>[edit]
The author of the question s... | <p>If you're using a language with first-class functions like Scheme, you can add memoization without changing the initial algorithm:</p>
<pre><code>(define (memoize fn)
(letrec ((get (lambda (query) '(#f)))
(set (lambda (query value)
(let ((old-get get))
(set! get (l... | 4,375 |
<p>we're developing a web app to cover all aspects of a printing company from finances, to payroll, to job costing. Its important to be able to control who can access what parts of these applications. Don't want a line employee giving himself a raise, etc...</p>
<p>I've heard of the concept of ACL & ACO, but hav... | <p>A brief rundown on ACLs, where they should be used and how they should be structured and implemented for various applications and user levels can be found here:</p>
<p><a href="http://c2.com/cgi/wiki?AccessControlList" rel="nofollow noreferrer">LINK</a></p>
| <p>I've had to implement that type of security a couple of times. Unfortunately I don't know of any really good articles that provide examples. My implementations were mainly piecing together the parts through trial and error.</p>
<p>However, I did come across this link on MSDN:</p>
<p><a href="http://msdn.microsof... | 3,368 |
<p>I've been using user controls extensively but never use a HttpHandler and was wondering if I am doing something suboptimal or wrong</p>
| <p>Unfortunately your question is a little like "Should I use a sandwich or a cement mixer". HttpHandlers and User controls are completely different things.</p>
<p>HttpHandlers are used to process HTTP requests. For example, if you wanted to dynamically create an RSS feed, you could write an HTTP handler that handle... | <p>Even an <code>Asp.Net</code> page is an <code>HttpHandler</code>.</p>
<pre><code>public class Page : TemplateControl, IHttpHandler
</code></pre>
<p>A user control actually resides within the asp.net aspx page.</p>
| 4,216 |
<p>I've been printing successfully on my CR-10 for the past year now. I've had issues now and then but have been able to look around the internet and solve them. I've been using some Flashforge white PLA with great results.</p>
<p>Example:
<a href="https://i.stack.imgur.com/JlMqb.jpg" rel="noreferrer"><img src="https:... | <p>Not all filaments are created equal. Even with the very same manufacturer, the addition of colorful pigments can change the needed printing temperature a lot! I have had a white china PLA that was giving ok quality at 200°C, but the same brand's clear PLA only took 195°C to print. My white Kaisertech prints better a... | <p>Not all filaments are created equal. Even with the very same manufacturer, the addition of colorful pigments can change the needed printing temperature a lot! I have had a white china PLA that was giving ok quality at 200°C, but the same brand's clear PLA only took 195°C to print. My white Kaisertech prints better a... | 1,006 |
<p>I have a two dimensional array that I need to load data into. I know the width of the data (22 values) but I do not know the height (estimated around 4000 records, but variable).</p>
<p>I have it declared as follows: </p>
<pre><code>float[,] _calibrationSet;
....
int calibrationRow = 0;
While (recordsToRead)... | <p>You can't use an array.
Or rather, you would need to pick a size, and if you ended up needing more then you would have to allocate a new, larger, array, copy the data from the old one into the new one, and continue on as before (until you exceed the size of the new one...)</p>
<p>Generally, you would go with one of... | <p>I generally use the nicer collections for this sort of work (List, ArrayList etc.) and then (if really necessary) cast to T[,] when I'm done.</p>
| 7,334 |
<p>Are people still writing <a href="http://zeroc.com/blogs/michi/" rel="noreferrer">SOAP services</a> or is it a technology that has passed its <a href="http://www.addsimplicity.com/" rel="noreferrer">architectural shelf life</a>? Are people returning to binary formats?</p>
| <p>The alternative to SOAP is not binary formats.</p>
<p>I think you're seeing a surge in the desire to leave the complexities of WS-* behind in favor of REST and JSON, because they're much simpler to use and don't require frameworks to be used successfully. The problems that WS-* ostensibly tries to solve aren't prob... | <p>Yes, some people <strong>still</strong> are (and now it's 2011!). I think the main reason is that MS WCF automatically generates SOAP bindings. The horror. </p>
| 5,938 |
<p>What would be the best way to calculate someone's age in years, months, and days in T-SQL (SQL Server 2000)?</p>
<p>The <code>datediff</code> function doesn't handle year boundaries well, plus getting the months and days separate will be a bear. I know I can do it on the client side relatively easily, but I'd like... | <p>Here is some T-SQL that gives you the number of years, months, and days since the day specified in @date. It takes into account the fact that DATEDIFF() computes the difference without considering what month or day it is (so the month diff between 8/31 and 9/1 is 1 month) and handles that with a case statement that... | <pre><code>DECLARE @DoB AS DATE = '1968-10-24'
DECLARE @cDate AS DATE = CAST('2000-10-23' AS DATE)
SELECT
--Get Year difference
DATEDIFF(YEAR,@DoB,@cDate) -
--Cases where year difference will be augmented
CASE
--If Date of Birth greater than date passed return 0
WHEN YEAR(@DoB) - YEAR(@cDate) >= 0 THEN DA... | 8,193 |
<p>I am trying to code TDD style in PHP and one of my biggest stumbling blocks (other than lack of a decent IDE) is that I have to make my own hacked together IoC container just to inject all my mock objects properly.</p>
<p>Has anyone used an Ioc container in PHP? All I've been able to find is <a href="http://www.ph... | <p>I played with some DI Frameworks for PHP, but I haven't used one in production. Have some links:</p>
<ol>
<li><a href="http://www.stubbles.net" rel="noreferrer">http://www.stubbles.net/</a> which
I think is the oldest I tried</li>
<li><a href="http://php.xjconf.net/" rel="noreferrer">http://php.xjconf.net/</a></li>... | <p>Laravel 4 has the best IoC and DI framework. if you dont mind using a framework the Laravel 4 is the way to go</p>
| 7,530 |
<p>My goal is to maintain a web file server separately from my main ASP.NET application server for better scalability. The web file server will store a lot of files downloaded by users.<br>
So the question is: Is it worth to adopt FreeBSD + Apache + ZFS, or will good old IIS be сonvenient enough?</p>
| <p>I understand you will serve only static files. In this case, lightweight HTTP servers will give you a higher performance for a given machine. The following are well known:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Lighttpd" rel="nofollow noreferrer">Lighttpd</a></li>
<li><a href="http://en.wikipedia.org/wi... | <p>If you're serving files over the Internet, you might also consider <a href="http://www.amazon.com/gp/browse.html?node=16427261" rel="nofollow noreferrer">Amazon's S3 service</a>. I've found the rates and reliability to be better than anything I could do (or find) on my own.</p>
| 4,746 |
<p>Is there a way (or shortcut) to tell VS 2008 that it cuts a line like this:</p>
<p><strong>Before:</strong></p>
<pre><code>Some Text here
This gets cut
Some Code there
</code></pre>
<p><strong>After:</strong></p>
<pre><code>Some Text here
Some Code there
</code></pre>
<p><strong>What I want:</strong></p>
... | <p>Unless I misunderstood you:<br>
Just place cursor on the line you want to cut (no selection) and press <kbd>Ctrl</kbd> + <kbd>x</kbd>. That cuts the line (leaving no blanks) and puts the text in the Clipboard. (tested in <em>MS VC# 2008 Express</em> with no additional settings I'm aware of)</p>
<p>Is that what you ... | <p>Don't select anything, just hit <kbd>ctrl</kbd>+<kbd>x</kbd> when the cursor is on the line.</p>
| 8,409 |
<p>I've been writing C / C++ code for almost twenty years, and I know Perl, Python, PHP, and some Java as well, and I'm teaching myself JavaScript. But I've never done any .NET, VB, or C# stuff. What exactly does <strong>managed</strong> code mean?</p>
<p>Wikipedia <a href="http://en.wikipedia.org/wiki/Managed_code" r... | <p>When you compile C# code to a .exe, it is compiled to Common Intermediate Language(CIL) bytecode. Whenever you run a CIL executable it is executed on Microsofts Common Language Runtime(CLR) virtual machine. So no, it is not possible to include the VM withing your .NET executable file. You must have the .NET runtime ... | <p>Managed Code--MSIL and IL and Managed Code are same.When we build our application the .dll or .exe files are generated in the Bin folder.These files are called as Managed code.Later these files are given to CLR to generate Native code which would be understood by OS.</p>
| 8,238 |
<p>I'm using Cura to slice prints from a biodegradable polyester called PCL (<a href="https://en.wikipedia.org/wiki/Polycaprolactone" rel="nofollow noreferrer">Polycaprolactone</a>).</p>
<p>I need to print @ ~70 °C but extruder does not run until nozzle reaches 175 °C.</p>
<p>Which setting to change so extruder will tu... | <p>70 °C is a specialty filament. It is well below the <code>MIN_TEMP</code> defined in any sane firmware. In Marlin, you <strong>can't</strong> turn on the extruder in any way, while this is online.</p>
<p>You do need to define your firmware to allow such a print - either by dropping the value in the firmware or disab... | <p>In Cura Machine Settings, add <code>M302 S70</code>.</p>
<p>Apparently, <code>M302 P1</code> and <code>M302 S0</code> do nothing, you need to define a non-zero minimum, and in my case, 70. Thanks to 0scar and Trish for your help.</p>
| 1,849 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.