Upgrading and setting up the computer for recording

This week I spent two days upgrading the computer with Windows 10 and a new SSD drive.

Step 1 – A new clean install of Windows 7

For a quite some time I’ve been wanting to entirely re-install my computer. It had gotten slow, occasionally not booting and felt unstable. Finally I got the time for some computer housekeeping.


Computer’s mental state

I formatted the new drive and re-installed Windows 7. Upgrading to Windows 10 for free, requires you to possess a Windows 7 or 8 version.

I imagined that re-installing Windows 7 would be a simple and quick thing to do. But I forgot the vast amount of updates it needs to install. (Windows 7 was apparently released 2009). It took pretty much the whole night to download/install patches and service paks. It doesn’t really help that the updating procedure in Windows is painfully slow compared to Linux or OSX.

Step 2 – Upgrading 7 to 10


Upgrading to Windows 10 went fairly quick apart from that my on-board network adapter wasn’t supported, so I needed to find a driver for it.

Windows 10 and privacy settings
Soon after the installation was complete, I had to go through all the privacy options. Windows 10 is really eager monitor your daily activities and your data in order to better suggest ads, tips and other things via Cortana. (Cortana is the “Siri” for Windows users.)
Collecting data about their users is something that Apple and Google already are doing. However it is a bit frightening that Windows 10 soon will be used daily in the public sector and governmental organisations, due to the fact that it monitors who your contacts are, who you are, what you type on your keyboard and what data you access/work with…
Is privacy for the individual officially dead? Did they win?

For privacy concerns and tips on what to disable, check this video out:

I am using the operating system in order to run my programs, code and record music. It would be a dream to have a lightweight Windows edition without all the “crayons”. I’m really not interested in a news, weather or messaging app on my desktop. I value each byte of resource the OS can give me, in order to run the programs I prefer to use. Too bad I have a hard time abandoning Windows since my audio interface at the moment only supports OSX and Windows.

After removing all the “extras”, I feel it’s actually a quite nice Windows edition (except privacy intrusion part). It feels quicker than Windows 7, and I like the new design (if you compare it to Windows 8). Even though it still takes some time to find some settings. Since laptops are more used than desktops today the battery life is important. So Windows will by default conserve power by putting disks, usb hubs on standby mode. When recording music it’s a good idea to turn these “sleeping” functions off.

The good parts of Windows 10:

  • Quick, responsive and stable
  • No metro screen
  • A fairly minimized look and feel (after disabling some elements)

The less good parts of Windows 10:

  • A lot of privacy options to disable
  • Still unknown what of your data is sent to Microsoft and parties.
  • Configuration is hidden
  • Monitors your activities

Step 3 – Installing Reaper and Superior Drummer 2


Windows 10 automatically found my audio interface Roland Quad Capture (UA-55) and installed it. Reaper is always a graceful experience. 10Mb download and install. Done!

I recently got Superior Drummer 2 from Toontrack together with Metal Foundary SXD. It’s a massive library of different drum samples, 10 DVD’s to install. It has all the possibilities to create a great drum sound for what ever music style you want. Although it’s a bit of a double-edged sword. The more options you have, the more complex the product gets to use.


I think the upgrade to Windows 10 and a new SSD drive made a bit of a difference. I believe it’s healthy to once in a while do a complete re-install and try something new.

A lot is new on the surface in Windows 10 (hey the start menu is back).  However, underneath the make-up I believe there aren’t that many improvements from Windows 7. So at the moment there are no real advantages to upgrade your Windows 7 if your happy with it. I also hope that everyone knows that a solid state drive is the cheapest and most effective way to make your computer feel and run faster.

Posted in Other, Recording and mixing Tagged with: , , , ,

My timeline of text editors

I’ve been coding on and off since the beginning of the 90’s and along this journey I’ve been stumbling over quite a few editors and IDE:s. In this post I will go through some of them. It’s a selection of editors I either very much enjoyed working in or hated with a burning passion. I very much doubt that anyone might find this interesting or useful, but it’s sometimes nice to walk down memory lane.

Edlin (1980) (DOS)


Edlin.exe – Line editor, very archaic.

Edlin was the very first text file editor I used. Since it was shipped with MS-DOS 3.30 it was the only editor on the early PC’s DOS era. You could only edit one line at the time. It was all-right if you needed to tweak the autoexec.bat and config.sys, but to write anything complex and large would be unthinkable. If I wasn’t such a persisting child, edlin would probably had me losing my interests in computers.

