instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>When I launch CruiseControl.NET with a particular configuration file I receive the following error:</p> <blockquote> <p>ThoughtWorks.CruiseControl.Core.Config.ConfigurationException: Duplicate node detected</p> </blockquote> <p>What does this mean, and what causes it?</p>
<p>No, I don't believe so.</p> <p>Certainly the C# compiler disallows it when converting a lambda expression:</p> <pre><code>int x; Expression&lt;Func&lt;int,int&gt;&gt; foo = (x=y); // Assign to x and return value </code></pre> <p>This yields the error:</p> <pre><code>CS0832: An expression tree may not contain an ...
<p>You could probably work around it by nexting expression trees. Call a lambda function, where an argument is the value of the assignee.</p>
25,636
<p>I have the requirement of generating UML Diagrams for one of my C++ assignments. I'm using Visio 2007 and I'm having trouble representing C++ pointers. I've found a way to add a suffix to Datatypes however it's rather time consuming to do this for every pointer used or returned in my program. </p> <p>Basically I'm ...
<p>One solution is to create a custom datatype with Object* as the name but that would need to be done for every class. </p>
<p>One solution is to create a custom datatype with Object* as the name but that would need to be done for every class. </p>
29,533
<p>I would like to write an application that will copy MP3 files to a SanDisk Sansa M240. The SanDisk doesn't have a drive letter and uses MTP for file transfer. I stumbled through the sample of connecting to the device at : <a href="http://blogs.msdn.com/dimeby8/archive/2006/09/27/774259.aspx" rel="nofollow noreferr...
<p>It looks like dimeby8 posted some code that handles data transfers. Check other posts in his blog, especially:</p> <p><a href="https://learn.microsoft.com/en-us/archive/blogs/dimeby8/sending-mtp-commands-through-wpd-part-1-without-a-data-phase" rel="nofollow noreferrer">Sending MTP commands through WPD part 1</a></...
<p>To transfer files through MTP with c#:</p> <ol> <li><p>Download this NuGet package: <a href="https://www.nuget.org/packages/PortableDevices/" rel="nofollow">PortableDevices</a></p></li> <li><p>Add references to these 4 COM libraries:</p> <ul> <li>PortableDeviceClassExtension</li> <li>PortableDeviceConnectApi</li> ...
33,514
<p>I'm looking for a way to visualize a piece of GML I'm receiving. What is the best freely available java library to use for this task?</p>
<p><a href="http://geotools.codehaus.org/" rel="nofollow noreferrer">GeoTools</a> provides a library for reading GML files. They also provide UI components for displaying geospatial formats their library supports. </p>
<p>You are warned that GML does not actually define a file format. It provides an abstract starting point for defining your own xml schema. We use the schema to sort out what xml elements to map to what Java class (so dates show up as Date, geometry as a JTS Geometry, etc...).</p> <p>This causes enough grief with peop...
15,659
<p>I've seen there are a few of them. <a href="http://code.google.com/p/opencvdotnet/" rel="noreferrer">opencvdotnet</a>, <a href="http://www.cs.ru.ac.za/research/groups/SharperCV/" rel="noreferrer">SharperCV</a>, <a href="http://sourceforge.net/projects/emgucv" rel="noreferrer">EmguCV</a>, <a href="http://www.codepro...
<p>I started out with opencvdotnet but it's not really actively developed any more. Further, support for the feature I needed (facedetection) was patchy. I'm using <a href="http://www.emgu.com/wiki/index.php/Main_Page" rel="noreferrer">EmguCV</a> now: It wraps a much greater part of the API and the guy behind it is ver...
<p>SharperCV was our tool of choice, and it doesn't let us down, for our <a href="http://palcom.bmfnik.hu/content/hu/2006/PALCOM-RAAD2006-eng.pdf" rel="nofollow noreferrer">robotics project</a>. Even though it is currently marked as abandoned, the code is in really good shape, requires only minor tweaking to customize ...
11,114
<ol> <li>Developing software solutions which already exist and are available for re-use (either commercial or open-source). AKA "re-inventing the wheel".</li> <li>Same as above, but your solution being broken. AKA "re-inventing the square wheel".</li> <li>Developing solutions for problems which do not exist.</li> </ol>...
<p>Doing some research beforehand (1) and investing in solid software architecture (2,3) usually helps :)</p> <p>When you're planning to develop something you always need to calculate the benefits of doing some and the things like the ROI.</p> <p>You could read more about this in <a href="https://rads.stackoverflow.c...
<ol> <li>Local Market Research</li> <li>Internet Research</li> <li>Google Metrics (Seeing what the Google Count is)</li> </ol>
22,701
<p>I've been wanting to teach myself Lisp for a while. However, all the interpreters of which I've heard involve some flavor of emacs. Are there any command line interpreters, such that I could type this into the command line:</p> <blockquote> <p>lispinterpret sourcefile.lisp</p> </blockquote> <p>just like I can r...
<p>You could also try <a href="http://www.plt-scheme.org/" rel="noreferrer">DrScheme</a>, which whilst not exactly a standalone interpreter, isn't emacs :)</p> <p>It's basically a simple IDE that has an area to type in code that can be executed as a file, and then another area that is the running interpreter that you ...
<p>Another good dialect of lisp is <a href="http://www.google.com/url?sa=t&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fwww.cons.org%2Fcmucl%2F&amp;ei=04CjSMesMIKWsAPkreiEDw&amp;usg=AFQjCNEaD4T5bkSLBKWylon98jBsL7-IGA&amp;sig2=W3p2EItQZ4NdWN8YCzPbRg" rel="nofollow noreferrer">cmucl</a>. They used to love to brag about bein...
3,103
<p>Any code I've seen that uses Regexes tends to use them as a black box:</p> <ol> <li>Put in string</li> <li>Magic Regex</li> <li>Get out string</li> </ol> <p>This doesn't seem a particularly good idea to use in production code, as even a small change can often result in a completely different regex.</p> <p>Apart f...
<p>If regexes are long and impenetrable, making them hard to maintain then they should be commented.</p> <p>A lot of regex implementations allow you to pad regexes with whitespace and comments.<br /> See <a href="https://www.regular-expressions.info/freespacing.html#parenscomment" rel="nofollow noreferrer">https://www....
<p>I use them in my apps but I keep the actual regEx expression in the configuration file so if the source text I'm parsing (an email for example) changes format for some reason I can quickly update the config to handle the change without re-building the app.</p>
18,180
<p>I have just moved job and gone from VB 6 to VB.Net and found the learning jump fairly steep, have more a problem with the object / conceptual side of things .. but getting there now ... but as I was a assembler / C++ 10/15 years ago and was considering learning C++/C# .Net (XNA games library calls my name) but not s...
<p>To me the biggest obstacle for .NET is learn what is available in the framework. Therefore, if you find it easier to code in C# it will mean you only struggle with one thing instead of two. Once you know the framework it's just syntax really as 95% of the stuff you can do with C# can be done with VB.</p> <p>Also, C...
<p>I was also a VB6 developer before switching to .NET. First I tried to use VB.Net but it never felt comfortable so I tried C# and fell in love with it. :-)</p> <p>There are some differences as noted in the previous replies, there are things you can do in VB.Net that you can't in C# (like indexed properties) and vice...
39,685
<p>I am trying to leverage ORM given the following requirements:</p> <p>1) Using .NET Framework (latest Framework is okay)<br> 2) Must be able to use Sybase, Oracle, MSSQL interchangeably<br> 3) The schema is mostly static, BUT there are dynamic parts.</p> <p>I am somewhat familiar with SubSonic and NHibernate, but n...
<p>Acording to this blog you can in fact use <a href="http://ayende.com/Blog/archive/2008/05/01/Dynamic-Mapping-with-NHibernate.aspx" rel="nofollow noreferrer">NHibernate with dynamic mapping</a>. It takes a bit of tweaking though...</p>
<p>I am a little confused as to how the orm would be used then at runtime? If the ORM would dynamically build something at runtime, how does the runtime code know what the orm did dynamically? </p> <p>"have it at that point allow me to manipulate the data" - What is manipulating the data? </p> <p>I may be missing som...
16,503
<p>I have defined a new dialog and its controls in an already existing resource file. I have also created a new file which will handle the events being generated from this dialog. But I am not sure how to connect these two. </p> <p>Is the statement <code>enum { IDD=IDD_NEW_DIALOG };</code> all that is required to conn...
<p>The way this is usually done in MFC is to define a dialog template in the resource editor (as you've done), then in C++ derive a class from CDialog and associate it with the dialog template (which it sounds like you've done - it's not entirely clear).</p> <p>What actually associates the two is the constructor for y...
<p>Use class wizard to create a class for newly created dialog. ctrl+w is the shortcut key from UI resource view.</p>
45,384
<p>I can't seem to figure this out. I'm experimenting with MVC Beta and am trying to implement a catchall route such that if the user enters mysite.com/blah instead of mysite.com/home/index it will hit the "Error" route. </p> <p>Unfortunately it seems that the "Default" route always catches "blah" first. In fact the o...
<p>MVC routes are checked in the order that they are entered. </p> <p>Mysite/blah will be found by the default route. The controller will be blah, and the action is index. </p> <p>When you entered the mysite/blah/blah/blah/blah route you gave it a route it could not map the default route to and then your catchall ro...
<p>This can also help when dealing with MVC catchall problems:</p> <pre><code>routes.MapRoute( "Default", // Route name "{controller}/{action}/{*id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Para...
41,224
<p>For the purposes of this question, the code base is an ASP.NET website that has multiple pages written in both C# and Visual Basic .NET. The primary language is C# and the Visual Basic .NET webpages where forked into the project as the same functionality is needed. </p> <p>Should the time be taken to actually rewri...
<p>There are three points you should keep in mind:</p> <ol> <li>If it aint' broke don't fix it.</li> <li>Team makeup and proficiencies</li> <li>Coding standards and uniformity</li> </ol> <p>First off, like many have said if it's not broken, then why go through the effort of changing the code base. You risk adding bug...
<p>You may not want to do this. Maintainability will be very difficult in this case, as teams usually have expertise with a single language.</p> <p>We have had projects here using C# written for some pages and VB.Net for other. Building teams to maintain such projects is difficult.</p> <p>Kind regards, Ashish</p>
28,904
<p>For posting AJAX forms in a form with many parameters, I am using a solution of creating an <code>iframe</code>, posting the form to it by POST, and then accessing the <code>iframe</code>'s content. specifically, I am accessing the content like this:</p> <pre><code>$("some_iframe_id").get(0).contentWindow.document...
<p>Solved it by myself!</p> <p>The problem was, that even though the correct response was being sent (verified with Fiddler), it was being sent with an HTTP 500 error code (instead of 200).</p> <p>So it turns out, that if a response is sent with an error code, IE replaces the content of the <code>iframe</code> with a...
<p>Basically, this error occurs when the document in frame and outside of ii have different domains. So to prevent cross-side scripting browsers disable such execution.</p>
18,245
<p>Hrm... here's where my CS knowledge lets me down. I want to write an algorithm that generates a reference number that is unique. </p> <p>I don't want to use sequential numbers as they introduce a security risk and I want to use alphanumerics. The ref will have a min and max length too. (I can't use a GUID it is t...
<p>If you're worried about security risks, then you want a cryptographically-secure random number generator. You should be able to tell it how many bytes you want (i.e. how long the number can be).</p>
<p>Truncate the GUID to the size you want.</p> <p>If you're generating numbers, unless they are random and huge, you are better off checking to see if they've been used anyway.</p>
46,529
<p>Is there some way to detect file handle leaks at program termination? </p> <p>In particular I would like to make sure that all of my handles that get created are being freed in code. </p> <p>For example, I may have a CreateFile() somewhere, and at program termination I want to detect and ensure that all of them a...
<p>I have used !htrace command of windbg.</p> <pre><code>!htrace -enable !htrace -snapshot !htrace -diff </code></pre> <p>Allow you to compare the handle situation of two execution point and help you the locate the point where the leaked handle have been allocated.</p> <p>It worked well for me.</p>
<p>As MadKeithV stated, you can use RAII to great effect.</p> <p>Also a simple way (and free) is to use <a href="http://dmoulding.googlepages.com/vld" rel="nofollow noreferrer">Visual Leak Detector</a>. It's not perfect but a good way of making sure you have free'd/delete[]d/close'd, etc.</p>
40,720
<p>I have a directory of bitmaps that are all of the same dimension. I would like to convert these bitmaps into a video file. I don't care if the video file (codec) is wmv or avi. My only requirement is that I specify the frame rate. This does not need to be cross platform, Windows (Vista and XP) only. I have read...
<p>At the risk of being voted down, I'll offer a possible alternative option-- a buffered Bitmap animation.</p> <pre><code>double framesPerSecond; Bitmap[] imagesToDisplay; // add the desired bitmaps to this array Timer playbackTimer; int currentImageIndex; PictureBox displayArea; (...) currentImageIndex = 0; p...
<p>I have not tried it, but <a href="http://msdn.microsoft.com/en-us/library/bb469712(VS.85).aspx" rel="nofollow noreferrer">Windows Movie Maker</a> has an API, and XML file format you can use.</p>
31,321
<p>In Visual Studio, I often use objects only for RAII purposes. For example:</p> <pre><code>ScopeGuard close_guard = MakeGuard( &amp;close_file, file ); </code></pre> <p>The whole purpose of <em>close_guard</em> is to make sure that the file will be close on function exit, it is not used anywhere else. However, Vi...
<p><strong>Method 1:</strong> Use the <code>#pragma warning</code> directive.</p> <p><code>#pragma warning</code> allows selective modification of the behavior of compiler warning messages.</p> <pre><code>#pragma warning( push ) #pragma warning( disable : 4705 ) // replace 4705 with warning number ScopeGuard close_g...
<p>The core issue here seems to really be that the compiler does not quite understand what you are going at... which seems to be to use scoping semantics in C++ to get some code called when a variable is deallocated even when it is not being used. Right? That mechanism itself strikes me as borderline... a compiler sho...
27,050
<p>I am working a project that does not have a trunk / branches / tags directory structure - ie. everything is in the root of the svn repo.</p> <p>I would like to create a trunk directory and in the root directory, and move everything in the root directory into the new trunk directory.</p> <p>What is the best way to ...
<p>I had exactly the same problem and solved it after looking through several different pages (this one included). Here's my solution:</p> <p><strong>Note:</strong> Before you begin, if you plan to use <code>svn switch</code> to keep your working copy and avoid checking out the repo again, it's best to make sure your ...
<p>You may want to look into the svnadmin tool.</p> <ul> <li><a href="http://svnbook.red-bean.com/en/1.0/ch09s02.html" rel="nofollow noreferrer">http://svnbook.red-bean.com/en/1.0/ch09s02.html</a></li> </ul> <p>To be honest I have not tried this before, and you'll probably get an answer from someone who has, but you ...
44,977
<p>I have seen some photos of aluminum based Prusa i3 printers, and I like to know the numbers and the specs of the profiles? Also I want to know Is the first pic strong enough for reliable printer or I must use the second(respect to profiles I mean).</p> <p><a href="https://i.stack.imgur.com/JcgdB.jpg" rel="noreferre...
<p>They are 2020 (20mm x 20mm) T-slot extrusions. They should not be confused with V-slot extrusions, which are similar to T-slot, but have a 45-degree slot profile to accommodate V-slot wheels.</p> <p>If you are contemplating a new build, I would recommend using V-slot. Note that T-slot and V-slot come in a number of...
<p>It can really depend on where you are in the world. A few years ago, I was unable to obtain standard V-slot (&amp; T-nut) 2020 extrusion, at a reasonable price, and so I ended up using an extrusion from a local supplier instead, and managed to obtain 6&nbsp;m of extrusion for only $15!</p> <p>My aluminium extrusion...
750
<p>I'm using Apache JMeter 2.3, which now supports "attempt HTTPS spoofing" under the Proxy Server element. </p> <p>I've tried this on several different servers, and have had no success. Has anyone been able to successfully record from an HTTPS source with this setting?</p> <p>Or barring successfully recording, can ...
<p>While the JMeter proxy already has the ability to record HTTPS requests, a Chrome Extension that creates JMeter script came out recently: <a href="https://chrome.google.com/webstore/detail/blazemeter-the-load-testi/mbopgmdnpcbohhpnfglgohlbhfongabi?hl=en" rel="noreferrer">https://chrome.google.com/webstore/detail/bla...
<p>I am using Webscarab to record https and ajax conversations. It workd fine. I extended the Webscarab with export function for Jmeter. Bugzilla 48898.</p>
38,378
<p>I'm looking for a linux utility that can alter the payloads of network packets based on a set of rules. Ideally, I'd use <code>iptables</code> and the <code>netfilter</code> kernel module, but they don't support generic payload mangling: <code>iptables</code> will alter various <em>header</em> fields (addresses, po...
<p>I haven't used it, but the <a href="http://www.wallinfire.net/files/netfilter-packets-alter.html" rel="noreferrer">QUEUE</a> netfilter target looks like it might work. It uses an nflink socket and a userspace application registered to the socket to perform the payload modifications.</p> <p>The <a href="http://linu...
<h2>Resolution:</h2> <p>We ended up with a custom module for netfilter, which is clearly the "right" tool for the job. </p>
32,608
<p>I want to change/animate the Foreground property of a custom button control template depending on the control's state.</p> <p>Pre-RC0, I set the Foreground of the ContentPresenter, gave it an x:Name, and referenced it in the VisualStateManager transitions.</p> <p>Now, ContentPresenter no longer has a Foreground, sin...
<p>There is a <a href="http://jesseliberty.com/2008/09/28/rc0-contentpresenter/" rel="nofollow noreferrer">post from Jesse Liberty</a> dealing with this issue. In a few words, the idea is that you can't, because you would be forcing any content in the button to have a specific foreground colour, and that decision shoul...
<p>Put a Border around your ContentControl and make your VSM works for that border control.</p>
19,343
<p>This question will expand on: <a href="https://stackoverflow.com/questions/68774/best-way-to-open-a-socket-in-python">Best way to open a socket in Python</a><br /> When opening a socket how can I test to see if it has been established, and that it did not timeout, or generally fail. <br /><br /> Edit: I tried this:<...
<p>It seems that you catch not the exception you wanna catch out there :)</p> <p>if the <code>s</code> is a <code>socket.socket()</code> object, then the right way to call <code>.connect</code> would be:</p> <pre><code>import socket s = socket.socket() address = '127.0.0.1' port = 80 # port number is a number, not s...
<p>12 years later for anyone having similar problems.</p> <pre><code>try: s.connect((address, '80')) except: alert('failed' + address, 'down') </code></pre> <p>doesn't work because the port '80' is a string. Your port needs to be int.</p> <pre><code>try: s.connect((address, 80)) </code></pre> <p>This sh...
21,370
<p>On our web application, the search results are displayed in sortable tables. The user can click on any column and sort the result. The problem is some times, the user does a broad search and gets a lot of data returned. To make the sortable part work, you probably need all the results, which takes a long time. O...
<p>Using sorting paging at the database level is the correct answer. If your query returns 1000 rows, but you're only going to show the user 10 of them, there is no need for the other 990 to be sent across the network. </p> <p>Here is a mysql example. Say you need 10 rows, 21-30, from the 'people' table:</p> <pre>...
<p>You could do the sorting on the server. AJAX would eliminate the necessity of a full refresh, but there'd still be a delay. Sides, databases a generally very fast at sorting.</p>
14,321
<p>I have created a Web Application in asp.net 2.0. which is working fine on my Local machine. However when trying to deploy it on sever that has windows 2003 sever, I get the error:</p> <h1>Server Error in '/' Application.</h1> <hr> <h2><em>Parser Error</em></h2> <p><strong>Description:</strong> An error occurred ...
<p>Is the folder on the web server (IIS presumably) marked as an ASP.NET application? If not, ~/ will point to the next application up, or the site root.</p> <p>It should have a cog icon in the IIS/MMC snap-in. Also ensure that it is running the right version of ASP.NET (v2.blah usually).</p> <p>In the IIS/MMC view, ...
<p>There are other possible issues that could result in the error message stated above, like permission problems on the server for instance.</p> <p>Look <a href="http://forums.asp.net/p/972609/1228020.aspx" rel="nofollow noreferrer">here</a> for a thread in which this topic is also discussed.</p>
19,045
<p>I come from a .NET world and I'm new to writting C++. I'm just wondering what are the preferred naming conventions when it comes to naming local variables and struct members.</p> <p>For example, the legacy code that I've inheritted has alot of these:</p> <pre><code>struct MyStruct { TCHAR szMyChar[STR...
<p>That kind of Hungarian Notation is fairly useless, and possibly worse than useless if you have to change the type of something. (<a href="http://www.joelonsoftware.com/articles/Wrong.html" rel="noreferrer">The <em>proper</em> kind of Hungarian Notation</a> is a different story.)</p> <p>I suggest you use whatever yo...
<p>If you use CamelCase the convention is to Capitalize the first letter for classes structs and non primitive type names, and lower case the first letter for data members. Capitalization of methods tends to be a mixed bag, my methods tend to be verbs and are already distingished by parens so I don't capitalize methods...
29,068
<p>As I develop more with vim, I find myself wanting to copy in blocks of useful code, similar to "templates" in Eclipse. </p> <p>I was thinking of making a separate file for each code chunk and just reading them in with</p> <pre><code>:r code-fornext </code></pre> <p>but that just seems kind of primitive. Googling ...
<p>To record macros in Vim, in the command mode, hit the <code>q</code> key and another key you want to assign the macro to. For quick throw away macros I usually just hit <code>qq</code> and assign the macro to the <code>q</code> key. Once you are in recording mode, run through your key strokes. When you are done make...
<p>On vim.wikia, you will find a <a href="http://vim.wikia.com/wiki/Category:Automated_Text_Insertion" rel="nofollow noreferrer" title="Automated Text Insertion category">category of tips</a> dedicated to snippets and abbreviations expansion. You will also see a list of plugins that ease the definition of complex snipp...
7,801
<p>My company is in the process of rewriting our software from scratch, and I'm the one who is going to be doing most of the work in rewriting the Mac client (The core of our software is Windows based, and the Mac client communicates with it through a webservice).</p> <p>This isn't a real heavy app, mainly does some b...
<p>If it were I doing the update, I would target 10.5, especially since 10.6 is just around the corner and 10.5 did come out with a lot of great, new things (especially Objective-c 2.0). However, I think you really need to answer this question based on what you think your target customer group will be using. If they ar...
<p>I never wrote production code in Objective-C and its hard to keep up, but as far as i am aware NSInteger and friends are in 10.4, it's just that Cocoa isn't 64 bit in 10.4 whereas in 10.5 most of it is (so no more need for seperate 64bit worker process under a 32bit UI).</p> <p>I don't know what your product is, or...
36,308
<p>I want to create own header.jsp file instead of the one included in the JBoss Portal 2.6 but have to support the locale set by the user.</p> <p>The original header.jsp does not contain any i18n and I don't know how to do it, especially how to get the actual locale.</p>
<p>In header.jsp, use a scriptlet:</p> <pre><code>&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %&gt; &lt;% locale = request.getLocale() // get the user's locale from the HttpServletRequest %&gt; </code></pre> <p>and then set the property bundle:</p> <pre><code>&lt;fmt:setLocale value="&lt;...
<p>You can look to Thread.currenThread method to see the user's lang.</p> <p>After that you have to a framework to implement i18n, ex : struts or jsf.</p>
33,193
<p>A C-program is placing what it considers to be 64-bit unsigned integers into a column in a Postgres database that is typed as int8. To Postgres, int8 is always 'signed int8' (no such thing to it as 'unsigned int8'). So the Ruby program I have shows numbers retrieved from Postgres in the upper half of that space as n...
<p>For all those requirements, there's only two companies to choose from: <a href="http://www.telerik.com/" rel="nofollow noreferrer">Telerik</a> and <a href="http://www.devexpress.com/" rel="nofollow noreferrer">DevExpress</a>. Both have fantastic support and incredible ASP.NET products. They release often, and are ...
<p>I would add Componentone to the list of good companyes who make great components. Check out their studio for Asp.Net package. Full of nice components. Most of them use Ajax. You can check out samples of all components on their homepage and you can download and try before buy. </p> <p>The licenses are developer-base...
38,640
<p>I've just installed Ocaml on Mac OS X, and when I run the ocaml program I get a "Bus Error" with no other clues to what might be going on. Can anyone offer suggestions on where to go from here?</p> <p>EDIT:</p> <p>I installed via the package: </p> <p><a href="http://caml.inria.fr/pub/distrib/ocaml-3.10/ocaml-3....
<p>Turns out I was installing a version of OCaml built for Mac OS X 10.5.x (Leopard) on my machine running 10.4.x (Tiger). One would think it would be easy for the installer to catch this, but alas...</p>
<p>Did you install it from macports? It's working fine for me. Can you describe some more details about your installation? Perhaps what you're doing to get the error?</p>
42,738
<p>I need to randomly fade my background images in and out.</p> <p>It will be a timed function, like once every 5 seconds.<br> I need to do it with ASP.NET, Javascript, CSS or all three.</p> <p>Please help me out here guys. Thank you.</p>
<p>Cycle, a jQuery plugin is a very flexible image rotating solution: <a href="http://malsup.com/jquery/cycle/" rel="nofollow noreferrer">http://malsup.com/jquery/cycle/</a></p>
<p>Just found a tutorial on how to do this with CSS background images and jQuery at...<br /> <a href="http://www.marcofolio.net/webdesign/advanced_jquery_background_image_slideshow.html" rel="nofollow">http://www.marcofolio.net/webdesign/advanced_jquery_background_image_slideshow.html</a></p> <p>Seems fairly in depth....
17,606
<p>How to get the path of the current csproject?</p> <p>Let's say I have a csproject name <code>MyProj.csproj</code>, inside there is a class that wants to know what is the file path of this csproj, any idea on how to do this? thanks.</p>
<p>If you really must do this, I would consider meta-programming. Create another project in your solution that builds a command line exe which takes one argument. The command line exe project should output a cs file that contains a class with a static property returning the value passed at the command line.</p> <p>T...
<p>I just found this and there is a really easy way to do it with Roslyn.</p> <pre><code>string solutionPath = @"C:\Users\...\PathToSolution\MySolution.sln"; var msWorkspace = MSBuildWorkspace.Create(); var solution = msWorkspace.OpenSolutionAsync(solutionPath).Result; foreach (var project in solution.Projects) { ...
28,261
<p>I'm getting into more of a TDD workflow, and have a mix of MVC and asp.net Web Forms apps.</p> <p>MOQ is recommended for MVC.</p> <p>I've used Rhino for Web Forms.</p> <p>Does anyone have a best practice for having 1 framework mock for both?</p>
<p>Rhino's latest release includes much of the sweet sweet 3.5 love that MoQ has. I'm a fan of MoQ, so that's what I'm using. But I also have Rhino, in case it does something that MoQ doesn't do.</p> <p>TL;DR: MoQ it baby.</p>
<p>I would just go ahead and use my favourite framework for both. I don't think there's any reason that I would choose one framework for web forms and another for MVC. A far bigger problem is how I would unit test my web forms pages at all, since it's notoriously hard to seperate the page from the rest of the HttpReque...
3,137
<p>About 6 months ago I rolled out a site where every request needed to be over https. The only way at the time I could find to ensure that every request to a page was over https was to check it in the page load event. If the request was not over http I would response.redirect("<a href="https://example.com" rel="nore...
<p>Please use <a href="https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security" rel="noreferrer">HSTS</a> (HTTP Strict Transport Security)</p> <p>from <a href="http://www.hanselman.com/blog/HowToEnableHTTPStrictTransportSecurityHSTSInIIS7.aspx" rel="noreferrer">http://www.hanselman.com/blog/HowToEnableHTTPStrictT...
<p>-> Simply ADD [RequireHttps] on top of the public class HomeController : Controller.</p> <p>-> And add GlobalFilters.Filters.Add(new RequireHttpsAttribute()); in 'protected void Application_Start()' method in Global.asax.cs file.</p> <p>Which forces your entire application to HTTPS.</p>
6,928
<p>I'm currently using and enjoying using the Flex MVC framework <a href="http://www.puremvc.org" rel="noreferrer">PureMVC</a>. I have heard some good things about Cairngorm, which is supported by Adobe and has first-to-market momentum. And there is a new player called Mate, which has a good deal of buzz.</p> <p>Has...
<p><a href="http://mate.asfusion.com/" rel="noreferrer">Mate</a> is my pick. The first and foremost reason is that it is completely unobtrusive. My application code has no dependencies on the framework, it is highly decoupled, reusable and testable. </p> <p>One of the nicest features of Mate is the declarative configu...
<p>Bear in mind that Cairngorm is THE adobe sponsored framework, and now hosted on opensource.adobe.com. Also note that it's by far the most prolific amongst developers at the moment.</p> <p>If you know Cairngorm and are looking for a job, you won't go far wrong.</p>
5,768
<p>I'm trying to setup the Entity Framework with SQL Server 2008. I'm using Guids for the keys on my tables. Is there a way to set it up so the keys are automatically generated by the database? I tried setting "RowGuid" to true and also set the column's default value to be "(newid())". Either way the mapped class s...
<p><a href="http://blogs.msdn.com/dsimmons/pages/ef-faq-entity-services.aspx#Section_17" rel="nofollow noreferrer">Not yet</a>:</p> <blockquote> <p><strong>17.4.Can I use a server-generated guid as my entity key?</strong></p> <p>Unfortunately, in v1 of the EF this is not supported. While it is possible with SQL Server...
<p>Update: Microsoft has fixed this bug for VS2010 SP1 with <a href="http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=37957" rel="nofollow">hotfix KB2561001</a>.</p>
43,041
<p>In my database (SQL 2005) I have a field which holds a comment but in the comment I have an id and I would like to strip out just the id, and IF possible convert it to an int:</p> <p><code>activation successful of id 1010101</code></p> <p>The line above is the exact structure of the data in the db field.</p> <p>A...
<p>This should do the trick:</p> <pre><code>SELECT SUBSTRING(column, PATINDEX('%[0-9]%', column), 999) FROM table </code></pre> <p>Based on your sample data, this that there is only one occurence of an integer in the string and that it is at the end.</p>
<pre><code>-- Test table, you will probably use some query DECLARE @testTable TABLE(comment VARCHAR(255)) INSERT INTO @testTable(comment) VALUES ('activation successful of id 1010101') -- Use Charindex to find "id " then isolate the numeric part -- Finally check to make sure the number is numeric before co...
12,820
<p>Is there an exact overview what has changed in the SP1 for .NET 3.5? New classes, methods, etc.</p> <p>For example, I've noticed there is a new <code>WaitOne(TimeSpan)</code> and <code>WaitOne(int)</code> overloads in the <code>WaitHandle</code> class.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/cc713697.aspx" rel="nofollow noreferrer">What's New in the .NET Framework Version 3.5 SP1 - MSDN</a></p>
<p><strong>.NET Framework Client Profile</strong> is a great feature , check all the features <a href="http://msdn.microsoft.com/en-us/library/cc713697.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/cc713697.aspx</a></p>
21,944
<p>How to check reliably if a SoundChannel is still playing a sound? </p> <p>For example,</p> <pre><code>[Embed(source="song.mp3")] var Song: Class; var s: Song = new Song(); var ch: SoundChannel = s.play(); // how to check if ch is playing? </code></pre>
<p>I've done a little research and I can't find a way to query any object to determine if a sound is playing. You'll have to write a wrapper class and manage it yourself it seems.</p> <pre><code> package { import flash.events.Event; import flash.media.Sound; import flash.media.SoundChannel; public cla...
<p>One of the ways to check if sound is still playing, and not using any managers, would be checking soundChannel.position in two consecutive enterFrame listener calls, if mismatched, then the sound is still playing.</p> <pre><code>private var oldPosition:Number; function onEnterFrame(e:Event):void { var stillPlay...
23,589
<p>Or any open source project which utilize collective intelligence extensively?.</p>
<p>There's a new book out from Manning, <a href="http://www.manning.com/alag/" rel="nofollow noreferrer">"Collective Intelligence in Action"</a>. There are also code samples available written in Java. I also recommend the Toby Segaran book. Coming from a Java background I was able to follow the Python code without a pr...
<p>look up weka (java) and the Datamining book by Franke and Witten</p>
45,017
<p>I have two tables containing Tasks and Notes, and want to retrieve a list of tasks with the number of associated notes for each one. These two queries do the job:</p> <pre>select t.TaskId, (select count(n.TaskNoteId) from TaskNote n where n.TaskId = t.TaskId) 'Notes' from Task t -- or select t.TaskId, ...
<p>On small datasets they are wash when it comes to performance. When indexed, the LOJ is a little better.</p> <p>I've found on large datasets that an inner join (an inner join will work too.) will outperform the subquery by a very large factor (sorry, no numbers).</p>
<p>You can use either, and they are semantically identical. In general, the rule of thumb is to use whichever form is easier for you to read, unless performance is an issue.</p> <p>If performance is an issue, then experiment with rewriting the query using the other form. Sometimes the optimizer will use an index for o...
14,354
<p>I'm using an in-memory dataset to represent an array of objects. I've got most of the code figured out to fill the dataset at runtime, but part of my object contains a dynamic array of TPoint records, and I have no idea how to set up the dataset and the loading code to make that work. I know a TPoint can be repres...
<p><a href="http://www.netbeans.org/" rel="noreferrer">Netbeans IDE</a> is quite good.</p>
<p>Go for Eclipse for everything. I tried Netbeans but it sucks! It doesn't even have a word-wrap feature! Can you believe that?</p>
31,993
<p>I'm at a loss for where to get the best information about the meaning, likely causes, and possible solutions to resolve COM errors when all you have is the HRESULT.</p> <p>Searching Google for terms like '80004027' is just about useless as it sends you to random discussion groups where 90% of the time, the question...
<p>I always use WinError.h. That has the vast majority of Windows error codes of all sorts.</p> <p>A key indicator to look out for is the Facility part of the code: the second most-significant byte. That is, 0x80nnmmmm, where nn is the Facility. That tells you which component generated the code. Anything with a facili...
<p><H2><a href="http://msdn.microsoft.com/en-us/library/ms690088.aspx" rel="nofollow noreferrer">Structure of COM Error Code</a></H2></p> <p>Second in Google results for COM Error Code.</p>
7,527
<p>The job at hand:</p> <p>I want to make sure that my website's users view a page before they start a download. If they have not looked at the page but try to hotlink to the files directly they should go to the webpage before the download is allowed.</p> <p>Any suggestions that are better than my idea to send out a ...
<p>Instead of allowing hotlinking to the files, store them outside of a web accessible route. Instead make download requests go to a php script that initiates the download. You can put checks in place to ensure that the requesting page was the one you wanted read.</p>
<p>I was about to suggest the .htaccess referral trick, but it isn't a very secure method. It's easy to make a PHP script, with a custom http-referral added. If you enter the download page there, it will think you come from that page.</p> <p>Is this a relevant problem? Can you tell something about the context of your ...
7,826
<p>For Asp.net web applications, is it best to:</p> <ol> <li>trap errors within sql stored procedures and test for a return value in the code or </li> <li>just let the error occur in sql (dont handle it) and rely on ado.net raising the errors within the code.</li> </ol> <p>What are the best practises here?</p>
<p>A general rule that applies here is to catch the error as near the source as possible. SQL Server now has "try ... catch ..." error trapping syntax. So use it. The overhead of the little bit of extra code is insignificant, and if you have multiple statements in your SP, you can adapt the string in RAISERROR to help ...
<p>I use try/catch on all potentially error generating calls to libraries or other servers including database queries. I'm primarily a developer not a DBA so I handle the error in the language that I'm most proficient in, C# not SQL. I'm sure that'll vary for every programmer. Not handling the error is never fine in my...
33,776
<p>Imagine a WinForms client app that displays fairly complex calculated data fetched from a server app with .Net Remoting over a HTTPChannel.<br> Since the client app might be running for a whole workday, I need a method to notify the client that new data is available so the user is able to start a reload of the data ...
<p>I've implemented a similar notification mechanism using MSMQ. The client machine opens a local, public queue, and then advises the server of it's queue name. When changes occur, the server pushes notifications into all the client queues that it's be made aware of. This way the client will know that data is ready,...
<p>I would usually use a UI timer on the client to periodically hit the server to see if there was new or updated data. (Assuming you have a mechanism to identify that you have new data like time stamps for new rows, or file time stamps, or a table with last-calculated dates, etc)</p> <p>That way the server doesn't h...
24,578
<p>Sorry for this not being a "real" question, but Sometime back i remember seeing a post here about randomizing a randomizer randomly to generate truly random numbers, not just pseudo random. I dont see it if i search for it.</p> <p>Does anybody know about that article?</p>
<p>I believe that was on <a href="http://thedailywtf.com/Articles/Random-Stupidity.aspx" rel="noreferrer">thedailywtf.com</a> - ie. not something that you want to do.</p> <p>It is not possible to get a truly random number from pseudorandom numbers, no matter how many times you call randomize().</p> <p>You <em>can</em...
<p>One of the best method to generate a random number is through <a href="http://en.wikipedia.org/wiki/Hardware_random_number_generator#Clock_drift" rel="nofollow noreferrer">Clock Drift</a>. This primarily works with two oscillators.</p> <p>An analogy of how this works is imagine a race car on a simple oval circuit w...
5,850
<p>I've just upgraded some old Java source which has been running on a Sun Java 1.4.2 VM to Sun Java (JRE) 6 VM. More or less the only thing I had to change was to add explicit datatypes for some abstract objects (Hashmap's, Vector's and so on). The code itself it quite memory intensive, using up to 1G of heap memory (...
<p>Not much information here. But here are a couple of things you might want to explore:</p> <ul> <li><p>Start the VM with Xmx and Xms as the same value (in your case 1024M)</p></li> <li><p>Ensure that the server jvm dll is being used to start the virtual machine.</p></li> <li><p>Run a profiler to see what objects are...
<p>Definitely use a profiler on the app (YourKit is great)...it's easy to waste a lot of time guessing at the problem when most of the time you'll be able to narrow it down really quickly in the profiler.</p>
47,314
<p>Is there any way to automatically rename accessor/mutator when a variable they get/set gets refactored -> renamed (Eclipse 3.4)?</p>
<p>1 - When you select Refactor->Rename on a variable, Eclipse prompts you to enter the new name in an "in-line" box. Directly below it, there is a help message and next to it a small icon (an arrow going down).Click on that arrow and then select "Open Rename Dialog". A new pop-up appears with the checkboxes you need.<...
<p>By default eclipse will not rename getters and setters when using 'inline' renaming of a variable. However you can change this behaviour by using the 'Rename Field' dialog for a rename once, and selecting 'Rename getter' and 'Rename setter'. (see the <a href="https://stackoverflow.com/a/197188/137369">answer by idro...
23,969
<p>Why VS does not have support for undo/redo files?</p>
<p>It would reproduce the functionality of a revision control system (such as Subversion or CVS), but without some of the benefits of those systems (such as tags and branches). That's probably why it isn't there (or in many IDEs). Many people seem to be discouraged from using revision control for small projects, but ...
<p>If that features does what I'm thinking it does, it's basically a function of your source control system, and isn't something that should be handled by visual studio. On the other hand, VS does keep a complete history of every change you made since you opened Visual studio, and you can undo an redo changes for the ...
47,716
<p>I'm going to be distributing a plugin that will be routinely updated with features, bug fixes, and updates to downloadable corpuses.</p> <p>The usual update site mechanism can do the update ok - when the user asks it to.</p> <p>The problem is that (unlike MS Office), the automatic updater preference is off by defa...
<p>Eclipse 3.4 check automatically for plugin updates by default. You will see a popup window in the bottom right when an update is available.</p> <p>To configure automatic updates, go to Window > Preferences > Install Updates > Automatic Updates</p>
<p>The absolute sure fire way is to make sure that your updates are compelling. The user will do the rest</p>
25,414
<p>I'm dynamically loading user controls adding them to the Controls collection of the web form.</p> <p>I'd like to hide user controls if they cause a unhandled exception while rendering.</p> <p>So, I tried hooking to the Error event of each UserControl but it seems that this event never fires for the UserControls as...
<p>mmilic, following on from <a href="https://stackoverflow.com/questions/10793/catching-unhandled-exceptions-in-aspnet-usercontrols#10910">your response</a> to my <a href="https://stackoverflow.com/questions/10793/catching-unhandled-exceptions-in-aspnet-usercontrols#10815">previous idea</a>..</p> <p>No additional log...
<p>Global.asax and Application_Error?</p> <p><a href="http://www.15seconds.com/issue/030102.htm" rel="nofollow noreferrer">http://www.15seconds.com/issue/030102.htm</a></p> <p>Or the Page_Error Event on an individual Page only:</p> <p><a href="http://support.microsoft.com/kb/306355" rel="nofollow noreferrer">http://...
3,194
<p>We're trying to decide between having all the devs on a particular team to use an absolute path for their code base or if relative paths are fine.</p> <p>One reason I can think for an absolute path, meaning everyone has the same path, is because of IIS and functional tests. Our asp.net functional test use Nunit an...
<p>Go with relative pathnames. Really. Think of branching your repository. Think of setting up Unit Tests. Think of having separate debug and release builds. To pun a bit... It's all relative.</p>
<p>I too was faced with the situation where the dev server required an absolute path to launch. It was also for unit testing. After spending a couple of days dwelling on the issue, I decided to refactor as much as possible to make testing work without requiring the actual ASP.NET pages to be served. This meant abandoni...
41,160
<p>I am hoping to find a way to do this in vb.net: </p> <p>Say you have function call getPaint(Color). You want the call to be limited to the parameter values of (red,green,yellow). When they enter that parameter, the user is provided the available options, like how a boolean parameter functions.</p> <p>Any ideas? <...
<p>to limit a enum with a large number of values, to just a few you could do the following</p> <h2>C#</h2> <pre><code>List&lt;Color&gt; allow = new List&lt;Color&gt; { Color.Red, Color.Green, Color.Yellow }; if (!allow.Contains(color)) { throw new ArguementException("Invalid Color"); } </code></pre> <h2>VB</h2> ...
<p>Hope I am not missing something from your question. Use an enumeration like this:</p> <pre><code>Enum Color Red = 1 Green = 2 Yellow = 3 End Enum </code></pre> <p>When you write <code>getPaint(Color</code> followed by a . (period) the Intellisense system will automatically suggest the three options dec...
23,292
<p>I need a high performance framework in native C++ for SQL. I need it to be able to use MySQL, Oracle and Microsoft SQL Server and provide abstraction from the lower level problems/idiosyncrasies found in every different syntax required for by DBMS from different vendors. Something like LINQ for C# and VB .Net.</p>
<p>I believe that Qt has at least some of what you're looking for</p>
<p>Personally, I like the <a href="http://dtemplatelib.sourceforge.net/" rel="nofollow noreferrer">database template library</a>.</p>
47,001
<p>Why does the code below return true only for a = 1?</p> <pre><code>main(){ int a = 10; if (true == a) cout&lt;&lt;"Why am I not getting executed"; } </code></pre>
<p>When a Bool true is converted to an int, it's always converted to 1. Your code is thus, equivalent to:</p> <pre><code>main(){ int a = 10; if (1 == a) cout&lt;&lt;"y i am not getting executed"; } </code></pre> <p>This is part of the <a href="http://www.bond.id.au/~gnb/wp/cd2/conv.html" rel="noreferre...
<p>I wouldn't expect that code to be defined and you shouldn't depend on whatever behavior your compiler is giving you. Probably the true is being converted to an int (1), and a is not being converted to a bool (true) as you expect. Better to write what you mean (a != 0) then to depend on this (even if it turns out t...
17,884
<p>Every time a user posts something containing <code>&lt;</code> or <code>&gt;</code> in a page in my web application, I get this exception thrown.</p> <p>I don't want to go into the discussion about the smartness of throwing an exception or crashing an entire web application because somebody entered a character in a...
<p>I think you are attacking it from the wrong angle by trying to encode all posted data.</p> <p>Note that a &quot;<code>&lt;</code>&quot; could also come from other outside sources, like a database field, a configuration, a file, a feed and so on.</p> <p>Furthermore, &quot;<code>&lt;</code>&quot; is not inherently dan...
<p>Try with </p> <blockquote> <p><code>Server.Encode</code></p> </blockquote> <p>and </p> <blockquote> <p><code>Server.HtmlDecode</code> while sending and receiving.</p> </blockquote>
10,770
<p>I'd like to know how to convert Perforce depot locations to client view locations for the purpose of script writing.</p> <p>I have a script that first checks out a file for edit in perforce and then interacts with the file. I need to have the depot location (i.e. \Projects\Project6) converted to the client view l...
<p>I have always used the <strong>p4 where</strong> command for this. Here is its description from the built-in help:</p> <blockquote> <pre><code>where -- Show how file names map through the client view p4 where [ file ... ] Where shows how the named files map through the client view. For each argument, thre...
<p>Check out the <code>p4 have</code> command. You give it <em>either</em> a depot location <em>or</em> a client filename and it gives you the depot location, client filename, <em>and</em> what version of that file you have.</p>
38,559
<p>I'm building a jar of my current application, which required several JVM arguments to be set.</p> <p>Is there a way of setting these JVM arguments in a file rather than on the command line?</p> <p>I've done some hunting and it looks like I might be able to do something witha java.properties file, possibly by setti...
<p>You could of course write a batch script to execute the JVM. The batch script could look into the file and call with the appropriate parameters. This would be OS dependent though.</p>
<p>If you are using a jar file you can setup a manifest file and supply some information (main class etc) in that file.</p> <p>You can also reference other jar files to be used by your main jar file. E.g. thirdparty jars that you don't want to include in <em>your</em> company jar file.</p> <p>Aside from that the othe...
41,557
<p>I am wondering what is the "best practice" to break long strings in C# source code. Is this string </p> <pre><code>"string1"+ "string2"+ "string3" </code></pre> <p>concatenated during compiling or in run time?</p>
<p>It's done at compile time. That's exactly equivalent to "string1string2string3".</p> <p>Suppose you have:</p> <pre><code>string x = "string1string2string3" string y = "string1" + "string2" + "string3" </code></pre> <p>The compiler will perform appropriate interning such that x and y refer to the same objects.</p>...
<p>StringBuilder will be your fastest approach if you are using any amount of strings.</p> <p><a href="http://dotnetperls.com/Content/StringBuilder-1.aspx" rel="nofollow noreferrer">http://dotnetperls.com/Content/StringBuilder-1.aspx</a></p> <p>If you are just doing a few string (5 or less is a good rule) the speed w...
35,940
<p>I need to create a DHTML menu with the specified features, but I can't figure out how to do it. Here's what I need:</p> <p>All items are layed out horizontally. If they would be wider than the screen, two little arrows appear on the right side of the menu that allow to scroll it. Something like this:</p> <pre><cod...
<p>Try the CSS below:</p> <pre><code>#menu { display: table; } #menu a { display:table-cell; vertical-align:middle; } </code></pre> <p>And then format your menu like:</p> <pre><code>&lt;div id="menu"&gt; &lt;a href="#"&gt;normal text&lt;/a&gt; &lt;a href="#"&gt;&lt;big&gt;large text&lt;/big&gt...
<p>clickable anywhere is easy: you can either bind the onclick event trigger (and hopefully some cursor styling) to the atomic cell element, or you can make the atomic cell elements &lt;a&gt; tags (or more likely wrap these in &lt;li&gt;) and link and style appropriately (padding, margin, foo).</p> <p>e.g. case 1:</p>...
45,958
<p>Has anyone written, or know of a library, that generates fairly accurate looking Western European style names? i.e. John, Susan, Smith, Julien, April, etc., etc... </p>
<p>Not sure if this will work but check <a href="http://www.fakenamegenerator.com/" rel="noreferrer">FakeNameGenerator</a> it will generate names and some information as well. One at a time or in batch.</p>
<p>why not just grab a list of names and choose one randomly from the list? I'm doubtful that there'd be a particular way to 'generate' realistic names.</p> <p><a href="http://www.ssa.gov/OACT/babynames/" rel="nofollow noreferrer">http://www.ssa.gov/OACT/babynames/</a></p> <p>You <em>could</em> try using this list to...
34,530
<p>IBM Rational Application Developer is very slow and has many problems.</p> <p>I tried to use ant scripts to build EAR/WAR files for Websphere Application Server but it did not work.</p>
<p>If Ant can't find the WAS tasks, then it is likely that the WAS API's are missing from the Ant classpath.</p> <p>See <a href="https://stackoverflow.com/questions/4046/can-someone-give-me-a-working-example-of-a-buildxml-for-an-ear-that-deploys-in">this question</a> for other sample scripts and suggestions.</p>
<p>My understanding is that you build the EAR/WAR, then open your browser, login to the admin console, then deploy your application.</p> <p>If my understanding is correct, just add an instance of the WAS server to your workspace, and then right click on the server, select Add/Remove Projects and add your project. This...
38,220
<p>I want to build a lightweight linux configuration to use for development. The first idea is to use it inside a Virtual Machine under Windows, or old Laptops with 1Gb RAM top. Maybe even a distributable environment for developers.</p> <p>So the whole idea is to use a LAMP server, Java Application Server (Tomcat or J...
<p>My 2c:</p> <p>I'd recommend basing your system on <a href="http://www.debian.org/" rel="nofollow noreferrer">Debian</a> - the <a href="http://wiki.debian.org/Apt" rel="nofollow noreferrer">apt</a> system has become the de-facto way to quickly install and update programs on Linux. <a href="http://www.ubuntu.com/" re...
<p>I suggest you should checkout the following three distros:</p> <ul> <li><p><a href="http://www.damnsmalllinux.org/" rel="nofollow noreferrer">Damn Small Linux</a> - Very lightweight. Includes its own lightweight browser (Dillo), but you can install Firefox easily. The entire distro fits on a 50MB LiveCD.</p></li> <...
5,808
<p>Microsoft SQL Server has a nice feature, which allows a database to be automatically expanded when it becomes full. In MySQL, I understand that a database is, in fact, a directory with a bunch of files corresponding to various objects. Does it mean that a concept of database size is not applicable and a MySQL databa...
<p>It depends on the engine you're using. A list of the ones that come with MySQL can be found <a href="http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html" rel="nofollow noreferrer">here</a>.</p> <p>MyISAM tables have a file per table. This file can grow to your file system's limit. As a table gets larger, yo...
<p>what you describe is roughly true for MyISAM tables. for InnoDB tables the picture is different, and more similar to what other DBMSs do: one (or a few) big file with complex internal structure for the whole server. to optimize it, you can use a whole disk (or partition) as a file. (at least in unix-like systems, ...
41,514
<p>I currently use AnkhSVN to integrate subversion into Visual Studio. Is there any reason I should switch to VisualSVN?</p> <p>AnkhSVN is free (in more than one sense of the word) while VisualSVN costs $50. So right there unless I'm missing some great feature of VisualSVN I don't see any reason to switch.</p>
<p>I used VisualSVN until Ankh hit 2.0, and ever since, I've abandoned VisualSVN. Ankh has surpassed VisualSVN in functionality, in my mind, and all the 1.x perf and integration issues are gone.</p>
<p>The main thing is that VisualSVN uses TortoiseSVN for nearly all of its UI. So you only really have to set up one client (preferred diff viewer, etc), and you can take advantage of things like the same "Previous messages" button on the Commit dialog, whether you're committing from Explorer or Visual Studio.</p>
4,383
<p>Are there any good, free (or at least reasonably cheap) profilers for at least native C++ that can integrate with Visual Studio 2008 Professional?</p> <p>I looked at <a href="http://www.compuware.com/products/devpartner/profiler/default.asp?cid=701000000004ej0AAA&amp;focus=&amp;productfocus=&amp;source=Web+-+Eval...
<p>At my workplace we use <a href="http://www.automatedqa.com/products/aqtime/" rel="nofollow noreferrer">AQTime</a>. It's not free ($600 or 30-day trial) but it really works wonders. I like it because it can handle both native (we do C++) and managed code. It works in stand-alone mode, integrates with Visual Studio, a...
<p>Intel's VTune or AMD's CodeAnalyst are both free, I believe.</p>
37,316
<p>I'm not too sure what is going on here, but sometimes a particular file in my repository will change the case of its name. e.g.,:</p> <p>before: <code>File.h</code></p> <p>after: <code>file.h</code></p> <p>I don't really care why this is happening, but this causes git to think it is a new file, and then I have to go...
<p>Since version 1.5.6 there is an <code>ignorecase</code> option available in the <code>[core]</code> section of <code>.git/config</code></p> <p>e.g. add <code>ignorecase = true</code></p> <p>To change it for just one repo, from that folder run:</p> <pre><code>git config core.ignorecase true </code></pre> <p>To ch...
<ol> <li>From the console: git config core.ignorecase true</li> <li>Change file name capitalisation</li> <li>Commit</li> <li>From the console: git config core.ignorecase false</li> </ol> <p>Step 4 fixed problems checking out branches with a different capitalisation.</p>
7,629
<p>Coming from a Perl 5 background, what are the advantages of moving to Perl 6 or Python?</p>
<p>There is no advantage to be gained by switching from Perl to Python. There is also no advantage to be gained by switching from Python to Perl. They are both equally capable. Choose your tools based on what you know and the problem you are trying to solve rather than on some sort of notion that one is somehow inheren...
<p>You have not said why you want to move away from Perl*. If my crystal ball is functioning today then it is because you do not fully know the language and so it frustrates you.</p> <p>Stick with Perl and study the language well. If you do then one day you will be a guru and know why your question is irrelevant. Enli...
15,156
<p>How do I convert a keycode to a keychar in .NET?</p>
<p>In VB.NET:</p> <pre><code>ChrW(70) </code></pre> <p>In C# you can cast:</p> <pre><code>(char) 70 </code></pre>
<p>String.fromCharCode(event.keyCode)</p>
30,570
<p>I have the following in my web.config:</p> <pre><code>&lt;location path="RestrictedPage.aspx"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow roles="Group1Admin, Group3Admin, Group7Admin"/&gt; &lt;deny users="*"/&gt; &lt;/authorization&gt; &lt;/system.web&gt; &...
<pre><code>// set the configuration path to your config file string configPath = "??"; Configuration config = WebConfigurationManager.OpenWebConfiguration(configPath); // Get the object related to the &lt;identity&gt; section. AuthorizationSection section = (AuthorizationSection)config.GetSection("system.web/authoriz...
<pre><code>if {User.IsInRole("Group1Admin"){//do stuff} </code></pre> <p>Is that what your asking?</p>
26,279
<p>I'm looking for ideas/elements of a user interface for a device I'm making. <a href="http://mypic32.com/web/guest/contestantsprofiles?profileID=50331" rel="nofollow noreferrer">Full description (and video of development setup) here.</a></p> <p>In short:</p> <ul> <li>It's essentially a direction finder, so I'm sta...
<p>You're summary page indicates that you're getting GPS coordinates from two devices... so a nice feature for children would be to show a dot for mom and a dot at display center for the child. Draw a line between these. Draw an arrow showing the child's most recent direction of travel to GPS resolution.</p> <p>Tell...
<p>I think it would be really cool to have it shaped like a Pokemon. I'm just saying...</p>
24,718
<p>Does anyone have settings for Visual Studio, in XML or a .vssettings-file, that is compatible with <a href="http://code.msdn.microsoft.com/sourceanalysis" rel="nofollow noreferrer">StyleCop</a>?</p> <p>I've used the book <a href="https://rads.stackoverflow.com/amzn/click/com/0321545613" rel="nofollow noreferrer" re...
<p><a href="http://www.codeplex.com/StyleCopForReSharper" rel="nofollow noreferrer">StyleCop for ReSharper</a> would certainly help:</p> <p>StyleCop for ReSharper is now feature complete in that is has reached feature parity with StyleCop 4.3.</p> <p>There are 148 StyleCop rules.</p> <ul> <li>38 of these must be fix...
<p>It costs money, but someone made a <a href="http://www.codeplex.com/StyleCopForReSharper" rel="nofollow noreferrer">ReSharper plugin for StyleCop</a>. Thanks for posting the question, I'd never heard of StyleCop before.</p>
42,124
<p>I'm writing some xlst file which I want to use under linux and Windows. In this file I use node-set function which declared in different namespaces for MSXML and xsltproc ("urn:schemas-microsoft-com:xslt" and "<a href="http://exslt.org/common" rel="nofollow noreferrer">http://exslt.org/common</a>" respectively). Is...
<p>You can use the function function-available() to determine which function you should use:</p> <pre><code>&lt;xsl:choose&gt; &lt;xsl:when test="function-available('exslt:node-set')"&gt; &lt;xsl:apply-templates select="exslt:node-set($nodelist)" /&gt; &lt;/xsl:when&gt; &lt;xsl:when test="function-available(...
<p>If there is not a particular reason to use msxml implementation of node-set on windows you coul use exslt one everywhere, by including the implemenation downloaded from <a href="http://exslt.org" rel="nofollow noreferrer">http://exslt.org</a> with your stylesheet, <a href="http://exslt.org/howto.html" rel="nofollow ...
11,759
<p>I am trying to cobble together a scene that basically consists of:</p> <ol> <li>A 2D image of the earth (think NASA satellite photography) that has been rotated into a view similar to <a href="http://flickr.com/photos/walterra/2631170956/in/photostream/" rel="nofollow noreferrer">this</a> and,</li> <li>Cylindrical ...
<p>This tutorial explains how to use quadratics to save time drawing objects in GL, there is an example of a cylinder closer to the bottom. This site is also a great learning resource for OpenGL overall. Although it uses C you can see the functions used and implement them as desired.</p> <p><a href="http://nehe.gamede...
<p>Thanks for the answers.</p> <p>I have read the nehe tutorials, they are quite good. In fact, they are translated to python in the demos included in PyOpenGL. I guess my problem is more to do with setting attributes of the cylinder after I draw it, I should have been more specific, sorry. I am probably missing so...
40,398
<p>I've got a request from a customer to automatically detect the type of mobile device (not the browser, the type. ex: Moto Q, Blackjack II, etc.) and automatically select the device from a drop down with a list of supported devices.</p> <p>So far I've found that the HTTP Headers (submitted by mobile IE) contain info...
<p>What exactly does the customer mean by "supported". Surely it means that the phone in question supports the web application and it's inner functionality - wouldn't it be better then to forget device detection and simply focus on detecting those capabilities required for the app to function properly? For example, if ...
<p>Another fast and easy solution is Apache Mobile Filter: <a href="http://www.apachemobilefilter.org" rel="nofollow noreferrer">http://www.apachemobilefilter.org</a></p>
19,147
<p>I've heard a lot about profiling. What is this all about? As far as I understand this is some kind of performance measurement but can someone elaborate this on more clearly so that a newbie can grasp the idea. Also, I use Eclipse IDE for my Java program. Can I profile my program using Eclipse IDE? What are the facto...
<p>Profiling basically shows you how often a given line of code is executed and how much time was spent in it (compared to other lines). This makes it easy to pinpoint the location where your code spends most of the time.</p> <p>It also makes it possible to find places where your code spends much time without doing an...
<p>From what little research I've done on Java profiling with Eclipse, you can use <a href="http://www.ej-technologies.com/products/jprofiler/java-profiler-IDE.html" rel="nofollow noreferrer">JProfiler</a>. I never really got much further than installing it and having a quick nose around though.</p>
35,776
<p>I can use VS08's MFC/ActiveX template to create a C++ ActiveX object that I can load into a HTML page and script with Javascript. But I can't figure out how to create an interface that allows me to call custom methods on my component with Javascript.</p> <p>Could you please tell me how to accomplish that? I have sp...
<p>I'm not extremely familiar with the MFC ActiveX wrapper, but I can answer the question in the general sense:</p> <p>A COM object with an interface which is derived from IDispatch can be called through automation languages (eg: Javascript). The methods must also be "automation-compatible", which means that the param...
<p>If you're using the VS08 MFC ActiveX template, you might see a snippet like this in your control's .h file (within the class declaration, it's protected):</p> <pre><code>afx_msg void AboutBox(); DECLARE_DISPATCH_MAP() </code></pre> <p>And one like this in the .cpp file:</p> <pre><code>// Dispatch map BEGIN_DISP...
34,020
<p>The deceptively simple foundation of dynamic code generation within a C/C++ framework has already been covered in <a href="https://stackoverflow.com/questions/45408/">another question</a>. Are there any gentle introductions into topic with code examples? </p> <p>My eyes are starting to bleed staring at highly intr...
<p>Well a pattern I've used in emulators goes something like this:</p> <pre><code>typedef void (*code_ptr)(); unsigned long instruction_pointer = entry_point; std::map&lt;unsigned long, code_ptr&gt; code_map; void execute_block() { code_ptr f; std::map&lt;unsigned long, void *&gt;::iterator it = code_map.fin...
<p>Get yourself a copy of Joel Pobar's book on Rotor (when it's out), and delve through the source to the <a href="http://research.microsoft.com/sscli/" rel="nofollow noreferrer">SSCLI</a>. Beware, insanity lies within :)</p>
29,948
<p>I would like a code sample for a function that takes a tDateTime and an integer as input and sets the system time using setlocaltime after advancing that tDateTime by (int) months. The time should stay the same.</p> <p>pseudo code example</p> <pre><code>SetNewTime(NOW,2); </code></pre> <p>The issues I'm running i...
<p>Below is a complete command-line program that works for me. Tested in Delphi 5 and 2007. Why do you say <a href="http://www.delphibasics.co.uk/RTL.asp?Name=IncMonth" rel="nofollow noreferrer">IncMonth</a> does not work for TDateTime?</p> <pre><code>program OneMonth; {$APPTYPE CONSOLE} uses SysUtils, Windows...
<p>There isn't enough information to provide a definitive answer to your question. </p> <p>Consider what you would want to happen if the day of the current month doesn't exist in your future month. Say, January 31 + 1 month. (7 months of the year have 31 days and the rest have fewer.) You have the same problem if yo...
21,716
<p>I would like to do the same thing I do in Java with the <code>final</code> keyword. I tried to use the <code>const</code> keyword, but it doesn't work. How can I prevent other classes from inheriting from my class?</p>
<p>The keyword you are searching is "sealed".</p> <p><a href="http://msdn.microsoft.com/en-us/library/88c54tsw.aspx" rel="nofollow noreferrer">MSDN</a></p>
<p>In general you should mark your type with sealed keyword in case you want prevent derivation. However is some cases it is not appropriate. For example, you want to allow types from your assembly to derive from your publicly accessible type but prevent third parties from derivation.</p> <p>Here few tricks which allo...
47,523
<p>I have a large classic ASP app that I have to maintain, and I repeatedly find myself thwarted by the lack of short-circuit evaluation capability. E.g., VBScript won't let you get away with:</p> <pre><code>if not isNull(Rs("myField")) and Rs("myField") &lt;&gt; 0 then ... </code></pre> <p>...because if Rs("myField...
<p>Maybe not the best way, but it certainly works... Also, if you are in vb6 or .net, you can have different methods that cast to proper type too.</p> <pre><code>if cint( getVal( rs("blah"), "" ) )&lt;&gt; 0 then 'do something end if function getVal( v, replacementVal ) if v is nothing then getVal = replacem...
<p>Would that there were, my friend -- TernaryOp is your only hope. </p>
8,423
<ul> <li>Do you need to use some kind of provider? </li> <li>Can you setup your own SMS server?</li> <li>Does any open source solutions exist?</li> </ul> <p>I am an SMS newbie so any insight on how this is accomplished would be great. I am partial to Java but any language is fine.</p>
<p>This is easy. Yes, you need a "sms gateway" provider. There are a lot out there. These companies provide APIs for you to send/receive SMS.</p> <p>e.g. the German company <a href="http://mobilant.de/" rel="noreferrer">Mobilant</a> provides an easy API. If you want to receive a SMS just program a simple PHP / JSP / s...
<p>You actually don't need an SMS gateway; nearly every cell phone can send/receive SMS messages to/from any email address. I built an SMS service (<a href="http://www.txtreg.net" rel="nofollow noreferrer">http://www.txtreg.net</a>) using <a href="http://www.nearlyfreespeech.net" rel="nofollow noreferrer">Nearly Free S...
10,983
<p>I'm looking for design\architectual guidance for modern text editors.</p> <p><em>Modern</em> text editor means that: </p> <ul> <li>It has support for syntax highlighting</li> <li>It has auto-completion (something like IntelliSense)</li> <li>It has advanced navigation capabilities (incremental search, etc.)</li> <...
<p>The ultimate text editor is, of course, emacs. I found <a href="http://www.finseth.com/craft/" rel="noreferrer">The Craft of Text Editing, or, Emacs for the Modern World </a> to be an excellent self-study guide for the basics of writing an editor. The examples are all in plain old C, and the text might look a bit da...
<p>Have you looked at vim? It supports autocompletion, syntax highlighting, incremental search, integrated building, etc, etc. It is modular and many of its more advanced features are implemented as plugins that either ship with it or can be found separately (e.g., svn integration, code indexing with cscope/ctags, tran...
8,309
<p>I'm puzzling over how to map a set of sequences to consecutive integers.</p> <p>All the sequences follow this rule:</p> <pre><code>A_0 = 1 A_n &gt;= 1 A_n &lt;= max(A_0 .. A_n-1) + 1 </code></pre> <p>I'm looking for a solution that will be able to, given such a sequence, compute a integer for doing a lookup into ...
<p>There is a natural sequence indexing, but no so easy to calculate.</p> <p>Let look for A_n for n>0, since A_0 = 1.</p> <p>Indexing is done in 2 steps. </p> <h2>Part 1:</h2> <p>Group sequences by places where A_n = max(A_0 .. A_n-1) + 1. Call these places <em>steps</em>.</p> <ul> <li>On steps are consecutive num...
<p>This is a python function which can do the job for you assuming you got these values stored in a file and you pass the lines to the function</p> <pre><code>def valid_lines(lines): for line in lines: line = line.split(",") if line[0] == 1 and line[-1] and line[-1] &lt;= max(line)+1: y...
48,248
<p>I have generated a few 3D prints in G-code using KISSlicer and Slic3r, but when I load them into Ultimaker Cura I'm unable to get anything. The number of layers says one but I cannot see anything and print option is not working. I have viewed these G-codes online and they are fine. I'm using a Lulzbot KITTAZ with v2...
<p>Cura prior to version 2.5 does not take G-code as an input. I'm not sure what you mean by "print only using Cura." Don't you have a SD slot on your control board? For that matter, why can't you drive the USB port from Slic3r? </p> <p>Remember: G-code is the equivalent of "compiled code," the raw commands which dri...
<p>Cura prior to version 2.5 does not take G-code as an input. I'm not sure what you mean by "print only using Cura." Don't you have a SD slot on your control board? For that matter, why can't you drive the USB port from Slic3r? </p> <p>Remember: G-code is the equivalent of "compiled code," the raw commands which dri...
448
<p>I'm working on a site now that have to fetch users feeds. But how can I best optimize fetching if I have a database with, lets say, 300 feeds. I'm going to set up a cron-job to which fetches the feeds, but should I do it like 5 every second minute or something? </p> <p>Any ideas on how to do this the best way in PH...
<p>Based on the new information I think I would do something like this:</p> <p>Let the "first" client initiate the updatework and store timestamp with it. Everey other clients that will ask for the information get a cashed information until that information are to old. Next hit from a client will then refresh the cash...
<p>The best thing to do is to be 'nice' and not overload the feeds with lots of needless requests. I settled on a 1 hour update time for one of my webapps that monitors about 150 blogs for updates. I store the time they were last checked in the database and use that to decide when to update them. The feeds were added a...
43,161
<p>I remember first learning about vectors in the STL and after some time, I wanted to use a vector of bools for one of my projects. After seeing some strange behavior and doing some research, I learned that <a href="http://www.informit.com/guides/content.aspx?g=cplusplus&amp;seqNum=98" rel="noreferrer">a vector of boo...
<p>A short list might be:</p> <ul> <li>Avoid memory leaks through use shared pointers to manage memory allocation and cleanup</li> <li>Use the <a href="https://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization" rel="noreferrer">Resource Acquisition Is Initialization</a> (RAII) idiom to manage resource clean...
<pre><code>#include &lt;boost/shared_ptr.hpp&gt; class A { public: void nuke() { boost::shared_ptr&lt;A&gt; (this); } }; int main(int argc, char** argv) { A a; a.nuke(); return(0); } </code></pre>
5,029
<p>PHP, for all its warts, is pretty good on this count. There's no difference between an array and a hash (maybe I'm naive, but this seems obviously right to me), and to iterate through either you just do</p> <pre><code>foreach (array/hash as $key =&gt; $value) </code></pre> <p>In Ruby there are a bunch of ways to d...
<p>This will iterate through all the elements:</p> <pre class="lang-rb prettyprint-override"><code>array = [1, 2, 3, 4, 5, 6] array.each { |x| puts x } # Output: 1 2 3 4 5 6 </code></pre> <p>This will iterate through all the elements giving you the value and the index:</p> <pre class="lang-rb prettyprint-override"><c...
<p>If you use the <a href="http://www.ruby-doc.org/core/classes/Enumerable.html" rel="nofollow noreferrer">enumerable</a> mixin (as Rails does) you can do something similar to the php snippet listed. Just use the each_slice method and flatten the hash.</p> <pre><code>require 'enumerator' ['a',1,'b',2].to_a.flatten.e...
40,026
<p>I have a backup script that runs in the background daily on my linux (Fedora 9) computer. If the computer is shut down while the backup is in progress the backup may be damaged so I would like to write a small script that temporarily disables the ability of the user to reboot or shut the computer down. </p> <p>It i...
<p>Another get-you-started solution: During shutdown, the system runs the scripts in /etc/init.d/ (or really, a script in /etc/rc.*/, but you get the idea.) You could create a script in that directory that checks the status of your backup, and delays shuts down until the backup completes. Or better yet, it graceful...
<blockquote> <p>But a script that would remind me (or another user) that the backup is still running when I choose shut down from the Gnome/GDM menus </p> </blockquote> <p>One may use polkit to completely block shutdown/restart - but I failed to find method that would provide a clear response why it is blocked.</p> ...
41,716
<p>I need to use sed to convert all occurences of <code>##XXX##</code> to <code>${XXX}</code>. X could be any alphabetic character or '_'. I know that I need to use something like:</p> <pre><code>'s/##/\${/g' </code></pre> <p>But of course that won't work properly, as it will convert <code>##FOO##</code> to <code>${FOO...
<p>Here's a shot at a better replacement regex:</p> <pre><code>'s/##\([a-zA-Z_]\+\)##/${\1}/g' </code></pre> <p>Or if you assume exactly three characters :</p> <pre><code>'s/##\([a-zA-Z_]\{3\}\)##/${\1}/g' </code></pre>
<pre class="lang-none prettyprint-override"><code>sed 's/\([^a-z]*[^A-Z]*[^0-9]*\)/(&amp;)/pg </code></pre>
29,063
<p>I am using UIActivityIndicatorView to showing user that there is something going on, let them wait. But UIActivityIndicatorView looks small, do not have background color, and not very obvious to the user. While in iPhone SDK's UIImagePickerController, it uses the similar mechanism, but with the black background as w...
<p>If you just want a different background color of your UIActivityIndictatorView, you could just send the setBackgroundColor message to the object, i.e.:</p> <pre><code>[activityIndicator setBackgroundColor:[UIColor blackColor]]; </code></pre> <p>By the way, you can change the size of the indicator as well. just do ...
<p>Seems I still have to create a separate view, because the indicator will be automatically enlarged if I enlarge the frame.</p> <p>Thanks.</p>
35,862
<p>Are there any pre-written component-like Silverlight web widgets like there are for Flash? </p> <p>Flash examples:<br> <a href="http://musicplayer.sourceforge.net/" rel="nofollow noreferrer">XSPF Web Music Player</a><br> <a href="http://wpaudioplayer.com/" rel="nofollow noreferrer">WordPress Audio Player</a><br> <...
<p>I am aware of two ways to do it. The fancy way is to write a windows shell extension, which is how powerarchiver, winzip etc do it I believe (this involves running code to determine what the context menu items will be dependent on the file chosen).</p> <p>The simple way, for simple functionality, is you can add an ...
<p>You could also package the java program in an installer like NSIS and you could use NSIS script to generate explorer context menu</p>
48,346
<p>In an OLAP database I work with there is a 'Location' hierarchy consisting of the levels Company -> Region -> Area -> Site -> Room. I am using the following MDX to get all the descendants of a particular member at company level.</p> <pre><code>DESCENDANTS([Location].[Test Company],[Location].[Site], SELF_AND_BEFORE...
<p>The EXCEPT function will take a set, and remove the members you dont want. In your case you need to say:</p> <pre><code>EXCEPT( {DESCENDANTS([Location].[Test Company],[Location].[Site], SELF_AND_BEFORE)}, {DESCENDANTS([Location].[Whatever].[Redundant],[Location].[Site], SELF_AND_BEFORE)} ) </code></pre> <p>This gi...
<p>When returning members for your hierarchy simply use "-" to exclude a member you don't want. This is how I exclude unknown members:</p> <pre><code>select {[Module].[Hierarchy].[Module].Members - [Module].[Hierarchy].[Module].[Unknown]} on rows, {[Date].[Month-day].[Day Of Month].Members - [Date].[Month-day].[Day O...
17,938
<p>How do I uninstall a Windows Service when there is no executable for it left on the system? I can not run <code>installutil -u</code> since there is not executable left on the system. I can still see an entry for the service in the Services console. </p> <p>The reason for this state is probably because of a problem...
<p>You should be able to uninstall it using sc.exe (I think it is included in the Windows Resource Kit) by running the following in an "administrator" command prompt:</p> <pre><code>sc.exe delete &lt;service name&gt; </code></pre> <p>where <code>&lt;service name&gt;</code> is the name of the service itself as you see...
<p>Create a copy of executables of same service and paste it on the same path of the existing service and then uninstall.</p>
42,852
<p>I know there is re-sharper for Visual Studio, but is there a really good refactoring tool for Eclipse that is better than the small amount of built in refactors?</p> <p>Preferably something free.</p> <p>(Update)</p> <p>Looking to do things like take all string literals in a file and make them constants.<br> Solve...
<p>This does not really answer your question but I can't properly format this into a comment.</p> <p>Here is a nice way to extract Strings into constant in eclipse. (I didn't know about the pick out string until a couple of weeks ago)</p> <p>We have this line:</p> <pre><code>System.out.println("This Line Contains a ...
<p>Some plugins like Checkstyle plug into the quick fix framework and do allow mass fixes at once. But what you're looking for should plug into the existing refactoring framework, not replace it.</p>
49,717
<p>I need to match a string holiding html using a regex to pull out all the nested spans, I assume I assume there is a way to do this using a regex but have had no success all morning. </p> <p>So for a sample input string of </p> <pre><code>&lt;DIV id=c445c9c2-a02e-4cec-b254-c134adfa4192 style="BORDER-RIGHT: #000000 ...
<p>Once again <a href="http://www.developer.com/net/csharp/article.php/2230091" rel="nofollow noreferrer">use an HTML parser</a> to walk the DOM: regexs will never be robust enough to do this.</p>
<p>Basically, I agree with the above advices, using regexes for parsing HTML is asking for having code breaking some day on strange legal HTML constructs (not to mention malformed HTML that browsers accept...). Finding and using a good HTML parser can be rewarding in many ways...</p> <p>Now, I am pragmatic (and I can'...
45,879
<p>I am attempting to create a Clipboard stack in C#. Clipboard data is stored in <code>System.Windows.Forms.DataObject</code> objects. I wanted to store each clipboard entry (<code>IDataObject</code>) directly in a Generic list. Due to the way Bitmaps (seem to be) stored I am thinking I need to perform a deep copy fi...
<p>I wrote the code below for another question and maybe it could come in useful for you in this scenario:</p> <pre><code> public static class GhettoSerializer { // you could make this a factory method if your type // has a constructor that appeals to you (i.e. default // pa...
<p>Look up the docks for Serializable and find the stuff about serialization helpers. You can wrap the bitmap in your own serialization code the integrates with the .net framework. </p>
24,676