CSS Background not showing in IE

Posted by Michael Hendrickx on December 08, 2009
misc / No Comments

I searched for a while, and could not find out why places.ae wasn’t showing it’s background in IE, but it was showing it in Firefox (didn’t check other browsers).

Apparently, I had a “mistake” in my CSS files, and IE seem to trap more on this than firefox. I had the following line:


#city{ background:url(http://img.places.ae/p2bg.jpg)repeat-x scroll left top; width:100%; height:208px;}

And the missing space aftedr the url() parameter, prevented IE from showing the background. Just a quick tip in case you run into the same problems.

Tags: , ,

7days bashes on Linux, should stick to normal gossip

Posted by Michael Hendrickx on November 20, 2009
misc / No Comments

7days recently published an article about Valerie Singleton who created a PC for the elderly.

It was a well written, objective article until statements were made which wasn’t researched enough:

The computer runs on Linux – an operating system of such bewildering complexity to anyone outside its inner circle that trained IT experts have been known to weep in frustration at the process of installing a simple programme.

The reason? Linux has so many incarnations that software often has to be manually modified at the time of installation. That means coding. Yep, amateur programming. Scary, huh? Especially if you’re 82 and you’ve never used a computer before.

“Software” to be manually modified during installation is usually done when you set up services, such as dhcpd, sendmail and bind Let’s assume that a 82 year old will not install their own mailserver, or domain. From a Windows point of view, I doubt that many elderly will install a Windows Active Directory at home also. I would recommend Paddy Smith (the article author) not to mix up Interface and internal workings.

It’s like running a car, driving a car (the interface) is relatively easy, especially if it’s an automatic transmission. Start the car, put the transmission in “D” and push the right pedal. A car’s inner workings is a combination of electronics, air/fuel mixes, precise timed ignitions, and a lot more.

You don’t need a wrench to drive a car.
You don’t need to do coding to run an operating system.

I wish that topics highlighted in 7 Days’ articles were well researched before making statements.

In my eyes, Linux interfaces could be very easy for the young, or the elderly. On the EEE PC, Asus could get their Linux interface pretty right, I’m sure the “inner workings” were done by their IT geeks.
asuslinux

Tags: , ,

Ban Ki Moon is now into 419 scams

Posted by Michael Hendrickx on November 20, 2009
misc / No Comments

un2009
It seems that the United Nations is reserving 500.000 USD and I’m one of the 10 lucky ones to receive it. ;)

It’s the all old 419 scams, all over again. Just wrapped into a JPG image, and using trusted names.

Some things will never change,

Your mobile number has been awarded 430,000.00 Pounds

Posted by Michael Hendrickx on November 06, 2009
misc / 4 Comments
------ SMS ------
From: +22996713827
Sent: Nov 5, 2009 9:54 PM
Subject: (NOKIA PROMO)

(NOKIA PROMO)
Your mobile number has been awarded 430,000.00 Pounds.
Your REF Number is ML10002BN. To claim, email: info@nokiapromo.in
and call +447024084530

The only cool thing is that this SMS was sent from a number in Benin, which has a TLD that says “.bj”. yay.

Tags:

Dubai Twestival 2009 #2

Posted by Michael Hendrickx on September 12, 2009
misc / No Comments

twestival
Hi all,
Just got back from the second Dubai Twestival that took place today at 8 PM. Organized by a wonderful team (PK, Woo, esperanca, Stephanie and Baher and Abhamalpani – please let me know who I missed), it was a success.

Thanks all,
Michael

Tags: , , ,

Find “similar things” in Ruby

Posted by Michael Hendrickx on August 29, 2009
code / No Comments

rubyFor several Ruby on Rails projects I had to come up with “similar” results. These are often results (video’s, products,places, hobbies, etc) with the greatest number of tags.

Say, you are tagging car pictures on a website, and have the following:

image1.jpg -> ["honda","s2000","convertible","black"]
image2.jpg -> ["honda","civic","blue"]
image3.jpg -> ["lexus","is300","blue"]
image4.jpg -> ["s2000","honda","convertible","silver"]
image5.jpg -> ["toyota","starlet","black"]

Seeing this, you’d know that image1.jpg and image4.jpg are similar pictures. Or rather “more similar” than , say, image1.jpg and image3.jpg. For this, I wrote below snippet of code. This goes in the model file, and can be called as “object.similar”. It returns an array of similar “things”, sorted on most similar to less similar (hence the results.reverse at the end)

For example:

  img = Image.find(params[:id])
  @similar_images = img.similar[0..10]

Will give you the 10 “most similar” images as img. Well, it gives you the files with the most similar tags.

