« first day (1886 days earlier)      last day (2961 days later) » 

12:00 AM
I kind of want to make a conlang, world, etc.
 
@LockOpeners yeah, the hat is nasal, dot is plosive, tilde is fricative, and stroke is devoice
 
ah
what about the p/g difference
 
That's place of articulation
 
it's a wonder that's not any major projects that the ppcg regulars work on together
 
12:00 AM
so labial vs velar
well
 
@mınxomaτ Is that an issue? I don't see why anything other than logins has to be done over https
 
would that be coronal up at the front
I forget all my features
 
you guys are such cunning linguists
 
p is labial/labiodental, q is dental/alveolar, dotless j is palatal, g is velar
 
/me is a linguistics student
ah
 
12:01 AM
I wanted to have b/d instead of p/q but the diacritics look horrible with those
 
lol
If I make a language
 
Okay, here is the new and improved riddle.
 
it's going to have a click
 
@LockOpeners /me is just a guy super inexperienced but super interested in linguistics :P
 
Because I enjoy the click sound that african languages have
 
12:02 AM
i(<some string>)<esc>0%
 
@LockOpeners I wanted to have clicks and ejectives! They sound so amazing. But I decided against it.
 
I'm not great at doing the different clicks though
 
What string prevents your cursor from moving? e.g, you stay on char 0?
 
so i'd probably have just a general click sound in free variation
or in complementary distribution
if some click is easier than another in a given environment
 
@MyHamDJ I have to run for a little while now. I'll think about it :)
 
I was thinking like Xhosa
I don't know of taa
 
starvin' Marvin
 
well not like Xhosa, that's just where I know the clicks from
yeah
@QPaysTaxes ++
 
Any other vimmers think they can figure it out?
A vim riddle.
If you press
i(<some string>)<esc>0%
what is the "some string" that prevents your cursor from moving?
 
I'm in lecture so I can't figure it out right now
 
12:07 AM
the only vim riddle I care about is how to get out of it :p
3
 
Why are you in TNB if you're in a lecture?
 
@aditsu ಠ_ಠ
Mar 22 at 2:23, by Downgoat
vim is the best
 
esc :wq
 
@aditsu <esc>:q!
 
@MyHamDJ yeah, I kinda learned that one, thanks :)
 
12:08 AM
or :x if you're lame
:xa!
maybe
 
No way, :x is the way to go.
 
I can hit wq in succession very purposefully
it's nice
:x is boring
 
Or, you could do :nnoremap ^s :w<cr>
 
with appx 1 billion vidoes on youtube, and 64^11 total possible youtube video IDs, google has had 0.675% chance of generating the same ID twice
 
and while you're at it :vnoremap ^c "*y and :inoremap ^v "*p
Dammit, that works also.
 
12:11 AM
lol
 
There's an obscure string where all the parenthisis are correctly paired, but % jumps wrong.
That's what I wanted the riddle to be about, but I can't figure out how to make the riddle work. lol
If you wanna figure it out, a hint is that it involves '
 
@NathanMerrill Assuming they select them randomly, I guess. I haven't ever bothered looking that hard; do they?
 
But those aren't matched. They're backwards.
 
@Geobits I'm assuming they are random. Sequential would be too difficult due to synchronization issues
 
Now that one is right.
 
12:16 AM
@NathanMerrill They could probably do some variation of hi/lo to alleviate that.
 
It wasn't the one I was thinking of, but it's interesting.
Here's another one: ( 'a(' + ')' )
 
lol
 
Actually no, I was on github. github.com/vim/vim/issues/711
 
Python golf tip question
if I'm making a recursive function on a list of lists of integers
what's the shortest way to detect the base case?
(to detect the input is not a list, but an integer)
 
@QPaysTaxes Ewww, Ruby! --a Pythonista.
 
12:19 AM
there is no a or b
only l
e.g. v=lambda l:
 
@orlp so you want if type(l) is not "list":
but shorter?
 
@MyHamDJ x if type(l) is list else y
but yeah, that shortened basically
and you can assume that l is either a list or an integer
hrm
 
if type(l)!=int is shorter. I'm still trying to think of an even shorter way.
 
I have an idea
x if l*0!=0else y
 
@orlp Yes, that should work quite well.
 
12:23 AM
yes, that'd be shorter
 
Even better: [x,y][l*0!=0]
It's not.
 
@MyHamDJ nope
 
It's pretty much the opposite of c in every single way.
 
remember the original question: it's for the base case of recursion
that'll just recurse endlessly
 
@QPaysTaxes Yes.
Well, "converted".
 
12:25 AM
Oh, in that regards, yes.
 
@orlp Python 2 or Python 3? Because in 2 you can abuse comparison
 
@Sp3000 I guess Python2 is shorter then
 
