« first day (2648 days earlier)      last day (2197 days later) » 

5:01 PM
@Blue I think all passwords an 2FA is case insensitive and has severe restrictions on length and character set. I'm a bit reluctant to test it on my real account, though.
 
@Blue probably outsourced code from some company that does stuff for banks?
 
I'm pretty sure you could test case insensitivity pretty well
They got took over by a Spanish bank
Which would probably be why
But the mix and match looks rather not fun
 
hmm... now a random xkcd reminded me when I programmed in PHP all the day and I always stored results of the rand function in variable ayn.
 
@Blue Yup, both main password and 2FR are case insensitive.
 
good ol' times. now when I look into my old code I always want to close it asap. so much repeating code, bad practices, no comments and everything in one file...
 
5:06 PM
That's banks for you I guess
 
@Blue 2FR is restricted to [a-z0-9].
 
How many characters? That sounds rather brute-forceable
 
I remember when on forums of one game somebody suggested to make passwords case-sensitive
 
@Blue I guess no-one can hack my account, cause I get a 503 when trying to log in.
12
 
I got a 500 whenever I typed something into it, whatever
I was rather interested in there being a "isMock" field in the password reset field but nothing seemed to happen when I checked it
 
5:09 PM
@Blue 2FR is:
be 6-15 characters long (no spaces)
contain at least 3 letters and 1 number
[a-z0-9]
 
@Soaku isn't that standard php?
 
@J.Sallé What do you mean?
 
@Soaku it was a joke :p
regarding repeating code, bad practices, no comments and everything in one file...
 
ah, I get it :P
 
I've absolutely zero knowledge of php other than people where I study make fun of it all the time >.>
 
5:11 PM
@Blue Password has same rules. Only, I'm not sure about the character set, as it isn't stated clearly.
 
Just do a SQL injection
 
@Blue Whoa, animated chat messages. (Markdown is hard.)
 
finally
 
:P
I might have just opened the help url
 
strike through is an unstandard feature that is implemented in tons of different ways
 
5:14 PM
@Blue OK, found it: Passwords are 6 - 15 characters, contain at least 3 letters and 1 number and have no special characters, spaces, punctuation or symbols. and are case-insensitive.
 
Can I cry yet?
 
oh wow.
 
And this is a bank
 
CMC: How many TSB passwords+2FAs are there?
Each factor is [a-z0-9]{6,15} and the two factors may not be identical.
 
@Blue inb4 TSB uses mongodb
 
5:18 PM
I once saw a Reddit post where a secure HTTPS website used GET in their login forms... Weird that Google didn't made a warning on passwords in GET forms...
 
Oh, and each must have at least 3 letters and at least 1 number.
Should I complain about the security level or is this on par with what banks generally do?
 
I think it's rather normal but feel free to complain
 
CMP: How should +"23" be evaluated in Proton?
 
I think rather normal is the requirement to make anti-xkcd password
 
@HyperNeutrino NaN
 
5:27 PM
23
I hate when language returns NaN or a similar value in such cases
 
@HyperNeutrino What does +23 give? What does + do for other data types?
 
@Soaku But it's a string... How could it possibly give anything other than NaN?
 
do you want to be JS, or NaN?
 
@DJMcMayhem In APL, +'23' gives '23'.
 
I kind of want + to be a no-op as unary, so +"23" == "23"
 
5:29 PM
OK, maybe I worded that wrong. It's a string, how could you expect it to give a useful numeric value?
 
and then I'd have -"23" == "32"
 
I strongly dislike languages that implicitly cast strings to integers
 
@DJMcMayhem "23" interpreted as a number is a number right? I don't see the logic of such thinking here. Types don't really matter that much
 
why not convert the "+" into the string?
 
I could also make +"23" == 23 and +"hi" is NaN
 
5:30 PM
so +"23" == "+23"
 
@Soaku If you explicitly interpret it as a number
 
@HyperNeutrino Wait, reverse? Don't you have a reversing built-in?
 
[::-1]
 
@HyperNeutrino But then what about +"023" and eventually you have JS.
 
