Skip to content

Instantly share code, notes, and snippets.

View ExcaliburZero's full-sized avatar

Christopher Wells ExcaliburZero

  • California, United States
  • 05:36 (UTC -07:00)
View GitHub Profile
@ExcaliburZero
ExcaliburZero / SootPrintMethodsByteCode.scala
Created November 28, 2018 23:55
Printing out the methods in a class using Soot
import soot.Scene
import scala.collection.JavaConverters._
object SootPrintMethods {
def main(args: Array[String]): Unit = {
Scene.v().loadClassAndSupport("java.lang.Object")
val a = Scene.v().getSootClass("java.lang.Object")
Scene.v().loadNecessaryClasses()
@ExcaliburZero
ExcaliburZero / extract_log_L_and_log_Teff.py
Created October 30, 2018 19:43
MESA Profile File Aggregation Script (log_L, log_Teff)
import os.path
import sys
import numpy as np
import pandas as pd
def main():
"""
$ python extract_log_L_and_log_Teff.py LOGS/ log_L_and_log_Teff.csv
"""
@ExcaliburZero
ExcaliburZero / Lib.hs
Created March 22, 2017 18:48
Oswego CSA - Haskell Workshop Code
module Lib where
import Text.Parsec
import Text.Parsec.String (Parser)
someFunc :: IO ()
someFunc = putStrLn "someFunc"
numberStringParser :: Parser String
numberStringParser = many1 digit
@ExcaliburZero
ExcaliburZero / inverse
Created December 15, 2016 02:41
Inverse
#!/usr/bin/python
import sys
if len(sys.argv) >= 2:
print 1.0 / float(sys.argv[1])
@ExcaliburZero
ExcaliburZero / results.txt
Created December 4, 2016 18:20
Lyrae Results
mysql> SELECT Observation.id, Observation.time, Observation.light, Observation.error, Result.classifier, Result.chance FROM Observation INNER JOIN Result ON (Observation.id = Result.id AND Observation.time = Result.time);
+---------------+------------+--------+-------+------------+-------------------+
| id | time | light | error | classifier | chance |
+---------------+------------+--------+-------+------------+-------------------+
| OGLE-0001.dat | 2088.91535 | 18.868 | 0.078 | Period | 0 |
| OGLE-0001.dat | 2090.87535 | 19.54 | 0.165 | Period | 0 |
| OGLE-0001.dat | 2103.92958 | 18.704 | 0.04 | Period | 0 |
| OGLE-0001.dat | 2104.94812 | 19.291 | 0.098 | Period | 0 |
| OGLE-0001.dat | 2106.84596 | 18.91 | 0.066 | Period | 0 |
| OGLE-0001.dat | 2116.82993 | 18.935 | 0.057 | Period | 0 |
@ExcaliburZero
ExcaliburZero / graph_rr_lyrae.py
Last active November 25, 2016 18:32
A Python script for graphing RR Lyrae data.
import sys
import matplotlib.pyplot as plt
def main():
if not len(sys.argv) == 3:
print("Invalid number of arguments.")
print("python graph_rr_lyrae.py INPUTFILE OUTPUTFILE")
sys.exit(1)
else:
@ExcaliburZero
ExcaliburZero / lsstbroker_test.py
Last active November 18, 2016 17:45
A small test of the lsstbroker.
import binary_classifier
import classifier
import classifier_box
import handler
import observation
###
# Define classifiers
###
def function(_):
@ExcaliburZero
ExcaliburZero / recording.xml
Last active March 14, 2016 03:07
OscP5 Recording Example
<?xml version="1.0" encoding="UTF-8"?>
<oscp5messages>
<message channel="/muse/elements/blink" time="129" value="0" />
<message channel="/muse/elements/jaw_clench" time="132" value="0" />
<message channel="/muse/elements/blink" time="259" value="0" />
<message channel="/muse/elements/jaw_clench" time="259" value="0" />
<message channel="/muse/elements/blink" time="343" value="0" />
<message channel="/muse/elements/jaw_clench" time="343" value="0" />
<message channel="/muse/elements/blink" time="478" value="0" />
<message channel="/muse/elements/jaw_clench" time="478" value="0" />
@ExcaliburZero
ExcaliburZero / init.lua
Last active January 21, 2016 21:34
Minetest issue #3398 test mod
-- A node that is solid, but is also set to be wallmounted
minetest.register_node("test3398:solid_wallmount", {
description = "Solid Wallmount",
tiles = {"default_stone.png"},
groups = {cracky = 3, stone = 1},
drop = 'test3398:solid_wallmount',
paramtype1 = "wallmounted",
legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
})
@ExcaliburZero
ExcaliburZero / Main.java
Last active September 19, 2022 06:36
Heap's Algorithm - Java Implementation
/*
* Heap's algorithm
*
* Gives all permutations for the numbers 1 through n.
*
* Java implementation for psuedocode on the algorithm's Wikipedia article:
* https://en.wikipedia.org/wiki/Heap%27s_algorithm
*/
import java.util.Scanner;