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
function GetQueryString(name) | |
{ | |
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); | |
var r = window.location.search.substr(1).match(reg); | |
if(r!==null) { | |
return unescape(r[2]); | |
} else { | |
return null; | |
} | |
} |
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
<body style="margin:0;"> | |
<div style="overflow:hidden;"> | |
<div id="box" style="width:110%;height:100%;overflow-x:hidden;overflow-y:auto;"> | |
</div> | |
</div> | |
<script> | |
box = document.getElementById("box"); | |
for (var r of ['0', 'f']) | |
for (var g of ['0', 'f']) | |
for (var b of ['0', 'f']) { |
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 <string> | |
#include <sstream> | |
#include <bitset> | |
#include <typeinfo> | |
using namespace std; | |
class cast2bits { | |
private: |
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
export PS1='\[\033[35;1m\]\w\[\033[36;1m\] > \[\033[00m\]' | |
alias ls="ls --color=auto" | |
alias ll="ls -alhF" | |
alias la="ls -a" | |
alias l="ll" | |
alias ..="cd .." |
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 NumberOf1Between1AndN_Solution(int n) | |
{ | |
int ones = 0; | |
for (long long m = 1; m <= n; m *= 10) | |
ones += (n / m + 8) / 10 * m + (n / m % 10 == 1) * (n % m + 1); | |
return ones; | |
} |
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
vector<string> split(const string &str, const string &c) { | |
int start = 0; | |
int npos = str.find(c, start); | |
vector<string> result; | |
while (start < str.length() && npos != str.npos) { | |
result.push_back(str.substr(start, npos - start)); | |
start = npos + c.length(); | |
npos = str.find(c, start); | |
} | |
result.push_back(str.substr(start, str.length() - start)); |
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 <cstring> | |
#include <iomanip> | |
#include <iostream> | |
using namespace std; | |
class Base1 { | |
public: | |
virtual void f() { cout << "Base1::f" << endl; } | |
virtual void g() { cout << "Base1::g" << endl; } | |
virtual void h() { cout << "Base1::h" << endl; } |
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
class PyMsgBox(): | |
def __init__(self): | |
from tkinter import Tk, messagebox | |
self.msgbox = messagebox | |
self.root = Tk() | |
self.root.wm_attributes('-topmost', 1) | |
self.root.withdraw() | |
def info(self, msg): | |
self.msgbox.showinfo("来自ladyrick的提示", msg) |
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
[user] | |
name = ladyrick | |
email = ladyrick@qq.com | |
[alias] | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
[gui] | |
encoding = utf-8 | |
[i18n] | |
commitencoding = utf-8 | |
logoutputencoding = utf-8 |
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 google.protobuf import text_format | |
def ParseFromBinary(bytestr, message): | |
message.ParseFromString(bytestr) | |
def ParseFromText(string, message): | |
text_format.Merge(string, message) | |
def SerializeToBinary(message): | |
return message.SerializeToString() |
OlderNewer