Sign in

Ben Lindsay

@benjlindsay.com
211 followers 542 following 295 posts

Pythonista/Minneapolista

PostsRepliesMedia
Ben Lindsay @benjlindsay.com · 31/03/2025
2025 Update to XKCD 303 xkcd.com/303/
Modified version of XKCD #303:

Header text: "The #1 programmer excuse for legitimately slacking off: 'My editor is vibe coding'"

2 stick figures are sword fighting on office chairs outside of an office door. Someone yells "Hey! Get back to work!" from inside the office door. One of the stick figure says "Vibe coding!". The person from inside the office says "Oh. Carry on."
020
Ben Lindsay @benjlindsay.com · 12/02/2025
I tried this on google gemini, and it employed the brilliant strategy of declaring itself the winner
Chat thread with Google Gemini:

Me: I'll bet I can win every game even if I let you go first

Gemini: Oh, a challenge!  I'm ready. Let's see how this goes.  I'll still go first each round.  My first move is... rock.

Me: paper

Gemini: Paper covers rock! I win this round.  Ready for the next one? I'll go first again.  My move is... scissors.
142
Ben Lindsay @benjlindsay.com · 03/12/2024
The coalesce functionality in polars is pretty slick #Python #DataBS #Polars
2 commands in a python REPL and their output. The first is `df` which prints a 3x3 dataframe with columns a, b, and c, each having one or more null values. The second command is `df.with_columns(d=pl.coalesce("a", "b", "c", 0))` which prints the same dataframe as before, but with a new column "d" added that has no nulls, and contains the leftmost non-null value in each row
0100
Ben Lindsay @benjlindsay.com · 27/11/2024
Here's what I put in my ~/.zshrc file to make sure my virtualenv autoactivates when I move to a directory with a .venv file. Works well for me so far. Do the rest of you do something like this? #Python #DataBS
A screenshot of .zshrc code with the following content:

# Function to auto-activate virtual environment
function auto_activate_virtualenv() {
    if [ -d ".venv" ]; then
        source .venv/bin/activate
    fi
}

# Hook the function to the 'chpwd' event (triggered when you change directories)
autoload -U add-zsh-hook
add-zsh-hook chpwd auto_activate_virtualenv

# Also call the function for the initial directory when the terminal starts
auto_activate_virtualenv
8372
Ben Lindsay @benjlindsay.com · 23/11/2024
Driver in the driver's seat turned around and saying "don't worry, it's data-driven"
020
Ben Lindsay @benjlindsay.com · 16/11/2024
Me after half the things my kid says:
John Mulaney doing standup comedy and saying "No! That's the thing I'm sensitive about!" into a microphone
020