Relative Line Numbers in Vim - <AUTHOR> http://jeffkreeftmeijer.com/2012/relative-line-numbers-in-vim-for-super-fast-movement/

<comment><USER2> For the Emacs users, check out <https://github.com/coldnew/linum-relative>

And for those with the melpa repository set up, it can be found as the "linum- relative" package.

</comment><comment><USER3> Is this a commonly known feature? Because I have never seen it before. I wish I had been introduced to it about 10 years ago.

<comment><USER4> I saw it in _Learn Vimscript the Hard Way_. I assumed it was common knowledge, since I couldn't see any other practical way to use 5j, etc, on a regular basis, but it's apparently less well-known than I thought.

<comment><USER5> Pre-vim, one would get quite proficient at judging line distances, e.g. 11yy, through practice. Mind you, that was probably helped by text being a fixed size on a serial terminal and bigger than much text today. However, I do wonder if the article is over-promoting movement by lines. Movement commands like ), }, ]], and good old / should be readily considered as well.

</comment></comment></comment><comment><USER6> Probably worth mentioning numbers.vim (<https://github.com/myusuf3/numbers.vim>) as an easy plugin to get the relative line numbers going in your vim setup.

</comment><comment><USER7> I used to use relative line numbers until I learned about dG. For example, I can use 8dG to delete from my cursor to (and including) line 8. Also works with yanking, e.g. 8yG.

<comment><USER8> Relative line numbers for LIFE! :D

d3j (delete 3 down) and y3j (yank 3 down) do the same things, but relative. I don't even need to look at the relative numbers anymore really. For short hops I just guess. I'm right most of the times.

<comment><USER7> Absolute line numbers are more convenient for me. Relative line numbers didn't give me any advantage after I learned about the G command. That command is also useful for going to the bottom of the file (G) or to the top of the file (1G). With absolute line numbers I don't have the line numbers changing all the time, which was distracting. It's also easier to open files at a specific line.

<comment> c-oreills gg will take you to the top of the file too

<comment><USER7> Thanks, learned something new.

</comment></comment></comment></comment></comment><comment><USER9> I recommend the EasyMotion plugin. It allows you to do this via ,j or ,k (assuming your leader key is set to ,). If you want to move to a specific character in a line you can also use the w/b and f/F motions (with a leading comma).

<https://github.com/Lokaltog/vim-easymotion> (there's an animated demonstration on the bottom of the readme)

</comment><comment><USER10> I have used (and like) relative line numbers for a while now. However, when using MacVim full-screen on large (high resolution) screens, the _relativenumber_ and _cursorline_ slow down redraws considerably on my Macs, to the point where it annoys me a lot.

Does anyone else have the same experience and perhaps a solution?

<comment><USER11> Yes! Usually it's not a problem, but every now and then relativenumber really kills performance.

The last time I noticed this was with valgrind logs; and I have no idea what exactly is causing it (amount of lines doesn't seem to be it).

Thankfully it's perfectly usuable for day-to-day editing. Binding :set rn! to a key circumvents this problem well enough.

</comment></comment><comment><USER12> Maybe this is not in spirit of VIM, but I set my key repeat to very low value. Minimal setting you can set through mac options is 83 ms - if you press and hold a key it generates a key press every 83 ms. I set up a key repeat to 25 ms through KeyRemap4MacBook (and delay until repeat 150 ms). If I want to generate 1-4 clicks I just press the key repeatedly, otherwise I hold a key.

After some time I got used to it and I can select blocks of text of size 5-10 faster than I would using movement with number (I don't have to move my fingers away, I don't have to calculate or look at the relative distance). Advantage is that it works well outside of vim as well.

</comment><comment><USER13> Rather than switching between rnu and nu, I simply have `set rnu` and absolute line number in my status line.

<comment><USER8> I use <line>G to jump to the absolute line. When you need absolute numbers it's mostly because of an error that gave you a line number. You need to jump to it, that's all.

<comment><USER14> Also :<line> will do that.

</comment></comment></comment><comment><USER15> "Most testing libraries allow you to run a subset of tests based on their line number by running something like rspec spec/models/user_spec.rb:15."

This sounds... strange to me. When would this be an advantage over some sort of named test? e.g. `manage.py test Thing.validation_test`

<comment><USER16> > _When would this be an advantage over some sort of named test?_

Never. "Line number" is _very_ obscure and prone to breaking. "I just added a comment at the top of the file... Whoops! Broke all the tests."

To quote the Zen Of Python—"explicit is better than implicit".

The article is a bit old so I wonder if that is still a common Ruby practice (if it ever was).

<comment><USER17> Rspec tests aren't simply named "Thing.validation_test", they are generally full sentence descriptions of what the functionality is (eg. "A User that belongs to a valid and paid account should allow creation of projects").

The only time I've ever run specific tests by line-number is when I am working on making that single test green. In cases like that the line-number hardly ever changes (if it does, its because I've modified before filters or added a new `let`).

edit: for a bit more context: that entire string would not be typed in for the single test, it would be built from contexts.

        describe User do
          context "belongs to a valid and paid account" do
            it "should allow creation of projects" do
            end
          end
        end

</comment></comment></comment><comment><USER18> Step 1: Install <https://github.com/tpope/vim-unimpaired>

Step 2: Use the convenient 'cor' mapping for toggling 'relativenumber'

Step 3: Marvel at all the other super handy mappings contained within.

</comment><comment><USER19> Vim 7.3.918 (the version I have installed here on Arch Linux) shows the absolute number of the current line, along with relative line numbers for the other rows. No need for such toggle functions.

</comment><comment><USER20> Relative line numbers may be useful at first, but they quickly show their limitation when one needs to jump to a specific line.

<comment><USER20> Excuse me, I meant _when one needs to know in which line he is_.

<comment><USER21> You should upgrade to patch 787 or above if you can:

<http://i.imgur.com/xJ4r75B.png>

</comment></comment></comment><comment><USER22> spf13 is a great plugin bundle for vim that got me started using relative line numbering. It's great for the lazy person who doesn't want to bother setting up all the fancy vim plugins and settings.

<https://github.com/spf13/spf13-vim>

<comment><USER21> Lazy persons get the crap they deserve with SPF13.

<comment><USER23> Polite translation: Take the time to learn how to setup vim yourself and it will reward you 10 fold.

<comment><USER21> Haha. Yes, that's what I meant. Thanks for your help.

I see two slightly overlapping trends:

1\. Alice is intrigued by all the fuss about Vim and tries her best to wrap her head around it by reading online material and "The Fucking Manual" and getting her hands dirty. Because she knows that she can't be as productive as with her previous editor in an afternoon, she learns Vim on the side. Another benefit of that method (and one she doesn't know about at the moment) is that her commitment can be very light at the beginning: when she'll finally decide that Vim is not for her she won't lost anything. If she likes it her commitment will grow with time, as well as her ROI.

2\. Bob is a lot into Twitter, blogs, Reddit and HN and he noticed a serious slant of what he perceives as the elite toward Vim (and the screenshots are pretty) so he decides to follow the herd, however weird Vim might be He installs Janus/SPF13/YADR because he has to be a part of the elite right now, no time to setup all those plugins and stuff. After a couple of coderwall posts listing his favorite plugins, Bob will notice that the elite is moving toward Sublime Text, persuade himself and try to persuade others that Vim is too old and, finally, switch.

The two trends are slightly overlapping because a few Bobs are going to turn into Alices along the way. Thankfully, because who wants Bobs in his community?

For the record, I'm a Bob turned Alice.

<comment><USER3> I came to vim as an Alice. Everyone swore by vim, so I thought I should learn it, despite it being kinda _fiddly_ for a text editor. It took me another couple of years to switch over completely, a couple more before I started to actually enjoy using it, and a couple more before I started to care about being efficient with my keystrokes.

Once you drink the cool-aid, there's nothing quite like it. Sometimes I think that scooting around a text file in vim is my favorite thing about coding.</comment></comment></comment></comment></comment>


Insomnia Evidence Review Summary - <AUTHOR> https://www.insomniawiki.org/ <comment><USER2> A better title would be "A Summary of Studies of Insomnia _Treatments '_ Efficacy"</comment>


The Case for a Falling Dollar - <AUTHOR> https://www.economist.com/finance-and-economics/2019/11/14/the-case-for-a-falling-dollar <comment><AUTHOR> [https://archive.is/6Um7j](https://archive.is/6Um7j)</comment>


Dragon was destroyed just before the firing of its SuperDraco thrusters - <AUTHOR> https://arstechnica.com/science/2019/05/dragon-was-destroyed-just-before-the-firing-of-its-superdraco-thrusters/ <comment><USER2> For anyone wondering how this will affect the launch schedule, from the article:

Before this accident, SpaceX and NASA had been targeting early October for the first crewed Dragon mission to the station. Now, that will almost certainly be delayed by at least several months into 2020. At Thursday's news briefing, Koenigsmann said the schedule impact will depend on what the investigation turns up. "I hope this is a relatively swift investigation at the end of the day," he said. "I don't want to completely preclude the current schedule, but certainly this is not good news for the schedule."</comment>


Why is processing a sorted array faster than an unsorted array? - <AUTHOR> http://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array/11227902#11227902

<comment><USER2> This is one of the classic posts here:

[https://hn.algolia.com/?query=Why%20is%20processing%20a%20so...](https://hn.algolia.com/?query=Why%20is%20processing%20a%20sorted%20array%20faster%20than%20an%20unsorted%20array%3F&sort=byPopularity&prefix&page=0&dateRange=all&type=story)

Very good comments in some of the submissions

</comment><comment><USER3> For completeness, a) make the array very big (much much bigger than the LLC) b) split the work amongst cores (make it parallel with your favorite methodology)

</comment><comment><USER4>
      int t = (data[c] - 128) >> 31;
      sum += ~t & data[c];

> They've gone to plaid</comment>


Show HN: Senryu.pub, a simple content platform focusing on reader experience - <AUTHOR> https://senryu.pub <comment><USER2> I'd be very happy to receive any feedback you might have. I've been working on this for the past month and holding back on showing it around until it was basically usable. There's some details about the current state on this post: [https://senryu.pub/blog/articles/development- roadmap](https://senryu.pub/blog/articles/development-roadmap)

In reality I've just been building it for myself, but if it scratches my itch then maybe it'll work for other people as well :)</comment>


Please wear a mask. - <AUTHOR> https://wearafuckingmask.com <comment><USER3> This is very concerning. At a time like this, a profanity laden website preaching to ignore virtually every established medical authority and "trust the free market" is dangerous and careless.

It is not the fault of the WHO that some national governments have had poor responses. And the supply chain that would 'flood' the market would take far longer than the incubation period to increase supply to give literally everyone on the planet a mask -- and that's ignoring the fact that normal economics are sort of suspended right now when everyone is locked in their houses and all non-essential businesses are being closed by government decree.

If you A) are sick and B) _must_ venture outside, then yes, wear a mask. Healthy individuals should not be doing so at this time, however.

<comment><USER4> Governments can also mandate production. It's not like they have to sit there powerless going "aw geeze, we have to let them price gouge or they won't make more".

</comment></comment><comment><USER5> I find this mainstream crass "dirtbag" culture as expressed through inordinate swearing to be really obscene and distasteful.

<comment><USER6> Pearl-clutching much?

I guess you need to up your dose of Lenny Bruce and George Carlin before your snowflakes wilt.

<comment><USER5> The context of making a joke in front of an audience is very different from presenting guidelines for a virus.

</comment></comment></comment><comment><USER7> From the site:

> Fucking governments should institute Fucking price controls and ration > Fucking masks

> That is a Fucking horrible idea. Price controls mean no Fucking incentive to > make Fucking masks. They mean people will waste Fucking masks and no one > will have Fucking masks. Take it from our experience in Hong Kong, rising > prices mean supply will soon flood the market.

Oh, wow. So many wrong things here.

There's an assumption that there's extra idle manufacturing capacity in the factories producing masks. This is doubtful in the extreme, they're selling every single mask they can already.[1]

We've seen this with the depletion of stocks of toilet paper - <USER2> ramped up production within days. The mask shortages have been for weeks now, anyone with any ability to produce masks, is already doing so at full rate.

What about standing up new manufacturing facilities, or retooling other types of manufacturing facilities? There's a huge amount of capital expenditure (let alone time) involved in such a thing. And this assumes that you can even obtain the equipment to do that manufacturing in a short period of time. I can't imagine there's a warehouse somewhere full of mask-manufacturing equipment.

There's no need for that capacity normally, so as soon as this pandemic is over, the need for that extra capacity will disappear.

Is there any medical expert who believes that this situation won't be resolved (one way or another) within a year?

All that we achieve with completely free-reign/uncontrolled market in this situation is to allow exploitation of the needy. As we saw with multiple cases over hand sanitiser, toilet paper and wipes.

