28 September, 2007 | Written by Vincent 1 Comment

Undersized development team – Are you in one?

Are you in a software development team with less than ten members? Less than five members? Just three, including you?

In a small sized team, priorities and responsibilities may start getting mixed up, where each member can generally take the place of another. This is fine, and there’s an additional condition. Each member must also be extremely well-versed in an area of the team’s responsibilities.

For example, in a team of three, one member (usually the team leader) takes on documentation, business logic and the overall big picture. One member takes on the back end process flow, making sure the backbone of the project is running smoothly. And the last member takes on the front end application design.

Why is this segregation important? Let me contrast this with a larger sized team first. With more people, a task may be assigned to several people, and the collective knowledge of this group is used to solve the task. Any team member can also more or less take on roles and responsibilities of another team member in this smaller group.

As the team size gets smaller, this collective knowledge and role flexibility shrinks. When you’re dealing with a small team, every member counts. Each member has to be an expert in their own circle of responsibility, or the effectiveness of the team suffers. Treating each member in this situation like a plug-and-play component is a disaster waiting to happen.

So how can you help yourself? Learn to say no. Multitasking with other team members’ responsibilities is the fastest way to drain your energy and compromise your own output quality. In the event that you have to take on another person’s tasks (say the person’s on leave), then prioritise. Find the tasks that helps the team most, and then do those, even if they aren’t originally your responsibility. This way, the team moves forward, the project gets closer to completion, and the users are happier with the support.

If you can, get good help. Even one or two more team members can help the overall effectiveness of the team (try these for some hiring arguments). This is different from adding people to projects to make them go faster. What you want the additional members to do is alleviate some of the independent tasks off the existing members. Then slowly spread out tasks more evenly amongst the team members.

26 September, 2007 | Written by Vincent 1 Comment

Back to Basics – Sierpinski Triangle

I remember back when I was first learning C, and one of the assignments was to draw the Sierpinski Triangle. I didn’t know what it was, but sequential steps were given to iteratively create it. The steps were roughly like so:

  • Generate a triangle on a plane with 3 points
  • Set the centre of the triangle as the current point
  • Randomly select one of the triangle points
  • Get the mid-point between the current point and the selected point
  • Plot the mid-point and set it as the current point
  • Randomly select one of the triangle points
  • Get the mid-point between the current point and the selected point
  • Plot the mid-point and set it as the current point
  • Continue till iteration limit is reached

I was told to visualise the plane as a matrix, and the plotted points were to be printed as asterisks on the screen.

It’s been years now, and I still think the screen output of my Sierpinski Triangle sucked because of the low resolution. Now, older and wiser, I can come up with a better representation.
Sierpinski Triangle

Download the full source code.

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace b2bSierpinskiTriangle
{
    class Program
    {
        static void Main(string[] args)
        {
            const int cnSize = 512;
            const int cnLimit = 50000;
            int[,] points = new int[3, 2];
            points[0, 0] = cnSize / 2;
            points[0, 1] = 10;
            points[1, 0] = 10;
            points[1, 1] = cnSize - 16;
            points[2, 0] = cnSize - 16;
            points[2, 1] = cnSize - 16;
            Bitmap bm = new Bitmap(cnSize, cnSize);
            Graphics g = Graphics.FromImage(bm);
            g.FillRectangle(Brushes.White, 0, 0, cnSize, cnSize);
            int trianglepoint = 0;
            Random rand = new Random();
            int currentx = 0, currenty = 0;
            int previousx = cnSize / 2, previousy = cnSize / 2;
            for (int i = 0; i < cnLimit; ++i)
            {
                trianglepoint = rand.Next(3);
                currentx = (points[trianglepoint, 0] + previousx) / 2;
                currenty = (points[trianglepoint, 1] + previousy) / 2;
                bm.SetPixel(currentx, currenty, Color.Navy);
                previousx = currentx;
                previousy = currenty;
            }
            bm.Save("sierpinski.bmp");
            g.Dispose();
            bm.Dispose();
        }
    }
}

Short and sweet. Instead of printing to the command line screen, I plotted the points to a bitmap. I still remember printing my program listing and the Sierpinski asterisks output. Though pleased with the required output, I thought it looked a little unrefined around the edges.

Printing to a bitmap at pixel level makes it look much better…

24 September, 2007 | Written by Vincent 1 Comment

Path of a Polymath Programmer Part 5

I’ve talked about how stories, typing, role playing, console games and self-learning Japanese so far. Quick links here for reference:

Continuing the console game part, I started noticing more about the games than actually playing them. I marvelled at the graphics (it was mostly pixel art then), and appreciated the game music. Immersed in the story plots, I identified with the characters (I still have sniffles when I think of Celeste losing her grandpa in Final Fantasy VI) and got lost in the fantastic worlds the game creators forged.

I was in the Chinese orchestra then, so I had begun learning about music. It was at this point that I found I could separate distinct music pieces in the same song played by different instruments in my mind! There’s the main melody, the supporting melody, and the bass or beat carrying the song through.

