« first day (1489 days earlier)      last day (3359 days later) » 
00:00 - 17:0017:00 - 00:00

12:12 AM
@TheBestOne What is the exact value of that constant?
 
Uh... I used a graphing calculator to approximate it.
I have no idea.
 
okay
The first value of .735... is (Log[2] + 1)/Log[10]
 
A + ((5 + integrate(max(0, log10(x) + A) from 0 to 5)) / 5) -> A
Converges to about .7187493558
 
What about changing 5 to 50?
 
log10(10*x) + A = log10(x) + A + 1 for all A.
 
12:22 AM
0
A: Sandbox for Proposed Challenges

PhiNotPiCompressing the Atomic Ionization Energies This is a new type of compression challenge. In a normal compression challenge, you are required to recreate a list exactly. Here, you are allowed to round the values in any way you wish. What's the catch? Your errors are penalized based on how wron...

 
Does A stand for the same thing in both equations?
 
Yes.
A + ((5 - integrate(max(0, log10(x) + A) from 0 to 5)) / 5) -> A
I typed the wrong sign the first time.
 
Do you happen to know the full rounding penalty for either "output 1 for all inputs" or "truncated at decimal"? Those could be very short on bytes.
 
Is 3d space path-finding a viable challenge ?
 
@TheBestOne on a lattice? euclidean space?
 
12:29 AM
outer space, like through a dense field of asteroids ;)
 
No lattice, with gravity
 
@Geobits The penalty function does need a little bit of work, such as taking into account the decimal point.
13.598434005136 -> 13 is a penalty of about 12.51, but saves 13 chars.
because of the decimal point
saving a char without causing rounding
 
Yea, that's what I was wondering about. Yay for balancing acts :P
 
Change the values to have the same number of digits :P
7.6 -> 7.60000000
 
I could make everything the same length, although I don't think that would solve the problem by itself.
 
12:39 AM
anyone run the grid KOTH with the new bots?
 
I could make everything the same length and remove the decimal point from output.
Or simply remove the decimal point from output.
 
I was more concerned with loop(print(1)) type answers. It only adds a couple points to each penalty (over truncating), but it saves a huge amount of bytes total, since that's the whole thing.
(or whatever number gives the least penalty overall)
 
There may not be a good way to prevent those answers.
Rounding everything to 1 would save about 900 chars, which means it has to occur a massive penalty to balance.
This might be hard to fix.
 
1:05 AM
Hmm. Maybe you could add a rule that each number has to be +-1 from true to be considered a valid submission. Doesn't help truncating, but it should prevent any serious loop abuse, right?
 
0
A: Sandbox for Proposed Challenges

MickyTZeckendorf Number Representation Zeckendorf's Theorem states the every positive integer can be uniquely represented as a sum of one or more distinct Fibonacci numbers in such a way that does not include any two consecutive Fibonacci numbers. For example a valid Zeckendorf representation is: ...

 
1:36 AM
How do I find the size of a CJam array?
Or the dimension of it?
 
1:56 AM
@PhiNotPi If you mean length, then comma
 
Well, I found a slightly different CJam Sierpinski solution ],X+:X8mL
It's too similar to post as-is, and doesn't save any bytes.
Is there a way to... un-array something? [1 2 3] -> 1 2 3 on the stack?
 
Tilde
I have to say, that X solution you have is pretty trippy
 
2:13 AM
X~]:X,8mL also works
 
 
1 hour later…
3:15 AM
0
Q: Would we benefit from a tag that indicates a text-block scoring criterion?

Calvin's HobbiesA number of times now I have posted challenges where a rectangular block of text is the submission requirement. These are usually source-layout challenges. Examples: (other users surely have some too) Sierpinskified Code Reading Code in 8 Ways to Output 8 Numbers Code that runs the Game of Life ...

 
 
3 hours later…
5:53 AM
Woohoo! Tips are no longer CW!
13
Q: Re-evaluating [tips] and tip-like questions

DoorknobCurrently, all tips questions on the main site are Community Wiki. Furthermore, there are not many other non-challenge questions on the main site. These types of questions are generally supressed on PPCG. This should change. The first point I'm going to attack is the fact that tips questions ar...

I just flagged one yesterday on the old policy. Not having seen this.
In other news, I bagged-up some tricks for golfing in postscript.
So, now I can start looking for new challenges where I can use it!
 
 
1 hour later…
7:24 AM
nice! ** coming to Firefox and Chrome
 
8:13 AM
Piet is getting up votes just because its image based :D
 
Magic votes formula: Cleverness * IsPythonBonus * IsPietBonus * Humor * HNQ^2
 
8:48 AM
/isCJamBonus
 
8:58 AM
also writing out a number which is at least several hundred digits long is useful
 
as in ?
 
31
A: Smallest python script to print even numbers 0 to 100

feersumPython 2 - 12 characters print 8**999 The decimal representation of all even numbers from 0 to 100 can be found in the output: 1537789902701396471164448516595940643300892369671042144707647536450073500768341185969200084798241824478037061567564756135641105226122796029481353102581685414043699187...

17
A: Finding Programs in the Primes

feersumLenguage, M = ∞ All of the programs start at the beginning of the string. The following poorly written Python program calculates how many characters are needed for a given M. def program_length(n): PLUS, MINUS, DOT = '000', '001', '100' i = 1 s = '' while n > 0: i += 1 ...

 
9:52 AM
@Sp3000 can the ><> quine be adapted for CH's challenge?
 
10:14 AM
does ><> error on unknown characters or ignore them?
 
iMMA TRY cjAM
 
i'm starting with writing a regular quine for TECO
 
I was thinking Prelude (the score would be only be twice as large as a plain quine score, probably less), but then I couldn't be bothered
 
@MartinBüttner It errors, so no it can't
 
10:30 AM
hmm, having just 1 byte operator space makes it really tough
 
@MartinBüttner Also I'm not sure how the ><> quine would help because 1) You'll be opening/closing strings as you go and 2) I'd assume you'd need to take a log somewhere?
 
Math.log ?
 
well I've got my regular teco quine, It was actually easier than I thought.
 
are those : keystrokes too ?
 
no
 
10:37 AM
I mean, what is the final text in the editor window which gets evaluated ?
 
it 's code which can be invoked from the command line and executed from a file, as a proper programming language
 
Still, what is code left in the editor ? :)
 
@MartinBüttner nvm you mean CH's new challenge. Gotcha.
 
what do you mean @Optimizer?
 
considering there is an escape keystroke, what is the final text in the editor.
is the question confusing ?
 
10:39 AM
yes
 
y ?
 
it's not a keystroke. it's a byte 0x1b
 
how do you type it ?
 
if you are using it directly, then escape. From a file I use a 'character panel' and click on the number
There is some text in the buffer if that's what you mean. It is 73:^TV27:^TV
that buffer isn't displayed at all except when I command it to print
it does display a 1-character prompt after finishing the program
@Sp3000 the question specifically mentions a and I
 
... I'm blind :/
 
11:20 AM
ah, this word list is TWL with no "fuck"
 
11:47 AM
hey, what language has built-in "all permutations of an array"?
 
noo don't make the challenge easier!
 
Too late :P
 
i've almost got my TECO solution
 
Woo quine get.
 
It's an n^2 penalty though
 
11:53 AM
problem is, the vowels do bad things
need to brush up on my vowelless words, let's see
cwm
hm
what else...
sh
actually going for words would be pointless with new scoring system
should just post the shortest quine
 
Make that n^n
I feel sorry for Sp...
 
@Calvin'sHobbies I had to pull out the "I asked you whether I could use i yesterday and you said yes" trump card :P Didn't want to though
 
12:14 PM
hmm, no answers? ok, how about this: do you think the list of all permutations should be sorted? should it start with the given array? or doesn't matter?
 
@aditsu To answer, Mathematica. If you're implementing for CJam, sorted would be good, maybe lexicographical?
 
@Sp3000 ok, so [3 1 3] for example should return [[1 3 3][3 1 3][3 3 1]] ?
I don't think I can try Mathematica easily :p
 
Oh, actually...
Interesting, Python doesn't actually do lexicographical like I thought
[(3, 1, 3), (3, 3, 1), (1, 3, 3), (1, 3, 3), (3, 3, 1), (3, 1, 3)]
It starts with the given array :P
(and has duplicates)
 
and has duplicates :p
also, not very sorted
I wonder if it uses the swap algorithm
 
Yeah it's lexigraphical... in the order of the original array!
 
12:19 PM
oh, you mean it applies [0 1 2], [0 2 1] ... [2 1 0] to the array?
 
Yeah it seems
For [3, 2, 1]:
[(3, 2, 1), (3, 1, 2), (2, 3, 1), (2, 1, 3), (1, 3, 2), (1, 2, 3)]
 
anyway, I think the easiest for me would be to sort the array first and then keep applying the next-permutation algorithm
 
12:48 PM
seems to work :)
 
