Skip Navigation

Posts
14
Comments
539
Joined
3 yr. ago

Professional software engineer, musician, gamer, stoic, democratic socialist

  • One Piece is best enjoyed as a manga. Reading it goes much faster and loses a bit of the anime character tropes.

  • Remember how you could play this on the local network with anyone who had a Nintendo DS? Only one person needed the game cartridge. So fucking cool.

  • Ha. I'd expect nothing less from Theo.

  • Didn't Firefox just release a new feature that prevents fingerprinting? Hard to get a reading on Mozilla these days.

  • 素晴らしいアップりですね!使おう。

    音のボタンが壊れてるそうです。音が出ません。

     
        
    Play UI + feedback sound effects: Off
    Enable pronunciation audio: On
    
      

    ^ この設定では音が出ません

     
        
    Play UI + feedback sound effects: On
    Enable pronunciation audio: On
    
      

    ^ この設定では音が出ます

    発音の録音があればいいな。

  • My driving instructor said the airbag could rip the skin off your arms lol

  • I suspect every language does this to some extent. Some good examples from Japanese:

    靴 = shoes 下 = under 靴下 = socks

    手 = hand 紙 = paper 手紙 = letter

    歯 = teeth 車 = wheel 歯車 = cog / gear

    火 = fire 山 = mountain 火山 = volcano

    Sadly (?) the Japanese compounds are often only compounds of the symbols, not the spoken words.

  • ICE just needs to scan his face with the Racistron 2000 app and it overrides his birth certificate, haven't you heard?

  • Skyrim came out 14 years ago.

  • SQLite

    Jump
  • I believe both SERIALIZABLE and REPEATABLE READ isolation levels would raise an error for this example.

    And I looked this up: Postgres won't retry the transaction for you either. Though ultimately I think this a good default behavior.

  • SQLite

    Jump
  • There is a subtle scenario with read-modify-write transactions in MVCC where SQLite lacks some grace (in my opinion).

    In MVCC, transactions work with a point-in-time (read "between atomic transactions") consistent "read snapshot" of the database.

    Consider this example:

    1. Transaction A begins and reads from table foo.
    2. Transaction B begins and updates table foo.
    3. Both transactions commit.

    There is no conflict here because these transactions are isolated from each other via the snapshot mechanism. Transaction A's read snapshot is immutable and will not see any writes from transaction B, even if they are happening concurrently.

    Now what happens in this example (from the OP):

    1. Transaction A begins and reads from table foo.
    2. Transaction B begins and updates table foo.
    3. Transaction B commits.
    4. Transaction A tries to update foo.

    This is a true conflict because both transactions are trying to write to foo, and transaction A's writes might be based on what it just read. There is no consistent way for A to proceed, because B already wrote to foo, invalidating A's read snapshot.

    So SQLite handles this by returning an error to A, effectively requiring A to restart the transaction.

    There are other ways this could be handled though. The DB could optimistically retry the transaction for you. There is even a special BEGIN IMMEDIATE; statement that it could use to proactively take a write lock on foo so that the transaction doesn't get starved by other writers. But SQLite puts all of the responsibility on users to handle this.

    I'm not an expert, so there could be a very good reason that SQLite works this way, but it feels a bit annoying as a user.

    I don't actually know off the top of my head how PostgresQL handles this particular scenario.

  • Spent way too long trying to see how oxford comma was relevant.

    • Saying goodbye to your friend before realizing you both parked next to each other, so you follow not too closely behind so they don't notice.
  • I just own the mistake and turn around. No one gives a fuck in public.

    It's funnier when you are leaving a social event and you need to change directions in front of the people you were just with.

  • Probably won't solve all of your problems, but I like to at least change git's default pager to delta.

  • If it's that prevalent, is it really improper at this point?

  • Let's stop referring to AAVE as "improper".

  • I agree with the article's ideas, but certain things about the execution bother me.

    1. calculate_order_total_for_customer. I'd just call it calculate_order_total. It's clear than any order will have a customer, it's in the type signature.
    2. is_user_eligible_for_discount. I'd call it user_is_eligible_for_discount. Because inevitably that function is getting called in an if statement, and you'd rather it read closer to proper English: if user_is_eligible_for_discount: ....
    3. "Designing for Tomorrow". I agree that dependency injection is a valuable technique, but it's not always strictly necessary and they seem to say you might as well always do it just in case. That's counter to YAGNI. Make sure you have an immediate use case, or let future you do it if you end up needing it. It's not hard to refactor something to inject a dependency.