Software Development
This is a simple change that can make using the Windows command line much easier. Adding a directory to the Windows PATH will mean Windows will search the directory when a command is entered. The main reason for doing this is that it acts as a shortcut for common applications you may run.
For example, instead of typing : "C:\Program Files\SomeProgram\Bin\MyProg.exe" --some-arg to launch an application, you can type MyProg.exe –some-arg. This has three main advantages:
- Looks Neater – This can be important if you’re using batch files. Long lines are hard to read, so shortening things is a good idea.
- Less Typing – Speaks for itself. If you use the command line or batch files for any amount of time, you’ll appreciate how much easier it is to use if you’re not typing full paths for your tools.
- Portable – Perhaps the most important detail. Not using hard-coded paths makes it easier to port your batch files to other machines.
Note: Be careful when editing your path variable, as you could render some programs unusable if you make a mistake. Also remember that changes won’t take effect until you restart the console.
Editing the Windows Path Variable
1) Right click “My Computer” and select “Properties” OR goto Control Panel and select “System”. This will open the “System Properties” window.
2) Switch to the “Advanced” tab, and select “Environment Variables”.
3) There are now two options. You can modify the global path variable, or add your own to your personal profile. If you want all users on the machine to have the same shortcut, add it to the global path, otherwise use the local one.
a. To modify the global path variable – Find “Path” or “PATH” in the lower window (marked Global variables). Select Edit. Add the path to your application. Separate paths with a semi-colon (;). Add trailing slashes if you wish.
b. Either modify an existing one using the tutorial above, or select “new”, then enter “PATH” as the name of the variable and enter the path value in the environment value section.

