« first day (3916 days earlier)      last day (47 days later) » 
00:00 - 20:0020:00 - 00:00

12:50 AM
Documentation for (Pharo) Smalltalk is so absolutely terrible
I'm trying to read from a file, and the example in the File class involves calling some methods directly on a File object, but those methods are actually *class-side*/static and take the id of the file as an input, but I have no idea where to get those ids from automatically :(
1:27 AM
wow I never knew, apparently javascript was released the same year as java
history teacher says national history day projects must be about 20+-year-old topics, so I can't do a project on Ultrarisky
Aw :(
Truly a lot of historical events in its 8h of existence
I could finally use primary sources
last year (two years ago because 2020 never happened) I researched wikipedia because teachers keep specifically telling us not to use wikipedia
but I can use Ultrarisky as evidence of javascript's capabilities
if it's open-sourced, naturally
@Wezl so do it on APL
because APL is cool
1:44 AM
the theme is Debate and Diplomacy, so I can make a presentation about index origin and stuff
@user Weird coincidence: I just came here to say I absolutely love the intro paragraph of Esolangs's page on Lisp!
@Wezl I'll help if you need it.
you can write the diplomacy section :P
perhaps I shouldn't research a topic that I am so biased(/knowledgeable :P) about
1:54 AM
Researching a topic you're already biased and knowledgeable about just means an easy A :p
Why not? Then you can add an opinion section.
(At least, according to my friend who's turned in the same english essay for the last four years)
2:14 AM
CMQ: I have four list operations: head returns the first element of a list; tail returns all elements but the first; last returns the last element. What should I name the operation that returns all elements but the last?
@DLosc neck
@DLosc The entire article is a treat
@DLosc Haskell calls it init. It agrees with all other three names too
@Bubbler Ah, perfect!
@DLosc However, I disagree with your current naming. Should be head for first, behead for all-but-first, tail for last, and curtail for all-but-last.
2:18 AM
@Adám I've definitely considered that.
^^ It is J's naming if anyone's wondering
Factor: first, rest, last, but-last
So inconsistent. Why isn't it but-first?
head and tail are reserved for what APL calls take and drop
@Adám Well, I didn't name it :P
2:21 AM
Gotta love it when the implementation in APL is shorter than the shortest meaningful names: 1∘↑ and 1∘↓ and ¯1∘↑ and ¯1∘↓
@Adám Makes sense, but I’d feel a bit queasy writing that in my code
Perhaps body instead of beheD?
Obligatory reference to no A, just CAPS LOCK
@DLosc dropRight 1
@user But the idea is that the remainder after removing X is prefixX.
For some reason, I thought I got head and tail from some Lisp dialect, but neither Common Lisp nor Scheme appear to use those names (preferring to stick with the traditional but today meaningless car and cdr).
2:26 AM
@DLosc sans-tail
Ocaml has shorter hd and tl, but no equivalent for the other two
How about a and bc and z and xy?
@DLosc Where did Haskell and Scala get head, tail, last, and init from?
In Brachylog, it's head, behead, tail, and... knife. Possibly a Three Blind Mice reference, more likely an attempt at shoehorning a mnemonic around the command k
init really sounds like something entirely different.
2:29 AM
head and tail in linux refers to the first few and last few elems iirc
@Adám initial elems (but yeah, sounds like pythons init)
For whatever naming, you eventually get used to it anyway
assuming you don't give up entirely
@user Not sure. I think in my CS classes the terms head and tail were always used in that sense when talking about linked lists, though.
And all these names are so ambiguous. You can't tell from the names head and init what is what.
same with tail vs last.
Maybe it should be first, unfirst, last, unlast
In strictly typed langs, you're supposed to (at least partially) figure out what it does by looking at its type
2:32 AM
Or non instead of un, since un sort of implies an action
head and init have different type ([a] -> a vs [a] -> [a]) so Haskellers don't have problem differentiating the two
How about first dropfirst last droplast?
@Bubbler Oh, so they aren't 1∘↑ and ¯1∘↑
head is more like ⊣/ and init is like ¯1∘↓
I'd say head is and tail is ⊃⌽
@Adám s/tail/last
tail is 1∘↓
2:36 AM
Oof, well, proves my point :-)
Learning names is hard, really
Learning symbols is much easier.
Ehh... the experience varies from person to person, I'd say
@Adám It... doesn't exactly help when you have specific names attached to each symbol (though it would help with building intuition as you go)
Who has specific names attached to symbols?
2:39 AM
... my English isn't perfect
I mean like, ∊ has at least three names attached to it
epsilon (the symbol), enlist, member-of
That's the symbol, the monadic function, and the dyadic function. Sure, those are the official names – I think.
But monadic is "flatten" and dyadic is "in" or "element of" too.
- is dash/hyphen/bar, negate/negative/invert/opposite-sign/minus, minus/subtract/lessen-by…
Symbols are clear and unambiguous.
But you need to eventually know the official names to be effective, at least IMO
Huh. Why?
2:52 AM
I tend to want to pronounce stuff in my head (or out loud, if there's no one around to look at me funny).
Or it's just my bias from me depending on the official docs too much (and it isn't too helpful when you don't know the official name)
Oh wow. I don't associate the APL symbols with words until I actively try to.
Also yeah, verbal communication stuff
@pxeger What's match, that doesn't work...
i forget if it's a 3.10 or a 3.11 thing
3:05 AM
Oh I need to update Python
When you run python3 -v instead of python3 -V
Everything else uses -v...
@pxeger Oh well, you still missed a tab and now it's mostly unreachable
Fun thought for the day: putting bread into a toaster makes it toast. Does that mean putting toast into a breader makes it bread?
3:29 AM
Any last-minute feedback on river crossing puzzle thingy?
Looks good
3:44 AM
Sounds good
Q: Crossing a river with weird animals

BubblerBackground One kind of river-crossing problems involves two kinds of animals. One such problem reads like this: (all wordings, including animal species, are arbitrary) A farmer has to cross a river with three chickens and three dogs. There's a boat which can only fit the farmer and at most two a...

3:59 AM
when i see a bubbler post, i upvote
bubbler is such a god
Thanks for upvote, but lol no I'm not a god :)
you're Bubbler
4:17 AM
I think I might have found an interesting property of hamming codes
You can make a 2d grid, with hamming codes on both axes, and they'll make sense with each other
That probably doesn't make sense
I have an idea of what you're saying but it's probably wrong
<insert obligatory ham joke>
4:18 AM
This is a bunch of 15,11 hamming codes, and they overlap
Everything green (the color is hard to see) is the data
@RedwolfPrograms didnt 3b1b make 2 videos on hamming codes?
The gray and blue are the redundant bits, and they correspond with the parities of both the rows and the columns
It's quite cool
@PyGamer0 Yep, that's how I learned about them :p
This could actually be a pretty good error correction system, since you could lose a burst of up to like 16 bits in a row and repair it
@RedwolfPrograms didnt he also display them in the grid form?
This is different
4:20 AM
These are 22 (or 32, depending on how you count) hamming codes
They're arranged in rows and columns
E.g., row 7 would be a hamming code all on its own
And you could fit it into the 4x4 grid 3b1b used as an example
With this system, if a bit is flipped, you could fix it either by row or by column. That means you can fix long stripes of missing data by approaching them from the opposite side
It comes at a cost though. This one fits 121 bits of data in a 256 bit block, but it'd be more efficient if you scaled it up.
It feels extremely elegant though
A: Sandbox for Proposed Challenges

BubblerBuild the stove controller (physically) atomic-code-golf logic-gates Challenge Build the Wheat Wizard's stove using 2-input NAND gates. The solution with the fewest NAND gates wins. Externally, it works in the following way: (the first line is added from the original spec for physical output) It...

4:37 AM
CMQ: I have plans to be able to do: Þ∑÷L for average, instead of ≡∑⍨L÷, also it depends on the arity of the 3 operators after Þ, so if i have Þ∑L÷, it will be: ÷L∑.
^ for stack based
^ is it a good idea??
I wish my stove was interesting. For controls all it has is a regular old lever-and-flamethrower arrangement where you use the lever to put the transmission into the right gear, then trigger the flamethrower, lighting the gas in the combustion engine and cooking the food.
^ what is that dumb list
^ they dont even mention haskell / apl
TBF those are not particularly practical to learn as a regular old dev
> We often meet .NET, and Java experts. But, we rarely see programmers who master multiple languages.
It's very opposite here
@Bubbler lol
4:39 AM
@RedwolfPrograms Almost nobody uses them for actual business stuff
I do sort of disagree with the list though. C/C++ don't seem like they're exactly gaining in usage
And bash seems more like the sort of thing you can get away with picking up little bits of here and there
then s/c\+\+/rust
and then c != c++
Yeah, C and Rust seem like the two lower level languages to learn
why c??
its much harder
C++ just seems like the awkward middle child between C and Java
If you want something low level without many distractions as a learning experience, C is pretty nice
@RedwolfPrograms but in fact java is a kid of c++ , and why are we talking about families
4:45 AM
I'm not using the metaphor as in their siblings in what they were based off of, just C++ seems like it takes the middle ground between C and Java and I think it has some of the worst stuff from both (and adds in its own unique quirks)
Learning C is meaningful for 1) the memory model and 2) the inner workings of basic data structures found in the stdlib of other languages
C++ is just frick
Multiplying cout by 2 ** x should output x
For consistency's sake
@PyGamer0 why would they choose go over haskell or apl
@UnrelatedString idk
4:59 AM
it's like go is the most "different" thing the author has ever interacted with
which is just
@NewPosts I've tried for half an hour to solve this using codex (GPT-3) but with no luck
There's been some real interesting solutions, including creating a DFS helper function inside the submission
but none have worked
and now I've accidentally lost the prompt I was working with
so now I can't keep trying what I had
inb4 Jelly solution: construct all possible paths and check if any of them is covered by the input
5:16 AM
@cairdcoinheringaahing I'm sure you've already addressed your intentions on running in a much more grown up way, but... don't you dare not run for election, caird!
Oh wait, now I realize the election is for SO. I'm the worst, smh
(To clarify, I didn't understand anything. I thought we were electing one more person, and caird was the only honorary mod TNB guy who didn't win. But I didn't see his name in the running, so I feared the worst. Does that make any sense?!)
But but but, do you get it though?
I just had a notification for an election (which I figured was CGCC adding an additional moderator), so I clicked it and didn't see caird. That's how you know the world is ending.
5:36 AM
CMQ: I have plans to be able to do: Þ∑÷L for average, instead of ≡∑⍨L÷, also it depends on the arity of the 3 operators after Þ, so if i have Þ∑L÷, it will be: ÷L∑. Is this a good idea for dinoux?
i mean if there were a CGCC election
you would've been hearing about it for a while now
with discussions on who's running, candidates, the election room generated for every election, etc, and it'd have been pinned like 8 times here
Protip: Before reacting to anything in your inbox, check the site icon first
^ lol
also there's like no way caird wouldn't run. at least without like 17 people asking why here
5:44 AM
I think moderator elections are announced to all users, ignoring whether they're actual members of that specific site or not
@PyGamer0 just parallel apply sum and length then divide
@lyxal ?
well all eligible voters i think
definitely not every user otherwise everyone would be getting spammed all the time
@PyGamer0 ₌∑L/ but dinoux
@hyper-neutrino Agreed
5:47 AM
@lyxal wdyM
@lyxal idk
Para apply seems more useful than tacit chaining for stack based
@lyxal docs?
@PyGamer0 apply sum and length using the same stack
5:50 AM
so parallel apply applies 2 functions on one element?
3 4₌+- pushes 7 and -1
@PyGamer0 almost
3 4 ₌+d pushes 7 and 8
Runs both, one on a duplicated copy of the stack, then push the top of the duplicated stack to the main stack
@emanresuA ?
I have an idea... Factor's "stack effect checker" concept hasn't been in any stack-based esolang I think
5:54 AM
@PyGamer0 It's as if it created two different processes with the same stack, ran both processes at once, and merged their results into the main stack in order of process creation
@lyxal oh
It basically computes how many items a function consumes from / outputs on the stack, so it can be seen as different "arity" of functions
which in turn allows a combinator to act differently based on that arity
So Factor's fixed-arity?
Mostly for named functions, though there are certain escape hatches
i dont understand factor's combinators
6:07 AM
it doesnt say how it works
@lyxal is hardcoded arrays (this) counted as structures?
@PyGamer0 Summary articles are a bit unkind, but specific words (bi, 2bi, bi*, 2bi*, bi@, 2bi@) have a more concrete description
@PyGamer0 a list is considered a structure internally
@Adám when curating the snippets for APLCart, how did you choose what problems/subtasks/idioms to include?
There were a few existing compilation of APL snippets
like FinnAPL idioms (warning: extremely slow to load... sometimes)
6:26 AM
@Bubbler what it loaded very quickly for me
Q: Magic square for odd numbers challenge

ShwethaChallenge Create a magic square generator for odd numbers with python 3. The user should enter an odd number(n) and the program should output a magic square with dimensions n x n. You cannot use any imported modules. Test cases The user can input any character. Only the program should decline the...

> It should be very efficient
Definitely a homework question
Well, it can be done in O(n^2) (linear in the output size) because a simple cell-filling procedure will do it
@NewPosts so tempted to answer with what codex generated
6:42 AM
And I'm again tempted to argue "CGCC newbies are required to read all the FAQs and related meta posts, and lurk for a month before participating"
lurking is an underrated skill
7:13 AM
7:36 AM
Q: Surround a string with hashes

Jacob_I've already made this in Python, but it seems that it could be shortened a lot: txt = input("Type something.. ") c = "#" b = " " print(c * (len(txt) + 4)) print(c, b * len(txt), c) print(c, txt, c) print(c, b * len(txt), c) print(c * (len(txt) + 4)) So if the user types: Hello World The pr...

7:47 AM
@AviFS After much consideration, I've decided not to run in the SO mod election, as I think Ryan M would be a much better candidate than I would :P
Although at least I know I'd have support if/when I do run for mod here :P
Looks more like typed Factor to me
8:02 AM
f(x,y) = h(x)(y)
^ thats currying?
h is the curried function, f is uncurried one
how is it useful??
@lyxal does vyxal have dip?
@PyGamer0 from which perspective
@UnrelatedString stack based
...i may or may not have been thinking on and off about making a stack language that leverages currying extensively and failed to actually think of something
8:08 AM
What is quot in that contextt?
@emanresuA a function
if it's like a builtin that curries things that aren't by default curried then it could be helpful for partial application and the like
In that case, $†$
@PyGamer0 Then forget currying and just think of it as partial application
@emanresuA for dip?
8:10 AM
Ye - swap, call, swap
but what if the function called pops more than one value
But the point of dip is that the called function can take more than one argument
1 2 3 [ + ] dip -> 3 3
otherwise you could just flank with swaps
it's more like you move the top to a hidden stack, call it, and then move back
8:12 AM
£†¥ then, assuming no register use
Or →x†←x with variables
Or even →†← using the ghost variable
looks like dup;store;call;recall
Usefulness of partial application: { 1 2 } 3 [ [a,b] ] curry map -> { { 1 2 3 } { 2 3 } } (things wrapped in curly braces make a list)
@PyGamer0 you got it right
in factor: bi / tri just are like parallel applies?
yes, apply 2 or 3 functions to a single data
8:55 AM
i made a programming language Try it online!
9:09 AM
9:46 AM
@lyxal Yeah, as Bubbler said, I started with a few pre-existing lists and collections of utilities plus the documentation. I also went through phrase collection for J which I translated selected parts of to APL.
CMQ: The next APL Campfire has Jim Brown (main designer of today's APL) as guest! What would you like me to ask him?
1 hour later…
11:06 AM
CMQ: What more elements should I add to dinoux, I have ran out of ideas.
any ideas for exotic stuff?
11:24 AM
Quite some APL influence there :-)
yes :)
@PyGamer0 Current date?
11:43 AM
@PyGamer0 do you really need a one-byter for swapping stdin and stdout?
Is swapping stdin and stdout even that useful for code golf?
@pxeger no yes
@PyGamer0 spoiler alert: the answer is definitely no
@pxeger correction: *stderr and stdout
12:04 PM
CMQ: Should keep and dip call subroutines or operators?
and i am considering graphics
12:37 PM
@AviFS I'm hoping (and I expect that) there won't be another election here for a few more years
@RedwolfPrograms I'm sort of expecting one at some point in 2022, simply because we've had elections in 2016, 2018 and 2020
I doubt we'll need one that soon though
I'm hoping for 2024 personally
You'll be 18 then? :P
Yep :p
But with HN, WW, and JoKing, all of whom seem to be pretty active and good at moderatorating, I'd be pretty surprised if we were a year away from another election
Having more moderators at this point seems like it'd just get in the way more than anything :p
And the mods are scattered about as wide as possible around the world, so we don't need to worry about all of them being taken out by a nuclear missile sent by Code Review :p
I think that if we did have an election, it'd be caused by at least one of two things: one of the mods stepping down (for whatever reason), or a large increase in traffic to require an additional hand
12:49 PM
Hmm. It would be nice if we woke up one morning and a few tens of thousands of new users were here :p
@RedwolfPrograms 300 people in TNB
But I think we're quite far from the limit our mods can handle
Anyway, gtg for now o/
1:41 PM
Ugh AWS is sponsoring another SE site
Have I mentioned how much I hate AWS
whats it stand for
Amazon Web Services
ahh X_X
They sponsor a lot of stuff, and they do it in a way that worries me a bit. E.g., sponsoring comp sci classes in high schools.
In other words, paying to advertise their products in public schools.
And, being someone who went to one of those high schools, you probably wouldn't know there was any money being exchanged. You're just given lots of assignments that conveniently involve using AWS products.
2:02 PM
I wonder if you could cut the ground pin off a nema 5-20p plug and fit it into a 6-20r receptacle and make lots of fire happen
This image makes me so mad
oh my god
That plug will not fit into the receptacle pictured in the bottom left
Because the receptacle on the bottom left is actually a 240v nema 6-20
its a glass receptacle, were just on the other side
@RedwolfPrograms you dont even need to go that far, simple spatial reasoning can show it wont fit
And that picture's from home depot, not just some random amazon listing
maybe if you rotated it a bit... :P
2:29 PM
wew, it's been a while since I've been here
2:47 PM
@RedwolfPrograms I can only hope that the photo was for some reason mirrored before the socket diagram was overlaid
It's the socket diagram that's incorrect, oddly
I'm 90% sure that's a 240v one
the thing is i spend so little time doing janitorial mod tasks that even if our activity increased tenfold overnight i feel like the four of us would still suffice lol
@RedwolfPrograms This is the one thing I really like about working in enterprise .net, everyone uses Azure/TFS. It's far from perfect, but I much prefer it to AWS
3:18 PM
3:42 PM
I don't think you should restrict it to the first 20
Maybe the first 92
Since those are the naturally occuring ones
But 20 seems too low to be interesting, since your only option will probably be a hashmap
why limit it arbitrarily? can it not just be the known 118?
@RedwolfPrograms Will that be any different for a longer list?
I think it could be
@thejonymyster Then what happens when 119 is discovered? :p
118 would become arbitrary
@RedwolfPrograms we update the challenge and invalidate all answers prior
no uh lol
i mean "all of them up to posting date" isnt arbitrary imo
can it not just be the known and unknown 241?
3:51 PM
Do we know valencies for some of the recent ones?
They're not really around long enough to form compounds before radioactive decay changes them into something else, I would imagine
oh, fair
at least pick a round number smh my head
92 is a nice number for this I'd say...it's the number of naturally occuring elements
oh, so it isnt arbitrary
then yea, 92
why valency, out of curiousity
4:29 PM
GPT is just the ultimate sh*tposter
Wtf did it find some little kid's Mario fanfiction or something
bruh i don't even know
> Mario: lol ur not a turtle ur a wierdo!
> Bowser: omg! dies
> Wario: u r all gona die! stabs everyone with a knife
> Luigi: ur not a ninja ur just fat and ugly!
4:32 PM
@AaroneousMiller replying to save this really quickly
@AaroneousMiller Reminds me of Neftlix's AI-written christmas movie
But nothing will ever beat "assielassies" or "kingsizedkink"
Or perhaps "speeeometersspeee"
4:58 PM
there's no way that, in this 500 level cs class with like 70 people in it, i'm the only one who has heard of parametric polymorphism
@UnrelatedString I don't think I've ever heard that exact phrase, but knowing what the two words mean, are generics an example of parametric polymorphism?
like, in java? depends on if java generics can like
tell what the type variables instantiate to
not specific to Java, many languages have generics. Java, C++, C#, Rust.
For example in C#, a List<T> is a dynamically resizable collection of items of type T. A List<string> contains only strings, a List<MyObnoxiouslyNamedClass> contains only instances of MyObnoxiouslyNamedClass etc.
I'm just taking a guess based solely on the name "parametric polymorphism"
Ah okay Wikipedia says:
> Using parametric polymorphism, a function or a data type can be written generically so that it can handle values identically without depending on their type.
Which is exactly what generics are for. In the C# List<T> example, the List class doesn't need to know anything about the type, allowing it to be any possible type. The class is written generically so that it can handle values identically without depending on their type.
5:13 PM
I believe Java's equivalent is ArrayList<T>, but I don't use Java so I could be mistaken
i think idiomatically you'll mostly deal with the List<T> interface for which you'll just mostly use ArrayList<T>
Ah gotcha. C# is similar, but has multiple interfaces of varying specificity. IList<T>, ICollection<T>, and IEnumerable<T>
think java does too
I should really look into getting an education in CS some time...
5:36 PM
...there's a chinese guy in my class whose first name the indian professor pronounces like my full name
never actually noticed that before
his name is pronounced "unrelated string"?
5:54 PM
@UnrelatedString Bet that caused some confusion
2 hours later…
7:54 PM
CMC iterate over all arrays of length 5 with numbers from the range 0..5 but excluding all arrays which have the same number twice in a row. So 12234 is not allowed and nor is 01244
@UnrelatedString What does that mean?
@Anush Can we return a 5-by-3750 matrix?
@Adám ok...although that's not beautiful )
00:00 - 20:0020:00 - 00:00

« first day (3916 days earlier)      last day (47 days later) »