@orlp Fine, return [x,y][l*0!=0]
 
@MyHamDJ again doesn't work
x and y both get evaluated
 
but only one is returned.
What is the line right now?
 
12:26 AM
the point is that in the base case the recursive call (e.g. x) gets evaluated
 
Then [y,x][l*0!=0]
 
f=lambda l:f(l[0])if[]==l*0 else l
a recursive function repeatedly returning it's first element
 
No. ? is a syntax error.
 
oops, forgot the recursion
 
a if cond else b
 
12:29 AM
a if b else c is the same as b?a:c
 
@MyHamDJ No, you don't get it. [y,x] will be evaluated fully, and if one of these is the function it itself is in, then the recurrence will be endless. Try f=lambda n:[1,n*f(n-1)][n>0].
 
@El'endiaStarman Oh, yeah you're right. Durr.
 
hey there @ZachGates
 
Hmm I can't think of any type that fits between list and int, so at the very least you can do l*0>1 in Python 2
 
@Quill Hello
 
12:30 AM
hrm
if the integers are non-zero
l*-1 would be enough
@QPaysTaxes nope
@QPaysTaxes because it's not relevant
when you write [f(l[0]),l], that is first evaluated
 
In most cases def is more expensive, just side note
Since usually you need return
 
0
Q: All possible ways to interleave two strings

My Ham DJI recently saw this question on stackoverflow. It's a great question, but there's one fatal problem with the question. They are asking for the best way to do it. E.g, easiest to read, most idiomatic, neatest etc. Don't they know that isn't what matters? You're supposed to ask about how to do it w...

 
@Sp3000 in Python2 is < always True for int < list?
 
If they were both function calls, you could do [x,y][l*0!=0]()
Which is horrifyingly ugly.
 
@QPaysTaxes fails for l == 0
(0*0 == 0 and 0) or 0[0]
(False) or 0[0]
0[0]
oops
 
12:36 AM
@orlp Yeah, and tuple > list as well
I think for custom types there's a point where it's just alphabetical order, if I remember right
 
@NewMainPosts I was shocked when I saw that in the HNQ and the little SO logo next to it. I thought surely it would be a PPCG question. Thanks for fixing that @MyHamDJ , now let's see if we end up with two identically-titled HNQs.
 
@QPaysTaxes I'm a terrible golfer
I wasn't invalidating your claim, but just saying you're not alone
anyways, look at my answer history
I've literally got 2 golfing answers
and neither of them are very good
 
I kinda want to answer some questions in Factor but it's fairly verbose
and you have to import everything
even the core language stuff
 
@LockOpeners its fine
 
12:43 AM
like everything needs "USE: kernel" at the very least
:p
 
@LockOpeners "fairly verbose" doesn't stop people from using Java and C#... :P
 
@LockOpeners is the kernel std input/output
if so, you don't necessarily need that
not by variable, but by function parameter
 
kernel is most of the basic things
stack ops
 
@QPaysTaxes s/create a function/use JavaScript/ >:D
 
etc.
 
12:44 AM
ಠ_ಠ
 
@QPaysTaxes Well that's a function with locals, which requires "USE: locals" :p
I'll probably do some anyway
it just won't compete with most of the short langs
I'll compete with myself :)
 
that's the policy
we've actually got a recent interesting meta post that places languages into a "class": meta.codegolf.stackexchange.com/questions/8798/…
so, depending on the verbosity of the language, you can find closer competition
that said, it looks like Factor is in the top group
so...apparently there are some amazing factor answers out there
 
Perl 6 isn't in the first pass grouping :(
 
I excluded version numbers
 
@NathanMerrill It's been mentioned, but it's more a bias of what types of questions the answers are posted for
 
12:48 AM
People make their headers in too many different formats to reliably parse a version number separately from the byte count
 
@Sp3000 I'm pretty sure I was the one that mentioned that
 
They are seperate languages though, just fyi
but fair enough
 
I know
 
why is brainfuck grouped with Jelly...
 
As are Python 2 and 3 to some extent
 
12:48 AM
Python 3 is more of an incremental thing though
 
@Downgoat Most of the time when BF is used it's used because it's surprisingly competitive
 
P6 was an entire redo
 
Yeah. Apparently a lot of people don't like it.
 
I like it
:D
 
@LockOpeners If so, it was a huge increment.
 
12:49 AM
oh
you mean python
 
also, are there any consensus as to which JS engine should be considered the "default" for JS?
 
@Downgoat Well, Node uses Chrome's, so there's that.
 
most JS answers don't work in chrome...
 
nice
 
really?
 
12:50 AM
Yeah Factor is fun but it isn't super golfable
 
yeah, it doesn't have full ES2015 supoprt
 
