Tim Jarvis

Leaving CodeGear

After nearly 9 years at Borland / CodeGear its finally time to sign off. I have loved my time here and I count many of my colleagues as friends not just co-workers. With so much time and energy that I have invested at CodeGear it will be with a tinge of sadness as I leave to take up an exciting new challenge, and I will always be cheering CodeGear on from the sidelines.

So I’d like to say a big thank-you to all the Delphi community, its you guys that have made my job so enjoyable, look for me in the newsgroups and email forums, I most likely will still be lurking and making the occasional post. 

See you round.

Posted by Tim Jarvis on February 1st, 2008 under Uncategorized | 6 Comments »


Lowering the barriers

Last year I had approx 40-50 blogs subscribed to in my RSS reader, since then I have been ruthlessly cutting them down. I am now subscribed to 18 (the Codegear main feed just counts as 1) One of the feeds that I have kept is Jeff Atwood’s Code Horror, if you are not subscribed then do yourself a favour and hook it up, he really nails it time and time again in my opinion.

This post http://www.codinghorror.com/blog/archives/000881.html really resonated with me, one of my pet peeves is needless barriers to sales and processes that are self serving, I get irritated as a customer when I have to jump through hoops that are all about making an organisations job easier but does nothing for me as a consumer except annoy me, so of course when I see ourselves falling into that trap I feel I have to speak up (privately). Jeff nails it with his example of login UI’s becoming a barrier, but the implication is wider than that, so many processes nowadays are one sided, all aimed away from the consumer, all to often the consumer becomes the defacto sales / process admin person as well as the customer, I for one will go elsewhere if I have a choice.

Now don’t get me wrong, I have no problem with filling out forms and registering on websites etc, and I feel that its perfectly correct to ask that of customers as well, but it has to be less one sided I need to get something out of that, for a relationship to work and grow, there has to be a quid pro quo, and again Jeff nails it, it has to not feel forced, it has to be organic and flow naturally, out of that comes trust.

 

 

Posted by Tim Jarvis on June 5th, 2007 under Uncategorized | 2 Comments »


Touch screen magic

While I was typing my last post, I was also chatting with John K on IM, he sent me this link http://www.macrumors.com/2007/02/12/more-multitouch-from-jeff-han/ man this is cool, really cool, reminds me of some scenes in Minority Report.

Posted by Tim Jarvis on February 15th, 2007 under Uncategorized | 7 Comments »


India again

Last time I went to India I had a great time, I promised pictures I know, I managed to lose most of them when I recently had to rebuild my machine, but good news, I am coming to India again soon, and I will definitely post them up this time (yeah I know you are sceptical, I guess I deserve that)

Last time I was there, some people commented that they didn’t get an invite, so here is a link to the invite letter http://www.borlandpresents.com/edm/devday07/india.html, we take spamming seriously, so we do try not to send out these invites uninvited (so to speak). But if you would like to come to one of these events, they’re free, please feel free to sign up, even if you didn’t get an email invite.

Posted by Tim Jarvis on February 15th, 2007 under Uncategorized | 4 Comments »


5 things you (probably) didn’t know about me

I have been putting this off because it meant I needed to install a HTML editor on this new laptop, and frankly I wanted to spend a bit of time researching what was the best one to use….but who am I kidding I am never going to make time for that, and the fact is I have a Frontpage disk at my fingertips…..so here it is, 5 things that you (probably) didn’t know about me.

  1. I did my tertiary schooling while I was in the Royal Australian Navy. I was an Electronics Technical Communications (ETC) Engineer.
  2. I sky-dived for approx 10 years, until financial priorities changed (expensive sport) for the uninitiated or slow, that’s also called getting married and having kids.
  3. Related to 2. I once was arrested for jumping off of a building, also called a base jump.
  4. I have the lowest IQ in my household, both my daughters and my wife have extremely high IQ’s, and yes it does annoy me.
  5. I have been playing Golf for 30 years (since I was 11, now you know my age too) and my handicap is still 20. Though with the travel demands of my job, I only get to play 10-12 times a year.

So that’s me. I got tagged by Malcolm and Pawel, but because I am very late to this meme, those that I would tag have already been tagged, so this end of the chain has to end here.

Posted by Tim Jarvis on January 29th, 2007 under Uncategorized | 1 Comment »


Off to India this weekend

When you have 2 daughters both almost teenagers, you will probably find that your life is crazy busy, and most of the time not with your own projects / hobbies etc, mostly with driving your kids and their friends here there and everywhere.

I am off to India on Sunday, and I have had to plan my Sunday morning with military precision (lucky for me, I am indeed ex-military) around Alex’s Karate commitments and Rachels Tennis commitements.

The India trip should be fun. firstly I love Indian food and second, though this is a gross generalization, Indian Developers tend to be highly skilled and should make for fun seminars. If you are in India and havn’t heard about these seminars and would like to come, we would love to have you, register here http://www.borlandpresents.com/edm/devstudio/india/

I’ll post some pictures of the events when I get back.

 

Posted by Tim Jarvis on December 1st, 2006 under Uncategorized | 4 Comments »


Unmanaged Exports (or Inverse P/Invoke)

Lets face it, we as Delphi developers have been pretty spoilt, for more than 11 years we have had the RTL and the VCL. We now take for granted that we have a high level wrapper around both the Windows API and the Windows Common Controls libraries. For most of us when we look at the .NET framework, particularly Winforms we fail to see what the big deal is, and in fact porting our apps to Winforms or even VCL.NET at the end of the day costs us time and energy for no real gain, and in some cases performance degradation. But the big deal is this, not everyone has had it as good as you, in fact the majority of Windows developers have had it pretty hard, to them Winforms is as ground breaking and RAD’ifying as the VCL was to us 11+ years ago, so give the poor b%$rds a break when they wax lyrical about the .NET framework.

So leaving aside all the "managed", "safe", "verifiable", "secure"….yada, yada, yada there is something else that we need to be aware of, even for you die hard “native code or bust“ enthusiasts, sometime in the future you will need to call .NET framework code, you can fool yourself all you like that you won’t, but the time will come that you need to use an API and it will only exist as a managed API, might not be today, but it will come.

