How do you actually write this? Do have all symbols mapped to your keyboard somehow or do you have a list with symbols and copy them one symbol at a time?
- 4 Posts
- 170 Comments
eta@feddit.orgto
Advent Of Code@programming.dev•What language are people using this year?English
1·1 day agoWhat’s the reason for building your own language?
Elixir
First I tried to manually assemble a list with the IDs and their amounts but then found out there is a built in function for that.
solution
#!/usr/bin/env elixir require Logger defmodule AOC do def part1(filename) do ids = File.read!(filename) |> String.trim() |> String.split("\n") |> Enum.map(fn x -> String.to_integer(x) end) |> Enum.frequencies() [p1, p2, p3 | _rest] = Enum.sort_by(ids, fn {_k,v} -> -v end) {p1, p2, p3} end def part2(filename) do ids = File.read!(filename) |> String.trim() |> String.split("\n") |> Enum.map(fn x -> String.to_integer(x) end) |> Enum.frequencies() [p1, p2, p3 | _rest] = Enum.sort_by(ids, fn {_k,v} -> v end) {p1, p2, p3} end end # module {p1, p2, p3} = AOC.part1("input/day01Test.txt") res = elem(p1,0)*elem(p2,0)*elem(p3,0) if res != 186276, do: raise "result should be 186276 but is #{res}" {p1, p2, p3} = AOC.part1("input/day01Input.txt") res = elem(p1,0)*elem(p2,0)*elem(p3,0) Logger.info("Part 1: #{res}") {p1, p2, p3} = AOC.part2("input/day01Test.txt") res = elem(p1,0)*elem(p2,0)*elem(p3,0) if res != 193050, do: raise "result should be 193050 but is #{res}" {p1, p2, p3} = AOC.part2("input/day01Input.txt") res = elem(p1,0)*elem(p2,0)*elem(p3,0) Logger.info("Part 2: #{res}")
eta@feddit.orgto
DACH - Deutschsprachige Community für Deutschland, Österreich, Schweiz@feddit.org•FDP kippt Brandmauer zur AfD bei AbstimmungenEnglish
61·2 days agoEcht? Also solange ich mich mit Politik beschäftige (gut was jetzt auch noch nicht so sehr lange ist) haben die sich wenn überhaupt nur für Unternehmensrechte eingesetzt. Vielleicht war das vor meiner Zeit anders.
eta@feddit.orgto
Formula 1@lemmy.world•Gary Anderson's verdict on first 2027 flip-flop F1 wingEnglish
2·3 days agoI wonder if with these with these mechanisms that rotate with a decreasing angle as described in the article you could slightly over rotate it so the airflow can attach and then turn it back a bit to get to the final position. And if this is possible would it be too complicated so the advantage of reduced rotation would no longer be useful?
For a project using Elixir on a Raspberry Pi I recently used Alpine instead of the default Raspberry OS because the package there was so old that it wasn’t compatible with a second PC I was developing the project on. It could have worked if I had set up a special distrobox with Debian or something that has the older version but honestly why do all that just for using software that’s years old. However now I have to run the project as root because apparently you can’t access the GPIO pins as a user on anything other than Raspberry OS so it’s not perfect but at least it works.
eta@feddit.orgto
Lemmy Shitpost@lemmy.world•Don't Question Anything. This Is The Future.English
2·5 days agoYeah, they go hand in hand to really express the message of how much he wants to help humanity with everything he does.
eta@feddit.orgto
Lemmy Shitpost@lemmy.world•Don't Question Anything. This Is The Future.English
24·5 days agoThat’s one of the fun things Elon likes to do at parties.
eta@feddit.orgto
Ask Lemmy@lemmy.world•What are the most important things Lemmy does better than Reddit ?English
60·5 days agoNot having one single person or entity in charge of everything.
eta@feddit.orgto
Lemmy Shitpost@lemmy.world•behold, the pinnacle of German software engineeringEnglish
6·9 days agoI drew one today
In Germany we say “beschissene Situation”
eta@feddit.orgto
Linux@programming.dev•Librem 5 second-gen $1599 RISC-V Linux phone - OMG! UbuntuEnglish
2·16 days agoWhat happened with that?
Asking AI in my experience is not always bad but you have to know at least a little about the subject for it to be helpful. If you just tell it “this doesn’t work, fix it” and leave out important information then it comes up with strange solutions.
eta@feddit.orgto
Ask Lemmy@lemmy.world•What differences have you seen between Reddit and Lemmy? Has anyone else had any experience with subreddit overreach (bots, biased filtering) and do you find Lemmy to be a productive alternative?English
5·26 days agoDefinitely this. I also avoid news about politics as much as I can and only specifically look at them when I feel like it.
looks a bit like a screenshot from Forza
What do you need help with? I recently set up an Alpine Linux system and was surprised how easy audio was. I just installed pipewire, pipewire-pulse and wireplumber, made sure they start when the system starts and added my user to the audio and video groups. I’m not an expert on Linux though, so I don’t know how it works on other systems.
eta@feddit.orgto
Linux@programming.dev•Why do you use a systemd-less distro (if you do)?English
2·1 month agoI’m not really that deep into it but I’m also using elogind and Alpine uses the newest Kernel so do your points still apply in that case?
eta@feddit.orgOPto
unixporn@lemmy.world•[Alpine Linux][River 0.5] Finally got a working setup. First time really going from bare installation to full desktop setup on my own.English
4·1 month agoThe screenshots are from different sessions. You just have to tell river which window manager to use when it starts up, either via init script or with “river -c <name_of_window_manager>”.
And yeah I found the font on the site of the news organization “The New Republic” and thought it looked cool and could fit the rest of this theme.





Elixir
I thought about this a bit and realised that modulo math could probably help with this repeating pattern. So I transformed the letters to numbers, like on a clock. For part 2 I just sorted the program in descending order, since you start at 0 (or rather 6) and want to go as far as possible for all the remaining instructions.
solution