News for hackers. Stuff that matters.

maksimum

This is good nuance to add to the conversation, thanks.

I think in most cases you have to trust some group of parties. As an individual you likely don't have enough time and expertise to fully validate everything that runs on your hardware.

Do you trust the OSS community, hardware vendors, OS vendors like IBM, Apple, M$, do you trust third party vendors like Crowdstrike?

For me, I prefer to minimize the number of parties I have to trust, and my trust is based on historical track record. I don't mind paying and giving up functionality.

A reference (that lays out the statistical arguments) is "Common Sense on Mutual Funds" by John Bogle.
What would you rather have for the next 5 years? Why?
Many reasons. Time value of money, competition, maybe even regulation.
Re:Making Python Programs Blazingly Fast on Tuesday January 14, 2020 @01:56AM (#22042482)
Compared to __slots__ (also Python 3.7.4)

Using your definition of class X

  %timeit x.w()
  313 ns ± 18.3 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
Add __slots__

  class X:
    __slots__ = ('a')
    def w(z):
      a = z.a
      return a+a+a+a+a

  %timeit x.w()
  271 ns ± 7.13 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
About 14% less time.
Re:Python Type Hints on Sunday December 29, 2019 @01:37AM (#21904452)
> The condition is, though, that I need to be able to quickly run the program to validate just all of it to work.

That's a condition for all TDD.

> I know there's testing frameworks, although it seems more of an eclectic mess than Java

If you look at the test suites for popular libraries like numpy, django, airflow it's mostly `pytest`, `unittest` (part of the standard library), and `nose`.

> where testing and mocking is just a little harder to do...

Mocking is actually pretty easy to do in python using pytest.monkeypatch or unittest.mock. Compared to mocking in a strongly typed language like C++ (and I assume Java) if an object you're mocking implements a particular interface, you would only have to mock out the parts that get exercied by the codepath in the tests you care about.

TIL... Thanks for highlighting this.
> We've lost this battle.

I think you could look at the battle/war from a different perspectives, and come up with different conclusions.

In the mainstream (whatever that is?) it appears that convenience wins. And hardware/software vendors seem to make the assumption that customers won't complain if their data is harvested. I think that's where you're coming from?

On the (privacy) enthusiast things, the horizon looks much better. We've got great software that makes self-hosting easier: FreeNAS, Nextcloud, Docker, Plex, NixOS, etc. We have more choice in phones: we can still use "dumbphones", or use open source operating systems, or choose manufacturers with better privacy track records. I'm not familiar with consumer electronics as much, but buying low end/dumb devices (TVs, appliances) is still viable. And the open source home automation movement keeps getting traction with hardware and software.

Re:How to undo almost anything with Git (2015) on Tuesday December 24, 2019 @01:31AM (#21870316)
Wow, that's super unlikely. How many commits did the repo have?

According to [1] using 3 letters you'd need at least 72 commits to have at least 50% chance to observe a clash. Using 6 letters you'd need at least 3977 commits, lol.

[1] https://en.wikipedia.org/wiki/Birthday_problem#The_generaliz...

Re:How to undo almost anything with Git (2015) on Tuesday December 24, 2019 @01:11AM (#21870240)
> It works in conjunction with the command line

Do you know of git GUIs that explicitly maintain a bijection between the GUI and the underlying command history? It'd be cool to use the GUI and see the command history, or use the CLI and see updates in the GUI.

Re:Uber and Lyft Suggest the Days of Cheap Rides Could Be Over on Saturday December 14, 2019 @01:51PM (#21791293)
> I don't interpret this as charging different customers different prices per se.

Based on my experience Lyft and Uber charge different prices to different customers with identical trips. I've tested this by asking friends with who I'm about to share a ride with to request the same trip as me, and compare prices. We've observed differences of 10-20%.

> Knowing what your service is worth to customers so you can extract a greater fraction of this is pricing 101.

Where this becomes problematic is in the age of big data. When a company can build an accurate profile of me, they can extract maximum prices from me. We need laws that mandate what definition of "profile" is allowed to be used for pricing.

I'm not sure why we accept price discrimination at the individual level for airlines and Lyft/Uber. I'm pretty sure people would be outraged if Amazon started price discriminating based on your purchase history.

Re:Uber and Lyft Suggest the Days of Cheap Rides Could Be Over on Saturday December 14, 2019 @01:16PM (#21791055)
> more precisely predict what riders might be willing to pay for a ride

It's weird to me that this sort of price discrimination is legal.

E.g. given this information, my incentive as a rider is to never tip (so that their algorithm doesn't identify me as "willing to pay" more). Maybe I could also make a new Lyft account every time I need a ride?

Re:My Python Development Environment, 2020 Edition on Tuesday November 12, 2019 @01:32AM (#21511989)
Docker + setuptools/pip + python is great for development and production. Docker is definitely worth learning, and is pretty easy to learn.
Re:My Python Development Environment, 2020 Edition on Tuesday November 12, 2019 @01:29AM (#21511982)
It seems like long builds are either (a) necessary or (b) user error. (a) If you have a tree of dependencies and you change the root, you should rebuild everything that depends on it to make sure it's still compatible. (b) if you placed your application into one of the initial Dockerfile layers, but then you're installing dependencies that don't depend on you, it's user error.

What's the situation where your application needs to go first in the Dockerfile, and then you need to put a bunch of stuff that doesn't depend on your application?

Re:My Python Development Environment, 2020 Edition on Tuesday November 12, 2019 @01:23AM (#21511951)
I think contemporary best practices start with the production environment and work backwards towards creating a development environment as close to the production environment as possible.

These days, most productions environments are effectively isolated containers. If your production environment is a container, you probably should develop in a container as well. In that case you don't need much tooling for isolating an application's dependencies from other applications.

The tooling that you need is to build a python application, which means (1) get the dependencies (2) copy over some source code (or invoke the C-compiler if build a C<->Python extension) (3) run tests. Python's builtin setuptools does that fine. It didn't strike me as amazingly simple, but it's not amazingly complex either. pip is essentially a convenience wrapper for setuptools, i.e. pip is to setuptools as apt is to dpkg.

Basically, I believe that because of docker isolation is a irrelevant criterion by which to judge a language/ecosystem.

Re:My Python Development Environment, 2020 Edition on Tuesday November 12, 2019 @01:12AM (#21511903)
That does sound convenient. I wonder if the virtualenv aspect is relevant though, i.e. do people really deploy npm apps outside of a container/isolation layer?

I imagine if you're deploying docker, you probably should be developing in docker (e.g. using PyCharm's remote interpreter/docker interpreter integration).

> It’s not really clear how to best use containers to protect your privacy

Do you think private browsing sessions are also unclear/have unintuitive UX? It seems like firefox containers are just private browsing sessions that you can close and re-open.

Re:What’s New in Python 3.8 on Tuesday October 15, 2019 @02:39AM (#21256075)
As a python programmer I would have no idea what `valid_P` is supposed to mean. Valid Pascals?
Re:I find journaling indispensable on Saturday August 31, 2019 @07:32PM (#20849461)
Whenever I hear people talk about picking up journaling I come away a little annoyed.

They publicly describe a habit that they claim is useful. To me that implies that they're suggesting others invest time into the habit.

But I've never been compelled by the arguments. I haven't seen someone try to make (even qualitatively) refutable claims. If you don't make refutable claims, how can I experiment in order to see whether the habit makes sense for me?

Re:RSI as a Developer on Saturday August 31, 2019 @06:29PM (#20849199)
Took me about 3 weeks to get to proficient and a month or two to be fluent. Mainly playing on a dvorak typing tutor website while watching TV.
Re:DoorDash Buying Caviar from Square for $410M on Friday August 02, 2019 @02:57AM (#20591105)
Have you been tipping on your AWS bill? Or the package delivery workers? (What does Amazon have to do with this?)
Re:Finding Fibonacci numbers using linear algebra on Saturday July 27, 2019 @09:25PM (#20545327)
Re:In Defence of the Technical Interview on Monday June 17, 2019 @12:11AM (#20199856)
Did you vet your question and its phrasing with your co-workers? What did they say?
Re:Go is Google's language, not ours on Wednesday May 22, 2019 @02:38AM (#19978412)
For what purpose?
Re:Ask HN: What does your ML pipeline look like? on Monday April 22, 2019 @01:32AM (#19716772)
Interesting topic. :)

This is mainly relevant if your data is used for training.

It seems like you'd want to use a log-based system like kafka to manage versioning and state in this case. I imagine you could:

1. Store incoming training data in a "raw data" topic.

2. A model trainer consumes incoming training data, updates a model's state, and at a pre-determined period writes the model's state as of a given offset in the "raw data" topic in a "model state checkpoint" topic.

3. Then you probably have some "regression testing" workflow that reads from the "model state checkpoint" topic and upon success writes to a "latest best model" topic.

4. Workers that use the model in production read from the "latest best model" topic and update their state upon a change.

I imagine you could add constraints about "model" continuity or gradual release to production that would make the process more complex, but I feel like fundamentally kafka solves a lot of the distributed systems problems.

Re:Ask HN: What does your ML pipeline look like? on Sunday April 21, 2019 @03:37PM (#19714078)
> Containers are meant to be stateless infrastructure. By downloading something at startup, you're breaking that contract implicitly.

I feel that mounting a NFS partition is a similar break of contract. I.e. you could see the same image behave differently depending on what's in the NFS partition. I feel like to get data in a "reproducible" way you need to pull it from a data versioning system. I think there's different ways to implement data versioning with their own trade-offs. NFS and S3, among others, could be used to implement data versioning.

I agree with you that in theory an NFS is more performant because it allows you to load lazily.

> platform providers that primarily monetize through advertising should be in their own category: as I noted above, because these platform providers separate monetization from content supply and consumption, there is no price or payment mechanism to incentivize them to be concerned with problematic content

The article does a good job of explaining why YouTube and Facebook don't currently do a good job of currating content, or whether that should even be their responsibility. It's not about machine learning, it's about price incentives.

Facebook (and Google and others) can easily identify themes in natural language both written and spoken. They're really good at those problems because they're used as inputs for ad sales.

Identifying themes in video is harder than natural language. But fundamentally it requires the same kind of ML tools as natural language, which these companies have already mastered. I think the bigger issue is that Facebook doesn't have a business purpose for understanding video as compelling as it has for understanding natural language. They also don't have a business purpose for building scalable content censoring workflows since there's no serious regulation.

Older »