Tuesday, 13 October 2015

Funny comment in old code

Today a client of mine 'found' some comments in HTML code that was long lost and forgotten. I estimate it to be around 5 years old. It is a web app that has a very dark theme, and as we know, there always has been controversy over dark themes. And this comment gave me quite a chuckle. Fortunately the client did take it as a joke and didn't harbour any hard feelings.


<!--
<td style="padding-left:5px;padding-right:15px">

Please leave this select box commented out until people get really frustrated about NOT having a light theme.
The default theme is black, and lets try and keep it that way for as long as possible.
Black themes are better because they are good for the eyes (emits much less light into the eyes), and it saves a lot on power (because it emits less light). And tablet, phone and laptop batteries would last longer while using the application.
The only thing bad about black themes is that people in general prefer white themes, and don't like black themes because it makes them feel all awkward and weird inside.
But because people in general are stupid, trust their feelings instead of their logic, and just generally full of shit, they would rather have a white theme, do harm to their eyes, and use more power just so they can feeling all warm and fuzzy inside.
So help me to help the world, fight the forces of evil, and keep this code commented out as long as possible so that we can start forcing people to change. The only way to move forward is to embrace change. Like the Mr Smith said: "Change is inevitable!"
Once people start using it, the warm and fuzzy feeling of comfort would come back as they get use to the change. And we would all live happily ever after in peace, with healthy eyes and long lasting batteries!

Only when someone actually have an eyesight problem and cannot use the black theme at all, then it might be the time to enable the theme changer, and remove this comment.

<select class="select" onchange="[THIS].switchTheme(this.value)">
<option value="../app_theme/theme_dark.css">Dark Theme</option>
<option value="../app_theme/theme_light.css">Light Theme</option>
</select>
</td>
-->

Sunday, 11 October 2015

Computer Networking Overview

One of the first lessons is about computer networking. I cover the most commonly used subjects in networking today. The goal of these lessons is to help you understand in a very basic way how networks work, and how you are able to browse the web, view videos and listen to music.



Click the image below:

Tuesday, 6 October 2015

Who is Steve?

Hey! This is my very first post. I have never blogged before so this is quite exciting times.

Since this blog is mostly about my software development, I am just going to give a bit of a history of my life with software development. Then you can paint your own picture of who this Steve dude is.

First source code

It was 1998 and a hot sunny summer in South Africa. I was 14 years old and in standard 6 (nowadays known as grade 8) in school. My friend across the street started playing around with Turbo Pascal and told me that it can be used to write games. I was instantly hooked, wanting to know the background of how games work and how to create them. I asked my father to teach me about Turbo Pascal after I found out that he had some QBasic experience. This didn't go so well as his experience was a bit rusty at the time, so I was off on my own and with some help from my friend across the street to figure it out. He was also still learning and trying to figure things out. All he gave me was some source code that he managed to get somewhere. By that time the internet didn't really exist in South Africa and getting help was next to impossible.

But I had a lot of source code and willpower. The sample source code I was given was able to compile successfully and able to run. So I started reading the code. I had no idea where to start, I just looked at file after file of Turbo Pascal source code. Every now and then I would see something that looked like human language. Strings that actually made sense. And when I changed it, re-compiled the code and ran the application, it would change the text in the application, like menu's and readable text. I was blown away!

Soon I started to change more and more code. Moving things around and eventually figured out that code actually executed from top to bottom. With no one able to teach me, this was the only way. Trial and error! Breaking and fixing! Slowly I started figuring out what "while" loops, "if" statements, "procedures" actually meant and how they are used. Things started to make sense and I considered myself a software developer :P

Developing Games

After developing some test applications with Turbo Pascal I really wanted to create games. But I soon found out that it's not going to be an easy task. Back in those days you had to write everything from scratch, there was no libraries. All the logic, all the rendering you had to write your own code for. Every pixel you would have to place on the screen. It was the days of 32bit VESA graphic cards, when EGA (16 color screens @ 640x380 resolution) was considered cutting edge.

The game I was writing was called Tank and consisted of a top down view of a map with a couple of wall sections scattered throughout and 2 Tanks that could fire rockets at each other to bring down each others health until one of the tanks would ultimately explode when it's health reached 0. It was a 2 player game where 2 people would typically use the same keyboard, one used the arrow keys and another the ASDF keys to control their tank. And obviously some other keys to fire rockets.

Gaming Obstacles

Handling key presses was a big issue, since it was not possible to know when 2 keys were held down simultaneously. Turbo Pascal simply did not support this feature. So to circumvent the issue I simply made the Tanks always go forward and never be able to stop. And each keypress simply turned the tank in one of the 4 directions possible, up, down, left and right. It was quite fun to play, and me and my friends invested a fair amount of hours playing the game.

Turbo Pascal also didn't support any images. So drawing my tanks was a big problem since I wanted to use some textures to make the tank look like it was camouflaged. So I created a 2 dimensional byte array that I manually typed out in my source code. I then wrote a renderer that was able to render this byte array anywhere on the screen by manually putting every pixel in it's place. And by changing some values in the byte array I was able to change pixel values (aka colors) in the "images" that I rendered. So everything was bare basic and hours of work had to be put in to accomplish the most basic task.

Deeper darker side of computing

It was the year 2000 and I was getting fed up with the native graphics mode that Turbo Pascal supported. It was slow and bulky and memory was an issue. Then after questioning a lot of people, and driving my bike halfway across town to another friend that had an internet connection, I was able to get my hands on a DOS application that served as a help manual for assembly commands. And Turbo Pascal supported in-line assembly code! Wow! My world was shaken! I was suddenly able to do whatever I wanted. All the hardware on the PC was accessible and things executed at lighting speed. So entered display mode 13h (320x200 with 256 colours), interrupt 33 (mouse access), and port 60 (keyboard access). The entire PC was mine!

