The Intellectual Wilderness There is nothing more useless than doing efficiently that which should not be done at all.

2020.09.22 14:23

Erlang: [Video redo!] Creating and running GUI apps with ZX

Filed under: Computing — Tags: , , , , , — zxq9 @ 14:23

I had a little bit of time to re-make a video on how to use ZX to create GUI applications. Hopefully the video demonstrates the basic use case well enough to make the purpose of the tool itself obvious.

Erlang: [ビデオ] ZXでGUIプログラムの作成と実行のしかた

Filed under: Computing,日本語 — Tags: , , , — zxq9 @ 14:22

2020.09.20 21:01

Erlang: [Video] Creating and running GUI apps with ZX

Filed under: Computing — Tags: , , , , , , , , — zxq9 @ 21:01

I had a little bit of time to make a video on how to use ZX to create GUI applications, but not enough time to do any post processing. Hopefully the video demonstrates the basic use case well enough to make the purpose of the tool itself obvious. (The audio isn’t great — hopefully I’ll have to either go back and dress that up a bit or make a better version of this video.)

2020.09.11 16:05

Hardware Development VS Software Development Budget Allocation

Filed under: Computing — Tags: , , , , , , — zxq9 @ 16:05

It is funny to me that hardware engineers are able to test the bejeezus out of essentially solved problems like how many keypresses a keyboard can take before mean operations to failure and document every minute aspect of their development, but software developers are pretty much prohibited from being given the time to document code.

In fact, it strikes me that hardware engineers’ actual job is to produce a specification from which hardware can be built, nearly always by people other than the engineers developing the product. That is to say, the product of the engineers’ labor is documentation.

The software developers, on the other hand, have the ability to document their product in coordination with its development, but are almost always forbidden from taking the time to do so, despite that documentation effort costing far less than the process hardware manufacturers have to go through to tool up a production line for a physical product.

This is a pretty insane state of affairs. If I could only show the public some of the chewed-to-crap, undocumented, wazoo code I’ve seen in production on closed source projects…

2020.09.9 12:51

Erlang: Barnsley’s Fern

Filed under: Computing — Tags: , , , , — zxq9 @ 12:51

A mathematician friend of mine asked me the other day whether we used many techniques from fractal theory in game development. I told her that I didn’t think so, at least not formally. She asked me if I had ever implemented “Barnsley’s Fern” (Wikipedia) and of course I never had. So she asked me to implement it and tell her what I thought.

Her plan seems to have been to get me to recognize that we do use techniques derived from fractal theory all over the place by implementing a famous fractal by hand myself. The plan worked: it was immediately obvious to me that Barnsley’s Fern makes use of a technique that is central to the way random map generators work in game development, but I had never realized this was actually from “fractal theory”, having stumbled on the technique myself because it was a useful shortcut to making game maps that were interesting and felt natural(ish).

Here is the interesting part of the code:

The interesting part about that is the fact that the plotting of points is actually a random function, not a concretely defined rotation of an existing pattern. The constants involved in the fern1-4 functions are found here:

My Barnsley’s Fern implementation is available on gitlab and can be run using either ZX or Vapor if you have ZX on your system. The most recent version as of this post, 0.1.2, uses OpenGL to render the image and seems to work much more reliably across platforms than the previous implementation using a WX graphics context (some versions of WX don’t like the way I drew the points). In Vapor you can select the version with the version drop box if you want to see the WX implementation:

Or you can run it directly from ZX using the command line with:
zx run barnsley_fern

Here is what the OpenGL version looks like at 100001 iterations:

The OpenGL interface allows you to rotate and move the image around a bit, though in v0.1.2 the center of rotation is a bit off center. Also, if you have more than a few hundred thousand points it becomes cumbersome to render repeatedly in animation because it is actually re-plotting each frame (I didn’t go to the trouble to plot the points to a buffer or texture and simply rotate that instead).

The previous version looks like this at the same number of iterations:

The coordinate systems are different for the two implementations, hence the difference in the direction of the curve.

Hanging around mathematicians lately has made me realize that there is a tremendous amount of higher math involved in a lot of what we do in programming, but that the mathematicians rarely talk to the computer science people, and computer science people are living on their own little planet with little connection to what actual developers are doing in industry (all of us little people just “trying to make it go”). Further, the semantic map of what words are used to mean what in which context is an absolute mess, so it takes some patience and explanation to understand what the other person is saying half the time if you are talking outside your tribe.

Keep the patience! Explain exhaustively! Listen carefully! It is so much more interesting when you have a chance to confer with people outside your tribe!

2020.09.3 15:35

Smart VS Wise

Filed under: Society — Tags: , , , , , , — zxq9 @ 15:35

