« first day (1693 days earlier)      last day (3142 days later) » 

1:04 PM
'Taking a function f as its only argument, call/cc takes the current continuation (i.e., a "snapshot" of the current control context or control state of the program) as an object and applies f to it.'
Ew that snapshot sounds so inefficient
what even IS this
 
math
 
@Fatalize I gotta learn that
I can't see how Scheme is...wh...why do people call this minimal
Ideal programming imho should compile to only what you actually wrote
 
If a program compiles to only what you wrote, isn't that the same as not compiling at all?
 
@Rainbolt that was badly phrased...I just dislike it when you compile a hello world program and it's 1.5mb
 
1:20 PM
hi .. i am stuck with this puzzle problem .... i saw a lot of solution on internet but curious to know how i am wrong
Given a string, return true if the first instance of "x" in the string is immediately followed by another "x".

doubleX("axxbb") → true
doubleX("axaxax") → false
doubleX("xxxxx") → true
my SOLUTION
boolean doubleX(String str) {

for(int i=0; i<str.length()-1; i++){

if( str.charAt(i) == 'x' && str.charAt(i+1) == 'x') return true;

}
return false;
}
 
} else {
return false;
}
 
i know ds iz nt java programming chat room... i still expect some useful answers !!!
@jrenk i dont undersntad .. i only what to use if statement ..
i tried debugging .... but fail to undersntad
 
pfeehh, you're using ==
eheheheheheheh
 
== is fine for char primitives.
 
yeah
char is not a class
 
1:24 PM
...can't java at least be CONSISTENTLY wrong
 
It's wrong because it doesn't just check the first x, that's all.
 
it's also gonna crash for the last i
 
Why? It's only running to <length()-1
 
it has a charAt(i+1)
 
Right... that's why the -1
 
1:27 PM
oh yeah nevermind
 
[continues inspecting Java code that is indented in classic Java style]
 
@user143252 if(str.contains("xx")) {return true;} else {return false;}
 
@Fatalize return str.contains("xx");
 
That still doesn't check the first x only.
 
jeez yall are weird
 
1:28 PM
wait
I didnt even read what was above the code
 
Is this ?
 
it's easy in python
 
@cjfaure It's easy in Java, too.
 
x=lambda s,c:c==s[s.index(c)+1]
 
@cjfaure It's easy in PHP, too.
 
1:29 PM
str.split("x")[1].startsWith("x")
 
@jrenk lmao
 
add some checks too
 
0
Q: Print a table of numbers in decimal and 2**i bases

CaridorcComputers live by binary. All programmers know binary. But the 2**x bases are often neglected as non-practical, while they have beautiful relations to binary. To show you one example of such a beatiful relation, 19 will be my testimonial. 19 10011 103 23 13 j 19 is decimal, included for cla...

 
1:43 PM
Why does Java not have a simple string multiply/repeat method? I mean FFS, it's pretty basic.
 
@Geobits at least it has proper ternary
 
@Geobits you mean like "lol" * 3?
 
^ yea that
 
today in: EA vs Ubisoft
 
well could be useful but Java still has plenty of useful built-in things
 
1:44 PM
Even "lol".repeat(3) would be better than the nothing that currently exists.
 
compared to C++ where std::string doesn't even have a split method...
 
Here's the top answer on SO for it in java:
new String(new char[3]).replace("\0", "lol")
 
EW
 
Yes.
 
brb taking a shower because that's gross
 
1:49 PM
that's actually a pretty cool way to do it
ugly, but cool
 
@Fatalize admittedly yes but there...isn't a single acceptable thing about it
the Wordbuilding stackexchange is full of meat lovers
 
"you're going to eat that chicken and you're going to like it..."
 
2:09 PM
@Geobits I love that "simple" and "basic" take on a new meaning after you have been on PPCG for too long.
 
i don't think BASIC had a string multiply method
 
I still think for (int i = 0; i < 3; i++) { sb.append("lol"); } is simple, but I don't golf much
 
It looks even simpler when you remove the StringBuilder init ;)
 
You didn't declare your string either
 
cringe
 
2:13 PM
Oh, right. I'm trying to use directly (like thatcode.stringfunction()).
I just need a bare string.
 
