Forum menu
Advent of Code
 

Advent of Code

Posts: 0
Free Member
Topic starter
 
[#12133209]

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.


 
Posted : 01/12/2021 9:33 am
 Drac
Posts: 50602
 

I concur.


 
Posted : 01/12/2021 9:36 am
Posts: 0
Free Member
Topic starter
 

I guess that's a no then 🙂


 
Posted : 01/12/2021 2:07 pm
Posts: 7203
Full Member
 

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).


 
Posted : 01/12/2021 2:22 pm
Posts: 23334
Free Member
 

looked at problem 1, thought yeah I can do that and ate some chocolate. does that count?


 
Posted : 01/12/2021 2:23 pm
 grum
Posts: 4531
Free Member
 

I concur.

I think it's a coded message.


 
Posted : 01/12/2021 2:33 pm
Posts: 0
Free Member
Topic starter
 

Never seen this before, but just solved the first day with excel, is that cheating?

No, you can use whatever language/program you like


 
Posted : 01/12/2021 2:56 pm
 Drac
Posts: 50602
 

I think it’s a coded message.

In winter the red fox hunts the white hare.


 
Posted : 01/12/2021 3:17 pm
Posts: 1230
Full Member
 

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?


 
Posted : 01/12/2021 3:24 pm
Posts: 1230
Full Member
 

(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.


 
Posted : 01/12/2021 3:28 pm
 grum
Posts: 4531
Free Member
 

In winter the red fox hunts the white hare.

The sparrow farts gently in the autumn sun.


 
Posted : 01/12/2021 3:32 pm
Posts: 0
Free Member
Topic starter
 

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.


 
Posted : 01/12/2021 3:49 pm
Posts: 403
Free Member
 

I'm in, hopefully using ICI as that's our language of choice at <work>, don't @ me.

Failing that, perl.


 
Posted : 01/12/2021 4:17 pm
Posts: 1230
Full Member
 

ICI as that’s our language of choice at <work>

Another new one! Today is a proper school day 😀


 
Posted : 01/12/2021 4:44 pm
Posts: 0
Free Member
 

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....


 
Posted : 01/12/2021 5:59 pm
Posts: 403
Free Member
 

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.


 
Posted : 01/12/2021 6:31 pm
kelvin reacted
Posts: 11402
Free Member
 

far to much reading involved for me.


 
Posted : 01/12/2021 6:36 pm
Posts: 23
Free Member
 

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.


 
Posted : 03/12/2021 12:24 pm
Posts: 78467
Full Member
 

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.


 
Posted : 03/12/2021 12:31 pm
Posts: 6859
Free Member
 

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.


 
Posted : 03/12/2021 2:13 pm
Posts: 7203
Full Member
 

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.


 
Posted : 03/12/2021 2:45 pm
Posts: 5300
Full Member
 

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.


 
Posted : 03/12/2021 2:59 pm
Posts: 6859
Free Member
 

Fair enough. I just thought it should be dead easy to scrape the website itself rather than having additional files saved on my PC.


 
Posted : 03/12/2021 3:13 pm
Posts: 0
Free Member
Topic starter
 

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.


 
Posted : 03/12/2021 5:33 pm
Posts: 0
Free Member
Topic starter
 

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


 
Posted : 06/12/2021 2:37 pm
Posts: 7203
Full Member
 

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...


 
Posted : 06/12/2021 2:46 pm
Posts: 5827
Full Member
 

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)


 
Posted : 06/12/2021 3:05 pm
Posts: 7513
Free Member
 

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....


 
Posted : 06/12/2021 3:14 pm
Posts: 0
Free Member
Topic starter
 

FME is an ETL tool rather than a programming language, not sure if I'd made that clear 🙂


 
Posted : 06/12/2021 3:14 pm
 StuF
Posts: 2099
Free Member
 

Lanternfish looks pretty straight forward…

pt2 would be, except it starts blowing the array limit of javascript 🙂


 
Posted : 06/12/2021 3:25 pm
Posts: 403
Free Member
 

Gah - not even started - tonights the night !


 
Posted : 06/12/2021 4:44 pm
Posts: 8857
Full Member
 

Jeez, I'm stumped on day one. Powershelling it and I don't think my code is wrong but I must be missing something.


 
Posted : 06/12/2021 5:01 pm
Posts: 7513
Free Member
 

That was one line of R code...


 
Posted : 06/12/2021 6:26 pm
Posts: 1230
Full Member
 

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!


 
Posted : 06/12/2021 6:28 pm
Posts: 8857
Full Member
 

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


 
Posted : 06/12/2021 8:07 pm
 Aidy
Posts: 2977
Free Member
 

Does it get interesting at any point?

I've been running through last years, some have required a bit of thought.


 
Posted : 06/12/2021 8:12 pm
Posts: 1230
Full Member
 

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?


 
Posted : 06/12/2021 8:23 pm
 Aidy
Posts: 2977
Free Member
 

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


 
Posted : 06/12/2021 8:35 pm
Posts: 8857
Full Member
 

Well, the same data & logic worked for D1P2, so truly stumped.


 
Posted : 06/12/2021 9:19 pm
Posts: 403
Free Member
 

@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.


 
Posted : 06/12/2021 11:39 pm
Posts: 0
Free Member
Topic starter
 

I was able to brute force a solution this morning before I stumbled on a cleverer way


 
Posted : 07/12/2021 12:41 pm
Posts: 3323
Full Member
 

this is much more interesting than the meeting I am in

got to day 3 part 2


 
Posted : 07/12/2021 1:37 pm
Posts: 3323
Full Member
 

d3p2 took some typing


 
Posted : 07/12/2021 3:09 pm
Posts: 8857
Full Member
 

@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.


 
Posted : 07/12/2021 3:19 pm
Posts: 403
Free Member
 

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


 
Posted : 07/12/2021 3:26 pm
Page 1 / 5