Skip to content

Instantly share code, notes, and snippets.

View mfandl's full-sized avatar

Matej Fandl mfandl

View GitHub Profile
@mfandl
mfandl / k.md
Last active March 18, 2026 13:33
notes from learning K

First attempt at matrix multiplication :)

mmul:{+/+y*/:x}

works fine here

m2: (2 6; 3 5; 4 2)

mmul[m1;m2] 
@mfandl
mfandl / README.md
Created March 15, 2026 12:20 — forked from shriram/README.md
Review of Claude Code-generated code for a bookshop, March 2026

Context

This is code generated as part of our course on agentic coding. The code below was written by Claude Code using its default model in late Feb 2026.

Learning Objective

The purpose of this assigment was to help students realize that, in the absence of explicit prompting to this effect, Claude Code (in its current state) is highly unlikely to generate code with a clean separation of concerns. The specific concern we wanted to focus on was the factoring-out of business rules. This is to set up students to learn about business rules, author them separately, and then figure out how to incorporate them into the program: e.g., using something like the RETE algorithm.

The hope is that once students learn this concept, they will recognize it in future tasks, and think to prompt for it to be done more deliberately. Since Claude doesn't do it automatically, it's something they need to be taught abo

⍝ My attempt to implement a hopfield network with synchronous update rule in APL
⍝ Our network is a weight matrix created from array of patterns (vectors)
net ← {ws ← ⊃+⌿∘.×⍨¨⍵ ⋄ (1 1⍉ws) ← 0 ⋄ ws}
⍝ LHS argument is the net, RHS is the probe we want to update
update ← {(2×0∘<⍵+.×⍺)-1}
⍝ Example use
set number
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
set nofoldenable
let g:mapleader = ','
filetype plugin on
[
{
"creationDate": "2018-10-24 12:24:51 +0100",
"value": "81"
},
{
"creationDate": "2018-10-24 12:24:55 +0100",
"value": "78"
},
{
const propertyExtractor = propName => ({ [propName]: prop }) => prop
const idExtractor = propertyExtractor('id')
const nameExtractor = propertyExtractor('name')
const convict = { id: 7556, name: 'ash' }
console.log(idExtractor(convict), nameExtractor(convict)) // 7556 "ash"
const finishedLevelsCount = levels
.filter(({ finished }) => finished)
.reduce(acc => acc + 1, 0);
@mfandl
mfandl / lesson1.clj
Last active August 1, 2018 21:23
clojure school lesson 1 recap and exercises
;; WIP material
;; RECAP
; clojure expressions are lists
; syntactically, lists are values in parentheses delimited by white space
(1 2 3)
; clojure expects each expression is built in such a way,
; that the first element is a function name followed by its arguments
const obj = {a : 2}
const fn = propName => ({ [propName]: prop }) => prop == 2
console.log(fn('a')(obj))
// Output down
const arr = [
{ value: 1 },
{ value: 2 },
{ value: 3 },
undefined,
{ value: 5 },
{ value: 6 }
];