ThoughtFactory.CreateThought() A random collection of thoughts from an easily bored developer

6Jan/090

InfoPath Form Security and Custom Code

Generic error messages are high on my list of pet peeves. Being told that "an error occurred" may be something that you can pass off in a line of business application, especially if the actual error message gets emailed to the help desk or something similar, but it is totally unacceptable in a product targeted towards software developers.

Tonight, when trying to add some managed code to an InfoPath 2007 solution, I ran into one of these horrible errors. InfoPath was presenting me with a highly helpful "InfoPath cannot open the selected form" error message whenever I tried to debugging the solution.

After spending a few minutes scratching my head I remembered that InfoPath forms need to run in Full Trust mode in order to use managed code. I navigated to "Tools>Form Options>Security and Trust" and had a look at the settings, which were still set to the default "Automatically determine security level". Unfortunately I assumed that, when using this setting, InfoPath would be able to figure out that I was using managed code and select the appropriate security level. Obviously my assumption was incorrect.

InfoPath Security Settings

After setting the level of trust to "Full Trust" I was finally able to launch the form, complete with managed code.

If I had not previously read about security and trust within InfoPath then I would have had to waste more time floundering on Google with only a generic error message to help me. All that could have been avoided if they had just presented me with a dialog saying "The form has an insufficient trust level to perform this operation". Well, either that or make the "Automatically determine security level" trust setting actually determine an appropriate trust level in the first place.

Tagged as: No Comments
5Jan/090

Fast Food Development

The idea of trust within a software development team is an interesting one. Jeff Atwood argues that a lack of trust between management and the development team can lead to "micromanagement zombies" who mindlessly follow anything management tells them without contributing creatively. I believe that the issue is much more complex than this, as demonstrated by the following comment from the post:

OK, what do you do if:

  • Your team regularly commits errors to make the editors of Daily WTF blush?
  • They've been doing it that way their entire career and aren't very interested in changing?
  • They're above average coders in the SE Asian nation you live in?

At least you can shoot zombies.

What we have here are two totally different approaches to software development: Fast Food and Gourmet.

The Fast Food approach delivers a bland product that is frequently prepared incorrectly, but it does it fast, cheap and using unskilled resources. The Gourmet approach delivers a higher quality product, but may take longer, will certainly cost more and requires a more experienced resource to prepare.

Successful fast food chains invest millions in making meal preparation as idiot proof as possible. Flashing lights and screeching sirens tell their employees are told when to wash their hands, when to flip the burgers and when to change the oil in the fries. They are micro-managed to the hilt simply because management do not trust their employees and expect them to fail if left to their own devices.

In contrast, a gourmet establishment has higher expectations of their staff. At the very least, they expect them to know how to cook as opposed to how to follow a checklist of specific orders. Most restaurants have to trust their staff to be able to perform their jobs to a certain level without specific instructions.

This parallel exists in many industries; for example, a master luthier would be trusted by his or her management more than the employee working the line in a factory that produced cheap, mass production guitars. Each has a place: some people want to spend $10,000 on a quality custom guitar, where as others would prefer to spend $150 on a cheap hunk of plywood that sort of looks like a guitar. To each their own.

The software development industry is no different. As much as some people would hate to admit it, there is a market for horribly written software that is impossible to maintain but was developed for minimum wage. It may be cheaper to produce a quality product using quality resources and best-of-breed practices, but that is irrelevant when the customer simply does not care about, or cannot afford, quality. These are the same customers who consider Access a viable solution, and who would have never been able to afford custom software before the advent of VB6.

To service these clients it may be necessary to use inexperienced or low-skilled workers and use management practices similar to those found in fast food restaurants. If you know that your resources are incapable of developing a product without guidance then all you can do is hope that they follow instructions and review, review, review.

I'm fortunate enough to work in an environment where high quality resources are the norm, but I have also consulted in the small business market and seen first hand just how common Fast Food Development is out there in the "real world". Regardless of developer idealism, cheap, dodgy software development is the oil that keeps the wheels of business running. As a quality developer you may not want to work in environments such as this, but that is no reason to stick your head in the sand and pretend that they do not exist or are not an important part of the software development landscape.

4Jan/090

Awesome cuff links are awesome

I've never been a fan of "bling". I don't wear watches, necklaces, rings, earrings or anything of that sort. If my shirt requires cuff links then I'll usually wear the standard "monkeys fist" style silk knot cuff links that come with some French cuff shirts.

