This file contains hidden or 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.combient.sparkjob.tedsds | |
/** | |
* Created by olu on 09/03/16. | |
*/ | |
import org.apache.spark.ml.feature.{MinMaxScaler, VectorAssembler} | |
import org.apache.spark.sql.{Column, SaveMode, SQLContext, GroupedData} |
This file contains hidden or 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 | |
. /etc/spark/conf/spark-env.sh | |
export PYSPARK_SUBMIT_ARGS="--master yarn-client pyspark-shell" | |
# Spark master url. eg. spark://master_addr:7077. Leave empty if you want to use local mode | |
export MASTER=yarn-client | |
export SPARK_YARN_JAR=hdfs:///apps/zeppelin/zeppelin-spark-0.5.5-SNAPSHOT.jar | |
export JAVA_HOME=/usr/jdk64/jdk1.8.0_60 | |
# Additional jvm options. for example, export ZEPPELIN_JAVA_OPTS="-Dspark.executor.memory=8g -Dspark.cores.max=16" | |
export JAVA_OPTS="-Dhdp.version=2.4.0.0-169 -Dspark.executor.memory=1024m -Dspark.executor.instances=2 -Dspark.yarn.queue=default" |
This file contains hidden or 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
|-- id: integer (nullable = true) | |
|-- cykle: integer (nullable = true) | |
|-- setting1: double (nullable = true) | |
|-- setting2: double (nullable = true) | |
|-- setting3: double (nullable = true) | |
|-- s1: double (nullable = true) | |
|-- s2: double (nullable = true) | |
|-- s3: double (nullable = true) | |
|-- s4: double (nullable = true) | |
|-- s5: double (nullable = true) |
This file contains hidden or 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
// PARTITION BY id ORDER BY cykle ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING (5) | |
val w = Window.partitionBy("id").orderBy("cykle").rowsBetween(-2, 2) | |
//def getcols(id:String):Seq[Column] = Seq(mean($"s"+id).over(w).as("a"+id) sqrt( sum(pow($"s"+id - mean($"s"+id).over(w),2)).over(w) / 5).as("sd"+id)) | |
val x = df.select('*, | |
mean($"s1").over(w).as("a1"), | |
sqrt( sum(pow($"s1" - mean($"s1").over(w),2)).over(w) / 5).as("sd1"), | |
mean($"s2").over(w).as("a2"), |
This file contains hidden or 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
val schema = Seq("id", "cykle", "value") | |
val data = Seq( | |
(1, 1, 1), | |
(1, 2, 11), | |
(1, 3, 1), | |
(1, 4, 11), | |
(1, 5, 1), | |
(1, 6, 11), | |
(2, 1, 1), | |
(2, 2, 11), |
This file contains hidden or 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 | |
# | |
# Automatic configuration of a VPN on GCE debian-7-wheezy server. | |
# Tested only on debian-7-wheezy. | |
# | |
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 | |
# Unported License: http://creativecommons.org/licenses/by-sa/3.0/ | |
# | |
# Thx to: https://github.com/sarfata/voodooprivacy/blob/master/voodoo-vpn.sh for the code/idea | |
# |
This file contains hidden or 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
* forward messagges to new Qmanager | |
inputqm('QM') inputq('DLQ') | |
DESTQ(QINMESSAGES) ACTION(FWD) fwdq(TOQ) fwdqm('TOQM') header(no) | |
* | |
inputqm('QM') inputq('DLQ') | |
DESTQM(QMINMESSAGES) ACTION(FWD) fwdq(&DESTQ) fwdqm('TOQM') header(no) |
This file contains hidden or 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.util.{Enumeration, HashMap} | |
import com.ibm.mq.constants.{CMQC, MQConstants, CMQCFC} | |
import com.ibm.mq.headers.pcf.{PCFMessage,PCFParameter} | |
import scala.collection.JavaConverters._ | |
object Main extends App { | |
val pcfCM: PCF_CommonMethods = new PCF_CommonMethods | |
try { |
This file contains hidden or 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.util.{Enumeration, HashMap} | |
import com.ibm.mq.constants.{MQConstants, CMQCFC} | |
import com.ibm.mq.headers.pcf.PCFMessage | |
import com.ibm.mq.headers.pcf.PCFParameter | |
import scala.collection.JavaConverters._ | |
object Main extends App { | |
val pcfCM: PCF_CommonMethods = new PCF_CommonMethods |
This file contains hidden or 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
Jag inser inte varför det skulle var något att glädjas över att personer som redan är rikare än någon har behov av att vara skulle kunna fördubbla sin konsumtion av sådant som ger liten eller ingen tillfredsställelse annat än som symboler för rikedom. Det är bara i mindre utvecklade länder som ökad produktion fortfarande utgör ett viktigt mål: i de mest utvecklade länderna behövs istället jämnare fördelning.. | |
Och inte heller skänker tanken på en värld där inget lämnats till naturens spontana aktivitet någon större glädje; där varje stycke land odlats upp och där varje blommande vildmark eller naturlig betesäng lagts under plogen och där varje fyrfoting eller fågel som inte gjorts till husdjur utrotats och där varje häck eller överflödigt träd röjts undan och där knappast en plats finns kvar där en vild buske eller blomma kan växa utan att utrotas som ogräs av det avancerade jordbruket. | |
Om jorden förlorar sin ljuvlighet genom obegränsad tillväxt av rikedom och befolkning, bara för att kunna hysa en större me |