The Way Lunch Should Be

There’s a right way to go for lunch during your break at work, and, if you’re in Aberystwyth, this is it.

Starter
I started in Scholars, where Matt (in the Hat) is spending the entire day as a birthday celebration. I treated Matt to a pint of Guinness, and had a half myself, thereby giving myself probably a full lunch’s worth of calories. But never mind. Matt was trying to teach his friend Dave to play cribbage, with moderate success dulled only by the alcohol both had consumed. Matt’ll be in Scholars until they close, I don’t doubt, so if you haven’t wished him a happy birthday yet, that’s where you’ll find him.

Main Course
Morgan's ButchersI’ve recently discovered the sandwiches of Morgan’s, the butchers opposite Barclays on Great Darkgate Street. You go in there and mutter “beef” to the chap, who then slices a generous bun and fills it with roast beef, a Yorkshire pudding, fried onions, and thick gravy. It’s a roast beef dinner… in a sandwich! Genius! Apart from the obvious mess it makes to eat it, it’s fantastic.

Dessert
And to finish: back to The Hot Bread Shop on the corner of Cambrian Place and Chalybeate Street for a slice of orange cake. And now I’m very full. Marvellous.

Abbey National’s Rebranding

Is is just me who sees Abbey National‘s new logo – the result, inevitabley, of thousands of pounds worth of rebranding as part of their “new appeal”, as looking like some kind of symbolic steaming turd?

Abbey National's new "baked bean in a cape" logo.

Perhaps it’s just me, but when I first saw it in Aber high street the other day, that’s the first thing I thought of.

×

Writing A Calendar App In Rails Vs. PHP

Some time ago, I wrote a web-based calendar application in PHP, one of my favourite programming languages. This tool would produce a HTML tabular calendar for a four week period, Monday to Sunday, in which the current date (or a user-specified date) fell in the second week (so you’re looking at this week, last week, and two weeks in the future). The user-specified date, for various reasons, would be provided as the number of seconds since the epoch (1970). In addition, the user must be able to flick forwards and backwards through the calendar, “shifting” by one or four weeks each time.

Part of this algorithm, of course, was responsible for finding the timestamp (seconds since the epoch) of the beginning of “a week last Monday”, GMT. It went something like this (pseudocode):

