Latest Entries »

As of late my circumstances haven’t allowed me to do coding in reasonable volumes and it has been a point of frustration and concern to me professionally and personally. So I recently dug out an old URL I found a while back, www.projecteuler.net

For those too lazy to click the link and read.. it is essentially a decent set of problems that require some sort of computation to solve the problem in reasonable time. In other words, it needs a computer program which means programming. Ultimately you can choose any programming language you like to solve as the website only requires the final output to verify whether you got the solution or not. While perl, python or even bash may have been the shortest path to programmatically solving the problems, those languages are not where my interests are. So I have chosen C++ and I have begun tackling them. I doubt I will share my solutions as it defeats the point of the website and there are forums for sharing after successful completion of each problem, but I will share side lessons that I learnt to achieve solutions. For example I have chosen to do away with make (I will be developing in C++ on the linux platform for educational purposes) and I am giving scons a try and for the time being I will be editing code in vi. Development environments under linux are HIGHLY subjective and I may even say contraversial. So I will learn in stride.

Something that I am also attaching to my project euler exercises are time trials.. Evaluating program execution times which has also been suprising as it seems there may not be a cross platform C++ standard for high resolution time measurement. That requires the use of OS specific system calls. No matter though there is a host of online examples which I will add to the list of URLs below that may or not be worth reading..

This is all in an effort to learn C++ to a semi reasonable standard which is actually quite a challenge if you plan on doing something reasonable with it. So I think in summary I want to atleast achieve the following out of these exercises (all of which specific to C++) :

  1. A complete understanding of the coding standards

  2. Intuitive feel of the syntax

  3. Writing efficient readable code

  4. Solving generic logic problems with it .. AKA Brain gym

  5. Learning relevant APIs that are taken for granted in higher level languages (such as Java’s GUI APIs)

  6. Comfort in the dev environment (whether that be a generic text editor like vi or a full fledged IDE like Netbeans or codelite)

Links used :

C Timer? – https://sites.google.com/site/jivsoft/Home/timer

C++ Timer – http://www.songho.ca/misc/timer/timer.html ; http://takinginitiative.net/2008/08/31/multiple-high-resolution-timer-class/

No Timing standard in C++ – http://comp.std.c.narkive.com/HiXsAVSr/any-standard-way-of-geting-timer-resolution-finer-than-1-second

Header files explained well – http://www.learncpp.com/cpp-tutorial/19-header-files/

Build system scons – http://www.scons.org/

IDEs :

https://www.netbeans.org/

http://codelite.org/

http://www.eclipse.org/

Troubleshooting tools :

Valgrind(tried briefly and seems easy to use) – http://valgrind.org/

TAU (want to try..) – http://www.cs.uoregon.edu/research/tau/home.php

Various Coding standard guides :

http://www.possibility.com/Cpp/CppCodingStandard.html

http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml

http://geosoft.no/development/cppstyle.html

Β Often a sore point for some.. gaming under linux has finally started getting more serious backing from a major game developer and publisher. Valve.

After applying for beta access to Steam I left it be until the started opening up the group to larger albeit closed groups of Linux users. My main linux machine that I had planned to test Steam on is a Dell laptop, an i7 with a GT 540m Nvidia card. I expect my machine would be less common and a good source of testing for valve’s new platform…

When I finally got access to Steam I installed it under Mint 13 (with MATE as my desktop manager) and although the client launched as is, I only had one game that was supported by Linux, Team Fortress 2. For a while the only message I could get from launching it involved a requirement for S3TC Support. After investigating I found the S3 Texture support should be included with a DRI support. With this dependency already installed I had to find a way to launch a specific application with the S3TC enabled.

force_s3tc_enable=true steam

I find this sad in itself that something simple was not covered as part of either the environment (in this case Linux) or the application(in this case Steam). A fail in my opinion but I carried on out of interest and hope. Needless to say this arcane command did not do the trick on its own, as steam would launch, Team Fortress would launch, but alas at most ONE texture would load making the menu unusable…..

