« first day (1918 days earlier)      last day (2927 days later) » 

Anonymous
6:23 AM
My code is doing infinite recursion for a reason I cannot fathom
 
Anonymous
So I'm gonna waste some time here until the reason becomes apparent to me
 
Anonymous
@quartata The instances where I have seen it referenced so far are all popcons with no validity criteria.
 
Anonymous
Though you're right, that's not the proper post to be referencing for that issue
 
6:38 AM
0
A: Showcase your language one vote at a time

CyoceCy Factoid Cy is a postfix language that operates on a stack. The order in which operands are expected on the stack is based not on what makes sense, but the order in which it would be most convenient to pass on arguments in a point-free style.

Any horrible flaws? Did it on my phone
 
       PROGRAM MEGO_PARTY
100        IF (.TRUE.)
               GOTO 100
           END IF
       END PROGRAM
Fortran
FORTRAN 77 to be specific
 
No mobile button
At least not one that's fully on the screen
Look at the bottom right corner
@QPaysTaxes oh I got an upvote?
 
mobile is at bottom right
 
@QPaysTaxes no. The "mobile mode" button is hanging off the bottom right corner of the screen. A+ design
 
Anonymous
@AlexA. What about my party?
 
Anonymous
6:47 AM
Oh it's a recursion joke
 
Yes
 
Anonymous
Except that looks more like an infinite loop than infinite recursion, assuming GOTO doesn't push a new stack frame
 
¯\_(ツ)_/¯
I didn't think very hard about it <-- summary of my existence
 
Anonymous
It would be interesting to implement Seriously (a stack-based lang) in Stackless...
 
@Cyoce ... The desktop side isn't exactly meant to workwell on mobie
 
Anonymous
6:49 AM
@MarsUltor s/The desktop side/everything/
 
Anonymous
Mobile browsing is still so terrible that I'd rather get my laptop or wait until I have access to a computer
 
*site
It works well on Remix OS though
So it's possible to have it workwell on an androiding
 
Is there a way to re-trigger a Travis CI build without pushing an unnecessary commit?
 
*working well on an android
 
Hey, what should I name my new esolang?
 
Anonymous
6:51 AM
 
I need inspiration.
 
Anonymous
@DrGreenEggsandHamDJ Call it Inspiration
 
@DrGreenEggsandHamDJ Ham Slam
 
I'm not a huge fan of either, but since I have no ideas of my own I'm not really in a position to complain.
 
@Mego Oh, not my repo so I don't have that button.
 
Slam Ham
 
@KennyLau I think it means it's time to throw out the bread. — Alex A. ♦ 8 mins ago
I was waiting for something like that.
 
He wanted to know what mold was...
 
@MarsUltor but I had to switch because I couldn't figure out how to send a picture in mobile
 
Anonymous
@AlexA. Then I dunno. Make a pointless commit or ask the repo owner to rebuild.
 
6:55 AM
I'm waiting for senpai to notice so hopefully they'll restart the build. Otherwise I could close and reopen the PR maybe?
They don't like pointless commits
 
Anonymous
Find something else that needs fixing so you can commit again :P
 
Well, I tried to keep everything on my feature branch specific to that feature...
 
@DrGreenEggsandHamDJ DGEH
 
@Cyoce How is that pronounced?
 
198
A: Trigger a Travis-CI rebuild without pushing a commit?

jbtule If you have write access to the repo: On the build's detail screen, there is a button ↻ with the tooltip "Restart Build". Note: Browser extensions like Ghostery may prevent the restart button from being displayed. Try disabling the extension or white-listing Travis CI. If you've sent a pull req...

 
6:58 AM
Ok
 
Is it a PR or a commit?
 
PR
 
How about "Brain-Flack"?
 
Flax Muffin
Straight Slammin' 420
 
Ham's Remix
Ham's Golfo Supreme
Ham's New Language
 
7:05 AM
Dr. Green Programming and Ham Language DJ
 
^^^ if golfing language, else ^^.
 
Anonymous
Once again, my poor typing skills at 2 AM have caused me issues while programming :P
 
Green Eggs and Ham
 
I appreciate the effort.
 
Along the lines of Cheddar/Jelly/Bubblegum/CJam
 
