Profile cover photo
Profile photo
Ricardo Ferraz Leal
Scientist, photographer, world traveller, runner, biker, even geek...
Scientist, photographer, world traveller, runner, biker, even geek...
Ricardo's interests
View all
Ricardo's posts

Post has attachment
Replace Conditional with Polymorphism
Trying to convince my team to give up on if/then/else & case... Let's play with some code! First the the non Object Oriented / procedural version: /*  * non_oop.cpp  *  * Created on: Sep 4, 2015  * Author:  *  * Non OOP example ...

Post has attachment
Just for fun
64 cores, 512 GB of memory...

Post has attachment
JQuery autocomplete with ranged fields
Few weeks ago I was looking for a way to get a form field autocomplete from a remote JSON file with a single HTTP request. the solution is  here . Now I want to do the same but using ranged fields (i.e., sort of an array where commas and hyphen mean ranges)...

Post has attachment
Writing post in markdown for your blog
Just write your markdown here: And copy paste from the right pane :) That's all!! Flavoured (i.e., github) Markdown syntax is available here:

Post has attachment
Git: Going back in time
1. Testing stuff on a old commit # This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32 Or: # This will create a new branch to play and make new commits
git checkout -b old-state 0d1d7fc32 2. Getting rid of every...

Post has attachment
Git: Delete Branch Remote and Locally
Delete the branch remotely: git push origin --delete And then (or the other way around) delete it locally: git branch -D

Post has attachment
Git Roll Back
Rolling back to a previous commit: Only and if only you are working by your self! (This is dangerous in a collaborative environment: we are rewriting history!) git reset --hard git push -f origin Note, if by any reason you want to have access to the  lost  ...

Post has attachment
Getting your pocket content delivered to your Kindle touch
I wanted to have the articles I save in my  Pocket  emailed to my old kindle touch... I hate reading in LCDs so I used for a while the  en2kindle  until the point it became paid. It's not expensive but after checking the  python wrapper for the pocket api I...

Post has attachment
JQuery JavaScript autocomplete with remote json
Because it took me ages to figure it out: - No dynamic JSON request - One and a single one request to the remote location. Here the code: /* Function to populate the autocomplete from a remote json. */ function set_autocomplete ( selector , jsonurl ) { $ . ...

Post has attachment
Wait while more posts are being loaded