|
Bongo Bill posted:Is there a shell that does have good syntax? https://hackage.haskell.org/package/turtle
|
# ? Jun 23, 2018 18:33 |
|
|
# ? May 25, 2024 08:38 |
|
Eggnogium posted:No, which is why you should write all your scripts in python. Sadly my org will never get on board with that.
|
# ? Jun 23, 2018 19:17 |
|
Bongo Bill posted:Is there a shell that does have good syntax? emacs
|
# ? Jun 23, 2018 19:27 |
|
Bongo Bill posted:Is there a shell that does have good syntax? Comedy option: Perl.
|
# ? Jun 23, 2018 19:55 |
|
I worked on a build system based on makefiles and Perl years ago... What a hosed language, hope I never use or see it again
|
# ? Jun 24, 2018 17:53 |
|
tyrelhill posted:I worked on a build system based on makefiles and Perl years ago... What a hosed language, hope I never use or see it again It is great at its original intended purpose, viz. text processing. You can replicate most of its capabilities using sed and awk, but not always and personally I'm bad at remembering how to use those tools. So, like, a one-liner to find things that look like email addresses, convert them to lowercase, and output them would look something like this: code:
(And yeah, I know that regex is bad and that trying to recognize email addresses is a stupid-hard problem)
|
# ? Jun 24, 2018 19:20 |
|
TooMuchAbstraction posted:I know that regex is bad TooMuchAbstraction posted:and that trying to recognize email addresses is a stupid-hard problem code:
|
# ? Jun 24, 2018 19:40 |
|
ynohtna posted:emacs
|
# ? Jun 24, 2018 19:50 |
|
The email address regex is constructed by machines and consumed by other machines. The intermediate representation is unfit for human eyes but that's nothing unusual.
|
# ? Jun 24, 2018 22:33 |
|
If you are trying to solve a problem with regex, you now have two problems.
|
# ? Jun 24, 2018 23:05 |
|
TooMuchAbstraction posted:It is great at its original intended purpose, viz. text processing. it's fine at that, but there's still no reason for someone without pre-existing perl experience to choose it for that purpose over python or ruby you get some nice-ish syntactic sugar in exchange for the incoherent design that comes from taping together a dozen unix utilities and calling them a language
|
# ? Jun 24, 2018 23:14 |
|
New Yorp New Yorp posted:What's dumber is how it handles return types. This looks like they looked at the way functions in Bourne have to "return" anything that isn't a small integer by writing it to stdout and then capturing it with $(...) -- something that makes it very easy to get log output from your function or anything it calls mixed into your "return value" by accident -- and went "yes, this is awesome, we should replicate this behaviour in Powershell". I've barely touched Powershell, but based on indirect exposure to it, it really looks like the high-level concept was "let's copy all the most awkward misfeatures from the Bourne family, but with much more verbose syntax for everything and perhaps stick a type system in there somewhere".
|
# ? Jun 24, 2018 23:27 |
|
ynohtna posted:emacs Needs a good text editor though.
|
# ? Jun 25, 2018 01:51 |
|
ToxicFrog posted:This looks like they looked at the way functions in Bourne have to "return" anything that isn't a small integer by writing it to stdout and then capturing it with $(...) -- something that makes it very easy to get log output from your function or anything it calls mixed into your "return value" by accident -- and went "yes, this is awesome, we should replicate this behaviour in Powershell". That behavior happens because of how powershell treats the object pipeline and is perfectly logical if you understand the underlying concept.
|
# ? Jun 25, 2018 02:11 |
|
The Fool posted:That behavior happens because of how powershell treats the object pipeline and is perfectly logical if you understand the underlying concept. It's perfectly logical, but it's also totally counter to how someone coming from almost any other language would expect it to work. code:
I know you can pipe things to Out-Null so that this doesn't happen, but the bottom line is that it's awful, counterintuitive behavior. The way a powershell novice learns about these behaviors is by getting bitten by them. New Yorp New Yorp fucked around with this message at 02:29 on Jun 25, 2018 |
# ? Jun 25, 2018 02:26 |
|
Doom Mathematic posted:The email address regex is constructed by machines and consumed by other machines. The intermediate representation is unfit for human eyes but that's nothing unusual. Almost all email regexes are wrong. There is only one way to validate an email address: send an email to it. Given how badly programmers usually handle names, mailing addresses, and similar things I’ll also take the opportunity to remind people not to attempt to “validate” those things either.
|
# ? Jun 25, 2018 03:46 |
Simulated posted:There is only one way to validate an email address: send an email to it. If this is the only way, then I can safely assume there are zero ways to validate an email address. v namaste v Polio Vax Scene fucked around with this message at 19:36 on Jun 25, 2018 |
|
# ? Jun 25, 2018 19:01 |
|
Polio Vax Scene posted:If this is the only way, then I can safely assume there are zero ways to validate an email address. Then you have achieved enlightenment
|
# ? Jun 25, 2018 19:06 |
|
Is just checking for *@* the bare minimum? That's what I've used just to validate input. I assume all email addresses have the @.
|
# ? Jun 25, 2018 20:57 |
|
"abc\@def.com" has an @, but it's also backslash-escaped, so it also doesn't.
|
# ? Jun 25, 2018 21:16 |
|
Useful email validations: does it have an @, does a call to getaddrinfo() on the thing to the right of the @ succeed.
|
# ? Jun 25, 2018 21:38 |
|
Meat Beat Agent posted:"abc\@def.com" has an @, but it's also backslash-escaped, so it also doesn't. This is one of those cases where whoever entered that email is deliberately out to cause trouble. My policy in that situation is "gently caress you". I also check .+@.+\..+ because there are people who use the @google TLD, and they also fall into the above category.
|
# ? Jun 25, 2018 21:50 |
|
Plorkyeran posted:Useful email validations: does it have an @, does a call to getaddrinfo() on the thing to the right of the @ succeed. You can also do a fair amount of heuristics to suggest to a user that they may have made a mistake, but those aren't exactly validation. By which I mean that you can detect, say, that in "ulmomt@yajoo.com" I may have made 2 typos, even if the domain exists (this one doesn't, but hey). https://hackernoon.com/how-to-reduce-incorrect-email-addresses-df3b70cb15a9
|
# ? Jun 25, 2018 21:50 |
|
There's an extension for postgresql to do an MX lookup on the domain name before allowing email types to be saved
|
# ? Jun 25, 2018 22:32 |
|
Just send an email and make them confirm the account
|
# ? Jun 25, 2018 22:55 |
|
Pollyanna posted:Just send an email and make them confirm the account ulmont's link is about pointing out that if the user typos a valid-looking email address, they'll never get the confirmation email and you just lost a customer. You can use some heuristics to try to detect typos; it's always going to be an imperfect science but you can probably catch ~99% of typos. Just let the user say "yeah actually I do use pollynaan@gmail.cmo".
|
# ? Jun 25, 2018 23:01 |
|
The important part that a ton of web sites seem to forget is that you need to give the user the option to go "oops, actually sent a verification email to this different address" so that when they don't get a verification email due to a typo they can then fix the problem.
|
# ? Jun 25, 2018 23:30 |
|
More websites need verification emails so people stop signing up for poo poo with my email address
|
# ? Jun 26, 2018 02:28 |
|
Plorkyeran posted:Useful email validations: does it have an @, does a call to getaddrinfo() on the thing to the right of the @ succeed. I forget, does getaddrinfo() on untrusted input have any security concerns? I remember something being exploitable if you had an unusual nsswitch.conf module enabled.
|
# ? Jun 26, 2018 03:00 |
|
Suspicious Dish posted:I forget, does getaddrinfo() on untrusted input have any security concerns? I remember something being exploitable if you had an unusual nsswitch.conf module enabled. There was a stack overflow RCE exploit in glibc's getaddrinfo a few years ago: https://security.googleblog.com/2016/02/cve-2015-7547-glibc-getaddrinfo-stack.html
|
# ? Jun 26, 2018 05:53 |
|
Suspicious Dish posted:I forget, does getaddrinfo() on untrusted input have any security concerns? I remember something being exploitable if you had an unusual nsswitch.conf module enabled. Obviously bugs can exist, but it is intended to be safe to call on untrusted input.
|
# ? Jun 26, 2018 06:05 |
|
code:
|
# ? Jun 26, 2018 15:30 |
|
And so the So.
|
# ? Jun 27, 2018 17:26 |
|
Mayst I interest thee in two vectors? code:
code:
|
# ? Jun 28, 2018 12:10 |
|
“Float”?
|
# ? Jun 28, 2018 13:11 |
|
csammis posted:“Float”? as opposed to the super common integer vector
|
# ? Jun 28, 2018 13:24 |
|
csammis posted:“Float”? There's also a FuckedString and FuckedName, which don't seem to have anything to do with floats.
|
# ? Jun 28, 2018 13:27 |
|
Bruegels Fuckbooks posted:as opposed to the super common integer vector I don't know if you're being sarcastic, but e.g. GLM will have integer vectors. It's pretty common for placing things on grids, making parallel integer calculations, etc.
|
# ? Jun 28, 2018 13:51 |
|
F was indeed originally for float: https://forums.unrealengine.com/dev...ructs-stand-for It seems to have morphed into a catch-all prefix for anything that doesn't fit into their other prefixes though. repiv fucked around with this message at 14:09 on Jun 28, 2018 |
# ? Jun 28, 2018 13:58 |
|
|
# ? May 25, 2024 08:38 |
|
repiv posted:F was indeed originally for float: https://forums.unrealengine.com/dev...ructs-stand-for "F" is for "gently caress it".
|
# ? Jun 28, 2018 14:25 |