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 object spark { | |
| import org.apache.spark.sql.types.StructType | |
| implicit class StructTypeExtension(schema: StructType) { | |
| import org.apache.spark.sql.types.StructField | |
| implicit def similar(other: StructType): Boolean = _similar(schema, other) | |
| implicit val fieldOrdering: Ordering[StructField] = Ordering.by(field => field.name) | |
| private final def _similar(_this: StructType, _other: StructType): Boolean = |
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 scala.reflect.runtime.universe.TypeTag | |
| implicit class ProductExtension[T <: Product : TypeTag](o: T) { | |
| def productElementNames: Iterator[String] = { | |
| import scala.reflect.runtime.universe._ | |
| typeOf[T].members | |
| .collect { case m: MethodSymbol if m.isCaseAccessor => m.name.toString } | |
| .toList.reverse.toIterator | |
| } | |
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.example | |
| import utest._ | |
| object SparkExampleTests extends TestSuite { | |
| import scala.util.{Try,Success,Failure} | |
| import org.apache.spark.sql.SparkSession | |
| val _spark: Try[SparkSession] = | |
| 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
| //file: project/Configs.scala | |
| import sbt._ | |
| object Configs { | |
| val FunctionalTest = config("ft") extend (Test) | |
| val AcceptanceTest = config("at") extend (Test) | |
| val PerformanceTest = config("pt") extend (Test) | |
| val Tools = config("tools") extend (Test) | |
| } |
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
| def disablePublishing: Seq[Setting[_]] = | |
| Seq( | |
| publish/skip := true, | |
| publishLocal/skip := 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
| trait SlickConfig { | |
| import scala.util.{Try, Success, Failure} | |
| private val RegexDB2 = "^jdbc:(db2):.*//(.*):(.*)/([^;]*)[?:;](.*)".r | |
| private val RegexDerby = "^jdbc:(derby):.*//(.*):(.*)/([^;]*)[?:;](.*)".r | |
| private val RegexH2 = "^jdbc:(h2):(?:mem):()()([^;]*)[?:;](.*)".r | |
| private val RegexHsqlDB = "^jdbc:(hsqldb):.*//(.*):(.*)/([^;]*)[?:;](.*)".r | |
| private val RegexSqlServer = "^jdbc:(sqlserver)://(.*):(.*);DatabaseName=([^;]*)[?:;](.*)".r | |
| private val RegexjTDS = "^jdbc:(jtds):sqlserver://(.*):(.*)/([^;]*)[?:;](.*)".r | |
| private val RegexMySQL = "^jdbc:(mysql):.*//(.*):(.*)/([^;]*)[?:;](.*)".r |
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 scala.util.Try | |
| implicit class SeqTryExtension[T](seq: Seq[Try[T]]) { | |
| def sequence: Try[Seq[T]] = | |
| seq | |
| .foldRight(Try(List.empty[T])) { | |
| case (item, acc) => for { a <- acc; i<- item } yield i :: a | |
| } | |
| } |
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
| #![allow(unused_parens)] | |
| use anyhow::{Context,Result, anyhow}; | |
| use clap::{arg, App, AppSettings}; | |
| use std::ffi::OsStr; | |
| fn main() -> Result<()> { | |
| let matches = App::new("mkvm") | |
| .about("Make virtual machines easily!") | |
| .setting(AppSettings::SubcommandRequiredElseHelp) |
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
| ## /etc/network/interfaces | |
| # This file describes the network interfaces available on your system | |
| # and how to activate them. For more information, see interfaces(5). | |
| source /etc/network/interfaces.d/* | |
| # The loopback network interface | |
| auto lo | |
| iface lo inet loopback |
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
| System Information | |
| ------------------- | |
| Manufacturer: HP | |
| Product Name: HP ENVY x360 Convertible 15-ee0xxx |