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 os | |
import logging | |
import codecs | |
import yaml | |
# config the logging | |
current_folder = os.path.dirname(os.path.realpath(__file__)) | |
logging_config_filename = os.path.join(current_folder, 'python_logging_example.yaml') | |
logging.config.dictConfig(yaml.load(codecs.open(logging_config_filename, 'r', 'utf-8'))) | |
logger = logging.getLogger('commonLog') |
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
/** | |
* Modify the parts you need to get it working. | |
*/ | |
var should = require('should'); | |
var request = require('../node_modules/request'); | |
var io = require('socket.io-client'); | |
var serverUrl = 'http://localhost'; |
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
conn = pymssql.connect(server, user, password, "tempdb") | |
cursor = conn.cursor() | |
cursor.execute('SELECT * FROM persons WHERE salesrep=%s', 'John Doe') | |
for row in cursor: | |
print('row = %r' % (row,)) | |
conn.close() |
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
sudo yum update -y | |
sudo yum groupinstall -y 'development tools' | |
sudo yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel xz-libs wget | |
sudo wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz | |
tar xvf Python-2.7.8 | |
cd Python-2.7.8 | |
sudo ./configure --prefix=/usr/local | |
sudo make | |
sudo make altinstall | |
sudo wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py |
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
<script language="javascript"> | |
<!-- | |
var ua = navigator.userAgent; | |
var $IE = (navigator.appName == "Microsoft Internet Explorer"); | |
var $IE5 = $IE && (ua.indexOf('MSIE 5') != -1); | |
var $IE5_0 = $IE && (ua.indexOf('MSIE 5.0') != -1); | |
var $Gecko = ua.indexOf('Gecko') != -1; | |
var $Safari = ua.indexOf('Safari') != -1; | |
var $Opera = ua.indexOf('Opera') != -1; | |
var $Mac = ua.indexOf('Mac') != -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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> | |
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> | |
<title>Index Page</title> | |
<style type="text/css"> | |
.yui-skin-sam .yui-dt-liner { white-space:nowrap; } | |
</style> | |
<script type="text/javascript"> | |
YAHOO.example.Data = { | |
bookorders: [ |
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
/* | |
* | |
* 此问题源自于BinarySearch中的求中数的小陷阱。 | |
* 查看了微软的源代码,在1.x时代是如line01所示的方案,显然是有错的。 | |
* 在2.0后改为line03,无错。 | |
* 由于疏忽,我上来写成了line02,于是也出错了,一查看原来是优先级没搞混了。 | |
* | |
*/ | |
using System; |
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.Data; | |
using System.Configuration; | |
using System.Collections; | |
using System.Web; | |
using System.Web.Security; | |
using System.Web.UI; | |
using System.Web.UI.WebControls; | |
using System.Web.UI.WebControls.WebParts; | |
using System.Web.UI.HtmlControls; |
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
static void Main(string[] args) | |
{ | |
using (SvnClient client = new SvnClient()) | |
{ | |
SvnInfoEventArgs serverInfo; | |
SvnInfoEventArgs clientInfo; | |
SvnUriTarget repos = new SvnUriTarget("http://svn.test.com/demo"); | |
SvnPathTarget local = new SvnPathTarget(@"d:\Work\Code\demo"); | |
client.GetInfo(repos, out serverInfo); |
NewerOlder