« first day (2819 days earlier)      last day (2028 days later) » 

12:22 AM
Reddit thread "MRI disabled every iOS device in facility": reddit.com/r/sysadmin/comments/9mk2o7/…
Hospital installed a new MRI device, but then all the iOS devices nearby (and only the iOS devices) stopped working. Rather than being caused by some sort of electromagnetic interference, it turns out that helium from a leak had diffused into the electronic chips and broken the clocks. It turns out that the clocks in the iOS devices weren't sealed as well as the other devices.
The end result is a bunch of bricked phones and watches, but over the next couple weeks the helium should diffuse back out and they should start working again.
 
12:50 AM
Well, that's lost helium ... which is another problem (at least for U.S.A.)
 
1:05 AM
0
A: Sandbox for Proposed Challenges

BubblerMaximize Sudoku King's tour code-challenge sudoku Background Sudoku is a number puzzle where, given a n * n grid divided into boxes of size n, each number of 1 to n should appear exactly once in each row, column and box. In the game of Chess, the King can move to any of at most 8 adjacent cell...

 
@PhiNotPi whoa
 
@PhiNotPi wow leaking helium... sounds fatal
 
I'm not sure how long it had been leaking, but the good thing about helium is that it tends to disperse easily... if it had been argon, the people in the hospital basement might not have done so well.
 
 
2 hours later…
3:04 AM
But I'd hear that people sometimes suffocate because they inhale helium to make interesting sounds
 
3:18 AM
I had heard I mean
 
 
1 hour later…
4:39 AM
If I have an array of objects in python and wish to check if an object exists with a given key. Is there better way to do val in [obj.k for obj in obj_arr]
 
Dunno if it's better, but the first thing that comes to mind is something like [obj for obj in obj_arr if obj.k == val] (and test whether the list is nonempty).
But if you expect you may have multiple objects with that key in a large array, you're probably better off writing a for loop and breaking early when you find a match.
for obj in obj_arr:
    if obj.k == val:
        # Do x
        break
else:
    # Do y
 
4:55 AM
Ah, I've got it. A subtle change: val in (obj.k for obj in obj_arr)
That way you're using a generator instead of a list, which gives you the same exit-early benefits as the for loop version.
 
5:33 AM
@Downgoat What better?
Alternatively: any(val == obj.k for obj ...)
 
That's a good one too.
Seems like the main goals are 1) don't generate a whole list of results, and 2) short-circuit as soon as you find a match.
 
 
3 hours later…
8:58 AM
For the ones has to implement some language if 'a' is one array a[4..2] is the void list .
 
9:09 AM
@RosLuP Well, if .. means all the numbers up to 4 except the numbers below 2, then yes. E.g. if to←⊢↓∘⍳⍨¯1+⊣ and a←3 1 4 1 5 then a[4 to 2] gives
 
10:08 AM
@Adám it is ok for me (⍳4)∼⍳2 in how I see... definition for v..k would be (⍳k) ∼⍳v
 
@RosLuP So one of A or B (depending on ⎕IO) would be missing in the range A..B‽
 
yes I don't thought on that IO is always 1, definition possible v..k would be (⍳k)∼⍳v-1
@Adám

yes I don't thought on that; IO would be always 1, for that value, the definition possible v..k would be (⍳k)∼⍳v-1
 
@RosLuP This may interest you.
 
11:04 AM
0
Q: Find an array that fits a set of sums

AnushConsider an array A of length n. The array contains only positive integers. For example A = (1,1,2,2). Let us define f(A) as the set of sums of all the subarrays of A. In this case f(A) = {1,2,3,4,5,6}. The steps to produce f(A) are as follows: The subarrays of A are (1),(1), (2), (2), (1,1)...

 
hi all
 
What about in general programming language introduce one symbol that mean "increment by 1" and one as "decrement by one" in the loop I use always these operations...
 
@RosLuP Why do you want a single symbol? Is it very hard to type the two symbols 1+? And If you're incrementing a variable, then +=1 is only three characters.
 
