« first day (2285 days earlier)      last day (2541 days later) » 

2:00 PM
I started looking at the cmc and got as far as Ḃ >.<
got a bit lost on the ternary part
that makes sense, though
i think
a bit lost
hahahahaha
 
user165474
hahaha
 
2:12 PM
@HyperNeutrino You are neutrino, that too hyper. I am simply an ex-free-elf. How can an elf ever be in competition with a neutrino ?!
 
user165474
@Arjun Answer: You can't. You can't touch me, I move at nearly the speed of light and I can pass through almost all matter.
 
@HyperNeutrino you can't touch this slides away through matter really fast
 
I want to check because it has 5 upvotes and maybe I'm just crazy, but I think this answer is invalid. If the input is a reserved word of Python you can't name a variable that and it won't work
 
user165474
@BusinessCat You're right. I tested it with "for" and it broke.
 
user165474
unupvoted but I won't downvote.
 
2:22 PM
@HyperNeutrino I wonder, how can you touch your keyboard then?
(And I think neutrinos haven't been proved to be as fast as light)
 
user165474
@Arjun I said almost as fast. And I interact with my keyboard by transferring energy to it. Wonder why you feel so sleepy? That's right, I'm drawing energy out of you to transfer into my keyboard so it knows what I'm typing. :D
 
Is it possible to get a github commits feed in a SE chat room? I can't seem to make it work
 
Anonymous
@Fatalize I tried and never had any success
 
Hmm
What's the best way to "bump" an old meta post?
Bounty?
 
user165474
You could give it a trivial edit...
 
2:30 PM
CMC: print 12345678987654321
 
Well nevermind
 
user165474
I remember this from Jelly training :D
 
Looks like Feeds is drunk!
"posted on January 01, 0001 by JCumin" hmm yeah sure
 
lol
 
@Fatalize I gave up long ago on using a feed to post commits into the Japt room, for this very reason...
 
2:32 PM
So it does actually (hah) work
but only kind of
 
If you push more commits it will never post them
 
user165474
@LeakyNun Python, 15 bytes: (10**9-1)**2/81
 
I'll see how it evolves and if it indeed does not post them, I'll start bump/start a meta discussion on that
 
@HyperNeutrino it isn't a program or a function
 
@HyperNeutrino Lol, but that's just (s+hit)
 
Anonymous
2:34 PM
IIRC from my experience trying to set up the feed for commits in the Seriously room, it posts the first 5 or so commits when you add the feed, and then never posts more.
 
user165474
@LeakyNun Python, 20 bytes: print(10**9-1)**2/81
 
@Mego Well seems like it's doing exactly that so far…
 
user165474
@Arjun Please avoid repeatedly editing messages with pings. Also implying swear words is no better than just using them.
 
@LeakyNun APL, 12 bytes: 81÷⍨2*⍨1E9-1
 
@Adám 2*⍨9÷⍨1E9-1
 
2:37 PM
@LeakyNun just back now - just so you know, if replacing with nothing powershell lets you emit the ,'' - so actually -5 from Martin's solution, -12 total, thanks! codegolf.stackexchange.com/a/118407/59735
 
@ConnorLSW nice
@Adám how to turn a dyad into a monad by giving its own argument to itself?
 
@LeakyNun Brachylog, 7 bytes: Ịị:Lc.↔
 
@LeakyNun just like J's ~, but more cute.
 
@LeakyNun Japt, 5 bytes: 9õ ¬ê
 
user165474
@LeakyNun Jelly, 5 bytes: ȷ9:9²
 
user165474
2:42 PM
I think this is the program you made yesterday.
 
@HyperNeutrino that's what we came up with
 
user165474
Yes.
 
user165474
I forgot that ȷ existed :P
 
Heh, I got a different 5-byter in Jelly
 
@BusinessCat we came up with 3 variants
 
user165474
2:43 PM
We did? I can't remember xD
 
Presumably this one: 9RŒBḌ
 
@BusinessCat yes we did come up with this
 
@LeakyNun Not declarative, 2/10
 
@Fatalize what's the two points for?
 
2:45 PM
Effort :p
 
user165474
Pity points :P
 
Jelly, 4 bytes: 9ŒḄḌ
 
@ETHproductions you win
 
user165474
10/10 Apparently the range is redundant???
 
user165474
...
 
@HyperNeutrino ŒḄ on a number makes a range automatically, ŒB does not (?)
 
user165474
Interesting.
 
user165474
That's weird.
 
user165474
@Dennis Can you explain the above behaviour?
 
2:49 PM
ŒB: Vectorizes at depth 1. ŒḄ: Does not vectorize.
I'm sure that's why
 
user165474
Oh.
 
user165474
Probably.
 
Yes, but I thought it would have been the other way around: vectorize = creates a range, non-vectorize = doesn't create a range
 
user165474
Anyway, I have to go now. I'll keep thinking about the Jelly task. Cy'all!
 
3:02 PM
i don't suppose anyone knows of an easy way to revert all scrollbar styling in css
a library i'm using has a bunch of styling for scrollbars and i think i would rather have the default
 
idk, sorry
 
@Poke custom scrollbars require a bunch of custom css (there's not standardized way to do it)
like, you don't actually stylize the scrollbar, you build your own, and disable the default
so, that is not possible in a general way
 
that's what i was afraid of
the library has like 175 lines of scrollbar styling haha
using pseudoselectors and the shadowdom
 
175 sounds about right
making a good scrollbar isn't easy
you'll also need to look at the JS
 
i saw this SO post and got hopeful
i was really hoping there wasn't a javascript component to it
it's the webkit selector styles
 
3:11 PM
I'd check just in case
 
CMC: given array a of positive integers, for each element, determine the parity of the sum of the other elements.
 
example?
 
[1,2,3,4] -> [parity of (2+3+4), parity of (1+3+4), parity of (1+2+4), parity of (1+2+3)] -> [1,0,1,0]
 
Anonymous
Actually, 10 bytes: 2,│♀%)Σ%♀^
 
Anonymous
XOR the parity of each element with the parity of the sum
 
Anonymous
3:27 PM
Python, more bytes: lambda a:[x%2^sum(a)%2for x in a]
 
@Mego I keep hitting output cache
@Mego 8 bytes: 2,;Σ♀-♀%
 
Anonymous
@LeakyNun I actually wrote that program first but failed to note its length in my sleep-deprived state, and thought that the 10-byte version was shorter
 
Anonymous
Hence why you kept getting cache hits
 
Does anyone know of a BF interpreter that supports signed cells?
 
arbitrarily large signed cells, to be precise
 
3:37 PM
Well, that's not necessary for testing purposes.
As long as my program doesn't intend to wrap, I'm fine
 
ah, true
 
It's an interesting problem
 
Anonymous
@mbomb007 IIRC the original BF interpreter used signed two's complement 8-bit cells
 
CMC: given non-negative integer n, output 1 if n is 0, and the value of n otherwise.
 
@LeakyNun Japt, 2 bytes: ª1
 
3:43 PM
@LeakyNun Brain-Flak 22 bytes: {(<({}[()])>)}{}({}())
 
CJam, 5 bytes: ri_1?
 
In ES6, you can do either n=>n||1 or n=>n+!n for 8 bytes
 
Or also ri1e| or ri_!+
 
Python, 18 bytes lambda n:n==0 or n
Idk why, but the space after the 0 is manditory
 
@mbomb007 there's a shorter version
 
3:46 PM
@LeakyNun C (GCC), 15 bytes: f(n){n=n<1?:n;}
 
@LeakyNun 05Ab1E 4 bytes: D_i1
 
C golfier than Python? :O
 
@betseg there's also a shorter version
 
Oh, non-negative
 
@mbomb007 don't know how that matters
 
3:46 PM
@LeakyNun Because it's longer to support negatives. That's why
 
@mbomb007 there's (still) a shorter version
 
Anonymous
@mbomb007 It's only mandatory in Python 2 because of poor octal literal parsing. 0o[0-7]+ is an octal literal.
 
7
Q: Zero an arbitrarily large cell in Brainf***

jimmy23013Your task is to write a piece of code that zeros the current cell in the Brainfuck variant that, each cell can contain a signed integer of arbitrarily large magnitude, instead of the normal 0 to 255. You may assume there are l cells to the left and r cells to the right of the current cell that a...

 
Anonymous
@mbomb007 lambda n:n or 1
 
@Mego bingo
Oasis, 2 bytes: >V
 
Anonymous
3:49 PM
1@| in Actually
 
@betseg figured out?
 
n?:1
 
@betseg nice
 
mego's answer helped a little
 
Anonymous
Remember that ints are bools (or can be used as bools) in basically every language
 
3:51 PM
Jelly, 2 bytes:
 
@Mego yeah, basically every language... except...
'cause ya know it...
@BusinessCat that's nice
 
that's one of the reasons it's so verbose
 
@LeakyNun PHP or JS or Java?
 
@BusinessCat how does it work? (I need inspiration for an APL answer)
 
@betseg not JS IIRC
@KritixiLithos z+not(z)
 
3:52 PM
PHP's data types work a lot like JS, so I don't think PHP either
 
in JS you can use int as bool
 
JS doesn't even have int and bool types :P
 
right
 
You can use anything as a boolean
or an int, with x|0
 
Anonymous
@ETHproductions It sort of has a boolean type. true and false are keywords. But really those are aliases for 1 and 0.
 
3:54 PM
Same with Python, though it does have actual types
 
Anonymous
Like Python, but Python actually has a bool type (which is a subclass of int and only allows two objects to exist: True and False).
 
@Mego If you print true, it doesn't print 1, though, does it?
 
JS technically does have a boolean type (typeof true === "boolean")
 
^
 
Anonymous
@mbomb007 Oh right. So yeah I guess the boolean type does exist
 
3:55 PM
> technically
 
But you can't do e.g. bool x = true;
 
@BusinessCat oh well, you can drop the $
 
Anonymous
But JS doesn't have an int type because someone got the great idea that doubles were better and should be used everywhere.
 
And there's no such thing as ints, just one generic number type
 
3:56 PM
I guess as long as the input has no leading 0s
 
@LeakyNun APL: ⊢*0≠⊢
 
ninja'd
 
Anonymous
Floating point errors be damned
 
@Adám that's long
 
Anonymous
@ETHproductions var x = true; is legal
 
3:56 PM
@Adám just do +0= or whatnot
 
@LeakyNun huh?
 
doesn't work?
 
Retina, 4 bytes if input is unary, and output is decimal
 
@LeakyNun a constant cannot be a middle tine
 
@mbomb007 same as the regular retina
 
3:58 PM
What exactly is a tine?
 
@LeakyNun I suppose you mean ⊢+0≠⊢
 
@Adám that's... long
 
Nice one
 
Tines or prongs or teeth are parallel or branching spikes forming parts of a tool or natural object. They are used to spear, hook, move or otherwise act on other objects. They may be made of metal, wood, bone or other hard, strong materials. The number of tines (also written tynes) on tools varies widely – a pitchfork may have just two, a garden fork may have four, and a rake or harrow many. Tines may be blunt, such as those on a fork used as an eating utensil; or sharp, as on a pitchfork; or even barbed, as on a trident. The terms "tine" and "prong" are mostly interchangeable. A tooth of a comb...
 
3:59 PM
@Adám I actually meant ⊢+0∘=
 
So a tine is a branch or a part of the train
 
(hey, our answers are contradictory)
 
@KritixiLithos A Dyalog fork has three tines: f g h or A g h
@LeakyNun That's the same.
 
@Adám but you used not equal
 
@LeakyNun because I used power. 0≠⊢ gives 1 for non-zero args, 0 for zero args. 0*0 is 1, arg*1 is arg.
 
4:01 PM
oh heh
 
@LeakyNun and what I meant by "the same" is ⊢+0∘= and ⊢+0=⊢ are the same.
 
alright
 
In J: 0&= and 0=]
@LeakyNun Here is a shorter one: ⊢*×
In J, that translates to ^*
 
