Older blog entries for jnewbigin (starting at number 9)

Automatic type conversion

I just added my 2c about Inner Classes to the WIKI but it got me thinking again about a feature I think is lacking in modern languages. Having slipped out of the top 10 blogs, I felt it was time to share my idea.

The feature is automatic type conversion. When you have some pseudo code like this:

class TMyChildClass inherits from TMyParentClass;
 
function DoSomeProcess(bar : TMyChildClass);
 
var
 foo : TMyParentClass;
begin
 foo := TMyChildClass.Create;
 DoSomeProcess(foo)

It does not work. The problem is that although foo is compatible, the compiler wants me to explicitly say so. The solution is to add an explicit type conversion like this

DoSomeProcess(TMyChildClass(foo));

But this becomes a problem if the conversion is not type checked until run time. If for example I had:

var
 p : Pointer;
begin
 DoSomeProcess(TMyChildClass(p));

I have valid code but I get a run time error because of the invalid type cast. So, the explicit type cast is for shutting up the compiler, not for making my code correct.

The compiler complains because it knows what type to expect, and given that it knows, I think it should be able to implicitly cast my parameter like this:

DoSomeProcess(foo);

and I get the same result. If the type is correct, it works and if not I get a run time error.

What about preventing programming bugs? Well I guess some kind of syntax is required to allow the automatic conversion. Each language would have to pick it’s own syntax but in delphi, it might be something like this:

DoSomeProcess(auto foo);

Syndicated 2006-05-15 01:13:50 from John's test blog

My rawwrite tools are coming along but bugs in the MS UpdateResource made me give up for a while and focus on ext2ifs. After 2 days of debugging I found the bug which was causing incorrect data to be read. It was a 32 bit multiply when I wanted a 64 bit one :( Anyway, thanks to vmware virtual disks, it is now fixed and everyone should be able to get accurate directory listings now.

Well it has been a long time since I posted anything here and I don't feel like I have done much in the past year but there are a few things in the pipeline.

First off, centos-2. This is a rebuild of RHEL21AS but with the redhat logos removed. It is currently at beta3 but I have not had any bug reports so next week I think I will release a final version which will be more or less the same as the redhat U3 version. See http://www.caosity.org/

The cAos project also has centos-3 which is a RHEL3 rebuild and cAos which is an improved version of RHL (but you will have to check the web site for the version numbering).

I am also slowly working on updated rawwrite tools. I have a version of dd ready which will be a core part of a new studio of tools. I am currently working on self writing disk images. This will be a .exe file which contains one or more compressed disk images. When you run it it will create the disks for you. My test disk image compresses well so the .exe should be less than the disk image. We will see how well it works when you have a disk image which is full of compressed files.

I think that will do for now. I should get back into writing some code.

I finally released the next version of my ext2ifs. So far the biggest problem is that Windows XP goes out of it's way not to create volume devices for Linux filesystems. This means that for now you can't do any funky mount point stuff.

I have also got a few bug reports but nothing too major, no bluescreens at least.

I havn't done much else recently. I have got a stack of things to fix in my other programs but as always there just isn't enough time to do it all.

For those who might be interested, check out my driver here http://uranus.it.swin.edu.au/~jn/linux/ext2ifs.htm

It has been ages since I looked at this site but I came across Fefe's web page which had a link so I thought it was about time to write an update.

I have not been doing much else but work recently. I did stop the other day so see how the Unix extensions in SAMBA were going. Samba 3.0 seems to work but I still have to submit a patch for the symlink security. I had a play with creating a new config file option but I have not finished.

I also checked out the latest 2.5 kernel. My patches all seem to be present so I assume Urban is looking after them which is good.

I have also started a new project which is to reimplement qmail under an open source license. At the moment I am still planning but I hope to start coding soon. As the word gets out I think support will grow so I don't have to write it all myself. As soon as I pick a name I will create a sourceforge project for it. At the moment I think I will go with "open qmail" which is not very imaginative but seems accurate enough.

It's been a while since my last entry, but that is because I have been too busy working.

My SAMBA patch has been accepted so smbfs should work against the 2.2 CVS tree. Now I need to work out what needs to be done in the way of symlink security and see if I can't get that into the next SAMBA release. That way smbfs will be useful for the masses.

I also had to rebuild my dialin modem server. The modems have to stay on the staff subnet so with uranus moved I had to find a new box for the modems. I got an old Pro200 which is now doing the job nicely. I also took the opportunity to update my smb authentication plugin for pppd. New new plugin has simple config files which allow multi domain authentication and user access control and comes in an easy to install rpm.

I even sorted my problems with the bank and the interest rates have just gone up so now I get an extra %0.2 interest.

17 May 2002 (updated 5 Jun 2002 at 09:59 UTC) »

I am finally back on the air. Some quick thinking network admins though they would firewall the staff subnet to prevent incoming connections. They neglected the fact that there were still a few servers on that subnet. Of course I did not notice there was a problem until someone phoned me and asked why their mail was not getting through. Anyway, I am now set up on the server subnet and should be live again.

I have spent the last few days playing with RedHat Linux 7.3. It comes with a recent kernel which accepts my patches without any modifications. All my RPMs seem to work too which is good.

Now all I have to do it sort out the rest of my problems with the bank...

I had a late night last night. I built an RPM for my smbpwman code but after I have published it I realiased that I still had hard coded server names and port numbers. I quickly invented a config file and implemented a simple config reader which should keep people happy at this stage. I'll polish it later.

After finishing smbpwman I figured I should get the smbmount RPM going. Despite all my looking I could not find any docs on "rpm -ta" but in the end I got it to do what I wanted. My samba patches seemed to work and after a few small build issues I had a working RPM. (Lucky I had mercury to do the builds for me. mercury can do a kernel diff in < 1 sec :).

Now that the client side setup is complete, I just have to wait and see if my samba patch gets into 2.2.4 so people can start using the unix extensions.

Today I was tasked with installing a web log analysis for a client so I did a test install on uranus. AWstats does a pretty good job. I was quite impresses with my stats too, even more so when I realised it was only 3 days worth not 30:).

After spending a few hours searching around on some old backups I found the source to my php module which does smb authentication.

I cleaned it up and built it into a RH72 compatible rpm. Now all the pesky students can log in and check their entries in the apache error log and fix their cgi assignments.

While I was at it, I set up a local php mirror so I can have instant access to the pretty PHP manual. I guess I'll let the students look at it too :)

I also got a tip off about the symlink problem in smbfs. I am off to check that out now

I finally got Windows 2000 running under VMWare with the kernel debugger connected. It turns out that the MS debugging tools installer can not do an upgrade and I had to uninstall the old version first.

Now that it is working I can make some progress on the ext2 filesystem. If I can get reparse points working then you will be able to mount your linux filesystems in a tree and not have to worry about drive letters :)

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!