Wednesday, August 9. 2006
I LOOOOOVE defragmentation. I love the thought of my files, my bytes, my bits, on my harddrive is laying in a nice and orderly stream; perfectly aligned and ready to be read right off the magnetic surface of my disks. So, I was sitting there contemplating the concept of deframentation on a modern harddrive. These days, the disks don't actually report the actual geometry of the disk, instead it maps the "virtual geometry", which is exposed to the OS, to the actual geometry of the disk. This way the disk can easily detect bad sectors on the drive and move and map them to another position on the drive, in case a part of the disk goes bad (which is probably more often than we'd like to know). So, we power up our favorite defragmentation program and has it move all the files around so that they are ordred perfectly in the "virtual geometry". The problem, as I see it, is that when the disk actually has to read the data, it will be read from the actual geometry of the disk, which could, at least in theory, be scattered all over the disk. Does this mean that defragmentation is more useful when the disk is new (and has less bad sectors)? Does it even make sense to defragment your disk?
Saturday, June 3. 2006
So we are nearing a release of www.momondo.com. I am really happy with the results. We have moved all the different services to different servers which has resulted in a serious improvement of performance on the site. Results are blazing out. Also, the work we have done with ensuring the quality of the robots and adding many new robots, the data quality is excellent. I have no doubt that our site has the best coverage out of all the different sites that seem to be opening lately. I hope you will all go check it out and book your next vacation through our links (which will in turn give us a small kickback from the airline), so that the site can become the success that, I believe, that it deserves.
Wednesday, November 30. 2005
I mean, who cares what the flight is like, as long as you can trust the airline, not to crash the airplane. Okay, so it's not just me that thinks that, but people in general. The success of low-cost carriers like easyJet and RyanAir. So, what I do for a living, is make a low-cost carrier search system. The system itself is called SpeedFares and is targeted at business travel agencies as a complimentary system to their GDS (Global Travel Distribution System) which mainly includes classical airlines, like, SAS, KLM, Lufthansa, and the likes. So lately we've been toying with the idea of taking our search engine to the web. I've recenly finished a "to-the-bones" version of the search engine. Programmed with Ajax techniques. It has a spiffy dropdown for choosing the cities to travel from and to, and a very cool dynamically updating price comparrisson page. In short I'm pretty proud of the result. So, if I caught you interest you can go see how you can travel cheap on Momondo for yourself. I hope you will like it, and that you will use it the next time you are going to go somewhere. If you feel any routes or carriers are missing feel free to leave me a note here.
Sunday, October 2. 2005
When picking out a web-based image gallery system, the choices are almost endless: Comdev Photo Gallery, IMS Pro, PhotoStore, PhotoPost PHP Pro, Coppermine Photo Gallery, and my personal favorite: Gallery. I recently updated my wifes web-based image gallery which was using Gallery 1.5.1. We had decided that it was looking a little bland, and might be in need of an update, so I went scouting for what was out there. After taking the whole trip around, I ended up with Gallery again. They had recently released 2.0.0, so I decided to try it out. I have always felt that Gallery was well designed, inside and out, but I have to say that the installation process really blew me away. It was step based and each set would tell you of any problem. For example I php's maximum script memory set to 8M. The script told me it need to be updated to 16M to run it. It was a breeze to install and about 5 minutes later I had a running version of Gallery2. Fiddling around with the importer in about 5 more minutes. I got it to import the captions so they would work with Gallery2, and then it just had to run for about 45 minutes (importing, scaling and thumbnailing 1600 pictures). The look is excellent, the features are great, installation is as easy as it's humanly possible, and it doesn't cost 1 cent. You be the judge.
Friday, September 30. 2005
I have been working on a project at work where it should be possible to set up what suppliers are available to our customers and their users. We also wanted to be able to be able to provide the customers with a standard setup (sort of a template) based on what type of product they are using. Here is the solution I came up with.
First the tables we already have available: Customer
| Column Name | Value | | CustomerId | Int (PK) | | CustomerName | Varchar(30) |
Office
| Column Name | Value | | OfficeId | Int (PK) | | CustomerId | Int (FK) | | SupplierTemplateId | Int (FK) | | OfficeName | Varchar(30) |
Supplier | Column Name | Value | | SupplierId | Int (PK) | | SupplierName | Varchar(30) |
So then we will need to add a table to hold the templates: SupplierTemplate | Column Name | Value | | SupplierTemplateId | Int (PK) | | SupplierTemplateName | Varchar(30) |
Last but not least we will need a table to hold the actual supplier selection: SupplierSetting | Column Name | Value | | SupplierSettingId | Int (PK) | | SupplierId | Int (FK) | | SupplierTemplateId | Int (FK) NULL | | CustomerId | Int (FK) NULL | | OfficeId | Int (FK) NULL | | Enabled | Bit | | Priority | Int |
A setting can either belong to a template, a customer, a registration number or none (which makes it a default setting). The priority is assigned as follows:
| Condition | Priority | | No owner | 1 | | Owned by a template | 2 | | Owned by a customer | 3 | | Owned by a registration | 4 |
So now we can fill in some data: Customer
| CustomerId | CustomerName | | 1 | Test Customer |
SupplierTemplate
| SupplierTemplateId | SupplierTemplateName | | 1 | Template 1 |
Office
| OfficeId | CustomerId | SupplierTemplateId | OfficeName | | 1 | 1 | 1 | Test Office |
Supplier
| SupplierId | SupplierName | | 1 | Test Supplier 1 | | 2 | Test Supplier 2 |
Now all that is left is set up the suppliers: SupplierSetting
| SupplierSettingId | SupplierId | SupplierTemplateId | CustomerId | OfficeId | Enabled | Priority | | 1 | 1 | NULL | NULL | NULL | true | 1 | | 2 | 2 | NULL | NULL | NULL | false | 1 | | 3 | 2 | 1 | NULL | NULL | true | 2 | | 4 | 1 | NULL | 1 | NULL | false | 3 |
Here is a textual representation of the above data: - On a global (default) level 'Test Supplier 1' is turned on and 'Test Supplier 2' is turned off.
- On 'Test Customer' level 'Test Supplier 2' is turned on'
- On 'Test Office' level 'Test Supplier 1' is turned off.
So how do we get this data out so we only have one row per supplier with the correct status? Well, the answer is a SELECT statement with a sub-SELECT to find the highest priority for the current supplier. Enjoy! Here it is:
DECLARE @OfficeId INT SELECT @OfficeId = 1 DECLARE @CustomerId INT DECLARE @SupplierTemplateId INT SELECT @CustomerId = CustomerId, @SupplierTemplateId = SupplierTemplateId FROM Office WHERE OfficeId = @OfficeId SELECT * FROM SupplierSetting s1 WHERE (CustomerId = @CustomerId OR CustomerId IS NULL) AND (SupplierTemplateId = @SupplierTemplateId OR SupplierTemplateId IS NULL) AND (OfficeId = @OfficeId OR OfficeId IS NULL) AND Priority = ( SELECT MAX(Priority) FROM SupplierSetting s2 WHERE s1.SupplierId = s2.SupplierId AND (CustomerId = @CustomerId OR CustomerId IS NULL) AND (SupplierTemplateId = @SupplierTemplateId OR SupplierTemplateId IS NULL) AND (OfficeId = @OfficeId OR OfficeId IS NULL) )
Monday, December 20. 2004
I just found this excellent beginner's tutorial to Regular Expressions. If you don't know what Regular Expressions are, or know what they are, but not how to use them, I strongly urge you to read the article. Your life will never be the same, well, at least your programming life.
Wednesday, December 1. 2004
When running a forum over time, alot of topics become "outdated". You want to keep them for historical reasons, but you are not really interested in people reviving them by replying to them. The answer to this problem is the Auto Lock MOD which I have made to solve this exact problem. After it is installed it is very easy to set up auto-locking. First you have to enable auto-locking on the board in general. This is done on the Configuration page: Then you have to set up auto-locking for each forum you want to automatically lock posts that have not been posted to in a certain time-frame: DownloadYou can donwload the MOD here InstallationYou can follow the instructions in the auto-lock-1.0.0em.txt file to install the MOD. The MOD is tested with EasyMOD so for your own convenience you should use that. Read how to use EasyMOD to install a MOD here.
Monday, November 29. 2004
I got a request from richey on the phpBB boards to add common replies to private messages as well as forum messages. Version 1.0.4 of my Common Replies MOD adds this functionality. You can download it here.
Friday, November 19. 2004
My Common Replies MOD finally (I was just being impatient) got validated. Here is the post to prove it.
Thursday, November 11. 2004
I have recently accquired a Digital Signature for accessing official Danish sites and for signing and encrypting e-mail. Today at work I helped a coworker with signing an ActiveX control, that made me consider if my personal digital signature could be used to sign code as well. When I came home I checked the advanced options of my digital signature, and Code Signing was among the certificate purposes: Okay, that was really cool. So now onto the details of actually signing the code. First I downloaded the Microsoft Authenticode Tools and extracted them to C:\Program Files\CodeSign. To sign an executable I would just need to run signcode.exe. I would however, need the a .cer file containing the public key of my digital signature and a .pvk file containing my private key. The issuer had disabled export to .cer includining the private key, so I had to find a different solution. From the issuers page it was possible to export the key (both public and private) to .pkcs12. Using the parts of the steps described on Matthew Jones' Page I got the .pkcs12 (which is the same as a .pfx file) converted to a .pem file and then finally to a .pvk file. To perform these steps you need OpenSSL for Windows and the PVK utility. To convert the .pfx file to .pem: openssl pkcs12 -in sune.pkcs12 -nocerts -nodes -out sune.pem
To convert the .pem file to .pvk: pvk -in sune.pem -topvk -out sune.pvk
Using the cert2spc.exe executable from the authenticode tools I turned my .cer file into a .spc file. Now I had everything to sign my first file (using Wise for Windows Installer): or from the command line: C:\Program Files\CodeSign>signcode.exe -spc sune.spc -v sune.pvk -n "Davina's GGS Timer" -i http://www.tanis.dk/Products/DavinasGGSTimer -t http://timestamp.verisign.com/scripts/timestamp.dll DavinasGGSTimerInst.exe
A quick compile and running chktrust.exe from the authenticode tools on my installer exe now gives me this result: I'll be signing my productions from now on.
Monday, November 1. 2004
The BackgroundWhen creating web service today, Web Service Interoperability is getting to be a bigger and bigger issue. There are a number of choices for the server platform, but the it is definately best if the client platform is not restricted in any way. We want everybody to be able to use our web service. WS-I is an organization working towards Web Service Interoperability "across platforms, operating systems, and programming languages". They have created some profiles that define a number of rules, that should ensure that your web service is interoperable. Ensuring that your web service complies to all these rules would, of course, be a monumental task, so there are ways to automate the actual testing, and that is what I am going to talk about today. Getting StartedFirst you need to download the WS-I's Testing Tools which can be found on this page. Since I am talking about Web Service Interoperability in the context of .NET you should get the C# version of the testing tools. Extract the zip file in the directory where you have your web WSDL file or files of your web service. It should be extracted to a subdirectory called wsi-test-tools. ConfigurationNow we need to create a configuration file for the testing tools, here is an example: <?xml version="1.0" encoding="utf-8"?> <configuration xmlns="http://www.ws-i.org/testing/2003/03/analyzerConfig/" xmlns:wsi-common="http://www.ws-i.org/testing/2003/03/common/" xmlns:uddi="urn://uddi-org/api_v2/"> <description>This file contains the WS-I testing configuration for WebService.</description> <verbose>true</verbose> <assertionResults type="all" messageEntry="true" assertionDescription="true" failureMessage="true" failureDetail="true"/> <reportFile replace="true" location="..\..\..\REPORT_WebService.xml"> <addStyleSheet href="wsi-test-tools\common\xsl\report.xsl" type="text/xsl" alternate="false"/> </reportFile> <testAssertionsFile>..\..\common\Profiles\BasicProfileTestAssertions.xml</testAssertionsFile> <wsdlReference> <wsdlElement type="binding" namespace="http://tanis.dk/2004/10/29/services.wsdl"></wsdlElement> <wsdlURI>..\..\..\..\WebService.wsdl</wsdlURI> <serviceLocation>http://tanis.dk/blog</serviceLocation> </wsdlReference> </configuration>
We also need a batch file to run the tests. It could look like this: @echo off cd wsi-test-tools\cs\bin Analyzer.exe -config ..\..\..\WebServiceConfig.xml cd ..\..\..
Running the testsAnd now we are ready to run our tests:
The outputAfter we have run the tests we have a nice viewable report that holds all the different test details, and what went wrong, if some of them failed. If everything goes well, this is what you should be seeing:
If there are any problems with the wsdl, it will show you so: 
The report contains a summary over all the different tests as defined, and it shows which ones passed or failed:
Further down in the report you can read a detailed description of each test. If they failed you will get an explanation why it failed:
ConclusionEnsuring Web Service Interoperability is not an easy task. There are lots of things to be aware of, but if you align yourself with a few good tools, it might just become easier. Just my two cents.
Sunday, October 31. 2004
I just fixed some more problems that were keeping the MOD from being approved at phpbb.com. Nothing too major, but a new released can be downloaded here.
Saturday, October 30. 2004
I just fixed a couple of problems that were keeping the MOD from being approved at phpbb.com. Nothing too major, but a new released can be downloaded here.
I have been a happy user of Eudora mail for my home email for years. It has always been an easy program to use and their recent addition of a pretty good junk filter has made it a e-mail client worth mentioning. I have recently acquired an X509 personal certificate for signing and encrypting mail and for authenticating myself with official Danish sites. So today I sat down thinking that it would be cool if I could sign my mails using this certificate. The system that is used to sign MIME based mail is called S/MIME (short for secure MIME), and to my utter surprise Eudora lacks any kind of support for using this. A little googling revealed that several plug-ins had existed for this, but they are all discontinued. I guess it is time for me to find a different email client if I want to digitally sign my messages.
Saturday, October 23. 2004
I have been customizing the excellent free forum system phpBB for almost two years. The modular design and the template system makes phpBB a very pleasent experience from a programming point of view. Although I have been making many different customizations for phpBB, I had yet to make an officially released MOD. So a couple of weeks back I decided that I would rework one of my current customizations into an actual MOD. The result is this MOD. The background for making this MOD is that when a community grows with several indiviuals every day, there are bound to be silly questions, wrong behavior, and, misplaced posts. Instead of getting a cramp from writing the same replies over and over, I have made this customization for phpBB. The basic idea is that you will have a list of common replies readily available when you are both reading posts and when you are replying to a post. The common replies are tied to the phpBB group system. You can define a list of common replies that will be available to the members of the group (i.e. moderators) and you can also allow the group members to define their own custom common replies. Furthermore it is possible to set up footers for both BBCode-enabled messages and for plain text messages. Both the allowed number of custom common replies and the footers are set up under the group that you want this functionality available to. To set up the list of common replies tied to the group, click the Canned Messages link the administration interface. DownloadYou can download the MOD here. InstallationYou can follow the instructions in the common-replies-1.0.0em.txt file to install the MOD. The MOD is tested with EasyMOD so for your own convenience you should use that. Read how to use EasyMOD to install a MOD here. DemoIf you would like to see a live demo of the system, it is available here. Username/password: demo/demo.
|