Tuesday, March 23, 2010

Updating Firefox/Thunderbird (Ubuntu & Mint)

I really like both Firefox and Thunderbird, and I like using the latest stable versions (plus it makes sense from a security standpoint). Unfortunately, the official Ubuntu software repositories lag behind, so if you stick to them you don't get the latest versions. In my case, that's an extra headache because I also use Firefox and Thunderbird on Windows XP, and I'd like to have the same user interface on all machines. Fortunately, there's a simple solution: the Ubuntuzilla project.

The first step is to add Ubuntuzilla to the list of repositories used by the Synaptic package manager. The Ubuntuzilla wiki gives good instructions, although they seem to omit what I would consider the most intuitive approach for GUI-oriented users: start the package manager (giving an administrator password); click Settings | Repositories; go to the Other Software tab; click Add... and paste in the command shown on the wiki page ("deb ... main"). Then click the Reload button. (Ignore any complaint about not finding the public key for the new repository.) You can now install the firefox-mozilla-build and thunderbird-mozilla-build packages to update them to the latest versions, and also do future updates through Synaptic the same as with other packages.

Before updating them, though, it's recommended that you back up your existing configuration information, mailboxes etc. They'll most likely be saved in folders named .mozilla and .mozilla-thunderbird under your home folder. If you're using the default Nautilus file manager, you can see hidden folders (those starting with ".") by hitting ctrl-h. Just copy those two folders anywhere safe (I use the desktop) before upgrading.

Today's update took Firefox from 3.5 to 3.6.2 and Thunderbird from 2.0.something to 3.0.3. Firefox found and used the old settings with no effort, but Thunderbird did not. (The same upgrade on Windows did automatically convert all the old settings, archives etc.) The problem with Thunderbird is that version 2 stored its stuff in .mozilla-thunderbird but version 3 stores it in .thunderbird. So the fix is trivial. The first step is to create a .thunderbird folder under the home folder. If you've already started Thunderbird and bailed out when it asked you to create new accounts, just find the .thunderbird folder and delete its contents (but leave the folder itself). Then all that remains is to copy the contents of .mozilla-thunderbird into .thunderbird, and Tbird 3 aborbs it all when next it is started. I'll hang onto the .mozilla-thunderbird folder a bit just to be on the safe side, but I should be able to delete it safely.

