« first day (2391 days earlier)      last day (2455 days later) » 

10:00 AM
@Mayube Lua is the reason why I didn't attempt to create that code myself :p
 
yeah.. screw that
 
10:12 AM
What's a fast way of checking if the binary representation of a number has 3 1s in a row?
 
Which language..?
@dzaima Yay! Lua!
Lua is the most beautiful language of it's time.
 
@ATaco Ruby / Crystal
 
I maintain
 
lol. Got lua macros running, spammed buttons on the keyboard and turned off my computer..
 
10:29 AM
ahahaha
good job
 
Lua is a terrible language.
 
I love 1-indexing!
It's my favourite! /s
 
posted on August 16, 2017 by Peter Taylor

Write a java code to detect the JVM version was closed in error as part of the underhanded cleanup. It's obvious from the comment thread that it was never really an underhanded question, and that tag was only added because the system required at least two tags. I removed the tag and voted to reopen. To my surprise, all three reopen reviewers voted to leave closed. I

 
@ATaco I want you to know that I woke up at 3:30 AM to say that.
At first I thought it was just insomnia
But then I checked TNB and realized the universe needed me to assert my opinion on Lua.
Hmm... I have to get up at five anyway, should I even try going back to sleep..?
 
10:51 AM
THE TRIANGLE DRAWING ALGORITHM THE SITE SUGGESTED DOES NOT WORK ;_;
it makes this "triangle":
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00001000000000000000000000000000000000000000000000000000000000000000000000000000
00000001110000000000000000000000000000000000000000000000000000000000000000000000
00000000000111000000000000000000000000000000000000000000000000000000000000000000
00000000000000111110000000000000000000000000000000000000000000000000000000000000
00000000000000000111111100000000000000000000000000000000000000000000000000000000
 
that actually looks pretty cool
CMC: Output the above
 
no, look at how the top left 1 is disconnected
 
@wizzwizz4 Nah, that's not the reason bro. Being quite busy; hardly can manage any time, that's why :)
 
@Mayube that are a bad kolmo complexity
 
@DestructibleLemon that are a bad english
 
11:05 AM
that are missing the point
 
0
A: Sandbox for Proposed Challenges

Kevin CruijssenIt's a Bit of a Stretch.. code-golfbinaryintegernumber Input: We take two inputs: An input with two distinct values b, like a boolean.† And a positive integer n. Output: Based on the boolean input, we output either of the following two sequences in the range of 1-n (in the example below ...

 
CMC: Test if a number's binary representation contains 111 or 000.
 
@Qwerp-Derp C#: x=>{var y=Convert.ToString(x,2);return y.Contains('000')||y.Contains('111');}
 
@Mayube Save one byte by || to |
 
isn' | xor?
 
11:14 AM
no its bitwise or
 
@Qwerp-Derp SOGL, 6 bytes: 2─13mW
 
xor is ^
 
@dzaima Doesn't work for 2048
 
@Qwerp-Derp can't read lol, fixing
 
@Qwerp-Derp Jelly, 7 bytes: BŒgZL>2
 
11:16 AM
@Qwerp-Derp 05AB1E, 7 bytes: bŒ3ù€ËZ
 
alternative: bγéθg2›
 