now THIS is interesting
def random_tree():
    if random.random() < 0.5:
        return random.randint(0, 100)

    return [random_tree() for _ in range(random.randint(1, 5))]
does this sometimes never terminate?
when, why?
how does that change if we change the probabilities?
 
seems like it would eventually terminate
might take a while depending on the RNG gods
 
I think that if you change 0.5 to 0.2, then it'll probably terminate in general.
 
@El'endiaStarman that's worse
 
12:52 AM
You can work this out using probability theory.
 
you mean 0.5 to 0.8
 
yeah that'd be worse
 
Oh, yes, you're right.
 
Seems like it'd either terminate normally or terminate from recursion depth anyhow
 
Well, if recursion depth is infinite and/or you don't want stack overflows...
 
12:53 AM
@Downgoat V8 with Babel
 
P = 0.5 + avg(P**n for n in range(1, 6))
no?
@Sp3000 assuming infinite recursion depth
 
When in doubt, Monte Carlo it. :P
 
V8 doesn't have full coverage, so you should babelify your code
 
@Quill V8 doesn't have console.log, alert, prompt, etc.
 
I don't think any JS engine has full coverage.
 
12:55 AM
Chrome's engine is V8 and so does node and it has console.log
@El'endiaStarman yeah, none of them have full coverage. babel is close though
 
Which means, weirdly, that the developers of JS are not actually developers, but more like designers.
 
I think it should be SpiderMonkey on Firefox, that's the original JS engine
 
[[[[[19], [[[[[46, [68]], [[74, 34], [[[[[[[41, 14]]]], [9, 61]]], [55, [[[[[68, [[[[17, [80, [[[[[[[[[[[[[[[74, [30]]]], [99, 30]]]], [[31]]]]], [[[35, 72], [[46]]], [72]]], [[35, [33, [[[[[[21], 72]], [10, [70]]], [[18, [[[[[[47], 46]]], [72]]]]]]]]]]]]], [17]], [78]]]]], [[17], [[[50], 29]]]]]]]], [[10, [[[5]]]], [[67], [[[[[[[30, 49]]], 41]], 72]]]]]]]]]], [[[[[[68], 73], 61], [78]], [94, [[[72], 62]]]]]], 11], [[[[[14], [[[8]]]], [[88]]]]]]]]]]
THESE TREES ARE GLORIOUS
 
alert and prompt don't work in terminal, and prompt is available as an npm package
 
VISUALIZE THEM
 
12:56 AM
@El'endiaStarman this already took a while
although I did that manually
I could write a script to visualize them
('manually' - wrote a .dot of course)
 
I've got an interesting problem, if anyone has any thoughts pls let me know!: I am writing a side view jumping game (sort of like Super Smash), I have some equations for gravity and a background timer updating the game every 10 miliseconds. The problem is, when the sprite is accelerating fast enough, it passes the floor hitboxes since in the 10 milisecond time between updates it has gone farther then the width of the floor.
 
@Quill also babel doesn't support array comprehensions.
 
With 0.5 and up to 5 children, I'd imagine it wouldn't terminate in general then? From memory it was something like up to 2 children and probability > 0.5 terminates with probability 1, although I might be remembering my random processes incorrectly
 
And if you're going to say babel, then with what plugins?
 
@AshwinGupta you just discovered quantum tunneling :)
 
12:57 AM
@orlp excuse me? LOL.
 
@Quill define full coverage? that every function is defined, or that they work without bugs?
 
@AshwinGupta the phenomenon you describe happens in real life too :)
 
@NathanMerrill both, they work as expected/laid out in the specification
 
@AshwinGupta lower your timestep, or go fancy with line based intersection
 
@Quill then do we have a full coverage c++ compiler?
 
12:57 AM
@Sp3000 it still has a termination probability?
 
@orlp interesting. I am reading the wikipedia page now. You learn something new everyday.
 
@Downgoat Besen implements ES5 completely. It always performs how the standard says it has to.
 
@NathanMerrill there's a difference, and it's a pointless comparison
 
@mınxomaτ ES5 is ancient though, almost all JS answers are ES6
 
Well ancient is objectively wrong.
 
12:58 AM
hence my question, are we counting bugs?
 
Modern browsers support pretty much all ES5> code
 
@orlp damn. I'm guessing the math here is going to go a little beyond my level. Only in middle school so I haven't taken anything past Geo.
 
because I doubt we'll ever have a bug-free JS interpreter
 
@AshwinGupta This is a very common problem. You're gonna have to do more-sophisticated intersection checks.
 
@El'endiaStarman Yeah looks like it. I'm trying to think of something now.
 
12:59 AM
@AshwinGupta render the graphics ten seconds behind the physics and logic checks
 

« first day (1886 days earlier)      last day (2961 days later) »