I chose display mode 13h, because the whole screen consisted of one bank, since it was less than 64k of data. So no bank switching was needed in order to cover the whole screen in pixels. But it was fast! Wow it was fast! A thousand times faster than Turbo Pascal's native graphics. I could get insane frame rates, I could render moving fire, I could do blurring of textures, and all sorts of other nice stuff. All with a lot of hardcore assembly code that needed to be written first of course.

3D

But then the world of 3D games started intriguing me. I spoke to a couple of people about how a 3D world can be projected on a 2D screen. I was once again fascinated and hooked. My aim was to write my own fully featured software rendering 3D engine. I coded night and day. Sleeping only a few hours. I went to school in the morning and bunked half the classes to come home early just so that I can code. I went full geek and didn't have much friends, I didn't go out, my parents only saw me at dinner and I spent all of my time coding 3D software rendering engines using assembly code. I did not use OpenGL or Direct3D, because they where too easy, everything was already done with them. I wanted to know how OpenGL worked and how Direct3D worked, and the only way was for me to try and write them.

Some of the obstacles were that Turbo Pascal only supported 16bit registers. So if some floating point value was needed you would have to apply some bit-shifting magic to make sure all the calculations are accurate enough to be usable. And operations like sin, cos and tan was not available in assembly. So I had to create sin, cos and tan reference tables to do fake calculations, which used a reference table in the background to simply lookup the closest match and return it as a result.

My life was a blur at this point. I still can't make out what the order of things was, but I have discovered 32bit programming under windows using TMT Pascal. I discovered the floating point stack to assist with floating point calculations. I ventured into Video encoding to compress the 3D scenes that I was generating. I even ventured into sound programming and created filters that created distortion, echos, mixing, fading etc. All using assembly code with TMT Pascal under Windows.

Attempt at higher education

It was the year 2003 and I was off to University to attempt to make something out of myself. Studying computer programming and computer engineering. I did quite well in my first year, since a lot of the concepts and code was very familiar to me. I think I even got a few distinctions. But the second year of University came along and I discovered, alcohol, weed, women and parties. And my life was a blur again. But this time a different blur than before. I was stoned, drunk, half dead for 3 months straight and missed almost all my classes. I failed all my subjects in the first semester. The University wrote me a letter to ask me to please leave, since they were under the impression that I wasn't taking my studies serious enough.

First job

July 2004. So I left and was back home twiddling thumbs. I was a bit aimless and wasn't really driven to do any coding, or anything else whatsoever, except working on my mom's nerves. Until another friend of mine told me of a start-up software development company that he was working for that needed developers. I was going to earn next to nothing pay and would be required to work very hard and long hours. So I went for this brilliant opportunity.

We operated from a flat in Pretoria and half the team was sitting in the garage. Initially things were tranquil and slow. We developed some websites and got work done. I was paid R 600 per month, which then was about $ 60 per month. It was not enough to cover my fuel costs to work and back. So I slept at the "office" / flat / garage during the week and only came home on some weekends. We worked from 8am till 4am. So it was a typical 20 hour work day with some sleep sprinkled in between.

I created my first website platform that could be used to create application like websites. This was before the days of AJAX and we used a JavaScript tag that we force reloaded in order to simulate something that was similar to AJAX that we all know and love. It was called BOS which stood for Browser Operating System.

We managed to get some big projects because of this and developed application like websites for companies to use as tools. Eventually I got a raise to R 3,500 ($ 350) per month. And I was able to afford going home every day. We also grew in size and moved out into proper fancy offices that used fingerprint scanners to gain access to the site, offices and various other places. We felt like we have made it! We can soon go and buy our Lamborghini.

But the setup wasn't perfect. The process consisted of the boss / owner landing almost impossible projects, with impossible timelines and me attempting to make these projects work. Most of whom we actually did manage to get working and yield good results. But the constant workload and time limitations and constant new projects made it impossible to finish current projects. Causing a wave of unfinished projects that all semi-worked and is nothing more than a proof of concept or prototype. So we always had cash flow issues and mostly got only half our salaries paid. But since I was never a money chaser in my life. I stuck in there and tried to keep head above water for a total of 6 years.

But I did learn a lot from these projects. And I am ever thankful for that. I re-developed BOS 5 times. I developed another Web2Core platform for easy Web2 application development. I developed the entity data model that made setting up databases and adding new entities to any system a breeze, with auto generated GUI components. I developed mobile platforms that delivered video, audio and image content to various mobile devices while converting them on the fly to the correct codec, container and size to fit the mobile device specifications. Because back then not all mobile phones could play the same video or audio formats, even images was not compatible. I integrated with Asterisk VOIP manager to have our own custom GUI and reports manager, we used it to terminate international phone calls in and out of South Africa. And these are but a few of the many projects that I tackled at my first job.

My Business

It's 2010 October. After some heated discussions that I am not going to go into now, I decided to quit my first job. My wife back then, sent my CV all over the world. I was broke while I was working my first job and now I was jobless. So I was a little worried. Google gave me an interview and wanted to fly me to New York to take things further. But at the same time I got offered the opportunity to take one of the big clients from my previous job as my own client (completely legally of course). And with it enough money to start my own company. So that's what I did. And now I have my own company which has been running for 5 years now. Developing various technologies in cloud management, high throughput systems, mobile devices and integrated development.

So that's me! Steve!