TOP

PRG Creator

I started to learn assembler for the C64. Assembler for the 650x CPUs is easier to
learn than assembler for the x86 CPUs. They have less registers and instructions. I wouldn’t learn assembler to use it on the PC, that would be a waste of time, but I ordered a video game console and assembler on small systems is a good choice.

Most cross-assemblers just produce a memory dump of the compiled source, so I wrote this conversion programm. Inserting the two bytes everytime before the start of the programm was just too tedious :) .


#include <iostream>
#include <cstdlib>
#include <fcntl.h>
using namespace std;

/*******************************************
 *This programm converts the output file of* 
 *a 650x (cross) assembler                 *
 *to a PRG file suitable for C64 emulators *
 *******************************************/
int main(int argc, char *argv[])
{
  if (argc!=2){
    cout<<argv[0]<<" FILE"<<endl;
    exit(1);
  }
  FILE * pFile;
  pFile = fopen (argv[1],"rb");
  if (pFile!=NULL){
   long lSize;
   char * buffer;
   // obtain file size.
   fseek (pFile , 0 , SEEK_END);
   lSize = ftell (pFile);
   rewind (pFile);
   // allocate memory to contain the whole file.
   buffer = (char*) malloc (lSize+2);
   if (buffer == NULL) exit (2);
   // copy the file into the buffer.
   fread (buffer+2,1,lSize,pFile);
   fclose (pFile);
   char start[2];
   char end[2];
   start[0]=buffer[2];
   start[1]=buffer[3];
   end[0]=buffer[lSize];
   end[1]=buffer[lSize+1];
   if(end[0]&start[0]==end[0]&&end[1]&start[1]==end[1]){
    cout<<"File is already in PRG format."<<endl;
    exit(1);
   }
   buffer[0]=end[0];
   buffer[1]=end[1];
   pFile = fopen (argv[1] , "wb");
   fwrite(buffer,1,lSize+2,pFile);
 }
 return EXIT_SUCCESS;
}
Read More
TOP

wlan tip and the 2.6 kernel

The wlan connection broke down (or the server crashed, I am not sure) as I was transfering large files. I was using the Debian 2.4.18 kernel and the prism2 driver mentioned in an earlier post. The connection stays up now after I installed a 2.6 Kernel. The transfer rate went up from 400 kb/s to about 600kb/s.

The transition to the 2.6 kernel was easy I just had to update the modutil files and had to apply a patch for the nvidia drivers. The message “dma_timer_expiry”, while accessing the harddisk disappeard in the new kernel.

Read More
TOP

theblessing.net moved

theblessing.net’s DNS entry moved to DynDNS and all the DNS servers should have the new adress, which means that this site is reachable again.

Read More
TOP

AnmalTracker 0.66

Version 0.66 was released yesterday. Vou can now record the behaviour for each scan. The manual was updated today. I also uploaded the Windows demo version today.

Read More
TOP

Serverchange and a WLAN

This Website is now served from a server in my home. I did this to have an opportunity to play with all the server stuff, without having to pay or lot if I had an account somehwere else.

I put the server in another room so that it’s not disturbing my sleep. This “made” it neccessary to install a WLAN. I bought a Netlink MA-111 USB network adapter and a Sitecom wl-018 AP/router.

Click on “Read More” to read the rest.
(more…)

Read More
TOP

Automation

I spent most of the day reading ESRs book. I stopped in chapter 9 Ad-hoc Code Generation. He wrote about a generated HTML table. He also wrote that everything should be automated, he also has read book “The Pragmatic Programmer” where this is also mentioned.

I applied this advice: AnimalTracker now uses autoconf and automake which makes the build process easier. I also can type “make dist” and a package will be automatically created.

The HTML table generator inspired me to create a perl script which creates the software page on my site. I now only have to insert some parameters in a configuration file and the page gets generated. This should save some work. It’s now not longer nessecary to change the HTML page if I am adding a new version. It also should be easier to change the look of the page.

Read More
TOP

Software Development

Currently I am especially interested in software development. As I was searching for something on the web, I don’t remember what it was, I found three very interesting sites/links:

Artima is a site with a lot of articles. Some of them were written by Bruce Eckel. I found out that he has a weblog with very interesting entries. Eric S. Raymond posted a link on Artima to a online manuscript of a book he is writing, titled “The Art of Unix Programming”. He writes about the unix way of programming. I just began reading it. The book seems to be very good.

I am now using a hashmap in wxWindows for the first time. The declaration seems to be a bit ugly compared to hashes in Java or Perl. To do it (code) right I thought I read a book about the Standard Template Library. I have rarely used templates and containers in C++ because of the ugliness.

My Safari Bookshelf is now full with five slots:

It contains:

  • C++ Templates: The Complete Guide – This seems to be the best book on that topic. I favored it over the book “The C++ Standard Library: A Tutorial and Reference”, a book also written by on of the authors of C++ Templates and also available on Safari, because the choosen book contains a chapter about design. It seems to be a book for advanced c++ programmers. I hope I understand enough of it :)
  • Core C++ A Software Engineering Approach – I never read a real C++ book apart from C++ for Dummies and a few chapters on C++ in the book “Introductory C, Pointers, Functions and files” (which I used to learn C). That was enough to write basic C++ programs (the knowledge was at least sufficient for KTagebuch :) ), but the advanced stuff was missing. I had trouble with inheritance in AnimalTracker, so I thought it might be useful to refresh and deepen my knowledge about C++ with this book.
  • The Peopleware Papers: Notes on the Human Side of Software – This is a book about techniques in a development team. I’ve never been in one, but that could change. I choose to read this book because I’m interested in this topic (I took a semester in Group Management) and because I it is not as strenous as reading a book about C++.

If I read these books and would remember all of it, I would be a very good C++ programmer I think. But I’ll remember (and possibly understand) only a part of it. The ability to save knowledge directly in a brain without learning, would really be a fantastic thing, as great as teleporting people, developing an engine that goes faster than light and the ability to be immortal :)

Read More
TOP

A new release and future versions

Yesterday I released version 0.65 of AnimalTracker after I found and removed the reason the screen was flickering while one was drawing. It only affected the GTK version, otherwise I would have removed it much earlier. The 0.64 GTK version was probably unusable bcause the mouswheel must be used to zoom and to select the height. The mousewheel was not working at least on my computer (the mouswheel just scrolled the windowcanvas). These things can now also be done with the Page Up/Down Keys. The Windows and GTK version should now be rather equal in functionality and stability.

The new version also had two functional enhancements. The median algorithm is now also used to calculate the mean distance. This is useful if you only want to see the difference to the animals in the same visibility area. The distribution view is now a bit more useful. You can select the colours for the valuerange in a square. The amount of animals within a square is now shown in the statusbar if you move the mousepointer above a square.

I will now extend the postition/scan table. There will be additional rows for the time for the corresponding behaviour. The most difficult thing here will be the interface design.

Read More
TOP

Median

I got a few new ideas and wishes for AnimalTracker:

  • The algorithm for the calculation of the mean distance will be selectable. It will be possible to choose the artihmetic mean or the median.
  • The user will be able to select colours for a certain range in the distribution calculation.
  • A table with behaviour values will be importable into a column next to the position values.

The MS Windows version only has two bugs now (it’s not released):

  • The pictures hangs sometimes if you zoom it. (It happens sometimes if the scale value is 1.1.The scrollbars disappear and reappear.)
  • The areazooming is not accurate the first time you zoom. It’s not a real bug, but it should be corrected.

Read More
TOP

The Pragmatic Programmer: From Journeyman to Master

Today I reactivated my Safari Bookshelf account and begun reading the book The Pragmatic Programmer: From Journeyman to Master . I read it until the section “orthogonality” in the second chapter. I instantly apllied the things I read and created metaclasses for some classes in AnimalTracker. This mostly reduces duplicate code which makes the handling of the code easier. I wouldn’t have done it if everything would be working. I knew while I was writing these similar classes that I could use a metaclass for them, but I thought it wouldn’t be worth the time to code that. I hope I won’t make that mistake again :)

Read More

Bad Behavior has blocked 110 access attempts in the last 7 days.