HNHacker News
TopNewBestAskShowJobs

mark242

2,159 karma · joined May 12, 2011

https://markbeeson.net

[ my public key: https://keybase.io/mark242; my proof: https://keybase.io/mark242/sigs/nJ2IAh2nEXLlnolJOnWEDYJT48SvfBE0w9dqQoQ4d0Q ]

submissionscomments
mark242··on Async/await support in Firefox

  var txt = await read();
  // This code is blocked until read() completes.
  console.log(txt);
mark242··on Async/await support in Firefox
Dear Javascript coders:

If you wind up writing the word "await" in your codebase more than once, you're doing it wrong. You will quickly see how futures/promises wind up taking over all of your code. This is a very good thing. You shouldn't need to block, ever.

Sincerely,

Scala coders

mark242··on Image hoster pushes 1.8 PB per month through Cloudflare CDN
Could you run the service off a few OVH dedicated boxes with 3Gbps? Sure, you could, but it's going to be painful, and at that point imgur is the better choice anyways.
mark242··on Image hoster pushes 1.8 PB per month through Cloudflare CDN
Equivalent pricing:

Amazon Cloudfront: $59770 per month

Google Cloud CDN: $50000 per month

Fastly: $144200 per month

etc etc. If they can't get together $12000 per month for Cloudflare, they sure as hell don't have a viable business model.

mark242··on Secret Management with Vault
"As Vault is run within our internal network (and for other reasons), TLS is disabled. "

No. No. No. No. No. No. This should NEVER be an option. You should not allow data to pass unencrypted over the wire, period.

mark242··on [dead]
What a load of crap. Lightbend released Lagom for Java because... drumroll.. Lagom is meant to bridge the gap between microservices and legacy Java monoliths.
mark242··on US Olympic athlete files leaked in alleged WADA hack
Read up on Todd Marinovich before you ask that question.
mark242··on Chrome is warning users about insecure pages
Then you need to be deploying HTTP/2 over TLS. You are doing a disservice to users with slow connections due to the cost of opening up multiple sockets. Multiplexing your data over an encrypted channel over HTTP/2 and TLS will be faster than domain-sharding over HTTP.
mark242··on Vesper, Adieu
What you're seeing are apps that aren't optimized for mobile. Once you start moving application logic, network IO, and anything that doesn't involve the DOM off the main rendering thread via a cached ServiceWorker, mobile web app performance jumps by an order of magnitude.

Every single performance issue that you're talking about can be seen in native apps; check Twitter, for example, or Facebook. There is a definite lag there caused by the network sync being front-and-center. That's unavoidable, but for an app like Vesper where you're not looking at a huge data transfer, running the sync in the background is absolutely viable.

mark242··on Vesper, Adieu
Pardon me while I go off on a bit of a rant. I've played with Vesper and it is a fine app. It is also the perfect example of the power of the web.

There isn't anything that Vesper is doing that can't be done on the web. You could even write Vesper as a single-page app, and use a ServiceWorker with Firebase or PouchDB or whatever to run the sync. The infrastructure to do all this is very, very easy to do on the web.

This is not rocket science-- this is how far the web has come in a very short time. The UI could absolutely be the same as the iOS native app and while you might have a bit of scrolling hesitation on the interface, it would be perfectly accessible.

Suddenly you're on every mobile device, Android, iOS, iPad, desktop, whatever. The absolute hardest and most time-consuming endeavor would be to get the Stripe account set up for the one-time "in-app" payment to get sync working.

John and Brent and Dave made a fine app in 2012, but I would certainly hope that the next Vesper starts out life as a web app.

mark242··on Using an API to build a $1,500/month side business in 4 months
"This would also let you charge spammers a lot" should be rewritten to "This would also let you charge unwitting victims of credit card theft a lot, and get a ton of chargebacks".
mark242··on Using an API to build a $1,500/month side business in 4 months
Please don't continue to run this.

What you are doing is effectively recreating the VRFY command that nearly every major mail hosting service has removed for privacy and abuse reasons. You are opening yourself up to a huge liability, since spammers will quickly use stolen credit cards to crosscheck their lists against your API.

This will cause you to have processing issues from Stripe. This will cause you to have a huge backlash from hosting providers as you desperately try to make sure that your cached address is still valid. (Let's fire off 1000 calls to some random Postfix server, WCGW?) This will cause you to produce false results for domains that run catch-all addresses but don't advertise mailboxes. This will cause you to unwittingly become an effective tool in a spammer's repertoire.

Look, sticking a cache in front of the RCPT TO command is all well and good, but that functionality should be up to the owner of the mail server that you're bombarding, and not up to some third party. You are putting the onus of "hey, just contact us if you don't want us to hit your mail server" on every single mail server admin. This is not okay. SMTP servers aren't nearly as robust, and cannot handle a quickly-spiraling-out-of-control web service hitting them.

mark242··on The Road to CouchDB 2.0
Primarily merging the changes that Cloudant (now an IBM product) made to Couch to turn a fairly simple implementation of NoSQL / MapReduce into a first-class datastore.

Things like:

* Native Lucene search, which you had to build as a weird add-on for Couch. Now it's full-featured out of the box.

* Geospatial queries, also a weird add-on which only kind of worked in Couch, is also cooked in and is pretty strong now.

* True node clustering and data sharding; Couch has always had really really easy replication between nodes, and getting master-master replication is essentially creating a document on each node. However, you had to store your entire data set on every node, which would grow out of control in a hurry.

* A better auto-compactor. Couch 1.6 does fairly well but it's still a weird cron-based thing that can still fail horribly. The auto-compactor in Cloudant/Couch 2.0 is pretty solid and you don't have to worry about massive spikes in disk space consumption.

mark242··on A practical proposal for migrating to safe long sessions on the web
That's the other option; sending both session cookies at the same time and having the server do the work. Google's solution pushes that "if (short_session != valid)" logic to the client vs having it run on the server.
mark242··on A practical proposal for migrating to safe long sessions on the web
Yes; and CPU is cheap as hell. Round trips to a cache are expensive.
mark242··on A practical proposal for migrating to safe long sessions on the web
"The session has to be fetched from cache/hot memory on every request, right?"

Nope. Let's say you have a rest endpoint that accepts a Pokemon id to add to your collection. If you cryptographically sign a cookie that says "I am this user id" you can assume the request to add the Pokemon to your collection is valid. There's other business logic to perform, sure, but "I am this user" is taken care of for you.

What Google is proposing is the ability to save a long-term cookie that says "I am this user" and a short-term cookie that says "I'm signed in". The requests periodically say "am I still signed in/am I still this user" and the server can periodically (eg not every request) look that up in cache/database.

mark242··on A practical proposal for migrating to safe long sessions on the web
You don't need to verify the session on the server all the time. Session verification very quickly becomes a bottleneck to app performance, since you're doing a separate database/cache lookup for each rest endpoint request. It's far easier, and provides much better performance, to just cryptographically sign a cookie that says "I'm this user".

This is where the short/long-term cookie comes into play, and is actually a neat idea to take care of the "how do I periodically check that the user hasn't logged out/changed their password/invalidated their sessions/etc" problem that the cryptographically-signed cookie brings up.

mark242··on Twitter now lets anyone request a verified account
Yeah; $10 says there's a preference coming "Only show notifications from verified accounts" or "Only allow verified accounts to follow" etc etc.
mark242··on Accidentally nonblocking
This is where I think Scala really, really shines, regardless of whether you're using Akka or not. Once you've gotten into that mode of using futures, turning your code from blocking to nonblocking is as simple as never writing that Await statement, but having your methods return a Future[MyClass] instead of MyClass.

The funny thing is that writing nonblocking code doesn't have to be as hard as it is, you just have to get into the mindset. It's easy to say "well, I have to have the result coming back from my JDBC/REST/etc call before I know what to do with it" and that's not the case at all, especially when you're working in a strongly-typed environment.

mark242··on Web Storage: the lesser evil for session tokens
Yes, this.

If you are working with any sort of confidential data, be it personal information, or payment info, or whatever, a determined attacker with access to executing Javascript on your page is going to cause a world of problems, the least of which is gaining access to localStorage. A much more concise example is adding a simple eventlistener on keypress, and just logging that data to a third party.

localStorage is ready for widespread use, imo, you just need to know what and when to use it; using localStorage as initial cached state on application startup is extremely useful.

mark242··on Open-Sourcing Twitter Heron
Okay, the better question then would be, how does this compare with writing a processor on top of Akka streams?
mark242··on Open-Sourcing Twitter Heron
How does Heron compare to Spark streaming?
mark242··on Spectre.css – a lightweight, responsive and modern CSS framework
<div class="text-italic"></div>

Come on.

<em>This is my italic text.</em>

mark242··on The 9 lines of code that Google allegedly stole from Oracle
A void function that does nothing but throw exceptions. Scala engineers everywhere cringe at the thought of converting this kind of code to native Scala.
mark242··on Everybody gets WebSockets
Absolutely yes.

Connections are very very cheap to maintain, and very very expensive to build up and break down. Even in environments with load balancers, stateful firewalls, etc., it is much easier to keep a socket open than it is to create a new one.

If you're doing any kind of realtime data, websockets are the way to go. It is way, way easier to do stream processing and deal with backpressure than it is to have a gigantic number of clients doing http polling.

When Cloudflare mentions that websockets haven't had a gigantic uptake, I don't wonder if it's because Amazon's ELB doesn't support them and people don't want to roll their own haproxy solution.

mark242··on Continuous Deployment at Instagram
"The test suite needs to be fast. It needs to have decent coverage, but doesn't necessarily have to be perfect."

Holy hell, what a telling statement that is. I get not unit testing for 1 == 1, but come on, unit and integration tests for, say, user login should be difficult, not fast. There are some test suites that actually do need to be perfect, unless Instagram thinks that eg OWASP isn't "decent coverage".

mark242··on Jenkins 2.0 Beta
Don't run production code on a nano.

Don't run production code on a nano.

Don't run production code on a nano.

I don't care what language you're using, if you find yourself saying "well, I could run on a nano" just stop.

mark242··on Jenkins 2.0 Beta
"Heaps in the 1-2 GB range are not uncommon."

Is this really still a complaint in 2016? Your phone has that much RAM.

Honestly if you're worried about Java heap size, spin up a t2.medium instead of a t2.small for your build pipeline. Running Jenkins on a Raspberry Pi is probably not a great idea if you're writing any serious application.

mark242··on Google Cloud Vision API enters Beta
IBM's Watson service, provided via Bluemix, does this:

https://www.ibm.com/smarterplanet/us/en/ibmwatson/developerc...

mark242··on SoundCloud could be forced to close after $44m losses
My obligatory show HN link: https://octave.is is the Vimeo to Soundcloud's Youtube. No crap comments, no ads, no garbage on your artist page.
← PreviousPage 8 of 12Next →