« first day (1309 days earlier)      last day (1344 days later) » 

12:31 AM
PS C:\> ipcsv c:\sc\aplcart\table.tsv `t |? docs -match tio\.run

82 rows with a TIO link in the Docs column
 
 
3 hours later…
3:37 AM
I made a function to calculate all required powers till n under n for the almost prime challenge
⋄{(s∘*¨(s←((⊢~∘.×⍨)1↓⍳)⌈⍵))}5
 
@Razetime 4 9 25 8 27 125 32 243 3125
 
You're missing fourth powers.
 
yeah it doesn't seem to give me the right result
first power isn't there
and fourth power isn't there
 
2401 = 7^4
16=2^4
and they're truthy inputs.
 
⋄{(s←((⊢~∘.×⍨)1↓⍳)⌈⍵)∘*¨⍳⍵}5
 
3:41 AM
@Razetime 2 3 5 4 9 25 8 27 125 16 81 625 32 243 3125
 
I think this one is.. better?
 
4:03 AM
@TessellatingHeckler submitted a PR to fix
 
4:32 AM
tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/… so this porgram works correctly in dyalog classic
tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/v/… but in extended it gives a different output?
 
5:21 AM
@Razetime Oh wow, I made a mistake. The idea with Extended is that it is a consistent extension of Dyalog (17.1) but for dyadic ~ I mistakenly made a change that isn't backwards compatible. Nicely spotted. Oh, and btw, use Unicode, not Classic.
 
5:40 AM
Whats the difference between Unicode and classic?
 
@Razetime Unicode is the modern version. Classic is a legacy pre-Unicode version that uses a custom one-byte-per-character character set. Several features are missing from Classic, including support for scripts, which is why Classic "echoes" back all input to output. Multiple newer primitives don't have symbols either because their symbols aren't in the character set.
 
Ah, that makes sense.
 
RGS
6:07 AM
@Bubbler yeah, quite clean
@ngn usually by how many degrees? 90, 180 and 270? (The avatars I'm generating have 180° rotational symmetry :p)
If I have 4 items in a vector v ← a b c d is there a smart way to create the 2×2 matrix 2 2⍴a b d c from v?
 
@RGS Anything wrong with 2 2⍴v?
 
RGS
@Adám the ordering of the last two elements :)
 
Oh, my bad.
@RGS 0 1⌽2 2⍴v
 
RGS
6:22 AM
@Adám yes! awesome
@ngn like this, right?
 
6:55 AM
@RGS Looks believable, though 1×2 diagonals are also used sometimes.
 
RGS
@Adám wdym by 1×2 diagonals?
 
@RGS tan(x)∊{1÷2,2÷1}
 
RGS
@Adám ah ok, I think I understood what you meant
 
ngn
7:23 AM
@RGS right. btw, a 270deg rotation generates the same symmetry group as 90deg.
 
RGS
@ngn yeah, but I felt more natural to enumerate it like 90, 180, 270 instead of 270, 180, 90 :P
 
ngn
this would make a good
cmc: generate a random boolean 2×⍵ by 2×⍵ matrix with 90deg rotational symmetry
 
RGS
@ngn (uniformly?) random over all such boolean matrices?
And I already have an answer, it's just not golfed: ⊃⍪/,/1 0⌽2 2⍴(⊢,⍨⊂∘⌽∘⍉∘⊃)⍣3⊂?⍵ ⍵⍴2
 
ngn
@RGS that sounds like it might be unnecessarily hard, so let's use the codegolfing definition of "random" - any valid output has probability >0
@RGS this is where the fun begins :)
 
@RGS Why the ?
⋄ 2/⊃∘'█ '¨{⊃⍪/,/1 0⌽2 2⍴(⌽∘⍉⍤⊢)\4⍴⊂?⍵ ⍵⍴2}6
 
7:44 AM
 
RGS
8:05 AM
@Adám ugh, (⊂∘⌽∘⍉∘⊃,⊢) would've also worked, right?
@Adám This doesn't have 90deg rotational symmetry
 
are you guys making game of life structures?
designs looks pretty cool
Hey there @xpqz
 
RGS
@Razetime I was making mock SE avatars and then ngn posed a CMC
 
Good morning.
 
nyce
 
This place never sleeps.
 
8:15 AM
good afternnon
@xpqz being in different time zones helps
 
@RGS No, I see that, but it should be possible to do it with this method.
@xpqz Right:
 
and then Adám comes in with evidence lmao
 
It does seem activity is very limited around 02:00 GMT…
 
about 7:30 AM my time
I can't create activity then because of schoool
 
I can't create activity then because of sleeep
 
8:20 AM
yep, never sacrifice sleep
CMC: plot a randomly generated SO profile picture
 
An Identicon is a visual representation of a hash value, usually of an IP address, that serves to identify a user of a computer system as a form of avatar while protecting the users' privacy. The original Identicon was a 9-block graphic, and the representation has been extended to other graphic forms by third parties. == Invention == Don Park came up with the Identicon idea on January 18, 2007. In his words: I originally came up with this idea to be used as an easy means of visually distinguishing multiple units of information, anything that can be reduced to bits. It's not just IPs but also...
 
ngn
did you guys give up on this?
 
Well, it was a chat mega question
 
ngn
mini challenge
 
unironically would make a decent graphical output question
no, mega joke challenge lol
@Adám AH THATS IT
 
8:30 AM
@RGS ?
 
Hmm does this look like a good question idea
I feel like it can be a bit more complex
 
 
2 hours later…
10:42 AM
@ngn 17
 
ngn
@dzaima very good! :)
 
Is there a way of applying a function to one axis only of a matrix?
 
@rak1507 What do you mean by "applying"?
 
ngn
@dzaima if you rearrange it a little, it could go down to 16 (that's my best, the approach is similar to yours)
 
@Adám
1 2 3 4 5
6 7 8 9 10

becomes
1 2 3 4 5
f(6) f(7) f(8) f(9) f(10)
 
10:44 AM
Oh, so you want to apply f only on the second row (not axis)?
@rak1507 f@2 or f¨@2 depending on if you want f applied on the the entire row at once or separately on each element of the row.
 
Yeah a certain row or column, my bad
thanks!
 
Applying to a specific column (say column 4) is a bit more work. Either f@4⍤1 to apply it separately on each element or ⍉f@4⍤⍉ to apply f on the entire column at once.
 
ngn
@dzaima mine is a "full program"
 
@ngn ah
 
@ngn I've got 16 as a proper function.
 
ngn
10:52 AM
@dzaima yes, that works. btw, you can get rid of the strong 1-bias by using ≠ instead of ∨
@Adám (⌽≠⍉)⍣3∘?2⍴⍨2⍴+⍨ ?
 
For example. There are many variations of the rightmost phrase.
 
@Adám thanks again
 
Sure thing.
 
@Adám (note that the argument to f in f@4⍤1 is enclosed)
 
@dzaima @rak1507 I assumed these were numerical computations, f taking a scalar number and returning a scalar number.
@ngn Special challenge for you: Do it in 16 without
 
ngn
11:00 AM
@Adám (⌽≠⍉)⍣3?≢¨⍳,⍨+⍨⎕
 
Yup, that's equivalent to what I had.
 
11:12 AM
Generate your own APLvatar with {2/'█ '[(⌽≠⍉)⍣3⊢8 8⍴11⎕DR⍵]}'yourname' ― mine is
2
██████  ████████
████      ██████
████          ██
██
              ██
██          ████
██████      ████
████████  ██████
(⎕IO←0)
 
ngn
@Adám you're losing a lot of squares there because of predictability of input bits and lack of padding
better hash it first :)
 
11:29 AM
@ngn Of course. This is just for fun. However, you don't need a strong encryption unless you encode PII. That said, Gravatar uses MD5 on people's email addresses which means you can often find out what they are based on the icon.
Just doing a ≠\ already helps.
 
ngn
@Adám right
any stirring of the bits would do, including checksums like crc
i don't remember if md5 was already broken when gravatar appeared.. opens wikipedia
 
RGS
⋄ ⎕IO←0 ⋄ {2/'█ '[(⌽≠⍉)⍣3⊢8 8⍴11⎕DR⍵]} 'RGS'
 
@RGS Illegal code
 
⎕DR at fault.
 
RGS
Yup; why? Blacklisted or just not whitelisted?
 
ngn
11:35 AM
@ngn yeah, md5 had been broken before that, so it was a bad choice even then
 
@RGS There's no blacklist, really.
 
RGS
@Adám meaning there's only a whitelist of quad commands that work? Because IO works
 
Right.
@RGS Here you go:
⋄ ∆DR←⍉(8⍴2)⊤¯128+256|128+⎕UCS⍤⊢ ⋄ {2/'█ '[(⌽≠⍉)⍣3≠\8 8⍴11∆DR⍵]}'RGS'
 
@Adám INDEX ERROR
 
Oh well, 3rd's the charm…
⋄ ⎕IO←0 ⋄ ∆DR←⍉(8⍴2)⊤¯128+256|128+⎕UCS⍤⊢ ⋄ {2/'█ '[(⌽≠⍉)⍣3≠\8 8⍴11∆DR⍵]}'RGS'
 
11:41 AM
@Adám
        ██  ██
████        ██
    ██    ██
██    ████
      ████    ██
    ██    ██
  ██        ████
  ██  ██
 
ngn
@Adám see, that's why io's default matters ;)
 
RGS
Awesome haha
 
@ngn No, that's why ⎕IO being unchangeable matters.
CMC: Given a Boolean matrix, render it using ▀▄ █
I've got 15.
Actually, don't post solutions to this. I like this one so much that I'll suggest putting it into the next competition.
My 15 was a mistake anyway.
 
12:39 PM
competition?
 
ngn
@Razetime you forgot
 
oh in that competition
 
1:43 PM
If I have a vector of coordinate pairs:
c←(23 43)(78 34)(¯45 34)  ⍝ etc (y x)
Is there a smart way to pick the ones that fall within a given rectangle (XMIN XMAX) (YMIN YMAX)?
 
ngn
@xpqz smart = fast or short?
 
Let's start with short :)
 
@xpqz ⊃∧/0=(YMIN YMAX) (XMIN XMAX)⍸¨↓⍉↑c
 
Was thinking making a 2d binary map and dropping rows and cols
 
ngn
@Adám huh. does ⍸ support 2d?
 
1:47 PM
However, this will exclude (YMAX XMAX).
@ngn It uses lexicographical ordering. That's why I used ⍸¨
 
ngn
@Adám lexicographic order doesn't detect rectangles
⋄(2 2)(4 4)⍸⍳6 6
 
@ngn
0 0 0 0 0 0
0 1 1 1 1 1
1 1 1 1 1 1
1 1 1 2 2 2
2 2 2 2 2 2
2 2 2 2 2 2
 
Exactly. That's why I used ⍸¨
 
ngn
ah, now i understand, sorry
 
@xpqz If you want an inclusive range, use ⊃∧/(YMIN YMAX) (XMIN XMAX){(⍵≥⊃⍺)∧(⍵≤⊃⌽⍺)}¨↓⍉↑c
 
1:53 PM
nice
 
@xpqz Btw, I highly recommend keeping your data flat for performance. Can you not store your coordinates as a 2-row matrix or a 2-column matrix?
 
ngn
for short: c≡¨↓⍉↑ymin xmin⌈ymax xmax⌊↓⍉↑c
 
What I'm doing in this particular case is some path-finding stuff -- given a point, the next step can reach a smallish number of neighbours (single digits) that just need to be constrained to not 'drop off the board'. So data representation is certainly up for debate, but performance here won't be a problem either way. But I shall bear your suggestion in mind.
@ngn nice
 
ngn
c≡¨ymin xmin∘⌈¨ymax xmax∘⌊¨c
(⊢≡ymin xmin⌈ymax xmax⌊⊢)¨c
 
@ngn that instinctively looks as if it should be fast & short...
 
ngn
2:04 PM
@xpqz well, this one is each-y. for fast, do what adam said.
pair of vectors (x and y) should be fine too
 
2:36 PM
@TessellatingHeckler ohh intentionally in the docs column; well at least it took me on a fun trip through "I lost all my other changes because I don't understand git well enough" and recovering from that.
 
3:06 PM
@ngn md5 didn't even need to be broken, I had results from trying people's forum usernames at half a dozen big email provider suffixes (gmail.com mostly) then using the hash to confirm; the design of Gravatar is an information-leaky choice no matter what hash they use.
 
ngn
@TessellatingHeckler good point
 
and then a precomputed-hash attack only has to crunch through valid email addresses, e.g. from the kind of leaked dump HaveIBeenPwned gets.
 
3:30 PM
Then again, if people use their email address (without domain) as user name, they can't reasonably expect it to remain private.
 
ngn
@Adám i think the expectation is that an attacker shouldn't be able to deduce the user name only from the avatar
 
@ngn I'm a bit confused about the avatar usage. I'd think everyone is associated with a user name, and then an icon is displayed with it. That's how it works on SE. What other uses of such avatars exist?
 
ngn
@Adám gravatar is associated with an email address, not user name (i made a mistake in my previous message)
 
Ah so people would have a public facing user name and an avatar based on their private email address. Yeah, that sounds like a bad idea.
 
ngn
@Adám why? don't most websites that require registration work that way?
 
3:42 PM
They shouldn't display a hash (or an equivalent thereof) of any private data, since that allows checking guesses for the user's email address.
 
ngn
@Adám yep, that's the problem tesselatingheckler described
 
I get that having the same auto-generated icon across multiple services, even though your user name differs between them, is nifty, but then they should have generated a random avatar and only used the the email address for requests. But of course, the requests should be thoroughly end-to-end encrypted requests, not in URLs with a weak hash.
 
I'm not sure how else Gravatar could have done it; they used a dark pattern because otherwise nobody would bother signing up with Gravatar and getting a secret code and then logging into every website they use and entering their secret Gravatar code.
 
ngn
@TessellatingHeckler if we're still talking about not being able to guess the email from an avatar: maybe they could have used not a hash of the email, but an (asymmetric) encryption of it
but that would have required more infrastructure and effort to implement
 
Using what as the private key? Gravatar's model is that users didn't have to sign up, no new accounts, no signup, etc.
 
ngn
3:55 PM
@TessellatingHeckler using a private key known only by gravatar
 
@ngn at which point, why even base the image on the email? just generate a random one!
 
ngn
@dzaima this too is a separate problem from the enumeration attack on the hashes. i guess they prefer to base the image on the email because that way they don't have to store it as an image, they can generate it on demand and cache it for a while.
@dzaima imagine you have a million users. only a small fraction of them will bother to customize their avatars - those you'd have to store in a db, there's no way around it. but for the rest of the usership you can get away with only a small temporary cache and on-demand image generation, because not all of them are browsing all the time.
 
@ngn ah, for some reason i immediately connected asymmetric encryption with needing to store data per-person. of course it doesn't, in which case it makes perfect sense (until the private key gets leaked)
 
ngn
yep, keeping secrets is hard
 
So the site owner, instead of generating an md5 hash of every user's email address, they generate an encrypted blob using Gravatar's public key? Would still have to be the same blob every time for Gravatar to show the same avatar on every site, so it could never change if anything was compromised
it's website owners doing most of the work, they can easily generate md5 from most web backend languges, less likely they can incorporate Gravatar specific encryption code, and even less likely they will keep up with new versions and track PKI changes correctly
 
ngn
4:12 PM
@TessellatingHeckler "Would still have to be the same blob" - nope. at least not when the cipher is used with the a mode that supports iv-s (initialization vectors).
but this is probably too complicated for such a simple service..
 
IV used effectively like a salted hash? Where would the IV come from?
 
@ngn wait, what exactly does that solve?
 
ngn
@TessellatingHeckler on second thought, you're probably right. the iv would have to be part of the blob, which still allows enumeration :(
@dzaima we were trying to come up with some scheme that makes it harder to guess the email from an avatar
 
if you want some free money, maybe claim you can solve this with Blockchain, get some VCs to fund you
 
@ngn "harder" ah. i guess that would mean that you can't locally brute-force the images, but you could still send requests to the server
 
ngn
4:22 PM
@TessellatingHeckler lol :D and neural networks too
@dzaima read this
 
@ngn so any encryption is pointless
 
ngn
@dzaima well, as tesselatingheckler pointed out, in this case encryption is equivalent to a salted hash, which makes my earlier suggestion look silly
 
@ngn "We use a GPT-3 based public key derivation function"
 
@ngn yeah, thinking of salted hashes (with a constant salt?) is what made me think your suggestion wasn't that
 
I'm imagining it could be done; forum owner signs up their forum to Gravatar, they get an account with private communication with Gravatar's servers using whatever standard way. Then every page view where they need to show an avatar the forum sends the email MD5 to Gravatar and gets a random IV in return, puts that in the image link gravatar/icon?blob=FF2Etc
 
4:30 PM
<klg> public-key encryption wouldn't need to be equivalent to salted hash if you add random data to the encrypted payload rather than as a public iv
 
the visitor's browser gets a different blob each time, requests that iamge from gravatar, and gravatar have the email + code -> blob from their side as well so they can match it up
makes for a lot of computing and back-and-forth on gravatar and forum to do it, but in public it's a different blob each time and not including the email address
actually not a random IV just a random number
 
ngn
4:45 PM
@TessellatingHeckler might work in theory, but in practice forum owners aren't that sophisticated :)
@klg interesting
 
 
4 hours later…
9:01 PM
@dzaima Getting the following error. What's going on here?
   F←2 {𝕗+𝕘} 3
   f<6
DomainError: Cannot compare 5 and 6
 
@Marshall seems the result is wrapped in a function wrapper (i.e. what's done to make f←5 ⋄ F 0 work)
yup, it just does that unconditionally as the derive function has a required Fun return type
@dzaima don't think there's any reason for that requirement though, will remove it
 
@dzaima Is there an advantage to having a distinct function type? In the Go version I just had every value type implement a call method, that is, type Value interface { call (x, w Value) Value }. For modifiers it gives an error.
 
@Marshall i did think about doing that, and it does seem quite reasonable. i'd still keep the function type though, as a marker that the object isn't an identity function
 
@dzaima Might not be a constant function.
I guess this would also be a good time to PR my little change to make headerless blocks be immediate by default, so that something like {a+↩1} gets executed immediately. Was making these functions intentional? The spec version is sometimes better and sometimes worse but definitely more consistent.
 
@Marshall the probable use-case being (1+⊢)⁼10 vs (1˜+⊢)⁼10 (though for that it'd make more sense to have a true is-guaranteed-constant type, otherwise i still need to test for Fun/Mop/Dop)
@Marshall i intentionally have kept headerless 𝕨𝕩-less blocks as functions as i personally prefer it (and while the logic behind wanting them to be executed immediately is nice, it's still a little weird that the result isn't interpreted as a function)
 
9:22 PM
@dzaima If you think the purpose of blocks is to make subroutines then it's weird. But if they're just a way to encapsulate code then it's weird not to have a base case like an immediate block.
And the fact that IIFE is a real acronym shows that's a common thing to want.
 
@Marshall "weird" as in the sense that, otherwise, any block, when fully derived, is a function, and can be called afterwards. it's obviously the extreme perfectionist in me speaking, the thing's very impractical, nor is my implementation better (it's quite a bit worse actually), but ¯\_(ツ)_/¯
@Marshall no-arg functions are also a very common thing
(and IIFE mostly exists because js had horrible variable scoping. in java just { whatever; } is pretty much always equivalent (the only times i've used that have been for labeled breaks, aka poor man's goto))
 
@dzaima That's the point though? I wouldn't say that's any weirder than subjects being the only value role that can't be called or arrays being the only type that can have a non-empty shape.
 
@Marshall yeah, not saying that message has any value at all.
 
@dzaima Yes, I have to use them a lot in the runtime and end up confused when they work in dzaima/BQN and not my implementations! But the runtime has to use them because it doesn't have most of the constructs like structural Under that would let you write performant code with pure funtions yet; I'd hope it's rarer in full BQN.
The acronym IIFE is because of the Javascript scoping problems of course, but it's evidence that if creating scopes is a little awkward it creates a lot of friction.
 
@Marshall i have thought about having some (temporary) toggle for my preferences vs following specs, but don't have much else to add to it which wouldn't result in horrifying confusion
 
9:36 PM
@dzaima I guess that would work. On the one hand I don't want to dictate what other implementers do; on the other I think if something's called "BQN" the user should know what they're getting.
 
@dzaima (an alternative being me squeezing that into •vi and just making that "my preferences")
 
As an eventual goal. My implementation's still pretty far from spec compliance. I'll probably publish some test suites eventually so you can declare "passes BQN-BASE and BQN-COMPLEX" or whatever.
 
@dzaima pushed
 
@dzaima Thanks!
 
9:51 PM
@dzaima no-arg function in my tests
{2 ; 4}10 from my tests is now erroring (previously was 2)
@dzaima fixed that; now to find what causes bt to break
@dzaima ah, there wasn't any assertion error, it's literally {≤4} being an immediate error :P
 
10:16 PM
@dzaima that's not actually that easy if i want that to allow the •vi←1 in the same code block that uses the consequences
 
Another little oddity is something like {𝕊:3}6 not working. That would be my choice if I just wanted to indicate that a block is a function.
 
@Marshall iirc your spec (and you when asked) said that wasn't allowed
@dzaima just went with a static constant in the code and no option to toggle it at runtime; pushed
@dzaima (i'd probably need to move all 8 function calling methods to Value)
 
10:37 PM
@dzaima So I did. I can't figure out why I said so though. I guess I just thought it was unnecessary? But it's useful to say something is a function without having to take up a name for it. I'll add 𝕊 _𝕣 _𝕣_ as allowed labels (in FMain, _mMain, and _cMain_) in the spec.
 
@dzaima actually is-guaranteed-constant doesn't work
@dzaima i'll have to go with the inverse (which is what i already have with Callable (which doesn't mean much other than non-constant in BQN))
 
10:53 PM
@dzaima Breaks on single name function labels like {F:≤4}? My fix was just
     type = 'f'; boolean canBeImmediate = funType(tokens, this);
+    if (canBeImmediate && type=='f') type = 'a';
     ArrayList<ArrayList<LineTok>> parts = new ArrayList<>();
 
@Marshall :|; will have to wait a bit on pushing, since i'm in the middle of refactoring asFun away
@dzaima correction: 9 (including getting the identity element)
@dzaima (heh, 4´⟨⟩ could be anything)
@dzaima (and technically 10 for my way to access a double+double→double interface for faster reduce/scan without needing to write special code for each)
 
11:08 PM
@dzaima 4⍨⌿ is a nice way to get a major-cell's-worth of 4s in Dyalog, except for that identity issue. 4´⟨⟩ should probably just be an error.
 
11:18 PM
Ctrl+Tab from editor to Dyalog main window doesn't cause the same bug. AutoHotkey using WinActivate to try and bring Dyalog main window to the foreground does have the same bug, but using `#WinActivateForce` makes it work. Using AutoHotkey and intercepting Alt+Tab and, if in the editor, substituting Ctrl+Tab apparently helps but it does mean you can't switch from (other program) to editor and alt tab back to (other program), only back to the main window.

#IfWinActive ahk_class DyalogEditor_{58BFFE15-4D69-4480-B2F1-6316087A1F0A}
Whatever AutoHotkey's Force option is doing seems to be able to overcome it.
 
@Marshall that errors on {2 ; 4}1
pushed changes, and now there are 0 instances of (Fun) (still quite a few instanceof Fun though)
 

« first day (1309 days earlier)      last day (1344 days later) »