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
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int compareVersion(const char *v1, const char *v2) | |
{ | |
char *f1, *f2, *s1, *s2; | |
int n1, n2, r; | |
f1 = s1 = strdup(v1); | |
f2 = s2 = strdup(v2); |
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 matplotlib.pyplot as plt | |
from cStringIO import StringIO | |
import win32clipboard | |
from PIL import Image | |
def send_to_clipboard(clip_type, data): | |
win32clipboard.OpenClipboard() | |
win32clipboard.EmptyClipboard() | |
win32clipboard.SetClipboardData(clip_type, data) |
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
func BinaryToGray(num uint) uint { | |
return (num >> 1) ^ num | |
} | |
func GrayToBinary(num uint) uint { | |
for mask := num >> 1; mask != 0; mask = mask >> 1 { | |
num = num ^ mask | |
} | |
return num | |
} |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<style> | |
table { | |
border-collapse: collapse | |
} | |
</style> | |
<script src="jquery.min.js"></script> | |
<script> | |
function add_float_head(tid){ |
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
# This program shows off a python decorator( | |
# which implements tail call optimization. It | |
# does this by throwing an exception if it is | |
# it's own grandparent, and catching such | |
# exceptions to recall the stack. | |
import sys | |
class TailRecurseException: | |
def __init__(self, args, kwargs): |
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 socket | |
import fcntl | |
import struct | |
def get_ip_address(ifname): | |
""" | |
>>> get_ip_address('lo') | |
'127.0.0.1' | |
>>> get_ip_address('eth0') |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Monokai</string> | |
<key>settings</key> | |
<array> | |
<dict> |
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 sublime | |
import sublime_plugin | |
from os import path | |
import tempfile | |
import sys | |
import datetime | |
import webbrowser | |
import re | |
from HtmlAnnotations import get_annotations | |
import ExportHtmlLib.desktop as desktop |
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
# -*- coding: utf8 -*- | |
""" | |
使用java的模块SmartXLS[http://www.smartxls.com/indexj.htm]和jpype修改excel | |
和xlrd,xlwt不同的是它可以生成和保持图表 | |
""" | |
from __future__ import print_function, division | |
import os |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include "lua5.1/lua.h" | |
#include "lua5.1/lauxlib.h" | |
#include "lua5.1/lualib.h" | |
// Measuring lua vm memory usage. | |
// build: gcc main.c -llua5.1 -lm -ldl -fPIC | |
static size_t mem_used = 0; |
OlderNewer