Setting up a Windows-only network printer for Linux/Mac access.

Due to a lack of a sensible place for this documentation, it’s going on my blog:

We have a Canon MF5770 printer/fax machine which only has Windows drivers. I’m only interested in printing, not faxing, and have the following workaround (which requires a Windows XP machine as a go-between):

Install necessary software:

  1. Install Ghostscript, GSview and RedMon from the Ghostscript site
  2. Install “Print services for Unix” (under “Other Network File and Print Services” in Add/Remove windows components.

Add a Postscript printer to work as a go-between:

  1. Start “add printer” wizard
  2. Choose “local printer” and untick “Automatically detect my plug and play printer”
  3. Choose “Create a new port” and the “Redirected Port” type
  4. Use RPT1: as the port name
  5. Choose a Postscript printer – I choose HP Color Laserjet 4550 PS
  6. Call the printer something without a space (I used “mf5770gs”), and no to default
  7. I shared the printer
  8. No to test page
  9. Open the port settings for RPT1: (printer properties – Ports – Port Setttings)
  10. Redirect this port to program: “C:\Program Files\Ghostgum\gsview\gsprint.exe”
  11. Arguments for this program: “-printer “Canon MF5700 Series” -color -“
  12. Run: Hidden

Print a test page – if all is well it should come out.

I did have to add TCP port 515 to the XP firewall exceptions for it to work, but apart from that the system works flawlessly.

Vista has got to go.

I’ve finally reached the end of my teather with Vista and it has got to go. Why? Not because of UAC, the constant RAM useage of 900MB with nothing else running, the rebooting without prompting me to save whenever windows update feals like it or the fact the a third of my PC games won’t run on it. It’s going because I played two games of minesweeper last night and both times minesweeper crashed (“Minesweeper is not responding”), before I got to the end of the game, in response to me doing nothing more than right-clicking on a square to mark it as a mine (and yes, I did let it send the crash reports off to MS).

On a not entirely unrelated note I spent Monday afternoon slipstreaming SP3 and last Thursday’s emergency hot fix into an OEM XP Pro CD (having discovered I didn’t have an OEM disk at home after taking my boss’s laptop home to reinstall it) using nLite. It was surprising easy and having a CD into which I only have to type the product key and the owner information to get a properly localised British XP install was a very nice experience. One thing I don’t understand is why Microsoft cannot supply localised install disks in the first place. I appreciate that there would be additional cost in producing the different disks but Microsoft is large enough and should be profitable enough to be able to do that. Failing that they could always re-write the installer so that once I tell it I’m in the UK it automatically sets they keyboard, timezone and language preferences (like most Linux distributions) rather that me having to change it in 5 different places.

Oh, incidentally, I am still alive ;) .

Windows FTS

Windows just helpfully rebooted itself (in order to install updates) because I did not spot that the “Rebooting in 5mins…” dialogue had appeared in the background. The last time is showed (10 minutes before) I only managed to catch it 3 seconds before it was about to restart the system. I find a number of things wrong with this:

1. A dialogue which will result in something happening if immediate action is not taken to prevent it (which is a bad idea for a dialogue in the first place) should draw as much attention as is (sensiabily) possible to itself. Being always on top would be a good start, as would flashing the taskbar. That way it could not be ignored and the user would have to clear the dialogue by selecting the “reboot now” or “postpone” buttons. (Note I said “on top” not “focused” – focus stealing is evil and even a critical dialogue like this should not practice this method of grabbing the user’s attention.)

2. Rebooting the system should require elevated privalidges (in my opinion – and if Windows update is already running with elevated pricalidges why am I not prompted to allow it to have these? I am when most Linux distros wish to install updates). What is the point in preventing programs from installing software, altering critical system files etc without my being harrassed by UAC if a process can reboot the system on a whim?

3. For the love of bob can IE please prompt me to save the tabs when a reboot is being forced upon me, in the same way as when I click on the big red ‘X’ in the top right? I not only lost the tabs I was still reading through, but also the contents of my shopping basket on an e-commerce site. As I now do not have the time to rebuild the contents of the basket (due to venting my frustration at my blog, which is far more fun ;) ) the site in question has lost a sale (for a few pounds shy of £100), thanks to Microsoft.

 On a completely different note: I am currently debating what UI convention (specifically related to button placement in dialogues, at the moment) to follow for a new web app I am thinking about developing in my own time. The choice boils down to:

