Makefile for rust projects
Personal Coding and Hobby Notebook
It was about 15 years ago when I first created my first class. I went from thinking of Object Oriented programming as this awesome paradigm I should know about, I remember having all these mental models of what objects where and learning all this new vocabulary that I really didn’t fully grasp until years later […]
[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 […]
On this one, we’ll show of the dynamic nature of javascript and we’re going to make all strings have a new method called “capitalize()”. So you can do stuff like this: [javascript] console.log("this text should look nicer now".capitalize()); >> This Text Should Look Nicer Now [/javascript] Here’s the magic code you’ll need to add somewhere […]