Delphi


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 →


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…


5
Jun 09

Ownerdrawn menus in Delphi

Owner drawn popup menu Just when I was thinking that what this blog really needed was some content, an old article that I wrote for delphi.about.com was pulled out unto the frontpage again. It was written back when Office 2007 was still in beta, but the principles of owner drawn components should still be the same.

You can take a look at it on the delphi.about.com-page: How to Mimic Office 2007 Rich Menus using Owner Drawn TMenuItems