« first day (1893 days earlier)      last day (2952 days later) » 

9:02 AM
Codegolf: Write the shortest infinite recursion in your language.
That would actually be a fun idea=)
 
><>: [
 
]:(:)
Let's sandbox it
 
You'd have to be really good with your definition of "infinite recursion" though
 
Do fork bombs count?
 
Why?/ what loopholes do you see?
 
9:05 AM
Hmm
 
f=lambda n:f(n-1) in Python
 
But many languages have recursion overflows
 
f=->n{f[n-1]} in Ruby
 
Well that's why I posted [ - in ><> it starts a new stack, which is its way of doing recursion
 
def f(n):f(n-1) is shorter
 
9:06 AM
So [ just keeps making new stacks ?
 
Yeah, since ><>, being ><>, executes that in a loop
Also f=lambda:f()?
 
@MarsUltor Oh, whoops
 
How about a recursive counter or something like that?
 
What do you mean?
 
@Sp3000 In that case, f=->{f[]} in Ruby
 
9:09 AM
Well just requiring the function to actually do something instead of only calling itself.
Using an infinite recursion your program should terminate and output the largest integer.
 
Oh, my mistake - forgot ><> needs a number of arguments, so 0[. Well if you need a counter I guess that'd just be keeping a number on the stack and incrementing it each recurse?
 
0
A: Sandbox for Proposed Challenges

flawrShortest infinte recursion Your task is writing a program/function that recursively calls itself ad infinitum. META: I know this is not a good definition yet, just a rough idea. If you have any thoughts on this please let me know. -Ideas: The program does have to do something simple like cou...

0
A: Sandbox for Proposed Challenges

NeilSelf-identification before golfing Since golfed code is harder to read, answers often contain an less golfed version. There are a number of potential golfing transformations depending on the language, so you may be able to score more highly using a more traditional language. Some examples of gol...

 
anyone know C?
 
9:16 AM
@JesterTran I am rusted, but I do
 
@Katenkyo do you mind helping me with strange usage of data types?
 
@JesterTran I can at least try ^^
 
int add(int a, int b);
int (*test)(int, int);
test = add;
test(4,5); // new way of calling add
what is the purpose of the second line?
 
it declares a variable test of type function of int and int returning int
 
@JesterTran That would be a pointer to be executed as a function a laying down an integer value
 
9:20 AM
is it practical?
 
But are you sure it's plain C...?
 
I'm learning C at the moment so it must be
 
it's definitely plain C, and it's practical for passing functions around
 
never came accross that, never knew it could be done
Thanks for the intel Oo
 
@aditsu that is interesting...
To the main question:
typedef void (*test)(void *a);
what does that do?
 
9:23 AM
define a pointer on a procedure that can accept a parameter a of any type
(void* isn't really "any type", but let's go with this for the moment)
 
it defines a type alias named test, for a function that takes void* and returns void
 
@aditsu in C, we name procedure a "function" declared with void as a return type
also, it doesn't return at all
 
I doubt it's standard, but yes you can call it that
and the function may very well return (unless it has an infinite loop or something)
 
so any function with prototype:
void functionName(void *variable);
has a new alias, "test"?
 
@aditsu I don't know if it's standard by the c99 or what, but that's what it is name in books and in the community ^^
 
9:27 AM
@JesterTran test is an alias for the function type
 
@aditsu if you defined the function as void doSomething(void* a) it won't
 
@Katenkyo yes it will, if it has a return statement and reaches it
 
@aditsu doesn't it will cause a compile/runtime error?
 
absolutely not
oh, it also returns if it reaches past the last line in the function block, of course
 
@aditsu Ok, typedef is used for re-naming. So instead of void functionName(void *variable); we have test(... what?
 
9:30 AM
@JesterTran not really like that, but you can write test x = functionName;
 
@aditsu I see...
where does the "void *var" come into play?
 
that's a function argument, you pass it when you call it and it's supposed to be used inside the function
 
@aditsu effectively checked, you can write void a(){return;} without any problem Oo
 
instead of calling it functionName, do we call it "x"?
 
@JesterTran that's it
 
9:34 AM
@Katenkyo sure you can; the return there is redundant but valid
 
@aditsu never tried and always assumed it couldn't be done
 
@JesterTran yeah, x is basically a pointer to that function, but you can call it just like calling the function
 
the ultimate aim here is to pass functions?
 
probably
you can also use this stuff to implement OOP
 
thanks guys, I learnt a lot!!
 
9:36 AM
OOP in C would be a pain...
You'd better go with C++ from the start
 
yeah it's cumbersome, but I've seen it done
 
wait, test x = functionName;
where does this go and where does the instructions for the function go?
 
@JesterTran it means you already have defined functionName
 
the instructions for the function go where you define the function; x goes anywhere you want (but probably not inside the function itself :p)
 
riiiight XD
 
9:42 AM
void functionName(void *variable); -> that's a declaration, not a definition
 
so you'd have something like
void functionName(void* a){/*instructions*/}
test x= functionName
 
@Katenkyo yep yep, makes sense
 
@JesterTran actually, as long as you have the declaration above this affectation, the definition can be everywhere (as we're speaking about pointers :))
 
@Katenkyo Ok
 
10:42 AM
0
Q: Simulate Cookie Clicker

BasIntro Cookie Clicker is a popular browser game in which the player has to click a cookie to gain... Cookies! The player can buy upgrades which will automatically farm cookies for you. Sometimes a golden cookie will enter the screen, which will provide a bonus upon clicking it. Challenge This c...

 
11:21 AM
Why is Bluetooth still so flaky in 2016...
But... but ... Bluetooth 4 :( (jk, it's horrible)
 
If you have to use Bluetooth for something, you can probably groan and not do that
 
I lost my line in lead, so I have to use BT now...
 
most of the world still operates on copper lines for everything
 
@Quill Well, I remember data over IR. It didn't work until the devices actually touched their sensors. And even then it was horrible.
I was tethering my GPRS mobile internet over IR to my PSION 3a :D
 
that reminds me of a conversation I overheard at work last week; apparently wireless car remotes have more range if you put them to your head
 
11:26 AM
Well, AOL wasn't really around in Germany (hence the A in AOL) :). But I guess that's older.
Though I remember AOL was one of the first free mail providers in Germany.
I'm not in a "Foreign Land", just another country. There are surprisingly many Germans here :P
 
11:53 AM
Post-processed Fencing is a thing I didn't know I needed in my life.
 
@mınxomaτ It's fancy :D
 
P.S. if you want to scare the people at code golf with the complexity of the problem, link them to this paper. — J. M. ♦ 39 secs ago
 
12:08 PM
@MartinBüttner Where was it posted?
 
You can click the timestamp
 
Oh, right.... nevermind... I'm dumb
 
@QPaysTaxes Which game?
 
^
 
Who's following the 64x64 gamejam on IO?
 
12:20 PM
@QPaysTaxes jWhen I first learned pointers, I was angry because I didn't understand their usage... now, i'm angry when a language don't let me mess with them
 
@zyabin101 the what what on what?
 
@zyabin101 Did you take your pills?
 
@Katenkyo I did >:U
> jWhen
 
@zyabin101 it is a new things to add to js
(I must be tired, speaking becomes incredibly hard -_-)
 
you guys know Erdős's "the Book"?
it's the book in which God keeps the most elegant proof for each mathematical theorem
sometimes I want to take a peek into "the Book" for code golfs :(
just to see what an optimal solution would look like
 
12:34 PM
@orlp codegolfs ain't mathematical problems per se
 
@Katenkyo that doesn't matter
 
But I agree that I'd love to see what an optimal solution in the language I golfed in would be
 
for example in Python
for a simple problem solved in 30-50 characters it'll probably have a cool trick or two
but already by ~150 characters I think it'll be mindblowing
 
@orlp I would want to see it for lua because answers can easily be 200+ even for something not so hard
 
1:14 PM
welp, my first puzzle has been on PPCG for nearly a month
 
@crayzeedude g'morning m8
 
13 upvotes and still no answers
@zyabin101 monking
 
hi
first day of school after two weeks, so sleeeepy...
 
btw, is the function call for a quine necessary? (ex: in JS $=`$=${$};$()`;$(), is the ;$() necessary?)
 
@MamaFunRoll Is that the Bling quine?
 
1:16 PM
@zyabin101 Yes.
But can the part at the end (calling the function) be taken out?
 
0
A: Sandbox for Proposed Challenges

FatalizeDiamondize a Matrix Given a matrix, output a representation of the matrix where the top left element is on top, the anti-diagonal is the central row and the bottom right element is at the bottom. For example, consider the following matrix: 1 2 3 4 5 6 7 8 9 The diamond version of this matrix...

 
@Lembik I'm on a chromebook right now, but I'll put up timings when I get home. I'm surprised its this fast, but then again, I was testing on repl.it and it wasn't finishing N=6 in < 5 min.
So checking if the last one is < accuracy is not enough, the other ones can also pile up. I'm not sure if there is a good way to check if its enough.
 
@El'endiaStarman I like the red light because it's good for sleeping. I love sleeping.
 
You don't have to put on the red light...
 
I was half expecting that :P
 
1:29 PM
ROOOOOOOOOOOOOOOOOOOXXXXXXXXXXXXXXXXXXXXXANNNNNNNNNNEE
 
And yet that took me by surprise...
I wish you wouldn't use all caps when I have the volume turned right up
 
Screenreading software?
 
Lol I love the idea of screenreading software that shouts louder when it's all caps.
No I was just being silly - the all caps make no difference to me
 
If you're not careful you'll get tinnitus of the eye.
 
Outweirded
 
1:35 PM
@Sp3000 Is Grime broken?
 
13
Q: Help develop Alphys' newest puzzle!

crayzeedudeAlphys, the Underground's Royal Scientist, has finished a prototype for a new puzzle. However, she can't seem to find anyone willing to test it. The rules of her puzzle are as follows: The goal is to get to the right side, starting from the centermost tile on the left side. For puzzles with ev...

 
@Geobits Vidditus, maybe? Latin videre "to see" versus Latin tinnire "to ring".
My Latin is abysmal - purely guessing at the conjugation.
 
Nah, I mean an audible ringing in the eye.
It's like when you see things from your ear, but the opposite.
 
I need to invest in some eye plugs before reading any more of this conversation
 
Sorta the opposite of a lazy eye -- a hyperactive eye.
 
1:42 PM
@Zgarb Not broken, but I was mentioning that basically the only 2D matching language which has a way of negating the output was Snails, which made it harder for the other languages to do Rectangle Detection
 
Grime has negation.
 
Is it just me or the background doesn't actually show up?
 
Oh? :o
 
A! matches iff A doesn't.
 
@zyabin101 In what context? Do you mean the chat background?
 
1:44 PM
@trichoplax Yup.
 
For me it shows up very subtly - more noticeable when it moves on scrolling
I wouldn't really want it to be any more noticeable
 
@Zgarb Did you want to give Rectangle Detection a shot then? :D
 
@Sp3000 Nah, it's not really an interesting problem for Grime.
And every time I want to use Grime, I remember that I should change its syntax.
 
Hmm, okay then
 
1:59 PM
It's the distro for people who ride their father's coattails to fame.
 
Badum-tsh
Best of Both Worlds Tour was the debut concert tour by American recording artist Miley Cyrus. The tour was held to promote the double-disc album Hannah Montana 2: Meet Miley Cyrus (2007), which consisted of the soundtrack to Hannah Montana's second season and her debut studio album. It initiated in October 2007 and concluded in March 2008, visiting cities in the United States and Canada. The tour was promoted by AEG Live and Buena Vista Concerts. Labelmates the Jonas Brothers, Aly & A.J., and Everlife each served as opening act during the tour. One dollar from each ticket sold was donated to the...
 
@Quill 0/10 quite disturbing.
 
@Sp3000 I patched Grime and made a release. The only thing I changed was option syntax (it uses a backtick instead of comma, so no change for golfing purposes).
Maybe I should request adding it to TIO.
 
:)
 
@Dennis Are you able to add Grime to TIO? It only does file-based IO.
And needs Haskell to run.
 
2:15 PM
@Dennis you should probably make a "How to get your language on TIO" post
 
@Zgarb I don't think he allows the file reading parts to stay, for anything.
@Downgoat:
                                                .--____.
                     ,_____._,                ,~-__,__,;\
                   ,/ /  / /~,\              ~'-_ ,~_/__--\
                 ,~'\/__:_; / ~\,_          /-__ ~\/  \";/,\
                / \ ,/\_\_~\ /  /|,';;;;`,|\  /\/     \=/- |
               ~--,/_/__  \ ~\ |  `._____.'  |/\/     __---=--
              /==/./ \ /\  ;\~\_\          _/\/,,__--'._/-' `
             |==|/    \==\;  ;\|  , \ \ / /L /::/ \,~~ |==|-|
             |//\\,__/== |: ;  |L_\  \ V / /L::/-__/  /=/-,|
 
@EasterlyIrk He means to read the code and input...
 
also what is that supposed to be
 
Yeah, it can't access any files itself.
 
2:20 PM
it's terrifying
a goat mecha?
 
i think so
 
oh wait it's a bighorn sheep
 
mecha sheep
 
^
eh
mechagoat sounds cooler than mechasheep
Other opinions on this suggested edit here? I declined it as superfluous.
 
@Zgarb Could I run it as runhaskell grime.hs code inputor do you need STDIN as well?
@Zgarb Do you happen to know which packages I'd need on Ubuntu?
 
2:29 PM
@Dennis No need for STDIN. Also, you may want to compile it for better performance.
@Dennis I think ghc should be enough.
 
Compilation is done with ghc? Total Haskell noob here...
 
@Dennis Yes, that's Glasgow Haskell Compiler.
 
A lot of the answers on this question use a builtin quine command. Is that disallowed as part of the default loopholes?
 
Then you run ghc -O2 grime to compile with optimizations.
 
It isn't a quine challenge, but similar.
 
2:33 PM
And it produces an executable.
No wait, make that ghc -O2 grime.hs
I haven't compiled Haskell in a while...
 
Idea: reverse king-of-the-hill. The entrants are provided, you must write the game.
 
@PhiNotPi Two bots each holding a signpost which can display any four-digit number from 0000 to 9999.
 
I like that idea.
 
@Zgarb Needed libghc-parsec3-dev as well. Do you have anything handy I could use to test it?
 
There's a couple ways to do this:
1) the bots do something simple (output a number), and I have a large number of bots that do dozens of different strategies (always high/medium/low/alternate/etc.) Then, it's up to the controller to give meaning to it all.
2) I create a complete KOTH by myself, but keep the original controller/spec a secret, only releasing the bots.
 
2:43 PM
Maybe 2 posts like a C&R post, bots and controllers go on different pages?
Like you can start with a couple bots, and people take the info and do stuff with it?
 
The first one sounds like a real easy way to assume favoritism -- you could just program a controller that happens to make X person win.
 
3) Create general-game-playing AIs that can learn strategies based on the game rules that are provided to it, giving more freedom to the users to create a controller.
 
As unpopular as they are, #2 could easily become a pop-con
 
4) Cops-and-robbers, with general-game-playing bots on one side and controllers on the other
 
@Dennis Put d{2} in the grammar file, and something containing a 2x2 sub-rectangle of digits in the pattern file. It should find and print the digit rectangle.
 
2:48 PM
Like this? It says grime: grime.hs:(254,36)-(256,28): Non-exhaustive patterns in case.
 
@Maltysen in pypy it only takes 10 seconds with n= 9 !
 
can you find the pentagon:
@PhiNotPi I've already done this. It was a massive project using temporal difference learning, and learning was slow, but it worked
 
@Dennis Huh? That's not supposed to happen. Let me check...
 
it actually didn't parse the rules, but took the current game state, and learned what good states were and bad states were
 
@Dennis Okay, it's complaining that you gave it the wrong number of command line arguments.
 
2:51 PM
>.< Just a sec.
 
(Maybe the error message should be clearer...)
 
7
Q: Snakify a String

user81655A snakified string looks like this: T AnE eOf ifi ing h s x l A k e r isI amp Sna dSt Your Task Take a string s and a size n, then output the snakified string. The inputs ThisIsAnExampleOfaSnakifiedString and 3 would produce the example above. Specifications s will only contain ASCII chara...

 
@Zgarb \o/
 
Wohoo!
BTW, can you make the debug option give the -d flag to it?
 
If -d prints to STDERR, I can just enable it permanently.
 
2:54 PM
user image
6
 
@Dennis I think it just prints extra stuff to STDOUT.
 
It does. ._.
 
Oh well, you can also set it from within the program.
 
@PhiNotPi Would the competing controllers be scored by how well they distinguish the bots? So the worst controllers would have all the bots scoring similarly, and the best controllers would have a clearly defined leaderboard with few ties or overlaps?
 
@Zgarb Or with CLAs. grime.tryitonline.net/…
 
2:57 PM
Ooh, that's nice.
But anyway, thanks a lot!
 
@NathanMerrill @MartinBüttner may be interested in this for its potential applications in computer graphics
 
its an april fools, apparently there's a pentagon in it, but I can't find it
 
@trichoplax I'm trying to think of a way to score them other than popcon. Ideally, the game (that the users create) should follow the "simple to learn, difficult to master" principle.
 
@NathanMerrill Don't look too hard... If there were any pentagons there would be 12 of them, so if you can't spot one fairly quickly it's almost certain there aren't any.
 
I now can create tag synonyms! which mean I can say that and are alike :D
 
3:02 PM
You're not wrong
 
^
@Katenkyo you also need to have a +5 answer score in that tag however.
 
@EasterlyIrk I wonder what an challenge would look like...
 
@NathanMerrill I'm guessing that they're faking it by taking a regular sheet of hexagons and applying some visual distortion to it, to make it look spherical.
 
@NathanMerrill It's a double April fool - first tricking us into thinking it's possible to tile the sphere with hexagons, and then tricking us into looking for the counterexample on a sphere that isn't really a sphere. It's a work of art :)
 
@Katenkyo idk
Maybe check if a user if alex?
They rate dogs.
 
3:10 PM
Lol. This guy at my office thinks he got an amazing deal on a printer. I pointed out that the toner costs more than the printer itself, and that the comparable Dell costs more but the toner is half as much. He went off and found a great deal on toner, and then I pointed out that the cartidge yield was 1000 pages compared to the 5000 page yield I quoted him. It feels good to be right so many times in one day.
 
rofl
also:
Oh. My. God. 13/10 magical af https://t.co/Ezu6jQrKAZ
The link has a gif.
@CᴏɴᴏʀO'Bʀɪᴇɴ @CᴏɴᴏʀO'Bʀɪᴇɴ @CᴏɴᴏʀO'Bʀɪᴇɴ:
0
A: The plus-minus sequence

Easterly IrkFuzzy Octo Guacamole, 17 bytes (non-competing, uses features later than the challenge) ^^:(C.Zs.aZ.s.-:) This was hard to make, due to client-side errors. But I got it! Walkthrough: ^^ # Get input twice, pushes it to the stack. : # Prints the stack, and since ...

I got it in FOG. \o/
@CᴏɴᴏʀO'Bʀɪᴇɴ done.
 
@EasterlyIrk is it a rickroll?
 
@Downgoat Nope.
Verified by #83.
 
3:25 PM
@EasterlyIrk 8/10 not upsidedown
 
@EasterlyIrk Why doesn't ^^(:C.Zs.aZ.s.-) work? (Or maybe it does?)
 
@trichoplax thanks, I already found that somewhere on the weekend :)
 
