skysight-inc/HackerNews huggingface dataset:
I've wrestled with this problem several times. My conclusion was mocks are just fine, but this is a wart in that there isn't "one way to do it"

For the most part I can get by with one rule: always mock the module.

with mock.patch('os.listdir'):

will always work, even if it doesn't accomplish what you want.

with mock.patch('mymodule.os.listdir')

will fail if that module does not explicitly import os and instead does something like from os import listdir (perhaps because a later dev did not realize importing os directly was actually a requirement for the test and changed the code).

The rule is not perfect though. In the above case, the error will actually be

ImportError: No module named os

This can be fixed with e.g.,

assert hasattr(module, 'os'), "os module is not explicitly imported"

as a preamble to your test but ... it is not perfect by any means.

EDIT: formatting
Well with someone such as that you aren't trying to convince him you are trying to convince the audience of your position.
Well no.. because I’m in California currently. But, yeah we have civilization in Montana. Also, the place in question is small enough that you can get to know a double digit percentage of the population within 30 mins driving distance if you wanted to, so it’s not entirely unlikely that there wouldn’t be a couple mutual connections anyhow.
> It's downright ridiculous to complain about companies taking perfectly legal steps to reduce their tax burden.

How ironic that you had to post (as of now) 24 times in this very thread defending this condescending viewpoint. You're not at all addressing what the article mentions.

I'll address what the article mentions. The article (quite clearly, in bold) mentions, at the top:

> The company is currently under investigation by tax authorities in the UK, Sweden and France over alleged transfer pricing irregularities and is is facing a potential bill of over $1.1bn in back taxes and penalties.

> In the United States, Activision Blizzard has recently settled a transfer pricing dispute with tax authorities for $345m

It appears these steps may very well be not legal.

If you deal with your tax in countries such as:

> The multinational company has a complex structure with subsidiaries in a number of tax havens including Malta, the Netherlands, Barbados and Bermuda.

