Skip to content

Instantly share code, notes, and snippets.

@5agado
5agado / conway_2D.py
Created June 23, 2017 12:43
Code for reproducing a 2D Conway's Game of Life cellular automaton in Blender
import bpy
import sys
from mathutils import Vector
import numpy as np
class ConwayGOL_2D:
def __init__(self, N):
"""
2D Conway Game of Life
:param N: grid side size (resulting grid will be a NxN matrix)
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 23, 2024 03:59
Swift Concurrency Manifesto
@HarshaVardhanBabu
HarshaVardhanBabu / Instructions_UML_Python.rst
Last active December 19, 2023 13:48
Generating UML diagrams in python using pyreverse

Requirements

  1. Install Pylint from Install. If you have anaconda already installed use pip install -U pylint to update the Pylint so that pyreverse is added to the scripts folder.
  2. You need to install Graphviz as the pyreverse generates the UML diagrams in dot format and needs the dot.exe provided by Graphviz. Once Graphviz is installed make sure the bin folder is added to the PATH variable so that pyreverse can find it at run time. "the command pyreverse generates the diagrams in all formats that graphviz/dot knows." (Reference
  3. Now add the path of python modules for which you want to generate the documentation to PYTHONPATH.
  4. Use pyreverse -S <modulename> to generate dot files in the current folder

    Usage:

Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea

@Fbalashov
Fbalashov / InvalidatesView.kt
Last active December 6, 2022 12:08
A property delegate to remove boilerplate when updating views
package *****
import android.view.View
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
/**
* Copyright 6/24/2017 Fuad Balashov
*
* Licensed under the Apache License, Version 2.0 (the "License");
@seanjensengrey
seanjensengrey / octal_x86.txt
Last active May 24, 2024 04:23
x86 is an octal machine
# source:http://geocities.com/SiliconValley/heights/7052/opcode.txt
From: mark@omnifest.uwm.edu (Mark Hopkins)
Newsgroups: alt.lang.asm
Subject: A Summary of the 80486 Opcodes and Instructions
(1) The 80x86 is an Octal Machine
This is a follow-up and revision of an article posted in alt.lang.asm on
7-5-92 concerning the 80x86 instruction encoding.
The only proper way to understand 80x86 coding is to realize that ALL 80x86
@nadavrot
nadavrot / Matrix.md
Last active May 22, 2024 13:38
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@cscalfani
cscalfani / ThinkAboutMonads.md
Last active December 4, 2022 20:58
How to think about monads

How to think about Monads

UPDATE 2021: I wrote this long before I wrote my book Functional Programming Made Easier: A Step-by-step Guide. For a much more in depth discussion on Monads see Chapter 18.

Initially, Monads are the biggest, scariest thing about Functional Programming and especially Haskell. I've used monads for quite some time now, but I didn't have a very good model for what they really are. I read Philip Wadler's paper Monads for functional programming and I still didnt quite see the pattern.

It wasn't until I read the blog post You Could Have Invented Monads! (And Maybe You Already Have.) that I started to see things more clearly.

This is a distillation of those works and most likely an oversimplification in an attempt to make things easier to understand. Nuance can come later. What we need when first le

@rxwei
rxwei / ad-manifesto.md
Last active November 9, 2023 09:58
First-Class Automatic Differentiation in Swift: A Manifesto
@patmaddox
patmaddox / 01_README.md
Created April 7, 2019 01:19
dorico custom instruments

To add custom instruments, you need to modify some XML files under /Applications/Dorico 2.app/Contents/Resources. Only do this if you're comfortable doing something like that!

For instruments.xml and instrumentnames_en.xml, you will add new entries. I placed them after the Pianoforte entry.

If your computer isn't set to English, choose the correct localization file for your system.

For instrumentFamiliesDefinitions.xml you will replace the existing keyboards entry (essentially you add instrument.keyboard.piano.alias.part to the `` element for Keyboards.