Ctrl & Esc key cufflinks

Transformers cufflinks

Saying all that, I love these cufflinks. They were a birthday present from my better half, and are sufficiently geeky without being overly garish.

They aren't exactly "hey, look at me, I'm totally unique and quirky!" items, unlike, for example, the 8-bit tie, which I could never wear to work with a straight face. Perhaps if it came in a colour that wasn't bright blue or red?

Update: I've had a few people ask me where I got these from. I've been informed that they came from http://www.benjamincufflinks.com.au/.

Filed under: Toys No Comments
28Dec/080

Flashdance

Until recently, Adobe's support for Flash in 64 bit Linux environments has been pretty much non existent. Those of us who have made the jump have had to make do with nspluginwrapper, which enables the Netscape plugins to run on architectures (such as x64) that they were not written for. The experience offered by this solution was seriously sub par, and was almost a show stopper issue for me when deciding whether or not to make the switch to Linux.

This all changed when Adobe started releasing Alphas of the Flash 10 player for x64 linux distros. Finally we can run the flash plugin natively, ditching the horrid performance and "gray screen of death" that was commonly associated with nspluginwrapper.

It took me about 20 seconds to set up the new plugin using this guide from Softpedia. I uninstalled nspluginwrapper, created a plugin directory as instructed and copied in the libflashplayer.so file. Then I reboot firefox and....

Argh! The performance was even worse than before! What was going on?

A quick scan of top told me that a process called gtk-gnash was eating 100% of one of my 4 CPU cores. I had found the culprit. Unfortunately Ubuntu comes with a horrible open source flash implementation called gnash. The nspluginwrapper implementation had successfully kept it at bay, but now that was gone, leaving me exposed to the CPU usage equivalent of Unicron that is gnash.

After uninstalling everything to do with gnash and giving the system a quick restart for good measure, seeing as gnash had successfully crashed ALSA and a few other core systems, and I was up and running. Finally I can enjoy watching mind numbing Youtube videos and playing benign Flash games at a speed more befitting of my Quad Core box with 8 Gb of RAM!

Tagged as: , , No Comments
23Dec/080

DataDude for All

Picking an appropriate version of Visual Studio Team System for your team to use has always been an interesting proposition. The full Team Suite edition is outside the price range of most projects, and you have to make sure that the majority of your team will be able to see all of the artifacts with minimal trouble. Using features such as the infrastructure diagramming tools or database projects can often mean that you have one machine capable of performing that function, which can act as an annoying bottleneck for your team.

The choice of product becomes an even tougher question if you are a Microsoft Gold Partner (with ISV or CDS competency), as Gold Partners have traditionally gotten a certain number of VSTS Developer Edition licenses as part of their partner pack. This is great, but it makes it really hard to justify the cost of another version of VSTS. Other versions are now $4000 dollars more expensive than Developer edition, rather than all of the editions being the same price.

I have always maintained that, bang for buck, VSTS Database Edition is the best value for money out of all the VSTS editions, and, given a choice, I would pick this for every member of the team so that they could all use the database source control feature. It's the feature I always miss whenever I don't have the full Team Suite edition of Visual Studio installed.

There was much rejoicing, then, when I found this lovely little tidbit on the MS Partner site.

Certified Partners who have earned either ISV and/or CDS Competency are upgraded to Microsoft Visual Studio Team System 2008 Development Edition with MSDN Premium Subscription. Starting 1 October, 2008, these Certified Partners will be able to download VSTS Database Edition from MSDN Subscriber Downloads as part of their upgrade to VSTS Development Edition with MSDN Premium Subscription.

It seems that we now get the choice between VSTS Developer Edition and VSTS Database Edition. I for one am extremely happy with this news. Test Edition and Architect Edition have some nice features (most notably the performance testing tools in Test Edition which run rings around the old Application Centre Test product that came with 2003), but for me these two products cover the majority of the Team Suite features that most development teams would need.

8Oct/080

The Truth, The Whole Truth, and Nothing But The Truth

There's no denying that recruiters deliver a useful service to the IT consulting industry; without them we'd never be able to hire personnel with more than 2 or 3 degrees of separation from our current employees. However, the extended reach comes at a cost. The recruiters themselves are not IT consultants, and they also have limited time. This means that they need a way of placing candidates in positions that does not involve deep knowledge of the domain or a vast amount of time. A really effective way of doing this is through tagging.

