code
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<time.h> | |
#include "bigInt.h" | |
using namespace std; | |
BigInt::BigInt(){ //构造函数 | |
head = tail = temp = NULL; | |
symbol = '+'; | |
length = 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
#include <iostream> | |
using namespace std; | |
class Date | |
{ | |
public: | |
Date(int y=0, int m=0, int d=0):year(y), month(m), day(d){} | |
friend bool operator>(const Date& da, const Date& db); | |
int getyear()const; | |
int getmonth()const; |
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
var i,j; | |
var result = ''; | |
for(i=2000; i<2100; ++i){ | |
[1, 3, 5, 7, 8, 10, 12].forEach(function(j){ | |
d = new Date(i, j - 1); | |
if(d.getDay() == 5){ | |
result += d.getFullYear() + '年' + (d.getMonth() + 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
(setq elephant "elephant form global") | |
(defun print-elephant () | |
(message elephant) | |
) | |
(defun test-let-variable () | |
(print-elephant) | |
(message elephant) | |
(let ((elephant "elephant from let")) |
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
优化前: | |
+----+-------------+------------+--------+---------------+---------+---------+------------------------+------+----------------------------------------------+ | |
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | | |
+----+-------------+------------+--------+---------------+---------+---------+------------------------+------+----------------------------------------------+ | |
| 1 | SIMPLE | ttb | ALL | NULL | NULL | NULL | NULL | 10 | Using where; Using temporary; Using filesort | | |
| 1 | SIMPLE | dt | ALL | PRIMARY | NULL | NULL | NULL | 5 | Using where; Using join buffer | | |
| 1 | SIMPLE | tc | eq_ref | PRIMARY | PRIMARY | 4 | tp_db.ttb.topic_id | 1 | | | |
| 1 | SIMPLE | last_reply | eq_ref | PRIMARY | PRIMARY | 4 |
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 User{ | |
static public function instance(){ | |
static my_user = User() | |
return my_user; | |
} | |
public function setToken(token){ | |
this.token = token | |
} |
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
for file_path in $(find . -name '*.cpp');do clean_file_path=${file_path:2} ;mv -v $file_path ${clean_file_path//\//_} ; done | |
# 第1版 | |
for file_path in $(find Images);do clean_file_path=$file_path ;mv -v $file_path ${file_path%/*}/${clean_file_path//\//_} ; done |
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> | |
using namespace std; | |
class Foo{ | |
public: | |
Foo(){ | |
cout << "Foo constructor" << 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
args = { | |
'_id': 'xxx', | |
'group': 123 | |
} | |
cursor = db.table.find(args) | |
args.pop('_id') | |
data = list(cursor) | |
# 这样得到的data是没有_id = 'xxx'这个条件的查询结果 |
NewerOlder