Delphi Blog


This blog is now closed. All future posts will be here

Ken Henderson, rest in peace  - 1/30/2008

I just read today that Ken Henderson has passed away. My first ever Delphi book was from him and he was a fabulous writer. My greatest condolences go out to his family and children.

:(



Comments ...

Oh here's a thought...  - 1/28/2008

And I've mentioned this in the past. Tiburon should be a CTP for the whole Delphi community to view and provide feedback on. And if you think it shouldn't and should remain restricted to the few elite named Field Testers, give me a good reason why.

Comments ...

Intraweb supports Silverlight  - 1/28/2008

Since this question popped up on the newsgroup and some might be wondering, yes we've added support for Silverlight in Intraweb. Right now you can pretty much use a control developed in .NET in Intraweb by supplying the assembly. The limitations are in regard to interaction with Intraweb, which requires DOM/JS right now. I'm hoping that with the next CTP/Release of Silverlight 2.0, things will improve in terms of input and we can add some more functionality out of the box. Hopefully in the next week or so I'll blog about what we have so far, showing you some code.

Comments ...

Integrating with jQuery  - 1/17/2008

[Warning: A tiny little bit of Javascript ahead]

Want to know what jQuery is? You've come to the wrong place. Here I'm going to show you how to integrate jQuery with Intraweb...

So what's jQuery? To put it simply, it's a very powerful Javascript library that allow you to do a lot with little code, based on the notion of querying DOM objects.


Ok, big deal. What can it do for me?

Well to start with, it offers a whole range of plugins that make use of the library to provide outstanding functionality inside the browser. It also provides a lot of base functionality like easy Ajax support (though not as simple as Intraweb, you still need to know Javascript...actually jQuery).

Wait a minute. Isn't this competing with Intraweb? Why are you integrating with it? At Atozed we believe in harmony in a eco-system were all parties involved form a beautiful relationship both at a personal and professional level...yeah right!

Seriously, why are we trying to integrate with jQuery? Simple: it adds value to Intraweb and offers solutions to our customers. We're actually aiming at integrating with other Javascript libraries and jQuery is the start of it.

So how does it work? As usual, here comes the...

[Disclaimer: this is work in progress. Things might change from now to release. In fact, it might be radically different]

Enough already, how does it work? Warning: jQuery ahead!


First of all we've added a couple of new things to Intraweb. The server controller and all forms now have a property called ContentFiles of type TStringList (actually TIWStringList to be precise but that's irrelevant). ContentFiles allows you to add javascript and css files you want rendered on your form. Let's say you want to include a file named... jquery.js, you can add it to the ContentFiles and it will be automatically rendered in your form. In the name of "convention over configuration", it's assumed that the the file exists under the Files url. If you want to add a stylesheet, just put it's name, same thing will happen. This actually allows you to add more than one Stylesheet per form as well as simplify the whole process. Oh, if you want it rendered on all forms, just add it to the ContentFiles property of the ServerController instead of the individual forms.

Secondly, we've added a new non-visual control which is called TIWJQueryWidget (and in the future there might be a TIWDojoWidget). This component has two important properties: ContentFiles and OnReady. I won't explain what the first one does since I just did, except to add that in this case, it's content is copied to the ContentFiles property of the form so that the form knows what to render. The OnReady is the soul of it all. jQuery basically allows to define behaviors for components by initializing some parameters once the document (HTML) has been loaded. This basically means that whatever you enter in OnReady will be automatically placed in the document loaded event. Normally this will be jQuery. Sounds all too complicated? It isn't. Let's see how it works.

Suppose you want a fabulous looking Calendar for your edit box. First step is to navigate to the jQuery web site and see what there is. At this url I find a plugin called datePicker. Like the way it looks and want to use it.

