• 0 Posts
  • 132 Comments
Joined 2 years ago
cake
Cake day: July 24th, 2023

help-circle


  • probably a relatively simple equation

    Yes, the area of a triangle is base times height over 2. The base is a side of your choice and the height is measured in a right angle to it (You may have to extend it in a straight line).

    Lets split the flag into two triangles from corner to corner and consider the bottom right one (the other works the same way).

    Chose the edge on the right flag edge as the base and the height of the triangle becomes the width of the flag.
    All the colored triangles have the same height and by the look of it roughly the same base length.

    Therefore the areas are equals.




  • the reason the bombers were in the open is due to Russian compliance with the START treaty.

    First, Russia suspended it’s participation in new START

    Second, are you sure that’s a requirement of the treaty?

    The only relevant article I could find is the following (emphasis mine):

    Article X

    1. For the purpose of ensuring verification of compliance with the provisions of this Treaty, each Party undertakes: (a) to use national technical means of verification at its disposal in a manner consistent with generally recognized principles of international law; (b) not to interfere with the national technical means of verification of the other Party operating in accordance with this Article; and © not to use concealment measures that impede verification, by national technical means of verification, of compliance with the provisions of this Treaty.
    2. The obligation not to use concealment measures includes the obligation not to use them at test ranges, including measures that result in the concealment of ICBMs, SLBMs, ICBM launchers, or the association between ICBMs or SLBMs and their launchers during testing. The obligation not to use concealment measures shall not apply to cover or concealment practices at ICBM bases or to the use of environmental shelters for strategic offensive arms.

    Looks to me like plane hangars are allowed while the tires on planes that they actually used are illegal as they don’t protect against the weather and just exist to fool bad satellite images.






  • If you want to have a library that can also be a standalone executable, just put the main function in an extra file and don’t compile that file when using the library as a library.
    You could also use the preprocessor to do it similar to python but please don’t.

    Just use any build tool, and have two targets, one library and one executable:

    LIB_SOURCES = tools.c, stuff.c, more.c
    EXE_SOURCES = main.c, $LIB_SOURCES
    

    Edit: added example




  • That boolean can indicate if it’s a fancy character, that way all ASCII characters are themselves but if the boolean is set it’s something else. We could take the other symbol from a page of codes to fit the users language.
    Or we could let true mean that the character is larger, allowing us to transform all of unicode to a format consisting of 8 bits parts.



  • It might also introduce spurious data dependencies

    Those need to be in the in smallest cache or a register anyway. If they are in registers, a modern, instruction reordering CPU will deal with that fine.

    to store a bit you now need to also read the old value of the byte that it’s in.

    Many architectures read the cache line on write-miss.

    The only cases I can see, where byte sized bools seems better, are either using so few that all fit in one chache line anyways (in which case the performance will be great either way) or if you are repeatedly accessing a bitvector from multiple threads, in which case you should make sure that’s actually what you want to be doing.