HNHacker News
TopNewBestAskShowJobs

professoretc

474 karma · joined August 20, 2013

submissionscomments
professoretc··on Test Scores Down, GPAs Up: The New Angst over Grade Inflation
Prefixes come first, 1 byte each, order doesn't matter except that REX, if present, must come last. Then the opcode, 1-3 bytes. Followed by Mod R/M byte, if present. Followed by SIB byte, if present. Followed by address/immediate, 1, 2, 4, or 8 bytes, if present.

Ugh; there's a reason why I'm switching my architecture course to MIPS32.

professoretc··on Garbage Collectors Are Scary
The problem is that if you call another function, you won't know whether that function is uses any instructions that require alignment. So in practice, only leaf functions can skip stack alignment. The ABI states that the stack pointer must be aligned to a multiple of 16, plus 8, before any `call` instruction.
professoretc··on Results of the Grand C++ Error Explosion Competition (2014)
For my beginner programming class, I have them use a script `compile` which handles compilation and linking, while also enabling enabling all the warnings/errors I think are helpful, and also doing the above redirection. An absolute beginner doesn't gain anything from invoking `g++` directly.
professoretc··on The agony and ecstasy of Costco (2023)
A typical grocery store will carry on the order of 40,000 unique products. Costco is hard limited to a max of 3,700 unique products. If a store wants to bring a new product in, something must be rotated out. This also means that if a product wants to stay in Costco, it has to sell a certain minimum number of pallets, per month, to be worth it.
professoretc··on Ask HN: Interesting TUIs (text user interfaces), maybe forgotten ones?
TurboVision was distributed as source with some of the Borland tools, and later open-sourced, I think. So it's not a rewrite, just a port to non-DOS terminals.
professoretc··on If Inheritance is so bad, why does everyone use it?
The implementation of inheritance (more specifically, polymorphism and dynamic dispatch via vtables) is a problem in games, because it adds an extra layer of indirection, and screws with cache locality. But the semantics of inheritance (X ISA Y) still apply. In an ECS, the implementation is different (struct-of-arrays) but you can still think of an entity as "inheriting from" the various components its built from.
professoretc··on Show HN: Bonk, a command-line tool for X11 window management
Is that article correct, that mixed DPI on Wayland works by just rendering everything to a virtual screen whose resolution corresponds to the maximum DPI of any physical screen, and then downscaling all the other screens?
professoretc··on Hamas Believed It Would Conquer Israel
The journalist who wrote the article is an Israeli Jew.
professoretc··on Jedi Knight (Plus, Notes on an Expanded Universe)
It's worth pointing out how different (and better) Jedi Knight's morality system is from the "Bethesda model", in which you play as good/bad but at the end of the game, it doesn't matter and you get to make the Big Moral Choice (purify the water or POISON EVERYONE?).

In JK you are never asked explicitly, "Do you want to do a Good Thing or a Bad Thing?". After a boss fight, you can choose to kill your opponent, or not. Those civilians running around sometimes drop health packs or ammo when they die, so maybe you kill them, or you don't. Dark side force powers are awesome, and don't require ammo to work, so maybe you put a few points into them. Then, at about 3/4 through the game, it doesn't ask if you want to be a light or dark Jedi, it tells you what kind of Jedi you were all along. You get to the point where you might expect the game to offer you a Big Choice, but instead, it points out that you already made your choice when you weren't paying attention.

professoretc··on Jedi Knight (Plus, Notes on an Expanded Universe)
My brother and I made a mod in which you played as an Ugnaught (the little guys running around cloud city) wielding a wrench instead of a lightsaber. For some reason we thought it was hilarious to replace the main villain with Bob Saget.
professoretc··on Why Don't I Like Git More?
Yeah, but if every project, no matter how small, required you to spin up and maintain a full Postgres install, surely you'd start thinking, there has to be something easier than this...

The problem with Git is the same kind of problem Excel has: everyone can (correctly) claim to only use 20% of its features, thus everyone can say "Git is too complex!". But the problem is that everyone uses a different 20% of Git; Git is the union of the solutions to lots of different problems.

professoretc··on The V8 Sandbox
You're essentially correct; in JS, if you write

    for(var i = 0; i < arr.length; ++i)
        ...
then the array's length is not read once at the beginning of the loop; it is read every loop iteration. So if the code inside the loop (or inside the getter for `length` itself) modifies the length of the array, then it will be caught when the condition is evaluated. The problem is that the C++ code makes assumptions about JS (reading the length of an array cannot change the array's length) that don't hold. But it's an easy mistake to make.
professoretc··on Autoconf makes me think we stopped evolving too soon
It's kind of weird that these days, many (most?) projects use Cmake directly as their build tool. They don't generate a VC or Xcode project and then work from that; they generate a VC project and then immediately build it. The CMakeLists.txt effectively is the project definition. VS now has support for opening CMake projects directly, without creating a VS project file from them. So the thing that made CMake useful (and what also makes it complicated...), is now used less and less.
professoretc··on Autoconf makes me think we stopped evolving too soon
In other words, it's not just as simple as "figure out how to compile things on this system, once, and then reuse that information in the future". Different projects can be compiled with different options, cross-compilation is a thing, etc. As soon as you try to solve this with a simple global `site_config.h` you discover that that doesn't quite work.
professoretc··on What we know about the xz Utils backdoor that almost infected the world
So all of Fabrice Bellard's projects (https://bellard.org/) should not exist?
professoretc··on Sam Bankman-Fried sentenced to 25 years in prison
> I agree with it only in principle; it seems ripe for injustice in all practical details.

