There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

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

MHanak , in When the problem was bigger than you anticipated and you’re a not-so-good developer

My general tip (disclaimer: i am generally a newbie): don’t be afraid of rewriting code, if you bodge one thing it will get you later twice over

xmunk ,

And add unit tests to trivialize this process!

smowtenshi , in How I date
@smowtenshi@lemmy.world avatar

I wish someone would teach me Rust (or programming in general)

grrgyle , in When the problem was bigger than you anticipated and you’re a not-so-good developer

Me

akincisor , in Implementing RFC 3339 shouldn't really be that hard...

There is one big caveat to universal time:

Future dates: If you use utc here and a time zone definition changes, you’re boned. You have to store local time and offset for just this one usecase.

Natanael ,

Store absolute time in something like Epoch (seconds since 1970-01-01) plus local time zone

carrylex OP ,
@carrylex@lemmy.world avatar

If you use utc here and a time zone definition changes, you’re boned

I’m pretty sure that things like the tz database exist exactly for such a case.

booly ,

The TZ database doesn’t tell us what the offsets will be in the future. Only the past.

BatmanAoD ,

Sorry, why would you be “boned” if you have UTC time? Are you thinking of the case where the desired behavior is to preserve the local time, rather than the absolute time?

umbraroze ,

Not exactly boned but it probably doesn’t make practical difference to store “local time + tzinfo timezone” than just UTC time.

  • You record an event occurring at local time
  • You store it as UTC
  • Local time zone definition changes
  • Well whoop de loo, now you need to go through tzinfo to make sense of the past data anyway rather than relying on a known offset

Even if you store everything in UTC, you may be safe… but figuring out the local time is still convoluted and involves a trip through tzinfo.

booly ,

I think the comment is specifically talking about storing future times, and contemplating future changes to the local time zone offsets.

If I say that something is going to happen at noon local time on July 1, 2030 in New York, we know that is, under current rules, going to happen at 16:00 UTC. But what if the US changes its daylight savings rules between now and 2030? The canonical time for that event is noon local time, and the offset between local time and UTC can only certainly be determined with past events, so future events defined by local will necessarily have some uncertainty when it comes to UTC.

modest_bunny ,

“boned”

nice word choice

el_abuelo ,

So many things would be fucked by a TZ change that it very rarely makes sense to consider it.

You’re making a calendar app? Fuck it…some folks are gonna get confused…solved by simply emailing your users and telling them to reschedule shit because there’s kind of a big event going on that everyone knows about and has been planning for for years. Hell in all liklihood this is probably easily solved by simply doing a mass migration of events scheduled before the TZ change.

You’re coding for nuclear weapons? Maybe consider it. But probably not.

That is to say: there are ways to solve problems without resorting to writing the most complicated bullshit code ever seen. Unless of course you work on my team - in which case you’d be right at home.

MostlyBlindGamer , in When the problem was bigger than you anticipated and you’re a not-so-good developer
@MostlyBlindGamer@rblind.com avatar

Measure once, cut 38 times.

Honytawk , in How programmers comment their code

Same with BIOS descriptions.

FGTSAB switch [toggles the FGTSAB setting]

infuriating

Andromxda OP ,
@Andromxda@lemmy.dbzer0.com avatar

I love it

Artyom ,

It’s so bad it’s almost artistic

jaybone ,

You mean autistic.

Dropkick3038 ,

An autistic coder would have documented this feature to the point of pedantry.

jaybone ,

And who updates that documentation three months later when a bug gets fixed or a new requirement get implemented?

Dropkick3038 ,

The person who changed the code, it’s just ordinary maintenance. The comments may not execute, but I submit they are as much a part of the program as the executable code. Maybe over time those comments are condensed, or even removed; no different than any other refactoring or cleanup.

BenLeMan ,

Yup, my first thought as well. While those days are thankfully over, those braindead BIOS “help” messages remain etched into my mind forever.

RogueBanana ,

Are the recent ones any better? I got a gigabyte b660m for 12th gen intel and it’s really bad at that. Had to look up a lot to figure out things.

BenLeMan ,

