Archive for the ‘Uncategorized’ Category

How to Make a Lego QR Code

March 12, 2010

Generate a QR Code

First generate a QRCode. Use a generator that lets you control the error correction level and the version (size) of the QR Code. Swetake.com has a generator that gives you these options. Lower error correction levels allow you to have more characters but it makes it harder for the phone to scan the code. You can also fit in more characters if you only use uppercase letters and certain punctuation. This table has details about the width and height of the different qrcode versions and the maximum number of characters you can fit. QR Code version 3 is a good size for a lego QR code because it is 29×29 blocks which will give you 1-2 block border when placed on 32×32 lego base plate. It is important to leave room for a white border because phones have a lot of trouble scanning the QR Code if it doesn’t have a border. If you use QR Code version 3 you will be able to have a maximum of 24 characters if using high error correction or 53 characters if using low error correction (more if only using upper case characters).

Fix the Margins

The qrcode generated by swetake has a 3 block white margin all around. If you have used a 29×29 qr code this will mean the qr code is currently 35×35 blocks but lego base plates are 32×32 blocks. Crop the image so the top and left has a 2 block margin and the bottom and right has a 1 block margin. This will make the image 32×32 blocks. Save the file as a gif so it can be opened by PicToBrick (it doesn’t support pngs).

Generate Mosaic using PicToBrick

PicToBrick is an awesome program that will generate lego mosaics from images.

  1. Load the image using the ‘Load Image’ button

  1. Click ‘Load Configuration’
  2. Select ‘Edit existing Configuration’
  3. Choose PicToBrick_Lego_top_view.cfg
  4. Delete all the colors except white and black
  5. Delete all the plates except 1×1, 2×1 and 1×2 (include others if you can be bothered ordering them)
  6. Save the configuration with a name like ‘black_and_white.cfg’

  1. Click ‘Mosaic Size’
  2. Enter 32×32 Basic elements

  1. Click and drag a rectangle to select the whole image
  2. Click Cut Out
  3. Choose the ‘Methods Tiling’ option: ‘Costs optimisation’
  4. Click Generate Mosaic

  1. Click Output Documents
  2. Check all the Boxes
  3. Click Generate documents

Now you have a tiled image and a list of lego bricks you need to acquire.

11_Black Plate_1×1_(3024) 101 piece(s)

11_Black Plate_2×1_(3023) 104 piece(s)

11_Black Plate_1×2_(3023) 51 piece(s)

01_White Plate_1×1_(3024) 117 piece(s)

01_White Plate_2×1_(3023) 192 piece(s)

01_White Plate_1×2_(3023) 56 piece(s)

Purchase Bricks from BrickLink

If you don’t already have the bricks and the 32×32 baseplate go to bricklink and buy them

Put it all together

Most Awesome Cake Ever

March 11, 2010

Recruiters for the Win

February 19, 2010

HiFIRST_NAME,

I hope you are well, i was keen to get in touch with you in regards to some exciting new positions that are now available, working for a Tier 1 Investment Bank in London.

I am working very closely with a number of managers to source highly skilled and motivated individuals to join this award winning team.

Would you kindly update me on your current situation and if you would be interested in discussing these opportunities further, please attach an updated version of you cv.

I look forward to hearing from you.

Warm Regards,
Joel Jacobson

and the awesome reply that i was lucky enough to be CCd on

Hi Joel LAST_NAME,

I’m very INSERT_EMOTIONS about this new exciting positions that you have available at COMPANY_NAME1 and COMPANY_NAME2 banks. I’d really INSERT_EMOTION to be considered for those positions cause I think my skills match with the criteria those JOB_TYPE requires. My main skills are; SKILL_1, SKILL_2, SKILL_3, SKILL_4 and SKILL_5 and have been on PROJECT_TYPE_1 and PROJECT_TYPE_2 projects mainly but am also suitable for managing TEAM_SIZE_2
on PROJECT_TYPE_3 projects.
I’d love to update my CV and send it to you but my auto-text-generator is a bit broken these days. Will check with you in NUMBER_OF_DAYS days to update you on that matter.
STANDARD_GREETING,
Mr. FIRST_NAME
p.s. I replied to all just so they would not bother applying for those jobs cause I’m definitely going to get hired.

esprit d’escalier

February 16, 2010

Recidivism and Expectations

February 15, 2010

Someone linked me to the pretty fcked up website on twitter and this got me thinking about how it is expectations of punishment that deter people from comitting crime and not the actual punishment itself. Wouldn’t it be cool if we could have high expectations of punishment but low actual punishment :) . Then I got the idea that maybe high recidivism rates are product of expectations of punishment being higher in the general population than actual punishment. I might write on this later…

Lego QR Code

February 10, 2010

I’ve been looking at QR codes which are way of drawing 2D barcodes and decided to make one with lego. I ran out of white bricks so the border is grey. I can scan it with my iPhone using QRApp or Quickmark (quickmark is soooo fast).

EDIT: yay! more white pieces. doesn’t seem to scan well when there is glare :( QR codes printed on soft drink labels seem to have the same problem.

iphone screenshot:

False Economies in Energy Saving

January 31, 2010

I’ve noticed a trend in my flat where every time I leave my laptop charger on and I leave the room the charger is mysteriously unplugged from the socket. This made me curious as to how much this little act is actually saving us. From searching around my best estimate for the ’standby’ power use for  my charger is 1/2 a watt. I also estimate we are being charged around £0.07/kWh for electricity. So if the laptop charger was being wasted 24 hours a day, 365 days a year this would end up costing: 0.5 * 24 * 0.07 * 365 / 1000 = £0.30.

Not much, but I guess it all adds up. However, how much work is being done for this £0.30. Assuming it takes 5 seconds to unplug the charger this adds up to 1/2 an hours work over the whole year. I doubt many people would work for £0.60/hour. This also ignores the time I spend plugging the charger back in :)

Sorry for the rant post but my housemates are on an irrational drive to reduce electricity and gas usage. The gas usage is the bit that is pissing me most off :(

Neutered Root

January 19, 2010

Had a problem today where a root process was unable to read files owned by other users.  I looked through the strace and there were no calls to setXXuid which might be giving the process other permissions.

[pid 12930] geteuid()                   = 0
[pid 12930] open(“/opt/tomcat/conf/logging.properties”, O_RDONLY) = -1 EACCES (Permission denied)

Then I noticed this call:

[pid 12930] capset(0×19980330, 0, {CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE, CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE, CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE}) = 0

It appears this removes useful permissions like CAP_DAC_OVERRIDE that allows the process to read files not owned by it :(

(blah blah blah.. tomcat shouldn’t be running as root)

Martha Stewart’s Blog Show

January 15, 2010

Martha has made a show dedicated to her internet stalkers. The two guys I saw on the show were almost identical. Both were middle aged, thin, balding and had lispy voices. Very weird.