def similar
  tags = self.tags
  results = []
  tags.each do |tag|
    results = results + tag.pictures # or tag.things, tag.products, ...
    results.delete(self)
  end

  # make array into hash
  h = Hash.new
  results.each do |r|
    h[r] = h[r].to_i + 1
  end

  # sort on values
  tmp = h.sort {|a,b| a[1]<=>b[1]}
  results = []
  tmp.each do |t|
    results << t[0]
  end

  results.reverse # return all items, products, ...
end

This was written for a new project coming up, and will be used to do better "similarities matching" for places.ae, though for the latter we also had to sort on distance. (For it's vicinity)

Tags: , , , ,

Starting a UAE business now 40.000 USD cheaper

Posted by Michael Hendrickx on August 12, 2009
misc / 2 Comments

bulbGulfnews tells us that those who are willing to start a business (LLC, Limited liability company), do not have to cough op the 150.000 AED (40.000 USD). With the current economic situation, this is not a bad step at all.

More than 80 % of businesses in the UAE are LLC’s, so it’s a good step. Often, entrepreneurs were put off by setting up a business in the UAE, because of it’s rules and monetary requirements.

I hope this will result in a growth of entrepreneurship in the UAE.

Etisalat’s spyware patch – funny video

Posted by Michael Hendrickx on August 02, 2009
misc / No Comments

Catboy, a radio DJ at Dubai 92, released a funny video on Etisalat’s spyware patch for Blackberries. (more here, here and here)

Simply awesome.

Are web frameworks really worth it?

Posted by Michael Hendrickx on July 27, 2009
misc / 1 Comment

railsAs places.ae is maturing to it’s 500 days being online and growing… It’s also awfully painstaking how cumbersome a framework (it’s written in Ruby on Rails) can be. Agreed, I am not the most seasoned rails programmer, and my ruby code sometimes makes people cry, but still. Note that this rant is about web based frameworks, though it might apply in other environments also.

Web developments Frameworks have one main advantage: it’s a framework. You don’t have to write 90% of your code anymore. If you want user-login-forgot-password functionality, or a nice captcha, you often only has to enable one module, et voila, you’re rolling. Great to advocate so-called agile development. I wrote a audit tracking tool (points raised in a systems audit and outlining their risks) at work in Rails in a few hours, needless to say, it was impressive.

The downside of a framework is that it is a framework, you are bound by it’s rules and bend yourself often to make it work.

The first 90% of your applications gets done in 10% of the time, and you’ll be debugging for the remaining 90%. As said, it’s my personal opinion as a non full fledged rails guy, but a project that matures over time seems to give problems with frameworks. (Database migrations tend not to work well in the/my real world)

Sorry just a rant. It’s 3 AM, and these migrations are driving me up the wall, to an extend that I downloaded MDB2 and smarty, and am assessing how long a rewrite would take.

Good night,
Michael

Tar based incremental backups

Posted by Michael Hendrickx on July 01, 2009
code, sysadmin / No Comments

A small bash script I wrote to have incremental backups done on a unix server, and then pushed to a Windows File system. On the fileserver, we add this directory to the normal backup.

This is on a mail server, where emails are stored in MailDir format. We create weekly full backups on sunday, and daily incremental. This script is called daily at night from a cron job. Gotta love the scripting abilities of bash.

It might help you out, so here goes:

#!/bin/bash
# backup script is doing following items
# dump all incremental email into a backup file, gzip the backup file and
# move the file to an external file server

START_TIME=`/bin/date`
echo "backup started at: ${START_TIME}"

DOW_N=`/bin/date +"%w"` # number, 0 (sun), 1 (mon)
DOW_T=`/bin/date +"%F"`

TO_BACKUP="/opt/maildata/"
TEMP_FILE="/tmp/${DOW_T}_mail_backup.tar"
BACKUP_LOG="/tmp/mail.backup"
FILE_SERVER="/mnt/fileserver/" # mounted over SMB

# if it's a sunday, delete the incremental file and take a full backup
if [ ${DOW_N} -eq "0" ]; then
  /bin/rm ${BACKUP_LOG}
fi

/bin/tar -c -f ${TEMP_FILE} --listed-incremental=${BACKUP_LOG} ${TO_BACKUP}
/bin/gzip -f ${TEMP_FILE}
FILE_SIZE=`/bin/ls -lah ${TEMP_FILE}.gz | awk '{ print $5 }'`
/bin/mv ${TEMP_FILE}.gz ${FILE_SERVER}

## report, this goes in an email through cron
END_TIME=`/bin/date`; export END_TIME
echo "backup ended at: ${END_TIME}"
echo "data moved: ${FILE_SIZE}"