7:05 AM
Does anyone in here know ruby?
 
Kinda
@QPaysTaxes Uses Ruby a lot
 
@DrGreenEggsandHamDJ I know Python.
 
Anonymous
I think Doorknob is our resident Ruby nerd
 
Anonymous
Oh yeah Q too
 
@Mego He's not here right now
 
7:06 AM
Maybe I should post it on code-review.
 
@Doorknob Green Eggs and Ham needs help
@DrGreenEggsandHamDJ Do you have a repo?
 
Code Review loves it when PPCG people post there
 
@MarsUltor He's probably asleep.
 
s/probably/definitely/ it's like 3am there
 
Fwiw it's like 1am here.
 
7:07 AM
@AlexA. I'm usually awake at 3am
 
@AlexA. lol Is that sarcastic or serious?
Anyway, I'll probably end up posting since it's the first thing I've ever written in ruby.
 
It sounds sarcastic but someone in their chat once said that they actually do like it because it brings more traffic to their site
(so long as we abide by their very different rules)
 
@DrG Line 8: return @data.length != 0 ? @data.pop : 0
 
@MarsUltor why
 
IDK
 
7:09 AM
@MarsUltor Yeah, there's a lot of tidying like that I need to do.
I literally just got it working 10 minutes ago.
 
Anonymous
"Hello this is my code how can I make it better" posts golfed code "You should use longer variable and function names" "No I said better"
14
 
You mixed 2- and 4-space indents
 
@AlexA. Oh shit, you're right.
I forgot about that.
 
Ruby standard is 2, unfortunately
 
Generally, I like 4-space, but while I was writing this I felt like 2 looks better.
TBF, I usually write C/C++ and python where 4 is standard.
 
7:10 AM
I prefer 4 as well but I have Vim set to 2 for Ruby
 
Anonymous
I'll normally use 4-space indents except for cases where I have a lot of nested indents
 
@AlexA. FTPlugin?
 
no
 
@DrG Use case
 
@Mego 1#84ⁿ@q* dot product with [1,4**8] o___O why you no base
 
7:12 AM
@DrGreenEggsandHamDJ autocmd FileType ruby setlocal shiftwidth=2
 
Line 120: n == 0?
 
2 mins ago, by Alex A.
Ruby standard is 2, unfortunately
2 minute ninja
 
@MarsUltor Facepalm.
 
What is love?
Baby don't hurt me
Don't hurt me
No more
 
@QPaysTaxes I don't know, but the answer is 42.
 
7:13 AM
<3
 
Anonymous
@Sp3000 Using base conversions and ensuring that the values are padded to 16 digits is longer than just dot product
 
Why padding?
 
Anonymous
 
@QPaysTaxes I was looking for someone to judge my amatuer ruby codez, but it's really terrible right now.
 
so, I finally got the code-golf gold badge \o/
 
7:15 AM
I'll probably put it on code-review once I'm reasonably happy with it.
 
wait
0/10
inconsistent string delimiters
also, make brackets a variable at the top of the file
 
@Mego No I mean, why do you even need padding?
 
then use brackets.include? s
 
Anonymous
Say you have a checksum that comes out to higher = 256, lower = 1. Binary conversion would turn that into ['10000000', '1'].
 
@QPaysTaxes huh?
 
7:16 AM
@MarsUltor ? Do you mean ' vs "
 
@DrGreenEggsandHamDJ Yes
 
@Mego I don't think base conversion requires converting to binary at any point...
 
@QPaysTaxes When should I use then?
 
Anonymous
Then what are you talking about with base conversion?
 
Like I said, this is the first ruby I've ever written.
 
7:17 AM
@DrGreenEggsandHamDJ if foo then bar
 
@Mego [a b] 65536 base -> a*65536+b
 
Also, if foo then bar else baz assuming you're not capturing the result
otherwise use a ternary (quux = foo ? bar : baz)
7 mins ago, by Mars Ultor
@DrG Use case
Ruby's case is pretty powerful
 
Anonymous
@Sp3000 Python doesn't do base conversion past base-36, and I've been too lazy to implement higher-base conversion
 
@MarsUltor I am. That's what I'm currently working on.
 
@Mego Seriously?
 
