code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
/**
* Copyright (c) 2012, www.quartzsource.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 la... | cyberspinach/meutrino | src/test/scala/org/quartzsource/meutrino/hglib/StatusTest.scala | Scala | apache-2.0 | 2,752 |
package com.github.radium226.logging
import org.slf4j.LoggerFactory
trait Logging {
val logger = LoggerFactory.getLogger(getClass)
def info(message: String, arguments: Any*): Unit = {
logger.info(message, arguments.map(_.asInstanceOf[Object]):_*)
}
def debug(message: String, arguments: Any*): Unit = {
... | radium226/face-recognizer | video-stream/src/main/scala/com/github/radium226/logging/Logging.scala | Scala | gpl-2.0 | 395 |
/*
* Copyright 2014 IBM Corp.
*
* 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... | bpburns/spark-kernel | kernel-api/src/main/scala/com/ibm/spark/interpreter/ScalaInterpreter.scala | Scala | apache-2.0 | 11,457 |
/*
* 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 ... | h2oai/sparkling-water | scoring/src/main/scala/ai/h2o/sparkling/ml/params/HasFeatureTypesOnMOJO.scala | Scala | apache-2.0 | 1,207 |
package io.getquill.codegen.util
import java.io.Closeable
import io.getquill.{ H2Dialect => TheDialect, H2JdbcContext => TheContext, Literal, SnakeCase }
import io.getquill.codegen.integration.CodegenTestCases._
import io.getquill.codegen.util.ConfigPrefix.{ TestH2DB => TheDB }
import javax.sql.DataSource
trait With... | getquill/quill | quill-codegen-tests/src/test/scala/io/getquill/codegen/util/WithH2Context.scala | Scala | apache-2.0 | 4,571 |
package com.cterm2.miniflags.common
// Enumerated Color
package object EnumColor
{
sealed abstract class Type(val value: Int, val r: Float, val g: Float, val b: Float)
case object White extends Type( 0, 1.0f, 1.0f, 1.0f)
case object Orange extends Type( 1, 1.0f, 0.5f, 0.0f)
case object Magenta extends Type( 2, ... | Pctg-x8/miniflags | src/common/color.scala | Scala | lgpl-2.1 | 1,464 |
package org.shade.common.file
import org.scalatest.{Matchers, WordSpec}
class FilenameSpec extends WordSpec with Matchers {
"Constructing a filename" should {
"file if the filename is empty" in {
an [IllegalArgumentException] should be thrownBy Filename("")
}
"fail if the filename contains a s... | jamesshade/common | src/test/scala/org/shade/common/file/FilenameSpec.scala | Scala | apache-2.0 | 1,294 |
/*
* 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/views/application/debts/FuneralExpensesViewTest.scala | Scala | apache-2.0 | 2,739 |
/*
* 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/vat-registration-frontend | app/models/external/addresslookup/AddressLookupConfigurationModel.scala | Scala | apache-2.0 | 1,056 |
package exercises
import org.scalatest.FunSuite
/**
* Created by damiengoblot on 2017-04-16.
*/
class p01LastElementSuite extends FunSuite {
test("last: list of ints") {
assert(new p01LastElement().last(List(0, 1, 2, 3, 8, 5)) === 5)
}
test("last: list of strings") {
assert(
new p01LastElemen... | damien75/99-scala-problems | src/test/scala/exercises/p01LastElementSuite.scala | Scala | mit | 527 |
import scala.tools.nsc._
object Test {
/**
* Type inference overlooks constraints posed by type parameters in annotations on types.
*/
val testCode = """
class posingAs[A] extends annotation.TypeConstraint
def resolve[A,B](x: A @posingAs[B]): B = x.asInstanceOf[B]
val x = reso... | yusuke2255/dotty | tests/pending/run/t1500.scala | Scala | bsd-3-clause | 1,002 |
package forimpatient.chapter04
/**
* Created by Iryna Kharaborkina on 7/30/16.
*
* Solution to the Chapter 04 Exercise 09 'Scala for the Impatient' by Horstmann C.S.
*
* Write a function lteqgt(values: Array[Int], v: Int) that returns a triple containing
* the counts of values less than v, equal to v, and... | Kiryna/Scala-for-the-Impatient | src/forimpatient/chapter04/Exercise09.scala | Scala | apache-2.0 | 611 |
package com.datastax.spark.connector.writer
import java.util.concurrent.atomic.AtomicLong
import scala.annotation.tailrec
/** A leaking bucket rate limiter.
* It can be used to limit rate of anything,
* but typically it is used to limit rate of data transfer.
*
* It starts with an empty bucket.
* When pack... | datastax/spark-cassandra-connector | connector/src/main/scala/com/datastax/spark/connector/writer/RateLimiter.scala | Scala | apache-2.0 | 2,326 |
final class Option[+A](val value: A) extends AnyVal
// Was: sandbox/test.scala:21: error: bridge generated for member method f: ()Option[A] in class Bar
// which overrides method f: ()Option[A] in class Foo"
abstract class Foo[A] { def f(): Option[A] }
class Bar[A] extends Foo[A] { def f(... | loskutov/intellij-scala | testdata/scalacTests/pos/t6260a.scala | Scala | apache-2.0 | 701 |
package org.allenai.common.testkit
/** Base class for any unit test that, for some reason, want to share the Spec instance.
* Usually the reason is a slow expensive test setup time (setting up a 3rd party DB, etc.)
*/
abstract class SingeInstanceUnitSpec extends AllenAiBaseSpec
| allenai/common | testkit/src/main/scala/org/allenai/common/testkit/SingeInstanceUnitSpec.scala | Scala | apache-2.0 | 284 |
package cc.abstra.scuby
import org.jruby.{RubyException => JRubyException}
/**
* Wrapper around an org.jruby.RubyException that shows both the Java and the JRuby backtraces
* @param exception the contained org.jruby.RubyException
*/
case class RubyException(exception:JRubyException) extends Exception(exception.toSt... | usr/scuby | src/main/scala/cc/abstra/scuby/RubyException.scala | Scala | bsd-3-clause | 901 |
package com.sksamuel.elastic4s
import org.scalatest.FlatSpec
import org.scalatest.Matchers
import ElasticDsl._
/** @author Stephen Samuel */
class GetDslTest extends FlatSpec with Matchers with ElasticSugar {
"a get by id request" should "accept tuple for from" in {
val req = get id 123 from "places" -> "citie... | l15k4/elastic4s | elastic4s-core/src/test/scala/com/sksamuel/elastic4s/GetDslTest.scala | Scala | apache-2.0 | 1,983 |
package com.karasiq.nanoboard
import java.time.format.{DateTimeFormatter, DateTimeFormatterBuilder, TextStyle}
import java.time.temporal.ChronoField
import java.time.{ZoneId, ZonedDateTime}
import java.util.Locale
import com.typesafe.config.{Config, ConfigFactory}
import scala.util.Try
object NanoboardMessageGenera... | Karasiq/nanoboard | library/src/main/scala/com/karasiq/nanoboard/NanoboardMessageGenerator.scala | Scala | apache-2.0 | 1,800 |
/*
* Copyright 2017 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... | iteratoruk/microservice-bootstrap | src/main/scala/uk/gov/hmrc/play/microservice/filters/DefaultToNoCacheFilter.scala | Scala | apache-2.0 | 1,343 |
/*
* Copyright 2020 CJWW Development
*
* 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 agree... | cjww-development/session-store | app/common/ErrorHandler.scala | Scala | apache-2.0 | 2,607 |
/*
* 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/test/scala/org/neo4j/cypher/internal/compiler/v2_3/pipes/UnionPipeTest.scala | Scala | apache-2.0 | 2,243 |
/*
@meta {
"processorId": "org.helgoboss.scala_bundle:1.0.0",
"projectId": "org.helgoboss:automatic-commandlet-executor:1.0-SNAPSHOT",
"dependencies": [
"com.weiglewilczek.scala-lang-osgi:scala-library:2.9.1",
"org.helgoboss:commons-scala-osgi:1.0-SNAPSHOT",
"org.helgoboss:mini-obr-runti... | helgoboss/automatic-commandlet-executor | org.helgoboss.automatic-commandlet-executor.scala | Scala | mit | 1,573 |
package pkg1
private class A {
//def foo: Int = 1
}
| dotty-staging/dotty | sbt-test/source-dependencies/pkg-private-class/changes/A.scala | Scala | apache-2.0 | 54 |
package com.cloudray.scalapress.util
import org.springframework.stereotype.Component
import org.springframework.beans.factory.annotation.Value
import javax.annotation.PostConstruct
import com.cloudray.scalapress.framework.Logging
/** @author Stephen Samuel */
@Component
class UrlGeneratorBootstrap extends Logging {
... | vidyacraghav/scalapress | src/main/scala/com/cloudray/scalapress/util/UrlGeneratorBootstrap.scala | Scala | apache-2.0 | 662 |
package argon.codegen.chiselgen
import argon.core._
import argon.codegen.FileGen
trait ChiselFileGen extends FileGen {
override protected def emitMain[S:Type](b: Block[S]): Unit = emitBlock(b)
override protected def process[S:Type](b: Block[S]): Block[S] = {
// // Forcefully create the following streams
... | stanford-ppl/spatial-lang | spatial/core/src/spatial/codegen/chiselgen/ChiselFileGen.scala | Scala | mit | 17,930 |
package pipelines.images.voc
import java.io.File
import breeze.linalg._
import breeze.stats._
import evaluation.MeanAveragePrecisionEvaluator
import loaders.{VOCDataPath, VOCLabelPath, VOCLoader}
import nodes.images.external.{FisherVector, SIFTExtractor}
import nodes.images._
import nodes.learning._
import nodes.stat... | tomerk/keystone | src/main/scala/pipelines/images/voc/VOCSIFTFisher.scala | Scala | apache-2.0 | 6,283 |
/*
Implement uncurry, which reverses the transformation of curry.
Note that since => associates to the right, A => (B => C) can be written as A => B => C.
*/
def uncurry[A,B,C](f: A => B => C): (A, B) => C = {
(a, b) => f(a)(b)
/* Can also be written as
(a, b) => {
val func1 = f(a)
func1(b)
}
*/
}
/*
- u... | wkimeria/fp_scala_for_mortals | chapter_2/exercises/exercise_4.scala | Scala | mit | 1,483 |
package org.jetbrains.plugins.scala
package lang.actions.editor
import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter
import org.jetbrains.plugins.scala.editor.typedHandler.ScalaTypedHandler
import org.jetbrains.plugins.scala.lang.formatting.settings.ScalaCodeStyleSettings
/**
* User: Dmitr... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/lang/actions/editor/ArrowTypingTest.scala | Scala | apache-2.0 | 2,920 |
/*
* 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 ... | goldmedal/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/DataSourceReadBenchmark.scala | Scala | apache-2.0 | 21,561 |
package com.boldradius.astrolabe.http
sealed trait NodeState
case object Up extends NodeState
case object Unreachable extends NodeState
case object Removed extends NodeState
case object Exited extends NodeState
| boldradius/cluster-console | shared/src/main/scala/com/boldradius/astrolabe/http/NodeState.scala | Scala | bsd-3-clause | 212 |
package com.softwaremill.sql
import java.sql.ResultSet
import com.softwaremill.sql.TrackType.TrackType
import scalikejdbc._
object ScalikejdbcTests extends App with DbSetup {
dbSetup()
ConnectionPool.add('tests, "jdbc:postgresql:sql_compare", "postgres", "")
def db: NamedDB = NamedDB('tests)
// -- 1.
/... | adamw/sql-compare-pres | src/main/resources/clean/ScalikejdbcTests.scala | Scala | apache-2.0 | 382 |
package filodb.repair
import com.typesafe.config.{ConfigFactory, ConfigRenderOptions}
import filodb.core.GlobalConfig
import org.apache.spark.SparkConf
import org.scalatest.{BeforeAndAfterAll, DoNotDiscover}
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.match... | filodb/FiloDB | spark-jobs/src/test/scala/filodb/repair/ChunkCopierValidatorSpec.scala | Scala | apache-2.0 | 1,700 |
package com.garnercorp.swdvm
import com.github.nscala_time.time.Imports._
trait Dates {
def date(year: Int, month: Int, day: Int) = dateTime(year, month, day)
def dateTime(year: Int, month: Int, day: Int, hour: Int = 0, minute: Int = 0, second: Int = 0) =
new DateTime(year, month, day, hour, minute, second)
... | thinkingbox/velmod | src/test/scala/com/garnercorp/swdvm/Dates.scala | Scala | apache-2.0 | 404 |
/*
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2017-2018 Alexis Seigneurin.
*
* 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 o... | ollie314/kafka | streams/streams-scala/src/main/scala/org/apache/kafka/streams/scala/Serdes.scala | Scala | apache-2.0 | 3,545 |
package scala.slick.driver
import scala.slick.profile.SqlTableComponent
import scala.slick.ast.ColumnOption
trait JdbcTableComponent extends SqlTableComponent { driver: JdbcDriver =>
trait ColumnOptions extends super.ColumnOptions {
val NotNull = ColumnOption.NotNull
val Nullable = ColumnOption.Nullable
... | retronym/slick | src/main/scala/scala/slick/driver/JdbcTableComponent.scala | Scala | bsd-2-clause | 401 |
package net.lshift.diffa.kernel.util
import org.joda.time.DateTime
import org.hamcrest.{Description, BaseMatcher}
/**
* Helpers for use in JUnit Hamcrest (eg, assertThat) expressions allowing datetimes to be asserted upon in a nice
* manner.
*/
object HamcrestDateTimeHelpers {
def after(t:DateTime) = new BaseMat... | aprescott/diffa | kernel/src/test/scala/net/lshift/diffa/kernel/util/HamcrestDateTimeHelpers.scala | Scala | apache-2.0 | 746 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/stream/sql/TemporalJoinITCase.scala | Scala | apache-2.0 | 6,387 |
import akka.actor.{ActorSystem, Props}
import akka.testkit.{ImplicitSender, TestActors, TestKit}
import hu.bme.mit.ire.datatypes.Path
import hu.bme.mit.ire.messages.ChangeSet
import hu.bme.mit.ire.nodes.unary.TransitiveClosureNode
import hu.bme.mit.ire.util.TestUtil._
import org.scalatest.{BeforeAndAfterAll, Matchers, ... | FTSRG/ire | src/test/scala/TransitiveClosureNodeTest.scala | Scala | epl-1.0 | 7,289 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package base
package patterns
import org.jetbrains.plugins.scala.lang.psi.types.api.{Any, TupleType}
import org.jetbrains.plugins.scala.lang.psi.types.result.TypingContext
/**
* @author Alexander Podkhalyuzin
* Date: 28.02.2008
*/
trait ScTupl... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/base/patterns/ScTuplePattern.scala | Scala | apache-2.0 | 583 |
/*
* 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 ... | yu-iskw/gihyo-spark-book-example | src/main/scala/jp/gihyo/spark/ch06/gihyo_6_3_reduceByKey.scala | Scala | apache-2.0 | 1,616 |
/*
* 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/boxes/AC130E.scala | Scala | apache-2.0 | 1,170 |
package org.openurp.edu.eams.teach.program.major.service
@SerialVersionUID(-6860578234314582201L)
class MajorPlanGenException(arg0: String, arg1: Throwable) extends Exception(arg0,arg1) {
}
| openurp/edu-eams-webapp | core/src/main/scala/org/openurp/edu/eams/teach/program/major/service/MajorPlanGenException.scala | Scala | gpl-3.0 | 194 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | Parth-Brahmbhatt/kafka | core/src/main/scala/kafka/api/OffsetCommitResponse.scala | Scala | apache-2.0 | 2,890 |
/**
* 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 us... | Zhiqiang-He/kafka-0914-edit | core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala | Scala | apache-2.0 | 26,349 |
package org.functionalkoans.forscala
import org.functionalkoans.forscala.support.KoanFunSuite
import org.scalatest.Matchers
import org.scalatest.Matchers
class AboutIterables extends KoanFunSuite with Matchers {
koan( """Iterable is a trait that has the ability to return an iterator of itself.
| Some know... | pharmpress/codingdojo | scala-koans/src/test/scala/org/functionalkoans/forscala/AboutIterables.scala | Scala | apache-2.0 | 3,734 |
/***********************************************************************
* 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-orc/src/main/scala/org/locationtech/geomesa/fs/storage/orc/OrcFileSystemWriter.scala | Scala | apache-2.0 | 2,323 |
package lila.security
case object Fixtures {
def text = """
leeching.net
ChaCuo.net
027168.com
0-mail.com
mail1a.de
0815.ru
0815.su
0clickemail.com
0sg.net
0wnd.net
0wnd.org
10mail.org
123-m.com
1ce.us
1chuan.com
1mail.ml
1pad.de
1zhuan.com
20email.eu
20mail.in
20mail.it
21cn.com
2prong.com
30mail.ir
3126.com
33mai... | luanlv/lila | modules/security/src/test/Fixtures.scala | Scala | mit | 16,459 |
package domala.jdbc
/**
* A batch processing result for immutable entities.
*
* @tparam ENTITY
* the entity type
* @param counts
* the array of the affected row count
* @param entities
* the entity list
*/
case class BatchResult[ENTITY](counts: Array[Int], entities: S... | bakenezumi/domala | core/src/main/scala/domala/jdbc/BatchResult.scala | Scala | apache-2.0 | 332 |
package utils
import java.util.Date
import java.lang.Math._
object Score {
def score(up: Long, down: Long) = up - down
def hot(up: Long, down: Long, time: Date) = {
_hot(up, down, time.getTime/1000)
}
def _hot(up: Long, down: Long, time: Double) = {
val s = score(up, down)
val order = log10(max(... | lequangdzung/quora-clone | api-app/app/utils/Score.scala | Scala | gpl-2.0 | 1,463 |
object Test {
val f2: Tuple2[Int, String] => Int = (x, y) => x
val g2: Tuple2[Int, String] => Int = _ + _.length
// FIXME issue #5257
// val h2: Int *: Int *: Unit => Int = (x, y) => x + y
// val k2: Int *: Tuple1[Int] => Int = (x, y) => x + y
type T2 = Tuple2[Int, Int]
val h2: T2 => Int = (x1, x2) => 2... | som-snytt/dotty | tests/pos/automatic-tupling-of-function-parameters.scala | Scala | apache-2.0 | 2,156 |
/*
* 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 ... | irudyak/ignite | modules/scalar/src/main/scala/org/apache/ignite/scalar/lang/ScalarClosure3Function.scala | Scala | apache-2.0 | 1,242 |
/* Title: Pure/General/pretty.scala
Author: Makarius
Generic pretty printing module.
*/
package isabelle
object Pretty
{
/* XML constructors */
val space: XML.Body = List(XML.Text(Symbol.space))
def spaces(n: Int): XML.Body =
if (n == 0) Nil
else if (n == 1) space
else List(XML.Text... | larsrh/libisabelle | modules/pide/2019-RC4/src/main/scala/General/pretty.scala | Scala | apache-2.0 | 6,589 |
/*-------------------------------------------------------------------------*\\
** ScalaCheck **
** Copyright (c) 2007-2021 Rickard Nilsson. All rights reserved. **
** http://www.scalacheck.org **
** ... | rickynils/scalacheck | src/main/scala/org/scalacheck/Properties.scala | Scala | bsd-3-clause | 4,937 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | jmnarloch/akka.js | akka-js-actor/shared/src/main/scala/akka/routing/MurmurHash.scala | Scala | bsd-3-clause | 5,166 |
package dpla.ingestion3.mappers.providers
import dpla.ingestion3.enrichments.normalizations.StringNormalizationUtils._
import dpla.ingestion3.enrichments.normalizations.filters.{DigitalSurrogateBlockList, FormatTypeValuesBlockList}
import dpla.ingestion3.mappers.utils.{Document, XmlMapping, XmlExtractor}
import dpla.i... | dpla/ingestion3 | src/main/scala/dpla/ingestion3/mappers/providers/EsdnMapping.scala | Scala | mit | 8,366 |
package org.fedoraproject.mobile
import android.app.Fragment
import android.content.Context
import android.view.View
import scalaz.concurrent.Task
trait TypedFragment extends Fragment with TypedActivityHolder {
def findViewById(x: Int): View = getView.findViewById(x)
def activity = getActivity
def runOnUiThrea... | fedora-infra/mobile | src/main/scala/util/TypedFragment.scala | Scala | mpl-2.0 | 619 |
/*
* Copyright 2013 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... | vert-x/mod-lang-scala | src/main/scala/org/vertx/scala/core/datagram/DatagramSocket.scala | Scala | apache-2.0 | 12,142 |
package io.igu.cityindex.market.model
case class MarketInformationResponse(marketInformation: MarketInformation)
case class MarketEod(marketEodUnit: String,
marketEodAmount: Double)
case class StartTimeUtc(utcDateTime: String,
offsetMinutes: Double)
case class MarketPric... | deadcore/city-index-scala-api | src/main/scala/io/igu/cityindex/market/model/MarketInformationResponse.scala | Scala | apache-2.0 | 5,065 |
package sc.ala.rubyist
import java.security.MessageDigest
object Digest {
object MD5 {
// code is derived from
// http://code-redefined.blogspot.com/2009/05/md5-sum-in-scala.html
def hexdigest(str:String): String = {
val md5 = MessageDigest.getInstance("MD5")
md5.reset()
md5.update(str... | maiha/rubyist | src/main/scala/sc/ala/rubyist/Digest.scala | Scala | mit | 428 |
/**
* Copyright 2011-2017 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 appli... | MykolaB/gatling | gatling-app/src/main/scala/io/gatling/app/Runner.scala | Scala | apache-2.0 | 4,541 |
package xerial.lens
import collection.mutable
import java.io.File
import java.text.DateFormat
import mutable.ArrayBuffer
import java.lang.{reflect => jr}
import xerial.core.log.Logger
import scala.reflect.ClassTag
import scala.reflect.runtime.{universe => ru}
import scala.reflect.runtime.universe.TypeTag
im... | xerial/xerial | xerial-lens/src/main/scala/xerial/lens/TypeUtil.scala | Scala | apache-2.0 | 8,859 |
/*
* Copyright (c) 2018. Fengguo Wei and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0
* which accompanies this distribution, and is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* Detailed contributors ar... | arguslab/Argus-SAF | src/main/scala/org/argus/saf/Main.scala | Scala | apache-2.0 | 14,916 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package io.scalaland.chimney.examples.pb.addressbook
sealed trait PhoneType {
type EnumType = PhoneType
def isMobile: _root_.scala.Boolean = false
def isHome: _root_.scala.Boolean = false
def isWo... | scalalandio/chimney | protos/src/test/scala/io.scalaland.chimney.examples.pb.addressbook/PhoneType.scala | Scala | apache-2.0 | 1,273 |
/*
* This software is licensed under the GNU Affero General Public License, quoted below.
*
* This file is a part of PowerAPI.
*
* Copyright (C) 2011-2014 Inria, University of Lille 1.
*
* PowerAPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public Lice... | rouvoy/powerapi | powerapi-core/src/main/scala/org/powerapi/reporter/JFreeChartDisplay.scala | Scala | agpl-3.0 | 1,585 |
package spinoco.fs2.http.internal
import fs2.Chunk.ByteVectorChunk
import fs2._
import scodec.bits.ByteVector
import spinoco.fs2.http.util.chunk2ByteVector
/**
* Created by pach on 20/01/17.
*/
object ChunkedEncoding {
/** decodes from the HTTP chunked encoding. After last chunk this terminates. Allows to sp... | Spinoco/fs2-http | src/main/scala/spinoco/fs2/http/internal/ChunkedEncoding.scala | Scala | mit | 3,447 |
package scorex.consensus
import scorex.account.{PrivateKeyAccount, Account}
import scorex.block.{BlockProcessingModule, Block}
import scorex.transaction.{TransactionModule, History, State}
import scala.concurrent.Future
trait ConsensusModule[ConsensusBlockData] extends BlockProcessingModule[ConsensusBlockData]{
... | beni55/Scorex-Lagonaki | scorex-basics/src/main/scala/scorex/consensus/ConsensusModule.scala | Scala | cc0-1.0 | 1,191 |
/*
* Copyright 2016, 2017 TECNOLOGIA, SISTEMAS Y APLICACIONES S.L. <http://www.tecsisa.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/LICEN... | Tecsisa/constructr-consul | constructr-coordination-testing/src/multi-jvm/scala/com/tecsisa/constructr/akka/consul/MultiNodeConsulConstructrSpec.scala | Scala | apache-2.0 | 2,070 |
package almhirt.almvalidation
import org.scalatest._
import almhirt.common._
import almhirt.problem._
class SeveritySpec extends FlatSpec with Matchers {
"A Severity combines always to the most severe and so" should
"return 'Critical' when 'Critical' and 'Critical'" in {
Critical.and(Critical) should equ... | chridou/almhirt | almhirt-common/src/test/scala/almhirt/almvalidation/SeveritySpec.scala | Scala | apache-2.0 | 1,219 |
package scala.pickling
package pickler
import java.util.UUID
trait JavaUUIDPicklers extends PrimitivePicklers {
implicit val javaUUIDPickler: AbstractPicklerUnpickler[UUID] = {
new AbstractPicklerUnpickler[UUID] with AutoRegister[UUID] {
lazy val tag = FastTypeTag[UUID]("java.util.UUID")
def pickl... | scala/pickling | core/src/main/scala/scala/pickling/pickler/JavaUUIDPickler.scala | Scala | bsd-3-clause | 1,323 |
package quizleague.web.model
import scalajs.js
import quizleague.domain.{Key => DomKey}
import scala.scalajs.js.URIUtils
abstract class Model extends js.Object {
val id:String
var key:Key = null
}
class Key(val parentKey:String, val entityName:String, val id:String) extends js.Object {
def key = s"${Option(p... | gumdrop/quizleague-maintain | js/src/main/scala/quizleague/web/model/Model.scala | Scala | mit | 926 |
package scamr.examples
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.io.{LongWritable, Text}
import scamr.MapReduceMain
import scamr.conf.ConfigureSpeculativeExecution
import scamr.io.InputOutput
import scamr.mapreduce.{MapOnlyJob, MapReducePipeline}
/* This example demonstrates a map-only MR j... | ooyala/scamr | src/main/scala/scamr/examples/ExampleMapOnlyJob.scala | Scala | apache-2.0 | 1,053 |
package io.github.tailhq.dynaml.graph.utils
import com.tinkerpop.frames.{EdgeFrame, InVertex, OutVertex}
/**
* Defines the [[EdgeFrame]] for the
* edges going out from the parameter
* node.
*/
trait ParamEdge extends EdgeFrame {
@OutVertex
def getParameter(): Parameter
@InVertex
def getLabel(): Label
}
| mandar2812/DynaML | dynaml-core/src/main/scala/io/github/tailhq/dynaml/graph/utils/ParamEdge.scala | Scala | apache-2.0 | 319 |
package at.fh.swengb.android_resifo
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget._
import scala.util.matching.Regex
/**
* Created by Martin on 15.01.2017.
*/
class AnmeldungActivity extends Activity{
var db: Db = _
var perso... | Mr-Get/android-resifo | app/src/main/scala/at.fh.swengb.android_resifo/AnmeldungActivity.scala | Scala | mit | 8,545 |
/*
* ArtifactLocationObjView.scala
* (Mellite)
*
* Copyright (c) 2012-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.me... | Sciss/Mellite | core/src/main/scala/de/sciss/mellite/ArtifactLocationObjView.scala | Scala | agpl-3.0 | 2,522 |
package org.jetbrains.plugins.scala
package findUsages
import com.intellij.psi.search.searches.ReferencesSearch
import com.intellij.util.{CommonProcessors, QueryExecutor, Processor}
import com.intellij.psi.{PsiElement, PsiReference}
import com.intellij.psi.search.{GlobalSearchScope, UsageSearchContext, PsiSearchHelper... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/findUsages/OperatorAndBacktickedSearcher.scala | Scala | apache-2.0 | 4,388 |
/*
* 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 ... | bill1208/incubator-carbondata | integration/spark/src/test/scala/org/apache/carbondata/integration/spark/testsuite/dataload/TestLoadDataGeneral.scala | Scala | apache-2.0 | 3,356 |
package es.weso.shaclex
import es.weso.shextest.manifest._
import com.typesafe.config.{Config, ConfigFactory}
import java.nio.file.Paths
import cats.effect.unsafe.implicits.global
object ShExTestRunner {
val conf: Config = ConfigFactory.load()
val shexFolder = conf.getString("validationFolder")
val sh... | labra/shaclex | src/main/scala/es/weso/shaclex/ShExTestRunner.scala | Scala | mit | 894 |
/*
* Licensed to Intel Corporation under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Intel Corporation licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use t... | SeaOfOcean/BigDL | dl/src/main/scala/com/intel/analytics/bigdl/utils/Table.scala | Scala | apache-2.0 | 7,489 |
package com.twitter.finagle.netty4
import io.netty.buffer.{ByteBuf, ByteBufAllocator, CompositeByteBuf}
import java.lang.Iterable
import scala.collection.JavaConverters._
private[netty4] object LeakSafeCompositeByteBuf {
// PooledByteBuf is protected so we have to reflect
val pooledClass = Class.forName("io.netty... | koshelev/finagle | finagle-netty4/src/main/scala/com/twitter/finagle/netty4/LeakSafeCompositeByteBuf.scala | Scala | apache-2.0 | 2,620 |
package dotty.tools.dotc
package core
package transform
import Symbols._, Types._, Contexts._, Flags._, Names._, StdNames._
object Erasure {
/** The erasure |T| of a type T. This is:
*
* - For a refined type scala.Array+[T]:
* - if T is Nothing or Null, scala.Array+[Object]
* - otherwise, ... | DarkDimius/dotty | src/dotty/tools/dotc/core/transform/Erasure.scala | Scala | bsd-3-clause | 5,626 |
package gapt.expr.util
import gapt.expr.Expr
import gapt.expr.Normalizer
import gapt.expr.ReductionRule
import gapt.expr.formula.Top
import gapt.expr.subst.Substitution
import gapt.formats.tip.subterms
case class ConditionalNormalizer( rewriteRules: Set[ConditionalReductionRule] ) {
private val unconditionalRules ... | gapt/gapt | core/src/main/scala/gapt/expr/util/ConditionalNormalizer.scala | Scala | gpl-3.0 | 1,539 |
package epfl.pacman.editor
import scala.swing._
import event.ButtonClicked
object Test extends SimpleSwingApplication {
def top = new MainFrame {
title = "Editor Test"
contents = new GridBagPanel {
import GridBagPanel._
val pane = new ScalaPane {
preferredSize = new Dimension(300, 300)
... | lrytz/pacman | src/main/scala/epfl/pacman/editor/Test.scala | Scala | bsd-2-clause | 903 |
package org.bitcoins.core.serializers.p2p.messages
import org.bitcoins.core.crypto.DoubleSha256Digest
import org.bitcoins.core.gcs.FilterType
import org.bitcoins.core.p2p.CompactFilterHeadersMessage
import org.bitcoins.testkit.util.BitcoinSUnitTest
import scodec.bits._
class RawCompactFilterHeadersMessageSerializerTe... | bitcoin-s/bitcoin-s-core | core-test/src/test/scala/org/bitcoins/core/serializers/p2p/messages/RawCompactFilterHeadersMessageSerializerTest.scala | Scala | mit | 3,175 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.linker.backend.closure
im... | SebsLittleHelpers/scala-js | linker/jvm/src/main/scala/org/scalajs/linker/backend/closure/ClosureLinkerBackend.scala | Scala | apache-2.0 | 8,551 |
package org.jetbrains.plugins.scala.failed.annotator
import com.intellij.codeInspection.LocalInspectionTool
import com.intellij.testFramework.EditorTestUtil
import org.jetbrains.plugins.scala.PerfCycleTests
import org.jetbrains.plugins.scala.codeInspection.ScalaInspectionTestBase
import org.jetbrains.plugins.scala.cod... | triplequote/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/failed/annotator/OverridingAnnotatorTest3.scala | Scala | apache-2.0 | 1,091 |
package com.github.jw3.di
import com.typesafe.config.ConfigValueType._
import com.typesafe.config.{Config, ConfigValue}
import com.typesafe.scalalogging.LazyLogging
import net.codingwell.scalaguice.ScalaModule
import scala.collection.JavaConverters._
/**
* Bind Config values as @Named(path)
*/
object NamedConfigMo... | jw3/akka-injects | src/main/scala/com/github/jw3/di/NamedConfigModule.scala | Scala | apache-2.0 | 1,733 |
/*
* Copyright 2001-2013 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... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/matchers/dsl/ResultOfNoElementsOfApplicationSpec.scala | Scala | apache-2.0 | 1,457 |
/*
* Copyright 2015 Roberto Tyley
*
* 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... | rtyley/play-git-hub | src/main/scala/com/madgag/scalagithub/model/Deleteable.scala | Scala | gpl-3.0 | 975 |
package components
import chandu0101.scalajs.react.components.materialui.{ MuiCheckbox, MuiList, MuiListItem }
import japgolly.scalajs.react.BackendScope
import japgolly.scalajs.react._
import japgolly.scalajs.react.ReactComponentB
import japgolly.scalajs.react.vdom.prefix_<^._
import chandu0101.scalajs.react.componen... | workingDog/SilverworkReact | clientUser/src/main/scala/components/JobInterest.scala | Scala | apache-2.0 | 3,431 |
/*
* Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
*
* 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
*
* Unles... | telefonicaid/fiware-cosmos-platform | infinity/common/src/main/scala/es/tid/cosmos/infinity/common/fs/Path.scala | Scala | apache-2.0 | 3,632 |
package org.jetbrains.plugins.scala.lang.typeInference
package generated
class TypeInferenceLocalTypeInferenceTest extends TypeInferenceTestBase {
//This class was generated by build script, please don't change this
override def folderPath: String = super.folderPath + "localTypeInference/"
//todo:
/*def testA... | consulo/consulo-scala | test/org/jetbrains/plugins/scala/lang/typeInference/generated/TypeInferenceLocalTypeInferenceTest.scala | Scala | apache-2.0 | 1,872 |
/* Title: Tools/jEdit/src/spell_checker.scala
Author: Makarius
Spell checker with completion, based on JOrtho (see
http://sourceforge.net/projects/jortho).
*/
package isabelle.jedit
import isabelle._
import java.lang.Class
import javax.swing.JMenuItem
import scala.collection.mutable
import scala.sw... | MerelyAPseudonym/isabelle | src/Tools/jEdit/src/spell_checker.scala | Scala | bsd-3-clause | 11,173 |
/*******************************************************************************
Copyright (c) 2012-2013, KAIST, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
**********************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/interpreter/InterpreterHelper.scala | Scala | bsd-3-clause | 44,209 |
/*
* 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 | streaming/src/main/scala/org/apache/spark/streaming/scheduler/JobScheduler.scala | Scala | apache-2.0 | 10,888 |
/*
* Copyright 2001-2013 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/scalatest-test/src/test/scala/org/scalatest/BeforeAndAfterEachTestDataAsyncSuite.scala | Scala | apache-2.0 | 15,572 |
package adhoc
class A | som-snytt/dotty | tests/neg-custom-args/adhoc-extension/A.scala | Scala | apache-2.0 | 21 |
package ru.zconstz.shortener.service
import akka.actor.Actor
import ru.zconstz.shortener.http.HttpEntities._
import ru.zconstz.shortener.db.DbHolder._
import scala.slick.driver.PostgresDriver.simple._
import ru.zconstz.shortener.db.DataBaseSchema.{Links, Folders}
class FolderActor extends Actor {
def receive = {
... | konstantin-zlobin/url-shortener | src/main/scala/ru/zconstz/shortener/service/FolderActor.scala | Scala | apache-2.0 | 1,055 |
package at.vizu.s2n.generator.expression
import at.vizu.s2n.generator.{GeneratorContext, GeneratorUtils}
import at.vizu.s2n.types.symbol.{BaseTypes, TType}
/**
* Phil on 29.11.15.
*/
case class ValDefExpression(baseTypes: BaseTypes, varName: String, varTpe: TType, rhs: Expression) extends Expression {
override ... | viZu/nasca | src/main/scala/at/vizu/s2n/generator/expression/ValDefExpression.scala | Scala | apache-2.0 | 908 |
package troy
package dsl
import com.datastax.driver.core._
import scala.concurrent.Future
object MacroDSL {
trait TroyCql {
def prepared: Statement
// def preparedAsync: Future[Statement]
// def unprepared: Statement
}
trait DslBoundStatement extends ParsingOps {
type ParseAs[R] = Future... | schemasafe/troy | troy-macro/src/main/scala/troy/dsl/MacroDSL.scala | Scala | apache-2.0 | 943 |
class DefInput {
def foo {
def goo(x: Int): Int = x + 4
val g = 77
/*start*/
g match {
case 77 => print(g)
case _ => print(goo(g))
}
/*end*/
print("exit")
}
}
/*
class DefInput {
def foo {
def goo(x: Int): Int = x + 4
val g = 77
/*start*/
testMethodName(g,... | LPTK/intellij-scala | testdata/extractMethod/input/DefInput.scala | Scala | apache-2.0 | 505 |
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.