Squobble Blog

Sunday, December 13, 2009

ChromeEye, a TinEye extension for Google Chrome

chromeeyeI made a simple reverse image search extension for Google Chrome. Reverse what? Reverse image search. Think Google, but instead of text you enter an image. Ah okay. Please continue.

The ChromeEye extension uses the image search engine TinEye, whose technology allows you to find exact copies of images (including scalings and slight distortions).

Version 0.1 of ChromeEye (updated: now latest version) basically mimics the TinEye bookmarklet behavior, i.e. it lists all images of the current page with links to TinEye results. Let's hope Google Chrome allows for editing the browser context menu soon, so you can right click and select a "Search Image on TinEye".

Meanwhile, you can download the latest version of ChromeEye directly from this link, while the complete source code is available on GitHub. So until the oficial TinEye plugin gets released, have fun with this easy solution.

Update 14 December 2009: ChromeEye now has a page on the google chrome extensions site. Version 0.2 was also released, with a nicer logo.

Labels: , , , , , , ,

Friday, December 04, 2009

Drawing beautiful block diagrams in LaTeX

I used to put together the illustrations in my publications with a mixture of Inkscape, CorelDraw and psfrag, but obviously this couldn't continue for a long time without becoming an insult to graphic design.

For my latest writings I am returning to the basics: PSTricks. (I know there are lots of other programs to draw block diagrams, but I didn't find any that allowed enough customization). To avoid starting from zero, I am using the PSTricks Signals and Systems package (pst-sigsys), which is easy to customize if you keep the PSTricks user guide (pdf) at hand.

Here's a simple example:

\documentclass{article}
\usepackage{pst-sigsys}

\pagestyle{empty}

\begin{document}

\begin{figure}[ht]
\centering %
\begin{pspicture}[showgrid=false](0.5,-1.2)(9,1.55)
%--- Define blocks ---
\rput(0.5,0){\rnode{s}{$s[n]$}}
\dotnode[dotstyle=square*,dotscale=0.001](1.7,0){dot}
\psblock(3,.75){H1}{$H_1(z)$}
\psblock(3,-.75){H2}{$H_2(z)$}
\psblock(5.8,.75){B2}{$\hat H_2(z)$}
\psblock(5.8,-.75){B1}{$\hat H_1(z)$}
\pscircleop(7.7,0){ominus}
\rput(9,0){\rnode{e}{$e[n]$}}

%--- Connect blocks ---
\psset{style=Arrow}
\ncline[nodesepA=.15]{-}{s}{dot}
\ncangle[angleA=90,angleB=180]{dot}{H1}
\ncangle[angleA=-90,angleB=180]{dot}{H2}
\ncline{H1}{B2} \naput[npos=.5]{$x_1[n]$}
\ncline{H2}{B1} \naput[npos=.5]{$x_2[n]$}
\ncangle[angleB=90]{B2}{ominus} \naput[npos=.5]{$z_1[n]$}
\ncangle[angleB=-90]{B1}{ominus} \naput[npos=.5]{$z_2[n]$}
\ncline[nodesepB=.15]{ominus}{e}
\end{pspicture}
\end{figure}

\end{document}
which, after some retouching of the .sty file produces this pretty diagram:



Update 6th December 2009: Here's a slightly more complicated diagram, based on the same codes as the above example.

Labels: , ,

Friday, May 08, 2009

Kindle DX for Scientific Papers?

Just out of curiosity, I wondered what scientific papers look like on the Kindle DX's 1200 x 824 pixel resolution. The native PDF support is great, but exactly how readable are those tiny little subscripts in mathematical formula?

Although it will probably take some time until I can lay my hands on a real device, I did the test by scaling a page of one of my own papers to the Kindle's resolution. Check for yourself by clicking on the thumbnails below.

modeoriginal version
(vectorial)
scanned version
(IEEE archive)
kindle portrait
portrait
(full page zoom: page fits within 824 x 1200 pixels)


kindle landscape
landscape
(width rescaled to 1200 pixels)

(The original PDFs can be found here and here.)

In portrait mode, some details might be difficult to distinguish, especially when the PDF is generated from a scanned image. Check for instance this formula, from the scanned version in portrait mode:
But in landscape mode everything looks perfectly readable (at least in this probably very unrealistic experiment). This is the same formula, as it appears in landscape mode:
So I might buy one when it's launched in Europe. But the price needs to be slightly lower. $300 (or its equivalent in €) would be fine. And it needs an SD slot. And Wifi. Apart from that it seems to be fine.

Labels: , ,

Friday, April 24, 2009

Pictures on ClusterShot

Time to boost my picture sales!

I am putting some of my pictures for sale on ClusterShot, a new photo marketplace I found this week. Until now I only had my pictures sitting on flickr, and every time somebody wanted to buy one that meant paperwork.

ClusterShot seems to make the process pretty easy, for buyer and seller. And apart from that, their design is very neat. There are still a lot of features missing and issues to work on, but let's give them some time. In the meantime, I invite you to go check out my page and haggle on my pictures: clustershot.com/steven2358

Illustration: some Spanish lolcows

Labels: , , ,

Tuesday, February 17, 2009

The Love Injections web sites

Now that Valentine is over, can we please proceed with the serious matter?

I programmed the websites for the release of the Love Injections book, written by Kim Brusselmans. Here are the English version (Love Injections) and the Spanish version (Inyecciones de Amor). This book might be described as "an original attempt to inspire people to boost their relationships", but to get a better idea of what that means you should check this page: Example pages.

The book is on sale in a few shops in Spain and Belgium, and after the crazily successful book presentations in Barcelona and Ghent, we also opened online shops for both countries.

The sites were done in Drupal, with a fairly simple Ubercart setup to deal with the shopping part. The minimalist graphic design was done by Luxoa and programmed as a subtheme of the Zen theme.

Labels: , ,

Tuesday, March 11, 2008

The silent MP3: To bed with the iPod Shuffle or Zen Stone

Flaws in products call for hacks, so that's why I tried to solve the following annoyingness.

Lots of people listen to their mp3 player in bed and fall asleep with the music still on. "Shuffle" players like the iPod Shuffle and Zen Stone don't have a "do not repeat" option, so they just continue playing songs until the battery dies. That will most probably disturb your good night's rest, and apart from that you will wake up with an empty battery. And we don't want either of these, do we.

I figured that a small hack could solve both problems: put a very long silent MP3 in your playlist. You could peacefully sleep over it and it wouldn't drain your player's power either. So I generated a set of MP3 files that occupy just 3.5 MBytes per hour of true quality silence. They are encoded at 8 bits, mono and 8 KHz (the minimum sound quality playable by most players). The links are at the bottom of this post, packed as .rar archives. This is how it works:
  1. Determine how long you want to sleep, e.g. 7 hours.
  2. Download the corresponding silent mp3 file and put it in your playlist just after the track by which you will likely fall asleep. If you don't have a playlist, simply rename the mp3 so that it is played after the last music track you want.
  3. Go to bed with your favorite music, fall asleep and enjoy the silence.
  4. Get up, switch off your mp3 player, and have a croissant.
Suggestions are open for other uses of these silent MP3s. So onto the next problem now: avoiding being strangled by the headphone chord while sleeping.

Files (compressed with RAR):
Update 16th April 2009: Due to popular demand I'm adding a complementary set of shorter MP3s, for all you sleephackers out there. This should cover your napping needs.

Labels: , , ,

Monday, February 18, 2008

Hosting Uptime/Downtime Calculation

While searching for hosting companies for a number of websites I'm working on, I noticed that a lot companies in Spain try to sell 99.5% guaranteed uptime as being very little downtime. Since this seemed like less than the average to me, I figured I might do a little calculation.

guaranteed uptime max downtime downtime / week downtime / month downtime / year
99% 1% 1.68 hours 7.2 hours 3.65 days
99.5% 0.5% 50.4 minutes 3.6 hours 1.825 days
99.9% 0.1% 10.08 minutes 43.2 minutes 8.76 hours
99.99% 0.01% 1.008 minutes 4.32 minutes 52.56 minutes
99.999% 0.001% 6.048 seconds 25.92 seconds 5.256 minutes
99.9999% 0.0001% 0.6048 seconds 2.592 seconds 31.536 seconds
99.99999% 0.00001% 0.06048 seconds 0.2592 seconds 3.1536 seconds

While most of these scenarios are not really realistic, it is interesting to see what companies are really offering. Reading about the recent Amazon S3 outage makes one want to place things into context. Amazon's goal is to offer 99.9% uptime, which means a maximum of 0.1% downtime and therefore not more than 43.2 minutes of downtime per month. The outage took little more than 2 hours which qualifies it as a 99.5% host this month. That's a long way from the 99.999% they should be offering for cloud computing indeed.

Labels: , , , ,