What I like(d) about Edlin:

  • Nice with a bundled editor in DOS.

What I dislike(d):

  • Too bad the bundled editor was Edlin.
  • Unusable

What I use(d) it for:

  • Editting autoexec.bat and config.sys

More about Edlin on Wikipedia

MS Editor (1991) (DOS)


MS Editor – Capable editor for its time.

MS Editor was a huge step up from Edlin with menus, search/replace, copy/paste functions and pretty easy to edit large files. What many people doesn’t know is that edit.com was actually the QBasic editor but stripped down. Edit became a proper standalone product with MS-DOS 6. I mainly used Edit for editing batch files in DOS. I would actually say that this editor was much better than Notepad we got with MS-Windows.

What I like(d) about MS Editor:

  • Copy, Paste, Search, Replace, multiple buffers

What I dislike(d):

  • Not much, extremely simple, no features for coding.

What I use(d) it for:

  • Editing batch files
  • Reading text files
  • Writing text files

Read more about the MS Editor on Wikipedia

QuickBASIC (1985) (DOS)


Quick Basic – The first IDE I used. You can see the resemblance to MS Editor.

In the beginning it was BASIC. As a kid this was the first programming language I came across. Me and my younger brother wrote an endless amount of small text games and some programs that painted some graphics on the screen. The difference from QBasic was that on Quick Basic you could compile your BASIC source code to executables and show them on a friends computer.

What I like(d) about Quick Basic:

  • Multiple buffers, Debugger

What I dislike(d):

  • Syntax highlightning

What I use(d) it for:

  • Writing programs and games in Basic

Read more about QuickBASIC on Wikipedia

Turbo C++ 3.0 (1991) (DOS)


My first attempts in C++ were made in this IDE


My passion for writing text games didn’t seem to end. At this time I’d discovered MUD games. Which are the uninitiated a type of text multi-player games with monsters, quest and parties. Imagine it as a MMORPG in pure text. This made me start to write text games in Turbo C++. The result must have been the weirdest C++ code anyone ever seen, but I really enjoyed it. The IDE was very easy to understand and use.

What I like(d) about Turbo C++ 3.0:

  • Simple, multiple buffers, search / replace, project based
  • Easy to use with compilation and debugging

What I dislike(d):

  • Not much at all,

What I use(d) it for:

  • Learning C++
  • Writing programs

Notepad (1985) (Windows 1 and forward)


Notepad and me was responsible for my first homepage.

Everyone has tried to write some kind of script code in this editor. I actually think I made my first webpage in notepad. But it really is a crappy editor. I don’t know how many times people has edited “nice formatted” XML data in notepad in UTF8, saved it and sent it back to me. The result is terrible, the format is scrambled, the UTF-8 characters are replaced or garbled. But to be fair, it’s not an editor, it’s a “notepad” and I guess it’s allright for taking notes…

What I like(d) about Notepad:

  • Quick to open and read text files.

What I dislike(d):

  • Bad default editor
  • Lack of features

What I use(d) it for:

  • Reading text files
  • Writing my first HTML documents

Read more about Notepad’s history on Wikipedia

Notepad2 (2004) (Windows)


Upgrading the notepad with notepad2

Notepad2 fixed everything that was wrong with the original notepad. I always used to replace the original notepad with this one on my Windows computer.

What I like(d) about Notepad2:

  • Multiple buffers
  • Very fast
  • Syntax high lightning
  • Support for many languages

What I dislike(d):

  • Sadly only for Windows

What I use(d) it for:

  • Same as notepad
  • Writing PHP scripts

Visit website
Read more about Notepad2 on Wikipedia

Macromedia Dreamweaver (1997) (Windows / MacOS)


Macromedia Dreamweaver – Great application, bad editor

I made a lot of web sites in Dreamweaver in the early 2000. At the time it was a great tool to quickly make a design that worked in the majority of browsers. It didn’t generate the nicest code to edit, but it worked.  I left Dreamweaver to learn CSS and HTML properly.

What I like(d) about Dreamweaver:

  • Easy to use
  • Generates a lot HTML

What I dislike(d):

  • Generates a lot HTML
  • Not really a good code editor

What I use(d) it for:

  • Creating web pages
  • Coding PHP
  • Editing HTML

Read more about Dreamweaver on Wikipedia

Midnight Commander Editor (1994 and onwards) (Linux / Unix)


