Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Sunday, February 26, 2012

Dublin GameCraft 2012

I spent the day with more than 100 game developers and designers yesterday at Dublin GameCraft. It was a lot of fun and although Donall and I didn't really submit our entry for any prizes, we recorded a short video of what we got up to, and here it is:



The topic of the day was: Dinosaur Angst, and as you can see, our dino was pretty angry! Our half baked game was based on OpenSimulator, using stuff we found in the web and LSL. Certainly not the best platform for good gameplay for a shooter, but it was fun to make, the atmosphere in the place was awesome, and have met some really nice people so that's what I call a great day!

Wednesday, January 11, 2012

New Year, New Wonderland Project

Another year begins and so does another Wonderland Wednesday Project. This time we have decided to improve the telepointer module that is already part of the wonderland-modules project.

The current telepointer has a bit of a weird shape and it's a 3D object. I personally cannot think of the benefits of a 3D pointer as compared to a 2D one… sounds the same to me!
The user name renders on top of the pointer in billboard mode, and that makes parts of the word disappear depending on the surface that the pointer is held against. So the first 2 tasks we will go for first are to change the appearance to a more regular 2D shape, and more importantly, to make it work when you take control of a 2D app.

This module is a good example of a Wonderland Component or Capability. In this case, instead of being available to attach to any object in world, it is programmatically attached to all avatars through a server plugin. A nice example if you want to see how to do such a thing.

We will be working on this again on Wednesday the 18th of January so feel free to pop along to the community server at 1p.m. EST or 6p.m. here in Dublin.

Monday, July 18, 2011

Dublin JavaScript Group July meet up -- Kata Reloaded!

We are organising another Kata session for the Dublin Javascript meetup this month, which will happen tomorrow Tuesday the 19th at 6.30pm @amworks. You can sign up here.

These are my slides for the event, which are pretty much the same as the ones I used last month.


The initial idea was to have a presentation on Processing.sj although that has been postponed, but I'm sure Nigel will come up with something. And in any case we are going ahead with uncle Bob's Prime Factors Kata.

The solution, in the form of a powerpoint document, can be found here so you don't really have to worry about the solution itself and can focus on practising the Kata instead.
A couple of interesting points I've noticed after practising it a couple of times are the differences between his Java implementation and a JavaScript one, and my mixed feelings to his last refactoring, which I find a bit contrived. I prefer to stop at the level of 'while' structures because I believe it preserves the intent of the algorithm a lot more than if you go the whole way and replace them with 'for' structures. The result has more lines of code but in my head it's clearer. But as usual, this is a personal preference and everyone will have their own, which is a good thing!

The format for this part of the meetup will be the following:
I will go through the slides, which will take me about 3 minutes. Then we will set about 20 minutes for people to work on the Kata. Working in pairs using ping pong pairing would be highly recommended. The idea is that one person writes the first test, the other person makes that test pass and writes the following test, and this goes on until the Kata is solved. If you don't want to pair, that is fine. If you don't want to program at all, that is fine too!
During those 20 minutes I'll be available to help out, especially to any new faces that are not familiar with the concept of a Kata or with Jasmine. At then end of this period we will project one solution and have a short retrospective about it.

And that is all, please feel free to join us from 6.30pm at amworks. See you there!

Friday, July 15, 2011

Sprockets for JavaScript

As a JavaScript newbie, a thing that some times puts me off when I see some libraries out there is the fact that they tend to be just the one big file, with long functions and tons of lines of code that is not that easy to follow.

Sprockets aim is to help out with this situation. As their website reads:
[Sprockets] helps you turn messy JavaScript into clean modules for development and a single file for deployment.

Sounds good to me!!! so how to get started? Reading the manual, of course!

The following is a quick a dirty guide to Sprockets and how to use it from the command line with the sprocketize command. I have created a really silly bunch of sample files that contain only dummy js functions and are here just to illustrate the use.


Installation

Installation is easy peasy through a Ruby gem. The only trick here is that if you are using rvm (and you should!) you will not need to use sudo, and if you are using your system Ruby it will probably be need. So let's do it:

gem install sprockets

And you are ready to go!

What else you need to know? Only two more things are needed: directives and the sprocketize command.


Directives


//=

Comments that start with the symbol above are considered directives, and they are used to pull in other resources that your project will use: other JavaScript files and any assets you use in the form of stylesheets, images, and so on.

There are two directives currently supported in Sprockets, require for other js files, and provide for other related assets. If the files are surrounded by quotes as in "myfile", then sprockets will only look for that file in the same directory. If is used, then all the load path will be searched for. That load path can be indicated to sprockets through the command line option.

So let's see some code: I have two files called my_file_1.js and my_file_2.js and I want them in just the one file for deployment. The contents of the files are:

my_file_1.js

function firstFunction() {
  // I do nothing really!!!
};



my_file_2.js

//= require "my_file_1.js"
function secondFunction() {
    // I do nothing but function one should appear before me
};


The Sprocketize command

There are different ways to use Sprockets being probably the Ruby library the most used. But the gem also bundles a command line tool which is a wrapper for the Ruby library so let's go with that cause it is really easy.

From the previous section we have two files called my_file_1.js and my_file_2.js and I want them in just the one file for deployment. To generate that concatenated file we can do:


sprocketize *.js > deployment_file.js

This will create a file called deployment_file.js with the following content:

deployment_file.js
function firstFunction() {
};
function secondFunction() {
};


You can see that firstFunction has been pulled in before the second one, and in the process all the comments and stuff that you don't need to deploy have also been stripped out. How nice is that!!!???


Hungry for more?
There is more about Sprockets that you can fin about in their manual. It is a great tool that I hope to start using soon.

Tuesday, July 12, 2011

Code Review Session for Open Wonderland 0.5 Preview 5

Preview 5 is coming... finally!

The Open Wonderland community is closing off the last bunch of issues, being the major one the Video Module that will finally work out of the box, without having to fiddle with the sources. As usual, Jon is in charge of the really hard stuff (Thanks Jon!).

As always, this is a community effort and we are all trying to contribute as much as we can. If you would like to help us move forward please do not hesitate to contact us!

At the meeting, the usual suspects were around, and we all took on some of the problems to fix. On my side of things, I've been poking about with the Placemarks menu, trying to make it a bit more user friendly by alphabetising the marks, separating them in more logical chunks, and so on.

Discussing and Assigning Bugs in-world


Last wonderland Wednesday session was devoted to discuss what was going to be fixed and added in the preview, and this Wednesday (July the 13th), we have organised a Code Review session after the normal Wednesday session.
I think a code review is a great way to learn, and it will definitely be very helpful for me, as I am not very familiar with the codebase. Please feel free to join us if you are interested in Wonderland development.

Tuesday, June 21, 2011

Dublin JavaScript Group June meet up -- jQuery and Jasmine

In a couple of hours the JavaScript Dublin Group will meet up for the second time. The first meetup was last month, and it was basically a gathering to get to meet other people and talk a bit about organisation.
So this will be the first time for a technical session. Nigel Kelly will be talking about jQuery apps, and I will run a Kata session in JavaScript using Jasmine. I hope people will follow along. We will use the standalone version of Jasmine and the kata chosen for the session is Fizz Buzz.

I came up with the following 4 slides (yeah, want to keep it short!):



The slides will not make much sense on their own, so you better come to the meet up!


