Dual Numbers and Automatic Differentiation (2014) - <AUTHOR> http://blog.demofox.org/2014/12/30/dual-numbers-automatic-differentiation/ <comment><USER2> BTW this older article of mine is extended with a new one that shows how to handle multiple variables (: [http://blog.demofox.org/2017/02/20/multivariable-dual- number...](http://blog.demofox.org/2017/02/20/multivariable-dual-numbers- automatic-differentiation/)

<comment><USER3> _> If I had to guess, I'd say that dual numbers may be slightly slower than backpropagation_

The cost of Dual numbers (a form of forward-mode differentiation) scales linearly with the number of derivatives (just like finite differencing, but more accurate). Backpropagation, or reverse-mode differentiation, is a constant factor times the cost of a function evaluation. For neural nets with millions of parameters, backpropagation is going to be millions of times faster than dual numbers.

<comment><USER4> [http://www.denizyuret.com/2015/02/beginning-deep-learning- wi...](http://www.denizyuret.com/2015/02/beginning-deep-learning- with-500-lines.html)

This guy did neural nets with dual numbers in julia and found it to take ~1.2 times as long as standard backpropagation, which suggests that if you had dedicated hardware for it it would be very nice.

<comment><USER3> I think you're assuming that "automatic differentiation" (AD) is the same thing as "using dual numbers", but AD is a family of methods including dual numbers. The blog post you link to says they're using [https://github.com/denizyuret/AutoGrad.jl](https://github.com/denizyuret/AutoGrad.jl) which uses reverse-mode differentiation not Dual numbers. That means they're performing the same operations (or nearly the same) as standard backpropagation.

Dual numbers are just the wrong approach for neural nets, which have many parameters. The _amazing_ thing about backprop / reverse-mode differentiation is that you get the derivatives wrt _all_ the weights in one reverse sweep through the network.

<comment><USER4> Huh. I stand corrected. I thought for sure the package used automatic differentiation using dual numbers.

</comment></comment></comment></comment></comment><comment> one-more-minute Check out ForwardDiff.jl [1], which is a really impressive implementation of this exact idea. The technique gets pretty magical results; you can apply it to any function, complete with loops, linalg etc, and it will compute a derivative with something like 10% overhead. The standard approach is finite differencing, which involves many-times overhead, isn't exact, and can easily blow up for common pathological cases like step functions.

Fede_V's points about the drawbacks of the technique are valid in C++, but Julia's duck-typing makes being generic the default (including in the standard library). ForwardDiff works out of the box, for free, in a huge number of cases.

[1] [https://github.com/JuliaDiff/ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl)

<comment><USER4> I hesitate to call what julia does "duck typing" because types are usually checked at _compile time_ , even though it looks like "run-time" because the system holds off on compilation until it's needed. If you write your functions correctly, (with type stability) there is no active type checking that's done after the first time you call the functions.

There certainly is run-time checking in julia (true duck-typing) if you are not careful with how you write your functions, but I doubt that ForwardDiff, for example, uses it.

<comment> one-more-minute By duck typing, I mean that you can write:

        f(x) = x^2 + 2

for example, and the function will happily run with any type that supports multiply and add. This is in contrast to languages where `x` has to explicitly inherit from a given supertype or implement an interface to be valid. It's true that Julia will specialise the function for ints or complex numbers or whatever, but that's an implementation detail which doesn't change the meaning of the program.

</comment></comment></comment><comment><USER5> This is a great post. However, it didn't touch on the two main problems of AD:

\- Using Dual Numbers requires that all functions that you call into accept templated parameters. If you want to use GSL, BLAS, or any other mature math library, you are probably out of luck.

\- Even if you are willing to port the code and modify the functions to accept templated parameters, very highly optimized math libraries make assumption not just about the behaviour of numbers (their API, defined by how they behave under addition/subtraction, etc) but also about their ABI. For example, a well tuned LAPACK like OpenBlas or MKL has very well tuned loop sizes to optimize cache behaviour assuming that floats are of a particular size.

<comment><USER3> If the function is analytic and supports complex numbers (usual in Matlab/Numpy/Fortran/...), but you're only interested in the real part, a quick hack is to abuse complex numbers and compute imag(f(x+i*epsilon))/epsilon. That one-liner can often give the right answer to machine precision for small epsilon. [http://blogs.mathworks.com/cleve/2013/10/14/complex-step- dif...](http://blogs.mathworks.com/cleve/2013/10/14/complex-step- differentiation/)

For matrix-based code, a good note on derivative propagation is [https://people.maths.ox.ac.uk/gilesm/files/NA-08-01.pdf](https://people.maths.ox.ac.uk/gilesm/files/NA-08-01.pdf) — the symbols with dots on top are forward-propagated derivatives like dual numbers. The symbols with bars on top are back-propagated derivatives, which is what you want to compute lots of derivatives at once. "Machine learning" libraries like Theano, TensorFlow, and Autograd will compute the reverse mode operation for many linear algebra expressions automatically, and use reasonable libraries like BLAS+LAPACK or Eigen under the hood.

</comment></comment><comment><USER6> Using dual numbers and modern C++ you can write a library that can do this:

        auto lambda =
            [](auto x, auto y)
            {
                // The Rosenbrock function.
                auto d0 =  y[0] - x[0]*x[0];
                auto d1 =  1 - x[0];
                return 100 * d0*d0 + d1*d1;
            };

        // The lambda function will be copied and
        // automatically differentiated. The derivatives
        // are computed using templates, not numerically.
        //
        // No need to derive or compute derivatives
        // manually!
        auto func = make_differentiable<1, 1>(lambda);

"func" now has code for first-order, second-order derivatives all generated and heavily optimized at compile-time. This is one reason C++ is so good for (mathematical) optimization.

</comment><comment><USER7> One of the libraries I'm using for computer vision depends on using the inner dual number class Jet [0] from Google's ceres-solver to do automatic differentiation.

It was worthwhile research reading through the implementation to understand the applications.

[0]: [https://github.com/ceres-solver/ceres- solver/blob/master/inc...](https://github.com/ceres-solver/ceres- solver/blob/master/include/ceres/jet.h)

</comment><comment><USER8> Super cool. In this example, it's differentiation of a one-dimensional curve, but one can use the dual numbers to compute tangent spaces of more interesting algebraic objects as well. See, e.g. remark 5.38 here: [http://www.jmilne.org/math/CourseNotes/AG500.pdf](http://www.jmilne.org/math/CourseNotes/AG500.pdf)

</comment><comment><USER9> Dual numbers are a blast, especially with type-templated languages. I wrote a Scala implementation some time ago that I would like to share: [http://www.win-vector.com/blog/2010/06/automatic- differentia...](http://www.win-vector.com/blog/2010/06/automatic- differentiation-with-scala/)

</comment><comment><USER10> I've implemented this in Python a while ago, also (ab)using operator overload: [https://github.com/boppreh/derivative](https://github.com/boppreh/derivative)

Not remarkable, but works.

        f = lambda x: x * 5 + x ** 2 - 2 / x + 3 / x ** 2
        print(derive(f, 6))

<comment><USER11> Similar: [https://github.com/darius/sketchbook/blob/master/misc/autodi...](https://github.com/darius/sketchbook/blob/master/misc/autodiff.py)

</comment></comment><comment><USER12> An extension to multiple dimensions is mentioned. This would be exactly geometric algebra, wouldn't it?

<comment><USER13> It would be a subset of geometric algebra. Geometric Algebra is more generic as it defines signature e_i * e_i := {-1,0,1} (where e_i are unit vectors) and defines an exterior algebra [1].

So a 1 Dimensional geometric algebra with the signature e_1 _e_1 = e_ e := 0 is isomorphic to dual numbers.

[1] [https://en.wikipedia.org/wiki/Exterior_algebra](https://en.wikipedia.org/wiki/Exterior_algebra)

</comment></comment><comment><USER14> I don't like this use of dual numbers notation for differentiation because division by a dual number is not defined. For example, how would one calculate ε^2/ε? If ε is a matrix [0,1;0,0] then it doesn't have inverse and thus the expression could not be evaluated.

On the other hand, little-o notation [1] was invented for exactly this purpose. It is easy to evaluate derivatives using it, for example (x+ε)^3 = x^3+3 _x^2_ ε+o(ε), and so ((x+ε)^3 - x^3)/ε = 3*x^2 + o(1), and o(1) tends to 0 for ε tends to 0.

[1] [https://en.wikipedia.org/wiki/Big_O_notation#Little- o_notati...](https://en.wikipedia.org/wiki/Big_O_notation#Little-o_notation)

<comment><USER4> Epsilon squared divided by epsilon is most definitely epsilon.

<comment><USER15> It is most definitely not. For starters, you could also have argued that ε^2/ε = 0 since the numerator is 0.

</comment></comment></comment><comment><USER16> The article is interesting but one have to be aware that dual number are not a solution to automatic differentiation.

The reason is that to have automatic differentiation one needs to keep in principle the epsilon^n for any order and the dual number just take epsilon^2 = 0 which is an strong limitation.

For example with dual number you can say that:

limit(x->0) (sin(x) - 1) / x = 1

just by doing x = epsilon but they will fail with:

limit(x->0) (cos(x) - 1) / x^2 = -1/2

because the quadratic terms you need will go to zero for x = epsilon.

<comment><USER17> >The reason is that to have automatic differentiation one

>needs to keep in principle the epsilon^n for any order and

>the dual number just take epsilon^2 = 0 which is an strong

>limitation.

Actually not. Differentiation in an abstract sense is the change of the function, _approximated linearly_. This means: when you do normal differentiation, you basically do already throw away the squared terms. The Leibniz notation for a differentiated function df/dx is really explicit about this principle - as opposed to the Newton notation f'(x).

What these people call dual numbers automatic differentiation is a really powerful tool. In a more abstract sense, having an object and adding a small epsilon to it, allows you differentiate much more general objects. For instance I could ask: how does a function S[f] of a function change with respect to a function f. I know this sounds like abstract non-sense but you can for example calculate the curve of a rope with it by solving dS[f] = 0 to f.

>limit(x->0) (sin(x) - 1) / x = 1

>just by doing x = epsilon

No, that's not the case. If you use the L'Hospital rules, you throw away the epsilon (it's constant) and the derivatives of both enumerator and denominator don't change. Thus the two limits stay the same.

</comment></comment><comment><USER18> Anyone else know this guy from his shadertoy profile?

<comment><USER2> Too funny, what's your shadertoy handle? (this is demofox)

</comment></comment><comment><USER19> I'm not a math guy, but I've gotten incredible usage out of Dual numbers over the years. Highly recommended.

<comment><USER20> Could you elaborate?

Imho, the article is not very convincing, since Dual numbers require double amount of work per operation (making the computation of the derivative not "free" or "automatic").

The concept, however, seems very interesting, so I'm wondering about other applications.

<comment><USER19> To follow up on what @zardo said, it's also not "double the amount of work" in a language like C++ _on the coding side_ , because you just replace `float` or `double` by your Dual number type and read off the derivatives as needed.

So, the "work" is almost nothing vs. computing derivatives by hand, which requires entirely different math. Furthermore, the actual CPU instructions are generally lower with a Dual implementation, usually because transcendentals and the like aren't computed over and over again—although this is obviously computation-dependent.

An example of a project that uses automatic differentiation in a really useful way is the Ceres Solver.[0]

[0] [http://ceres-solver.org/](http://ceres-solver.org/)

</comment></comment></comment><comment><USER21> How would this work with second, third, etc, derivatives?

<comment><USER22> This is where it gets complicated.

I'm not sure where the term "Dual Numbers" came from, but in the numerical math community, this is known as Complex Step Differentiation. [https://en.wikipedia.org/wiki/Numerical_differentiation#Comp...](https://en.wikipedia.org/wiki/Numerical_differentiation#Complex_variable_methods)

Complex step is only straightforward for first-derivatives. For second-order and above, there are a number of competing techniques. One of them is multicomplex numbers.

From a performance perspective, Automatic Differentiation pretty much outperforms complex step methods in most situations. The only reason to use complex step methods is when you have a very fast language with a complex types (i.e. FORTRAN) and you need a quick-and-easy way of getting 1st order derivatives.

Otherwise, just use AD.</comment></comment>


Ask HN: Personal Dashboard? - <AUTHOR> What frameworks or services do you use for personal dashboards? Something to keep all of your tasks, goals, financials, etc in one place. Something with api integration for other services like Mint, Todoist, Evernote, etc. Does such a thing exist? <comment><USER2> I don't really need those things in one place because of the time scales involved.

For example, financial goals might be years away, while tasks might only be minutes away. I don't need to see my financials on the same screen -- they're not going to change drastically on a minute-to-minute (or even month-to-month) basis.

I've never thought about integrating long-term things like financials or goals into my task list before for that reason. Thinking about it now, I can't see any value for me personally, and it would actually decrease the value of my task list.

</comment><comment><USER3> I'm building it for myself, since I don't think anything will do exactly what I want it to. I wrote [https://github.com/upvalue/meditations](https://github.com/upvalue/meditations) for this, but it's not nearly as powerful as I'd like and after thinking about this for a long time, I have a pretty solid idea of what I want to do for the next rewrite.

I expect to handle like 80% of what I want and the rest will just have to be bespoke code and other applications (e.g. I don't expect to handle finances -- I'll continue using YNAB but import from it using its API to display financial info in the same place as everything else).

<comment><USER4> The devil is in the details. I've been working on something similar (looks very different, but similar goals), and I am on my 4th re-write :)

I've worked on some very complex software projects, but creating a simple task/habit tracker that is actually useful has been more difficult than I expected.

<comment><USER3> Yep, I think this is the fifth? I've lost track honestly. I do use it daily, but I know I can do a lot better. The next one probably will not have any noticeable Trello/kanban heritage.

I will say for those working on their own, I started to make breakthroughs on this when I stopped worrying about what other people might want for the eventual open-sourcing or SaaS and just made exactly what I wanted to.

</comment></comment></comment><comment><USER5> I made one step lower: a collection of microservices that wrap up the APIs of services I use into a cohesive interface and authentication (JWT).

The intention of the project was less about the cohesive interface and more just making it easy for me to do automated data dumps.

[https://gitlab.com/TheWatchers](https://gitlab.com/TheWatchers)

It does feed back into a dashboard I wrote but the code is super simple and dumb. I don't even know if I have open-sourced it. Let me check. You'd have to go in and change stuff probably because it was never meant to be given out.

</comment><comment><USER6> I don't think that a good one of these exists or can easily be made because the difficulty of integrating with third party services. Plus, those third parties may not look the same for everyone else.

This is a category of startup I would call "integration hell." For the most part, I would recommend to avoid these ideas if you're looking at pursuing it. However, it can be fruitful if done correctly - i.e Stripe.

</comment><comment><USER7> Exist[0] is as close as I can think for this type of thing.

[0][https://exist.io](https://exist.io)

<comment><USER8> Looks like a cool service but sounds somewhat off-putting in that they will have all those data about my behavior. Maybe it would be cool to be able to self-host.

<comment><USER5> It's just a couple from Australia running it.

They're pretty cool and nice. If you send a support request, it will be one of the developers... who are also the owners.

They also have an option to destroy all the data they have on you.

<comment><USER8> Thanks for sharing, I didn't know that.

Good to know that the owners are "pretty cool and nice" but that is orthogonal to the point.

> They also have an option to destroy all the data they have on you.

Unless open source, the users never know if the data is destroyed or not. Furthermore, it is impossible for the users to verify the checksum of software running on the server side. Therefore on-premise install could be a nice solution.

</comment></comment></comment></comment><comment><USER9> Just use a text file. I once wasted one year creating some such thing: [https://github.com/LibreTask/website/blob/master/public/imag...](https://github.com/LibreTask/website/blob/master/public/images/libretask_demo.gif)

</comment><comment><USER10> Hi, fellow HN readers. My friend and I are building the same service where user can choose a widget of their choices (as mentioned in some comments, we think this idea is going to be bottlenecked by the # of integrations), drag and drop, and resize on the screen.

I'm curious how many people would want/benefit from a service like this?

</comment><comment><USER11> After trying just about everything, I've come full circle to...text files. Specifically, I use Emacs, with a mix of markdown and org-mode. I use a few techniques (Eisenhower matrix, GTD, etc.) to organize things.

Now, a few years in, I've got a fairly simple, light, extremely portable system.

</comment><comment><USER12> Like others here, I am building something myself [1].

[1] [https://dashboard.darekkay.com/docs/](https://dashboard.darekkay.com/docs/)

</comment><comment><USER13> You might want to take a look at Netvibes[0]

[0][https://www.netvibes.com/en](https://www.netvibes.com/en)

<comment><USER14> Wow. I remember setting up a NetVibes dashboard back in college (circa 2006). I can't believe they're still around.

</comment></comment><comment><USER15> This service might do what you want [https://tryshift.com/](https://tryshift.com/)

</comment><comment> d--b Call me old school but Excel works well for me...

</comment><comment><USER16> And here I am, thinking I'm the only fool who's rebuilt a private personal dashboard app 5 times in the past 10 years..

<comment><USER16> Guessing all of you suffer from over-generalization too. One time someone told me I was "too meta" and I thought it was a compliment.

</comment></comment><comment><USER17> Not that I know of, but I would be really cool. You thinking about building one?

<comment><USER18> I am. Lots of thoughts, not much action, so far though ...

<comment><USER19> I am building something that fits this need ([https://www.aspen.cloud/owners](https://www.aspen.cloud/owners)). It lets you pull together all of your personal data into on database and build apps on top of it! Let me know if you want to contribute, have feedback, or want early access!

</comment></comment></comment><comment><USER20> Any tool for this MUST be self hosted.

</comment><comment><USER21> I use notion

</comment><comment><USER22> A page of iframes would do it!

</comment><comment><USER23> wtfutil</comment>


New Study Confirms That American Workers Are Getting Ripped Off - <AUTHOR> https://nymag.com/daily/intelligencer/2018/07/oecd-study-labor-conditions-confirms-that-u-s-workers-are-getting-ripped-off.html <comment><USER2> My thought here is that there is a significant lack of outrage in weak wage growth and income disparities because the data is not relatable enough. There's certainly some protest at the most abhorrent levels of minimum wage meeting acceptable levels for a living, but shouldn't everyone from the upper to lower class be up in arms if there is such a favoritism toward executives and shareholders? Maybe something along the lines as showing what normal wage growth in tangible quality of live areas (e.g. this is the home you could afford) would look like for certain income levels might be a better way to explain this.

<comment><USER3> _" shouldn't everyone from the upper to lower class be up in arms if there is such a favoritism toward executives and shareholders?"_

Most people are just too tired, too busy with their own lives, too disillusioned with idealistic promises of change, and too fearful of repercussions to try to rock the boat unless they're starving and have nothing to lose.

As long as they've got their bread and circuses, nothing will substantively change.

Even if/when it does change, history shows that we'll probably just wind up with a new boss who's the same as the old boss.

<comment><USER4> > Even if/when it does change, history shows that we'll probably just wind up > with a new boss who's the same as the old boss.

But history doesn't show anything of the sort? History instead shows a clear path to how Europe ended up with the bottom 50% ending up with a much larger portion of wealth than the top 1%.

What's remarkable here is not how impossible change is, but how Americans have utterly resigned themselves to the supposed unchanging inevitability of their current situation despite clear evidence that alternative modes of operating aren't just _possible_ but clearly _exist_ right now.

America's primary problem with change seems first and foremost to be its own fatalistic delusion that being any other way is impossible.

<comment><USER5> s/bottom 1%/top 1%/ ?

Otherwise that's trivially true for all countries, no?

<comment><USER4> Whoops, top, yeah.

</comment></comment></comment></comment></comment><comment><USER6> I sometimes ask people how their employer justifies operating a bus service to take them to and from work, but not the additional real-estate cost of giving you a bit of personal space in the workplace.

I'm guessing that they do this because it is "easy" to take away lifestyle benefits if the numbers aren't working but it is "hard" to reconfigure real estate to stuff more people into the same space.

High end, class A office space is $10/sq foot per month in Silicon Valley. An open office plan allocates roughly 15 square feet to each employee ($150/month or $1,800/year). That employee is typically generating more than $10,000 of net income per year to the bottom line for all of the top tech companies). It took Ford nearly 100 people to develop a new automobile feature that could differentiate their cars in the market, it takes Facebook about three. And Ford gave every engineer in that group of 100 an office of their own to work in.

So yeah, times have changed and the employees aren't benefiting as much as they used to. The only question is whether or not they will do anything about it.

<comment><USER7> _That employee is typically generating more than $10,000 of net income per year to the bottom line for all of the top tech companies_

I think your math is a little off: [http://www.businessinsider.com/revenue- per-employee-at-apple...](http://www.businessinsider.com/revenue-per-employee- at-apple-facebook-google-others-2016-2)

...even if you're only talking about profits: [http://www.businessinsider.com/apple-facebook-alphabet- most-...](http://www.businessinsider.com/apple-facebook-alphabet-most- profitable-companies-per-employee-2017-12i)

Not to promote Business Insider, they were just the top hits with the charts.

<comment><USER6> Apple is pretty extreme and yes, I was trying to focus on just net revenue so after everything else, free cash flow on a standard accounting basis.

It just makes the argument stronger in my opinion, if you're bringing the company more than $1M/year in free cash flow why can't they build you an office everyone can enjoy working in?

<comment><USER7> Absolutely.

</comment></comment></comment></comment><comment><USER8> As a partial rebuttal to the article's points about income inequality, it seems worthwhile to quote one of PG's better-known essays [0]:

> _Variation in wealth can be a sign of variation in productivity. (In a > society of one, they 're identical.) And that is almost certainly a good > thing: if your society has no variation in productivity, it's probably not > because everyone is Thomas Edison. It's probably because you have no Thomas > Edisons._

> _In a low-tech society you don 't see much variation in productivity. If you > have a tribe of nomads collecting sticks for a fire, how much more > productive is the best stick gatherer going to be than the worst? A factor > of two? Whereas when you hand people a complex tool like a computer, the > variation in what they can do with it is enormous._

Now, the middle-class and upper-middle-class do subsidize the wealthiest Americans as a result of the US's tax structure, and that's a problem. But aside from that, the fact that the top quantiles in the US are wealthier than their equivalents elsewhere is not fundamentally a bad thing.

[0] [http://www.paulgraham.com/gh.html](http://www.paulgraham.com/gh.html)

<comment><USER9> I am surprised by how infrequently I see the arbitrary progressive tax bracket levels being brought up in these debates. The fact that you are considered ultra wealthy and paying at about the top bracket at ~200k per year is absurd. Meanwhile there is no progressive taxation for capital gains. The highest brackets should be stretched into the tens of millions (or even in the hundreds), and taxes should be significantly lower for the upper middle class (for whom it is increasingly difficult to become upper class through hard, good work and a somewhat standard career directory).

<comment><USER8> Better yet, tax wealth instead of income. The value derived from government services is more closely proportional to wealth than to income, and income- based taxation is inherently regressive compared to wealth-based taxation. The only significant wealth-based tax in the US is property tax, and even that is somewhat regressive because the share of income and wealth spent on housing decrease as income and wealth increase.

<comment><USER10> Inflation is the tax on wealth, and much easier to administer and harder to avoid than a wealth tax program would.

<comment><USER11> Inflation is a tax on cash, not wealth

</comment></comment></comment></comment></comment><comment><USER12> >Further, the OECD finds that only Turkey, Lithuania, and South Korea have lower unionization rates than the United States, a fact that can be attributed to the myriad ways American policymakers have undermined organized labor since the Second World War. And a government that discourages unionization — and alternative forms of collective bargaining — is one that has decided to cultivate an exceptionally large population of "low income" workers, and an exceptionally low labor-share of national income.

I continue to wonder why technology workers (some of whom write article after article about how poorly they're treated) approach unionization with such a sour attitude and instead magically expect things to improve.

<comment><USER13> because they can negotiate a better deal despite the illegal no poaching agreements.

</comment></comment><comment><USER14> Yet, American workers keep voting for the people that rip them off. If you never learn, things will never change.

</comment><comment><USER15> Time to trot out my favorite quote: "Socialism never took root in America because the poor see themselves not as an exploited proletariat, but as temporarily embarrassed millionaires." \- Ronald White, paraphrasing John Steinbeck.

The prideful are painfully easy to rip off. But just like any con, a little vigilance goes a long way. It's not hard to see rising trends, and the trend has been towards the trades for at least a decade now. It's not hard for plumbers to make more than lawyers these days.

<comment><USER16> I wanted to create a new party called the middle. As the poor and the rich are arguing over who gets what the middle class is getting gutted.

<comment><USER17> I always thought that the 99 percenters should become the democrat counter to the republican tea party.</comment></comment></comment>


Understanding Monads - <AUTHOR> http://jezenthomas.com/understanding-monads/ <comment><USER2> $40 seems really expensive for a short book like this. I'd love to read a few objective reviews to see if it's worth the price.

For $10 I'd buy without thinking. For $20 I'd probably buy with an Amazon type consensus. But for $40 I'd need a few trusted reviews before a blind purchase from a self publish.

 _Not that there 's anything wrong with self publishing ... just that there's no judge of content or quality as there isn't a "style" for the publisher._

<comment><AUTHOR> That's a fair comment. I didn't buy the book _completely_ blind; I read a tutorial Brisbin wrote on his blog on building a simple web app with Yesod. I thought he wrote clearly and concisely, and he didn't gloss over parts that would otherwise be a total roadblock for me. As I mentioned in the article, I don't know the guy, so I can't speak on his behalf. But, maybe write to him and see if he can cut you a deal?

In any case, I'm not made of money but given the choice again I wouldn't hesitate to pay the money to gain that much knowledge.</comment></comment>


DCI and Decoupling Business Logic from Ruby on Rails Part 1 - <AUTHOR> http://lancecarlson.github.com/2012/05/15/dci-and-decoupling-business-logic-from-ruby-on-rails.html

<comment><USER2> I've been applying DCI with my team for the past few months and have found it allows for much greater flexibility in design. We can keep our classes small and cohesive and in turn we find the code easier to understand in a lot of ways. Specifically, the fact that design can be driven by scenarios centered around the contexts gives a clear flow of logic from the controller to the domain.

In a lot of ways DCI will almost seem a bit like having a meta-MVC within your MVC application. I like to think of it as a MVC-like pattern for the domain, decoupling your domain from the infrastructure of the web-tier.

If you are unfamiliar with DCI, I'd recommend checking out the Oredev videos where it was first introduced:

<http://vimeo.com/8235574>

<http://vimeo.com/8235394>

Also Jim Gray is currently working on a book (I've pre-ordered and get the chapters as they are being written) <http://clean-ruby.com/>

<comment><AUTHOR> I'm not sure I can consider it a meta MVC pattern however. They way I use it is a completely separate pattern in a completely different application.

By decoupling the business layer from the delivery mechanism (the web), I can use DCI as a pattern the effectively organizes my business application and use MVC specifically for my display/web application. Although, the MVC pattern sort of breaks down when you abstract out your business layer and your infrastructure layers. It turns into something more like VC where your controllers interact with your interactors and push the data to the views depending on the interactor logic.

</comment></comment><comment><USER3> This is an interesting approach.

One change I would make is in the testing of the lib directory. I've found it best to separate the testing of the lib directory contents from the unit and functional tests that are baked into Rails. It requires a bit of custom setup, but it's easy to reuse in other applications.

1\. Create a test/lib directory

2\. Create a lib/tasks/test_libs.rake file

3\. Put the following into the Rake file[1]:

        namespace :test do
          desc "Test libraries"
          Rake::TestTask.new(:libs) do |t|
            t.libs << "test"
            t.pattern = 'test/lib/**/*_test.rb'
            t.verbose = false
          end
        end

        lib_task = Rake::Task["test:libs"]
        test_task = Rake::Task[:test]
        test_task.enhance { lib_task.invoke }

4\. Run `rake test:libs` to test just your lib directory.

[1] Credit goes to <http://stackoverflow.com/a/1588496> for this Rake task.

<comment><AUTHOR> Just to be clear, the code inside of the lib and test directories is not actually inside of our rails application. They're inside of a different git repository and are packed as a separate gem. It makes more sense to me once you've isolated the code this way that you would then write "use case tests" and then role tests (which I haven't gotten into yet.. next post :))

</comment></comment><comment><USER4> Does anybody else see similarity between this

      authenticate = SApp::AuthenticateUser.authenticate(...
      action = authenticate.action
      if action != :login_error
        redirect_to "/#{action}"
      ...
      def find_account
        @account = SApp::FindAccount.find(@account_subdomain)
      end

and this <http://en.wikipedia.org/wiki/Inner-platform_effect> <http://thedailywtf.com/Articles/Soft_Coding.aspx>

<comment><AUTHOR> Do you have any better way of approaching this?

I mainly posted code examples to show the general idea of what I'm trying to describe. My actual code base has a lot of logic locked behind the authentication and which action to take after the user is authenticated (there are about 4 different places they could land).

4 other use cases are then discovered in the underlying app depending on which action they are taken to.

<comment><USER4> > Do you have any better way of approaching this?

No, but frankly speaking I don't get the idea from the keynote speech.

2012 and there are no example apps of that concept. I don't get it.</comment></comment></comment>


Parody (in Go) of some of the basic Python core features (collections package) - <AUTHOR> https://github.com/marcsantiago/collections <comment><USER2> Are you sure you mean "parody"?

> an imitation of the style of a particular writer, artist, or genre _with > deliberate exaggeration for comic effect_.

These seem pretty faithful, and useful since Go lacks many 'batteries included' we take for granted in other languages

<comment><USER3> Probably meant parity</comment></comment>


Show HN: Tasktopus – lightweight, offline task manager for Mac OS X and Windows - <AUTHOR> https://gumroad.com/l/ADWm/tasktopus <comment><AUTHOR> Hi everyone,

This is my newly finished side project. Built on Qt 5.5 (QML, C++).

I have used web-based task/todo lists (trello, asana, etc.) but I wanted something that could be used offline - my work does not allow storing company sensitive data on 3rd-party servers.

Started the project with Electron, using AngularJS and Angular Material. That allowed rapid prototyping with a slick UI and it was fairly easy to find additional Angular-based plugins. My main motivation in selecting Electron and Angular was to learn the two technologies (easier to learn something by doing a project in it). Screenshot: [http://imgur.com/NZzEFKX](http://imgur.com/NZzEFKX)

Had a few issues with the Electron app - big download size (50-70MB zipped), no print functionality, app felt non-native, very convoluted process to get it published on the Mac App Store.

Decided to change the tech stack to Qt/QML. I have published C++-based games, built on Cocos2dx. Wanted to try Qt to build a serious app.

Gumroad has been a slick experience - I have opted for the fully functional trial option and let the user buy a license to use beyond the trial period. Gumroad's onboarding (buy workflow) and tech (license key generation and validation) have been a revelation.

-Kid</comment>


Samsung unveils Galaxy Gear smartwatch accessory - <AUTHOR> http://www.bbc.co.uk/news/technology-23961692 <comment><USER2> There really isn't anything here that would have me wanting to get one. I feel this is a preemptive me too device with no real product vision. Well, other than "we really need to get a watch out before Apple so we can say they copied us".

<comment><USER3> There isn't anything about any smart-watch that would have me wanting to get one. Apple's is going to be equally useless.

The ridiculous part is the price-point. People who spend $300 on a watch, want something that looks nice. They don't want to spend $300 to strap a smart- phone to their wrist, when they already have one in their pockets.

<comment><USER4> I'm glad I wasn't the only feeling this. It seems almost a foregone conclusion to tech "pundits" that watches are going to be the salvation for Apple's iPhone fatigue. I just don't get it, the biggest use case is usually "your smart phone is in your pocket, now you won't have to get it out". The only time my smartphone is't already visible is when I am walking or eating dinner (and most of my friends continue to put their smartphones out on the table when eating out).

<comment><USER5> Until some wearable device can actually replace a smartphone instead of complement it, I think you're right. Not many people want to carry yet another device, so you've got to have a pretty awesome and broadly appealing use case to convince them to do so. I just don't see it with the Gear (or the Glass for that matter).

</comment></comment></comment></comment><comment><USER6> This smells like a flop to me.

</comment><comment><USER7> It is really surprising how Pebble hit almost all the right spots [ form factor, multi-day battery, screen readability, standard watch strap, hardware buttons, SDK ]. Sure there is room for improvement but we've now seen three big tech companies ( Sony, Samsung and Qualcomm) bringing in smartwatches and none of them got close to Pebble.

</comment><comment><USER8> I love their verdict on the casio calculator watch _The original and the best!_ :)

</comment><comment><USER9> Consider the use case of an authentication token. I would use a watch for unlocking a phone, password manager, or laptop.

However, Bluetooth and a monochrome LCD would get the job done just fine.

<comment><USER10> I read that the Sony SmartWatch also supports NFC. It would be interesting to see if a standalone smartwatch app could support NFC building entry (like a replacement for your company badge). It'd be a much nicer form factor and I'd be significantly less likely to forget it at home or at my desk.

Though it's worth noting, with August and Lockitron keyless entry systems being shipped this year, I wonder if the same can't also be accomplished with the existing BLE implementation by Pebble/others

</comment></comment><comment><USER11> Not hugely impressive, but it could be worse. If it were $100 cheaper and had a front-facing camera I might actually want one.

</comment><comment><USER12> At least pebble looks good.

<comment><USER13> love my pebble - wish it wasn't as 'clunky', but it's exactly what a smartwatch should be - an accessory for my powerful smartphone, making my smartphone experience better. However, it recently died and i'm finding that pebble support is almost as bad as google support.

</comment></comment><comment><USER14> ugly... sorry, I like the concept but I have to wear this?</comment>


Being the Cat Herder at BBC for the Olympics project - <AUTHOR> http://aledalgrande.posterous.com/being-the-cat-herder-at-bbc-for-the-olympics

<comment><USER2> As one of those "from the US" watchers, just wanted to say you guys did some amazing work. I was constantly impressed with the quality of the streamed video and how well it stayed up under so much load.

So huge props all around and thanks for not flipping out at those of us stealing some traffic for a better Olympics experience.

<comment><AUTHOR> Thanks :)

</comment></comment><comment><USER3> BBC staff (perhaps not contractors) do get access to discounts and other benefits with Apple and many other companies as well as offering staff discounts for some BBC events (tours, proms) but these are not guaranteed.

<comment><AUTHOR> Yes, probably perm get some discounts, but what I found peculiar is that there is not a queue "jump" compared to non-staff people.</comment></comment>


A Middle Ground Between Contract Worker and Employee - <AUTHOR> http://www.nytimes.com/2015/12/11/business/a-middle-ground-between-contract-worker-and-employee.html <comment><USER2> "on a 1099 model it's tougher to compel them to show up."

Translation: Show up or be fired. Restaraunts have had this policy since the beginning for high trafic days.

/S American employement-at-will at work.... S/</comment>


Study shows where the brain transforms seeing into acting - <AUTHOR> http://picower.mit.edu/news/study-shows-where-brain-transforms-seeing-acting <comment><USER2> I thought that the new phrenology (localizing some cognitive activity spatially somewhere in the brain) is dead. Late William Uttal provided empirical arguments to the effect that new phrenology is dead.

This said research is about mouse. Love to see this experiment performed on many human beings, at many sites, but by different research teams, with the the same spatial identity. Meta analysis on these as well. Until then, I am skeptical.

<comment><USER3> Well, there are certainly specialized brain regions for _some_ tasks - e.g., we know certain structures in the visual cortex are responsible for extracting low-level image features (edges, lines, shapes, etc as well as attributes such as speed and direction). We even have a pretty good idea _how_ they do that - good enough that early neural network research was inspired by it.

I'm highly skeptical as well though that this works for high-level cognitive tasks.

I'm also a bit confused by the way the article describes the task. They describe it as "the link between seeing and doing" as if that were some low- level, easily predictable reflex. But if you put it that broadly, wouldn't that entail almost _all_ cognitive decision making?

<comment><USER2> Actually, localization is true for the early phases of input systems (sensory) and for the later phases of output systems (motor).

From the published paper:"This strongly suggests that PPC neurons encode choice-related signals related to decision formation or motor planning." 'Decision formation', if seen in isolation, sounds like a higher cognitive process; however, it is 'motor planning'. Here, one has enough freedom to fall back on the motor system and its dependence on the sensory system as well.

</comment></comment></comment><comment><USER4> Twinkle twinkle Little Star</comment>


Show HN: We made a community-powered cost of living insight site - <AUTHOR> https://costof.live/ <comment><USER2> Wow, great UI. Reminds me of [https://nomadlist.com](https://nomadlist.com)

</comment><comment><USER3> can we say that this is Numbeo with a slick design?</comment>


How lego model design applies to software development - <AUTHOR> http://lunatractor.com/2012/12/16/software_design_lego/

<comment><USER2> I still regret that I no longer have the suitcases of lego that I acquired as a child.

I don't think I was ever disappointed with a Lego product.</comment>


Nutrition is personal. Identical foods responds differently in individuals - <AUTHOR> http://news.meta.com/2015/11/19/cell-nutrition-is-personal-identical-foods-produce-healthy-and-unhealthy-responses-in-different-individuals/ <comment><USER2> The reaction to food is related greatly to gut flora. It seems like they collected samples of feces but I'm not clear how much weight they gave to the role of microbiome in digestion.</comment>


Design For Hackers: Why You Don't Use Garamond on The Web - <AUTHOR> http://www.kadavy.net/blog/posts/design-for-hackers-why-you-dont-use-garamond-on-the-web/

<comment><USER2> What this is actually saying is don't use Garamond for copy text as its not designed for current DPI's that are currently used on monitors. It doesn't mean you can't use it for titles or headings or devices with a high DPI.

<comment><USER3> What does Garamond look like on an iphone 4?

<comment><USER4> Exceedingly legible on mine even at 7-8pt sizes, but I should note that I'm very accustomed to reading Garamond and may be inferring more. I know my first impression from the iPhone 4 was that it was blurry; I think this is because I could no longer see the pixels, which I had apparently been subtly keying off. It is definitely not blurry, but still sometimes disorients me.

</comment></comment></comment><comment><USER5> The article mentions Google Font API and Typekit as sources of fonts online, but there's another option that's worth looking at: The Open Font Library (<http://openfontlibrary.org/>)

The fonts hosted there are free (both as in beer and as in freedom). It's interesting to see how they apply the concepts around free software to another medium, like fonts.

<comment><USER6> Another site with open source fonts is The League of Moveable Type: <http://www.theleagueofmoveabletype.com/>

They only have a handful, but they're pretty much all high-quality.

<comment><AUTHOR> Thanks - these are beautiful!

</comment></comment></comment><comment><AUTHOR> If you like what you see here, please consider voting for my SXSW panel. I'll be covering this and more, including proportion and color: <http://panelpicker.sxsw.com/ideas/view/6261>

<comment><USER7> Although it might be a creative way to promote your panel, it earned a downvote. Just don't think it's the appropriate place to promote it.

<comment><AUTHOR> Can you explain that further? Here's my logic: if you're in the comments on this thread, you're presumably interested in this topic, and would like to learn more about it -> Many HNers go to SXSW, and would get a chance to learn more, should my panel be accepted -> I'm not famous, so getting help from interested people is my only chance at getting a panel accepted.

<comment><USER8> > _Can you explain that further?_

Here's a stab: The culture here is such that comments are for the sake of the readers and not the writer. Some amount of self-promotion is fine, but too much is not appreciated.

<comment><AUTHOR> "Too much" seems subjective to me.

Additonally, I've spent thousands of hours over the course of a decade obsessing over design details and historical context. Then, I spend a week crafting a blog post to condense a piece of my knowledge for sharing. I then ask for an opportunity to spend hundreds of hours preparing a presentation to share more of my knowledge. Somehow this is self-serving?

I don't need more (or more prestigious) clients. A SXSW badge is (relatively) inexpensive. I do all of this because I love to share knowledge. I understand what it's like to be turned off by shameless self-promotion, but sometimes a little perspective is called for.

<comment><USER9> Don't worry. The culture here has clearly upvoted you more! Please don't get turned off by the few negative people. Keep sharing.

</comment></comment></comment></comment></comment></comment><comment><USER10> Anyone who is using 12 _px_ font in body text should be butchered imho. For reference 12 pt is approx 17 pixels in 100 PPI, and I think that even it is bit small for body text in web.

Also, desktop display tech needs to advance. But meanwhile, yes, please test your font selections with different software and preferably hardware, and ensure that it stays readable. I think all these new tech allowing fancy typefaces has produced at least twice as many horribly unreadable sites than those it has improved.

<comment><USER11> HN is 12px font for me, I think that's the Chrome default. Looks fine to me.

<comment><USER10> Actually its 10 points (at least so it's defined in the CSS). But I wouldn't like to read any longer passages in this font size, and sometimes I zoom in even here to read more comfortably. But 12pt seems actually quite comfortable now that I tried it, so the part about it being too small can be redacted.

But the main point was that I strongly disagree defining font sizes in pixels. What happens when somebody with 250 PPI display comes along and that 12 px font suddenly is 3.5 points?

<comment><USER12> Note that a px is not the same thing as a pixel. On a 250 PPI display 1 px probably equals 2 pixels.

<http://webkit.org/blog/55/high-dpi-web-sites/>

<comment><USER13> This just makes me angry. The _whole point_ of being able to specify in px was to have something that is actually specific to the device's pixels---otherwise you'd use points or inches or cm---for those rare instances where the pixel count is actually relevant. Of course, it got overused, but the answer should _not_ be to just redefine "pixel" as "something a bit smaller than a point" (except in a bit more detail)! Argh.

<comment><USER14> I may be reading it wrong, but it sounds like a px is a pixel—until you zoom in. If you define a web page's default font size as 12px, and it stayed at that no matter how much you zoomed in, it wouldn't be much of a zoom feature, would it?

<comment><USER13> That would be reasonable, but the CSS standard says:

 _"If the pixel density of the output device is very different from that of a typical computer display, the user agent should rescale pixel values."_

It then goes on to define a "reference pixel" in terms of arclength subtended within the user's field of vision. On reflection, I suppose this is sufficiently different from pt/in/cm (which measure absolute length) to merit its own separate measure; I just wish they hadn't used the term "pixel" for it. Because "pixel" _already means something else_ and the arclength subtended by a pixel in a "typical computer display" has changed considerably over the last twenty years.

</comment></comment></comment></comment></comment></comment></comment><comment><USER15> While we're on subject, I wanted to note that Helvetica makes a terrible body font. Please use Arial instead for your body, as it renders more clearly and reserve Helvetica for text above 13pt.

KISSmetric uses Helvetica and a matching bg shadow blur for all of their body text, which makes my eyes bleed. Horrible practice. Avoid text-shadow for body.

<comment><USER16> I would very much like a _simple_ cheat-sheet of "standard" fonts and what range of sizes each looks best at with regards to webpages.

Something that I can _blindly follow_ when making the first draft of a site.

Anyone want to share a link to such a thing?

<comment><USER15> <http://www.typetester.org> is a great resource for making comparisons.

But I will try to put together a simple list of standard fonts and how to optimize them for the best results. Will shoot you an email when it's done.

<comment><USER17> I'm also interested in this, and in case you don't mind sending it to me too: colin.f.drake -at- gmail

Maybe you should also consider posting it? It seems like many people would appreciate it here!

</comment></comment></comment></comment><comment><USER18> Was anybody else bothered by how every other sentance was in bold?

</comment><comment><USER19> The first line in my userContent.css is:

      * {
          font-family: helvetica !important;
          font-size: 18px !important;
          text-decoration: none !important;
          line-height: 105% !important;
      }

This has really kept me from bothering which fonts look bad on the screen and why. For years. I would love to have a few basic, classic fonts used on my display but currently a carefully selected sans-serif font such as Helvetica is required for pleasurable web experience. Times and Garamond come to mind, I love them on print.

The Helvetica I have is actually a real Helvetica that I grabbed from some odd place several odd years ago and stashed for my personal use.

</comment><comment><USER20> The irony is that the font used in this article actually renders to be really unattractive on my Windows machine at work. I've always noticed that they use this font at BusinessWeek online, and it's always bugged me, personally. It looks like someone took a notch out of each of the letters or something. It looks a lot better on my Mac. Screenshot on Windows: <http://imgur.com/hWzXN.png>

</comment><comment><USER21> Does this problem still occur when you use even higher-resolution screens, like the "Retina" display?

<comment><USER22> More explicitly: most professional print documents are done at 300 dpi. Since retina is 326 ppi, it's safe to assume that if it looks alright on paper, it will look fine on retina.

It's worth noting that it doesn't really matter though. Most iPhones are pre- retina, and this will be the case for at least several years. So I can't think of a medium where it's okay to assume this level of screen resolution. The author's point still holds.

<comment><USER23> I think 300 DPI is for full-color prints. Black-and-white text is more like 1000-2000 DPI.

<comment><AUTHOR> 300 DPI is the resolution recommended for images that will be printed on offset printers (like, for a magazine). The text - if black - in these applications will be turned into crisp vectors, so the DPI is in effect limitless.

I believe laser printers do print at something like 1200 DPI, like you're saying.

</comment></comment></comment></comment><comment><USER24> tldr: Screen resolution isn't fine enough to properly render Garamond.</comment>


What I Learned from Executing Two Men - <AUTHOR> http://www.nytimes.com/2016/09/18/opinion/sunday/what-i-learned-from-executing-two-men.html?_r=1 <comment><USER4> The difficulty with trying to argue down the death penalty is that you end up arguing on so many levels.

This article mentions the dollars and cents expense of the death penalty; this is an empirical fact, either it is cheaper to execute someone or cheaper to imprison them.

This article mentions the ineffectiveness in protecting society; this is also an empirical question, although it is harder to measure than the monetary cost.

Finally, the article speaks of the emotional and moral cost to those employed to carry out the execution.

But the article only devotes a single sentence to the core of the argument, at the very beginning: the author has come to believe that life is either hallowed or not, and he prefers to believe that it is always hallow, and killing always wrong.

This is the core of the problem. Some people believe killing is always wrong. Some people believe justice requires the execution of those convicted of a capital crime. Heck, sometimes these contradictory beliefs are held by the same person.

All the other arguments don't matter. If killing is always wrong, you pay the cost of life imprisonment and don't execute people to save money. If justice requires a life for a life, you don't scrimp on that, either. You pay whatever monetary, emotional, and moral costs are necessary for justice to be done.

<comment><USER5> If you think that killing is always wrong then you'll eventually be guilty of killing by omission

As it was shown even this weekend in St. Cloud

Society has a lot of self-contradictory situations like that. Hence why I think no value is absolute

<comment><USER6> There's a big difference between killing defensively and killing in the name of justice, though. There's no conflict in believing that (1) life is always hallowed, (2) retributive killing is always wrong, and (3) killing is justified in some situations to preserve life.

<comment><USER7> Sure there is. What is your definition of "hallowed"? By implication, I believe the author used it to mean "killing is always wrong", or "life must always be preserved."

Is that is indeed the definition, #1 and #3 are directly incompatible. This is the problem with using words like "hallowed" in philosophical debates. One person uses a word without defining it, and they intend it one way. Then the other party argues with their imperfect and improvised understanding of the word's definition, and no one gets anywhere. This is how we end up with six people debating whether or not "the good always matches the beautiful", and it's one of the reasons philosophy as a discipline has a bad reputation to outsiders.

If you dig deep enough, what will often happen is one or more parties will try to create an empirical definition and the other parties will just use circular definitions until it's clear they're not saying anything at all.

If "hallowed" doesn't mean "must always be preserved", I'm not sure it can mean anything of consequence to the debate. You could define it as "must be preserved unless there is a justifiable reason not to", but then you're not saying anything new. It's redundant.

<comment><USER8> There is no incompatibility at all. If life is hallowed, it follows that the only situation in which killing would be justified would be to prevent another killing.

If anything, war makes a much more challenging case for this view, unless you accept a position of total pacifism

<comment><USER7> Please define "hallowed" for me. As I explained, I believe the only definition of "hallowed" with any consequence to the debate is "must always be preserved."

If that is the definition we're working with, it precludes "justifiable" exceptions, because there are no exceptions allowed. You'd need to equate passively allowing someone to kill another life with actively killing to preserve a life, which is another entire debate before we can begin to take that as a premise.

If that is not the definition, then why should we bother saying something like "life is hallowed"? What could it mean that would have any consequence for, or add any further meaning to the debate? "Life is meaningful."? "Life is to be respected."?

This is the complexity inherent to engaging in dialectics, and in my opinion words like "hallowed" should simply be avoided unless they're rigorously defined by all parties.

<comment><USER8> "Should never be taken except to preserve another life" seems both consequential and fitting.

<comment><USER7> Fair enough, I suppose that does fit.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> This is a strange article. The author glosses over the criminals charged with death penalty easily and goes into depth about his and his staff's personal experience and their moral burden/PTSD, the distress they might have felt. While that's a valid point of view, it completely sidesteps the core issue of why the author is advocating a change in his stance on the death penalty, or worse, it's the only reason for the change.

Being an outsider, it's something I notice a lot in American media - <USER3> tendency by law officials (and soldiers) to lament about their suffering while not paying enough attention to the people who are the real figures of the tragedies (death penalty, victims of war). It also relates to the hero worship that I see in American culture (even online). Every soldier with a PTSD is made out to be a "poor fellow who needs help". The person who said "yes" to being comfortable in killing people telling his harrowing story about how difficult it was for his staff.

Apologies in advance if the above comes across as too insensitive. Not sure what I'm trying to say here but just dumping my immediate thoughts.

<comment><USER10> > The author glosses over the criminals charged with death penalty easily and > goes into depth about his and his staff's personal experience and their > moral burden/PTSD, the distress they might have felt.

I think that is pretty much expected with an article titled "What I Learned from Executing Two Men".

> Being an outsider, it's something I notice a lot in American media - <USER3> > tendency by law officials (and soldiers) to lament about their suffering > while not paying enough attention to the people who are the real figures of > the tragedies (death penalty, victims of war).

But there _is_ damage on both sides. No one disputes the suffering of those who are killed, but it's a fairly recent development to study the suffering of those on the other end. I think it should be studied so that we know what we're asking people to do (be it an executioner, soldier or first responder).

</comment></comment><comment><USER11> How can a society which calls itself "civilized" keep the death penalty?

There's so much deeply disturbingly wrong with it that I don't even.

<comment><USER12> We kill less than 100 people per year via execution.

Not so bad compared to drone strikes: [https://www.thebureauinvestigates.com/category/projects/dron...](https://www.thebureauinvestigates.com/category/projects/drones/drones- graphs/)

The really horrifying thing to me is that drone strikes aren't even a serious topic this election cycle. HRC is in favor for more. Trump wants to commit war crimes. Perhaps I am biased because I helped to do a lot of them.

In the end it comes down to the same thing, judging the value of other people's lives, or perhaps more callously never thinking about their lives at all.

<comment><USER13> I'm pretty peaceful, but surgical, targeted drone strikes against combatants that are currently a threat against civilians isn't exactly going to keep me up at night.

Edit:

Yikes, the downvote brigade is swift. Here is what I'm saying: Compared to traditional war. Where we lose tens of thousands of people or more on both sides, targeted drone strikes are a net positive. I'm not for perpetual war in the middle east, but realistically speaking we can't just pull out everywhere and targeted drone strikes are better than conventional responses.

<comment><USER14> Does that mean you are 100% confident that these drone strikes are ONLY killing bad guys that deserve it? How many collateral deaths of innocent men, women and children do you consider OK before it begins to infringe on your peaceful sleep?

<comment><USER13> We don't live in a Utopia. I don't need to be 100% confident that drone strikes are ONLY killing 100% bad guys. Tens of millions of people died in WW2. The answer to stoping drone strikes is increasing diplomacy in the Middle East - not burying our head in the sand and banning drones from doing drone strikes against enemy combatants.

<comment><USER12> This is an easy thing to say when it isn't your country being bombed by foreign powers.

</comment></comment></comment></comment></comment></comment><comment><USER15> The article sort of delved into this but there are some convicts that strangely find comfort in the future of being executed. In some ways I can understand this as the thought of being in American prisons for an extended period is rather terrifying.

Michael Shermer examined this in a recent article in Scientific America [1].

I'm sad to say I don't have that many strong thoughts on the subject because as (some other commenters have posted) there are just so many other atrocities that far more concerning both quantitatively and qualitatively.

[1]: [http://www.scientificamerican.com/article/why-do-death- row-i...](http://www.scientificamerican.com/article/why-do-death-row-inmates- speak-of-love/)

<comment><USER16> I don't think that they find comfort in it. I think it's more they can't stop the fact that they are going to die, and want some control over the process. So they take control of _how_ they die, not whether they die or not. And that seems like comfort.

</comment></comment><comment><USER17> This article unfortunately conflates the value (or absence of value) of the death penalty with the unpleasantness involved with carrying it out.

If the process were better would he still be opposed to it?

<comment><USER18> > After much contemplation, I became convinced that, on a moral level, life > was either hallowed or it wasn't. And I wanted it to be.

Also

> I could not see that execution did anything to enhance public safety.

</comment></comment><comment><USER19> But the average citizen might find himself looking at the death row prisoner in the eye when the said prisoner is doing the killing.

<comment><USER20> Or maybe it's their 10 year old son who's lured away by some maniac, abused and killed. It's a complicated issue, and really easy to talk about how revenge doesn't solve anything from a great distance. I could see the absence of a death penalty putting me in a situation where I would end up taking the law into my own hands. Not that I think that's okay, but I could very much see it happening in that situation.

<comment> saiya-jin there is 7 billion people on earth, and number is growing fast. rather than focusing on preserving quantity at all costs, which is not an issue anyway, we should focus on quality (character, added value to mankind etc.).

With this reasoning, killing a murdered of your own child (or any similar case, ie parents/loved one) isn't that much of a stretch. Extreme situations call for extreme solutions

<comment><USER21> It's a small step from what you're proposing to euthanizing "unwanted" or "unproductive" parts of the population. Are you sure you want to go down that path?

<comment> saiya-jin my point was only concerning the case above - somebody intentionally, even brutally kills someone closest to you.

I never suggested scaling it up to anyone else, liked or not, from where did you get that?

<comment><USER21> Oh I'm not insinuating that you do! But you do make an argument about quality of persons in the context of preserving life. That's a very dangerous path to go down.

<comment> saiya-jin indeed it is, but in the scenario above, rationality wouldn't be the strongest part of most humans, me including.

All this topic is ridiculous and I hope that none of us would ever be facing anything similar. But if we would, this kind of rationalization would keep at least me sane afterwards... or so I think.

</comment></comment></comment></comment></comment></comment></comment><comment><USER22> Does anybody have an opinion why not to use low pressure as a method killing [0]? All the failed executions by electrical chairs and administered chemicals makes me think about a safer and more human method. Just theoretical question, not advocating for anything.

[0] [https://www.youtube.com/watch?v=kUfF2MTnqAw](https://www.youtube.com/watch?v=kUfF2MTnqAw)

Edit: Typo

<comment><USER7> I agree that the methodology could probably be improved. If we're optimizing for psychological comfort for the prisoner and certainty of the process working, I'd actually recommend a close-range shot to the head with a high caliber bullet.

Depending on the distance and round, not only will the prisoner not experience their own death (they won't see or even hear it coming), it's astronomically unlikely to fail. High velocity rounds will pierce through the tissue more quickly than it can physically tear, and will technically exit the body before the brain matter has begun tearing. The physics of this is fascinating, because it not only ultimately destroys significant brain tissue; the process stretches out the tissue, straining and damaging the rest of the surviving brain tissue.

Of course, this is not optimized to be clean. It's gruesome, but I don't think it's necessarily cruel. One moment they're alive, the next they're not. Blunt force is still the quickest way to induce a cessation of consciousness. If the prisoner were not aware of it happening, they would probably be at greater peace at the time of their death. This could also be done remotely so as to reduce the mental toll on the executioner.

Unfortunately, it would make an open casket unlikely. But I imagine most prisoners due to be executed experience a lot of terror in the hours, days and weeks preceding their final moments under the current system. I imagine living with that anticipation is horrifying for some.

From what I can understand through cursory research, morphine is a painless way to die, so much so that doctors use it to ease patients into death when there is an acceptable lack of available treatment. Extreme euphoria followed by unconsciousness doesn't sound like a bad way to do.

</comment></comment><comment><USER6> It's nice to see a statement of regret, but it really bothers me how rarely those who feel this way do anything about it while in positions of power. This Warden claims to have felt it wrong in the moment, yet he did not make the faintest of sacrifices to oppose it. It would be much more influential for a well-regarded Warden to publicly oppose or resign over such policies, than to obey them blindly and issue a mea culpa years later when he no longer has influence. Read the passage below, and consider the lack of courage required to kill someone in a way you feel is pointless at best, and morally heinous at worst, because it's your "job." How many extra years of capital punishment will we have, how many extra prisoners killed, because people in his position took too long to speak up?

> Regardless of their crimes, the fact that I was now to be personally > involved in their executions forced me into a deeper reckoning with my > feelings about capital punishment. After much contemplation, I became > convinced that, on a moral level, life was either hallowed or it wasn't. And > I wanted it to be.

> I could not see that execution did anything to enhance public safety. While > death penalty supporters suggest that capital punishment has the power of > deterrence, a 2012 report by the National Research Council found that > research "is not informative about whether capital punishment decreases, > increases or has no effect on homicide rates."

> I now believed that capital punishment was a dismal failure as a policy, but > I was still expected to do my job. So I met with my staff and explained my > position. I made it known that anyone who felt similarly opposed could back > out of our assignment. According to state policy, assisting in the > executions was voluntary for everyone but the superintendent. And yet each > of those asked to serve chose to stay to ensure that the job was done > professionally.

<comment><USER23> I disagree that it is so cut and dry. Does publicly opposing a̶n̶d̶ or resigning prevent those deaths from occurring? Should all of the staff involved be morally obligated to hand in their resignation _or publicly oppose_ as well? What of the other prisoners under his custody that he may feel responsibility for?

Quitting _or publicly opposing_ may be the most conspicuous way of opposing the death penalty, but people need to be able to choose their battles.

<comment><USER6> I said "publicly oppose _or_ resign." There are many ways to protest and draw attention to things that are broken; my point isn't that he failed to do all of them, it's that he failed to do any of them.

<comment><USER23> He failed to do any that you are aware of, with regards to this single issue of many that affect his facility.

<comment><USER6> > He failed to do any that you are aware of

The whole premise of this piece is that the author went along with a broken system because "that's the way it's supposed to work" \-- that people on the inside oil the machine and people on the outside look the other way, and both are to blame for their part in it.

The author bends over backwards throughout to show that he was no exception, that he went right along with it, and he seems to regret that now. If evidence to the contrary is available, I'm all ears.

> with regards to this single issue of many that affect his facility.

Well yeah, but "this single issue" is the premise of the article, a major social issue, and the topic of discussion here. I'm not saying this guy shirked his moral duties all throughout life; I'm saying he shirked them on capital punishment.

<comment><USER23> I think that had he, as warden, resigned/publicly opposed the executions they still would have happened. I think that as warden, he has many other opportunities for reform within his prison. I therefore don't think that he has a moral obligation to resign/publicly oppose the executions. We live in a society of broken systems. If we have to protest every wrongdoing that we encounter, we wouldn't be able to get anything done.

As to the warden's own lack of "the faintest sacrifice to oppose it" and "bending over backwards". What do you consider an appropriate sacrifice for an ordinary citizen who opposes capital punishment? Campaigning for more progressive political leaders? Communicating with state officials? How do you know he did none of these things? I don't have evidence that he did but neither do you have evidence that he didn't. I don't understand the condemnation of this individual you know only through an op-ed.

<comment><USER6> Public opinion is turning on capital punishment[1]. Anything those with power can do to draw attention to its failures will continue and further that momentum. Yeah, those two guys were probably going to be executed either way, but he could have impacted others by accelerating the pace of reform. Similar impact has been made elsewhere in the last decade, in states like Illinois where moratoriums have been imposed when officials and governors have come to their senses before the lawmakers.

In terms of what an appropriate sacrifice is, I suppose there's a pretty wide spectrum. At the extreme, he could've publicly resigned and refused to have any part in something so unethical. On the lighter end, he could've penned an op/ed stating that it's a terrible practice but that he's going to stay and do his part to make it as comfortable as possible for the condemned, while calling on lawmakers to end the practice. I'm not prescriptive about how exactly people should react when their ethics are challenged, but I think it's reasonable to ask them to wander in the direction of their moral compass even when their job points the other way.[2]

[1] [http://www.people-press.org/2015/04/16/less-support-for- deat...](http://www.people-press.org/2015/04/16/less-support-for-death- penalty-especially-among-democrats/)

[2] Obviously, some people would be hurting for work if they lost their job, and cannot afford to take big risks or piss off their bosses. But that doesn't apply to prison wardens, and if anything, the imperative of a prison warden to have solid ethics is much higher than that of a typical worker.

</comment></comment></comment></comment></comment></comment></comment><comment><USER24> on the subject of deterrence, if the author argues that the death penalty is not a deterrence, how does he explain the relatively low levels of drug crimes in asian countries where death penalty is more heavily used? It appears to me the death penalty, while used as a potential punishment threat in the U.S, is actually a sparsely applied. Criminals know that, so its deterrence factor is effectively diminished

<comment><USER25> You may be confusing the metric of convictions with the metric of activity (proxy for deterrence)

The way it works in the USA for example, is if the punishment for cocaine dealing is draconian, for white people it'll be plea bargained down to time served and some probation for a small possession charge, but black people will get convicted and go to prison on a full trafficking and conspiracy charge, so the metric you're actually measuring is the racial ratio of coke dealers caught by the cops.

Likewise what you're likely really measuring in the Asian countries is the ratio of border guards and cops who can be bought off and stay bought off. There may be some occasional extremely aggressive bribe negotiation situations, or a much disliked or distrusted courier is ratted out by his own guys (or an opposing group?). Another metric that's actually being measured is the local technologies and ratios of shipments; its quite possible that things in the USA are extremely personal with trunks full of stuff in personally owned vehicles but in Asia anonymous shipping containers in government owned and operated ports that don't legally exist are the primary source or maybe something even sneakier.

<comment><USER26> Drug abuse is far less common in Singapore, to take one example, than Western countries. That would suggest low activity.

</comment></comment></comment><comment><USER27> Essential reading on this topic: [https://en.wikipedia.org/wiki/Discipline_and_Punish](https://en.wikipedia.org/wiki/Discipline_and_Punish)

The opening I will never forget. It is a detailed historical description of one of the last public executions in France for Regicide. A powerful opening to a very thought provoking book. It details the decline of capital punishment as the public began to see the punishment as worse than the crime, and the moving from the taking of life by the state (execution), to the taking of bodily freedom (imprisonment). From punishing the soul of the man, to merely punishing his body.

After reading the book I became sure that this trend in the reform of punishment will continue and that it is inevitable that eventually capital punishment will disappear completely from the world.

</comment><comment><USER28> The video "Hanging with Frank" covers the details of the process the UK used to use:

[https://vimeo.com/24804876](https://vimeo.com/24804876)

</comment><comment><USER29> You could make a general case that the government shouldn't kill anyone unless it's obviously beneficial to do so. That would rule out capital punishment since imprisonment works ok, would allow for killing armed attackers in self defence and probably for assisted dying for the terminally ill. It gets more tricky with regime change and the like but you could make a case for opposing the Saddams and Assads financially rather than with bombs.

</comment><comment><USER30> Do we actually have numbers that shows death penalty actually impacts criminality rates? Why put any emotional stuff (revenge, punishment, suffering) in the equation?

</comment><comment><USER31> While it may not serve as a deterrent, in my opinion there are people that have performed actions so heinous and grizzly that they should not be allowed to live. The death penalty should be reserved for only the most depraved and irredeemable members of society.

If you don't agree, how about an opposing viewpoint instead of downvotes?

<comment><USER32> Many people have been proven innocent after they were on death row.

<comment><USER31> If there is any question of guilt, then the death penalty would not be an appropriate sentence. There are many examples where there is no question of guilt, where I feel the death penalty would be completely appropriate. Admitted serial killers for example. I'm not advocating a liberal use of the death sentence, but I still feel that there are cases where it's needed. If anyone doesn't agree, make an argument instead of downvoting. HN is better than that.

<comment><USER33> > Admitted serial killers for example.

Like this man? [https://en.wikipedia.org/wiki/Sture_Bergwall](https://en.wikipedia.org/wiki/Sture_Bergwall)

<comment><USER31> "With no eyewitnesses or technical forensic evidence to connect him to the crimes..."

So no, not like that at all.

<comment><USER33> He was at one point _convicted_ of eight murders, and had confessed to more than 20 more. Who, if not that man, would you nominate for a death penalty? Or is a conviction not a conviction?

<comment><USER31> I'm thinking more along the lines of a Jeffery Dahmer. There was overwhelming forensic evidence of guilt, along with full confessions. In that case, guilt was all but irrefutable. I've yet to hear an argument as to why someone like that, and under those circumstances, should be allowed to remain alive.

I submit that allowing such unrepentant and irredeemable evil to exist is more barbaric than a quick death.

<comment><USER33> You still have not clearly defined how you would differentiate between the two cases. Both were convicted, with forensic evidence, and had confessed, to multiple murders. If a _conviction_ is not enough, what would be?

<comment><USER31> I'm not a lawyer or a legislator. I don't have the legal wherewithal to know exactly how to word a potential codification of death penalty requirements based on a large amount of forensic evidence and a confession. It doesn't change my opinion that there are some people (in extremely rare cases) that should lose their lives.

For what it's worth, the article you cited states that there was a lack of technical forensic evidence, which was not a problem in the Dahmer case.

<comment><USER33> So what you seem to be saying is that the death penalty is only for when we're _really, really sure_ that the person is guilty. The problem is, we already have such a thing, and we call it a _conviction in court_. This is _already_ only supposed to happen when we're _really, really sure_ of a person's guilt. What you are proposing is some sort of "super-conviction", and the question of where to draw the line between the two forms of conviction, and how they should be defined, becomes _extremly subjective_. Until you have some concrete objective measures which can stand up to legislative scrutiny, I doubt the possibility of even doing such a thing.

<comment><USER31> There's guilty, where you have evidence that points to a suspects guilt, and then there's (for example) "I did this thing in full view of 100 people and cameras" guilty. That's already pretty big difference between levels of assurance of guilt.

As I said before, I can't come up with legal, concrete, and objective measures because I haven't studied law. It's completely unreasonable for you to ask that. Furthermore, as a taxpayer and regular voter, I help fund and choose the people that have said training. It's up to them to figure out how to implement a solution. I can't be expected to do everything.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER34> I'm curious about the intersection of two policies that each seem to be gaining momentum:

1) Discouraging the death penalty

2) Encouraging "end of life" options for the terminally ill

Should an inmate serving life without parole have the option of voluntarily ending their own life?

</comment><comment><USER35> >During a prisoner's final days, staff members keep the condemned person under 24-hour surveillance to, among other things, ensure that he doesn't harm or kill himself, thus depriving the people of Oregon of the right to do the same.

</comment><comment><USER36> I wonder what happens if a death row inmate keeps yelling and fighting. Do they sedate him?

That would be a deterrent for those officers, having to handle inmates who won't consent to their own death.

</comment><comment><USER37> On a purely moral level, I think capital punishment for murderers and traitors is absolutely justified. You, who have stolen a man's most precious possession, his life, shall not enjoy the rest of your own. You, who have betrayed our nation and our security, will never again enjoy our protection.

But in its practicalities, the chance for wrongful conviction, the cost to society, the anguish it causes the executioners, and the potential for abuse, I see many good reasons for abolition.

<comment><USER38> > You, who have betrayed your nation and its security, will never again enjoy > its protection.

Which can also be accomplished by exile instead of killing.

<comment><USER39> The world ran out of Australias to send people to.

<comment><USER40> That might be an interesting venue for space travel. Gather a bunch of convicts sentenced to exile, put them in a space ship where they can sustain themselves for the rest of their life [1], and send the ship onto a locked course into outer space.

[1] At least in theory. In practice, a society of convicts will likely not hold up very long.

</comment></comment></comment></comment><comment><USER41> I can't even begin to imagine the anguish that taking another human's life in that manner would cause me.

</comment><comment><USER42> While death penalty supporters suggest that capital punishment has the power of deterrence, a 2012 report by the National Research Council found that research "is not informative about whether capital punishment decreases, increases or has no effect on homicide rates."

<comment><USER12> Put deterrence aside for a moment. Let's talk about the cost of keeping guilty murderers alive in prison for the remainder of their lives. Is it worth it?

<comment><USER43> The progress of civilization towards an increasingly better society requires cost and effort.

Either you consider human life a fundamental value, or you do not. There are no final answers in this mysterious, apparently indifferent universe, but there is a lot of empirical data. Over and over, cultures that place a high value on human life lead to the societies where the most people prefer to live.

Another issue is that an old religious superstition survives even among atheists/agnostics, because it is disguised as a philosophical concept. This superstition is called "free will". Some people are born with problematic brains, others are raised in environments where they never have the chance to develop a healthy mind. Does society have to protect itself from these people? Absolutely. Do we want to live in a society that decides to kill them because it is more economically effective? I don't.

Yet another issue is that of certainty. It is never possible to be 100% certain that someone is guilty. Even if they confess, even if there is video evidence. There is always a tiny probability that there is something fundamental that we are missing. A culture that place a very high value on human life will not be willing to take this chance.

Consider also that, in the EU, not only is there no death penalty but not even life sentences. Typically, the harshest sentence you can get is 20-something years, no matter how terrible your crime. And yet, there is less violent crime in the EU than in the US. EU countries spend much less resources in keeping people incarcerated than the US. Why do you think that is?

<comment><USER40> > This superstition is called "free will". Some people are born with > problematic brains, others are raised in environments where they never have > the chance to develop a healthy mind.

How can you know that what you're saying is not a superstition itself?

<comment><USER43> Because I have never seen a coherent definition of what "free will" is supposed to mean, let alone how to empirically test for its existence. What is this "will" free from? The workings of the brain? If that is the case, then we are talking about the supernatural. If not, then we know that the brain develops according to genetic instructions and the environment, and we also know that both these things can go wrong by no fault of the person.

<comment><USER44> I suggest reading [http://plato.stanford.edu/entries/freewill](http://plato.stanford.edu/entries/freewill) for a pretty good overview of the arguments in favor of the existence of "free will" (which itself has many definitions).

Which isn't to say you're wrong, but I think it's pretty uncharitable to say there aren't any "coherent" arguments in favor of free will. You did say you haven't "seen" any arguments, which I suppose is not the same as a claim that are none, but a cursory glance at that article should be illuminating for you. People have been thinking about this for a very long time, and no consensus seems to have emerged. :-)

You might also be interested in [http://plato.stanford.edu/entries/materialism- eliminative](http://plato.stanford.edu/entries/materialism-eliminative), which seems to fit what little you've said about your current thinking.

</comment></comment></comment></comment></comment></comment><comment><USER45> Misery is a very well used form of slow painful execution, why do people wish to use more flashy forms that are counterproductive in keeping our systems so perfect?

The poor needs to fear the wealthy in order to not disrupt a perfect society that have proven being an example of progress, humanitarian values and eco- friendly system.</comment>


Show HN: Fullstack ML – From Notebooks to Deployment - <AUTHOR> https://github.com/xadrianzetx/fullstack.ai <comment><USER3> I have absolutely no idea what this is, supposed to do, and what the demo shows.

<comment><USER4> From what I can tell it's an example application to show how a machine learning project could be turned into a real world web app more or less from start to finish.

<comment><USER5> That's my take as well. yhat, datascience.com, and Domino Data Lab were the first players in this space. Domino has a webinar and trial project to see how these platforms approach this type of workflow. [https://www.dominodatalab.com/resources/webinars/web-apps- in...](https://www.dominodatalab.com/resources/webinars/web-apps-in- production/)

</comment></comment></comment><comment><USER6> A few days ago there was this related post on /r/machinelearning

> Book on practical considerations of ML

[https://reddit.com/r/MachineLearning/comments/cxu9d7/](https://reddit.com/r/MachineLearning/comments/cxu9d7/)

</comment><comment><USER7> I came here because I thought this was about the ML programming language, aka Lisp with Types™, but it's about machine learning.

<comment><USER8> The TLA namespace is badly overloaded enough, but it's got nothing on the TLA namespace.

<comment><USER9> Well done!

</comment></comment></comment><comment><USER10> Love the X-Clacks-Overhead header for Terry Pratchett. [https://xclacksoverhead.org/home/about](https://xclacksoverhead.org/home/about)

</comment><comment><USER11> This is very, very similar to what Yhat (YC W15) did.

You dropped some code in your Python or R project and it would slurp everything in to one package and, for Python, run it in Flask in a docker container using their home-grown container orchestrator.

[https://www.welcome.ai/tech/data- science/yhat/](https://www.welcome.ai/tech/data-science/yhat/)

<comment><USER12> What happened to them?

<comment><USER13> They got purchased by Alteryx

</comment></comment></comment><comment><USER14> While the example here is definitely trivial, it would be nice to see some more documentation. Particularly around project structure, internals, and thought process.

Seeing e2e projects is definitely a huge plus, but without relevant commentary I don't see how it is consumable enough to help a large enough mass.

</comment><comment><USER15> This feels like it doesn't live up to its own hype because it doesn't really exhibit a production-quality deployment of a Python application but something closer to a dev server. It uses a single-threaded flask server behind a nginx reverse proxy without a WSGI layer to handle multiple requests, etc. Here is the nginx code:

        server {
            listen 80;
            server_name: localhost;
            location / {
                proxy_pass http://fai:4242/;
                proxy_set_header Host "localhost";
            }
        }

According to the docker-compose.yml file, fai:4242 is running a container called "flask":

          flask:
            build:
              context: ./
              dockerfile: Dockerfile
            container_name: flask
            networks:
              net:
                aliases:
                  - <USER2>

And according to the Dockerfile for the "flask" app.py runs flask built-in (single threaded, recommended for development only) server:

        if __name__ == '__main__':
            APP.run(host='0.0.0.0', port=4242)

There's not much to say about this except that the flask project themselves don't recommend running this server in production[1]. I would recommend a WSGI server such as gunicorn[2] running under supervisord[3]. I would also like to see some logging and error handling in production quality code, and it would make sense to have nginx serve the static files (index.html, index.js, etc.) directly without using up a python thread (which should be reserved for the more dynamic endpoints.) It would be nice to demonstrate using nginx for rat limiting[4] or as a load balancer[5] spreading the work across multiple flask servers.

Mind you, I think this is a neat little demo, but as something to put into production - or to teach other people how to put REST APIs into production - it falls short in its current state.

[1]: [https://flask.palletsprojects.com/en/1.1.x/tutorial/deploy/](https://flask.palletsprojects.com/en/1.1.x/tutorial/deploy/)

[2]: [http://docs.gunicorn.org/en/stable/deploy.html#deploying- gun...](http://docs.gunicorn.org/en/stable/deploy.html#deploying-gunicorn)

[3]: [http://supervisord.org/](http://supervisord.org/)

[4]: [https://www.nginx.com/blog/rate-limiting- nginx/](https://www.nginx.com/blog/rate-limiting-nginx/)

[5]: [http://nginx.org/en/docs/http/load_balancing.html](http://nginx.org/en/docs/http/load_balancing.html)

<comment><USER16> I don't think supervisord is necessary when you're in a container environment. Just write a healthcheck to bring up a new container when something goes wrong

</comment></comment><comment><USER17> Looks really nice! Love to see it next to some Rust-like or Golang=like backend. What do you think?

</comment><comment><USER18> this is freaking awesome! was looking for something like this for a long time. Much appreciated!!!</comment>


Ask HN: sharing social data - <AUTHOR>

if you could share any data into a social network's feed, what would you share?
what is your favorite stuff to share in via email, on frienfeed, twitter, facebook or myspace?
if you were a website, which data are you most interested in from myspace, facebook or twitter? <comment><USER2> Status updates. The rest would make for interesting demographic research, but statuses change constantly and provide real-time info into what people are doing or thinking.

<comment><AUTHOR> myspace currently offers access to status updates, twitter already does, and i think facebook is thinking about it.

anything else of interest?

i guess i was asking what do you think people put in their status updates that is actually interesting.</comment></comment>


How to Jump from Cloud to Cloud - <AUTHOR> http://www.bloomberg.com/news/articles/2015-08-27/switching-cloud-providers-standards-sought-for-container-software

<comment><USER2> Container is one approach, but it is hardly the only approach.

If your entire setup is take a base linux VM - run some ansible magic on it - and start serving webpages.. you don't care what cloud you run on (or local hardware). It is when you start building out a bunch of logic around SNS and an Amazon specific tech that you have problem. Container is not does not "fix" this problem.

<comment><USER3> Which is exactly why Amazon is trying their best to make you integrate with Amazon-specific technologies as much as possible. They know that S3 and EC2 are commodities. Their other products are what keeps customers locked in.

</comment></comment><comment><USER4> Containers are completely orthogonal to the cloud vendor lock-in issue. You still can consume proprietary services and APIs from containers just like you may use them from VMs.

All containers give you, is a portable omnibus image format. Container Orchestration software like Mesos/Marathon or Kubernetes gives you ability to deploy and schedule containers.

For those who want to be truly multi-cloud, they need to exercise high level of self-discipline, periodically doing code and devops scripts reviews and audits and check their system on different clouds or on-prem.

I.e. in short they shouldn't take any shortcuts, but IMO for startups taking shortcuts is preferred way.

</comment><comment><USER5> Interesting. The devops lead at a previous employer migrated us from AWS to SoftLayer and wrote a post about it that I believe popped up here a few months back.

</comment><comment><USER6> I'm really surprised Mesos and YARN weren't talked about in the article as they've actually been used to build multi-cloud environments.

</comment><comment><USER7> Loved the Hotel California quote :)</comment>