11:24 AM
@Adám it is variable<-variable+1 or variable+<-1 against µvariable for example, at last 2 chars less ok possible it is too few
for the increment operator one can paint one 1+ in one char for example
 
how do I find comments I have been tagged on in the chatroom?
 
@Anush It should be in your notifications on the site.
 
11:41 AM
The situation is the follow: I can understand all code I write even without comments because I reduce operations to the one I thing very good ; but I not understand others because too much functions and operators and their idiom strange, and I am not so smart or info saving
 
@Quintec Hmm... the comments in this chat room don't seem to be listed
 
The situation is the follow: I can understand all code I write even without comments because I reduce operations to the one I think very good ; but I not understand others because too much functions and operators and their idiom strange, and I am not so smart or info saving
 
@RosLuP In APL?
 
This is for all programming language APL too... nobody understand me out of CPU and myself (but possible i'am wrong and my programs are wrong or someone else understand them...)
 
11:57 AM
@RosLuP For APL, try breaking complex code up into small pieces you can grasp. E.g. {⊃(⍸0=|∘⍵){⍺[1]@(⍺⍺ ⍺[2])⊢⍵}/('FizzBuzz' 15)('Buzz' 5)('Fizz' 3)⍵} may be tough to read, but try breaking it up: tinyurl.com/FizzBuzzAPL
 
12:09 PM
@user202729 Thank you for your comments to my question
 
thanks!
 
Another point: for this particular challenge, I expect that most of them are efficient heuristics solutions that is hard to prove time complexity.
 
12:25 PM
@user202729 That makes sense. I don't need proofs
@user202729 I changed it so it only has to be fast enough for the examples in the question
I don't want to stress people out :)
 
(unrelated note. I have no idea why this comment was upvoted again after the problem is fixed.)
 
That happens all the time
 
and I got a downvote :(
 
@Anush If you care about votes, just write trivial easily-answerable questions that get on HNQ quickly.
(don't do that!)
 
@user202729 I never will! :)
 
12:32 PM
@PostLeftGhostHunter and do you have any idea why?
 
I deliberately ask questions which I hope are surprisingly hard :)
 
@user202729 No. I find it annoying
 
on the grounds that there are 7 billion people who can try to solve it :) (sort of)
then one of two things happen hopefully either a) someone shows me why it isn't hard at all. That's cool or b) someone solves the hard problem . That's also cool
codegolf.stackexchange.com/a/174259/9207 might have just done that!
 
@user202729 hard questions are usually accompanied by mathematical descriptions. If they find a post hard to read, they downvote
 
@NathanMerrill Wrong reply?
 
12:37 PM
true.. and it looks like my problem may now be simple
assuming the answers that are appearing work for all the test cases
hmm.. I am not sure they are correct
if the input is [1, 2, 3, 4, 6, 7, 8, 10, 14]
6
X = [1, 1, 1, 1, 3, 7] doesn't seem to work
how do you make 8?
 
@Anush 7+1? I may have misunderstood the challenge. They are supposed to be continuous?
 
yes they are
@Emigna hopefully the question makes that clear
 
@Anush SHould be better now
 
ah ok.. let me see
 
12:43 PM
@user202729 Sure. Assuming you manage to read the challenge correctly ;)
 
@Emigna It's still wrong I am afraid [1, 1, 1, 1, 4, 6] gives 5 for example
 
@Anush I must have missed something again. The output should only sum to the values in the input, none other?
 
@Emigna Yes...
 
@Emigna yep
 
It's f(X) = S, not f(X) contains S.
the challenge is very clear, even with example input/output, why do people keep reading it wrong...
 
12:46 PM
:)
the ruby code appears correct at least
I am slightly relieved my challenge wasn't that trivial!
 
@Anush It's very difficult.
 
@user202729 phew :)
 
(unrelated note. I have misread the problem at least three times in programming contests. Of course the consequences are disastrous.)
 
DavidC has 23.5k rep and still misread it!
 