SOGL, 7 bytes: 2─č►Χ2> (idk why it doesn't work without č)
 
@DestructibleLemon this is how it's supposed to be drawn hang on wait what you must have messed up
@Qwerp-Derp there is none
 
@ASCII-only ???
 
@ASCII-only I think there is
 
11:20 AM
@Qwerp-Derp PHP, 48 bytes <?php=preg_match('/(000|111)/',decbin($argv[1]))
 
a hopefully quick implementation in python
def has000_111(n):
	while n:
		if n % 8 in (0, 7): return True
		n >>= 1
	return False
@ASCII-only ^
 
@EriktheOutgolfer well there's probably none faster than the naive method
Except if you use a cache, but it would need to be massive to make a difference
 
@ASCII-only actually this isn't the naive method
the naive method does the whole base conversion process
 
@EriktheOutgolfer depends on who you ask
 
k now 6 bytes works
 
11:25 AM
@EriktheOutgolfer wait it needs to be while n > 7:
 
it's (0, 7) not range(0, 7)
 
@EriktheOutgolfer yeah?
But if you check n > 7 that should save 3 iterations on average
 
I think the check itself would make it slower anyways...and it should be n >= 7 instead
 
@Mayube do you need the patterns on the regex
 
idk, maybe not
 
11:29 AM
I think you can shorten the regex to '/[01]{3}/' or something?
 
@EriktheOutgolfer Well right now it checks != 0, changing it won't make a difference
@EriktheOutgolfer won't that match any three digit binary number
 
hmm...maybe
@ASCII-only I think it'll do (>= 7) != 0 with the check...
unless it checks if the datatype is bool
 
Which it almost certainly does
 
:/
so i got f=lambda n:lambda x=sum(map(int,n)):n-1and f(n%x or n/x)()+1 as an answer
to this
but somebody else already has def f(x):y=sum(map(int,x));y=x%y or x/y;return(y>1and f(y))+1
is it different enough? or no
 
@ASCII-only at least this is golfed
def f(n):
 while n>6:
	if n%8in 0,7:return 1
	n>>=1
 return 0
(python 2)
 
11:35 AM
@EriktheOutgolfer but no more bitshift
 
@ASCII-only fixed
 
@EriktheOutgolfer maybe if not n%8%7?
It's not shorter but it may be faster
You might want to test with timeit
 
@ASCII-only maybe if n%8%7==0 then?
because that's what not does for ints
 
@EriktheOutgolfer true
 
def f(n):
 while n>6:
	if n%8%7==0:return 1
	n>>=1
 return 0
 
12:30 PM
> python? more like pythno
 
ahaha
 
1:03 PM
What is the user icon of @Dennis?
 
It's Dennis the Menace
 
@BusinessCat Wrong hair and top colour.
 
I believe
 
Dark hair, red and black-striped top.
 
Doing an image search gives me both what you're describing and what Dennis's avatar looks like
 
1:06 PM
@BusinessCat Really? I must have a look.
 
In fact, I even found the exact image he used
 
@BusinessCat ... There are two Dennis the Menaces.
 
It's weird
 
Both of which originated in comic strips.
In the same year.
In the same month.
In the same week.
But the US one was before the Beano, so it's canonical... :-/
 
1:20 PM
@w0lf Are you around?
 
@wizzwizz4 TIL
 
@AdmBorkBork Which one did you know?
 
The US version
Never even heard of the UK version until today.
 
The Beano is a popular (in the UK) children's comic from Dundee.
Its probably most famous character is Dennis the Menace.
 
1:51 PM
For some reason I have a Beano issue
 
I got my macroscript working
I can now create a bunch of macros quite easily for my second keyboard
I'm using a char-by-char string system to encode what key combinations the macros should perform, using typable chars to represent typing those chars, and untypable chars such as extended ascii chars to represent other key presses such as enter or arrow keys
 
@Mayube I would recommend using ANSI ESC codes for the arrow keys.
 
hmm
can they easily be inserted into a python string though?
 
Iirc that's <ESC>]A (for letters A-D) for Up, Right, Down, Left.
@Mayube Escape it.
0x1b.
 
or I could just do this 'if() {••}ˆˆ»‹‹‹'
is enter, ˆ is up, is left, and » is end
 
1:59 PM
@Mayube You could, but ANSI ESC codes have the added benefit of being interpreted by many terminal emulators as the actual arrow keys.
 
but that's irrelevant though
 
I'd recommend using new line and backspace for enter and backspace respectively.
 
that serves no added benefit to me
 
@Mayube It means that, if you get the right input method, you can just pipe keyboard input directly into a lookup table.
 
that's not what I'm trying to do though
the "input" is a single keypress
 
2:03 PM
I understand now... No key combinations then?!
 
key combinations involving shift, ctrl, alt, caps-lock, num-lock and scroll-lock, sure
but really I'm not gunna need that many macros
 
So, the "input" isn't a single keypress.
I'm confused.
 
the input is a single keypress, if I want too I can also handle modifiers (I'm not right now), that input is received by the python script, which then simulates a series of corresponding key presses from my actual keyboard
I have 2 keyboards plugged in. The typing keyboard functions normally, the macro keyboard is "floated" in xinput, and python is reading /dev/input/event to get keypresses from it
 
@HyperNeutrino this is the guy to contact for the next OEIS: jsm@polyomino.org.uk
unless it can be figured out from one of those papers...
 
@Mayube I see... Couldn't you just use a binary file with - wait, that's more complicated.
 
2:10 PM
hello
 
I'll probably abstract the macro strings out to a JSON file though, which python will then parse
better than hardcoding them into a massive if-elif-elif chain in the python directly
 
2:33 PM
LinkedIn loses lawsuit against HiQ. I know this happened a couple days ago but I'm pretty happy that the judge wasn't an idiot
 
@Poke thank goodness
it'll be appealed though probably :/
 
almost certainly
 
> LinkedIn plans to challenge the decision
 
The cfaa is such a vague piece of crap
lawsuits basically end up being based on how the judge feels that day
 
what judge would say "Google can have the info but HiQ can't" though...
 
2:37 PM
A judge that sees that LinkedIn explicitly disallowed access to the information to HiQ. In essence that means that HiQ accessed a protected computer that they were not authorized to use
and violated the cfaa
 
@Poke I don't see how "you can't use a search engine on our stuff" holds any ground :/
stupid laws xD
 
there have been more ridiculous lawsuits
one of the better quotes from that article:
> We will continue to fight to protect our members’ ability to control the information they make available on LinkedIn.
that's referencing information that folks made public. like wtf
 
aka "We will still fight other companies' abilities to use Google"
 
i have to think it was taken out of context
because of how stupid it is to say something like that
If I make my information public there should be no expectation of privacy
honestly if I put my information on the internet at all...
 
Well, that's what you get when you try and use a 30-year-old piece of legislation in the modern Internet
 
@AdmBorkBork yup
 
do we have a sudoku solver and if not, do we want one?
 
@totallyhuman no and yes
 
> Shortest byte length; Tie breaker by efficiency (execution time)
Ouch
 
oof
Save a byte, but your algorithm now becomes O(scary)? Better hope that byte was worth it.
 
2:52 PM
@Mayube well i can't make one, all i have is a chromebook to run code on
 
rip
I have a server
but I'm too lazy to make one
and I'm too lazy to test the submissions myself
 
@StepHen All laws are stupid from the point of view of people who know the technicalities. Most of them are better than nothing, though.
 
@AdmBorkBork won't it always be worth it since bytecount is the primary criteria
@wizzwizz4 in most cases. it matters who is interpreting/carrying out said laws
 
Perhaps. If you can tie someone else's count and have yours be faster, then yes. Otherwise, was it really worth it?
 
My point was really that it's a horrible winning condition and shouldn't be allowed :P
 
3:04 PM
it does if you were already tied with someone else
@trichoplax i'm not sure i understand your reasoning. we have both code golf and fastest code challenges
they're both valid winning criteria
it's not controversial like popcons
 
In general, they're orthogonal, though.
 
@AdmBorkBork I'd argue they're only orthogonal because it's difficult to make fair scoring when combining them. Using one as a tiebreaker for the other seems to be reasonable
 
Your statement is self-contradictory.
 
> awarded 418 times
 
3:09 PM
Let me restate. It's difficult to compute some fair metric by combining golf and efficiency. There's no nice mathematical formula for it. A tiebreaker removes that drawback
 
@trichoplax the first recipient was Community too :P
 
@AdmBorkBork if your code is 3x slower but 1 byte shorter, you still win
 
@StepHen I posted that before and got no stars. :-(
 
@wizzwizz4 uh... magic
 
@StepHen Star magic...
 
3:12 PM
@Poke My objection is that one works against the other, so you have to take into account a condition you might never need, and in doing so lose out, so it just multiplies the amount of work to be done, detracting from the challenge. A similar argument was made on meta
 
@wizzwizz4 You only posted a link to the profile badge, not an image :P
 
you only need to care about speed if you end up tied with somebody else though, golfing is still the main goal, speed is only a concern if golfing results in a tie
 
15
Q: How did the Community bot earn the "Not a Robot" badge?

Steven VascellaroSomehow, the community edits bot earned the "Not a Robot" badge. How did this happen and should I start welcoming our new robot overlords?

 
@StepHen I have learned this now. Thank you.
 
Somewhere on Stack Overflow is an easter egg I inserted directly in SQL today. I wonder how long it’ll take people to find it…
 
3:15 PM
@trichoplax code challenges are analogous to popcons and neither of them seem to be very welcome on this site as of late. it makes sense that a tiebreaker of shortest code wouldn't work for that type of problem
 
Why was the same thing posted twice?
 
@ppperry one on MetaSE, one on MetaSO
 
@trichoplax You don't really need to consider a condition you "never need". If your code is the shortest, you're worry-free.
If your code is a little longer but more efficient, then you'll lose anyway
 
@Poke I wasn't aware of code-challenges being unpopular. It's just a tag for any objective winning criterion that isn't already covered by an existing tag. The ones I've posed have been well received.
 
i guess i should preface that with "in my experience"
 
3:16 PM
@Poke usually goes over well, as long as the scoring is solid
 
Still, ...
 
@trichoplax perhaps i'm thinking more of "code trolling". still, that means that code challenges are more meta than scoring criteria
they describe a challenge more than dictate who wins
 
@Poke Code challenge just means "see the spec for the winning criterion"
 
@Poke well, kind of. "Highest number of languages in polyglot" seems pretty dictatatory to me
 
If a new winning criterion catches on then it will get its own tag, and code-challenge covers all the rest
The two code-challenges I've posted have had "longest valid output" and "shortest valid output" as winning criteria, respectively
 
3:19 PM
then maybe that meta post is really calling out the fact that shortest code is a bad tiebreaker and not that another piece of criteria cannot be used as a tiebreaker
though you may also run into instances where syntax is very similar between languages but one language may be implemented better under the hood and thus run faster
/sigh
 
Yes that one is just about golf as a tiebreaker. I linked to it because I think that the same applies to fastest-code as a tie breaker, but if that is disputed maybe it needs a separate answer for people to vote on
 
is the tiebreaker in this instance more about time complexity or physical runtime
i think time complexity is an okay tiebreaker because it is constant regardless of language
 
The challenge was closed for other reasons so this was just something I was surprised at, not a pressing problem. In this case it said execution time
 
hmm
 
Execution time seems like a huge amount of extra unnecessary work, since it needs the challenge author to test on their machine
Seems to detract from the simplicity of golf
 
3:25 PM
makes sense
 
Complexity at least doesn't need the challenge author to run anything, but it borders on being unobservable behaviour and requires looking at the internals of the interpreter/compiler if there's dispute
 
however it is also more... not quite objective but fair(?) than "whomever posts first"
that is also true
 
I see your point with first to post. Especially since some people won't even see the post until a few days later
 
but the same might be said for challenges where that is the primary winning criteria
 
I do also feel that isn't as objective as it sounds
I'm not against it existing, just pointing out that golf makes judging disputes so much simpler
 
3:28 PM
can a mod unfreeze VSL room please? chat.stackexchange.com/rooms/46888/vsl
 
@Downgoat Done :)
 
thanks :)
 
:I repcap
 
@HyperNeutrino shuddup :P
 
lol
:P
 
3:33 PM
1. never repcap
2. ???
3. profit!
 
xD
I just logged on tho
then again I was using PPCG last night which counts as "today" because of timezones xD
 
@totallyhuman never post, never repcap, profit
 
I have a KoTH idea where you submit an encoder and a decoder and the program gives the same random string to all encoders, gets all of the encoded strings, and sends the list to each decoder where you try to figure out which one is yours and decode it, while trying to encode messages that other decoders think are theirs. What's a good title for this and would people be interested in a KoTH like this?
 
title mctitleface
 
@HyperNeutrino something something Recode
although what does while trying to encode messages that other decoders think are theirs mean
 
3:38 PM
like you try to trick the other decoders into thinking that the message that you encoded was encoded by their encoder so that they don't get the right string decoded
 
@HyperNeutrino during runtime or no?
 
ok so I'll just describe the controller to you. First it generates a random string and then runs all of the encoders on it. It now has a list of strings, which it shuffles. Then, it sends the entire list to each decoder, where each decoder tries to identify which message it can decode and then decode it. The decoder that returns the original string the most times out of $n$ test runs wins
 
@HyperNeutrino so... each encoder just appends a key to the front of its encryption...
 
something like that, except you're trying to make it unobvious how your decoder identifies the correct string otherwise other people will make their encoder generate a string that matches your decoder
 
@HyperNeutrino the problem I see is that whoever posts last will probably do best :/
 
3:44 PM
so like say I made an encoder that always makes the output string have only even bits. Then, if I make it obvious by doing all(x % 2 == 0 for x in map(ord, string)), then someone else is going to do the same, except maybe theirs will always be a zigzag of codepoints so that they don't get confused by mine
@StepHen yeah that might be an issue :/ that's why I'd obviously sandbox this first and even before then ask in chat :P
 
@HyperNeutrino ok, but what if my encoder just does "stephenisawesome"+"message", and its the last one posted
 
then someone will post after you doing the same thing and yours will become confused
 
@HyperNeutrino right, so the last person to post wins :/
 
yeah that's the problem, people can just post after the last answer to win so it will just be an endless chain of boring answers :I
 
they'll look for "stephenisawesome1", next person "stephenisawesome11", etc
 
3:45 PM
yup
 
hey neutrino what does wolfram think your avatar is
 
a switch
 
does it recognize it as benzene
 
3:46 PM
if the background was transparent it might
 
@HyperNeutrino it's a really cool idea, maybe find some way to prevent keys like that
 
> [What the heck?!] > [primate] [hominid] [person]
 
@StepHen maybe. I have another KoTH idea though that's like most KoTHs (2D grid) so I might just work on that :P
 
@HyperNeutrino I could /maybe/ see a backboard being made like that but it doesn't look like the backboard they linked haha
 
3:48 PM
@HyperNeutrino I had an idea for that (you probably saw me talking about it) but I'm too lazy to make a controller
 
@StepHen yeah :P my idea is a bit different though, I'll give a brief description and I don't think it's been done before
 
@HyperNeutrino Relevant xkcd
 
anyway brb o/
 
CMC: find a PPCG user avatar that is correctly identified by wolfram
 
3:55 PM
Mine is
 
@totallyhuman imageidentify.com/result/0ir6s3c3fp4tm does this count ;)
 
> [What the heck?!] > [fictional character] [domestic dog] [Stewie Griffin]
 
@Mego is the cookie monster confirmed
 
mego is cookie monster confiemmed
 
4:00 PM
@totallyhuman it got Stewie Griffin right one time, its just sticking with its guns ;)
 
@Jordan no way mego is a penguin that's insulting the penguin race!
 
penguins can like cookies
 
Are you saying penguins aren't people too?
 
@BusinessCat depends on who you ask
 
4:04 PM
I came here to figure out what the Ninteenth Byte relates to, and it's come up with Code Golf? Even more confused than before. Dear god.
 
4
A: What is code golf?

gnibblerIn the game of golf, you win by minimising the number of strokes to complete the game. In code-golf, each character is equivalent to a stroke in golf, so you win by using the smallest number of characters. You may even see people using the words "characters" and "strokes" interchangeably here

> In the game of golf, you win by minimising the number of strokes to complete the game.

In code-golf, each character is equivalent to a stroke in golf, so you win by using the smallest number of characters.
 
@user3200293 this thingy particularly
also "the nineteenth hole" in golf means a pub or something after the eighteenth hole on an 18-hole course
 
I've been genuinely surprised because I thought that was a lot more common knowledge than it apparently is
 
ono next sequence is hard thingy
 