The problem with tags, though, is that you can game the results if you know what people are searching for. The IT job market realised long ago that common industry buzz words and "hot technologies" form a large portion of the obvious tags that recruiters will be searching for. Since then candidates have been peppering their resumes with them in order to catch the eye of recruiters.

The good news is that job seekers usually won't put in keywords that have nothing to do with their technology space, meaning that you still get .Net developers sent through for .Net jobs and Java developers interviewing for Java jobs. The bad news is that a lot of candidates are rather liberal in lacing their resumes with terms that they think the employer will be looking for rather than terms that actually reflect their experience and understanding. They also have a tendency to apply this focus on keywords to the other parts of the interview process. What they don't realise is that no one involved in the actual hiring process cares about buzz words, so they are going to assume that you have experience with whatever you mention and treat you as such.

This is especially true at technical interviews. If you've indicated that you know all about XP, TDD, DDD, ORM and a bunch of other cool acronyms then you should expect to be asked questions about them. Questions like this usually carry much more weight, as you have set an expectation. To falter here indicates that you have either been dishonest or just don’t know what you’re talking about.

For example, if the interviewer asks you about a technology you know nothing about and you haven’t given them any reason to think that you know something about it then it's perfectly acceptable to say “I don’t know”. If, however, you indicated that you knew of the technology in question then not giving a decent answer looks really bad.

It's not uncommon for a potential employee to mention a technology that they know nothing about just because they might think that the interviewer wants to hear them say it. Pro tip: If a company wants you to mention random technologies you know nothing about just so they can tick it off on a list then that's probably not a company any decent consultant would want to work for. Any company worth their salt should be looking to assess your current abilities and your potential to grow, not trying to check off a list of buzz words to see if you are “compliant” with their “technology stack”.

So please, next time you submit a resume or go for an interview just try and focus on your actual experience and aspirations rather than getting hung up on what you think the company expects you to mention. Remember that there’s a good chance the person interviewing you either does a similar job to the one you’re applying for or has done in the past, so they’re going to be able to call you out if you don’t know what you’re talking about.

14Aug/080

Expand Your Mind

After the recent release of Visual Studio 2008 SP1 and .Net 3.5 SP1 I thought it would be a good idea to upgrade my Windows development environment to take advantage of some of the cool new features. I do .Net development on my Ubuntu machine by using VirtualBox to run a Windows 2008 Virtual Machine. It works quite well, especially if you're mainly doing server side stuff or Windows Forms. I'm not sure how it would handle the DirectX goodness of WPF, but I'm willing to live without that for the moment, and I can always install Vista x64 on another box if need be.

When I originally set up the VM, 20 gig sounded like a good size for the hard drive, so I set up a 20 gig dynamically expanding VDI file using VirtualBox and started installing. The dynamically expanding disks are cool in that they will only expand if need be, so if you create a 300 gig image and only use 20 gig of it, the VDI file for the drive only uses 20 gig of your actual disk space disk. I wasn't planning on installing office or anything else, so I thought that the drive would be more than big enough. How wrong I was.

After installing the Windows 2008, Visual Studio 2008, SQL Server 2008 and Firefox 3.0  I had around 3 gig free. Where did all my drive space go??? "No matter", I thought, "3 gig should be enough to work with for the moment, especially as I'm using network drives for all my data storage". I continued working like this for a few months, right up until I went to install the VS 2008/.Net 3.5 Service Pack 1 updates.

Half way through the install I merrily discovered that the service packs require over 6 gig of free space just to install themselves. But.. but.. but... I don't HAVE 6 gig of free space! It should be noted that the installation program says that it is merely "recommending" that you have this amount of free space, but it won't let you continue unless you free up the "recommended" 6 gig. That's a pretty definite recommendation.

My first thought was that to free up that amount of space I would have to uninstall either Visual Studio or SQL Server, which would sort of defeat the purpose of installing the service packs. Obviously this wouldn't do, so I went looking for ways to save a few gig here and there, and quickly discovered that I had a 2 gig page file by default. I reduced this to 200 meg or so, but I still needed to free up more space to install the service packs.

