This file contains 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
# https://en.wikipedia.org/wiki/Call_signs_in_the_United_Kingdom#Call_sign_assignments_for_amateur_radio | |
# This appears to work: | |
/ | |
(?<reg>[UDJIMWPTHNSC]?) | |
(?<callsign>M\g<reg>[01356][A-Z]{3})| | |
(?<callsign>(G\g<reg>[123468][A-Z]{2,3})| | |
(G\g<reg>[07][A-Z]{3})|(G\g<reg>5[A-Z]{2}))| | |
(?<callsign>2[EUDJIMW][01][A-Z]{3}) | |
/ |
This file contains 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
require 'fileutils' | |
package = ARGV.shift | |
info = `pkgutil --pkg-info #{package}`.split("\n") | |
exit if info.empty? | |
files = `pkgutil --files #{package}`.split("\n") |
This file contains 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
[ 0.000000] Booting Linux on physical CPU 0xf00 | |
[ 0.000000] Initializing cgroup subsys cpuset | |
[ 0.000000] Initializing cgroup subsys cpu | |
[ 0.000000] Initializing cgroup subsys cpuacct | |
[ 0.000000] Linux version 3.18.0-25-rpi2 (buildd@lgw01-08) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04) ) #26-Ubuntu SMP PREEMPT Sun Jul 5 06:46:34 UTC 2015 (Ubuntu 3.18.0-25.26-rpi2 3.18.17) | |
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d | |
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache | |
[ 0.000000] Machine: BCM2709 | |
[ 0.000000] cma: Reserved 8 MiB at 0x38800000 | |
[ 0.000000] Memory policy: Data cache writealloc |
This file contains 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/sh | |
DMESG=`which dmesg` | |
LIBS=`ldd $DMESG | cut -d ">" -f 2 | tr -d "\t " | cut -d "(" -f 1` | |
echo $LIBS | |
cp $LIBS /run/shm | |
cp $DMESG /run/shm | |
LIBS=`echo $LIBS | tr "\n" " "` |
This file contains 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
class IsinValidator < ActiveModel::Validator | |
CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
def validate(record) | |
value = record[:isin_cusip] | |
return if value.blank? | |
digits = value.upcase.chars.collect { |c| CHARS.index c } | |
digits = digits.join.chars.collect { |c| c.to_i } | |
actual_check_digit = digits.pop |
This file contains 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
wdt reset | |
load 0x40100000, len 25052, room 16 | |
tail 12 | |
chksum 0x0b | |
ho 0 tail 12 room 4 | |
load 0x3ffe8000, len 3312, room 12 | |
tail 4 | |
chksum 0x53 | |
load 0x3ffe8cf0, len 6576, room 4 | |
tail 12 |
This file contains 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 com.example.jps.opensesame.tasks; | |
import android.view.View; | |
import android.os.AsyncTask; | |
import android.widget.LinearLayout; | |
import android.widget.ToggleButton; | |
import com.example.jps.opensesame.Sensor; | |
/** |
This file contains 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
module Equality | |
include ActiveSupport::Concern | |
def ==(other) | |
if self.instance_variables == other.instance_variables | |
self.instance_variables.each do |ivar| | |
return false if self.instance_variable_get(ivar) != self.instance_variable_get(ivar) | |
end | |
true | |
else |
This file contains 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
with percentiles1 as | |
(select prison_name, end_to_end_time, cume_dist() over (partition by prison_name order by end_to_end_time) as percentile | |
from visit_metrics_entries where processed_at is not null) | |
, top_percentiles1 as | |
(select prison_name, end_to_end_time, rank() over (partition by prison_name order by end_to_end_time) as rank1 | |
from percentiles1 where percentile >= 0.95) | |
select prison_name, end_to_end_time from top_percentiles1 where rank1 = 1 |
This file contains 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
import java.lang.ProcessBuilder; | |
import java.io.File; | |
import java.io.FileWriter; | |
import java.io.FileReader; | |
import java.io.InputStreamReader; | |
import java.io.BufferedReader; | |
import java.security.MessageDigest; | |
import javax.xml.bind.DatatypeConverter; | |
public class Miner { |