Wednesday, March 21, 2012

easy_install for PortablePython3 behind a proxy

Do you love Python? Do you have Portable Python(v3) installed on a flash drive somewhere? Do you want easy_install for your Python 3, but you're behind a proxy or a firewall that won't let the good times roll? Well, turns out it's fairly easy to get around that.

 First, download the Distribute setup.py installer. If simply running your \App\python distribute_setup.py script doesn't work, then all you have to do is download the tar.gz file, put it in the same directory as your distribute_setup.py and run it again. You might need to install the MinGW32 compiler, too, and put that on your path. 


 Once you have these pieces in place then it's usually really easy to install other packages from source, if you're unable to hit the cheeseshop using easy_install.


If this helps you, please leave a comment below!

Saturday, December 31, 2011

Awesome (the window manager you probably should be using)

I'm not so sure how much I like this new blogger interface. It's a little annoying and definitely doesn't work like I'm used to, and so far it's not great in working like I would think it should. Also, my name is completely off the screen - and this is using Google Chrome, so I'm certain they've got some nasty CSS issues there.

But that's not what I came to tell you about. I came to tell you about Awesome, the window manager for X that you should probably be using.

First of all, I'm running a computer that's not terribly impressive. It's an Intel T2400(?) running at 1.83Ghz. It's a dual core, which definitely counts for something but it's only got 500MB of RAM, so that pretty seriously cramps my style. Not to fear, though, for Awesome Window manager is here, which is much nicer than your standard Gnome or KDE - mainly because it's a lot lighter. So I can actually do things that I want to without having to worry about whether I have enough RAM. Well, at least I can browse the 'net.

Also, pretty much all of the nice chrome that comes with Ubuntu is a bit heavy for my tastes and most certainly this machine. So I've taken to disabling it, so now joy and love abound - or something. Also, I'm a pretty big command-line nut, so it's pretty helpful. About the only reason that I feel the need to start up X is if I want to see pretty pictures. And if I knew of a way to do that via command line, I'd probably rarely bother with X.

So, some instructions about what I did. First, I disabled starting gdm by default by changing line 9 of /etc/init/gdm.conf to read
start on runlevel []
Which just tells gdm not to start... ever.

Then I disabled the splash screen on startup following these instructions:
$ sudoedit /etc/default/grub
$ sudo update-grub 
Then I had to setup an .xinitrc file so that I could actually start my awesome session. It's pretty easy:

$ touch ~/.xinitrc
Then I added the following lines:
#!/bin/sh
nm-applet & #Runs the nm-applet so we can use the nice GUI
exec awesome
And that's the current state of my system.

There are a few things on my wishlist that I'll post when I find the answers:

  1. The virtual terminal isn't swapped to at the beginning, so I have to  Ctrl+Alt+F1 after the boot process. Not sure what the issue is there.
  2. I don't like having to have X started for the network stuff. I can connect to open networks fine, but I need to setup some scripts/cron jobs to auto connect to a list of networks. If I don't find a pre-wrapped solution I may roll my own via Python.
  3. Viewing images/video without having to startx. Not that it's a horrible thing, but it would be pretty cool if I didn't have to - or had some way to simply launch programs in X without having a terminal open, that might be acceptable.
I think those are the extent of my problems that I don't already have some knowledge of how to fix.

Friday, July 29, 2011

Review: DIY Bookbinding


DIY Bookbinding
Bind your own book by hand
By Brian Sawyer

is a short (32 pages) article that teaches you how to bind your own books. Whether you find the idea of binding your own books exciting, or you just want a way to preserve your magazines or other printed material, DIY Bookbinding is a book for you.

Brian Sawyer takes you step-by-step through the bookbinding process, from pulling the pages out of a perfect bound book, all the way up through putting in the endsheets. If you're interested in binding your own books, this book has some great information.

The Good
High quality photos and step-by-step instructions make this guide an excellent how-to. The amount of literature available on the internet dealing with book binding is somewhat limited, so the concentrated information here is quite welcome.

The Bad
I wished this article had more illustrations to accompany or replace some of the photographs. The important aspects of the photos ended out obscuring some of the more important details. Of course that means that there are reference images, so that's a good thing.

The Bottom Line
If you're interested in book binding, whether as a hobby, or just to preserve your magazines or other papers, you should buy this book. With the information in this guide, you can easily make back the $5 cover price, or make presents (journals, personalized books, etc.) of a high enough quality that will make this a good buy.

Thursday, July 14, 2011

Book Review: The Book of Ruby


The Book of Ruby, by Huw Collingbourne, is an interesting introduction to the language of Ruby. And a great choice for the advanced programmer who wants to pick up Ruby.

If you check out the Table of Contents you can see that after the introduction to Ruby, the author provides plenty of instruction on how Ruby deals with classes, and then moves to strings and other common data types. After discussing data types, The Book of Ruby goes on to present different flows (loops, if-else statements) and grouping (blocks, methods) and then drops into a fairly powerful Ruby construct called Symbols. You'll also find information on marshaling data, and storing it to disk either by marshaling or YAML data.

Overall this was an interesting book - I liked having several small programs to work with, which let you focus on a single concept. My biggest issue with this book is jumping straight from an introductory "Hello World!" program into classes. For the novice programmer, this approach is probably like jumping in the deep end and I would have to recommend picking up another book to learn how to program. When reading The Book of Ruby you won't be entertained or bored, merely informed. I'd say this book is best suited for reference material, and would be a great addition to your reference library.

Book Review: The Myths of Innovation


The Myths of Innovation, by Scott Berkun, is an interesting read. In this book he argues that the word innovation is overused, and that true innovation is a hard thing. He provides examples of true innovators, (Ford, Edison, Jobs, Brin and Paige) and explains how we build myths around the men.

I really enjoyed Berkun's take on the term innovation. He does a wonderful job of persuading the reader that innovation isn't just something that you do on a daily basis, but that it's more of a process. I found his arguments compelling. There were many thought provoking points, and I think my favorite was "Creativity has more to do with being fearless than intelligent or any other adjective superficially associated with it." His arguments and examples helped me to sort of "meta-think", or think about the ways that people think about the world. I think the most eye-opening parts of the book are when he tries to shed the aura of mystique from around the innovators of the past and the present. One of the points he made is that there's no magic moment of innovation - as humans we just build up the idea that there was one magic moment when Bell invented the telephone, or Newton discovered gravity, or Copernicus developed his heliocentric theory.

I think that anyone who has ideas should read this book. If you want to invent something, or be the next Mark Zuckerberg, then you should read the Myths of Innovation. If you are a knowledge worker (programmer, artist, etc. - or if you just want to be one), you should read this book. The Myths of Innovation was a good read, and helps pull mythic figures of the past off their pedestals.

Friday, February 4, 2011

ed man! !man ed

ed is the standard editor. And I just wrote my first Python program with ed today. Sure, it was a short one:


num = int(raw_input("Please enter a number: "))
print "%d^2 = " % num, num**2


but by golly, it was a program written in ed!

So... just how geeky does that make me?

Wednesday, January 19, 2011

Book Review - jQuery Pocket Reference


jQuery Pocket Reference, by David Flanagan leads the reader through a lot of the basic jQuery principles. This book is for those who are fairly familiar with JavaScript already, and are interested in the jQuery library, or those who may have some experience with jQuery and want a solid guide to its features, as well as a language reference.

In jQuery Pocket Reference, you will be introduced to the basic concepts of jQuery which includes the some of the what and why behind jQuery. You will also learn how to modify DOM element attributes, add and remove elements from your page, work with events, animate your elements, working with Ajax, some utility functions, how to extend jQuery, and you will also learn some about the jQuery UI library that allows you to automate the building of a user interface. Then, of course, you have the actual language reference.

I was again impressed by Flanagan's writing in this book. I had only heard of jQuery before I got this book, but I have some familiarity with JavaScript (and several years experience with other languages), and this book has been a great introduction to jQuery and I'm sure the reference will come in handy later this semester in my Web Technology class. If you're looking for a great reference for jQuery, you should buy this book.

Friday, January 14, 2011

Book Review - Canvas Pocket Reference


Canvas Pocket Reference, By David Flanagan, is a short and sweet little book that covers the HTML5 canvas element, made famous by the likes of Mr. Doob's Harmony Sketch tool.

In this book, David Flanagan assumes you are familiar with HTML, CSS, and JavaScript, and focuses solely on the canvas element and all the things you can do with it. The first chapter is an introduction to all the ways you can draw on a canvas, with code examples accompanying each description. If you need a refresher or haven't really been exposed to the canvas element, this chapter will serve you well. I only learned about the canvas element this previous summer and never really experimented with it. But this chapter was all I needed to feel comfortable using all of the different canvas drawing methods.

The second chapter is just a reference for the canvas element and all of its associated methods. In alphabetical order, it's quite handy if you just need to remember what the parameters for bezierCurveTo() are, or what the name of that function is that closes a path.

At $15 for the ebook+Dead tree version, this is a must-buy for any web developers library. Sure, you can find most of the information on the web, but this is a handy guide that you can keep on your desk or in your laptop bag (or just on your computer). I enjoyed reading this book, and I look forward to using it to help me develop my own canvas apps.

Book Review - Natural Language Processing with Python


Natural Language Processing with Python, By Steven Bird, Ewan Klein, Edward Loper, introduces the Pythonista to the field of NLP, the language processing enthusiast to Python, and everyone else to both. In this book, the reader is introduced to both Python and some language processing by page five. Rather than teaching Python first and then Natural Language Processing, this book alternates between the two, showing live examples in Python code when a language processing concept is mentioned. When programming concepts are needed or useful, they are explained - usually in the context of "How can this help me better process text?".

After a solid introduction to Python and some language analysis tools, the reader is taught how to load corpa (large collections of text, if you're new to NLP like I am) - both those provided by the NLTK (Natural Language Tool Kit) team, as well as the users own corpa. Then the next few chapters alternate between Python and language processing. The reader will by no means finish with a complete understanding of computer science, but they will be equipped with most of the knowledge of programming that they will need to do most language processing tasks with Python and the NLTK.

I was fairly impressed with this book - I originally saw it at the most recent Python Arkansas conference as a door prize and it looked interesting to me. Someone else was the lucky winner, however, so when I had the chance to review this book I jumped at the opportunity. This book was very well written, in a style that had just the right mix of code samples to try out, conceptual information, and challenging exercises. That's probably why it has "been adopted in courses in dozens of universities" (p xiv). As they explain in the introduction, this book is not a reference book for either Python or Natural Language Processing. If you want more in-depth coverage of either of those you're probably best off looking elsewhere. However, if you know Python and want a great introduction to language processing, or if you know some language processing and are interested to see what Python has to offer you, this book is a must-buy.

Friday, January 7, 2011

Book Review - Learning Perl


Learning Perl, by Randal L. Schwartz, Tom Phoenix, brian d foy is an entertaining and well-written book that will take you from knowing at least a little bit about programming, to knowing a lot about Perl.

Learning Perl starts off with a basic introduction to Perl, with basic data types, subroutines, and input/output (including files). Then you are introduced to more advanced topics such as hashes, regexes, Perl modules, file tests, and directory operations. In this book you will find fairly in-depth discussions on each chapter, with a set of exercises at the end that should take the novice programmer about 45 minutes to complete. The exercises are well written and help the reader retain the information that was presented in the chapter.

I picked up Learning Perl for the obvious reason - I wanted to learn Perl! And this book was a marvelous introduction to the language that says TMTOWTDI (pronounced Tom Towdy). Rather than a horribly dry book full of obfuscated examples, I was surprised at how entertaining the read was. The examples were somewhat contrived (using Flintstones characters, for example), but they were perfect for teaching the principles in each chapter. If you make an honest effort to go through this book and finish the exercises, you can easily learn a lot of Perl in a week. You may not be a Perl whiz, but when you see something like

while (<>){ chomp($_); print $_; }


rather than being utterly confused at the cryptic symbols, you'll have a fairly good (if not great) idea about what's going on.

This book is a must-have for anyone who wants to learn Perl.

Monday, January 3, 2011

Book Review - Programming Python

Programming Python, by Mark Lutz is a serious book for those serious about programming in Python. A follow up to his book Learning Python, Programming Python covers none of the basics, but is entirely devoted to practical applications of the Python standard library. He starts off with representing records, and persistent storage, then introduces classes, console interaction, GUI programming, and web interfaces. The next several hundred pages provide practical examples of using system tools, file handling, parallelism, GUIs, networks, CGI scripting, databases, and basically anything else you can do with Python.

As an avid Pythonista, I had heard of this book a few times on mailing lists, and the list price of about $70 USD is probably the right price for this book if you're interested in using Python in a practical sense. However, for the current price of $40, this book is a steal. If you know the basics of Python and are wondering, "Now what?", you should buy this book.

Saturday, January 1, 2011

Book Review - 97 Things Every Programmer Should Know

97 Things Every Programmer Should Know, by Kevlin Henny is a collection of CC-Licensed essays containing... well, you read the title! Topics range from beautiful code, to testing and automating tasks, to interacting with customers/clients. Just about every facet of the professional life of a programmer is covered in this book.

As a Senior in a Computer Science program, I found the essays to have extremely good advice. Probably the best essay was the Boy Scout Principle, though they were all pretty helpful. For the seasoned developer, these essays probably won't bring anything new, especially if you've looked into some of the XP methodologies. However, for the novice programmer these principled presented here will hopefully make for a better programmer. The only criticism I have is that while this book is certainly a useful one to have around, though the $29(USD) list price is a little on the steep side ($10-15 seems more reasonable, although I don't know what printing costs these days!)

Wednesday, December 22, 2010

Response to a Comparative Study

A study was performed to try to compare vi and emacs, and on the surface seems to be a rather good study, unfortunately the author's bias (or perhaps just ignorance) introduced errors into the study. I will endeavor to expose those errors here. The entire text of the study will be presented, along with any criticisms that I have.


A COMPARATIVE STUDY OF VI AND EMACS FROM THE
PERSPECTIVE OF NOVICE AND REGULAR USERS

(author: William Knottenbelt - william@cs.uct.ac.za/wjk@doc.ic.ac.uk)

ABSTRACT:

The editors vi and emacs were compared using a simple time-based
experimental method involving common text manipulations and a post-
test opinion survey by questionnaire. The subjects were twelve
students; six were novices and six were regular users. Significant
objective performance differences were confined to the novice users;
here emacs consistently outperformed vi with respect to time taken to
perform the tasks and the amount of help needed. Subjectively, novices
preferred emacs because of its more predictable nature. Emacs was
therefore the editor of choice for the novice users tested. There
appears to be no advantage for a regular user of one editor to switch
to the other.


We'll see later that the bias/ignorance caused much of the preference for emacs.



INTRODUCTION:

A text editor is an essential tool in virtually every computing
environment since a large proportion of a user's time is likely to be
spent in editing documents or writing program code and job control
files. Intense and sometimes emotional "my-editor-is-better-than-your-
editor" debates are common in computer discussion groups. One
perennial bone of contention concerns the qualities of "vi" and
"emacs" - both popular and widely-used UNIX editors. Published formal
studies of text editors [eg. 1] tend to be very complex, and few, if
any, have specifically addressed the "vi"/"emacs" controversy. Other
informal studies on this subject [2] have generally been anecdotal,
reflecting the personal experience of the author, rather than being
objective reviews. This study attempts to compare the performance of
"vi" and "emacs" in our local environment in a simple but scientific
way.

METHOD:

A controlled experiment was determined to be the best means of
objective comparison. The design was in keeping with the limited
resources available so methodology involving in-depth analysis of
functionality and specialized techniques such as real-time keystroke
recording were avoided. Instead, the final design was simple enough to
be implemented by two observers with stopwatches.

Twelve subjects were used in the experiment - six novices and six
skilled regular users. Three of the novices were "non-technical"
novices who had little or no computing experience and no experience of
either vi or emacs; the other three novices were "technical" novices
who had substantial computing experience but little or no experience
of either vi or emacs. Since all the novices had similar experience
with vi and emacs, useful comparisons could be made by testing their
performance with both editors; on the other hand, each of the regular
users was tested only on his/her editor of choice.

Each subject was asked to perform some common text manipulation tasks
on an extract from Sue Townsend's Diary of Adrian Mole. These included
text entry, insertion and deletion of characters, words and sentences,
searching and replacing, and transposition of paragraphs (see Appendix
A for the complete task list, starting text and target text).

All tests were conducted individually on a user/observer basis. The
subject was told that the editor, rather than the subject, was being
tested and that he/she was free to quit at any time if he/she became
uncomfortable. The subject was then given a copy of the task list and
a help sheet containing relevant commands for each editor (see
Appendix B). Each task was explained and questions were answered.
During the observation, the time for each task was noted, as well as
the amount of time spent looking for help and the number of times help
was needed.

Novices used the editors in randomized order (determined by the toss
of a coin) and performed the set of tasks twice so that some idea of
learning curves could be obtained. Skilled regular users were only
required to perform the tasks once.

After completing the tasks, subjects completed a questionnaire asking
them to rate the editors based on six criteria, viz. consistency,
feedback, friendliness, learnability, usability and efficiency. They
were also asked to give details of any problems or frustrations they
experienced, as well as any features they liked (see Appendix E for
the full questionnaire).

Trial runs of the experiment were performed on both editors. No
problems were found with vi and all tasks could be performed
successfully. However, some problems, all caused by terminal
peculiarities, were experienced with emacs. In particular, backspace
did not work, the cursor keys did not work and Ctrl-s could not be
used (it is used for XON/XOFF flow control). Investigation revealed
that the ibm3151 terminals we use are not supported by emacs; when
emacs was run on a more common vt100 terminal, everything worked
correctly. However, emacs on-line help gives full details to enable
system administrators to have emacs support any particular terminal
type without user intervention. So as not to penalize emacs for this
administrative oversight, emacs was minimally customized to emulate a
proper working setup on our terminals. (* the error was reported by
the author and emacs has now been correctly set up for use with our
terminals.)

To statistically compare the editors with regard to the total time
taken to perform the tasks and the time spent looking for help,
appropriate t-tests for dependent or independent samples were applied.

RESULTS:

OBJECTIVE EVALUATIONS:

Appendix C contains a complete summary of the times taken to complete
the tasks. The statistical analysis of the results is given below:

+------------------------------------------------------------------+
| HYPOTHESES | Non. | Tech. | Reg. |
| (Objective testing) | Tech. | Nov. | User |
|-------------------------------------+---------+---------+--------|
| First trial: emacs faster than vi | Yes+ | Yes+ | No |
| Second trial: emacs faster than vi | Yes* | Yes+ | N/A |
| Less help required with emacs | Yes+ | Yes+ | No |
| Text entry faster with emacs | Yes* | Yes* | No |
| Text manipulation faster with emacs | Yes+ | Yes* | No |
+------------------------------------------------------------------+
Non. Tech. = Non-technical Novice + p<0.05 * p<0.01
Tech. Nov. = Technical Novice
Reg. User = Skilled Regular User

The mean improvement in time taken by novices between the first and
the second trials for each editor (expressed as a percentage) was also
calculated:

+------------------------------------------------------------------+
| PERCENTAGE IMPROVEMENT IN TIME BETWEEN TRIALS |
|------------------------------------------------------------------|
| Non-technical Technical |
| novices novices |
|------------------------------------------------------------------|
| vi 39 +/- 4 % 28 +/- 5 % |
| emacs 27 +/- 6 % 21 +/- 8 % |
+------------------------------------------------------------------+

SUBJECTIVE EVALUATIONS:

Appendix D contains summarised results of the questionnaire. Although
differences in subjective scores were not significant on testing, each
editor came in for some criticism and some praise.

SUBJECTS' OPINIONS OF VI:

The main difficulties novice users found with vi were:
- editor modes were hidden resulting in apparent unpredictability
- backspace worked only on newly inserted text and did not update
the screen accurately
- using ESC x to delete a character appeared to be unpredictable -
most novices could not apparently tell whether the character
to the left of the cursor or the character under the cursor
would be deleted (see discussion below)
- case-sensitivity of commands caused some confusion
- cursor keys could not be used to get right to the end of a line or
right to the end of a document
- non-technical novices found it very clumsy

Positive features appreciated by novice users were:
- the undo feature
- commands could be backed out of at any time by pressing ESC
- technical novices thought it had potential to be efficient

Regular vi users felt:
- vi was fast, powerful and efficient
- although vi had some "quirks", they were not a nuisance as one
got used to them very quickly
- the command structure of vi was logical and intuitive
- vi's key mapping/macro facilities were very useful
- vi was the standard UNIX editor and was always available; it
should be learned for this reason alone
- vi was, however, difficult to learn; an on-line help facility
was needed

SUBJECTS' OPINION OF EMACS:

The main difficulties novice users found with emacs were:
- some of the commands were regarded as being unnecessarily
cumbersome, especially for the more complex manipulations
- mistyping commands sometimes resulted in "windows" appearing
which some users had difficulty in getting rid of

Positive features appreciated by novice users were:
- the "modeless" operation (or rather the lack of mode changes)
- the undo feature
- the backspace key was consistent in operation; it always
worked and always deleted the character to the left of the
cursor
- commands generally did what was expected first time
- technical novices in particular liked the way emacs agreed
with their experience of other editors and word processors,
making basic editing tasks easy and giving the editor a
familiar "feel" ("You don't have to learn what you already know")
- moving around the document was easy - getting to the end of a
line or to the end of the document was simply a matter of moving
the cursor

Regular emacs users felt:
- emacs was powerful and efficient enough for their purposes
- although there were a daunting number of commands and some
commands were cumbersome to type ("escape-meta-alt-control-
shift"), emacs was easily customizable so frequently
used operations could be moved to more acceptable key
combinations
- emacs was particularly suited to editing large documents as
it had facilities such as a spelling checker etc.
- emacs was very easy to use and also easy to learn, especially with
the on-line tutorial and help

DISCUSSION:

Emacs appears to be the editor of choice for novices performing the
given tasks. Not only were they able to perform the tasks
significantly faster on both trials with significantly less need for
help, but they also seem to have experienced less frustration.
Novices, especially non-technical novices, had a very mechanical way
of approaching the tasks and disliked having to give special
commands - emacs suited this approach. For example, to add something
to the end of a paragraph, novices generally just tried to move the
cursor there and type. While this worked with emacs, vi would not let
them move their cursor past the last character on a line (some held
down the right arrow key for several seconds, hoping to achieve the
desired effect); eventually they had to consult the help sheet (they
needed ESC a - append to line).

Some apparent inconsistencies in vi's operation particularly
frustrated novices. For example, the backspace key works only on newly
inserted text - many novices expressed dismay that the backspace key
that had worked while they were typing in text suddenly seemed to
cease functioning when correcting other errors. They were forced to
consult the help sheet again; this time they needed ESC x - delete
character. The delete character operation itself seemed to be
inconsistent - users felt they had to guess whether the character to
the left of the cursor or the one under the cursor would be deleted.
This is because vi moves the cursor backwards one space when the mode
is changed from insert to command mode; thus if the user is in insert
mode, the character to the left of the cursor is deleted, otherwise
the character under the cursor is deleted. To novice users who were
unused to these subtleties, however, deletion appeared to be a random
process. By contrast, the operation of backspace in emacs was totally
consistent - it always deleted the character to the left of the
cursor.

The experiment also served to illustrate the main disadvantage of vi
and the strong point of emacs as far as novices are concerned: the
issue of on-line help. Not only did novices find that they needed less
help with emacs (many did not need any help at all to perform basic
manipulations), but a full tutorial and interactive on-line help is
available; emacs' title screen gives new users full instructions on
how to access these features (as well as how to quit emacs at any
stage). This immediately puts the user at ease and gives him/her a
sense of security. Vi, however, does not provide any on-line help;
system manual pages are generally available but these tend to give
reams of very technically-oriented detail which is mostly useless to a
novice. In addition, most novices are not even aware of the manual
page's existence. All the novices in our experiment encountered
difficulties and required lots of help with vi right from the start of
their tasks; it is therefore puzzling that vi should have no help
facilities. Every editor user must pass through the novice phase; if
the editor seems difficult to use and does not even provide basic help
(like a list of common command keys), the user is likely to abandon
the effort and use another program (if available).

The comparison of the percentage improvement in time between trials
(see objective results) can be used to get an idea of the initial
learning curves of vi and emacs, since time taken to perform tasks is
a good measure of how well the user has learned to use the editor.
While non-technical novices underwent a dramatic time improvement
(39 +/- 4 %) between trials with vi, a more modest improvement (27 +/-
6 %) was noted using emacs. Thus we may tentatively conclude that vi
has the steeper initial learning curve for non-technical novices. The
percentage increases for technical novices were not as striking; a
similar tendency was noted, but uncertainties were too large to reach
any firm conclusions.

No significant difference in performance times was found with regular
users of the editors; this suggests that, with practice, a similar
level of performance can be obtained using both editors. Regular users
of both editors were fully satisfied with their editor's functionality
and efficiency. Regular users of vi, however, seemed to be more
emotionally attached to that editor (ironically, this is possibly
because they had invested considerable effort in learning it and take
pride in their achievement).


I'm not sure if the author understands the definition of the word "ironic". I believe most people would agree that people who spend time to get good at something should have some emotional level of attachment.



It is important to note that while these experimental results strictly
only apply to the specific set of tasks given ie. basic text
manipulation, each editor has advanced facilities for other tasks such
as programming. A non-technical novice, however, is unlikely to
require these features at the beginning of his editing career;
therefore it is reasonable to omit such specialized tasks from his/her
tests. It is also likely that the performance of technical novices
using these special features would be similar to their performance on
basic text manipulation since programming involves similar tasks: for
example insertion and deletion of "text" (code) and moving
"paragraphs" (procedures). This, however, needs to be verified in
further studies.

All subjects used in the study were relatively intelligent, well-
educated university students (selected from various faculties).
Although it would be presumptuous to extrapolate these results to the
general population, it seems likely that with less sophisticated
users, emacs would perform even better relative to vi due to its
novice-friendly nature. Again, this needs to be experimentally
verified.

CONCLUSION:

In this study, Emacs was found to be a significantly faster editor
than vi for all grades of novice user attempting the simple text
manipulation tasks given; they required significantly less help and
also felt more comfortable with emacs' uniform modes and consistent
response. Since emacs also has on-line help which is lacking in vi, it
is definitely the editor of choice for novice users undertaking simple
editing tasks. Further work needs to be done on specialized tasks such
as programming and involving a broader spectrum of users.

No significant performance difference was found between vi and emacs
for regular users and both have sufficient power to maintain a
considerable following. Since every UNIX system already has vi, and
many devoted adherents, vi should continue to be available as a choice
to users; there is no advantage for regular vi users to change to
emacs.

ACKNOWLEDGMENTS:

Although the analysis presented here is the work of the author, the
experiment was designed and executed in collaboration with Ms.
Marjolijn Weber, also a third year computer science student at UCT.

REFERENCES:

[1] T. Roberts, and K. Moran. The Evaluation of Text Editors:
Methodology and Empirical Results; from Readings in Human-Computer
Interaction (edited by B.M. Baeker and W.A.S. Buxton, 1987)
[2] Collected undergraduate studies of vi and emacs (Compiled by E.
Blake, 1991)
[3] K. Gomoll. Some Techniques for Observing Users; from The Art of
Human-Computer Interface Design (edited by Brenda Laurel, 1990)
[4] R. L. Mason. Statistical Design and Analysis of Experiments
(Wiley, 1989)

APPENDIX A:

USER TASK LIST

1. Go to the end of the document and type in the following paragraph:

Joined the library. Got Care of the Skin, Origin of the Species, and a book
by a woman my mother is always going on about. It is called Pride and
Prejudice, by a woman called Jane Austen. I could tell the librarian was
impressed. Perhaps she is an intellectual like me. She didn't look at my
spot, so perhaps it is getting smaller.
2. Correct the three spelling errors in the first three lines of the first
paragraph (one error per line) and remove the extra "Geography" in the
3rd line of the first paragraph.
3. Add the words "About time!" to the end of the second paragraph.
4. Delete the sentence "Time flies like an arrow but fruit flies like a
banana" and re-form the paragraph.
5. Replace all occurrences of "is" with "was".
6. Swap the two paragraphs.
7. Save the file and quit.

STARTING TEXT

Wednesday January 14th

None of the teechers at school have noticed that I am an intellectual. They
will be sorry when I am famouse. There is a new girl in our class. She sits
nixt to me in Geography Geography.
Time flies like an arrow but fruit flies like a banana.
She is all right. Her name is Pandora, but she likes being called "Box".
Don't ask me why. I might fall in love with her. It's time I fell in love,
after all I am 13 3/4 years old.


TARGET TEXT

Wednesday January 14th

Joined the library. Got Care of the Skin, Origin of the Species, and a book
by a woman my mother was always going on about. It was called Pride and
Prejudice, by a woman called Jane Austen. I could tell the librarian was
impressed. Perhaps she was an intellectual like me. She didn't look at my
spot, so perhaps it was getting smaller. About time!

None of the teachers at school have noticed that I am an intellectual. They
will be sorry when I am famous. There was a new girl in our class. She sits
next to me in Geography. She was all right. Her name was Pandora, but she
likes being called "Box". Don't ask me why. I might fall in love with her.
It's time I fell in love, after all I am 13 3/4 years old.

APPENDIX B - HELP SHEETS


VI COMMANDS:


INSERTING & TYPING TEXT:
ESC i insert text
ESC $a append text (to end of line)


ESC A would be a more useful and accurate keystroke to perform this task. Evidence of the authors ignorance of full vi features.


ESC J join lines

CURSOR MOVEMENT:
ESC ^ beginning of line

0 (zero) would be more accurate here as well

ESC $ end of line
ESC 1 G top of document

ESC gg would be better than 1 G

ESC G end of document

DELETING & MOVING TEXT:
Backspace delete character before cursor (only works with
newly inserted text)
ESC x delete character

One of the main criticisms were referring to this particular command - if you compare the emacs command it says "delete character under the cursor", which is what this command will do. I suspect the authors' bias against vi's modes a large part of the problem here. ESC is not a required preface to all commands - it simply removes you from the insert mode. This seemingly minor fact is likely the source of much of the problems found with vi.

ESC dw delete word
ESC dd delete line (puts deleted text into a buffer which can
be restored by pressing ESC "1P)

The 1 is not required to paste/put a line. Capital P is sufficient to insert the line above the current one, while p inserts on the line after.

ESC dd delete n lines (puts deleted text into buffer which
can be restored by pressing ESC "1P)
ESC "1D delete rest of line (puts deleted text into a buffer
which can be restored by pressing ESC "1P)

Just D is all that is needed.

ESC "1P yanks back (restores) text deleted with ESC dd or
ESC "1D

Undo would be a more useful command for restoring deleted text.


SEARCHING FOR AND REPLACING TEXT:
ESC :%s///g

MISCELLANEOUS:
ESC u undo
Clear redraws screen
ESC :w save file
ESC ZZ save file and quit

:wq is a more accurate save and quit



EMACS COMMANDS


CURSOR MOVEMENT:
Ctrl a beginning of line
Ctrl e end of line
ESC < top of document
ESC > end of document

DELETING & MOVING TEXT:
Backspace delete character before cursor
Ctrl d delete character under cursor
Ctrl k delete to end of line (puts deleted text into a buffer
which can be restored by pressing Ctrl y)
ESC k delete to end of sentence (puts deleted text into a
buffer which can be restored by pressing Ctrl y)
Ctrl y "yanks" back (restores) text deleted with Ctrl k or
ESC k

SEARCHING FOR AND REPLACING TEXT:
ESC x repl str

MISCELLANEOUS:
Ctrl G cancel
Ctrl X u undo
Ctrl X k kill window
Ctrl X s save file
Ctrl X Ctrl C quit


APPENDIX C - TASK COMPLETION TIMES


Note: all times given in seconds. HELP refers to the total time spent
looking for help; the number in brackets next to the help time refers
to the number of times help was needed. For a complete description of
tasks, see appendix A.


NON-TECHNICAL NOVICES:


VI TRIAL 1:

------------------------------------------------------------------
TASK
1 2 3 4 5 6 7 TOT HELP (no)
------------------------------------------------------------------
Subject 1 570 94 21 135 56 113 3 992 151 (14)
Subject 2 486 75 19 273 94 95 9 1051 233 (16)
Subject 3 637 72 56 178 101 90 12 1146 182 (19)
------------------------------------------------------------------


EMACS TRIAL 1:

------------------------------------------------------------------
TASK
1 2 3 4 5 6 7 TOT HELP (no)
------------------------------------------------------------------
Subject 1 343 26 24 53 90 129 12 677 151 ( 9)
Subject 2 232 71 10 91 44 55 10 513 102 (10)
Subject 3 414 47 50 136 70 57 10 721 94 ( 6)
------------------------------------------------------------------


VI TRIAL 2:

------------------------------------------------------------------
TASK
1 2 3 4 5 6 7 TOT HELP (no)
------------------------------------------------------------------
Subject 1 380 82 41 77 57 47 11 695 101 ( 9)
Subject 2 222 63 31 95 82 40 2 535 82 (17)
Subject 3 369 67 56 104 41 61 30 728 93 ( 9)
------------------------------------------------------------------


EMACS TRIAL 2:

------------------------------------------------------------------
TASK
1 2 3 4 5 6 7 TOT HELP (no)
------------------------------------------------------------------
Subject 1 216 26 23 54 79 52 23 473 11 ( 4)
Subject 2 168 36 6 82 33 38 12 375 42 ( 7)
Subject 3 246 42 35 112 57 48 14 554 62 ( 5)
------------------------------------------------------------------



TECHNICAL NOVICES:



VI TRIAL 1:

------------------------------------------------------------------
TASK
1 2 3 4 5 6 7 TOT HELP (no)
------------------------------------------------------------------
Subject 1 134 73 14 168 33 76 3 501 165 ( 9)
Subject 2 276 54 14 92 28 33 2 499 106 ( 7)
Subject 3 221 157 15 129 50 53 15 640 164 ( 9)
------------------------------------------------------------------


EMACS TRIAL 1:

------------------------------------------------------------------
TASK
1 2 3 4 5 6 7 TOT HELP (no)
------------------------------------------------------------------
Subject 1 127 34 7 46 25 42 8 289 70 ( 9)
Subject 2 243 28 12 34 26 20 10 373 42 ( 6)
Subject 3 157 24 28 61 24 21 14 329 52 ( 8)
------------------------------------------------------------------


VI TRIAL 2:

------------------------------------------------------------------
TASK
1 2 3 4 5 6 7 TOT HELP (no)
------------------------------------------------------------------
Subject 1 136 57 12 56 14 43 2 320 10 ( 3)
Subject 2 252 48 15 73 20 27 1 436 4 ( 1)
Subject 3 178 54 14 95 55 80 2 423 41 ( 5)
------------------------------------------------------------------


EMACS TRIAL 2:

------------------------------------------------------------------
TASK
1 2 3 4 5 6 7 TOT HELP (no)
------------------------------------------------------------------
Subject 1 100 18 9 17 15 11 5 175 8 ( 2)
Subject 2 217 37 10 37 15 20 6 342 6 ( 2)
Subject 3 140 21 7 50 26 12 6 262 14 ( 4)
------------------------------------------------------------------










SKILLED REGULAR USERS:



VI USERS:

------------------------------------------------------------------
TASK
1 2 3 4 5 6 7 TOT HELP (no)
------------------------------------------------------------------
Subject 1 97 22 9 23 7 12 2 172 0 ( 0)
Subject 2 89 27 7 35 12 15 1 186 5 ( 1)
Subject 3 102 25 9 31 11 18 2 198 7 ( 1)
------------------------------------------------------------------


EMACS USERS:

------------------------------------------------------------------
TASK
1 2 3 4 5 6 7 TOT HELP (no)
------------------------------------------------------------------
Subject 4 101 19 10 23 17 17 8 195 4 ( 1)
Subject 5 93 18 7 28 8 10 6 170 0 ( 0)
Subject 6 95 21 8 24 11 12 7 178 3 ( 1)
------------------------------------------------------------------











APPENDIX D - QUESTIONNAIRE SUMMARY


Note: All qualities below are average scores as judged by subjects on a
rating from 1 to 5. See Appendix E for the complete questionnaire.

----------------------------------------------------------------------
NON-TECH. NOVICE TECH. NOVICE REG. USER
VI EMACS VI EMACS VI EMACS
----------------------------------------------------------------------
Consistency 1-2 3 2 4 4 4
Feedback 2 3 3 3-4 3 4
Friendliness 2 3 3 4 3 4
Learnability 3 4 3 4 4 4
Usability 1-2 3-4 3 4 4 4
Efficiency 1 3 3 3 4 4
----------------------------------------------------------------------

APPENDIX E - VI/EMACS POST-TEST QUESTIONNAIRE


1.1 AGE:___ 1.2. SEX:___


1.3. COMPUTING EXPERIENCE

1 2 3 4 5
None Under 1 1-2 2-3 over 3
years years years years



----------------------------------------------------------------------

2. EMACS

2.1 PREVIOUS EXPERIENCE WITH EMACS

1 2 3 4 5
None Have used it Occasional Regular Expert
once or twice User User User

2.2 IF YOU HAVE PREVIOUS EXPERIENCE, HOW DID YOU LEARN HOW TO USE EMACS?
(you may select more than one answer)

1 2 3 4 5
On-line help/ External Manual/ Friends Other
On-line tutor tutor file documentation _______

2.3 HOW WOULD YOU RATE EMACS WITH REGARD TO:

a) CONSISTENCY (ie. did the editor always react to your commands in the same
way and was its behaviour consistent with your past experience)

1 2 3 4 5
Erratic, Tolerable Always
Unpredictable Mostly Predictable Predictable

Comment: _____________________________________________________________

_____________________________________________________________


b) FEEDBACK (ie. did the editor inform you what was going on?)

1 2 3 4 5
No Some Complete
feedback feedback feedback

Comment: _____________________________________________________________

_____________________________________________________________


c) FRIENDLINESS

1 2 3 4 5
Intimidating, Reasonable Welcoming,
Unhelpful helpful

Comment: _____________________________________________________________

_____________________________________________________________


d) LEARNABILITY (ie. how easy was it to learn how to use EMACS?)

1 2 3 4 5
Nightmare Manageable Very easy

Comment: _____________________________________________________________

_____________________________________________________________


e) USABILITY (ie. if you had to use an editor, would you use EMACS?)

1 2 3 4 5
Would avoid Would use Would use Would use Would always
using if necessary occasionally regularly use

Comment: _____________________________________________________________

_____________________________________________________________


f) EFFICIENCY (ie. is it possible to get things done speedily and with
minimal effort)

1 2 3 4 5
Clumsy and Reasonably Lean and
cumbersome efficient mean

Comment: _____________________________________________________________

_____________________________________________________________


2.4 Particular problems/frustrations: ________________________________

______________________________________________________________________

______________________________________________________________________


2.5 Particular "likes": ______________________________________________

______________________________________________________________________

______________________________________________________________________


----------------------------------------------------------------------

3. VI

3.1 PREVIOUS EXPERIENCE WITH VI

1 2 3 4 5
None Have used it Occasional Regular Expert
once or twice User User User

3.2 IF YOU HAVE PREVIOUS EXPERIENCE, HOW DID YOU LEARN HOW TO USE VI? (you
may select more than one answer)

1 2 3 4 5
On-line help/ External Manual/ Friends Other
On-line tutor tutor file documentation _______

3.3 HOW WOULD YOU RATE VI WITH REGARD TO:

a) CONSISTENCY (ie. did the editor always react to your commands in the same
way and was its behaviour consistent with your past experience)

1 2 3 4 5
Erratic, Tolerable Always
Unpredictable Mostly Predictable Predictable

