Webgazer.js webcam eye tracking on the browser - <AUTHOR> https://webgazer.cs.brown.edu/ <comment><USER2> Disclaimer, I am the primary engineer of a commercial eye tracking system.

Tools like these popup every now and then are a nice tool for rough estimation of gaze. Fixation tracking is a large complicated issue that usually requires some sort of calibration to get more precise results. By sidestepping the calibration problem, much higher subject compliance can be achieved since you don't have a grad student barking confusing order at you. The downside to this is the noise you see in the tracking results. For those interested a product that produces similar results is pupil labs ambient gaze tracking "Core" research headset[0]. [0] [https://pupil- labs.com/products/core/](https://pupil-labs.com/products/core/)

<comment><USER3> In your estimation, how far away are we from eye-tracking software being able to detect the start of a microsaccade, estimate where the gaze is moving toward, and draw new contents on the screen there before the gaze even reaches that point? I would think that by "hacking" into human brain "vulnerabilities" like saccadic masking and chronostasis, such software could potentially yield seriously trippy and mind-altering results!

<comment><USER2> There's two parts to that implementation of such a system, and they're both interesting! The first part is detection of a micro saccade which is already available in research systems I have personally worked on. You can basically crank up the camera frame rate until you're around the micro saccade range and do some clustering analysis on the positional data to decouple the hardware moving vs the face. The second part is having a fast enough reliable commercial grade displa system to present stimulus on. Displays are very fickle in practice and getting your hands on one that can run with adequate color, contrast, and brightness at speed is currently very difficult. One angle under research currently is the perception of stimulus during saccades and micro saccades. There's quite a bit of time and effort in the industry going into neurological assessments through saccades, the tools coming out of this are really starting to come down in price. This opens the door for a bunch of lower priced research options, such as the parent article, to enable a much more rapid pace of understanding.

<comment><USER4> That's fascinating, but I'm wondering what is the practical value of detecting microsaccades? Aren't they just involuntary twitching?

<comment><USER5> For the duration of the microsaccade, you're blind. So if something changes onscreen it's much harder to see.

IIRC people have used small orientation changes during microsaccades for redirected walking in VR. You feel like you're walking straight but you're actually curving back on yourself.

Edit: I think that was just detecting full-on saccades but a microsaccade version would be smoother and harder to detect.

Source: [https://blog.siggraph.org/2018/05/challenge-accepted- infinit...](https://blog.siggraph.org/2018/05/challenge-accepted-infinite- walking-in-vr.html/)

</comment></comment></comment></comment></comment><comment><USER6> Had a blast at LauzHack '16 using this library to make a Chrome extension enabling "no-hands scrolling"[1]. Sadly, reading web articles while eating with both hands is still a dream. We managed to get okay-ish results on a MacBook Pro in perfect lighting from time to time, but nothing consistent. In variable lighting and on lower-end laptops we found it impossible.

I wonder if it would be possible with a better webcam and good, consistent lighting.

[1] [https://github.com/jarlg/lookmanohands](https://github.com/jarlg/lookmanohands)

</comment><comment><USER7> In the brown undergraduate computer vision course one of the homework's (or final project; my memory is a little hazy) was to improve the tracking of webgazer. People were pretty successful from what I remember. As an undergrad I didn't think much of it but as a grad student I would be slightly mortified if undergraduates were improving on my current research for homework.

<comment><USER8> Why? Someone smarter will always follow

<comment> yjftsjthsd-h Not even just smarter; we all stand on the shoulders of giants, and every year the barrier to entry falls that much more.

</comment></comment></comment><comment><USER9> Can't wait until this makes its way to adtech. You can have sites that hold their "premium" content hostage until you allow camera access and proved (via eye tracking) that you looked at their ad.

<comment><USER10> "Please drink verification can"

<comment><USER11> Boy, I love to see an r/lol reference on HN. Gotta be a lot of crossover, right?

</comment></comment></comment><comment><USER12> I had an idea for an evil-eye game, in the style of Happy Tree Friends or so. That is: a lot of cute creatures around, and nothing happens (they may giggle, jump or blink occasionally) until you look at them. If you do...

<comment><USER13> That's a really cool use case for the library ! I think the calibration stage could be made easier with some "click as fast as you can on the randomly appearing circle on screen" gamification, and just assume that people look at what they click on by default. It could be some little character changing color at random and you need to click it at that point, to make sure the user keeps his eyes on it for a few seconds before clicking.

</comment></comment><comment><USER14> If you want to see how well webcam eye tracking works check this out [https://www.realeye.io/test/f80dd676-3b55-4d2c-931c-d925b068...](https://www.realeye.io/test/f80dd676-3b55-4d2c-931c-d925b068a740/) It's using WebGazer as it's core - but with many improvements done by us.

BTW I'm RealEye co-founder so AMA :)

</comment><comment><USER15> I just don't see the point of this. I don't think I've _ever_ lost track of my eyes.

</comment><comment><USER16> Sadly my eyes are too small to actually track the pupils. I remember when I got my ID, the lady taking the picture said "Sir, please open your eyes". I looked at her and asked "They are open... you don't see that?" She laughed and asked if I had been smoking. :/

</comment><comment><USER17> Whoa. I have a strange mix of reactions to this. It's impressive, and interesting, and worthwhile, slightly creepy, and potentially hugely useful for a11y, democratizing cutting-edge HCI, AR, gaming, etc etc. Surprised it's not getting more attention!

<comment><USER18> One good thing about webcam access on the web is that browsers require explicit access by the user and browser tabs clearly indicate when a tab is recording with either the mic or camera.

<comment><USER17> Yes! Hence the "slightly" modifier. :)

</comment></comment></comment><comment><USER19> This seems really cool but it doesn't seem to let me choose which webcam to use- it seems to default to a virtual device I use for streaming that isn't set up right now so I can't really try it out.

<comment><USER20> I've had this issue with Chrome on OSX where it won't allow camera selection. Firefox (and I think Safari) both do.

It's unclear why Chrome does this - it has a preference for which camera but it seems ignored and takes the most recently installed one.

</comment></comment><comment><USER21> The "move the ball around with your eyes" demo doesn't work at all for me in Safari on a MacBook. I can only move the ball with the mouse. The other demo works okay, but very low accuracy (like 50%). Firefox on the same computer is unusably slow, generates a new "data point" (the visible dot) only every few seconds. Accuracy was about 10%.

</comment><comment><USER22> The listed use cases here struck me as odd, I can't imagine why I or anyone wanting to read a news article would allow the site access to my webcam. Nor do I think most users would turn on their cameras to help with any given sites analytics.

So aside from games, what is the actual use case here ?

<comment><USER23> I'm starting to develop RSI in my wrists and hands, and have been looking at eye tracking systems as a potential way to help reduce the amount of clicking that I need to do.

I was thinking maybe I could put webgazer.js into a chrome extension and use it to navigate through pages for me, but I don't think it has a click mechanism.

fwiw - I'm a huge vimium extension user as keyboarding is less of a strain than mouse movement.

<comment> yjftsjthsd-h Have you looked at [https://eviacam.crea-si.com/](https://eviacam.crea- si.com/) ? Supports Windows, GNU/Linux, and Android, works globally, and runs separately from the browser. (Technically not _eye_ tracking, but close enough)

<comment><USER23> Wow! I had not, but that looks like it might do the trick. Thanks!

</comment></comment></comment></comment><comment><USER24> Can you recommend any literature to get an introduction into eye-tracking at all?

<comment><USER2> Here's an old school high level overview of pupil tracking methods[0]. The focus recently has been moving these older computer vision methodologies to ML without introducing too many errors.

[0] [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.155...](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.155.5186&rep=rep1&type=pdf)

</comment></comment><comment><USER25> I tried my best on the calibration demo page in Safari and consistently get a 0% accuracy result. It calibrates sort of ok in Firefox. I guess this is heavily browser dependent? But why?

<comment><AUTHOR> Hmm, not sure -- do you see the gaze dot when you're looking at the center circle?

<comment><USER25> I see a gaze dot. It just seems kinda like Safari is accumulating some tracking error that Firefox doesn't. Both browsers find my face accurately.

(side note: when the gaze dot overlaps the calibration circles, the circles become unclickable without some very careful fiddling)

</comment></comment></comment><comment><USER26> I tried using this one time but unfortunately found it didn't work when I wore my reading glasses. The screen reflection off my glasses just whites out both eyes.

</comment><comment><USER27> Now add this to vidconf systems by figuring out which speaker is who, and make a button to talk only to them.</comment>


The 5 Design Clients You Meet In Hell - <AUTHOR> http://pandadesk.com/blog/2011/10/the-5-design-clients-you-meet-in-hell/

<comment><USER2> Did anyone else pick up a strong Oatmeal influence here?

<comment><USER3> Definitely... <http://theoatmeal.com/comics/design_hell>

That said, after looking at the two side by side, it's not like any artwork was lifted, despite the similarities.

</comment></comment><comment><USER4> Just got rid of our Scope Creeper yesterday, it was getting ugly. Funny enough, this client was also our Buzzturd. Thanks for the fun read!</comment>


Ask HN: What languages teach the wisdom of C without the uglyness of it? - <AUTHOR> I have been going through C again. I want the manual power on memory management and low level computing without C's ugly I/O and other pointer semantics it provides.
The syntax is inconsistent in many ways.
https://stackoverflow.com/questions/4025768/what-do-people-find-difficult-about-c-pointers
So basically, I want to be able to use pointers but in a sane way. Most of them are dependent of standard library than language anyway.
I can't afford time for going further low level like machine architecture or assembly language.
Does Pascal help? Does learning functional programming first help? If so, which small functional language( except for Haskell)? <comment><USER2> Noting that that link was closed as "not constructive".

Not sure what about (say) ANSI C is particularly ugly. The business about pointers to arrays versus pointers to array elements is a bit annoying (and a mistake in retrospect). But that's about it. The rest makes perfect sense.

<comment><USER3> > The rest makes perfect sense.

Yes, if we are in 1967, just before Algol-68 was proposed.

<comment><USER2> Arguably Algol was better, in the sense of being higher-level and with fewer sharp edges. But it looks like C probably exposes a lot more of what's actually going on with memory, pointers, the stack, the heap, etc. That's not always good, but you'll learn a lot that you can't really get with a language like Java or Python.

</comment></comment></comment><comment><USER4> You don't describe what you actually want or consider 'sane'. But the answer is probably "There's no such thing" anyway, unless you're looking for Rust, which you probably aren't.

<comment><AUTHOR> Syntax is inconsistent as described in the stack overflow link's second answer.

Input output like scanf and printf functions are annoying and don't work on what they are asked.

Too many gotchas and not for better - like understand how the underlying system works but some side effect by merely the design of language.

Including above points, my hope is that playing with pointers in a language I want should be easier and intuitive than using in C.

Could you please help? Pascal is just as much confusing when using pointers?

<comment><USER5> If you find Pascal and C equally confusing using pointers, then maybe the problem is that you find pointers confusing, not so much the language.

Pointers are not very intuitive. You have to have a clear mental picture of what you're doing, and think very carefully about each step to make sure that you're doing what you think you are. I'm not sure that any language can save you from that. C might actually be better than Pascal, though, because it does less to try to hide what you're doing from you. On the other hand, Pascal does more about trying to keep you from doing something stupid.

<comment><AUTHOR> I must clarify that I am _asking_ if pointers are just as much confusing in Pascal.

Thanks for the comment!

<comment><USER5> I think I would say that no, they are not quite so confusing in Pascal, because they are more limited. (At least, they were in the original Pascal. I have no experience with the more modern versions.) As a result, you couldn't do some of the things that you can do in C, which made it easier to understand the uses of pointers in existing Pascal code. (On the other hand, if you were trying to get pointers to do something in Pascal, and that thing was outside the range of what you could do with pointers in Pascal, then Pascal could be _very_ frustrating...)</comment></comment></comment></comment></comment>


Ask HN : Suggestions for Writing Background jobs - <AUTHOR>

I need to implement a few background jobs, that run  continuously in the background and do a lot of http calls to some API's to gather some data and store it in mysql. I would like your suggestions and comments on what will be the best way, architecture, language to use so that the system is scalable.
I will need it to be threaded so that i can pull data simultaneously.
What language should I use.
1) Ruby 2) Scala 3) Java
5) PHP
I know Ruby PHP and Java well.
Thanks <comment><USER2> RabbitMQ (or any AMQP broker) sounds like it would do the job, since it sounds like you need to send very little data (a URL) to the background worker. I believe that there are some good AMQP/Rabbit gems for Ruby, but I'm a little dated on that. The basic premise is that a broker (RabbitMQ-Server, etc.) holds onto a queue of messages, that are distributed to N subscribers when they ask for them. The more subscribers you have to the broker, the more jobs can happen at the same time.