i don't use java and whenever i see stringbuilders it makes no sense to me
 
@Justin C++ understanding is not a poset. No-one knows the whole of it, and probably no two people know the same subset of it.
 
i don't know why you would use one instead of a regular string but again, i don't use java
 
Generally either speed (faster append/concat) or methods that regular strings don't have.
 
They are logically interchangeable. StringBuilders exist for performance reasons
 
2:16 PM
Ooooh god...
 
if they're the same, why not just always use strings but have them act as stringbuilders on the backend?
 
There's probably a backwards-compat explanation somewhere, but I couldn't tell you for sure.
 
If you wanted to print out the string every iteration of the loop, then the StringBuilder saves you nothing (might actually make it worse)
 
it doesn't make sense to me but i'm not someone it has to make sense to so oh well ¯\_(ツ)_/¯
 
Strings are supposed to be immutable
 
2:18 PM
@feersum I was gonna mention that but I haven't touched Java in a while
 
And Strings have a lot of other functions that StringBuilders don't have
 
@PeterTaylor i despise the country i live in with every cell in my body
 
Let's say that they made it transparent and then the developer says "When I call .replace() suddenly the code gets way slower. Why?" and the answer is "Because we use StringBuilders behind the scenes, but when you call replace() we convert it to a String and [...]"
 
"When I launch Java suddenly the code gets way slower."
fixed it
 
2:21 PM
Java Python
Java is probably one of the faster languages seen on this site at least :P
 
sometimes i think about performance but then i remember that i only use python
so it doesn't matter
 
I always find it funny when people are trying to improve performance of Python code.
 
for me
i hit enter instead of shift
 
@undergroundmonorail python is slow as hell but...it's for quick utility scripting...have you ever tried quickly scripting utilities in Java
 
Exactly.. Python is good for code-writing performance, not execution performance
 
2:23 PM
for me "improving performance" is "making the whole algorithm better" but i don't bother with anything more than that because even if i make a difference it's negligible
i really like python, don't get me wrong, but because i use it so much i could do nothing but complain about it for hours :D
 
sameeeee
although my only true complaint is tHE DAMN TERNARY OPERATOR
 
the ternary operator is garbage
 
I implemented Angel and Demon in Python and Java in one of my contests. Angel printed "Good". Demon printed "Evil". The python one took 200 ms on average. The Java one took 20 ms on average.
Granted, the controller was written in Java, so the JVM was already running
 
that seems slightly biased eh
 
The only function is to print a string?
 
2:26 PM
honestly [on_false, on_true][condition] is a better "ternary operator" than the one you're supposed to use
 
yea. print("good") in Python. and I don't even want to type out the java one...
 
also you probably timed it after reading the stdout via the java controller
so you have some java latency in there lmao
 
You could probably get Python to win too, if you syscalled Java from Python, lolz
 
@cjfaure I timed them both exactly the same. The controller code changed exactly none between tests
It accepted two arguments - the program and the program that runs the program. Ex: python Angel.py
 
@Rainbolt did the java one use stdout too though?
 
2:28 PM
i'm not going to say python is faster than java because that's definitely not the case, but i think timing really short programs is probably less fair than timing longer ones because if all you're doing is printing one string, the startup time for each language is going to be a lot more significant
 
@undergroundmonorail ye, python has to generate bytecode after all
 
@cjfaure They all used stdout. If you printed to any other place, the controller wouldn't know you said anything.
 
@Rainbolt ah, i see~ nevermind that then
 
I'm gonna rerun the test in C# just to eliminate the bias.
 
A 10x speed difference between Java and Python isn't unusual.
 
2:30 PM
I always assume that when people says Java is slow, they mean slow relative to the C family of languages
 
python is slow but somehow you never notice
although, moving from python to C is weird as hell because
"iterating over every byte? in this HUGE file? this is gonna take 10 minutes to run..."
and then it runs instantly
facedesk
 
43
A: Convert Python program to C/C++ code?

Lennart RegebroYes. Look at Cython. It does just that: Converts Python to C for speedups.

 
i'm not saying python isn't slow, i'm not even saying that the test results are incorrect, just that they could be incorrect because of the way the test worked
 
Why was the name merge done using prefix of C and postfix of Python ? I want the other one
PC
 
Cython is the mean-ness of C combined with the...less than optimal for complicated things...syntax of Python
 
2:32 PM
Cython > PC
 
Pytoc
 
I like Pytoc/Pythoc better
Sounds barbaric
 
PytoC
 
CPcyctchcocn
 
@Optimizer That reads PIE TOE SEE
 
2:33 PM
@Rainbolt better than PEITOK
 
P
 
:P
 
better than SIGH-THON
 
^
5
 
y u "^" and no star
meanie
you all have terrible aim
 
2:34 PM
You knew better than to ask...
 
sorry, I meant to flag the "meanie" instead of starring. I guess, my aim is terrible
 
I bet that Doorknob will remove it from the transcript. He's the youngest boring old man ever.
 
:P
 
@Rainbolt but i did anyway because i wanted to say "meanie" today
 
When I was 15, I was a scab on the ass of the Internet.
 
2:36 PM
Some people never change :P
 
Ouch. You pierced my heart Geobits.
 
honestly looking at my old starred messages, I was so much better than I am now a year ago
 
I think I was busy conning people in Diablo 2 now that I think about it.
 
why did I have to discover tumblr
 
I knew how to make people drop their entire inventory on the ground on death in Diablo 2. And I'd claim that I was helping them dupe their items.
 
2:38 PM
Ah, Diablo griefers... that takes me back :D
 
@Rainbolt the world is full of MEANIES
 
I'd get in the good ranks with clans, and people would ask me to help them transfer their items between chars. I'd steal it all and run and find another clan
 
my mom asked what we were talking about in here
i got away with "code"
 
My day on PPCG so far:
1) Found a somewhat interesting challenge
2) Wrote a program, golfed it
3) Decided not to post it
^ Absurdly typical
 
I do that often.
 
2:44 PM
I normally do that except i abandon it at def f(x,y):
 
I don't half-ass my ultimately pointless activities.
3
 
@Geobits Isn't half-assing code how golfing started in the first place?
 
@Geobits According to the transcript, neither does Optimizer
 
I think golfing was started by the Scots long ago (and yes, to half-ass code).
 
@Rainbolt it took me too long to understand that
 
2:55 PM
Is anyone else rewatching all of Heroes in preparation for the new season/show/whatever we are calling it?
 
Nope, I've been rewatching DW for the new season.
I only watched the first season or so of the original Heroes, so I'm not sure whether to bother with the new one.
 
I can't think of what DW is
Of course... Doctor Who
 
I guess it could be Dino Wars, too, but yea I meant Doctor Who :)
 
3:11 PM
so if One Piece gets new season, am I supposed to re-watch all the 700+ episodes?
 
If you want to. Nobody's forcing me to rewatch, but it's been a few years since I saw them in order.
I've also been watching Dragonball with my kid. Very nostalgia-inducing.
 
if I start re-watching now, it will be a few years before I can start on the new season
 
at least nobody's going to try to rewatch Judge Judy
 
I wrote my first challenge!
3
 
:O :O :O 5K+ episodes??
 
3:14 PM
I way, way, way over-specified it.
Which is probably better than the opposite
 
I thought pokemon or one piece would be one of the highest!
 
@Optimizer indeed, it's insane
 
Now it looks like that I also wrote my first challenge right now :/
 
This is a list of episodic television programs by episode count with 150 episodes minimum. Episode numbers for ongoing daytime dramas, such as soap operas, are drawn from the websites for the shows. Daily news broadcasts, such as The Today Show and Good Morning America, are not episodic in nature and are not listed. == Television programsEdit == Note: This list is still incomplete. You can expand it. === Over 10,000 episodesEdit === === 5,000–9,999 episodesEdit === === 2,500–4,999 episodesEdit === === 1,000–2,499 episodesEdit === === 550–999 episodesEdit === === 300–549 episod...
Guiding Light is over 18k
 
Nice, I have never even heard of it
 
3:17 PM
Daytime soap opera
 
@Geobits and the one that's longest and still running (e.g. eligible for rewatch) is General Hospital
 
