Skip to content

Instantly share code, notes, and snippets.

@DemoHn
DemoHn / page_table.py
Last active October 23, 2016 13:50
Solution for Problem 4 of EESM 5060 Assignment.
#
# Copyright by Lu Mingchaun
# 2016.10.21
#
__author__ = "Nigshoxiz"
class Utils:
@staticmethod
def dec_to_bin(data, width):
_bin_str = "{0:b}".format(data)
@DemoHn
DemoHn / toxic.py
Created October 14, 2016 16:47
An integrated test framework for digital components of Cadence
#coding=utf-8
from __future__ import print_function
import os
import subprocess
import inspect
import traceback
__author__ = "Nigshoxiz"
import socket
import json
# ss-manager use UNIX domain protocol to send command
# here is the test file
# only test command "add"
# DemoHn
# 2015-12-12
def sendSocket(cmd,content):
@DemoHn
DemoHn / solve.js
Last active January 3, 2016 05:19
人人上有一道趣题的题解.有点黑科技. (居然还有闲情写程序,偏微不是要挂的节奏嘛==)
var sum_array = function(arr){
var sum = 0;
for(var j=0;j<arr.length;j++){
sum += arr[j];
}
return sum;
};
var _trans = function(str){
var final_str = "";