kumbunterland posed this question in the park yesterday:
There are four men in a coal mine. This exit is narrow so that no more than 2 men can exit at the same time. In addition, there is only one torch and they can't leave the mine without it.
Each man walks at a different speed. The first man takes one minute to exit the mine the bridge distance, the second takes two minutes, the third takes five, and the fourth takes eight minutes.
If two men walk together they must walk at the slower speed. For example, if person #1 and person #3 go together, they will leave the mine in 5 minutes. Then, person #1 could return back to return the torch to the others (taking another one minute) so they can use it to exit again.
The coal mine will collapse in exactly 15 minutes; you must find a way to allow all the men to leave the mine within this time.
Unfortunately, swi-prolog is broken on the N900, so I wasn't able to solve it right then:
solution(Men, Bound, Out) :- torchInside(Men, [], [], Log), totalDuration(Log, 0, Duration), Duration =< Bound, swritef(Out, '%w (%w minutes)', [Log, Duration]). % We use torch{Inside,Outside} predicates like a state machine. torchInside(A, B, Log, X) :- % Move two people from inside -> outside the mine combination(2, A, S), subtract(A, S, A1), append(S, B, B1), torchOutside(A1, B1, [S|Log], X). torchOutside([], _, Log, Log). torchOutside(A, B, Log, X) :- % Move someone from outside -> inside the mine combination(1, B, S), subtract(B, S, B1), append(S, A, A1), torchInside(A1, B1, [S|Log], X). % Utilities: totalDuration([], X, X). totalDuration([H|T], Acc, X) :- max_list(H, Max), NewAcc is Acc + Max, totalDuration(T, NewAcc, X). combination(0, _, []). combination(N, [H|T], [H|Comb]) :- N > 0, N1 is N - 1, combination(N1, T, Comb). combination(N, [_|T], Comb) :- N > 0, combination(N, T, Comb). ?- solution([1, 2, 5, 8], 15, X). X = "[[2, 1], [2], [5, 8], [1], [1, 2]] (15 minutes)" ; X = "[[1, 2], [1], [5, 8], [2], [1, 2]] (15 minutes)" ; false.I'm fun at parties.
Wasn't the best start this week, unfortunately.
I thought I had won.
I've been trying to get back to Norwich for a few days now. I was due to drive back last weekend, but the heat was already too intense at 8am to justify sitting in a car for three hours, even with the air conditioning on. So on Monday night I took a look at train times, with a view to letting the train take the strain on Tuesday. Unfortunately, the cheapest return tickets would be £85.30 - far in excess of the £39 it costs in petrol to drive there and back.
After playing around with the various train websites for an hour or so, I hit the jackpot: a train leaving London at 06:25 and returning at 20:00, for a total of £24. If I took my bike and cycled either end to avoid using taxis, I could justifiably use public transport, save the planet, save money, keep fit and claim back four hours of my life with productive work and email rather than sitting behind a wheel pointing a ton of metal in roughly the right direction. Big saving, time regained, total win!
On Tuesday morning I called up and booked my tickets, including one of the precious 6 slots available for bikes on the train. I started emailing friends to make plans to meet for coffee. Everything was looking good. But I've mentioned trains and winning, you can tell where this is going, can't you?
I woke up bright and early at 5am this morning, showered, dressed, and hopped on my bike to Liverpool Street station. When I got to the station, I was slightly confused to see no train at 06:25 to Norwich - the only likely suspect was going to Diss. Uh-oh. As I collected my tickets from the ticket machine, I noticed one of the displays.
Trains to Norwich stopping at Diss due to overhead power line failure, with a bus replacement service.
I've been on enough bus replacement services in my time. The London-Norwich line must have one of the highest numbers of weekend engineering works of any line in the country, so it's somewhat amazing that the power lines could even fail. Anyway, the prospect of taking my bike on such a service was not appealing, to say the least. And cycling from Diss to Norwich would be about 25 miles, a bit more than I wanted to do at short notice.
So I queued up at the ticket office, and asked for a full refund on my now-useless tickets. The response was a masterpiece of the state of consumer rights in the UK, delivered with maximum glottal stoppage: "We don't give refunds for advance tickets, you'll 'ave to write orf to National Express innit". I explained that wasn't acceptable, and in return was told I could wait until 9am for a manager, but I wasn't going to get a refund. A form was thrust into my hand, and I was shooed away.
That's when things all went a bit Keith Waterhouse. The leaflet I was given to reclaim my expenses was a masterpiece of failed social engineering. I can imagine the Strategy Boutique meeting, held in some smokey office in London (the marketing folks couldn't get to Norwich for the meeting, obviously). "We need to rebrand the Complaints and Refunds form", says Brand Middle Manager #1, "it's too negative. Let's fill it with positivity and happy vibes." The rest of the brand middle managers nod in agreement, and, fired up on caffeine, start a free-thinking word association game on the whiteboard. "What about Frequently Updated Commentary/Knowledge/Education on Derailments?" says #2, "it's got a snappy acronym!". #3 chips in: "yes, our customers are going to be happy that only 1 in 10 of our trains is late or cancelled, so let's invite them to say nice things! How about 'In praise of good service'?"
I suspect it was the same team of sharp-witted wags that put together the Compensation and Refunds page on the National Distress website, highlights of which include "a full refund will be issued at any National Express East Anglia ticket office (or any other National Rail ticket office) [...] certain discounted tickets are sold on a 'no change, no refund' basis". There's no mention on what tickets are sold on a no refund basis. I can only assume that advance fares fall into that category. Or maybe the staff at the Liverpool Street ticket office that refused to provide a refund are lying conniving bastards wanting to save themselves the job of filling out some paperwork. Or, more likely, both options are true. It's hard to see how the public interest is served with such a lack of transparency and Byzantine system. I guess that's the point: protect shareholder value for the rail companies, and tough luck on the punters naïve enough to use the trains.
The final moment of entertainment was provided upon calling the customer helpline to confirm refund methods. Upon explaining my situation, I was told I had to write in for a refund. I asked if I could just go into a station for the refund, but was told that it was not possible. The helpful lady on the phone concluded "oh, but you can pop into Norwich station and deliver your refund request letter by hand if you like?"
I politely pointed out I was not in Norwich - problems with the trains, you see.
On Sunday 5 September I will be entering a 10K running event, probably the Middlesex 10K in Victoria Park.
This will be my first running event, so I've put together a training schedule based on a few sources on the web. Whilst nine weeks preparation appears quite conservative—I have been running for about 5 weeks already—I will be in North America for about a month of that with an unpredictable schedule.
Below is what I'm currently shooting for. Units are in miles, a hyphen indicates a rest day and "cross" stands for cross-training. I haven't decided what I'm going to do for that yet although swimming is tempting.
Tasks for this week:
An ongoing issue for many is address books, everyone has one on their phone, in their email client, in Gmail… or to cut a long story short, in a number of independent locations (usually with varying information across all).
A solution (of sorts) I have found, avoiding the caveats of using LDAP, is to use a combination of GoogleSync on my smart phone, whilst using the Zindus addon for Mozilla Thunderbird:
Using Zindus I can sync my address book from Thunderbird with my Google address book, this in turn then allows me to use GoogleSync to update the data on my phone. All three locations now have the same contacts, and with Thunderbird already using Lightning and Provider for Google Calendar, the same calendars.
This only leaves my default calendar on the computer to deal with, which generally speaking most of does not ever need to be mobile. In theory, I can now update one, and have the changes synced more or less automatically to the other two data sets. Problem solved, in a round about way.
A plus to all of this would be ”de-googling” the process, however.
Originally posted: April 8th, 2008 (15:26)
“What is Ogg?!” I hear you cry.
You will all be highly familiar with the format Mp3 (MPEG-1 Audio Layer 3), as it is somewhat common in the world of digital music. You would think a widely used, compressed audio format would offer great benefits. Not entirely true, unfortunately, Mp3 is riddled with patents causing headaches for music distributors and also software developers alike. Permissions and more likely than not, money are needed to get anywhere. Ogg Vorbis, is entirely the opposite, open source. It is completely in the public domain, the entire source code available to view or use, thus allowing developers and anyone else to use it as they please, patent free and of course, free. It would also be your safest bet in avoiding any patent-based lawsuits!
I will be honest with you, I have known of the format for a number of years now, but for one reason or another shyed away from making the transition. I had many questions, much like you, the Mp3 user, has this very moment whilst reading this. What about portable players? What can I use to listen to it on my PC? Questions of that nature, at least. Nowadays even Windows Media Player can play Ogg with a simple set of DirectShow filters. I will post all relevant links at the end of this entry.
Vorbis.com-
We have a new Windows DirectShow based decoder thanks to our friends at Illiminable. These will let you play your Ogg Vorbis files in Windows Media Player, and other DirectShow based players.
You have all the benefits of compressed audio, without the hassles of patents such as DRM, as an example. There is a plethora of media players and portable players with Ogg compatibility via codecs and plugins, a number also support the format straight out of the box. Having made the transition to open source operating systems, and also software in that respect, a number of months ago now, I felt that this was the next step. I feel that the play Ogg campaign is a very worthy cause, in need of much more support. I wholly agree with its mission statement:
fsf.org-
A campaign to encourage use of the patent- and license-free standard Ogg Vorbis as an ethically, legally and technically superior audio alternative to the proprietary MP3 format.
Here are the links to all the related material I promised:
Development:
Lets get more people using Ogg! Make the transition today!
What it says on the tin really, just testing some plugins and features.
On Friday, I was at this event in Plymouth. The basics of it are pretty well covered by John Atherton’s blog post. I led one of open surgeries on use of Social Media, which I’m going to try to summarise and expand into an interactive briefing note on the website of our co-op. If you’ve hints and tips, or questions you feel I should cover, please leave me a comment here.
Other than that, I was trying to help support the event (as I’m one of the steering group for co-sponsors Co-operatives SW), so I was carrying some kit around and videoed the Question Time. That and some other clips should find their way online next week, along with some other thoughts triggered by the presentations. It was a pretty interesting and productive day, worth the ticket price in my opinion.
Happily, we launched the new Co-operatives SW website from a train at 9am Friday because of some unforeseen events and it seems to be working fairly smoothly. Please be gentle with it. I like the Members News section, but then I would, wouldn’t I?
(This post originally appeared on the LiMo Foundation blog)
A couple of weeks ago I went to Berlin for the annual LinuxTag event and to participate in the WIPJam running on the first day.
This was my first visit to LinuxTag, and it was interesting to compare it to FOSDEM, which I visited for the second time earlier this year. For those that haven't been, LinuxTag is an interesting combination of trade show, commercial exhibition, conference and community get-together. Apparently some 11,000 individuals were in attendance, which would make it almost three times the size of FOSDEM. But a combination of the much larger exhibition centre in place of FOSDEM's university campus, and being a 4 day event compared to FOSDEM's weekend, meant that it never really felt that busy. This is borne out by the speaking events - FOSDEM had almost 300 talks over two days, while LinuxTag only managed 231 across four. Much more leisurely! This turned out to be a good thing - it was handy to have some time to look around the show floor, hold conversations in the corridors, and generally soak up the atmosphere. On the whole, the LinuxTag talks seemed to be pitched more at introductory level, while FOSDEM felt more bleeding-edge and intensively technical. This seemed to suit the audience, which was much more mixed at LinuxTag.
The WIPJam on Wednesday turned out to be lively, with lots of good discussions. I really like the WIP format for these sessions - relaxed and informal with just the right amount of nudging from the organisers to keep things moving. Carlo and Thibaut did a great job of running the event, despite the blistering heat. I'd been asked to help facilitate discussion on "Cross Platform development - platform choices and mobile dev tools". We ran two sessions, both with more than a dozen participants, from a range of backgrounds including developers, researchers, industry luminaries and business owners.
One of the key messages to come out of the discussion was that these developers are very much focussing on HTML5 to help solve their cross-platform problems. The message was "as much HTML as possible, only use native when absolutely necessary". A significant number of apps in app stores only use native to embed browser engines and provide a wrapper around HTML, combining the benefits of cross-platform standards-based development with the benefits of the app store delivery model. It would certainly be interesting to see some hard statistics that back up this perception.
We looked a bit at priorities for picking a platform, and the consensus was that reach, monetisation, tooling, openness and the availability of a vibrant support community ("fan boys") were key. A corollary of that was that no amount of openness or reach can make up for a platform that is simply too difficult to write for. There was also significant enthusiasm for multiple app stores to be available on each phone platform (a view I'm not altogether in agreement with as I think it will frustrate and confuse consumers). Developers also wanted "Babelfish for Apps" to help them with cross-platform development: a guide to how things work on each platform. For example, on Palm you have a swipe gesture to go back in apps, on Android you have a back button, on iPhone it's typically a UI element on screen.
Finally, the discussion group members were all conscious that we're entering a new era where we don't just need to worry about cross platform development, but also cross form factor. With the proliferation of mobile devices, netbooks, and the oncoming tsunami of tablet computers, good design and an MVC approach to app construction will only become more important. Cross-platform UI toolkits and frameworks will help, but design and testing will become increasingly challenging.
Elsewhere in LinuxTag, some of the highlights included:
Next year's LinuxTag is 11-14 May in Berlin, and there's a load more WIP Jams coming up in the future - catch one if you can.
I’ve been watching the June budget and pondering its effects on me, our co-op, co-ops in general and the wider community.
So, how was it for you? Have I missed some friendly changes?