The purpose of this post is to show you that you don’t have to throw away any of your code or port your application to take advantage of some nugget of managed code that you want to use, you can still do your development as native as you like and still call out to a .NET assembly. In fact Delphi.NET is reasonably unique in this respect. (You can’t do this in C# or VB.NET without resorting to COM)

So here is a scenario for you,

You need to start storing your users passwords in your system, obviously you don’t want to store the actual password, so you feel the simple solution is to store a password hash, you know that the SHA1 hashing algorithm is pretty secure so you decide to use that, you also know that the algorithm will hash to an array of bytes, and that they might contain control characters, which of course is not so good for storage or easy comparison, so you decide that you want to store the resulting hash in Base64……Ok so in Delphi-Win32 without add on components this is going to require quite a bit of work, but in .NET with the cryptographic classes, this is just a few lines of code, wouldn’t it be great if we could take advantage of that but still have a mostly Win32 app.

With Unmanaged Exports we can do this very simply.

Step 1.

Using the Delphi.NET language personality create a Library project (note this is not really analogous to a .NET assembly, a Delphi.NET library is used to create dll’s that will be mostly consumed by Delphi Win32. If you want to create an assembly to be consumed by other .NET languages, create a Delphi.NET package project.)

Step 2.

Write your function and export it….

procedure GetPasswordHash([MarshalAs(UnmanagedType.Bstr)] const Password : string ; [MarshalAs(UnmanagedType.Bstr)] out b64Result : string) unsafe; export;
var
  ha : HashAlgorithm;
  hashResult : Array of Byte;
begin
  ha := HashAlgorithm.&Create(‘SHA1′);
  try
    hashResult := ha.ComputeHash(Encoding.Default.GetBytes(Password));
    b64Result := Convert.ToBase64String(hashResult);
  finally
    // HashAlgorithm implements IDisposable, so just good manners to "dispose" it
    //(ha as IDisposable).Dispose;
    ha.Free; //Or the simple way….
  end;
end;

exports
  GetPasswordHash;

What I also had to do was add the compiler directive {$UNSAFECODE ON} I did this just under the uses clause in the library. Also I removed the SysUtils and Classes references in the uses clause. And note I am specifying that .NET marshal the strings to Win32 as Bstr (Widestring in Delphi-speak) this is because the default marshalling is to a PChar, and whilst Delphi can handle PChars just fine it raises all sorts of questions like who is responsible for cleaning up the allocated memory etc, by marshalling as a Widestring I can just let Delphi worry about that.

You might also note the & symbol in front of the Create method call as well, this is because in this case the Create method is not a constructor this is a factory style class method from the HashAlgorithm class and Delphi needs to know that we are not trying to call the constructor.

Step 3.

Compile the DLL.

Step 4.

Create a Delphi Win32 VCL application, Add a couple text boxes and a button, and create a function prototype for the exported function GetPasswordHash.

procedure GetPasswordHash(const password : WideString; out b64Result : WideString); stdcall; external ‘Passwordhash.dll’;

Step 5.

Call the function…

procedure TfrmGetHashSample.btnGetHashClick(Sender: TObject);
var
  hash : WideString;
begin
 
GetPasswordHash(txtPassword.Text,hash);
  txthash.Text := hash;
end;

(you may of course want to turn GetPasswordHash into a function to return an error code on failure for a bit of error protection)

For some more info on Unmanaged Exports, Brian Long has some great articles here

Posted by Tim Jarvis on November 10th, 2006 under Uncategorized | 17 Comments »


Jonathon Edwards Revolution

While catching up on some RSS feeds during my vacation I noticed Jeff Attwood linked to this post by Jonathon Edwards. FWIW I agree with a large portion of this post, I totally agree with Jonathon that the time is ripe for a “revolution” of programming tools and idea’s.

 

Posted by Tim Jarvis on June 27th, 2006 under Uncategorized | 2 Comments »


Starteam SDK - Getting server information.

“How do I programmatically get the Starteam Server list that the Starteam Client Displays ?“

I have been asked this a couple times now, so I thought that I would blog the answer. The Starteam configuration details are stored in a file called starteam-servers.xml in your profile’s application data directory (I am assuming a windows setup here) so in my case the file is at C:\Documents and SettingsTim JarvisApplication DataBorlandStarTeam. Of course it’s a simple matter to read this XML file and produce your list, however there is an even easier way, and this is using the ServerList class in the SDK.

private void doItButton_Click(object sender, System.EventArgs e)
{
  ServerList sl = new ServerList();
  sl.LoadFrom(ServerList.DefaultFile); // This static property will refer to your profile’s starteam-servers.xml file
  foreach(ServerInfo si in sl.Servers)
  {
    Trace.WriteLine(si.Description);
  }
}

Posted by Tim Jarvis on June 21st, 2006 under Uncategorized | Comment now »


Asia Pacific Kick-off for "DevCo"

Earlier this week I was in Tokyo for the Asia Pacific "DevCo" Kick-off. What a blast we had, a lot of it was work of course, learning about our new roles, what was expected, where we are at in the spin-out process etc. Nigel briefed us via video conference as did Tod. We also got to speak to Michael Swindell and Allen Bauer et al directly about product plans, roadmaps etc. I have never in my life been so pumped to be part of something as I am about "DevCo" the atmosphere is simply electric, and some of our plans…well….you’ll see. ( I actually asked Tod, "are you now kicking yourself" )

But for me, the highlight of the trip (apart from buying myself a Samurai Sword) was the chance to meet and chat with Tagawa-san. I felt like a fan meeting my favorite rock star, just between you and I, I am pretty sure Malcolm and Gordon felt the same way too. Tagawa-san is such a nice guy, very shy but agreed to let his photo go up on the net, so here are a couple pics….

From the left, Gordon Li, Me, Tagawa-san, Malcolm Groves.

Me and Tagawa-san.

Deep in conversation.

Posted by Tim Jarvis on June 10th, 2006 under Uncategorized | 1 Comment »




Server Response from: blog2.codegear.com