Steve Jobs gives a commencement speech at Stanford. He tells few short stories from his life and describes how little things made all the difference in his life. Worth listening to! When I was 17 I read a quote that went something like “If you live each day as if it was your last, someday […]
I was upgrading some old page with new CMS that supported nice and friendly URLs. I didn’t want to loose all those precious links to page content so I tried to make redirects with .htaccess. As I soon realized this is not so trivial as I thought. My old links were dynamic like “index.php?id=12”. If […]
I’ve to import 1GB MySql dump file today. It was the biggest MySql dump I’ve ever worked with and it gave me a bit of problems before I managed to imported it on my development platform. phpMyAdmin is unsuitable for this kind of tasks and other Windows GUI tools I have for dealing with MySql […]
I assume you know the difference between class and an object. If not, read this! A static method is basically the same as a non-static, but there is one difference: a static method is accessible without needing an instantiation of the class. Because you access a static element via a class and not an instance, […]
I use NLB (Nova Ljubljanska Banka) and I wanted to import data to Quicken. The problem was, that NLB only supports QIF or CVS export and Quicken only supports limited QIF import. When I looked more deeply I found out that the problem occurs because of the date format. NLB exports date as DD.MM.YYYY andQuicken […]
Zend offers different logging possibilities. I won’t present them all. The basic of logging possibilities is Zend_Log_Writer_Db which logs in database. By default there are timestamp, message, priority andpriorityName entries. If you want to log your own entry that is you want some custom fields to be logged you have to deal with event array. […]
Imagination is more important than knowledge is a famous quote by Albert Einstein. I’ve always agreed. One that has imagination can learn. But you can never learn imagination by traditional methods. Just the opposite! Traditional methods kill creativity and they kill imagination! Yesterday I’ve stumbled upon a video of Sir Ken Robinson talking about this […]
PHP way PHP uses unix timestamps for all its date functionality. Functions to format and convert this timestamps are available. Timestamp is simply an unsigned integer – itâ€™s the number of seconds that have elapsed since midnight on January 1st 1970 (greenwich mean time). MySQL way MySQL has three date types for use in columns. […]
%inserts X to a custom position in list and returns BL
Bookies wants to take some bets and of course they want to make profit with it. All they have are latest results from friendly matches.Predicate win(Team1, Team2, Result) means that the first team won the match with the Result. Initial knowledge database
win(portugal, saudi_arabia, 3-0).
win(mexico, paraguay, 2-1).f
win(mexico, congo, 2-1).
win(argentina, portugal, 3-2).
win(mexico, gana, 1-0).
win(portugal, croatia, 2-0).
win(netherlands, ivory_coast, 3-1).
win(argentina, hungary, 2-1).
win(netherlands, ecuador, 1-0).
win(portugal, egypt, 2-0).
win(croatia, argentina, 3-2).
win(ivory_coast, slovenia, 3-0).
win(south_corea, mexico, 1-0).
win(netherlands, mexico, 2-1).
Predicate to return difference between points Write predicate gd(Team, GD) that returns […]