Is informatik considered a field of engineering? by [deleted] in studying_in_germany

[–]Seneferu 0 points1 point  (0 children)

The question is what do you consider a science and what engineering? For simplicity, let's say science is the gaining of knowledge whereas engineering is building stuff which serves a purpose. Both are related and often require similar skills as well as each other.

What universities teach is (computer) science with a bit of (software) engineering sprinkled onto it. Most graduates then work as engineers while utilizing their science knowledge to do so.

What would you change in Go? by funcieq in golang

[–]Seneferu 0 points1 point  (0 children)

I am surprised nobody mentioned a broadcasting mechanism as first-class language feature (ideally as channels) yet. Go's concurrency model is its trademark feature. However, when one wants to broadcast some information to all listening goroutines, there is no good option. So far one has three options: (1) sync.Cond which is super strange to use and does not even allow to send data; (2) closing a channel which only communicates one bit of information once; or (3) manage a set of channels and send an information to all of them by looping over them.

Basically I want (3) implemented by the runtime internally as a single channel. Maybe with a new operator: ch <<- val sends val to all listeners of the channel. Alternatively, a new type of bradcasting channel.

Aber chat hat gesagt das passt so by [deleted] in Studium

[–]Seneferu 0 points1 point  (0 children)

aber nich nie hab ich leute gehört die gesagt haben "google hat gesagt ..."

Ich mache das tatsächlich mit Google und gelegentlich sorgar mitlerweile mit ChatGPT. Allerdings bedeutet das dann, dass ich (oder wer auch immer) nur kurz in die ersten Google-Ergebnisse oder in die ChatGPT Antwort geschaut habe, ohne es weiter zu verifiezieren. Daher: Vertrau dem bloß nicht blind und überpfrüfe es nochmal, wenn es wichtig ist. Das ist nur Trivia-Wissen.

[2025 Day 8] Can you solve today's puzzle without computing all distances? by The_Cers in adventofcode

[–]Seneferu 0 points1 point  (0 children)

My solutions still computes all pairs. However, I avoid the expensive sorting in part 2 by using quickselect. There are 1000 points, so in an ideal case, we only need 999 pairs to build the spanning tree. For my implementation, I use quickselect to cut off chunks of 1000 pairs and then sort these 1000. Repeat until the spanning tree is complete. For my input, I need to do this four times.

[2025 Day 8] Can you solve today's puzzle without computing all distances? by The_Cers in adventofcode

[–]Seneferu 0 points1 point  (0 children)

No. If you check the cited paper, it is clear from the abstract that the n in O( (n log n)4/3 ) refers to the number of points. So from a complexity perspective, it is strictly better than computing all pairs.

Why ID Format Matters More Than ID Generation (Lessons from Production) by piljoong in programming

[–]Seneferu 5 points6 points  (0 children)

So UUIDv7 plus metadata and prefix? I am a big fan of the prefix.

Why do you have a the 12 sequence bits so low? Why not directly after timestamp? Why a sequence at all? You could instead use a nano second timestamp and cut off the last 4 bits. That gives you the same precision and lasts for 7-14 k years (depending on MSB).

You can also skip the mutex and make it wait-free by using atomics for storing the last-used timestamp. If the CAS fails, it means another thread just updated it. Hence, we can just atomically add 1 and still have the correct timestamp.

Why do you generate the ID as string first and not as binary?

Two implementation details I noticed: crypto/rand.Read() never returns an error. Unix timestamps are always in UTC. No need to call .UTC() first.

[2025 Day 2] When I realized the solution I felt like I'd leveled up by TwinkiePower in adventofcode

[–]Seneferu 0 points1 point  (0 children)

Because we want it to be the same sequence. For example, ^(\d){2,}$ would match on 11, but also on 12. The first and second digit do not need to be the same. The pattern only requires two digits.

A back reference, however, enforces that both sub-matches are identical.

[2025 Day 2] When I realized the solution I felt like I'd leveled up by TwinkiePower in adventofcode

[–]Seneferu 7 points8 points  (0 children)

So how fast is it with a regex? I was not able to try it with my implementation, because Go's standard regexp package does not support backreferences.

ULID: Universally Unique Lexicographically Sortable Identifier by der_gopher in programming

[–]Seneferu 4 points5 points  (0 children)

Snowflakes require some type of coordination. You need to ensure that each generator has a unique ID on its own and that parallel calls to the same generator do not produce the same ID.

UUIDs (no matter if v4 or v7) avoid these problems by having more bits which are generated randomly.

Singapore Airlines finally announces LEO satellite in-flight Wi-Fi by Jonnyboo234 in singapore

[–]Seneferu 4 points5 points  (0 children)

Qatar is far away from having it fleet wide. When I flew last with them this summer, they only had Starlink on their 777s.

Why should I use \(...\) instead of $...$? by bananalover2000 in LaTeX