Fast forwarding… got drafted into military service. Learned to harden will and tons of self discipline and self reliance. Fast forwarding…

University life!! I would eventually major in applied math and computational science. What’s the difference between computer science and computational science? You can read the short description here. You will also notice that a lot of my sample program source or topics tend to focus on math and science related stuff.

With university life came a lot more freedom in how I use my time. I watched tons of television shows. Ed. Friends. Gilmore Girls. Ally McBeal. Charmed. CSI. Andromeda. Alias. Sliders. I also watched tons of movies (my friends usually find out about the latest movies from me). Lots of stories and plot lines. Improved listening skills and English language (I’m in Singapore, and sometimes the English spoken here leaves a lot to be desired…).

Also with university life, I needed a computer. So finally, I got a proper computer so I could print notes and reports, and do some light programming. If you’re doing C/C++ programming on the Windows platform, I suggest the Dev-C++ software. I was writing code on the *nix platform, but sometimes I needed to test my code without going to the university labs.

Then I started mucking around with computer graphics software. There’s Terragen™ for generating incredible landscapes, Bryce 4 (version 6 as of this writing) for creating quick scenes and texture generation, and trueSpace 4 (version 7.5 out as of this writing) for object modelling. I used the different software for the function it provides best, then export the results to another software for the purpose I need. For example, I could model something in trueSpace, export it into Bryce, and render the object there with a texture I created. Or I could

  • render scene in Terragen and export as picture (resource 1)
  • create texture in Bryce and export as picture (resource 2)
  • import resource 1 and 2 into trueSpace
  • map resource 1 onto cylinder and place on scene to use as backdrop
  • map resource 2 onto an object modelled in trueSpace
  • render entire scene in trueSpace

Learn to use the tool that is most efficient at what it does. More importantly, learn to use the results from that tool with other tools.

Then I learned about Hyper Text Markup Language (HTML) and Cascading Style Sheets (CSS), and played with the code. It looks very nice and all, but it’s only on my computer. The web was all the craze then, so I thought I might as well get a place to put my brand new spanking HTML page up, so I searched around for web hosts. I went for free hosting for a while, but eventually got a paid package. I was still a student then, so this cut me back quite a bit.

Sometime around this period, I was taking computer graphics and 3D geometry classes. One of the professors mentioned a computer graphics contest, and the deadline was only a few days away. I don’t know what came into me, but I spent the next few days coming up with a theme and the scene. My weekend was burnt because I was busy scanning textures. I worked through the night before the deadline because I was slapping on textures and tweaking the radiosity settings and rendering and rerendering the scene.

It was terrible. I don’t think my submission even got noticed. The other entries were way better looking than mine. But I thought I had a better theme. All those days and nights gone… oh well, at least I tried.

Time passed and suddenly I was in my final year. The thesis topics available weren’t interesting, so I talked with my advisor and finally came up with something. I would be doing a study on computer virus epidemiology. Ok, big word there. Simply put, I’d be studying how computer viruses behave during an epidemic, and I’ll be using existing information on biological viruses as a comparison.

So amidst the graph theory, coding theory and Frenet apparatus from my math classes, and more matrix calculations than I ever want to see in my computational science classes, I was busy researching on both biological and computer viruses. I had to understand the math models used in epidemiology so I could transfer the relevant properties over to my simulation program.

Oh, I didn’t tell you. I was writing a computer virus behaviour simulation program that mimics real world results. And no, it’s not a computer virus. I was interested in its behaviour, not its method of spreading (though I got bombarded with information on payload and security and what-not during my research).

Then my ability to use tools and interchange results was put to the test. I wrote my simulation program in C and ran it in Unix. But I didn’t know how to produce a graph or chart with my results. Then I remembered Matlab, so I changed my C program to output something Matlab could take in. Then I used Matlab to generate the chart.

I was using LaTeX to generate my thesis document, and I had had to write small programs to generate code for some LaTeX commands. I also imported the Matlab generated charts into my thesis document. I remember one of my fellow students being kind of smug about his knowledge of document generation, because he co-wrote a few papers with his professor. Oh well…

In the end, I wrote a 40-page thesis, complete with research findings, charts, math formulas, proofs, topological models and my proposed model and program for computer viruses. That fellow student was kind of smug about his 100+ pages of material. Whatever

Next came the thesis dissertation. I figured that my presentation would have more impact if I could show the computer virus propagation. I needed a Windows port of my simulation code. Oh my goodness! Luckily, I tinkered with Windows code before, so I dug up the remnants of a working template, and translated my C program simulation logic into the Windows code equivalent. My original simulation program had no interface to speak of (it was supposed to just run for hours and blip out a bunch of numbers), so I had some work to do. I also had to display the viral propagation in real time, so I had to code in some basic charting function.

I got the Windows program up in time, and all in all, the dissertation went well. Whew…

So… a preview for the next one in this series, I’ll be talking about game development and demos. Keep coding!

Continue to part 6

Next Page →