BBQ n Blogging

Here is a photo of Chris:

Here is a photo of Will:

Posted in Gastronomie, Leisure | Tagged , , | 1 Comment

Burn After Reading

Saw this recent Coen brothers black comedy. The critics are loving it and I found it was pretty hilarious at times.

Brad Pitt and John Malkovich gave really great performances I think.

I recommend!

image source

Posted in Leisure | Tagged , | Leave a comment

Flinder’s Street Rat

Finished ISD with chris and cat – arrive at platform 13 to find this bloke. Charming :)

Posted in Walkabout | Tagged , | Leave a comment

Cooking Attempto! Tuna Pasta

I googled for a tuna pasta recipe on the train home tonight and then headed straight to the shops. The recipe was along the lines of:

  • Pasta
  • Tuna
  • Garlic
  • Onion
  • Capers
  • Cream
  • Sundried Tomatoes
  • Tomato Paste

From the above I devised my own version as:

  • Pasta
  • Tuna
  • Mushrooms
  • Onion
  • Feta Cheese
  • Sundried Tomatoes
  • Olives
  • Tomato Paste
  • Garlic

I nearly went insane (really!) and added asparagus. Perhaps next time I’ll add that and see the results.

Anyway, I got organic Feta and Greenseas tuna, they looked like this:

The pasta I used was Fettucini:

By the end I had a strange tuna, feta, mushroom dressing to put over the pasta:

Overall I think it went well. I need to practice with pasta though, I definitely cooked too much and didn’t stir it often enough. I also let the onion burn instead of softening but I’ll work on this from now on.

Posted in Gastronomie | Tagged , | 2 Comments

Debugging Javascript

So far my experience with Javascript has not required too much dealing with its raw form. I’m a big fan of the jQuery library and I’ve heard described as a swiss army knife for Javascript. I think that’s an understatement though, it goes beyond just being a toolset. I believe it is a framework in its own right. And in fact, it pushes all your Javascript code into a more structured form.

I recently fixed a problem with a website that was developed by someone using raw Javascript. Basically it failed to work in IE. The underlying problem was that IE doesn’t recognise the visual text of a drop down select box in the DOM of the page as the ‘value’ of the element in the drop down select box.

So if you selected “5pm” from the box, the Javascript can’t be:

foo = frm.select[bar].value;

It has to be:

foo = frm.select[bar].text;

If you want it to work across all the browsers. In jQuery, you would never even write code like the above. You’d be using the CSS selectors:

$("#date_select").text();

The above would find the element with id ‘date_select’ and extract its text. Why the dollar sign? It tells Javascript we’re dealing with the jQuery library.

So you see, jQuery just looks different to raw Javascript most of the time. For example, take a load of this raw Javascript:

document.getElementById("x20").style.display='none';
document.getElementById("x21").style.display='none';
document.getElementById("x22").style.display='none';

var d = frm.Dates;
var dval = d.options[d.selectedIndex].text;
var idx;

for (x=frm.Times.length;x>0;x=x-1)
{
        frm.Times.remove(x);
}

Ugh, messy. jQuery steps away from the ‘document’ rubbish by using the CSS selectors mentioned previously. And the for loop? jQuery provides you with functions to iterate throughout CSS selected elements:

$("#times_list li").each(function () {
  this.remove()
}

Where ‘this’ is one of the CSS selector’s matched elements, iterated by the ‘each’ function.

Posted in Programming | Tagged , , | Leave a comment