« first day (2225 days earlier)      last day (2611 days later) » 

4:02 AM
a.pop returns nil if array is empty, so I can just a.pop || 0
 
In java that's a compiler error
 
Yeah, but Ruby is awesome, so there's that
 
@CheckOutTomato Loops make, well not much sense.
 
Well, where does test get it's input, and how does the program know what test output?
 
4:09 AM
Every loop, the test is performed, then the top of the stack is checked. If it is truthy, the loop continues. If it is falsey, the loop ends (breaks)
 
Peek or pop?
@CheckOutTomato So, no actual need for a seperate condition block
 
@Pavel Huh?
Test is what is before the colon. Loop body continues after the colon.
 
Pls provide example of loop
 
eventually I will end up with a compiler that just translates Tomato to Ruby, then runs the Ruby code.
One sec, let me write one.
0Ydo{La:paY}
@Pavel Counts down from number to 0
This is... definitely an esolang. :)
 
yodo		# Read from STDIN a number
-1no 		# This will be the incrementer, so lower it by one
pa			# Duplicate the top of the stack
1no 		# But leave the other two as the original number.
pa			# Twice
{-1nupupapu-2no:# While the decremented bottom of the stack is truthy, leaving one of them on the top of the stack
	2no		# We subtracted two from that incrementer before, so that it would skip 1. Undo that.
	zo		# Modulus
	(to)?		# if the top of the stack is 0, thus, this is a factor.
	("AHHHHH, NOT A PRIME"Yo)
That should theoretically check primes.
 
4:16 AM
Ok, does {:Y} print the stack (or until it gets to something falsy)?
 
If it's a prime, there's no output, otherwise, there's potentially server "AHH NOT A PRIME"s printed.
 
@ATaco +1 for yodo
 
@ATaco Syntax errors all over the place.
 
I'm writing it as I read the spec.
You get me an interpreter, I'll get you code.
 
Comments are `text` not #text
#text only works on the first line, to allow for shebangs
 
4:19 AM
Why
 
hey, if you want me to do that
i can allow the comments to be # on every line
should I?
 
Why not
 
parsing
 
The way eLisp does it is it's a comment if it's the start of a line.
 
I can just delete all \n#.+\n
 
4:20 AM
@Pavel reeeally needs to be yoda instead
 
thanks pavel
 
It can theoretically be yoda without any problems.
 
@Pavel yes
...no
it ends up printing half the elements, since the loop pops the test's result
 
o
 
Oh,the loop is poppy?
 
4:22 AM
{:aY}?
 
something like {pa:Y}
 
no wait that's silly
 
yodo				# Read from STDIN a number
-1no 				# This will be the incrementer, so lower it by one
pa					# Duplicate the top of the stack
1no 				# But leave the other two as the original number.
pa					# Twice
{-1nupupapu-2nono:	# While the decremented bottom of the stack is truthy, leaving one of them on the top of the stack
	2no				# We subtracted two from that incrementer before, so that it would skip 1. Undo that.
	zo				# Modulus
	(to)?			# if the top of the stack is 0, thus, this is a factor.
 
Is there a way to print the stack? You can't distinguish 0 from empty.
 
{pa:y}up
 
@MistahFiggins Syntax error, unfortunatly.
 
We can't add vowels to constructs.
 
@Pavel I replaced the goat with a test for empty.
 
Coolio
{goto:Y}
Y and y should be switched.
What will you do more often, print or take input?
 
Take Input, you don't own me
 
4:26 AM
No idea, but that will break all existing programs.
 
>_>
 
Anonymous
I don't think changing your username to promote a product is really appropriate for SE
 
Anonymous
Even if it's a non-commercial, open-source programming language
 
nice photoshop skillz
 
4:30 AM
I need to give RProgN a logo.
 
Can't be open-source if there is no source
 
@Riker MSPaint lol
 
@Mego It's been like that for a couple days, unless mods can change usernames it's not fixable for a month.
 
Anonymous
@Pavel Mods can change usernames, and have done it in the past for certain cases
 
@Mego I can't really see a problem with it...?
 
4:33 AM
There is also the fact that it's not causing any issues, yes.
 
Anonymous
Changing your username to promote a product is borderline spam imo
 
I was only going to keep it like this for a month.
@Mego "Product"
It's not like I changed my username to "Inexpensive Computers"
 
@DJMcMayhem I answered your VBDay in Jolf. 7 bytes behind lol
 
@ConorO'Brien I was literally just typing a message about that lol
 
xD
now I need to study for my chem test tomorrow. o/
 
4:39 AM
Your Jolf begrudgingly wishes V a happy birthday! Made me literally burst out laughing. :)
 
@DJMcMayhem I've been trying to learn Emacs Lisp today just so I can answer that challenge.
@CheckOutTomato Someone needs to draw an ASCII art tomato
                   ,
                  /.\
                 //_`\
            _.-`| \ ``._
        .-''`-.       _.'`.
      .'      / /'\/`.\    `.
     /   .    |/         `.  \
    '   /                  \  ;
   :   '            \       : :
   ;  ;             ;      /  .
    ' :             .     '  /
     \ \           /       .'
      `.`        .'      .'
        `-..___....----`
nvm, found one.
 
5:15 AM
let me design one
 
That looks like a Pumpkin.
 
@ATaco As far as I can tell, it is the only Ascii art tomato on the internet.
 
6:11 AM
@DJMcMayhem Happy birthday, V! Now in a month and a half, I'll have to come up with a birthday challenge for Pip. Hm...
 
DAE ever change their password, then type the new one accidentally?
 
6:33 AM
@CheckOutTomato you should make a way to apply multiple vowels to a consonant.
 
7:00 AM
Hello
 
7:11 AM
Is it possible to have a loop in 1D cellular automata?
 
@Qwerp-Derp Well, there has to be something akin to a loop, at least, for Rule 110 to be considered Turing-complete. But I don't know what that would look like exactly.
 
So, like a "clock" of repeating states, which doesn't stop or evaluate to anything.
I'm not sure if those exist, because altering one cell alters all the cells next to it as well
 
hi I need help with a thing
 
@Pavel That's supposed to be one of the difficulties, and what makes it an esolang. You can't just apply one vowel.
 
so, say I have 1/11, and 3/32, I add the numerators and the denominators for 4/43. how would I write this as a function?
in proper maths
(/ spreadsheet maths)
 
7:21 AM
@DestructibleWatermelon What do you mean "in proper maths"?
 
@Qwerp-Derp If you're looking for a periodic configuration in an elementary cellular automaton, those are pretty easy to come by. (E.g., have a rule where 010 -> 1, 110 -> 1, 011 -> 1, 101 -> 1, 111 -> 0 and give it an initial configuration of 01010: you get a period-2 oscillation.) If you're looking for a periodic configuration in a Turing-complete ECA, probably a lot harder.
 
@DLosc Nah, just this is fine. Thanks!
 
@Qwerp-Derp no awful hacks
 
@DestructibleWatermelon I'm still confused... do you want a MathJax thing or what?
Or like an Excel formula?
 
DestructibleWatermelon-- Let me paraphrase to see if I understand what you're asking. You have two rational numbers, x and y. Let x = a / b and y = c / d. Are you asking for a formula in x and y that results in (a + c)/(b + d)?
 
Anonymous
7:29 AM
@DestructibleWatermelon I'm assuming you want decimal input/output. For rational numbers, there are two cases: terminating decimals and repeating decimals. For terminating decimals, it's easy: write the value as a fraction with denominator 1, multiply by 10/10 until the numerator is an integer value, and reduce by dividing the numerator and denominator by their gcd. For repeating decimals, there's a well-known method.
 
Anonymous
So then you have a, b, c, and d (where x = a/b is the first input and y = c/d is the second input), so you can compute (a+b)/(c+d).
 
Anonymous
Now to get a formula for that algorithm, you just have to combine the various steps together
 
Anonymous
The method for computing the numerator and denominator of a repeating decimal works for terminating decimals too, so you don't even need the distinction between the two
 
@Mego What langs do you usually program in?
 
Anonymous
@Qwerp-Derp Python, C, JS
 
7:33 AM
In unrelated news, I made a sidebar thing in Clojure and CLJS!
 
Anonymous
@DestructibleWatermelon The trouble with that "addition" scheme is that you have to restrict it to reduced fractions, or else the "addition" of any two values could be computed as their arithmetic mean
 
'eyy wassup bois
 
@Mego cc: @DestructibleWatermelon Note that this is an algorithm rather than a function. I doubt there's a closed-form formula for it.
 
wait of course I realise the issue now
what I asked for is actually impossible
because no way to tell the difference between 1/2 and 2/4, and no way to make the weighting work right...
 
Anonymous
7:41 AM
@DestructibleWatermelon It could work, but, like I said, you'd have to restrict it to reduced fractions
 
yup, but thats entirely useless for my purposes
I asked stupid question.
 
 
1 hour later…
9:07 AM
Doing Zanada even though it's really old :(
For anyone who's played it, I'm currently on level 11 now
 
@Downgoat That's why I alias rm="echo \"You can't use rm\" #"
 
alias rm="echo \"You shouldn't have done that.\";rm -rf / --allow-root"
 
9:53 AM
0
A: Sandbox for Proposed Challenges

milesThe Clock Game Twelve people are arranged in a circle like the numbers of a clock. 12 11 1 10 2 9 3 8 4 7 5 6 One of these twelve people is the chosen one while the other eleven are not. You will ask each of these twelve people whether or not the...

 
10:04 AM
@KritixiLithos then how do you remove stuff
 
@betseg alias kkjjhlhlab="unalias rm"
 
Wow
 
G B
10:25 AM
/bin/rm
 
can someone help with this argument ? codegolf.stackexchange.com/questions/111613/…
please
 
That's ... an interesting loophole abuse.
 
yes!
 
G B
No, it isn't
 
Is it an uninteresting one then?
 
G B
10:33 AM
This is almost identical to my answer
Which I had to change because of a similar comment
If a method is not static, then the object it's called on is an argument.
 
@GB please add a comment :)
although the person is being downvoted to oblivion too I see (not yet by me)
 
G B
He has to learn it the hard way. :-)
As I did.
 
I am not sure Check Out is a boy's name :)
or Check?
 
G B
Read his profile.
Actually, I think he's just trolling. :-)
 
:)
I am still not sure which answer I am meant to accept
if it's really the shortest one then it seems I am not needed as the system could do that
 
 
1 hour later…
11:45 AM
@Riker talk about math/science/anything other than ppcg :)
 
 
2 hours later…
1:19 PM
0
Q: 'Press any key to continue' in Java

bruceleefinalkungfuYour goal is to create a program displaying Press any key to continue and as soon as any key is pressed with or without the exception of ctrl, alt, caps lock, etc, program should terminate. Language used is restricted to ONLY java. 7, 8 or any of its version is allowed.

 
@NewMainPosts Too late.
 
It was still open for a few seconds after New Main posts submitted it
 
Ninja'd by Dennis by 11 seconds…
 
I like how because the post is tagged that the "Related" links are things like Code Bots 4, or Battle of the Fellowships
 
2:03 PM
That's because KOTHs often require the use of Java.
 
2:26 PM
lol, I'm really tempted to link this challenge on CR and direct them to write it as a challenge here
 
0
Q: Can I use static initializer in Java for code golf?

WinterHere's an example of a static initializer in Java. It is possible to launch a program without a main method in Java using a static initializer and it's way shorter. It doesn't work on ideone.com but in command line or in my IDE, my code in static is executed even if I have no main. The JVM throw...

 
@NewMetaPosts I predict he's using Java 6
 
2:51 PM
@Poke You still use 7
 
I don't see how that applies here
 
hahaha
 
On the upside I got 20× more visitors on Brachylog's repo after that answer was posted, so I can't complain
 
Wow. The V question was really well received. It got like 20+ votes while I was asleep
 
:o
 
a) it's a milestone achievement, and folks are upvoting for that, and b) it's a pretty nifty question in and of itself
 
3:27 PM
Eyy wassup bois
(Maybe I should quit talking like this :\)
 
prolly
>_>
 
The number 6 somewhat resembles delta (a greek letter)
 
0
Q: Should Java Applets include HTML in the byte count?

ZavadaI'm curious whether or not the HTML required to run applets should be included in byte count. Also what's the current standard for counting bytes with applets? In Eclipse if I recall correctly you can run applets without HTML, however in other IDE's you need the HTML.

 
δ 6
Eh, kinda?
 
@MatthewRoh it also kinda resembles a backwards Eth: ð
 
3:30 PM
I thought it kind of does resemble each other
 
big big jpg
pls no onebox
is spazzing out my ipad tho
 
@DJMcMayhem btw d in delta is pronounced as eth
 
@Downgoat thx
 
@Riker It's JPG but done :P
 
3:32 PM
@Downgoat You brain borked BorkBork
 
@Poke Update your Java
 
BorkBork is BrainBorked so its now BrainBorkedBorkBork?
Ehh, Its becoming a tongue twister
 
@Pavel It's mostly that I prefer not to golf with lambdas that I stick with Java 7.
I like having something that you can copy/paste and run
 
Δ + ⊙ = Illuminati..?
 
Woah. Dr Seuss's birthday was March 2nd. That's hilarious
 
3:38 PM
Really
btw Dr Seuss is a creator of some memes like the lorax
 
s/memes/books s/some/many
Of course I know who Dr Seuss is
 
A cat which knows Dr Seuss: normal.
 
Is /dev/random/ just machine noises which somewhat resembles a random number generator
 
no
it's a random number generator
 
3:44 PM
but yah if you don't read it right then it goes wonky
 
Then what's the difference from random and urandom?
 
tl;dr: one "blocks" when low entropy (random does)
which makes it less secure for many purposes
somebody linked an article a while ago (on the starboard), look around there
 
Define secure. The data from urandom isn't actually random.
 
@Dennis eh? in most cases it provides high quality randomness
 
So TL;DR: Both gets data from entropy, but urandom doesn't wait for high enough entropy, being not totally random-ish?
 
3:48 PM
@Poke High quality or not, pseudo-random is not random.
 
it's all pseudo-random
it's being done in a computer
iirc random and urandom both use the same CSPRNG
 
iirc Entropy is a source which generates random data, like the noises by the machine itself?
 
you only need to worry about the csprng being properly seeded right after boot while you're still gathering entropy
 
However its true random is more random-ish than urandom
 
how
 
3:53 PM
There are applications for urandom and for random, but we cant (for now) prove which is more random :P
 
@Poke But random uses only actual entropy gathered from hardware (e.g., mouse movement). I'm not saying urandom isn't secure (with 256 bits or entropy and a good PRNG, you can get all the pseudo-random data you'll ever need), but that doesn't make it random.
 
So the difference is entropy vs prng seeded with entropy?
 
a prng is random enough when properly seeded except when you're actually defining "true random"
hardware like mouse movement isn't random
there are tendencies for that
 
If it gets down to human level, yes.
But even slight differences when repeating tendencies generate different entropy.
So I could as well assume human level is random enough. Hackers obviously couldn't know what physical tendencies a human has anyways :)
 
Actually we should rethink what we define as random
True randomness may not exist
 
4:00 PM
i basically said that already >.>
 
What we think as random may not be random
 
@Poke It actually is, as mouse movement is influenced by a lot of external factor
 
Even human made randomness may not be random
 
And if you want true randomness from hardware a mic would work pretty well
 
just because you don't know the pattern or algorithm doesn't mean it's random
 
4:01 PM
Nothing should be defined 'true' random
 
^
 
Background noise from a mic is random
 
Nothing should be defined "random" at all.
 
Prove it
 
A dice roll? It depends on external factors, such as throwing force, friction, other forces.
 
4:02 PM
(Not you, erik, but tux)
 
Oh. I intended to put that after my message anyways though.
 
Okay then :)
 
A die roll may not be truly "random", but it is unpredictable in most circumstances
 
The output of a micro isn't predictable as the output is influenced by different natural factors which are unpredictable.
 
4:06 PM
Unpredictable by human intelligence does not mean truly random though, there can be constant complex patterns that just bork your mind down.
 
random != unpredictable
 
you cant predict something thats really random
 
> Randomness is the lack of pattern or predictability in events.
 
What I meant is, human made things may not be random, we have to use truly random factors such as the nature
 
> made, done, happening, or chosen without method or conscious decision
 
4:08 PM
I need a goat meme and fast
 
So, mathematically: random => unpredictable?
 
Yes
 
Random things are unpredictable, unpredictable things may not necessarily be random
 
@ChristopherPeart go on imgur for that
 
Nope, otherwise it would be random <=> unpredictable, which it isn't.
 
4:10 PM
They had no goat memes
just pictures of these adorable goats
 
But there is a difference between what humans can predict and what is predictable by math
 
@MatthewRoh But the definition of random is that it's unpredictable ...
 
GOAT means Greatest Of All Time
@BusinessCat true
 
There are some memes there.
 
@AdmBorkBork i don't think that's true
 
4:12 PM
@Poke Yes it is
 
random: unpredictable by any means
 
@AdmBorkBork the definition of unpredictable is not that its random, its just not predictable
 
picking a random number 1-10 you could choose the number two 100 times in a row
if i saw a run of 2's like that
i would predict another 2 unless i had more information
 
Given enough trials it will happen
Assuming it's truly random
 
4:13 PM
If you see 100 2s in a row you will probably start to question the generator...
 
given enough trials 100000000000 twos in a row will happen
 
6 mins ago, by Poke
> made, done, happening, or chosen without method or conscious decision
 
So you mean like a thunder striking the same place 10000000000000 times in a row? Hell no.
 
That's what random is
 
4:14 PM
doesn't mention predictability at all
 
The Nineteenth Byte onebox theory states: "If you don't want a onebox you gonna get oneboxed. If you want a onebox you will not get a onebox"
 
Citations (^)?
 
@Poke That is literally what predictability is. If something is happening with a method then that means it's predicitable.
 
If something is made, done, happening, or chosen without method or conscious decision, it would be truly random. However, no man could do that (Not even random or urandom!) so nearly nothing should be random
 
predictability is just the ability to be predicted
a prediction is an estimate or guess of something happening
there doesn't need to be a method
 
4:18 PM
Even nature has methods.
 
@EriktheOutgolfer I am the citation
 
If you are making a theory yourself, you need to prove it too.
 
@Dennis
 
@AdmBorkBork Ohh boy, a typo
@Haunted ._.
 
sorry that was a typo.
 
4:20 PM
@Poke That's the rub, then. You're using the English definition, not the mathematical definition.
Like the word "Theory"
 
Uhh, you're kinda breaking this "argument"
 
if you're given a function foo which, when called several times, returns the number 4 each time, is that a random function? It's predictable but it might also be random
 
@EriktheOutgolfer I posted a link that I wanted oneboxed. it didn't onebox
 
i guess there is a method, then
but it may not be the correct method
the method in this case is that i see that result a lot so it must be constant
 
Theres just typical types of hyperlinks which will be oneboxed
Probs upload on imgur?
 
4:23 PM
Oneboxing isn't a general thing, it only works for specific websites.
 
pretty sure oneboxing works with picture extensions
 
@Poke having 4 a thousand times doesnt mean there won't be a 5 somewhere
 
Imgur will work, but then it would be better to just use the "upload" button next to the "send" button in the chatroom directly.
 
@MatthewRoh exactly
it could be random and predictable
your prediction might be wrong, though
 
Uhh, what? You're confusing me
 
4:24 PM
@Poke But that's not what "prediction" means as a mathematical term.
 
my argument is that randomness and predictability are not the same
 
If a prediction is wrong do we call it a proper 'prediction'
 
Hello everyone. I am very fascinated looking at the codegolf challenges and in particular the awesome answers. The thing that fascinates me more is the way you guys think, the algorithms that you guys apply, it just wows me. I am looking forward to start involving in the golf challenges.
Can you guys please guide me on what is that I need to focus more on solving these challenges. Is it Mathematics? Algorithms? Data Structures? If there are books to build my base on these subjects, that would be awesome too.
 
@AdmBorkBork in math terms you can't evaluate a black box function as predictable or not
you need more information
 
I am sorry if my grammar is not correct or my question sounds stupid.
 
4:26 PM
I would say that you can't determine if a black box function in mathematics is what you think it is.
 
@Haunted The specs of the questions are most likely stated in the questions
 
@Haunted personally i've seen a lot of challenge answers that benefit from knowing a lot of mathematics
 
@Haunted Lotta math. I have links to some easy oones
 
not including those, it's about knowing the ins and outs of the language you want to use
 
Easy challenges that is
 
4:28 PM
@Haunted A good understanding of math algorithms (and how you can apply those algorithms in new ways). Also, understanding the language you're using and reading the on that language.
 
@Haunted I go with maths too, personal experience shows.
 
@Poke Uh, right. And?
 
@Poke - Thank you. I have started re-learning Mathematics and I am taking course on Python.
@ChristopherPeart - Thank you, Chris. Easy ones as in easy challenges?
 
Yeah, I agree that math is very, VERY important in generally coding
 
@AdmBorkBork so that doesn't help/hinder my argument at all
 
4:30 PM
@Haunted yes
 
We could teach math if you please
 
@Poke This argument is dependent upon the function being a black box. Thus, mathematically, it has to be non-predictable, and is therefore random.
 
@AdmBorkBork @EriktheOutgolfer - Thank you so much guys.
 
@Haunted Welcome to the site! :) There's also this page, for some good starter tips
56
Q: Tips for golfing in <all languages>

ajax333221The aim of this post is to gather all the golfing tips that can be easily applied to <all languages> rather than a specific one. Only post answers that its logic can be applied to the majority of the languages Please, one post per answer

 
http://codegolf.stackexchange.com/questions/107709/press-any-key-to-continue
http://codegolf.stackexchange.com/questions/109865/notcalc-calculate-the-wrong-answer
 
4:32 PM
@MatthewRoh - You can teach maths?
 
two easy challanges
 
@DJMcMayhem - Thank you so much DJ. :) Appreciate the help
 
@Haunted Well, yeah, I'm not really anyone to really teach math but I can if you please
 
@ChristopherPeart - Thank you so much. Appreciate the help on the links.
 
I'm just an ordinary middle school student which learnt a lot
 
4:34 PM
@MatthewRoh - Any good book should be fine. You are kind. Thank you.
 
@Haunted The other thing -- just start in and answer a challenge! Challenges that already have a lot of answers tend to be easier (in general), so they may be a good way to begin. In general, we Assume Good Faith and allow duplicate answers, so don't feel afraid of coming up with a solution that's similar to an existing one. Don't copy an answer verbatim, however, that's a social taboo.
 
You don't need to learn that much, people here tend not to put calculus or some hard as heck math in their questions
 
@AdmBorkBork - Thank you. I will start very soon. :)
@MatthewRoh - Sure. Thank you. :)
Everyone, you all are very kind and helpful. Thank you again.
 
No problem, just ask here if you don't know something about a challenge
Also we have a meta to discuss about the site
 
@Haunted if you want to post a challenge post it in the sandbox first
I made the mistake of not doing that
 
4:40 PM
Me too, 15 dislikes is a PITA
 
@Haunted codegolf.stackexchange.com/questions/102618/… one I wrote that is pretty simple
@MatthewRoh CC: yeah that is the one I did first
It took a meta post and a lot of discussion before it worked
 
:\
Wait did we tell him about the 'legendary' tetris challenge
 
No I don't think so
Lets not
 
Sure
 
Will that ever really start up again?
 
4:53 PM
I don't know
But CA golfing is a thing now, thanks to that question
 
@Dennis I was under the impression that is was still more secure to use urandom
 
bash added the PS0 variable that resembles zsh's feature
i couldnt find that feature in zsh
 
@Riker Again, what you mean secure?
 
Does secureness matter in RNGs
@Dennis prolly 'advanced' or 'random'?
 
@Dennis more random
bad word choice
@Downgoat why do you always manage to do very bad things to files
 
4:58 PM
Now that windows put bash in themselves, did linux dominate windows or is it the other way
 

« first day (2225 days earlier)      last day (2611 days later) »