Good to see our Familie on that list
 
Aah, Egoli is on the list too :D
and 7de Laan
i grew up on these
 
4
Q: Track listings to time tables

MaurisIntroduction Don't you hate it when someone uploads an album you like to YouTube, but the description only contains a track listing? Like this: 1. Everything in Its Right Place - 4:11 2. Kid A - 4:44 3. The National Anthem - 5:50 4. How to Disappear Completely - 5:55 5. Treefingers - 3:42 6. Op...

 
@cjfaure you grew up on those and they grew up on you
 
3:20 PM
@Optimizer ow
 
Lol Eat Bulaga!
I can just imagine someone rewatching ten thousand episodes of a show and then their jaw drops when that guy from twenty years ago just walks in and says "Did ya miss me?"
 
@minxomat Great!
 
@Rainbolt oooh damn
it's like audrey hepburn in the Galaxy commercial
 
Wow, codegolf.xyz is neat!
 
@Mauris no it's full of meanies
 
3:31 PM
It can be neat and full of meanies.
 
@Geobits that's called parliament
 
3:42 PM
parliament is never neat
 
1
Q: Re-arranging M stacks into N

user221287In a small Textile manufacturing unit, there are 'M' stacks of folded cloth materials on the left hand side of the room that need to be distributed into 'N' stacks towards the right hand side of the room. Each of the 'M' stacks has it's own length of the clothes and it's own frequency. For the s...

 
@Mauris Is the extra space at the end of track 21's line intentional?
@MartinBüttner Damnit Martin: qN/{"()"T60bZ0e[":%02d"3*e%2>*S@S/1>)':/:~60bT+:T;W<S*N}/
 
4:00 PM
heh
 
Actually, does ':/60b just work? No need to :~?
 
b implies :i
 
:o didn't know that
 
yeah I keep forgetting about it too
although you did know, because "983q45q043502iaf"256b ;)
 
