Páginas

domingo, 7 de octubre de 2012

Class 101

Some days ago I finally was able to finish the problems that I got with DataChannel-polyfill and published a version using them so the guys from the WebP2P group could be able to test it. The fact was that regarding this, the first feedback I received* was about don't know how to use it, so I put my "plain user hat" on and got where was the problem.

Althought I was developing ShareIt! with usability and accesibility in mind, the fact was that being at a development stage I was thinking more about the developer (the guy that will go to GitHub and download the code) instead of the final user or just the curious, so the demo that I have uploaded to 5Apps didn't make a sense to them. This is the reason why in the last days I have been developing a "Start here" div that will be showed when there's no active sharings or downloads, with the tabs disabled and a big arrow pointing to the main menu, and also some links to the starting points of the app. This way also it could be used as a presentation page, so finally I developed the app logo and favicon (just a pretext to learn to use Inkscape... :-P), so now the app at 5Apps will looks prettier with a custom logo instead of the default one :-)

Tomorrow I'll put a little tutorial about how I did it ;-)

* the second one was about requesting collaborate in the project to integrate it in AtomOS as a FTP-like communications layer :-)

sábado, 6 de octubre de 2012

Si pagas en cacahuetes tendras monos


Oferta de trabajo que he recibido en el correo de una consultora:

Urge Programador C/unix
...
Requisitos: OBLIGATORIO:
- Experiencia REAL en lenguaje C sobre Unix (al menos 6 meses).
Requisitos deseados:
- Experiencia trabajando alguna de las siguientes tecnologías: C++, ProC, SQL contra Oracle, Tuxedo, Webservices.
...
Salario mínimo: 12.000 Euro
Salario máximo: 18.000 Euro
...
Por favor ,necesitamos perfiles ADECUADOS al salario de la oferta.

¿Mande? ¿"Urge" un programador C con experiencia en ProC, Tuxedo y Oracle (que siendo algo tan especializado y que requiere de alguien experto entiendo que si les corre prisa es porque se les ha echado el tiempo encima por una mala gestion) y aun asi solo ofrecen como maximo 18k y piden "por favor" que los perfiles sean "adecuados" al salario de la oferta?

Lo dicho: si pagas en cacahuetes tendras monos ¬¬

viernes, 5 de octubre de 2012

ShareIt! working over DataChannel-polyfill


I could be able to finish it two days ago (after an entire week -and weekend- going to sleep after 3:00 AM :-P) but I have been busy this two days with university. Anyway, I have finished to debug the code and now ShareIt! is using DataChannel-polyfill to do the communications between the peers. Also, I needed to develop an IndexedDB polyfill to by-pass the Chrome bug related to storing Blob objects, so there's no persistence but I could be able to continue with the experiments :-)

The only drawback I have seen is that communications were really slow (about 25-30 seconds just for a 500KB image) until I got on the fact i have a 10Mbps/1Mbps ADSL line, so I tested it using a DataChannel-polyfill backend server on localhost and it downloaded in just 2 seconds, so maybe it was a problem with my limited line upload. The good part is that for the tests i used Chrome SpeedTracer and didn't look any unusual (except comunication peaks were about each 5 seconds), so the app is very responsible :-) Also i have developed the code on a library way, so it could be exported to other projects (althought previously it needs some documentation and port the original, simple interface to it as a proof-of-concept).

Finally, you can test it (currently only on Chrome, DataChannel-polyfill is giving me problems on Firefox) at http://shareit.piranna.5apps.com, running against a handshake server and a datachannel backend server that I have hosted on two Nodejitsu testing sandboxes.

And obviously, you can get the code on GitHub :-D Things were I would need some help from now are related with the Kademlia implementation for searches (I was thinking about using KadOH), and file hashes where I would like to use Tiger TTH, but currently there's no JavaScript implementation. Another point I have been thinking about this days is just use the SDP IDs to do the handshake directly over the DataChannels, so there will be no need to use handshake or backend servers at all, but this need some investigation (a friend of mine told me that SDP IDs would expire in a few minutes so I can't be able to have a PeerConnection object ready to accept incoming connections just to do the handshake, any clue about this?).

