FOSDEM 2012 – hotels and useful info.

If you are going to Fosdem 2012, here is some useful hotel info.

  • Hotels near to Grand Place and to the Delirium Cafe (yes, the party is there). This location is near to all sights and it’s good idea to stay here instead near to the FOSDEM venue;
  • Cheapest hotels in Brussels.
  • Hotels near to the ULB – the venue
  • The nearest hostel to the Venue is Hostel Brussels Louise (Price is about 19E/person/day)

 

Personally I can recommend CitaDines apartments, because there is a small kitchen included into the price and you can make a dinner or breakfast. If you are more than 2 people, they can offer you a really great offer and it’s near to the bus stop for FOSDEM bus.

 

FOSDEM

FOSDEM is a free and non-commercial event organized by the community for the community. The goal is to provide Free Software and Open Source developers and communities a place to meet to:

  • + Get in touch with other developers and projects;
  • + Be informed about the latest developments in the Free Software and Open Source world;
  • + Attend interesting talks and presentations held in large conference rooms by Free Software and Open Source project leaders and committers on various topics;
  • + To promote the development and the benefits of Free Software and Open Source solutions.
  • + and to SHARE knowledge with each other

Sharing the knowledge and ideas is the most valuable think you can get during FOSDEM and it’s free. There is no excuse not to be there.

If you are worried about anything, just feel free to ask me and I will help you, especially if this will be your first visit. If you are living for Free software NOR Open Source – you must be there.

(cc) Image is under CC lisense by bertogg

Put some Agile into your community

Finding a way to stimulate/encourage your community to do stuff can be a very difficult task.  I will show you an Agile-like approach to do that and actually it works pretty well, but remember:

Don’t try to control your community, try to manage it.

Create the infrastructure

  • Get an account in Trello.
  • Define your basic iteration period. Let say 2 weeks.
  • Define tasks.

Don’t try to find people who want to contribute.

“What? Are you serious?”

Hell yeah. Try to create tasks first. Put anything you think can be doable in the next 2 weeks (This is your main task).

You can start from “we need someone to tweet using our account” , “we need a new wiki” or something more interesting like “we need someone to be responsible for beer giveaways”

Ready?

Invite

Ok, now invite ALL community members to create an account and to look at the task.

Let them:

  1. Vote for the tasks.  See how community see the importance of the tasks.
  2. Add themselves to a task. It’s a common mistake project manager/leader/the big boss to assign someone to a task. Don’t do that!

Teams

Now you can see which people are willing to work together on a certain task and you can create a new board for them.

Let say you have a task website on the main board:

And there are 10 people that want to contribute to it. Move them to another board and let them create tasks, with a simple workflow:

Todos > Working on > Done:

Meetings

If you have well working community or some kind of core contributors, you can start every iteration with a meeting and to define all the tasks together.

Why?

  • This approach will help you a lot to do things faster. Remember define only tasks that can be done in 2 weeks (or 3 weeks). It’s much easier to create a simple skeleton of your website with most, most important functionalities (like who we are and join us) than to plan and create whole website in 2 months.
  • Step by step
  • Build a community and respect your community member’s skills.
  • Invite anyone to join and to help. It’s kind of easy to find someone to write a post in a forum or to contact a media representative, because this takes 3-4 minutes.
  • Get things done!


Face Recognition with Node.js

It’s pretty simple to have a basic face recognition in Node.js using the Face.com API.

Pre-Requirements :
0. You will need apikey and api-secret from face.com. You can obtain them by clicking here.

1. I am using a package called restler to handle REST requests.

npm install restler

Here is the code:

var sys = require('sys'),
     api = require('restler');


var api_key = '....';
    api_secret = '...'
    image_url = 'http://farm6.static.flickr.com/5127/5284942130_ab25c2dafd_b.jpg'; 
    