Midnight Commander Editor – great for editing conf files on servers.

I love mcedit, which comes with the Midnight Commander package. Midnight Commander itself, is a great file browser with support for ftp/ssh and lots of other great stuff. The editor supports syntax high lightning and is a pleasure editing small scripts with. Where a lot of people use nano or vi to edit their system files I use mcedit.

What I like(d) about MCEdit:

  • Syntax highlightning
  • The simpleness

What I dislike(d):

  • Single buffers only

What I use(d) it for:

  • Editing configuration files on servers
  • PHP/C++

Read more about Midnight Commander on Wikipedia

Geany (2005) (Linux / Windows / MacOSX)


Meet Geany, your new notepad replacement

Geany is my all time favourite lightweight editor. Nowadays I only use it for very simple things; taking notes, copy pasting code snippets and so on. It’s sad because Geany’s capabilities stretch a lot further than that. It supports a ton of different file formats, with syntax high lightning and simple auto completion. I’ve been using Geany on and off since 2006 and in the start I wrote a lot more code with Geany.

What I like(d) about Geany:

  • Lightweight
  • Very simple to use
  • Supports many fileformats
  • Built-in terminal support
  • Multiple buffers

What I dislike(d):

  • Not a thing

What I use(d) it for:

  • PHP programming
  • Viewing text documents
  • Taking notes

Visit Geany’s  Home Page
Read more about Geany on Wikipedia

Netbeans (1996) (Multiplatform)


Working with PHP projects in Netbeans is a breeze

I love this IDE when coding PHP. It’s easy to setup and easy to tweak. The editor started out as a student project which later was commercialized and bought up by Sun MicroSystems (now Oracle).

What I like about the IDE is the great code completion. It also gives you hints about what is considered good code standard, which is a great help. I almost dare to say that this IDE made me a better developer when it comes to keeping your code looking clean and readable. It also has support for XDebug so you can profile and debug code from the IDE.

But the core strength of the IDE is coding in Java. It has a GUI builder and you can quickly create your own small desktop application.

The downside is that Netbeans is a fairly large application if you work with very small things and the lack of Python support.

What I like(d) about Netbeans:

  • Great with bigger projects in PHP
  • Comes with a GUI builder for Java
  • A lot easier to configure than Eclipse
  • Comes with a debugger and profiling tool.

What I dislike(d):

  • Supports a few picked languages
  • Maintained by Oracle

What I use(d) it for:

  • Bigger PHP projects
  • Java programming

Visit Netbeans’s web site
Read more about Netbeans on Wikipedia

Emacs (1976) (Unix, Windows)


For the hard-core programmer (Read: über unix geek)

Emacs is not an editor, it’s more of a life style. Some developers are rumoured live in Emacs. I first heard of Emacs when tinkering with Linux in the late 90’s, but never used it until now. Since Emacs’s learning curve is like a brick wall.

The strengths of Emacs, are all the different modes. One mode helps you code Python, another one C++ or another mode that is used as a file browser. The whole idea is to use Emacs as all-in-one environment, where everything can be tweaked and set up the way the user wants it. I have spent hours to find LISP code snippets that just do that thing I would like it to do and tweak it in my own way. There are a lot of help to find online. You can also extend the editor almost endlessly with packages.

I both like and dislike Emacs. Its full-screen mode focuses fully on the coding; without menus and other distractions. It’s ability to have many buffers also helps when you’re debugging or need to edit two/three files at the same time. On the downside is that I’ve never managed to get code completion working. Which usually is very handy if you sit on a large code base and trying to recall that weird name of a function.

What I like(d) about Emacs:

  • Fully customizable
  • Not many distractions from coding

What I dislike(d):

  • Need to know LISP in order to harness the good stuff
  • No good PHP support
  • No good code completion support

What I use(d) it for:

  • Coding in C/C++
  • Coding in Python
  • Coding assembler

Visit Emacs website
Read more about Emacs on Wikipedia


Posted in Other, Programming Tagged with: , , , , , , , , , , , , ,

Status update!

You haven’t noticed, but the blog hasn’t been updated for quite some time! The main reason is that on the 22nd of December 2014 I became a dad to two very early born children. Everything has gone well, but we’re very tired.

However I’m back at work and I’ll try to re-ignite some sparks into this blog when I find some topics of interests. But a lot of spare time “work in progress” will be put on a shelf.

Posted in Uncategorized