5:31 PM
IMO, this is going the wrong way: instead of saying "What does X and Y do", language design should be "how do I do Z"
 
@DJMcMayhem Well, PowerShell strongly dislikes you back ;-)
 
I like python's attitude:
>>> a = +"23"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: bad operand type for unary +: 'str'
>>>
 
the question is what unary + even means
 
@DJMcMayhem doesn't +"23"" itself say to interpret it as a number? If + functions both as math op and string concat (which is insane), then I would never make it NaN. It could either be 23 or an exception, with my preference of the first one
 
better question: who actually wants unary +?
 
5:33 PM
^
 
because it compliments -?
big deal
 
@HyperNeutrino What does +23 give?
 
PS C:\tools\scripts> 1+23
24

PS C:\tools\scripts> 1+"23"
24

PS C:\tools\scripts> "1"+23
123

PS C:\tools\scripts> "1"+"23"
123
 
in fact, I think I'm of the opinion that unary negative is also a bad idea
 
5:34 PM
@NathanMerrill So you must use 0-x to negate x?
 
yeah
its uncommon, and easily rewritten
 
@AdmBorkBork Well I already knew that :P
 
similar to not wanting "x++"
 
@AdmBorkBork D:
So it always casts obj1 to typeof(obj2)?
 
It takes whatever is the left operand and tries to cast everything else to that.
 
5:37 PM
@Adám 23
 
then why is "1"+23=123, not "123"
 
@HyperNeutrino So, a no-op?
 
^ for numbers at least
where did my userscripts go
 
@NathanMerrill Well, APL embraces the ambivalence of symbols, so that most symbols can be used monadically or dyadically. Monadic - negates everything. + negates the imaginary part, i.e. it is complex conjugate.
 
@Soaku It is. There's an implicit Write-Output that happens at the end of every execution, so you get it written back to STDOUT as a string. If I encapsulated it into a variable, it'd be of type String or Int32, as is the case.
 
5:39 PM
ah, fine. I'm blind
 
@Adám yeah. For a language like APL that emphasizes brevity, I think that's a good decision
 
I am going to use Python standards
 
@NathanMerrill It isn't so much emphasis on brevity as much as on expressiveness and mnemonics. It is intended to be an alternative to conventional mathematical notation.
 
@HyperNeutrino just don't have unary "+"
(at the bottom, one of the bullet points)
"No one would shed tears if the unary plus operator disappeared tomorrow."
 
hm
yeah sure
 
5:45 PM
I'd be sad, but I wouldn't shed tears. It's incredibly useful in PowerShell golfing.
 
proton != golfing
so I'll take it out
 
also, big tangent: You know which language has the best parsing syntax: Scala
it's fantastic, because you don't worry about so much stuff
val forecast = weather \ "channel" \ "item" \ "forecast"
and you can cast it to a value easily, it handles lists well
 
I just realized something interesting after reading that article. In brain-flak, a++ is like (({}())[()]) and ++a is like ({}()).
 
so much of the ".getElement()" is just gone
 
@HyperNeutrino Yeah, if I were designing a non-golflang, I'd have strict type casting and error handling. Production PowerShell can get confusing when it tries to be super helpful on-the-fly by casting something to a String that you weren't expecting.
 
5:51 PM
command-line languages like Powershell are interesting to me: They try to be two things at once: a one-off quick statement and a full-blown language
they always have bizarre syntax and rules for this
 
@NathanMerrill The article you sent... wtf, most of these points don't make sense. Why would they be the "worst" feature?
 
I agree with all of them, actually
I mean, there may be worse ones, but yeah, all of them I agree with him on
 
@NathanMerrill I didn't agree with most of them
 
really? I'd be interested in knowing which ones
 
#9 and #7 make sense
not the others
oh, maybe #6
 
5:56 PM
ok, then lets talk #10: you want a language with an empty statement?
 
I don't see any problem with this one. There is no point in banning this. Nobody uses it anyway
but why force it?
 
I have written accidental empty loops
and I've seen them written
the use-case is minimal, and the potential harm is high
 