So I see that it requires a couple of files, namely a ui.datepicker.js and a ui.datepicker.css file. I click to download it and save it to my Files folder under my Intraweb application root, where I also have jquery.js (downloaded previously from the same site). I want to add a date picker to my edit controls. Once I have the files in place, I drop a TIWJQueryWidget component onto my form, double-click on the ContentFiles property and enter the names of the files it uses. 

Now all that's left to do is let the edit boxes know I want to use a date picker (the plugin that we selected actually tells us what we need to do). This is where the OnReady comes in.  We write the following code:

$('#EDITSTART').datepicker();
$('#EDITEND').datepicker();

Next we run the application. When we enter the edit box, we get:


Viola! Remember the warning about JS? It was quite little wasn't it?

What next?

Well I've just shown you one simple example, but there's so much more you can do with jQuery without much effort. The obvious question is, are we going to provide wrappers around jQuery? Not initially. There are many reasons. First of all, there might be licensing issues with some plugins. Secondly there's issues with keeping in sync with jQuery and other releases. It also requires a lot of effort to create wrappers that will give access to all the possibilities that each of the plugins (or even the base library) offer, and seeing how simple it is to work with it as is, it might not be the best approach. However, the jury is still out on that one, but the fact that we've made a widget component is a good sign.......

I'll try and post some more entries on how to work with jQuery in the next couple of weeks. Hopefully you'll get this functionality in the next release. Oh, and there's also another new component on the palette, I'll try and post about that one very soon.

Comments ...

FYI: Check Digit  - 1/11/2008

In Spain, bank accounts have twenty digits, two of which represent the check digits (known in Spanish as "Digito de Control"). The purpose of a check digit is to perform a validation of a value. In this case, we have four digits representing the bank, four representing the branch, ten for the actual account number and last but definitely not least, the two check digits. It's important to have them since you can often get confused why typing in twenty numbers and find you've incorrectly put in a two instead of a three. You don't want the 1M€ to be transferred to the wrong account.

Now any good system should verify the check digit and notify the user if it's incorrect. That's what my bank does. However, mine goes one step further. It actually tells me what the correct control digit is!!! @#!??!¡%$&. Only one scenario comes to mind where that would be useful. Otherwise I think it can cause more harm than good.

[Translation: the check digit is incorrect. It should be 41]

Comments ...

Rosetta@Home  - 1/7/2008

I've known about SETI@Home for a really long time (can't even remember when I first heard of it), however today I found out about another project, called Rosetta@Home for research to help fight cancer, HIV and other diseases. It seems it's been around for quite some time, and since I hadn't heard of it (thanks Toni), I'm sure there are others who don't know of it either. I've already got my dormant server plugged up, and since it's 100% idle most of the time, that's a lot of juice!

So, sign up. It's for a good cause!

Comments ...

Progress Indicator revealed  - 1/4/2008

Some of our customers have been asking us about the ProgressIndicator that appears on Intraweb forms. It was added sometime ago but not fully functional. I've been working on it for the past couple of days trying to get it finished for the next release and we're very close. Just some bugs to iron out and some minor features to add. In this post I'll give you a general idea of what it is and why it came about.