Comment: _____________________________________________________________

_____________________________________________________________


b) FEEDBACK (ie. did the editor inform you what was going on?)

1 2 3 4 5
No Some Complete
feedback feedback feedback

Comment: _____________________________________________________________

_____________________________________________________________


c) FRIENDLINESS

1 2 3 4 5
Intimidating, Reasonable Welcoming,
Unhelpful helpful

Comment: _____________________________________________________________

_____________________________________________________________


d) LEARNABILITY (ie. how easy was it to learn how to use VI?)

1 2 3 4 5
Nightmare Manageable Very easy

Comment: _____________________________________________________________

_____________________________________________________________


e) USABILITY (ie. if you had to use an editor, would you use VI?)

1 2 3 4 5
Would avoid Would use Would use Would use Would always
using if necessary occasionally regularly use

Comment: _____________________________________________________________

_____________________________________________________________


f) EFFICIENCY (ie. is it possible to get things done speedily and with
minimal effort)

1 2 3 4 5
Clumsy and Reasonably Lean and
cumbersome efficient mean

Comment: _____________________________________________________________

_____________________________________________________________


3.4 Particular problems/frustrations: ________________________________

______________________________________________________________________

______________________________________________________________________


3.5 Particular "likes": ______________________________________________

______________________________________________________________________

______________________________________________________________________


----------------------------------------------------------------------

4. GENERAL


4.1 WHICH EDITOR WOULD YOU PREFER TO USE?

VI EMACS

Comment: _____________________________________________________________

_____________________________________________________________


4.2 DO YOU THINK THAT EITHER EDITOR IS SATISFACTORY OR DO THEY HAVE COMMON
FAILINGS WHICH SHOULD BE ADDRESSED?

Comment: _____________________________________________________________

_____________________________________________________________


Many of the concerns cited in this study have largely been addressed with the release of Vim - Vi IMproved.

I am incredibly curious to see a study done following similar guidelines, but using vi with better commands, and with vim. Of course a few more volunteers would be needed...

The main thing this study points out to me is that it is important to get the input of experts from both sides of an issue when designing a study, so as to be an appropriate study.

Questions, comments, criticisms of my criticisms? Leave a comment!

(Disclosure: I used vim in compatibility mode under cygwin to test the commands, but according to the online help, that should make vim run exactly like vi)

Review - Building the Perfect PC


Building the Perfect PC, by Robert Bruce Thompson and Barbara Fritchman Thompson, is the perfect introduction to the world of building your own computer. Whether you're looking for a general purpose computer built mainly for playing Farmville, or you want to build a web server, or a MythTV DVR computer, or you want a system that can play Crysis on max settings, this book will teach you how. The Thompson's introduce you to the world of PC building by explaining why you should want to build your own (and you should!), and then proceed to demystify the process of selecting components and putting them together to build your perfect PC, designed specifically for what you want to do.

Having built my own computers (and having cobbled together a few from various dead PCs), I can say this guide is an invaluable resource. The money that you will save buying an equivalent pre-built PC will probably be much greater than the cost of this book, so if you're in the market for a new PC you should buy this book and build your own. You'll be able to custom tailor your PC to your individual needs and desires, that will be a much better buy than anything you can find pre-built.

Bottom line: You should buy this book if you need a new PC soon.

An Extension...?

Google has announced that they are extending free calling in Gmail through 2011. I would ask why they are doing this but it seems obvious to me - they haven't gained the market share they're looking for, so by extending the free calling they're looking to garner new customers. Whether that's pulling from competing services such as Skype or Vonage, or introducing new users to the VOIP market.

Of course if you enjoy using Google's services, it's just another reason to love Google.

Tuesday, December 14, 2010

Review - Make: Electronics



Make: Electronics, by Charles Platt, is an incredible book for anyone who is curious about electronics. This book guides you through a variety of experiments, beginning with simple experiments like "tasting" electricity and making a battery with lemons, lighting an LED with a battery, and then quickly (but not too quickly!) moving into more advanced topics such as using relays, creating timers, soldering, integrated circuits, electromagnetism, stepper motors, and even some PICAXE programming. It has high-quality color pictures and diagrams, and great explanations.

