Depression - <AUTHOR> https://www.robertsapolskyrocks.com/depression.html <comment><USER2> From my amateur perspective, i think the history of how people treat others with depression may be deeply rooted in the Human flaw of, "the way I experience the sensations of existence must be how everyone else does."

I can't exactly fault the default response to be, "I don't get it. Just get off your butt and go for a jog. I always feel better when I do that."

I remember being so ignorant to depression until I experienced it myself. It's unlike anything else. Your drive to persist is just missing.

P.S. the entire lecture series this one is from is worth watching.

<comment><USER3> _I can 't exactly fault the default response to be, "I don't get it. Just get off your butt and go for a jog. I always feel better when I do that."_

I've been living with depression for almost two decades now. I took up running a few years ago and you're right, it did make me feel good. But there was no way for me to keep it up through the Waterloo winters with mountains of snow, disgusting brown slush, and deadly black ice.

So I stopped late in the fall and restarted in the spring. I tried to keep active during the winter with an exercise bike and a rowing machine, but it's not the same. Every time I got back to the spring it felt like I was starting over.

Now, just over a year ago, I started university (at Waterloo) and the enormous challenge and stress of the workload drove exercise out of my immediate priorities. With the stress I ate more and gained weight, and stressed more over school without the calming relief of exercise.

This past summer I tried taking up running again, after exams. I ended up breaking my ankle, which is not surprising given that I was so out of shape and trying to push myself too hard over a shorter window.

Now the depression is stronger than ever. I don't know how I'm going to finish my degree.

<comment><USER4> Have you tried Vitamin D and magnesium aminoacid chelate / orotate / citrate.

<comment><USER5> On the one hand, answers like this always seem to over-simplify. Oh hey just take this vitamin and the soul sucking demon that's been riding on your shoulder for years, decades, will magically go away.

On the other, I spent nearly two decades of my life suffering from this horrendous illness, and nothing has helped as much as daily magnesium does.

I take a big Magnesium pill, a men's health multivitamin and I add D in the winter. Even my sleep apnea went away, and there's no damn reason that makes any sense.

Biology is stupid.

<comment><USER4> Yeah, on the one hand I'm strongly against drive-by one liners, on the other hand vitamin D _cured me_.

I was already taking magnesium, B6 ... everything else.

8000 to 12000IU of Vitamin D a day for four weeks weeks cured me of my suicidal ideation / depression / emotional instability / irritability.

I went to the doctor and got a prescription for antidepressants a couple of times, drove to the pharmacist and sat in the carpark in my car crying for half an hour before I drove home without getting the medication.

Vitamin D was the _keystone_ that's made all the other supplements work _way better_.

Now I'm on a much lower maintenance dose, a few hundred IU a day average taken as larger random doses throughout the week.

I guess it makes sense if I think about it, I get _almost no sun exposure_ , and when I am outside I'm covered in long sleep and pants because the sun here in Tasmania is either too low in the sky to warrant shorts and a tshirt, or it's summer and the sun here cooks my pale skin in minutes.

Your millage may vary. Vitamin D and magnesium are considered very non-toxic even at stupendously high dosages for short periods of time. And they're both fairly cheap.

Disclaimer: this does not constitute medical advice, do your own research, and all of that. I'm not insured to give nutritional advice.

<comment><USER5> Yeah, I added the vitamin D after spending most of a winter in Edinburgh. Lovely city- but it's 56 degrees north. That city will get less than 7 hours of daylight today.

<comment><USER4> At the winter solstice, the city I live in, at 41 degrees south, gets 9 hours and 10 minutes of daylight.

I spend 10 of those indoors at work.

It's not _feasible_ for me to get enough sun light most of the year.

<comment><USER5> What I learned from my time in Edinburgh was to _make time_ in the winter. Go for a post-lunch walk when possible. And of course take supplement too.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> I personally think that mental illness is the #1 challenge of western societies.

It's not just about personality disorders, mood disorders, psychosis, and other illnesses, but also milder conditions that have a very high, hidden cost and not only affect the lives of those who suffer from it, but everyone around them.

If you live in a big city, you will meet people with mental conditions and knowing how to react can make a world of difference for them and you.

</comment><comment><USER7> Wow, Sapolsky's explanation of a various neurotransmitter mechanisms, starting with transmission across a neuron synapse, is simply beautiful.

