« first day (1767 days earlier)      last day (2121 days later) » 

3:03 PM
Added if statements! :D
@MartinBüttner Oh hey I found that earlier
@NewMainPosts Slightly disappointed that this isn't in OEIS.
perhaps its too easily calculated with a simple formula
@MartinBüttner That 4x8 tiling, I mean
I found it while running ... I forget who's code for exhaustive search
I posted it later, but everyone had fallen asleep by that time
if 1 > 0:
The first line is a conditional (statement), but what would you call the second line?
3:12 PM
@Sherlock9 orlp's
@MartinBüttner Thanks. I've been dropping things out of my head left and right lately
@MartinBüttner I should write down who made the Game of Life using Python 2 and #
@ZachGates I usually see it referred to as a clause or the more generic block, but sometimes a suite (as in the python docs).
@Geobits I was thinking about "code block", but "clause" just sounds better, IMO. Thanks!
fwitw, I think it's also a statement
unless you want to refer to the entire thing if there are several lines
in which case I'd call it a block
3:18 PM
Clause is sometimes used for the conditional itself, too, just to add a bit of pain :/
^ I'd call that an expression
/: I'll stay with "block" then
Whatever you do, be consistent ;)
What happens when your developers are board: Task #12345 created - Remove not equals logic from all stored procedures.
Apparently we don't like <> operations anymore
I didn't even like it when I first met it. <> has always bothered me for some reason.
3:21 PM
@Rainbolt Last I remember, Python 3 removed those entirely
Yeah. -ne is much better. :)
@MartinBüttner At any rate, you guys probably found that tiling before I did
well, I didn't
and I think orlp wasn't looking into 4-in-a-row
oh wait
that was 3-in-a-row
Ohhh, I see where this task came from.
Yeah, I haven't tried modifying orlp's code to look for four-in-a-row
3:24 PM
oooh, a "tiler" would be a great PPCG challenge
especially if the tiles don't have to be a square
@NathanMerrill and/or contiguous? :P
what do you mean by contiguous?
Apparently not equals is bad in where clauses in SQL: mssqltips.com/sqlservertutorial/3203/…
meaning, there can be empty spots?
holes or gaps
you can tile the plane with:
3:26 PM
getting the input right is the hardest part of this challenge
so, it accepts two parameters: first parameter is a list of (x,y) offsets and the second is the string to be duplicated
and if they want to accept it via stdin, then a space counts as a blank space (and can be overwritten)
and guarantee that no other character will be overridden with the offsets
oh, what's the output?
a 20x20 square?
@NathanMerrill That sounds like a decent enough question already. Sandbox it?
nah, I think I'm just going to post it
I'm in the middle of writing it
3:43 PM
@Rainbolt Is that so surprising? Those cases assuming you're returning "almost all" rows in the table, so a table scan is to be expected.
Hey, Eumel wants to send me an .exe of his LabVIEW code for one of my questions
Trouble is, SO and SE don't have private messaging and I'm not keen on giving out my email address
Any idea how we can send stuff?
With this tiling question, I feel like I'm playing Sudoku ... "No, that can't be a one, because it would put four in a row here ..."
What's all this tiling stuff? Looks interesting.
we've got two tiling discussions
the first is this question
but we are doing 4-in-a-row
3:51 PM
Let's say you have six possible values for a column {1,2,3,4,5,6}, and you know that 90% of the values are 1.
Original condition: A<>1 AND A<>2 AND A<>3
Modified condition: A=4 OR A=5 OR A=6 -- or A IN (4,5,6)
The original condition should short circuit on the first condition 90% of the time. The second condition will have to check all three conditions 90% of the time. To a programmer with no real training in SQL performance tuning, the first should be faster.
the second is writing a program that tiles for you
which I'm about to post about
Also, another variation on @MartinBüttner's 5/8 tiling:

Okay, cool. I know people who are working on this type of stuff.
@ChrisJester-Young It's probably not surprising to a SQL veteran who knows the difference between seeks and scans and how indexes can impact performance. I'm still learning.
@NathanMerrill I don't quite understand what your input is now
3:54 PM
@MartinBüttner I'm going to use this ok?
its a good example of tiling that isn't grid based
orthogonal based?
not sure how to term that
my input is a string
"non-rectangular prototile"?
that and the fact that the tiling isn't (0,y), (x,0)
bah, mis-enters
oh right
@NathanMerrill what does that string represent though
3:57 PM
I'll sandbox it
very good idea ;)
I am working on a JS interpreter for a language (Labyrinth)...
What should I use to do each step?
a) a while loop
b) a for loop
c) setInterval (Using that one right now)
d) requestAnimationFrame (I doubt I could use that)
e) a web worker
f) something else?
unless you're going to animate the execution, use a while loop
Ok! :D
(But a for loop is shorter, goto is cooler...and web workers sound fancy... :P )
> goto is cooler
> for loop is shorter
web workers do sound fancy, I'll give you that
4:03 PM
A: Sandbox for Proposed Challenges

Nathan MerrillTiler In this challenge, you need to take a string and tile it. For example: abc abcdefabcdef def -> cdefabcdefab efabcdefabcd You will be given 2 inputs (either via function parameter or STDIN): a list of offsets, and a string to tile. The offsets will be in (x,y) for...

So, for loops are way shorter!
(And I like dinosaurs..)
while(1) doesn't work?
not that it's shorter than for(;;), but still
Oh, that does work... :D
@Stefnotch outside of golfing for(;;) is only cool in C/C++, provided you add a macro #define ever ;;
I'd rather #define ever (;;)
4:07 PM
does that work? I thought the preprocessor only touches separate tokens
but maybe it's even dumber than that
no idea
I keep running into variations on the 5/8 tilings ...
Can you "override" goto with #define?
@NathanMerrill I'm pretty sure it doesn't break up tokens... that would wreak all sorts of havoc...
@Stefnotch you can do worse things: stackoverflow.com/a/771974/1633117
4:09 PM
ok. I thought the preprocessor was before tokenization
#define a bb
#define b aa
Is that even worse?
@NathanMerrill I think it does its own tokenisation, which is a bit different: gcc.gnu.org/onlinedocs/cpp/Tokenization.html#Tokenization
@Stefnotch not really.
A: Sandbox for Proposed Challenges

Nathan MerrillTiler In this challenge, you need to take a string and tile it. For example: abc abcdefabcdef def -> cdefabcdefab efabcdefabcd You will be given 2 inputs (either via function parameter or STDIN): a list of offsets, and a string to tile. The offsets will be in (x,y) for...

@NathanMerrill you'll need to come up with 10 more characters for the title ;)
oh now I see what you mean
wouldn't it be more interesting to provide only the prototile and ask for a tiling if possible?
i.e. make the answers figure out a valid offset
Q: An alphabet position quickie to motivate us all

A. BurnheimerIt has been said, or copied from http://ifunny.co/fun/SiQ7PlRR3 rather, that if... A B C D E F G H I J K L M N O P Q R S T U V W X Y Z equals... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 then... K + N + O + W + L + E + D + G + E 11 + 14 + 15 + 23 + 12 + 5 +...

4:14 PM
(and require a that the tiling is gap free, or it should indicate if no gap-free tiling is possible)
I have an idea: You all remember the question: count the number of sums of squares, right?
Two input numbers, n and p, where the question is to check what is the minimum number of p-th powers that are needed to sum to n
Like 7 needs 4 squares, n=7 p=2
I'll need to come up with some large test cases for things like cubes, 4th powers and 5th powers, but for now, what do you all think?
sure why not?
Excellent. I'll go round up some test cases
@MartinBüttner How would it deal with this:
there are two totally valid tilings
actually, more than that
Even color codes work :D (PPCG Playground)
4:26 PM
@Sherlock9 related
(in Wikipedia, not PPCG)
@Zgarb Yep. It's where I got the idea
@Zgarb I'm thinking of allowing negative cubes in there, though
so many people are upvoting my Weakest link challenge, but I've only received 2 answers :(
maybe you are the weakest link?
@NathanMerrill I'd accept any tiling that only involves translation
@Zgarb Do you happen to know if there are some simple conditions a polyomino has to fulfil to be able to tile the plane without gaps (and without rotating or reflecting it).
4:45 PM
@MartinBüttner Hmm, nothing comes to mind right now.
This gives a sufficient condition.
interesting. that one seems to allow rotations though.
(so for it to be sufficient, it might actually require rotations)
Okay, here's a characterization and n^2 algorithm: lama.univ-savoie.fr/~vuillon/IanRAIRO.pdf
Q: Hexagonal maze time!

J AtkinTime for another maze challenge, but not as you know it. The rules for this challenge are a little different than most of this kind. The tile types are defined as follows: S: The location on the maze you start at E: The location you are trying to get to 0: Wall that you can't cross +: Floor th...

@Zgarb llama*
"A polyomino P tiles the plane by translations if and only if the boundary word b(P) is equal up to a cyclic permutation of the symbols to X Y Z X' Y' Z' where one of the variables in the factorization may be empty."
@Optimizer Their logo is a llama: lama.univ-savoie.fr/index.php
4:54 PM
@MartinBüttner does it make more sense to have them output the 20x20 square, or a list of offsets?
I liked the idea of outputting the tiling, if possible.
I like the 20x20 because it is more human-readable
but the offsets is easily extendable
make it 30x30 and it should be big enough to cover any test cases a solution will be able to handle in a reasonable amount of time :P
@Zgarb Thanks for digging that up. Any luck for non-contiguous polyominoes? (Or whatever you'd call them in that case.)
Someone else code something... coderpad.io/GMD6794F
5:00 PM
@MartinBüttner There's probably an algebraic characterization, but I can't recall one right now.
@Calvin'sHobbies print("something")
Traceback (most recent call last):
File "prog.py", line 1, in <module>
NameError: name 'code' is not defined
What is the best way to have a billion images in a billion places in Javascript?
@Stefnotch jQuery
5:07 PM
(I don't like JQuery...)
1 million libraries later
@Stefnotch Error parsing question.
Ok, let me rephrase that:
What is the WORST way to have a billion images in a billion places in Javascript?
I'm also pretty sure you'd hit a browser out-of-memory error well before you hit 1 billion images loaded, regardless of what JavaScript code you were using ...
5:12 PM
(I tend to exaggerate...)
Arcyou needs better string handling...
Algorithms for when the size of the tile is a prime number or 4
@Stefnotch array filled with a billion image URI's (pick only short links), then ajax load in a loop each one replacing the previous, few seconds timer, or smth. would requite ~20GB ram give or take another 20
@Stefnotch And I tend to read things literally when it allows me to be a sarcastic wise-ass while doing so. :D
5:18 PM
Hey guys I'm trying to do operator overloading. What should "a string, squared" be?
(And the square roots of lists and strings :P)
Maybe some magic string compression algorithm that doesn't get described in the specs?
Square of a string? Maybe the string concatenated (string.length) number of times?
That makes sense. Thanks ^
@Stefnotch Haha, nice
@Zgarb wow, thank you
needs more llama
5:23 PM
Ok, fixed!
@MartinBüttner It seems that the general case is still an open problem.
not enough jQuery!
@NathanMerrill I asked your tiling question on quora too, just to see if any over there is smrt.
people still use quora?
5:24 PM
that was exactly what i said to myself about SE before i showed up here
@CSᵠ ಠ_ಠ
@MartinBüttner Mine was a legit caret
5:25 PM
mine too
array / (anything) = ?
Really tempted to ^ the "mine too" ...
@CᴏɴᴏʀO'Bʀɪᴇɴ slice
or chop
@MartinBüttner looks good?
A: Sandbox for Proposed Challenges

Nathan MerrillTiler In this challenge, you need to take a string and tile it. For example: abc abcdefabcdef def -> cdefabcdefab efabcdefabcd You will be given a string to tile either via function parameter or STDIN. Spaces in the tile are considered "blank" and can be overwritten by...

5:26 PM
@quintopia "chop"?
any other interesting tilings you can think of?
As in, at every nth index?
@NathanMerrill one second
@CᴏɴᴏʀO'Bʀɪᴇɴ yes exactly
@CᴏɴᴏʀO'Bʀɪᴇɴ ith
5:27 PM
@CSᵠ kth
@Zgarb open problem in the sense that there is no general known condition. or open in the sense that there are certain clusters for which we don't even know how to figure it out algorithmically by brute force?
@NathanMerrill ^ the latter would make your challenge slightly impossible
you mean my last tiling?
array / (something) should return an array of arrays, sliced by thesomething (either literal if it's numeric, or length-of-string, etc.)
if it doesn't divide evenly, the last array is truncated
5:28 PM
@NathanMerrill oh you're not even asking for gap-free tilings
@TimmyD Show me an example?
My mind isn't working right now :P
no, minimizing the gaps
[1,2,3,4,5] / 2 ==> [[1,2],[3,4],[5]]
how minimized?
@TimmyD ohhhhhh
5:29 PM
as possible?
you could do floats, too
@TimmyD nice
@NathanMerrill in the 30x30 block, or in terms of density?
@NathanMerrill how can you calculate the most optimal?
[1,2,3,4,5] / 2.5 ==> [[1,2,3],[4,5]]
5:30 PM
@MartinBüttner either sounds fine. If density is near impossible, then 30x30 block
@TimmyD Rounded up?
@CSᵠ Yeah - Raspbian distros come with Mathematica installed now.
@NathanMerrill there's another thing: do the tilings have to be regular?
[1,2,3,4,5,6,7,8,9,10] / 2.5 ==> [[1,2,3],[4,5],[6,7,8],[9,10]]
5:30 PM
Welp, having looked at sums of p-th powers == n, I'm going truncate the possible p to 2<=p<=4
Even fifth powers are too much @_@
@MartinBüttner I'm pretty positive that an optimal tiling is going to be regular
^ I was wondering about that, but I don't actually know
well I mean, I can think of optimal irregular tilings, but then a regular one exists as well
especially because we aren't allowing rotation or reflection
@VoteToClose $2,745 or 300/yr ?!?!??! for free in a distro?
@TimmyD So... alternating round up/down?
5:32 PM
well, we've never come up with an irregular tiling that couldn't be converted into a regular one
@CSᵠ yes, Mathematica's been on the pi for a couple of years now
@CᴏɴᴏʀO'Bʀɪᴇɴ Well, in that instance, because 2.5*2=5 so you get a cycle
@CᴏɴᴏʀO'Bʀɪᴇɴ discard float, treat as int (floor)
@NathanMerrill there's no conversion here, because you're prescribing the prototile
5:33 PM
@TimmyD Huh. Is there an existing implementation?
*reads the chat*
*gives up, 2 (or more?) conversations at the same time*
It was the main reason for me attempting to emulate a raspberry pi. xD
prototile XO, optimal irregular tiling:
Which failed miserably, of course.
5:33 PM
But still.
I can even tile that aperiodically by using a Fibonacci tiling to alternate between offsets
@MartinBüttner Having read that message without context, I thought "on the pi" meant "gone loopy"
oooh, I understand
@CSᵠ I see that CG has taken your interest, since you haven't left yet.
@Sherlock9 this is also true.
5:34 PM
@Stefnotch I'm talking with @TimmyD and @CSᵠ; @MartinBüttner is talking to @Sherlock9 and @NathanMerrill; @VoteToClose is talking to himself ;)
do raspberry pi zeroes also have mathematica?
@VoteToClose it sparked a something, had it in me for ages
however, because every prototile can converted into a square tile (without changing the tiling), I think it is safe to say that the optimal tiling is going to be regular
had to get rid of the "skills" for business, readability seems important for office folk, sigh :PP
@CᴏɴᴏʀO'Bʀɪᴇɴ You'd get a different cycle if you ` / 2.75` ... maybe something like [[1,2,3],[4,5,6],[7,8],[9,10]]
5:36 PM
@NathanMerrill re your edit, I think you should still explicitly mention whether your counting that ratio inside the 30x30 block or in the infinite plane
@VoteToClose @CSᵠ I used to do those projects where you factor really large numbers, because messing around with code for factoring was really fun. Now CG fills that coding-shaped hole in my life
@MartinBüttner is it going to be near impossible to do it in the infinite plane?/
also, yes it may be true that regular tilings are always optimal, but that doesn't answer whether submissions may produce irregular ones if they give the same ratio ;)
Or, like @CSᵠ said, just drop the decimal positions and floor the divisor
@CᴏɴᴏʀO'Bʀɪᴇɴ Yeah, of course I'm talking to myself. Why wouldn't I?
5:36 PM
@MartinBüttner yes irregular ones are acceptable
@NathanMerrill I think you'll have to ask someone like Zgarb or Peter to tell you that.
@VoteToClose Stop talking to him - you're making me jealous.
@VoteToClose Oh, hush, you.
well, if it is going to require their input, then 30x30 it is
@VoteToClose I think we should stop speaking now.
5:37 PM
I don't want this to be a "genius-only" challenge
@Sherlock9 i verbosely hardcoded the output of everything constant
@VoteToClose Ugh, fine.
@CᴏɴᴏʀO'Bʀɪᴇɴ I can't think of a directly-the-same existing implementation, but slicing an array is decently standard in many language
@NathanMerrill I don't know how difficult it would actually be, but I can't spend much time thinking about it right now
@CSᵠ Sorry?
5:38 PM
@MartinBüttner that's fine
@MartinBüttner In the former sense, I believe. If there is a smallest known possible counterexample, it's got to be huge.
@TimmyD I can do it by flooring, but the decimal bit stumps me.
@Sherlock9 apology accepted.
Truncating to int in Vitsy suuucks.
@CSᵠ No, wait. Hardcoded the output of what?
5:39 PM
sorry, whenever I see someone say x in y sucks I just see y sucks
@VoteToClose You're writing the bloody language. Fix it
I am righting it, but that's how I wrote it.
righting haha
@Sherlock9 say hour in seconds would always be 3600, and not a 60*60 expr
5:40 PM
@VoteToClose pnt is truncate in Jolf
@Sherlock9 Righting was actually contextually correct in this case: to right something in England means to fix, to set to a position in which it is not "wonky".
@anOKsquirrel regex in javascript sux!
> javascript sux
> wonky
@MartinBüttner actually, tiling does need to be regular, because if I'm measuring minimum number of spaces in a fixed area, I may be able to remove a space or two by making the edges irregular
5:41 PM
@CSᵠ ಠ_ಠ cc @anOKsquirrel
Alrighty. I must leave.
I hunger.
@CᴏɴᴏʀO'Bʀɪᴇɴ Like, you need to "accumulate" the decimal part until you have enough to include an additional element in the sliced array.
And need to go home.
@VoteToClose Fair enough. I still edited my message to what I meant first
5:41 PM
@VoteToClose Bye
@CSᵠ better than python
Whether you do that by rounding or by literally accumulating is up to the implementation.
IT is important that you have this sushi in your life
@anOKsquirrel Didn't the regex module do better?
5:42 PM
@Sherlock9 who wants imports to do regexes?
@anOKsquirrel What's your opinion of Ruby regexes?
@anOKsquirrel nope, py has backref, js knows not what those are
@NathanMerrill you are aware though that you can also change the number of spaces by a simple translation if the period of the tiling doesn't divide 30?
@Sherlock9 ruby sux
5:42 PM
@MartinBüttner correct
@anOKsquirrel wat
[1,2,3,4,5,6,7,8,9] / (4/3) ==> [[1],[2,3],[4,5],[6],[7,8],[9,10]] could be an example
@anOKsquirrel got a point there, even more in cg
@MartinBüttner for code golfing that is
@CSᵠ it does
5:43 PM
@TimmyD Oh!
but it doesn't have lookbehinds
@TimmyD why would you want that?
@MartinBüttner That be true
@CSᵠ Why? I dunno. Why are you dividing an array by a float in the first place? ;-)
@TimmyD except there is no 10
5:44 PM
@TimmyD because [1,2,3,4,5,6] / 0.5 == [[1,2,3],[4,5,6]]
@CᴏɴᴏʀO'Bʀɪᴇɴ handwave
@TimmyD @CᴏɴᴏʀO'Bʀɪᴇɴ [1,2,3,4,5,6,7,8,9] / (4,3,1) = [[1,2,3,4],[5,6,7],[8],[9]]
@MartinBüttner Dividing by half is multiplying by 2, for gosh sake
@CSᵠ Nice idea thanks
@Sherlock9 in your maths maybe
5:45 PM
@Sherlock9 math != programming
@TimmyD I have no idea what is happening here
@MartinBüttner sorry, that's what i meant
@MartinBüttner [1,2,3,4,5,6] / 0.5 == [1,2,3,4,5,6] / 2 ??
math INTERSECT programming != {}
No because programming doesn't have half the consistency of math
5:46 PM
@Sherlock9 they aren't too bad. I think they've got recursion.
@MartinBüttner Really? How does that work?
@CᴏɴᴏʀO'Bʀɪᴇɴ ymw
@TimmyD [1,2,3,4,5,6] / 2 == [[1,2],[3,4],[5,6]]
@Sherlock9 just like in Perl/PCRE
you reference some group in your pattern, and that pattern is matched again
as opposed to backreference which match the exact same string again, recursion actually processes the pattern again
5:47 PM
@MartinBüttner I don't know Perl so thanks for the explanation
@quintopia The first sliced array has length (1.33333....), which isn't enough for two elements, so we take only one, leaving (0.3333...) remaining. The second sliced array has length (1.3333... + 0.3333 = 1.6666...), which is enough for two elements.
it's actually more useful for pattern reuse than recursion, because if you're doing recursion in your regex (in production code), there's a good chance you should be doing something else
it's not pearl
@MartinBüttner Oh, right. Getting myself confused
@TimmyD that's gonna give you headaches and garbage
5:48 PM
@TimmyD It's enough for 2 elements because why?
@CSᵠ Yes. Which is why I recommended flooring the divisor
@CᴏɴᴏʀO'Bʀɪᴇɴ Because rounding error
because ieee754
@CᴏɴᴏʀO'Bʀɪᴇɴ Like @Sherlock9 said, rounding
@TimmyD which leaves us with -0.333333 which, added to 1.33333 is 1, but you had a group of 2 next...
5:50 PM
@quintopia Did I? Doh! Did not mean that.
Apologies to @MartinBüttner and @anOKsquirrel, math != programming, but they're both fun
But comment was harsher in tone than I meant. Sorry
open up your favourite language and do: 0.1+0.2
@TimmyD So 1.4 => 1, 1.4 + .4 => 1.8 ~> 2?
@quintopia Gah. At least I was consistently inconsistent.
i would expect dividing by 4/3 to split each four elements into 3 groups. [a][b,c][d]. which is what changing that would give.
@anOKsquirrel something something consistency
verizoncraft what
Oh that
@quintopia Oh, that's an interesting take.
Peace out y'all
5:53 PM
[1,2,3,4,5,6,7,8,9,10] / (4/3) = [[[1],[2,3],[4]] ,[[5],[6,7],[8]], [[9],[10]]]
painkillers for *
@CᴏɴᴏʀO'Bʀɪᴇɴ Bye
Still, flooring the divisor is much easier and more consistent
@CᴏɴᴏʀO'Bʀɪᴇɴ you'd want to make sense of arr/float somehow?
mainly to make sense of that particular pair operation?
[1,2,3,4,5,6,7,8,9,10] / 0.4231 = [4, 6, 9]

« first day (1767 days earlier)      last day (2121 days later) »