Reputation has nothing to do with the ability to avoid making mistakes.
Same for real-world knowledge.
 
12:51 PM
all true
 
I have a bad habit of skimming the content of the challenge and assuming the task by looking at the I/O.
 
It took me 5 reads to understand what was input and what was output. Mostly because you used different letters in your example.
 
@Quintec Of course, you're not supposed to use the same symbol for different variables.
Imagine x(x, x) = x(x-1, x) + x(x-2, x/2)...
 
@user202729 I think he's referring to the fact that A in the text is S in the examples
 
@Emigna No it's not.
 
12:55 PM
@Emigna no it's not! A and X are arrays. S is always a set
 
A is more similar to X.
 
Ah yeah
I meant A is X
 
A and X have the same type
but it's confusing to reuse variable names
 
f(X, n) = S is how I interpret it
if our function is f
 
f(X) = S. In order to invert f you need to know n as well
 
12:59 PM
A is X, except X is output, and S is input, wait what's S, oh that's f(X), i mean f(A), i mean f(X), wait, why do the examples use the word from? Does that mean X is the input? But it's not...
 
the only input to the problem is S and n
When I write S comes from X I mean that f(X) = S
 
Yes but it makes me think X is the input
 
so you are given (f(X), n) and have to compute X
I hoped this line was clear
For example, if S = {1,2,3,5,6} and n = 3 then a valid output is X = (1,2,3).
 
Yes, but you shouldn't use the word "from"
 
@Quintec which words would you prefer? "comes from"?
 
1:03 PM
Just a table that says Input: .... Output: ...
 
@Quintec I could do that I suppose
but it wouldn't be right
Input:... Possible output:
 
Sure
 
@Quintec Done!
 
@Quintec A very good point!!
hmm.. a pause after an initial flurry of excitement :)
 
1:24 PM
-3
Q: exact change combinations

NoahWith euros you can pay an amount in a variety of ways. If you have to pay 13 cents, you can, if you have enough of all coins in stock, choose from sixteen different ways: There are also other coin systems. If you only have coins of 1, 13 or 169 cents, you can only pay 13 cents in 2 ways (ch...

 
@Quintec fun fact: Uranus' rotation axis (obliquity) is almost perpendicular to the Sun's. That means Uranus rolls around the solar system.
 
@Quintec are you happy with the change?
 
Yeah, it makes things more clear :)
 
1:39 PM
@Quintec Great!
Glad to be of service :)
 
1:52 PM
@Quintec Who told you A is X? Challenges should be parsed with mathematics, not English.
 
@user202729 A nice clean solution seems to have been posted
 
@Anush I'm pretty sure that the solution is not written in Clean programming language...
 
:)
 
@Anush (do note that comments that contains just "nice" on Stack Overflow are flagged as NLN.)
 
NLN?
 
1:57 PM
No longer needed.
 
can I pay a compliment at all?
 
... actually people here don't care much about them. But if it gets deleted don't be surprised.
 
ok
 
>.< Jelly does not have efficient builtin for "distinct permutations"
But I guess you can delete it after a while (when the poster have seen it?), just in case...
(I flag a lot of them on Stack Overflow, so I am "allergic" to it.)
Jelly is so inefficient...
 
@Quintec No JS on any Mars lander or rover?
 
2:09 PM
@Adám I don't think NASA (or any other space agency) would risk sending JS into space. The consequences could be devastating.
 
^
 
lots of MATLAB and Erlang apparently
oh at NASA...I don't know about on the mars rover
 
Wouldn't it be nice if APL used APL?
 
Wasn't Curiosity programmed in like a million lines of C? I seem to remember reading that somewhere.
 
491
A: What is the Mars Curiosity Rover's software built in?

World EngineerIt's running 2.5 million lines of C on a RAD750 processor manufactured by BAE. The JPL has a bit more information but I do suspect many of the details are not publicized. It does appear that the testing scripts were written in Python. The underlying operating system is Wind River's VxWorks RTOS...

 
2:19 PM
So there ya go. No JavaScript in sight.
 