@MartinBüttner I spun the sphere quite a bit before noticing the date... :)
 
@MarsUltor any idea why CheddarExperessionToken isn't returning anything?
 
how would you preoptimize a graph so that finding the length of the path between two nodes is as fast as possible?
storing a map of every possible node pairing is prohibitively large
 
3:34 PM
@MartinBüttner Wow, really collapsed the loops.
 
Using #. to output so that we only needed to drag one element instead of two was all Martin's idea
 
@NathanMerrill Would it help to store closest node for each node?
 
paths all have a cost of 1
so all neighbors are the "closest"
 
ah OK
What about storing the neighbour with the highest number of neighbours for each node?
 
@NathanMerrill Maybe storing how many neighbors each node has?
Ninja'd
 
3:40 PM
how would that help?
 
> Experession
 
No idea :)
 
simply select the "high neighbor" firsT?
you are more likely to find him, maybe?
 
It's a higher probability of getting you closer.
 
It would only help for a heuristic as far as I can see - it wouldn't guarantee anything
 
3:41 PM
Right
 
right, but you have to search more paths on the neighbor with more paths
 
Good point
 
.
^ that?
 
That one's not so good. It's OK though
To me that's a full stop/period rather than a point, which would be floating half way up the line
 
anOKpoint
 
3:42 PM
Roughly how much data can we store anyway? Can we do, say, store one edge for each pair of nodes?
 
@NathanMerrill Could you store some data for each node on what proportion of the graph is accessible via each neighbour without passing through the current node again?
 
I'm not sure how that data would like
 
Does the graph have lots of loops? It's not a tree?
 
yes
if you're looking for a more concrete example, consider linkedin. They post how many degrees of separation you are to person A
the graph is connected with lots of cycles
 
Are you looking for the shortest path?
 
3:46 PM
yes
but only the length, not necessarily the path
 
@NathanMerrill Do you need to process a lot of paths that have the same destination, or few different destinations?
 
I can't make any assumptions about the destination or starting point
between any two nodes
 
Okay.
 
If you only need the length, and not the nodes in the path, does that simplify it? I can't quite think how but it seems like it should
 
I'm not sure either, but it could make a difference
 
3:49 PM
If you have some nodes that have a huge number of neighbours (like Erdos or Bacon), then you can get a reasonable upper bound on the path length by adding the Erdos/Bacon number of the two nodes
 
is your graph undirected?
 
Maybe you could identify a small number of "central nodes", such that for all nodes that are far enough away from each other, there is an optimal path between them that goes through a central node. Then you could store the optimal paths to the central nodes.
That may depend heavily on your graph though.
 
yeah, that depends on a graph with a low connectivity
 
do you know/can you determine the graph's diameter?
 
