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 API ** ** / __/ __// _ | / / / _ | (c) 2005-2010, LAMP/EPFL ** ** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\\___/_/...
cran/rkafkajars
java/scala/actors/remote/RemoteActor.scala
Scala
apache-2.0
3,738
package com.github.vonnagy.service.container.health import akka.actor._ import akka.testkit.TestActorRef import com.github.vonnagy.service.container.AkkaTestkitSpecs2Support import org.specs2.mutable.SpecificationLike import scala.concurrent.duration._ import scala.concurrent.{Await, Future} class RegisteredHealthCh...
vonnagy/service-container
service-container/src/test/scala/com/github/vonnagy/service/container/health/RegisteredHealthCheckActorSpec.scala
Scala
apache-2.0
1,418
package demo package pages import chandu0101.scalajs.react.components.mixins.AsyncLoad import demo.components.LeftNavPage import demo.routes.{LeftRoute, SpinnerRouteModule} import japgolly.scalajs.react.extra.router2.RouterCtl import japgolly.scalajs.react.{BackendScope, ReactComponentB} object SpinnerPage { class...
tpdi/scalajs-react-components
demo/src/main/scala/demo/pages/SpinnerPage.scala
Scala
apache-2.0
882
package com.sammyrulez.ocs.api import org.scalatra._ import scalate.ScalateSupport class MyServlet extends ScalatraServlet with ScalateSupport { get("/") { <html> <body> <h1>Hello, world!</h1> Say <a href="hello-scalate">hello to Scalate</a>. </body> </html> } }
sammyrulez/octo-crypto-samurai
src/main/scala/com/sammyrulez/ocs/api/MyServlet.scala
Scala
mit
305
package org.http4s.ember.server.internal import fs2._ import fs2.concurrent._ import fs2.io.tcp._ import cats.effect._ import cats.implicits._ import scala.concurrent.duration._ import java.net.InetSocketAddress import org.http4s._ import _root_.org.http4s.ember.core.{Encoder, Parser} import _root_.org.http4s.ember.co...
ChristopherDavenport/http4s
ember-server/src/main/scala/org/http4s/ember/server/internal/ServerHelpers.scala
Scala
apache-2.0
3,761
/** * Generated by Scrooge * version: 4.7.0 * rev: d9d56174937f524a1981b38ebd6280eef7eeda4a * built at: 20160427-121531 */ package com.komanov.serialization.domain.thriftscala import com.twitter.scrooge.{ LazyTProtocol, TFieldBlob, ThriftException, ThriftStruct, ThriftStructCodec3, ThriftStructFieldInfo...
dkomanov/scala-serialization
scala-serialization/src/main/scala/com/komanov/serialization/domain/thriftscala/DomainEntryPointAddedPb.scala
Scala
mit
13,673
import de.tototec.sbuild._ @version("0.7.0") @classpath("target/org.sbuild.plugins.adept-0.0.9000.jar") class Test(implicit _project: Project) { import org.sbuild.plugins.adept._ Plugin[Adept] }
lefou/sbuild-adept
org.sbuild.plugins.adept/Test.scala
Scala
apache-2.0
202
package coursier.cli.options import caseapp.{ExtraName => Short, HelpMessage => Help, ValueDescription => Value, _} // format: off final case class DependencyOptions( @Help("Exclude module") @Value("organization:name") @Short("E") @Help("Global level exclude") exclude: List[String] = Nil, @Short("x") ...
alexarchambault/coursier
modules/cli/src/main/scala/coursier/cli/options/DependencyOptions.scala
Scala
apache-2.0
1,400
package im.actor.config import java.nio.file.{ Path, Paths } import java.util.concurrent.TimeUnit import akka.actor.ActorSystem import com.typesafe.config.{ Config, ConfigException, ConfigFactory } import scala.collection.JavaConversions._ import scala.concurrent.duration._ import scala.util.{ Failure, Success, Try ...
ljshj/actor-platform
actor-server/actor-runtime/src/main/scala/im/actor/config/ActorConfig.scala
Scala
mit
2,588
package no.nr.edvard.convergence import models.{JavaTypeName, JavaElement, JavaType, JavaPackage} import scala.math._ import processing.core._ import collection.mutable class Renderer( name: String, stopFn: () => Unit, classMap: Map[JavaTypeName, JavaType], packageRoot: JavaPackage, width: Int = 1200, hei...
edwkar/edwbsc
projects/Osiris/src/main/scala/no/nr/edvard/convergence/Renderer.scala
Scala
gpl-2.0
4,455
// object Test { // val x: Int => Int = identity // } trait Foo[F[_], I[X] <: X] { type Id[X] <: X def foo[G[x] >: F[x]]: G[Unit] def foo2[X >: F[String]]: Id[X] def foo3[X >: F[String]]: I[X] } trait M[A] { def bla: Int = 1 def baz(f: Int => Int): Int = f(1) } object Test { def bar(x: Foo[M, [X] =>>...
dotty-staging/dotty
tests/pos/i9567.scala
Scala
apache-2.0
407
package lila.pref import play.api.libs.json._ import lila.db.JsTube import lila.db.JsTube.Helpers._ import lila.user.User case class Pref( _id: String, // user id dark: Boolean, transp: Boolean, bgImg: Option[String], is3d: Boolean, theme: String, pieceSet: String, theme3d: String, ...
terokinnunen/lila
modules/pref/src/main/Pref.scala
Scala
mit
7,770
package com.twitter.finagle.postgresql import com.twitter.finagle.postgresql.BackendMessage.CommandTag import com.twitter.io.Buf import com.twitter.io.Reader import com.twitter.util.Await class RichClientSpec extends PgSqlIntegrationSpec { "Rich client" should { "support multi-line queries" in withRichClient(...
twitter/finagle
finagle-postgresql/src/it/scala/com/twitter/finagle/postgresql/RichClientSpec.scala
Scala
apache-2.0
2,927
package org.qbproject.schema.internal.json import play.api.libs.json.{JsNumber, JsString, JsValue} /** * Convenience partial functions that may be passed into the map function of a type mapper. */ trait JsValueUpdateOps { val trim: PartialFunction[JsValue, JsValue] = { case JsString(s) => JsString(s.trim) ...
edgarmueller/qbproject
qbschema/src/main/scala/org/qbproject/schema/internal/json/JsValueUpdateOps.scala
Scala
apache-2.0
646
import sbt._ import sbt.Keys._ import sbt.{ThisBuild, Project} object SbtScalaParseBuild extends Build { val repoKind = SettingKey[String]("repo-kind", "Maven repository kind (\\"snapshots\\" or \\"releases\\")") val projectName = "sbt-scalaparse" val sbtScalariform: Project = Project( projectName, file(...
cvogt/sbt-scalaparse
project/Build.scala
Scala
bsd-2-clause
2,334
package com.twitter.scalding.reducer_estimation import com.twitter.scalding._ import com.twitter.scalding.platform.{ HadoopPlatformJobTest, HadoopSharedPlatformTest } import org.scalatest.{ Matchers, WordSpec } import scala.collection.JavaConverters._ import scala.util.{ Failure, Success, Try } class SimpleJobWithNoS...
tglstory/scalding
scalding-hadoop-test/src/test/scala/com/twitter/scalding/reducer_estimation/RatioBasedEstimatorTest.scala
Scala
apache-2.0
8,543
package extracells.render.block import cpw.mods.fml.client.registry.{ISimpleBlockRenderingHandler, RenderingRegistry} import extracells.tileentity.TileEntityHardMeDrive import net.minecraft.block.Block import net.minecraft.client.Minecraft import net.minecraft.client.renderer.texture.TextureMap import net.minecraft.c...
AmethystAir/ExtraCells2
src/main/scala/extracells/render/block/RendererHardMEDrive.scala
Scala
mit
10,837
package bignum.benchmark import com.google.caliper.Param import com.google.caliper.{Runner => CaliperRunner} import bignum.BigInt2 import annotation.tailrec object DivideBenchmark { def main(args: Array[String]) { CaliperRunner.main(classOf[DivideBenchmark], args: _*) } } class DivideBenchmark extends Simpl...
techaddict/bignum
benchmark/src/main/scala/benchmark/Division.scala
Scala
mit
1,735
package org.ausdigital.apecconnect.common.model trait ApecConnectEnumEntry { def value: Int def name: String }
TeamAusDigital/apec-connect
server/modules/common/src/main/scala/org/ausdigital/apecconnect/common/model/ApecConnectEnumEntry.scala
Scala
apache-2.0
116
package org.jetbrains.plugins.scala.codeInspection.typeChecking import com.intellij.codeInspection.{InspectionManager, LocalQuickFix, ProblemDescriptor, ProblemHighlightType} import com.intellij.psi.PsiElement import org.jetbrains.plugins.scala.codeInspection.{AbstractRegisteredInspection, ScalaInspectionBundle} clas...
JetBrains/intellij-scala
scala/scala-impl/src/org/jetbrains/plugins/scala/codeInspection/typeChecking/IsInstanceOfInspection.scala
Scala
apache-2.0
937
package ru.freefry.furniture_factory.core import akka.actor.ActorSystem import akka.util.Timeout import com.typesafe.config.{Config, ConfigFactory} /** * Core trait containing member `system: ActorSystem`. * @author freefry */ trait Core { implicit def system: ActorSystem implicit def timeout: Time...
freefry/furniture-factory
src/main/scala/ru/freefry/furniture_factory/core/core.scala
Scala
apache-2.0
1,072
package ch.ninecode.model import com.esotericsoftware.kryo.Kryo import com.esotericsoftware.kryo.Serializer import com.esotericsoftware.kryo.io.Input import com.esotericsoftware.kryo.io.Output import org.apache.spark.sql.Row import ch.ninecode.cim.CIMClassInfo import ch.ninecode.cim.CIMContext import ch.ninecode.cim....
derrickoswald/CIMScala
CIMReader/src/main/scala/ch/ninecode/model/VoltageCompensatorDynamics.scala
Scala
mit
25,641
package org.bitcoins.core.script import org.bitcoins.core.crypto._ import org.bitcoins.core.script.constant._ import org.bitcoins.core.script.control.{OP_ELSE, OP_ENDIF, OP_IF, OP_NOTIF} import org.bitcoins.core.script.flag.ScriptFlag import org.bitcoins.core.script.result._ import org.bitcoins.core.util.BitcoinScript...
bitcoin-s/bitcoin-s
core/src/main/scala/org/bitcoins/core/script/ScriptProgram.scala
Scala
mit
12,339
/** * Swaggy Jenkins * Jenkins API clients generated from Swagger / Open API specification * * The version of the OpenAPI document: 1.1.2-pre.0 * Contact: blah@cliffano.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech */ packag...
cliffano/swaggy-jenkins
clients/scalatra/generated/src/main/scala/ServletApp.scala
Scala
mit
1,195
package twotails import org.scalatest.{ FlatSpec, Matchers } class Bippy{ @mutualrec final def one(x: Int, y: Int = 1): Int = if(0 < x) two(y, x) else 0 @mutualrec final def two(x: Int, y: Int = 1): Int = if(0 < x) one(x-1, y-1) else 0 } class Baz{ @mutualrec final def one(x: Int)(y: Int): Int = if(0 < x) two(...
wheaties/TwoTails
core/src/test/scala/twotails/ArgumentListTest.scala
Scala
apache-2.0
1,054
package com.github.agourlay.cornichon.steps import com.github.agourlay.cornichon.core.Engine import com.github.agourlay.cornichon.dsl.ProvidedInstances import com.github.agourlay.cornichon.resolver.PlaceholderResolver import monix.execution.Scheduler trait StepUtilSpec extends ProvidedInstances { implicit val sch...
OlegIlyenko/cornichon
cornichon-core/src/test/scala/com/github/agourlay/cornichon/steps/StepUtilSpec.scala
Scala
apache-2.0
469
package controller import skinny._ import skinny.validator._ import model.{ Gender, Employee } class EmployeesController extends SkinnyResource with ApplicationController { protectFromForgery() override def model = Employee override def resourcesName = "employees" override def resourceName = "employee" ...
grimrose/skinny-employee-schedule-sample
src/main/scala/controller/EmployeesController.scala
Scala
mit
2,715
package com.sksamuel.scrimage import org.scalatest.{WordSpec, Matchers} import scala.concurrent.{Await, Future} import scala.concurrent.duration._ class ScalingDeadlockTest extends WordSpec with Matchers { import scala.concurrent.ExecutionContext.Implicits.global val in = Image(getClass.getResourceAsStream("/c...
davenatx/scrimage
scrimage-core/src/test/scala/com/sksamuel/scrimage/ScalingDeadlockTest.scala
Scala
apache-2.0
661
package cn.hjmao.rosalind.hamm object Main extends App { val lines = scala.io.Source.fromFile("dataset.txt").getLines().toList val string0 = lines(0) val string1 = lines(1) val indices = 0 until string0.length println(indices.filter(index => string0(index) != string1(index)).length) }
RepoCastle/rosalind
src/cn/hjmao/rosalind/hamm/answer.scala
Scala
apache-2.0
299
package lila.mod import akka.actor.ActorSelection import lila.analyse.{ Analysis, AnalysisRepo } import lila.db.BSON.BSONJodaDateTimeHandler import lila.db.Types.Coll import lila.evaluation.Statistics import lila.evaluation.{ AccountAction, Analysed, GameAssessment, PlayerAssessment, PlayerAggregateAssessment, PlayerF...
pavelo65/lila
modules/mod/src/main/AssessApi.scala
Scala
mit
7,666
package org.finra.datagenerator.scaffolding.config case class Config[+T](conf: ConfigDefinition[T], value: Option[T]) extends Comparable[Config[_]] { def isNotDefault = value.isEmpty def getValue(): T = { if(value.isDefined) value.get else if(conf.default.isDefined) conf.default.get el...
yukaReal/DataGenerator
rubber-scaffolding/rubber-commons/src/main/scala/org/finra/datagenerator/scaffolding/config/Config.scala
Scala
apache-2.0
453
/* Copyright 2009 David Hall, Daniel Ramage 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 writi...
tjhunter/scalanlp-core
process/src/main/scala/breeze/serialization/TableMultiCellSerialization.scala
Scala
apache-2.0
5,515
package org.joda.time.convert import java.util.{Calendar, GregorianCalendar} import org.joda.time.chrono.{ BuddhistChronology, GJChronology, GregorianChronology, ISOChronology, JulianChronology } import org.joda.time.{Chronology, DateTimeZone} object CalendarConverter { val INSTANCE = new CalendarConvert...
mdedetrich/soda-time
shared/src/main/scala/org/joda/time/convert/CalendarConverter.scala
Scala
bsd-2-clause
1,791
/*********************************************************************** * Copyright (c) 2013-2018 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...
ddseapy/geomesa
geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/index/attribute/AttributeIndexKeySpace.scala
Scala
apache-2.0
12,530
import play.api._ import models._ import anorm._ object Global extends GlobalSettings { override def onStart(app: Application) { InitialData.insert() } } /** * Initial set of data to be imported * in the sample application. */ object InitialData { def date(str: String) = new java.text.SimpleDa...
scoverage/scoverage-maven-samples
playframework/singlemodule/zentasks/zentasks-scala-2.10/app/Global.scala
Scala
apache-2.0
2,599
package com.arcusys.learn.liferay.update.version250 import com.arcusys.learn.liferay.LiferayClasses.LUpgradeProcess import com.arcusys.learn.liferay.LogFactoryHelper import com.arcusys.learn.liferay.update.version250.slide.SlideTableComponent import com.arcusys.valamis.persistence.common.SlickDBInfo import com.arcusys...
arcusys/Valamis
learn-portlet/src/main/scala/com/arcusys/learn/liferay/update/version250/DBUpdater2415.scala
Scala
gpl-3.0
3,942
/* * 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 reflect ...
scala/scala
src/reflect/scala/reflect/internal/pickling/Translations.scala
Scala
apache-2.0
6,649
package org.janzhou.LSH trait LSHHelper extends NumberConversions { private val rand = new scala.util.Random(System.nanoTime) def hyperplane(dim:Int):HyperplaneLSH[Int] = new HyperplaneLSH(Array.fill(dim)(rand.nextInt)) private def seed(dim:Int, min:Int, max:Int):Iterable[Int] = { val range = max - min ...
janzhou/scala-lsh
src/main/scala/org/janzhou/lsh/LSHHelper.scala
Scala
mit
1,926
/* * 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 ...
jatin9896/incubator-carbondata
integration/spark2/src/main/scala/org/apache/carbondata/datamap/IndexDataMapRebuildRDD.scala
Scala
apache-2.0
19,401
package org.repwatch.config import com.typesafe.config.ConfigFactory class ApplicationConfig { private val config = ConfigFactory.load("repwatch.conf") val googleApiKey: String = config.getString("google.api-key") val propublicaApiKey: String = config.getString("propublica.api-key") }
csunwold/repwatch
alexa/src/main/scala/org/repwatch/config/ApplicationConfig.scala
Scala
gpl-3.0
296
package dotty.tools.dotc package transform import core._ import Contexts.Context import Decorators._ import tasty._ import config.Printers.{noPrinter, pickling} import java.io.PrintStream import Periods._ import Phases._ import Symbols._ import Flags.Module import reporting.ThrowingReporter import collection.mutable ...
som-snytt/dotty
compiler/src/dotty/tools/dotc/transform/Pickler.scala
Scala
apache-2.0
4,288
import sbt._ class CommonsProject(info: ProjectInfo) extends DefaultProject(info){//} with ChecksumPlugin{ val scalatest = { if(buildScalaVersion.contains("2.9")) "org.scalatest" % "scalatest_2.9.0" % "1.4.1" % "test" else "org.scalatest" % "scalatest" % "1.3" % "test" } val asm = "org.sca...
bowler-framework/recursivity-commons
project/build/CommonsProject.scala
Scala
bsd-3-clause
2,349
/* * 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/shared/src/main/scala/monix/benchmarks/TaskMapCallsBenchmark.scala
Scala
apache-2.0
2,090
package es.weso.shex import org.scalatest.FunSpec import com.typesafe.config._ import com.hp.hpl.jena.rdf.model.ModelFactory import java.io.FileOutputStream import java.io.FileInputStream import scala.collection.JavaConverters._ import org.scalatest.Matchers import es.weso.shacl.Report class RunTestsDeriv extends Fun...
jorgeyp/ShExcala
src/test/scala/es/weso/shex/RunTestsFolderDeriv.scala
Scala
mit
1,731
/* * 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 ...
brandon-edwards/incubator-spot
spot-ml/src/test/scala/org/apache/spot/testutils/TestingSparkContextWordSpec.scala
Scala
apache-2.0
1,533
package ml.sparkling.graph.operators.predicates import ml.sparkling.graph.api.operators.IterativeComputation.{SimpleVertexPredicate, VertexPredicate} import org.apache.spark.graphx.VertexId /** * Created by Roman Bartusiak (roman.bartusiak@pwr.edu.pl http://riomus.github.io). * Always true predicate */ object AllP...
sparkling-graph/sparkling-graph
operators/src/main/scala/ml/sparkling/graph/operators/predicates/AllPathPredicate.scala
Scala
bsd-2-clause
529
// 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.formats import shapeless._ import org.ensime.sexp._ /** * Helper methods for generating wrappers for types in a family, also * known as "type hints". * * See ht...
d1egoaz/ensime-sbt
src/sbt-test/sbt-ensime/ensime-server/s-express/src/main/scala/org/ensime/sexp/formats/FamilyFormats.scala
Scala
apache-2.0
1,898
// Databricks notebook source // MAGIC %md // MAGIC // MAGIC # [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/) // COMMAND ---------- // MAGIC %md // MAGIC Archived YouTube video of this live unedited lab-lecture: // MAGIC // MAGIC [![Archived YouTube video of this live un...
raazesh-sainudiin/scalable-data-science
db/2/2/034_LDA_20NewsGroupsSmall.scala
Scala
unlicense
43,041
/* * Copyright (c) 2012-2016 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.apach...
snowplow/iglu
0-common/igluctl/src/main/scala/com.snowplowanalytics.iglu/ctl/Main.scala
Scala
apache-2.0
3,305
package com.twitter.finagle.mysql.param import com.twitter.finagle.mysql.MysqlCharset.Utf8_general_ci import com.twitter.finagle.Stack /** * A class eligible for configuring a mysql client's credentials during * the Handshake phase. */ case class Credentials(username: Option[String], password: Option[String]) obje...
luciferous/finagle
finagle-mysql/src/main/scala/com/twitter/finagle/mysql/param/params.scala
Scala
apache-2.0
2,853
package slick.relational import scala.language.existentials import slick.ast._ import slick.SlickException import slick.util.SlickLogger import org.slf4j.LoggerFactory /** Create a ResultConverter for parameters and result sets. Subclasses have * to provide profile-specific createColumnConverter implementations. */...
easel/slick
slick/src/main/scala/slick/relational/ResultConverterCompiler.scala
Scala
bsd-2-clause
3,569
/* * Copyright 2008-present MongoDB, 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 ag...
rozza/mongo-scala-driver
driver/src/main/scala/org/mongodb/scala/FindObservable.scala
Scala
apache-2.0
9,749
/* * 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 ...
chenc10/Spark-PAF
core/src/test/scala/org/apache/spark/memory/UnifiedMemoryManagerSuite.scala
Scala
apache-2.0
12,208
object Foo: opaque type BlaBla[+T, D] = Int extension [T, D](token: BlaBla[T, D]) def data: D = ??? //To cause the crash, after initial clean compilation //replace `???` with `value.data` to cause the compiler crash def foo[W <: Int](value: Bar.BlaBla[W]): Unit = ??? //value.data
dotty-staging/dotty
sbt-test/opaques/i12927/src/main/scala/Foo.scala
Scala
apache-2.0
286
/* * Copyright 2014–2020 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...
slamdata/quasar
impl/src/test/scala/quasar/impl/storage/PureIndexedStoreSpec.scala
Scala
apache-2.0
1,414
object Driver { def main(a: Array[String]) { val s = new Solution() println(s.candy(Array(1, 0, 2))) println(s.candy(Array(1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1))) println(s.candy(Array(5, 5, 4, 3, 3, 5, 8, 9, 7))) } }
shengmin/coding-problem
leetcode/candy/Driver.scala
Scala
mit
233
package com.github.symcal import spire.algebra._ import spire.implicits._ import scala.language.implicitConversions sealed abstract class Expr[T: Ring : Eq] { def +(x: Expr[T]): Sum[T] = (this, x) match { case (Sum(y@_*), Sum(z@_*)) => Sum(y ++ z: _*) case (Sum(y@_*), _) => Sum(y :+ x: _*) case (_, Sum(...
hamdi-jenzri/symcal
src/main/scala/com/github/symcal/Expr.scala
Scala
apache-2.0
13,729
package org.karps.row import scala.util.{Failure, Success, Try} import org.apache.spark.sql.Row import org.apache.spark.sql.types._ import karps.core.{row => R} /** * A representation of a row that is easy to manipulate with * algebraic datatypes. */ case class AlgebraicRow(cells: Seq[Cell]) object AlgebraicRo...
tjhunter/karps
src/main/scala/org/karps/row/AlgebraicRow.scala
Scala
apache-2.0
1,380
/* * 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
sql/core/src/main/scala/org/apache/spark/sql/execution/command/InsertIntoDataSourceDirCommand.scala
Scala
apache-2.0
2,989
package im.tox.antox.utils import java.io.{File, FilenameFilter} import java.util import java.util.{ArrayList, List} import android.app.{Activity, AlertDialog, Dialog} import android.content.DialogInterface import android.os.Environment import android.util.Log import im.tox.antox.utils.FileDialog._ import im.tox.ant...
0xPoly/Antox
app/src/main/scala/im/tox/antox/utils/FileDialog.scala
Scala
gpl-3.0
4,335
package org.zouzias.qclocktwo.examples import org.zouzias.qclocktwo.examples.ExamplePhrases._ /** * Phrases iterator */ class ExamplePhrasesIterator extends Iterator[Array[String]]{ var currentTime = ExamplePhrases.initTime() val END_CONST: String = "__END__" override def hasNext: Boolean = { currentTim...
zouzias/qlocktwo-grid-generator
src/main/scala/org/zouzias/qclocktwo/examples/ExamplePhrasesIterator.scala
Scala
apache-2.0
948
package shrimp import tables._ import models._ import slick.dbio.DBIOAction import slick.dbio.Effect.{Read, Write} import slick.driver.H2Driver.api._ import scala.concurrent.ExecutionContext.Implicits.global package object stores { object CarStore { def storeCar(car: Car) = { (car.id match { ca...
radium226/snippets
scala/slick-transactions/src/main/scala/shrimp/stores/package.scala
Scala
gpl-2.0
1,937
/* * Copyright 2017 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...
liquidarmour/ct-calculations
src/main/scala/uk/gov/hmrc/ct/ct600e/v2/E5.scala
Scala
apache-2.0
1,029
package de.tu_berlin.dima.bdapro.flink.palindrome.omarflores16 import org.apache.flink.api.scala._ import org.apache.flink.util.Collector import scala.collection.mutable.Queue object Palindrome { def main(args: Array[String]){ if (args.length != 1) { Console.err.println("Usage: <jar> inputPath outputPat...
cristiprg/BDAPRO.GlobalStateML
bdapro-ws1617-flink-jobs/src/main/scala/de/tu_berlin/dima/bdapro/flink/palindrome/omarflores16/Palindrome.scala
Scala
apache-2.0
1,640
/* * Copyright (c) 2015, Nightfall Group * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of conditions a...
Nightfall/SRails
src/main/scala/moe/nightfall/srails/SRails.scala
Scala
bsd-2-clause
2,369
package io.continuum.bokeh package sampledata import java.io.{File,InputStream,FileInputStream,InputStreamReader,FileNotFoundException} import java.util.zip.{ZipInputStream,GZIPInputStream} import java.net.URL import scala.collection.JavaConverters._ import scalax.io.JavaConverters._ import scalax.file.Path import ...
bokeh/bokeh-scala
sampledata/src/main/scala/SampleData.scala
Scala
mit
4,287
/******************************************************************************* * Copyright (c) 2019. Carl Minden * * 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, either version 3 of the ...
carlminden/anathema-roguelike
src/com/anathema_roguelike/entities/characters/actions/attacks/WeaponAttack.scala
Scala
gpl-3.0
2,355
/* * 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 ...
rekhajoshm/spark
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala
Scala
apache-2.0
49,082
/* * 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/play-async
src/test/scala/uk/gov/hmrc/play/asyncmvc/controllers/AsyncSetup.scala
Scala
apache-2.0
9,392
package controllers.silhouette import java.util.UUID import com.google.inject.AbstractModule import com.mohiva.play.silhouette.api.{ Environment, LoginInfo } import com.mohiva.play.silhouette.impl.authenticators.CookieAuthenticator import com.mohiva.play.silhouette.test._ import models.User import net.codingwell.scal...
raisercostin/play-silhouette-slick-seed
modules/silhouette/test/controllers/ApplicationControllerSpec.scala
Scala
apache-2.0
2,813
package org.backuity.matchete import org.backuity.matchete.TestUtil._ import org.junit.{ComparisonFailure, Test} class SeqDiffableTest extends JunitMatchers { @Test def beEqualNestedList_Ok(): Unit = { { List(Person("John", 21), Person("Jane", 32)) must_== List(Person("John", 21), Person("Jane", 12)) ...
backuity/matchete
core/src/test/scala/org/backuity/matchete/SeqDiffableTest.scala
Scala
apache-2.0
3,775
/* * 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 ...
duynguyen/incubator-openwhisk
tests/src/test/scala/ha/ShootComponentsTests.scala
Scala
apache-2.0
5,977
package de.htwg.zeta.server.model.modelValidator.validator.rules.metaModelDependent import scala.collection.immutable.Seq import de.htwg.zeta.common.models.project.concept.Concept import de.htwg.zeta.common.models.project.concept.elements.AttributeType import de.htwg.zeta.common.models.project.concept.elements.Attrib...
Zeta-Project/zeta
api/server/app/de/htwg/zeta/server/model/modelValidator/validator/rules/metaModelDependent/NodeAttributeScalarTypes.scala
Scala
bsd-2-clause
2,902
package service import play.api.Logger import play.api.libs.Files.TemporaryFile import play.api.mvc.{MultipartFormData, Request} /** * Created by supriya on 15/2/16. */ class UploadService { private val log: Logger = Logger(this.getClass) /** * Get file from the request and move it in your location ...
rklick-solutions/bigdata-tutorial
app/service/UploadService.scala
Scala
apache-2.0
853
/* * Copyright 2013 Joachim Hofer * * 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 t...
jmhofer/rxjava-akka
src/main/scala/rx/schedulers/AkkaScheduler.scala
Scala
apache-2.0
3,537
/* Copyright 2012 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 in writing, software distr...
sriramkrishnan/scalding
scalding-core/src/main/scala/com/twitter/scalding/typed/TypedPipe.scala
Scala
apache-2.0
45,782
package main.scala; import MorseLanguageDetails._; import GeneralFunc._; object MorseFunc { /** * MorseReader class used to interpret Morse code or translate to Morse code. * * METHODS: * translate * USE: * PARAMETERS: * s:String {Phrase...
Eli45/MorseGUI
src/main/scala/MorseFunc.scala
Scala
gpl-2.0
6,392
/* * Copyright 2015 Paul Horn * * 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...
knutwalker/ff7-simulator
items/src/main/scala/ff7/monsters/midgar1/reactor1/package.scala
Scala
apache-2.0
3,846
/* * Copyright (c) 2012-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.apach...
mdavid/lessig-bigdata
lib/snowplow/3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/utils/ScalazJson4sUtils.scala
Scala
mit
2,657
/** * Copyright (C) 2007 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 program i...
brunobuzzi/orbeon-forms
xforms/jvm/src/main/scala/org/orbeon/oxf/xforms/Loggers.scala
Scala
lgpl-2.1
1,424
/* * 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
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RewriteSubquerySuite.scala
Scala
apache-2.0
2,682
/* * BlobVoices.scala * (SysSon) * * Copyright (c) 2013-2017 Institute of Electronic Music and Acoustics, Graz. * Copyright (c) 2014-2019 Hanns Holger Rutz. All rights reserved. * * This software is published under the GNU General Public License v3+ * * * For further information, please contact Hanns Holg...
iem-projects/sysson
src/main/scala/de/sciss/fscape/stream/BlobVoices.scala
Scala
gpl-3.0
37,201
package com.airbnb.aerosolve.training import java.io.BufferedWriter import java.io.OutputStreamWriter import java.util.concurrent.ConcurrentHashMap import com.airbnb.aerosolve.core.{ModelRecord, ModelHeader, FeatureVector, Example} import com.airbnb.aerosolve.core.models.LinearModel import com.airbnb.aerosolve.core.u...
dmoliveira/aerosolve
training/src/main/scala/com/airbnb/aerosolve/training/LinearRankerTrainer.scala
Scala
apache-2.0
20,178
package tryp import shapeless._, poly._, ops.hlist._, ops.coproduct.ExtendBy trait FlatMapWith[HF <: Poly2, L <: HList, In] { type Out <: HList def apply(l: L, in: In): Out } object FlatMapWith { def apply[HF <: Poly2, L <: HList, In] (implicit fm: FlatMapWith[HF, L, In]): Aux[HF, L, In, fm.Out] = fm typ...
tek/pulsar
main/src/lib_ext/shapeless/flat_map_with.scala
Scala
mit
2,931
package im.actor.server.eventbus import java.util.UUID import akka.actor._ import akka.cluster.sharding.{ ClusterSharding, ClusterShardingSettings } import akka.pattern.ask import akka.util.Timeout import im.actor.config.ActorConfig import im.actor.types._ import scala.concurrent.Future object EventBus { type Eve...
ljshj/actor-platform
actor-server/actor-core/src/main/scala/im/actor/server/eventbus/EventBusExtension.scala
Scala
mit
3,876
package play.api.libs.json import scala.language.reflectiveCalls import scala.reflect.macros.Context import language.experimental.macros object JsMacroImpl { def readsImpl[A : c.WeakTypeTag](c: Context) : c.Expr[Reads[A]] = { import c.universe._ import c.universe.Flag._ val companioned = weakTypeOf[A]...
noel-yap/setter-for-catan
play-2.1.1/framework/src/play/src/main/scala/play/api/libs/json/JsMacroImpl.scala
Scala
apache-2.0
39,435
/** * 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 ...
tdanford/bdg-utils
utils-minhash/src/main/scala/org/bdgenomics/utils/minhash/MinHash.scala
Scala
apache-2.0
7,267
package com.nitin.nizhawan.decompiler.structures.constantpool import com.nitin.nizhawan.decompiler.main.ByteReader /** * Created by nitin on 13/12/15. */ class ConstantPool(br:ByteReader,size:Int){ val poolEntries = new Array[ConstPoolEntry](size) poolEntries(0) = new UnknownConstPoolEntry(0,br,this) for(i <-...
nitin-nizhawan/jedi
src/com/nitin/nizhawan/decompiler/structures/constantpool/ConstantPool.scala
Scala
artistic-2.0
513
/* * Copyright 2015 – 2016 Martin Seeler * * 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...
MartinSeeler/rx-oanda
src/test/scala/rx/oanda/orders/OrderDecoderSpec.scala
Scala
apache-2.0
4,850
package org.amcgala.agent import org.amcgala.agent.World.{ CellWithIndex, InformationObject } import org.amcgala.agent.Agent.{ OwnerPheromone, Pheromone, AgentStates } import akka.actor.{ PoisonPill, ActorRef } /** * Ein WorldContraintsChecker überprüft während der Simulation die Aktionen der Agenten und kann entsc...
th-koeln/amcgala
src/main/scala/org/amcgala/agent/WorldConstraints.scala
Scala
apache-2.0
4,522
// scalac: -feature -language:implicitConversions -language:higherKinds -language:-implicitConversions -Xfatal-warnings // showing that multiple settings are respected, and explicit enablement has precedence class X { def hk[M[_]] = ??? implicit def imp(x: X): Int = x.hashCode }
loskutov/intellij-scala
testdata/scalacTests/pos/t8736.scala
Scala
apache-2.0
285
{ def f = {} } /* resolved: false */ f
LPTK/intellij-scala
testdata/resolve2/scope/InnerBlock.scala
Scala
apache-2.0
41
/* ************************************************************************************* * Copyright 2011 Normation SAS ************************************************************************************* * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero Ge...
fanf/cf-clerk
src/main/scala/com/normation/cfclerk/services/TechniqueLibraryUpdateNotification.scala
Scala
agpl-3.0
2,537
/* * Wire * Copyright (C) 2016 Wire Swiss GmbH * * 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, either version 3 of the License, or * (at your option) any later version. * * This progr...
wireapp/wire-android-sync-engine
zmessaging/src/test/scala/com/waz/service/IntegrationsServiceSpec.scala
Scala
gpl-3.0
8,047
// // EventCounter.scala -- Scala object EventCounter // Project OrcScala // // Created by jthywiss on Jul 18, 2017. // // Copyright (c) 2019 The University of Texas at Austin. All rights reserved. // // Use and redistribution of this file is governed by the license terms in // the LICENSE file found in the project's t...
orc-lang/orc
OrcScala/src/orc/util/EventCounter.scala
Scala
bsd-3-clause
3,508
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** @author Matthew Saltz, John Miller, Ayushi Jain * @version 1.3 * @date Thu Jul 25 11:28:31 EDT 2013 * @see LICENSE (MIT style license file). */ package scalation.graphalytics.mutable import scala.collection.mutable.Map ...
NBKlepp/fda
scalation_1.3/scalation_modeling/src/main/scala/scalation/graphalytics/mutable/MDualIso.scala
Scala
mit
9,037
package com.avsystem.scex package compiler import java.lang.annotation.RetentionPolicy import com.avsystem.scex.compiler.ScexCompiler.CompilationFailedException import com.avsystem.scex.compiler.TestUtils.CustomBooleanConversionRoot import com.avsystem.scex.util.{PredefinedAccessSpecs, SimpleContext} import org.scala...
AVSystem/scex
scex-core/src/test/scala/com/avsystem/scex/compiler/LiteralExpressionsTest.scala
Scala
mit
3,268
package debop4s.timeperiod.timerange import java.util import debop4s.timeperiod.TimeSpec._ import debop4s.timeperiod._ import debop4s.timeperiod.utils.Times import org.joda.time.DateTime import scala.beans.BeanProperty import scala.collection.SeqView /** * debop4s.timeperiod.timerange.HalfyearTimeRange * @author...
debop/debop4s
debop4s-timeperiod/src/main/scala/debop4s/timeperiod/timerange/HalfyearTimeRange.scala
Scala
apache-2.0
3,209
object RandomBot extends BotFactory { def main(args: Array[String]): Unit = { Runner.run("scalaRandom", this) } override def make(id: Int): Bot = new RandomBot(id) } class RandomBot(myId: Int) extends Bot { override def getMoves(grid: Grid): Iterable[Move] = { for { site <- grid.getMine(myId) ...
yangle/HaliteIO
airesources/Scala/RandomBot.scala
Scala
mit
379
package amphip.base import scala.collection.{immutable, generic, GenTraversableOnce} import scala.collection.generic.CanBuildFrom /** * Immutable map preserving insertion order */ class LinkedMap[K, +V] private ( private val theVect: Vector[K], private val theMap: Map[K, V] ) extends immutable.Map[K, V] ...
gerferra/amphip
core/src/main/scala/amphip/base/LinkedMap.scala
Scala
mpl-2.0
1,721