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
# -*- 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
-- 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
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
#if !defined(UTILHY_SINGLETON_INCLUDED_) | |
#define UTILHY_SINGLETON_INCLUDED_ | |
////////////////////////////////////////// | |
// 使用: | |
// 1, 继承 public CSingleton<T> | |
// 2, 增加成员量: friend class CSingleton<T>; | |
////////////////////////////////////////// | |
template <class T> | |
class CSingleton { |
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
void crypt_test() | |
{ | |
zipFile zf = zipOpen("myarch.zip",APPEND_STATUS_ADDINZIP); | |
int ret = zipOpenNewFileInZip(zf, | |
"myfile.txt", | |
&zfi, | |
NULL, 0, | |
NULL, 0, | |
"my comment for this interior file", | |
Z_DEFLATED, |
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
Show hidden characters
{ | |
"cmd": ["/AutoHotkey/App/AutoHotkey.exe", "/ErrorStdOut", "$file"], | |
"file_regex": "^[ ]*File \"(...*?)\",\nline ([0-9]*)", | |
"selector": "source.ahk", | |
"working_dir": "$file_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
// get_pyfiles.cpp : 定义控制台应用程序的入口点。 | |
// | |
#include <Python.h> | |
#include <Windows.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
int main(int argc, char* 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
// 使用CCLabelBMFont创建文字 | |
// arial16.fnt可以在cocos2d-x包里找到 | |
CCLabelBMFont* label = CCLabelBMFont::labelWithString("Hello World", "arial16.fnt"); | |
label->setPosition(ccp(320, 480)); | |
label->setScale(5); | |
addChild(label); | |
// 为每个单独的字设定颜色 | |
for (int i=0; i<label->getChildrenCount(); i++) | |
{ | |
CCSprite* sub = (CCSprite*)label->getChildByTag(i); |
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
function display.newFrames(pattern, begin, length, isReversed) | |
local frames = {} | |
local step = 1 | |
local last = begin + length - 1 | |
if isReversed then | |
last, begin = begin, last | |
step = -1 | |
end |