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 |
|---|---|---|---|---|---|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/batch/sql/agg/HashAggITCase.scala | Scala | apache-2.0 | 1,241 |
def msum[T](list: T*)(implicit m: Monoid[T]): T =
list.foldLeft(m.mzero)(m.madd)
| lkuczera/scalatypeclasses | steps/Monoidmsum.scala | Scala | mit | 84 |
// Classes: Constructors
// Constructors aren’t special methods, they are
// the code outside of method definitions.
class Calculator(val brand: String) {
// Code executed on instance construction
val color: String = if (brand == "TI") {
"blue"
} else if (brand == "HP") {
"black"
} else {
"w... | agconti/scala-school | 01-intro-to-scala/slides/slide022.scala | Scala | mit | 375 |
/**
* Copyright 2011-2017 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | MykolaB/gatling | gatling-http/src/main/scala/io/gatling/http/fetch/EmbeddedResource.scala | Scala | apache-2.0 | 2,019 |
package com.cerner.beadledom.lifecycle
import com.google.inject.{AbstractModule, Inject, Module}
import java.util.Collections
import javax.annotation.{PostConstruct, PreDestroy}
import org.scalatest.mockito.MockitoSugar
import org.scalatest.{FunSpec, MustMatchers}
import scala.collection.JavaConverters._
/**
* Unit... | bbaugher/beadledom | lifecycle/src/test/scala/com/cerner/beadledom/lifecycle/GuiceLifecycleContainersSpec.scala | Scala | apache-2.0 | 4,013 |
/*
* Copyright 2015 PayPal
*
* 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 ... | keshin/squbs | squbs-httpclient/src/test/scala/org/squbs/httpclient/dummy/DummyService.scala | Scala | apache-2.0 | 11,052 |
package com.shorrockin.cascal.serialization
import java.nio.ByteBuffer
import java.util.{Date, UUID}
object TupleSerializer {
def extractType[T](bytes: ByteBuffer, mf: Manifest[T]): T = {
val length = (bytes.get() & 0xFF) << 8 | (bytes.get() & 0xFF)
val typeBuffer = bytes.duplicate
typeBuffer.limit(typ... | Shimi/cascal | src/main/scala/com/shorrockin/cascal/serialization/TupleSerializer.scala | Scala | apache-2.0 | 4,140 |
package chap5
object Exe14 extends App {
assert(Stream.from(1).startsWith(Stream(1, 2)))
assert(!Stream.from(1).startsWith(Stream(1, 2, 4)))
}
| ponkotuy/FPScala | src/main/scala/chap5/Exe14.scala | Scala | unlicense | 148 |
package part3
trait 火 extends NumR {
def tail: NumR
override def methodL(num: NumL): Result = ResultP(tail.methodL(num))
}
object 火 {
def apply(tail1: => NumR): NumR = new 火 {
override def tail: NumR = tail1
}
}
| djx314/ubw | a50-指对2/src/main/scala/part3/火.scala | Scala | bsd-3-clause | 231 |
package championships
import eu.ace_design.island.arena.Run
import eu.ace_design.island.game.{Directions, Plane}
import eu.ace_design.island.map.IslandMap
import eu.ace_design.island.stdlib.Resources._
import library.Islands
import library.SI3
object Week09 extends Run with SI3 {
override val number: String = "09"... | mosser/QGL-15-16 | arena/src/main/scala/championships/Week09.scala | Scala | lgpl-3.0 | 691 |
package org.scalaide.debug.internal.launching
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import scala.io.Codec
import scala.io.Source
import scala.util.control.Exception.allCatch
import org.eclipse.core.resources.IFile
import org.eclipse.core.resources.IProject
import org.eclipse... | Kwestor/scala-ide | org.scala-ide.sdt.debug.tests/src/org/scalaide/debug/internal/launching/LaunchUtils.scala | Scala | bsd-3-clause | 3,884 |
package rx.lang.scala.completeness
import java.util.Calendar
/**
* Generate comparison tables for Scala classes and Java classes. Run `sbt 'test:run rx.lang.scala.completeness.CompletenessTest'` to generate them.
*/
object CompletenessTables {
/**
* CompletenessKits to generate completeness tables.
*/
va... | ReactiveX/RxScala | src/test/scala-2.11/rx/lang/scala/completeness/CompletenessTables.scala | Scala | apache-2.0 | 3,344 |
package mesosphere.marathon.core.task
import mesosphere.marathon.core.task.Task.Id
import mesosphere.marathon.core.task.bus.MarathonTaskStatus
import mesosphere.marathon.state.Timestamp
sealed trait TaskStateOp {
def taskId: Task.Id
/**
* The possible task state if processing the state op succeeds. If process... | vivekjuneja/marathon | src/main/scala/mesosphere/marathon/core/task/TaskStateOp.scala | Scala | apache-2.0 | 2,227 |
/**
* 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... | usakey/kafka | core/src/main/scala/kafka/network/SocketServer.scala | Scala | apache-2.0 | 21,242 |
package com.arcusys.learn.liferay.util
import com.arcusys.learn.liferay.LiferayClasses._
import com.arcusys.learn.liferay.services.ServiceContextHelper
import com.liferay.portal.kernel.notifications.UserNotificationManagerUtil
import com.liferay.portal.model.{MembershipRequestConstants, UserNotificationDeliveryConstan... | arcusys/Valamis | learn-liferay620-services/src/main/scala/com/arcusys/learn/liferay/util/UserNotificationEventLocalServiceHelper.scala | Scala | gpl-3.0 | 1,677 |
package io.github.shogowada.scalajs.reactjs.example.todoappredux
import io.github.shogowada.scalajs.reactjs.ReactDOM
import io.github.shogowada.scalajs.reactjs.VirtualDOM._
import io.github.shogowada.scalajs.reactjs.redux.ReactRedux._
import io.github.shogowada.scalajs.reactjs.redux.Redux
import org.scalajs.dom
impor... | shogowada/scalajs-reactjs | example/todo-app-redux/src/main/scala/io/github/shogowada/scalajs/reactjs/example/todoappredux/Main.scala | Scala | mit | 986 |
import scala.annotation.StaticAnnotation
import scala.meta._
class companion extends StaticAnnotation {
inline def apply(stats: Any): Any = meta {
def extractClass(classDefn: Defn.Class): Stat = {
val q"""
..$mods class $tname[..$tparams] ..$ctorMods (...$paramss) extends { ..$earlyStats } with ..... | xeno-by/paradise | tests/meta/src/main/scala/companion.scala | Scala | bsd-3-clause | 1,237 |
package com.twitter.finagle.netty4.http
import com.twitter.finagle.http.AbstractMultipartDecoderTest
class Netty4MultipartDecoderTest extends AbstractMultipartDecoderTest(new Netty4MultipartDecoder)
| mkhq/finagle | finagle-netty4-http/src/test/scala/com/twitter/finagle/netty4/http/Netty4MultipartDecoderTest.scala | Scala | apache-2.0 | 201 |
/*
* 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... | ericchang/incubator-toree | kernel/src/test/scala/org/apache/toree/kernel/protocol/v5/handler/GenericSocketMessageHandlerSpec.scala | Scala | apache-2.0 | 2,385 |
package net.fwbrasil.activate.util
import net.fwbrasil.scala._
object CollectionUtil {
def combine[T](lists: Seq[Seq[T]]) =
(if (lists.nonEmpty)
((lists.map(_.map(Seq(_))))
.reduceLeft((xs, ys) => for { x <- xs; y <- ys } yield x ++ y).toList)
else List(List[T]()... | xdevelsistemas/activate | activate-core/src/main/scala/net/fwbrasil/activate/util/CollectionUtil.scala | Scala | lgpl-2.1 | 6,977 |
/*
* Copyright 2012 Pellucid and Zenexity
*
* 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... | Enalmada/datomisca | integration/src/it/scala/datomisca/AggregatesSpec.scala | Scala | apache-2.0 | 3,789 |
/*
* 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/gmp-frontend | app/controllers/BulkReferenceController.scala | Scala | apache-2.0 | 2,809 |
package net.aicomp.terraforming.scene
import net.aicomp.terraforming.entity.GameEnvironment
import net.aicomp.terraforming.util.settings.Defaults
import net.exkazuu.gameaiarena.gui.DefaultScene
abstract class AbstractScene extends DefaultScene[GameEnvironment] {
def env = getEnvironment
def renderer = env.getRend... | AI-comp/Terraforming | src/main/scala/net/aicomp/terraforming/scene/AbstractScene.scala | Scala | apache-2.0 | 781 |
package tv.camfire.jetty.server.session
import org.eclipse.jetty.server.session.AbstractSessionIdManager
import javax.servlet.http.{HttpSession, HttpServletRequest}
/**
* User: jonathan
* Date: 6/5/13
* Time: 4:30 PM
*/
class RedisRailsSessionIdManager()
extends AbstractSessionIdManager {
def getClusterId(no... | jgrowl/jetty-session-redis-json-readonly | src/main/scala/tv/camfire/jetty/server/session/RedisRailsSessionIdManager.scala | Scala | mit | 1,435 |
package tv.camfire.media_server.config
import tv.camfire.media_server.controllers.SignalController
import tv.camfire.media_server.listener.SessionListener
/**
* User: jonathan
* Date: 7/22/13
* Time: 7:01 PM
*/
trait ServletModule extends LogicModule {
lazy val signalController: SignalController = wire[SignalCo... | jgrowl/camfire-signaling | signaling-server/src/main/scala/tv/camfire/media_server/config/ServletModule.scala | Scala | mit | 400 |
package mapmartadero
package config
import net.liftweb._
import common._
import http._
import json._
import util.Props
import net.liftweb.squerylrecord.RecordTypeMode
import RecordTypeMode._
import java.sql.DriverManager
import org.squeryl.{Schema, Table}
import model._
import org.squeryl.adapters.MySQLInnoDBAdapter
... | jgenso/mapamartadero | src/main/scala/mapmartadero/config/SquerylConfig.scala | Scala | apache-2.0 | 1,274 |
/*
* 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/amls-frontend | test/models/notifications/NotificationRowSpec.scala | Scala | apache-2.0 | 8,139 |
package io.vamp.model.artifact
import io.vamp.common.{ Artifact, Reference }
import io.vamp.model.reader.{ MegaByte, Quantity }
object Blueprint {
val kind: String = "blueprints"
}
abstract class Blueprint extends Artifact {
val kind: String = Blueprint.kind
}
trait AbstractBlueprint extends Blueprint {
def n... | magneticio/vamp | model/src/main/scala/io/vamp/model/artifact/Blueprint.scala | Scala | apache-2.0 | 3,636 |
package repository
import domain.util.crypto.Aes
import repository.model.scalatrader.{User}
import scalikejdbc.AutoSession
import scalikejdbc._
object UserRepository {
def get(email: String, secret: String): Option[User] = {
implicit val session = AutoSession
sql"select * from user where email = ${email}".... | rysh/scalatrader | scalatrader/app/repository/UserRepository.scala | Scala | mit | 1,084 |
/*
* 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... | jenniew/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/example/languagemodel/PTBWordLM.scala | Scala | apache-2.0 | 4,256 |
package io.udash.web.guide.styles.partials
import io.udash.css.{CssBase, CssStyle}
import io.udash.web.commons.styles.GlobalStyles
import io.udash.web.commons.styles.attributes.Attributes
import io.udash.web.commons.styles.components.CodeBlockStyles
import io.udash.web.commons.styles.utils.{FontWeight, StyleConstants,... | UdashFramework/udash-core | guide/shared/src/main/scala/io/udash/web/guide/styles/partials/GuideStyles.scala | Scala | apache-2.0 | 7,429 |
package se.lu.nateko.cp.meta.upload
import java.net.URI
import scala.concurrent.Future
import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue
import scala.scalajs.js.URIUtils.encodeURIComponent
import org.scalajs.dom.File
import org.scalajs.dom.ext.Ajax
import org.scalajs.dom.ext.AjaxException
import org.... | ICOS-Carbon-Portal/meta | uploadgui/src/main/scala/se/lu/nateko/cp/meta/upload/Backend.scala | Scala | gpl-3.0 | 6,692 |
/*
* 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 ... | shuangshuangwang/spark | resource-managers/kubernetes/core/src/test/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsPollingSnapshotSourceSuite.scala | Scala | apache-2.0 | 3,302 |
package com.enkidu.lignum.parsers.java.v8
import com.enkidu.lignum.parsers.ast.expression.Expression
import com.enkidu.lignum.parsers.ast.expression.discardable.dimension.Dimension
import com.enkidu.lignum.parsers.ast.statement.declarator._
import org.parboiled2._
abstract class JavaDeclaratorParser extends JavaParam... | marek1840/java-parser | src/main/scala/com/enkidu/lignum/parsers/java/v8/JavaDeclaratorParser.scala | Scala | mit | 1,320 |
/*******************************************************************************
Copyright (c) 2013, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
*********************************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/analysis/typing/models/Tizen/TIZENdownload.scala | Scala | bsd-3-clause | 21,213 |
package adts
object t1:
enum Option[+T]:
case Some(x: T)
case None
object t2:
enum Option[+T]:
case Some(x: T) extends Option[T]
case None extends Option[Nothing]
enum Color(val rgb: Int):
case Red extends Color(0xFF0000)
case Green extends Color(0x00FF00)
case Blue extends Color(... | som-snytt/dotty | tests/pos/reference/adts.scala | Scala | apache-2.0 | 645 |
/**
* Copyright (C) 2009-2011 the original author or authors.
* See the notice.md file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | dnatic09/scalate | archetypes/scalate-archetype-guice/src/main/resources/archetype-resources/project/build/Project.scala | Scala | apache-2.0 | 1,570 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.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... | alexandru/monifu | monix-tail/shared/src/test/scala/monix/tail/IterantMapEvalSuite.scala | Scala | apache-2.0 | 11,893 |
/*
* Copyright 2015 Nicolas Rinaudo
*
* 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... | nrinaudo/scala-csv | cats/shared/src/main/scala/kantan/csv/cats/package.scala | Scala | mit | 2,260 |
package com.kleggett.db
/**
* @author K. Leggett
* @since 1.0 (2/28/15 3:05 PM)
*/
case class Book(title: String, author: String, published: Option[Int])
| kleggett/scalasqlutils | src/test/scala/com/kleggett/db/Book.scala | Scala | cc0-1.0 | 158 |
/*
* Copyright 2020 Spotify AB.
*
* 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 ... | regadas/scio | scio-core/src/main/scala/com/spotify/scio/util/ProtobufUtil.scala | Scala | apache-2.0 | 2,291 |
package pw.ian.sysadmincraft.world
import java.util.UUID
import org.bukkit.World
import pw.ian.sysadmincraft.system.{SysProcess, ProcessAdmin}
import pw.ian.sysadmincraft.SysAdmincraft
import pw.ian.sysadmincraft.world.WorldConstants._
case class PillarManager(plugin: SysAdmincraft, world: World) {
// process.na... | simplyianm/sysadmincraft | src/main/scala/pw/ian/sysadmincraft/world/PillarManager.scala | Scala | isc | 2,938 |
package com.regblanc.sgl.test
package core
import sgl._
import sgl.util._
trait AbstractApp extends MainScreenComponent {
this: GameApp with InputHelpersComponent with SchedulerProvider =>
override def startingScreen: GameScreen = LoadingScreen
}
| regb/scala-game-library | examples/hello/core/src/main/scala/App.scala | Scala | mit | 255 |
package akka.cluster.pubsub
import akka.actor.ActorRef
/**
* User: zhuyuqing
* Date: 2017/7/13
* Time: 15:43
*/
abstract class AbstractDistributedPubSubMediator(settings:DistributedPubSubSettings) extends DistributedPubSubMediator(settings) {
override def preStart(): Unit = super.preStart()
override... | qqbbyq/controller | opendaylight/md-sal/sal-distributed-datastore/src/main/java/akka/cluster/pubsub/AbstractDistributedPubSubMediator.scala | Scala | epl-1.0 | 508 |
package com.sksamuel.scapegoat.inspections.math
import com.sksamuel.scapegoat.{ Levels, Inspector, InspectionContext, Inspection }
/** @author Stephen Samuel */
class ZeroNumerator extends Inspection {
def inspector(context: InspectionContext): Inspector = new Inspector(context) {
override def postTyperTraverse... | pwwpche/scalac-scapegoat-plugin | src/main/scala/com/sksamuel/scapegoat/inspections/math/ZeroNumerator.scala | Scala | apache-2.0 | 831 |
import sbt._
import Keys._
object FPInScalaBuild extends Build {
val opts = Project.defaultSettings ++ Seq(
scalaVersion := "2.10.3",
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
libraryDependencies ++= Seq(
"org.specs2" %% "specs2" % "2.4.2" % "test"
),
... | coughlac/fpinscala | project/Build.scala | Scala | mit | 1,431 |
import KVStore.KVStoreState
import cats.Monad
import diesel._
@diesel
trait Maths[F[_]] {
def int(i: Int): F[Int]
def add(x: F[Int], y: F[Int]): F[Int]
}
@SuppressWarnings(Array("org.wartremover.warts.Any"))
object Maths {
implicit object KVSStateInterpreter extends Maths[KVStoreState] {
def int(i: Int) = ... | lloydmeta/diesel | examples/src/main/scala/Maths.scala | Scala | mit | 475 |
/**
* 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... | dchenbecker/kafka-sbt | core/src/test/scala/other/kafka/TestZKConsumerOffsets.scala | Scala | apache-2.0 | 2,482 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | derekmorr/squants | shared/src/main/scala/squants/motion/Jerk.scala | Scala | apache-2.0 | 2,468 |
package fr.acinq.eclair.wire
import fr.acinq.bitcoin.ByteVector32
import fr.acinq.eclair.UInt64
import fr.acinq.eclair.wire.CommonCodecs._
import scodec.Codec
import scodec.codecs.{discriminated, list, variableSizeBytesLong}
/** Tlv types used inside Init messages. */
sealed trait InitTlv extends Tlv
object InitTlv... | btcontract/wallet | app/src/main/java/fr/acinq/eclair/wire/InitTlv.scala | Scala | apache-2.0 | 742 |
package teststate
import teststate.Exports.{testStateAssertionSettings => _, _}
import teststate.TestUtil._
import teststate.core.Around
import teststate.data._
import utest._
object DslTest extends TestSuite {
val dsl = Dsl[Unit, Unit, Unit]
// def extract1[A, B](s: Sack[A, B]): B =
// s match {
// ca... | japgolly/test-state | core/shared/src/test/scala/teststate/DslTest.scala | Scala | apache-2.0 | 2,348 |
object Test {
def main(args: Array[String]): Unit = {
println("Guillaume is number 1")
System.out.println("ducksarethebest.com")
System.err.println("foolsRus.com")
}
}
| som-snytt/dotty | tests/vulpix-tests/unit/i2147.scala | Scala | apache-2.0 | 184 |
package com.twitter.zipkin.tracegen
/*
* 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... | ajantis/zipkin | zipkin-test/src/main/scala/com/twitter/zipkin/tracegen/TraceGen.scala | Scala | apache-2.0 | 4,468 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | swhgoon/scala-js | test/src/test/scala/scala/scalajs/test/javalib/ReferenceTest.scala | Scala | bsd-3-clause | 1,119 |
package org.life
object Main {
def main( args: Array[ String ] ) = {
println( "Hello, world!" )
}
}
object ConwaysGameOfLifeRunner extends App {
def allPositions( height: Int, width: Int ): Positions = Positions( ( ) => {
for {x <- 0 until height; y <- 0 until width} yield (x, y)
} )
... | squid314/scala-game-of-life | src/main/scala/org/life/Main.scala | Scala | gpl-3.0 | 2,492 |
package com.faacets.qalg
package algos
import scala.{specialized => sp}
import spire.algebra._
import algebra._
trait PackRingMutable[@sp(Double, Long) A] extends Any with PackRing[A] {
implicit def MM: MatMut[M, A]
implicit def VM: VecMut[V, A]
implicit def MShift: MutableMatShift[M]
implicit def VShift: ... | denisrosset/qalg | core/src/main/scala/qalg/algos/PackRingMutable.scala | Scala | mit | 555 |
/*
* 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 ... | style95/openwhisk | tests/src/test/scala/org/apache/openwhisk/core/database/LimitsCommandTests.scala | Scala | apache-2.0 | 4,846 |
/*
* 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 | external/kafka-0-10/src/test/scala/org/apache/spark/streaming/kafka010/mocks/MockTime.scala | Scala | apache-2.0 | 1,979 |
package net.cucumbersome
import akka.http.scaladsl.testkit.ScalatestRouteTest
import com.danielasfregola.randomdatagenerator.RandomDataGenerator
import net.cucumbersome.rpgRoller.warhammer.player.CombatActorJsonFormats
class RouteSpec extends UnitSpec with ScalatestRouteTest with RandomDataGenerator with CombatActorJ... | CucumisSativus/rpgRollerBackend | src/test/scala/net/cucumbersome/RouteSpec.scala | Scala | mit | 331 |
/*
* Copyright 2006-2010 WorldWide Conferencing, LLC
*
* 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 applica... | jeppenejsum/liftweb | framework/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/MappedDateTime.scala | Scala | apache-2.0 | 4,468 |
package org.jetbrains.plugins.scala
package annotator
package template
/**
* Pavel Fatin
*/
class UndefinedMemberTest extends AnnotatorTestBase(UndefinedMember) {
def testValidHolders(): Unit = {
assertNothing(messages("class C { def f }"))
assertNothing(messages("trait T { def f }"))
}
def testHolde... | jastice/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/annotator/template/UndefinedMemberTest.scala | Scala | apache-2.0 | 1,485 |
package core.api.modules
import akka.actor.ActorRef
import com.ning.http.client.AsyncHttpClientConfig
import io.surfkit.core.api.AbstractSystem
import io.surfkit.core.rabbitmq.RabbitDispatcher
import io.surfkit.core.rabbitmq.RabbitDispatcher.RabbitMqAddress
import play.api.libs.json._
import io.surfkit.model.Api._
im... | coreyauger/surfkit | core/src/main/scala/core/api/modules/SurfKitModule.scala | Scala | mit | 1,575 |
package object docs {
import java.io.File
import doodle.image.Image
import doodle.effect.Writer._
import doodle.java2d._
implicit class ImageSaveSyntax(image: Image) {
import doodle.image.syntax._
def save(filename: String): Unit = {
val dir = new File("docs/src/main/mdoc/")
val file = ne... | underscoreio/doodle | docs/src/main/scala/package.scala | Scala | apache-2.0 | 643 |
package contege.seqgen
import scala.collection.JavaConversions._
import scala.collection.mutable.Set
import scala.collection.mutable.Map
import java.util.ArrayList
import contege.ClassReader
import contege.Random
import contege.Atom
import contege.ConstructorAtom
import contege.MethodAtom
import contege.Util
import co... | michaelpradel/ConTeGe | src/contege/seqgen/TypeManager.scala | Scala | gpl-2.0 | 5,226 |
/*
* Copyright 2012 The SIRIS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | simulator-x/core | src/simx/core/worldinterface/WorldInterfaceActor.scala | Scala | apache-2.0 | 8,422 |
package mesosphere.marathon.api
import java.net.URI
import javax.servlet.http.{ HttpServletRequest, HttpServletResponse }
import javax.ws.rs.core.Response.Status
import javax.ws.rs.core.{ NewCookie, Response }
import mesosphere.marathon.plugin.auth._
import mesosphere.marathon.plugin.http.{ HttpRequest, HttpResponse ... | Kosta-Github/marathon | src/main/scala/mesosphere/marathon/api/AuthResource.scala | Scala | apache-2.0 | 3,832 |
package com.box.castle.router.mock
import com.box.castle.metrics.MetricsLogger
import scala.collection.mutable
import scala.concurrent.Promise
class MockMetricsLogger extends MetricsLogger {
val counts = mutable.HashMap[String, Long]()
var getCountPromises = mutable.HashMap("committer_fatal" -> Promise[Long])
... | Box-Castle/router | src/main/scala/com/box/castle/router/mock/MockMetricsLogger.scala | Scala | apache-2.0 | 1,028 |
package com.github.agourlay.cornichon.steps.regular
import cats.instances.future._
import cats.instances.either._
import cats.data.{ EitherT, NonEmptyList }
import cats.syntax.either._
import com.github.agourlay.cornichon.core._
import com.github.agourlay.cornichon.core.Engine._
import com.github.agourlay.cornichon.st... | OlegIlyenko/cornichon | cornichon-core/src/main/scala/com/github/agourlay/cornichon/steps/regular/EffectStep.scala | Scala | apache-2.0 | 3,281 |
package controllers
import io.flow.common.v0.models.User
import io.flow.splashpage.v0.{Authorization, Client}
import io.flow.splashpage.v0.errors.{GenericErrorResponse, UnitResponse}
import io.flow.splashpage.v0.models.{Geo, GeoForm, Publication, Subscription, SubscriptionForm}
import java.util.UUID
import scala.util.... | flowcommerce/splashpage | api/test/controllers/SubscriptionsSpec.scala | Scala | mit | 4,992 |
package advent
//package test
import swing._
import event._
import java.util.Date
import java.awt.Color
import java.text.SimpleDateFormat
import javax.swing.{Icon, ImageIcon}
/**
* Demonstrates how to use combo boxes and custom item renderers.
*
* TODO: clean up layout
*/
object ComboBoxes extends SimpleSwingApp... | gregwk/clay-pot | Adventure/src/advent/ComboBoxes.scala | Scala | mit | 3,053 |
package debop4s.core.cryptography
import debop4s.core.AbstractCoreFunSuite
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.ApplicationContext
import org.springframework.test.context.support.AnnotationConfigContextLoader
import org.springframework.test.context.{ContextCo... | debop/debop4s | debop4s-core/src/test/scala/debop4s/core/cryptography/StringDigesterFunSuite.scala | Scala | apache-2.0 | 1,728 |
package andriusdap.orbweaver.controllers
import andriusdap.orbweaver.core.Classifier
import com.google.inject.Singleton
import play.api.mvc._
import scala.language.postfixOps
@Singleton
class ClassifierController {
def classify(source: String) = Action {
request =>
Results.Ok(Classifier.classify(source))... | AndriusDap/orb-weaver | docs/apps/src/main/scala/andriusdap/orbweaver/controllers/ClassifierController.scala | Scala | mit | 326 |
package logic
import akka.util.ByteString
import io.circe._
import io.circe.generic.JsonCodec
import io.circe.generic.auto._
import io.circe.generic.semiauto._
import io.circe.parser._
import io.circe.syntax._
import models.MetaServer
import play.api.http.HttpEntity
import play.api.mvc.{ResponseHeader, Result}
import ... | toidiu/toidiuFS | app/logic/FsMetaLogic.scala | Scala | mit | 1,257 |
/*
* Copyright 2017 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/api-gateway | app/uk/gov/hmrc/apigateway/connector/AbstractConnector.scala | Scala | apache-2.0 | 2,254 |
package foo
class Outside
package object bar {
class Val(b: Boolean)
implicit def boolean2Val(b: Boolean) = new Val(b)
implicit def boolean2Outside(b: Boolean) = new Outside
}
| scala/scala | test/files/pos/t3999/a_1.scala | Scala | apache-2.0 | 184 |
package com.bbva.mike
/**
* Created by joseluisillanaruiz on 3/3/16.
*/
object KafkaProducerProtocol {
import spray.json._
case class StructuredLog(messageValue: String)
case class Sender(topicName: String, messageValue: String)
case object SenderResponseOK
case object SenderResponseKO
case objec... | joseluisillana/rest-api-scala-akka-poc | src/main/scala/com/bbva/mike/KafkaProducerProtocol.scala | Scala | apache-2.0 | 958 |
package au.com.dius.pact.model
import au.com.dius.pact.consumer._
/**
* @deprecated Moved to Kotlin implementation: Use Pact interface instead
*/
@Deprecated
case class PactFragment(consumer: Consumer,
provider: Provider,
interactions: Seq[RequestResponseInteraction... | algra/pact-jvm | pact-jvm-consumer/src/main/scala/au/com/dius/pact/model/PactFragment.scala | Scala | apache-2.0 | 1,489 |
package koncept.http.web.sessions
import java.util.Date
import java.util.concurrent.ConcurrentHashMap
import com.sun.net.httpserver.HttpPrincipal
import java.util.HashSet
import scala.collection.JavaConversions._
import java.util.concurrent.TimeUnit
class Sessions {
val map: ConcurrentHashMap[String, Session] = ne... | nkrul/http-router | src/main/scala/koncept/http/web/sessions/Sessions.scala | Scala | mit | 1,992 |
package play.modules.gjson
import play.api.libs.json.JsValue
object JSON {
def toJSON[A](a: A)(implicit jp: JSONPickler[A]): JsValue = jp.pickle(a)
def fromJSON[A](v: JsValue)(implicit jp: JSONPickler[A]) = jp.unpickle(v)
}
| kindleit/gkit | play-gjson/src/main/scala/JSON.scala | Scala | apache-2.0 | 232 |
package com.betfair.domain
import play.api.libs.json.{Reads, Writes}
object OrderBy extends Enumeration {
type OrderBy = Value
val BY_MARKET, BY_MATCH_TIME, BY_PLACE_TIME, BY_SETTLED_TIME, BY_VOID_TIME = Value
implicit val enumReads: Reads[OrderBy] = EnumUtils.enumReads(OrderBy)
implicit def enumWrites: Wri... | city81/betfair-service-ng | src/main/scala/com/betfair/domain/OrderBy.scala | Scala | bsd-2-clause | 358 |
/*
* Copyright 2015 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | liquidarmour/play-health | app/uk/gov/hmrc/play/health/AdminController.scala | Scala | apache-2.0 | 1,404 |
/**
* This file is part of mycollab-scheduler.
*
* mycollab-scheduler 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.
*
* mycol... | maduhu/mycollab | mycollab-scheduler/src/main/scala/com/esofthead/mycollab/schedule/email/crm/service/LeadRelayEmailNotificationActionImpl.scala | Scala | agpl-3.0 | 8,224 |
/*
* 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... | jenniew/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/torch/VolumetricConvolutionSpec.scala | Scala | apache-2.0 | 15,445 |
/*
* 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 ... | trueyao/spark-lever | mllib/src/main/scala/org/apache/spark/mllib/regression/LabeledPoint.scala | Scala | apache-2.0 | 2,163 |
import org.scalatest._
import eu.unicredit.sophia._
import eu.unicredit.sophia.client._
import scala.annotation.tailrec
import scala.util.Random
class CursorSpec extends FlatSpec with SequentialNestedSuiteExecution {
val client = new SophiaClient()
client.start
client.setSophiaPath("./storage")
... | andreaTP/sophia-java | src/test/scala/CursorSpec.scala | Scala | apache-2.0 | 1,818 |
import com.typesafe.sbt.GitPlugin
import org.scalafmt.sbt.ScalaFmtPlugin
import sbt._
import sbt.plugins.JvmPlugin
import sbt.Keys._
object Build extends AutoPlugin {
override def requires = JvmPlugin && GitPlugin && ScalaFmtPlugin
override def trigger = allRequirements
override def projectSettings =
Scal... | ksilin/sargon | project/Build.scala | Scala | apache-2.0 | 1,088 |
package com.gilt.storeroom.dynamodb
import com.gilt.storeroom._
import scala.collection.JavaConverters._
import org.scalatest.time._
import play.api.libs.iteratee.Iteratee
import com.amazonaws.services.dynamodbv2.{ AmazonDynamoDBClient, AmazonDynamoDB }
import com.amazonaws.services.dynamodbv2.model._
class Dynamod... | gilt/storeroom | dynamodb/src/test/scala/com/gilt/storeroom/dynamodb/DynamoDbStoreTest.scala | Scala | mit | 2,518 |
/**
* Copyright 2017 RiskSense, Inc.
* This file is part of ipaddr library.
*
* Ipaddr is free software 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.apac... | risksense/ipaddr | src/test/scala/com/risksense/ipaddr/IpRangeTest.scala | Scala | apache-2.0 | 3,571 |
package org.wartremover
package contrib.test
import org.scalatest.FunSuite
import org.wartremover.contrib.warts.OldTime
import org.wartremover.test.WartTestTraverser
class OldTimeTest extends FunSuite with ResultAssertions {
val javaError = "The old Java time API is disabled. Use Java 8 java.time._ API instead."
... | tim-zh/wartremover-contrib | core/src/test/scala/wartremover/contrib/warts/OldTimeTest.scala | Scala | apache-2.0 | 9,412 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js sbt plugin **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | jmnarloch/scala-js | js-envs/src/main/scala/org/scalajs/jsenv/rhino/package.scala | Scala | bsd-3-clause | 1,530 |
package org.scalatra
package swagger
// separate files so the dependencies stay clean
import org.scalatra.json.NativeJsonSupport
trait NativeSwaggerBase extends ScalatraBase with NativeJsonSupport with CorsSupport with SwaggerBase
| lightvector/scalatra | swagger/src/main/scala/org/scalatra/swagger/NativeSwaggerBase.scala | Scala | bsd-2-clause | 234 |
package com.arcusys.valamis.hook
import com.arcusys.valamis.hook.utils.{StructureInfo, TemplateInfo, Utils}
import com.liferay.portal.kernel.events.SimpleAction
import com.liferay.portal.kernel.log.LogFactoryUtil
import com.liferay.portal.service.{GroupLocalServiceUtil, UserLocalServiceUtil}
class UpgradeTemplates ex... | igor-borisov/valamis | valamis-hook/src/main/scala/com/arcusys/valamis/hook/UpgradeTemplates.scala | Scala | gpl-3.0 | 1,048 |
package org.littlewings.javaee7.cdi
import java.io.File
import org.apache.catalina.startup.Tomcat
import org.scalatest.Suite
import org.scalatest.BeforeAndAfterAll
trait EmbeddedTomcatCdiSupport extends Suite with BeforeAndAfterAll {
protected val port: Int = 8080
protected val tomcat: Tomcat = new Tomcat
pro... | kazuhira-r/javaee7-scala-examples | cdi-alternative/src/test/scala/org/littlewings/javaee7/cdi/EmbeddedTomcatCdiSupport.scala | Scala | mit | 1,461 |
package ch.ninecode.cim
import org.apache.spark.rdd.RDD
import org.apache.spark.rdd.RDD.rddToPairRDDFunctions
import org.apache.spark.sql.SparkSession
import org.apache.spark.storage.StorageLevel
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import ch.ninecode.model._
/**
* Handle duplicate processing.
*
... | derrickoswald/CIMScala | CIMReader/src/main/scala/ch/ninecode/cim/CIMDeDup.scala | Scala | mit | 3,805 |
package de.m7w3.signal.messages
import java.nio.file.Files
import java.util
import de.m7w3.signal.Logging
import de.m7w3.signal.events.{ContactsSyncedEvent, EventPublisher, GroupsSyncedEvent}
import de.m7w3.signal.store.SignalDesktopApplicationStore
import org.whispersystems.signalservice.api.SignalServiceMessageRecei... | ayoub-benali/signal-desktop-client | src/main/scala/de/m7w3/signal/messages/SignalDesktopMessageHandler.scala | Scala | apache-2.0 | 4,729 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/ShouldBeWritableLogicalAndExplicitSpec.scala | Scala | apache-2.0 | 11,304 |
/*
* 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 ... | caneGuy/spark | mllib/src/main/scala/org/apache/spark/ml/classification/NaiveBayes.scala | Scala | apache-2.0 | 15,011 |
package org.sbuild.plugins.scalac
import org.sbuild._
class ScalacPlugin(implicit project: Project) extends Plugin[Scalac] {
def create(name: String): Scalac = {
val compileTargetName = s"scalac-${name}"
val cleanTargetName = s"clean-scalac-${name}"
val classpath = TargetRefs()
val targetDir = Path... | SBuild-org/sbuild-scalac-plugin | org.sbuild.plugins.scalac/src/main/scala/org/sbuild/plugins/scalac/ScalacPlugin.scala | Scala | apache-2.0 | 2,613 |
package edu.gemini.pit.ui.robot
import edu.gemini.pit.model.Model
import edu.gemini.spModel.core.Coordinates
import scalaz.Lens
import edu.gemini.model.p1.visibility.TargetVisibilityCalc
import edu.gemini.model.p1.immutable._
object VisibilityRobot extends ObservationMetaRobot[(ProposalClass, BlueprintBase, Coordina... | arturog8m/ocs | bundle/edu.gemini.pit/src/main/scala/edu/gemini/pit/ui/robot/VisibilityRobot.scala | Scala | bsd-3-clause | 1,750 |
/*
* Copyright (c) 2013, Scodec
* 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
* list of conditions a... | scodec/scodec | unitTests/src/test/scala/scodec/EncoderTest.scala | Scala | bsd-3-clause | 1,861 |
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.