this post was submitted on 03 Apr 2024
425 points (89.1% liked)

Programmer Humor

32048 readers
1614 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 5 months ago

Having a similar moment right now. I'm trying to figure out how to compute the transformation matrix for reflecting a bitmap of any given dimension across the y axis, but all the tutorials that come up in my search just tell me to import some python library. Its like nobody wants to learn how to do anything anymore.

[–] [email protected] 25 points 5 months ago (1 children)

Remove seems like a terrible name for that method.

[–] [email protected] 16 points 5 months ago (1 children)

While yes, the true issue here is that, for some reason, the code only imports the remove method from the package, instead of importing the package and doing rembg.remove().

[–] [email protected] 3 points 5 months ago

if you only wanted to import remove you could maybe import as rembg_remove

unless there's some weird taboo against doing that I don't know about, I'm an awful programmer tbh

[–] [email protected] 33 points 5 months ago* (last edited 5 months ago) (1 children)

That reminds me back when some time ago, I was tired of dealing with sketchy, and often broken, websites and programs for downloading videos from Youtube. I figured these sorts of programs must be doing something along the lines of downloading the Youtube page, parsing through the massive pile of HTML and Javascript to find the stream, and then saving that to a video file. That seemed like something I could do myself with Python, so I set out to see if I could figure out how to do it.

A few minutes and a couple of web searches later, I discovered that someone else had figured that all out already and I just needed to do "pip install pytube".

[–] [email protected] 35 points 5 months ago (2 children)

Have you ever heard about yt-dl?

[–] [email protected] 9 points 5 months ago

I did switch over to yt-dlp some time later as development seems to have slowed on Pytube and yt-dlp seems to be where all the activity is.

[–] [email protected] 14 points 5 months ago
[–] [email protected] 17 points 5 months ago

Waiting for the “in one line” tutorial

[–] [email protected] 13 points 5 months ago

No work in micropython on uno? pls help. Need thesis in Rust do tomorgh. Removed French bloat rm -fr catz tut. Why

[–] [email protected] 58 points 5 months ago

This is exactly why we love Python (and other languages with rich package ecosystem, even when only on their niche usage cases). You can build upon other people's knowledge and effort to do cool things efficiently and effectively!

[–] [email protected] 7 points 5 months ago (1 children)
[–] [email protected] 7 points 5 months ago

All the best things in life are intangible.

[–] [email protected] 58 points 5 months ago (2 children)

Hahaha now code-golf it. One line FTW!

remove(Image.open(‘cl.jpeg’)).save(‘output.png’)

[–] [email protected] 5 points 5 months ago (2 children)

Code golf! I just learned something new 😂

[–] [email protected] 10 points 5 months ago

https://codegolf.stackexchange.com/

Enjoy a new rabbit hole to dive down

[–] [email protected] 2 points 5 months ago* (last edited 5 months ago) (1 children)

You never heard of code Golf before? It's usually programming challenges where the goal is to use the smallest number of source code characters possible.

[–] [email protected] 2 points 5 months ago

I haven't either but I like it.

[–] [email protected] 59 points 5 months ago (3 children)

If I find this in production I'm whipping your ballsack till you change it back.

[–] [email protected] 19 points 5 months ago

import("rembg").remove(import("PIL").Image.open(‘cl.jpeg’)).save(‘output.png’)

[–] [email protected] 15 points 5 months ago

Can i hire you?

[–] [email protected] 9 points 5 months ago

So I'm not going to change it

[–] [email protected] 5 points 5 months ago (1 children)

I know this is a joke, but I totally wanna run the code and see what happens or what errors I get just for fun.

[–] [email protected] 3 points 5 months ago

According to PyPI, the library is genuine.

[–] [email protected] 30 points 5 months ago

There's a python library for everything

[–] [email protected] 28 points 5 months ago (1 children)
[–] [email protected] 4 points 5 months ago* (last edited 5 months ago)

*the libraries that are made for python

load more comments
view more: next ›