November 2009 Archives

I’m almost a text-based e-mail purist. I used to use Mutt as my primary e-mail client application, but decided to go with a graphical client such as Mozilla Thunderbird or KMail so that I could at least effectively read HTML-formatted messages.

I’ve been happy with KMail. I’ve had it configured to prefer text-based e-mail and aside from the fact I don’t use my preferred text editor (vim) inside it, it’s been a good e-mail client. Now, my dad is a more typical e-mail user. While he probably doesn’t care that much about composing original HTML messages, he does receive a lot of them that he wants to forward onto other people that he feels may be interested. He’s on lots of political and family mailing lists that swap HTML messages complete with embedded images, etc.

He has been using Thunderbird at his home and KMail (an old version running on a Fedora Core 6 desktop) at his office. He mentioned to me that KMail runs noticeably faster on his work system than Thunderbird does on his home system. I suggested that we could standardize him on KMail and upgrade his office desktop to a more recent version of Fedora Linux.

Things got more interesting when Thunderbird recently got updated on his home system in a package update to version 3.0b4. The Smart Folders “feature” threw both of us for a loop. It combines multiple Inbox, Sent, and other IMAP folders into single virtual folders containing an aggregate of messages from each corresponding folder. I really have no idea who would want this feature. My parents each have their own e-mail accounts and I had Thunderbird configured so they could check mail for both accounts. The new version of Thunderbird combines both inboxes into one virtual “Smart” folder and subsequently confused the heck out of my father.

I figured out how to disable the “smart folder” behavior (View->Folders->All), but Thunderbird was still hiding other IMAP folders like Sent and Trash that my parents often need to access messages in.

So, KMail. KMail works great for almost all things, but my father noticed right away when he tried to forward an HTML message with embedded images that KMail wasn’t letting do what he was used to doing: Editing the forwarded message to remove the annoying gazillions of e-mail addresses the original message(s) were addressed to.

KMail has two methods of forwarding a message: First, you can forward a message as an attachment. This preserves everything about the original message, but KMail doesn’t let you edit anything within the attached message. Alternatively, you may forward a message “inline”. This lets you edit the message, but it only gives you the text portion of the message to edit and completely omits the HTML attachment altogether.

I did some research online to see if there was a way to get the desired functionality out of KMail, but it doesn’t look like it’s possible. If it does ever happen, it’s a couple versions out at least. It may never happen because it seems there are voices within the KMail community that feel KMail should never take on these types of features because it risks KMail becoming “another Outlook/Thundebird clone.”

Has anyone found other solutions to this problem for a Linux user?

I recently encountered a problem when I plugged in my Sprint USB aircard (A Sierra Wireless USB 598) into my laptop running Fedora 12. When I clicked on the NetworkManager applet running in my system tray and selected the mobile broadband (CDMA) device to connect to, it appeared to connect and, then shortly after, disconnect.

I watched the messages sent to the /var/log/messages file to see what was going on and sure enough, NetworkManager was successfully making a PPP connection to Sprint’s service and then PPP was terminated and the connection was closed.

I did some quick searching online but didn’t find anything definite about this. There were lots of links to the Fedora 12 release notes which claimed Fedora 12 had better support for mobile broadband cards than previous releases. That made me wonder if their improvements were actually breaking things for me.

I decided to explore the options dialogs. I right-clicked on the NetworkManager applet and chose Edit connections..., selected the Mobile Broadband tab, selected my adapter and clicked Edit.

Under the PPP Settings tab there is a button labeled Configure methods in the Authentication section. This lets you choose which authentication methods PPP should try. A list of checkboxes next to possible methods appears with EAP, PAP, CHAP, MSCHAP, and MSCHAP v2 as possible selections.

I knew Sprint doesn’t use anything fancy. In fact, you don’t even need to provide a user or password. It authenticates using the device ID or virtual phone number of your device. So, I wondered if disabling some things might work. I figured if it was using anything it was probably CHAP or PAP. I disabled everything else.

Lo and behold, the next time I tried to connect, it connected and stayed connected!

I hope this is useful to someone else.

