Welcome to this Blog. I am Software Engineer and work for Zühlke Engineering AG in Bern. This is my private blog, in which I will post mainly about technical stuff like Software Engineering or IT related topics. The views expressed herein do not necessarily represent those of my employer.
For those of you running Virtual Server 2005, try out the tool VMRCPlus. You can download it here. With this tool, you got everything you need out of the box, the administration access over IIS is not needed anymore.
As mentioned on the Programmer’s Notepad help site (http://pnotepad.org/docs/RegularExpressions), Regular Expressions are supported. But what are the benefit of Regular Expressions? In this blog entry, I will show two examples, how to use Regular Expression in Programmer’s Notepad.
If you have to replace a specific word (e.g. %test%) with another word (e.g. Hello), Regex doesn’t really make sense. Just use the regular search & replace window.
![]()
But what, if you have several entries like ?1, ?2, ?3, … and you want to replace them with {1}, {2}, {3}, …? With the regular search & replace window, you have to replace ?1 with {1}, ?2 with {2}, and so on. Furthermore, there are some problems with ?10, which gets replaced with {1}0 if you start replacing ?1 with {1}. In this situation, Regular Expressions is the solution.
Regular Expression always works char by char (not by a word). Inside the brackets [], there can be defined, which chars are allowed, e.g. [0-9] means, the numbers 0,1,2,3,4,5,6,7,8,9 are allowed. To select a year, just write [0-9][0-9][0-9][0-9]. To select any number, just write [0-9]+. The + means, at least one ore more occurrences.
Our search pattern for the previous described example should search for a question mark, followed by numbers. There can be a single number ore more numbers. Last but not least, the number should be extracted and surrounded by {} in the replacement.
- ? could also be a Regular Expression (zero or one occurrences, unfortunately not supported by Programmer’s Notepad), so we have to escape it with a backslash. –> \?
- The following number(s) should be extracted and surrounded with (). In the Programmer’s Notepad syntax, you have to use \(\) to declare, that something should be extracted. Everything found between this to brackets are later accessible with \1, \2, …
- We allow any number from 0 to 9 –> [0-9]
- This number appears at least once or more –> [0-9]+
- Combined, the search pattern is \?\([0-9]+\)
- The replace pattern is simpler. The expression found between the \(\) get’s stored into \1. Now use this placeholder between the curly brackets {\1}.
This replaces following examples with just one click. It’s easy, not?
?1 –> {1}
?10 –> {10}
?2 –> {2}
?3 –> {3}
The second example is a little bit more advanced. I got the result of a SQL query, separated by spaces, which I needed surround with some other words and in another order. The SQL result, which I had, was something like:
1 Monday 9 No description
1 Monday 3 Fish and meat
1 Monday 4 Vegetables and fruits
2 Thusday 10 No details
As result, I wanted:
Day “Monday” (id 1), Desc “No description” (id 9)
Day “Monday” (id 1), Desc “Fish and meat” (id 3)
Day “Monday” (id 1), Desc “Vegetables and fruits” (id 4)
Day “Thusday” (id 2), Desc “No details” (id 10)
- First, there is a number (once or more times), which should also be extracted –> \([0-9]+\)
- After that, there are some spaces, but they should not be extracted –> [ ]+
- Followed by a text (to be extracted) –> \([A-Za-z]+\)
- Again some spaces –> [ ]+
- Again some numbers –> \([0-9]+\)
- At the end text with spaces –> \([A-Za-z ]+\)
- The result is the string \([0-9]+\)[ ]+\([A-Za-z]+\)[ ]+\([0-9]+\)[ ]+\([A-Za-z ]+\)
- this should be replaced into Day “\2″ (id \1), Desc “\4″ (id \3)
That’s working. Easy, heh?
Didn’t understand any word about Regular Expressions? Check out http://pnotepad.org/docs/RegularExpressions or http://www.regular-expressions.info/.
In team project, CruiseControl is often in use to maintain a continuous build process. It is a Java program and it was first designed for Java development process. But as a successfully project, there is also a .NET implementation, called CruiseControl.NET. With this .NET implementation, Windows users can now benefit from a tiny tool called CCTray.
CCTray monitors the build process and informs a Windows user, if a build is successfully or if it has failed. This is done with a tiny balloon tip:
To use CCTray, download it from the Sourceforge project page. After the installation you can add your CruiseControl instance. Because we use a Java CruiseControl instance, you have to define the XML path. The Java CruiseControl provieds a XML servlet, which is accessible from http:// cruisecontrol/xml. After adding your Server, you can choose the projects, which should be monitored.![]()
CCTray helps you to maintain the build process and is a tiny, but very helpful tool.
Today, I encountered an interesting tool. Usually, Putty fulfills most of my needs to a SSH client. Only if I want to transfer files with Putty, I had to use another tool. Until now, I used Filezilla. But today I saw a cool tool on the computer of a teammate. It’s called WinSCP and works very well with Putty.
First of all, you have to define the location of the Putty executable.![]()
After that, you can import all Putty connections into the connection window:
If you have an open WinSCP connection, you are now able to open a Putty windows with just hitting CTRL + P. And after this fast setup, you can use WinSCP as your file transfer client.
Furthermore, for people who don’t know how to use vim (that’s not me
, there is another nice feature with WinSCP: it let’s you edit all files directly in your favourite editor. Just double click at a file and edit the file. People reading this blog knows, that my favourite editor is Programmer’s Notepad.
To define Programmer’s Notepad as your primary notepad in WinSCP, just open the preference window and add a new editor:
![]()
Active the option “External editor opens multiple files in one window (process)” and save it with pressing okay. To use Programmer’s Notepad as your primary editor, just move the new entry “Pn” at the top of the editor list.
![]()
That’s it. Now you can edit every file on the host system with just a double-click. Enjoy it!
Wooow!
I just installed the beta version of the new email organization tool Xobni (http://www.xobni.com/). This tool is incredible. It is a toolbar in Outlook and analyses all your emails in your inbox and creates statistical user profiles of each person, you are in contact with.
The toolbar looks like following:
Xobni also let’s you analyse your emails. Here’s an example on my daily average of my email conversations.
This tool is fantastic. I have currently one invitation left for the beta version. The first, who writes a comment with an email address will get this invitation.
« Newer Posts — Older Posts »
