What is (functional) reactive programming?

If you want to get a feel for FRP, you could start with the old Fran tutorial from 1998, which has animated illustrations. For papers, start with Functional Reactive Animation and then follow up on links on the publications link on my home page and the FRP link on the Haskell wiki. Personally, I like … Read more

Does JavaScript have a method like “range()” to generate a range within the supplied bounds?

Numbers […Array(5).keys()]; => [0, 1, 2, 3, 4] Character iteration String.fromCharCode(…[…Array(‘D’.charCodeAt(0) – ‘A’.charCodeAt(0) + 1).keys()].map(i => i + ‘A’.charCodeAt(0))); => “ABCD” Iteration for (const x of Array(5).keys()) { console.log(x, String.fromCharCode(‘A’.charCodeAt(0) + x)); } => 0,”A” 1,”B” 2,”C” 3,”D” 4,”E” As functions function range(size, startAt = 0) { return […Array(size).keys()].map(i => i + startAt); } function … Read more

map function for objects (instead of arrays)

There is no native map to the Object object, but how about this: var myObject = { ‘a’: 1, ‘b’: 2, ‘c’: 3 }; Object.keys(myObject).forEach(function(key, index) { myObject[key] *= 2; }); console.log(myObject); // => { ‘a’: 2, ‘b’: 4, ‘c’: 6 } But you could easily iterate over an object using for … in: var … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)