However, RabbitMQ might be too much overhead for what you want to do. With Ruby, specifically, I've had a good deal of experience with Resque, which uses Redis (key-value store) as a queueing system, much like RabbitMQ. It's easy to set up, and gets the job done just as well.

</comment><comment><USER3> If you know java and scala, I would recommend you to give Play framework a try. It is extremely simple and fast to set up and develop with, plus it uses Quartz scheduler library for the jobs.

<http://www.playframework.org/documentation/1.2.3/jobs>

Alternatively you could simply use Quartz alone.

<http://www.quartz-scheduler.org>

<comment><USER3> And for the rest of your needs, Play gots you covered too...

You can use play's WS class to make asynchronous HTTP calls from your server, and it integrates nicely with MySQL or your database of choice too. I think it uses Hibernate under the hoods, but leverages all its power while simplifying configuration and usage.

You can use Play with Scala, and if you do so, there is a nice database layer called Anorm.

<comment><AUTHOR> I see Play is web dev framework. As far as my system is concerned I dont need to have a full web app. The system just needs to sit in the background read the database and then request 2-3 API's for data and put that back in the db. I expect a lot of writes to the database. I am reading about Play's support for jobs. Do you still think Play is the way to go ?

<comment><USER3> I see your point. Play is a framework based in the pattern MVC. If you just don't provide any View layer, you can use the Controller to access the Model, and use the rest of the goodies Play gives you for free, like Jobs, the WS class for easy HTTP calls, a RESTFUL interface, etc.

