Better Task control on Windows (NT/XP/Vista)

I have been using ProcessExplorer since long before Microsoft bought out SysInternals, since long long before that too, and I have found it incredibly useful.

e.g.: checking to see if my new application has a memory leak etc..

Now I have just discovered it has an even better toy-set built into it.

If you have never tried it, download and install ProcessExplorer.
The run it.

You will get a view like task manager, but with much better granularity in the processes.

ScreenShot007

Next comes the standard view:

select View > System Information

ScreenShot008

 

Now, for the “Piece de Resistance”…

Goto Options > Replace Task Manager.

ScreenShot009

 

Now try CTRL-ALT-DELETE

Windows Task Manager has been replaced by the more powerful ProcessExplorer.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon

How to make a difficult descision - an analysis of Global Warming

I recently came across the series of videos produced by wonderingmind42 on the risk management analysis of the current gloabal warming crisis. Also available on manpollo.

He proposes a very compelling argument. And what is more, it is simple.

Also very interesting, is that his very detailed videos (there is nearly 6 hours in total) also teach the principals he is using to perform the analysis… and they are entertaining…! WOW.

He is a science teacher, but still I am impressed by the amount that can be learnt, from watching even a small fraction of his available videos.

I have long awaited someone bringing back interest and fun into important educational topics, this is a very nice example.

If you have any interest in Global Warming, or you would like to learn more about scientific principals, or you would like to undersand more about risk analysis, then I seriously suggest you have a look.

Here is the first video, covering the basics:

Then more on how science works:

And finally some on risk analysis

If you like any of this, take some time and watch more of his videos.

You will learn a lot.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon

Firefox tricks…

As a long term Windows user, but also a developer, I am a strong believer in Fitts Law. But I know it is difficult to reconcile the two design requirements of simple interface for beginners, with advanced interface for experts.

So I love to find anything that quickly merges into my standard keyboard usage and makes me more efficient and faster. Especially given the enormous increases in productivity that are available by doing this properly

I know these will seem obvious to those who know…but:

In FireFox:

  • CTRL + click on a link -> open page in a new tab
  • CTRL + TAB -> switch tab (like Alt+Tab for windows)
  • CTRL + N -> New Window
  • CTRL + T -> New Tab
  • CTRL + W -> Close Tab or Close Window

If you have any more, please add them here.
No quips about emacs etc… I already know, but clients needs dictate.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon

Scaleable unit testing and continuous integration in an agile team using GIT

I like agile development, it works, but it does need some pretty clear guide lines and rules. It also needs very good testing systems to ensure no developer breaks anyones elses code.

Up until now, I have been using the same tools as everyone else.

SVN, perforce, CVS, etc… we all know this type of source control management system.

We all know how these systems work.

I take a task, I write my unit test, I make sure it fails, then I write my code until the test passes and all other tests pass as well. Then I can commit my code.

When I commit my code, the continuous integration system kicks in, re-builds the application, runs all the units tests, and then the functional tests.

It is really cool. Especially if you have been developing for some time and remember ‘the older days’.

The ‘Old Days’ when we worked alone were much easier, but we need teams now, and we must have ways to manage and control working together.

However, about half the time, when I check in my code, I break something, and the continuous integration system bleeps loudly and displays an embarrassing photo of me.

So now I have to fix the problem. And that’s ok.

However, with any decent sized team, you now have a single point of failure.

The build server itself.

Everything merges at this point, and many regression mistakes are only discovered when the code is checked in. This means that the primary development codebase is now broken.

And this tends to happen often, every day.
A right pain if you are running a tight release cycle.
There is no way you can pass broken code to QA.

It gets even worse, when tasks are larger, the changed code coverage is large, and it has been quite a few days since it was checked out.

Now, it is possible, and good practice, to do a checkout before checking in. But how many times have I seen this forgotten in the rush to get a release ready.

So that’s the problem.

 

The solution that I have recently converted to, is GIT.

This distributed SCM, at first seems rather primitive, but on further examination, this primitive nature hides a great deal of raw power.

Distributed SCM means every developer can commit to their own repository, so they can roll-back their own code if they go in the wrong direction.

Distributed SCM also requires much better branching and merging.

It is simple to create a distributed branch for a micro-project team, each developer can now clone this branch, work locally, commit locally and then check their code back into the branch.

The micro-project team leader can now do code review, unit testing and functional testing, before committing the completed project back into the primary codebase.

So now, at any point in time, you can take a copy of the main codebase and pass it to QA for testing and release. Knowing for certain that only working code ever makes it into the this codebase.

This allows you to move to a fast release cycle. A new feature has been added. Now you can test and release knowing everything will work.

In effect, you have moved the larger scale unit/functional/regression testing further back into the development process.

What you also managed to achieve, is secure asynchronous micro-project development, so each micro-project team can now work independently while still being agile.

And all the effort ends up in a single unified codebase that works!

This is the secret to scalability in agile development.

 

The title of this little note does promise to let you in on how to integrate the unit and functional testing of continuous integration into GIT.

I love this, it is so simple.

Because GIT is so primitive, it runs scripts, that actually sit in the repository itself.

All you need to do, is edit the scripts to add your testing.

Even better, you can set it up to run pre or post any command.

e.g.: run unit tests post-commit.
e.g.: run functional testing post-merge

etc…

With a little thought, you can have an entire workflow mapped out that will only allow unit tested, function tested, regression tested and codebase merged micro-projects to be committed to the primary codebase.

As far as I can see… this is as close to the holy grail as we have ever been.

Have fun.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon

Autocomplete using tab in windows command line prompt

One of my bug-bears for years has been the lack of auto-completing in the windows CMD promt.

I have always used *nix tools like cygwin to provide this.

Now I find out that this has been built in for years….

It was simply disabled.

The fix is very easy. A Registry edit:

HKEY_CURRENT_USER/Software/Microsoft/Command Processor/CompletionChar= 9

Thats it.

This is a microsoft fix. But why did they fail to make it standard…?

FYI: here is the registry export of what it looks like when done.

=============================================

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
“CompletionChar”=dword:00000009
“DefaultColor”=dword:00000000
“EnableExtensions”=dword:00000001

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon

GIT on Windows…are they forking already?

I already have cygwin installed, with GIT.

I have just been trying the mingw32 based version of GIT.

Mostly because I wanted to see the QT based QGIT, which will work directly with the mingw32 version of GIT.

What I want to point out, is that these two versions seem slightly incompatible…

A full commit from cygwin, comes up in mingw32 as all files modified and needing commiting…. but this have been because I started things in the middle of a commit.

another point that concerns me, is that mingw32 GIT automatically converts LF to CRLF, ie: it makes things windows specific… As I develop on windows to use on linux, that is a problem.

Something is wrong if these two are unable to communicate properly, especially as they should be using the the same repository files, ie: .git folder.

I hope they get it together soon.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon

Categories vs Tags - a pointless fight?

I have been thinking about removing the category navigation system on this site and replacing it with a tag cloud.

So I obviously hit google first to find out a bit more… i.e.: is it possible.

Nice quick answer to that, yes, if you have version 2.3 or above. Cool.

But then I got into reading everyones comments about using categories or tags and how and when you should use either.

This seems ridiculous to me.

They are both navigation system.

But more importantly, categories can be implemented in tags, so categories are a subset of tags, rather than a different thing.

But more importantly, no one seems to be talking about the real power of a tag cloud… when you can drill into the information.

Navigation a non-heirarchical storage system is very different from a standard heirarchical system.

Instead of nice heirarchical menus, you must normally be able to find you document with search, or tags.

But in effect, tags are simply user defined categories. They are still heirarchical, just 1 dimensional.

Why is no-one talking about using tags to drill into information.
ie: a combination of tags to select documents.

This would truely follow the web 2.0 ethics: i.e.: organic, non-heirarchical, user generated social intelligence.

It would be easy… you click on a tag, then click on another one, each time the number of tags displayed is limited by documents that have the ones you have already selected, so you are drilling down into you information resource.

If you now had a dynamic document box showing availble documents with all the selected tags, you should be easily able to choose what you are looking for.

An added benefit, would be finding stuff that is on-topic, but you would never have thought about.

Best off all, this multi-point access system is almost identical to the way the brain works. It would be completely intuitive.

So, I am off to see if I can find anything.. otherwise, watch this space.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon

SSH Tunneling for mySQL GUI tools from Windows to a production Linux server

I thought I might add another simple tip.

When I am messing around with a wesite… I spend a lot of my time creating, editing and manipulating the databases.

Any commercial Hosting Service, worth their salt, will block port 3306 to mysql.
It is a simple and basic security measure, that must be left in place.

So I often have to use the command line tools to do all my work. This is fine for most things. But when I am editing data, it can be a real pig and slows me down.

I want to be using a GUI tool.

So how… do I use the availble GUI tools, when their communications are blocked?

Simple, I use PuTTY to create a local tunnel through the firewall to the server.

I am going to assume you already have PuTTY and are used to using it.
Otherwise my first suggestion is learn PuTTY.

 

How To do it…

putty setup1