Modifying the Path Using the Command Line
If you’d like to do this using the command line, you can use the “setx” command included with Windows XP service pack two. To add the directory “c:\program files\SomeProgram\Bin” to your path, use the following:
setx path "%PATH%;C:\Program Files\SomeProgram\Bin"
Remember to include the %PATH% variable at the start of your setx command so that you’ll keep existing path names.
Related posts:
Creating software is a time consuming business, and it’s important to always be on the lookout for ways to reduce the amount of time spent on less important tasks. The process of actually building software (creating the finished distributable binary) is one such area that can be optimised. Opening up your IDE and hitting “compile” might not seem particularly time consuming, but it’s only one part of the build process.
To get you started, here’s a short list of tasks that can be automated:
- Compiling the executables and dependent libraries
- Packing media
- Creating an installer
- Uploading files to an FTP site
- Checking out files from a repository to be built
- Sending an email about a finished build to other developers
- Creating the application documentation / Converting it to HTML
- Testing the software
The benefits of using an automated build system include:
- Saves time – Run a build and leave the computer to do the work whilst you take care of other tasks.
- Documents the build process – If a build requires several steps before being completed, a build file will document this process for you. This is useful if templates need to be generated or options need to be set before a build is ready.
- Improves quality – As well as automating the creation of a binary package, tests can be automated. This saves a lot of time on the development end, as tests can be constantly run so you’ll quickly find out if the software’s behaviour has changed.
Simple Automation – Batch Files
The simplest way to automate many of these tasks is to use batch files. A batch file is a list of tasks to be run, usually in the form of a list of applications with some command line parameters. Using a few simple commands it’s possible to run many tasks in succession without any user input, leaving you to do more important things. Microsoft.com has a is a simple guide to batch files which is a good place to start.
As useful as batch files are, there is only so much they can accomplish, and there may come a time when something more complex is required for your project. Thankfully there are many build systems available
Build Tools
There are plenty of build systems available, and several of them are targeted at certain platforms or languages. It may take a while to become comfortable with a platform, but the savings are worth it.
- GNU make – A standard system used by many Linux projects. It consists of a plain text file that lists targets and dependencies, and features many advanced features such as automatically determining which files require rebuilding.
- Apache Ant – Ant is designed as a replacement for make, and uses XML files to describe the build process instead of text files. It’s written in JAVA, and is completely portable.
- nAnt – nAnt is a .NET based version of Ant, and although it is not exclusively for .NET developers it has many features that make it useful for building .NET apps.
- A-A-P – A-A-P is a portable build tool that uses text-based “recipes” to compile and distribute software, but it can also be used for other tasks such as publishing websites and generating files from templates.
- Visual Build Professional – VBP is a commercial build tool that takes a more visual approach to creating build scripts. It integrates well into many Microsoft IDEs, but also supports other languages such as Delphi and Java.
- BlitzBuild – A free build tool aimed at BlitzPlus and Blitz3D developers.
Breaking the Task Down
Most build scripts will contain more than a single command, so it is useful to break the build script into different groups or “targets” that can be executed individually. This is particularly useful if building of data files is included, as it can be used for art or music to be built independently of the main application. Many build platforms also allow targets to be called from other targets, which effectively breaks a build script into a set of functions that can be executed in any order.
Common targets include compilation, installation and cleanup, but the choice is entirely up to the developer. It may also prove beneficial to include a separate target for generating debug versions of the application which can be distributed as a troubleshooting option.
Related posts:
Zip files are one of the most common compression formats around, and are a great way of storing files. Using the userlib functionality of BlitzPlus and Blitz3D, it’s now possible to access and manipulate zip files from within your Blitz applications. This can be useful for packing your media, as well as compressing network data.
This article will show you the following:
- What files you need to use zip files in Blitz, and how to install them.
- How to open an archive file and find out what files it contains.
- How to extract a file from an archive.
- How to create a new zip file and add files to it.
- How to compress and uncompress Blitz banks.
What will you need?
Blitz.ZipApi — A free library that you can include in your Blitz project. It comes with everything you need to use zip functionality within Blitz.
Installing the files
Once you’ve downloaded the library, you’ll need to copy “zlibwapi.dll” and “zlibwapi.decls” to the appropriate “userlibs” folder so that you can use the userlib functions in your application. This will be something similar to “c:\program files\blitzplus\userlibs\”. The userlib file is fully documented and has XML comments for use with Protean IDE.
You’re now able to use simple zip functions, but if you’d like to get easier access to some of the more common functions, you should include the following into your project:
- Blitz_File_ZipApi.bb — Helper functions for using zip files in Blitz.
- Blitz_File_FileName.bb — A few functions for manipulating file names. Use them to get a directory name, file name and extensions from a string.
- Blitz_Basic_Bank.bb — PeekString and PokeString functions.
All of these files are included in the Blitz.ZipApi distribution, along with full documentation in HTML format.
How it works
The zip library works in a similar fashion to the standard Blitz file functions. Before a file can be read from it should be opened with ZipApi_Open, and once finished with it should be closed with ZipApi_Close. Files to be written to should be opened with ZipApi_CreateZip and closed with ZipApi_CloseZip.
Fully documented examples are included with the library, and are also available online.
Pages: 1 2
Related posts:
Subversion is an open-source version control system. That doesn’t sound particularly interesting, and at face value it isn’t, but you only need it to save your skin once to realise how useful it can be.
Version control is a method of storing different revisions of the same file, usually source code or documents. This allows developers to see when changes to a file have been made, which can be useful for isolating bugs, and can also be used to “roll-back” a file to a time before a bug was introduced.
Along with these features, version control allows developers to merge two versions of a file, which is very useful for projects with more than one person.
This article covers the following:
- What software you need
- Creating a new repository
- How to set up a Subversion server
- Adding password protection to a Subversion repository
- Laying out your repository and importing files
- Checking out and checking in
- Using tags and branches
What you’ll need
Subversion – The primary download is source code, but there are binary versions available for different operating systems, including Windows, Mac OS and most common flavours of Linux.
If you intend to use Subversion mostly from the command line, you might want to add the Subversion binaries directory to your Windows PATH variable.
Optional Downloads
TortoiseSVN – If you’re using Subversion with Windows, I highly recommend installing TortoiseSVN. It integrates with the Windows explorer shell, so you can see an icon if a file has been changed. You can and also check in items, commit changes and perform other common operations with a few clicks of the mouse instead of using the command line.
Pages: 1 2 3
Related posts:
I use the “Sociable” WordPress plugin to add social bookmarking links to the bottom of every post. There are a tonne of social bookmarking sites around, so I’ve kept things light to avoid the icon overload that can be seen on some blogs. I’ve made two updates over the last few days, one was adding devbump and the other was adding CSS image rollovers.
If you’re not sure about adding a few bookmarking buttons, you might want to check out the traffic increase at webloghits.com. That’s the kind of increase that is worth a few minutes of your time.
Adding devbump.com
There are a lot of digg style sites out there, but devbump caught my eye because it’s aimed squarely at game developers. Submitting your posts to places that are actually interested in the subject is always more useful, so devbump was a natural choice.
To add new sites to sociable, open up “sociable.php” and find the following line:
$sociable_builtin_known_sites = Array(
Once you’d found it, add the following after the “Del.irio.us” definition:
'devbump' => Array(
'favicon' => 'devbump.png',
'url' => 'http://devbump.com/submit.php?url=PERMALINK&title=TITLE',
),
You’ll have rebuild the list of available sites by logging in to your blog, and selecting “Restore Built-in Defaults” from the sociable page (Options -> Sociable). “devbump” should now be available to use on your site.
Adding CSS image rollovers
Now for the fun part. I used some code from Present Tense (Hacking the Sociable WordPress Plugin for Image Rollovers), but it didn’t quite hit the spot so I did quite a lot of tweaking to get things looking nice. I’ve stuck it all in a zip at the end of this post.
Before you skip ahead to the freebies, there are a few important things to note.
Tweaked “sociable.php” — I made two main tweaks to sociable.php. One was because some sites have “.” characters in their name, so it wouldn’t work with CSS class names. The other tweak was to change the way that the HTML was generated. Instead of standard images, it’s a list.
Internet Explorer — Naturally IE messes things up a little bit, so you might have to experiment a little bit to get things looking the way you want them. Removing the CSS tooltip may help.
16 x 16 Images — I like to have text next to my images, so each one has a different width. If you open “sociable.css”, you’ll see I’ve defined each networking site with a pair of definitions:
.sociable li.delicious a { width: 69px; background-image: url(images/delicious-hover.gif)}
.sociable li.delicious a:hover { background-position: 0 -16px;}
If you’re using 16 x 16 images, you can move the width statement into the “.sociable li” definition.
Adding New Rollovers
To add a new image, you need to add a class with the name of the site, and then set its image. It’s really just a matter of copying an existing class definition and changing the names. I’ll add new sites as time goes on, but at the moment I’ve only defined: del.icio.us, digg, devbump, Reddit and Furl.
Free Stuff!
Everyone likes free stuff, so I’ve zipped up all of the files I modified for your downloading pleasure. There are still a few bugs to iron out, so I’ll be modifying this post as and when things change.
To install the changes, just copy the files into your “wp-content/plugins/sociable” directory — you’ll need to have sociable already installed (download here).
Related posts: