Skip to content

Instantly share code, notes, and snippets.

View oluies's full-sized avatar

Örjan Angré (Lundberg) oluies

  • Sweden
  • 02:33 (UTC +02:00)
  • X @oluies
View GitHub Profile
case class Station(STN: Option[Int], WBAN: Option[Int], GPSLocation: Location)
case class TemperatureReading(stn: String,
wban: String,
month: Int,
day: Int,
temperature: Double)
case class Location(lat: Double, lon: Double){
test("interpolateColor. Above 60") {
assert(Visualization.interpolateColor(Color.threasholds, 60.001) === Color(255, 255, 255))
assert(Visualization.interpolateColor(Color.threasholds, 60.01) === Color(255, 255, 255))
assert(Visualization.interpolateColor(Color.threasholds, 60.1) === Color(255, 255, 255))
assert(Visualization.interpolateColor(Color.threasholds, 61) === Color(255, 255, 255))
assert(Visualization.interpolateColor(Color.threasholds, 62) === Color(255, 255, 255))
assert(Visualization.interpolateColor(Color.threasholds, 63) === Color(255, 255, 255))
assert(Visualization.interpolateColor(Color.threasholds, 100) === Color(255, 255, 255))
assert(Visualization.interpolateColor(Color.threasholds, 1000) === Color(255, 255, 255))
@oluies
oluies / brews.txt
Created September 14, 2017 19:34 — forked from anonymous/brews.txt
ack
adns
ansible
ant
apache-spark
argtable
arpack
augeas
autoconf
autojump
public static void main(String[] args) throws IOException {
PipelineOptionsFactory.register(PipelineCmdLineOptions.class);
PipelineCmdLineOptions options =
PipelineOptionsFactory.fromArgs(args).as(PipelineCmdLineOptions.class);
//Config config = ConfigFactory.parseFile(new File(args[0]));
//LOG.info(config.root().render(ConfigRenderOptions.concise().setFormatted(true)));
@oluies
oluies / spark-read-from-csv-string.scala
Created December 1, 2017 08:32
spark-read-from-string
val csv:String = """
|rowKeyLineage |eventTimestamp|dataEventId|dataDictId |sourceKey |transport|eventType |recordId|processingTime|application|entity |product|lifecycle |lineDate |dayOfMonth|dayOfYear|
|1488327264000:2001200:MUREX:DK_LEI_6000:BOND:CONTRACT |1488327264000 |2001200 |MUREXCONTRACT_DELTA |20170301MUREXCONTRACT.csv |FTP |DISTRIBUTE| |1512074938523 |MUREX |DK_LEI_6000|BOND |CONTRACT |2017-03-01 01:14:24|1 |60 |
|1488327264000:2001200:MUREX:DK_LEI_6100:REPO:CONTRACT |1488327264000 |2001200 |MUREXCONTRACT_DELTA |20170301MUREXCONTRACT.csv |FTP |DISTRIBUTE| |1512074938523 |MUREX |DK_LEI_6100|REPO |CONTRACT |2017-03-01 01:14:24|1 |60 |
|1488327264000:2001200:MUREX:DK_LEI_6200:BOND:CONTRACT |1488327264000 |2001200 |MURE
@oluies
oluies / StatsCount.scala
Last active December 18, 2017 09:26
HBase extract kv._2 -> map( column family name, map ( column qualifier name, value ) )
import java.time.Instant
import java.{lang, util}
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.hbase.{Cell, HBaseConfiguration}
import org.apache.hadoop.hbase.client.Result
import org.apache.hadoop.hbase.io.ImmutableBytesWritable
import org.apache.hadoop.hbase.mapreduce.TableInputFormat
import org.apache.hadoop.hbase.util.Bytes
import org.apache.hadoop.hbase.util.Bytes.toBytes