code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
/*
*************************************************************************************
* Copyright 2013 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | armeniaca/rudder | rudder-core/src/main/scala/com/normation/rudder/rule/category/LDAPRuleCategoryRepository.scala | Scala | gpl-3.0 | 14,853 |
package lila.tournament
import akka.actor._
import akka.pattern.{ ask, pipe }
import actorApi._
import lila.game.actorApi.FinishGame
import lila.hub.actorApi.map.Ask
import lila.hub.actorApi.WithUserIds
import makeTimeout.short
private[tournament] final class Organizer(
api: TournamentApi,
reminder: ActorRef... | Happy0/lila | modules/tournament/src/main/Organizer.scala | Scala | mit | 2,631 |
/*
* 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 ... | maxday/spark.samples | streaming-twitter/src/main/scala/com/ibm/cds/spark/samples/StreamingTwitter.scala | Scala | apache-2.0 | 12,475 |
package org.littlewings.tweetbot.job
import javax.enterprise.inject.spi.{Bean, CDI}
import javax.servlet.annotation.WebListener
import javax.servlet.{ServletContextEvent, ServletContextListener}
import org.apache.deltaspike.scheduler.spi.Scheduler
import org.littlewings.tweetbot.LoggerSupport
import org.quartz.Job
i... | kazuhira-r/tweet-bot | src/main/scala/org/littlewings/tweetbot/job/JobActivator.scala | Scala | mit | 1,080 |
/* Copyright 2009-2021 EPFL, Lausanne */
package stainless
package utils
import inox.utils._
import java.io.OutputStream
import scala.reflect._
import stainless.termination.{TerminationReport => TR}
class StainlessSerializer(override val trees: ast.Trees, serializeProducts: Boolean = false)
extends InoxSerializ... | epfl-lara/stainless | core/src/main/scala/stainless/utils/Serialization.scala | Scala | apache-2.0 | 9,967 |
package honor
/**
* @author ponkotuy
* Date: 15/05/05.
*/
object HasUsers extends HonorCategory {
override def category: Int = 17
override def comment: String = "提督人数突破記念"
override def approved(memberId: Long, db: HonorCache): List[String] = List("提督500人突破", "提督1000人突破")
}
| b-wind/MyFleetGirls | server/app/honor/HasUsers.scala | Scala | mit | 322 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.maven
import javax.inject.Inject
import org.apache.maven.execution.MavenSession
import scala.beans.BeanProperty
/**
* Internal goal, invoked by other Lagom mojos that work with multiple projects at once, to rea... | edouardKaiser/lagom | dev/maven-plugin/src/main/scala/com/lightbend/lagom/maven/ConfigureMojo.scala | Scala | apache-2.0 | 767 |
/*
* Copyright 2011-2021 Asakusa Framework Team.
*
* 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 ... | asakusafw/asakusafw-spark | extensions/iterativebatch/compiler/core/src/main/scala/com/asakusafw/spark/extensions/iterativebatch/compiler/graph/IterativeJobClassBuilder.scala | Scala | apache-2.0 | 14,850 |
package kvstore
import org.scalatest.BeforeAndAfterAll
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.FunSuite
import akka.actor.ActorSystem
import akka.testkit.{ TestProbe, TestKit, ImplicitSender }
import scala.concurrent.duration._
import scala.util.Random
import scala.util.control.NonFatal
i... | M4573R/playground-notes | principles-of-reactive-programming/kvstore/src/test/scala/kvstore/Step2_SecondarySpec.scala | Scala | mit | 3,785 |
package scala.meta.internal.semanticdb.scalac
import org.scalameta.unreachable
import scala.{meta => m}
import scala.meta.internal.inputs._
import scala.meta.internal.{semanticdb => s}
trait DiagnosticOps { self: SemanticdbOps =>
implicit class XtensionCompilationUnitDiagnostics(unit: g.CompilationUnit) {
def r... | scalameta/scalameta | semanticdb/scalac/library/src/main/scala/scala/meta/internal/semanticdb/scalac/DiagnosticOps.scala | Scala | bsd-3-clause | 1,453 |
/* Copyright (C) 2008-2014 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... | patverga/factorie | src/main/scala/cc/factorie/tutorial/ChainNERExample.scala | Scala | apache-2.0 | 4,604 |
package play
import scala.language.implicitConversions
import play.api.Mode
import play.api.mvc._
import play.api.mvc.Results.NotFound
import play.core.Router
object navigator {
type Out = Handler
sealed trait PathElem
case class Static(name: String) extends PathElem {
override def toString = name
}
c... | teamon/play-navigator | src/main/scala/play/navigator/PlayNavigator.scala | Scala | mit | 22,229 |
package com.github.mgoeminne.sitar.parser
import scala.util.parsing.combinator.JavaTokenParsers
trait CitationParser extends JavaTokenParsers
{
def citation: Parser[Citation]
}
| mgoeminne/sitar | src/main/scala/com/github/mgoeminne/sitar/parser/CitationParser.scala | Scala | mit | 181 |
package io.youi.http
import io.youi.http.content.Content
import io.youi.http.cookie.RequestCookie
import io.youi.net.{IP, URL}
case class HttpRequest(method: HttpMethod = HttpMethod.Get,
source: IP = IP.LocalHost,
url: URL = URL(),
headers: Headers ... | outr/youi | core/shared/src/main/scala/io/youi/http/HttpRequest.scala | Scala | mit | 1,029 |
package qq
import qq.cc.Parser
import qq.data.{Definition, FilterAST, Program}
class ParserTest extends QQSyncTestSuite {
import qq.data.QQDSL._
"parse plain dots" in {
Parser.dot.parse(".").get.value.shouldBe(())
}
"parse selections" - {
"select key" in {
Parser.fullPath.parse(".key").get.va... | edmundnoble/slate | qq/shared/src/test/scala/qq/ParserTest.scala | Scala | mit | 6,890 |
package cs4r.labs.learningscala.otherexercises
/**
* Created by cs4r on 28/01/17.
*/
package object implicits {
class Greeter(s: String) {
def sayHello: String = "hola " + s + "!"
}
implicit def stringToGreeter(s: String) = new Greeter(s)
}
| Cs4r/LearningScala | src/main/scala/cs4r/labs/learningscala/otherexercises/implicits.scala | Scala | gpl-3.0 | 259 |
package com.paytmlabs.akka.cluster.discovery
import scala.collection.JavaConverters.asJavaCollectionConverter
import scala.collection.JavaConverters.asScalaBufferConverter
import akka.actor.Actor
import akka.actor.ActorLogging
import akka.actor.Cancellable
import akka.actor.Props
import akka.cluster.Cluster
import sc... | PaytmLabs/akka-batteries | discovery/core/src/main/scala/com/paytmlabs/akka/cluster/discovery/SelfJoinActor.scala | Scala | apache-2.0 | 1,707 |
object test:
import language.experimental.saferExceptions
import java.io.IOException
class Failure extends Exception
def bar(x: Int): Int throws Failure | IOException =
x match
case 1 => throw AssertionError()
case 2 => throw Failure() // ok
case 3 => throw java.io.IOExcept... | dotty-staging/dotty | tests/neg/saferExceptions.scala | Scala | apache-2.0 | 601 |
package org.jetbrains.plugins.scala.findUsages.factory
import scala.meta.inputs.Input.{File, LabeledString}
import scala.meta.inputs.{Input, Position}
import scala.meta.io.{AbsolutePath, Classpath, Sourcepath}
import scala.meta.semantic.Database
/** An object providing API which relies on semanticdb to get implicit u... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/findUsages/factory/SemanticDbUsagesProvider.scala | Scala | apache-2.0 | 1,339 |
package ch20_linked_hash_map
class Node[K, V](var key: Option[K], var data: Option[V], var prev: Option[Node[K, V]], var next: Option[Node[K, V]],
var hNext: Option[Node[K, V]]) {
def this(key: Option[K], data: Option[V]) = this(key, data, None, None, None)
}
/**
* LRU cache - https://leetcode.c... | wangzheng0822/algo | scala/src/main/scala/ch20_linked_hash_map/LRUCache.scala | Scala | apache-2.0 | 4,382 |
package com.lorandszakacs.util.list
import com.lorandszakacs.util.math.Identity
import scala.annotation.tailrec
/**
*
* @author Lorand Szakacs, lsz@lorandszakacs.com
* @since 12 Jul 2017
*
*/
object ListUtilFunctions extends ListUtilFunctions
trait ListUtilFunctions {
implicit class BuffedList[T](thisL... | lorandszakacs/sg-downloader | util/src/main/scala/com/lorandszakacs/util/list/ListUtilFunctions.scala | Scala | apache-2.0 | 1,717 |
package ar.edu.unq.tip.qsim.ui
/**
* Copyright 2014 Tatiana Molinari.
* Copyright 2014 Susana Rosito
*
* 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 ... | molinarirosito/QSim_UI | src/main/scala/ar/edu/unq/tip/qsim/ui/PuertosWindow.scala | Scala | gpl-3.0 | 3,311 |
package com.github.tonivade.buildtiful
import org.apache.ivy.core.settings.IvySettings
import java.io.File
import org.apache.ivy.Ivy
import org.apache.ivy.plugins.resolver.IBiblioResolver
import org.apache.ivy.core.module.descriptor.ModuleDescriptor
import org.apache.ivy.core.retrieve.RetrieveOptions
import org.apache... | tonivade/buildtiful | src/main/scala/IvyTasks.scala | Scala | mit | 2,942 |
package com.pygmalios.reactiveinflux.spark.extensions
import com.pygmalios.reactiveinflux.spark.{DStreamExtensions, _}
import com.pygmalios.reactiveinflux.{PointNoTime, ReactiveInfluxDbName}
import org.apache.spark.rdd.RDD
import org.apache.spark.streaming.dstream.DStream
import scala.concurrent.duration.Duration
cl... | pygmalios/reactiveinflux-spark | src/main/scala/com/pygmalios/reactiveinflux/spark/extensions/PointDStreamExtensions.scala | Scala | apache-2.0 | 643 |
package com.twitter.finagle
import com.twitter.conversions.time._
import com.twitter.finagle.stats.{DefaultStatsReceiver, StatsReceiver}
import com.twitter.finagle.util._
import com.twitter.util._
import com.google.common.cache.{Cache, CacheBuilder}
import java.net.{InetAddress, SocketAddress, UnknownHostException}
im... | folone/finagle | finagle-core/src/main/scala/com/twitter/finagle/Resolver.scala | Scala | apache-2.0 | 12,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 ... | debugger87/spark | resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/bindings/JavaDriverFeatureStepSuite.scala | Scala | apache-2.0 | 2,321 |
package es.weso.rbe
import es.weso.rdf.nodes._
import es.weso.rdf._
import es.weso.utils.Debugging
/**
* RDF as graphs
*/
case class RDFAsGraph(rdf: RDFReader)
extends Graph[IRI,RDFNode] with Debugging {
def in: RDFNode => Seq[(IRI, RDFNode)] = { n =>
val in = rdf.triplesWithObject(n).map(t => (t.pre... | labra/ShExcala | src/main/scala/es/weso/rbe/RDFAsGraph.scala | Scala | mit | 822 |
package lila.game
private[game] final class GameJs(path: String, useCache: Boolean) {
def unsigned: String = useCache.fold(cached, readFromSource)
val placeholder = "--ranph--"
def sign(token: String) = unsigned.replace(placeholder, token)
private lazy val cached: String = readFromSource
private def rea... | Enigmahack/lila | modules/game/src/main/GameJs.scala | Scala | mit | 433 |
package com.timushev.sbt.updates
import sbt.Keys._
import com.timushev.sbt.updates.UpdatesKeys._
trait UpdatesPluginTasks {
def dependencyUpdatesDataTask =
(projectID, libraryDependencies, ivySbt, scalaVersion, scalaBinaryVersion, dependencyUpdatesExclusions, dependencyAllowPreRelease, streams)
.map(Repo... | beni55/sbt-updates | src/main/scala/com/timushev/sbt/updates/UpdatesPluginTasks.scala | Scala | bsd-3-clause | 673 |
/*
* Copyright (c) 2014 Contributor. All rights reserved.
*/
package org.scalaide.debug.internal.expression.proxies.primitives.operations.bitwise
import org.junit.Test
import org.scalaide.debug.internal.expression.Names.Java
import org.scalaide.debug.internal.expression.BaseIntegrationTest
import org.scalaide.debug.... | scala-ide/scala-ide | org.scala-ide.sdt.debug.expression.tests/src/org/scalaide/debug/internal/expression/proxies/primitives/operations/bitwise/BitwiseShiftLeftWithZerosTest.scala | Scala | bsd-3-clause | 4,000 |
/**
* FILE: LoadUserList.scala
* PERCORSO /Codice/sgad/servertier/src/main/scala/sgad/servertier/businesslogic/operations
* DATA CREAZIONE: 3 Marzo 2014
* AUTORE: ProTech
* EMAIL: protech.unipd@gmail.com
*
* Questo file è proprietà del gruppo ProTech, viene rilasciato sotto licenza Apache v2.
*
* DIARIO DELLE ... | protechunipd/SGAD | Codice/sgad/servertier/src/main/scala/sgad/servertier/businesslogic/operations/LoadUserList.scala | Scala | apache-2.0 | 2,356 |
trait TestTrait
trait TestTrait2
class Test(y: Int, yy: String)(implicit zx: Double) extends T(5) with TestTrait with TestTrait2{
class B { def ggg(y: String) = y }
val r = "ttt"
val t = "rrr"
val bbb = new B
bbb ggg r
}
class T(x: Int)
| VladimirNik/tasty | exttests/tests/classInh/Test.scala | Scala | bsd-3-clause | 247 |
/**
* 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/integration/kafka/api/SslEndToEndAuthorizationTest.scala | Scala | apache-2.0 | 1,410 |
/*
* 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... | psyyz10/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/ConcatTableSpec.scala | Scala | apache-2.0 | 2,366 |
package lila.tournament
import chess.Color
import lila.game.{ Game, PovRef, IdGenerator }
import org.joda.time.DateTime
case class Pairing(
id: String, // game Id
tourId: String,
status: chess.Status,
user1: String,
user2: String,
winner: Option[String],
turns: Option[Int],
berserk1: ... | clarkerubber/lila | modules/tournament/src/main/Pairing.scala | Scala | agpl-3.0 | 2,532 |
// @GENERATOR:play-routes-compiler
// @SOURCE:/media/ajay/D/my_projects/play-silhouette-angular-seed-2/conf/routes
// @DATE:Mon Sep 28 10:26:16 IST 2015
import play.api.mvc.{ QueryStringBindable, PathBindable, Call, JavascriptLiteral }
import play.core.routing.{ HandlerDef, ReverseRouteContext, queryString, dynamicSt... | ajaygeorge91/play-silhouette-neo4j-angular-seed | target/scala-2.11/routes/main/com/tuplejump/playYeoman/ReverseRoutes.scala | Scala | apache-2.0 | 686 |
// Copyright: 2010 - 2016 Rory Graves, Sam Halliday
// License: http://www.apache.org/licenses/LICENSE-2.0
package com.acme
object F@foo@oo {
def ba@bar@r(a@a@: Int): Int = 2
}
| rorygraves/pcplod | pcplod/src/test/resources/com/acme/foo.scala | Scala | apache-2.0 | 181 |
package io.chymyst.jc
import io.chymyst.jc.Macros.{getName, rawTree}
import io.chymyst.test.LogSpec
import org.scalatest.BeforeAndAfterEach
import io.chymyst.test.Common._
import scala.concurrent.duration.DurationInt
import scala.language.postfixOps
class MacrosSpec extends LogSpec with BeforeAndAfterEach {
val wa... | Chymyst/chymyst-core | core/src/test/scala/io/chymyst/jc/MacrosSpec.scala | Scala | apache-2.0 | 41,073 |
package uk.gov.digital.ho.proving.financialstatus.domain
import java.time.LocalDate
import java.time.temporal.ChronoUnit.DAYS
import org.springframework.beans.factory.annotation.{Autowired, Value}
import org.springframework.stereotype.Service
import uk.gov.digital.ho.proving.financialstatus.bank.{BarclaysBankService,... | UKHomeOffice/pttg-fs-api | src/main/scala/uk/gov/digital/ho/proving/financialstatus/domain/AccountStatusChecker.scala | Scala | mit | 2,622 |
/*
* 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 | examples/streaming/kafka/src/test/scala/org/apache/gearpump/streaming/examples/kafka/wordcount/SplitSpec.scala | Scala | apache-2.0 | 1,595 |
/**
* 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 | workflowexecutormqprotocol/src/main/scala/io/deepsense/workflowexecutor/communication/message/global/PoisonPill.scala | Scala | apache-2.0 | 970 |
package model
import skinny.orm.SkinnyJoinTable
case class ProgrammerSkill(programmerId: Long, skillId: Long)
object ProgrammerSkill extends SkinnyJoinTable[ProgrammerSkill] {
override val defaultAlias = createAlias("ps")
}
| BlackPrincess/skinny-framework | example/src/main/scala/model/ProgrammerSkill.scala | Scala | mit | 230 |
package com.twitter.algebird.benchmark
import com.twitter.algebird._
import com.twitter.bijection._
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
import scala.util.Random
object QTreeBenchmark {
@State(Scope.Benchmark)
class QTreeState {
var qtreeUnit: QTreeSemigroup[Unit] = _
... | sid-kap/algebird | algebird-benchmark/src/main/scala/com/twitter/algebird/benchmark/QTreeBenchmark.scala | Scala | apache-2.0 | 2,312 |
package com.recursivity.commons.bean
/**
* Created by IntelliJ IDEA.
* User: wfaler
* Date: Mar 25, 2010
* Time: 11:36:46 PM
* To change this template use File | Settings | File Templates.
*/
class JavaBooleanTransformer extends StringValueTransformer[java.lang.Boolean]{
def toValue(from: String): Option[java.l... | rkpandey/recursivity-commons | src/main/scala/com/recursivity/commons/bean/JavaBooleanTransformer.scala | Scala | bsd-3-clause | 564 |
/*
* Copyright (C) 2017 LREN CHUV for Human Brain Project
*
* This program 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 Foundation, either version 3 of the
* License, or (at your option) any later version... | HBPSP8Repo/workflow | src/main/scala/ch/chuv/lren/woken/service/FeaturesService.scala | Scala | apache-2.0 | 6,924 |
package org.jetbrains.plugins.scala.actions
import com.intellij.openapi.actionSystem._
import org.jetbrains.plugins.scala.components.HighlightingAdvisor
import com.intellij.openapi.project.Project
/**
* User: Alexander Podkhalyuzin
* Date: 27.01.2010
*/
class ToggleTypeAwareHighlightingAction extends AnAction {
... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/actions/ToggleTypeAwareHighlightingAction.scala | Scala | apache-2.0 | 530 |
/*
* 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 ... | yanboliang/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileIndexSuite.scala | Scala | apache-2.0 | 15,337 |
package lila.user
import org.joda.time.DateTime
case class Plan(
months: Int,
active: Boolean,
since: Option[DateTime]
) {
def incMonths =
copy(
months = months + 1,
active = true,
since = since orElse DateTime.now.some
)
def disable = copy(active = false)
def enable =
... | luanlv/lila | modules/user/src/main/Plan.scala | Scala | mit | 768 |
/*
* 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 ... | andrewor14/iolap | sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetTableSupport.scala | Scala | apache-2.0 | 15,151 |
/* Copyright 2009-2015 EPFL, Lausanne */
import leon._
import leon.lang._
import leon.annotation._
object Numerical {
def power(base: BigInt, p: BigInt): BigInt = {
require(p >= BigInt(0))
if (p == BigInt(0)) {
BigInt(1)
} else if (p%BigInt(2) == BigInt(0)) {
power(base*base, p/BigInt(2))
... | epfl-lara/leon | testcases/repair/Numerical/Numerical2.scala | Scala | gpl-3.0 | 1,092 |
package de.fosd.typechef.crefactor.evaluation.evalcases.openSSL
import de.fosd.typechef.crefactor.evaluation.Refactor
object OpenSSLRefactorEvaluation extends OpenSSLEvaluation with Refactor { }
| joliebig/Morpheus | src/main/scala/de/fosd/typechef/crefactor/evaluation/evalcases/openSSL/OpenSSLRefactorEvaluation.scala | Scala | lgpl-3.0 | 197 |
/**
* (C) Copyright IBM Corp. 2015, 2016
*
* 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... | SparkTC/spark-netezza | src/main/scala/com/ibm/spark/netezza/NetezzaInputFormat.scala | Scala | apache-2.0 | 6,840 |
package com.blogspot.nhu313.tictactoe
class Rules {
def isGameOver(board: Board): Boolean = {
return winner(board) != None || board.isFull
}
def winner(board: Board): Option[Marker] = {
val winning_sets = sets(board)
val result = winning_sets.find(x =>
x.forall(marker => marker != Marker.NONE... | nhu313/tic_tac_toe_scala | src/main/scala/tictactoe/Rules.scala | Scala | apache-2.0 | 533 |
import com.datastax.spark.connector.cql.CassandraConnector
import org.apache.spark.SparkConf
import org.joda.time.{DateTime, DateTimeZone}
import org.scalatest._
class ResponseTimeTest extends FlatSpec with BeforeAndAfter with GivenWhenThen with Matchers {
private val master = "local[2]"
private val appName = "spa... | t3g7/spark-streaming-twitter | src/test/scala/ResponseTimeTest.scala | Scala | apache-2.0 | 2,260 |
import java.io.{FileOutputStream, FileInputStream}
import scala.tools.asm.{ClassWriter, Opcodes, ClassReader}
import scala.tools.asm.tree.{InsnNode, ClassNode}
import scala.tools.nsc.backend.jvm.AsmUtils
import scala.tools.partest.DirectTest
import scala.collection.JavaConverters._
/**
* Test that the ICodeReader do... | felixmulder/scala | test/files/run/icode-reader-dead-code.scala | Scala | bsd-3-clause | 2,142 |
package com.seanshubin.uptodate.logic
import java.nio.file.{Path, Paths}
import com.seanshubin.devon.domain.DevonMarshaller
class ConfigurationValidatorImpl(fileSystem: FileSystem,
devonMarshaller: DevonMarshaller) extends ConfigurationValidator {
private val sample = new Configura... | SeanShubin/up-to-date | logic/src/main/scala/com/seanshubin/uptodate/logic/ConfigurationValidatorImpl.scala | Scala | unlicense | 2,315 |
package concrete.constraint.linear
import concrete.constraint.AdviseCount
import concrete.{Assignment, BooleanDomain, Problem, Variable}
import org.scalatest.{FlatSpec, Matchers}
class LinearNeTest extends FlatSpec with Matchers {
"LinearNe" should "not filter" in {
val x_2095 = new Variable("X2095", BooleanDo... | concrete-cp/concrete | src/test/scala/concrete/constraint/linear/LinearNeTest.scala | Scala | lgpl-2.1 | 1,499 |
/*
* Copyright (c) 2012 Yahoo! Inc. All rights reserved. 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... | markusweimer/ScalOps | src/main/scala/com/yahoo/scalops/dsl/types/CompositeType.scala | Scala | apache-2.0 | 745 |
package forcomp
import common._
object Anagrams {
/** A word is simply a `String`. */
type Word = String
/** A sentence is a `List` of words. */
type Sentence = List[Word]
/** `Occurrences` is a `List` of pairs of characters and positive integers saying
* how often the character appears.
* Thi... | samsol/FunProg-scala | forcomp/src/main/scala/forcomp/Anagrams.scala | Scala | agpl-3.0 | 8,577 |
package scala.scalajs.runtime
import scala.scalajs.js
/** Information about link-time configuration of Scala.js. */
@js.native
trait LinkingInfo extends js.Object {
/** Semantics configuration. */
val semantics: LinkingInfo.Semantics = js.native
/** Whether we are assuming ECMAScript 6 support or not. */
val... | CapeSepias/scala-js | library/src/main/scala/scala/scalajs/runtime/LinkingInfo.scala | Scala | bsd-3-clause | 832 |
package com.twitter.finagle.util
import com.twitter.finagle.{Stack, StackBuilder, Stackable, param, stack}
import com.twitter.util.registry.{Entry, GlobalRegistry, SimpleRegistry}
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
case class TestParam(p1: Int) {
def... | spockz/finagle | finagle-core/src/test/scala/com/twitter/finagle/util/StackRegistryTest.scala | Scala | apache-2.0 | 4,341 |
package fpscala.c03
import fpscala.datastructures.{List => FpList, Nil => FpNil}
import org.scalatest.{FlatSpec, Matchers}
class Exercise06Spec extends FlatSpec with Matchers {
"append" should "add new elements to the end of a List" in {
Exercise06.append(6, FpList(1, 2, 3)) should equal(FpList(1, 2, 3, 6))
... | willtaylor/fpscala | src/test/scala/fpscala/c03/Exercise06Spec.scala | Scala | gpl-3.0 | 552 |
import scala.util.Random.nextInt
import scala.sys.error
object Test extends App {
def unreachableNormalExit: Int = {
return 42
0
}
def unreachableIf: Int = {
return 42
if (nextInt() % 2 == 0)
0
else
1
}
def unreachableIfBranches: Int = {
if (nextInt() % 2 == 0)
ret... | lampepfl/dotty | tests/run/unreachable.scala | Scala | apache-2.0 | 2,171 |
package org.openurp.edu.eams
import org.beangle.commons.inject.bind.AbstractBindModule
import org.openurp.edu.base.Course.web.action.CourseAction
import org.openurp.edu.base.Course.web.action.CourseSearchAction
import org.openurp.edu.eams.teach.lesson.helper.LessonSearchHelper
import org.openurp.edu.eams.teach.web.act... | openurp/edu-eams-webapp | web/src/main/scala/org/openurp/edu/eams/TeachWebModule.scala | Scala | gpl-3.0 | 885 |
package scala.meta.internal.semanticdb.scalac
import java.io._
import java.net.URI
import scala.compat.Platform.EOL
import scala.tools.nsc.Phase
import scala.tools.nsc.plugins.PluginComponent
import scala.util.control.NonFatal
import scala.meta.internal.{semanticdb => s}
trait SemanticdbPipeline extends SemanticdbOps... | MasseGuillaume/scalameta | semanticdb/scalac/library/src/main/scala/scala/meta/internal/semanticdb/scalac/SemanticdbPipeline.scala | Scala | bsd-3-clause | 5,753 |
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt.internal.util.codec
import _root_.sjsonnew.{ deserializationError, Builder, JsonFormat, Unbuilder }
import xsbti.Position
import java.util.Optional
trait Positio... | sbt/sbt | internal/util-logging/src/main/scala/sbt/internal/util/codec/PositionFormats.scala | Scala | apache-2.0 | 3,320 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos.spark
import com.azure.cosmos.CosmosException
import com.azure.cosmos.implementation.HttpConstants
import com.azure.cosmos.implementation.HttpConstants.SubStatusCodes
import reactor.core.scala.publi... | Azure/azure-sdk-for-java | sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/Exceptions.scala | Scala | mit | 1,751 |
object p1 {
class B
object B
class C extends java.io.Serializable
object C
type D = DD
object D
}
package object p2 {
class B
object B
class C extends java.io.Serializable
object C
type D = DD
object D
}
class DD extends java.io.Serializable
object Test {
def main(args: Array[String]): U... | martijnhoekstra/scala | test/files/run/SD-290.scala | Scala | apache-2.0 | 864 |
package work.martins.simon.expect.fluent
import work.martins.simon.expect.StringUtils._
import work.martins.simon.expect.{Settings, core}
/**
* @define type Expect
*/
case class Expect[R](command: Seq[String], defaultValue: R, settings: Settings = Settings.fromConfig()) extends Expectable[R] {
def this(command:... | Lasering/scala-expect | src/main/scala/work/martins/simon/expect/fluent/Expect.scala | Scala | mit | 1,738 |
/*
* 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/incubator-toree | kernel/src/test/scala/org/apache/toree/kernel/protocol/v5/handler/ExecuteRequestHandlerSpec.scala | Scala | apache-2.0 | 10,920 |
/*
* AudioNodeImpl.scala
* (Cord)
*
* Copyright (c) 2015-2020 Hanns Holger Rutz.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.cord
package impl
trait AudioNodeIm... | Sciss/Cord | src/main/scala/de/sciss/cord/impl/AudioNodeImpl.scala | Scala | lgpl-2.1 | 828 |
package example
import java.util.NoSuchElementException
object Lists extends App {
/**
* This method computes the sum of all elements in the list xs. There are
* multiple techniques that can be used for implementing this method, and
* you will learn during the class.
*
* For this example assignment ... | giovannidoni/Scala-course-1 | example/src/main/scala/example/Lists.scala | Scala | gpl-3.0 | 1,745 |
/*
* Copyright (C) 2016 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* 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
... | DANS-KNAW/easy-process-sip | src/test/scala/nl.knaw.dans.easy.multideposit/parser/ParserUtilsSpec.scala | Scala | apache-2.0 | 10,237 |
package xscalatest.util
import org.scalatest.Suite
import scala.concurrent.duration._
import scala.concurrent.{Await, Future}
trait FutureValues {
this: Suite =>
val defaultAtMost = 10.seconds
implicit class Rendezvous[A](future: Future[A]) {
/**
* Await and return the result of an `future`.
* @... | nokamoto/scalatest-util | src/main/scala/xscalatest/util/FutureValues.scala | Scala | mit | 455 |
package org.hammerlab.guacamole.reads
import org.hammerlab.guacamole.readsets.{SampleId, SampleName}
/**
* An unmapped read. See the [[Read]] trait for field descriptions.
*
*/
case class UnmappedRead(
name: String,
sequence: IndexedSeq[Byte],
baseQualities: IndexedSeq[Byte],
isDuplicate: Boolean,
... | hammerlab/guacamole | src/main/scala/org/hammerlab/guacamole/reads/UnmappedRead.scala | Scala | apache-2.0 | 544 |
/*
* Copyright (C) 2014 GRNET S.A.
*
* 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 program is distrib... | grnet/snf-vmcatcher | src/main/scala/gr/grnet/egi/vmcatcher/package.scala | Scala | gpl-3.0 | 1,187 |
import scala.tools.nsc.interpreter.IMain
object Test extends App {
val engine = new IMain.Factory getScriptEngine()
engine.asInstanceOf[IMain].settings.usejavacp.value = true
engine put ("n", 10)
engine eval "1 to n.asInstanceOf[Int] foreach print"
}
| som-snytt/dotty | tests/pending/run/t7843-jsr223-service.scala | Scala | apache-2.0 | 260 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009, 2010 Mark Harrah
*/
package xsbt.boot
import scala.collection.immutable.List
import java.io.{File, FileFilter}
import java.net.{URL, URLClassLoader}
object Pre
{
def trimLeading(line: String) =
{
def newStart(i: Int): Int = if(i >= line.length || !Characte... | olove/xsbt | launch/src/main/scala/xsbt/boot/Pre.scala | Scala | bsd-3-clause | 2,870 |
package models.dao
import com.google.inject.ImplementedBy
import models.dao.anorm.AnormUserDAO
final case class User(id: Int, email: String, name: String, password: String)
@ImplementedBy(classOf[AnormUserDAO])
trait UserDAO {
def authenticate(email: String, password: String): Option[User]
def findByEmail(email... | jcranky/lojinha | app/models/dao/User.scala | Scala | gpl-3.0 | 407 |
package dit4c.common
import java.net._
import akka.http.scaladsl._
import akka.stream.scaladsl._
import akka.event.LoggingAdapter
import akka.http.scaladsl.model._
import akka.http.scaladsl.settings.ClientConnectionSettings
import scala.concurrent._
import akka.stream.Client
import akka.http.scaladsl.Http.OutgoingConn... | dit4c/dit4c | dit4c-common/src/main/scala/dit4c/common/AkkaHttpExtras.scala | Scala | mit | 5,105 |
package org.danielnixon.playwarts
object HeadersPartial extends ClassMethodWart(
"play.api.mvc.Headers",
"apply",
"Headers#apply is disabled - use Headers#get instead"
)
| danielnixon/playwarts | core/src/main/scala/org/danielnixon/playwarts/HeadersPartial.scala | Scala | apache-2.0 | 177 |
package controller
import skinny._
import skinny.validator._
import model._
class CompaniesController extends SkinnyResourceWithId[CompanyId] with ApplicationController {
protectFromForgery()
implicit override val scalatraParamsIdTypeConverter = new skinny.TypeConverter[String, CompanyId] {
def apply(s: Stri... | BlackPrincess/skinny-framework | example/src/main/scala/controller/CompaniesController.scala | Scala | mit | 1,381 |
package com.scalapenos.myapp.api
import scala.concurrent.duration._
import akka.actor._
import akka.util.Timeout
import akka.pattern.ask
import spray.routing._
import spray.http.StatusCodes._
import scala.concurrent.ExecutionContext
object ApiActor {
def props = Props[ApiActor]
def name = "api"
}
class ApiAct... | RayRoestenburg/nljug2013 | src/main/scala/com/scalapenos/myapp.api/TestCreateChildrenAfter.scala | Scala | apache-2.0 | 1,723 |
package com.github.ldaniels528.scalascript.extensions
import com.github.ldaniels528.scalascript.Scope
import com.github.ldaniels528.scalascript.core.Provider
import scala.scalajs.js
/**
* \$route is used for deep-linking URLs to controllers and views (HTML partials).
* It watches \$location.url() and tries to map ... | ldaniels528/scalascript | src/main/scala/com/github/ldaniels528/scalascript/extensions/Route.scala | Scala | apache-2.0 | 3,411 |
/*
* Copyright (c) 2014 Paul Bernard
*
* 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... | pmularien/spectrum-old | financial/src/main/scala/org/quantintel/ql/time/calendars/Norway.scala | Scala | apache-2.0 | 2,871 |
package org.jetbrains.plugins.scala
package lang
package formatting
import psi.api.ScalaFile
import settings.ScalaCodeStyleSettings
import com.intellij.lang.ASTNode
import com.intellij.psi.codeStyle.{CommonCodeStyleSettings, CodeStyleSettings}
import com.intellij.openapi.util.TextRange
import org.jetbrains.plugins.sca... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/formatting/ScalaBlock.scala | Scala | apache-2.0 | 7,020 |
package com.versal.fireotter.tests
object Arithmetic {
def add(x: Int, y: Int): Int = x + y
def subtract(x: Int, y: Int): Int = x - y
def multiply(x: Int, y: Int): Int = x * y
def divide(x: Int, y: Int): Int = x / y
}
class ArithmeticTest extends org.scalatest.FunSuite {
import com.versal.fireotter._
va... | Versal/fireotter | src/test/scala/tests.scala | Scala | bsd-2-clause | 885 |
package lesst
import org.mozilla.javascript.{ NativeArray, ScriptableObject }
case class StyleSheet(src: String, imports: List[String])
class ScriptableStyleSheet extends ScriptableObject {
implicit class NativeArrayWrapper(arr: NativeArray) {
def toList[T](f: AnyRef => T): List[T] =
(arr.getIds map { id... | softprops/lesst | src/main/scala/sheets.scala | Scala | mit | 658 |
package im.tox.antox.data
import java.util
import java.util.ArrayList
import android.content.{ContentValues, Context}
import android.database.sqlite.{SQLiteDatabase, SQLiteOpenHelper}
//remove if not needed
class UserDB(ctx: Context) extends SQLiteOpenHelper(ctx, "userdb", null, 1) {
private var CREATE_TABLE_USE... | afkgeek/Antox | app/src/main/scala/im/tox/antox/data/UserDB.scala | Scala | gpl-3.0 | 2,884 |
import com.twitter.finagle.Http.Server
import com.twitter.finagle.http.Request
import com.twitter.finagle.stack.nilStack
import com.twitter.finagle.stats.NullStatsReceiver
import com.twitter.finatra.http.filters.HttpResponseFilter
import com.twitter.finatra.http.routing.HttpRouter
import com.twitter.finatra.http.{Contr... | actframework/FrameworkBenchmarks | frameworks/Scala/finatra/src/main/scala/Main.scala | Scala | bsd-3-clause | 997 |
package ru.maizy.cheesecake.server.endpointmanager
/**
* Copyright (c) Nikita Kovaliov, maizy.ru, 2016
* See LICENSE.txt for details.
*/
import scala.concurrent.Future
import scala.concurrent.duration._
import akka.actor.{ ActorRef, Props }
import akka.event.LoggingReceive
import akka.pattern.{ ask, pipe }
import ... | maizy/cheesecake | server/src/main/scala/ru/maizy/cheesecake/server/endpointmanager/HttpEndpointManagerActor.scala | Scala | apache-2.0 | 1,757 |
package im.actor.server.user
import akka.pattern.pipe
import im.actor.api.rpc.users.{ User ⇒ ApiUser }
import im.actor.server.api.ApiConversions._
import im.actor.server.util.{ ACLUtils, UserUtils }
import im.actor.server.{ persist ⇒ p }
private[user] trait UserQueriesHandlers {
self: UserProcessor ⇒
import Use... | darioajr/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/user/UserQueriesHandlers.scala | Scala | mit | 1,411 |
package systems.adaptix.bling.tags
import org.specs2.mutable.Specification
import scala.collection.mutable
/**
* Created by nkashyap on 5/18/15.
*/
class TagDagSpecification extends Specification {
"A TagDag is instantiated with a tag which represents universal context. This means that every data point is, if not... | nkashy1/bling | src/test/scala/systems/adaptix/bling/tags/TagDagSpecification.scala | Scala | mit | 13,764 |
package scalax.hash
import org.scalameter.api._
import scodec.bits.ByteVector
object CRC32Regression extends PerformanceTest.OfflineRegressionReport with CRC32 {
val sizes = Gen.range("megabyte")(2,16,2)
val streams = for (size <- sizes) yield
Stream.fill(size)(ByteVector.view(Random.MB))
performance of "... | wookietreiber/scala-hash | core/it/scala/CRC32Regression.scala | Scala | bsd-2-clause | 653 |
/*
* 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 | foundation/src/main/scala/quasar/contrib/scalaz/MonadListen_.scala | Scala | apache-2.0 | 2,340 |
/*
* 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 ... | akopich/spark | core/src/main/scala/org/apache/spark/scheduler/cluster/StandaloneSchedulerBackend.scala | Scala | apache-2.0 | 8,780 |
package models
import java.util.UUID
import play.api.libs.json.{ Json, OFormat }
case class TwilioFax(
userID: UUID,
claimID: UUID,
claimSubmissionID: UUID,
dateCreated: java.util.Date,
dateUpdated: java.util.Date,
to: String,
from: String,
twilioFaxId: String,
status: String) {
}
object TwilioFa... | vetafi/vetafi-web | app/models/TwilioFax.scala | Scala | apache-2.0 | 397 |
/***********************************************************************
* Copyright (c) 2013-2016 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is ... | MutahirKazmi/geomesa | geomesa-hbase/geomesa-hbase-tools/src/main/scala/org/locationtech/geomesa/hbase/tools/stats/HBaseStatsHistogramCommand.scala | Scala | apache-2.0 | 1,188 |
package com.sksamuel.elastic4s.requests.searches.aggs
import com.sksamuel.elastic4s.requests.script.Script
import com.sksamuel.elastic4s.requests.searches.aggs.pipeline.PipelineAgg
import com.sksamuel.elastic4s.ext.OptionImplicits._
case class WeightedAvgAggregation(
name: String,
... | sksamuel/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/aggs/WeightedAvgAggregation.scala | Scala | apache-2.0 | 1,291 |
package com.tristanpenman.chordial.dht
final case class SeedNode(hostname: String, port: Int)
| tristanpenman/chordial | modules/dht/src/main/scala/com/tristanpenman/chordial/dht/SeedNode.scala | Scala | bsd-3-clause | 95 |
Subsets and Splits
Filtered Scala Code Snippets
The query filters and retrieves a sample of code snippets that meet specific criteria, providing a basic overview of the dataset's content without revealing deeper insights.