(Yes, I'm including my own country here.)

Then you're appearing to do something shady with regards to tax. You can expect something shady in return. And of course, since they're also using Delaware, it could very well be that they do pay fair (or "fair") tax over their US part. If so, would you argue Americans have no say in this, given that they're not losing out on tax from Activision-Blizzard?

There appears to be a lack of political willpower here in The Netherlands to combat this issue. No surprise, given how far right the current leading party (VVD) is. As a result, The Netherlands wins a little bit, but the EU as a whole loses out. Its stupid egoism like this which makes the EU lose on an international scale, akin to Germany allowing the NSA to tap data as long as it wasn't about Germans.
Give Immigrants Money
I'm getting pretty tired of seeing 5 ("Establish and showcase an online presence").

Why? It's substantially nonsense. Many of the best programmers I've worked with don't do, or don't showcase, side-projects. And why should they? They've got families and other interests.

Who wants to be stuck in front of a computer all the time? (He said, ironically, whilst typing a HN comment on a Sunday evening.)
The world will be hotter. Much hotter. :(
Oh man I can relate to this. Tried watching a murder show on Netflix and I swear half the content was just rehashing of the other half. Come to think of it, this is how most books are written - 10% value, -90% filler.
Just gonna have to shower your enthusiasm a wee bit on the electricity prices in France: they are rising steeply, but this is mostly for political reasons, as this was to allow the private sector to make money from the public nuclear production in the name of "free and fair competition". It's explained reasonably well here (in french only though): https://fr.wikipedia.org/wiki/March%C3%A9_de_l%27%C3%A9lectr...
> The stolen data contained names, email addresses, scrambled password (believed to be hashed with the MD5 algorithm and salted)

This is absolutely atrocious if this is the case. MD5, even with a salt, can be cracked in a matter of seconds even with the most basic hardware. MD5 hasn't been an acceptable password hashing algorithm for at least a decade now, and StockX was created in 2015, long after the creators should have known better (sadly, despite this, an absurdly high number of companies still use MD5 for pass hashing).

These passwords, hashed with MD5, might as well be considered to have been stored in plaintext.
Well now I’m curious, would anyone here reject a Comic Sans resume and why?
the flip side seems to be that America is rigged for consumers[1]

[1] of imported goods and watery beer, as contrasted with health care and higher education
RISC-V cores ship in certain quantities already. They just don't happen to be general purpose / hobbyist chips. They are embedded into specialized controllers, such as SSD controllers [1], or FPGA cores.

[1]: https://www.anandtech.com/show/13678/western-digital-reveals...
It all depends on the amounts being moved. Transfer pricing is complex because what is market rate in situation A is not market rate in situation B. $345 million could be a minor difference of a few percentage points on tens of billions in revenue.

Just like FDSGSG wrote above, I went through a sizeable tax dispute (for an individual, outside of the US) and won. I have a good understanding of tax law yet it was nothing more than a bullshit money grab. No merit, nothing. More along the line; that's a very nice outcome for you but we don't really like it -- so pay up regardless. Like trying to shake a tree.

In this case, I can imagine for Activision (as a publicly traded company) it is better to settle a case for an OK amount than take it to court and run through the process. You have to make a risk reward analysis of whether it's worth spending time and resources on.
We need to start charging companies with criminal negligence if they are not using secure password hashing algorithms. People reuse passwords and this leak puts other companies at risk.
A lot of AR applications depend upon centralized map and street level info, which is susceptible to information siloing.
Starting a $13K/Month Online Book Club from Bali
It's not like that makes it a good idea.
I can't memorize regex completely but my favorite cheat sheet for regular expressions is this simple one:

https://github.com/ashchan/cheatsheets/blob/master/misc/regu...

For more advanced expressions I just do a quick google search for existing solutions before attempting to recreate the wheel.
Wow, I just wanted to say thanks for sharing this. These slides are great. Would you mind if I shared this link with some coworkers?
Maybe try something with KaiOS?
It's a pre chewed thought for people who want to be angry and can't be bothered with the why part.

I'm absolutely of the mind that many off the systems which comprise our socio-economic-political system are deeply unfair to people who are "workers“(side note, what a bullshit term, do CEOs not do work? Are lawyers not workers? They sure seem to work a lot)

But instead it reduces the concept to the point of being a bumbling conspiracy theory which is bordering on semantically invalid. How do you rig a geographic location?
I'm curious what the build-your-own-pancreas people have to say about Tidepool's plan to build an iOS app to do the control logic, and at the same time developing standard interfaces to insulin pumps and glucose monitors. Any comments?

https://www.tidepool.org/blog/tidepool-loop-medtronic-collab...
The guide to hacking for beginners – Learn Worthy
> Why does Brasil have to suffer alone for the world’s lungs?

Because we all know Brazilians don't need oxygen to breathe.
I found it much more pleasant to parse JSON than YAML. At least there's a fairly soecific RFC for JSON! YAML parsing felt like a whole bunch of "meh, we came up with this, but just sorta do what you want".

And on the topic of cute names, back when I was learning Elixir, I wrote a wrapper for an Erlang YAML parser. I called it Mark Yamill :)

https://hex.pm/packages/mark_yamill
Raspberry Pi Helps Vintage Psion Find Its Voice
However, some famous papers like Watson & Crick's DNA model were published without peer review.
The concept is certainly old, but it hasn't been a systematic part of the "universal scientific process" for more than a few decades.

Most revolutionary scientific discoveries were made without it.
To be clear, the only reason that these tactics can work in the USA in the first place is because of the district gerrymandering. It will be interesting to see what kind of monster the Republicans return as after the millennials have driven a stake through the heart of the current version.
US military purchased $32.8m worth of electronics with known security risks
They're not operating in The Netherlands. They're "operating" in The Netherlands. The "operating" refers to having a PO box. That's all they need to have a physical presence here.

See RamBam episodes (in Dutch, but contain some English too):

> S04E11 Nederland Belastingparadijs broadcasted 29 Apr 2015

> S05E05 Russische bedrijven in Nederland broadcasted 17 Feb 2016

[1] https://nl.wikipedia.org/wiki/Rambam_(televisieprogramma)
Yes, but she wrote in the article "It's my daughter who's breaking bad," not "It's my daughter who's like all kinds of mafia/heist/drug dealing/espionage/etc stories". I was referring to that specific cultural reference in the article.
Look for their prepaid phone offerings. There's some feature phones in that line up, and it'll work with any plan.

On Amazon, search by carrier, sort by lowest price. Some are low end Android, but some are feature phones. In my experience really low end android phones have such little storage they might as well be feature phones. You could only get 1-2 apps on max if you tried.
Show HN: Codelines – Create Coding Articles from Visual Studio Code
Phantom Types in Swift
I think you're focusing too much on the women part? I see it as criticising the stage aspect: instead of being able to be secluded and focus on the task at hand in a practically small space, you are instead performing in a space visible to everyone which is much too big to be good for the actual task.
Ask HN: Using HTTP GET with request body
We are doing a RESTful service that is non-public. For a request that is read-only and potentially uses 20+ parameters, we are planning to implement it as a GET request that will pass these parameters in the body.

I have seen the well known announcement by Dropbox in 2015: https://blogs.dropbox.com/developers/2015/03/limitations-of-the-get-method-in-http/ and the response in Hacker News: https://news.ycombinator.com/item?id=9133469

As I understand it, there are three potential issues with a GET with request body:

(1) Not all servers will support this.

(2) Not all tools will support this (POSTMAN added support this year: https://github.com/postmanlabs/postman-app-support/issues/131)

(3) There is not yet a consensus on GET with request body. (For example, is Dropbox still using a POST)

I am not finding too many recent statements about this, I wanted to open up the question here and see what the current opinions are.

I heard that ElasticSearch is using GET request parameters in the body. It sounds like there are some who are against this approach:
https://stackoverflow.com/questions/36939748/elasticsearch-get-request-with-request-body

(1) Does this make sense for a private server? (The answer here seems to be yes -- unless I am missing something)

(2) Does this make sense in general? If the tools needed support it, what is wrong with implementing a RESTful service that requires GET request parameters in the body?
I don't understand what you mean by "will always work, even if it doesn't accomplish what you want." Mocking os.listdir will be useless if your product code's imports don't match it. How is this "one rule" to use?
Ha, are you arguing the merit of this is that it's not click bait?

Consider me totally dumbfounded.
In my experience people think/hope that the minimum tells them the performance of their program when all noise is removed. However, this is based on the assumption that programs have a single performance point which, as the Stabilizer paper shows, is rarely the case on modern systems. Rather, what the minimum tells you is the behaviour of your program at one given point in the non-deterministic performance space. This might seem like a minor, perhaps even a pedantic, difference, but I have found it to be a profound observation.

Imagine, for example, your program has 100 possible ASLR states: in 99 of those states it takes 1s to run and in the 1 remaining state it takes 0.8s to run. Using the minimum, you will think your program takes 0.8s to run even though there's only a 1% of chance of observing that performance in practise. That's bad, IMHO, but the problem compounds when you compare different versions of the same program. Imagine that I optimise the program such that in those 99 slow states the program now takes 0.9s to run, but in the remaining state it still takes 0.8s. The minimum will tell me that my optimisation made no difference (and thus should probably be removed) even though in 99% of cases I've improved performance by 10%.
Leaving an uninhabitable planet for future generations is not exactly my idea of getting off free.
I think this kind of reasoning needs to be questioned since the mechanisms available to large corporations and the wealthy completely outclass those available to less wealthy citizens and small business.

Additionally, despite the delusion that some companies and individuals may have, they damn well do have similar and perhaps greater obligation to work towards the betterment of society. For some reason, we seem to think that a group of people somehow have less ethical obligations than individuals.
When the author mentioned the “messy kitchen” I thought it was a joke. Now I realise, as a European, that American house design is just absurd form over function. If you need a second, practical kitchen to deal with your main kitchen not being usable for its ostensible purpose then something is horribly wrong.
Which one is broken? There were at least two, last I checked:

* https://github.com/bollwyvl/hy_kernel/

* https://github.com/Calysto/calysto_hy
Well yeah, but I was talking about getting data off the system onto my own notebook (for the purpose of writing the lab course report). A 90s-era hard drive would be even more impractical for this purpose than a floppy disk.
Actually laughed out loud for this one, thanks! :)
One of those rare times in which the title of the article sums up the article, and in a way that is just brilliant.
There is a Java ME version of WhatsApp available. Many dumb phones support Java ME apps.
Isn't it great to know corruption has ended completely now that the previous party was removed?
Sounds alarming, but not true. If you don’t know the salt, you are not cracking an MD5 password on basic hardware. You are probably not cracking the password in any reasonable time, period.

And when you have a unique salt per user, that’s basically game over.
If peer review in Academia is anything like code review in corporate software dev it's probably next to worthless.
"The restaurants in particular are restive, not least because food is already a low-margin business."

Coupled with the recent survey from US Foods that 28 percent of food couriers admit to eating food from their deliveries(1) are some of the reasons for the consolidation in the food delivery industry.

(1) https://www.usfoods.com/our-services/business-trends/2019-fo...
Apps are often more of an obstacle to connection than the aid they promise to be. What we mean to each other cannot be quantified with ones and zeros.

To get more thin, artificial connections that never used to happen, we give up the real ones. Now friends don't have to met up to get the latest news. They know everything already, so no need to met up with a real live person.

My advice is if you have a great friend in real life, do NOT friend them on Facebook!

Of course, as long as we've been wealthy enough to afford separate shacks, we've had people die in isolation without anybody knowing. It's not a new problem. But I think it's going to become more common, not less, unfortunately.
Nice write-up, would love something like this for more advanced concepts such as lookahead and condition.
>Because I'm still a bit confused at what Lisp is!

You're in for a treat!

http://www.paulgraham.com/avg.html
They wouldn't even need cert pinning would they? Just cert validation. Unless you have access to the device to install an alternate ca, then regular cert validation is going to fail when it reads your fake cert issued from a non-authoritative source.
> they damn well do have similar and perhaps greater obligation to work towards the betterment of society.

Says who?

I don't hold the elevator door if I see someone behind me. I don't tip. I don't recycle. I don't donate blood. I don't vote. I give preferential job treatment to my friends.

Is it illegal to be an asshole?
I think “culture” is a vague word that can be made to do a lot of work, a weasel word. Culture as a reason for not hiring someone strikes me a very suspicious. There should be a concrete reason the person is not fit for the work as part of a no-hire decision.

“Culture” should be an emergent property of the people who work at the company.
Given that data, doesn't their attempt to call this "system updates" constitute a violation of California's data breach notification laws? https://oag.ca.gov/privacy/databreach/reporting
Not sure exactly, but when I pull out my Nokia 106 in Ontario or Michigan, there's a good chance somebody will refer to it as a burner phone.

A phone you can afford to discard ("burn"), either after its first use, or on a schedule, or when something risky happens (you are moving a lot of money or material, cheating on your spouse, etc.).

I just use it for the standby time (nearing a month).
Burner phones are a central plot point in later seasons of The Wire, too.
On the surface, it seems like a good idea especially in the face of upcoming "water wars" if some transformational technology involving cheap clean water isn't trotted out by mid-century.

If Capital wants billions of new consumer and their resultant markets, Capital better steward the natural resources that enable those billions to thrive.
> There's also a few experimental train lines running on fuel cells

Your wording is a bit funny, so let me clarify: That's an actual train line with actual passengers. More train lines will be converted from diesel to hydrogen soon.
Hi, OP here.

My friend and I created this because we think the current state of how we share programming knowledge on the internet is broken and mostly neglected.
We just got frustrated by reading another Medium article with code in it.

We think the best place to read something with code has already been invented - IDE. We started with an extension for Visual Studio Code.

The core idea is that you can keep your codebase separated from the text and at the same time, you can create bindings between smaller parts of code and parts of the text. This way you can have growing codebase and reveal the story behind it.

The extension is kinda buggy but usable and shows the core idea. Feel free to ask any questions.
They're probably the largest hospital provider in the country. Looking at their wiki it says there's 152 hospitals and 1400 outpatient facilities. Plus all the other VA responsibilities they fulfill.

It's a big organization and they have a lot of 'customers'
How is Phoronix Test Suite these days? Back when it was announced, people looked at it and grilled it (IIRC at Slashdot). No idea how it is these days.
Usually the salt is stored along the login and password.
See Boeing MCAS for an example of how a seemingly simple fix is actually not.
Friend,
(1) there is a versioning mechanism already in place
(2) Cython is used to optimize the speed
(3) FunctorFlow only works on Repl.it. We are in alpha.
It does not work on your machine. Just go and install it. See if it works. It doesn't!
Students in the US can buy their way in as well, although it's rare as it totally requires board approval and a significant amount of money. I know of a high school classmate who talked to the board of a public University after his parents were willing to fund a building and was accepted only after that. The issue with the Varsity Blues was that the money didn't go directly to the school and that it involved bribing an athletic coach in order to grant admission on false pretenses.
Best regex intro I’ve read
Cuddles is a cuttlefish.
Yeah, I think people should complain about the lawmakers not the companies. Maybe that way we will see some changes but I doubt given the current administration stance on the subject(i.e Digital Tax)
Which city is that?

I'm in Berlin and it's complete chaos, even more than usual since they introduced scooters a few months ago. We have at least 5 bicycle companies and 4 scooter ones.

https://imgur.com/a/diAmFH9
Yes! I think this is fantastic. Tidepool’s employees actually have worked on many of these open-source projects, are funded a lot by the JDRF (one of the biggest T1 Diabetes NFP’s) ans seem to be the most aligned with diabetic’s interests.

Personally I’ve been using their Tidepool software for two years before this and it’s very good. The Tidepool Loop is actually based off of another FLOSS APS called Loop - so it’s likely the efforts will not go to waste. That being said, there’s still possibility that the pump manufacturers have interest to stifle their development - but we’ll see.
> ...The company “robbed their users of the chance to evaluate their exposure” by not informing customers of the breach when it happened...

StockX is valued at $1B and aside from their cataclysmic choice of using MD5 + salt as their way of hashing passwords (They obviously don't take security seriously) the company failed to inform their customers of this security breach as soon as it happened and left it very late for the customers to change their credentials. I would expect any unicorn valued company to have some form of incident-response system to immediately inform staff of the breach and to instantly reset all user credentials and to notify their users.

Instead they didn't inform their customers after the breach and now someone is calculating all those MD5 collisions and attacking all accounts with common passwords.

In the case of StockX handling this security breach, this is un-professionalism at its finest.
A helpful tip for finding a new job that uses technologies you don't have professional experience with, but you want to learn...

Say you want to learn Rust, but all your experience is in Javascript. Most recruiters will immediately filter out your resume if you don't have the keyword "Rust" somewhere in the document.

Before you start sending out your resume, spend a few weeks hacking on a Rust side project to learn some of the basics. Then on your resume, include a description at the top saying you're proficient in Javascript, but want the opportunity to work in Rust. Then include a "Side Projects" section at the bottom that lists your Rust experience.

I've landed 3 jobs that way, where I'm hired for my experience with X, but under the condition I will have the opportunity to learn Y. Otherwise, it's easy to get trapped working with the same tech at a new job, and your skills eventually become obsolete over time.
Reminds me of the discussion of the tragedy of the commons from yesterday.

https://news.ycombinator.com/item?id=20602217