« first day (2969 days earlier)      last day (2196 days later) » 
00:00 - 21:0021:00 - 23:00

00:00
"Stop complaining. Start creating." -Dale Patridge (source)
Hello
Is there a neat way to iterate over all the elements in a diagonal in a grid?
you might want to be more specific
is the grid a square?
Yeah, it's a chess game
is it a grid of nested lists/arrays?
It's a grid of objects of the class Piece
Given a start and an end position in some diagonal in this grid, I want to check so all elements are null
00:16
again, "grid" is a loose term
Well, I suppose it is a nested array
So given the start/end position $(x_1,y_1), (x_2,y_2)$ and some point in the diagonal $(x_i,y_i)$, I want to go from start to end for such $i$ that $|x_i-y_i| = |x_1-y_1|$
Nvm
Nvm the nvm
Another condition is that $|x_i-x_1| = |y_i-y_1|$
 
5 hours later…
05:27
Jenna Sloan completed part 1 of day 9! \o/
Jenna Sloan completed part 2 of day 9! \o/
Unihedron completed part 1 of day 9! \o/
So, has anyone else here completed today's AoC challenge?
06:09
/advent
Leaderboard owned by Mike Angstadt (http://adventofcode.com/2018/leaderboard/private/view/256093)
1. Unihedron - 219 (17 stars)
2. anonymous - 187 (16 stars)
3. Madara Uchiha - 150 (16 stars)
4. geisterfurz007 - 141 (16 stars)
5. Olivia Zoe - 135 (16 stars)
6. nsharmon - 133 (14 stars)
7. Jenna Sloan - 130 (18 stars)
8. hawkwietlol - 105 (16 stars)
9. Mike Angstadt - 100 (16 stars)
10. towc - 60 (16 stars)
11. nicktar - 60 (10 stars)
12. Patrick Stegmann - 0 (0 stars)
13. Neoares - 0 (0 stars)
 
2 hours later…
Zoe
Zoe
08:25
Wow, Unihedron has been beaten
09:17
Olivia Zoe completed part 1 of day 9! \o/
09:27
Olivia Zoe completed part 2 of day 9! \o/
Zoe
Zoe
izi pizi
Zoe
Zoe
10:19
/advent
Leaderboard owned by Mike Angstadt (http://adventofcode.com/2018/leaderboard/private/view/256093)
1. Unihedron - 193 (17 stars)
2. anonymous - 163 (16 stars)
3. Olivia Zoe - 139 (18 stars)
4. Madara Uchiha - 132 (16 stars)
5. geisterfurz007 - 124 (16 stars)
6. Jenna Sloan - 116 (18 stars)
7. nsharmon - 111 (14 stars)
8. hawkwietlol - 95 (16 stars)
9. Mike Angstadt - 88 (16 stars)
10. nicktar - 60 (10 stars)
11. towc - 52 (16 stars)
12. Neoares - 0 (0 stars)
13. Patrick Stegmann - 0 (0 stars)
10:37
towc completed part 1 of day 9! \o/
11:07
null completed part 1 of day 9! \o/
null completed part 2 of day 9! \o/
Zoe
Zoe
owo
how are you people completing part 2 so fast?
I'm getting a computation that would last days
it finds part one in ~1.5s
Zoe
Zoe
Uh, how does it take that long?
Part 1 takes 380 ms including 5 test cases, part 2 takes 949 ms
maybe I misunderstood the question. It's asking me to simulate a game that would last until (last marble of part 1) marbles, right?
or maybe you're not simulating it, and using maths?
because right now I have an array with 1M + elements in it
and I bet that slows me down
(using javascript)
Zoe
Zoe
How do you have a million?
11:22
the marble I found in the previous game was in the 70k, so I need to go up to 7M, right?
Zoe
Zoe
waffles
yeah
Can I see your code?
sure, how should I share it?
(don't want to ruin the fun for others who haven't done it yet)
Zoe
Zoe
/paste
Alternatively make a gist
oh, I guess others can just not click on it
Zoe
Zoe
11:25
There's a bunch of solutions on reddit too IIRC, just add a spoiler alert or something
nvm 16-19, it's leftover from part 1
and it's marble number, not index
Zoe
Zoe
Why do you use i % 23 > 0?
instead of === 0?
I tried benchmarking it. Speed didn't seem to change, it actually seemed slightly faster with >
Zoe
Zoe
or == or whatever's correct to use xd
Judging by the code, I'd assume it's somehow related to the rotation
I don't think something at that scale is going to make the performance go from 10 days to a few seconds, either way
oh, no, it's just a check to see if the number is not a multiple of 23
you had 23 in your challenge too, right?
Zoe
Zoe
11:32
The definition of the challenge itself is always the same; it's the input that varies
that's what I thought
Zoe
Zoe
That code killed my tab xd
it's extremely intensive for some reason
I ran it on the terminal, with node
Zoe
Zoe
I don't think I have node installed any more
well, still running it. At 1.7M marbles
try removing the * 100. It should be pretty ok
Zoe
Zoe
11:34
I got a 10 digit number.
Zoe
Zoe
Hiya
@Zoe wait, it completed? 0.o
I'm also on a very shitty laptop, so that might be the reason
are you guys using spoiler ? :)
Zoe
Zoe
@Unihedron Meh, I found a better option
11:36
why would you use that here?
because list insertion / removal tends to be O(1)
Zoe
Zoe
I'm pretty much a noob when it comes to JS types, but how does JS handle longs?
Morning o/
@Unihedron oh that's... fair
@Zoe Das all number
11:37
@Zoe every number is a double
Zoe
Zoe
@towc Not your code, it got to under a million before I killed the script
all numbers in JS are floats but they are GoodEnough™
Zoe
Zoe
lol
They might change it in 6 to 8 weeks.
/advent
@towc not the JS lists though, there's a lot of crazy optimization, as long as you don't do something stupid that makes it not want to optimize
11:37
Leaderboard owned by Mike Angstadt (http://adventofcode.com/2018/leaderboard/private/view/256093)
1. Unihedron - 193 (17 stars)
2. anonymous - 183 (18 stars)
3. Olivia Zoe - 139 (18 stars)
4. Madara Uchiha - 132 (16 stars)
5. geisterfurz007 - 124 (16 stars)
6. Jenna Sloan - 116 (18 stars)
7. nsharmon - 111 (14 stars)
8. hawkwietlol - 95 (16 stars)
9. Mike Angstadt - 88 (16 stars)
10. towc - 62 (17 stars)
11. nicktar - 60 (10 stars)
12. Patrick Stegmann - 0 (0 stars)
13. Neoares - 0 (0 stars)
Zoe
Zoe
Seems to handle mine correctly
who's this guy Unihedron and why is he wrecking our leaderboard?
Must be a real genius that guy...
Zoe
Zoe
waffles
11:38
you made me laugh haha (pre-edit)
That is honestly impressive...
I did a few of 2015s I didn't finish and I'm thinking about doing a marathon and record it
Oh god the start of this one gives me flashbacks to the spiral of last year.
Zoe
Zoe
splice removes the item from the list too, right?
Yes.
items*
Zoe
Zoe
11:42
@geisterfurz007 this one is easy though
I'm not looking forwards to day 11, every day 11 has been my personal hell so far
I hope I will break the curse
Zoe
Zoe
@towc doesn't line 10 remove the items as well?
the elementsToDelete parameter is 0 so it removes 0 elements and inserts 1 @Zoe
Why would you play that game? The results are already determined the moment you know who is starting and how many people take part...
Zoe
Zoe
Splice is considerably heavier than not using it. /cc @towc
11:46
no, I know what you're going for, but while I have all the variables in the observable universe, I don't know about the initial parameters
Zoe
Zoe
Since it looks like you're calling it every loop, it might be the reason it's so slow
@Unihedron wouldn't push be faster to use?
push doesn't let you specify the index, it's 100% "insert at arr.length"
if you want to mutate in place at index, push is... :p
oh, I just implemented it with unihedron's suggestion
finished in about a second
Zoe
Zoe
using splice to add items is much slower though. At least from the crappy in-browser testing I just did :*
@Unihedron oh
> there's a lot of crazy optimization, as long as you don't do something stupid that makes it not want to optimize
maybe don't test it in browser but actually run a script with time :p
11:50
@Zoe if you find an alternative for inserting at random locations in a js array that is faster, do tell
Zoe
Zoe
/paste
Zoe
Zoe
/about
RIP Oak
why did you kill it >:(
was chat dead?
Zoe
Zoe
@Unihedron I NEEDED MY REVENGE!!!
cough
@towc dunno about JS. I used Kotlin, and used a paste.ofcode.org/yQwSvFt8viGp3tEFnTCppt
11:52
did you file a request for revenge? I didn't receive one
OakBot by Michael | source code | JAR built on: Over a week ago. | started up: Over a week ago. | responded to 10262 commands since Mar 9, 2017
Zoe
Zoe
@Unihedron well, obviously I didn't. Revenge is a dish best served with a surprise ;)
And there Oak is xD
@Zoe Java deques are implemented with linkedlists
Zoe
Zoe
/javadoc LinkedList
right
derp
@Unihedron still no rotate method
@Michael Oak appears to have some hickups :/ Sometimes there is no response or it takes very long (see above)
11:55
it's probably not oak's fault but stack overflow's servers
Zoe
Zoe
in SOBotics, 8 secs ago, by Natty
@Zoe Nope
More likely Oak's server
well this chat just timed me out three times and I had to click on retry so 100% stack's servers
ok, now I'm thinking I got lucky with the first answer
how did you interpret "last marble is worth X"?
@Unihedron Or your internet is shitty :D
or both of our internet is shitty
11:58
@towc That is the last marble that is placed I guess.
or a shark just shaked the underground cables that connects china to US
is that the number on the last marble, or that + the marble 7 back, or something else?
pretty sure it's "the amount of marbles in the game" since each marble is worth 1 more than the previous, starting at 0
Zoe
Zoe
@towc If you look at the examples, the placed one always increments by one.
@Zoe I get that, it's just that I had originally thought the value of a marble is the amount you get after placing it (0 if not a multiple of 23, and itself + previous 7th)
and that somehow got me the right answer for part 1
Zoe
Zoe
12:08
The score is only when 23 is placed. Anything else simply doesn't score
So you're actually right
you score points when you take the 1. divisible-by-23 marble and 2. marble that is 7 in front of the current marble, every other marble are placed but don't reward points until you're the lucky 23rd turn guy
12:38
well, turns out I was adding the score from the wrong node -_-
man, these challenges are lovely
Zoe
Zoe
o-o
I think I managed to get the Kotlin Native C interop to work
 
2 hours later…
14:49
Unihedron completed part 2 of day 9! \o/
Zoe
Zoe
IntelliJ: "GRADLE BUILD FAILED!"
Also IntelliJ: "Open message view" => except it's empty xd
./gradlew build => "Here's an error message your you <3"
15:14
Hi anyone here with JPA or Hibernate?
@Laxminarayan Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
Thanks @OakBot
I want to know, JPA class EntityManager interface implementation is written?
Is there a collective term for something that is horizontal or vertical?
Zoe
Zoe
@Lozansky Oriented? /shrug
Uhm
Straight line...ar? :/
Ugh
As opposed to a non-straight line oO
15:27
Hi,

anyone knows that where is implementation written for JPA's EntityManager class?
Zoe
Zoe
@Laxminarayan Probably in your code
@Lozansky Straight line might be the closest you get. Dunno if there's a collective term aside that
Right
no @Zoe. At DAO layer they(project architect) used EntityManager Interface but I searched everywhere in the project but no luck
In Hibernate configuration they used this EntityManager as autowired but nowhere implementation is written. I want to see how this library is written.
Zoe
Zoe
It really depends on what you're using it for. If it's lines, that might be wrong
15:45
@Zoe How would you describe the movement pattern of a Rook?
Zoe
Zoe
6
A: A word to describe vertical and horizontal movement?

anemoneThe rook in chess moves orthogonally. This term is not used often (unlike diagonally) as more authors seem to prefer to spell things out (i.e., horizontally and vertically) to prevent being misunderstood. Still, it can be traced in many chess manuals, such as this one (cf. Basic play section, p....

Orthogonal is pretty good though!
Zoe
Zoe
Stumbled over that one before the first one I linked ^^"
@geisterfurz007 stuck on day 9? :>
@Lozansky along the ranks and files
don't complicate it
Yeah but I want a nice name for my method :P
(Which returns the tuples making up the orthogonal path)
Zoe
Zoe
15:49
What about moveSomePieceAlongTheVerticalAndHorizontalLinesInOrderToSmiteThyEnemiesAndWinTh‌​eWar?
:p
honestly rectilinear is better for describing this than orthogonal
but they both suck so
getOrthogonalPath doesn't sound too shabby
getSquaresRookCanSee
andAlsoSubsetOfSquaresQueenCanSee
16:13
@RTarson Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
Is there any chat room related to Hibernate only?
Zoe
Zoe
no
16:31
Hmm
Too elegant for my style
16:46
heh
Zoe
Zoe
I'm already looking for replacements. It's a PITA though xd
17:38
@fredoverflow NB: Java is not Android and Android is not Java
Zoe
Zoe
Except in syntax
18:33
@Zoe Busy having a life. I just got back home after a relaxing 5 hour chat at the flight school.
Zoe
Zoe
@geisterfurz007 oh, exams?
Not at all! Just a comfy hangout with other students.
Now I gotta be productive for 2.5 hours or so though...
Didn't get anything done so far.
18:57
Hmm
Am I a filthy casual if I don't implement en passant in my chess game?
I usually do the "normal" stuff first.
All the fancies come after. So if your chess is playable without en passant, why not add it? If it doesn't, there are other things to focus on first ;)
geisssssss
@Lozansky yes
En passant is basically cheating anyway
19:25
@Zoe Jenna is using someone else's code... :P
Jenna is cheating badly...
/advent
Leaderboard owned by Mike Angstadt (http://adventofcode.com/2018/leaderboard/private/view/256093)
1. Unihedron - 202 (18 stars)
2. anonymous - 183 (18 stars)
3. Olivia Zoe - 139 (18 stars)
4. Madara Uchiha - 132 (16 stars)
5. geisterfurz007 - 124 (16 stars)
6. Jenna Sloan - 116 (18 stars)
7. nsharmon - 111 (14 stars)
8. hawkwietlol - 95 (16 stars)
9. Mike Angstadt - 88 (16 stars)
10. towc - 72 (18 stars)
11. nicktar - 60 (10 stars)
12. Neoares - 0 (0 stars)
13. Patrick Stegmann - 0 (0 stars)
Zoe
Zoe
@Michael What?
that's no fun xd
@Zoe Jenna wrote code that downloads and executes code of people on the leaderboard with Jenna's input and automatically submits it.
@geisterfurz007 No, that's not what it does
19:34
@Zoe that's not what it does.
/afk busy with schoolwork
@JennaSloan Cya later
Zoe
Zoe
xd
My condolences.
geisterfurz007 completed part 1 of day 9! \o/
19:40
Is part two a game of patience or do you have to think about that?
I like how they hyperlinked the word "marble". Just incase you're from Mars and don't know what a marble is. xD
Or if you lost your marbles.
hurrhurr
Punny! xD
19:57
@geisterfurz007 my original implementation would have completed in ~10 dayys
@towc Ooooooooooook. That's not good because I don't have time for that.
I actually got help from here, someone made a suggestion
I didn't even get it at first, but it made sense, and the new implementation completed in ~2s
Yeah I was just reading though that when you pinged me :D
want a subtler hint?
@towc You mean the hastebin Uni posted?
That one doesn't load for me ._.
20:02
I mean, a hint that's not what he actually said
he was very straight forward with his spoiler
after realizing it, I felt very dumb
wouldn't want you to go through that
spent the day in bed, because I was too ashamed to let people see me
That's rough...
Yeah a hint would be great...
well, assuming you made the same mistake as me
I wrote a code that uses splice to insert and for the second part I just put 00 after my last marble number.
Reading through the stuff from this morning that sounds at least somewhat similar.
right, get rid of that method
Should I emulate it with other array methods?
20:07
there's a big thing slowing you down, and it's not your algorithm
It's my input heh.
actually, well, you could use splice
oh, no, my input was ~70k, so I went through 7M rounds
Yeah that's what my node is still doing currently.
I also thought my input was unlucky
and I did reach 1M eventually, but it took many minutes
Get rid of splice everywhere where I use it or just get rid of it as tool for insertion?
20:09
that's as far as the clue goes
your algo is not the issue, although you're going to need to tweak it to fit the non-algo issue
you can still use splice, just think about its big O
A direct question: Would throwing a letter out here or there help?
a letter?
oh
not talking about slice
that's not the issue
Dangit :/
and spices never really help
Fair enough.
20:14
what lang are you using?
right, just don't use splice then
mkay.
Never ever?
alright, slightly more direct. Use c29tZXRoaW5nIHRoYXQgYWxsb3dzIHlvdSB0byByZW1vdmUvaW5zZXJ0IGluIE8oMSk=
Hm ok, thanks :)
Oh god.
20:18
damnit, too late
Although...
Madara Uchiha completed part 1 of day 9! \o/
curious how long before he figures it out
The issue I have with the two ideas I had from pre-edit: I still have to change a bunch of entries, or not?
zoe here just went straight to the better version, I think. Unihedron too?
@geisterfurz007 you know enough
20:21
I am not sure I do...
I did enough spoiling today
What a shame ._.
20:32
damn for a sec i thought geisssssss is talking to geissssssssssssssss
damn similar icons
@ColdFire Why would you look at the icons?
@JennaSloan Welcome back!
@JennaSloan because humans
I think we can settle that
@geisterfurz007 I can give you a bigger hint if you change your icon
@ColdFire pesky humans
20:34
/shrug
¯\_(ツ)_/¯
good bot
@towc bruh.-
How much of a sin is autoboxing? :>
xD
geis will transform to geisssplaneeeeeeeeee icon
20:35
(I'm joking. You're not getting a better hint)
I was about to change my icon ._.
if you don't mind, it might actually be helpful
I have no clue if you're joking now
what we talk anything seriously here?
20:38
@ColdFire my cat died
At least you may see your kids again.
they chose a different path
I don't think I should see them anymore
Mike Angstadt completed part 1 of day 9! \o/
Mike Angstadt completed part 2 of day 9! \o/
/javadoc LinkedList
20:39
Ok that sucks.
It looks like Oak is back now.
Seeing a lot of "connection to stackoverflow.com timed out" messages in the logs.
No seriously: I am fully stuck. And I am not too firm with Javascript Structures that I would find anything useful.
I thought about using an object which indeed has O(1) insert/remove but the problem of keeping track of the indices remains.
not talking about a native structure
Are you talking about today's puzzle?
20:41
yeah
you see how Mike did it in a few seconds?
it means you're dumb
It means he has better tools than I have.
Do you want a hit?
@towc Harsh
Err, hint... xD
20:42
I've been trying to hit him for the last 20 mins
he keeps missing
I already had a fullblown book on todays second part... I really hope that I get it done with that but it is really late already ._.
#poorexcuses
@geisterfurz007 there's something that's been javadoc-ed a lot
they're not doing it because they're curious
Well yeah that's what I meant with better tools.
20:44
@gei What kind of data structures are you using?
A trash one.
Obviously
@geisterfurz007 I literally used a bunch of objects with a value, prev, and next fields
But I am too tired to write myself one in JS :D
@towc Right, right... That was how linked lists worked.
held a single reference to one object of the cycle/chain
and I used JS
20:46
@towc Me too
Ok fuck that, I am using Java...
cba to writing myself a linked list in JS at almost 10 PM...
again, a simple linked list is probably not what you want either way
because you want to go back
/javadoc LinkedList
oh
well, there you go
20:48
I didn't use LinkedList. I just created my own "node" class that has next and prev.
Y'all nerds.
4
Since it's a circle, a list data structure doesn't really make sense.
I am really, really, really tempted to pin my last message.
I wanna "highlight" the available squares for a piece on my chessboard
What's a nice way of doing that? My squares are JButtons
20:51
Use JavaFX hurdurp.
Give them a red border. There should be something like that.
/javadoc JButton#setBorder
Yeah
360 no scope, right into the docs.
20:52
I guess either that or just change the background
Or some kind of gradient
I love how almost everyone here is using js
I take everything back what I wrote in an earlier revision of this message.
/shrug
:P
¯\_(ツ)_/¯
Ok we are not going to play that game for the rest of the time I can edit that message.
youtube.com/watch?v=oeRmXaQusD4 On loop to give me enough power to go through writing this rubbish.
00:00 - 21:0021:00 - 23:00

« first day (2969 days earlier)      last day (2196 days later) »