#AOC
Day 7
This one was pretty fun. Good exercise to leverage a custom Rust Ord implementation, especially given that the scoring rules dropped to lexicographic after equivalent hands.
Adding the joker was interesting. First I copied the whole module and worked in the Joker, then after submitting, I reworked it into generics.
Not a great generic solution, but it's good enough.
https://codeberg.org/Taywee/AdventOfCode-2023/src/branch/main/src/bin/day07.rs
I completed #Day08 of #AdventOfCode2015, just for the fun of it.
Part 1:
- Difficulty: 2/10
- Workout: 1/10
Part 2:
- Difficulty: 1/10
- Workout: 0/10
Bloody, tricky, quotes! :-P
Just kidding: easy one, done in just 1 hour.
The hardest part was quoting both searches, regexes and substitutions on strings, while the terms were quoted themselves. I have a lot of experience with that, from when I generate code by metaprogramming. The order of substitutions do matter.
The program itself was easy: for each line, do replaces, and compare lengths.
I completed #Day07 of #AdventOfCode2015, just for the fun of it.
Part 1:
- Difficulty: 3/10
- Workout: 5/10
Part 2:
- Difficulty: 1/10
- Workout: 2/10
I've done it in upwards of 6 hours, spread at 2 or 3 different days. It's a direct simulation: create all the wires (entries in a Map), map each line to an logic operation (with arguments validation), then run the operations. Each operation, when called, only runs if all arguments are available (not null).
The operation loop is a double one. While there are "not done" operations, loop executing them, marking each as done/not done. Eventually, all operations will be done.
The harder part was rewriting the class/function structure for operations (from full-featured class to collection of static methods) and for wires (Map of classes, to Map from String to number). KISS. Could be refactored further for size, but I'm shot of it.
⭐⭐ Here's my Advent of Code 2023 Day 6 "Wait For It" solution in pure Python 🐍
#aoc for #AdventOfCode, do I need to do everything day before the current day or can I start with today's and work backwards?
Rep. #AlexandriaOcasioCortez / #AOC Lights Up #Republicans For #Voting Against #Women’s Interests
https://www.politicususa.com/2023/12/05/alexandria-ocasio-cortez-gop-women.html
I completed #Day06 of #AdventOfCode2023.
Part 1:
- Difficulty: 1/10
- Workout: 1/10
Part 2:
- Difficulty: 1/10
- Workout: 1/10
Completed in just over 1 hour. The implementation of part 1 was straightforward: easy parsing, map, filter, length. Part 2 would work, too, but after a few seconds running, I did the smart thing: skip the loops entirely. Immediate solution.
Big hint: solve the equation
a * (t - a) > d
For integer a.
Once again I learn I will go to incredibly great lengths to avoid solving the quadratic equation.
I've completed "Wait For It" - Day 6 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/6
#aoc #AdventOfCode23 #aoc23 #aoc_cpp
#AdventOfCode 2023 Day 6: Wait For It
https://adventofcode.com/2023/day/6
Today a little high school math? I solved it first with just the calculator. But then coded up a fancy python program nevertheless.
Code is here:
https://github.com/nharrer/AdventOfCode/blob/main/2023/day06/solve-day06.py