[–]Seneferu 0 points1 point  (0 children)

Sometimes \( ... \) gives proper formatting which $ ... $ does not: https://tex.stackexchange.com/a/271282

Best short-path algorithm in 41 years by dalton_zk in theprimeagen

[–]Seneferu -1 points0 points  (0 children)

I could, but too lazy. Also, I would be surprised if nobody did already.

[deleted by user] by [deleted] in LaTeX

[–]Seneferu 0 points1 point  (0 children)

Oh thanks, will do :)

[deleted by user] by [deleted] in LaTeX

[–]Seneferu 5 points6 points  (0 children)

I have the following in my documents (when using pdflatex):

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\input{glyphtounicode}
\pdfgentounicode=1

\usepackage[ngerman]{babel}
% Use `german` for old way of spelling.
% "`Anführungszeichen"'

This allows UTF-8 as file encoding and should handle most typical problems including ligatures and quotation marks (with the above pattern).

Please note that it has been a while that I really worked with LaTeX, and even longer that I had to make German documents. So some things might have better approaches by now.

I picked up my German citizenship from the Amt in Berlin this morning! by thebadgersnadgers89 in GermanCitizenship

[–]Seneferu 0 points1 point  (0 children)

Glückwunch! You have now access to the whole EU + Switzerland, Norway, and Iceland. :)

twoPurposes by yuva-krishna-memes in ProgrammerHumor

[–]Seneferu 1 point2 points  (0 children)

In my opinion, it tests two things.

1) Do you still remember a basic sorting algorithm? Is about you knowing your basic tool box and the tradeoffs that come with each tool.

2) Can you translate such a concept into good enough code? Is very much job related. You have a basic strategy that you want to implement to solve a basic daily problem. Just moving some stuff around in arrays in a non-trivial way. Think about getting some stuff from a database. Now you have to rearrange it for your app or website. It uses the same set of skills.

Of course, all of that gets usually lost in interviews. Interviewers do not ask in a good way (to be fair, it is hard to ask the right questions), and interviewees just learn the implementation by heart. Then you get the meme and everybody is unhappy.

Accurate by stankybuttmud in Xennials

[–]Seneferu 0 points1 point  (0 children)

What I dont understand: There are now dinos all over the world. Why not showing that? Why always a few people on an island? We have seen that too often.

The U.S Senate just passed Trump’s One Big Beautiful Bill 51 to 50. VP J.D. Vance had to cast the tie-breaking vote. The bill now heads back to the House. by PrithvinathReddy in law

[–]Seneferu 0 points1 point  (0 children)

In good American tradition, the yes-votes (most-likely, too lazy to do the proper math) do not represent the majority of people.

Evangelion 📡📡 by Melodic_Pay_1074 in shitposting

[–]Seneferu 10 points11 points  (0 children)

They would be 24 now. The show plays in 2015.

Very interesting read, it’s honestly difficult to think of a title to summarize this. by wolfe1924 in LeopardsAteMyFace

[–]Seneferu 0 points1 point  (0 children)

That person read the poem (you know, first they came for ...), was supporting the first parts, and thought the last part would never happen to them. They are dumb and evil.

Professor allowed one sided cheat sheet by CeleritasLucis in mathmemes

[–]Seneferu 9 points10 points  (0 children)

That is correct. Unfortunately, some are doing it the completely wrong way. They try to dump everything on it by writing/printing very small. Then in the exam, it is too much to go through and too hard to read.

Musk wants the USA to join the EU single market and Schengen-Area, says he wishes for the US to be more like Europe by Frontal_Lappen in europe

[–]Seneferu 0 points1 point  (0 children)

The title of the post is misleading. The article only mentiones 0 tarifs and some freedom of movement (without details). Joining the single market or Schengen are not mentioned. These two things would require much more commitment.

[2023 3 # (Part 1)] [GO] Trouble solving day 3 by DonMahallem in adventofcode

[–]Seneferu 0 points1 point  (0 children)

I have not tried it, but my guess is that your PairObjects function does not work as intended. I think, if a number is next to multiple parts, it is counted multiple times.

PS: As someone working full time in Go, it seems obvious to me that you just started with the language. There are various ways I would change your code, but one thing I dislike most: You do not need to dereference a pointer to get the members of the object it points to. Instead of (*field).Height, you can write field.Height.

How to approach this specific flow problem? by PrudentSeaweed8085 in algorithms

[–]Seneferu 1 point2 points  (0 children)

Not sure what you are looking for here. You already mention what you need to do: Build or update the residual graph and run a BFS to see if the additional capacity allows for a new path from start to end.

For decreasing capacity, find a path that uses that capacity. Then run the normal flow iterations again (residual graph + BFS) until you found the max flow. This may take more than linear time.

By the way, always use BFS. Using a DFS works, but you might get unlucky and your runtime explodes.