skip to main | skip to sidebar

Monday, December 7, 2009

MATLAB findpeaks function

The findpeaks function in the MATLAB (verion 7.6.0.324) Signal Processing Toolbox finds local maxima or peaks in a vector.

>> v = [0 3 0 0 3 2];

>> [pks, locs] = findpeaks(v)
pks =
3 3

locs =
2 5
locs contains the locations or indices of the peaks in v (MATLAB indexing starts at 1).

For each column of a 256 x 5188 matrix we were calculating a simple moving average (smooth function) and then finding the peaks and it was taking a long time, approximately 19.6 seconds. We whipped up our own findpeaks function based on the following two lines:

>> s=v(2:end)-v(1:end-1);
>> loc=find((s(1:end-1)>0) & (s(2:end)<0)) + 1
loc =
2 5
This calculates the pairwise differences between elements, i.e. the slopes and then looks for an up slope immediately followed by a down slope. Pretty simple and now the 5188 matrix columns are processed in approximately 1.3 seconds.

Sunday, November 15, 2009

Upgraded to Velocity Gold, not

I received an email from Velocity rewards notifying me of a free upgrade to Gold membership. It was quickly followed up by another email containing the following.



Was it a human data input error or programming error?

Friday, November 13, 2009

Just say No!

Most software projects produce a mess and are a mess to manage. Projects that make it to production generally go on to a have a lifetime measured in years. While they are alive new projects are started, accumulating more mess. If the internal IT budget/group increases there is capacity to create an even bigger mess.

An obvious way to reduce the total mess, is for each project to be less messy. Unfortunately, there is little hope to do this at present due to the inherent nature of (current) organisations and the immaturity of software development in general. Another way is to do less software projects and make those smaller.

The business orientated technical managers I know seem to understand this at some level and are dealing with it by purchasing more off-the-shelf or outsourcing. This makes some of the costs of the mess more visible and attributable to (hopeful) benefits. However, it doesn't really address how poor we are at actually figuring out requirements, transforming them into usable, executable software and adapting to new requirements over time. With outsourcing, the mess is now less visible, but as a business relies on the systems and data, it will still experience similar effects from the mess over time.

From a purely technical perspective, does the world really need another bloated Java, Spring, Hibernate, Oracle, JUnit (削除) abomination (削除ここまで) application? Feel free to substitute other languages and libraries, such as Ruby and Rails, Groovy, etc.

Reduce the software mess. Do less software projects. Just say no!

Saturday, October 17, 2009

Mac Flickr client

I am looking for a native mac application that provides an easy interface to my Flickr account. Requirements:

  • Uploading - need to easily filter out the good photos from the camera, upload and add metadata.

  • Browse photos in photostream, or by sets, tags, etc

  • Edit metadata

  • Save photos locally

From what I have briefly read, iPhoto 09 integration with Flickr is very limited. I use Flickr as the primary repository for my photos and iPhoto isn't intended to be a passive Flickr client. I found the following other candidates:
  • Photonic Really nice app. Demo is free but expires after 14 days. Registration is US25ドル. Can browse photostream and sets, no coverflow view. Can search by tags, but you need to know the tag names. Double-click a photo to view a larger version. Doesn't show descriptions and no metadata editing or slideshow. However, there is a convenient link to a photo's Flickr page to do these. Apart from assistance with tags, the other major missing feature is the ability to download a photo or set for use as a desktop background or with the screen saver.

  • FlickrEdit Java app that looks horrible with a clunky UI. However you can backup and download photos and sets. Apparently it saves some metadata in the IPTC header of downloaded files, but I can't see it with the mdls command.

  • DeskLickr Set the Desktop background to a Flickr photo. You can point it to your own account, but it only uses your public photos.

  • Cooliris Firefox add-on A 3D wall for viewing images. Works with Flickr, so if you open it on the first page of your photostream or on a Set page, you can view all those photos. My head is spinning from the animation, so it would be nice to turn that right down. More keyboard keyboard control (photo selection and paging) would make this really good.

  • Picture Sync Essentially just an uploader. Didn't seem very intuitive to me.

  • FotoViewr Webapp that provides 3D viewing of Flickr photos (like coverflow). Only works with public photos.

  • Fotobounce Windows only now, with a mac version due this year.

  • 1001 Didn't try this out.

  • Flickr Finder A very simple Finder-like column view. Content layout seems to be broken on Snow Leopard.

  • Photo Grabbr Didn't try it. Suspect it is public photos only.

None of the apps did uploading really well. I am using the standard mac Image Capture application to get photos off the camera. Finder Quick Look in Snow Leopard provides an easy way to look through photos and delete unwanted ones. The Flickr web site uploader and metadata editing work well enough.

Photonic is the easy winner for viewing photos. If it had better tag support and desktop/screensaver integration or the ability to download original images, then the license fee would be more easily justified.

I have made a Flickr set of my favourite photos for use in my screen saver. FlickrEdit is clunky, but I can use it to quickly download the whole set. This is all I use it for. It also includes an incremental backup feature (I need a backup solution too), but I haven't investigated that yet.

Saturday, September 26, 2009

QOTD

Teaching for understanding didn't offset the destructive effects of telling them how to get the answer. Any step-by-step instruction in how to solve such problems put learners at a disadvantage; the absence of such instruction was required for them to understand.

-- Alfie Kohn
From: Education's Rotten Apples

Friday, September 25, 2009

Apple store error



Just wanted to find out the status of my Snow Leopard order. Nice fonts though.

Thursday, September 24, 2009

R Resources

Been learning to use R for a stats subject. These links were useful.


Other things I have stumbled across along the way.

Update 1/11/2009
For completeness I should also have included An Introduction to R that comes bundled with R, as well as the official R Wiki. Also discovered RSeek.org as well as this MATLAB / R Reference.

Subscribe to: Comments (Atom)
 

AltStyle によって変換されたページ (->オリジナル) /