« first day (2767 days earlier)      last day (2371 days later) » 

09:40
Interestingly I've now got two separate approaches for codegolf.stackexchange.com/questions/171147 - the brute-force approach is shorter at generating the maximum value but the fast algorithm lets me combine my answers and the result turns out to have the same byte count.
 
4 hours later…
13:35
0
Q: Single Perceptron Implementation

DimChtzChallenge Train a single perceptron with 2 inputs and 1 output. Step 1: Initialize the weights Step 2: Calculate the output For inputs: [i1, i2, ..., in] and weights: [w1, w2, ..., wn] the output is: i1 * w1 + i2 * w2 + ... + in * wn Step 3: Apply activation function on the output (i.e ...

 
2 hours later…
15:14
> Phobophobia: When the only thing you fear is fear itself.
@AdmBorkBork First, I thought you were joking, but then I found the Wikipedia entry.
> Pseudo-hypochondrias: When you only think you're suffering from hypochondria.
15:49
Dumbass question: how do I get a file out of a docker
docker cp
I always forget that exists
And write awful Volume hacks
Thanks. I'm glad Volume hacks will not be happening to me.
16:22
0
Q: Textbattles KoTH

FireCubezTextbattles Textbattles is is strategy game (that I made up of course) about well, text. It consists of a 10x10 grid, and each player has a position on the grid. Each player can decide whether to move a step in any direction, or just stay where they are. If a player moves into another player'...

Ugh, the underlining of links is really messed up for code:
0
A: List of bounties with no deadline

DLosc50 to 200 rep for significantly outgolfing me in BitCycle I am offering the following bounties for outgolfing any of my answers in BitCycle: Outgolfed by 10% or more: 50 rep Outgolfed by 20% or more: 100 rep Outgolfed by 40% or more: 200 rep Only one person can win the bounty for a given cha...

17:00
CMC: Given a list of points in the form (x, y) where x and y are (possibly negative) integers, output the smallest possible disk in the form (x, y, r) where x, y, and r are integers such that the disk contains all given points.
@Pavel Ouch, that sounds difficult. Nice challenge. Main it?
If there are multiple possible smallest disks, you may output either one of them or all of them.
@Adám If I still remember about it by the time I'm off work and have time to write it up and properly specify it.
And come up with test cases
@Pavel Yeah, you have to find some where choosing a slightly sub-optimal (across an int boundary) leads to a smaller r.
@Adám You mean like (1, 0), (0, 1) where you can't just put the disk in the center between them?
@Pavel Yeah. But having more than two points makes it even more interesting.
@Pavel (1 4) (3 2) (4 1) (4 5) (5 2) (7 4)
17:09
Hold on let me plot that quickly :P
+++O+
+++++
+O+++
O+++O
+O+++
+++++
+++O+
@Pavel ^ If you find centre of the bounding box, you fail.
+++O+  +++O+
+++++  +++++
+O+++  +O+++
O+C+O  O++RO
+O+++  +O+++
+++++  +++++
+++O+  +++O+
@Pavel ^ Centre, Right answer
17:28
@Adám That plot and this list of points are different aren't they
I've been trying to get them to line up
@Pavel They are y,x from left side. (But it doesn't matter, as any other interpretation is just mirroring and/or transposing)
+++O+++
O++++++
++O+O++
++++++O
+++O+++
(x,y)
No matter how I looks at that it looks like the solution is in the middle
._. how'd I mess up like that
Which would put the right answer at 4,4
Right?
@Pavel Yes.
17:34
Hooray, I can at least read plots
@Pavel I can't think of a good way to solve this challenge other than by brute force (which is not "good").
I sometimes think that, and then PPCG wizards prove me wrong, so I'm not too concerned
@DJMcMayhem @Mego Please add featured tag to sandbox
Anonymous
Done
I think that's something you can flag for
Yeah but who checks flags
Anonymous
17:45
Me
Imagines blue penguin flying in circles around a flag
@Mego Ok but how often
Anonymous
@Pavel I check flags at least daily
@Adám penguins can't fly though, don't make fun of his disability! D:
17:52
@J.Sallé Heresy! Of course they can, they just don't when people look. It's called modesty.
@Mego Right, and respond to pings in seconds, clearly making it the more efficient communication channel then once every 24 hours
@Adám oh god my life is a lie
Isn't there like one species of penguin that actually does fly
Anonymous
@Pavel You just happened to catch me during my lunch break. Had I not been available, I wouldn't have seen it until I checked after work this evening.
Anonymous
@Adám You're not supposed to tell everyone the secrets of my kind!
17:54
Or am I just thinking of puffins
@Mego I'm sorry, the secret is out:
Did the new sandbox questions bot get removed?
Anonymous
@fəˈnɛtɪk No, it's just broken. SE is aware of the issues with answer feeds.
0
A: Sandbox for Proposed Challenges

PavelFind the smallest disk containg given points Hello, golfers! This challenge is, as the title says, about finding the smallest disk that contains some given points. This is made somewhat tricker, however, by the fact that in this challenge, the disk's coordinates and radius must both be integers....

@Adám ^
18:26
@Adám uh, I'm afraid that Mego isn't of exactly that species; his forehead is white
 
1 hour later…
19:44
CMC Given a positive integer, output a truthy value if it can be written as the sum of 20 or more sequential positive integers, or a falsey value otherwise. Example: 11630 is 572 + 573 + … + 590 + 591, and so is truthy.
@AdmBorkBork May we assume input≥210
@Adám what an unreasonable assumption...
@EriktheOutgolfer Why?
@Adám well, 59 looks like a perfectly valid input to me, the result would be falsy
210 is specifically the first truthy number, although I don't think that makes it that more reasonable
@Adám No, any positive input is allowed. Numbers up to 210 will happen to all be falsey.
20:02
@AdmBorkBork APL (Dyalog Unicode), 15 bytes ⊢∊∘∊⊂∘⍳+/⍨¨20↓⍳ (fails on large inputs due to restricted memory on TIO)
What a golf! lol
@AdmBorkBork You mean by switching encoding? Yeah, that tends to help.
@AdmBorkBork Jelly, 13 bytes: ŒṗI=1Ạ$ƇḢL>18 (note: TIO will never return a truthy result)
@AdmBorkBork Btw, 11630 requires about half a gigabyte of memory, and on my machine, it takes about a quarter of a second.
@EriktheOutgolfer A tad inefficient?
@Adám it works in theory, so...
20:08
code-golf at its finest -- "This takes more memory than even God has, but it'll (eventually) return the result."
I think PPCG is the only place that allows something like this
Yep, PPCG (or code-golf in general) is beautiful in that respect.
I think very other server uses automated testing, which, of course, doesn't know theory
btw, Jelly has an integer partition builtin (Œṗ), but is just 2 measly bytes shorter than Adám's Dyalog
(I don't want to imagine ngn's Dyalog)
@EriktheOutgolfer That'd be ... fun to see.
well, it would most probably contain a backslash
20:15
@EriktheOutgolfer Hm…
@Adám Fails for 190
@H.PWiz Hm, that's odd.
@Adám ಠ_ಠ
Just change 20 for 21
20:17
@H.PWiz Oh, d'oh, I changed ⎕IO.
No, I don't think I'm right
@EriktheOutgolfer @Zacharý it'd probably have a few cumulative reduces.
A few isn't enough.
@H.PWiz Why? I never need the entire range.
@Adám I think you want ⎕io←1 and 19
20:21
@H.PWiz For ⊂∘⍳ it doesn't matter because the number will never be in its own sum. But we do need windows of size 20 and up, so either 20↓⍳ with ⎕IO←0 or 19↓⍳ with ⎕IO←1, no?
@Adám Well you don't want ⊂∘⍳ to include 0
@H.PWiz Oh, I must be getting too tired. Of course not. 19↓ with ⎕IO←1 it is. Formula still holds.
@Adám public shaming of Jelly still holds
hm, let's analyze that further...
@AdmBorkBork Oh well, correction: ⊢∊∘∊⊂∘⍳+/⍨¨19↓⍳
Still 15, so not too bad of an issue.
20:26
Just so we're all on the same page here, we all realize that penguin video was a prank yeah?
@AdmBorkBork Yeah, it was just a couple of off-by-one errors.
@Poke ¯\<(")_/¯
Something wrong with your shoulder, there ...
I think that's a beak
Oh, I see
yeah, the edit seems to have proven as such
20:28
I thought he was maybe still on APL keyboard and it just done goofed.
it's pretty easy to typo APL + 3 with APL + 4
one key apart
It wasn't a typo. I figured that < over _ would look like ≤
It does, I just didn't see it as a beak.
well, it's too hard to typo _ (APL + F) with ≤ (APL + 4), but you might not know much about the APL keyboard
20:33
@EriktheOutgolfer ⪪(ಠ) In any case it shouldn't be _
What is that first character?
conclusion: a penguin can influence messages even with a shrug
Random CMP: How do you prounounce Data?
@Mr.Xcoder What's the context?
@Mr.Xcoder dera?
20:37
@Mr.Xcoder Day-tah
@Zacharý 'SMALLER THAN' (U+2AAA)
@Zacharý Any context. Pick Data analysis and Personal Data, for example
Never mind, the xkcd I was thinking of refers to the plurality.
I switch between both /deɪtə/ or /dætə/
@Mr.Xcoder Dah-tah analysis, Personal day-tah.
Hmmm, I say Day-tah analysis and personala dah-tah
CMP: how do you pronounce either?
20:43
@Adám ee-there
E-ther X or Y (as opposed to Aither)
To change topic: What's the relationship between ≤ and ⪯ and ⪬, i.e. {less than|precedes|smaller than} or equal to?
@AdmBorkBork 05AB1E, 11 bytes: LŒ20ùʒOQ}gĀ
05AB1E, 8 bytes: LŒ20ùOså
That could be ported to Jelly, would save a few bytes.
4
Better yet, 7 bytes: Åœ20ùgĀ. Painfully slow though.
That runs in about 3 minutes locally for 210.
@Mr.Xcoder fails for 231. There can be more than 20 numbers in the sum
20:58
I completely misunderstood the challenge... Oh well, there goes my <10 byter
It can be fixed for I think... 11 or 12 bytes (my 8-byter), the 7 one is completely off.
@H.PWiz Yup, fixed for 11. Thanks for the heads-up.
this is in hnq so you've all probably seen it already but it's a good read: gaming.stackexchange.com/questions/337897/…
Physica, 44 bytes: ->n:n∈Sum[(->k:Len@k>19)$$Sublists[1…n]]
21:24
If I do for x in $(...); do; ...; done does it iterate line-by-line or word-by-word?
@Poke I have no interest in Pokemon but still found that interesting - thank you
21:58
@Zacharý it's a charcoal character :P
Yeah, I need to instal some fonts.
@Adám Custom defined operators :P
@Zacharý OK, but Unicode seem to assign them some specific meanings rather than naming them by shape.
"specific"
@Adám link, can't find anything for the latter
@ASCII-only Yeah, I kind of knew about ordered sets. It is mostly ≤ vs ⪬ I'm wondering about.
22:17
-2≤-1
-1⪬-2
Something like that?
(purely guessing)
@trichoplax You mean smaller in magnitude?
Yes
Can't find anything to back that up but that's what "smaller" intuitively means to me
x⪬y would be equivalent to |x|≤|y|
@trichoplax You ninja'd me
@AdmBorkBork Jelly, 9 bytes: ẆfŒṗZL>19
Always returns 0 in practice.
CMC: |a|≤|b|?
22:23
Aren't you going to golf your challenge down using your new found symbol? :P
@trichoplax Uh, no, how would that work?
CMC: ⪬
@trichoplax Oh. But that'd have to be ⪬ according to trichoplax
I don't mean golf an answer - I mean express the challenge in fewer...
(That's assuming my guess at the meaning is right - I have no idea...)
@AdmBorkBork Jelly, 10 bytes: ẆS=¥Ƈzṫ20L
This one actually works.
22:29
@trichoplax So if a⪬b is |a|≤|b| then a⪪b would be |a|<|b| of course, but how would one express |a|=|b| or |a|≠|b|?
I never realised there was a need for ⪬ or ⪪ until now so I may be the wrong person to ask. The first time I ever saw ⪪ was when you were playing the old ASCII version of Angry Birds earlier today
Unfortunately equals with a strike through is just going to look like equivalent to
I couldn't spot what I was looking for, but this w3schools page is surprisingly detailed: w3schools.com/charsets/ref_utf_math.asp
@trichoplax Same problem arises with ⪯, but maybe in a well-ordered set, two values different values cannot be at the same position without being equivalent, so ≡ or = will do.
@AdmBorkBork Jelly, 8 bytes: ṡⱮṫ20§Fċ
Final answer.
@Adám Sounds reasonable
@trichoplax Well, thanks to the page you linked, I found ≍ ("equivalent to") which I guess works as being to = what ⪯ is to ≤.
22:39
From that page of symbols: I'd never realised there were symbols for "APPROXIMATELY BUT NOT ACTUALLY EQUAL TO" and "NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO"
@Adám Oh yeah - seems to match stylistically
@trichoplax Except the underbar isn't curved in ⪯.
So in everyday terms, ≇ means "not even close"
@Adám Good point.
@trichoplax Although one can use the (I think) stylistic variant glyph ≼ instead of ⪯ just like ⩽ is a permitted alternate glyph to ≤.
I wonder if the makers of JS had a hand in this one: ≣
@trichoplax Gosh, you just ninja'd me: ≣ means very much super equal to?
22:44
"Strictly equivalent to" but I can't help reading it as "really strictly equal to"
@trichoplax No no, Unicode JS needs ⩶
That's a thing?!?
@trichoplax Apparently, just like ⩵ (don't use that in JS!)
The JS golf variants could do with these...
Hm, wonder what the difference is between ≷ and and ≷ ≠ and between ≸ and ≹ and =
22:46
All these alternative symbols remind me of BASIC versions that used <> to mean not equal to
@trichoplax Yeah, doesn't that make more sense (when you have >= and <=) than != or whatever it is other languages use?
@Adám Haha the descriptions are super unhelpful
@Adám It makes sense to me but I'm biased because it was the first way I learned
@Adám ~= and /= :P
Ew those have other meanings in other languages
@ASCII-only Ugh, I'll just stay with APL's ≠
J uses ~: for ≠ (and <:/>: for ≤ and ≥)
22:50
I'm more comfortable with !(x=y) than x!=y (no good for golf though...)
Haha, a⋚b a.k.a. ∃a,b
Really?
@trichoplax No idea. Maybe it means that a and b are comparable. E.g. a vector cannot be compared to a matrix.
Maybe some of these are just for stating the obvious at the beginning of a proof
I feel "division times" ⋇ belongs in a box with interrobang
@trichoplax I wouldn't say that. There are a ton of "overstrikes", but ‽ is really a combo.
22:57
12
Q: What is the symbol ''$\divideontimes$'' (DIVIDE TIMES) for?

Mark CidadeI looked "$\divideontimes$" up on Google and now I know that it's Unicode U+22c7 but when would it be used? I am guessing that $5 \divideontimes 5 = 25$ and $1$...?

@trichoplax The golden ratio is 1⋇(((√5)-1)÷2)
2
Perfect
That question has the answers sorted by votes, with the accepted answer appearing second because of having less votes
@trichoplax If APL gets (probably in Dyalog v18) such that f⍥g(a,b) is f(g(a),g(b)) (or to use APL notation: a(f⍥g)b is (g a)f(g b)), then your understanding of ⪬ will be writeable as ≤⍥|, which generalises to <⍥| and =⍥| etc.
Hypothetical golfing in advance
@trichoplax Not very hypothetical. J already has but using the & symbol.
23:10
J's version looks less surprised
@trichoplax Yeah, but means to invoke the connection to simple function composition f∘g. Another function composition is f⍤g and so f⍥g fits well in.
Neat. I don't know either of these languages so it's all unreadable to me at the moment, but I can imagine little details like that can make it more readable to established users
@trichoplax Wait, now we need a symbol to mean power/root, i.e. (if ^ is power), so x□y is x^(1⋇y)
@trichoplax Well, about time you learn APL then :-D
@Adám I'm sure the Unicode Consortium will be delighted to hear this...
@Adám I am currently trying to decide which language to host my next KotH in...
@Adám then maybe tetration/(?? quartration??) ?
@trichoplax I've never understood how KotHs work.
@trichoplax Well, for each operation which has an inverse, there exists such a pair.
23:19
@Adám The motivation or the practicalities?
@trichoplax Practicalities.
The only one I've hosted had each player submit a JS function, which is called each time the player is to make a move. Others get more involved, allowing any language to compete, but I'm not intending to try that
@trichoplax In Dyalog APL, we can we can write the inverse of a function f as f⍣¯1 and a pair of results from the functions f and g as f,g, so in general, a function and its inverse is f,f⍣¯1. E.g. ± is +,- and ∓ is -,+ and ⋇ is ×,÷ or ÷,× (⋇ is ambiguous as to the order of its × and ÷ constituents).
@trichoplax If you want to stick to a single language, you probably do well in choosing a well-known one, but I still think you should learn APL. It is fun, and mind-opening — and the only production language which extensively uses mnemonic Unicode glyphs.
You got me with 2 out of 3 there. The use of glyphs isn't drawing me in as much, although it does seem elegant
Yes I was leaning towards a well known language, but also half considering a more obscure one so learning a new language would be part of the competition
(Lots of answers to JS KotHs are that person's first experience of JS)
@trichoplax If you like mathematics, you'll like APL. APL was originally conceived as a "maths done right" replacement notation. It just happens to be (well, obviously is) consistent so it can be machine execuable.
23:27
I'm also biased by having to write the controller, which will be a lot quicker in a language I already know...
@trichoplax I would be delighted to assist if you were to choose APL. We have long been considering hosting competitions where people submit competing programs. Of course, you'd have to learn some APL then…
Do you happen to know if it is used for long running applications? For example, I've left my JS KotH running for months 24 hours a day to get a trustworthy leaderboard
@trichoplax You mean if APL can for a long periods? Sure, APL drives systems that have been running for decades.
The sensible part of my brain says stick with a language you know and keep things simple. The other part of my brain (the part which makes all my decisions) says try something no one expects to work and see what happens
@Adám Excellent
I have a few KotH ideas lined up in the sandbox and I like the idea of posting each one in a different language
I have one which I specifically designed with a terse language in mind, in which entrants would be limited to a fixed number of characters in their code. I was considering Japt, but I'll add APL to the possibilities too
@trichoplax You can even use APL as "full stack" language. E.g. our conference registration system is full stack APL. So too with TryAPL.
23:34
Full stack meaning the front end scripting is also APL? That's what drew me to JS for my first one, so if that means what I think it does I could host the whole thing on a static webpage drawing in answer code from the SE API
@trichoplax Yes. Obviously, we can't run APL in the user's browser, so instead, APL generates "dumb" JS which just redirects all call-backs to the server for processing in APL. The appropriate response is then rendered in "dumb" JS and sent back to the client.
Ah. So if I used that approach in my own page it would put load on your servers?
@trichoplax No, you would just run APL on your own server.
That was going to be my next question :)
In that case each contestant would need to install APL in order to test their own submission before entering, so the benefit of running it in the browser is diminished. Might be easier to just write a stand alone APL application and let people download that to run the game locally
I'm guessing APL runs much faster locally than converting back and forth from JS?
@trichoplax Depending on how complex it would need to be, people could use TIO to test.
@trichoplax APL would be running on the server anyway. The converting back and forth is just serialising needed page data, and rendering changes as JS. Not noticeable unless you change a massive number of DOM elements.
23:43
I'd expect TIO to time out. Even for a 2 player game, the 2 competing functions could be called many thousands of times back and for until there is a winner
@trichoplax I see. One could allow access to a test arena for people to try their code. Btw, how do you deal with malicious code?
For the JS KotH, it's a static webpage hosted on GitHub so there's no backend to attack. I don't have security expertise so I can't say for certain it's safe though
There's a risk that someone could submit malicious code as an answer, and then people running the static webpage could be vulnerable. I need to think about this more for any future KotHs, and ideally try to improve the security of the first one too
@trichoplax I guess only JS (and languages written in JS) can be used for that. For TryAPL, we run user code through a very strict white-list.
Yes I'd be very wary of hosting something where user code was submitted to a server
Is that white list publicly available?
@trichoplax It is described on the About tab.
23:55
Handy - thanks. If I do decide to host an APL KotH I can use the same approach to hopefully minimise the impact of any malicious answers.
@trichoplax For an example of how little JS is needed to run a browser game in APL, see my 2048 clone. You can view the entire APL code by clicking View: APL code. The only JS there is return!$("#a"+(event.which-37)).click().length[0] on line 37 to capture keypresses and window.location.reload() on line 94 (and I could easily have done the latter in APL too).

« first day (2767 days earlier)      last day (2371 days later) »