« first day (2320 days earlier)      last day (2509 days later) » 

6:01 PM
@Phoenix Depends on the author. E.g. there is an entire explicit-lambda APL compiler (compiles to C++) written in tacit APL lambdas!
 
@Adám I have been trying too hard to try to use ⍳3 and have failed many times
 
@Phoenix I generally tend to write monolithic programs that call lots of medium sized explicit lambdas which in turn use tiny tacit ones.
@KritixiLithos ⎕○⍨⍳3
 
what about a train?
 
@KritixiLithos (⍳3)∘○
 
My last attempt on the IDE was ⍳∘3∘○, I didn't bother to use parentheses...
 
6:04 PM
@Phoenix If you just need to apply monadic functions on an argument, and concatenate the results, then a tacit lambda is simply f,g,h,i,j,k etc. Compare to Jelly (which is an APL derivative).
@KritixiLithos That's {(⍵⍳3)○⍵}
@Phoenix Here is a function I worked on today. It is a giant explicit lambda, with tacit sub-lambdas being defined e.g. on lines 33-39. But note how the tacit lambda on line 38 contains an anonymous explicit lambda.
 
Can't acces GitHub rn, will remember for later.
@Adám If you're going to make a function that big, why make it a lambda?
 
kbd←{
     Hex4s←'[\dabcdef]{4}'⎕S'&' ⍝ find four-digit hex numbers
     Hex←⊃∘digits¨1+16 16⊤⊢     ⍝ decimal to hex
     Char←⎕UCS 16⊥¯1+digits⍳4↑⊢ ⍝ hex to character
     Symbol←(3⌊≢)⊃⊃,' ',Char    ⍝ appropriate display symbol

     In←{1⍳⍨⍺∘(⊃⍷)¨⍵}¨∘⊂ ⍝ first beginning occurance of each ⍺ in ⍵
     Is←∊∘⊆              ⍝ ⍺ is one of ⍵
 }
@Phoenix ^ the lines in question.
@Phoenix Why not? I originally wrote it as a program (not lambda), but it turned out to be a good fit for a lambda. The translation between programs and lambdas is very easy if the program has little or no structural blocks or side effects.
 
Welp, IDK APL
 
@Phoenix No problem; I'll teach you :-)
 
I'm fine with knowing Mathematica.
 
6:20 PM
@Phoenix Welp, I don't know Mathematica. To me, it just looks like a jumble of ampersands, hashes, and built-ins with long names.
 
@Adám At least the built-in names are descriptive, so you know what's being done, even if you aren't sure in which order.
 
Don't forget @ signs
 
@Phoenix That's true, but specialized APL built-ins have proper names too, and our new IDE (RIDE) shows tooltips when you hover the mouse over a glyph.
Also, the APL glyphs are very mnemonic. Once you've been told what one does, you won't forget.
 
Mathematica is easy. f@x is the same as f[x], which is a function call. # is a lambda argument, a lambda being denoted by & at the end.
That's basically it.
 