@Adám "The RTOS in question can be programmed in C, C++, Ada or Java" I imagine those 2.5M lines of C would be like 15M if it was Java ⍨
 
@J.Sallé And 0.25M if it was APL…
 
@J.Sallé It depends. Java has some builtins which would shorten the code too.
(actually not very much. At least it has biginteger)
 
@user202729 the verbosity alone would increase the line count IMO
@Adám well one could say that (very technically) APL and C are interchangeable >.>
So yeah, no reason not to use APL ⍨
 
Twitter-driven development, "Sites are excluded only after a twitter demand, from someone with at least 1k followers. That's how it works. Feature requests here regarding those things are 100% ignored." — gnat 7 hours ago
 
2:50 PM
hnq probably accounts for 90% of my SE traffic
what a stupid issue
what did the twitter post even say
 
wow
i hate people
 
3:07 PM
Eh, the twitter drama is dumb, but I'm glad SE is finally thinking about fixing HNQ.
 
i honestly haven't had a problem with it
it is great for stack discovery
 
Absolutely, but many many other sites complain that only bad questions get featured.
 
This is the second (?) time the top voted answer is about veteran users not being listened to.
 
it's not for "good" questions
it's for "hot" questions
 
We have similar problems here where the simplest questions (e.g. add two numbers) are the ones that get featured
 
3:09 PM
seems like it's working as intended
 
@ZachLipton people on Twitter were polite, they explained the person's error and hasty judgement, but she rudely dismissed them. It was rude. She didn't engage at all. If I want to express an opinion on the Internet, that's my choice but I have to accept that I am open to criticism and/or correction(s) from outsiders. Just as I am now replying to your comment, acknowledging your dissent and trying to explain myself. — Mari-Lou A 6 hours ago
 
I found PPCG through HNQ.
 
Same
 
I found PPCG by searching "Regex golf" after stumbling upon it on xkcd
 
@Pavel I didn't even know what code golf was.
 
3:19 PM
Neither did I
That's why I searched it up
 
I found PPCG after googling for something in Java, and one of the links was to a challenge that had some Java answers.
 
3:37 PM
Quick questions guys. If a new user post a challenge that doesn't fulfill the requirements to be on topic and after a while he drop it, can we take it, modify it in order to make it better and post it again?
I ask because I liked this challenge and I dont know if the user who posted it is going to fix it
 
...The debate around clickbait is interesting:
People don't like it...but if the clickbait goes away...people won't click it. That's why it's called clickbait
@LuisfelipeDejesusMunoz yes. I'm trying to find a post on it, but you are absolutely free to fix up a challenge.
 
So, I'm continuing to brainstorm for my (as yet non-existent) GolfSQL, and I'm trying to come up with a list of commonly used strings I should make sure to include in my language.
I have the super-obvious ones (alphabet, reverse alphabet, digits 1-0, digits 0-9, entire printable ascii set (space to ~))
 
Perhaps you leave a bunch of space open to add built-ins?
that way, you can actually try using it, and see what needs improvement
 
Yeah, this feature will have plenty of room, in fact its going to just be a function F(n) so I can expand the range of inputs that return a valid output.
but clearly I can't just go and retrospectively add F(P) as "Peter Piper picked..." just for a single challenge.
 
Right, but if it is for a single challenge, then it's likely a bad idea
but if if comes up multiple times, then definitely add it
 
3:50 PM
Right. I know we no longer have the "language created after" rule, but we do still have the "adding a built-in just for a single challenge" rule.
Yep
The less common ones I was considering included "QWERTYUIOP..." keyboard order, but that also need a "row" number to be truly useful
We have a few occasional challenges that relate to keyboard order
Besides single-char keyword replacements for long SQL keywords (SELECT, REPLICATE, STRING_SPLIT), I'm also including a bunch of super useful predefined tables (number table, table of primes, table of dates) and associated functions.
None of that will make it competitive with register-based golfing languages, but should be leaps and bounds better than what normal SQL can do
 
@LuisfelipeDejesusMunoz Yes you can, post it yourself.
> If they don't want to modify their post or don't reply to the comments after a certain threshold (e.g. a couple of days), some other member of the community can take over their challenge and post it separately, of course mentioning the original post. -- source.
 
SQL has one big advantage, golf-wise. It asks for stuff declaratively
Aka, all you need to do is specify the requirements of what you want, and it'll find it
 
@LuisfelipeDejesusMunoz Make sure to search for dupes. We've had quite a few challenges related to making change.
 
@NathanMerrill Not as useful as Brachylog?
(coin change problem)
 
Yeah, Brachylog would be hard to compete against with a SQL-based language
 
3:59 PM
@NathanMerrill Yep. I think there are probably a wide universe of set-based challenges that SQL would be very competitive in, that are slightly different than the normal ones we see here.
Maybe I should post more questions like that
 
That's a clever way to get users: Find challenges your language is good at, and ask those questions
 
Import a million rows from an external table! Filter and transform! Group and output! do it all in under a second!
(enterprise hardware required...)
 
...I mean, "under a second" is out of fashion right now
 
No, I wouldn't include that part :)
 
make sure your logic operators is better than SQL. One of my least favorite parts of build SQL queries is figuring out whether to do "WHERE condition" or "AND condition"
I shouldn't say "one of my least favorite". It is my least favorite
Although, if they are writing queries directly, I guess that's less important
 
4:05 PM
@NathanMerrill Not sure that I will be able to change things that fundamentally, at least in version 1.0.
Right now GolfSQL really is two things:
 
It's a big find/replace engine?
with a bunch of preloaded tables?
 
1. A keyword replacement step (S replaced with " SELECT ", F replaced with " FROM ")
2. A set of user tables, procs and functions
So basically you'll take a string of GolfSQL, run it through this replacement function
and you'll be left with valid T-SQL that will run in a specific SQL 2017 databases where I've defined those user tables and functions
 
...Find and Replace doesn't work well with SQL
you still need to parse the query
 
No, I won't be "parsing" anything in any real sense
 
like, what happens if I want to search for the string "S" in my query?
That's no longer possible
 
4:08 PM
My intent was to use higher-bit printable characters, between 128 and 256
In the SQL default code page
For all my SQL keyword replacements
 
So, you're side stepping it for now. I still think a full parser would give you the most power, but that's up to you
 
Yep, side-stepping for the moment. So I'd actually be replacing Š with " SELECT " and ß with " FROM "
or whatever
By my reckoning that still gives me over 100 replacements, once I eliminate the unprintables and/or the ones that look too close to other chars (like all the various dashes)
So while that's less than the full list of MS SQL keywords and built-in functions, its still enough to be pretty powerful
I don't expect to need a shortened version of SEMANTICSIMILARITYDETAILSTABLE or something
But its still in the toying phase right now.
So instead of SELECT REPLICATE(LEFT(v,2),3) FROM t WHERE v BETWEEN 0 AND 7 you'd do something like Š™(è(v,2),3)£tÜvß0À7
which would expand to the other with a single set of keyword replacements
You're still left with too many annoying parenthesis and stuff, because you're constructing the syntax the same, it's just highly abbreviated
Actually, I can eliminate a few of those left parens as well, since they can be included in the replacement: Š™èv,2),3)£tÜvß0À7
 
4:23 PM
The other thing you can do is make a custom code page that represents Š as SELECT
Basically, this means you can write the word "SELECT" while gaining the byte benefits
 
I was about to suggest that ^
having a code-page table built-in would also be useful, I think
 
Hmm... not sure I entirely understand how to do that, but that's very interesting.
FYI I'm building this off of SQL's default code page, 1252 Windows Latin 1:
Or at least that's what I'm using as my list of available characters
 
