This file contains hidden or 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 <string> | |
| #include <windows.h> | |
| #pragma comment(lib, "Advapi32.lib") | |
| std::string getOSInfo() | |
| { | |
| std::string value; | |
| HKEY result; | |
| BYTE data[MAX_PATH] = {0}; | |
| DWORD length = MAX_PATH; |
This file contains hidden or 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 "AFURLResponseSerialization.h" | |
| @interface AFTextResponseSerializer : AFHTTPResponseSerializer | |
| @end |
This file contains hidden or 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
| // | |
| // macro.h | |
| // | |
| // create by kyle. 2013.11 | |
| // https://gist.github.com/kylescript/7332390 | |
| #ifdef DEBUG | |
| #define debugLog(...) NSLog(__VA_ARGS__) | |
| #define debugMethod() NSLog(@"%s", __func__) | |
| #else |
This file contains hidden or 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
| // | |
| // KHookObjectWrapper.h | |
| // ObjectHook | |
| // | |
| // Created by kyle on 13-12-13. | |
| // Copyright (c) 2013年 kyle. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |
This file contains hidden or 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
| - (char)getFirstPinyinChar:(NSString *)text { | |
| NSInteger index = [[UILocalizedIndexedCollation currentCollation] sectionForObject:text collationStringSelector:@selector(self)]; | |
| NSString *englishLetter = [[[UILocalizedIndexedCollation currentCollation] sectionIndexTitles] objectAtIndex:index]; | |
| return [englishLetter characterAtIndex:0]; | |
| } |
This file contains hidden or 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 <map> | |
| #include <string> | |
| void print(const std::map<int, std::string> &map) | |
| { | |
| for (auto it=map.begin(); it!=map.end(); it++) { | |
| printf("key = %d, value=%s\n", it->first, it->second.c_str()); | |
| } | |
| } |
This file contains hidden or 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
| //复杂的宏实现,效率确实比较高一些,但有点小瑕疵,需要继续分割“//”才能消除警告 | |
| #define _ToStr(x) #x | |
| #define __ToStr(x) _ToStr(x) | |
| #define HTTP_HEADER http:/\/www.google.com/ | |
| #define WEBSITE_INDEX1 @__ToStr(HTTP_HEADER)"index1.html" | |
| #define WEBSITE_INDEX2 @__ToStr(HTTP_HEADER)"index2.html" |
This file contains hidden or 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 urllib import urlencode | |
| import cookielib, urllib2, urllib, re, os | |
| _loginweb = "http://0.0.0.0:8080/" | |
| _userinfo = { 'os_username': "wangkangan", | |
| 'os_password': "***", | |
| 'os_cookie':'true'} | |
| def issue(opener, issue): | |
| op = opener.open(_loginweb + "browse/" + issue + "?page=com.atlassian.jira.plugin.ext.subversion:subversion-commits-tabpanel") |
This file contains hidden or 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 "stdafx.h" | |
| #include <regex> | |
| using namespace std; | |
| int main() | |
| { | |
| string str = "xxxABC999yjdskABC444阿凡ABC0_达ABC77汉字eABC9"; | |
| const regex reg("ABC[0-9]+"); | |
| smatch results; |
This file contains hidden or 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 flask import Flask, render_template, jsonify, request | |
| from threading import Timer, Thread | |
| from time import sleep | |
| app = Flask(__name__) | |
| @app.route("/api/<method>") | |
| def api(method): | |
| data = { |