1. Follow MS Windows’ convention, which is likely to be most familiar to the user


2. Follow GNOME style convention, which make logical sense and (following button labeling guidelines, as well as placement) significantly reduces the likelyhood of dialogues in which the choice can be ambiguous as to which button will perform which action.

The fact that this is a web app means that following a non-MS convention may be more easily accepted by unskilled (strictly in the sense of computer use) workers than if it were a stand-alone app which was designed to be used within a Windows environment.  On the flip-side, following MS’ convention would probably decrease the learning curve due to the user’s existing familiarity with Windows-style dialogues.

It’s been a while…

I’ve not posted to my blog since the end of May, so after two-and-a-bit months it’s high time wrote something.

Whilst I’ve not been writing, I’ve also not been checking the comments. Due to the amount of spam, I require all comments to be approved by me before appearing on the site, so appologies to all the people who had comments stuck in moderation.

I’ve now been working in my new job for 2 months and it is generally okay. Windows, VisualStudio (2003) and Sourcesafe are all colluding to slowly drive me insane but for the time being I’m keeping the urge to take a Linux LiveCD into work at bay with healthy doses of Ruby and Debian in the evenings.

The one major cock-up I’ve made at work was a MS-SQL script to delete four rows from a table. Another, related, table had been corrupted and every row had been altered to point to the same (one) record in the first table. I had written a script to delete four faulty record and then fix the data in the associated table. Since I was deleting data I, as I make a point to always do, only used the primary key column of the table I was deleting from to ensure only the specific record which needed deleting was dropped. Unfortunately I was not aware of SQLServers ability to cascade delete record, nor was I aware that this feature was in use of the tabels in question. As a result the related table ended up with nothing in it. Whoops! We are waiting for the backup tape to be sent from Derby to Nottingham in order to restore the data to a point before the script was run. Fortunately all scripts which are run on live database servers have to be peer-reviewed, both for syntactic correctness and that they perform the task intended, before they are run so I have someone to share the blame with. I am, as the script writer, ultimately responsible for this mistake (through my own ignorance) however my colleague who reviewed the script should have been aware of the cascade delete and he did not spot the potential problem either. Nevermind.

For the past week I have also been shadowing another colleague who is left the company yesterday to learn about the systems where he was the only person with any knowledge. Last night hosting services, in their infinite wisdom, decided to move all of the servers involved in these systems from one location to an entirely different part of the country. The one thing that could possibly break everything should have now been performed the very night after the last day of the only person who knew these systems! Go go gadget forward planning.
I have a number of other things to write about, but I have to go to work early today in order to be there should the server move cause any problems. Maybe I’ll find time to write some more tonight (I wouldn’t hold your breath, though).

Vista Clipboard

One of the really useful new features in Vista (and Server 2003, apparently) is the `clip` command, e.g.:

echo foo | clip

This nifty command copies whatever is piped into it to the clipboard, for easy pasting into other Windows applications. Of course, Linux users have been able to do this trivially for ages in both GNOME and KDE.

People suck…

About two months ago a coworker of mine suggested that I implement a Palm-based data entry program for our stock database system (which I wrote). As I had no experience at all of writing applications for anything more (physically) portable than a laptop I was not overly keen on the idea, and a few hours of me being less than enthusiastic seemed to have kept him quiet. At least until a few weeks later when I was presented with a brand new palm (the company’s (of course!), and now in the less than safe hands of one of my other coworkers) and told to write said application.

Last week I had finished implementing a storage and retrieval system and was just starting work on the facility to edit stored data (a fairly trivial task once it was possible to save a new record and view existing ones). The coworker who initially requested the system duely demanded a progress report, which I gave. I was promptly told that editing existing data was not needed, so I deployed the application. Fast forward to yesterday, when another coworker (the one who actually uses the shiney new palm, and my app) says, “You know what’d be really useful? The facility to store part of the data and to come back and edit it and fill in the blanks later, without returning to the office to use the PC-based frontend.” (or words to that effect). People suck, in this case because they don’t know what they want (or, rather, they think they know what they want and then demand that you provide what you thought they wanted after they told you they did not want that (still with me?)).

