Skip to content

Instantly share code, notes, and snippets.

View radiosilence's full-sized avatar
🔥

James Cleveland radiosilence

🔥
View GitHub Profile
@radiosilence
radiosilence / index.html
Last active August 29, 2015 14:00
Versioned repository pattern for JS
<!doctype html>
<html>
<head>
</head>
<body>
<div id="main" />
<script src=http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js></script>
<script src=http://cdnjs.cloudflare.com/ajax/libs/react/0.10.0/JSXTransformer.js></script>
<script src=http://cdnjs.cloudflare.com/ajax/libs/react/0.10.0/react-with-addons.min.js></script>
<script type="text/jsx">
@radiosilence
radiosilence / gist:b65b268e74b24f0ffc79
Created September 18, 2014 11:56
fucking around with mori
Download the React DevTools for a better development experience: http://fb.me/react-devtools react.js:4356
DOM fully loaded and parsed uitest.html:40
You are using the in-browser JSX transformer. Be sure to precompile your JSX for production - http://facebook.github.io/react/docs/tooling-integration.html#jsx JSXTransformer.js:12703
_
function (obj) {
if (obj instanceof _) return obj;
if (!(this instanceof _)) return new _(obj);
this._wrapped = obj;
} underscore.js:36
mori
@radiosilence
radiosilence / utils.js
Created November 17, 2014 11:32
Handy function to turning a nested object into a list of string based constants.
"use strict";
module.exports = {
constantify: function constantify(app, obj, prevK) {
for (var k in obj) {
var nextK = prevK ? prevK + '.' + k : app + '.' + k;
if (obj[k] === null) obj[k] = nextK;
else constantify(app, obj[k], nextK);
}
return obj;
@radiosilence
radiosilence / gist:167464
Created August 13, 2009 21:25 — forked from tcrayford/gist:167461
what the fuck am I doing
def woopfordocstrings():
'''this is a docstring'''
print( "shittin' balls" )
<?php
// Algotest
/*
For PN,
Assign next in line as target
End For
For PN,
If targets available are only self/other target restart
Here we can see a deadlock - All of paris' targets are either already owned by Edward, or are Edward himself. Assignment is impossible!
Solution?
================
Paris hunters
Array
(
[0] => Edward
[1] => Karl
[2] => Ralph
)
void numtest( double learnparas[], int numhid, int emax, int usevalid, int wopt, char *tstr, char *vstr, char *ustr )
{
// test network on the numerical problem
// specified are the learning rate, momentum, number of hidden neurpons
// emax is max number of epochs for learning
// if usevalid then stop training when SSE on validation set starts to rise
// wopt is seed used to initialise random number generators used to initialise weights
// data files names are in tsr, vstr and ustr
int
// Library Module Implementing Layers of Perceptrons for CY2D7
// Dr Richard Mitchell 18/12/06 ... 17/3/08 ...12/8/09
// Adapted by
#include "mlplayer.h"
#include <math.h>
#include <iomanip>
void dcopy (int num, const double fromarray[], double toarray[]) {
/// copy num doubles from the fromarray to the toarray
% NOTES:
% * HAVE AXIS LABELS PLOTTED
% * Put all the working stuff in Appendix 2
% * Talk about Wien bridges in Discussion
\documentclass[a4paper,10pt]{memoir}
\raggedbottom
\setlength{\unitlength}{1cm}
\usepackage{url}
\usepackage{graphicx}
\usepackage{epstopdf}