Subscribe now and choose from over 30 free gifts worth up to £49 - Plus get £25 to spend in our shop
Anyone else playing this year?
I'm attempting solutions using FME, but will resort to python within FME if a pure FME solution looks impossible.
I concur.
I guess that's a no then 🙂
Never seen this before, but just solved the first day with excel, is that cheating?
(There wasn't an RPGIV editor on replit.com, so I'm a bit stuffed otherwise).
looked at problem 1, thought yeah I can do that and ate some chocolate. does that count?
I concur.
I think it's a coded message.
Never seen this before, but just solved the first day with excel, is that cheating?
No, you can use whatever language/program you like
I think it’s a coded message.
In winter the red fox hunts the white hare.
looked at problem 1, thought yeah I can do that and ate some chocolate. does that count?
That reminds me of the old joke about the Engineer, Physicist and Mathematician.
They're all staying at a hotel overnight and by some freak chance a fire breaks out in each of their rooms.
The Engineer wakes up, sees the fire, quickly fills an ice-bucket with water, douses the flames and goes back to bed.
The Physicist wakes up, sees the fire, quickly fills and ice-bucket with water, quickly calculates the optimum angle and force to apply to the bucket given an assumed range and bucket mass, and neglecting the effects of air resistance as negligible; douses the flames, and goes back to bed.
The Mathematician wakes up, sees the fire, quickly determines that the problem is solvable, and goes back to bed.
Anyway. I had a go at Day 1. First time I've heard of FME: is it a natural fit for coding advent calendar problems?
(There wasn’t an RPGIV editor on replit.com, so I’m a bit stuffed otherwise).
It's also the first time I've come across RPGIV, too.
I desperately wanted it to be some kind of MMUD where you code by moving through ASCII-rendered dungeon rooms accumulating counters, fighting d-cache lookup misses, and vaulting NULL pointers, but sadly it's nothing like that at all.
Ignorance is bliss.
In winter the red fox hunts the white hare.
The sparrow farts gently in the autumn sun.
First time I’ve heard of FME: is it a natural fit for coding advent calendar problems?
Based on past years, I'd say some puzzles are simpler in FME but most are more difficult (possibly impossible). I think I managed 44 stars out of 50 last year using FME and had to resort to python for the final 6.
I'm in, hopefully using ICI as that's our language of choice at <work>, don't @ me.
Failing that, perl.
ICI as that’s our language of choice at <work>
Another new one! Today is a proper school day 😀
Ooh this looks like just the sort of distraction from real work I like!
Failing that, perl.
Now there's something I've not heard mentioned for a few years, other than when asked by a friend 'What on is earth is Perl for the web?' when looking at the 20+ year old text books my iMac sits on.
See if I can dust off some of that old knowledge....
Perl is my natural language of choice I guess, having used it for a few sites over the years but mostly backend processes these days. I can't remember the last time I bought a programming book, despite being addicted in my youth - probably something on WAP.
I just made a long list of all the languages I've used, and realised they are nearly all no longer used, , with the exception of c+variants and java/python, everything else back to algol/fortran is just about defunct. ICI is used ony at <work>, and almost no where else.
far to much reading involved for me.
Just done day 3, nothing more than excel and a bit of sorting. Got a feeling my basic excel knowledge is not going to be enough fairly soon.
It’s also the first time I’ve come across RPGIV, too.
I desperately wanted it to be some kind of MMUD
No use to me, I haven't played the first 3.
I'm trying to do it in R, since I'm trying to become more competent in that language. I'm getting frustrated!
Stupid n00b question, the URL for the data is 'https://adventofcode.com/2021/day/1/input' but R (and Matlab, which I also tried) seem to want a file to read. I tried bunging .html, .php and /index.html at the end of that address, but it didn't work. How can I scrape the website? I've already got the answer by copying / pasting into excel then loading that into R but that seemed like an immediate failure.
I’ve already got the answer by copying / pasting into excel then loading that into R but that seemed like an immediate failure.
Nah, get it into whatever file format however you want to.
I'm in. Using Ruby.
How can I scrape the website?
I'm just copying the data into a local txt file. Parse into an array. Job done.
Fair enough. I just thought it should be dead easy to scrape the website itself rather than having additional files saved on my PC.
I can just copy paste the data into my workspace but most of the python solutions I've seen use a local txt file as their input so I wouldn't worry about that. Puzzle inputs differ by user so you can't just simply scrape the website.
Part 2 of Day 3 is fairly hideous to do in FME but it's done.
Yesterday's puzzle was really nice and straightforward in FME, only required one change to get part 2. Today's part 2 required a complete rewrite. You win some you lose some
Part 2 of Day 3 is fairly hideous to do in FME but it’s done.
Because use I'm a dick, I tried doing it just with SQL. Got the wrong answer and I had give up to to do some actual work...
Just looked at the bingo and the vents one, both look equally tricky...
Lanternfish looks pretty straight forward...
Another new one! Today is a proper school day 😀
Indeedy,FME and ICI ,I’d heard of RPGiv thou.
Perl’s a singer 🙂
Got enough work related coding challenges, without digging up a Chrissy one 🙂
(Who thought page numbering could be so interesting)
Does it get interesting at any point? The first few were the sort of trivial processing that I waste most of my life doing as a pre-requisite to getting any useful work done....
FME is an ETL tool rather than a programming language, not sure if I'd made that clear 🙂
Lanternfish looks pretty straight forward…
pt2 would be, except it starts blowing the array limit of javascript 🙂
Gah - not even started - tonights the night !
Jeez, I'm stumped on day one. Powershelling it and I don't think my code is wrong but I must be missing something.
That was one line of R code...
Jeez, I’m stumped on day one. Powershelling it and I don’t think my code is wrong but I must be missing something.
Use the example as a test case: helps to debug when you know what the answer should be and why of course!
did it in excel (correctly) and it was 1 more than my original answer, 2 more than my afterthought answer. I'm still stumped to the logic. Something is back to front.
But it works on the example data.
#feelingthick
Does it get interesting at any point?
I've been running through last years, some have required a bit of thought.
did it in excel (correctly) and it was 1 more than my original answer, 2 more than my afterthought answer. I’m still stumped to the logic. Something is back to front.
But it works on the example data.
If the code is right could the data be wrong? Some copy/paste error or similarly frustrating PEBKAC?
did it in excel (correctly) and it was 1 more than my original answer
It is one of the two hard problems in computer science:
https://twitter.com/codinghorror/status/506010907021828096?lang=en-GB
Well, the same data & logic worked for D1P2, so truly stumped.
@jimmy - post code if you are stuck, probably something very simple.
I cocked my first few attempts up by not using strict in perl and mistyping a variable name - noob.
I was able to brute force a solution this morning before I stumbled on a cleverer way
this is much more interesting than the meeting I am in
got to day 3 part 2
d3p2 took some typing
@jimmy – post code if you are stuck, probably something very simple.
Thanks. The fact it works for D1P2 suggests there's some data nuance I've missed. But I'm onto D2P2 now. Just doing it because I miss scripting now absent from the day job.
Oh dear - I posted the wrong AoC STW code a few minutes ago - apologies if you joined and then get booted from our work leaderboard.
I have created a STW leaderboard, where we can all revel in our lack of effort.
Its the end of no-effort November, into born-to-be-mild December.
The correct code is, scouts honour checked it a few times now, 502307-275d7a99
Thanks
Ant
I'm sure there's a thread about work ethic and not being distracted by quizzes. I could waste a lot of time with these
Thanks. The fact it works for D1P2 suggests there’s some data nuance I’ve missed.
Probably miscounting at the start/end, and works for p2 because comparing n-1/n+1 happens to give you the right answer despite that.
Out of interest, how long are these taking people?
I can code stuff semi-competently in Matlab but as stated I'm trying it in R. I can think up a possible solution within seconds, but getting it into a script takes time, and there's always some error / troubleshooting to be done (converting numbers to strings is a PITA, and I don't quite 'get' data structures and indexing in R very fluidly). As a result, I reckon each day's challenge probably takes at least an hour.
Out of interest, how long are these taking people?
I think they've all been under 10 minutes so far. Before I've gotten to the bottom of the first cup of coffee, anyway.
The leaderboard times are pretty impressive - 1:32 for the fastest to get to both stars today.
https://adventofcode.com/2021/leaderboard/day/7
It varies for me depending on the nature of the problem. Saturday probably took me an hour for both parts, Sunday only 10 minutes. I'd nearly always be able to do them more quickly in python, but the challenge I've set myself is to do them in FME.
Also, if you've done previous contests, you get to know the style of problems they set so that makes things easier.
Nine times out of ten, if you can brute force a solution for part 1, you'll find part 2 needs a rewrite so you know to start looking for patterns or alternative ways of getting the answer. Today's was unusual in that you could complete part 2 even with a naive solution for part 1
Hmm, that's not making me feel better 😀 Are you guys professionals?
I can code stuff semi-competently in Matlab but as stated I’m trying it in R. I can think up a possible solution within seconds, but getting it into a script takes time, and there’s always some error / troubleshooting to be done (converting numbers to strings is a PITA, and I don’t quite ‘get’ data structures and indexing in R very fluidly). As a result, I reckon each day’s challenge probably takes at least an hour.
The trouble you have there IMO is that you're not "doing advent of code", you're doing advent of code as a part of the process of learning R.
If you had the language details at your fingertips you'd be able to concentrate on the problems and solutions rather than looking up language details.
Are you guys professionals?
Yes.
But yeah, you're learning a new language - trying at all is winning.
Are you guys professionals?
I'm not a programmer/developer but I'm solving them with FME which is pretty much my day job. Although the data wrangling I do day to day is quite far removed from Advent of Code type puzzles.
Yeah you're right. I just did both parts of day 7 in my favoured Matlab code and got it done in about 15 mins. Not lightning quick but waaay quicker.
R is kind of similar to Matlab* but sufficiently enough that I have to look up nearly everything!
* Python is also similar
Just doing the Lanternfish exponential growth one and it's broken my computer! I guess my code was pretty inefficient. 80 iterations ran quickly, and I thought that my code allowed me to simply swap number_iterations=80 for 256 and press run. But instead, I've run out of RAM 😀
But instead, I’ve run out of RAM
640K is all you really need.
I had to do a complete rewrite for part 2 of lanternfish too 🙂
For me so far d4 took the longest, d5-7 not very long, I had to redo the fish one too
They are all in a similar style but how people get sub 2 mins I have no idea
They are all in a similar style but how people get sub 2 mins I have no idea
A lot of it is just having done enough of them, and built up enough of a toolkit to refer to.
I've been doing them pretty leisurely in the morning whilst I'm still waking up, and flipping languages for fun, but if I was taking it seriously, I'd probably be looking at 3-4 minutes for most of them so far.
640K is all you really need.
Can't work out if that's just a computer joke, or whether it's a serious attack on my code optimisation 😀
Oooooohh. Yeah. 😀
(I just worked out how to do the Laternfish one in less than a second of computing time and definitely less than 8Gb RAM)
I made the mistake of trying to read today's puzzle before coffee, took me 5 minutes to work out what they were asking for nevermind solving it!
Stalled on D3 last night. I have a theory but it's testing my PS knowledge. As usual, I'm sure there are inbuilt clever ways to do it but I'm too old skool clunky.
Today's took quite a bit of effort. Hared off down the wrong path trying to be too clever to start with.
My solution today feels clunky but not sure I can make it any more elegant in FME
I think I’ve given up at day 4 having spent the best part of an hour today writing the world biggest nested for loop to get halfway to the answer and then being stumped on where to go next. Maybe next year I’ll have more python skills.
You don't need to complete a day to go on to the next so you can always dip in and out.
Yes didn't get today's figured out before I had to start doing paid work, it's tricky
I too niaively thought I'd just up the iterations for the lanternfish 😁
Loved today's puzzle, right up my street.
yes it was a good one
I'll go back to yesterday's later, I think I need to read it again because I'm not seeing it
Got yesterday's. The way I read it made me think that some clever trick was necessary. In the end I did a big search.
I enjoyed todays; took me back to my youth creating programs to draw graphics in 8-bit micros 😀
Just finished Day3Pt1. I had the logic early on, just getting the code to work for me took way too long.
This is fun / addictve but I don't really have the time!
CBA this year. I've started it the past couple of years, but after about 2 weeks in it tends to require about an hour every day, and the mental energy, neither of which I have.
It is a fun wee puzzle after breakfast - thanks for posting OP. I'm lazy so cheating and just doing it in Java.
I thought today's was quite a bit easier than yesterdays - once I realised my answers were bigger than 2^32 and my scores going negative. Doh..
Nice quick one today
I've got all the stars for days 1 through 10 in FME which is an improvement on last year. I had to resort to a pythoncaller within FME for part 2 of one of the puzzles by this stage last year.
Pleasantly surprised that my part 1 solution today led nicely into part 2
Took longer than d9, but I switched to a style/lang I am less familiar with (excuses, excuses). Got a tidy solution though. I suspected what part 2 would be, so getting the point was easier than figuring the convoluted score!
Doing this kind of thing in what I imagine FME to be sounds horrible