oh nice
 
So the best algorithms are pretty much n+(n==0), n||1, and n**bool(n) (or n**sgn(n))
 
4:05 PM
can anyone check if there is a duplicate in main?
 
Caught that right as you did
 
@ETHproductions no, n**sgn(n)
 
That'd be *Ṡ in Jelly
 
G is grid
 
Hmm yes, I guess I was going off the sign function in Japt (which is g)
 
4:07 PM
@ETHproductions problems of being a polyglot
 
which leads to the solution pUg in Japt
@LeakyNun Indeed :P
If I can't remember which instruction does what I want it to, I'll usually default to Japt
@LeakyNun I don't think there's a duplicate, but I'm finding it really hard to search
 
@ETHproductions me too
 
@BusinessCat or ri1e>
 
That too
 
I thought the regex guru only speaks Retina :p
 
4:13 PM
I have a lot more CJam answers than Retina answers...
 
oh really
regex-golf: match a non-negative integer with no leading zeros.
 
s/would/with/ ?
 
But 0 should match right?
 
yes
 
Isn't it just ^\d?
 
4:19 PM
you would match 0.123 as well
 
> non-negative integer
 
> match
regex-golf: match a non-negative integer with no leading zeros, and do not match anything else.
or else you could just write .+
 
ah, I get you now
 
