A simple Huffman implementation

Huffman encoding uses some interesting insights about data to achieve compression.  It’s reasonably simple, and exposes some interesting questions about data representation and optimization.

simplehuffman.c – (300 lines of C) is a program I wrote in an afternoon to do Huffman encoding and decoding of files.  It will work on any type of file and can compress and decompress a 15MB text file in under 2 seconds on current hardware.

Continue reading

The Coast to Coast Walk

P6207470 Across England – Walking Wainwright’s Coast to Coast route

Preparations – What we did to prepare for the walk

Day 0 – Getting to Kirkby Stephen – In which we all somehow manage to arrive in Kirkby Stephen in time for dinner.

Day 1 – St. Bees to Ennerdale Bridge – In which we set off on our journey only to immediately get lost. Also: an introduction to two English institutions: the pub and the weather, and a lesson in country living.

Day 2 – Ennerdale Bridge to Longthwaite – In which we continue our way across the Lake District and make a worthwhile detour up into the hills in search of adventure. Also: getting an understanding for the youth hostel system.

Day 3 – Longthwaite to Grasmere – In which we are thoroughly drenched en route to Wordsworth’s home and celebrate the birthday of our guides in style.

Day 4 – Grasmere to Patterdale – In which a complete absence of rain provides the perfect excuse to visit England’s third highest mountain and descend via the aptly named ‘Striding Edge.’ Also: experiencing a proper evening in the pub.

Day 5 – Patterdale to Shap – In which we ascend Kidsty Pike without being able to see it (or much of anything else) before leaving the hills of the Lake District for good. Also: admiring the handiwork of King Henry VIII and learning a valuable lesson about sheep.

Day 6 – Shap to Kirkby Stephen – In which we enjoy the benefits of a cream tea in the morning and a massive downpour in the evening crossing the middle of England.

Day 7 – Kirkby Stephen to Keld – In which a wet day is made considerably soggier thanks to the presence of numerous bogs and we encounter the happiest farm in England. Also: a brief stop at Nine Standard Riggs.

Day 8 – Keld to Reeth – In which we cross the Pennines and pass numerous relics of Britain’s mining past. Also: what to do when the afternoon proves rain-free.

Day 9 – Reeth to Richmond – In which a short leg ends in our first encounter with a real city. Also: trying out England’s new national dish at dinner.

Day 10 – Richmond to Oaktree Hill – In which we miss the rainy weather and sweat our way across the lowlands. Also: learning how to fill Sunday afternoon in a really small town.

Day 11 – Oaktree Hill to Clay Bank Top (Chop Gate) – In which we continue to bake even while leaving the lowlands for the moors. Also: the incredible friendliness of folks in the countryside and the case for leaving the urban grind.

Day 12 – Clay Bank Top to Blakey Ridge (Rosedale Abbey) – In which the weather mercifully cools off allowing us to traverse the Yorkshire Moors in relative comfort. Also: the peculiar story of the grouse, the gentry and the moors.

Day 13 – Blakey Ridge to Grosmont – In which we catch numerous glimpses of the ocean descending off the moors and are treated to some of England’s finest villages. Also: learning a bit about British railroads.

Day 14 – Grosmont to Robin’s Hood Bay (Kirkby Stephen) – In which we conclude our walk with a stretch along the rugged coast and help move England slightly eastward. Also: the best vegetarian dinner in Cumbria and swapping stories with 6 other hikers on the same hike.

Day 14 + 1 – Conclusion – In which we find ourselves in York and discover the difference between being a tourist and being a hiker. Also: the nuisances of luggage.

Day 14+1 – Conclusion

DSC 7423

Thursday June 30 – Concluding

Our journey did not in truth end at Robin’s Hood Bay. First, there was the matter of returning to Kirkby Stephen. This we did thanks to the luggage service’s bus. After a few hours of exploring Robin’s Hood Bay, including a pause at the Victoria Inn pub to celebrate, we caught the bus around 4PM. The bus driver was a talkative fellow, so I learned a fair amount throughout our 2 hour drive to Kirkby Stephen. He was also quite skillful, maneuvering the van up and down narrow roads and streets. Despite it being almost rush hour, we saw little traffic save on one major motorway.

To celebrate the successful completion of the Coast to Coast walk, we decided to have dinner at the Croglin Castle, a restaurant in Kirkby Stephen known for its vegetarian shepherd’s pie. The fact that establishment had its own brewery was merely an additional incentive! After an excellent dinner (everybody had the same dish – shepherd’s pie), we were greeted by some familiar voices – 6 members of the same hiking group in the bay area were also doing the Coast to Coast walk too, but 8 days after us, so they were passing through Kirkby Stephen on the way to Keld. They had gone as part of a tour, and apparently had had much drier weather than us. We exchanged stories until quite late.

Friday June 31 – Epilogue

The next morning was not particularly relaxed. In addition to repacking our luggage (we’d left a suitcase in Kirkby Stephen the first time through), we had to figure out our next step. Michelle and Mark were heading back to London. Chris and Bridget were going off to see a bit more of the Lake District. After some back and forth, the remaining 3 of us agreed to go to York in the hopes of visiting a scenic, but still smallish, city. Making rail arrangements proved complicated too, but at length the taxi deposited us at the station, Chris and Bridget said goodbye, and we caught the same train we’d taken on our first day in England, only this time back toward Leeds.

The train ride was scenic, as it had been on our arrival. Unfortunately, we were now saddled with a full collection of luggage, which hampered movement considerably. At Leeds, I got tickets to York, and when the express train to York arrived, we had to quickly load ourselves and our luggage into it. We nearly left behind several pieces of baggage. Unloading in York was also hurried. Using a payphone, I managed to find a hotel, but getting there again required the assistance of a taxi. A day before the one mile walk would have been a pleasant diversion, but now it required a car to complete. It was a relief to drop the luggage at Astley House, and venture out into the town unencumbered.

York showed itself to be, as advertised, a very pleasant old city of manageable size. Without a set end-point determining our movements, it was difficult to decide what to do, so we did a fair amount of meandering through the old town. After two weeks spent mostly in towns that could be walked across in 5 minutes, we found ourselves beginning to get lost in the maze of small streets and intersections. The most interesting place we did visit was the railroad museum, which included some magnificent old steam engines as well as a great deal of history. This was enough to leave us hungry, and we had dinner at an Italian restaurant.

When we had finished dinner and returned to the hotel, there was the question of what to do for the following day. Again I thought back to our walk, and somehow it did feel that in spite of the difficulties of finding, following and completing the route, life looked more complicated now that we were no longer walkers on the way to the next town, but tourists, looking for something interesting, but not sure exactly what that something was.