Skip to content

Instantly share code, notes, and snippets.

View Marenz's full-sized avatar

Mathias L. Baumann Marenz

  • Berlin
  • 02:33 (UTC +02:00)
View GitHub Profile
@Marenz
Marenz / gist:4c29a17e82a864b61170
Created May 18, 2014 13:17
Crashing UDK's json parser
{
"servers": [
{
"ip": "107.170.132.78",
"port": 7777,
"title": "NewYork-011",
"description": "Official server",
"max_players": 12,
"max_spectators": 20,
"max_duration": 20,
root@85-31-186-85:/srv/graphite/conf# cat storage-schemas.conf
# Schema definitions for Whisper files. Entries are scanned in order,
# and first match wins. This file is scanned for changes every 60 seconds.
#
# [name]
# pattern = regex
# retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ...
# Carbon's internal metrics. This entry should match what is specified in
# CARBON_METRIC_PREFIX and CARBON_METRIC_INTERVAL settings
@Marenz
Marenz / diff.d
Created September 25, 2015 11:02
//before
in_buffer.length = packet_length;
conn.read(in_buffer);
// now
while ( in_buffer.length < packet_size && conn.connected )
{
if ( conn.waitForData(1.seconds) )
@Marenz
Marenz / gist:1064630
Created July 5, 2011 10:33
boost linker errors
Errors:
libmaidsafe_common-d-0_09_02.a(file_chunk_store.cc.o): In function `boost::filesystem3::copy_file(boost::filesystem3::path const&, boost::filesystem3::path const&, boost::filesystem3::copy_option)':
/usr/include/boost/filesystem/v3/operations.hpp:300: undefined reference to `boost::filesystem3::detail::copy_file(boost::filesystem3::path const&, boost::filesystem3::path const&, boost::filesystem3::copy_option, boost::system::error_code*)'
libmaidsafe_common-d-0_09_02.a(file_chunk_store.cc.o): In function `boost::filesystem3::copy_file(boost::filesystem3::path const&, boost::filesystem3::path const&, boost::filesystem3::copy_option, boost::system::error_code&)':
/usr/include/boost/filesystem/v3/operations.hpp:307: undefined reference to `boost::filesystem3::detail::copy_file(boost::filesystem3::path const&, boost::filesystem3::path const&, boost::filesystem3::copy_option, boost::system::error_code*)'
Available Symbol:
nm /usr/lib/libboost_filesystem.a --demangle | grep boost::filesystem3::detail::cop
@Marenz
Marenz / file_chunk_store.h.patch
Created July 5, 2011 12:21
patch for MaidSafe-Common
--- file_chunk_store.h.org 2011-07-05 14:20:46.218355096 +0200
+++ file_chunk_store.h 2011-07-05 14:20:50.218499494 +0200
@@ -43,6 +43,8 @@
# pragma warning(disable: 4127)
#endif
+#define BOOST_NO_SCOPED_ENUMS
+
#include "boost/filesystem.hpp"
#include "boost/filesystem/fstream.hpp"
@Marenz
Marenz / bt
Created September 27, 2015 20:53
Starting program: /home/marenz/supragames/masterserver/masterserver
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
returning from scopebuf
returning unittest
FREEING 7FFFFFFFD810
@Marenz
Marenz / all.d
Created September 27, 2015 21:01
struct ScopeBuffer ( Type, size_t size = 512 )
{
static import std.internal.scopebuffer;
struct Range
{
ScopeBuffer!(Type, size)* buf;
void put ( T... ) ( auto ref T t ) { this.buf.put(t); }
}
const void toString ( scope void delegate(const(char)[]) sink )
{
struct SinkOutputRange
{
void put ( const(char)[] t ) { sink(t); }
}
SinkOutputRange r;
mysql_escape(input, r);
}
@property auto spots ()
{
if ( !this.both_sides )
{
// Return only red spots if set to only one side
return spots_red.take(required_players);
}
return chain(spots_red.take(required_players/2),
spots_blue.take(required_players/2));
class SyncedArray ( T )
{
import std.typecons;
/***************************************************************************
Data
***************************************************************************/