• 0 Posts
  • 45 Comments
Joined 2 years ago
cake
Cake day: June 21st, 2023

help-circle

  • I would argue that in your application, a wrong URL is a sever error. That error being improper handling of a client error.

    I’m not a web dev, but had a similar problem with a niche compiler I used to develop.

    We were pretty good at validating invariants at the mid and back-end. This meant that most user errors got reported as internal errors. Generally, these errors were good enough that users were able to get used to reading them and fix their code.

    It was next to impossible to actually get users to file bugs about this. Our internal error messages started with a banner that read “THIS IS A BUG IN <compiler name>. PLEASE REPORT TO <support email address>”. Despite that, whenever we actually got a bug report, it would inevitably start with “I’m pretty sure this isn’t actually a bug in the compiler, but I can’t figure out what I am doing wrong in my code”.


  • Under current law, you would need to kill 22 people before replacements can be appointed. Possibly less if some of them are not constitutionally eligible to be president; but if it ever got to that point, I suspect we would ignore that provision.

    Pulling this off is made even more difficult by both the heightened security given to everyone in the line of succession; and the fact that under our continuity of government plans, those people are deliberately never all in the same place at the same time.

    Anything that could accomplish a full decapitation strike would likely require marshall law anyway, and would likely make the conditions for an election difficult.



  • If you are running an AC, you might be able modify it to reduce the humidity.

    AC units naturally dehumidify (as TC points out, they are essentially the same thing as traditional dehumidifiers). However, the amount of moisture they pull out is mostly related to how long they are running, not how cold they can get. This means that if you have an overpowered AC, you get less dehumidifying effect because the AC is on less.

    Some ACs let you reduce their power, which will increase their duty cycle and increase the amount of water they pull out of the air. It also helps improve their lifespan as they need to cycle less.



  • “Calories” is actually two different things. The first thing is a unit of energy. In this sense, calories are very much interchangeable. Wood has calories, which is why we use it for fire. However, if you tried eating wood, you would mostly just be increasing the caloric value of your poop. This is not inherent to wood; if you were a termite and tried eating wood, you would actually get nutritionally relevant calories from it.

    For nutritional purposes, we generally use some variant of the Atwater system. The core idea was to measure the caloric value of food, as well as the caloric value of the subjects feces and urine. This gives you a better estimate of how many nutritionally relevant calories there are.

    Nowadays, we have standard values various core food components (e.g various fats, proteins, etc). By breaking down a food into its components, we can apply the standard conversion for each component and add up the results to get a value for the food as a whole.

    This process is actually pretty bad. The digestibility of individual components does not perfectly predict the digestibility of a whole food. The measure of individual components is not perfect. The actual digestibility of some foods can vary significantly between people.

    As a practical matter, “counting calories”, really just means eating less in a way that roughly measures food by effective energy content. It turns out that an accurate accounting of calories just isn’t super important or useful for this. There is even bigger variance in the “calories out” department (including the annoying tendency of bodies to become more energy efficient when less energy is available). Further, all of the errors in calorie counting tend to be consistent. If you reduce calories by reducing the quantity of food you eat, you are reducing actual metabolized calories, even in the exact measurement is wrong.

    It is a little more complicated if you reduce calories by changing the composition of the food you eat, but broadly speaking lower reported calories are actually lower effective calories there as well. Further, if you are adjusting the composition of your food specifically enough for this to be a problem, then you are well past the point where you should be caring about other nutritional factors.


  • How do you get the folder?

    The trick with initramfs and initrd is that the kernel does not read them into memory. By the time the kernel boots, they are already in memory. This let’s you move a lot of initializing logic out of the kernel and into userspace. In some sense, this just moves the problem to the bootloader. But the bootloader already has to load the kernel, so that is no real loss.

    This is also incredibly useful for stateless VMs. You do not need to futz around with virtual drives. Just put everything you need into a CPIO archive, then pass that and and your kernel into QEMU (or your emulator of choice) and it will just work.


  • Where in those axioms does it say that ↑ = 0 = 0 {0 0 } is not a number? No where, that’s where!

    The actual reason that ↑ is simply that it is too ill behaved. The stuff I thought were the “numbers” of combinatorical game are actually just called Conway games. Conway numbers are defined very almost identically to Conway games, but with an added constraint that makes them a much better behaved subset of Conway games.

    I suppose you could call this an axiom of combinatorical game theory; but at that point you are essentially just calling every definition an axiom.

    <s> Getting back to my original point; this distinction just goes to show how small minded mathematicians are! Under Conway’s supposed “reasonable” definition of a number, nimbers are merely games, not proper numbers. However, the nimbers are a perfectly good infinite field of characteristic 2. You can’t seriously expect me to believe that those are not numbers! </s>


  • I was going to make a comment about surreal numbers not being numbers. But I did a bit of fact checking and it looks like all of the values I was objecting to are not considered surreal numbers, but rather pseudo numbers.

    I find this outrageous. Why can’t ↑ be a number? What even is a number that would exclude it and leave in all of your so-called numbers?


  • My big complaint with Wayland is that the ecosystem has not really developed an effective standardization process.

    With web browsers, you would get browsers doing their own thing; then copying each other’s thing, then writing down a standard for that thing, then all switch to the standard.

    With Wayland, you get: https://wayland.app/protocols/ For as old as Wayland is, there are 5 standard protocol extensions (plus some updates to the core protocol). A bunch sitting in the standardization pipeline. Then a whole bunch of redundant protocols because each compositor is just doing their own thing without even attempting to standardize.

    It doesn’t help that one of the major compositor (Gnome/Mutter) has essentially abandoned Wayland for everything beyond the core capabilities in favor of offering additional functionality over a separate DBus interface.



  • If you are building a static system, SELinux is amazing. You need a few lines of policy per application to label things appropriately, then you can see what accesses programs made and decide if you want to allow them or not.

    Taking a full Linux system and adding a locked down SELinux policy can be done in less than a week. If you are starting with an SELinux enabled system and just want to lock down your application, it can be done in less than a day.

    Once you know what you are doing, there is also a pretty powerful policy analysis tool that lets you see what a given domain can do; including transitive things like “domain sandbox_t can launch a program in Domain vim_t, which can write a file in Domain sshd_config_t, which can be read by domain sshd_t” which may indicate that your sandbox has a hole allowing it to compromise your sshd configuration. Although, to be fair, doing this level of analysis is not simple, even with the tooling. And you very quickly notice issues that are inherent in how Linux works.

    The problem with SELinux comes when you try applying it to general purpose systems, because you do not know ahead of time what the user will want to do. To be effective, policy needs to be written for the specific system it will be running on.

    An example I like to use is Android. Android makes great use of SELinux, and is a general purpose system. But the SELinux policy itself does not protect the general purpose Android system. It protects the special purpose system that is the Android runtime. All apps run with the same policy that says things like “cannot access the filesystem at all, unless given access by the Android runtime”, then the actual security policy users see is all implemented in use space by Android. SElinux is just a means of preventing apps from bypassing the Android permission system.


  • Also, AppArmor might not exist without SELinux.

    When the NSA first implemented SELinux, they did so directly, but were not able to get that merged into mainline because there was concern that SELinux was not the correct solution.

    What they ended up doing was creating the Linux Security Modules (LSM) framework, which is just a bunch of hooks in the kernel that a module can implement. SELinux was then rewritten as LSM module. This allowed other solutions like AppArmor to be implemented without any invasive work; they could just plug into the same system SELinux used.

    Some time later, the ability to run multiple LSMs at once was added.

    Incidentally, Linux capabilities are also implemented as an LSM.


  • A typical employee would have taxes taken out of every paycheck. Employers calculate that assuming they are your only source of income and you have nothing interesting going on tax wise, which is correct for 90% of people. Employees can ask for their income tax withholding to be changed and employers will do so no questions asked [1]. At the end of the year, you’re employer will give you a form W2 that says how much they payed you, how much they paid in taxes on your behalf, how much they payed into your tax deductible account on your behalf, etc. Basically everything about your job that is tax relevant. A copy of this W2 form is sent to the IRS.

    If you have investment accounts, work as an independent contractor, or various other forms of income, you will generally be given a form 1099. Again, a copy of this will be sent to the IRS. Income tax is not automatically withheld from these, so if you get a lot of income through them, you may owe taxes at the end of the year.

    You may also qualify for tax deductions that lower your effective income for the purposes of computing your income tax. For instance, the interest on you mortgage, charitable donations, etc. However if you choose not to claim these, you can instead claim a deduction of about $14,000; which is more than most people would be able to deduct anyway, so there often isn’t a point of keeping track of these.

    There are a couple of less common situations that you may need to deal with

    1. You can deduct significantly more than the standard deduction, so actually need to keep track of all of your possible deductions.

    2. You are self employed. In this case, you need to keep track of your business expenses, as those are deductible. You also do not have anyone taking out your income tax for you, so you are responsible for making sure you have enough saved come tax time (these tend to be the people who have problems). You are also supposed to pay taxes quarterly.

    3. You have a significant amount of income that is not from a single W2 employer. This can be multiple W2 jobs, 1099 jobs, investment income, proceeds from criminal activity, etc.

    4. You make a significant amount of money from unreported cash tips. (In practice, you can underreport this and no one will know).

    5. You choose to deduct your state’s sales tax instead of your states income tax; and do so by actually tracking how much you pay in sales tax instead of estimating it based on your income.

    Having said all of that. For 99% of taxpayers, the IRS knows exactly how much you owe; because all of your income was reported to them, as was your only significant deductions, and nothing else matters because you just take the standard deduction for the rest. The IRS could send you a bill/refund based on this and let the remaining 1% file if the IRS gets it wrong. However, that would collapse the tax preparation industry, so companies like TurboTax have lobbied against it for years.

    What actually happens instead is you go to TurboTax, upload all of the forms that were sent to the IRS, and let them file taxes on your behalf. This service was “free” until they were sued for false advertising on account of charging money.

    [0] At least for income tax. There’s a few other taxes on payroll that you cannot change.

    [1] Assuming you asked in the form of a properly filled out W4.


  • Volatility has always been built into investing, including index funds.

    If retirement is a long way away, then this is a non event. If retirement is close and your 401k was in a target date fund, you are heavily invested in bonds at this point, precisely to deal with this sort of situation.

    If you are close to retirement, and heavily weighed to tech heavy indecies, then this will probably delay your retirement a few years. If you’re already retired and so invested, you may have a problem.


  • In fairness to the PA, Palestine has an approximately 0% chance of winning a war against Israel. And an approximately 100% chance of them getting blown to pieces if they ever had an attack successful enough for Israel to fully mobilize against them (see Gaza).

    Their most likely to succeed strategy would be pursuing victory through the Israeli court system (which was relatively on their side, leading to the attempted “court reform” power grab that was the political story in Israel prior to October 7). Their next best bet would be Israeli politics moving away from the current right wing nationalist coalition.

    That is not to say that any of the above is easy, or likely to succeed. But at least it has a plausible chance. And, if it fails, that failure still leaves them better off than a war against Israel.




  • That’s called self insurance, and it works if you can afford it. The thing about insurance is that it is fundamentally a negative expected value financial product. That negative EV is the premium you pay for the reduced risk. And the risk reduction happens immediately, instead of needing to wait a decade for your self insurance fund to build up.

    One way to see this is to look at what the people who most understand insurance do. Insurance companies have a problem if too many people make claims at once. They could self insure against this risk, but that takes a lot of capital that they do not want to spend. Instead, insurance companies go out and buy insurance to cover them in case something happens that results in a lot of claims (this is called reinsurance).

    You can actually pull a similar truck with your own insurance. Self insure for the amount that you can handle, then treat your insurance provider like a reinsurance provider to cover large events beyond your capacity. In this case, we call it having a high deductible plan. And you can increase the deductible as your savings increase.

    Of course, once you have enough capital to self insure the full value of a house, you need to ask if self insuring is the most profitable use of that capital. You could also pay a premium to insurance companies for the financial service of risk reduction, then invest what would be your self insurance fund in something that you expect to produce higher returns.

    Of course, now you have the risk that this other investment might perform poorly and you want to insure against that. In this case, you might invest in something you expect to perform relatively poorly, but would do well in circumstances that makes your other investment do poorly. Of course, figuring this out is difficult, so you can instead pay a premium to an investment fund that specializes in hedging their bets.