Skip to content

Instantly share code, notes, and snippets.

View Marenz's full-sized avatar

Mathias L. Baumann Marenz

  • Berlin
  • 21:50 (UTC +02:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am marenz on github.
  • I am m4renz (https://keybase.io/m4renz) on keybase.
  • I have a public key ASD5SLLPBTiEd2yoyQXoLUQ55yQzHAP01uz5zuc-y-pfRgo

To claim this, I am signing this object:

Program terminated with signal SIGABRT, Aborted.
#0 0x00007f784906f067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 0x00007f784906f067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007f7849070448 in __GI_abort () at abort.c:89
#2 0x00007f78493f507a in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#3 0x00007f78493f5517 in _Unwind_Resume () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#4 0x0000000001894323 in TCPHandler.TCPHandler.newConnection() (this=0x7f784adb2340, conn=0x47db600)
at source/TCPHandler.d:176
@Marenz
Marenz / wtf.d
Created February 15, 2017 13:05
// C'tor, sets up timer to refresh settings periodically
this ( MatchmakingManager _mm )
out
{
assert(this.mm !is null); // fails
}
body
{
assert(_mm !is null); // succeeds
import std.algorithm;
alias filterZeros2 = filter!(a=>a!=0);
class C
{
alias filterZeros = filter!(a=>a!=0);
size_t doCount ( ) const
import std.stdio;
import std.range;
import std.algorithm;
import std.traits;
void main ()
{
auto data = [[1,2], [3,4], [5], [6]];
class SomeClass
{
void someFunc ( )
{
int[] some_array;
import std.algorithm;
bool func ( int f )
{
/+
Expected usage:
auto manager = new MySqlConnectionManager(..);
{
// Suspends the fiber if no connection available
// Will automatically free the connection when the scope is left
auto con = manager.get();
    int opApply ( scope int delegate ( T element ) @nogc dg ) const @nogc
{
int forward ( size_t, ref T el ) @nogc
{
return dg(el);
}
return (cast(SyncedArray!T)this).opApply(&forward);
}  
import std.stdio;
import std.random;
import std.range;
void main ()
{
auto rnd = new Random(0);
auto rnd1 = new Random(0);
auto a = iota(10).randomCover(rnd).dropOne.array;
auto s_zip = assumeSameStructure!("g", "i", "s_prev", "f")(
this.state.g, this.state.i, this.s_prev, this.state.f);
this.state.s = s_zip.ndMap!(z => z.g * z.i + z.s_prev * z.f).slice;
// vs
this.state.s = this.state.g.perElement!mul(this.state.i)
.perElement!add(this.s_prev.perElement!mul(this.state.f));