Book Review: Beginning Ubuntu Linux Second Edition

    The latest version of Ubuntu Linux, 7.04 Feisty Fawn was released yesterday and at the same time a courier showed up at my door with a package from Apress Publishers. The package contained their wonderful Beginning Ubuntu Linux book, now in its second edition. When I reviewed the first edition, almost a year ago, I liked it a lot. The second edition is also geared to the newbie, just like the first one, but there are a number of changes, all of which for the better.

First off, the book comes with a double sided DVD containing both the 6.06 and 6.10 releases of Ubuntu, Kubuntu, Xubuntu and Edubuntu, which means that there is something for everyone. The basic chapter is the same, starting with an introduction to what Linux is and what you can do with and progressing to how to get around to installing and using Ubuntu. But some sections of the text have been reorganized and additional matter added. Of course, everything is now up-to-date with regards to the 6.10 release. There are more screenshots, which is always a good thing for a new Linux user.

The installation guide is still written in a hold-your-hand manner, something that is certain to be reassuring to people installing their first Linux. The section dealing with common installation problems and their fixes has been expanded and the typesetting is now much clearer, making it easier to find the problem that you are looking for. The getting-started sections as well the introductions to common programs retain their well-written style but have been improved by adding further screenshots and by providing howtos for  common tasks.

One thing that I especially liked about the first edition was the section on using the BASH shell to perform slightly more advanced tasks. The corresponding section of the new edition provides much of the same information, but advanced topics are better explained. The chapter regarding filesystems, users and file permissions has been improved and expanded. This will be a welcome change for first-time users as file permissions can often be something quite hard to understand and quite easy to misuse.

By far the section that has received the most attention is the one regarding software management. There are instructions on keeping your system up-to-date as usual, but also guides on installing an anti-virus software (which is probably not necessary, but many people feel safer with one around) and also on adding more repositories. This is handy for people who are ready to pass out of the “newbie” stage and move on to do some exploring.

On the whole, the book lives up to its claim of being “Written for newcomers to Linux, yet comprehensive enough to appeal to even seasoned users”. While readers will derive the most benefit in the first few weeks of their Ubuntu experience, there is a good chance that you will you be looking up some of the more advanced matter even after a good few months. The second edition has the same price as the first one : $39.99, but whereas the first one was a fair deal, the new one, with all the new material and the power-packed DVD, is a downright bargain. If you’re looking for your first Linux experience, but unsure where to start, I recommend you pick up this book.

Top Web Tools for Students

Being a student myself, I have to use the Internet regularly for things like projects, papers and sometimes just looking for new things to do. Here’s a list of online services that will make your life as a student easier.

1. Mozilla Firefox Web Browser

If the internet is going to be a friendly companion, you’re going to need this. Standards compliant, feature-rich and most importantly, extensible. Opera comes in at a close second, but there a number of web services that still don’t work properly in Opera.

2. Gmail

The best webmail service on the internet. Not only does it have the largest inbox, it has the best spam filter I’ve seen and it’s use of filters and labels makes it a snap to keep your mail organized. If your working on a collaborative project, and documents that you’re emailed can be opened, edited and saved using Google Docs. Furthermore, using tools like Gspace or Gmail Drive, you can turn your 2 GB of inbox into an online file storage system. But that’s not the end of Gmail’s capabilities, here’s an article about using Gmail to do everything from storing bookmarks to managing your schedule.

3. Online Office Apps — Zoho

Zoho provides a wide-range of online, free office applications including a word processor, a spreadsheet program, presentation creator, a wiki and a planning tool that can come in very handy. Zoho provides a one-stop shop for almost all of a student’s needs. Everything can be stored online, shared with other Zoho users and exported to a number of formats including both Microsoft and OpenDocument formats. Zoho has recently tied up with a number of online storage providers, including OmniDrive, Box.net and myDataBus. Any documents stored in these services can be edited using Zoho’s tools and stored back, without requiring you to download a copy. Unfortunately there is no way to open email attachments with Zoho (at least not if you use Gmail). If integration with your Gmail account is a must, you might want to take a look at Google Docs and Spreadsheets, but it is an inferior product.

4. Google Search

Google Search can be an extremely powerful tool for online research. Unfortunately, most students simply don’t know how to use it properly and as a result, they often don’t find what they’re looking for. If you intend to make your use of Google more efficient, you’re going to need to learn some hacks. Google has a cheat sheet of simple operators and there is an interactive tutorial to help you learn more. And if you’re really determined to become a powerful Google Hacker, get the book from O’Reilly.

5. Google Notebook

This is just what it sounds like: a notebook. You can create a notebook and by using a browser plugin, you can select almost anything off the internet and save it to your notebook. The URL your information came from also gets saved which makes things a lot easier when it’s time to write references. You can reorganize your notes, add or delete them, or move them to another notebook. Once your research is done, you can export your Notebook to Google Docs, which means that you get a skeleton document to start off with (and a lot less copy/pasting). Sharing and searching is also supported, but the search is rather basic.

