Skip to content

Instantly share code, notes, and snippets.

View DanielVF's full-sized avatar

Daniel Von Fange DanielVF

View GitHub Profile
you = "Frog"
me = "Frog"
you == me # True
using System.Reflection;
using System.Collections;
public static void ShowProperties(Object myObject){
Hashtable PropertiesOfMyObject = new Hashtable();
Type t = myObject.GetType();
PropertyInfo[] pis = t.GetProperties();
for (int i=0; i<pis.Length; i++) {
PropertyInfo pi = (PropertyInfo)pis.GetValue(i);
Console.WriteLine(pi.Name);
-- Learning both Lua, and OpenGL. Probably NOT GOOD CODE.
-- But it's pretty in action.
-- Click to add squares.
require 'luagl'
require 'luaglut'
local fps = 60
local msec = 1000 / fps
quit = false
//in public void Update()
//change
if (updateResult.Errors) { throw new CouldNotUploadBudget(); }
//to
if (updateResult.Errors) { throw new CouldNotUploadBudget( this, updateResult); }
//change
public class CouldNotUploadBudget : System.Exception { }
//to
public class CouldNotUploadBudget : System.Exception {
<?
// Written for my own use, 2009
function select_exisiting_or_new($object,$field_name){
// To use:
// echo select_exisiting_or_new($product,'manufacturer')?
$current_value = $object->$field_name;
$possible_values = $object->query("SELECT `$field_name` from $object->table_name GROUP BY `$field_name` ORDER BY `$field_name`");
@DanielVF
DanielVF / lionback_template.php
Created January 19, 2010 13:52
PHP template engine for emailing form results.
// PHP template engine for emailing form results.
class LionbackTemplate{
function LionbackTemplate($template,$data){
$this->template=$template;
$this->data=$data;
}
function render(){
from suds.client import Client
URL = 'https://ws.customertest.newdea.com/NonprofitServices_100.asmx?wsdl'
LOGIN = ''
PASSWORD = ''
ORGXID = ''
client = Client(URL, timeout=600)
diff --git a/docco.coffee b/docco.coffee
index beb6ec7..399fe80 100644
--- a/docco.coffee
+++ b/docco.coffee
@@ -25,11 +25,11 @@
# and merging them into an HTML template.
generate_documentation: (source) ->
ensure_directory ->
- set_language source
code: fs.readFile source, (error, code) ->
var config = {
planet_font: 'bold 15px Arial,Helvetica ',
planet_pixels: [10,13,18,21,23,29],
display_size: 640,
display_margin: 50,
framerate: 5
}
// Setup Context
@DanielVF
DanielVF / game_simulator.py
Created March 1, 2011 15:04
Written to simulate games using the 'likelihood of superiority' bayesian elo results dump from the conclusion of the 2010 Google AI challenge. -- Daniel Von Fange
import random
"""
Written to simulate games using the 'likelihood of superiority'
bayesian elo results dump from the conclusion of the 2010 Google AI challenge.
-- Daniel Von Fange
"""
# We offset off this to find the scores