Skip to content

Instantly share code, notes, and snippets.

View haxpor's full-sized avatar
🤓
Some of my financial tools https://www.mql5.com/en/users/haxpor/seller

Wasin Thonkaew haxpor

🤓
Some of my financial tools https://www.mql5.com/en/users/haxpor/seller
View GitHub Profile
@haxpor
haxpor / dep.txt
Created July 27, 2019 03:59
Note on package requirement automatically installed by Setup.sh script of ue 4.18
libmono-system-web-extensions4.0-cil
install -y libmono-system-data-datasetextensions4.0-cil
libmono-csharp4.0c-cil libmono-microsoft-csharp4.0-cil mono-dmcs mono-mcs
mono-dmcs
mono-xbuild
mono-devel
libmono-system-runtime4.0-cil
libmono-system-io-compression-filesystem4.0-cil
libmono-system-io-compression4.0-cil
libmono-windowsbase4.0-cil
@haxpor
haxpor / Contiguous.cpp
Created July 15, 2019 01:54
Test code following and adapting from https://stackoverflow.com/a/35008842/571227 to check if such STL container store its elements in contiguous way or not. Compile it will `g++ -std=c++11 Contiguous.cpp`
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <deque>
#include <array>
#include <string>
@haxpor
haxpor / in.h
Last active July 12, 2019 22:29
sockaddr and sockaddr_in struct. The size of both structure equals. The textbook (unix network programming book) said because in that time, there's no void* pointer yet, thus it has to be casted to generic socket address structure.
/* Structure describing an Internet socket address. */
struct sockaddr_in
{
__SOCKADDR_COMMON (sin_);
in_port_t sin_port; /* Port number. */
struct in_addr sin_addr; /* Internet address. */
/* Pad to size of `struct sockaddr'. */
unsigned char sin_zero[sizeof (struct sockaddr) -
__SOCKADDR_COMMON_SIZE -
@haxpor
haxpor / code.h
Created July 9, 2019 04:36
section of code showing why shared_ptr has flaw when using raw pointer as input in constructor, because it won't increase the reference count. Only when send in shared_ptr via copy constructor, and assignment operator, will it increase reference count.
template<_Lock_policy _Lp = __default_lock_policy>
class __shared_count
{
public:
__shared_count()
: _M_pi(0) // nothrow
{ }
template<typename _Ptr>
__shared_count(_Ptr __p) : _M_pi(0)
#include "Holder.h"
#include <algorithm>
/*
==================
Constructor
==================
*/
abziHolder::abziHolder( int size ) {
Init( size );
@haxpor
haxpor / openbor.log
Last active May 30, 2019 14:57
openbor log when loading a save file. Used ctrl+c to see location of code in execution via gdb
Thread 1 "OpenBOR-debug-1" received signal SIGINT, Interrupt.
0x000055555565eaa9 in List_AddHash (list=0x55555eca0304,
node=0x55555ec6e880) at source/scriptlib/List.c:65
65 save = list->buckets[h]->size;
(gdb) where
#0 0x000055555565eaa9 in List_AddHash (list=0x55555eca0304,
node=0x55555ec6e880) at source/scriptlib/List.c:65
#1 0x00005555556600e3 in List_InsertAfter (list=0x55555eca0304,
e=0x55555ec63b90, theName=0x55555ec70620 "L20")
at source/scriptlib/List.c:639
@haxpor
haxpor / openbor-note.md
Created May 13, 2019 04:17
all about openbor note
  • weapnum define the weapon number globally to be used in the game, this affects weapons when used in character's script
@haxpor
haxpor / a1-dumplog.log
Created May 4, 2019 10:47
dump log from `identify -verbose ...` of working sprite a1.gif of williams in Double Dragon Reloaded
Image: data/chars/williams/a1.gif
Format: GIF (CompuServe graphics interchange format)
Mime type: image/gif
Class: PseudoClass
Geometry: 200x200+0+0
Units: Undefined
Colorspace: sRGB
Type: Palette
Base type: Undefined
Endianess: Undefined
@haxpor
haxpor / zombie-gifdump.log
Created May 4, 2019 10:34
result from `identify -verbose ....` of zombie image sprite given for OpenBOR issue at https://github.com/DCurrent/openbor/issues/141
Image: Zombie01Walk001-3.gif
Format: GIF (CompuServe graphics interchange format)
Mime type: image/gif
Class: PseudoClass
Geometry: 250x250+0+0
Units: Undefined
Colorspace: sRGB
Type: Palette
Base type: Undefined
Endianess: Undefined
@haxpor
haxpor / zombie-processed-only.log
Created May 3, 2019 12:44
dump of `identify -verbose ...` of processed only gif image of zombie sprite
Image: Zombie-only-processed.gif
Format: GIF (CompuServe graphics interchange format)
Mime type: image/gif
Class: PseudoClass
Geometry: 250x250+0+0
Units: Undefined
Colorspace: sRGB
Type: Palette
Base type: Undefined
Endianess: Undefined