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 com.seanshubin.todo.persistence.domain
import java.io._
import java.nio.charset.Charset
import scala.annotation.tailrec
object IoUtil {
def inputStreamToString(inputStream: InputStream, charset: Charset): String = {
val bytes = inputStreamToBytes(inputStream)
new String(bytes, charset)
}
def s... | SeanShubin/todo-persistence | domain/src/main/scala/com/seanshubin/todo/persistence/domain/IoUtil.scala | Scala | unlicense | 1,162 |
package org.scalaide.debug.internal.extensions
import org.scalaide.util.eclipse.EclipseUtils
import org.scalaide.debug.DebugEventHandler
object EventHandlerMapping {
final val EventHandlerId = "org.scala-ide.sdt.debug.eventHandler"
/**
* Returns all existing event handler extensions mapped to the
* [[Even... | Kwestor/scala-ide | org.scala-ide.sdt.debug/src/org/scalaide/debug/internal/extensions/EventHandlerMapping.scala | Scala | bsd-3-clause | 1,629 |
/*
* Copyright 2019 Spotify AB.
*
* 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 ... | regadas/scio | scio-core/src/main/scala/com/spotify/scio/coders/KryoAtomicCoder.scala | Scala | apache-2.0 | 11,363 |
package quotidian.web.controller
import org.apache.lucene.document.Document
class DocumentWrapper(private val document:Document) {
def apply(name:String):Option[String] =
try { Some(document.getValues(name)(0)) }
catch {
case _ => None
}
}
object DocumentWrapper {
def apply(doc:Document) = new DocumentWra... | bryanjswift/quotidian | src/main/scala/quotidian/web/controller/DocumentWrapper.scala | Scala | mit | 409 |
/**
* Copyright 2015 Thomson Reuters
*
* 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 l... | nruppin/CM-Well | server/cmwell-fts/src/test/scala/cmwell/fts/FTSServiceEsSpec.scala | Scala | apache-2.0 | 22,684 |
package org.jetbrains.sbt.editor.documentationProvider
import com.intellij.lang.documentation.DocumentationProvider
import com.intellij.openapi.editor.Editor
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.psi.{PsiElement, PsiFile}
import org.jetbrains.plugins.scala.editor.documentationProvider.Documentat... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/sbt/editor/documentationProvider/SbtScalacOptionsDocumentationProviderTestBase.scala | Scala | apache-2.0 | 1,851 |
/******************************************************************
* See the NOTICE file distributed with this work for additional *
* information regarding Copyright ownership. The author/authors *
* license this file to you under the terms of the Apache License *
* Version 2.0 (the "License"); you may not use ... | reactivecodes/scala-time | src/test/scala/scalatime/impl/TemporalAmountOpsSuite.scala | Scala | apache-2.0 | 4,139 |
package gsd.linux.tools
/*
* This file is part of the Linux Variability Modeling Tools (LVAT).
*
* Copyright (C) 2010 Steven She <[email protected]>
*
* LVAT 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 Soft... | scas-mdd/linux-variability-analysis-tools.fm-translation | src/main/scala/gsd/linux/tools/BooleanTranslationMain.scala | Scala | gpl-3.0 | 2,754 |
package sds.classfile.bytecode
class Iinc(_index: Int, _const: Int, pc: Int) extends OpcodeInfo("iinc", pc) {
def index: Int = _index
def const: Int = _const
override def toString(): String = s"${super.toString()}: $index, $const"
} | g1144146/sds_for_scala | src/main/scala/sds/classfile/bytecode/Iinc.scala | Scala | apache-2.0 | 245 |
package redstone.solver.levels
import org.scalatest._
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import redstone._
import redstone.piece._
import redstone.solver.util._
import redstone.solver._
@RunWith(classOf[JUnitRunner])
class Two extends FunSuite {
// Which solver do we use?
val... | skumargithub/redstone-solver | src/test/scala/redstone/solver/levels/Two.scala | Scala | gpl-2.0 | 2,111 |
package io.backchat.hookup
class ScalaUpstreamHandler extends {
}
| backchatio/hookup | src/main/scala/io/backchat/hookup/netty_handlers.scala | Scala | mit | 69 |
package temportalist.compression.main.client.model
import net.minecraft.client.renderer.block.model.ModelResourceLocation
import net.minecraft.client.resources.IResourceManager
import net.minecraft.util.ResourceLocation
import net.minecraftforge.client.model.{ICustomModelLoader, IModel}
import temportalist.compression... | TheTemportalist/Compression | src/main/scala/temportalist/compression/main/client/model/ModelLoaderCompressed.scala | Scala | apache-2.0 | 913 |
/*
* 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/Alignment.scala | Scala | apache-2.0 | 925 |
package com.twitter.querulous.unit
import java.sql.Connection
import org.specs.Specification
import org.specs.mock.JMocker
import com.twitter.querulous.query._
import com.twitter.finagle.tracing._
class TracingQuerySpec extends Specification with JMocker {
"TracingQuery" should {
"add records as query is execu... | twitter/querulous | querulous-tracing/src/test/scala/com/twitter/querulous/unit/TracingQuerySpec.scala | Scala | apache-2.0 | 1,048 |
/*
* *
* * Copyright 2012 Martin Gontovnikas (martin at gonto dot com dot ar) - twitter: @mgonto
* *
* * 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.... | mgonto/factory_pal | framework-src/src/main/scala/ar/com/gonto/factorypal/reflection/ObjectReflector.scala | Scala | apache-2.0 | 2,658 |
package ee.cone.c4ui
import ee.cone.c4actor.{Context, TransientLens}
import ee.cone.c4vdom.Types.ViewRes
import ee.cone.c4vdom.{VDomLens, VDomState, VDomView}
trait View extends VDomView[Context] with Product
trait UntilPolicy {
def wrap(view: Context=>ViewRes): Context=>ViewRes
}
case object VDomStateKey extends... | conecenter/c4proto | base_lib/src/main/scala/ee/cone/c4ui/UIApi.scala | Scala | apache-2.0 | 787 |
package plainFP
import org.scalatest._
import org.scalatest.Matchers._
class RequestResponseSpec extends FunSpec with Matchers {
import RequestResponse._
import Method._
val badResponse = Response("400", "", "text/plain", "")
val goodResponse = Response("200", "", "text/plain", "Hello John!")
describe("he... | enpassant/miniatures | src/test/scala/plainFP/RequestResponseSpec.scala | Scala | apache-2.0 | 2,176 |
package com.ubeeko.exceptions
/**
* Created with IntelliJ IDEA.
* User: elb
* Date: 18/02/13
* Time: 09:03
*/
trait BusinessRuleException extends Exception | eric-leblouch/htalk | src/main/scala/com/ubeeko/exceptions/BusinessRuleException.scala | Scala | apache-2.0 | 161 |
import collection.mutable.UnrolledBuffer
object Test {
def main(args: Array[String]): Unit = {
val buf = UnrolledBuffer(1 to 50: _*)
val dub = buf ++ buf
println(dub)
}
}
| folone/dotty | tests/run/t5867.scala | Scala | bsd-3-clause | 193 |
package com.github.vonnagy.service.container.http.routing
import akka.ConfigurationException
import akka.actor._
import akka.http.scaladsl.server.{Route, RouteConcatenation}
import scala.concurrent.ExecutionContext
/**
* Add a set of defined routes
*
* @param route
*/
case class AddRoute(route: RoutedEndpoints... | vonnagy/service-container | service-container/src/main/scala/com/github/vonnagy/service/container/http/routing/RoutedService.scala | Scala | apache-2.0 | 2,821 |
package com.twitter.algebird
import org.specs._
import org.scalacheck.Arbitrary
import org.scalacheck.Arbitrary.arbitrary
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
import org.scalacheck.Gen.{choose, oneOf, value}
import java.lang.AssertionError
import java.util.Arrays
object SGDLaws extends... | snoble/algebird | algebird-test/src/test/scala/com/twitter/algebird/SGDTest.scala | Scala | apache-2.0 | 2,475 |
package picasso.analysis
import picasso.utils._
import picasso.model.dbp._
import picasso.graph._
import picasso.math._
import TransitionsGraphFromCover._
object InterfaceExtraction {
type ObjType = String
type Field = String
type UnaryPredicates = Map[String, Boolean]
type BinaryPredicates = Map[String, Map... | dzufferey/picasso | core/src/main/scala/picasso/analysis/InterfaceExtraction.scala | Scala | bsd-2-clause | 32,367 |
import sys.process._
object TextAnalyzer extends App {
if (args.length != 2) {
System.err.println( "Usage: TextAnalyzer" +
" <VectorizationModelFolder>" +
" <ClassificationModelFolder>"
)
System.exit(1)
}
val vectorizationModelFolder = args(0)
val classificationModelFolder = args(1)
... | dotdeb/Pilsner | Analytics/ScienceAnalyzer/Docker-full/spark-app/src/main/scala/TextAnalyzer.scala | Scala | apache-2.0 | 991 |
package org.example5.declaration.data
class Y {
}
| JetBrains/intellij-scala | scala/scala-impl/testdata/move/moveMultipleClasses_UsedInLocalImports/after/org/example5/declaration/data/Y.scala | Scala | apache-2.0 | 52 |
import de.tototec.sbuild._
import de.tototec.sbuild.ant._
import de.tototec.sbuild.ant.tasks._
import de.tototec.sbuild.TargetRefs._
@version("0.4.0")
@include("../SBuildConfig.scala")
@classpath("mvn:org.apache.ant:ant:1.8.4")
class SBuild(implicit _project: Project) {
val namespace = "de.tototec.sbuild.compilerpl... | SBuild-org/sbuild | de.tototec.sbuild.compilerplugin/SBuild.scala | Scala | apache-2.0 | 2,522 |
/**
* Copyright (c) 2013-2015 Patrick Nicolas - Scala for Machine Learning - All rights reserved
*
* The source code in this file is provided by the author for the sole purpose of illustrating the
* concepts and algorithms presented in "Scala for Machine Learning". It should not be used to
* build commercial ap... | batermj/algorithm-challenger | books/cs/machine-learning/scala-for-machine-learning/1rst-edition/original-src-from-the-book/src/main/scala/org/scalaml/scalability/akka/message/Messages.scala | Scala | apache-2.0 | 2,636 |
/*
* Copyright 2010-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or ag... | arashi01/couchdb | src/main/scala/net/liftmodules/couchdb/Database.scala | Scala | apache-2.0 | 11,823 |
package com.rasterfoundry.api.utils.queryparams
import com.rasterfoundry.datamodel._
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.directives.ParameterDirectives.parameters
import akka.http.scaladsl.unmarshalling._
import javax.xml.bind.DatatypeConverter
import java.sql.Timestamp
imp... | raster-foundry/raster-foundry | app-backend/api/src/main/scala/utils/QueryParameters.scala | Scala | apache-2.0 | 7,090 |
package rebind.syntax.std
import rebind.std.FutureAction
import scala.concurrent.{ExecutionContext, Future}
import scalaz.DisjunctionT
trait FutureSyntax {
implicit def futureSyntax[A](future: => Future[A])(implicit ec: ExecutionContext): FutureOps[A] =
new FutureOps(future)
}
class FutureOps[A](future: => F... | adelbertc/rebind | core/src/main/scala/rebind/syntax/std/FutureOps.scala | Scala | bsd-3-clause | 443 |
/*
* Copyright (c) 2016 by its authors. Some rights reserved.
* See the project homepage at: https://sincron.org
*
* 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.apa... | monixio/sincron | sincron-atomic/jvm/src/main/scala/org/sincron/atomic/AtomicBuilder.scala | Scala | apache-2.0 | 3,126 |
package com.wavesplatform.transaction.smart
import com.wavesplatform.account.Address
import com.wavesplatform.db.WithDomain
import com.wavesplatform.db.WithState.AddrWithBalance
import com.wavesplatform.lang.directives.values.StdLibVersion
import com.wavesplatform.lang.script.Script
import com.wavesplatform.lang.v1.co... | wavesplatform/Waves | node/src/test/scala/com/wavesplatform/transaction/smart/SubInvokeStateChangesSpec.scala | Scala | mit | 6,724 |
// create an svg display object
//package svgala
import scala.collection.mutable.ListBuffer
import java.io._
class SVGala(val width: Int, val height: Int) {
// list of objects to display
val displayList = ListBuffer[String]()
// utilities
// get the attribute name from an attribute assignment string
def ... | toma63/svgala | svgala.scala | Scala | gpl-3.0 | 3,438 |
/*
* 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 ... | nkhuyu/Spark-SQL-on-HBase | src/main/scala/org/apache/spark/sql/hbase/HBaseCriticalPoint.scala | Scala | apache-2.0 | 31,135 |
package org.jetbrains
import _root_.java.io._
import _root_.java.lang.{Boolean => JavaBoolean}
import _root_.java.security.MessageDigest
import com.intellij.ide.plugins.PluginManager
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.extensions.PluginId
import com.intellij.openapi.... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/sbt/package.scala | Scala | apache-2.0 | 5,938 |
/*
* Copyright 2014–2017 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... | drostron/quasar | marklogic/src/main/scala/quasar/physical/marklogic/qscript/ProjectPath.scala | Scala | apache-2.0 | 3,938 |
/*
* @author Philip Stutz
*
* Copyright 2012 University of Zurich
*
* 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.... | Tjoene/thesis | Case_Programs/signal-collect/src/main/scala/com/signalcollect/nodeprovisioning/local/LocalNodeProvisioner.scala | Scala | gpl-2.0 | 1,149 |
package scala.collection.mutable
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
import org.openjdk.jmh.infra._
import scala.util.Random
@BenchmarkMode(Array(Mode.AverageTime))
@Fork(2)
@Threads(1)
@Warmup(iterations = 10)
@Measurement(iterations = 10)
@OutputTimeUnit(TimeUnit.NANOSECONDS)... | lrytz/scala | test/benchmarks/src/main/scala/scala/collection/mutable/RedBlackTreeBenchmark.scala | Scala | apache-2.0 | 2,023 |
package io.transwarp.midas.constant.midas.params.outlier
object LOFParams {
val minPts = "minPts"
}
| transwarpio/rapidminer | api-driver/src/main/scala/io/transwarp/midas/constant/midas/params/outlier/LOFParams.scala | Scala | gpl-3.0 | 103 |
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
object Test extends App {
reify {
object Persons {
/** A list of persons. To create a list, we use Predef.List
* which takes a variable number of arguments and constructs
* a list out of them.
*/
val person... | felixmulder/scala | test/files/run/reify_fors_oldpatmat.scala | Scala | bsd-3-clause | 3,204 |
package com.twitter.finagle.stats
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.mock.MockitoSugar
import com.twitter.finagle.{Codec, CodecFactory, Service}
import com.twitter.util.{Await, Future}
import org.jboss.netty.channel.{Channels, Chann... | adriancole/finagle | finagle-ostrich4/src/test/scala/com/twitter/finagle/stats/FinagleStatsTest.scala | Scala | apache-2.0 | 3,122 |
package paperdoll.core.nondeterminism
import org.junit.Test
import Nondeterminism._
import scalaz.std.list._
import scalaz.syntax.monadPlus._
import org.fest.assertions.Assertions.assertThat
import scala.Vector
import paperdoll.core.effect.Effects
import scala.Predef.intWrapper
class NDetTest {
@Test def testIfte()... | m50d/paperdoll | core/src/test/scala/paperdoll/core/nondeterminism/NDetTest.scala | Scala | apache-2.0 | 672 |
package lila.i18n
import play.api.libs.json._
import lila.common.PimpedJson._
import play.api.libs.ws.WS
import play.api.Play.current
import tube.translationTube
private[i18n] final class UpstreamFetch(upstreamUrl: Int => String) {
private type Fetched = Fu[List[Translation]]
def apply(from: Int): Fetched =
... | Happy0/lila | modules/i18n/src/main/UpstreamFetch.scala | Scala | mit | 732 |
/*
* Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* 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/... | scouter-project/scouter | scouter.server/src/main/scala/scouter/server/db/xlog/XLogDataWriter.scala | Scala | apache-2.0 | 2,878 |
/* scala-stm - (c) 2009-2010, Stanford University, PPL */
package scala.concurrent.stm
object MaybeTxn {
implicit val unknown = TxnUnknown
}
/** `MaybeTxn` allows lookup of the implicit `InTxn` instance without failing
* if the `InTxn` is not known at compile time. `implicitly[MaybeTxn]` will
* bind to an imp... | djspiewak/scala-stm | src/main/scala/scala/concurrent/stm/MaybeTxn.scala | Scala | bsd-3-clause | 564 |
package de.mukis
import com.typesafe.config.ConfigFactory
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
import java.nio.file.Files
import java.nio.charset.Charset
object ConfigApp extends App {
val logFile = Files.createTempFile("mukis-", ".log")
// Creating an executor service to s... | muuki88/sbt-native-packager-examples | linux-mappings/src/main/scala/de/mukis/ConfigApp.scala | Scala | apache-2.0 | 841 |
package lila.swiss
import akka.stream.scaladsl._
import reactivemongo.api.bson._
import lila.db.dsl._
import lila.user.User
// https://www.fide.com/FIDE/handbook/C04Annex2_TRF16.pdf
final class SwissTrf(
sheetApi: SwissSheetApi,
colls: SwissColls,
baseUrl: lila.common.config.BaseUrl
)(implicit ec: scala.... | luanlv/lila | modules/swiss/src/main/SwissTrf.scala | Scala | mit | 4,443 |
package com.imadethatcow.hipchat.rooms
import com.imadethatcow.hipchat.common.{Logging, Common}
import Common._
import com.imadethatcow.hipchat.common.caseclass.{HistoriesResponse, HistoryItem}
import scala.concurrent.{ExecutionContext, Future}
class ViewHistory(private[this] val apiToken: String, private[this] val ... | poweld/hipchat-scala | src/main/scala/com/imadethatcow/hipchat/rooms/ViewHistory.scala | Scala | mit | 1,416 |
package spotlight.model.outlier
import omnibus.commons.util._
trait IsQuorum extends Serializable {
def apply( results: OutlierAlgorithmResults ): Boolean
def totalIssued: Int
protected def evaluateRemainder( results: OutlierAlgorithmResults ): Boolean = results.size >= totalIssued
}
object IsQuorum {
case ... | dmrolfs/lineup | core/src/main/scala/spotlight/model/outlier/IsQuorum.scala | Scala | mit | 1,467 |
package org.jetbrains.plugins.scala.lang.parser.parsing.xml
import org.jetbrains.plugins.scala.lang.lexer.ScalaXmlTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.util.ParserPatcher
import scala.annotation.tailrec
/**
* @author... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/parser/parsing/xml/Content.scala | Scala | apache-2.0 | 1,553 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScan.scala | Scala | apache-2.0 | 5,633 |
/*
* Copyright 2013 http4s.org
*
* 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 i... | http4s/http4s | core/shared/src/main/scala/org/http4s/internal/SSLContextOption.scala | Scala | apache-2.0 | 1,680 |
package io.scalac.newspaper.crawler.urls
import java.nio.file.Path
import akka.NotUsed
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{FileIO, Source}
import akka.util.ByteString
import scala.collection.immutable
import scala.concurrent.{ExecutionContext, Future}
import scala.io
class FileURLsStor... | ScalaConsultants/newspaper | crawler/src/main/scala/io/scalac/newspaper/crawler/urls/FileURLsStore.scala | Scala | agpl-3.0 | 887 |
package scalaz.stream.mongodb.query
import org.bson.types.ObjectId
import java.util.Date
/**
* Witness for allowed predicates in query
* @tparam A
*/
trait QueryPredicateWitness[A]
object QueryPredicateWitness {
implicit val boolWitness = new QueryPredicateWitness[Boolean] {}
implicit val stringWitness = n... | Spinoco/scalaz-stream-mongodb | core/src/main/scala/scalaz/stream/mongodb/query/QueryPredicateWitness.scala | Scala | mit | 794 |
/*
* 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 ... | ddna1021/spark | mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala | Scala | apache-2.0 | 15,540 |
package name.orhideous.twicher.error
sealed trait TwicherError extends Exception
object TwicherError {
case object NoSuchQuote extends TwicherError
case object NoQuotes extends TwicherError
}
| Orhideous/twicher | src/main/scala/name/orhideous/twicher/error/TwicherError.scala | Scala | gpl-3.0 | 202 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frs102/calculations/NetCurrentAssetsLiabilitiesCalculator.scala | Scala | apache-2.0 | 1,333 |
package scredis.io
import scredis.protocol._
import scredis.{Subscription, Transaction}
import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future}
import scala.util.Try
trait Connection {
implicit val dispatcher: ExecutionContext
}
trait NonBlockingConnection {
protected[scredis] def ... | scredis/scredis | src/main/scala/scredis/io/Connection.scala | Scala | apache-2.0 | 719 |
/*
* 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 ... | bwsw/sj-platform | core/sj-engine-core/src/test/scala-2.12/com/bwsw/sj/engine/batch/benchmark/read_kafka/storm/StormBenchmark.scala | Scala | apache-2.0 | 2,449 |
/*
* The MIT License
*
* Copyright (c) 2017 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/EstimatePoolingFractionsTest.scala | Scala | mit | 7,640 |
package org.openurp.edu.eams.teach.grade.lesson.service
import org.openurp.edu.base.Student
import org.openurp.edu.teach.code.GradeType
import org.openurp.edu.teach.grade.model.CourseGradeState
import org.openurp.edu.teach.grade.model.ExamGradeState
import org.openurp.edu.teach.lesson.Lesson
trait LessonGradeServi... | openurp/edu-eams-webapp | grade/src/main/scala/org/openurp/edu/eams/teach/grade/lesson/service/LessonGradeService.scala | Scala | gpl-3.0 | 709 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | witgo/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Percentile.scala | Scala | apache-2.0 | 11,232 |
package jigg.pipeline
/*
Copyright 2013-2015 Hiroshi Noji
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... | tomeken-yoshinaga/jigg | src/main/scala/jigg/pipeline/Requirement.scala | Scala | apache-2.0 | 4,442 |
package fink.web
import org.scalatra.ScalatraBase
import fink.support.{Config, MediaManager}
import java.io.File
import fink.data.RepositorySupport
trait MediaSupport extends ScalatraBase with RepositorySupport {
get("/uploads/images/:hash/:spec/:file") {
(for {
hash <- Option(params("hash"))
image... | dozed/fink | src/main/scala/fink/web/MediaSupport.scala | Scala | mit | 850 |
package co.rc.authmanager.persistence.daos
import co.rc.authmanager.persistence.daos.base.DAO
import io.strongtyped.active.slick.Lens
import io.strongtyped.active.slick.Lens._
import slick.ast.BaseTypedType
/**
* Class that defines DAO implementation for UsersRoles
*/
class UsersRolesDAO extends DAO {
import j... | rodricifuentes1/authentication-manager | src/main/scala/co/rc/authmanager/persistence/daos/UsersRolesDAO.scala | Scala | mit | 803 |
/* Copyright (C) 2016 Luis Rodero-Merino
*
* This file is part of MxCompanions
*
* 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 2 of the License, or
* (at your option) any... | lrodero/mxcompanions | src/test/scala/mxcompanions/Gens.scala | Scala | gpl-2.0 | 3,756 |
/*
* Copyright 2019 ACINQ SAS
*
* 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... | ACINQ/eclair | eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/CommonCodecs.scala | Scala | apache-2.0 | 8,278 |
package com.szadowsz.spark.ml.feature
import org.apache.spark.ml.Transformer
import org.apache.spark.ml.param.shared._
import org.apache.spark.ml.param.{Param, ParamMap}
import org.apache.spark.ml.util.Identifiable
import org.apache.spark.sql.functions._
import org.apache.spark.sql.types._
import org.apache.spark.sql.... | zakski/project-cadisainmduit | module/spark/src/main/scala/com/szadowsz/spark/ml/feature/ValueCounter.scala | Scala | apache-2.0 | 1,844 |
import com.google.inject.{AbstractModule, Guice}
import domain.repositories.LigaRepository
import infrastructure.persistence.tables.LigaRepositoryImpl
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.test._
import play.api.test.Helpers._
/**
* Add your spec here.
* Yo... | Bluewolfbr/makecups | makecups-backend/test/ApplicationSpec.scala | Scala | mit | 1,305 |
/*
* 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 t... | gneokleo/zipkin | zipkin-scrooge/src/main/scala/com/twitter/zipkin/conversions/thrift.scala | Scala | apache-2.0 | 6,704 |
//TODO
/**
*/
package object domain {
} | rysh/scalatrader | store/ticker/src/main/scala/domain/package.scala | Scala | mit | 42 |
package me.enkode.j8
import java.util.function.Consumer
import org.scalatest.{Matchers, FlatSpec}
class JavaConsumerSupportTest extends FlatSpec with Matchers {
def fixture(onAccept: (String) ⇒ Unit) = new JavaConsumerSupport[String] {
override def jConsumer: Consumer[String] = new Consumer[String] {
ove... | kender/java8-converters | src/test/scala/me/enkode/j8/JavaConsumerSupportTest.scala | Scala | mit | 625 |
/**
* Copyright (C) 2015-2016 DANS - Data Archiving and Networked Services ([email protected])
*
* 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/license... | ekoi/easy-stage-dataset | src/main/scala/nl/knaw/dans/easy/stage/fileitem/EasyStageFileItem.scala | Scala | apache-2.0 | 6,580 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdColumnIntervalTest.scala | Scala | apache-2.0 | 31,466 |
object IfStatementComplex {
def foo(x: Boolean => String => String) = x(false)("45")
foo(if (_) /*start*/_.concat("3")/*end*/ else _.concat("6"))
}
//(String) => String | ilinum/intellij-scala | testdata/typeInference/expected/placeholder/IfStatementComplex.scala | Scala | apache-2.0 | 173 |
package org.newsfromthestreets.lib
import net.liftweb.http._
import net.liftweb.util._
import net.liftweb.common._
import java.util.Date
/**
* A factory for generating new instances of Date. You can create
* factories for each kind of thing you want to vend in your application.
* An example is a payment gateway. ... | Rmanolis/newsfromthestreets | src/main/scala/org/newsfromthestreets/lib/DependencyFactory.scala | Scala | apache-2.0 | 1,368 |
trait HList
trait HNil extends HList
trait FromTraversable[Out <: HList]
object FromTraversable {
implicit def hnilFromTraversable[T]: FromTraversable[HNil] =
new FromTraversable[HNil]{}
}
object Filter {
def apply[A <: HList, O <: HList]()(implicit ftA: FromTraversable[A],
... | som-snytt/dotty | tests/pos/i2981.scala | Scala | apache-2.0 | 411 |
package cwe.scala.library.audit.listener
import cwe.scala.library.audit._
import scala.collection.mutable.HashSet
/**
* A queued event listener which has an independent working thread to manage the event queue
*/
class QueuedListener extends AuditEventListener {
private val auditor = AuditServiceProvider.createAudi... | wwwigii-system/research | cwe-scala-library/src/cwe/scala/library/audit/listener/QueuedListener.scala | Scala | gpl-3.0 | 3,139 |
/*
* Copyright 2014–2017 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... | drostron/quasar | blueeyes/src/main/scala/quasar/precog/common/security/AccessControl.scala | Scala | apache-2.0 | 1,051 |
package com.typesafe.sbt.packager.jdkpackager
import com.typesafe.sbt.packager.jdkpackager.JDKPackagerPlugin.autoImport._
import org.apache.tools.ant.{ BuildEvent, BuildListener, ProjectHelper }
import sbt.Keys._
import sbt._
import scala.util.Try
import scala.xml.Elem
/**
* Helpers for working with Ant build defini... | bfil/sbt-native-packager | src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerAntHelper.scala | Scala | bsd-2-clause | 9,263 |
/*
* Copyright (c) 2017-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | snowplow/snowplow | 5-data-modeling/event-manifest-populator/src/main/scala/com/snowplowanalytics/snowplow/eventpopulator/R83Codec.scala | Scala | apache-2.0 | 1,038 |
package reactivemongo.api
import reactivemongo.bson.buffer.{ ReadableBuffer, WritableBuffer }
trait SerializationPack { self: Singleton =>
type Value
type ElementProducer
type Document <: Value
type Writer[A]
type Reader[A]
def IdentityWriter: Writer[Document]
def IdentityReader: Reader[Document]
de... | maowug/ReactiveMongo | driver/src/main/scala/api/serializationpack.scala | Scala | apache-2.0 | 2,482 |
package com.sfxcode.sapphire.core.scene
import javafx.beans.property.Property
import javafx.scene.Node
import javafx.scene.control._
import javafx.scene.text.Text
class DefaultResolver extends NodePropertyResolving {
def resolve(node: Node): Option[Property[_]] =
node match {
case label: Label => Some(la... | sfxcode/sapphire-core | src/main/scala/com/sfxcode/sapphire/core/scene/DefaultResolver.scala | Scala | apache-2.0 | 1,125 |
package com.danielasfregola.twitter4s.http.clients.rest.blocks
import com.danielasfregola.twitter4s.entities._
import com.danielasfregola.twitter4s.http.clients.rest.RestClient
import com.danielasfregola.twitter4s.http.clients.rest.blocks.parameters.{
BlockParameters,
BlockedUserIdsParameters,
BlockedUsersParame... | DanielaSfregola/twitter4s | src/main/scala/com/danielasfregola/twitter4s/http/clients/rest/blocks/TwitterBlockClient.scala | Scala | apache-2.0 | 10,063 |
package scalax.collection
import GraphPredef._
import GraphEdge._
/* TODO
import edge._
import edge.Implicits._
*/
abstract class TGraph[N, E <: EdgeLike[N], G[N, E <: EdgeLike[N]] <: Graph[N, E] with GraphLike[N, E, G]](
val g: G[N, E]
) {
def node(outer: N): g.NodeT = g get outer
def n(outer: N): g.NodeT ... | scala-graph/scala-graph | core/src/test/scala/scalax/collection/Data.scala | Scala | apache-2.0 | 1,289 |
package smtlib
package theories
import Ints._
import org.scalatest.FunSuite
class IntsTests extends FunSuite {
override def suiteName = "Ints theory test suite"
test("IntSort is correctly constructed and extracted") {
IntSort() match {
case IntSort() => assert(true)
case _ => assert(false)
... | manoskouk/scala-smtlib | src/test/scala/smtlib/theories/IntsTests.scala | Scala | mit | 4,552 |
import sbt._
import sbt.Keys._
object StandardLayout {
def settings: Seq[Setting[_]] = List(
sourceDirectory := baseDirectory.value / "src",
sourceDirectory in Compile := sourceDirectory.value / "main",
sourceDirectory in Test := sourceDirectory.value / "test",
resourceDirectory in Compile := (source... | restfulscala/play-content-negotiation | project/StandardLayout.scala | Scala | mit | 736 |
/**
* Copyright 2015 Thomson Reuters
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | thomsonreuters/CM-Well | server/cmwell-ws/app/controllers/LoginHandler.scala | Scala | apache-2.0 | 4,689 |
/** *
* Copyright 2014 Rackspace US, 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 la... | wdschei/api-checker | core/src/test/scala/com/rackspace/com/papi/components/checker/MultiSchemaElementsBaseSuite.scala | Scala | apache-2.0 | 14,011 |
/*
* 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 ... | fhueske/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/runtime/operators/KeyedProcessFunctionWithCleanupStateTest.scala | Scala | apache-2.0 | 4,908 |
import scala.quoted._
def test(using QuoteContext) = {
val a = '{
def z: Int = 5
Macro.ff(z, 5)
}
}
| som-snytt/dotty | tests/disabled/pos-macros/i3898c/quoted_2.scala | Scala | apache-2.0 | 112 |
package junto
import junto.io._
import junto.graph._
import junto.util.Evaluator
/**
* Given the edge and seed descriptions, create the graph and run modified adsorption.
*/
object Junto {
def main(args: Array[String]) {
val conf = new JuntoOptions(args)
val separator = if (conf.tabSeparated()) '\\t' e... | scalanlp/junto | src/main/scala/junto/Junto.scala | Scala | apache-2.0 | 2,144 |
package org.eknet.sitebag.rest
import scala.xml.PrettyPrinter
import spray.http._
import spray.http.HttpResponse
import spray.httpx.marshalling.ToResponseMarshaller
import porter.model.Ident
import org.eknet.sitebag.{Failure, Success, Result}
import org.eknet.sitebag.model.PageEntry
object RssSupport {
type RssMar... | eikek/sitebag | src/main/scala/org/eknet/sitebag/rest/RssSupport.scala | Scala | apache-2.0 | 2,545 |
/**
* 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... | linkedin/pinot | pinot-connectors/pinot-spark-connector/src/main/scala/org/apache/pinot/connector/spark/exceptions/exceptions.scala | Scala | apache-2.0 | 1,170 |
import scala.annotation.tailrec
object Fact {
def main(args : Array[String]) = {
if(args.length > 0 && args(0).matches("\\\\d+"))
Console println factorial(args(0).toInt)
else
Console println factorial(3)
}
def factorial (n: Int) = {
@tailrec
def facto(a : Int, acc: Int): Int =
... | splacentino/My-Project-Euler | other/Fact.scala | Scala | mit | 390 |
package com.seanshubin.concurrency.samples.statemachine
object StateMachineSampleApp extends App {
new DependencyInjection {}.runner.run()
}
| SeanShubin/concurrency-samples | statemachine/src/main/scala/com/seanshubin/concurrency/samples/statemachine/StateMachineSampleApp.scala | Scala | unlicense | 144 |
package hevs.especial.utils.tests
// A Tour of Scala: Generic Classes
// http://www.scala-lang.org/old/node/113.html
object Var1 {
// Subtyping of generic types is INVARIANT.
// Stack[T] is only a subtype of Stack[S] iff S = T
val stack = new Stack[Int]
// Mutable stacks of an arbitrary element type T
class... | hevs-isi/especial-frontend | src/main/scala/hevs/especial/utils/tests/Variance.scala | Scala | mit | 1,699 |
package com.github.ornicar.paginator.test.adapter
import org.scalatest._
import com.github.ornicar.paginator._
import com.github.ornicar.paginator.InMemoryAdapter
class PaginatorTest extends FunSuite {
test("Empty seq") {
val a = makeAdapter[Int]()
Paginator(a, 1, 10).fold( { f => fail(f) }, { p =>
a... | ornicar/scala-paginator | core/src/test/scala/PaginatorTest.scala | Scala | mit | 1,510 |
/*
* Copyright 2014-2022 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... | Netflix-Skunkworks/iep-apps | atlas-cloudwatch/src/main/scala/com/netflix/atlas/cloudwatch/MetricCategory.scala | Scala | apache-2.0 | 5,586 |
package io.getquill
import com.datastax.oss.driver.api.core.{ CqlSession, CqlSessionBuilder }
import com.typesafe.config.Config
import io.getquill.context.ExecutionInfo
import io.getquill.context.cassandra.util.FutureConversions._
import io.getquill.monad.ScalaFutureIOMonad
import io.getquill.util.{ ContextLogger, Loa... | getquill/quill | quill-cassandra/src/main/scala/io/getquill/CassandraAsyncContext.scala | Scala | apache-2.0 | 3,026 |
/*
* Copyright (C) 2016 VSCT
*
* 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... | voyages-sncf-technologies/maze | src/main/scala/fr/vsct/dt/maze/topology/NodeGroup.scala | Scala | apache-2.0 | 847 |
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.