« first day (2372 days earlier)      last day (2766 days later) » 

18:00
@Xanderhall That's kinda neat, actually. Not many languages will have ++ work on non-numbers.
1 min ago, by totallyhuman
` https://imgur.com/Br00TCn
But -- doesn't work with strings
such consistency
57 secs ago, by Business Cat
Because why not ¯\_(ツ)_/¯
PHP's consistency is amazing Kappa
18:01
And also echo ("0"?1:0); is 0
that one's a weird case
Well, given that everything is a string, that kinda makes sense.
But echo ("test"?1:0); is 1
@Dennis who deleted it?
Right, because that's non-zero
18:03
A non-empty string should evaluate to true. But I think PHP treats it as a number, in which case 0 evaluates to false
"Let's just cast everything to a number first for no reason! Sounds like a great idea!"
Actually, it's "let's cast everything that looks like a number to a number!"
If you manually cast "test" to a number, ie "test" + 0, it will give you 0
[int]$a = 3; [int]$b = 2; $a / $b ... what do you think is the result in PowerShell?
Nope, a double 1.5
18:05
Nice, it converts to double
another challenge copied from some place else
That can either be a nice feature or an inconvenience
if you then [int]($a / $b) you won't get 1, you'll get 2
I am so confused curerntly
currently*
because (3/2) = 1.5, which rounded is 2
18:07
right
How about this one? [int]$a = [int32]::MaxValue; $a + 1
No idea
Wouldn't that be language dependant?
Talking PowerShell
Never used Powershell
You get a double of 2147483648
so I wouldn't be able to tell you
18:09
codegolf.stackexchange.com/questions/133754/… if the terms in the next sequence in the question are not even known, how are you supposed to write a program to calculate it?
Anyways, I shall leave you with the greatest function ever built into a language, belonging of course to PHP: strtotime
Straight Oti Me?
string to time
@HusnainRaza I think the intention is to write a program that would calculate the next number in the sequence, i.e., check if it's prime and keep looping until it is.
Check the examples for some ideas of what you can feed it for input
18:12
3
A: Float 754 to Hamming

Leaky NunPython 3, 72 71 bytes 1 byte thanks to Lynn. lambda n:n and(bin(1020+len(bin(abs(n))))+bin(abs(n))).count('1')-(n>0) Try it online! Explanation The binary64 format consists of three components: the first bit is the sign bit, which is 1 if the number is negative the next 11 bits store th...

@totallyhuman Oh, duh. Now it's obvious when looking at it.
I remain to be the only answer that doesn't use built-in.
oeis.org/A000066 the sequence only has terms from n=3 to 12
only upper and lower bounds are known for higher values of n, could i code those?
@LeakyNun That's because I don't want to do manual float-to-binary conversion in PowerShell.
@HusnainRaza I don't understand your question.
hard code, you mean?
if so, yeah i think so
18:17
-2
Q: Given a palindrome write a program to print the sorted list of all palindromes that can be constructed from the alphabets of the given palindrome

Shobit MahajanTHE OUTPUT PALINDROMES SHOULD BE IN SORTED ORDER Output Format: Output containing a sorted list of all palindromes constructed from the given input palindrome string. Example 1 Input NITIN Output INTNI NITIN Explanation There are only two palindromes that can be constructed from NITIN Examp...

hi all
Yeah, I made a program that hardcoded only the known values of the sequence, and yet it still got deleted
hmm
there was another answer that hardcoded and it was fine
should probably just ask caird
is there a pm system on stackexchange?
just ask in the comments
or ping them here
18:20
but caird's suspended
@Husnain I did the same thing and it got deleted, too.
horrible timing
step hen, can you look at my deleted answer?
oh i think i saw your answer this morning @KSmarts
it was a 2d program iirc
yeah fission
18:22
I think you need to implement a program that would find more if they existed
or something like that
and that calculates the first ones too
I was told "Just because the next values are unknown doesn't mean that they do not exist."
instead of hard coding
hang on lemme find the other hardcoded ones
my bash answer
But if no-one knows what the next values are, what am I supposed to output?
18:23
^
@KSmarts you're not (I think) but you should be doing something that would theoretically find the next one
-4
A: One OEIS after another

Lynn40. Rust, 3416 bytes, A000001 The rules seem to imply hardcoding the first 1001 cases is fine. static COUNT: [i32; 1001] = [0, 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51, 1, 2, 1, 14, 1, 2, 2, 14, 1, 6, 1, 4, 2, 2, 1, 52, 2, 5, 1, 5, 1, 1...

2
A: One OEIS after another

Husnain Raza83. Bash, 53+165265=165318, A000014 #!/bin/sh read index head -"$index" a.txt | tail -1 requires that a.txt (https://hastebin.com/eroterefov) be in the same directory next sequence Also, this is my first post to the Code Golf Stack Exchange, please let me know if I messed up in any way.

@totallyhuman downvoted bu valid
Rules say it has to work up to n=1000
18:24
How is this allowed?
that's the thing
2
A: One OEIS after another

Mayube77. Braingolf, 51 bytes, A004147 m32&gM9784&gM7571840&gM11140566368&gMvvcv1+[R<v]v_; Try it online! Next sequence

2
A: One OEIS after another

Mayube77. Braingolf, 51 bytes, A004147 m32&gM9784&gM7571840&gM11140566368&gMvvcv1+[R<v]v_; Try it online! Next sequence

this one too
I dunno
my first answer which hardcoded them got accepted
18:25
oh up to 1000
Sure, the numbers are uncomputable but that doesn't mean they don't exist!
but the braingolf answer doesn't..?
I think because you're first version @HusnainRaza didn't work even for the first ones, everything got screwed up
and I don't know anymore
@KSmarts Graham's number is pretty uncomputable, but it's known to exist...
really have to wait for caird at this point
can't do much
18:27
rip
oh and they're suspended till august 26th
so guess the challenge is over
Or even if Dennis would explain his reasoning and what he expects to see
...or wrote what he expected as an answer himself
dennis, even as a mod, cannot confirm what the challenge requires you to do
I kinda get the reasoning though. Just because it's not computable past a certain input, doesn't mean it's not computable before that, so you have to actually compute it
18:29
I'm sorry
and writing an answer is practically impossible
I'm tempted to write a program that gives the lower bound for higher-index answers (since there is a known formula for that) and ask anyone who challenges it to prove me wrong.
so challenge is dead tbh
But I liked that one. I want to play more :(
@KSmarts I would say go for it
18:30
mm
yeah might as well
you can't prove it wrong
It's not necessarily right, but nobody can validly say it's wrong without a proof
i dont know any more programming languages tho :C
you can do the one you deleted
or whoever deleted
I do want it to keep going
yeah me too but oeis is weird
18:32
I've had two deleted. One on its own, and one because it followed someone else's deleted answer.
that was probably mine :(
there are erroneous sequences, uncomputable sequences
I have 1 deleted because ETH posted literally 4 seconds before me
I told caird he should make it not include sequences that didn't go to 1000 :(
and since the challenge does not specify what to do on those
can't do much
18:33
@Husnain was yours the Shakespeare answer?
i think though
we could edit the challenge to specify required behaviour on those circumstances
@LeakyNun The author. Who else?
@Dennis alright
@BusinessCat FWIW, Meta consensus is that the poster must be able to prove their answer correct when challenged.
18:40
Well then how can you compute something with no proven right answer?
@BusinessCat it just wouldn't finish before the heat death of the universe
but it would theoretically output the right answer
Hmmm I guess
Maybe I have to learn Perl just to have a useful language to answer this in
any rules about editing the question?
12
Q: Are challenges that may not be solvable on-topic for PPCG?

MegoConsider the following example challenge: Given a set of integers, output a truthy value if there is a non-empty subset whose sum equals 0, or a falsey value if no such subset exists. Solutions must have worst-case polynomial time complexity or better. This is the subset sum problem, which ...

@AdmBorkBork clogging with pure ecstasy
18:48
There's another answer, I think by Peter, about proving if the program terminates, but I can't seem to find it.
@Poke I'll assume you mean the emotional state.
Any name ideas for a language embedded in a hyperbolic geometry?
@WheatWizard Smileylang?
Because a hyperbola... never mind.
That's not a good name.
@WheatWizard Exaggeration or some derivative
If the sequence is unsolvable, can I add a lower bound and just output that?
18:51
when people write C code with SSE/AVX support, how do they specify that the AVX code should only be used if the cpu supports it?
is there some variable you can check in the code?
7
Q: On the subject of testing code

MegoSomewhat related In my Bernoulli Numbers challenge, I've been seeing a lot of invalid answers that fail to compute certain values to the required accuracy/precision, or that take substantially longer to run than the amount of time between the posting of the challenge and the answer (such as this...

@wizzwizz4 mmyeah good assumption ;)
i suppose i would have wanted a capital E otherwise
@WheatWizard π∫|f(x)|^2
Because that's the volume of...
I'm not good at names.
@WheatWizard hypercode
Just hyper
18:55
hyper diaper
4
I haven't learnt what hyperbolic geometry is yet
There's already hyperRogue, a roguelike in hyperbolic geometry
@Cowsquack check hyperRogue
I think I might go with Hyperb. Sounds like superb + hyperbola
@WheatWizard codeh
A naming convention based on sinh and cosh.
So just to clarify, code needs to be written that actually calculates the sequence
like with an actual algorithm or something
18:59
@HusnainRaza believe so
That doesn't seem enforcable
OEIS sequences are not well specced
@WheatWizard is it a 2d lang?
IMO it should just be everything in a b file
@Cowsquack Yes.
CMC: find an OEIS sequence that cannot be computed by an algorithm
@JohnDvorak by any algorithm?
19:01
@JohnDvorak that's not well specified. I mean an algorithm could just read the answers from the page
like what about busy beaver
it's supposed to be uncomputable but I can compute the ones that are there
Busy beaver is good
@JohnDvorak oeis.org/A060843
Ah I see Stephen and I had the same idea
:39092247 We linked different sequences but the same general idea
@WheatWizard oh wait they are different? 0.o
Travelling salesman
?
19:03
Travelling salesman is NP but computable
> Finally, Pakistan is now Sans Sharif.
2
and then there's this: A000017
@WheatWizard NP-hard you mean
Oh yeah
0
A: Sandbox for Proposed Challenges

LembikCan you compete with a supercomputer? The challenge is to write super fast code for computing the permanent of a matrix of complex numbers. In a paper from 2016 a team of coders managed to compute the permanent of a 40 by 40 complex matrix on 8192 nodes of what was at the time the world's f...

19:08
The downvotes on my A000001 answer are actually pretty ridiculous. I added a little comment saying why that’s so, but there’s another aspect to it, I guess — the fact that I blocked off such a “useful” language like Rust
@Lynn ... Sometimes people make me sad.
I intentionally picked the most popular, useful language I could think off to block off
@StepHen That is an excellent reason why we should allow hard coding
Other people not being able to use it means I’ve slowed down the flow of answers, which is the only strategic angle I can grab in this challenge
@Lynn Hence the downvotes maybe?
19:11
(although I share it with everyone who does know weirder languages)
I mean. It’s a competition with no way to influence “how hard you’re winning” (because the penultimate answer wins for some bizarre reason). Making things hard for others is the closest thing.
Anyone know why this is happening to me?
Do you downvote hard cops because they make the robbers’ life tougher?
It makes absolutely no sense.
No, I don't. I encourage the hard ones with upvotes
I do often downvote artless crypto in cops and robbers
But I will say I see no problem with your answer
What did people expect to see, for A000001?
19:14
But those that use clever techniques (this does not include hardcoding)
In fact I've up voted it
An optimized, 10k line algorithm full of heuristics and group theory? Nobody was going to write that. If I didn’t post my Rust answer, someone was gonna post the equivalent of fun (n) -> FiniteGroupCount(n) in some math suite that has a built-in for it like Magma
And I know y’all would have upvoted the hell out of that for some strange reason
even though, internally, it obviously has the first 1001 group counts memoized
Sorry for that ^
@Lynn I never upvote trivial posts, I don't understand that way of voting either.
CMC: Given a 2D list of positive integers, add the length of the flattened list to all the integers.
[[1,2,3], [1,2,3]] -> [[7,8,9], [7,8,9]]
+F might work in jelly
i'm not sure about the vectorization depth
19:22
FL+ should work but there might be a better way
FL+ does the trick
+ is commutative why did I say +@ ಠ_ಠ
the community can be a fickle beast
19:23
@Poke What do you mean?
at least we can all agree that java is the best language
Sure, sure ಠ_ಠ
@Mr.Xcoder i was referring to the large push for not upvoting trivial solutions but then doing it anyway or how we have hmmhmm criteria for closing popcons, etc
1
Q: Continuous Niven Numbers

Shobit MahajanIn recreational mathematics, a Niven number in a given number base, is an integer that is divisible by the sum of its digits when written in that base. For example, in base 10, 18 is a Niven number since 18 is divisible by 1+8 = 9. Also, 12001 in base 3 is also a Niven number since the sum of the...

19:24
Closing bad pop-cons!
Well made Pop-cons are gems of this community
s/closing popcons/determining which popcons are worth closing/
anyway
those challenges were clearly copied from somewhere
as long as we agree with the java thing
@totallyhuman I feel so too
Wait are there more bad challenges?
19:25
i'm happy enough to ignore the other arguments and discussions
@Mr.Xcoder too bad they don't exist. :P
@Poke I don't know about that. PowerShell is great and does all things.
@WheatWizard Yours is one of the best around.
@BusinessCat check yourself, sir
19:26
@Mr.Xcoder If thats true then it only proves my point.
@WheatWizard Unknown Completeness is very interesting :)
this was quite clearly some kind of task that the OP was supposed to do
isn't there policy on this?
I have seen those before, I am searching for them now
@totallyhuman I have a meta post on that
also the reddit post was posted 6 hours ago
19:29
which probably means that the reddit OP and the OP here are the same person
Too many challenges at once!
can somebody who knows how to deal with this deal with this? :P
@totallyhuman Unless they find the original reference, no...
>_< but it is so obviously copied...
How do I get to the sandbox?
19:33
what part is copied? From reddit to here?
Then use a plagiarism checker to try to find its source.
@WheatWizard here?
it has the exact same body
Then flag it.
19:34
Right, who is to say it's not the same author?
Although it is copied, I'm wondering that too. The moderators will have to decide. It seems probable that it's the same author.
@AdmBorkBork Why place it on two different sites?
@HyperNeutrino No the chat sandbox
Even if it is the same OP its really suspicious that they would post in both places

Sandbox

Where you can play with chat features (except flagging) and ch...
@Mr.Xcoder Why not? If it was posted asking for help, the person got the help, then thought it would be a challenge? What's the harm with that?
19:36
Seems to me like they are perhaps fishing for a homework solution
@HyperNeutrino Thanks a bunch I am awful at navigating chat rooms
No problem :)
Whatever code-golf solution gets put out is not going to help with homework, unless the homework is to golf something.
it's not golf
it's fastest-code
I flagged it as in need of moderator attention.
@totallyhuman Refresh your page.
19:38
>_<
but still
Now it's very clear it seeks hw help. They restrict the output format.
I'll personally just boycott both the challenges.
Restricted output format is typically either inexperience on this site or just homework help.
> Can we view source code in code-golf?
This convinced me.
1
Q: Solve the Trolley Problem

PyRulezPhilosophers have long pondered the Trolley problem. Unfortunately, this no human has solved this problem yet. Luckily, as programmers we can use computers to solve the problem for us! Your program will take as input a (finite) directed graph (with at most one edge from x to y, for any x and y...

what
what does that mean?
19:41
Can we view source code in code-golf? — Shobit Mahajan 1 min ago
@Mr.Xcoder bona fides
English?
yeah I'm asking what he means by that
That's Latin for "Good Faith." As in, assume that the person is making an honest attempt and something else (likely English-as-second-language) is getting in the way.
I highly doubt that anyway.
19:43
The amount of editing done, and the fact that the user posted a second (unrelated) question seems to me like they've discovered a new community.
give-me-teh-codez people don't do that
to get their homework done by?
The only way to determine is to interact with the user and try to either get them to let information slip by or for us to figure out that he's not asking for homework help.
Could I get another user to help me test something in the sandbox?
@WheatWizard I'm up
@AdmBorkBork why not? they have two assignments so they posted both
19:44
@WheatWizard I'll help.
@AdmBorkBork A new community of unpaid programmers seeking to solve things as fast and as golfier as possible?
@totallyhuman Second one does not seem homeworky to me at least :P
a possible, most probable, situation
@WheatWizard chatjax?
@Cowsquack No, I'm trying to reproduce a bug.
19:45
@Mr.Xcoder For homework? What homework asks for golfed code?
@AdmBorkBork well he didn't originally wanted golfed code
@AdmBorkBork None. But fast answers are on trend here
originally there was no winning criterion
@StepHen Right. I assume that to be an ESL thing.
and then he accepted fastes-code
19:46
Now it's 100% up to the mods to decide. I've flagged the first one.
and then code-golf
Anyone know an inverse of Python 3's int.from_bytes
@wizzwizz4 int( ,2) what you want or no? or do I have that backwards
@AdmBorkBork It's not a new community: Member for 1 year, 11 months
@StepHen int(,256) is closer.
But that isn't a thing.
19:48
oh that's complicated
python doesn't have good base conversion
is your input in binary, hex, or just bytes?
@Mr.Xcoder That doesn't mean it's not a new community. I was a "member" for several months before I actually joined, and another several weeks before I actually contributed.
@StepHen My input is a big int.
@AdmBorkBork Me too. I just made an observation
@wizzwizz4 uh... int.to_bytes?
19:50
@StepHen If only... :-/
Wait...
That's a thing?
I dunno, docs say so
I must've missed that.
No, it's definitely in dir(1).
I missed it when looking for an inverse. :-S
hmm
hey what does dir(...) output?
19:54
@totallyhuman dir(x) is all ys where x.y is a thing.
ye I know lol
what does it output on ...
on Ellipsis
Oh, lol, the way your question is worded
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
:/ lame
__doc__ returns None
print(....__doc__)
doesn't look like valid code but y'know
Ellipsis seems like the most arbitrary object they could've implemented
It... doesn't disassemble.
import dis
dis.dis(type(...))
... No output.
Can someone smarter than me at JavaScript put a leaderboard of uncracked answers on @WheatWizard 's cops thread?
19:59
robbers thread?
you could use the one from the halting CnR

« first day (2372 days earlier)      last day (2766 days later) »