@Phoenix so could you also write f[#]&x for f[x]?
 
6:25 PM
0
A: "Hello, World!"

georgeMATLAB, 21 bytes Thought I'd another to the long list of answers disp('Hello, World!')

Is it OK if I edit this? It can be golfed 1 byte, and OP is no longer active.
 
@Phoenix APL is easy. f x is the same as f(x), which is a function call. is the right lambda argument ( the left, note: leftmost and rightmost letters of the Greek alphabet), a lambda is enclosed in curly braces.
 
@flawr lambda args don't have names
 
I mean assuming x is some values
and f some function
 
Or should I add a separate answer? We are aiming for a catalog with all the shortest answers, so it should be one or the other.
 
@Phoenix Rigth, they are denoted by symbols, not names.
 
6:26 PM
@StewieGriffin hm
I think editing would be allowed
 
@flawr Yes.
 
@flawr is there a way to replace the element with something else, using arrayfun?
 
@flawr Yes. Also, the parens in f(x) are completely unneeded.
 
@Dennis why does ¦ not work with non-vectorizing links?
 
specifically I'm iterating over an image and replacing the white rgb triplets with 1s and everything else with 0
 
6:28 PM
@Riker In Dyalog APL version 16.0 you can use new@position to replace elements.
 
@Riker so an rgb image is usually a MxNx3-matrix in matlab, do you have the index of that pixel?
 
?
index of what pixel
I need to apply this to all pixels
 
oh, do you have the indices of those pixels?
 
@Adám I need to use matlab though, it's part of a larger script which I'm turning in
@flawr nope
 
@flawr f[x] is the sames as f[#]&[x]
 
6:29 PM
@Phoenix ah thanks
 
I mean I could probably find the size of the img array in each direction but not other than that
 
@Riker Well, to bad for you then ;-)
 
you could use [i,j] = find(M(:,:,1) == 255 & M(:,:,2) == 255 & M(:,:,3) == 255); M = 0*M; M(i,j,:) = 1;
 
M being hte image?
 
yep
 
6:30 PM
and how's that work O-o
oh, I see
thanks!
 
sorry, forgot the find
Or if it does not matter if you get a binary image you can just write M=M(:,:,1) == 255 & M(:,:,2) == 255 & M(:,:,3) == 255
So in Matlab you can write almost everything in a vectorized way, instead of using arrayfun / map /filter or similar stuff=)
 
@flawr binary image?
i.e. just white and black?
yea, I can probably force that
@flawr :D thanks!
 
@Riker yep, each pixel is true/false (which can implicitly be cast to 1/0, e.g. if you use an areithmetic operation on that binary matrix)
 
so [1, 1, 1] and [0,0,0] works right
 
yep, both are 1x3 matrices
 
6:34 PM
If a lambda has multiple arguments, # is the first one, #2 is the second, etc. ## is a splat of all arguments.
 
quite golfy=)
 
Yep
 
I should use mathematica at some point
 
Mathics is free and on TIO
 
mathics = mathematica language?
 
6:36 PM
it's basically a free mathematica
 
Mathics is a python implementation of it.
It sometimes dies for no reason, and the longest builtins aren't implementated, but it works a lot of the time.
 
oh cool
basically the octave of mathematica :)
 
Pretty much
 
@Phoenix In APL, the ⍵[1] is the first, ⍵[2] the second, etc. is the list of them all. (i.e. uses same indexing syntax as everywhere else in APL)
 
I've always wondered what happens if you pass a lambda a splat as an argument, along with other things.
 
6:40 PM
@Phoenix Wait, what exactly do you mean by "splat"?
 
If 1,2,3 is the splat x, then {0,x,4} is {0,1,2,3,4} and not {0,{1,2,3},4}
 
splat essentially removes the braces around an array
 
@JanDvorak Ah, I guess would be APL's splat then. if x←⊂1 2 3 then 0,x,4 is 0(1,2,3)4 while 0,(⊃x),4 is 0,1,2,3,4.
 
seems good
In Ruby it works both ways
 
How do you "un-splat" in Mathematica? (APL's )
 
6:47 PM
a, *b, c = [*1..5] makes b equal to [2,3,4]
 
I use splat in my code (as a variable) to indicate something for which split has been applied
 
@JanDvorak a b c←1 1 0 0 1⊂1 2 3 4 5 makes b equal to 2 3 4.
 
TIL my name means "follower of Demeter, the Greek goddess of agriculture"
Also if you don't have I am Typing yet, please install it, it's really helpful
 
@Mendeleev Where?
 
yesterday, by ATaco
I am Typing now should work.
 
6:50 PM
@JanDvorak But what about a, *b, *c = [*1..5]
 
That's illegal
 
@JanDvorak Then APL's "syntax" (it is just normal function application) is much more powerful: a b c←1 1 0 1 0⊂1 2 3 4 5 makes a equal 1, b equal 2 3 and c equal 4 5
 
was that really necessary?
@Mendeleev
 
@Adám but then you need to know how many elements will be in b
 
@JanDvorak So what is the rule? All but the first and last go into b?
 
6:54 PM
When there's a splat on the left side, all others are assigned by position from the left and right, and what doesn't get its own variable is inside the splat
[*foo] is a synonym for foo.to_a
 
@JanDvorak And what is foo.to_a?
 
1..5 is a range, [1..5] is an array with a range inside, and (1..5).to_a is the range transformed to an array - an array of five numbers
 
@BetaDecay cool! :D
 
[*foo, *bar] performs concatenation
 
@JanDvorak Ah, I didn't realise there was a difference between arrays and ranges.
 
7:00 PM
Hashes turn into arrays of key-value pairs
 
7:15 PM
brainfuck without the '+' is still TC, right?
 
@JanDvorak What is a "hash"?
 
As long as you have wrapping cells
 
it requires a lot more thinking though
 
You can just replace each '+' with 255 '-'
 
+ is equivalent to 255 -s
 
7:16 PM
AKA, dictionary
AKA, map
 
Or more practically a sequence of n +s with 256-n -s
 
@JanDvorak Ah, and "key-value pairs" are just an array of unconnected names and values?
 
i've just started trying to golf that
it's a little annoying though
all that to get 2 >.>
 
@ATaco the "is typing" text has transparent background, which doesn't look good when scrolling the chat history.
@JanDvorak I'll just stick with APL. We've got just arrays and spaces (which cannot be converted into one another, but may contain each other).
 
7:20 PM
-1
 
@Adám Does APL have bare values, or just arrays?
 
@Mendeleev Every array has a rank and a depth. Even scalars, like a character, a number and a space, are arrays, and have rank 0 and depth 0.
 
All right, thanks, that makes sense
 
Actually, memory dumps are technically also a "thing", but they act almost like arrays.
 
@Adám what does rank and depth mean here?
 
7:27 PM
@Phoenix What about plov
 
@flawr Rank is the number of dimensions, e.g. a matrix has rank 2. Depth is the level of nesting (arrays in arrays), e.g. a list of strings (strings being lists of characters) have depth 2.
APL and J are AFAIK unique in having both rank and depth. No other languages have both.
 
Why did I just 3D print a comb?
 
@Adám ah I see, thanks for the explanation.
how about types: can you have different types in one array?
 
@ConorO'Brien Have fun xD
 
@BadCatEye hey=)
 
7:32 PM
@flawr In APL; yes. In J; no.
 
I really need to look into APL at some point=)
 
@flawr It's confusing
 
But there are so many interesting things, and so little time =/
 
I have no idea what the symbols mean
 
@Mendeleev so is Haskell=)
 
7:33 PM
@flawr Well, we have a chat room for that.
 
@Adám probably knows them all
 
@Adám oh great, well perhaps I'm gonna make use of that at some point in the future=)
 
@Mendeleev Well, you didn't ask. They are so easy to remember once some-one (me?) has told you the mnemonic.
 
What's the mnemonic?
 
7:34 PM
A mnemonic (RpE: /nəˈmɒnᵻk/, AmE: /nɛˈmɑːnɪk/ the first "m" is silent) device, or memory device, is any learning technique that aids information retention in the human memory. Mnemonics make use of elaborative encoding, retrieval cues, and imagery as specific tools to encode any given information in a way that allows for efficient storage and retrieval. Mnemonics aid original information in becoming associated with something more meaningful—which, in turn, allows the brain to have better retention of the information. Commonly encountered mnemonics are often used for lists and in auditory form,...
 
Not what's a mnemonic
 
@Mendeleev LIUITRM (Look It Up In The Reference Manual)
 
What's the mnemonic you used?
...there's a reference manual?
 
@flawr I don't think the reference manual brings memory devices :-)
@Mendeleev Yes of course.
 
Right...
 
7:37 PM
@Mendeleev I mean, each symbol is easy to remember, e.g. a large circle with a line on it represents mirroring over that line, so is horizontal reversal, is vertical flip, and is transpose.
 
Off topic note: OpenSCAD is pretty awesome
@Adám That's true.
I always get confused over the square, I keep seeing it as a missing character.
 
haha=)
@Mendeleev sounds interesting!
 
@Mendeleev Well, it refers to the "box" i.e. the system, the computer: ⎕← is output and ←⎕ is input, and ⎕xxx is a system name (function/variable).
 
@flawr Yeah, its language is very confusing for a bit before you get it and it's really easy from there
@Adám Thanks for the explanation
I keep thinking that some other character was there but got replaced with the missing character symbol/"tofu"
 
Strings are surrounded by single quotes, so instead of generic input/output () you can use for string input/output (i.e. STDERR/without trailing newline). It is a quote on the box.
 
7:41 PM
@Mendeleev While amazing, not all that common.
 
@Mendeleev Well, APL's predates tofu by a few decennia.
 
@Phoenix My mom makes it sometimes
@Adám True. I guess tofu is sort of ingrained in my brain
 
Ye, my mom makes it twice~ a year.
 
@Mendeleev So use Google's NoTo(fu) fonts. They cover APL too (albeit it looks funny in variable width). :-) But seriously, all modern systems have fonts that include all APL symbols. DejaVu Sans Mono is especially nice looking.
 
Yeah, I just installed all of Noto, Symbola, and code2000
Am I the only one who dislikes DejaVu?
 
7:45 PM
I feel like I've heard that question somewhere :P
 
:P
@flawr For example, here's a comb in OpenSCAD: hastebin.com/ayofavekuv.scad
 
@Mendeleev No
 
all right
I prefer Roboto, Noto, Source Sans
 
I like Menlo
 
Noto fits DejaVu's inteded purpose pretty well
For Serif fonts, I use Adobe Source Code Pro or Terminus
 
7:51 PM
comic sans is the best one out there
 
I like Roboto too
 
@totallyhuman No
@betseg Have you seen Roboto Slab?
 
Yeah
 
For monospace I like Fira Code, for sans serif I like the Ubuntu one.
 
all the roboto family fonts are nice
 
7:52 PM
I don't really have a serif font I like.
 
roboto, roboto slab, roboto mono
 
Nooooooo
 
@Phoenix Roboto Slab
 
comic sans, whyyyyyy
 
7:53 PM
I usually set it to Roboto :P
 
@BetaDecay I really want to do something large with it for the heck of it. Probably after I finish my current esoteric project tho :P
 
144 is better, but 10 is possible if you store result in the current cell, 8 if it can be stored anywhere. — Dennis ♦ 4 mins ago
i...
how???
 
@Mendeleev tutorial.dyalog.com (not safe for eyes)
7
 
@Adám Thanks
Will die now
I actually showed you this one
 
@Adám but why
why comic sans
 
7:55 PM
@Adám is this a joke? enter key doesn't work >_>
 
@Adám presses enter key ... nothing happens huh.
 
That too
 
@ConorO'Brien Just press Next
@TuxCopter Why are accents (or whatever they're called) in French so confusing
 
Once the next key is highlighted enter will work everytime
 
@TuxCopter Because we inherited it from an ancient system (back when Comic Sans was chick) and have kept it alive because apparently people like it (despite the awful looks, the content is quite good).
 
7:56 PM
@Mendeleev 3/10 no pictures
 
@Mendeleev ¯\_(ツ)_/¯
 
@Mendeleev they aren't, really. I mean, no more confusing than english spelling "rules"
 
Right.
 
> Hopefully, this course will teach you enough about APL to love it or hate it intelligently.
 
I wish I could try Pragmata Pro, but it is so expensive. I'd pay if I knew I liked it.
 
7:57 PM
But I consistently get <40% in electronic assignments with accent checking enabled, and >90% with it disabled
 
Oh wait, the Enter key does work, just the Next button needs to be focused
 
@Adám It's $20?
 
@Adám looks a bit condensed
 
NM it's $60 for just regular for desktop use.
And I'm pretty sure that you can do bolding and italicizing in software
 
@Mendeleev Yeah, I don't think the Essential version covers APL.
 
8:00 PM
Oh, I'm an idiot O_o
BTW what's Dyalog written in?
 
C and C++
 
Probably Monolog.
11
 
+1
 
@Mendeleev Mostly C, some C++, a little assembler, and… some APL!
 
8:02 PM
bootstrapping ftw :D
 
@Adám Assembler? Why?
But muh portability
 
how do self-interpreter languages actually work?
 
Needs some first version that wasn't written in that language
 
@Mendeleev I'm not sure (I'm not on the interpreter devt team), but I think it is to perform some very low level processor access that the C compiler won't do.
 
In computer science, bootstrapping is the process of writing a compiler (or assembler) in the source programming language that it intends to compile. Applying this technique leads to a self-hosting compiler. An initial minimal core version of the compiler is generated in a different language (which could be assembly language); from that point, successive expanded versions of the compiler are run using the minimal core of the language. Many compilers for many programming languages are bootstrapped, including compilers for BASIC, Algol, C, D, Pascal, PL/I, Factor, Haskell, Modula-2, Oberon, OCaml...
 
8:03 PM
Dammit ninja'd
 
wait what is wikiwand??
 
@ConorO'Brien A Wikipedia reader
 
@ConorO'Brien Do you have I Am Typing installed?
 
I do. Why should it matter?
 
Nevermind
I never see the thing
 
8:05 PM
@KritixiLithos Well, but since APL doesn't compile (it is interpreted), that's not how it works in the APL interpreter. Instead, we have something called magic functions.
 
Question: if I force-close my browser so I never send a "finishedTyping" thing to Am I Typing server, does it still show me as typing?
 
@totallyhuman nvm i got it
 
@Downgoat ha, that'd be funny
 
@Downgoat No because it closes the websocket
 
@Adám than it's like how PyPy works
 
8:06 PM
This font is cool: 01.org/clear-sans
 
@Adám that's pretty cool! It's kinda crazy how its faster than writing it in C...
 
@ConorO'Brien Haha neat. I'm always available here if you need to know anything more :)
 
@all What do you think about having someone hold scheduled APL teaching sessions on SE chat?
 
8:19 PM
seems kinda nifty
 
8:43 PM
does this explanation take up too much space?
also why do i have more upvotes than the neim answer
it's not only more impressive but also funny because of the amount of constants it has :P
 
@totallyhuman Upvotes are inversely proportional to the effort
 
@totallyhuman Too much space? Have you seen my answer? :P
 
your answer has a lot to go over :P
i'm not sure if the tape thing is really needed
 
@totallyhuman That's pretty much what I don't like about it. Nothing wrong with using the right tool for the task, but 32 constants and merely 6 snippets is hardly breathtaking...
 
9:09 PM
it's like mathematica
i misspelled pyke as puke
 
not much of a difference, is it?=)
 
No idea
I wonder how it is even allowed to cast votes o_O:
 
@flawr your eye has eyes
 
I don't have high rep and I've never seen community close something
 
9:17 PM
downvotes, i get
why is it upvoting stuff o0
 
-1
Q: Ayy Lmao Inception

eniallatorInput Any positive integer (greater than 0) Output where n is the input, print out "ayy lm", n times followed by 1 "a" and then with n amount of "o"'s at the end. Examples n = 1 ayy lmao n = 2 ayy lmayy lmaoo n = 3 ayy lmayy lmayy lmaooo n = 4 ayy lmayy lmayy lmayy lmaoooo This i...

 
@flawr It casts downvotes automatically when an answer is edited a few seconds after posting
Idk why
 
41
Q: Community downvotes posts that were just fixed

Michael MrozekIf a post has a low quality score flag on it, it's automatically dismissed as helpful if a user edits it, which results in an automatic Community downvote. I understand (kind of) adding a downvote if a moderator marks the flag helpful, but it seems bad to downvote the post at the exact instant so...

 
Yeah, that
 
@Dennis you know a lot about how se works, can you explain why community closed the above post?
 
9:23 PM
I have some questions about allowed input/output methods when using SQL, specifically this answer in the FAQ:
27
A: Default for Code Golf: Input/Output methods

jimmy23013SQLs may take input from a named table which is probably not good enough. But I don't know a better way.

 
hi guys :3
 
