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.

programmerhumor

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

Thndrchld , in Code that lives forever

I feel personally attacked.

UpperBroccoli , in This is not a meme, I was trying to find content for an OC /c/programmerhumor post and found this

[ ] tabs [ ] spaces [x] why would I even care, I press tab and the editor puts either a tab or a number of spaces, couldn’t care less…

demonen , in This is not a meme, I was trying to find content for an OC /c/programmerhumor post and found this
@demonen@lemmy.ml avatar

I use tabs because I prefer 4-space indents and others might prefer 2-space indentation or the gross and unacceptable 6-space indentation.

If more than one person is working on a code base, there will likely be more than one preference, and with tabs everyone gets to just set their own tab width.

Yes, even the 3-space savages.

noisytoot ,

Tabs work fine as long as you don’t align stuff. If you do, you have to assume a tab size and mix tabs and spaces.

gun ,
@gun@lemmy.ml avatar

This is a legit observation. However, I would argue that spaces needs a set indentation width anyway, so if tabs had a set indentation width that coders are expected to maintain when aligning code, it wouldn’t make a difference. Enforcing that in practice may be different, but in theory it works.

edward ,

Generally aligning stuff isn’t nice. But if you do, it’s tabs up to whatever level of indentation you’re at then spaces the rest of the way. So you wouldn’t have to assume a tab size. And the tabs and spaces have different semantic meaning (indent vs alignment) so mixing them makes sense. It’s even built into Jetbrains IDEs, where it’s called “Smart Tabs”.

https://lemmy.ml/pictrs/image/2b14b960-5c9c-4d3a-9f54-cc390e991378.png

Although really just adding a level of indent is better than aligning.

https://lemmy.ml/pictrs/image/9aa8acc8-3035-403d-bebc-edcb322418ad.png

gnuslashdhruv , in This is not a meme, I was trying to find content for an OC /c/programmerhumor post and found this

Is this some kind of python meme I’m too C++ to understand?

Now, I’m completely willing to start a war about { going on the next line.

TheInsane42 ,
@TheInsane42@lemmy.ml avatar

Totally agree, all my { end up on the next line, 1st spot when starting a function, last character of the keyword when starting an if/for/… section. I even put the closing one on the same line when it’s single line, else either at the end of the closing line (when changing really old code) or same indent.

So indenting varies a lot, which makes most ‘new’ programmers go mental.


<span style="color:#323232;">while (my code)
</span><span style="color:#323232;">    { I'll do it my way }
</span><span style="color:#323232;">
</span><span style="color:#323232;">if (! liked)
</span><span style="color:#323232;"> { toughen-up }
</span><span style="color:#323232;">else
</span><span style="color:#323232;"> { get used to it
</span><span style="color:#323232;">   multi-line can go both ways...
</span><span style="color:#323232;"> }
</span>

That is, unless the font used messes it up. ;)

Trashcan , in You can always rely on grandma

I take it chatGPT does not give you windows 10 codes if you ask about it directly? You just have to trick it a little OG Grandma style?😅

Otome-chan ,
@Otome-chan@kbin.social avatar

tbh the keys are probably fake

gkd ,
@gkd@lemmy.ml avatar

There was an article about Barr actually giving people real keys, so they might be…

torafugu ,
@torafugu@kbin.social avatar

You should probably watch Enderman. He unlocked Windows 11 Pro using Windows 7 Ultimate keys generated by ChatGPT. It took 3 regenerations, but a key did pass the online check.

mrmanager ,
@mrmanager@lemmy.today avatar

This is so nostalgic to me. I left windows many years ago and seeing those keys reminded me how I used to try and get those keys etc. :)

torafugu ,
@torafugu@kbin.social avatar

You left it for the better. Anything above Windows 7 is basically spyware now.

mrmanager ,
@mrmanager@lemmy.today avatar

Yup I saw it coming in Win 7 and havent used windows since :)

Kerb , in Code that lives forever
@Kerb@discuss.tchncs.de avatar

There is nothing more permanent than a temporary solution

SavvyWolf , in You can always rely on grandma

Fun fact: If you google those codes you find out that they are “real” codes, but they don’t actually activate Windows. I think they are something that are used as placeholders in the upgrade from Windows 8 to 10 or something, but don’t know the specifics.

ChatGPT actually can’t create new “words”, just regurgitate words that it’s seen somewhere before!

demonen ,
@demonen@lemmy.ml avatar

Yep yep, statistical analysis as to the frequency of tokens in the training text.

Brand new, never-before-seen Windows keys have a frequency of zero occurrences per billion words of training data.

average650 ,
@average650@lemmy.world avatar

That isn’t actually what’s important. It’s the frequency of the token, which could be as simple as single characters. The frequency of those is certainly not zero.

LLMs absolutely can make up new words, word combinations, or sentences.

That’s not to say chatgpt can actually give you good windows keys, but it isn’t a fundamental limitation of LLMs.

demonen ,
@demonen@lemmy.ml avatar

Okay, I’ll take your word for it.

I’ve never ever, in many hours of playing with ChatGPT as a toy, had it make up a word. Hallucinate wildly, yes, but not stogulate a word out of nothing.

I’d love to know more, though. How does it combine new words? Do you have any examples of words ChatGPT has made up? This is fascinating to me, as it means the model is much less chained to the training data than I thought.

relevants ,

A lot of compound words are actually multiple tokens so there’s nothing stopping the LLM from generating the tokens in a new order thereby creating a new word.

demonen , in Using linux infront of my friends be like
@demonen@lemmy.ml avatar

I used to do a lot of work in vim, over SSH. Five PuTTY windows, one of which was always showing cmatrix

Shared an office with a Business Analyst, so he was way more impressed with my “matrixing”, than I was with his “spreadsheeting”.

Th4tGuyII , in You can always rely on grandma
@Th4tGuyII@kbin.social avatar

Cool until you realise Grandma is senile and can't actually think beyond piecing together text they've seen before into what they think is a coherent response.

Those keys will absolutely not work, either because they've already been used and were scraped from training data, or they are fake keys generated based on said training data.

MrAegis , in You can always rely on grandma
@MrAegis@lemmy.ml avatar

Relevant xkcd: xkcd.com/2169/

dodslaser , in Object oriented programming

“Not a single problem of the class struggle has ever been solved in history except by violence.”

~ Vladimir Lenin

emi , in Code that lives forever
@emi@lemmy.blahaj.zone avatar

I have a mental image of 50+ lines that could be replaced with 15 if someone just used a loop.

darcy ,
@darcy@sh.itjust.works avatar

hey depending on the code, it could run faster without the loop

brezelradar , in Tell me your real address
@brezelradar@feddit.de avatar

It’s ::1, but also fe80::d00f:foo5

lynx ,

Its a MAC address not IPv6.

noisytoot , in This is not a meme, I was trying to find content for an OC /c/programmerhumor post and found this

Seven semicolons are the correct way to do indentation (it even alliterates):


<span style="color:#323232;">int main
</span><span style="color:#323232;">(void) {
</span><span style="color:#323232;">;;;;;;;printf("like thisn"); }
</span>
dystop ,

the correct way is to never indent and never use whitespace. Saves memory.

Your goal should be 1LOC every month, no more.

booty ,
@booty@hexbear.net avatar

all code should be written in one line with absolutely no breaks. it’s the most efficient way

Otome-chan , in Tell me your real address
@Otome-chan@kbin.social avatar

"okay how about this, you're always on your mac, tell me your mac's address"

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