Skip to content

Instantly share code, notes, and snippets.

View superlayone's full-sized avatar
👻

superlayone superlayone

👻
  • Ant Group,Zhima Enterprise Credit
  • Dragon Space-C,Zhejiang,Hangzhou,China
View GitHub Profile
@superlayone
superlayone / wandoujia-1.md
Last active August 29, 2015 13:57
豌豆荚面试

打印mxn螺旋矩阵

	class Solution {      
	public:      
	    vector<int> spiralOrder(vector<vector<int> >& matrix) {      
	        vector<int> result;      
	        if (matrix.empty()) return result;      
	        ssize_t beginX = 0, endX = matrix[0].size() - 1;      
	        ssize_t beginY = 0, endY = matrix.size() - 1;      
@superlayone
superlayone / AddNewWeightFunc.md
Last active August 29, 2015 13:57
Nova scheduler weight function

change to directory

cd /usr/share/pyshared/nova/scheduler/weights

add a new weight function

vim disk.py

go to bin directory

cd /usr/lib/python2.7/dist-packages/nova/scheduler/weights
#! /usr/bin/env python
# coding=utf-8
__author__ = 'jszhou'
from bottle import *
import hashlib
import xml.etree.ElementTree as ET
import urllib2
# import requests
import json