Hacker Newsnew | past | comments | ask | show | jobs | submit | ryan-duve's commentslogin

I only spent a minute on the trainer, but my recommendation is to change the user experience from "type M 5 times in a row" to something like "get to the target with a single keystroke". Without any expertise is making a Vim training program, I feel like showing someone a goal and having them think of what keystrokes gets them there will be more effective than telling them the keystroke and having them type it 5 times consecutively.


Good news: no p-value threshold needs to be passed to switch from one UI layout to another. As long as they all cost the same amount of money to host/maintain/whatever, the point estimate is sufficient. The reason is, at the end of the day, some layout has to be shown, and if each option had an equal number of visitors during the test, you can safely pick the one with the most signups.

When choosing one of several A/B test options, a hypothesis test is not needed to validate the choice.


Yes, but assuming it was enhancing something already there, it was all pointless work.


I wonder if the author would have thought Pandas feels less clunky if they knew about `.eval`?

    import pandas as pd


    purchases = pd.read_csv("purchases.csv")

    (
        purchases.loc[
            lambda x: x["amount"] < 10 * x.groupby("country")["amount"].transform("median")
        ]
        .eval("total=amount-discount")
        .groupby("country")["total"]
        .sum()
    )


Or with and .assign:

    (
        purchases.loc[
            lambda x: x["amount"] < 10 * x.groupby("country")["amount"].transform("median")
        ]
        .assign(total=lambda df: df["amount"] - df["discount"])
        .groupby("country")["total"]
        .sum()
        .reset_index()  # to produce a DataFrame result
    )


``` library(data.table)

purchases[amount <= median(amount)*10][, .(total = sum(amount - discount)), by = .(country)][order(country)]

```

- no quotes needed - no loc needed - only 1 groupby needed


> The current 9-series configuration, which will end with 9ZZZ999, is projected to end sometime in 2026... The next generation of license plates will flip that structure on its head, moving to a “Numeral Numeral Numeral Alpha Alpha Alpha Numeral” format — such as 000AAA0.

Does anyone know why they care about this structure? Naively, there are 36^7 (minus edge cases) combinations available, which will always be sufficient.


In addition to the more concrete reasons, abstractly they're getting a bit of extra usage out of the namespace by segmenting it. A 9ZZZ999-type license plate is not just any license plate — it's specifically an ordinary private vehicle (as opposed to a state-owned vehicle or a trailer) that was registered in California between 1980 and 2026, and both of those facts are durably encoded in the number. Notably, both of these are also very human-readable facts, which for most of the existence of the car bureaucracy was extremely germane. The CA DMV got its digital-records act together in the 1990s (this is from memory, it might have been in the Bush years but it certainly wasn't in the '80s and it was a done deal by the Obama era) but there was a long time before that when "just plug it into the DB" was not an option because the DB was a filing cabinet and the query engine was a human digging through it.


So for example the capital O on license plates in California is only distinguished from the zero by being slightly more squarish, the capital G is mostly distinguished from six by six being slightly more smooth and diagonal in its top arc. I and one are a bit further visually, as are B and 8, but it would probably fool a traffic camera that was taking down plates automatically.

In addition, all-numbers-plates, I believe, are reserved by California exempt plates (emergency vehicles, police), and vanity plates are absolutely a thing, much more likely to start and/or end on a letter, so that's why you see numbers at the beginning and end. Like you can kinda see “6EIC023” and say “oh yeah my car looks like an ad for Geico” but because the start and end are numbers it doesn't occur to most people.


All-numbers would be worse not better? That's only 10^7, even if they kept the first one 1-9 and did 26^7,they'd have billions, seems like the obvious solution, but I take it there must be some limitations that make it hard to go there.


The DV (Disabled Veteran) plates are notably all-numerical. They are also issued in order of application.

That’s the primary way you can differentiate them at a glance from the DP (Disabled Person) plates.

Just a little odd fact; I know you meant the more standard plates.


