Low-overhead Multi-file Tail plugin for Rainmeter

Low-overhead Multi-file Tail plugin for Rainmeter

Low-overhead Multi-file Tail plugin for Rainmeter

I’ve always thought the computer interfaces in movies were cool.  Unrealistic, impractical, but cool.  I especially liked the interfaces where there were multiple windows of scrolling text – and I thought  this could actually be useful in real life.

At work I use several services (mostly JADE databases) that log their status to files, and it would be useful to be able to see the current contents of the log files.  I thought an interface like one from the movies could be useful for this – one where there are several windows on the desktop that contain automatically updating displays of the most recently added lines (known as the “tail”) of the log files.

I tried writing a program to do this.  The first hurdle was putting a transparent window on the desktop, and I fell at the first hurdle.  Putting a window on the desktop used to be pretty easy, but Microsoft changed things in Vista, and it became almost impossible to do.  Apparently they thought that enthusiasts’ desktop customization needs would be met by their Sidebar gadgets feature, so nobody would need to put windows on the desktop anymore.

Separately from that effort, Rainmeter v2 was released.  Rainmeter is a piece of desktop customization software that’s been around for a long time, but the important thing in this context is that it can put a window on the desktop.  There is a Tail plugin for Rainmeter, but it doesn’t do exactly what I want – it only works with a specific filename and loads the whole file on every update, so it’s not very efficient for big log files, frequent updates or over a network.  I wanted to write my own tail plugin for Rainmeter, but I don’t have a lot of experience with writing C++.  Fortunately in v2, Rainmeter added the ability to write C# plugins.  I don’t have much experience in C# either, but it’s closer to languages I’m used to and means I can leverage .Net framework classes.

Loading a file is easy, but the goals for my plugin were “low-overhead” and “multi-file”.  What I mean by “low-overhead” is reading as little of the log file as necessary as infrequently as possible.  I ran into a few dead ends because the documentation for C# Rainmeter plugins are basically non-existent, but eventually I achieved this goal by storing the last updated timestamp of the log file and caching the last text I read from it.  This way Rainmeter can update the plugin as often as it wants, but the log file will only be read if it was modified since the last refresh.  The plugin also only reads the last few KB of the log file, so that no matter how big the log file is we aren’t causing a lot of disk I/O or network traffic.

Many applications automatically roll-over their log files in order to avoid having one huge file that just gets bigger and bigger and can’t be deleted because it’s always in use.  Sometimes they just sequentially number the files, for example when log1.log reaches the maximum allowed size, log2.log is started.  Other times log files are date stamped, so there’s only ever one log file per day.  In any case, the purpose of the “multi-file” goal was to automatically read from the latest log file.  This is achieved by specifying a file mask (like c:\log*.log) instead of a specific filename (like c:\log1.log).

So finally I achieved what I wanted – a Low-overhead Multi-file Tail plugin for Rainmeter.  Use it in good health.

Enhanced by Zemanta

Shelfari

Shelfari logo

Image via Wikipedia

I first became aware of Shelfari when they announced their integration with Amazon, so I decided to give it a try and ended up spending quite a lot of time with it.

Backing up a step – what is Shelfari?  Basically it’s a social network based around the books you read, like Goodreads or LibraryThing.  In 2008 Shelfari was bought by Amazon, but nothing much seemed to happen until recently when they announced the integration.  Basically now you can log into Shelfari using your Amazon login and fill your “shelf” (the list of books you’ve read) with your purchases at Amazon.  This is nice, but Goodreads has imports too.  There’s also a wishlist import hidden away1 (quite a lot of functionality is hidden), but it seems to be broken at the moment.

Visually Shelfari is a bit nicer than Goodreads, but it seems a bit weaker when it comes to discovery.  All books on Shelfari seem to be rated highly, even terrible ones.  Also I kind of expected it to do clever recommendation based on what books I own, what rating I gave those books and what people similar to me rated highly, but it doesn’t.  Amazon has some clever recommendation stuff but it doesn’t seem to have been integrated with Shelfari (yet?).

Shelfari has an unusually manual method of helping you decide whether or not to read a book – it lets you send a message to those of your friends who have read the book or to the whole community.  I’ve grown used to the algorithmic recommendations favored by Amazon and Google for its scalability – the “ask a human” approach seems foreign to me now.