Video link starting at 14:48 min: [https://youtu.be/NOAgplgTxfc?t=888](https://youtu.be/NOAgplgTxfc?t=888)

</comment><comment><USER8> Is it just me or is this site literally completely unreadable? Its font color is too similar to the background for me. Screenshot: [https://i.imgur.com/KFzMuaF.jpg](https://i.imgur.com/KFzMuaF.jpg)

<comment><USER9> Yes, the mobile web version of the website has a dark background color which makes the text extremely difficult to read. The desktop website has a white background.

</comment></comment><comment><USER10> In this lecture, Sapolsky talks briefly about the genetic component but at a super high level "good/bad" version of a gene.

 _Depression is a genetic disorder. It has some degree of heritability. 50% identical twins, 25% full sibling. So again we have the whole nature-nurture interaction. Have the bad gene (a serotonin one), add in major stressors and uh-oh. A 30 fold increase in the likelihood of depression at the extreme. Oh, and glucocorticoids regulate the expression of the gene._

Anyone know what gene he is referring to?

<comment><USER10> So, I'm guess maybe this one: [https://www.ncbi.nlm.nih.gov/snp/rs25531#frequency_tab](https://www.ncbi.nlm.nih.gov/snp/rs25531#frequency_tab)

...and despite: "According to David Hinds of 23andMe on community forums, "nearly everyone (99.97%) is getting called as CC, and there is no clear heterozygote cluster" ... "the genotype calls for rs25531 on our platform are not meaningful." Looking at OpenSNP frequency data, this seems to be universal for direct to consumer genotyping services at this stage.... "

... but went looking for this in my own data anyway, and couldn't even find the rs#.

disclaimer: I have no idea what i'm doing.

</comment></comment><comment><USER11> this was a good read. I am currently myself spiraling down into depression and fighting against it. It's very interesting to try to get a grasp of what's going on and in the past year or so I learned more about brain chemistry, receptors, amines, enzymes, etc than I did during my entire school curriculum.

I call myself a self-proclaimed guineapig: I read a lot of papers, talk with my doc about different attempts of medication and things that I don't want to touch such as SSRIs and why, and self-medicate for things that don't need a prescription or are off-label useful for depression. Some things worked, but aren't sustainable because they aren't prescribable where I live.

Yet after a long time of fighting, the feeling of hopelessness is getting more and more stronger. Depression is horrible and I would give so much to turn back the clock to when I didn't feel the way I do now.

</comment><comment><USER12> This is fascinating. I didn't realized the scientists had developed such a detailed understanding of depression.

<comment><USER13> Knowing the way we are made is depressing. Too many moving parts, too much complexity, too much uncertainty, too many things can (and do) go wrong. And there's not much we can do about it. At the same time, it is quite amazing that we are sturdy enough not to fall apart the moment we are born but instead last for many years.

</comment></comment><comment><USER14> As a programmer trying to imagine how I would construct & create depression for a simulation. I think it would make sense to have a negative state that turns "on or off" against the will, associated with unwanted thinking patterns, current life circumstances and some type of past trauma playing a big role in the illness. Anyone think of something different?

I believe past trauma is the root cause and I doubt people have depression if they haven't had some type of experience they would classify as trauma. I think one solution is defeating the trauma with after decoupling the negative thinking patterns. Another problem is I think the illness cannot be defeated in some rare circumstances. I think people get prescribed medication too often. Doctors use the diagnosis too often from my observation. Some have tried to label me with it, when I suffer from another illness "gender dysphoria" and I think that isn't right for them to do. I also think the diagnosis is too vague and should have classifications.

I believe more resources need to be put into educating people and how to approach mental health as important to physical health. When I grew up in the US, it was always about physical health and with a little sex education. Mental health might be even more important because it can prevent a person from having good physical health.

<comment><USER5> > I believe past trauma is the root cause and I doubt people have depression > if they haven't had some type of experience they would classify as trauma.

I had a great childhood. Amazing parents. A good upper middle class life. Good friends. No real trauma to speak of at all.

By 12, if I'd shared with a doctor what was going on in my head they'd have slapped me with the depression label. I wasn't healthy. There was no event or trauma. This shit is genetic- I can tell which relatives on my Mom's side have the demon riding on their shoulders. They, like me, were born with it. I'm sure they can see it on me too.

Trauma can indeed trigger it, but there are a lot of other ways. Don't presume that just because someone suffers from depression that they have been traumatized, nor that someone who hasn't been traumatized can't suffer from depression.

<comment><USER15> I got very depressed because I actually had undiagnosed Aspergers.

This caused me to get bullied, have problems in school which then turned into depression later. People with Aspergers are incredibly sensitive and blind to emotions making them easy targets.

The root cause for me was the Aspergers. What tipped me over the edge was not knowing I was different and being put into a school environment not suited for someone with all the sensitivities associated with Aspergers.

Yes bad things happened to me that made be depressed, but there was more going on.

<comment><USER16> What's the catch once your asperges is diagnosed? What can you do anyways..

</comment></comment></comment></comment><comment><USER17> I had the good fortune to watch the lectures some years ago and the helped my understanding greatly. Just would like to share this and encourage everyone to take a close look.

</comment><comment><USER18> why does this page have grey text on a grey background? ist it only me (Firefox on Android)?</comment>


ESPN under fire for taking Asian announcer Robert Lee off UVA game - <AUTHOR> http://money.cnn.com/2017/08/23/media/espn-robert-lee-uva-game/index.html <comment><USER2> The town of Bondi Beach, Australia has permanently blocked construction of a synagogue because the town council was concerned it might one day be terrorist target[1]. But that's going straight to the win condition for the forces of evil. Evil got rid of the synagogue and didn't even have to build a bomb.

This feels like a similar thing. At least make the forces of evil work for chasing innocent people out of their work - don't do it for them!

[1] [http://www.news.com.au/national/nsw-act/news/bondi- synagogue...](http://www.news.com.au/national/nsw-act/news/bondi-synagogue- ban-over-terrorism-risk-leaves-jewish-community-shocked-and-furious/news- story/6ec6252d613583df7797c7cac2b25de4)

<comment><USER3> What a thoughtful contribution - it's thought provoking and adds depth to the conversation. I wish more comments did as much.

You touch on an interesting topic - the point of terrorism isn't destruction, it's to inspire fear. They're playing a long game so whether or not they attack every event, they gain as people lose freedoms or privacy and when we dedicate resources to security and protection that could have served another purpose.</comment></comment>


Intel: Meltdown, Spectre silicon fixes coming 2018; 3D XPoint RAM, not so much - <AUTHOR> https://arstechnica.com/gadgets/2018/01/intel-meltdown-spectre-silicon-fixes-coming-2018-3d-xpoint-ram-not-so-much/ <comment><USER2> Reading the headline I had wished for more details.

What does it mean to fix spectre? The microcode updates that were presented weren't... very elaborate as far as I understood it. They basically add optional capabilities for software to say "please let speculative execution run into nowhere and I know it'll be really slow".

What will these fixes look like? Will they add memory permission management to speculative execution? Is that even possible? Will they move away from speculative execution? Is it possible to have a performant processor without it? Will the fixes "just work" or will they require changes in software? In compilers? Will they be on by default or only for sensitive processes?

<comment> Tuna-Fish > Will they add memory permission management to speculative execution?

Probably.

> Is that even possible?

That's how AMD does it, so yes. Simply refusing to return a result from memory before the permissions are checked is a good solution to Meltdown. Might be a little slower in some situations, but it shouldn't be terrible.

> Will they move away from speculative execution? Is it possible to have a > performant processor without it?

No and no.

Spectre 2 can be fixed by storing more bits in BTB tags, including the PCID and possibly some id to distinguish between VMs. If they don't want to do that, they can fix the issue with somewhat more of a performance penalty by introducing a fast operation to clear the BTB, which would be used when switching between privilege levels.

> Will the fixes "just work" or will they require changes in software? In > compilers?

Spectre 1 cannot be fixed, and the only solution is to accept that branches cannot be used as security boundaries.

</comment></comment><comment><USER3> So Intel just hit earnings records[1] for 2017Q4 despite all the vulns (AMT). And now, after recent events (Meltdown/Spectre) with no warranty losses, are anticipated in excitement to hit new records in 2018Q4 with new, apparently not much faster, but fixed CPUs. Awesome.

[1] [https://www.anandtech.com/show/12371/intel- announces-q4-2017...](https://www.anandtech.com/show/12371/intel- announces-q4-2017-and-fy-2017-results)

<comment><USER4> Intel has absolutely no incentive to do anything about any of these problems. They are the definition of a monopoly.

<comment><USER5> Intel does not have a monopoly. The do have the best (i.e. fastest) processors for some applications. But having the best product in a market niche is not a monopoly.

AMD make instruction-compatible CPUs and other vendors make other computing architures (POWER, ARM, SPARC, etc.) that all compete with Intel.

<comment><USER6> Regardless of comparative product quality, AMD does not have access to the fab capacity to compete with more than 10-20% of the volume of CPUs that intel ships. AMD is the only other x86 competitor which, for the time being, are not easily replaceable for a large swath of the market (eg desktop and server cpus). AMD can threaten Intel's margins, or up to 20% of their volume, but otherwise intel is monopolistic to a significant degree.

<comment><USER7> Is that capacity only from global foundries ? What about tsmc ?

<comment> Tuna-Fish As of right now, AMD only designs their CPUs to work on the GloFo foundry. They could relatively easily expand production to the samsung fabs (as those are using almost the same process), but moving to use TSMC would require expensive and time-consuming redesign.

</comment></comment></comment></comment></comment></comment><comment><USER8> Highly doubt that any proper silicon fix is going to be out this year. Silicon validation is no joke, so I'd expect 3years before speculation issues are fixed properly. I think the new fixes will be in microcode instead

<comment><USER9> Sorry for asking, what is Silicon Validation? and how it is related to Meltdown, Spectre?

<comment><USER10> Simulating and testing the design. You generally don't want to spend millions of dollars on a semiconductor mask set unless you're sure the design will work correctly.

This part usually takes longer than the actual logic design and transistor layout phases.

<comment><USER11> > You generally don't want to spend millions of dollars on a semiconductor > mask set unless you're sure the design will work correctly.

For varying levels of sure, given recent history.

</comment></comment></comment></comment><comment><USER12> OK, time to hold off on computer purchases until the fixed version is out the door. Maybe by then the big GPU shortage due to cryptocurrency mining will have been resolved.</comment>


Awesome-Selfhosted -  FOSS web applications that can be hosted locally - <AUTHOR> https://github.com/Kickball/awesome-selfhosted <comment><USER2> This is awesome! Kudos to the poster.

There are other lists like these, but an updated one (especially covering this many areas) is good.

I started a series of posts on [http://flintbox.me](http://flintbox.me) around this topic (specifically self-hosting on lightweight hardware like Raspberry Pis), and it's a great way to keep sensitive data off the cloud (or even just if you want to keep control of your data).

Self-hosting is becoming easier, cheaper, and quite powerful, and should definitely not be overlooked as an option for home and business users.</comment>


Stop Password Masking - <AUTHOR> http://www.nngroup.com/articles/stop-password-masking/

<comment><USER2> Many people work in office settings with co-workers sometimes looking at their screen (Pair programming, getting help.) Masking passwords by default is a good thing.

Also, don't forget sight-impaired accessibility features. OS features like VoiceOver on Mac will read what you type, unless you are on a masked text field in which case the OS knows not to say each character you type for the whole office to hear.

A user option to toggle the visibility is welcome. Many of the Mac password panels today have a checkbox under the field for "Show Password."

</comment><comment><USER3> type="password" inputs are not explicitly saved to browser form history, which is the biggest functional differentiator.

<comment><USER4> Does the same thing happen (in modern browsers) with autocomplete="off"? I assume that's why I don't get autocomplete/history for my bank's login page, despite that it's in cleartext.

<comment><USER3> Yeah that's generally how its done, but also doesn't give users the choice to use their browsers password manager or keychain. The autocomplete feature was more geared towards sensitive data that should never be re-surfaced in an automated way, such as credit card info, that sort of thing.

<comment><USER4> Right! I forgot about the browser's password manager.</comment></comment></comment></comment>


Ask HN: The Best Discovered Podcast in 2020? - <AUTHOR> Which podcast that you discovered in 2020 has the best signal vs. noise ratio? <comment><USER2> I just discovered the news / comedy podcast No Agenda. [1] Hosted by Adam Curry and John Dvorak. Apparently this has been a thing now for ten years!? Sort of a hidden treasure. Adam was on Joe Rogan recently to talk about how he invented the Podcast format years ago. [2] It seemed to capture a lot of Adams enthusiasm for researching and explaining what makes the world tick.

I find that No Agenda consistently delivers insight and entertains, with a producer driven podcast twice a week. I am grateful I found them as my commute is much more entertaining! While they fund this based on donations, they accept no Advertising so it has a very refreshing feel to it.

[1]: [http://www.noagendashow.com/](http://www.noagendashow.com/) [2]: [https://www.youtube.com/watch?v=NaPKrZTUoUs](https://www.youtube.com/watch?v=NaPKrZTUoUs)</comment>


Huxley vs. Orwell: Infinite Distraction Or Government Oppression - <AUTHOR> http://www.prosebeforehos.com/image-of-the-day/08/24/huxley-vs-orwell-infinite-distraction-or-government-oppression/ <comment><USER2> It's most definitely both.

I've been really intrigued by this topic as of late because it's an easily noticed problem. The general public (that's a fun term, aye) are becoming equally insatiable as they are stupid.

There's an excellent film called Idiocracy that came out a few years back. It's meant to be a farce but makes a really great point about where we might end up in the future. Here's a clip of one of my favorite scenes: <http://www.youtube.com/watch?v=wW-4LU79qbU>

It's funny, but it's also sad. At this point, I don't see much of a reversal taking place. If you're an intelligent person, be thankful and try to help those around you who are less aware of Spaceship Earth.

Edit: I misspoke. I thought about it and "I don't see much of a reversal taking place" isn't true. The one thing that can reverse all of this is parents. If you have children, take the time to educate them and make them aware of their existence. Explain how systems work and the benefits/problems with them. Don't use scare tactics, just talk to them. More likely than not, they'll grow up with a head on their shoulders.

<comment><USER3> +1 for idiocracy. There is so much of society crammed into that film it's unreal. Warning: it's by mike judge of Beavis and butthead fame so you have to look past the fart jokes.

"ow my balls" is definitely a reference to wasting time on YouTube...

<comment><USER4> This film struck me as an educated elitist view of the lumpenproletariat. Once upon a time, an itinerant person was the one who idled by reading, rather than working, or enjoying the more "vigorous" pleasures of the hunt, etc. Reading novels was thought (and by some, still is) to delude the mind with fantasies. New mediums are often derided.

I also found the film prudish, implying that having a large family can only be a product of ignorance and animalistic tendencies.

<comment><USER2> _I also found the film prudish, implying that having a large family can only be a product of ignorance and animalistic tendencies._

I believe you're referring to the family tree scene where the affluent couple wants to conceive but they cannot. Instead, they parallel their experience against the destitute couple breeding at an infinite rate.

I don't believe this should be a slight against having a large family, but rather, doing so under mindless pretenses. To be blunt: just having sex to have sex, not to procreate with a purpose.

<comment><USER4> This would be my statement to the writer: Sex for sex' sake is far from mindless, and a child conceived in love is no worse than one who is the product of deliberation and effort. Also, pregnancies are equally likely to be deliberated amongst low-income families, especially in rural societies.

<comment><USER5> I don't think it was just "sex for sex' sake". It's just that contraception requires responsibility, and the irresponsible are the ones who, by default, have more children, which is the opposite of how it should be.

<comment><USER2> Much better articulation of what I was trying to say.

</comment></comment></comment></comment></comment></comment></comment><comment><USER6> Why are techies as a group so apocalyptic? I think the world 100 years from now will be a fairer, more just, more humane place than it is now. 100 years ago, women still couldn't vote in the US and the country was legally segregated instead of just segregated in practice. 100 years ago, child labor was at its peak in the US, food safety was non-existstant, charlatans ran rampant in the practice of medicine, and cities were thick with the pollution of the industrial revolution. We live in a better world today than has ever existed for the greatest number of people. Why should we believe that it will be society, that has improved itself so, that will be its own undoing?

<comment><USER7> Because they are people, and people as a group are apocalyptic.

Four to five decades back, everyone grew up convinced that atomic war was inevitable. That was the zeitgeist, but wrong. Nuclear war is a great stride forward in that it's the only methodology of war yet invented that is both aggressively pursued by leaders and presents those leaders with a dire and immediate threat of death if used. (As opposed to, say, war by assassination, which only satisfies one of those criteria). So the incentives were aligned against what popular sentiment said was inevitable.

Then all of that determined, grim sentiment sloshed over into the ready and waiting environmentalist hair-shirt death cult after the collapse of the USSR.

As someone who advocates for engineered human longevity, I see a lot of this. Most people, the majority, don't have a positive view of the future. At present that is largely informed by what in a sane world would be extreme environmentalist views, but in this world are middle of the road environmentalist views - most people are convinced that the world is falling apart, that there are too many people, that no-one should be allowed to extend human life, that all resources are running out, and in short that Malthus was right.

This view of the end of the world will no more come to pass than nuclear war did. All the incentives are aligned against Malthusian limits of any sort, and always have been. Hopefully one doesn't have to explain why that's the case to the present audience.

<comment><USER8> I agree with you, but I also think that being a cynic/skeptic allows you to _appear_ more intelligent, and that is why people (perhaps unconsciously) find flaws in an idea.

By finding flaws, you're almost saying you've outwitted the idea proposer.

</comment></comment></comment><comment><USER9> The one piece of science fiction that really struck me in this way is the 1960's BBC television play _The Year of the Sex Olympics_. It manages to predict the onset and results of reality TV with startling accuracy. Highly recommended, if you can find a copy.

<comment><USER10> Is that where Futurama's references to an "Olympic gold medal in limbo.. and sex" comes from? I always found that quite curious, but could not find out where the jape came from..

</comment></comment><comment> DanI-S Does it even matter that a portion of the time once stolen away by grinding toil in the fields (for the benefit of kings) is now stolen away by inane cable television (for the benefit of CEOs)? Heart disease is a kinder killer than starvation, drought and cold.

It's easy to forget that things are better now than they have ever been before. Don't stop believing!

</comment><comment><USER11> Planet Earth is a big place, and its inhabitants managed to reach both of those destinies at the same time. There are places where people live like Orwell predicted, and then there is this so called "First World", which looks exactly like Huxley's vision portrayed by this comic.

The real question is: how do we fix both of those states?

</comment><comment><USER12> I don't think it's one or the other. I think it's a little bit of both. The less people care about what's going on in politics and about defending their rights, the more oppressive and invasive the Governments become.

<comment><USER13> I would consider myself much more aware of international events than most and still believe that there is realistically no chance of defending my rights in this age of a two party system where both are equally interested in seeing the nightmares of Huxley and Orwell come to pass.

Sure there may be a lot of people who aren't educated about the dangers we face, but from my own experience the bigger problem is all those that understand but feel powerless to do anything meaningful about it.

<comment><USER14> Between women's suffrage, the civil rights act and pretty big reductions in corruption, the story of the U.S. from 1900 to the present is one of massive expansion of personal rights.

The last half of the 1800s wasn't so bad either.

(I'm not saying the U.S. does not have corruption, I'm claiming that it has mostly gone down over the time mentioned)

<comment><USER15> Yes, but all of these changes didn't just happen because people were posting displeasure on reddit. There were nationwide movements. Where's our movements now? We have some, and what happens to them?

I don't dispute for a second that we are better off today than ever before. I just wonder if we've peaked...

</comment></comment></comment></comment><comment><USER16> I had the enormous privilege of having a teacher who assigned both _The End of Education_ and _Amusing Ourselves To Death_ by Neil Postman my junior year of high school. I can't recommend them enough; reading them was one of the formative political experiences of my life.

We live in dangerous times; civic engagement and an educated, vibrant population is more important than ever. But our political and cultural discourse has fallen to its lowest point in as long as anyone can remember. If I were not already politically engaged, I might become so if I watched Edward Murrow at night -- but watching CNN these days seems to be no different from watching the Jersey Shore.

<comment><USER17> >>> " But our political and cultural discourse has fallen to its lowest point in as long as anyone can remember."

Sure, but what does that really mean? To me, not much, as peoples memories are short.. There are numerous examples in the last few centuries of much, much worse political discourse. Think about the Lincoln-Douglas debates where newspapers that were controlled by political parties would edit the transcripts of the opposing candidate to enhance the standings of their own horse in the race.

</comment></comment><comment><USER18> My vote is for infinite distraction. Government is taking advantage of this right now. They can already do basically whatever they want without that much blowback.

<comment><USER12> Another problem in US besides a lot of people not being educated on the issues and not caring about them, is the feeding of bad information through the corrupt media. With today's media, it's almost too easy to get most people in the country to think a certain country is the enemy and needs to be destroyed, at whatever cost. Thanks to the same media, it's also pretty easy to pass bad laws, too, either because the media is not covering them, or lies about them.

</comment></comment><comment><USER19> The comic paints a picture from a very specific viewpoint, as if Huxley's were the rational, correct one and Orwell's came from a delusional fantasy land. Both men lived very different lives and they were responding to what they saw.

Huxley came from a family distinguished in science and rational thought, so he had something to live up to. He was intellectually gifted, but was a poor authoritarian who was barred from military service due to poor eyesight.

Orwell came from the gentry, was told that he was clever at a young age and when given the chance to see authority and violence he jumped at it. Both noticed just how broken the worlds they had stepped into were.

Huxley was never shot in the throat or saw the Soviets pervert his ideals in Spain or endure a slow death by TB. Orwell had little interest in examining the gullible, impatient, "zippy" world of the US that Sinclair Lewis and Co were responding to, so he missed out on a taste of what the future would hold for those with peacetime and plenty.

</comment><comment><USER20> I very much enjoyed the book.. <http://en.wikipedia.org/wiki/Amusing_Ourselves_to_Death>

<comment><USER21> The Time Machine is quite interesting on the same topic.

</comment></comment><comment><USER22> Neither will destroy us IMHO. Too many emo-burgers being slung lately. It's not the end of the world when things go wrong. In fact, it's business as usual.

</comment><comment><USER23> And they're both happening. Great.

<comment><USER24> Both has been happening for a long time. Romans used to say: "Bread and circuses"

<comment><USER10> You mean "panem et circenses", which translates to "Bread and games", to be exact :)

<comment><USER24> You are the native speaker, so I guess you are right. In my defense, I checked the wikipedia before I posted.

<http://en.wikipedia.org/wiki/Bread_and_circuses>

</comment></comment></comment></comment><comment><USER25> At the top of the page, there are logos for other blogs that if you mouseover them, they pop down with inane headlines for things that don't matter. There are three pictures linking to inane political cartoons above the article. Above and to the left there is a "recent comments" widget and links to Facebook and StumbleUpon, plus a couple of Flash banner advertisements to round it out.

Below the comic there is a row of social networking widgets, plus a block of linkspam along the lines of "The Hilarious College Liberal Meme", "10 Things Much Worse Than Same-Sex Marriage (But Are Totally Legal)", "Nine Hilariously Awkward Facebook Interactions", "50 Ridiculously Athlete Photos", and "Atom Bomb Detonation May Have Alerted Aliens that We're Trouble". After a long block of comments, there's more linkspam, including "19 Celebrity Drunk Pictures (Bet They Regret These!)". At the bottom of the page, _even more linkspam_ , from "We know who's the boss. (That damn cat)." and "Sheep Poop Bookmark" to "Cats Hate Wallpaper!" and "The Best Of The Overly Attached Girlfriend". At the very bottom, you can sign up for emails from this website, and there's another Twitter and Facebook widget for good measure.

Sometimes you have to step back a little before the message really sinks in.

</comment><comment><USER26> 1984 is seemingly the only book everyone has read.

It is really frustrating to see people simplify all economics, (evidence- based) social psychology and proper appraisal of philosophy applied to historical perspectives only to reduce our future to these bizarre extremes. The only reason people even give 1984 its credibility post Cold-War is that its two chief components, the television and surveillance camera became a reality. This is not to trivialise the presence of surveillance, but honestly, I'm amazed anyone can read it past the hysterical Room 101 bit. BWN is basically just 1984 told from the bourgeoisie perspective, the specifics are different but both themes are two sides of the same coin.

tl;dr 1984 is the print version of those crackpot websites that are all made in Frontpage, where every other word is formatted differently and there's a maddening tree of stream of consciousness ramblings, some of which lead to nowhere. The whole hoary debate can be summarised as basically one legible paragraph of that.

</comment><comment><USER27> It's too Kazinskian a perspective that these are the only choices we have...

</comment><comment><USER28> False dichotomies.

<comment><USER29> Denial.

</comment></comment><comment><USER30> For the record.. Huxley was Orwell's teacher at some point.

<comment><USER31> Aldous Huxley taught Eric Blair (George Orwell) at Eton. Perhaps most interesting, George Orwell achieved success before Huxley and wrote some rather scathing things about Brave New World!

<comment><USER29> Link, good sir!

<comment><USER32> A quick Wikipedia search on "George Orwell" will provide you with evidence that Huxley was Orwell's teacher.

<http://en.wikipedia.org/wiki/George_Orwell>

[http://www.lettersofnote.com/2012/03/1984-v-brave-new- world....](http://www.lettersofnote.com/2012/03/1984-v-brave-new-world.html)

That wasn't too hard.

</comment></comment></comment></comment><comment><USER33> As several other comments here have pointed out, it's possible for neither bad outcome to happen. Human beings always have frailties and make mistakes, and even take advantage of one another, but the long-term trend line in human society suggests the worries in the submitted article are overblown. By coincidence, the Why Evolution Is True website today has a post that responds to worries like this with actual research by careful scientists who know human nature well.

[http://whyevolutionistrue.wordpress.com/2012/10/03/things- ar...](http://whyevolutionistrue.wordpress.com/2012/10/03/things-are-getting- better/)

The Hans Rosling video linked to from that post is familiar to some participants on Hacker News; if you haven't seen it yet, it is well worth a look.

</comment><comment><AUTHOR> Looks like the site is having load issues.. [http://webcache.googleusercontent.com/search?q=cache:r-Sz2Hq...](http://webcache.googleusercontent.com/search?q=cache:r-Sz2Hqe5GsJ:www.prosebeforehos.com/image- of-the-day/08/24/huxley-vs-orwell-infinite-distraction-or-government- oppression/+&cd=1&hl=en&ct=clnk&gl=in)

</comment><comment><USER34> Both at the same time.

</comment><comment><USER5> Okay, am I the only one who saw Brave New World as a utopia? Everyone's _completely frigging happy_!

<comment><USER35> They aren't happy. They are drugged. Any time anyone starts to have any questions or qualm of any kind, they have been trained to drug themselves into insensibility rather than think about it. Anyone desiring individuality is a pariah.

Furthermore, the siciety is completely static -- it's designed that way. It cannot grow or adapt in the face of new opportunities or needs (eg climate shift, resource depletion). Would you want to live like that?

<comment><USER5> > They aren't happy. They are drugged.

I don't see why the two are mutually exclusive.

> It cannot grow or adapt in the face of new opportunities or needs (eg > climate shift, resource depletion).

It looks like they solved all their problems through technology, so they don't need to adapt to anything. Just full-time happiness!

</comment></comment></comment><comment><USER36> Neither, this is a false dilemma. Humanity, as any form of life, always balances the equation when one side gets too prominent.

</comment><comment><USER37> asteroid

</comment><comment><USER38> Both. So what can we do?

Resisting oppression calls for courage. If you merely complain or protest you may be tracked down and threatened. If you go beyond that to active resistance you definitely run the risk of being labelled a criminal or terrorist and put in a cage.

Resisting distraction is a whole lot easier. It just requires self-discipline, and a willingness to say no the the bait. Don't use a bank, credit card, television, or unfree software. Don't buy industrially processed or GMO food. Opt out.

Yes, it involves sacrifice, and other people will mock you, but if you are short on bravery, what else can you do?

EDIT: Forgot this: Do not vote.

</comment><comment><USER39> Is somewhat odd and amusing that the copyright holders of the text (not the author, as he died in 2003) requested that this comic be taken down from the site that originally posted it. - [http://www.recombinantrecords.net/docs/2009-05-Amusing- Ourse...](http://www.recombinantrecords.net/docs/2009-05-Amusing-Ourselves-to- Death.html)

[edit] I just read that the artist actually contacted the estate of Neil Postman to check if they had any problem with it, just in case they ever sued, and then removed it on their instruction. - [http://www.stuartmcmillen.com/blog/cartoon-blog/amusing- ours...](http://www.stuartmcmillen.com/blog/cartoon-blog/amusing-ourselves-to- death/)

<comment><USER40> Link to the full comic image: [http://www.acceleratingfuture.com/michael/blog/images/Amusin...](http://www.acceleratingfuture.com/michael/blog/images/Amusing- Ourselves-To-Death.jpg)</comment></comment>


Beta – Aangle – Reaction Videos of Anything on Your Phone - <AUTHOR> https://play.google.com/apps/testing/com.getswizzle.angle <comment><AUTHOR> Aangle basically lets you record anything on your screen with a floating window that shows your front camera. We even let you record both camera's at the same time!</comment>


Ask HN: How to become more effective at email communication? - <AUTHOR> <comment><USER2> What do you mean exactly by more effective?

As much as we love email, it depends on the context and message you are trying to get across. The medium is the message and when you need to get a response or communicate urgency, you call or do F2F. Email is great for short conversations and simple topics. Think about what you're sending and what you'd like to get out of the email conversation.

</comment><comment><USER3> My advice is to keep emails short and try to focus on as few different points as possible - this will get you a much quicker response.

I tend to request confirmations a lot (i.e. "can you confirm x") to make sure there's a shared understanding: just because you've written something in a previous email doesn't mean the recipient actually read it.

</comment><comment><USER4> There are a few principles that make email effective:

1\. Make sure email is the best way to communicate. Email is great when you or the recipient need to reference the material later. Email is also good when you don't need an urgent response. Otherwise, a phone call, text message, or meeting in person might be better.

2\. Only ask one question/topic in an email. Multiple questions rarely work well in an email. If you must ask more than one question, you should probably send one email about the most important question and then follow up with a second question once you get a reply. If you ask too many questions in one email, the recipient may get overwhelmed and not respond.

3\. Have a clear call to action at the end of the email. It could be a final question that asks for the recipient's opinion. If you have no need for a reply, say "No reply needed." That will let the recipient know that you don't expect a response.

I wrote more about how to write effective emails on my website with 2 sample emails for common workplace situations: [https://www.climbuptheladder.com/getting-the-most-out-of- ema...](https://www.climbuptheladder.com/getting-the-most-out-of-emails-at- work/)

</comment><comment><USER5> Predictive scheduling. With clients I like to let them know when "office hours" are open. So let's say you subdivide your day into blocks of time. 8-12am is set aside for actual uninterrupted work / coding. 12-2pm for lunch / long walks in nature. Then you can reserve 2-4pm for communications. My preference is actually for video chat. Delegating email to transfer design and business docs via attachment.

Since 90% of that session tends to be putting out fires and lowering their blood pressure around whatever panic they have worked themselves into that day about the project not moving forward quickly enough for their liking. Having a set time each day when you make yourself available is itself soothing and a way to instil confidence into your process.

Of course it all flies out the window during a crunch anyway ;)

</comment><comment><USER6> \- Keep them as short as possible.

\- If you're presenting options, label them with numbers/letters so people can easily reference them in a reply.

\- Instead of leaving follow-up actions open-ended, specifically call out what you're going to do, when you need a response by, etc.

</comment><comment><USER7> After you write each email, and before you hit 'send':

1\. Split any long sentences.

2\. Identify any list-like information (anything with multiple 'ands' or 'ors' or commas) and turn those into bulleted or numbered lists.

3\. Summarise what you want the person to _do_ in a short sentences at the beginning of the email.

4\. Go through the rest of the email and delete anything that the person isn't going to need, in order to do the thing specified in (3).

5\. Now think about it from the reader's perspective. If they get this email and read it from start to finish. What are they going to do in the next 15 seconds? After you empathise with them, you may want to add/remove some more info.

</comment><comment><USER8> If you are programmer then try to think of email as code for brain quantum networks and use automation tools. I have coded email about that here [https://gitlab.com/dzmitry-lahoda/dzmitry- lahoda.gitlab.io/b...](https://gitlab.com/dzmitry-lahoda/dzmitry- lahoda.gitlab.io/blob/master/howto/How%20technical%20person%20can%20write%20good%20corporate%20email.md)

</comment><comment><USER9> 1\. Find an editor you trust enough to give you very candid feedback. Work with this person to figure out where you are right now and where you want to be in the future. Ideally, you're looking for someone who will tell you what's wrong without killing your spirit. Or as I often say, you're looking for someone who is kind but picky.

2\. Practice.

</comment><comment><USER10> In the absence of elaboration on what you mean:

\- Be brief.

\- Use simple language.

\- If you're asking for things to be done, bullet item or number them and make your request clear and flesh out the details up front. Provide them with the information that will make their work easier.

\- Do not send needless emails and responses (such as "Thanks" replies).

</comment><comment><USER11> My rule is that you lose half your readers after each sentence. And the subject line counts as a sentence!

Plan accordingly.</comment>


Ask HN: If you could restart your current project, what would you do different? - <AUTHOR> If you can explain why, it will be more valuable to readers. <comment><USER2> Use TDD methodology for getting clear picture of customer requirements. Get exact design and feture specification.

Have written agreement that any furthet change will be charged extra.

After that start write a code.

Instead of standalone app create web app with thin client for workstation.

</comment><comment><USER3> I might have written my last project in Python rather than Go. Go is a great language in its niche, but it's overkill for a run-of-the-mill web CRUD API on a low-traffic site. Flask or Django would have got the project done in half the time. The front end was in React, which was fun, but I was still climbing the learning curve and made a few mistakes I wouldn't have made today.

<comment><USER4> Same experience here. Prototyping in Python remains faster. The possibility to inspect variables on the go in a notebook are an invaluable feature of this programming language. Afterwards you can always implement the time critical components in Go.

</comment></comment><comment><USER5> Better structure, different (better/smaller) deps, and much different code I'll never do now that it works already. I'm thinking of re-doing the whole project once it can be called a `full` version, but that probably won't happen as 'hey, if it works...'.

</comment><comment><USER6> Probably add a couple more subdirectories. Now that I have a fair few files I want to go back in time and put the source under src/ (but at the same time I hate that). At least I had the sense to use some subdirs for slightly separate components. Also, I want to import some third-party code which needs to be kept somewhere.

</comment><comment><AUTHOR> My project is built with ReactJS. I'd have started with TypeScript I think. I'd like to switch but I bet there would be enough errors and pain not warrant the change at this point.

Everything else is pretty much OK.

</comment><comment><USER7> Write it in ember instead of php

<comment><AUTHOR> Care to elaborate?

</comment></comment><comment><USER8> vanilla Node.JS instead of Meteor, Vue.js instead of Blaze</comment>


Three vital commands every Docker magician should know - <AUTHOR> https://hackernoon.com/three-vital-commands-every-docker-magician-should-know-69214e80002b?source=linkShare-c253ef9822fd-1492791927 <comment><USER2> really, "magicians" is what docker users call themselves?

I mean, it fits: sleight of hand and misdirection used to make people think you're doing something amazing, but that's still a pretty obnoxious name. It's almost sandwich artist level obnoxious.</comment>


Node.js, redis backed guess the song app - <AUTHOR> http://binb.nodejitsu.com/

<comment><AUTHOR> It uses the Levenshtein distance algorithm to match guesses</comment>


The Dogs That Sniff Out Land Mines - <AUTHOR> http://modernfarmer.com/2014/06/dogs-sniff-land-mines/ <comment><USER2> Also see: APOPO, a Belgian organization training rats to detect landmines and tuberculosis.

[http://en.wikipedia.org/wiki/APOPO](http://en.wikipedia.org/wiki/APOPO) & [http://apopo.org](http://apopo.org)

<comment><USER3> Yes. Rats are cheaper to train, and light enough that they don't set off the mines.

</comment></comment><comment><USER4> There's a lot of really cool information here, especially for animal lovers. From the technical side of things, though, one part stood out: the dogs are more effective at finding mines? That's not something I exactly expected; though I suppose it makes sense. Dogs and their nose, like humans and their eyes are great pattern matchers. Humans are great at seeing and recognizing faces, and specific faces to a degree, better than humans, at least historically (we have put a lot of research into face recognition). I suppose the reason that dogs are so good at this is a similar reason.

<comment><USER5> There a smell from the explosives - it's quicker to cover an area for the smell-ee than with a metal detector. \</comment></comment><comment> "After a few months underground, almost all landmines leak vapours that betray the presence of explosives."

[http://www.economist.com/news/technology- quarterly/21603239-...](http://www.economist.com/news/technology- quarterly/21603239-clearing-landmines-despite-sophisticated-new-technology- many-explosive-devices-are)

<comment><USER4> Indeed, and it's awesome. It's just impressive that we can detect that odor better with dogs than with some sort of engineered odor detector</comment></comment>


President Obama: "Today is a big step in our march toward equality." - <AUTHOR> https://twitter.com/potus/status/614435467120001024

<comment><AUTHOR> Love is blind and should be allowed as long as it's not hurting anybody. I can't believe it was just 11 years ago since the first legal Gay marriage happened in United States.

But still, this makes me super happy, that a president would write something like this, so publicly. It gives me hope for the humanity.</comment>


42 Fallacies - <AUTHOR> http://blog.talkingphilosophy.com/?p=2139

<comment><USER2> Nota bene:

1\. Informal fallacies are highly sensitive to context. Even ad hominems can be valid under the right circumstances.

2\. In actual arguments, trotting out fancy-sounding fallacy names is rarely the correct play. You'll either be wrong and look foolish [1], or be right and look like a bully. It's lose-lose. Better to think of arguments like debugging: you need to explicitly step through the other side's statements, locate the problem(s), etc.

(These are general observations from a former rhetoric and argumentation teacher. They're directed at no one in particular.)

[1] Straw man, ad hominem, appeal to authority, and appeal to popularity seem to be the most common offenders.

<comment><USER3> I completely agree with you. On the other hand, good knowledge and understanding of them can be very useful when formulating ones own arguments.

But running around telling people their argument is invalid because it is X, simply makes one look like an ass.

</comment></comment><comment><USER4> Wow, this is pretty cool, thanks for sharing. Interesting to see a name put on all of these argumentative structures that pop up.</comment>


On Self-Publishing "A Programmer's Introduction to Mathematics" - <AUTHOR> https://medium.com/@jeremyjkun/on-self-publishing-a-programmers-introduction-to-mathematics-1472b7511c99 <comment><USER2> Hey Jeremy,

If you're reading this, firstly, thank you! It looks awesome and I have purchased this on UK Amazon to read over the Xmas period. Two points, though:

A) Please generate an HTML version of the Table of Contents and consider putting that on your site, rather than making me guess it's in "First Pages", download a PDF, etc. I think you'd find the return on investment on getting a landing page expert to create a mini-site for the book worth itself many times over...

B) Invest your first sales profits into getting someone to turn this into the epub or mobi your audience are asking for.

<comment><USER3> I thought he has replied about the difficulty and costly to do the epub and mobi due to maths questions in the OP.

</comment></comment><comment><USER4> Jeremy, thanks for this book. I bought it today and it's fantastic. I struggled with mathematics earlier in my career and being able to understand it through coding is immensely helpful.

As far as self-publishing goes, let's take inventory of the tasks the author had to do to get this book out the door:

      - editing himself 3x over
      - building out a latex template
      - graphic design for the cover and the website
      - "struggled" to find someone to review each chapter
      - build a mailing list of 2,000 people
      - make a website
      - lost steam / hit a wall, as is natural when working mostly alone
      - customer service

He could have gone with a traditional publisher to help some of these things, but then he'd get 15% (!) royalties, write in Word (ew), and still have to do most of the marketing.

I've written/produced about 6 self-published books (Fullstack React, ng-book, etc.) and I've got a system down for semi-self publishing books that deals with all of the above issues.

We'll help you:

      - research and outline the book
      - write the book in markdown or latex, using git, plus our custom tools for importing code (which are way better than copy and paste)
      - deal with the marketing / cover / branding / graphic design
      - review / edit the book and recruit beta readers
      - market the book to our (active) email audience of 100,000+ programmers
      - deal with customer service
      - for 50/50 royalties

Basically we'll make sure your book is good, it gets finished, and people buy it when it's done.

(The author of Fullstack Vue earned $20k in royalties on the opening weekend and was not even close to our biggest book.)

If you're thinking about self-publishing a programming book, I'd love to chat. See: [https://www.fullstack.io/write-a-book/](https://www.fullstack.io/write- a-book/)

<comment><USER5> Jashmenn, I just checked it out.. good work!

how about very niche topics? I self published a book on Ruby regular expressions last month on leanpub, currently working on Python version of it. Later I plan on command line topics like grep/sed/awk/perl/etc one-liners and stuff like that (I already have lots of material on these topics as tutorials on github, need to convert to books)

Selling is the biggest pain point for me

<comment><USER4> Absolutely. I'd love to do stuff on Bash in particular. Like many of us, I have a decades worth of bash commands collected too and I think editing those and teaching them to other devs would be super helpful.

Shoot me an email!

(For anyone else reading this, I'd also like to collaborate on a book about Rust, and another on Golang)

</comment></comment></comment><comment><USER6> "I listed the book at $35 for the paperback and $20+ for the ebook. (i.e., $20 or pay what you want above that)"

Jeremy, if you're reading this and want to share, did you find many buyers that opted to pay above the $20 baseline?

Thanks anyway for the blog post, it's interesting and useful. Myself, I've written a kids sci-fi novel, currently stuck in editing phase, and still figuring out what my publication vector will be.

Good luck!

</comment><comment><USER7> To the author: I just bought the book and skimmed a chapter whose topic I have studied. It seems pretty helpful for me, and it would be awesome if you did a second part that's more advanced and/or covers more topics. Thanks

</comment><comment><USER8> For what is worth, I try to buy systematically all books in hard-copy that the authors put available online for free. I have spent thousands of euros that way (printed GNU Manuals, math lecture notes, etc). In your case, I would not buy this book because it is not freely readable. I guess my case is not very representative, but I throw it here anyway.

<comment><USER9> You're criticizing the author for not making the ebook freely available? You only buy books for which you can obtain the ebook for free? I'm lost.

<comment><USER8> > You're criticizing the author for not making the ebook freely available?

Not at all.

> You only buy books for which you can obtain the ebook for free?

Yes, I do.

<comment><USER9> On reflection I think my comment sounds rather thoughtless. You clearly have an interesting philosophy. Could you explain it a little more? You say

> I just want to encourage the practice of authors allowing everybody to read > their books.

And yes, that would be great. You're hoping for a world in which essentially voluntary paid contributions (e.g. for paper books) is sufficient incentive for authors, correct? I say essentially voluntary because in your world an electronic copy would be available to everyone for free.

My main question is: how far do you depart from the conventional incentive structure of capitalist/market-based societies? Do you think food should be free, also paid for by voluntary monetary or in-kind donations? Or only digitally-encoded information? Can you explain why information as a commodity should be treated differently?

<comment><USER8> Nothing too deep. I just loved the idea from this book : [http://www.inference.org.uk/mackay/itila/](http://www.inference.org.uk/mackay/itila/) , where you can download even the .tex source and compile it yourself (and read the tex comments, they are great fun!)

Then I bought a few copies of this one, and I found that there are many books of the same kind. I enjoyed the concept and decided to buy all such books that I found (and ask my library to buy one or two copies as well).

> My main question is: how far do you depart from the conventional incentive > structure of capitalist/market-based societies?

LOL, this is just a silly criterion of mine for buying books. Do not read too much into it. By the way, it acts as a _great_ filter: authors who are obsessed in spreading their knowledge no matter what, tend to write very interesting things.

<comment><USER10> Hello! A tangential question: how did you manage to compile the book yourself? I find many errors that are hard to track down and Im not sure if its due to missing custom packages.

</comment></comment></comment></comment></comment></comment><comment><USER11> Great initiative. After a quick read-through of the preview I've decided to buy a hard-copy. Looking forward to reading it all.

</comment><comment><USER3> Bought the book. My first maths book after the one bought by father in 1977 titled "elementary set theory". Hope this one is better.

</comment><comment><USER12> Thanks for the book. How does it compare to 'Math for CS'.

</comment><comment><USER13> Hi I just bought the book. Have you got other formats?</comment>


Venezuela tells CNN journalists to 'get out' - <AUTHOR> http://www.cnn.com/2014/02/21/world/americas/venezuela-cnn-journalists/

<comment><AUTHOR> Apropos of this story to HN: [https://news.ycombinator.com/item?id=7274277](https://news.ycombinator.com/item?id=7274277) I reiterate how challenging it is to provide accurate and up to date coverage in a country with a functioning government, that doesn't want you there. For decades it was impossible to get any stories out of the Soviet Union with any reliability.

</comment><comment><USER2> The joke's on Venezuela: the journalists have already left CNN.</comment>


CSS vs. JavaScript animations - <AUTHOR> https://developers.google.com/web/fundamentals/look-and-feel/animations/css-vs-javascript?hl=en <comment><USER2> Years ago, I thought, why we should use css animations? Because it can let GPU works best with animations.I don't know is this true for today.</comment>


T-Rex runner Chromium source-code - <AUTHOR> https://source.chromium.org/chromium/chromium/src/+/master:components/neterror/resources/offline.js;l=7?q=t-rex%20package:%5Echromium$&ss=chromium <comment><USER2> You can play this game at any time by going to chrome://dino</comment>


Ask YC: Does anybody enjoy unit testing their code?  - <AUTHOR>

Is it just me? I don't know if I'm just particularly cranky today. After a major refactoring of our app I find myself drained out with unit testing every minor change. Ugh I wish VIM had some automatic unit testing suite similar to some major IDE's...anyone else share my rant? <comment><USER3> I really do enjoy unit testing.

Before I got the bug, I was wary of refactoring and adding new features. I would do a few simple tests when I originally wrote the code to satisfy myself that it worked. But then if I'd change the program flow or move things around, the benefit of that ad hoc testing was now lost, and I'd have to do it again.

Unit tests make me feel confident that the stuff I've got really works, even after I've modified it substantially. I'm a lot more likely to make big sweeping improvements because of it.

<comment><AUTHOR> Your right, but dammit I think I'm just too damn lazy to write and test unit tests. I think that's my main problem...I'm lazy :-)

<comment><USER4> But that's exactly the point. You can be MORE lazy. You spend so much more time than you realize testing and re-testing your own code... doing monkey- level QA! Stop doing all that work. Be more lazy. Write your tests first!

<comment><AUTHOR> Ha ha I guess you're right! Test Driven development right? I'll try to make some time for it.

</comment></comment></comment></comment><comment><USER5> I do. I used to consider it a necessary evil - I hated unit testing, but I hated _not_ unit testing more. But then I started using the green bar as my first indication that the code _works_. Everybody likes seeing their code work, so naturally I liked seeing the green bar. I'd just write a test and have it pass instead of running the program.

(Naturally, I'd run the program afterwards to make sure it _really_ worked - but if it didn't, I could just consider that a bug in the tests, write the test, fix the code, and close the bug. Everybody likes closing bugs, so there's the reward...)

Doctest is great too, since it's pretty common to use the Python interpreter as the first indication that your code works. Then you just paste the session transcript into the docstring, and you're done.

<comment><AUTHOR> Hang on what green bar are you talking about? is that a feature of your IDE or something?

<comment><USER6> He is talking about an IDE feature that indicates that, well, your test passed!

[http://www.eclipse.org/ajdt/EclipseCon2006/shots/junitTestsP...](http://www.eclipse.org/ajdt/EclipseCon2006/shots/junitTestsPassing.png)

The idea is that you write a few lines of code, test it (most likely you'll get red), and you keep fixing your code until you get green, and only then you proceed to the next task.

As far as I know, it started with jUnit on Eclipse, and then others implemented the concept on other languages / IDEs.

<comment><AUTHOR> Sweet....is there something similar for VIM?

<comment><USER7> In emacs they call this general capability 'flymake', I think. Perhaps that+google will get you what you want.

</comment></comment></comment></comment></comment><comment><USER8> I tried it for a few weeks. I got mildly test infected, but I don't do it anymore.

I found unit tests are most adequate for the parts of my code I'm the most confident about anyway (i.e., the functional parts). Testing side-effects intensive code (e.g., games) can be done and the discipline can improve your design skills and taste. But it can also drag you into boilerplate addiction and architecture astronautics.

But what really keeps me from writing unit tests is that they are a hindrance for the types of changes that scare me the most: those that introduce far- reaching changes to the interfaces between parts of my codebase. Those kinds of changes force you to rewrite your tests anyway. Thus, they add a cost and a mental barrier without offering the desired confidence in the transition (in a way, tests and code 'validate' each other; part of that confidence is lost while you are refactoring your tests).

To summarize: they help where I least need it, and they are a net hindrance where I'd need their help the most.

I don't do pacemakers or financial software, so I'd rather get the occasional bug during development, and use heavy human testing before release.

I said something on these lines a while ago here:

<http://news.ycombinator.com/item?id=46284>

</comment><comment><USER6> I hated unit testing until I learned this practice:

<http://www.extremeprogramming.org/rules/testfirst.html>

Since then I really enjoy writing unit tests. It really changed my mindset. Unit testing is more about design rather than testing itself.

<comment><USER9> I also like test driven development.

6 reasons to develop your tests first: <http://www.lispcast.com/drupal/node/6>

</comment></comment><comment><USER10> doctests are one of the many reasons I use django. It could not be easier

[http://www.djangoproject.com/documentation/testing/#writing-...](http://www.djangoproject.com/documentation/testing/#writing- doctests)

I never did testing until my current app and it has made my life much easier.

Especially when working in a group they're a great way to verify that your parts are working the way someone else needs them to work. It means you both don't have to go chasing after what's wrong.

</comment><comment><USER11> One thing that that I don't like about unit testing is it can give you false positives that everything is working correctly.

When you follow the red-green pattern and write the test, have it fail, then write the code to make it pass, I find that my brain is thinking the same when I write the test to when I write the code. So as a simple example if I write a test that says add(2,2).should == 5, it fails since there is no add() method. I then quickly write the add method to allow the test to pass and I am happy that I get a passing test even though the logic is incorrect. Obviously this is an over-simplification, but I have experienced situations that have some resemblance.

I can't say I always agree with the laziness argument. I can't even count the number of times it would take me only a few lines of code to get something done, but writing all the unit tests increases the amount of time to complete the task by a factor of 10. Other times the tests are easily saving me hours in a day. So it depends on exactly what they are testing and how they are doing so.

I am not saying I don't like them all the time, just sometimes :)

</comment><comment><USER12> I know some people who enjoy testing other people's code as a challenge: "lets see what happens when I enter a negative number of days/make an employee their own boss/paste word.exe into that text field..."

<comment><USER13> The first job I had after college, I remember playing around with my company's online commerce software. I found out I could enter a negative number of items to purchase and my total cost would be negative. Or, I could buy 1.537 dresses.

Amazingly, no one else knew this. (That probably should have been a big red flag for me.)

</comment></comment><comment><USER14> It depends very much on the environment.

If I'm using Python, I'm happy because it has built-in testing modules I can count on.

There are also cases where Python unit tests are worthwhile for other languages. For instance, I've subclassed unittest to quickly run and diagnose arbitrary Unix programs in isolation, and further subclassed it to help launch specific compiled programs under test.

If I join a team where someone has already done the work of setting up a reasonable test infrastructure, adding and maintaining tests is often OK.

But anything starting from scratch, count me out. :) Sometimes you're thrown into a semi-mature C++ project where they weren't making modules "testable" from the start, and that's way too much effort to retrofit.

</comment><comment><USER15> As the comments here show, people tend to come down on unit testing in a binary way (love it or hate it). Like a lot of things in software, especially in software process and double-especially when consultants and authors are involved, it became a religious question. Advocates insist up and down that they love it, it saves time, it's all good. But it's not _all_ good. Unit testing has benefits and it also has costs: you have to write the tests and you have to maintain them. The cost of an entire second codebase is hardly insignificant. So the rational question to be asking is whether the benefits exceed the cost, or rather, when they do.

My experience is that it depends on things like language, environment, and team. I've written many thousands of unit tests in C# and Java and trained quite a few people to write them, too. But when I began working in Common Lisp, I was surprised to find that didn't need them as much. I write and test my code by evaluating expressions in the REPL and I mostly write functional code without side-effects. This turns out to yield many of the benefits of unit testing without many of the costs. The overall tradeoff becomes different, making unit testing less valuable, except in targeted places. Other things that in my experience increase the overall benefit of unit testing include OO designs, larger teams, and corporate environments.

How much I enjoy writing unit tests depends on my gut feeling of whether the benefits are exceeding the costs. If I'm struggling with a tricky algorithm that I want to work out a bunch of examples for, I enjoy writing unit tests very much because they're helping me solve my problem. But if I'm going through the motions of updating a bunch of unit tests that aren't relevant to what I really want to do (and this happens a lot on larger XP projects despite what the advocates say), I don't enjoy it.

</comment><comment><USER16> I love it. But I only have, like, two tests, so it's not very useful.

Honestly, I've only recently started writing tests, and so it doesn't impact my code very much, but it's awesome for being able to know that a function change is doing what I think it's doing. Just tonight I added a new regex to a function that generates a "safe" string for using as an ID for DOM elements, and being able to test it from the command line--and see just the relevant output--rather than reloading the page several times and search for the converted string, saved me several minutes.

I'm a fan. Just need to add more tests.

</comment><comment><USER17> I hate it but I still try to force myself to do it. It really, really helps to find bugs if refactoring or a new feature breaks something, so it's a necessary evil. I call it evil because unit-tests themselves have to be written and debugged, which takes time. I believe I should just practice more, so that I could write them incredibly quickly, then they won't suck.

</comment><comment><USER18> I have been using Behavior driven development (BDD): <http://en.wikipedia.org/wiki/Behavior_driven_development> This has made unit testing more intuitive (and fun) for me. Specifically, I have been using RSpec, <http://rspec.info/> , which is an excellent BDD framework for Ruby. I am not a purist who first writes the tests(behavior's) before writing the actual code. However, my experience has been that it is important to eventually have thorough unit tests for your code to ensure that your application is more robust. It allows you to add new features with greater confidence.

</comment><comment><USER19> Yes, I think it's fun and particularly important.

Especially TDD.

You end up writing code that looks very similar to real code that will use your soon-to-be API.

You will design a better API this way, because you're looking at it from the user's perspective.

</comment><comment><USER20> Yes and no (is there ever any other answer?)

I enjoy unit testing when it all lights up green and I'm doing TDD. What I don't enjoy is retrofitting unit tests to my code. Time spent debugging the unit tests themselves (when I know the code is ok for at least a small value of "working") always feels frustrating and wasteful.

I find that TDD doesn't work well for exploratory programming where I'm feeling my way around a new library, or trying to work out a satisfactory architecture for a new component.

It's well worth it for future maintainability but certainly sometimes it is a chore.

</comment><comment><USER21> Even aside from support pretty unit testing, having a good tool for automating the generation of test cases makes a world of difference. [http://www.haskell.org/haskellwiki/Introduction_to_QuickChec...](http://www.haskell.org/haskellwiki/Introduction_to_QuickCheck) for example is a great tool that allows for pretty expressive specifications and counter example generation

</comment><comment><USER22> I find that by building a test, I get to know what the code is doing and why better than any other way. It's a great learning experience.

Also, while thinking and building about a test, I think of simplifications and new features to add. Why? It's because technically, a test actually _uses_ the code. If you and your code are friends, prepare to become lovers.

</comment><comment><USER23> Yes. It's kind of funny and rewarding to get positive feedback and see that the code runs as expected.

</comment><comment><USER24> I absolutely loathe writing them, but that's easily overcome by the sense of relief I get at being able to extensively test my software with a single automated script.

Automated regression testing while I enjoy a coffee at the local cafe? That's a win!

</comment><comment><USER25> Nope. Hate unit testing. Never do it. Makes me more invested in my existing code so I'm less likely to throw out previous versions.

<comment><USER19> So, you throw away previous versions without knowing that your new code actually works with your existing integration points?

Ba bow.

<comment><USER25> There's a difference between checking that the code works overall, and checking that each individual component works.

Anyways, I realize I'm in the minority (in many ways..), but I find that if I have a crapload unit tests, then I'm more inclined to not want to change how something works (because then I'd need both new code AND new unit tests - <USER2> everything).

To me, that's a bad thing

As an aside, is there any studies that show that the proliferation of unit testing in the last few years has actually reduced the number of bugs and/or decreased development time _overall_?

</comment></comment></comment><comment><USER26> You should take a look at test driven developmnt e.g. write the test first then code.

</comment><comment><USER27> test-second can be kinda boring sometimes.

test-first is more fun.

<comment><USER28> I find this to be very true, writing the tests at the beginning is exciting because you get to see what your code is going to accomplish. Then filling in the code to pass the tests is exciting because you're working toward a very clear goal with a very clear payout. Best way to work, imho.

<comment><USER29> Fastest way to work, too, since you figure out in advance specifically what you're trying to accomplish. It helps avoid YAGNI syndrome (<http://c2.com/xp/YouArentGonnaNeedIt.html>)!

<comment><USER28> Right! It's almost as fast as writing code a second time after you accidentally rm it into oblivion! Thanks for that YAGNI page, makes a lot of sense.</comment></comment></comment></comment>


Ask HN: Should I use SwiftUI or UIKit for a new iOS app in 2020? - <AUTHOR> My company [1] has been developing an iOS app for a few months and want to launch in the fall. We've been using React Native for prototyping, but decided to go fully native moving forward (our usage of custom native modules played a part in that decision). We're really on the fence regarding which UI framework to choose. What's your experience? What would you do in our situation? Would you pick one over the other? Use a little bit of both?<p>Relevant context:<p>• we're starting from scratch (no legacy codebase)<p>• only supporting iOS 13+ is fine<p>• execution speed matters, but we care deeply about UX and we're playing the long game<p>• we're mostly "full stack" devs, although we are actively looking for an iOS engineer<p>[1] https://www.nabla.com/ <comment><USER2> Hey Martin, I was looking into this to understand current landscape of iOS development. Found this[0] very detailed post about SwiftUI vs UIKit - HTH. When you do decide, do you mind posting about your decision and rational as well? In addition what made you decide against ReactNative and going fully native?

[0] [https://medium.com/@SteelKiwiDev/swiftui-vs-uikit- benefits-a...](https://medium.com/@SteelKiwiDev/swiftui-vs-uikit-benefits-and- drawbacks-6a540cced684)

</comment><comment><USER3> I'm also wondering if it's more strategic to have the top level (navigation etc.) in SwiftUI and lower levels in UIKit, or the reverse?

</comment><comment><USER4> For your company, SwiftUI no brainer. Regards to Yann if he ever drops by your Paris office. Anonymous with a long long experience in iOS.</comment>


Trout Tickling - <AUTHOR> https://en.wikipedia.org/wiki/Trout_tickling <comment><USER2> Ha! My dad can do this. People always call me a liar when I tell them about the technique. It's all about patience and wile.

When my dad sets out to do it what he'll do is find a stream and walk along the banks but a good 10 feet back watching for fish. When he sees a fish he'll go down stream a bit and then crawl up the bank slowly and quietly. When he draws just behind the fish he'll put his hand in the water and ever so slowly work his hand up under the fish, tickling its belly as he goes. Once he gets up to the front he slips his finger into its gills and pops it out of the crick onto the bank. He makes it look easy. You can then dump the fish back into the crick.

<comment><USER3> Fantastic story, thanks sharing. Wonder who discovered this first? One of those strange human achievements. Also, we should call you Danny.

</comment></comment><comment><USER4> I learned to do this 5 years ago as part of a wilderness survival program. I was highly skeptical at first, but it was much easier in reality. I believe the practice is banned in most states because it is so effective at catching fish.

<comment><USER5> How bizarre that such a primitive technique could be banned. You'd think elaborate fishing lures and rods would also be illegal if using your hands is wrong.

</comment></comment><comment><USER6> I guess it's a form of tonic immobility. Which reminds me of one of the oddest things I've ever seen on TV. This young lady who appeared on Letterman who immobilizes lizards and then dresses them up and poses them.

[https://youtu.be/v6yuEuvXOnA](https://youtu.be/v6yuEuvXOnA)

</comment><comment><USER7> Surprisingly discussed once before, in 2015: [https://news.ycombinator.com/item?id=10527891](https://news.ycombinator.com/item?id=10527891).

<comment><USER8> The fact that you knew that really tickles my trout.

edit: that sounds dirtier than I intended, but I still like it as a cliche.

</comment></comment><comment><USER9> >The practice is currently illegal under most circumstances in Britain.

why? i mean i understand when for example explosives or highly maiming (while not very efficient at actually catching) types of hooks, spears, etc. are banned, or nets. What is wrong with tickling?

<comment><USER10> I think the reason is it's easy to do without a fishing license. That's why poachers would use this technique - if they get caught by the authorities there's no incriminating equipment, they just claim they were going for a walk.

Fishing rights in the UK are very strictly protected. The are many places where the public can walk along a river but are not allowed to fish.

<comment><USER11> Plus you need a government (Dept of Environment) supplied rod license to fish at all [1]

[1] [https://www.gov.uk/fishing-licences](https://www.gov.uk/fishing-licences)

<comment><USER12> "You need a rod fishing licence to fish for salmon, trout, freshwater fish, smelt or eel with a rod and line in:

England (except the River Tweed) Wales the Border Esk region of Scotland You must always carry your rod fishing licence when you're fishing or you could be prosecuted."

That licence is for fishing with a rod or line, might tickling still be legal?

</comment></comment></comment></comment><comment><USER13> My dad always claimed to have tickled trouts and I was always suspicious of this claim. At least I know now that it's possible.

<comment><USER14> When we were children, my aunt used to take us to a trout farm to get dinner.

The farm owner taught us to tickle and the trout we took home were always caught that way by us.

It was a lot easier than tickling in a trout stream, they were in ponds, but fun for pre-teen children nonetheless.

</comment></comment><comment><USER15> Ok, where the heck did I see trout tickling in the last couple of days? I want to say it was the biography of Montaigne, something about _The Compleat Angler_.

</comment><comment><USER16> The response I got from my wife when I asked her if she has ever heard of trout tickling is priceless.

(Gasps) "hunny, it's the middle of the afternoon!"

</comment><comment><USER17> Is this surprising? It's almost a trope in fantasy and historical fiction.

The one that I find nutty is noodling for catfish. That's one of those cases where you wonder who was the first to decide that was a good idea.

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

<comment><USER18> +1 was thinking about this happening in Wheel of Time at least once, and definitely in some other fantasy series I've read. It's got that feel of old- timey-ness that just feels right for a tension breaking scene (like splitting wood, stoking fires, playing dice, and moving through a forest without stepping on sticks)

</comment></comment><comment><USER19> It'd be really hard to get that close to a trout and I'm calling bullshit on this.

Wait, what do u know, a bunch of videos of trout ticklers on YouTube. Thx internet.

<comment><USER11> Yeah, I've fly-fished for 20+ years now, and if I hadn't seen this on TV I wouldn't have believed it either. Trout are skittish things.</comment></comment>


How to change symlinks atomically (2005) - <AUTHOR> http://blog.moertel.com/posts/2005-08-22-how-to-change-symlinks-atomically.html <comment><USER2> Ah, yes, atomic file system operations in UNIX-like systems.

May not be available for your operating system variant. May not be available for your file system. Not applicable to some remote file systems. May not function properly in some virtual machines. Consult your storage area network vendor for additional information.

<comment><USER3> Yeah, it's another one of the many things that the Windows kernel gets right but *nix programmers never care to give it credit for. `FILE_LINK_INFORMATION` in Windows has a `ReplaceIfExists` flag just for this purpose.

<comment><USER4> It's funny how you name Windows kernel in a comment about symbolic links, considering that it _misses_ symbolic links.

<comment><USER5> [https://en.wikipedia.org/wiki/NTFS_symbolic_link](https://en.wikipedia.org/wiki/NTFS_symbolic_link)

<comment><USER6> These things are called symbolic links, but are not what UNIX calls a symbolic link. The name is unfortunate and perhaps cannot be helped.

<comment><USER7> What's the difference? Because MS claims it has created them "to function just like UNIX links", and I'm not seeing how they're wrong.

<comment><USER6> On UNIX, anyone can create a symbolic link, and a symbolic link can contain arbitrary text, while Windows requires admin privileges and that the target be a valid file path.

The new WSL _does_ have symbolic links, but these are only available to Linux programs.

<comment><USER7> The admin privileges is just the default security policy, you can configure it to allow regular users.

<comment><USER6> That is really bad advice.

An application should not change the default security policy.

<comment><USER7> I'm not saying it should. I'm saying it's not a property of the symlink feature. Some Linux distro could implement the same policy, but symlinks would still be symlinks.

<comment><USER8> No, it cannot be disabled via a policy in Linux, because it is regular FS operation, not a filter.

<comment><USER7> Sure it could, SELinux policies can operate on regular FS operations just fine.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> This is just an accident of how some file systems are implemented and isn't actually garunteed. If you did this on xfs you could still end up with the a 0 length symlink if you crashed at just the right time.

<comment><USER10> xfs doesn't guarantee atomic renames in the same directory?

I thought that requirement was from POSIX.

Does xfs not conform to POSIX?

<comment><USER9> The rename is atomic, the data being in the file is the problem, there is no garuntee unless you fsync.

<comment><USER11> Sorry, would you mind clarifying? "The data being in the file"?

The way I understand the article's proposal is this:

1\. Create new symlink pointing to desired file (assumed to already exist in a stable state).

2\. Move new symlink over old symlink.

<comment><USER12> Symlinks are just special files with a the contents being the link contents. His argument is that it is not atomic when considering a server crash. But I don't think that matters anyway.

<comment><USER6> Symlinks are not files, they do not have inodes and you cannot open them to fsync their contents.

They exist as _directory entries_ with a small in-directory content only, thus syncing the directory they exist in is sufficient to persist them.

<comment><USER7> Symlinks do have inodes, and their content (the link information) will be stored in that inode structure, if it fits, not in the directory.

See e.g. [https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Symb...](https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Symbolic_Links)

<comment><USER6> Sorry, you're right, however this is an implementation detail, and nothing to do with POSIX which did not define any use for the `d_ino` field for a symbolic link[1]. I think this is made unnecessarily difficult by Linux/ext4 calling something an "inode" that is not what UNIX traditionally called an inode (or what POSIX calls a "file serial number").

I think it is more useful to think of the symbolic link as "inside" the directory it is in, because this tells the programmer what to do (and what to sync: the directory).

[1]: [http://pubs.opengroup.org/onlinepubs/009695399/functions/rea...](http://pubs.opengroup.org/onlinepubs/009695399/functions/readdir_r.html)

<comment><USER13> An inode, traditionally, is the per-file data structure on disk (or in memory) that contains the user/group IDs, file type (plain/directory/device/etc; not jpeg/png/executable/etc), permissions, file size, and the location of the content (either a list of block numbers, or the address of a block containing the list if it wouldn't all fit into the fixed-size inode), among other things. These structures were identified by a number. This is an implementation detail not specified by POSIX.

A directory, historically (on systems with 14- or 30-character file name limits like we had in the 1990s, at least 4.2 or 4.3 BSD-derived), consisted of a file containing a list of (16-bit inode number, file name) structs, thus making a nice round 16 or 32 bytes per directory entry, evenly dividing a 512-byte block. On some older systems you could see this structure by opening and reading a directory with open and read (I think every system everywhere prohibited writes to a directory because modifying a directory would allow you to access files in unreadable directories, uncleanly delete any file given its inode number, etc). The only special thing about a directory on disk was that its inode said it was a dir, so the filesystem code would trust it as a source of inode numbers and otherwise use it as a dir.

Some of the 14-byte-name systems supported symlinks. As there was no space in the directory entry for anything other than an inode number, the link contents would have to be accessed through an inode. (I think I've heard of systems that could store very small file contents like typical symlink target names in the inode instead of allocating a data block, but can't name one).

The number you see in ls -i, which is sometimes called just the "inode" (and apparently also called the "file serial number"), is the number in the directory entry that's used to find the inode. I guess someone somewhere had or intended to have a system that could store symlinks in the directory instead of consuming an inode.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER14> As much as the Win32 API is criticised for many of its functions containing often-unused parameters, symlink() having a flag parameter to control whether to overwrite the original link's contents if it exists would've made this much easier.

<comment><USER15> You would need the extra parameter + the guarantee that the symlink syscall did the overwrite atomically. And I don't think proliferating such guarantees througought the API is going to end well.

In Unix we have this convention that `rename()` is our atomicity swiss-army knife. I guess it makes it easier for implementers to only have to make their strong guarantees for one system call (+ a few related friends like `renameat`).

Now you could argue that `rename()` is a bit too under-powered for this job, and maybe we want transactions or something. But NTFS tried that too and deprecated them.

What I would like to see in Unix is better support for anonymous files and directories. You could use this with things like `renameat()` so that the temporary never touches the filesystem and is automatically cleaned up if the rename fails.

<comment><USER16> > What I would like to see in Unix is better support for anonymous files and > directories. You could use this with things like `renameat()` so that the > temporary never touches the filesystem and is automatically cleaned up if > the rename fails.

Exactly. This approach makes the various calls orthogonal. Various syscalls create anonymous reference-counted inodes on a filesystem (which disappear when all references to them do), and syscalls like linkat or renameat or installs such an inode (referenced by file descriptor) into the filesystem with a name.

O_TMPFILE allows creating an anonymous file inode. Ideally, a syscall would exist to do the same for an anonymous symlink inode.

<comment><USER17> On GNU/Linux there's also the (badly designed) memfd_create() syscall which allows you to create an anonymous inode even if / is entirely read-only and you don't have mounting permission. While you could do it with a user+mount namespace and sending the fd over a UNIX socket, sometimes making a syscall is a better idea. :P

<comment><USER6> memfd_create() does not create an inode. It only creates a file descriptor.

With a file descriptor you can create multiple mappings to the same physical address -- something otherwise impossible on UNIX or Linux (although mach allows you to vm_remap[1] which is often sufficient).

[1]: [http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/vm_remap...](http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/vm_remap.html)

<comment><USER16> > memfd_create() does not create an inode. It only creates a file descriptor.

It creates both; memfd_create (and timerfd_create, signalfd, eventfd, userfaultfd, epoll, and others) use a kernel subsystem called "anon_inode" to create an in-memory inode to back the file descriptor.

<comment><USER16> (Minor correction: memfd_create creates an in-memory inode without using anon_inode, while the various other syscalls use anon_inode.)

</comment></comment></comment></comment></comment></comment></comment><comment><USER18> Some related articles:

[https://yakking.branchable.com/posts/moving- files-1-copying/](https://yakking.branchable.com/posts/moving- files-1-copying/) [https://yakking.branchable.com/posts/moving- files-2-sparsene...](https://yakking.branchable.com/posts/moving- files-2-sparseness/) [https://yakking.branchable.com/posts/moving- files-3-faster/](https://yakking.branchable.com/posts/moving-files-3-faster/)

</comment><comment><USER19> As a Python/web developer whose never written a line of production C/C++ code in his 16 year career, it's always humbling to stumble into these threads on HN.

<comment><USER20> I highly, highly recommend getting in the habit of consulting OS syscall documentation for stuff. The behaviour of the syscall determines most of the behaviour for this stuff in every language(few exceptions like stdlib buffering, etc). The linux syscall docs are pretty easy to consume even if you don't write C. "The Linux Program Interface" is an awesome book based on the man pages(by the main man page maintainer). Not sure what exists for Windows in the same vein book wise, but technet or something surely has what you NEED.

<comment><USER19> Thank you. I will check it out. I've been looking into the `select` call a little because I'm working with websockets, but I'm not sure if that's related to syscall. It's amazing what you can get away with _not_ knowing with computers nowadays. It doesn't necessarily mean you should strive for ignorance, of course.</comment></comment></comment>