Nice and easy today. Thanks Eric
https://git.sr.ht/~luciano/adventOfCode/commit/ffbd06d0afc64149ed049d581690084218d42a8c
Things you can do with a database, which you shouldn't necessary should do…
https://github.com/michael-simons/aoc/blob/master/2023/day06/sql/solution.sql
Todays challenge was sponsored by "PQ-Formel" respectively "Wie ging dat nochmal?!"
Day 6 is complete - recognised early on that quadratic equations would be better than testing, but part 2 needed bigger numbers than the types I usually use allow for so I just had to fiddle with that a bit... Otherwise a fairly simple challenge today 8-)
AdventOfCode 6 was surprisingly easy compared to all of the previous puzzles...
My solution for part 1 also worked for part 2.
Day 6
Very easy day. Used my whiteboard to suss out that this was a #QuadraticEquation (yes, I had to use my whiteboard to do this, and I'm not ashamed of being an embarrassment). Naturally, my solution uses the #QuadraticFormula to find the answers.
https://codeberg.org/Taywee/AdventOfCode-2023/src/branch/main/src/bin/day06.rs
I (finally!) completed #Day05 of #AdventOfCode2023.
Part 1:
- Difficulty: 4/10
- Workout: 3/10
Part 2:
- Difficulty: 5/10
- Workout: 7/10
Part 1 was completed in 1 hour. Early in the game, I noticed that the mappings, with billions of elements, were too big to fit explicitly in memory. So, I created a function to pass one seed through the mapping, only checking the intervals' end points.
Then part 2 came, with billions of seeds to check. Brute forcing was a lost cause: tried it, lost 2 hours, expected another 6 to be done.
I had to resort to clever set operations (intersection and difference) over intervals: several folks had this idea. Split seed intervals over each mapping: common intervals are mapped to destination intervals, seeds not in common intervals make their own intervals and pass unchanged. The result is a list of intervals, to pass as input "seeds" to the next mapping.
Now part 2 was almost immediate, the seeds having been pulverized into just a few hundred intervals.
Total elapsed time: about 8 hours. Whew!
finally got day 05 part 2. stupid. part 2 finishes in 70 seconds.
https://git.sr.ht/~luciano/adventOfCode/commit/877ac16d35fa9412907dae3d3774851806fc0fbd
I did *not* complete day 05 of Advent of Code today.
Part 1 was done in 1 hour:
- Difficulty: 4/10
- Workout: 3/10
The rules were tricky, but doable.
Part 2 broke me: running through billions of seed values takes too much time. I had to use a idea from someone: splitting seed intervals over a mapping, and take the corresponding destination intervals. I'm still debugging it. Workout 6/10, for now, let's see when I end it.
To not get spoilers of the next days, and to not stress myself, I'm unfollowing Advent of Code related tags - but I will still post once in a while.
AOC Was Offered $100,000 by AIPAC to “Start the Conversation.” She Turned Them Down.
#AOC #AIPAC #Conversation #SquadBook #TurnedThemDown #PoliticalInfluence #Politics #News
Today #Java again.
First used #JEP #453 to make my dead slow solution bearable fast, then my brain to make it fast.
The puzzles this year are nice. All programs I wrote so far work on stdin, so one can directly copy and paste on them. None of the solutions read the input twice or buffer it unnecessary.
https://github.com/michael-simons/aoc/blob/master/2023/day05/java/solution.java
AOC Was Offered $100,000 by AIPAC to “Start the Conversation.” She Turned Them Down...#AOC..#AIPAC..#Israel https://theintercept.com/2023/12/05/aoc-aipac-squad-book/
Just finished part 2 of todays #aoc #aoc2023 challenge. The calculation took ~160s and it would probably be an interesting exercise to optimize my approach, but no time left for today.
Nice experience: Writing the parsing code takes most of the time because I'm not used to it, but I'm getting faster. Then I have a fight with #Rust (which is also getting shorter).
Afterwards it "just works" and the result is correct with the first try. At least most of the time.
TIL: While going through the #aoc code for Day 5 in #CrystalLang, I came across a usage of "Unpacking block parameters" that caught my attention. Example from the doc:
```
array = [{1, "one"}, {2, "two"}]
array.each do |(number, word)|
puts "#{number}: #{word}"
end
```
Check it out here: https://crystal-lang.org/reference/1.10/syntax_and_semantics/blocks_and_procs.html#unpacking-block-parameters
#aoc начало пятого дня. Уже чуть побольше нужно думать.
Still stuck on day three of #aoc, but I think I almost have part one pinned down. I dunno why, but this really racked my brain lmao.
Ended up rewriting my attempt like three times already.
oooo... part 2 is NASTY. #aoc
Can't say I'm a huge #AOC fan but as a #USPol she's more impressive than most. Faint praise, but jesus fuck the general offhand level of corruption here is INSANE.
Quick and disgusting read in link below about how one facet of Big Evil brazenly buys (or in this case, attempts to) US pols.
Illustrates the worth of bearing in mind that when #Democrats* side with the evil af, ultra right wing govt of Israel, it's basically a giant beacon proclaiming "HELLZ YEAH, I TOOK THOSE AIPAC BRIBES! I HAVE NO MORALS WHATSOEVER BUT YAY $$$$!"
*Yes, yes, obvs #Republicans too. As we all know, our good buddy & massive tax $ hoover, Bibi, wanted POTUS Trump. But Reps' loudly proclaimed BRAND has been We're Evil, Fuck You(TM) as long as this Gen Xer has been alive. Whereas Dems pretend they're a "lesser" evil, if not The Good Guys.
#AIPAC #USPol #Corruption #Democrats #GenocideJoe #Evil #Amoral
#AdventOfCode 2023 Day 5: If You Give A Seed A Fertilizer
https://adventofcode.com/2023/day/5
Done and dusted.
Regarding Part 2, I initially thought it was easy. However, I encountered some minor challenges that caused a bit of a setback. I find it frustrating that Python lacks type checking; if I had been using Typescript, as I did last year, I could have detected mistakes much earlier.
And no, I did not brute force part 2 😎.
Code is here:
https://github.com/nharrer/AdventOfCode/blob/main/2023/day05/solve-day05.py
I have the framework for the part 2 solution but arghh... the debugging...
Todays #aoc (day 5) took 9 minutes on my box to run (single threaded). Please tell me there is a smart way to do it, searching from the minimum upwards.
Mostly C++, because it's comfort food & I already have some #AOC -specific utilities sitting around from a previous year.
I did do a couple days in rust because I was on a different machine at the time and felt like giving it a try. Rust is pretty cool, IMO.
I've completed "If You Give A Seed A Fertilizer" - Day 5 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/5
#aoc #aoc23 #AdventOfCode2023 #aoc23_cpp
*optimistically starts the stupid, brute force method*
*goes to make breakfast and ponder further*
One problem is can I guarantee that a single range of seeds will stay within a single range of mappings? Probably not...
As always, I am left wondering which idiot designed such an awful system which is sooooo unusable that the experienced elves should know exactly what they;re doing and how to interpret these things...
Part 1 is done, but Part 2 feels like there must be some weird shortcut I can use rather than dealing with all that...
I wanted to do #aoc day 5 on the train, but this looks like I'd need a proper workplace for that.
@Linux_Is_Best the problem with the U.S. politricks is that people only have the choice of "choosing a lesser evil" by virtue of it's system.
And whilst that is neither a law of nature nor something that can't be changed, it's very much not going to get changed this term around.
https://mstdn.social/@Linux_Is_Best/111525359844557182
Or as some people may say:
"For evil to prevail, good people only have to do nothing!"
Would I wish for a real #SocDem to get into the white house or #BermieSanders or #AOC as a compromise?
OFC!
Hoopla just completed Day 4 of #adventofcode2023. The hoops I had to jump through to get part 2 to work for loops in C++ is 😵 But here it is! https://github.com/somecho/aoc23.cpp/blob/main/src/day_4_2.cpp
#cpp #aoc #adventofcode #codingchallenge #functionalprogramming
@ericwastl Hi!
Thanks for #AoC. I was trying to share it with the #Teckids community, but then found out that hackers under 16 years of age are banned :/
Can you shed some light on this decision, please ☺?
es kommen immer wieder Menschen zu uns und fragen ob wir auch Programmierkurse geben. in der Regel ja nicht, eher Hilfe zur Selbsthilfe - wo möglich.
Wer aber irgendwo einsteigen möchte kann sich am #aoc #AdventOfCode versuchen, im Dezember jeden Tag eine Aufgabe - oder aber hier ein paar der vielen tollen Lösungen verstehen.
happy coding, gerne weitersagen.
Wer mag kann die natürlich auch bei uns im Club lösen.
https://adventofcode.com/2023
#coding #challenge #programmmieren #wettbewerb
I've been in such a programming slump for like almost six months, but I think #aoc is getting me back into the groove again.