The DMV considers the "DP" at the end of a DV plate to be part of the identifier. So DV123DP, in their database.


I think the DV and DP have implicit prefixes (DV and DP respectively) for when they are referenced or recorded.

I may be wrong, but that’s what get when I see them.


It's easier for memory and verbalization.


So... the headline is BS, and California is just being dumb?

This is not a shock. After moving here, I find that CA's highly-touted "car culture" is pretty retrograde compared to other major metro areas.


Down-modded by flunkie CA administrators.


When I click "Join the waitlist" on Firefox I see an empty beige box on an otherwise blank page.


Thanks for letting us know. Unfortunately we haven't been able to reproduce that with the current version of Firefox, but if you'd like to email us at hello@freefollow.org we'll add you to the list manually.


In Edge I get a big red screen yapping about the site being unsafe.


What "very simple columnar format" did you switch to?



For the curious, from the link above:

> log, plank, stick, crafting table, wooden pickaxe, cobblestone, stone pickaxe, iron ore, furnace, iron ingot, iron pickaxe and diamond


Could you share an example of a workflow using the built in feature to run tests in Vim?


Sure, here's a recorded example: https://www.youtube.com/watch?v=TUeousvp4PQ


TL;DR, YAGNI

I had a former boss who strongly pushed my team to use the repository pattern for a microservice. The team wanted to try it out since it was new to us and, like the other commenters are saying, it worked but we never actually needed it. So it just sat there as another layer of abstraction, more code, more tests, and nothing benefited from it.

Anecdotally, the project was stopped after nine months because it took too long. The decision to use the repository pattern wasn't the straw that broke the camel's back, but I think using patterns that were more complicated than the usecase required was at the heart of it.


Could you give me some insights what the possible alternative was that you would have rather seen?

I am either now learning that the Repository pattern is something different than what I understand it to be, or there is misunderstanding here.

I cannot understand how (basically) tucking away database access code in a repository can lead to complicated code, long development times, and the entire project failing.


Your understanding of the repository pattern is correct. It's the other people in this thread that seem to have misunderstood it and/or implemented it incorrectly. I use the repository pattern in virtually every service (when appropriate) and it's incredibly simple, easy to test and document, and easy to teach to coworkers. Because most of our services use the repository pattern, we can jump into any project we're not familiar with and immediately have the lay of the land, knowing where to go to find business logic or make modifications.

One thing to note -- you stated in another comment that the repository pattern is just for database access, but this isn't really true. You can use the repository pattern for any type of service that requires fetching data from some other location or multiple locations -- whether that's a database, another HTTP API, a plain old file system, a gRPC server, an ftp server, a message queue, an email service... whatever.

This has been hugely helpful for me as one of the things my company does is aggregate data from a lot of other APIs (whois records, stuff of that nature). Multiple times we've had to switch providers due to contract issues or because we found something better/cheaper. Being able to swap out implementations was incredibly helpful because the business logic layer and its unit tests didn't need to be touched at all.

Before I started my current role, we had been using kafka for message queues. There was a huge initiative to switch over to rabbit and it was extremely painful ripping out all the kafka stuff and replacing it with rabbit stuff and it took forever and we still have issues with how the switch was executed to this day, years later. If we'd been using the repository pattern, the switch would've been a piece of cake.


Thanks. I was starting to get pretty insecure about it. I don't actually know why in my brain it was tightly linked to only database access. It makes perfect sense to apply it to other types of data retrieval too. Thanks for the insights!


It doesn't. Use it; it's easy.


> And don't even get me started with dependency injection in Python.

Could I get you started? Or could you point me to a place to get myself started? I primarily code in Python and I've found dependency injection, by which I mean giving a function all the inputs it needs to calculate via parameters, is a principle worth designing projects around.


Here’s 1% that gives 50% of result. Replace:

    class C:
        def __init__(self):
            self.foo = ConcreteFoo()

with:

   class C:
        def __init__(self, foo: SupportsFoo):
            self.foo = foo

where SupportsFoo is a Protocol. That’s it.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: