« first day (2368 days earlier)      last day (281 days later) » 

6:58 AM
@Adám if I guess, say, that there is an i-beam that tells you the actual seed when ⍬≡⊃⎕rl, and I'm correct, will you tell me what number it is?
 
No.
I'm not at liberty to reveal undocumented I-beams. The dozen on APLcart are only there because they have been used (and then usually described in a comment) in code that Dyalog ships or publishes, so I collected that information. If you want to know Dyalog's secrets, you'll have to join the company (but of course, that includes not being able to tell outsiders).
 
7:23 AM
was half joking :)
omw to bruteforce all i-beams to figure out what they do
 
Yeah, good luck with that…
 
 
3 hours later…
10:12 AM
is there a non .net way to read a fine as binary (bytes)?
 
@RubenVerg File? If so, then ⎕NREAD is what you want. It can read as bytes or bits or any other internal type.
 
10:25 AM
great thanks
yeah I meant file :)
 
I'll add ((⎕NUNTIE⊢⎕NREAD⍤,∘83 ¯1)⎕NTIE∘0)Dv to APLcart.
 
@Adám Sorry, I missed this somehow. Thanks!
 
Any additional keywords I can add to the entry to make it more findable?
 
I think "read binary" and "read bytes" should be enough
does "8 bit integer" mean signed and "8 bit character" unsigned?
or does it actually read as a char array
 
10:43 AM
Ah, I should clarify that, and add an alternative entry for the other one.
 
 
2 hours later…
1:02 PM
Announcement: Only 2 weeks left for 10% Early Bird Discount for Dyalog ’23 registration (expires 6 Aug.)
 
 
2 hours later…
2:45 PM
I cannot attend this time. If I found some other solution I wil post it
 
3:00 PM
Welcome to APL Quest 2020-7! Today's quest is See You in a Bit:
> A common technique for encoding a set of on/off states is to use a value of 2  for the state in position n (origin 0), 1 if the state is “on” or 0 for “off” and then add the values.
> Write a function that, given a non-negative right argument which is an integer scalar representing the encoded state and a left argument which is an integer scalar representing the encoded state settings that you want to query, returns 1 if all of the codes in the left argument are found in the right argument (0 otherwise).
So, there are really two parts to this problem.
One is to convert the integer states to compatible bit-masks.
The second is to check if the 1 bits of the query are also 1 in the state. If there's a 0 in the query, it doesn't matter if the state has 0 or 1.
Then we do a ∧/ to make sure all requirements are met.
 
∧/⍤⊃⍤(//)⍤↓↑⍤,⍥⊂⍥(⌽2∘⊥⍣¯1)
 
OK, that works. Let's see if we can clean it up a bit.
Much of the work here is just to ensure the two masks have the same length with corresponding bits aligned.
However, if we use a vector of the two integers instead of dealing with one scalar at a time, all that just falls out. Compare:
      2⊥⍣¯1¨2 7
┌───┬─────┐
│1 0│1 1 1│
└───┴─────┘
      2⊥⍣¯1⊢2 7
0 1
1 1
0 1
 
{∧/⊃(//)↓⍉2⊥⍣¯1⊢⍵},
 
Much better already!
But can we find a mathematical relationship between the columns rather than using replicate to isolate the relevant bits?
Note that each bits (a row in our matrix) can be considered separately (until the ∧/).
> check if the 1 bits of the query are also 1 in the state. If there's a 0 in the query, it doesn't matter if the state has 0 or 1.
 
3:16 PM
{∧/≤⌿⍉2⊥⍣¯1⊢⍵},
 
Beautiful.
 
Wow, that was a great lesson, thank you
 
Hey, we're not done yet!
For matrices ⌿⍉ can be simplified. Can you see how?
 
Oops sorry, got too excited :)
{∧/≤/2⊥⍣¯1⊢⍵},
 
Good good.
Next up, it seems a bit strange to use , outside the dfn to combine the arguments, only to refer to them with inside the dfn. Any alternatives?
Hint: Let's rewrite it as the, admittedly awkward, {∧/≤/2(⊥⍣¯1)⍺,⍵}
This should allow you to spot a pattern.
 
3:22 PM
Start with 2⊥⍣¯1, ?
 
Yes, indeed.
 
∧/⍤(≤/)2⊥⍣¯1,
There's probably a way to get rid of the parens?
 
Not entirely, no, but you can get rid of the
 
∧/(≤/2⊥⍣¯1,)
 
You got it!
 
3:25 PM
Yay :)
 
Another one is (∧/≤/)2⊥⍣¯1,
 
Ah, that's even nicer
 
These two are probably as good as it gets.
 
That took some thinking
 
:-)
Whenever I need to combine two conditions, I find it helpful to draw the diagram. In our case:
┌─┬───┐
│ │0 1│
├─┼───┤
│0│1 1│
│1│0 1│
└─┴───┘
And then it is just a question of finding the right logic function from among <≤=≥>≠∧∨⍱⍲
Heh, fun bonus exercise: Given a 2-by-2 Boolean matrix, return the function symbol.
 
3:32 PM
I wrote down
0 0 → don't care
0 1 → don't care
1 0 → no
1 1 → yes
and that helped
 
don't care means it is fine, i.e. yes
 
Ah, that's a nice way to think about it
@Adám ooh that sounds fun, will need some time to think about it
 
You have a week, after which we'll do 2020-8: Zigzag Numbers :-)
 
I really enjoyed this one. Thank you so much!
 
No worries. Thanks for coming.
 
3:36 PM
:)
Btw, why don't and ⊥⍣¯1 convert multiple numbers into rows of digits instead of columns?
In the powerset function {⌿∘⍵¨↓⌽⍉2⊥⍣¯1⊢¯1+⍳2*≢⍵} on APLcart for example, you have to do a after the 2⊥⍣¯1
 
@rabbitgrowth Because matrix product +.× is defined with a transposed left argument, so if we didn't transpose the result, you couldn't directly use +.× to multiply by the digit weights and sum the result.
@rabbitgrowth And yes, maybe ↑ isn't so important, and it'd be better to have a non--transposed result, as that's in fact very often needed. Indeed, J does gives the non-transposed result.
 
3:51 PM
I read the "↑" in APL and was confused for a moment :)
 
Sorry, should probably use ^
 
When is it useful to give digits weights?
 
That's how (mixed) base evaluation works.
 
Would you mind giving an example where +.× is used with or ⊥⍣¯1?
 
3:57 PM
@Adám is it too late?
I have ∧/∊⍥(⍸⍤⌽2⊥⍣¯1⊢)
(spent way too little on it, I'm sure it could be much better)
 
@RubenVerg A bit, but if you follow the transcript, you'll find it the sequence of demonstrated simplification applicable to your solution too.
 
yep, yours are much nicer
 
4:32 PM
@Adám ⊃'0⍨' '∧' '>' '⊣' '<' '⊢' '≠' '∨' '⍱' '=' '~⊢' '≥' '~⊣' '⍲' '1⍨'⌷⍨⎕io+2⊥,
surely could be shorter with some ,∘⊂'s but I'm lazy :)
 
4:54 PM
{f⌷⍨(⊂⍵)⍳⍨{⍎'∘.',⍵,'⍨0 1'}¨f←'<≤=≥>≠∧∨⍱⍲'}
lol
 
5:22 PM
Learned about ⊃⍷ for "is prefix of" from Array Cast today. That is nice wow
⊣≡⍴⍛↑ also seems nice
 
5:46 PM
@rabbitgrowth this is less cursed than my code I used for generating the list in the first place
I have a outer product (evaluate omega) somewhere
also I would argue the other six functions are also interesting, might as well include them
 
 
5 hours later…
10:50 PM
@RubenVerg the 6 others being?
Or is that 6 combinations missing from the ∘.f⍨0 1 set?
 

« first day (2368 days earlier)      last day (281 days later) »