Yeah, but the difference here is we have "1"i instead of '1i, and I was expecting the latter
(well 55 I guess...)
(btw that's a you-can-take-that)
 
4:05 PM
thanks
it's kinda annoying me that I can't find a way to shorten that really repetitive format string
 
Kinda annoyed what I had was the same length :P
 
and qN/{"()"T60bZ0e[{sY0e[}%':*1>*S@S/1>)':/60bT+:T;W<S*N}/ is the same length as well
I tried something with H3b but it was a byte longer
 
Same :P
(The H3b part)
 
@Sp3000 Oops, no
 
4:12 PM
That moment when you are at 99/100 for a fanatic badge and you miss the UTC time by 12 minutes...
 
Ouchhhh
 
I wish I had known when I was at 99/100... then I could have made sure to close all my browser windows for a day, to avoid such an "accolade" :P
 
Doesn't matter, since it wasn't a PPCG fanatic badge :P
 
@MartinBüttner Any alternatives for .e[? :(
 
I think ternaries don't work with the modifier operators at all yet
 
@Sp3000 you'd have to do .{0e[}
 
.{t} works, but that relies on the first argument being the same throughout (like f)
... oh of course
Too long though :/
 
yeah, I get 56
 
4:38 PM
3
Q: 16-bit binary grid

type_outcastGiven any unsigned 16 bit integer, convert its decimal form (i.e., base-10) number into a 4x4 ASCII grid of its bits, with the most-significant bit (MSB) at the top left, least-significant bit (LSB) at bottom right, read across and then down (like English text). Examples Input: 4242 +---+---+-...

 
 
2 hours later…
6:12 PM
SO swag email has arrived!
 
Did you win something?
 
Yes. It's not hard to win something
All you had to do was post something
 
Was it for the "this user did something great" thread?
 
And the other too
 
Oh, didn't know there was another one.
 
6:14 PM
Interestingly, each of the emails have "What?! you say, I posted a day or so after the deadline, why are you contacting me? Because you're awesome too, just slower than everyone else, but I still want you to get the stuff. " in it. I posted before the deadline. I guess it's literally the same exact email for everyone.
 
Ohh. That would have been easier for me to answer than highlighting a single user's contributions.
But it still would have been similar to several others.
 
Darn... I can't remember my shirt size
 
Look in your drawer?
 
For reference, I'm about 6'2", 170 lbs, and a medium is good, maybe a touch snug in the shoulder area.
If that helps at all ;)
 
I'm at school right now. Listening to music.
 
6:19 PM
@Geobits We are the same height.
 
6'2'' is very tall...
 
I know how tall Geobits, Justin and Alex are. Not sure how to feel
 
My girlfriend is 5'4". I'm much taller than she is.
 
I feel only a bit above average height here. In Japan it was very strange :D
 
I'm just shy of 5'10''
I like to say that I'm 5'9 3/4''
 
6:20 PM
We should do a "How has PPCG helped you?" thread.
 
@SvenTheSurfer Feel a strange combination disgust and intrigue.
 
The biggest hurdle I need to get over is the belief that you are all robots.
 
@PhiNotPi I have a legit responses for that and also some not so legit.
@Geobits I bet!
 
@SvenTheSurfer Does that mean you think we actually aren't?
 
@SvenTheSurfer You also know Geobit's weight...
 
6:22 PM
Quick, calculate his BMI.
 
21.8 according to the first google hit for bmi calculator.
 
Yes
 
Congratulations, you're in the normal range.
 
My BMI has always fallen in the "underweight" range. For ones that have "dangerously underweight", I fall within that
 
Eat a sandwich.
 
6:24 PM
Sorry to interrupt your important discussions but... I was wondering today, are do-while loops computationally as powerful as while-do loops? E.g. would BF still be Turing-complete if each [] was always executed at least once?
 
I do
 
Eat more of them.
 
@Martin I don't think BF would have If statements then, would it?
 
exactly
 
@AlexA. No matter how hard I try to gain weight, it never happens.
 
6:25 PM
can a language be TC if it's impossible to skip code without executing it at least once?
 
@MartinBüttner Why not?
 
well I don't know, that's why I'm asking :P
 
Well, what if you had self-modifying code?
 
I shrunk my Befunge program (Beatles hexagon) and increased the song lengths! (link)
 
That might break the rule against skipping code...
 
6:26 PM
@Justin is that relevant?
(I'm not looking for a way to make a language TC despite only having do-while loops... I'm actually wondering if BF with do-while loops would be TC)
 
Implement it and then do all the TC tests or whatever
 
"or whatever"
 
Say you had a program in this modified BF. You enter [...] and the first thing you do inside the [ is write to the beginning of the loop. Then you check your condition at ] and possibly execute the code written to the beginning of the loop
 
What kind of agonizing esolang are you designing now? ;)
 
@Geobits I am in a very strange place right now.
3
 
6:28 PM
@Geobits nothing related to this :P
 
@SvenTheSurfer Good. That's the intent.
 
@MartinBüttner I'm at the very limits of my knowledge but I'm trying to contribute to the discussion somehow. :P
 
@Justin All you need to do is monitor calories in vs calories out. You can start estimating caloric need with something like this nutritiondata.self.com/tools/calories-burned and use an app like my fitness pal to record exercise and food intake.
 
but I've been discussing the Turing-completeness of Mornington Crescent with Timwi
 
@SvenTheSurfer Do you mean emotionally? It's okay, we're here for you.
 
6:30 PM
@SvenTheSurfer monitoring calories is a pain. I've never been able to gain weight. My doctor doesn't think I'm unhealthy, so I'm not worried. I'm not happy with my weight, but for a different reason than most people: I want to weigh more. It's kind of socially unacceptable for guys to be sticks. Not sure why.
I want to have muscles, but I honestly don't want to put in the effort...
 
haha
15
A: How to Prove a Programming Language is Turing Complete?

Giorgio MossaA programming language is Turing complete if and only if we can write every computable function in this language. So proving that we can emulate a turing machine is a good way to prove that a language is turing complete, by the way this is not the only way, another way can be to prove that your l...

 
@Justin I was like that until 25 or so, then gradually gained weight (not intentionally) to a more normal "average". Been there since, without trying one way or the other. It's not a big deal if there are no health problems associated.
 
¯\_(ツ)_/¯
Yeah, what Geoboots said
 
@AlexA. Thanks, I think in the case of BF there are simpler ways to prove it (and I could actually just go and try it), but not being able to prove it doesn't mean that it isn't.
I think it's more interesting how to prove that a language isn't TC
 
I don't know or understand what's going on but I'm interested
 
6:33 PM
what's a good example that needs a proof other than 'has finite memory' or 'is 1-stack automaton'?
 
see above messages, I was wondering whether BF would still be TC if we changed the semantics of [] to do-while
 
I'd be really surprised if it isn't
 
It's rather strange hearing a saxophone playing classical music after only hearing it in the context of jazz.
 
I do expect it to be still TC, but it doesn't seem obvious
 
@Justin I feel you! I have been called "skinny" all my life, and people don't realize that (although it might be less offensive) it is the same as calling someone fat. I had started trying to gain weight just last year, and have gained 25lbs. It's a lot of work, but worth doing... if you want to talk, you know my number.
 
6:36 PM
Can you implement a while loop with a do-while and no if... Hmm.
 
@SvenTheSurfer Do you guys know each other IRL?
 
We will soon!
 
I don't
 
Uh, okay
 
I don't know Sven's number either
I don't really want to know either
 
6:37 PM
Um, Sven? ^
 
I don't want to talk about it.
 
...
 
@SvenTheSurfer Sorry, I just don't think it's necessary to talk to you. I have enough friends.
 
haha
shut down
 
And I find it weird to talk to someone who's only been met online. Especially someone who I don't know online.
 
6:40 PM
I'm not sure if you're both trolling or if Sven is trolling or what.
 
However, if you really need a friend... you should actually try to find some IRL, but if nothing else works for you, there's always The Nineteenth Byte
I'm not trolling, I'm telling the truth
 
hahaha I use that phrase not in relation to a phone. I was referencing my user number because I thought you could chat with people, but I can't find it now.
 
Better ban everyone just to be safe
 
Hahahaha
Okay
 
All of Justin's friends:
 
6:40 PM
Much better
@BetaDecay Are you implying that the set of my friends is the empty set?
 
I might as well freeze The Nineteenth Byte for a bit. We could all do with some time apart.
 
I know I'd get more work done rather than fruitlessly backpedaling my sarcastic statements.
 
@Justin Nope, You'll see in a minute if I ever get it right
 
@SvenTheSurfer Sorry, I tend to take things a little too literally.
 
6:42 PM
?
 
Justin's friends ↑
 
Dice are my friends?
I don't understand...
 
Your avatar
 
Oh... :-) hehe
 
6:43 PM
Four and six are underrepresented.
He must be better friends with odd dice.
 
Probably true. I tend to befriend odd people.
 
Nope, he's friends with prime dice
 
I thought Beta was implying that you have a gambling problem.
 
Ahh. :-)
 
Except he doesn't know that 1 isn't prime ;)
 