At this point I gave up on the idea of trimming back my install to allow the service pack to continue. I went hunting for some free hard drive cloning software, and found the excellent (and free) HDClone. HDClone allows you to copy one hard drive to another, and it can also expand partition so that it takes up all the space on the new drive.

Screen Shot of HDClone Running on VirtualBox

I downloaded the free version of HDClone and mounted the ISO in VirtualBox, then I created a new 230 gig dynamically expanding VDI file which should be enough to install the service pack (cough). I mounted the new drive as the secondary master for my Windows 2008 Virtual Machine and mounted the ISO in the virtual CD-ROM drive.

A quick reboot of the machine presented me with the HDClone interface, and in 4 clicks I was ready to copy my drive. It even asked me if I wanted to covert the partition to take up all 230 gig of the new virtual drive. I let it do the conversion and left it to copy all my data.

An hour or so later it was done. HDClone asked me if it wanted me to automagically set up my partition data, so I let it do that and then reboot. "Yay!", I thought, "finally I'll be able to install the service pack!".

Unfortunately it was not to be. When trying to boot off my new VDI file I discovered that it wouldn't boot, even though it new the OS was on there. I dug around for my Win2k8 install media and went into repair mode. Sure enough, Windows was reporting my partition as being 0 meg. Something wasn't quite right here.

I could have downloaded something like the Ultimate Boot CD to play around with the partitions, but it was late and quite frankly I couldn't be bothered, so I booted back into HDClone again and redid the copy, this time making sure that I said "no" to its overzealous partition magic (no pun intended).

Once that was finished I removed the old 20 gig VDI, gave it a reboot and bingo, I now had Win2k8 installed on a 224 gig drive. This was more than enough space for the Service Pack 1 installer to work with. I might even have enough room to install MOSS 2007 now.

25Jul/083

Coolest. Thing. Ever.

I honestly had no idea they made these. I saw them on display at the Target toy sale, but didn't get a chance to make a purchase. Ah, to be 10 again..

Halo 3 Laser Tag Game

Looking at these, I'm reminded of the all night Zone 3 sessions I used to frequent in my youth. It leads me to wonder how the Halo hardware compares to the commercial laser tag systems like they use at the modern Zone 3 equivalents like LaserCorps and DarkZone, as it would be pretty cool to have a LaserCorps style skirmish using the Halo gear. I somehow doubt they're going to have the range required, though, and probably don't have any concept of a central scoring system.

Wikipedia seems to have a nice writeup of all the different manufacturers of lasertag equipment, but it doesn't mention very many consumer kits. No matter, at least they look cool.

Filed under: Toys 3 Comments
16Jul/082

Command and Conquer Pt 1: The Basics

In the early years of public internet usage, before the days of PPP and SLIP (anyone else remember using a SLIP client to get IP connectivity??), one of the only ways to get connected from home was to dial in to a *NIX shell account using a Terminal Emulator application. To many people, their first exposure to the "internet" involved a blinking cursor and a plethora of confusion as their "dir" command refused to work.

That method of internet access hasn't been popular in quite some time, but regardless, the ancient art of staring blankly at the command line is making somewhat of a comeback through another avenue. With the popularity of OSX, Linux-based ultra portables and "friendly" Linux distributions such as Ubuntu, more and more people are being exposed to environments where Bash is the most common way of performing non-GUI operations.

"What's that?", I hear you say, "Non-GUI Operations? But I'm using the latest version of Friendlynix, the friendliest Linux distribution in the world! Can't I do everything through the GUI?". For the most part, yes. However, there are going to be times when you need to peek "under the covers", and it's best to be prepared lest you be shocked and disturbed by what you find. *NIX variants may have lost a lot of their rough edges, but it's not all icecream and cakes just yet.

So let's start with the basics. A *NIX style file system is completely different to the C:\ drive orientated view found in Windows. Everything starts from a single root directory, which lives at "/". All your devices, including DVD Drives, USB sticks, and hard drives,  live as branches of this directory. If you're interested, you should look into device mounting, but for the sake of this conversation it's enough to know that the top of your file system is always "/" and everything else can be found below it. Another thing to note is that most *NIX file systems are case sensitive. This means that, to the file system, "MySpecialFile.txt" is not the same as "myspecialfile.txt".

One of the most important things you'll need to do once you pop open your terminal of choice is get your bearings, as you won't be comfortable until you get a feeling for where you sit in relation to everything else. Depending on your terminal setup, this may already be shown to you as part of the prompt, but if it is not then you'll want to use a command called pwd, which means "print working dir".

