This file contains 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
local list = {} | |
local v_map = {} | |
local count = 20 | |
math.randomseed(os.time()) | |
local function gen_data() | |
for i=1,count do | |
local r = math.random(1, 100) | |
list[i] = {objid=r} | |
v_map[r] = r |
This file contains 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
diff xls2lua_pool.py xls2lua.py !10017 | |
20,21d19 | |
< from multiprocessing import Pool | |
< from functools import partial | |
773,774d770 | |
< def wrap_conv_xls(args, file_names_): | |
< convet_xls_file(args[0], args[1], file_names_=file_names_) | |
809,811d804 | |
< p = Pool(8) | |
< |
This file contains 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
#! /usr/bin/env lua | |
--1. git config diff.xml_diff.textconv xml_diff.lua | |
---- file: .git/config | |
---- [diff "xml_diff"] | |
---- textconv = xml_diff.lua | |
--2. file: .gitattributes] | |
---- *.xml diff=xml_diff |
This file contains 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
#!/usr/bin/env python | |
""" | |
A simple echo server | |
""" | |
import socket | |
host = '' | |
port = 50000 |
This file has been truncated, but you can view the full file.
This file contains 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
Build Preparation | |
Dependency cycle for target 'LuaHostMac' detected: LuaHostMac -> LuaHostMac | |
Build target libquickcocos2dx | |
ProcessPCH /Users/MobileGame/Library/Developer/Xcode/DerivedData/LuaHostMac-certifysiadpjhbqxeskvaiuofpk/Build/Intermediates/PrecompiledHeaders/libquickcocos2dx-ambgnlepjrpfnzgpszalouayuxqz/libquickcocos2dx.pch.pth libquickcocos2dx.pch normal i386 c com.apple.compilers.llvm.clang.1_0.compiler | |
cd /Users/MobileGame/Work/quick-cocos2d-x/lib/proj.mac |
This file contains 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
/Users/mobileGame/Work/quick-cocos2d-x/lib/proj.android/../cocos2d-x/scripting/lua/cocos2dx_support/LuaCocos2d.cpp: In function 'int tolua_Cocos2d_CCTMXMapInfo_getTileProperties00(lua_State*)': | |
/Users/mobileGame/Work/quick-cocos2d-x/lib/proj.android/../cocos2d-x/scripting/lua/cocos2dx_support/LuaCocos2d.cpp:41775:75: error: invalid conversion from 'void*' to 'int' [-fpermissive] | |
/Users/mobileGame/Work/quick-cocos2d-x/lib/proj.android/../cocos2d-x/scripting/lua/cocos2dx_support/LuaCocos2d.cpp:41775:75: error: cannot convert 'char const*' to 'int*' for argument '3' to 'int toluafix_pushusertype_ccobject(lua_State*, int, int*, void*, char const*)' | |
/Users/mobileGame/Work/quick-cocos2d-x/lib/proj.android/../cocos2d-x/scripting/lua/cocos2dx_support/LuaCocos2d.cpp: In function 'int tolua_Cocos2d_CCTMXMapInfo_formatWithTMXFile00(lua_State*)': | |
/Users/mobileGame/Work/quick-cocos2d-x/lib/proj.android/../cocos2d-x/scripting/lua/cocos2dx_support/LuaCocos2d.cpp:42113:75: error: invalid conversion from 'void*' to 'int' [-fp |
This file contains 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
[Thread debugging using libthread_db enabled] | |
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". | |
Core was generated by `./HelloLua'. | |
Program terminated with signal 11, Segmentation fault. | |
#0 0x0000000000000000 in ?? () | |
(gdb) bt | |
#0 0x0000000000000000 in ?? () | |
#1 0x00007fea6fbc5c82 in cocos2d::CCGLProgram::initWithVertexShaderByteArray (this=0x21e9900, | |
vShaderByteArray=0x7fea6fce18f8 '\t' <repeats 13 times>, "\nattribute vec4 a_position;\t\t\t\t\t\t\t\nattribute vec2 a_texCoord;\t\t\t\t\t\t\t\nattribute vec4 a_color;\t\t\t\t\t\t\t\t\n", '\t' <repeats 13 times>, "\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\nvarying lowp vec4 v_fragmentColor;\t\t\t\t\t\nvarying m"..., | |
fShaderByteArray=0x7fea6fce1b00 '\t' <repeats 11 times>, "\n#ifdef GL_ES\t\t\t\t\t\t\t\t\nprecision lowp float;\t\t\t\t\t\t\n#endif\t\t\t\t\t\t\t\t\t\t\n", '\t' <repeats 11 times>, "\nvarying vec4 v_fragmentColor;\t\t\t\t\nvarying vec2 v_texCoord;\t\t\t\t\t\nuniform sampler2D CC_Texture0;\t\t\t\t\n", '\t' <repeats 11 time |
This file contains 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
#encoding:utf8 | |
def analyze(filename): | |
statics = {} | |
with open(filename) as fh: | |
for line in fh: | |
infos = line.split() | |
obj_name, obj_size, _, refs = infos[0:4] | |
statics[obj_name] = [int(refs), int(obj_size)] | |
return statics |
This file contains 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
// At this point, I'd like to take a moment to speak to you about the Adobe PSD format. | |
// PSD is not a good format. PSD is not even a bad format. Calling it such would be an | |
// insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format. Having | |
// worked on this code for several weeks now, my hate for PSD has grown to a raging fire | |
// that burns with the fierce passion of a million suns. | |
现在,请允许我花一小会给你说一下adobe家的psd格式。PSD不是一个好格式,它甚至算不上一个坏格式。 | |
将它称为坏格式,简直是对其他坏格式的侮辱,例如PCX或者JPEG。TMD,PSD是一个糟糕透了的格式。 | |
在连续数周码这段代码之后,我对PSD的厌恶已经增长到犹如狂暴的怒火,猛烈得犹如灿烂千阳。 | |
This file contains 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 -*- | |
def update(module_name): | |
import types, gc, re | |
def test_and_process_list(obj, old, new): | |
if not isinstance(obj, list): return | |
# find the references in list | |
refs = [ index for index, item in enumerate(obj) if item is old ] | |
# update the list |
NewerOlder