[Disclaimer: this is work in progress, so some things might change from now to the time of release. I'm also interested in feedback]

We introduced our support for Ajax over a year ago, and we did this by providing events that you can call (and having worked with other frameworks, I'm still amazed at the simplicity of Ajax support in Intraweb...in terms of end-user that is). The reason we've called these events OnAsyncXXX is because Ajax calls can be made in two ways: synchronously and asynchronously. Async isn't really to distinguish it from the OnXXX events, but to indicate that the Http request made via XMLHttpRequest is an asynchronous call. This type of call prevents the page from locking up and other requests can be made and it's also the most flexible. However, it also introduces a problem.

I've always advocated that Ajax calls shouldn't be made in all cases. There are certain types of requests that make more sense with a full page submit (requests that refresh many controls on a page for example). At the same time the purpose of Ajax is to allow a more fluid interaction with the user. This implies that many of the calls made should be short-lived, not long running processes. However, there are many times where you have a complex page with a lot of data, and you do not want to use a full submit, for instance a long running query against a database. If there isn't a need to refresh the whole page, why cause a full submit?

Due to this scenario, where you need the best of both worlds, that is, the form "locking" effect that you get on a full submit and the reduced data interchange caused by an asynchronous callback, is where TIWProgressIndicator comes into play. It's a non-visual control that you link up to your form. Every asynchronous callback will now use this component to provide status information during a callback. Here's a screenshot of it in action

(Apologize for the bad contrast).

What is happening is that on the asynchronous call, the screen locks and some status information is displayed. The display is completely configurable, either by setting individual properties or using Css.

Here is the same form at design-time, as well as the object inspector showing the properties for the progress indicator control.

It doesn't end here though. If you look at the properties, there are three interesting one, actually there are 4 but one is public. This last one, is called DivTag and it allows you to specify what you want shown when the progress is called. This means that you can pretty much display whatever it is you want, completely overriding the default progress information. You also have two properties called PreScript and PostScript. These are Javascript code that will be called prior to the Ajax call and after the Ajax call. This allows you to hide your custom tags, show information, pretty much do anything you want. And all this is acomplished by setting the UserDefined property to True. By doing this, I've tried to make the progress indicator as flexible as possible and not restricting you to use what comes built in. Again, it's still not entirely finished and I'm open to comments and suggestions. But so far, this is what we have and you'll be able to play with it very soon.


Comments ...

Look Ma, I'm an MVP  - 1/1/2008

I got one of those really nice e-mails today. I've been awarded with the Microsoft MVP Award for 2008 in the category of C#. I'd like to thank everyone that supported me, and a special thanks to Cristina Gonzalez (MVP Lead Manager for Spain and Portugal) and Alfonso Rodriguez (MSDN Spain).

Thanks!

Comments ...

Thumbritis or Weird Typing Syndrome  - 12/31/2007

I've been having extremely bad pain in the joint that joins my thumb with the rest of my hand. I didn't realize what it was until a couple of days ago. Turns out that I can blame it on computers. I've been working a lot on my laptop lately. Actually I work on my laptop 100% of the time, but most of the times I plug in an external keyboard and screen. However, in the past month or so I've been using the device's keyboard itself. The other day it hit me why I was having this excruciating pain. It's because of the way I use my thumb to get to the right shift and cursor keys. Turns out, as shown in the wonderful diagram below, I bend my thumb under my hand to get to the keys instead of using my right pinky for the shift and moving my whole hand down to get to the other keys. Using my thumb has made me extremely fast with the keyboard.


My pain problem is that right now, as stupid it as it may seem, it's extremely hard to get rid of the habit. So I really feel like Homer every time I repeat the same movement and cringe in pain. Doh!

So, if you're like me, don't do this movement. Stop it before it starts to hurt, literally!


Comments ...

Applying Delphi 2007 Update pack or 'My hate towards InstallAware is justified'  - 12/18/2007

As you might know by now, a new update has been released for Delphi 2007. As component vendors, we need to provide a new binary for our customers also. So, like any naive, trusting person, I download the update and double-click it. I make myself several cups of coffee, some crisps and sit back to enjoy myself for 15-20 minutes, and very happy that I uninstalled Vista and not have to wait 2 to 3 hours for it to install (according to Nick's blog). Well, was I stupid. After about 10 mins I get an error, something about code 2705. I click next, and the installer continues to "install" and then I'm presented with one of the most informative screens ever:

Now the good news is that I'm not the only person getting this error. There's at least 3 other people having problems. Two of them get the same error as I do. Out of respect I won't mention who either of them are. So, save yourself those precious 15-20 minutes, don't bother!

CodeGear, when will you get it? When will you just say "Ok, we messed up, we made the wrong choice with the installer and we'll switch to something reliable and serious". It doesn't matter how much you try and 'optimize' and 'fix' the installer issues, it won't get there.

Comments ...

More recent entries | Older entries