And this is all for now. As usual, any comments or suggestions are welcome :-)

Online Python Tutor

Online Python Tutor, un tutor online de Python, que no solo permite hacer pequeños programas para aprender sino que ademas te muestra paso a paso todo lo que sucede internamente con una animacion: asignacion de variables, llamada a funciones, datos en la pila de programas... El unico pero que le veo es la reasignacion de variables que queda un poco confusa (un paso intermedio para mostrar el recolector de basura funcionando seria mucho mas claro y realista), pero si algo asi se usara en primero de carrera se prevendrian despues muchos dolores de cabeza... :-D

jueves, 20 de septiembre de 2012

What is WebRTC?

http://lincolnloop.com/blog/2012/sep/12/what-webrtc/

What is WebRTC, one of the most important building block of ShareIt!, explained for non-techies: what is, what is intended for and what is the current status of this technology. Cool :-)

sábado, 8 de septiembre de 2012

DataChannel polyfill


Han sido tres semanas de duro trabajo, pero finalmente he terminado una implementacion de DataChannel usando WebSockets :-D

Obviamente, no es P2P porque necesita un servidor funcionando como proxy entre los pares, pero puesto que lo he desarrollado a partir de la especificacion deberia ser compatible con su API cuando haya una implementacion nativa en Chrome o Firefox a final de año, o al menos deberia ser util para empezar a trabajar con una mentalidad distribuida en lugar de basada en servidor (esto es lo que mas me ha costado mientras desarrollaba la implementacion :-P ) y probar nuestras aplicaciones. Usarlos es tan simple como incluir datachannel.js en el codigo HTML (despues de cambiar la URL del servidor puesto que actualmente esta metida a pelo), arrancar el servidor proxy y listo, a partir de aqui es completamente autonomo :-D

El codigo se puede encontrar en https://github.com/piranna/DataChannel-polyfill. Tambien tengo una version modificada del codigo de la demo y del cliente de WebRTC.io que he usado para probarlo (sustituyendo el pequeño chat que tienen hecho basado en servidor a una arquitectura P2P enviando los mensajes a todos los pares conectados) que pueden encontrarse en https://github.com/piranna/webrtc.io-demo/tree/polyfill y https://github.com/piranna/webrtc.io-client/tree/polyfill y tambien he hecho un pull-request para que lo añadan en su rama maestra. Por favor mandadme cualquier comentario, consejo o mejora que le veais al codigo :-)

P.D.: por si alguien anda perdido, WebRTC es la especificacion que esta desarrollando para poder conectar los navegadores web directamente entre ellos sin necesidad de un servidor entre medias, y aunque en las ultimas version de Chrome y de Firefox ya hay soporte para realizar videoconferencia directamente desde el navegador y hay algunas aplicaciones que ya empiezan a usarlo (incluso Skype va a cambiar su protocolo para acogerse al estandar), lo cierto es que el soporte para el envio de datos todavia esta por definir y no hay ningun navegador que lo soporte hasta final de año, por lo que para ir preparandome para entonces y poder ir adaptando el codigo para estar listo he desarrollado esta libreria siguiendo la especificacion para que el codigo sea compatible de cara al futuro.

miércoles, 11 de julio de 2012

Achievement unlocked: Chinese spaghetti code

Dos dias y medio peleandome con la funcion de inicializacion de una tarjeta capturadora profesional cuyo codigo de ejemplo no se ajustaba a las especificaciones de la documentacion del fabricante y que devolvia un codigo de error no documentado y totalmente ilogico y descabellado, y descubrir que el problema estaba en que faltaba copiar una libreria dinamica de la cual no hay constancia en ninguna parte y el framework de la tarjeta no echaba en falta en ningun momento ni lanzaba ningun mensaje de error.

He visto cosas que jamas creeriais, returns incondicionales en mitad de una funcion sin venir a cuento, sistemas criticos sin tests cuya configuracion te obligaba a tocar 5 archivos distintos... pero lo de estos chinos no creo que lo supere nada. Despues de esto creo que ya estoy listo para retirarme al Tibet a dedicarme a la meditacion y encontrar mi yo interior...