Does a narcissism epidemic exist in modern western societies? - <AUTHOR> https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5783345/ <comment><USER2> I wonder if narcissism and individualism are also linked to higher suicide rates.

<comment><USER3> Possibly; however, aren't the depression rates in Russia pretty high as well? I, being a very independent American, feel that high rates of individualism are a good thing and provide inner power to continue when situations become difficult.

<comment><USER4> I think Russia has extremely high rates of alcoholism, seasonal depression must also be an issue.

I just don't think you can learn much by comparing Russia with western Europe and North America. There are too many radically different variables.

</comment></comment></comment><comment><USER5> Yes, and Instagram is at the forefront of perpetuating this...[1]

Source: [https://lendedu.com/blog/millennials-instagram- narcissistic-...](https://lendedu.com/blog/millennials-instagram-narcissistic- social-media-platform/)

See the chart comparing narcissism on various social platforms.... The 'Gram is waaay ahead.

<comment><USER6> I tend to agree whole heartedly, but at the same time, IG seems, IMO, to feel a lot less toxic than Twitter. It's a small sample set, and perhaps not really indicative of much besides my personal feeds, but IG definitely has a lot more self promotion, but my Twitter feed comes off far more as a place for people to air their quick take criticisms and gripes.

Shallow "hey look at me posts" don't bother me as much as just a lot of generally, even if mildly, negative thoughts and observations.

Admittedly, I've long had a very strained and irritated relationship with my Twitter feed, even if I still enjoy the people I follow personally. I just get a much more negative feeling when using Twitter. Just could be me though.

</comment></comment><comment><USER7> I'm sorry, but I can't take such a study seriously when it's using data collected from East Germany pre fall of Communism, when it had one of if not the most intrusive surveillance societies in human history. There's simply too great a possibility that the fear of study participants would have altered their responses to avoid reprisal.

To a lesser extent, I'd cast a skeptical glance on this kind of data any society with collectivist pressures until presented with a very high standard of evidence that the participants were convincingly guaranteed their responses were untraceably dissociated from their regular lives.

<comment><USER8> Did you read the abstract? They conducted an online survey and asked where the participants where coming from. They collected the data a few months ago.

Besides that you seem to have no idea how society actually worked in Eastern Germany - trust to medical personel was actually pretty high and health care was good. STEM subjects were hard science and also medicine education was good. Not sure about psychiatry but western countries did lobotomy until the 80ies...

So I guess if they would have screened in the GDR for that, the data might be accurate enough - but you didn't bother to read the abstract.

Stasi worked different - they didn't bother with regular folks but were focussed on dissidents (wearing blue jeans and having long hair was often enough, through) and people in power positions or with connections outside of GDR were targeted.

Reprisal was not like in North Korea where you end up in the gulag (stuff like that happend, I just want to clarify not excuse them) - it was a much more nuanced system - you don't get the flat or job an stuff like this.

People planning for or announcing public discontent with system got often harsh treatment but everday folks could speak open as long as you didn't articulate discontent with the system - even that was allowed to a certain degree.

</comment></comment><comment><USER9> Edgyyy</comment>


France plans 'Google tax' on Internet searches - <AUTHOR> http://www.telegraph.co.uk/technology/google/6947706/France-plans-Google-tax-on-internet-searches.html

<comment><USER2> The core problem with this scheme is one that's endemic to this sort of legislation. It's a basic assumption that economic interactions are all ultimately zero-sum, which is simply untrue. The idea that Google (or anyone else) must necessarily derive its success from somehow, somewhere screwing people denies the fact that the healthiest economies are packed with non-zero- sum interactions.

<comment><USER3> Taxation is also a tool to shape behavior.

<comment><USER4> Not sure how this relates to what karzeem has said. You're right, taxation can shape behaviour. So what do you suppose it's saying here? Let's tax and discourage a productive part of society - or at least a part that helps people get things done faster to subsidize an industry (that's already being protected and promoted by government) that people are not interested in enough to actually support with their own money?

Let's also not forget Quaero that the French tried to create as a counterbalance to supposedly American centric search for a total estimated amount of 293M Euros over 5 years! If the French government was that concerned about certain favored industries, why not just put their money there?

<comment><USER3> I simply said that because he said the motivation from this proposed tax stems from the misbelief of the zero sum game in wealth creation.

However, from the article it seems it is more a way to to stimulate certain behavior (i.e. cultural developments).

</comment></comment></comment></comment><comment><USER5> _The president is said to have been made keenly aware of the problems illegal downloads pose musicians by his supermodel-turned-singer wife, Carla Bruni- Sarkozy._

 _This may explain why the French first lady's producer, Patrick Zelnik, was tasked with leading the commission, which came up with the proposals._

Wow, no conflict of interest there.

</comment><comment><USER6> I'm constantly amazed that France's economy is as good as it is, given how much they love shooting themselves in the foot.

<comment><USER7> Indeed. Most of the US's growth in GDP versus say the Euro 15 countries for the past while has come from population growth. On a per-capita basis, the US doesn't seem to be reaping much of the supposed benefit of its allegedly pro- business system, though as you can tell I think there's a lot of meddling in the US system too, with what appears to be legalized bribery of government under a different name.

A blogger for The Economist had an interesting article today:

<http://www.economist.com/blogs/democracyinamerica/2010/01_0>

