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.

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.

ooterness , in Surely "1337" is the same as 1337, right?

CBOR for life, down with JSON.

0x0 ,

If there are no humans in the loop, sure, like for data transfer. But for, e.g., configuration files, i’d prefer a text-based solution instead of a binary one, JSON is a nice fit.

MonkderDritte ,

What, no! Use TOML or something for config files.

0x0 ,

TOML

Interesting… me likes it.

frezik ,

What I’d like for a configuration language is a parser that can handle in-place editing while maintaining whitespace, comments, etc. That way, automatic updates don’t clobber stuff the user put there, or (alternatively) have sections of ### AUTOMATIC GENERATION DO NOT CHANGE###.

You need a parser that handles changes on its own while maintaining an internal representation. Something like XML DOM (though not necessarily that exact API). There’s a handful out there, but they’re not widespread, and not on every language.

bitfucker ,

JSON5

frezik ,

Is a very good idea providing much needed fixes to the JSON spec, but isn’t really what I’m getting at. Handling automatic updates in place is a software issue, and could be done on the older spec.

bitfucker ,

Hmm, maybe I am missing the point. What exactly do you mean by handling automatic updates in place? Like, the program that requires and parses the config file is watching for changes to the config file?

frezik ,

As an example, Klipper (for running 3d printers) can update its configuration file directly when doing certain automatic calibration processes. The z-offset for between a BLtouch bed sensor and the head, for example. If you were to save it, you might end up with something like this:


<span style="color:#323232;">[bltouch]
</span><span style="color:#323232;">z_offset: 3.020
</span><span style="color:#323232;">...
</span><span style="color:#323232;">#*# <---------------------- SAVE_CONFIG ---------------------->
</span><span style="color:#323232;">#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
</span><span style="color:#323232;">#*#
</span><span style="color:#323232;">[bltouch]
</span><span style="color:#323232;">z_offset: 2.950
</span>

Thus overriding the value that had been set before, but now you have two entries for the same thing. (IIRC, Klipper does comment out the original value, as well.)

What I’d want is an interface where you can modify in place without these silly save blocks. For example:


<span style="color:#323232;">let conf = get_config()
</span><span style="color:#323232;">conf.set( 'bltouch.z_offset', 2.950 )
</span><span style="color:#323232;">conf.add_comment_after( 'bltouch.z_offset', 'Automatically generated' )
</span><span style="color:#323232;">conf.save_config()
</span>

Since we’re declaratively telling the library what to modify, it can maintain the AST of the original with whitespace and comments. Only the new value changes when it’s written out again, with a comment for that specific line.

Binary config formats, like the Windows Registry, almost have to use an interface like this. It’s their one advantage over text file configs, but it doesn’t have to be. We’re just too lazy to bother.

bitfucker ,

Ahh, then the modification must be done on the AST level not the in-memory representation since anyway you do it, you must retain the original.

frezik ,

Right.

Michal ,

Yaml is more human readable/editable, and it’s a superset of json!

bob_lemon ,

Yaml is just arcane bullshit to actually write as a human. Nor is it intuitively clear how yaml serializes.

Aux ,

Yaml is cancer.

JackbyDev ,

It’s entirely disingenuous because who the hell is throwing JSON into YAML without converting it? Oh wow, I changed the file extension and it still works. I’m so glad we changed to YAML!

bitfucker ,

Until someone cannot tell the difference between tab and space when configuring or you miss one indentation. Seriously, whoever thinks indentation should have semantic meaning for computers should burn in hell. Indentation is for us, humans, not computers. You can write a JSON with or without indentation if you want. Also, use JSON5 to have comments and other good stuff for a config file.

themusicman ,

If you’re moving away from text formats, might as well use a proper serialisation tool like protobuf…

wtfrank ,

Yaml?

JackbyDev ,

For the love of all things pure, holy, and just, please do not use YAML in your APIs…

wtfrank ,

Fine, and if you don’t use json in your API because of the deficiency highlighted in the meme, what format do you use in your API?

JackbyDev ,

I use JSON. I have used Avro for things in Kafka but I’m not sure the benefits outweigh the negatives. Avro is much more complicated than people think and most folks don’t really have a strong desire to learn how it should be used and do stuff incorrectly. Everybody knows JSON and it works with everything though. (Example: so many people just hear that Avro schemas can be backwards compatible but have zero idea that you still need the schema that wrote the message even if you want to read it into a newer one.)

Interestingly, I take the meme as saying a dev is using the wrong types in their serialization format (using strings to store integers) which was my biggest problem with Avro. Mostly from people not using logical types or preferring to use ISO 8601 datetime strings instead of the built-in timestamp-millis type.

bleistift2 OP ,

Hell, no. If I wanted to save bytes, I’d use a binary format, or just fucking zip the JSON. Looking at a request-response pair and quickly understanding the transferred data is invaluable.

douglasg14b , in Implementing RFC 3339 shouldn't really be that hard...
@douglasg14b@programming.dev avatar

