20190706

neato videos

the whole channel is pretty great

there’s a lot of pushback against oop.

wait… you can just leave the web??

having recently gotten back into C programming, it’s not super hard to make object-oriented style structs and things. and after that, the weird naming conventions and abstraction layers you see in oop code make even less sense.

neato links

https://www.maizure.org/projects/decoded-gnu-coreutils/ – contains diagrams and explanations of how common utilities work under the hood.

https://userinyerface.com/ – crappy ui code samples.

https://heartbeat.fritz.ai/activestereonet-the-first-deep-learning-solution-for-active-stereo-systems-f52ed2c6cd2 – get depth maps from your stereo photos? what about from all those mannequin challenge videos from a couple years ago?

https://picolisp.com/wiki/?guiScripting – picolisp’s shipped-with gui.

https://picolisp.com/wiki/?interfacing – picolisp ffi, in case you want to use gtk instead.

https://bitbucket.org/iromero91/web.l/wiki/Home – url dispatch.

stupid computer tricks

here’s how you make an mvc controller in c:

#define CONTROLLER(fields,setup,validte,submit,view) setup(argc,argv,&fields) || validate(&fields) && submit(&fields) || view(&fields);

and here’s your associated main:

int main (int argc, char *argv[])
{
  MainData fields;
  CONTROLLER(fields,
             setup_main,
             validate_main,
             submit_main,
             view_main);
  return EXIT_SUCCESS;
}

Now you just need to make MainData, setup_main, validate_main, submit_main, view_main.

This definition uses || and && for flow-control, which is dependent on C’s execution model. Short-circuit operators were the cool thing to do in the 1970s, before the invention of “try.”

setup_main handles the “commandline arguments” passed into your controller method. It expects argc, argv to be in scope. You may oneday break out commands from all these controllers, and this enforces “message-passing” as the invokation method.

validate_main returns true if the fields are valid for processing.

submit_main returns true if view_main shouldn’t be called.

view_main only runs if the || is evaluated.