• 0 Posts
  • 23 Comments
Joined 2 years ago
cake
Cake day: August 3rd, 2023

help-circle
  • The basic problem is that identifiers can be either types or variables, and without a keyword letting you know what kind of statement you’re dealing with, there’s no way of knowing without a complete identifier table. For example, what does this mean:

    foo * bar;
    

    If foo is a type, that is a pointer declaration. But if it’s a variable, that’s a multiplication expression. Here’s another simple one:

    foo(bar);
    

    Depending on how foo is defined, that could be a function call or a declaration of a variable bar of type foo, with some meaningless parentheses thrown in.

    When you mix things together it gets even more crazy. Check this example from this article:

    foo(*bar)();
    
    

    Is bar a pointer to a function returning foo, or is foo a function that takes a bar and returns a function pointer?

    let and fn keywords solve a lot of these ambiguity problems because they let the parser know what kind of statement it’s looking at, so it can know whether identifiers in certain positions refer to types or variables. That makes parsing easier to write and helps give nicer error messages.






  • sushibowl@feddit.nltoEurope@feddit.org*Permanently Deleted*
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 months ago

    Drones work now because they are $1000 (random number in the right range), while a patriot missile is $4 billion dollars each. Sure you could shoot a drone down with one, but if you do the enemy will just send more and bankrupt you.

    I agree with the point but these numbers are some orders of magnitude off. A patriot missile is typically 4 million dollars (so not billion). Drones vary widely depending on the type. Man-portable scouting drones can go as low as a few hundred dollars. I don’t think a patriot missile would ever target something that small flying that low though. The Iranian Shahed is estimated to cost around $30-50k. Russia produces its own upgraded version (better navigation systems, bigger warheads, etc.) that costs around $80k.

    Even then, you can make 50 drones for the cost of a single patriot. The economics are not favourable.




  • Another big factor is that every plant is effectively a completely custom design. Because of how few nuclear plants are constructed, every new one tends to incorporate technological advancements to enhance safety or efficiency. The design also has to be adapted to the local climate and land layout. This makes every single plant effectively one of a kind.

    It also tends to be built by different contractors, involving different vendors and electric utilities every time. Other countries have done better here (e.g. China and France) mostly due to comprehensive government planning: plopping down lots of reactors of the same design, done by the same engineers. Although these countries are not fully escaping cost increases either.

    You are completely correct that regulation is also a big factor. Quality assurance and documentation requirements are enormously onerous. This article does a pretty decent job explaining the difficulties.


  • I think holding more helium in a smaller space is the opposite of what you want. The lifting force is equal to the weight of the air being displaced, so you want as little stuff as possible in as big a volume as possible.

    Maybe if you went the other way round and compressed the atmosphere?


  • Very little is known about the Hunnic culture, so it is not really possible to establish this with any certainty. That being said, it’s pretty typical for pastorial nomads like this to collectively own and care for their herd. Although it’s also worth noting that communal property does not usually extend between different tribes, even when these tribes were united to some extent, such as under Attila.

    In general it’s difficult to fairly place ancient tribal societies into the modern day political spectrum. The structure and scale of societies has changed radically.


  • A system I work with gives all keys a string value of “Not_set” when the key is intended to be unset. The team decided to put this in because of a connection with a different, legacy system, whose developers (somehow) could not distinguish between a key being missing or being present but with a null value. So now every team that integrates with this system has to deal with these unset values.

    Of course, it’s up to individual developers to never forget to set a key to “Not_Set”. Also, they forgot to standardise capitalisation and such so there are all sorts of variations “NOT_SET”, “Not_set”, “NotSet”, etc. floating around the API responses. Also null is still a possible value you need to handle as well, though what it means is context dependent (usually it means someone fucked up).





  • VAT is a universal tax on goods. A tariff is basically a tax that applies only to imported goods. So a tariff distorts the market, making imports from a region more expensive relative to other regions, or domestic goods.

    Note that basically any tax is bad from an economic perspective. However for the government to function revenues must be raised. It is considered better for market efficiency to raise revenues in such a way as to least distort the market. Tariffs are a very distorting instrument, VAT is generally considered less distorting because it affects all parts of the market equally.


  • No magnetic confinement fusion reactor in existence has ever generated a positive output. The current record belongs to JET, with a Q factor of 0.67. This record was set in 1997.

    The biggest reason we haven’t had a record break for a long time is money. The most favourable reaction for fusion is generally a D-T (Deuterium-Tritium) reaction. However, Tritium is incredibly expensive. So, most reactors run the much cheaper D-D reaction, which generates lower output. This is okay because current research reactors are mostly doing research on specific components of an eventual commercial reactor, and are not aiming for highest possible power output.

    The main purpose of WEST is to do research on diverter components for ITER. ITER itself is expected to reach Q ≥ 10, but won’t have any energy harvesting components. The goal is to add that to its successor, DEMO.

    Inertial confinement fusion (using lasers) has produced higher records, but they generally exclude the energy used to produce the laser from the calculation. NIF has generated 3.15MJ of fusion output by delivering 2.05MJ of energy to it with a laser, nominally a Q = 1.54. however, creating the laser that delivered the power took about 300MJ.



  • sushibowl@feddit.nltoScience Memes@mander.xyzMoss
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    Note that although species can be described as tree-like, they didn’t quite look like modern trees do. Also, much of the world was swamp, and much of the dead plant material sank into these bogs and decayed into peat.

    The amount of CO2 trapped during this period caused the atmosphere to be around 35% oxygen. This allowed life with inefficient respiratory systems to grow much bigger in size without suffocating, mainly insects. Think woodlice 6 feet long, spiders the size of dogs, millipedes as big as cars, and dragonflies as big as eagles.


  • is-number is a project by John Schlinkert. John has a background in sales and marketing before he became an open source programmer and started creating these types of single function packages. So far he has about 1400 projects. Not all of them are this small, though many are.

    He builds a lot of very basic functionality packages. Get the first n values from an array. Sort an array. Set a non-enumerable property on an object. Split a string. Get the length of the longest item in an array. Check if a path ends with some string. It goes on and on.

    If you browse through it’s not uncommon to find packages that do nothing but call another package of his. For example, is-valid-path provides a function to check if a windows path contains any invalid characters. The only thing it does is import and call another package, is-invalid-path, and inverses its output.

    He has a package called alphabet that only exports an array with all the letters of the alphabet. There’s a package that provides a list of phrases that could mean “yes.” He has a package (ansi-wrap) to wrap text in ANSI color escape codes, then he has separate packages to wrap text in every color name (ansi-red, ansi-cyan, etc).

    To me, 1400 projects is just an insane number, and it’s only possible because they are all so trivial. To me, it very much looks like the work of someone who cares a lot about pumping up his numbers and looking impressive. However the JavaScript world also extolled the virtues of these types of micro packages at some point so what do I know.