create window HomeStatus.win:length(1) as (status string);
insert into HomeStatus select 'ok' as status
from BedroomTemperatureStatus as bedroom ,
HallTemperatureStatus as hall
where bedroom.status = hall.status and bedroom.status = 'ok';
insert into HomeStatus select 'warning' as status
from BedroomTemperatureStatus as bedroom ,
HallTemperatureStatus as hall
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
/** | |
* In Scala it is a good practice to keep configuration in traits. | |
* The main reason is that you can easily override them programmatically | |
* using the fact that the last trait imported to a class will win in case of override | |
*/ | |
// Default configuration | |
trait Configuration { | |
lazy val defaultName:String = "default" | |
} |
create window HallTemperatureStatus.win:length(1) as (status string);
insert into HallTemperatureStatus select 'warning' as status from HallTemperature(temperature > 18 and temperature <=22);
insert into HallTemperatureStatus select 'alert' as status from HallTemperature(temperature <= 18);
insert into HallTemperatureStatus select 'ok' as status from HallTemperature(temperature > 22);
create window BedroomTemperatureStatus.win:length(1) as (status string) ;
insert into BedroomTemperatureStatus select 'warning' as status from BedroomTemperature(temperature > 18 and temperature <=22);
create schema Temperature(place string, temperature double);
create window HallTemperature.win:length(2) as Temperature;
insert into HallTemperature select * from Temperature(place='hall');
create window BedroomTemperature.win:length(2) as Temperature;
insert into BedroomTemperature select * from Temperature(place='bedroom');
create schema Temperature(place string, temperature double);
create window HallTemperature.win:length(1) as Temperature;
insert into HallTemperature select * from Temperature(place='hall');
create window HallTemperatureStatus.win:length(1) as (status string);
insert into HallTemperatureStatus select 'warning' as status from HallTemperature(temperature > 18 and temperature <=22);
insert into HallTemperatureStatus select 'alert' as status from HallTemperature(temperature <= 18);
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
class RunningActors extends Actor with ActorLogging { | |
def receive = { | |
case "start" => | |
log.info("Current Actors in system:") | |
self ! ActorPath.fromString("akka://Streams/user/") | |
case path: ActorPath => | |
context.actorSelection(path / "*") ! Identify(()) | |
As I use cygwin
curl https://raw.githubusercontent.com/n8han/conscript/master/setup.sh | sh
mv ~/.conscript/sbt-launch-0.13.7.jar ~/.conscript/sbt-launch.jar
Then edit $HOME/bin/cs
java -jar "cygpath -m "$HOME/.conscript/sbt-launch.jar"
" "@file:///C:/Users/PUT_YOUR_USERNAME/.conscript/n8han/conscript/cs/launchconfig" "$@"
A workaround is to manually force every VM to use the host's resolver with
VBoxManage modifyvm "VM name" --natdnshostresolver1 on
or to modify the guest's /etc/resolv.conf file with an external nameserver.
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.io.File | |
import scala.io.Source | |
import org.apache.log4j.Logger | |
import org.apache.log4j.Level | |
import org.apache.spark.SparkConf | |
import org.apache.spark.SparkContext | |
import org.apache.spark.SparkContext._ |