1:01 PM
so, I'm looking at this problem:
I am I accurate in assuming the solution is the sum(1..len(str)/2)?
 
what problem?
 
grc
@NathanMerrill it doesn't look that simple
 
you're right. But I think it is
 
hmm, by that definition it seems that every palindrome that can be split down to 1 character is ∞-palindrome
 
1:10 PM
no?
 
including their example, "abaaba"
 
the problem statement doesn't say that the prefixes or suffixes need to match
 
grc
what about: abacabadddddd
it should still be 6 right?
 
@NathanMerrill what do you mean match?
@grc that's not a palindrome at all
 
grc
@aditsu but some of its prefixes are
 
1:13 PM
well, "palindrome" implies that the string is actually a palindrome, but they don't actually say that anywhere
oh, yes they do
 
@grc ah ok, in that case, always ∞ :)
 
"if it is a palindrome itself"
nevermind
ok, this problem is now significantly harder
 
grc
@aditsu why? the empty string is defined as a 0-palindrome
 
@grc all strings are defined as 0-palindrome initially
if you rely on that, then the answer is always 0 :p
 
empty string is 0, 1 character string is 1, 2-3 character palindromic string is 2
 
1:17 PM
empty string is ∞, 1 character string is ∞, 2-3 character palindromic string is ∞
 
why is empty string infinity?
oh, because 0/2 = 0
 
delighted you asked :) suppose empty string had a palindrome degree n, then its half prefix and half suffix which are also the empty string also have degree n, then the string has degree n+1
 
I'm currently writing the reference implementation for my Paeth challenge.
It's fun.
 
ok, assume that the degree of the empty string is defined to be 0. What should be the answer to "CCeCeCCCee"
 
@NathanMerrill anyway, even if they specify the problem correctly, your sum doesn't look like it has anything to do with what they are asking
 
1:23 PM
@aditsu you are right. If they didn't include the "is a palindrome itself" part, it would be the right answer
 
I'm not sure it would.. anyway, doesn't matter much
for that string, I guess the non-0 prefixes would be C, CC, CCeCeCC
 
grc
I don't think CCeCeCC works
 
why not?
 
it would be non-0, but not necessarily 2
 
grc
it would get broken into CCe and eCC, which aren't palindromes
argh my bad
 
1:26 PM
those have degree 0
 
also, wouldn't "eCe" be a non-zero prefix?
oh, no because its in the middle of the string
C = 1, CC = 2, CCeCeCC = 1 so 4
 
eCe is not a prefix at all
heh, they write "polindrome" in one place :p
 
I should be deleting my challenge in the sandbox for proposed challenges. Just a heads up to those who may edit the submission directory that I'll remove "Grandes complications" :-)
 
I should edit mine..
 
1:56 PM
hmmm...so, I have a correct solution to the problem I described above
but it is o(n^2) time
is there a more efficient way to check all substrings for palindromicness in less than O(n^2)?
nevermind
 
@NathanMerrill did you find a way?
 
I thought I diid
but I realized I didn't
I need to check all prefixes for palindromicness
and it was talking substrings
Ok, here's a question. If I know that a prefix of length N is a palindrome, do I know anything else?
 
2:16 PM
I think I know how to solve it
(the big picture)
 
In less than O(N^2)?
 
in O(N)
 
ok, go on
 
first, it all reduces to checking if prefixes of various lengths are palindromes
 
which is O(n^2)\
I have the rest of the algorithm in O(n)
 
2:19 PM
not in my solution
the way to do that is to search for the string in its reversed string
substring search is linear
 
that is O(N^2)
 
yes, but you are doing it for every prefix
 
no, O(m+n), which in this case is N+N
 
and you will be iterating over all substrings, no ?
exactly
 
there are N prefixes, thus N*N
 
2:21 PM
no
I search for the whole string inside the whole reversed string
but the algorithm needs to be modified a bit
 
^ not a palindrome
:(
 
the algorithm I use can identify partial matches
if the partial match goes up to the middle, we got a palindrome
 
I don't understand.
 
me neither
code it
 
You have two strings, the original and the reversed
you compare the two, starting with 0
if you get to the middle, then its a palindrome
 
2:24 PM
if you find a mismatch, you jump to the next possible position
 
that algorithm, for a single string is O(n)
what's the next possible position
say I was currently checking at position 4, and the strings didn't match
 
it's just like substring search.. let's take abababc, search for it in cbababa
position 0 doesn't match, go to position 1, then 2
at position 2 we can go up to half way so it's a palindrome
 
that's still O(n^2)
 
still n**2
 
then we jump to position 4
not if you use my algorithm
 
2:27 PM
the one you just described is
EEEEEEEEIEEE
 
well, I haven't explained how it jumps from 2 to 4
 
how do you tell that position 0 does not match ?
 
@Optimizer a != c
 
just those two chars ?
 
yes, that's already a mismatch
anyway, the general search algorithm is included in CJam, let me point you to the code
 
2:29 PM
ok so next what two chars you compare ?
 
aditsu, why would you jump to position 4?
 
the algorithm includes a preprocessing step which identifies occurrences of prefixes of the "needle" string inside itself
bah, I should just use a pastebin
 
that's my O(n) substring search algorithm
O(m+n)
 
still n**2
 
2:34 PM
how is n == n**2 ?
 
i never said that
 
I said it's O(n)
 
you have to think about worst case
you are saying its O(n)
I am saying its O(n**2)
 
Is there a way to find the "dimension" or "complete size" of an array in CJam, so [[[2]2]2] gives 3 and not 2?
 
well, you are not wrong in the sense that O(n) is included in O(n^2), but you are wrong if you say it's not O(n)
 
2:36 PM
O is worst case
it cannot be both
so. find "abcdefg" in "abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefg"
i gotta go, will be back in 30
 
I'm preparing a judging program for my next code-golf challenge. Can somebody tell me if it contains any grave mistakes?
 
yes it refers to worst case, if you go by the definition it's in both but the way people commonly use it, it's O(n)
@Optimizer that's really simple, after finding a mismatch for "g" starting from position 0, it will jump directly to position 6
that's what the preprocessing is for
anyway, everybody knows (or should know) that substring search is O(m+n)
this is one such algorithm
which can be adapted for palindrome testing
 
ok...I don't follow your algorithm. How would it work for a string with 99 "E"s in a row?
 
back in a minute..
 
2:53 PM
@NathanMerrill well, that would just find a perfect match
or you want to know how it goes to the next position?
 
yes, it would find a perfect match for the full string
 
the idea is: it knows 99 E's match at position 0, then it goes to position 1 and already knows 98 E's match
 
how does it know that?
 
from the preprocessing
 
which does what?
 
2:55 PM
nobody cares about me.
 
@FUZxxl I would recommend simply running test bots against it
 
hugs FUZxxl
 
@NathanMerrill 'kay
 
personally, I've yet to write a controller that was bug free on release
 
@NathanMerrill as I said, it identifies occurrences of prefixes of the string inside itself
 
2:56 PM
by bug free, I mean "it didn't have bugs found by other users"
 
@aditsu yes and then again after a mismatch of g, it will go to position 11, then 16 and so on
 
I'll have to review it and test some results to give more details, as I wrote it quite a long time ago
 
this is the case when there is no overlap
search "abcabcabd" in "abcabcabcabcabcabcabc"
 
why is it searching for that @Optimizer ?
 
@NathanMerrill what ?
 
2:59 PM
ok I'll try to give some examples of preprocessing results
 
you guys must be on a different tangent, because "abcabcabd" is not a prefix of the strings
 
Ah, okay, my code is completely incorrect.
hm… let me fix it.
 
well, anyways, I need to be off
see you guys later
 
@Optimizer for "abcabcabd", the preprocessing seems to give [-1, 0, 0, -1, 0, 0, -1, 0, 5]
@Optimizer and when searching, the only "shortcut" seems to be jumping from the 8th position back to the 5th position in "abcabcabd"
(0-based)
and it does that 5 times
so I'm still not sure what the issue is.. you don't believe substring search is linear? you don't believe my code is one such algorithm? or what?
some similar algorithms are mentioned at en.wikipedia.org/wiki/String_searching_algorithm
 
3:29 PM
looks like everybody left, and I don't know if anybody understood what I'm talking about :p
 
that's sad
hey @randomra
 
I'm afraid to say hi back...
but assume I did :)
 
3:46 PM
0
Q: Paeth-transform arrays

FUZxxlOne of the key parts of PNG's compression algorithm is the Paeth transformation, which transforms the image in a way that makes it compress better (usually). In this challenge, your task is to write a function to compute a Paeth transformation. The operation of a Paeth transformation is described...

@randomra Look at this challenge! It's neat.
@VisualMelon Hey!
 
@aditsu please make the permutation operator return duplicates. Filtering them out manually is trivial, adding them in isn't.
 
why would you want duplicates?
 
