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 controllers
import javax.inject.Inject
import models.db
import play.api.mvc._
import scalikejdbc._
import scala.concurrent.ExecutionContext
/**
*
* @author ponkotuy
* Date: 14/03/22.
*/
class RestImage @Inject()(implicit val ec: ExecutionContext) extends Controller {
import controllers.Common._
def... | kxbmap/MyFleetGirls | server/app/controllers/RestImage.scala | Scala | mit | 2,044 |
/*
* Copyright (c) 2008, Michael Pradel
* All rights reserved. See LICENSE for details.
*/
package patternsWithoutRoles
class HelpHandler(var successor: HelpHandler, var topic: String) {
def hasHelp = topic != ""
def handleHelp: Unit = if (successor != null) successor.handleHelp
}
abstract class Widget(var p... | tupshin/Scala-Roles | examples/patternsWithoutRoles/ChainOfRespExample.scala | Scala | bsd-3-clause | 1,087 |
package lila.fishnet
import org.joda.time.DateTime
import reactivemongo.bson._
import scala.concurrent.duration._
import scala.concurrent.Future
import scala.util.{ Try, Success, Failure }
import Client.Skill
import lila.db.dsl._
import lila.hub.FutureSequencer
final class FishnetApi(
repo: FishnetRepo,
move... | clarkerubber/lila | modules/fishnet/src/main/FishnetApi.scala | Scala | agpl-3.0 | 7,236 |
/*
* Copyright (c) 2013-2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0, and
* you may not use this file except in compliance with the Apache License
* Version 2.0. You may obtain a copy of the Apache License Version 2.0 at
* http://www.... | krahman/snowplow | 3-enrich/scala-kinesis-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.kinesis/SpecHelpers.scala | Scala | apache-2.0 | 8,626 |
package scredis.io
import java.net.InetSocketAddress
import java.util.LinkedList
import akka.actor._
import akka.io.{IO, Tcp}
import akka.util.ByteString
import com.typesafe.scalalogging.LazyLogging
import scredis.exceptions.RedisIOException
import scredis.protocol.{Protocol, Request}
import scala.collection.mutable... | 1and1/scredis | src/main/scala/scredis/io/IOActor.scala | Scala | apache-2.0 | 6,045 |
/*
* 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 ... | saturday-shi/spark | core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala | Scala | apache-2.0 | 35,524 |
package org.shapelogic.sc.operation
import spire.math.Numeric
import spire.implicits._
import org.shapelogic.sc.image.BufferImage
import org.shapelogic.sc.numeric._
import org.shapelogic.sc.pixel._
import spire.math._
import spire.implicits._
import scala.reflect.ClassTag
import org.shapelogic.sc.numeric.GenericInver... | sami-badawi/shapelogic-scala | src/main/scala/org/shapelogic/sc/operation/Transforms.scala | Scala | mit | 3,928 |
//
// Copyright 2016 Commonwealth Bank of Australia
//
// 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 ... | CommBank/coppersmith | core/src/main/scala/commbank/coppersmith/Feature.scala | Scala | apache-2.0 | 12,172 |
package org.http4s
package server
package middleware
package authentication
import java.util.concurrent.Executors
import org.http4s.Status._
import org.http4s.headers._
import org.http4s.parser.HttpHeaderParser
import org.http4s.util.CaseInsensitiveString
import scalaz.concurrent.Task
import scala.concurrent.durati... | hvesalai/http4s | server/src/test/scala/org/http4s/server/middleware/authentication/AuthenticationSpec.scala | Scala | apache-2.0 | 8,030 |
/*
Copyright 2012 Georgia Tech Research Institute
Author: lance.gatlin@gtri.gatech.edu
This file is part of org.gtri.util.xmlbuilder library.
org.gtri.util.xmlbuilder library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published ... | gtri-iead/org.gtri.util.xmlbuilder | impl/src/main/scala/org/gtri/util/xmlbuilder/impl/XmlElement.scala | Scala | gpl-3.0 | 4,616 |
package filodb.core.memstore
import com.typesafe.scalalogging.StrictLogging
import filodb.memory.NativeMemoryManager
/**
* This is a policy that determines when partitions should be evicted out of memory
*/
trait PartitionEvictionPolicy {
/**
* Returns if partitions _should_ be evicted right now based on crit... | filodb/FiloDB | core/src/main/scala/filodb.core/memstore/PartitionEvictionPolicy.scala | Scala | apache-2.0 | 2,944 |
package com.softwaremill.akka.stream.throttle
import akka.actor.ActorSystem
import akka.stream.scaladsl.Source
import akka.stream.testkit.TestSubscriber
import akka.stream.testkit.scaladsl.TestSink
import akka.stream.{ActorMaterializer, Materializer}
import com.softwaremill.akka.stream.throttle.IntervalBasedThrottlerS... | mkubala/akka-stream-throttle | src/test/scala/com/softwaremill/akka/stream/throttle/IntervalBasedThrottlerSpec.scala | Scala | gpl-2.0 | 4,349 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package controllers
import java.util.Properties
import _root_.features.ApplicationFeatures
import kafka.manager.model._
import ActorModel.LogkafkaIdentity
import kafka.manager.features.KMLogKafkaFeat... | herokumx/heroku-kafka-manager | app/controllers/Logkafka.scala | Scala | apache-2.0 | 14,409 |
/*
* This file is part of Apparat.
*
* Copyright (C) 2010 Joa Ebert
* http://www.joa-ebert.com/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the Lice... | joa/apparat | apparat-core/src/main/scala/apparat/graph/BlockVertex.scala | Scala | lgpl-2.1 | 1,382 |
/*
Facsimile: A Discrete-Event Simulation Library
Copyright © 2004-2020, Michael J Allen.
This file is part of Facsimile.
Facsimile 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 ... | MichaelJAllen/facsimile | core/src/main/scala/org/facsim/anim/cell/CellColorType.scala | Scala | lgpl-3.0 | 1,962 |
package com.avsystem.commons
package redis.examples
import akka.actor.ActorSystem
import com.avsystem.commons.redis._
// Global execution context is used for the sake of simplicity of this example,
// think well if this is what you actually want.
import scala.concurrent.ExecutionContext.Implicits.global
/**
* Exam... | AVSystem/scala-commons | commons-redis/src/test/scala/com/avsystem/commons/redis/examples/MultiExecExample.scala | Scala | mit | 1,714 |
package net.lshift.diffa.kernel.util
import net.lshift.diffa.kernel.util.SessionHelper.sessionFactoryToSessionHelper
/**
* Implements SchemaCleaner for MySQL databases.
*/
object MySqlSchemaCleaner extends SchemaCleaner {
override def clean(sysEnvironment: DatabaseEnvironment, appEnvironment: DatabaseEnvironment)... | aprescott/diffa | kernel/src/test/scala/net/lshift/diffa/kernel/util/MySqlSchemaCleaner.scala | Scala | apache-2.0 | 1,056 |
/*
* Copyright 2019 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/auth-service | app/connectors/AuthMicroserviceConnector.scala | Scala | apache-2.0 | 1,736 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/nn/AddSpec.scala | Scala | apache-2.0 | 2,248 |
package com.googlecode.kanbanik.model
import com.mongodb.casbah.commons.MongoDBObject
import com.mongodb.casbah.Imports._
import com.googlecode.kanbanik.db.HasMidAirCollisionDetection
import com.googlecode.kanbanik.db.HasMongoConnection
import com.googlecode.kanbanik.commons._
import com.googlecode.kanbanik.dtos.Workf... | nagyistoce/kanbanik | kanbanik-server/src/main/scala/com/googlecode/kanbanik/model/Board.scala | Scala | apache-2.0 | 5,657 |
package com.wavesplatform.state.diffs.ci
import com.wavesplatform.account.{Address, KeyPair}
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.common.utils.EitherExt2
import com.wavesplatform.db.WithDomain
import com.wavesplatform.db.WithState.AddrWithBalance
import com.wavesplatform.features.Bloc... | wavesplatform/Waves | node/src/test/scala/com/wavesplatform/state/diffs/ci/CallableV4DiffTest.scala | Scala | mit | 16,746 |
package info.folone.scala.poi
import scala.language.implicitConversions
package object impure {
implicit def workbook2WorkbookImpure(wb: Workbook): WorkbookImpure =
new WorkbookImpure(wb)
}
| folone/poi.scala | src/main/scala/info.folone/scala.poi/package.scala | Scala | apache-2.0 | 198 |
package com.twitter.scrooge.backend
import com.twitter.finagle
import com.twitter.finagle.thrift.ThriftClientRequest
import com.twitter.scrooge.ThriftException
import com.twitter.scrooge.testutil.{JMockSpec, EvalHelper}
import com.twitter.util.{Await, Future}
import org.apache.thrift.protocol._
import org.jmock.{Expec... | elipoz/scrooge | scrooge-generator/src/test/scala/com/twitter/scrooge/backend/ServiceGeneratorSpec.scala | Scala | apache-2.0 | 12,365 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package index
import _root_.org.jetbrains.plugins.scala.lang.psi.impl.search.ScSourceFilterScope
import api.statements.ScFunction
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiClass
import com.intellij.psi.search.Global... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/index/ScFunctionNameIndex.scala | Scala | apache-2.0 | 887 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009 Mark Harrah, Vesa Vilhonen
*/
package sbt
import java.io.File
import java.lang.reflect.{ Method, Modifier }
import Modifier.{ isPublic, isStatic }
import sbt.internal.inc.classpath.ClasspathUtilities
import sbt.internal.inc.ScalaInstance
import sbt.io.Path
import... | Duhemm/sbt | run/src/main/scala/sbt/Run.scala | Scala | bsd-3-clause | 4,828 |
package ru.maizy.ambient7.mt8057agent
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback.classic.filter.ThresholdFilter
import ch.qos.logback.classic.spi.ILoggingEvent
import ch.qos.logback.classic.{ Level, LoggerContext, Logger => LogbackLogger }
import ch.qos.logback.core.{ ConsoleAppen... | maizy/ambient7 | mt8057-agent/src/main/scala/ru/maizy/ambient7/mt8057agent/Mt8057AgentAppLauncher.scala | Scala | apache-2.0 | 4,000 |
package mesosphere.marathon.core.health.impl
import akka.actor.{ ActorSystem, Props }
import akka.testkit._
import mesosphere.marathon._
import mesosphere.marathon.core.health.{ Health, HealthCheck, MarathonHttpHealthCheck }
import mesosphere.marathon.core.task.termination.{ TaskKillReason, TaskKillService }
import me... | timcharper/marathon | src/test/scala/mesosphere/marathon/core/health/impl/HealthCheckActorTest.scala | Scala | apache-2.0 | 5,004 |
/**
* 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 applicable... | danielcsant/RabbitMQ-Receiver | src/main/scala/com/stratio/receiver/RabbitMQInputDStream.scala | Scala | apache-2.0 | 6,042 |
import sbt._
import Keys._
import org.scalatra.sbt._
import org.scalatra.sbt.PluginKeys._
import com.mojolly.scalate.ScalatePlugin._
import ScalateKeys._
object AquiEstamosBuild extends Build {
val Organization = "com.github.upsidedownmind"
val Name = "Aqui Estamos"
val Version = "0.1.0-SNAPSHOT"
val ScalaVers... | upsidedownmind/aquiestamos | project/build.scala | Scala | mit | 1,849 |
package scala.collection
import org.junit.{Assert, Test}
import org.junit.Assert._
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import scala.tools.testkit.AssertUtil._
import scala.util.Try
@RunWith(classOf[JUnit4])
class StringParsersTest {
def doubleOK(str: String): Unit = assertTrue(
s"st... | martijnhoekstra/scala | test/junit/scala/collection/StringParsersTest.scala | Scala | apache-2.0 | 12,819 |
package by.bsuir.verpav.misoi.ui
import java.awt.{Font, Toolkit, Image, FileDialog}
import java.awt.event.{ActionEvent, ActionListener}
import java.awt.image.BufferedImage
import java.io.File
import javax.imageio.ImageIO
import javax.swing._
import by.bsuir.verpav.misoi.harris.HarrisCornersDetector
import by.bsuir.ve... | VerkhovtsovPavel/BSUIR_Labs | Labs/MISOI/MISOI-4/src/by/bsuir/verpav/misoi/ui/MainForm.scala | Scala | mit | 4,884 |
/*
* 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 ... | pgandhi999/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesConf.scala | Scala | apache-2.0 | 7,323 |
/**
* Copyright 2015 Ram Sriharsha
*
* 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 i... | harsha2010/magellan | src/main/scala/magellan/dsl/package.scala | Scala | apache-2.0 | 2,503 |
/*
* 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 | project/MimaBuild.scala | Scala | apache-2.0 | 4,079 |
package support
import com.github.tomakehurst.wiremock.client.WireMock._
object WireMockStubs {
def stubUrl(url: String) = {
stubFor(get(urlEqualTo(url))
.willReturn(aResponse()
.withHeader("Accept", "application/vnd.github.v3+json")
.withBody("Hello world!")));
}
}
| ZDevelop94/RNG-GitHubAPI | test/support/WireMockStubs.scala | Scala | apache-2.0 | 300 |
package propositional
import parsing._
import propositional._
class ConnectiveTestSuite extends ParsableTestSuite[Connective] {
val parsable = Connective
val parameters = ConnectiveTestParameters
}
object ConnectiveTestParameters extends ParsableTestParameters[Connective] {
val children = Set[Parsable[_]](
... | julianmichael/deduction | src/test/scala/propositional/ConnectiveTestSuite.scala | Scala | mit | 1,606 |
package akka.persistence.pg
import java.util.UUID
import akka.actor.Props
import akka.persistence.pg.ExamplePersistentActorTest.{Command, ExamplePA, GetMessage, TakeSnapshot}
import akka.persistence.pg.util.{CreateTables, PersistentActorTest, RecreateSchema}
import akka.persistence.{PersistentActor, SnapshotOffer}
im... | kwark/akka-persistence-postgresql | modules/akka-persistence-pg/src/test/scala/akka/persistence/pg/ExamplePersistentActorTest.scala | Scala | mit | 4,406 |
package com.karasiq.shadowcloud.config
import com.typesafe.config.Config
import com.karasiq.common.configs.ConfigImplicits
import com.karasiq.shadowcloud.model.RegionId
import com.karasiq.shadowcloud.storage.replication.StorageSelector
import com.karasiq.shadowcloud.storage.replication.selectors.SimpleStorageSelector... | Karasiq/shadowcloud | core/src/main/scala/com/karasiq/shadowcloud/config/RegionConfig.scala | Scala | apache-2.0 | 1,811 |
/******************************************************************************************************************\\
* Rapture Core, version 2.0.0. Copyright 2010-2015 Jon Pretty, Propensive Ltd. *
* ... | utaal/rapture-core | src/result.scala | Scala | apache-2.0 | 6,139 |
package com.roundeights.isred
/**
* Methods for sending connection level requests
*/
trait Connection extends Iface {
/** Authenticates to the server with a password */
def auth ( password: String ): AckResult
= getAck( "AUTH" ::: password :: Cmd() )
/** Echos back the given string */
def e... | Nycto/IsRed | src/main/scala/IsRed/iface/Connection.scala | Scala | mit | 704 |
package org.jetbrains.plugins.scala
package codeInspection.collections
import org.jetbrains.plugins.scala.codeInspection.InspectionBundle
/**
* Nikolay.Tropin
* 2014-05-07
*/
class FilterSizeCheckTest extends OperationsOnCollectionInspectionTest {
val hint = InspectionBundle.message("filter.size.check.hint")
d... | consulo/consulo-scala | test/org/jetbrains/plugins/scala/codeInspection/collections/FilterSizeCheckTest.scala | Scala | apache-2.0 | 1,363 |
package net.nomadicalien.ch1
import java.util.Date
/**
* Composing identity verification and opening of an account
*/
object Listing1_11 {
import Listing1_10.AccountService._
val date = new Date()
val cust = getCustomer(1)
verifyCustomer(cust)
.map(c => openCheckingAccount(c, date))
.getOrElse(thr... | BusyByte/functional-n-reactive-domain-modeling | chapter1/src/main/scala/Listing1_11.scala | Scala | apache-2.0 | 376 |
package entities
case class Page(title: String, body: String, slug: String, id: Option[Int]) | icambridge-old/inspector | app/Entities/Page.scala | Scala | mit | 93 |
package cspom.xcsp
import cspom.extension.MDDRelation
import cspom.variable.CSPOMConstant
import cspom.{CSPOM, CSPOMConstraint}
import mdd.{MDD, MDDLeaf}
import org.xcsp.parser.entries.XVariables.XVarInteger
import scala.collection.mutable
/**
* Created by vion on 30/05/17.
*/
trait XCSP3CallbacksLanguage extend... | concrete-cp/cspom | src/main/scala/cspom/xcsp/XCSP3CallbacksLanguage.scala | Scala | lgpl-2.1 | 1,798 |
/*
* 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 ... | JihongMA/incubator-carbondata | integration/spark2/src/test/scala/org/apache/spark/carbondata/vectorreader/VectorReaderTestCase.scala | Scala | apache-2.0 | 3,070 |
class foo(a: String) extends annotation.StaticAnnotation
object o {
implicit def i2s(i: Int): String = ""
@foo(1: String) def blerg: Unit = { }
}
| yusuke2255/dotty | tests/untried/pos/t5892.scala | Scala | bsd-3-clause | 150 |
package utilities
import java.text.SimpleDateFormat
import java.util.Calendar
import com.sksamuel.elastic4s.ElasticDsl.{bulk, index, _}
import com.sksamuel.elastic4s.{ElasticClient, ElasticsearchClientUri}
import com.typesafe.config.Config
import org.elasticsearch.common.settings.Settings
import org.json4s.NoTypeHint... | MixedEmotions/Orchestrator | src/main/scala/utilities/ElasticsearchPersistor.scala | Scala | apache-2.0 | 4,819 |
/**
* © 2019 Refinitiv. 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 License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | dudi3001/CM-Well | server/cmwell-domain/src/main/scala/cmwell/domain/AggregationFilter.scala | Scala | apache-2.0 | 3,520 |
// #Sireum
/*
Copyright (c) 2018, Robby, Kansas State University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
l... | sireum/v3-runtime | library/shared/src/main/scala/org/sireum/Library.scala | Scala | bsd-2-clause | 1,446 |
package manual
trait Monoid[A] {
def compose(a: A, b: A): A
def empty: A
}
object DefaultMonoids {
implicit val stringConcatMonoid = new Monoid[String] {
override def compose(a: String, b: String): String = s"$a$b"
override def empty: String = ""
}
}
object Operations {
def combineAll[A](list: Lis... | denisftw/advanced-scala-code | cats/src/main/scala/manual/CatsMonoidManual.scala | Scala | apache-2.0 | 618 |
package validation
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import WorkingWithLists.P09._
@RunWith(classOf[JUnitRunner])
class P09TestSuite extends FunSuite {
test("pack an ordinary list: pack(List('a, 'a, 'a, 'a, 'b, 'c, 'c, 'a, 'a, 'd, 'e, 'e, 'e, 'e)) ... | ihac/Ninety-Nine-Scala-Problems | src/test/scala/validation/P09TestSuite.scala | Scala | gpl-3.0 | 2,022 |
/** Copyright 2015 TappingStone, 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 ... | ch33hau/PredictionIO | data/src/main/scala/io/prediction/data/api/WebhooksConnectors.scala | Scala | apache-2.0 | 1,103 |
package org.mybatis.caches.rediscala
import java.util.concurrent.locks.{ReadWriteLock, ReentrantReadWriteLock}
import org.apache.ibatis.cache.Cache
import org.mybatis.caches.rediscala.concurrent.Asyncs
import org.slf4j.LoggerFactory
import redis.RedisClient
import scala.beans.BeanProperty
import scala.concurrent.Execu... | debop/mybatis-redis | src/main/scala/org/mybatis/caches/rediscala/AbstractRedisCache.scala | Scala | apache-2.0 | 1,814 |
/*
* Copyright 2016 rdbc contributors
*
* 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... | rdbc-io/rdbc-pgsql | rdbc-pgsql-core/src/main/scala/io/rdbc/pgsql/core/typeconv/package.scala | Scala | apache-2.0 | 794 |
package com.github.j5ik2o.forseti.domain.user
object GenderType extends Enumeration {
val Male = Value("male")
val Female = Value("female")
}
| j5ik2o/forseti | domain/src/main/scala/com/github/j5ik2o/forseti/domain/user/GenderType.scala | Scala | mit | 151 |
/*
* Copyright 2014 JHC Systems Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | andrewjskatz/sqlest | src/main/scala/sqlest/ast/Order.scala | Scala | apache-2.0 | 679 |
/*
* 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/computations/machineryAndPlant/CP105.scala | Scala | apache-2.0 | 1,633 |
package ersir
import akka.actor.ActorSystem
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import ersir.shared.{Bindings, Posting}
import loci.communicator.ws.akka._
import loci.registry.Registry
import org.jsoup.Jsoup
import rescala.default._
import rescala.extra.lattices.delta.C... | guidosalva/REScala | Code/Examples/Ersir/server/src/main/scala/ersir/Server.scala | Scala | apache-2.0 | 3,256 |
package breeze.inference.bp
import breeze.numerics._
import breeze.util.Index
import breeze.linalg.DenseVector
/**
* A Factor knows about a set of variables and can
* score any assignment to those sets of variables.
* By default, we assume all assignments are valid/scoreable.
*
* You can make some assignments in... | tjhunter/scalanlp-core | learn/src/main/scala/breeze/inference/bp/Factor.scala | Scala | apache-2.0 | 3,986 |
package ch.epfl.yinyang
package api
import reflect.ClassTag
import reflect.runtime.universe.TypeTag
/**
* Base trait for code generating DSLs.
*/
trait CodeGenerator { this: BaseYinYang =>
/**
* Should return a string with a class definition of the DSL code. The class
* must be a Scala FunctionX with adequ... | vjovanov/scala-yinyang | components/yin-yang/src/api/CodeGenerator.scala | Scala | bsd-3-clause | 1,116 |
/*
* 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 ... | andrewor14/iolap | sql/core/src/main/scala/org/apache/spark/sql/json/JSONRelation.scala | Scala | apache-2.0 | 7,480 |
package org.shlrm.scloud
import java.io.File
import java.nio.file.Files
import com.google.common.base.Charsets
import com.google.common.io.ByteSource
import org.apache.commons.io.FileUtils
import org.jclouds.ContextBuilder
import org.jclouds.blobstore.BlobStoreContext
import org.scalatest.{BeforeAndAfterAll, BeforeAn... | dkowis/scloud | src/test/scala/org/shlrm/scloud/GetSpec.scala | Scala | mit | 2,089 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.it.routers
class AdditionalRoutersServiceImpl extends AdditionalRoutersService {}
| lagom/lagom | service/scaladsl/integration-tests/src/test/scala/com/lightbend/lagom/scaladsl/it/routers/AdditionalRoutersServiceImpl.scala | Scala | apache-2.0 | 188 |
import com.twitter.sbt.{BuildProperties,PackageDist,GitProject}
import sbt._
import com.twitter.scrooge.ScroogeSBT
import sbt.Keys._
object Zipkin extends Build {
val CASSIE_VERSION = "0.25.2"
val FINAGLE_VERSION = "6.4.0"
val OSTRICH_VERSION = "9.1.1"
val UTIL_VERSION = "6.3.4"
val SCROOGE_VERSION = "3... | ustczxf/zipkin | project/Project.scala | Scala | apache-2.0 | 11,009 |
package services.db
import javax.inject.{Inject, Singleton}
import models.db.{CustomColumns, MenuItem, MenuItems}
import org.joda.time.LocalDate
import slick.driver.MySQLDriver.api._
import slick.lifted.TableQuery
import scala.concurrent.Future
case class ClientMenuItem(id: Option[Int], name: String, date: LocalDat... | atanana/vue-stocks | app/services/db/MenuItemsDao.scala | Scala | mit | 992 |
package smc.enum
trait Enum {
/**
* Defines the type of elements to map to/from numbers.
*/
protected type EnumElement
/**
* Maps a given integer to a corresponding element.
*
* @param ordinal a number to search the corresponding element for.
* @return an element that is mapped to the gi... | ryo0ka/smc | src/main/scala/smc/enum/Enum.scala | Scala | gpl-2.0 | 862 |
package net.wrap_trap.goju
import java.io.File
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.nio.charset.Charset
import java.util.zip.CRC32
import com.google.common.primitives.UnsignedBytes
import net.wrap_trap.goju.element.Element
import net.wrap_trap.goju.Helper._
import org.j... | masayuki038/goju | src/main/scala/net/wrap_trap/goju/Utils.scala | Scala | mit | 6,225 |
/*
* 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 ... | witgo/spark | external/avro/src/main/scala/org/apache/spark/sql/avro/AvroSerializer.scala | Scala | apache-2.0 | 13,605 |
/*
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.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 require... | frees-io/freestyle | modules/integrations/cache-redis/src/test/scala/free/TestContext.scala | Scala | apache-2.0 | 1,373 |
package com.signalcollect.dcop.modules
trait UtilityFunction[AgentId, Action, Config <: Configuration[AgentId, Action, Config], UtilityType] extends Serializable {
implicit protected def utilEv: Numeric[UtilityType]
def computeUtilities(c: Config, a: Action): Map[AgentId, UtilityType]
def computeUtilities(c: ... | flueckiger/dcop-algorithms | src/main/scala/com/signalcollect/dcop/modules/UtilityFunction.scala | Scala | apache-2.0 | 791 |
/**
* 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... | SumoLogic/shellbase | shellbase-core/src/test/scala/com/sumologic/shellbase/ShellBannerTest.scala | Scala | apache-2.0 | 1,194 |
/* sbt -- Simple Build Tool
* Copyright 2009, 2010 Mark Harrah
*/
package sbt
package classfile
import scala.collection.mutable
import mutable.{ ArrayBuffer, Buffer }
import scala.annotation.tailrec
import java.io.File
import java.lang.annotation.Annotation
import java.lang.reflect.Method
import java.lang.reflect.M... | xeno-by/old-scalameta-sbt | util/classfile/src/main/scala/sbt/classfile/Analyze.scala | Scala | bsd-3-clause | 6,435 |
package de.juergens.time
import java.time.LocalDate
import java.time.temporal.Temporal
import org.junit.Assert._
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
/**
* Created by juergens on 14.08.15.
*/
@RunWith(classOf[JUnit4])
class BusinessDayTest {
@Test(timeout = 2000)
... | hjuergens/date-parser | date-rule-combinators/src/test/scala/de/juergens/time/BusinessDayTest.scala | Scala | apache-2.0 | 1,556 |
package com.gilt.thehand.rules.typed
import com.gilt.thehand.{AbstractContext, Context, Rule, AbstractRuleSpec}
class StringLteSpec extends AbstractRuleSpec {
val testCases: Map[Rule, (Set[AbstractContext], Set[AbstractContext])] = Map(
StringLte("1") -> (
Set(Context(1), Context(0), Context(0.001)),
... | gilt/the-hand | src/test/scala/com/gilt/thehand/rules/typed/StringLteSpec.scala | Scala | apache-2.0 | 690 |
package vaadin.scala
import vaadin.scala.mixins.PasswordFieldMixin
package mixins {
trait PasswordFieldMixin extends AbstractTextFieldMixin
}
class PasswordField(override val p: com.vaadin.ui.PasswordField with PasswordFieldMixin = new com.vaadin.ui.PasswordField with PasswordFieldMixin) extends AbstractTextField(... | CloudInABox/scalavaadinutils | src/main/scala/vaadin/scala/PasswordField.scala | Scala | mit | 322 |
/**
* 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"); yo... | noslowerdna/kafka | core/src/main/scala/kafka/server/ReplicationQuotaManager.scala | Scala | apache-2.0 | 6,668 |
package jp.co.dwango.s99
import Util.flatMap
import Util.copyN
object P12 {
def decode[T](encoded: List[(Int, T)]): List[T] = {
flatMap(encoded) { case (n, e) => copyN(e, n) }
}
}
| dwango/S99 | src/main/scala/jp/co/dwango/s99/P12.scala | Scala | mit | 190 |
/*
* Copyright 2013 Steve Vickers
*
* 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 i... | osxhacker/ReactiveMongo-Criteria | src/main/scala/dsl/criteria/Expression.scala | Scala | apache-2.0 | 5,288 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | jahhulbert-ccri/geomesa | geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/index/z2/XZ2Index.scala | Scala | apache-2.0 | 1,355 |
package mesosphere.marathon
package api.akkahttp.v2
import akka.NotUsed
import akka.actor.Actor.Receive
import akka.actor.ActorSystem
import akka.event.EventStream
import akka.http.scaladsl.model.RemoteAddress
import akka.http.scaladsl.server.Route
import akka.stream._
import akka.stream.scaladsl.Source
import akka.st... | Caerostris/marathon | src/main/scala/mesosphere/marathon/api/akkahttp/v2/EventsController.scala | Scala | apache-2.0 | 5,598 |
package com.gilt.gfc.util
import java.util.UUID
import java.util.concurrent.atomic.AtomicInteger
import org.scalatest.{Matchers, FunSuite}
class SingletonCacheTest extends FunSuite with Matchers {
test("SingletonCache") {
def makeCounters = new scala.collection.mutable.HashMap[String, AtomicInteger]() {
o... | gheine/gfc-util | src/test/scala/com/gilt/gfc/util/SingletonCacheTest.scala | Scala | apache-2.0 | 2,033 |
/*
* 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 ... | ueshin/asakusafw-spark | extensions/iterativebatch/runtime/core/src/test/scala/com/asakusafw/spark/extensions/iterativebatch/runtime/graph/DirectOutputPrepareForIterativeSpec.scala | Scala | apache-2.0 | 26,508 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | wzhongyuan/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/BilinearSpec.scala | Scala | apache-2.0 | 2,301 |
package com.criteo.dev.cluster.copy
import com.criteo.dev.cluster.Node
import com.criteo.dev.cluster.config.GlobalConfig
import org.slf4j.LoggerFactory
import scala.collection.parallel.ForkJoinTaskSupport
import scala.concurrent.forkjoin.ForkJoinPool
/**
* Gets the metadata from Hive.
*
* TODO- rewrite this us... | criteo/berilia | src/main/scala/com/criteo/dev/cluster/copy/GetMetadataAction.scala | Scala | apache-2.0 | 2,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 may ... | rezasafi/spark | core/src/test/scala/org/apache/spark/ShuffleSuite.scala | Scala | apache-2.0 | 20,518 |
package uppsat.approximation.refinement
import uppsat.ModelEvaluator
import uppsat.ModelEvaluator.Model
import uppsat.ast.AST
import uppsat.approximation._
import uppsat.approximation.toolbox.Toolbox
import uppsat.globalOptions._
import uppsat.precision._
/** Refinement done in a post-order way by specifying a node-b... | uuverifiers/uppsat | src/main/scala/uppsat/approximation/refinement/PostOrderRefinement.scala | Scala | gpl-3.0 | 1,441 |
package net.ettinsmoor.zipped
import java.io.InputStream
import java.util.zip.ZipFile
private sealed abstract class NextIs
private case class NextIsChar(c: Char) extends NextIs
private case class NextIsString(s: String) extends NextIs
private case class NextIsNewline() extends NextIs
private case class NextIsEOF() ex... | dbarowy/ZippedTextFileIterator | src/main/scala/net/ettinsmoor/zipped/ZippedTextFileIterator.scala | Scala | mit | 2,627 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/ImprovedMartialArts.scala | Scala | apache-2.0 | 1,656 |
package com.github.mdr.mash.ns.core
import com.github.mdr.mash.classes.MashClass
object NoArgClass extends MashClass("core.NoArg") {
override def summaryOpt = Some("Value that represents no argument being provided, for use as sentinel values in default arguments")
}
| mdr/mash | src/main/scala/com/github/mdr/mash/ns/core/NoArgClass.scala | Scala | mit | 273 |
package im.mange.common
import collection.mutable.ListBuffer
import scala.Predef._
case class ShutdownFunction(message: String, function: () => Unit)
object OnShutdown {
private val shutdownFunctions = new ListBuffer[ShutdownFunction]
def execute(message: String, function: () => Unit) {
shutdownFunctions.... | alltonp/driveby | src/main/scala/im/mange/common/OnShutdown.scala | Scala | apache-2.0 | 880 |
package com.yannick_cw.elastic_indexer4s
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Sink, Source}
import com.yannick_cw.elastic_indexer4s.Index_results.{IndexError, StageSuccess}
import com.yannick_cw.elastic_indexer4s.indexing_logic.FullStream
import com.yannick_cw... | yannick-cw/elastic-indexer4s | src/test/scala/com/yannick_cw/elastic_indexer4s/FullStreamSpec.scala | Scala | mit | 1,377 |
package com.gilt.gfc.concurrent
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.{AtomicReference, AtomicInteger}
import scala.annotation.tailrec
import scala.collection.generic.CanBuildFrom
import scala.concurrent.duration._
import scala.concurrent.{Future, ExecutionContext, Promise}
import sca... | gilt/gfc-concurrent | src/main/scala/com/gilt/gfc/concurrent/ScalaFutures.scala | Scala | apache-2.0 | 10,110 |
/*
* BreedingImpl.scala
* (Muta)
*
* Copyright (c) 2013-2014 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Lesser General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.muta
package impl
... | Sciss/Muta | src/main/scala/de/sciss/muta/impl/BreedingImpl.scala | Scala | lgpl-3.0 | 1,399 |
package com.twitter.finatra.http.internal.marshalling
import com.twitter.finagle.http.Request
import com.twitter.finatra.http.fileupload.FileUploadException
import java.io.InputStream
import org.apache.commons.fileupload.RequestContext
import org.jboss.netty.buffer.ChannelBufferInputStream
class FinatraRequestContext... | tom-chan/finatra | http/src/main/scala/com/twitter/finatra/http/internal/marshalling/FinatraRequestContext.scala | Scala | apache-2.0 | 909 |
/*
* Copyright 2016-2018 SN127.fi
*
* 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... | jaa127/tackler | cli/src/test/scala/fi/sn127/tackler/cli/TacklerCliTest.scala | Scala | apache-2.0 | 6,773 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/enhancement/enhancements/CurativeAdmixtureCureSeriousWounds.scala | Scala | apache-2.0 | 2,022 |
/*
* 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/src/test/scala/org/apache/flink/table/api/stream/sql/SetOperatorsTest.scala | Scala | apache-2.0 | 7,139 |
package chandu0101.scalajs.react.components.demo.routes
import chandu0101.scalajs.react.components.demo.components.reactlistview.{ReactListViewDemo, ReactListViewInfo}
import chandu0101.scalajs.react.components.demo.components.reacttagsinput.{ReactTagsInputDemo, ReactTagsInputInfo}
import chandu0101.scalajs.react.comp... | coreyauger/scalajs-react-components | demo/src/main/scala/chandu0101/scalajs/react/components/demo/routes/ReactTagsInputRouteModule.scala | Scala | apache-2.0 | 882 |
package io.skysail.server.app.events
import akka.actor.ActorSystem
import akka.http.scaladsl.server.PathMatcher
import akka.http.scaladsl.server.PathMatchers._
import io.skysail.domain.routes.RouteMapping
import io.skysail.server.RoutesCreatorTrait
import io.skysail.server.app.{ApplicationProvider, BackendApplication}... | evandor/skysail-server | skysail.server.app.events/src/io/skysail/server/app/events/EventApplication.scala | Scala | apache-2.0 | 910 |
class Foo[@specialized T] {
var v: T = _
def foo(x: T): T = x
println("abc")
class Bar[@specialized U] {
def bar(x: U): T = v
// def barInt(x: Int): T = bar(x.asInstanceOf[U])
}
}
class Test {
def test {
val a = new Foo[Int]
val b = new a.Bar[Int]
a.foo(10)
b.bar(11)
}
}
/*
abs... | loskutov/intellij-scala | testdata/scalacTests/pos/spec-simple.scala | Scala | apache-2.0 | 927 |
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.