31 May 2007

Write better code

There is an interesting talk on Slashdot about coding here. It's good to see that there is still occasionally some discussions about programming on there.

The article is about Six Ways To Write More Comprehensible Code. It makes size points:
  1. Comment well and often.
  2. Use sensible names not obscure constants.
  3. Use variables with descriptive names.
  4. Do error checking.
  5. "Premature optimization is the root of all evil." - Donald Knuth
  6. Don't be too clever.


The article is a nice little bit about writing better code. Personally I rate number 5 very highly, in fact I should write an article about writing better code from my point of view.

30 May 2007

X-Box Media Center - For Linux

The critically acclaimed X-Box Media Center which is a HTPC program for the X-Box is planning to work on a Linux version. Bizarrely some of X-Box Media Center inspired Media Portal, the very good and comprehensive HTPC program for Windows.

They are looking for C/C++ developers to help with the porting to another platform. This will require substantial work to port the functionality requiring new playback engines, 2D and 3D graphics, and no doubt lots more.

There is a thread on their forum for developers here. There is a post on the forum for end users here.

On their wiki the preparations are going along. You can read this information here.

I have the sincerest hope this is successful because with MythTV out there things will be healthy for Linux HTPC programs. Also, it is a good thing it will be built out of open-source and free tools.

29 May 2007

Good resource for icons, buttons, and so on...

Smashing Magazine has a great article Freebies Round-Up: Icons, Buttons and Templates detailing lots of sources of icons and images available for use. Not all can be used in commercial programs but they could be used for open-source programs.

Windows Aero UI Development

There is a new article on the CodeProject about retrofitting Windows Aero UI elements to existing applications. Adding or Retrofitting Aero Glass into Legacy Windows Applications - Stefan Kuhr.

It's quite a comprehensive article and means someone else has done the research legwork for you - one of the beauties of the CodeProject. This is especially useful as the Aero C++ headers have no real documentation as yet.

26 May 2007

Boostcon 2007 Presentations

Boostcon 2007 (the conference about the splendid C++ library Boost) happened on the 14th-18th May 2007.

I've been keeping an eye out for any papers/presentations that will be made public from it. Fingers crossed someone will sort out the general public with copies of all the presentations and notes.

Good news though since on the Adobe ASL Wiki, Sean Parent one of the dead clever guys at Adobe has posted his presentations. One of which is the keynote address.

The first one, the keynote, is about the possible future of software development - concentrating mainly on generic programming and how we can use it to reduce errors. You can download it here.

The second is about the Boost Poly library. You can download this here. This is also by Sean Parent.

On a related note I will hopefully be doing some in-depth posts about the Adobe ASL soon as I am finding it very interesting going through the documentation.

The Future Of OpenGL

The OpenGL website has put up links to a couple of articles about the future of OpenGL 2 and 3.

This article covers the next two versions of OpenGL codenamed Longs Peak (2.x) and Mount Evans (3.0). Longs Peak concentrates on tidying up the current API, whereas Mount Evans is a rework of the API to deal with the newer concepts in 3D technology. Mount Evans also dels with the unification of OpenGL with its ES version that is used in low powered handheld devices like mobile phones and games consoles.

Another article is linked here. Also there is an interview with Roy Taylor from nVidia about OpenGL.

24 May 2007

Programming Resources

This post is just going to be a collection of links to interesting resources and papers on programming, mostly to do with C++.

First up some interesting papers on programming in gerneral. Notes on Foundations of Programming by Alex Stepanov and Mat Marcus - you can read Part 1 here and Part 2 here.

Next up there is the papers of Andrei Alexandrescu the template and modern C++ specialist. He also started the Loki library as a by-product of his books which is a collection of C++ classes for useful things.

Cheatsheets and reference is a collection of useful links for web programmers (there are some other more general programming links like Python and C++).

For the beginners out there here is a link to a C++ tutorial which is quite well presented.

A good resource for peer-reviewed C++ articles is the C++ Source although there isn't a massive amount of recent content.

23 May 2007

Future Developments - Subversion

Subversion is always a great choice for source control, and in the summer it looks like there will be an update to version 1.5 with some fairly major features.

The most important of these features is the merge tracking which is detailed in this blog post. It is not a problem for a simple life of development, but when you are maintaining multiple branches with multiple requirements and they all need to know what revisions have an haven't been merged you really need to know what is going on. With Subversion up until the upcoming 1.5 you would just have to be conscientious and meticulous.

There is a list of all issue reports that are targeted for Subversion 1.5.

Also for Subversion resources there is a great blog here which has more about what the developers are planning (or would like to ideally include). You can see the Subversion roadmap here. There is also an issue list for what could be potentially included in 2.0. Oh and finally the plans for TortoiseSVN in relation to Subversion 1.5.

Edit: Thanks to hwright for the comment that Planet Subversion is an aggregator for Subversion blogs. Cheers!

GUI Toolkits - GuiToolkit

Many many moons ago there was a CodeProject article about something called GuiToolkit which was an extension to MFC adding lots of modern bits and pieces (for the time) like the Office 2003 look.

It had lots of nice little features that people could use in their MFC apps. Things like the flashy new icon menus and docking windows. I found it a little heavy going looking at the code but it was interesting at least.

The writer of GuiToolkit has just published a new article called Pretty WinAPI Class and covers a modern looking GUI interface by wrapping the Win32 API. It has nice looking menus, docking windows and lots of other good looking tools. The source looks very similar to MFC in some respects, but it seems to do the job nicely providing the "modern Windows look" since Microsoft does not see fit to provide the common controls for this in a lot of areas.

You can see the homepage for all of these projects here.

22 May 2007

Porting C++ Applications To 64-Bit

A couple of recent articles on the CodeProject cover the porting of applications to 64-bit. It does mention the datatype problem where the size changes.

The first one is Problems Of Testing 64-bit Applications. The second is 20 issues of porting C++ code on the 64-bit platform.

The second one is the more comprehensive and provides practical solutions to the problem.

18 May 2007

Boost 1.34 Released

The latest version of the Boost Library has been released. This is version 1.34 and you can read the changes on the Boost frontpage.

Boost is a fantastic peer reviewed library collection for C++. It adds power and robustness for C++ programmers, after all we shouldn't need to reinvent the wheel all of the time.

There are five new libraries:
* Foreach Library:
BOOST_FOREACH macro for easily iterating over the elements of a
sequence, from Eric Niebler.
* Statechart Library:
Arbitrarily complex finite state machines can be implemented in
easily readable and maintainable C++ code, from Andreas Huber.
* TR1 Library:
An implementation of the C++ Technical Report on Standard Library
Extensions, from John Maddock.
This library does not itself implement the TR1 components, rather
it's a thin wrapper that will include your standard library's TR1
implementation (if it has one), otherwise it will include the Boost
Library equivalents, and import them into namespace std::tr1. Highlights
include: Reference Wrappers, Smart Pointers, result_of,
Function Object Binders, Polymorphic function wrappers, Type Traits,
Random Number Generators and Distributions, Tuples, Fixed Size Array,
Hash Function Objects, Regular Expressions and
Complex Number Additional Algorithms.
* Typeof Library:
Typeof operator emulation, from Arkadiy Vertleyb and Peder Holt.
* Xpressive Library:
Regular expressions that can be written as strings or as expression
templates, and that can refer to each other and themselves recursively
with the power of context-free grammars, from Eric Niebler.

Obviously lots of the other libraries have been updated like Boost::Python.

17 May 2007

PTC Acquires NC Graphics

Part of the reason blogging has been so light in recent months is that work has been taking up more time than usual. Now at least it is official.

The company I work for, NC Graphics has been acquired by PTC (Parametric Technology Corporation). You can see the press release here and some additional information is available here.

Obviously it is all only of interest if you know me, but at least it will explain what I am doing when I change my blog summary. Fingers crossed it will be a good move. This has all been very tightly kept under wraps so it probably surprises quite a few people. It has been surprising that noone in this entire period has asked me about it since CAM really is quite a small industry.

And on a related note - Julian Todd and Martin Dunschen are ex-NC Graphics employees with a CAM blog linked to on the side panel to your right.

16 May 2007

GCC 4.2 Released

GCC 4.2 has now been released. The biggest feature is OpenMP for C/C++ and Fortran. You can read the changes here.

All this means I'll be keeping an eye on MinGW as they should be releasing an update sometime soon.

15 May 2007

Random GUI stuff - wxFormBuilder

wxFormBuilder is a RAD designer for wxWidgets. It is free and open-source. It is in the beta phase of version 3.0 and is also supplied as part of wxPack.

