Category Archives: Development

Rants about application development technologies.

1 equals 1?

Back to .NET: amazing what you stumble across when writing software. Assume you have 2 arrays and want to compare them:
byte[] array1 = new byte[] { 1, 2, 3 };
byte[] array2 = new byte[] { 1, 2, 3 };
array1.Equals(array2);

All you want to do is determine if the two arrays contain the same elements. The problem with above pseudo-code: it returns “false” as result! The arrays are considered to be different instances of the same data – and thus not equal.

Quick and dirty workaround for small arrays: convert both arrays to a Base64 string and compare their values.

Part Time Assembly

What if you are a sworn in C and C#/VB.NET coder working mostly on x86/x64 architectures who is looking for a past time occupation? Of course, you go with ARM CPUs, assembly language, and intercepting functions of an embedded system’s innards!
The target of choice: the Canon Ixus 970 digital camera. As mentioned in the article Fiddling with an Ixus, it’s firmware was dumped to contribute it to the community. However, no volunteer stepped forth to port the Canon Hackers Development Kit over. Consequently, the port has been started and shows some success, a beta version is already available for download. Some technical info and the download can be obtained at the CHDK Wiki.

Fiddling with an Ixus

In the best spirit of looking beyond Windows/Linux development, the recently acquired digicam Canon DIGITAL IXUS 970 IS seemed to be a good target for some practicing. They sport ARM based processors, which we gathered some experience on when working on dumping tools for the Dreamcast.
The main goal is to help the CHDK community to port their enhancements over to the Ixus 970. Obviously the first step in doing so is to dump the original firmware, and it seems there was no dump of a PAL device with version GM1.00C available yet. Things have changed, and the firmware has been made available to the public by vware!

own3d Video

A long term friend and source of inspriation started a gaming related community site named own3d some years ago. With a recent development towards video hosting, the need for a simple to use video transcoding tool was born.
Presenting our first cooperation after a long break, we would like to hint you at the little x264 video converter tool which is available for site subscribers. Hopefully a lot of users will find it easy enough to create and share their videos! The video site is currently in beta and can be checked out here: beta.own3d.at

Mono

With the latest round of Linux distribution releases just being completed, notably Ubuntu and Fedora, it was time to give Linux another shot, along with the latest Mono version, to be able and run our projects in a free (as in speech) environment.
Seems like vbnc, the free VB compiler, has still its fair share of issues, so efforts were put into porting the vware Libraries to C#, as well as a small project that uses it: FileIndexer. All said and done, after ironing out a lot of conversion errors, both projects compile and run just fine in Microsofts .NET implementation as well as Mono. Expect both to be released rather soon, as using C# inspired me to include a few new features.

Coding Horror

There are a lot of interesting articles on slashdot.org, at least for the nerds that read it. For those who do not, get started with it.
Today, there has been a new post about coding style and general misunderstandings. One that could not possibly fit any better with reality. At least the reality over here at vware, nicely illustrated in this picture. Someone obviously took a lesson at this very project and the webpage.

Project Conversion

Microsoft has recently released Visual Studio 2008 to MSDN subscribers. The revised IDE makes a better impression than its predecessor, and the new compilers have some useful new features. When loading up a project created with a previous version, it needs to be converted. If you have your source code under version control, such as Subversion, you are going to notice a few changes to the files, other than just new file headers, for instance: 2.0. When looking at that, one question comes to mind immediately: why in the world would you ever want to store the previous tool version in the project metadata?

Free Software

In modern computing, you are likely to be using GPL or MIT licensed programs, especially as a developer. While huge companies are propagating digital rights management, software patents, and are inforcing copyrights, free software represents the spirit of the early days in computing: sharing information free of charge and royalties.
Free Software gives everyone the right to look at program source code, to use and modify it, for as long as the “rights” are retained. It is an extremely intimidating concept, especially for developers wanting to add content to already available programs, without the need to request features and go through a long line of support lines. This enables hundreds of developers to work together, share and modify each others ideas, and create applications for all major operating systems.

Sounds like a coders’ dream come true. There is just one major drawback: ease of use. Not the ease of use for the end user, but of the development tools.

On Windows, Microsoft’s own Visual Studio is one of the major development platforms, or integrated development environments (IDE). Nowadays, C# or Visual Basic are available for rapid application development (RAD) with the .NET Framework. This is where Visual Studio truly lives up to the marketing fuzz: hardly any development environment is so comfortable to use and yet powerful in features. Dead easy visual designers for data sets and dialogs along with templates. Comfortable text editing, indenting and formatting inclusive. Even Stop-Edit-Run debugging in the case of Visual Basic, without the need to recompile the whole project. A invaluable time saver for the average developer.

The popular development environment for software created with “free” tools which are portable mostly consists of a whole bunch of tools: vi/vim/emacs for editing, gcc for compiling, gdb for debugging. This so called toolchain is then complemented by a host of libraries, such as zlib, and a toolkit such as GTK+, wxWidgets, etc. Each one of them is highly configurable and highly flexible, cross-compiling and other features not even mentioned. But they are incredibly difficult to get started with! vi probably has more keyboard commands and shortcuts than the average human brain can store, gcc compilers ship without any infrastructure to actually create a program (libraries, headers, examples), and gdb is very difficult to set up and use.
This is not to speak of the wealth of libraries and dependencies one needs to create something meaningful, all of which have to be gathered seperately. Different versions of libraries may not work with different versions of executables, patching headers to make specific versions work with new compilers or recent code bases is common practice.

In my humble opinion, a lot of users would love to support the Free Software movement. Everyone involved with this very project here at vware would love to give back to the community. If it was not for all the time you lose getting into it, where you could do something meaningful (like actually developing an application).

100>>2=25

One of the features I always missed in VisualBasic was bitwise shifting. One of my most used features in earlier years, because it was especially useful for evaluating registers and masking out values. Since it was always rather easy to develop GUI applications with VB, I often hit the limits of it (as of version 6.0 and earlier).
The only way around it was to write a DLL in C and import it in VB to shift bits left and right. A lot of time has passed since then, and I did not need shifting as much anymore.
Yesterday, however, when working on ClanTools, I forgot the “” in MsgBox(“100>>25”). When the program hit this line, the message box showed “25”, which puzzled me at first, but then I realized that VB 2005 now actually supports bit-shifting! I wonder if I just overlooked it or Microsoft never actually announced it in a big way. They should have done so, it really adds to VisualBasic as a language.