Category Archives: Blog

Like most nights, tonight I was reading the public GitHub News Feed to keep up with interesting projects that people I follow might create, follow or contribute to. One that caught my eye immediately is a project called FCBKcomplete, currently with over a 100 followers and 22 very active forks.

As I was glancing the list of files, I notice one called close.gif, which specially intrigued me: when I released the initial version of my project TextboxList (MooTools, jQuery), that’s exactly what I had called the sprite image which contained the normal, hover and active states of the boxes close buttons.

But there was a small problem: in the entire GitHub repository, I couldn’t find a single mention of my name or my website.

The early days of TextboxList

Around January 2008, I announced the first open source widget released under the MIT license intended to mimic the behavior of the Facebook tokenizer.

The header of the source file, still up today, contains two interesting bits:

Credits:
  - Idea: Facebook + Apple Mail
  - Caret position method: Diego Perini 

I included credit for the ideas and sources of inspiration, and for a relevant key piece of source code which had been written by another developer.

The second interesting bit is my copyright message:

/* Copyright: Guillermo Rauch  - Distributed under MIT - Keep this message! */

When I started writing this project, I was a 16-year-old high school student trying to seek some recognition for a piece of work given away for free. Today, with the message formatting unchanged we can find:

/* Copyright: Emposha.com  - Distributed under MIT - Keep this message! */

The problems

  1. The file close.gif was copy-pasted
  2. The stylesheet was entirely copy-pasted.

    For the first release of the project, I wrote an article about the thought process behind the creation of the widget.

    One of the core ideas emphasized in it is that you should start by having the markup and CSS be as bullet proof as possible, as you don’t want to hinder the JavaScript development with debugging related to style, positions, floats, and you don’t want to solve problems within JavaScript that CSS alone can solve. Years later, this is still a design principle I live by for the creation of web applications

  3. At 550 lines of code, it has considerably less features than my very old version at 350 lines of code. Namely, no keyboard navigation of the boxes, one of the premises of the original Facebook tokenizer.

    Since my first release, the entire codebase was re-written, with full documentation and many more characteristics. This version wasn’t released under MIT. However, hundreds of people are using it for free, others have chosen to willingly contribute (as I have no mechanisms to prevent unfair use), and special licenses were given to open source projects, companies with dozens of subdomains and very well known web application makers.

  4. Many parts of the code show a striking resemblance, which of course is not coincidental.
  5. Even the JSON data used to feed autocompletion values, which is a collection of my favorite argentinean writers, has been blatantly reproduced. Quite interesting considering the author seems to be from Israel, and I’m sure he wasn’t just including it out of passion for good foreign literature.
  6. Under these conditions, it managed to sneak dozens of commits from people in the community, including Chris Williams. It’s left for me to wonder if they ever learned of all the effort that took me to research this particular problem and execute its solution, now shown to the world under a very intriguing brand.

Update: special thanks to Chris Williams who updated his fork to reflect proper copyright

For those of us who didn’t make it, I’ve compiled a list of slides + blog posts from the JSConf 2010 Track A speakers

Alex Russell – “Google Chrome Frame”
Post: http://alex.dojotoolkit.org/
Slides: http://alex.dojotoolkit.org/10/jsconf/gcf.html

Francisco Tolmasky – “Socratic: Documentation Done Right”
GitHub: http://github.com/tolmasky/socratic
Slides: ?

Aaron Newton – “Programming To Patterns”
Slides: http://www.slideshare.net/guest2ee5e2c/programming-to-patterns-presentation (not up-to-date)

Jed Schmidt – “A (fab) approach to web apps”
GitHub: http://github.com/jed/fab
Slides: http://www.flickr.com/photos/tr4nslator/sets/72157623883700702/show/

Dmitry Baranovskiy – “RaphaĆ«l the Great”
Slides: http://www.slideshare.net/Dmitry.Baranovskiy/raphal-js-conf

Douglas Crockford – “Really, JavaScript?”
?

Tobias Schneider – “Flash is dead, long live Flash!”
GitHub: http://github.com/tobeytailor/gordon
Slides: http://www.slideshare.net/ConfEcho/flash-is-dead-long-live-flash

Makinde Adeagbo – “Primer: Facebook’s 2k of JavaScript to power (almost) all interactions”
Slides: http://www.slideshare.net/makinde/javascript-primer

Steve Souders – “The Best of Steve”
Slides: http://www.slideshare.net/souders/jsconf-us-2010

Jenn Lukas – “JavaScript and Web Standards Sitting in a Tree”
Slides: http://www.slideshare.net/JennLukas/javascript-and-web-standards-sitting-in-a-tree

Ryan Dahl – “Less is More in Node.js”
Slides: http://nodejs.org/jsconf2010.pdf

Billy Hoffman – “JavaScript’s Evil Side”
Slides: ?

John David Dalton – “All you can leet”
Slides: http://www.slideshare.net/johndaviddalton/jsconf-all-you-can-leet

Aaron Quint – “Making Bacon / Making Code”
GitHub: http://github.com/quirkey/sammy
Post: http://www.quirkey.com/blog/2010/04/20/making-baconmaking-code-jsconf-2010/
Slides: http://swinger.quirkey.com/#/preso/aq-jsconf/display/1
Video: http://bit.ly/9j7u3L

Dion Almaer, Ben Galbraith, and Matt McNulty – “The mobile web”
Slides: http://www.slideshare.net/dion/the-mobile-web-2010-jsconf

I just pushed node.dbslayer.js to GitHub, a very basic and easy-to-use interface to DBSlayer.

What is DBSlayer?

The DBacesslayer aka DBSlayer is a lightweight database abstraction layer suitable for high-load websites where you need the scalable advantages of connection pooling. Written in C for speed, DBSlayer talks to clients via JSON over HTTP, meaning it’s simple to monitor and can swiftly interoperate with any web framework you choose.

Developed by the New York Times to distribute the load of their MySQL servers, DBSlayer allows us to perform queries in a non-blocking way. Running a SQL query is as simple as:

connection.query("SELECT * FROM TABLE").addCallback(function(result){
	for (var i = 0, l = result.ROWS.length; i < l; i++){
		var row = result.ROWS[i];
		// do something with the data
	}
});

Have fun!

As part of the very comprehensive suite of packages Google GO is bundled with, a WebSocket server seems to be in the works:

http://code.google.com/p/go/source/browse/src/pkg/websocket/

Makefile
client.go
server.go
websocket.go
websocket_test.go

This is how you define a handler in GO’s WebSocket:

package main

import (
   "http"
   "io"
   "websocket"
)

// echo back the websocket.
func EchoServer(ws *websocket.Conn) {
     io.Copy(ws, ws);
}

func main() {
  http.Handle("/echo", websocket.Handler(EchoServer));
  err := http.ListenAndServe(":12345", nil);
  if err != nil {
      panic("ListenAndServe: ", err.String())
  }
}

Using node.websocket.js, it’d boil down to starting up the server:

$ node runserver.js --port="12345"

and defining the modules/echo.js handler:

this.onData = function(data, conn){
   conn.send(data);
}

I’d be interested in seeing how well GO performs with many simultaneous, long-lived clients.