On a completely unrelated topic, Vista is still going strong on my laptop with only 2 major gripes at the moment. The first is that it uses well over 1.5GB of memory (of which less than half seems to be accounted for by Task Manager’s process list – and yes that is running with administrator rights, my user alone seems to only be using ~200MB although IE7 doubles that when running) which means doing anything (from loading an application to compiling a test build of a program) involves waiting about 3 minutes for Vista to swap enough stuff to disk(the laptop has 1GB physical RAM) to perform the task it was asked to do. The second is that I can not seem to lay my hands on a decent free archiver which works with Vista, my usual choice (IZarc) has major issues, as does 7Zip and several other ones I’ve never heard of before but tried. At the moment I’m using the WinRAR trial and hopefully IZarc’s issues will be resolved before the trial expires. I have not yet had chance to play about with getting WMP11 or MPC to play my music collection due to work, coursework, a sister in hospital and other bits and pieces I have to do to survive and pass my degree. I will probably have to activate Vista soon too, hopefully it will require less effort than the 5 calls to Microsoft it took to activate (pre-installed!) XP on my old laptop.

Windows Vista

At XING on Friday I installed my (free!) copy of Windows Vista on my laptop. I was very skeptical about it, from all of the screenshots and reviews I had seen plastered about the internet I though it looked dire and most of the “new” features seemed to be poor imitations of Apple’s OSX features. How wrong I was. Even IE 7, which I thought was completely unusable when I ran it under XP, has grown on me – especially as explorer (the file browsing bit, at least) uses the same UI layout and having used it for a couple of days I find it much better than the old Windows’ UI.

One of the things which took a bit of finding was the keyboard shortcut to bring the sidebar to the front (Win+G, if you wanted to know). I read the help and searched the Microsoft Knowledge base. Eventually Google came up with a link to the answer tucked away on someone else’s blog. As it doesn’t seem to be refered to in any official documentation I can only assume that this person found it by trial and error.

The search box on the start menu is fantastic, not quite as good out-of-the-box as OpenSuSE’s or the Gnome deskbar, but a welcome addition. By installing a small .NET app, Start++, it is possible to extend the functionality and since it allows you to bind arbitary programs to commands it approaches the power of the deskbar. The only thing it lacks is the ability to display results in place from, say, a Google search. The deskbar achieved this via a plugin which used the Google API (for which you had to register for an API key, but that’s free) – I’m not sure the same would be possible with the Vista start menu.

The lack of Codec support in Windows Media Player is highly frustrating. WMP has never been able to play many of my videos, so I’ve always used something else like VLC. Unfortunately all of the media players I’ve tried (all 3 of them) have varying degrees of “issues” with Microsoft’s latest OS. I expect that they will soon fix them, but I’m impatient so I tried playing a video that I had laying around my USB Pen drive and WMP connected to the internet with the promise of downloading the codec required. Some 5 minutes later it gave up and said it couldn’t find one. I have no idea (nor do I want to know) precisely what codec the file is encoded with, all I know is that it’s a .avi and on Windows that means it opens with WMP. It would be nice if WMP could play media files.

When I home I like to sit my laptop to the right of my desktop’s TFT and use Synergy to control the former from the latter’s keyboard an mouse. The latest version of Synergy seems to work flawlessly on Vista, as testified by my writing this using it. One quirk I did discover is that when an application running with elevated privaledges is focused Synergy stops working. I assume Windows actively prevents other programs controlling the keyboard and mouse when an elevated app is focused to prevent any of these nice scripts with move the mouse to perform unwanted actions from working. I think this is a great feature, however it is somewhat annoying when wanting to use an application which has to run with elevated priviledges to work (Eclipse being the only example I’ve found to date as swt seems to throw an exception when run without elevated priviledges).