Make: Electronics blows most other electronics introductions out of the water. I was given a copy of Electronics Projects for Dummies, but that book was so dry I couldn't bring myself to try any of the projects. Charles Platt writes an incredibly informative and entertaining book - if you are looking to buy a beginners guide to electronics, your search is over. If you are buying this book for someone with just a spark of curiosity about electronics (even yourself), after they finish this book, they just may be addicted. This book is excellent - 5/5!

Monday, December 13, 2010

Review: JavaScript: The Good Parts


JavaScript: The Good Parts, by Douglas Crockford.

Mr. Crockford writes a fine book for anyone who uses or needs to use JavaScript - ever. He quickly presents his view on JavaScript, that it can be a powerful and expressive language, but that it has some rather large warts. The author quickly leads the reader through an introduction to JavaScript, and shows how to avoid the major pitfalls inherent in JavaScript.

This book is fairly terse and not so much a learn-JavaScript book as it is a guide. The beginner embarking on a journey through the JavaScript jungle should certainly purchase this book as a companion to another more beginner-friendly book, to help clarify (and possibly correct) points being taught. I enjoyed JavaScript: The Good Parts, and recommend it to any one who works with or will work with JavaScript. It will make a big difference. Before taking a look at this book, I certainly would have happily criticized this language, but the author makes several good points and made me reassess my opinion of JavaScript. If I am ever in a position where I develop with JavaScript, you can be sure that this guide will be by my side, helping me to avoid the many pitfalls and use JavaScript to its full effectiveness.

Tuesday, December 7, 2010

Password Generator

My older brother first introduced me to the idea of a pronounceable password generator. At one point I took a look at the one available here., and at one point I downloaded the C++ version to try and reverse engineer the generator. Well, fast forward to tonight when I had the opportunity to do so from the JavaScript version into Python. I suspect my engineering may not be quite so perfect, as almost all of my generated PWs start with the letter 'a'. Of course it may be a function of the random number generator. As far as programs go, it is actually fairly simple - the complexity is really in the trigram matrix - which is huge, accounting for about 620 lines. Aha! I found the issue - I was seeding with 12579.0 instead of 125729.0, whoops!

So now it works. Sweet action.

You can see the source here.

Tuesday, November 23, 2010

Review - Buying a Home: The Missing Manual

Buying a Home: The Missing Manual

by Nancy Conner



Are you thinking about buying a home? Then this book is for you! Buying a Home: The Missing Manual walks you through everything you need to know about the process of purchasing a home, from selecting a real estate agent, to closing (and even a little beyond). Having started the process of buying a home a few times before, I can honestly say I wish I had this book back then. I would have avoided some of the pitfalls that plagued both of my experiences. I didn't even know the questions to ask, and Buying a Home gave me questions to ask and answers to some questions I didn't even know to ask.

I seriously recommend this book to anyone who is contemplating home ownership - whether you get the digital or dead tree version, if you think you will buy a home in the future, Buying a Home: The Missing Manual is a wise investment.

I review for the O'Reilly Blogger Review Program

Sunday, November 14, 2010

Winamp and XMMS Alternative

Do you use Linux? When you were on Windows, did you love the classic Winamp? Are the hokeys z,x,c,v,b ingrained in your soul? Did you think XMMS was a great Winamp replacement? If so, you'll probably love Audacious media player. It's simple, basic, and is everything you loved about Winamp - the simple interface, the hotkeys... it's an mp3 player that plays mp3s, not a super-ultra-megazord-multimedia station. I found my new toy.