@NathanMerrill And I have never. I've got no idea how somebody can do so
It's useful in some polyglots tho :P
 
all it takes is a stray semicolon.
most of them time, those come from copy/paste and moving code around
 
0
A: Sandbox for Proposed Challenges

BeefsterWord Search on a Torus string grid filter code-golf The Challenge Given a list of words and a grid of letters, your job is to determine which of the given words can be found on the grid in all 8 directions, much like a word search. The grid is toroidal, so the grid wraps around on the edges....

 
5:58 PM
why would you place a stray semicolon? And it's rather for the thing to hate, not the empty statement
 
its has nothing to do with a "for"
it can be any loop
like a while
or if statement
 
@NathanMerrill That's only because the loops can work on a single statement with no ending keyword.
 
like I said: when you are copy/pasting code, often times you do/don't want the semicolons
 
C# doesn't say anything when you put ; inside a non-for statement? ಠ_ಠ
that makes a whole different thing
 
oh, it prints a warning
but it doesn't error
 
6:00 PM
ok. it makes sense then
 
anyways, it has happened. It's also a feature that doesn't come by default, depending on your parser. You generally have to explicitly say that statements can be empty
 
@NathanMerrill In APL, empty statements do truly nothing. Don't close loops, don't terminate functions, nothing.
 
I mean, I wouldn't remove it from C# now (obviously), but yeah, I think it's a poor idea to implement it in a new language
even if you have something like APL that makes it do nothing
 
@NathanMerrill Wait, doesn't allowing empty statements allow you to comment out code?
 
? I'm not sure I follow the logic there
like, if I have a multi-line statement, and the semicolon on the last line?
and I only comment out the first lines?
 
6:07 PM
@NathanMerrill E.g., but more relevant for languages where line endings are (on of the) statement separators.
 
like newlines? yeah
 
implement it like in lua
 