garrys@GAMBIT:~$ pwd
/home/garrys

Here it is telling me that I'm currently in the "/home/garrys" directory. This is my home directory, and is quite often your starting point for a new shell session. Don't worry about the "garrys@GAMBIT:~$". That's my Bash prompt telling me who I'm logged on as, the machine that I'm logged on to and the current working directory. "~" is effectively a shortcut for your home directory, but I'll get into that a little later.

Now that we know where we are, we'll want to get a look at our surroundings. The ls command is the *NIX equivalent of good old dir, and the source of much confusion for recent DOS converts. It stands for "list directory contents", and that's exactly what it does.

garrys@GAMBIT:~$ ls
amsn_received         Music                       squeak.image
argo.user.properties  My GCompris                 SqueakV39.sources
autosave.xmi          nautilus-debug-log.txt      temp
Desktop               paw.metafile                Templates
Documents             Pictures                    uml_generated_code
Examples              Public                      Videos
GNUstep               runtime-EclipseApplication  workspace
gpodder-downloads     squeak.changes

Now, there are a few arguments for ls that you should be aware of. The actual format of the ls command is:

ls [OPTIONS] [FILE]

where [OPTIONS] is, for the sake of this conversation, a string starting with "-" and [FILE] is a filter that you would like to apply to restrict your query. Both [OPTIONS] and [FILE] are optional. [OPTIONS] represents a series of options that you can apply to your command to affect the outcome. An important thing to note is that these options can be combined, which makes for a pretty powerful little tool.

One of the most useful options you can apply is the list option, "l". It formats the output in a one item per row list, and also presents additional information on each entry, including file size. You would execute it as follows.

garrys@GAMBIT:~$ ls -l
total 16500
drwx------  2 garrys garrys     4096 2008-05-13 20:10 amsn_received
-rw-r--r--  1 garrys garrys     1439 2008-07-04 09:42 argo.user.properties
-rw-------  1 garrys garrys    18067 2008-07-14 20:34 autosave.xmi
drwxr-xr-x 15 garrys garrys     4096 2008-07-04 18:44 Desktop
drwxr-xr-x  8 garrys garrys     4096 2008-07-14 18:01 Documents
lrwxrwxrwx  1 garrys garrys       26 2007-12-02 09:07 Examples -> /usr/share/example-content
drwxr-xr-x  3 garrys garrys     4096 2008-07-13 21:10 GNUstep
drwxr-xr-x  5 garrys garrys     4096 2008-07-05 19:55 gpodder-downloads

ls in it's base form tries to be helpful by hiding various files from you, such as those that start with a "." character. If you'd like to see these, you can use the "a" option (think "all", as in "show me all files"). Here we've combined the "a" and "l" options to show all files in a directory in an item per row list format:

garrys@GAMBIT:~$ ls -la
total 17868
drwxr-xr-x 138 garrys garrys    12288 2008-07-17 00:31 .
drwxr-xr-x   3 root   root       4096 2007-12-02 09:07 ..
drwx------   2 garrys garrys     4096 2008-04-20 23:58 .abuse
drwxr-xr-x   2 garrys garrys     4096 2008-02-22 20:17 .ActiveState
drwx------   4 garrys garrys     4096 2008-05-30 23:57 .adobe
drwxr-xr-x   4 garrys garrys     4096 2008-01-04 13:50 .alien-arena
-rw-r--r--   1 garrys garrys      224 2008-05-11 23:53 .alsamodular.cfg
drwx------   9 garrys garrys     4096 2008-05-28 01:31 .amsn
drwx------   2 garrys garrys     4096 2008-05-13 20:10 amsn_received
-rw-r--r--   1 garrys garrys      657 2008-07-15 22:09 .amSynthControllersrc
-rw-r--r--   1 garrys garrys   116060 2008-07-15 22:09 .amSynth.presets
-rw-r--r--   1 garrys garrys      159 2008-07-15 22:09 .amSynthrc
-rw-r--r--   1 garrys garrys     1439 2008-07-04 09:42 argo.user.properties

Notice all the files with full stops at the start? Normally we wouldn't see these (and rightly so, as they are mostly settings files), but the "a" option makes them visible. There are many more useful options, such as "t" to sort by the modification time and "S" to sort by size, but those should be enough to keep you going for the moment.