isn't it always
 
4:10 PM
ಠ_ಠ not appropriate for chat (I think?)
 
lol
@EriktheOutgolfer Didn't know that!
 
well you can search it up for more details :p
@user3200293 please no, that kind of message is sexually offensive
 
Woah I didn't know John Dvorak was/is on code golf (if its him)
 
he was Jan Dvorak before
 
Ohhh, so not him :-(
 
4:13 PM
Apologies, but when your chat room is based on a game that uses terms like "hole in one, strokes, 19th hole", innuendos are difficult to pass up. Alas, my query is done and thank you for your answers. Apologies once again and goodbye.
 
Innuendos only are apparent when you want them to be. Just stop mentioning it.
 
does anybody ever think... that... SE might not have been the best place for a site like PPCG..? :P
 
you're not the first
 
please don't start
 
Lots of people think that all the time.
 
4:20 PM
ok i didn't know that sorry :P
 
What can we do, though?
 
and there we go...
 
PPCG was created to consolidate the codegolf questions off of SO.
 
i'm just looking at the meta questions about stuff
 
I think there's ups and downs to it
 
4:21 PM
@EriktheOutgolfer what do you have against the conversation?
 
SE have taken steps to accomodate us though
 
A mutiny has been formed I guess!
;)
 
@totallyhuman it's been done so many times...
 
@totallyhuman he's probably just seen it too many times and sick of it
 
0
Q: Generate unseen numbers

Wheat WizardLet us say a proper substring is any continuous section of an original string. For example cat is a substring of concatenate. We will say that a proper substring is a substring that is not equal to the original string. For example concatenate is a substring of concatenate but not a proper subs...

 
4:25 PM
@NewMainPosts good work NMP
 
@NewMainPosts well done! you posted before it being already answered!
 
an in 7 minutes! That's 7 minutes quicker than usual!
 

« first day (2391 days earlier)      last day (2455 days later) »