Mobile Broadband connection dialogs

Masterminds of ProgrammingMasterminds of Programming by Federico Bioancuzzi and Shane Warden and published by O’Reilly and Associates is a large (480 pages), dense book packed full of exposition about language design, software engineering practices, software development lifecycle methodologies, Computer Science curricula, and unique insights into computer and computation history.

The format of the book is straightforward. Each chapter is dedicated to a programming language and contains a series of questions by the authors and responses from designers and creators of the language being highlighted.

I expected the chapters on languages I was familiar with to be the most interesting and those I was not familiar with to be the least interesting but my experience was the opposite. Chapters highlighting languages that I have had no exposure to such as Forth, APL, ML, and Lua were full of intriguing information, especially languages that were designed in the 1960s or 1950s. It’s fascinating learning about how these languages came to be given the relatively restrictive hardware they were developed with.

Other languages highlighted in the book include:

  • Python
  • Perl
  • Java
  • C++
  • C#
  • Objective-C
  • UML
  • AWK
  • Postscript
  • Eifel
  • Haskel
  • BASIC

The book is just overflowing with powerful quotes that carry substantial meaning to developers, language designers, and managers. Here are a few that stood out to me.

“Whenever I hear people boasting of millions of lines of code, I know they have grieviously midunderstood their problem. There are no contemporary problems requiring millions of lines of code. Instead, there are careless programmers, bad managers, or impossible requirements for compatibility.” —Chuck Moore in the Forth chapter

“As processors continue to get faster and memory capacities rise, it’s easier to do quick experiments and even write production code in interpreted languages (like AWK) that would not have been feasible a few decades ago. All of this is a great win.

“At the same time, the ready availability of resources often leads to very bloated designs and implementations, systems that could be faster and easier to use if a bit more restraint had gone into their design. Modern operating systems certainly have this problem; it seems to take longer and longer for my machines to boot, even though, thanks to Moore’s Law, they are noticeably faster than the previous ones. All that software is slowing me down.” —Brian Kernighan in the AWK chapter.

“Software engineering is in many ways a very pathetic field, because so much of it is anecdotal and based on people’s judgements or even people’s aesthetic judgements.” — Peter Weinberger in the AWK chapter

“The software business is one of the few places we teach people to write before we teach them to read. That’s really a mistake.” — Tom Love in the Objective-C chapter

“What do you think the chances are that Microsoft applications get slower and slower because they haven’t managed memory properly? Have you ever met a three-year-old Microsoft operating system that you wanted to use? I actually operate with a laptop that has a Microsoft-free zone. It’s amazing how much more productive I am than other people sitting in the same room with Microsoft computers. My computer is on, and I’ve done my work, and I’ve closed it down before they’ve gotten to their first Excel spreadsheet.” — Tom Love in the Objective-C chapter.

“If you study gold or lead from day to day, you can measure the properties and employ scientific methods to study them. With software, there is none of that.” — Brad Cox in the Objective-C chapter.

“C# basically took everything, although they oddly decided to take away the security and reliability stuff by adding all these sorts of unsafe pointers, which strikes me at grotesquely stupid, but people have used most of the features of Java somewhere.” — James Gosling in the Java chapter responding to the question related to C# being inspired by Java.

“I think architecture is very important, but I am cautious about labeling individuals as architects, for many reasons. Many times I have seen companies with a team of architects that they send to other organizations to work on projects. That may be fine if they work inside a particular project, but companies such as big banks usually have a group of enterprise architects that sit and draw representations of the architecture. Then they throw this over the wall to the developers. The developers just ask themselves: ‘What is this? It’s useless.’ In many companies, enterprise architects sit in an ivory tower without doing anything useful.” — Ivar Jacobson in the UML chapter

“Developing software is not rocket science. Look at the 5-10 million people who call themselves software developers. Very few of them really do anything creative of fundamentally new. Unfortunately, the outside world thinks that programmers are creative and brilliant people, and that’s far from reality.” — Ivar Jacobson in the UML chapter.