(On HN here: <http://news.ycombinator.com/item?id=1038226> )

</comment></comment><comment><USER8> This will lead the way so they can start taxing BMW and Mercedes to revive buggy whip manufacturing. Truly visionary.

<comment><USER9> Haha, very much along the lines of what I was thinking.

Isn't the idea behind capitalism that good businesses succeed, while bad businesses fail? What happens when all of the bad businesses are propped up by government subsidies?

^sigh^ whatever happened to letting the market decide...

<comment><USER3> The tax is to be levied irrespective of the (major) search engine used.

<comment><USER9> But the money is still being used to prop up a market that cannot support itself. If it was a vital service (like maybe a utility service) then I could understand. But we are talking about the _music industry_!

<comment><USER3> But why should search engines be able to escape paying taxes on their advertising revenues, while the music industry must pay taxes on their revenues?

<comment><USER9> You keep saying the same thing again and again. It's still not correct.

The companies that own the search engines are _already_ paying tax on their advertising revenue. See other person's comment above.

<comment><USER3> But they're not paying tax in France, where, one can argue the advertising revenue originates as and when the user clicks on the ad since it is only then that the good is considered delivered (very different from traditional advertising).

<comment><USER9> One could argue that. But advertising is a product. If I sell a product to a person in France from my Canada based company, I do not have to pay taxes on that revenue in France.

Why should this case be any different.

<comment><USER3> Depends on where the sale is made (and in this case it would be hard to argue the sale is being made in Ireland, no?), and how residency is determined.

The origination of revenue concept, residency, etc. in tax law is continuously being tested, both by governments and by companies, in a tug of war.

Consider this case of affiliate advertising (which, although different in specifics from the French case, has the same tone and a similar legal path):

[http://venturebeat.com/2009/04/24/california's-proposed-"ama...](http://venturebeat.com/2009/04/24/california's-proposed-"amazon- tax-–-bad-for-california/)

In particular, this bit: "Here's how it would work: If you have a web-based business in California and collect revenue by showing out-of-state companies' ads on your site, Bill AB178 will claim that both you and the businesses you advertise on your site have residence in California, and are therefore required to pay California sales tax. For example, say your Santa Monica-based web site shows banner ads for Amazon.com. With Bill AB178 in place, Amazon.com would be classified as a California-based business based on the fact that your business draws affiliate advertising sales revenue. Amazon would then be required to collect sales tax on all sales into California. The idea behind the bill is that California could force out-of-state retailers to collect and pay California sales taxes."

You can also read more about it here: [http://www.amazon.com/gp/help/customer/display.html?nodeId=4...](http://www.amazon.com/gp/help/customer/display.html?nodeId=468512)

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER10> Also in France we have a tax on CD-R, DVD-R, hard drives, mp3 players which is given to the music companies to compensate their losses from pirating (you pay that tax whether you pirate or not. And still haven't the right to pirate after paying it).

The ISP also give 1% of their income to those companies.

So yes I think taxing the search engines is the logical next step.

<comment><USER9> Wow. I remember reading something about that a while ago but I didn't realize it was that bad...

The next logical step is that the government forces you to listen to 4 hours of music a day, and pay for it, so that _flagging creative industries_ are supported...

</comment></comment><comment><USER3> Aren't they just simply proposing to tax online advertising revenue? What's the big deal?

<comment><USER9> The big deal is that they're planning on using the money generated to support creative industries that _are harmed by digital innovation_. ie, the music industry.

<comment><USER3> But the music industry gets taxed on their revenue, no?

If so, shouldn't the search engines be taxed on their advertising revenues?

<comment><USER9> As per the comment above: they are already taxed on their advertising revenue.

<comment><USER3> But they don't get taxed in the jurisdiction where the revenue originates (as and when the user clicks on the ad).

<comment><USER11> What you're saying is that if I click on an ad, and that click results in a company in a completely different country paying another company in another completely different country a certain sum of money, that my government should be able to tax that? There is no money entering or leaving France when a French person clicks on a Google ad. The French government has no business whatsoever trying to tax online advertising revenue that occurs due to transactions in other countries.

<comment><USER3> Aren't the ads displayed in a particular country from companies that operated in that country? When the user clicks on the ad the (French-based) company is charged by Google (i.e. the company advertising has now transacted, and according to tax origination principles, most likely that would be interpreted as having occurred in France).

See my other comments in this thread about the Amazon advertisers cases in California and New York, for a similar situation.

</comment></comment></comment></comment></comment></comment></comment><comment><USER12> This is a very interesting subject. Countries in the EU have competed to provide a better business environment to foreign companies. Eire has gone for the 10% corporation tax break. Other EU countries are threatening the companies with sanction. Witness the recent story concerning Google's UK tax bill:

<http://www.timesonline.co.uk/tol/news/uk/article6122329.ece>

Google avoids £100m UK tax "The website hailed as a 'paragon' is accused of adding to the public's burden."

Google's advertising first, then Facebook's (er, pardon - Livre de Visage's), then Reddit's (LuLui's) self service ads.

To then dish it out to non-profitable ventures is astonishing, it's like the levy I had to pay on C60 tapes to save my programs, or the levy in some countries on blank CDs and DVDs that goes into the publishing pot.

Then again, I get money from the Lottery Fund and I've never bought a ticket so I should shut up :)</comment>


Women prefer Apple, gentlemen prefer Samsung - <AUTHOR> http://news.cnet.com/8301-17852_3-57619501-71/women-prefer-apple-gentlemen-prefer-samsung/

<comment><USER2> It is comments like this "The iPhone... is merely a girlie gadget with all the technological sophistication of a 1980s Barbie."

Which shows how hostile our industry can be to women.

They aren't buying an iPhone because it is any less capable or more feminine than a Samsung. Maybe there are other reasons.

Could it be the size of the iPhone is better suited to the smaller hands of women (not a put down, women on average have smaller hands than the average man). Could there be other reasons?

I have a strong dislike for Apple products, but to say women purchasing them because they are 'girlie gadget' is offensive to women, and we as an industry have to speak out against this kind of BS.</comment>


20 top political scientists gathered to discuss our democracy. They're scared - <AUTHOR> https://www.vox.com/2017/10/13/16431502/america-democracy-decline-liberalism <comment><USER3> Link to the actual discussions.

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

</comment><comment><USER4> I'm always rather skeptical of people who call themselves political scientists. Like all branches of social science, actual scientific standards are low and many academics in these fields cling to bizarre and archaic worldviews. For instance a surprisingly large number of American social scientists claim to be Marxists:

[http://econlog.econlib.org/archives/2015/03/the_prevalence_1...](http://econlog.econlib.org/archives/2015/03/the_prevalence_1.html)

The analysis in this article is a mishmash of old findings and regurgitation of currently fashionable paranoias. The past was rosy and wonderful and apparently the modern era is full of authoritarian fascists. The fact that the apparent golden era of American democracy witnessed things like McCarthy-ism and a full blown Communist party with tens of thousands of members. The article breathlessly says things like:

 _So it's not merely that we disagree about issues; it's that we believe the other side is a grievous threat to the republic. According to Pew, the numbers above have more than doubled since 1994._

Gosh. People strongly disagree with each others politics? Say it ain't so! Here's some political science theory for you: maybe 2017 is not unusually politically divided year but rather, maybe 1994 was an unusually united year. 1994 was after all just a few years after the fall of communism, thus conclusively resolving the 20th centuries biggest political fight in favour of capitalism. The new ideological causes that would replace socialism in universities and amongst the metropolitan elites (identity politics, globalism, etc) had not yet taken over in any major way.

The article is also riddled with its own biases that the authors cannot see. Hillary Clinton believed she should be president because she is a woman, wanted to start a war with Russia and is a devotee of moving power away towards opaque bureaucracies, as she's made clear with her many comments disparaging Brexit as "not the future" and so on, but it's Trump - <USER2> actually listened to voters who'd been ignored for years - who is supposed to be the autocrat?

And of course they take it as an article of faith that the Trump election wasn't legit because Russia "meddled" in it. Vox is the sort of publication that's always claiming democracy is about to be wiped out by people they disagree with. Several years ago it was railing against Citizens United because it would put democracy at threat from "dark money", whatever that meant:

[https://www.vox.com/cards/super-pacs-and-dark-money/what- is-...](https://www.vox.com/cards/super-pacs-and-dark-money/what-is-the- citizens-united-decision-citizens-united-v-fec)

[https://www.vox.com/xpress/2014/11/3/7150105/dark- money-2014](https://www.vox.com/xpress/2014/11/3/7150105/dark-money-2014)

But ever since Clinton massively outspent Trump (an actually super rich dude) and yet still got her ass kicked, it's no longer campaign financing that threatens democracy. Now it's something else.</comment>


Photographer shoots stunning San Francisco images with an aerial drone - <AUTHOR> http://melashar.com/blog/2013/12/my-top-10-aerial-photographs-of-2013

<comment><USER2> Anyone reccomend some equipment to do this?</comment>


Google 'obsessed' with chasing Facebook - <AUTHOR> http://www.nzherald.co.nz/connect/news/article.cfm?c_id=1501833&objectid=10792228

<comment><USER2> What is the real reason for this, other than display ads and (maybe) attention? Are the founders pissed that Zuckerberg might end up richer than them? Is it for "copying"?

<comment><USER3> I guess it's because everyone used to think that the social aspect will have such a huge impact on search that it will disrupt and replace Google's search model.

But I think they were wrong. The social aspect is a minor aspect at best regarding search, and it should be just one of Google's hundreds of other search signals, not 50% of the search algorithm.</comment></comment>


Show HN: Giving lonely domain names a new life - name2.me - <AUTHOR> http://www.name2.me

<comment><USER2> I have around 100 domains and only "use" about 10 of them. I'd be interested in being able to upload a "portfolio" listing all my domains that others could browse. If another user wants one of my domains, a message would be sent to me. I could then browse their "portfolio" and see if I wanted one of their domains. If so, a 1-to-1 trade would be proposed which both parties would then have to agree to. At that point, we would each transfer the domains to the other party (without some type of escrow, you'd be on the honor system and have to trust the other party, but some type of "reputation" or "karma" could maybe be implemented for that?).

<comment><AUTHOR> Just the sort of ideas i need.. Thanks

</comment></comment><comment><USER3> Hey did this come out of the domain exchange idea I had a week or so ago in one of the threads on HN? If so, great execution. I like the idea of a "kudos" being used as a virtual currency.

Just looking at the instructions now is there any way to make them shorter (maybe 3 or 4 steps instead of 6?) Also step 6 is very vague. What are "golden domains"? I mean I may have some idea but it's really not clear to an average user. What makes a domain a "golden one"? Are my domains "golden"? Anyway you get the picture.

<comment><AUTHOR> Funny you should say that.. I was about to launch with a similar product but a little more complicated. I was waiting for someone at the airport and I saw your post/comment and it made it clear to me that I'd over complicated the idea. So I pretty much went back to scratch and came up with name2.me... Thanks for unintentional "push" in the right direction. When we see top domain names come through we are going to mark them as "Golden" and give the opportunity to the highest kudos users to get in first. Thanks again.

<comment><USER3> Excellent. And no problem, I'm happy I was able to provide a little bit of inspiration. Rock on.

</comment></comment></comment><comment><USER4> Are you detecting a doorway makers in some way? Your project looks like a Klondike for them.

<comment><USER5> Are you talking about adding a unattractive domain, then using the free kudos point to grab up a better one? That's kind of what is keeping me from putting mine up (magnatecha.com and linuxterm.com). They're not that great, but I would rather keep them than get 3 kudos to get things like antpx.com... I guess one just has to make a choice as to how much they like their current unused domains.

<comment><USER4> You get 1 point just after registering, and 2 more with tweet and like buttons. So you can get a free domain without giving away yours. 2) Register a new account. 3) Repeat.

<comment><AUTHOR> We are aware of that possibility and we have "whois" jobs running to tell us that domains have exchanged hands - we are working on other ideas. Also we won't be so generous with the points once the site is off and running. But I still think that if you are not using a domain (and not going to renew) then you might as well let anyone have it - I don't foresee many really great domains coming through here (I might be wrong)... But it does give the kid who doesn't have $10 (or a credit card) the chance to grab a domain for free.

</comment></comment></comment></comment><comment><USER6> Nice idea.

I tried to add a domain and it said it was invalid, looks like a faulty regex or something... <http://quickscreen.me/aPEd.png>

<comment><AUTHOR> Thanks for the heads up.. we'll fix that up straight away.

</comment></comment><comment><USER7> good idea, will be nice to see if this becomes popular. i think quite a lot of people (myself included) have loads of unused domain names for project ideas that were never finished (or started) that will just be left to expire</comment>


Ask HN: What is the role of economic advisors to a national leader? - <AUTHOR> Edit: obviously, I don't know how to get this to show up under 'Ask', or whether that is the most appropriate place for it.
I'd post this as a poll if I could, as that is essentially what I am getting at. I'm hoping for enough responses for a statistically valid sample of the responding population. A previous version of this on another site got one poll response.
I wouldn't be surprised if there are zero responses to the question no matter what I ask, but I'll try to ask a fair question that most accurately reflects the situation, without going into too much detail:
Suppose there was a way for a country to create a lot of jobs without additional government spending. Due to less need for welfare spending or things like the Works Progress Administration that created jobs in the US during the Great Depression, government spending could actually decrease.
However, if one country used the system, other countries would know of it as well, and if they used it, profits of companies selling luxury goods in the first country would decrease. The 'cultural influence' of the first country could also decrease — if the first country was the US, perhaps fewer people would be interested in learning English.
The question is, what role do economic advisors have in this situation? In the US, this is the Council of Economic Advisors: https://www.whitehouse.gov/cea/
I will not quote it due to length. Other countries may have similar things. What best describes what advisors should do?
1) They SHOULD NOT do anything as a result of knowing about a system that does this.
2) They MAY or CAN share this system with the leader of their country.
3) They SHOULD share this system with the leader of their country.
4) They MUST share this system with the leader of their country.
I'd also ask, if economic advisors should not share this system, is there anyone who should? But I doubt I will get many responses even to the first question. <comment><USER2> Without knowing more I'd say the situation is contrived and artificial, and there's almost never a situation in which a nation improving its economic conditions makes its medium run economic output worse _because it had never occurred to anyone else to do this and the other countries all copy it better_.

There are real world tradeoffs like boosting the value of a country's currency making its exports a little more expensive to foreign purchasers of its manufacturing output, but your question is more akin to 'if I knew of a perpetual motion machine, should I hide it from the boss of my motor company'. The perpetual motion machine doesn't exist, and if it did, the benefits outweigh any potential losses to your company's existing revenue streams.

<comment><AUTHOR> >in which a nation improving its economic conditions makes its medium run economic output worse

It doesn't say that economic output would decrease, only that luxury goods sales would decrease. I will take this misunderstanding into future consideration. It is also a misunderstanding to assume that "the other countries all copy it better": the implication is that when the first country uses the system, it buys fewer luxury goods from other countries as well. However, people would be more divided on the benefit of a country BUYING fewer luxury goods. If people want expensive German cars and they can afford them, let them, right? But everyone in Germany presumably wants Germany to SELL more luxury cars.

Also, in regards to whether an unused system could be beneficial, it's worth pointing out that the overtime system was basically invented in the 1930's, during the Great Depression. Companies suggested it as an alternative to further mandated decreases in working hours.

<comment><USER2> If the tradeoff is _if we enact this policy we will have more jobs, a better budget balance and more money collectively and the only downside is our people will buy different types of goods and in particular fewer luxury goods from overseas_ , I can't imagine why any self-respecting economist wouldn't recommend the policy on purely economic grounds. Assessing which parts of the economy will be worse off and whether there will be a net benefit is literally what the advisers are paid for, and every policy or non-enactment of policy has an opportunity cost.

If the problem is that there exists a cost-free solution to economic growth but other countries adopting it might kill your economic base of exporting luxuries to them if they do it, it's probably safe to assume that either they will do it anyway or that they aren't doing it because they face other political barriers or adverse consequences.

If your solution is protectionism or luxury tax or devaluation or similar it's neither cost free nor something other countries haven't considered and don't have plenty of specific reasons why it's not a good idea for them even if it'll work for your economy.

And time and a half pay legislation not being copied by [e.g] the UK which also had a Great Depression cutting its industrial output, pays great attention to the US economy and generally has more generous labour laws kind of underlines the pointlessness of keeping good ideas secret in the assumption you'll be harmed by everyone else following your lead.

<comment><AUTHOR> >I can't imagine why any self-respecting economist wouldn't recommend the policy on purely economic grounds.

I would like to agree with that, but there's this: [https://www.aljazeera.com/indepth/opinion/2012/10/2012102915...](https://www.aljazeera.com/indepth/opinion/2012/10/2012102915021526447.html)

"Most economists are not paid for knowing about the economy. They are paid for telling stories that justify giving more money to rich people."

Or another, more famous quote: "It is difficult to get a man to understand something, when his salary depends upon his not understanding it!"

Is that the case for economists? I can't say for sure. If people don't care whether economists actually try to fix problems, though, then it's more likely that they will not. That's what this question (not precisely a poll, but meant to be) was for.

>If your solution is protectionism or luxury tax or devaluation or similar

It's a way of getting people to work less. Relevant details about why it works 'mechanically' (as opposed to psychologically) include that rich people spend a lower percentage of their income than poor people; rich people tend to buy higher-profit or expensive items, meaning their spending goes to other rich people; limited possibilities for targeted pricing when income inequality is high mean that e.g. there are many homeless people at the same time as many homes are unoccupied; and possibly other things I'm forgetting.

I may not reply again.

</comment></comment></comment></comment><comment><AUTHOR> I created a poll, in case people are willing to use 3rd-party poll sites: [https://www.strawpoll.me/19409077](https://www.strawpoll.me/19409077)

</comment><comment><USER3> For me it's 3), although I'm no public policy expert. Why wouldn't they discuss a potentially great idea with the chief decision maker?

<comment><AUTHOR> Laziness or arrogance.

Like when the engineer and statistician W. Edwards Deming suggested improvements in manufacturing, but US manufacturers ignored him.

>Why were Deming's views on quality control initially ignored in the United States?

>Following World War II, Deming was largely ignored in the productivity-crazed United States. ... The message Deming made to the United States was that productivity without quality was a dead end. He attempted to teach engineers his philosophy, but the companies they worked for were focused on other things.</comment></comment>


Problem at my workplace - need suggestions. - <AUTHOR>

I am facing an issue at my workplace. I am not able to get along with few of my coworkers. It annoys me and I don't know how to cope up with it.
Bugs in code are inevitable and the challenge I think is to resolve those issues as a team (I don't mean by sitting together all the time but just to approach it like a team player). Fun is to treat the code as if it belongs to everyone equally.
Quite lately, I got into a new project with a new set of coworkers and I find the approach of those coworkers a bit strange, at times annoying. Problem is, if there is any bug related to the piece of code that I wrote, few of my coworkers treat it as if its totally my responsibility to resolve it ( even if it means to change a line in properties file ). For instance, today it so happened that my coworker found a bug and she saw the error message in logs coming from the class that I wrote. Immediately without taking any efforts to debug the code, she turned back to me saying I need to get it resolved and get her moving. It gave me a feeling as if I am being a roadblocker to her. I didn't feel like we were looking at the code as a team. She raised hands as if 'that bug belongs to me and I should get back to her when its resolved'. As it turns out in the end, it was a small fix. It was not really a problem with the code but a change in the properties file she had to make according to a path on her machine. I almost feel as if I am spoon feeding my coworker.
Not sure if it made any sense to you but if you were in such a situation before then let me know what you did to cope up. I tried telling my coworkers in a calm manner but they don't seem to get it. This behavior has been repeating for couple of months now and I am finding it difficult to get along with others. <comment><USER2> My feeling is that they don't enjoy programming or like the team. It is unlikely you'll be able to change this.</comment>


Ask HN: Please recommend a 13-15" programmers laptop to replace 15" MacBook Pro - <AUTHOR>

Regular office use (email, word processing, messenger)
Lots of terminals (SSH)
Lots of browser windows / tabs (gmail, outlook web, YC, Stackoverflow, etc)
1 Ubuntu VM running 25% of the time (1 core, 2 GB)
Needs to be <5 lbs
good screen & resolution (1920 X 1080 is enough for me, higher is ok)
good keyboard & trackpad
8 GB minimum RAM
decent battery life
OS doesnt matter
discrete graphics plus
need to survive 5 years of sustained use
SSD not mandatory, prefer higher disk capacity
2K or less <comment><USER2> Acer 720p Chromebook. Install Codestarter's Ubuntu package ([https://github.com/codestarterorg/ubuntu-chromebook- installe...](https://github.com/codestarterorg/ubuntu-chromebook-installer)) and add more SSD Space ([http://www.androidcentral.com/how-upgrade-ssd-your- acer-c720...](http://www.androidcentral.com/how-upgrade-ssd-your- acer-c720-chromebook))

Best laptop I've ever owned.

</comment><comment><USER3> 13" MacBook Pro Retina. I just moved to one and it is perfect.

<comment><AUTHOR> those are only i5 and the usable resolution is really low on the 13. i can bump it up really high but that will be pretty useless. i have one on hand that i used for a couple of days and didnt find it comfortable

<comment><USER4> The i5 shouldn't be an issue. You can always custom order. Even the entry model can be bought with an i7. You can have a custom Macbook shipped to a nearby Apple store for pickup, so ordering custom is no big deal.

Of course if the resolution isn't acceptable to you, that's an entirely different issue.

<comment><AUTHOR> thanks, didnt realize i7 was an option. you just complicated my life! :)

</comment></comment></comment></comment><comment><USER5> Ubuntu works just fine on the 2015 Thinkpad Carbon X1. We use them as our company laptops, and we're on Ubuntu.

<comment><AUTHOR> i am strongly leaning towards that system. question is will it last 5 yrs minimum? esp., the ssd. also, it tops at 8GB, which is not a deal breaker

<comment><USER6> A friend has the original x1 carbon. 2-3 years had the charging port break, a key fall off and now the fan seems to be broken. You could look into T-series for something more sturdy. Also T550 has a geforce 940M option.

</comment></comment></comment><comment><USER7> I have a orange Lenovo Yoga 2 Pro (i7 proc, 8Gb RAM, 512G SSD). I use it with Ubunu 14 LTS

<comment><AUTHOR> ornage - wow!

looks like they are dumping stock to make room for a refresh

</comment></comment><comment><USER8> Sounds like that would get you into a new entry level 15" retina MacBook pro or a high end 13" retina MacBook pro, both fantastic machines. I'd probably do the 13" one since they just got updated, 15s probably won't be until June.

<comment><AUTHOR> trying to avoid the macs. dont really NEED OS X. wondering if there are viable alternatives

<comment><USER9> I think you'll find Windows based alternatives to be comparatively priced to be honest. And you really can't do better than the Macbooks trackpad.

But I'll second the XPS13 dev edition, or at least waiting to see how it'll do.

<comment><USER8> Seconding the trackpad part of this. If you're going to be using the computer anywhere other than a desk, Apple has by far the most usable trackpads. Not sure why no other manufacturer has figured this out yet since it's been the state of the industry for years now

<comment><AUTHOR> +1 on trackpads

</comment></comment></comment></comment></comment><comment><USER10> two weeks ago I received the new Lenovo x1 carbon 3rd gen, I expected a high end machine. But I got: low brightness screen, bad colour range + build flaws: the screen cover was not glued well. These flaws also appeared with other customers (search the forums).

After three days I sent it back, and today got the new macbook 13", although I don't like the brand Apple, you can't deny its quality over all the other brands.

</comment><comment><USER11> I have the Lenovo X240 and it has been awesome. Super light weight and amazing battery life, I can use it almost 2 days at school without having to charge it.

<comment><AUTHOR> I had an X201 in ~2010 and I loved it. It was very portable. But the screen may be too small for me now

</comment></comment><comment><USER12> Sony Z or high end Lenovo's.

These will be joyful but at the higher end of price tag. Sony Z will be made in Japan (not China like the rest of the flock)

</comment><comment><USER13> Why not wait for the XPS 13 Dev Edition?

<comment><USER14> I definitely agree at least with the xps13 part however Id recommend against the Dev edition, or at least depending on where you are buying it. When I bought mine (the old one) the "regular" same hardware version cost the same as the Dev edition, but you got a windows licenses as well. And even if you don't use windows regularly it's always nice to have an extra license.

Hardware wise I am extremely pleased with the old version and can't really see any indication that the new one should be worse in any way.

<comment><AUTHOR> license is not an issue for me. we have bulk license at work. so i would prefer not to pay for the license. but in reality, doesnt really matter. but i do get your point

</comment></comment></comment><comment><USER15> I know Lenovo lost some respect recently, but I love my T420s. I anticipate using it another 3-5 years.

<comment><AUTHOR> I have a t420 from 2007 still kicking strong. but its slow, unusably slow even with a fresh win7 install. maybe disk is too full.

not worried about the certs, will be installing a fresh non-lenovo copy right away

I like the new t450s and w550s</comment></comment>


This is what a Tor Supporter looks like: Laura Poitras - <AUTHOR> https://blog.torproject.org/blog/what-tor-supporter-looks-laura-poitras <comment><USER2> It seems that over the last 5 years the number of exit nodes has remained relatively constant [1], I assume to the risks associated with running an exit node. What is Tor doing the increase number of exit nodes?

[1][https://metrics.torproject.org/relayflags.html](https://metrics.torproject.org/relayflags.html)

<comment><USER3> The Library Freedom Project is working on deploying exit nodes in libraries: [https://libraryfreedomproject.org/](https://libraryfreedomproject.org/)

</comment></comment><comment><USER4> I can't imagine Tor being viewed differently by the NSA than any other honeypot tool out there. (How would they still not have completely overtaken it today?)

</comment><comment><USER5> It seems like a good way to support Tor would be to open exit nodes.

And a good way to promote that would be to sell pre-configured, "just plug in power and ethernet" Raspberry Pi.

<comment><USER6> IMO, the major challenge of hosting an open exit node is the legal burden of receiving complaints about Tor traffic. I am not sure a PnP Tor RPi would help on that point.

<comment><USER7> Agreed, Ive run a few nodes on and off for years, and to date I still have one in the neatherlands running however I have never run an exit node, because I'm just too nervous of the legality around it.

</comment></comment></comment><comment><USER8> Tor is an amazingly good start :) to things. Tails seems to be decent as well.

Hopefully there aren't other major vulnerabilities that turn up in it... but that's like wishing for a pink unicorn that er... expresses rainbows rearwards. :D

</comment><comment><USER9> Good for them that they managed to find a non-neckbeard person which doesn't ramble about the UNIX philosophy at sight to promote the TOR network.</comment>


Show HN: Add crazy calculations to your apps with SaturnAPI - <AUTHOR>

https://saturnapi.com/
Ever needed to solve some equations or make 3D plots for your app? We're here to get your functionality to the next level, so holla at us if you need any sort of calculation beyond simple arithmetic. We'll help build a custom API for your needs. All feedback is appreciated. Thanks!
email@example.com <comment><AUTHOR> [https://vpartition.meteor.com/](https://vpartition.meteor.com/)

Above is an app to perform Voronoi partitioning on latitude and longitude data. It was built using SaturnAPI and Meteor. Very easy to do.</comment>


Ask HN: Why do all cryptocurrencies have similar mining-based strategies?  - <AUTHOR>

Aren't there other strategies that would introduce new currency? Let's say some philanthropy gives you new currency. Or some contribution to wiki leaks does. Or in the crypto world discovering new solutions to useful difficult problems would reward you. <comment><USER2> The problem with the solutions you suggested is that there is no easy automatic trustless mechanism for demonstrating proof-of-work. Edit: Of course, if you don't mind some centralization/trust, then your suggestions could theoretically work.

One altcoin called primecoin has a proof-of-work algorithm which finds long runs of prime numbers, which is supposedly useful for some purposes.

The most common alternative to proof-of-work mining is called proof-of-stake, which is used in a few altcoins (most notably Peercoin). It still doesn't provide anything useful, but at least it provides a mechanism for securing the blockchain without wasting a bunch of energy. You can read about it here: [https://en.bitcoin.it/wiki/Proof_of_Stake](https://en.bitcoin.it/wiki/Proof_of_Stake)</comment>


Aluminum and strength - <AUTHOR> http://leancrew.com/all-this/2015/08/aluminum-and-strength/ <comment><USER2> It's interesting that the new alloy was not recognized by XRF. In the video it looked like they had a large set of standards from which to build an empirical model. I don't know how likely it is that Apple created their own alloy, but I have experience with XRF analysis and I know it's easy to make mistakes preparing a sample. It's possible the tungsten came from the sandpaper used to remove the anodization layer or it might have been part of the anodization layer. Another tricky detail when analyzing materials is how the different elements adhere to the surface. The X-rays only see the atoms at the surface. If sanding the alloy removes more of a softer metal or smears it over the surface covering the other elements you may get inaccurate results.

<comment><USER3> Do you know if there's been experimentation with tungsten alloying of aluminum in the past? The thing that surprises me here is that if Apple did create an entirely new alloy with novel properties, why weren't those metallurgical characteristics already known? It's not like metallurgy is a new field.

<comment><USER4> It seems there's been a bit of research into Aluminum Tungsten systems[1]. The alloy systems described in the abstract are strengthened by particle formation (also called precipitation hardening), which is the primary strengthening mechanism used in most Al alloys[2].

In general, alloy design is an extremely high dimensional problem. You have composition, the forming processes, and heat treatments which all can profoundly affect the properties of the finished product. It's only since the fifties or so that we've really started to understand the internal structures of metals and how they affect properties like strength, and there are many open questions yet.

[1] [http://link.springer.com/article/10.1007%2Fs11661-008-9593-3](http://link.springer.com/article/10.1007%2Fs11661-008-9593-3) [2] [https://en.m.wikipedia.org/wiki/Precipitation_hardening](https://en.m.wikipedia.org/wiki/Precipitation_hardening)

</comment></comment></comment><comment><USER5> I couldn't find it in the quick digging I did; can anyone tell me where he got the 6S case, which he describes as a case that is "likely" from the new 6S? I assume it's either a technical reproduction based on rumour or an intentional gift from Apple to build hype?

<comment><USER6> During the initial production of a new iPhone, which seems to start a month or two in advance of the release, parts are regularly smuggled out of the factories - especially case backs. They're sold to case manufacturers mainly who want the specs so they can design iPhone cases that are out on launch day.

<comment><USER5> Interesting! Wouldn't that make him in possession of stolen material?

</comment></comment></comment><comment><USER7> Could it be an alloy designed by Liquidmetal?

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

<comment><USER2> Looks like the Liquidmetal alloys are zirconium-based, the XRF showed that it was an aluminium-based alloy. So, no.

</comment></comment><comment><USER3> This is pretty interesting because it raises the question about additional applications of this and similar alloys in the future. I wonder what, if any, material property drawbacks there are for the new alloy.

<comment><USER8> Usually in industrial design when you select a material you do so based off a constraint selection process: [https://en.wikipedia.org/wiki/Material_selection](https://en.wikipedia.org/wiki/Material_selection)

Typically you have material specific constraints (workability, cost, ease of sourcing) and application constraints (for a phone case this would be weight, stiffness, min/max dimensions things like that).

Once you have determined the constraints you can solve for the objective function using numerical methods i.e. Solve all the simultaneous equations.

That will identify the materials which are most suited to the chosen application. And will eliminate materials with drawbacks that cause them to fail to meet the constraints (so you don't end up with a iphone case made from diamond which costs a fortune or from ceramics which weigh a tonne).

</comment></comment><comment><AUTHOR> _...we can tell how cool Lew is from his backwards baseball cap._

Note to self: stop wearing caps that way _before_ beard starts turning white.

<comment><USER9> Backwards hats go back to at least the mid-80s. By that regard, they should now be a sign of middle-aged wisdom, not of youth.

<comment><USER10> this guy gets it, well said, sir. "darn kids and their forward hats"

</comment></comment></comment><comment><USER11> I have to laugh at Apple's efforts to toughen up their phones. I own a Caterpillar brand phone, which will survive being run over by a truck.[1][2] Drops on cement result in zero damage. When an Apple product can pass IP67 certification, then they can talk about ruggedness.

[1] [https://www.youtube.com/watch?v=mVPku- xItv8](https://www.youtube.com/watch?v=mVPku-xItv8) [2] [https://www.youtube.com/watch?v=sggbV7j_rLA](https://www.youtube.com/watch?v=sggbV7j_rLA)</comment>


New Features in ES2019 - <AUTHOR> https://javascript.christmas/2019/7 <comment><USER2> Really liking these new developments! JavaScript is not the horrible language it used to be anymore (in my very subjective opinion). When I started writing JavaScript in 2016 after a Python background I was frustrated every day... Then after some time and learning about which dark corners to avoid, which tools to use, etc. it became quite an enjoyable experience. Nowadays I mostly use a mix of JavaScript and TypeScript depending on the projects and it's been great.

One thing that I am a bit afraid about though is that the language might become more complex and complicated over time because of backward compatibility (C++-like?). I saw that they will be introducing a new function "replaceAll(...)" to avoid the weird semantics of "replace(...)" (stopping after first occurrence unless a 'global' RegExp is passed as argument). And that's great, but that's a new function, and maybe 'replace(...)' should have had this behavior from the start. I hope to be wrong on this one!

<comment><USER3> The difference between JS and C++ is that C++ is addressing a complex problem domain whereas JS is addressing a simple one. So JS can put its complexity budget towards features that improve productivity whereas such features in C++ require huge amounts of complexity. Take for instance anonymous functions in JS compared with lambdas since C++11, the C++ version needs a complicated capture syntax, capability for capture by value and reference, type inference, templating, and more. All that complexity is useful and needs to be there (I have used most of it in my own code) - in JS anonymous functions are immensely simpler. That's why JS will never become even 1/2 as complex as C++.

<comment><USER4> > C++ version needs a complicated capture syntax

C++ doesn't actually need it. Rust proved that capture everything by reference or capture everything by move is enough for all practical use cases.

C++ lambdas is another example where C++ committee chose complex uber- universal solution instead of much simpler which solves 99% use cases.

<comment><USER5> > C++ doesn't actually need it. Rust proved that capture everything by > reference or capture everything by move is enough for all practical use > cases.

That's kinda true but kinda not: precise "capture clauses" is a common design pattern in rust[0] showing that the flexibility is extremely useful, and I think I've seen rumblings about adding them to the language.

I mean technically you only ever need `move` closure, "ref" closures are already a convenience.

[0] [http://smallcultfollowing.com/babysteps/blog/2018/04/24/rust...](http://smallcultfollowing.com/babysteps/blog/2018/04/24/rust- pattern-precise-closure-capture-clauses/)

</comment></comment></comment></comment><comment><USER6> Not ES directly, but you know what I need on an almost daily basis? A JSON date type. It's obnoxious to have to pass a string back and forth and parse it on either end between server and browser.

<comment><USER7> There's plenty of good reasons one doesn't exist. JSON is not JS-specific. It is a standard interchange format used by thousands of languages, many of which have very different date implementations.

If you did have a JSON date, how would you decide what it was? Would it be a timestamp, or a civil date-time? Would it have timezones? Offsets? Locations? Would there be a database along with it required to understand it correctly?

Just stick with ISO8601 strings.

<comment><USER8> A 'date' type could be as simple as syntax indicating that a particular ISO8601 string IS a date. Right now, there's no reasonable way to infer that unless you're already aware of the schema of the JSON object you're receiving.

You could make the same argument with numbers - there's no reason you couldn't just pass strings containing the number - but there's advantages to being able to distinguish between a string and a number when the schema is unknown.

<comment><USER7> If you're not aware of the schema, how would you use the value? Same as any other use of strings - enums, types, etc

</comment></comment></comment></comment><comment><USER9> [This comment is wrong; see masklinn's response for my misunderstanding.]

> _Now the function would rather insert an escape character before the > character code so that the result is still readable and valid UTF-8 /UTF-16 > code:_

> _JSON.stringify( '\uD83D');_

> _/ / '"\\\ud83d"'_

I'm inclined to consider this a misfeature, unbreaking something that I'm _glad_ was broken and should have _remained_ broken.

Unpaired surrogates are (to simplify terminology a little) basically invalid Unicode. On the web platform, the _only_ situation where unpaired surrogates should be encountered is as a transient state on user input, on platforms that send non-BMP characters through in two pieces (which is most browsers on Windows). Beyond that, nothing should _ever_ deal in unpaired surrogates, because they _will_ make things blow up and your life miserable.

Unpaired surrogates cannot be represented in UTF-8, or in well-formed UTF-16 (and that's where JavaScript did the annoyingly bad thing that we're paying for decades later, going with UTF-16 and not requiring well-formedness). Hence I'd quibble with the description of the result as "valid UTF-8/UTF-16 code". (Sure, the actual JSON byte stream will be valid, but it contains an escaped string that is not valid.) U+FFFD REPLACEMENT CHARACTER was at least as valid, arguably more valid.

Various JSON parsers will choke on such strings, as observed in what I'd consider the canonical JSON spec: [https://tools.ietf.org/html/rfc7159#section-8.2](https://tools.ietf.org/html/rfc7159#section-8.2).

In the I-JSON restricted subset, which is what I'd say everything should _actually_ limit itself to, such strings are disallowed and will cause parse failure: [https://tools.ietf.org/html/rfc7493#section-2.1](https://tools.ietf.org/html/rfc7493#section-2.1).

<comment><USER5> You're misreading the article section, although the article is also partially wrong: the old behaviour was to output the lone surrogate in the JSON stream[0] (the "�" here is confusing: it is a display artefact of the specific font, not U+FFFD), the new behaviour is to replace the unpaired surrogate by _the literal 6-character long escaped representation of the unpaired surrogate_.

That is, formerly U+D83D would pass through straight as U+D83D (or possibly be replaced by U+FFFD in some implementations), whereas it is now "encoded" as the sequence U+005C U+0075 U+0044 U+0038 U+0033 U+0044.

That is, _the entire point_ of the "well-formed stringify" proposal[1] was to _stop generating broken JSON_ :

> Rather than return unpaired surrogate code points as single UTF-16 code > units, represent them with JSON escape sequences.

[0] it's possible that some implementations would replace the lone surrogate by U+FFFD but according to MDN:

> Before this change JSON.stringify would output lone surrogates if the input > contained any lone surrogates; such strings could not be encoded in valid > UTF-8 or UTF-16

this is also the behaviour I observe on an old safari, and the one which is quoted in the tc39 proposal[1]:

> JSON.stringify can return strings including code points that have no > representation in UTF-8 (specifically, surrogate code points U+D800 through > U+DFFF). And contrary to the description of JSON.stringify, such strings are > not "in UTF-16" because "isolated UTF-16 code units in the range > D800₁₆..DFFF₁₆ are ill-formed" per The Unicode Standard, Version 10.0.0, > Section 3.4 at definition D91 and excluded from being "in UTF-16" per > definition D89.

[1] [https://github.com/tc39/proposal-well-formed- stringify](https://github.com/tc39/proposal-well-formed-stringify)

<comment><USER9> Ah, you're right; thanks for the correction.

The article _does_ contain an error here, for the code point on the page _is_ actually U+FFFD, not U+D83D (which of course is unrepresentable there). I trusted that (being a little surprised that it'd do the replacement, which is more what I'd expect of Python, but accepting it all the same) and didn't pull out an old browser to confirm what _actually_ happens, which is, as you say, an unpaired surrogate code point.

The article should probably say '"\ud83d"' instead of '"�"' (even though the number of backslashes still then requires thought), because yielding U+FFFD there would be a completely valid (and preferable, in my opinion) solution.

<comment><USER5> > The article does contain an error here, for the code point on the page is > actually U+FFFD, not U+D83D (which of course is unrepresentable there).

The MDN page also does that, that's a bit misleading but TFA commits way worse a sin: it actually states the unpaired codepoint is swapped for the replacement character:

> In earlier versions, these would be replaced with a special character:

which is just wrong.

> yielding U+FFFD there would be a completely valid (and preferable, in my > opinion) solution.

I agree. The proposal does not explain whether U+FFFD was considered, I expect they picked the escaped version to limit or avoid data loss: if you get an U+FFFD you have no idea what it used to be.

</comment></comment></comment></comment><comment><USER10> > Optional catch binding

Eh... that's great and all, but why not go the whole way and allow me to just use `try { }` without a catch-block? I'm sure that was part of a conversation somewhere, and I wonder why they chose not to go that far.

<comment><USER11> I expect it's because of `finally`. You can write a try without a catch today, provided there's a finally, however the error will continue to propagate in that case.

        try {throw new Error('')} // exception is caught

        try {throw new Error('')} // uncaught exception
        finally {console.log('finally')}

That would be a bit of a footgun, as adding a finally clause that does something innocuous like logging would result in an uncaught exception!

<comment><USER10> That makes sense. I guess `try` means something a bit different in JavaScript than `rescue` does in Ruby.

It seems like this code in Ruby:

```

begin

      do_something

rescue => e

      handle_error e

ensure

      log_something

end

```

is equivalent to this in JavaScript:

```

try {

      doSomething();

} catch(e) {

      handleError(e);

} finally {

      logSomething();

}

```

I'm not saying that they're 100% equivalent, but I was thinking of the `try` block as if it's `rescue` when really it has more in common with `begin` in Ruby in that it's defining a block of code that can be rescued/caught if an error occurs.

So I guess my confusion comes from this type of block being named `try` rather than something like `do` or `begin`.

TL;DR I was just thinking about this in the wrong way from what I can tell.

EDIT: Yet I think that my point might still stand in that, if `try` is just a block that has its own scope, like an if-block or `begin` in Ruby, then it should be possible to not require either `catch` or `finally` since its own behavior has little to do with error handling.

For instance, this is possible:

```

let x = 'foo';

try {

      let x = 'bar';

} catch(err) {

      // noop

}

console.log(x); // foo

```

The try-block would be way more useful if it could just define scope without being tied specifically to error handling. There are lots of circumstances where defining scope would be handy outside of conditionals and creating functions for a similar purpose.

I guess what might have made the most sense, if JS could have started over, is that there'd be no `try` statement and that `do` could be used in its place.

```

const words = ['foo', 'bar', 'baz'];

let i = 0;

do {

      console.log(words[i]);

      i++;

} catch(err) {

      console.error('whoops!');

} while (i < words.length);

```

We can't go back now since JS, for good reasons, is remaining mostly backwards-compatible. But the ability to do the above without extra gymnastics would be pretty cool.

<comment><USER11> > The try-block would be way more useful if it could just define scope without > being tied specifically to error handling. There are lots of circumstances > where defining scope would be handy outside of conditionals and creating > functions for a similar purpose.

This is the case today! With `let` and `const`, any {} block creates a scope. So:

        let foo = 'outside';
        {
          let foo = 'inside';
          console.log(foo); // logs 'inside'
        }
        console.log(foo); // logs 'outside'

</comment></comment></comment></comment><comment><USER12> I don't mean to hate on ECMAScript, but is anyone else slightly surprised these features weren't in earlier?

Like I wonder how many bugs were introduced because the developer didn't realize Array.sort() was unstable.

<comment><USER13> Another sort() quirk that catches people out is not realising it uses string comparison by default

        [1,2,10].sort()

= [1,10,2]

<comment><USER14> It's the curse of the optional arguments. Same thing with parsing numbers where the second argument magically specifies the base.

If the comparison function argument was mandatory in sort() this wouldn't be a problem.

<comment><USER5> > It's the curse of the optional arguments. Same thing with parsing numbers > where the second argument magically specifies the base.

Stupid defaults is not "the curse of optional arguments", it's the curse of stupid defaults.

Most languages have defaults for these two operations yet have proper defaults rather than stupid ones. Python's list.sort() and int() certainly do, so do Java's Collections.sort() and Integer.parseInt().

Uniquely awful defaults is a historical (and defining) feature of javascript, not of having default values, or optional arguments.

<comment><USER14> The horror that arises in js is due to a combination of unfortunate things like function arity, and coercion. The one I was thinking of is the famous

[1,2,10].map(parseInt)

It's several things that on their own aren't mad which taken together produces a crazy result. 10 as the default for an optional second argument of parseInt is fine. But map should only use a single argument closure by default. So map(parseInt) must be equivalent to map(x -> parseInt(x)).

</comment></comment></comment></comment></comment><comment><USER15> fromEntries(), aside from the symmetry with entries() is a really neat feature.

For example `Object.fromEntries(new URLSearchParams(window.location.search))` will parse a query string into a nice JS object. This works because the iterator of the search params class returns tuples.

What is already available today is `new URLSearchParams(Object.entries(params))` for turning a "params" object into a query string.

</comment><comment><USER16> I wonder what kind of shenanigans you could do with Function.toString(). It'd be even better if they had Function.toAST().

<comment><USER17> If I remember correctly, AngularJS 1.x would use it for dependency injection.

<comment><USER18> How so? Were these eval()ed by Angular?

I don't follow what it would use function strings for determining missing - presumably - polyfills that you couldn't do in better ways.

<comment><USER19> In angular 1, if you had a function on the form

      myApp.controller('MyCtrl', function($myCoolService) {
        //...
      });

Angular would see that you are looking for a parameter named myCoolService, see if it already has it, and then inject it when calling your controller.

This of course broke in various ways with minification when the parameter names were mangled. So one had the opportunity to use "array syntax", requesting a dependency by a string. Or use a preprocessor in the build script adding the array syntax before minifying.

<comment><USER20> Did it by any chance pull parameter names out by using a magic-number index into the function text? If so, that'd be broken by the 'function /* a comment */ foo () {}' change in the article (and might be what I remember having seen a long time ago). Glad I don't have to deal with that sort of thing. Does Angular 2 do it the same way?

</comment></comment></comment></comment></comment><comment><USER21> No pipe operator, no TCO, no pattern matching- _sigh_.

I wonder if Java will get pattern matching before JS [https://medium.com/better-programming/top-5-new-features- exp...](https://medium.com/better-programming/top-5-new-features-expected-in- java-14-82c0d85b295e)

</comment><comment><USER22> One thing I would fix about JavaScript is that currently "return" followed by a newline returns undefined. I would say that only return followed by ';' should return undefined. Else it should return the value of the expression following "return", whether on the same line or not, until the next ";".

Not sure how how much backwards compatibility this would break, but at some point we must allow for newer better less error-prone versions of the language to co-exist in different modules. That is not difficult at all. Consider the case of "use strict"; which does just such a thing. We could have "use strict 2020" etc.

</comment><comment><USER23> Demanding a stable Array.sort is surprising. I find it questionable, as it implies a performance trade-off. Why not add a new stableSort function?

Trying to retroactively fixing bugs in code that did not follow the standard is not a good idea IMHO.

<comment><USER5> The "stable Array.sort" proposal was actually made because all major browsers had switched to a stable sort implementation: [https://github.com/tc39/ecma262/pull/1340](https://github.com/tc39/ecma262/pull/1340)

It was actually proposed by the v8 / chrome people ([https://v8.dev/features/stable-sort](https://v8.dev/features/stable-sort)) after they'd finally come around to implement one of the oldest v8 feature requests: [https://bugs.chromium.org/p/v8/issues/detail?id=90](https://bugs.chromium.org/p/v8/issues/detail?id=90)

And stable does make for a better default than unstable: it offers stronger guarantees and more reliable behaviour. That's doubly important because by and large developers work to the implementation not the spec. And it's unlikely you'll ever change that.

The last one to switch was Chakra (Edge), and that one was _weird_ as it used a stable sort up to 512 elements, and unstable above.

Funnily enough, Mozilla had originally switched to a stable sort because MSIE used a stable sort: [https://bugzilla.mozilla.org/show_bug.cgi?id=224128](https://bugzilla.mozilla.org/show_bug.cgi?id=224128)

</comment></comment><comment><USER24> These features are good (except I think Function.prototype.toString is a mistake).

(An alternative to String.prototype.trimStart would be to use String.prototype.replace, although trimStart would probably be more efficient.) Still some things missing includes: a goto command, ability to disable automatic semicolon insertion, macros, enhanced regular expressions, and a built-in regular expression quotation function (it is easily enough to implement in JavaScript, but it seem to me the kind of thing that should be built-in).

</comment><comment><USER25> Good stuff! Normally I cringe to see new language features, but these are pretty good (Java after lambdas, even arguably after generics, is pretty crufty, IMHO)

One thing I'd to request is that `Object.fromEntries()` simply skip undefined entries, rather than do...strange things. I wrote an `mapObject` function that looks like `(a,fn) => Object.fromEntries(Object.entries(a).map(fn))` and occasionally the fn needs to skip an entry and the easiest way to do this is just return `undefined`.

<comment><USER5> > One thing I'd to request is that `Object.fromEntries()` simply skip > undefined entries, rather than do...strange things.

Not sure what strange things it does. fromEntries simply takes each entry, sets its first item as key (stringifying if necessary as object keys are necessarily strings) and the second item as value. Naturally falls from these that a null or undefined entry will error, and an empty entry will create an {undefined: undefined} item.

> I wrote an `mapObject` function that looks like `(a,fn) => > Object.fromEntries(Object.entries(a).map(fn))` and occasionally the fn needs > to skip an entry and the easiest way to do this is just return `undefined`.

Use flatMap instead?

<comment><USER25> Yes, it errors out. And flatMap isn't applicable here. Here's some complete test code you can try in your browser right now:

``` let p = (a,fn) => Object.fromEntries(Object.entries(a).map(fn)) p({a:1, b:2}, ([k,v])=> v === 2 ? undefined : [k,v]) ```

My intent is to skip the entry with `b:2`. However, both map and flatMap error out. It would be nice if `fromEntries` did what I think is the appropriate thing, which is just skip undefined and null. Is this not the behavior you'd expect?

Note that without special treatment in fromEntries, there's _no way_ for the mapping function to indicate "skip this entry". You have to do it in another pass, or some other way.

<comment><USER5> > And flatMap isn't applicable here.

It's absolutely applicable, flatMap can trivially act as a filterMap by returning an empty array in the "remove this element" case:

         let p = (a,fn) => Object.fromEntries(Object.entries(a).flatMap(fn))
         p({a:1, b:2}, ([k,v])=> v === 2 ? [] : [[k,v]])

there you go.

You can even make the adaptation transparent by wrapping the fn:

         let p = (a,fn) => Object.fromEntries(Object.entries(a).flatMap((v) => {
             let r = fn(v);
             return r == null ? [] : [r];
         }));
         p({a:1, b:2}, ([k,v])=> v === 2 ? undefined : [k,v])

> My intent is to skip the entry with `b:2`. However, both map and flatMap > error out.

Return an empty list from flatmap to remove the entry and a singleton list containing the new pair to alter it.

> Is this not the behavior you'd expect?

No. I would much rather have the existing function which has a very clear and straightforward behaviour and is not prone to silently misbehaving on buggy code.

> Note that without special treatment in fromEntries, there's no way for the > mapping function to indicate "skip this entry".

I fail to see an issue with that. If you want to remove an entry, remove the entry.

</comment></comment></comment></comment><comment><USER26> I love Javascript and TypeScript, but with all the technologies gravitating around JS, the setup for a project gets clunkier and clunkier.

But overall, loving the direction JS is taking.

<comment><USER27> I hear this a lot, but everything can be handled with a single tool: Webpack. Even a TS project can compile with Webpack and all of its assets, minification and compression needs can be handled in the same file. While you're at it you can set up a development server with source mapping. Just take an afternoon to learn Webpack and be done with complaining about setup overhead. I set up a multi-stage build for TS Project References but that's only necessary if you want to share code between the front and back ends. Aside from that you should only need a single build step.

<comment><USER28> > take an afternoon to learn we pack

If only it was that easy. The weeks I've spent hunting down webpack specific bugs because the plugins don't always quite work with typescript transformations and source maps...

<comment><USER27> If you have spent multiple weeks on a Webpack bug then you are not trying to fix it. You could have asked Stack Overflow over and over again in a matter of weeks.

There are many options for source maps due to their performance overhead and the docs describe then in detail and provide a guide for when to use each one.

</comment></comment></comment></comment><comment><USER29> How are these used on a browser? Do you have to wait for browsers to update? It's something I don't understand

<comment><USER27> Every individual feature has a support graph on MDN.

[https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction)

</comment></comment><comment><USER30> I've wished for a stable sort. But there doesn't seem to be any reliable way to determine whether the current implementation is stable or not. For most language features, you can do detection to find out whether you can use it or not. This one seems to be different.

</comment><comment><USER31> i just wish for something like lodash to be baked into js

<comment><USER32> A lot of the newer functionality in JS was obvious influenced by jQuery. Maybe the same thing will happen with lodash over time.</comment></comment>


CodeTable - online compiler/interpreter. (A weekend hack) - <AUTHOR> http://www.codetable.org

<comment><USER2> It's down for me:

"This webpage is not available The connection to www.codetable.org was interrupted."

<comment><AUTHOR> We crashed! It's up now :)

<comment><USER2> It's working now. Thanks.

</comment></comment></comment><comment><USER3> Slick! :)</comment>


Show HN: Wiffi – The Scent of Secure Connection - <AUTHOR> http://www.wiffi.co.uk

<comment><USER2> How does it handle rouge smells? What if an attacker tries to interfere using something like Febreze?

</comment><comment><AUTHOR> Hello - I would really appreciate feedback on my new startup. We are developing scented patches that inform a user that a WiFi connection is secure and legitimate. Thanks!

<comment><USER3> I heard about this one company that had a similar idea but implemented it via a high frequency acoustic signature; the higher the frequency the stronger the encryption. It apparently turned into this nightmare of competing signatures and people couldn't think straight near the more secure connections. This scent technology seems to be less intrusive.

When you get different scents, will the wiffi emitters automatically sychronised with other nearby emitters so the distinct carrier smells don't interact and cause service ambiguity?

<comment><AUTHOR> Can you remember the name of the company who tried it with high frequency acoustic signatures?

Nice idea! Ambiguity isn't something we have encountered so far during testing. It's something we are looking into though.

The plan is to eventually 'poison' the scent with a bad smell if there is somebody trying to spoof the hotspot or if the connection is compromised.</comment></comment></comment>


MIPS Creator CI20 development board now available for $65 - <AUTHOR> http://blog.imgtec.com/powervr/mips-creator-ci20-development-board-now-available <comment><USER2> Sorry, but I'm incredibly wary of anything Linux related from Img, particularly drivers. Poulsbo was a fiasco, and the situation has not improved significantly since. (And it's not just Linux. Intel had to delay the N2800 and related CPUs for several quarters because Img struggled to deliver stable Windows drivers.)

<comment><USER3> The same can be said about a lot of embedded projects. The fact is they all have custom hardware, which require custom drivers, etc.

<comment><USER4> ... and the number of people who can write that kind of code -- low-level driver code -- is pretty small.

</comment></comment></comment><comment><USER4> Why do all these boards have 100mbps Ethernet?

<comment><USER5> Because it's cheap?

<comment><AUTHOR> Because it's lower power.

</comment></comment></comment><comment><USER6> The UK store only offers credit card as payment option. Not in all EU countries owning a credit card is common (I don't). So please offer a kind of payment that is common in the EU (for me: Germany) (say, direct debit (in German: Lastschrift) or at least SEPA credit transfer). Paypal, for example, offers direct debit.

</comment><comment><AUTHOR> Please let me know if you have any questions.

<comment><USER7> Are there any good web pages or resources that offer a good high level overview of the differences between MIPS and ARM architectures generally?

<comment><USER8> It's a pretty standard RISC about halfway between SH4 and ARM in RISCiness(TM).

It's memory map is a little different. (For MIPS32 at least, not sure what KSEG of MIPS64 looks like) 80000000-9FFFFFFF is fixed to a cached view of the first 512MB of physical memory. A0000000-BFFFFFFF is fixed to an uncached view. Everything else is only accessible by mapping it via the MMU (both from a physical and virtual context). Last I played with MIPS cores, they were only soft fill TLBs, but maybe that's changed. Thumb2 is more expressive than MIPS16 IMO (but that's just, like, my opinion, man).

Other than that, the microarchitectual differences between individual implementations greatly outweigh the influence of the ISA, but for an in order design at least you can probably make a MIPS that'll compete well with an ARM for less transistors.

</comment></comment></comment><comment><USER9> I'm still surprised no company released a rpi A+ competitor using a simpler SoC (without the GPU running a rt kernel to drive USB to drive piggybacking eth link)

</comment><comment><USER10> Is ETAG some sort of JTAG variant? If yes, does OpenOCD have support for this ETAG interface?

<comment><AUTHOR> It is a type of connector for MIPS debug probes. Probably the best place to ask for more info is [http://forum.imgtec.com/categories/creator](http://forum.imgtec.com/categories/creator)

</comment></comment><comment><USER11> How does this compare/contrast w/ (eg) Raspberry Pi or similar ?

<comment><AUTHOR> Here is quick breakdown:

Newer/faster processor: 1.2 GHz dual-core MIPS32 vs. 700 MHz single-core ARMV6 More memory: 1 GB DDR3 vs. 512 MB DDR2 More storage options: 4 GB of flash + SD card expansion vs. microSD expansion Better connectivity: Ethernet + Wi-Fi + Bluetooth vs. Ethernet-only Wider operating system support: Linux + Android vs. Linux only.

I've ran some Linux/Android benchmarks on it and will publish the results in an article soon.</comment></comment>


Office.com Goes Live  - <AUTHOR> http://www.techcrunch.com/2009/08/21/officecom-goes-live/ <comment><USER2> I just noticed that Office live features dont work on chrome...

Ironic :)</comment>


Looks Like BoingBoing Got Hacked (NSFW) - <AUTHOR> http://techcrunch.com/2010/10/27/looks-like-boingboing-got-hacked-nsfw/ <comment><USER2> This kind of online griefing continues because people applaud it as clever and cool. This is an artless act of vandalism, like spray painting penises on Doctorow's house in real life. Please HN, don't give vandals credibility.

</comment><comment><USER3> What I find funny was that TechCrunch cited a random twitter user Machika Kuro (xXstandstillXx) as their informant of how it was most likely compromised.

If you read the tweet they were citing, "@TechCrunch @alexia mostlikly a mysql injunction attack" you get a sense that he's not the most reliable expert on security.

Injunction attack. I lol'd

<comment><USER4> Isn't an Injunction attack use to hack the court systems?

</comment></comment><comment><USER5> I stopped reading boingboing after I realised that the signal to noise ratio is lower than an unfiltered reddit. There's nothing in there that can't be found by tuning your RSS reader, except with an RSS reader you can filter out all the garbage.

It's a case study in how not to use your time. For every boingboing post out there, there's an interesting paper on arxiv, an insightful post on HN or pictures of cats that look like Hitler on Reddit.

</comment><comment><USER6> OMG. Thanks for the warning. Too bad I ignored it.</comment>


Manufacturing Reports Show Depth of Global Downturn - <AUTHOR> http://www.nytimes.com/2009/01/03/business/worldbusiness/03yuan.html

<comment><AUTHOR> "In China, the purchasing managers' index by the brokerage firm CLSA showed the manufacturing sector had contracted for a fifth consecutive month. The survey showed the steepest decline in its history.

"'With five back to back P.M.I.s signaling contraction, the manufacturing sector, which accounts for 43 percent of the Chinese economy, is close to technical recession,' said Eric Fishwick, head of economic research at CLSA in Hong Kong, in a note accompanying the release."</comment>


Six Months with Julia: Parse-Time Transpilation in 80 Lines or Less - <AUTHOR> https://medium.com/@otde/six-months-with-julia-parse-time-transpilation-in-80-lines-or-less-38412b640e1 <comment><USER2> Beautiful showcase of Julia's metaprogramming features.

For those lispers around, these string macros are used for arbitrary syntax, but if your desired syntax can be parsed by julia's parser, then you can just use regular macros which operate like Lisp1 macros with hygiene being something you opt out of instead of into.

<comment> dan-robertson I found Julia's macros to be pretty difficult. Unlike lisp's, it's not obvious what the (somewhat lisp like) ast of a given piece of code will be. That ast also frequently changed between language versions. It also wasn't documented when I last checked (ages ago). I recall the parsing rules around quoting were particularly confusing. It also seemed there were multiple valid asts for some expressions which would sometimes be magically canonicalised but maybe I was mistaken about that.

I still think there's a lot to like about Julia.

<comment><USER2> Yes, I found while I was learning the ropes of metaprogramming, I did a lot of quoting and dumping of code and then just reading the output structure to teach myself how a given piece of code get's lowered. Honestly, even if there were good docs for this, I think just quoting code at the REPL is a faster and more direct way to get that information anyways. This f course does increase the cognitive overhead when you're writing macros.

I think this additional complexity is a bit unavoidable given that Julia aims to provide something more like mathy syntax.

> t also seemed there were multiple valid asts for some expressions which > would sometimes be magically canonicalised but maybe I was mistaken about > that.

Yes, there are some things like that that happen, and to introspect that process you can use the Meta.@lower macro to see the canonicalization.

<comment> dan-robertson > I think this additional complexity is a bit unavoidable given that Julia > aims to provide something more like mathy syntax.

I'm not sure I agree with regard to the canonicalisation. But also there are generally a few ways to do macros in different languages:

\- Macros that run in a preprocessor. This can be quite structured with macros written into the source code file (eg C) or they may exist inside the preprocessor (eg camlp4 would have a modified ocaml+macros grammar and output pure ocaml after expanding the macros)

\- CL style reader macros/Perl style language extensions dynamically modify the syntax/grammar of the language in somewhat arbitrary ways. These may operate at a text level (eg CL) or a higher parse tree level.

\- CL style: macros look similar to function calls, expansion works in a well defined way and they manipulate a regular syntax tree which is obvious from the syntax

\- scheme/rust style macros which are rule-based and automatically hygienic. In scheme the rules are easy to write because the AST is obvious. In rust these are a little harder to write but the ast is interesting: macro calls are distinguishable from other syntax at parse time and their arguments are passed on as "trees of tokens with balanced brackets", a bit like sexps but there are a few types of paren pair. This way the rest of the language syntax need not apply inside the arguments to a macro and one doesn't need to know the structure of the ast

\- Julia style macros: you get an untyped ast that isn't obvious from the written code and you can modify it unhygienically like in CL macros.

\- ocaml ppx/rust proc macros: you get a typed ast (ie one in which the types let you know all possible ways some syntax you're interested in may be represented) with certain extension points that may be used to call macros, and you can unhygienically modify that ast. I think in the rust case your ast input may be in the "tree of tokens with balanced parens" form, and you may only be able to look at the ast related to the proc macro call that invokes you. In ocaml ppxes, they get the whole ast of the file and have to find the extension points they care about. There's no tree-of-tokens in the ast and the extension points need to contain valid expressions/types. The ppx must remove any references to these extension points from the ast (replacing them with valid syntax) or compilation will fail.

</comment></comment></comment></comment><comment><USER3> There's a fairly sophisticated transpiler from a computer algebra system language called Singular, to Julia, here:

[https://github.com/tthsqe12/SingularInterpreter/](https://github.com/tthsqe12/SingularInterpreter/)

It's still being developed, but Basically Works TM.

It does give some speedups over the original interpreter for the language, which has been in use for about 30 years:

[https://github.com/tthsqe12/SingularInterpreter/blob/master/...](https://github.com/tthsqe12/SingularInterpreter/blob/master/contrib/timings.md)

</comment><comment><USER4> Excerpt:

"

julia> a = function (x); x += 1; x += 1; return x; end

#13 (generic function with 1 method)

julia> @code_llvm a(3)

; @ none:1 within `#13'

define i64 @"julia_#13_17607"(i64) {

top:

; ┌ @ int.jl:53 within `+'

       %1 = add i64 %0, 2 <-- <one instruction, not two>

; └

      ret i64 %1

}"

Prior to reading this article, I did not know that Julia could compile LLVM at the function level... very cool!

<comment><USER5> It can also show you assembly at the function level:

       julia> a=1+2im; b=2+4im; @code_native a+b
               .text
       ; ┌ @ complex.jl:271 within `+'
               pushq   %rbp
               movq    %rsp, %rbp
       ; │ @ complex.jl:271 within `+' @ int.jl:53
               vmovdqu (%r8), %xmm0
               vpaddq  (%rdx), %xmm0, %xmm0
       ; │ @ complex.jl:271 within `+'
               vmovdqu %xmm0, (%rcx)
               movq    %rcx, %rax
               popq    %rbp
               retq
               nopw    %cs:(%rax,%rax)
       ; └

</comment></comment><comment><USER6> Thanks for reading, y'all!

I am quite new to anything lisp-y, but I did my best to honor the lisp wizards that came before me with this one.

</comment><comment><USER7> <pedantic> Shouldnt we replace "lines of code" with "statements" since with most compilers line breaks are optional <\pedantic>

</comment><comment><USER8> Lisp user here. Is bf" like a reader macro?

<comment><USER2> Yes, it's a string macro which is essentially a reader macro. We also have regular macros that operate on Julia's AST.

There's some really useful and approachable info here: [https://docs.julialang.org/en/v1/manual/metaprogramming/inde...](https://docs.julialang.org/en/v1/manual/metaprogramming/index.html)

You can think of Julia as a Lisp-1 with opt out hygenic macros hiding behind Algol syntax. However, the AST is very lispy:

        julia> dump(:(x^2 - 1))
        Expr
          head: Symbol call
          args: Array{Any}((3,))
            1: Symbol -
            2: Expr
              head: Symbol call
              args: Array{Any}((3,))
                1: Symbol ^
                2: Symbol x
                3: Int64 2
            3: Int64 1

The `:` is how you quote code in Julia, and `dump` is just a convenient function for printing nested data-structures.

Furthermore, you can see this package [https://github.com/swadey/LispSyntax.jl](https://github.com/swadey/LispSyntax.jl) for a string macro that lets julia use Lisp style syntax instead.

<comment><USER8> Thanks for the explanation. I'm checking it out.

</comment></comment></comment><comment><USER9> In C# since 2007. Feature is called LINQ expressions.

Not sure fully grokked it, but the difference appears to be, that in Julia the final Julia code is checked by the compiler at compile time?

<comment><USER10> sorry but did we read the same article? how's compiling brainfuck into Julia via macros related to LINQ?

<comment><USER9>
      Expression BrainFuck(string code) => Expression.Constant(42); // parser would go there
      var bfFunc = BrainFuck(@"arbritrary code").Compile();
      WriteLine(bfFunc(someArg)); // <- prints 42

As I mentioned later the difference appears to be that Julia does `Compile` call at compile time, thus giving you build-time validation.

P.S. this exact code won't work, but it shows the idea.

<comment><USER10> ah sorry, the naming threw me off. TIL you can manipulate/compile ASTs in C#! [https://docs.microsoft.com/en- us/dotnet/api/system.linq.expr...](https://docs.microsoft.com/en- us/dotnet/api/system.linq.expressions?view=netframework-4.8)

i guess all the macro stuff is under System.Linq.Expressions because LINQ expressions like

      from score in scores
      where score > 80
      select score

aren't just for SQL and can desugar to arbitrary C# code, is that right?

<comment><USER9> I think they are limited quite a bit. E.g. do not support classes, latest C# features, etc.

They were made exactly for SQL among other things. With SQL target your example will use this feature: scores will be IQueryable, and "IQueryable.Where" will take Expression, which C# compiler will generate from "score > 80" during compilation. Then the specific database engine will convert that "Expression" instance to SQL query for execution.

Of course, there are other ways to generate more .NET code at runtime. But not at compile time, which I wish we had.</comment></comment></comment></comment></comment>