After I formatted and installed Mint 14(still with MATE) I thought I would give my Steam problem another tackle. This time with a focus on experimenting with drivers. My first attempt was to try Nvidia’s website directly to try native binaries straight from the source. This ended in disaster with forced resolutions of 640×480. So I decided to stick to drivers available straight from the default repositories. Unfortunately my encounter with the nvidia.com driver pretty much left my /etc/X11/xorg.conf unusable and I decided to start from scratch by installing drivers all over. This became a story on its own as it took over a day to get my 3D acceleration back. To try keep a long whine short, after the following articles I managed to get my 3D acceleration back :

http://askubuntu.com/questions/22118/can-i-install-extra-drivers-via-the-command-prompt

http://steamcommunity.com/app/221410/discussions/5/846939854395048434/

After using the “EXPERIMENTAL” drivers AND specifically using jockey-text to enable the driver (why wasn’t installing the driver enough?), I was able to use my card properly passing the glxinfo or glxgears tests. To boot, Team Fortress 2 is also working after months of on and off of experimentation.

I am glad Valve is taking the steps it has, if anyone can kick off the Linux gaming world more seriously and commercially, it is Valve. I am appalled at how many sysadmins accept the problems that come out of trying to game on a linux machine. Computer admins, programmers and the like may be capable and even interested in tweaking the OS to get it to work, but until the graphics/gaming giants step their Linux game up (and perhaps linux could enforce standards a little more, why so many varying dependencies?), Windows will continue to dominate the PC gaming world.

Cheers |-(

Hi All

I realized I had a backlog of mostly-written blog entries that I write at the time ofΒ  “inspiration” but I don’t tend to publish immediately cause I like to proof read etc. So if I tend to publish things that seem out of context/date then don’t be confused, I like to try publish as much as legally possible if only for archive sake

Ciao πŸ™‚

So during a conversation with some colleagues the topic of RobotWars came up. Not the ones in real life though, but virtualized. As in, you program the behaviour of your own robot and then you compete with other programmers (or your own robots). I have never heard of programming games like this (I know of logo, or turtle) so I had to start reading up on them and there are dozens at least. I think just the idea of this is awesome. So I have been digging through them and a lot of them seem to be built around their own scripting language which may be faster to get going with, I liked the idea of a RobotWars clone that used a full commercial language which includes all the language’s bells and whistles. So far the only one I have found that does is called RealTimeBattle. Check it out at :

http://realtimebattle.sourceforge.net/

Unfortunately the latest source code available for download did not build. As it turns out the project hasn’t been updated since 2005 and the C/C++ compilers and their standards have changed somewhat since then. Most of it has to deal with string handling, plus I found patch lying around that was published around from 2006 that was necessary to get the source to compile. I am a bit surprised that there is no backwards compatibility with regards to string handling but until I look into why the APIs have been changed the way they have, I shall assume that the gurus managing the C/C++ standard have good reason for refactoring the way they did.

If I can get in touch with the original RTB programmers, I will try get my patched version added onto sourceforge. In the meantime here is a download link just in case I can’t get the sourceforge version updated :

RealTimeBattle 1.0.8 Revised

Just as a caution, I did not take time to optimize my changes, such as the use of namespaces which may not be necessary. Feel free to optimize yourself.

Ciao πŸ™‚

So it has been a dang long time since I last posted anything… In short, a job change happened and it has been a steep learning curve with a large change to the industry I work for. I have moved from Business Systems software to telecommunications with VOIP. Despite the stressful move I have learned about some awesome tech and am getting into some advanced software which I am looking forward to getting involved with. Although I will probably be most heavily involved with Java work, I do get a fair amount of exposure to the C written PBX and hopefully some C++ for some of the smaller utilities used which are languages of interest for me personally.

Part of the learning curve has been using Linux which I started off with simply by using it in a VM, but I recently ditched the VM and moved to Linux Mint 13 as my main OS. All that aside, once I get a firmer grasp of VOIP and its related tech, I will hopefully be able to blog a little on some of the lower details involved.

Anyway, just wanted to put up a brief status update,

Ciao πŸ™‚