Skip to content

Instantly share code, notes, and snippets.

View enjoylife's full-sized avatar
📖

Matthew Clemens enjoylife

📖
View GitHub Profile
@enjoylife
enjoylife / wordCount.sh
Created February 10, 2014 01:28
Count words
echo "Lorem ipsum dolor sit sit amet." | tr [:space:] '\n' | grep -v "^\s*$" | sort | uniq -c | sort -bnr
java -jar pdfbox-app-1.8.4.jar ExtractText -console ~/Dropbox/Books/technicalAnalysis.pdf | tr -s [:space:] '\n' | grep -v "^\s*$" | sort | uniq -c | sort -bnr |less
#!/usr/bin/perl
print "Folder Name: ";
chomp($folder = <STDIN>);
opendir(DIR, $folder) || die "Folder not found";
my @file = grep { (/\.EW/i || /\.NS/i || /\.UD/i) }readdir(DIR);
close(DIR);
@testFiles;
Corrected accelerogram 20130816_023105_MRZ_20 GNS Science
Site MRZ 40 39 38S 175 34 43E Basalt file: 20130816_023134_MRZ
Mangatainoka River
Instrument Basalt_612
Resolution: 24-bit Instr Period: 0.0050 s Damping: 0.700
Accelerogram 20130816_023105_MRZ_20 Processed 2014 January 20
10 km south-east of Seddon
2013 August 16 02:31:05 UT
Epicentre 41 44 02S 174 09 07E Bearing S45W Dist 169km Depth 8km M 6.64
Number of points 8100 Duration 161.98 sec
#!/usr/bin/perl
use File::Find;
find({ wanted => \&process_file, no_chdir => 1 }, "NZ_Original");
sub process_file {
my $F = $File::Find::name;
if ($F =~ /V2A$/ ) {
To benchmark:
go test -bench=".*" > machine_description.txt
@enjoylife
enjoylife / RuntimeStats.go
Created February 18, 2014 07:40
Runtime stats
func (self *Errplane) ReportRuntimeStats(prefix, context string,
dimensions Dimensions, sleep time.Duration) {
if self.runtimeStatsRunning {
fmt.Fprintf(os.Stderr, "Runtime stats is already running\n")
return
}
self.runtimeStatsRunning = true
go self.reportRuntimeStats(prefix, context, dimensions, sleep)
}
@enjoylife
enjoylife / vdc.txt
Created February 24, 2014 21:15
VDC
NewZealand_01062010094846
Auckland Islands, New Zealand Region 2010-01-06 09:48:46 -49.789 164.192 10.0 5.7 MW 12 38 0 0 Empty 50
Auckland Islands, New Zealand Region 2010-01-06 09:48:46 -49.789 164.192 10.0 5.7 MW 12 38 0 0 Empty 50
NewZealand_01132011120453
North Island New Zealand 2011-01-13 12:04:53 -36.92 179.46 35.0 5.5 MW 17 53 0 0 Empty 50
NewZealand_01192012064845
West of South Island New Zealand 2012-01-19 06:48:45 -46.686 165.778 20.0 5.9 MW 24 74 0 0 Empty 50
NewZealand_02212011235142
Christchurch 2011-02-21 23:51:42 -43.583 172.68 5.9 6.1 MW 133 235 0 70 Empty 50
NewZealand_02222011000419
//mh.resetElement("Event(1).Hypocenter(1).DateTimeTrigger_txt", getTriggerTimeFileName());
/*
public String getTriggerTimeFileName(){
// Get tail integer. Normally 20 or 21
String tail = thead.getLine(1);
int index = tail.lastIndexOf("_");
tail = tail.substring(index+1);
int numlen = tail.indexOf(" ");
import ftputil
import datetime
import os
def fileTypeMatch(name):
return (name.endswith('.V2A') or name.endswith('.V1A') or name.endswith('.V3A'))
wantedDates = [
#"2010-09-03 16:35:41"