上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 24 下一页
摘要: Given 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y. Sin 阅读全文
posted @ 2017-05-08 22:13 cdongyang 阅读(268) 评论(0) 推荐(0)
摘要: 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long LL; 4 const int N=1e6+10; 5 const int INF=0x3f3f3f3f; 6 int cas=1,T; 7 int c[N]; 阅读全文
posted @ 2017-05-08 22:09 cdongyang 阅读(202) 评论(0) 推荐(0)
摘要: 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long LL; 4 void gcd(LL a, LL b, LL &d, LL &x, LL &y) 5 { 6 if (!b) 7 { 8 d = a; 9 x = 阅读全文
posted @ 2017-05-08 19:57 cdongyang 阅读(245) 评论(0) 推荐(0)
摘要: 1 #include <bits/stdc++.h> 2 using namespace std; 3 int p,x,y,a[26]; 4 bool init(int s) 5 { 6 int i=s/50%475; 7 for (int j=0;j<25;j++) 8 { 9 i=(i*96+4 阅读全文
posted @ 2017-05-08 14:51 cdongyang 阅读(339) 评论(0) 推荐(0)
摘要: 1 package Network 2 3 import ( 4 "SQL/myDB" 5 "database/sql" 6 "logs" 7 "net/http" 8 ) 9 10 func dbPage(w http.ResponseWriter, req *http.Request) { 11 阅读全文
posted @ 2017-05-06 12:38 cdongyang 阅读(610) 评论(0) 推荐(0)
摘要: 1 func newfileUploadRequest(uri string, form map[string]string, formFileName, path string) error { 2 file, err := os.Open(path) 3 if err != nil { 4 re 阅读全文
posted @ 2017-05-06 12:35 cdongyang 阅读(223) 评论(0) 推荐(0)
摘要: 1 package Network 2 3 import ( 4 "encoding/base64" 5 "encoding/json" 6 "net/http" 7 "os" 8 "strings" 9 "time" 10 "token" 11 ) 12 13 func getFile(w htt 阅读全文
posted @ 2017-05-06 12:31 cdongyang 阅读(308) 评论(0) 推荐(0)
摘要: 修改ubuntu DNS的步骤 阅读全文
posted @ 2017-05-06 12:17 cdongyang 阅读(256) 评论(0) 推荐(0)
摘要: 测并发时由于使用db时没有lock,当连接数超过postgres设定的最大值时报错too many clients,于是问了下老师,老师说用连接池,一开始打开固定个数的db,每次都用这些db,而且每个db用的时候要加锁 于是就开始想如何用lock来实现每次让进来的数据库请求排队,每次分配一个空闲的d 阅读全文
posted @ 2017-05-06 11:44 cdongyang 阅读(2342) 评论(0) 推荐(0)
摘要: 1 package token 2 3 import ( 4 "crypto/md5" 5 "fmt" 6 "io" 7 "math/rand" 8 "sync" 9 "time" 10 ) 11 12 type User struct { 13 ID string 14 Timer *time.T 阅读全文
posted @ 2017-05-06 11:42 cdongyang 阅读(1538) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 24 下一页