Hacker Newsnew | past | comments | ask | show | jobs | submit | 2013-04-02login
Stories from April 2, 2013
Go back a day, month, or year. Go forward a day, month, or year.
1.Comcast injecting JS (gist.github.com)
461 points by brokentone on April 2, 2013 | 273 comments
2.We call ourselves innovators, but most of us are really just iterators (evernote.com)
444 points by pgrote on April 2, 2013 | 222 comments
3.Tesla Unveils New Finance Product (teslamotors.com)
438 points by antr on April 2, 2013 | 256 comments
4.Check you're wearing trousers first (robertheaton.com)
321 points by FailMore on April 2, 2013 | 58 comments
5.Show HN: Cap'n Proto, by the ex-maintainer of Protocol Buffers (kentonv.github.com)
286 points by kentonv on April 2, 2013 | 85 comments
6.Netcat – The swiss army knife of networking (mylinuxbook.com)
252 points by giis on April 2, 2013 | 47 comments
7.I'm disappointed by Instacart (dentafrice.com)
210 points by calebio on April 2, 2013 | 125 comments
8.Show HN: Chardin.js, beautiful instructions for apps (heelhook.github.com)
203 points by heelhook on April 2, 2013 | 44 comments
9.Explicit vs. Clever (raganwald.com)
196 points by raganwald on April 2, 2013 | 97 comments
10.The Patent Protection Racket (joelonsoftware.com)
190 points by doty on April 2, 2013 | 94 comments
11.A mother tongue spoken by millions of Americans still gets no respect (the-magazine.org)
187 points by nathan_long on April 2, 2013 | 251 comments
12.Ask HN: What should I do?
176 points by pattle on April 2, 2013 | 152 comments
13.Vega: A Visualization Grammar on top of D3 (trifacta.github.com)
172 points by mmaia on April 2, 2013 | 15 comments
14.Growing Tomatoes (joehewitt.com)
160 points by siong1987 on April 2, 2013 | 81 comments
15.Instacart: We're Sorry (instacart.com)
159 points by apoorvamehta on April 2, 2013 | 125 comments
16.4K gyro-stabilized aerial video of San Francisco (fstoppers.com)
151 points by sheri on April 2, 2013 | 54 comments
17.Microsoft Launches Windows QuickStart Kit For Mac Developers (techcrunch.com)
148 points by lanthe on April 2, 2013 | 97 comments
18.Rendr - Use Backbone on both the server and client (github.com/airbnb)
141 points by jlogsdon on April 2, 2013 | 33 comments
19.I'm tired (andymoore.ca)
139 points by luigi on April 2, 2013 | 123 comments
20.JetBrains is working on a cross-platform C++ IDE (jetbrains.com)
131 points by amatheus on April 2, 2013 | 132 comments
21.Our Regressive Web (medium.com/future-tech-future-market)
133 points by lukedeering on April 2, 2013 | 77 comments
22.The OAuth Bible (github.com/mashape)
129 points by ecesena on April 2, 2013 | 13 comments

They're bundling an ordinary car loan with a put option, and Musk is personally guaranteeing the put.

Elon Musk is great. He's always all-in.


This code is beyond awful - it fails to display, makes endless AJAX requests, and more; here are a few fun tidbits:

1. The code is not encapsulated in an IIFE, so it clobbers any global variables (like 'image_url') in the page, breaking any scripts relying on those variables.

2. The code spends an inordinate time checking if you're running Netscape Navigator 6.

3. Strangely, they include a whole bunch of code allowing the message to be dragged around the window (which is nice) but they don't allow it to be closed. Of course, it closes itself after making a single AJAX request into a black hole, so there's that. Bugs piled on top of each other make this entire message mostly harmless, if it weren't for the variable clobbering & bandwidth usage (see the next item...)

4. Upon load, checkBulletin() is immediately invoked. This does an AJAX call to '/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do?dispatch=checkBulletin'. I assume this is to check if the bulletin has changed, to see if there are new messages, or maybe to check if the user has acknowledged the message yet. Unfortunately:

* This URL is relative, which means it will never actually reach its intended target (instead filling your web logs with this request)

* Upon xmlhttp.readystate=4 (request finished, successful or not, so this will change to 4 even on a 404 error), the comcast message is hidden. This means that the entire 'bandwidth exceeded' message will actually be hidden as soon as this request completes, which may be in <500ms, giving the user absolutely no time to see or acknowledge it.

* The author makes an attempt to not continue sending AJAX requests to this URL after a successful attempt, but botches it, so this request is actually sent indefinitely, every 5000ms, while every any page is open. This means every single tab on your system is popping AJAX requests every 5 seconds for the whole month that your account is nearing its quota. This likely brings you over quota pretty quickly if you leave your computer on all day.

That's right, this code causes every page served on your system to pop an AJAX request to the wrong URL every 5 seconds, as long as the tabs are open.

We can sit and argue all day whether or not it's ethical to display messages by injecting code into the DOM, but it is certainly unethical to write such awful javascript that clobbers global variables and drives up bandwidth costs by making AJAX requests to the wrong url every 5 seconds until the cows come home. Whoever wrote this script should be fired.

EDIT: Similarly, back in the dialup days, some ISPs would inject ads into their content. One way this was stopped was to argue that it was not legal for the ISP to charge you for data, then artificially inflate the size of that data by injecting ads. This script is doing just the same in a measurable way by causing these AJAX requests to be run every 5 seconds on every tab in your system.

25.Powerful Thoughts From Paul Graham (rosshudgens.com)
110 points by lispython on April 2, 2013 | 88 comments
26.Principles of Software Engineering, Part 1 (nathanmarz.com)
107 points by ananthrk on April 2, 2013 | 18 comments
27.Show HN: Mosaic – Use multiple iPhones as one big screen (mosaic.io)
106 points by igul222 on April 2, 2013 | 47 comments
28.Prenda Law's Attorneys Take The Fifth (popehat.com)
105 points by jstalin on April 2, 2013 | 38 comments
29.We are Switching to Dart (ramen.io)
105 points by MartinMond on April 2, 2013 | 94 comments
30.Kinect can now be used to diagnose depression with 90% accuracy? (thescorpionthefrog.com)
99 points by SilentStump on April 2, 2013 | 38 comments

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: