Related Posts
How to shuffle a List (or Array) in Javascript
[javascript] /** * Returns number starting from offset up to n-1 */ function getRandomWithOffset(n,offset) { return Math.floor(Math.random()*n+offset); } /** * Returns random integer from 0 to n-1 */ function getRandom(n) { return getRandomWithOffset(n,0); } /** Fisher–Yates shuffle algorithm O(n) */ function shuffleList(list) { for (var i=list.length-1; i>0; i–) { var j = getRandom(i+1); var buffer […]

My Git Cheat-sheet
I don’t know if it’s the crazy syntax, but for the life of me, I always need to come back to this cheat sheet, maybe you will too: GIT CHEATSHEET fetch remote branch. git fetch origin nameofbranch “fetch” downloads the changes of the remote branch but doesn’t automatically merge them. If you have commited local […]
How to use environment variables in your Eclipse project Run Configuration
Say you have some environment variables that you’d love to use as arguments of an executable in your project. 1. Go to “Run Configurations” 2. Click on the “Environment” tab. 3. Click the “Select” button. 4. A list with all of your environment variables will be shown. Choose the environment variables you need for this […]