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) 2015 Language Technology Group
*
* This program 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 (at your option) any later version.
*
* ... | tudarmstadt-lt/newsleak | common/src/main/scala/model/queryable/impl/KeyTermQueryableImpl.scala | Scala | agpl-3.0 | 2,208 |
package is.hail.expr.ir
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
import is.hail.HailSuite
import is.hail.annotations.Region
import is.hail.asm4s._
import is.hail.backend.ExecuteContext
import is.hail.check.{Gen, Prop}
import is.hail.expr.ir.agg._
import is.hail.expr.ir.orderings.CodeOrdering
import... | hail-is/hail | hail/src/test/scala/is/hail/expr/ir/StagedBTreeSuite.scala | Scala | mit | 9,119 |
package com.inocybe.pfm.template.model
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import spray.json.DefaultJsonProtocol
object JsonProtocol extends SprayJsonSupport with DefaultJsonProtocol {
implicit val workFormat = jsonFormat2(Work)
implicit val workResultFormat = jsonFormat2(WorkResult)... | botekchristophe/akka-http-cluster-remote | src/main/scala/com/inocybe/pfm/template/model/JsonProtocol.scala | Scala | mit | 324 |
package com.arcusys.learn.scorm.manifest.storage.impl.liferay
import com.arcusys.learn.persistence.liferay.model.LFActivityDataMap
import com.arcusys.learn.persistence.liferay.service.LFActivityDataMapLocalServiceUtil
import com.arcusys.valamis.lesson.scorm.model.manifest.ActivityDataMap
import com.arcusys.valamis.les... | ViLPy/Valamis | learn-persistence-liferay-wrapper/src/main/scala/com/arcusys/learn/scorm/manifest/storage/impl/liferay/ActivityDataRepositoryImpl.scala | Scala | lgpl-3.0 | 1,533 |
package redis.commands
import redis._
import scala.concurrent.{Await, Future}
import akka.util.ByteString
import redis.protocol.{Bulk, MultiBulk}
import redis.actors.ReplyErrorException
class StringsSpec extends RedisStandaloneServer {
sequential
"Strings commands" should {
"APPEND" in {
val r = redis.... | npeters/rediscala | src/test/scala/redis/commands/StringsSpec.scala | Scala | apache-2.0 | 9,802 |
/*
* 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 ... | jackylk/incubator-carbondata | mv/core/src/test/scala/org/apache/carbondata/mv/testutil/ModularPlanTest.scala | Scala | apache-2.0 | 6,347 |
package io.iohk.ethereum.vm
import akka.util.ByteString
import io.iohk.ethereum.crypto.kec256
import io.iohk.ethereum.domain.{Account, Address, TxLogEntry, UInt256}
import io.iohk.ethereum.domain.UInt256._
import io.iohk.ethereum.vm.BlockchainConfigForEvm.EtcForks.EtcFork
import io.iohk.ethereum.vm.BlockchainConfigFor... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/vm/OpCode.scala | Scala | mit | 45,186 |
package demo
/*
* Copyright (C) 24/08/16 // [email protected]
*
* This program 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
* (at your option) a... | openmole/scaladget | bootstrapDemo/src/main/scala/demo/PopoverDemo.scala | Scala | agpl-3.0 | 2,641 |
// From: https://github.com/akka/akka/blob/master/project/Unidoc.scala
import sbt._
import sbt.Keys._
import sbt.Project.Initialize
object Unidoc {
val unidocDirectory = SettingKey[File]("unidoc-directory")
val unidocExclude = SettingKey[Seq[String]]("unidoc-exclude")
val unidocAllSources = TaskKey[Seq[Seq[File... | travisbrown/zipkin | project/Unidoc.scala | Scala | apache-2.0 | 2,444 |
package com.reactific.jfxtend.scene
import javafx.scene.shape._
import javafx.scene.shape.Path
/** Unit Tests For package */
package object shape {
implicit class LineExt(val extendee: Line) extends LineExtensions
implicit class RectangleExt(val extendee: Rectangle) extends RectangleExtensions
implicit class S... | reactific/jfxtensions | src/main/scala/com/reactific/jfxtend/scene/shape/package.scala | Scala | apache-2.0 | 611 |
package coursier.util
import org.jsoup.Jsoup
import scala.jdk.CollectionConverters._
private[coursier] abstract class WebPageCompatibility {
def listWebPageRawElements(page: String): Iterator[String] =
Jsoup.parse(page)
.select("a")
.asScala
.iterator
.map(_.attr("href"))
}
| alexarchambault/coursier | modules/util/jvm/src/main/scala/coursier/util/WebPageCompatibility.scala | Scala | apache-2.0 | 310 |
package controllers.buildinfo
trait BuildInfoBase {
val name: String
val version: String
val commit: String
val author: String
val builtAtString: String
}
| dpalmisano/plato | app/controllers/buildinfo/BuildInfoBase.scala | Scala | mit | 166 |
/*
* 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/AC5052A.scala | Scala | apache-2.0 | 2,806 |
package com.socrata.datacoordinator.secondary.sql
import java.sql.{Connection, SQLException}
import java.util.UUID
import com.rojoma.simplearm.v2.using
class PostgresCollocationManifest(conn: Connection) extends SqlCollocationManifest(conn) {
private val log = org.slf4j.LoggerFactory.getLogger(classOf[PostgresCol... | socrata-platform/data-coordinator | coordinatorlib/src/main/scala/com/socrata/datacoordinator/secondary/sql/PostgresCollocationManifest.scala | Scala | apache-2.0 | 1,230 |
package com.rbh.controllers
import play.api._
import play.api.mvc._
import play.api.libs.json._
import java.time._
import scala.concurrent.{Promise, Future}
import org.apache.kafka.clients.producer.RecordMetadata
//import scala.concurrent.ExecutionContext
import scala.concurrent.ExecutionContext.Implicits.global
impor... | bradkarels/acme-step-consumer | app/com/rbh/controllers/Application.scala | Scala | mit | 5,222 |
package io.getquill.context
import scala.concurrent.Await
import scala.concurrent.Future
import scala.concurrent.duration.Duration
import io.getquill._
import io.getquill.Literal
import io.getquill.CassandraStreamContext
package object cassandra {
lazy val mirrorContext = new CassandraMirrorContext with TestEntit... | jcranky/quill | quill-cassandra/src/test/scala/io/getquill/context/cassandra/package.scala | Scala | apache-2.0 | 673 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fhueske/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/rules/logical/FlinkAggregateExpandDistinctAggregatesRuleTest.scala | Scala | apache-2.0 | 6,460 |
package views.html
import play.templates._
import play.templates.TemplateMagic._
import play.api.templates._
import play.api.templates.PlayMagic._
import models._
import controllers._
import java.lang._
import java.util._
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import play.... | MattCCieslak/surferpedia | target/scala-2.10/src_managed/main/views/html/Main.template.scala | Scala | mit | 5,810 |
// Equites, a Scala chess playground
// Copyright © 2014 Frank S. Thomas <[email protected]>
//
// 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 ... | equites-chess/equites-core | src/main/scala/eu/timepit/equites/format/Pgn.scala | Scala | gpl-3.0 | 3,432 |
package com.rocketfuel.sdbc.postgresql
import java.time.{Duration => JavaDuration}
import java.util.concurrent.TimeUnit
import org.postgresql.util.PGInterval
import scala.concurrent.duration.Duration
trait IntervalImplicits {
implicit def JavaDurationToPGInterval(value: JavaDuration): PGInterval = {
val nano =... | rocketfuel/sdbc | postgresql/src/main/scala/com/rocketfuel/sdbc/postgresql/IntervalImplicits.scala | Scala | bsd-3-clause | 2,298 |
package cz.kamenitxan.jakon.core.dynamic
import java.lang.reflect.Method
import java.sql.Connection
import javax.servlet.MultipartConfigElement
import com.google.gson.Gson
import cz.kamenitxan.jakon.core.database.DBHelper
import cz.kamenitxan.jakon.logging.Logger
import cz.kamenitxan.jakon.utils.PageContext
import cz.... | kamenitxan/Jakon | modules/backend/src/main/scala/cz/kamenitxan/jakon/core/dynamic/PageletInitializer.scala | Scala | bsd-3-clause | 7,437 |
package giter8
import org.scalatest.{FlatSpec, Matchers}
class GitRepositoryTest extends FlatSpec with Matchers {
"JGit" should "resolve repo name correctly" in {
val testCases: Map[String, GitRepository] = Map(
"[email protected]/repo" -> GitRepository.Remote("[email protected]/repo"),
"git://some... | wolfendale/giter8 | library/src/test/scala/giter8/GitRepositoryTest.scala | Scala | apache-2.0 | 1,033 |
/**
* Copyright (C) 2016 Pau Carré Cardona - All Rights Reserved
* You may use, distribute and modify this code under the
* terms of the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt).
*/
package db
import java.util.concurrent.TimeUnit
import play.api.db.slick.{DatabaseConfigProvider, Ha... | paucarre/tiefvision | src/scala/tiefvision-web/app/db/BoundingBoxQueryActions.scala | Scala | apache-2.0 | 1,549 |
import scala.reflect.macros.whitebox.Context
import scala.language.experimental.macros
import scala.annotation.StaticAnnotation
object helloMacro {
def impl(c: Context)(annottees: c.Expr[Any]*): c.Expr[Any] = {
import c.universe._
val result = {
annottees.map(_.tree).toList match {
case ModuleD... | xeno-by/paradise | tests/reflect/src/main/scala/hello.scala | Scala | bsd-3-clause | 1,037 |
case class C[T](x: T)
case class CS(xs: C[_]*)
// t3856
object Test {
val x = CS(C(5), C("abc")) match { case CS(C(5), xs : _*) => xs }
println(x)
}
| yusuke2255/dotty | tests/pending/pos/t3856.scala | Scala | bsd-3-clause | 155 |
package monocle.syntax
import monocle._
import monocle.function.At
trait AppliedGetter[S, A] extends AppliedFold[S, A] {
override def optic: Getter[S, A]
def get: A = optic.get(value)
override def some[A1](implicit ev1: A =:= Option[A1]): AppliedFold[S, A1] =
adapt[Option[A1]].andThen(std.option.some[A1]... | julien-truffaut/Monocle | core/shared/src/main/scala/monocle/syntax/AppliedGetter.scala | Scala | mit | 3,542 |
import collection.GenTraversable
import scala.annotation.tailrec
import scala.util.matching.Regex
trait Template {
val children: List[Template] = List.empty
protected def childrenContent =
children.map(_.toString).map(_.split("\\n").map(" " + _).mkString("\\n")).mkString("\\n") + "\\n"
}
trait ClassTempl... | svn2github/scalatest | project/GenFramework.scala | Scala | apache-2.0 | 14,457 |
package jigg.pipeline
/*
Copyright 2013-2017 Hiroshi Noji
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... | mynlp/jigg | src/main/scala/jigg/pipeline/PipelineServer.scala | Scala | apache-2.0 | 8,252 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package synthesis
package rules
import purescala.Expressions._
import purescala.ExprOps._
import purescala.Constructors._
import solvers._
import scala.concurrent.duration._
case object OptimisticGround extends Rule("Optimistic Ground") {
def instantiateOn(im... | epfl-lara/leon | src/main/scala/leon/synthesis/rules/OptimisticGround.scala | Scala | gpl-3.0 | 2,824 |
/**
* Copyright 2014 Gianluca Amato <[email protected]>
*
* This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains
* JANDOM 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 o... | rubino22/JDBeta | core/src/test/scala/it/unich/jandom/objectmodels/TrivialObjectModel.scala | Scala | lgpl-3.0 | 1,591 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package controllers
import play.api.mvc._
class Application extends Controller {
def index = Action(Ok)
}
| aradchykov/playframework | framework/src/sbt-plugin/src/sbt-test/routes-compiler-plugin/source-mapping/Application.scala | Scala | apache-2.0 | 187 |
package com.twitter.finagle.loadbalancer.aperture
import com.twitter.app.GlobalFlag
import com.twitter.finagle._
import com.twitter.finagle.Address.Inet
import com.twitter.finagle.loadbalancer.p2c.P2CPick
import com.twitter.finagle.loadbalancer.{Balancer, DistributorT, NodeT}
import com.twitter.finagle.util.Rng
import... | luciferous/finagle | finagle-core/src/main/scala/com/twitter/finagle/loadbalancer/aperture/Aperture.scala | Scala | apache-2.0 | 23,410 |
package com.themillhousegroup.gatsby.actors
import akka.actor.ActorRef
import io.gatling.core.action.Chainable
import io.gatling.core.session.{ Expression, Session }
import com.themillhousegroup.gatsby.stubby.RuntimeStubbing
import com.dividezero.stubby.core.model.StubExchange
import com.typesafe.scalalogging.slf4j.{ ... | themillhousegroup/gatsby | src/main/scala/com/themillhousegroup/gatsby/actors/TearDown.scala | Scala | mit | 958 |
/*
* 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 ... | XiaoqingWang/Spark-SQL-on-HBase | src/main/scala/org/apache/spark/sql/hbase/HBasePartitioner.scala | Scala | apache-2.0 | 3,030 |
/**
* Copyright 2017 Interel
*
* 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... | Interel-Group/core3 | src/main/scala/core3/config/StaticConfig.scala | Scala | apache-2.0 | 1,051 |
package org.javachannel.implicits.model
import java.util.Date
class Audit extends BaseEntity {
var notation:Option[String]=None
var modifiedBy:Option[String]=None
var timestamp:Option[Date]=None
}
| jottinger/conceptmodel | src/main/scala/org/javachannel/implicits/model/Audit.scala | Scala | apache-2.0 | 205 |
package jsons
import models.InventoryOrder
import play.api.libs.json.Json
object InventoryOrderJson extends KiwiERPJson[InventoryOrder] {
def base(inventoryOrder: InventoryOrder) = Json.obj(
"createdAt" -> inventoryOrder.createdAt,
"deliveredDate" -> optDateTimeToString(inventoryOrder.deliveredDate),
"i... | KIWIKIGMBH/kiwierp | kiwierp-backend/app/jsons/InventoryOrderJson.scala | Scala | mpl-2.0 | 656 |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package scaps.searchEngine.queries
import scaps.api.Covariant
import scaps.api.FingerprintTerm
import scaps.api.T... | scala-search/scaps | core/src/main/scala/scaps/searchEngine/queries/QueryExpander.scala | Scala | mpl-2.0 | 6,305 |
/*
* 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 ... | minixalpha/spark | resource-managers/mesos/src/test/scala/org/apache/spark/scheduler/cluster/mesos/Utils.scala | Scala | apache-2.0 | 3,602 |
package io.mem0r1es.trank.ranking
import java.net.URI
class ANCESTORS extends RankingAlgo {
/**
* Rank types by inverse-sort on the # of ANCESTORS contained in the type set.
*/
override def rank(entityTypes: Map[URI, HierInfo]): Seq[(URI, Double)] = {
def score(path: Seq[URI]): Double = {
path.f... | ahmadassaf/TRank | src/main/scala/io/mem0r1es/trank/ranking/ANCESTORS.scala | Scala | apache-2.0 | 489 |
package paddy
trait UncaughtErrorHandler {
def handle(throwable: Throwable)
} | despegar/paddy | src/main/scala/paddy/UncaughtErrorHandler.scala | Scala | bsd-2-clause | 80 |
package akka.contrib.persistence.mongodb
import akka.actor.ActorSystem
import akka.persistence.PersistentRepr
import akka.serialization.{SerializationExtension, Serialization}
import com.mongodb.util.JSON
import com.mongodb._
import com.typesafe.config.ConfigFactory
import org.scalatest.BeforeAndAfterAll
import collec... | tomzhang/akka-persistence-mongo | common/src/test/scala/akka/contrib/persistence/mongodb/JournalUpgradeSpec.scala | Scala | apache-2.0 | 6,656 |
package streaming.perf
import org.apache.spark.SparkContext
import org.apache.spark.streaming.StreamingContext._
import org.apache.spark.SparkContext._
import org.apache.spark.streaming.{Milliseconds, Time}
import org.apache.spark.rdd.RDD
import org.apache.spark.storage.StorageLevel
import streaming.perf.util.FileGene... | zsxwing/spark-perf | streaming-tests/src/main/scala/streaming/perf/HdfsRecoveryTest.scala | Scala | apache-2.0 | 3,312 |
package hydrograph.engine.spark.components
import java.util.Set
import hydrograph.engine.core.component.entity.UnionAllEntity
import hydrograph.engine.core.component.entity.elements.SchemaField
import hydrograph.engine.spark.components.base.StraightPullComponentBase
import hydrograph.engine.spark.components.platform.... | capitalone/Hydrograph | hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/components/UnionAllComponent.scala | Scala | apache-2.0 | 3,005 |
/*
* 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 | core/src/main/scala/org/apache/spark/api/r/RUtils.scala | Scala | apache-2.0 | 4,049 |
/*
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | Frannie-Ludmilla/sparta | sdk/src/test/scala/com/stratio/sparta/sdk/pipeline/schema/TypeOpTest.scala | Scala | apache-2.0 | 6,130 |
// - Project: scalajs-svgjs (https://github.com/jokade/scalajs-svgjs)
// Description: Bindings for svg.js RBox
//
// Copyright (c) 2015 Johannes Kastner <[email protected]>
// Distributed under the MIT License (see included file LICENSE)
package biz.enef.svgjs
import scala.scalajs.js
trait RBox exte... | jokade/scalajs-svgjs | src/main/scala/biz/enef/svgjs/RBox.scala | Scala | mit | 339 |
package com.dzegel.DynamockServer.service
import com.dzegel.DynamockServer.types.{DidOverwriteResponse, ExpectationId, Response}
import com.google.inject.{ImplementedBy, Singleton}
import scala.collection.concurrent.TrieMap
@ImplementedBy(classOf[DefaultResponseStore])
trait ResponseStore {
def registerResponse(ex... | dzegel/DynamockServer | src/main/scala/com/dzegel/DynamockServer/service/ResponseStore.scala | Scala | apache-2.0 | 1,465 |
package hackerRank.algorithms
/* group anagram strings
dog, eat, god, ate, tea
output should be [ [dog,god], [eat,ate,tea]]
*/
object GroupAnagram {
def findGroupAnagrams(words: Seq[String]): Seq[Seq[String]] = {
if (words.isEmpty) Seq.empty else if (words.lengthCompare(1) == 0) Seq(Seq(words.head)) else
... | cricanr/AlgorithmsHackerRank | src/main/scala/hackerRank/algorithms/GroupAnagram.scala | Scala | mit | 640 |
package scala.slick.session
import scala.language.reflectiveCalls
import java.sql._
import scala.slick.SlickException
import scala.slick.util.Logging
import scala.Array
/**
* A database session which opens a connection and transaction on demand.
*/
trait Session extends java.io.Closeable with Logging { self =>
d... | zefonseca/slick-1.0.0-scala.2.11.1 | src/main/scala/scala/slick/session/Session.scala | Scala | bsd-2-clause | 9,802 |
package de.tu_berlin.impro3.scala
import java.lang.{ Long => JLong }
import java.io._
import net.sourceforge.argparse4j.ArgumentParsers
import net.sourceforge.argparse4j.inf._
import de.tu_berlin.impro3.scala.spatio_temporal_dynamics._
import metrics._
import parsers._
import scala.io.Source
import language.reflect... | joroKr21/spatio-temporal-dynamics | impro3-ws14-scala/src/main/scala/de/tu_berlin/impro3/scala/SpatioTemporalDynamics.scala | Scala | apache-2.0 | 4,886 |
package mimir.lenses;
import java.sql._;
import java.io.StringReader;
import collection.JavaConversions._;
import mimir.parser._;
import mimir.ctables._;
import mimir.algebra._;
import mimir.util._;
import mimir.sql._;
import mimir.{Database,Mimir};
class LensManager(db: Database) {
var lensCache = scala.collecti... | sophieyoung717/mimir | src/main/scala/mimir/lenses/LensManager.scala | Scala | apache-2.0 | 2,969 |
package de.leanovate.swaggercheck.schema.model
import org.mockito.Mockito._
import org.scalatest.{MustMatchers, WordSpec}
import org.scalatestplus.mockito.MockitoSugar
class ObjectDefinitionSpec extends WordSpec with MockitoSugar with MustMatchers {
"ObjectDefinition" should {
"accept any object if no property ... | leanovate/swagger-check | json-schema-model/src/test/scala/de/leanovate/swaggercheck/schema/model/ObjectDefinitionSpec.scala | Scala | mit | 7,418 |
package org.qi4j.sample.scala
import org.qi4j.api.concern.ConcernOf
/**
* TODO
*/
class HelloThereConcern
extends ConcernOf[ HelloWorldMixin2 ] with HelloWorldMixin2
{
override def sayHello(name: String ) = next.sayHello("there " + name)
} | joobn72/qi4j-sdk | libraries/lang-scala/src/test/scala/org/qi4j/sample/scala/HelloThereConcern.scala | Scala | apache-2.0 | 247 |
package com.cave.metrics.data.influxdb
import com.cave.metrics.data.Metric
object InfluxMetric {
final val MissingAccountTagMessage = "All metrics should have the account tag"
/**
* Convert a sequence of metrics into InfluxDB requests
*
* @param metrics the metrics to send to InfluxDB
* @return requ... | gilt/cave | core/src/main/scala/com/cave/metrics/data/influxdb/InfluxMetric.scala | Scala | mit | 1,841 |
package chat.tox.antox.wrapper
import chat.tox.antox.utils.Hex
object ToxAddress {
val MAX_ADDRESS_LENGTH = 76
def isAddressValid(address: String): Boolean =
address.length == MAX_ADDRESS_LENGTH &&
address.matches("^[0-9A-F]+$") &&
address.grouped(4).map(Integer.parseInt(_, 16)).fold(0)(_ ^ _) =... | subliun/Antox | app/src/main/scala/chat/tox/antox/wrapper/ToxAddress.scala | Scala | gpl-3.0 | 1,072 |
package utils
import com.github.nscala_time.time.Imports._
import org.joda.time.{LocalDate, IllegalFieldValueException}
import java.util.Calendar
/**
* The Class DateTimeUtils.
*
* @author Nguyen Duc Dung
* @since 4/15/14 3:57 PM
*
*/
object DateTimeUtils {
val quarters = Map(
1 -> List(1, 2, 3),
2 -... | SunriseSoftVN/sunerp | app/utils/DateTimeUtils.scala | Scala | apache-2.0 | 2,018 |
import leon.lang._
object PropositionalLogic {
sealed abstract class Formula
case class And(lhs: Formula, rhs: Formula) extends Formula
case class Or(lhs: Formula, rhs: Formula) extends Formula
case class Implies(lhs: Formula, rhs: Formula) extends Formula
case class Not(f: Formula) extends Formula
case c... | ericpony/scala-examples | testcases/web/sav15/02_Exercise2.scala | Scala | mit | 1,329 |
package com.coiney.akka.rabbit.protocol
import akka.actor.ActorRef
import com.rabbitmq.client.AMQP
import com.coiney.akka.rabbit.{ExchangeConfig, QueueConfig}
import scala.concurrent.duration.FiniteDuration
sealed trait RabbitRequest
case class AddConfirmListener(listener: ActorRef) extends RabbitRequest
case clas... | Coiney/akka-rabbit | akka-rabbit-core/src/main/scala/com/coiney/akka/rabbit/protocol/RabbitRequestProtocol.scala | Scala | bsd-3-clause | 2,398 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.indexer
import scala.collection.immutable.Queue
import org.objectweb.asm.Opcodes._
sealed trait Access
case object Public extends Access
case object Default extends Acce... | sugakandrey/ensime-server | core/src/main/scala/org/ensime/indexer/domain.scala | Scala | gpl-3.0 | 6,162 |
object Test extends App {
override def toString = "Test"
assert(s"$this" == "Test")
assert(s"$this$this" == "TestTest")
assert(s"$this$$" == "Test$")
assert(s"$this.##" == "Test.##")
assert(s"$this.toString" == "Test.toString")
assert(s"$this=THIS" == "Test=THIS")
assert(raw"$"" == "\\"")
}
| som-snytt/dotty | tests/run/t5856.scala | Scala | apache-2.0 | 308 |
package db
import db.TestTables.{directoryTable, itemTable, taggTable}
import slick.jdbc.H2Profile.api._
class DaoCommonDeleteOrderedTest extends DaoCommonTestHelper {
def createItem(parentId: Long, order: Int) = db.run(
itemTable returning itemTable.map(_.id) += Item(directoryId = parentId, order = order, val... | Igorocky/readtext | server/test/db/DaoCommonDeleteOrderedTest.scala | Scala | mit | 6,285 |
package scalajs.antdesign
import japgolly.scalajs.react.{React, ReactComponentU_, ReactNode}
import scala.scalajs.js
import scala.scalajs.js.{Dynamic, Object}
/**
* @see https://ant.design/components/badge/#API
* @param count Number to show in badge
* @param overflowCount Max count to show
* @param dot Wheth... | mdedetrich/scalajs-antdesign | src/main/scala/scalajs/antdesign/Badge.scala | Scala | bsd-3-clause | 1,779 |
package com.twitter.scalding.parquet.scrooge
import _root_.parquet.scrooge.ParquetScroogeScheme
import cascading.scheme.Scheme
import com.twitter.scalding._
import com.twitter.scalding.parquet.thrift.ParquetThriftBase
import com.twitter.scalding.source.{ DailySuffixSource, HourlySuffixSource }
import com.twitter.scroo... | nvoron23/scalding | scalding-parquet-scrooge/src/main/scala/com/twitter/scalding/parquet/scrooge/ParquetScrooge.scala | Scala | apache-2.0 | 1,140 |
/*
* Copyright 2020 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/play-authorised-frontend | src/test/scala/uk/gov/hmrc/play/frontend/auth/connectors/DelegationConnectorSpec.scala | Scala | apache-2.0 | 8,451 |
/*
* Bang.scala
* (Cord)
*
* Copyright (c) 2015-2020 Hanns Holger Rutz.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* [email protected]
*/
package de.sciss.cord
case object Bang {
override def toStr... | Sciss/Cord | src/main/scala/de/sciss/cord/Bang.scala | Scala | lgpl-2.1 | 334 |
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... | CapeSepias/scala-js | tools/jvm/src/main/scala/org/scalajs/core/tools/optimizer/ClosureAstTransformer.scala | Scala | bsd-3-clause | 13,408 |
package info.simsimy.MsgPackParser
import java.nio.ByteBuffer
/**
* Created by sim on 14/12/2016.
*/
class ByteReader(data: Array[Byte]) {
var Position : Int = 0
def getShort(): Short = {
return (0.asInstanceOf[Short] | getByte()).asInstanceOf[Short]
}
def getByte(): Byte = {
val res = data(Posi... | SimSimY/scala-msgpack-rawparser | src/main/scala/info/simsimy/MsgPackParser/ByteReader.scala | Scala | apache-2.0 | 1,620 |
package com.github.wakfudecrypt.types.data
import com.github.wakfudecrypt._
@BinaryDecoder
case class UserGroupTemplate(
_0_int32: Int,
_1_bool: Boolean,
_2_hasmap_int32_composite: Map[Int, UserGroupTemplate_2_hasmap_int32_composite]
)
object UserGroupTemplate extends BinaryDataCompanion[UserGroupTemplate] {
... | jac3km4/wakfudecrypt | types/src/main/scala/com/github/wakfudecrypt/types/data/UserGroupTemplate.scala | Scala | mit | 474 |
package net.categoricaldata.category
case class Path[O, G](source: O, target: O, morphisms: List[G]) {
if (morphisms.isEmpty) require(source == target)
def length = morphisms.size
def andThen(path: Path[O, G]) = {
require(target == path.source)
Path(source, path.target, morphisms ::: path.morphisms)
}... | JasonGross/categoricaldata | src/main/scala/net/categoricaldata/category/Path.scala | Scala | mit | 739 |
/*
* 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 ... | chenc10/Spark-PAF | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DataTypeParser.scala | Scala | apache-2.0 | 4,521 |
/*
* Copyright (c) 2013 Aviat Networks.
* This file is part of DocReg+Web. Please refer to the NOTICE.txt file for license details.
*/
package vvv.docreg.backend
import akka.actor.Actor
import vvv.docreg.util.Environment
import net.liftweb.common.{Empty, Full}
import vvv.docreg.model.{ProjectAuthorization, Project... | scott-abernethy/docreg-web | src/main/scala/vvv/docreg/backend/UserStorage.scala | Scala | gpl-3.0 | 1,883 |
package com.twitter.finagle.mux
import com.twitter.app.GlobalFlag
import com.twitter.conversions.time._
import com.twitter.finagle.{Status, Stack}
import com.twitter.finagle.mux._
import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver}
import com.twitter.finagle.util.parsers.{double, duration, int, list}
i... | rojanu/finagle | finagle-mux/src/main/scala/com/twitter/finagle/mux/FailureDetector.scala | Scala | apache-2.0 | 5,914 |
package java.lang
/* This is a hijacked class. Its instances are primitive numbers.
* Constructors are not emitted.
*/
final class Float private () extends Number with Comparable[Float] {
def this(value: scala.Float) = this()
def this(s: String) = this()
@inline def floatValue(): scala.Float =
this.asIns... | xuwei-k/scala-js | javalanglib/src/main/scala/java/lang/Float.scala | Scala | bsd-3-clause | 4,254 |
package com.github.zenpie.macrowave.internal.datalift
import java.io.DataOutput
import java.util
import scala.reflect.macros.whitebox
import scala.language.implicitConversions
abstract class LiftCodec[@specialized T](val c: whitebox.Context) {
import c.universe._
def encode(stream: DataOutput, value: T): Unit
... | zen-pie/macrowave | src/main/scala/com/github/zenpie/macrowave/internal/datalift/LiftCodec.scala | Scala | mit | 3,961 |
package com.cloudray.scalapress.widgets.controller
import org.scalatest.{OneInstancePerTest, FunSuite}
import org.scalatest.mock.MockitoSugar
import org.mockito.Mockito
import com.cloudray.scalapress.widgets.{HtmlWidget, WidgetDao}
import org.springframework.ui.ModelMap
/** @author Stephen Samuel */
class HtmlWidgetE... | vidyacraghav/scalapress | src/test/scala/com/cloudray/scalapress/widgets/controller/HtmlWidgetEditControllerTest.scala | Scala | apache-2.0 | 852 |
package api
import api.Api._
import models.Page
import play.api.libs.json._
/*
* Successful response for an ApiRequest.
*/
case class ApiResponse(status: Int, json: JsValue, headers: Seq[(String, String)]) extends ApiResult
object ApiResponse {
/////////////////////////////////////////////////////////////////////... | ygpark2/play-ain-board | app/api/ApiResponse.scala | Scala | bsd-3-clause | 1,406 |
import sbt._
import Keys._
class PlayJdbc(
scalacPlugin: Project,
jdbcScala: Project) {
import Dependencies._
import Format._
val playVersion = settingKey[String]("Playframework version")
lazy val project =
Project(id = "play-jdbc", base = file("play-jdbc")).
settings(formatSettings ++ Seq(
... | cchantep/acolyte | project/PlayJdbc.scala | Scala | lgpl-2.1 | 1,578 |
package scalan.util
import scalan.BaseTests
import scalan.util.CollectionUtil._
class CollectionUtilTests extends BaseTests {
def join(l: Map[Int,Int], r: Map[Int,Int]) =
outerJoin(l, r)((_,l) => l, (_,r) => r, (k,l,r) => l + r)
def joinSeqs(l: Seq[Int], r: Seq[Int]) =
outerJoinSeqs(l, r)(l => l, r => r)(... | scalan/scalan | common/src/test/scala/scalan/util/CollectionUtilTests.scala | Scala | apache-2.0 | 1,652 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This... | beangle/ems | core/src/main/scala/org/beangle/ems/core/config/service/DataSourceManager.scala | Scala | lgpl-3.0 | 862 |
package com.coiney.akka.rabbit.protocol
import com.rabbitmq.client.AMQP
case class RabbitRPCResult(data: Option[Array[Byte]], properties: Option[AMQP.BasicProperties] = None)
trait RabbitRPCProcessor {
def process(hd: HandleDelivery): RabbitRPCResult
def recover(hd: HandleDelivery, cause: Throwable): RabbitRPC... | Coiney/akka-rabbit | akka-rabbit-core/src/main/scala/com/coiney/akka/rabbit/protocol/RabbitRPCProtocol.scala | Scala | bsd-3-clause | 481 |
package ch8
import org.learningconcurrency._
import ch8._
import akka.actor._
import akka.event.Logging
import akka.util.Timeout
import akka.pattern.{ask, pipe, gracefulStop}
import akka.util.Timeout
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util._
c... | tophua/spark1.52 | examples/src/main/scala/scalaDemo/threadConcurrency/ch8/Communicating.scala | Scala | apache-2.0 | 2,710 |
package spoker.betting
import spoker.{ Player, ManageablePlayer }
case class Better(manageablePlayer: ManageablePlayer) {
lazy val myAction = BetterAction(this)
def myActionIs(a: Action) = myAction(a)
def bet(value: Int) = myActionIs(Bet(value))
def call = myActionIs(Call)
def check = myActionIs(Check)... | vladmm/scala-poker | src/main/scala/spoker/betting/Better.scala | Scala | mit | 699 |
package chat.tox.antox.utils
import java.util
import android.content.{BroadcastReceiver, Context, Intent}
import android.net.ConnectivityManager
import scala.collection.JavaConversions._
trait ConnectionTypeChangeListener {
//only called when network is connected
def connectionTypeChange(connectionType: Int): U... | subliun/Antox | app/src/main/scala/chat/tox/antox/utils/ConnectionManager.scala | Scala | gpl-3.0 | 1,697 |
package org.jetbrains.plugins.scala.codeInsight.template.macros
import com.intellij.codeInsight.CodeInsightBundle
import com.intellij.codeInsight.lookup.LookupElement
import com.intellij.codeInsight.template._
import org.jetbrains.plugins.scala.codeInsight.template.impl.ScalaCodeContextType
import org.jetbrains.plugin... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/codeInsight/template/macros/ScalaComponentTypeOfMacro.scala | Scala | apache-2.0 | 2,241 |
/*-
* #%L
* FWAPP Framework
* %%
* Copyright (C) 2016 - 2017 Open Design Flow
* %%
* This program 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
(at your option) a... | opendesignflow/fwapp | src/main/scala/org/odfi/wsb/fwapp/framework/FWAppValueBufferView.scala | Scala | agpl-3.0 | 4,505 |
//: ----------------------------------------------------------------------------
//: Copyright (C) 2014 Verizon. All Rights Reserved.
//:
//: Licensed under the Apache License, Version 2.0 (the "License");
//: you may not use this file except in compliance with the License.
//: You may obtain a copy of the Licen... | oncue/remotely | core/src/main/scala/Remote.scala | Scala | apache-2.0 | 7,113 |
package io.swagger.client.api
import com.wordnik.swagger.client._
import scala.concurrent.{ Future, Await }
import scala.concurrent.duration._
import collection.mutable
class UserApi(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) {
def userMeGet()(implicit reader: ClientRespon... | QuantiModo/QuantiModo-SDK-Async-Scala | src/main/scala/io/swagger/client/api/UserApi.scala | Scala | apache-2.0 | 756 |
/*
* Copyright (c) 2013 Curry Order System authors.
* This file is part of Curry Order System. Please refer to the NOTICE.txt file for license details.
*/
package code.util
import org.specs._
import net.liftweb._
import http._
import net.liftweb.util._
import net.liftweb.common._
import org.specs.matcher._
import ... | scott-abernethy/curry-order-system | src/test/scala/code/util/SchedulerTest.scala | Scala | gpl-3.0 | 1,511 |
package com.twitter.finagle.buoyant.h2
package netty4
import com.twitter.concurrent.AsyncQueue
import com.twitter.finagle.Failure
import com.twitter.finagle.stats.{NullStatsReceiver => FNullStatsReceiver, StatsReceiver => FStatsReceiver}
import com.twitter.logging.Logger
import com.twitter.util.{Future, Promise, Retur... | denverwilliams/linkerd | finagle/h2/src/main/scala/com/twitter/finagle/buoyant/h2/netty4/Netty4StreamTransport.scala | Scala | apache-2.0 | 24,384 |
package org.bitcoins.crypto
import scodec.bits.ByteVector
import java.math.BigInteger
import scala.math.BigInt
trait CryptoNumberUtil {
/** Converts a sequence of bytes to a **big endian** unsigned integer */
def toUnsignedInt(bytes: ByteVector): BigInt = {
toUnsignedInt(bytes.toArray)
}
/** Converts a... | bitcoin-s/bitcoin-s | crypto/src/main/scala/org/bitcoins/crypto/CryptoNumberUtil.scala | Scala | mit | 1,707 |
package me.laiseca.restcale.internal.function
import org.mockito.Mockito.verify
import org.scalatest.FlatSpec
import org.scalatest.Matchers
import org.scalatest.mock.MockitoSugar
import me.laiseca.restcale.http.HttpMethod
class RestFunction0Spec extends FlatSpec with Matchers with MockitoSugar {
val method = Ht... | xabierlaiseca/restcale | shared/src/test/scala/me/laiseca/restcale/internal/function/RestFunction0Spec.scala | Scala | apache-2.0 | 593 |
/*
* Copyright 2001-2008 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... | hubertp/scalatest | src/test/scala/org/scalatest/fixture/FixtureSuiteSpec.scala | Scala | apache-2.0 | 41,624 |
/*
* 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 ... | jackylk/incubator-carbondata | integration/spark/src/main/scala/org/apache/spark/sql/hive/execution/command/CarbonResetCommand.scala | Scala | apache-2.0 | 1,614 |
package fi.pelam.javafxutil
import org.junit.Assert._
import org.junit.Test
case class TestImmutable(a: Int, b: Int) {
}
class ScalaToJavafxPropsTest {
val immutable = TestImmutable(1, 2)
val scalaToJavafxProps = ScalaToJavafxProps.forClass[TestImmutable]
val props: JavafxProps[TestImmutable] = scalaToJavafxPr... | pelamfi/pelam-scala-incubator | src/test/scala/fi/pelam/javafxutil/ScalaToJavafxPropsTest.scala | Scala | apache-2.0 | 726 |
package com.arcusys.valamis.content.service
import com.arcusys.valamis.content.exceptions.NoCategoryException
import com.arcusys.valamis.content.model._
import com.arcusys.valamis.content.storage.{CategoryStorage, PlainTextStorage, QuestionStorage}
import com.arcusys.valamis.persistence.common.DatabaseLayer
import sli... | arcusys/Valamis | valamis-questionbank/src/main/scala/com/arcusys/valamis/content/service/CategoryService.scala | Scala | gpl-3.0 | 5,372 |
package jp.co.dwango.s99
import org.scalacheck.Prop.forAll
import org.scalacheck.Properties
class P14Check extends Properties("P14") {
property("duplicate()") = forAll { (s: List[Int]) =>
P14.duplicate(s) == s.map { x =>
List(x, x)
}.flatten
}
}
| dwango/S99 | src/test/scala/jp/co/dwango/s99/P14Check.scala | Scala | mit | 266 |
/*
* Copyright 2011-2019 Asakusa Framework Team.
*
* 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 ... | ashigeru/asakusafw-spark | extensions/iterativebatch/compiler/core/src/test/scala/com/asakusafw/spark/extensions/iterativebatch/compiler/graph/CoGroupClassBuilderSpec.scala | Scala | apache-2.0 | 17,237 |
package com.kodekutters.gpsd4scala.core
import akka.actor._
import java.net.InetSocketAddress
import com.kodekutters.gpsd4scala.messages.ConnectionFailed
/**
* Author: Ringo Wathelet
* Date: 18/04/13
* Version: 1
*/
/**
* main entry point to link to the gpsd server
*
* @param address the IP address of the gp... | workingDog/Gpsd4Scala | src/main/scala/com/kodekutters/gpsd4scala/core/GPSdLinker.scala | Scala | bsd-3-clause | 1,449 |
import sbt._
import sbt.Keys._
object SlickTestingBuild extends Build {
lazy val slickTesting = Project(
id = "slick-testing",
base = file("."),
settings = Seq(
name := "Slick Testing",
organization := "com.daverstevens",
version := "0.1-SNAPSHOT",
scalaVersion := "2.11.2"
... | drstevens/slick-testing | project/Build.scala | Scala | apache-2.0 | 359 |
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.