@totallyhuman how are you?
:3
 
"SQLs may take input from a named table" - does that mean I can do something like SELECT val1, val2, val3 FROM InputTable, if we expect 3 inputs?
Obviously for golfing I'd prefer SELECT a,b,c FROM D
 
@CriticalGhost i'm doing good, how about you? :3
 
9:25 PM
I'd say that's fine.
 
@totallyhuman excellent friend :3
 
@Phoenix Ok, for most purposes that's a lot simpler than making a whole function with typed variable input values
 
Well, I return to the chat of SOes XD
XD
chau
 
"Ciao"
 
Why even come in then..? /shrug
 
9:27 PM
A harder question: are there any valid input methods for Minecraft redstone/command blocks?
 
@BradC yes
scoreboard? I would assume so
World blocks?
levers?
 
Input bools with a lever
 
ninjad
 
or a button
 
that is a momentary input though
 
9:28 PM
You could use an arrow + image frame to get an 8-valued input
 
Ok, those are all ones that I can see would work, but are those methods that are allowed?
And is the extra command block that saves the input values to the scoreboard count in the bytes?
Wait, I might be able to prompt for values in Minecraft, hold on...
 
What do you think about this?
0
A: We need to talk about the Sandbox

AdámReplace the sandbox with a tag I think this suggestion is doable without any changes to SE. Introduce a special sandbox tag which has a description along the lines of: A proposed challenge. This tag indicates that the challenge is not ready to receive answers, but rather has been posted to ...

 
unexpected, but I like it
 
@Adám That's a really good idea
I was thinking something along the lines of that
 
@Adám I'm on the fence, wouldn't want to clutter main with unready posts
 
9:34 PM
^
Also, it might be hard to get everyone to not post answers and/or vote (would voting on "sandbox" challenges still be allowed?)
 
@Phoenix I understand your concern, but I front page exposure is the only way to get peer reviews.
 
i think voting should be allowed but answers... can they be disabled somehow?
 
@Phoenix When the first dupe vote is cast, the author is asked if the target "answered their question". If they say yes, Community casts a binding close vote.
 
@ETHproductions If someone posts on a sandboxed challenge, we kindly remind them/inform them. Why shouldn't voting be allowed?
 
Yeah, sorry, I was mistaken there for a second
 
9:37 PM
@totallyhuman There was a suggestion to put new challenges on hold.
 
@Adám Yeah, that would be be great. Users who wanted to sandbox all challenges before posting them would have hundreds of deleted, closed answers.
 
@Dennis thanks! I wonder why that never seems to happen.
 
I was also thinking that it would be difficult to get new users to do this. Were you thinking we would just kindly edit in the sandbox tag and explain the "rules"?
 
@ETHproductions That's a possibility.
 
@Phoenix Because the initial reaction by default to dupe votes is wtf this is totally different.
 
9:42 PM
@ETHproductions I've added this to the suggestion.
 
Thanks, looks good.
 
@Mego cheesy?
 
Whoa. Minecraft 1.12 introduces a new "function" command. Looks like you can create custom function files, place them in a certain path, and access them from within the game. That might bring Minecraft golf up to the next level.
4
Or not. Still don't see a super obvious way to input text or numeric values. Maybe as custom tags on an in-game object. Toss two objects into a hopper, with tag=6 and tag=9, then return 42.
 
count of items in a stack
 
heh stack
 
9:53 PM
wool color, perhaps
 
@JanDvorak Yep, that gives 0-15. A pair of wool blocks gives 0-256
 
armor color then?
 
@JanDvorak Not sure if you can "read" armor color via commands.
Even with wool blocks, you'd have compare 16 times to blocks of known color
 
> My fingers: Hmm, I swear we misspelled "weird" there...
> Microsoft Word: Haha what? I didn't see anything
 
Eh, looks at 1.12 "functions", they're not as useful as they could have been. its just a series of minecraft commands, not all that different than cramming them into command blocks.
 
9:59 PM
@ETHproductions yeah correct way to spell it is "sheep" :P
 

« first day (2320 days earlier)      last day (2509 days later) »