Skip to content

Instantly share code, notes, and snippets.

View LizardLeliel's full-sized avatar

Evan Larose LizardLeliel

  • Halifax, Canada
View GitHub Profile
@LizardLeliel
LizardLeliel / mail.muf
Last active February 5, 2016 02:23
muf code, for implementing a very functional @mail command to handle reading, sending, and deleting mail. Some parts aren't mine, but are used with permission. Other then that, most of this is my work.
(newmailsend.muf)
$include #3 (ansilib.muf)
$include #6 (Useful.muf)
( words appearing in this program in order:
greenline - pushes a greenline onto the stack.
usage - notifies the caller the basic commands.
usage2 - notifies the caller some more advanced commands.
sendusage - If a string is on the stack, it'll notify it to
@LizardLeliel
LizardLeliel / transliteration.py
Last active October 17, 2015 17:25
A function for translating romaji into either hiragana or katana (but no way to do it reverse so far)
prefixTable = {
"" : 0 , "k" : 5 , "s" : 10, "t" : 15, "n" : 20,
"h" : 25, "m" : 30, "y" : 35, "r" : 40, "w" : 45,
"g" : 50, "z" : 55, "d" : 60, "p" : 65, "b" : 70,
"j" : 75, "ky": 80, "sh": 85, "ny": 90, "hy": 95,
"py": 100, "by": 105, "my": 110, "ch": 115, "ry": 120,
"gy": 125, "f" : 130, "ts": 135, "v" : 140,
"elongations" : 145,
"nn" : 150, ".": 151, "," : 152, "smalltsu" : 153, " " : 154,
@LizardLeliel
LizardLeliel / layeredNetwork.py
Created June 25, 2015 19:08
Two multi-layered perception neural networks, one using theano and the other not.
# My first layered neural network thingy,
# Whooooo.
# No Theano just yet. Maybe Numpy.
# Numpy will require me to express everything
# with as little iteration as possible. That's
# what bugs me about that library >_<. You can
# only hope everything broadcasts correctly!
import numpy
import theano
@LizardLeliel
LizardLeliel / geneNetwork.py
Created June 22, 2015 14:51
Its a hardcoded neural network that was built so I could have just a neural network, regardless of implementation (so I can build off, reference, change, etc.). By the way its python3
# How nessecary is this?
class Gene:
def __init__(self, inNeuron, outNeuron, weight = 1):
# inNeuron and outNeuron represent array indices
self.inNeuron = inNeuron
self.outNeuron = outNeuron
self.weight = weight
def compareOuts(self, otherGene):
if self.outNeuron < otherGene.outNeuron: return -1
elif self.outNeuron > otherGene.outNeuron: return 1
@LizardLeliel
LizardLeliel / a) main.cpp
Created January 23, 2015 16:43
Virtual Stack Things
#include <ostream>
#include <string>
#include "vStacks.h"
using namespace std;
int main(int argc, char** argv) {
virtualStack* thisThing = new spamNode("Hello");
@LizardLeliel
LizardLeliel / matrices.rb
Last active August 29, 2015 14:12
Amazing. Happy new year!
class Vec < Array
def initialize(ary)
super(@vec = ary)
end
def *(scalar)
Vec.new (
@vec.map { |element|
@LizardLeliel
LizardLeliel / RubyRot.rb
Created December 31, 2014 17:34
Ruby class for 2x2 matrices, plus a section that rotates around a grid
# Our class
class Matrix2by2
# Initialize with a 2x2 list
def initialize(x, y)
if not (x.is_a? Array and y.is_a? Array) then
throw(:notArray)
end
if (x.length != 2 and y.length != 2) then
throw(:notEqual)
@LizardLeliel
LizardLeliel / SortedLinkedListInsertion.c
Created December 6, 2014 17:34
Just a snippit to show someone
void pushSortedAdjNode(adjNode** listHead, int newID, int newDistance) {
adjNode* newNode = malloc(sizeof(adjNode));
newNode->id = newID;
newNode->distance = newDistance;
if (*listHead == NULL || (*listHead)->distance >= newDistance) {
newNode->next = *listHead;
*listHead = newNode;
return;
}
@LizardLeliel
LizardLeliel / FloatingBinaries
Created November 14, 2014 17:53
It actually prints out the binaries of double numbers
#include <cstdlib>
#include <cstdio>
#include <iostream>
// Last one is for cin.ignore()
using namespace std;
typedef enum binDigPlaces {
b1 = 0x01,
b2 = 0x02,
b3 = 0x04,
@LizardLeliel
LizardLeliel / IWasBored.C
Created November 13, 2014 22:04
I was bored :V. Have fun
#include <stdlib.h>
typedef struct Node{void*data;int type;struct Node*next;}dynamicNode;int main()
{dynamicNode*first=(dynamicNode*)malloc(sizeof(dynamicNode));first->next=
(dynamicNode*)malloc(sizeof(dynamicNode));int m=4;float q=4.5;first->data=(void
*)(&m);first->next->data=(void*)(&q);printf("%f\n",(*(int*)first->data+*(float*
)first->next->data));int*a=(int*)malloc(sizeof(int));float*b=(float*)malloc(
sizeof(float));first->next->next=(dynamicNode*)malloc(sizeof(dynamicNode));
first->next->next->next=(dynamicNode*)malloc(sizeof(dynamicNode));first->next->
next->data=(void*)a;first->next->next->next->data=(void*)b;*a=5;*b=22.4;printf(
"%f\n",(*(int*)first->next->next->data+*(float*)first->next->next->next->data))