One way that Shelfari is better than Goodreads is the shelf – it shows a graphical bookshelf with your book covers on it instead of just a list of book titles.  Where it really excels is that you can choose which edition of the book you have, so the cover matches.  I’ve always found it very annoying to look at a book I own in Goodreads or Google Books and not recognize it because they’re showing a different cover. This especially affects Terry Pratchett’s books, since the UK covers are so beautiful and the US covers are so horrible.

You can also create a widget to put on your website to display your shelf, like so:

Shelfari: Book reviews on your book blog

Another benefit of Amazon owning Shelfari is that the Public Notes people make on the Kindle are visible on Shelfari, and the information people put into Shelfari is visible on the Kindle.  Shelfari acts a bit like a wiki for books, which is presumably needed because publishers don’t give out as much detailed information about their books as people want.  So if you want a synopsis, summary, list of characters, quotes, settings & locations, organizations, first sentence, table of contents, glossary, themes & symbolism, series & lists, authors & contributors, editions, awards, classification, reading level, supplemental material, movie connections etc. or you want to edit any of this information for a book, Shelfari is the place to be.  I suppose all that information could be useful when you’re trying to decide whether you want to read a book or not, but mostly I think it’s useful if you’re writing a book report.

Shelfari also has a page of reading stats – how many books you’ve read per year, what kinds of books etc.  Strictly speaking not vital information, but since the data is there why not graph it.

Finally, Shelfari has discussion groups based on genre, specific authors, cities and a lot more things.  I don’t really have a lot of time to spend in the groups, but I can see that it could be fun if you wanted to discuss a book you just read or were considering reading or the state of Steampunk or whatever.

Enhanced by Zemanta
  1. From your Shelfari home page (click the green Home tab), there is a Your Shelf drop down menu with a link to “import books”.  On the Import Books page is the option to enter your Amazon email address to import books on your wishlist. []

My first Chrome extension – Google Web History Updater

Google Web History Updater extension icon

Google Web History Updater extension icon

I’ve created my first extension for Google Chrome – Google Web History Updater!

One of my favorite features of the Google Toolbar is that it records your browsing history in Google Web History.  If you don’t like that feature or are paranoid about Google keeping information about you then you might as well stop reading now.

The benefits of Google Web History are that Google uses your history to personalize your search results, and that you can track down a site you visited while on another computer.

Unfortunately Google Toolbar isn’t available in Chrome.  The reasons for this are fairly clear (Chrome doesn’t do toolbars at all because of its minimalist aesthetic) but I still missed my Google Web History.

Several people entered bug reports for adding Toolbar’s features to the browser, but I got tired of waiting and decided to try and make an extension that would update Web History.  I quickly hit a dead end and contacted the Chrome developers to ask them for help.  They said there was no published API for updating Web History and suggested I reverse engineer the way Toolbar does it.  I couldn’t work out how to do it, and the developers said that the Toolbar team were thinking about making an official extension to do it, so I waited some more.

Then I read an article that reminded me that some browsers (Opera) have had this problem for a long time, and there was a solution available for them – the UseGoogleWebHistory userscript.  This is a small javascript file that runs whenever a page loads, and sends the URL to Web History.  I could have converted the userscript to an extension pretty easily or even had the conversion done for me automatically using a new feature of Chrome but although the userscript worked, it didn’t work for every URL.  I couldn’t work out what was wrong with it, so I went looking for another solution.

It turns out that sending a URL to Web History is actually done as a side effect of asking Google for the PageRank of the URL.  This means that PageRank extensions like this one actually do exactly what I want, except that they also take up space on the screen.

I ended up just modifying that extension (mostly just removing the UI) so I can’t take much credit, but the majority of the code is lifted from the Toolbar anyway.

In the end I got what I wanted – Chrome updating Web History.

Reblog this post [with Zemanta]

Win a Kindle!

Amazon 10th Anniversary Wishlist Sweepstakes

Amazon 10th Anniversary Wishlist Sweepstakes

To celebrate their 10th Anniversary, Amazon is holding Wishlist Sweepstakes.

Every week from the start of October until the middle of December they’re giving away prizes.  To enter the sweepstakes all you have to do is add something to your wishlist and then click on the link to enter the sweepstakes for that week.

