C++ : if constexpr isn't broken - <AUTHOR> https://brevzin.github.io/c++/2019/01/15/if-constexpr-isnt-broken/ <comment><USER2> "a somewhat more awkward and uglier, yet slightly more correct way... all the functionality is right there. We're not missing anything" might as well be C++'s motto :)

<comment><USER3> "The amount of things you have to know in C++ is arguably a bit larger."

Arguably, lol.

<comment><USER4> In Bitcoin SV, there is a saying "devs gotta dev" to refer to the mass of crypto developers that add unnecessary complexity to their coins to solve minor or even nonexistant problems while not seeing the bigger (usually economic) picture. Everyone wants to make their mark on the space and there aren't enough leaders to direct the energy. C++ looks to be doing the same and not able to see the impact this will have on adoption. Oh well. I personally moved from C++ to Rust last year and haven't looked back.

<comment><USER5> I disagree - I work in high-performance computing and I think in our case the complexity of C++ is actually mirroring that of the problem domain. Nothing else gives us the level of abstraction that C++ does, _while still offering convenient ways to specify low-level performance semantics_.

I think for a while Fortran was pulling ahead for large-scale numerical computing, but the mess of different options for parallelism (and also I think in our case a profileration of algorithm choices that made not just polymorphism but the explicit distinction between polymorphism and templates more important for code architecture) have brought C++ back into the limelight.

I know that some competitors in our space have a Fortran codebase and they essentially had to hack together C++ Templates as part of their build process (i.e. pre-process a template file and generate multiple sources which are then compiled).

<comment><USER6> Looking at some C++ extension proposals, many are definitely a case of "devs gotta dev." Fortunately most of these don't have a chance in hell of making it in.

<comment><USER7> Yeah Stroustrup put his foot down this year on whacky proposals.

</comment></comment></comment></comment></comment></comment><comment><USER8> I used to be a C++ guy from the early 90s 'till about 2010. Every few months, I think "I should really learn the new C++ hotness", and then I read something like this. It's like a bunch of priests arguing about how best to fit a bunch of ugly angels on a pointless pin. It just feels so pointless.

If you must use C++, just use another language to generate the C++. All this template mumbo jumbo. Who says your meta-programming language has to be the same as your target language?

I used to spend some time looking for the perfect vector (as in linear- algebra) library. Templatized for vector dimension, data-type, blah blah blah. Dude, just use Python to generate it. Duplication doesn't violate DRY if the duplication is generated from a single higher-level source.

Doing meta-programming in C++ is a really limited way of thinking.

<comment><USER9> > _fit a bunch of ugly angels on a pointless pin. It just feels so pointless._

A pointless pin would indeed be pointless.

</comment></comment><comment><USER10> I had similar thoughts when looking through the slides for Andrei's talk. A main argument in favor of static if over the mechanisms C++ offers to do the same things seems to be familiarity of if statements but having scope not be respected is such an unintuitive difference for anyone with experience in curly braces languages that it seems like a net loss in clarity to me. It looks more like using macros for conditional compilation.

Overuse of if statements is generally something of a code smell and tends to make code harder to follow. To my taste the C++ way of doing things is generally preferable as a result even if more verbose. Given this is probably somewhat a matter of taste it is hard to justify changing C++ to match the D way IMO.

</comment><comment> mark-r Why is it every time I see a new article about C++ features my eyes glaze over? Am I just getting old, or has C++ jumped the shark?

<comment><USER11> Probably because you are used to the paralysed C++ pre C++11. Nothing happens for years and now we have new functionalities every three years supported by all major compilers. But, also, many new functionalities are not for global consumption. The audience of many meta programming functionalities are library developers for example.

<comment><USER12> Isn't every developer in a non-trivial software project a library developer? As soon as you have a common piece of functionality you want to reuse - that's a library.

<comment><USER13> I think that's dependent on language culture. Because the C++ community doesn't take language simplicity or comprehensibility seriously, there are lots of C++ developers who can't use or reason about surprisingly large parts of the language. So the community has rallied around the notion that "library" developers need to understand everything and that most developers will just glue together bits that the library devs made.

I mean, how many C++ developers actually write serious template code? How many of them could reliably explain what the keywords in post do?

The idea that every developer is a library author (or the lisp extension that every developer is a language author) is common in many other language communities but it relies on the community working hard to make mastery of the language feasible for lots of people. The C++ community never bought into that notion; they inherited a very stratified class structure from Bell Labs.

<comment><USER14> >... the C++ community doesn't take language simplicity or comprehensibility seriously...

I think this is an unreasonable assertion and not borne our by a read of the committee discussions.

<comment><USER13> To clarify: of course they like simplicity when it costs nothing. But they consistently value other goods over simplicity.

For example: maintaining backwards compatibility. The community believes that it is more important that 20 year old C++ code run unmodified than that the language should be simplified. There's lots of stuff you could do to simplify the language but options dry up in a world where 20 year old code must be able to run unmodified.

So sure, the committee talks a lot about simplicity, but it isn't willing to sacrifice much.

Don't get me wrong: I'm glad that finally, in 2020, C++ will be almost but not quite as good as Common Lisp was at metaprogramming back in 1982. But it remains the case that eval-when and defmacro are both more powerful and dramatically simpler than anything the C++ committee has ever considered.

<comment><USER10> Two other goals for C++ are 'zero-cost abstractions' and 'leaving no room for a lower level language'. It does better on both of these goals than Common Lisp and they are important reasons for its popularity (along with backwards compatibility and easy interop with C APIs).

<comment><USER13> Zero-cost abstractions only exist in a world where you don't highly value language simplicity and comprehensibility.

Simplicity and comprehensibility were things the committee had to give up in order to pretend they had "zero-cost" abstractions. Nothing in life comes free: everything, including all abstractions, comes at some cost.

<comment><USER15> > Nothing in life comes free: everything, including all abstractions, comes at > some cost.

Yes. As a slogan, it is imprecise. But it's always been talking about a very specific kind of cost: runtime costs. You're 100% right about there always being some kind of cost, but the slogan doesn't disagree with you.

(Some prefer "zero-overhead principle" instead to make this a bit more clear.)

<comment><USER13> (1) I love your writing.

(2) Even reducing it to runtime costs, it seems a bit nonsensical. Are C++ exceptions a zero cost abstraction? All the googlers I argued with about them would insist that they have unacceptably high runtime costs.

OK, but templates are surely zero (runtime) cost abstractions, right? Unless you start to worry about duplicate code blowing out your instruction cache but if that's a problem, no profiler in the world will ever be able to tell you, so I guess you'll never know just how costly the abstraction is, so you might as well continue believing it is zero...?

<comment><USER10> Zero cost abstraction is not the same thing as a free lunch. It's a goal that using the abstraction will have no runtime cost relative to implementing the same or equivalent functionality manually. It goes hand in hand in C++ with the "don't pay for what you don't use" principle (again talking about runtime performance cost).

When it comes to exceptions, it's generally true on x64 that you don't pay for what you don't use (there's no performance penalty to exception handling if you don't throw) although that hasn't always been true for all platforms and implementations. It's also generally true that you couldn't implement that kind of non local flow control more efficiently yourself, although the value of that guarantee is a little questionable with exception handling.

I'd argue that no language has a really good story for error handling. It's kind of tragic that we have yet to find a good way to deal with errors as an industry IMO. The most promising possible direction I've seen is in some of the possible future extensions to C++ - it's widely recognized as an area for improvement.

Template code bloat is another case of not imposing more cost than if you implemented it yourself and you have pretty good mechanisms in C++ for managing the tradeoffs.

<comment><USER13> > When it comes to exceptions, it's generally true on x64 that you don't pay > for what you don't use (there's no performance penalty to exception handling > if you don't throw) although that hasn't always been true for all platforms > and implementations. It's also generally true that you couldn't implement > that kind of non local flow control more efficiently yourself, although the > value of that guarantee is a little questionable with exception handling.

I'm inclined to agree with you but just about everyone at Google says the opposite and most C++ shops I've seen agree with them. I've made this argument and lost repeatedly. So, it seems like the community can't even agree on which abstractions are zero cost (or maybe whether some zero cost abstractions are actually zero cost?). To the extent that the community itself has no consensus about these things, maybe they're not a marketing slogan that's helpful to use.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER16> Slides from Alexandrescu's referenced talk [1].

[1] [http://erdani.com/MeetingC++2018Keynote.pdf](http://erdani.com/MeetingC++2018Keynote.pdf)

</comment><comment><USER17> I agree with this blog writer. Allowing typedefs to cross static if boundaries would be a major change to the way I read code. Unless there's a more substantive example demonstrating why using the existing metaprogramming is insufficient, its benefits are imo outweighed by its cost.

<comment><USER18> Well you already have to remember that 'if' introduces a scope but '#if' doesn't..

<comment><USER17> I guess that's true. But I can't remember the last time I have used `#if` aside from header guards and optimization paths. So they _do_ exist, but I almost never do this.

</comment></comment></comment><comment><USER19> I think I just got used to C++11. What is this dark magic?

<comment><USER20> If you refer to `if constexpr`: There is no dark magic. Most of it is already possible with C++11 meta programming (i.e. with std::enable_if [0]). However, it's much more readable now (and it's more fun to write :D). I think we're on a good way that compile time programming will be more easily accessible.

[0] [https://en.cppreference.com/w/cpp/types/enable_if](https://en.cppreference.com/w/cpp/types/enable_if)

</comment></comment><comment><USER21> Oh my. If only C++ would have used proper macros from the start...

<comment><USER14> I discussed this once with Stroustrup. He mourned that the word "macro" had been "polluted" (his word, though I completely agreed) by the preprocessor and said "templates was the best we could do within the constraints of C".

This was in the mid 90s and things are a lot better these days but still, I had better macro support writing Lisp in the 1970s.

<comment><USER21> I am ready to believe that hygienic macros would have been difficult, but just using lisp macros should have been straightforward. Tbh, I think that templates were an adhoc, amateurish design decision.

<comment><USER14> A lot of the arcanity in templates is the arcane C syntax they are shackled to. I wouldn't call it ad HPC.

Lisp is so much easier. But current C++ is surprisingly expressive and generates pretty good production code. Instrumenting your Lisp with a lot of type declaration is pretty messy too.</comment></comment></comment></comment>


Maxed Out: A Closer Look at Coffee Consumption in Finland - <AUTHOR> http://nordiccoffeeculture.com/maxed-out-a-closer-look-at-coffee-consumption-in-finland/ <comment><USER2> Finn here, although just drinking tea :p Can't understand why people drink and drink that much of bad coffee and bad beer in Finland. There are good artesan beers in Finland but those are not consumed that much compared to the classical Finnish big brand lagers.

(somewhat offtopic:) Had a conversation with a Korean girl living in Finland and she complained about the quality of tea in Finland. I ROTFLMAOed as the tea culture in Finland started basically in the 90s with horribly over aromated teas compared to longer than dynasties tea cultures of Asia. Nowadays there's bunch of nice tea shops at least in the bigger cities, though.

<comment><AUTHOR> A part of me is imagining an Ethiopian goat farmer much like the first to (allegedly) discover coffee visiting Starbucks, taking a sip, spitting it out and complaining "I wouldn't even give this to my goats!"</comment></comment>


Americans think they live in a democracy. But workplaces are small tyrannies - <AUTHOR> https://www.vox.com/the-big-idea/2017/7/17/15973478/bosses-dictators-workplace-rights-free-markets-unions <comment><USER3> Agree. The central idea behind capitalism is a hard logical division between employment and ownership, so it's almost tautological to say that workplaces are small tyrannies- but it's good to see someone say it. I mean, I think the real issue with our democracy might be that we've never experienced it on a personal level, so we don't really understand how government by the people is even supposed to work. Our day to day experience is authoritarianism, so that's what we project on a national level.

<comment><USER4> I have the same thoughts every July 4th. I ask myself 'what exactly am I celebrating here?' Our rights and freedoms seem heavily curtailed and most people have to work and are wage slaves in service of their debts.

I am debt-free, but have not yet managed to extract myself from this system. Health insurance is a big reason why.

Also, there are few part-time jobs that pay anything and although I have been attempting a career downshift, I can't find decent paying work. It's either I kill my body as a software developer and make decent money but work way too much, or I go be a $10/hr schmuck checkout clerk, I guess. I need that in between thing...but it's not there...on purpose.

<comment><USER5> I agree overall, but I would say that in terms of your work killing your body, software dev is clearly much less destructive than, say, working in construction. But likely anything you do nonstop for hours on end is going to exact a toll. I am interested in what you think the purpose of the our system is - social control? Simple snatch-and-grab by the 1% ?

<comment><USER6> Perpetuating itself and treating well those in power that treat it well.

Like any remotely complex systems, it's all about replicating and thriving itself.

</comment></comment></comment></comment><comment><USER7> The article mentions that the industrial revolution has made it too difficult for small business to compete with large companies.

To solve that problem, let's eliminate all taxes for everyone making less than $100k. No income tax, no payroll tax, no property tax, no sales tax, no...

<comment><USER8> I personally am drawn to this idea. $100k seems arbitrary though. I would like to see it adjusted for the COL of an average American family. Would you happen to have any reading material or studies related to this tax scheme?

<comment><USER7> You're absolutely right, I pulled $100k out of the air for it's nice- roundedness...

I don't have any reading material on it unfortunately, no. I'm mostly libertarian, so [https://mises.org/](https://mises.org/) maybe?

</comment></comment></comment><comment><USER9> Yep, and then people said we need a businessman running America and surprise they got someone who wants to run it like a dictatorship.

<comment><USER4> I don't see it that way at all. Trump is not responsible for what has taken place here, as fun as it is to blame him. I see him as someone who is trying to undo a lot of the problems and fix them but he has no support from either the Democrats or the Republicans because both sides are vested in continuing the slave plantation that we have here in service of the ultra .01%. In Trump, we have a guy who is part of the system who has rebelled from it because he no longer could live with what he saw it doing and what he knwos it to be. He deserves a little bit of sympathy and the American people deserve credit for finally waking up to what is going on. It's going to take more than one guy to fix this, though. I don't hold out a lot of hope. It is what it is now--we're headed for third world style living, and let's be honest--a large number of Americans are already living in third world squalor. It's not "heading" it's here.

<comment><USER10> Trump isn't interested in actually fixing things, and I don't know what evidence has led you believe he is.

<comment><USER11> When politicians keep their campaign promises, that is democracy working properly.

President Trump is keeping his campaign promises to reform lobbying[1], cracking down on illegal immigration[2], cracking down on ISIS[3], and he's making America no longer be the world's police officer[4].

[1] [http://www.nbcnews.com/news/us-news/trump-sets-5-year- lifeti...](http://www.nbcnews.com/news/us-news/trump-sets-5-year-lifetime- lobbying-ban-officials-n713631)

[2] [http://www.sandiegouniontribune.com/business/economy/sd- fi-b...](http://www.sandiegouniontribune.com/business/economy/sd-fi-border- wal-20170404-story.html)

[3] [https://www.theguardian.com/world/2017/apr/15/us-mother- of-a...](https://www.theguardian.com/world/2017/apr/15/us-mother-of-all-bombs- moab-afghanistan-donald-trump-death-toll)

[4] [http://www.politico.com/story/2017/02/donald-trump- congress-...](http://www.politico.com/story/2017/02/donald-trump-congress- speech-nato-235543)

</comment></comment></comment></comment><comment><USER12> I like the worker council idea. Though perhaps a more elegant solution would be to eliminate all corporate tax deductions and set the rate to a flat 20% while taxing co-ops at 5%. Over time, this would Incentivize the formation of co-ops over corporations and reduce the negative effects of having an economy controlled by large corporations.

</comment><comment><USER13> Edward DeBono calls democracy a "dictatorship of the majority", i.e. we vote in a new dictator every 4 years.

<comment><USER14> Except the courts override a lot. And he doesn't make any actual laws(although regulations are trouble enough half the time).

</comment></comment><comment><USER15> It is interesting that no one with money believes that democracy is a credible way to run a business and yet people still believe it is a credible way to run a government.

Fun fact: the US Constitution has exactly ZERO uses of the word "democracy" in it.

<comment><USER16> There are numerous examples of cooperatives, businesses that are run democratically, which are successful. Sure, no one amasses huge piles of money that way, just like nobody in a (effective) democracy amasses huge amounts of power. But that's kind of the point. Saying nobody with money thinks democracy is a good way to run a business is like saying no dictators with power think democracy is a good idea. It's not a criticism of democracy/cooperatives, it's an obvious statement of the motivations of dictators/business leaders.

</comment></comment><comment><USER17> A bit off topic, but I think it speaks to the more general issues that voters (as employees) have little say in the laws which govern their workplaces.

The notion that America is currently a functioning Democracy is still a bit up in the air for me. Americans in general have little factual policy knowledge, and for the few issues that do get fairly well covered there is a strong politicization which verges on propaganda.

More to the point - many political arguments that we see today in the national press usually has the strong cashflow backing of a few elite pocketbooks. It is likely impossible to run an apolitical cause for the public good.

If not for overwhelming politicization, is there another reason why so many US voters are basically anemic to political causes (e.g. wages, education, vacation, medical) which (in general) they could easily vote into law - <USER2> don't?

Anyway, just my opinion.

Gilens and Page[1]:

>>>What do our findings say about democracy in America? They certainly constitute troubling news for advocates of "populistic" democracy, who want governments to respond primarily or exclusively to the policy preferences of their citizens. In the United States, our findings indicate, the majority does not rule — at least not in the causal sense of actually determining policy outcomes. When a majority of citizens disagrees with economic elites and/or with organized interests, they generally lose. Moreover, because of the strong status quo bias built into the U.S. political system, even when fairly large majorities of Americans favor policy change, they generally do not get it.

Some rebuttles:

>>> Bashir and Branham/Soroka/Wlezien find that on these 185 bills, the rich got their preferred outcome 53 percent of the time and the middle class got what they wanted 47 percent of the time. The difference between the two is not statistically significant.[2]

>>> The researchers found the rich's win rate for economic issues where there's disagreement is 57.1 percent, compared with 51.1 percent for social issues. There's a difference, but not a robust one. "The win rates for the two issue types are not statistically different from one another," Branham, Soroka, and Wlezien conclude.[2]

[1] [https://www.cambridge.org/core/journals/perspectives-on- poli...](https://www.cambridge.org/core/journals/perspectives-on- politics/article/testing-theories-of-american-politics-elites-interest-groups- and-average-citizens/62327F513959D0A304D4893B382B992B/core-reader)

[2] [https://www.vox.com/2016/5/9/11502464/gilens-page- oligarchy-...](https://www.vox.com/2016/5/9/11502464/gilens-page-oligarchy- study)

<comment><USER18> In a democracy, shouldn't the middle class get their preferred outcome far more often than the rich since their are far more of them? If the rich get their preferred outcome even just as frequently as the middle class do, they have way more power than they would in a pure democracy.

<comment><USER19> > In a democracy, shouldn't the middle class get their preferred outcome far > more often than the rich since their are far more of them?

Even in theory in a democracy, outcomes are not democratically chosen, actions (at some level, which may merely be choice of representative) are; therefore, those who have more resources to devote to understanding the relationship between actions and outcomes, and to understanding other actors preferred outcomes to craft propaganda tying preferred actions to other actors preferred outcomes will tend to get their preferred outcomes more often than others.

<comment><USER18> "Democracy" is descriptive, not prescriptive. It describes an outcome, not specific methods.

If the outcomes don't match the will of the people, it is not a true democracy regardless of the method of governance used.

</comment></comment></comment></comment><comment><USER20> I hate to get pedantic, but with the misuse of terms for the purpose of demagoguing against those with more capital, I feel compelled to point out that an employment relationship is wholly contractual, and therefore not a "tyranny", and perfectly consistent with a completely democratic society.

Maybe the author means "egalitarian" or some other concept tangentially related to democracy. Voluntarily formed hierarchies are perfectly consistent with a free and democratic society.

But points to the author on hitting people's emotional buttons with her victim/outrage politics.

<comment><USER21> Yeah, I don't understand the need to compare the structure of a business to the structure of a countries government in the first place.

Employment relationships are contractual, and completely voluntary. People need income to live, sure, but they are not forced to work for any one person or company to receive that income.

The working conditions mentioned in the article are insane, but you "vote" by choosing not to work for that company.

I also take issue with "Like Louis XIV's government, the typical American workplace is kept private from those it governs." What world is the author living in where normal governments disclose 100% of the information they hold or receive?

<comment><USER22> Im not sure it is contractual when death is the alternative. It isn't like they can just walk to an empty piece of land and build a cabin and farm on it to live. Or wander the wilds foraging and hunting. Work, or the capital to purchase other people's work, is a requirement to live here. That is why I support stronger minimum wages and eliminating work 'benefits' in favor of paying that money directly to employees. If they want to buy into a company insurance plan, so be it, but it should be entirely optional and payed into out of their bank account, not drawn out before the employee even knows what it is worth. Companies are using benefits to hide employee's actual wages from them so it is harder to even value your own income and compare it to others or other companies.

<comment><USER20> Why can't it be contractual when death is the alternative? What if I agree to provide X in exchange for someone's kidney? That can't be contractual? Unless there is _imminent_ threat of death, I can see a contract that is entered into by one of the parties in order to avoid death as meeting every condition of consent.</comment></comment></comment></comment>


React Color – Color Pickers from Sketch, Photoshop, Chrome and More - <AUTHOR> http://casesandberg.github.io/react-color/ <comment><USER2> Every time someone invents another framework, 1000s of hours are lost to rewriting these widgets - colour pickers, date pickers, drop-downs, combo- boxes etc etc. And that's before people complain about lack of flexibility and all the missing features their predecessors have accrued over time. More wasted time as people try to get to grips with yet another style of configuration, operation and tweaking to fit real world use cases.

I'm all for innovation and advancing the state of the art, but there has got to be a better way of dealing with these basic components. All we're doing here is creating projects for those with time on their hands, frustrating those with none, and keeping StackOverflow in business.

<comment><USER3> In this particular case, the HTML5 <input type=color> works great. (Not on IE yet, but there is a polyfill.)

In the long run, shadow DOM should make it easier to make framework agnostic widgets.

<comment><USER4> Doesn't work on Safari either.

[http://caniuse.com/#feat=input-color](http://caniuse.com/#feat=input-color)

</comment></comment></comment><comment><USER5> Looks awesome. Kudos.

I'm not a React specialist and I have the following question : Is it that common to write the CSS inside the JSX file?

Since I started learning React, the hardest part to swallow was that my HTML and JS now live in the same file. Now I see that this library also puts the CSS and since I'm not entirely sure if this is good or not, can someone point some Pro's and Cons and if it's common or not.

<comment><USER6> It's becoming more and more common. Check this out:

[http://blog.vjeux.com/2014/javascript/react-css-in-js- nation...](http://blog.vjeux.com/2014/javascript/react-css-in-js- nationjs.html)

<comment><USER7> [http://keithjgrant.com/posts/against-css-in- js.html](http://keithjgrant.com/posts/against-css-in-js.html)

</comment></comment></comment><comment><USER8> Try dragging within the colorpicker rainbow sections... Its super slow, for every drag event React-engine will perform a diff on the domtree.... This is not the way to implement such components. React is nice for non-continuous dom updates. But it will be never quicker than drawing to the screen yourselve, or updating the components yourselve... Its a lot faster than diffing a tree every few milliseconds.

<comment><USER8> [https://github.com/casesandberg/react- color/issues/13](https://github.com/casesandberg/react-color/issues/13)

</comment></comment><comment><USER9> I've tried half a dozen libraries to solve this problem for Literally Canvas ([http://literallycanvas.com](http://literallycanvas.com)). They all have one or more dealbreakers. In this case, it's superficially that the controls are too close together to be touch-friendly. But it looks really extensible and easy to change, so I'll give it a shot anyhow. Thanks!

<comment><AUTHOR> Thanks Steve!

If you know of a color-picker design that is better spaced (mobile friendly) go ahead and open up a issue on the repo and paste it in there. I am going to be going through this week and making a couple more!

<comment><USER9> You'll see a pull request from me soon. I'd much rather contribute than write my own from scratch, as I had planned to do before I saw this.

Edit: to elaborate, the layouts are generally fine, you just need fatter sliders and more space between the buttons.

<comment><AUTHOR> Sweet! Yeah, let me know if you have any questions about the helper components as well, its the first time I have done something like that!

</comment></comment></comment></comment><comment><USER10> Cool but it still lags :( Wasn't ReactJS suppose to be quicker because of Virtual DOM or something?

<comment><USER11> Quicker than what? And a framework choice doesn't guarantee a certain level of responsiveness, it also comes down to the implementation.

<comment> jarek-foksa One of the primary selling points of React is better performance of the virtual DOM, which apparently has no prove in benchmarks [1].

[1] [https://aerotwist.com/blog/react-plus-performance-equals- wha...](https://aerotwist.com/blog/react-plus-performance-equals-what/)

<comment><USER12> That article has been discredited pretty thoroughly.

Anyway, it's not a panacea. It can't do much if you're forcing a reflow every few milliseconds.

<comment><USER13> As a complete outsider, do you have a link or two to support that so I could learn more?

It would seem to me, again completely without knowledge, that a virtual DOM seems suboptimal. Web browsers should be able to optimize for that use case a lot better.

<comment><USER12> Pete Hunt's talk is good. [https://youtu.be/x7cQ3mrcKaY?t=1112](https://youtu.be/x7cQ3mrcKaY?t=1112) I'd recommend watching the entire video if you have time, but that's the gist of it. More detail:

[http://stackoverflow.com/questions/21109361/why-is-reacts- co...](http://stackoverflow.com/questions/21109361/why-is-reacts-concept-of- virtual-dom-said-to-be-more-performant-than-dirty-mode)

It is challenging to make a large app with lots of state be performant when you manually mutate the DOM, and there's no way for the browser to fix that because of the way things work.

For example, if you move an element, and then request the position of another element immediately after, the browser will be forced to recalculate layout before giving you an answer. With lots of state and lots of updates, it's very challenging to keep this in the right order.

As virtual DOM is an abstraction over the DOM, you can make a vanilla app that is much faster, but as your app grows, that quickly reverses.

<comment> jarek-foksa Shadow DOM will allow browsers to optimise their rendering code to re-render encapsulated DOM subtrees independently of each other.

Virtual DOM makes sense when (A) you have a huge tree and (B) you show only a small portion of that tree to the user at any given time.

For example a long scrollable list or a multi-line text editor would be better implemented with virtual DOM, but using it everywhere is an overkill.

</comment></comment></comment></comment></comment></comment></comment><comment><USER14> Pretty, although I found a few issues:

The Sketch colour picker in the second sample in More Examples has no alpha, yet displays an editable field for it. Furthermore, while a text box for the colour component has focus, dragging of the label below it changes the colour, but not the value in the text box. And I think for all "dialog-like" colour pickers the text box labels should actually be labels for the text box, that is, when clicked, they should put focus on the text box.

</comment><comment><USER15> Very nice work. Sincerely, thank you for the writeup! I'm still trying to gauge whether React is good for me or not, and this is very readable :)

I noticed that it is trivial to break the whole thing in a way that would probably put off average users. (See Bug Report at bottom.)

I would like to read ideas here that weigh the merits of Web Components and other compartmentalized (web) programming techniques and their ability to still have the ability to fail globally, especially if they promote an environment that gives the (perhaps false) notion that 'What I do in this will not be a problem for you'. Is this a function of React(and similar), the programmer, or other? Is it even a thing at all?

Bug Report: Changing an integer value to "g" in the R field of "Sketch" breaks ALL widgets with the only apparent way of fixing is clicking a swatch or entering a valid hex where available. Clicking Up or Down arrows in 'Chrome' does not fix. Clicking in color areas of 'Chrome', 'Sketch', or 'Photoshop' does not fix. Inputting Valid RGB values into any field does not fix but reverts to NAN.

<comment><AUTHOR> Thank you so much for the bug report! There are so many edge cases, I cant believe I didnt even catch this one -- being so basic. I have created a github issue for it and hope to fix this tonight!

[https://github.com/casesandberg/react- color/issues/11](https://github.com/casesandberg/react-color/issues/11)

</comment></comment><comment><USER16> It's missing my personal favorite the triangle or sometimes called color wheel.

<comment><AUTHOR> Any particular rendition of it you like? I can put one together today!

<comment><USER16> GTK Color Wheel actually. It's the one with a triangle in the middle. User dbbolton suggested it and it looks like it's on your list.

</comment></comment></comment><comment><USER17> I'd love to see a GTK-style version, i.e. a hue wheel with a S/L triangle like this: [http://i.imgur.com/yscI9Iy.png](http://i.imgur.com/yscI9Iy.png)

<comment><AUTHOR> It's on the list for me to build!

[https://github.com/casesandberg/react- color/issues/6](https://github.com/casesandberg/react-color/issues/6)

</comment></comment><comment><USER18> This looks awesome; the color pickers I've seen for react so far are either really minimally complete or too rigid. Nice to have a solid one to reference/use if I need it. Thanks for your work on this!

</comment><comment><USER19> This is really cool! Sorry if this is kind of a dumb question but I know nothing about web development: can I use this without running node on the server? I'd like to use this for a WebGL distance field renderer I'm working on but host things on my Github page and thus can only do client side stuff. Getting a server is a possibility but for just one tiny project it doesn't seem worth it.

<comment><USER20> Yes, you can absolutely run React components without the use of a server. You can edit an html file locally and put a react component in there. That's usually the first thing most React tutorials have you do.

If you're using a backend server you're just rendering the react stuff to html and sending it to the client.

<comment><USER19> Great! I'll go check out some React tutorials.

</comment></comment></comment><comment><USER21> The documentation is awesome, I noticed it is pretty similar to React-CSS's documentation. Is that the original source of this documentation style or is there some library I can use for my own personal project?

<comment><AUTHOR> Thanks! I built it originally for `reactcss` but have used it on 3 projects now. I am going to be releasing it at the end of next month with a nice writeup!

<comment><USER21> Really cool, look forward to it!

</comment></comment></comment><comment><USER22> Wow! I feel like this is one of the first packaged widgets I've ever come across (could be very very wrong). Great example of how React and web components will make the future of the web more awesome.

<comment><USER23> There's some good widget collections out there:

      * http://material-ui.com/#/components/appbar
      * http://react-bootstrap.github.io/components.html

And for more single-use components, theres [http://react- components.com/](http://react-components.com/)

<comment><USER22> Appreciate the links, thanks!

</comment></comment></comment><comment><USER24> Looks really great. Why the React dependency though? Would be more flexible, faster, and avoid dependency hell if it was vanilla JS.

<comment><USER25> "dependency hell" is a bit of an exaggeration. It has one dependency.

<comment><USER24> Dependency hell is from when multiple components depend on the same framework, but work with different versions. Since React is pre 1.0, you can expect the API to change a bit. If you build an app with multiple React components, you'd better hope all of them are well maintained, or you'll break some scripts when upgrading React (which you'll need to do for other scripts' bug fixes)

</comment></comment></comment><comment><USER26> Really slick but would be great if there was a browser compatibility listed somewhere.

</comment><comment><USER27> does this work with react 0.14?</comment>


Easy parallel Python with concurrent.futures - <AUTHOR> https://gist.github.com/mangecoeur/9540178

<comment><USER2> If you need this in python 2.7, you can get it from pypi (pip install futures)

</comment><comment><USER3> Parallel python is almost an oxymoron. Python has a GIL that prevents more than one thread from running Python code at the same time. You can get around that by spawning multiple processes each running an independent interpreter, but that's not as cheap or easy as spawning threads. You need to reuse those processes for multiple units of work, or chunk your units of work into big enough pieces to offset the startup costs. Sharing large amounts of memory between the processes requires copying or shared memory (which also isn't that friendly to use from Python.) Granted copying is harder to get wrong, so it's the recommended solution anyway. If you wanted extreme performance Python is a lousy choice in the first place.

<comment><USER4> CPython the implementation has a GIL; Python the language does not. Plenty of other implementations (PyPy, Jython, Cython) avoid having a GIL or have options to disable it.

> If you wanted extreme performance Python is a lousy choice in the first > place.

Using Python for glue code and C-modules for performance critical work is a popular option.

<comment><USER3> I'm aware of that, but CPython is by far the most popular implementation. Add IronPython to the list without a GIL as well.

However, Jython, IronPython and PyPy must all variously slow down even single- threaded code without the GIL because Python having the GIL made lists, dicts, and sets threadsafe. The locking (or complex lock-free algorithms or STM in the case of PyPy) is not free.

The Python language is just a poor choice for concurrency. It's also a poor choice for a glue language, as Lua is much better designed for that, but Python seems to have become popular in that role anyway (likely due to a richer ecosystem.) Python, even with all of PyPy's JIT magic is still one of the slower languages. If you're using it for real work (not just as glue) and you need extreme performance, then it's a poor choice in the first place.

Keep in mind that I have a Python day job, and Python has been my favorite language for over a decade. I'm not hating on Python, I'm just acknowledging its failings.

<comment><USER5> Through Cython you can write extensions that release the GIL to make them easily parellizable. However, given that I mostly work Python in Windows (and 64 bit version), I get that Cython might not be a viable option for your use cases.

As for high performance Python, I always recommend Ian Ozsvalds talks at various conferences. Python can be used to reach high performance, even work well in distributed environments and very paralell architectures. It's owed to the great librarys that were developed to work in those circumstances (Numpy, numba, SciPy, OpenCV[1], to name a few), but it's still something posible within the language. Add that to the rapid development cycle that is posible within it, and the flexibility that it can achieve, and you've got a great language for HPC -- despite it's shortcommings.

[1] I will acknowledge here that OpenCV is not Python-specific, if anyone wishes to point that.

<comment><USER3> I'll grant you all of those points, if you use Cython to compile your code to native or use a native library to do the expensive parts of your code, then it works out fine. Both of those get around Python's inherit slowness by doing the costly things outside of Python.

</comment></comment></comment></comment></comment><comment><USER6> _Another_ Python concurrent library?? To boot one which makes Python look like Java? This.that.that.this.whatever()?

How is this better than a few simple lines of multiprocessing module exactly?

Yes I'm being negative. People need to _stop_ already adding yet more parallel libraries to Python. Contribute to existing 15+ options or stay away. Unless you're GvR (and even that's debatable) you're not helping the ecosystem - you're confusing it even further.

Python is not a good first choice for multicore anyway because it is at least 10x slower than compiled languages so the best you are hoping for is 8-core parallelism to get you back to the performance of _single core C_ (or whatever compiled language you want). If you're serious about performance there is no other way than to abandon Python. Only Numpy (and Pandas) are keeping it competitive, and in a number of fields, it's looking more and more R-like as a prototyping-only language, with production in anything-but.

<comment><USER7> concurrent.futures isn't really _another_ parallel library... its just the standard libraries higher level interface to both the multiprocessing and threading modules.

See the PEP: [https://www.python.org/dev/peps/pep-3148/](https://www.python.org/dev/peps/pep-3148/)</comment></comment>


Ask HN: What awesome projects did you shipped in 2018? - <AUTHOR> 2018 is closing fast. So what awesome projects did you shipped during the year? <comment><USER2> Nothing yet, but I still have a couple of days left. The goal here at Fogbeam Labs all year has been to launch our "Fogcutter" SaaS platform in 2018, and it's down to a few final things that need to be done to launch and finally be able to actually call it "shipped".

Ask me again on the 31st. :-)</comment>


How to quickly build a stock photo site using Cloudinary - <AUTHOR> http://cloudinary.com/blog/how_to_quickly_build_a_stock_photo_site_using_cloudinary

<comment><AUTHOR> This blog post describes how to utilize the private images and strict transformations features that are now available through Cloudinary, for easily building a stock photo site. Uploading private images, resizing, cropping and adding watermarks, fast delivery of low-resolution samples through a CDN and authenticated download of original hi-resolution images on demand. Ruby on Rails, PHP, Python and Node.js sample code included.</comment>


How Israel Caught Russian Hackers Scouring the World for U.S. Secrets - <AUTHOR> https://www.nytimes.com/2017/10/10/technology/kaspersky-lab-israel-russia-hacking.html <comment><USER2> This is huge. I'm very curious why there is not a larger discussion around this.</comment>


Two Israeli teens arrested for running major DDoS service - <AUTHOR> http://www.theverge.com/2016/9/11/12878692/vdos-israeli-teens-ddos-cyberattack-service-arrested <comment><USER3> This story was originally reported by American journalist brian krebs

[http://krebsonsecurity.com/2016/09/israeli-online-attack- ser...](http://krebsonsecurity.com/2016/09/israeli-online-attack-service-vdos- earned-600000-in-two-years/)

[http://krebsonsecurity.com/2016/09/alleged-vdos- proprietors-...](http://krebsonsecurity.com/2016/09/alleged-vdos-proprietors- arrested-in-israel/)

</comment><comment><USER4> I would be surprised if anything happens to them. They are Israeli and most likely considered off limits to the US Justice System. They will probably just get a stern warning.

Different rules for different folks......

<comment><USER5> FYI, Israel has extradited quite a few people, mostly related to fraud and drug dealing, e.g. [http://www.jpost.com/National-News/Court-upholds-US- extradit...](http://www.jpost.com/National-News/Court-upholds-US-extradition- request-for-Israelis) and [http://www.haaretz.com/news/ze-ev-rosenstein-to-be- extradite...](http://www.haaretz.com/news/ze-ev-rosenstein-to-be-extradited- to-u-s-for-drug-smuggling-1.178871)

A sad (or amusing, depending on your point of view) thing, actually - <USER2> police has started begging the FBI a few years ago to ask Israel for extradition of Israeli drug dealers who had anything, even remotely, to do with the US - because the burden of evidence in a criminal case in Israel is so much heavier than in the US.

This is their plan B: Israeli police have been unable to get the conviction they wanted in cases which would have been cut-and-dry in the US. Israeli courts don't just trust blindly trust a cop's "I saw / I heard" evidence, and apply custody of evidence rules very strictly, which makes some (arguably just) convictions nearly impossible. (On the other hand, wrong convictions, though definitely exist, are probably much less frequent as a result)

<comment><USER6> Sounds like we can learn something from them regarding burden of proof.

Not that a police officers experience shouldn't have any gravitas, but it also shouldn't become the law.</comment></comment></comment>


Sony agrees to pay millions to gamers to settle PS3 Linux debacle - <AUTHOR> http://arstechnica.com/tech-policy/2016/06/if-you-used-to-run-linux-on-your-ps3-you-could-get-55-from-sony/ <comment><USER2> > To get the $55, a gamer "must attest under oath to their purchase of the > product and installation of Linux, provide proof of their purchase or serial > number and PlayStation Network Sign-in ID, and submit some proof of their > use of the Other OS functionality." To get the $9, PS3 owners must submit a > claim that, at the time they bought their console, they "knew about the > Other OS, relied upon the Other OS functionality, and intended to use the > Other OS functionality."

I seriously doubt very much money will be payed out to users if this settlement is approved.

I'm sure the lawyers would be happy with it though:

> The deal also provides up to $2.25 million in attorneys' fees for the > lawyers who brought suit.

That payout is equal to around ~40909 users who are able to prove they used the Other OS functionality. I'm doubtful that many exist.

<comment><USER3> What really pisses me off about this is I can't provide proof anymore that I made use of OtherOS. The later updates removed that functionality.

I remember at that time I was so excited thinking I'd get to use my PS3 as my main machine, my game console, and for bitcoin mining -- and a bluray player. I desperately wanted it to be my entertainment center for all purposes.

Sony didn't want me to be a happy customer.

<comment><USER4> You don't need proof as in mathematical proof.

You need proof as in legal proof, i.e. a paper saying "I used it".

<comment><USER2> Attestation ("I used it") and "proof" are used separately in the quote from the article, implying that the proof must be more that just attestation.

</comment></comment></comment></comment><comment><USER5> I specifally followed the PS3 market carefully, and made sure to buy a used PS3 that had the capability to install Linux. Installing it was a fun side- project, although I didn't use it much. Then I bought a game I really wanted to play, but it required the firmware update that would destroy the Linux. I've been upset, and was seriously considering buying another used PS3 just to be able to play my game on _that_.

So, I'm glad this finally won. I was disenfranchised by their obnoxious actions. Guiltily, I admit that the $55 I get back will probably go towards a used PS3 so I can play the game alongside my Linux-enabled PS3 :)

</comment><comment><USER6> Sony is the best example that I can think of for manufacturers whose products have fewer features over time. Remember that PS3s also had PS2 compatibility?

<comment><USER7> I chose the ps3 because it had usb controllers. I thought that would make the controllers forward compatible to ps4.

I'm done with consoles.

<comment><USER8> forward compatible with a console released 7 years apart?

It shows how different the clientele of Nintendo is, since they change the controllers at every new iteration.

<comment><USER7> For a controller, sure. The current controller has all the buttons the old controller has. They are both USB/bluetooth. Most games need a one or two sticks and the standard buttons. There is no reason they couldn't develop a system to cover a grand total of _two_ controller specs, both of which they created and which probably have a 90+% overlap.

I'll stick to my PC, where every controller works.

<comment><USER9> > I'll stick to my PC, where every controller works.

Your PC still has a 15 pin gameport and a 9/25 pin serial?

</comment></comment></comment></comment></comment><comment><USER10> It would have been better if Sony had to put the Linux support back in. What good are $55 (after jumping through lots of hoops) if you want to run Linux on your PS3?

<comment><USER11> I wouldn't be surprised if Sony _couldn 't_ fix their hypervisor. They may have lost the source code, or perhaps the person who wrote it was transferred to the pachinko division.

<comment><USER12> Pretty sure that's Konami you're thinking of :)

</comment></comment></comment><comment><USER13> Software developers beware: removing support for a niche feature in your product can get you into big trouble.

<comment><USER14> I'm sorry, but I think this comment severely misrepresents what happened and the precedent it helped establish.

First, the firmware update didn't remove support for a feature, it explicitly blocked certain user space software. It forced consumers to use Sony's PS OS rather than an alternative like Linux.

Second, it helps establish precedence that hardware vendors can have control/part ownership of hardware after you purchase it. Gone are the days where the computer you purchase pre-assembled is your own. Now vendors can apparently control what you decide to do with hardware that you purchase. Sony isn't alone in this, Microsoft has been moving towards this for a long time, and Apple is probably the worst offender, but they are joined by most hardware vendors at this point.

It's anti-consumer behavior. It probably shouldn't even be legal, but yet corporations can get away with it, so they continue to do it since it aligns with their best interests (barriers to competition).

<comment><USER15> How does it imply any sort of loss of ownership? They removed Linux support in an update. The update was not forced. You got the choice to install it or not.

If you wanted to decline the update and keep using Linux, you could. All your existing games would continue working, too, but you couldn't play games released after the update (which require the newer firmware). Nor could you play online, as having all updates is a requirement of connectng to their online service.

I have a 60GB PS3, but I agree with the grandparent that a legal obligation to maintain support indefinitely would set a bad precedent.

<comment><USER16> > The update was not forced. You got the choice to install it or not.

Some choice:

> However, without updating, console owners couldn't connect to the > PlayStation Network, play any games online, play any games or Blu-ray movies > that required the new firmware, play any files kept on a media server, or > download any future updates.

If you buy a product on a claim that it performs N features, and a future update forces you to choose which subset of N features you would like to keep, the company has still failed on their claim.

<comment><USER15> Those things also all happen when a platform is no longer supported. So, if Sony wanted to shut down their games division tomorrow, how many new games would you require they release for the PS4 and how long should they be required to keep running their servers?

While I think there's an argument for being required to allow online access to those within warranty, it makes way more sense to just guarantee it plays the games it played when you got it. It's something that consumers could easily understand and depend on.

<comment><USER16> > Those things also all happen when a platform is no longer supported.

That's not a given. Some of the features require no ongoing support, like playing media from a local server.

> So, if Sony wanted to shut down their games division tomorrow (...) how long > should they be required to keep running their servers?

Leave the concrete numbers to the judges and juries. But if today I bought a $700 console from an authorized dealer, and tomorrow it was a brick, I'm pretty sure I'd have a case for getting a big chunk of that money back. If in a year it was mostly a brick, I'd expect less money back. Exact numbers in these cases come down to negotiation.

All this is tangential of course because Sony _didn 't_ stop supporting the platform.

</comment></comment></comment></comment></comment></comment><comment><USER17> Sony should adopt Linux and Vulkan already (maybe for PS4 Neo?). It needs to be able to tout some compatibility with other platforms, in the same way Microsoft is doing it now with Xbox/Win10/DX12. Sony could tout Android/Linux/Windows 7+ compatibility with Vulkan.

<comment><USER18> Vulkan doesn't do anything new that PS APIs haven't been already doing since the PS3.

They already do the same that Microsoft does with their APIs for PS3, PS4 and to smaller extent PSP and Vita.</comment></comment>


Social Inequality Worse Than Previous Estimates, According to Researcher - <AUTHOR> https://www.washingtonpost.com/news/wonk/wp/2016/10/06/striking-new-research-on-inequality-whatever-you-thought-its-worse/?wpisrc=nl_rainbow&wpmm=1 <comment><USER2> Previous discussion: [https://news.ycombinator.com/item?id=12667871](https://news.ycombinator.com/item?id=12667871)

</comment><comment><USER3> I find it weird that "only" 20% of the middle fifth will rise into the top fifth. Isn't 20% equal to one fifth and is pretty much expected? It feels like the Dilbert cartoon of the boss complaining that 40% of sick days being on Mondays and Fridays. I think the article is right overall but I'm wondering if anyone has some insight into why 20% is an unexpected number in the data.

<comment><USER4> The 20% rising up out of the middle fifth and the middle fifth being a fifth of total population are unrelated numbers. It's coincidence that they are the same number.

<comment><USER5> But the point is that, if where you ended up was completely unrelated to where you started, you would expect 20% of the middle fifth to end up at the bottom, 20% the 2nd lowest fifth, 20% the middle, 20% the 2nd highest, and 20% the highest. The article seems to be arguing there is NOT a lot of social mobility, but if so you wouldn't expect more than 20% of the middle fifth to end up in the top.

</comment></comment></comment><comment><USER6> Ok. Here is an article that claims something in the headline and then repeats it many times through out the text. In all that clutter and fear mongering; claims of how much worse things are in the american society, the proof is the new "research"\- if parents education level correlates well with the child's! Wow.. never thought that could be true.. The only "new" thing seems to be that the correlation coefficient is slightly higher. 0.1 higher.. What does that mean? I am not sure. They define educational mobility as a proxy for social mobility. By that definition any non negative correlation of education achievement between generations implies increasing social inequality. They bring up this statistic of "20% of middle fifth will rise to the top fifth" I am not sure whether that is bad. Naively I would expect exactly that to happen in an unbiased system without inequality. I guess I am saying, color me confused.

</comment><comment><USER5> IIRC there was another recent article in Hacker News that looked back on prominent families in Florence going back centuries. They _still_ found that families who were prominent back during the Renaissance are still on top today.

<comment><USER7> Yes! The thread was [https://news.ycombinator.com/item?id=11731890](https://news.ycombinator.com/item?id=11731890)

</comment></comment><comment><USER8> This seems to insist that social mobility is _only_ moving into the top fifth, and ignores that moving from the middle fifth to the second fifth (etc) is still mobility

</comment><comment><USER9> Am the only one who is baffled by their explanation of correlation? FTFA:

"correlation in educational attainment between a parent and a child is generally around .4 to .6. This basically means that, if my parent has one more year of schooling than your parent, I will automatically end up with 4/10 to 6/10 of an extra year of school than you have, all else equal."

This doesn't line up with my understanding of statistics

<comment><USER10> It's likely that the paper communicated the effect of the correlation and the reporter butchered the explanation.

Can't get the paper though, so who knows.

</comment></comment><comment><USER11> I couldn't help but try to square this article with another article I saw today that said a record number of people are graduating high school. So, this article says that _relative to each other_ people are staying in the same socioeconomic class, which they conclude is bad. But if _everyone as a group_ is doing better, then I think there really is no problem.

</comment><comment><USER12> Fix the education system the rest will follow.

<comment><USER13> So lets say that you "fix" the education system.

What does that mean for college enrollments? Do the ~70% of households making less than 50k who were generating far lower percentages of college bound children now boost enrollments for universities?

With a similar dropout rate or lower since education is "fixed" we now have a ton more college graduates. Are there anywhere near enough jobs requiring a college degree to satisfy the demand?

There is a much larger problem than some stock-phrase about education can fix.

<comment><USER14> I see it as more of a failing of our current economic system if we don't know how to use a surge in the number of college graduates.</comment></comment></comment>


Facebook miss, shares at all-time low - <AUTHOR> http://www.google.com/finance?q=fb

<comment><USER2> All time is a bit rich, given how long the shares have been available.

<comment><AUTHOR> Factually correct. It is 24.09 right now. Previous intraday low was 25.52</comment></comment>


Iranian Web Programmer's Death Sentence to Be Carried Out Any Moment - <AUTHOR> http://freejafarpanahi.wordpress.com/2012/02/16/urgent-saeed-malekpours-death-sentence-to-be-carried-out-any-moment <comment><USER3> Wow! That could have been me! During the 2008 post-election protests and the beginning of the green movement, I aggregated all the images coming out of Iran into my personal flickr account. BIG-STUPID-MISTAKE! These were brutal, news breaking images .

Little did I know people and news organizations around the world were including these images in their articles, blogs, tweets etc and attributing me, and sometimes printing my full name as the _original_ photographer. If you do a google search of my full name, you still come up with results like that (luckily not in the first page). I've tried unsuccessfully to get them removed.

Seeing what is happening to Malekpour, I don't think it's safe to go back. Not anytime soon

<comment><USER4> The reason he is scheduled for execution is that he is not a Canadian citizen yet. Had he been, Iran would just have expelled him.

<comment><USER5> That's not the case. Forfeiting Iranian citizenship is a fairly complicated process that ultimately requires permission from the uppermost levels of the Iranian Government as well as completing your national service. As long as he has Iranian citizenship, it's irrelevant whether he has a Canadian passport or not, it's a basic rule of international law that your country cannot (officially) provide you diplomatic assistance in another country where you're also a citizen.

</comment></comment></comment><comment><USER6> As annoyed as I often get at my country, it is things like this that make me glad to be here and able to voice opinion about all its flaws without fear of something like this. Occasionally I might have some regrets about my time in the service, but not today.

I just wish there was something we could do for this guy - I hate knowing what I know about it and also being completely powerless to influence the outcome of this in any way at all.

<comment><USER7> You can do something. Our country's foreign relations with Iran may really shaky but that doesn't stop us from being able to officially condemn their behavior, which the international community will hear, and potentially echo.

Write your representatives and tell them how you feel and that they should do something about it.

<comment><USER8> That unfortunately won't turn out to be the ethical thing to do. Our government overthrew Iran's secular, parliamentary democracy and installed the Shah — and it's still threatening them. (They fail to have a sufficiently obedient tyranny.) This proposal you mention is tantamount to supporting more attacks.

Fortunately, there's a lot of room to really help out mideasterners — by getting our government off their backs and stop supporting their regimes.

And anyone in an ethical mood need look no further than their own country! The US jails far more of its own people than any other country. On Feb 20, you can participate in a nearby Occupy 4 Prisoners. (<http://occupy4prisoners.org/actions/>)

<comment><USER9> Wait, are you speaking out against the US criminal justice system? Is that because you... plan to invade it? Or do you believe that maybe, just maybe, _saying_ something might achieve the kind of push-back you want to happen?

Maybe countries could do that too...? Hmm. And I'm pretty sure they don't have to be pure virgin countries in order to condemn unfairness.

<comment><USER10> Wait, are you trying to reform Iran to internationally end the death penalty for certain crimes? Or are you just playing into CIA psyops to overthrow the Iranian government.

Maybe the U.S. could do that too...? Hmm. Too bad there wasn't this same energy to stop the U.S. from executing Troy Davis, or murdering Al-Awlaki's 16 year old son, Abdulrahman al-Awlaki, a U.S. citizen. Probably couldn't get that support in racist North America.

<comment><USER11> What do you expect from a continent that's only been inhabited for fifteen thousand years?

As for the meme that "America is the worst country!"-

Although I would love for us to shoulder less of the burden and withdraw, the nuclear fallout would circle the globe.

<comment><USER10> Under the NPT Treaty Iran has a right to develop nuclear energy. As for the Western canard about Iran's nuclear weapons, that dog won't hunt. It is also a double unfair standard for the imperialist U.S. and Israel to have nuclear weapons and prevent Iran from having similar weapons.

<comment><USER12> Truly. The world would be a much safer place if every country had intercontinental nuclear warheads. Even better if everyone had guns that fired mini-nukes. It would completely end all crime and war!

</comment></comment></comment></comment></comment></comment></comment></comment><comment><AUTHOR> Just two days ago, his sister Maryam Malekpour told[1] the International Campaign for Human Rights in Iran: "[Saeed] has been pressured [by security forces] to make confessions before a television camera, which he has fortunately not accepted".

He didn't accept that, so now they're having him executed.

[1] <http://www.iranhumanrights.org/2012/02/malekpour-sister/>

<comment><USER13> How do you know that they wouldn't have used the coerced confession to try to justify the execution?

</comment></comment><comment><USER14> I don't have words for how much this upsets me.

</comment><comment><AUTHOR> Related HN submission:

 _Death sentence for Iranian web programmer_ – <http://news.ycombinator.com/item?id=3484674> (28 days ago)

</comment><comment><USER15> Copied verbatim from: https Saeed's Facebook group:

<https://www.facebook.com/Free.Saeed.Malekpour> \</comment><comment></comment><comment>----- Saeed Malekpour's sister has written an urgent appeal to the United Nations. She is hoping that the the United Nations may help her save Saeed's life.

You can help get Maryam's voice heard faster by emailing her letter to the following UN contacts:

 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __Navi Pillay, UN High Commissioner for the Office of Human Rights

Email: firstname.lastname@example.com Fax: +41-22-917-9008 (Geneva) +1-212-963-4097 (NY)

His Excellency Ban Ki-moon, Secretary General of the United Nations

Fax: 212-963-7055 (You can send a fax for free online here), Tel: 1-212-963-7160, 61, 62

Additional emails: email@example.com, email@example.com

 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __*

To the Office of the High Commissioner for Human Rights:

My name is Maryam Malekpour. I am Saeed Malekpour's sister. I am writing this urgent request to you on behalf of my family. We live in Tehran, Iran. My brother has been living with the threat of death in Evin prison since October 2008. We require your urgent help. When Saeed's lawyers visited the Revolutionary Court two days ago to follow up on his case file, they discovered that the file containing the death sentence ruling was no longer there, and it was not in the possession of the Supreme Court either. Saeed Malekpour's lawyers were informed that this only meant that the case file was sent to the Circuit Court for Execution of Sentences.

One of Saeed's lawyers said: "If we [Saeed's lawyers] had a chance to review the case file, then we would have had a chance to prevent the execution of the sentence. By reviewing the case we could have pointed out that an expert has never been brought into the case for investigation. The case file was sent straight to the Circuit Court for Execution of Sentences." He continued: "Since Saeed Malekpour's sentence is in the possession of the Circuit Court for Execution of Sentences, this means that they are capable of executing Saeed at any moment they wish."

Saeed's case file was sent to the the execution of sentences office even though his lawyer's never reviewed the case file beforehand. Many illegal actions have been taken to condemn Saeed to death, including the fact that no expert has ever reviewed the case. Some other examples of illegal actions taken are: One of Saeed's charges is, "Corrupting the Earth", however no one, not even the lawyers have been able to review the charges in Saeed's case file. They want to execute Saeed but his case file still possesses discrepancies never investigated. The only evidence they have to condemn Saeed to death are hours of false confessions Saeed gave while under physical and psychological torture. I am aware that the United Nations already possesses a detailed record of Saeed's accounts of torture.

Saeed was living in Canada with his wife. They are Permanent Residents of that country. He came for a visit to Iran in October 2008 to visit his father, who died from a brain tumour shortly after Saeed's arrest.

We cannot believe Saeed was arrested in the first place let alone sentenced to death. We cannot believe that we have been forced to live a horrific nightmare every day for more than three years. Saeed can be illegally executed at any moment unless the international community defends his life. Saeed's lawyers have told our family that the only hope left is the international community. All legal channels within Iran have been exhausted.

We are desperate for your help!

Please help Saeed. We can provide you with any further information needed. If we all do our part, we can possibly save Saeed from execution.

Sincerely,

Maryam Malekpour Tehran, Iran

<comment><USER16> Or copy the letter from here (which I think may be getting updated with additional emails):

[http://peoplewithoutnation.wordpress.com/2012/02/16/maryam-m...](http://peoplewithoutnation.wordpress.com/2012/02/16/maryam- malekpour-makes-an-urgent-appeal-to-the-united-nations/)

</comment></comment><comment><USER17> I'm unclear why Canada hasn't granted him citizenship while in Iranian custody, just to escalate matters. Although I don't think Iran recognizes dual nationality for its citizens, so even with Canadian (or US) citizenship, he'd still be an Iranian national to them.

</comment><comment><USER18> Does anyone have any facts on the case? What software did he write, where was it released, which website used it, and what evidence was presented for the other charges?

</comment><comment><USER19> Can someone explain the il/legality behind this? Articles say that the man is "a Canadian resident" - does this not affect where he can be tried?

<comment><AUTHOR> He's a Canadian resident, not a _citizen_. Unfortunately that makes all the difference in the world:

 _"Canada condemns Iran's reported decision to execute Mr. Malekpour. Sadly, his case is far from the only example of Iran's utter disregard for human life. The regime in Tehran frequently ignores principles like due process for its citizens domestically, and international human rights obligations generally."_

Canadian governments _condemns_ his execution, but nothing more.

<comment><USER20> And rightly (although sadly) so. Consider the reverse: A Canadian citizen takes up residence in a third-world country, where he has sex with minors. He returns to Canada, where he is arrested under Canadian law for engaging in sex tourism.

The other country may want to prosecute him, they may not, they may want to protest, they may not. But the Canadian government is not bound by any treaty or agreement to send him back to the other country.

</comment></comment></comment><comment><USER21> Does anyone have a copy/link to his code?

</comment><comment><USER22> What does this mean for other open-source developers. For example - <USER2> Torvalds, GKH etc. Or what about Tim-Berner's Lee ? Will they be executed if they every visit Iran ?

<comment><USER23> I wouldn't risk it, personally. Although it might make a difference if you are an Iranian citizen or not.

<comment><USER4> Iran wouldn't have touched Tim since he is a UK citizen. That is just begging for the US to go 'special relatioship' on his ass. Linus is a finn, so he is properly also safe. I don't know the last one.

<comment><AUTHOR> They were _touching_ those American hikers for a couple years though, weren't they?

<comment><USER24> In that case, it was clear that the Americans committed some sort of crime (straying across an international border), and so it was Iran's right to do whatever they wanted (to extract as much political value from the event as possible).

Someone visiting the country on a valid visa and facing execution because of their positive contributions to society in their home country is a whole other issue. I'm guessing that Iran, in that case, would have a lot less precedent to stand on, so they might not play the same political games.

</comment></comment></comment></comment></comment><comment><USER25> Wow, I'm actually stunned. The general consensus seemed to be that Iran would pardon him at the last minute and just have him exiled. Maybe that will still be the case?

</comment><comment><USER22> I was hoping the threat of execution was one of the usual sabre-rattling, grand-standing moves Iran keeps making to piss off the international community or just to get back at them. Now it seems they're taking it too far. Surely the bosses in Iran can see how stupid this is.

<comment><USER26> Yes, I really don't understand moves like this. With Israel poised to attack Iran's nuclear facilities, and perhaps start an all out air war with them, you would think Iran would want to gain some good will from the international community... I would just write it off as a country run by madmen that are not rational actors, but any number of other madmen have played things better. I wonder what the regime wants for freeing him, maybe they just want too much.

<comment><USER27> This is not a rational assessment of Iran's rulers. The Iranian regime doesn't care about international good will. They care about power, and geopolitical advantage. They have been exporting terror to neighboring states for 3 decades through Hezbollah and other organizations. They have been involved in a proxy war with Israel for ages. They have recently been working as fast as possible to acquire home grown nuclear weapons, and the ICBMs to deliver them anywhere.

The Iranian regime doesn't care about world sentiment or about the Iranian people. They care about holding on to power and furthering their narrow ideological beliefs.

</comment></comment></comment><comment><USER28> If anyone came here, like me, wondering what to do to help there's a petition that's linked to on his facebook page:

<https://www.gopetition.com/petition/40162.html> [includes unecrypted assets]

</comment><comment><USER29> How about flooding Twitter with mentions to @chavezcandanga, asking him to ask the Iranian president to do something about this? They're very close, and his twitter account is really active. I just tweeted him this link.

</comment><comment><USER30> Does anybody have a link to the software that Saaed created? It sounds like it was just either a library or just generic image sharing software, but none of the stories seem to link to it.

</comment><comment><USER31> Imagine what it feels like to know the whole world is aware you're about to be murdered and no one is likely to stop it from happening.

</comment><comment><USER32> Another example of why Iran is an evil dictatorship.

<comment><USER24> Democracies have the death penalty, too. This is another example of why the death penalty is never an acceptable punishment for a crime; this guy hasn't even had a chance to appeal properly, and they're already planning to execute him. That's not justice, that's barbaric.

<comment><AUTHOR> > _This is another example of why the death penalty is never an acceptable > punishment for a crime_

I disagree. Bashar al-Asad has killed 8300 Syrian in the past 11 months, and now the country is on the verge of civil war. _Some_ crimes deserve death penalty (though, obviously writing an open-source app does not qualify!).

<comment><USER24> The fact that the death penalty seems reasonable in one case doesn't make it reasonable. The death penalty is inappropriate because it doesn't have any checks and balances; if you are executed and later found not guilty, you can't be brought back to life.

It's clear that fear of punishment does not deter crimes; otherwise death penalty states would have no murders.

</comment></comment></comment></comment><comment><USER33> Iran's going to execute someone? It must be Thursday.

<comment><USER33> Downvote me more! I love it!

</comment></comment><comment><USER34> Malekpour created porn websites. In particular, he created Persian porn websites - porn websites targeted at people who read Persian. Porn websites are against the law in Iran. He's an Iranian citizen. He traveled to Iran.

I strongly disapprove of censorship, particularly censorship of the "death" kind. But he should perhaps have been a little bit more discerning about his travel plans. This anti-porn thing is not new or unexpected. What did he think would happen?

<comment><USER35> So you're saying it's his fault if he's going to get executed?

Next time you break the law and you get fined for it, I truly hope you will not complain because I'll teleport right next to you and say "what did you think would happen?".

And we'll have a good laugh about it, because you will not die.

<comment><USER36> I think the OP is saying "don't fuck with the government or you will end up gone"</comment></comment></comment>


It's OK to reject potential customers - <AUTHOR> https://www.saberfeedback.com/blog/its-ok-to-rejet-potential-customers/#.XDy8QgqkTq4.hackernews <comment><USER2> Good on you. It's tough to find companies with strong morals, you did the right thing.</comment>


Slides.IO - Realtime slideshow service preview - <AUTHOR> http://slides.indutny.com/

<comment><AUTHOR> Basically, this project allows you to share your slides with people. And change/add/remove them on the fly. Only author of slideshow can move slides left and right

</comment><comment><AUTHOR> We're actively searching for donations or funding. Please contact me by email: email@example.com for details</comment>


Ask HN: Secondary markets for employees with stock options? - <AUTHOR> Many great minds have discussed how the current employee equity situation is broken. One point is how the 90-day stock option exercise period forces employees to give up vested stock if they are fired/leave, if they can't afford to pay the exercise price of their options and the Alternative Minimum Tax (28% federal of "paper gains"). Some have responded by changing their exercise periods to 10 years e.g. Quora.
For employees who lack that option, what about secondary markets that offer share liquidity before IPO/acquisition? Employees can exercise all shares and sell enough to cover AMT. The first wave (SharesPost, SecondMarket) offered direct transfer of shares on the cap table. The next wave (ESOFund, 137 Ventures) can do deals without company involvement, with a non-recourse loan with limited upside/downside, or a forward contract with cash delivered today, and the certificate held as collateral until IPO, when it is transferred.
So why don't see this discussed more?
One reason is some companies try to restrict anything involving shares-from Right of First Refusal, to an outright prohibition of any loan/sale/_ without board approval. Some argue the latter is unenforceable, but I haven't seen any case law. First-hand knowledge online is scarce and lawyers give unclear answers due to the novelty of these deals. Can the company find out? Intervene? Sue? Are they likely to? Would this cause an unseemly public case and TechCrunch headline? How different is a rich relative vs. angel vs. a marketplace investor?
I'm asking HN to get more thoughts on secondary markets, and new ideas on solving the stock option issue for employees.
Background: https://amplitude.com/blog/2015/12/01/employee-equity-is-broken-heres-our-fix https://zachholman.com/posts/the-new-10-year-vesting-schedule https://dangelo.quora.com/10-Year-Exercise-Periods-Make-Sense https://news.ycombinator.com/item?id=7920877 http://blog.samaltman.com/employee-equity <comment><USER2> Apologies in advance that my response is somewhat scattered. At Capshare, we are actively working on all of these problems. Here are some of our thoughts on early liquidity for founders: [https://www.capshare.com/blog/finding-early- liquidity-6-thin...](https://www.capshare.com/blog/finding-early- liquidity-6-things-founders-should-consider-before-selling-their-shares/). Here are some thoughts on cap table transparency: [https://www.capshare.com/blog/will-cap-table-transparency- he...](https://www.capshare.com/blog/will-cap-table-transparency-help-your- startup/). Finally some thoughts about optimizing options for tax efficiency: [https://www.capshare.com/blog/how-to-structure-stock- options...](https://www.capshare.com/blog/how-to-structure-stock-options-for- millions-in-tax-savings-part-1/). Many of the online equity / electronic stock companies are anticipating new ways to transact that will increase private stock liquidity.</comment>


Apple Multiple Store Services Working Again - <AUTHOR> https://www.apple.com/support/systemstatus/

<comment><AUTHOR> Apple Multiple Store Services Working Again:

[https://www.apple.com/support/systemstatus/](https://www.apple.com/support/systemstatus/)

[http://i.imgur.com/O7lDwx4.png](http://i.imgur.com/O7lDwx4.png)</comment>