<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>The personal site of Dan Webb</description><title>danwebb.net</title><generator>Tumblr (3.0; @danwebb)</generator><link>http://danwebb.tumblr.com/</link><item><title>Low Pro for Prototype and Firefox 3.5</title><description>&lt;p&gt;Just a quick note for those googling for a solution to this.  Older versions of Low Pro for Protoype will be experiencing problems with behaviors in Firefox 3.5.  This issue has been fixed so pick up the latest version &lt;a href="http://github.com/danwrong/low-pro/raw/2f47a651ab1143b2e067de7d2381f615c389a14e/dist/lowpro.js"&gt;from GitHub&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;An interesting upshot of this is that I found out something pretty nice which is kind of obvious but had never occurred to me before.  If you create a function in a closure then that function can refer to itself because it has access to that closure’s variables.  I normally use arguments.callee to get a reference to a function from within its body but there’s never really any need to do that:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;(function() {
  var aFunction = function() {
    aFunction.thing = 47;
  };

  aFunction();

  alert(aFunction.thing); //=&amp;gt; 47;
})();&lt;/code&gt;&lt;/pre&gt;</description><link>http://danwebb.tumblr.com/post/214656834</link><guid>http://danwebb.tumblr.com/post/214656834</guid><pubDate>Thu, 02 Jul 2009 11:22:00 +0100</pubDate><category>javascript</category><category>lowpro</category><category>firefox</category><category>fix</category><category>tech</category></item><item><title>Massive Robot launches twaud.io</title><description>&lt;p&gt;Well, it’s been a bloody long while again since I’ve posted here and I suppose you’ve all unsubscribed me now.  To be honest, I wouldn’t blame you.&lt;/p&gt;


	&lt;p&gt;However, silence here does not mean that I’ve been sitting on my arse doing nothing.  In fact, the reality is very much to the contrary.  Loads of stuff has been going on but there are two new pieces of news.  Firstly, I’ve renamed and rebranded my company.  We are now &lt;a href="http://www.massiverobot.co.uk"&gt;Massive Robot&lt;/a&gt; and we are available for consultancy and development work so if you have anything in mind then please contact us.  &lt;a href="http://josephmckernan.co.uk"&gt;Joe&lt;/a&gt; has done the branding and it’s something I’m really pleased with.&lt;/p&gt;


	&lt;p&gt;Check the business cards…&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://www.danwebb.net/assets/2009/5/20/6640430.jpg" title="Massive Robot Business Cards" alt="Massive Robot Business Cards"/&gt;&lt;/p&gt;


&lt;p style="clear:left"&gt;Along with those is a &lt;a href="http://massiverobot.co.uk"&gt;new site&lt;/a&gt; and a T-shirt.  The final and most important Massive Robot branding will be the kicks.  I’m working on those at the moment.&lt;/p&gt;

	&lt;p&gt;&lt;img src="http://twaud.io/images/logo.png?1242825321" title="twaud.io" alt="twaud.io"/&gt;&lt;/p&gt;