Never not UTC Everywhere.

utceverywhere.com

ooterness ,

UTC is better than most, but leap seconds are still awful. Computers should use GPS or TAI everywhere. Dealing with time zones and leap seconds is for human readability and display purposes only.

jerkface ,
@jerkface@lemmy.ca avatar

That’s why I only ever use Seconds Since Epoch.

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

When the API returns UTC, but the system insists on giving you local time… but there’s an extension method that accepts DateTimeOffset?

agressivelyPassive ,

Or requires a timestamp with zone offset, but ignores the zone offset, so you have to send the timestamp itself with a zone offset of zero relative to the systems timezone, but can’t just omit the zone offset, because it’s required.

bleistift2 ,

When the API returns UTC, but mandates that you give it an offset which it will add or subtract from the UTC time, while still adding the Z at the end.

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

Wait til you see what’s required to parse HTTP-date fields.

RFC 9110

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

There’s an even worse thing: timezone selection UIs that don’t let you choose UTC

Klear , in Average CSS

No! I wanted orange!

nikaaa , in How programmers comment their code

Good code is self-explanatory. You should only comment your code if it does something unexpectedly complicated.

That being said, it’s always a good idea to write a manual, about how to use the code. Don’t document how it works, because those who can code will understand it anyways, and those who can’t, have no need to understand it.

photonic_sorcerer ,
@photonic_sorcerer@lemmy.dbzer0.com avatar

Regardless, comments do speed up understanding.

BorgDrone ,

Good code is self-explanatory. You should only comment your code if it does something unexpectedly complicated.

The code shows what is being done. The comments should explain the why.

independantiste ,
@independantiste@sh.itjust.works avatar

Yes. This 1000x. I hate it at work when I come across code that was written 3 years ago that has literally no traces of why it’s there and a quick summary of what it does. Especially because that code is always the most abbreviated spaghetti you’ve ever seen. People should stop thinking (their) code documents itself because 99.999% of programmers cannot do it right.

I really like the Google way of coding: assume the person reading the code is the most 1337 programmer ever, BUT that this person knows absolutely nothing about the project

BorgDrone ,

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

dan ,
@dan@upvote.au avatar

This is something a lot of people don’t seem to understand. Even if code is self-explanatory, I want to know why it was designed that way.

I’ve fixed bugs where the fix was only a one line change, but it was extremely difficult to figure out, so I left a 10ish line comment above it explaining why it has to be done that way.

potustheplant ,

Hard disagree. It’s a lot easier and faster to understand a function that is prefaced with a small line of text explaining what it does rather than trying to figure it out yourself.

It’s not about whether you can understand the code or not, it’s about efficiency and clarity.

Aux ,

Hard disagree - that’s just dumb:


<span style="color:#323232;">// Calculates tax
</span><span style="color:#323232;">function calculateTax() { }
</span>
uis ,

Hard disagree - that’s very helpful:


<span style="color:#323232;">// Calculates Personal Income Tax by formula from section 1.2.3 of tax code. Other taxes like VAT are not calculated.
</span><span style="color:#323232;">function calculateTax() { }
</span>
potustheplant ,

This guy gets it.

Aux ,

If it calculates personal income tax, just call calculatePersonalIncomeTax.

uis ,

Why not calculatePersonalIncomeTax123 then?

Aux ,

Yeah, why not?

usernamefactory ,

I’m a new developer. Is that referring to page 123 of the in-house documentation? Version 12.3 of the code? I have no clue.

You’d have to call it something like calculatePersonalIncomeTaxPerTaxCodeSection1_2_3, but I get exhausted just looking at that. There comes a point where the cognitive work of reading crazy long camel case names is more trouble than it’s worth.

An explanation of what specification a function was written to implement is a perfectly appropriate comment. Could be improved by a direct link where possible. But it’s worth noting what that comment isn’t doing - specifying any implementation details. For that, I really can just read the code.

plecks ,

Is that state, federal, or combined?

Aux ,

Add a flag.

weststadtgesicht ,

If done right, the “what it does” is in the method name. If your method is too complicated to summarize in its name, chances are good you should split it up or extract parts of it.

Aurelius ,
@Aurelius@lemmy.world avatar

Yeah, just 15 seconds and jot down a comment. Whenever I’m even hesitant, I just leave a comment. Doesn’t hurt anything and it can always be removed if not needed

Easier to remove later rather than add it after the fact

TORFdot0 ,

This is true, but it’s easier and faster to parse plain English and so if I don’t adequately comment my code the first time. I will be commenting it when I have to return to it for whatever reason. Honestly the second round of commenting is more verbose and clearer than the function x does y style of comments I tend to make when coding the first time

tiredofsametab ,

Asinine business logic can still make some things very hard to read and digest no matter how well-planned and well-written it is (particularly if it is rushed by the business meaning that engineers don't have time to do it well). As such, there are places where code can't/won't be self-documenting to a useful degree.

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