« first day (1446 days earlier)      last day (3380 days later) » 

12:13 AM
@Rainbolt bool.Parse(true.ToString()) works for me
 
 
2 hours later…
1:56 AM
0
A: Sandbox for Proposed Challenges

mdc32Final Exam Grade Calculator So, it's around time for finals, and many students want to know what grade they need on their final exam to achieve an A, B, or sometimes a passing grade. There are many factors here - the weight of the final, two quarters having weight, what grade the students want -...

 
 
5 hours later…
6:45 AM
finding system time in milliseconds in c++ is not very golf-friendly
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock().now().time_since_epoch()).count()
oops, should have put system_clock instead of high_resolution_clock. Much shorter !
 
 
3 hours later…
9:32 AM
@Optimizer, re the shortest path thing. I think the point of disagreement is into how many graphs a given 2D grid can be parsed. You seem to be assuming that it inherently represents von Neumann adjacency (each vertex has up to four neighbours: up, down, left, right), but that's really a parsing decision. In another context I doubt you'd have any problem with it representing Moore adjacency (eight neighbours, including diagonals).
To count the turns, you just need to parse it with rook adjacency: each vertex is adjacent to each other vertex on its row or column which it isn't blocked from seeing.
 
9:43 AM
@PeterTaylor in a typical graph problem, yes the two things might be same. but here, its totally different approach to solve the problem and the difficulty is also at a completely different level
in other news.. 3 more up votes remaining to get a guru badge on a closed question :D (given OP accepts)
 
What's a "totally different approach to solve the problem"?
 
So for shortest path, you can simply apply distance algorithm over the grid , which will tell the distance of any cell from A
and then simply get that value where B was
 
No, you're applying the distance algorithm over a graph you generated from the grid
 
how did u generate the graph ?
 
By parsing the grid
 
9:49 AM
I mean what are walls and what are empty spaces in that graph ?
 
Hi! Can I ask here for some help on golfing a python program? It isn't related to any PCG question.
 
@SampritiPanda you can ask a question on the site with tips tag for advice
 
Graphs don't have walls and spaces. They have vertices and edges.
 
@Optimizer Ok thanks!
 
@PeterTaylor can you some how represent the graph for the first example shown in the question ?
(if its not too much)
 
9:51 AM
That is a bit big. I'd do a smaller one.
 
ok
pick something which has different path for shortest and straightest.
(on the grid)
 
Graph:

`...`
`.#.`
Meh. Pastebin
 
10:52 AM
This grid has only 1 path from A to B
(from any A to any B)
 
This is true modulo doubling back.
 
I have no idea what that means. (Not good with fancy terms)
 
If you double back, it ceases to be true.
But why do you bring it up? I don't see the relevance.
Wait, actually it's not true in the rook graph.
 
I wanted to see why you keep on insisting that the shortest and straightest paths are exactly same in terms of graph using adjacency matrix
but this is not going anywhere.
 
Bottom left to bottom right: in the rook graph you take one step to top-left, one step to top-right, and one step to bottom-right. That's the shortest path, three steps, which means two changes of direction.
 
11:08 AM
In this case. yes. But let me give a little bigger case with variations.
too big ?
 
I'm not going to fill out 25 x 25 adjacency matrices by hand
 
there are not online tools ?
I think this is the smallest case where shortest path has more turns than an alternate path
 
I've never looked, but I can't see why there would be.
Ah! I misunderstood where the disagreement was.
Forget the shortest path in the von Neumann adjacency. It's completely irrelevant. What matters is the shortest path when each rook movement counts as only one step.
 
oh so in the adjacency matrix, calculating the shortest path and straightest path is almost similar ?
 
@Optimizer it's identical
the only difference is getting the adjacency matrix
 
11:14 AM
oh
is getting the matrix code-golf wise wiser ?
using any other approach.
 
I don't understand the question
 
It's the mathematical abstraction underlying every implementation
 
I think if I golfed it wouldn't actually get the matrix
I'd just to the BFS for the grid where, at each step, I queue all the cells available via a rook move, instead of just the four neighbours
 
I was using a different approach and got around 180 bytes in cjam
 
 
1 hour later…
12:20 PM
hi
 
 
2 hours later…
2:05 PM
@VisualMelon It turns out that XML can't handle title cased bools like True and False, but C# can.
 
hi @Rainbolt
 
And now the funny part: I should have known.
"This method returns the constants "True" or "False". Note that XML is case-sensitive, and that the XML specification recognizes "true" and "false" as the valid set of Boolean values. If the String object returned by the ToString() method is to be written to an XML file, its String.ToLower method should be called first to convert it to lowercase."
 
@Rainbolt joy
 
@Lembik Hi
 
 
4 hours later…
5:48 PM
oO
I had an answer accepted 2 years later
 
well done! :)
 
sure, its just odd, especially when it comes from a questioner with only 12 rep :P
 
I'm considering doing a challenge where you generate a random Boolean expression, and print it along with its value. So essentially a combination of this and this. Would you say it's a duplicate?
 
6:10 PM
@Zgarb you could post it in the sandbox, so people can get a clearer idea of what's it gonna be like
 
@MartinBüttner Sure, just a moment.
There.
 
0
A: Sandbox for Proposed Challenges

ZgarbGenerate a Random Boolean Expression code-golf random generation In this challenge, you generate a random Boolean expression -- and then evaluate it. Input Nothing, or a random seed if your program requires one. Output A random Boolean expression and its value, formatted as a string <expr> =

 
6:29 PM
oO
so I'm on two different systems
(a mac vs windows)
and they produce different cars with the same input
@MartinBüttner
 
oh
then maybe my car isn't even the same as yours
wrong room btw
@Geobits @PeterTaylor another idea for the traversal counting. it's a folded strip of paper and the question is "into how many pieces can you cut it with a single cut?"
 
n + 1 ?
 
@Optimizer yes. I just meant as a background story.
 
oh
 
6:53 PM
That would work. I'd probably either clearly specify it needs to be a perpendicular cut or use something like a folded string instead, to avoid cheatery diagonal answers.
 
hi all
I feel I haven't been here for ages :)
 
@Geobits oh, good idea
 
@Lembik I feel like you were here a few hours ago :P
 
@Lembik you haven't been here for so long that Sp3000 felt the need to post a challenge about binary strings.
 
no!!! :)
I need to find it
which one?
 
6:55 PM
17
Q: 0-1 Maximal Phase Counter

Sp3000Consider an array of bits, say 1 1 1 0 0 0 0 1 0 0 1 0 1 1 1 1 1 0 1 0 We call a contiguous subarray of length ≥ 5 a phase if at least 85% of the bits are the same and the first/last bits are both equal to the majority bit. Furthermore, we call a phase maximal if it is not a strict subarray of...

nontransitive dice was surprisingly popular for not spending much time in the HNQ... I still get a couple of upvotes trickling in every day
 
nice!
and I just bought some non-transitive dice :)
 
heh, nice
 
good coincedence
I feel my binary string crown has gone
I will need to move on to other things
I am sure I was about to post a new challenge last time I was here
but I can't remember what
 
there's a transcript :P
 
how do I find/search that?
oh I see
oh well I will think of some new ones :)
the main problem is giving good test inputs
when they are too large to paste into the question
how about this challenge...
given a binary string A of length 2n and a binary string B of length n
find the edit distance between B and all length n substrings of A
maybe make A of length 2n-1 so that there are n of them
too hard? :)
 
7:21 PM
could be interesting
that just reminds me, there was another binary string challenge yesterday by Zgarb
Is anyone else regularly annoyed by sentences like, "An odd number n is in general not prime."? (as opposed to "An odd number n is not in general prime.")
 
better: "An odd number generally is not prime"
 
@NathanMerrill no, that's the same problem. To me that reads like "it's a general statement that odd numbers are not prime", as opposed to "it's not a general statement that odd numbers are prime". So the version of your sentence I'd be happy with is "An odd number is not generally prime."
 
7:38 PM
"...is not in general prime" makes it hard(er) to parse to me. A better option of the first IMO would separate "in general" with some punctuation to indicate a pause (which would reflect the intent better to me). Commas, em-dash, parentheses... whichever your preference.
 
hm, I don't know... my point is that the "not" negates the "general" and not the "prime". if you separate off the "in general" that seems to group it with the "prime" even more strongly.
 
I have started a binary string craze :)
 
@Geobits although I sometimes feel that word order for negation works very differently in English and Germany anyway which probably adds to my confusion :D
 
I would like to ask a question about minimising the precise execution time of some code but I feel that cpu's are now too complicated and varied to make it meaningful.. sadly
"An odd number n is in general not prime" to me implies that no odd numbers are prime
 
@Lembik same here
 
7:42 PM
@MartinBüttner Agreed, negation in English is just weird sometimes. Even if your example is technically correct, though, it feels awkward and I wouldn't say it that way.
 