After specifying all your options you are able to add an optional filter to limit your results. These filters can make use of wildcards. You will probably find yourself reaching for the "*" character more often than the others. It basically means "match anything and everything", and is incredibly handy. Using this you could do something like the following to match all text files in a directory:

garrys@GAMBIT:~$ ls *.txt
nautilus-debug-log.txt

As you can see, only files ending in ".txt" were returned. Very useful.

Now that we can look at the contents of a directory, how do we move about? We use the cd command, which means "change directory". cd is fairly straightforward, as the syntax is extremely simple:

cd [DIRECTORY]

There are a few special directories that you should be aware of. The aforementioned "/", or root directory, is probably the most important. If you cd to here then you'll be sitting at the top of your file system. As previously mentioned, "~" is a shortcut for your home directory. If you cd to here from anywhere in the file system then you will be taken straight to your home directory, usually /home/yourusername.

Every directory always contains two entries you can navigate to, "." and "..". The first, ".",  refers to the directory itself, so if you cd to this then you're not going to go anywhere. This is actually extremely useful, as you'll find out later on, but for the moment we'll ignore it. ".." refers to the parent directory (the directory "above" your current location in the file system). Technically you could cd to ".." until the end of time, as once you hit the root directory it becomes just like ".", i.e. ".." in the root directory always refers to the root directory.

# Change directory to the root of your file system
cd /
# Change directory to your home directory
cd ~
# Stay in the current directory
cd .
# Move to the parent directory
cd ..

When moving to an actual directory you simply type the name of the path to that directory. You can either reference the directory from the root of the file system (an absolute path), or use a relative path, which is the location of the directory from your current position. For example:

# Move to the "etc" directory which lives directly under the root directory
cd /etc
# Move to the downloads/graphics directory which is in the directory I'm currently in. Note there's no leading "/" because we want the path to be relative
cd downloads/graphics

We can even get fancy and combine the parent directory ".." with other paths. This allows us to move up in the file system as well as down. For example:

# We're going to use two directories here: /etc and /bin. They both sit one level under the root directory.
garrys@GAMBIT:/$ cd /etc
#Then we can use a relative reference to move to /bin as follows
garrys@GAMBIT:/etc$ cd ../bin

You can also use wildcards with cd. It will pick the first matching path from the wildcard results and attempt to change directory to it.

# Get a list of all the directories starting with "D". The -d option on ls simply tells ls to only print the names of directories, rather than their contents
garrys@GAMBIT:~$ ls -d D*
Desktop  Documents
# Change directory to the first wildcard match, which is going to be the Desktop directory
garrys@GAMBIT:~$ cd D*
# Show our full path, just to prove exactly where we are (even though it's shown in the Bash prompt)
garrys@GAMBIT:~/Desktop$ pwd
/home/garrys/Desktop

The most important thing you can ever be taught is how to learn, and the best way to learn about commands on *NIX systems is the man command. It presents manual pages on commands, describing exactly what they do and what syntax you need to use when calling them. Using this command you can find out more information about all those ls options I neglected to mention in the above text.

garrys@GAMBIT:~$ man ls
LS(1)                           User Commands                           LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List  information  about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort.
Mandatory arguments to long options are mandatory  for  short  options
too.
--SNIP--

The man command takes up the entire terminal, and pushing escape will not get you out of it, no matter how many times you try. "q" is the magic key to exit a man page. You can also use the arrow keys to move around, and space acts as a "page down" mechanism. One of the coolest things you can do is search within the man page. "/" followed by a character sequence will search the man page for that character sequence. Very handy if you're hunting through a rather lengthy file for one pesky option.

One of the best things about *NIX based operating systems is the majority of the content on your file system is in plain text format. Storing things like this is actually a key part of the philosophy that UNIX was based on, as it enables programs to play nice with each other on the command line (among other things). So you have all these text files sitting on your computer; how do you get at them? Well, there are a few options, perhaps the simplest being the cat command.

cat is capable of concatenating multiple files together and printing them out to the command line. Technically it sends them a stream called stdout, but that's a discussion for another day. Basically you give it one or more files (actually you don't even need to give it a file, but once again that's a little beyond our discussion here) and it will print the files out, one after another.

