Skip to content

Instantly share code, notes, and snippets.

@barik
barik / gist:7281640
Last active December 27, 2015 06:29
class MyClass(object):
@staticmethod
def foo(name):
print("Hello!")
MyClass.foo("Hello")
MyClass().foo("Hello") # Fails without @staticmethod.
1. What is the worst that could happen?
2. What would I do if the worst really happened?
3. How would I lessen the pain and get on with as much happiness as possible if the worst did occur?
4. What alternatives would I have?
5. What can I do now to lessen the probability of this dreaded event occurring?
6. Is there anything I can do now to increase my changes of achieving my goal?
@barik
barik / gist:5268472
Created March 29, 2013 03:03
FIE2013
We report on the experience of teaching an elective, pilot course on Artificial Intelligence (AI) in Computer Games within the Simulation and Game Design department at a two-year community college during a 16-week Fall 2012 semester. An advisory committee comprising both academic and industry members added the course to address two primary concerns: 1. to evaluate if teaching through game design can positively increase attitudes about Computer Science, and 2. to assess alternative pedagogical approaches, which include a blended classroom model, active learning techniques, and the use of practical, computer-based coding exercises and exams in lieu of traditional multiple-choice or true-false formats. We selected Python as the course programming language, based on suggestions from industry partners and academic literature. The course content can be summarized as two weeks of learning the Python language features, an additional two weeks reviewing mathematical foundations, and the remaining semester time on AI g
@barik
barik / gist:4680192
Created January 31, 2013 04:28
mIRC ZNC
alias -l config {
; Mandatory settings
; var %TIMESTAMP_PATTERN = ^\[(\d\d:\d\d:\d\d)\].*$
var %TIMESTAMP_PATTERN = ^\[(\d\d:\d\d:\d\d)\].*$
var %PLAYBACK_BEGIN = Buffer Playback...
var %PLAYBACK_END = Playback Complete.
var %VARIABLE_PREFIX = gbuffer
; Optional settings
; Indent wrapped lines
@barik
barik / gist:4392729
Created December 27, 2012 22:35
Land of Lisp #' confusion.
(let ((car "Honda Civic"))
(mapcar #'car '((foo bar) (baz qux))))
(let ((car "Honda Civic"))
(mapcar 'car '((foo bar) (baz qux))))
(let ((car "Honda Civic"))
(mapcar car '((foo bar) (baz qux))))
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 5154K 1292M RH-Firewall-1-INPUT all -- any any anywhere anywhere
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 0 0 RH-Firewall-1-INPUT all -- any any anywhere anywhere
Chain OUTPUT (policy ACCEPT 554K packets, 172M bytes)
num pkts bytes target prot opt in out source destination
@barik
barik / gist:4236736
Created December 7, 2012 21:36
break message
message = "ABC[DE]F[GH]I"
def breakmessage(message):
brace = False
out = []
for s in message:
@barik
barik / gist:4082925
Created November 16, 2012 00:57
Generics for Donghoon
Step 0: Java Generics
Step 1:
A lesson on generics can be found here:
http://docs.oracle.com/javase/tutorial/java/generics/
JLS is at (search Generic):
http://docs.oracle.com/javase/specs/jls/se7/html/index.html
@barik
barik / gist:3703491
Created September 12, 2012 01:23
Cognitive model for counting
CL-USER> (run 1)
0.000 GOAL SET-BUFFER-CHUNK GOAL FIRST-GOAL REQUESTED NIL
0.000 PROCEDURAL CONFLICT-RESOLUTION
0.000 PROCEDURAL PRODUCTION-SELECTED START
0.000 PROCEDURAL BUFFER-READ-ACTION GOAL
0.050 PROCEDURAL PRODUCTION-FIRED START
0.050 PROCEDURAL MOD-BUFFER-CHUNK GOAL
0.050 PROCEDURAL MODULE-REQUEST RETRIEVAL
0.050 PROCEDURAL CLEAR-BUFFER RETRIEVAL
0.050 DECLARATIVE START-RETRIEVAL
@barik
barik / gist:3366009
Created August 16, 2012 02:57
Conferences
| Conference Name | Date | URL |
|-----------------+---------------+-------------------------------------------|
| FIE | January 1 | http://www.fie2012.org |
| IJCAI | January 9 | http://ijcai.org/ |
| AAAI | January 20 | http://www.aaai.org/ |
| KDD | February 10 | http://www.kdd.org/ |
| DiGRA | February 12 | http://www.digra.org/ |
| OOPSLA | April 13 | http://splashcon.org/2012/ |
| CIG | April 15 | http://www.ieee-cig.org/ |
| UIST | April 22 | http://www.acm.org/uist/uist2011/ |