Anonymous
7:19 AM
...
 
:D
 
Anonymous
ಠ_ಠ
 
No, I mean, base conversion isn't that hard to implement
 
Anonymous
I know, but I've had other priorities
 
Anonymous
Like getting everything else working
 
Anonymous
7:20 AM
And making it use less memory so that it is actually usable for larger problems
 
If you need extra memory for your programs, just take a trip down memory lane.
 
Anonymous
For instance, I'm working on using generators more and only explicitly converting to lists when needed (like with printing)
 
I hear they have terabytes of excess.
 
   else
        case cur
            when ')' then active.push(n)
            when ']' then puts n
            when '>' then n == 0 (meant to be n=0, right?)
            when '}' then i = data[2] - 1 if active.peek != 0
Line 88: active = active == left ? right : left
 
Anonymous
Right now, the range function is implemented as push(list(range(a,b)))
 
7:23 AM
@QPaysTaxes All of the Ruby style guides I've seen say to keep them on the same level as case, which makes me crazy
 
@MarsUltor I appreciate the input. I really do. But I also need time to implement it.
 
Anonymous
Similar silly things like that totally negate any benefits I get from using Python 3 (aside from better handling of Unicode)
 
@DrGreenEggsandHamDJ Can't you just copy-paste?
 
I suppose I could.
 
BTW, if you copy the case, 1. Test it, 2. change the four spaces to two
 
7:26 AM
@Mego Sure, I get that, but I just feel like there's some improvements which would be very useful but wouldn't take longer than a few minutes (like base conversion) that might be worth doing in the meanwhile, since stuff like making range lazy would require a lot more time and testing
 
@DrGreenEggsandHamDJ "djeh". "duh zheh"
 
OK. Is there a symbol I should use instead?
 
@QPaysTaxes what language is this? Ruby?
Also I like the sentence "and && for and"
I read it as "and and and for and"
 
Anonymous
I figured out my infinite recursion issue
 
Anonymous
Strings are iterables
 
Anonymous
7:30 AM
Specifically, they're iterables all the way down
 
Also @QPaysTaxes Do you prefer for i in [a..b] or for i in [a .. b]?
 
@Mego yep. I learned that the hard way.
 
Anonymous
@Sp3000 Arbitrary-base conversion just hasn't ever been high on my todo list. In fact, until recently, it wasn't on my todo list at all.
 
Anonymous
So recursive_function=lambda s:[recursive_function(x) for x in s] if isinstance(s, collections.Iterable) else s causes some issues if isinstance(s, str)
 
7:34 AM
@Mego aggggh so verbose :'(
 
Anonymous
@Cyoce Because it's an example, not a code golf solution
 
@Mego I know. I was remarking on Python's verbosity. My apallment was at the fact that this is the "obvious" way to do it in Python.
 
Anonymous
For golf it'd be f=lambda s:hasattr(s,'__contains__')and map(f,s)or s
 
Anonymous
There probably is a different method that is more obvious to people other than me
 
try/except seems a bit shorter
 
7:39 AM
@DrG Painful = malbolge-level painful?
 
@MarsUltor No, slightly above brainfuck level.
 
@Mego even that's verbose :(
 
Anonymous
@Sp3000 Can't do try/except in a lambda though
 
:D where has this been my whole life?
 
7:41 AM
@Cyoce What do you keep comparing to?
@Mego I mean try/except in a def
 
@Sp3000 My primary langauges, ruby/js
 
Anonymous
def f(s):
 try:a=map(f,s)
 except:a=s
 return a
 
Anonymous
That's definitely not shorter
 
47 vs 52
 
Anonymous
Really? It looks longer at a glance
 
7:45 AM
@Cyoce That's fair enough. I wouldn't consider Python that verbose personally though, so I find it a bit weird
 
Anonymous
It would be neat in Python to have a function composition operator. That would make maps so much golfier
 
Anonymous
Like def __mul__(self, other): return lambda *a,**k: self(other(a,k))
 
Anonymous
So (f*g)(x) would be equivalent to f(g(x))
 
Anonymous
So ['1 2 3', '4 5 6'] => ['1,2,3','4,5,6'] could be implemented as map(','.join*str.split,s)
 
