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.util.Map.Entry | |
import com.typesafe.config.{ConfigFactory, ConfigObject, ConfigValue} | |
import scala.collection.JavaConverters._ | |
import scala.util.Properties | |
class Configuration(fileNameOption: Option[String] = None) { | |
val config = fileNameOption.fold(ifEmpty = ConfigFactory.load())(file => ConfigFactory.load(file) ) | |
def envOrElseConfig(name: String): String = { |
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
FROM golang:1.10 AS build-image | |
ADD https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 /usr/bin/dep | |
RUN chmod +x /usr/bin/dep | |
WORKDIR $GOPATH/src/fts/STSCardValidator | |
COPY Gopkg.toml Gopkg.lock ./ | |
RUN dep ensure --vendor-only | |
COPY . ./ |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.fts.cp</groupId> | |
<artifactId>bpmn-ui</artifactId> | |
<version>1.0</version> | |
<packaging>jar</packaging> | |
<name>bpmn-ui</name> | |
<url>https://gitlab-delivery-platform.fexcofts.com/cp/bpmn-ui</url> | |
<properties> |
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
def getListOfDiagramFilesFromDirectory(dir: String): Array[Option[Elem]] = { | |
val canonicalPath = getClass.getResource("/".concat(dir)) | |
var listOfFiles: ArrayBuffer[Option[Elem]] = ArrayBuffer[Option[Elem]]() | |
if (canonicalPath.getProtocol().equals("jar")) { | |
val jarPath: String = canonicalPath.getPath().substring(5, canonicalPath.getPath().indexOf("!")) | |
val jar: JarFile = new JarFile(URLDecoder.decode(jarPath, "UTF-8")) | |
val entries = jar.entries() | |
while(entries.hasMoreElements){ | |
val entry = entries.nextElement() | |
if (entry.isDirectory()) { |
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
val uiJIRAStructure: Map[String, Array[String]] = configuration.getMapArrays("flowMatch.UIProjectKeys") | |
var componentWithDiagrams = scala.collection.mutable.Map.empty[String, Array[Option[Elem]]] | |
var projectsWithComponentsAndDiagrams = scala.collection.mutable.Map.empty[String, scala.collection.mutable.Map[String,Array[Option[Elem]]]] | |
for ((project, components) <- uiJIRAStructure){ | |
components.foreach(component => | |
componentWithDiagrams += (component -> Files.getListOfDiagramFilesFromDirectory(project.concat("/").concat(component))) | |
) | |
projectsWithComponentsAndDiagrams += (project -> componentWithDiagrams) | |
} |
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
@throws(classOf[ReadDBFeaturesException]) | |
def getRequirementFeaturesFromDBByProject(project: String): Option[DataFrame] ={ | |
var result: Option[DataFrame] = None | |
try{ | |
val storedRFsDF = spark | |
.sqlContext | |
.read | |
.format("com.microsoft.azure.cosmosdb.spark") | |
.cosmosDB(featuresStorageMap) | |
.toDF() |
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
@throws(classOf[JIRAException]) | |
def getJIRARESTClient(): Option[JiraRestClient] = { | |
try { | |
val asyncClientFactory: AsynchronousJiraRestClientFactory = new AsynchronousJiraRestClientFactory() | |
result = Some(asyncClientFactory.createWithBasicHttpAuthentication( | |
new URI(baseUrl), | |
jiraUser, | |
jiraPwd | |
)) | |
}catch{ |
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 akka.actor.{Actor, ActorSystem, Props} | |
import scala.io.Source | |
import scala.xml._ | |
class WeatherActor extends Actor { | |
override def receive: Receive = { | |
case msg => println (msg) | |
} | |
} |
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 'rxjs/add/operator/toPromise'; | |
search(term:string) { | |
let promise = new Promise((resolve, reject) => { | |
let apiURL = `${this.apiRoot}?term=${term}&media=music&limit=20`; | |
this.http.get(apiURL) | |
.toPromise() | |
.then( | |
res => { | |
this.results = res.json().results; |
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
val textFile = sc.textFile("hdfs://...") | |
val df = textFile.toDF("line") | |
val errors = df.filter(col("line").like("%ERROR%")) | |
errors.count() | |
errors.filter(col("line").like("%MySQL%")).count() |
OlderNewer