kari's recent activity
-
Comment on Day 2: Fulminating Farmland in ~comp.advent_of_code
-
Comment on Day 1: Dusty Shed in ~comp.advent_of_code
kari LinkPretty short but, because I love to learn a new language for AoC, took me a bit to get started. Gleam seems fun so far :) Both parts import gleam/dict.{type Dict} import gleam/int import...Pretty short but, because I love to learn a new language for AoC, took me a bit to get started. Gleam seems fun so far :)
Both parts
import gleam/dict.{type Dict} import gleam/int import gleam/list import gleam/order.{type Order} import gleam/string fn counts(input: String) -> Dict(Int, Int) { let assert Ok(ids) = input |> string.split("\n") |> list.map(string.trim) |> list.filter(fn(line) { !string.is_empty(line) }) |> list.try_map(int.parse) ids |> list.fold(dict.new(), fn(counts, id) { let count = case dict.get(counts, id) { Ok(n) -> n + 1 _ -> 1 } dict.insert(counts, id, count) }) } fn top_three_product( input: String, compare_counts: fn(Int, Int) -> Order, ) -> Int { counts(input) |> dict.to_list() |> list.sort(by: fn(a, b) { let #(_, count_a) = a let #(_, count_b) = b compare_counts(count_a, count_b) }) |> list.take(3) |> list.map(fn(pair) { let #(id, _count) = pair id }) |> list.fold(1, int.multiply) } /// Takes a list of line-separated container-ID numbers. /// Returns the product of the three most-common IDs. pub fn part1(input: String) -> Int { top_three_product(input, fn(a, b) { int.compare(b, a) }) } /// Takes a list of line-separated container-ID numbers. /// Returns the product of the three least-common IDs. pub fn part2(input: String) -> Int { top_three_product(input, fn(a, b) { int.compare(a, b) }) }I'm not 100% sure how idiomatic it is but I tried to be functional?
-
Comment on US Federal Aviation Administration issues nationwide ground stop for all flights citing "due to extraordinary circumstances and for reasons of safety" in ~transport
kari Link ParentHey, I watched it too! It was actually the first time I'd ever seen it.Hey, I watched it too! It was actually the first time I'd ever seen it.
-
Comment on US Federal Aviation Administration issues nationwide ground stop for all flights citing "due to extraordinary circumstances and for reasons of safety" in ~transport
kari LinkWell @unkz link to topic about the FAA phasing out floppies An ATC I follow on Instagram told me it's expected to be at least 4 hours.Well @unkz link to topic about the FAA phasing out floppies
An ATC I follow on Instagram told me it's expected to be at least 4 hours.
-
Comment on What programming/technical projects have you been working on? in ~comp
kari LinkI spent a bit of time working on my window manager for the first time in a while to update it for Zig 0.17 and fix a few bugs. I also learned about the Idris language and I'm tempted to try create...I spent a bit of time working on my window manager for the first time in a while to update it for Zig 0.17 and fix a few bugs. I also learned about the Idris language and I'm tempted to try create a River tinyrwm with some weird Wayland bindings for Idris as a way of learning.
-
Comment on How often do you talk to strangers? And do you have a preference for the stranger’s gender? in ~life
kari LinkI personally don't start up conversations but for whatever reason it feels like people will talk to me, and I always enjoy chatting back.I personally don't start up conversations but for whatever reason it feels like people will talk to me, and I always enjoy chatting back.
-
Comment on Tesla to wind down Cybertruck production in Texas next year in ~transport
kari Link ParentYeah sorry I was mostly agreeing just saying it does sound skewed is allYeah sorry I was mostly agreeing just saying it does sound skewed is all
-
Comment on Tesla to wind down Cybertruck production in Texas next year in ~transport
kari Link ParentWhile I'm assuming you're right overall, it does seen like it's probably skewed some considering here, where it's definitely skewed the other way, I almost never see Rivians.Decent number of Rivians (skewed by being in central IL). Cybertrucks did not compete successfully.
While I'm assuming you're right overall, it does seen like it's probably skewed some considering here, where it's definitely skewed the other way, I almost never see Rivians.
-
Comment on US Federal Aviation Administration says it will phase out floppy disks from air traffic control by 2028 in ~tech
kari Link ParentIf it makes you feel better, I personally wouldn't worry much about that specific situation. There are tons of untowered airports in the world and, while they're usually not seeing commercial...This makes me afraid that now every airport in the country is going to shut down catastrophically all at once.
If it makes you feel better, I personally wouldn't worry much about that specific situation. There are tons of untowered airports in the world and, while they're usually not seeing commercial service, pilots will have flown in/out of them during various stages of getting their license(s) and ratings. In other words, there are standard procedures for operating in uncontrolled airspace.
Idk, besides the fact that it would effectively shutdown our airspace for who knows how long, I wouldn't be too worried about the safety aspect (though, obviously, it's not great, just it could be a lot worse).
-
Comment on Details for the Motorola Signature 27 with GrapheneOS support in ~tech
kari LinkSeems cool and I probably would've liked one even with the price tag if I hadn't just bought a phone in August. I was trying to wait for this, but my iPhone broke (mostly my fault, had to get the...Seems cool and I probably would've liked one even with the price tag if I hadn't just bought a phone in August. I was trying to wait for this, but my iPhone broke (mostly my fault, had to get the battery replaced last year and then I took it to a water park and it got wet, I guess the battery replacement destroyed the water proofing, but I digress) back in August so I just went ahead and got a Pixel 10 Pro for Graphene. I will say, I'm loving Graphene a lot and the Pixel 10 Pro feels amazing in my hands and with the case I have on it.
-
Comment on Tesla to wind down Cybertruck production in Texas next year in ~transport
kari LinkI'm honestly a little surprised considering how many of these I see around Austin, but maybe it's just the fact that they're made here and we've got so many tech bros.I'm honestly a little surprised considering how many of these I see around Austin, but maybe it's just the fact that they're made here and we've got so many tech bros.
-
Comment on 2026 United States midterm elections megathread in ~society
kari Link ParentHere in Texas, a bunch of the attack ads against Hinajosa were saying how she wants a state income tax... which we already banned in our constitution a couple years ago... Regardless, I'm glad...We already had a law requiring it (I had to show my ID at the poll), why does it also need to be in the constitution.
Here in Texas, a bunch of the attack ads against Hinajosa were saying how she wants a state income tax... which we already banned in our constitution a couple years ago...
Regardless, I'm glad y'all also had good results for the most part :)
-
Comment on 2026 United States midterm elections megathread in ~society
kari Link ParentI think this is the big thing. I saw some people shitting on Florida, for example, but even the races that progressive Democrats lost were much closer than they had any right to be and are a good...Callie Barr came within shouting distance of winning where there's usually a 70% Republican electorate.
I think this is the big thing. I saw some people shitting on Florida, for example, but even the races that progressive Democrats lost were much closer than they had any right to be and are a good sign, I think.
-
Comment on 2026 United States midterm elections megathread in ~society
kari LinkI'm genuinely still in shock that we're about to have a blue Texas in my lifetime. The fact that Collin, Tarrant, and Williamson counties all voted blue is insane. I'm still going to ride the high...I'm genuinely still in shock that we're about to have a blue Texas in my lifetime. The fact that Collin, Tarrant, and Williamson counties all voted blue is insane. I'm still going to ride the high for a few days, but come January, there are absolutely no excuses left. If Trump doesn't need to get his veto pen ready, I worry for 2028, but for now, I'm ecstatic.
-
Comment on Setting up own email FQDN (and maybe service?) in ~tech
kari Link ParentYou absolutely can reply from any email address with Mailbox, at least. I'm admittedly too lazy to send a redacted screenshot of this, but I just emailed myself from...but you can't reply from these made up addresses.
You absolutely can reply from any email address with Mailbox, at least. I'm admittedly too lazy to send a redacted screenshot of this, but I just emailed myself from
rodrigofromtildes@<mydomain>.emailand it went through fine even to my gmail account that I still keep around. Now, depending on the email client you're using, it can be a pain to set that up, but Thunderbird on desktop you can just do "customize from address" and it's super easy. Regardless, I've forgotten to do that a few times and never had issues with companies getting annoyed/confused at me replying from a different address than the one they sent to. -
Comment on 2026 United States midterm elections megathread in ~society
-
Comment on 2026 United States midterm elections megathread in ~society
-
Comment on 2026 United States midterm elections megathread in ~society
kari Link ParentAh, still neat. Hadn't heard of things like that. I think here, the positions are by district or at-large, but for at-large ones, you still have to run/vote for the specific place.Ah, still neat. Hadn't heard of things like that. I think here, the positions are by district or at-large, but for at-large ones, you still have to run/vote for the specific place.
-
Comment on 2026 United States midterm elections megathread in ~society
kari Link ParentI had 64! Probably a similar percentage were uncontested.I was [...] had 35 things to vote on
I had 64! Probably a similar percentage were uncontested.
-
Comment on 2026 United States midterm elections megathread in ~society
kari Link ParentRanked-choice voting? Must be nice. Signed, A voter in a state where anything aside from first-past-the-post is literally illegal :(or have "select up to 3"
Ranked-choice voting? Must be nice.
Signed,
A voter in a state where anything aside from first-past-the-post is literally illegal :(
I'm still working on part 2 but figured I'd share my part 1:Both parts in Gleam!
Part 1
It doesn't feel super idiomatic maybe? I dunno, functional programming is fun but I think I don't do it enough so I always make unreadable code lol.
Part 2
consume_sorted()is actually a noop right now because I got kinda stuck with looping in gleam :P butttt I realized if I just get the counts of the waypoints it's trivial to do the rest.e.g.
[#(0, 2), #(2, 2), #(4, 2)]from one of the examples (where 0 is "r", 1 is "o", etc. and the second value is the count of that waypoint in the program), we can do 26 because we start at r so that's the longest, then the next longest is to 4 so 26+4 and we've got[#(2, 2), #(4, 1]left, so 26+4+16 then repeat for the 2 26+4+16+4+1*6. Works the same for the large input so I just did that in a calculator and got the answer. I still can't wrap my head around how to implement the algorithm without loops! Not used to this stuff.I actually didn't even finish my program for part 2 because I'm so bad at gleam but I figured out it's pretty easy to get the answer (more in the details).