Skip to content

Instantly share code, notes, and snippets.

View jangsoopark's full-sized avatar
:octocat:
asdf

jangsoo park jangsoopark

:octocat:
asdf
View GitHub Profile
@140am
140am / observer.py
Created June 18, 2011 08:35
python observer pattern example
import pdb
import time
import threading
class Event(object):
pass
class Observable(object):
def __init__(self):
self.callbacks = []
@enjoylife
enjoylife / Scan.py
Created April 3, 2012 05:56
Python implementation of SCAN: A Structural Clustering Algorithm for Networks
# -*- coding: utf-8 -*-
"""
SCAN: A Structural Clustering Algorithm for Networks
As described in http://ualr.edu/nxyuruk/publications/kdd07.pdf
"""
from collections import deque
import numpy as np
from scipy.sparse import csr_matrix
@stevedonovan
stevedonovan / install.lua
Created September 28, 2013 13:37
A simple Lua install script for Lua modules, extensions and scripts. Tested on Windows and Linux.
#!/usr/bin/env lua
--[[ -- installing LDoc
function install()
-- requires('pl','Penlight')
-- install_script 'ldoc'
end
--]]
-- --[[
@blmarket
blmarket / login.py
Created February 15, 2014 00:26
네이버 로그인 python 스크립트
#/usr/bin/env python
# vim: set fileencoding=utf-8
from ghost import Ghost
from config import COOKIE_FILE, LOGIN_ID, LOGIN_PW
import urllib2
import cookielib
import Cookie
class NaverCrawler:
@jegger
jegger / Pygst_virtualenv.sh
Created April 6, 2014 09:51
Install (link) gstreamer0.10 (pygst / gst) into a virtualenv
# Replace 'venv' with the foldername of your virtualenv.
# This script links the gst module and it's dependecies into the virtualenv.
# Tested on ubuntu 12.04
sudo apt-get install python-gst0.10
cd venv/lib/python2.7/site-packages
ln -s /usr/lib/python2.7/dist-packages/glib
ln -s /usr/lib/python2.7/dist-packages/gobject
ln -s /usr/lib/python2.7/dist-packages/gst-0.10
ln -s /usr/lib/python2.7/dist-packages/gstoption.so
@declank
declank / go-play-music.go
Created June 10, 2015 22:19
[Golang] Simple music player that uses ffmpeg and portaudio
package main
import (
"code.google.com/p/portaudio-go/portaudio"
"encoding/binary"
"log"
"io"
"os"
"os/exec"
)
@allieus
allieus / README.md
Last active January 20, 2021 02:23
네이버 블로그 크롤링

네이버 블로그 크롤링

  • 파이썬3 에서 동작합니다.
  • requests, beautifulsoup4 라이브러리가 필요합니다.
pip install requests beautifulsoup4

AskDjango

@kanhua
kanhua / README.md
Last active February 1, 2023 17:08
A template of writing C or C++ extension for python and numpy

This gist demonstrates how to setup a python project that process a numpy array from C language.

To compile the project, run

make all

To test it, run

make test
@InnerPeace-Wu
InnerPeace-Wu / tf_gradient_clip_lr_decay.py
Created October 5, 2017 11:21
ways to do gradients clipping and learning rate decay in tensorflow
import tensorflow as tf
#aplly exponential decay on learning rate
global_step = tf.Variable(0, trainable=False)
stater_learning_rate = lr #for start
learning_rate = tf.train.exponential_decay(starter_learning_rate, global_step,
decay_steps, decay_rate, staircase=True)
optimizer = tf.train.AdamOptimizer(learning_rate)