• 0 Posts
  • 175 Comments
Joined 2 年前
cake
Cake day: 2023年6月14日

help-circle



  • Yeah, mine was similar. Had some old Win95 machines from work that were getting thrown away; scavenged as much RAM as possible into one case and left Red Hat Linux downloading overnight on the company modem. Needed two boxes of floppy disks for the installer, and I joined up a 60 MB and an 80MB hard drive using LVM to create the installation drive. It was a surprisingly functional machine - much better at networking than it was as a Win95 computer - but yeah, those days are long gone.



  • Three months of using Arch and you’ve not included your ‘btw’ when claiming to use it? Most suspicious.

    But yeah, agree completely. I made a new-years resolution about five years ago to try ‘Linux only gaming for a month’ rather than dual booting; worked so well that I wiped Windows a few months later and have never missed it for a minute. That was for Mint, which is great but hard to keep cutting-edge. Decided to try Arch instead, and after a couple of false starts (hadn’t read the install guide carefully enough to have networking after restart, that kind of thing) it’s been absolutely superb - rock solid, got everything I want at the very latest versions for work and games, best documentation of any distro.


  • Enough of that crazy talk - plainly WheeledDeviceServiceFactoryBeanImpl is where the dependency injection annotations are placed. If you can decide what the code does without stepping through it with a debugger, and any backtrace doesn’t have at least two hundred lines of Spring boot, then plainly it isn’t enterprise enough.

    Fair enough, though. You can write stupid overly-abstract shit in any language, but Java does encourage it.



  • Well now. My primary exposure to Go would be using it to take first place in my company’s ‘Advent of Code’ several years ago, in order to see what it was like, after which I’ve been pleased never to have to use it again. Some of our teams have used it to provide microservices - REST APIs that do database queries, some lightweight logic, and conversion to and from JSON - and my experience of working with that is that they’ve inexplicably managed to scatter all the logic among dozens of files, for what might be done with 80 lines of Python. I suspect the problem in that case is the developers, though.

    It has some good aspects - I like how easy it is to do a static build that can be deployed in a container.

    The actual language itself I find fairly abominable. The lack of exceptions means that error handling is all through everything, and not necessarily any better than other modern languages. The lack of overloads means that you’ll have multiple definitions of eg. Math.min cluttering things up. I don’t think the container classes are particularly good. The implementation of pointers seems solely implemented to let you have null pointer exceptions, it’s a pointless wart.

    If what you’re wanting to code is the kind of thing that Google do, in the exact same way that Google do it, and you have a team of hipsters who all know how it works, then it may be a fine choice. Otherwise I would probably recommend using something else.


  • I feel that Python is a bit of a ‘Microsoft Word’ of languages. Your own scripts are obviously completely fine, using a sensible and pragmatic selection of the language features in a robust fashion, but everyone else’s are absurd collections of hacks that fall to pieces at the first modification.

    To an extent, ‘other people’s C++ / Bash scripts’ have the same problem. I’m usually okay with ‘other people’s Java’, which to me is one of the big selling points of the language - the slight wordiness and lack of ‘really stupid shit’ makes collaboration easier.

    Now, a Python script that’s more than about two pages long? That makes me question its utility. The ‘duck typing’ everywhere makes any code that you can’t ‘keep in your head’ very difficult to reason about.


  • Frezik has a good answer for SQL.

    In theory, Ansible should be used for creating ‘playbooks’ listing the packages and configuration files which are present on a server or collection of servers, and then ‘playing the playbook’ arranges it so that those servers exist and are configured as you specified. You shouldn’t really care how that is achieved; it is declarative.

    However, in practice it has input, output, loops, conditional branching, and the ability to execute subtasks recursively. (In fact, it can quite difficult to stop people from using those features, since ‘declarative’ doesn’t necessarily come easily to everyone, and it makes for very messy config.) I think those are all the features required for Turing equivalence?

    Being able to deploy a whole fleet of servers in a very straightfoward way comes as close to the ‘infinite memory’ requirement as any programming language can get, although you do need basically infinite money to do that on a cloud service.




  • CMake, which is kind of the universal standard build system for C++ now, has “fetch content” since v3.11. Put the URL of a repository (which can be remote, but also local, which is handy) and optionally the branch / commit ID that you’d like, and it will pull it into your build directory automatically. So yeah, you can pull anything nefarious that you’d like. I don’t think most people would question pulling and building a library from Github as part of the build, especially if it had a sensible name for the task at hand.





  • It’s one of those materials that has an almost complete list of superb properties, with one overwhelming downside. It’s cheap, abundantly available, completely fireproof and can be woven into fireproof cloth, adds enormous structural strength to concrete in small quantities, very resistant to a wide range of chemical attacks. It’s just that the dust causes horrific cancers. See also CFCs, leaded petrol, etc, which have the same ‘very cheap, superb in their intended use, but the negative outweighs all positives’.

    One of the ‘niche industrial applications’ was the production of pump gaskets in high-temperature scenarios, especially when pumping corrosive liquids. We’ve a range of superalloys that are ‘suitable’ for these applications - something like inconel is an absolute bastard to form into shapes, but once you’ve done so it lasts a long time. But you still need something with similar properties when screwing the bits together. For a long time, there was no suitable synthetic replacement for asbestos in that kind of usage.

    If you know that the asbestos is there, have suitable PPE and procedures, then IMHO it’s far from the worst industrial material to work with. It’s pretty inert, doesn’t catch fire or explode, and isn’t one of the many exciting chemicals where a single droplet on your skin would be sufficient to kill you. What is inappropriate is using it as a general-purpose building material, which is how it was used for so long, and where it was able to cause so much suffering for so many people.


  • From a UK perspective, a lot of US cars would be illegal to drive on public roads here - too large, too dangerous for pedestrians and other road users. “Dangerous” also applies to some of your other potential exports too. Chlorinated chicken, for instance, isn’t considered safe for consumption. So the absence of a market for those goods isn’t simply “customer preference”.

    As a European, we’ve been too dependent on the US on some things for too long. We need to be more independent. The situation in Ukraine has shown that; we need to be able to support our allies better. But the US trashing their own economy, making themselves into global pariahs and handing over their superpower status to China is what I would have described as “not my dream way” of achieving that.


  • A binary tree is one way of preparing data, usually for sorting. Each node can have a left, right, or both, children.

      A
     / \
    B   C
       / \
      D   E
    

    “Inverting the tree” means swapping the children for each node, so that the order that the nodes are visited is reversed. Depending on whether you want to copy the tree or swap it in place then the algorithm is different. C++ provides iterators too, so providing a “order reversed” iterator can be done efficiently as well.

    You’re going to have to visit every node and do at least one swap for every node, and an efficient algorithm won’t do much more than that. Bring unable to do it suggests that the student programmer doesn’t understand stacks or recursion yet, so they’ve more to learn.