This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* lstm.c | |
| * | |
| * Character‑level LSTM with BPTT. | |
| * | |
| * Features | |
| * • No back‑space / in‑place updates – every status line is printed on a new line. | |
| * • At the start of training it prints: | |
| * Loading <file>. Training for <num_epochs> epochs. | |
| * • Every 100 epochs the loss value is printed, followed by a 128‑character | |
| * generated sample on the next line. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * vertex.js — single-file library combining: | |
| * | |
| * 1. VQuery — DOM layer (hn.js-inspired, jQuery surface-compatible) | |
| * 2. Reconciler — Fiber-based React clone (pomb.us architecture + hooks) | |
| * 3. template — Mustache template engine + component loader (Vertex.template) | |
| * 4. Router — Backbone-style hash router (class-based + singleton) | |
| * 5. Glue — useHash hook, unified Vertex namespace | |
| * | |
| * jQuery compatibility: if jQuery / $ already exist on the page they are |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| law.py — Decentralised Legislative System over a DHT | |
| ===================================================== | |
| A single-file implementation of a fully decentralised legislative system | |
| where laws are proposed, drafted, and voted into existence by citizens | |
| holding cryptographic identity keys issued by a birth-certificate authority. | |
| OVERVIEW | |
| -------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # Implements a scaffold for rapidly developing a REST API. | |
| import os | |
| import sys | |
| import pwd | |
| import time | |
| import optparse | |
| from gevent.wsgi import WSGIServer | |
| from flask import Flask | |
| from flask.ext import restful |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // gcc -c $(python2.7-config --cflags) simplepython.c | |
| // gcc simplepython.o $(/usr/bin/python2.7-config --ldflags) -o simplepython | |
| #include <Python.h> | |
| int main(int argc, char *argv[]) | |
| { | |
| Py_SetProgramName(argv[0]); /* optional but recommended */ | |
| Py_Initialize(); | |
| PyRun_SimpleString("from time import time,ctime\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| pthread "github.com/lukeb42/go-pthreads" | |
| "fmt" | |
| "io" | |
| "log" | |
| "net" | |
| "time" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| startup_message off | |
| autodetach on | |
| hardstatus alwayslastline | |
| #hardstatus string "%{= kw} %l %{.kK} %-= @%H - %LD %d %LM - %c " | |
| hardstatus string "%{= kw} %l %{.kK}%-w%{.KW}%n %t%{-}%+w %-= @%H - %LD %d %LM - %c " | |
| #hardstatus alwaysignore | |
| vbell off | |
| #term screen-256color | |
| caption splitonly "%{.kK}%-w%{.KW}%n %t%{-}%+w" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # _*_ coding: utf-8 _*_ | |
| # | |
| # Usage: emrange int:start int:stop | |
| # Examples: emrange ; Display the total number of articles | |
| # emrange -5 ; Display the last five articles | |
| # emrange 0 5 ; Display the first five articles | |
| # | |
| import sys | |
| from emissary.models import Article |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # Use PyMarkovChain to generate markov chains from news articles. | |
| import sys, os | |
| from emissary.models import Article | |
| from pymarkovchain import MarkovChain | |
| mc = MarkovChain(os.getenv('HOME') + os.sep + '.markovdb') | |
| if __name__ == "__main__": | |
| if len(sys.argv) < 3: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Print resident set size of a process | |
| ps aux|grep $*|grep -v grep|grep -v bash|awk '{$6=$6/1024; print $6 "MB\t" $11 "\t" $1;}'|sort -n |
NewerOlder