wxFormBuilder is easy to use, simple to look at, and provides a very decent set of features. It is a standalone system that is simultaneously good and bad, goosd that it requires nothing else, bad because some people require IDE integration. You can output the designs to XRC (the XML based resource language for wxWidgets) or to native C++.

You can see some screenshots of version 3.0 here. The screenshots so some fairly interesting and complex designs demonstrating some of the power of the system.

You can see their roadmap for features here. They use flyspray for their bugtracker (which is a good system).

What is particularly nice about this program is the amount of GUI widgets it supports including the contributed ones like wxFlatNoteBook. I thin it supports enough to create a very good GUI visually.

14 May 2007

Microsoft Opens Salvo Against Open-Source

I believe knowledge wants to be free, it never thrives when it is being stifled by secrecy. I am an idealist in that regard although I am willing to admit I fail to do enough about it (hopefully I will get around to changing that).

My TortoiseSVN integration into Visual Studio is out there because I wanted people to not go through what I did to get it up and running. Because the project that makes it possible is open-source, there is no reason I should keep something so trivial secret that makes it more useful.

It seems that the war is about to begin. Microsoft have declared that free software violates 235 of their software patents. Microsoft are not specific beyond application areas like office applications or email. The article itself is deliberately inflammatory, especially the choice of pictures and captions.

This article is merely a couple of days after this article in which Microsoft declares that fee software does not exist. In fact Bill Hilf (of Microsoft's Linux Lab) is so wide of the mark it is not funny. He seems to equate people having jobs means that free software does not exist, and goes so far to say that there is no community when Microsoft are masters at astroturfing. For a start it is Open-Source software and free as in libre software, it is about knowledge being free, not about the cost being nothing. Sharing knowledge surely makes a better society.

In fact Microsoft are deliberately framing the debate mainly focussing on trying to term it all "free software" and trying to make it mean what they say it means. Microsoft are trying to create a public awareness of people sharing knowledge to create better software being a bad thing by making it sound like it does not really exist and is a corporate conspiracy.

Microsoft are treading dangerous ground now because they are going to start alienating people. Most importantly they will alienate some areas of the development community, I know I have no interest in contributing to anything Microsoft will do, and I plan to steer clear of things like .NET for philosophical reasons. I started to use VS2005 Express because it is free, but all home development I do from now on will be using non-MS tools (hopefully GCC 4.2 will be out soon).

All of this does prove that the doomsayers from the Novell-Microsoft agreement were right on the money.

Eben Moglen ( former general counsel to the Free Software Foundation) has given an interview here. He has been instrumental in getting GPLv3 together. There is an interesting article about misconceptions about the GPLv3 licence here. Alex Cox, one of the instrumental developers on Linux has also given his backing to GPLv3.

In almost unrelated news Intel have released more open-source graphic drivers. Also AMD/ATi have committed to releasing open-source drivers.

13 May 2007

Bugzilla 3.0 Released

My favourite bugtracker Bugzilla has just released version 3.0.

New features include custom fields, an XML-RPC interface, per-project permissions, better UTF-8 support and much more.

I think the reason that I like Bugzilla so much is that it is a developer's bugtracker. it is not the prettiest or simplest of the bugtrackers out there, but it has masses of useful features and is very configurable. It really does make a developer's life easier since I find it more centred around getting the bugs done and dusted rather than attempting to make it look nice for non-techies.

12 May 2007

Code Correctness

One of the things we pride ourself with at work is well written code. In a previous post I have mentioned the code review (also known as peer review) process, but we also use Lint by Gimpel Software for static C++ code analysis.

There was a new article about The Problems of Testing 64-bit Applications which is interesting from the point of view that it approaches the problem from a code correctness viewpoint.

At the end of the article there is a good selection of links to interesting software, papers and theories.

11 May 2007

C++ in Visual Studio Orcas

Here is an interesting article about C++ in Visual Studio Orcas. I get the feeling of deja vu from reading something similar...

Anyway some of the C++ stuff...

Vista styles support. Lots of work has been done on MFC to make it use the Vista common controls like file open dialogs and the rest.

New common controls. New common controls are available like a split button and network addresses and more.

Resource editor. It has been sorely in need of some work in recent releases and it looks like it will finally have support for 32bit colour images.

User Access Control. Some built in support for UAC through the manifests and the suchlike.

Compile in parallel. The parallel compilation will be ramped up to allow faster builds, which is always useful.

KDE4 Alpha 1 - Knut

The first alpha release of KDE 4.0 has just been released. Exciting times are certainly ahead for this desktop environment.

At the link you'll see some pictures, which are not radically different but do contain the spiffy new Oxygen icon set. There are improvements to the backend including being based on the latest Qt, and multimedia and hardware support through projects like Phonon and Solid.

The release is expected in October 2007. Most of the work looks like it will start to concentrate on bringing the apps and the look up to scratch.

They are also asking for help to make sure the apps follow the Human Interface Guidelines here.

10 May 2007

MinGW GCC and all that great stuff

One of the most overlooked programs out there is GCC - The Gnu Compiler Collection - a vast array of development tools that are truly free to use unencumbered.

It provides a suite of compilers from Fortran, to Java, to C++.

At the moment for Windows unless you use Cygwin (not recommended) you will be using MinGW which is currently at version 3.4.5, some way behind the version available on Unix systems (which is in 4.2 prerelease). The good news is that once gcc 4.2 is released it will be released for MinGW, which should mean lots of good improvements, from standards compliance to OpenMP to speed ups from new optimisations.

Obviously it does not only target specific OSes, but it also targets different platforms including 64-bit.

Admittedly it is not as fast the the Microsoft compilers, but maybe it will get there. One worry is that Microsoft will lose interest in their compilers for native code as they go further and further down the .NET route.

Open-Source Java

Sun announced the open-source Java Development Kit recently. It's under the GPLv2 license and it looks like they want to capture the open-source community.

This could be a really interesting period since Java may start to gain even more traction as more people become involved in its development. Hopefully meaning slicker VMs being released.

OpenBSD are currently merging this release into their codebase. I imagine others will not be far behind. I hope it means that it becomes well supported on many platforms.

You can see the OpenJDK website here.

SPA Cambridge Meeting - CMMI

Went to another talk from the BCS SPA Cambridge group. There is a talk every month and they are normally well worth attending, there is certainly nothing else I have found like it elsewhere. As usual they are hosted at Microsoft Research, Cambridge with a buffet.

This month's talk was about CMMI hosted by Kieran Doyle of Lamri. I must admit I had no idea what CMMI was before going to this talk, only what it was an acronym for. For the first half of the talk I had no idea what was going on as it covered the history of it, and did not explain what it actually was.

Eventually we got onto the nitty gritty of this thing was. I'd have to see what the benefits were in reality but the premise of itself is admirable, especially in a larger corporation. Overall, I actually learnt something that is a plus, and also the at the talk we got free 512Mb USB keys - not half bad.

Anyone interested in computing in the Cambridge area should check out these talks.

08 May 2007

New Blog Of Interest

An interesting new blog is out there about physics-based animation. You can go and read it here.

It is mainly from a gaming perspective but I think that most of the theory can be applied to engineering as well. A lot of great theory comes out of the gaming arena and they certainly share ideas a lot more than the engineering arena.

Adobe ASL

A new version of the Adobe ASL open-source GUI library came out on the 3rd May. The releases of this library seem to be steaming ahead at a monthly rate. As far as I can tell it is not in production use at Adobe but provides a testing ground for theory.

You can see the changelog here.

02 May 2007

CMake - Cross-Platform Make

CMake is a cross-platform make system that seems to be gaining a large following. It is simple to write the make definitions and the program can create platform specific builds including Visual Studio.NET project and solution files. There is a nice Wikipedia article here.

Recently KDE successfully transitioned to the new build system relatively painlessly, when the previous system was essentially unmaintainable.

It provides support even for SWIG - the Simple Wrapper Interface Generator. Which is interesting from a library standpoint.

There are hooks for testing regimes available from the main website.

Admittedly from the Visual Studio viewpoint it would probably be a hard sell to others. The main problem I have with Visual Studio is that it screws with the vcproj files massively on seemingly innocuous edits. At least then you have complete control of your build environment without worrying everything getting altered due to GUI edits.

01 May 2007

Dell Offers Ubuntu Linux Option

Dell has officially announced they will be making Linux based computers.

Dell are going to offer certain computers with the option of Ubuntu 7.04 (Feisty Fawn) as the pre-installed OS. This is a good thing because it will at least guarantee the hardware and support of those platforms will be well catered for in the Linux environment.

All in all this is a good thing, and I hope it spurs other computer makers into the same area.