Skip to content

Instantly share code, notes, and snippets.

View WebberHuang's full-sized avatar

Webber Huang WebberHuang

View GitHub Profile
@WebberHuang
WebberHuang / newtonMethodImprove.py
Created February 13, 2013 16:09
According the Lecture 6 of Berkeley Computer Science 61A – Fall 2012 ,i modify the newton method code for performance improve.
"""
INPUT: float, float, float
OUTPUT: bool
"""
def approx_eq_1(x, y, tolerance=1e-18):
return abs(x - y) <= tolerance
"""
INPUT: float, float, float
OUTPUT: bool
@WebberHuang
WebberHuang / heartNode.py
Last active December 15, 2015 08:29
A maya custom node for output motion path with heart shape
"""A maya custom node for output motion path with heart shape"""
__author__ = 'Huang Weibo <xracz.fx@gmail.com>'
__version__ = '1.0'
__status__ = "release"
__date__ = "2013/3/12"
__copyright__ = "Copyright 2013, riggingtd.com"
import math, sys
@WebberHuang
WebberHuang / repairFileByInvertBinaryString.py
Created May 11, 2014 15:58
Repair files that corrupted by desktop virus
blockSize = 100
fileList = ["filepath1", "filepath2", "filepath3"]
def invert(x):
return ~x & 0xFF
def repair(filePath, blockSize):
try:
with open(filePath,"rb+") as f:
block = f.read(blockSize)
@WebberHuang
WebberHuang / closestEdgeOnMesh.py
Last active May 11, 2016 20:35
find the closest edge on mesh from any position
#!/usr/bin/env python
# Author: Webber Huang
# E-mail: xracz.fx@gmail.com
# Website: http://riggingtd.com
# Purpose: Find the closest edge on mesh from any position
# Created: 2014/6/17
#========================================================================
import heapq
import maya.cmds as cmds
port: 7890
socks-port: 7891
allow-lan: true
mode: Rule
log-level: info
external-controller: :9090
proxies:
- {name: CYL-科技, server: lv26wr2p4q0pl8v4i8h.v22222.xyz, port: 33331, type: vmess, uuid: dc66f479-7453-33ea-9d7f-9a10e04591bf, alterId: 1, cipher: auto, tls: false, network: ws, ws-path: /tnt-awsxjp1, ws-headers: {Host: baidu.com}}
- {name: CYL-科技 2, server: rxzgzq.moox.icu, port: 34016, type: vmess, uuid: 7ac1c362-480b-4b79-b363-dc52a4a0e97a, alterId: 1, cipher: auto, tls: true, network: ws, ws-path: /, ws-headers: {Host: ntt.xlanfly.xyz}}
- {name: CYL-科技 3, server: icajm.moox.icu, port: 34019, type: vmess, uuid: 7ac1c362-480b-4b79-b363-dc52a4a0e97a, alterId: 1, cipher: auto, tls: true, network: ws, ws-path: /, ws-headers: {Host: do403.xlanfly.xyz}}