also the use of only has an even worse problem
I only sat there
I sat only there
 
It implies to me that most odd numbers are not prime, honestly.
 
only I sat there
@Geobits well that is true :)
 
Exactly my point.
But I think it should read "An odd number n is (in general) not prime." or equivalent.
I don't think changing the word order there changes the actual meaning, but it feels more natural to me this way.
 
then how would you say that "An odd number n is not prime" is a general statement? :P
 
7:44 PM
"'An odd number n is not prime' is a general statement."
 
Or if you're restricting n to non-prime odd numbers, I'd just say "A non-prime odd number n".
 
I have this weird obsession with going back to old golfs I've done and golfing them some more.
 
Oh the horror! Someone who doesn't abandon old work :P
 
In that old Rosetta Stone golf, "What's average anyways?", I had a 32 char J solution and I just kicked it down to 29.
 
7:57 PM
@algorithmshark that's a great thing to do!
 
8:17 PM
Wow, change more than 50% of a question without OP's consent and then ask for reopening.
 
@Optimizer The minimum required number was implied. It just needed to be stated explicitly. Otherwise, there would be a loophole where you just output "2" repeatedly until you have achieved your goal.
 
@Rainbolt you did not just add a victory condition. You removed the language limitation , added an extra rule that minimum numbers have to be outputted. Moreover, in the original question its nowhere even hinted by the OP that she wants it to be code-golf
@Rainbolt there can be scenarios that 2 unique combinations of unique powers can add up to N.
 
@Optimizer wow, I'm failing to do solve it in less than 22 bytes in CJam
 
we dont know which one to choose
 
The language limitation had nothing to do with the remainder of the challenge. I'm certainly not the first one to remove a language restriction that made no sense.
 
8:22 PM
@Rainbolt this can be very well a tips question
with the language restriction still in place
 
@Optimizer That's true without the restriction. But with the restriction, solutions are guaranteed to be unique
 
I am reverting it back. Please wait for OP to clarify things, even if she agrees with you
 
Wait
Only revert the language restriction.
You haven't established a good basis for reverting the rest of it.
 
the added rule is completely out of blue
the code-golf thing seems acceptable since this is PPCG
but still not sure.
 
2 mins ago, by Rainbolt
@Optimizer The minimum required number was implied. It just needed to be stated explicitly. Otherwise, there would be a loophole where you just output "2" repeatedly until you have achieved your goal.
 
8:24 PM
maybe she wants best time complexity
2 mins ago, by Optimizer
@Rainbolt there can be scenarios that 2 unique combinations of unique powers can add up to N.
 
Again, that's only true without the restriction.
Without the restriction, if the input was 8, I could just output 2, 2, 2, 2
Finding the actual powers of 2 would be dumb if I could just output 2 over and over.
 
@Rainbolt so its not implied that she wants the smaller combination
Are you not getting my point ? I am not even saying that we are allowed to output 2 again and again
 
But without the restriction you are allowed to do that.
 
your restriction is not just that
it prevents me to output X Y Z , instead of A B where X+Y+Z = A+B = N and none of them are same numbers
 
sigh An input cannot have multiple solutions without repeating a number.
So your X Y Z example makes zero sense
 
8:29 PM
is that a fact ?
 
Fact.
 
because bitwise ?
the restriction should then say "you cannot repeat a number"
or something on that grounds
 
Which is the exact same restriction...
 
but, we still need to hear from OP
its not your's or my question
if you want, you can put all these improvements in the comments
 
Ok, you win. I cannot read minds, and thus cannot make sensible edits. Instead, I'll wait two weeks and then repost my version of the challenge and immediately request that it be community wikid.
 
8:33 PM
1) It needs a winning criteria. [code-golf] would be good for that 2) the restriction is the only sensible way to do it IMO 3) Tips questions should have some example code to work/start from, so this isn't a good example of that.
I'm tempted to rollback the rollback for those reasons.
 
@Geobits It had one. Optimizer rolled it back.
 
again, she could very well be looking for best time/ good algorithm.
 
"2) the restriction is the only sensible way to do it IMO" < this
Because without it, answer could repeatedly print 2 2 2 2 2 2 .... 2 2 for every single input
Which is obviously a loophole that should be closed.
Not to mention the fact that the examples given by the OP agree.
 
why can't we simply wait to hear back from OP like in other questions which are put on hold ?
 
If looking for a time/algorithm, she should say that. Honestly it just looks like it wants any answer, in which case it doesn't belong here at all. At least the edits made it a viable challenge (if simple).
 