Bro wtf is day three :blobfoxangrylaugh:
Okay, so I got around to part two for yesterday's #aoc, but the answer I'm spitting out seems low.. I'm afraid to submit it lmao.
I'm going to try and write about my #aoc solutions.
Dude #aoc day two was a trip. There's all kinds of subtleties in the inputs this year that are really tripping me up.
It's great practice, though. Had to go full debugging mode to find why I wasn't able to parse the input as expected. printf debugging for the win.
Waiting for my car at the shop and it’s taking forever. Just doing today’s #aoc from my phone, nbd.

(CW: Subjective, not objective, ranking of languages for one person (me))
Funny (and maybe sad) to find that after all this time Python is still the language I turn to for solving #AOC like problems. I did Day 2 in Python (first) and then Racket and I'm working on the C++ solution.
My Racket is getting better but it's hard to be motivated to use a scheme when Python feels dynamic enough and I'm so at home with it.
Everyone apparently writes their own string::split equivalent in C++. In 2023.
Finally finished day one! https://codeberg.org/btp/aoc
Totally forgot that the Advent of Code started on the 1st of December! https://adventofcode.com/
It's a nice way to do some coding puzzles and test your coding skills! :parrotnotfound: I might get to it later - I'm currently quite busy in several corners of my daily life. More on that soon (maybe).
#AdventofCode #aoc #advent #calendar
its Advent of Code time btw:
https://adventofcode.com/2023/day/1
#developer #aoc #learning
i prolly won'T be able to fix this every day, but i'm gonna try!
this year i actually want to try golang, however since im the worst JS dev on the team i should prolly go towards JS (and book it as company training at least :D)
Anyone doing Advent of Code this year?
Here's the solution to the first part of Day 1 #adventofcode challenge in 192 bytes!
I ended up doing the first AoC challenge in 16bit 8086 assembly.
#programming #assembly #asmprogramming #retrodev #adventofcode #adventofcode2023 #aoc #aoc2023

