this post was submitted on 16 Jan 2025
655 points (98.2% liked)

Engineering Memes

1366 readers
1 users here now

About:

Memes about engineering for all disciplines.

Rules:

General Rules:

  1. No hate speech
  2. No harassment, calls to violence
  3. No advertisement

Posts:

  1. Must be a meme/joke/observation/attempt at humour
  2. Must be engineering related (software engineer humour probably better suited for programmer humour communities, though not explicitly banned)

founded 2 years ago
MODERATORS
655
Get Dated (lemmy.dbzer0.com)
submitted 4 days ago* (last edited 4 days ago) by [email protected] to c/[email protected]
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 3 days ago* (last edited 3 days ago) (1 children)
function validate(val) 
   try:  
       cast val as numeric
   except:
      print "Oops, not a number"
      cast val as general  ## date or whatever 
end

validate(12.5)     ## returns 12.5
validate("12.5")   ## returns 12.5
validate("12 . 5") ## returns a date maybe

[–] PoolloverNathan 3 points 3 days ago* (last edited 3 days ago) (1 children)

Oh my god what cursed Python, Lua, and SQL offshoot is this

[–] [email protected] 1 points 3 days ago

It's my own grammar, "Luanatic"