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 |
|---|---|---|---|---|---|
/***********************************************************************
* Copyright (c) 2013-2015 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0 which
* accompanies this distribution and is ... | mcharles/geomesa | geomesa-raster/src/main/scala/org/locationtech/geomesa/raster/index/RasterEntry.scala | Scala | apache-2.0 | 3,971 |
/*
* 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 ... | WeichenXu123/spark | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala | Scala | apache-2.0 | 33,130 |
package momijikawa.p2pscalaproto
import akka.actor._
import akka.pattern.ask
import scala.reflect.ClassTag
import akka.util.Timeout
import scala.concurrent.{ Await, Future }
import scala.concurrent.duration._
/**
* すべてのメッセージの継承元。
*/
class Message {
// not sealed because of extension
def !?[T: ClassTag](a: Actor... | windymelt/p2pScalaProto | src/main/scala/momijikawa/p2pscalaproto/Messages.scala | Scala | bsd-3-clause | 4,479 |
package org.bizzle.astar
import
org.bizzle.tester.{ criteria, TestCriteriaDialect },
criteria._,
TestCriteriaDialect._
import
org.bizzle.pathfinding.TestScript
/**
* Created by IntelliJ IDEA.
* User: Jason
* Date: 12/9/11
* Time: 2:48 PM
*/
object BiDirAStarTest extends TestScript {
run(1 >&> 39 ... | TheBizzle/PathFinding | AStar/src/test/org/bizzle/astar/BiDirAStarTest.scala | Scala | bsd-3-clause | 418 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.routes.compiler
import java.io.File
import org.specs2.mutable.Specification
import org.specs2.matcher.FileMatchers
import play.routes.compiler.RoutesCompiler.RoutesCompilerTask
class RoutesCompilerSpec extends Specification with FileMat... | benmccann/playframework | dev-mode/routes-compiler/src/test/scala/play/routes/compiler/RoutesCompilerSpec.scala | Scala | apache-2.0 | 2,397 |
package org.jetbrains.plugins.scala
package lang.refactoring.extractMethod
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScFunction
import scala.collection.mutable.ArrayBuffer
import org.jetbrains.plugins.scala.lang.psi.api.statements.params.ScTypeParam
import com.intellij.psi.{ResolveState, PsiNamedEleme... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/refactoring/extractMethod/ScalaExtractMethodUtils.scala | Scala | apache-2.0 | 20,269 |
package com.stockit.yql
import com.stockit.util.ConcurrentReducer
import org.slf4j.LoggerFactory
import scala.concurrent.{Future, Await}
import scala.concurrent.duration.Duration
import scala.concurrent.ExecutionContext.Implicits.global
/**
* Created by jmcconnell1 on 3/17/15.
*/
class StockClient {
val logger... | stockit/stockit-indexer | src/main/scala/com/stockit/yql/StockClient.scala | Scala | gpl-2.0 | 2,159 |
/**
* Copyright (c) 2012 Petr Kozelek <petr.kozelek@gmail.com>
*
* The full copyright and license information is presented
* in the file LICENSE that was distributed with this source code.
*/
package mql.comparer
object ComparisonResult extends Enumeration {
type ComparisonResult = Value
val LeftOnly, RightOn... | footcha/MQL | src/main/scala/mql/comparer/ComparisonResult.scala | Scala | bsd-3-clause | 350 |
/*
* 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 ... | pgandhi999/spark | sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala | Scala | apache-2.0 | 37,113 |
package scheduler.controllers
import controllers.KafkaManagerContext
import play.api.mvc.{Action, Controller}
object SchedulerApplication extends Controller {
private[this] val kafkaManager = KafkaManagerContext.getKafkaManager
import play.api.libs.concurrent.Execution.Implicits.defaultContext
def getSchedul... | stealthly/kafka-manager | app/scheduler/controllers/SchedulerApplication.scala | Scala | apache-2.0 | 902 |
/*
* Copyright 2011-2021 GatlingCorp (https://gatling.io)
*
* 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 applic... | gatling/gatling | src/docs/content/reference/current/http/helpers/code/HttpHelperSampleScala.scala | Scala | apache-2.0 | 2,006 |
import sbt._
import sbt.Keys._
import sbt.File
object Docs {
val apiDocsInclude = SettingKey[Boolean]("api-docs-include", "Whether this sub project should be included in the API docs")
val apiDocsIncludeManaged = SettingKey[Boolean]("api-docs-include-managed", "Whether managed sources from this project should be ... | michaelahlers/team-awesome-wedding | vendor/play-2.2.1/framework/project/Docs.scala | Scala | mit | 6,075 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | erictu/adam | adam-cli/src/main/scala/org/bdgenomics/adam/cli/CountReadKmers.scala | Scala | apache-2.0 | 3,397 |
package app
import com.google.inject.Guice
import com.mohiva.play.silhouette.api.{ Logger, SecuredSettings }
import play.api.GlobalSettings
import utils.di.SilhouetteModule
/**
* The global configuration.
*/
object Global extends GlobalSettings with SecuredSettings with Logger {
/**
* The Guice dependencies ... | mehdichamouma/session-montpellier | app/Global.scala | Scala | apache-2.0 | 842 |
package de.sciss.lucre.matrix
import de.sciss.file._
import de.sciss.lucre.artifact.{Artifact, ArtifactLocation}
import de.sciss.lucre.expr.{IntObj, StringObj}
import de.sciss.lucre.matrix.DataSource.Resolver
import de.sciss.lucre.stm.InMemory
import de.sciss.synth.proc.{GenContext, WorkspaceHandle}
import ucar.nc2
i... | iem-projects/LucreMatrix | core/src/test/scala/de/sciss/lucre/matrix/NewReadTest.scala | Scala | lgpl-2.1 | 3,780 |
package dotty.tastydoc
import representations._
import references._
import comment.Comment
import scala.annotation.tailrec
import java.io._
class DocPrinter(mutablePackagesMap: scala.collection.mutable.HashMap[String, EmulatedPackageRepresentation], userDocSyntax: String, packagesToLink: List[String]){
val packa... | som-snytt/dotty | tastydoc/src/dotty/tastydoc/DocPrinter.scala | Scala | apache-2.0 | 19,363 |
package test.feed
/**
* @author terry
*/
import main.scala.feed.Cafe
import main.scala.feed.Mendeley
import main.scala.model.{ScienceDirect,Scopus}
object CafeTest {
//Cafe.scienceDirectMessages.foreach { println }
// println(Cafe.fetched("sc-ani-xml-prod", "84918592010"))
// println(Cafe.fetched("sc-apr... | adeagbot/snowball | src/test/scala/feed/Cafe.scala | Scala | gpl-2.0 | 810 |
package slaq.test
import org.junit.Test
import org.junit.Assert._
import slaq.ql._
import slaq.ql.TypeMapper._
import slaq.ql.driver.MySQLDriver
import slaq.session._
import slaq.test.util._
import slaq.test.util.TestDB._
object SequenceTest extends DBTestObject(H2Mem, Postgres, MySQL, HsqldbMem)
class SequenceTest(... | godenji/slaq | src/test/scala/slaq/scalaquery/test/SequenceTest.scala | Scala | bsd-2-clause | 2,051 |
/**
* 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"); yo... | TiVo/kafka | core/src/test/scala/unit/kafka/server/CreateTopicsRequestWithPolicyTest.scala | Scala | apache-2.0 | 8,480 |
/*
* Copyright 2015-2016 IBM Corporation
*
* 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 agree... | nwspeete-ibm/openwhisk | common/scala/src/main/scala/whisk/common/Config.scala | Scala | apache-2.0 | 5,541 |
package com.ubirch.user.core.manager
import com.typesafe.scalalogging.StrictLogging
import com.ubirch.user.core.manager.util.UserInfoUtil
import com.ubirch.user.model.db.{Context, Group, User}
import com.ubirch.user.model.rest.{UserContext, UserInfo, UserInfoGroup}
import com.ubirch.util.mongo.connection.MongoUtil
i... | ubirch/ubirch-user-service | core/src/main/scala/com/ubirch/user/core/manager/RegistrationManager.scala | Scala | apache-2.0 | 5,069 |
package dsentric
import dsentric._
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
class ProjectionTests extends AnyFunSuite with Matchers {
import Dsentric._
import dsentric.codecs.std.DCodecs._
object Query1 extends Contract {
val field = \?[String]
val nested ... | HigherState/dsentric | maps/src/test/scala/dsentric/ProjectionTests.scala | Scala | apache-2.0 | 3,567 |
/*
* Copyright (c) 2018. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagi... | BiyuHuang/CodePrototypesDemo | demo/DataLoader/src/main/scala/com/hackerforfuture/codeprototypes/dataloader/DataLoader.scala | Scala | apache-2.0 | 1,881 |
import org.apache.log4j.{Level, Logger}
import org.apache.spark.graphx._
import org.apache.spark.graphx.util.GraphGenerators
import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}
object clusterWildGraphv01 {
def main(args: Array[String]) = {
Logger.getLogger("org").setLevel(Level.WAR... | anadim/clusterWild | src/main/scalaPre20150324/clusterWildv0.1.scala | Scala | apache-2.0 | 3,187 |
/*
* 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 ... | chuckchen/spark | sql/core/src/test/scala/org/apache/spark/sql/JoinHintSuite.scala | Scala | apache-2.0 | 28,658 |
package controllers
import play.api.mvc.Action
import models.AssetSupport.IdType
import play.api.mvc.BodyParsers.parse
import models.customer.{EmailTypeIn, EmailTypeUpdate, EmailTypeCreate}
import controllers.utils.CrudController
object EmailTypes extends CrudController {
override type MODEL = EmailTypeIn
overr... | tsechov/shoehorn | app/controllers/EmailTypes.scala | Scala | apache-2.0 | 730 |
package fafa
import org.scalatest.{Matchers, FlatSpec}
/**
* Created by mac on 07.01.16.
*/
class BaseTest extends FlatSpec with Matchers {
}
| Macok/fafachess | src/test/scala/fafa/BaseTest.scala | Scala | apache-2.0 | 149 |
/**
* Copyright 2011-2017 GatlingCorp (http://gatling.io)
*
* 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 appli... | timve/gatling | gatling-http/src/main/scala/io/gatling/http/request/package.scala | Scala | apache-2.0 | 722 |
package scala.meta
package internal
package trees
import scala.language.experimental.macros
import scala.annotation.StaticAnnotation
import scala.reflect.macros.whitebox.Context
import scala.collection.mutable.ListBuffer
import scala.meta.internal.trees.{Reflection => AstReflection}
// @branch is a specialized versio... | DavidDudson/scalameta | scalameta/common/shared/src/main/scala/scala/meta/internal/trees/branch.scala | Scala | bsd-3-clause | 2,073 |
/**
* Copyright 2011-2016 GatlingCorp (http://gatling.io)
*
* 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 appli... | GabrielPlassard/gatling | gatling-core/src/main/scala/io/gatling/core/action/TryMax.scala | Scala | apache-2.0 | 3,759 |
package org.psesd.srx.shared.core.sif
import org.psesd.srx.shared.core.exceptions.{ArgumentNullException, ExceptionMessage}
import org.scalatest.FunSuite
class SifProviderTests extends FunSuite {
test("valid provider") {
val sifProvider = new SifProvider(SifTestValues.sifUrl, SifTestValues.sessionToken, SifTes... | PSESD/srx-shared-core | src/test/scala/org/psesd/srx/shared/core/sif/SifProviderTests.scala | Scala | mit | 1,749 |
package de.leanovate.dose.product.model
import spray.json.DefaultJsonProtocol
import reactivemongo.bson.{BSONObjectID, Macros}
import de.leanovate.dose.product.util.TypeMapper._
case class ImageRef(thumbnail: BSONObjectID,
preview: BSONObjectID,
original: BSONObjectID)
object ... | leanovate/microzon-product | src/main/scala/de/leanovate/dose/product/model/ImageRef.scala | Scala | mit | 490 |
/*
* Copyright 2016 LinkedIn Corp.
*
* 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... | nntnag17/dr-elephant-1 | app/com/linkedin/drelephant/spark/fetchers/SparkFetcher.scala | Scala | apache-2.0 | 5,422 |
/*
* Copyright 2016 The BigDL Authors.
*
* 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... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/integration/torch/SequentialSpec.scala | Scala | apache-2.0 | 3,969 |
package com.landoop.streamreactor.connect.hive.sink
import com.landoop.streamreactor.connect.hive
import com.landoop.streamreactor.connect.hive._
import com.landoop.streamreactor.connect.hive.sink.config.HiveSinkConfig
import com.landoop.streamreactor.connect.hive.formats.HiveWriter
import com.landoop.streamreactor.co... | CodeSmell/stream-reactor | kafka-connect-hive/connector/src/main/scala/com/landoop/streamreactor/connect/hive/sink/HiveSink.scala | Scala | apache-2.0 | 5,466 |
package com.ubirch.user.server.route
import com.ubirch.user.config.Config
import com.ubirch.util.json.MyJsonProtocol
import com.ubirch.util.model.JsonResponse
import akka.http.scaladsl.server.Directives.{complete, get}
import akka.http.scaladsl.server.Route
import de.heikoseeberger.akkahttpjson4s.Json4sSupport._
/**... | ubirch/ubirch-user-service | server/src/main/scala/com/ubirch/user/server/route/WelcomeRoute.scala | Scala | apache-2.0 | 677 |
/*
* tswrdb - a program and API to export the TSW resource database
*
* Copyright (C) 2013 Joakim Bjørnstad <joakibj@gmail.com>
*
* Licensed under the GNU General Public License version 2.
* Please see the LICENSE file for the license text in verbatim.
*/
package com.joakibj.tswrdb.rdb.util
import java.nio.{By... | joakibj/tswrdb | tswrdb-api/src/main/scala/com/joakibj/tswrdb/rdb/util/ByteUtils.scala | Scala | gpl-2.0 | 1,134 |
package net.gerdriesselmann.unfiltered
import unfiltered.response._
import java.io.PrintWriter
import unfiltered.request.{HttpRequest, AcceptEncoding}
import unfiltered.Cycle
/**
* Extractor for Accept-Encoding header
*
* Use like:
*
* req match {
* case AcceptsEncoding.GZip(_) => ....
* }
... | gerdriesselmann/unfiltered-gzip | gzip.scala | Scala | mit | 3,759 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/expressions/DecimalTypeTest.scala | Scala | apache-2.0 | 7,799 |
package com.twitter.io
import com.twitter.conversions.DurationOps._
import com.twitter.conversions.StorageUnitOps._
import com.twitter.util.{Await, Future}
import org.scalacheck.{Arbitrary, Gen}
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import scala.annotation.tailrec
import org.scalatest.funs... | twitter/util | util-core/src/test/scala/com/twitter/io/BufReaderTest.scala | Scala | apache-2.0 | 3,956 |
package client.modules
import client.components.{Icon, LabelsList}
import diode.react.ModelProxy
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
import client.handler._
import client.rootmodel.SearchesRootModel
import client.css._
import shared.models.{Label, UserModel}
import ... | LivelyGig/ProductWebUI | client/src/main/scala/client/modules/Searches.scala | Scala | apache-2.0 | 51,311 |
// This package implements the higher-order analogue to Skolemization:
// a transformation from LK to LK_skc
package at.logic.gapt.proofs.algorithms.skolemization.lksk
import at.logic.gapt.language.hol.{ toLatexString }
import at.logic.gapt.proofs.lk.algorithms.getCutAncestors
import at.logic.gapt.proofs.lk.base.{ FSe... | gisellemnr/gapt | src/main/scala/at/logic/gapt/proofs/algorithms/skolemization/lksk/lksk.scala | Scala | gpl-3.0 | 22,711 |
package com.pwootage.metroidprime.templates
import scala.xml.NodeSeq
trait XmlSerializable {
def fromXml(v: NodeSeq): Unit
}
| Pwootage/prime-patcher | src/main/scala/com/pwootage/metroidprime/templates/XmlSerializable.scala | Scala | gpl-3.0 | 129 |
import sbt._
import Keys._
import Scope.ThisScope
object Sxr {
val sxrConf = config("sxr") hide
val sxr = TaskKey[File]("sxr")
val sourceDirectories = TaskKey[Seq[File]]("sxr-source-directories")
lazy val settings: Seq[Setting[_]] = inTask(sxr)(inSxrSettings) ++ baseSettings
def baseSettings = Seq(
lib... | xeno-by/old-scalameta-sbt | project/Sxr.scala | Scala | bsd-3-clause | 1,522 |
package enumeratum.values
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import argonaut._
import Argonaut._
/** Created by alonsodomin on 14/10/2016.
*/
class ArgonautValueEnumSpec extends AnyFunSpec with Matchers {
testArgonautEnum("LongArgonautEnum", ArgonautMediaType)
... | lloydmeta/enumeratum | enumeratum-argonaut/src/test/scala/enumeratum/values/ArgonautValueEnumSpec.scala | Scala | mit | 4,111 |
/*
* Copyright 2013 Twitter 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 agreed to... | AndreasPetter/storehaus | storehaus-dynamodb/src/main/scala/com/twitter/storehaus/dynamodb/DynamoStringStore.scala | Scala | apache-2.0 | 1,301 |
/*[-1-]Attribution-Share Alike 3.0 License, copyright (c) 2010 Pieter Hintjens, modified @alpaca-tc
[-2-]Asynchronous client-to-server (DEALER to BROKER)
[-3-]
[-4-]While this example runs in a single process, that is just to make
[-5-]it easier to start and stop the example. Each task has its own
[-6-]context and conc... | alpaca-tc/comment_extractor | spec/assets/source_code/scala.scala | Scala | mit | 1,632 |
package es.weso.schemaInfer
import es.weso.rdf.{Prefix, PrefixMap}
import es.weso.rdf.nodes.IRI
import es.weso.rdf.PREFIXES._
object PossiblePrefixes {
val wikidataId = "Endpoint(https://query.wikidata.org/sparql)"
val wikibase = IRI("http://wikiba.se/ontology#")
val schemaIri = IRI("http://schema.org/... | labra/shaclex | modules/schemaInfer/src/main/scala/es/weso/schemaInfer/PossiblePrefixes.scala | Scala | mit | 2,135 |
package example
import common._
object Lists {
/**
* This method computes the sum of all elements in the list xs. There are
* multiple techniques that can be used for implementing this method, and
* you will learn during the class.
*
* For this example assignment you can use the following methods in ... | jatinshah/coursera_scala_programming | wk0/example/src/main/scala/example/Lists.scala | Scala | mit | 1,743 |
import org.scalatest._
import techniques.PeakComparison._
import utils.Formatting._
/**
* Created by zhivka on 03.05.15.
*/
class PeakComparisonTests extends FunSuite with ShouldMatchers {
/*test("guerre") {
val sc = new SparkContext("local", "whatever")
val inputDir = "input"
val data = dataFormatter... | SidneyBovet/smargn | SparkCommander/src/test/scala/PeakComparisonTests.scala | Scala | gpl-2.0 | 1,153 |
object Serialize {
@throws(classOf[java.io.IOException])
def write[A](o: A): Array[Byte] = {
val ba = new java.io.ByteArrayOutputStream(512)
val out = new java.io.ObjectOutputStream(ba)
out.writeObject(o)
out.close()
ba.toByteArray()
}
@throws(classOf[java.io.IOException])
@throws(classOf[... | felixmulder/scala | test/files/jvm/t1143.scala | Scala | bsd-3-clause | 1,469 |
package threesixty.engine
import threesixty.visualizer.Visualization
import spray.http.{HttpMethods, HttpResponse, HttpHeaders, HttpRequest, AllOrigins, StatusCodes, ContentTypes, ContentType, MediaTypes, HttpEntity, StatusCode}
import ContentTypes.{`text/plain(UTF-8)`, `application/json`}
import MediaTypes.`image/sv... | elordin/threesixty | src/main/scala/threesixty/engine/Engine.scala | Scala | mit | 3,494 |
/*
* Copyright 2014 JHC Systems Limited
*
* 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 ag... | DavidGregory084/sqlest | sqlest/src/test/scala/sqlest/extractor/ColumnExtractorSpec.scala | Scala | apache-2.0 | 24,721 |
package io.github.loustler.traitt
/**
* @author loustler
* @since 08/25/2018
*/
class Rational(val n: Int, val d: Int) extends Ordered[Rational] {
// def <(that: Rational): Boolean = this.n * this.d < that.n * that.d
// def >(that: Rational): Boolean = that < this
// def <=(that: Rational): Boolean = (this < ... | loustler/sKaLa | src/main/scala/io/github/loustler/traitt/Rational.scala | Scala | apache-2.0 | 505 |
package uk.ac.ncl.openlab.intake24.foodsql.admin
import java.util.UUID
import javax.sql.DataSource
import anorm.NamedParameter.symbol
import anorm.{Macro, NamedParameter, SQL, sqlToSimple}
import com.google.inject.name.Named
import com.google.inject.{Inject, Singleton}
import org.slf4j.LoggerFactory
import uk.ac.ncl.... | digitalinteraction/intake24 | FoodDataSQL/src/main/scala/uk/ac/ncl/openlab/intake24/foodsql/admin/FoodsAdminImpl.scala | Scala | apache-2.0 | 7,602 |
package is.solidninja
package k8s
package api
package v1
import org.scalatest.{FreeSpec, Matchers}
import io.circe._
import io.circe.literal._
import io.circe.syntax._
import JsonProtocol._
class ContainerTest extends FreeSpec with Matchers {
"Container v1" - {
"should decode and reencode from a simple examp... | solidninja/openshift-scala-api | src/test/scala/is/solidninja/k8s/api/v1/ContainerTest.scala | Scala | mit | 4,102 |
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. Camunda licenses this file to you under the Apache License,
* Version 2.0; y... | camunda/feel-scala | src/test/scala/org/camunda/feel/impl/interpreter/InterpreterFunctionTest.scala | Scala | apache-2.0 | 7,015 |
package template.megam
import com.typesafe.config.{ Config, ConfigFactory }
import org.apache.spark._
import org.apache.spark.SparkContext._
import org.apache.spark.SparkContext, SparkContext._
import org.apache.spark.rdd.RDD
import scala.util.Try
import scala.collection.mutable.{ LinkedHashMap, ListBuffer }
trait Ho... | megamsys/meglytics_hotel_template | src/main/scala/template.megam/Engine.scala | Scala | apache-2.0 | 1,267 |
package org.jetbrains.plugins.scala.lang.macros.expansion
import java.io._
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.components.ProjectComponent
import com.intellij.openapi.fileEditor.FileEditorManager
import com.in... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/macros/expansion/ReflectExpansionsCollector.scala | Scala | apache-2.0 | 3,326 |
package com.twitter.zipkin.tracegen
/*
* Copyright 2014 Twitter 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 ... | Yelp/zipkin | zipkin-tracegen/src/main/scala/com/twitter/zipkin/tracegen/Main.scala | Scala | apache-2.0 | 4,931 |
/*
* 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/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600j/v2/J7.scala | Scala | apache-2.0 | 768 |
package com.szadowsz.gospel.core.listener
import com.szadowsz.gospel.core.event.io.ReadEvent
import java.util.EventListener
trait ReadListener extends EventListener {
def readCalled(event: ReadEvent)
} | zakski/project-soisceal | gospel-core/src/main/scala/com/szadowsz/gospel/core/listener/ReadListener.scala | Scala | lgpl-3.0 | 205 |
package com.websudos.phantom.builder.serializers
import com.websudos.phantom.builder.query.QueryBuilderTest
import com.websudos.phantom.tables.BasicTable
import com.websudos.phantom.dsl._
import com.websudos.util.testing._
class DeleteQuerySerialisationTest extends QueryBuilderTest {
"The DELETE query builder" - {... | analytically/phantom | phantom-dsl/src/test/scala/com/websudos/phantom/builder/serializers/DeleteQuerySerialisationTest.scala | Scala | bsd-2-clause | 1,757 |
package de.neuland.reminder.postgres
case class Reminder(id: String, author: String, recipient: String, message: String, schedules: String, webhookKey: String)
| neuland/matterminder | app/de/neuland/reminder/postgres/Reminder.scala | Scala | gpl-3.0 | 161 |
package org.jetbrains.plugins.scala.lang.formatter.tests
import org.jetbrains.plugins.scala.lang.formatter.AbstractScalaFormatterTestBase
trait LineCommentsTestOps { self: AbstractScalaFormatterTestBase =>
def doTextTestWithLineComments(before: String, after: String): Unit = {
doTextTest(before, after)
doT... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/formatter/tests/LineCommentsTestOps.scala | Scala | apache-2.0 | 895 |
package zzb.rest
package directives
import scala.concurrent.Future
import spray.util.SingletonException
class FutureDirectivesSpec extends RoutingSpec {
object TestException extends SingletonException
"The `onComplete` directive" should {
"properly unwrap a Future in the success case" in {
var i = 0
... | stepover/zzb | zzb-rest-tests/src/test/scala/zzb/rest/directives/FutureDirectivesSpec.scala | Scala | mit | 1,761 |
package com.kleggett.persistence.cache
/**
* This is a wrapper around whatever caching implementation you choose to use.
*
* @author K. Leggett
* @since 1.1 (6/13/15 5:21 PM)
*/
trait CacheWrapper[M]
{
def name: String
def get(key: Any): Option[M]
def add(key: Any, value: M)
def remove(key: Any): Boole... | kleggett/domainmodeling | src/main/scala/com/kleggett/persistence/cache/CacheWrapper.scala | Scala | cc0-1.0 | 362 |
package io.vamp.common.akka
import akka.actor.{Actor, ActorRefFactory}
import scala.concurrent.ExecutionContext
trait ExecutionContextProvider {
implicit def executionContext: ExecutionContext
}
trait ActorRefFactoryExecutionContextProvider extends ExecutionContextProvider {
implicit def executionContext: Execu... | BanzaiMan/vamp-common | src/main/scala/io/vamp/common/akka/ExecutionContextProvider.scala | Scala | apache-2.0 | 574 |
def f(arr:List[Int]):List[Int] = arr match {
case x::y::xs => y::f(xs)
case _ => List[Int]()
} | zearom32/hackerrankFP | scala/introduction/fp-filter-positions-in-a-list.scala | Scala | mit | 106 |
package com.sksamuel.elastic4s.requests.searches.aggs.builders
import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory}
import com.sksamuel.elastic4s.requests.script.ScriptBuilderFn
import com.sksamuel.elastic4s.requests.searches.aggs.{AggMetaDataFn, GeoBoundsAggregation}
object GeoBoundsAggregationBuild... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/aggs/builders/GeoBoundsAggregationBuilder.scala | Scala | apache-2.0 | 851 |
package com.trifectalabs.polyline
case class LatLng(
lat: Double,
lng: Double
)
| trifectalabs/polyline-scala | src/main/scala/LatLng.scala | Scala | mit | 85 |
package katas.scala.classic_katas.wordchain
import org.junit.Test
import org.scalatest.Matchers
import scala.collection.immutable.SortedSet
import scala.io.Source
/**
* User: dima
* Date: 26/05/2012
*/
class WordChain8 extends Matchers {
@Test def shouldFindMinChainOfTransformationsFromOneWordToAnother() {
fi... | dkandalov/katas | scala/src/katas/scala/classic_katas/wordchain/WordChain8.scala | Scala | unlicense | 3,804 |
package io.citrine.lolo.hypers
import io.citrine.lolo.Learner
/**
* Brute force search over the grid of hypers
*
* Created by maxhutch on 12/7/16.
*/
case class GridHyperOptimizer() extends HyperOptimizer {
/**
* Search by enumerating every combination of hyper values
*
* @param trainingData t... | CitrineInformatics/lolo | src/main/scala/io/citrine/lolo/hypers/GridHyperOptimizer.scala | Scala | apache-2.0 | 1,868 |
package dk.bayes.factorgraph.ep.util
import dk.bayes.factorgraph.FactorGraph
import scala.math._
import java.util.concurrent.atomic.AtomicInteger
import dk.bayes.factorgraph.GenericFactorGraph
import dk.bayes.factorgraph.factor.DiffGaussianFactor
import dk.bayes.factorgraph.factor.LinearGaussianFactor
import dk.bayes.... | danielkorzekwa/bayes-scala | src/test/scala/dk/bayes/factorgraph/ep/util/TennisFactorGraphDBN.scala | Scala | bsd-2-clause | 3,075 |
package ru.stachek66.nlp.mystem
import java.net.URL
import com.typesafe.config.ConfigFactory
import org.slf4j.LoggerFactory
/**
* Various configs for interaction with outer world
* alexeyev
* 31.08.14.
*/
object Properties {
private val log = LoggerFactory.getLogger(getClass)
val BinDestination = System.g... | alexeyev/mystem-scala | src/main/scala/ru/stachek66/nlp/mystem/Properties.scala | Scala | mit | 1,798 |
package coursier
import java.lang.{Boolean => JBoolean}
import coursier.params.ResolutionParams
import coursier.util.Artifact
import scala.async.Async.{async, await}
import scala.concurrent.{ExecutionContext, Future}
object TestHelpers extends PlatformTestHelpers {
implicit def ec: ExecutionContext =
cache.e... | alexarchambault/coursier | modules/coursier/shared/src/test/scala/coursier/TestHelpers.scala | Scala | apache-2.0 | 5,919 |
/*
* Copyright 2013 the original author or authors.
*
* 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 applica... | Hocdoc/sandoc | src/main/scala/laika/parse/markdown/BlockParsers.scala | Scala | apache-2.0 | 10,006 |
package org.scalajs.openui5.sap.ui.model
import scala.scalajs.js
import scala.scalajs.js.annotation.JSName
@JSName("sap.ui.model.ListBinding")
@js.native
class ListBinding extends Binding {
def filter(filters: js.Array[Filter],
filterType: js.UndefOr[FilterType] = js.undefined): this.type = js.native
}... | lastsys/scalajs-openui5 | src/main/scala/org/scalajs/openui5/sap/ui/model/ListBinding.scala | Scala | mit | 321 |
package org.elasticmq.persistence
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
class QueueSorterTest extends AnyFunSuite with Matchers {
test("sorts an empty list") {
val sortedQueues = QueueSorter.sortCreateQueues(List())
sortedQueues should have size (0)
}
t... | adamw/elasticmq | persistence/persistence-core/src/test/scala/org/elasticmq/persistence/QueueSorterTest.scala | Scala | apache-2.0 | 3,029 |
/*******************************************************************************/
/* */
/* Copyright (C) 2017 by Max Lv <max.c.lv@gmail.com> */
/* Copyright (C) 2017 by Mygod Studio <contact-shadowsocks-android@mygod.... | weiwenqiang/GitHub | Linux/shadowsocks-android-master/mobile/src/main/scala/com/github/shadowsocks/GuardedProcess.scala | Scala | apache-2.0 | 4,727 |
package com.seanshubin.schulze
import com.seanshubin.black_box_test_5.Fixture
import com.seanshubin.black_box_test_5.tree.StringTree
class AlternativesFixture extends Fixture {
def run(input: Iterable[String]): Iterable[String] = {
val inputTree = StringTree.fromLines(input)
val pathsLines = inputTree.seque... | SeanShubin/schulze | test/src/main/scala/com/seanshubin/schulze/AlternativesFixture.scala | Scala | unlicense | 566 |
package org.dynfabdoc.styles
import scalacss.Defaults._
import scalacss.Attr
import scalacss.ValueT
import scalacss.Transform
import scalacss.CanIUse
import scala.language.postfixOps
import scalatags.Text.implicits._
import scalatags.Text.Util
import scalatags.Text.{ svgTags => S, svgAttrs => s }
import java.nio.chars... | math85360/dynFabDoc | src/main/scala/org/dynfabdoc/styles/Presentation.scala | Scala | gpl-3.0 | 2,993 |
package justin.db.cluster
import akka.actor.ActorRef
import justin.db.actors.StorageNodeActorRef
import justin.db.consistenthashing.NodeId
import org.scalatest.{FlatSpec, Matchers}
class ClusterMembersTest extends FlatSpec with Matchers {
behavior of "Cluster Members"
it should "define an \\"empty\\" method whi... | speedcom/JustinDB | justin-core/src/test/scala/justin/db/cluster/ClusterMembersTest.scala | Scala | apache-2.0 | 2,800 |
/**
* Copyright (c) 2016 Intel Corporation
*
* 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 applicabl... | trustedanalytics/spark-tk | sparktk-core/src/test/scala/org/trustedanalytics/sparktk/tensorflow/TensorFlowTest.scala | Scala | apache-2.0 | 10,567 |
object T {
def f () =
x = 3
def g () = {
freeBufs += ((cap, bufs))
bufs
}
}
| hjz/emacs | jz/scamacs/scala/T.scala | Scala | gpl-3.0 | 99 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.persistence
import akka.persistence.query.Offset
import akka.stream.scaladsl
import akka.{ Done, NotUsed }
import scala.concurrent.Future
import scala.concurrent.duration._
import scala.reflect.ClassTag
... | rstento/lagom | persistence/scaladsl/src/main/scala/com/lightbend/lagom/scaladsl/persistence/PersistentEntityRegistry.scala | Scala | apache-2.0 | 3,088 |
/*
* Copyright 2001-2013 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... | travisbrown/scalatest | src/test/scala/org/scalatest/ShouldBeAMatcherAndOrSpec.scala | Scala | apache-2.0 | 20,909 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2006-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | gourlaysama/scala-parser-combinators | src/main/scala/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala | Scala | bsd-3-clause | 1,906 |
package io.youi.stream
import java.nio.ByteBuffer
import java.nio.channels.SeekableByteChannel
import scala.annotation.tailrec
class ByteReader(startingSize: Int = 4096) {
private var bytes = new Array[Byte](startingSize)
def byteBuffer(length: Int): ByteBuffer = {
if (length > bytes.length) {
bytes =... | outr/youi | stream/src/main/scala/io/youi/stream/ByteReader.scala | Scala | mit | 991 |
object bits extends App { println((math.log(args(0).toInt) / math.log(2)).toInt + 1); }
| EvanHahn/bits-required | scala/bits.scala | Scala | unlicense | 88 |
package org.oneugene.log.play
import java.util.concurrent.TimeUnit
import org.oneugene.log.model._
import org.openjdk.jmh.annotations._
import org.openjdk.jmh.infra.Blackhole
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@BenchmarkMode(Array(Mode.AverageTime))
class MutableChangelogPerformanceTest {
import PrebuildLenses... | oneugene/evgeniy-portfolio | jmhtests/src/main/scala/org/oneugene/log/play/MutableChangelogPerformanceTest.scala | Scala | mit | 912 |
/*
Stratagem is a model checker for transition systems described using rewriting
rules and strategies.
Copyright (C) 2013 - SMV@Geneva University.
Program written by Edmundo Lopez Bobeda <edmundo [at] lopezbobeda.net>.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU G... | didierbuchs/oldstratagem | src/main/scala/ch/unige/cui/smv/stratagem/transformers/SetOfModules2TransitionSystem.scala | Scala | gpl-2.0 | 10,241 |
/*
* 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 ... | pferrel/PredictionIO | e2/src/test/scala/org/apache/predictionio/e2/engine/BinaryVectorizerTest.scala | Scala | apache-2.0 | 2,159 |
package com.oct.sclaav.visual.computation
import com.oct.sclaav._
import com.oct.sclaav.visual.computation.CellIntersectsExisting.{ApplyCellToTruthTable, FillQuadWithSingles}
import com.oct.sclaav.visual.manipulators.SimpleCrop
import com.sksamuel.scrimage.filter.{EdgeFilter, ThresholdFilter}
import com.sksamuel.scrim... | ogeagla/sclaav | src/main/scala/com/oct/sclaav/visual/computation/GeneratesEdgeDensityBasedQuadrilateralGrid.scala | Scala | apache-2.0 | 12,644 |
package springtastrophe.trees
/**
* General ADT for a file type `A`
*/
sealed trait FileTree[+A]
case object EmptyDir extends FileTree[Nothing]
final case class FileA[A](f: A) extends FileTree[A]
final case class FileDirectory[A](d: List[A]) extends FileTree[A] | hamishdickson/springtastrophe | src/main/scala/springtastrophe/trees/FileTree.scala | Scala | mit | 267 |
@deprecated("bla", "2.11.0") class Foo {
println("")
def this(x: Int) = this()
}
object Test {
new Foo // error: deprecated
new Foo(1) // error: deprecated
} | som-snytt/dotty | tests/neg-custom-args/deprecation/i2333.scala | Scala | apache-2.0 | 166 |
/*
*
* Copyright 2017 David Hall
*
* 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 ... | scalanlp/breeze | math/src/test/scala/breeze/collection/mutable/RingBufferTest.scala | Scala | apache-2.0 | 2,332 |
package io.hydrosphere.mist.api.ml
import breeze.linalg.{DenseVector => BDV, SparseVector => BSV, Vector => BV}
import org.apache.spark.ml.linalg.{DenseVector, Matrices, Matrix, SparseVector, Vector, Vectors}
import org.apache.spark.ml.param.{Param, Params}
import org.apache.spark.ml.tree._
import org.apache.spark.mll... | KineticCookie/mist | mist-lib/src/main/scala-2.11/io/hydrosphere/mist/api/ml/DataUtils.scala | Scala | apache-2.0 | 6,598 |
/*
* Copyright (c) 2013-2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0, and
* you may not use this file except in compliance with the Apache License
* Version 2.0. You may obtain a copy of the Apache License Version 2.0 at
* http://www.a... | mdavid/lessig-bigdata | lib/snowplow/2-collectors/scala-stream-collector/src/main/scala/com.snowplowanalytics.snowplow.collectors/scalastream/ResponseHandler.scala | Scala | mit | 6,850 |
package com.bwsw.commitlog.filesystem
import java.io.{File, FilenameFilter}
import java.nio.file.Paths
import java.text.SimpleDateFormat
import java.util.Calendar
/**
* Created by Ivan Kudryavtsev on 26.01.2017.
*/
object FilePathManager {
val EXTENSION = ".dat"
var CATALOGUE_GENERATOR = () => new SimpleDate... | bwsw/journaled-commit-log | src/main/scala/com/bwsw/commitlog/filesystem/FilePathManager.scala | Scala | apache-2.0 | 2,078 |
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.