8:34 PM
and these improvements should go in as comments
not edits
@Geobits I remember making edits to a similar question, where the user wants just an answer , changing it to a challenge a while back
and then I remember you rolling it back
 
@Optimizer You seem to be under the impression that content posted on PPCG belongs to the original author. While they certainly have final say, I am by no means overreaching by making edits that make sense.
 
@Optimizer Can you point me to it?
 
yeah sure, let me go through my 34 pages of comments history and search it out.
 
Given that the author doesn't even appear to know how to use the site, I would venture to guess that "Wait to hear what the OP originally wanted." would result in "Well I don't know what I wanted because I'm new. 90% of the questions are tagged code-golf, so maybe I should use that."
 
I'm not saying I don't believe you, I'm saying that I don't remember it and I can't compare the situations unless I know which post it was...
 
8:38 PM
I was not being sarcastic there
 
Damn this text interface.
 
did you see any ;) at the end ?
;)
 
I normally only see those on good-humor sarcasm, not grumpy sarcasm, which I assumed it was ;)
 
hmm, so that question was a tips already , I guess unrelated then.
Some other day ;)
 
Ah, space invaders, right? I just found it in my revision history :D
 
8:41 PM
yeah
 
Having only one with the text "rolled back" in the last six months made it easier. I hardly ever roll back, that's why I was curious.
 
what is a revision history ?
oh
you sure do rollback my stuff
wanting to rollback this one too
:P
 
User > Activity > Revisions
:P
If waiting for the OP, I wouldn't wait long, to be honest. My main concern is that with the edit, I could vote to reopen. Without, I can't.
 
did I eat your lunch box without your knowledge in school ?
 
No, you did it with my knowledge ><
 
8:44 PM
were you upside down ?
crying..
 
Upside down yes. Crying no.
 
8:58 PM
@Optimizer It turns out that your Space Invaders edit is the only one I've ever rolled back here. I rolled back one of my own edits on an answer of mine, but I didn't really think that counted. You should feel special :P
 
all I did was eat your lunch once, that too looong time back
such a grudge holder
 
And I reverted one edit. Even now.
 
all of the arguing comments have 1 upvote in that question :D
 
Nice... I'd add my votes, but that would mess it up :(
 
9:44 PM
O_o
Magic
 
9:56 PM
@Geobits @PeterTaylor I've reworked the spec for the challenge. Let me know what you think. (I've removed the formal definition, because I figured with the story around it is now pretty clear and better than a formal definition could be. It also doesn't immediately give away what sort of algorithm I'm looking for.)
2
A: Sandbox for Proposed Challenges

Martin BüttnerInto how many pieces can you cut this string? code-golfarray-manipulation Consider a piece of string (as in "rope", not as in "a bunch of characters"), which is folded back and forth on the real line. We can describe the shape of the string with a list of points it passes through (in order). Fo...

@Doorknob you're good with SE'ss markdown and html capabilities, right? can you figure out why that second 2<sup>31</sup> in that sandbox post won't render?
 
@MartinBüttner isn't this oddly similar to your other sandbox question ?
most of the times the answer is n+1 where n is answer of the other one
 
there is no other sandbox question
 
ooohhh
:D
I missed that its you who posted it here instead of the new sandbox post bot
 
@MartinBüttner You had a missing </sup> way up earlier in the post. (Fixed.)
 
@Doorknob lol, thanks
@Optimizer just wrote a very inefficient reference implementation for the above challenge in Mathematica and it solves all inputs instantly
even for 1k entries it only needs a second
 
10:11 PM
some sort of set manipulation ?
 
that's possible too
 
so you have a non set based non counting based approach ?
 
I'm not going to tell you what exactly I'm doing... but there are both counting and set approach which will handle the test cases, and there is also at least one approach that needs neither sets nor counting.
 
I tried counting approach in cjam in java compiler, it was not able to handle 2^30 to 2^-30 values present at the same time
(i mean in 10 seconds)
 
I was hoping it wouldn't ;)
 
10:16 PM
and I am not talking about brute force
 
trying to count all segments between -2^31 and 2^31 sounds pretty brute force to me ;)
 
i did not say that
 
Hey, I found this site like codereview.stackexchange.com: exercism.io
have you guys used it?
 
oh, you changed the rules, now you cannot have sequences like 1 , 3, 5
also, I wonder if it is array-manipulation at all.
 
10:26 PM
@Optimizer yes you can
 
which is folded back and forth
doesn't hold true then
 
