programming.dev

Xeroxchasechase, to newcommunities in Notepad++ - A community for the notepad++ text editor!

It’s just amazing this project still exist!

Flax_vert,

Favourite text editor. Wouldn’t change it for the world.

rimjob_rainer, (edited ) to programmer_humor in ifn't

Why not just ifnot? Same count of characters but an o instead of a possibly problematic single quote.

KmlSlmk64,
@KmlSlmk64@lemmy.world avatar

If someone really wanted to add it, probably the best would be to use unless

JoshuaEN,

I really liked having unless in Ruby; a ! can be easy to miss, while unless made it clear without needing to write out != true.

HexAndSquare,

It’s also cool when you do unless(!condition). I particularly like this.

Ookami38,

I think it’s just capitalizing on a trend to add n’t to otherwise noy contractions, to make them into contractions. Contractionn’ts, if you will

Corbin, to programmer_humor in The Perfect Solution

Don’t use OpenAI’s outdated tools. Also, don’t rely on prompt engineering to force the output to conform. Instead, use a local LLM and something like jsonformer or parserllm which can provably output well-formed/parseable text.

lledrtx,

Agree this is better but neither of them actually seem “provable” though?

Corbin,

I’ll be informal to boost your intuition. You know how a parser can reject invalid inputs? Parsers can be generated from grammars, so we can think of the grammars themselves as rejecting invalid inputs too. When we use a grammar for generation, every generated output will be a valid input when parsed, because the grammar can’t build any invalid sentences (by definition!)

For example, suppose we want to generate a JSON object. The grammar for JSON objects starts with an opening curly brace “{”. This means that every parser which accepts JSON objects (and rejects everything else) must start by accepting “{”. So, our generator must start by emitting a “{” as well. Since our language-modeling generators work over probability distributions, this can be accomplished by setting the probability of every token which doesn’t start with “{” to zero.

muntedcrocodile, (edited ) to programmer_humor in ifn't
@muntedcrocodile@lemmy.world avatar

With ahit like that its not microsoft java its now microsoft javascript

ohlaph,

That’s Typescript…

taanegl, to programmer_humor in ifn't

I’m just hoping this paves the way to code with Southern dialect


<span style="color:#323232;">iffun is == true
</span><span style="color:#323232;">iffun ain't == false
</span>
timetravel,

May I introduce you to the joys of and creating your own horrible sub language

frezik, (edited )

That reminds me of an old paper about how to create a compilable C program out of old game ROMs. Decompile to assembly. Implement a bunch of #define statements that implement all the ASM statements. Now compile it to a native binary on whatever platform.

Won’t likely be faster or more accurate than regular emulation methods, but it’s a neat idea considering that the source code on all this stuff was lost a long time ago.

MagicShel, to programmer_humor in ifn't

Reduce exclamation marks!? Great Scott!!! Is there a shortage of punctuation in the future!?

SubArcticTundra,
@SubArcticTundra@lemmy.ml avatar

All known deposits were depleted

KairuByte,
@KairuByte@lemmy.dbzer0.com avatar

You could have saved two, all you had to do was use the interrobang. You’re a monster.

fsr1967,

Kernighan, what was I thinking?

jaybone,

1.21GB!!!

sar1n, to programmer_humor in The classic font size exploit

Dig that color theme though

funkajunk,
@funkajunk@lemm.ee avatar

My guess is Monokai?

tetris11, to programmer_humor in The classic font size exploit
@tetris11@lemmy.ml avatar

It very well might be a real exploit. Lemmy was briefly taken down by an XS attack using the emoji library… so who knows, maybe a 3000% smiley face is all that is needed

Fogle,

I think there a lot of phone scammers that use font size to hide all the shit they’re doing. Like they make shit so small so that the old people can’t see anything

bappity, (edited ) to programmer_humor in ifn't
@bappity@lemmy.world avatar

cap () {

}
nocap () {

}

runner_g, (edited )

nocap(frfr){

}

peopleproblems, to programmer_humor in The Perfect Solution

oh Jesus

did this come full circle?

we used python to query chatgpt to decide if a number is even or odd and return true or false?

Ephera,

True or false or null.

Mathematicians didn’t know it yet, but numbers can now be even, odd or neither.

dan,
@dan@upvote.au avatar

True or false or null.

Ah, yes, a three-state boolean.

lars,
Natanael,

Non integers certainly aren’t even or odd, so yes?

Ephera,

Yeah, I’m chalking that up to Python’s untypedness. I was going to write “integers”, but technically that function takes a “num”, whatever that is.

For all we know, it could be a string, asking ChatGPT to hack the government. Is that even? Probably no. Or None. Or T-Rex. Without reading the entire function, we don’t know that it’s not returning T-Rex.

Thankfully, it doesn’t matter. Just stick the result into an if-else, then False and None will land you in the else-branch. And both True and our Truthiness-Rex will land you in the if-branch. Just as Guido intended.

…this rant brought to you by trauma.

lung, to programmer_humor in ifn't
@lung@lemmy.world avatar

ifn’t(!valid) halp?

Deconceptualist,

I believe that resolves the same as

ain’t!(!untrue)

RagingHungryPanda,

ain’t (nothin)

vlad76, to programmer_humor in ifn't
@vlad76@lemmy.sdf.org avatar

What’s wrong with “else”

NekkoDroid,
@NekkoDroid@programming.dev avatar

It’s not ifn’t

SpaceNoodle,

*it’sn’t

felbane,

I’dn’t’ve said it like that.

Scubus,

Perchance

NocturnalMorning,

^This

OP raises a valid point

Darkassassin07,
@Darkassassin07@lemmy.ca avatar

if(condition) {#block never used} else {#actually do a thing}

Vs

ifn’t(condition) {#actually do a thing}

Vs

if!(condition) {#actually do a thing}

MNByChoice,

Cannot start a statement with else. One can with ifn’t. There is a new thing where we don’t branch (which is a separate discussion).

Or am I missing the joke…

kromem, to programmer_humor in The Perfect Solution

Inefficient solution.

You should simplify it to just ask the model if the last bit of the binary representation of the integer is a 1 or a 0.

Natanael,

They don’t process inputs as binary (they use clusters of symbols, i.e. letter groups) so that’s not guaranteed to work

kromem,

r/woosh

Natanael,

I did realize that too was a joke, still wanted to point that out

kromem,

Well, in the sake of pointing things out, GPT-4 can actually correctly answer the prompt, because it arrives at it in the opposite direction. It can tell the integer is even or odd and knows that even or odd integers in binary end in 0 or 1 respectively.

AeonFelis,

You can ask it if the last digit is odd or even, then.

AcesFullOfKings, to programmer_humor in The Perfect Solution

deleted_by_author

  • Loading...
  • rimu,
    @rimu@piefed.social avatar

    gpt3.5 is faster though. You can tell they really thought about performance while writing this code because they used 3.5 instead. /s

    fartsparkles,

    3.5e was so much better than 4e tho /d20

    Boogiepop, to manga in Don't Bully Me and Give Me Flashback To Your Old Persona, Nagatoro!
    @Boogiepop@lemmy.world avatar

    I was reading this earlier thinking ‘holy shit, did Nanashi go for the long con?’

    fogetaboutit,

    Imagine he rode it back to the bank and bullied the shit out of him

    DickJones,
    @DickJones@lemmy.ml avatar

    I’m praying for this

    Boogiepop,
    @Boogiepop@lemmy.world avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #