Skip to content

Instantly share code, notes, and snippets.

@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))))
@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: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
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: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.
NameClashSameErasureNoOverride1.java:37: error: name clash: m(Integer) in NameClashSameErasureNoOverride1.B overrides a
method whose erasure is the same as another method, yet neither overrides the other
public void m(Integer l) {}
^
first method: m(Object) in NameClashSameErasureNoOverride1.A
second method: m(X) in I
where X is a type-variable:
X extends Object declared in interface I
1 error
Erasure.java:7: error: name clash: m(Erasure<Integer>) in B and m(Erasure<String>) in A have the same erasure, yet neith
er hides the other
static void m(Erasure<Integer> l) {}
^
1 error
@barik
barik / gist:8172843
Created December 29, 2013 17:48
Windows Update Issue
2013-12-29 12:47:12:923 952 408 AU Triggering AU detection through DetectNow API
2013-12-29 12:47:12:923 952 408 AU Additional Service {117CAB2D-82B1-4B5A-A08C-4D62DBEE7782} with Approval type {Scheduled} added to AU services list
2013-12-29 12:47:12:924 952 408 AU Triggering Online detection (interactive)
2013-12-29 12:47:12:924 952 b40 AU #############
2013-12-29 12:47:12:924 952 b40 AU ## START ## AU: Search for updates
2013-12-29 12:47:12:924 952 b40 AU #########
2013-12-29 12:47:12:924 952 b40 AU Additional Service {117CAB2D-82B1-4B5A-A08C-4D62DBEE7782} with Approval type {Scheduled} added to AU services list
2013-12-29 12:47:12:925 952 b40 IdleTmr WU operation (CSearchCall::Init ID 15) started; operation # 123; does use network; is not at background priority
2013-12-29 12:47:12:925 952 b40 IdleTmr Incremented PDC RefCount for Network to 1
2013-12-29 12:47:12:925 952 b40 IdleTmr Incremented idle timer priority operation counter to 2
@barik
barik / gist:8303188
Created January 7, 2014 17:38
Emacs LaTeX Output for latexmk under Windows/MikTeX [TeX-show-compilation]
Running `LatexMk' on `hello' with ``latexmk "hello.tex"''
Latexmk: This is Latexmk, John Collins, 10 Nov 2013, version: 4.39.
**** Report bugs etc to John Collins <collins at phys.psu.edu>. ****
Rule 'pdflatex': File changes, etc:
Changed files, or newly in use since previous run(s):
'hello.tex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
class Foo {
class Inner {}
Inner r = new<String> Inner();
}