garrys@GAMBIT:~$ cat textfile1.txt
This is textfile 1
garrys@GAMBIT:~$ cat textfile2.txt
This is textfile 2
garrys@GAMBIT:~$ cat textfile1.txt textfile2.txt
This is textfile 1
This is textfile 2

That's fine for small text files, but what about large files? Well, for that you can use less. It presents information page by page, much like man; in fact, it has almost the same syntax as man (q to quit, space to page, "/" to search etc). You can check out it's man page for a full list of commands. You may also be interested in learning about more, which is basically the predecessor to less. It's worth knowing simply because you may see it pop up on the web and wonder just exactly what it is.

Most of the commands you've executed up until this point have been in your PATH. This means that they are in designated parts of the system that Bash is aware of and knows to look for executables in. A slight problem arises when you try to run an executable file that may be sitting on your Desktop or in your home directory somewhere;  namely it won't find the file you're after.It can be incredibly frustrating for new users, as the file shows up when using ls. The thing is, for various security reasons you need to provide a full path to any executable that's not in your PATH.

# List the executable I want, just to show that it's clearly in the local directory
garrys@GAMBIT:~/Desktop$ ls NVIDIA-Linux-x86_64-169.12-pkg2.run
NVIDIA-Linux-x86_64-169.12-pkg2.run
# Try to execute the file without providing a full path
garrys@GAMBIT:~/Desktop$ NVIDIA-Linux-x86_64-169.12-pkg2.run
#Bash tells me that this didn't work because it couldn't find the command
bash: NVIDIA-Linux-x86_64-169.12-pkg2.run: command not found
# The following will work, as I've specified a full command by using the magic "." directory that references the current directory. The added "./" at the start is the key to success here
garrys@GAMBIT:~/Desktop$ ./NVIDIA-Linux-x86_64-169.12-pkg2.run

This is a fairly big difference for people who are used to the Windows command line or DOS, but it's one that's extremely important to remember.

So now you can find out where you are, see what's in your current directory, move about, find out more information about commands and check out the contents of text files. See, the command line is not so scary after all! Next time we'll check out some basic file and directory manipulation commands and also explore the difference between Windows and *NIX style file permissions.

14Jul/086

The Rumble In The Jungle

The technology industry is no stranger to brand wars, nor the fanboys that accompany them. For decades, battles have been waged in the school yard, workplace, arcade, any place where over-excited tech geeks gather, all over issues that seem inconsequential to the casaul observer. Whether it be Apple vs IBM, Amiga vs IBM, Microsoft vs everone else or Sonic vs Mario, opposing forces are willing to defend their claim to throne right down to the last soldier.

This sort of behaviour usually occurs when you make a significant financial outlay and have to choose between competing products that do essentially the same thing, either because it's only practical to own one of the devices or because you can only afford one. It's the reason that Ford and Holden owners don't get along, and why the console wars are so intense. If you'd just spend $40,000 on a car or were 14 years old and had spent 3 years of savings on a games console then you'd want to justify the purchase when it came under fire. Computers and Gadgets are not exactly known for being cheap, so it's no wonder that the industry is rife with commentators and consumers who are rather vocal about the choices they have made. After all, who would want to admit to being on the losing side of a technology war, especially after laying down a few hundred or thousand dollars on a new purchase?

N95 owners, of which I am one, are one of the latest groups to join in the self justification to avoid feeling like they have just purchased $800 of FAIL. The iPhone, with it's fancy touch screen and vast amounts of media coverage, has become somewhat of an affront to everything an upstanding Nokia user should stand for, and a scourge that must be wiped from the face of the Earth. The only logical way to accomplish this feat is through the release of many "anything you can do, I can do better" YouTube videos. Now why didn't I think of that?

Amidst all the kerfuffle, one of my close friends has said "why can't I have both??". He's a recent N95 8Gb owner, and being a total gadget geek, simply had to have an iPhone 3G as soon as they launched in Australia. He's started blogging about his experiences running both devices simultaneously, the N95 8Gb as a work phone and the iPhone for personal use. He's a long time Nokia user but also an Apple fanboy, so it will be very interesting to see how it goes. Will he remain objective? Will he throw one of the devices out the window? Will he have to buy a whole new stylish wardrobe to accompany his new iPhone? Only time will tell!

Filed under: Gadgets 6 Comments
Sharing Buttons by Linksku