Jummit, to advent_of_code in 🎄 - 2023 DAY 1 SOLUTIONS -🎄

Trickier than expected! I ran into an issue with Lua patterns, so I had to revert to a more verbose solution, which I then used in Hare as well.

Lua:

lualua – SPDX-FileCopyrightText: 2023 Jummit – – SPDX-License-Identifier: GPL-3.0-or-later local sum = 0 for line in io.open(“1.input”):lines() do local a, b = line:match(“^.-(%d).*(%d).-$”) if not a then a = line:match(“%d+”) b = a end if a and b then sum = sum + tonumber(a…b) end end print(sum) local names = { [“one”] = 1, [“two”] = 2, [“three”] = 3, [“four”] = 4, [“five”] = 5, [“six”] = 6, [“seven”] = 7, [“eight”] = 8, [“nine”] = 9, [“1”] = 1, [“2”] = 2, [“3”] = 3, [“4”] = 4, [“5”] = 5, [“6”] = 6, [“7”] = 7, [“8”] = 8, [“9”] = 9, } sum = 0 for line in io.open(“1.input”):lines() do local firstPos = math.huge local first for name, num in pairs(names) do local left = line:find(name) if left and left < firstPos then firstPos = left first = num end end local last for i = #line, 1, -1 do for name, num in pairs(names) do local right = line:find(name, i) if right then last = num goto found end end end ::found:: sum = sum + tonumber(first * 10 + last) end print(sum)

Hare:

harehare // SPDX-FileCopyrightText: 2023 Jummit // // SPDX-License-Identifier: GPL-3.0-or-later use fmt; use types; use bufio; use strings; use io; use os; const numbers: [](str, int) = [ (“one”, 1), (“two”, 2), (“three”, 3), (“four”, 4), (“five”, 5), (“six”, 6), (“seven”, 7), (“eight”, 8), (“nine”, 9), (“1”, 1), (“2”, 2), (“3”, 3), (“4”, 4), (“5”, 5), (“6”, 6), (“7”, 7), (“8”, 8), (“9”, 9), ]; fn solve(start: size) void = { const file = os::open(“1.input”)!; defer io::close(file)!; const scan = bufio::newscanner(file, types::SIZE_MAX); let sum = 0; for (let i = 1u; true; i += 1) { const line = match (bufio::scan_line(&scan)!) { case io::EOF => break; case let line: const str => yield line; }; let first: (void | int) = void; let last: (void | int) = void; for (let i = 0z; i < len(line); i += 1) :found { for (let num = start; num < len(numbers); num += 1) { const start = strings::sub(line, i, strings::end); if (first is void && strings::hasprefix(start, numbers[num].0)) { first = numbers[num].1; }; const end = strings::sub(line, len(line) - 1 - i, strings::end); if (last is void && strings::hasprefix(end, numbers[num].0)) { last = numbers[num].1; }; if (first is int && last is int) { break :found; }; }; }; sum += first as int * 10 + last as int; }; fmt::printfln(“{}”, sum)!; }; export fn main() void = { solve(9); solve(0); };

caos, (edited ) to foss German

📲 Welches Custom ROM (mit MicroG) für das Pixel 5?

Ich soll für jemanden ein Pixel 5 flashen und einrichten. Die Person hat bislang ein anderes Gerät mit genutzt und eigentlich ist der Auftrag, auch auf dem Pixel /e/OS zu installieren.

Ich habe nun aber gesehen, dass das Pixel dafür einen Downgrade von Android 14 auf Android 13 braucht, daher bin ich nun am Überlegen, ob ich nicht doch ein anderes empfehlen soll.

Für das Pixel 5 kämen infrage:
­age­OS 21 (Android 14)
­est­OS 20.0 (Android 13)
/e/ t (Android 13)
­OS 14
(Android 13)

