Skip to content

Instantly share code, notes, and snippets.

View maplebeats's full-sized avatar
🎯
Focusing

maplebeats maplebeats

🎯
Focusing
View GitHub Profile
@maplebeats
maplebeats / reverse.c
Last active August 29, 2015 14:06
反转字符串原地操作版
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int strlen(char * str)
{
int i=0;
while(str[i]!='\0')
i++;
return i;
}
@maplebeats
maplebeats / remove_space.c
Created September 18, 2014 16:04
删除空格
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int strlen(char * str)
{
int i=0;
while(str[i]!='\0')
i++;
return i+1;
}
#include <iostream>
using namespace std;
class Test
{
private:
int a;
public:
int *b = new int;
#include <stdio.h>
#include <stdlib.h>
int slen(const char * string){
int i=0;
while(string[i]!='\0'){
i++;
}
return i+1;
}
#!/usr/bin/env python3
import threading
from time import sleep
def wrong():
#Do sth.
print("wrong")
sleep(1)
a = threading.Thread(target=wrong)
def simi_init(self):
simi_Jar = cookiejar.CookieJar()
self.simi_opener = request.build_opener(request.HTTPCookieProcessor(simi_Jar))
self._headers = {
"User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1",
"Accept-Language":"zh-cn,en;q=0.8,en-us;q=0.5,zh-hk;q=0.3",
"Accept-Encoding":"deflate",
"Referer":"http://www.simsimi.com/talk.htm"
}
url = "http://www.simsimi.com/func/req?%s" % parse.urlencode({"msg": "hi", "lc": "zh"})
@maplebeats
maplebeats / gist:3663462
Created September 7, 2012 05:33
pidgin-lwqq日志
*** glibc detected *** pidgin: malloc(): memory corruption: 0x0000000001226120 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x798a6)[0x7f6a6508e8a6]
/usr/lib/libc.so.6(+0x7b328)[0x7f6a65090328]
/usr/lib/libc.so.6(__libc_malloc+0x70)[0x7f6a65091e50]
/usr/lib/purple-2/libwebqq.so(s_malloc0+0x1b)[0x7f6a56e2be8b]
/usr/lib/purple-2/libwebqq.so(lwqq_http_request_new+0x1c)[0x7f6a56e1fc1c]
/usr/lib/purple-2/libwebqq.so(lwqq_http_create_default_request+0x23)[0x7f6a56e1fdf3]
/usr/lib/purple-2/libwebqq.so(lwqq_msg_send+0x370)[0x7f6a56e2a8b0]
/usr/lib/purple-2/libwebqq.so(_background_send_msg+0x90)[0x7f6a56e18e50]
@maplebeats
maplebeats / soft
Created July 19, 2012 14:25
pacman -Q
a52dec 0.7.4-6
aalib 1.4rc5-9
abs 2.4.3-2
acl 2.2.51-2
aliedit 1.0.3.20-1
alsa-lib 1.0.25-1
alsa-utils 1.0.25-3
archlinux-keyring 20120622-1
archlinux-lxdm-theme 1-1
aspell 0.60.6.1-1