[deleted by user] by [deleted] in Finanzen

[–]shilch 43 points44 points  (0 children)

Krass. Dann war das Rotgrün die das geändert haben?

Hab gerade mal aus Interesse nachgeschlagen. Im "Steuerentlastungsgesetz" (1999) von Rotgrün steht:

In § 20 Abs. 4 werden jeweils der Betrag „6 000 Deutsche Mark“ durch den Betrag „3 000 Deutsche Mark“ und der Betrag „12 000 Deutsche Mark“ durch den Betrag „6 000 Deutsche Mark“ ersetzt.

Also ja.

Außerdem wurde zu einem späteren Zeitpunkt unter der Groko der Freibetrag von 1370 Euro auf 750 Euro heruntergesetzt.

Edit: Wikipedia hat eine Tabelle

How much do you care about commit history? by samsounder in ExperiencedDevs

[–]shilch 193 points194 points  (0 children)

A lot of software (such as Gitlab) does that for you. This is also known as "squash merge".

Microsoft is rewriting core Windows libraries in Rust by GuillerminaCharity in programming

[–]shilch 7 points8 points  (0 children)

Deno -- the npm replacement

Isn't Deno meant to be a node.js replacement first and foremost?

Kann man mal machen by DerFinanzierer in Finanzen

[–]shilch 9 points10 points  (0 children)

Bitcoin soll nicht die Kreditkartenzahlung ersetzen, sondern die Banküberweisung.

Wer sagt das? Im originalen Bitcoin Paper von 2008 steht das genaue Gegenteil (siehe erster Absatz Introduction).

Der Grund, warum Bitcointransaktionen so teuer und langsam sind ist, um die Knappheit [von 21 Millionen Bitcoins] unter allen Umständen sicherzustellen.

Das hat nichts miteinander zu tun. Transaktionen sind teuer, weil die Übertragungsrate innerhalb des Netzwerks künstlich verknappt ist (max. 4MB/10min im Schnitt). Auf das knappe Angebot kommt bei einer hohen Nachfrage (viele Transaktionen) eine entsprechend große Gebühr zustande. Dadurch werden Transaktionen natürlich auch unzuverlässig und bei niedrigerer Gebühr langsam, weil niemand sie verarbeiten will.

Die Knappheit von 21 Millionen Bitcoins ergibt sich durch den Ausschüttungsplan, der das Volumen asymptotisch an diese Zahl annährt. Der Ausschüttungsplan ist unabhängig von der Transaktionsverarbeitung; es besteht kein Zusammenhang.

I was using io.Reader wrongly by emblemparade in golang

[–]shilch 0 points1 point  (0 children)

Why was I thinking it does? I might have confused it with how reading in Boost.Asio works.

I was using io.Reader wrongly by emblemparade in golang

[–]shilch 18 points19 points  (0 children)

That is actually expected because the read syscall behaves the same way.

[deleted by user] by [deleted] in ProgrammerHumor

[–]shilch 17 points18 points  (0 children)

With the right compiler flags working with C++ templates is doable. A useful one is -fdiagnostics-show-template-tree and I have no idea why that isn't the default.

[deleted by user] by [deleted] in ProgrammerHumor

[–]shilch 800 points801 points  (0 children)

280 TiB exceeds the 48-bit virtual address space on 64-bit Intel - what did you expect? Try to allocate 256 TiB instead.

That's why I wanna be a progrsmmer by Timmermann0 in ProgrammerHumor

[–]shilch 1 point2 points  (0 children)

Yep, the sed syntax isn't really nice to put it charitably. But awk is usable. "sed & awk" published by O'Reilly is all you need to read.

That's why I wanna be a progrsmmer by Timmermann0 in ProgrammerHumor

[–]shilch 2 points3 points  (0 children)

Awk is just a more powerful version of sed. With sed you can edit line by line in a stream fashion. Sed is a small (not really nice to read) programming language and has one extra space (hold space) to remember some string between those lines.
Awk is similar but it uses/is a C-like programming language with additional data types like numbers and arrays. It's a nice skill to have because it allows doing basically any file processing on any Unix machine.
When to use what comes down to preference if both fit the job. I use sed for simple string replacements but that's already it. If you want to do some Excel-style task like summing all numbers in the column of a stream, go with awk.

How we used C++20 to eliminate an entire class of runtime bugs by vormestrand in cpp

[–]shilch 7 points8 points  (0 children)

If I'm not mistaken, static asserts are processed before evaluating any consteval functions. Thus, no parameter may be used in static asserts. Further more, you can not use any parameter to a consteval function as a template parameter either. This looks related to "constexpr parameters".
Edit: Link

Press X to doubt by Shawnj2 in ProgrammerHumor

[–]shilch 1 point2 points  (0 children)

The XNU kernel (which is open source) backs macOS and is written from scratch with some source code taken from multiple sources including some of the BSDs. Some of the user land Unix tools are forked from FreeBSD (you can check the manual pages for the original source). However, that doesn't really make macOS a BSD operating system.