A smart youngster and a crotchety old curmudgeon tended a farm together to feed their village. The crotchety old curmudgeon would only plant about half of the farm at a time, just enough to feed the village with a bit of margin for storage and enough left over to sell a bit to the caravan that would come by once a year.

The smart youngster wanted money. He was annoyed at the refusal of the crotchety old curmudgeon to maximize the area usage every season, and couldn’t understand why he wouldn’t allow them to try for three or four growing cycles across the year instead of just one or two.

One day the crotchety old curmudgeon finally died and the youngster got his chance. He planted everything he could everywhere he could, and he went even further: he put three seeds in each hole!

“Why not try for three times the crop from each unit?” he told himself, confident his smart plan would bring a tremendous bounty the likes of which the village had never seen.

The rains came and went, and the seeds started to sprout! But even though the whole farm sprouted at once, all that rose from the ground were stunted, sad, pale little shoots. No seeding occurred, no flowering, and no fruit or grain could be had from those stunted, sad, pale little shoots.

Half the village died that year and the smart youngster lost weight and fell deathly ill. He survived along with about half of the village, but just barely. Thankful to be alive but highly skeptical of smart, untested plans, he became well known for being quite a crotchety old curmudgeon.

2020.08.30 19:58

Erlang: R23.0 Doc Mirror Added

Filed under: Computing — Tags: , , , , , , — zxq9 @ 19:58

Erlang R23.0 docs have been added to the doc mirror list on the Erlang Stuff page.

2020.08.15 20:35

Building Erlang R23.0 on Debian/Ubuntu

Filed under: Computing,Science & Tech — Tags: , , , , , , , — zxq9 @ 20:35

As an update to my previous notes on building R22.2, my current notes for building Erlang R23.0 and installing ZX using kerl on a fresh system (Kubuntu 18.04 LTS) are below. The same instructions (or very nearly the same) should work for any Debian or Ubuntu version within a few years of 18.04 LTS.

sudo apt update
sudo apt upgrade
sudo apt install \
    gcc curl g++ dpkg-dev build-essential automake autoconf \
    libncurses5-dev libssl-dev flex xsltproc libwxgtk3.0-dev \
    wget vim git
mkdir vcs bin
cd vcs
git clone https://github.com/kerl/kerl.git
cd ..
ln -s ~/vcs/kerl/kerl bin/kerl
kerl update releases
kerl build 23.0 23.0
kerl install 23.0 ~/.erts/23.0
echo '. "$HOME"/.erts/23.0/activate' >> .bashrc
. ~/.erts/23.0/activate
wget -q https://zxq9.com/projects/zomp/get_zx && bash get_zx

[NOTE: ~/vcs/ is where I usually put “version control system” managed code and my backup and sync scripts know to never copy or update that one.]

And that’s that. If you’re on a full desktop installation some of the packages in the apt install [stuff...] may be redundant, of course (who doesn’t already have wget and git?), but that’s no big deal.

Day 30, Summary Data

Filed under: Fast Food Fighter — Tags: , — zxq9 @ 20:28

Unfortunately the digital data for days 28 through 30 was lost before I could write the final three days of posts. All data on hardcopy (food receipts, nutrition information and the final medical testing information) still exists and whatever was able to be scannable I have posted below. I’ll eventually format this into a table, but for now the images will have to do!

The results of my blood tests at day 0, day 15, day 30 and day 45 (15 days after returning to a normal diet) are posted below. McDonald’s did not have any significant effect on my blood levels, though working out at such a high intensity across the month certainly had some impact, though nothing unexpected according to the doctors.

The killer finding turned out to have nothing to do with health and everything to do with cost. McDonald’s is expensive! It cost me about $750 to eat at McDonald’s for one month — and I’m just one person! This explodes the myth that “poor people are fat because they have to eat at McDonald’s”. It appears more like that poor people who eat at McDonald’s are poor because they throw their money at nonsense luxuries like McDonald’s instead of saving it and cooking at home!

Blood work from 2009-05-09
Blood work from 2009-05-23
Blood work from 2009-06-09
Blood work from 2009-06-23
Vitals (body composition, etc.) scans from 2009-05-09 and 2009-05-23
Caloric intake and cost per day throughout the month.
~$750 for one person for one month! AH!

Day 29, More digital terror!

Filed under: Fast Food Fighter — Tags: , — zxq9 @ 20:17

Unfortunately the digital data for days 28 through 30 was lost before I could write the final three days of posts. All data on hardcopy (food receipts, nutrition information and the final medical testing information) still exists, so I can still present at least the performance data, but unless I can recover the workout bits I won’t be able to catalogue exactly what I did on these last three days in terms of workout.

This is a placeholder page just in case I am able to recover the data at some point.

« Newer PostsOlder Posts »

Powered by WordPress