@bijumon

Github - Exercism - blog

mmmnnnmmm - Gwern - Matt Might - tim rodenbröker - The Coding Train - CG Cookie


frontpage - Welcome

Python docs - Tutorial - Data Structures - Stdlib - Pathlib - Argparse - Errors and Exceptions - Built-in Exceptions - unittest - Markdown


Blender

  1. Fundamentals v2.8 from Blender Foundation- YouTube
  2. Blender 3 basics: Intro to Blender - Learn Blender | Online 3D tutorials with CG Cookie
  3. Blender 3.0 Basics Course - CG Cookie - YouTube
  4. Blender Modeling Tutorials - CG Cookie - YouTube
  5. Blender 3.0 Beginner Donut Tutorial - Blender Guru - YouTube
  6. Learn Blender 3 for Complete Beginners - Grant Abbitt - YouTube
  7. Blender 3.0 - Jayanam - YouTube
  8. Blender 10 Minute Modeling Challenge - Imphenzia - YouTube

  9. Blender Developers - YouTube

  10. Blender Daily - YouTube

Paid


python exercises from Exercism

"Hello, World!" is the traditional first program for beginning programming in a new language or environment.

The objectives are simple:

def hello():
    return 'Hello, World!'

Guido's Gorgeous Lasagna

You have five tasks, all related to cooking

  1. Define expected bake time in minutes

Define an EXPECTED_BAKE_TIME constant that returns how many minutes the lasagna should bake in the oven. According to your cookbook, the Lasagna should be in the oven for 40 minutes:

>>> import lasagna
>>> lasagna.EXPECTED_BAKE_TIME
40
  1. Calculate remaining bake time in minutes

Implement the bake_time_remaining() function that takes the actual minutes the lasagna has been in the oven as an argument and returns how many minutes the lasagna still needs to bake based on the EXPECTED_BAKE_TIME.

>>> from lasagna import bake_time_remaining
>>> bake_time_remaining(30)
10
  1. Calculate preparation time in minutes

Implement the preparation_time_in_minutes() function that takes the number of layers you want to add to the lasagna as an argument and returns how many minutes you would spend making them. Assume each layer takes 2 minutes to prepare.

>>> from lasagna import preparation_time_in_minutes
>>> preparation_time_in_minutes(2)
4
  1. Calculate total elapsed cooking time (prep + bake) in minutes

Implement the elapsed_time_in_minutes() function that has two parameters: number_of_layers (the number of layers added to the lasagna) and elapsed_bake_time (the number of minutes the lasagna has been baking in the oven). This function should return the total number of minutes you've been cooking, or the sum of your preparation time and the time the lasagna has already spent baking in the oven.

>>> from lasagna import elapsed_time_in_minutes
>>> elapsed_time_in_minutes(3, 20)
26
  1. Update the recipe with notes

Go back through the recipe, adding notes and documentation.

def elapsed_time_in_minutes(number_of_layers, elapsed_bake_time):
    """
    Return elapsed cooking time.

    This function takes two numbers representing the number of layers & the time already spent 
    baking and calculates the total elapsed minutes spent cooking the lasagna.
    """

Solution

"""Functions used in preparing Guido's gorgeous lasagna.

Learn about Guido, the creator of the Python language: https://en.wikipedia.org/wiki/Guido_van_Rossum
"""

EXPECTED_BAKE_TIME = 40

def bake_time_remaining(elapsed_bake_time):
    """Calculate the bake time remaining.
    :param elapsed_bake_time: int - baking time already elapsed.

    :return: int - remaining bake time (in minutes) derived from 'EXPECTED_BAKE_TIME'.

    Function that takes the actual minutes the lasagna has been in the oven as
    an argument and returns how many minutes the lasagna still needs to bake
    based on the `EXPECTED_BAKE_TIME`.
    """

    return EXPECTED_BAKE_TIME - elapsed_bake_time

def preparation_time_in_minutes(number_of_layers):
    """
    Return minutes spent making the recipe

    This function takes a number representing the number of layers added to the lasagne
    """

    preparation_time = 2
    return preparation_time * number_of_layers

def elapsed_time_in_minutes(number_of_layers, elapsed_bake_time):
    """
    Return elapsed cooking time.

    This function takes two numbers representing the number of layers & the time already spent 
    baking and calculates the total elapsed minutes spent cooking the lasagna.
    """

    return preparation_time_in_minutes(number_of_layers) + elapsed_bake_time

Road to Lisp

learning functional programming in a LISP

I'm trying to learn and understand functional programming, i.e traveling on the road to lisp.

scheme is a dialect of lisp #toto

Racket is a scheme descendant ... DrRacket is a REPL, editor

How to Design Programs

HtDP and Racket

@Matthew Butterick - Beautiful Racket

SICP by abel and sussman ...

Structure and Interpretation of Computer Programs, 2e: Chapter 1

SICP and Racket

Steve Losh - A Road to Common Lisp


April 2024

devsec hardening framework

ansible roles to harden a server

testing with linode vps and debian VM

protecting a server with ufw, fail2ban

https://wiki.crowncloud.net/?How_To_Protect_SSH_With_Fail2Ban_on_Debian_12

sysadm - last and lastb commands

https://ioflood.com/blog/last-linux-command/

12 security tools for linux

lynis, rkhunter, chrootkit etc

https://geekflare.com/linux-security-scanner/

docker on debian

https://docs.docker.com/engine/install/debian/

explain docker's container filesystem

https://www.baeldung.com/ops/docker-container-filesystem

docker volumes guide with examples

https://spacelift.io/blog/docker-volumes

docker port mapping

https://medium.com/@AbbasPlusPlus/docker-port-mapping-explained-c453dfb0ae39

Docker cleanup: How to remove Images, containers, and volumes

https://middleware.io/blog/docker-cleanup/

pandoc on docker

https://hub.docker.com/r/pandoc/minimal/tags https://github.com/pandoc/dockerfiles

caddy webserver on docker

https://www.howtogeek.com/devops/how-to-deploy-a-caddy-web-server-with-docker/

jupyter on docker

https://jupyter-docker-stacks.readthedocs.io/en/latest/ https://quay.io/repository/jupyter/docker-stacks-foundation?tab=tags

python

vim and motions is awesome

https://levelup.gitconnected.com/vim-is-not-about-speed-88968ae4283c

meow editing

https://lobste.rs/s/lb2eld/switching_meow_modal_editing_system_from

bash - looping over files with spaces

https://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html

nvimpager instead of less/more

https://github.com/lucc/nvimpager

anki on arch linux

https://aur.archlinux.org/packages/anki-bin https://aur.archlinux.org/packages?K=anki

if inheritance is so bad, why does

everyone use it https://stackoverflow.com/questions/1871549/how-to-determine-if-python-is-running-inside-a-virtualenv

dotfiles digest - git

https://adrg.se/blog/dotfiles-digest-git

on being bipolar

https://news.ycombinator.com/item?id=24670966

fraidycat

https://fraidyc.at/

alf's room

https://alf-s-room.com/ https://alf-s-room.com/etc/nandarou/binbows/binbows_english.htm

explain bloom filters

https://samwho.dev/bloom-filters/ also: what is hashing https://samwho.dev/hashing/

activitypub server in a single php file

https://shkspr.mobi/blog/2024/02/activitypub-server-in-a-single-file/

FSRS - efficiat spaced repetition

https://news.ycombinator.com/item?id=39002138


Unity game engine

Unity game engine






Longreads June 2023

Python Tricks: The Book

Sculpting a Python function - by Nobody has time for Python

Data Classes in Python 3.7+ (Guide) – Real Python

Make your own Tower Defense Game with PyGame • Inspired Python

Malcolm Gladwell and William Cohan on What Really Happened to GE

Life Lessons After 10 Years of BetterExplained.com – BetterExplained

‘Story Of Your Life’ Is Not A Time-Travel Story · Gwern.net

What “Drive My Car” Reveals on a Second Viewing | The New Yorker

'Drive My Car' and 'Uncle Vanya': How Intertextuality Enriches a Film


May, 2023

Creating Isometric RPG Game Backgrounds - using Stable Diffusion techniques to create 2D game environments

Game Design Logs – LOSTGARDEN

Great game development is actively harmed by this assumption. Pre-allocating resources at an early stage interrupts the exploratory iteration needed to find the fun in a game. A written plan that stretches months into the future is like a stake through the heart of a good game process. Instead of quickly pivoting to amplify a delightful opportunity found during play testing, you end up blindly barreling towards completion on a some ineffectual paper fantasy.

A Skeleton Key to Ali Smith's Artful — The Airship, from the Wayback machine

The most beautiful thing about Ali Smith’s book Artful — at once a series of real-life Oxford lectures and a metafictional post-love story — is the way she carries us through her unnamed narrator's emotional progression

The Guardian review, theliterarysisters, #AliSmith

Google - We Have No Moat, And Neither Does OpenAI, discussion at Hacker News

Leaked internal document claims open-source will outcompete Google and OpenAI the uncomfortable truth is, we aren’t positioned to win this arms race and neither is OpenAI. While we’ve been squabbling, a third faction has been quietly eating our lunch.

Development notes from xkcd's Gravity and Escape Speed #gamedev

Escape Seed is a large space exploration game created and drawn by Randall Munroe.

This was one of the most ambitious — and most delayed — April Fools comics we’ve ever shipped. The art, physics, story, game logic, and render performance all needed to work together to pull this off. We decided to take the time to get it right.

The game is a spiritual successor to last year’s Gravity space exploration comic. Our goal was to deepen the game with a bigger map and more orbital mechanics challenges to play with.

Andreas Fragner - Writing summaries is more important than reading more books

Ted Chiang's essay - Will A.I. Become the New McKinsey?, comments from Schneier on Security. previously, Ted Chiang - ChatGPT Is a Blurry JPEG of the Web

Out of Sir Vidia’s Shadow, Paul Theroux @LRB


Sparks

Vocabulary trainer game in python? tui? flask? use data from Wiktionary:Extended Basic English alphabetical wordlist

godot4 clone Platformer Toolkit as an exercise

Cowboy shoots at aliens in pygame 2D

tutorials - pygame wiki

Working through the books on precalculus, pi, gamma, e, in jupyter.

Writing Math Equations in Jupyter Notebook: A Naive Introduction | by Abhay Shukla | Analytics Vidhya | Medium

Create youtube shorts - jupyter math equations - vscode python - installing - debugging - testing - jupyter

AI for Beginners

Tried the Google Machine Learning Crash Course : r/learnmachinelearning

reviews and comments on the course

Godot 4.0 sets sail: All aboard for new horizons

Learn to Make Games · GDQuest

Minimal NES

Godot engine got updated to v4. make a few tiny games? digdug, space invaders, moon buggy etc. use the 'Minimal NES' designs for inspiration

Working through Knuth's AoCP

Knuth, AoCP and MIX


gaming

Disco Elysium has stopped working. The game freezes on loading. A solution is to install a custom build of proton, GloriousEggroll/proton-ge-custom. It has FFmpeg enabled for FAudio, patches from wine-staging and Vulkan for Direct3D (VKD3D).

Download a release

mkdir -v ~/.steam/root/compatibilitytools.d/
tar -xf Proton-7.2-GE-2.tar.gz -C ~/.steam/root/compatibilitytools.d/

Civilization IV needs xml dll's to work with steam proton.

$ protontricks 8800 vcrun2003 msxml3 corefonts lucida tahoma fontsmooth=rgb

civ4 beyond the sword


Longreads 2022

Crossing the Blood Meridian: Cormac McCarthy and American History

The 'Dead-Internet Theory' Is Wrong but Feels True - The Atlantic

An app can be a home-cooked meal

Ian Rankin on Patricia Highsmith’s hunger for love and thought

Arundhati Roy, novelist with a sting

Benyamin on how he became a writer

Did I invade? Do you exist?

Lavender in a drawer


things to do

2023 May 29 09:03 IST

I've been playing WOS - Words On Stream on the twitch app. I suck at it because my vocabulary is pathetic.

How to improve my vocabulary and get better at this game?

A good place to start would be Wiktionary:Extended Basic English alphabetical wordlist - Simple English Wiktionary.

I need to keep notes on my reading and write summaries. see Writing summaries is more important than reading more books


Longreads 2021

The Truth, by Stanisław Lem | The MIT Press Reader by Stanisław Lem, translated by Antonia Lloyd-Jones

Lem's 1964 story, published in English for the first time, tells the tale of a scientist in an insane asylum theorizing that the sun is alive.

The meditative empathy of Susanna Clarke’s Piranesi - Vox by Constance Grady

There is something meditative about watching Piranesi live, the purity of his life and the kindness of it. And Piranesi’s kindness is possible in part because he lives in such communion with the House, which is his world. He respects the House and knows how to live within it, and in turn the House blesses him with its bounties.

The Sellout won the Booker Prize. This blistering passage on white male privilege shows why. - Vox by Constance Grady

In the end we found it impossible to ignore the impassioned pleas of the Lost City of White Male Privilege, a controversial municipality whose very existence is often denied by many (mostly privileged white males). Others state categorically that the walls of the locale have been irreparably breached by hip-hop and Roberto Bolaño’s prose ...

9 Fictional Friendships that Explore Male Intimacy - Electric Literature by Jackson Frons

