programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

Lucien, in Twitter/GitHubProjects has no chill 😅
@Lucien@hexbear.net avatar

Man fuck that, if I’m in a coma work can suck my dick

Nakoichi,
@Nakoichi@hexbear.net avatar

probably having some sick ass dreams and not having to work

QuazarOmega,

…dreaming of all tests passing

erayerdin,

This is the guy who has 10 years experience on a 1 year old framework.

cabhan, in Rust's static linter is called "Clippy" for a reason.

I wish this was exaggerated, but it isn’t at all. Every time I try to learn Haskell, I end up in some tutorial: “You know how you sometimes need to represent eigenvectors in an n-dimensional plane with isotonically theoretical pulsarfunctions? Haskell types make that easy!”

dauerstaender, in I'll just be a quick 3h

Only 3h? What kind sql magician are you?!

reverendsteveii, (edited ) in Bill is a pro grammer

`//Get CustomerInfo from CustomerRepository by Customer ID or else throw an CustomerNotFoundException

public CustomerInfo getById(String customerId) {


<span style="color:#323232;">return customerRepository.getById(customerId).orElseThrow(new CustomerNotFoundException());
</span>

}`

This is the kind of pointless comment I see in my codebase all the time. Best I can tell, a couple of my coworkers like to plan out their code using comments, then backfill in the actual executable code. That’s fine, but they leave the comments in when they add no value.

` public static LocalDate parseEndDateFromString(String dateString) {


<span style="color:#323232;">    try {
</span><span style="color:#323232;">
</span><span style="color:#323232;">        String[] split = dateString.split("-");
</span><span style="color:#323232;">
</span><span style="color:#323232;">        //In order to get the last day of the desired month, we go to the first day of the next month, account for rollover, then subtract one day
</span><span style="color:#323232;">
</span><span style="color:#323232;">        int month = Integer.parseInt(split[0]) == 12 ? 1 : Integer.parseInt(split[0]) + 1;
</span><span style="color:#323232;">
</span><span style="color:#323232;">        return LocalDate.of(Integer.parseInt(split[1]), month, 1).minusDays(1);
</span><span style="color:#323232;">
</span><span style="color:#323232;">    } catch (Exception e) {
</span><span style="color:#323232;">
</span><span style="color:#323232;">        throw new RuntimeException("Invalid date format - must be MM-YYYY");
</span><span style="color:#323232;">
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">
</span><span style="color:#323232;">}`
</span>

Stuff like this, otoh, is where comments are useful. The required format is obvious from the error message, the param and return from the method signature, the only part that requires a comment is the fiddly logic of accounting for the edge case where month == 12 and the rationale behind how we determine the last day of the month. As a rule, comments are for why something is being done, if it’s not obvious, and for magic numbers. Code should tell you what code does.

edit: can anyone spot the bug that I introduced with that parseEndDateFromString() method?

magic_lobster_party, in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

Bill writes spaghetti code.

Bill is not smart.

Don’t be like Bill.

Thcdenton, in ifn't
davidgro,

Ding ding ding ding ding ding…

LoremIpsumGenerator, in Every goddamn time

sudo apt-get update

*im in!

deaf_fish,

vim

How do I get out?!

WindowsEnjoyer, (edited )

journalctl

I’m in!

sneezycat, (edited )
@sneezycat@sopuli.xyz avatar

-Esc twice

-:wq

-:q!

-kill the process

-fuck it pull the plug

-put a bomb in the power station that powers your house

-have a cosmic ray randomly bitflip vim’s internal logic making it quit

bluemellophone,

ZZ

MacNCheezus,
@MacNCheezus@lemmy.today avatar

-Good ol’ C-x M-c M-butterfly

akash_rawal, (edited ) in Need a rust version too.

You have rust.

You get a horse and arrive at the castle within seconds but the horse is too old and doesn’t work with the castle.

You remove the horse, destructure the castle and rescue the princess within seconds, but now you have no horse.

While you’re finding a compatible horse and thinking whether you should write your own horse, Bowser recaptures the princess and moves her to another castle.

Treczoks, in Not mocking cobol devs but yall are severely underpaid for keeping fintech alive

I had a friend at university who got a job fixing cobol stuff before Y2K. The bank paid him extremely well, housed him in a luxury apartment during the job, and, as he had no driving licence, dropped in a car with free driver for him.

8000mark, in Programmer tries to explain binary search to the police

For anybody else looking for the source of this quote: archive.md/RyZI0

amanaftermidnight, in Works on my machine

Then we’ll ship the AI.

…what do you mean, all the ICBM silo doors are opening?

hakunawazo,

ChatGPT is far too long, let’s call it WOPR. The most capable tic tac toe machine.
en.wikipedia.org/wiki/WarGames

jubilationtcornpone, in Infinite Loop

Project A: Has 6 different implementations of the same complex business logic.

Project B: Has one implementation of the complex business logic… But it’s ALL in one function with 17 arguments and 1288 lines of code.

“The toast always lands the buttered side down.”

QuazarOmega,

Project B is just called neural network

CanadaPlus,

Actually, I bet you could implement that in less. You should be able to legibly get several weights in one line.

QuazarOmega,

You have my interest! (Mainly because I don’t know the first thing about implementing neutral networks)

CanadaPlus, (edited )

At the simplest, it takes in a vector of floating-point numbers, multiplies them with other similar vectors (the “weights”), sums each one, applies a RELU* the the result, and then uses those values as a vector for another layer with it’s own weights (or gives output). The magic is in the weights.

This operation is a simple matrix-by-vector product followed by pairwise RELU, if you know what that means.

In Haskell, something like:

layer layerInput layerWeights = map relu $ map sum $ map (zipWith (*) layerInput) layerWeights

foldl layer modelInput modelWeights

Where modelWeights is [[[Float]]], and so layer has type [Float] -> [[Float]] -> [Float].

  • RELU: if i>0 then i else 0. It could also be another nonlinear function, but RELU is obviously fast and works about as well as anything else. There’s interesting theoretical work on certain really weird functions, though.

Less simple, it might have a set pattern of zero weights which can be ignored, allowing fast implementation with a bunch of smaller vectors, or have pairwise multiplication steps, like in the Transformer. Aaand that’s about it, all the rest is stuff that was figured out by trail and error like encoding, and the math behind how to train the weights. Now you know.

Assuming you use hex values for 32-bit weights, you could write a line with 4 no problem:

wgt35 = [0x1234FCAB, 0x1234FCAB, 0x1234FCAB, 0x1234FCAB];

And, you can sometimes get away with half-precision floats.

QuazarOmega,

That’s cool, though honestly I haven’t fully understood, but that’s probably because I don’t know Haskell, that line looked like complete gibberish to me lol. At least I think I got the gist of things on a high level, I’m always curious to understand but never dare to dive deep (holds self from making deep learning joke). Much appriciated btw!

CanadaPlus,

Yeah, maybe somebody can translate for you. I considered using something else, but it was already long and I didn’t feel like writing out multiple loops.

No worries. It’s neat how much such a comparatively simple concept can do, with enough data to work from. Circa-2010 I thought it would never work, lol.

BigDanishGuy, in Fitbit Clock Face

I’ve seen too many android devices with corrupt memory showing something like that to want it as a my watchface…

hypnotic_nerd, in Rust project startup kit
@hypnotic_nerd@programming.dev avatar

Very small projects 😂 after mastering it try building whooping to-do app in rust!

uid0gid0, in The Holy Trinity of JavaScript

Violating the transitive property? Go home JavaScript, you’re drunk.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmer_humor@programming.dev
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #