« first day (3273 days earlier)      last day (1570 days later) » 

12:43 AM
0
A: Sandbox for Proposed Challenges

NissaWhat order(s) can I fire my tonics in? code-golf game Helsing's Fire is a classic mobile game about light. You fire blasts of holy retribution (from chemicals called tonics), using cover to selectively hit enemies in the right sequence. For this challenge, we're going to ignore the line-of-s...

 
 
4 hours later…
5:06 AM
8
Q: How can I salvage jelly that does not set?

kevinThis is related but not a duplicate of this question. Apparently, I used fresh kiwi and mango in my jelly, and now it does not set. I know what I did wrong; but what can I do about it? E.g. Can I add gelatin powder to the mixture to improve the chances of it setting? I know that as a last reso...

The answer is clearly to ask Dennis for help
I mean, he made Jelly
:P
(╭☞´• ͜ʖ •`)╭☞ Humour!
 
 
2 hours later…
6:48 AM
@ChristianSievers The markdown syntax for a link is [display text](url)
 
7:35 AM
I wish Dennis was still around
 
 
4 hours later…
11:06 AM
@Pavel same
 
 
1 hour later…
12:22 PM
hi all
 
-1
Q: Average number of strings with Levenshtein distance up to 4

AnushThis is a version of this question which should not have such a straightforward solution and so should be more of an interesting coding challenge. It seems, for example, very likely there is no easy to find closed form solution, even though we have only increased the bound by one from the previou...

 
 
3 hours later…
3:35 PM
@Adám Thanks, don't know why I tried Wiki markup
@Anush oh, hadn't seen your math.SE questions before
 
4:01 PM
@ChristianSievers I even put a bounty on it!
 
4:29 PM
@ChristianSievers do you think you need more than 10 points to fit it?
as in (4+1)*2
 
4:43 PM
CMC: DJ's Made Up Binary is a base system that works like this: Start with the counter at 1. For each digit, if it's a 1, double the counter. If it's a 0, subtract 1 from the counter. Given an integer N (which may be negative), output the shortest representation of N in DJMUB
6 -> 1101
10 -> 110101
-10 -> 0011100 or 0001100
 
@Anush Where does (4+1)*2 come from? I think you need one point for each coefficient of each polynomial, of which I suggested three.
 
@ChristianSievers I was thinking a degree 4 poly + 2^{-n}* a degree 4 poly . That needs 10 points ?
oh you suggested three polynomials in the sum.
so we need 15 points?
we need more julia and nim coders here.... just saying
 
@Anush And in finding the formula, at first I tried values from n=1 (I knew 0 is a special case), but it didn't work because the formula is only correct for n>=2. Now I wouldn't trust values <distance.
 
@ChristianSievers do you have 15 points to try now?
 
4:59 PM
@Anush Maybe the one polynimial keeps being of lower degree, and I see a chance to get the coefficient of the most growing part by other means
 
this sounds pretty exciting. Surely at some point a general formula for all k might become apparent. Or is that too optimistic?
 
@Anush No, I'd try my method again, then I'll have arbitrary many... But that will have to wait
 
I look forward to whatever you discover!
 
@Anush Yes, I do think that it might be possible to derive enough formula to conjecture a general one
 
@ChristianSievers that would be pretty cool!
 
5:19 PM
0
Q: What is the correct complexity of All paths from Source to Target DFS solution

Henry WiseThe question: "Given a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N-1, and return them in any order." The DFS solution is described here. https://leetcode.com/articles/all-paths-from-source-to-target/ I feel like the author likely got the time complexity a...

 
5:37 PM
@DJMcMayhem Why is -10 not 000101?
@DJMcMayhem Besides for ^, Dyalog APL, 45 bytes: {0::⍺∇1+⍵⋄c⌷⍨⍺⍳⍨(⊣-∘~⍨⊢+×)/⌽1,c←⍉2⊥⍣¯1⍳2*⍵}∘0
 
6:12 PM
@Adám Oversight on my part
 
@Adám What's your algorithm?
 
@DJMcMayhem The correct answer for 1 is the empty list, right?
@Pavel [[],[[0],[1]],[[0,0],[0,1],[1,0],[1,1]],…]
 
so brute force?
 
yup.
 
I always forget that's a valid approach
I was trying to think up a clever formula
 
6:15 PM
@Pavel "Just Brute Force Everything!" :p
 
I'm sure there is a clever formula, but I couldn't immediately see it, so BF FTW.
 
Here's an observation for ya: x001y == x10y
 
@JohnDvorak If I understand your notation right, then that isn't correct.
0{0 0 1}0 1 is -10 but 0{1 0}0 1 is -4
 
correction: x01y == x100y
 
Or better, x100yx01y
 
6:19 PM
that, yeah
 
It is pretty obvious. 2x-2=2(x-1)
@JohnDvorak Also, x110000y → x011y
 
that's a corollary of the above
 
So I think in general you want at every step to use 0 to move closer to a power-of-2th of the target if possible, else just go with 1
 
@Adám (⊢-*⍨∘-)/
 
@dzaima Nice. 43 then.
 
6:27 PM
huh, {≢∪{(⊢-*⍨∘-)/⌽1,⍵}⍉(a⌿2)⊤⍳2*a←⍵}¨⍳20 is ~3x faster in dzaima/APL than Dyalog ((⊣-∘~⍨⊢+×)/ brings the two closer though)
 
Ruby, untested x->{(0...x.bit_length).map{|i|%w{1 01}[x[i]]}.join.chop}
 
@dzaima What are you computing there? Why the assignment to a?
 
@Adám amount of numbers representable in n bits of DJMUB; a is a remnant of what i previously used it as
 
@dzaima And also the inner dfn, I presume.
 
6:43 PM
@Adám aka (in positive numbers) there shouldn't be more than one 0 in a row
 
right
 
6:59 PM
Would it be possible please to have some more feedback on my Sandbox post codegolf.meta.stackexchange.com/a/18414/42248 prior to posting to live? In particular, should I make it code golf or fastest code? The challenge involves counting the number of different buildings that can be made from n identical cubes without overhangs, and I think represents a new integer sequence.
 
@NickKennedy If you go for fastest code, do you have a plan for actually timing solutions in all kinds of (platform-specific) languages?
 
@NickKennedy as a nitpick, those example images are huge. maybe put the comparisons side-by-side?
(<img src="..." height="250"> is a way to change the image size in SE, but just merging into one image is probably a better solution)
 
@dzaima I went ahead and edited it since there's a trick: you can append s, m, or l to an Imgur link to get small/medium/large versions of images.
 
@DJMcMayhem J, 29 Try it online!
 
7:15 PM
hm, how hard would it be to make a J→APL transpiler? would be a nice way to learn more about J too (as i can't read ^ at all :|)
 
@FrownyFrog Please explain!
@dzaima For most primitives, pretty easy. Some of them more difficult.
 
I uh, turn the negative input to binary, and then I remove a leading 1, and then I turn each 0 into 1, and 1 into 10, and add 00 if it was negative
and it's kinda long
 
Huh, how did you come up with that>
 
oh wait, it's the wrong answer for _10
 
@Adám the question's less about the primitives (just using words would suffice), more about the syntax and if there'd be any mismatches just not representable in apl
e.g. gerunds or whatever they're called
 
7:18 PM
@dzaima Yeah, gerunds are a problems, and also enclosed simple scalars.
 
@Adám ah, well there's my answer.
 
J → SAX should be fairly easy though.
@dzaima Naive transliteration: 0∘> 0 0∘⍮ 1 ⊂⍤⊤⍤+ (⊃↓⊢)⍤⊤⍤-⍤|
 
yeah, so it just works for n > 1
 
Wait, that doesn't make sense. Parity is off, no?
 
although at some point I got the right answer for 1
ignore 0∘> 0 0∘⍮
it's that power thing if you're confused about it
 
7:26 PM
Ah, right, & is sometimes.
 
I still get correct answer for 1, that's a small relief
 
@FrownyFrog are these not the pieces? 0&> 0 0&; 1 <@#:@+ ({.}.])@#:@-@|
 
yeah why
 
Wouldn't 0 0&; be used dyadically then?
 
0 0&; is one piece
that is the power thing
do 0 0&; 1 or 0 times
(3) 0 0&; 1 -> │0 0│0 0│0 0│1│
 
7:32 PM
Yes yes, but somehow I fail to find it in NuVoc
Blind me. It is right there!
 
it's here https://www.jsoftware.com/help/dictionary/d630n.htm
on the right side, it doesn't even have an English gloss
 
@FrownyFrog That's why I missed it.
Here too.
 
and at the bottom it literally gives a golfing tip
one shorter than f@]^:[
the idea is to get the difference from the next power, and interleave it with the next power (1 1 1 1 for 16) so that 1s are 0s and 0s are erased
14 is 16 - 2
2 is 1 0, flip it, we get 0 1
1
1
1 0
1 1 nub each row and we're done: 1, 1, 1 0, 1 = 14
I noticed that -14 is 0 0 1 0
so I can add 1 and I get 1 1 10 1 in binary
then it turned out that powers of 2 get output with a useless 1 0 at the start, so I removed leading 1
a brute force approach of a different kind
 
7:57 PM
@Adám I was planning to get the highest valid n possible with a 10 minute run time on Linux. This would restrict it to languages with a freely available implementation. The expectation would be that the answerer gives an indication of n on their own machine and then I would verify it. Does that seem reasonable? I’m also still happy to stick to Code Golf, and note that they tend to attract more answers.
 
@NickKennedy I guess that's reasonable.
 
8:14 PM
> The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. -- Ted Nelson
 
8:44 PM
I think it works as is, just remove the @|
 
@FrownyFrog huh, you beat DJ's original length 7 -10 :D
 
3 hours ago, by DJMcMayhem
@Adám Oversight on my part
 
oh. ¯\_(ツ)_/¯
@Adám seems like just following that gets you the best answer
 
9:00 PM
just noticed 0 is wrong
 
9:24 PM
Golfed 4 bytes and used them to patch the zero in Try it online!
I remembered that # with complex numbers intersperses zeroes
so no more boxes
 
I was just about to ask what j. was doing there
 
 
1 hour later…
10:52 PM
CMQ: We're merging our APL JSON server and RESTful server software. What should we call the joint server?
 
11:32 PM
apl gives an empty space for 2⊥⍣¯1 ⊢0?
That's very convenient
 
@FrownyFrog Empty list.
 

« first day (3273 days earlier)      last day (1570 days later) »