As I’ve already mentioned, IE 7 is growing on me as a browser. The only things really holding it back for me are a lack of adblock (I’ve found no sensible, free (of the beer variety) things for IE which duplicated the functionality), no find-as-you-type within pages (rectified thanks to a find as you type plugin) and mouse gestures. I did install IE7 pro which promised all of these things, and more, but it was horribly unstable and I had to remove it to be able to use IE without it falling over.

Also worthy of mention is MyExpose, which brings OSX’s expose feature to Vista. Despite all of the pleasant surprises with features which managed to far exceed my expectations, the new Win+Tab thing is just as bad I thought it was going to be. It’s actually less use than Alt+Tab, and that’s not terribly useful much of the time.

All of these “new” additions to Microsoft’s OS mean, at the moment at least, Vista is about on a par with the latest offerings from the GNU/Linux world (although Vista’s are slightly less configurable). Whether or not I continue to use it when I still have a perfectly good Linux install remains to be seen. I am sorely missing BASH and the core GNU utilities (grep, sed and friends) for processing a large volume (~40,000 lines) of data for my Neural Computing coursework.

Project Management and Revision Control

I quite like trac and use it for “managing” (for well defined values of managing) the various projects I work on (I’m currently using subversion for version control and so trac makes logical sense as it was designed to work with subversion, although other version control backends are now supported).

Recently a former student at Warwick, Peter Ellis, gave an interesting talk on managing projects based upon his experience working in industry. During his talk he alluded to liking the bazaar revision control system. Bazaar is a distributed system, as opposed to subversion and the older cvs systems which rely on a central repository.

Personally I could not see the advantage of distributed versioning over centralised and could not get my head past the idea the distributed versioning would result in a horrendous mess of different version distributed all over the place which were completely out of sync.

Seeking further enlightenment, I spoke to some of my peers at Warwick who were using a distributed versioning system for the project they were working on. They pointed out that as the version control is distributed every checkout is in effect also a repository. This allows the same work flow to occur offline as online with all of the changes to the repositoy pushed upstream when it is more convinient (i.e. an internet connecting is available). As a result many changesets can be applied to the local repository, which is desirable when multiple major alterations are being made to a project. With subversion this would not be possible without a connection to the central server due to its concept of a single ‘Working copy’ when offline.

The only downside I see to switching to bazaar (or a similer versioning system) is that my use of trac’s bug tracking/milestone management and wiki, negate the benefits as I have to have an internet connection to use them. While I could live without the Wiki as I can just store text files inside the repository with the same contents (in fact the wiki was initially populated from text files containing various ideas I’d had, when I started using trac) I cannot do without the bug tracking and milestone management.

Looking around on the internet I found a couple of promising looking bug tracking systems designed to be used with distributed revision control systems, such as Bugs Everywhere and artifacts. Tracker for ruby also looked quite nice, until I realised it was using SQLlite which, although it stores its data in a single file on the filesystem, uses a binary format which is unlikely to place nice with most (if not all) versioning systems. Both Bugs Everywhere and artifacts are written in Python. I was unable to get Bugs Everywhere to run under Windows, and artifacts seems to run but spaffs out a lot of warnings if not being run within a darcs repository.

As a result I am sorely tempted to write my own bug/milestone tracking system in Perl (using only standard libraries, nothing from cpan, so it should just-work™ on most systems with Perl out-of-the-box™). The obvious criteria (besides just-working™) being a text-based storage method such that adding/removing & updateing bugs is easilly diff-able (for the revision control system), completely usable offline, allowing the grouping of bugs for milestones and reasonably attractive to use (whilst being command-line driven and avoiding the use of ncurses for the purpose of compatiblity, see below). Ideally the fields (priority/summary/milestone etc) would not be pre-defined so the user can create what is needed depending on the project (e.g. in an personal project ‘assigned to’ would be completely redundant as there is only one developer, me).

Whilst it would be nice to use BASH(and associated “standard” unix utilities) to write this, I think this would be a bad idea for two reasons 1. It does not solve the not working on Windows problem (I’m completely side-stepping cygwin here on the grounds that my laptop, which is my primary development machine, has ActivePerl installed for my third year project, but not cygwin under Windows) and 2. I can forsee this getting quite complex should I wish to add more nifty features (a stand-alone webserver for a web-interface would be nifty(if somewhat excessive!), for example) as which point BASH may prove insufficient and the project ends up depending on BASH and Perl whereas I might as well have chosen Perl in the first place and only have one dependancy.