Clipmarks offers a similar service, and its plugin makes it somewhat easier to add content, but I feel the interface is unnecessarily cluttered and it provides more emphasis on sharing your information. And there is no export feature. Zoho is also working on it’s own Notebook product which should be out soon and from the demo video it looks like it’s going to be a killer app as well.

6. Online Calendars and To-do-lists

You won’t be much of a student if you don’t manage your time properly luckily the internet is there to help you out. There are a number of online calendars out there, out of which Google Calendar is the one I like. But 30Boxes is a strong contender and there are a number of people who swear by it.

While talking about to-do-lists, Remember the Milk beats them all. It’s simple, uncluttered and gets straight to the point. It’s also easy to integrate it into Google Calendar, giving you an all in one time management tool. If you want a heavier management system, you might want to look at Backpack, though its calendar is only in the non-free version.

Many of the above aren’t as feature-rich as their desktop equivalents, but that will probably not be a problem for most students. And of course all that is balanced by the fact that your data is available anywhere, anytime (as long as you have an internet connection). It takes some effort juggling multiple services, but if you invest some time in learning your way around, you’ll get better benefits in the long run. If you have your own can’t-live-without web services, do tell me and I might include it in a future update.

Introductory Books for Beginning Programmers

I’ve recently started learning progrmming seriously and so I’ve been on the lookout for good books to learn from. So here’s a short list of books that I’ve found useful. They deal with a variety of languages and concepts and the best thing is that they’re all absolutely free. Please note that these books would probably be most useful for someone in the last two years of school, though older people shouldn’t have a problem. I’m personally using them as a sort of prep for studying Computer Science in college and so only time will tell if I’ve been successful.

How to Think Like a Computer Scientist – Python Version

Python by itself is a very good programming language for beginners (unless you’re less than ten years old in which case I would suggest Logo). Combine that with a good book and you get a winning combination. The book’s style is clear and cluttered and the chapters are fairly self-contained. It does a good job of introducing procedural programming first before moving on to object orientation (which can be quite a difficult concept for beginners). My only real gripe is that there seem to be too few exercises, which sort of leaves you on your own to find something to do.

How to Think Like a Computer Scientist – Java Version

This is the original Think Like a Computer Scientist book, and unfortunately it’s one major flaw isn’t really something that can be fixed: the choice of language. Java as a language may be very nice, but it’s certainly not too fascinating for beginners. If your learning programming on your own, like I am, I would recommend starting this book after you’ve come to grips with the object oriented matter in the Python book. That issue aside, it is a very good book and I personally like its style slightly more than I do the Python one’s. One major scoring point is that there are a number of exercises at the end of each chapter which involve both writing and reading/fixing code. This book will also come in handy if you’re studying for the American AP exam, but I’m not quite sure if it covers all the bases. I would suggest combining this with the BlueJ IDE, which’ll let you sidestep many of the practical hurdles involved in using Java as a beginning language.

How to Design Programs

This book is designed from the ground up to make you learn programming that is data-centric, i.e. the program’s very purpose for existence is the data that it manipulates. Unlike other programming books that focus on specific concepts as a path around which to structure your learning, this book focuses on data: you start by using smaller, atomic types of data and then move on to using mroe complex data structures. This book uses the functional programming language Scheme. But this books comes with its own dedicated environment: DrScheme. DrScheme helps beginners tremendously by hiding obscure syntax features until the time is right. It does this by providing not just standard Scheme, but a number of subsets containing only the features that you will need. As you progress through the book you move on to richer and richer subsets until finally you’re ready to use full-fledged Scheme. The book focusses on the ‘why’ of a program rather than the ‘how’.

Structure and Implementation of Computer Programs

Think of this as the last one’s big brother. SICP has been the textbook for MIT’s introductory Computer Science for the better part of two decades. As you can well imagine, this not for the faint of heart. However, once you set your mind to it, you’ll find that the book deserves its reputation as a computer science classic. It’s written in a simple no-nonsense style and like HtDP, it teaches you programming, not a programming language. It uses Scheme, but it makes and effort not to let your attention be drawn to what language you’re using. The book drives home the fact the computer is just a tool and your head is where you have to do the real work. That being said, there is probably no point in reading this book unless you intend to make computers your career. Also, having some amount of programming experience would help you on your way. This book is also rather intensely mathematical, and so make sureyour math skills are well polished before you embark on this journey.

Programming from the Ground Up

This book takes a different approach to programming: it’s basic premise that you can only really learn how to make a program if you understand how the computer ticks inside and what it does when it runs your program. As a result of that philosophy you are required to get up close and personal with the computer and that means assembly language. Yes the book uses assembly language (x86 assembly to be specific), but all the examples are very thoroughly explained and if you have patience in abundance, you shouldn’t have any problems. What sets it apart from SICP, is that while SICP approaches programming from a mostly theoretical aspect, this approach is decidedly practical. Again, probably not worth your time unless you plan on computer science as a career.