Da nur LineageOS und CalyxOS Android 14 für das Pixel 5 anbieten, tendiere ich momentan zu CalyxOS (mit dem ich aber noch keine Erfahrung habe).
Für mich persönlich würde ich ja DivestOS nehmen, aber das wäre doch vielleicht noch etwas weiter von eOS weg (und unterstützt nicht bzw. nur über Umwege). Es sollen auch einige Apps über Aurora installiert werden, die wohl bislang mit MicroG auf eOS gut laufen.
Einen besonders hohen Sicherheitsanspruch gibt es in dem Fall nicht; es soll auch kein Banking und keine Zahlungsdienste o.ä. drauf laufen (nur bspw. einige Spiele, die wohl microG erfordern)

  • Hat jemand von Euch Erfahrung sowohl mit eOS als auch mit CalyxOS und kann von den Unterschieden aus User-Perspektive berichten?
  • Kann man irgendeine Prognose treffen, welches ROM das Pixel 5 mehr oder weniger lang unterstützen wird?

@foss_de

kuketzblog, to Discord German
@kuketzblog@social.tchncs.de avatar

#Followerpower. Die Überarbeitung der Messenger-Matrix ist nun vollständig abgeschlossen. Über einen Tipp/Klick auf Teilen würde ich mich riesig freuen, damit sich die Messenger-Übersicht (weiter) verbreitet. ❤️ 👍

Deutsch: https://www.messenger-matrix.de/messenger-matrix.html
Englisch: https://www.messenger-matrix.de/messenger-matrix-en.html
FAQ: https://www.messenger-matrix.de/#faq
Mitarbeit: https://codeberg.org/kuketzblog/www.messenger-matrix.de

#messenger #briar #discord #matrix #element #imessage #jami #line #signal #simplex #siskin #telegram #threema #viber #whatsapp #wire

ncoca, to linux
@ncoca@social.coop avatar

Using #Linux #LinuxMint on my laptop, and so far, can run every single program I had on windows, either directly or via browser, except for one. #Line, the superapp you can't really escape if you live in #Japan (or #Taiwan, or #Thailand).

#opensource

ruffsl, to flashlight in [NBD] Convoy S2+ Copper Triple 519A 2700K
@ruffsl@programming.dev avatar

I think you need two spaces before a line break, or double carriage returns, before starting a bullet list. That’s the original markdown spec anyways. Other markdown flavors, like what GitHub uses are a little more forgiving with that but are then non standard.

kuketzblog, to Matrix German
@kuketzblog@social.tchncs.de avatar

ist gefragt. Nachdem großen Update der Messenger-Matrix habe ich noch den Line-Messenger ergänzt. Ich bitte alle mal einen prüfenden Blick auf die Matrix zu werfen - insbesondere auf jene Messenger, die ihr selbst benutzt. Sollten Angaben nicht stimmen bzw. überarbeitet werden, so meldet das bitte. Entweder hier oder über die Projektseite.

https://www.messenger-matrix.de/messenger-matrix.html


kuketzblog, to Matrix German
@kuketzblog@social.tchncs.de avatar

Liebe #Follower. Nach eurem Feedback zur Messenger-Matrix habe ich diese erneut überarbeitet. Es wäre schön, wenn ihr erneut euer Feedback hinterlassen könntet. (bitte keine Anfragen zur Bewertung/Aufnahme weiterer Messenger!).

https://www.messenger-matrix.de/messenger-matrix.html

#messenger #element #matrix #signal #simplex #telegram #line
#threema #viber #whatsapp #wire

arkadiusz, to analog
ncoca, to TikTok
@ncoca@social.coop avatar

I've dipped into the #TikTok debate, with a unique proposal. No ban, instead, mandate reciprocity.

Liberal democracies should restrict TikTok and other Chinese apps like #WeChat and #Weibo from accessing their digital markets until #China allows foreign platforms like #LINE, #Spotify, #Signal, and #Facebook equal and fair access to the Chinese #digital market.

Read my entire piece in The Diplomat 👇

https://thediplomat.com/2024/04/reciprocal-access-how-to-deal-with-tiktok-and-other-chinese-apps-fairly-and-democratically/

#tech #censorship #Japan #privacy

asahi95, to random

I have finally decided that I'll use #Matrix & #XMPP for those who are somewhat or is tech-literate (also with friends) and then use #WhatsApp & #LINE for family and tech-illiterate people 💬

