Skip to content

Instantly share code, notes, and snippets.

View antiface's full-sized avatar

A.G. antiface

View GitHub Profile
#!/usr/bin/env python
#
# Copyright (C) 2011 by Ben Noordhuis <info@bnoordhuis.nl>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@antiface
antiface / geomancia.py
Created March 26, 2014 06:08
My first official Python program. Attempted merely as a casual intellectual pursuit. Honestly, I found the math most awesome, the fact that people were doing this in medieval times, was just too amazing. Thank the Lord for Python and the great community of theoretical computer scientists, computer programmers, informaticians, etc., the world ove…
import random
Mothers = [[random.choice([1,2]) for x in xrange(0,4)] for x in xrange(0,4)]
FirstDaughter = [x[0] for x in Mothers]
SecondDaughter = [x[1] for x in Mothers]
ThirdDaughter = [x[2] for x in Mothers]
FourthDaughter = [x[3] for x in Mothers]
def my_func(val):
from Population import Population
from Individual import Individual
from random import random, randint
class Algorithm():
#Constants
Uniform_rate = 0.5
Mutation_rate = 0.015
Tournament_size = 5
from functools import partial
def _composed(f, g, *args, **kwargs):
return f(g(*args, **kwargs))
def compose(*a):
try:
return partial(_composed, a[0], compose(*a[1:]))
except:
return a[0]
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
background: #000;
}
</style>
<body>
<html>
<head>
<title>Minimal River Reader</title>
<script src="http://fargo.io/code/jquery-1.9.1.min.js"></script>
</head>
<body>
<script>
var theRiver;
function onGetRiverStream (updatedFeeds) {
theRiver = updatedFeeds;
function fbUpdatePost (idPost, thePostText) {
FB.api (idPost, "post", {message: thePostText}, function (response) {
console.log ("fbUpdatePost: response == " + JSON.stringify (response, undefined, 4));
});
}

Keybase proof

I hereby claim:

  • I am antiface on github.
  • I am antiface (https://keybase.io/antiface) on keybase.
  • I have a public key whose fingerprint is 1927 7D23 5031 A13A CD49 CC35 104B 3E0E A61B E865

To claim this, I am signing this object:

{
"created_at": "Fri Sep 19 12:20:23 +0000 2014",
"id": 512939257850511360,
"id_str": "512939257850511360",
"text": "\"I never used the Blackberry again.\" https://t.co/CYsbbBDtOh",
"source": "<a href=\"http://radio3.io/\" rel=\"nofollow\">radio3.io</a>",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
@antiface
antiface / pets.py
Last active August 29, 2015 14:06 — forked from jhamrick/pets.py
class Pet(object):
def __init__(self, name, species):
self.name = name
self.species = species
def getName(self):
return self.name
def getSpecies(self):