Insanity + OS Dev = TempleOS

Sometimes you stumble upon interesting but yet very strange projects. TempleOS is absolutely one of those. It’s been developed by Terry A. Davis who has single handily been working on his Operating System project for over ten years. During these ten years it’s been called LoseThos and SparrowOS.

TempleOS is quite special since you are writing code directly towards the hardware and the whole point is to produce an OS that is more simple to understand. It has taken a lot of  inspiration from what the Commodore 64 meant for programmers in their teens, who are now in their 30’s and 40’s: A hackable OS for “recreational programming”.

But that is not really what makes TempleOS special is probably its creator. Terry is diagnosed with schizophrenia and there are times he doesn’t make any sense with his random angry outbursts, flavoured both with an unhealthy portion of profanity, racism and endless paranoia. Terry on twitter: https://twitter.com/TempleOS

He’s been actively banned from a myriad of forums due to the fact he spam irrelevant and offensive posts. This is a bit tragic since I figure Terry possesses oceans of knowledge to share, regarding OS development.

I found this thread which is a rare case where Terry gets some room and is being tolerated, and the participants in the thread doesn’t ridicule him. This gives him enough room to actually construct answers that makes somewhat of a sense. See: http://www.metafilter.com/119424/An-Operating-System-for-Songs-from-God

Even stranger

TempleOS is a very religiously Christian operating system. It’s filled with biblical passages and features, such as “Talk to god”, “Offerings to God” etc. In one of his videos, Terry talks about listening to God via TempleOS own random generator which is to be fair pretty strange!

The cause of the low resolution (640×480 with 16 colours), was apparently also a size that is easy enough to use and understand, according to what God has been telling Terry. He also wrote his own JIT compiler in a language he calls HolyC, which is a modified C/C++ language. This is used the same way under Temple OS as Basic was used on the Commodore 64, right from the start on the prompt.

It’s very hard not to be impressed what he’s actually made:

  • A 64-bit multitasking operating system
  • A compiler, AOT/JIT which is build in to his shell
  • A vast range of tutorials and games (including 3D games) for people that want to start tinkering with the OS

The idea of making an OS that is simple for the programmers is of course a cool idea. But I personally believe the people who still are tinkering with low-level programming are already hacking on Ardunio or RaspberryPI. And not to forget, the Commodore 64 demo-scene is still quite active and it’s super impressive to see how hackers still find new ways of pushing the 8-bit MOS 6510 processor and the 32 year old hardware further to do amazing stuff. (Probably a Commodore 64 post will come up later)

TempleOS is an interesting project. It’s certainly a mountain of work put into it, but who is it for? Probably mostly for the author. The Christian theme will put many persons off, since it’s like an OS that’s been designed by Salvadore Dalí in secret collaboration with Jehovah’s Witnesses. I like the idea of having an OS that’s built simple so programmers can learn more about the assembly and code behind, but I believe the audience and its users are elsewhere.

Read more about TempleOS:

Posted in Programming Tagged with: , , ,

Internet Explorer 6, all over again

Chrexplorer 6In the period 2001-2005, Internet Explorer 6 was the most popular web browser around. Even the colourful plastic Apple Macs had their own Internet Explorer version as the default web browser.

Internet Explorer 6 was introduced with the new Microsoft Windows XP (which most of us had installed as the Devils 0wn “sneak preview”.)

The first web responsive* web applications were made around this time. And many applications were specifically written for IE6. This was mostly because the support of XMLHttpRequest (see AJAX). Since version 5, XMLHttpRequest had been a part of Internet Explorer and with version 6 the support had grown up to be fairly reliable. Other browsers had their different implementations of this technology too, but most people used and developed with Internet Explorer, so yes, the developers were lazy.

So as I see it, this one huge reason why Internet Explorer became so big. At the time, there were not really any competition. Netscape Communicator that was closest but it had just been up bought by AOL and been transformed to an ad possessed monster, with massive memory consumption issues. The success of IE6 was of course also helped that Microsoft shipped it as the default browser in Windows XP.

But happiness if brief

In the end of the last decade, Internet Explorer had been swiftly overtaken by new generations of web browsers like: Mozilla Firefox, Opera, Google Chrome and Safari to name a few. Internet Explorer had made many enemies mostly among developers and web designers. And for it’s users; Internet Explorer had become a personal ad-toolbar repository.