1. Get a handle on the beginning of "today" with [specified time] modulus [number of seconds in day]
2. Go back in time a week by deducting [number of seconds in day] multiplied by [number of days in week] (you can see I'm a real programmer, because I set "number of days in week" as a constant, in case it ever gets changed)
3. Find the previous Monday by determining what day of the week this date is on (clever functions in PHP do this for me), then take [number of seconds in day] multiplied by [number of days after Monday we are] from this to get "a week last Monday"
4. Jump forwards or backwards a number of weeks specified by the user, if necessary. Easy.
5. Of course, this isn't perfect, because this "shift backwards a week and a few days" might have put us in to "last month", in which case the calendar needs to know to deduct one month and add [number of days in last month]
6. And if we just went "back in time" beyond January, we also need to deduct a year and add 11 months. Joy.

So; not the nicest bit of code in the world.

I’ve recently been learning to program in Ruby On Rails. Ruby is a comparatively young language which has become quite popular in Japan but has only had reasonable amounts of Westernised documentation for the last four years or so. I started looking into it early this year after reading an article that compared it to Python. Rails is a web application development framework that sits on top of Ruby and promises to be “quick and structured”, becoming the “best of both worlds” between web engineering in PHP (quick and sloppy) and in Java (slow and structured). Ruby is a properly object-oriented language – even your literals are objects – and Rails takes full advantage of this.

For example, here’s my interpretation in Rails of the same bit of code as above:

@week_last_monday = 7.days.ago.gmtime.monday + params[:weeks].to_i.weeks

An explanation:

  • @week_last_monday is just a variable in which I’m keeping the result of my operation.
  • 7.days might fool you. Yes, what I’m doing there is instantiating an Integer (7, actually a Fixint, but who cares), then calling the “days” function on it, which returns me an instance of Time which represents 7 days of time.
  • Calling the ago method on my Time object, which returns me another Time object, this time one which is equal to Time.now (the time right now) minus the amount of Time I already had (7 days). Basically, I now have a handle on “7 days ago”.
  • The only thing PHP had up on me here is that it’s gmdate() function had ensured I already had my date/time in GMT; here, I have to explicitly call gmtime to do the same thing.
  • And then I simply call monday on my resulting Time object to get a handle on the beginning of the previous Monday. That simple. 24 characters of fun.
  • + params[:weeks].to_i.weeks simply increments (or decrements) the Time I have by a number of weeks specified by the user (params[:weeks] gets the number of weeks specified, to_i converts it to an integer, and weeks, like days, creates a Time object from this. In Ruby, object definitions can even override operators like +, -, <, >, etc., as if they were methods (because they are), and so the author of the Time class made it simple to perform arithmetic upon times and dates.

This was the very point at which I feel in love with Ruby on Rails.

The Flat Is Tidy

Thanks to JTA for his help. Huge thanks to Matt (temporarily minus his hat) for his help: feed the guy oatcakes and rum and he’ll mop your floor! Winnage!

This is, of course, a result of the anticipated sale of the building we live in. The owners of MG’s cafe, below us, and – in fact – the whole building, are selling up and leaving. I’m not sure if this is what they’d planned all along – to buy the building, renovate the café, and sell it at a profit – but it’s at least a little bit inconvenient for those of us who live there and don’t know if and when we’ll have new landlords and whether or not they’ll want tenants (for instance, one of the prospective buyers when the building last came up for sale would have wanted to turn The Flat into a home for themselves).

But hey; The Flat is clean. Come see.

A Jolly Good Fundraiser

Just got back from three days of fundraising for Aberystwyth Nightline, selling hot dogs, burgers, and fries at a stall at the University “Fresher’s Fair”. That was pretty successful.

In other news, a large padded A4 envelope arrived at The Flat today, addressed to Paul. The stamps, letter header etc. all seem to imply that the letter has been sent from NATO‘s “Public Diplomacy Division.” That’s a little alarming.

Beer and curry tonight, usual crew. Meet at 7pm at Scholars or 8:15pm at Cafe All Spice if you want in.

The Aber Effect

Last night really works as a great example of the ‘Aber Effect’. Claire and I went along to Sundeep‘s housewarming party, where she was feeding curry to her housemates and those of us who came along to welcome her back into Aberystwyth. I’d also promised to help sort her computer out with an internet connection, but I’d forgotten to take the network card I’d agreed to lend her.

Having eaten, as some folks were packing up to leave, I suggested that Claire and I go and pick up the network card from The Flat, then come back and install it into Sundeep’s PC. That’s when we heard about Sundeep’s flatmate, who’d managed to lock himself out of his room. So we went back to The Flat and picked up the network card and also a set of lockpicks and a can of oil, and so when we got back Claire was able to install the network card while I picked the lock of the housemate’s room.

Having succeeded in my lockpicking attempt (after some jiggerypokery with the lockpicks and a filed-down Somerfield saver card [knew those things would come in handy]) and opened the room, the housemate offered Claire and I a pint in Scholars, which we accepted. Leaving Sundeep, we joined him and some of the other housemates in the pub for a congratulatory pint each of Old Speckled Hen.

And that’s where we bumped into Matt (in the hat), Andy K, and a friend of Andy’s who will henceforce me known as MOT. Jokes about having to renew him every year aside, we explained our plan to return to The Flat and decant the wine we’ve been brewing in our wardrobe for the last fortnight, and invited them to come join us when they’d finished their drinks. Then, needing to get a head start on them so as to start processing the wine, we set off.

On the way home, we were greeted by two separate groups of strangers, the first of whom overheard our conversation and with whom we briefly debated “the Aber effect”, and the second of whom wanted to use their camera phone to take a picture of Claire and I (although we’re not quite sure why).

We siphoned the wine into bottles, dissolved some fine sugar into it (the yeast had been somewhat overenthusiastic over the first few days and had made the wine slightly bitter and extremely alcoholic), and corked them, right on time for Matt, Andy, and MOT to arrive. We lounged, and drank wine, and were joined by JTA and Gareth, with whom we watched a few episodes of American Dad and listened to some music while the wine kicked in. Which it did, quite remarkably.

So, from a housewarming in Llanbadarn we met a guy who’s lock I picked for which he bought me a pint at a pub where I met some guys I knew and a guy I didn’t who came back to my flat where we drank homebrew wine with some folks who were at the party to begin with. This is the essence of the Aber Effect. And I love it.

Interview With Hayoa Miyazaki

The Guardian ran an interview with Hayao Miyazaki, director of such films as Princess Mononoke, Spirited Away, and Tonari no Totoro. My favourite bit of the interview:

Miyazaki taps a cigarette from a silver case. The Disney deal suits him, he explains, because he has stuck to his guns. His refusal to grant merchandising rights means that there is no chance of any Nausicaa happy meals or Spirited Away video games. Furthermore, Disney wields no creative control. There is a rumour that when Harvey Weinstein was charged with handling the US release of Princess Mononoke, Miyazaki sent him a samurai sword in the post. Attached to the blade was a stark message: “No cuts.”

The director chortles. “Actually, my producer did that.”

Magic Story

Inspired by Andy‘s PassThePageGame on the RockMonkey wiki – a collaborative storytelling game based on that silly game you used to play at school, I’ve written my own tool:

MagicStory is a collaborative wiki storytelling tool designed to be harder to “run away” with than normal wikifiction. Having read the story, participants can write a suggested “next sentence”, and after three suggestions have been collected a fourth person will be able to choose which one is used. Give it a go!

You’ll need a RockMonkey account, of course, but they’re free and simple to set up.

Rock Exchange

This weekend I hope to release Rock Exchange, my latest WikiGame on the RockMonkey wiki. I’m just finishing performing some tests and fine-tuning on it now. Here’s a screenshot:

Rock Exchange game on the RockMonkey Wiki

In Rock Exchange, players will be able to invest their hard-earned Rocks (a unit of currency) in shares in the various pages on the RockMonkey wiki. The value of these shares will fluctuate based on several characteristics, and players will have to play the odds in order to know when to buy and when to sell to gain a return on their investment. A page’s shares fluctuate based on:

  1. Popularity: so if a new page seems likely to attract the attention of a lot of passing Googlers, it’s worth investing in, whereas an “in joke” that’s died out is not. Similarly, players can manipulate wiki page links in order to attract interest. The most valuable indicator of popularity is how many people come to the site for the first time, entering on a given page.
  2. Investment: investment in pages will put positive pressure on their value, but selling shares damages this value by flooding the market – who’ll be first to pull out of a high-flying page, thereby forcing other shareholders to suffer?
  3. Interference: there will be several methods for people to drastically interfere with the value of their shares and the shares of the other traders, but these won’t necessarily be immediately apparent.
  4. Random factors: the rock market, like the stock market, is an unpredictable animal, and there’ll be a small amount of luck in any investment.

The game’s pretty much “ready-to-play” in it’s most basic form right now, but I want to run it alone awhile longer and see if I can improve the balancing factors in it.

×

Client Of The Day

Oh, some of our clients are funny. A client of ours, who hosts her web site and e-mail with us, calls me up because she has difficulty getting access to her webmail:

Her: “My e-mail doesn’t work.”
Me: (not knowing much about her configuration) “Are you using a web browser to check your e-mail, over the web? Or are you using some other program, like Outlook or Outlook Express?”
Her: “What?”
Me: “Are you using Internet Explorer?”
Her: “Yeah. [my co-worker] sent me a link and I went to the page and it worked. So to make it easier in future I saved it to my desktop. But now when I click on it I get the user name and password thing and then it doesn’t work.”
Me: “So… you’re clicking a shortcut on the desktop, and you see the user name and password boxes. You put in your user name and password… what do you get?”
Her: “Page Not Found.”
Me: “Could you tell me the address your web browser says it’s at?”
Her: “The what?”
Me: “The thing written in the white bar at the top of the screen.”
Her: “Okay, it’s C:\Documents and Settings\Meriel\Desktop\login.html.”
Me: “Umm. When you made this link on your desktop, how did you do that?”
Her: “I clicked File, then Save. Why?”
Me: “Right. What you’ve done is you’ve saved a copy of the login page onto your computer, isn’t it? But your webmail is online, so that’s not working.”
Her: “But I wanted to be able to read my webmail offline, because I’m only on dial-up and it’s a lot faster to open things from my desktop.”
Me: (bangs head on desk)

Frag!

Frag! arrived this afternoon, earlier than expected. If anybody wants to come around to The Flat in advance of Naruto Night this evening, we can have a quick blast at it… what do you think?

In other news, Predictive Solutions, with whom we share the offices on this, the first floor of the Aber Technium, are closing down. Now who’s buffets am I supposed to gatecrash?

Article #11012

[this post originally appeared on AvAngel.com; a copy is archived here]

It looks like the shit has hit the proverbial fan as far as Diogel is concerned. AvAngel.com, and all other sites formerly part of the Big McLargeHuge collective, is very, very dead.

This site is coming back online by installments. Watch this space.

Normal service will be resumed as soon as possible. We apologise for the inconvenience caused.

The Abnib Real Ale Ramble 2005

Wow; there seems to be a lot of interest in the idea I just blogged. That’s brilliant!

Now there’s just the small matter of arranging how everybody who wants to go is going to get there, and where they’re going to stay once they have. To this end, I’ve set up a web page: The Abnib Real Ale Ramble 2005. Take a look there for the most up-to-date information about who’s going, where they’re staying, who needs lifts, who can give lifts, what’s going on, etc. etc.

Like Real Ale? Like walking around the Welsh hills in winter? Get involved! Yay!

Knightmare Night tonight! Double-yay!

Llanwrtyd Wells Real Ale Ramble

What’s everybody doing on the third weekend in November? If I could find reasonabley-priced accomodation (everybody likes camping, right <wink>), who’d be up for the Llanwrtyd Wells Real Ale Ramble – two days of trekking over hills and being fed real ale at various points along the way?

From the web site:

The Real Ale Ramble is held annually in conjunction with the Mid Wales Beer Festival. All the walks begin from the centre of Llanwrtyd Wells, the smallest town in Britain. This is an area where the pace of life is relaxed and traditional, where the inhabitants are friendly and welcome visitors who come to enjoy the unsurpassed scenery of this little known part of Mid Wales.

The Real Ale Rambles are non competitive, the entry fee for 2004 [think they mean 2005 – they say 2005 everywhere else, and the information seems to still be accurate] is £16 per person which covers 2 days (booking by the day will cost £15 per day) and there are choices of 10, 15 or 25 miles daily. All routes are waymarked, and a refreshing glass of Real Ale will be free to all registered participants at the various checkpoints en-route. All walks take place off road, so you can enjoy the beauty of the landscape, forest, moor and mountain in this spectacularly beautiful area of Mid Wales. Those who finish their chosen walk can purchase a medal or badge and track suit badges will also be on sale.

I’ll get an information pack on it’s way to The Flat. And before you ask, Llanwrtyd Wells is less than 2 hours drive away.