In better news, I think I just figured out a use for function composition... Instead of mapping with one function than mapping with the next, I can map with a composition of the two functions...
I'm smart, I am!
really bad failing to explain an important part of the input - not giving any relevant examples...
in "eightwothree" you do not see "eight" and discard those characters as if they were a digit to leave "wothree" from which you can pull out "three" - these are all you need in that example line, but the full digits are 8, 2 and 3 as the two should also be extracted. This is not shown in the example...but it does matter at end of the line...
Hmm.... trying to get Part 2 sorted and my code gives... the wrong answer..?
The example input works, I seem to be finding the digits and making the calibration figure correctly in each row I spot check, I've checked the (literal) edge cases, I've checked for all digits being recognised...
but it's just the wrong answer...
Arghh...
After some time of playing and making a working ugly solution with searching in a reversed string for reverse words. Solved the problem.
Then got an hint from HertzDevil the simple magick prefix `.*` to get the most last captured word.
https://github.com/HertzDevil/advent-of-code/blob/main/crystal/2023/day01.cr
#aoc Regexp is hard.
Almost time for Advent of Code 2023. (11 minutes away and counting as I write this.) I'm going to try it in Rust this year.
In an effort to make things easier I've gone so far as to create a new Rust binary project, and added some templates for parts 1 and 2 of the daily problem. I followed the suggestions in this Chris Biscardi YouTube video to get started.
AOC Says Republicans Would Be “Humiliated” If Hunter Biden Hearing Was Public
#AOC #Republicans #HunterBiden #Hearing #Humiliated #Public #Politics #News
Hm.
Advent of Code is around the corner.
Who's going to participate?
I'm inclined to skip again. The competition is tough. I rather need to focus on other parts.
Mission Statement
[but don't hold me to that]
After the devastating Dutch elections [22-11-'23] I decided to dedicate my toots back to the original goal.
I care about a lot of issues, most global some national; but I won't be 'tooting' about them all.
First and formost I WANT to 'toot' about:
* #ClimateSolutions
Because I trust that most people reading know about the dreadfull future of climate change, I want to spread the, possible, solutions to a problem rather than reiterate on the problem.
* #ClimateJustice
One of those solution might be sueing the polluters or governments on human rights, violations or #Ecoside
* #ClimateAction
Action is by all means a solution.
* #ClimateEmergency
* #Climate
As said I want to focus on the global issue. I don't want to nitpick on too much principles. Like: "What's worse: eating cows or driving diesel?" Both are devastating behaviors of intitled rich people!
On the otherhand therefore I truly respect ANY effort to make a change for the better.
Most of all... I want to add instead of preach. Bring some bits of the puzzle to the table.
I'm NOT a scientist of any kind. I'm just a disabled old white guy typing on a desk reading and searching a lot.
I tend to toot 2 - 3 times a day, but that's NOT a promise.
I tend to follow anyone who 'retoots' or 'favourites' my toots. Forget it, I'm vain.
I might be interested in: #StopCopCity #ClimateFinance #Capitalism #Energy #USpolitics #Ukraine #Europe #Bernie #XR #OceanCleanup #NextBlue #InductionCooking #TaxTheRich #Africa #FemaleSoccer #Ajax #MíTambién #BigOil #Greta #CityDesign #VanessaNakate #2030 #Wildfires #Floods #PussyRiot #IPCC #AOC and more.
If any of my 'followers' want to opt out... this is your chance, as always.
#5yrsago Europe’s collision course with copyright censorship: where we stand today https://doctorow.medium.com/europes-copyright-rules-will-stifle-free-expression-8633e91f5284
#5yrsago Congresswoman #AOC can’t afford to rent a DC apartment https://www.cnbc.com/2018/11/08/alexandria-ocasio-cortez-cant-afford-to-rent-an-apartment-in-dc.html
#5yrsago @bruces on architecture, design, science fiction, futurism and involuntary parks https://www.youtube.com/watch?v=Z0__x5SG8WY
#1yrago Delegating trust is really, really, really hard (infosec edition) https://pluralistic.net/2022/11/09/infosec-blackpill/#on-trusting-trust
7/
@serge @dukepaaron There was a time when I had high hopes in #AOC, but she soon spoiled that with her astoninglishly ignorant statements on #Israel. Since she's been marauding around with her #antisemitic goon #squad, she rather successfully managed to convince me that she's not merely ignorant, but actually evil.
This is just one more proof.
There has always been that virulent #antisemitism on the #left, but the sheer amount is still shocking. And the increasing aggressiveness, the rage.
A number of Republicans are reporting death threats and harassment as the hard-right of their party turns against them for voting against Jim Jordan.
https://www.vice.com/en/article/n7e9nk/gop-death-threats-speaker?at_medium=Social%20media&at_campaign=Mastodon
#Politics #HouseSpeaker #congress #THREATS #AOC #JimJordan #mattgaetz #capitolpolice #News
AOC knocks ‘bigotry and callousness’ at Times Square rally for Palestine. “It should not be hard to shut down hatred and antisemitism where we see it. That is a core tenet of solidarity”.
https://www.politico.com/news/2023/10/10/aoc-pro-palestine-nyc-rally-00120684
#AOC #Palestine #TimesSquare #Bigotry #Callousness #Solidarity #Politics #News
I don't agree with #AOC on everything, but this was the best, most stirring speech I've heard in a long time.
"We do not pledge allegiance to greed. We do not pledge allegiance to Wall Street. We do not pledge allegiance to corporate profit. We pledge allegiance to the 𝘜𝘯𝘪𝘵𝘦𝘥 States of America; to our fellow man; to the betterment of all people!"
AOC accuses Republicans of making up evidence in Biden hearing
https://www.theguardian.com/us-news/2023/sep/28/aoc-impeachment-hearing-biden-fake-evidence
#TheGuardian #AOC #Republicans #BidenHearing #FakeEvidence #Impeachment #Politics #News
Hey! Are you a liberal or progressive now blaming Democrats for saying things like "we're happy to do this in a #bipartisan way" or "we remain open to working with our colleagues?" Do you understand that BLAMING #Democrats for that is actually Really Dumb™?
Look, I totally LOVE when the D's get all sassy; I'm pretty partisan myself. I love when #AOC or or others take down the R's. BUT...
1. People like the sound of bipartisan. It doesn't make any sense, but they like it! /1
@AmandaMarcotte Challenging corruption is the companion of progressive strategy to democratize social wealth and power. Besides, Trump’s exploits in Queens are well known to residents, especially those who were displaced. See David Kay Johnston and Tim Burton’s 2019 Dumbo. I think you’ve nailed it. #CongressionalInquiry #AOC #ProgressiveCaucus
What lies beyond, what the next points along the path are, I don't know, but I think there are some small signs of the possibility of meaningful and lasting progress in people like Alexandria Ocasio-Cortez (#AOC).
I do know that not crushing the resurgence of #fascism and other social evils allowed by our current status quo will be far worse than anything we've experienced since my childhood, and before.
You think things have been bad these last few decades, let the #Republicans continue...
here is the CNN report on what is now, not only #AOC's historic line of questioning, but a clinic in the art of deductive questioning
say her name: ALEXANDRA OCASIO-CORTÉZ
this is why #USCongress matters.
this is why voting matters.
this is why voting for anti-fascist, anti-capitalists absofuckinlutely matters
ALEXANDRA
OCASIO-CORTÉZ
the name missing from today’s news about a judge siding with NYSAG Leticia James’ investigation into how #DonaldTrump and the #TrumpOrganization defrauded #NewYork State and NYC from hundreds of millions in #taxes through his asset inflation/deflation games.
here is #AOC questioning Trump’s personal fixer, Michael Cohen, on the matter of Trump’s #paperBillionaire #wealthValuation games at the 2019 congressional hearings on the subject:
'Extremely serious': AOC becomes first progressive to call for Menendez resignation
New York Congresswoman Alexandria Ocasio-Cortez on Sunday became the first progressive House Democrat to call on Sen. Bob Menendez to resign following the former Senate Foreign Relations Committee chair's indictment last week on federal bribery charges.
Menendez (D-N.J.) and his wife, Nadine Menendez, were charged Friday with accepting hundreds of thousands of dollars in bribes—including gold bars, cash, home mortgage payments, and a Mercedes-Benz—from businessmen in exchange for influence. The indictment also accuses Menendez of giving "sensitive U.S. government information" to Egypt's dictatorship.
Appearing on CBS' "Face the Nation," Ocasio-Cortez said that "the situation is quite unfortunate, but I do believe that it is in the best interest for Sen. Menendez to resign in this moment."
"Consistency matters. It shouldn't matter whether it's a Republican or a Democrat. The details in this indictment are extremely serious. They involve the nature of not just his, but all of our seats in Congress," added Ocasio-Cortez, who is the vice-ranking member of the House Oversight Committee.
#USPol #Politics #News #AOC #BobMenendez #USSenate #Senate #Democrats #Menendez #OcasioCortez #Alternet
'Extremely Serious': AOC Becomes First House Progressive to Call for Menendez Resignation
https://www.commondreams.org/news/ocasio-cortez-menendez
#AOC #MenendezResignation #HouseProgressive #ExtremelySerious #CallForResignation #FirstHouseProgressive #Politics #News
AOC Says Climate Movement Must Become 'Too Big and Too Radical to Ignore'
https://www.commondreams.org/news/ocasio-cortez-climate-march-speech
#ClimateMovement #TooBigToIgnore #RadicalAction #AOC #ClimateMarch #CommonDreams #Politics #News
@fulelo “Every billionaire is a policy failure.” - #AlexandriaOcasioCortez #AOC
Has #TeamOrcas been seen #DownUnder ?
#AOC is so right, and this is a strong step in the right direction. And I only knew some of this history of #US meddling in #LatinAmerica #democracy.
AOC claps back at Justice Alito for saying Congress can’t have oversight of Supreme Court
#AOC #JusticeAlito #CongressOversight #SupremeCourt #ClapBack #Mastodon #Politics #News
#5yrsago UK #RailwayArches, the last bastion of publicly owned commercial space, engines of small business, about to be killed by privatization https://theconversation.com/britains-railway-arches-are-being-sold-off-and-small-businesses-could-be-forced-out-99907
#5yrsago They said #AOC’s message wouldn’t play in the midwest, now she and #Bernie are headed to #Kansas https://theintercept.com/2018/07/17/brent-welder-kansas-primary-3rd-district-ocasio-cortez-bernie-sanders/
#5yrsago China uses sewage surveillance to detect drugs in urine and feces https://www.nature.com/articles/d41586-018-05728-3
9/
Dems in array:
#AOC Ocasio-Cortez endorses #Biden's reelection campaign, sending a strong signal of Democratic unity (Michelle L. Price/Associated Press) #2024election