{code, programming, news, dev_stuff};
April 6, 2011
Liskov substitution principle

If S is a subtype of T, then objects of type T in a program may be replaced with objects of type S without altering any of the desirable properties of that program


If it looks like a duck, quacks like a duck, but needs batteries – you probably have the wrong abstraction

http://en.wikipedia.org/wiki/Liskov_substitution_principle

March 26, 2011
databending for dummies

Cool eh?

March 19, 2011
Large, informative and AWESOME HTML5 Cheatsheet →

(Source: saimaali)

Stackoverflowizer - Chrome Extension →

This is a simple Chrome extension that redirects to Stackoverflow from pages that just copy content, like efreedom, questionhub, answerspice (and many more)

(Source: petekp)

March 18, 2011
Don’t Distract New Programmers with OOP

http://prog21.dadgum.com/93.html

When I get asked “What’s a good first programming language to teach my [son / daughter / other-person-with-no-programming-experience]” my answer has been the same for the last 5+ years: Python.

Me consta que Python es mucho mas fácil que muchos lenguajes como C#, vb.net y java y ni decir de c/c++

via mashable.com

via mashable.com

March 17, 2011
via http://abstrusegoose.com

via http://abstrusegoose.com

March 14, 2011
$.getImageData

$.getImageData es un plugin para jquery que nos permite obtener el “data:image” (a.k.a “image base64 encoded data URL”) de una imagen para poder procesarla localmente, ¿y esto para que?

Supongamos que tenemos un canvas llamado cancan

<canvas id=”cancan” width=”10” height=”10”></canvas>

y supongamos que queremos cargar una imagen desde flickr para llenar el canvas

var canvas = document.getElementById(‘cancan’);

var ctx = canvas.getContext(‘2d’);

var myimage = new Image();

myimage.onload = function () { 

 ctx.drawImage(myimage, 0, 0);

};

myimage.src = ‘http://farm1.static.flickr.com/209/499409303_bfe28ec063.jpg’;

ahora intentemos acceder a uno de los pixeles 

ctx.getImageData(0, 0, 1, 1).data;

¡¡taran!! el error “Error: SECURITY_ERR: DOM Exception 18”

¿que pasa?

por cuestiones de seguridad no podemos acceder a informacion de recursos cargados remotamente, ya saben “por cuestiones de seguridad”.

y aquí es cuando entre en accion $.getImageData

solo tenemos que incluir el script  

<script type=”text/javascript” src=”jquery.getimagedata.min.js”></script>

y agregar las siguientes lineas de codigo

$.getImageData({

        url: “http://farm1.static.flickr.com/209/499409303_bfe28ec063.jpg”,

        success: function (image) {

            ctx.drawImage(image, 0, 0);

            var p = ctx.getImageData(0, 0, 1, 1).data;

        }

    });

y listo!

$.getImageData se conecta al sitio “img-to-json.appspot.com” y nos convierte la imagen en json. [cool! no?], también podemos cambiar el sitio por defecto si queremos pero esa es otra historia.

Mas info aquí: http://www.maxnov.com/getimagedata/

¿El fin de AjaxControl ToolKit a manos de JQuery?

leyendo un interesante articulo sobre como JQuery va ganado terreno que antes era del AjaxControl Toolkit llego a la conclucion de que todavia falta mucho camino para que jquery pueda derrocar a el ajaxcontrol toolkit.

aquí mi humilde opinión 

Postdata:

No todos los desarrolladores .net son iguales, yo soy de los que prefiere hacer un llamado ajax a mano antes de poner una grilla y 15 controles dentro de un updatepanel, pero levante la mano el que no trabajo o conoció a alguien que lo hacia o lo hizo ;)

aquí el articulo [Is it the end for the AJAX Control Toolkit ?]

*esa definición me la acabo de inventar 

If debugging is the process of removing software bugs, then programming must be the process of putting them in.