Skip to content

Instantly share code, notes, and snippets.

@AlaskanEmily
AlaskanEmily / frobulate.cpp
Created January 3, 2019 05:39
An example of auto for a method result, in a template
class FloatHolder {
float GetValue() const;
void SetValue(float);
};
class IntHolder {
int GetValue() const;
void SetValue(int);
};
@AlaskanEmily
AlaskanEmily / test.m
Created September 29, 2018 21:55
Mercury compiler assert test case
% Any copyright is dedicated to the Public Domain.
% http://creativecommons.org/publicdomain/zero/1.0/
:- module test.
%==============================================================================%
% Released by Transnat Games for testing purposes.
%
% Causes an assert in the Mercury compiler:
% Software Error: hlds.assertion: predicate `hlds.assertion.record_preds_used_in'/4: Unexpected: invalid pred_id
H4sIAHugJlsA/21RTUsDMRT8K5KTwhaSVGvZnGQReil79CAeXpPUBneTJR/SWtbf7nu1lFZ7eZ
DJzLyZZM8ieBP6ifNDyZOv4G1i9Z5xGgcMj6971ofO6tJZVrMG4ir4m2XwYeuMVU2rhJhJrqSY
c84qpkPxmdUPY3WhW+xMDO/Wq8U3lygRgiTiXPI4vo1jxdZua82VROwFso0HfXsymHOhpCQbVI
aS/9c4y7CELninb560M6oho9umbRd3h0RyJiRazQQaYiGhplRIiSlNLue0jtM6wWk1DeTQaiWn
Fz0EpxqYNYLzrJYV62E7iRZ0DhGD3VdsA2mSMkQksXoNXbK/GKRk+1W3uwCNS1dxMJ/gtTUXoC
+6s4CuOZYjlMpg6dPMn2XR6h2ST9y8G+iVhhhM0dkFj5U89ITRi7m103CEoeRNiHTRQfoA/9w7
DFcxJCGrdBmT8vEHyzYYyl8CAAA=
include <stdlib.h>
#include <ncurses.h>
/* setting up typing function */
char * nr_echo( int start_y, int start_x, int h, int w, int *out_count ){
int ch, y, x, end_y, end_x, ch_count ;
int ch_count_in;
char *stored_line;
stored_line = malloc(100000);
@AlaskanEmily
AlaskanEmily / multi_math.m
Created February 24, 2018 23:46
MMC Compiler crash
:- module multi_math.
%==============================================================================%
:- interface.
%==============================================================================%
:- import_module float.
% add(A, B, C) :- C = A + B
% Used for multi-moded addition.
:- pred add(float, float, float).
$ mmc --output-libgrades
none.gc.spf.stseg.rbmm
none.gc.spf.stseg
none.gc.spf.debug.stseg
none.gc.spf.debug
none.gc.memprof.spf.stseg
none.gc.debug
hlc.gc.spf
hlc.gc.pregen
hlc.gc.memprof
:- module testmodule.
:- interface.
% This exports:
% :- type t.
% pred do_stuff(int::in, int::in, int::in, t::out) is det.
% pred do_stuff(int::in, int::in, int::in, float::in, t::out) is det.
:- use_module othermodule.
@AlaskanEmily
AlaskanEmily / wlink_help
Created October 19, 2017 03:05
WLink Help
@AlaskanEmily
AlaskanEmily / emirc.py
Last active January 8, 2022 17:28
Quick IRC example in Python
import socket
import select
import sys
class emirc:
def __init__(self):
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# The buffer contains any messages or parts of messages we receive
"""
Simple IRC Bot for Twitch.tv
Developed by Aidan Thomson <aidraj0@gmail.com>
"""
import lib.irc as irc_
from lib.functions_general import *
import lib.functions_commands as commands