• 0 Posts
  • 13 Comments
Joined 1 year ago
cake
Cake day: July 1st, 2023

help-circle



  • That is true, but from a human perspective it can still seem non-deterministic! The behaviour of the program as a whole will be deterministic, if all inputs are always the same, in the same order, and without multithreading. On the other hand, a specific function call that is executed multiple times with the same input may occasionally give a different result.

    Most programs also have input that changes between executions. Hence you may get the same input record, but at a different place in the execution. Thus you can get a different result for the same record as well.


  • That exact version will end up making “true” false any time it appears on a line number that is divisible by 10.

    During the compilation, “true” would be replaced by that statement and within the statement, “__LINE__” would be replaced by the line number of the current line. So at runtime, you end up witb the line number modulo 10 (%10). In C, something is true if its value is not 0. So for e.g., lines 4, 17, 116, 39, it ends up being true. For line numbers that can be divided by 10, the result is zero, and thus false.

    In reality the compiler would optimise that modulo operation away and pre-calculate the result during compilation.

    The original version constantly behaves differently at runtime, this version would always give the same result… Unless you change any line and recompile.

    The original version is also super likely to be actually true. This version would be false very often. You could reduce the likelihood by increasing the 10, but you can’t make it too high or it will never be triggered.

    One downside compared to the original version is that the value of “true” can be 10 different things (anything between 0 and 9), so you would get a lot more weird behaviour since “1 == true” would not always be true.

    A slightly more consistent version would be

    ((__LINE__ % 10) > 0)
    

  • That’s pretty much it, yes! I’m not 100% sure about the German part, because they are are part of Wallonia (which is the southern part) but do have their own language representation so I’m not actually sure which government manages their curriculum.

    The German-speaking part isn’t shown on the map, probably because it is too small or the map maker got confused with our amazing organization.

    There’s also the region of Brussels, which is separate of Flanders and Wallonia, and officially bilingual french / dutch. They sort of tried to represent it on the map, but I have no idea what they tried to do there.

    It is a clusterfuck, really.


  • You want to translate COBOL to another language? That exists as a commercial product! The complexity is not the syntax though, it is the environment and subsystems surrounding the code. A lot of COBOL is designed for mainframe systems, and emulating a mainframe is complex.

    You also end up with code that is still written as if it were COBOL. The syntax for COBOL is the easy part and that is all you can easily replace. Afterwards you’re still stuck with the way of working and mindset, both of which are quite peculiar.

    The company I work for recently looked at all of this, and we decided not to translate our code.




  • Are sd card slots cheaper than 128 GB of flash storage chips? I’m not sure, but yes, probably. You would also need to factor in the additional complexity of allowing physical access to the slot, which would take some additional designing and a few more components. The sd card itself will probably be a more expensive and slower than integrated flash storage. By contrast, it is probably extremely easy to just shove some flash storage chips in a phone. Still, I agree that it sounds like a worthwhile tradeoff for me.


  • premium phones that have SD cards, but there aren’t many options. The only one is a $1400 Xperia I V

    There are other options too, like the fairphone or Galaxy A-series mentioned by others in this thread. They never disappeared, they just became less common because there is less customer demand.

    If you need a phone with a lot of storage or extensible storage, you can get one. There will be a cost associated with that need, but it is not necessary to pay $1400 either. It is hardly anti-consumer to say that a lot of people don’t need this option.

    What you do with your phone is your choice, and if you want to store 1 TB of pictures, audiobooks, or even porn, you should go ahead and do that. All I’m saying is that this is not a typical use case, and you can’t expect any random phone to support it. But there are phones that do, and you should get one.