3:51 PM
yes
 
@Dennis do you have any place where to read up on these 'chains' that Jelly uses?
 
I guess with linked-in, you could get loose groupings of people
 
@orlp the github wiki has a tutorial
 
like, is it a standard notation/concept?
or your own creation?
@MartinBüttner I'm more specifically interested in it's concept/grounds than Jelly's specifics
 
@NathanMerrill Well, if you have a graph with high connectivity, then most paths are short anyway.
 
3:52 PM
@Zgarb right, but a BFS will then also have a massive branching factor
 
@MartinBüttner to give an analogue, I'm not asking about Pyth, I'm asking about prefix notation
 
@orlp I took J's and APL's trains and changed their name. jsoftware.com/help/learning/09.htm
 
I mean, essentially, you're wanting the results of Dijkstra's algorithm pre-populated for every vertex.
 
They are a little more useful in Jelly, since all built-ins have a fixed arity, so I can define more types of chains.
 
not necessarily prepopulated, but yeah, more efficient
 
3:56 PM
(I've gotta say, I'm really enjoying the on-topic-ness in here...)
 
oooh, lets say you define loose groupings of people
and you find the shortest path between these groups
no, that won't work.
 
how do you group them? pick a random person, group all people that can be reached in two steps, repeat?
 
what are you guys babbling about?
 
25 mins ago, by Nathan Merrill
how would you preoptimize a graph so that finding the length of the path between two nodes is as fast as possible?
 
Is there a faster algorithm than WFI for all-pairs?
 
3:58 PM
O(n^2) lookup table?
 
@NathanMerrill If you can identify bottlenecks that could work - depends on your graph.
 
25 mins ago, by Nathan Merrill
storing a map of every possible node pairing is prohibitively large
 
does anybody know how wolfram alpha does the friend grouping here:
 

« first day (1893 days earlier)      last day (2952 days later) »