Of course, even starting this project depends on me getting sufficiently far ahead with my third year project to set aside a day or two to write most of the code. The whole idea may end up on my stack of nifty projects that never get properly started, along with all the other projects I’ve been shelving there since my GCSE days.

On the topic of project management, I work Saturday mornings at Startin Tractors and often come home feeling that I’ve worked solidly for 5 hours and achieved nothing. This morning I made an effort to ensure I worked away at the bug list for the system I wrote and closed the tickets as I fixed them. As a result I returned home having commited 9 changes to subversion (as I avoid commiting broken code, on principle, this suggested that 9 problems were fixed), closed 4 tickets (however some items are, of course, considered to minor to ticket, like changing the wording of a dialogue) and opened 5 new tickets. Although a net increase in open tickets I came away felling I had accumplished a lot in the time due to the amount of activity showing up in the trac timeline.

Incidentally, looking at the timeline I can determine exactly what I was doing at any given point of the morning. I can tell, for instance, that the first fourty minutes of the day were spent fixing a bug in the “latest arrivals” facility whilst the last hour was spent (desperately!) fixing a critical bug in the caching system which caused the entire edit feature to die horribly whenever a change was made to an existing piece of machinery.

IE is lame

This is an old draft which I never properly wrote up, since I’m unlikely to find the time in the near future to do it I’ve decided to just post as-is. At some point I may edit it to make it a proper post.
The plan:

The bug:

The spec:

Why SVN sucks:

The solution:

More bugs in IE (5):

Flames, what flames? This is a full blown fire here! Quick, someone get the marshmallows!

Where did you get this installation media from, just out of interest? Did you download them, say, a DVD iso? Sounds rather large, if you aren’t going to be installing most of the packages by default.

If you aren’t going to install the compilers at install time when you know you want to use the system for development then you deserve to have some extra trauma. Granted the complete install ISOs are rather large, but since I personally know of only 2 people who do not have broadband this really shouldn’t be a major issue now-a-days and as you so kindly pointed out, if the large downloads do cause problems then there are people who will ship you CDs for a small charge. A friend of mine assures me that shipit will ship you one, or more, Ubuntu CDs completely free.

I think we might need pictures here.

  1. First of all we’re going to visit the website of a popular search engine, known as Google.

For some completely crazy reason I was using the search box at the top of the MicroSoft homepage to search the MicroSoft website for it, using various combinations of “Visual Studio”, “Express Edition” and “Download”. It took three searches to find a link which looked remotely relivent and I then had to follow a significant number of links to actually get to the download page. Perhaps Google is better at searching MicroSoft’s website? In future I will try to bear this in mind.

Visual Studio has a global library path, very useful for these library things. It even has a nice GUI to configure it! To access it, under Visual Studio 2005, follow: Tools -> Options -> Projects and Solutions -> VC++ Directories -> Show directories for: Library files.

Any path added to there will be searched by your project.

I didn’t know this. I was following the help pages(!!!) which just told me how to add the libraries to individual projects (I must have overlooked a section or page or something). Thanks for the info.

I wasn’t refering to the labeling of the menus, I was refering to the fact that they will be accessible via. alt keys (if they exist at all), and that windows will attempt to fill in any access keys that the application has failed to specify, meaning that you’ll always have a consistent interface.

I’m not sure “consistent” is the word I’d use, since the programmer can arbitarily bind the keys and hence override the defaults which Windows would like to use, however fair point that the menus will always be accessible via the alt keys assuming the application is using the Windows toolkit to draw its menus.

Hope that helps :)

It certainly does. Today kids we have learnt; Goole > Microsoft for searching (well, I knew this already – afterall it is what Google /do/ – I just need to learn to apply it), Visual Studio does in fact have a nice GUI interface for everything and do not draw menu bars in Windows without using the Windows toolkit and using non-“standard” activation keys.