Smalltalk: Step 2

Richard Kenneth Eng’s article recommended Learn Smalltalk with ProfStef, which was easy to follow even without full concentration. I wanted to try gnu smalltalk next, but unfortunately it was not yet available for Apple chips. Given that Pharo is available on Mac, the best next step is probably Pharo by Example 9 (updated 2022), which is freely downloadable here.

July 13, 2024

Max Datom levels 1 to 5

I heard about this game in a Clojure dojo and wanted to give it a spin. It is an interactive tutorial of Datomic, a databse assoicated with Clojure. While it is not a technology I am likely to use, the story line was engaging and I ended up spending a morning on it. My takeaway from levels 1 to 5 is the truism that, in broad outlines, database systems need to fulfill the same kind of tasks....

July 12, 2024

Notes on my first Clojure Dojo

Doing 4clojure for 2 hours, from problem 1 to problem 21 (nth element). 1 Everything is an expression in clojure. So are there any statements? 2 On the command line, `(6 7 8) is not the same as (6 7 8) because it is not evaluated. Similiar for :a versus a. 3 Searching and parsing the following expressions: (for [i (range 1 5)] i) (for [i (range 1 5)](* 2 i)) (do (for [i (range 1 5)](* 2 i))) (doall (for [i (range 1 5)](* 2 i))) (print (for [i (range 1 10)](* 2 i))) 4...

July 10, 2024

Smalltalk and Clojure: quick start

Before attending a Smalltalk meetup and a Clojure dojo this week, I spent the morning getting to the “hello world” stage with these languages. Smalltalk After watching Bernat Romagosa’s video, I chose the Pharo variety of Smalltalk. I then followed Richard Kenneth Eng’s tutorial to dip my toe into the Pharo IDE, itself written in Smalltalk. Clojure Having flipped through the first chapters of Brave Clojure before, I was aware of the significant set-up costs....

July 9, 2024

Random HTML Attribute

I spent last evening and this morning playing around with Andrew’s Random MDN page. The result is a remix, Random HTML Attribute. Looking through my old commits, here are main hurdels along the way:- The MDN webpage used in the original project is no longer actively maintained: see web archive version here. I therefore needed to look for an alternative page with a similiar structure. There were a few candidates but in the end I settled on this page....

July 8, 2024

From Passport.js to Project Mood: diary of a day's reading

1 Passport.js I started the day with the excellent “Concept” section of the documenation for Passport.js, a tool for adding user authenticiation with Express.js. I have been reading into the documentation for MongDB and Mongoose recently. The trouble with them (as of 2024) was that there was a very steep jump between the very simple quick start example and the full documenation. This made getting to grips with the materials very difficult: especially because Mongoose is a kind of “wrapper” around MongoDB native driver, and when I search for how things are done, search results often use two different sets of terms....

July 7, 2024

Pupeteer

1 Well thought-out side projects Despite some misgivings that I am veering away from my cirriculum, and more generally that there is such an ocean of talent out there, I spent much of Sunday exploring Andrew Healey’s projects on his website. The main reason is that they are just so well thought-out and explained! For example, one of his side projects is this website which (1) gets your location from your IP address and (2) plays you a soothing song if (and only if) it is raining in your locality....

July 7, 2024

Schema and Model in Mongoose (1 of 2)

The point of Schema Initially I was surprised that the code below logs anything out at all. const uri = process.env.DB_URL; const port = process.env.PORT || 3000; const localTest = "mongodb://127.0.0.1:27017/test" const express = require("express") const mongoose = require("mongoose") const app = express() app.use(express.static("public")) main().catch((err) => console.log(err)) async function main() { await mongoose.connect(localTest) } // There is no "goingCrazy" property in Kitten // There is instead a "name" property of the type String....

July 1, 2024

Schema and Model in Mongoose (2 of 2)

So the point of Schema is to define what properties can be read. The point of model is instead to define what collection is read. Try const uri = process.env.DB_URL; const port = process.env.PORT || 3000; const localTest = "mongodb://127.0.0.1:27017/test" const express = require("express") const mongoose = require("mongoose") const app = express() app.use(express.static("public")) main().catch((err) => console.log(err)) async function main() { await mongoose.connect(localTest) } // There is no "goingCrazy" property in Kitten // There is instead a "name" property of the type String....

July 1, 2024

Self-cultivation for Web Full-Stack Engineers (2015): a review

Free Chinese language excerpts released by the author here. A point which really caught my eye was the author’s reaction to the Non-Designer’s Design Book by Robin Williams. In fact, this is how the author caught the eye of his interviewer for his first employer, Tencent, 我说这些作品都是我先在白纸上手绘——主要是彩色铅笔——然后用照相机拍下来,放到ps里处理一下对比度什么的,就作为一个设计了,然后还有自己喜欢的专辑里的一些元素,然后还考虑了色彩,还有一些信息的对齐之类的, 其实我的设计知识仅限于看的一本书《写给大家看的设计书》。这本书非常棒,到现在为止我都反复看了3遍以上,因为约书亚树原理说的是,当你对一个概念的名字很熟悉的时候,当你看到这个概念,就会马上意识到,而不是无意识的一晃而过。然后我就提到了书里说的设计的四大原则:对齐、对比、距离和重复,面试官表示很有兴趣。 (Rough translation: I first hand-drawed these works on white paper - mainly colored pencils - and then photographed them with a camera, put them in Photoshop to process the contrast and so on, and then used them as a design, and then included my favorite albums…...

June 17, 2024