cbrogrammer's comments

cbrogrammer | 3 years ago | on: Code Smell of the Day: Type Keys (2021)

> const createUser = (

> attributes: UserAttributes,

> onCreate: (user: User) => void

> ): User => {

> user = User.create(attributes);

> onCreate(user);

This stood out to me, in an otherwise tame article, as probably the most terrible overthought interface possible. A literal callback function passed as a function reference to something that does three lines of code? Good luck with that, I much prefer even a slightly procedual implementation.

cbrogrammer | 3 years ago | on: Overfitting and the strong version of Goodhart’s law

> Goal: Distribution of labor and resources based upon the needs of society > Proxy: Capitalism > Strong version of Goodhart's law leads to: Massive wealth disparities (with incomes ranging from hundreds of dollars per year to hundreds of dollars per second), with more than a billion people living in poverty

Nothing as annoying as online communists inserting their horrible political opinions everywhere. Try moving to a communist country. See how capitalism has raied billions out of poverty in only 30 years

cbrogrammer | 3 years ago | on: Sudo: Heap-based overflow with small passwords

We could start by considering not writing stuff like

> /*

> * Truncate to 8 chars if standard DES since not all crypt()'s do this.

> * If this turns out not to be safe we will have to use OS #ifdef's (sigh).

> */

> sav = pass[8];

cbrogrammer | 3 years ago | on: How CUDA Programming Works

CUDA is absolutely fine just like x86 assembly is absolutely fine. They are well thought out. What I am saying is that from my perspective they are as granular and difficult, and programming directly in them for even small projects is not a good idea. GPU programming is, at the moment, stuck in 1960's way of thinking, as there are multiple people writing CUDA code by hand.

cbrogrammer | 3 years ago | on: Framework Laptop Mainboard

will this laptop ever ship with a non-US keyboard layout? The enter key is so bad on them, I hate that it is long and not high. Dealbreaker unfortunately, wish I could buy one of these.

cbrogrammer | 3 years ago | on: Old C code – how to upgrade it?

What do you mean? A cast to a char pointer is absolutely valid C. For most intents and purposes, a pointer "type" in C is merely the step size, and only void pointers cannot be decremented.

The line of code is basically two lines:

  (char*)hash_ptr.parm.v.p = (char*)hash_ptr.parm.v.p - 1; // move the pointer back by one byte
  *((char*)hash_ptr.parm.v.p) = fpop(sst); //At the memory location, write the output of fpop(sst)
page 1