instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I use some wx.ListCtrl classes in wx.LC_REPORT mode, augmented with ListCtrlAutoWidthMixin.</p> <p>The problem is: When user double clicks the column divider (to auto resize column), column width is set to match the width of contents. This is done by the wx library and resizes column to just few pixels when the con...
<p>Ok, after some struggle I got working workaround for that. It is ugly from design point of view, but works well enough for me.</p> <p>That's how it works:</p> <ol> <li><p>Store the initial width of column.</p> <pre><code>self.SetColumnWidth(colNum, wx.LIST_AUTOSIZE_USEHEADER) self.__columnWidth[colNum] = self.Ge...
<p>Ok, after some struggle I got working workaround for that. It is ugly from design point of view, but works well enough for me.</p> <p>That's how it works:</p> <ol> <li><p>Store the initial width of column.</p> <pre><code>self.SetColumnWidth(colNum, wx.LIST_AUTOSIZE_USEHEADER) self.__columnWidth[colNum] = self.Ge...
49,394
<p>Is there a way to detect whether IIS is enabled or not?</p> <p>I know how to check if it is INSTALLED, but I need to know if it's installed but not enabled.</p> <p>Also, can this be done natively via InstallShield? Checking this via .NET would be acceptable as we can write custom actions, but if there is an IS ca...
<p>You can't append to an actual array - the size of an array is fixed at creation time. Instead, use a <code>List&lt;T&gt;</code> which can grow as it needs to.</p> <p>Alternatively, keep a list of arrays, and concatenate them all only when you've grabbed everything.</p> <p>See <a href="https://learn.microsoft.com/en-...
<p>Olmo's suggestion is very good, but I'd add this: If you're not sure about the size, it's better to make it a little bigger than a little smaller. When a list is full, keep in mind it will double its size to add more elements. </p> <p>For example: suppose you will need about 50 elements. If you use a 50 elements si...
39,186
<p>I'm looking for advanced strategies for dealing with User Object Handle limits when building heavy-weight windows interfaces. Please explain how you overcame or bypassed this issue using SWT or direct Windows GUI APIs. The only thing I am not interested in is strategies to optimize widget usage as I have done this...
<p>You should think about using windowless controls. They are designed for precisely this situation. See <a href="https://devblogs.microsoft.com/oldnewthing/20050211-00/?p=36473" rel="nofollow noreferrer">"Windowless controls are not magic"</a>, by Raymond Chen</p>
<p>Not only top-level windows, but most native controls use one user object each. See <a href="http://msdn.microsoft.com/en-us/library/ms810501.aspx" rel="nofollow">Give Me a Handle, and I'll Show You an Object</a> for an in-depth explanation of user- and other handle types. This also means that SWT uses at least one u...
19,917
<p>I would like to draw a diagram in HTML. The positioning structure looks like this:</p> <pre class="lang-html prettyprint-override"><code>&lt;div id='hostDiv'&gt; &lt;div id='backgroundDiv'&gt; ... drawing the background ... &lt;/div&gt; &lt;div id='foregroundDiv' style='position: absolute;'&gt; ... dra...
<p>There isn't any way to predict the height without actually rendering it in the target browser.</p> <p>Once you do that, you can use (for example) <a href="http://docs.jquery.com/" rel="noreferrer"><strong>jQuery</strong></a> to get the height of the element:</p> <pre><code>var height = $('#myTable').height(); </co...
<p>I think you can use one of DOM attributes: clientHeight, offsetHeight, and scrollHeight as defined in w3 <a href="http://www.w3.org/TR/cssom-view/#extensions-to-the-element-interface" rel="nofollow">here</a></p> <p>This is the usage of clientHeight:</p> <pre><code>document.getElementById("#Table").clientHeight; do...
19,580
<p>I am writing a text editor which has an option to display a bullet in place of any invisible Unicode character. Unfortunately there appears to be no easy way to determine whether a Unicode character is invisible.</p> <p>I need to find a text file containing every Unicode character in order that I can look through ...
<p>Oh, I see... actual invisble characters ;) This FAQ will probably be useful:</p> <p><a href="http://www.unicode.org/faq/unsup_char.html" rel="nofollow noreferrer">http://www.unicode.org/faq/unsup_char.html</a></p> <p>It lists the current invisible codepoints and has other information that you might find helpful.</...
<p>Its an impossible task, Unicode supports even Klingon, so it's not going to work. However most text editors use the standard ANSI invisible characters. And if your Unicode library is good, it will support finding equivalent characters and/or categories, you can use these two features to do it as well as any editor o...
39,127
<p>There's been this ongoing display issue my team has been having with the font size rendering larger than it should within the product. We've been having a heck of time pinpointing what it is.</p> <p>Here's a screenshot of a before and after shot: <a href="http://quickbase.intuit.com/images/font-issue.gif" rel="nofo...
<p>I've had the same issue with quickbase (and other aps) in the past. I've always put it down to some external resource not loading (css or javascript). I feel confident in that since I know that one of the aps it happens on isn't that complicated.</p> <hr> <p>A little more information:</p> <p>I noticed that your ...
<p>Run some validator on your code, perhaps there's some error in the HTML code or in a script that enlarges the font.</p>
49,003
<p>When I build a unit test project before the tests are executed the test output is copied to a TestResults folder and then the tests are executed. The issue I'm having is that not all the files in the Debug/bin directory are copied to the TestResults project.</p> <p>How can I get a file that is copied to the Debug/...
<p>The standard way to do this is by specifying the <a href="http://msdn.microsoft.com/en-us/library/ms182473.aspx" rel="noreferrer" title="MSDN: Team System Test Deployment">deployment items</a> in the <em><code>.testrunconfig</code></em> file, which can be accessed via the <em>Edit Test Run Configurations</em> item i...
<p>Try out the Post-Build event command line from within Visual Studio (if you are using that IDE).</p>
28,160
<p>We have a server (written in C and C++) that currently catches a SEGV and dumps some internal info to a file. I would like to generate a core file and write it to disk at the time we catch the SEGV, so our support reps and customers don't have to fuss with ulimit and then wait for the crash to happen again in order ...
<p>Google has a library for generating coredumps from inside a running process called <a href="http://code.google.com/p/google-coredumper/" rel="noreferrer">google-coredumper</a>. This should ignore ulimit and other mechanisms. </p> <p>The documentation for the call that generates the core file is <a href="http://code...
<p>system ("kill -6 ")</p> <p>I'd give it a try if you are still looking for something</p>
41,186
<p>Suppose user has opened my web application in many different browser windows. After sometime he is timed out / sign out from the application.</p> <p>I want to close all the related browser windows. How can we handle this?</p> <p>(I think GMAIL does that)</p>
<p>If you maintain references to any child windows, you can use <a href="http://www.w3schools.com/HTMLDOM/met_win_close.asp" rel="nofollow noreferrer">window.close()</a> in combination with <a href="http://www.w3schools.com/js/js_timing.asp" rel="nofollow noreferrer">setTimeout()</a>.</p> <p>As a note, you should prob...
<p>Write a scriplet that when the focus is brought to the window (for your application) it checks to see if the session is still valid. If it is not, then send a command to close the window.</p>
45,605
<p>With CSS bugs, do you fix them as and when they arise during each stage of your development, or do you save them up till the end? as I'm at quite an early stage in a large project and seem to be getting bogged down with annoying IE6 bugs.</p>
<p><strong>My Workflow:</strong></p> <ul> <li>Develop on Firefox. <strong>Edit:</strong> Try and take care of known ie6 bugs - but do not waste time checking.</li> <li>Validate</li> <li>Check on Chrome/Safari. Usually OK</li> <li>Hack for IE7 - Usually not much to do. Add hacks in a separate stylesheet if necessary.</...
<p>I also develop on FF and only test for IE compatibility. I tend to fix big issues as I develop so I can verify that the desired style is achievable on all browsers. I leave all the small stuff or later ie. defining the margins and such to achieve the exact layout we want. An by later I don't mean the end of the proj...
32,249
<p>I am having trouble getting my ASP.NET application to start an application. For example when I type: <a href="http://my.domain.com/virtualdir" rel="nofollow noreferrer">http://my.domain.com/virtualdir</a> or </p> <p><a href="http://my.domain.com/virtualdir/default.aspx" rel="nofollow noreferrer">http://my.domain.c...
<p>Is the textbox for editing the node? or for secondary data? If the node, it can already be editable (Edit/BeginEdit or something). If secondary data, I would be quite tempted to push this into a single textbox that displays/edits the data for the current selected node. That may text-boxes is going to be confusing!</...
<p>Don't use useless 3rd party controls, as they are native in Windows ! (in particular the TreeListView, which is native since NT 3.5)</p>
42,129
<p>What are the lesser-known but useful features of the Haskell programming language. (I understand the language itself is lesser-known, but work with me. Even explanations of the simple things in Haskell, like defining the Fibonacci sequence with one line of code, will get upvoted by me.) </p> <ul> <li>Try to limit a...
<p><strong>My brain just exploded</strong></p> <p>If you try to compile this code:</p> <pre><code>{-# LANGUAGE ExistentialQuantification #-} data Foo = forall a. Foo a ignorefoo f = 1 where Foo a = f </code></pre> <p>You will get this error message:</p> <pre>$ ghc Foo.hs Foo.hs:3:22: My brain just exploded. ...
<p><strong>Monads</strong></p> <p>They are not that hidden, but they are simply everywhere, even where you don't think of them (Lists, Maybe-Types) ...</p>
25,944
<p>Usually Flash and Flex applications are embedded on in HTML using either a combination of <code>object</code> and <code>embed</code> tags, or more commonly using JavaScript. However, if you link directly to a SWF file it will open in the browser window and without looking in the address bar you can't tell that it wa...
<p>Upsides for linking directly to SWF file:</p> <ul> <li>Faster access</li> <li>You know it's a flash movie even before you click on the link</li> <li>Skipping the html &amp; js files (You won't use CSS to display 100% flash movie anyway)</li> </ul> <p>Downsides:</p> <ul> <li>You have little control on movie defau...
<p>Adobe should be ashamed of themselves with the standard embed, which defeats the puprose of convention over configuration. Check ^swfobject (as mentioned above) or <a href="http://code.google.com/p/swfin/" rel="nofollow noreferrer">swfin</a></p>
7,756
<p>Is it possible using Java to convert a real time audio stream from the mixer to MP3? </p> <ul> <li>It has to be converted chunk by chunk otherwise the memory will be exhausted. </li> <li>I already know how to record but only to lossless formats such as wav and aiff. </li> <li>I need conversion as the audio comes i...
<p>May be you could use <a href="http://openinnowhere.sourceforge.net/lameonj/" rel="nofollow noreferrer">LAMEOnJ</a>, which is a 100% Java API wrapping the standard LAME API (LAME being a MP3 encoder).</p> <p>I am not sure however it would encode "chunk by chunk"...</p>
<p>try using Ring buffer to encode the raw audio buffer in fly.</p>
44,636
<p>I'm looking for a module or some way to obtain the information about the content of a file. </p> <p>The same sort of thing that the Linux "file" command does, but in Perl language.</p>
<p>Have a look at the File::Magic module on the CPAN. (Editor's note: This module was removed by its author.)</p>
<p>I finally opted to do something like</p> <pre><code>$res = `file a.txt`; </code></pre>
37,819
<p>Plug-in systems in C++ are hard because the ABI is not properly defined, and each compiler (or version thereof) follows its own rules. However, COM on Windows shows that it's possible to create a minimal plug-in system that allows programmers with different compilers to create plug-ins for a host application using ...
<p>Dr Dobb's Journal has an article <a href="http://www.ddj.com/cpp/204202899?cid=RSSfeed_DDJ_Cpp" rel="nofollow noreferrer">Building Your Own Plugin Framework: Part 1</a> which is pretty good reading on the subject. It is the start of a series of articles which covers the architecture, development, and deployment of a...
<p>I have my own game engine that has a C++ plug-in system.</p> <p>I have some code in header files so it gets put into the plugin's compilation unit.</p> <p>Larger functions that live in the main engine are called via an exported C function (plugin calls MyObject_somefunction(MyObject *obj) which in the engine just ...
6,494
<p>We have a Makerbot Replicator 2X at our school. I have a class in the computer lab and one of our focuses is using the printer. Currently, it is not printing properly. We are using PLA at 210 degrees Celcius. The built plate is not heated (using Build Tak). This has worked very well in the past. The problem is ...
<p>Overall, it is unlikely that the problem is temp sensing accuracy. There are only a few things that will throw off the thermocouple's reading:</p> <ul> <li>Poor thermal coupling between the tip and the hot block, such as if the tip has partially pulled free of the brass thermowell crimp (this will make the hot bloc...
<p>The temperature is fine.</p> <p>In my experience the filament curls up only when the extruder is extruding way up, far from the plate: are you experiencing this while actually printing?</p> <p>If yes: recalibrate the printer so that the extruder is closer to the build plate and this shouldn't happen. For the filam...
206
<p>Which class design is better and why?</p> <pre><code>public class User { public String UserName; public String Password; public String FirstName; public String LastName; } public class Employee : User { public String EmployeeId; public String EmployeeCode; public String DepartmentId; } ...
<p>The question is simply answered by recognising that inheritance models an "IS-A" relationship, while membership models a "HAS-A" relationship.</p> <ul> <li>An employee IS A user</li> <li>An employee HAS A userinfo</li> </ul> <p>Which one is correct? This is your answer.</p>
<p>Three more options:</p> <ol> <li><p>Have the <code>User</code> class contain the supplemental information for both employees and members, with unused fields blank (the <code>ID</code> of a particular <code>User</code> would indicate whether the user was an employee, member, both, or whatever).</p></li> <li><p>Have ...
5,978
<p>Is hashing a password twice before storage any more or less secure than just hashing it once?</p> <p>What I'm talking about is doing this:</p> <pre><code>$hashed_password = hash(hash($plaintext_password)); </code></pre> <p>instead of just this:</p> <pre><code>$hashed_password = hash($plaintext_password); </code>...
<h2>Hashing a password once is insecure</h2> <p>No, multiple hashes are not less secure; they are an essential part of secure password use.</p> <p>Iterating the hash increases the time it takes for an attacker to try each password in their list of candidates. You can easily increase the time it takes to attack a pass...
<p>I'm going to go out on a limb and say it's more secure in certain circumstances... don't downvote me yet though!</p> <p>From a mathematical / cryptographical point of view, it's less secure, for reasons that I'm sure someone else will give you a clearer explanation of than I could.</p> <p><strong>However</strong>,...
45,295
<p>I have a dev and a UAT environments. Dev is in our place, UAT is in client's place.</p> <p>Our DEV machine is a XEON 4 core @2,33GHz, 4Go RAM with Windows server 2003 The UAT physical machine is quite the same but a virtual machine is used (under VMWare). I don't know the exact parameters used for this VM.</p> <...
<p>Use the custom events in jQuery to make this easy.</p> <p>Something like this:</p> <pre><code>(function($) { $.fn.myPlugin = function() { return this.each(function(){ //Plugin Code Goes Here $(this).bind("pluginEdit",function(){ internalEditFu...
<p>Hmmm I guess I could create an array of instances...</p> <pre><code>var plugins = new Array(); plugins.push($('first_editable_section').pluginThing()); plugins.push($('second_editable_section').pluginThing()); </code></pre> <p>and access them through that.</p>
25,547
<p>I downloaded and installed the Aptana Studio free version. But apparently, to install the Radrails plugin for ruby on rails development you have to connect to the internet. I don't have internet on my machine right now. So is there a way I could download the installer from another machine and copy it over my existin...
<p>I wrote down <a href="http://madcoderspeak.blogspot.com/2008/02/showmethemoney-15-aptana-radrails-hell.html" rel="nofollow noreferrer">my duel with Aptana Rails</a> - See if this helps you. There is a link on manual installation that may be what you're looking for.</p>
<p>If you're able to actually install it on the machine with the Internet connection, then you can simply copy over the directory you installed it in. Eclipse installations are completely self-contained in their installation directories.</p>
5,418
<p>I'm writing a small application in VB.NET and I would like some of the classes to be able to write themselves out to XML to serve as a "save" feature. I have seen XSD files used to generate VB classes that can serialize themselves into and out of XML very easily. How would I do this if I do have any pre-existing X...
<p>Use the System.Xml and System.Xml.Serialization namespaces. They describe classes that you can use to annotate your classes' members with the corresponding tag.</p> <p>For example (in C#):</p> <pre><code>[XmlRoot("foo")] public class Foo { [XmlAttribute("bar")] public string bar; [XmlAttribute("baz...
<p>To go with a simple 'save' feature either use the .net xml serialization [1] or create yourself a n in memory DateSet to persist the 'state of the world' in as many DateTables as your see fit. It rather depends how complext your object model that you are trying to persist is.</p> <p>[1] simplest example I could fin...
27,600
<p>I've been looking at some Ruby dependency injection libraries. In particularly, I checked out <a href="http://needle.rubyforge.org/" rel="noreferrer">Needle</a> and <a href="http://copland.rubyforge.org/" rel="noreferrer">Copland</a>. They've been around for quite awhile, yet not a lot of usages. </p> <p>What a...
<p>Jamis Buck, who wrote Copland and Needle, <a href="http://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-programming" rel="noreferrer">posted here</a> about Needle, dependency injection and their usefulness in a Ruby world.</p> <p>It's long but worth reading, but in case you want the single paragraph most releva...
<p>Here's one more IoC <a href="http://alexeypetrushin.github.com/micon" rel="nofollow">http://alexeypetrushin.github.com/micon</a></p> <p>I used it as a core component of my web framework (not Rails), You can see it working here - <a href="http://ruby-lang.info" rel="nofollow">http://ruby-lang.info</a> (this site pow...
35,936
<p>When using custom-draw (NM_CUSTOMDRAW) to draw the entire contents of a ListView SubItem (in Report/Details view), it would be nice to be able to apply the same left and right padding in my custom paint method that is applied by the control itself for non-custom-drawn items.</p> <p>Is there a way to programmatically...
<p>use ListView Header message HDM_GETBITMAPMARGIN see <a href="http://msdn.microsoft.com/en-us/library/bb775314(VS.85).aspx" rel="nofollow noreferrer">link text</a></p>
<p>I would assume that <em>GetSystemMetrics()</em> is that you need to look at. I think that <strong>SM_CXEDGE</strong> and <strong>SM_CYEDGE</strong> are probably the values you want, but don't quote me on that. ;-)</p>
7,400
<p>I'm building a python application from some source code I've found <a href="http://code.google.com/p/enso" rel="nofollow noreferrer">Here</a></p> <p>I've managed to compile and fix some problems by searching the web, but I'm stuck at this point:</p> <p>When running the application this message appears.</p> <p><a ...
<p>Looking at your update, it looks like you need to install <a href="http://www.cairographics.org/pycairo/" rel="nofollow noreferrer">Pycairo</a> since you're missing the _cairo module installed as part of Pycairo. See the <a href="http://www.cairographics.org/download/" rel="nofollow noreferrer">Pycairo downloads pag...
<p>You probably need to install the VC++ runtime redistributables. The links to them are <a href="https://stackoverflow.com/questions/99479/visual-cstudio-application-configuration-incorrect#100310">here</a>.</p>
27,214
<p>I've always been wondering how people use CRC (class responsiblity collaboration) cards. I've read about them in books, found vague information on the internet, but never grasped it really. I think someone ought to make a youtube video showing a session with CRC cards, since one of my books described it as being ver...
<p>I'll try to give an answer. So CRC cards are generally used for modelling in a Object-Oriented environment to get a better understanding of the system that has to be developed (but that I think you'll know already). CRC cards come at the very end, when you arrive just before the actual implementation. The different ...
<p>In their book <a href="http://books.google.co.uk/books?id=vUF72vN5MY8C&amp;lpg=PP1&amp;dq=inauthor%3ARebecca%20inauthor%3AWirfs%20inauthor%3ABrock&amp;pg=PA61#v=onepage&amp;q=&amp;f=false" rel="nofollow noreferrer">Object Design: roles, responsibilities, and collaborations</a> published in 2003 <a href="http://wirfs...
12,418
<p>Are most flash video players created all programmatically? Or they done using static buttons that are referenced in classes? Is it better to create all your buttons on the fly or does it not really matter?</p>
<p>Most video players aren't using AS3 yet, but different ones do it differently. It depends on what level of configurability you want. Personally I mostly do it programmatically so that I can configure everything with an XML config file or FlashVars.</p>
<p>I don't think there is much difference internally if you use static buttons or programmed ones. Its more a personal preference. If my buttons have been complexly designed then I would import them, then reference them in classes; but if they are simple boxes and text, for example, then I would program them as it give...
25,562
<p>How do I locate resources on the classpath in java? Specifically stuff that ends in .hbm.xml.</p> <p>My goal is to get a List of all resources on the classpath that end with ".hbm.xml".</p>
<p>You have to get a <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#getContextClassLoader()" rel="nofollow noreferrer">classloader</a>, and test whether it's a URLClassLoader. If so, downcast and <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLClassLoader.html#getURLs()" rel="nofoll...
<p>MyClass.class.getClassLoader().getResourceAsStream("Person.hbm.xml") is one way to look for it.</p>
17,186
<p>In Python there is a really neat function called <code>zip</code> which can be used to iterate through two lists at the same time:</p> <pre><code>list1 = [1, 2, 3] list2 = ["a", "b", "c"] for v1, v2 in zip(list1, list2): print v1 + " " + v2 </code></pre> <p>The above code should produce the following:</p> <pr...
<p>Update: It is built-in in C# 4 as <a href="https://msdn.microsoft.com/en-us/library/vstudio/dd267698(v=vs.110).aspx" rel="nofollow noreferrer">System.Linq.Enumerable.Zip Method</a></p> <p>Here is a C# 3 version:</p> <pre><code>IEnumerable&lt;TResult&gt; Zip&lt;TResult,T1,T2&gt; (IEnumerable&lt;T1&gt; a, I...
<p>There's also one in F#:</p> <p>let zipped = Seq.zip firstEnumeration secondEnumation</p>
12,656
<p>just now the dba let me connect to the database using Sql Server Management Studio, this is how i noticed that the default database for the tfs setup and service users is master, is this ok?, is this why I'm having this error?, Let me post part of the log and the properties of the Setup user to confirm that the use...
<p>There's one really icky way of doing this:</p> <pre><code>class Base { // Put common stuff in here... } class Base&lt;T&gt; : Base where T : Base&lt;T&gt;, new() { private static T m_instance = new T(); public static T Instance { get { return m_instance; } } } class DerivedA : Base&lt;DerivedA&gt; {...
<p>Short answer: not that I'm aware of. Static members are always nonvirtual and do not readily support polymorphism.</p> <p>However, you should also ask yourself <em>why</em> you are doing this. Normally, static members are shared resources that every instance of that class (including the derived classes) will find...
44,792
<p>so, I'm running Apache on my laptop.</p> <p>If I go to "localhost", I get the page that says, </p> <blockquote> <p>If you can see this, it means that the installation of the Apache web server software on this system was successful. You may now add content to this directory and replace this page.</p> </blockquote...
<p>"By default, your pages should be placed in the "C:\Program Files\Apache Group\Apache2\htdocs" folder for Apache 2.0 and the "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs" folder for Apache 2.2. When your site is ready, simply delete the existing files in the folder and replace them with those you wa...
<p>If you have Skype it also uses the same ports(80, 443) as Xampp does. So start Xampp first and then Skype.</p> <p>[source: http://starikovs.com/2011/02/23/apache-doesnt-start-in-xampp/]</p>
8,505
<p>I have to create a dialog based application, instead of old CFormView type of design. But CDialog produces fixed-size dialogs. How can I create dialog based applications with resizable dialogs?</p>
<p>In the RC resource file if the dialog has this style similar to this it will be fixed size:</p> <pre><code>IDD_DIALOG_DIALOG DIALOGEX 0, 0, 320, 201 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU </code></pre> <p>If the dialog has this style it will be sizeable:</p> <pre><code>IDD_DIALOG_DIALOG DIALOGEX...
<p>I've tried many MFC layout libraries and found this one the best: <a href="http://www.codeproject.com/KB/dialog/layoutmgr.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/dialog/layoutmgr.aspx</a>. Check out the comments there for some bug fixes and improvements (disclaimer: some of them by me ;) ). Whe...
16,695
<p>What do you think about this <a href="http://raven.rubyforge.org/" rel="nofollow noreferrer">build tool</a>? I'm thinking of migrating from maven2 to raven (my poms are getting bigger and bigger), but I'd like to hear some opinions first.</p> <p>Thanks!</p> <p>@andre:</p> <p>Thank's for writing but I was actually...
<p>I haven't used either Raven or <a href="http://Incubator.Apache.Org/buildr/" rel="nofollow noreferrer">Buildr</a>, but I have heard good things about the latter. In <a href="http://Blog.LabNotes.Org/2007/05/03/buildr-or-when-ruby-is-faster-than-java/" rel="nofollow noreferrer">this blog article by Assaf Arkin</a>, t...
<p>pom growth is a problem that everybody faces w/ maven I guess, but maven is at least maintained (2.1. just around the corner) and the raven project looks pretty dead to me. No updates this year and the mailinglist archives are also very small. It looks to me as it's too risky to switch your build process to a tool w...
17,018
<p>Lately I've been having problems with overhangs not adhering when curvature is outward (stringing across instead) that look like what you'd see at insufficient temperature, and that go away with temperature jacked up a bit (PLA at 220 °C, which is a bit extreme) or fan disabled. Is it possible that the hotend thermi...
<p>I don't think it is the thermistor degrading. To answer your question directly, all my thermistors have failed because the tiny wire has broken off, and generally the fail is “hard” not soft.</p> <p>It is more likely you’re experiencing absorbed humidity in the filament from it being out on the spool too long. this ...
<p>It is indeed possible that the thermistor is broken (yet not sure). I am aware of two types of issues with thermistors:</p> <ol> <li><p>The contact (soldering) is broken, usually due to the temperature extreme variations. The thermistor will indicate the maximum temperature in case of PTC or minimum temperature in c...
1,726
<p>Is there an apache module that implements Kerberos authentication for use by Tomcat and also supports Kerberos delegation?</p> <p>I've already looked at mod_spnego and it throws away the SSPI context it creates only keeping the principal name. Instead, I'm looking for a module that would allow for the delegation o...
<p><a href="http://waffle.codeplex.com/" rel="noreferrer">WAFFLE</a> (Windows Authentication Functional Framework) now provides that feature starting from v1.4beta.</p> <p>It provides a ServletFilter that uses native Windows APIs to authenticate the user, either using Basic or Negotiate authentication. The user then c...
<p>How about using the JAAS realm and using the kerberos 5 JAAS module?</p> <p><a href="http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#JAASRealm" rel="nofollow noreferrer"><a href="http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#JAASRealm" rel="nofollow noreferrer">http://tomcat.apache.org/tomcat-6....
44,033
<pre><code>select distinct constraint_type from user_constraints; C - C P R U </code></pre> <p>Seems P means primary key and R means foreign key, correct? What are U and C? </p>
<pre><code>Code Description Acts On Level --------------------------------------------- C Check on a table Column O Read Only on a view Object P Primary Key Object R Referential (Foreign Key) Column U Unique Key Column V Check Option on a...
<p>From the <a href="https://docs.oracle.com/database/121/REFRN/GUID-9C96DA92-CFE0-4A3F-9061-C5ED17B43EFE.htm" rel="noreferrer">12cR1 documentation</a>:</p> <pre><code>C - Check constraint on a table P - Primary key U - Unique key R - Referential integrity V - With check option, on a view O - With read only,...
22,209
<p>Is there a trivial, or at least moderately straight-forward way to generate territory maps (e.g. Risk)?</p> <p>I have looked in the past and the best I could find were vague references to Voronoi diagrams. An example of a Voronoi diagram is this:</p> <p><img src="https://i.stack.imgur.com/aX9Tp.gif" alt="here">.<...
<p>The best reference I've seen on them is <a href="https://rads.stackoverflow.com/amzn/click/com/3540779736" rel="noreferrer" rel="nofollow noreferrer">Computational Geometry: Algorithms and Applications</a>, which covers Voronoi diagrams, Delaunay triangulations (similar to Voronoi diagrams and each can be converted ...
<p>Why not use a map of primitives (triangles, squares), distribute the starting points for the countries (the "capitals"), and then randomly expanding the countries by adding a random adjacent primitive to the country.</p>
2,622
<p>I'm working with <a href="http://webby.rubyforge.org" rel="nofollow noreferrer" title="Webby">Webby</a> and am looking for some clarification. Can I define attributes like <code>title</code> or <code>author</code> in my layout?</p>
<p>Not really. The layout has access to the page attributes rather than the other way.</p> <p>The easiest way to do what you want is to populate the SITE.page_defaults hash in your site's Rakefile (probably build.rake). Add something like the following:</p> <pre><code>SITE.page_defaults['title'] = "My a...
<p><a href="http://webby.rubyforge.org/tutorial/" rel="nofollow noreferrer">I've never used it but the tutorial here:</a></p> <p>Makes it look like the answer to your question is "yes". Specifically I'm looking under the "Making Changes" header on that page.</p>
4,380
<p>If I wanted to get a pilot project off the ground using Microsoft PixelSense, where or who do I ask for testing hardware?</p>
<p>Here is a great interview <a href="http://www.dotnetrocks.com/default.aspx?showNum=389" rel="nofollow noreferrer">you should listen to</a>.</p> <p>Basically, you will likely need to purchase a PixelSense machine. The Developer edition is $15,000. At the moment, it is difficult to get your hands on the bits unless ...
<p>There's a book called "Developing for Microsoft Surface" that's been released. It's very basic but worth having a look. </p>
38,123
<p>I know that there has been a couple questions about tutorials on rhino-mocks. But I am wondering if there are any sample apps out there that use rhino-mocks in the context of an n-tier business application using ado.net. </p> <p>I find the tutes good, but they don't seem to bring everything all together into the bi...
<p>I have a demo app from a talk I gave on testing. It does some mocking with Rhino Mocks. You can download it if you would like:</p> <p><a href="http://www.houseofbilz.com/archive/2008/10/18/gui-testing-resources.aspx" rel="nofollow noreferrer">http://www.houseofbilz.com/archive/2008/10/18/gui-testing-resources.asp...
<p><a href="http://ayende.com/wiki/Rhino+Mocks+Documentation.ashx" rel="nofollow noreferrer">Rhino Mocks Documentation</a><br/> <a href="http://weblogs.asp.net/stephenwalther/archive/2008/03/22/tdd-introduction-to-rhino-mocks.aspx" rel="nofollow noreferrer">TDD : Introduction to Rhino Mocks</a></p> <p>Using Google you...
29,267
<p>Is anyone aware of a multi-format file viewer, capable of displaying common image formats, as well as MS Office document formats (at least Word and Excel), and PDFs? I've seen several image viewers available, but none besides Outside In from Oracle.</p> <p>I'm looking for viewer technology that can be imbedded in ...
<p>In terms of performance, the big gain in using separate files/filegroups is that it lets you spread your data across multiple physical disks. This is beneficial because with several disks, multiple data requests can be handled simultaneously (parallel is generally faster than serial). All other things being equal, t...
<p>It could if you place them on separate drives - not logical but physical drives so IO is not slowing you down so much.</p>
13,386
<p>I fail to understand why this code won't compile</p> <pre><code>ExecutorService executor = new ScheduledThreadPoolExecutor(threads); class DocFeeder implements Callable&lt;Boolean&gt; {....} ... List&lt;DocFeeder&gt; list = new LinkedList&lt;DocFeeder&gt;(); list.add(new DocFeeder(1)); ... executor.invokeAll(lis...
<p>Just to expand on saua's answer a little...</p> <p>In Java 5, the method was declared as:</p> <pre><code>invokeAll(Collection&lt;Callable&lt;T&gt;&gt; tasks) </code></pre> <p>In Java 6, the method is declared as:</p> <pre><code>invokeAll(Collection&lt;? extends Callable&lt;T&gt;&gt; tasks) </code></pre> <p>Th...
<p>Thanks for the detailed answer , but it still bugs me - Callable is an interface , so actually , the "addSomething" function in Jon's answer should be OK (not only legal , but reasonable) - because , well , that's the whole point of interfaces - As long as you comply with some initial agreement , I don't care which ...
48,431
<p>I need to call a method that accepts a stream argument. The method loads text into the stream, which would normally be a file. I'd like to simply populate a string with the contents of the stream, instead of writing it to a file. How do I do this?</p>
<p>Use a MemoryStream with a StreamReader. Something like:</p> <pre><code>using (MemoryStream ms = new MemoryStream()) using (StreamReader sr = new StreamReader(ms)) { // pass the memory stream to method ms.Seek(0, SeekOrigin.Begin); // added from itsmatt string s = sr.ReadToEnd(); } </code></pre>
<p>you can do something like:</p> <pre><code>string s = "Wahoo!"; int n = 452; using( Stream stream = new MemoryStream() ) { // Write to the stream byte[] bytes1 = UnicodeEncoding.Unicode.GetBytes(s); byte[] bytes2 = BitConverter.GetBytes(n); stream.Write(bytes1, 0, bytes1.Length); stream.Write(bytes2, 0, ...
19,730
<p>I'm trying to drag a <code>CALayer</code> in an iOS app.</p> <p>As soon as I change its position property it tries to animate to the new position and flickers all over the place:</p> <pre><code> layer.position = CGPointMake(x, y) </code></pre> <p>How can I move <code>CALayers</code> instantly? I can't seem to get...
<p>You want to wrap your call in the following:</p> <pre><code>[CATransaction begin]; [CATransaction setValue: (id) kCFBooleanTrue forKey: kCATransactionDisableActions]; layer.position = CGPointMake(x, y); [CATransaction commit]; </code></pre>
<p>Combining previous answers here for Swift 4, to clearly make the animation duration explicit...</p> <pre><code>extension CALayer { class func perform(withDuration duration: Double, actions: () -&gt; Void) { CATransaction.begin() CATransaction.setAnimationDuration(duration) actions() ...
27,986
<p>I'm using Hibernate 3.1 and Oracle 10 DB. The blob is defined as @Lob @Basic @Column in the Hibernate entity which corresponds to the relevant DB table. The error -java.sql.SQLException: Closed Connection- seem to appear once in while, not in every attempt to get the blob from the DB. This seems like a hibernate fe...
<p>Is this against an Oracle database?</p> <p>I've had to resort to user data types in Hibernate to get this to work, but that was using Hibernate 3.0 against an Oracle 9 db. </p> <p>See <a href="http://www.hibernate.org/56.html" rel="nofollow noreferrer">http://www.hibernate.org/56.html</a> for a long discussion abo...
<p>If you want to specify the fetching strategy use:</p> <pre><code>@Basic(fetch = FetchType.LAZY) </code></pre> <p>for your member.</p>
43,384
<p>Is it possible to pass a path such as subject/name to a template then to use that path which is passed in the template as a path and not as a textual string. I am finding that the path is treated as text rather than a path.</p>
<p>There is no path data type in XPath or XSLT, so no. What sort of operations do you want to perform on this parameter? Get information about the file that the path points to?</p>
<p>Saxon implements this the extension functions, <a href="http://saxonica.com/documentation/extensions/functions/evaluate.html" rel="nofollow noreferrer">saxon:evaluate()</a> and <a href="http://saxonica.com/documentation/extensions/functions/evaluate-node.html" rel="nofollow noreferrer">saxon:evaluate-node()</a>. </...
25,468
<p>My current setup binds the <code>Text</code> property of my <code>TextBox</code> to a certain <code>Uri</code> object. I'd love to use WPF's inbuilt validation to detect invalid URIs, and proceed from there. But this doesn't seem to be working?</p> <p>I would imagine that it would throw an exception if I entered, e...
<p>You can try create our own ValidationRule (inherit from ValidationRule). In this class, override Validate(...) and try create an URI object and catch the exceptions. In the catch, just set the e.Message to exception message.</p> <p>(I am not too sure what is your binding source. Is it a URI object or a string?)<...
<p>OK, I think I know what is going on. The binding doesn't know how to convert a string to a URI object (because the textbox <em>Text</em> property is a string). You need a converter to help him.</p> <p>Try this: Create a converter class (inherit from IValueConverter) that:</p> <ul> <li>convert a string to a Uri u...
29,396
<p>I have a homemade 3D printer running on ramps 1.4 When i start a new print and the hotend reaches melting point of PLA, the PLA start coming out of the hotend.<br> This goes on for as long as the temperature is kept above melting point, without moving the extrusion gear. </p> <p>The extruder is a bowden type.<br>...
<blockquote> <p>Any ideas what to do to prevent this from happening?</p> </blockquote> <p>You cannot prevent it entirely, but <strong>you can probably mitigate the problem by depressing the lever that squashes the filament against the hobbed gear of the extruder</strong> before starting to heat the nozzle.</p> <p>I...
<p>Does it really go on for more than a minute or so? You can't get filament from nowhere, so if the feed gear isn't moving, sooner or later all the material in the reservoir inside the nozzle &amp; hotend will be melted and gone. Leakage like this is normal, and probably a lot more noticeable if you have a larger di...
811
<p>I'm currently running Visual Studio 2008 Standard Edition and one of the items they cut out for that edition is the unit testing capability. As a result, when I open up example projects like the MVC commerce test, one of the projects just won't load since it doesn't know to open that type of project.</p> <p>I know ...
<p>Try <a href="http://www.gallio.org/" rel="nofollow noreferrer">Gallio</a> as explained best in <a href="http://richarddingwall.name/2008/09/26/gallio-the-framework-agnostic-test-runner-for-net/" rel="nofollow noreferrer">this blog post</a> by Richard Dingwall, and for Visual Studio support, use <a href="http://www.t...
<p>TestDriven.NET can run NUnit, xUnit.NET and MSTest. It's not free, though, but well worth it. From <a href="http://www.testdriven.net/overview.aspx" rel="nofollow noreferrer"><a href="http://www.testdriven.net/overview.aspx" rel="nofollow noreferrer">http://www.testdriven.net/overview.aspx</a></a>:</p> <blockquote>...
33,956
<p>I've written a simple SessionItem management class to handle all those pesky null checks and insert a default value if none exists. Here is my GetItem method:</p> <pre><code>public static T GetItem&lt;T&gt;(string key, Func&lt;T&gt; defaultValue) { if (HttpContext.Current.Session[key] == null) { Ht...
<p>Since that is a func, a lambda would be the simplest way:</p> <pre><code>Foo foo = GetItem&lt;Foo&gt;("abc", () =&gt; new Foo("blah")); </code></pre> <p>Where [new Foo("blah")] is the func that is invoked as a default. </p> <p>You could also simplify to:</p> <pre><code>return ((T)HttpContext.Current.Session[key]...
<pre><code>var log = SessionItem.GetItem("logger", () =&gt; NullLog.Instance) </code></pre> <p><strong>Note,</strong> than normally you can skip {T} specification in the GetItem{T} call (if Func{T} returns object of the same type)</p>
18,972
<p>I was kind of scratching my head at this a week ago, and now with a little bit more Cocoa experience under my belt I feel like I have an inkling as to what might be going on. </p> <p>I'm making an application that is driven by a UINavigationController. In the AppDelegate, I create an instance of this class, using "...
<p>I would recommend using the delegation pattern to solve your problem. Create a property</p> <pre><code>@property (nonatomic, assign) id &lt;MyModalViewDelegate&gt; delegate; </code></pre> <p>And a corresponding protocol</p> <pre><code>@protocol MyModalViewDelegate @optional - (void)myModalViewControllerDidFin...
<p>I just ran into this same problem. It definitely seems that if you put a UIViewController embedded in a NavigationController, then when, from that UIViewController you present another UIViewController modally, the presentee thinks that the presenter is the NavigationController. In other words, parentViewController...
30,331
<p>Range intersection is a simple, but non-trivial problem.</p> <p>Its has been answered twice already:</p> <ul> <li><a href="https://stackoverflow.com/questions/224878/find-number-range-intersection">Find number range intersection</a></li> <li><a href="https://stackoverflow.com/questions/143552/comparing-date-ranges...
<p>The standard approach is to use an <a href="http://en.wikipedia.org/wiki/Interval_tree#With_an_Interval" rel="noreferrer">interval tree</a>.</p> <blockquote> <p>In computer science, an interval tree is a tree data structure to hold intervals. Specifically, it allows one to efficiently find all intervals that overlap...
<p>Just as a quad tree works for a set of 2d points, a simple binary tree should work for this case. Build a tree with your ranges.</p> <p>To explain further: Each node in the tree contains two integers, the beginning and end of the range, and the two children if it's not a leaf node. To find the ranges that your inp...
39,004
<p>In perl one would simply do the following to store and iterate over a list of names</p> <pre><code>my @fruit = (apple, orange, kiwi); foreach (@fruit) { print $_; } </code></pre> <p>What would the equivalent be in bash?</p>
<p>bash (unlike POSIX sh) supports arrays:</p> <pre><code>fruits=(apple orange kiwi "dried mango") for fruit in "${fruits[@]}"; do echo "${fruit}" done </code></pre> <p>This has the advantage that array elements may contain spaces or other members of $IFS; as long as they were correctly inserted as separate element...
<pre> for i in apple orange kiwi do echo $i done </pre>
10,404
<p>I am looking for an alternative to my old "Font Navigator" that I... borrowed... from the CorelDraw Suite :-)</p> <p>Googling for it, took me to hundreds of pages with old software, so I hope to find a quick idea from here (waiting for FontExplorer X from Linotype).</p> <p>Which Font Explorer for Windows do you cu...
<p>This <a href="http://typophile.com/node/41998" rel="nofollow noreferrer">thread</a> references the main font explorers like <a href="http://www.bitstream.com/fonts/index.html" rel="nofollow noreferrer">Bitstream Font Navigator</a>, <a href="http://www.neuber.com/typograph/" rel="nofollow noreferrer">Typograf</a> (bo...
<p>Start->Run->Fonts</p> <p>Works for me (:</p> <p>You can uninstall, preview and add new fonts. It also displays the font type.</p> <p>It's a redirect to WINDOWSDIR\Fonts</p>
38,759
<p>I'm building an application that needs to run through an XML feed but I'm having a little trouble with getting certain elements.</p> <p>I'm using the <a href="http://twitter.com/statuses/public_timeline.rss" rel="nofollow noreferrer">Twitter feed</a> and want to run through all the <code>&lt;item&gt;</code> element...
<p>You can enable unsafeHeaderParsing programmatically if you wish - here's a function I included in <a href="http://qdfeed.codeplex.com/" rel="noreferrer">Quick and Dirty Feed Parser</a> for turning that on - it's similar to some of the ones you linked to in your question:</p> <pre><code>private static bool SetUseUns...
<p>I'm not sure what the trouble is. </p> <p>You don't use a web.config with a windows service, you use App.config (this gets moved into the deployment directory when you compile and renamed to .config</p> <p>I have used this setting in my App.Config for windows forms applications, web applications and many windows s...
30,095
<p>Microsoft <a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx" rel="nofollow noreferrer" title="recently announced">recently announced</a> that they were endorsing <a href="http://jquery.com" rel="nofollow noreferrer">jQuery</a> as an "officially" supported JavaScript library.</p> <...
<p>As to why MS endorsed jQuery, probably best asking ScottGu. </p> <p>It seems as though jQuery is becoming the js hammer of choice for many, and the more that happens, the less love will be shown for the other libraries. </p> <p>Personally, I find that it has a nice balance of features, and allows me to get most ...
<p>Reinforcing what Sean says, it seems that there are many more quality, ready to use libraries for jQuery than other JS frameworks. This is also a factor in driving more developers to it.</p>
39,566
<p>I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used VB in ten years and I don't even have it insta...
<p>By using <code>__declspec</code> for export, the function name will get exported <em>mangled</em>, i.e. contain type information to help the C++ compiler resolve overloads.</p> <p>VB6 cannot handle mangled names. As a workaround, you have to de-mangle the names. The easiest solution is to link the DLL file using an...
<p>A VB6 DLL is always a COM dll. I shall describe an example in as few words as possible. Suppose you have a ActiveX DLL project in VB6 with a class called CTest which contains a method as shown below</p> <p>Public Function vbConcat(ByVal a As String, ByVal b As String) As String vbConcat = a &amp; b End Function...
6,052
<p>Lately i got into web development (in asp.net mvc), and i'm looking for some ideas web application ideas worth coding, preferably in an increasing difficulty level. my first app (which i'm currently coding) is a photo gallery web site</p>
<p>The application you're likely to get the most out of is the one you most want to actually use. That way you'll have much more motivation to add features, consider usability etc than if you just do one for the sake of learning.</p> <p>Implementation requirements which are handy to have had experience with though:</p...
<p>A simple contacts database is a pretty good starting project.</p>
44,442
<p>Typically you will find STL code like this:</p> <pre><code>for (SomeClass::SomeContainer::iterator Iter = m_SomeMemberContainerVar.begin(); Iter != m_SomeMemberContainerVar.end(); ++Iter) { } </code></pre> <p>But we actually have the recommendation to write it like this:</p> <pre><code>SomeClass::SomeContainer::i...
<p>If you wrap your code into lines properly, the inline form would be equally readable. Besides, you should always do the <code>iterEnd = container.end()</code> as an optimization:</p> <pre><code>for (SomeClass::SomeContainer::iterator Iter = m_SomeMemberContainerVar.begin(), IterEnd = m_SomeMemberContainerVar.en...
<p>You can throw braces around the initialization and loop if you are concerned about scope. Often what I'll do is declare iterators at the start of the function and reuse them throughout the program.</p>
22,926
<p>I'm a C# developer. I develop both Windows &amp; Web Applications. I would like to build an Winforms application that has a role-based system. All users must in role/group(s). Then we assign permissions like "View, Add, Update,.." to role/group. The role/group is dynamic, so we let users to define it.</p> <p>Is the...
<p>Out-of-the-box, MS offers a <a href="http://msdn.microsoft.com/en-us/library/ms178586(VS.80).aspx" rel="nofollow noreferrer">StateServer mode</a>. This lets you store Session data in memory on a single server shared by one or more Web servers. In some cases (if your session state SQL Server is under significant load...
<p>There are number of strategies. I hope that your session is sticky (i.e. routed to the same machine all the time it is up). In this case, you can cache data locally (in memory) and use DB only for backup ("write-only"). Moreover, there are solutions like <em>memcached</em> providing distributed cache.</p>
45,815
<p>I've worked with MySQL and MSSQL for some time and have used a variety of CASE and UML tools when designing some of my more complex projects.</p> <p>I was recently asked by a colleague if I could provide an Access database for his department. The application itself isn't too complicated, and Access actually looks l...
<p>ModelRight will do this for you. You can download the community version which will access any db using ODBC and Mysql.</p> <p><a href="http://www.modelright.com/downloads.aspx" rel="noreferrer">http://www.modelright.com/downloads.aspx</a></p> <p>I currently use it with SQL server and it works great.</p>
<p>Dezign from datanamic (erd tool) can read in access databases and make a diagram out of it. No ODBC needed. Native connection to ms access.</p> <p><a href="http://www.datanamic.com" rel="nofollow noreferrer">dezign for databases</a></p>
28,432
<p>I have a page, with some code in js and jQuery and it works very well. But unfortunately, all my site is very very old, and uses frames. So when I loaded my page inside a frame, <code>$(document).ready()</code> doesn't fire up.</p> <p>My frameset looks like:</p> <pre><code>&lt;frameset rows="79,*" frameBorder="1" ...
<p>I have tried the method mentioned in another comment:</p> <pre><code>$("#frameName").ready(function() { // Write you frame on load javascript code here } ); </code></pre> <p>and it did not work for me. </p> <p>this did:</p> <pre><code>$("#frameName").load( function() { //code goes here } ); </code></pr...
<p>There is no reason for <code>$(document).ready()</code> not to be called. Be sure your page contains an include to <code>jquery.js</code>. Try to do a simple test with an empty HTML page and just an alert to see if there is another problem.</p> <p>If you are trying to use this inside the HTML page that contains the...
27,253
<p>I have a CSS class called grid which I place on my tables. I want to Zebra strip my even rows so I use the following jQuery code</p> <pre><code>$(".grid tr:nth-child(even)").addClass("even"); </code></pre> <p>This basically says "Apply the css class even to any tr tag which has a parent (at any level) with a class...
<p>You want to use a different selector, like the child selector:</p> <pre><code>$(".grid &gt; tr:nth-child(even)").addClass("even"); </code></pre> <p>This limits the selection to direct children your <code>.grid</code> only.</p>
<p>There's a great jQuery blog post that you might find useful: <a href="http://blog.jquery.com/2006/10/18/zebra-table-showdown/" rel="nofollow noreferrer">Zebra Table Showdown</a>.</p> <p>This post also includes an interesting discussion of how to do zebra striping in most of the other major JavaScript libraries.</p>...
36,576
<p>Suppose I have <code>fileA.h</code> which declares a class <code>classA</code> with template function <code>SomeFunc&lt;T&gt;()</code>. This function is implemented directly in the header file (as is usual for template functions). Now I add a specialized implementation of <code>SomeFunc()</code> (like for <code>Some...
<p>It is <strong>an error</strong> to have a specialization for a template which is not visible at the point of call. Unfortunately, compilers are not required to diagnose this error, and can then do what they like with your code (in standardese it is "ill formed, no diagnostic required").</p> <p>Technically, you need...
<p>Unless the specialized template function is also listed in the header file, the other application will have no knowledge of the specialized version. The solution is the add <code>SomeFunc&lt;int&gt;()</code> to the header as well.</p>
8,391
<p>I have to rename a complete folder tree recursively so that no uppercase letter appears anywhere (it's C++ source code, but that shouldn't matter).</p> <p>Bonus points for ignoring CVS and Subversion version control files/folders. The preferred way would be a shell script, since a shell should be available on any L...
<p>A concise version using the <code>"rename"</code> command:</p> <pre><code>find my_root_dir -depth -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \; </code></pre> <p>This avoids problems with directories being renamed before files and trying to move files into non-existing directories (e.g. <code>"A/A"</code> into <c...
<pre><code>( find YOURDIR -type d | sort -r; find yourdir -type f ) | grep -v /CVS | grep -v /SVN | while read f; do mv -v $f `echo $f | tr '[A-Z]' '[a-z]'`; done </code></pre> <p>First rename the directories bottom up <em>sort -r</em> (where -depth is not available), then the files. Then <em>grep -v /CVS</em> inste...
18,403
<p>I have a site made with php which uses server side sessions throughout the site.<br> In fact, it's a site with a user login which depends on session variables and if there were a problem with <em>all</em> session variables, no pages would load at all. </p> <p>On the site, there's an iframe that holds a feed of lit...
<p>Check the name of the server machine. IE has problems with machine names that contain '-' or '_' - they cannot maintain a session! I've had this problem twice in the past, and it always takes me weeks to figure out, and I'm shocked IE hasn't fixed it.</p> <p>Just rename the machine to have no strange characters! ...
<p>If I understand it correctly, you are trying to use a session variable to pass data from a page to pages within iframes on that page? This doesn't seem a good way to go about it - why not just pass a GET variable into the iframe url i.e. ?current_page=special1 . I would think this would be more reliable as it does...
39,380
<p>We are currently using database to maintain state information (in a separate table) for the user. We fetch that information from the database every time user access the application (sends request) and update it in the database back after processing the request.</p> <p>This has worked very well for us in many of our...
<p>Out-of-the-box, MS offers a <a href="http://msdn.microsoft.com/en-us/library/ms178586(VS.80).aspx" rel="nofollow noreferrer">StateServer mode</a>. This lets you store Session data in memory on a single server shared by one or more Web servers. In some cases (if your session state SQL Server is under significant load...
<p>There are number of strategies. I hope that your session is sticky (i.e. routed to the same machine all the time it is up). In this case, you can cache data locally (in memory) and use DB only for backup ("write-only"). Moreover, there are solutions like <em>memcached</em> providing distributed cache.</p>
45,814
<p>I am trying to come up with such a solution that the user is going to enter the URL of a web-service and it is going to be tested.</p> <p>Although what I want is a URL change, I guarantee the Service Description is always going to be the same (except the wsdl:service tag of course which contains the soap:address); ...
<p>yes you can. just change the url property of the service proxy before calling any methods on it.</p>
<p>Yes; every web-service proxy offers a way to do this; with pre-WCF proxies (including WSEx) the address is the <code>Url</code> property on the proxy class - just change it before you do anything interesting with the proxy.</p> <p>With WCF, I believe you specify the endpoint-address via one of the constructors.</p>...
25,996
<p>Are there any?</p>
<p>A polished UI is a feature. Windbg somewhat lacks this feature. But that only matters when UI "bugs" slow me down, and that's not really very often.</p>
<p>Mostly the easier to use GUI -- it has many more debugging features than VS.</p> <p>BTW, I highly recommend <a href="https://rads.stackoverflow.com/amzn/click/com/0321374460" rel="nofollow noreferrer" rel="nofollow noreferrer">Advanced Windows Debugging</a> to learn about it and other advanced debugging tools and t...
21,741
<p>Currently I am developing in the .Net environment using C# but I want to know whether it is worth learning python. I'm thinking of learning the Django framework. What is better?</p>
<p>Yes, you should learn Python, but it has nothing to do with Python or C# being better. It is really about making you a better programmer.</p> <p>Learning Python will give you a whole new perspective on programmer and how problems can be solved. It's like lifting weights, except you're building up the developer mu...
<p>I have been thinking about this same question myself. I believe however there is still a lot of stuff C# can offer that I want to get good at before I job into Python. Because Python is easier to learn it. One advantage I have found in languages is not the language itself but the materials available to learning t...
14,500
<p>The first thing I do when I incorporate any third party code into my application is reformat it to my personal coding preference:</p> <pre><code>// Single line comments only // I never put spaces inside my parenthesis -(void)myOCDMethod { // If an if or for statement has only one instruction, I don't use ...
<p>I do a lot of this, with a few differences:</p> <p>I always insert spaces before and after parens: <code> -(void)myOCDMethod -> - (void) myOCDMethod</code></p> <p>I leave braces on the same line: <pre><code>if (this) { //code } </code></pre> becomes </p> <pre><code>if (this) { //code } </code></pre> <...
<ol> <li>Indent the code properly</li> <li>Correct line breaks. (Max one line break; line break before every function and comment etc.)</li> <li>Correct naming conventions</li> </ol>
39,663
<p>I am developing a kernel for an operating system. In order to execute it, I've decided to use GRUB. Currently, I have a script attached to GRUB's <code>stage1</code>, <code>stage2</code>, a pad file and the kernel itself together which makes it bootable. The only problem is that when I run it, you have to let GRUB...
<p>I would imagine you could just make your own menu.lst conf file, load that at the grub shell with "configfile /path/to/menu.lst" and then do "setup (hd0)" replacing values as needed. I'm just guessing though.. no telling what the differences are on your custom setup.</p>
<p><a href="http://www.gnu.org/software/grub/manual/grub.html#Embedded-data" rel="nofollow noreferrer"><a href="http://www.gnu.org/software/grub/manual/grub.html#Embedded-data" rel="nofollow noreferrer">http://www.gnu.org/software/grub/manual/grub.html#Embedded-data</a></a> gives some general information about block li...
26,532
<p>This query is related to <a href="https://stackoverflow.com/questions/259850/javascript-multiple-client-side-validations-on-same-event">this</a> one I asked yesterday. I have a radio button list on my asp.net page defined as follows: </p> <pre><code>&lt;asp:RadioButtonList ID="rdlSortBy" runat="server" RepeatDir...
<p>I fixed this, the problem was that I was attaching the "onclick" of the RadioButtonList instead on the individual radio buttons.</p> <p>This is the fix:</p> <pre><code>rdlSortBy.Items(0).Attributes("onclick") = "javascript:return isDirtied() &amp;&amp; prepareSearch();" rdlSortBy.Items(1).Attributes("onclick"...
<p>The <code>OnClick</code> code you are using to "validate" is being run and then the code which posts the form back which the control itself injects is being run.</p> <p>You need to intercept that PostBack process and stop it before it posts the form client-side. The best way to do this would be with a <code>Custom...
32,709
<p>I have many emails coming in from different sources. they all have attachments, many of them have attachment names in chinese, so these names are converted to base64 by their email clients.</p> <p>When I receive these emails, I wish to decode the name. but there are other names which are not base64. How can I diffe...
<blockquote> <p>Please note both <code>Content-Transfer-Encoding</code> have base64</p> </blockquote> <p>Not relevant in this case, the <code>Content-Transfer-Encoding</code> only applies to the body payload, not to the headers.</p> <pre><code>=?gb2312?B?uLGxvmhlbrixsb5nLnhscw==?= </code></pre> <p>That's an <stron...
<p>Well, you parse the email header into a dictionary. And then you check if Content-Transfer-Encoding is set, and if it = "base64" or "base-64".</p>
34,168
<p>We use Grid Control 10.2.0.4, with a catalog repository database also at 10.2.0.4. It seems that after a week or two of being up, the response time of the web interface gets very poor (20+ seconds to navigate to a new page, when normally 2-3 seconds is seen). The only thing we've found to overcome it is a restart of...
<p>Use <a href="http://msdn.microsoft.com/en-us/library/ms173486(SQL.90).aspx" rel="noreferrer">DataLength()</a></p> <pre><code>SELECT * FROM YourTable WHERE DataLength(NTextFieldName) &gt; 0 </code></pre>
<pre><code>Select Max(DataLength([NTextFieldName])) from YourTable </code></pre>
28,482
<p>If I have a table structure that is: </p> <pre><code>code, description, isdeleted </code></pre> <p>where <code>code</code> is the primary key.</p> <p>The user creates a record, then later on deletes it. Because I am using soft deletes the <code>isdeleted</code> will be set to true. Then in my queries I would be d...
<p>I know many people have argued that the data should be natural, but you should be using a primary key that is completely separate from your data if you're going to be supporting soft deletes without the intention of always re-using the previous record when this situation arises.</p> <p>Having a divorced primary key...
<p>When you select records (excluding soft-deletes) to display them in user interface/ output file, use where not isdeleted.</p> <p>But when the user requests an insert operation, perform two queries.</p> <ol> <li><p>Lookup all records (ignoring isdeleted value).</p></li> <li><p>Based on first query result, perform a...
9,552
<p>We are hosting a site for a client and they want us to include the header they have on their server into the pages we are hosting. So whenever they change it, it will automatically change on our site.</p> <p>We are attempting to use the "include" tag in our JSP code. The code we are using is as follows:</p> <p><...
<p>If you choose to do this in Java, it's nice and easy using the HttpClient from Apache Commons.</p> <pre><code>public static String fetchSourceHtml( String urlString ) { try { HttpClient httpClient = new HttpClient(); GetMethod getMethod = new GetMethod( urlString ); getMethod.setFollowRedirects( true...
<p>JSP includes are not meant to work like that with external servers. Here is a completely horrible way to fix your problem, but it was the only option for me in a similar situation. Write a class to actually parse the html from that site, and then print it out. I would add that whenever you are going to do somethi...
22,664
<p>I need to optimize code to get room for some new code. I do not have the space for all the changes. I can not use code bank switching (80c31 with 64k). </p>
<p>You haven't really given a lot to go on here, but there are two main levels of optimizations you can consider:</p> <p><strong>Micro-Optimizations:</strong> eg. XOR A instead of MOV A,0 Adam has covered some of these nicely earlier.</p> <p><strong>Macro-Optimizations:</strong> Look at the structure of your pr...
<p>1) Where possible save your variables in Idata not in xdata<br> 2) Look at your Jmp statements – make use of SJmp and AJmp</p>
43,526
<p>I need to replace some 2- and 3-digit numbers with the same number plus 10000. So</p> <pre><code>Photo.123.aspx </code></pre> <p>needs to become</p> <pre><code>Photo.10123.aspx </code></pre> <p>and also</p> <pre><code>Photo.12.aspx </code></pre> <p>needs to become</p> <pre><code>Photo.10012.aspx </code></pre>...
<p>James is right that you want to use the Regex.Replace method that takes a MatchEvaluator argument. The match evaluator delegate is where you can take the numeric string you get in the match and convert it into a number that you can add 10,000 to. I used a lambda expression in place of the explicit delegate because...
<p>did you try just using <a href="http://msdn.microsoft.com/en-us/library/system.string.padleft.aspx" rel="nofollow noreferrer">PadLeft</a>?</p>
28,954
<p>Selenium Remote Control has a method of "get_html_source", which returns the source of the current page as a string.</p> <p>AFAIK, this method works in all cases in Firefox and Safari. But when it's invoked in Internet Explorer, it returns an incorrect source.</p> <p>Does anyone know if this is a bug with Selenium...
<p>I'm 99% sure get_html_source uses the browser's innerHTML property. InnerHTML returns the browser's internal representation of a document, and has always been inconsistent and "wonky" between platforms. </p> <p>You can test this by temporarily adding the following onload attribute to the body tag of your page.</p>...
<p>thanks Alan. it turns out it was a problem with the different browser's implementation of innerHTML.</p> <p>for tags having to do with lists, like <LI> , the end tags are optional.</p> <p>browsers like safari and firefox pick up on the end tags with their respective innerHTML methods, but internet explorer's inne...
15,231
<p>I have some code which is supposed to display a short message. Here's the pertinent code:</p> <pre><code>DATA SEGMENT 'DATA' MSG DB 0AH, 0DH, 'Hello, Adam', '$' CHAR DB 00H DATA ENDS CODE SEGMENT 'CODE' PRINT_MSG: MOV AH, 09H ;Command to print string of characters MOV DX, OFFSET MSG ;Mov addre...
<p>My guess is that your DS does not point to your data-segment.</p> <p>Int21 Function 0x09 takes the string from DS:DX.</p> <p>Remember that DX is only a 16 bit register. To access data outside the 16 bit range you have to use segment registers. These are called DS and ES for data, CS for code and SS for the stack (...
<p>My guess is that you are probably not running in "Real" mode, which is needed for MSDOS programs in general (and Int 21h interrupts in specific) to work. </p> <p>Windows has been running exclusively in "Protected" mode since Windows 95; The Command Prompt has been in Protected mode since, I think, Windows 2000. <...
11,808
<p>I'm printing parts for a HEVO (<a href="https://www.thingiverse.com/thing:2254103" rel="nofollow noreferrer">HyperCube Evolution</a> CoreXY), using Colorfabb XT filament. After several successful prints. I'm having a lot of failed prints. They start off pretty well but after ~15 layers the filament starts to string ...
<p>This looks a lot like <strong>under extrusion caused by heat creep</strong>.</p> <p>Heat creep is when the nozzle temperature 'creeps' up through the filament and makes it melt (a bit) and form a blob (or just widen enough to get stuck) a centimeter or two before the nozzle.</p> <p>The characteristic is usually th...
<p>I have a possible cause for my problems. XT is sensitive to moisture (hydrolytical stability) When I extruded 20mm filament manually, the string felt a bit rough. When I looked closer very tiny bubbels where visible. I baked the filament at 60°C for 2 hours.</p> <p>The baked filament allowed me to print a perfect m...
960
<p>Having read up on quite a few articles on Artificial Life (A subject I find very interesting) along with several questions right here on SO, I've begun to toy with the idea of designing a (Very, very, very) simple simulator. No graphics required, even. If I've overlooked a question, please feel free to point it out ...
<p>If you were doing this as a hard-core development project, I'd suggest using the equivalent of Java reflection (substitute the language of your choice there). If you want to do a toy project as a starter effort, I'd suggest at least rolling your own simple version of reflection, per the following rationale.</p> <p>...
<p><a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life" rel="nofollow noreferrer">Life</a> with lisp(sbcl) :)</p>
45,010
<p>Is there any way to save the state of vim settings with a document?</p> <p>To clarify: I'm editing a document and I change a bunch of settings. I don't necessarily recall which; and I don't want to use these settings again, except for the current document. I don't want to manually try to remember what I've changed;...
<p>Yes, vim settings can be included within the document.</p> <p>They are mostly found within comments, so they don't mess up the original file. An example for tab-specific settings is:</p> <pre><code>/* ex: set tabstop=8 expandtab: */ </code></pre> <p>Note that this command works in most cases, however, servers are...
<p>You could maybe save the file as a particular type, e.g. special filename format or extension, and then define an autocommand in your .vimrc for that filetype.</p> <p>I do this for my makefiles to ensure that I have the various settings I need for specific files.</p> <p>For example, here's my autocommand dec.</p> ...
40,414
<p>I can go to a specific line number by double clicking in the status bar in Visual Studio. Is there a keyboard shortcut that does the same thing?</p>
<p><kbd>Ctrl</kbd> + <kbd>G</kbd> </p> <p>Check out all the keyboard shortcuts at:</p> <p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=e5f902a8-5bb5-4cc6-907e-472809749973&amp;displaylang=en" rel="noreferrer">http://www.microsoft.com/downloads/details.aspx?familyid=e5f902a8-5bb5-4cc6-907e-4728097...
<p>Yep <kbd>Ctrl</kbd> + <kbd>G</kbd>.</p> <p>From <a href="https://stackoverflow.com/questions/320119/visual-studio-hotkey-to-switch-between-code-behind-and-source-file#320151">this answer</a> you can get a nice Shortcut poster.</p>
43,239
<p>I've recently come across a feature of doing a large query in oracle, where changing one thing resulted in a query that used to take 10 minutes taking 3 hours.</p> <p>To briefly summarise, I store a lot of coordinates in the database, with each coordinate having a probability. I then want to 'bin' these coordinates...
<p>Hash group (and hash joins, as well as other operations such as sorts etc.) can use either optimal (i.e. in-memory), one-pass or multi-pass methods. The last two methods use TEMP storage and is thus much slower.</p> <p>By increasing the number of possible items you might have exceeded the number of items that will ...
<p>Is your <em>PGA_AGGREGATE_TARGET</em> set to zero by any chance? It's unlikely that it's the HASH GROUPBY on its own that caused the issue, it's probably something before it or after it. Downgrade your <em>OPTIMIZER_FEATURES_ENABLE</em> to 10.1.0.4 and rerun the query - you'll see that now you'll get a SORT GROUPBY ...
18,709
<p>I have currently 200+ GB database that is using the DB2 built in backup to do a daily backup (and hopefully not restore - lol) But since that backup now takes more than 2.5 hours to complete I am looking into a Third party Backup and Restore utility. The version is 8.2 FP 14 But I will be moving soon to 9.1 and I a...
<p>One thing that will help is going to DB2 version 9 and turn on compression. The size of the backup will then decrease (by up to 70-80% on table level) which should shorten the backup time. Of course, if your database is continuosly growing you'll soon run into problems again, but then data archiving might be the thi...
<p>It's not a "third-party" product but anyone that I have ever seen using DB2 is using <a href="http://www-01.ibm.com/software/tivoli/products/storage-mgr/" rel="nofollow noreferrer">Tivoli Storage Manager</a> to store their database backups.</p> <p>Most shops will set up archive logging to TSM so you only have to ta...
21,163
<p>This is somewhat similar to <a href="https://stackoverflow.com/questions/25653/hide-a-column-in-aspnet-dynamic-data">this question</a>.</p> <p>However, rather than wanting to hide a column all together, I am just looking to hide the column on the List.aspx page.</p> <p>My specific example is that fields that are l...
<p>You can create a custom page for the particular table you want to change. There's an example <a href="http://davidhayden.com/blog/dave/archive/2007/12/30/ASPNETDynamicDataWebsitesCustomizingPagesValidation.aspx" rel="nofollow noreferrer">here</a>.</p> <p>Within your custom page, you can then set <code>AutoGenerate...
<p>if u r using bootstrap u can set like this</p> <pre><code>&lt;asp:DynamicField DataField="Id" ItemStyle-CssClass="hidden" HeaderStyle-CssClass="hidden" FooterStyle-CssClass="hidden"/&gt; </code></pre>
10,559
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/30170/avoiding-repeated-constants-in-css">Avoiding repeated constants in CSS</a> </p> </blockquote> <p>We have some "theme colors" that are reused in our CSS sheet.</p> <p>Is there a way to set a variable and ...
<p>There's no requirement that all styles for a selector reside in a single rule, and a single rule can apply to multiple selectors... so <em>flip it around</em>:</p> <pre><code>/* Theme color: text */ H1, P, TABLE, UL { color: blue; } /* Theme color: emphasis */ B, I, STRONG, EM { color: #00006F; } /* ... */ /* Th...
<p>CSS does not (yet) employ variables, which is understandable for its age and it being a declarative language.</p> <p>Here are two major approaches to achieve more dynamic style handling:</p> <ul> <li>Server-side variables in inline css<br> Example (using PHP): <blockquote> <p><code>&lt;style&gt; .myclass{colo...
6,976
<p>Having a problem trying to create a function, as part of a BizTalk helper class that returns a value of type (Microsoft.XLANGs.BaseTypes.XLANGMessage). The function code is as follows:</p> <pre><code>public XLANGMessage UpdateXML (XLANGMessage inputFile) { XmlDocument xDoc = new XmlDocument(); XLANGMessage ou...
<p>In the code you have provided, change the line:</p> <pre><code>XLANGMessage outputFile; </code></pre> <p>to:</p> <pre><code>XLANGMessage outputFile = null; </code></pre> <p>and change the <code>TypeOf</code> to <code>typeof</code></p> <p>You might want to take a look at these two blog articles <a href="http://v...
<p>There is no need to return XLangMessage in this case. You can return the XmlDocument object itself and assign it a new variable in a Construct Message Shape.</p> <p>Also it's not a good idea to return XLangMessage from user code. See here <a href="http://msdn.microsoft.com/en-us/library/aa995576.aspx" rel="nofollow...
32,151
<p>I've got several examples like the image below where the perimeter either doesn't bond to, or doesn't reach the infill. I tried adjusting the <code>infill overlap</code> parameter in Slic3r from its default of 25 % to 30 %, but it doesn't seem to have made a difference. This is on a new Tevo Tornado that's all stock...
<p>This has nothing to do with the infill overlap, the image you've added looks as if the issue is related to non-bonding perimeters (it looks as if it is in between the 2<sup>nd</sup> and the 3<sup>rd</sup> perimeter), hence infill overlap doesn't apply here. If that is the case look into <a href="/q/6067">this questi...
<p>I had absolutely the same issue. And after some research I finally found that this is because of wrong pressure advance setting (In case of Marlin - linear advance) in the firmware. Without pressure advance (linear advance) will be more plastic at the end of the travel rather than at the start. As result the fast fu...
1,276
<p>What best practices should be observed when implementing HDL code?</p> <p>What are the commonalities and differences when compared to more common software development fields?</p>
<p>The best book on this topic is <a href="http://www.amazon.com/exec/obidos/tg/detail/-/1402071418/ref=ase_penguintelecomin/102-8353601-4848123?v=glance&amp;s=books" rel="noreferrer">Reuse Methodology Manual</a>. It covers both VHDL and Verilog.</p> <p>And in particular some issues that don't have an exact match in ...
<ul> <li><p>in HDL, some parts of the code can work at the same time, for example two lines of code "can work" at the same time, this is an advantage, to use wisely. this is something that a programmer who is accustomed to line by line languages may find hard to grasp at first:</p> <ul> <li>Long and specific for your...
42,349
<p>using <code>target="_blank"</code> in the <code>navigateToUrl</code></p> <p>with Firefox on Windows it opens in new tab, with Firefox on Mac it opens a 'popup',</p> <p>How to make the window popup in a new tab on Firefox on Mac as well?</p>
<p>Check your Firefox preferences >> Tabs >> New windows should be opened in (a new window | a new tab). Do you have different settings for your Firefox on your Windows and on your Mac?</p>
<p>This is most likely a bug in the browser and/or plug-in. My suggestion would be to try telling JavaScript to open the window, using ExternalInterface. This may be more likely to trigger a pop-up blocker though.</p>
12,588
<p>I need to query Active Directory for a list of users whose password is about to expire. The obvious (and easy) way to do this is with:</p> <pre><code>dsquery user -stalepwd n </code></pre> <p>The problem is that I need to add additional filters to only look for users who are in certain security groups. This is ...
<p>There are better tools than dsquery to use.</p> <p><a href="http://www.joeware.net/freetools/tools/findexpacc/usage.htm" rel="nofollow noreferrer">FindExpAcc</a> from joeware will do the same as stalepwd and allow a filter through its -f switch.</p> <p>The filter would then look like:</p> <pre><code>&amp;(objectC...
<p>There are better tools than dsquery to use.</p> <p><a href="http://www.joeware.net/freetools/tools/findexpacc/usage.htm" rel="nofollow noreferrer">FindExpAcc</a> from joeware will do the same as stalepwd and allow a filter through its -f switch.</p> <p>The filter would then look like:</p> <pre><code>&amp;(objectC...
38,370
<p>A while ago, I created some simple command buttons in Octoprint to help with bed levelling, by hopping to particular points on the bed. I realised that what I actually want to do is move Z up 10mm, move, and then home Z though, to avoid ploughing the nozzle along the bed if the level is badly off.</p> <p>So I did t...
<p>NO if you want to smooth your print, gently heat the plastic and with a utensil smooth out the plastic. A hair dryer is a good way of doing this but be careful to only lightly melt the outside of the model.</p>
<p>Nail polish contains acetone. It melts PLA, so yes you <em>could</em> damage it. Google acetone vapor batch to read up on a safer way to do the job.</p>
700
<p>I want to add text to speech user guided instruction to my applications. Where can I find a Text to speech component to do that. I do not want to use the Windows functions.</p>
<p>Chant SpeechKit has everithing you need <a href="http://www.chant.net/Products/SpeechKit/Default.aspx" rel="nofollow noreferrer">http://www.chant.net/Products/SpeechKit/Default.aspx</a></p>
<p>If you just want a Delphi component that 'wraps' the Windows speech API, you could try this:</p> <p><a href="http://www.o2a.com/dtalk.htm" rel="nofollow noreferrer">http://www.o2a.com/dtalk.htm</a></p> <p>However, if you want a complete speech synthesizer which is totally independent of the Windows system, that's ...
41,447
<p>When commiting to SVN I can add a top level commit message to detail what is being committed, but I would ideally like a means to comment on the individual files and what has changed within them. I have seen something similar in previous employment, but this was using CVS (and I can't recall whether this was achiev...
<p>I would just do this in the individual commit message. <a href="http://tortoisesvn.tigris.org/" rel="nofollow noreferrer">TortoiseSVN</a> has filename autocompletion so that greatly aids in this.</p> <p>Another thing you could do is svn st before you commit and copy/paste the filenames into your commit message.</p>...
<p>That kind of result could be obtain if there is some rules regarding the way comments are written inside each of the committed files. These comments can after that be extracted by a svn trigger.</p>
12,805
<p>I have an List and I'd like to wrap it into an IQueryable.</p> <p>Is this possible?</p>
<pre><code>List&lt;int&gt; list = new List&lt;int&gt;() { 1, 2, 3, 4, }; IQueryable&lt;int&gt; query = list.AsQueryable(); </code></pre> <p>If you don't see the <code>AsQueryable()</code> method, add a using statement for <code>System.Linq</code>.</p>
<p>Use the <code>AsQueryable&lt;T&gt;()</code> extension method.</p>
9,929
<p>What is the best solution to sanitize output HTML in Rails (to avoid XSS attacks)?</p> <p>I have two options: white_list plugin or sanitize method from Sanitize Helper <a href="http://api.rubyonrails.com/classes/ActionView/Helpers/SanitizeHelper.html" rel="nofollow noreferrer">http://api.rubyonrails.com/classes/Act...
<p>I recommend <a href="http://code.google.com/p/xssterminate/" rel="nofollow noreferrer">http://code.google.com/p/xssterminate/</a>.</p>
<p>Personally I think it's not a small decision to accept any HTML entry in any web app. You can test for white/blacklisted tags as much as you like, but unless you're testing for correct nesting, someone could enter a series of closing tags, for example</p> <pre><code>&lt;/td&gt;&lt;/tr&gt;&lt;/span&gt;&lt;/div&gt; <...
26,410
<p>Why does Visual Studio declare new classes as private in C#? I almost always switch them over to public, am I the crazy one?</p>
<p>I am not sure WHY it does that, but here's what you do in order to get Visual Studio to create the class as Public by default:</p> <p>Go over to “Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033″, you will find a file called Class.zip, inside the .zip file open the file called Cl...
<p>C++, upon which C# is derived, specified that the default class access level is private. C# carries this forward for better or worse.</p>
6,106