Thursday, 2016-12-01

Advent of Code 2016

Project website: Advent of Code 2016.

I use Perl for all the solutions.

Most assume the input data is in a file called input.txt in the same directory as the file. Some require extra modules from CPAN.

A note on scoring

I score my problems to mark where I’ve finished a solution myself or given up and looked for hints. A score of 2 means I solved both the daily problems myself, a score of 1 means I looked up a hint for one of the problems, and a zero score means I didn’t solve any of the problems myself.

The times are hours and minutes from the time of the puzzle release (00:00 EST) until I posted an announcement on Twitter.

My goals for this year (in descending order of priority):

  • solve all problems myself (higher cumulative score than last year’s 43/50).
  • solve all problems within 24 hours of release
  • be among the first 1,000 on each day’s leaderboard

Day 1 — No Time for a Taxicab

My solution for day 1: part 1, part 2.

I managed to get the correct solution in part 1 despite not taking absolute values in consideration, fixed in code.

Part 2 was frustrating as I didn’t have time to re-think the problem, instead I kludged something on top of part 1.

Score: 2, 9h50m.

Day 2 — Bathroom Security

My solution for day 2: part 1, part 2.

Actually reading the Wikipedia article linked from day 1 helped me with part 2.

Alternate part 2, inspired by this solution.

Score: 2, 4h21m.

Day 3 — Squares With Three Sides

My solution for day 3: part 1, part 2.

The hardest part of this problem was cleaning up the input…

Score: 2, 3h59m.

Day 4 — Security Through Obscurity

My solution for day 4: part 1, part 2.

A fun problem!

Score: 2, 3h38m.

Day 5 — How About a Nice Game of Chess?

My solution for day 5: part 1, part 2.

I already had the required modules installed since 2015 day 4 and initially thought this was going to be straight repeat. While part 1 was indeed simple enough, part 2 threw me for a little loop due to the requirements to keep track of previous entries.

Score: 2, 2h32m.

Day 6 — Signals and Noise

My solution for day 6. Alternative with more map.

Decided to try to solve this over breakfast.

Score: 2, 0h40m.

This was the last of the warmup problems. Things will get tougher from now on.

Day 7 — Internet Protocol Version 7

My solution for day 7: part 1, part 2.

Not very proud of part 2, but at least I know what it does. Using regexps would be the obvious choice but I frankly lack the regex-fu to handle it.

Update: some quick googling revealed the existence of lookahead to deal with overlapping matches, so I whipped together an alternative part 2. This runs appreciably faster (although still within a second).

Just made the first 1,000 submitters for part 2.

Score: 2, 4h36m.

Day 8 — Two-Factor Authentication

My solution for day 8, both parts.

Really didn’t want to do this, it reeked of fiddly bit-flipping, but after thinking a bit the solution presented itself.

Again just squeeked in under the 1,000 first submitters for both parts.

Score: 2, 4h27m.

Advent of Code 2015.

Wednesday, 2016-11-30


Early November snow

In November, Summer seems the furthest away

God, I hate this month so much…

Nov 2015 | Nov 2014 | Nov 2013 | Nov 2012 | Nov 2011 |

Monday, 2016-10-31

Friday, 2016-09-30

Monday, 2016-09-05

Sufficient low-light performance

A Reddit user asked whether s/he should purchase a Nikon D800, a camera that was released in 2012.

A commenter mentioned that the D800 had good low-light performance up to ISO 12,800, where it “fell apart”.

This got me thinking. Just what does ISO 12,800 mean?

For example, take this night shot from last year.

small version of NI35_5.6
35mm ƒ/1.4 @ ƒ/5.6

This was shot according to EV 9, which was 1/60 @ ƒ/1.4 at ISO 400. As this was shot at ƒ/5.6, I had to use a shutter speed of 1/8. I was obviously using a tripod.

An ISO increase of 3 stops to ISO 3,200 would have meant a shutterspeed of 1/60, which is handholdable at 35mm with good technique.

However, increasing sensitivity 2 more stops to ISO 12,800 would mean I could shoot at 1/200, enough to stop most action!

Let’s say I’d have used a modern 24-70mm ƒ/2.8 wide open at 24mm. I’d risk 1/30 to get the shot, which means I could keep the ISO at 400, or bumped it up one stop to 800 and get a more steady 1/60. In no way would I have stressed a modern sensor.

Hedda & Anna
1/15 @ ƒ/2 at ISO 1,600 - could definitely have used a stop more here!

Of course, there are situations where ISO 12,800 is very useful. In video, for example, one is often constrained to a narrow band of exposure times. And in astrophotography, the recent popularity of wide-angle astro shots can be attributed to the combination of affordable, highly corrected fast wide angle lenses and cameras with excellent low light capabilities.

However for “normal” use, especially with modern fast primes, ISO 6,400 should be more than enough for handheld, non-stabilized shots!

Wednesday, 2016-08-31

Tuesday, 2016-08-30

Going Dark by Linda Nagata

Last book in The Red trilogy. Sadly the weakest of the three.

Monday, 2016-08-22

28mm blues

I’ve managed to bang up my 1 Nikkor 10mm ƒ/2.8 lens[1], so now it’s severely decentered. I’m going to get a quote for a repair as soon as possible.

Considering I purchased this lens used for €110, and it’s available new for around twice that, the repair has to be quite cheap to justify.

Of course this leads to me planning on alternatives in case I have to ditch this lens. I really want to have a compact 28mm on hand.

The options are, in roughly order of expense:

  1. get the lens repaired - update the repair quote came to more than twice what I paid for this, so I’ve decided to let the repair shop ‘recycle’ this lens…
  2. get a Voigtländer Color-Skopar 28mm ƒ/2.8 in F mount, for my D700 - this combo, while compact for a FX camera, is still really bulky and heavy! And it would be my 3rd 28mm lens for Nikon F.
  3. get a used Ricoh GR or Nikon A - but then I’ll have to give up the EVF, or get an expensive, bulky accessory viewfinder
  4. get a Panasonic 14mm ƒ/2.5 Micro-4/3 lens, and a camera to mount it on - pro: new system to play with! Cons: new system to learn.

The wildcard option is to get a new iPhone. Even if it’s the most expensive option the phone has utility beyond photography, and maybe I need to get over the need of a dedicated camera for this.

[1] This lens has a field of view equivalent of 27mm on the Nikon V1’s 2.7x crop sensor.

Sunday, 2016-08-21

The Trials by Linda Nagata

The second book in The Red trilogy. First one was reviewed here.

Maybe not the very best near-future mil-SF I’ve read but pretty good nonetheless.

Thursday, 2016-08-18

Ancillary Mercy by Ann Leckie

The Ancillary trilogy brought to a satisfactory close.