6:45 PM
But all the ones shown twice are odd.
(Two is an odd prime, so must be odd)
 
@BetaDecay Except I got mad at a previous engineering teacher because he accepted someone's statement that 1 is prime
 
Yes
5
 
@Geobits The mathematician and linguist in me are at war.
 
If I could star, I would
 
@El'endiaStarman Those wars are typically prolonged and bloody. It's better if they never meet up at all.
 
6:47 PM
0
Q: How did the chicken cross the road?

CaffeineToCodeCluck cluck. No one knows why the chicken crossed the road, maybe there was a good looking rooster on the other side. But we can figure out how. Write a program, that, left to right, crosses this "road". 1356 | 1738 3822 | 1424 3527 3718 9809 | 5926 0261 | 1947 7188 4717 6624 | 9836 4055 | 9...

 
Let the mathematician win. It will shorten the war by several years and save thousands of lives
 
Prove it.
 
Damn maths and their proofs
 
Use induction.
 
An induction hob?
 
6:51 PM
Hob?
 
The problem with induction hobs is that you can't just heat any old pan.
You also can't use them as an emergency lighter, but that's getting into a whole other topic.
 
Well you could always get a half induction, half electric heater
 
Or you could just get a fully electric (or gas, really) one ;)
 

« first day (1693 days earlier)      last day (3142 days later) »