Blog Categories
Ad Space
Twitter Updates
Powered by Squarespace
Git Projects
Sunday
23Nov

My CouchDBX version

Hey people.

I have been playing with Jan's CouchDBX a bit and thought someone might enjoy what I did. CouchDBX is a nice little Mac OS X tool to run CouchDB without the need to set up Erlang or anything.

There are 3 major changes that I did. First of the UI is gone and everything is now in a status bar menu. Should make for quicker access to it and also stay out of the way. There is also a new transparent log window if you need to see what is happening on the Erlang level. The third an most important change is that CouchDBX now stores it's database in ~/Documents/CouchDB. Before the database was inside the Application bundle itself and all the data disappeared every time you downloaded a new release of CouchDBX.

I have not renamed it or anything in case Jan would like to incorporate these changes to the original code or something.

EDIT 26. Nov: There was a serious error in my old version that made the javascript engine not run correctly. This has now been fixed and you need to redownload.

CouchDBX Screenshot


Saturday
22Nov

Why do you dislike me Apple?

Dear Apple. I am a loyal customer of Apple product. Out of my top 10 favourite things I own propably 6 of them are from Apple. You make some the greatest products available today. Your attention to detail and ease of use is legendary. So it makes me wonder why in the world you dislike me so much.

I have myself an iPod Touch. And even though you have allowed me to buy it you have deemed me not worthy of using it. You have decided that I should not be allowed to run 3rd party applications on it since my country (Iceland) is not worthy of the holy iTunes store. You have also deemed me not worthy of upgrading it for the same reason. I am not even worthy of developing applications for it since I don't live in the list of countries approved for iPod/iPhone development. And I just must ask you why?

I also have the Apple TV which you allowed me to buy. And again I was allowed to buy it just not use it. I'm not allowed to rent or buy movies. Why? I'm allowed to buy music and movies from Amazon or any other store and have it shipped to me. Suddenly when it's in digital form it's like it's a crime for me to shop it? What gives. And as many Apple TV owners I have installed Boxee to it so I can enjoy some extra features. But you have decided that is not allowed and in your latest update you removed it??!?!? This seems to be on purpouse this time and not some accidental breakage because of things you needed to update. It seems to me like you decided to remove it. And what gives you the right to enter my computer and remove things. I know for a fact that AppleTV is just a Mac Mini with Tiger and an app runnin full screen. I sometimes see glimpses of the window border and the close/minimize/zoom buttons. This is in no way different than if you would use your software update to remove competitor software like Microsoft Office on my iMac. How is this ok? And why would you do that to begin with? It's not like Boxee is in competition with you. I still use Apple TV's built in media player.

I know that the reason for why I'm not allowed to use the iTunes store is because of requirements from the record companies. But let me remind you that it is illegal for you to shut me out of it. It is actually 100% illegal for you to deny me shopping on the Danish iTunes store. I'm not kidding you check with your legal team. Europe is one big economic area and according to European laws I am allowed to shop in any European country and I should pay the same price + shipping and handling. So even though the record companies asked you it does not make it less of a crime. If laws have any meaning to you open up my access to the store. You know that sooner or later someone will force you to do that and force you to pay fines while doing that. So why not just do it now?

So please Apple. Stop hating me.

Regards. A Loyal Customer.


Friday
21Nov

A knock knock joke

Just a quick one in the morning.

-module(knockknock).
-compile(export_all).

start_joke() ->
    register(person_1, erlang:spawn(knockknock, person1, [])),
    register(person_2, erlang:spawn(knockknock, person2, [])),
    person_1 ! start_joke.

relay(Person, Message) ->
    io:format("------- ~p -------~n", [Message]),
    Person ! Message.

person1() ->
    receive 
        start_joke ->
            relay(person_2, "Knock, Knock");
        "Who's There?" ->
            timer:sleep(100000),
            relay(person_2, "Java")
    end,
    person1().

person2() ->
    receive
        "Knock, Knock" ->
            relay(person_1, "Who's There?");
        "Java" ->
            relay(person_1, "Ha Ha")
    end,
    person2().

Thursday
13Nov

Adding Erlang library locations

When adding Erlang libraries there are a few possible ways. The easy way is to add the libraries into the directory /usr/local/lib/erlang/lib. All directories there will be added to the library paths by default. The problem with that is that I don't like mixing 3rd party libraries with the core libraries.

Enter the ERL_LIBS environment variable. Set that to a directory and all the subdirectories of it that include code will the added automatically to the code path. To add it open up the file /etc/bashrc and add the following:

ERL_LIBS=/Library/Erlang/lib
if [ -d $HOME/Library/Erlang/lib ]; then
  ERL_LIBS=$HOME/Library/Erlang/lib:$ERL_LIBS
fi
export ERL_LIBS

This way all libraries under /Library/Erlang/lib and /Users/JoeUser/Library/Erlang/lib will be added to Erlangs code paths. The libraries will be in priority before the system libraries but after the -pa code paths. Now you can add things like Mochiweb, Eunit, Nitrogen and more under the /Library/Erlang/lib directory.

You could also put this in the file /usr/local/bin/erl


Saturday
01Nov

Contact List using SproutCore, Mochiweb and Mnesia

Here is an example program using a SproutCore frontend talking to an Erlang backend using the ReST protocol.

Lets start by creating the Sproutcore application. I will not go into detail into the Sproutcore code as JavaScript and Sprutcore are way beyond a single tutorial.

sc-init mochi_contacts
cd mochi_contacts

Click to read more ...