@NathanMerrill But also potentially in-line comments (if the language has that:
 
or like in js
 
A lot of his points seem to be ranting for the sake of ranting. Someone with 25+ years of experience, as he self-described, that doesn't remember the difference between ++x and x++ without consulting reference documentation doesn't have any right to complain about language "features."
 
6:08 PM
he's a primary designer of C#
 
some code;
/* some */ code;
/* some code */;
 
he knows C#
@Adám yeah, that still seems like a poor usecase IMO
the whitespace argument is a good one, though
 
@NathanMerrill Well, then since APL (also) uses line breaks as statement separators, I guess its empty-statement-does-nothing policy is good.
 
@Adám I don't know about you, but I find /* some code; */ way more realistic and easy to work with.
I can't imagine any reason I would intentionally go to the trouble of placing the */ before the semicolon
 
@NathanMerrill This doesn't exactly inspire confidence.
 
6:11 PM
well, he's honestly one of my favorite writers in regards to language design. I highly recommend his blog.
 
How about first trying:
/* some */ code;
then
some /* code */;
then
/* some */ /* code */;
i.e. toggling pieces on and off?
 
I think he is very well reasoned and a great writer
 
I agree with Adam here
great writer who can't resist using clickbaits
 
Think about how the browser's inspector allows you to toggle each piece of CSS.
 
@Adám I totally agree: This sort of thing is possible: I just don't think it's common to write code like this
it's a matter of weighing "how useful is this" vs "how problematic is this"
 
6:13 PM
@Adám I don't think I would ever use that.
I would be way more likely to do:
//some;
code;
then
some;
//code;
then
//some;
//code;
 
@NathanMerrill I don't see how it is problematic at all except if the language allows omitting the endif/endfor/endwhatever and thereby makes the structure only apply to a single statement. Now that's crazy (IMHO).
@DJMcMayhem Do you never put multiple statements on a single line?
 
0
Q: "Enterprise" hello world program - Reverse Code Golf

Donald HobsonI am writing a hello world program in Python3 (a program whose only task is to print "Hello World") Now print("Hello World!") Isn't very "Extensible" or "Dynamic". The best I can come up with in this regard is def generateFunction(functionImputs,functionOutputs): def generatedFunction(*...

 
oh, I agree. If you have empty statement, you need to ensure that you can't have an empty block :)
 
Never. I don't see any reason to
 
I just wouldn't personally spend the effort to supporting such a feature (part of the "cost" in that equation)
 
6:17 PM
@DJMcMayhem I occasionally find that using multiple statements can help emphasise symmetries in the code:
 
hello
 
x=TransformationA(x); x=TransformationB(x+y+z); x=TransformationC(x+y+z);
y=TransformationA(y); x=TransformationB(y+z);   x=TransformationC(y+z);
z=TransformationA(z); x=TransformationB(z);     x=TransformationC(z);
 
this looks... pretty
@Yoginth Hi
 
@Adám yeah, I can see this being way more common in mathematical code
I've written similar code, and I often try to refactor it into a function, but that function always seems clunky and hard to name
 
@NathanMerrill Yeah, but also because APL is so concise, sometimes it is just a waste of screen real estate to have so many short lines. E.g. I'd initialise some variables on the same line:
counter=0; list=[]; total=100;
 
6:23 PM
eh, that argument holds no weight to me
 
@NathanMerrill Well, I try to keep my functions and programs to fit on a single screen. ANything more than that is way more likely to contain bugs.
 
@DJMcMayhem Don't write in PowerShell, then. My record for longest single line of code is close to 400 bytes.
 
@Adám var (counter, list, total) = (0, [], 100)
 
@AdmBorkBork Multiple statements or single?
 
@Adám I work in a very corporate environment so most of my code is multi-file, so trying to maintain a single screen is literally impossible
 
6:24 PM
Single statement, lots of pipes.
 
(Does APL have deconstructing assignment?)
 
@Pavel Yes: (counter list total)←0 ⍬ 100 (omit parens at your own peril)
 
For readability, I split it out based on brackets {}, but it's technically one line of code.
I'd share it, but it contains some internal info
 
@Adám Can you define how to deconstruct instances of custom classes?
 
@Pavel I don't understand. Classes and instances (and all other objects) are simple scalars, and all the array rules apply to them as to any number of character.
 
6:28 PM
@Adám Here, let me write up an example
 
@Pavel Also, you may use any nested structure, e.g ((a (b c) d) e)←… just like Python.
 
ngn
@Pavel no, because it has no object literals
 
In C#, you can do:
public class Foo {
	int A, B;
	public Foo(int a, int b) {
		A = a; B = b;
	}
	public void Deconstruct(out int a, out int b) {
		a = A;
		b = B;
	}
}

var (a, b) = new Foo(12, 42);
// a is now 12 and b is now 42
 
Deer Lord, why would you do such a thing?
 
you wouldn't want a Point() class you can deconstruct?
 
6:34 PM
@AdmBorkBork Here's an example. A Dictionary<k, v> implements IEnumerable<KeyValuePair<k, v>>. Therefore, you can do this:
 
As in Cartesian? I'd rather var x = pointB.GetX()
 
ngn
closest equivalent:
foo←⎕ns⍬
foo.(a b)←1 2
a b←foo.(a b)
 
foreach (KeyValuePair<k, v> kvp in someDict) {
    // whatever
}
 
@AdmBorkBork but not, (x, y) = point?
 
If you define Deconstruct for KeyValuePair, you can instead do:
 
6:34 PM
isn't that super readable?
 
foreach (var (key, value) in someDict) {
    // whatever
}
 
That's highly unexpected behavior, to me.
 
And then access the variables key and value directly.
 
@Pavel do structs get deconstruction for free?
or do they still need to implement it?
@AdmBorkBork it not a common feature, I agree. But if you saw the code, I don't think you'd be confused about what it does
 
They have to implement it, since you have to say what order the deconstruction is in, which fields are included, etc.
 
6:36 PM
KeyValuePai why is it pai? maybe KeyValueBoi
 
it's Pair :)
 
waffles
 
@Soaku Pai is Father in Portuguese.
 
I generally define Deconstruct as an extension method for KVP.
 
@Pavel I could see a reasonable way of giving it for free (give all of them, in the order declared)
but yeah, that's totally fine
@Pavel out of curiosity: where do you put your extension methods?
I'm never sure where to put them
 
6:38 PM
public static class Extensions
 
About key/value pairs, PHP made it in the most readable way I've seen yet. foreach ($array as $value), but since you define arrays as ["key" => "value"], key/value foreach is done via foreach($array as $key => $value)
 
Note: Unlike in C, the order the fields are declared in doesn't actually determine in which order they are in the compiled struct. When interoping with C, you have to manually specify struct layour paramters to order them correctly.
 
@Pavel lol ok
 
You can use the "manually specify struct layout" trick to create union types in C#, which lets you do some intresting things but mostly create some really fascinating bugs.
@NathanMerrill Although, in C# 8, you would do public extension class NameOfClassYouAreExtending { ... }
 
and put it where?
 
6:43 PM
And then you can define not just methods, but properties and fields, too
@NathanMerrill It's own file
 
named NameOfClassYouAreExtending?
 
Or ClassNameExtensions
 
@Pavel ew. This I don't go along with
 
@NathanMerrill Not public fields, by the way. Public properties, but only private fields.
 
@Pavel I think maybe I'm just more used to the object-oriented nature of PowerShell. Try it online!
 
6:44 PM
I'm ok with methods, but actually adding to the data that gets stored with objects feels problematic to me
 
@AdmBorkBork Yeah, that's how you did that in C# before we got deconstruction.
 
it's an interesting idea though
I'll have to think about it
 
Actually IDK about private fields
I think that's the part they weren't sure about
 
Makes sense, since PowerShell and C# are cousins.
 
But for sure properties, since properties are implemented as methods
 
6:45 PM
@Pavel Dyalog APL doesn't have deconstructors, but you can have a default property:
 
well, yeah
 
:Class Foo
    ∇ Foo(a b)
      :Access Public
      :Implements Constructor
      A←a ⋄ B←b
    ∇
    :Property Default Deconstruct
        ∇ r←Get
          r←A B
        ∇
    :EndProperty
:EndClass
a b←⌷⎕NEW Foo(12 42)
 
I was just thinking, if you set an autoproperty in an extension class, will it generate a backing field?
 
yes
I mean, if you allow autoproperties, that's the only reasonable way to support it
 
Or rather, can you set an autoproperty in an extension class
 
6:47 PM
I'd say yes if you allow private variables
 
Which we don't actually know
 
I just read the top post, but it appears that instance fields aren't allowed
 
Notice how it's a proposal and not the spec
I remember reading a lot of discussion about whether fields would be allowed
 
@Adám what is the squad doing before ⎕NEW?
 
yeah.
 
6:49 PM
@J.Sallé Fetching the value of the Default property
@Adám Feature-request: Deconstructors :P
 
oooh, I'm pretty excited for C# 8
 
Absolutely
 
interface methods is the #1 reason I use extension methods
 
0
Q: Elixir Array Syntactic Sugar

OkxIn Elixir, (linked) lists are in the format [head | tail] where head can be anything and tail is a list of the rest of the list. Lists can also be written like [1, 2, 3] which is equivalent to [1 | [2 | [3 | []]]] Your task is to convert a list as described. The input will always be a valid lis...

 
but they are adding default methods, so that gets rid of their primary use case for me
 
6:53 PM
@Pavel I'll make sure to forward that to the CA, but can you modify my TIO link to show how you would want it to look?
 
I have a few extension methods that I just bring into every project I work on
 
C# 8 looks like they realised that Java and Kotlin have null handling syntax sugar
 
C# already has null handling syntax. They are simply improving it
 
but type? looks exactly as in Kotlin
 
I literally just typed the following code: e?.ToString() ?? ""
what they are doing is making null handling code required
which is a great move
 
6:58 PM
that reminded me of !ErrorOccured() ??!??! HandleError()
 

« first day (2648 days earlier)      last day (2197 days later) »