Coding Dreams

It’s a real thing, and I’ve had a couple this weekend. I’m surprised it’s taken so long, given the intense coding we’ve been doing on my Codeclan course.

On Friday night I decided to re-read The Hobbit after many years. In my previous post I mentioned that I had been caught out in an incorrect Lord of the Rings reference, and that put it in my mind to revisit that world.

In The Hobbit, the intrepid clan of Dwarves can only enter the secret door on the Lonely Mountain on “Durin’s Day”, which is described as the first day of the last moon of Autumn. (I’m sure I’ll be corrected if I’m wrong there.)

pp-hobmap-anim

Feel free to read the description of Durin’s day here if you want to check my accuracy.

So after starting the book that evening before bed, I had a dream about using a Ruby program to calculate when Durin’s Day would fall every year and to send out a notification. I can’t remember any of what I thought would be in the program, only that I would need an API of moon phases, or something like that. But looked at logically, if you have a table of moon phases you wouldn’t need a program. But that didn’t enter my nocturnal calculations.

I had another one this morning, not really connected to anything, just a (probably imaginary) method running around in my head about how to use an .each method to iterate around something and do something terribly important. Pity I can’t remember more, it might come in handy when next I write something in Ruby!

Advertisements

Coding, games in a cave, and real ale

It’s been a quiet week in Lake Wobegon – aka Codeclan Towers in Edinburgh.

After the alligator wrestling of the first three weeks – Ruby and Sql mainly, all foreign and scary for me – we came to html, css and the Sinatra web framework. (Except it’s not a framework. Except that it is, really.)

Having worked with HTML since the web’s inception in 1996, and CSS from the early part of this century, I was finally in my comfort zone. That meant I had one less thing to worry about than the others in my cohort, and I could concentrate on getting the trinity of Sinatra/Ruby/Sql to spit out some database-driven web pages, complete with forms for adding stuff to the database – our model was a record collection, so adding artists and albums and linking them all together was the goal. I was able to do a credible job and layer some unobtrusive styling on top of it all.

screenshot of a demo music library website with content superimposed over the image of blank record sleeve.

Homepage for the website I built for homework at Codeclan

album page from a music website

Album page for the music library website I built.

Another cool thing that happened this week was a Thursday night foray to “Games are for Everyone”, a games night at The Caves in Edinburgh. This event was in its fourth edition, put on by We Throw Switches, who I admit is an outfit I’d not heard of before. But some of the games looked amazing, even if the number of people there meant I didn’t really get much hands-on time for any of them. Still a good evening out, and I’m going to download a free version of one of the games I had a look at, a text-based game called The House Abandon.

So that leads us on to the end of the week and we have our first major individual project to work on. We were given the choice of five briefs to work on and present what we have accomplished next Thursday. Wow, a whole week to work on something by ourselves! Exciting and scary at the same time. Well, “scary” may be overstating it, but sobering.

My brief is to build a web app that allows the entry of pubs and pub voting for a “Pub of the Year” competition. Pubs voting for other pubs. The app allows the registering of voting pubs and giving votes to other pubs, and compiling a league table as a result. The more I look at the complex relationships involved the more I wonder if this was the wisest choice. But at least I will enjoy the research!

I’ll report back next Friday and let you know how i got on…