Static methods and properties

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, […]

repair QIF format

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 […]

Date and time with PHP and MySQL

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. […]

Prolog example – bookies exercise

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

Predicate to return difference between points Write predicate gd(Team, GD) that returns […]