This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static string ConvertInFixToPostFix(string inFixExpression) | |
{ | |
if (inFixExpression == null || inFixExpression.Trim().Length == 0) | |
return inFixExpression; | |
inFixExpression = inFixExpression.Replace("(", " ( "); | |
inFixExpression = inFixExpression.Replace(")", " ) "); | |
inFixExpression = inFixExpression.ToLower(); | |
string[] tokens = inFixExpression.Split(new string[] { }, StringSplitOptions.RemoveEmptyEntries); | |
if (tokens.Length == 0 || tokens.Length == 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static XmlDocument ToXml(object thisObj) | |
{ | |
XmlDocument propertyDoc = new XmlDocument(); | |
XmlNode rootNode = propertyDoc.CreateElement(thisObj.GetType().Name.Replace("[]", "Array")); | |
propertyDoc.AppendChild(rootNode); | |
if (thisObj.GetType().IsArray) | |
{ | |
Array objects = (Array)thisObj; | |
foreach (object obj in objects) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Text; | |
namespace Common | |
{ | |
/// <summary> | |
/// This class will take down the steps in the api flow, and trace it if the latency is larger than config. | |
/// </summary> | |
public static class PerfTracer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import string | |
def NameToNo(name): | |
result = 0 | |
for ch in name.upper().strip("\n"): | |
result = result * 26 + ord(ch) - ord('A') + 1 | |
return result | |
def NoToName(no): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install git | |
git clone https://github.com/njukidreborn/vimbackup.git ~/.vim | |
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle | |
ln -s ~/.vim/vimrc ~/.vimrc | |
ln -s ~/.vim/gvimrc ~/.gvimrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import urllib | |
import json | |
import ConfigParser | |
COMMENTS_SHOW = 'https://api.weibo.com/2/comments/show.json' | |
USER_TIMELINE = 'https://api.weibo.com/2/statuses/user_timeline.json' | |
HDR = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import feedparser | |
rss_url = "" | |
feed = feedparser.parse( rss_url ) | |
items = feed["items"] | |
for item in items: | |
time = item[ "published_parsed" ] | |
title = item[ "title" ].encode('gb18030') | |
fileName = str(time.tm_year) + '-' + str(time.tm_mon) + '-' + str(time.tm_mday) + '-' + title + '.md' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import urllib2 | |
url = 'https://path.com/developers/docs' | |
data = urllib2.urlopen(url).read() | |
soup = BeautifulSoup(data) | |
for node in soup.findAll(attrs={'class': 'curl'}): | |
print node.contents[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\xm] | |
@="URL:xm Protocol" | |
"URL Protocol"="" | |
[HKEY_CLASSES_ROOT\xm\shell] | |
[HKEY_CLASSES_ROOT\xm\shell\open] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace MinLength | |
{ | |
class Program | |
{ |
OlderNewer