Code pages are basically how you visually show a byte. So, the 1s and 0s for Š will be the same, but you say "It's rendered to look like SELECT"
for practical purposes, you'd need a converter between, say, utf-8 and your custom code page
so that you could turn the bytes in "SELECT" (in UTF-8) into the byte for Š
You don't technically need that, but it makes it much easier to back up your claims
 
That's pretty cool, I'll keep that in mind.
At the moment this'll probably all be in SQL management studio, though, so I doubt I can
 
Would that be similar to how Charcoal verbosifies/deverbosifies its own source code? Like this answer by Neil where the TIO link is a verbose version, but the debug pane shows the code as non-verbose.
 
4:32 PM
yeah
 
@J.Sallé V does something similar
 
Very cool
 
CMC: Given a string S of printable ASCII, print S, len(S) times with every character in the middle hollowed out (replaced with a space).
For example: "Hello, World!" -->
Hello, World!
H           !
H           !
H           !
H           !
H           !
H           !
H           !
H           !
H           !
H           !
H           !
Hello, World!
 
Verbose-capable languages are really good for this site IMO: They make golf languages more approachable to new users, helping to solve one of the big problems with the site (that new users generally don't like golfy languages)
 
13 bytes in V: $ÝäHjlLkhhr<space>
Or $<M-]><M-d>Hjl<C-v>Lkhhr<space> in verbose mode (since we're on the topic :P)
 
4:38 PM
lol :)
 
@NathanMerrill V's verbose mode is pretty user-unfriendly compared to charcoal. <M-]><M-d> is super obvious to me since I designed it, but says nothing about what it's really doing
 
It doesn't match Vim commands?
I was under the impression that V is a shorter Vim...is that wrong?
 
It does, but it defines new ones. Out of the box alt-d doesn't do anything in vim.
 
Ah, gotcha. So parts of the string is still pretty unfamiliar
 
So (mostly) every ASCII character is the same in V and vim, and then the 0x80-0xFF range is defined to do useful idioms.
 
4:40 PM
And only for users that can read Vim...which I don't actually know how common it is
I mean, I know that "M" means "Alt" but I can't tell you what any of the keyboard shortcuts are
 
I think basic familiarity is pretty common, but not many people would be familiar with using it in a golf setting
 
Perhaps, though I feel like there's a strong culture in Vim for efficiency, which leads to golfyness, right?
 
@NathanMerrill Actually all of the "Keyboard shortcuts" are just plain keys. So like alt+whatever usually doesn't do anything and "keyboard shortcuts" are combinations of things like yj or dip etc.
 
They're still keyboard shortcuts :)
I've had to look them up, and I'm familiar with the multi-step nature of them, but that doesn't make them not keyboard shortcuts :)
 
@NathanMerrill Sure, but when I'm using vim for editing rather than golf, I'd be more likely to do something easy to understand than the golfiest solution.
 
4:45 PM
Gotcha. Common idioms may be longer in bytes, but it's faster for your brain because it's the highway
 
One thing V does that I'm actually really surprised no other language I'm aware of has done too is regex compression. Since escaping is really common in regex, you can basically represent \ with a single on-bit. So like 0x73 means the letter 's', and \s means whitespace, so combine them to get 0xF3 means whitespace.
Which is nice because it only means that only in the context of regex, so it's not a waste of bytes because 0xF3 can still be it's own command outside of regex
 
I mean...regex seems super useful in Vim, and less so in other languages
Is V (in verbose mode) a superset of Vim?
 
@DJMcSpookem o_O what is that Ý?
 
@NathanMerrill In 95% of cases
Off the top of my head, some settings are different, certain things are implicitly added to the end of programs, and 0 doesn't do anything because | can achieve the same things.
@Cowsquack Fun :D
It gives the current column as a count
 
Actually...you can have a Vim/V polyglot with different byte counts
that's crazy
I don't think that's actually a polyglot? Not sure
 
5:00 PM
Uhh, I guess?
If you are actually typing "<", "C", "-", "v", ">", in vim, then I guess so, but then it would actually be a polyglot with the same byte count
 
