Tuesday, August 4, 2009

Selling my second-hand paperbacks and Evernote

Book photos in Evernote


I have more than 300 of my books up for sale. The vast majority are paperbacks with hardly any value and I list these on GreenMetropolis (if it sells you get £3 per book but have to take the postage out of that). A handful have some second-hand value and I sell the ones worth more than £5 on Amazon (anything less than that and it's not worth the fees to Amazon).

My average is to sell 4 books/month, so I have a fair stock of books to keep tabs on. At the moment there are three places around the house where they are stashed and it was getting quite irritating when one had sold and I was having trouble locating the book (they only grouping I have was splitting fiction from everything else).

Searching for "Kraken"



I stumbled across a fairly easy way of getting around this problem using Evernote. By taking snapping some digital photographs of the stacks of books with the spines showing and then pasting these to Evernote, the online application craftily does its text recognition thing and gives you a fairly good chance of finding the photograph of the book (and hence location) by typing in part of the title. Blam, instant book database.

It's actually an incredibly handy time-saver for double checking where the book is, before going around the house reading every book spine.

Thursday, June 4, 2009

Making a Google Calendar link

There is a handy form available under Google help to create a website button for a calendar event (http://www.google.com/googlecalendar/event_publisher_guide.html). It is pretty useful but I needed to decode the parameters in order to get some javascript to create a particular link on demand. Here's my notes about the parameters you can play with.

anchor address
  • http://www .google.com/calendar/event?
  • This is the base of the address before the parameters below.
action
  • action=TEMPLATE
  • A default required parameter.
src
  • Example: src=default%40gmail.com
  • Format: src=text
  • This is not covered by Google help but is an optional parameter in order to add an event to a shared calendar rather than a user's default.
text
  • Example: text=Garden%20Waste%20Collection
  • Format: text=text
  • This is a required parameter giving the event title.
dates
  • Example: dates=20090621T063000Z/20090621T080000Z (i.e. an event on 21 June 2009 from 7.30am to 9.0am British Summer Time (=GMT+1)).
  • Format: dates=YYYYMMDDToHHMMSSZ/YYYYMMDDToHHMMSSZ
  • This required parameter gives the start and end dates and times (in Greenwich Mean Time) for the event.
location
  • Example: location=Home
  • Format: location=text
  • The obvious location field.
trp
  • Example: trp=false
  • Format: trp=true/false
  • Show event as busy (true) or available (false)
sprop
  • Example: sprop=http%3A%2F%2Fwww.me.org
  • Example: sprop=name:Home%20Page
  • Format: sprop=website and/or sprop=name:website_name

Tuesday, May 19, 2009

My experience setting up a 1 Terabyte USB drive on a Macmini

I already have an external 500GB USB drive but with Leopard time-machine taking half of this, and keeping a backlog of downloaded films to hand with several backups from other machines, this means that it's been running pretty full (in fact only about 10GB general storage left and time-machine backups only run 2 months into the past before being deleted forever).
1TB drives (1,000GB) have come down nicely in price and I managed to buy a Western Digital Elements drive on Amazon for under £80. Price was a significant factor for me, as well as compatibility for re-use with other machines, so I didn't really consider the alternative of a firewire compatible version (it would have been potentially 5x faster than a USB 2.0 connection).

How the 1TB USB drive ("Zeus") appears on my desktop using a Matrix icon
It was pre-formatted but as I'm going to use this one exclusively on Leopard, I decided to reformat with "Mac OS Extended" into two partitions, one with 300GB for the time-machine (backup) and the rest (631GB) for my ever growing document, video and photo archives plus around 80GB of other computer archives (some dating back to the 1990s but you never know when some old document might be interesting to search out).

Step One: Reformat the drive
Easy part; plugged in the drive into a spare USB port and using Leopard's Disk Utility, chose the option for two partitions, Mac OS Extended (not journaled), typed in required partition size and let it go ahead.

Step Two: Transfer existing files
This was more problematic. I wanted to transfer around 200+GB from my old USB drive so I just used drag & drop using the Finder but it turned out that the estimated time to transfer was around several days! A little more research, eventually using the System Profiler showed that the USB port (on a USB extra hub) the new drive was plugged into was rated as USB1.1 speed (why can't the Finder show you this information?) so I had to use one of the ports on the main Macmini box to get it running at USB2.0 speeds (12x faster). This still gave an estimated 12 hours to transfer the files but at least this could run overnight.

Note that the real times for transfer I achieved were nowhere near the theoretical maximum (put 200GB/USB2.0 into WolframAlpha and you get 55 minutes). This was probably due to the old drive being formatted in (non-native version of) NTFS and though I have an open source driver to enable read/write access, it's pretty likely that this means extra processing power is needed to get the data transferred.

It was a good lesson, USB can be slow, so moving large archives is worth a little planning. Obviously on a day-to-day basis the largest things I'll move would be video files but these are on average less than 1GB and it's not an issue to wait for a minute (assuming USB2.0, on a USB1.1 connection, 1GB takes a minimum of 11 minutes to transfer).

WD Elements 1TB USB 2.0
Step Three: Setup Time Machine
I went into Time Machine settings (via System Preferences) and changed the drive to be used to the new blank partition.

[This is the bit I failed to sort out] I wanted to copy across all my previous Time Machine archive files on the old disk into the new folder created on the new disk. This was another 123GB (3½ million items), but after trying to do this several ways (including making both drives read/write after Time Machine made them read-only) I found it invariably caused Finder to lock up. Eventually I gave up and started Time Machine from scratch (it was still an 82GB initial backup).

Conclusion
After all the transfers, and with 300GB reserved in a partition for Time Machine, I now have 380GB spare for new files. As for the old 500GB drive, it's become a nifty media and backup disk shared on my home network connected to a Vista desktop. As this drive had previously been re-partitioned on my Mac, I took the precaution of reformatting it from scratch using Vista to ensure a stable drive standard.

Final speeds: Transferring a 700MB video file to my new archive (named Zeus) now takes me around 15 seconds. Compare that to 2½ minutes to transfer the same file from the old USB drive, across my home network, to get to my new drive. Let's hope USB3.0 gets a move on!

Sunday, March 1, 2009

Evernote as my receipt wastebasket

Evernote seems to be quite a neat solution to an ongoing problem of what to do with receipts. Most of my receipts end up going in the shredder with various more meaningful ones left stacked on a bill-hook on my desk (like certificates of posting). This is sort of okay but it would be nice to turn this into useful data of what, when and how I bought something. Evernote also ensures that everything gets backed up online and I can then access the information from another location (like being in the office and someone asks "how much did you pay for your TV?").

I use a Fujitsu scanner to keep most of my statements, letters and dreaded tax demands under paperless control and it's a relatively simple thing for me to shove my receipts through it too. One drawback of Evernote (the free version anyway) is that it's a bit crap at handling PDF files. My route for getting receipts onto the Evernote website is to save up a batch of around 30, shove them through the scanner, batch convert pdf to jpg (using Adobe Bridge) and drag & drop them into my Evernote notebook on the desktop application.

Things would be more straight forward if I had a decent webcam on my Macmini, but that's not the case at the moment. The benefit is that I don't have to name the files or organize them in any way as Evernote will recognize text in the image so I can quickly search for "fridge" and the right receipt with its 2 year guarantee from John Lewis will pop up.

As well as archiving away (and shredding most of) my receipts this way, I'm going to do the same for train tickets and film ticket stubs as a useful aid to my poor memory. My trusty Sony Ericsson K750i is capable of taking reasonable photos too, so I might start using it to keep more shots of the type "look for one of these second hand on eBay" sort.

Wednesday, February 25, 2009

Creating an eBay product turntable

Something I have been pondering for a while is a (free) way of creating a rotating product view on eBay. Some professional sellers do it so I knew it was possible. A bit of research today on wiki.panotools.org led me to a way of using a freeware .jar in an applet to do exactly that.

I reused an empty CD spindle box as a turntable (the transparent top makes a nice reflective surface with a depression that a CD can sit in to form a small Lazy Susan). I then took 8 photographs of a mug I could list on eBay and got my first example up within around an hour of messing about. Hopefully now I know how to use Photoshop to create a strip of photos and automate corrections, the next one will be a lot faster. In particular I have a load of matchbox cars to sell and as they are only worth a couple of quid each I needed a fast way of listing them.

Example turntable (16 photographs):







Needs java.

Turntable (use mouse to stop/drag to turn)

Monday, February 16, 2009

Still waiting for my next gadget to be released

The economic downturn has made electronics companies draw back from releasing new technology. Here are the key gadgets that I would gladly layout good dosh for but don't think they'll exist in 2009:

Better camera specification
  • Must - built in GPS to tag photo location in EXIF
  • Must - 5x or more optical zoom with internal lens
  • Must - pocket sized
  • Must - image stabilization
  • Must - good in low light conditions
  • Must - take decent video of unlimited length (> SXGA @ 30 fps)
  • Must - have excellent burst mode (> 7 shots/s)
  • Must - under £250
  • Nice - waterproof
  • Nice - integrated with mobile
  • Nice - can sync with external flash
Better notepad specification
  • Must - web tablet touch screen
  • Must - screen larger than 10cm wide (iPod Touch is less than 9cm)
  • Must - screen resolution > SXGA
  • Must - wifi
  • Must - GPS so I can find my way on foot or by bus
  • Must - less than £200 (otherwise I'll just get a netbook)
  • Must - take standard memory cards (like SD or M2)
  • Must - takes open source software
  • Must - weigh less than 500g with charger (my laptop weights 1.2 kg and it's a drag)
  • Nice - expanding keyboard 3/4 size or more
  • Nice - built in cheap (£2/month) wireless broadband deal

Better usb drive specification
  • Must - 32GB of storage space (I have 19GB of photographs to carry around)
  • Must - small (preferably tiny) with intrinsic plug cover
  • Must - under £30
  • Could be - a M2 memory card with adaptor (so it can be used in a mobile phone)

Thursday, February 5, 2009

Second Life hexagonal prism space station


Reusing the modules from my tetrahedron experiment, I fairly easily put together a script to create a hexagonal prism of any size. Again debugging the intelligent floor tiles to automatically detect if they are the floor was a real pain due to the lack of an easy way to compare rotations (rather than vectors).

The one generated in the snapshot is of size 3. The square walls are 30mx30m and the longest floor width is 60m. Total prim count = (walls) 6x3x3 + (roof and floor) 2x6x9 = 162.

Update: I had been using my Sony laptop to work with Second Life. With hubby away I borrowed his PC (I'm normally on a Macmini) and was surprised to find the way SL rendered quite different. In particular the equilateral panels I had been using were set with "glow" at 1.0 (maximum) which made little difference on the laptop but on the desktop were mind bogglingly glowing with green radioactive light. Obviously the laptop graphics doesn't render the glow at all. I ended up muting the glow down to zero as they look pretty bright with the "full light" option on (which makes them ignore local lighting conditions).

Wednesday, February 4, 2009

Second Life Tetrahedron maker


Finally debugged the LSL script to generate tetrahedrons of any size using equilateral triangular panels of edge size 10m. In the picture you can see my avatar inside a tetrahedron of size 2 next to one of size 3 and I'm inside a massive tetrahedron of size 7 in the shot below.

The last formula to work out (which I'd fudged a number for before) was the distance between the avatar (or generating object) and the centre of the tetrahedron side. This is actually N*10m/sqrt(24) where N is the size of tetrahedron.

It took a little while to get the side on the bottom to detect itself and texture itself with grass rather than being glass when rezzed. My problem was that llVecDist() which I was using to compare the rotation of a panel to the vector rotation I was looking for (<pi,0,0> or <3*pi/2,0,pi>) was ignoring the fact these are angles and so I had to get the sign right (so the last vector had -pi in the z-axis rather than pi).

All those glass panels make for a classy looking instant space station at 4,000m.

Now I have the subroutines to create equilateral platforms of any size I might try a future experiment using them to make something like a truncated cubic honeycomb.

Now to do some proper work!

Second Life creation problems with equilateral triangles

In Second Life you can create any 3D object using the basic building blocks (called Prims from primatives) like cubes and spheres. These are a maximum size of 10x10x10m (unless you are a God I guess).

I wanted to create the maximum size possible equilateral triangle (in order to help make a giant tetrahedron), unfortunately the "prism" prim was less that 10m on a side maximum. Instead I flattened a 10m cube and tapered it to be a triangle. To turn it into an equilateral I changed the height from 10m to 8.66m, as using Pythagoras' theorem the height must be:
√(102-52)m=√(25x(3-1))m=5m√(2)
≈8.660m


Now here's the unexpected problem. When you rotate the large equilateral, it turns out that the centre of gravity is still based on the cube and so has been set to be at half the height. Consequently to rotate correctly about a centre I had to add a correction vector (unfortunately it's not possible to reassign the centre of gravity of a prim).



The centre of an equilateral triangle can be found by bisecting the angles, the resulting 3 central lines intersect at the centre. Looking at the intersection of one of these bisecting lines and the height line gives a right-angled triangle with 30° at the corner and with a base of 5m. Consequently the distance from the base to the centre of gravity must be:
COG=5m*tan(30°)
=5m/(√3)
≈2.887m


So my correction factor to move to the centre (in the Y-plane) is:
CF=[(5m√2)/2]-[5m/(√3)]
=5m(1/√2-1/√3)

≈0.649m


I kind of wish I'd stuck to the prism prim as this correction factor has really sullied the beauty of my LSL scripts ;)

Sunday, February 1, 2009

Second Life mathematics

About a year or so ago I played around with Second Life but found it was limited as an environment due to lack of integration with IM or Skype (I was looking to use it as an intuitive conferencing tool). It still lacks these features but I've had a little fun recently playing around with the scripting language to play with polygons using Second Life as my geometry lab.

The maximum object size (normally) you can create is a 10x10x10m cube. You can reshape this up in different ways (like a cylinder) but with the premise of making a simple house/room I created a couple of scripts to make giant cubes and domes using a 10x10x0.025m panel as a building block.

My recent experiment was to create a script to use these flat panels to make an N-sided polygon shaped wall in a ring around my avatar. The only tricky bit of math is the distance between the centre point (my avatar) and the 10m wide panel.

This formula does the trick:
distance = panelwidth (2×tan[π/N])
You can work this out by thinking about the right-angled triangle between the avatar, middle of the panel and the edge where the next panel joins:
  1. The base of the triangle shown must be ½ the panel width
  2. the angle "a" cuts up the circle into 2xN triangles (a full circle is 2π in radians) and so "a" = 2π/2N = π/N.
  3. Basic trigonometry gives us the tangent of "a" equal to the opposite side (which we know) over the adjacent side (which is the distance we want).
Programming bit: Note that SL limits the distance you can create (rez) an object to 10m, so my script creates the panel in a small size near the avatar (llRezObject) with the right final rotation, orders the panel (the panel has its own script listening for this command) to the target position (llSetPos) and then the panel resizes itself (llSetScale) when it realizes it has reached the target position (llGetPos). Phew.

Thursday, January 29, 2009

The importance of FoxMarks

Ask yourself this question, if I lost all my browser bookmarks would I know what I've lost? It's quite amazing how much time most surfers invest in organizing and collecting their favourite places on the internet.

I have recently installed Foxmarks which backup your favourites and allows you to access your bookmarks on the internet. I particularly like the password saving part as this means that I can create new accounts and passwords on websites and log in without any problem on another machine. The profiles feature is pretty neat too as this means I can restrict my "@work" version to professional interest rather than overly personal stuff.

I did however take the precaution of using a pretty secure password for the account. The thought of someone hacking all my passwords at the same time gives me the shivers.

Saturday, January 3, 2009

Flickr email checkbox ticker bookmarklet

One slightly annoying feature of Flickr is that there is no way of filtering your email. In particular I get a lot of group invites and emails telling me someone added me as a contact. Frequently there is no need for me to open these emails and to delete them means individual checkboxes have to be ticked. Here's a bookmarklet that you can drop into your bookmarks that does exactly that.

Within the javascript there is a "filter" variable that you can set to any text you want (at the moment it matches emails with the words 'Invite to' or 'You are' in the subject). Here's the javascript source:
javascript:(function(){
var anchors=document.getElementsByTagName('A'),
checkboxes=document.getElementsByTagName('INPUT'),
filter=/Invite to|You are/, i, j;
for(i=0;i<anchors.length;i++){
if(anchors[i].innerHTML.search(filter)>=0){
for(j=0;j<checkboxes.length;j++){
if(anchors[i].href.slice(-16)==checkboxes[j].name.slice(-16)){
checkboxes[j].checked=1
}
}
}
}
})()