Development


25
Sep 09

Project Euler, Problem 7

It want be easy to keep up with my brother on this. Well, here’s my take on Project Eulers problem no 7:

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

What is the 10001st prime number?

Continue reading →


22
Sep 09

Project Euler, Problem 6

Inspired by my brother over at geekality.net, I thought I should do an attempt on the various problems presented at projecteuler.net/.  Since he already solved the first five, I jumped right in at problem 6:

The sum of the squares of the first ten natural numbers is,

12 + 22 + … + 102 = 385

The square of the sum of the first ten natural numbers is,

(1 + 2 + … + 10)2 = 552 = 3025

Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is

3025  385 = 2640.

Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.

Continue reading →


12
Sep 09

Running FitNesse tests from the command line

image Using FitNesse to write and run test is nice, but sometimes you want to run the tests as part of an automatic build cycle. FitNesse has this possibility, and fit4delphi comes with a testrunner that makes it possible with delphi code as well.

Continue reading →


24
Aug 09

FitNesse + Delphi –> Fit4Delphi

FitNesseLogoI have been thinking about FitNesse for a couple of weeks now. It seems to be near to perfect for testing the type of code that I’m currently writing. A lot of calculations with a lot of rules, odd cases and exceptions. So I finally started to check it out, to see if it is possible to use FitNesse to test code written in delphi. Continue reading →


21
Aug 09

DUnit: Loading tests from dll’s

I wanted to split all my unittests for a project into separate packages to keep tings nice and clean. DUnit comes with a unit called TestModules.pas which helps you do that. Continue reading →


14
Aug 09

TDD, Unittesting and Delphi

Lately, I’ve been trying to learn TDD. In this post, I will collect some resources that I find helpfull.

Continue reading →


25
Jul 09

Particle-challenge part 2: OK – the math-part is a little bit hard…

Matrix Transformation It’s summer. I’m 500 km from home, and I’m trying to find some time to continue on the particle-challenge.  In the last post, I didn’t decide where to go next; The world, the particles or physics. After some thinking, I found the first one most important, and chose to read a little about how the coordinate system in OpenGL works. It sounds simple enough, but after some coding, I really feel that I need more math skills to get control of this. I have now started to read ‘Beginning Math and Physics for Game Programmers’ to see if I can get the hang of it.

I have started on a camera class, but can’t make it work quite like I want to. There ain’t much functionality in it yet, either.

The camera consist of three vectors: eye position, forward direction and up direction. In theory, the class should make a rotation-matrix from the forward and up vectors, and then translate the matrix by the eye vector.

For now, it uses gluLookAt( ) to do the transformations instead. The reason why is simply that I can’t get the math to work… I’ll have to look at it some more at a later time, but now, I want more particle-fun and less math-hassle.

snapshot of the code is available.


10
Jul 09

1st particle-challenge: Getting something unto the screen

No firework, but it's somethingA couple of days ago, I took a challenge to show that making a particle engine is not that hard. I also stated that the first part of the challenge would be to get something unto the screen, and that is as far as I have come. I have enough code to emit particles unto the screen, beautifully rendered as small triangles in various colors.

Well – its no firework, but it’s a start…

For those who are interested in the code, it’s available for  download here. The lib-folder contains two libraries that I use. First of all, there is the Free Pascal OpenGL Headers used for rendering. Second, there is a folder called ‘SDL’, which is a older version of the Delphi Container and Algorithm Library (DeCAL).  I started using it for many, many years ago, back when it was a commercial product. It was called Standard Delphi Library, but was renamed to avoid confusion with ‘Simple DirectMedia Library’. I guess it’s time to find something else, and when I start using Delphi 2009, I will for sure.

So, how did I put something unto the screen? Continue reading →


8
Jul 09

The “Particle-engines-ain’t-that-hard’-challenge

particle firework The other day, a colleague and I where looking at a cool application, Machine Flow. It’s a visual development environment and interpreter for the programming language Machine Flow. The language it self is defined by small lua-scripts, which you visually connect together. The running of the program is illustrated by small marbles carrying data around. It’s quite fun to play with, and the source is open, so there should be one or two things to look at there to.

What caught my colleagues interest, was a small firework-effect when the development environment was cleared. So we started discussing it, and soon I was determined to show that it’s really not that hard to make such effects. Now, I have never before done anything like this before. I lack experience with both graphics programming and the necessary math/physics. But it can’t be that hard, can it?

Well, we’ll just have to wait and see, then. The first challenge will be to get something unto the screen, and than I can start look at how to make it look nice. I will try to steer away from available libraries and tutorials, and rather come up with something completely on my own. The visual part will require  some reading though…


18
Jun 09

Norwegian Developers Conference 2009

So, for three days now, I have been attending #ndc09. One thing that I really like about it, is that it’s not owned by any single platform vendor or any thing like that. This is not Microsoft trying to sell their tools or technology. It’s just some cool gays (and a couple of ladies) putting together some of the worlds best speakers and inviting all of Norway to come listening. It’s not like you want see any Microsoft banners at all, and most of the technology spoken of is MS specific, though. It’s hard to change the fact that most developers tend to use MS technology already, so that’s what they would want to hear about.

Now, you can read more about #ndc09 at http://ndc2009.no/, and you can also find information about last years event there. We have been promised that all sessions will be published on that site as soon as possible. I’m looking forward to that. There where quite a few sessions that I would love to see, but obviously you have to make some choices. So when the sessions get available online, I can catch up with all the sessions that I missed. I will also take a second look at some of the sessions that I did attend. It’s easy to forget things after eight hours in uncomfortable chairs…

Continue reading →