[1] [https://www.wired.com/story/surreal-frenzy-inside-us- biggest...](https://www.wired.com/story/surreal-frenzy-inside-us-biggest-mask- maker/)

<comment><USER8> In that interview it does seem that there's spare capacity and that the CEO simply doesn't wish to be burned by misreading the market as happened before in company history. The CEO goes on to note that he has warned the national government many times, and that an urgency on their part is no emergency for him.

> anyone with any ability to produce masks, is already doing so at full rate.

<comment><USER7> The wired article doesn't go into too much detail - I forget which one I read that went into a bit more detail, but NPR has more information[1]

It's clear that he doesn't have any additional capacity to turn on.

[1] [https://www.npr.org/sections/health- shots/2020/03/05/8113874...](https://www.npr.org/sections/health- shots/2020/03/05/811387424/face-masks-not-enough-are-made-in-america-to-deal- with-coronavirus)

</comment></comment></comment><comment><USER9> It's not enough to wear a mask. More than 90% of the people I've seen wearing a mask are doing it wrong.

So if you're wearing a mask, at least do it correctly.

[https://www.who.int/emergencies/diseases/novel- coronavirus-2...](https://www.who.int/emergencies/diseases/novel- coronavirus-2019/advice-for-public/when-and-how-to-use-masks)

<comment><USER10> >Replace the mask with a new one as soon as it is damp and do not re-use single-use masks.

I can't find a place to buy a mask in my city, so all those rules work only in an ideal situation.

In reality, people are buying and selling musky online for profit, which in my opinion should be illegal.

<comment><USER11> > all those rules work only in an ideal situation.

If you cannot follow all the rules for PPE you increase, not decrease, your risk of infection.

</comment></comment></comment><comment><USER12> Ehhh no. There is a huge mask shortage, leave the masks for the people that actually need them (hospital staff).

Just stay "the fuck" home .

</comment><comment><USER13> This is wrong!

Facemasks are scarce and in most countries they should be preserved for medical personal and infected people. If everybody wears facemasks all the time, the most endangered people will not have masks if they need them.

<comment><USER6> Moral panicking without fundamental knowledge doesn't mean anything. I hate to break it to you, but retail and medical supply chains doesn't have much overlap. Nurses and surgeons relying on scant mid-pandemic retail pharmacy supplies already indicates systemic failure and desperation. You're not going to solve any tragedies of the commons by lying to people or wagging your "think of the children" finger at people to push your misinformed agenda.

</comment></comment><comment><USER14> I am skeptical of those initiatives.

The usage priority should be to the ones that are sick and the medical professionals.

Using it indiscriminately won't help and it will harm availability to those who really need it.

</comment><comment><USER15> Fudge yeah, let's use curse words to spread misguided information and make things worse. The website feels like a DHH Tweetstorm.

Masks work if the sick people use them, (that is for the standard masks). For some reason people started to hoard those masks in Germany, leading to shortages in German hospitals, effectively meaning they can't do any surgeries right now other than the most necessary (also we see hospitals being robbed [0]). Also if you wear masks to protect yourself you would also need to cover your eyes. Which of course nobody does.

Germany is mostly not dense enough or has remotely enough confirmed cases to warrant broad use of masks. Social distancing and self-quarantine, hand- washing and general hygiene are far more effective measures without threatening the medical system. It's the same for other places.

[0]: [https://www.spiegel.de/panorama/coronavirus-diebe- stehlen-50...](https://www.spiegel.de/panorama/coronavirus-diebe- stehlen-50-000-atemschutzmasken-aus- klinik-a-3e88f8e3-1ef4-4fa5-a5f6-6545ae95d2e4) (German)

</comment><comment><USER11> I swear a lot. The swearing in this piece just isn't very good. It takes some skill to swear effectively, and this isn't it.

On top of that the author is simply wrong. Aerosolized virus is possibly one route of infection, but we know that there is a fecal-oral route for covid-19, and we know that touching surfaces and then your face can transmit covid-19.

PPE is difficult to wear correctly, and if you don't wear it correctly you normally increase, not decrease, your risk.

Public health experts in most countries are telling people not to wear masks (unless they have covid-19 and are self-isolating, or are healthcare professionals). This is only partly because there's a shortage. It's also because of the risks from improper mask use.

I've seen a few people wearing masks in public and _every single one of them_ did something stupid.

</comment><comment><USER16> There haven't been masks to buy for over a month now. People literally steal them from hospitals and warehouses.

</comment><comment><USER17> Another good DIY mask tutorial [https://www.consumer.org.hk/ws_en/news/specials/2020/mask- di...](https://www.consumer.org.hk/ws_en/news/specials/2020/mask-diy- tips.html)

</comment><comment><USER18> Stop posting this multiple times.

</comment><comment><USER18> Stop posting this multiple times

</comment><comment><USER19> They don't help

</comment><comment><USER20> What's a 'fucking mask' and why haven't I heard of this sexual practice before?</comment>


The Science Behind Coffee and Why it's Actually Good for Your Health - <AUTHOR> http://lifehacker.com/5986506/the-science-behind-coffee-and-why-its-actually-good-for-your-health <comment><USER3> Horrbily one-sided. Wikipedia's article has both ways coffee is good and is bad for you.

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

The important thing is that the dosage makes the the medicine of poison, and that while drinking two or three cups a day may be better for your health than not drinking coffee, drinking ten cups a day is bad for you.

<comment><USER4> Ignoring the specific number of cups for a moment, I like your discussion of dosage making something medicine or poison.

In medicine we say that drugs have a "therapeutic index". That is, there is some window in which the medication is more helpful than harmful. On the low side, there is just no effect. On the high side, toxicities dominate.

<comment> qu4z-2 Makes me wonder if there's anything with the opposite progression:

No effect -> harmful -> helpful

I'd guess not, but I'm curious as to why.

<comment><USER5> Overload /limitations to adaptation.

</comment></comment></comment></comment><comment><USER6> All rings true to me both from my intuition and personal experience, HOWEVER... They only briefly mention not to put sugar in your coffee. I think this is a gross understatement, when all I see everywhere is people walking around with bucket-sized cups of cream and syrup (plus a little espresso).

If anything, our consumption of coffee may have spurred the diabetes epidemic by encouraging people to indulge their cream and sugar cravings all day long, in a socially-encouraged and -reinforced way...

<comment><USER7> Use honey instead of sugar or syrup it is very good.

<comment><USER7> @drakim Yes IT is waaaayy better... (of course keep sane proportions) you can check several papers at pubmed. one here [1] [1] = <http://www.ncbi.nlm.nih.gov/pubmed/21310307>

<comment><USER8> Quoting the conclusion of the linked abstract: "These results suggest that in comparison with sucrose, honey may reduce weight gain and adiposity, _presumably due to lower food intake_ ,"

It seems like the rats on honey diet just ate less. I don't think this transfers to the honey as sweetener use case, where you'd use about the same amount of sugar compounds to reach desired sweetness level of the beverage.

</comment></comment></comment></comment><comment><USER9> Cool, let's just ignore the science of "coffee is bad for you" folks. Everything has to be so fucking simple now - it's either good for you or it's bad for you. Screw the other interacting variables.

</comment><comment><USER10> We each have 20k different genes and infinite combinations of genetics, environment, behavior etc.

But the good news is everything is binary - it is all either good or bad - <USER2> all of us.

</comment><comment><USER11> Interesting article and I do enjoy my one cup of coffee (with Splenda™, brown sugar and milk) per weekday _but_ . . .according to the article: __"Drinking coffee is associated with a drastically reduced risk of type II diabetes" and __"Coffee is associated with a much lower risk of dementia and the neurodegenerative disorders Alzheimer's and Parkinson's." and __"Coffee consumption has been associated with a lower risk of death in prospective epidemiological studies, especially in type II diabetics."

Being "associated with" is pretty meaningless; it's _not_ the same as being statistically correlated with. The article also states "In fact, coffee is the biggest source of antioxidants in the western diet, outranking both fruits and vegetables combined". I view that more as an indictment against the western diet, not an endorsement of coffee as a source of antioxidants.

</comment><comment><USER12> Yes, but how does it compare with tea?

</comment><comment><USER13> Every time I drink coffee, I get mini-seizures. It's like my brain becomes TOO over-active, and causes it to work faster/harder than it is capable of. I stay away from coffee all the time as a result.

<comment><USER4> What does the term "mini-seizure" mean?

<comment><USER14> I'm guessing they mean muscle spasms and/or irregular heartbeat. I once drank an entire pot of coffee when I was younger and had irregular heartbeat for about half a day from it, I was wide awake though.

</comment></comment></comment><comment><USER15> A lot of bold claims here. It's unfortunate that the article focuses solely on the potential benefits of caffeine/coffe but glosses over the possibility of there being any risks associated with them. That being said, I applaud the author for providing references for all the claims he makes!

</comment><comment><USER7> Enough said! Now I am doing my MONSTER ITALIAN Espresso!</comment>


McDonald's Fires CEO Steve Easterbrook over Relationship with Employee - <AUTHOR> https://www.wsj.com/articles/mcdonalds-fires-ceo-steve-easterbrook-over-relationship-with-employee-11572816660?mod=rsswn <comment><USER2> Meanwhile, the Chief _Legal_ Officer of Alphabet had multiple workplace relationships with subordinates, one of whom was transferred out of her specialty when she became pregnant.

...Good on McDonald's for doing what's right. Relationships with subordinates is inherently wrong.

</comment><comment><USER3> I can't tell if there is actually a massive culture shift across big corporations to try and weed out bad stuff like this, or if the media is just more willing to put news like this out in the open.

Either way, its a step in the right direction

</comment><comment><USER4> Presumably the "I'm lovin it" slogan will require some edits?</comment>


Help Archive Team back up Yahoo Messages before it shuts down in 7 days - <AUTHOR> http://tracker.archiveteam.org/yahoo-messages/

<comment><USER2> Go go go !</comment>


Scientists Are Afraid To Talk About The Robot Apocalypse - <AUTHOR> http://www.businessinsider.com/robot-apocalypse-2014-7

<comment><USER2> "when... self aware machines..."

What makes anyone assume a machine is capable of being self aware? I never got that.</comment>


Ask HN: How to invest in the time of Covid-19? - <AUTHOR> I'm a salaried person living in France. I have never owned stock. Every Euro I have in my bank account comes from salary. And to be honest I have only a very basic understanding of the market.
I have been reading that stocks have been going down massively in the past 48 hours, and I was wondering how one would invest some saved up money? If I buy a stock that is now 16$ but was 26$ a few days ago, will it go back to that price and i can make a small profit ?
I'm not talking about putting a huge amount of money, just a few thousands Euros i can spare. <comment><USER2> > If I buy a stock that is now 16$ but was 26$ a few days ago, will it go back > to that price and i can make a small profit ?

Most people think _probably_ , since the stock markets have always recovered after previous crises. But it might potentially take weeks, months, or years (if the impact of the pandemic and other troubles causes an ongoing weakness in the economy). There's also a risk that particular companies or industries will be so severely affected that they never fully recover; for example, individual companies could go bankrupt or could be acquired at a lower valuation than their peak value.

Here in California, which currently has a less disruptive COVID-19 outbreak (and less disruptive responses to it) than much of Europe, there have already been reports of some small businesses failing. Someone who invested in those businesses on the assumption they would later recover could have lost the whole investment. Larger businesses can fail, too, though usually on a longer time scale. For example, it's possible that some travel-related companies that are especially impacted by reduced travel will have to sell off their assets and operations to other companies, maybe at a comparatively low value.

The point of this is that, in general, stock markets as a whole, and economic sectors as a whole, have always recovered from crises and disasters -- potentially providing profit on some timescale to people who invested during a crash -- but that this may sometimes take a very long time¹ and is definitely not guaranteed for any individual company. Therefore there is never an opportunity to invest in stocks with absolutely no risk, although a financial advisor may be able to help you estimate and manage your risk.

Even if a particular community is convinced that a certain stock or the market as a whole will _probably_ move in a certain direction, it's never a guarantee. Your gamble may have a positive expected value, but that doesn't disqualify it from being a gamble.

¹ If you get really unlucky, there could be other economic disruptions that interrupt the recovery (other disease outbreaks, natural disasters, political instability, wars, effects of climate change?) and so the economy may not recover on the timescale that you expected it would.

</comment><comment><USER3> Market cycles for recessions/depressions have sudden drops and then long bleeds. We're in falling knife territory. Wait for fundamental good news and then wait for the bounce with confirmation (retest with higher low). For the short term, cash is king, unless you are able to short.

</comment><comment><USER4> > will it go back to that price and i can make a small profit ?

No one has any idea, here or anywhere. However, what you're describing isn't investing, it's a lotto. Read some posts about why you aren't going to be able to time the market (which is what you're asking about doing): [https://www.google.com/search?q=stop+trying+to+time+the+mark...](https://www.google.com/search?q=stop+trying+to+time+the+market)

</comment><comment><USER5> > will it go back

In theory this might be true. But with the current corporate debt bubble not all will survive this recession.

</comment><comment><USER6> The way things are going now, it looks like we're heading into global recession or possibly depression territory.

The combination of the current global economy and this sudden crash brought about by a global pandemic is unprecedented. We are in uncharted territory. It all depends on how much faith you have in world leaders - this virus is shaking up geopolitics and markets may not bounce back from this for _years_ , though that's quite a pessimistic take.

Personally I feel like a lot of the world has been propped up on a house of cards and this virus is about to expose a lot of it, which means hard times are coming.

So tl;dr if you have faith in world leaders, wait another week or two because the market is probably going to crash even harder when the fed pumps $1.5T into the market (we've shut down trade with Europe and China is still not back online so this can only lead to a dead cat bounce) and then if you have disposable income buy up some bargain stocks. But the most important advice I'd give you is to _only spend what you are prepared to lose_. Your general impression is correct - if a stock is significantly lower now than it was two months ago, it's technically a bargain if you buy and _hold until this is over_.

Now, that said, if we miraculously find a cure or vaccine in the next month or so, I imagine markets will skyrocket overnight. And given that this is probably the most attention a disease has ever been given in history, it's not impossible.</comment>


Letter to the Patent Office from Professor Donald Knuth (circa 1994) - <AUTHOR> http://www.pluto.it/files/meeting1999/atti/no-patents/brevetti/docs/knuth_letter_en.html

<comment><USER2> "Therefore the idea of passing laws that say some kinds of algorithms belong to mathematics and some do not strikes me as absurd as the 19th century attempts of the Indiana legislature to pass a law that the ratio of a circle's circumference to its diameter is exactly 3, not approximately 3.1416."

now that is a real gem

<comment><USER3> Seems like the Indiana bill had a few more options than pi = 3. :)

[http://www.straightdope.com/columns/read/805/did-a-state- leg...](http://www.straightdope.com/columns/read/805/did-a-state-legislature- once-pass-a-law-saying-pi-equals-3)

</comment></comment><comment><USER4> Even when a patent claim tries to tie a mathematical algorithm to a machine, the legal tests get all convoluted.

For example, in Ex Parte Gutta (BPAI 2009) (decided August, made precedential December, 2009), the current USPTO test for patentability in such a case is set out:

"(1) Is the claim limited to a tangible practical application, in which the mathematical algorithm is applied, that results in a real-world use (e.g., 'not a mere field-of-use label having no significance')?

(2) Is the claim limited so as to not encompass substantially all practical applications of the mathematical algorithm either 'in all fields' of use of the algorithm or even in 'only one field?'"

If the answer to either question is "no," the claim fails.

In that case, the claim indicated that a processor (working with memory) is configured to identify a "mean item" whose symbolic value minimizes the variance of a set. (See [http://www.patentlyo.com/patent/2009/12/patentable- subject-m...](http://www.patentlyo.com/patent/2009/12/patentable-subject- matter-of-a-machine-that-uses-a-mathematical-algorithm.html) for a visual depiction)

The BPAI found that the claim failed the first prong by not limiting itself to any "tangible practical application in which the mathematical algorithm is applied that result in a real-world use." Likewise, the claim failed the second prong because it "encompasses substantially all practical applications" of the algorithm. "That is we are unable to identify any other practical application [of the algorithm] outside of the broadly defined claim."

Any time someone tries to grab a monopoly on an algorithm, there is a real danger to innovation. Sometimes (as here) common sense prevails but often it does not.

</comment><comment><USER5> > _If present trends continue, the only recourse available to the majority of > America's brilliant software developers will be to give up software or to > emigrate._

There is one other alternative which is available to anyone not selling their software... ignore patents. I'm not sure if it's a legal option, but it certainly seems to be the common case. I know I don't bother to stop and figure out if an idea is patented before I implement it for my own uses.

<comment><USER6> I'm afraid patents are too strong for that. It's illegal to infringe on patents even for your own use.

<comment><USER5> I'm aware that it may not be legal. My argument was that it's also unenforceable.

</comment></comment></comment><comment><USER7> I'm not really sure how this has existed for 16 years and I haven't read it.

This is the best argument I've ever heard against software patents.

<comment><USER8> Indeed! Although, with the recent rise of Open Manufacturing, Knuth's distinction between physical and abstract patents is looking a bit dated though?

Thanks for the find fogus!

</comment></comment><comment><USER9> Imagine that IT was a more mature field, where basic techniques formed a body of knowledge, a "state of the art" (perhaps in a "text-book" for IT), that is known to all "qualified" practitioners. Then, the few innovations that do occur would be truly new (and it'd be immediately clear whether they are or not). A problem with this maturation is the complexity of software, and the many ways to implement the "same" thing. Some fp academics (Smullyan) have gone some substantial way to categorizing different techniques, such as a list of "the" combinators, and ways to determine whether some code really implements that combinator or not. A theory of computation.

As it is, we keep "reinventing" the same techniques, because they _aren't_ well-known - and many of us don't want to learn them because it's much more fun to reinvent [mea culpa].

But this is really only half the idea of patenting. Really, the point of patents is not to own new techniques, but to own _new ways of solving practical problems_. It's not the technique in isolation; the patent should only cover _that_ specific way of solving _that_ specific problem.

e.g. the patent on the telegraph should be on a particular solution to transmitting information over long distances - not a patent on connecting wires in a certain way. It should be specific to the problem.

</comment><comment><USER10> Probably the most persuasive essay I've read in favor of patents is by pg.

<http://www.paulgraham.com/softwarepatents.html>

I'm still not in agreement, but he he makes a good case.

<comment><USER11> Good quote from the article:

 _One thing I do feel pretty certain of is that if you're against software patents, you're against patents in general. Gradually our machines consist more and more of software. Things that used to be done with levers and cams and gears are now done with loops and trees and closures. There's nothing special about physical embodiments of control systems that should make them patentable, and the software equivalent not._

I agree. I just think this is a strong argument against all patents rather than an argument for patents. _The march of information technology makes boundaries fuzzier and fuzzier and we have to think what will happen at the limit of this process._ The boundaries between algorithms and information expressions becomes fuzzy within a world of pure information. And ultimately, either we will be in a position where all information, all expression, is _a priori_ owned by one or another entities or we'll be in a position where all information is free (sorry about the cliche being true..). I'd rather be in the latter world.

<comment><USER12> > There's nothing special about physical embodiments of control systems that > should make them patentable, and the software equivalent not.

I think he's wrong, there is something special, the rate of innovation, and the cost of both change and the the initial barrier to entry. Physical machine are generally much more expensive to create, change, and startup a business with so granting the patent holder some limited monopoly on the invention makes sense. With software, not so much.

<comment><USER11> Uh,

This may be true currently but point I agree with PG on is that things are _moving_ towards a situation where this will no longer be true. And the movement is getting faster and faster. If the law is formulated merely on how things are now, it will become obsolete just when it can do the most damage.

</comment></comment></comment></comment><comment><USER13> This isn't so clear cut for me. In many endeavors, it is far easier to copy than to invent. Patents and the entire field of IP law exists to give innovators and creators more incentives to take on risky or costly projects that ultimately provide value.

Do people have a problem with:

1.) The concept of owning IP (and collecting the rewards)

2.) That there is human subjectivity in the process

3.) That the legal system for resolving disputes is broken and hackable via expensive lawyers?

For me I think I'm only angry at (3) and some of (2), and maybe there is a way to fix the system while keeping most of the current spirit of the law intact.

<comment><USER5> > _Patents and the entire field of IP law exists to give innovators and > creators more incentives to take on risky or costly projects that ultimately > provide value._

This may be true, but has anyone ever verified that IP law actually brings about more innovation? It certainly provides a legal framework to build a _business_ around a new idea, but it's unclear to me whether it actually causes people to come up with _more new ideas_.

<comment><USER14> There are no areas of computer science that seem to rely on patents to make investment worthwhile. The closest would be compression I guess, but unpatented video compression techniques seem to be advancing just fine. The inherently low cost of computing research means there is a massive amount of invention without the help of patents, and in those circumstances patents are just getting in the way.

</comment></comment></comment><comment><USER15> "Nor is it possible to distinguish between 'numerical' and 'nonnumerical' algorithms [...]"

But I guess it is possible to distinguish "seminumerical" algorithms (vol 2)!

</comment><comment><USER16> Here's a slashdot thread on the subject of software patents that I find horribly interesting.

[http://yro.slashdot.org/comments.pl?sid=624631&cid=24319...](http://yro.slashdot.org/comments.pl?sid=624631&cid=24319265)

</comment><comment><USER17> The title should perhaps say "... sent in 1994". (I don't think any of it is any less applicable now than it was then, though.)

<comment><USER18> Wait so what you are trying to say is that in 1994 we already knew that patents on software are going to kill us, and someone spoke up against it, and nothing was done?

Yes because enough people were not pissed off. This is changing now (sort-of- kind-of-maybe-is) because a company like Red-Hat was ticked off well enough. I give the current movement a 30% chance of success and a 80% chance of a success with no real good impact that was intended by something like this letter.

<comment><USER19> Heh... It was pretty obvious what would happen, well before 1994. From a 1991 Bill Gates memo:

 _If people had understood how patents would be granted when most of today's ideas were invented, and had taken out patents, the industry would be at a complete standstill today. I feel certain that some large company will patent some obvious thing related to interface, object orientation, algorithm, application extension or other crucial technique. If we assume this company has no need of any of our patents then they have a 17-year right to take as much of our profits as they want. The solution to this is patent exchanges with large companies and patenting as much as we can._

[http://arstechnica.com/business/news/2007/03/analysis- micros...](http://arstechnica.com/business/news/2007/03/analysis-microsofts- software-patent-flip-flop.ars)</comment></comment></comment>


Data Mining Hacker News: Front vs. Back - <AUTHOR> https://lettier.github.io/posts/2016-10-10-data-mining-hacker-news-front-vs-back.html <comment><USER2> Really nice work David, good job.

One suggestion: For each important conclusion try to have at least one sentence that is understandable by a business exec.

For example at first glance it looks like time of day may be significant, then you conclude:

"Because the p-value is greater than the alpha value, we fail to reject the null hypothesis that the two nominal categories are independent."

By adding after this something like "Therefore submitting articles at a certain time of day is not an effective strategy to achieve front page visibility.", your post gains accessibility.

This is not a nitpick. The idea is to make sure the full power of your analysis is felt across a broad section of readers. Even if you send to tech people, these things often find their way to a wider audience.

<comment><USER3> Please don't use this language. Your suggested quote implies the null hypothesis has been confirmed. In fact, the null hypothesis has simply not been rejected. A better summary would be: "We did not find any proof that submitting articles at a certain time of day is an effective strategy to achieve front page visibility."

<comment><USER2> Yep, my mistake. Main point stands, helps to have some plain english.

<comment><USER3> It's so easy to make mistakes when talking about this, with double and triple negatives that don't necessarily cancel out. I made one myself in the above comment before editing it.

</comment></comment></comment></comment><comment><USER4> Yeah these days it feels really random who ends up on the front page; there are just too many stories being submitted, and too few people filtering them :(

Back when I was blogging I crunched the HN stats and tried to draw conclusions: [http://williamedwardscoder.tumblr.com/post/18839832580/reddi...](http://williamedwardscoder.tumblr.com/post/18839832580/reddit- vs-hacker-news-vs-twitter)

<comment><USER5> Yeah, HN needs subreddits. I really do not care about the medium tier SV people that get bought for $50m. I know they are friends with a lot of other people here, but the only time I care about an acquisition is if it it is either over $500m or from somebody from Toronto that I might know.

Also, I'm much more interested in data science nuts and bolts or technology's impact on foreign policy than I am about CSS or Go frameworks or libraries.

<comment><USER4> What HN really needs is self-organisation :) By remembering your votes and views and doing a bit of collaborative filtering the site can give you a 'filter bubble' where things you are quite likely to like float towards the top...

I prototyped and wrote a blog post about that too: [http://williamedwardscoder.tumblr.com/post/15581427232/self-...](http://williamedwardscoder.tumblr.com/post/15581427232/self- organizing-reddit) ;)

<comment><USER6> > By remembering your votes and views and doing a bit of collaborative > filtering the site can give you a 'filter bubble' where things you are quite > likely to like float towards the top...

The lack of such a "filter bubble" is why I actually treasure HN more than other similar news aggregation sites; it exposes me to ideas, sites, and viewpoints outside of those I'm normally interested in, whether I agree with them or not. :)

<comment><USER4> HN is a filter bubble, its just a collective filter bubble and not personalised.

(My prototype split above the fold into "unfiltered unrated" stories and the filtered stories, so everyone was always exposed to some irrelevancies.)

</comment></comment></comment></comment></comment><comment><USER7> A couple years ago, I did my own analysis of all Hacker News submissions ([http://minimaxir.com/2014/02/hacking-hacker- news/](http://minimaxir.com/2014/02/hacking-hacker-news/)) and also wrote a script around that time to get all data ([https://github.com/minimaxir/get- all-hacker-news-submissions...](https://github.com/minimaxir/get-all-hacker- news-submissions-comments) , see also a modern dataset on Kaggle derived from it: [https://www.kaggle.com/hacker-news/hacker-news- posts](https://www.kaggle.com/hacker-news/hacker-news-posts)). I only looked at the # of points as a metric for quality, so front v. back with this approach is interesting. Given the good work in this post, I may take another look at the data myself.

This is a case where the sample size used may be problematic. "425 fronts against 570 corresponding backs" (n = 995), in the grand scheme of Hacker News, is not a lot, even if statistical analysis permits it (example: the by- hour Chi-Sq test, which barely hits the 5-per-cell assumption). Given the method of collection by scraping the front page directly, this is understandable, though.

However, that presents a problem. _the front-page algorithm has changed_ in recent months and I myself have had difficulty predicting what makes the front page and what doesn't (and what ends up making the front page _hours after being submitted for no reason_ ). With relatively new features like the second-chance pool and explicit dupe marking, there is new quality control of the front page thanks to dang/sctb. That is another issue of looking at a small subset of HN data; it does not reflect the site as a whole, although looking at more-recent data might be more beneficial for optimizing one's own posts.

<comment><USER8> > _(and what ends up making the front page hours after being submitted for no > reason)._

Some post are "resubmitted" by the mods using some kind of manual curation. They appear a few hours later. I sometimes notice this with a comment in an obscure submission with 2 or 3 points that falls from the newest page, but a few hours later the submission gets to the front page and then the comment can get a few upvotes.

I think the most clear description of this by dang is in: [https://news.ycombinator.com/item?id=10705926](https://news.ycombinator.com/item?id=10705926)

</comment></comment><comment><USER9> Great job! I've been working on a related tool that could be useful as well.

[http://hnlive.tk/static/index.html](http://hnlive.tk/static/index.html) is a "live" HN activity meter.

I wrote it for myself. Anytime before posting to HN, I use it to decide if the activity on the site is high enough. Right now the graph says, current time has the highest activity spike in the past 24 hours.

It's far from done. I'm yet to plot answers to few more common questions, backed by realtime data. Like say,

\+ Which weekday had the highest activity, last week?

\+ Which weekday usually has high activity?

\+ What time slot last week had the highest activity spike?

</comment><comment><USER10> I generally only visit the "new" stories page if I don't find many interesting front page items. So I wonder if there is a correlation there. Amount of browsing time available vs. promotion of new items to front page.

</comment><comment><USER8> I like the analysis, but I wonder if the criteria is week enough to detect the dupes from medium.com , because medium adds some tracking crap to the URL that confuses the dupe detector of HN. For example see: [https://hn.algolia.com/?query=I%20Peeked%20into%20My%20Node_...](https://hn.algolia.com/?query=I%20Peeked%20into%20My%20Node_Modules%20Directory%20and%20You%20Wont%20Believe%20What%20Happened%20Next&sort=byDate&dateRange=all&type=story&storyText=false&prefix=false&page=0) (this list doesn't include many dupes that were detected and marked).

A problem with this analysis is that it doesn't count the dupes that never had a sibling that get to the front page. Counting it would modify the distribution of some domains and submitters.

<comment><USER11> I think that is actually a document version, nothing to do with tracking.

<comment><USER12> The first number might be a document version, the second is most certainly a tracking number. Load that first link in a few successive tabs and see how you get a different one each time.

</comment></comment></comment><comment><USER13> While it's a very interesting analysis, it kinda reinforce the idea that it's down to luck. Sure you can make your post on the week end to increase your chances (even though I don't understand that given there is only so many room on the hot page, if every one is more likely to go on the top page then no one is). I think it's just the matter that people going to the "news" section tend to upvote the link that are already upvoted. The only way to increase that is to artificially bump up the upvotes by asking friends from different parts of the world to upvote your article while it's in the news section (note that if you cannot give them a link to your post directly or their vote won't be taken into account).

<comment><USER14> > Sure you can make your post on the week end to increase your chances

If everyone did this, it would increase the impact of luck: there would be an increased rate at which posts would fall off the front page of /newest - diminishing the chances that someone would see the post and upvote it. Conversely, with the consequential lower post-rate during the week your posts would earn more eyeballs.

</comment></comment><comment><USER15> Impressive research. I don't really mind the repost if the article went in fact in oblivion while we should have paid attention. A gentle reminder for everyone to sometimes visit the 'new' section and upvote the interesting part.

Maybe an AI data mining process could know what's interesting based on.... wait, no, that's a bad idea :)

</comment><comment><USER16> Good investigation but would be nice to see more in the way of conclusions that can be drawn.

</comment><comment><USER17> I wonder if you could analyze this data to extract moderation information (for example when mods changed, or when mod activity level changed). It would be interesting to identify data spikes, and try to understand why.

</comment><comment><USER18> I think it would be nice to add the time delay upon the first upvote as a feature in the analysis. Whenever checking the "new" page, I tend to look at the items which already had an upvote.

</comment><comment><USER19> Monitored tag filters, like on [https://lobste.rs/](https://lobste.rs/), would be great for HN. There is too much randomness on HN now.

</comment><comment><USER20> To what extent will the publication of this article change HN trends to make its conclusions invalid?

If everyone reads this article and then follows its recommendations, wouldn't HN posting strategy change?

</comment><comment><USER21> Side discussion, does anyone know what type of code highlighting library they are using for this? Looks like server side processing, and then outputs the html/css.

<comment><USER22> >pandoc.css

Looks like it might be called pandoc

[http://pandoc.org/demo/example18g.html](http://pandoc.org/demo/example18g.html)

<comment><USER21> Duh, not sure how I missed that last line of <head>. Thanks!

</comment></comment></comment><comment><USER23> Interesting study, it suggests a few dynamics.

The weekday data show a high back-page rate for Tuesday, and a high frontpage rate for weekend posts (Saturday/Sunday). This suggests to me that the total _volume_ of posts, a statistic not presented (that I noticed) might have some bearing. Specifically, many PR firms and other seakers of publicity tend to target Tuesday morning for positive items, as these beat the Monday rush (and blues), but allow for time to process during the rest of the week. And professional submitters are going to be quiet on weekends. If I had to hazard a guess, I'd suggest that HN attracts a significant amount of direct or indirect RP blitzing. My thought is that PR pieces are, in general, less likely to be voted to front page than organic content -- where PR includes low-quality blog, YouTube, marketing, and similar type content.

The time-of-day analysis suggests something similar. Traffic begins to pick up at about 0400 system time, which is US/Pacific. That would be 7am East Coast (morning breakfast/commute) and about 10am in Europe, suggesting there's traffic arriving from those locations. There's also a pretty noticeable _dip_ in backs ratio around the noon hour, plus or minus, and a slight increase in the early afternoon. Again, PR / SEO content might take a mid-day break within the US.

As for "new" page reconfigurations, a concern I've had is that as submissions increase, the latency of any given item on the page decreases -- well under an hour at peak times. Odds of even a good item collecting upvotes is small.

An alternative presentation might be to randomly shard submissions such that each is present on the page for at least some period of time, _for some fraction of HN users_. A hash of UID (or some other arbitrary value) and shard assignment, weighted by the predicted voting on the item, would present _each_ unvoted and low-voted submission to a small set of users, but over a longer period of time, while increased positive votes would expand the exposure category. The idea being that each piece has a more realistic opportunity for exposure. Flags would remove from scores.

HN does a good job of (usually) promoting quality and interesting content. It does have a high false-negative rate, in not promoting good content, which is a problem. On the other hand, _there are very real limits to how much content a pereson can handle in a day_ , and simply opening the firehose wider isn't a viable solution.

Based on counts of daily emails from Stephen Wolfram and Walt Mossberg, and _The New York Times_ moderation desk volumes, I'm seeing ~150 - 300 emails, or <800 comment moderations, per day, as something of a pertty consistent upper bound to meaningful content interaction, and that 800 is a pretty low value of "meaningful" at about 36 seconds per item. HN's front page with 30 solid articles is a pretty reasonable target for deeper material.

</comment><comment><USER24> the plot of differences would benefit from showing negative values - so that fronts > backs is positive (like sat, sun) and backs > fronts is negative (like tuesday).

The way it's currently shon (magnitude or abs value) requires a lot of cognitive load to parse that could be intuitive.

</comment><comment><USER25> This was very interesting - a bit confusing but helpful!

</comment><comment><USER26> would like to see the next version in a week or two to see how your article affected the numbers.

(im sure from now on we will see a pike on Tue 6 and 11 on posts)

</comment><comment><USER27> Very well put together post. Great work.

</comment><comment><USER28> Why is that "posts" button moving so much? I can't focus on the text at all. I had to inspect the page and remove the animation in order to be able to focus.

<comment><USER28> If anyone else if bothered by that, paste this in your chrome's console:

jQuery('.shaker').removeClass('shaker');

<comment><USER29> Thanks for this; it was the only way I could read the (very interesting!) article.</comment></comment></comment>


Ask HN: Google Logo Today - Is it built using Flash? - <AUTHOR>

I just noticed Google Logo has a light bulb animation today - Is it built using Flash ? <comment><USER2> Check the source.

Hint: no, it's not flash. It's an animated gif.</comment>


Harvard Chemistry Chair Lieber Charged with Not Disclosing Chinese Funding - <AUTHOR> https://www.thecrimson.com/article/2020/1/29/lieber-federal-charges/ <comment><USER2> Given current news about Wuhan, somewhat interesting bit:

> " ... Unbeknownst to Harvard University beginning in 2011, Lieber became a > "Strategic Scientist" at Wuhan University of Technology (WUT) in China and > was a contractual participant in China's Thousand Talents Plan from in or > about 2012 to 2017. ... ."

[1] [https://www.justice.gov/opa/pr/harvard-university- professor-...](https://www.justice.gov/opa/pr/harvard-university-professor- and-two-chinese-nationals-charged-three-separate-china-related)</comment>


Structuring Your Project - <AUTHOR> https://docs.python-guide.org/writing/structure/ <comment><USER10> Always one of the good articles to link to when creating a Python repo from scratch.

Should mention that __init__.py is not needed for python 3.3+ anymore (just found that out this week myself to my surprise) so for projects where backwards compatibility is not required you can stop creating extra blank files if you don't need them.

[https://stackoverflow.com/questions/37139786/is-init-py- not-...](https://stackoverflow.com/questions/37139786/is-init-py-not-required- for-packages-in-python-3-3)

<comment><USER11> That's really not recommended. A lot of behaviors are subtly affected by failing to have init files.

<comment><USER12> Like what?

<comment><USER13> Not op but I have personally noticed that doing a 'python setup.py install' doesn't correctly import modules unless you have an __init__.py file. It's possible I could be doing something wrong however.

</comment></comment></comment></comment><comment><USER14> When I'm just learning a new programming language or framework, I prefer to have something like create-react-app [0], django-admin startproject [1], cargo new [2], or lein new [3].

Guides like these are just full of (the wrong type of) rabbit holes. Just give new people something that lets them work productively as soon as possible and refer them to language documentation to understand how features of the language or the runtime work - in case they want to dig deeper.

Most people will not want to dig deeper, anyway. They will be happier to just have boilerplate that works and that they can iterate upon.

Look at the golang version of this guide: [https://github.com/golang- standards/project-layout](https://github.com/golang-standards/project-layout)

How many programmers new to go are going to want to wade through all of that? Especially when they're probably starting out with projects for which most of those conventions don't even apply!

It's surprising to me that Python, as focused as its philosophy is on providing canonical solutions to problems, doesn't have a "python -m newproject". There must be a good reason. Will try making one in my free time to find out.

[0] [https://github.com/facebook/create-react- app](https://github.com/facebook/create-react-app)

[1] [https://docs.djangoproject.com/en/2.2/ref/django- admin/#star...](https://docs.djangoproject.com/en/2.2/ref/django- admin/#startproject)

[2] [https://doc.rust-lang.org/cargo/guide/creating-a-new- project...](https://doc.rust-lang.org/cargo/guide/creating-a-new-project.html)

[3] [https://github.com/technomancy/leiningen/blob/master/doc/TUT...](https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#creating- a-project)

<comment><USER15> `poetry new`[0] is what you are looking for, previously I have used pyscaffold[1] but I like the pyproject.toml from PEP 518[2] better than all the old stuff. Unfortunately poetry does not set up docs like pyscaffold does though.

[0]: [https://poetry.eustace.io/](https://poetry.eustace.io/)

[1]: [https://pyscaffold.org/en/latest/](https://pyscaffold.org/en/latest/)

[2]: [https://www.python.org/dev/peps/pep-0518/](https://www.python.org/dev/peps/pep-0518/)

<comment><USER16> I never tried Poetry because of this somewhat worrying part of installation instructions: "The installer installs the poetry tool to Poetry's bin directory ... located at $HOME/.poetry/bin ...This directory will be in your $PATH environment variable".

The directory _will be_ in my PATH? That makes me wonder what else it might take the liberty to reconfigure on my system.

But, reading the installer script, it seems like it at least prompts you for confirmation first, so perhaps I'll try it.

</comment></comment></comment><comment><USER17> This is the kind of documentation I wish every language/framework provided. Every time I try to learn a new language/framework, I just see code fragments with no idea how to organize them coherently.

This month I'm working on a side project and learning to use sequelize (a SQL ORM for node). All the examples [1] just seem to assume my entire project live in a single file.

[1] [https://sequelize.org/master/manual/models- definition.html](https://sequelize.org/master/manual/models-definition.html)

<comment><USER18> The most frustrating part of learning new tech stack is the implicitly assumed tribal knowledge.

ex. s.o answers start with _np.yada_ without the _import numpy as np_ part.

</comment></comment><comment><USER19> Most of the advice here seems okay but this stuck out to me:

        foo += 'ooo'  # This is bad, instead you should do:
        foo = ''.join([foo, 'ooo'])

This seems like such a silly micro-optimization. I also have to question its validity, even in scenarios where you're working with huge strings.

<comment><USER20> I would agree with you.

The only reason I can see for the advice is that the first line does not handle that foo (#) might be other than a string - for example if foo was [1,2,3] you just got [1,2,3,'ooo']. the second line would barf on that. But if that was the case it is waaaay more readable to explicitly test for that

so yeah, generally not great advice

(#) Holy moly how many times will autocorrect change foo to too!!! stop it!

</comment></comment><comment><USER18> Nitpick: I'd rather use the _python -m pytest_ way than modify sys.path (AKA "the django way").

Modifying sys.path is an ugly hack which makes python look like some... idk. matlab?

<comment><USER19> I don't understand what the author has against requiring a pip install -e .

You're requiring contributors to install dependencies anyway.

If you're using pytest (I think the article assumes you're only using the standard library unittest which I wouldn't personally recommend) there is pytest-pythonpath which at least makes this invisible to the user.

</comment></comment><comment><USER11> The best answer in 2020 is to use poetry.

[http://poetry.eustace.io](http://poetry.eustace.io)

</comment><comment><USER21> Whenever I start a new Django / Python project I come up with a short and generic(ish) internal name, like "pluto" - then, the repo is structured like this:

        README.md
        runtime.txt
        requirements.txt
        pluto
          wsgi.py
          manage.py
          urls.py
          - <USER2>
            - common.py
            - prod.py
            - local.py
          - <USER3>
          - <USER4>
          - <USER5>
            - <USER6>
              - models.py
              - <USER9>
            - <USER8>
            - <USER9>

In a case like this, the repo is named "pluto" in GitHub, but I clone it as "src"; so, the project locally looks like this:

        pluto
         \ src
            \ pluto

I CD to the root (pluto/src) and work from there.

I also use relative imports from within the "apps" directory:

        # e.g., inside pluto/apps/accounts/views.py
        from ..users.models import User

I've used this pattern for years now. It feels so much cleaner than any other pattern I've ever used, and it also makes my projects much more reusable (if I want to copy my latest project as a skeleton for the next, etc.).

</comment><comment><USER22>
      To give the individual tests import context, create a  tests/context.py file:
      import os
      import sys
      sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

Or you can convert your tests directory to package by placing __init__.py. It's pretty amazing that Kenneth Reitz uses this ugly solution.

</comment><comment><USER23> I find myself coming back to this guide whenever I set up a new project: [https://sourcery.ai/blog/python-best- practices/](https://sourcery.ai/blog/python-best-practices/)

<comment><USER24> A general ignore_missing_imports=True in mypy.ini is very bad advice. This will hide lots of real errors. It's surprisingly easy to set up mypy such that it will silently not check types in many files.

Additionally I can't be the only person who utterly despises pipenv. It is confusing for most people who don't know python packaging internals, phenonomially slow for everyone else and besides discourages building proper distributables (or:wheels).

<comment><USER25> What do you do instead of pipenv?

<comment><USER24> Pipenvs attempts to replace all other tooling to the answer is: all other tooling. Specifically, setuptools via either setup.py or setup.cfg. pbr, virtualenvs, tox, pip-tools, pip, etc are all useful. Anything that does not take 5-10 minutes to recompute dependencies basically!

<comment><USER23> That is a big weakness, I agree. But the mental tax of having to remember how to use >5 cli tools vs one is definitely pro pipenv for me.

</comment></comment></comment></comment></comment><comment><USER26> For all the grief Kenneth Reitz gets... gotta give him credit for his emphasis on usability and professional presentation.

<comment><USER25> Why does he get grief?

<comment><USER27> [https://news.ycombinator.com/item?id=19826680](https://news.ycombinator.com/item?id=19826680)</comment></comment></comment>


Canada's leading Web 2.0 pioneers - <AUTHOR> http://www.techvibes.com/blog/canadas-leading-web-2.0-pioneers

<comment><USER2> I just can't take any list seriously, that has a twitter app in the top 10.

       #10 HootSuite, Vancouver - A Twitter toolbox that manages multiple Twitter profiles

<comment><USER3> HootSuite is one of only 3 listed that I'd heard of (HootSuite, FreshBooks, NowPublic), and I'd heard of it in a business context where people would pay -- a technical team at a Major Company sharing responsibility for a support Twitter account. So the dismissiveness is unwarranted.

<comment><USER2> they may be fine as a stand alone business, but not as a top 10 business for an entire country

<comment><USER4> The list is supposed to be the top 20 web 2.0 businesses, not all businesses or even all tech businesses.

<comment><USER2> and would you say that those are the 20 top web 2.0 businesses for the entire country? I just don't believe that.

<comment><USER4> I'm not sure, I don't really follow web 2.0 stuff. The list does seem a bit West-coast biased though. I can think of other Canadian tech and software companies (Idée, for example) that are more interesting _to me_ than HootSuite, but it's not my list.

</comment></comment></comment></comment></comment></comment><comment><USER5> Some of those companies are absolute rubbish. Though voices.com looks very cool. I browsed around and if I had a need for voice acting I'd go there.

ThoughtFarmer looked like a neat idea. Then I saw their demo and pricing. $109/per seat, 100 seat minimum. For $4K I can buy an Xserve from apple that does the same thing, better.

I can't wait for the second dotcom crash.

</comment><comment><USER6> It's great to see the Internet on fire in Canada. Most people don't realize that we have had some amazing Web companies come out of Canada, like Flickr and iStockPhoto and StumbleUpon and ClubPenguin, and it looks like we'll have a bunch more over the next few years. Congrats to all the winners!

Disclosure: I work at FreshBooks (and am very excited!)

<comment><USER7> Got an email? I've got a few questions about FreshBooks...

<comment><USER6> For sure! sunir splat freshbooks dot comm

</comment></comment></comment><comment><USER8> Ottawa is completely missing from the list.

<comment><USER9> That's like saying Washington DC is completely missing from the list. Ottawa city is bit of a boring town.

<comment><USER4> Ottawa has generally had a lot of tech and software (Corel, for example), so I do think it is surprising they aren't on the list. Shopify, for example, is based in Ottawa.

</comment></comment></comment><comment><USER10> I've said this before and I will say it again -- any list of Canadian entrepreneurs without backtype.com on it is a sorely incomplete list. They're building real core tech that is powering dozens of other sites.

<comment><USER11> Agreed - looks like this list only includes Web 2.0 companies that are located in Canada. While Backtype was founded by Canadians, I believe they have moved to Silicon Valley??

</comment></comment><comment><USER12> Shopify.com should probably be on there..

</comment><comment><USER13> Gas Buddy is missing too.</comment>


Fixing Apple's Engineering in an Hour [video] - <AUTHOR> https://www.youtube.com/watch?v=MlOPPuNv4Ec <comment><USER2> To be fair isn't this probably the case with just about every laptop? Kit it out with some crazy totally impractical cooling setup and you can squeeze out a bit more performance. Even after all the craziness they edged out enough performer to detect it on a stress test but probably not enough to materially impact user experience.

This video sort of misses the point that real-world design is balancing multiple factors, not just over-optimizing one factor at the cost of others.

People don't buy a MacBook Air because their looking for the fastest processor performance processor. That's not the point of the product or the market it's made for.

<comment><AUTHOR> Hmm, fair point, but I do expect the CPU and the fan to _at least_ be to be connected!

The machine quickly jumps to 100 degrees on load, which is something I do care about, from a usability perspective. I have to regularly turn on the aircon to make the keyboard on my MacBook Pro even usable -- something I did not have to do on a ThinkPad T440p.

And then there's the chance of damaging internal components because of the sustained high heat over a long time.

I think the intention of the video, initially, was to "squeeze out a bit more performance.", but it ended up demonstrating some arguably obvious oversights in the thermal solution of a rather expensive machine.

</comment></comment><comment><USER3> I came here expecting an in depth view of Apple's Software Engineering practices... I am disappointed.

<comment><USER4> That would be Louis, not Linus.

</comment></comment><comment><USER5> Consumer hardware engineering these days is all about getting away as close to the edge as possible. And that'd be fine, if there was an option for better margins at a higher price. But there isn't...

</comment><comment><USER6> Can't have that MBA beating the base spec MBP... -_-

<comment><USER7> Watch the whole video. They managed to keep the laptop ice cold with a custom heatsink, but even then only managed to eek out a 12% performance improvement. As it turns out, Apple actually knows what they're doing.

<comment><USER8> From what I understand it's the CPU power management/frequency profile that is limiting it. Even when satisfying the thermal requirements they were still getting sub-par performance because presumably the CPU was being limited in software anyway.

A combination of good cooling + a tweaked power management profile to accommodate the better thermals should give a substantial performance increase.

<comment><USER9> > presumably the CPU was being limited in software anyway

Would this be in the OS or the bios (or whatever they call it on a Mac)?

If it's the former, I wonder if the test would have been more interesting if the MBA was running a different OS.

<comment><USER8> Firmware.

Doing it within the operating system is suicidal as a malfunction of the OS (whether accidental or due to malware) would force the machine to operate beyond its thermal limits and potentially damage itself.

<comment><USER10> The thermal management is done in userland. This is probably the same.

\- [https://twitter.com/tomcoates/status/1255170545366097922](https://twitter.com/tomcoates/status/1255170545366097922)

<comment><USER5> This is another misunderstanding/misconnection. "kernel_task" is used to report "missing" CPU time so the CPU usage accounting remains consistent even when the CPU is throttled. That does not mean either the kernel or userland have any input to the thermal throttling functions.

There's also multiple levels of protection and throttling. At the lowest level, various ICs on the board (e.g. power regulators) will turn themselves off if they overheat. Somewhere above that, firmware will definitely exert /some/ control, to cover odd situations like the machine hanging while booting. Above that, the kernel or userspace can add another layer — but like each of the layers before, that layer can only lower the limits further.

Having thermal management in userland (and nowhere else) would be legal suicide. Imagine the lawsuits from people accidentally burning their legs...

<comment><USER10> Thanks for this.

I believe you are correct, although I did think that kernel_task was there to help cool the components down, and not simply as a devide to report throttled CPU usage consistently with unthrottled.

That said, I didn't mean to say that thermal throttling only happened in userland but rather that it did happen there, even though it might also happen elsewhere.

Within the context of this thread, this is relevant since in this case the CPU was not being thermally throttled as it was running cool, but something was still throttling the amount of power going to it.

I was merely suggesting that Nextgrid's affirmation that it must have been the firmware throttling the CPU is not necessarily true. Given that there is a software component to thermal management (or at least I thought so), it's only logical to assume that there may be a software component of whatever other throttling was occurring without it necessarily being suicidal as suggested.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER11> I found it unreasonable that ipad keyboard is only $300. simultaneously, Windows is very bad OS: bitlocker, updates, userland, no solution for game anti cheats so every game has to run a special program to create anti cheat program, visual studio is terrible.

yet, in the long run I think the OS itself is beast!</comment>


WordPress Plugin Development, What Not to Do - <AUTHOR> http://wpvibe.com/plugin-development-what-not-to-do-243/

<comment><USER2> Quick summary: Wordpress core developer says 'don't be an asshole when you make plugins.'

Why is this news?</comment>


The Nerd Handbook - <AUTHOR> http://www.randsinrepose.com/archives/2007/11/11/the_nerd_handbook.html <comment><AUTHOR> I felt parts of me resonate with the Nerd Stereotype. It made me laugh.

There is a good description of a personality requirement I found on this blog (<http://blog.boxee.tv/2007/08/08/wanted-a-code-poet/>) for a programming job in Israel typifying the stereotype:

"someone that can write PHP with two hands tied behind his back, but dreams in C++.

favorite beach book reading: design patterns (hard cover edition, signed by the authors)

favorite debate topic: LAMP vs. J2EE (prefers LAMP, but can argue both sides of the issue)

favorite animal: penguin.

hobbies: none.

(social skills are not a requirement)

if you think you fit the bill please send us an email (don't forget to mention your favorite compilation flags for the Linux kernel)."

Obviously they're trying to find someone of the stereotype - they'd be the best for that job. I laugh at my Nerd side, it's only just the beginning of personality development.

</comment><comment><USER2> Is this supposed to be a parody of something else?

Anyway, I think this one tends to be a bit more accurate, for a stereotype: <http://www.catb.org/jargon/html/appendixb.html>

</comment><comment><USER3> Nerds are efficient, too. Just emailed this to everyone I know. One minute to give them all the data they ever need to know me. Pretty good return, huh?

</comment><comment><USER4> Although this is surprisingly accurate overall, I think the author is describing the INTJ personality. That's a much better label than "nerd".

</comment><comment><USER5> Stereotyping like this doesn't really accomplish much.

For instance, I find that a lot of people who program because they love to often have no problems with speaking in front of crowds. The only time I'd be nervous is if I had nothing to say. I love sharing the things I find interesting with other people, so after you get started it comes very naturally and you can just be yourself.

</comment><comment><USER6> _It's cliched, but a [WORD_OMITTED] is defined by his computer_

Nobody is defined by his computer, and nobody likes being called a [WORD_OMITTED] 500 times in one article. Can we have a downmod arrow?

<comment><USER7> I don't mind being called a nerd. I don't have all of the social faults described in the article, but I certainly have many of them -- enough that I immediately sent this to girlfriend with the suggestion that she read it.

Most geeks (people who have exceptional interest and ability in a particular field, usually technical) are also nerds (people who are socially awkward or abnormal). Rather than pretending that this isn't the case, why not accept reality and try to find the best way of dealing with it?

<comment><USER8> Why? Because it's not "reality". The described "nerd" traits are largely a self-imposed condition, and glorification of them only makes them worse.

There are _plenty_ of people out there who are exceptionally good with "nerdy" subjects, yet whom also have social lives, enjoy travel and human contact, and find a life spent locked in front of a computer to be extremely limiting. And those people are often the most respected and honored by their peers.

The common thread that I sense in these kinds of articles is one of _defensiveness_ \-- here's why I'm different, and why you should treat me with kid gloves. And I suppose that's a natural behavior for a group that perceives itself as marginal, but it's not anything particularly insightful or life- enhancing.

<comment><USER9> This is a fantastic comment. You are absolutely right.

<comment><USER10> Seconded. Spot on comment</comment></comment></comment></comment></comment>


KidnApp - An app that lets you create and schedule your own private kidnappings - <AUTHOR> http://getkidnapped.com/

<comment><USER2> I'm pretty sure this is fake because most arranged (consentual) kidnappings I've heard of have cost much more than $4.99/month.

<comment><USER3> Maybe it's like a lottery where 1 member a month gets a kidnapping. The idea is super weird to me though.

<comment><USER2> A friend of a friend payed for college by doing kidnappings like this.

Basically, people would come to him wanting to be kidnapped, to feel a rush of adrenaline that comes with a life threatening experience.

Paying his rates for kidnapping -- 10K and up -- was not something a rational person would do. His clients were similar to those of the high-end dominatrix; rich, successful, people (usually men), with deep-seated complexes. Maybe the meaning had left their lives. Maybe a past trauma had gotten them addicted to adrenaline and violence. Maybe they saw themselves a big kidnapping targets, and the faux kidnappings were just training for the real thing.

Whatever the reason, people paid him to do it.</comment></comment></comment>


Terahash $1.4M configuration VS "Multi One Password" 1 char long password - <AUTHOR> Well, Terahash $1.4 Million configuration of 448 x RTX 2080 GPUs can't even crack 1 character long hashed password generated with "Multi One Password" tool!
1 character long password, lowercase letter, sha512 hashed string generated with "Multi One Password" tool:
6d78101f3965681a61ab72365de3f9052d6da65f5a42ea6d4a6e68f02b81d32825388837ee9d61e5314cfca90d5638316c1465634fcad42c8cf1a744cc924947
https://twitter.com/TerahashCorp
https://windowsportableapps.blogspot.com/2019/09/multi-one-password.html
#passwordmanager #Infosec #cybersecurity #netsec #hashcat #CrackQ <comment><USER2> Your twitter account got suspended, but we still have their side of the conversation. [https://twitter.com/TerahashCorp/status/1229598522372239360](https://twitter.com/TerahashCorp/status/1229598522372239360)

</comment><comment><USER3> repeat of this garbage [https://news.ycombinator.com/item?id=22181814](https://news.ycombinator.com/item?id=22181814)</comment>


Too much JavaScript - <AUTHOR> http://latviancoder.com/story/too-much-javascript

<comment><USER2>
        "The amount of users with javascript disabled in their
        browsers is around 1% or even less. Who are those people?
        I always imagined them like some old-school security-
        obsessed maniacs."

I'm one of those people and I write lots of JavaScript for a living at a company that writes mostly JavaScript. The truth is that the overwhelming majority of sites don't use JavaScript for anything useful. In fact a lot is actively not in your interests. 90% of the time most of the JS I encounter in SafeScript is metrics collection and adware. I also block javascript because I like to have a lot of tabs open and 100 tabs running javascript can easily send my fans into overdrive and kill my battery life. For the most part, I usually just whitelist domains I trust.

One day I wouldn't mind sitting down to write a browser plugin that is a lot smarter about executing JavaScript. I'm doing a lot with AST parsing with esprima these days so hopefully that experience will provide some insights over time. The truth is that the browser is supposed to be a user-agent and most need a lot more work still to act in the best interests of the users using them.

I especially would really love to build a LittleSnitch for browsers that overrides the browser's XHR, WebSockets and other networking features to disable timeouts and give you the option of whitelisting GETs, PUTS and POSTS to certain routes.

Furthermore, I think it would also be nice to be able to figure out what parts of a page touched certain elements and decide to block the javascript that manipulated that part of the page.

</comment><comment><USER3> If it can be done without Javascript, it's probably better to do without it. Not only for compatibility, but it will be faster, too. Serving an empty div with a lot of Javascript to AJAX/JSON things in doesn't make everything better.

</comment><comment><USER4> The real question is, why do people still disable Javascript? (And, why do browsers offer this option)

<comment><USER5> I use noscript, then white-list sites I trust (or am temporarily curious about).

The web runs so much faster.

<comment><USER6> No flashy adverts - static images are so much less distracting. A few places use animated GIFs, but they're a minority among minorities.

</comment></comment></comment><comment><USER7> 1) You were wondering why people disable JS.

2) You were making "THIS FACE" at _one of them_.

3) You _didn 't ask him why_ did he disable JS.

4) You're about to remake your site based on conclusions drawn by _a sample of one_.

Well, god damn it dude. That's not how thinking works!

<comment><AUTHOR> Well I did ask him, it looks like he's pretty religious about it.</comment></comment>


Comparison Between iOS, Android and Windows Phone Sales - <AUTHOR> http://daringfireball.net/linked/2011/04/04/app-store-market-share <comment><USER2> Why is this a link to the reblogged article on a popular blog, and not the original article?</comment>


Path, Timeline & Worship of The Self - <AUTHOR> http://www.readwriteweb.com/archives/path_timeline_worship_of_the_self.php#.TtZ22A56bZg.hackernews <comment><USER2> We're born worshiping ourselves. Now we just get to do it a little more publicly. At least since it's a closer group of friends and family on Path, those you "friend" will be more likely to know your true character, and they'll be genuinely interested in what's going on with your life.

<comment><AUTHOR> Will they? Is a gorgeous, lovely, stroke-able app for this compelling enough to get people to use it? Use it all the time? Make it a primary means of communication?

<comment><USER2> I don't know. I'm not saying it'll catch on or be used. I'm just saying those are the things that make it more compelling than facebook to me. And pointing out that these new "social networks" aren't making us worship ourselves anymore than we used to.</comment></comment></comment>


In Defense of ORMs - <AUTHOR> http://darwinweb.net/articles/in-defense-of-orms

<comment><USER2> > You might claim that you don't use an ORM in your code, but in effect you > are just implementing your own idea of an ORM. If you are just peppering > queries around your model then it might be a very lightweight ORM, but the > fact is you are still Mapping Objects to Relations and vice-versa.

Well said. If you don't use an ORM and you don't write SQL queries in your model methods, you're likely practicing poor OO design.</comment>


Windows 8 to showcase 'desktop as a service'? - <AUTHOR> http://www.zdnet.com/blog/microsoft/windows-8-to-showcase-desktop-as-a-service/7975

<comment><USER2> I don't like Microsoft very much, and I'm aware of every technology that MS has stolen or copied, MS-DOS and QDOS, Windows and the Xerox windows interface or C# and Java. But this DaaS concept is an interesting one as it is different from Chrome OS or EyeOS. Kudos to Microsoft!!</comment>