@Optimizer sure, the back and forth doesn't mean that it can't pass other points on the way
clarified
@Optimizer the approaches that I have in mind manipulate the array sufficiently to justify the tag I think
okay I think it's ready
@PeterTaylor I did like your 3D printer idea, but producing a visualisation seemed a bit trickier.
 
ughh, I have to manually remove , from those inputs
 
life is hard
 
mathematica is soo nice to do all the things that I want to do with these numbers
doing them in cjam is hard
 
10:35 PM
@Optimizer mathematica uses curly braces
0
Q: Into how many pieces can you cut this string?

Martin BüttnerConsider a piece of string (as in "rope", not as in "a bunch of characters"), which is folded back and forth on the real line. We can describe the shape of the string with a list of points it passes through (in order). For simplicity, we'll assume all of those points are integers. Take as an ex...

 
I did not mean that
I meant the manipulations i want to do with these pairs
 
right... yeah it was quite convenient
 
I'll call my super computer a very reasonable computer
 
I won't
 
clear that up
@MartinBüttner are you sure that the last test case gives 2 ?
I am getting 3
 
10:52 PM
sorry, accidentally deleted a minus when copy-pasting
 
something is wrong with me code..
gives 6 for that 6 case, 53 for that 53 case, and 1 less for others.
1 less should be the right answer by my code right now.
 
I like the problem :) I have an idea but I'm not sure about its correctness
 
almost done ..
 
11:11 PM
@MartinBüttner that python one and mine are the same algorithm, y is that slow ?
 
@Optimizer it's not I think
if I read it correctly he increments for every integer segment, not just for the first
 
oh
whats with gnibbler♦ ?
 
@Optimizer what's with him?
 
being active
 
happens every now and then
 
11:21 PM
We used to have another mod who was always active on meta but never participated on main.
 
I can golf my answer down a lot , but it exceeds the 10 second limit.
 
@Rainbolt dmckee?
yeah. I always thought he had surprisingly strong opinions for not participating on main, but I don't know if he used to be more active on main.
@flawr "I really enjoy your nice little just-before-I-go-to-bed-challenges!" awwww thanks ;) (in fact, I also post them just-before-I-go-to-bed :D)
 
@MartinBüttner He was very active in on SO before PPCG was even created.
 
yeah, that's what I thought
 
oh, actually it is still fast enough
 
11:42 PM
I wonder if the pyth answer can do under 10 seconds
 
@PeterTaylor What happened to the old crowd from the early days of PPCG? I see a lot of names I don't recognize on old meta posts. Is this natural drift of a userbase over the years, or was there some split in the community?
 
@MartinBüttner Yea that's the guy.
So how long exactly are we going to wait around for this OP to never come back? codegolf.stackexchange.com/q/44534/18487
Do I need to post on meta asking for a timeline of exactly how long I am required to wait for the original OP to get his stuff together before I receive elevated edit privileges from Optimizer?
 
I think flag for mod should be enough
no response from mod yet ?
 
Mod removed all comments, left no explanation.
 
or he declined ;)
 
11:48 PM
Great mods we have.
 
true
go to your profile and see the flags
 
Well, if the mod feels no need to explain, then I will abandon my attempts to participate on that question.
 
it will tell the response
 
edit went against network policy as per codegolf.stackexchange.com/help/privileges/edit. feel free to write a meta post if you think we should have a different standard.
 
this is his reply ?
true to some extent though .
 
11:53 PM
@xnor I'm not sure. I didn't participate in chat back then, so I don't know whether they discussed their reasons or just drifted away silently.
 
I see
in particular, I'm thinking of the "Golfscript is killing all fun" meta thread
 
But there wasn't any violent split in the community. The only thing that's really generated that much heat was code trolling, and that came later.
 
So that's it? I can't add winning criteria to challenges until I meta post about it?
 
IIRC that meta thread was from the first week of the site.
People who agreed with it wouldn't have stuck around long enough for you to have seen their names on many posts.
 
OK, that makes sense.
@Rainbolt I'd support a policy of assuming code golf for any post without a stated winning criterion, and editing it as such
 
11:57 PM
@xnor I'd support that too. Given we all first agree on it via a meta post.
3 more bytes...
 
May be possible to golf this a bit more, but it's bedtime now.
 
I expected more out of you Peter
a better algorithm.
some mathematical magic.
@MartinBüttner any idea if my two f{} block can be combined in some way ?
 

« first day (1446 days earlier)      last day (3380 days later) »