Skip to content

Instantly share code, notes, and snippets.

View seckcoder's full-sized avatar

Wei Li seckcoder

  • Blablabla
  • San Francisco
View GitHub Profile
@seckcoder
seckcoder / mysql_innodb_4G.png
Last active August 29, 2015 14:08
mysql error

screen shot of top and mtop: Inline-style: ![alt text][logo]

mysql status when cpu is 190%:

+------------------------------------------+-------------+

| Variable_name | Value |

@seckcoder
seckcoder / gist:ba0a4da718dd6fe578ad
Created October 28, 2014 06:19
cloud computing mysql bulk load. Fuck you cloud computing!!!
#!/usr/bin/env python
__author__ = 'seckcoder'
import sys
import json
from mysql.connector.pooling import MySQLConnectionPool
import traceback
from mysql.connector.conversion import MySQLConverter
@seckcoder
seckcoder / gist:d68c6107766cee9ac60c
Created October 26, 2014 05:42
send_mysql_metric
__author__ = 'seckcoder'
import config
import boto.ec2.cloudwatch
import subprocess
import time
from datetime import datetime
region = "us-east-1"
import numpy as np
import numpy.linalg as linalg
import matplotlib.pyplot as plt
import math
def p4():
A = np.array([[1, 3, 2],
[-1, 2, -5],
[2, -4, 3]])
@seckcoder
seckcoder / gist:9204855
Last active May 22, 2023 04:29
implementation of exception, generator and coroutine based on continuation
#lang racket
; Implementations and examples are inspired by Matt Might's blog posts:
; http://matt.might.net/articles/programming-with-continuations--exceptions-backtracking-search-threads-generators-coroutines/
; Note I didn't just copy the code. I implemented it independently, so it looks a lot different from Matt's code.
(define (current-continuation)
(call/cc (lambda (k)
(k k))))
(define (exception)
@seckcoder
seckcoder / gist:8234822
Created January 3, 2014 08:37
ocamlinit
(* Added by OPAM. *)
let () =
try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
with Not_found -> ()
;;
#use "topfind";;
#thread;;
#camlp4o;;
#require "core.top";;
@seckcoder
seckcoder / gist:7511433
Created November 17, 2013 09:53
高昌, 侯旭, 蠢货第一次修改
To 侯:
我把
And we present a system that's capable of
integrating transfer function design results
from a group of experts to facilitate the
design process of novice users by providing
useful interactions that enable flexible
navigation in the transfer function feature
space and effective visual suggestion.
@seckcoder
seckcoder / gist:6749188
Created September 29, 2013 03:48
scheme implementation test
(let ((a 1))
(define (f x)
(define b (+ a x))
(define a 5)
(+ a b))
(f 10))
@seckcoder
seckcoder / gist:6732850
Last active December 24, 2015 02:49
words->lines
#!/usr/local/bin/guile -s
!#
; Scheme(guile) implementation for http://weibo.com/1822142792/Abqbesr1n?mod=weibotime
; include guile pattern matching module
(use-modules (ice-9 match))
; transform a list of words to list of lines, with length of line not exceeding line-len
(define (words->lines words line-len)
(cond ((null? words) '())
@seckcoder
seckcoder / gist:6281530
Last active December 21, 2015 08:58
limited access object
var assert = require("assert"),
ms = require("ms");
function LimitedAccessObject(opts) {
var initial = {
times:1,
costed:0,
autoRefresh:false,
refreshInterval:0
};