Skip to content

Instantly share code, notes, and snippets.

import bisect
class NFA(object):
EPSILON = object()
ANY = object()
def __init__(self, start_state):
self.transitions = {}
self.final_states = set()
self._start_state = start_state
function a = lsa(fun,x,d,a1,varargin)
% a = lsa(fun,x,d,a1)
%
% Implementation of Line Search Algorithm with Strong Wolfe conditions
% as found J. Nocedal, S. Wright, Numerical Optimization, 1999 edition
% Algorithm 3.2 on page 59
%
% Output arguments:
% a : final stepsize
%
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@jashmenn
jashmenn / ej-autocomplete.el
Created January 17, 2012 19:12
emacs autocomplete w/ hippie-expand and yasnippets
(require 'popup)
(require 'pos-tip)
(require 'popup-kill-ring)
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories (concat libfiles-dir "/ac-dict"))
(ac-config-default)
(setq ac-use-menu-map t)
(define-key ac-menu-map (kbd "ESC") 'viper-exit-popup-menu)
(define-key ac-complete-mode-map (kbd "ESC") 'viper-exit-popup-menu)
(deftheme bubbleberry "bubbleberry")
;; Based on the theme used for LightTable (see: http://www.chris-granger.com/images/lightable/main.png )
(custom-theme-set-variables
'bubbleberry
'(linum-format " %7i ")
'(fringe-mode 5 nil (fringe))
'(powerline-color1 "#3d3d68")
'(powerline-color2 "#292945")
@osdf
osdf / test_numpy.py
Created October 5, 2012 21:27
Testing numpy and scipy setups
#!/usr/bin/env python
import numpy
import sys
import timeit
try:
import numpy.core._dotblas
print 'FAST BLAS'
except ImportError:
print 'slow blas'
@exaos
exaos / el-emacs-zh-face.el
Last active March 21, 2022 10:27
My emacs face settings for Chinese environment. Emacs 字体设置,中英文同步缩放,大字符集显示。
;; mode: emacs-lisp; coding: utf-8
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; By: Exaos Lee
;; URL: https://gist.github.com/4493582
;; References:
;; - http://baohaojun.github.com/perfect-emacs-chinese-font.html
;; - http://fonts.jp/hanazono/
;; - http://ergoemacs.org/emacs/emacs_n_unicode.html
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

先做好硬碟分割
PS. 本人指令功力不足(掩面),我會先藉助Gparted圖形介面分割軟體做好分割,分割後記得等等要安裝的分割區代號(像是/dev/sda3那種)
掛載要安裝的分割區
$ mount /dev/sda3 /mnt #我是安裝在sda3分割區
$ dhcpcd #開啟有線網路自動抓取IP
$ pacstrap /mnt base base-devel #安裝Linuix所需基本檔案環境
產生需要的自動掛載設定檔
$ genfstab -p /mnt >> /mnt/etc/fstab
@Superbil
Superbil / fix-font-org-mode.el
Last active August 27, 2022 08:25
fix chinese font on Emacs
;;; base on https://gist.github.com/coldnew/7398835
(defvar emacs-english-font nil
"The font name of English.")
(defvar emacs-cjk-font nil
"The font name for CJK.")
(defvar emacs-font-size-pair nil
"Default font size pair for (english . chinese)")