&lt;p style="clear:left"&gt;This week launched &lt;a href="http://twaud.io"&gt;twaud.io&lt;/a&gt;, Massive Robot’s new service.  The idea is simple – it’s like &lt;a href="http://twitpic.com"&gt;twitpic&lt;/a&gt; but for audio.  Go to the site or use the &lt;span class="caps"&gt;API&lt;/span&gt; to upload your audio and you get a page with a short &lt;span class="caps"&gt;URL&lt;/span&gt; and a player for your followers to listen to it.  This is just the start and we are working on a whole load of new features for it so follow &lt;a href="http://twitter.com/twaudio"&gt;@twaudio&lt;/a&gt; to keep up to date.&lt;/p&gt;

	&lt;p&gt;The build of twaud.io has been an interesting and fun experience.  I was able to use Twitter’s new OAuth based login process via &lt;a href="http://github.com/mbleigh/twitter-auth/tree/master"&gt;twitter_auth&lt;/a&gt; which I’d recommend wholeheartedly for as a foundation for Twitter applications, although I have hacked to allow for both OAuth (for the site) and username/password based (for the &lt;span class="caps"&gt;API&lt;/span&gt;) authentication where normally you must choose one or the other.  It also uses S3’s direct uploading facility via &lt;a href="http://swfupload.org"&gt;SWFUpload&lt;/a&gt; which was not easy to get going but has provided a really scalable system as the application stays completely out of the loop of the bulky upload process. I love the direction web development is moving in at the moment.&lt;/p&gt;</description><link>http://danwebb.tumblr.com/post/214656809</link><guid>http://danwebb.tumblr.com/post/214656809</guid><pubDate>Wed, 20 May 2009 13:29:00 +0100</pubDate><category>rails</category><category>massive robot</category><category>oauth</category><category>twaudio</category><category>twitter</category><category>tech</category></item><item><title>It's Been A Long Time...</title><description>&lt;p&gt;But I’ve not just been sitting on my arse playing &lt;span class="caps"&gt;GTA IV&lt;/span&gt;, oh no.  Well, not all the time anyway.  The reason I’ve not posted anything (or been particularly active on the web in general) is that I’ve been damn busy.  Most importantly, Catherine kindly gave birth to our first son, &lt;a href="http://flickr.com/photos/danwebb/2361976989/"&gt;Max&lt;/a&gt;, back in March which has been quite a change and sapped a lot of my hacking time.  I have to say though, despite the horror stories that many veteran parents like to feed you, our experience has only been good.  In fact, not good, great.  I recommend this reproducing lark.&lt;/p&gt;


	&lt;p&gt;Secondly, I’ve been hacking away nearly full time on one of my favourite projects to date, &lt;a href="http://peoplesmusicstore.com"&gt;Peoples Music Store&lt;/a&gt; with &lt;span class="caps"&gt;LRUG&lt;/span&gt; stalwart and renowned anarchist, &lt;a href="http://abscond.org"&gt;James ‘Bringing London To Its Very Knees’ Darling&lt;/a&gt; which is maturing nicely under private beta as we speak.  Peoples Music Store is a great idea from some of the guys behind &lt;a href="http://bleep.com"&gt;bleep.com&lt;/a&gt; whereby users can construct and customise their very own download store from the music they love then get free music themselves if people buy from their store.  It’s a great way to both promote and show off you’re own music taste or in depth genre knowledge and find new music from stores you trust while getting some free digital swag along the way.  I’m probably not explaining it well so just drop me a line if you want and invite and the site will explain itself.  Public launch is coming in a month or so.&lt;/p&gt;


	&lt;p&gt;Building Peoples Music Store has been a great learning experience.  We run the site on a cloud computing platform and from content ingestion to audio preview delivery to application servers to download packaging and delivery everything has been designed to scale horizontally – and I’m pretty proud of it.  Thin, Rack, Sphinx, God, Starling and a whole load more cool open source gear is all running in there. I really need to get to blogging some of what I’ve discovered about working with &lt;a href="http://rack.rubyforge.org/"&gt;Rack&lt;/a&gt;.  It simply is the dog’s bollocks.&lt;/p&gt;


	&lt;p&gt;So, enough of the excuses.  What’s on the horizon?&lt;/p&gt;


	&lt;h3&gt;Speaking and Conferences&lt;/h3&gt;


	&lt;p&gt;I’ve taken some time of speaking and conferencing in general so as to spend lots of time with Catherine and Max but come September I’m restarting the conference trail.  Firstly, I’m doing a presentation and a tutorial (with &lt;a href="http://jlaine.net"&gt;Jarkko Laine&lt;/a&gt;) at RailsConf Europe all about JavaScript related Rails stuff and I’m likely to have a slot at &lt;a href="http://vivabit.com/atmediaajax"&gt;@media Ajax&lt;/a&gt; as well.  Also, I’ll be heading to &lt;a href="http://2008.dconstruct.org"&gt;dConstruct&lt;/a&gt; as is the tradition.&lt;/p&gt;


	&lt;h3&gt;Hacking and Open Source Business&lt;/h3&gt;


	&lt;p&gt;Although I’ve not commited to Low Pro or Low Pro JQ for a good while now they are both very much alive.  I’ve simply not come across anything that I’ve felt the need to add for a while.  If you have any suggestions or patches do let me know.  I’ve actually got time to commit them at the moment.  Another little project that I’m hoping to get off the ground is called &lt;strong&gt;Evil&lt;/strong&gt; which is going to contain lots of Merb/Rack goodness.  The first by-product of which is the &lt;a href="http://github.com/danwrong/merb_openid"&gt;merb_openid&lt;/a&gt; gem for consuming OpenID in Merb apps (it’s still not quite production ready though so don’t go using it just yet).  I’ll let you know what Evil actually does when (or if) I actually get something working.&lt;/p&gt;


	&lt;p&gt;So, that’s all for now.  Just a bit of a status report.  I promise I’ll get some useful content written that you actually care about very soon.&lt;/p&gt;</description><link>http://danwebb.tumblr.com/post/214656766</link><guid>http://danwebb.tumblr.com/post/214656766</guid><pubDate>Mon, 23 Jun 2008 22:56:00 +0100</pubDate><category>rails</category><category>general</category><category>events</category><category>lowpro</category><category>speaking</category><category>prattle</category><category>chitchat</category><category>boring</category><category>work</category><category>reproduction</category><category>rack</category><category>bullshit</category><category>donotread</category><category>tech</category></item><item><title>Event Delegation Made Easy</title><description>&lt;p&gt;I’m having a lot of fun poking around jQuery at the moment and came up with a cool little thing that’s going into Low Pro for jQuery but is a nice stand-alone little snippet for implementing event delegation.  Since the &lt;a href="http://icant.co.uk/sandbox/eventdelegation/"&gt;Christian and the guys at &lt;span class="caps"&gt;YUI&lt;/span&gt; started talking about it&lt;/a&gt; event delegation has gone from being something that I’d use occasionally to the way I do nearly all my event handling.  If you aren’t familiar with the technique go and click that previous link and read Christian’s article now – it’s important.&lt;/p&gt;


	&lt;p&gt;In most instances I end up writing a lot of event handlers that look like this:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;$('#thing').click(function(e) {
  var target = $(e.target);

  if (target.hasClass('quit') return doQuitStuff();
  if (target.hasClass('edit') return doEditStuff();
  // and so on...
});&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Obviously, writing a lot of the same kind of code is a warning sign that something needs refactoring but I’ve never come up with a nice way to abstract this.  But with a little bit of functional magic I’ve just found with something I really like.  Here’s what I came up with:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;jQuery.delegate = function(rules) {
  return function(e) {
    var target = $(e.target);
    for (var selector in rules)
      if (target.is(selector)) return rules[selector].apply(this, $.makeArray(arguments));
  }
}&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Using it is simple:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;$('#thing').click($.delegate({
  '.quit': function() { /* do quit stuff */ },
  '.edit': function() { /* do edit stuff */ }
}));&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The function simple runs through the rules checking if the element that fired the event belongs to that selector then calls the corresponding handler passing the original event object through.  The great thing about it is that you can use it in Low Pro behavior classes:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;DateSelector = $.klass({
  onclick: $.delegate({
    '.close': function() { this.close() },
   '.day': function(e) { this.selectDate(e.target) }
  }),
  selectDate: function(dayElement) {
    // code ...
  },
  close: function() {
    // code ...
  }
});&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;I’m not sure of the performance implications of using is() so heavily but some form of caching could be added if it was a problem.  Still, it’s a really nice little bit of syntactic sugar that’s going into Low Pro for jQuery and I’ll be using it a lot.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;&lt;/strong&gt;: I should have added that there’s a version of this in Low Pro for Prototype. In case you want to use it on its own:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;Event.delegate = function(rules) {
  return function(e) {
      var element = $(e.element());
      for (var selector in rules)
        if (element.match(selector)) return rules[selector].apply(this, $A(arguments));
    }
}&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Meanwhile, you might want to take a look at &lt;a href="http://peter.michaux.ca/article/3752"&gt;the patch&lt;/a&gt; by &lt;a href="http://peter.michaux.ca/"&gt;Peter Michaux&lt;/a&gt;.&lt;/p&gt;</description><link>http://danwebb.tumblr.com/post/214656738</link><guid>http://danwebb.tumblr.com/post/214656738</guid><pubDate>Fri, 08 Feb 2008 13:10:00 +0000</pubDate><category>javascript</category><category>lowpro</category><category>jquery</category><category>tech</category></item><item><title>How To Use Low Pro For jQuery</title><description>&lt;p&gt;It seems that my initial version of &lt;a href="http://github.com/danwrong/low-pro-for-jquery/tree/master/src/lowpro.jquery.js?raw=true"&gt;Low Pro for jQuery&lt;/a&gt; has gotten enough interest to continue
with it but, as always, my previous post was extremely lacking in actual detail about how to use
the damn thing.  So without further ado here we go.  It’s pretty simple really and, as its a port
of a subset of Low Pro for Prototype, anything that goes for that also goes for jLow.&lt;/p&gt;


	&lt;p&gt;Heh, let’s not call it that again.  Bad.&lt;/p&gt;


	&lt;p&gt;Anyway, on with the show…&lt;/p&gt;&lt;h3&gt;Class-based OO&lt;/h3&gt;


	&lt;p&gt;In order for Low Pro behavior classes to work with jQuery we need a class implementation.  The
one I’ve based this on is the version from Prototype originally based on Alex Arnell’s work. This
is detailed in &lt;a href="http://prototypejs.org/learn/class-inheritance"&gt;this article on the prototype site&lt;/a&gt;. The
only difference is that instead of using Class.create you use $.klass:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;Draggable = $.klass({
  initialize: function(options) { },
  onmousedown: function() {}
});

GhostedDraggable = $.klass(Draggable, {
  onmousedown: function($super) {
    // do extra stuff here then call original method...
    $super();
  }
});&lt;/code&gt;&lt;/pre&gt;

	&lt;h3&gt;Attaching the behavior class to elements&lt;/h3&gt;


	&lt;p&gt;To attach the behavior class to some 
elements you can use the attach method:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;$('div.product').attach(GhostedDraggable, { anOption: thing });&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;attach&lt;/code&gt; creates a new instance of the given behavior class for each element in the collection and
attaches them to these elements.  Any subsequent arguments are passed to the class’s &lt;code&gt;initialize&lt;/code&gt; function.  
A few magic things happen here.  First, &lt;code&gt;this.element&lt;/code&gt; in the 
behavior instance is set to a dollared version of the element it’s attached to.  Secondly, every 
method beginning with on (eg. onclick, onsubmit etc) gets bound as an event handler on the attached
element.  However, in the event handler functions themselves, &lt;code&gt;this&lt;/code&gt; points to the behavior instance
rather than the element so you can call it’s other methods.  You can obviously get to the element
by using &lt;code&gt;this.element&lt;/code&gt; if you need to though.&lt;/p&gt;

	&lt;h3&gt; And for the bonus round…&lt;/h3&gt;


	&lt;p&gt;So, that’s about all there is to it.  One added bonus is that if you are using &lt;a href="http://brandonaaron.net/docs/livequery/"&gt;livequery&lt;/a&gt; then Low
Pro will automatically use it to attach any new behaviors after the &lt;span class="caps"&gt;DOM&lt;/span&gt; is changed without you needing to worry about it.&lt;/p&gt;


	&lt;p&gt;Here’s a super simple example behavior that simply adds and removes a &lt;span class="caps"&gt;CSS&lt;/span&gt; class name when it is
hovered over.  It’s about as bare bones as you can get while showing off most of the features:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;Hover = $.klass({
  initialize: function(hoverClass) {
    this.hoverClass = hoverClass;
  },
  onmouseover: function() {
    this.element.addClass(this.hoverClass);
  },
  onmouseout: function() {
    this.element.removeClass(this.hoverClass);
  }
});

jQuery(function($) {
  $('span.name').attach(Hover, 'myClassName');
});&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;For more information about how you might use behavior classes take a look at &lt;a href="/2007/7/18/low-pro-behaviours-101-part-2"&gt;this article.&lt;/a&gt; ANother good point of reference is the built-in Remote.Link and Remote.Form
behaviors that are built in to Low Pro.  Take a look at the &lt;a href="http://github.com/danwrong/low-pro-for-jquery/tree/master/src/lowpro.jquery.js?raw=true"&gt;source&lt;/a&gt;
Also a Low Pro site is on its way shortly. As I use it more myself I’ll post more real examples but you can post any questions to the &lt;a href="http://groups.google.co.uk/group/low-pro"&gt;Low Pro list&lt;/a&gt;.&lt;/p&gt;</description><link>http://danwebb.tumblr.com/post/214656697</link><guid>http://danwebb.tumblr.com/post/214656697</guid><pubDate>Sun, 03 Feb 2008 16:00:00 +0000</pubDate><category>javascript</category><category>lowpro</category><category>jquery</category><category>tech</category></item><item><title>Low Pro For jQuery?</title><description>&lt;p&gt;A few days ago &lt;a href="http://groups.google.co.uk/group/low-pro/browse_thread/thread/29b96e32fb68f45e"&gt;a discussion started about porting Low Pro over to jQuery&lt;/a&gt;.  It’s been on my mind 
for a while (especially since &lt;a href="http://meme-rocket.com/2007/09/07/agnostic-unobtrusive-javascript/"&gt;Bill blogged about agnostic &lt;span class="caps"&gt;UJS&lt;/span&gt;&lt;/a&gt;) but I’d hesitated in doing this for a few
reasons.  Firstly, of course, jQuery is the mortal enemy of Prototype and only one library shall
remain come The Quickening. Aside from this completely rational reason, I wondered whether jQuery
really needed anything like Low Pro at all.  After all, jQuery has always been designed with
‘unobtrusiveness’ in mind and was written with most of what Low Pro originally intended to fix 
in Prototype implemented from the start.  There was no need for something like Event.addBehavior 
because essentially that’s what jQuery is:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;Event.addBehavior({
  'a.external:click': function() { //...code...// },
  'div.product:mouseover': function() { //...code...// }
});&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Can be achieved in jQuery like this:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;jQuery(function($) {
  $('a.external').click(function() { //...code...// });
  $('div.product').mouseover(function() { //...code...// });
});&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;And rather than ever going near inline event handlers this unobtrusive style was the de-facto
method of working for the jQuery crowd.  The angel on your scripting shoulder.  However, as you
can probably tell from reading this blog, I’ve never really adopted jQuery as my main library
and this was due to one big reason (and a bundle of small ones but I’ll leave them out)&amp;#8230;&lt;/p&gt;&lt;p&gt;The one big reason was that, while jQuery was super simple and concise when working on smaller
projects, it offered no help in structuring larger applications.  All you get in jQuery, aside from
Ajax methods and a handful of utilities, is the ability to select nodes then doing something 
with them. On the other hand Prototype is much rounder in scope.  It generally plumps out JavaScript 
as a language adding lots of useful methods to built-ins, a host of functional programming tools 
and recently a full Class-based OO system with inheritance and the whole shebang which has formed
the back bone of Low Pro’s behavior classes.&lt;/p&gt;


	&lt;p&gt;Low Pro’s behavior classes have become my favourite solution to the problem of structuring complex
Ajax applications in a simple and maintainable way. Even hugely complex applications can be separated
up into a number of groups of elements with attached behaviors.  These behaviors maintain their
own state, respond to events and can also expose there own public methods.  They are linked to an
element but the element doesn’t know about them which eliminates the need for expandos on elements and
also most of the reasons for having element references in closures which is good for keeping memory usage
at bay.  For instance, a click on
a TabBar instance can call the loadContent method of a ContentPanel.  The result is more than a
set of widgets, its a way of splitting up huge complicated interfaces into a collection of small,
loosely joined parts each simple in its own right and totally responsible for its part of the interface.
This approach becomes incredibly useful when you introduce server-side requests and responses into
the mix but that’s a whole other article.&lt;/p&gt;


	&lt;p&gt;In jQuery land this kind of effect can be achieved via plugins.  You’ll find a ton of widgets
in the repository that have this kind of UI:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;$('#example4').draggable({ helper: 'clone', revert: true });&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The plugin architecture is one of jQuery’s many strong points but this kind of approach has a couple
of disadvantages.  Firstly, the plugin is created within a closure which means usually if you want to
change the behavior of the plugin you literally need to pop open the source and change it.  The second
and related disadvantage is that because of the difficulty in changing plugins they tend to have
a whole raft of options to allow you to configure how it works.  The problem with this is that
individual widgets can end up pretty monolithic.  Wouldn’t it be be better if you could just take
the basic draggable behavior and just augment it to your liking?&lt;/p&gt;


	&lt;p&gt;Well, in Low Pro behaviors are classes so we can do this by simply subclassing another behavior
and overriding or adding what we need.  For example, we can create GhostedDraggable as a subclass
of Draggable.  No need to hack any existing code at all.  As well as having the power and convenience
of jQuery’s &lt;span class="caps"&gt;DOM&lt;/span&gt; manipulation we can have a simple and powerful way to structure larger, more
complex applications.  I can have my jQuery cake and eat it.&lt;/p&gt;


	&lt;p&gt;So, I’ve started experimenting with &lt;a href="http://github.com/danwrong/low-pro-for-jquery/tree/master/src/lowpro.jquery.js?raw=true"&gt;Low Pro for jQuery.&lt;/a&gt;
Here’s a preview:&lt;/p&gt;


&lt;pre&gt;&lt;code class="javascript"&gt;Hover = $.klass({
  initialize: function(hoverClass) {
    this.hoverClass = hoverClass;
  },
  onmouseover: function() {
    this.element.addClass(this.hoverClass);
  },
  onmouseout: function() {
    this.element.removeClass(this.hoverClass);
  }
});

$('div.products').attach(Hover);&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;If you want to leave feeedback or abuse &lt;a href="http://groups.google.co.uk/group/low-pro"&gt;jump on the Low Pro list.&lt;/a&gt;
Do you think it has a place in the jQuery landscape?  How do you currently structure complex applications
in jQuery?&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;&lt;/strong&gt;: Thanks to Chris of &lt;a href="http://errtheblog.com"&gt;Err The Blog&lt;/a&gt; Low Pro JQ is &lt;a href="http://github.com/danwrong/low-pro-for-jquery/tree/master/"&gt;rocking on GitHub&lt;/a&gt;.  Fork away.&lt;/p&gt;</description><link>http://danwebb.tumblr.com/post/214656668</link><guid>http://danwebb.tumblr.com/post/214656668</guid><pubDate>Thu, 31 Jan 2008 00:56:00 +0000</pubDate><category>javascript</category><category>lowpro</category><category>jquery</category><category>experiments</category><category>tech</category></item><item><title>How Good Is This?</title><description>&lt;pre&gt;&lt;code class="ruby"&gt;&amp;gt;&amp;gt; a = 79.99 * 100
=&amp;gt; 7999.0
&amp;gt;&amp;gt; a.floor
=&amp;gt; 7998
&amp;gt;&amp;gt; b = 7999.0
=&amp;gt; 7999.0
&amp;gt;&amp;gt; b.floor
=&amp;gt; 7999&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;I’ll tell you.  &lt;strong&gt;It’s not good.&lt;/strong&gt;  I hate floating point calculations.  Happy new year!&lt;/p&gt;</description><link>http://danwebb.tumblr.com/post/214656637</link><guid>http://danwebb.tumblr.com/post/214656637</guid><pubDate>Wed, 02 Jan 2008 12:35:00 +0000</pubDate><category>ruby</category><category>argh</category><category>stupid</category><category>tech</category></item><item><title>danwebb.net Dunk Low</title><description>&lt;p&gt;&lt;img src="/assets/2007/12/25/-1.png" title="danwebb.net Dunks" alt="danwebb.net Dunks"/&gt;&lt;/p&gt;


&lt;p class="caption"&gt;Thanks Catherine!  The real things are on there way in a couple of weeks.  Happy Christmas, Peeps.&lt;/p&gt;</description><link>http://danwebb.tumblr.com/post/214656615</link><guid>http://danwebb.tumblr.com/post/214656615</guid><pubDate>Tue, 25 Dec 2007 16:36:00 +0000</pubDate><category>trainers</category><category>sneakers</category><category>xmas</category><category>tech</category></item><item><title>Low Pro 0.5: Now Compatible With Prototype 1.6</title><description>&lt;p&gt;Today I &lt;a href="http://svn.danwebb.net/external/lowpro/tags/rel_0.5/"&gt;tagged Low Pro 0.5&lt;/a&gt; for release which now works with Prototype 1.6.  There are a number of things about this release that are worth mentioning aside from the compatibility.  Firstly, it’s gotten a little smaller as Prototype core now includes most of the functionality Low Pro used to add (DOM Ready support, inserting using &lt;span class="caps"&gt;DOM&lt;/span&gt; nodes and a lot more).  It’s also got a couple of new features so here’s a rundown:&lt;/p&gt;


	&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Event.onReady delegates to the new dom:loaded event&lt;/strong&gt;: Except that as before if functions are added after the &lt;span class="caps"&gt;DOM&lt;/span&gt; is loaded they fire immediately.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;DOMBuilder now delegates to Prototype’s new Element&lt;/strong&gt;: Now difference in usage here though, just less code.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Low Pro’s &lt;span class="caps"&gt;DOM&lt;/span&gt; methods are now gone&lt;/strong&gt;: Prototype core does everything you should need now.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Behavior.create() works just like the new Class.create()&lt;/strong&gt;: Yes, you can now create behavior classes that inherit from other behaviors (or indeed any other class).  &lt;a href="http://prototypejs.org/learn/class-inheritance"&gt;See the Prototype’s site for more information.&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;New core behaviors&lt;/strong&gt;: The Remote and Observed behaviors are now included in the core so you can now turn normal links and forms into Ajaxy links and forms even more easily.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Event.addBehavior.reassignAfterAjax is now false by default&lt;/strong&gt;:  Normally, if you are relying on this behavior it’s much more efficient to move to a solution using event delegation.  However, if you do want your behaviors reassigned to new content after Ajax calls then go ahead and set it back to true again.  Another solution is to manually call Event.addBehavior.reload();&lt;/li&gt;
	&lt;/ol&gt;&lt;p&gt;So that’s about it.  As you can see, it’s getting smaller as Prototype fills the gaps and graduating into more of a pure behavior framework.  I’d be interested in adding more core behaviors for other common tasks as well as possibly getting together some kind of behavior library.  I know I’m building up a fair few and I’d love to see what everyone else is doing (in fact I’ve already seen some great stuff) so suggestions are more than welcome…as are bug reports and patches.  For both of these and general assistance try &lt;a href="http://groups.google.co.uk/group/low-pro"&gt;the Google Group&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://svn.danwebb.net/external/lowpro/tags/rel_0.5/dist/lowpro.js"&gt;Grab the new version&lt;/a&gt; and have a play.&lt;/p&gt;</description><link>http://danwebb.tumblr.com/post/214656310</link><guid>http://danwebb.tumblr.com/post/214656310</guid><pubDate>Wed, 12 Dec 2007 00:23:00 +0000</pubDate><category>javascript</category><category>lowpro</category><category>release</category><category>tech</category></item><item><title>@media Ajax</title><description>&lt;p&gt;Well, that turned out rather nicely I must say.  Really high quality presentations and great attendees – I really hope that Patrick makes it happen again.  Here are the slides from my presentation:  Metaprogramming JavaScript.&lt;/p&gt;


&lt;div style="width:425px;text-align:left;margin-left:6em" id="__ss_174396"&gt;&lt;object style="margin:0px" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=metaprogramming-javascript-1195638729182448-3"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=metaprogramming-javascript-1195638729182448-3" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"&gt;&lt;a href="http://www.slideshare.net/?src=embed"&gt;&lt;img src="http://static.slideshare.net/swf/logo_embd.png" style="border:0px none;margin-bottom:-5px" alt="SlideShare"/&gt;&lt;/a&gt; | &lt;a href="http://www.slideshare.net/danwrong/metaprogramming-javascript" title="View 'Metaprogramming  JavaScript' on SlideShare"&gt;View&lt;/a&gt; | &lt;a href="http://www.slideshare.net/upload"&gt;Upload your own&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;

	&lt;p&gt;In other news, Low Pro 0.5 is nearly ready to rock.  The new version is quite a lot smaller as Prototype 1.6 has solved so many of the things I used to fix with Low Pro.  It does however have a few nice new features.  Watch this space.&lt;/p&gt;</description><link>http://danwebb.tumblr.com/post/214656279</link><guid>http://danwebb.tumblr.com/post/214656279</guid><pubDate>Thu, 22 Nov 2007 10:09:00 +0000</pubDate><category>javascript</category><category>lowpro</category><category>atmedia</category><category>presentation</category><category>metaprogramming</category><category>event</category><category>atmediaajax</category><category>tech</category></item></channel></rss>
