Skip to content

Instantly share code, notes, and snippets.

@seronis
seronis / App32Pix.java
Created November 3, 2012 18:30
understanding Swing
import javax.swing.*;
import javax.swing.border.EtchedBorder;
import java.awt.*;
import java.awt.event.*;
/**
* Created with IntelliJ IDEA.
* User: seronis
* Date: 10/30/12
* Time: 10:04 PM
@seronis
seronis / TheApp.java
Created November 15, 2012 20:07
Color Cycle Test
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created with IntelliJ IDEA.
* User: seronis
* Date: 11/15/12
* Time: 2:55 PM
AlertMsgType@[] alertTypes;
class AlertMsgType {
string@ name;
string@ genMsg;
string@ badMsg;
AlertEntry@[] list;
int spamLimit; //max msgs to queue before grouping
float spamDelay; //time between messages
float lastMsg;
@seronis
seronis / bldVals.as
Created January 10, 2013 18:36
print() crashes when called with bldVals oloc = //initialization; oloc.print( pl.toObject().getName() + " oloc" );
class bldVals {
float gcap;
float pcap;
float city;
float farm;
float metl;
float elec;
float advp;
float yard;
@seronis
seronis / DisableKeyRepeats.java
Created June 8, 2013 17:10
AWTEventListener to enforce exactly one keyPressed/keyReleased event is triggered per user action with no superfluous repeats.
package seronis.util;
import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.Toolkit;
import java.awt.event.AWTEventListener;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
package seronis.testing;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.IOException;
@seronis
seronis / Makefile
Created November 23, 2013 02:35
ultimate mud makefile
CC = g++
EXE = game
C_FLAGS = -Wall -std=c++11
L_FLAGS = -lcrypt -lz
# Source Files
SRC_FILES := $(wildcard *.cpp)
# Directories
OBJ_DIR_D = ../obj/Debug
@seronis
seronis / Die.java
Created November 11, 2014 19:26
Dice class for reddit
package com.seronis.reddit.dicebag;
import java.util.Random;
public abstract class Die {
protected int value;
protected int sides;
protected boolean froze;
protected Random rand = new Random();
#include "myInnerClass.h"
myInnerClass::myInnerClass( int _val1, int _val2 )
{
val1 = _val1;
val2 = _val2;
}
myInnerClass::~myInnerClass()
{
@seronis
seronis / main.c
Last active August 29, 2015 14:10
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>