Live data from Hacker News

Graphing when your Facebook friends are awake

defaultnamehere.tumblr.com

151–160 of 200 posts

Re: Graphing when your Facebook friends are awake

#153

> If you reload the page you’ll see approximately fifty-bajillion network requests go off as Facebook desperately tries to load all the junk that it needs to display facebook.com. I like this part. As a developer I've often looked at the network usage of large websites / web applications and it's always surprising to me just how...unoptimized it is as far as network connections go. I mean Facebook loads decently enou…

> I like this part. As a developer I've often looked at the network usage of large websites / web applications and it's always surprising to me just how...unoptimized it is as far as network connections go. Have you considered that your opinion on the best way to serve data to a billion users might actually be wrong? That maybe Facebook actually knows what they are doing?

This is the company that bragged about having 18,000 classes for their iOS app [1] and having to patch the Dalvik Virtual Machine to support new features in their Android app [2]; they are not infallible.

[1] http://quellish.tumblr.com/post/126712999812/how-on-earth-th...

[2] https://www.facebook.com/notes/facebook-engineering/under-th...

Re: Graphing when your Facebook friends are awake

#154

Earlier quoted context omitted.

I find myself reminded of the "for dummies" series of books. they are written in a humorous tone, and intersperse joke drawings between the chapters.

I have wanted to write a series of "X for mathematically inclined idiots" for several years. If you're going to pick a baseline...

I'd probably buy one or two.

In college, I was a mechanical engineer living with a CompSci major, CompE major, and a CompSci / CompE double-major. I'd occasionally stop them when they were explaining things to me with "Explain like I'm a MechE". Slightly less self-deprecating than "mathematically inclined idiot", but same gist.

Because of this, I was also quite useful as a rubber duck for debugging.

Re: Graphing when your Facebook friends are awake

#155
post #30

It would be real creepy if someone does the same thing for Whatsapp, you can even predict who's talking to each other much better than Facebook. It's a bit harder to collect data from web.whatsapp.com because it's using Websockets but let me know if someone develop such tool and publish it on Github. :)

You mean something like this? https://gitlab.maikel.pro/maikeldus/WhatsSpy-Public/wikis/ho...

Re: Graphing when your Facebook friends are awake

#156

Awesome and hilarious article. Id just like to note `for (;;);` is not to prevent users from using bad JSON parsers like `eval` but prevent older browsers with little to no cross domain policy from loading it with a script tag and doing evil XSS by overriding Array or Object constructors or prototypes to pull that data

Good point. Minor nitpick: I believe this is called CSRF, not XSS? But Im just repeating stackoverflow comments at this point.

No, CSRF (cross-site request forgery) is where a page tricks your browser into making requests to another domain in which you're already authenticated, in order to perform some kind of action. e.g. an img or script with a src "http://example.com/message.php?message=you+are+hax0red&s.... You can sometimes perform similar tricks with self-submitting hidden forms, or XHR. Quite easy to mitigate using nonces and referrer checking.

Re: Graphing when your Facebook friends are awake

#157
post #65

> If you reload the page you’ll see approximately fifty-bajillion network requests go off as Facebook desperately tries to load all the junk that it needs to display facebook.com. I like this part. As a developer I've often looked at the network usage of large websites / web applications and it's always surprising to me just how...unoptimized it is as far as network connections go. I mean Facebook loads decently enou…

Progressive rendering and lots of small network requests can be good if the user feels its faster. I suspect their mobile apps are more conservative about using fewer requests (and probably a binary protocol).

Unlikely. People report that uninstalling Facebook on their phones increases battery life by up to 20%.

Re: Graphing when your Facebook friends are awake

#158
post #3

Some people might take issue with it, but the writing for this had me in stitches. I very much agree with the author on graphing libraries - there are a few good simple ones, but as soon as you want anything unusual you have to jump to these big, hard to configure monstrosities. More than once I've just given up and written my own server-side generator.

What's striking about this writing style is that (as a junior dev) it's a lot easier to understand what he's doing. By sticking to jokes and a simple style, I never felt confused or lost in lingo.

As a not-so-junior dev, I didn't think he was all that funny half the time, and there was enough extraneous verbiage that I didn't bother parsing it all to find out what he was actually doing. I like the humorous style, but IMO this was badly in need of a once (or twice)-over to clean it up.

Re: Graphing when your Facebook friends are awake

#159
post #105

My favorite part - > This friend recommended nvd3.js, presumably because you’re not making real graphs in 2016 unless your graphing library is .js and requires at LEAST one other .js as a dependency. Everyone looks at you like “what, you DON’T already use .js? Jeez say goodbye to your Hacker News karma. Just apt-get install npm && npm install bower && bower install-” NO STOP IT THIS ISN’T WHAT TIM BERNERS-LEE WANTED”…

Tho only drawback I see with nvd3.js is that we can't generate png images of the graphs, server-side, for email of PDF export. Is there an nvd3-js-to-png.java ;)?

If the graph renders to canvas, you can get a data url for the image and send that to a server for decoding/storage.
Post reply on HN