That's... kinda what decorators are though, right?
 
Anonymous
7:48 AM
Sort of
 
Anonymous
But I want an infix binary operator
 
Anonymous
@QPaysTaxes map(lambda x:','.join(x.split()),s) or [','.join(x.split())for x in s]
 
@Mego What about |, >>? That would kinda make sense..
 
[s.replace(' ',',')for s in L]
 
@Dennis if that's not a troll account you got an answer from Mark Adler
 
Anonymous
7:51 AM
@Cyoce * would be more consistent with mathematics ()
 
Anonymous
@Sp3000 My example wasn't great but it illustrates the point
 
@Mego true.
I wish python had better functional programming support.
 
Anonymous
> Member for 2 years, 4 months
 
Anonymous
@Cyoce Same
 
I think haskell-style isolated operators, e.g. (+) would be a godsend.
 
Anonymous
7:52 AM
Mark Adler, Southern California
28.3k 2 32 64
 
Anonymous
Holy shit it is the Mark Adler
 
Guys! I have seen a very large model railroad.
 
Anonymous
I am the reference, having been part of all of that. This post could be cited in Wikipedia as an original source. — Mark Adler Oct 16 '15 at 16:38
 
Oh my god this made me cry
 
@Mego Yeah, I know, but the reality is you're not going to have a language that's got everything, unfortunately
 
Anonymous
7:56 AM
@Sp3000 No, but that's why we have modules/libraries :)
 
Well what I meant was, even with that you'd get close, but since it's not what the language was designed for it won't quite be the same
 
196
Q: Why isn't Python very good for functional programming?