As I said, you can always use just Quartz for the jobs (that's what Play uses anyway), and create your own Data Access Layer or use an ORM, or what you like.

</comment></comment></comment></comment><comment><USER4> It would be polite to put to least a hint of your question in the title so people know what it's about.

<comment><AUTHOR> I noticed that after i posted. I have following HN for over a year but this was my first post so thats why...</comment></comment>


Agrivoltaics: Save solar plant land costs with sheep and agriculture - <AUTHOR> https://www.utilitydive.com/news/sheep-ag-and-sun-agrivoltaics-propel-significant-reductions-in-solar-main/581879/ <comment><USER2> > typical per-acre range of $250-750 for sheep to graze at its sites

Where we live, the farmer pays the landowner to graze his cattle on their land.

So I'd be interested to know why it's the other way around to have sheep graze your solar farm.

Isn't the benefit of animals that they are self-managing, that they can identify the sections that need grazing the most, and that they can even self- replicate without human involvement?

Why not just put up some predator fences and then let them do their own thing?

<comment><USER3> It costs money to transport the sheep, provide care, farmer pay, and housing for the sheep. The sheep don't stay on site continuously.

What I wonder is why don't they seed plants that don't grow high? Like clovers or something and use bee keeping as an additional source of income.

<comment><USER4> > What I wonder is why don't they seed plants that don't grow high?

Because within a few years, there will be plants that grow high anyway. In a few years more, they will dominate.

In climates that support trees and bushes, the only way to have grassland is regular grazing or mowing.

<comment><USER5> Or burning! Though that requires regular dry conditions.

</comment></comment></comment></comment><comment><USER6> Interesting premise. I agree that getting paid $300 for grazing sheep wont scale and is certainly not sustainable.</comment>


Write your own transformation! Simple Computer Algebra System made in Java - <AUTHOR> https://github.com/dedoussis/algebrain <comment><AUTHOR> I would really appreciate opinions on what to improve.</comment>


Amazon Element 55-Inch 4K TV with Alexa - <AUTHOR> https://www.amazon.com/dp/B06XDC9RBJ/ <comment><USER2> 43-inch is still to big for small rooms. It would be nice to have a smaller 1080 screen with the same features.</comment>


Ask HN: Who's the publisher of unofficial open source ports? - <AUTHOR> Like some, I enjoy searching for my own stuff on Google once in a while. Some time last year, I searched for my game, "Wizznic!" on google, and was slightly annoyed when I saw the publisher listed. See, I actually knew about this publisher, I vaguely recall some contact with them in relation to their android port of my game. I don't think they did anything wong, but I think google did.
So I submitted feedback on the panel, multiple times, every time, explaining that, Wizznic is my game, I made it. Linked to relevant sites. To any human, I believe I definitely proved that the game was made by me. I explain that the Android port is not official and the correct publisher should either be "Wizznic.org" or my own name,
I've done this several timess, but google keeps the wrong publisher on the panel.
It made me wonder if I'm wrong..
Can opensource products have only one publisher? Maybe they have multiple?
Does every mirror site serving Ubuntu ISOs qualify as "the publisher" ?
I'd like to hear your opinions on this :) <comment><USER2> Have you tried claiming the panel instead of submitting feedback?

<comment><AUTHOR> That's a good idea, but, since the panel is not about a person, I cannot claim it as a person, but must do it as someone who represents an entity. However, to do that, I must provide some sort of documentation that the company exists (because, people apparently, cannot make things, only companies can)</comment></comment>


History Of The Color Wheel - <AUTHOR> http://www.colourlovers.com/blog/2008/05/08/history-of-the-color-wheel/ <comment><USER2> Fascinating article! The history of color is oddly neglected, it seems to me. Any subject good enough for Newton and Goethe to weigh in on ought to be worth taking another look at...

</comment><comment><USER3> I want to see a documentary on this! Why not right? they already have on out for the font Helvetica.</comment>


Ask HN: What is your startup email solution? - rush-tea

I am curious to know what you guys use for your startup email solution.
I am currently considering moving to AWS, and possibly using their Amazon SES.  However I see that there are other alternatives like mailgun.com or sendgrid.com
what would be the advantage of using 3rd party solution vs in house Amazon SES?  I see that the pricing is pretty similar and I am leaning towards using SES, but I would like to hear opinions.
Thank you. <comment><AUTHOR> I'm using Mandrill for transactional email, and will most likely start using Mailjet for email campaigns.

I believe that Mandrill etc give a better deliverability compared to SES.

<comment><USER2> Can you please share more of your experience regarding deliverability of various services? I'm somewhat surprised to hear SES can be surpassed in this department.

<comment><AUTHOR> I only tested SendGrid and Mandrill for transactional email.

I switched off SendGrid after seeing quite a bit of gmail owners got their email sent into spam (but I believe they fixed the issue).

I use DKIM/SPF with Mandrill and nobody mentioned a spam issue since then.

On SES: I cannot find back the precise article I was thinking about right now (a benchmark if I remember well), these are just my memories.

<comment><USER3> I use SES with DKIM and SPF. It's fast, cheap and I've never had a single email go to spam.

</comment></comment></comment></comment><comment><USER4> We were using campaignmonitor.com until we found out about sendy.co

Sendy uses SES to send the emails on our behalf - so far so good - we do a weekend update to about 1500 address (so far) and it's worked quite well.

Someday I'll script something to dumb the current user email list into sendy so I don't have to export it to csv and reimport it every weekend...

</comment><comment><USER5> I asked a similar question recently

[https://news.ycombinator.com/item?id=5634319](https://news.ycombinator.com/item?id=5634319)

<comment> rush-tea Thanks for the info. I searched earlier before post, but I can not find it. Not sure how HN search engine actually works... :(</comment></comment>


Facebook Co-Founder Departs To Build "Extensible Enterprise Productivity Suite" - <AUTHOR> http://www.techcrunch.com/2008/10/03/facebook-co-founder-departs-to-build-extensible-enterprise-productivity-suite/

<comment><USER2> This is where your silly Valleywag ban bites you in the ass. They broke this story fair and square.

<comment><USER3> As far as I know, this is the only counterexample that has come up in the months since the ban. I think that not being able to submit this one Valleywag story is a small price to pay to have kept dozens of crappy stories off the front page.

<comment><USER4> They brought up the Google buying Digg story repeatedly for months before Techcrunch confirmed it. I love valleywag, because they're a tabloid. They dig for dirt, throw up crap, but they break stories early and often.

Everything on Techcrunch is carefully polished press releases fed through the established PR pipeline. Everything on valleywag is actual (though often scurrilous) journalism.

</comment></comment></comment><comment><USER5> twitter:yammer = facebook: "extensible enterprise productivity suite?"

</comment><comment><USER6> I really like these false good-bye-letters hehe. "I like this company, I like everyone in it but I need to go" ... this always makes me cry :)</comment>


Writing Dockerfiles for Node.js Web Apps - <AUTHOR> https://blog.hasura.io/an-exhaustive-guide-to-writing-dockerfiles-for-node-js-web-apps-bbee6bd2f3c4 <comment><USER2> I completely get the purpose and benefit of Docker. More and more though I'm becoming convinced that for many settings and problems Docker actually creates more problems and meaningless ritual because Docker rapidly is becoming the standard way of deploying software with hardly anyone asking about the reasons anymore.

Docker recreates many of the benefits the Java platform has had from the start (in addition to some other aspects but that's the main selling pont). So, if you have a non-Java application Docker might indeed be a worthwhile choice. The thing is, even with Java platform-independence and deployment standardization for web apps / SaaS-type applications has always been a minor selling point.

Those features are certainly important if you need to rapidly provision and scale your application on many different machines in a distributed environment you don't completely control.

In reality, for many applications today this simply isn't the case though. The main motivator behind that feature after all was the concept of desktop applications that are deployed to each user individually.

So, with Docker we now indiscriminately add an additional layer of complexity on top of existing applications regardless of the actual problems this might solve.

<comment><USER3> > So, with Docker we now indiscriminately add an additional layer of > complexity on top of existing applications regardless of the actual problems > this might solve.

I agree that it adds an extra layer of complexity but it also provides a lot of things out of the box (like isolation, separation of concerns, platform agnostic deployments, reproducability and lot more) which makes the life of a developer so easy. If he wants to deploy his application, instead of SSHing into the server, installing the dependency, managing the lifecycle of his application. He just needs to dockerize his application and rest assured that it will run irrespective of the platform on which it is put to run as long as it has docker running.

I think what it boils down to is what you expect a tool to do and if it really solves some hard hitting problems you have with your development life and took away your nightmares then it is totally fine to invest in it and chill.

<comment><USER2> The problem lies with the "just needs to dockerize his application" part. These days I see many developers regularly servicing Docker containers where they rather should be adding value to the product they're creating. It almost seems as if Docker has become an end in itself rather than just a means.

In some ways with Docker you also only move concerns from one layer to another. While in the past you had to manage dependencies on the target machine you now have to manage Docker dependencies and environments on that machine on top of the dependency management for your application.

<comment><USER3> Fair point. Again it is the call that the developer has to take depending upon certain parameters. If he is shipping multiple applications built with Python with one requiring Python 2.7 and the other requiring Python 3.4. He has to somehow make sure that both the application will run peacefully together or he can just create two docker images on his machine one contains Python2.7 installed and the other contains Python 3.0 installed and deploy it the docker way without any hassle. At the end of the day it is the call he has to take depending upon how much time each of the flow is going to consume and which one makes his life easy.

</comment></comment></comment></comment><comment><USER4> Ideally I'd like the same Dockerfile used for both local dev as well as deployment. To do this, we're using something similar to the first Dockerfile, with the `nodemon` install.

Then in a docker-compose.override.yml,

        command: nodemon --inspect=0.0.0.0:5858 /code/bin/www

To allow for debugging as well. We delete that .override.yml file as part of the CI build/deploy.

</comment><comment><USER5> Nice post, and very close to my experiences with Dockerfiles for node.

To the author: could you elaborate on the differences between carbon and alpine base images please? I can obviously go look this up, but this was the one part of the guide that was new to me. Your description wasn't enough to give me a complete understanding, so perhaps you could explain a bit more about carbon and alpine? Thanks.

<comment><AUTHOR> carbon is the latest LTS (Long Term Support) version of Node. Instead of using the latest version, which can have breaking changes and possible drop of support in the future, it is recommended to use LTS version just to ensure using a stable + well supported version. alpine base images are generally used to cut down the image size for production, because they are very minimal and works well for most use-cases. But you would generally use carbon or specific full blown version of node in development, because you can install system dependencies for bundling code.

<comment><USER5> Thanks! You've given me something new to try out :)

</comment></comment></comment><comment><USER6> No mention of using a non-root user? Any reason why or just oversight?

With Debian based images like node:carbon you could do something like this:

      ENV HOME /home/nodejs
      RUN groupadd -r nodejs \
      && useradd -r -g nodejs nodejs \
      && mkdir -p $HOME \
      && chown nodejs:nodejs $HOME
      USER nodejs

With alpine something like this:

      RUN addgroup -S nodejs && adduser -S -G nodejs nodejs
      USER nodejs

</comment><comment><USER7> I'm surprised they haven't included a process manager for the production build. In my experience it allows for much easier 0-sec downtime updates and load balancing.

We're using pm2 [1] for this if anyone's interested.

[1] [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2)

<comment><USER8> If you use container orchestration platforms like Kubernetes, this is not required, as restarts load balancing etc. are handled by the orchestrator.

<comment><USER7> Does Kubernetes support graceful reload of containers, with 0 downtime? I'd be very interested if so.

<comment><USER8> Yes, it does. Kubernetes can perform rolling updates [1].

One scenario is that when you rollout a new version, the old container will only be killed when new one is up and running. If there are many replicas running, Kubernetes will replace them with new versions one by one. And all of this behaviour is highly configurable.

[1] [https://kubernetes.io/docs/tutorials/kubernetes- basics/updat...](https://kubernetes.io/docs/tutorials/kubernetes- basics/update-intro/)

<comment><USER7> Thanks! I think for our scenario it's a bit overkill as we're only running one container and pm2 seems a better fit for that.

It would be interesting to know how this works under the hood though, is this just built on top of docker swarm load balancing?

<comment><USER8> Kubernetes will definitely be an overkill if you run only one container. But, if your application follows microservice architecture and have multiple containers, Kubernetes is the best solution to run them.

Kubernetes architecture is entirely different from that of Docker Swarm.

A Kubernetes Service object [1] can load balance traffic to various Kubernetes Pods (think containers) [2] as defined by it's " pod selectors". It can choose to direct traffic only to running containers.

[1] [https://kubernetes.io/docs/concepts/services- networking/serv...](https://kubernetes.io/docs/concepts/services- networking/service/) [2] [https://kubernetes.io/docs/concepts/workloads/pods/pod/](https://kubernetes.io/docs/concepts/workloads/pods/pod/)

</comment></comment></comment></comment></comment></comment><comment><USER9> I like the new multi stage Dockerfile concept in the later Docker versions. It makes it easy to define Dockerfiles that both builds and runs your code, while still separating build and run dependencies. I have used this for both Node and Go projects. As long as the build output is not too spread out in terms of paths copying your build artifacts over to the other Dockerfile stages should not be a big issue.

</comment><comment><USER10> > As you can see above, we are using the npm package serve to serve static > files.

I would recommend using nginx or apache instead. You get more performance and better configurability.

</comment><comment><USER11> > root@id:/app# nodemon src/server.js

Why is this needed when "CMD [ "nodemon", "server.js" ]" already exists?

<comment><AUTHOR> CMD will work in detached mode. i.e - "docker run -d". In an interactive mode i.e - "docker run -ti", you can land up with shell access of the container, where you can run commands / perform other tasks as required. In this case, we are running nodemon.

</comment></comment><comment><USER12> or not writing dockerfiles at all, using stock docker images. as in this article [http://engineering.opensooq.com/on-the-fly-ad-hoc-docker- com...](http://engineering.opensooq.com/on-the-fly-ad-hoc-docker-compose- development-stack/)

<comment><AUTHOR> Instead of writing Dockerfiles, this approach requires me to write a docker- compose.yaml file. How is it more advantageous?

</comment></comment><comment><USER13> > Using an appropriate base image (carbon for dev, alpine for production).

Isn't using the same container everywhere the actual selling point for containers?

<comment><AUTHOR> Depends on the use-case. For development, you would need to install some system dependencies, access to bash for debugging etc and hence the full blown base image. In production, you want the image sizes to be minimal and hence alpine base image. Also reduces the attack vector.

<comment><USER14> But why are you doing minute-to-minute development within a container? What's so hard about installing the official Node package for your development system's distribution? When the developer is finished working on a feature, then and only then build a production Docker image from the codebase that now implements that feature, maybe run a few smoke tests, and push to CI. Building special containers for development purposes is sheer madness.

<comment><USER15> I am developing in a container - most of the time - as this allows me to run the (micro-)service within it's defined ecosystem, so no need to mock any service boundaries.

Note: New services and major functionalities are usually developed locally with unit-tests ensuring compliance with the spec. But once this is done and stuff needs to be integrated with the real system - or debugged later on - there is IMHO nothing that can beat a complete copy of the real system running locally where one can easily manipulate whatever is needed.

</comment></comment></comment></comment><comment><USER16> When does it make sense to run Node on docker vs Heroku dynos or something similar? Is it just a cost thing at a certain number? Are these significantly specialized containers? The types mentioned in the doc seem like basic web apps.

I've used Docker for things like complicated java dev environments. But it seems over-applied for basic web apps.

<comment><AUTHOR> > But it seems over-applied for basic web apps.

Generally your app will be composed of multiple services (like Java, Node.js, some database etc) and there are benefits to run them as microservices (isolation, easy to develop, easy to scale) and hence Docker makes sense in those use cases. Though the app seems basic and overkill to use Docker, the architecture enforces this and adds the above mentioned benefits.</comment></comment>


Does the US govt record every phone call? - <AUTHOR> http://m.guardiannews.com/commentisfree/2013/may/04/telephone-calls-recorded-fbi-boston

<comment><USER2> Does a bear shit in the woods?

<comment><AUTHOR> It does, but does the US government have a record of it?</comment></comment>


Proposed Tax Reform Stands to Impact Equity and Performance-Based Compensation - <AUTHOR> https://www.fenwick.com/publications/pages/proposed-tax-reform-bill-stands-to-significantly-impact-equity-and-performance-based-compensation.aspx <comment><USER2> Overall I think average comp full time employees at eaely stage startups will be a big beneficiary. They won't hit the exercise threshold, AMT will be gone, and ISO tax benefits and 409A valuation will remain.

One problem I see is that the extended exercises that are popular these days convert from ISO to NQOs, so I wonder what that treatment will be like.

Contractors lose some flexibility over NQOs, but imho they were unlikely to have extended exercise periods anyways so I think the impact is not as large as communicated?

Executive especially at late stage companies lose out because of the exercise cap, but they're doing extremely well anyways so whatever.

Employees at late stage companies might be in a bind here. They probably won't hit the ISO exercise cap (BC the value should be 409A based target than preferred price based) but the currently popular method of giving out RSUs that don't officially "vest" until the company goes public (or the employee leaves, I imagine) might get affected, and that's potentially significant.

<comment><USER3> > AMT will be gone

Trump is doing this to help himself. I read somewhere that he got hit pretty bad on AMT recently.

<comment><USER4> Let's avoid making the same mistakes the right always makes, namely assuming the worst of people, and always assuming financial motives for peoples' actions.

Trump reducing the AMT for himself seems somewhat unlikely, because:

= The plan(s) are written by the House and Senate, not the administration.

\- he doesn't seem to have given any relevant input to these tax plans except asking for lower corporate tax rate (which he hot only partially)

\- AMT has so many opponents among Republican donors, Trump just doesn't need to get involved.

\- Trump was hit by AMT because he had large losses that are deductible over a certain number of years. Don't remember the number, but I seem to remember they have run out by now. He'd need a new bankruptcy to keep going. And no, morally doesn't count.

\- I'm not sure if he is still motivated by money as much as he used to be. It seems to always have been a plot to get recognition by Manhattan's elites, and therefore would have been eclipsed by his _other_ failed attempt, namely politics.

<comment><USER5> _Let 's avoid making the same mistakes the right always makes, namely assuming the worst of people_

This made me chuckle. You're basically telling people to not do what you just did.

</comment></comment></comment></comment><comment><USER6> At least at my employer, the deferred compensation plan is only offered to high-level management employees ("Director" and above). So this doesn't seem to be a great loss for the average engineer.

If other people who are individual contributors, or even low level managers, have access to an employer deferred compensation plan (different from my experience), I would love to hear about it.

(As a highly paid engineer, I would totally make use of this deferred compensation scheme to lower my tax burden by smoothing out my income, if I could. But I've never been able to.)

<comment><USER7> I've literally never heard of a tech company _not_ offering deferred compensation (either stock options or RSUs).

<comment><USER6> RSUs aren't elective deferred compensation. They're just income at the time of vest. ISOs are a little weirder. Nevertheless, neither is what I'm talking about.

Traditional 401(k)s are a type of _qualified_ deferred compensation plan and are slightly closer to what I have in mind.

The type of plan I am referring to is a _non-qualified_ deferred compensation plan. Unlike 401(k)s, they are not protected from the sponsoring organization (or the sponsoring organization's creditors) accessing the funds, for example, in bankruptcy. On the other hand, they can smooth out income taxes, and are not subject to the same contribution caps as 401(k) plans. Like in a 401(k), these non-qualified plans allow you to control how funds are invested while they are deferred. Unlike 401(k)s, you choose when they will pay distributions in advance.

Here's a little bit more about this kind of plan, from Fidelity: [https://www.fidelity.com/viewpoints/retirement/nqdc](https://www.fidelity.com/viewpoints/retirement/nqdc)

> Most companies provide NQDC plans as an executive retirement benefit, > because 401(k) plans often are inadequate for high earners

</comment></comment></comment><comment><USER8> > Similarly, awards with vesting triggers based on exit events such as an > initial public offering or change-in-control would be taxable on grant > unless they require the recipient to be employed through the liquidity date

Double trigger RSUs are popular in late stage unicorns where the exercise price for ISOs have already hit a high level but the stock isn't liquid enough to sell to cover the tax as they vest.

A lot of people might be affected, I wonder if existing grants are grandfathered in?

<comment><USER9> there is a section in the document called "Grandfathering of Compensation Earned Prior to 2018" =)

<comment><USER10> These grandfather clauses irk me... if the policy is not good enough to stand on its own then it should not be policy.

<comment><USER11> Not at all. It's a recognition that the people who made long-term arrangements under the old law shouldn't be punished for that. The safer people feel making commitments, the more we can pursue things that take time to pay off, which has broad societal benefits. And in practice, laws are much harder to change if you piss off a lot of people who didn't do anything wrong but now suddenly stand to lose big.

As an example, take the mortgage interest tax credit. Personally, I strongly believe it should go away; if the government is going to subsidize housing, it shouldn't spend most of that money on the already well off. But I think it would be wrong to screw all the homeowners who bought a house expecting the credit. We'd see a wave of disruption (short sales, foreclosures, people suddenly barely scraping by) that benefits nobody. So I'm fine with grandfathering existing mortgages and gradually phasing out the credit.

<comment><USER12> It would be totally reasonable to phase out the mortgage interest deduction over ~10 years, giving people time to plan and decide how they wanted to handle it. The cap is currently $1M, let's reduce it by $100k/yr. (or $50k/yr over 20 years)

</comment></comment></comment></comment></comment><comment><USER13> Since most ISOs permit early-exercise, isn't this a moot point? (if a given ISO permits exercise upon issue, since the value of a newly issued ISO must be zero, then this $100K cap is not an issue?)

> In particular, under the current tax rules, the total aggregate fair value > of ISOs that become exercisable for an individual employee for the first > time within a calendar year may not exceed $100,000. ISOs that fail to > comply with this provision are treated as non-qualified stock options. > Companies with higher valuations would easily hit this threshold for > executives and highly-paid employees and therefore would have limited > reprieve from 409B.

EDIT: it says "become exercisable", which is completely separate from actual exercise

<comment><USER14> A lot of larger private companies don't allow early exercise (and even if they did the strike price is often pretty high anyway).

The "become exercisable" language is ambiguous to me.

If you have ISOs that became exercisable in one year that at the time were less than 100k, but you didn't exercise them and they're now worth more than that they still remain ISOs right?

Would you still hit the 100k limit when you tried to exercise them if AMT is repealed or could you exercise all of them and delay the tax burden until you sell them?

If that's the case getting rid of AMT would be a big deal for people in private companies to actually be able to exercise their equity without paying a massive amount of taxes for something they can't liquidate easily.

<comment><USER13> I would never work for a company that doesn't allow early exercise. Whether or not you plan to do it, you have to wonder about the attitude of those in charge if they don't allow early exercise.

<comment><USER15> Allowing early exercise is a legal and accounting headache. Many small startups have a hard time even getting stock option agreements to employees. When you're new, small, and possibly don't even have an HR person you can't really spend time on frivolous things like early exercise.

<comment><USER14> I also thought that early exercise at a certain point could force a company to go public, but it's possible I'm mixing up laws.

I think it had to do with how many share holders you could have, but I think that law also changed to not include employees as share holders.

<comment><USER15> The JOBS Act changed this rule [0]:

"In order to mandate becoming an SEC reporting company, you now would have to have $10 million in assets and at least 2000 shareholders or 500 shareholders who are not accredited investors. Stock issued pursuant to an employee compensation plan would not be counted for this purpose."

0: [https://investmentbank.com/summary-of-jobs-bill-and- update/](https://investmentbank.com/summary-of-jobs-bill-and-update/)

</comment></comment></comment></comment></comment></comment><comment><USER16> _> 409B does not appear to impact the taxation of incentive stock options (ISOs), which in conjunction with the repeal of the alternative minimum tax, would make ISOs more valuable_

So AMT is being repealed now?

<comment><USER17> Yes, which is sort of a shame. Frankly if you were serious about simplifying the tax code and reducing unfairness and asymmetry, you'd __keep __the AMT and throw out the existing income tax.

But whatever: the AMT is an issue for upper middle class taxpayers, and particularly ones (like tech employees, and most particularly startup employees) who see lots of their income in big chunks like stock grants and option exercises. Helping these people is sort of dumb, as they (we) are hardly hurting to begin with. But it won't break the economy either.

Honestly, the Senate plan is... not at all insane (and the House plan only slightly insane). These are relatively modest tax cut bills arriving at a time where the economy is growing and deficits are shrinking, which is exactly where you'd want them. [ _Edit, hoo boy did this statement the trigger the economics folks. This isn 't a growth point, the metric here, which I thought I'd made clear, is "when they are least likely to mess things up". Passing this bill won't break the bank or make progressive reforms in other areas more difficult in the near term._]

After the last year... it's like a breath of fresh air. I still don't think this is Good Policy per se, but the very fact that our government isn't actively trying to make things worse is hopeful.

<comment><USER18> > These are relatively modest tax cut bills arriving at a time where the > economy is growing and deficits are shrinking, which is exactly where you'd > want them.

So you want to cut taxes and increase deficits during growth times? This is, of course, not just different but exactly the opposite of Keynesianism. What is it that you plan to do during recessions? Cut spending and increase taxes to close your deficit?

This is insanity.

<comment><USER19> Keynesian economics is insanity. Disproven by Milton Friedman and others.

<comment><USER18> Milton Friedman was a _monetarist_ which is a belief in controlling the supply of money. That's a different instrument but actually quite similar to Keynes: they are both feedback control mechanisms. That said, monetarism is most definitely NOT _cut taxes and increase spending in good times_. Keynes and Friedman would both call that insanity.

<comment><USER20> Taxes on fiat currency are away to distribute expenses, not a way to raise funds. A fiat currency government can print money whenever it wants, which is taxation via inflation. (For more, see: Modern Monetsr Theory.)

</comment></comment></comment></comment></comment></comment><comment><USER21> Personally happy to see that the new tax code appears to reduce the inequality between staff and executives, with regard to compensation and taxation. I'm a strong advocate for leveling the playing field for EVERYONE; because it eliminates (or reduces to the extent possible) the ability to negotiate these special options for "deferred" compensation.... for which the vast majority of us will never qualify.

<comment><USER22> This doesn't do that at all. It punishes employees 100-1000 of late stage startups with unknown, perhaps bankrupting retroactive taxes. The entire 409a system was designed to protect exactly that group of employee after the dot- com crash, and this undoes it.

Founders and execs likely will be fully vested before their options are worth anything at all (figure 8 years from founding to IPO, 4 years to vest).

</comment></comment><comment><USER23> Tjis tax plan is not likely to pass. It has major stakeholders as active opponents, and an impotant cadre of republican congress-people from coastal states. There's plenty of reporting on Politco or Washington Post that outlines the difficult road ahead for this legislation.

<comment><USER2> The GOP has high risk of losing control of one or both chambers of Congress in 2018 of they don't pass some kind of tax reform.

The contents are in flux but I'd happily wager on them passing _something_ they can point to

</comment></comment><comment><USER24> Oh come on. The absolute last thing we need are more things making it harder for people to keep the options they earned after leaving the company.

<comment><USER7> You're right! Which is why getting rid of AMT will actually make it significantly easier.

<comment><USER24> I was referring to this part: "Similarly, awards with vesting triggers based on exit events such as an initial public offering or change-in-control would be taxable on grant unless they require the recipient to be employed through the liquidity date"

<comment><USER25> In my experience those vesting triggers are much less common than a fixed vesting schedule.

</comment></comment></comment></comment><comment><USER26> Honestly, everyone's just trying to game the system. Someone figures out a way to game the tax code, and then the laws get written to support those games.

Taxes are just too darn complicated! It takes far too long to figure out what I legitimately owe! I shouldn't have to pay a professional or use a computer to figure that out.

<comment><USER27> > Taxes are just too darn complicated!

While I understand this sentiment, I feel that a complicated tax code (or legal code in general) is just where countries end up going as they become larger and more important in the day-to-day lives of its citizens. All the various financial situations in this country are incredibly complicated.

Perhaps we should take a similar route as public defenders (not in practice but in theory, public defenders are horribly under-funded at the moment). The government could provide a tax management program for the general public that does the basics for you. Basically if you qualify for a 1040-EZ you can just use some IRS front-end system. If you have a more complicated situation, then accountants are always available.

I'm frankly disappointed our governments have not done more with the Internet.

<comment><USER26> The problem is that TurboTax lobbies against this. Basically, they benefit from our current system. That's why proposal for things like the IRS filling out your taxes for you are illegal.

Really, what should happen is that the IRS mails you your taxes already filled out, you check for errors and fill in the things that aren't reported, and mail it back. This would kill TurboTax's business, so they lobby against it.

<comment><USER28> So the solution isn't to nerf the existing tax code, but instead to elect representatives that are actually looking out for their electorate instead of companies like TurboTax.</comment></comment></comment></comment>