So how did this happen?
When developing web applications and web pages, Internet Explorer had to be treated as the “special-kid”. With it’s own exception code and CSS-hacks in order to work around its handicaps. While the other web browsers worked (most of the time) with the same CSS/Javascript and HTML.

The web designers struggled with Internet Explorer since it didn’t have support for transparent PNG-files until version 8 (2009)  and even that support was pretty bad. (Try change the opacity on a PNG image and you will see what I mean.)

For personal web project it was easy to disregard the support for the ancient Internet Explorer 6. But for web applications that met a larger audience,  you still had to support IE6. Most larger business and institutions were still jailed to Internet Explorer 6, since their old Intranet applications didn’t work with anything else.

Many web developing companies used  to add a separate clause in their contracts. That if the project required Internet Explorer 6 support, it would also cost 20% extra in development costs. (Tears and frustration included).


Thankfully most of the web applications that were made in early 2000 has been upgraded. And the support for he older versions of Internet Explorer is not needed any more, even the newer versions of Internet Explorer plays along fine today.

There absolutely a myriad of things that is happening in the field of web development today. Especially on the front-end side.But the implementations in the different web browsers are starting to stray away from each other.

For instance there are many HTML5 and WebGL apps that only runs on Google Chrome. Since I’m using Linux most of my days I’m a bit pissed off that Adobe stopped supporting their Flash player for Linux. What we’re left with is a bug filled memory hogging plug-in, that most people would be wise to un-install. How ever Adobe has been working together with Chrome to implement Flash support in Linux, but only Chrome’s “Google version”, not the open sourced Chromium.

The latest news I read about Google and Adobe is that they’re planning to stream a Photoshop app via Chrome.

This is of course exciting, but in my eyes, Chrome starts to become a lot what Internet Explorer 6 was. “The preferred” browser and Exclusive functionality. I hope that every web developer and designer won’t repeat the same mistakes that was made 15 years ago and continue to support the majority of modern web browsers. The web is and should be a multi platform, accessible for as many as possible.

Personally I wish people would grow more aware about Google. It’s not the creative, innovative, loving start-up company we used to know.

  • It’s a billion dollar business.
  • Its business is you and what you do on-line.
  • And Google Chrome is just one of its tools.
* Receiving, displaying and updating data without to reload the web page.
Posted in Other, Web development Tagged with: , , , , ,

Exposing my own php object generator – PowerDB

Once upon a time I wrote my own database ORM. It is heavily influenced by the PHP Object Generator. Which was a very easy to use tool for generating database objects in PHP.

Sadly POG had its flaws:

  • Low reliability under pressure, a lot of weird things exhausting the db connections
  • Lousy code (wildlife PHP code)
  • Only produced direct queries without security IE. INSERT into books VALUES (‘Title’, ‘2023’, ’24’);
  • Only MySQL support
  • No development

So the main reason why I wrote PowerDB was because that I needed support for both PostGreSQL and MySQL for different setups. I was also tired of trying to hack the miserable PHP code that POG written in. It resulted in a PHP library that can do the following:

  • Creating database relations such as CHILD, PARENT and SIBLING
  • All queries are made through PDO statements to prevent injection and other errors.
  • Fast (if used in the right way)
  • Designed to produce maintainable code
  • Support for transactions via PDO

In PowerDB you generate base classes via a web interface. The web interface also contains a package where you can try out your models and generate the database tables. It actually enables you to produce some complex data models. I wrote a project using 40 tables.

The whole idea is that PowerDB generates base classes which are meant to be derived from, so you can put your custom code in the derived classes. To make it easier to re-generate models that needs an extra field in the database.

Here is a brief coding example how it supposed to be used:


// Create an author
$William = new Author();
$William->name = "William Subwoofer";
$William->birthYear = 1957;

// Add a book and assign to the Author
$Book1 = new Book();
$Book1->title = "I wish I was a robber";
$Book1->year = 2012;
$Book1->pages = 243;

// Add another book 
$Book2 = new Book();
$Book2->title = "I'm leaving the city";
$Book2->year = 1998;
$Book2->pages = 23;

// Add a library
$Library = new Library();
$Library->address = "23 Long Road st."
$Library->city = "Gotham";

// Add the author to the Library

// And save recursively 

The code is pretty self explanatory. PowerDB gives a clean way of working with database entities. The Author object has child objects books. Each book has a parent called Author, which is set automatically. The library object has authors as child objects. Since all the objects are related to the Library object I only need to call save on the “master” object and it will create an author, two books and a library.

It also supports sibling relationship which actually means that an entity (for instance a book) can point to many different entities. For instance a book can point to related books.

To query the data later on is fairly simple:

$Library = Library::fetchAll(array(array('city', '=', 'Gotham')));

$AuthorList = $Library->getAuthorList(array(array('name', '=', 'William Subwoofer')));

$Author = array_pop($AuthorList); 

// Prints out the title of the first book in the array.
echo $Author->getBookList()[0]->title;

The code is just an idea on how the developer will use the different objects to access data. (Of course you should include checking when writing proper code.)

I’ve been using PowerDB in a lot of small projects, and I believe it’s a great tool for small to medium PHP projects. There are some things that would be nice to have in the library as support for composer distribution, namespaces etc, support for more databases.

If you find this interesting, checkout the PowerDB generator or browse/fork the code for the generator on Bitbucket. Maybe in the future I will get around to write a simple manual for it.

Posted in Libraries, Web development Tagged with: ,

Plone experiences and rants

I’ve been working with Plone for little over a year now, and I would like to share some experiences with this article. First I would just like to say these are my experiences about the CMS/Framework and I’m still fairly new so there might be things I’ve misunderstood or haven’t done “the right way”.

So “Plone?” you say.
Let me tell you about Plone. Plone was the coolest “Python kid” on the block during the first decade of the new millennium. Since then it’s not making a lot of buzz, but still manages to compete against other big CMS/Portal systems like Typo3, Liferay.

It has quite a few good points. A well though through framework, competing with other CMS’s written in C# and Java. I would describe it as  a Python CMS with an “enterprisey” feeling to it. Written in the language everyone loves. Underneath the core, Plone is built upon the framework Zope and uses ZODB as its default database. Admirably, ZODB was first released in the 90’s which is pretty unusual for that time.

The good parts

The CMS can practically do anything. You have access to all the functionality you get from Python and thousands of libraries. This makes text processing/parsing a breeze. I don’t know many languages except Perl that handles parsing of text better. Of course this is more of a Python treat than the actual framework. But it’s great since getting into Python is a quite fast ride. The whole database is located in one file “Data.fs”, so just by copying0 that file you have a copy of your entire database.

Setuptools with buildout. Defining what dependencies you have in your project, the buildout script will download everything for you and set the whole thing up. Plone is also very easy to use for the users. Especially to select what content you would like to see on a specific page.

The lesser good parts

00000065-001That Plone is a complicated CMS is an huge understatement. It takes a lot of time to get into. As much as Python is easy to get into, Plone is hard! I’ve tried two approaches. I bought the book Plone for professionals and gave it a read. The books goes through the process of creating a cinema website. “Neat” I thought. A pretty realistic  final product instead of many small tutorials that usually is about blogs…

However the book was pretty much killing the interest of Plone development from the start. A lot of editing XML (or ZCML  as the call it) and more XML files. Writing unit-tests against the xml files you wrote. So to summarize the book pretty much killed any slight Plone enjoyment you might have had. On the other hand, the book is very throughout. It has a lot of Plone wisdom in it. But for a beginner it’s not the optimal entrypoint.

The second approach worked much better for me. Trial and error and Internet. One big problem with this Google Driven Development approach, is that when you land on Plone’s website you notice it’s severely broken. You might have thought you found the right link for what you were looking, but instead leads you to a blue white 404 webpage that refers to Plone’s index manual.

So to be completely honest, most of the Plone I’ve learned is from by looking at other peoples code, and trial and error.

The biggest thing that bothers me is that Plone is very fragmented. All the python packages you install are called eggs. Each egg contains it’s certain functionality, so Plone is more of a distribution with hundreds of eggs. This for me feels a bit problematic, when an egg becomes obsolete and defunct. Our website also has dependencies on custom plone eggs, which were maintained by a company that ceased to exists 5 years ago. I am just crossing my fingers they won’t cause problems in the next months.

It’s already happened that I’ve had packages I had to replace that doesn’t exist anymore. It’s bit of a fright pushing out someone else’s packages to the live servers that I don’t know can conflict with anything else. Of course I’ve tried it out on test before but that isn’t 100% bullet proof.

