Skip to content

Instantly share code, notes, and snippets.

View JAChapmanII's full-sized avatar

Jeff Chapman II JAChapmanII

View GitHub Profile
@JAChapmanII
JAChapmanII / 4letter words
Last active December 24, 2015 12:09
words
abbe
abbr
abed
able
acct
aced
aces
ache
achy
acid
@JAChapmanII
JAChapmanII / ss.cpp
Created September 13, 2013 16:35
stringstream input
#include <iostream>
#include <sstream>
using namespace std;
int main() {
stringstream ss;
ss << "5 10 20";
cin.rdbuf(ss.rdbuf());
int n;
while(cin >> n) {
21:36 -!- bk [[email protected]] has joined #uakroncs
21:37 * bk punches Nibbles
21:37 < bk> someone from your host is trying to connect a regular client to an SSL
port
21:37 -!- smalls [[email protected]] has quit
[Quit: Nettalk6 - www.ntalk.de]
21:37 < bk> for 12 hours
21:38 * omalley takes a drink
21:38 -!- smalls [[email protected]] has joined
#uakroncs
@JAChapmanII
JAChapmanII / b.log
Created April 13, 2013 19:10
partially implemented
reading types...
reading type effectiveness...
reading species data...
reading form data...
reading proto move data...
reading move data...
reading form stats...
reading monster types...
Mewtwo: 25 iv:{ 19, 2, 16, 19, 23, 16 } ev:{ 3, 13, 11, 0, 21, 3 } stats:{ 92, 61, 54, 86, 57, 74 } =
Rain Dance, Magic Coat, Sleep Talk, Energy Ball
@JAChapmanII
JAChapmanII / pinkserv2.log
Created March 19, 2013 13:26
private log with PINKSERV2
2013-03-16 11:54:56 PINKSERV2 jac: OK! :D
2013-03-19 09:20:43 PINKSERV2 Sorry, I don't know anything about that
2013-03-19 09:20:50 jac !markov Nolshine loves
2013-03-19 09:20:50 PINKSERV2 Sorry, I don't know anything about that
2013-03-19 09:20:54 jac !markov nolshine loves
2013-03-19 09:20:54 PINKSERV2 Sorry, I don't know anything about that
2013-03-19 09:21:00 jac !markov Solshine hates
2013-03-19 09:21:00 PINKSERV2 Sorry, I don't know anything about that
2013-03-19 09:21:15 jac !markov Solshine loathes
2013-03-19 09:21:16 PINKSERV2 Sorry, I don't know anything about that
@JAChapmanII
JAChapmanII / ex.rb
Created January 29, 2013 13:09
to_hash thing
class Thing
def initialize
@fname = ""
@lname = ""
@index = 0
end
def to_hash
hash = {}
instance_variables.each { |var|
hash[var.to_s.delete("@")] = instance_variable_get(var)
@JAChapmanII
JAChapmanII / startup
Created January 23, 2013 19:48
list of current commands
moudles::init: PINKSERV2.brain
read dictionary, size is: 0
reading modules:
loading core (core functions)
loading markov (markov data)
2 modules read
discovered functions:
irc (issues an IRC command) [core]
echo (displays it's arguments) [core]
#!/usr/bin/perl
use strict;
use warnings;
my @arr = ("<f><e><e>stuff</e></e></f>" =~ /<f>(<e>((?1)|[^<>]+)<\/e>)<\/f>/g);
print join("\n", @arr);
print "\n";
#!/usr/bin/perl
if("catdog" =~ "/catdog/") {
print "match\n";
} else {
print "no match\n";
}
@JAChapmanII
JAChapmanII / christmas.txt
Created December 22, 2012 20:53
pbrane's AST: a -syntax- christmas tree
jac@Ratushnyak ~/p/p/src (future)> g++ -std=c++0x evaluation.cpp -I../lib ../obj/util.o -g -o eval; and segfind ./eval "!ho (ho * (ho + ho)) (Merry * Christmas) * (Merry * Christmas) + (MerryChristmas * MerryChristmas) * (HoHoHoHappyHolidays * HoHoHoHappyHolidays) xx"
1: !ho (ho * (ho + ho)) (Merry * Christmas) * (Merry * Christmas) + (MerryChristmas * MerryChristmas) * (HoHoHoHappyHolidays * HoHoHoHappyHolidays) xx
; ! ho ( ; ho * ( ; ho + ho ; ) ; ) ( ; Merry * Christmas ; ) * ( ; Merry * Christmas ; ) + ( ; MerryChristmas * MerryChristmas ; ) * ( ; HoHoHoHappyHolidays * HoHoHoHappyHolidays ; ) xx ;
^~~~~~~~~~^
; ! ho ( ; ho * ( ; ho + ho ; ) ; ) ( ; Merry * Christmas ; ) * ( ; Merry * Christmas ; ) + ( ; MerryChristmas * MerryChristmas ; ) * ( ; HoHoHoHappyHolidays * HoHoHoHappyHolidays ; ) xx ;
^~~~~~~~~~~~~~^
; ! ho ( ; ho * ( ; ho + ho ; ) ; ) ( ; Merry * Christmas ; ) * ( ; Merry * Christmas ; ) + ( ; MerryChristmas * MerryChristmas ; ) * ( ; HoHoHoHappyHolidays * H