20190615

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.

20190611

neato links

https://www.kernel.org/doc/html/v4.10/process/coding-style.html – linux kernel coding style guide.

This is a short document describing the preferred coding style for the linux kernel. Coding style is very personal, and I won’t force my views on anybody, but this is what goes for anything that I have to be able to maintain, and I’d prefer it for most other things too. Please at least consider the points made here.

summary

nice docbook format too… is there a theming guide for doctools css? let’s have a look.

http://www.sphinx-doc.org/en/stable/theming.html – sphinx doctools theming guide.

there may be style guides for other org tools i use…

https://www.mantisbt.org/wiki/doku.php/mantisbt:style_guide – mantis

HTML:

Do use HTML5

Do not use tables for layout. Tables may only be used when the content is actually table data.

Do not put business logic in the templates – Using PHPTAL templating engine will assist with security (automatically escaping strings to prevent XSS attacks), internationalisation and ease of template maintenance. The templates are valid XML documents and can be rendered directly in a web browser without needing to be parsed through the templating engine.

first thing. must be important.

https://codex.wordpress.org/WordPress_Coding_Standards – i mean, half the web uses this thing for some reason, instead of yanking out the useful parts and dropping them into something predictable. filters, for example, are lovely.

The WordPress coding standards have been moved to the Core Contributor Handbook:

first search result. i guess there’s a handbook now…

you can probably go to that link in archive.org for old versions’ documentation, in your wordpress archaeology projects.

https://archive.org/ – a pretty big public library. nice microfilm collection.

https://manpages.ubuntu.com/manpages/xenial/en/man1/man.1.html – output of “man man”, converted to an html format. i wonder if there’s links to doctools in here?

https://manpages.ubuntu.com/manpages/xenial/en/man1/manconv.1.html – open source file conversion util, btw.

https://assets.ubuntu.com/v1/vanilla-framework-version-1.8.1.min.css – there’s a framework called “vanilla” that provided an output point for something like manconv.

https://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_hacking.html – official guide for creating documentation

https://www.w3.org/TR/html401/ – world wide web spec for html4.01. goodness, do i have a lot of dusty old projects from my youth.

HTML 4 is an SGML application conforming to International Standard ISO 8879 — Standard Generalized Markup Language [ISO8879].

the publishing language of the World Wide Web

*grumble grumble*

https://peopleshader.com/media/js/domchanger.js – by the way, you need to add the namespace bit to get svg node editors working, then you can just basically code your ui’s in s-expressions.

https://codepen.io/xgundam05/pen/KjqJn – a lot of ideas from this went into media/js/page/node.js, which is the domchanger version.

https://codepen.io/xgundam05/pen/bNeYbb – v2 looks really nice.

might need to actually download the full sources and docs to “man” and have a look for pointers in there.

https://www.gnu.org/software/coreutils/ – the core of any old LOAF system. iirc, they used argv[0] to determine what command to execute, and just made a butt-tonne of softlinks to a single executable.

https://superuser.com/questions/130457/what-linux-fits-on-a-floppy-disk – the Small Linux Site is down? :'( that website was rad.

https://superuser.com/tags – might be a useful index. a lot of people have usually been where you’re at, on the internet, and asked right there out in the open.

https://cs.wmich.edu/~gupta/teaching/cs4850/sumII06/The%20syntax%20of%20C%20in%20Backus-Naur%20form.htm – i may have mentioned before, but this BNF grammar for C is fantastic for making code generators in scheme

this lecture series is pretty great

20190607

stupid computer tricks

objective

c# doesn’t appear to have shortcode arrays, but if you look under the hood of asp.net its xml support is pretty amazing. if it had both, there might be an excuse to port domchanger.js to c#. so let’s see if c# curly arrays can be treated like php-style shortcode arrays, or if the java-with-a-microsoft-accent world remains hopelessly verbose.

experimental aparatus

gnome-builder c# project that often compiles when you hit f5

hypothesis

something along the lines of

object[] jsonml = {"p",{{"style","background-color: red; color: yellow;"}},"hello world"};

after that, maybe put jsonml inside another object[] array with a different name, on its way through a tag generator.

and then you should get back the much more elegant and beautiful sgml representation:

<p style="background-color: red; color: yellow;">hello world</p>

although probably with extraneous whitespace, depending how lazy one gets with the tag generator. perhaps port that later, to dom elements, using the builtin dom api? \_(O_o)_/