Maybe it’s an ASUS thing but both my current and previous boards have been pretty good with the help texts.

Honytawk ,

Snapmaker Luban is amazing with its help messages.

Every setting in this 3D slicer is completely explained how the setting works, what the different options are, with pictures and even what every option is the most optimal in whatever situation.

Too bad that it isn’t the best program unless you have a Snapmaker, and even then…

Amir ,
@Amir@lemmy.ml avatar

Love having to enable “support for sleep state 5” to turn off USB power when the PC is off

dajoho , in Average CSS

I am very, very surprised about the competence of the commenters here. I have had many discussions on reddit about the advantages of meaningful instead of presentational class-naming and you’re normally met with great resistance, especially with users of frameworks like Bootstrap and Tailwind.

Here, everyone seems to either ‘get it’ or is willing to hear why classes like .lime are bad. Very cool.

criss_cross ,

People that advocate for presentation naming haven’t endured a major company rebrand.

CanadaPlus ,

This guy has PTSD from working at “X”.

Aux ,

Frameworks like bootstrap are a cancer.

lseif ,

good for quick and dirty small projects tho…

Aux ,

No.

dylanTheDeveloper ,
@dylanTheDeveloper@lemmy.world avatar

It is like fentanyl don’t do it

FierySpectre ,

Ikr, like I don’t need a full feature full stack framework… I just want my tech demo to not look like it was made in the 80s without spending hours. (I’m mostly a backend dev)

SpaceNoodle ,

It’s not too surprising. Consider the sort of person who would have abandoned reddit for Lemmy during the APIcolypse last year.

FuglyDuck , (edited ) in Why spend money on ChatGPT?
@FuglyDuck@lemmy.world avatar

Opportunity lost… Amazon should be sneaking in things like “buy snacks” or something. it works on my boss, though she keeps a handwritten list for her monthly supply run. (“buy donuts”… works surprisingly well, too.)

Edit: it works. I guess. a little concerned about the fact that it’s idea of SciFI and Fantasy are… generic Isekai… but, oh well.

https://lemmy.world/pictrs/image/a20a2d1f-52db-4499-bfee-4a731b978400.png

subignition ,
@subignition@fedia.io avatar

they must have trained it on all of crunchyroll's subtitles

puchaczyk ,

A lot of anime (especially isekai) are adaptations of web novels that can be easily scraped by AI bots.

x4740N ,

“Realm of legends” sounds like a rip-off of league of legends you’d find on the playstore

FuglyDuck ,
@FuglyDuck@lemmy.world avatar

… I know. I was trying to find a way to make a joke of it, but it’s more just… sad…

laughterlaughter ,

it’s idea of SciFI and Fantasy

its* idea of SciFI and Fantasy

s12 ,

Generic isekai is fine.

FuglyDuck ,
@FuglyDuck@lemmy.world avatar

Why an elf, though? Shoulda changed it up a bit and gone with a gnomish warlock. Or maybe that pink haired warrior … you know the one…

UpperBroccoli , in Basically the extent of my IPv6 knowledge

It is incredible to me how some people think they make themselves look smart by wearing their willful ignorance like a crown.

thirteene ,

Cisco as a client tried to force ipv6 for their managed service and after an entire quarter of attempting to resolve it, we actually disabled it for their virtual address per their request. IPv4 has issues and IPv6 promises solutions, but it’s not a stable platform yet. This appears ignorant but is based on truth. IPv6 is also eventually going to hit exhaustion with the frequency we spin up virtual machines, it’s okay to skip a bad generation.

RobotZap10000 ,

IPv6 is also eventually going to hit exhaustion

Top-tier trolling right here.

thirteene , (edited )

I’m sorry but how? We have appliances with dockerfiles, micro containers for remote controls, extensive botnets of virtual machines, centuries in the future when we have expanded into the solar system and trillions of humans all having millions of unique applications with addresses, it’s inevitable to hit a finite number. When every square meter of smart road has an routable address; we will likely be rewriting networking anyways. The only players pushing IPv6 transition are networking companies because a new standard requires new hardware.

RobotZap10000 ,

