• YUI: click on disabled buttons

    October 16, 2009

    Surprisingly, I’ve discovered that disabled YUI buttons fire events regardless their state and YUI API: disabled – Boolean indicating if the button should be disabled. (Disabled buttons are dimmed and will not respond to user input or fire events. Does not apply to button’s of type “link.”) After some debugging I found the reason for […]

  • JavaScript: sort an array

    October 13, 2009

    For some reason I needed to sort an array of objects by their ‘url’ property. Array’s sort method accepts a sort function and initially my code looked like: function sortFunc(a, b) { return a.url > b.url; } list.sort(sortFunc); I was developing with FF and this code worked fine. However, other browsers refused to sort the […]

  • SQLAlchemy smooth queries

    October 2, 2009

    Suppose we have a table A and a child table B and we need the following queries: Select all records from A where their Title like ‘something’; Select count of records in the result of the previous one; Select all records from A that have children in B and Title like “something”; Select all records […]

Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org