Wednesday, March 25, 2009 

Deioces

The following story by Herodotus reminds me so much of current politics.

According to Herodotus, the Medes lived independently (autonomon) in scattered villages after they won their freedom from the Assyrians. Ambitious to unite the Medes under his rule, Deioces set about gaining a reputation for honesty. The men in his village grew to trust him and invited him to settle their disputes. As his reputation grew, more and more people submitted their disputes to him until he finally declared he had had enough and would judge no more lawsuits. His withdrawal plunged the country into lawlessness (anomia) and forced the Medes to make him king. Once in office, Deioces demanded that his subjects build him a vast palace at Ecbatana. When the palace was complete, Deioces remained inside to keep himself safe from plots and communicated with his people through messengers. He continued to judge lawsuits, but all cases were now submitted to him in writing so that he could keep his distance from the people.


excerpt from "Solon of Athens New Historical and Philological Approaches", Mnemosyne, Supplements, 272, Brill Publishing, 2006

Tuesday, February 10, 2009 

Building a Personal Filtered RSS Reader with Oracle XE and Apatar - Part 2

This is the second part of my post about building an RSS Reader with Oracle and Apatar. If you have all the prerequisites mentioned in the previous post in place, let's proceed with the database schema. It is actually just one table:

CREATE TABLE "FEEDHUB" (
"POSTDATE" DATE NOT NULL,
"TITLE" VARCHAR2(512 CHAR),
"SCORE" NUMBER, --the feedhub score of the post or null
"URL" VARCHAR2(1000 CHAR) NOT NULL,
"POSTRANK" NUMBER, --the postrank score of the post or null
"AUTO_ID" NUMBER,
CONSTRAINT "FEEDHUB_PK" PRIMARY KEY ("URL")
)


It combines both my Feedhub and Postrank feeds. This is enough to define the Apatar transformations which will load RSS posts into the table automatically.

Next start Apatar, modify this transformation with your feeds and database connection, and you are good to go. Each run will load the new rss entries into the database. You can also create a nice and quick web interface by using Oracle APEX. This is beyond the scope of this post, but it is really easy and should take about 20 minutes.

p.s. You can always achieve the same without installing any software - just use Yahoo Pipes.


Saturday, January 24, 2009 

The dumbest way to copy a file to a USB stick

Let me describe my experience from last night where I had to download a 400MB file and copy it to a USB stick. This is one of the dumbest things I've ever done on a computer. Do not repeat it at home.

Step 1. (Mid-morning) I found out that the file I want is 400 MB. I do not want to just go and download it because this will eat all the bandwidth and the other people sharing my Internet connection will be extremely frustrated. I have to shape my connection. Well, I was running Windows and I don't know how to do this on Windows so I fired up Virtualbox where I have a Debian virtual machine (VM). I shape eth0 to 24KB and am good to go.

Step 2. (Late afternoon) I remembered my download - the file is there. It has to go to the USB stick. After two minutes I am cursing Virtualbox for making it so difficult to connect a USB device. After another 3 minutes and 2 restarts of the VM I give up.

Step 3. (One cigarette later) I set up the USB stick as a shared folder in Virtualbox. Then "modprobe vboxfs" and mount it... Now I have access to my stick from within VM. I start copying the file...................... A minute later I understand my mistake, the speed of transfer is 150 KB/s, on average. I curse... in Serbian :)

Step 4. (Evening) It is already dark outside. The file is on the USB stick. Finally. I test it - it opens from Windows. I carefully unmount everything, bag the stick and go.

Step 5. (Next morning, at home) I try to open the USB stick on my laptop. Vista says it wants to format it. I curse Vista.

Step 6. (At the office) My PC at last! Debian, no VMs. I insert the USB stick. Nothing happens. fsck.vfat says it's bad, the partition table is corrupted. I try for an hour to copy (dd) the contents somewhere so I can mount it on the loopback and eventually fdisk in. Nope. I curse my stupidity...

As I said don't try this at home.

Monday, January 19, 2009 

Automated Game Design

A very interesting post in togelius explores the concepts of automated game design. The novel concept here is that it proposes a learning algorithm to be used as a fitness function for the generated games.
Somewhat more technically, our fitness function proceeds in two stages: first it tries to play the game using only random actions. If a random player can win a the game, the ruleset (=the game) is assigned a negative fitness. Otherwise, an evolutionary algorithm is used to try to learn a neural network that plays the game (using the score of the game as fitness function). The fitness of the game then becomes the best fitness found by the "inner" evolutionary algorithm after a certain number of generations.
There are also other interesting resources on this topic like this article, or this older one which explores the automatic generation of dungeons for computer games.

Sunday, January 18, 2009 

Building a Personal Filtered RSS Reader with Oracle XE and Apatar

Today I will show you how to build a personal, filtered, web-based RSS reader with free tools and no programming (except simple SQL). I will not go into too many details so that you can have fun experimenting with the tools. Before we start you will need:
  1. A list of the URLs of your favorite feeds - the more the better because we will be filtering the content. High-profile, popular RSS feeds will work better with the filtering I propose. OPML format will be best.
  2. Oracle XE - it's free to use. You might also want to install Oracle SQL Developer - it will make developing databases easier.
  3. Apatar - This is a FOSS ETL tool which we will use to transform the RSS feed items and automatically import them in the database.
In order to have filtering you should use the Feedhub , Postrank or Feedscrub services. In my example I used the first two. Please note that Feedhub and Feedscrub need some "training" in order to work well. After you've registered for these services import your feed list in them and get the URLs of the personalized RSS feeds they provide. You will need those shortly.

In the next post we will create the database and Apatar transformations.

Tuesday, December 16, 2008 

Fun with Oracle and the Dow Jones

I have written an article describing my explorations in the world of Oracle. I actually started learning Oracle two days before I wrote this article. So if you find that some of the things in it are not done in the best way, you can leave a comment. Before starting you will need of course an Oracle server. You can get the free version - Oracle XE. You might also want to install Oracle SQL Developer. A good knowledge of general SQL is also necessary.

The main question I explore is can we use Oracle to tell us when the financial crisis started?


p.s. Of course, the PostgreSQL fans can try and repeat the steps from the article in PostgreSQL, you will need 8.4dev though in order to use the analytical functions support.

p.s. PostgreSQL fans are actually out of luck, because the implementation of analytical functions does not allow for arbitrary ranges...

Sunday, September 07, 2008 

Google's newsest patent

Google has patented a floating platform-mounted computer data center:

A system includes a floating platform-mounted computer data center comprising a plurality of computing units, a sea-based electrical generator in electrical connection with the plurality of computing units, and one or more sea-water cooling units for providing cooling to the plurality of computing units.