• 0 Posts
  • 105 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2023

help-circle



  • I started in C and switch to C++. It’s easy to think that the latter sort of picked up where the former left off, and that since the advent of C++11, it’s unfathomably further ahead. But C continues to develop and occasionally gets some new feature of its own. One example I can think of is the restrict key word that allows for certain optimizations. Afaik it’s not included in the C++ standard to date, though most compilers support it some non-standard way because of its usefulness. (With Rust, the language design itself obviates the need for such a key word, which is pretty cool.)

    Another feature added to C was the ability to initialize a struct with something like FooBar fb = {.foo=1, .bar=2};. I’ve seen modern C code that gives you something close to key word args like in Python using structs. As of C++20, they sort of added this but with the restriction that the named fields have to come in the same order as they were originally defined in the struct, which is a bit annoying.

    Over all though, C++ is way ahead of C in almost every respect.

    If you want to see something really trippy, though, have a look at all the crazy stuff that’s happened to FORTRAN. Yes, it’s still around and had a major revision in 2018.


  • The first time I met the dad of the woman I would eventually marry was when I flew out to have Christmas with them. He was a big-shot lawyer, and I was a little scared of the guy. Not gonna lie.

    I thought I gotta bring him a gift. But what? I had very little money, having just graduated. What could I get lawyer dad that wouldn’t seem tacky? I went to a book shop and got around to the true crime section. He’s a lawyer right? Maybe he likes true crime? So I read a few back covers and found one that looked sort of interesting. It was about a murder on a college campus, but looked like the investigation had lots of twists and turns with a big trial at the end? Would he like it?

    Anyway, I meet him and give him the book and he sort of tosses it aside and grills me, as expected. I kind of shrank in the chair, but my to-be-wife and her siblings said I did okay.

    Now fast-forward several weeks. I’m back home and get an email from her dad. Oh boy! What did I do? But he’s like, “I just finished the book. It was set at the college where I got my law degree. I even knew one of the profs who’s a character in it! How did you know?!?” I didn’t. “It was so nostalgic. The author mentioned landmarks, some of which aren’t even around anymore. But I remember. That was the best book I’ve read in years! I couldn’t put it down!”

    We were all good after that.





  • I’m an English-speaking Canadian, so the de facto 2nd language here is French. It was mandatory at school. I’d say I have a passable reading knowledge of it, though my oral comprehension sucks. That’s still good though. I can read signs and menus in Québec and maybe even say a few words if people are patient with me.

    What I find a tad amusing is that while English class was also mandatory, I don’t remember learning much about the English language itself. Like I learned more English grammar and language structure from French class, plus those couple of semesters of Latin I took.

    I also speak a bit of Japanese as it’s my literal mother tongue, but there, the situation is sort of reversed from French. Speaking comes naturally but reading is hopeless. So I guess I am bilingual in 1 + .5 + .5 sort of way?



  • If you can figure out how to simulate molecules, or draw 3D stereograms, or translate hieroglyphics, or any other RIDICULOUSLY COMPLICATED SHIT, making a graphical user interface should be nothing to you. You should be able to do it in a fucking afternoon.

    In a word, no. Being able to build an engine doesn’t mean you know the first thing about how to design a car. It’s a totally different skill set.

    I work with PhDs who code all sort of amazing physics engines and then I design the GUI apps around them. That’s a full-time job right there (I’m living proof of it), and I wouldn’t expect them to understand it any more than they would expect me to understand all the physics.

    When you write some sort of procedural tool, you are in complete control of the program flow from start to finish. In a GUI app, the user is in control most of the time. That’s awesome if you’re the user, but it means a lot more what-if scenarios you have to account for, since users are notoriously unpredictable. And if the task your command line was performing takes an appreciable length of time, you need to spawn it off into separate threads or subprocesses and worry about all the synchronization logic you must get right. This is a programming minefield for anyone who has done it, especially when you need said threads to interact with the GUI, as GUI frameworks are notoriously not thread-safe.

    Anyway, what I’m trying to say is designing and implementing GUIs is non-trivial, unless maybe you just want something like an installer wizard that runs you through 10 dialogs to gather info for a command line and then runs it.





  • 100g * 9.832m²/s

    That should be 100g * 9.832m/s², or better yet 0.1kg * 9.832m/s² to get a number in newtons (N).

    From a high school physics perspective, holding a 100g object steady for any length of time does no work, since work is force applied over a distance, measured in joules (J). What you do have is gravitational potential energy. Potential energy is the ability to do work, also measured in joules. Once you release the object, then you actually start getting numbers for work and power.

    Power, measured in watts (W), is work done per unit time. So 10W/hr would be (10J/s)/hr. I guess that would be the rate of change of power consumption, if that were useful to you?

    In theory, energy and work should be measured in joules. Simple as that. But this unit of kwh (kilowatt∙hour) has come into vogue, presumably because that’s what power utilities show on the meter outside your house? 1 kW∙hr = 1 kJ/s∙hr ∙ (1000J / kJ) * (3600s / hr) = 3.6MJ. So now we’re back from power to energy consumption.





  • #2 is certainly food for thought. So the idea is that from a journalistic fact-checking point of view, it is more important to convey the information exactly as it was presented than to verify its accuracy?

    This would explain why science/engineering-based articles are so commonly inaccurate or missing in critical details. The journalist can fall back on saying “I have a recording of an interview with the expert after we downed a few pints at the pub, and I’m just parroting back what he said. Don’t shoot the messenger!”