sources of error

  • coding recreationally
  • blogging about code before its written

reproducibility

requires human readers. that’s not really a thing, if google analytics are any indication, so maybe start practicing seo techniques on rewrites of old posts?

20190607

neato links

https://code.gnucash.org/docs/MAINT/ – gnucash is open source, and they seem to have a promotion drive at the moment. the file format is understood by many actual accountants, and can be read by a relatively simple user interface.

if an autonomous application needs to record financial data, there are worse formats to use than the gnucash file format, since there already exist facilities and apis to record transactions, set up accounts internal to the project, and read the resulting numbers for reporting purposes. the hard parts for such a project involve rebuilding gnucash from sources, and then pulling out the parts that are needed for the specialisation.

https://code.gnucash.org/docs/MAINT/python_bindings_page.html – gnucash official python bindings.

https://builder.readthedocs.io/en/latest/ – recently some experiments were performed using gnome-builder. this is an ide in the sense that there is a code editor with syntax highlighting, a console, and the ability to hit f5 and run the project. there are a lot of plugins and modules already available to expand the substrate created by this project, and it creates incentives for the user to learn to create their own automation of annoying or inconsistent human tasks.

the hard part is, of course, understanding what gnome-builder is doing at any particular phase of operation. the error messages are as arcane as using the commandline directly, but at least the file listings are consistent with the files on disk. this appears to be a platform that rewards organization and automation.

https://nav.al/how-to-get-rich – “how to get rich” podcast. might just be a demonstration of the ability to create aphorisms.

20190601

stupid computer tricks

objective: rapid prototyping of localnet web services.

constraints:

  • single php file, index.php
  • really obvious path of execution
  • jquery, bootstrap and domchanger for the frontend
  • generate html tags in php using jsonml-like array shortcodes
  • easy paths to generalization and publishing release versions

index.php

here is some pseudo-php:

class PageController { 
    public function main() { 
       // handle a web request
    }
}
function url($path,$internal=true) { 
    // generate an internal url
}
// more utility functions
$x = new PageController();
$x->main();

everything else in the webroot can be expected to be a static file.

within the server configuration, having mod_rewrite enabled or not is a matter of coding discipline when coming up with url() calls. the typical apache2 configuration to get rewrite pointed at the server may look something like this:

<Directory /home/mike/sites/dev.internal.localnet/mantis299/>
 RewriteEngine On
 Require all granted
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^ /index.php?path= [L]
</Directory>

this tells apache to load the requested files, and otherwise pipe all other urls through /index.php in the webroot specified by the directory.

individual page controllers can probably be made with utility functions like base_controller($setup,$validate,$submit), with a body that looks something like:

function base_controller($setup=function() { }, $validate=function() { }, $submit = function() { }, $view = function() { }) {
    $context = $setup($_REQUEST);
    if($validate(&$context)) { $submit(&$context); }
    return $view($context);
}

public frontend

in the rest of the site, there are no php executables of any sort, but data for the user-agent to pick up and process. the directory structure would look something like

media/js - javascript library files
media/js/site.js - sitewide javascript utility library
media/js/page - page-specific javascript files
media/js/page/index.js - page-specific javascript file for /
media/js/page/user_login.js - page-specific javascript file for /user/login
media/css - css library files
media/css/page/ - page-specific css files, like the ones in /js/page/
media/css/site.css - sitewide javascript utility library

for the purposes of rapid prototyping, the javascript and css utility libraries should accumulate well-encapsulated and frequently-used features implemented in the page-specific javascript.

de-prototyping

when it comes to moving something from a prototype to a production-ready release, one of the steps is to get the environment around the project under control. with explicit referencing, a work breakdown structure of changes to implement becomes a matter of starting at main() and then working one’s way down the call tree to any other method or file that’s relevant to the task at hand.

when a prototype is built, it may be necessary to move the database connection strings or any other private materials to outside of index.php. perhaps include them in the web server configuration as environment variables accessible from within index.php.

another important consideration is version control history. while prototyping, one might leave all sorts of secrets lying around in the file, which may get picked up by version control and preserved for posterity. starting the release version with a new repository might be worthwhile.

neato links

https://patents.google.com/patent/US6285999B1/en – the patent for the low-cost starting point of a major search engine has expired. it may now be worth the effort to release a subscription-only pagerank-based search engine.

https://www.ebay.ca/sch/i.html?_nkw=control+unit – ebay sells used control units