I think I've figured out how to quine in Prelude. It's not going to be nice though and it won't be adaptable for CH's challenge. I'll have to try it out when I get home.
@aditsu there are applications where you do want count all permutations, treating duplicate elements as different.
 
you can still do 3e![3 1 3]ff= -> [[3 1 3] [3 3 1] [1 3 3] [1 3 3] [3 3 1] [3 1 3]]
if you just want to count them, it's factorial :p
 
4:04 PM
@FUZxxl example output would be useful
 
that was a nice new word :)
 
CH's challenge might be possible in Java 6.
 
@randomra Run the reference program to make some!
 
byu-ze-ful
 
not just for me but generally
in the question
 
4:09 PM
@aditsu I think Martin means permutations of a certain type, e.g. permutations where all1s come before a 2 but not after 3 in [1, 1, 2, 2, 2, 3, 4, 4]
Or something less silly
 
that doesn't make any sense..
 
Maybe if I could come up with better examples on the spot...
How many ways can you arrange 4 girls and 4 boys so that no two girls are next to each other?
Something like that
 
that's extremely specific, and still doesn't benefit from duplicates
 
Never mind, CH's challenge is impossible in Java :(
 
@aditsu, sure it does
Otherwise you need to multiply the result by 2*4!
 
4:15 PM
^^ exactly that
 
hmm, depends if you count "girl 1" "girl 2" "girl 3" "girl 4" or just "girl" "girl" "girl" "girl"
 
You do the latter because the former makes it hard to c check the restriction
 
you do the latter for checking, but I'm guessing you want the former for counting?
that's the only way duplicates would make sense
 
It helps whenever you want to count the number of permutations of distinct elements where the permutations are restricted based on properties shared by multiple elements
 
is that important enough? now I'm thinking whether I should make another operator for that :p
or.. I could rethink the way I plan to use e! and m!
 
4:24 PM
I think simply the fact that both interpretations are perfectly valid in the presence of duplicates, and one is much easier to compute based on the other, speaks for including duplicates by default.
 
why is this correct in J? (]-3)i.10 returns 1
 
@MartinBüttner what about this? dpaste.com/0YYNPAD
 
@randomra because (]-3) is a noun.
try (]-3:)
 
just realized and facepalming..
 
@aditsu that's just inconsistent and confusing :P
And m! with duplicates is pretty useless because it only saves one byte
 
4:29 PM
m! with duplicates? what is that?
ah, last one
well, it saves 4 bytes
at least
 
How? Isn't it equivalent to ,m! ?
 
,m! returns a number
wait, what do you have before the comma?
 
what is m! ?
 
Ohhhh, I thought it was number of permutations
 
when did it come into being ?
 
4:33 PM
@Optimizer possibly in an hour or so from now
 
what does it do ?
is it the e* that i requestd ?
 
that's what we're discussing :p see the paste I linked above
 
i dont see how factorial fits into picture
 
@PeterTaylor I'm almost inclined to think it'd be better for you to post that as a separate answer, considering the tricks you used to remove 2 chars from the bottom row
 
the factorial is the number of permutations
 
4:35 PM
and i agree that with dupe is more useful
one more thing, this is no where near what i requested :)
so its a different thing
we still need a generic perm calculater
 
I think what you requested are not permutations
so yea it's a different thing
@MartinBüttner @Optimizer would you just want an operator for permutations with duplicates? and do away with the no-duplicates option?
 
sure
or if you can proide both, y not ?
@aditsu I requested perms only, just ability to control length of perm
 
if you're talking about different lengths, those are not permutations at all
from what I understand, you'd like a kind of cartesian power operator
 
yes
its just all perm of a given length
:P
 
no, they're at most combinations with repetition
or more likely, arrangements with repetition
 
4:45 PM
whatever. when is that due ? :P
that is I think more useful than a full fledged perm
 
when I feel like it :p
did you file a ticket?
 
I think I did, but chances are sourceforge was down and I didn't :P
 
@MartinBüttner I doubt you filed a ticket for Optimizer's request
so anyway, if nobody objects, I guess I'll go ahead with the new plan at dpaste.com/0YYNPAD
 
I wanted to request a bunch of combinatorics-related operators
 
you did request permutations, just didn't go into details
anyway, I also wanted some of those operators
@MartinBüttner do you think the permutations should be sorted?
 
4:57 PM
Sure, any fixed order is better than undefined order
 
e! with array is already sorted, I'm thinking of implementing m! with array like this: chat.stackexchange.com/transcript/message/20263442#20263442
 
00:00 - 17:0017:00 - 00:00

« first day (1489 days earlier)      last day (3359 days later) »