code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package commands.makemkv
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import scala.io.Source
import duration.Implicits._
/**
* Created by alex on 05/05/15.
*/
class MakeMkvConInfoImplSpec extends Specification with Mockito {
"Reading information from makemkvcon info" should {
"cor... | unclealex72/ripper | src/test/scala/commands/makemkv/MakeMkvConInfoImplSpec.scala | Scala | mit | 1,737 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.3
* @date Sun Sep 16 14:09:25 EDT 2012
* @see LICENSE (MIT style license file).
*/
package scalation.linalgebra
import scala.collection.{breakOut, Traversable}
import scala.collection.... | NBKlepp/fda | scalation_1.3/scalation_mathstat/src/main/scala/scalation/linalgebra/VectorL.scala | Scala | mit | 43,007 |
/** Improving: An unconstrained collection of scala code.
* Copyright 2005-2011 Paul Phillips
*
* Distributed under the "Simplified BSD License" in LICENSE.txt.
*/
package improving
package reflect
import scala.reflect.AnyValManifest
object WeakConformance {
import scala.reflect.Manifest._
def numericType... | adriaanm/scala-improving | src/main/scala/reflect/WeakConformance.scala | Scala | bsd-3-clause | 5,192 |
package hevs.especial.generator
import java.io.File
import hevs.especial.dsl.components._
import hevs.especial.utils._
import scala.collection.mutable
import scala.language.existentials
import scalax.collection.Graph
import scalax.collection.edge.LDiEdge
import scalax.collection.io.dot._
/**
* Generate a diagram o... | hevs-isi/especial-frontend | src/main/scala/hevs/especial/generator/DotGenerator.scala | Scala | mit | 10,688 |
package org.eknet.sitebag.content
import org.scalatest.{Matchers, FunSuite}
import spray.http.Uri
import org.eknet.sitebag.utils._
import java.nio.charset.Charset
class AddonsTest extends FunSuite with Matchers {
test("uri sanitizing") {
Uri.sanitized("http://localhost/a in valid url") should be (Uri("http://l... | eikek/sitebag | src/test/scala/org/eknet/sitebag/content/AddonsTest.scala | Scala | apache-2.0 | 1,180 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | rmetzger/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/table/GroupWindowITCase.scala | Scala | apache-2.0 | 15,967 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | themarkypantz/kafka | core/src/test/scala/unit/kafka/log/LogManagerTest.scala | Scala | apache-2.0 | 13,460 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package expressions
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.parsing.types.ParamType
/**
... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/expressions/Binding.scala | Scala | apache-2.0 | 1,173 |
package frameless
import org.scalacheck.Prop
import org.scalacheck.Prop._
import math.Ordering
class IntersectTests extends TypedDatasetSuite {
test("intersect") {
def prop[A: TypedEncoder : Ordering](data1: Vector[A], data2: Vector[A]): Prop = {
val dataset1 = TypedDataset.create(data1)
val dataset... | adelbertc/frameless | dataset/src/test/scala/frameless/forward/IntersectTests.scala | Scala | apache-2.0 | 829 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | sh-cho/cshSpark | api/java/JavaSparkContext.scala | Scala | apache-2.0 | 36,177 |
package io.iohk.ethereum.utils
import java.util.concurrent.atomic.AtomicReference
/**
* An [[https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html AtomicReference]] that can be set once.
*/
class Ref[T <: AnyRef] {
private[this] final val ref = new AtomicReference[Option[T]]... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/utils/Ref.scala | Scala | mit | 686 |
package cats.derived
import cats.Hash
import shapeless._, labelled._
trait MkHash[A] extends Hash[A]
object MkHash extends MkHash0 {
def apply[A](implicit hash: MkHash[A]): MkHash[A] = hash
}
private[derived] trait HashBuilder[A] {
def hashes(a: A): List[Int]
def eqv(x: A, y: A): Boolean
}
object HashBui... | milessabin/kittens | core/src/main/scala/cats/derived/hash.scala | Scala | apache-2.0 | 2,711 |
/**
* Copyright (C) 2017 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This p... | brunobuzzi/orbeon-forms | form-runner/shared/src/main/scala/org/orbeon/oxf/fr/ControlOps.scala | Scala | lgpl-2.1 | 1,164 |
package com.blogspot.nurkiewicz
import org.apache.commons.dbcp.BasicDataSource
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.context.annotation.AnnotationConfigApplicationContext
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Compone... | nurkiewicz/spring-di | src/main/scala/com/blogspot/nurkiewicz/Bootstrap.scala | Scala | apache-2.0 | 1,081 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | tillrohrmann/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/utils/RankUtil.scala | Scala | apache-2.0 | 11,217 |
package countyAdjacency
private object Graph {
import Model._
val file = "src/main/resources/county_adjacency.txt"
val lines = scala.io.Source.fromFile(file).getLines.toList
type RawData = List[List[String]]
val extractedFIPS: RawData = lines map ("""(\\d+)""".r.findAllIn(_).toList)
type Group = List[Li... | jarrodwb/CountyAdjacency | old-scala-code/src/main/scala/countyAdjacency/Graph.scala | Scala | mit | 933 |
package hackerRank.algorithms
object ServiceLanes {
def main(args: Array[String]) {
val sc = new java.util.Scanner(System.in)
val n = sc.nextInt()
val t = sc.nextInt()
val width = new Array[Int](n)
for (width_i <- 0 to n - 1) {
width(width_i) = sc.nextInt()
}
var a0 = 0
while (a... | cricanr/AlgorithmsHackerRank | src/main/scala/hackerRank/algorithms/ServiceLanes.scala | Scala | mit | 548 |
package com.scaledaction.weather.ingest.api
import akka.event.Logging
import org.apache.kafka.clients.producer.{ KafkaProducer, ProducerRecord, Callback, RecordMetadata }
import akka.actor._
import com.scaledaction.core.kafka.HasKafkaConfig
import com.datastax.killrweather.Weather.RawWeatherData
import spray.httpx.Spr... | scaledaction/weather-service | ingest-api/src/main/scala/com/scaledaction/weather/ingest/api/KafkaProducerActor.scala | Scala | apache-2.0 | 2,084 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not u... | andrewor14/iolap | sql/catalyst/src/main/scala/org/apache/spark/sql/types/UTF8String.scala | Scala | apache-2.0 | 5,815 |
package net.hearthstats.hstatsapi
import org.scalatest._
import org.junit.runner.RunWith
import net.hearthstats.core.Deck
import org.scalatest.junit.JUnitRunner
import net.hearthstats.config.TestConfig
import net.hearthstats.config.UserConfig
import net.hearthstats.config.TestEnvironment
import net.hearthstats.ui.log.... | HearthStats/HearthStats.net-Uploader | companion/src/test/scala/net/hearthstats/hstatsapi/DeckSpec.scala | Scala | bsd-3-clause | 1,312 |
package com.typesafe.slick.testkit.tests
import org.junit.Assert._
import com.typesafe.slick.testkit.util.{JdbcTestDB, AsyncTest}
import scala.reflect.ClassTag
class JdbcMapperTest extends AsyncTest[JdbcTestDB] {
import tdb.profile.api._
def testMappedEntity = {
import TupleMethods._
case class User(id... | lukasz-golebiewski/slick | slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JdbcMapperTest.scala | Scala | bsd-2-clause | 13,584 |
/*
* Copyright 2017-2022 John Snow Labs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | JohnSnowLabs/spark-nlp | src/main/scala/com/johnsnowlabs/client/aws/AWSGateway.scala | Scala | apache-2.0 | 6,700 |
package com.twitter.finagle.stats
import org.junit.runner.RunWith
import org.scalacheck.Gen
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest.{Matchers, FunSuite}
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class BucketedHistogramTest extends FunSuite
with Genera... | suls/finagle | finagle-stats/src/test/scala/com/twitter/finagle/stats/BucketedHistogramTest.scala | Scala | apache-2.0 | 5,027 |
package step2_tuples
import step2_tuples.CsvFieldInstr.CsvField
import step2_tuples.CsvLineInstr.CsvLine
//A Typeclass to serialize some object of type T into a csv field by passing it to the convert method
trait CsvFieldInstr[T] { def convert(obj: T): CsvField }
//Helper object that makes it convenient to create ins... | valenterry/shapeless_csv | src/main/scala/step2_tuples/Typeclasses.scala | Scala | mit | 1,018 |
package com.skittr.model
/* *\\
(c) 2007 WorldWide Conferencing, LLC
Distributed under an Apache License
http://www.apache.org/licenses/LICENSE-2.0
\\* */
import _root_.net.liftweb.mapper._
import DB._
import _root_.jav... | beni55/liftweb | sites/skittr/src/main/scala/com/skittr/model/Friend.scala | Scala | apache-2.0 | 1,095 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/amls-frontend | app/models/moneyservicebusiness/SendTheLargestAmountsOfMoney.scala | Scala | apache-2.0 | 3,505 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | witgo/spark | core/src/main/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProvider.scala | Scala | apache-2.0 | 6,819 |
/*
* This file is part of P2pCore.
*
* Copyright (C) 2012 Timur Mehrvarz, timur.mehrvarz(at)gmail.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation <http://www.gnu.org/licenses/>, eith... | mehrvarz/P2pCore | src/RsaEncrypt.scala | Scala | gpl-3.0 | 1,973 |
package hmda.geo.http.routes
import akka.actor.ActorSystem
import com.typesafe.config.Config
import akka.stream.ActorMaterializer
import akka.event.LoggingAdapter
import scala.concurrent.ExecutionContextExecutor
trait BaseRoute {
implicit val system: ActorSystem
implicit def executor: ExecutionContextExecutor
i... | cfpb/hmda-pip | api/src/main/scala/hmda/geo/http/routes/BaseRoute.scala | Scala | cc0-1.0 | 416 |
package com.tribbloids.spookystuff.uav.planning
import com.tribbloids.spookystuff.dsl.GenPartitioner
trait TrafficControl extends GenPartitioner {}
| tribbloid/spookystuff | uav/src/main/scala/com/tribbloids/spookystuff/uav/planning/TrafficControl.scala | Scala | apache-2.0 | 150 |
import java.time._
import scala.concurrent._
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
object Main extends App {
val f = Future { Thread.sleep(10000); 42 }
val result = Await.result(f, 11.seconds)
println(result)
val f2 = Future { Thread.sleep(10000); 42 }
Await.ready(f2, 1... | yeahnoob/scala-impatient-2e-code | src/ch17/sec02/Futures.scala | Scala | gpl-3.0 | 372 |
import sbt._
import Keys._
object Dependencies {
val akkaVersion = "2.4.16"
val akkaDependencies: Seq[ModuleID] = Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion
)
val testDependencies: Seq[ModuleID] = Seq(
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
"junit" % "junit" %... | Spacelift/akka-mq-proxies | project/dependencies.scala | Scala | mit | 586 |
package com.datawizards.dqm.configuration
import com.datawizards.dqm.rules.group.GroupRule
case class GroupByConfiguration(
groupName: String,
groupByFieldName: String,
rules: Seq[GroupRule] = Seq.empty
... | piotr-kalanski/data-quality-monitoring | src/main/scala/com/datawizards/dqm/configuration/GroupByConfiguration.scala | Scala | apache-2.0 | 337 |
package org.dsa.test
import com.google.common.collect.{Ordering => GuavaOrdering}
import scala.collection.JavaConversions._
/**
* Created by xubo on 2016/12/10.
*/
object takeOrderedTest {
def main(args: Array[String]) {
var arr = Array(new Person(11, "a"), new Person(21, "v"), new Person(5, "c")).toItera... | xubo245/CloudSW | src/test/scala/org/dsa/test/takeOrderedTest.scala | Scala | gpl-2.0 | 1,047 |
package cspom
import cspom.variable.CSPOMVariable
import cspom.variable.IntVariable
import CSPOM._
import org.scalatest.Matchers
import org.scalatest.FlatSpec
import org.scalatest.OptionValues
import cspom.variable.CSPOMSeq
import cspom.compiler.MergeEq
import cspom.compiler.CSPOMCompiler
import cspom.variable.BoolVar... | concrete-cp/cspom | src/test/scala/cspom/CSPOMTest.scala | Scala | lgpl-2.1 | 6,327 |
package Chapter18
object TypeParameters {
// topics:
// generic classes
// generic functions
// bounds for type variables
// view bounds
// context bounds
// the ClassTag context bound
// multiple bounds
// type constraints
// variance
// co- and contravariant positions
// o... | vasnake/scala-for-the-impatient | src/main/scala/Chapter18/TypeParameters.scala | Scala | gpl-3.0 | 23,630 |
// XML要素に複数の子要素を追加するサンプル
package playground.xml
import scala.xml.Elem
object AddChildrenToXmlElement extends App {
// 単純にxml.Elemのリストを受け取る場合
def ul(items: Seq[Elem]): Elem = <ul>{ items }</ul>
assert(
ul(Seq(<li>item1</li>, <li>item2</li>, <li>item3</li>)) ==
<ul><li>item1</li><li>item2</li><li>item3... | suin/scala-playground | src/main/scala/playground/xml/AddChildrenToXmlElement.scala | Scala | mit | 713 |
package pl.edu.agh.mplt.parser.AMPL.declarations
import org.scalatest.{Matchers, FlatSpec}
import pl.edu.agh.mplt.parser.{AMPLParser, IntercodeImplicits}
import pl.edu.agh.mplt.parser.phrase.set.{IndexedSet, Indexing}
import pl.edu.agh.mplt.parser.reference.SimpleReference
import pl.edu.agh.mplt.parser.declarati... | marek1840/MPLT | src/test/scala/pl/edu/agh/mplt/parser/AMPL/declarations/ConstraintDeclarationTest.scala | Scala | mit | 5,134 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2020 Ángel Cervera Claudio
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
... | angelcervera/osm4scala | examples/spark-utilities/src/test/scala/com/acervera/osm4scala/examples/spark/tagkeys/JobSpec.scala | Scala | mit | 2,610 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | yu-iskw/spark-application-template | src/main/scala/SampleApplication.scala | Scala | apache-2.0 | 1,833 |
class LazyInput {
def foo {
lazy val x = 44
/*start*/
x + 77
/*end*/
}
}
/*
class LazyInput {
def foo {
lazy val x = 44
/*start*/
testMethodName(x)
/*end*/
}
def testMethodName(x: => Int): Unit = {
x + 77
}
}
*/ | triggerNZ/intellij-scala | testdata/extractMethod/input/LazyInput.scala | Scala | apache-2.0 | 260 |
package io.catbird.util.effect
import cats.effect.{ ContextShift, IO }
import com.twitter.util.{ ExecutorServiceFuturePool, Future, FuturePool }
import org.scalatest.Outcome
import org.scalatest.funsuite.FixtureAnyFunSuite
import scala.concurrent.ExecutionContext
class ContextShiftingSuite extends FixtureAnyFunSuite... | travisbrown/catbird | effect/src/test/scala/io/catbird/util/effect/ContextShiftingSuite.scala | Scala | apache-2.0 | 2,600 |
package dk.tennis.compare.rating.multiskill.analysis.h2h
import org.junit._
import Assert._
import dk.tennis.compare.rating.multiskill.matchloader.MatchesLoader
import java.text.SimpleDateFormat
class Head2HeadStatsDBTest {
val matchesFile = "./src/test/resources/atp_historical_data/match_data_2006_2014_121114.csv... | danielkorzekwa/tennis-player-compare | multiskill/src/test/scala/dk/tennis/compare/rating/multiskill/analysis/h2h/Head2HeadStatsDBTest.scala | Scala | bsd-2-clause | 1,881 |
package io.krom.lsh
import breeze.linalg.DenseVector
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.node.{ArrayNode, DoubleNode, ObjectNode}
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import scala.c... | barneygovan/lsh-scala | src/main/scala/io/krom/lsh/Serialization.scala | Scala | apache-2.0 | 1,694 |
package com.zkay
/*
* Portfolio Statement (pg 36, listing 1.13)
*/
object Listing1_13 {
import com.zkay.Utils.Portfolio
type Balance = Double
def getCurrencyBalance(): Balance = 100000
def getEquityBalance(): Balance = 2000000
def getDebtBalance(): Balance = 10000
def getLoanInformation(): Balance = ... | zkay/bookclub_notes | FunctionalAndReactiveDomainModeling/chapter1/src/main/scala/Listing1_13.scala | Scala | apache-2.0 | 739 |
package main.scala.au.com.telegraphics.data
// Copyright (C) 2013-2014 Toby Thain, toby@telegraphics.com.au
import util.Random
object Median {
// This isn't useful for anything at the moment. Ignore.
def randomPartition[T <% Ordered[T]](s:IndexedSeq[T]): (IndexedSeq[T],IndexedSeq[T]) = {
val k = Random.nex... | qu1j0t3/functional-data | src/main/scala/au/com/telegraphics/data/Median.scala | Scala | gpl-2.0 | 652 |
package com.ctm
import org.apache.spark.{SparkConf, SparkContext}
object SparkWordCount {
def main(args: Array[String]) {
val conf = new SparkConf()
conf.set("spark.app.name", "SparkWordCount")
conf.set("spark.master", "local[4]")
conf.set("spark.ui.port", "36000") // Overri... | Omsrisairam/sparkwordcount | src/main/scala/com/ctm/sparkwordcount/SparkWordCount.scala | Scala | apache-2.0 | 760 |
import java.io.{File, FileWriter, BufferedWriter}
object GenVersions {
def genMain(targetDir: File, version: String, scalaVersion: String) {
val shortScalaVersion = scalaVersion.split("\\\\.").take(2).mkString(".")
targetDir.mkdirs()
val scalacticVersionsFile = new File(targetDir, "ScalacticVersions.sc... | travisbrown/scalatest | project/GenVersions.scala | Scala | apache-2.0 | 1,489 |
package models
import com.byteslounge.slickrepo.meta.Keyed
import slick.jdbc.JdbcProfile
object FileMetadataTable extends JdbcProfile {
import api.{Table => SlickTable, _}
val name = "FILES"
class FileMetadataTable(tag: Tag) extends SlickTable[FileMetadata](tag, name) with Keyed[Int] {
def id = column[In... | sysgears/apollo-universal-starter-kit | modules/upload/server-scala/src/main/scala/models/FileMetadataTable.scala | Scala | mit | 610 |
package com.madhukaraphatak.spark.sql.parquet
import org.apache.spark.SparkContext
/**
* Aggregate using DataFrame API in Parquet file
*/
object AggParquet {
def main(args: Array[String]) {
val sc = new SparkContext(args(0), "Parquet loading example")
val sqlContext = new org.apache.spark.sql.SQLCo... | phatak-dev/structured_data_processing_spark_sql | src/main/scala/com/madhukaraphatak/spark/sql/parquet/AggParquet.scala | Scala | apache-2.0 | 516 |
object Exporter {
object Exportee {
inline def foo(args: String*): String = args.mkString(" ")
inline def bar(l: Option[Int])()(i: Int)(b: Boolean, args: String*): String =
s"$l-$i-$b-${args.mkString("-")}"
}
export Exportee._
}
import Exporter.*
@main def Test =
println(foo("a", "b", "c"))
p... | dotty-staging/dotty | tests/run/i10724.scala | Scala | apache-2.0 | 367 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | aosagie/spark | project/SparkBuild.scala | Scala | apache-2.0 | 42,062 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | markusthoemmes/openwhisk | tests/src/test/scala/org/apache/openwhisk/common/ConfigMapValueTests.scala | Scala | apache-2.0 | 2,251 |
package models.request
import models.ScheduledJobType
import play.api.libs.json.Json
/**
* Represents a request to launch a scheduled job.
*/
case class LaunchJob(jobType: ScheduledJobType.Value, cronExpression: String) {
}
/**
* implements a companion object for LaunchJob.
*/
object LaunchJob {
implicit val l... | aquisio/quartz-scheduler-scala | app/models/request/LaunchJob.scala | Scala | unlicense | 416 |
trait Foo[A, B]
object Foo {
type Bar[A] = Foo[A, _]
}
trait Base[M[_]] {
def method(in: M[_]): Unit
}
class Concrete extends Base[Foo.Bar] {
def method(in: Foo.Bar[_]): Unit = {}
}
trait Template[M[_]] {
def toBeImplemented: Base[M]
def mark[A]: M[A]
def method2(): Unit = {
toBeImplemented.method(m... | scala/scala | test/files/run/t10363.scala | Scala | apache-2.0 | 567 |
package leon
package laziness
import invariant.util._
import invariant.structure.FunctionUtils._
import purescala.TypeOps
import purescala.Common._
import purescala.Definitions._
import purescala.Expressions._
import purescala.ExprOps._
import purescala.Types._
import leon.invariant.util.TypeUtil._
import HOMemUtil._
... | epfl-lara/leon | src/main/scala/leon/laziness/ClosureFactory.scala | Scala | gpl-3.0 | 11,777 |
/**
* Copyright 2012-2013 StackMob
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | matthewfarwell/stackmob-customcode-dev | project/build.scala | Scala | apache-2.0 | 1,792 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | jinglining/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/batch/sql/join/LookupJoinTest.scala | Scala | apache-2.0 | 12,184 |
package org.usagram.clarify.validator
import org.usagram.clarify.error.ShouldBeLessThan
class LessThan[-V](that: V)(implicit ordering: Ordering[V]) extends Validator[V] {
def validate(value: V) =
failIf(ordering.gteq(value, that)) {
ShouldBeLessThan(that)
}
def orEqual: LessThanOrEqualTo[V] = LessT... | takkkun/clarify | core/src/main/scala/org/usagram/clarify/validator/LessThan.scala | Scala | mit | 452 |
package com.tdl.study.scala.pkg2.basic
/**
* sealed 关键字限定所有子类必须在当前文件中,不得在其它文件中继承
*/
sealed abstract class Sealeds {
class Sealeds1 extends Sealeds {}
class Sealeds2 extends Sealeds {}
}
| taideli/study-parent | study-scala/src/main/scala/com/tdl/study/scala/pkg2/basic/Sealeds.scala | Scala | gpl-3.0 | 251 |
/*
Copyright 2013 Stephen K Samuel
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | davenatx/scrimage | scrimage-filters/src/main/scala/com/sksamuel/scrimage/filter/ColorizeFilter.scala | Scala | apache-2.0 | 1,242 |
package com.socrata.soql.brita
/** Creates an identifier from a (sequence of) strings according to
* the SoQL specification for creating aliases of expressions. */
object IdentifierFilter {
def apply(xs: Iterable[String]) = new Impl(xs).go()
def apply(x: String) = new Impl(Some(x)).go()
private class Impl(xs:... | socrata-platform/soql-brita | src/main/scala/com/socrata/soql/brita/IdentifierFilter.scala | Scala | apache-2.0 | 627 |
// The MIT License (MIT)
//
// Copyright (c) 2015 David Heidrich, BowlingX <me@bowlingx.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limit... | BowlingX/commentp | src/main/scala/com/bowlingx/commentp/akka/TimeoutPromise.scala | Scala | mit | 2,014 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This... | beangle/ems | app/src/main/scala/org/beangle/ems/app/blob/Repository.scala | Scala | lgpl-3.0 | 1,451 |
package net.technowizardry.xmpp.messages
import net.technowizardry.XMLWriter
class StreamCloseMessage extends XmppProtocolMessage with WritableXmppMessage {
def WriteMessage(writer : XMLWriter) {
writer.WriteEndElement()
}
} | ajacques/XmppClient | SeniorProject/src/net/technowizardry/xmpp/messages/StreamCloseMessage.scala | Scala | mit | 238 |
package nodescala
import com.sun.net.httpserver._
import scala.concurrent._
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
import scala.async.Async.{async, await}
import scala.collection._
import scala.collection.JavaConversions._
import java.util.concurrent.{Executor, ThreadPoolExecutor, ... | mitochon/hexercise | src/mooc/reactive/week3.nodescala.orig/src/main/scala/nodescala/nodescala.scala | Scala | mit | 4,745 |
package com.twitter.algebird
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class MinMaxAggregatorSpec extends AnyWordSpec with Matchers {
sealed trait TestElementParent
case object TestElementA extends TestElementParent
case object TestElementB extends TestElementParent... | twitter/algebird | algebird-test/src/test/scala/com/twitter/algebird/MinMaxAggregatorSpec.scala | Scala | apache-2.0 | 1,224 |
import _root_.io.gatling.core.scenario.Simulation
import ch.qos.logback.classic.{Level, LoggerContext}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
/**
* Performance test for the Schutzausruestung entity.
*/
class Schutzausruestung... | t08094a/ffManagementSuite | src/test/gatling/user-files/simulations/SchutzausruestungGatlingTest.scala | Scala | gpl-3.0 | 3,567 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.testsuite.javalib.util
im... | scala-js/scala-js | test-suite/shared/src/test/require-jdk11/org/scalajs/testsuite/javalib/util/OptionalTestOnJDK11.scala | Scala | apache-2.0 | 2,692 |
package org.littlewings.infinispan.listener
import org.infinispan.notifications.Listener
import org.infinispan.notifications.cachelistener.annotation._
import org.infinispan.notifications.cachelistener.event.{CacheEntriesEvictedEvent, CacheEntryEvent}
trait CacheListener[K, V] {
val name: String
@CacheEntryCreat... | kazuhira-r/infinispan-getting-started | embedded-listeners/src/main/scala/org/littlewings/infinispan/listener/CacheListener.scala | Scala | mit | 1,024 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/Quasar | core/src/main/scala/quasar/metastore/MetaStore.scala | Scala | apache-2.0 | 6,098 |
package com.sksamuel.elastic4s.requests.indexes.admin.recovery
import com.sksamuel.elastic4s.ext.OptionImplicits._
case class IndexRecoveryRequest(indices: Seq[String],
activeOnly: Option[Boolean] = None,
detailed: Option[Boolean] = None) {
def activeO... | sksamuel/elastic4s | elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/indexes/admin/recovery/IndexRecoveryRequest.scala | Scala | apache-2.0 | 487 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package models.navigation
import play.api.mvc.Call
/**
* @author hiral
*/
object QuickRoutes {
import models.navigation.BreadCrumbs._
val baseRoutes : Map[String, () => Call] = Map(
"Clust... | krux/kafka-manager | app/models/navigation/QuickRoutes.scala | Scala | apache-2.0 | 3,686 |
package reasonably
import language.higherKinds
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
object Algebra {
trait Monad[M[_]] {
def pure[A](a: => A): M[A]
def flatMap[A,B](a: M[A])(f: A => M[B]): M[B]
}
object Monad {
def apply[F[_]:Monad]: Monad[F] = i... | enpassant/scalaz | src/main/scala/reasonably/Algebra.scala | Scala | apache-2.0 | 3,107 |
package com.hyenawarrior.OldNorseGrammar.grammar
import com.hyenawarrior.OldNorseGrammar.grammar.enums.GNumber._
import com.hyenawarrior.OldNorseGrammar.grammar.enums.{GNumber, Pronoun}
import com.hyenawarrior.OldNorseGrammar.grammar.verbs.enums.VerbVoice.{ACTIVE, MEDIO_PASSIVE}
import com.hyenawarrior.OldNorseGrammar... | HyenaSoftware/IG-Dictionary | OldNorseGrammarEngine/src/main/scala/com/hyenawarrior/OldNorseGrammar/grammar/verbs/package.scala | Scala | lgpl-3.0 | 2,734 |
import scala.annotation.unchecked.uncheckedVariance
class Outer {
// A final class gets no outer ref, so we expect to see warnings where an outer ref check should be performed
final case class Inner(val s: String) // unchecked warning
def belongs(a: Any): Unit = a match {
case Inner(s) => // unchecked warni... | felixmulder/scala | test/files/neg/outer-ref-checks.scala | Scala | bsd-3-clause | 2,589 |
package com.sksamuel.elastic4s.fields
import com.sksamuel.elastic4s.fields.builders.ElasticFieldBuilderFn
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
class LongFieldTest extends AnyFunSuite with Matchers {
test("LongField fields") {
val field = LongField(
name ... | stringbean/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/fields/LongFieldTest.scala | Scala | apache-2.0 | 733 |
package org.scalatest
import org.scalatest.prop.TableDrivenPropertyChecks
import java.lang.annotation.AnnotationFormatError
import java.nio.charset.CoderMalfunctionError
import javax.xml.parsers.FactoryConfigurationError
import javax.xml.transform.TransformerFactoryConfigurationError
import scala.collection.GenTravers... | svn2github/scalatest | src/test/scala/org/scalatest/InspectorsSpec.scala | Scala | apache-2.0 | 65,982 |
package sbt
package internals
package parser
import java.io.File
import sbt.internals.parser.SbtParser._
import scala.reflect.runtime.universe._
private[sbt] object SbtParser {
val END_OF_LINE_CHAR = '\\n'
val END_OF_LINE = String.valueOf(END_OF_LINE_CHAR)
private[parser] val NOT_FOUND_INDEX = -1
private[sb... | pdalpra/sbt | main/src/main/scala/sbt/internals/parser/SbtParser.scala | Scala | bsd-3-clause | 8,577 |
package cromwell.backend.impl.sfs.config
import com.typesafe.config.ConfigFactory
import cromwell.backend.MemorySize
import cromwell.backend.impl.sfs.config.ConfigConstants._
import cromwell.backend.validation.{RuntimeAttributesKeys, ValidatedRuntimeAttributes}
import org.scalatest.prop.TableDrivenPropertyChecks
impor... | ohsu-comp-bio/cromwell | supportedBackends/sfs/src/test/scala/cromwell/backend/impl/sfs/config/MemoryDeclarationValidationSpec.scala | Scala | bsd-3-clause | 4,613 |
package org.scalaide.core
package sbtbuilder
import org.eclipse.core.resources.IFile
import org.eclipse.core.resources.IncrementalProjectBuilder
import org.eclipse.core.runtime.NullProgressMonitor
import org.junit.Assert.assertTrue
import org.junit.BeforeClass
import org.junit.Test
import org.scalaide.core.testsetup.S... | dragos/scala-ide | org.scala-ide.sdt.core.tests/src/org/scalaide/core/sbtbuilder/ScalaJavaDepWhenJavaIsWrongTest.scala | Scala | bsd-3-clause | 3,053 |
package info.hargrave.composer.util
import info.hargrave.composer.util
import info.hargrave.composer.util.Localization.TString
import org.streum.configrity._
import org.streum.configrity.io.FlatFormat
import scala.collection.immutable.StringLike
import scala.io.Source
/**
* Trait that can be mixed in where i18n res... | RomanHargrave/CUEComposer | src/main/scala/info/hargrave/composer/util/Localization.scala | Scala | gpl-3.0 | 4,245 |
package opentrack.jp.planner
import java.time.LocalDate
import opentrack.jp.journey.Journey
import opentrack.jp.planner.filter.SlowJourneyFilter
import opentrack.jp.station.Location
import opentrack.jp.station.repository.StationRepository
import opentrack.jp.transferpattern.repository.TransferPatternRepository
impor... | open-track/journey-planner-scala | app/opentrack/jp/planner/GroupStationPlanner.scala | Scala | gpl-3.0 | 1,072 |
package com.github.jeroenr.bson
import java.nio.ByteOrder
import com.github.jeroenr.bson.element.BsonObjectId
import com.github.jeroenr.bson.reader.BsonDocumentReader
import BsonDsl._
import org.joda.time.DateTime
import org.scalatest.OptionValues._
import org.scalatest.{Matchers, WordSpec}
class BsonSpec extends Wo... | jeroenr/tepkin | bson/src/test/scala/com/github/jeroenr/bson/BsonSpec.scala | Scala | apache-2.0 | 2,558 |
package org.workcraft.services
import org.workcraft.scala.effects.IO
import org.workcraft.scala.effects.IO._
object FileNameService extends Service[ModelScope, FileName] {
def attach (model: ModelServiceProvider, fileName: Option[String]) = model ++ new ModelServiceProvider {
def implementation[T](service: Serv... | mechkg/workcraft | Core/src/main/scala/org/workcraft/services/FileNameService.scala | Scala | gpl-3.0 | 682 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.annotation.extern
import leon.lang._
object Generics5 {
case class Dummy[T](t: T)
def fun[T](x: Int) = x
def gun[T](x: T) = x
def _main() = {
fun[Int](58) - 58 /* == 0 */ + gun(42) - 42 /* == 0 */ + fun[Char](0)
} ensuring { _ == 0 }
@extern
d... | regb/leon | src/test/resources/regression/genc/valid/Generics5.scala | Scala | gpl-3.0 | 368 |
/*
* Copyright 2015 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | scottcutts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600j/v3/J50A.scala | Scala | apache-2.0 | 1,013 |
package lensimpl.subtyping
trait Optional[A, B] { self =>
def getOption(from: A): Option[B]
def set(to: B): A => A
def modify(f: B => B): A => A = a => getOption(a).fold(a)(set(_)(a))
def compose[C](other: Optional[B, C]): Optional[A, C] = new Optional[A, C] {
def getOption(from: A): Option[C] = self.get... | julien-truffaut/LensImpl | core/src/main/scala/lensimpl/subtyping/Optional.scala | Scala | mit | 721 |
package controllers
import com.github.tototoshi.play2.auth.{AuthenticityToken, AsyncIdContainer, AuthConfig}
import com.github.tototoshi.play2.auth.sample.{Role, Account}
import com.github.tototoshi.play2.auth.sample.Role._
import play.api.mvc.RequestHeader
import play.api.mvc.Results._
import scala.concurrent.{Futur... | tototoshi/play2-auth | sample/app/controllers/BaseAuthConfig.scala | Scala | apache-2.0 | 3,916 |
// Copyright 2015 Willem Meints
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to... | wmeints/ReactivePI | core/src/main/scala/nl/fizzylogic/reactivepi/gpio/InputPin.scala | Scala | apache-2.0 | 1,213 |
package dao
import java.sql.SQLException
import javax.inject.{Inject, Singleton}
import com.typesafe.scalalogging.LazyLogging
import models.NodeEntity
import play.api.db.slick.{DatabaseConfigProvider, HasDatabaseConfigProvider}
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import slick.driver.Jdb... | vuminhkh/tosca-runtime | deployer/app/dao/NodeDAO.scala | Scala | mit | 1,640 |
/*
* Copyright 2001-2008 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | hubertp/scalatest | src/main/scala/org/scalatest/FailureMessages.scala | Scala | apache-2.0 | 2,149 |
package blended.jms.utils.internal
import java.text.SimpleDateFormat
import blended.jms.utils.{ConnectionCommand, ConnectionState, Disconnected}
class ConnectionMonitor(vendor : String, provider : String, clientId : String) extends ConnectionMonitorMXBean {
private[this] val df = new SimpleDateFormat("yyyy-MM-dd-H... | woq-blended/blended | blended.jms.utils/src/main/scala/blended/jms/utils/internal/ConnectionMonitor.scala | Scala | apache-2.0 | 1,799 |
package spinoco.fs2.http.sse
import cats.effect.IO
import fs2.Chunk.ByteVectorChunk
import fs2._
import org.scalacheck.Properties
import org.scalacheck.Prop._
import scodec.bits.ByteVector
import spinoco.fs2.http.sse.SSEMessage.SSEData
import spinoco.fs2.http.util.chunk2ByteVector
object SSEEncodingSpec extends Prop... | Spinoco/fs2-http | src/test/scala/spinoco/fs2/http/sse/SSEEncodingSpec.scala | Scala | mit | 2,138 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | yelshater/hadoop-2.3.0 | spark-core_2.10-1.0.0-cdh5.1.0/src/main/scala/org/apache/spark/scheduler/cluster/SimrSchedulerBackend.scala | Scala | apache-2.0 | 2,352 |
package com.wavesplatform.lang.v1
import cats.Eval
import cats.data.EitherT
import com.wavesplatform.lang.v1.evaluator.ctx.LoggedEvaluationContext
import com.wavesplatform.lang.v1.task.TaskMT
import com.wavesplatform.lang.{EvalF, ExecutionError, TrampolinedExecResult}
package object evaluator {
type EvalM[F[_], C[_... | wavesplatform/Waves | lang/shared/src/main/scala/com/wavesplatform/lang/v1/evaluator/package.scala | Scala | mit | 1,022 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | hdinsight/spark-eventhubs | core/src/main/scala/org/apache/spark/eventhubs/EventPosition.scala | Scala | apache-2.0 | 4,024 |
package ml.combust.mleap.core.ann
/** NOTE: this code was taken from Spark and adopted for
* use by MLeap outside of a Spark Context
*
* https://github.com/apache/spark/blob/v2.0.0/mllib/src/main/scala/org/apache/spark/ml/ann/LossFunctions.scala
*/
import java.util.Random
import breeze.linalg.{sum => Bsum, D... | combust-ml/mleap | mleap-core/src/main/scala/ml/combust/mleap/core/ann/LossFunctions.scala | Scala | apache-2.0 | 3,629 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | guoxiaolongzte/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala | Scala | apache-2.0 | 32,404 |
package reasonable.error
import language.higherKinds
import scalaz._, Scalaz._, Free._
import reasonable.Algebra._
object ErrorAlgebra {
sealed trait ErrorMonad[A]
case class Error(msg: Throwable) extends ErrorMonad[Throwable]
class ErrorMonads[F[_]](implicit I: Inject[ErrorMonad,F]) {
def error(t: Throwa... | enpassant/scalaz | src/main/scala/reasonable/error/ErrorAlgebra.scala | Scala | apache-2.0 | 499 |
Subsets and Splits
Filtered Scala Code Snippets
The query filters and retrieves a sample of code snippets that meet specific criteria, providing a basic overview of the dataset's content without revealing deeper insights.