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.twitter.finagle.memcached.replication
import _root_.java.lang.{Boolean => JBoolean, Long => JLong}
import scala.collection.JavaConversions._
import scala.util.Random
import com.twitter.conversions.time._
import com.twitter.finagle.builder.{Cluster, ClientBuilder, ClientConfig}
import com.twitter.finagle.... | sveinnfannar/finagle | finagle-memcached/src/main/scala/com/twitter/finagle/memcached/replication/ReplicationClient.scala | Scala | apache-2.0 | 18,819 |
package com.openquant.quoter
import java.util.Date
import com.openquant.quoter.common.{Interval, Contract}
import com.openquant.quoter.historical.Source
import org.joda.time.format.DateTimeFormat
import org.slf4j.bridge.SLF4JBridgeHandler
import org.slf4j.{Logger, LoggerFactory}
import scala.util.{Failure, Success, ... | openquant/quoter | src/main/scala/com/larroy/quoter/Main.scala | Scala | lgpl-3.0 | 6,708 |
package scife.util.structures
object BTree {
case class Tree(keys: List[Int], children: List[Tree]) {
require { children.isEmpty || keys.size + 1 == children.size }
// override def toString =
// listOfKeys(this).mkString("[", ",", "]")
}
def invariant(tree: Tree, min: Int, max: Int, t: Int) =
... | kaptoxic/SciFe | src/test/scala/scife/util/structures/BTree.scala | Scala | gpl-2.0 | 1,574 |
package lamrongol.regression
import java.io.File
import lamrongol.regression.model.{GeneManager, Gene}
import Gene.Unused
import org.apache.commons.io.FileUtils
import scala.collection.mutable.ArrayBuffer
import scala.io.Source
/**
* Created by admin on 2015/11/16.
*/
class RegressionCalculator(tsvFile: String)... | lamrongol/NonlinearRegressionFunctionSelectionByGeneticAlgorithm | src/main/scala/lamrongol/regression/RegressionCalculator.scala | Scala | mit | 1,720 |
package org.scalajs.testsuite.javalib
import java.{lang => jl, util => ju}
import java.util.Comparator
import scala.collection.JavaConversions._
import org.scalajs.jasminetest.JasmineTest
object CollectionsTest extends JasmineTest with ListTest with SortedSetTest
with SortedMapTest with ExpectExceptions {
@i... | jmnarloch/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/javalib/CollectionsTest.scala | Scala | bsd-3-clause | 49,091 |
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{universe => ru}
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
object Test extends dotty.runtime.LegacyApp {
// will fail because y is a private field
// reification doesn't magically make unavailable stuff... | yusuke2255/dotty | tests/disabled/macro/run/reify_closure8b.scala | Scala | bsd-3-clause | 560 |
package im.actor.server.dashboard.controllers.utils.json
import scala.concurrent.forkjoin.ThreadLocalRandom
import play.api.libs.functional.syntax._
import play.api.libs.json.Reads._
import play.api.libs.json.{ JsPath, Reads }
import im.actor.server.dashboard.controllers.utils.json.Common._
import im.actor.server.mo... | zomeelee/actor-platform | actor-server/actor-dashboard/app/im/actor/server/dashboard/controllers/utils/json/ManagersJsonImplicits.scala | Scala | mit | 990 |
/**
* 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... | quantiply-fork/kafka | core/src/main/scala/kafka/server/ReplicaManager.scala | Scala | apache-2.0 | 32,173 |
/*
* 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 ... | bowenli86/flink | flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/function/ProcessAllWindowFunction.scala | Scala | apache-2.0 | 2,920 |
package net.virtualvoid.sbt.graph.rendering
import net.virtualvoid.sbt.graph.ModuleGraph
object LicenseInfo {
def render(graph: ModuleGraph): String =
graph.nodes.filter(_.isUsed).groupBy(_.license).toSeq.sortBy(_._1).map {
case (license, modules) β
license.getOrElse("No license specified") + "\n"... | jrudolph/sbt-dependency-graph | src/main/scala/net/virtualvoid/sbt/graph/rendering/LicenseInfo.scala | Scala | apache-2.0 | 420 |
/*
* 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 | resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnRMClient.scala | Scala | apache-2.0 | 4,935 |
/*
* 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... | quantintel/spectrum | financial/src/main/scala/org/quantintel/ql/instruments/swap/BmaSwap.scala | Scala | apache-2.0 | 1,246 |
package com.github.akiomik.leap_scala
import com.leapmotion.leap.{ Pointable, PointableList }
class RichPointableList(val underlying: PointableList) extends AnyVal {
def apply(index: Int): Pointable = underlying get index
}
| akiomik/leap-scala | src/main/scala/com/github/akiomik/leap_scala/RichPointableList.scala | Scala | mit | 229 |
package org.globalnames
package parser
package runner
import java.io.{Console => _, _}
import java.nio.charset.StandardCharsets
import java.nio.file.{Files, Path}
import GnParser.{Config, Mode}
import org.specs2.matcher.{MatcherMacros, StringMatchers}
import org.specs2.mutable.Specification
import scalaz.syntax.std.... | GlobalNamesArchitecture/gnparser | runner/src/test/scala/org/globalnames/parser/runner/GnParserSpec.scala | Scala | mit | 5,923 |
package info.andreaswolf.roadhopper.simulation
import akka.actor.{ActorRef, ActorLogging}
import akka.pattern.ask
import scala.concurrent.{Future, ExecutionContext}
import scala.util.Success
/**
* Watches the vehicle status and adds them to the passed result object.
*
* @param result
* @param timer
* @param int... | andreaswolf/roadhopper | src/main/scala/info/andreaswolf/roadhopper/simulation/SimulationResultLogger.scala | Scala | mit | 1,846 |
package com.rocketfuel.sdbc.scalaz
import com.rocketfuel.sdbc.scalaz.jdbc._
import scalaz.stream._
import scala.concurrent.duration._
class SelectProcessSpec
extends JdbcProcessSuite {
test("Use a stream of Select to select rows using a connection pool.") { implicit connection =>
val selectFuture = for {
... | wdacom/sdbc | jdbc.scalaz/src/test/scala/com/rocketfuel/sdbc/scalaz/SelectProcessSpec.scala | Scala | bsd-3-clause | 630 |
package wow.realm.protocol.payloads
import wow.realm.entities.Position
import wow.realm.protocol._
import scodec.Codec
import scodec.codecs._
/**
* Created by sknz on 3/24/17.
*/
case class ServerLoginVerifyWorld(playerPosition: Position) extends Payload with ServerSide {
require(playerPosition != null)
}
obje... | SKNZ/SpinaciCore | wow/core/src/main/scala/wow/realm/protocol/payloads/ServerLoginVerifyWorld.scala | Scala | mit | 571 |
import scala.tools.nsc.interactive.tests.InteractiveTest
object Test extends InteractiveTest {
override protected def loadSources(): Unit = { /* don't parse or typecheck sources */ }
import compiler._
override def runDefaultTests(): Unit = {
val res = new Response[Tree]
val pos = compiler.rangePos(sour... | scala/scala | test/files/presentation/t7548b/Test.scala | Scala | apache-2.0 | 549 |
/*
* 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/test/scala/fr/acinq/eclair/io/PeerConnectionSpec.scala | Scala | apache-2.0 | 26,288 |
package etlChron
trait Greeting{
lazy val greeting : String = "Hello"
}
object Main extends App with Greeting{
Console.println(greeting + " World: " + "[" + (args mkString ", ") + "]\\n")
} | darkhipo/etlChron | src/main/scala/info/darkhipo/etlChron/Main.scala | Scala | mit | 195 |
package shared.services
import shared.models.SharedDefault.{ SharedAccount, SharedAssigned, SharedJob, SharedJobAndBiz }
import scala.collection.Seq
import scala.concurrent.Future
trait AdminApi {
def getAwayOf(accId: Int): Future[Seq[String]]
def getAccount(): Future[Option[SharedAccount]]
def getAccounts(ro... | workingDog/SilverworkReact | shared/src/main/scala/shared/services/AdminApi.scala | Scala | apache-2.0 | 1,168 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.collection.mutab... | scala/scala | src/library/scala/collection/mutable/Builder.scala | Scala | apache-2.0 | 3,793 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/main/scala/org/apache/carbondata/events/DropIndexEvents.scala | Scala | apache-2.0 | 1,698 |
package im.actor.server.api.rpc.service.messaging
import im.actor.api.rpc.DBIOResult._
import im.actor.api.rpc.PeerHelpers._
import im.actor.api.rpc._
import im.actor.api.rpc.messaging._
import im.actor.api.rpc.misc.{ ResponseSeq, ResponseVoid }
import im.actor.api.rpc.peers.{ ApiOutPeer, ApiPeerType }
import im.actor... | jamesbond12/actor-platform | actor-server/actor-rpc-api/src/main/scala/im/actor/server/api/rpc/service/messaging/HistoryHandlers.scala | Scala | mit | 11,369 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/mutation/SetAction.scala | Scala | apache-2.0 | 1,066 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package kafka.manager.model
import java.util.Properties
import grizzled.slf4j.Logging
import kafka.common.TopicAndPartition
import kafka.manager.jmx._
import kafka.manager.utils
import kafka.manager.... | Knewton/kafka-manager | app/kafka/manager/model/ActorModel.scala | Scala | apache-2.0 | 36,864 |
package org.jetbrains.plugins.scala
package lang.completion
import com.intellij.codeInsight.lookup.{Lookup, CharFilter}
import com.intellij.codeInsight.lookup.CharFilter.Result
import lang.psi.api.ScalaFile
import extensions.Parent
import lang.psi.api.toplevel.imports.ScImportExpr
class ScalaCharFilter extends CharFi... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/completion/ScalaCharFilter.scala | Scala | apache-2.0 | 961 |
package io.swagger.client
import com.typesafe.scalalogging.Logger
import org.slf4j.LoggerFactory
trait Logging {
@transient protected val logger = Logger(LoggerFactory.getLogger(getClass))
}
| swagger-api/swagger-async-httpclient | src/main/scala_2.11/io/swagger/client/Logging.scala | Scala | apache-2.0 | 195 |
package com.twitter.finagle.zipkin.thrift
import com.twitter.finagle.tracing._
import com.twitter.util._
import com.twitter.util.events
import org.junit.runner.RunWith
import org.mockito.Mockito.verify
import org.scalacheck.{Gen, Arbitrary}
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import or... | lukiano/finagle | finagle-zipkin/src/test/scala/com/twitter/finagle/zipkin/thrift/ZipkinTracerTest.scala | Scala | apache-2.0 | 2,960 |
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js tools **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2014, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ **
** /____/\___/_/ |_/... | matthughes/scala-js | tools/shared/src/main/scala/org/scalajs/core/tools/optimizer/OptimizerCore.scala | Scala | bsd-3-clause | 137,121 |
/**
* Copyright 2017 Yurii Lahodiuk (yura.lagodiuk@gmail.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 b... | lagodiuk/tic-tac-toe-minimax-scala | src/main/scala/com/lahodiuk/tic_tac_toe/State.scala | Scala | apache-2.0 | 951 |
class T
trait T
println(/* resolved: false */ T.getClass)
println(classOf[/* resolved: false */ T])
| ilinum/intellij-scala | testdata/resolve2/element/mix/ClassAndTrait.scala | Scala | apache-2.0 | 102 |
// - Project: slogging (https://github.com/jokade/slogging)
// Module: shared
// Description: Defines mixins that provide access to a logger instance
//
// Copyright (c) 2015 Johannes Kastner <jkspam@karchedon.de>
// Distributed under the MIT License (see included file LICENSE)
package slogging
/*... | jokade/slogging | shared/src/main/scala/slogging/logging.scala | Scala | mit | 1,008 |
/*
* 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 ... | zimmermatt/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/rules/logical/PushFilterIntoTableSourceScanRule.scala | Scala | apache-2.0 | 4,975 |
package sectery.producers
import sectery.Rx
import sectery.Tx
object BlinkSpec extends ProducerSpec:
override val specs =
Map(
"@blink foo produces blinking foo" ->
(
List(Rx("#foo", "bar", "@blink foo")),
List(Tx("#foo", "\\u0006foo\\u0006"))
)
)
| earldouglas/sectery | modules/producers/src/test/scala/sectery/producers/BlinkSpec.scala | Scala | mit | 301 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2014 Matthias Langer (t3l@threelights.de)
*
* 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... | bashimao/ltudl | demos/src/main/scala/edu/latrobe/demos/imagenet/TrainBlazeModel.scala | Scala | apache-2.0 | 7,724 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | streaming/src/main/scala/org/apache/spark/streaming/ui/UIUtils.scala | Scala | apache-2.0 | 4,249 |
package sk.eset.dbsystems
import java.io.File
import java.{lang, util}
import org.apache.commons.io.FileUtils
import org.apache.commons.io.FilenameUtils
import org.apache.commons.io.filefilter.DirectoryFileFilter
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.Path
import org.apache.... | andybab/OfflineESIndexGenerator | src/main/scala/sk/eset/dbsystems/ESWriter.scala | Scala | apache-2.0 | 9,839 |
package org.infinispan.spark.rdd
import org.apache.spark.api.java.{JavaPairRDD, JavaSparkContext}
import org.infinispan.query.dsl.Query
import org.infinispan.spark._
import org.infinispan.spark.config.ConnectorConfiguration
import scala.annotation.varargs
import scala.reflect.ClassTag
/**
* @author gustavonalle
... | galderz/infinispan-spark | src/main/scala/org/infinispan/spark/rdd/InfinispanJavaRDD.scala | Scala | apache-2.0 | 2,169 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | massie/adam | adam-core/src/test/scala/org/bdgenomics/adam/models/ProgramRecordSuite.scala | Scala | apache-2.0 | 2,006 |
/*
* Copyright 2017 PayPal
*
* 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 ... | az-qbradley/squbs | squbs-unicomplex/src/test/scala/org/squbs/stream/JavaPerpetualStreamSpec.scala | Scala | apache-2.0 | 8,600 |
package pregnaware.naming
import akka.actor.{ActorContext, ActorRefFactory}
import akka.event.Logging._
import akka.util.Timeout
import com.typesafe.scalalogging.StrictLogging
import com.wordnik.swagger.annotations.{ApiResponse, ApiResponses, ApiOperation, Api}
import pregnaware.naming.entities.{WrappedBabyName, AddNa... | jds106/pregnaware | service/src/main/scala/pregnaware/naming/NamingHttpService.scala | Scala | mit | 5,460 |
package org.flowpaint.util
import scala.xml.{Elem, Node}
import org.flowpaint.property.{Data, DataImpl}
/**
* Common interface for some class that needs configuration and xml serialization support.
*/
trait Configuration {
private val settings: Data = new DataImpl()
def init(initialSettings: Data) {
... | zzorn/flowpaint | src/main/scala/org/flowpaint/util/ConfigurationMetadata.scala | Scala | gpl-2.0 | 2,906 |
package org.jetbrains.plugins.scala
package lang.psi.impl.statements
import com.intellij.openapi.util.TextRange
import com.intellij.psi._
import com.intellij.psi.impl.light.LightElement
import org.jetbrains.plugins.scala.lang.psi.api.expr.{ScBlockExpr, ScExpression}
final class FakePsiCodeBlock(body: ScExpression) ex... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/statements/FakePsiCodeBlock.scala | Scala | apache-2.0 | 1,444 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-fs/geomesa-fs-storage/geomesa-fs-storage-common/src/main/scala/org/locationtech/geomesa/fs/storage/common/metadata/FileBasedMetadata.scala | Scala | apache-2.0 | 20,377 |
/*
* 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/util/ParallelLimitedFn.scala | Scala | apache-2.0 | 1,548 |
/*
* Copyright 2015 Avira Operations GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | Avira/sparser | test/src/test/scala/com/avira/ds/sparser/test/SamplePersonParserTestSuite.scala | Scala | apache-2.0 | 1,756 |
package rros.examples
import java.util.concurrent.CountDownLatch
import rros.{Response, Request, RROSProtocol, SocketListener}
import rros.core.{RROSActorSystem, RROSProtocolImpl}
/**
* Created by namnguyen on 3/2/15.
*/
object TestApp {
//-------------------------------------------------------------------------... | namhnguyen/RROS | src/main/scala/rros/examples/TestApp.scala | Scala | apache-2.0 | 3,332 |
package eventstreams
/*
* Copyright 2014-15 Intelix Pty 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
*
* Unless required by... | intelix/eventstreams | es-instructions/es-instructions-set/src/test/scala/eventstreams/ReplaceInstructionTest.scala | Scala | apache-2.0 | 3,397 |
/*
* Copyright 2022 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/fset-faststream | app/model/exchange/AssistanceDetailsExchange.scala | Scala | apache-2.0 | 2,173 |
package org.igye.learnpl2
import org.junit.{Assert, Test}
class TextFunctionsTest {
@Test
def canWordBeHiddenTest(): Unit = {
Assert.assertTrue(TextFunctions.isHiddable("abc"))
Assert.assertFalse(TextFunctions.isHiddable(","))
Assert.assertFalse(TextFunctions.isHiddable(", "))
... | Igorocky/learnpl2 | src/test/scala/org/igye/learnpl2/TextFunctionsTest.scala | Scala | mit | 5,242 |
/*
* 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 ... | aokolnychyi/spark | resource-managers/yarn/src/test/scala/org/apache/spark/scheduler/cluster/YarnSchedulerBackendSuite.scala | Scala | apache-2.0 | 2,435 |
/*
* Copyright 2013 TeamNexus
*
* TeamNexus Licenses this file to you under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://opensource.org/licenses/mit-license.php
*
* Unless required by applicable law ... | crvidya/nexus-scala | src/main/scala/com/nexus/event/IEventListener.scala | Scala | mit | 814 |
package scredis.io
import com.typesafe.scalalogging.LazyLogging
import akka.actor._
import scredis.Transaction
import scredis.exceptions._
import scredis.protocol._
import scredis.util.UniqueNameGenerator
import scala.util.Try
import scala.concurrent.{ ExecutionContext, Future, Await }
import scala.concurrent.durat... | Livestream/scredis | src/main/scala/scredis/io/AkkaNonBlockingConnection.scala | Scala | apache-2.0 | 2,869 |
trait GeneticAlgorithm {
type Individual = List[Rule]
val PopulationSize: Int
val EliteRatio: Double
val NumberOfRules: Int
val RuleSize: Int
val TournamentSize: Int
val Iterations: Int
val HaliteGridSize: Int
val rng: RandomGen
def winnerOf(i1: Individual, i2: Individual): Individual
//////... | zaklogician/chainsaw | src/main/scala/GeneticAlgorithm.scala | Scala | bsd-3-clause | 4,965 |
/*
* -β₯ββββ -ββββ-
* β‘β’βββββ\\βββΟ ββββββββββββͺβ
* β£β¬ββ` `ββββ’β Οββ£β¬ββ βββ’β£Q
* ββ£β¬ββ ` β€βββΓ
` ββ’β¬β£
* ββ£β¬ββ βββββ`Β«β β’β’β£β
* β«β¬βββ .β ββ¨β¨ β£β£β¬βΟ βΟββ’β’Γ
* ββ’βββββ"ββββ βΓ
ββββββββββ`
* ``ΛΒ¬ β ΛΛβΒ΄
*
* ... | Flipkart/connekt | receptors/src/main/scala/com/flipkart/connekt/receptors/wire/ResponseUtils.scala | Scala | mit | 1,746 |
package fpinscala.datastructures
import org.scalatest.FunSuite
import fpinscala.datastructures.Tree._
/**
* Tree unit tests.
*/
class TreeTest extends FunSuite {
test("size") {
assert(7 === size(
Branch(Branch(Leaf("a"), Leaf("b")), Branch(Leaf("c"), Leaf("d")))))
}
test("max") {
assert(4 === ... | conor10/fpinscala | exercises/src/test/scala/fpinscala/datastructures/TreeTest.scala | Scala | mit | 1,292 |
package demesne.repository
import demesne.AggregateRootType
/**
* Created by rolfsd on 8/19/16.
*/
sealed trait StartProtocol
object StartProtocol {
case object Load extends StartProtocol
case class Loaded(
rootType: AggregateRootType,
resources: Map[Symbol, Any] = Map.empty[Symbol, Any],
depend... | dmrolfs/demesne | core/src/main/scala/demesne/repository/StartProtocol.scala | Scala | apache-2.0 | 1,224 |
package beyond.engine.javascript.lib
import beyond.config.BeyondConfiguration
import beyond.engine.javascript.BeyondContextFactory
import beyond.engine.javascript.JSArray
import beyond.engine.javascript.JSFunction
import com.beyondframework.rhino.ContextOps._
import java.nio.ByteBuffer
import java.nio.charset.Charset
... | SollmoStudio/beyond | core/app/beyond/engine/javascript/lib/ScriptableBuffer.scala | Scala | apache-2.0 | 7,790 |
package com.webtrends.harness.component.kafka.actor
import akka.actor._
import akka.util.Timeout
import com.webtrends.harness.component.kafka.KafkaConsumerCoordinator.TopicPartitionResp
import com.webtrends.harness.component.kafka.util.KafkaSettings
import com.webtrends.harness.component.zookeeper.{ZookeeperAdapter, ... | malibuworkcrew/wookiee-kafka | src/main/scala/com/webtrends/harness/component/kafka/actor/AssignmentDistributorLeader.scala | Scala | apache-2.0 | 7,488 |
package cakesolutions
import akka.actor.ActorSystem
import akka.cluster.Cluster
import akka.cluster.ClusterEvent.MemberUp
import akka.testkit.{TestKit, ImplicitSender, TestProbe}
import cakesolutions.etcd.WithEtcd
import java.util.concurrent.TimeUnit
import net.nikore.etcd.EtcdJsonProtocol.NodeListElement
import org.s... | carlpulley/coreos-example-application | lib/cluster/src/test/scala/cakesolutions/BootableClusterSpec.scala | Scala | apache-2.0 | 2,691 |
/**
* Copyright (C) 2009-2011 the original author or authors.
* See the notice.md file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | maslovalex/scalate | scalate-core/src/main/scala/org/fusesource/scalate/support/RenderHelper.scala | Scala | apache-2.0 | 4,693 |
/*
* Copyright (c) 2015 Miles Sabin
*
* 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... | milessabin/macro-compat | core/src/main/scala_2.10/macrocompat/macrocompat.scala | Scala | apache-2.0 | 9,008 |
package com.blogspot.nurkiewicz.akka.demo.fs
import akka.actor.ActorRef
import com.weiglewilczek.slf4s.Logging
import java.nio.file._
import java.nio.file.StandardWatchEventKinds._
import java.nio.file.attribute.BasicFileAttributes
import collection.JavaConversions._
/**
* @author Tomasz Nurkiewicz
* @since 3/30/13... | nurkiewicz/learning-akka | src/main/scala/com/blogspot/nurkiewicz/akka/demo/fs/WatchServiceTask.scala | Scala | apache-2.0 | 1,630 |
/*
* Copyright (c) 2008, Michael Pradel
* All rights reserved. See LICENSE for details.
*/
package util;
object PerformanceAnalysis {
def measureTime(body: => Unit): Long = {
val t0 = System.nanoTime
body
System.nanoTime - t0
}
}
| tupshin/Scala-Roles | examples/util/PerformanceAnalysis.scala | Scala | bsd-3-clause | 251 |
package com.gilt.aws.lambda
import sbt._
object AwsLambdaPlugin extends AutoPlugin {
object autoImport {
val createLambda = taskKey[LambdaARN]("Create a new AWS Lambda function from the current project")
val updateLambda = taskKey[LambdaARN]("Package and deploy the current project to an existing AWS Lambda... | Jimdo/sbt-aws-lambda | src/main/scala/com/gilt/aws/lambda/AwsLambdaPlugin.scala | Scala | apache-2.0 | 7,466 |
/*
* Copyright Β© 2015-2019 the contributors (see Contributors.md).
*
* This file is part of Knora.
*
* Knora 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
*... | musicEnfanthen/Knora | webapi/src/test/scala/org/knora/webapi/testing/tagobjects/E2ETest.scala | Scala | agpl-3.0 | 896 |
package net.liftmodules
import net.liftweb._
import http._
import org.specs2.mutable.Specification
object FoBoTooResSpec extends Specification {
"FoBoTooResSpec Specification".title
sequential
//Tooltip114
"With fobotoores.Resource.init set to fobotoores.Resource.Tooltip114 the ResourceServer" should {
... | karma4u101/FoBo | Popper/Tooltip-Res/src/test/scala/net/liftmodules/fobotoo/FoBoTooResSpec.scala | Scala | apache-2.0 | 1,109 |
package scommons.client.ui.tree
import scommons.client.ui.TriState._
import scommons.react.test.TestSpec
class CheckBoxTreeDataSpec extends TestSpec {
it should "return flatten nodes list when flattenNodes" in {
//given
val item1 = CheckBoxTreeItemData("item1", Deselected, "/item1")
val item2 = CheckBo... | viktor-podzigun/scommons | ui/src/test/scala/scommons/client/ui/tree/CheckBoxTreeDataSpec.scala | Scala | apache-2.0 | 2,433 |
/*
* 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 ... | trueyao/spark-lever | mllib/src/main/scala/org/apache/spark/mllib/tree/model/Split.scala | Scala | apache-2.0 | 2,809 |
package slinky.docs
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSExportTopLevel, JSImport}
import scala.scalajs.LinkingInfo
import org.scalajs.dom
import org.scalajs.dom.History
import slinky.core.CustomAttribute
import slinky.core.facade.ReactElement
import slinky.web.{ReactDOM, ReactDOMServer}
im... | shadaj/slinky | docs/src/main/scala/slinky/docs/Main.scala | Scala | mit | 3,392 |
/***********************************************************************
* Copyright (c) 2013-2017 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... | ronq/geomesa | geomesa-filter/src/main/scala/org/locationtech/geomesa/filter/function/CurrentDateFunction.scala | Scala | apache-2.0 | 1,032 |
package com.tuvistavie.xserver.protocol.error
import akka.util.ByteString
import com.tuvistavie.xserver.backend.util.Conversions._
import com.tuvistavie.xserver.backend.util.ExtendedByteStringBuilder._
import com.tuvistavie.xserver.backend.util.Config
case class ConnectionError (
message: String
) (
implicit va... | tuvistavie/scala-x-server | backend/src/main/scala/com/tuvistavie/xserver/protocol/Error.scala | Scala | mit | 831 |
package com.datawizards.dmg
import org.scalatest.{FunSuite, Matchers}
trait DataModelGeneratorBaseTest extends FunSuite with Matchers {
def assertResultIgnoringNewLines(expected: String)(result: String): Unit =
stripNewLines(result) should equal(stripNewLines(expected))
private def stripNewLines(v: String): ... | mateuszboryn/data-model-generator | src/test/scala/com/datawizards/dmg/DataModelGeneratorBaseTest.scala | Scala | apache-2.0 | 439 |
package marketdata
trait FeedService {
def getLastTick(subject: String): Option[Tick]
def getTrades(subject: String, sinceTimestamp: Long): List[Trade]
}
| mfahsi/btc-akka-demo | btc-trading-akka/src/main/scala/marketdata/FeedService.scala | Scala | mit | 160 |
/*
# Copyright 2016 Georges Lipka
#
# 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 wri... | glipka/Easy-React-With-ScalaJS | src/main/scala/com/glipka/easyReactJS/reactBootstrap/Media.scala | Scala | apache-2.0 | 1,151 |
package example
import scala.scalajs.js
import rdfstore.Store
import rdfstore.rdf.{Quad, Graph, NamedNode, Triple}
/**
* Created by hjs on 26/12/2013.
*/
object rdfstoreExample {
val console = js.Dynamic.global.console
def main(): Unit = {
console.log("in main()")
//1. Create Store
val store = Sto... | read-write-web/rdfstore.scala.js | src/main/scala/example/rdfstoreExample.scala | Scala | apache-2.0 | 4,033 |
/*
* FactoredAlgorithm.scala
* Trait for algorithms that use factors
*
* Created By: Michael Howard (mhoward@cra.com)
* Creation Date: Jul 1, 2013
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http://ww... | bruttenberg/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/factored/FactoredAlgorithm.scala | Scala | bsd-3-clause | 7,542 |
/*
* 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/models/Inception.scala | Scala | apache-2.0 | 17,002 |
package stefansavev.demo.hyperloglog.counters
import com.clearspring.analytics.stream.cardinality.{HyperLogLogPlus => HLLPP}
class StreamLibHLLPP extends ApproximateCounter {
val hLL = new HLLPP(14, 14)
override def add(obj: Long): Unit = {
hLL.offer(obj)
}
override def distinctCount(): Double = {
h... | dvgodoy/HashingAndSketching | out/production/hyperloglog/stefansavev/demo/hyperloglog/counters/StreamLibHLLPP.scala | Scala | apache-2.0 | 344 |
/**
* This file is part of SensApp [ http://sensapp.modelbased.net ]
*
* Copyright (C) 2011- SINTEF ICT
* Contact: SINTEF ICT <nicolas.ferry@sintef.no>
*
* Module: net.modelbased.sensapp
*
* SensApp is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public L... | SINTEF-9012/sensapp | net.modelbased.sensapp.data.samples/SFCab/transform.scala | Scala | lgpl-3.0 | 2,574 |
package com.twitter.finagle.http2
import com.twitter.finagle.http.AbstractEndToEndTest
import com.twitter.finagle
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class ClientFailUpgradeTest extends AbstractEndToEndTest {
def clientImpl(): finagle.Http.Client =
... | adriancole/finagle | finagle-http2/src/test/scala/com/twitter/finagle/http2/ClientFailUpgradeTest.scala | Scala | apache-2.0 | 510 |
package com.mesosphere.cosmos.circe
import com.mesosphere.cosmos.http.MediaType
import io.finch.DecodeRequest
import scala.reflect.ClassTag
/** Associates relevant metadata with an [[io.finch.DecodeRequest]] instance. */
final class MediaTypedDecoder[A] private(
val decoder: DecodeRequest[A],
val mediaType: Medi... | movicha/cosmos | cosmos-server/src/main/scala/com/mesosphere/cosmos/circe/MediaTypedDecoder.scala | Scala | apache-2.0 | 768 |
package com.eptcomputing.neo4j.rest
import org.scalatest.Spec
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import org.codehaus.jettison.json.{JSONObject, JSONArray}
import org.neo4j.graphdb._
import com.eptcomputing.neo4j.Neo4jServer
@RunWith(cl... | ept/neo4j-resources | src/test/scala/com/eptcomputing/neo4j/rest/JsonConverterSpec.scala | Scala | mit | 6,834 |
package blended.streams.dispatcher.cbe
import java.text.SimpleDateFormat
import java.util.Date
import java.util.concurrent.TimeUnit
import blended.streams.transaction.EventSeverity.EventSeverity
import blended.streams.transaction.FlowTransactionState._
import blended.streams.transaction.{EventSeverity, FlowTransactio... | lefou/blended | blended.streams.dispatcher/src/main/scala/blended/streams/dispatcher/cbe/CbeEvent.scala | Scala | apache-2.0 | 3,586 |
package orderpayment
import com.palantir.docker.compose.DockerComposeRule
import com.palantir.docker.compose.connection.Container
import com.palantir.docker.compose.connection.waiting.{HealthChecks, SuccessOrFailure}
import io.restassured.RestAssured
import org.apache.http.HttpStatus
import org.joda.time.Duration
obj... | labcart/camunda-bpm-reallife | qa/order-payment-stress-testing/src/test/scala/orderpayment/TestStarter.scala | Scala | apache-2.0 | 1,278 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package index
import com.intellij.openapi.project.Project
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.stubs.{StubIndex, StubIndexKey}
import com.intellij.psi.{PsiClass, PsiElement}
import com.intellij.util.CommonPro... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/stubs/index/ScalaIndexKeys.scala | Scala | apache-2.0 | 7,371 |
/**
* Copyright (C) 2012 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | brunobuzzi/orbeon-forms | xforms/jvm/src/test/scala/org/orbeon/oxf/xforms/control/BindingTest.scala | Scala | lgpl-2.1 | 3,556 |
/*
* Copyright (c) 2015 Robert Conrad - All Rights Reserved.
* Unauthorized copying of this file, via any medium is strictly prohibited.
* This file is proprietary and confidential.
* Last modified by rconrad, 1/4/15 2:41 PM
*/
package base.socket.handler
import io.netty.channel.ChannelHandlerContext
/**
* Bas... | robconrad/base-api | project-socket/src/main/scala/base/socket/handler/ExceptionHandler.scala | Scala | mit | 1,329 |
package memcached
import io.netty.bootstrap.Bootstrap
import io.netty.channel._
import io.netty.channel.nio.NioEventLoopGroup
import io.netty.channel.socket.nio.NioSocketChannel
import io.netty.util.internal.logging.{InternalLoggerFactory, Slf4JLoggerFactory}
import memcached.ChannelFutureTransformer.toFuture
import m... | daewon/til | scala/netty/src/main/scala/memcached/NettyClient.scala | Scala | mpl-2.0 | 4,028 |
/*
* Copyright Β© 2015-2019 the contributors (see Contributors.md).
*
* This file is part of Knora.
*
* Knora 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
*... | musicEnfanthen/Knora | webapi/src/test/scala/org/knora/webapi/e2e/v2/JSONLDHandlingV2R2RSpec.scala | Scala | agpl-3.0 | 4,113 |
package org.http4s
package server
package middleware
import scalaz.concurrent.Task
/** [[Middleware]] for lifting application/x-www-form-urlencoded bodies into the
* request query params.
*
* The params are merged into the existing paras _after_ the existing query params. This
* means that if the query alread... | hvesalai/http4s | server/src/main/scala/org/http4s/server/middleware/UrlFormLifter.scala | Scala | apache-2.0 | 1,438 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | bigdatagenomics/PacMin | pacmin-core/src/test/scala/org/bdgenomics/pacmin/overlapping/MinHashableReadSuite.scala | Scala | apache-2.0 | 4,524 |
package mesosphere.marathon
package state
import com.wix.accord.scalatest.ResultMatchers
import mesosphere.UnitTest
import scala.concurrent.duration._
class UnreachableStrategyTest extends UnitTest with ResultMatchers {
def validate = UnreachableStrategy.unreachableStrategyValidator
"UnreachableStrategy.unreac... | Caerostris/marathon | src/test/scala/mesosphere/marathon/state/UnreachableStrategyTest.scala | Scala | apache-2.0 | 1,615 |
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package sbt.protocol.codec
import _root_.sjsonnew.JsonFormat
trait SettingQueryResponseFormats { self: sbt.internal.util.codec.JValueFormats with sjsonnew.BasicJsonProtocol with sbt.protocol.codec.... | Duhemm/sbt | protocol/src/main/contraband-scala/sbt/protocol/codec/SettingQueryResponseFormats.scala | Scala | bsd-3-clause | 625 |
package ch.epfl.callgraph.visualization.view
import org.scalajs.dom.raw.Event
import scalatags.JsDom.all._
object ContextMenu {
val newLayerLink = li(`class` := "context-menu__item")(
a(`class` := "context-menu__link")(
i(`class` := "fa fa-eye")("Expand node to new layer")
)
).render
val expand... | lionelfleury/scala-js-call-graph | visualisation/src/main/scala/ch/epfl/callgraph/visualization/view/ContextMenu.scala | Scala | mit | 1,312 |
/*
* 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 ... | cloud-fan/spark | external/avro/src/test/scala/org/apache/spark/sql/avro/AvroRowReaderSuite.scala | Scala | apache-2.0 | 3,389 |
package com.github.wakfudecrypt.types.data
import com.github.wakfudecrypt._
@BinaryDecoder
case class Resource_12_array_composite_1_array_composite(
_0_int32: Int,
_1_int32: Int,
_2_int32: Int,
_3_int32: Int,
_4_int32: Int,
_5_int32: Int,
_6_int32: Int,
_7_int32: Int,
_8_int32: Int,
_9_str: String... | jac3km4/wakfudecrypt | types/src/main/scala/com/github/wakfudecrypt/types/data/Resource.scala | Scala | mit | 1,235 |
/*
* =========================================================================================
* Copyright Β© 2013-2018 the kamon project <http://kamon.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... | kamon-io/kamon-agent | agent-test/src/test/scala/app/kanela/specs/MultiMixinsInstrumentationSpec.scala | Scala | apache-2.0 | 1,499 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | wangmiao1981/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala | Scala | apache-2.0 | 85,997 |
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.