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
class AStar(object): | |
def __init__(self, graph): | |
self.graph = graph | |
def heuristic(self, node, start, end): | |
raise NotImplementedError | |
def search(self, start, end): | |
openset = set() | |
closedset = set() |
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
-- func to be hooked | |
function test(a,b) | |
print('\norg test'); | |
print('a='..a..' b='..b) | |
return a,b; | |
end | |
-- store original func | |
org_test = test; |
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
# -*- coding: utf-8 -*- | |
import sys | |
from PySide.QtCore import * | |
from PySide.QtGui import * | |
from PySide.QtWebKit import * | |
class Scrape(QApplication): | |
def __init__(self): | |
print('init') | |
super(Scrape, self).__init__(sys.argv) |
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
/* | |
* Impact Plugin | |
* NotificationManager | |
* Written by Abraham Walters | |
* July 2011 | |
* Jxyzzy Dev Company | |
* jxyzzy.com | |
* | |
* This plugin extends the Font class and allows you to pop-up a | |
* text Notification (spawnNote()), move it (this.pos) and have |
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
std::ifstream in("some.file"); | |
std::istreambuf_iterator<char> beg(in), end; | |
std::string str(beg, end); | |
// or | |
std::ifstream in("some.file"); | |
std::ostringstream tmp; | |
tmp << in.rdbuf(); | |
std::string str = tmp.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
#include <luabind/luabind.hpp> | |
#pragma comment(lib,"libluabindd.lib") | |
#pragma comment(lib,"lua51.lib") | |
#include <iostream> | |
using namespace std; | |
using namespace luabind; | |
class testlua | |
{ |
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
# -*- coding: utf-8 -*- | |
import urllib2 | |
import urllib | |
import cookielib | |
minus_invite = "http://min.us/rjRVW6n" #邀请地址 | |
commit_url = "http://minus.com/api/login/register" #注册地址 | |
def open_url(): | |
"""打开邀请地址""" |
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
原帖地址: http://topic.csdn.net/u/20110113/19/b0d5d506-4307-428b-a61d-7974aa66a2da.html | |
首先要说明的是:这里介绍的方法都是大部分是本人“悟”出来的,所以网上难有流传! | |
好方法不能自己私藏,否则就白忙乎这几天了,分享给有需要的朋友们。如果有转载,敬请注明来自*CSDN老邓*作品。 | |
呵呵,给自己打广告,实在是无耻之极,权当无聊之时打字之用。 | |
欢迎流传,为最优秀的分布式版本管理系统Git做宣传!! | |
步骤: | |
1. 下载:http://loaden.googlecode.com/files/gitconfig.7z | |
2. 解压到:<MsysGit安装目录>/cmd/,例如:D:\Program Files\Git\cmd |
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
CString GetModuleDirectory(void) | |
{ | |
TCHAR tempstr[1024]; | |
::GetModuleFileName(AfxGetInstanceHandle(),tempstr,sizeof(tempstr)); | |
CString mulu; | |
mulu.Format(_T("%s"),tempstr); | |
mulu = mulu.Left(mulu.ReverseFind('\\')+1); | |
return mulu; | |
} |