Tag: programming

  • Garballed Attractors

    Waiting for a flight home, I stumbled across a Medium blog post on attractors. The example system seemed simple enough and I had some spare time coming up, so I thought I’d try to ape a demo.

    Below is my flawed reconstruction. It’s not an attractor, but similar to a spirograph.

  • Introduction to Computer Vision with Go I: Obnoxious Webcams

    Earlier this week I spent a morning listening to Ron Evan’s introduction to computer vision with Go course through Safari. Following my belief that every course should should have at least one project, I hacked up an application to deface images and webcam streams with hats: Lotsohats.

    The course walked through several GoCV example applications to apply filters to images and use deep-learning packages with pre-trained models for image classification. To me, it seemed like an obvious easy assignment was mimic a certain alcohol-advertising crowd-cam app used at the local hockey arena and drop hats on people in images.

    It was my first experience with Go, but the proof of concept took a morning to hack something together, learning Go unit testing and exploring the GoCV and Standard Go Library APIs along the way, and this morning was spent polishing, tweaking, and documenting. The Donovan and Kernighan Go book is also a good resource.

  • What Dat?

    Scraping the web for cheap transfer of database content to web pages, I got stuck on the number of products with the name WebDB, many essentially running something like SQLite backed by web local storage…. one of them drives Beaker Browser, a peer-to-peer web browser using DAT built upon Electron. The rabbit hole along my search to find a corporate IT alternative surfaced into a hacker community. So, what are DAT and peer-to-peer browsing?

    Share…. FTP or BitTorrent ish

    Dat is a peer-to-peer file-sharing protocol that builds a distributed directory to publically readable filesystems. There is a Node command-line implementation to share and clone directories and a NPM package for programatic access. Dat is similar to BitTorrent, but it’s lighter-weight, since Dat clients can choose to download and share portions of filesystems. The requirements are so minimal that Dat can even run from my Chromebook after a minor configuration twiddle and installation of python2, gcc, et al…. via pkg from Termux.

    The Dat Project has a tutorial to install Dat and install files. The TLDR; is

    • use npm to install dat (repeatedly until you satisfy all the gyp requirements),
    • run dat create to share a directory,
    • populate the directory with your stuff,
    • and run dat clone to access the directory elsewhere.

    If you want your files to persist beyond your terminal session, HashBase will host your data, the first 100MB is free. There’s a Dat podcast, DAT;Cast, with Dat enthusiasm and events from January 2018 onward.

    Interface…. _Browser_

    Dat ships with a web server, just run “dat sync –http“. More generally, running dat-gateway will bridge content to your browser, but now we’re back to server land. Beaker Browser merges a Dat node with a web-browser.

    What makes this a happy marriage? Along with providing basic editing tools, Beaker provides Dat to its rendered web applications. Without Beaker, a web app’s I/O is limited to HTTP or Websockets, which require a third-party adaptor (e.g. dat-gateway). I’ve failed at using a couple of Websocket-based approaches, much of the browser support is out of date, so I’d advise starting with Beaker or dat-node.

    Sadly, Beaker won’t run on most Chromebooks anytime soon. Beaker is built on Electron, which runs poorly on Google’s high-end PixelBook (only in development mode?), but not on lesser Chromebooks, and the Electron team turns away requests to accommodate Chrome OS. So this next step requires a lap or desktop computer…..

    How Dat…. A Sample P2P App

    Here’s a simple peer-to-peer application to support consensus: Cahoots! The basic idea is that each voting-bloc member controls and publishes her own ballot containing her opinion, notes, and optionally references to other bloc members she has invited. Each bloc member can traverse the web of references starting from a master or config ballot to listen for ballot updates and count the common opinions.

    { "displayName":
      "issueName":
      "participants": [
        
      ],
      "proposal":
      "notes": [
        [ 1531859696122, "I don't like cold soup"]
      ]
    }
    

    Entrance to the election is controlled through the write permission of the config ballot. Other ballots can contain additional invites, but we (each member, even) can choose to limit the entrance by the distance from the config.