Personally, I think all the above are very good books. Of course there is the inevitable question of choice. I’m currently working my way through the How to Think Like A Computer Scientist books (yes, both of them). Once school is over I will try push through How to Design Programs and finally go through SICP and Programming from the Ground Up. All in all, I think all of that should keep me busy for the better part of a year. So in a year’s time, come back and check on my progress. If you’d like an IDE to go with your new book, check out the next post.

The Ackermann Function in Java: Why Computers are Stupid

I’ve started teaching myself Java, right from the basics and as a guide I’m using the Java version of the How to Think Like a Computer Scientist book. One of the exercises at the end of the fifth chaper (called Fruitful Functions) is to implement the Ackermann Function as a recursive method. The Ackermann function is mathematically defined as:


Now, the Ackermann function is quite well suited to computerization, it takes little real intelligence to solve for any two numbers, and is mostly repetitive calculation (which computers are good at). It took me less than a minute to implement the function as a Java method as follows:

public static int ackerman(int ack1, int ack2){

if (ack1 == 0)

	return ack2+1;

else if (ack1 >0 && ack2 == 0)

	return ackerman(ack1-1, 1);
else if (ack1 >0 && ack2>0)

	return  ackerman(ack1-1, ackerman(ack1, ack2-1);
)

I passed it to the compiler and the compiler replied with a cheery: “missing return statement”. Since I already had three return statements, that meant that there was a possible path through the method where the method would end without a value being returned. The Ackermann function doesn’t work with negative numbers, so I had already implemented a check for negatives before the function call. I tried putting in another check for negatives in the function itself, but that didn’t work. By this point I was getting rather frustrated because the above code would catch all non-negative numbers and produce appropriate returns. I ran the code in my mind with a few small numbers and everything seemed to check out as it should, the values of ack1 and ack2 would keep on reducing until ack1 hit zero and the method would end with a proper return.

Finally on a hunch, I decided to remove the last if-else and make the last return statement free-standing. Semantically it was the same thing, because there was only one possible case if the first two conditions were not satisfied. And for some reason the compiler thought that this new version was perfectly passable. I haven’t entirely ruled out the possibility that there was really some path that would have resulted in no return. But I think that it is far more probable that the compiler for some reason couldn’t handle the multiple recursions and simply gave up. Of course, I’m not an expert in these things and if someone knows of a proper explanation please let me know. Until then I’ll stick to the knowledge that a computer is still quite some distance away from what would be common sense to a human (or at least the Java compiler is).

Book Review: Beginning Python

Learning a new language (human or computer) isn’t always easy. But it helps if you have a good teacher, who makes things fun as well as interesting to learn. Sometimes a good book can make things a lot easier. I’ve been wanting to learn Python for a good few months now and being the dedicated netizen that I am I turned to the Internet for tutorials and howtos. Though Python documenatation is fairly complete and quite usable if you are trying to teach yourself, it can be rather bland at times. Luckily for me, Beginning Python: From Novice to Professional from Apress came to my rescue.

Beginning Python is written by Magnus Lie Hetland, author of another Apress book, Practical Python and a number of well-written online tutorials which are available at his website. Beginning Python isn’t meant to teach you everything that there is to know about Python or programming. What it tries to do (and succeeds at) is to give you a good head-start from the basics upwards. The book covers a fair amount of matter, starting from the basics of writing simple, small programs to full-fledged GUI applications. Most importantly however, it does so in a pleasing, conversational style. Each chapter is fairly self-contained, dealing with a particular aspect of Python programming, which means that you can learn at your own pace and even skip a few chapters without too much difficulty. But what makes the book stand out from the crowd is that it not only gives a working knowledge of Python, it helps you figure out what to do with that knowledge. The book includes 10 programming projects including things like an XML converter, and internet messaging system, a file transfer program with a graphical frontend and even an interesting little game. Most chapters also come with a set of suggestions at the end about how you can apply what you’ve learned: a great way to keep yourself busy if you’re bored

While the book is called Beginning Python, there is some amount of more advanced information like network programming (including working with CGI and SQL), using GUI toolkits and other practical things like testing, debugging, optimizing and packaging programs. At the same time, it should be noted that the book does not intend to turn you into a complete master: the advanced material is enough to get you up and running, but do not cover the topics in great depth. All things considered, the book will probably be useful to you even after you have a fair mastery of the basics. It’s clean structure and good formatting allows it to be used as a quick reference as well as a textbook.

The book is definitely worth a buy if you’re interested in learning Python but have been keeping it off for want of a good resource. The $45 price tag is a bit steep, but it’s worth it for a book that will take you a long way and will probably still be useful even after a good few months.