To query the database in Plone you use the “portal_catalog”. It’s a tool that consists of pointers to data with indices. When you do a query you get something called a list of  brains back. Each brain has some metadata and you can wake up the full object it points to in the database by calling the method getObject(). You can also incorporate solr with the catalog, for faster searches that also supports full-text search. The catalog is fairly fast in returning its brain results. But waking up an object from the grave (zodb) is not an efficient thing. So when presenting contents as lists, make sure there are meta data on those brains.

The website I’m developing on has a database that is more than 13 GB, it’s closer to 100GB if you include all the images, PDF’s and other binaries. And I’ve experienced that ZODB is pretty error prone and requires a lightning fast harddrive. The catalog tool is not always updated to it tries to access content that is deleted and pages crash, and it’s slow due to the fact digging up objects from zodb is not fast.

But I guess it all bottles down to that you need to be smart when you planning the architecture of a huge website. Some content is better suited in a relational database and some in a object database. ZODB is not a magic bullet. It’s more a rusty blunt shovel that rather would like to have a retirement retreat to Hawaii.


So if you looking for a great framework for you smaller web project don’t look at Plone. It seems to work alright for larger organisations that would like an Intranet or a corporate website and do not want to run Sharepoint. But in most cases it seems to be a fairly stable solution since there are a lot of websites that has been running on Plone for over 10 years.

To be comfortable as a developer in Plone you probably have to give it around 2 years. I also believe you should be active in the community and snoop around source code to become a professional. But I think it’s the same thing whatever huge framework you would like to master.

Posted in Programming, Web development

So much to learn, so little time

320x240Recently I have been doing a lot of researching for my new game. In order to develop a larger game, I really need to acquire as much knowledge beforehand as possible and avoid the most common pitfalls. I need a clear vision about how to incorporate game states and be able to pass information between them. Gamestates running simultaneous, pausing and resuming. It’s many things that very easily can get messy extremely quick.

I am still playing around with the idea to use some interpreted script for the actual game-logic. It would make the development more rapid and lower the need to recompiling the code. So “modding” will actually build most of the game logic. It also prevents the C++ to be very “hacky”.

I imagine that I will have a level state. Which will read a tile map file. In this tilemap file it’s referenced a script. The state loads all the different objects to the “scene”, and the script code will direct everything. I also want the games to use  cut scenes and events. A super nice feature would be if a script can generate random missions.

I will continue to browse around to get more tips and knowledge about the game-engine structure. I want a very clear picture in my head before starting coding, since I don’t have the time to do major rewrites (too many times). It would naturally be a lot easier to use a “out-of-the-box” game-engine, but besvärligt är det bästa.

The link section has been updated with some knowledge resources like links to game patterns discussions, forums and misc.

Posted in Game programming Tagged with: ,

New challenges for nameless game number 2


I’ve just started to write some code for game number two. The end product will have exciting levels and different game states. There will be a (to start with) main menu, intro screen and the actual game level (a couple of diffent game play levels). These seem to have very little in common, but to structure the code I’ve tried to make a Statemachine which returns a game state. Each state will have implementations for the routines listen, update, render.

#ifndef __GAMESTATE_H__
#define __GAMESTATE_H__
#include <SDL.h>
#include <memory>
#include <string>
#include <vector>
#include "manager.h"
#include "gameobject.h"
#include "camera.h"
#include "timer.h"

class GameState {

    Timer timer;
    std::string name;
    std::unique_ptr<Camera> camera;
    std::shared_ptr<Manager> manager;
    std::vector<std::shared_ptr<GameObject> > gameObjectList;

    bool running;

    GameState(std::shared_ptr<Manager> man);

    enum class State {

    static GameState::State stateId;

    virtual void listen(SDL_Event event) = 0;
    virtual void update() = 0;
    virtual void render() = 0;
    virtual ~GameState(){};

