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:
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!)