This file contains hidden or 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
#! /usr/bin/env bash | |
# Author: Damien Cassou | |
# | |
# This is the script I use to build Emacs packages for Ubuntu. These | |
# packages are uploaded to | |
# https://launchpad.net/~cassou/+archive/emacs/. Each package is | |
# either build from a Debian package or from | |
# http://emacs.naquadah.org/. |
This file contains hidden or 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
""" Self-contained code example to listen for postgres events. | |
This is the Python 3 counterpart of | |
http://bjorngylling.com/2011-04-13/postgres-listen-notify-with-node-js.html | |
Preconditions: create a database and a trigger with | |
CREATE TABLE foo (id serial primary key, name varchar); |
This file contains hidden or 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
from numpy import empty | |
def mandelbrot_escape(x, y, n): | |
""" Mandelbrot set escape time algorithm in real and complex components | |
""" | |
z_x = x | |
z_y = y | |
for i in range(n): | |
z_x, z_y = z_x**2 - z_y**2 + x, 2*z_x*z_y + y |
This file contains hidden or 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
;;; -*- lexical-binding: t -*- | |
(defun atom? (x) (not (listp x))) | |
(atom? 'abc) | |
(atom? 1) | |
(atom? '(a b c)) | |
(defun member (a lat) | |
(cond ((null lat) nil) |
This file contains hidden or 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
# Mangled version of Chaco's lasso demo that has a LassoSelection that | |
# constrains the selection to be parallel to the coordinate axes. | |
import sys | |
# Major library imports | |
from numpy import sort, compress, arange | |
from numpy.random import random | |
import numpy as np |
This file contains hidden or 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
\documentclass{article} | |
\usepackage[T1]{fontenc} | |
\usepackage{CJKutf8} | |
\usepackage[english]{babel} | |
\usepackage{hyperref} | |
\title{Korean Class \\ | |
26 November 2016 \\ | |
{\small \url{% |
This file contains hidden or 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
#!/usr/bin/env python | |
"""Horrible hacked-together script to reformat import statements along | |
something that vaguely resembles our coding standard. To be called from | |
within Emacs via | |
(defun jvk/python-reformat-import () | |
(interactive) | |
(save-excursion | |
(let ((pmin (py-statement-point-begin)) | |
(pmax (py-statement-point-end))) |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from __future__ import division, print_function | |
from traits.etsconfig.api import ETSConfig | |
ETSConfig.toolkit = 'qt4' | |
from traits.api import HasTraits, Instance, String | |
from traitsui.api import Action, Controller, Handler, Item, View | |
import sys, traits, traitsui | |
print ('python version :',sys.version) # 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
#!/usr/bin/env python3 | |
# TODO | |
# 2. support block structure | |
from collections import deque, namedtuple | |
import contextlib | |
from functools import reduce | |
import operator | |
import re |