code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
/*
* Copyright (C) 2017 The Proteus 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 applicable law ... | aagea/peach | peach-server/src/test/scala/com/proteus/peach/server/cache/ExternalCacheValidator.scala | Scala | apache-2.0 | 3,109 |
/*
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... | Cascading/scalding-tutorial | src/main/scala/tutorial/Tutorial6.scala | Scala | apache-2.0 | 1,605 |
package controllers
import play.api._
import play.api.mvc._
import securesocial.core.SecureSocial
object Application extends Controller with SecureSocial {
def index = SecuredAction {
Ok(views.html.main())
}
def login = Action {
Ok(views.html.authentication.login())
}
def postLogin = Action { req... | mikegirkin/papersheet | src/app/controllers/Application.scala | Scala | mit | 342 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package scalaguide.tests.guice
import java.io.File
import java.net.URLClassLoader
import play.api.{ Configuration, Environment, Mode }
import play.api.test._
// #builder-imports
import play.api.inject.guice.GuiceApplicationBuilder
// #builde... | aradchykov/playframework | documentation/manual/working/scalaGuide/main/tests/code/tests/guice/ScalaGuiceApplicationBuilderSpec.scala | Scala | apache-2.0 | 5,144 |
/*
* Copyright 2015 ligaDATA
*
* 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 ... | traytonwhite/Kamanja | trunk/Pmml/PmmlCompiler/src/main/scala/com/ligadata/pmml/transforms/xmltoraw/common/TransformationDictionaryNodes.scala | Scala | apache-2.0 | 6,684 |
package org.somelightprojections.skeres
import com.google.ceres.{NumericDiffMethodType, NumericDiffOptions}
import org.somelightprojections.skeres
import spire.implicits._
import spire.math._
/**
* A CostFunction with Jacobians computed via numeric (a.k.a. finite) differentiation.
* For more details on numerical ... | fgcallari/skeres | core/src/main/scala/org/somelightprojections/skeres/NumericDiffCostFunction.scala | Scala | bsd-3-clause | 6,328 |
/**
* Copyright 2013-2015, AlwaysResolve Project (alwaysresolve.org), MOYD.CO LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | Moydco/AlwaysResolveDNS | src/main/scala/records/NSEC.scala | Scala | apache-2.0 | 1,673 |
package roles
import models.{Inventory, Parts}
import org.joda.time.DateTime
import scalikejdbc.async.AsyncDBSession
import scala.concurrent.Future
trait DeletedParts {
this: Parts =>
def deleteInventories(deletedAt: DateTime)(implicit s: AsyncDBSession): Future[Int] =
Inventory.destroyAllByPartsId(id, del... | KIWIKIGMBH/kiwierp | kiwierp-backend/app/roles/DeletedParts.scala | Scala | mpl-2.0 | 443 |
package com.incra.spark
import org.apache.log4j.{Level, Logger}
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.optimization.{L1Updater, SimpleUpdater, SquaredL2Updater}
import org.apache.spark.mllib.regression.LinearRegressionWithSGD
import org.apache.spark.mllib.util.MLUtils
import org.apa... | suryavanshi/Spark-MLlib-Example | src/main/scala/com/incra/spark/LinearRegression.scala | Scala | apache-2.0 | 4,084 |
/*
* 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 ... | bravo-zhang/spark | mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala | Scala | apache-2.0 | 11,182 |
/*
* 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 ... | mike0sv/spark | mllib/src/main/scala/org/apache/spark/ml/tree/impl/TreePoint.scala | Scala | apache-2.0 | 5,272 |
package eu.inn.binders.naming
trait IdentifierBuilder {
def regular(c: Char)
def divider()
def toString(): String
}
| InnovaCo/binders | src/main/scala/eu/inn/binders/naming/IdentifierBuilder.scala | Scala | bsd-3-clause | 125 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/enhancement/enhancements/EfficientMetamagicsI.scala | Scala | apache-2.0 | 1,395 |
/*
* -------------------------------------------------------------------------------------------------
* - Project: Objectify -
* - Copyright: ©2014 Matygo Educational Incorporated operating as Learndot -
* - Author: ... | learndot/Objectify.scala | src/test/scala/org/objectify/policies/BadPolicy.scala | Scala | mit | 731 |
package threesixty.data.metadata
import org.scalatest.FlatSpec
/**
* @author Thomas Engel
*/
class ScalingTestSpec extends FlatSpec {
"A Scaling" should "deduce the default scaling for input data" in {
assertResult(Scaling.Nominal) {Scaling.deduce(null)}
}
}
| elordin/threesixty | src/test/scala/threesixty/metadata/ScalingTest.scala | Scala | mit | 283 |
package org.scalaide.ui.internal.preferences
import java.io.FileInputStream
import java.io.FileOutputStream
import java.io.IOException
import java.net.URL
import java.util.HashMap
import java.util.Properties
import net.miginfocom.layout._
import net.miginfocom.swt.MigLayout
import org.eclipse.core.resources.IProject
i... | Kwestor/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/internal/preferences/FormatterPreferencePage.scala | Scala | bsd-3-clause | 16,038 |
/**
* Copyright 2013 ScalaNLP
*
* 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 ... | math4youbyusgroupillinois/junto | src/main/scala/junto/JuntoContext.scala | Scala | apache-2.0 | 4,228 |
package org.repwatch.models
import scala.collection.immutable.HashSet
object State {
val States = HashSet("AL",
"AK",
"AZ",
"AR",
"CA",
"CO",
"CT",
"DE",
"DC",
"FL",
"GA",
"HI",
"ID",
"IL",
"IN",
"IA",
"KS",
"KY",
"LA",
"ME",
"MD",
... | csunwold/repwatch | domain/src/main/scala/org/repwatch/models/State.scala | Scala | gpl-3.0 | 790 |
/*
* 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 ... | agoncharuk/ignite | examples/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarExamplesSelfTest.scala | Scala | apache-2.0 | 2,754 |
package com.googlecode.avro.runtime
trait HasCollectionBuilders {
implicit def scala$collection$BitSetFactory = new BuilderFactory[Int, scala.collection.BitSet] {
def newBuilder = scala.collection.BitSet.newBuilder
}
implicit def scala$collection$IndexedSeqFactory[E] = new BuilderFactory[E, scala.collection.I... | amanjpro/piuma | avro/src/main/scala/runtime/BuilderFactories.scala | Scala | bsd-3-clause | 10,168 |
/*
* Copyright 2014 Groupon.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 applicable law or agreed to ... | ModMountain/sbt-typescript | src/sbt-test/sbt-typescript-plugin/error-output-issue-8/project/TestBuild.scala | Scala | apache-2.0 | 1,676 |
/*
* FOLUnificationAlgorithmTest.scala
*
*/
package at.logic.gapt.expr.fol
import at.logic.gapt.expr._
import org.specs2.mutable._
class FOLUnificationAlgorithmTest extends Specification {
"UnificationBasedFOLMatchingAlgorithm" should {
"match correctly the lambda expressions f(x1, x2, c) and f(a,b,c)" in ... | loewenheim/gapt | src/test/scala/at/logic/gapt/expr/fol/FOLUnificationAlgorithmTest.scala | Scala | gpl-3.0 | 632 |
package view
import util.StringUtil
import util.ControlUtil._
import util.Directory._
import org.parboiled.common.StringUtils
import org.pegdown._
import org.pegdown.ast._
import org.pegdown.LinkRenderer.Rendering
import java.text.Normalizer
import java.util.Locale
import scala.collection.JavaConverters._
import servi... | alexpriem/gitbucket | src/main/scala/view/Markdown.scala | Scala | apache-2.0 | 5,321 |
/*
* Copyright (c) 2014, ARM Limited
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publis... | carpproject/pencil | example/Example.scala | Scala | mit | 4,799 |
package com.bryanjswift
import java.util.logging.{Level,Logger}
import org.apache.velocity.runtime.{RuntimeServices => Services}
import org.apache.velocity.runtime.log.LogChute
class VelocityLog extends LogChute {
private val logger = Logger.getLogger(getClass().getName())
def init(services:Services) = { }
def ... | bryanjswift/bryanjswift.com | src/main/scala/VelocityLog.scala | Scala | mit | 844 |
/*
* Copyright (C) 2011 Romain Reuillon
*
* 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 di... | ISCPIF/PSEExperiments | openmole-src/openmole/plugins/org.openmole.plugin.tool.sftpserver/src/main/scala/org/openmole/plugin/tool/sftpserver/SFTPServer.scala | Scala | agpl-3.0 | 2,558 |
/*
* 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 ... | fanyon/flink | flink-scala/src/main/scala/org/apache/flink/api/scala/typeutils/OptionSerializer.scala | Scala | apache-2.0 | 4,855 |
/*
* 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 ... | starpit/openwhisk | core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/LocalEntitlement.scala | Scala | apache-2.0 | 3,620 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package toplevel
package typedef
import com.intellij.openapi.progress.ProgressManager
import com.intellij.psi._
import com.intellij.psi.impl.light.LightMethod
import com.intellij.psi.scope.{ElementClassHint, NameHint, PsiScopeProcessor}
import c... | igrocki/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/toplevel/typedef/TypeDefinitionMembers.scala | Scala | apache-2.0 | 43,626 |
package sangria.parser
import language.postfixOps
import sangria.ast.AstLocation
import sangria.ast
import sangria.ast._
import sangria.util.{FileUtil, StringMatchers}
import scala.reflect.ClassTag
import scala.util.{Success, Try}
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec... | sangria-graphql/sangria | modules/parser/src/test/scala/sangria/parser/QueryParserSpec.scala | Scala | apache-2.0 | 86,611 |
/**
* My solution to problem 7 of Project Euler.
* <p>
* The new code that I wrote for this problem is mostly in the new
* implementation of the Sieve of Erasthones. For small values of
* <em>N</em>, this file worked already even with my old implementation
* of the Sieve.
*
* @author Joe Carnahan (joseph.carna... | joecarnahan/projecteuler | src/main/scala/007.scala | Scala | mit | 689 |
package com.azavea.keras
import com.azavea.keras.config.ProcessConf
import geotrellis.spark.io.s3.S3InputFormat
import geotrellis.spark.util.SparkUtils
import org.apache.spark.SparkConf
object Main {
def main(args: Array[String]): Unit = {
implicit val sc = SparkUtils.createSparkContext("GeoTrellis ETL Keras ... | pomadchin/geotrellis-keras-segmentation | generators/src/main/scala/com/azavea/keras/Main.scala | Scala | apache-2.0 | 729 |
package pl.writeonly.son2.text.creators
import pl.writeonly.son2.apis.config.{Action, Format, RWTConfig, TConfig}
import pl.writeonly.son2.apis.pcreators.PCreatorConfig
import pl.writeonly.son2.text.core.{Actions, FormatsText}
import pl.writeonly.scalaops.pipe.Pipe._
class PCreatorConfigText extends PCreatorConfig {
... | writeonly/son2 | scallions-impl/scallions-text/src/main/scala/pl/writeonly/son2/text/creators/PCreatorConfigText.scala | Scala | apache-2.0 | 1,428 |
package lila.api
import play.api.libs.json._
import lila.common.PimpedJson._
import lila.db.api._
import lila.db.Implicits._
import lila.game.GameRepo
import lila.hub.actorApi.{ router => R }
import lila.rating.Perf
import lila.user.tube.userTube
import lila.user.{ UserRepo, User, Perfs, Profile }
import makeTimeout.... | abougouffa/lila | modules/api/src/main/UserApi.scala | Scala | mit | 3,729 |
package com.peterpotts.interview
import org.scalatest.mock.MockitoSugar
import org.scalatest.{Matchers, WordSpec}
class ConnectionPoolTest extends WordSpec with Matchers with MockitoSugar {
"A connection pool" should {
"reuse connections" in {
val factory = new ConnectionFactory
val pool = new Conne... | peterpotts/interview | src/test/scala/com/peterpotts/interview/ConnectionPoolTest.scala | Scala | mit | 883 |
import scala.util.{Failure, Success}
import sangria.execution.deferred.DeferredResolver
import sangria.execution.{ErrorWithResolver, Executor, QueryAnalysisError}
import sangria.slowlog.SlowLog
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.StatusCodes._
import akka.http.sc... | sangria-graphql/sangria-akka-http-example | src/main/scala/Server.scala | Scala | apache-2.0 | 2,133 |
package cluster
import java.io.FileWriter
//import cluster.LDANewsClustering.nDropMostCommon
import org.apache.spark.ml.clustering.LDA
import org.apache.spark.ml.feature._
import org.apache.spark.ml.linalg.{DenseVector, SparseVector, Vector, Vectors}
import org.apache.spark.sql.functions._
import org.apache.spark.sql... | rockiey/explore-spark | src/main/scala/cluster/LDANewsClusteringLessFeature.scala | Scala | mit | 8,621 |
package com.realizationtime.btdogg.scraping
import akka.NotUsed
import akka.actor.ActorRef
import akka.stream.scaladsl.Flow
import akka.util.Timeout
import com.realizationtime.btdogg.BtDoggConfiguration.HashSourcesConfig.nodesCount
import com.realizationtime.btdogg.BtDoggConfiguration.RedisConfig
import com.realizatio... | bwrega/btdogg | src/main/scala/com/realizationtime/btdogg/scraping/ScrapingProcess.scala | Scala | mit | 2,578 |
/**
* 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... | Parth-Brahmbhatt/kafka | core/src/main/scala/kafka/log/Log.scala | Scala | apache-2.0 | 32,999 |
/*
* scala-swing (https://www.scala-lang.org)
*
* Copyright EPFL, Lightbend, Inc., contributors
*
* 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... | scala/scala-swing | src/main/scala/scala/swing/event/ComponentEvent.scala | Scala | apache-2.0 | 407 |
/*
* 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 | external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/DB2IntegrationSuite.scala | Scala | apache-2.0 | 5,906 |
package vtpassim
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions.{broadcast, regexp_extract, udf}
import collection.JavaConversions._
import scala.util.Try
import vtpassim.pageinfo._
case class AltoInfo(text: String, pages: Array[Page])
case class MetaInfo(issue: String, series: String... | ViralTexts/vt-passim | src/main/scala/MetsAltoDDD.scala | Scala | apache-2.0 | 2,244 |
package com.twitter.finatra.kafkastreams.transformer.stores
import com.twitter.finatra.kafkastreams.test.KafkaTestUtil
import com.twitter.finatra.kafkastreams.transformer.domain.{Expire, Time, TimerMetadata}
import com.twitter.finatra.kafkastreams.transformer.stores.internal.{
FinatraKeyValueStoreImpl,
Timer
}
imp... | twitter/finatra | kafka-streams/kafka-streams/src/test/scala/com/twitter/finatra/kafkastreams/transformer/stores/PersistentTimerStoreTest.scala | Scala | apache-2.0 | 5,530 |
package scalaprops
import scalaz._
import ScalapropsScalaz._
abstract class Gen1[F[_]] { self =>
def gen1[A: Gen]: Gen[F[A]]
final def mapF[G[_]](f: F ~> G): Gen1[G] =
new Gen1[G] {
def gen1[A: Gen]: Gen[G[A]] =
self.gen1[A].map(f.apply)
}
}
object Gen1 {
@inline def apply[F[_]](implici... | scalaprops/scalaprops | scalaz/src/test/scala/scalaprops/Gen1.scala | Scala | mit | 1,501 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package base
package patterns
import com.intellij.lang.ASTNode
import com.intellij.psi._
import com.intellij.psi.scope.PsiScopeProcessor
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.extensions._
import org.jetbrain... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/base/patterns/ScReferencePatternImpl.scala | Scala | apache-2.0 | 4,169 |
/*
* Copyright (c) 2011, Daniel Spiewak
* 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 cond... | djspiewak/anti-xml | src/main/scala/com/codecommit/antixml/Selectable.scala | Scala | bsd-3-clause | 10,022 |
/*
* Copyright (c) 2015. Gaëtan La Marca
*
* 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... | glamarca/cuam | app/models/entity/fileStorage/DocumentUser.scala | Scala | apache-2.0 | 1,218 |
package grammarcomp
package grammar
import CFGrammar._
import EBNFGrammar._
import scala.io.StdIn
object GrammarReaders {
/**
* Reads a grammar from the console
*/
def readFromConsole: BNFGrammar[String] = {
println("Enter Rules in the format given by the regex: ([a-zA-Z] -> [a-zA-Z]+ \\n)+")
val ... | epfl-lara/GrammarComparison | src/main/scala/grammarcomp/grammar/GrammarReaders.scala | Scala | mit | 1,946 |
package com.duffmanstudios.memory
/**
* Represents a single playing card in the game.
*
* @author Iain Duff
* @param Id The ID used to identify whether this card matches another
*/
class Card(val Id: Int) {
override def equals(other: Any): Boolean = {
other.isInstanceOf[Card] &&
other.asInstanceOf[Ca... | iainduff91/memory-backend | src/main/java/com/duffmanstudios/memory/Card.scala | Scala | gpl-2.0 | 344 |
/**
* Magmanics Licensing. This web application allows for centralized control
* of client application activation, with optional configuration parameters
* to control licensable features, and storage of supplementary information
* about the client machine. Client applications may interface with this
* central serv... | manicmonkey/licensing | Auditing/src/test/scala/com/magmanics/auditing/dao/AuditDaoJPATest.scala | Scala | gpl-3.0 | 2,273 |
package mesosphere.marathon.core.task.jobs.impl
import akka.actor._
import akka.testkit.TestProbe
import mesosphere.marathon
import mesosphere.marathon.core.base.ConstantClock
import mesosphere.marathon.core.task.{ TaskStateOp, Task }
import mesosphere.marathon.core.task.tracker.{ TaskReservationTimeoutHandler, TaskTr... | vivekjuneja/marathon | src/test/scala/mesosphere/marathon/core/task/jobs/impl/OverdueTasksActorTest.scala | Scala | apache-2.0 | 7,851 |
/*
Copyright 2015 Mate1 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 writ... | mate1/kafka-avro-tools | src/test/scala/com/mate1/kafka/avro/KafkaAvroBatchConsumerSpec.scala | Scala | apache-2.0 | 3,425 |
package io.getquill.norm
import io.getquill.ReturnAction.{ ReturnColumns, ReturnRecord }
import io.getquill._
import io.getquill.ast.Renameable.ByStrategy
import io.getquill.ast.Visibility.Visible
import io.getquill.ast._
import io.getquill.context.Expand
import io.getquill.quat._
class ExpandReturningSpec extends Sp... | getquill/quill | quill-core/src/test/scala/io/getquill/norm/ExpandReturningSpec.scala | Scala | apache-2.0 | 7,137 |
package lila.history
import lila.rating.PerfType
import org.joda.time.{ Days, DateTime }
case class History(
standard: RatingsMap,
chess960: RatingsMap,
kingOfTheHill: RatingsMap,
antichess: RatingsMap,
threeCheck: RatingsMap,
atomic: RatingsMap,
horde: RatingsMap,
bullet: RatingsMap,
... | abougouffa/lila | modules/history/src/main/History.scala | Scala | mit | 2,309 |
package services.jwt.authenticator
import exception.InvalidJwtTokenException
import models.User
import org.mockito.Mockito._
import org.scalatest.mock.MockitoSugar
import org.scalatestplus.play.PlaySpec
import play.api.Configuration
import scala.util.{Failure, Success}
class AuthentikatJwtAuthenticatorTimeoutTest ex... | GMadorell/play-jwt | test/services/jwt/authenticator/AuthentikatJwtAuthenticatorTimeoutTest.scala | Scala | mit | 1,829 |
import scala.reflect.runtime.universe._
import scala.reflect.macros.blackbox.Context
object Impls {
def impl(c: Context)(meth: String) = {
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(meth))))
c.Expr[Unit](body)
}
def fooNul... | lampepfl/dotty | tests/disabled/macro/run/macro-expand-nullary-nongeneric/Impls_1.scala | Scala | apache-2.0 | 549 |
/*
* 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 ... | WindCanDie/spark | sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala | Scala | apache-2.0 | 29,245 |
/*
* 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/main/scala/rx/oanda/trades/Trade.scala | Scala | apache-2.0 | 1,082 |
package monadasync
import MonadAsync.syntax._
import scala.concurrent.duration.Duration
import scalaz._
import scalaz.syntax.monad._
object Retry {
abstract class RetryOps[F[_]: MonadAsync: Monad, L, A](self: F[A]) {
/**
* Retries this F if it fails, once for each element in `delays`,
* each retry d... | lukiano/monadasync | scalaz/src/main/scala/monadasync/Retry.scala | Scala | apache-2.0 | 2,501 |
package com.twitter.finagle.naming
package buoyant
import com.twitter.finagle._
import com.twitter.finagle.buoyant.Dst
import com.twitter.finagle.factory.ServiceFactoryCache
import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver}
import com.twitter.finagle.tracing.Trace
import com.twitter.util.{Activity, D... | denverwilliams/linkerd | router/core/src/main/scala/com/twitter/finagle/naming/buoyant/DynBoundFactory.scala | Scala | apache-2.0 | 3,961 |
package pl.tk.scalaconstructs.streamsprimes
object Primes {
def isPrime(number:Integer) : Boolean = {
if(number==0) false
else if(number==1) true
else (2 to Math.sqrt(number.toDouble).toInt).forall(number % _ != 0)
}
def getPrimes : Stream[(Int,Boolean)] = {
Stream.from(0).map(x=> (x,... | almendar/scala-constructs-learn | src/main/scala/pl/tk/scalaconstructs/streamsprimes/Primes.scala | Scala | apache-2.0 | 350 |
package utils
import app.ConfigProperties._
import models.domain._
import utils.C3Encryption._
object ClaimEncryption {
def saveForLaterKey = getStringProperty("saveForLater.uuid.secret.key")
def encryptUuid(uuid:String):String=XorEncryption.encryptUuid(uuid, saveForLaterKey)
def decryptUuid(encuuid:String):St... | Department-for-Work-and-Pensions/ClaimCapture | c3/app/utils/ClaimEncryption.scala | Scala | mit | 15,257 |
import sbt._
import Keys._
import com.typesafe.sbt.SbtScalariform.{ ScalariformKeys => sr, _ }
object Formatting {
lazy val BuildConfig = config("build") extend Compile
lazy val BuildSbtConfig = config("buildsbt") extend Compile
lazy val settings: Seq[Setting[_]] = Seq() ++ scalariformSettings ++ prefs
lazy v... | jkinkead/sbt | project/Formatting.scala | Scala | bsd-3-clause | 1,204 |
package org.igye.jfxutils.properties
import javafx.collections.ObservableList
class SyncronizableList[E] extends SyncronizableListJ[E] {
def <==[S](sourceList: ObservableList[S], targetElemConstructor: S => E, targetElemDestructor: E => Unit = null): Unit = {
unbind()
bind(sourceList, ListOperators.createLi... | Igorocky/jfxutils | src/main/scala/org/igye/jfxutils/properties/SyncronizableList.scala | Scala | mit | 391 |
package io.clouderite.commons.scala.berries.json
import java.nio.file.{Path, Paths}
import java.time.Instant
import spray.json.{DeserializationException, JsFalse, JsNumber, JsString, JsTrue, JsValue, RootJsonFormat}
object StandardJsonProtocol {
implicit val instantJson = InstantJsonFormat
implicit val pathJson ... | clouderite/scala-berries | src/main/scala/io/clouderite/commons/scala/berries/json/StandardJsonProtocol.scala | Scala | mit | 1,980 |
package scalaprops
package scalazlaws
import scalaz._
import Property.forAll
object profunctor {
def identity[F[_, _], A1, A2](implicit F: Profunctor[F], G: Gen[F[A1, A2]], E: Equal[F[A1, A2]]): Property =
forAll(F.profunctorLaw.identity[A1, A2] _)
def composite[F[_, _], A1: Gen, A2: Gen: Cogen, A3: Cogen, A... | scalaprops/scalaprops | scalaz/src/main/scala/scalaprops/scalazlaws/profunctor.scala | Scala | mit | 1,232 |
package safe.dsp
import safe.SafeVector
import breeze.linalg.{ DenseVector, Vector }
import breeze.math.Complex
import scala.math._
import scala.reflect.ClassTag
/**
* Module for Fast Fourier Transform functions.
*/
object FFT {
/** Compute a forward FFT on a 1-dimensional real data sequence */
def fft(data: S... | devonbryant/safe | safe-core/src/main/scala/safe/dsp/FFT.scala | Scala | epl-1.0 | 6,340 |
import sbt._
import sbt.Keys._
import sbtrelease.ReleasePlugin.autoImport._
import sbtrelease.ReleaseStateTransformations._
import bintray.BintrayKeys._
object Publishing {
val PublishSettings = Seq(
autoAPIMappings := true,
bintrayOrganization := Some("tapad-oss"),
pomIncludeRepository := { _ => false ... | Tapad/sbt-marathon | project/Publishing.scala | Scala | bsd-3-clause | 2,831 |
/*
* This file is part of Kiama.
*
* Copyright (C) 2013-2015 Anthony M Sloane, Macquarie University.
*
* Kiama 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 3 of the License, or ... | seanjensengrey/kiama | core/src/org/kiama/util/Memoiser.scala | Scala | gpl-3.0 | 3,580 |
/*
* The MIT License
*
* Copyright (c) 2016 Fulcrum Genomics LLC
*
* 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 us... | fulcrumgenomics/fgbio | src/test/scala/com/fulcrumgenomics/bam/FilterBamTest.scala | Scala | mit | 9,515 |
/*
* 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 ... | MLnick/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/InferFiltersFromConstraintsSuite.scala | Scala | apache-2.0 | 10,045 |
package org.scalacoin.marshallers
/**
* Created by chris on 2/18/16.
*/
trait RawBitcoinSerializerHelper {
/**
* Adds the amount padding bytes needed to fix the size of the hex string
* for instance, vouts are required to be 4 bytes. If the number is just 1
* it will only take 1 byte. We need to pad the ... | TomMcCabe/scalacoin | src/main/scala/org/scalacoin/marshallers/RawBitcoinSerializerHelper.scala | Scala | mit | 1,020 |
import org.scalacheck._
import Prop._
import Gen._
object PrimitiveEqEqTest extends Properties("==") {
def equalObjectsEqualHashcodes(x: Any, y: Any) = (x != y) || (x == y && x.## == y.##)
// ticket #2087
property("short/char") = forAll { (x: Short) => {
val ch: Char = x.toChar
(x == ch) == (ch == x... | shimib/scala | test/scalacheck/primitive-eqeq.scala | Scala | bsd-3-clause | 1,139 |
/***********************************************************************
* 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... | jahhulbert-ccri/geomesa | geomesa-hbase/geomesa-hbase-tools/src/main/scala/org/locationtech/geomesa/hbase/tools/ingest/HBaseIngestCommand.scala | Scala | apache-2.0 | 1,925 |
package poly.macroutil
import scala.language.experimental.macros
import scala.reflect.macros.blackbox._
/**
* @author Tongfei Chen (ctongfei@gmail.com).
*/
object MapReduceOps {
def bySemigroup[T](n: Int, f: Int => T, op: (T, T) => T): T = macro bySemigroupImpl[T]
def byMonoid[T](n: Int, f: Int => T, z: T, op... | ctongfei/poly-macroutil | src/main/scala/poly/macroutil/MapReduceOps.scala | Scala | mit | 2,346 |
/*
* 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 ... | ueshin/apache-flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/nodes/logical/FlinkLogicalRel.scala | Scala | apache-2.0 | 1,026 |
package io.skysail.api.metrics
trait Stoppable {
def stop()
}
trait Markable {
def mark()
}
sealed trait Metric
case class CounterMetric(cls: Class[_], identifier: String) extends Metric
case class HistogramMetric(cls: Class[_], identifier: String) extends Metric
case class MeterMetric(identifier: String) exten... | evandor/skysail-server | skysail.api/src/io/skysail/api/metrics/Metric.scala | Scala | apache-2.0 | 577 |
package upickle
import utest._
import acyclic.file
/**
* Created by haoyi on 4/22/14.
*/
object TestUtil extends TestUtil[upickle.default.type](upickle.default)
object LegacyTestUtil extends TestUtil[upickle.legacy.type](upickle.legacy)
class TestUtil[Api <: upickle.Api](api: Api){
import api._
def rw[T: Reader: Wr... | Voltir/upickle | upickle/shared/src/test/scala/upickle/TestUtil.scala | Scala | mit | 764 |
/**
* 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... | kavink92/kafka-0.8.0-beta1-src | core/src/main/scala/kafka/controller/PartitionStateMachine.scala | Scala | apache-2.0 | 23,897 |
/*
* Copyright (c) 2018. Fengguo Wei and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0
* which accompanies this distribution, and is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* Detailed contributors ar... | arguslab/Argus-SAF | jawa/src/main/scala/org/argus/jawa/core/compiler/lexer/WhitespaceAndCommentsGrouper.scala | Scala | apache-2.0 | 1,908 |
package views.vrm_retention
import composition.TestHarness
import org.scalatest.selenium.WebBrowser.{currentUrl, go}
import pages.vrm_retention.PrivacyPolicyPage
import uk.gov.dvla.vehicles.presentation.common.testhelpers.{UiSpec, UiTag}
class PrivacyPolicyUiSpec extends UiSpec with TestHarness {
"go to page" shou... | dvla/vrm-retention-online | test/views/vrm_retention/PrivacyPolicyUiSpec.scala | Scala | mit | 490 |
package com.git.huanghaifeng.spark.basic
import scala.collection.JavaConverters._
import org.apache.spark.util.Utils
object BasicSystemProperties {
def main(args: Array[String]): Unit = {
println("Environment variables containing SPARK_TEST:")
val env = System.getenv()
env.asScala.foreach(... | prucehuang/quickly-start-spark | src/main/scala/com/git/huanghaifeng/spark/basic/BasicSystemProperties.scala | Scala | apache-2.0 | 896 |
package lila.setup
import chess.{ Mode, Clock }
import lila.rating.RatingRange
import lila.game.{ Game, Player, Source }
import lila.lobby.Color
import lila.rating.RatingRange
private[setup] case object ApiConfig extends Config with GameGenerator {
val color = Color.White
val variant = chess.variant.Standard
v... | Enigmahack/lila | modules/setup/src/main/ApiConfig.scala | Scala | mit | 627 |
/*
* Copyright 2016 Johannes Rudolph
*
* 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 applicab... | jrudolph/sbt-dependency-graph | src/main/scala/net/virtualvoid/sbt/graph/rendering/Statistics.scala | Scala | apache-2.0 | 2,804 |
package com.felixmilea.vorbit.reddit.connectivity
object Nodes {
val login = "api/login"
val hot = "hot.json"
val me = "api/me.json"
} | felixmc/Felix-Milea-Ciobanu-Vorbit | code/com/felixmilea/vorbit/reddit/connectivity/Nodes.scala | Scala | mit | 143 |
/*
* Copyright © 2018 Full 360 Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish,... | full360/prometheus_client_scala | client-akka/src/main/scala/com/full360/prometheus/http/akka/AkkaHttpHistogram.scala | Scala | mit | 2,161 |
/**
* 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... | confluentinc/kafka-deprecated-fork | core/src/main/scala/kafka/log/LogCleaner.scala | Scala | apache-2.0 | 29,112 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/HalflingBravery.scala | Scala | apache-2.0 | 1,176 |
import scala.collection.mutable.Queue
object main extends App {
/*
* Mutable Queue
*/
val queue = new Queue[String]
// Appending a single element
queue += "a"
// Appending multiple elements
queue ++= List("b", "c")
// Appending a single element again
queue += "d"
// Operations on the queue
pri... | arcyfelix/Courses | 18-10-18-Programming-in-Scala-by-Martin-Odersky-Lex-Spoon-and-Bill-Venners/65-MutableQueues/src/main.scala | Scala | apache-2.0 | 428 |
/*
* 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 ... | rezasafi/spark | external/kafka-0-10/src/test/scala/org/apache/spark/streaming/kafka010/KafkaTestUtils.scala | Scala | apache-2.0 | 11,640 |
package polyite.fitness.classifier
import polyite.AbstractTest
import org.junit.Test
import polyite.ScopInfo
import polyite.schedule.Dependence
import polyite.schedule.schedule_tree.ScheduleNode
import polyite.schedule.schedule_tree.util.SchedTreeUtil
import polyite.schedule.DomainCoeffInfo
import polyite.schedule.Sch... | stganser/polyite | test/polyite/fitness/classifier/TestTreeDepth.scala | Scala | mit | 3,448 |
package models
import play.api._
import play.api.mvc._
import controllers.Permissions
import util.Stats
import util.security.{AuthenticationAccessor, AuthenticationProvider, AuthenticationProviderConfig}
import java.security.SecureRandom
import java.math.BigInteger
import org.squeryl.PrimitiveTypeMode._
import org.squ... | Shopify/collins | app/models/Session.scala | Scala | apache-2.0 | 2,800 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not u... | chenc10/Spark-PAF | sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala | Scala | apache-2.0 | 12,523 |
/*
* 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 ... | neoremind/kraps-rpc | kraps-core/src/main/scala/com/neoremind/kraps/util/ByteBufferInputStream.scala | Scala | apache-2.0 | 2,049 |
package edu.rice.habanero.benchmarks.nqueenk
import edu.rice.habanero.actors.{JetlangActor, JetlangActorState, JetlangPool}
import edu.rice.habanero.benchmarks.nqueenk.NQueensConfig.{DoneMessage, ResultMessage, StopMessage}
import edu.rice.habanero.benchmarks.{Benchmark, BenchmarkRunner}
/**
* @author <a href="http:... | shamsmahmood/savina | src/main/scala/edu/rice/habanero/benchmarks/nqueenk/NQueensJetlangActorBenchmark.scala | Scala | gpl-2.0 | 5,231 |
//: ----------------------------------------------------------------------------
//: Copyright (C) 2015 Verizon. 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 Licen... | neigor/funnel | integration/src/multi-jvm/scala/IntegrationTest.scala | Scala | apache-2.0 | 7,585 |
//: ----------------------------------------------------------------------------
//: Copyright (C) 2015 Verizon. 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 Licen... | neigor/funnel | elastic/src/main/scala/HttpLayer.scala | Scala | apache-2.0 | 3,957 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.libs.crypto
import java.nio.charset.StandardCharsets
import java.security.{ MessageDigest, SecureRandom }
import java.time.Clock
import javax.inject.{ Inject, Provider, Singleton }
import org.apache.commons.codec.binary.Hex
... | wsargent/playframework | framework/src/play/src/main/scala/play/api/libs/crypto/CSRFTokenSigner.scala | Scala | apache-2.0 | 4,839 |
/*
Pack consecutive duplicates of list elements into sublists.
If a list contains repeated elements they should be placed in separate sublists.
Example:
scala> pack(List('a, 'a, 'a, 'a, 'b, 'c, 'c, 'a, 'a, 'd, 'e, 'e, 'e, 'e))
res0: List[List[Symbol]] = List(List('a, 'a, 'a, 'a), List('b), List('c, 'c), Lis... | gcanti/S-99 | src/main/scala/P09.scala | Scala | mit | 816 |
package geotrellis.test.singleband.s3
import geotrellis.config.Dataset
import geotrellis.raster.Tile
import geotrellis.spark._
import geotrellis.spark.io._
import geotrellis.test.S3Test
import geotrellis.test.singleband.load.HadoopLoad
import geotrellis.vector.ProjectedExtent
import org.apache.spark.SparkContext
abs... | pomadchin/geotrellis-integration-tests | src/main/scala/geotrellis/test/singleband/s3/HadoopIngestTest.scala | Scala | apache-2.0 | 604 |
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.