This means that I will miss the P2PU SICP study group session on IRC (freenode #sicp room) today at 7pm GTM, 3pm EST, but it's for a good cause, right? :)

Saturday, June 18, 2011

SICP -- Starting with the P2PU study group

We have finally started with the SICP study group and I'm delighted to put some time into it. For once, I will focus all my effort and free time to work through and enjoy this fantastic book.

The goal of the group is to finish one section every second week, which gives us 6 weeks for the first chapter. Some people might think that 6 weeks is a lot but to be honest, at least for me, with a full time job, a part time PhD to work on, and all the normal social commitments, it's not that much time. So let's get cracking!

I decided to go back a re-watch the first bunch of MIT SICP lectures as it's been a while since I got around to see them first. I always have this funny and a bit weird feeling when I start watching one because for a moment I feel like I am watching an 80's sitcom or something similar. I'm probably just being silly but it always makes me smile!

The lecture series starts with Harold Abelson ranting a bit about the term Computer Science not being a very good one when it's not a real science, or even about computers. I do agree with him but if you want to know more about the subject you will have to watch it for yourself.

More interesting are his comments about the distinction between declarative or descriptive knowledge and imperative or procedural knowledge. Procedural knowledge or 'Know-How' can be directly applied to a task, whilst declarative knowledge tells us about truth. His example for this is the fact that the square root of a number can be expressed in the form of a mathematic equation(descriptive), compared to a way or algorithm to finding that square root through approximation (imperative).

He also explains that although you can learn most of the LISP language (its rules anyway!) in a short lecture, that does not make you a good user of the language. He compares it to learning the rules of chess and being a good chess player; you need the rules to play, but the rules do not make you any good at it. So you need to embed yourself in the context and the experience, and the techniques to do so are the topic of the course.

In Abelson's words, programming is all about managing complexity, and the techniques in this course will allow you to do so.

The lectures are divided into three main topics which do not correspond to the five sections of my book (my edition is from 1996), but that can be easily correlated, or so I think.

The parts discussed in the lectures are:
    - Black-box Abstraction: I guess this will be chapters 1 and 2, building abstractions with procedures/data.
   - Conventional Interfaces: I'd say this is chapter 3: Modularity, Objects, and State.
   - Metalinguistic Abstractions: This is chapter 4, of the same title.

The fifth chapter of the book about Register Machines does not seem to be in the lectures, but I couldn't tell right now cause I have yet to watch them all.

And that is all for now. I will spend another couple of hours later this evening working through the book and preparing the meeting for tomorrow Sunday at 7pm GMT, 3pm EST. Meetings happen on the #sicp channel on freenode IRC and everybody is welcome!!!

Friday, June 17, 2011

learn, laugh and move on!

There's been a lot going on lately and as a professional procrastinator I couldn't let go the chance of putting off writing a new blog post, but with things going back to normal (hopefully!) it's about time for a bit of reflection.

It's been a very social few weeks, ending May with a double bill: The software craftsmanship conference in Bletchley Park, and a coding day with the chaps of codingday.org here in Dublin.

What can I say about scuk11? it was a great day with fantastic sessions and I got to meet a great bunch of Spaniards in red t-shirts. Happy faces all over... yeah, the bar was already open!

The Dublin event was also fantastic and although it was first thought as a coderetreat, the addition of scientists and their real problems changed the nature of the session itself and made of it a fantastic coding day. The group I was working with got a spinning cube in the browser, with three different lights and three particles lighting up the cube with different colours. Great fun using the Three.js library!

The month of June started with @silverspoon organising hack nights in a café near the city centre, that I sadly missed because I was in Barcelona for a conference. Spain was great, as usual, although it was raining most of the time, but that didn't really have an impact on things such as meeting old friends, the great conversations we had, and of course, the fantastic food!

On Tuesday the 14th we had the first meet up for the SICP study group at P2PU. You can see what happened in the new wiki. This is an open group which basically means that you can join in anytime that suits you. We will meet twice a week for the next couple of months, Tuesdays and Sundays at 7pm GMT, 3pm EST. We are hoping to finish a section every two weeks, including exercises. As chapter one of the book has 3 sections, we are hoping for a 6 week period to be done with it. Wish us luck!!! or even better, join in!!!

Last night the first Ruby Project Night happened in armworks. The space is absolutely great and I want to thank Alan for hosting it. We didn't really know what to expect at first, and after a bit of chat and trying to get the projector going, we started hacking away in a rails 3 gem, something that none of us had done before. We didn't get too far but at least we got it packing and installing fine. As soon as the @theirishpenguin pushes it publicly I will share the link here. It was great to meet a bunch of enthusiastic people and looking forward to meeting them again!

This morning I read this 'Help Wanted' message from @oisin in the ruby Ireland list. If you are looking for contract Ruby work you should definitely get in touch with him. His last talk at ruby Ireland was really interesting.
In the thread he mentions that they like egoless programming which brought me back to the this old post of mine. Weingberg's book is a very recommended read even if as myself, you were not even born when it was written!

An finally, more to look forward to as the first 'technical' meet up of the Javascript Dublin group will be next Tuesday 21st at 7pm. A presentation about jQuery for web apps and a kata with Jasmine are in the menu. Are you really going to miss that???

Saturday, March 19, 2011

Talks at the Virtual Worlds Best Practices in Education 2011 Conference

In a couple of hours I will be talking about the Open Wonderland Development course that I organised through P2PU earlier this year. The time is 7a.m. PST or 2p.m. GMT and everybody is welcome!

This is the master schedule for the whole conference, which is finishing today.

Yesterday was the turn of Roland Sassen from Thinsia Research to talk about Wonderschool, their fantastic project that allows children in schools to use Alice through Open Wonderland. Roland also talked about some new research they are starting, to use Wonderland through thin clients and that sounds really exciting!

After that, Nicole and Jonathan from Open Wonderland Foundation and Wonderbuilders talked about the imminent preview 5 release that we are all waiting for!

As for today, I will be talking about the P2PU course and later on, at 1p.m. PST or 8p.m. GMT, Jon and Nicole will be joined by Kathryn Aten to tell us all about how to learn to program collaborative using Open Wonderland. This is a talk based on Wonderland Wednesdays which are our community weekly meetings in which we've been gathering together to write code collaboratively almost every Wednesday for the last 6 months. Can't wait!

Tuesday, January 25, 2011

Open Wonderland Development course starting tomorrow

I cannot believe it is already tomorrow!!! I am really excited and cannot wait to start working.

In the end a great bunch of people applied for the course, and although initially I was only offering 10 seats, it will be 12 of us starting the course. Hope it will also be 12 of us finishing it!

I am truly sorry to have had to deny several applications, but the pre-requisites were higher than an introductory course, and a good bunch of people did not complete the sign-up task, so I could not approve their applications.

If you are still interested, you can follow the course through the P2PU site, as all the content is openly available. Course link.

Looking forward to starting this collaborative project and I will be documenting several steps of the process in this blog, so stay tuned if you want to hear more!

Tuesday, November 30, 2010

about frogs and programmers

I am reading Gerald M. Weinberg's classic book Psychology of Computer Programming, which I am finding really interesting, and it also has some funny bits:

"Looking back, it seems that forcing programmers to work in isolation is like trying to study the swimming behaviour of frogs by cutting off their legs and putting those legs in the water to watch them swim. After all, everyone knows that the frog swims with its legs, so why complicate the experiments with all the rest of the frog?"


Sadly, in many senses, things don't seem to have changed much in the last 40 years.

Sunday, November 7, 2010

breakable toys

A couple of weeks ago I watched this talk in which Corey Haines tells us all about the software craftsmanship movement.

Although I haven't heard about the movement before (where have I been for the last couple of years???!!!) some of the things he talked about there felt very familiar.
A bit more digging out took me to the Apprenticeship Patterns book. And there again, a lot of familiar concepts, and even real physical situations clicked with me straight away.

One of the patterns that I enjoyed a lot is breakable toys. I have been doing this kind of small projects for years now, although I never called them toys but prototypes or spikes. Also the level at which I was getting involved with these projects was different from the one in the pattern. In my case they used to be pretty much a couple of hours work to get some framework installed and getting a hello-world kind of project out of it. The pattern goes much deeper than that. One of the examples they use is to create a wiki, and although it might seem a bit over-engineered at the beginning, they assure that it cat teach you about "HTTP, REST, parsing, web design, caching, full-text search, databases, and concurrency". That sounds a lot cooler than my 2 hours testing framework approach to toys.

I have also enjoyed the interconnection among patterns, and how some of them can lead to others. It is a great read and although the book is available online, I had to buy a copy. And of course, recommend it here; you should certainly go and buy it now!