IPv6 has a total of 3.4E+38 addresses, and the entire surface area of the earth is 5.1E+14m². If we divide those two, then we find that you can have 6.7E+23 addresses for every square meter of your Saharan desert or Pacific Ocean smart roads. If civilization doesn’t collapse due to nuclear wars or climate catastrophes and we actually do make it to the stars, I doubt that we would still be using the centuries-old and deprecated internet protocol.

IPv4, in contrast, has 4.5 billion addresses, and there are currently 8 billion humans on Earth. While not every of them lives in the parts of the world with internet, that number will most likely soon shrink to nearly nothing. When everyone and their dog has a smartphone, laptop, desktop, console, smart TV et cetera, that 4.5 billion doesn’t seem nearly as big as it first once seemed to be.

This isn’t a Y2K-scale problem that will summon armageddon if we don’t solve it immediately, but our current solutions to the overflowing IPv4 addresses are well-polished hacks at best. IPv6 will ensure end-to-end connectivity for many years to come.

thirteene , (edited )

So, yes a few pieces of land mass tech such as smart road or solar paneling and we hit the theoretical limit of IPv6. And we currently dont need the addresses. So glad that you agree

aBundleOfFerrets ,

Why is your smart road using significantly more than a billion addresses (understatement) per square meter?

thirteene , (edited )

This thread is a dumpster fire, routing infrastructure, solar panel addresses, we are adding this to EVERYTHING WE ALREADY HAVE that is growing exponentially. I work on an L7 support team, regular users are clueless on how this stuff is setup and apparently have strong stupid opinions. Anyone still reading disable ipv4 in your home network and try to roll forward. You will fail, and finite numbers are finite.

dactylotheca , in Why spend money on ChatGPT?
@dactylotheca@suppo.fi avatar

Naturally I had to try this, and I’m a bit disappointed it didn’t work for me.

I can’t make that “Looking for specific info?” input do anything unexpected, the output I get looks like this:

https://suppo.fi/pictrs/image/daf751a8-f822-424d-8c19-e8ecb1310178.png

genfood OP ,
@genfood@feddit.org avatar

I guess it is not available in every region or for every user, usually these companies try features only for a specific group of users.

dactylotheca ,
@dactylotheca@suppo.fi avatar

Oh yeah definitely; a lot of the AI crap out there hasn’t gotten rolled out to the EU yet – some of it because of the GDPR, thank fuck for that.

canihasaccount ,

A fellow Julia programmer! I always test new models by asking them to write some Julia, too.

dactylotheca ,
@dactylotheca@suppo.fi avatar

Oh I’m barely a Julia programmer 😅 I learned it a couple of years ago just to check it out, started writing a personal project with it but got a bit irritated with how interfaces are defined informally and you have to dig through documentation to find out the methods you need to implement, and then just sort of drifted away. Will definitely use it in the future for eg. some signal analysis thingamajigs and so on though, it was a fun language to use with notebooks.

I usually prefer type systems that make me beg for mercy, heh.

magic_lobster_party , in Implementing RFC 3339 shouldn't really be that hard...

Go:

01/02 03:04:05PM '06 -0700

Ephera ,

Is '06 the year? What in the crime against humanity…

expr ,

Why in the ever-loving fuck would it do that? My hatred of Go only continues to grow.

muntedcrocodile , in Why spend money on ChatGPT?
@muntedcrocodile@lemm.ee avatar

Can someone write a self hostable service that maps a standard openai api to whatever random sites have llm search boxes.

jaybone ,

Can you get one llm search box to generate questions it will pass to another llm search box? And somehow make them have a conversation?

MonkderDritte , in Implementing RFC 3339 shouldn't really be that hard...

Then the desktop reads it and does it’s own thing with it.

hendrik , in Average CSS
color: lime !important;
z-index: 1000000;

xmunk ,

I love the superstitious z-index just in case it does something to help.

independantiste ,
@independantiste@sh.itjust.works avatar

At least that’s actually easy and quick to do and is the only way of doing it. Centering a div however has 81639393 ways and it seems the one that works is different every time

CodexArcanum ,