so ^(?!0.)\d+$?
 
@MartinEnder nice
 
4:22 PM
Hello to all!
 
^(?!-|.*\.)
 
@MartinEnder Do you want to remove leading 0's?
 
3 mins ago, by Leaky Nun
regex-golf: match a non-negative integer with no leading zeros, and do not match anything else.
 
@KritixiLithos matches "ramen"
3
 
@LeakyNun Okay. Thanks!
 
4:24 PM
@LeakyNun [^0]\d* ?
 
doesn't match 0 on its own
 
@Adám doesn't match 0
ninja
 
and it's missing anchors
(although I guess some flavours implicitly match only entire strings)
 
@LeakyNun What about \A[1-9]\d*\z ? ;)
 
doesn't match 0
 
4:25 PM
@MartinEnder ...
 
Then ^(0|[^0]\d*)$
 
what does \a do?
 
same as ^ but isn't affected by the m-modifier
(assuming you mean \A)
 
@MartinEnder Ah! You're right!
 
\a is just an escape sequence in some flavours
 
4:26 PM
@Adám Matches A113
 
@MartinEnder I have much to learn
 
@ETHproductions Arrg. ^(0|[1-9]\d*)$
 
@MartinEnder Try with \A([1-9]\d*)?\d\z (or ^([1-9]\d*)?\d$). :)
 
