Archive for November 2008

 
 

Euro conversion rate feed

I came across this while searching for a good currency conversion feed or web-service for Clickini earlier this year.

It’s probably useful in your project too:
http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml

The European Central Bank updates it once a day (hence, daily) at 14:15 CET (currently GMT +1).

Besides this, they also provide a history since 1999 and various other formats (PDF, CSV and iPhone). Who knows what you can use that for.

Any alternatives?

Finally

Finally. May this be the beginning of common sense.

If Guy Kawasaki (yes, the one from the motorcycles) states:

Focus on function, not form. Mea culpa: I love good form. MacBooks, Audis, Graf skates, and Breitling watches.

maybe others will follow and finally wake up.

Read the rest of his post about bootstrapping here.

Convert Word document to PDF

I always assumed installing Adobe Acrobat was by far the best way to print a Word or Excel document to PDF.

While Acrobat has indeed its advantages, certainly over web-based services like Doc2PDF online, it does have a moderate price tag if you use it only for this purpose.

Because I recently experienced hyperlinks would not be converted properly when printing a Word document as PDF with Acrobat, I decided to look for a dedicated “print to PDF” Office plug-in.

I was surprised: apparently Microsoft initially intended to have a “save as PDF” feature available in Office 2007 by default (a big step for them!). Of course Adobe wasn’t happy with that and forced them to remove it immediately.

Luckily Microsoft has made it freely available as an Office 2007 add-on.

This made me happy as hyperlinks are now properly converted.

Effects of the Global Economic Crisis on Small Businesses

Because even the current president of the United States has heard of the economic crisis, I felt the need to hold a small survey with Belgian customers/colleagues/friends about their vision on what is currently happening.

While it is probably still too early to see significant effects, it’s nice to know what entrepreneurs with a similar activity think and experience.

15 people, all self-employed and active in ICT, send in their responses within the first 3 weeks of November. 5 of them are consultants with a limited amount of clients, while 10 run a company with a larger amount of customers. Because it is difficult to compare their experiences directly, I’ve split up the results:

Feedback of ICT companies on the current economic turmoil.

While the larger companies in this group tend to have a better planned long term vision and the smaller ones state to have none, they do not notice a change in their own business nor act pro-actively. A fairly large part of them notices some effect on their clients. Some doubt about hiring new staff, while others think this is the best moment to do so.

Feedback of ICT consultants on the current economic turmoil.

Although the low amount of participants makes it difficult to conclude anything, the result is aligned with companies with a larger amount of customers. Consultants receive a large part of their income from fixed budget projects and thus are not affected immediately. They also state to never plan ahead more than one year. Their clients, outsourcing companies, expect to see major changes around mid Q1 2009 when the current budgets will be replaced with (less) new ones.

I want express my gratitude to the brief and useful answers that were provided. Thank you all!

Please do not feel offended if I forgot to contact you, but do so if you didn’t answer. Shame on you!

I hope you found this useful: please let me know.

Ext JS available via CDN

As many JavaScript libraries relied on Google or AOL, Ext JS didn’t have a CDN.

Until now: they have partnered with CacheFly.

If you, for instance, need the complete library, use:

  • http://extjs.cachefly.net/ext-2.2/ext-all.js
  • http://extjs.cachefly.net/ext-2.2/resources/css/ext-all.css

This is great. Ext JS can be one of the bigger libraries (even minified & packed).

Speed up Zend Framework

The performance of frameworks has always been subject to discussion and Zend Framework is no exception.

But with the release of version 1.7 an appendix has been added to the manual with guidelines to improve performance.

Most notably:

  • How to optimize your include path (even if it is in your vhost conf).
  • Do not use XML translation formats if possible and certainly use caching for these framework parts.
  • Different techniques to improve view rendering.

Read the complete appendix for a detailed explanation.

Zend Framework SVN authentication

This morning I received SVN authentication requests all over the place. Total panic! I suddenly feel the need to withdraw all my savings.

Ok, I’m exaggerating (just a bit), but it’s no fun if your release scripts are failing because your Zend Framework svn:externals suddenly requires authentication.

Apparently they changed that overnight (for us Europeans) as it worked yesterday. Let’s hope it’s a mistake and they don’t change their policy all of a sudden!

I just love svn:externals…

Edit: and we’re back on the road!

Language specific tables in MySQL

Since a large part of the world doesn’t care about i18n and L10n, remarkably little articles on best practices are available about these topics.

If you live in a multilingual country however, you can’t build an application without. For a recent project I was looking at a way to avoid language specific tables (it goes without saying language specific fields are not an option either!).

Since we all like to keep our data as clean as possible, I have created my language specific tables like this example:

CREATE TABLE IF NOT EXISTS `country` (
  `code` char(2) NOT NULL,
  `language` char(2) NOT NULL default 'en',
  `name` varchar(100) NOT NULL,
  PRIMARY KEY  (`code`,`language`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

A sample country table with the ISO code as identifier, a language ISO code and the country name in that specific language. Notice that code and language form the composed primary key. In a multi-table set-up you would probably have a country table and a country_language table. Although this solution looks so much cleaner it creates a challenge when it comes to querying.

Imagine you would have these records:

DE,en,Germany
DE,de,Deutschland
DE,fr,Allemagne
US,en,United States
US,fr,Étas-Unis

and you want to get a list of countries for a German audience.

Since much data in these kinds of tables won’t be translated into all possible languages (which is the case for German in this example), you will probably want to settle for a default language if German is not available: let’s say English in this case.

Basically you want to have a result with Deutschland and United States. After some thought, this query is my best bet:

SELECT IFNULL(language_set.`code`, default_set.`code`) AS 'code',
  IFNULL(language_set.`language`, default_set.`language`) AS 'language',
  IFNULL(language_set.`name`, default_set.`name`) AS 'name'
FROM `country` AS default_set
LEFT OUTER JOIN `country` AS language_set
  ON default_set.`code` = language_set.`code`
  AND language_set.`language` = 'de'
WHERE default_set.`language` = 'en'

This creates a set of German data joined by English data if German is not available. Since MySQL supports sub-queries for some time, you can use this set as a sub-query in any larger query. In my project I’ve put this default query in each language-based model for re-use in larger queries. For example:

$sql = "SELECT DISTINCT country.*
  FROM (" . $completeSet . ") AS 'country'
  INNER JOIN other_table ON country.`code` = other_table.`country_code`
  ORDER BY country.`name`";

This would query all countries that have records in other_table.

Until now, I haven’t found a situation where this could not be used. I don’t guarantee that there isn’t one though. Any improvements are highly appreciated!