    static std::unique_ptr<GameState> getNewGameState(
        GameState::State st,
        std::shared_ptr<Manager> man

#endif /* __GAMESTATE_H__ */

The enum lists all the different types of states. The GameState contains a static state id, which keeps track on which state that is in use.
Note: This code will be rewritten to make use of unique_ptrs instead the shared_ptrs.


The game state relies on a number of dependencies, such as pointers to the SDL_Renderer and the SDL_Window. I encapsulated these dependencies in a class called manager. In SDL2 almost everything that deals with graphics needs a reference to the renderer, together with the resource handlers AnimationLibrary and SoundLibrary.

Camera, action!

The observant, can see there is a reference to a camera in the gamestate. I’ve been experimenting with scrolling the level horizontal and also vertical. The camera is not a real cameraobject (as you would use in 3D. Each object on the level/stage will be tied with the camera, so instead that the camera is panning or tilting, it actually moves the objects through the “viewport”, except the player. The player object is responsible for pushing the camera up, down, left or right.

When updating the objects position, I’ll set speed the object will move, this gives it a sense of  depth. For example the background image will scroll slower than the foreground (all the sprites). The camera function is still very experimental and I’ll try to make more features like focusing and maybe zooming into different objects

Level builder

I’ve been thinking a lot on how to make it easy to build all the levels. First I had an idea of creating a small png image. Where each pixel represents a tile and the color value the type of the tile. However I feel this is a fairly un-flexible solution, and I would need to define a whole range of color codes.

I’ve been doing some research and I found out that there are some good free to use tile editors like Tiled. It can also export to JSON, which should hopefully make it easy to parse with jsoncpp. And another plus, it looks like someone already written a parser for the Tiled format here.

Game design

Lately I’ve been playing with the idea to make a more larger game. With a story line and a world outside the ship, to make a more of a RPG experience. This largely increases the game complexity and development time.

The need for a simple script language

What I can see already now, is that I need to create some simple scripting language to stage the game. Like the following:

      • FOCUS on PLAYER
      • AUTOSCROLL CAMERA *The player is cruising
      • PLAYER DIALOG (“MESSAGE TO ENEMY”, 4) *The player starts a conversation to someone
      • WAITFORKEY(10) *Waits for the player to press a key or automatically continues after 10 sec.
      • FOCUS ON ENEMY(“BOSS32”) *The camera pans over to the enemy tagged (“BOSS32”)
      • ENEMY DIALOG(“MESSAGE TO PLAYER”)  *The enemy spurts out some text.
      • START GAME *The game state begins.

This is in particualar very useful when making cut-scenes in the game. I will read up more on game scripting, and what I could use. Because writing all the cutscenes in c++.

Posted in Game programming, Libraries, Programming Tagged with:

“Smart” pointers

During my vacation I’ve been drawing pixel art for my next game and brainstormed around some basic game structure. Creating pixel graphics is consuming a lot of time.  In round terms it takes at least 5 hours (for me, the newb)  to get a very simple enemy ship done. And that requires that I’ve sketched some ideas first. I also had some time structuring some game logic for the next game. This article will be about the “dangerously easy” in coding.

Smart pointers

Smart pointers is the “magic bullet” in C++11. If you recall, I’ve been nagging about how tedious it is to keep track on the memory allocation in C++? Smart pointer is supposed to be the supreme solution to this problem, since it auto-magically releases the memory for you.

Smart pointers are actually template wrapped pointers which frees the allocation, when the object is supposed to be dead.  However, there are three commonly used types of smart pointers. They’re called unique_ptr, shared_ptr and weak_ptr.

So I though “Wow, this would be neat to implement in the next game so I can spare some time hunting memory leaks.”. I started straight away to play around with the new types of pointers. And I’ll try to go through them in my ever so “not knowing much about smart pointers” manner.

My first assumption was that smart pointer was treated as regular pointer per type (like MyObject*). But no, you need to specify what kind of smart pointer you’re using and the type of the object…

A unique pointer refers that it has one specific owner. While been using raw pointers before I pretty much used them as reference. Thrown them into functions and everything was fine and dandy. Although this use of unique_ptr soon gets to a halt. Consider the code below:

int main(void){
    std::unique_ptr<MyObject> obj(new MyObject());
    return 0;

void handleObject(std::unique_ptr<MyObject> obj){
    // Do stuff to object

The code above won’t compile. Since it tries to destroy the object when it goes out of scope. What you can do is to pass your unique pointer as a reference. So then I turned to:


Shared pointers sounded good to me. Most of my time programming I’ve been coding web applications in PHP, where all objects you pass around are passed by reference. This is very convenient. Shared pointers “kind of” works in the same manner. It has a reference counter. When the shared_ptr doesn’t have any references left it self destructs. This is also pretty much how it seems to work in Obj-C. Of course this convenient solution has been questioned and “use in worst case” like here.


So if I wasn’t confused enough, there is of course a third type of smart pointer called weak_ptr, of which I haven’t tried to read up much on. I suspect its a type of a shared_ptr?


I’m still a bit confuse, but I’ll try implementing smart pointers in the new game, hopefully I don’t have to rewrite everything when I’m done…

Posted in Programming Tagged with: ,