Skip to content

Instantly share code, notes, and snippets.

@jyrkive
jyrkive / gist:0dfedf1c74b8f1dd5fc1d23a58c3825a
Created October 12, 2016 17:10
Siduction /disks directory
jyrki@siductionbox:~$ ls -dl /media
drwxr-xr-x 2 root root 4096 Nov 23 2014 /media
jyrki@siductionbox:~$ ls -dl /disks
drwxr-xr-x 4 root root 4096 Oct 21 2015 /disks
jyrki@siductionbox:~$ ls -l /media
total 0
jyrki@siductionbox:~$ ls -l /disks
total 36
drwxr-xr-x 1 root root 20480 Oct 12 16:26 disk1part3
drwxrwxrwx 22 root root 16384 Jan 1 1970 disk1part5
enum FONT_STYLE {
STYLE_NORMAL = 0,
STYLE_BOLD = 1,
STYLE_ITALIC = 2,
STYLE_UNDERLINE = 4
};
std::vector<double> accl_speeds_;
const auto accl_load = [this]()->int {
return std::find(accl_speeds_.begin(), accl_speeds_.end(), turbo_speed()) -
accl_speeds_.begin() + 1;
};
const auto accl_save = [this](int i) {
set_turbo_speed(accl_speeds_[i - 1]);
};
@jyrkive
jyrkive / group.hpp
Last active November 19, 2016 11:36
if (w.get_value_bool()) {
// If this was selected, select another member
if (!res) {
w.set_value_bool(false);
}
do_reselect = !res;
}
constexpr bool is_positive(int x)
{
if (x > 0)
{
return true;
}
else
{
return false;
}
@jyrkive
jyrkive / gist:b9f460172a3128f8921af414482961cb
Created November 25, 2016 21:14
MP test stuck call stack
#0 0x00007fe01d54e81d in nanosleep () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00007fe01d82e855 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#2 0x000055b358092167 in gui2::dialogs::network_transmission::wesnothd_dialog (msg=...,
conn=..., video=...)
at /home/jyrki/wesnoth/src/gui/dialogs/network_transmission.cpp:107
#3 gui2::dialogs::network_transmission::wesnothd_receive_dialog (video=..., msg=...,
cfg=..., connection=...)
at /home/jyrki/wesnoth/src/gui/dialogs/network_transmission.cpp:136
#4 0x000055b35807ac7b in gui2::dialogs::mp_join_game::fetch_game_config (
this=this@entry=0x7ffd9530d6a0, video=...)
@jyrkive
jyrkive / gist:f39df28bcf53baf4c0f27bdb5f1d6e05
Created February 28, 2017 18:57
Failing test call stack
[modify_ai] can only change one component at a time
stack traceback:
[C]: in function '.error'
lua/helper.lua:24: in field 'wml_error'
lua/wml-tags.lua:761: in local 'cmd'
lua/wml-utils.lua:145: in field 'handle_event_commands'
lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
@jyrkive
jyrkive / gist:687938a737b999c590d6f1833a410c59
Created March 7, 2017 17:16
Dr. Memory detecting use-after-free
~~Dr.M~~ Error #1: UNADDRESSABLE ACCESS of freed memory: reading 0x031c1378-0x031c137c 4 byte(s) within 0x031c1378-0x031c137c
~~Dr.M~~ # 0 system call NtDeviceIoControlFile AFD_SEND_INFO.BufferArray[i].buf
~~Dr.M~~ # 1 MSWSOCK.dll!? +0x0 (0x7321769b <MSWSOCK.dll+0x769b>)
~~Dr.M~~ # 2 WS2_32.dll!WSASend +0x11d (0x7712347e <WS2_32.dll+0x1347e>)
~~Dr.M~~ # 3 boost::asio::detail::socket_ops::send [i:\battle for wesnoth\external\include\boost\asio\detail\impl\socket_ops.ipp:1154]
~~Dr.M~~ # 4 boost::asio::detail::socket_ops::non_blocking_send [i:\battle for wesnoth\external\include\boost\asio\detail\impl\socket_ops.ipp:1244]
~~Dr.M~~ # 5 boost::asio::detail::reactive_socket_send_op_base<>::do_perform [i:\battle for wesnoth\external\include\boost\asio\detail\reactive_socket_send_op.hpp:56]
~~Dr.M~~ # 6 boost::asio::detail::
1>------ Build started: Project: wesnoth, Configuration: Debug Win32 ------
1>advanced_graphics_options.cpp
1>attack_predictions.cpp
1>campaign_difficulty.cpp
1>campaign_selection.cpp
1>campaign_settings.cpp
1>chat_log.cpp
1>core_selection.cpp
1>debug_clock.cpp
1>depcheck_confirm_change.cpp
1>------ Build started: Project: wesnothlib, Configuration: Debug Win32 ------
2>------ Build started: Project: liblua, Configuration: Debug Win32 ------
3>------ Build started: Project: WindowsTimeout, Configuration: Debug Win32 ------
3>WindowsTimeout.cpp
3>WindowsTimeout.vcxproj -> I:\Battle for Wesnoth\wesnoth\projectfiles\VC14.1\\..\..\WindowsTimeout.exe
3>WindowsTimeout.vcxproj -> Debug\WindowsTimeout\WindowsTimeout.pdb (Full PDB)
1>color.cpp
1>color_range.cpp
2>lapi.cpp
1>config.cpp