Skip to content

Instantly share code, notes, and snippets.

View sapier's full-sized avatar

sapier

View GitHub Profile
@sapier
sapier / gist:9853279
Created March 29, 2014 12:02
mesh calcs
updateAllFastFaceRows
3* MAP_BLOCK_SIZE exp 2 835584
updateFastFaceRow 1088
getTileInfo
4* getSmoothLight 64
2* getSmoothLight 16
8* getNodeNoEx
MAP_BLOCK_SIZE * 16*64 1024
GetTileInfo
4* getSmoothLight 16*4 64
@sapier
sapier / gist:9850401
Created March 29, 2014 07:56
GPROF result xoropad 20140329 1
This file has been truncated, but you can view the full file.
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
7.11 3.70 3.70 238850514 0.00 0.00 irr::core::vector3d<short>::vector3d(short, short, short)
6.40 7.03 3.33 77973180 0.00 0.00 irr::core::vector3d<short>::operator+(irr::core::vector3d<short> const&) const
6.19 10.25 3.22 143454145 0.00 0.00 irr::core::vector3d<short>::vector3d(irr::core::vector3d<short> const&)
5.06 12.88 2.63 72247636 0.00 0.00 irr::core::vector3d<short>::operator-(irr::core::vector3d<short> const&) const
2.50 14.18 1.30 101654468 0.00 0.00 MapNode::MapNode(unsigned short, unsigned char, unsigned char)
Formspec toolkit api 0.0.2
==========================
Formspec toolkit is a set of functions to create basic ui elements.
File: fst/ui.lua
----------------
ui.lua adds base ui interface to add additional components to.
----------------variant A
local function somefunc(self,a)
print("Have: " .. dump(self.have) .. " GOT: " .. a)
end
local sometable = {}
sometable.tablefunc = somefunc
sometable.have = "havesomething"
#!/usr/bin/lua
local status, module = pcall(require, 'socket')
local mytable = {}
mytable.func = function(self,a)
self.val = self.val + a
end
mytable.val = 0
-o ../bin/minetest -rdynamic -lz -lSM -lICE -lX11 -lXext -lGLU -lGL -lSM -lICE -lX11 -lXext -ljpeg -lbz2 -lpng -lz -Wl,-Bstatic -lIrrlicht -Wl,-Bdynamic -lopenal -lvorbisfile -lvorbis -logg -lsqlite3 -lluajit-5.1 json/libjsoncpp.a -lpthread -lrt -ldl -lXxf86vm -lcurl -lfreetype cguittfont/libcguittfont.a -lGLU -lGL -ljpeg -lbz2 -lpng -lopenal -lvorbisfile -lvorbis -logg -lsqlite3 -lluajit-5.1 -lpthread -lrt -ldl -lXxf86vm -lcurl -lz -Wl,-Bstatic -lIrrlicht -Wl,-Bdynamic -lfreetype
-o ../bin/minetest -rdynamic -lz -lSM -lICE -lX11 -lXext -lGLU -lGL -lSM -lICE -lX11 -lXext -ljpeg -lbz2 -lpng -lz -Wl,-Bstatic -lIrrlicht -Wl,-Bdynamic -lopenal -lvorbisfile -lvorbis -logg sqlite/libsqlite3.a -lluajit-5.1 json/libjsoncpp.a -lpthread -lrt -ldl -lXxf86vm -lcurl -lSM -lICE -lX11 -lXext -lGLU -lGL -ljpeg -lbz2 -lpng -Wl,-Bstatic -lIrrlicht -Wl,-Bdynamic -lopenal -lvorbisfile -lvorbis -logg -lluajit-5.1 -lpthread -lrt -ldl -lXxf86vm -lcurl
==22407== Thread 3:
==22407== Invalid write of size 8
==22407== at 0xB811FE: luaV_gettable (lvm.c:117)
==22407== by 0xB690C6: lua_getfield (lapi.c:551)
==22407== by 0x5B7589: AsyncWorkerThread::Thread() (s_async.cpp:276)
==22407== by 0x5ABA1A: JThread::TheThread(void*) (jthread.cpp:156)
==22407== by 0x6E4CB4F: start_thread (pthread_create.c:304)
==22407== by 0x81580EC: clone (clone.S:112)
==22407== Address 0xe14cac0 is 16 bytes before a block of size 3,456 alloc'd
==22407== at 0x4C28CCE: realloc (vg_replace_malloc.c:632)
------------------------------- doc/lua_api.txt -------------------------------
index f4e1fd2..6ed5608 100644
@@ -986,32 +986,28 @@ vertlabel[<X>,<Y>;<label>]
^ label is the text on the label
^ Position and size units are inventory slots
-button[<X>,<Y>;<W>,<H>;<name>;<label>]
+button[<X>,<Y>;<W>,<H>;<name>;<label>;<tooltip>]
^ Clickable button. When clicked, fields will be sent.
^ x, y and name work as per field
------------------------------- doc/lua_api.txt -------------------------------
index f4e1fd2..6ed5608 100644
@@ -986,32 +986,28 @@ vertlabel[<X>,<Y>;<label>]
^ label is the text on the label
^ Position and size units are inventory slots
-button[<X>,<Y>;<W>,<H>;<name>;<label>]
+button[<X>,<Y>;<W>,<H>;<name>;<label>;<tooltip>]
^ Clickable button. When clicked, fields will be sent.
^ x, y and name work as per field
--------------------------------- src/test.cpp ---------------------------------
index dd26919..8a08045 100644
@@ -1517,22 +1517,29 @@ struct TestSocket: public TestBase
const char sendbuffer[] = "hello world!";
IPv6AddressBytes bytes;
bytes.bytes[15] = 1;
- socket6.Send(Address(&bytes, port), sendbuffer, sizeof(sendbuffer));
+
+ try {
+ socket6.Send(Address(&bytes, port), sendbuffer, sizeof(sendbuffer));