1: Create a connection in PuTTY to your server as normal.

  • HostName, A on fig.
  • Port(22/SSH), B on fig.
  • Give it a name, C on fig.
  • Click save, D on fig.

2. Goto the Connection->SSH->Tunnels option at the bottom of options of the left. E on fig.

putty setup2

3. Make sure the local and Auto radio buttons are selected. F on Fig.

4. Enter the Source port. G on fig. This is the listener port you will connect to on your local machine. If you have mySQL running locally on 3306, then I suggest 3307. Continue incrementing the port number for each server you add.

5. Enter a destination HOSTNAME:PORT. H on Fig.This is the destination FROM the remote server, so if you are SSHing directly into the mySQL server, the hostname needs to be localhost:3306 or 127.0.0.1:3306.

6. Click Add. I on Fig.

putty setup3

7. Check that your tunnel is now shown in the list box. J on fig. The info displayed should show “L3307″ which is localhost port 3307, and localhost:3306, which is the destination host & port.

7. Remember to save your setting before you open your connection. D on Fig.

8. Start you PuTTY connection, (Open, K on Fig) and log in as normal…

9. Now Start the mySQL GUI, I am using the MySQLQueryBrowser.

putty mysql setup4

 

10. Enter the Server Host. L on fig. This should be localhost , as we are connecting to putty.

11. Enter the Port. M on fig. This is our local putty listening port, in this case 3307 .

12. Enter your MySQL Username and Password. N & O on fig.

13. Click OK. P on fig.

That’s it…

You should now be connected to MySQL.

Finally

Set up a batch file to create the PuTTY connection.

Put this in a batch file. Obviously change the location to point to your install of Putty.

c:\some\dir\with\putty\in\it\putty.exe -load mysqltunnel

You can then of course, create a keyboard shortcut to the batch file.

 

Errors

If you get a user not allowed error, then you need to check how you log in to mysql using the command line on the server. This will affect your tunneling setting.

putty mysql setup5

If you get a Can’t Connect error, you have forgotten to start the putty session first…

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon

Getting KCacheGrind for xDebug on Windows with KDE

As I am playing around with xDebug, I need a profile file GUI. I tried WinCacheGrind, but as it is two years out of date, I wished to try KCacheGrind as well.

So, how do you install a Linux KDE application on windowsXP?

As it turns out, quite easily.

Here’s how…

1. download the installer to C:\KDE4 from here:
http://download.cegit.de/kde-windows/installer/

2. Run the installer
2.1 Choose you packages, I choose all of them.
(NOTE: KCacheGrind needs Kdesdk package)

3. Add “C:\KDE4\lib” to the %PATH%
3.1. Start > Control Panel > System > Advanced > Environment Variables, Select PATH, click [edit]..

4. Create env variable KDEDIRS with value “C:\KDE4″
4.1 Start > Control Panel > System > Advanced > Environment Variables, click [New]

5. Do this… at a command prompt
(temporarily needed, check KDE link below to verify)
cd C:\KDE4
C:\KDE4> bin\update-mime-database C:\KDE4\share\mime
C:\KDE4> bin\kbuildsycoca4 –noincremental

THAT’S IT…. ALL DONE. How quick was that…

6. Testing…
run c:\KDE4\bin\assistant.exe to test a QT program.

Now run KCACHEGRIND..
run c:\KDE4\bin\kcachegrind.exe

These instruction are a summary of the KDE on Windows project

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon

Simple tricks for Windows Programming automation using batch files

I thought I might mention a few of the simple tricks I use when I am developing…

Keyboard assigned Shortcuts

I often need to restart apache very regularly, ie: every other minute.

This is a real bore when I have to find either a GUI or and command prompt. So I set up shortcuts in windows..

I create batch files to do what ever I want, create a shortcut to the batch file and then assign key strokes to them.

ie:

CTRL+SHIFT+F9 => start apache service

CTRL+SHIFT+F10 => stop apache service

Then all I need to do is keep an eye on the Apache Monitor.

NOTE: You must put the shortcuts in a folder in your Start menu… otherwise they will never run when you hit the assigned keys.

While it seems simple, I have noticed how few people truly automate the tasks they perform again and again and again….

Do it.
This alone saves me hours every week when I have my head in code.

 

Automating a task with Batch file and viewing the results

Use set /p varName=”ask for data” then use the variable to call the correct thing.

You can also use this to stop the box from closing, so you can see the results, put this at the end: set /P Done=”Press return to close.”

Here is an example for an ant build:

@echo off
set /P TARGET=”Please enter Target(clean,compile,build,run,javadoc):”
CMD /C ant %TARGET%
echo ——————————————-
set /P Done=”Press return to close.”
:End

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon
Byting the hand that feeds you…