Monthly Archives: January 2010

My technology tools

Talking the other day with a labmate I suggested him some tools I’m using. I thought it could help someone else to make a list of some of the technological tools I use everyday. Some may help you, some may not be for you, but the main lesson here is this: technology is supposed to help us, not hinder. If you feel trapped by a particular gadget or software, look for alternatives.

  • Operating system (Ubuntu Linux) – I won’t go into the Mac vs PC debate here. I’m using Ubuntu Linux 95% of the time. The other 5% is for games and software that can not be run anywhere else, like ArcGIS. Each release of Ubuntu is easier to use. In particular, version 9.10 includes a “Software Center” that allows you to search easily for programs or descriptions. You can download a “live CD,” which is a CD-ROM image you can burn to a CD-R and then boot directly from the CD; you will be using Ubuntu without making any change to your computer. Worth a try.
  • Data in the cloud (Dropbox) – One of the most impressive and simple working applications to store files in the cloud is Dropbox. It automatically keeps file synchronized and keeps a history of the file changes. I am using their free account (2GB) to store files that I am working on or might need for reference on working projects. Note: I still have some referrals for an extra 250MB for free, just use this link.
  • Note keeping (Tiddlywiki) – A few months ago I began a search for a note-taking application to replace a notebook. The reason was simple: convenience. I tried using MediaWiki, but it was too much overhead for just me and it required a live Internet connection. Now I’m using Tiddlywiki, which works like a local wiki that is completely contained in a single file. The file is loaded locally, so no network connection is needed. It uses a combination of CSS and JavaScript to allow to use tags, links, and search of your notes. I keep the file in the Dropbox folder.
  • Task tracking (MonkeyGTD) – A system based on TiddlyWiki that lets you manage tasks based on the Getting Things Done program. You can find more info here.
  • Office applications (OpenOffice) – Most users do not need all the extras that MS Office has, OpenOffice opens and edits all MS Office formats and the best thing is that is free and open source. Some features may not be present, but for most students it will be enough.
  • Data analysis and statistics (R) – One of the most important open-source scientific tools is R, which is based on S-Plus. It was even featured in a New York Times article. Check the Comprehensive R Archive Network for packages, tutorials, and many publications.
  • Password management (KeePassX) -Too many passwords, not much memory to keep them. KeePassX is a password manager that will allow you to keep many passwords and other information encrypted with a single password. I like it because it also has a password generator with many options.
  • Document encryption (Truecrypt) – To protect my documents in my laptop in case it is stolen, I have all my documents inside an encrypted partition using Truecrypt. It is a free and open-source encryption software that only uses strong methods. It is a must-have to reduce the risk of identity theft.
  • Update: Literature management (Aigaion) – In this digital age, PDFs are a convenience but it is still complicated to keep them organized. I’ve been using Aigaion for a while, it runs on PHP/MySQL and can import literature in several formats as well as hold the PDF files for each paper.

I hope this list helps someone else.

A web-based sound archive management and visualization system

About two years ago we started a project in which we we collecting several hundred recordings each week at different sites. In an instant, browsing this archive became a problem due to the difficulty in browsing files that we need to listen and look at their spectrograms to make sense. Back then I started to work on a web-based system to manage and browse the archive. What was then is now an open-source and free software system available in version 1.0: Pumilio.

The system is written mostly in PHP, with some Python scripts and Javascript. PHP provides the main interaction and communication with the MySQL database. Python is used to analyze the structure of the sound files and generate spectrogram and waveform images. Javascript, in particular the JQuery framework, provide some checks, notices and interactivity. The system has two sound players, one is based on Prototype and Soundmanager2 and was made by Freesound.org. The other is the JW Player.

A bit further into the project, we needed a way to select regions in the spectrograms. I designed a way to do it from a web browser with a bit of Javascript code, using the JCrop plugin, in addition to the PHP code.

Future enhancements include options for ultrasonic and infrasonic recordings, more tools, and improved archive and metadata management tools. If you are interested in testing it there is a demo available or you can download the current version from SourceForge.

Finding the nearest point using only SQL

I’m working on a web-based system to browse and manage sound archives with a spatial component. As part of it I wanted to use a simple way to find the nearest point to a point of interest. Lets say I’m browsing for sounds recorded at a specific location, so I want to find the nearest weather station to find out the temperature, wind speed and rain near the time of the recording. I found out this SQL query on a forum post. Lets say you query the latitude and longitude of a site as SiteLat and SiteLon, respectively, using PHP. Then, to find the nearest point:

  1. SELECT Name ((ACOS((SIN( '$SiteLat' /57.2958) * SIN( locations.Latitude /57.2958)) +
  2. (COS( '$SiteLat' /57.2958) * COS( locations.Latitude /57.2958) *
  3. COS( locations.Longitude /57.2958 - '$SiteLon' /57.2958)))) * 6378.7)
  4. AS Distance FROM locations ORDER BY Distance LIMIT 1

To get a list and their distance, just remove the LIMIT. The distance is given in kilometers.

I’m sure there must be a more elegant or proper solution, but for a quick fix, it works. Of course, it works using a spheroid, so local features are ignored and would require to use some spatial software.