instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Say you have a shipment. It needs to go from point A to point B, point B to point C and finally point C to point D. You need it to get there in five days for the least amount of money possible. There are three possible shippers for each leg, each with their own different time and cost for each leg:</p> <pre><code>A...
<p>Could alter some of the <a href="http://en.wikipedia.org/wiki/Shortest_path_problem" rel="noreferrer">shortest path algorithms</a>, like Dijkstra's, to weight each path by cost but also keep track of time and stop going along a certain path if the time exceeds your threshold. Should find the cheapest that gets you ...
<p>I think that Dijkstra's algorithm is for finding a shortest path. </p> <p><strong>cmcculloh</strong> is looking for the minimal cost subject to the constraint that he gets it there in 5 days. </p> <p>So, merely finding the quickest way won't get him there cheapest, and getting there for the cheapest, won't get it ...
3,567
<p>I have found the before_dispatch and after_dispatch in dispatcher.rb but I need to access something earlier. Like around when Rails.public_path is defined.</p>
<p>Not sure what you're trying to do, but you can take a look at <code>config/boot.rb</code> (don't change it please). In there, you'll find it will load the file <code>config/preinitializer.rb</code> if it exists. That might be overkill though, you probably can do what you want by creating an initializer in <code>co...
<p>If it's needed for Mongrel or Apache, are You sure it can not be done by configuration?</p>
45,592
<p>ZeroC's ICE (www.zeroc.com) looks interesting and I am interested in looking at it and comparing it to our existing software that uses WCF. In particular, our WCF app uses server callbacks (via HTTP).</p> <p>Anybody who's compared them? How did it go? I'm particularly interested in the performance aspect, since int...
<p>I did a very terse review of ICE a few years ago, and although I haven't compared them directly before, having reasonable knowledge of WCF my thoughts might have some relevance.</p> <p>Firstly, it's not entierely fair to compare WCF with ICE as WCF as ICE is a specific remote communication mechanism and WCF is a hi...
<p>We are using ICE to integrate modules written in both C++, Java and C#. The nice thing is that our server can access components on remote machines as well, so if we need more performance we can shift processing to different machines.</p> <p>I've used both WCF and ICE, and I'd say that ICE is cleaner on the implemen...
12,477
<p>In my routing I would like to have something like not found route handler. </p> <p>For example I have created one mapping like</p> <pre><code>routes.MapRoute( "default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id="" }...
<p>I think you should use RenameFile() in [CODE] section instead, since you know where the ini file is.</p>
<p>I think you should use RenameFile() in [CODE] section instead, since you know where the ini file is.</p>
40,942
<p>When developing a plug-in to application, using the application API which doesn't run independently of the application, is unit-testing even a possibility? What are strategies to test a plug-in that is tightly integrated with an application?</p>
<p>Abstract out the host API with interfaces, and test against a mock host. </p> <p>The key is that your logic is tested with the characteristic data that the host might provide.</p> <p>If you have a code example, I can probably give you a better answer.</p>
<p>Abstract out the host API with interfaces, and test against a mock host. </p> <p>The key is that your logic is tested with the characteristic data that the host might provide.</p> <p>If you have a code example, I can probably give you a better answer.</p>
38,946
<p>I have a local mercurial repository with some site-specific changes in it. What I would like to do is set a couple files to be un-commitable so that they aren't automatically committed when I do an <code>hg commit</code> with no arguments.</p> <p>Right now, I'm doing complicated things with <code>mq</code> and gua...
<p>I would put those files in <code>.hgignore</code> and commit a "sample" form of those files so that they could be easily recreated for a new site when someone checks out your code.</p>
<p>I'm curious why you can't have another repo checked out with those specific changes, and then transplant/pull/patch to it when you need to update stuff. Then you'd be primarily working from the original repo, and it's not like you'd be wasting space since hg uses links. I commonly have two+ versions checked out so I...
15,061
<p>If a packed Javascript saves 20kb off the download size, but takes a perfomance hit to unpack, then are there any benefits, besides obfuscating the code?</p> <p>I've made this a community wiki because it may be open to some discussion.</p>
<p>Packed javascript code generally does not take longer to execute vs regular code. Most code packers will shorten variables, function names and use a host of tricks to make the source smaller. The resulting source is fully executable! You can verify this by taking a look at it during runtime with firebug. You'll see ...
<p>The question is, why does the packing save 20kB? You should investigate making your 'normal' javascript smaller. Is the readability of your code significantly improved by putting spaces around operators, or by using very long variable and function names? The most egregious waste of bandwidth I have seen on any we...
46,230
<p>I am having an string like this</p> <p>string str = "dfdsfdsf8fdfdfd9dfdfd4"</p> <p>I need to check whether the string contains number by looping through the array.</p>
<p>What about a regular expression:</p> <pre><code>bool val = System.Text.RegularExpressions.Regex.IsMatch(str, @"\d"); </code></pre>
<p>If you're a linq junkie like me, you'd do it this way</p> <pre><code>string s = "abc1def2ghi"; bool HasNumber = (from a in s.ToCharArray() where a &gt;= '0' &amp;&amp; a &lt;= '9' select a).Count() &gt; 0; </code></pre>
33,645
<p>I am developing a Rails application that will access a lot of RSS feeds or crawl sites for data (mostly news). It will be something like Google News but with a different approach, so I'll store a lot of news (or news summaries), classify them in different categories and use ranking and recommendation techniques.</p>...
<p>purexml is heavier than SQL, so you pay more for your roundtrip between webserver and DB. If you plan to have lots of users, I'd avoid it, your better off letting your webserver cache the requests, thus avoiding creating xml(rss) everytime, if that is what you are thinking about.</p> <p>I'd go with MySQL because it...
<p>It sounds to me the application you will build can easily become a large-scale web app. I would suggest PostgreSQL, for it has been known for its reliability.</p> <p>You can check out the following link -- Bob Ippolito from MochiMedia tells us why they ditched MySQL for PostgreSQL. Although the posts are more than ...
38,787
<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>I'm writing a C parser using PLY, and recently ran into a problem. This code:</p> <pre><code>typedef int my_type; my_type x; </code></pre> <p>Is correct C code, because my_type is defined as a type previously to being used as such. I handle it by filling a type symbol table in the parser that gets used by the lexe...
<p>With <a href="http://groups.google.com/group/ply-hack/tree/browse_frm/thread/cf31e8334801eabd/b9cdf4a6682635c1?rnum=1&amp;_done=%2Fgroup%2Fply-hack%2Fbrowse_frm%2Fthread%2Fcf31e8334801eabd%3F#doc_5c415da045e77a6e" rel="nofollow noreferrer">some help</a> from Dave Beazley (PLY's creator), my problem was solved.</p> ...
<p>I think you need to move the check for whether an ID is a TYPEID from c_lexer.py to c_parser.py.</p> <p>As you said, since the parser is looking ahead 1 token, you can't make that decision in the lexer.</p> <p>Instead, alter your parser to check ID's to see if they are TYPEID's in declarations, and, if they aren't...
13,339
<p>In a web-app I'm writing, the user is supposed to enter the path in the Perforce repository for the node they're entering. The application is supposed to validate that the entered directory exists in the repo.</p> <p>I've got the P4Package (p4.jar) lib, and I'm configuring it correctly enough that it works for alm...
<p>Definitely useful, at least from the user's point of view. By manually resending the email, they <em>know</em> that it has been sent and can check their spam folder immediately to catch the mail. Otherwise, they might not know about the mail and it will dissapear from their spam before they can catch it.</p>
<p>Absolutely pointless. But, if the user's want it, and it doesn't take too long, it may be worthwhile. Users are silly sometimes, and if it makes them happy...</p>
11,050
<p>What is the best way to change the height and width of an ASP.NET control from a client-side Javascript function?</p> <p>Thanks, Jeff</p>
<p>You can use the controls .ClientID and some javascript and change it that way.</p> <p>You can do it through CSS height/width or on some controls directly on the control itself.</p>
<p>You can use the controls .ClientID and some javascript and change it that way.</p> <p>You can do it through CSS height/width or on some controls directly on the control itself.</p>
34,896
<p>This is not a new topic, but I am curious how everyone is handling either <code>.js</code> or <code>.css</code> that is browser specific. </p> <p>Do you have <code>.js</code> functions that have <code>if/else</code> conditions in them or do you have separate files for each browser? </p> <p>Is this really an issue...
<p>It's a very real issue. Mostly just because of IE6. You can handle IE6-specific CSS by using <a href="http://msdn.microsoft.com/en-us/library/ms537512.aspx" rel="nofollow noreferrer">conditional comments</a>.</p> <p>For JavaScript, I'd recommend using a library that has already done most of the work of abstracting ...
<p>I use the built in functions of jQuery for the actual detection:</p> <pre><code>jQuery.each(jQuery.browser, function(i, val) {}); </code></pre> <p>As for organization, that would depend on your application. I think putting this in an initialization code and then using the detection where you need it would be best...
14,162
<p><em>The pictures explain my problem. I have already tried to reduce the retraction but that showed no effect. Thank you for your help.</em> </p> <p>The effect is a total stop of the print (no material is extruded).</p> <ul> <li>Creality CR 10</li> <li>Cura 3.4.1</li> </ul> <p>I recently added this new feeder alum...
<p>This is typically caused by resistance in the tube or hotend but in your case it appears to be mostly caused by a very poorly designed extruder. The filament needs to be constrained closer to the drive gear. You may be able to drill out the PTC connector to allow the PTFE tube to reach closer to the gears or print...
<p>You just have to cut the filament at a 45° angle. Then push down the extruder and push the filament in. Then heat up the nozzle. Next, hand feed the filament until the filament starts oozing out.</p>
1,039
<p>I generaly disable viewstate for my ASP.net controls unless I explicitly know I am going to require view state for them. I have found that this can significantly reduce the page size of the HTML generated. </p> <p>Is this good practice? When should be enabled or disabled?</p>
<p>Yes it is a very good idea. One could argue that it should have been disabled by default by Microsoft, just like caching.</p> <p>To see how bad Viewstate is in terms of size increased you can use a tool called <a href="http://lab.aspitalia.com/26/ViewStateAnalyzer200.aspx#eng" rel="noreferrer">Viewstate Analyzer</a...
<p>_Viewstate can unnecessarily increase the number of bytes that need to be transferred. So unless the data is going to be used the next time , it's a good idea to switch it off.</p>
13,856
<p>I have a mouseenter and mouseleave event for a Panel control that changes the backcolor when the mouse enters and goes back to white when it leaves.</p> <p>I have Label control within this panel as well but when the mouse enters the Label control, the mouseleave event for the panel fires.</p> <p>This makes sense b...
<p>You can use GetChildAtPoint() to determine if the mouse is over a child control.</p> <pre><code>private void panel1_MouseLeave(object sender, EventArgs e) { if (panel1.GetChildAtPoint(panel1.PointToClient(MousePosition)) == null) { panel1.BackColor = Color.Gray; } } </code></pre> <p>If the cont...
<p>You could add a MouseEnter event for the label which also sets the Panel's back colour. You wouldn't need a MouseLeave event for the label.</p> <p>Or:</p> <ol> <li>Set the MouseEnter event for the Panel to set the Panel's back colour.</li> <li>Set the Panel's parent control's (e.g. the Form) MouseEnter event to r...
45,204
<p>After reading <a href="http://www.colder.ch/news/08-24-2007/28/late-static-bindings-expl.html" rel="noreferrer">this description</a> of late static binding (LSB) I see pretty clearly what is going on. Now, under which sorts of circumstances might that be most useful or needed?</p>
<p>I needed LSB this for the following scenario: </p> <ul> <li>Imagine you're building a "mail processor" daemon that downloads the message from an email server, classifies it, parses it, saves it, and then does something, depending on the type of the message. </li> <li>Class hierarchy: you have a base Message class, ...
<p>I have a class with a static method that handles some formatting. I have another class that than needs all the functionality of the original one except for how it handles formatting.</p>
11,269
<p>I have a rather weak understanding of any of oracle's more advanced functionality but this should I think be possible.</p> <p>Say I have a table with the following schema:</p> <pre><code>MyTable Id INTEGER, Col1 VARCHAR2(100), Col2 VARCHAR2(100) </code></pre> <p>I would like to write an sproc with the follo...
<p>Using MERGE and COALESCE? <a href="http://blogs.oracle.com/cmar/entry/using_merge_to_do_an" rel="nofollow noreferrer">Try this link for an example</a></p> <p>with</p> <pre><code>SET a.Col1 = COALESCE(incoming.Col1, a.Col1) ,a.Col2 = COALESCE(incoming.Col2, a.Col2) </code></pre>
<p>Using MERGE and COALESCE? <a href="http://blogs.oracle.com/cmar/entry/using_merge_to_do_an" rel="nofollow noreferrer">Try this link for an example</a></p> <p>with</p> <pre><code>SET a.Col1 = COALESCE(incoming.Col1, a.Col1) ,a.Col2 = COALESCE(incoming.Col2, a.Col2) </code></pre>
14,224
<p>In Eclispe you can do Ctrl+Shift+R and a Window popup where you can write the name of the file (or just the beginning of it) and to press enter to go directly to the file.</p> <p>What is the equivalence in Visual Studio 2005? (Ctrl+Shift+F is not what I would like).</p>
<p>From <a href="http://www.chinhdo.com/20070920/top-11-visual-studio-2005-ide-tips-and-tricks-to-make-you-a-more-productive-developer/" rel="noreferrer">Top 11 VS 2005 IDE tips and tricks:</a></p> <blockquote> <p>This is the Find dropdown that is on the Standard Toolbar, not the Find dialog. Use the shortcut CTRL+D to...
<p>I don't know if there is an equivalence, but you can probably do it with the macro editor. It's pretty powerful and you can do pretty much what you want with it.</p>
23,327
<p>What is the simplest way to determine the length (in seconds) of a given mp3 file, <strong>without using outside libraries</strong>? (python source highly appreciated)</p>
<p>You can use <a href="http://spacepants.org/src/pymad/" rel="noreferrer">pymad</a>. It's an external library, but don't fall for the Not Invented Here trap. Any particular reason you don't want any external libraries?</p> <pre><code>import mad mf = mad.MadFile("foo.mp3") track_length_in_milliseconds = mf.total_ti...
<p>You might count the number of frames in the file. Each frame has a start code, although I can't recollect the exact value of the start code and I don't have MPEG specs laying around. Each frame has a certain length, around 40ms for MPEG1 layer II.</p> <p>This method works for CBR-files (Constant Bit Rate), how VBR-...
14,523
<p>Lately, I've been pondering the somewhat non-mainstream architecture of building raw XML on the server side, and then using an XSLT stylesheet on the client to transform the XML into the full UI. Of course, a fallback mechanism would have to exist if the client was not capable of client side XSLT, in which case we'...
<p>Like other people have mentioned, Blizzard has many sites that are client side xsl. I would recommend avoiding client side xsl. It is a really cool idea, but there are many unusual bugs that you need to work around.</p> <p>In Firefox, any javascript that uses document.write will destroy the DOM. Also, the noscript ...
<p>I agree with Elijah's answer. I think that using client side XSLT is a difficult job. You have to do a lot of QA for it. But whereas with server side, you don't that QA. You have to take care of all type of clients and possibilities while using client side. There may be a possibility that your code may break while u...
34,550
<p>I collect statistics on IP addresses from where users visit my site and I have noticed what there are only two IP addresses presented, 172.16.16.1 and 172.16.16.248. The property I use to determine IP address is</p> <pre><code>Request.UserHostAddress </code></pre> <p>What could be a reason of IP address informatio...
<p>You might want to something like this;</p> <pre><code>string SourceIP = String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_FORWARDED_FOR"]) ? Request.ServerVariables["REMOTE_ADDR"] : Request.ServerVariables["HTTP_X_FORWARDED_FOR"].Split(",")[0]; </code></pre> <p>The HTTP_X_FORWARDED_FOR header gets the IP addres...
<p>The two addresses you've listed there are from one of the ranges defined as being private. (see <a href="http://en.wikipedia.org/wiki/Private_network" rel="nofollow noreferrer">here</a> for description)</p> <p>It sounds more like you're picking up the internal address of your own firewall(s)?</p>
24,468
<p>I'm trying to create a jsp tag file but it fails to compile when I try to use <code>pageContext.getServletConfig().getInitParameter("myInitParam")</code></p> <p>I'm using tomcat and when I try to view a page including the file I get a jasper compile error pageContext cannot be resolved. I've also tried just using <...
<p>I just found out the trick is to use one of the implicit objects, in this case config or application depending on the init-parameters scope. they are list at <a href="http://today.java.net/pub/a/today/2003/11/14/tagfiles.html" rel="nofollow noreferrer">http://today.java.net/pub/a/today/2003/11/14/tagfiles.html</a><...
<p>Have you tried the request rather than the pageContext? Or just off the servlet itself:</p> <pre><code>getInitParameter("myInitParam"); </code></pre>
46,471
<p>I have designing the TabMenu Like following</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $('#container-1').tabs(); $('#container-2').tabs(); } &lt;/script&gt; ..... &lt;div id="container-1"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#fragment-1"&gt;&lt;span id="start"&g...
<p>Can you clarify what you mean?</p> <p>If you change this:</p> <pre><code>&lt;li&gt;&lt;a href="#fragment-1"&gt;&lt;span id="end"&gt;Last&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; </code></pre> <p>to:</p> <pre><code>&lt;li&gt;&lt;a href="#fragment-2"&gt;&lt;span id="end"&gt;Last&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; </code><...
<p>I hope this means you got the other part working. Building on the previous example this is possible:</p> <pre><code> $(document).ready(function() { $('#container-1').tabs({ selected : function(e, ui) { if ($($("a", e.target).get(ui.index)).attr('href') == '#fragment-1') { ...
46,748
<p>My friend accidentally bought a laptop with Windows Vista Home Basic Edition. He figured out how to install IIS on it, but it doesn't seem to have either the management console or the admin tools. Is there any way for him to configure a site or import an IIS 6 config file?</p> <p>EDIT: "Windows Vista Home Edition" ...
<p>Not entirely certain here, but start the IIS console on another machine and tell it to connect to the laptop? The normal management console snap-ins all support remote operation.</p>
<p>Okay, not being on Vista I don't know for sure, but on XP the application which controls IIS is <code>%SystemRoot%\system32\inetsrv\iis.msc</code>. Perhaps hunting around for <code>iis.msc</code> would be a first step.</p>
22,500
<p>I have a database called foo and a database called bar. I have a table in foo called tblFoobar that I want to move (data and all) to database bar from database foo. What is the SQL statement to do this?</p>
<p>On SQL Server? and on the same database server? Use three part naming.</p> <pre><code>INSERT INTO bar..tblFoobar( *fieldlist* ) SELECT *fieldlist* FROM foo..tblFoobar </code></pre> <p>This just moves the data. If you want to move the table definition (and other attributes such as permissions and indexes), you'll ...
<p>I give you three options:</p> <p>If they are two databases on the same instance do:</p> <pre><code>SELECT * INTO My_New_Table FROM [HumanResources].[Department]; </code></pre> <p>If they are two databases on different servers and you have linked servers do:</p> <pre><code>SELECT * INTO My_New_Table FROM [ServerNam...
22,750
<p>Reading <a href="https://stackoverflow.com/questions/437/what-is-your-solution-to-the-fizzbuzz-problem">this question</a> I found this as (note the quotation marks) "code" to solve the problem (that's perl by the way). </p> <pre><code>100,{)..3%!'Fizz'*\5%!'Buzz'*+\or}%n* </code></pre> <p>Obviously this is an inte...
<p>My process for situations where I think performance may be an issue:</p> <ol> <li>Make it work.</li> <li>Make it clear.</li> <li>Test the performance.</li> <li>If there are meaningful performance issues: refactor for speed.</li> </ol> <p>Note that this does not apply to higher-level design decisions that are more ...
<p>at times when optimization is necessary, i'd rather sacrifice compactness and keep the performance enhancement. perl obviously has some deep waters to plumb in search of the conciseness/performance ratio, but as cute as it is to write one-liners, the person who comes along to maintain your code (who in my experienc...
5,061
<p>On Windows XP, the following command in a script will prevent any power saving options from being enabled on the PC (monitor sleep, HD sleep, etc.). This is useful for kiosk applications.</p> <pre><code>powercfg.exe /setactive presentation </code></pre> <p>What is the equivalent on Vista?</p>
<p>powercfg.exe works a little differently in Vista, and the "presentation" profile isn't included by default (at least on my machine. so you can setup a "presentation" profile and then use the following to get the GUID</p> <blockquote> <pre><code>powercfg.exe -list </code></pre> </blockquote> <p>and the following t...
<p>In Vista you create a power profile and use the commandline powercfg to select that profile <a href="http://www.nooblet.org/blog/tag/powercfg/" rel="nofollow noreferrer">see here</a></p>
31,679
<p>To minimize retractions and travel when printing several objects, some slicers produce gcode for sequential deposition when each object is built in a traditional manner bottom up layer by layer before starting a new object. Of course, there are limitations caused by the hotend geometry <a href="https://i.stack.imgur...
<p>The site is not well-suited to crowd-sourced invention, but the drawbacks to your suggestion are (I think) on topic.</p> <p>The hotend has two main tasks. Accurate control of extrusion, and maintaining the desired volumetric melt rate. One factor which influences extrusion quality is the size of the melt-zone - gen...
<p>Yes, using a needle to extrude will result in a smaller diameter extrusion. All that is needed is to find a one with a suitable bore size. The problem however is in generating enough hydraulic pressure, needed to extrude hot plastic through a nozzle of that size. If you can form an extruder that can, then go for it....
1,375
<p>I have a web application that uses <a href="https://javaee.github.io/jaxb-v2/" rel="nofollow noreferrer">JAXB 2</a>. When deployed on an <a href="https://www.oracle.com/technetwork/middleware/ias/overview/index.html" rel="nofollow noreferrer">Oracle 10g Application Server</a>, I get errors as soon as I try to marsh...
<p>I assume you use the former BEA Weblogic Server?</p> <p>You can add a weblogic.xml file to your WEB-INF, looking like this:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/web...
<p>Use a different JVM than your Oracle instance and make sure that their libraries are not in your classpath.</p>
16,056
<p>My predicament is fairly simple: This function gets the <code>id</code> of 'this' <code>&lt;li&gt;</code> element based on parent <code>id</code> of <code>&lt;ul&gt;</code>. It used to work fine but not any more, I will either need to have <code>&lt;ul&gt;</code> use <code>class</code>es instead of <code>id</code> ...
<p>You should use classes for things like "current", not the id. The id normally shouldn't change, and "current" isn't a very good id, as you could have a bunch of things on a page that is "current" in some way. If you need some css style to override another, you can force it with !important:</p> <pre><code>ul#leftlis...
<p>It looks like you do need to change one line in your css:</p> <pre><code>ul#leftlist li#current a{color: rgb(96,176,255); background-color:218,218,218);} </code></pre> <p>It's missing the <code>rgb(</code> after <code>background-color</code> and should look like:</p> <pre><code>ul#leftlist li#current a{color: ...
27,950
<p>I'm stuck in having to write a simple spam filter I'm not really sure about how I'm going to do it.</p> <p>So far I've come up with wordlist and domain filtering, which will give or remove points up to a certain threshold.</p> <p>For example, if you're writing about "v1agr4" from a blacklisted domain, you'll get l...
<p>Some really good algorithm info here:</p> <p><a href="http://www.paulgraham.com/spam.html" rel="nofollow noreferrer">http://www.paulgraham.com/spam.html</a></p> <p><a href="http://www.paulgraham.com/better.html" rel="nofollow noreferrer">http://www.paulgraham.com/better.html</a></p> <p>But, seriously, why reinven...
<p>I've written <a href="http://code.google.com/p/sblam/" rel="nofollow noreferrer">one with all the bells and whistles</a>.</p>
37,922
<p>I have a function that, among other things, takes in an object and a Type, and converts the object into that Type. However, the input object is often a double, and the type some variation of int (uint, long, etc.). I want this to work if a round number is passed in as a double (like 4.0), but to throw an exception...
<p>This seems to do what you ask. I have only tested it for doubles, floats and ints.</p> <pre><code> public int GetInt(IConvertible x) { int y = Convert.ToInt32(x); if (Convert.ToDouble(x) != Convert.ToDouble(y)) throw new ArgumentException("Input was not an integer"); retu...
<p>You should be able to use a combination of Convert.ToDecimal and x % y, I would have thought, where y = 1 and checking the result ==0;</p>
41,556
<p>Good day,</p> <p>I have about 4GB of data, separated in about 10 different tables. Each table has a lot of columns, and each column can be a search criteria in a query. I'm not a DBA at all, and I don't know much about indexes, but I want to speed up the search as much as possible. The important point is, there won...
<p>Answer: No. Indexing every column separately is not good design. Indexes need to comprise multiple columns in many cases, and there are different types of indexes for different requirements. </p> <p>The tuning wizard mentioned in other answers is a good first cut (esp. for a learner).</p> <p>Don't try to guess y...
<p>If you are selecting a set of columns from the table greater than those covered by the columns in the selected indexes, then you will inevitably incur a bookmark lookup in the query plan, which is where the query processor has to retrieve the non-covered columns from the clustered index using the reference ID from l...
45,744
<p>I want to print a piece of fruit modeled in Blender. It is an STL file. Please note that I am an absolute beginner at 3D printing models. </p> <p>What do these red zones mean? What is wrong about the mesh in each case?</p> <p><a href="https://i.stack.imgur.com/GGEQe.png" rel="nofollow noreferrer"><img src="https:...
<p>3D printers cannot print in the air without a prior layer or a support structure supporting the new printed layer. For the picture showing the bottom of the fruit, the red area is the calculated area that requires support for printing, so please enable that in the slicer application.</p> <p>For the top picture pleas...
<p>Red is the color Cura uses to mark overhang areas. For the bottom that is normal, it can be fixed by using support.</p> <p>For the top, the presence of red <strong>atop</strong> the seeds is a common tell of inverted normals in the seeds.</p> <p>To fix, open your .blend file again, choose the seeds and <code>flip no...
1,086
<p>I know the name of the table I want to find. I'm using Microsoft SQL Server Management Studio 2005, and I want to search all databases in the database server that I'm attached to in the studio. Is this possible? Do I need to query the system tables?</p>
<p>As above but use system function not system tables</p> <pre><code>EXEC sp_MSForEachDB 'USE [?] IF OBJECT_ID(''dbo.mytable'') IS NOT NULL PRINT ''?''' </code></pre>
<p>use master </p> <p>DECLARE @db_name varchar(128) DECLARE @DbID int DECLARE @sql_string nvarchar(4000) DECLARE @TableName varchar(30) </p> <p>Select @TableName = ''</p> <p>set nocount on</p> <p>CREATE TABLE [#tblDatabaseName] ( [DbName] [varchar] (128) NOT NULL , [TableName] [varchar] (128) NOT NULL ) </...
20,137
<p>I'm refactoring "spaghetti code" C module to work in multitasking (RTOS) environment.</p> <p>Now, there are very long functions and many unnecessary global variables.</p> <p>When I try to replace global variables that exists only in one function with locals, I get into dilemma. Every global variable is behave like...
<p>Short answer: no, there isn't any way to tell automatically whether the function will behave differently according to whether the declaration of a local variable is static or not. You just have to examine the logic of each function that uses globals in the original code.</p> <p>However, if replacing a global variab...
<p>Please give examples of what you call 'global' and 'local' variables</p> <pre><code>int global_c; // can be used by any other file with 'extern int global_c;' static int static_c; // cannot be seen or used outside of this file. int foo(...) { int local_c; // cannot be seen or used outside of this function. } <...
16,275
<p>How do I remove empty elements from an array in JavaScript? </p> <p>Is there a straightforward way, or do I need to loop through it and remove them manually?</p>
<p><strong>EDIT:</strong> This question was answered almost nine years ago when there were not many useful built-in methods in the <code>Array.prototype</code>.</p> <p>Now, certainly, I would recommend you to use the <code>filter</code> method.</p> <p>Take in mind that this method will return you <em>a new array</em>...
<p>Try this. Pass it your array and it will return with empty elements removed. *Updated to address the bug pointed out by Jason</p> <pre><code>function removeEmptyElem(ary) { for (var i = ary.length - 1; i &gt;= 0; i--) { if (ary[i] == undefined) { ary.splice(i, 1); } } ...
35,583
<p>Besides the dynamic nature of Python (and the syntax), what are some of the major features of the Python language that Java doesn't have, and vice versa?</p>
<ol> <li><p>List comprehensions. I often find myself filtering/mapping lists, and being able to say <code>[line.replace("spam","eggs") for line in open("somefile.txt") if line.startswith("nee")]</code> is really nice.</p></li> <li><p>Functions are first class objects. They can be passed as parameters to other functio...
<p>With <a href="http://www.jython.org/Project/" rel="nofollow noreferrer">Jython</a> you can have both. It's only at Python 2.2, but still very useful if you need an embedded interpreter that has access to the Java runtime.</p>
7,242
<p>In emacs, I've read the following code snippet in <code>simple.el</code>:</p> <pre><code>(frame-parameter frame 'buried-buffer-list) </code></pre> <p>What is the exact meaning of the <code>'buried-buffer-list</code> parameter? What it is used for?</p>
<p>MSSQL2000 won't give you that kind of information. But a way you can identify what tables ARE used (and then deduce which ones are not) is to use the SQL Profiler, to save all the queries that go to a certain database. Configure the profiler to record the results to a new table, and then check the queries saved ther...
<p>If you have lastupdate columns you can check for the writes, there is really no easy way to check for reads. You could run profiler, save the trace to a table and check in there</p> <p>What I usually do is rename the table by prefixing it with an underscrore, when people start to scream I just rename it back</p>
5,553
<p>I need to update data to a mssql 2005 database so I have decided to use adodbapi, which is supposed to come built into the standard installation of python 2.1.1 and greater.</p> <p>It needs pywin32 to work correctly and the open office python 2.3 installation does not have pywin32 built into it. It also seems like ...
<p>maybe the best way to install pywin32 is to place it in </p> <p>(openofficedir)\program\python-core-2.3.4\lib\site-packages</p> <p>it is easy if you have a python 2.3 installation (with pywin installed) under </p> <p>C:\python2.3 </p> <p>move the C:\python2.3\Lib\site-packages\ to your</p> <p>(openofficedir)\p...
<p><a href="http://www.time-travellers.org/shane/howtos/MS-SQL-Express-Python-HOWTO.html" rel="nofollow noreferrer">http://www.time-travellers.org/shane/howtos/MS-SQL-Express-Python-HOWTO.html</a></p> <p>use an alternative?</p>
29,571
<p>What are the best code snippets for C#? (using visual studio) VB has a lot that are pre-defined, but there are only a handful for C#. Do you have any really useful ones for C#?</p> <p>Anyone want to post a good custom one you created yourself?</p> <p><a href="http://en.wikipedia.org/wiki/Ferris_Bueller" rel="nor...
<p>There's plenty of code snippets within Visual Studio for basic programming structure but I wouldn't necessarily rate one higher than another. </p> <p>I would definitely say the best ones are the custom snippets you define yourself to accomplish more specific tasks that you may find yourself using on a regular basis...
<p>prop and exception are my favorites.</p>
7,030
<p>From question <em><a href="https://stackoverflow.com/questions/71323/how-to-replace-a-character-for-a-newline-in-vim">How to replace a character for a newline in Vim?</a></em>. You have to use \r when replacing text for a newline, like this</p> <pre><code>:%s/%/\r/g </code></pre> <p>But when replacing end of lines...
<p>From <a href="http://vimdoc.sourceforge.net/htmldoc/pattern.html#/%5Cr" rel="noreferrer">vim docs on patterns</a>:</p> <blockquote> <p><code>\r</code> matches &lt;CR&gt;</p> <p><code>\n</code> matches an end-of-line - When matching in a string instead of buffer text a literal newline character i...
<p>First of all, open <a href="http://vimdoc.sourceforge.net/htmldoc/change.html#:s" rel="noreferrer"><code>:h :s</code></a> to see the section "4.2 Substitute" of documentation on "Change". Here's what the command accepts:</p> <pre><code>:[range]s[ubstitute]/{pattern}/{string}/[flags] [count] </code></pre> <p>Notice...
9,690
<p>I'm wondering if its possible to add new class data members at run-time in PHP?</p>
<p>Yes.</p> <pre><code>$prop = 'newname'; $obj-&gt;$prop = 42; </code></pre> <p>will do the same thing as:</p> <pre><code>$obj-&gt;newname = 42; </code></pre> <p>Either one will add "newname" as a property in $obj if it does not yet exist.</p>
<p>It is. You can add public members are run time with no additional code, and can affect protected/private members using the magical overloading methods __get() / __set(). See <a href="http://www.php.net/manual/en/language.oop5.overloading.php" rel="nofollow noreferrer">here</a> for more details.</p>
19,876
<p>I'm looking for some resources regarding the <strong>virtual machines of the future</strong> (Like jvm or clr)</p> <p>What are they going to look like? Will they provide a concurrent runtime, more powerful metaprogramming models?</p> <p>I'm looking for articles, research projects, or pure speculation, anything tha...
<p>The <a href="http://www.parrotcode.org/" rel="nofollow noreferrer">Parrot</a> is an upcoming virtual machine that will be used for Perl 6 along with other dynamic languages such as Ruby, PHP, Python, to name a few.</p> <p>Parrot is a little different from the Java Virtual Machine and Common Language Runtime as it i...
<p>Not knowing what would attract you the most (compilation, garbage collection, security, etc...), my advice would be to do some "depth first search" in webpages/papers/conferences/blog posts/etc related to people working on different virtual machines for java, clr, python, javascript etc.</p> <p>First starters that ...
40,817
<p>Can anyone help me to convert a C# .NET program to PowerShell cmdlet? I am very new to this area. Please help me to get out of this checkpoint!</p> <p>Regards,</p> <p>Arun</p>
<p>Add a reference to <em>System.Management.Automation</em>, create a class that inherits from <em>Cmdlet</em> and override the <em>ProcessRecord</em> method:</p> <pre><code>[Cmdlet(VerbsCommon.Get, "Double")] public class GetDouble : Cmdlet { [Parameter] public int SomeInput { get; set; } protected overr...
<p>First of all, you should convert your .cs file into a DLL using PowerShell template. Then by using <code>pssnapin</code> and <code>getproc</code> you can convert it into a DLL.</p>
44,623
<p>I am wondering how to use NUnit correctly. First, I created a separate test project that uses my main project as reference. But in that case, I am not able to test private methods. My guess was that I need to include my test code into my main code?! - That doesn't seem to be the correct way to do it. (I dislike the ...
<p>Generally, unit testing addresses a class's public interface, on the theory that the implementation is immaterial, so long as the results are correct from the client's point of view.</p> <p>So, NUnit does not provide any mechanism for testing non-public members.</p>
<p>I would make the private methods package visible. That way you keep it reasonably private while still being able to test those methods. I don't agree with the people saying that the public interfaces are the only ones that should be tested. There is often really critical code in the private methods that can't be pro...
31,075
<p>I need a way to automate test orders on our test and production web sites. I was thinking about using something like iMacro, but I thought there must be a better way. Any ideas?</p>
<p>Another good FF add-in is <a href="https://addons.mozilla.org/en-US/firefox/addon/2079" rel="nofollow noreferrer">Selenium IDE</a> which seems a bit more feature rich than the add-in for iMacros. There are extended editions (<a href="http://selenium.openqa.org/" rel="nofollow noreferrer">Selenium</a>,<a href="http:/...
<p>Without knowing what kind of "order" you're talking about, it's really impossible to say.</p> <p>I suspect that you don't <em>really</em> want to be creating test orders on a production system though.</p>
25,555
<p><a href="https://rads.stackoverflow.com/amzn/click/com/0201485672" rel="noreferrer" rel="nofollow noreferrer">Martin Fowler</a> says that we should do refactoring before adding new features (given that the original program is not well-structured).</p> <p>So we all want to refactor this <em>dirty</em> codebase, that...
<p>My suggestion would be that you touch as little as possible and add what you need. I have found that it is best to leave well enough alone, especially if you are on a tight deadline.</p> <p>If you had had unit tests, that would be a different story, but when you change code it can be like touching a spider web. C...
<p>touch as little as possible. And pray.</p>
21,585
<p><strong>What happens in the memory when a class instantiates the following object?</strong> </p> <pre><code>public class SomeObject{ private String strSomeProperty; public SomeObject(String strSomeProperty){ this.strSomeProperty = strSomeProperty; } public void setSomeProperty(String strSo...
<p>Let's step through it:</p> <pre><code>SomeObject so1 = new SomeObject("some property value"); </code></pre> <p>... is actually more complicated than it looks, because you're creating a new String. It might be easier to think of as:</p> <pre><code>String tmp = new String("some property value"); SomeObject so1 = ne...
<p>Points to remember:</p> <ol> <li>When a method is called, a frame is created on the top of stack. </li> <li>Once a method has completed execution, flow of control returns to the calling method and its corresponding stack frame is flushed. </li> <li>Local variables are created in the stack. </li> <li>Instance var...
41,527
<p>How can I pass a variable number of args to a yield. I don't want to pass an array (as the following code does), I'd actually like to pass them as a programmatic number of args to the block.</p> <pre><code>def each_with_attributes(attributes, &amp;block) results[:matches].each_with_index do |match, index| yie...
<p>Use the splat-operator <code>*</code> to turn the array into arguments.</p> <pre><code>block.call(*array) </code></pre> <p>or</p> <pre><code>yield *array </code></pre>
<p>Asterisk will expand an array to individual arguments in ruby:</p> <pre><code>def test(a, b) puts "#{a} + #{b} = #{a + b}" end args = [1, 2] test *args </code></pre>
42,342
<p>I have a program that when it starts, opens a winform (it is the one specified in Application.Run(new ...). From this form I open another form:</p> <pre><code>OtherForm newForm=new OtherForm(); newForm.Show(); </code></pre> <p>How can i communicate from the new winform with the form that opened it? So that I can a...
<p>The simplest way is to override the constructor, eg, <code>OtherForm newForm=new OtherForm(string title, int data);</code>. This also works for reference types (which would be a simple way to send the data back).</p>
<p>I think I have found the answer here: <a href="http://www.c-sharpcorner.com/UploadFile/mosessaur/winformsdelegates09042006094826AM/winformsdelegates.aspx" rel="nofollow noreferrer">http://www.c-sharpcorner.com/UploadFile/mosessaur/winformsdelegates09042006094826AM/winformsdelegates.aspx</a></p> <p>I have to use del...
33,077
<p>C#</p> <p>When I try to debug my program today I get "The requested operation requires elevation" (Vista of course). Why today? I've not changed anything the reads/writes to the registry or hard drive, where should I look?</p> <p>Thanks</p>
<p>If it is just Visual Studio complaining (and not an underlying security issue of your code), you can set Visual Studio to <a href="https://stackoverflow.com/questions/258728/request-admin-privileges-for-java-app-on-windows-vista#258863">automatically run as admin</a>.</p>
<p>Just compiled the exe and now the exe require elevation outside of VS! The only interaction with the local PC is a read from the user part of the registry but that was in days ago when it worked without elevation.</p> <p>Thanks</p>
38,992
<p>In a <a href="https://stackoverflow.com/questions/21848/switch-branch-names-in-git">previous Git question</a>, Daniel Benamy was talking about a workflow in Git:</p> <blockquote> <p>I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and t...
<p>'stash' takes the uncommitted, "<em>dirty</em>" stuff on your working copy, and stashes it away, leaving you with a clean working copy.</p> <p>It doesn't really branch at all. You can then apply the stash on top of any other branch. Or, as of Git 1.6, you can do:</p> <pre><code>git stash branch &lt;branchname&gt; ...
<p>If you look for a workflow that may be more fitting than git stash, you may want to look at <a href="https://github.com/da-x/git-bottle" rel="nofollow" title="git-bottle">git-bottle</a>. It's a utility for the purpose of saving and restoring the various git working states as normal git commits, effectively snapshott...
6,075
<p>Lets say I have an EJB application which defines some entities and relations among them. I figured the DB schema can easily be created from the entities. So now the app works but after a while a need to change some relations, e.g. a one-to-one needs to become a one-to-many, can I upgrade my DB to do so WITHOUT losin...
<p>Have a look at Scott Gu's post on <a href="http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx" rel="nofollow noreferrer">form posting scenarios</a>. In particular you want to look at model binders.</p>
<p>There is always the old...</p> <pre><code>Request.Form("key"); </code></pre>
31,300
<p>What are the main differences (if any) between the box models of IE8 and Firefox3?</p> <p>Are they the same now?</p> <p>What are the other main differences between these two browsers? Can a web developer assume that these two browsers as the same since they (seem to) support the latest web standards?</p>
<p>The Internet Explorer box model has been "fixed" since Internet Explorer 6 so long as your pages are in standard compliants mode.</p> <p>See: <a href="http://en.wikipedia.org/wiki/Quirks_mode" rel="noreferrer">Quirks mode</a> and <a href="http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug" rel="noreferrer...
<p>Things that will always differ between the two (and other browsers) are default values (font sizes in headings, for example). The way they achieve default visuals is often different, as well, such as whether or not they use padding or margin to achieve the indentation in bulleted lists.</p> <p>Something quite posit...
6,727
<p>I have a custom (code-based) workflow, deployed in WSS via features in a .wsp file. The workflow is configured with a custom task content type (ie, the Workflow element contains a TaskListContentTypeId attribute). This content type's declaration contains a FormUrls element pointing to a custom task edit page.</p> ...
<p>You can use string.Format to easily pad a value with spaces e.g.</p> <pre><code>string a = String.Format("|{0,5}|{1,5}|{2,5}", 1, 20, 300); string b = String.Format("|{0,-5}|{1,-5}|{2,-5}", 1, 20, 300); // 'a' will be equal to "| 1| 20| 300|" // 'b' will be equal to "|1 |20 |300 |" </code></pre>
<p>Can't you use standard text file? You can read back data line by line.</p>
11,191
<p>Our system dynamically generates a large report by converting many HTML pages into a single PDF. The resulting PDF is sent back (via the HTTP request) to the calling browser. When the report is sufficiently large (200+ pages) IE 7 intermittently chokes. The result issue is the calling PC locks up and must be reboo...
<p>I beleive there are a few ways you can do this: 1) Stream the pdf binary data to the browser and change the mime type so the browser handles it as pdf, or 2) Stream the pdf bindara data to the broswer using the "attachment;file=" header which will cause the browser to give you the option of opening or saving the f...
<p>What headers are you serving up with the PDF? IE has issues with downloadable files if the cache headers are set to no-cache, and (although) I doubt this is the issue, IE can't handle very large downloads (e.g. 2.x Gig)</p>
21,258
<p>Please suggest some free tools which will help me to get Lines-of-Code metrics for C# projects using the command line.</p>
<p>i got the LoC using <a href="http://www.ndepend.com/" rel="nofollow noreferrer">Ndepend</a></p>
<p>i got the LoC using <a href="http://www.ndepend.com/" rel="nofollow noreferrer">Ndepend</a></p>
38,019
<p>I want to develop some educational content, which I want to distribute to children using Adobe AIR. The content will contain videos. Now, from what I see, AIR will put the content onto the local file system, for anyone to see. I want to prevent this. Is there a way out?</p>
<p>One solution is to use DRM in conjunction with Flash Media Server (as mentioned by Stu).</p> <p>Another option would be to stream the content at runtime, and not cache to the file system. </p> <p>Finally, it might also be possible to store the bits for the FLV in the encrypted local data store or SQLite database (...
<p>Possibly, but you must embrace The Dark Side -- aka DRM (Digital Rights Management). Go read up <a href="http://www.flashcomguru.com/index.cfm/2007/10/23/Flash-Video-DRM-Roundup" rel="nofollow noreferrer">Flash Video DRM</a>. It is awfully painful stuff to do correctly, and users tend to hate it. Ask yourself if ...
9,677
<p>I am currently working through various different iterations ofccreating a propeller for a model ICE (nitro engine). So far I have managed to disintegrate each of them eventually. I have been experimenting mostly with PLA and PETG so far. I am currently thinking about using carbon-infused PLA or using PC (I found one...
<p>As Kezat noted, your part has very low infill, but infill is not what provides most of the part strength anyway. From what I can see of the broken part, it looks like you only have 1 or at most 2 walls, and these are what contribute most to part strength, especially in the orientation you're working in.</p> <p>You s...
<p>For safety on a project like this, it's best to have a self-contained chamber to run a life test until the propeller falls apart. Once a material and design has a reasonable lifetime, then you could use the print.</p> <p>Reputable propeller manufacturers will already do this. They may even run a shorter burn-in te...
2,005
<p>I'm looking to introduce a unit testing framework into the mix at my job. We're using Visual Studio 2005 (though we may be moving to 2008 within the next six months) and work primarily in C#. If the framework has some kind of IDE integration that would be best, but I'm open to frameworks that don't have integration...
<p>I think <a href="https://en.wikipedia.org/wiki/NUnit" rel="nofollow noreferrer">NUnit</a> <strong>is</strong> your best bet. With <a href="https://testdriven.net/" rel="nofollow noreferrer">TestDriven.NET</a>, you get great integration within Visual Studio. (ReSharper also has a unit test runner if you're using it)....
<p><a href="https://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#.NET_programming_languages" rel="nofollow noreferrer">MbUnit</a> is worth a look. It has a set of features comparable to NUnit. It has its own GUI, or can be integrated into Visual Studio if you have <a href="https://en.wikipedia.org/wiki/JetBrai...
2,313
<p>I'm having an annoying problem registering a javascript event from inside a user control within a formview in an Async panel. I go to my formview, and press a button to switch into insert mode. This doesn't do a full page postback. Within insert mode, my user control's page_load event should then register a javascr...
<p>Have you tried using RegisterClientSideScript? You can always check the key for the script with IsClientSideScriptRegistered to ensure you don't register it multiple times. </p> <p>I'm assuming the async panel is doing a partial page past back which doesn't trigger the mechansim to regenerate the startup scripts. P...
<p>Try this, i got the same issue</p> <pre><code>ScriptManager.RegisterClientScriptBlock(MyBase.Page, Me.[GetType](), ("dialogJavascript" + this.ID), "alert(\"Registered\");", True) </code></pre> <p>This worked for me!</p>
15,486
<p>I still haven't got my head around decorators in Python.</p> <p>I've already started using a lot of closures to do things like customize functions and classes in my coding.</p> <p>Eg.</p> <pre><code>class Node : def __init__(self,val,children) : self.val = val self.children = children def mak...
<p>While it is true that syntactically, decorators are just "sugar", that is not the best way to think about them.</p> <p>Decorators allow you to weave functionality into your existing code without actually modifying it. And they allow you to do it in a way that is declarative.</p> <p>This allows you to use decorator...
<p>Following up Dutch Master's AOP reference, you'll find that using decorators becomes especially useful when you start <strong>adding parameters</strong> to modify the behaviour of the decorated function/method, and reading that above the function definition is so much easier.</p> <p>In one project I recall, we need...
26,511
<p>I want to get the base 10 logarithm of a Fixnum using Ruby, but found that n.log or n.log10 are not defined. Math::log is defined but uses a different base than 10.</p> <p>What is the easiest way to get the base 10 logarithm of a Fixnum?</p>
<p>There is </p> <pre><code>Math::log10 (n) </code></pre> <p>And there is also a property of logarithms that <code>logx(y) = log(y)/log(x)</code></p>
<p><a href="http://www.ruby-doc.org/core-1.8.7/classes/Math.html#M001197" rel="nofollow noreferrer">Math.log10</a>(numeric) => float returns base 10 log</p>
7,447
<p>3D printing can be used to make injection molds of unimaginable complexity but which kind of 3D printing process is suitable when? </p> <p>Suppose that a part is to be made using injection molding in large quantity for an extended period of time, what Additive Manufacturing (AM) process will be the best, such that ...
<p>Yes, this is very broad. That said...</p> <p>For high detail you want SLA. i.e. jewelry. If you just want a prototype of a mold, you can do a standard FDM style printer (95% of printers are FDM, and that number is a guess)</p> <p>Really, you should be asking what material you need for your mold, but you can open a...
<p>Injection molds generally require tooling and are not usually cast from 3D prints. Depending on the size of your part - costs can easily skyrocket to over $60,000. The price per part is sometimes lower than other methods. Other possible methods (depending on the part) are Thermo-Forming, Vacu-Forming, and differe...
450
<p>I'm looking at the new object initializers in C# 3.0 and would like to use them. However, I can't see how to use them with something like Microsoft Unity. I'm probably missing something but if I want to keep strongly typed property names then I'm not sure I can. e.g. I can do this (pseudo code)</p> <pre><code>Dicti...
<p>Look no further, use <a href="http://visifire.com/silverlight_chart_designer.php" rel="nofollow noreferrer">visifire</a>.</p>
<p>I am not sure how well it will fit your needs, but you might take a look at <a href="http://www.visifire.com/" rel="nofollow noreferrer">http://www.visifire.com/</a><br> Visifire is an open source graphing control for Silverlight and WPF.</p>
42,211
<p>i have the following jquery code. </p> <p>basically i will have several overlapped divs and a list of links on the right of all those overlapped divs. when hovering over a link, the link's assigned div will fade in.</p> <p>I have the following code and it works (it uses the default windows' sample pictures), but i...
<p>The first thing you can do, to make it cleaner is replace all those similar calls with something more generic. </p> <p>(note: assume all of this is inside of <code>document.ready()</code>)</p> <pre><code>$('#trigger1').data('target', '#divsunset'); $('#trigger2').data('target', '#divwinter'); $('#trigger3').data(...
<p>It's good, but you'll need a more generic approach to the id's you've assigned.</p> <p>The quickest solution that comes to mind is to wrap up the overlapped divs that fade in under a parent div "#wrapped". Take all the links and assign them CSS classes 'trigger NAME' where 'NAME' is 'Sunset, 'Winter', etc. Then you...
46,081
<p>I have a Rails application that in the erb code, I use a select box. What I would like to do is reload the page passing the sort parameter. My controller already handles it, but I don't know how to reload the page with the selected value from my select box. Here is my code:</p> <pre><code>&lt;% @options = {:latest ...
<p>Have you considered using an ajax call on your list box? If you have a method on your controller that returns just the sorted list, based on sort parameter, then you could do:</p> <pre><code>&lt;% @options = {:latest =&gt; 'lastest' , :alphabetical =&gt; 'alphabetical', :pricelow =&gt; 'price-low', :pricehigh =&gt;...
<p>If you don't want to use AJAX, then put a form_tag around your code.</p> <p>Take a look at the Redmine source code on <a href="http://redmine.rubyforge.org/svn/trunk" rel="nofollow noreferrer">http://redmine.rubyforge.org/svn/trunk</a>. The UsersController does something similar - there's a combo box that allows a ...
28,142
<p>Is there a specfic <a href="http://en.wikipedia.org/wiki/Design_Patterns" rel="nofollow noreferrer">Gang Of Four Design Pattern</a> that you frequently use, yet hardly see used in other peoples designs? If possible, please describe a simple example where this pattern can be useful. It doesn't have to necessarily b...
<p>Strategy pattern maybe? I see not a lot of person using it and it's quite useful when calculations change or can be accumulated together. I use it when a part of the calculation can be replaced by another calculation. Often in program that use for enterprise rate for product.</p> <p>Here is some documentation :</p>...
<p>The Visitor pattern seems to be hard to understand for many new developers. I was using it for calculus when I had possibility to get value for Country>State>City>House. This way I haven't need to change how many data had in each sub collection. I just choose the right visitor and the final answer was get whatever t...
15,565
<p>I have a J2EE based web application, in which on clicking a button I need to create a word file from Java. I want to be able to sent the printing command to this file, so that the file is being printed without the user having to open the document and do it manually.</p> <p>Could anyone please tell me if this is poss...
<p>It is easy to generate the file. Take a look at <a href="http://poi.apache.org/" rel="nofollow noreferrer">Apache POI</a>, a Java API To Access Microsoft Format Files. The site is plenty of examples.</p> <p>About printing it, I don't really know if that's possible. I think you always need to open it in the clien...
<p>As you are specifically mentioning Java as your environment you might want to take OpenOffice or StarOffice into account - they have an API that's a lot easier to talk to from Java than ActiveX or remote-controlling Word. </p> <p>It's no more heavyweight than Word is. References and docs should be easy to find.</p>...
24,734
<p>I want to give credit to all open source libraries we use in our (commercial) application. I thought of showing a HTML page in our about dialog. Our build process uses ant and the third party libs are committed in svn.</p> <p>What do you think is the best way of generating the HTML-Page? </p> <ul> <li>Hard code th...
<p>There are two different things you need to consider. </p> <p>First, you may need to identify the licenses of the third-party code. This is often down with a THIRDPARTYLICENSE file. Sun Microsystems does this a lot. Look in the install directory for OpenOffice.org, for example. There are examples of .txt and .h...
<p>Ant task seems to be the best way. We do a similar thing in one of our projects. All the open source libraries are present in a specified folder. An Ant task reads the manifest of these libraries, versions and so on and generates an HTML, copies into another specified folder from where it is picked up by the web con...
35,084
<p>I am having a strange intermittent printing error specific to one particular object I'm trying to print.</p> <p><a href="https://i.stack.imgur.com/L7Sxz.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/L7Sxz.jpg" alt="A picture of my print error"></a></p> <p>My printer is a BCN3D Sigma R17. I am printing ...
<p>Well, for a 0.6 wall thickness using a 0.6 nozzle you should have one line for the whole wall. But I´m seeing in your prints walls of 0.1 and 0.4 as infill, Why? I´m using simplify3D and I can see the results about walls and infill prior to send to the printer. On this kind of parts avoid infill and give priority to...
<p>I'd suggest you change the Flow (%).</p> <p>It is usually at 100%, but can be adjusted. I'd suggest printing at 80%, and adjusting from there.</p> <p>Layer height, printing speed or other configurations always change the Extrusion Rate with it, because for example higher layers always require more material extrude...
625
<p>I am creating some build scripts that interact with Perforce and I would like to mark for delete a few files. What exactly is the P4 syntax using the command line?</p>
<pre><code>p4 delete filename </code></pre> <p>(output of p4 help delete)</p> <p>delete -- Open an existing file to delete it from the depot</p> <p>p4 delete [ -c changelist# ] [ -n ] file ...</p> <pre><code>Opens a file that currently exists in the depot for deletion. If the file is present on the client it is rem...
<p>Admitted - it takes a (small) number of steps to find the (excellent!) Perforce user guide online in the version that matches your installation and get to the chapter with the information you need.</p> <p>Whenever I find myself in need of anything about the p4 command line client, I rely on the help Perforce have b...
20,354
<p>I'd like to warn users when they <strong>try to close a browser window</strong> if they <strong>didn't save</strong> the changes they made in the web form.</p> <p>I'm using ASP.NET 3.5 (with ASP.NET Ajax).</p> <p>Is there a common solution which I could easily implement?</p> <p><em>EDIT: maybe my question wasn't ...
<p>Here is an ASP.NET extender control that will help you with this:</p> <p><a href="http://www.codeproject.com/KB/ajax/ajaxdirtypanelextender.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/ajax/ajaxdirtypanelextender.aspx</a></p> <p>Hope this helps. It may not perfectly fit your needs but it at least...
<p>On the Page_Unload event (or call this function in your body tag, <code>&lt;body onunload="onPageUnload();"&gt;</code>), you can have a check if the form has data in it. Then you could run some Java:</p> <pre><code>&lt;script language="text/javascript"&gt; function onPageUnload() { var oConfirm = window...
31,106
<p><em>UPDATE: Focus your answers on hardware solutions please.</em></p> <p>What hardware/tools/add-in are you using to improve ASP.NET compilation and first execution speed? We are looking at solid state hard drives to speed things up, but the prices are really high right now.</p> <p>I have two 7200rpm harddrives ...
<p>One of the important things to do is keeping projects of not-so-often changed assemblies unloaded. When a change occurs, load it, compile and unload again. It makes huge differences in large solutions.</p>
<p>You can precompile the site, which will make the first run experience better</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms227972.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms227972.aspx</a></p>
13,702
<p>What are the compelling features of MFC? Why would you select it for a new project?</p>
<p>MFC was a good option 10 years ago. It is still a good wrapper over Win32 API but unfortunately obsolete.</p> <p><a href="https://www.qt.io/" rel="nofollow noreferrer">Qt</a> is a better option with one big advantage - it is platform-independent. With MFC you're doomed to Windows.</p>
<p>I've written cross platform code for years so when I need to write something I always have a very thin abstraction layer between it and the system calls for almost everything except posix calls. That way you can code it go MFC but quite easily convert it a different API later if needed. My base set of c++ libraries ...
14,738
<p>In C# there are <code>String</code> objects and <code>string</code> objects. </p> <p>What is the difference between the two? What are the best practices regarding which to use?</p>
<p>There is no difference. string (lower case) is just an alias for System.String.</p>
<p>There is no difference because string is converted to System.String by the compiler. Same with all of the common types (int goes to System.Int32, etc). We use the simple name so they stand out.</p>
14,191
<p>I am trying to publish an Asp.net MVC web application locally using the NAnt and MSBuild. This is what I am using for my NAnt target;</p> <pre><code>&lt;target name="publish-artifacts-to-build"&gt; &lt;msbuild project="my-solution.sln" target="Publish"&gt; &lt;property name="Configuration" value="debug" /...
<p>The "Publish" target you are trying to invoke is for "OneClick" deployment, not for publishing a website... This is why you are getting the seemingly bizarre message. You would want to use the AspNetCompiler task, rather than the MSBuild task. See <a href="http://msdn2.microsoft.com/en-us/library/ms164291.aspx" r...
<p>I came up with such solution, works great for me:</p> <pre><code>msbuild /t:ResolveReferences;_WPPCopyWebApplication /p:BuildingProject=true;OutDir=C:\Temp\buidl\ Test.csproj </code></pre> <p>Secret sauce is _WPPCopyWebApplication target.</p>
7,101
<p>I have a model that contains a cavity, into which I want to insert a piece of metal, so I can use a magnet to stick to the print. How can I introduce a pause into the G-code without manipulating it manually in Ultimaker Cura?</p>
<p>Ultimaker Cura contains "Extensions"; in version 4.1.0, the process is as follows:</p> <ul> <li>Extensions -> Post Processing -> Modify G-code</li> <li>Add a Script -> Pause at height <ul> <li>Choose the one that matches your firmware!</li> </ul></li> <li>Choose the <code>Pause height</code> to match the height th...
<p><a href="/a/10588/">This answer</a> already explains how you insert the G-codes to enable a pause into your model. But, <strong>this will only work if the printer supports the G-codes that are inserted by Cura</strong>. E.g. <a href="/q/11236">this question</a> shows that this does not always work!</p> <p>To pause ...
1,410
<blockquote> <p>The APIs that might be of interest to developers of Java applications that need to perform source code analysis are the Java Compiler API (JSR 199), the Pluggable Annotation Processing API (JSR 269), and the Compiler Tree API.</p> </blockquote> <p>Any similar api or library for .net?</p>
<p>Visual Studio 2008 comes with a tool that run source code analysis: it gives you the code inheritance depth, lines of code (compiled), mainteinability indexes for your solution/project/clases/methods.</p> <p>Im not sure if there is a plugin for VS2003-2005 with this functionality.</p> <p>For the comments of the me...
<p>Visual Studio 2008 comes with a tool that run source code analysis: it gives you the code inheritance depth, lines of code (compiled), mainteinability indexes for your solution/project/clases/methods.</p> <p>Im not sure if there is a plugin for VS2003-2005 with this functionality.</p> <p>For the comments of the me...
44,710
<p>Where can I find a Perl module for converting a Perl data structure into a JavaScript one?</p> <p>e.g. this is my code (Mason):</p> <pre><code>% # convert our @cti data structure into a javascript one var cti = [ % foreach my $cti_category (@cti) { { label: "&lt;% $cti_category-&gt;...
<p>JSON stands for JavaScript Object Notation, which is the format you're looking for.</p> <p>Unfortunately, none of the modules you're looking for are in the Perl core, but they are available on CPAN, as a quick <a href="http://search.cpan.org/search?query=JSON&amp;mode=all" rel="noreferrer">search</a> will reveal.</...
<p><a href="http://search.cpan.org/~makamaka/JSON-2.53/lib/JSON.pm" rel="nofollow noreferrer">JSON</a> !</p> <blockquote> <p>This module converts Perl data structures to JSON and vice versa using either JSON::XS or JSON::PP.</p> </blockquote>
16,303
<p>I am writing a web application that requires user interaction via email. I'm curious if there is a best practice or recommended source for learning about processing email. I am writing my application in Python, but I'm not sure what mail server to use or how to format the message or subject line to account for aut...
<p>There are some pretty serious concerns here for how to send email automatically, and here are a few:</p> <p>Use an email library. Python includes one called 'email'. This is your friend, it will stop you from doing anything tragically wrong. Read an example from <a href="http://docs.python.org/lib/node161.html" rel...
<p>Some general information with regards to automated mail processing...</p> <p>First, the mail server "brand" itself isn't that important for broadcasting or receiving emails. All of them support the standard smtp / pop3 communications protocol. Most even have IMAP support and have some level of spam filtering. Tha...
10,502
<p>Can anyone tell me how I can display a status message like "12 seconds ago" or "5 minutes ago" etc in a web page?</p>
<p>Here is the php code for the same:</p> <pre><code>function time_since($since) { $chunks = array( array(60 * 60 * 24 * 365 , 'year'), array(60 * 60 * 24 * 30 , 'month'), array(60 * 60 * 24 * 7, 'week'), array(60 * 60 * 24 , 'day'), array(60 * 60 , 'hour'), array(60...
<p>PHP's <code>\DateTime::diff</code> returns a <a href="http://nl3.php.net/dateInterval" rel="noreferrer"><code>\DateInterval</code></a> object on which you can get the minutes by the public <code>i</code> property.</p>
3,923
<p>I'm working on a large application (300K LOC) that is causing a memory leak in the Sun 1.6 JVM (1.6_05). Profiling the Java shows no leak. Are there any diagnostics available from the JVM that might detect the cause of the leak?<br> I haven't been able to create a simple, isolated Java test case. Is the only way to ...
<p>Some profiler like profiler4j can show the managed and the unmanaged memory (live curve). Then you can see if you has a leak and when the leak occur. But you does not find more informations.</p> <p>After this there are 2 possible solutions:</p> <ol> <li>You can with the live curve isolate the problem and create a ...
<p>I love valgrind ( <a href="http://valgrind.org/" rel="nofollow noreferrer">http://valgrind.org/</a> ), if you are executing it on a system it supports. It really rocks!</p>
13,345
<p>I understand that Parrot is a virtual machine, but I feel like I'm not completely grasping the idea behind it.</p> <p>As I understand, it's a virtual machine that's being made to handle multiple languages. Is this correct? </p> <p>What are the advantages of using a virtual machine instead of just an interpreter?...
<p><A href="http://www.parrotcode.org/" rel="noreferrer">Parrot</a> is a virtual machine specifically designed to handle several languages, especially the dynamic languages. Despite some of the interesting technology involved, since it can handle more than one language, it will be able to cross language boundaries. For...
<p>Honestly, I didn't know it was that big of a deal. It has come a long way, but just isn't seeing much use. The main target language has yet to really arrive, and has lost a huge mind-share among the industry professionals. Meanwhile, other solutions like .Net and projects like Jython show us that the here-and-now ca...
14,381
<p>I have a list of data that looks like the following:</p> <pre><code>// timestep,x_position,y_position 0,4,7 0,2,7 0,9,5 0,6,7 1,2,5 1,4,7 1,9,0 1,6,8 </code></pre> <p>... and I want to make this look like:</p> <pre><code>0, (4,7), (2,7), (9,5), (6,7) 1, (2,5), (4,7), (9,0), (6.8) </code></pre> <p>My plan was to ...
<p>Let's look at</p> <pre><code>d[t].append(c) </code></pre> <p>What is the value of <code>d[t]</code>? Try it.</p> <pre><code>d = {} t = 0 d[t] </code></pre> <p>What do you get? Oh. There's nothing in <code>d</code> that has a key of <code>t</code>.</p> <p>Now try this.</p> <pre><code>d[t] = [] d[t] </code></...
<pre><code>dict=[] //it's not a dict, it's a list, the dictionary is dict={} elem=[1,2,3] dict.append(elem) </code></pre> <p>you can access the single element in this way:</p> <pre><code>print dict[0] // 0 is the index </code></pre> <p>the output will be:</p> <pre><code>[1, 2, 3] </code></pre>
42,447
<p>do you use a tool? or just manually make them?</p>
<p><a href="http://code.google.com/apis/chart/basics.html" rel="nofollow noreferrer">Google charts api/server</a> can make one fairly easily</p> <p><img src="https://chart.apis.google.com/chart?chs=600x250&amp;cht=lxy&amp;chtt=Burndown&amp;chxt=x,y&amp;chxl=days&amp;chdl=Estimated|Actual&amp;chco=FF0000,00FF00&amp;chd...
<p>We use something locally based on <a href="http://opentcdb.org/" rel="nofollow noreferrer">http://opentcdb.org/</a> but that does scrum tracking, and draws pretty graphs.</p>
14,376
<p>I have a rather large (many gigabytes) table of data in SQL Server that I wish to move to a table in another database on the same server.</p> <p>The tables are the same layout.</p> <p>What would be the most effecient way of going about doing this?</p> <p>This is a one off operation so no automation is required.</...
<p>If it is a one-off operation, why care about <em>top</em> efficiency so much?</p> <pre><code>SELECT * INTO OtherDatabase..NewTable FROM ThisDatabase..OldTable </code></pre> <p>or</p> <pre><code>INSERT OtherDatabase..NewTable SELECT * FROM ThisDatabase..OldTable </code></pre> <p>...and let it run over night. I wo...
<p>If it's SQL Server 7 or 2000 look at Data Transformation Services (DTS). For SQL 2005 and 2008 look at SQL Server Integration Services (SSIS)</p>
40,548
<p>I'm using LINQ to SQL and C#. I have two LINQ classes: User and Network. </p> <p>User has UserID (primary key) and NetworkID</p> <p>Network has NetworkID (primary key) and an AdminID (a UserID)</p> <p>The following code works fine:</p> <pre><code>user.Network.AdminID = 0; db.SubmitChanges(); </code></pre> <p>...
<p>I just ran a quick test and it works fine for me. </p> <p>I hate to ask this, but are you sure the if statement ever returns true? It could be you're just not hitting the code which changes the value.</p> <p>Other than that we might need more info. What are the properties of that member? Have you traced into t...
<p>Here's the original <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3086400&amp;SiteID=1" rel="nofollow noreferrer">post</a>.</p> <hr> <p>Here's a setter generated by the LinqToSql designer.</p> <p>Code Snippet</p> <pre><code>{ Contact previousValue = this._Contact.Entity; if (((previousValue ...
18,804
<p>I am trying to create wrapper functions for <code>free</code> and <code>malloc</code> in C to help notify me of memory leaks. Does anyone know how to declare these functions so when I call <code>malloc()</code> and <code>free()</code> it will call my custom functions and not the standards lib functions?</p>
<p>You have a few options:</p> <ol> <li><p><strong>GLIBC-specific solution (mostly Linux).</strong> If your compilation environment is <code>glibc</code> with <code>gcc</code>, the preferred way is to use <a href="http://www.gnu.org/software/libtool/manual/libc/Hooks-for-Malloc.html" rel="noreferrer">malloc hooks</a>....
<p>If you are using Linux, you can use malloc_hook() (with GNU glibc). This function allows you to have malloc call your function prior to calling the actual malloc. The man page has an example on how to use it.</p>
32,850
<p>How do I get AS3 and/or Flex/AIR applications to communicate with CORBA apps?</p>
<p>Until somebody writes a CORBA-compliant library for Flex (which you may care to do yourself ;), your best bet may be to build a 'wrapper' web service (accessible via the standard Flex WebService object) that acts as a bridge.</p>
<p>I think you need to make some sort of proxy, like a Java server that you connect to. I don't think there are any CORBA libraries for AS3. I could be wrong though...</p>
43,971
<p>I have a c++ header file containing a class. I want to use this class in several projects, bu I don't want to create a separate library for it, so I'm putting both methods declarations and definitions in the header file: </p> <pre><code>// example.h #ifndef EXAMPLE_H_ #define EXAMPLE_H_ namespace test_ns{ class ...
<p>These are not equivalent. The second example given has an implicit 'inline' modifier on the method and so the compiler will reconcile multiple definitions itself (most likely with internal linkage of the method if it isn't inlineable).</p> <p>The first example isn't inline and so if this header is included in multi...
<pre><code>//Baseclass.h or .cpp #ifndef CDerivedclass #include "Derivedclass.h" #endif or //COthercls.h or .cpp #ifndef CCommonheadercls #include "Commonheadercls.h" #endif I think this suffice all instances. </code></pre>
26,054
<p>Using an FDM printer and PLA or ABS, without adding support material. What modifications can I make to improve how steep an overhang my printer can print before it starts having problems?</p> <p>The obvious first answer is to add a cooling fan, increasing the airflow over the freshly-extruded material ensuring it s...
<p>The two most important things you can do are:</p> <ul> <li>Provide adequate cooling to solidify the plastic quickly</li> <li>Minimize layer height</li> </ul> <p>Cooling is really obvious. You need the plastic to solidify before it has a chance to sag. PLA in particular has to shed a lot of heat before it is fully ...
<p>There's an answer <a href="https://3dprinting.stackexchange.com/questions/519/how-to-improve-face-that-are-printed-on-support?answertab=oldest#tab-top">here</a> that holds some of the same concepts. Regarding your questions: </p> <ul> <li><strong>Does lowering the temperature help? Raising it?</strong> : Yes, lower...
209
<p>I would like to store log4net config data in my application.config file. Based on my understanding of the documentation, I did the following:</p> <ol> <li><p>Add a reference to log4net.dll</p></li> <li><p>Add the following line in AssemblyInfo.cs: </p> <pre><code>[assembly: log4net.Config.XmlConfigurator(Watch = ...
<p>Add a line to your app.config in the configSections element</p> <pre class="lang-xml prettyprint-override"><code>&lt;configSections&gt; &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" /&gt...
<p>Have you tried adding a <code>configsection</code> handler to your app.config? e.g.</p> <pre class="lang-xml prettyprint-override"><code>&lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/&gt; </code></pre>
48,722
<p>I've used lex and yacc (more usually bison) in the past for various projects, usually translators (such as a subset of EDIF streamed into an EDA app). Additionally, I've had to support code based on lex/yacc grammars dating back decades. So I know my way around the tools, though I'm no expert.</p> <p>I've seen posi...
<h3>Update/warning: This answer may be out of date!</h3> <hr /> <p>One major difference is that ANTLR generates an LL(*) parser, whereas YACC and Bison both generate parsers that are LALR. This is an important distinction for a number of applications, the most obvious being operators:</p> <pre><code>expr ::= expr '+' ...
<p>Another advantage of ANTRL is that you can use <a href="http://www.antlr.org/works/index.html" rel="noreferrer">ANTLRWORKS</a>, although I can't say that this is a strict advantage, as there may be similar tools for other generators as well.</p>
26,166
<p>What is better?</p> <p><strong>A:</strong></p> <pre><code>server:1080/repo/projectA/trunk/... branches/branch1 branches/branch2 branches/branch3 tags/tag1/... tags/tag2/... server:1080/...
<p>The <a href="http://svnbook.red-bean.com/en/1.5/svn.reposadmin.html" rel="noreferrer">Repository Administration</a> chapter of the <a href="http://svnbook.red-bean.com/en/1.5/index.html" rel="noreferrer">SVN book</a> includes a section on <a href="http://svnbook.red-bean.com/en/1.5/svn.reposadmin.planning.html#svn.r...
<p>We use </p> <pre><code>/repos/projectA/component1/trunk - branches - tags /repos/projectA/component2/trunk - branches - tags /repos/projectB/component3/trunk - branches - tags /repos/projectB/component4/trunk - branches - tags </code></pre> <p>Which I'm starting to regret. It should be flatter. This would be bet...
18,379
<p>When logging with Log4Net it's very easy to put class that called the log into the log file. I've found in the past that this makes it very easy to trace through the code and see the flow through the classes. In Log4Net I use the %logger property in the conversion pattern like so: </p> <pre><code>&lt;conversionPa...
<p>Add the calling method to the LogEntry's ExtendedProperties dictionary; assuming you haven't removed the ExtendedProperties tokens from the formatter template, of course.</p> <p>Put something like this in a logging wrapper: </p> <pre><code>public void LogSomething(string msg) { LogEntry le = new LogEntry { Mess...
<p>We havn't found an easy way without hitting the StackTrace. If it's an exception, we just grab from that:</p> <pre><code> StackTrace trace = new StackTrace(ex, true); StackFrame frame = trace.GetFrame(0); </code></pre> <p>For chatty items, we just write the string. We have a snippet that's able to grab the clas...
12,520
<p>In the company where I work we have major releases twice every year. Extensive testing (automated and manual) is done the weeks before. The automated tests produce logfiles, the results of the manual tests are written down in test plans (Word documents). As you can imagine this results in a lot of different files t...
<p>You could use combination of a bug tracker (JIRA, Mantis, Bugzilla) and test case management tool like <a href="http://testlink.org/wordpress/" rel="nofollow noreferrer">testlink</a></p>
<p>If you develop with MS products and technologies you could always look at <a href="http://msdn.microsoft.com/en-us/tfs2008/default.aspx" rel="nofollow noreferrer">Team Foundation Server</a>. I find it fits perfectly for managing automated Unit Testing/builds, managing bugs, managing test results, assigning testing t...
22,537