@DJMcSpookem a quiack glance at math.vim gives ý as an alternative to
 
Oh yeah duh
@Cowsquack BTW, <M-[> gives the current line as a count, <M-]> gives the current column, <M-{> gives the number of lines in the current buffer, and <M-}> gives the number of columns in the current line
Because without those, you'd have to do something nasty like <M-D><M-x>.<cr>D"_dd@" to get the length of the current line as a count. ewww
 
it's been a while since I golfed in V
 
5:17 PM
I'm wondering how could I make object initialization in one of my languages. Either by a call (like in Python) Example(), new operator (C-like) new Example or by a method (GDScript) Example.new(). What's your opinion?
Example() could collide with static _call - might not be a thing one would use, but... new Example is nice, but a bit ambiguous (what would new Example.test do?), Example.new() is also nice, but takes the new name and would require to do return super.new() in constructor.
 
@Soaku You mean C++-like
 
@Pavel Yeah
 
@DJMcSpookem Canvas, 12 bytes
@DJMcSpookem I have had a full explanation (that's readable for me) for a compressed regex design, I just never got around to implementing it in SOGL. Don't think I'll be adding it to Canvas now (as I'd either have to make it very limited, wasting too many chars, or make a new object type, which would require quite some redo of things), so thanks for reminding me to put that on my next ascii-golflang idea list :D
 
5:33 PM
@DJMcSpookem Jelly, 11 bytes: J%L«þ`Ịao⁶Y
(beats Canvas, btw)
 
For APLers and other interested: Any feedback on my refresh of TryAPL?
 
@DJMcSpookem PowerShell, 60 bytes Try it online!
I wonder if I should temporarily change my name to AdmSpookSpook ...
 
you have until the 31st to decide :P
 
5:55 PM
@NathanMerrill "Connect to an Exchange server and execute this command against 500 mailboxes." Kinda limited in options to even choose from, lol.
 
@Adám the interactive lessons look nice, while going through the one on depth first search, I tried using ⎕← to debug each iteration but it looks like the quad is disallowed
 
@AdmBorkBork AdmSporkSpork™
you heard it here first
 
also, switching to another tab, like "primer" and going back to "learn" resets the lesson when I expected it to retain the progress, idk if that was intentional or not
 
@Cowsquack Yes, that's correct. ⎕← is blocked as we capture the result and send it to your browser. Any other output would be lost. I guess I could write a cover for ⎕← but it would be complicated.
@Cowsquack Not intentional, I think. IMHO, one should e.g. be able to use the Primer in the middle of a lesson.
 
@Cowsquack @Adám I was about to comment on that. Doesn't look intentional though
 
6:04 PM
@J.Sallé @Cowsquack @dzaima Anyone interested in a side job of converting more chat lessons to Jupyter notebooks? I can't guarantee that it can be arranged, but if there's interest, I'll ask.
 
@Adám Most definitely, yes.
 
@J.Sallé OK, I'll ask the higher-ups. What do you think would be a reasonable pay?
 
@Adám Don't really care about pay, to be honest. I won't complain if they feel like paying me something but I also won't complain if they don't :p
 
@J.Sallé Oh, ok. Look at the ones H.PWiz did (APL Basics and Closer Looks…) and then send us one you've made to notebooks@. Then I can show management and ask if we want to reward you for making more.
 
@Adám deal. Can I send it whenever ('cause of time zones and such)?
 
7:06 PM
@J.Sallé Yes of course, and take your time. I don't expect you to send it any time soon.
 
7:24 PM
0
Q: Hexagonal neighbors

ZeeYou have a hexagonal grid of points created by translating every other y-axis to the left as shown below. Each point has 6 neighbors, assuming the center point is (x,y), its 6 neighbors would be : (x, y-1) (x+1, y-1) (x-1, y) (x, y) (x+1, y) (x...

 
 
1 hour later…
8:41 PM
@DJMcSpookem Retina, 31 bytes
 
9:11 PM
thanks
 
@AdmBorkBork Personally, I think the decline in activity may mean that people are being more productive at work.
 
CMC: Given a ragged, but uniform depth, N-dimensional array of strictly positive integers, pad it with zeros to be non-ragged. E.g. [[[2,3],[4,5,6],[5,6]],[[15],[1,4,3,2]],[[2,3],[5,6]]][[[2,3,0,0],[4,5,6,0],[5,6,0,0]],[[15,0,0,0],[1,4,3,2],[0,0,0,0]],[[2,3,0,0],[5‌​,6,0,0],[0,0,0,0]]]
 
ngn
10:07 PM
@Adám can N be an input?
 
@ngn Sure, why not?
 
ngn
@Adám apl: ↓⍣(N-1)↑⍣(N-1)
 
@ngn Per consensus, you can't take input as a pre-set variable.
@ngn But I guess ↓⍣(⎕-1)↑⍣≡ is a valid solution.
 
ngn
@Adám i was just going to post that :)
with another ⎕ at the end
 
@ngn And what if you can't take N?
 
ngn
10:12 PM
thinking...
 
why does lichess not work for me right now
 
@ngn I have 12.
 
ngn
@Adám ⊃↓⍣(≡∘⊂)↑⍣≡⎕
 
@Adám I don't know any apl, but there is an exception for variables like "ans" (i.e. last expression)
 
@ngn Very nice. I had ↓⍣{1=≢⍴⍺}↑⍣≡.
@flawr I know, but no APL has that (officially) yet (although I'm lobbying for it).
 
10:21 PM
@Adám why would you like to have that?
maybe I need to read about APL first before I can understand any possible answer to this:)
 
@flawr Because I find it a natural way to experiment. Try an expression, and if it gives a result which moves in the right direction towards the goal, then build on that.
@flawr You don't know any APL? Well, then it's about time you get started with learning APL. Even if you keep using other languages, it will enrich your algorithmic thinking.
5
A: A greeting bot for a colleague from work

AdámAPL (Dyalog Unicode), 61 53 50 48 37 36 bytesSBCS Anonymous infix lambda. Called with YYYYMMDD f hhmm and then prompts for weekday number; 2 and 4 are Tuesday and Thursday. Redefines the global D to remember dates. D←⍬ {≢D,←⍺/⍨(⎕∊2 4)∧(⍺∊D)<30≥|780-⍵} Try it online! D←⍬ initialise D to be ...

 
@Adám You already convinced me to learn it at some point a while ago, so it definitely is on my todo list. Right now I'm still trying to get better at Haskell, which also taught me a whole different perspective so far (even though I don't think I've ever used it for anything else than golfing:)
 
@flawr See the explanation ^^ where each step uses the result of everything so far. If we had an "Ans" we wouldn't need to explicitly assign each step to a variable.
 
@Adám For REPL environments it totally makes sense. But I'm not sure how good it is for "programs" (as in files).
 
@flawr Oh no, my proposal explicitly prohibits it from programs. But APL development is usually done by experimentation in a REPL.
 
10:31 PM
@Adám Sure that makes sense!
@Adám are the different boolean expressions somehow implicitly chained via and?
 
@flawr No, the chaining is explicit: p<q is "q and not p"; p∧q is "p and q".
One could expand
  D←⍬
  ≢D,←20180827/⍨(⎕∊2 4)∧(⍺∊D)<30≥|780-0800
as
  D←⍬
  780-0800
  |⎕that
  30≥⎕that
  (⍺∊D)<⎕that
  (⎕∊2 4)∧⎕that
  20180827/⍨⎕that
  D,←⎕that
  ≢⎕that
instead of
  D←⍬
  ⎕←result←780-0800
  ⎕←result←|result
  ⎕←result←30≥result
  ⎕←result←(⍺∊D)<result
  ⎕←result←(⎕∊2 4)∧result
  ⎕←result←20180827/⍨result
  D,←result
  ≢result
 

« first day (2819 days earlier)      last day (2028 days later) »