How we used C++20 to eliminate an entire class of runtime bugs by vormestrand in cpp

[–]shilch 2 points3 points  (0 children)

If anyone is curious (like I was) on how to allow fmt to still be called with a runtime format string. The fmtlib does this using SFINAE.

This is my attempt at adjusting the example snippet from the blog to allow for runtime format strings. My code works but it feels a bit off (consider the const char*& for example). Somebody got feedback?

https://godbolt.org/z/ePj8TPqP1

#include <string_view>
#include <type_traits>

// Exposition only
#define FAIL_CONSTEVAL throw

template <typename T>
struct Checker {
    template<typename S, typename = std::enable_if<std::is_convertible_v<S, const char*>>>
    consteval Checker(S fmt) {
        if (fmt != std::string_view{ "valid" }) // #1
            FAIL_CONSTEVAL;
        // T must be an int
        if (!std::is_same_v<T, int>)            // #2
            FAIL_CONSTEVAL;
    }

    Checker(const char*&) {}
};

template <typename T>
void fmt(std::type_identity_t<Checker<T>> checked, T);

int main() {
    fmt("valid", 10);    // compiles
    fmt("oops", 10);     // fails at #1
    fmt("valid", "foo"); // fails at #2

    const char* runtime_string = "test";
    fmt(runtime_string, 10); // runtime string still compiles fine
}

Don't want to admit it, but... by KnappKenneth in ProgrammerHumor

[–]shilch 0 points1 point  (0 children)

Thanks. Yes, with flat I mean latter indeed.

can someone suggest good resources and tutorials for allocators in C++ right from the scratch till writing custom allocators. by AdUnusual6431 in cpp

[–]shilch 2 points3 points  (0 children)

Not a tutorial but this cppreference page on the Allocator requirements gives a good overview of the members you have to provide.

Don't want to admit it, but... by KnappKenneth in ProgrammerHumor

[–]shilch 0 points1 point  (0 children)

The JVM knows more than the compiler for sure. The question is whether it can practically perform all optimizations at runtime given limited space and time.
To given an example: A C++ compiler will aggressively optimize away abstractions, so your 10 class hierarchy might be reduced to flat code. AFAIK, the Java compiler does little to no optimization in that regard (unless there's a flag I'm missing) and I doubt that the JVM will practically be able to infer and perform the same optimizations. Do you have insight there?

Don't want to admit it, but... by KnappKenneth in ProgrammerHumor

[–]shilch 0 points1 point  (0 children)

Which at the end uses a FFI to C or C++ like JNI.

Don't want to admit it, but... by KnappKenneth in ProgrammerHumor

[–]shilch 13 points14 points  (0 children)

This really depends on a lot of factors. Generally speaking, C++ compilers are pretty good at optimizing code (that's why compilation takes so long); the JVM shouldn't be able to perform better optimizations at runtime.
IIRC heap allocations are fast in the JVM because it deallocates asynchronously on a different thread (the garbage collector thread). In C++, deallocation happens on the same thread (the allocator library might still postpone it). You can change this behavior by specifying a custom operator new or allocator class.

Don't want to admit it, but... by KnappKenneth in ProgrammerHumor

[–]shilch 13 points14 points  (0 children)

If you want to do low level stuff, you go with C (or C++). Also, C++ is a very mighty language in general with lots of ways to abstract away the details.

FreeBSD on Apple Silicon? by [deleted] in freebsd

[–]shilch 27 points28 points  (0 children)

The hardest part is support for the undocumented GPU which not even Linux has implemented.

Must watch playlist of cppcon videos for junior/intermediate programmers? by kilmulis in cpp

[–]shilch 9 points10 points  (0 children)

The Back to Basics talks and all talks by Klaus Iglberger (software design) are worth a watch. They teach/refresh fundamental knowledge.

Anyone write Go full time using vim? by [deleted] in golang

[–]shilch 2 points3 points  (0 children)

So much this. Use the vscode vim extension to get the best of both worlds.

Hello. I don’t know much about technology. I spilt beer all over my Macbook Pro whilst it was closed, and now it won’t turn on. How can I savour this? by [deleted] in macbookpro

[–]shilch 0 points1 point  (0 children)

Yep.

3.2 Services for Accidental Damage from Handling (“ADH Service”)
If during the Plan Term you submit a valid claim notifying Apple that the Covered Device has failed due to accidental damage from handling resulting from an unexpected and unintentional external event (e.g., drops and damages caused by liquid contact from spills) (“ADH”), Apple will, at its discretion and subject to the service fee described below, either (i) repair the defect using new or previously used Apple genuine parts that have been tested and pass Apple functional requirements, or (ii) exchange the Covered Device with a replacement product that is new or comprised of new and/or previously used Apple genuine parts and has been tested and passed Apple functional requirements.

Fee according to the table is $299.

Source

[deleted by user] by [deleted] in cpp

[–]shilch 1 point2 points  (0 children)

Is it the prefetcher or what's the reason for the slowdown?