« first day (1897 days earlier)      last day (2929 days later) » 

4:00 AM
I don't think it counts as a "video" if it's just a still image with music.
 
@quartata What does Toxic Garbage Island have to do with anything?
 
@PhiNotPi I didn't even click on it
 
Anonymous
 
@Mego gaben pls
 
Anonymous
Oh wow the quality on that came out terrible
 
4:01 AM
Is it a rotating clown leg?
 
Anonymous
It's the Steam logo
 
No, that's the steam logo
 
Anonymous
Hence steamrolled
 
@quartata You say potato
 
4:01 AM
Is that better?
@El'endiaStarman Trust me, the advice I'd give has nothing to do with programming. :P
 
@AlexA. Hahaha, well, would it be good advice for someone dating a programmer?
 
Anonymous
Another good piece of advice is "don't complain unless you want it fixed"
 
@El'endiaStarman Programmers are normal people too.
 
^ I was going to say
 
Anonymous
10 mins ago, by Mego
The advice I'd give is "expect me to take everything too literally, but it's not always because I'm joking around"
 
Anonymous
4:07 AM
@HelkaHomba
 
I can't think of any advice that wouldn't apply to folks of other professions
Though I guess "don't be surprised if your significant other spends a lot of time on the computer"
 
Welp, Google Code Jam has me stuck already
 
@HelkaHomba Of course, but there's plenty of generic relationship advice out there. My fiancée was more interested in the programmer-specific side of things.
 
Might not help that I'm programming in class when I'm supposed to be learning about databases
 
Anonymous
The thing is, it's not specifically programmers. Rather, it's people who tend to think in similar ways - taking things literally, having a problem-solving mindset, etc. It just so happens that programming is a field where those traits are very beneficial.
 
4:09 AM
@Mego That's true.
 
@QPaysTaxes a wall you want broken?
 
@El'endiaStarman My advice: Take them outside once in a while.
 
Anonymous
You can see the same traits in many mathematicians, analysts, and engineers, too
 
@HelkaHomba Ha ha! Yep... >_>
 
@HelkaHomba why would you ever tell people to do that to programmers, you inhumane monster?!
 
Anonymous
4:10 AM
@QPaysTaxes Banging your head on the wall to get rid of a bug is not an optimal solution. Have you tried a shoe, or rolled-up newspaper?
 
Anonymous
@Maltysen Because the best way to solve a tricky problem is to step away from it for a while.
 
@Mego Speaking of which, do you know how to disable the "update news" popup when you open Steam?
 
Anonymous
@HelkaHomba Don't open Steam?
 
@Mego yeah, but you can just take a shower
 
Anonymous
@QPaysTaxes No that's alcohol.
 
4:12 AM
oooh, I found an improvement on google code jam
 
Anonymous
For example, I'm stuck on problem C in GCJ. So I'm playing Learn To Fly 3 while it marinates in my subconscious.
 
say you find two numbers when n = 5
 
Anonymous
Which problem? C?
 
and you find a similar number on n = 6
yes
 
codeJam is making me need a lot of sugar. I've had like a mountain dew, a pack of skittles, and now I have a bowl of ice cream. I should stop
 
4:13 AM
you can use the difference to find another number on n = 6
 
@Mego I have no idea why my submission is wrong
 
Anonymous
Sugar is not good for concentration and thinking
 
.............I'm seriously considering getting into Code Jam now, but...man, that'd take quite some time.
 
Anonymous
My C-small submission was right, but I did it with brute force
 
Well, it's only today, so
 
Anonymous
4:13 AM
I'm still trying to come up with a more efficient way to do the large
 
@El'endiaStarman I might do next year's.
 
My A-small submission is annoying me
 
I honestly never heard of it until recently...
 
@quartata I was thinking that too. I want to focus on Pytek for now.
 
Anonymous
I've done Code Jam every year since 2012
 
Anonymous
4:15 AM
A tip for problem A: 0 is the only input where all digits will never occur
 
did everything with brute force
 
Anonymous
A is brute-forceable by virtue of how simple it is
 
@Mego i did brute force it to verify that 0 was the only one
pypy is magic
 
I used a HashSet and everything for A thinking that the large test case would be at least somewhat performance-critical, but nope
 
took like 3 secs for 0-1e6
 