“I rarely have met a programmer who understands the principles of computational complexity and puts them into practice. Instead they fuss with all kinds of pointless suboptimizations that are ‘pennywise and pound foolish… I think the most important skill in computing (as in physics and other creative fields) is the ability for abstraction.” —James Rumbaugh in the UML chapter.

“I have found over my career, whether it be researchers or engineers, that in addition to the sort of intellectual skills that they manifest, if they are people who finish what they set out to do, they tend to be much more productive and have a much larger impact.” — Charles Geschke in the Postscript chapter.

These quotes are just scratching the surface.

Many of the interviews discuss history of computer science and computation theory. For example, Charles Geschke and John Warnock gave answers in the Postscript chapter detailing how Xerox PARC came into existence out of ARPA’s emphasis on digital communications which was the result of thinking within the Eisenhower and Kennedy administrations.

Because of the simple, straightforward format of this book, there is definitely room for improvement. For example, readers unfamiliar with certain languages would find it immensely useful to see examples of the language in use. One thought is that each chapter could start with a code excerpt showing how a programmer might use the highlighted language to solve a generic problem. Readers could then see, in code, how each language differs in their approach to the same problem.

Each chapter is preceded by one paragraph description of the language which may contain brief history of the language’s history. This could definitely be expanded upon. This book is big already and I don’t think O’Reilly’s goal is to make it a computer language text book, but it would be useful if each chapter started with 2-4 pages of introductory abstract about the language.

The authors have placed biographical information about each of the contributing interviewees in a Contributors appendix near the end of the book, but it would be more helpful to the reader if this information appeared at the beginning of each chapter instead.

Masterminds of Programming is available at a suggested price of $39.99. I rate it at four and a half stars.

The ffmpeg package that is available for Fedora 12 via the rpmfusion.org respository does not include faac support. This can be a problem when you want to create H.264 video content that incorporates the AAC (Advanced Audio Codec).

The most straightforward way I’ve found to rectify this situation is to build a new package from the source RPM.

First, download the source RPM using yumdownloader.

yumdownloader --source ffmpeg

This will download the .src.rpm file to the current directory. Install it using the rpm command. (This assumes you have a person RPM build environment set up. This blog post provides some good information on that.)

rpm -ivh ffmpeg-0.5-5.20091026svn.fc12.src.rpm

You probably want to indicate some sort of difference in the version numbering since this version is a modification of the upstream. Edit ~/rpm/SPECS/ffmpeg.spec and modify the Release: line by adding something to the end of it.

Release: 5.%{svn}svn%{?dist}_fozz

Now, you can try building the package with rpmbuild. Unless you’ve already installed all the development libraries and other dependencies ffmpeg relies on, you’ll get some dependency messages. Use yum to install those dependencies and then try building again.

rpmbuild -ba ~/rpm/SPEC/ffmpeg.spec --with faac

This will create RPM packages for you under ~/rpm/RPMS/. Use rpm to install the ffmpeg and ffmpeg-libs packages.

rpm -Uvh ~/rpm/RPMS/x86_64 ffmpeg-{libs-,}0.5-5.20091026svn.fc12_fozz.x86_64.rpm

The FFmpeg::Command Perl module is a convenient way to drive the ffmpeg command-line utility for converting multimedia files.

For work, I have developed some scripts that make heavy use of FFmpeg::Command. Yesterday, one of the other developers told me they need a conversion script to be able to merge separate video and audio streams into one file that contains both audio and video. The ffmpeg command-line utility can do this by accepting more than one input file. For example:

$ ffmpeg -i video.avi -i audio.wav -acodec copy -vcodec copy merged.avi

The FFmpeg::Command Perl module, however, assumed there can only be one input file. I made the necessary changes to the module code so that it would accept multiple input files, created a patch file, and sent it to the Module owner Gosuke Miyashita. This morning, I received e-mail from Gosuke thanking me for the patch and informing me that he has uploaded a new version (v0.12) of FFmpeg::Command to CPAN.

I love Perl and open source software!

About this Archive

This page is an archive of entries from November 2009 listed from newest to oldest.

October 2009 is the previous archive.

December 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.