similar-desc. slips (controls should look different)
mode slips (same controls, different meaning)
mistakes (=wrong plan/goal):
rule-based (right goal, wrong action)
knowlege-based (misdiagnosis)
memory-lapse
handle mistakes
rule-based: help beginners
knowledge-based: give documentation, search, collab.
memory-lapse: make info/state always visible
Designing
natural mapping:
controls on item itself
Controls as close as possible
Controls same spatial arrangement
(maybe culutre diff. e.g. left/right reading/driving)
minismise for error:
sensibility checks (telephone numerical?)
reversability (wrong click, go back! undo!)
make errors discoverable (use constraints e.g. conf. popup)
actions are not errors
support autocomplete approximation
avoid: ambiguity, unclear model, no feedback & interruptions
avoid: Featuritis, Matching competition, force newest tech
Design Principle
put operational knowledge in the world
use constraints (forcig, mapping etc.)
support interaction loop (discoverable, feedback, etc.)
2024-04-13
Taking a look at CSS size types
Relative
Relative to display itself:
10px
A pixel is the smallest unit on a display, that you are able to get a sharp 1px line. Thus relative to the used display. This includes images, so image-px. map to css-px, not display-px. In printing however 1px must be exactly 1/96th of an inch in all printed output. Thus px is a good unit to use, when requires alignment of text to images, or need for sharp x*1px
Relative to parent size:
10%
Relative to font size:
10em - font size
10rem - root font size
10ex - x height
Relative to viewed window:
10vw - view width
Absolute
Absolute (for printers):
10in
10cm
10pc
10mm
10pt
viewport meta tag
Now what does viewport="content="width=device-width, initial-scale=1.0" do? This is more or less legacy of old web and old small resolution mobile devices. Because there were no responsive websites early on, small screen devices would render the site based on a larger, more common desktop resolution. width=device-width sets the true width and initial-scale=1.0 zooms correctly. In the following you see 4 examples, rendered with Firefox Developer tools.
Examples:
No viewport meta tag:
Initial-width only:
initial-scale only:
Both:
2024-04-10
Stichpunkte zu "Das geheime Leben der Bäume"
This books has quite a few critics, but its a nice short read. Here some points to remember for me:
There might be a Wood Wide Web, plants communicating via biochemical signals, electrical signals, Duftstoffe, nutrial transfer.
Trees support each other in the forest via nutriant transfer.
If trees have time, they adapt and might thrive to the environment, even if its not their thought of habitat.
There are species of trees that have a kind of male/female distinction (8billiontrees.com)
Slow growing trees are long living trees.
Old trees create more biomass than younger trees. (journals.plos.org trees in tropical jungle: "In the last quarter of their lifetime trees accumulate on average between 39 percent (C. odorata) and 50 percent (G. glabra) of their final carbon stock.")
Forests are needed to get water inland via vapor, particals for water to condense and stop eroision. (Paper)
Vibrant redness may be an insect repellant (less vibrant more attraction for insects, cause maybe weaker; no consensus whether this is true).
Laubbaeume(100ma) jünger als Nadelbaeume (170ma)
Hunters also feed animals, so to have more to hunt. This may also damage the young forest trees, as they are eaten by hungry game. (This is quite complicated and depends on the laws of a country and your opinion/position.)
I really enjoyed the Kapitel "Straßenkinder".
In the end this emphasises the need for old growth forest/Urwald, leaving the forest to itself and treating trees not just as implict. (Especially the possible late biomass increase make me more skeptical of taking trees out, while also protecting it. Same goes for hunters. Both are also driven by economic incentives) However, many opinions he has are quite out there and could be presented much more objectivly, but it is not that kind of book.
Game Boy CPU has seven 8-bit GPRs: a, b, c, d, e, h, and l; of which a is accumulator; others ar paired bc, de,hl; a is technically af and can also hold 8bit, but f cannot be used alone
Flags: Z Zero flag/equal flag; N Addition/subtraction; H Half-carry; C Carry/larger/smaller
Reminder that two hex values, or rather a half-byte, is called a nibble.
Numerical prefixes: $-prefix means hexadecimal/0x, %-prefix is binary/0b
Gb uses tiles of 8x8 pixels for storing graphics/the tiles (with 256 possible 8x8 tiles). A tile map (mapping of tiles) for displaying the tiles. Very good explanation at huderlem.com/demos/gameboy2bppl
Gb-Image-Converter needs http to work for me. Click in top left corner to input a 36x36 image and convert to gb code
INCLUDE"hardware.inc"SECTION "Header", ROM0[$100]
jp EntryPoint
; Make room for the header
ds$150 - @, 0EntryPoint:WaitUntilVerticalBlankStart:ld a, [rLY]cp a, 144
jp c, WaitUntilVerticalBlankStart
ld [rLCDC], [LCDCF_OFF]; Copy the tile data
ld de, Tiles
ld hl, _VRAM9000
ld bc, TilesEnd - Tiles
call Memcopy
; Copy the tileMap
ld de, Tilemap
ld hl, _SCRN0
ld bc, TilemapEnd - Tilemap
call Memcopy
; Copy sprite tile
ld de, Player
ld hl, _VRAM
ld bc, PlayerEnd - Player
call Memcopy
; Copy ball tile
ld de, Ball
ld hl, _VRAM + $10
ld bc, BallEnd - Ball
call Memcopy
; Clean OAMRAM
ld a, 0
ld b, 160
ld hl, _OAMRAM
ClearOAMRAM:
ld [hli], a
dec b
jp nz, ClearOAMRAM
; Draw objects in AMRAM
; Player sprite
ld hl, _OAMRAM
ld a, 128 + 16ld [hli], a
ld a, 16 + 8
ld [hli], a
ld a, 0
ld [hli], ald [hli], a; Ball sprite
ld a, 0
ld [hli], a
ld a, 32 + 8
ld [hli], a
ld a, 1
ld [hli], a
ld a, 0
ld [hli], a
; Turn the LCD on
ld a, LCDCF_ON | LCDCF_BGON | LCDCF_OBJON
ld [rLCDC], a
; During the first (blank) frame, initialize display registers
ld a, %11100100
ld [rBGP], a
; initialize one of the object palettes, rOBP0
ld a, %11100100
ld [rOBP0], a
; Initialize global variables
ld a, 0
ld [wCurKeys], a
ld [wNewKeys], a
Main:
ld a, [rLY]
cp 144
jp nc, Main
WaitUntilVerticalBlankStart2:
ld a, [rLY]
cp 144
jp c, WaitUntilVerticalBlankStart2:
; move bullet down
;cp a, b sets C if a < b, and clears it if a >= b.
MoveBall:
ld a, 2
ld h, a
ld a, [_OAMRAM + 4]
add a, h
ld b, a
ld a, 160
cp a, b
jp c, MoveBallEnd
ld a, b
ld [_OAMRAM + 4], a
;check jump to top
ld a, [_OAMRAM + 4]
cp a, 159
jp c, MoveBallEnd
ld a, 0
ld [_OAMRAM + 4], a
;; add random x position
NewBallY:
call rand
ld a, 161
cp a, b
jp c, NewBallY
ld a, b
ld [_OAMRAM + 5], a
MoveBallEnd:
CheckCollision:
; First, check if the ball is low enough to hit player.
;get y of player and enemy
ld a, [_OAMRAM]
ld b, a
ld a, [_OAMRAM + 4]
cp a, b
; If the ball isn't at the same Y position as the paddle, it can't bounce.
jp nz, CheckCollisionEnd
; Now let's compare the X positions of the objects to see if they're touching.
ld a, [_OAMRAM + 5] ; enemy X position.
;right border of player, add this width to enemy
add a, 8
ld b, a
ld a, [_OAMRAM + 1] ; player X position.
;if enemy x > player x, else End
cp a, b
jp nc, CheckCollisionEnd
add a, 16 ; get player, but also added 8 for enemy right edge prev.
;if enemy x < player x, else End
cp a, b
jp c, CheckCollisionEnd
; player hit
ld a, 0
ld [_OAMRAM + 1], a
CheckCollisionEnd:
; Check the current keys every frame and move left or right.
call UpdateKeys
; First, check if the left button is pressed.
CheckLeft:
ld a, [wCurKeys]
and a, PADF_LEFT
jp z, CheckRight
Left:
; Move the paddle one pixel to the left.
ld a, [_OAMRAM + 1]
dec a
; If we've already hit the edge of the playfield, don't move.
cp a, 7
jp z, Main
ld [_OAMRAM + 1], a
jp Main
; Then check the right button.
CheckRight:
ld a, [wCurKeys]
and a, PADF_RIGHT
jp z, Main
Right:
; Move the paddle one pixel to the right.
ld a, [_OAMRAM + 1]
inc a
; If we've already hit the edge of the playfield, don't move.
cp a, 161
jp z, Main
ld [_OAMRAM + 1], a
jp Main
; Copy bytes from one area to another.
; @param de: Source
; @param hl: Destination
; @param bc: Length
Memcopy:
ld a, [de]
ld [hli], a
inc de
dec bc
ld a, b
;; Or checks if length is still left, by bitwise-or of bc
or a, c
jp nz, Memcopy
retUpdateKeys:
; Poll half the controller
ld a, P1F_GET_BTN
call .onenibble
ld b, a ; B7-4 = 1; B3-0 = unpressed buttons
; Poll the other half
ld a, P1F_GET_DPAD
call .onenibble
swap a ; A3-0 = unpressed directions; A7-4 = 1
xor a, b ; A = pressed buttons + directions
ld b, a ; B = pressed buttons + directions
; And release the controller
ld a, P1F_GET_NONE
ldh [rP1], a
; Combine with previous wCurKeys to make wNewKeys
ld a, [wCurKeys]
xor a, b ; A = keys that changed state
and a, b ; A = keys that changed to pressed
ld [wNewKeys], a
ld a, b
ld [wCurKeys], a
ret
.onenibble
ldh [rP1], a ; switch the key matrix
call .knownret ; burn 10 cycles calling a known ret
ldh a, [rP1] ; ignore value while waiting for the key matrix to settle
ldh a, [rP1]
ldh a, [rP1] ; this read counts
or a, $F0 ; A7-4 = 1; A3-0 = unpressed keys
.knownret
ret
;tiles we can select from in the mapping
;; https://www.huderlem.com/demos/gameboy2bpp.html
;; .33333.. -> 01111100 -> $7C
;; 01111100 -> $7C
;; Three tiles: black, white, gray
Tiles:
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF, $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $00,$00,$00,$00,$00,$00,$00,$00, $00,$00,$00,$00,$00,$00,$00,$00
DB $FF,$00,$FF,$00,$FF,$00,$FF,$00, $FF,$00,$FF,$00,$FF,$00,$FF,$00
TilesEnd:
;maps the tiles to the screen/background, all white
Tilemap:
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0,0,0,0,0,0,0,0,0,0,0,0
TilemapEnd:
;; Player just a black rectangle
Player:
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
PlayerEnd:
;; can also set it with values between 0 and 3
;; this is based on hardware.inc, symbols can be changed
Ball:
dw `00000000
dw `00033000
dw `00333300
dw `03333330
dw `03333330
dw `00333300
dw `00033000
dw `00000000
BallEnd:
;; declaring variables
SECTION "Input Variables", WRAM0
wCurKeys: db
wNewKeys: db
; RANDOM NUMBER GENERATOR
SECTION "MathVariables", WRAM0
randstate:: ds 4
SECTION "Math", ROM0
;; From: https://github.com/pinobatch/libbet/blob/master/src/rand.z80#L34-L54
; Generates a pseudorandom 16-bit integer in BC
; using the LCG formula from cc65 rand():
; x[i + 1] = x[i] * 0x01010101 + 0xB3B3B3B3
; @return A=B=state bits 31-24 (which have the best entropy),
; C=state bits 23-16, HL trashed
rand::
; Add 0xB3 then multiply by 0x01010101
ld hl, randstate+0
ld a, [hl]
add a, $B3
ld [hl+], a
adc a, [hl]
ld [hl+], a
adc a, [hl]
ld [hl+], a
ld c, a
adc a, [hl]
ld [hl], a
ld b, a
ret
Further points:
The OAMRAM doesnt have attributes, more like 16 flags, depending on how you use it. Here prenamed variables in WRAM0 are used
How to build the rom:
$ rgbasm -o hello-world.o hello-world.asm #create machine code (-o = output file)
$ rgblink -o hello-world.gb hello-world.o #links code with libs
$ rgbfix -v -p 0xFF hello-world.gb #adds final rom header data; -v adds gb license; pads the rom to valid size (idk more)
Create "symbols" for debuggung: rgblink -n main.sym main.o
2024-04-01
jar/AppImage as Ubuntu Desktop-App
This is a note to help me, when I want to add a .jar or .appimage to my Desktop and call it like normally installed .deb packages:
Create a file example.desktop with the following content:
[Desktop Entry]
Name=Example
Comment=The application does example
Exec=/home/username/example/example.appimage
Icon=/home/username/example/example.png
Type=Application
Terminal=false
Then call desktop-file-validate and desktop-file-install on this file. Now you find this app in the startup menu.
If you want to associate such an app with a file ending you need to edit ~/.local/share/applications/mimeapps.list (at least in Ubuntu) and add a line to the file. Use the existing associations as example.
If you want to call this program via terminal, a simple alias should suffice. Use the ~/.bash_profile or /etc/profile and add alias example="/home/username/example/example.appimage".
Interesting Words in Japanese
While learning any language you always find interesting words, that don't have a translation or have a interesting historical backround:
バタ臭い, Battakusai, smelling of butter or more generally Western-influenced;
The Japanese used this term after WW2, when the USA gave the Japanese a template of a consitution (which "smelled like butter"). The Japanese then used the consitution as is, apparently because of the language barrier. (Note: The term itself predates this use)
Source: This was a story from a Japanese teacher at Tohoku Universtity. I can only find a Japanese source: 「。。。新憲法ではバタ臭いような表現が多いのです。。。」 which translates to something like "the expression 'new constituion reeks of butter' was used often". (Didn't read everything, don't know the page, little shady because nikkey != nikkei)
恥の文化, haji no bunka, culture of shame;
罪の文化; tsumi no bunka; culture of blame;
When studying in Japan I also talked with my friends about Japanese vs German culture. There I learned the japanese distiction between a culture of shame and a culture of blame, especially in regards to the WW2 "Aufarbeitung".
円本, enpon, Yen-books;
Reading the manga コミック昭和史/Comic Showa I learned that in 1926 someone created cheap books, that cost just one Yen, were thus called and were a symbol of the growing middle class and education of the poeple. (Also 円タク entaku yen-taxi, same for Taxis, very short-lived)
Stichpunkte zu "Scount Mindset"
Here some points to remember for me:
"Can I believe it?" vs. "must I believe it?"
Objectivity/Knowledge != Scout, but self-change/empathy
Accept and quantify uncertainty/odds/chances
Honest coping: Make a plan and accept problems, see silver linings; Things could be worse
Learn to change/update your thoughts, lean into confusion as targets to map
Your communities shape your identity
Ancient Egpytian "Appeal to the living"
Egyptian Middle Kingdom common Tombstone engraving, and excerpt from the "Book of the Dead", called "appeal to the living" and part of it conatins: As you love to live and hate to die.
source: @DigItWithRaven
The Rime of the Ancient Mariner & The Wanderer
After listening to Tokiens reciting of The Ride of the Rohirim, I was looking more into the Rohirim and stumbled over the poem The Wanderer in this article.
Additionally somehow I found the more modern poem Ancient Mariner, which felt similar, including the great interpretation of Iron Maiden.
Hominin & Culture timeline
Two HackerNews comments have this great little list of the human culture timeline and hominin timeline in general:
7-6 million years ago: Possible divergence of the lineage leading to humans from the lineage leading to chimpanzees and bonobos (our closest living relatives).
Ardipithecus kadabba (~5.8-5.2 million years ago)
Ardipithecus ramidus (~4.4 million years ago)
Australopithecus anamensis (~4.2-3.9 million years ago)
Australopithecus afarensis (Lucy) (~3.9-2.9 million years ago)
Kenyanthropus platyops (~3.5 million years ago)
Australopithecus africanus (~3.3-2.1 million years ago)
Paranthropus aethiopicus (~2.7-2.3 million years ago)
Australopithecus garhi (~2.5 million years ago)
Paranthropus robustus (~2-1.2 million years ago)
Homo habilis (~2.1-1.5 million years ago)
Homo rudolfensis (~1.9 million years ago)
Homo ergaster/Homo erectus (~1.9 million years ago - ~143,000 years ago)
Paranthropus boisei (~1.7-1.1 million years ago)
Homo heidelbergensis (~700,000-300,000 years ago)
Homo naledi (~335,000-236,000 years ago)
Homo neanderthalensis (Neanderthals) (~400,000-40,000 years ago)
Denisovans (around 300,000-50,000 years ago)
Homo sapiens (modern humans) (~300,000 years ago to present)
Oldowan industry - simple flaked stone tools (~2.9-1.7 million years ago)
Acheulean industry - advanced tools like hand axes (~1.7 million - ~160,000 years ago)
Archaic humans in Southeast Asian islands like Indonesia (~1.8-1 million years ago, dating is a bit uncertain on this one)
First control of fire (~1 million - ~700,000 years ago)
First archaic humans living in colder climates like Atapuerca, Spain (~800,000 years ago)
First wooden spears denoting a change in hunting tech (~400,000 years ago)
Widespread control of fire (~400,000 years ago)
==> First homo sapiens <== (~300,000 years ago)
First neanderthals arrive in Europe (~230,000-150,000 years ago)
First use of ochre pigment for symbolic purposes (~190,000 years ago)
Body lice genetically diverge from head lice due to clothing (~170,000 years ago)
Mousterian industry - points, scrapers, denticulates, notches, and awls (~300,000-40,000 years ago)
First time eating seafood at Pinnacle Point (~150,000 years ago)
Humans start collecting and using shell beads (~130,000 years ago)
First heat treated material - silcrete (~110,000 years ago)
First compound adhesive leads to tar-hafted tools (~100,000 years ago)
First bed (~77,000 years ago)
First bow and arrow in Sibudu (~72,000–60,000 years ago)
Arrival in Australia (and thus first boat?) (~70,000-65,000 years ago)
First musical instrument (flute) (~60,000 years ago)
First burial ritual at Shanidar Cave (~60,000 years ago but controversial)
First sewing needle (~45,000 years ago)
Aurignacian industry - true homo sapien tools like microlithics, blades, projectile points, pressure flaking, split-base bone points (~43,000-26,000 years ago)
Gravettian industry - Bow and arrow, harpoons, and darts come into their own (~33,000-22,000 years ago)
Solutrean & Magdalenian industry - flint tools, cave art, etc. (~22,000-12,000 years ago)