David JohnstoneI have always thought that functional programming can be done in Python. Thus, I was surprised that Python didn't get much of a mention in this question, and when it was mentioned, it normally wasn't very positive. However, not many reasons were given for this (lack of pattern matching and algebr...

(Just doing some random researching on the topic atm)
 
It's very awesome.
 
Anonymous
Holy crap
 
Anonymous
7:58 AM
1
A: Sudoku Compression

Mark AdlerMathematica, score: 130 9 Update: After this answer was posted, it inspired a new loophole closer: "Optimising for the given test cases". I will however leave this answer as is, as an example of the loophole. Feel free to downvote. I won't be hurt. This encodes a cell at a time in raster or...

 
Anonymous
Mark Adler is the reason we have the "optimizing for the test cases" loophole
 
That's clever.
 
Anonymous
I suppose that much should be expected from the guy who co-authored gzip and zlib
 
@hey @QPaysTaxes
@QPaysTaxes Uhm..,no? You ahve to get up if you're hearing the morning birds.
 
Anonymous
@flawr That highlighting makes me want to throw things at them
 
Anonymous
8:09 AM
My kitty is trying to help me write generators
 
Anonymous
She's not terrible helpful
 
@Mego But she's a kitty, and that is a good thing.
 
Anonymous
@flawr Yes, she is purrfect
 
Anonymous
It's 3:10 AM right now for me and that comic is way too real
 
8:11 AM
@Mego OH MY GOD. I was just writing basically this exact challenge =(
Damn time travelers.
 
Anonymous
@flawr Too late, Mark Adler has already solved it
 
That's not what's bothering me.
Well it does, but what is bothering me even more is that someone from the past stole my idea.
 
Anonymous
How dare they steal your idea
 
I'm gonna post my challenge anyway and make that one as a duplicate of mine.
 
Anonymous
It certainly isn't the more reasonable case that you saw it in the past and now are getting inspiration subconsciously from it
 
Anonymous
8:13 AM
Yeah, both of those are unreasonable
 
I do no thinkg that I've ever seen it.
 
Anonymous
Clearly it's time-travelling idea thieves
 
Anonymous
No other explanation
 
Of course, I mean there is absolutely no other explanation.
@Mego AGAIN!
@Mego Time traveling Ninja!
 
Anonymous
Penguins traded flight for time travel
2
 
8:14 AM
Oh, now everything is starting to make sense!
 
Anonymous
And then GR proved that time and space are the same, so time travel == flight
 
Anonymous
Mephistopheles really got the short end of the stick there
 
Mephistopheles = dog?
 
FRUITW'd /o\
 
Thinking of it, which end is the "short end" of a stick???
 
Anonymous
8:15 AM
Mephistopheles (/ˌmɛfɪˈstɒfɪˌliːz/, German pronunciation: [mefɪˈstɔfɛlɛs]; also Mephistophilus, Mephistophilis, Mephostopheles, Mephisto, Mephastophilis and variants) is a demon featured in German folklore. He originally appeared in literature as the demon in the Faust legend, and he has since appeared in other works as a stock character. == Etymology == The word may derive from the Hebrew מֵפִיץ (mêp̄îṣ) which means "scatterer, disperser", and tophel, short for תֹּ֫פֶל שֶׁ֫קֶר (tōp̄el šeqer) which means "plasterer of lies". The name can also be a combination of three Greek words: με (me) as a...
 
Violence everywhere....
 
Anonymous
@flawr Break a stick in two unequal pieces, pick them randomly. Whoever gets the longer piece wins. The loser gets the short end of the stick. It's essentially the same as drawing the short straw, but with sticks.
 
But the end implies that it is still one stick, doesn't it?=)
 
while(*B)h+=l+=*B++;
tightest loop body of all time
 
Anonymous
@flawr One stick that has been broken into two. A broken stick is just two smaller sticks, yes. Just like a broken rock is just two smaller rocks.
 
8:17 AM
all these insignificant memes :/:\:/:\
 
PS: My challenge would have been making a program, that given a solved sudoku, removes as many numbers as possible that still make it unique. But I think this is really too much of a duplicate, is it?
 
Anonymous
@flawr That also exists
 
@Mego time traveling penguins
 
Anonymous
11
Q: Build a minimum-clue Sudoku unsolver

Joe Z.My attempt at stating this question, but with a more objective solving criterion. Your task is to build a program or function that takes a solved Sudoku grid S in the format of your choice and attempts to generate a problem grid with as few clues as possible that has S as its unique solution. (I...

 
h,l,m=65521;A(char*B){h=0;l=1;while(*B)h+=l+=*B++;return h%m<<16|l%m;}
@Mego "Actually" is only half as small as C
tsss
 
Anonymous
8:20 AM
@orlp Actually has a serious bug that I'm working on that made the shorter solution not work
 
@Mego wuts "optimizing for the test cases" ?
 
How about doing the same challenge with a binoxxo?
Or a bimaru?
 
ewwww thats sneaky
 
Anonymous
@QPaysTaxes That's not very nice
 
What is the meaning of ewwww?
@QPaysTaxes Good morning
 
8:25 AM
Why is this being flagged? Seems to be in jest...
I see nothing obviously wrong with those messages as they read like jokes to me.
Can't stay here for long.
 
@QPaysTaxes I though tthat was aaawww?
 
Anonymous
Jest or not, comments like that are not Being Nice
 
Night.
 
Night.
So, the premise is - you write a program in 64 bytes that outputs a program that outputs a program that outputs a program... that outputs a quine.
And you have to do it as short as possible, in the most languages possible.
Darn, I missed the code jam 1B.
Wait
It starts in 7 hours \o/
 
@zyabin101 Reference non-nested program - '!+OR", 6 bytes, Martin Büttner
 
8:43 AM
0
Q: Count the shapes

CarpetPythonGiven an image containing one or more circles and rectangles, return 2 integers with the count of circles and count of rectangles. Rules The input image will be black figures on a white background in any bitmap format you choose. The image width and height will be between 100 and 1000 pixels. ...

 
ven
8:53 AM
As a newcomer, the hardest thing around here when you want to take up a golfing language is that, well, it's gonna take you so long to golf stuff, somebody else who's fluent with the language is always gonna outgolf you.
 
hi all
anyone here understand the first thing about node.js?I am trying to run paste.ubuntu.com/16139686 with xlsx --help but it just returns the prompt
how do you run a node script?
 
@Lembik node <script-name>, <args>
 
@MarsUltor same result. Notice #!/usr/bin/env node at the start
with a comma?
 
No
whoops
 
xlsx --help Is that correct?
would you mind trying it ? I think I am just doing something dumb
as ever
 

« first day (1918 days earlier)      last day (2927 days later) »