sed and grep save the day

I use thunderbird for one of my less recently used email accounts – I get a lot of spam.

I was trying to use a website to fill in a survey  but I forgot my password so they emailed it to this email account.

Of course the email goes straight into the spam folder.  This is rather large and I cannot browse it.

Easy solution: copy  the Junk file to my linux box.

Find the location in the file of the retailer:

grep -in retailer Junk

This lists the location in the file of the retailer.

The first entry was on line 920123 

sed -e”1,920000d” Junk > Junk.tail

I can now edit Junk.tail and find the temporary password.

Can you find a quicker solution? 

Windows Developer Power Tools

This is a great book.  It provides descriptions, why to use and how to use guides for over 170 free windows devlopment tools.  Scott Hanselman provides the foreward.

 It has its own website.

I can definately see myself plugging several of the tools myself.

For example I have used, but forgotten about SourceMonitor. This allows analysis of an entire codebase to allow detection of excessively long methods, overlyly complex methods, uncommented code.

VB6 is dying

VB6 was consider flexible largely due to the suite of third party controls available.

Out of the box VB6 was always much weaker than it’s rivals.

The problem is that while MS will be releasing the VB6 runtime for the foreseeable future, I can’t see the add on developers maintaining VB6 versions indefinately.  For example certain grid controls are no longer supported and the documentation is unavailable. 

Escape Route From VB6

We have an (effectively) undocumented VB6 application.  The fun part is that some of the third party components that we used are now unsupported (since 2003).

Management will not authorise a full rewrite – but does want to extend the application.  Our new applications are in C#. The VB.NET translation wizard leaves 100’s of errors and fails to compile.

Here is an article on embedding a .NET form into a VB6 application.

Here is an article on embedding a VB6 form into a .NET application.

These may provide us enough of a quick win to allow us to use supported controls for new development yet keep the existing application. 

More Thinking about Validation

This is a series of posts that relate to Validation and the use of the Notification Pattern.

This guy is heading in the same direction that we have been using at my work.  There are a few details that he has not yet dealt with:

There is more you can do in this manner than validation.  You can apply defaults, calculations and more complex business logic.  This is the start of a rules engine.

A key point that is lost in an attributes based approach is that only a single question may be asked.

In this case the question is “Is the system valid”?  But is could equally be can I add an XYZ here? 

Minor Namespace Feature

Namespaces in C# and packages in Java are a convenient method of keeping related classes together. If you want to use code in another package in java you need to import the classes. This means that two distinct namespaces are entirely unrelated.

I used to think that the C# namespaces worked in the same way.  However it seems that namespaces form a hiearchy.

Namespace A.B.C automatically has access to Namespaces A and A.B

This is a minor detail but is not that clearly stated in the tutorials that you normally get.  It is in the language guide but not as clearly stated as it could be. 

Real World Applications : Deployment and Upgrading

When an application is initially being developed life is relatively simple for the developer.  There is an application and there is a database.  You can tear down the database and rebuild it with impunity.

Once it has been deployed life gets a little more complex.  Databases require upgrade scripts.  You need to know which version of an app is on each users machine.

Life gets a little more complex once you have multiple deployment stages.  The simplest is the QA/Test database and the Production Database.  In almost all cases you want to script changes to the test database and only run the finished scripts against the production server (having backed it up first).  Personally I find it far easier to control a database if every seperate item is scripted in a one feature two script file basis: Create Constraint/Drop Constraint, Create Table/ Drop Table.  This works great for databases that you control directly.  This becomes hard when you don’t have control.

Recently I have been working on a workflow application (Team Track).  It is relativley painless to make chnages in the test environment.  The problem comes when you want to deploy those changes to production.  The migration tools do not migrate all of the options – the poor developer has to recreate everything by hand.  Server tools should be fully scriptable.  Developers need to think of how to partition their applications to cope with more complex production deployment stages.

MS Analysis Server 2000 also suffers this problem – you need to manually copy the changes from one server to another.  What were the developers doing when they left out scripting?

What I described is the simple case.  Oftern  there are more stages (QA, UAT, Staging, Pre-Live, Live).