At the fulcrum of Roberto Bolaño’s kaleidoscopic epic Savage Detectives, are the poets Ulises Lima and Arturo Belano, the author’s alter ego. The mysterious leaders of the Visceral Realists, drift through Spain, Israel, North Africa, and Mexico sharing an unspoken and often inscrutable bond as they phase in and out of contact

‘Heartbreak is part of doing anything you want to do’ | Paul Beatty | The Guardian, Kate Kellaway interviews Paul Beatty

You are wary of other people’s questions. What questions do you ask yourself?

I don’t ask myself big questions. I’ve a friend who was struggling, saying: “I don’t know why I am here… what is the purpose?” I said: “There is no purpose.” If there were a purpose, then I would be frozen.

Considering the Novel in the Age of Obama by Christian Lorentzen

Environmental despoliation, economic regression, and enthroned sexism and bigotry are already on the cards. For all the turmoil on our streets and abroad, literary historians may look back at the Obama years as a time of tranquility ...

Joan Didion: Only Disconnect Off Center: Essays by Barbara Grizzutti Harrison (1980).

I am disinclined to find endearing a chronicler of the 1960s who is beset by migraines that can be triggered by her decorator's having pleated instead of gathered her new diningroom curtains. These, and other assorted facts -- such as the fact that Didion chose to buy the dress Linda Kasabian wore at the Manson trial at I. Magnin in Beverly Hills -- put me more in mind of a neurasthenic Cher than of a writer who has been called America's finest woman prose stylist.

A Premature Attempt at the 21st Century Canon | Vulture by Vulture Editors

A panel of critics tells us what belongs on a list of the 100 most important books of the 2000s … so far.

discussion at MetaFilter

The World According to Peter Thiel - Erik Torenberg's Thoughts

His claim is that we've had this narrow cone of progress around the world of bits—around software & IT — but not atoms. The iPhones that distract us from our environment also distract us from how strangely old & unchanged our current environment is. If you were to be in any room in 1973, everything would look the same except for our phones. This explains his old Founders Fund tagline: “We wanted flying cars, instead we got 140 characters.”

Zooming out, people don’t understand how important economic growth is. It’s the only thing sustaining the planet. Without it, we go into a malthusian war. Indeed: The only way our societies have worked for at least 250 years is by economic growth. Parliamentary democracies are built on an ever-expanding pie that they can continue subdividing. Once the pie is no longer expanding, everything turns zero-sum.

Cyberdecks For High-Tech Low-Lifes - The Dork Web

The term “Cyberdeck” was first coined in Gibson’s 1984 literary masterpiece, Neuromancer. He rewrote parts of Neuromancer several times after the release of Ridley Scott’s Blade Runner. Blade Runner was based on Philip K. Dick’s 1968 novel Do Androids Dream of Electric Sheep. Scott, Dick, Brunner’s The Shockwave Rider, Goddard’s Alphaville and work by futurists such as Syd Mead and Moebius make the title of “father of Cyberpunk” hard to hang on Gibson alone. But he’s clearly a very important character in the development of Cyberpunk culture.

Just as Shakespeare brought in new words to describe new worlds, 1980s Gibson is Cyberpunk’s Great Bard. The Cyberdeck is just one of Gibson’s literary gifts. It’s the tool that lets Console Cowboys jack into the Matrix of Cyberspace and start hacking.

The anthropologist in an economist world - Altered States of Monetary Consciousness

Anthropology starts from the recognition that a person - in the first instance at least - cannot exist apart from a group. Put differently, anthropology assumes that a human network always precedes its individual members, and that care and reproduction precede any form of solo heroics. Human babies don’t survive long if they are left to fend for themselves, and - even if they miraculously survived without others - they would not be able to speak language, which would make all future social interaction, relationships and trade near-impossible.

The age-old strategy of buying cheap shares is faltering - Hacker News

the article is behind paywall, but the discussion at HN is interesting (premii)

Why You Should Use Component-Based Design in Unity

Let’s say that any weapon will have a component for damage, range, and projectiles (optional). Using Unity’s UI, you could create a weapon by dragging these components onto any GameObject and customizing the values of each one. Then, if the way projectiles are handled changes further into development, all you need to do is change one script, and all your weapons’ functionalities will be updated instead of just those defined at one level of a tree.


yay the AUR helper

Yay is a command-line tool to install and manage software from the Arch User Repository. It is included in the community repository of Manjaro Linux.

> pacman -Ss yay
community/yay 10.0.4-1
    Yet another yogurt. Pacman wrapper and AUR helper written in go.

> sudo pacman -S yay
> man yay
> yay --help

# upgrade system
> yay -Syyu 