Anonymous
4:16 AM
I used sets too, but that was because I was too lazy to do my own duplicate checking
 
@Doorknob yo same!
 
wait
B didn't need brute force
but using brute force for C
 
@AlexA. Remember when you asked about languages that you really like but there's one thing about them that annoy you?
#![feature(step_by)]
 
@MarsUltor B-small does
 
^ this is that for Rust
 
4:17 AM
dijkastra
 
@Maltysen ?
 
@KennyLau Are no-ops allowed in cracking attempts (even though they are banned for cops?)
 
@Doorknob Oh yeah, I liked that question; that got some interesting responses. Yeah, Rust's feature importing thing bugs me and I've only used Rust a couple times.
 
@MarsUltor if you write it as an unweighted directed graph it only has 1024 nodes, easy with dijkastra
now I need to write dijkastra…
 
Ah, Dijkstra. I should learn that some time
 
4:21 AM
@Maltysen No, you can only lift from top of stack; you can't flip the middle. B doesn't need brute force
 
@MarsUltor right, you write each possible flip operation as an edge
 
@PhiNotPi added
 
yes you don't need brute-force, its not even good enough for large, but i'm lazy
 
Anonymous
You could make it into a tree by just not allowing the same flip you just did
 
@Maltysen It's way easier without djikstra
 
Anonymous
4:23 AM
Wait actually no
 
@Maltysen replace with capture group in pyth?
 
Anonymous
You can still have cycles that way
 
just did some conditional counting for B
wait a second
damnit
 
How to replace with capture groups in Pyth?
 
@KennyLau its in the python docs
Pyth uses python's re
 
4:26 AM
@Maltysen How do you do so in python?
 
2 mins ago, by Maltysen
@KennyLau its in the python docs
 
@quartata At least I can still look at the problems... :D
 
I didn't realize that the inputs changed with each attempt
Whoops
 
Hey wait haven't we had something like B as a challenge on PPCG?
 
4:27 AM
Well, A-small is done
 
Anonymous
@El'endiaStarman Something similar, yeah
 
Anonymous
20
Q: Flipping pancakes

danieroIn pancake sorting the only allowed operation is to reverse the elements of some prefix of the sequence. Or, think of a stack of pancakes: We insert a spatula somewhere in the stack and flip all the pancakes above the spatula. For example, the sequence 6 5 4 1 2 3 can be sorted by first flippin...

 
@Mego I remember attempting it with Pancake Stack, the programming language.
 
(define chunkNum (car (if (zero? (modulo room 2)) ((λ () (let ([y (list-tail side1 (- (length side1) 1))])
   (set! side1 (take side1 (- (length side1) 1)))
    y
)))((λ () (let ([y (list-tail side2 (- (length side2) 1))])
  (set! side2 (take side2 (- (length side2) 1)))
   y
))))))
Oh my god why does this work what have I done
 
You have transcended into parentheses hell. :P
 
Anonymous
4:30 AM
@El'endiaStarman I remember working on that with you :)
 
@Mego not optimal though, otherwise I would have submitted the golfscript answer :/
 
Anonymous
I think our final conclusion was that Pancake Stack can't sort
 
Anonymous
@Maltysen It's a completely different puzzle
 
Yeah, and Pancake Stack is Turing-complete only as a technicality.
 
Anonymous
Pancake sorting != pancake flipping happy making
 
4:31 AM
oh sorting
 
@quartata In most cases, excessive use of set! means you're Doing It Wrong.
 
Anonymous
Pancake Stack is not TC
 
@ChrisJester-Young I only used set! once trying to avoid it
 
Also, your code looks like it has way too many lambdas. :-)
 
I have two lists side1 and side2 and all I want to do is pop (remove) an element from side1 if room % 2 == 0 and from side2 otherwise
The empty lambda is so I can have multiple lines, the let is so I can save the list-tail
 
4:32 AM
Right, normally you'd use a named let to do that. Lemme see if I can demonstrate.
 
Wait a second
Why do I need the lambda
 
Anonymous
Pancake Stack is TC except for a certain subset of problems that 2CMs can't solve
 
Anonymous
Because Pancake Stack is essentially equivalent to a 2CM
 
Yeah. Hence my "technicality" remark.
It's not TC in a useful way.
 
Oh nevermind the lambda is completely unnecessary
 
