| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Copy and Paste is your friend for that one Mike. Playing catch up here, got day 13 and 14 done today. Day 15 looks like a zinger and might be a little while before I'm ready to code anything at all. |
| [+] Meaningless Drivel » Don't you get Annoyed by... (Go to) | | Liutauras Vilda |
This is one of my favourites found near ATMs FREE CASH WITHDRAWALS |
| [+] Meaningless Drivel » Motorcycle recommendation? (Go to) | | Liutauras Vilda |
Peter Rooke wrote:Well done, now you can start to learn how to actually ride Funny that's exactly what my instructor said to me when we got back from the test centre. Cheers for the recommendation, I'll definitely be looking for something to help me get better at all the stuff they don't cover in the test, which as you say is just mooching about town for half an hour and briefly hitting 50 mph on a straight bit of dual carriage way. The journey begins  |
| [+] Spring » * Winners: Spring in Action (5th edition) (Go to) | | Campbell Ritchie |
First, a big thanks to Craig Walls for being here to promote the book Spring in Action (5th edition). The winners are: Claude Mooremeenakshi sundarJulian IsaacMatt Campbell Please send your snail mail address to bookpromotion AT javaranch DOT com. To ensure the quickest response, please provide the following: Your name (first and last - if your CodeRanch name is different, please include both your real name and Ranch name) Email Country (needed even if requesting an e-book) Address Phone Number Also, please include the following as the subject of your Email. Book Promo Winner - Spring in Action (5th edition) - Tuesday, December 11th, 2018 Image from https://images-na.ssl-images-amazon.com As noted in the Book Promotion Eligibility Requirements and Legal type stuff, the winners have 8 days to submit their information. Within 3 days of receipt of your email, we will reply to let you know we got it. If you don't hear back, the goat might have eaten your email. Please let us know by posting in the Ranch Office so we can check on it. Once you have received your copy please let us know by editing the Book Promotions Winners Page and updating the 'Status' column to say you have it. Thanks and congrats to all the winners. |
| [+] Meaningless Drivel » Motorcycle recommendation? (Go to) | | Liutauras Vilda |
How did you find the tests? The theory was total nonsense IMO, the manoeuvres test was the toughest I'd say, and the on road test was just a nice waft around town for 40 minutes. I had never ridden a bike of any sort before starting out on lessons so was all very new and unusual but now feels great. Do you have a bike in mind? I have a 15 mile journey to work on a dual carriageway so a Vespa wouldn't really be ideal for that, so I'm looking for something comfortable and nimble that won't try and kill me. Just need to hit some bike shops and see what they've got that I like. |
| [+] Meaningless Drivel » Motorcycle recommendation? (Go to) | | Liutauras Vilda |
Hey congrats! What licence did you have before? A1 or A2? I had nothing but the AM (Moped) that I got by default when I passed my car test back in the mid 90s. Really looking forward to getting a bike now and going out by myself instead of having an instructor in tow all the time. |
| [+] Meaningless Drivel » Motorcycle recommendation? (Go to) | | Liutauras Vilda |
It's time to revisit this old discussion because yesterday I gained my full motorcycle licence  I'm super chuffed! In practice I think my motorcycle choice will come down to price, availability in my area, and whatever feels nice enough to ride. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
I've dropped a day behind so today I have 4 outstanding puzzles, this is it, the beginning of my inevitable AoC demise. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Yes, done. My hunch was right but not exactly as I first imagined it. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
My hunch was that the plant state would repeat so didn't need to compute all the generations, but no  |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Day 12 Part 1, yup no problem. Part 2, dang I got nothing that doesn't take a bunch of time to run. I do have a hunch though, so I'll be back  |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Part 2 was a bit of an odd one. I still could not get my program to finish in any reasonable time but I got lucky. I had it print out any new highest power level as it found them and after about 5 seconds the output dried up but the program kept running. As it turned out the most recent output was the puzzle solution. I totally got lucky. |
| [+] Spring » * Welcome Craig Walls (Go to) | | Liutauras Vilda |
This week, we're delighted to have Craig Walls helping to answer questions about the new book Spring in Action (5th edition). The promotion starts Tuesday, December 11th, 2018 and will end on Friday, December 14th, 2018 We'll be selecting four random posters in this forum to win a free copy of the book provided by the publisher, Manning. Image from https://images-na.ssl-images-amazon.com Please see the Book Promotion page to ensure your best chances at winning! Posts in this welcome thread are not eligible for the drawing, and should be reserved for welcoming the author. Questions posted in this topic are subject to removal. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
I think my Day 11 Part 2 needs some revision as it's been running for quite some time now..... |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Oh man that's really frustrating Stephan. I liked yesterday's puzzle too as a demonstration that your choice of data structure can really really really make a difference to your application performance. I couldn't find a linked list in Python so ended up with a little hack using a queue that had very fast head insertion and deletion operations. For today's puzzle I wrote a function that would generate and print the grid of dots and hashes but I made the mistake of having it print out every single iteration and it took so long generating the first grid (approx 100000 by 100000 item grid) that I quickly abandoned that before any output was generated at all. I took a similar approach to you and only printed anything out when the difference in y values was 10 or less. A guess that turned out to be spot on as it only printed one image and was the one I wanted. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Ha Ha! You got me  |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Tee hee  Bear successfully poked. I can say nothing, some of my code is truly a crime against the profession. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Recursion and using variables declared outside of the recursive method Liutauras? I managed to get part 1 done by simply processing the input sequence from left to right also using recursion to collect all the meta values. It was quite tidy even. But then along came part 2 and blew my design out the water and I had to start again  |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Day 10 was a fun one. It's a pleasant change of tact when you have to use your eyes to solve it rather than getting the computer to do it. The trick was having the computer present you visibly decipherable information but not too much or too little of it. Part 2 was a doddle. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
My initial day 9 part 1 solution used an array, but with insertions and removals mid list it was not efficient. Using this solution part 1 completed in around 0.6 seconds which was ok. Then came part 2. Just increasing the marble count by 100 with my original algorithm really highlighted the problem. After a half an hour I aborted the run and went back to the drawing board. I replaced the array with a python deque (double ended queue), jigged the algorithm to suit it, and viola! 2.5 seconds to the part 2 solution. If you're wondering how I did mid list inserts and deletions from a queue, well it turns out that a python deque has a rotate function that allows you to quickly rotate the list so that a popleft or appendleft achieves the desired action. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Oh my. Day 9 Part 1 was straight forward enough, but part 2 is a real test to your algorithm efficiency. I believe a data structure rethink is in order here. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Well I don't know Perl at all but you can use any list like structure as a queue as long as there are facilities to take things off one end of the list and put things on the other. I see in perl you can use an array like a queue by limiting use to the push and shift functions. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Day 8 is a welcome relief after yesterday. Straight forward enough, and even quite happy with the solution design too which is a rare thing. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Michael Mraz wrote:a combination of "That logic makes sense" and "WTF does that do?" I'll probably feel the same way tomorrow if I'm honest. I chose to use Python because I don't use it hardly ever and want to gain some more familiarity with it. I don't pretend for a second to be any good at it. |
| [+] Meaningless Drivel » A book as a gift? (Go to) | | Randy Maddocks |
I really enjoyed "Dr Sleep" but I had recently re-read "The Shining" which probably had a lot to do with it. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Jeepers that was hard work! Satisfying to get all of Day 7 done though. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Bumbled my way through Day 7 Part 1 but was such a mess that Part 2 is near impossible. The level of technical debt I have created in mere hours is astounding. Rewrite in progress........ |
| [+] Meaningless Drivel » A book as a gift? (Go to) | | Randy Maddocks |
I do love me a good Stephen King book, and I've heard both of the titles on that list "Outsider" and "Elevation" are very good. |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
I think I'll be keeping you behind me on the board this time Liutauras  |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Hey Frits thanks for the cow! There's plenty of room in the leaderboard if you want to join in? I wonder how Michael "I'm not a software engineer by trade but is kicking all our butts" Mraz found today's day 6 puzzle? |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Also took me a good while to get the requirement straight in my head before I even attempted to go near a computer with it. All done now though, phew! |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Day 6 is melting my head  |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Our Chicaco dwelling friends get a new puzzle at 11pm so just have to stay up a little late to get started. Where I am, in Northern Ireland, I would have to be up and ready for 5am and that ain't gonna happen. It's early days yet Piet, still plenty of time for the wheels to come off my AoC wagon. #AdventOfExcuses |
| [+] Meaningless Drivel » Edge is out (Go to) | | Harry Kar |
Sinead O'Connor doesn't usually have hair. Are you sure you're not thinking of The Cranberries? Probably the song Zombie? |
| [+] Meaningless Drivel » Edge is out (Go to) | | Harry Kar |
Edge is out  |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Michael Mraz wrote:23 times faster is good, right? Right |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Holy Smokes!!! Initial run = 8 minutes Refactor 1 = 2 minutes 30 seconds Refactor 2 = Half a second Thanks very much Stephan! |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Stephan, I never thought of using a stack for this but it makes total sense. I'm going to have to refactor again now  |
| [+] Programming Diversions » Advent of Code 2018 (Go to) | | Stephan van Hulst |
Hi Michael, Welcome to the Ranch! great to see you here. You're not alone in being hindered by silly mistakes. Sreedevi says she was so tired last night she kept submitting the wrong thing and having to wait to be allowed to submit again. And Liutauras, Sree says thanks for the global top 100 encouragement  |
| [+] Ranch Office » Tim Moores, congratulations (Go to) | | Tim Moores |
Nice one Tim. Cows waiting  |