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
/* * Scala (https://www.scala-lang.org) * * Copyright EPFL and Lightbend, Inc. * * Licensed under Apache License 2.0 * (http://www.apache.org/licenses/LICENSE-2.0). * * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ package scala package xml imp...
scala/scala-xml
shared/src/main/scala/scala/xml/Node.scala
Scala
apache-2.0
6,642
package elevators import elevators.queue.sweep._ import elevators.ui.MainPanel import scala.util.Random import javax.swing.JFrame import javax.swing.JPanel object Elevators { val random = new Random() def main(args: Array[String]) = { val queue = createLookQueue(List()) val mainPanel = new MainPanel...
wohanley/elevators
src/main/scala/elevators/Elevators.scala
Scala
agpl-3.0
676
package kschool.pfm.mail.dvl.model import reactivemongo.bson.{BSONArray, Macros} case class Contact (name: String, email: String) object Contact { implicit val contactHandler = Macros.handler[Contact] }
DVentas/PFM-Kschool-Flink-Docker
kschool.pfm.sendMail/src/main/scala/kschool/pfm/mail/dvl/model/Contact.scala
Scala
gpl-3.0
208
package almhirt.util sealed trait Severity extends Ordered[Severity] { def and(other: Severity): Severity = (this, other) match { case (Critical, _) ⇒ Critical case (_, Critical) ⇒ Critical case (Major, _) ⇒ Major case (_, Major) ⇒ Major case _ ⇒ Minor } /** Used for compariso...
chridou/almhirt
almhirt-common/src/main/scala/almhirt/util/Severity.scala
Scala
apache-2.0
1,101
/* * 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 ...
jeremiaswerner/openwhisk
tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskWebActionsTests.scala
Scala
apache-2.0
16,561
/** * 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...
rhauch/kafka
core/src/test/scala/unit/kafka/producer/SyncProducerTest.scala
Scala
apache-2.0
11,628
package com.twitter.storehaus.asynchbase import com.stumbleupon.async.Deferred import com.twitter.storehaus.testing.generator.NonEmpty.alphaStr import com.twitter.util.{Return, Throw, Await} import org.scalacheck.Prop.forAll import org.scalacheck.Properties class DeferredToFutureConverterProperties extends Properties...
twitter/storehaus
storehaus-hbase/src/test/scala/com/twitter/storehaus/asynchbase/DeferredToFutureConverterProperties.scala
Scala
apache-2.0
827
/* * 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 ...
apache/kylin
kylin-spark-project/kylin-spark-query/src/main/scala/org/apache/kylin/query/runtime/plans/AggregatePlan.scala
Scala
apache-2.0
12,715
import scala.{Seq => _} import scala.collection.immutable.Seq import org.scalameta.ast._ import scala.{meta => api} import scala.meta.inputs._ import scala.meta.tokens._ import scala.meta.prettyprinters._ import scala.meta.internal.{equality => e} package scala.meta { @root trait Tree extends Product with Serializab...
beni55/scalameta
scalameta/trees/src/main/scala/scala/meta/Trees.scala
Scala
bsd-3-clause
30,230
package org.scalaide.ui.internal.wizards import org.eclipse.core.runtime.IConfigurationElement import org.eclipse.jface.dialogs.IMessageProvider import org.eclipse.jface.wizard.WizardPage import org.eclipse.swt.widgets.Composite import org.eclipse.swt.widgets.Display import org.eclipse.ui.internal.dialogs.WorkbenchWiz...
Duhemm/scala-ide
org.scala-ide.sdt.core/src/org/scalaide/ui/internal/wizards/NewFileWizardAdapter.scala
Scala
bsd-3-clause
2,513
package io.pathfinder.routing import java.util.concurrent.TimeUnit import akka.actor.ActorRef import akka.event.{SubchannelClassification, ActorEventBus} import akka.util.{Subclassification, Timeout} import io.pathfinder.config.Global import io.pathfinder.models.{ModelId, HasCluster, Cluster, Commodity, Transport} im...
CSSE497/pathfinder-server
app/io/pathfinder/routing/Router.scala
Scala
mit
4,372
package kata.scala import scala.collection.mutable class GraphSearch(private val marked: Set[Int]) { def hasPathTo(vertex: Int): Boolean = marked.contains(vertex) } object DepthFirstSearch { def create(graph: Graph, startVertex: Int): Option[GraphSearch] = { if (!graph.contains(startVertex)) None ...
Alex-Diez/Scala-TDD-Katas
old-katas/graph-search-kata/day-4/src/main/scala/kata/scala/GraphSearch.scala
Scala
mit
1,483
/** * @author Yuuto */ package yuuto.enhancedinventories.ref final object ReferenceEI { final val MOD_ID= "EnhancedInventories"; final val MOD_NAME = "Enhanced Inventories"; final val VERSION = "1.7.10-1.1.9"; final val MOD_PACKAGE = "yuuto.enhancedinventories"; final val PROXY_CLIENT = MOD_PACKAGE+".pr...
AnimeniacYuuto/EnhancedInventories
src/main/scala/yuuto/enhancedinventories/ref/ReferenceEI.scala
Scala
gpl-2.0
449
package sims.test.gui class DebugWorld extends sims.dynamics.World with Publisher { override def +=(b: sims.dynamics.Body) = { super.+=(b) publish(BodyAdded(this, b)) } override def -=(b: sims.dynamics.Body) = { super.-=(b) publish(BodyRemoved(this, b)) } override def +=(j: sims.dynamics.Joint) = { ...
jodersky/sims2
src/test/scala/sims/test/gui/DebugWorld.scala
Scala
bsd-3-clause
536
import scala.reflect.runtime.universe._ object Test extends dotty.runtime.LegacyApp { val tree1 = reify(new collection.immutable.HashMap[String, String]) val tree2 = reify(new collection.mutable.HashMap[String, String]) println(showRaw(tree1.tree, printTypes = true)) println(showRaw(tree2.tree, printTypes = tr...
yusuke2255/dotty
tests/disabled/macro/run/showraw_tree_types_untyped.scala
Scala
bsd-3-clause
327
/* * 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 ...
h2oai/sparkling-water
core/src/main/scala/org/apache/spark/h2o/ui/CrossSparkUtils.scala
Scala
apache-2.0
1,229
package mr.merc.economics import mr.merc.economics.Culture.CultureAlignment.ColorAlignment import mr.merc.economics.PopulationType.{Clergy, Scholars} import mr.merc.economics.Products.Product import mr.merc.economics.RegionPopulation.Rebellion import mr.merc.economics.WorldConstants.Enterprises.{WorkersDistributionEqu...
RenualdMarch/merc
src/main/scala/mr/merc/economics/RegionPopulation.scala
Scala
gpl-3.0
8,207
package codechicken.microblock import codechicken.lib.vec.Cuboid6 import codechicken.lib.vec.Scale import codechicken.lib.vec.Vector3 import codechicken.lib.vec.TransformationList import codechicken.lib.vec.AxisCycle import codechicken.lib.vec.Rotation import Vector3._ import Rotation._ import codechicken.multipart.TM...
Chicken-Bones/ForgeMultipart
src/codechicken/microblock/EdgeMicroblock.scala
Scala
lgpl-2.1
6,796
import com.typesafe.scalalogging.LazyLogging import controllers.{Assets, DemoProxyController, SitemapController} import javax.inject.Inject import play.api.OptionalDevContext import play.api.http.{DefaultHttpRequestHandler, HttpConfiguration, HttpErrorHandler, HttpFilters} import play.api.mvc.{Handler, InjectedControll...
scalableminds/webknossos
app/RequestHandler.scala
Scala
agpl-3.0
2,008
/** * Copyright 2014 Andrea Esposito <and1989@gmail.com> * * 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...
roy20021/ONJAG
src/it/unipi/thesis/andrea/esposito/onjag/protocols/KCorenessProtocol.scala
Scala
apache-2.0
5,905
import org.junit.runner.RunWith import org.scalatest._ import org.scalatest.junit.JUnitRunner import scala.collection.mutable @RunWith(classOf[JUnitRunner]) class Test extends FlatSpec with Matchers { "A Stack" should "pop values in last-in-first-out order" in { val stack = new mutable.Stack[Int] stack.pus...
jorgeacf/smart-data
src/test/scala/Test.scala
Scala
gpl-3.0
615
package org.vertx.scala.tests.router import org.vertx.scala.router.{RouterException, Router} import org.vertx.scala.core.http.{HttpServer, HttpServerRequest} import org.vertx.scala.core.FunctionConverters._ import org.vertx.scala.router.routing._ import org.vertx.scala.platform.Verticle import scala.concurrent.Promise...
galderz/mod-lang-scala
src/test/scala/org/vertx/scala/tests/router/JsonRouter.scala
Scala
apache-2.0
1,646
package app import org.scalatra.servlet.ScalatraAsyncSupport import service._ import util.{StringUtil, UsersAuthenticator, Keys} import util.Implicits._ import service.IssuesService.IssueSearchCondition class DashboardController extends DashboardControllerBase with IssuesService with PullRequestService with Reposit...
mqshen/gitbucket
src/main/scala/app/DashboardController.scala
Scala
apache-2.0
5,433
package models import java.io.File import scala.io.Source import play.api.Play import play.api.libs.json._ object TranslationData { lazy val translations = load() val dataPath = Play.current.configuration.getString("charactersheets.pdf.path").getOrElse("public/pdf/")+"data/" def apply(language: String) = trans...
dyslexic-charactersheets/website
app/models/translation.scala
Scala
apache-2.0
1,986
package de.tu_berlin.formic.gatling.experiment.json import de.tu_berlin.formic.datastructure.json.JsonPath import de.tu_berlin.formic.datastructure.json.client.FormicJsonObject import de.tu_berlin.formic.datastructure.json.JsonTreeNode import de.tu_berlin.formic.gatling.Predef._ import de.tu_berlin.formic.gatling.acti...
rbraeunlich/formic
formic-gatling/src/test/scala/de/tu_berlin/formic/gatling/experiment/json/JsonDeleteSimulation.scala
Scala
apache-2.0
3,679
/* * 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/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/JoinReorderSuite.scala
Scala
apache-2.0
12,045
package org.workcraft.gui.modeleditor.tools import org.workcraft.dependencymanager.advanced.user.Variable import org.workcraft.gui.modeleditor.HotkeyBinding import org.workcraft.scala.Expressions.convertModifiableExpression import org.workcraft.scala.Expressions.monadicSyntaxV import org.workcraft.scala.Expressions.Ex...
mechkg/workcraft
Gui/src/main/scala/org/workcraft/gui/modeleditor/tools/Toolbox.scala
Scala
gpl-3.0
6,038
package com.karasiq.shadowcloud.config import com.karasiq.common.configs.ConfigImplicits import com.karasiq.shadowcloud.utils.ProviderInstantiator import com.typesafe.config.{Config, ConfigObject, ConfigValueType} import scala.collection.JavaConverters._ private[shadowcloud] case class ProvidersConfig[T](rootConfig:...
Karasiq/shadowcloud
core/src/main/scala/com/karasiq/shadowcloud/config/ProvidersConfig.scala
Scala
apache-2.0
1,232
/******************************************************************************* * (C) Copyright 2015 ADP, LLC. * * 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....
adplabs/unicorn
json/src/main/scala/unicorn/json/BaseJsonSerializer.scala
Scala
apache-2.0
6,808
/* * 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 in writing, software * distrib...
fusepoolP3/p3-silk
silk-workspace/src/main/scala/de/fuberlin/wiwiss/silk/workspace/LDEProject.scala
Scala
apache-2.0
8,190
/* * 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 ...
jeremiaswerner/openwhisk
core/standalone/src/main/scala/org/apache/openwhisk/standalone/ServiceInfoLogger.scala
Scala
apache-2.0
1,691
package mesosphere.marathon.integration.setup import java.io.File import java.util import mesosphere.marathon.health.HealthCheck import mesosphere.marathon.integration.facades.{ ITDeploymentResult, ITEnrichedTask, MarathonFacade, MesosFacade } import mesosphere.marathon.state.{ AppDefinition, Container, DockerVolume,...
yp-engineering/marathon
src/test/scala/mesosphere/marathon/integration/setup/SingleMarathonIntegrationTest.scala
Scala
apache-2.0
13,797
class O[T](z: T) { def xavava: T = z } 1 match { case z : O[Boolean] => { import z._ /*start*/xavava/*end*/ } } //Boolean
ilinum/intellij-scala
testdata/typeInference/statements/ImportedParameterizedType.scala
Scala
apache-2.0
137
/* * 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 ...
michalsenkyr/spark
mllib/src/test/scala/org/apache/spark/ml/source/image/ImageFileFormatSuite.scala
Scala
apache-2.0
5,164
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs // Licence: http://www.gnu.org/licenses/gpl-3.0.en.html package org.ensime.sexp import org.scalacheck.Arbitrary import org.scalacheck.Gen import org.scalatest.prop.GeneratorDrivenPropertyChecks import org.ensime.util.EnsimeSpec class SexpParserC...
d1egoaz/ensime-sbt
src/sbt-test/sbt-ensime/ensime-server/s-express/src/test/scala/org/ensime/sexp/SexpParserCheck.scala
Scala
apache-2.0
2,241
/* * Copyright 2013 - 2020 Outworkers Ltd. * * 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...
outworkers/phantom
phantom-dsl/src/test/scala/com/outworkers/phantom/builder/query/QueryOptionsTest.scala
Scala
apache-2.0
2,619
package models.db import models.join.RemodelWithName import scalikejdbc._ import com.ponkotuy.data import scala.util.Try case class Remodel( id: Long, memberId: Long, flag: Boolean, beforeItemId: Int, afterItemId: Int, vocieId: Int, useSlotIds: String, certain: Boolean, beforeItemLevel: Int, firs...
ttdoda/MyFleetGirls
server/app/models/db/Remodel.scala
Scala
mit
6,891
package im.actor.server.util import im.actor.server.util.StringUtils.validNickName import org.scalatest.{ Matchers, FlatSpecLike } class StringUtilsSpec extends FlatSpecLike with Matchers { "validNickName" should "validate nicknames" in e1 def e1() = { validNickName("rockjam") shouldEqual true validNick...
nguyenhongson03/actor-platform
actor-server/actor-tests/src/test/scala/im/actor/server/util/StringUtilsSpec.scala
Scala
mit
747
/* * 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/test/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC138Spec.scala
Scala
apache-2.0
1,003
package ee.cone.c4external import java.net.CacheResponse import com.squareup.wire.ProtoAdapter import com.typesafe.scalalogging.LazyLogging import ee.cone.c4actor.Types.NextOffset import ee.cone.c4actor._ import ee.cone.c4external.ExternalProtocol.S_ExternalUpdate import ee.cone.c4proto.HasId import ee.cone.dbadapter...
wregs/c4proto
c4external-base/src/main/scala/ee/cone/c4external/ExtDBSyncImpl.scala
Scala
apache-2.0
2,697
var menor = 11.0 var calificacion = 0.0 for (i <- 1 to 40) { println ("Ingresa tu calificacion: ") calificacion = readFloat () if (calificacion < menor ) { menor = calificacion } } println ("La calificacion menor obtenida es: " + menor)
diana170309/poo1-1
Calificaciones.2.scala
Scala
mit
245
object Module: class Bar class Baz class Qux object Givens: given GivenBar: Bar = new Bar() def GivenBar(ignored: Int): Bar = new Bar() class GivenBar object Members: given Member: Baz = new Baz() private def Member(ignored1: String)(ignored2: Int): Bar = new Bar() def Member(ignore...
dotty-staging/dotty
tests/neg/i10857.scala
Scala
apache-2.0
1,392
/* * Copyright 2001-2011 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/test/scala/org/scalatest/SuitesSpec.scala
Scala
apache-2.0
4,621
/* * The MIT License (MIT) * * Copyright (c) 2016 Ian McIntosh * * 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 to * use,...
cranst0n/f3
modules/semantic-ui/src/main/scala/semanticui/js/Semantic.scala
Scala
mit
1,534
/* * Copyright (c) 2014-2018 by The Monix Project Developers. * See the project homepage at: https://monix.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...
Wogan/monix
monix-reactive/shared/src/main/scala/monix/reactive/observers/SafeSubscriber.scala
Scala
apache-2.0
3,412
/** * Copyright (c) Lambda Innovation, 2013-2016 * This file is part of LambdaLib modding library. * https://github.com/LambdaInnovation/LambdaLib * Licensed under MIT, see project root for more information. */ package cn.lambdalib.test import java.awt.Font import cn.lambdalib.annoreg.core.Registrant import cn.lambda...
LambdaInnovation/LambdaLib
src/test/scala/cn/lambdalib/test/MarkdownRendererTest.scala
Scala
mit
2,617
/* * Copyright 2017 PayPal * * 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 in writin...
anilgursel/squbs
squbs-unicomplex/src/test/scala/org/squbs/unicomplex/JavaRootSvcSpec.scala
Scala
apache-2.0
2,506
/** * 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...
ollie314/kafka
core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
Scala
apache-2.0
21,625
/* * 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 ...
debugger87/spark
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
Scala
apache-2.0
88,290
package dog import scalaz._ object AssertionResultTest extends Dog with Assert { val skipAssertionResult = { def f: Int = throw new Exception("skip test") val expected = TestResult.nel(-\\/(Skipped("skip")), IList.empty[AssertionResult[Int]]) val actual = TestCaseTest.run(pass(f).skip("skip")) equa...
scala-kennel/dog
dog/src/test/scala/dog/AssertionResultTest.scala
Scala
mit
345
package edu.mit.cryptdb import java.sql._ import java.io._ import scala.collection.mutable.{ ArrayBuffer, HashSet } object Conversions { implicit def rsWrap(rs: ResultSet) = new ResultSetWrapper(rs) } class ResultSetWrapper(rs: ResultSet) { // requires the results to fit in memory def map[A](f: ResultSet => A)...
tristartom/monomi-optimizer
src/main/scala/util.scala
Scala
mit
5,173
package com.flowy.fomoapi.slick import com.flowy.common.slick.MyPostgresDriver object Config{ val jdbcDriver = "org.postgresql.Driver" val slickProfile = MyPostgresDriver }
asciiu/fomo
api/src/main/scala/com/flowy/fomoapi/slick/Config.scala
Scala
apache-2.0
181
/* Copyright 2017 Christopher Boucher * * 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...
CoolName1993/practice-project
app/controllers/FrontendController.scala
Scala
apache-2.0
809
/* * 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/test/scala/uk/gov/hmrc/ct/computations/CPQ18Spec.scala
Scala
apache-2.0
11,815
package io.continuum.bokeh package sampledata object Sprint extends CSVSampleData { def load(): SprintData = { val List(name, country, medal, time, year) = loadRows("sprint.csv").transpose SprintData(name, country, medal.map(Medal.fromString), time.map(_.toDouble), year.map(_.toInt)) } } seale...
bokeh/bokeh-scala
sampledata/src/main/scala/Sprint.scala
Scala
mit
647
object Foo: case object Boo var x: Foo.Booo = Foo.Booo // error // error object Main: def main(args: Array[String]) = type t = Option[Foo.Boo] // error
dotty-staging/dotty
tests/neg/i13320.scala
Scala
apache-2.0
162
/* * ScalaCL - putting Scala on the GPU with JavaCL / OpenCL * http://scalacl.googlecode.com/ * * Copyright (c) 2009-2013, Olivier Chafik (http://ochafik.com/) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following ...
nativelibs4java/ScalaCL
src/test/scala/scalacl/KernelTest.scala
Scala
bsd-3-clause
3,877
/* * 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/events/NameInfo.scala
Scala
apache-2.0
4,849
package com.rysh.experiment.util import java.time.Duration object DateTimeUtil { def formatDuration(duration: Duration) = { import java.time.format.DateTimeFormatter import java.time.LocalTime val t = LocalTime.MIDNIGHT.plus(duration) DateTimeFormatter.ofPattern("HH:mm:ss").format(t) } }
rysh/scalatrader
info/open/src/main/scala/com/rysh/experiment/util/DateTimeUtil.scala
Scala
mit
312
class A(x: Int)(y: String = "hi") object Test { def f() = 22 class B extends A(f())() }
som-snytt/dotty
tests/pos/default-super.scala
Scala
apache-2.0
94
package lila.coach case class RichPov( pov: lila.game.Pov, initialFen: Option[String], analysis: Option[lila.analyse.Analysis], division: chess.Division, accuracy: Option[lila.analyse.Accuracy.DividedAccuracy], moveAccuracy: Option[List[Int]]) case class NbSum(nb: Int, sum: Int) { def avg = (nb > 0) op...
r0k3/lila
modules/coach/src/main/model.scala
Scala
mit
479
// scalastyle:off multiple.string.literals package org.wquery.emitter import org.wquery.lang.{Answer, Error, Result} import org.wquery.model._ class RawWQueryEmitter extends WQueryEmitter { def emit(result: Result):String = { result match { case Answer(wordNet, dataSet) => emitDataSet(wordNet, da...
marekkubis/wquery
src/main/scala/org/wquery/emitter/RawWQueryEmitter.scala
Scala
bsd-3-clause
2,160
/** * */ package ga import scala.util.Random import akka.actor.Actor import akka.actor.actorRef2Scala import ga._ /** * @author kalman * */ class Generator(val population: Population) extends Actor { val random = new Random override def preRestart(reason: Throwable, message: Option[Any]) = { message m...
enpassant/population
src/main/scala/ga/Generator.scala
Scala
bsd-3-clause
1,692
package com.goticks import scala.concurrent.Future import akka.actor._ import akka.util.Timeout object BoxOffice { def props(implicit timeout: Timeout) = Props(new BoxOffice) def name = "boxOffice" case class CreateEvent(name: String, tickets: Int) case class GetEvent(name: String) case object GetEvents ...
RayRoestenburg/akka-in-action
chapter-up-and-running/src/main/scala/com/goticks/BoxOffice.scala
Scala
mit
2,317
import org.scalatest.FunSuiteLike import org.scalatest.Matchers import org.scalatra.test.scalatest.ScalatraSuite class HelloWorldServletSuite extends ScalatraSuite with FunSuiteLike with Matchers { addServlet(classOf[HelloWorldServlet], "/*") test("get /") { get(uri = "/") { status shouldBe...
earldouglas/xsbt-web-plugin
src/sbt-test/examples/scalatra/src/test/scala/HelloWorldServletSuite.scala
Scala
bsd-3-clause
591
/** * */ package addressbook import scala.collection.mutable.ArrayBuffer import java.io.File import scala.io.Source /** * @author Hariharan * */ class AddressBook { private val people: ArrayBuffer[Person] = ArrayBuffer() def add(p: Person) = people += p def size: Int = people.si...
hariharank12/address-book
src/addressbook/AddressBook.scala
Scala
apache-2.0
825
package net.ettinsmoor abstract class ContentType case class ImageJPEG() extends ContentType case class ImagePNG() extends ContentType case class ImageGIF() extends ContentType object ContentType { def isGIF(ct_str: String) = ct_str.matches("^image/(animated)?gif$") def isJPEG(ct_str: String) = ct_str.matches("^i...
dbarowy/bingerator
src/main/scala/net/ettinsmoor/ContentType.scala
Scala
bsd-2-clause
643
package downstream import japgolly.scalajs.react._ import japgolly.scalajs.react.extra._ import scala.scalajs.js.annotation._ @JSExportTopLevel("EXPORTS") object Exports { @JSExport def exp = List[Any]( Routed.Component, pxToCallback, ) private def pxToCallback: CallbackTo[Int] = { val x = Px.co...
japgolly/scalajs-react
downstream-tests/js-cbio/src/main/scala/downstream/Exports.scala
Scala
apache-2.0
358
package com.lyrx.latex import com.lyrx.text.{GenBase, StringGenerator} /** * Created by alex on 17.10.16. */ trait ConvertForTeX extends LaTeX{ def convertForTex(in: String): String = { val b: StringBuffer = new StringBuffer() in.foreach((aChar: Char) => { val cs: String = aChar.toString(); ...
lyrx/lyrxgenerator
src/main/scala/com/lyrx/latex/ConvertForTeX.scala
Scala
gpl-3.0
4,583
/* * Copyright (c) 2014-2020 by The Monix Project Developers. * See the project homepage at: https://monix.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...
alexandru/monifu
benchmarks/vnext/src/main/scala/monix/benchmarks/TaskShiftBenchmark.scala
Scala
apache-2.0
4,201
package com.intel.ie.evaluation.preparation.label import com.intel.ie.analytics.IOUtils /** * usage: copy the relevant lines to console, applicable when there is a "," after person name * Created by xianyan on 8/5/16. */ object LabelHelper { val titles = List( // "Chairman of the Board", "\\w+ Vice Pr...
intel-analytics/InformationExtraction
src/main/scala/com/intel/ie/evaluation/preparation/label/LabelHelper.scala
Scala
gpl-3.0
1,767
package com.arcusys.learn.service.util import javax.portlet.PortletRequest import javax.servlet.ServletRequest import com.liferay.portal.util.PortalUtil object UrlHelper { def getURLFromRequest[T](prefix:String, request: T): String = request match { case r: PortletRequest => PortalUtil.getPortalURL(r.getServer...
ViLPy/Valamis
learn-portlet/src/main/scala/com/arcusys/learn/service/util/UrlHelper.scala
Scala
lgpl-3.0
642
package org.apache.mesos.chronos.scheduler.mesos import java.util.logging.Logger import javax.inject.Inject import org.apache.mesos.chronos.scheduler.config.SchedulerConfiguration import org.apache.mesos.chronos.scheduler.jobs.{TaskUtils, EnvironmentVariable, Fetch, BaseJob} import com.google.common.base.Charsets im...
hamo/chronos
src/main/scala/org/apache/mesos/chronos/scheduler/mesos/MesosTaskBuilder.scala
Scala
apache-2.0
7,920
/* * 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...
jenniew/BigDL
spark/dl/src/test/scala/com/intel/analytics/bigdl/utils/tf/loaders/LogSoftmaxSpec.scala
Scala
apache-2.0
865
package edu.gemini.spModel.dataset import scalaz._ object Implicits { implicit val EqualDatasetLabel: Equal[DatasetLabel] = Equal.equalA implicit val EqualDatasetQaState: Equal[DatasetQaState] = Equal.equalA }
arturog8m/ocs
bundle/edu.gemini.pot/src/main/scala/edu/gemini/spModel/dataset/Implicits.scala
Scala
bsd-3-clause
222
/** * 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...
wangcy6/storm_app
frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/test/scala/unit/kafka/server/CreateTopicsRequestTest.scala
Scala
apache-2.0
10,424
package de.tudresden.inf.lat.tabulas /** Tabulas * design of extensions */ package object extension { }
julianmendez/tabulas
tabulas-core/src/main/scala/de/tudresden/inf/lat/tabulas/extension/package.scala
Scala
apache-2.0
109
package io.github.jfrazee.nifi.processors.aws.kinesis import java.io._ import java.nio.ByteBuffer // NiFi import org.apache.nifi.flowfile.FlowFile import org.apache.nifi.processor.{ ProcessContext, ProcessSession } import org.apache.nifi.processors.aws.AbstractAWSProcessor import org.apache.nifi.annotation.documentat...
jfrazee/nifi-kinesis
src/main/scala/io/github/jfrazee/nifi/processors/aws/kinesis/PutKinesisRecord.scala
Scala
apache-2.0
1,812
/* * Copyright (c) 2016. <jason.zou@gmail.com> * * Tag.scala is part of marc4scala. * * marc4scala 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 you...
jasonzou/marc4scala
src/main/scala/org/marc4scala/Tag.scala
Scala
gpl-3.0
1,583
/* * 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/main/scala/org/scalatest/Filter.scala
Scala
apache-2.0
15,368
// Copyright (C) 2014 Open Data ("Open Data" refers to // one or more of the following companies: Open Data Partners LLC, // Open Data Research LLC, or Open Data Capital LLC.) // // This file is part of Hadrian. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in ...
opendatagroup/hadrian
hadrian/src/test/scala/data.scala
Scala
apache-2.0
29,791
package scoverage import java.io.{File, FileNotFoundException} import java.net.URL import scala.collection.mutable.ListBuffer import scala.tools.nsc.{Settings, Global} import scala.tools.nsc.plugins.PluginComponent import scala.tools.nsc.transform.{Transform, TypingTransformers} /** @author Stephen Samuel */ object ...
rorygraves/scalac-scoverage-plugin
scalac-scoverage-plugin/src/test/scala/scoverage/ScoverageCompiler.scala
Scala
apache-2.0
7,418
package at.logic.gapt.provers.metis import at.logic.gapt.expr._ import at.logic.gapt.expr.fol.{ naive, thresholds } import at.logic.gapt.proofs.{ Clause, HOLSequent, Sequent, SequentMatchers } import at.logic.gapt.utils.SatMatchers import org.specs2.mutable._ class MetisTest extends Specification with SequentMatchers...
gebner/gapt
tests/src/test/scala/at/logic/gapt/provers/metis/MetisTest.scala
Scala
gpl-3.0
1,964
package name.denyago.yasc.config import com.typesafe.config.{Config, ConfigFactory} /** * Returns config objects for different parts of the server */ object Factory { def httpServiceConf: HttpServiceConf = { val hscPath = conf.getConfig("yasc.server.http") new HttpServiceConf( host = hscPath.getS...
denyago/yet-another-simple-chat
src/main/scala/name/denyago/yasc/config/Factory.scala
Scala
mit
434
/* Copyright 2009-2018 EPFL, Lausanne */ package inox package utils trait Cache[A,B] { def get(key: A): Option[B] def update(key: A, value: B): Unit def clear(): Unit def cached(key: A, body: => B): B = get(key) match { case Some(res) => res case None => val res = body update(key, res) ...
romac/inox
src/main/scala/inox/utils/Caches.scala
Scala
apache-2.0
1,361
/* * 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...
rahulkavale/scalatest
scalactic-test/src/test/scala/org/scalactic/PrettyMethodsSpec.scala
Scala
apache-2.0
1,867
/* * Copyright 2015 eleflow.com.br. * * 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 ...
eleflow/uberdata
iuberdata_core/src/main/scala/eleflow/uberdata/data/stat/Statistics.scala
Scala
apache-2.0
5,235
/* 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 use this f...
transcendent-ai-labs/DynaML
dynaml-core/src/main/scala/io/github/mandar2812/dynaml/optimization/ConjugateGradientSpark.scala
Scala
apache-2.0
4,055
package org.eligosource.eventsourced.journal.common import akka.actor.{ActorRef, Actor} import org.eligosource.eventsourced.core.JournalProtocol.ReadCommand class ReadOnlyFacade(journal: ActorRef) extends Actor { def receive = { case cmd: ReadCommand => journal forward cmd case msg => //noop } }
CoderPaulK/eventsourced
es-journal/es-journal-common/src/main/scala/org/eligosource/eventsourced/journal/common/ReadOnlyFacade.scala
Scala
apache-2.0
311
package biz.jackman.brewmaster /** Predef for brewmaster, maybe package objects will obsolete this */ private[brewmaster] object Prelude { implicit def any2GetAnyClass(x : Any) = new GetAnyClass(x) class GetAnyClass(val x : Any) { def getAnyClass = x.asInstanceOf[AnyRef].getClass } }
benjaminjackman/brewmaster
brewmaster-core/src/main/scala/biz/jackman/brewmaster/Prelude.scala
Scala
gpl-3.0
296
/* * 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 appli...
sgoeschl/gatling-blueprint-project
src/test/scala/computerdatabase/BasicSimulation.scala
Scala
apache-2.0
2,669
package com.twitter.concurrent import com.twitter.util.Awaitable.CanAwait import java.lang.management.ManagementFactory import java.util.ArrayDeque import java.util.concurrent._ import java.util.concurrent.atomic.AtomicInteger import scala.collection.mutable /** * An interface for scheduling [[java.lang.Runnable]] t...
cogitate/twitter-util-uuid
util-core/src/main/scala/com/twitter/concurrent/Scheduler.scala
Scala
apache-2.0
9,355
package com.sksamuel.elastic4s import com.sksamuel.elastic4s.ElasticDsl._ import org.scalatest.{WordSpec, Matchers} import com.sksamuel.elastic4s.testkit.ElasticSugar class ScrollTest extends WordSpec with Matchers with ElasticSugar { client.execute { bulk( index into "katebush/songs" fields("name" -> "h...
tototoshi/elastic4s
elastic4s-core-tests/src/test/scala/com/sksamuel/elastic4s/ScrollTest.scala
Scala
apache-2.0
2,011
package models.daos import models.gift.Notification import models.user.User import scala.concurrent.Future /** * Give access to the notification object. */ trait NotificationDAO { def hasNotification(user: User, category: Notification.Category, objectid: Long): Future[Boolean] def delete(user: Us...
epot/Gifter
app/models/daos/NotificationDAO.scala
Scala
mit
377
/** * Copyright (C) 2015 Stratio (http://stratio.com) * * 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 ap...
pmadrigal/spark-mongodb
spark-mongodb/src/main/scala/com/stratio/datasource/mongodb/schema/MongodbSchema.scala
Scala
apache-2.0
5,044
package com.twitter.finagle import com.twitter.conversions.time._ import com.twitter.finagle.service.Backoff import com.twitter.finagle.stats.InMemoryStatsReceiver import com.twitter.util.{Await, Future, MockTimer, Time} import java.net.{UnknownHostException, InetAddress} import org.junit.runner.RunWith import org.sca...
koshelev/finagle
finagle-core/src/test/scala/com/twitter/finagle/FixedInetResolverTest.scala
Scala
apache-2.0
6,144
package io.github.vigoo import io.github.vigoo.simpp._ import io.github.vigoo.simpp.PrettyPrint._ import cats.instances.string._ import org.atnos.eff._ import org.atnos.eff.syntax.all._ import org.specs2._ import org.specs2.matcher.Matcher trait PrettyPrinterTests[AdditionalFx, PP <: PrettyPrint[AdditionalFx]] { th...
vigoo/barlang
src/test/scala/io/github/vigoo/PrettyPrinterTests.scala
Scala
apache-2.0
932
package io.hydrosphere.mist.master.interfaces.cli /** * Table data representation for pretty-printing cli command results */ case class ConsoleTable( headers: Seq[String], rows: Seq[Row]) { def prettyPrint: String = { def printBorder(sizes: Seq[Int]): String = { "+" + sizes.map(i => "-" * i + "+")...
KineticCookie/mist
src/main/scala/io/hydrosphere/mist/master/interfaces/cli/ConsoleTable.scala
Scala
apache-2.0
1,075
import nozzle.server._ import nozzle.server.LoggingSupport._ import nozzle.modules.LoggingSupport._ import scala.concurrent.ExecutionContext object Example extends App { implicit val logging = nozzle.logging.BasicLogging() implicit val globalExecutionContext: ExecutionContext = ExecutionContext.global imp...
buildo/nozzle
example/src/main/scala/App.scala
Scala
mit
725
package actors import actors.PartitionedPortStateActor.{GetStateForDateRange, PointInTimeQuery} import akka.actor.{Actor, ActorRef, Props} import akka.testkit.TestProbe import drt.shared.Queues.Queue import drt.shared.SDateLike import drt.shared.Terminals.Terminal import services.SDate import services.crunch.CrunchTes...
UKHomeOffice/drt-scalajs-spa-exploration
server/src/test/scala/actors/PartitionedPortStateActorSpec.scala
Scala
apache-2.0
3,143