Skip to content

Instantly share code, notes, and snippets.

View silicontrip's full-sized avatar
💭
Less for Powershell

Mark Heath silicontrip

💭
Less for Powershell
View GitHub Profile
@silicontrip
silicontrip / bash2powershell.txt
Last active July 3, 2019 12:15
powershell for unix users
-- general commands --
\ `
\n `n
! invoke-history
~ $home
alias new-alias
cat get-content
cd set-location
|dd of=<blah> | set-content -path <blah>
|dd of=<blah> | out-file -path <blah>
@silicontrip
silicontrip / uniformdistribution.java
Created April 23, 2019 04:04
Uniform Distribution refine
/**
* Performs an intersection with another Uniform Distribution and updates this one in place
* The idea is that improves the accuracy of the current UD
*
* @param a the UniformDistribution to refine this one with
*
* @return boolean indicating if this UD was improved
*
* @throws ArithmeticException if there was no overlap between the two UD
*/
@silicontrip
silicontrip / processField.java
Created April 16, 2019 02:17
cell field processor worker loop
UniformDistribution initialMU = new UniformDistribution(score,range);
// an algorithmic version of the following equation
// mu[cell] = ( MU - intersectionArea[cell1] x mu[cell1] ... - intersectionArea[cellN] x mu[cellN]) / intersectionArea[cell]
for (S2CellId cellOuter: cells) {
UniformDistribution mus = new UniformDistribution(initialMU);
for (S2CellId cellInner: cells) {
// if not cell from outer loop
if (!cellOuter.equals(cellInner))
[{"type":"polygon","latLngs":[{"lat":-37.966942,"lng":145.175610},{"lat":-37.900551,"lng":145.143334},{"lat":-37.940236,"lng":145.088447}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.966726,"lng":145.175273},{"lat":-37.900551,"lng":145.143334},{"lat":-37.940236,"lng":145.088447}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.966586,"lng":145.175114},{"lat":-37.900551,"lng":145.143334},{"lat":-37.940236,"lng":145.088447}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.966586,"lng":145.175114},{"lat":-37.940236,"lng":145.088447},{"lat":-37.901384,"lng":145.142446}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.966586,"lng":145.175114},{"lat":-37.940236,"lng":145.088447},{"lat":-37.901644,"lng":145.142131}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.966586,"lng":145.175114},{"lat":-37.906811,"lng":145.136999},{"lat":-37.940236,"lng":145.088447}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.966586,"lng":145.175114},{"lat":-37.90765
[{"type":"polygon","latLngs":[{"lat":-37.738937,"lng":144.881564},{"lat":-37.74001,"lng":144.878695},{"lat":-37.737048,"lng":144.875162}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.754038,"lng":144.870517},{"lat":-37.757825,"lng":144.865619},{"lat":-37.756225,"lng":144.872932}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.760704,"lng":144.864723},{"lat":-37.769143,"lng":144.864732},{"lat":-37.764103,"lng":144.871212}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.73905,"lng":144.856103},{"lat":-37.749335,"lng":144.859853},{"lat":-37.747132,"lng":144.856471}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.74964,"lng":144.826229},{"lat":-37.756316,"lng":144.827534},{"lat":-37.749913,"lng":144.819417}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.714514,"lng":144.849395},{"lat":-37.715708,"lng":144.84764},{"lat":-37.714801,"lng":144.850303}],"color":"#a24ac3"},{"type":"polygon","latLngs":[{"lat":-37.752055,"lng":144.888365},{"lat":-37.757059,"l
String q = "select * from mufields where (((plat1=? and plng1=?) or (plat2=? and plng2=?) or (plat3=? and plng3=?)) and ((plat1=? and plng1=?) or (plat2=? and plng2=?) or (plat3=? and plng3=?)) and ((plat1=? and plng1=?) or (plat2=? and plng2=?) or (plat3=? and plng3=?)))";
ps = c.prepareStatement(q,ResultSet.CONCUR_READ_ONLY);
ps.setLong(1,f.getPLat1());
ps.setLong(2,f.getPLng1());
ps.setLong(3,f.getPLat1());
ps.setLong(4,f.getPLng1());
ps.setLong(5,f.getPLat1());
ps.setLong(6,f.getPLng1());
java.specification: Java Platform API Specification / 1.8 / Oracle Corporation
java.vm.specification: Java Virtual Machine Specification / 1.8 / Oracle Corporation
java.vm: Java HotSpot(TM) 64-Bit Server VM / 25.121-b13 / Oracle Corporation
os.arch: x86_64
os.name: Mac OS X
os.version: 10.13.4
graphics pipeline: com.sun.prism.es2.ES2Pipeline
javafx.runtime: 8.0.121-b13
uuid: 1229436385
utopia~/bpmdj-test% ./session_dump.py sessions/1007269585.bpmdjs sessions/1051738579.bpmdjs sessions/1052871377.bpmdjs sessions/1161663652.bpmdjs sessions/1365038751.bpmdjs sessions/1416172063.bpmdjs sessions/1466587652.bpmdjs sessions/1483253814.bpmdjs sessions/154760477.bpmdjs sessions/1685252262.bpmdjs sessions/1695623783.bpmdjs sessions/1702391300.bpmdjs sessions/1798484426.bpmdjs sessions/1813962726.bpmdjs sessions/1861477434.bpmdjs sessions/1892247259.bpmdjs sessions/1905616469.bpmdjs sessions/1907263844.bpmdjs sessions/1943286279.bpmdjs sessions/2044154182.bpmdjs sessions/272488942.bpmdjs sessions/493620254.bpmdjs sessions/660416500.bpmdjs sessions/67541470.bpmdjs sessions/682615576.bpmdjs sessions/835262348.bpmdjs sessions/860361474.bpmdjs sessions/961030081.bpmdjs
sessions/1007269585.bpmdjs
Holy Grail
ed4c9d74b2d946be9918fec8f6b6b3959d850c4911584205b840014f1538af15 /home/mheath/PhoneBackup/Music/Opus III/It's A Fine Day (Single)/02 It's A Fine Day.mp3.bpmdj1
5c0ecb6d89a04076be866eb18375d754896d15b261
#!/usr/bin/python
import os
import fnmatch
import sys
import struct
import json
djdb={}
for root, dir, files in os.walk(sys.argv[1]):
1.Table.3.TableRow.2.TableCell.2.Paragraph.2.Run.2.Text: Team: [54 00 65 00 61 00 6d 00 3a 00 T.e.a.m.:.]
1.Table.3.TableRow.3.TableCell.2.Paragraph.2.Run.2.Text: Brisbane Lions [42 00 72 00 69 00 73 00 62 00 61 00 6e 00 65 00 20 00 4c 00 69 00 6f 00 6e 00 73 00 B.r.i.s.b.a.n.e. .L.i.o.n.s.]
1.Table.4.TableRow.2.TableCell.2.Paragraph.2.Run.2.Text: Match: [4d 00 61 00 74 00 63 00 68 00 3a 00 M.a.t.c.h.:.]
1.Table.4.TableRow.3.TableCell.2.Paragraph.2.Run.2.Text: AFL Round 22 - Melbourne v Brisbane Lions [41 00 46 00 4c 00 20 00 52 00 6f 00 75 00 6e 00 64 00 20 00 32 00 32 00 20 00 2d 00 20 00 4d 00 65 00 6c 00 62 00 6f 00 75 00 72 00 6e 00 65 00 20 00 76 00 20 00 42 00 72 00 69 00 73 00 62 00 61 00 6e 00 65 00 20 00 4c 00 69 00 6f 00 6e 00 73 00 A.F.L. .R.o.u.n.d. .2.2. .-. .M.e.l.b.o.u.r.n.e. .v. .B.r.i.s.b.a.n.e. .L.i.o.n.s.]
1.Table.5.TableRow.2.TableCell.2.Paragraph.2.Run.2.Text: Game Date: [47 00 61 00 6d 00 65 00 20 00 44 00 61 00 74 00 65 00 3a 00 G.a.m.e. .D.a.t.e.:.]
1.Table.5.TableRow.3.TableCell