Skip to content

Instantly share code, notes, and snippets.

View annh3's full-sized avatar
🎯
Focusing

Ann He annh3

🎯
Focusing
View GitHub Profile
@glederrey
glederrey / conjgrad.py
Created May 28, 2018 13:17
Conjugate Gradient in Python
def conjgrad(A, b, x):
"""
A function to solve [A]{x} = {b} linear equation system with the
conjugate gradient method.
More at: http://en.wikipedia.org/wiki/Conjugate_gradient_method
========== Parameters ==========
A : matrix
A real symmetric positive definite matrix.
b : vector
The right hand side (RHS) vector of the system.

Modernity and mimetic rivalry

All that capitalism, or rather the liberal society that allows capitalism to flourish, does, is to give mimetic phenomena a freer rein and to direct them into economic and technological channels… capitalism is capable of doing away with the restraints that archaic societies placed upon mimetic rivalry.

The mythology of desire

We have the impression that if it were possible some cultures would dispense with individual choice entirely and so entirely eliminate the possibility of mimetic rivalry. In contemporary society, the exact opposite increasingly takes place. No more taboos forbid one person to take what is reserved for another, and no more initiation rites prepare individuals in common, for the necessary trials of life… Instead, modern education thinks it is able to resolve every problem by glorifying the natural spontaneity of desire, which is a purely mythological notion.

Desire and value

The value of an object grows in proportion to the resistance met w

@rtv
rtv / cond.c
Created February 19, 2013 19:56
An example of using pthread's condition variables, showing how to block a main thread while waiting for worker threads to finish their work, without joining the threads. This could be useful if you want to loop the threads, for example.
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <assert.h>
/* Compile like this:
gcc --std=c99 -lpthread cond.c -o cond
@jiahao
jiahao / Optimizer.py
Created January 4, 2012 17:44
Pure Python implementation of some numerical optimizers
#!/usr/bin/env python
'''
Pure Python implementation of some numerical optimizers
Created on Jan 21, 2011
@author Jiahao Chen
'''