code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package com.edropple.velvetrope.user
import roles.Role
/**
* Goes beyond the basic RoleOwner to define a consistent interface for
* adding and removing roles. This is separate from RoleOwner in order to
* allow for "User" and "MutableUser" being separate concepts (a pattern
* I personally prefer).
*
* @author ... | eropple/velvetrope | src/main/scala/com/edropple/velvetrope/user/MutableRoleOwner.scala | Scala | mit | 762 |
package net.opentsdb.kafka.consumer.modules
import com.google.inject.{Singleton, Provides, AbstractModule}
import net.codingwell.scalaguice.ScalaModule
import java.util.Properties
import com.google.inject.name.{Named, Names}
import java.util.concurrent.{LinkedBlockingQueue, ArrayBlockingQueue}
import org.hbase.async.H... | nikore/opentsdb-contrib | kafka-consumer/src/main/scala/net/opentsdb/kafka/consumer/modules/ConsumerModule.scala | Scala | apache-2.0 | 966 |
/**
* Copyright (c) 2002-2012 "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 Foundati... | dksaputra/community | cypher/src/test/scala/org/neo4j/cypher/internal/executionplan/builders/DeleteAndPropertySetBuilderTest.scala | Scala | gpl-3.0 | 2,301 |
/*
* Copyright (C) 2016 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.persistence.cassandra.journal
import scala.concurrent._
import java.lang.{ Long => JLong }
import akka.actor.ActorLogging
import akka.persistence.PersistentRepr
import akka.stream.ActorMaterializer
import akka.persistence.cassandra.liste... | kpbochenek/akka-persistence-cassandra | src/main/scala/akka/persistence/cassandra/journal/CassandraRecovery.scala | Scala | apache-2.0 | 2,699 |
package org.jetbrains.plugins.scala
package base
import java.io.File
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.projectRoots.{JavaSdk, Sdk}
import com.intellij.openapi.roots._
import com.intellij.openapi.roots.libraries.Library
import com.intellij... | advancedxy/intellij-scala | test/org/jetbrains/plugins/scala/base/ScalaLibraryLoader.scala | Scala | apache-2.0 | 5,615 |
/** This file is part of Nexus, which is Copyright 2012 Johannes Åman Pohjola.
*
* Nexus 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, version 3.
*
* Nexus is distributed in the hope that it will b... | Sen045/nexus | src/nexus/semimove.scala | Scala | gpl-3.0 | 6,272 |
/* sbt -- Simple Build Tool
* Copyright 2009 Mark Harrah
*/
package xsbt
import java.io.{ BufferedReader, BufferedWriter, InputStreamReader, OutputStreamWriter }
import java.net.{ InetAddress, ServerSocket, Socket }
import scala.util.control.NonFatal
object IPC {
private val portMin = 1025
private val portMax ... | Duhemm/sbt | main-command/src/main/scala/xsbt/IPC.scala | Scala | bsd-3-clause | 2,230 |
package com.github.tototoshi.play2.auth.test
import play.api.test._
import play.api.mvc.Cookie
import com.github.tototoshi.play2.auth.AuthConfig
import play.api.libs.Crypto
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
trait Helpers {
imp... | tototoshi/play2-auth | test/src/main/scala/com/github/tototoshi/play2/auth/test/Helpers.scala | Scala | apache-2.0 | 717 |
package net.flatmap.cobra
import akka.actor.{Actor, ActorLogging, ActorRef, Props, Terminated}
import net.flatmap.collaboration.{Annotations, Document, Server}
import scala.util.{Failure, Success}
object SnippetServer {
def props(env: Map[String,String]) = Props(classOf[SnippetServer],env)
val services: Map[Mod... | flatmap/cobra | modules/cobra-server/src/main/scala/net/flatmap/cobra/SnippetServer.scala | Scala | lgpl-3.0 | 2,537 |
package masterleague4s
package net
import io.circe.Decoder
import fs2._
import data._
import matryoshka.data.Fix
import shapeless.tag.@@
import spinoco.fs2.http._
import spinoco.protocol.http.Uri
//import spinoco.protocol.http.header.Authorization
import data.Serialized._
import codec.CirceSupport._
import codec.FDeco... | martijnhoekstra/masterleague4s | src/main/scala/net/UnfoldApiResult.scala | Scala | gpl-3.0 | 4,730 |
/*
* 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 ... | pronix/spark | core/src/main/scala/org/apache/spark/storage/DiskBlockObjectWriter.scala | Scala | apache-2.0 | 7,667 |
/*
* Copyright 2011-2022 GatlingCorp (https://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... | gatling/gatling | gatling-commons/src/main/scala/io/gatling/commons/validation/Validation.scala | Scala | apache-2.0 | 2,721 |
package com.gilt.nlp
sealed abstract class PartOfSpeech private[nlp](val name: String)
object PartOfSpeech {
case object Verb extends PartOfSpeech("verb")
case object Noun extends PartOfSpeech("noun")
case object Adjective extends PartOfSpeech("adjective")
case object Adverb extends PartOfSpeech("adverb")
c... | gilt/lib-nlp | src/main/scala/com/gilt/nlp/POS.scala | Scala | mit | 3,630 |
/*
ASIB - A Scala IRC Bot
Copyright (C) 2012 Iain Cambridge
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 versio... | icambridge-old/asib | src/main/scala/asib/command/user/news/Search.scala | Scala | gpl-3.0 | 2,443 |
/*
* 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/main/scala/org/apache/flink/table/plan/nodes/physical/FlinkPhysicalRel.scala | Scala | apache-2.0 | 1,622 |
import sbt._
import Keys._
object PlayFlowBuild extends Build {
import uk.gov.hmrc.DefaultBuildSettings
import DefaultBuildSettings._
import uk.gov.hmrc.{SbtBuildInfo, ShellPrompt}
val nameApp = "play-flow"
val versionApp = "0.1.0"
val appDependencies = {
import Dependencies._
Seq(
Compil... | liquidarmour/play-flow | project/PlayFlowBuild.scala | Scala | apache-2.0 | 2,450 |
/*
* Copyright 2016 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... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/CP502.scala | Scala | apache-2.0 | 828 |
package java.util
import scala.collection.mutable
class LinkedHashMap[K, V] private (inner: mutable.LinkedHashMap[Box[K], V],
accessOrder: Boolean) extends HashMap[K, V](inner) {
self =>
def this() =
this(mutable.LinkedHashMap.empty[Box[K], V], false)
def this(initialCapacity: Int, loadFactor: Float, ... | lrytz/scala-js | javalib/src/main/scala/java/util/LinkedHashMap.scala | Scala | bsd-3-clause | 1,827 |
/*
* Copyright 2011 TomTom International BV
*
* 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 o... | ebowman/splitter | src/test/scala/tomtom/splitter/config/ConfigSpec.scala | Scala | apache-2.0 | 4,439 |
package pdi.jwt
import java.time.Clock
import io.circe._
class JwtCirceSpec extends JwtJsonCommonSpec[Json] with CirceFixture {
override def jwtJsonCommon(clock: Clock) = JwtCirce(clock)
}
| pauldijou/jwt-scala | json/circe/src/test/scala/JwtCirceSpec.scala | Scala | apache-2.0 | 193 |
/*
* Copyright (c) 2014 Mario Pastorelli ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless re... | isaka/shapeless | examples/src/main/scala/shapeless/examples/csv.scala | Scala | apache-2.0 | 4,556 |
/*
* 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... | tromika/sparkling-water | core/src/main/scala/org/apache/spark/repl/H2OILoop.scala | Scala | apache-2.0 | 38,446 |
/*
* 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 ... | LantaoJin/spark | core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala | Scala | apache-2.0 | 27,791 |
/*
* Copyright 2013 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | twitter/storehaus | storehaus-core/src/main/scala/com/twitter/storehaus/PivotedReadableStore.scala | Scala | apache-2.0 | 1,836 |
package uk.co.seansaville.ninetyninescalaprobs.lists
/**
* Problem 20: Remove the Kth element from a list.
*/
object Problem20 {
def removeAt[T](k: Int, list: List[T]): (List[T], T) = {
def removeHelper[U](k: Int, list: List[U], temp: List[U]): (List[U], U) = (k, list) match {
case (0, h :: t) => (tem... | seansaville/99scalaprobs | src/main/scala/uk/co/seansaville/ninetyninescalaprobs/lists/Problem20.scala | Scala | mit | 505 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala | Scala | apache-2.0 | 18,656 |
/*
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 use this f... | transcendent-ai-labs/DynaML | dynaml-core/src/main/scala/io/github/mandar2812/dynaml/graph/FFNeuralGraph.scala | Scala | apache-2.0 | 9,499 |
/*
* Copyright (C) 2016 Nikos Katzouris
*
* 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 d... | nkatzz/OLED | src/main/scala/metric/Test.scala | Scala | gpl-3.0 | 1,077 |
package thought
import com.twitter.finatra.http.Controller
import com.twitter.finatra.request.QueryParam
import jarta.thoughtservice.thriftscala.{Thought, ThoughtService}
class ThoughtController(thoughtService: ThoughtService.FutureIface) extends Controller {
get("/thought/:id") { request: GetThoughtRequest =>
... | lbunschoten/jarta | apps-bff/src/main/scala/thought/ThoughtController.scala | Scala | apache-2.0 | 764 |
package ru.tomtrix.ttl
import org.eclipse.swt.widgets._
import akka.actor.ActorSystem
object GUI {
def createApp(title: String, width: Int, height: Int)(f: (Shell, ActorSystem) => Unit) {
// Akka Actor System
val system = ActorSystem(title)
// display & shell
val display = Display.getDefault
val... | tom-trix/TomTrixLibrary | src/main/scala/ru/tomtrix/ttl/GUI.scala | Scala | apache-2.0 | 1,032 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ronq/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/iterators/KryoVisibilityRowEncoder.scala | Scala | apache-2.0 | 5,976 |
package almond.display
import java.net.URL
final class Json private(
val contentOrUrl: Either[URL, String],
// FIXME This may not be the right terminology (see https://en.wikipedia.org/wiki/Media_type).
// This could also be generalized to the other Display classes.
val vendorPart: Option[String],
val... | alexarchambault/jupyter-scala | modules/scala/jupyter-api/src/main/scala/almond/display/Json.scala | Scala | apache-2.0 | 1,420 |
import scala.collection.immutable.{ Range, NumericRange }
object Test {
def rangeForeach(range : Range) = {
val buffer = new scala.collection.mutable.ListBuffer[Int];
range.foreach(buffer += _);
assert(buffer.toList == range.iterator.toList, buffer.toList.toString + "/" + range.iterator.toList)
}
de... | som-snytt/dotty | tests/run/range.scala | Scala | apache-2.0 | 2,607 |
package castalia.actors
//
//import akka.actor.ActorSystem
import akka.actor.ActorDSL._
import akka.actor.{ActorRef, ActorSystem}
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.model.{HttpMethods, HttpRequest}
import akka.testkit.TestActor.{NoAutoPilot, AutoPilot}
import akka.testkit.TestProbe... | TimSoethout/stubserver | src/test/scala/castalia/actors/ReceptionistSpec.scala | Scala | mit | 5,563 |
package controllers
import java.util.UUID
import javax.inject.Inject
import com.mohiva.play.silhouette.api._
import com.mohiva.play.silhouette.api.repositories.AuthInfoRepository
import com.mohiva.play.silhouette.api.services.AvatarService
import com.mohiva.play.silhouette.api.util.PasswordHasher
import com.mohiva.pl... | renexdev/Play-Auth-Slick-Seed-Load-Schema | app/controllers/SignUpController.scala | Scala | apache-2.0 | 3,056 |
package org.sisioh.aws4s.s3.model
import com.amazonaws.services.s3.model.{ CannedAccessControlList, AccessControlList, SetObjectAclRequest }
import org.sisioh.aws4s.PimpedType
object SetObjectAclRequestFactory {
def create(bucketName: String, key: String, acl: AccessControlList): SetObjectAclRequest =
new SetO... | everpeace/aws4s | aws4s-s3/src/main/scala/org/sisioh/aws4s/s3/model/RichSetObjectAclRequest.scala | Scala | mit | 1,319 |
package feh.tec.visual
import java.awt.Canvas
import feh.tec.visual.util.AwtEventUtils
import scala.swing.event.{WindowClosing, WindowActivated}
import org.lwjgl.opengl.{GL11, Display}
/**
* From http://lwjgl.org/wiki/index.php?title=Using_a_Resizeable_AWT_Frame_with_LWJGL
*/
trait SwingNicolApp extends AppSurround... | fehu/agent-tareas | draw-integration/src/main/scala/feh/tec/visual/SwingNicolApp.scala | Scala | mit | 1,363 |
package com.twitter.summingbird.planner
import org.scalacheck._
import org.scalacheck.Prop.forAll
object ComposedFunctionsTest extends Properties("ComposedFunctions") {
property("KeyFlatMapFunction maps only keys") =
forAll { (f: Int => Iterable[Int], i: Int, s: String) =>
val fn = KeyFlatMapFunction[Int... | twitter/summingbird | summingbird-core/src/test/scala/com/twitter/summingbird/planner/ComposedFunctionsTest.scala | Scala | apache-2.0 | 627 |
/*
* Copyright 2012 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | wyzssw/zipkin | zipkin-cassandra/src/main/scala/com/twitter/zipkin/storage/cassandra/CassandraStorage.scala | Scala | apache-2.0 | 5,741 |
package org.jetbrains.plugins.scala
package lang.psi.light
import com.intellij.psi._
import com.intellij.psi.impl.light.LightFieldBuilder
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTypeDefinition
import org.jetbrains.plugins.scala.lang.psi.types.ScType
/**
* @author Alefas
* @since 07.12.12
... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/light/ScLightField.scala | Scala | apache-2.0 | 609 |
/*
* Copyright 2016 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 applicabl... | sini/avrohugger-maven-plugin | src/main/scala/at/makubi/maven/plugin/avrohugger/Implicits.scala | Scala | apache-2.0 | 869 |
/*
Copyright 2016 ScalABM
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
distribu... | EconomicSL/agora | src/main/scala/org/economicsl/agora/markets/tradables/orders/ask/AskOrder.scala | Scala | apache-2.0 | 817 |
/*
* 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/commons | file/src/main/scala/org/beangle/commons/file/diff/bsdiff/Offset.scala | Scala | lgpl-3.0 | 3,997 |
package org.sisioh.aws4s.sns.model
import com.amazonaws.services.sns.model.{ ListSubscriptionsByTopicResult, Subscription }
import org.sisioh.aws4s.PimpedType
import scala.collection.JavaConverters._
object ListSubscriptionsByTopicResultFactory {
def create(): ListSubscriptionsByTopicResult =
new ListSubscript... | sisioh/aws4s | aws4s-sns/src/main/scala/org/sisioh/aws4s/sns/model/RichListSubscriptionsByTopicResult.scala | Scala | mit | 1,123 |
package polyite.fitness.scop_features
import polyite.fitness.Feature
import polyite.schedule.DomainCoeffInfo
import polyite.schedule.Dependence
import polyite.ScopInfo
import polyite.util.SCoPMetrics
import polyite.schedule.schedule_tree.ScheduleNode
import polyite.config.Config
/**
* Maximum loop depth of the SCoP... | stganser/polyite | src/polyite/fitness/scop_features/MaxLoopDepth.scala | Scala | mit | 646 |
package controllers
import play.api._
import play.api.mvc._
import org.xml.sax.InputSource
import org.htmlcleaner._
import scala.collection.mutable.ListBuffer
import scala.xml._
import java.net._
import parsing._
import scala.io.Source
import java.net.URL
import scala.util.matching.Regex
import scala.collection.mutab... | RichoHan/Fun_Programming_Hackthon | app/controllers/Application.scala | Scala | mit | 12,441 |
/*
* 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 | core/src/test/scala/org/apache/spark/deploy/history/ApplicationCacheSuite.scala | Scala | apache-2.0 | 13,740 |
package org.webant.extension.link
import org.apache.commons.dbutils.handlers.BeanListHandler
import org.apache.log4j.LogManager
import org.webant.commons.entity.Link
import org.webant.commons.link.JdbcLinkProvider
import scala.collection.JavaConverters._
class MysqlLinkProvider extends JdbcLinkProvider {
private v... | sutine/webant | webant-extension/src/main/scala/org/webant/extension/link/MysqlLinkProvider.scala | Scala | apache-2.0 | 4,188 |
package clide.messages
import scala.concurrent.Future
abstract class RefResolver[T,I](val resolve: I => Future[T])
sealed trait Ref[T,I] {
def get(implicit resolver: RefResolver[T,I]): Future[T]
def id: I
override def equals(other: Any) = other match {
case ref: Ref[_,_] => ref.id == this.id
case ... | martinring/clide2 | modules/clide-common/src/main/scala/clide/messages/Ref.scala | Scala | lgpl-3.0 | 601 |
package nsmc.conversion
import com.mongodb.casbah.Imports._
import nsmc.conversion.types.{StructureType, MongoAndInternal}
import org.apache.spark.sql.Row
import org.scalatest.{Matchers, FlatSpec}
class RecordConverterTests extends FlatSpec with Matchers {
"a flat record with no gaps in the right order" should "co... | shotishu/spark-mongodb-connector | src/test/scala/nsmc/conversion/RecordConverterTests.scala | Scala | apache-2.0 | 4,433 |
package com.datastax.spark.connector.writer
import java.io.IOException
import java.net.InetAddress
import com.datastax.driver.core._
import com.datastax.spark.connector.cql._
import com.datastax.spark.connector.util.Quote._
import org.apache.spark.Logging
import scala.collection.JavaConversions._
import scala.colle... | rafaelbarreto87/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/writer/ReplicaMapper.scala | Scala | apache-2.0 | 3,652 |
package com.twitter.finagle.redis
import java.lang.{Boolean => JBoolean, Long => JLong}
import com.twitter.finagle.redis.protocol._
import com.twitter.io.Buf
import com.twitter.util.Future
private[redis] trait StringCommands { self: BaseClient =>
val FutureTrue: Future[JBoolean] = Future.value(true)
val FutureFa... | mkhq/finagle | finagle-redis/src/main/scala/com/twitter/finagle/redis/StringCommands.scala | Scala | apache-2.0 | 10,799 |
package org.jetbrains.plugins.scala
package codeInspection
package collections
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression
import scala.collection.immutable.ArraySeq
/**
* Nikolay.Tropin
* 2014-05-05
*/
class FilterSizeInspection extends OperationOnCollectionInspection {
override def possi... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/codeInspection/collections/FilterSizeInspection.scala | Scala | apache-2.0 | 840 |
package com.avsystem.commons
package redis
import java.io.File
import org.apache.commons.io.FileUtils
import org.scalatest.Suite
import scala.concurrent.Await
import scala.concurrent.duration._
/**
* Author: ghik
* Created: 27/06/16.
*/
trait UsesPreconfiguredCluster extends UsesActorSystem with UsesClusterSe... | AVSystem/scala-commons | commons-redis/src/test/scala/com/avsystem/commons/redis/UsesPreconfiguredCluster.scala | Scala | mit | 961 |
package provingground.learning
import spire.algebra._
import spire.implicits._
object GramSchmidt {
def makePerpFromON[V](orthonormals: Vector[V], vec: V)(
implicit vs: InnerProductSpace[V, Double]
): V =
orthonormals match {
case Vector() => vec
case init :+ last =>
val recVec = ... | siddhartha-gadgil/ProvingGround | core/src/main/scala/provingground/learning/GramSchmidt.scala | Scala | mit | 5,010 |
package com.github.cuzfrog.maila.server
import java.util.Date
import javax.mail.Message.RecipientType
import javax.mail.internet.{InternetAddress, MimeMessage}
import javax.mail.{Address, MessagingException, Session, Transport}
private[server] trait Sender {
def send(recipients: Seq[String], subject: String, text: ... | cuzfrog/maila | src/main/scala/com/github/cuzfrog/maila/server/Sender.scala | Scala | apache-2.0 | 1,437 |
package forimpatient.chapter01
/**
* Created by Iryna Kharaborkina on 7/25/16.
*
* Solution to the Chapter 01 Exercise 10 'Scala for the Impatient' by Horstmann C.S.
*
* What do the take, drop, takeRight, and dropRight string functions do? What advantage or
* disadvantage do they have over using substring... | Kiryna/Scala-for-the-Impatient | src/forimpatient/chapter01/Exercise10.scala | Scala | apache-2.0 | 775 |
/**
* Copyright (c) 2013, The National Archives <[email protected]>
* https://www.nationalarchives.gov.uk
*
* 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://moz... | adamretter/csv-validator | csv-validator-core/src/main/scala/uk/gov/nationalarchives/csv/validator/schema/TraceableParsers.scala | Scala | mpl-2.0 | 1,906 |
package com.twitter.finagle.memcached.util
object ParserUtils {
val DIGITS = "^\\d+$"
}
| firebase/finagle | finagle-memcached/src/main/scala/com/twitter/finagle/memcached/util/ParserUtils.scala | Scala | apache-2.0 | 91 |
package treeline
import org.scalacheck._
object RenderingSpecification
extends Properties("rendering") {
import Prop._
def genTree = for {
root <- Gen.alphaStr
branch0 <- Gen.alphaStr
branch1 <- Gen.alphaStr
} yield (root, branch0, branch1)
property("render unicode trees") = forAll(genTree) {
... | softprops/treeline-scala | src/test/scala/rendering.scala | Scala | mit | 802 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/fset-faststream | test/controllers/AssessorControllerSpec.scala | Scala | apache-2.0 | 7,631 |
package com.github.takezoe.solr.scala.sample
import com.github.takezoe.solr.scala.Order
import com.github.takezoe.solr.scala.async.AsyncSolrClient
import scala.concurrent._
import scala.concurrent.duration._
import scala.util.{Failure, Success}
import scala.concurrent.ExecutionContext.Implicits.global
object AsyncSo... | takezoe/solr-scala-client | src/main/scala/com/github/takezoe/solr/scala/sample/AsyncSolrClientSample.scala | Scala | apache-2.0 | 1,450 |
package org.sisioh.aws4s.eb.model
import com.amazonaws.services.elasticbeanstalk.model.CreateStorageLocationResult
import org.sisioh.aws4s.PimpedType
object CreateStorageLocationResultFactory {
def create(): CreateStorageLocationResult = new CreateStorageLocationResult()
}
class RichCreateStorageLocationResult(v... | sisioh/aws4s | aws4s-eb/src/main/scala/org/sisioh/aws4s/eb/model/RichCreateStorageLocationResult.scala | Scala | mit | 717 |
package jp.ne.opt.chronoscala
import jp.ne.opt.chronoscala.Imports._
import org.scalacheck.{Prop, Properties}
object RichLocalDateTimeSpec extends Properties("RichLocalDateTime") with Gens {
import Prop.forAll
property("totally ordered") = forAll(for {
a <- localDateTimeGen
b <- localDateTimeGen
c <-... | opt-tech/chronoscala | shared/src/test/scala/jp/ne/opt/chronoscala/RichLocalDateTimeSpec.scala | Scala | mit | 573 |
/*
* 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 ... | NSAmelchev/ignite | modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala | Scala | apache-2.0 | 12,975 |
package org.jetbrains.plugins.scala.lang.completion3
import com.intellij.codeInsight.completion.CompletionType
import com.intellij.codeInsight.lookup.LookupElementPresentation
import com.intellij.openapi.vfs.VfsUtil
import org.jetbrains.plugins.scala.codeInsight.ScalaCodeInsightTestBase
import org.junit.Assert
/**
*... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/lang/completion3/ScalaLookupRenderingTest.scala | Scala | apache-2.0 | 1,511 |
package models
import java.sql.Connection
case class CreateItem(
localeId: Long, siteId: Long, categoryId: Long, itemName: String, taxId: Long,
currencyId: Long, price: BigDecimal, listPrice: Option[BigDecimal], costPrice: BigDecimal, description: String,
isCoupon: Boolean
)(
implicit itemRepo: ItemRepo,
s... | ruimo/store2 | app/models/CreateItem.scala | Scala | apache-2.0 | 497 |
package dhg.ccg.parse.pcfg
import dhg.ccg.cat._
import dhg.ccg.rule._
import dhg.ccg.tagdict.TagDictionary
import dhg.util._
import scalaz._
import Scalaz._
import dhg.ccg.prob._
import dhg.ccg.parse._
import dhg.ccg.util._
trait PcfgWeighterI extends Serializable {
def logWeight(tree: CcgTreeI,
logRootDist: In... | dhgarrette/2015-ccg-parsing | src/main/scala/dhg/ccg/parse/pcfg/PcfgWeighterI.scala | Scala | apache-2.0 | 1,811 |
package io.surfkit.clientlib
import scala.scalajs.js
import js.annotation._
import js.JSConverters._
package components {
import org.scalajs.dom.Event
import org.scalajs.dom.CanvasRenderingContext2D
trait ChartDataSet extends js.Object {
var label: String = js.native
var fillColor: String = js.native
var stro... | saileshs/scalajs-chart | src/main/scala/io/surfkit/clientlib/Chart.scala | Scala | mit | 19,977 |
package pl.touk.nussknacker.ui.security.oauth2
import java.net.URI
import java.nio.charset.{Charset, StandardCharsets}
import java.security.PublicKey
import com.typesafe.config.Config
import pl.touk.nussknacker.engine.util.Implicits.SourceIsReleasable
import pl.touk.nussknacker.ui.security.CertificatesAndKeys
import p... | TouK/nussknacker | security/src/main/scala/pl/touk/nussknacker/ui/security/oauth2/OAuth2Configuration.scala | Scala | apache-2.0 | 4,746 |
package de.tototec.sbuild.eclipse.plugin.container
import org.eclipse.core.runtime.IPath
import org.eclipse.core.runtime.NullProgressMonitor
import org.eclipse.jdt.core.ClasspathContainerInitializer
import org.eclipse.jdt.core.IClasspathContainer
import org.eclipse.jdt.core.IJavaProject
import org.eclipse.jdt.core.Jav... | SBuild-org/sbuild-eclipse-plugin | de.tototec.sbuild.eclipse.plugin/src/main/scala/de/tototec/sbuild/eclipse/plugin/container/SBuildClasspathContainerInitializer.scala | Scala | apache-2.0 | 1,455 |
package com.sidemash.redson.scalatest
import org.scalatest._
abstract class UnitSpec extends FlatSpec
with Matchers with OptionValues with Inside with Inspectors | sidemash/redson | src/test/scala/com/sidemash/redson/scalatest/UnitSpec.scala | Scala | mit | 165 |
/*
* This file is part of AckCord, licensed under the MIT License (MIT).
*
* Copyright (c) 2019 Katrix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including ... | Katrix-/AckCord | core/src/main/scala/ackcord/APIMessage.scala | Scala | mit | 12,562 |
// Copyright (c) 2010 Sean C. Rhea <[email protected]>
// All rights reserved.
//
// See the file LICENSE included in this distribution for details.
package org.srhea.scalaqlite
import org.scalatest.FlatSpec
import org.scalatest.Matchers
import scala.util.{ Failure, Try }
class SqliteDbSpec extends FlatSpec with ... | meraki/scalaqlite | src/test/scala/SqliteDbSpec.scala | Scala | mit | 7,461 |
package com.typesafe.sbt.packager.universal
import com.typesafe.sbt.packager._
import com.typesafe.sbt.packager.permissions
import org.scalatest._
import java.io.File
import java.nio.file.{ Path, Paths, Files }
import java.nio.file.attribute.PosixFilePermission._
import scala.collection.JavaConversions._
class ZipHel... | benmccann/sbt-native-packager | src/test/scala/com/typesafe/sbt/packager/universal/ZipHelperSpec.scala | Scala | bsd-2-clause | 6,299 |
package demesne.index
import scala.reflect._
import akka.actor.{ ActorLogging, ActorRef, Props }
import akka.cluster.Cluster
import akka.cluster.pubsub.DistributedPubSub
import akka.event.LoggingReceive
import akka.persistence.{ PersistentActor, SnapshotOffer }
import cats.syntax.either._
import omnibus.core.syntax.cl... | dmrolfs/demesne | core/src/main/scala/demesne/index/IndexAggregate.scala | Scala | apache-2.0 | 11,779 |
package com.mentatlabs.nsa
package scalac
package options
/* -Xno-patmat-analysis
* ====================
* 2.10.0 - 2.12.0: Don't perform exhaustivity/unreachability analysis. Also, ignore @switch annotation.
*/
case object ScalacXNoPatmatAnalysis
extends ScalacOptionBoolean("-Xno-patmat-analysis", ScalacVers... | mentat-labs/sbt-nsa | nsa-core/src/main/scala/com/mentatlabs/nsa/scalac/options/advanced/ScalacXNoPatmatAnalysis.scala | Scala | bsd-3-clause | 335 |
package org.psliwa.idea.composerJson.intellij.codeAssist.composer
import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile
import org.psliwa.... | psliwa/idea-composer-plugin | src/main/scala/org/psliwa/idea/composerJson/intellij/codeAssist/composer/InstallPackagesAction.scala | Scala | mit | 1,884 |
package net.resonious.sburb.entities
import net.resonious.sburb.game.After
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.resonious.sburb.abstracts.Vector3
import net.resonious.sburb.Sburb
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.entity.Entity
impor... | Resonious/mcsburb | src/main/scala/net/resonious/sburb/entities/Portal.scala | Scala | mit | 3,799 |
/*
* Copyright (c) 2012 Miles Sabin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | non/shapeless | core/src/main/scala/shapeless/zipper.scala | Scala | apache-2.0 | 12,052 |
package com.arcusys.learn.models.Gradebook
import org.joda.time.DateTime
/**
* Activity attempt model for response
*/
case class StatementAttemptResponse(id: Int,
date: DateTime,
grade: Int,
userResponse: String,
correctResponse: String)
| ViLPy/Valamis | learn-portlet/src/main/scala/com/arcusys/learn/models/Gradebook/StatementAttemptResponse.scala | Scala | lgpl-3.0 | 250 |
package pl.writeonly.son2.impl
import java.io.FileNotFoundException
import pl.writeonly.son2.funs.streamers.StreamerPipeForeach
import pl.writeonly.son2.jack.core.FormatsJack
import pl.writeonly.son2.jack.glue.CreatorConverterJack
import pl.writeonly.scalaops.specs.BlackSpec
class StreamerYamlFeatureSpec extends Bla... | writeonly/son2 | scallions-clis/scallions-main/src/test/scala/pl/writeonly/son2/impl/StreamerYamlFeatureSpec.scala | Scala | apache-2.0 | 2,136 |
package com.codahale.jersey.params
import javax.ws.rs.WebApplicationException
import javax.ws.rs.core.Response
import javax.ws.rs.core.Response.Status
/**
* An abstract base class from which to build parameter classes.
*/
abstract class AbstractParam[A](val input: String) {
val value: A = try {
parse(input)
... | codahale/jersey-scala | src/main/scala/com/codahale/jersey/params/AbstractParam.scala | Scala | mit | 1,492 |
package com.github.akiomik.leap_scala
import com.leapmotion.leap.Gesture.State
object StaticState extends StaticState
trait StaticState {
val Invalid = State.STATE_INVALID
val Start = State.STATE_START
val Stop = State.STATE_STOP
val Update = State.STATE_UPDATE
}
| akiomik/leap-scala | src/main/scala/com/github/akiomik/leap_scala/StaticState.scala | Scala | mit | 282 |
package lila.chat
import lila.user.User
import chess.Color
sealed trait Line {
def text: String
def author: String
def deleted: Boolean
def isSystem = author == systemUserId
def isHuman = !isSystem
def humanAuthor = isHuman option author
}
case class UserLine(
username: String,
text: String,
... | clarkerubber/lila | modules/chat/src/main/Line.scala | Scala | agpl-3.0 | 2,422 |
package com.shorrockin.narrator
/**
* sent from the master to a slave to register the work which needs
* to be performed.
*/
case class RegisterWork(source:(String, String, Int), target:Slave, workload:Seq[Workload])
/**
* sent from the slave back to the master to indicate that it is ready
* to start executing t... | shorrockin/narrator | src/main/scala/Messages.scala | Scala | apache-2.0 | 512 |
package demo.components
import japgolly.scalajs.react._
import scala.scalajs.js
object CallbackDebug {
trait Print[T] {
def print(t: T): String
}
trait PrintLower {
final implicit def PrintAny[T]: Print[T] =
new Print[T]{
override def print(t: T): String =
if (t == js.undefined)... | elacin/scalajs-react-components | demo/src/main/scala/demo/components/CallbackDebug.scala | Scala | apache-2.0 | 2,235 |
/*
* 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/domain | src/main/scala/uk/gov/hmrc/domain/SaUtr.scala | Scala | apache-2.0 | 1,033 |
package mayton.primes
import java.awt.Color
import java.awt.image.BufferedImage
import java.io.FileOutputStream
import java.nio.file.Files
import javax.imageio.ImageIO
object PrimeSpace {
def main(args: Array[String]): Unit = {
val SIZE = 1024
val PIXEL = 4
val CYAN = 0x12c2e8
val RED = 0xd22d96... | Mark-Kovalyov/primegen-experiments | mayton/mtn-primelib/src/main/scala/mayton/primes/PrimeSpace.scala | Scala | gpl-3.0 | 780 |
package helpers
import javax.inject.{Inject, Singleton}
import play.api.Logger
import twitter4j.{OEmbedRequest, Status, Twitter, TwitterFactory}
import twitter4j.conf.ConfigurationBuilder
class TwitterAdapter(
consumerKey: String, secretKey: String,
accessToken: String, accessTokenSecret: String,
cacheDuration... | ruimo/store2 | app/helpers/TwitterAdapter.scala | Scala | apache-2.0 | 2,023 |
package com.softwaremill.codebrag.common.config
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
import com.typesafe.config.{ConfigParseOptions, ConfigResolveOptions, ConfigFactory}
class ConfigWithDefaultSpec extends FlatSpec with ShouldMatchers {
case class Spec[T](path: String, default... | softwaremill/codebrag | codebrag-common/src/test/scala/com/softwaremill/codebrag/common/config/ConfigWithDefaultSpec.scala | Scala | agpl-3.0 | 2,105 |
package com.twitter.zipkin.receiver.kafka
import com.twitter.zipkin.thriftscala.{Span => ThriftSpan}
import com.twitter.util.{Closable, CloseAwaitably, FuturePool, Future, Time}
import java.util.concurrent.{TimeUnit, Executors}
import java.util.Properties
import kafka.consumer.{Consumer, ConsumerConfig, ConsumerConnec... | travisbrown/zipkin | zipkin-receiver-kafka/src/main/scala/com/twitter/zipkin/receiver/kafka/KafkaProcessor.scala | Scala | apache-2.0 | 1,694 |
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
package com.krux.hyperion.client
import scala.jdk.CollectionConverters._
import com.amazo... | realstraw/hyperion | core/src/main/scala/com/krux/hyperion/client/UploadPipelineObjectsTrans.scala | Scala | bsd-3-clause | 4,546 |
package ui.shader.builder
import ui.shader.builder.types.GlType
import ui.shader.builder.value.{GlValue, GlVec4Val}
class GlAssign[T <: GlType](val variable: GlVar[T],
val expr: GlValue[T]) extends GlCommand {
override def toGlsl: String = {
variable.toGlsl + " = " + expr.toG... | gvatn/play-scalajs-webgl-spark | client/src/main/scala/ui/shader/builder/GlAssign.scala | Scala | mit | 1,704 |
package japgolly.scalajs.react.internal.monocle
import japgolly.scalajs.react.extra.{StateSnapshot, StateSnapshotF}
import japgolly.scalajs.react.util.NotAllowed
import scala.annotation.nowarn
@nowarn("cat=unused")
trait MonocleExtStateSnapshot {
import MonocleExtStateSnapshot._
@inline final implicit def Monocl... | japgolly/scalajs-react | extraExtMonocle3/src/main/scala/japgolly/scalajs/react/internal/monocle/MonocleExtStateSnapshot.scala | Scala | apache-2.0 | 3,207 |
package com.nutomic.ensichat.core.messages.body
import java.nio.ByteBuffer
import com.nutomic.ensichat.core.routing.Address
import com.nutomic.ensichat.core.util.BufferUtils
private[core] object RouteRequest {
val Type = 2
/**
* Constructs [[RouteRequest]] instance from byte array.
*/
def read(array: A... | Nutomic/ensichat | core/src/main/scala/com/nutomic/ensichat/core/messages/body/RouteRequest.scala | Scala | mpl-2.0 | 1,196 |
object i0 {
inline def i1[i2[-i3]](implicit i1: i4[Int]): Unit = {
val i2: i2[i1] = new i0(0)
def this(i3: String) =
new i1(10 => i3.i3())
}
} | som-snytt/dotty | tests/fuzzy/dea0cf7fd832a6f39963ddda6ffd89b336d18808.scala | Scala | apache-2.0 | 142 |
package org.loom.scene
import org.loom.geometry._
import java.awt._
trait Drawable {
def update(): Unit
def draw (g2D: Graphics2D): Unit
} | brogan/Loom | src/org/loom/scene/Drawable.scala | Scala | gpl-3.0 | 145 |
/*
* Copyright 2014 Timothy Danford
*
* 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... | tdanford/scheduling-simulator | scheduling-core/src/main/scala/org/bdgenomics/scheduling/Provider.scala | Scala | apache-2.0 | 1,721 |
package com.github.luzhuomi.regex.deriv.diagnosis
import scala.collection.Map._
import com.github.luzhuomi.regex.deriv.RE._
import com.github.luzhuomi.regex.deriv.Common._
import com.github.luzhuomi.regex.deriv.Parse._
import com.github.luzhuomi.regex.deriv.diagnosis.Ambiguity._
object Universality
{
def allDerivs(... | luzhuomi/scala-deriv | src/main/scala/com/github/luzhuomi/regex/deriv/diagnosis/Universality.scala | Scala | apache-2.0 | 838 |
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.