Anonymous
4:33 AM
2CMs are TC iff you can initialize the counters to any value
 
@Maltysen Still can't get it to work
Tried "\1" and "\\1"
 
(define chunkNum (car (if (zero? (modulo room 2)) (let ([y (list-tail side1 (- (length side1) 1))])
  (set! side1 (take side1 (- (length side1) 1)))
  y
 )(let ([y (list-tail side2 (- (length side2) 1))])
  (set! side2 (take side2 (- (length side2) 1)))
  y
 ))))
Only marginally better of course...
 
Anonymous
But because Pancake Stack is equivalent to a 2CM with counters initialized to 0, the caveat makes it not TC
 
Anonymous
@KennyLau Use r'\1'
 
@Mego Can't find r in Pyth
 
4:34 AM
@quartata Can you describe in pseudocode what your code is trying to do?
I'll try to write a version in idiomatic Scheme. :-)
if for no other reason than so you have a pattern to work with.
 
@ChrisJester-Young int chunkNum = (room % 2 == 0 ? pop(side1) : pop(side2));
 
Anonymous
@KennyLau You need a raw string, I'm not sure how to do that in Pyth
 
literally the line I'm trying to translate
 
@isaacg Feature request lol
 
@quartata Can you show me the rest of the function, with the context of side1, side2, room, etc.?
 
4:35 AM
try "\\\\1"
that might work
 
Anonymous
@QPaysTaxes After new submissions are no longer competitive (when a winner is chosen)
 
Anonymous
So like for Kenny's CnR, after April
 
@Mego That's a thing? I make a point to update my accepted answer if a shorter answer is posted, no matter how far into the future.
 
(let ([side1 (shuffle (filter (λ(x) (= (bitwise-and x 2) 0)) (range 0 16)))]
      [side2 (shuffle (filter (λ(x) (= (bitwise-and x 2) 2)) (range 0 16)))])
 
Anonymous
It's customary for cops to reveal their solutions after the competition, usually with spoiler tags so that people can still try to solve it
 
4:38 AM
side1 and side2 are both lists.
(for ([room (range 0 (random 6 11))])
 
Anonymous
@ChrisJester-Young A lot of people use cutoff dates for CnRs and KoTHs
 
^^ that's the for loop my code is in
 
@Mego *nods*
 
I'd paste the whole code but I don't want to wall of text the 19th Byte
 
Anonymous
Use pastebin
 
4:38 AM
@quartata Put it in a Gist. :-)
 
Anonymous
Or a gist
 
Anonymous
Ninjo'd
 
Anonymous
My cat is being obnoxious and bathing in my lap while I'm trying to program :(
 
Anonymous
But she's cute so I can't be upset
 
4:40 AM
Currently all I have actually lol
 
Anonymous
Less cute when she's mopping Australia with her tongue, but still cute
 
@quartata What's the code supposed to do at a high level? I'm trying to avoid an XY problem. :-)
 
@ChrisJester-Young It's a random room generator for a little ASCII art dungeon maker.
So basically
 
@Mego "Please do not discuss the problems during the round."
 
You have the 80x24 screen split up into 19x4 chunks with 1x4 and 19x1 pockets of dead space between them
side1 represents chunks on the left side of the screen
side2 on the right
 
4:42 AM
@Sp3000 you're allowed to for qual
 
Where does it say that?
 
FAQ IIRC
or maybe terms and conditions
 
The loop alternates picking chunks from the left and the right side, picks a random point in the chunk and draws a rectangle between it and the farthest corner of the chunk
 
"Collaborating with anyone else during any round of the contest, with the exception of the qualification round, is strictly prohibited and will result in your disqualification."
I see, well this is just confusing
 
But all I have is the "picking chunks from the left and the right side" currently
 
4:43 AM
Cos their twitter says "The #CodeJam2016 Qual Round has officially started! Conversation about the problems during the round is prohibited."
o__O
 
That's what that monster if is supposed to be
 
Anonymous
Probably auto-generated
 
Anonymous
Their FAQ has more legal basis than a tweet
 
The first quote with the ping was from the main page though
But oh well
 
@quartata I see. I'll just translate your pastebin contents into how I'd write it (without changing the algorithm).
 
4:47 AM
@QPaysTaxes It uses Perl's "auto-typecasting." Meaning that it's converted to a number if used as a number.
 