Yep, instead of "you definitely get out of prison after X years have passed" you instead get "you get out of prison in 21 years! (or never, depending on how we feel)".

professoretc··on How is a company that sells canned water worth $1.4B?
Isn't caffeine one of the most bitter-tasting substance out there? Like, it's used to measure bitterness.
professoretc··on Software on gas pump with "demo mode" enabled allowed "free" gas for 5 months
Costco encourages the sample vendors to give out as many as you want.
professoretc··on How can C Programs be so Reliable? (2008)
> I don't know of a platform where a dereferencing of NULL (which happens in a separate translation unit, which is already compiled and linked, and will not be subject to LTO and other optimisations) within the various read/write/seek/tell functions doesn't result in an immediate crash.

Although in a very different content, I have seen "dereferencing" a null pointer in C++ not crash immediately, if you dereference it to call a nonvirtual class member function, e.g,

    t->foo();
Depending on how this gets compiled and the implementation of `foo()`, the segfault may not come at the line above, where technically `t` is being dereferenced. It may come inside `foo`, or somewhere further down the call chain. The resulting crash may not even manifest as a segfault.
professoretc··on HP wants you to pay up to $36/month to rent a printer that it monitors
Coming soon: "HP reserves the right to retain or sell your printed documents for the purposes of training AI."
professoretc··on Unidentified balloon belongs to amateur balloonist: US official
You linked to the wrong section (again); that covers how ATC should handle unmanned balloons, not what the balloon operator should do. You probably meant [FAR part 101](https://www.ecfr.gov/current/title-14/chapter-I/subchapter-F...), of which subpart D covers unmanned balloons. But it looks like for anything under 6 lbs, most of the requirements don't apply, except to file NOTAM and notify the nearest ATC when you launch/descend and a few other things.
professoretc··on Unidentified balloon belongs to amateur balloonist: US official
That entire section is about amateur rockets; nothing there applies to balloons.
professoretc··on AI Is Starting to Threaten White-Collar Jobs
LLM managers will almost certainly not be hooked up to any API that would allow them to actually give raises. Fire people, sure.
professoretc··on Pratt Parsers: Expression Parsing Made Easy (2011)
I met Vaughan Pratt at a math seminar a few years back, where he was talking about his current interest, Chu spaces. While we were waiting in line to get coffee, with the coffee stations labeled "regular" and "decaf", Pratt said, "But where's the context-free coffee?" and then laughed at his own joke. Later at lunch he was telling us about a physics experiment he set up in his pool shed; "My wife told me to do it in the pool shed so that if it explodes it won't destroy the house."
professoretc··on "LibreOffice is better at reading old Word files than Word"
It's rather ironic that the one old file format I've tried to open in LibreOffice, namely, old StarOffice 5 files, do not open. (LibreOffice forked from OpenOffice, which was the open-sourcing of StarOffice.) The converters were removed to simplify the codebase.
professoretc··on Deep cloning objects in JavaScript
It doesn't "corrupt" them; it converts them to JSON strings. It's in the name. Expecting `JSON.stringify` to throw in those situations would be like expecting `str` in Python to throw.
professoretc··on C++ Should Be C++
> I'm always saying that good way to learn language patterns and idioms is to look into standard libraries implementations.

Why would that be true? When you write a library, you are writing code to cover all possible uses; everything within the scope of your library should at least be considered, even if you personally have no need of that particular bit of functionality. But when you write a program it only has to do one thing, so of course it's going to be simpler. To me, it seems obvious that (good) library code will be very different from (good) application code.

(I've used libraries that were written like applications, but they were bad libraries; I was constantly fighting the fact that the library author wrote only for their own use-case, and didn't consider any other.)

professoretc··on YouTube is now blocking ad blockers so I make ads run faster
Please drink verification can.
professoretc··on Apostrophe Protection Society
There's a donut shop near me named Loi's Donuts. Not Lois's or Lois'. Yes, the owner's name is Lois, not Loi. I guess the apostrophe just means, Hey, there's an "S" coming up!
professoretc··on Nobody knows what the point of homework is
The rule for college/uni I've always heard (and repeated to my students) is 2 hrs outside of class for every hour in class. So a 4 unit (= 4 in-class hours/week) class should have 8 hrs of outside time dedicated to studying and homework.
← PreviousPage 2 of 8Next →