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 unfiltered.request
import test.AgentStrings
import org.scalatest.{WordSpec, Matchers }
class AgentMatchSpec extends WordSpec with Matchers {
"Chrome strings" should {
"satisfy the chrome predicate" in {
AgentStrings.chrome.map(AgentIs.chromeAM).forall(identity) shouldBe true
}
"fail the fi... | beni55/unfiltered | agents/src/test/scala/AgentMatchSpec.scala | Scala | mit | 3,221 |
package breeze.stats.distributions
/*
Copyright 2009 David Hall, Daniel Ramage
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 a... | dlwh/breeze | math/src/main/scala/breeze/stats/distributions/Rand.scala | Scala | apache-2.0 | 9,438 |
/*
* 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
* distribut... | copygrinder/copygrinder_server | src/main/scala/org/copygrinder/impure/copybean/persistence/FilePersistenceService.scala | Scala | apache-2.0 | 2,089 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* See the LICENCE.txt 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... | mjwallin1/wookiee-spray | src/test/scala/com/webtrends/harness/component/spray/directive/CommandDirectiveSpec.scala | Scala | apache-2.0 | 6,630 |
package warsztat
import org.scalatest.{FlatSpec, Matchers}
class StringConversionsTest extends FlatSpec with Matchers {
it should "convert '123.3' to BigDecimal" in {
import StringConversions._
val converter = implicitly[String => BigDecimal]
val value: BigDecimal = converter("123")
val number:... | bjankie1/warsztat-scala | src/test/scala/warsztat/StringConversionsTest.scala | Scala | apache-2.0 | 387 |
package au.id.cxd.math.example.text.model
import java.io.File
import java.net.URL
import au.id.cxd.math.data.CsvReader
import au.id.cxd.math.example.text.model.LsiModelExample.getClass
import au.id.cxd.math.example.text.model.config.ModelConfig
import au.id.cxd.text.count.TfIdfCount
import au.id.cxd.text.helpers.Embe... | cxd/scala-au.id.cxd.math | examples/src/test/scala/au/id/cxd/math/example/text/model/LsiModelWriteExample.scala | Scala | mit | 4,367 |
package filodb.query.exec.rangefn
import java.util.concurrent.TimeUnit
import scala.concurrent.duration.FiniteDuration
import com.typesafe.config.{Config, ConfigFactory}
import monix.execution.Scheduler.Implicits.global
import monix.reactive.Observable
import org.scalatest.concurrent.ScalaFutures
import filodb.core... | tuplejump/FiloDB | query/src/test/scala/filodb/query/exec/rangefn/ScalarFunctionSpec.scala | Scala | apache-2.0 | 7,841 |
package org.coursera.naptime.ari.graphql.controllers.filters
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class DefaultFilters @Inject() (
queryComplexityFilter: QueryComplexityFilter,
engineMetricsFilter: EngineMetricsFilter)
extends FilterList(List(
queryComplexityFilter,
en... | vkuo-coursera/naptime | naptime-graphql/src/main/scala/org/coursera/naptime/ari/graphql/controllers/filters/DefaultFilters.scala | Scala | apache-2.0 | 340 |
package org.scalatra
import scala.collection.mutable.{HashMap, ListBuffer}
import scala.util.matching.Regex
import scala.util.parsing.combinator.RegexParsers
import java.util.regex.Pattern.{quote => escape}
import ScalatraKernel.MultiParams
import util.MultiMap
/**
* A path pattern optionally matches a request path ... | kuochaoyi/scalatra | core/src/main/scala/org/scalatra/pathPatternParsers.scala | Scala | bsd-2-clause | 4,305 |
package org.algorithms
import org.scalatest.{FunSuite, Matchers}
class PresentsWrapperTest extends FunSuite with Matchers {
val pw = PresentsWrapper()
test("calculate paper for 1x1x1 box") {
pw.squareFor("1x1x1") shouldBe 2 * (1 * 1) + 2 * (1 * 1) + 2 * (1 * 1) + 1
}
test("calculate ribbon ... | Alex-Diez/Scala-Algorithms | advent-code/src/test/scala/org/algorithms/PresentsWrapperTest.scala | Scala | mit | 1,033 |
/*
* 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 ... | rmetzger/flink | flink-table/flink-table-api-scala-bridge/src/main/scala/org/apache/flink/table/api/bridge/scala/StreamTableEnvironment.scala | Scala | apache-2.0 | 45,289 |
package git
import org.joda.time.DateTime
case class PullRequest(number: Int,
author: String,
target: String,
title: String,
intraBranch: Boolean,
createdAt: DateTime,
closedAt: Da... | PRioritizer/PRioritizer-predictor | src/main/scala/git/PullRequest.scala | Scala | mit | 832 |
/*
* 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/streaming/StreamingQueryManager.scala | Scala | apache-2.0 | 14,795 |
package org.kapunga.icelandic
/**
* @author Paul J Thordarson kapunga@gmail.com
*/
package object morph {
val vowelSet: Set[Char] = "aáeéiíoóuúyýæö" match { case x => (x + x.toUpperCase).toSet }
val nonAVowelSet: Set[Char] = (vowelSet - 'a') - 'A'
val aShiftMap: Map[Char, Char] = Map('a' -> 'ö', 'A' -> 'Ö')
... | kapunga/icelandic-sandbox | src/main/scala/org/kapunga/icelandic/morph/package.scala | Scala | mit | 592 |
package net.anti344.rcircuits.network
import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec
import net.anti344.rcircuits.network.packet.Packet
import io.netty.channel.ChannelHandlerContext
import io.netty.buffer.ByteBuf
object PacketCodec extends FMLIndexedMessageToMessageCodec[Packet]{
override def e... | markus23/RedstoneMicrocircuits | src/main/scala/net/anti344/rcircuits/network/PacketCodec.scala | Scala | gpl-2.0 | 522 |
/* Title: Pure/PIDE/command_span.scala
Author: Makarius
Syntactic representation of command spans.
*/
package isabelle
import scala.collection.mutable
object Command_Span
{
sealed abstract class Kind {
override def toString: String =
this match {
case Command_Span(name, _) => pro... | larsrh/libisabelle | modules/pide/2018/src/main/scala/PIDE/command_span.scala | Scala | apache-2.0 | 2,542 |
package org.yotchang4s.ch2
trait Entity[+I] extends Serializable {
val identity: I
override def equals(other: Any): Boolean = {
other match {
case o: Entity[I] => o.identity.equals(identity)
case _ => false
}
}
override def hashCode: Int = 31 * identity.##
} | yotchang4s/gikolet | src/org/yotchang4s/ch2/Entity.scala | Scala | bsd-3-clause | 289 |
package at.magiun.core.statistics
import at.magiun.core.model.data.{DatasetMetadata, Distribution, VariableType}
import at.magiun.core.model.ontology.OntologyClass
import at.magiun.core.{MainModule, UnitTest}
class AlgorithmRecommenderTest extends UnitTest {
private val mainModule = new MainModule {}
private val... | Mihai238/magiun | core/src/test/scala/at/magiun/core/statistics/AlgorithmRecommenderTest.scala | Scala | apache-2.0 | 2,548 |
package scalacookbook.chapter10
/**
* Created by liguodong on 2016/7/30.
*/
object PopulatingCollectionWithRange extends App{
//the range method is available on the companion object of
// supported types like Array, List, Vector, ArrayBuffer, and others.
println(Array.range(1, 5).toList)
println(List.ran... | liguodongIOT/java-scala-mix-sbt | src/main/scala/scalacookbook/chapter10/PopulatingCollectionWithRange.scala | Scala | apache-2.0 | 1,577 |
import scala.tools.partest.ReplTest
object Test extends ReplTest {
def code = """
Map(1 -> "eis").values // no warn
:setting -Xmigration:none
Map(1 -> "eis").values // no warn
:setting -Xmigration:any
Map(1 -> "eis").values // warn
:setting -Xmigration:2.8
Map(1 -> "eis").values // no warn
:setting -Xmig... | yusuke2255/dotty | tests/pending/run/xMigration.scala | Scala | bsd-3-clause | 512 |
/*
* 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/src/test/scala/org/apache/flink/table/api/stream/sql/TemporalTableJoinTest.scala | Scala | apache-2.0 | 4,652 |
package is.hail.expr.ir
import is.hail.ExecStrategy
import is.hail.HailSuite
import is.hail.TestUtils.assertEvalsTo
import is.hail.types.physical.{PCanonicalLocus, PInterval}
import is.hail.types.virtual._
import is.hail.utils.{FastIndexedSeq, FastSeq, Interval}
import is.hail.variant.{Locus, ReferenceGenome}
import o... | danking/hail | hail/src/test/scala/is/hail/expr/ir/LocusFunctionsSuite.scala | Scala | mit | 4,191 |
import scala.io._
// https://github.com/OXCA/read_adjl
object read_adjl extends App {
val sources = Source.fromFile(args(0))
Console.println("init: " + args(0))
sources.getLines foreach ( line => {
line.length match {
case 0 => { Console.println("empty line") }
case _ => {
line(0) match ... | OXCA/ocala | prev/egv0.scala | Scala | gpl-3.0 | 1,374 |
package psyco.scala.basic
/**
* Created by lipeng on 15/8/5.
*/
abstract class CaseClassBase
case class A(name: String) extends CaseClassBase
case class B(name: String, a: A) extends CaseClassBase
case class C(name: String, b: B) extends CaseClassBase
object TestCase {
def run(caseClassBase: CaseClassBase): U... | psyco4j/projects | src/main/scala/psyco/scala/basic/CaseClass.scala | Scala | mit | 712 |
/*
* 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 ... | lxsmnv/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala | Scala | apache-2.0 | 35,431 |
/*
* Copyright 2015 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... | keithhall/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600j/v3/J50.scala | Scala | apache-2.0 | 1,001 |
/*
* 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.conve... | scala/scala | src/library/scala/collection/convert/impl/InOrderStepperBase.scala | Scala | apache-2.0 | 1,463 |
package com.github.jmora.scala.util.io
import org.scalatest.FunSpec
import java.io.File
import scala.io.Source
import scala.io.Codec
import java.net.URI
import java.io.FileOutputStream
class SinkSpec extends FunSpec {
val f = new File("ignoreme.txt")
val text = Seq("Hello world!", "")
def test(s: Sink) = {
... | jmora/scala.util | src/test/scala/com/github/jmora/scala/util/io/SinkSpec.scala | Scala | mit | 1,049 |
/*
* 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.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agre... | mate1/camus2kafka | src/main/scala/com/mate1/camus2kafka/JobRunner.scala | Scala | apache-2.0 | 1,004 |
package com.twitter.finagle.kestrel.unit
import org.specs.SpecificationWithJUnit
import org.specs.mock.Mockito
import org.jboss.netty.buffer.ChannelBuffers
import org.jboss.netty.util.CharsetUtil
import com.twitter.concurrent.Broker
import com.twitter.finagle.kestrel._
class ReadHandleSpec extends SpecificationWith... | joshbedo/finagle | finagle-kestrel/src/test/scala/com/twitter/finagle/kestrel/unit/ReadHandleSpec.scala | Scala | apache-2.0 | 4,090 |
package im.actor.server.migrations
import akka.actor.ActorSystem
import akka.util.Timeout
import im.actor.server.group.GroupErrors.NoBotFound
import im.actor.server.group.{ GroupExtension, GroupOffice, GroupViewRegion }
import im.actor.server.{ KeyValueMappings, persist }
import shardakka.keyvalue.SimpleKeyValue
impor... | lzpfmh/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/migrations/IntegrationTokenMigrator.scala | Scala | mit | 2,088 |
package com.scaledaction.core.examples
import com.typesafe.config.ConfigFactory
import com.typesafe.config.ConfigValue
// sbt assembly
//1. Load configuration from default configuration files
// java -cp core/target/scala-2.10/scaledaction-core-assembly-1.0.jar com.scaledaction.core.examples.TypesafeConfigExperiment... | benburford/core | core/src/main/scala/com/scaledaction/core/examples/TypesafeConfigExperiment.scala | Scala | apache-2.0 | 1,123 |
/*
* 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/iht-frontend | test/iht/controllers/application/exemptions/partner/PartnerNinoControllerTest.scala | Scala | apache-2.0 | 5,537 |
/*
* Copyright (C) 2015 Noorq, 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... | mailrest/mailrest | app/controllers/Application.scala | Scala | apache-2.0 | 791 |
object print_file_lines {
def main(args: Array[String]) {
// Put code here
}
}
| LoyolaChicagoBooks/introcs-scala-examples | print_file_lines/print_file_lines.scala | Scala | gpl-3.0 | 87 |
package de.kalass.batchmonads.base.impl
private [base] class ReturnBatchProcessor extends BatchProcessor {
protected[base] def execute(operationsWithIndices: List[Tuple2[Operation[_], Int]]): BatchProcessorResult = {
val (returnOperations, remaining) = impl.Util.partition[Operation[_], Return[_]](operationsWi... | kkalass/BatchMonads | src/de/kalass/batchmonads/base/impl/ReturnBatchProcessor.scala | Scala | lgpl-3.0 | 499 |
/*
* Types.scala
*
* Copyright (c) 2013 Lonnie Pryor III
*
* 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 ... | lpryor/fulcrum-spike | code/src/main/scala/fulcrum/code/Types.scala | Scala | apache-2.0 | 3,124 |
/*
* 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 ... | pferrel/PredictionIO | examples/scala-parallel-recommendation/custom-prepartor/src/main/scala/Preparator.scala | Scala | apache-2.0 | 1,696 |
package com.chrisomeara.pillar
import java.util.Date
import com.datastax.driver.core.Session
object Migrator {
def apply(registry: Registry): Migrator = {
new CassandraMigrator(registry)
}
def apply(registry: Registry, reporter: Reporter): Migrator = {
new ReportingMigrator(reporter, apply(registry))
... | comeara/pillar | src/main/scala/com/chrisomeara/pillar/Migrator.scala | Scala | mit | 589 |
package com.github.meln1k.reactive.telegrambot.models
/**
* This object represents a point on the map.
* @param longitude Longitude as defined by sender
* @param latitude Latitude as defined by sender
*/
case class Location(longitude: Float, latitude: Float) | meln1k/reactive-telegrambot | src/main/scala/com/github/meln1k/reactive/telegrambot/models/Location.scala | Scala | mit | 263 |
package views.html
package account
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import lila.pref.PrefCateg
import lila.user.User
import controllers.routes
object bits {
def data(u: User)(implicit ctx: Context) =
account.layout(title = s"${u.username} -... | luanlv/lila | app/views/account/bits.scala | Scala | mit | 1,125 |
/*
* 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... | mike0sv/spark | resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnShuffleIntegrationSuite.scala | Scala | apache-2.0 | 5,135 |
/*
* Copyright (C) 2012 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... | openmole/openmole | openmole/plugins/org.openmole.plugin.method.evolution/src/main/scala/org/openmole/plugin/method/evolution/ElitismTask.scala | Scala | agpl-3.0 | 1,691 |
package scalariform.formatter
import scalariform.lexer.Tokens._
import scalariform.lexer._
import scalariform.parser._
import scalariform.utils.Utils._
import scalariform.utils._
import scalariform.utils.BooleanLang._
import scalariform.formatter.preferences._
import PartialFunction._
import scalariform.ScalaVersions
... | gangstead/scalariform | scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala | Scala | mit | 20,581 |
/*
* 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
package runtime
... | martijnhoekstra/scala | src/library/scala/runtime/ScalaRunTime.scala | Scala | apache-2.0 | 12,478 |
package rml.args.logging
import org.slf4j.LoggerFactory
import com.typesafe.scalalogging.{LazyLogging => Logging}
import ch.qos.logback.classic.{Level => LogbackLevel}
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback.classic.spi.ILoggingEvent
import ch.qos.logback.core.ConsoleAppender
i... | rml/scala_args | src/main/scala/rml/args/logging/LoggerManager.scala | Scala | gpl-3.0 | 2,980 |
package es.weso
package object parser {
/** Provides StateParser trait which is an extension of Scapa Parser combinators that threads
* a state
*
* TODO: This library could be refactored using State Monads. However, we wanted to employ a
* minimal extension of parser combinators.
*
*
... | labra/StateParser | stateParser/shared/src/main/scala/package.scala | Scala | lgpl-3.0 | 337 |
package fommil.stalagmite.memory
import _root_.scala._
import _root_.scala.Predef._
import fommil.stalagmite.data
import fommil.stalagmite._
import fommil.stalagmite.TestUtils._
import org.scalacheck._
import Arbitrary.arbitrary
import shapeless.tag.@@
import testing.weakmemoised
// CAUTION: It's recommended to ru... | vovapolu/scala-data-classes | src/test/scala/fommil/stalagmite/memory/MemoryMemoisedBenchmarkMain.scala | Scala | lgpl-3.0 | 2,734 |
package com.etsy.sbt
import sbinary.DefaultProtocol
import sbt._
import xsbti.{AnalysisCallback, DependencyContext, Position, Severity}
import xsbti.compile.DependencyChanges
private[sbt] object Compatibility {
def createPackage(config: Package.Configuration, streams: Keys.TaskStreams): Unit = {
Package(config... | etsy/sbt-compile-quick-plugin | src/main/scala-sbt-0.13/com.etsy.sbt/Compatibility.scala | Scala | mit | 2,161 |
package io.protoless.tests.samples
import io.protoless.tests.samples.TestCaseNested.InnerNested
case class TestCaseNested(
d: Double,
m1: Option[InnerNested],
m2: InnerNested,
rm: Seq[InnerNested])
object TestCaseNested extends TestCase[TestCaseNested] {
case class InnerNested(
bigDecimal: BigDecimal,... | julien-lafont/protoless | modules/testing/src/main/scala/io/protoless/tests/samples/TestCaseNested.scala | Scala | apache-2.0 | 1,331 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/utils/FlinkRelOptUtilTest.scala | Scala | apache-2.0 | 7,980 |
package uk.me.arseni.search.queries
import scala.collection.mutable.ArrayBuffer
/**
* @author Arseni Anisimovich
* @since 26/03/16
*/
trait Query {
def rankResults(results: Map[Int, Double]): Array[(Int, Double)] = {
results.toArray.sortBy(_._2)
}
def findMatchingDocuments(invertedTermIndex: Map[Int... | yarrseni/scala_search_engine | src/main/scala/uk/me/arseni/search/queries/Query.scala | Scala | apache-2.0 | 519 |
package ee.cone.c4ui
import ee.cone.c4actor._
import ee.cone.c4actor.dep.request.LeafInfoHolderTypes.ProductLeafInfoHolder
import ee.cone.c4actor.dep.request._
import ee.cone.c4actor.dep.{Dep, DepFactory, DepFactoryApp}
import ee.cone.c4actor.dep_impl.RequestDep
import ee.cone.c4actor.hashsearch.base.{HashSearchDepReq... | conecenter/c4proto | extra_lib/src/main/scala/ee/cone/c4ui/DepFilterWrapper.scala | Scala | apache-2.0 | 8,601 |
package com.github.diegopacheco.sandbox.scala.akka.agents
import akka.actor._
import akka.agent._
import akka.stm._
import akka.agent.Agent
import akka.actor.Actor._
import akka.actor.{ActorRegistry, Actor}
import akka.remote._
import akka.actor._
object AgentsCode {
def transfer(from: Agent[Int], to: Agent[Int], ... | diegopacheco/scala-playground | akka/src/main/scala/com/github/diegopacheco/sandbox/scala/akka/agents/AgentsCode.scala | Scala | unlicense | 698 |
/*******************************************************************************
* Copyright (c) 2019. Carl Minden
*
* 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 ... | carlminden/anathema-roguelike | src/com/anathema_roguelike/entities/characters/player/perks/abilities/potions/KnockoutGasBomb.scala | Scala | gpl-3.0 | 1,052 |
import sbt.File
import java.io.ByteArrayOutputStream
import java.io.PrintStream
import org.scalastyle._
import Settings._
object StyleChecker {
val maxResult = 100
class CustomTextOutput[T <: FileSpec]() extends Output[T] {
private val messageHelper = new MessageHelper(this.getClass().getClassLoader())
v... | juliengrimault/Scala-Class | streams/project/StyleChecker.scala | Scala | mit | 2,711 |
import sbt._
object Dependencies {
lazy val testKit = Seq(
akkaModule("testkit") % "test",
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"org.scalactic" %% "scalactic" % "3.0.0" % "test",
"org.scalacheck" %% "scalacheck" % "1.13.4" % "test",
"net.databinder.dispatch" %% "dispatch-core" % "+... | B83YPoj/Waves | project/Dependencies.scala | Scala | apache-2.0 | 1,609 |
package slick.lifted
import scala.language.experimental.macros
import scala.reflect.macros.Context
import scala.util.control.NonFatal
/** An isomorphism between two types that can be used for mapped column types. */
class Isomorphism[A, B](val map: A => B, val comap: B => A)
trait MappedToBase extends Any {
type U... | jkutner/slick | slick/src/main/scala/slick/lifted/MappedTo.scala | Scala | bsd-2-clause | 2,334 |
/*
* 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 ... | u2009cf/spark-radar | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/socket.scala | Scala | apache-2.0 | 7,709 |
package io.ticofab
import java.lang.String._
import java.time.LocalDateTime
import com.amazonaws.auth._
import com.amazonaws.auth.profile.ProfileCredentialsProvider
import org.scalatest.{FlatSpec, Matchers}
class AwsSignerSpec extends FlatSpec with Matchers {
// Test Credentials.
val AwsAccessKey = "AKIDEXAMPLE... | ticofab/aws-request-signer | src/test/scala/io/ticofab/AwsSignerSpec.scala | Scala | apache-2.0 | 8,737 |
package io.hnfmr.chapter4
import scala.language.higherKinds
import cats.Monad
import cats.Id
import cats.syntax.flatMap._
import cats.syntax.functor._
import cats.syntax.applicative._
import cats.syntax.option._
import cats.instances.option._
import cats.instances.list._
import scala.concurrent._
import scala.concu... | hnfmr/advanced-scala | src/main/scala/io/hnfmr/chapter4/MonadTut.scala | Scala | mit | 956 |
package com.github.j5ik2o.reactive.redis.command.keys
import java.util.UUID
import com.github.j5ik2o.reactive.redis.RedisIOException
import com.github.j5ik2o.reactive.redis.command.{ CommandRequest, CommandResponse }
import com.github.j5ik2o.reactive.redis.parser.ByteParsers._
import com.github.j5ik2o.reactive.redis.... | j5ik2o/reactive-redis | core/src/main/scala/com/github/j5ik2o/reactive/redis/command/keys/DumpRequest.scala | Scala | mit | 1,653 |
package org.scalajs.core.tools.optimizer
import scala.annotation.switch
import org.scalajs.core.ir
import ir.Position
import ir.Position.NoPosition
import org.scalajs.core.tools.javascript.Trees._
import com.google.javascript.rhino._
import com.google.javascript.jscomp._
import scala.collection.mutable
import scal... | jmnarloch/scala-js | tools/jvm/src/main/scala/org/scalajs/core/tools/optimizer/ClosureAstTransformer.scala | Scala | bsd-3-clause | 13,192 |
package spark.streaming.examples
import spark.streaming._
import spark.streaming.StreamingContext._
/**
* Counts words cumulatively in UTF8 encoded, '\\n' delimited text received from the network every second.
* Usage: StatefulNetworkWordCount <master> <hostname> <port>
* <master> is the Spark master URL. In loc... | prabeesh/Spark-Kestrel | examples/src/main/scala/spark/streaming/examples/StatefulNetworkWordCount.scala | Scala | bsd-3-clause | 2,003 |
/***********************************************************************
* 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... | ddseapy/geomesa | geomesa-convert/geomesa-convert-simplefeature/src/test/scala/org/locationtech/geomesa/convert/simplefeature/SimpleFeatureSimpleFeatureConverterTest.scala | Scala | apache-2.0 | 4,614 |
package json
import com.alibaba.fastjson.JSON
import org.json4s.JsonDSL._
import org.json4s.jackson.JsonMethods._
object JsonString2Object extends App {
val json =new String("{\\"gateway_id\\":\\"1\\"}")
val jsonOjbect = JSON.parseObject(json)
println()
}
| chocolateBlack/LearningSpark | src/main/scala/json/JsonString2Object.scala | Scala | mit | 260 |
/*
* 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 ... | jkbradley/spark | core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferServiceSuite.scala | Scala | apache-2.0 | 5,595 |
package reactivemongo.api.commands
import scala.util.control.NonFatal
import reactivemongo.api.SerializationPack
import reactivemongo.core.errors.GenericDriverException
@deprecated("Internal: will be made private", "0.16.0")
object DropDatabase extends Command with CommandWithResult[UnitBox.type] {
private[api] d... | cchantep/ReactiveMongo | driver/src/main/scala/api/commands/instanceadministration.scala | Scala | apache-2.0 | 19,054 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
import sbt.ScriptedPlugin._
import sbt._
import Keys.{ version, _ }
import com.typesafe.tools.mima.core._
import com.typesafe.tools.mima.plugin.MimaKeys._
import com.typesafe.tools.mima.plugin.MimaPlugin._
import de.heikoseeberger.sbtheader.Au... | Shenker93/playframework | framework/project/BuildSettings.scala | Scala | apache-2.0 | 47,071 |
package viscel.server
import better.files.File
import loci.communicator.ws.jetty.WS.Properties
import loci.communicator.ws.jetty._
import loci.registry.Registry
import org.eclipse.jetty.http.{HttpCookie, HttpHeader, HttpMethod}
import org.eclipse.jetty.rewrite.handler.{RewriteHandler, RewriteRegexRule}
import org.ecli... | rmgk/viscel | code/jvm/src/main/scala/viscel/server/JettyServer.scala | Scala | agpl-3.0 | 9,828 |
package net.fehmicansaglam.tepkin.examples
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.Source
import akka.util.Timeout
import net.fehmicansaglam.bson.BsonDocument
import net.fehmicansaglam.bson.BsonDsl._
import net.fehmicansaglam.tepkin.MongoClient
import scala.collection.immutable.Iterable
impor... | cancobanoglu/tepkin | examples/src/main/scala/net/fehmicansaglam/tepkin/examples/Example1.scala | Scala | apache-2.0 | 2,270 |
/*
*************************************************************************************
* Copyright 2014 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | armeniaca/rudder | rudder-web/src/main/scala/com/normation/rudder/web/components/ComplianceModeEditForm.scala | Scala | gpl-3.0 | 9,694 |
package org.aja.dhira.nn.containers
import java.util
import scala.collection.mutable
import scala.collection.mutable.{AbstractMap, HashMap}
import scala.collection.immutable.TreeMap
import scala.collection.JavaConverters._
/**
* Created by mageswaran on 10/9/16.
* The MapFactory is a mechanism for specifying what ... | Mageswaran1989/aja | src/main/scala/org/aja/dhira/src/main/scala/org/dhira/core/containers/MapFactory.scala | Scala | apache-2.0 | 1,375 |
package controllers.authentication
import javax.inject.Inject
import _root_.services.auth.UserService
import com.mohiva.play.silhouette.api.Authenticator.Implicits._
import com.mohiva.play.silhouette.api._
import com.mohiva.play.silhouette.api.exceptions.ProviderException
import com.mohiva.play.silhouette.api.reposit... | SBP07/backend | app/controllers/authentication/CookieCredentialsAuthController.scala | Scala | gpl-2.0 | 3,856 |
/*
* This file is part of the ToolXiT 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 or agreed t... | gnieh/toolxit-bibtex | src/main/scala/toolxit/bibtex/Entries.scala | Scala | apache-2.0 | 4,294 |
/*
* Copyright 2014 the original author or 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 applicab... | CarloMicieli/first-steps-with-scala | src/test/scala/io/github/carlomicieli/scalakoans/AboutFunctions.scala | Scala | apache-2.0 | 4,890 |
package objsets
import common._
import TweetReader._
/**
* A class to represent tweets.
*/
class Tweet(val user: String, val text: String, val retweets: Int) {
override def toString: String =
"User: " + user + "\n" +
"Text: " + text + " [" + retweets + "]"
}
/**
* This represents a set of objects of typ... | ByzanTine/Coursera-Scala | objsets/src/main/scala/objsets/TweetSet.scala | Scala | mit | 7,355 |
package scala.lms
package epfl
package test5
import common._
import test1._
import java.io.PrintWriter
import java.io.FileOutputStream
trait JSGenEqual extends JSGenBase {
val IR: EqualExp
import IR._
override def emitNode(sym: Sym[Any], rhs: Def[Any]) = rhs match {
case Equal(a,b) => emitValDef(sym, "... | scalan/virtualization-lms-core | test-src/epfl/test5-js/TestConditional.scala | Scala | bsd-3-clause | 3,164 |
/**
* 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... | TRnonodename/CM-Well | server/cmwell-it/src/it/scala/cmwell/it/ExpansionTests.scala | Scala | apache-2.0 | 9,485 |
package japgolly.scalajs.react.component.builder
import japgolly.scalajs.react.internal.Box
private[builder] sealed trait InitState[-P, S]
private[builder] object InitState {
case object Stateless extends InitState[Any, Any]
@inline def stateless[S]: InitState[Any, S] =
Stateless.asInstanceOf[InitState[Any... | japgolly/scalajs-react | coreGeneric/src/main/scala/japgolly/scalajs/react/component/builder/InitState.scala | Scala | apache-2.0 | 595 |
package jp.kenichi.pki
package tsp
import scala.collection.JavaConversions._
import java.util.Base64
import java.net.URL
import java.security.MessageDigest
import org.bouncycastle.cms.CMSAlgorithm
import org.bouncycastle.tsp.TimeStampRequestGenerator
import org.bouncycastle.tsp.TimeStampResponse
import org.bouncycastl... | ken1ma/pades-scala-js | jvm/src/main/scala/jp.kenichi/pki/tsp/BcTspClient.scala | Scala | apache-2.0 | 1,522 |
/**
* @author Victor Caballero (vicaba)
* @author Xavier Domingo (xadobu)
*/
package actors.node
import java.io.{FileWriter, BufferedWriter, PrintWriter, File}
import actors.node.protocol.how.Core
import actors.node.protocol.when.Eager
import transaction.{DB, Transaction}
/**
* This node is responsible for stor... | vicobu/DistributedSystem | src/main/scala/actors/node/CoreNode.scala | Scala | mit | 1,423 |
package sql
import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkContext, SparkConf}
import org.apache.spark.sql._
import org.apache.spark.sql.types._
case class CC(i: Integer)
object SchemaConversion {
val spark =
SparkSession.builder()
.appName("SQL-SchemaConversion")
.master("local[4... | chocolateBlack/LearningSpark | src/main/scala/sql/SchemaConversion.scala | Scala | mit | 885 |
/*
* 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 ... | guoxiaolongzte/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala | Scala | apache-2.0 | 94,509 |
package com.seanshubin.uptodate.logic
import java.net.URI
import java.nio.file.{Path, Paths}
class HttpCache(delegate: Http,
oneWayHash: OneWayHash,
fileSystem: FileSystem,
cacheDirectory: Path,
expireCache: Long,
systemClock: SystemClock... | SeanShubin/up-to-date | logic/src/main/scala/com/seanshubin/uptodate/logic/HttpCache.scala | Scala | unlicense | 1,587 |
/*
* Copyright 2011-2018 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | wiacekm/gatling | gatling-core/src/main/scala/io/gatling/core/controller/inject/InjectionProfile.scala | Scala | apache-2.0 | 1,189 |
package kadai.config
import scalaz.syntax.id._
import ConfigReader._
import com.typesafe.config.Config
class NamedConfigSpec extends org.specs2.mutable.Specification {
val root = Configuration.load("test.conf")
val test = root.get[Configuration]("thing")
case class Server(url: String, port: Int)
implicit va... | simpleenergy/kadai | config/src/test/scala/kadai/config/NamedConfigSpec.scala | Scala | apache-2.0 | 750 |
package com.twitter.finatra.http.internal.exceptions
import com.twitter.finagle.http.Request
import com.twitter.finagle.http.Response
import com.twitter.finatra.http.internal.exceptions.ThrowableExceptionMapper._
import com.twitter.finatra.http.response.ResponseBuilder
import com.twitter.inject.utils.ExceptionUtils._
... | twitter/finatra | http-server/src/main/scala/com/twitter/finatra/http/internal/exceptions/ThrowableExceptionMapper.scala | Scala | apache-2.0 | 2,448 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | psyyz10/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/ConcatSpec.scala | Scala | apache-2.0 | 1,124 |
package com.softwaremill.codebrag.usecases.reactions
import com.softwaremill.codebrag.cache.UserReviewedCommitsCache
import com.softwaremill.codebrag.common.{EventBus, Clock}
import com.softwaremill.codebrag.dao.commitinfo.CommitInfoDAO
import com.softwaremill.codebrag.dao.user.UserDAO
import com.softwaremill.codebrag... | softwaremill/codebrag | codebrag-service/src/main/scala/com/softwaremill/codebrag/usecases/reactions/ReviewAllCommitsUseCase.scala | Scala | agpl-3.0 | 1,828 |
package org.libss.logic.guice
import java.util.concurrent.atomic.AtomicReference
import com.google.inject.multibindings.Multibinder
import com.google.inject.{AbstractModule, Guice, Injector, Module}
import scala.annotation.tailrec
import scala.util.Try
/**
* date: 02.06.2016 23:44
* author: Kaa
*
* This obj... | kanischev/libss | libss-logic/src/main/scala/org/libss/logic/guice/InjectorHolder.scala | Scala | apache-2.0 | 1,891 |
package tastytest
import intent._
class TestIntent extends TestSuite with Stateless {
apply("3 + 3") {
in("should be 6")(toEqual(expect(3 + 3))(6))
}
}
| scala/scala | test/tasty/neg/src-2/TestIntent_fail.scala | Scala | apache-2.0 | 162 |
/*
* 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 ... | sahilTakiar/spark | core/src/main/scala/org/apache/spark/util/Utils.scala | Scala | apache-2.0 | 108,013 |
package se.gigurra.leavu3.interfaces
import com.twitter.finagle.FailedFastException
import com.twitter.finagle.http.Status
import com.twitter.util.{Duration, Future}
import se.gigurra.leavu3.datamodel._
import se.gigurra.leavu3.gfx.Drawable
import se.gigurra.leavu3.util._
import com.github.gigurra.serviceutils.json.JS... | GiGurra/leavu3 | src/main/scala/se/gigurra/leavu3/interfaces/GameIn.scala | Scala | mit | 7,158 |
package com.eigengo.lift.exercise.classifiers.svm
import breeze.linalg._
import breeze.numerics._
import org.scalacheck.Arbitrary.arbitrary
import org.scalacheck.Gen
import org.scalacheck.Gen._
import org.scalatest._
import org.scalatest.prop._
class SVMClassifierPropertyTest extends PropSpec with PropertyChecks with... | ceecer1/open-muvr | server/exercise/src/test/scala/com/eigengo/lift/exercise/classifiers/svm/SVMClassifierPropertyTest.scala | Scala | apache-2.0 | 6,805 |
package doodle
package jvm
import doodle.core._
import doodle.backend._
import javax.swing.JFrame
final class Java2DFrame(finaliser: Finaliser, renderer: Renderer)
extends JFrame
with Interpreter.Draw {
val panel = new Java2DPanel(finaliser, renderer)
getContentPane().add(panel)
pack()
repaint()
se... | Angeldude/doodle | jvm/src/main/scala/doodle/jvm/Java2DFrame.scala | Scala | apache-2.0 | 663 |
/*
* 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/src/main/scala/org/apache/flink/table/factories/TableFactoryService.scala | Scala | apache-2.0 | 11,893 |
/*
* Copyright 2001-2015 Artima, 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 agre... | scalatest/scalatest | jvm/common-test/src/main/scala/org/scalatest/prop/package.scala | Scala | apache-2.0 | 21,701 |
package at.ac.tuwien.ifs.ir.evaluation.pool
import at.ac.tuwien.ifs.ir.model._
import scala.annotation.tailrec
/**
* Created by aldo on 29/03/16.
* Implementation of the pooling stragtegies studied in the following paper:
* Moffat, Alistair, William Webber, and Justin Zobel. "Strategic system
* comparisons v... | aldolipani/PoolBiasEstimators | src/main/scala/at/ac/tuwien/ifs/ir/evaluation/pool/RBPBasedPool.scala | Scala | apache-2.0 | 3,256 |
/*
* 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/test/scala/org/apache/carbondata/view/rewrite/TestPartitionWithMV.scala | Scala | apache-2.0 | 40,843 |
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.