JeanBaptisteEt4, to random French
@JeanBaptisteEt4@mathstodon.xyz avatar
arkadiusz, to analog
jonny, to random
@jonny@neuromatch.social avatar
techhelpkb, to linux
@techhelpkb@mastodon.social avatar

Using the Linux command line doesn't have to be the chore you think it is. Try these two tricks. https://tchlp.com/3r8kOfs

mlyon0486, to Flooring
@mlyon0486@pixelfed.social avatar
simevidas, (edited ) to random
@simevidas@mastodon.social avatar

“Always underline links” option new in @FirefoxNightly

Basically, it adds the following user agent style

:any-link {
text-decoration: underline !important;
}

which overrides text-decoration: none on all websites.

edit: Btw, I’m the one who requested this option 😁 https://bugzilla.mozilla.org/show_bug.cgi?id=1664278

simevidas,
@simevidas@mastodon.social avatar

@FirefoxNightly I wanted to know why the title links on Google search results pages don’t get underlined. Turns out, if the link has an inline-block child, that child is not underlined. This is true in all browsers.

Test page: https://jsbin.com/qebodif/edit?html,css,output

edit: Found the relevant spec text:

> Note that text decorations are not propagated to […] the contents of atomic inline-level descendants such as inline blocks https://drafts.csswg.org/css-text-decor/#line-decoration

thejapantimes, to business
@thejapantimes@mastodon.social avatar

SoftBank CEO Junichi Miyakawa has said that the telecommunications firm is in talks with South Korea's Naver over control of LY, which operates the Line app. https://www.japantimes.co.jp/business/2024/05/09/softbank-naver-line-ly/

thejapantimes, to Japan
@thejapantimes@mastodon.social avatar

After cyberattacks last year, Japanese regulators are discussing whether to force South Korean company Naver to divest its holdings in Line, moving control fully within Japan. https://www.japantimes.co.jp/commentary/2024/06/05/japan/line-superapp-diplomatic-dispute/

thejapantimes, to business
@thejapantimes@mastodon.social avatar

Japan's communications ministry has urged LY, operator of the Line messaging app, to strengthen its protection of users' personal data following a massive data breach last year. https://www.japantimes.co.jp/business/2024/03/05/companies/japan-line-operator-personal-info-leak/ #business #companies #line #ly #naver #personalinformation #hacking #cybersecurity

Skoop, to random
@Skoop@phpc.social avatar

Really looking forward to doing my Sustainable Open Source Contributions In Your Business talk at in Mannheim in April: https://sylius.com/sylius-days/#line-up

KarenKasparArt, to art
carlythaw, to art

Practicing carving in earnest. Testing out line work techniques I do with pen, and trying to translate to

I’m happy with it, it’s too busy and I need to practice the ink application more. But you can’t get better unless you start making stuff 🤷🏼‍♀️

image/png

codepo8, to random
@codepo8@toot.cafe avatar

Reminder that Shakespeare had a Yo Mama Joke:
Demetrius: "Villain, what hast thou ?"
Aaron: "That which thou canst not undo."
Chiron: "Thou hast undone our mother."
Aaron: "Villain, I have done thy mother."
https://www.folger.edu/explore/shakespeares-works/titus-andronicus/read/4/2/?q=Villain,%20I%20have%20done%20thy%20mother.#line-4.2.80

ncoca, to chinese
@ncoca@social.coop avatar

The idea of any democratic government essentially an app or platform for political reasons is deeply worrying $ hypocritical

Yet, I strongly freel something has to be done about TikTok, and its potential as a tool in state-led campaigns. But there's a more fundamental problem. Why should TikTok have access to the US, Japanese & European markets when platforms like , , & can't be used in China?

https://thediplomat.com/2024/04/reciprocal-access-how-to-deal-with-tiktok-and-other-chinese-apps-fairly-and-democratically/

thejapantimes, to business
@thejapantimes@mastodon.social avatar

South Korea's Naver said on Friday it is exploring various options including the potential sale of its stake in the company that controls LY, which operates the popular messaging app Line. https://www.japantimes.co.jp/business/2024/05/10/companies/naver-line-operator/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • GTA5RPClips
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • anitta
  • provamag3
  • Leos
  • cisconetworking
  • lostlight
  • All magazines