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
<%@ 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
set nu | |
set autochdir | |
set encoding=utf-8 | |
set fileencoding=utf-8 | |
set ai | |
set si | |
set ts=4 | |
set st=4 | |
set sw=4 | |
set et |
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 <iostream> | |
#include <thread> | |
using namespace std; | |
int _id = 1; | |
class Person | |
{ | |
public: |
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); |
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 class SnowFlakeIdWorker { | |
private final long workerId; | |
private final static long twepoch = 1390838400000L; | |
private Long sequence = 0L; | |
private final static long workerIdBits = 4L; | |
public final static long maxWorkerId = -1L ^ -1L << workerIdBits; | |
private final static long sequenceBits = 10L; | |
private final static long workerIdShift = sequenceBits; | |
private final static long timestampLeftShift = sequenceBits + workerIdBits; |
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
# https://stackoverflow.com/questions/13484206/cherrypy-url-dispatcher | |
import cherrypy | |
class City: | |
def __init__(self, name): | |
self.name = name | |
self.population = 10000 |
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 logging | |
import cherrypy | |
from cherrypy.process import plugins | |
class ADPHttpFacetPlugin(plugins.SimplePlugin): | |
def __init__(self, bus): | |
plugins.SimplePlugin.__init__(self, bus) | |
self.logger = logging.getLogger(__name__) |
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
int fit = false; | |
this->testLabel->setText(""); | |
QLabel *myLabel = this->testLabel; | |
QFont myFont = myLabel->font(); | |
QString str = "this is the new string. this is the new string. this is the new string. super long. don't fit. please please please overflow the box"; | |
while (!fit) | |
{ |
OlderNewer