stupid computer tricks

one of the exciting unix features that has survived the past several decades is the important command to render your terminal useless and force you to start over from last save, ctrl+s.

this default setting is not good, but exciting. strong emotions are evoked whenever switching from inferior operating systems, who program the user’s muscle-memory to hit ctrl+s on save, to places like vim in the terminal, which use <esc>:w.

to eliminate this feature, go to ~/.bashrc:

stty -ixon

turns out ctrl+s also does commandline searching, but only when you turn off the more-important “crash the terminal” feature that’s on by default.


neato links

http://alumni.cs.ucr.edu/~lgao/teaching/bison.html – lex/yacc prototyping setup. doesn’t actually work in ubuntu, and it’d be great to port to something easier-to-bootstrap from, like tcc.

https://www.gnu.org/software/bison/ – there are much better examples for your future main.y file, main.l file, main.c file, main.h file in here. calc, for example, just to prove it works.

then scrape out calc’s guts, init a repository, and do your prototyping.

blender python prototyping setup


pretty much the fastest you can get from zero to a blender scripting environment for rapid prototyping.


create file plugin.py

import bpy
class Plugin:
  def __init__(self):
  def go(self):
x = Plugin()

from the commandline

blender ide.blend

blender launches. delete the default cube.

set the timeline to the text editor pane.

pull the text editor window frame up so you have more room to read and write.

pull down your top window frame so you see the python result pane.

text editor – open – plugin.py

there are buttons to enable syntax highlighting and line numbers.

alt-s to save your script.

alt-p to run your script.

https://docs.blender.org/api/master/ – api documentation

20190701 followup:

https://www.tutorialspoint.com/awk/awk_basic_examples.htm – dae yacc and lex syntax look like awk?


neato tool

https://www.geeksforgeeks.org/awk-command-unixlinux-examples/ – suppose you want to take the .s file generated by gcc -S and port the remaining assembly output to s-expressions. you should expect to be able to process it line-by-line. there’s indented parts, for instructions and allocations, and unindented parts for location markers.

https://people.csail.mit.edu/jaffer/SCM.html – a scheme interpreter to target, perhaps?

on examination of the target language, it appears identifiers may not include starting-dots. changing all “.”s to “dot-“s helps. there’s also the problem of string literals in the text, but close enough for, say…

https://bellard.org/otcc/ – the tiny c compiler from the obfuscated c code contest.

https://renenyffenegger.ch/notes/development/languages/C-C-plus-plus/GCC/options/S_uppercase/index – gcc options, navigable.