api.get('http://api.face.com/faces/detect.json?api_key='+api_key+'&api_secret='+api_secret+'&urls='+image_url).on('complete', function(data) {
  sys.puts("the object gender is: "+ data.photos[0].tags[0].attributes.gender.value + ". I am  "+data.photos[0].tags[0].attributes.gender.confidence+" % sure");
  sys.puts("The object is smiling: "+ data.photos[0].tags[0].attributes.smiling.value + ". I am  "+data.photos[0].tags[0].attributes.smiling.confidence+" % sure");
});

The script returns object gender and is it smiling or not.


Change the picture and be amazed by the results. Click here for the detailed API explanation and more examples.

P.S Here is an interesting project – Face.js

MongoDB, Node.js and admin auth

There is a big challenge to make MongoDB driver to work with Node.js, but here is an cool and working example to do that:

Require:

var mongodb = require("mongodb"); //require node-mongodb-native
var settings = require('./mconfig'); //for settings

Connect to the admin database:

var mongoserver = new mongodb.Server(settings.mongo_host, settings.mongo_port, {});
admindb = new mongodb.Db('admin', mongoserver);	

Try to auth with admin cretentials:


exports.adminlogin = function(callback) {

		admindb.open(function (error, client) {
			
			admindb.authenticate(settings.mongo_user, settings.mongo_pass, function (err, val) {
		        if (err) {
		             callback(0);
		        } else {
		            	callback(1);
		          		         
		        }
   		 });

 	 });
	
	
};

It returns 1 on success and 0 on failure.

Full HTTPS REST server in Node.js

I will show you now, how to write a simple HTTPS JSON REST server using node.js components. Grab a beer, open your IDE and let’s start hacking.

0. Create certificates.

If you don’t have valid https certificates, you can generate one for testing purposes. If you need one cool certificate, you can join cacert community. Anyway, let’s openssl for a while:

openssl genrsa -out privatekey.pem 1024 
openssl req -new -key privatekey.pem -out certrequest.csr 
openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem

1. Install additional modules.

We will need just one aditional module, called journey.

It’s working only in JSON mode, but anyway I don’t like XML REST at all. JSON is the future, baby.

npm install journey

2. Writing the router.js file.

– Define the modules required:

var journey = require('journey');
var https = require('https');
var fs = require('fs');

– Define the certificates part:

var privateKey = fs.readFileSync('../certs/privatekey.pem');
var certificate = fs.readFileSync('../certs/certificate.pem');

var options = {
  key: privateKey,
  cert: certificate
};

– Define the router that will handle all REST requests (GET, POST, PUT, DELETE):

var mrouter = new (journey.Router)();

– Define the map of all requests. In other words what to do when the router receive a request:

mrouter.map(function () {
// Default URL
this.root.bind(function (req, res) { res.send("Welcome to my application") });

//GET request on /databases
this.get('/databases').bind(function (req, res) {
do something
});

//GET request on a specific database - /database/users21
this.get(/^databases\/([A-Za-z0-9_]+)$/).bind(function (req, res, id) {
	 //id contains 'users21' part       
 });

/**PUT request example. 
* You can deal with as many parameters as you need, just write the regexp for it and assign a parameter. 
* Here is an example to update a document on a collection on MongoDB database. 
* We have 3 user parameters - 6 parameters in URL:
**/
this.put(/^databases\/([A-Za-z0-9_]+)\/collections+\/([A-Za-z0-9_]+)\/documents+\/([A-Za-z0-9_]+)$/).bind(function (req, res, dbid, collid, docid, data) {
	        res.send('update '+docid+ 'in '+collid + 'on: '+ dbid);
 });
}); //end mapping

3. And the last thing we should do is to turn on the HTTPS server and the router

https.createServer(options,function (request, response) {
    var body = "";

    request.addListener('data', function (chunk) { body += chunk });
    request.addListener('end', function () {

        mrouter.handle(request, body, function (result) {

            response.writeHead(result.status, result.headers);
            response.end(result.body);
        });
    });
}).listen(8081);

4. Run and connect your JSON client on httpS://127.0.0.1:8081 to test it.

node router.js

One file to rule them all

Here you can see the whole WORKING simple app including nice tricks like adding settings and whole bunch of regexp examples for handling the URL parameters.

Enjoy!