• 6 Posts
  • 152 Comments
Joined 2 years ago
cake
Cake day: June 18th, 2023

help-circle

  • I wholeheartedly agree: In my job, I develop mathematical models which are implemented in Fortran/C/C++, but all the models have a Python interface. In practice, we use Python as a “front end”. That is: when running the models to generate plots or tables, or whatever, that is done through Python, because plotting and file handling is quick and easy in Python.

    I also do quite a bit of prototyping in Python, where I quickly want to throw something together to check if the general concept works.

    We had one model that was actually implemented in Python, and it took less than a year before it was re-implemented in C++, because nobody other than the original dev could really use it or maintain it. It became painfully clear how much of a burden python can be once you have a code base over a certain size.


  • I have next to no experience with TypeScript, but want to make a case in defence of Python: Python does not pretend to have any kind of type safety, and more or less actively encourages duck typing.

    Now, you can like or dislike duck typing, but for the kind of quick and dirty scripting or proof of concept prototyping that I think Python excels at, duck typing can help you get the job done much more efficiently.

    In my opinion, it’s much more frustrating to work with a language that pretends to be type safe while not being so.

    Because of this, I regularly turn off the type checking on my python linter, because it’s throwing warnings about “invalid types”, due to incomplete or outdated docs, when I know for a fact that the function in question works with whatever type I’m giving it. There is really no such thing as an “invalid type” in Python, because it’s a language that does not intend to be type-safe.


  • True, I did a quick calculation and the probability of knowing someone killed or severely injured is

    • 12.5% if you know 10 people
    • 23.5% if you know 20 people
    • 33.5% if you know 30 people
    • 41.5% if you know 40 people
    • 49% if you know 50 people

    So around ⅓ Russians know at least one person that’s been killed or wounded, and around 10-20% of Russians have someone in their inner circle of friends and family (10-20 closest) that have been killed for wounded.

    For this last number to reach 50%, the number of killed+wounded needs to reach about 5% of the fighting age population (≈2.5 million).

    Of course, the above assumes that casualties are randomly distributed in the population. In reality it’s likely that fewer people know someone killed or wounded, and that those that know someone likely know more, because of the casualties being disproportionately effecting more rural regions of the country.



  • I have to be honest: It does confuse be a bit how they’re able to get away with this. There’s this uproar now about the wealth tax (1), which I partly understand, because if your business isn’t turning a profit, and you’re forced to pay taxes based on the value of the shares, you have a problem. However, some people are apparently capable of buying houses, boats and cars, as well as living a lavish lifestyle, while still having a “zero” in their income. My guy, how are you buying food and houses without having a taxable income?

    I think the wealth tax is a good place to start, but as of now it seems to me like it isn’t specific enough. We need some way to ensure that

    • If you want to buy something, you need either income or a loan.
    • If you want to pay your loans you need income.
    • If you have income, it is taxed.

    so that we can ensure that the money these people are getting from somewhere is appropriately taxed, while avoiding hurting people that own a company with millions in assets (e.g. in equipment), but aren’t cashing out anything from the company (e.g. aren’t buying expensive shit for themselves). Of course, “benefits” like getting a house, meals, or a yacht as a “gift” from your company should be taxed appropriately.

    (1) For non-Norwegians: We’ve recently introduced a tax based on your current wealth, rather than income









  • There’s a lot of good advice here already, especially that wool is the gold standard - nothing synthetic cuts it. I want to add that the absolute key is about layering, and not over-stuffing.

    What keeps you warm is primarily the air trapped between your layers, which means that three thin layers can be a lot better than one thick layer. This also means that you will be freezing if your layers are too tight. If you have two thin layers, and put on a sweater, and that sweater feels tight, that likely means you’re pushing out the air trapped in your inner layers, and they won’t be as effective. The same applies when putting on a jacket.

    So: You want a thin base layer (think light, thin wool shirt + long johns), then an optional medium layer or two (slightly thicker wool shirt, I have some in the range of 200 grams), and finally a thicker sweater for when you’re not moving. These should increase in size so that they can fit the thinner layers underneath, and you want your jacket big enough to fit all the underlying layers.

    Finally: When you’re moving around, you will get stupidly warm and sweaty unless you take off clothes. It’s better to take off some stuff and be a bit cold for the first 10 minutes of moving than to get sweaty and be cold for the rest of the day. If (when) you do get cold, running in a circle for 10 min will fix it (run at a calm, steady pace, if you’re really cold it might take longer to get warm than you think, but you will get warm if you move).

    In short: Being in a cold climate is just as much about how you use your equipment, and how you activate yourself to stay warm, as it is about what equipment you have.



  • I have to be honest in that, while I think duck typing should be embraced, I have a hard time seeing how people are actually able to deal with large-scale pure Python projects, just because of the dynamic typing. To me, it makes reading code so much more difficult when I can’t just look at a function and immediately see the types involved.

    Because of this, I also have a small hangup with examples in some C++ libraries that use auto. Like sure, I’m happy to use auto when writing code, but when reading an example I would very much like to immediately be able to know what the return type of a function is. In general, I think the use of auto should be restricted to cases where it increases readability, and not used as a lazy way out of writing out the types, which I think is one of the benefits of C++ vs. Python in large projects.





  • I definitely think the ramping up is going far too slowly, and as such it isn’t strange that there are shortages.

    This is a huge war- the largest land war since WWII. All of NATO is still operating on a peace-time economy, so ramping up production to the levels required to support a 500 k - 1 mill. strong army like the Ukrainians is taking far too long.

    However, as far as I can tell, production in Europe is only heading one way: Up. Not only that, Russia is operating in a war economy, which is, more or less by definition, unsustainable in the long run. Europe has the economic capacity to double its production, and maintain it indefinitely. I just think we should prioritise more heavily, and scale up more quickly.