[UPDATE 5 March 2011: The latest updates to Firefox and Thunderbird have made their way into the Canonical repositories but not into Ubuntuzilla, as best I can tell.  Message traffic on the Ubuntuzilla forum (from outsiders, not from project managers) suggests that Ubuntuzilla may have become inactive.  So I've switched back to the "official" ports for Ubuntu.  The process was easy -- just uninstall the old, install the new in Synaptic.  I backed up my profile folders (~/.mozilla and ~/.thunderbird), but the backups were not needed in the end.  Rumor has it Canonical has adopted a policy of sanctioning updates, at least for the Mozilla programs, more quickly.  So thanks to the Ubuntuzilla folks for the service they provided while it was needed.]

Thursday, March 18, 2010

Presentation Software

I do all my writing in LyX, a very user-friendly authoring program that employs LaTeX as its publishing engine. It makes for nice-looking output, and composing math (which I do a fair bit) is very easy once you get the hang of it. LaTeX contains numerous user-contributed packages, and I find Till Tantau's Beamer package excellent for doing presentations. The presentations are generated as PDF files (with options for handouts and notes).

Business students are a bit disconcerted by the use of PDF (as opposed to PowerPoint), but there are advantages. Not least of those advantages is a comparative freedom from Adventures in Fonts. At a conference, presenters often share a single laptop brought by one of them. A couple of years ago, I attended a conference where the presenters were split roughly equally between Beamer users (mainly I think from Europe, some from the U.S.) and PowerPoint users (mainly from the U.S.). Both groups of users tended to have equations in their presentations. This was no problem for the Beamer users (with perhaps one exception), because the necessary math fonts were embedded in the PDF files. The PowerPoint users, however, relied on the laptop having the requisite fonts installed, and approximately half the PowerPoint presentations ended up with equations that were either missing (the space was there but appeared blank) or garbled.

PowerPoint does have advantages in terms of eye-candy, though. That advantage is somewhat negated by Martin Fiedler's Impressive program. Impressive allows me to present PDF files with transitions. I use the default, which is a random mix, but the transitions can be customized. More useful features, from my perspective, are the ability to highlight parts of a slide, put a "spotlight" on a portion of a slide, zoom in and out, and use the tab key to bring up thumbnails of all the slides and then jump to the one I want. Impressive is written in Python and runs on Linux, Mac OS and Windows. Very handy!

Monday, March 15, 2010

Icons for Windows Apps on Linux

As much as I prefer Mint/Ubuntu to Windows (and that's much), I've yet to find a directory synchronization application native to Linux that I like as much as Cockos Inc.'s (free) PathSync for Windows. Fortunately PathSync runs just fine under Wine emulation. That's doubly handy, since I still have a couple of Windows systems, and I can use the same sync app on all my machines.

PathSync saves it settings to files with a .pss extension, and on Windows you can double-click the icon for a .pss file and open it in PathSync. This works in Linux as well after I write a small script file to run PathSync under Wine, and associate the .pss extension with the script file.

On all machines, I sync to a USB drive. On the Linux boxes, I put all the .pss files, plus the script to run them, in a single directory under my home, and also throw in a script file to do a "master sync" by running the other script against every .pss file in the directory. Then I create a launcher for that master sync script and park it in the system panel for easy access.

That just leaves me with the task of associating useful icons with both the .pss files and the launcher for the master script. Turns out that's easier than I thought. Wine creates a .desktop file for PathSync in ~/.local/share/applications/wine/Programs/PathSync, which tells the OS among other things where to find the icon that PathSync provides to Windows. That icon shows up in ~/.local/share/icons, and I can associate it with the master script launcher as well. So everything looks the same under Mint and Ubuntu as under Windows.

Other Windows programs installed under Wine park their icons in the same directory, so they can also be associated with launchers and scripts.

Sunday, March 14, 2010

World Wide Crutch

Three posts within the last few days, on different technical forums, merit a short rant. In the first case, someone posted what was flagrantly a textbook exercise and asked for the solution. The first poster didn't even ask for hints (which the second poster did on what was also clearly a homework problem); he asked for the solution. The question was blocked by the forum moderator. This happens often enough that I've toyed with the idea of posting seemingly plausible but incorrect answers to homework problems in the hope that the "student" will get a poor grade, decide it's not worth infesting the forum, and share that wisdom with other intellectually- and ethically-challenged friends. (Someone, I can't recall who, adopted a policy of responding to questions that looked like homework by promising to post a response in a week or so, the theory being that an answer to a legitimate question will likely still be valuable in a week, whereas the deadline for the homework will likely have passed by then. I like the idea but can't be bothered to keep track of dates. Said laziness also keeps me from following through on my idea of disincentive by dissembling.)

The third poster asked a question on a software forum: will the statement ___ work. Someone posted the first answer that occurred to me: have you tried it? (Well, that's close to the first response that occurred to me, and a bit cleaner.) If you're wondering whether rebooting the autopilot during a landing sequence will cause the airliner problems, it's a really good idea to ask first. If you're just wondering whether a piece of software will accept a certain bit of syntax, or a certain sequence of keystrokes, create a test document/project/whatever and try it. If the software doesn't like what you're doing, it's highly unlike the result will be a total collapse of the space-time continuum.

Apparently it is easier to post a question on a forum that it is to try something simple on the same computer with a piece of software ... or, heaven forfend, actually try to figure things out the way they were figured out before the advent of the World Wide Crutch.

Getting Organized

... or at least less disorganized ...

I've never been one for outlining, diagramming or in general planning projects. Whether I'm writing a paper or a computer program, I generally dive in, compose in a somewhat stream-of-consciousness way, and then refactor things until I'm satisfied (or run out of time, or lose interest). Maybe it's a sign of age, but lately I've been using a couple of open-source tools to try to organize my thoughts a bit better. They both seem to have a lot of utility, if I can just get more regular in my use of them.

One is Tomboy Notes, a simple application that lets you jot down notes on the fly. Notes are essentially small HTML/XML files that can be organized into notebooks, linked to each other, and searched. You don't have to worry about naming and saving files; that's done automatically in the background. It's a Linux app, but there's a Windows port that works just as well as the original. You can park an icon for it your system tray/quick launch bar/panel/whatever so that it's one click away. I suspect there are ways to launch it with hot keys as well, but I'm not a hot key aficionado. (If I had enough memory cells to remember all those hot-key combos, I wouldn't need a note taking app!)

The other application falls into the category of mind-mapping software. When I first encountered stories about mind-mapping applications, it struck me as a way to make easy things harder. I'm changing my mind about that. The mind-mapper I've settled on is XMind, which has both free and pro versions. The free version is fine for me. Basically it's an easy way to draw a few types of diagrams that organize ideas into some sort of coherent display, with links connecting various concepts, and with the option for various types of annotations (including notes on individual concepts). I'm still trying to adjust to the use of a mind-mapper. Ideally it should be my first stop when starting a project, but so far I'm still in "dive in head first" mode there. Nonetheless, I'm finding productive uses for it, and I think it will grow on me.

Two recent examples relate to a service project for a professional society (the Decision Sciences Institute) and a research project. For DSI, I was asked to chair an ad hoc subcommittee that would make recommendations about improvements to their web site. I started by scribbling things on scrap paper (no sheet of paper with a blank back escapes me without some scribbles), but quickly realized that was turning into an incoherent mess and transferred the ideas to XMind. As with word processing software, one advantage of a mind-mapper is that you can quickly add, delete or modify things without having to rejigger the entire diagram. I was able to use the XMind diagram not only to organize the committee's activities, but also to present a preliminary set of recommendations to the institutes Board of Directors.

On the research side, a current project requires a relational database (SQL) to hold results. Once again, I started in scrap paper mode, then created the database in SQLite. When I needed to verify which fields were foreign keys to which other tables, I realized my error. The scrap paper notes were too hard to decipher, and there were enough tables in the database that looking through all the schema was a pain. So I retroactively mapped the database in XMind. At least this way, the next time I need to modify the database design I'll have an easy reference.

Tuesday, March 2, 2010

Installing CPLEX (educational version) on Linux

IBM recently made the full, size-unlimited version of several OR tools, including CPLEX, freely available to educators who join its Academic Initiative.  Once you've joined, you just surf to https://www.ibm.com/developerworks/university/software/get_software.html, click Download from the software catalog, sign in (if you have not already) and use the search feature to locate CPLEX (or whichever program you want).  Along with a couple of Windows installers, there's an omnibus archive file for Unix that contains 32 and  64 bit versions for several Unix and Linux distributions.  You download a license file separately from https://www.ibm.com/developerworks/university/support/ilog.html (but do not need to install the license manager program, just the license file).  They also make some courseware available.  It's a sweet deal!

Installation on Linux is pretty easy: extract the archive appropriate to your particular OS and architecture, unpack it somewhere, and park the license file someplace you can find it.  (Details are spelled out in a Quick Start guide.) That leaves the question of how you're going to run the interactive optimizer.

I decided to use a mix of two approaches on my systems, which run Linux Mint (which shares most of its plumbing with Ubuntu).  One approach was to create a run.sh file in the CPLEX installation directory.  The contents were pretty simple:

export ILOG_LICENSE_FILE=<absolute_path_to_file>/access.ilm

I ran chmod +x run.sh in a terminal to make it executable, then added it to Mint's main menu (mint-menu) by right-clicking the menu, selecting Edit menu, selecting an appropriate submenu, clicking New item, making the type Application in Terminal, and making the command /run.sh. Clicking this runs the interactive optimizer in a terminal window that closes automatically when I exit CPLEX.

It's also handy to be able to run the interactive optimizer from an arbitrary directory (so that I don't have to type in paths when I load files). Mint provides a convenient Open in Terminal command as part of the context menu for the file browser. (This can be added to Ubuntu by creating a shell script for it.) To make CPLEX available anywhere, in any terminal  window, I created a .bash_profile file in my home directory (since I didn't already have one) and added the following lines:

export ILOG_LICENSE_FILE=<absolute_path>/access.ilm
alias cplex=<absolute_path>/cplex

Technically I think the alias command might belong in .bashrc (which I also didn't have) rather than .bash_profile, but it works there, and why create two files if I only need one? So now I can run CPLEX's interactive optimizer in any directory.