This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
⍝ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set number | |
set expandtab | |
set tabstop=2 | |
set softtabstop=2 | |
set shiftwidth=2 | |
set nofoldenable | |
let g:mapleader = ',' | |
filetype plugin on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"creationDate": "2018-10-24 12:24:51 +0100", | |
"value": "81" | |
}, | |
{ | |
"creationDate": "2018-10-24 12:24:55 +0100", | |
"value": "78" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const finishedLevelsCount = levels | |
.filter(({ finished }) => finished) | |
.reduce(acc => acc + 1, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const obj = {a : 2} | |
const fn = propName => ({ [propName]: prop }) => prop == 2 | |
console.log(fn('a')(obj)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Output down | |
const arr = [ | |
{ value: 1 }, | |
{ value: 2 }, | |
{ value: 3 }, | |
undefined, | |
{ value: 5 }, | |
{ value: 6 } | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set number | |
set expandtab | |
set tabstop=2 | |
set softtabstop=2 | |
set shiftwidth=2 | |
set nofoldenable | |
let g:mapleader = ',' | |
let g:ale_fixers = { | |
\ 'javascript': ['eslint'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this productivity app blurs parts of aby webpage that are currently not important for you to read | |
// to use it, open devtools with f12, copy the following line to the console and hit enter. | |
Array.prototype.forEach.call(document.getElementsByTagName('*'), e => e.style.filter = `blur(${Math.random() < 0.95 ? 0 : 4}px)`) |
NewerOlder