# remove stale packages
> yay -Qdt
> yay -R $(yay -Qdtq | xargs)

# cleanup
> yay -Sc --noconfirm

# edit PKGBUILD
> mkdir ~/AUR_local && cd ~/AUR_Local
> yay --getpkgbuild julius-game
:: Querying AUR...
:: Downloaded PKGBUILD (1/1): julius-game
> ls julius-game/
total 12K
-rw-r--r-- 1 user0 user0  173 Sep 22 11:04 julius-game.desktop
-rw-r--r-- 1 user0 user0  145 Sep 22 11:04 julius-game.install
-rw-r--r-- 1 user0 user0 1.4K Sep 22 11:04 PKGBUILD
> cd julius-game
> vi PKGBUILD
> makepkg -si

# show foreign packages
# i.e those not belonging to official repos
# yay -Q --foreign
> yay -Qm

# info about AUR package
> yay -Si ktlint
:: Querying AUR...
Repository      : aur
Name            : ktlint
Keywords        : None
Version         : 0.38.1-1
Description     : An anti-bikeshedding Kotlin linter with built-in formatter
URL             : https://ktlint.github.io/
AUR URL         : https://aur.archlinux.org/packages/ktlint
....

longreads

The World According to Peter Thiel - Erik Torenberg's Thoughts

His claim is that we've had this narrow cone of progress around the world of bits—around software & IT — but not atoms. The iPhones that distract us from our environment also distract us from how strangely old & unchanged our current environment is. If you were to be in any room in 1973, everything would look the same except for our phones. This explains his old Founders Fund tagline: “We wanted flying cars, instead we got 140 characters.”

Zooming out, people don’t understand how important economic growth is. It’s the only thing sustaining the planet. Without it, we go into a malthusian war. Indeed: The only way our societies have worked for at least 250 years is by economic growth. Parliamentary democracies are built on an ever-expanding pie that they can continue subdividing. Once the pie is no longer expanding, everything turns zero-sum.

Cyberdecks For High-Tech Low-Lifes - The Dork Web

The term “Cyberdeck” was first coined in Gibson’s 1984 literary masterpiece, Neuromancer. He rewrote parts of Neuromancer several times after the release of Ridley Scott’s Blade Runner. Blade Runner was based on Philip K. Dick’s 1968 novel Do Androids Dream of Electric Sheep. Scott, Dick, Brunner’s The Shockwave Rider, Goddard’s Alphaville and work by futurists such as Syd Mead and Moebius make the title of “father of Cyberpunk” hard to hang on Gibson alone. But he’s clearly a very important character in the development of Cyberpunk culture.

Just as Shakespeare brought in new words to describe new worlds, 1980s Gibson is Cyberpunk’s Great Bard. The Cyberdeck is just one of Gibson’s literary gifts. It’s the tool that lets Console Cowboys jack into the Matrix of Cyberspace and start hacking.

The anthropologist in an economist world - Altered States of Monetary Consciousness

Anthropology starts from the recognition that a person - in the first instance at least - cannot exist apart from a group. Put differently, anthropology assumes that a human network always precedes its individual members, and that care and reproduction precede any form of solo heroics. Human babies don’t survive long if they are left to fend for themselves, and - even if they miraculously survived without others - they would not be able to speak language, which would make all future social interaction, relationships and trade near-impossible.

The age-old strategy of buying cheap shares is faltering - Hacker News

the article is behind paywall, but the discussion at HN is interesting (premii)

Why You Should Use Component-Based Design in Unity

Let’s say that any weapon will have a component for damage, range, and projectiles (optional). Using Unity’s UI, you could create a weapon by dragging these components onto any GameObject and customizing the values of each one. Then, if the way projectiles are handled changes further into development, all you need to do is change one script, and all your weapons’ functionalities will be updated instead of just those defined at one level of a tree.


fast inverse square root

source: Fast inverse square root - Wikipedia

Fast inverse square root, sometimes referred to as Fast InvSqrt() or by the hexadecimal constant 0x5F3759DF, is an algorithm that estimates 1/sqrt(x), the reciprocal (or multiplicative inverse) of the square root of a 32-bit floating-point number x floating-point

float Q_rsqrt( float number )
{
    long i;
    float x2, y;
    const float threehalfs = 1.5F;

    x2 = number * 0.5F;
    y  = number;
    i  = * ( long * ) &y;                       // evil floating point bit level hacking
    i  = 0x5f3759df - ( i >> 1 );               // what the fuck? 
    y  = * ( float * ) &i;
    y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
//  y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed

    return y;
}