Archive

Archive for August, 2012

Delphi days, damn!

August 10, 2012 1 comment

I’ve had some contact with detlef, the editor and producer of Blaise Pascal Magazine lately. He really is an icon in the pascal community and holds a passion for our beloved language that is hard to match. If you havent checked out the magazine, make sure you visit the website (link above) and sign up.

During our last Skype session detlef mentioned the upcoming “Delphi tage” (or Delphi days) in germany and also the upcomming delphi meetup in the netherlands. I really, really wanted to go there – especially to meet primoz and detlef – and also to meet some of the guys behind freepascal and Lazarus.

Delphi, ancient of days

Delphi, ancient of days

Sadly, the deadline for the next smart mobile update in combination to my boss moving to spain for a year, leaves little room for meetings. Hopefully my boss will make it to one of these meetings to represent smart mobile studio, but I will have to stand guard at the temple of Delphi (so to speak).

Also, I have decided to go solo with a few component packages I’ve made. I normally dont do this – but the license manager (and a lot more cool stuff) wont help anyone if it collects dust on my drive. The components were actually written about 10 years ago – and I have used them in countless products. It’s a good practical solution written in vanilla Delphi (so no assembler, no generics or platform bound code) that is tried and tested by time. So I figured I could put them on the marked where they will help other Delphi developers. As far as I know, this will be the only package (with the exception of Turbopower’s older system) that deals with serial numbers and trial software, written in Delphi only with no external libraries. C#, C++ and even Visual Basic have hundreds of solutions for this – but Delphi havent had a good set of components since TurboPower was in business, Which is around 10 years ago (?). So I’ll put some weekend work into changing that.

In the first version (way back then) I checked for debuggers like soft-ice, rootkit’s etc., but those were the old days and that code was removed because it quite frankly was in the way. It’s not about creating a hack-proof system, that is impossible (windows 8 was cracked in less than 20 minutes?), it’s about trial periods, serial number management and giving the user an incentive to buying the full product.

Well.. I’m off for dinner at a friend’s house, fresh sea-food and beer 🙂 And maybe a game of battlefield to spice up the weekend!

But damn… I really, really wanted to go to the Netherlands and Germany 😦

CORS for Indy

August 8, 2012 Comments off

If you are using Indy as your server component and want to support CORS, which is quite essential these days with regards to AJAX callback to your server, all you need to do is to add the magic header:

   with aResponseInfo do
   CustomHeaders.AddValue('Access-Control-Allow-Origin','*');

The above basically says “allow all cross domain calls”. If you want to be more specific you can return a comma separated list of allowed domain referrers. Here is a screenshot from Fiddler that shows the headers from the Indy server inside Smart Mobile Studio:

Headers galore

Headers galore

For an interesting read on CORS, check out this NCZOnline article. Also check out this section from HTML5 Rocks if you are a Smart Mobile developer!