@Adám and your solution would be equivalent to mine
 
@LeakyNun Min's shorter ;-)
 
4:29 PM
sure, but in some flavour, \d matches some peculiar characters...
@Adnan I'll give you a chance to answer my challenge on main using Oasis... If not, I'll post my 2-byte solution.
... provided that it hasn't been closed as dup.
 
posted on May 02, 2017 by Leaky Nun

Task Given a non-negative integer n, output 1 if n is 0, and output the value of n otherwise. Input A non-negative integer. If you would like to accept the string as input, the string would match the following regex: /^(0|[1-9][0-9]*)$/, i.e. it must not have any leading zeroes, except when it is 0. If you accept a real integer as input, you may assume that t

 
Wat is dat witchcraft
 
Is the feed borked?
 
@Adám 1∘⌈
 
If anyone is interested, there is a new bounty on this question because no one has answered it in a month that was started today:
 
4:45 PM
14 answers in 16 minutes @_@
 
what did you expect?
 
never mind
 
feed looks super cool
 
Got an upvote literally 3 seconds after posting the answer...
 
@Fatalize it's from me, because I like brachylog lol
 
4:50 PM
You didn't even check my answer then ಠ_ಠ
 
@Fatalize I did
you underestimate my [reading] power
 
@BusinessCat The SE API is borken.
 
Don't try it!
 
25
Q: Office Escape: Plan your way out!

VisualMelonFor those who can't scroll down... There is a bounty on this question for the most golfed answer by 5/9/17 by programmer5000. There are currently no answers, so hurry... It's the final sprint... and half your team is off ill. You're working late, just making your last commit for the day, look...

 
4:56 PM
@mawds sandbox is unfeatured
 
@DJMcMayhem Nice abuse!
It's really clever
 
I'm going to post this question today with no additional changes, unless anyone has any more thoughts.
 
@betseg it's not. it looks like SE fails to load any per-site meta posts for the sidebar right now
 
oh
 
@WheatWizard go ahead, looks good.
 
4:59 PM
@MartinEnder I also can't access user pages.
 
@KritixiLithos Thanks! I was ecstatic when I realized that could work, haha
 
@Dennis I can?
 

« first day (2285 days earlier)      last day (2541 days later) »