tips-and-tricks

Small tools/scripts that help you so much?

On top of my head, especially for C/Linux developer: ack git-bz colorgcc colordiff moap and prepare-ChangeLog Is there some tool/script you couldn't work without, but that you feel others don't know so much? For instance, I just found: cppcheck ...

Cool way to call methods on multiple objects in Ruby?

A long time ago I saw this trick in Ruby. Instead of doing (for example) if array1.empty? and array2.empty? and array3.empty? You could call all of the objects at once and append the operation at the end, kind of like if %w(array1 array2 array3).each { |a| a.empty? } But I think it was simpler than that... or, it could be that. I r...

Getting back on track after disruptions

Over the past few weeks it seems like I've been interrupted by maintenance tasks from old projects quite a bit in addition to a taking a training class. I feel like I've lost all forward momentum on my current project. It's difficult to even start coding because I'm not sure what I was doing and what I was thinking before the interrup...

Eclipse + PDT performance tips?

I recently wanted to get a decend IDE for my PHP side-projecs, and by searching SO found Eclipse+PDT. Although it's not quite at the level of Visual Studio yet, it's pretty nice and better than Notepad++ for this purpose. I can even debug somewhat, although it's pretty glitchy. But there is one thing that is bugging me. It seems to have...

Adding xml comments to methods, properties, etc quickly in vs 2008

Hello, Assume I have 10 Methods and 10 Properties. Is there a way to add the xml comments (///) to all 10 Methods and 10 Properties at once in VS 2008 or do I have to type /// for each one. ...

What would be the best programming guideline/tip

What would be the best programming guideline/tip to follow to become a better programmer? My favorite one is from the book The Pragmatic Programmer: From Journeyman to Master Don't Live with Broken Windows Their case is: One broken window, left unrepaired for any substantial length of time, instills in the inhabitants of the buil...

How do I create an empty solution in Visual Studio (2008)?

I am unable to create an empty solution in Visual Studio. The msdn documentation says this is possible but fails to mention how. (Where I have looked, anyway..) ...

Convert an array into an index hash in Ruby

Let's say I have an array, and I want to make a hash so I can quickly ask "is X in the array?". In perl, there is an easy (and fast) way to do this: my @array = qw( 1 2 3 ); my %hash; @hash{@array} = undef; This generates a hash that looks like: { 1 => undef, 2 => undef, 3 => undef, } The best I've come up with in Ruby ...

Is "tip-of-the-day" good?

Many programs (often large ones, like MS Office, The GIMP, Maxthon) have a feature called "tip-of-the-day". It explains a small part of the program, like this one in Maxthon: "You can hide/show the main menu bar by pressing Ctrl+F11" You can usually browse through them by clicking next. And other options provided are "Previous", "Close...

How do you keep your Windows development machine from slowing down?

After using Windows for some time, any computer can begin to suffer from "Slow Computer Syndrome", or "winrot", so I am interested to hear what you are doing to prevent this. I am not looking for these answers: Reinstalling Windows Upgrading the hardware I am, however, looking for your experience on what steps you can recommend that...

What really happens in a try { return x; } finally { x = null; } statement?

I saw this tip in another question and was wondering if someone could explain to me how on earth this works? I mean, does the finally clause really execute after the return statement? How thread-unsafe is this code? Can you think of any additional hackery that can be done w.r.t. this try-finally hack? Update 1 well, it seems as though a...

Want to sell own application. Where to start?

I developed a handy little application that can help a lot of people. I would like to sell it for a few dollars/license, but I do not have any infrastructure for hosting or big money for advertisement. What do you suggest, where should I start? EDIT: I would also like to come up with a very catchy name, I need a (preferably free) nice ...

How to manage FxCop overwhelming reports

I've recently started using it. However, after running it against one of my company's largest project. It turns up mountains of problems. The list of problems was so overwhelming it would take days to find and fix some, if not all of the stuff. Now, I know that it's not very practical to fix everything FxCop tells you to fix. But as I ...

How do you implement Related tags functionality as used in Stackoverflow.com?

Hi everybody, Good morning! Have been trying to find an answer to this. How do you implement the 'related tags' functionality as used in many websites like our stackoverflow.com and http://tagexplorer.sandbox.yahoo.com/. A user clicks on tag and he gets all the related tags connected to that. Daksh ...

Including .asp file into html file.

How can include .asp file inside of html file and have it proccessed besides having to process all html files with asp. ...

How to Leverage Clearcase's features

We use Clearcase at our office, and based on my admittedly light knowledge of clearcase, it just seems like a really bloated source control tool. I know from hearing friends talk about Clearcase that it's really powerful. My question is, what are some features of Clearcase that make it 'powerful', and what are good tips and tricks for ...

How can I dynamically update a variable in plain html files in on windows web server.

We have some old html files on the website that have copyright year on the bottom of the page (from include file). We are trying to find a way to update that dynamically to current year so the include file does not need to be edited every year. We are using asp and .net on the same server so there might be ways to use those technologies...

What's the most elegant way of commenting / uncommenting blocks of ruby code in Vim?

In VIM, at the moment when I need to comment out a section of Ruby code: I navigate to the first column in the row I want to comment out I press CTRL-v to enter visual block mode I navigate down till the place I want to end the operation I type r<space> if I want to uncomment the code or r# if I want to comment it out. This workfl...

WiX tricks and tips

We've been using WiX 3 for a while now, and despite the usual gripes about ease of use, it's going reasonably well. What I'm looking for is useful advice regarding: Setting up a WiX project (layout, references, file patterns) Integrating WiX into solutions, and build/release processes Configuring installers for new installations and up...

Using gdb, display multiple vars in one line?

Sorry in advanced gdb gurus, but how can I ask to display multiple vars in one line? So I want to get output like: 30 if(s[i] != '\0') 5: s[i] = 101 'e' 4: exp = 14 3: val = 123.45 2: sign = 1 1: i = 6 I've been typing in disp s[i] ENTER disp exp ENTER (etc, etc) and I just know there's got to be a better way to do this in one line ...