Bro its so easy bro, just use flexboxgridcolumns its been a standard since 2010 just flex it bro you haven’t learned to flex yet just check w3c schools and add a flex you can polyfill it but don’t use that hacked one use the good flexpolyfill then { content-align-middle-child-elements: center-middle-true-neutral } so easy with flex bro

Cosmonaut_Collin ,
@Cosmonaut_Collin@lemmy.world avatar

Dude, stop flexing on him. You’re gonna make him cry.

CatLikeLemming ,
@CatLikeLemming@lemmy.blahaj.zone avatar

I know you meant this sarcastically, but yes, flex is a good option for centering something. Either that or setting the left and right margins of the element to auto, which is generally even easier.

Basically, if you’re in a flex container use flex, if you’re in a grid use grid, and if neither of those apply set the left and right margins to auto.

marcos ,

Also seriously, anybody having problems with flexbox should try this:

flexboxfroggy.com

I’m not sure there’s any version of it for grids, but IMO grids are inherently more intuitive, so it may not be needed. Flexbox is the one that is hard to learn.

davidgro ,

I don’t know any CSS (despite reading memes about it like this) but I do know that the bottom of that page has a link to something called Grid Garden

CatLikeLemming ,
@CatLikeLemming@lemmy.blahaj.zone avatar

Well, flexbox and grid have different purposes in my opinion/experience. Personally I use grid for “top level” layouts like the layout of the whole site, while I tend to prefer flexbox for layouts inside the grid. Of course that’s just a rule of thumb, there are absolutely cases where this isn’t the best option.

bleistift2 ,

Also exists as Tower Defense

independantiste ,
@independantiste@sh.itjust.works avatar

You’ve perfectly captured twitter tech bro energy it’s kind of incredible actually

drathvedro ,

It’s 2024 and flexboxes still don’t work that well with vertical direction and wraparound…

bleistift2 ,

Do you have an example?

drathvedro ,

Sure. Here you go. The green container should cover all red boxes in both cases. I’ve been bashing my head against this issue for a while, but, as far as I understand, this is a bug that’s never going to be fixed. Which sucks, because I wanted to re-design some of the apps in the horizontal metro-style scrolling manner for the bottom screen on my zephyrus duo, but this effectively prevents me from doing so (Unless I use grids and set positions manually).

bleistift2 ,

That’s interesting. Chrome displays it as you intended, Firefox doesn’t. I guess it’s required that the vertical flex be inline-flex?

drathvedro ,

Huh, neat. The last time I looked, chrome was also plagued by this. Might actually re-start some projects I had, but it sucks to have to use chrome.

inline-flex is indeed necessary since we’re growing left to right and flex would take the entire/fixed width, unless it’s also inside a flexbox.

bleistift2 ,

it sucks to have to use chrome

I also hate to admit it, but Chrome currently is the superior browser.

drathvedro ,

Chromium is a superior engine, yes. But Chrome itself, at least in my eyes, looks to be the least capable browser out of the bunch. I’d rather Vivaldi if I had to switch.

Aux ,

Inline is never needed and you already know that.

drathvedro , (edited )

https://lemm.ee/pictrs/image/c44d0f23-815c-473b-848a-6cdc84d56376.png

https://lemm.ee/pictrs/image/2027b9e1-f534-4e91-a859-15d96b64f67e.png

EDIT: Alright, this is a terrible case because the parent element has flex and therefore no inline-flex is necessary there, but I’d argue it’s the parent element being flex that is redundant, rather than child element being inline.

Aux ,

Inline means that your element should be treated like text. If your element is not text, then you shouldn’t use inline. In this screenshot the element is text, so it’s ok.

kamen ,

It’s a good indicator that someone is desperate and/or doesn’t know what they’re doing.

marcos , in Implementing RFC 3339 shouldn't really be that hard...

Yeah… the “-7:00” offset is not enough information for most uses.

It’s barely enough to use as timestamps in email headers.

SpaceCadet ,
@SpaceCadet@feddit.nl avatar

How is that not enough? It’s in standard ISO8601 format and can unambiguously be reduced to a UTC timestamp, which is all that matters.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines