code
stringlengths
5
1M
repo_name
stringlengths
5
109
path
stringlengths
6
208
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
5
1M
package akka.persistence.pg.perf import java.util.concurrent.atomic.AtomicInteger import akka.actor.{ActorLogging, Props} import akka.persistence.PersistentActor import akka.persistence.pg.perf.Messages.{Alter, Altered} class PersistAllActor(id: Int) extends PersistentActor with ActorLogging { override val persis...
WegenenVerkeer/akka-persistence-postgresql
modules/akka-persistence-pg/src/test/scala/akka/persistence/pg/perf/PersistAllActor.scala
Scala
mit
845
package sttp.client3.ziojson trait SttpZioJsonApiExtensions {}
softwaremill/sttp
json/zio1-json/src/main/scalajs/sttp/client3/ziojson/SttpZioJsonApiExtensions.scala
Scala
apache-2.0
64
package object Macros { def foo: Unit = macro Impls.foo } object Test extends dotty.runtime.LegacyApp { import Macros._ foo }
yusuke2255/dotty
tests/disabled/macro/run/macro-term-declared-in-package-object/Macros_Test_2.scala
Scala
bsd-3-clause
132
// scalac: -Xfatal-warnings // sealed trait A2[T1] final class B2[T1, T2] extends A2[T1] sealed trait A[T] final class B[T] extends A[T] sealed trait A1[T] trait B1[T] extends A1[T] trait C1[T] extends A1[T] trait D1[T] extends A1[Int] trait E1[T] extends B1[Int] trait F1[T] extends B1[T] object MiscUnchecked { /*...
scala/scala
test/files/neg/unchecked3.scala
Scala
apache-2.0
3,369
package com.varunvats.practice.string import com.varunvats.practice.sorting.UnitSpec class LongestSubstringUniqueCharactersSpec extends UnitSpec { val givenAString = afterWord("given a string") "The longest sub-string (containing unique characters) finder" when givenAString { "that is empty" must { "...
varunvats/practice
jvm/src/test/scala/com/varunvats/practice/string/LongestSubstringUniqueCharactersSpec.scala
Scala
mit
2,123
/* * 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 ...
Panos-Bletsos/spark-cost-model-optimizer
streaming/src/test/scala/org/apache/spark/streaming/ReceivedBlockTrackerSuite.scala
Scala
apache-2.0
15,903
package org.purview.core.report import java.io.Serializable import org.purview.core.data.Color sealed trait ReportLevel extends NotNull with Serializable { val name: String } trait LevelColor extends ReportLevel { def color: Color } object Debug extends ReportLevel with LevelColor { val name =...
mroth23/purview
purview-core/src/main/scala/org/purview/core/report/ReportLevel.scala
Scala
apache-2.0
872
/* * 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 ...
wangmiao1981/spark
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesConf.scala
Scala
apache-2.0
8,668
/* * 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 ...
manuzhang/incubator-gearpump
streaming/src/main/scala/org/apache/gearpump/streaming/appmaster/JarScheduler.scala
Scala
apache-2.0
6,741
object DifferentWays extends App { val MODULO: Int = 100000007; case class Query(n: Int, k: Int) import scala.collection.mutable.{HashMap ⇒ MMap} val mem = MMap[Query, Int]() // let's cache prev results def memCount(n: Int, k: Int) = mem getOrElseUpdate (Query(n, k), count(n, k)) def count(n: Int, k: Int): In...
flopezlasanta/hackerrank
src/functional_programming/memoization_dp/DifferentWays.scala
Scala
mit
642
package test.ch.bsisa.hyperbird.orders import test.ch.bsisa.hyperbird.util.BaseSerialisationSpec import ch.bsisa.hyperbird.orders.OrderUtil import ch.bsisa.hyperbird.model.format.ElfinFormat import org.specs2.mutable._ import play.api.test._ import play.api.test.Helpers._ /** * Tests ch.bsisa.hyperbird.io.OrderUtilS...
bsisa/hb-api
test/test/ch/bsisa/hyperbird/orders/OrderUtilRoundingSpec.scala
Scala
gpl-2.0
7,850
class Foo[T] trait Prepend { type Out } object Test { def foo()(implicit ev: Prepend): Foo[ev.Out] = ??? def test: Unit = { foo(): Foo[Any] // error: found: Prepend => Foo[_] required: Foo[Any] } implicit val p: Prepend = ??? }
som-snytt/dotty
tests/neg/i2672.scala
Scala
apache-2.0
247
package fommil.stalagmite.benchmarks import org.openjdk.jmh.annotations.Benchmark import testing.meta._ import testing.{ caseclass, memoised, optimiseheap, weakmemoised } class ApplyBenchmark { import BenchmarkData._ // case class @Benchmark def caseClass(cs: CaseClassData): IndexedSeq[FooCaseClass[String]...
vovapolu/scala-data-classes
src/jmh/scala/fommil/stalagmite/benchmarks/ApplyBenchmark.scala
Scala
lgpl-3.0
1,792
/* * Copyright © 2013 by Jörg D. Weisbarth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License 3 as published by * the Free Software Foundation; * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRA...
joergdw/antconflictbeh
src/sim/app/antDefenseAIs/model/AntQueen.scala
Scala
lgpl-3.0
3,231
package io.jfc import algebra.Eq import cats.Show sealed abstract class CursorOpElement extends Product with Serializable object CursorOpElement { case object CursorOpLeft extends CursorOpElement case object CursorOpRight extends CursorOpElement case object CursorOpFirst extends CursorOpElement case object C...
non/circe
core/src/main/scala/io/jfc/CursorOpElement.scala
Scala
apache-2.0
2,601
/* * Copyright (c) 2013 Daniel Krzywicki <daniel.krzywicki@agh.edu.pl> * * 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 ...
eleaar/scala-mas
emas/src/main/scala/pl/edu/agh/scalamas/emas/EmasMeetings.scala
Scala
mit
2,931
/** * Copyright (c) 2002-2012 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j 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 Foundati...
dksaputra/community
cypher/src/test/scala/org/neo4j/cypher/internal/pipes/aggregation/CountTest.scala
Scala
gpl-3.0
1,223
package com.github.btmorr.harmonia.models case object SimpleLookup extends Model[String, String] { def apply(in: String) = in.toLowerCase match { case i if in contains "weather" => "I'm working on learning how to look up the weather" case i if in contains "how are you" => "I'm doing well. How's about you?" ...
btmorr/ideal-spork
mastermind/src/main/scala/com/github/btmorr/harmonia/models/SimpleLookup.scala
Scala
gpl-3.0
465
/* Copyright (c) 2017, Qvantel All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following di...
Doikor/jsonapi-scala
spray/src/test/scala/com/qvantel/jsonapi/spray/SprayExceptionHandlerSpec.scala
Scala
bsd-3-clause
3,821
package im.actor.server.enrich import scala.concurrent.ExecutionContext import akka.util.Timeout import slick.dbio._ import im.actor.api.rpc.Implicits._ import im.actor.api.rpc.messaging.{ ApiMessage, UpdateMessageContentChanged } import im.actor.server.models.{ Peer, PeerType } import im.actor.server.persist import...
damoguyan8844/actor-platform
actor-server/actor-enrich/src/main/scala/im/actor/server/enrich/UpdateHandler.scala
Scala
mit
3,468
package com.komanov.uuid import java.util.UUID import scala.annotation.tailrec object UuidScala3Utils { def fromStringFast(s: String): UUID = { val component1EndIndex = indexOfHyphen(s, 0) val component2EndIndex = indexOfHyphen(s, component1EndIndex + 1) val component3EndIndex = indexOfHyphen(s, compo...
dkomanov/stuff
src/com/komanov/uuid/UuidScala3Utils.scala
Scala
mit
2,172
/* * 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 ...
benburford/core
core/src/main/scala/com/scaledaction/core/kafka/KafkaConfig.scala
Scala
apache-2.0
2,584
/** * 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 ...
kcompher/adam
adam-core/src/main/scala/org/bdgenomics/adam/rdd/read/AlignmentRecordRDDFunctions.scala
Scala
apache-2.0
24,331
package cromwell.database.migration.workflowoptions import cromwell.core.WorkflowOptions /** * Clear the values from encrypted keys in METADATA_ENTRY. */ class ClearMetadataEntryWorkflowOptions extends WorkflowOptionsChange { override val tableName = "METADATA_ENTRY" override val primaryKeyColumn = "METADATA_...
ohsu-comp-bio/cromwell
database/migration/src/main/scala/cromwell/database/migration/workflowoptions/ClearMetadataEntryWorkflowOptions.scala
Scala
bsd-3-clause
592
package spire.math.algebraic import spire.algebra.Sign import spire.math._ import org.scalatest.FunSuite class MaybeDoubleTest extends FunSuite { test("Invalid is invalid") { assert(!MaybeDouble.Invalid.isValid) } test("Exact construction from Float, Double, and Int") { assert(MaybeDouble(0.3f).isExac...
lrytz/spire
tests/src/test/scala/spire/math/fpf/MaybeDoubleTest.scala
Scala
mit
4,912
/** * Copyright (C) 2010 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...
evlist/orbeon-forms
src/main/scala/org/orbeon/oxf/xforms/XFormsInstance.scala
Scala
lgpl-2.1
24,197
package com.twitter.finagle.zipkin.thrift import java.nio.ByteBuffer import java.net.{InetAddress, InetSocketAddress, SocketAddress} import java.util.logging.Logger import com.twitter.finagle.thrift.thrift /** * Endpoints describe a TCP endpoint that terminates RPC * communication. */ case class Endpoint(ipv4: Int...
joshbedo/finagle
finagle-zipkin/src/main/scala/com/twitter/finagle/zipkin/thrift/Endpoint.scala
Scala
apache-2.0
1,562
// 2. What is the value of an empty block expression {} ? What is its type? Value of empty block expression is (); Type of such expression is Unit.
P7h/ScalaPlayground
Scala for the Impatient/exercises/org/p7h/scala/impatient/chapter02/02.scala
Scala
apache-2.0
151
package demo.components import scala.scalajs.js import scala.scalajs.js.annotation.JSImport object Images { @js.native @JSImport("./googleMap.png", JSImport.Default) object googleMapImage extends js.Any @js.native @JSImport("./reactListView.png", JSImport.Default) object reactListViewImage extends js.Any @...
aparo/scalajs-react-components
demo/src/main/scala/demo/components/Images.scala
Scala
apache-2.0
1,668
package com.gigaspaces.csvwriter import java.io.File import org.apache.commons.cli.{CommandLine, GnuParser, Options} import scala.Predef.String import scala.Predef.require import org.openspaces.core.space.UrlSpaceConfigurer import org.openspaces.core.{GigaSpace, GigaSpaceConfigurer} import org.slf4j.LoggerFactory cla...
jasonnerothin/gs-csvwriter
src/main/scala/com/gigaspaces/csvwriter/CommandLineProcessing.scala
Scala
apache-2.0
2,614
package net.selenate.server package actions package workers import extensions.SelenateFirefox import net.selenate.common.comms.req.SeReqElementGetAttributes import net.selenate.common.comms.res.SeResElementGetAttributes import net.selenate.common.exceptions.SeActionException import scala.util.{ Failure, Success, Try }...
tferega/selenate
code/Server/src/main/scala/net/selenate/server/actions/workers/ElementGetAttributesAction.scala
Scala
bsd-3-clause
2,295
/** * 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...
mthak/test_kafka
core/src/main/scala/kafka/server/KafkaServer.scala
Scala
apache-2.0
12,902
package com.strad.evan.interpreters import cats.~> import com.strad.evan.algebra.EventStore.{EventStoreA, Write} import fs2.Task import org.mongodb.scala._ object MongoDbInterpreter extends (EventStoreA ~> Task) { implicit val scheduler = _root_.fs2.Scheduler.fromFixedDaemonPool(2, "generator-scheduler") impl...
rstradling/evan
client/src/main/scala/com/strad/evan/interpreters/MongoDbInterpreter.scala
Scala
mit
809
/* * Copyright 2012 IL <iron9light AT gmali DOT 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 applicabl...
iron9light/ideacolorschemes-commons
src/main/scala/com/ideacolorschemes/commons/json/BinarySerializer.scala
Scala
apache-2.0
1,372
package lila.forumSearch import com.sksamuel.elastic4s.ElasticDsl._ import com.sksamuel.elastic4s.QueryDefinition import org.elasticsearch.search.sort.SortOrder import lila.search.ElasticSearch private[forumSearch] final class Query private ( indexType: String, terms: List[String], staff: Boolean, tr...
Happy0/lila
modules/forumSearch/src/main/Query.scala
Scala
mit
1,569
package de.aaschmid.sbtplugin.testnotifier import org.specs.Specification import org.specs.util.DataTables object SeverityTest extends Specification with DataTables { import de.aaschmid.sbtplugin.testnotifier.{Error => SError} def provide = addToSusVerb("provide") "Sealed case class Severity" should provide...
aaschmid/sbt-test-notifier
src/test/scala/de/aaschmid/sbtplugin/testnotifier/SeverityTest.scala
Scala
apache-2.0
1,690
/** * 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 */ package...
cliffano/swaggy-jenkins
clients/scalatra/generated/src/main/scala/org/openapitools/server/model/ExtensionClassContainerImpl1map.scala
Scala
mit
601
package epfl.pacman package maze import collection.{mutable => mut, immutable => imm} trait Models extends Thingies with Positions with Directions { this: MVC => abstract class State case object Running extends State case object Paused extends State case class Loading(next: State) extends State case class ...
lrytz/pacman
src/main/scala/epfl/pacman/maze/Models.scala
Scala
bsd-2-clause
11,501
/* * Copyright (C) 2017 HAT Data Exchange Ltd * SPDX-License-Identifier: AGPL-3.0 * * This file is part of the Hub of All Things project (HAT). * * HAT is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License * as published by the Free Software Founda...
Hub-of-all-Things/HAT2.0
hat/test/org/hatdex/hat/she/functions/DataFeedDirectMapperSpec.scala
Scala
agpl-3.0
14,695
package com.github.dakatsuka.akka.http.oauth2.client import akka.actor.ActorSystem import akka.http.scaladsl.model.{ HttpEntity, HttpResponse, StatusCodes } import akka.http.scaladsl.model.ContentTypes.`application/json` import akka.stream.{ ActorMaterializer, Materializer } import org.scalatest.concurrent.ScalaFuture...
dakatsuka/akka-http-oauth2-client
src/test/scala/com/github/dakatsuka/akka/http/oauth2/client/AccessTokenSpec.scala
Scala
apache-2.0
1,925
/* * 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 ...
goldmedal/spark
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
Scala
apache-2.0
32,799
/* ************************************************************************************* * 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...
jooooooon/rudder
rudder-core/src/test/scala/com/normation/rudder/migration/XmlDataMigration_10_2.scala
Scala
agpl-3.0
24,084
package es.ucm.fdi.sscheck.gen import org.scalacheck.{Properties, Gen} import org.scalacheck.Arbitrary.arbitrary import org.scalacheck.Prop.{forAll, exists, AnyOperators, collect} import org.scalatest._ import org.scalatest.Matchers._ import org.scalatest.prop.PropertyChecks._ import org.scalatest.Inspectors.{forAll =...
juanrh/spark-testing-base
src/test/scala/es/ucm/fdi/sscheck/gen/TLGenTest.scala
Scala
apache-2.0
10,164
import scala.io._ import scala.actors._ import Actor._ object PageLoader { def getPageSize(url : String) = Source.fromURL(url).mkString.length } var urls = List("https://www.twitter.com", "https://www.linkedin.com/", "http://gmail.google.com") def timeMethod(method: () => Unit) = { val start = System.nanoTim...
brice/seven-adventure
Week4/day3/sizer.scala
Scala
gpl-3.0
1,018
package ilc package feature package let trait FreeVariables extends analysis.FreeVariables with Syntax { override def termFreeVariables(term: Term): Set[Var] = term match { case Let(v, exp, body) => //If v is free in exp, it is indeed free in the overall let! body.freeVariables - v ++ exp.freeVariabl...
inc-lc/ilc-scala
src/main/scala/ilc/feature/let/FreeVariables.scala
Scala
mit
379
package scala.slick.driver import scala.slick.lifted._ import scala.slick.ast._ import scala.slick.jdbc.{PositionedResult, JdbcType} import scala.slick.util.MacroSupport.macroSupportInterpolation import java.sql.{Timestamp, Date, Time} import scala.slick.profile.{SqlProfile, Capability} /** * Slick driver for Micros...
boldradius/slick
src/main/scala/scala/slick/driver/SQLServerDriver.scala
Scala
bsd-2-clause
5,667
/* Copyright (C) 2008-2016 University of Massachusetts Amherst. This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible) http://factorie.cs.umass.edu, http://github.com/factorie Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with...
strubell/factorie
src/test/scala/cc/factorie/la/TestTensor2.scala
Scala
apache-2.0
2,270
package tests private class /*caret*/Private { def foo = ??? } private object /*caret*/Private { def bar = ??? }
triplequote/intellij-scala
scala/scala-impl/testdata/rename3/privateSamePackage/before/tests/Private.scala
Scala
apache-2.0
118
/** * Copyright 2014 Marco Vermeulen * * 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...
sdkman/sdkman-release-api
src/main/scala/io/sdkman/release/releases.scala
Scala
apache-2.0
1,965
/* * 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...
pncampbell/ct-calculations
src/main/scala/uk/gov/hmrc/ct/computations/calculations/NonTradeIncomeCalculator.scala
Scala
apache-2.0
1,091
package scala.slick.jdbc.meta import java.sql._ import scala.slick.jdbc.{ResultSetInvoker, UnitInvoker, JdbcType} /** * A wrapper for a row in the ResultSet returned by DatabaseMetaData.getColumns(). */ case class MColumn( table: MQName, column: String, sqlType: Int, typeName: String, columnSize: Option[Int], d...
boldradius/slick
src/main/scala/scala/slick/jdbc/meta/MColumn.scala
Scala
bsd-2-clause
1,416
package scala.compat.java8.converterImpl import scala.compat.java8.collectionImpl._ import Stepper._ /** Abstracts all the generic operations of stepping over a backing array * for some collection where the elements are stored generically and some * may be missing. Subclasses should set `currentEntry` to `null` ...
Ichoran/scala-java8-compat
src/main/scala/scala/compat/java8/converterImpl/StepsLikeGapped.scala
Scala
bsd-3-clause
3,057
package org.workcraft.gui; import java.awt.BorderLayout import java.awt.Dimension import java.awt.FlowLayout import java.awt.event.KeyEvent import java.awt.event.MouseEvent import java.awt.event.MouseListener import java.util.ArrayList import java.util.Collection import java.util.Collections import javax.swing.BorderF...
tuura/workcraft-2.2
Gui/src/main/scala/org/workcraft/gui/CreateWorkDialog.scala
Scala
gpl-3.0
5,242
package io.vamp.common.notification import akka.actor.{ AbstractLoggingActor, Actor, Props } object LoggingNotificationActor { def props: Props = Props[LoggingNotificationActor] } case class Error(notification: Notification, message: String) case class Info(notification: Notification, message: String) trait Noti...
dragoslav/vamp
common/src/main/scala/io/vamp/common/notification/NotificationActor.scala
Scala
apache-2.0
945
package org.pignat.bwatnwa import processing.core.PApplet class Embedded extends Tmp { override def setup(): Unit = { // original setup code here ... size(800, 800) // prevent thread from starving everything else noLoop() } override def draw(): Unit = { stroke(255) if (mousePressed) {...
dskntIndustry/WerkStatt
src/main/scala/org/pignat/bwatnwa/Embedded.scala
Scala
agpl-3.0
521
package org.bitcoins.rpc.client.v16 import org.bitcoins.core.currency.Bitcoins import org.bitcoins.core.protocol.BitcoinAddress import org.bitcoins.rpc.client.common.Client import org.bitcoins.rpc.jsonmodels.ReceivedAccount import org.bitcoins.rpc.serializers.JsonReaders._ import org.bitcoins.rpc.serializers.JsonSeria...
bitcoin-s/bitcoin-s-core
bitcoind-rpc/src/main/scala/org/bitcoins/rpc/client/v16/V16AccountRpc.scala
Scala
mit
2,361
package scaffvis.client.components.common import japgolly.scalajs.react.ReactElement import japgolly.scalajs.react.vdom.prefix_<^._ /** * Wrapper for Bootstrap provided Glyphicons (http://glyphicons.com/) */ object GlyphIcon { type Icon = ReactElement def base(name: String): Icon = <.span(^.className := s"glyp...
velkoborsky/scaffvis
client/src/main/scala/scaffvis/client/components/common/GlyphIcon.scala
Scala
gpl-3.0
885
package mr.merc.map.hex import mr.merc.map.hex.Direction._ object Direction { object N extends Direction("N") object NE extends Direction("NE") object SE extends Direction("SE") object S extends Direction("S") object SW extends Direction("SW") object NW extends Direction("NW") val list: List[Direction]...
RenualdMarch/merc
src/main/scala/mr/merc/map/hex/Direction.scala
Scala
gpl-3.0
1,434
/* * 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 ...
tlby/mxnet
scala-package/examples/src/main/scala/org/apache/mxnetexamples/rnn/LstmBucketing.scala
Scala
apache-2.0
5,070
package com.wixpress.petri.petri import org.joda.time.DateTime import org.specs2.matcher.{Matcher, Scope} import org.specs2.mutable.SpecificationWithJUnit import scala.collection.JavaConversions._ /** * User: Dalias * Date: 12/10/14 * Time: 4:45 PM */ class JdbcMetricsReportsDaoIT extends SpecificationWithJUnit ...
wix/petri
petri-server-core/src/it/java/com/wixpress/petri/petri/JdbcMetricsReportsDaoIT.scala
Scala
bsd-3-clause
5,870
package skutek_examples.sat_solver import skutek.abstraction._ import skutek.std_effects._ import Solve.Fx /* * Ported from OCaml code: * https://gist.github.com/Drup/4dc772ff82940608834fc65e3b80f583 * The control flow mechanism by (ab)use of exceptions from the original, is replaced by Choice effect */ object S...
marcinzh/skutek
modules/examples/src/main/scala/skutek_examples/sat_solver/Solve.scala
Scala
mit
1,427
package bootstrap.liftweb import code.lib.Bootstrap import code.model._ import code.snippet.{Spell, SpellInfo} import net.liftweb.common._ import net.liftweb.http._ import net.liftweb.mapper._ import net.liftweb.sitemap.Loc._ import net.liftweb.sitemap._ import net.liftweb.util._ /** * A class that's instantiated e...
jbaiera/lift-play
src/main/scala/bootstrap/liftweb/Boot.scala
Scala
mit
3,048
package com.github.andr83.parsek.pipe import com.github.andr83.parsek._ import org.scalatest.{FlatSpec, Matchers} /** * @author andr83 */ class CoalesceSpec extends FlatSpec with Matchers { implicit val context = new PipeContext() it should "return first non empty value and update with it first field" in { ...
andr83/parsek
core/src/test/scala/com/github/andr83/parsek/pipe/CoalesceSpec.scala
Scala
mit
559
package util.tasks /** * Abstract timed task * @param time time when task should run (0 to run immediately) * @param priority task priorityColumn [0,maxInt] * Created by CAB on 13.10.2014. */ abstract class TimedTask (val time:Long, val priority:Int) { def execute():Unit}
AlexCAB/FreelanceAnalytics
src/util/tasks/TimedTask.scala
Scala
mit
282
package dc import java.text.SimpleDateFormat import java.util.Date import scala.collection.SortedMap import scala.concurrent.Await import scala.concurrent.duration.Duration import dc.json.Checkpoint import dc.json.Measurement import dc.serverapi.CloudantApi object HandleCheckpoints { var continue: Boolean = tr...
MagnusAk78/dynamic-checklist-server
tools/src/main/scala/dc/HandleCheckpoints.scala
Scala
gpl-3.0
5,614
package cilib package exec import zio.prelude._ abstract class MonadStep[M[+_]: IdentityFlatten: Covariant] { def liftR[A](r: RVar[A]): M[A] }
cirg-up/cilib
exec/src/main/scala/cilib/MonadStep.scala
Scala
apache-2.0
147
package club.diybio.bank import utest._ object DummyFrontendTest extends TestSuite { val tests = TestSuite { "this is simple frontend dummy test" - { assert(true) } } }
denigma/plasmid-bank
frontend/src/test/scala/club/diybio/bank/DummyFrontendTest.scala
Scala
mpl-2.0
189
package io.swagger.client.model import io.swagger.client.core.ApiModel import org.joda.time.DateTime case class VariableUserSettings ( /* User ID */ user: Int, /* Variable DISPLAY name */ variable: String, /* Estimated duration of time following the onset delay in which a stimulus produces a perceivable ef...
QuantiModo/QuantiModo-SDK-Akka-Scala
src/main/scala/io/swagger/client/model/VariableUserSettings.scala
Scala
gpl-2.0
638
package org.lolhens.renderengine.model import org.lolhens.renderengine.vector.Vector3f /** * Created by LolHens on 05.10.2014. */ class BoundingBox(val min: Vector3f, val max: Vector3f) { def contain(cube: BoundingBox): BoundingBox = new BoundingBox(min.min(cube.min), max.max(cube.max)) } object NullBoundingBo...
LolHens/LibRenderEngine
src/main/scala/org/lolhens/renderengine/model/BoundingBox.scala
Scala
gpl-2.0
375
/* * Copyright 2014 porter <https://github.com/eikek/porter> * * 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...
eikek/porter
api/src/main/scala/porter/model/DefaultPermission.scala
Scala
apache-2.0
1,975
/* * Copyright 2012-2016 Netflix, 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...
wstrucke/edda
src/main/scala/com/netflix/edda/CollectionManager.scala
Scala
apache-2.0
1,441
package net.fwbrasil.activate.json import net.fwbrasil.activate.ActivateContext import net.fwbrasil.activate.entity.BaseEntity trait JsonContext[J] { val context: ActivateContext def createEntityFromJson[E <: BaseEntity: Manifest](json: String): E def createEntityFromJson[E <: BaseEntity: Manifest](json:...
avramirez/activate
activate-core/src/main/scala/net/fwbrasil/activate/json/JsonContext.scala
Scala
lgpl-2.1
2,120
/* * Copyright (C) 2016 Department for Business, Energy and Industrial Strategy * * 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) an...
UKGovernmentBEIS/rifs-frontend-play
src/test/scala/services/ApplicationFormURLsTest.scala
Scala
gpl-3.0
1,301
package edu.gemini.pit.catalog import edu.gemini.model.p1.{immutable => I} import java.net.URL import java.net.URLEncoder.{encode => urlencode} import edu.gemini.spModel.core._ import votable._ import java.util.UUID object Simbad extends Catalog with App { private lazy val hosts = Array("simbad.u-strasbg.fr", "s...
arturog8m/ocs
bundle/edu.gemini.pit/src/main/scala/edu/gemini/pit/catalog/Simbad.scala
Scala
bsd-3-clause
4,489
/* * # Highly divisible triangular number * ## Problem 12 * The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: * > 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... * Let us list the factors of the fi...
NotBobTheBuilder/ProjectEuler
scala/p12.scala
Scala
mit
934
/** * CSPFJ - CSP solving API for Java * Copyright (C) 2006 Julien VION * * This library 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 op...
concrete-cp/concrete
src/main/scala/concrete/constraint/linear/Gt.scala
Scala
lgpl-2.1
4,944
package com.twitter.finagle import com.twitter.io.Buf package object decoder { /** * A `Decoder` performs protocol decoding. As `Buf`s arrive on the wire, a * decoder accumulates them until completed messages arrive. The return value * is an ordered sequence of any completed messages as a result of accumu...
koshelev/finagle
finagle-core/src/main/scala/com/twitter/finagle/decoder/package.scala
Scala
apache-2.0
1,061
package com.github.alixba.vast trait VideoClicks extends VASTElement { def clicksTracking: Seq[ClickTracking] def customClicks: Seq[CustomClick] }
AlixBa/vast
src/main/scala/com/github/alixba/vast/VideoClicks.scala
Scala
mit
154
def factorial(n: Long): Long = n match { case 0 => 1 case x if x > 0 => factorial(n - 1) * n } println(factorial(3)) println(factorial(0)) println(factorial(20))
spolnik/7-languages-in-7-weeks
scala/factorial.scala
Scala
apache-2.0
167
package org.neo4j.scala.util package scalax package rules /** * A workaround for the difficulties of dealing with * a contravariant 'In' parameter type... */ class InRule[In, +Out, +A, +X](rule: Rule[In, Out, A, X]) { def mapRule[Out2, B, Y](f: Result[Out, A, X] => In => Result[Out2, B, Y]): Rule[In, Out2, B, Y]...
extendedmind/neo4j-scala
src/main/scala/org/neo4j/scala/util/scalax/rules/SeqRule.scala
Scala
agpl-3.0
3,289
import compiletime.uninitialized class Memo[A](x: => A): private var cached1: A = uninitialized private var cached: A = uninitialized private var known: Boolean = false def force = if !known then known = true cached = x val y = cached1 cached
dotty-staging/dotty
tests/pos/i11225.scala
Scala
apache-2.0
278
package se.gigurra.gat.util import com.jogamp.opengl.util.glsl.ShaderCode import com.jogamp.opengl.util.glsl.ShaderProgram import Edit.EditCls import javax.media.opengl.GL2ES2 object ShaderUtil { def buildShader(gl: GL2ES2, shaderType: Int, sourceCode: String): ShaderCode = { new ShaderCode(shaderType, 1, Arr...
GiGurra/gat
src/main/scala/se/gigurra/gat/util/ShaderUtil.scala
Scala
gpl-2.0
1,523
package scala.slick.lifted import scala.slick.ast.{Node, BinaryNode} import scala.slick.SlickException object Case { /** A when...then clause in a Case expression. */ final case class WhenNode(val left: Node, val right: Node) extends BinaryNode { protected[this] def nodeRebuild(left: Node, right: Node): Node...
zefonseca/slick-1.0.0-scala.2.11.1
src/main/scala/scala/slick/lifted/Case.scala
Scala
bsd-2-clause
2,785
package org.apache.spark.mllib.clustering import org.apache.spark.broadcast.Broadcast import scala.collection.mutable.ArrayBuffer import org.apache.spark.{SparkContext, Logging} import org.apache.spark.annotation.Experimental import org.apache.spark.mllib.linalg.{Vector, Vectors} import org.apache.spark.mllib.linalg...
henryhezhe2003/simiTerm
src/main/scala/org/apache/spark/mllib/clustering/MyKmean.scala
Scala
apache-2.0
1,387
package org.opencompare.api.java.io import org.opencompare.api.java.PCMFactory import org.opencompare.api.java.interpreter.CellContentInterpreter import org.scalatest.{Matchers, FlatSpec} import scala.io.Source import collection.JavaConversions._ /** * Created by gbecan on 20/11/15. */ abstract class CsvScalaLo...
gbecan/OpenCompare
org.opencompare/api-java/src/test/scala/org/opencompare/api/java/io/CsvScalaLoaderTest.scala
Scala
apache-2.0
1,298
/* * Copyright 2012 Jahziah Wagner <jahziah[dot]wagner[at]gmail[dot]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 * * Unle...
jahwag/OpenLobby
modules/Primer/src/main/scala/com/openlobby/primer/GenericObserver.scala
Scala
apache-2.0
1,183
/** * Copyright 2016, deepsense.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 applicable law or agreed ...
deepsense-io/seahorse-workflow-executor
deeplang/src/it/scala/io/deepsense/deeplang/doperables/spark/wrappers/estimators/MultilayerPerceptronClassifierSmokeTest.scala
Scala
apache-2.0
1,371
/* * Copyright 2013 The SIRIS Project * * 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...
simulator-x/core
src/simx/core/component/SingletonComponent.scala
Scala
apache-2.0
1,262
/* * 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/nn/PoolerSpec.scala
Scala
apache-2.0
12,847
package es.weso.rdf.jena import org.scalatest.junit.JUnitRunner import org.junit.runner.RunWith import org.scalatest.Matchers import org.scalatest.FunSpec import es.weso.rdf.triples.RDFTriple import es.weso.rdf.nodes._ import es.weso.rdf.jena._ import com.hp.hpl.jena.rdf.model.ModelFactory import es.weso.rdf._ import ...
labra/wesin
src/test/scala/es/weso/rdf/jena/RDFJenaSpec.scala
Scala
lgpl-3.0
6,365
package immortan import java.util.concurrent.{Executors, TimeUnit} import com.google.common.cache.CacheBuilder import fr.acinq.bitcoin.Crypto import fr.acinq.bitcoin.Crypto.PublicKey import fr.acinq.eclair.router.Graph.GraphStructure.{DirectedGraph, GraphEdge} import fr.acinq.eclair.router.RouteCalculation.handleRout...
btcontract/wallet
app/src/main/java/immortan/PathFinder.scala
Scala
apache-2.0
12,974
package scorex.benchmarks import java.util.concurrent.TimeUnit import org.openjdk.jmh.annotations._ import scorex.benchmarks.Helpers._ import scorex.crypto.authds.avltree.batch.Operation object AVLBatchPerformance { @State(Scope.Thread) class Basic(proverCnt: Int, opsCnt: Int) { val preparedOperations = pr...
ScorexProject/scrypto
benchmarks/src/main/scala/scorex.benchmarks/AVLBatchPerformance.scala
Scala
cc0-1.0
2,591
/* * 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 ...
maropu/spark
external/kafka-0-10-token-provider/src/test/scala/org/apache/spark/kafka010/KafkaHadoopDelegationTokenManagerSuite.scala
Scala
apache-2.0
1,297
/* * 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 ...
ankurmitujjain/incubator-zeppelin
zeppelin-display/src/main/scala/org/apache/zeppelin/display/angular/paragraphscope/AngularModel.scala
Scala
apache-2.0
1,811
package ee.cone.c4gate import com.squareup.wire.ProtoAdapter import ee.cone.c4actor.IdGenUtil import ee.cone.c4proto.{HasId, ToByteString} trait KeyGenerator { def idGenUtil: IdGenUtil def genPK[P <: Product](model: P, adapter: ProtoAdapter[Product] with HasId): String = idGenUtil.srcIdFromSerialized(adapter...
wregs/c4proto
c4gate-client/src/main/scala/ee/cone/c4gate/OrigKeyGenerator.scala
Scala
apache-2.0
363
package lila.rating import reactivemongo.bson.BSONDocument import lila.db.BSON case class Glicko( rating: Double, deviation: Double, volatility: Double) { def intRating = rating.toInt def intDeviation = deviation.toInt def intDeviationDoubled = (deviation * 2).toInt def intervalMin = (rating - ...
danilovsergey/i-bur
modules/rating/src/main/Glicko.scala
Scala
mit
1,400
/* * 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 ...
GJL/flink
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/stream/table/validation/GroupWindowValidationTest.scala
Scala
apache-2.0
10,871
package lila.game import lila.db.{ BSON, ByteArray } import org.joda.time.DateTime import reactivemongo.bson._ import chess.{ CheckCount, Color, Clock, White, Black, Status, Mode } import chess.variant.Variant object BSONHandlers { private[game] implicit val checkCountWriter = new BSONWriter[CheckCount, BSONArray...
pavelo65/lila
modules/game/src/main/BSONHandlers.scala
Scala
mit
5,104
/* * 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 agre...
eleflow/uberdata
iuberdata_core/src/main/scala/com/cloudera/sparkts/models/UberXGBoostModel.scala
Scala
apache-2.0
2,561
/* * Copyright 2017 rdbc contributors * * 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...
rdbc-io/rdbc-examples
play-scala/app/io/rdbc/examples/playscala/Record.scala
Scala
apache-2.0
932