Here are the prizes for each week:

Certainly some of the prizes aren’t interesting to me – Disney?  No.  Jonas Brothers?  Hell no.

But HDTV?  Yes.  Kindle, oh yes.

I’ve written before about how much I like the Amazon Wishlist, and as it happens I tend to add something to my wishlist at least once a week, so entering the sweepstakes is easy for me.  Even if it wasn’t for the sweepstakes I’d recommend to anyone to use the Amazon Universal Wishlist – it’s very useful.

Reblog this post [with Zemanta]

Sensecam for sale! (almost)

Vicon Revue

Vicon Revue

In the past I’ve posted1 about my search for a wearable camera and how Microsoft’s Sensecam project looked promising but wasn’t commercially available.

Finally it appears there is good news – a British company named Vicon has licensed the technology to release a version of the SenseCam, and it will be available in the next few months.  The bad news is that it’ll cost £500 (about $820).

I’m starting to get the impression that I’m not the target audience for the SenseCam – it needs to be about 10x cheaper before I could consider buying one.  I think the price could come down if they made it a bit less smart – it currently has accelerometers, light sensors and heat detection that it uses in an attempt to only record interesting images so that it doesn’t fill up its storage too fast.  Storage is cheap – if they got rid of all the cleverness I think it would be a lot more affordable.

Then again I guess life-blogging isn’t exactly a huge market – the subset of all people who are geeks, the subset of geeks that are less paranoid, the subset of them that are interested in auto-instrumenting etc.

Reblog this post [with Zemanta]
  1. I would wear one of these every day, Finally some movement on the SenseCam front and Wearable cameras []

Heat Wave by Richard Castle – fantastic meta-fiction

Heat Wave book cover

Heat Wave book cover

I just finished reading Heat Wave by Richard Castle – a tie-in novel for the TV show Castle (I wrote about the show previously).

There are some TV tie-in novels that I’ve enjoyed – for Burn Notice1, Psych2 and Monk3, however they all had a certain pulpiness in common.  Not just because they immediately came out in paperback (which I’ve always taken as a sign of the publisher putting in less effort because they don’t expect to make a lot of money from the book), but because they were a bit hobbled by their connection to the TV series.  The writers can’t kill off or otherwise make any major changes to the characters, their back story or setting – something writers of original novels can do at will.

Heat Wave is different – it’s meta-fiction.  In the TV series Richard Castle is a writer, and has written a book called Heat Wave - this book is written as if it is that book, by him.  For a brief while we get to live inside the world of the TV series because we can read the book that they’re reading.  The illusion is maintained flawlessly – from the dedication and afterword to the picture on the back cover.

An advantage Heat Wave has over most (if not all) other tie-in novels is that because it’s supposed to have been written by the TV character instead of about the TV character, the actual author can change things without causing any problems.  Any differences to the TV series are put down to the meta-author changing the names to protect the innocent or improving on (what is to him) real life by making it juicier.

A difference between the TV series and the book is that Castle is the main character of the series, but Nikki Heat is the main character of the book.  The main difference this makes is that although a good portion of the series is dedicated to Castle’s personal life, that’s almost completely missing from the book.  Once again,  mother gets a cameo in the book, and if you’ve seen the TV series

A difference between the TV series and the book is that Castle is the main character of the series, but Nikki Heat is the main character of the book.  The main difference this makes is that although a good portion of the series is dedicated to Castle’s personal life, that aspect is almost completely missing from the book.  Once again the meta nature of the book smooths this over – Castle’s mother gets a cameo in the book, and if you’ve seen the TV series you can easily imagine her haranguing her son to be written in.  His daughter is completely missing, but as a protective father you can imagine Richard Castle wanting to spare her any embarrassment by leaving her out.

The book is further tied back into the TV series by the actual cover being used in an episode and the actual page number of a sex scene in the book (p105) mentioned in the episode.

Additional meta is provided by Nathan Fillion showing up to book stores and signing the books as Richard Castle.

Reblog this post [with Zemanta]
  1. The Fix and The End Game []
  2. A Mind is a Terrible Thing to Read and Mind Over Magic []
  3. Mr. Monk Goes to the Firehouse, Mr. Monk Goes to Hawaii and Mr. Monk and The Blue Flu []

Tree: 1 Satellite: 0

2-D logo.
Image via Wikipedia

Our DirecTV satellite reception has been getting worse for a while, and now it’s at the point where our DVR can’t record any programs without wild glitches.

We were finally able to convince DirecTV that the poor reception wasn’t caused by the summer storms we’ve been having, and they sent out a technician.  Unfortunately, the problem seems to be that there’s a tree between the satellite and our dish, and over the years the tree has grown to a point where the line of sight is too obscured.  Apparently there’s nothing they can do – wherever they would reposition the dish there’s a tree.  We also can’t do anything drastic like cut the tree down, because we live in an apartment complex and it’s not our tree.

So we cancelled our DirecTV account and signed up with DirecPath.  Apparently DirecPath just resells DirecTV to apartment complexes like ours – there’s a big dish somewhere in the complex and all of the apartments are serviced from it via the built-in cabling.  Needless to say, there are no trees in front of this dish.

We also took the opportunity to upgrade to HD – we bought an HD TV immediately after signing up for SD DirecTV and it’s been annoying me for three years.

This is all fine except that DirecPath aren’t installing the receiver until next week, the mid-season finale of Burn Notice is tonight and the season premiers of Psych and Monk are tomorrow – my three favorite programs. :-(

Reblog this post [with Zemanta]

My first Wikipedia article

Caption text
Image via Wikipedia

I have created my first Wikipedia article – Zemanta.

I’ve been using Zemanta since March 2008, and I was surprised that it didn’t have a Wikipedia article.

I’ve been planning on creating an article for Zemanta for a long time, but Wikipedia is pretty intimidating.  There are a lot of rules about what you can write about and how you write it – if you do it wrong up they might unilaterally delete your article.  Added to that is the fact that wikis use a unique kind of meta-data that I needed to learn, and I just ended up putting it off week after week.

In the end what worked was telling my wife to nag me to get it done.  I guess that goes to show a negative can be turned into a positive :)  Considering how easy it turned out to be, I feel foolish having put it off at all.

As you can see, the article is pretty bare at the moment because I was concentrating on just providing referenced facts without bias – it can always be fleshed out (by me or anyone with relevant knowledge) later.

Wikipedia have obviously put a lot of work into providing FAQ’s, tutorials and help sections for beginners like me, but I’d say they still have a long way to go.  I spent the vast majority of the time just trying to find answers to simple questions.

While writing the article I found several things that should have Wikipedia articles but don’t, for example Common Tag, LinkWithin and Outbrain.  If my first article is well received (or at least not immediately deleted) I might write some more.

EDIT: Apparently I’m not the only one who thinks that Wikipedia is less welcoming to new contributors – After the boom, is Wikipedia heading for bust?

Reblog this post [with Zemanta]

Battlefield 1943

Battlefield 1943
Image by s3rioussam via Flickr

Battlefield 1943 was released on Xbox Live Arcade yesterday (it comes out on the PlayStation Network today) and it puts a lot of other XBLA games to shame.

I’m getting a lot of hits from searches like “failed to connect to ea online”, so here’s something to help those people:

EA underestimated the demand for Battlefield 1943, so there aren’t enough servers.  They’re adding more, so just be patient and either keep trying to connect or wait a day or two.  In the meantime you can follow their twitter feed or go to their forums for news.

Read the rest of this entry »

Geek Chart

GeekChart logo

GeekChart logo

I recently read a Lifehacker article about Geek Chart and decided to check it out.  Basically Geek Chart gives you a widget that shows the social media sites where you share things.

Here’s my Geek Chart:

Ghosttie’s Geek Chart

Currently they support Twitter, YouTube, Flickr, blogs, DiggStumbleUponDelicious and Last.fm, with support for Facebook coming soon.

You can also see Geek Charts for famous people like Al Gore and Barack Obama.

Geek Chart seem to be having some problems at the moment – none of my tweets are showing up and there’s a message on the site saying:

GeekChart.com is currently experiencing a high load. Things may be slower than normal. Please be patient.
We’re also hitting the Twitter API limit so Twitter feeds may not update until next hour. :(

Reblog this post [with Zemanta]