Better HN
topnewbestaskshowjobs
Log inSign up

feliperibeiro

10 karma · joined Jul 4, 2012 (14y ago) · 12 submissions

Submissions

1.

Spotify Client 1.x beta for Linux has been released(community.spotify.com ↗)

2 points · by feliperibeiro · 11y ago · discuss

2.

Algorithms, Data Structures and Web Development(medium.com ↗)

2 points · by feliperibeiro · 11y ago · discuss

comment 12y ago · link · parent

I've been doing this sporadically and in my free time, just for fun, so there are a lot of fundamental things that haven't been covered there. :)

comment 12y ago · link · parent

You're right. This is the subtraction-based implementation, the division-based is the original and better one :)

https://github.com/felipernb/algorithms.js/commit/e5a04f9ad0...

comment 12y ago · link · parent

Exactly! Also, many JS devs are clueless about CS101 basic things, it's a way to maybe make them a bit interested.

From the wiki (https://github.com/felipernb/algorithms.js/wiki):

  The intention is to blend academic concepts with the
  JavaScript bits of insanity, applying Atwood's Law to CS101.

comment 12y ago · link · parent

Still this is an issue with the algorithm, not the implementation.

http://en.wikipedia.org/wiki/Euclidean_algorithm

comment 12y ago · link · parent

This is the Euclidean algorithm for GCD, it's naive and simple. But if you see it more carefully, the commit that says "Optimized performance ..." contains just the lines:

  34      var tmp = a;
  35	  a = Math.max(a, b);
  36	  b = Math.min(tmp, b);
  37	  if (a % b === 0) return b;
to avoid the unnecessary repetitions if b is already the GCD

8.

Design Patterns Can Be Evil(blog.feliperibeiro.com ↗)

3 points · by feliperibeiro · 12y ago · discuss

comment 13y ago · link · parent

This is a complicated issue, but in my opinion the google/facebook style of interview is the one that gives you less false positives, even though it gives tons of false negatives. In other words, very few people who can do it are bad coders (false positives), but many good coders can't do it (false negatives).

So, as companies like Google and Facebook have so many applications, they're much more concerned about false positives than false negatives.

10.

How do you sharpen your saw?(blog.feliperibeiro.com ↗)

1 points · by feliperibeiro · 14y ago · discuss

11.

When not to use a tool(blog.feliperibeiro.com ↗)

1 points · by feliperibeiro · 14y ago · discuss

12.

This is not another "PHP Sucks" article(blog.feliperibeiro.com ↗)

2 points · by feliperibeiro · 14y ago · 1 comment