instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>A custom HTTP header is being passed to a Servlet application for authentication purposes. The header value must be able to contain accents and other non-ASCII characters, so must be in a certain encoding (ideally UTF-8).</p> <p>I am provided with this piece of Java code by the developers who control the authentica...
<p>As mentioned already the first look should always go to the <a href="http://www.greenbytes.de/tech/webdav/rfc2616.html" rel="nofollow noreferrer">HTTP 1.1 spec</a> (RFC 2616). <a href="http://www.greenbytes.de/tech/webdav/rfc2616.html#basic.rules" rel="nofollow noreferrer">It says</a> that text in header values must...
<p>See the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2" rel="nofollow noreferrer">HTTP spec</a> for the rules, which says in section 2.2 </p> <blockquote> <p>The TEXT rule is only used for descriptive field contents and values that are not intended to be interpreted by the message parser. Wor...
42,017
<p>I am new to 3D printing which we all are/were at some point. I have <strong>no</strong> clue how to address the issue which likely is reason why I haven't found the solution yet. So if you see that this question has been posted elsewhere, please link it! Thanks!</p> <p>I have had this issue for a while, however righ...
<p>This is opinion-based, but the volcano has drawbacks that affect print quality, mine is oozier and sloppier than a V6 with the shorter, more precise melt zone. It isn’t a slam dunk upgrade, more of a special applications part. I think there is no point to using a Volcano unless you’re running big nozzles fast, like ...
<p>Yes, the Volcano or the Super Volcano allow for larger flow rate (typically when using larger nozzles), that is where they were designed for. Just the nozzle will not help you, you need this larger nozzle shaft to be inside a Volcano heater block, else you cannot transfer the heat.</p> <p>According to measurements f...
1,653
<p>How do I Deserialize this XML document:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Cars&gt; &lt;Car&gt; &lt;StockNumber&gt;1020&lt;/StockNumber&gt; &lt;Make&gt;Nissan&lt;/Make&gt; &lt;Model&gt;Sentra&lt;/Model&gt; &lt;/Car&gt; &lt;Car&gt; &lt;StockNumber&gt;1010&lt;/StockN...
<p>Here's a working version. I changed the <code>XmlElementAttribute</code> labels to <code>XmlElement</code> because in the xml the StockNumber, Make and Model values are elements, not attributes. Also I removed the <code>reader.ReadToEnd();</code> (that <a href="http://msdn.microsoft.com/en-us/library/system.io.str...
<p>If you're getting errors using xsd.exe to create your xsd file, then use the XmlSchemaInference class as mentioned <a href="http://msdn.microsoft.com/en-us/library/system.xml.schema.xmlschemainference.aspx" rel="nofollow">on msdn</a>. Here's a unit test to demonstrate:</p> <pre><code>using System.Xml; using Syste...
47,555
<p>I have a multilingual ASP.NET site; one of the languages is Arabic (ar-SA). To switch between cultures, I use this code: </p> <pre><code>Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Name) Thread.CurrentThread.CurrentUICulture = New CultureInfo(Name) </code></pre> <p>When displaying the d...
<h2>Answer:</h2> <p>Turns out the ar-SA culture is the only one to use the Hijiri calendar; all the other Arabic cultures use Gregorian. Here are the different date formats in Arabic (a bit messed up because WMD doesn't support seem to support RTL text).</p> <pre><code>ar-AE 11 ديسمبر 2008 ar-BH 11 ديسمبر 2008 ar-DZ ...
<p>You can just use another Arabic locale, The only difference between them is the Date format...</p>
46,977
<p>For a project I am doing I need to manually create a .net project. I am currently using a <code>StreamWriter</code> to create the .sln, .csproj and base (empty for now) class. I am also generating the AssemblyInfo.cs class. I have copied exactly the files and folder structure VS.Net creates when you create an empty ...
<p>Yes, an output parameter is all it took. I couldn't find the right calling syntax in the manual or google though.</p> <p>You create the procedure like this:</p> <pre><code>CREATE PROCEDURE myschema.add(IN a INT, IN b INT, OUT c INT) BEGIN SET c = a + b; END </code></pre> <p>And then call it like this (this is...
<p>How about an output parameter in the proc you call from within your original proc? Calling a proc is done through the CALL command. It's in the manual ;)</p>
48,836
<p>I need an up to date and easy to use .net wrapper for google maps. </p>
<p><a href="http://www.codeplex.com/googlemap" rel="nofollow noreferrer">Googlemap Control</a> Wraps Google Maps API as ASP.NET custom control. Offers extremely easy and fast way of adding Google Maps API support on your ASP.NET pages.</p>
<p>.NET wrapper libraries for the Google Maps API (API wrapper, but NOT controls for displaying maps):</p> <ol> <li><a href="https://github.com/vivet/GoogleApi" rel="nofollow noreferrer">GoogleApi</a></li> <li><a href="https://github.com/maximn/google-maps" rel="nofollow noreferrer">google-maps</a></li> </ol> <p><a h...
43,251
<p>I have a class which looks something like this:</p> <pre><code>public class Test { private static final Object someObject = new Object(); public void doSomething() { synchronized (someObject) { System.out.println(someObject.toString()); } } } </code></pre> <p>Can I consider the object to be sync...
<p>By using a static object as your monitor object, only one thread using ANY instance of the Test class can get into the sync block. If the monitor object was not a static object, other threads holding different instances of the Test class could get into the sync block.</p>
<p>What happens if Test class is loaded using different classloaders? </p>
40,603
<p>What is the best way to test my webforms applications?</p> <p>Looks like people are loving Watin, and selenium.</p>
<p><strong>UPDATE</strong>: <em>Given WatiN has been stagnant for over a year now, I would direct anyone that needs web ui tests towards <a href="http://seleniumhq.org" rel="nofollow noreferrer">selenium</a>, it is in continuous use &amp; development by many contributors, and is actively used by Google.</em> </p> <p><...
<p>I would use a tool like WaitIn:</p> <p>" WatiN is Web Application Testing in .NET, and this Test Recorder will generate chunks of source for you by recording your clicks in an embedded IE browser" (from <a href="http://www.hanselman.com/blog/ScottHanselmans2007UltimateDeveloperAndPowerUsersToolListForWindows.aspx" ...
14,429
<p>Can you recommend any resources for learning about Windows Installer?</p> <p>The best book I've found is "The Definitive Guide to Windows Installer" by Phil Wilson, but it's not very beginner friendly.</p> <p>I've been asked to make recommendations for those wishing to 'get up to speed' quickly and don't know what...
<p>There are very little difference between 2005 and 2008 from native C++ developer point of view. However, if coming from 2003, it makes sense to upgrade directly to 2008 - the conversion process should be almost the same, and you will end up with a slightly better platform. Some new features which are available for 2...
<p>Visual C++ 2008 have dropped support for single threaded runtime library. I don't think it really matters though.</p>
36,454
<p>For a file containing the given class, SomeCoolClass, what would be the proper or standard filename?</p> <pre> 1. somecoolclass.rb 2. some_cool_class.rb 3. some-cool-class.rb 4. SomeCoolClass.rb </pre> <p>or some other variation?</p> <p>I noticed in the Ruby stdlib, versions 1, 2 and 3 are used.</p>
<p>With just <a href="http://www.ruby-lang.org" rel="noreferrer">Ruby</a> (i.e. not Rails), naming is only a convention. In <a href="http://rubyonrails.org" rel="noreferrer">Rails</a> the <a href="http://itsignals.cascadia.com.au/?p=7" rel="noreferrer">convention</a> of using underscores is necessary (almost).</p> <p...
<p>I would recommend lower case characters with underscores (number 2 in your question). It's true that this naming scheme is the convention in Rails and not necessary in non-Rails projects. However, I would still stick to the Rails convention because most Ruby programmers are probably using Ruby exclusively for Rails ...
27,271
<p>I'm trying to parse an INI file using C++. Any tips on what is the best way to achieve this? Should I use the Windows API tools for INI file processing (with which I am totally unfamiliar), an open-source solution or attempt to parse it manually?</p>
<p>You can use the Windows API functions, such as <a href="https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getprivateprofilestring" rel="noreferrer">GetPrivateProfileString()</a> and <a href="https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getprivateprofileint" rel="norefer...
<p>Maybe a late answer..But, worth knowing options..If you need a cross-platform solution , definitely you can try GLIB,, its interesting.. (<a href="https://developer.gnome.org/glib/stable/glib-Key-value-file-parser.html" rel="nofollow">https://developer.gnome.org/glib/stable/glib-Key-value-file-parser.html</a>)</p>
3,370
<p>I'm using VS 2008 to create a C++ DLL (not managed) project and I need convert a char* to a long long type. Is there an easy way to do it?</p> <p>Thanks in advance :)</p>
<p>Try <code>_atoi64.</code> This takes <code>char*</code> and returns <code>__int64</code>.</p>
<p>Another option is using stoll() found within the string library. Takes a C++ string.</p> <pre><code>long long ll = std::stoll(mystr); </code></pre> <p><a href="http://www.cplusplus.com/reference/string/stoll/" rel="nofollow">Docs</a></p>
39,025
<p>Seems like a simple problem:</p> <ul> <li>I have an SVN repo inside our firewall. </li> <li>I have an SVN repo outside our firewall.</li> <li>I have users inside, and outside, the firewall. (no VPN isn't an option :( that'd be too easy)</li> <li>machines inside the firewall CAN talk to the outside SVN server. But n...
<p>I'd recommend <a href="http://svk.bestpractical.com/view/HomePage" rel="noreferrer">SVK</a> or <a href="http://git-scm.com/docs/git-svn" rel="noreferrer">git-svn</a>.</p> <p>Both of these let you create an external mirror of your svn repository, and allow the external devs to make commits directly to the external m...
<p>One thing you could try is to replicate the repo at file level. I am using FolderShare (<a href="http://www.foldershare.com" rel="nofollow noreferrer">http://www.foldershare.com</a> - runs on Windows and Mac) for a similar scenario, though I am replicating it only for backup purposes and have not tried to connect us...
17,903
<p>How can I AutoIncrement the assembly (build) number in Visual Studio?</p> <h3>Duplicate:</h3> <p><a href="https://stackoverflow.com/questions/650/">/questions/650/automatically-update-version-number</a></p>
<p>You can just use a wildcard in the <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assemblyversionattribute.assemblyversionattribute.aspx" rel="noreferrer">AssemblyVersionAttribute</a>:</p> <pre><code>[assembly: AssemblyVersion("1.0.*")] </code></pre> <p>This will cause build to be equal to the ...
<p>Setting it as such should do so:</p> <pre><code>[assembly: AssemblyVersion("1.0.*.*")] </code></pre>
24,733
<p>MessageBox.Show has forms like MessageBox.Show( ownerWindow, .... ).</p> <p>What do I gain by assigning a owner window?</p>
<p>A message box is a modal form, which means that its parent window is disabled until the message box is dismissed.</p> <p>If a Show() overload is called that does not take an owner identifier, then a parent form is usually chosen automatically. I can't find anything in the documentation that describes how that form ...
<p>if i'm not wrong this prevents to owner window to Focus() until the messagebox is closed.</p>
23,764
<p>Seems to me most of developers completely ignore this features. People prefer handling security exceptions as generic ones relying on standard windows roles and rights instead of learning to use CAS ways of enhancing security - probably because CAS is quite confusing in its logic and naming.</p> <p>Can anyone sugge...
<p>Yes and no.</p> <p>Unfortunately, you're right - developers rarely use CAS at all, let alone utilize it to it's fullest. In very few situations do I see them actually doing this (okay, its not really the programmers but the organization forcing them....) </p> <p>Besides being used to allow users to limit assembli...
<p>See also <a href="https://stackoverflow.com/questions/169951/using-the-net-framework-security-system">this discussion</a>.</p> <p>The problem is exacibated because a lot of code (perhaps too much) runs at full trust. And then the only checks that get done are things like PrincipalPermissionAttribute checks - most o...
20,606
<p>My colleague has found himself in an "interesting" situation. He is working on a Silverlight (2.0) prototype that needs to call existing web services in the enterprise and bind the returned data to data-display controls. The thing is, the web services return .NET DataSets (they are not about to change existing imple...
<p>AFAIK, when a .NET web service returns a DataSet, it returns its XML representation (which is pretty friendly). The fact that a .NET client can consume the DataSet directly only abstracts the fact that an Xml Serialization-Deserialization is taking place. </p> <p>So I would manually query the web services you requi...
<p>The dangers and general nastyness of Datasets eh. I would use a generic proxy that is responsible for consuming the webmethod and transforming the dataset into xml/json</p>
11,773
<p>I have a program that needs to run as a separate NT user to connect to a SQL Server databases. For running a program itself, this isn't a big deal as I can just right click on it in windows explorer and select run as. Is there any way to run my tests as a different user as well? (it would be nice if I could do so...
<p>The generic information is lost in runtime. There is no runtime equivalent of a Creator&lt;String>.class. You could create a type between Creator and StringCreator which fixes the generic type:</p> <pre><code>public interface Creator&lt;T&gt; { T create(); } public interface StringCreator extends Creator&lt...
<p>Not quite sure why you're using generics here.</p> <p>The instantiation of the object using reflection would suggest a general use but presumably you're going to call <code>create</code> at some point and assign the result to a <code>String</code>, otherwise why use the generics to control the return type.</p> <p>...
46,494
<p>Consider a database table holding names, with three rows:</p> <pre><code>Peter Paul Mary </code></pre> <p>Is there an easy way to turn this into a single string of <code>Peter, Paul, Mary</code>?</p>
<p>If you are on SQL Server 2017 or Azure, see <a href="https://stackoverflow.com/a/42778050/1178676">Mathieu Renda answer</a>.</p> <p>I had a similar issue when I was trying to join two tables with one-to-many relationships. In SQL 2005 I found that <code>XML PATH</code> method can handle the concatenation of the rows...
<pre><code> declare @phone varchar(max)='' select @phone=@phone + mobileno +',' from members select @phone </code></pre>
23,677
<p>I have a support environment where we connect to many of our customers' systems using VPN and Remote Desktop. Right now, support personnel have to manually set up the VPN connection on their workstation. Is there a way to programmatically create the VPN connection?</p>
<p>Check out the DotRas project on CodePlex, the RasPhoneBook component has full support over managing phone books used by Windows.</p> <p><a href="http://www.codeplex.com/DotRas" rel="noreferrer">http://www.codeplex.com/DotRas</a></p> <p>It'll be a lot easier than working with the APIs directly, that much I can guar...
<p>You need a batch script to connect to a VPN that is set up on the base machine. I had a similar problem to deal with a while ago and I found <a href="http://www.msfn.org/board/Connect-VPN-cmdexe-vi-t113128.html" rel="nofollow noreferrer">this</a> and <a href="http://technet.microsoft.com/en-us/library/cc779544.aspx"...
41,123
<p>I have an application with my object types that inherit from a base class that contains the majority of properties for the application objects. All the object types are stored in one table in the database. The "ClassType" column determines what object type I cast the SqlDataReader row to. </p> <p>Here is my curr...
<p>I guess I would lean towards an Object-Relational Mapper for this. <a href="http://www.hibernate.org/343.html" rel="noreferrer">NHibernate</a> is an example of an existing, free, mature ORM solution for the .NET platform.</p>
<p>LINQ to SQL might be a legitimate option. However, It does not play very well with databases that are not properly constrained with Primary and Foreign keys. It will generate the class based on the tables.</p>
38,535
<p>I've started with ASP.NET MVC recently, reading blogs, tutorials, trying some routes, etc. Now, i've stumbled on a issue where i need some help.</p> <p>Basically, i have an URL like /products.aspx?categoryid=foo&amp;productid=bar</p> <p>Most tutorials/examples propose to map this to something like: /products/categ...
<p><em>(your English is just fine, no need to apologize!)</em></p> <p>You can define a route like this:</p> <pre><code>routes.MapRoute("productsByCategory", "products/{category}/{productid}", new { controller="products", action="findByCategory" }) </code></pre> <p>This will match</p> <p><code>products/foo/bar</co...
<p>You also might consider making a Controller to test out your custom routes...</p> <p>Check out <a href="http://weblogs.asp.net/stephenwalther/archive/2008/08/03/asp-net-mvc-tip-29-build-a-controller-to-debug-your-custom-routes.aspx" rel="nofollow noreferrer">Stephen Walther's blog entry</a> about it.</p>
16,929
<p>We have an Apache ANT script to build our application, then check in the resulting JAR file into version control (VSS in this case). However, now we have a change that requires us to build 2 JAR files for this project, then check both into VSS.</p> <p>The current target that checks the original JAR file into VSS d...
<p>I would suggest to work with <a href="http://ant.apache.org/manual/Tasks/macrodef.html" rel="nofollow noreferrer">macros</a> over subant/antcall because the main advantage I found with macros is that you're in complete control over the properties that are passed to the macro (especially if you want to add new proper...
<p>You can use <a href="http://gant.codehaus.org/" rel="nofollow noreferrer">Gant</a> to script your build with <a href="http://groovy.codehaus.org" rel="nofollow noreferrer">groovy</a> to do what you want or have a look at the <a href="http://groovy.codehaus.org/The+groovy+Ant+Task" rel="nofollow noreferrer">groovy an...
7,249
<p>Which cryptography algorithm is the most secure that ships with .net?</p>
<p>You cannot directly compare all types of cryptographic algorithms. That would be like comparing a sorting algorithm with a multiplication algorithm: they have different purposes. That being said, I would answer:</p> <ul> <li>Symmetric cipher: <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptogr...
<p>I'm somewhat partial to <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx" rel="nofollow noreferrer">SHA-512</a>. If 512 is a little excessive, the other members of the SHA-2 family might be helpful - <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptograph...
32,295
<p><a href="http://www.w3.org/TR/xhtml1/#C_2" rel="noreferrer">W3C recommends putting a space before the closing tag in XHTML</a>, because this would give a better backwards compability with some browsers, e.g. write <code>&lt;br /&gt;</code> instead of <code>&lt;br/&gt;</code>. But are there still browsers out there, ...
<p>It's for Netscape 4.</p> <p>I still include it out of habit, and my templating library will put them in for me anyway, but it's questionable whether it's really that important today.</p>
<p>If there are still browsers that rely on the space use it. </p> <p>The amount of bytes saved does not justify the possible problems.</p>
39,279
<p>Is it possible to determine whether a particular youtube video is encoded with H.264 or FLV through the YouTube data API? If so, how? </p> <p>I can start a file download and check how the video stream was encoded (programmatically, of course), but I'd like to use the YouTube data API to avoid all that overhead.</p>...
<p>2000 and 365 are Integer values. In VBA, Integers are 16-bit signed types, when you perform arithmetic on 2 integers the arithmetic is carried out in 16-bits. Since the result of multiplying these two numbers exceeds the value that can be represented with 16 bits you get an exception. The second example works bec...
<p>In VBA, literals are integer by default (as mentioned). If you need to force a larger datatype on them you can recast them as in the example above or just append a type declaration character. (The list is here: <a href="http://support.microsoft.com/kb/191713" rel="nofollow noreferrer">http://support.microsoft.com/kb...
40,841
<p>I can currently to the following:</p> <pre><code>class SubClass extends SuperClass { function __construct() { parent::__construct(); } } class SuperClass { function __construct() { // this echoes "I'm SubClass and I'm extending SuperClass" echo 'I\'m '.get_class($this).' and I\'m extending '.__CL...
<p>You can use Reflection.</p> <pre><code>$ref = new ReflectionObject($this); $ref-&gt;getFileName(); // return the file where the object's class was declared </code></pre>
<p>Uh, not really, that I can think of. Each subclass would need to have an explicitly implemented method that returned <code>__FILE__</code>, which completely defeats the point of inheritance in the first place.</p> <p>I'm also really curious as to why something like this would be useful. </p>
24,726
<p>I am looking to use Java to get the MD5 checksum of a file. I was really surprised but I haven't been able to find anything that shows how to get the MD5 checksum of a file.</p> <p>How is it done?</p>
<p>There's an input stream decorator, <code>java.security.DigestInputStream</code>, so that you can compute the digest while using the input stream as you normally would, instead of having to make an extra pass over the data.</p> <pre><code>MessageDigest md = MessageDigest.getInstance("MD5"); try (InputStream is = Fil...
<p>If you're using ANT to build, this is dead-simple. Add the following to your build.xml:</p> <pre><code>&lt;checksum file="${jarFile}" todir="${toDir}"/&gt; </code></pre> <p>Where jarFile is the JAR you want to generate the MD5 against, and toDir is the directory you want to place the MD5 file.</p> <p><a href="ht...
39,092
<p>I have a long form that the user has to fill out. </p> <p>So I broke the form into logical units and created another user control for some elements (they will be reused elsewhere).</p> <p>So say the form has these fields:</p> <p>UserControl3.ascx</p> <p>Username password email -- usercontrol2.ascx address ...
<p>do as Java: pack it all in a zip, and use an filesystem-like API to read directly from there.</p>
<p>Short answer: yes.</p> <p>In Mac OS 6,7,8 there was a substantial API devoted to this exact task. Lookup the "Resource Manager" if you are interested. Edit: So does the <A href="http://root.cern.ch/" rel="nofollow noreferrer">ROOT</A> physics analysis package.</p> <p>Not that I know of a good tool right now. What ...
25,225
<p>How do I know what nozzle to get for my Anet A6 printer? I want to get some hardened nozzles because I would love to print with some glow in the dark filament, but I know that eats up brass nozzles fast. But there is so many thread differences so I don't know which one to get, or even what thread the Anet A6 is. Cou...
<p>The <a href="https://www.creaform3d.com/en/customer-support/legacy-products/exascan-scanner" rel="nofollow noreferrer">Creaform EXAscan</a> is according to the manufacturer a laser based machine. This means that it determines data points and their positions by some triangonometry done with a laser, 32.000 times a se...
<p>So if the original manufacturer still exists, <a href="https://www.creaform3d.com/en/customer-support/legacy-products/exascan-scanner" rel="nofollow noreferrer">(which they appear to, and even list your scanner under 'legacy' products)</a> your best chance of getting it working is going to be to contact them directl...
869
<p>I have an x64 server which, since my libraries are compiled to AnyCPU, run under x64. We are needing to access a COM component which is registered under x86. I don't know enough about COM and my google searches are leading me nowhere.</p> <p>Question: Can I use a symbolic registry link from x64 back to x86 for th...
<p>If a component is running x64-native, it can't load a 32-bit COM server in-process, because it's the wrong sort of process. There are a couple of solutions possible:</p> <ol> <li><p>If you can, build a 64-bit version of the COM code (which would of course register itself in the 64-bit registry). This is the cleanes...
<p>It's your COM component is housed in a COM server (ie a seperate process) then you won't need to do anything special as the COM subsystem will remote your calls from your x64 app to the X86 app and back again.</p> <p>If your component is an in-process COM component then you'll have to rethink things as a 64 bit pro...
46,867
<p>I've been trying with limited success to export a crosstab query result set to Excel using Access 2003. Occasionally, the export works correctly, and Excel shows with no errors. Other times, using the exact same query parameters, I get a 3190 error - too many fields. I am using the TransferSpreadsheet option in a ma...
<p>I've got one working as an MS Access Macro. It uses an OutputTo Action with:</p> <ul> <li>Object Type=Query</li> <li>Object Name=[WhateverQueryName]</li> <li>Output Format=MicrosoftExcel(*.xls)</li> <li>Auto Start=No</li> <li>(all the rest blank)</li> </ul> <p>I hate using Macros in MS Access (it feels unclean), b...
<p>A workaround would be to append the query to a table first and then export that. </p> <pre><code>DoCmd.SetWarnings False DoCmd.OpenQuery "TempTable-Make" DoCmd.RunSQL "DROP TABLE TempTable" ExportToExcel() DoCmd.SetWarnings True </code></pre> <p>TempTable-Make is a make-table query based on the crosstab.</p> ...
45,337
<p>I'm investigating the following <code>java.lang.VerifyError</code></p> <pre><code>java.lang.VerifyError: (class: be/post/ehr/wfm/application/serviceorganization/report/DisplayReportServlet, method: getMonthData signature: (IILjava/util/Collection;Ljava/util/Collection;Ljava/util/HashMap;Ljava/util/Collection;Ljava/...
<p><code>java.lang.VerifyError</code> can be the result when you have compiled against a different library than you are using at runtime.</p> <p>For example, this happened to me when trying to run a program that was compiled against Xerces 1, but Xerces 2 was found on the classpath. The required classes (in <code>org...
<p>In my case, I was getting verify error with below stack trace</p> <pre><code>jasperreports-server-cp-6.4.0-bin\buildomatic\build.xml:61: The following error occurred while executing this line: TIB_js-jrs-cp_6.4.0_bin\jasperreports-server-cp-6.4.0-bin\buildomatic\bin\setup.xml:320: java.lang.VerifyError: (class: org...
12,533
<p>I wanted to see if folks were using decimal for financial applications instead of double. I have seen lots of folks using double all over the place with unintended consequences . .</p> <p>Do you see others making this mistake . . .</p>
<p>We did unfortunately and we regret it. We had to change all doubles to decimals. Decimals are good for financial applications. You can look at this article <a href="http://www.codeproject.com/KB/recipes/MoneyTypeForCLR.aspx" rel="nofollow noreferrer">A Money type for the CLR</a>:</p> <blockquote> <p>A convenient...
<p>I have always used Decimal. At least when I had a language that supports it. Otherwise, rounding errors will kill you.</p>
28,764
<p>I have MAMP set up on my iMac and on my Macbook. I want to keep both installs synced using <a href="http://www.getdropbox.com" rel="noreferrer">dropbox</a>. When upgrading MAMP the only 2 folders you need to transfer are 'db' &amp; 'htdocs'. My theory is then that these are the only 2 folders I need to keep in sync....
<p>What I ended up doing was putting my hotdocs folder into my dropbox and changing the path in MAMP to the dropbox version. I than asked a friend to set up a few mysql remote databases for me. This combination has been working great. I have to use Sequel Pro to access the database which is a nice app. I was originally...
<p>Ok, so I am thinking that my solution is going to have to be a combination of chronosync <a href="http://www.econtechnologies.com/site/Pages/ChronoSync/chrono_overview.html" rel="nofollow noreferrer">http://www.econtechnologies.com/site/Pages/ChronoSync/chrono_overview.html</a> &amp; dropbox.</p> <p>Have a copy of ...
41,462
<p>What tips and "standards" do you use in your Redmine project management process?</p> <p>Do you have a standard wiki insert template you could share or a standard way to work a project using bugs features tasks and support issues?</p> <p>Do you let issues and updates get emailed into Redmine? Do you use the forums...
<p>I'm a freelance Ruby and Redmine web developer who runs a development business of one (me). So my Redmine is setup to be pretty lightweight and customer focused. My Redmine also serves double duty for hosting my Open Source projects.</p> <p>I do allow new issues and updates to be emailed and it works great for em...
<p>We are using the Roadmap section as a clear way to display:</p> <ul> <li>bugs</li> <li>features (that would be references to your word document, or link to html requirement pages)</li> <li>reconciliations (differences between production values and test values)</li> <li>and so on...</li> </ul> <p>That is the main p...
28,770
<p>Here's the problem:</p> <p>In C# I'm getting information from a legacy ACCESS database. .NET converts the content of the database (in the case of this problem a string) to Unicode before handing the content to me.</p> <p>How do I convert this Unicode string back to it's ASCII equivalent?</p> <p><hr> <strong>Edit<...
<p>Okay, let's elaborate. Both <a href="https://stackoverflow.com/questions/138449/how-to-convert-a-unicode-character-to-its-extended-ascii-equivalent#138579">csgero</a> and <a href="https://stackoverflow.com/questions/138449/how-to-convert-a-unicode-character-to-its-extended-ascii-equivalent#138583">bzlm</a> pointed i...
<p>Hmm … I'm not sure which character you mean. The caret (“^”, CIRCUMFLEX ACCENT) has the same code in ASCII and Unicode (U+005E).</p> <p>/EDIT: Damn, my fault. 710 (U+02C6) is actually the MODIFIER LETTER CIRCUMFLEX ACCENT. Unfortunately, this character isn't part of ASCII at all. It might look like the normal caret...
16,764
<p>I have two tables:</p> <p>Table 1: ID, PersonCode, Name, </p> <p>Table 2: ID, Table1ID, Location, ServiceDate</p> <p>I've got a query joining table 1 to table 2 on table1.ID = table2.Table1ID where PersonCode = 'XYZ'</p> <p>What I want to do is return Table1.PersonCode,Table1.Name, Table2.Location, Table2.Servic...
<p>Something like this:</p> <pre><code>SELECT Table1.PersonCode, Table1.Name, Table2.Location, MAX(Table2.ServiceDate) FROM Table1 INNER JOIN Table2 on Table1.ID = Table2.Table1ID WHERE TABLE1.PersonCode = 'XYZ' GROUP BY Table1.PersonCode,Table1.Name, Table2.Location </code></pre>
<p>Use MAX(ServiceDate)</p>
31,694
<p>In python is it possible to get or set a logical directory (as opposed to an absolute one).</p> <p>For example if I have:</p> <pre><code>/real/path/to/dir </code></pre> <p>and I have</p> <pre><code>/linked/path/to/dir </code></pre> <p>linked to the same directory.</p> <p>using os.getcwd and os.chdir will alway...
<p>The underlying operational system / shell reports real paths to python. </p> <p>So, there really is no way around it, since <code>os.getcwd()</code> is a wrapped call to C Library <code>getcwd()</code> function.</p> <p>There are some workarounds in the spirit of the one that you already know which is launching <co...
<p>This also does the trick for me:</p> <pre><code>import os os.popen('pwd').read().strip('\n') </code></pre> <p>Here is a demonstration in python shell:</p> <pre><code>&gt;&gt;&gt; import os &gt;&gt;&gt; os.popen('pwd').read() '/home/projteam/staging/site/proj\n' &gt;&gt;&gt; os.popen('pwd').read().strip('\n') '/ho...
15,077
<p>Is it possible to run a batch file as a menu item in studio 2008?</p>
<p>Yes, go to <strong>Tools | External Tools</strong> in the menus and add your batch file as the Command. You can also pass in any arguments that you want such as the build target, project directories, etc.</p> <p>Once you do this, your batch file will appear as one of the items on your tools menu. If you want, you c...
<p>Use "Tools"/"External Tools..." menu item and add your bat-file to "Tools" menu</p>
44,921
<p>I've got a table with a header, a row with input fields, rows with data. <a href="http://brow.hu/sitegen/stackoverflow_table_example.png" rel="nofollow noreferrer">Like this. http://brow.hu/sitegen/stackoverflow_table_example.png</a></p> <p>If somebody enters something into an input field I want to filter the data ...
<p>One way to avoid flicker is called double-buffering. In Ajax, this can be done simply with 2 divs occupying the same space, one of them with the style 'display: none', the other 'display: inline'. Always write to the invisible one, and then swap display styles. If the divs have absolute positioning and size, there i...
<p>It blinks because you're completely replacing the table ... if you add rows to or delete rows from the existing table and then load your AJAX data into the resulting table it won't blink.</p>
23,840
<p>I have an intel assembly assignment. I need to write a calculator which uses 2 stacks. For example, i have an expression like 23+4/2^4$ .So that $ indicates the end of expression. What I will do is to have two stacks, one for numbers, one for operators and push and pop them according to the operator precedence.</p> ...
<p>I think what you're looking for is Dijkstra's shunting algorithm.</p> <p>I have solved it without using stacks during interpretation, only during execution as described <a href="http://www.guge.net/?p=3#more-3" rel="nofollow noreferrer">in my blog.</a></p> <p>As for making extra stacks, it is quite easy. All a sta...
<p>So, am I right to create two stacks like this:</p> <pre><code>mov ecx,256 L1: call ReadInt push eax ;push the integer to where esp=1 points add esp,ecx ;esp=1+256=257, now esp points to 257. call ReadChar ;read operand cmp al,endChar ;compare with end sign=$ je next ...
47,750
<p>I'm on a beginner level course in prolog, doing a map colouring problem. Here's my code.</p> <pre><code>col(Colors,Map,Coloring) :- checkMap(Colors,Map,Coloring). checkMap(Colors,[Country1:Country2],Coloring) :- goodColor(Country1:Country2,Coloring,Colors). checkMap(Colors,[Country1:Country2|Rest],Coloring)...
<p>Using an incomplete data structure is a valid Prolog programming technique. If your intention is to use an incomplete data structure then one solution is:</p> <pre><code>ground_terms([H|T1],[H|T2]) :- ground(H), !, ground_terms(T1,T2). ground_terms(_,[]). </code></pre> <p>and change col as follows:</p> <pre><code...
<p>The trailing variable is there because <code>mem(Var,[Var|_])</code> binds the unbound <code>Coloring</code> variable to <code>[Var|_]</code>.</p> <p>One way to avoid it is to accumulate the map coloring e.g (very quick and extremely dirty):</p> <pre><code>col(Colors,Map,Coloring) :- check(Colors,Map,[],Colori...
36,145
<p>I am trying to use MinGW to compile a C program under Windows XP. The gcc.exe gives the following error:</p> <p><strong>stdio.h : No such file or directory</strong></p> <p>The code (hello.c) looks like this:</p> <pre><code>#include &lt; stdio.h &gt; void main() { printf("\nHello World\n"); } </code></pre> <...
<p>Try changing the first line to:</p> <pre><code>#include &lt;stdio.h&gt; </code></pre> <p>without the spaces. It is trying to look for a file called " stdio.h " with a space at the beginning and end.</p>
<p>You can use</p> <p>$ sudo apt-get install build-essential</p> <p>to solve this problem</p>
10,745
<p>Using Microsoft Visual Studio 98, Microsoft Visual C++ 6.0 SP6</p> <p>When running under the debugger, there's only one problem. If I pause the program and resume, everything's fine.</p> <p>The problem? When I hit a breakpoint, my program stops. But not in a good way; execution halts, I'm thrown out of debug mo...
<p>Stop beating on VC6. It's old. The STL was updated in 1996 from HP code written in 1994. C++ was ratified in 1998.</p> <p>What is the code doing when you are breaking? Can you reduce the situation into a simple test. When I try that I usually find the cause. If you can do that so it still happens then I'll take a l...
<p>I haven't used MSVC6 in years, but I remember the debugger basically being a flaky piece of crap. Things like this would regularly happen for no apparent reason because it just didn't like your code that day.</p> <p>In addition to the debugger being a flaky piece of crap, the rest of it was too.</p> <p>It's STL im...
2,986
<p>What is the best jQuery status message plugin?</p> <p>I like <a href="http://plugins.jquery.com/project/jgrowl" rel="noreferrer">jGrowl</a> and <a href="http://plugins.jquery.com/project/purr" rel="noreferrer">Purr</a>, but jGrowl doesn't have the feature to remain sticky (not close automatially) and Purr doesn't s...
<p>jGrowl does look to have sticky - see sample 2 in the demo page:</p> <p><a href="https://github.com/stanlemon/jGrowl" rel="nofollow noreferrer">https://github.com/stanlemon/jGrowl</a></p> <p>...ah - or did you mean after the page has reloaded?</p> <p>I would then handle this on the server side - i.e. include a si...
<p>There is a pretty nice humanized message one here: <a href="http://www.websanova.com/plugins/humanmsg/jquery#websanova" rel="nofollow">http://www.websanova.com/plugins/humanmsg/jquery#websanova</a></p>
24,633
<p>I know that I can share files using Shared Folders in Virtual PC, but this method seems to have pretty poor performance. Is there another method to share files that provides better performance? (Besides using something other than Virtual PC)</p>
<p>The best way to do it is probably set up proper bridge network connection between host machine and VM.</p>
<p>Using VirtualBox, I had problems setting up shared folders (I tried setting it up, and it wasn't working intuitively right away, so I got fed up with it). Thus, I just ftp'ed to the host OS (which I already had set up since I was on Linux), and transfered the file that way.</p> <p>I would suggest timing transferri...
18,239
<p>Can anyone recommend a good repository viewer for Git, similar to gitk, that works on Mac OS X Leopard? (I'm not saying gitk doesn't work)</p> <p>Of course I would like a native Mac application, but as I haven't found any, what are the best options to gitk?</p> <p>I know about gitview, but I'm looking forward to e...
<p>There's also <a href="http://www.gitx.org" rel="noreferrer">gitx</a>, it's progressing well and under active development (multiple commits per day).</p>
<p>You should checkout Sprout (formerly GitMac). <a href="http://sproutmacapp.com" rel="nofollow">http://sproutmacapp.com</a> it focuses on making Git easy, and browsing and committing changes in your projects</p> <p><a href="http://sproutmacapp.com" rel="nofollow">http://sproutmacapp.com</a> </p>
4,954
<p>So, I'd like to be able to set the max log file size to 64M, but after doing so with <code>innodb_log_file_size=64M</code> MySQL starts OK, but nothing seems to work properly. </p> <p><strong>EDIT:</strong> and by properly I mean not at all. Setting other InnoDB variables aren't causing any problems.</p> <p>How sh...
<p>Make sure MySQL shuts down cleanly, and delete (or move elsewhere) all <code>ib_logfile*</code> files from MySQL data directory (<code>/var/lib/mysql/</code> usually).</p> <p>I've tested it and worked for me. Here's <a href="http://mysqldatabaseadministration.blogspot.com/2007/04/innodb-performance-optimization.htm...
<p>Before changing the <a href="http://dev.mysql.com/doc/refman/5.6/en/innodb-parameters.html#sysvar_innodb_log_file_size" rel="nofollow"><strong>innodb_log_file_size</strong></a>, you must flush all remaining transactional data out of it. You simply set <a href="http://dev.mysql.com/doc/refman/5.6/en/innodb-parameters...
40,630
<p>I am a firm believer in the idea that one of the most important things you get from learning a new language is not how to use a new language, but the knowledge of concepts that you get from it. I am not asking how important or useful you think Assembly is, nor do I care if I never use it in any of my real projects. ...
<p>I think assembly language can teach you lots of little things, as well as a few big concepts.</p> <p>I'll list a few things I can think of here, but there is no substitute for going and learning and using both x86 and a RISC instruction set.</p> <p>You probably think that integer operations are fastest. If you wan...
<p>Nowadays, x86 asm is not a direct line to the guts of the CPU, but more of an API. The assembler opcodes you write are themselves are compiled into a completely different instruction-set, rearranged, rewritten, fixed-up and generally mangled beyond recognition.</p> <p>So it's not like learning assembler gives you a...
17,682
<p>I have a template in word (.docx) format and want to replace some placeholders in this template with my own data, do you know where I can find the right classes for this project? It would be nice for me to know the namespace. Are there any newer classes for handling word documents in the docx format (xml) than the c...
<p>The new office formats (docx, xlsx, etc) are zip files that contain a collection of xml files. With that in mind you have a couple of approaches.</p> <ol> <li><p>You can use the Open XML SDK located at <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=AD0B72FB-4A1D-4C52-BDB5-7DD7E816D046&amp;displa...
<p>By the way using xml I found this solution that finds ALL sdt-nodes</p> <pre><code> NameTable nt = new NameTable(); XmlNamespaceManager nsManager = new XmlNamespaceManager(nt); nsManager.AddNamespace("w", wordmlNamespace); XmlDocument xDoc = new XmlDocument(); xDoc.Load(doc.MainDocu...
22,029
<p>I would like to replicate a MSSQL 2005 db (hosting through a shared hosting provider) directly on an integration server for development purposes. MSSQL server provides quite a few ways of performing data replication, but I am not sure that any of them is compatible with a typical shared hosting environment.</p> <p>...
<p>There are couple of ways of doing it.</p> <ol> <li><p>Use SQL Server 2005 copy function, but it would fail if SQL Agent is not ruining or there is any permission restriction - mostly like to happen with shared hosting.</p></li> <li><p>Use SQL Server backup/restore: the problem is usually you don't have access to th...
<p>Try the SQL Server Publishing Wizard 1.2, which is included with VS 2008. Or download the 1.1 version here:</p> <p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&amp;displaylang=en" rel="nofollow noreferrer">http://www.microsoft.com/downloads/details.aspx?fami...
46,147
<p>Suppose I have the following C code.</p> <pre><code>unsigned int u = 1234; int i = -5678; unsigned int result = u + i; </code></pre> <p>What implicit conversions are going on here, and is this code safe for all values of <code>u</code> and <code>i</code>? (Safe, in the sense that even though <em>result</em> in th...
<p><strong>Short Answer</strong></p> <p>Your <code>i</code> will be <em>converted</em> to an unsigned integer by adding <code>UINT_MAX + 1</code>, then the addition will be carried out with the unsigned values, resulting in a large <code>result</code> (depending on the values of <code>u</code> and <code>i</code>).</p>...
<p><strong>Horrible Answers Galore</strong></p> <p><em>Ozgur Ozcitak</em></p> <blockquote> <p>When you cast from signed to unsigned (and vice versa) the internal representation of the number does not change. What changes is how the compiler interprets the sign bit.</p> </blockquote> <p>This is completely w...
7,342
<p>Just received my new Ender 3 v2. When using the Auto Home feature, the Y-axis motor drives the bed as far back as possible then the motor grinds for about 10-15 seconds. The Y-axis limit switch is not being depressed and the limit stop is about .5 inches away from the switch. The control unit locks at this point and...
<p>You could still get heat creep with a Bowden tube. It has different characteristics. Instead of jamming up in the direct drive, the filament can melt too far upwards into the heat break where it can refreeze and jam. The characteristic, if you can pull out the filament, is widened filament extending into the heat...
<p><em>Answer created from octopus8's comments. If octopus8 wants to post their own answer, this wiki answer can be deleted.</em></p> <hr /> <p>185 °C is quite ok for several PLAs I have when printing slow.</p> <p>Honestly, I couldn't believe that the heat can go up the heatsink and Bowden tube to make extruder frame h...
1,888
<p>I have (simplified for the example) a table with the following data</p> <pre><code>Row Start Finish ID Amount --- --------- ---------- -- ------ 1 2008-10-01 2008-10-02 01 10 2 2008-10-02 2008-10-03 02 20 3 2008-10-03 2008-10-04 01 38 4 2008-10-04 2008-10-05 01 ...
<p>If you read the book "Developing Time-Oriented Database Applications in SQL" by <a href="http://www.cs.arizona.edu/~rts/" rel="nofollow noreferrer">R T Snodgrass</a> (the pdf of which is available from his web site under publications), and get as far as Figure 6.25 on p165-166, you will find the non-trivial SQL whic...
<p>Well I decided to go down the iteration route using a mixture of joins and cursors. By JOINing the data table against itself I can create a link list of only those records that are consecutive. </p> <pre><code>INSERT INTO #CONSEC SELECT a.ID, a.Start, b.Finish, b.Amount FROM Data a JOIN Data b ON (a.Finis...
29,144
<p>We are using trac and are really satisfied with it. However, out of the box, trac is best suited for single-project environments only. I'd be interested to hear about the various approaches people take to make it work with multiple projects nevertheless and their experiences with them. Are there any plugins to recom...
<p>The approach we took is to create another trac environment for each new project and set up <a href="http://trac.edgewall.org/wiki/InterTrac" rel="noreferrer">InterTrac</a> links for simpler cross-referencing between the two. We also use a common base <a href="http://trac.edgewall.org/wiki/TracIni" rel="noreferrer">T...
<p>Same feeling here, Trac is really nice once configured properly. And it's easily hackable without touching any code. I only wish the wiki syntax were something more common, like markdown.</p> <p>We took the approach of using one Trac instance. We didn't need/want to use tight ACL and it has the benefit to keep all ...
33,629
<p>What do search engine bots use as a starting point? Is it DNS look-up or do they start with some fixed list of well-know sites? Any guesses or suggestions?</p>
<p>Your question can be interpreted in two ways:</p> <p>Are you asking where search engines start their crawl from in general, or where they start to crawl a particular site?</p> <p>I don't know how the big players work; but if you were to make your own search engine you'd probably seed it with popular portal sites. ...
<p>You can submit your site to search engines using their <a href="http://www.google.com/addurl/" rel="nofollow noreferrer">site submission forms</a> - this will get you into their system. When you actually get crawled after that is impossible to say - from experience it's usually about a week or so for an initial craw...
6,271
<p>When installing and using a new hotend for the first time, which steps of action should be taken before. This will probably be more applicable to chinese clones than to authentic products (is the statement true?): <strong>Should a certain cleaning procedure be carried out</strong> (removing swarf/shavings for exampl...
<p>I haven't done anything special to set up mine. But it's probably worth doing a general cleaning. I'd swab it off with alcohol, including running a q-tip or similar inside the fiber feed path. Then blow out the nozzle with compressed air to make sure it's clear.</p> <p>You could measure the nozzle diameter by fitti...
<p>I haven't done anything special to set up mine. But it's probably worth doing a general cleaning. I'd swab it off with alcohol, including running a q-tip or similar inside the fiber feed path. Then blow out the nozzle with compressed air to make sure it's clear.</p> <p>You could measure the nozzle diameter by fitti...
167
<p>I need to insert records into a table that has no primary key using LINQ to SQL. The table is poorly designed; I have NO control over the table structure. The table is comprised of a few varchar fields, a text field, and a timestamp. It is used as an audit trail for other entities.</p> <p>What is the best way to...
<p>LINQ to SQL isn't meant for this task, so don't use it. Just warp the insert into a stored procedure and add the procedure to your data model. If you can't do that, write a normal function with a bit of in-line SQL.</p>
<p>You might use the <a href="http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.executecommand.aspx" rel="nofollow noreferrer">DataContext.ExecuteCommand</a> method to run your own custom insert statement.</p> <p>Or, you might add a <a href="http://msdn.microsoft.com/en-us/library/bb386963.aspx" rel...
43,189
<p>I am using the ASP.Net plugin and control provided by <a href="http://recaptcha.net" rel="noreferrer">reCAPTCHA</a>. I can successfully get the control to work if the submit button on the web form is not in a validationgroup. There is no validationgroup attribute for the reCAPTCHA control. </p> <p>Has anybody had a...
<p>The reCAPTCHA ASP.NET plug-in is written to be backward-compatible with ASP.NET 1.1, which means the <code>ValidationGroup</code> concept (which is new in ASP.NET 2.0) is not supported. But the plug-in comes with <a href="http://code.google.com/p/recaptcha/downloads/list?q=label:aspnetlib-Latest" rel="nofollow noref...
<p>See ReCaptchaImage and ReCaptchaValidator controls being part of Altairis Web UI Toolkit: <a href="http://altairiswebui.codeplex.com/" rel="nofollow">http://altairiswebui.codeplex.com/</a></p> <p>It's open source set of web components, containing quite decent and ASP.NET standards-compliant (if I may say it being t...
28,638
<p>I have been using PLA filament for two years now and have had good prints. ABS on the other hand has not been so good, so my choice of filament is PLA. </p> <p>I am getting ready to do a sign for the American Legion and the colors are black, blue, and red and are 0.8 mm thin. The black letters are 4" x 2.5", blue a...
<p>I printed a handle for a rather big rolling door in natural PLA (From Fabberparts) - no UV protection. It's on the weather side of the house and is exposed to direct sun half the day.</p> <p>And after three years cycling to all the German seasons it's still absolutely fine. Also, Wikipedia told me that PLA has good ...
<p>Keep in mind that PLA has a much lower temperature point, where is starts getting flexible. I once had PLA-printed parts in my car in the summer for three hours and when I came back, they where bent. </p> <p>I don't know about the weather conditions in your local environment, but if you experience hot temperatures ...
410
<p>Is there such a thing as unit test generation? If so...</p> <p>...does it work well? </p> <p>...What are the auto generation solutions that are available for .NET?</p> <p>...are there examples of using a technology like this?</p> <p>...is this only good for certain types of applications, or could it be used to r...
<p>Take a look at <a href="http://research.microsoft.com/Pex/" rel="noreferrer">Pex</a>. Its a Microsoft Research project. From the website:</p> <p><em>Pex generates Unit Tests from hand-written Parameterized Unit Tests through Automated Exploratory Testing based on Dynamic Symbolic Execution.</em></p> <h2>UPDATE for...
<p>I've used <a href="http://code.google.com/p/nstub/" rel="nofollow noreferrer">NStub</a> to stub out test for my classes. It works fairly well.</p>
17,221
<p>It seems to me that the size of hole in the nozzle shouldn't matter in and of itself. If you program in the layer height and line width, then the same amount of plastic has to be extruded, no matter what size the hole is in the nozzle. </p> <p>Of course I understand that, mechanically, the best results are got with...
<p>CNC kitchen tested various extrusion widths with various nozzles and in fact there's no difference, only the line width matters. <a href="https://www.cnckitchen.com/blog/big-nozzles-how-do-they-make-your-3d-prints-stronger" rel="nofollow noreferrer">https://www.cnckitchen.com/blog/big-nozzles-how-do-they-make-your-3...
<p>I’m using sli3r. It use nozzle size for some auto value like auto extrusion width which calculate by 105% of nozzle diameter and prevent some error like setting layer height greater than nozzle diameter.</p>
1,655
<p>Since yesterday, I am analyzing one of our project with <a href="http://www.ndepend.com/" rel="nofollow noreferrer">Ndepend</a> (free for most of its features) and more I am using it, and more I have doubt about the real value of this type of software (code-analysis software).</p> <p>Let me explain, The system buil...
<p>Not yet, but maybe soon. First, note that your suggested query will not work at all in LINQ to Entities, with or without the property, because, at present, it doesn't support Contains. The new version of the Entity Framework in .NET 4.0, however, is supposed to support custom methods in LINQ to Entities queries. ...
<p>Craig,</p> <p>Sarted watching the video, then realised it's over an hour long, so will have to watch it when i have more time. Just to let you know though.. <strong><em>Contains</em></strong> seems to be working ok for me, here's the SQL that's generated by Linq to Entities:</p> <pre><code>SELECT 1 AS [C1], [Ext...
38,338
<p>I'm converting an application to use Java 1.5 and have found the following method:</p> <pre><code> /** * Compare two Comparables, treat nulls as -infinity. * @param o1 * @param o2 * @return -1 if o1&amp;lt;o2, 0 if o1==o2, 1 if o1&amp;gt;o2 */ protected static int nullCompare(Comparable o1, Compar...
<p>Change it to:</p> <pre><code>protected static &lt;T extends Comparable&lt;T&gt;&gt; int nullCompare(T o1, T o2) { </code></pre> <p>You need that because Comparable is itself a generic type.</p>
<p>I'm not sure that genericizing this method makes sense. Currently the method works on any kind of Comparable; if you genericize it you will have to implement it (with exactly the same code) multiple times. Sometimes it is possible to compare two objects that don't have a common ancestor, and any generic version won'...
8,358
<p>This question is about a Java JTree or a Window .Net Tree (Winforms) or an Adobe Flex Tree.</p> <p>In a client-server application (for Flex it's Web, really), I have a tree with hierarchical data (in a Windows Explorer type interface). Right now I lazily load up the tree as the user requests more data from the serv...
<p>PHP, Ruby On Rails, ASP.Net, or Java.</p> <p>It's a religious choce and it depends on who you ask.</p> <p>Everyone you ask will give you a different answer.</p> <p>You should ask yourself how you want to work, PHP java and ASP all let you write markup that is interspersed with code or code that writes the markup ...
<p>.NET platform, without a doubt.</p> <p>Pick up RoR as a secondary.</p>
36,256
<p>Am I able to embed the .net runtime so that .net is not required on the host operating system? I was looking at doing this with Mono by looking here: <a href="http://mono-project.com/Embedding_Mono" rel="nofollow noreferrer">http://mono-project.com/Embedding_Mono</a> but seems to allude to using external modules to ...
<p>You can now <a href="http://tirania.org/blog/archive/2008/Nov-05.html" rel="nofollow noreferrer">statically compile Mono assemblies</a> as was just demonstrated at PDC. The purpose of doing this was to allow .Net applications to run on the iPhone, but this should work anywhere.</p> <p>There are some limitations to ...
<p>This is not currently supported, and AFAIK there are no plans to change that status.</p> <p>There are some third party tools out there that try to do this for you, but last time I checked none were very good yet.</p>
34,003
<p>I am having an issue with SSH hanging on my Mac Book Pro. This only happens to me once I get home from work after I have used SSH while at work. The three factors I have narrowed the issue down to are SSH, our work AFS network drive and the method of network connectivity.</p> <p>At work we use an AFS drive with Ker...
<p>Can you be more specific about "SSH hanging"?</p> <p>It sounds like your ssh <strong>client</strong> hangs after losing the connection and you are unable to do anything in the terminal. To get around this, you can use the ssh escape character (default: ‘~’) to begin an escape sequence, and use the the '.' to termin...
<p>Just a shot in the dark: I recently had problems using ssh after installing Rogue Amoeba Audio Hijack Pro. I could only use ssh as super user (sudo). An Update to 2.8.1 resolved the issue...</p> <p>Also see <a href="http://www.macobserver.com/article/2008/03/19.8.shtml" rel="nofollow noreferrer">http://www.macobser...
36,725
<p>I'm using the contentEditable attribute on a DIV element in Firefox 3.03. Setting it to true allows me to edit the text content of the DIV, as expected.</p> <p>Then, when I set contentEditable to "false", the div is no longer editable, also as expected. </p> <p>However the flashing caret (text input cursor) rema...
<p>I've dealt with this and my workaround is clearing the selection when I disable contentEditable:</p> <pre><code>if ($.browser.mozilla) { // replace with browser detection of your choice window.getSelection().removeAllRanges(); } </code></pre> <p>I am actually removing the "contenteditable" attribute for browsers...
<p>The style attribute <code>-moz-user-input</code> can be used in Firefox to get the functionality <code>contenteditable=false</code> working. <br> The value assigned defines if user input is accepted. The possible values are </p> <pre><code>none : The element does not respond to user input. enabled : The eleme...
26,393
<p>Can you show sample code for reading a drive label or volume name in .NET? I get the sense this requires WMI, but I am loathe to "drop-down" into WMI because it is like dropping down into a string-based SQL query in the sense that certain objects may not exist on certain versions of OSes or the user may not have the...
<p>No WMI required. The following will get all volume labels:</p> <pre><code>var labels = from drive in DriveInfo.GetDrives() select drive.VolumeLabel </code></pre>
<p>You could use System.IO.DriveInfo to get the list of drives. See following example:</p> <p>Note: CDRom drive types do not have a volume name.</p> <pre><code>Using System.IO; . . . DriveInfo[] driveInfoList = DriveInfo.GetDrives(); foreach (DriveInfo drive in driveInfoList) { if (drive.DriveType != DriveType.CD...
48,648
<p>I have an application where 2 threads are running... Is there any certanty that when I change a global variable from one thread, the other will notice this change? I don't have any syncronization or Mutual exclusion system in place... but should this code work all the time (imagine a global <strong>bool</strong> na...
<p>Yes. No. Maybe.</p> <p>First, as others have mentioned you need to make dataUpdated volatile; otherwise the compiler may be free to lift reading it out of the loop (depending on whether or not it can see that doSomethingElse doesn't touch it).</p> <p>Secondly, depending on your processor and ordering needs, you ma...
<p>If the scope is right ( "extern", global, etc. ) then the change will be noticed. The question is when? And in what order?</p> <p>The problem is that the compiler <strong>can</strong> and frequently <strong>will</strong> re-order your logic to fill all it's concurrent pipelines as a performance optimization.</p> ...
14,386
<p>In the past I have needed to create custom SOAP headers in a C# project that was using an imported WSDL web reference. I found a way to do it but I was never happy with it and I have sense wondered if there was a better way. What I did was create a header that derives from SoapHeader:</p> <pre><code>[System.Xml.Ser...
<p>It seems that you are using .Net 2.0 and asmx webservices. Do you know that there is a framework called WCF (Windows Communication Framework) in .Net 3.0. I know that it is not easy to migrate to a new framework, but with WCF you get so much. Furthermore WCf can be used for so much more than WebServices (remoting, m...
<p>I ran into this problem today. I ended creating a class that derives from the autogenerated class and overriding the <a href="http://msdn.microsoft.com/en-us/library/system.web.services.protocols.soaphttpclientprotocol.getwriterformessage.aspx" rel="nofollow noreferrer">GetWriterForMessage</a> method to ensure my he...
42,908
<p>Imagine a web application written in Ruby on Rails. Part of the state of that application is represented in a piece of data which doesn't fit the description of a model. This state descriptor needs to be persisted in the same database as the models. Where it differs from a model is that there needs to be only one i...
<p>From your description I think the rails-settings plugin should do what you need. </p> <p>From the Readme:</p> <p>"Settings is a plugin that makes managing a table of global key, value pairs easy. Think of it like a global Hash stored in you database, that uses simple ActiveRecord like methods for manipulation. Kee...
<p>I'm not sure I understand why you say it can't fit in a Rails model. </p> <p>If it's just a complex data structure, just save a bunch of Ruby code in a text field in the database :-)</p> <p>If for example you have a complex nested hash you want to save, assign the following to your 'data' text field:</p> <pre><co...
13,940
<p>What are some of the better AJAX Treeviews out there that support asynchronous JSON loading.</p> <p>YUI TreeView seems nice, but bloated with tables, etc.</p>
<p><a href="http://plugins.jquery.com/project/treeview" rel="noreferrer">jQuery TreeView plugin</a> it's really good and it haves very nice <a href="http://jquery.bassistance.de/treeview/demo/async.html" rel="noreferrer">asynchronous</a> <a href="http://jquery.bassistance.de/treeview/demo/source.phps" rel="noreferrer">...
<p>I suggest DHTMLX Tree:</p> <ul> <li>Cross Browser </li> <li>AJAX Support </li> <li>In-line node editing </li> <li>Drag-n-drop capabilities</li> <li>*Smart Rendering - allows avoiding performance problems in trees with great number of nodes per level. </li> <li><p>Rich Client API</p></li> <li><p>Special techniq...
27,184
<p>I have a small app which references the Microsoft.SqlServer.Smo assembly (so I can display to the user a list of servers &amp; databases to which they can connect).</p> <p>My application originally referenced Microsoft.SqlServer.Smo and Microsoft.SqlServer.ConnectionInfo. Things worked as expected on my dev box.</p...
<p>Yes, they do need to be included. On the development machine you probably have SQL Server installed, which places those assemblies into the Global Assembly Cache. Whenever you build, Visual Studio just pulls from them from the GAC. It also assumes that the GAC of whatever computer it will be deployed on will also...
<p>Since JIT links to external assemblies at run-time, this question can't be answered without analyzing your code and seeing what you call and in turn, what those calls call, etc.</p> <p>If you want to analyze this yourself, your best bet would be to reference only the assembly you need and then to learn from the exc...
10,253
<p>I am looking to allow users to control of subdomain of an app I am toying with, much like Basecamp where it is <code>customusername.seework.com</code>.</p> <p>What is required on the <code>DNS</code> end to allow these to be created dynamically and be available instantly. </p> <p>And how do you recommend dealing w...
<p>The way we do this is to have a 'catch all' for our domain name registered in DNS so that anything.ourdomain.com will point to our server.</p> <p>With Apache you can set up a similar catch-all for your vhosts. The ServerName must be a single static name but the ServerAlias directive can contain a pattern.</p> <pr...
<p>I was looking to do something similar (<code>www.mysite.com/SomeUser</code>).</p> <p>What I did was I edited <code>404.shtml</code> to include this server side include (SSI) code:</p> <pre><code>&lt;!--#include virtual="404.php" -- &gt; </code></pre> <p>Then I created the file <code>404.php</code>, where I parsed...
2,360
<p>I realise this is not the ideal place to ask about this in terms of searchability, but I've got a page whose JavaScript code throws "Stack overflow in line 0" errors when I look at it in Internet Explorer.</p> <p>The problem is quite clearly not in line 0, but somewhere in the list of stuff that I'm writing to the ...
<p>You can turn <em>off</em> the <code>"Disable Script Debugging"</code> option inside of Internet Explorer and start debugging with <code>Visual Studio</code> if you happen to have that around.</p> <p>I've found that it is one of few ways to diagnose some of those <code>IE</code> specific issues.</p>
<p>This is problem with Java and Flash Player. Install the latest Java and Flash Player, and the problem will be resolved. If not, then install Mozilla Firefox, it will auto install the updates required.</p>
27,951
<p>I've always wanted a way to make a socket connection to a server and allow the server to manipulate the page DOM. For example, this could be used in a stock quotes page, so the server can push new quotes as they become available. </p> <p>I know this is a classic limitation (feature?) of HTTP's request/response pr...
<p>You may want to look at <a href="http://en.wikipedia.org/wiki/Comet_(programming)" rel="nofollow noreferrer">Comet</a> which is a fancy name for a long running HTTP connection where the server can push updates to the page.</p>
<blockquote> <p>You may want to look at Comet</p> </blockquote> <p>a.k.a. <a href="http://ejohn.org/blog/streaming-http-server-push/" rel="nofollow noreferrer">server push</a>. This does not let the server "update" the client page directly, but all the new data is sent to the page through a single connection.</p> <...
3,428
<p>Is there any way to prevent Visual Studio from creating a VSMacros80 folder in my default project directory?</p>
<p>I just found it out myself: If you add a trailing backslash to the <em>Project Folder</em> setting e.g. changing it from <code>C:\dev</code> to <code>C:\dev\</code>, the <code>VSMacros80</code> directory will no longer be created. </p> <p>I tested it with Visual Studio 2005 SP1, with all windows updates installed.<...
<p>I could not find the previous thread, because I was searching for "vsmacros" instead of "vsmacros80".</p> <p>There are currently 5 different entries in <code>Tools-&gt;Options-&gt;Addin/Macro Security</code></p> <pre><code>%ALLUSERSPROFILE%\Application Data\Microsoft\MsEnvShared\Addins %APPDATA%\Microsoft\MsEnvSha...
9,574
<p>My machine is seriously underpowered, and I think I need to start conserving every spare cycle. I know that my Gnome environment seems to underperform compared to my coworkers' KDE setups. But if I'm going to make that big of a switch, I might as well consider running something even lighter.</p> <p>Is it possible...
<p>The window managers listed below all subscribe to the lightweight and fast approach. They are faster than fully fledged window managers like KDE or Gnome and trim down on most visual distractions. Which one you pick will be mostly determined by your own taste and what you can get to run.</p> <p>There's a subfamily ...
<p>I'll second xfce, it's probably the most popular of the lightweight WM's out there (perhaps due to its inclusion in <a href="http://www.xubuntu.org/" rel="nofollow noreferrer">Xubuntu</a>). I've also had good experiences with <a href="http://www.fluxbox.org/" rel="nofollow noreferrer">Fluxbox</a> (it came with Damn...
14,118
<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 an algorithm to compare multiple sets of numbers against a target set to determine which ones are the most "similar"?</p> <p>One use of this algorithm would be to compare today's hourly weather forecast against historical weather recordings to find a day that had similar weather.</p> <p>The similarity of t...
<p>I think the mean square error metric might work for applications such as weather compares. It's easy to calculate and gives numbers that do make sense.</p> <p>Since your want to compare measurements over time you can just leave out missing values from the calculation.</p> <p>For values that are not time-bound or e...
<p>First of all, ask yourself if these are sets, or ordered collections.</p> <p>I assume that these are ordered collections with duplicates. The most obvious algorithm is to select a tolerance within which numbers are considered the same, and count the number of slots where the numbers are the same under that measure....
16,908
<p>I have been trying to tokenize a string using SPACE as delimiter but it doesn't work. Does any one have suggestion on why it doesn't work?</p> <p>Edit: tokenizing using:</p> <pre><code>strtok(string, " "); </code></pre> <p>The code is like the following</p> <pre><code>pch = strtok (str," "); while (pch != NULL) ...
<p>Do it like this:</p> <pre><code>char s[256]; strcpy(s, "one two three"); char* token = strtok(s, " "); while (token) { printf("token: %s\n", token); token = strtok(NULL, " "); } </code></pre> <p>Note: <code>strtok</code> modifies the string its tokenising, so it cannot be a <code>const char*</code>. </p>
<pre><code>int not_in_delimiter(char c, char *delim){ while(*delim != '\0'){ if(c == *delim) return 0; delim++; } return 1; } char *token_separater(char *source, char *delimiter, char **last){ char *begin, *next_token; char *sbegin; /*Get the start of the token */ if(source) be...
33,395
<p>I have a class that looks like this</p> <pre><code>public class SomeClass { public SomeChildClass[] childArray; } </code></pre> <p>which will output XML from the XMLSerializer like this:</p> <pre><code>&lt;SomeClass&gt; &lt;SomeChildClass&gt; ... &lt;/SomeChildClass&gt; &lt;SomeChildClass&gt; ...
<p>The best approach would be to do what you said and add a property to the "SomeChildClass" like this</p> <pre><code>[XmlAttribute("Index")] public int Order { { get; set; } } </code></pre> <p>Then however you are adding these items to your array, make sure that this property get's set. Then when you serialize......
<p>You may need to look into implementing System.Xml.Serialization.IXmlSerializable to accomplish this.</p>
19,710
<p>The following <strong>C++</strong> code uses a <strong>ifstream</strong> object to read integers from a text file (which has one number per line) until it hits <strong>EOF</strong>. Why does it read the integer on the last line twice? How to fix this?</p> <p><strong>Code:</strong></p> <pre><code>#include &lt;iostr...
<p>Just follow closely the chain of events.</p> <ul> <li>Grab 10</li> <li>Grab 20</li> <li>Grab 30</li> <li>Grab EOF</li> </ul> <p>Look at the second-to-last iteration. You grabbed 30, then carried on to check for EOF. You haven't reached EOF because the EOF mark hasn't been read yet ("binarically" speaking, its co...
<pre><code>int x; ifile &gt;&gt; x while (!iFile.eof()) { cerr &lt;&lt; x &lt;&lt; endl; iFile &gt;&gt; x; } </code></pre>
4,177
<p>Suppose I want to create a set of observers based on type. That is to say, when they are notified of an event, they are told the type of one of the arguments and then decides whether or not to act based on if it can operate on that type.</p> <p>Are there any simple ways to do this? I figured this would be fairly ...
<p>First off, change the code you've got to the following:</p> <pre><code>interface IObserver { } class Subject { public Subject () { m_observers = new List&lt;IObserver&gt; (); } public void Register (IObserver o) { m_observers.Add (o); } List&lt;IObserver&gt; m_observers; } </code></pre>...
<pre><code>interface IObserver { void Notify(NotifyArgs na); bool SupportsType(Type t); } class Subject { List&lt;IObserver&gt; observers; void Register(IObserver o) { observers.Add(o); } void OnNotify(Type t, NotifyArgs args) { foreach (IObserver o in observers) { ...
37,845
<p>I have a String such as: </p> <pre><code>Cerepedia, una apliación web </code></pre> <p>I would like to transform it into something URL valid such as: </p> <pre><code>Cerepedia,unaaplicacionweb </code></pre> <p><strong>Note:</strong> the special character transformation and spaces removal. </p> <p>By the way, ar...
<p>Have you looked at <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLEncoder.html" rel="nofollow noreferrer">URLEncoder</a>? That seems to do what you need it to do. Though the special characters will be transformed to escaped entities and not stripped from their "special" properties.</p>
<p>Try this code</p> <pre><code> public class Test { public static void main(final String[] args) { String str = "Cerepedia, una apliación web"; String[] parts = str.split(" "); int sum=0; for (int i=0;i&lt;=parts.length-1;i++) { sum = sum+parts[i].length(); } ...
25,162
<p>I am interested in what methods of logging is frequent in an Oracle database. Our method is the following:</p> <p>We create a log table for the table to be logged. The log table contains all the columns of the original table plus some special fields including timestamp, modification type (insert, update, delete), m...
<p>It sounds like you are after 'auditing'. Oracle has a built-in feature called Fine Grain Auditing (FGA). In a nutshell you can audit everything or specific conditions. What is really cool is you can 'audit' selects as well as transactions. Simple command to get started with auditing:</p> <pre><code>audit UPDATE...
<p>log4plsql is a completely different thing, its for logging debug info from PL/SQL</p> <p>For what you want, you need to either.</p> <ol> <li>Setup a trigger</li> <li>Setup PL/SQL interface around the tables, CRUD operations happen via this interface, the interface ensures the log tables are updated.</li> <li>Setup...
23,737
<p>I'm implementing a class that wraps around an xml document with a very strictly defined schema. I don't control the schema. </p> <p>One of the properties in the class is for an element value that the schema indicates must match a certain regular expression. In the setter for the property, if a string doesn't mat...
<p>XmlComments may help if you ship them with your assembly, but I would say that you are best off throwing exceptions if the requirements are not met, and making the exception message as detailed as possible. I would also throw exceptions (again with lots of detail) if the requirement is not met when the user calls a...
<p>Document it in the XML comments, and throw an exception. Make the message explicit:</p> <pre><code>Element &lt;elementname&gt; must match /regex/ </code></pre>
21,620
<p><code>itoa()</code> is a really handy function to convert a number to a string. Linux does not seem to have <code>itoa()</code>, is there an equivalent function or do I have to use <code>sprintf(str, "%d", num)</code>?</p>
<p>EDIT: Sorry, I should have remembered that this machine is decidedly non-standard, having plugged in various non-standard <code>libc</code> implementations for academic purposes ;-)</p> <p>As <code>itoa()</code> is indeed non-standard, as mentioned by several helpful commenters, it is best to use <code>sprintf(targ...
<p>You can use this program instead of sprintf.</p> <pre><code>void itochar(int x, char *buffer, int radix); int main() { char buffer[10]; itochar(725, buffer, 10); printf ("\n %s \n", buffer); return 0; } void itochar(int x, char *buffer, int radix) { int i = 0 , n,s; n = s; while (n &gt...
23,082
<p>Mac OS X stores some files with resource forks. I need to create a file with a resource fork. The trouble is, I need to create this file on the command line. Is anyone aware of how you can create a file with a resource fork on the command line in Mac OS X?</p>
<p>You can directly access the resource fork of a file using path/to/file/..namedfork/rsrc.</p>
<p>As an alternative, you can make a copy of an existing file, fork and all, using ditto:</p> <p>ditto -rsrc srcFile dstFile</p>
40,047
<p>i want to check my server connection to know if its available or not to inform the user..</p> <p>so how to send a pkg or msg to the server (it's not SQL server; it's a server contains some serviecs) ...</p> <p>thnx in adcvance ..</p>
<p>With all the possibilities for firewalls blocking ICMP packets or specific ports, the only way to guarantee that a service is running is to do something that uses that service.</p> <p>For instance, if it were a JDBC server, you could execute a non-destructive SQL query, such as <code>select * from sysibm.sysdummy1<...
<p>If you can open a port but don't want to use ping (i dont know why but hey) you could use something like this:</p> <pre><code>import socket host = '' port = 55555 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((host, port)) s.listen(1) while 1...
47,643
<p>I'm trying to insert a <a href="http://en.wikipedia.org/wiki/Spry_framework" rel="nofollow noreferrer">Spry</a> <a href="http://en.wikipedia.org/wiki/Accordion_(GUI)" rel="nofollow noreferrer">accordion</a> into an already existing <a href="http://en.wikipedia.org/wiki/JavaServer_Faces" rel="nofollow noreferrer">JSF...
<p>I'm not a Dreamweaver expert, but all Spry Accordian requires is the correct HTML structure. E.g.: </p> <pre><code> &lt;div id="Accordion1" class="Accordion"&gt; &lt;div class="AccordionPanel"&gt; &lt;div class="AccordionPanelTab"&gt;Panel 1&lt;/div&gt; &lt;div class="A...
<p>The only other thing you might check is if your ids are getting munged by JSF. Obviously that could impact the ability of Spry to wire itself to your accordion html structure.</p> <p>+1 to Dave's answer.</p>
10,151
<p>What is the best practices regarding storing files uploaded from users?</p> <p>Currently, I am during the following method for storing files:</p> <pre><code>&lt;web_app_root&gt;/course_material/&lt;term_id&gt;/&lt;course_id&gt;/&lt;file_id&gt; </code></pre> <p>As you can see, the files are stored according to the...
<p>I've always just stored the files in a directory with unique GUID based filenames, and mapped the guid to the file in the DB. As long as you're not manually browsing the files and such, this is probably the easiest solution (also gets around invalid chars).</p> <p>Another option is storing them as BLOBS in the dat...
<p>I've always just stored the files in a directory with unique GUID based filenames, and mapped the guid to the file in the DB. As long as you're not manually browsing the files and such, this is probably the easiest solution (also gets around invalid chars).</p> <p>Another option is storing them as BLOBS in the dat...
42,993
<p>Are there any open source or commercial web programming language that function much like Fog Creek's Wasabi? As in you write your web app in this parent language and it then compiles down to php for Linux hosts and ASP.NET for Windows hosts.</p>
<p><a href="http://haxe.org/" rel="nofollow noreferrer">Haxe</a> is the closest I've seen, but it only compiles to PHP (and mod_neko), not to ASP.</p>
<p>As far as I know, Fog Creek had to develop Wasabi because there wasn't such a tool. There are a few toolkits trying to be portable, but none that compiled to ASP or PHP that I know of (besides Wasabi, that is).</p>
19,242
<p>I have a function that looks something like this:</p> <pre><code>//iteration over scales foreach ($surveyScales as $scale) { $surveyItems = $scale-&gt;findDependentRowset('SurveyItems'); //nested iteration over items in scale foreach ($surveyItems as $item) { //retrieve a single value from ...
<p>One query that returns a dozen pieces of data is almost 12x faster than 12 queries that return 1 piece of data.</p> <p>Oh, and NEVER EVER NEVER put a SQL inside a loop, it will always lead in a disaster. </p> <p>Depending on how your app works, a new connection might be opened for each query, this is especially b...
<p>Definitely fetch all and retrieve from array.</p>
46,520
<p>i dunno, but will your machine suffer great slowdown if you use a very complex regex? like for example the famous email validation module proposed just recently? which can be found here <a href="http://ex-parrot.com/~pdw/Mail-RFC822-Address.html" rel="nofollow noreferrer">RFC822</a></p> <p>update: sorry i had to as...
<p>It highly depends on the individual regex: features like look-behind or look-ahead can get very expensive, while simple regular expressions are fine for most situations.</p> <p>Tutorials on <a href="http://www.regular-expressions.info/" rel="nofollow noreferrer">http://www.regular-expressions.info/</a> offer perfor...
<p>I once made a program that analyzed a lot of text (a big code base, >300k lines). First I used regex but when I switched to using regular string functions it got a lot faster, like taking 40% of the time of the regex version. So while of course it depends, my thing got a lot faster.</p>
27,790
<p>I need to tweak some variables (only in a development setting) without having to restart IIS or anything (so I assume Web.Config is the wrong place to put them). Where is the easiest place to put about 500 config settings that have to be read for every request and written to, like I said, while IIS is running?</p> ...
<p>In a database?</p>
<p>500 Config Settings to be read for every request? I'd put them in a database so they can be indexed and cached. A separate XML or data file would also most likely be cached in memory by the web server, but still wouldn't provide the performance an indexed database table could. But it depends on how you are access...
22,759
<p>I've come to love <a href="http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud" rel="nofollow noreferrer">Amazon's EC2 service</a> and I'm looking for something similar that supports the ability to save a running Windows server image and start new instances from it.</p> <p>I contacted <a href="http://www.gogr...
<p>I have just received a message from Amazon to the effect that that they will be <a href="http://aws.amazon.com/windows/" rel="nofollow noreferrer">supporting Windows Server on EC2</a> this fall.</p> <p>Wahaay!!</p>
<p>Seems like dealing with licensing issues would be nightmarish for the host.</p>
4,248
<p>Here is what I have:</p> <p>JAVA_HOME=C:\Software\Java\jdk1.5.0_12 (points to JDK 5.0)</p> <p>In Eclipse "Installed Runtimes" I have: jre 1.5.0_12 (points to JRE 5.0) jre 1.6.0_3 (points to JRE 6.0) (this one is default)</p> <p>I do not have "javac" on my PATH (i.e. I cannot run javac -version from command line i...
<p>Eclipse has the <a href="http://www.eclipse.org/jdt/overview.php" rel="noreferrer">JDT</a> which includes the incremental compiler so it does not need an external one unless that is your wish :)</p>
<p>Eclipse is shipped with an built-in compiler. You can use an external JDK, if you configure it in the preferences.</p> <p>Edit: Thanks to André!</p>
42,152