Numbers are (usually) actually stored as strings in Perl so
We usually refer to "numbers" and "strings that look like numbers" as numerals.
Why?
I'd think that would help your solution...
This is a code golf, right?
 
Cops-and-Robbers
 
Oh this is that new CnR
 
@QPaysTaxes What happens when you draw from an empty stack depends, IIRC, on the operator.
 
@quartata What's the [room (range 0 (random 6 11))] about?
 
4:52 AM
@ChrisJester-Young Oh, that's how many rooms will be generated.
 
I think, popping from an empty stack gives an empty scalar (empty string).
 
6-10.
So I'm iterating through 0 - random number
 
@quartata Okay.
 
@QPaysTaxes {} uses the control stack, and in that case an empty control stack is a falsey value
so, {} will be a no-op
@QPaysTaxes It's not a no-op in my original solution, but if you find a solution that doesn't use it, then that is also acceptable.
"No-ops can be used in robber's solution." codegolf.stackexchange.com/q/77420/2867
 
@Mego have answer for smallB crossing my fingers, trying it out
 
4:58 AM
(let-values ([(side1 side2) (partition (lambda (x)
                                         (zero? (bitwise-and x 2)))
                                       (range 16))]
             [(rooms) (random 6 11)])
  (let loop ([result '()]
             [side1 (shuffle side1)]
             [side2 (shuffle side2)]
             [room 0])
    (cond [(>= room rooms) result]
          [(even? room) (loop (cons (car side1) result) (cdr side1) side2 (add1 room))]
          [else (loop (cons (car side2) result) side1 (cdr side2) (add1 room))])))
 
Anonymous
I almost have an answer for smallB
 
@quartata ^ That's probably one of the more idiomatic ways to write your code in Racket. :-)
 
runs away from TNB in case of Code Jam spoilers
 
@Mego smallB is easy, but only if you do it the naïve way - counting the number of contiguous sections
Or maybe I just got insanely lucky that it worked
 
@QPaysTaxes : always takes two arguments (the top 2 things on the main stack). The topmost (most recent) argument is the number of copies, the other is the thing to copy. Performing : when there's not 2 things on the main stack is a no-op.
 
5:00 AM
@Mego \o/ 35 points (well assuming I got A-large correct)
 
Is sympy allowed in GCJ submissions?
 
@QPaysTaxes Yes.
 
@Sherlock9 prolly
 
Because brute-forcing C is driving me nuts
Thank God
 
I used networkX
so kinda cheating
but I would have copy pasted from python cookbook anyway so ¯\_(ツ)_/¯
 
Anonymous
5:02 AM
How would sympy help with C?
 
@Mego faster prime factors?
maybe faster base conversion
 
Anonymous
Base conversion is a builtin in Python
 
wait, what?
as in number to number in binary?
 
That's bin.
 
well, C needs to convert to bases 2-10
 
5:05 AM
@MarsUltor for c you need the opposite
that's int(n, base)
 
@Maltysen No, you don't need it in binary at all
just set it to minimum and keep on incrementing
 
(let-values ([(side1 side2) (partition (lambda (x)
                                         (zero? (bitwise-and x 2)))
                                       (shuffle (range 16)))]
             [(rooms) (random 6 11)])
  (let loop ([result '()]
             [side1 side1]
             [side2 side2]
             [room 0])
    (cond [(>= room rooms) result]
          [(even? room) (loop (cons (car side1) result) (cdr side1) side2 (add1 room))]
          [else (loop (cons (car side2) result) side1 (cdr side2) (add1 room))])))
@quartata ^ Slight improvement, with only one shuffle.
 
@MarsUltor no, converting from bases 2-36 is int
 
@Maltysen ?
yeah, but don't we need to convert to, not from?
 
@MarsUltor no you interpret it as bases 2-10
 
5:08 AM
oh wait
realy needs to read the question better
 
you don't even need to bruteforce C-small in advance
its really fast
 
Anonymous
int(str, base) interprets str as a base-base number
 
Anonymous
That's all you need for C, other than factoring
 
and itertools.product
 
@QPaysTaxes I don't think there's a case where it does nothing. It gives 0 on an empty stack.
@QPaysTaxes It does both a number->character and a character->number conversion, with the char->num result on top. One of those two results is typically useless/meaningless.
 
5:15 AM
@Mego what's your nickname?
 
@QPaysTaxes It's kinda weird, I hacked together two functions into a single operator (ran out of ASCII).
112, leaves the stack with 49 on top (the character code of 1), and p underneath (with p being 112).
Yes
 
hmm
are we allowed to share outputs for the qualifying rounds?
 
@QPaysTaxes That's actually a pretty smart solution.
Double check my original?
 
Anonymous
@Maltysen On what?
 
Yeah, it works (that's what I used to write it, too)
 
5:24 AM
@Mego on gcj
so i can add u as a friend
 
You're not going crazy though... there's definitely some weird behavior with the language that is important to my solution.
There's actually not that much to the source code: github.com/PhiNotPi/Element/blob/master/InterpreterTIO.plx
Nope, not a bug in Perl.
But, if you look over my list of operators, I'm sure you'll find something useful.
 
Anonymous
@Maltysen TheOnlyMego
 
added
 
Anonymous
Coolio
 
It means something along the lines of "last index of", but whatever you're looking at is completely irrelevant
 
5:29 AM
(require srfi/26)
(take (call-with-values (cut partition (compose zero? (cut bitwise-and <> 2))
                                       (shuffle (range 16)))
                        (cut append-map list <...>))
      (random 6 11))
^ a much golfier version of @quartata's code, if we compress all the spaces out and make identifiers single-character.
 
@QPaysTaxes I can tell you which entry to look at, if you're desperate.
(I'm trying to balance not giving out hints to make it difficult, with giving enough so that you don't give up)
 
> you may exclude it as long as you put a comment in your source code explaining where the library is available.
shit
do you think they check everyone's source code for the qualifying round?
 
Anonymous
Probably not
 
Sigh I discovered a mistake in my reasoning for D large
 
5:37 AM
D: i have no idea why i'm getting C small wrong
 
Anonymous
If you forget to list a third-party library, they can usually figure it out
 
@Mego ok then, as long as they aren't too strict, networkx is pretty well known
 
Anonymous
It's literally the top result on Google for "networkx"
 
Anonymous
If they can't use their own search engine, there are bigger issues here
 
@QPaysTaxes ¯\(°_o)/¯
 
Anonymous
5:38 AM
@QPaysTaxes That's not very nice
 
Anonymous
If you failed to expect something, maybe the problem lies within
 
Anonymous
Most unexpected behavior can be explained with the presence of alcohol
 
Anonymous
I never said anything about drinking it
 
oh whoops
 
Anonymous
Just the presence of a bottle of Jack can make interesting things happen
 
Anonymous
5:41 AM
Close enough
 
Anonymous
But seriously, calling someone a dick is not Being Nice
 
\o/ finished A through C
 
@QPaysTaxes That's not acceptable here. Name calling will not be tolerated.
 
Anonymous
With the exception of calling Alex wrong, of course :P
 
Anonymous
I should have B done. I don't know why it isn't working.
 
5:45 AM
@Mego ?
how are you doing it?
 
Anonymous
Graphs
 
right now I have a 50% change my B large is right (i.e. assuming flipping any number of pancakes only reduces the number of contiguous sections by at most 1)
 
Anonymous
But apparently I messed it up somewhere
 
@Mego I seem to have brute-forced C-large
 
@Maltysen what
why
just skip if the prime factor exceeds 10k
 
Anonymous
5:47 AM
I'm going to use better factoring to try brute-forcing C-large while I'm asleep tonight
 
@MarsUltor yeah that's exactly what I did
 
@Mego You don't need to
 
except with a million
 
@Maltysen Too slow
I got my answer in < 10 seconds
I only used up 12/32 binary digits, they're still common enough
around 1/4 are never prime and have all factors < 10k
 
crosses fingers hopes my C large is good, failed C small so many times because I kept getting my output confused
 
5:50 AM
always uses small solutions to calculate large solutions because it's so much easier
 
Anonymous
@QPaysTaxes Trying to define niceness other than "use common sense" isn't going to work
 
Anonymous
If there was a pattern-matching solution for not-nice messages, SE would've created a bot already
 
Anonymous
It doesn't matter if you intended it as a joke. Name-calling like that is not Being Nice, and is not tolerated.
 

« first day (1897 days earlier)      last day (2929 days later) »