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 may ... | witgo/spark | core/src/main/scala/org/apache/spark/shuffle/sort/SortShuffleManager.scala | Scala | apache-2.0 | 11,781 |
package gitbucket.core.ssh
import org.apache.sshd.server.shell.UnknownCommand
import org.scalatest.funspec.AnyFunSpec
class GitCommandFactorySpec extends AnyFunSpec {
val factory = new GitCommandFactory("http://localhost:8080", None)
describe("createCommand") {
it("should return GitReceivePack when command ... | xuwei-k/gitbucket | src/test/scala/gitbucket/core/ssh/GitCommandSpec.scala | Scala | apache-2.0 | 2,226 |
package brique.bench.input
import org.openjdk.jmh.annotations.{Setup, Param, Scope, State}
import scala.{Array, Int, Unit}
@State(Scope.Thread)
class ArrayInput extends InputHelper {
@Param(Array("10", "100", "1000"))
var size: Int = _
var array: Array[Int] = _
@Setup
def setup(): Unit =
array = genAr... | julien-truffaut/brique | bench/src/main/scala/brique/bench/input/ArrayInput.scala | Scala | mit | 345 |
package examples.range
import rescala._
class Range1(protected var _start : Int, protected var _length : Int){
protected var _end = _start + _length // backs up end
// getters and setters, maintaining correct state
def start = _start
def end = _end
def length = _length
def start_=(s : Int): Unit = {
... | volkc/REScala | Examples/examples/src/main/scala/examples/range/Range.scala | Scala | apache-2.0 | 1,363 |
package com.amarjanica.discourse.models
import com.amarjanica.discourse.util.{HasParameters, HasQueryParameters}
case class SSOContext(
payload: String,
signature: String,
secret: String
)
case class SSOUserResult(payload: String, signature: String)
/**
* Contains params for generating user signing tokens f... | amarjanica/discourse-scala-client | src/main/scala/com/amarjanica/discourse/models/SSO.scala | Scala | mit | 1,507 |
package org.biosys.pubmed.models
case class PubmedRecord(pmid: String, record: String, rtype: String, htag: String) extends PubmedAbstractRecord {
}
| sdor/biosys | pubmed_common/src/main/scala/org/biosys/pubmed/models/PubmedRecord.scala | Scala | gpl-2.0 | 151 |
import sbt._
object Version {
val spark = "1.0.0"
val hadoop = "2.4.0"
val slf4j = "1.7.6"
val logback = "1.1.1"
val scalaTest = "2.1.7"
val mockito = "1.9.5"
val akka = "2.3.3"
}
object Library {
// workaround until 2.11 version for Spark Streaming's available
val sparkStreaming... | charlesxucheng/spark-streaming-scala | project/Dependencies.scala | Scala | apache-2.0 | 1,175 |
// Copyright: 2010 - 2018 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.core
import java.io.{ ByteArrayOutputStream, PrintStream }
import java.nio.charset.StandardCharsets
import org.ensime.api.DeclaredAs
import org.ensime.indexer._
import s... | yyadavalli/ensime-server | core/src/main/scala/org/ensime/core/ScalapSymbolToFqn.scala | Scala | gpl-3.0 | 4,383 |
/**
* 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... | TiVo/kafka | core/src/main/scala/kafka/server/ControllerApis.scala | Scala | apache-2.0 | 37,054 |
package AST
object Priority {
val binary = Map("lambda" -> 1,
"or" -> 2,
"and" -> 3,
"is" -> 8, "<" -> 8, ">" -> 8, ">=" -> 8, "<=" -> 8, "==" -> 8, "!=" -> 8,
"+" -> 9, "-" -> 9,
"*" -> 10, "/" -> 10, "%" -> ... | tmachows/kompilatory | lab05-optimizer/simplifier_combinator/src/main/scala/AST/AST.scala | Scala | gpl-2.0 | 6,687 |
package sttp.client3.armeria.cats
import cats.effect.kernel.{Async, Resource, Sync}
import com.linecorp.armeria.client.WebClient
import com.linecorp.armeria.common.HttpData
import com.linecorp.armeria.common.stream.StreamMessage
import org.reactivestreams.Publisher
import sttp.client3.armeria.AbstractArmeriaBackend.ne... | softwaremill/sttp | armeria-backend/cats/src/main/scala/sttp/client3/armeria/cats/ArmeriaCatsBackend.scala | Scala | apache-2.0 | 2,608 |
import awscala._
import com.amazonaws.services.simpledb.model.ListDomainsRequest
import com.amazonaws.services.{simpledb => aws}
import scala.collection.JavaConverters._
object SimpleDB {
def apply(credentials: Credentials)(implicit region: Region): SimpleDB = new SimpleDBClient(BasicCredentialsProvider(credential... | hirokikonishi/awscala | aws/simpledb/src/main/scala/SimpleDB.scala | Scala | apache-2.0 | 4,831 |
// TODO (ptr): Replace MultiMap with MultiDict
package uppsat.approximation.components
import scala.collection.mutable.{ArrayBuffer, ArrayStack, HashMap,
MultiMap, Queue, Set}
import uppsat.globalOptions._
import uppsat.ModelEvaluator
import uppsat.ModelEvaluator.Model
import uppsat.Timer
import uppsat.approximati... | uuverifiers/uppsat | src/main/scala/uppsat/approximation/components/FixpointReconstruction.scala | Scala | gpl-3.0 | 16,900 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
object Root
| wsargent/playframework | framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/multiproject/app/Root.scala | Scala | apache-2.0 | 89 |
/*
* Copyright © 2014 TU Berlin (emma@dima.tu-berlin.de)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | emmalanguage/emma | emma-lib/src/test/scala/org/emmalanguage/lib/ml/clustering/KMeansSpec.scala | Scala | apache-2.0 | 2,381 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Mon Sep 7 15:05:06 EDT 2009
* @see LICENSE (MIT style license file).
*/
package scalation.util
import collection.mutable.ResizableArray
import math.random
//:::::::::::::::... | mvnural/scalation | src/main/scala/scalation/util/PQueue.scala | Scala | mit | 4,479 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/main/scala/org/apache/spark/ui/storage/StorageTab.scala | Scala | apache-2.0 | 3,585 |
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js tools **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2014, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ **
** /____/\___/_/ |_/... | jasonchaffee/scala-js | tools/shared/src/main/scala/org/scalajs/core/tools/optimizer/OptimizerCore.scala | Scala | bsd-3-clause | 146,697 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Framework **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | matthughes/scala-js | jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestException.scala | Scala | bsd-3-clause | 783 |
package ch.cern.sparkmeasure
import org.scalatest.{FlatSpec, Matchers}
import java.net.ServerSocket
import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.client.WireMock._
class PushGatewayTest extends FlatSpec with Matchers {
/** Get available ip port */
var ip_port = 0
... | LucaCanali/sparkMeasure | src/test/scala/ch/cern/sparkmeasure/pushgatewayTest.scala | Scala | apache-2.0 | 2,714 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | Kegeruneku/rudder | rudder-web/src/main/scala/com/normation/rudder/web/services/Section2FieldService.scala | Scala | agpl-3.0 | 12,322 |
package io.iohk.ethereum.utils
object LoggingUtils {
def getClassName(cls: Class[_]): String = cls.getName.split("\\\\.").last
def getClassName(o: Object): String = getClassName(o.getClass)
}
| input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/utils/LoggerUtils.scala | Scala | mit | 198 |
package com.hungrylearner.pso.swarm
import com.hungrylearner.pso.swarm.Report.{Progress, ProgressReport}
import akka.actor.ActorRef
import com.hungrylearner.pso.particle.EvaluatedPosition
/**
* A Worker does the actual work during swarming. Workers work and don't supervise other
* workers.
*
* @tparam F Fitness
... | flintobrien/akka-multiswarm | src/main/scala/com/hungrylearner/pso/swarm/Worker.scala | Scala | apache-2.0 | 2,134 |
/*
* Copyright (c) 2014-16 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 agr... | isaka/shapeless | core/src/test/scala/shapeless/labelledgeneric.scala | Scala | apache-2.0 | 12,203 |
package reactivemongo.core.actors
import reactivemongo.core.errors.DriverException
// exceptions
object Exceptions {
import scala.util.control.NoStackTrace
private val primaryUnavailableMsg = "No primary node is available!"
private val nodeSetReachableMsg =
"The node set can not be reached! Please check y... | maxime-gautre/ReactiveMongo | driver/src/main/scala/core/actors/Exceptions.scala | Scala | apache-2.0 | 2,930 |
package edu.colorado.plv.cuanto.jsy
package primitives
import edu.colorado.plv.cuanto.jsy.common.UnitOpParser
object Parser extends UnitOpParser with string.ParserLike with numerical.ParserWithBindingLike
| cuplv/cuanto | src/main/scala/edu/colorado/plv/cuanto/jsy/primitives/Parser.scala | Scala | apache-2.0 | 208 |
package org.elasticmq.rest.sqs.directives
import akka.http.scaladsl.server.{Directives, Route}
import org.elasticmq.rest.sqs.{Action, AnyParams, SQSException}
import org.elasticmq.util.Logging
trait UnmatchedActionRoutes {
this: Logging with Directives =>
def unmatchedAction(p: AnyParams): Route = {
extractR... | adamw/elasticmq | rest/rest-sqs/src/main/scala/org/elasticmq/rest/sqs/directives/UnmatchedActionRoutes.scala | Scala | apache-2.0 | 672 |
package main.scala.MineSweeper
import scala.io.Source
object MineReader {
private def ParseMineFields(lines: Array[String]): List[MineField] = {
val dims = lines.head.split(" ").map(x => x.toInt)
dims match {
case Array(0, 0) => Nil // (0, 0) means the end of the input stream.
case Array(nrows, ... | ollielo/ScalaKata | src/main/scala/MineSweeper/MineReader.scala | Scala | mit | 717 |
/*
* 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 l... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/nn/ClassSimplexCriterion.scala | Scala | apache-2.0 | 4,331 |
package domain.views
import akka.actor.Actor
import akka.contrib.persistence.mongodb.{MongoReadJournal, ScalaDslMongoReadJournal}
import akka.persistence.query.PersistenceQuery
import akka.stream.ActorMaterializer
import akka.util.Timeout
import scala.concurrent.duration._
case object LiveStreamFailed
trait Journal... | tegonal/lasius | app/domain/views/JournalReadingView.scala | Scala | gpl-3.0 | 848 |
package liang.don.dzviewer.viewer.imagefetch.actor
import liang.don.dzviewer.viewer.imagefetch.TileFetcher
/**
* This implementation does not prefetch any tiles.
*
* @author Don Liang
* @Version 0.1.1, 15/09/2011
*/
trait DummyFetcherActor extends TileFetcher {
override def fetch() { }
}
| dl2k84/DeepZoomViewer | src/liang/don/dzviewer/viewer/imagefetch/actor/DummyFetcherActor.scala | Scala | mit | 300 |
package com.github.luzhuomi.regexphonetic
import com.github.luzhuomi.regexphonetic.{Dictionary => D}
import com.github.luzhuomi.regexphonetic.Common._
import scala.io.Source
object SoundMap {
case class SoundMap(rowIDs : List[String], colIDs : List[String], rowScores : D.Dictionary[String,List[(String,Float)]], col... | luzhuomi/regexphonetic | src/main/scala/com/gitbhub/luzhuomi/regexphonetic/SoundMap.scala | Scala | apache-2.0 | 2,558 |
package debop4s.core.utils
import java.util.concurrent._
import java.util.concurrent.atomic.AtomicBoolean
import debop4s.core._
import debop4s.core.concurrent.NamedPoolThreadFactory
import debop4s.core.conversions.time._
import org.slf4j.LoggerFactory
import scala.collection.mutable.ArrayBuffer
import scala.concurre... | debop/debop4s | debop4s-core/src/main/scala/debop4s/core/utils/Timer.scala | Scala | apache-2.0 | 11,191 |
package polyite.schedule
import scala.math.BigInt.int2bigInt
import polyite.util.Rat
import polyite.util.Util
import scala.collection.mutable.HashSet
import isl.Isl.TypeAliases._
object ScheduleVectorUtils {
def checkAllZero(coeffs : Iterable[Rat]) : Boolean = coeffs.forall { _ == Rat(0) }
def checkAllZeroBigI... | stganser/polyite | src/polyite/schedule/ScheduleVectorUtils.scala | Scala | mit | 3,260 |
package de.unihamburg.vsis.sddf.visualisation.model
import org.apache.spark.rdd.RDD
import de.unihamburg.vsis.sddf.reading.Tuple
class ReadingModel extends BasicAnalysable {
var _tuples: Option[RDD[Tuple]] = None
def tuples = {
if (_tuples.isDefined) {
_tuples.get
} else {
throw new Exceptio... | numbnut/sddf | src/main/scala/de/unihamburg/vsis/sddf/visualisation/model/ReadingModel.scala | Scala | gpl-3.0 | 459 |
/**
* This file is part of mycollab-web.
*
* mycollab-web 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.
*
* mycollab-web is d... | maduhu/mycollab | mycollab-web/src/main/scala/com.esofthead.mycollab.module.project.view.parameters/ProjectSettingScreenData.scala | Scala | agpl-3.0 | 940 |
/*
* 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 ... | myfleetingtime/spark2.11_bingo | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceRDD.scala | Scala | apache-2.0 | 6,255 |
package org.jetbrains.plugins.scala
package codeInspection.syntacticSimplification
import com.intellij.codeInspection.{ProblemHighlightType, ProblemsHolder}
import com.intellij.openapi.project.Project
import com.intellij.psi._
import org.jetbrains.annotations.Nls
import org.jetbrains.plugins.scala.codeInspection.colle... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/codeInspection/syntacticSimplification/ConvertibleToMethodValueInspection.scala | Scala | apache-2.0 | 8,459 |
package dk.tennis.compare.analysis
import breeze.plot.Figure
import breeze.plot._
import java.util.Date
import java.text.SimpleDateFormat
import java.text.NumberFormat
import java.text.FieldPosition
import java.text.ParsePosition
case class TimePlot(legend: Boolean) {
val f = Figure()
f.subplot(0).legend = legend... | danielkorzekwa/tennis-player-compare | model-tester/src/main/scala/dk/tennis/compare/analysis/TimePlot.scala | Scala | bsd-2-clause | 1,218 |
package monocle.std
import monocle.MonocleSuite
import monocle.law.discipline.{IsoTests, PrismTests}
/*class ValidationSpec extends MonocleSuite {
checkAll("Validation is isomorphic to Disjunction", IsoTests(monocle.std.validation.validationToDisjunction[String, Int]))
checkAll("success", PrismTests(monocle.std.v... | fkz/Monocle | test/shared/src/test/scala/monocle/std/ValidationSpec.scala | Scala | mit | 436 |
object SpecializationAbstractOverride {
trait A[@specialized(Int) T] { def foo(t: T) }
trait B extends A[Int] { def foo(t: Int) { println("B.foo") } }
trait M extends B { abstract override def foo(t: Int) { super.foo(t) ; println ("M.foo") } }
object C exten... | felixmulder/scala | test/pending/run/t4996.scala | Scala | bsd-3-clause | 558 |
final object Test extends java.lang.Object with Application {
class Foo(val s: String, val n: Int) extends java.lang.Object {
};
def foo[A >: Nothing <: Any, B >: Nothing <: Any, C >: Nothing <: Any]
(unapply1: (A) => Option[(B, C)], v: A): Unit =
unapply1.apply(v) match {
cas... | felixmulder/scala | test/pending/run/t0508x.scala | Scala | bsd-3-clause | 1,003 |
/**
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.actor
import scala.collection.immutable
import akka.dispatch.sysmsg._
//import routing._
import akka.dispatch._
import akka.event._
import akka.util.{ /*Switch,*/ Helpers }
import akka.util.Collections.EmptyImmutableSeq
import sc... | sjrd/scala-js-actors | actors/src/main/scala/akka/actor/ActorRefProvider.scala | Scala | bsd-3-clause | 17,190 |
/*
* 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/retriever/ComputationsBoxRetriever.scala | Scala | apache-2.0 | 9,487 |
package mesosphere.marathon.tasks
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.marathon.state.{ AppDefinition, Timestamp }
import mesosphere.marathon.{ MarathonConf, MarathonSpec, MarathonTestHelper }
import mesosphere.mesos.protos.Implicits.{ slaveIDToProto, taskIDToProto }
import mesosphere.mesos... | sepiroth887/marathon | src/test/scala/mesosphere/marathon/tasks/DefaultTaskFactoryTest.scala | Scala | apache-2.0 | 1,578 |
package no.nr.edvard.osiris.analysis
import no.nr.edvard.osiris.model.JavaMethod
import collection.immutable.{List, Map}
case class CreatorCorpusMember(method: JavaMethod, distance: Int)
object CreatorCorpus {
def buildFrom(
methods: Seq[JavaMethod],
referenceFlowGraph: ReferenceFlowGraph
): Seq[CreatorC... | edwkar/edwbsc | projects/Osiris/src/main/scala/no/nr/edvard/osiris/analysis/CreatorCorpus.scala | Scala | gpl-2.0 | 2,183 |
import scala.swing._
/** A module that displays damage per second information over various timeframes
*
* @param windowPeriods A string that represents the timeframes over which to display damage statistics
* @param currentFightDelay The time that must elapse without damage occurring for a fight to be considered... | tfellison/eq-log-parser | src/main/scala/DamageMeter.scala | Scala | mit | 5,170 |
package com.twitter.finagle.netty4.ssl.server
import com.twitter.finagle.netty4.ssl.{Alpn, Netty4SslHandler}
import com.twitter.finagle.param.Stats
import com.twitter.finagle.ssl.{ApplicationProtocols, Engine}
import com.twitter.finagle.ssl.server.{
SslServerConfiguration,
SslServerEngineFactory,
SslServerSessio... | luciferous/finagle | finagle-netty4/src/main/scala/com/twitter/finagle/netty4/ssl/server/Netty4ServerSslChannelInitializer.scala | Scala | apache-2.0 | 3,998 |
/**
* Copyright (c) 2017-2018 BusyMachines
*
* See company homepage at: https://www.busymachines.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.apac... | busymachines/busymachines-commons | core/src/main/scala/busymachines/core/notFoundAnomaly.scala | Scala | apache-2.0 | 5,915 |
/*
* filter: inliner warnings; re-run with
*/
import scala.tools.nsc._
import scala.tools.partest.CompilerTest
import scala.collection.{ mutable, immutable, generic }
object Test extends CompilerTest {
import global._
import rootMirror._
import definitions._
override def code = """
package extest {
trait ... | felixmulder/scala | test/files/run/existentials-in-compiler.scala | Scala | bsd-3-clause | 2,791 |
package net.fluxo.plugins.kas
import net.xeoh.plugins.base.Plugin
import org.apache.log4j.Level
/**
* @author Ronald Kurniawan (viper)
* @version 0.1, /01/15
*/
trait TrKas extends Plugin {
def primaryCommand(): String
def setMailLoggerName(name: String)
def process(fullCommand: Array[String]): String
def wri... | fluxodesign/DDModules | PluginKickassTo/src/main/scala/net/fluxo/plugins/kas/TrKas.scala | Scala | lgpl-3.0 | 362 |
/*******************************************************************************
* Copyright 2010 Maxime Lévesque
*
* 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://ww... | wukaikailive/squeryl | src/main/scala/org/squeryl/adapters/MSSQLServer.scala | Scala | apache-2.0 | 5,824 |
// Solution-6.scala
// Solution to Exercise 6 in "Comprehensions"
import com.atomicscala.AtomicTest._
case class Activity(date:String, action:String)
def getActivities(date:String, activities:Vector[Activity]):Vector[String] = {
for {
a <- activities
if a.date equals(date)
}
yield a.action
}
val activi... | P7h/ScalaPlayground | Atomic Scala/atomic-scala-solutions/33_Comprehensions/Solution-6.scala | Scala | apache-2.0 | 824 |
package fpgatidbits.dma
import Chisel._
import fpgatidbits.ocm._
import fpgatidbits.streams._
class ReadOrderCacheParams (
val mrp: MemReqParams,
val maxBurst: Int, // largest burst size (in beats) to handle
val outstandingReqs: Int, // max # of simultaneous outstanding requests
val chanIDBase: Int ... | maltanar/fpga-tidbits | src/main/scala/fpgatidbits/dma/ReadOrderCache.scala | Scala | bsd-2-clause | 7,583 |
package com.github.raphaelpanta
object PrintFizzBuzzList extends App {
override def main(args: Array[String]): Unit = {
val numbers = List range(1, 101)
val fizzBuzz = new FizzBuzz
val result = fizzBuzz fizzBuzzList numbers
result.foreach { number => println(number) }
}
} | raphaelpanta/FizzBuzzScala | src/com/github/raphaelpanta/PrintFizzBuzzList.scala | Scala | mit | 305 |
/*
* 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 | compiler/src/main/scala/com/asakusafw/spark/compiler/operator/user/join/ShuffledMasterCheckOperatorCompiler.scala | Scala | apache-2.0 | 3,553 |
/*
* Copyright 2013 - 2020 Outworkers Ltd.
*
* 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... | outworkers/phantom | phantom-streams/src/test/scala/com/outworkers/phantom/streams/suites/iteratee/IterateeBenchmarkPerformanceTest.scala | Scala | apache-2.0 | 2,082 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package docs.home.scaladsl.serialization.v1
import com.lightbend.lagom.scaladsl.playjson.JsonMigration
import com.lightbend.lagom.scaladsl.playjson.JsonMigrations
import com.lightbend.lagom.scaladsl.playjson.JsonSerializerRegistry
import com... | rcavalcanti/lagom | docs/manual/scala/guide/cluster/code/docs/home/scaladsl/serialization/v1/OrderAdded.scala | Scala | apache-2.0 | 488 |
package com.github.pheymann.rrt.io
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.Uri.Query
import akka.http.scaladsl.model.headers.RawHeader
import akka.http.scaladsl.model._
import akka.stream.Materializer
import com.github.pheymann.rrt.{RequestData, ServiceConfig, TestC... | pheymann/rest-refactoring-test | core/src/main/scala/com/github/pheymann/rrt/io/RestService.scala | Scala | mit | 2,107 |
package fpinscala.errorhandling
import scala.{
Option => _,
Some => _,
Either => _,
_
} // hide std library `Option`, `Some` and `Either`, since we are writing our own in this chapter
sealed trait Option[+A] {
def map[B](f: A => B): Option[B] = ???
def getOrElse[B >: A](default: => B): B = ???
def fla... | antonioj-mattos/fpinscala | exercises/src/main/scala/fpinscala/errorhandling/Option.scala | Scala | mit | 1,702 |
/*
* 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 | core/src/test/scala/org/apache/spark/benchmark/BenchmarkBase.scala | Scala | apache-2.0 | 2,508 |
package universe
import rescala.reactives.Signals
import universe.Globals.engine._
import scala.util.Random
/**
* A World object unites a space (Board object), time (Time object), and a random object
* It also defines all repetitive actions, such as spawning new Animals and Plants
*/
class World(val width: I... | volkc/REScala | Examples/Universe/src/main/scala/universe/World.scala | Scala | apache-2.0 | 2,179 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | mdzimmerman/geomesa | geomesa-kafka/geomesa-kafka-08-utils/src/test/scala/org/locationtech/geomesa/kafka08/TestKafkaUtils08.scala | Scala | apache-2.0 | 839 |
/*
*
* /\\\\\\\\\\
* /\\\\\\///\\\\\\
* /\\\\\\/ \\///\\\\\\ /\\\\\\\\\\\\\\\\\\ /\\\\\\ /\\\\\\
* /\\\\\\ \\//\\\\\\ /\\\\\\/////\\\\\\ /\\\\\\\\\\\\\\\\\\\\\\ \\/// /\\\\\\\\\\ /\\\\\\\\\\ /\\\\\\ /\\\\\\ /\\\\\\\\\\\\\\\\\\\\
* \\/\\\\\\ \\/\\\\\\ \\/\\\\\\\\\\\\\\\\\\\... | vagm/Optimus | core/src/main/scala/optimus/algebra/Constraint.scala | Scala | lgpl-3.0 | 1,686 |
/*
* 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... | zhangxiaoli73/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/integration/torch/MVSpec.scala | Scala | apache-2.0 | 5,692 |
/*
* UDPChannelImpl.scala
* (ScalaOSC)
*
* Copyright (c) 2008-2021 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.osc
package im... | Sciss/ScalaOSC | shared/src/main/scala/de/sciss/osc/impl/UDPChannelImpl.scala | Scala | lgpl-2.1 | 833 |
package org.powlab.jeye.decode.graph
import scala.collection.mutable.ArrayBuffer
import org.powlab.jeye.decode.RuntimeOpcode
import org.powlab.jeye.decode.graph.OpcodeNodes._
import org.powlab.jeye.core.Exception
import org.powlab.jeye.core.Exception._
import org.junit.Assert._
import org.junit.Test
import org.powlab.... | powlab/jeye | src/test/scala/org/powlab/jeye/decode/graph/OpcodeNodesTest.scala | Scala | apache-2.0 | 1,210 |
package scaldi
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import scaldi.Injectable.inject
class InjectedMacroSpec extends AnyWordSpec with Matchers {
"`injected` macro" should {
"support basic injection" in {
implicit val inj = new Module {
bind[DepSimp... | scaldi/scaldi | src/test/scala/scaldi/InjectedMacroSpec.scala | Scala | apache-2.0 | 3,201 |
package com.progfun.worksheet
object TestApp extends App {
val words = Array("a", "ab", "abc")
val count = 10
val cnt = words.map {
word => (word, count)
}
cnt.foreach(println)
}
| lispmind/progfun | src/main/scala/com/progfun/worksheet/TestApp.scala | Scala | mit | 195 |
package org.hammerlab.guacamole.loci.args
import org.hammerlab.args4s.StringOptionHandler
import org.kohsuke.args4j.{ Option => Args4jOption }
trait ForceCallLociArgs {
@Args4jOption(
name = "--force-call-loci",
usage = "Always call the given sites",
handler = classOf[StringOptionHandler]
)
var forc... | hammerlab/guacamole | src/main/scala/org/hammerlab/guacamole/loci/args/ForceCallLociArgs.scala | Scala | apache-2.0 | 556 |
package reopp.common.choco.dataconnectors
import reopp.common.choco._
import reopp.common.Utils._
/**
* Created with IntelliJ IDEA.
* User: jose
* Date: 19/06/12
* Time: 21:04
* To change this template use File | Settings | File Templates.
*/
class ChoIMerger(x:String,y:String,z:String,uid:Int) extends ChoData... | joseproenca/ip-constraints | code/src/main/scala/reopp/common/choco/dataconnectors/ChoIMerger.scala | Scala | mit | 1,034 |
/*
* 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 ... | mashin-io/rich-spark | streaming/src/main/scala/org/apache/spark/streaming/ui/StreamingJobProgressListener.scala | Scala | apache-2.0 | 12,071 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | yu-iskw/gihyo-spark-book-example | src/main/scala/jp/gihyo/spark/ch06/gihyo_6_2_1_Sample.scala | Scala | apache-2.0 | 1,687 |
/*
* 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 ... | ueshin/apache-flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/nodes/dataset/DataSetScan.scala | Scala | apache-2.0 | 2,602 |
package unfiltered.util
import scala.annotation.tailrec
/** Unfiltered's base server trait, something plans can be added to */
trait Server { self =>
// ServerBuilder is concretely defined in the final case classes,
// and we can always return `this` for ServerBuilder
type ServerBuilder >: self.type <: Server
}... | xuwei-k/unfiltered | util/src/main/scala/servers.scala | Scala | mit | 2,765 |
object Main extends App{
def func(x: Int, y: Int):Int = x + y
def func2 = "World"
println("Hello World")
}
| maedaunderscore/sbt-sample | src/main/scala/Main.scala | Scala | mit | 114 |
/*
* Copyright 2011-2021 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 ... | asakusafw/asakusafw-spark | compiler/src/main/scala/com/asakusafw/spark/compiler/graph/DirectInputCompiler.scala | Scala | apache-2.0 | 2,653 |
package models
import play.api.libs.json.Json
case class DigitalInternetResponse(city: String, UHD3: String);
object DigitalInternet {
implicit val responseFormatter = Json.format[DigitalInternetResponse]
} | CamilleTh/goc_backend | app/models/DigitalInternetResponse.scala | Scala | mit | 210 |
/**
* 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... | OpenPOWER-BigData/HDP-kafka | core/src/main/scala/kafka/producer/Producer.scala | Scala | apache-2.0 | 6,300 |
/*
Copyright 2016-17, Hasso-Plattner-Institut fuer Softwaresystemtechnik GmbH
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicab... | bpn1/ingestion | src/main/scala/de/hpi/ingestion/deduplication/models/BlockEvaluation.scala | Scala | apache-2.0 | 1,832 |
/**
* Licensed to the Minutemen Group under one or more contributor license
* agreements. See the COPYRIGHT 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 complian... | datalek/silhouette | silhouette/src/main/scala/silhouette/services/IdentityService.scala | Scala | apache-2.0 | 1,309 |
package com.outr.arango
import com.outr.arango.api.model.{CollectionInfo, PostAPICollection, PostAPICollectionOpts}
import com.outr.arango.api.{APICollection, APICollectionCollectionName, APICollectionCollectionNameLoad, APICollectionCollectionNameTruncate, APICollectionCollectionNameUnload, APIWalTail, WALOperations}... | outr/arangodb-scala | driver/src/main/scala/com/outr/arango/ArangoCollection.scala | Scala | mit | 3,388 |
package com.fsist.subscala
import scala.language.higherKinds
/** Restrictions on Scala syntax features */
sealed trait Syntax
object Syntax {
sealed trait +[A <: Syntax, B <: Syntax] <: Syntax
sealed trait -[A <: Syntax, B <: Syntax] <: Syntax
sealed trait If <: Syntax
sealed trait While <: Syntax
sealed ... | fsist/subscala | src/main/scala/com/fsist/subscala/Syntax.scala | Scala | apache-2.0 | 899 |
/*
* 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... | yiheng/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/ops/Dilation2D.scala | Scala | apache-2.0 | 27,078 |
// Copyright 2014 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 ap... | CommBank/edge | src/main/scala/com/cba/omnia/edge/source/psv/TypedPsv.scala | Scala | apache-2.0 | 1,639 |
package io.github.andrebeat.bytes.benchmark
import com.esotericsoftware.kryo.Kryo
import com.esotericsoftware.kryo.io.{Input, Output}
import com.google.caliper.{Param, SimpleBenchmark}
import io.github.andrebeat.bytes._
import java.io._
import org.objenesis.strategy.StdInstantiatorStrategy
import scala.util.Random
cl... | andrebeat/bytes | benchmark/src/main/scala/io/github/andrebeat/bytes/benchmark/WriteBenchmark.scala | Scala | mit | 1,419 |
package com.monovore.coast.samza.safe
import com.monovore.coast.samza.Path
import com.monovore.coast.samza.safe.Checkpoint._
import com.monovore.coast.wire.{Protocol, Serializer}
case class Checkpoint(
inputStreams: Map[(String, Int), InputState],
mergeOffset: Long,
outputStreams: Map[Path, Long]
)
object Chec... | bkirwi/coast | samza/src/main/scala/com/monovore/coast/samza/safe/Checkpoint.scala | Scala | apache-2.0 | 673 |
package controllers.school
import controllers.helpers.CRUDController
import models.school
class Topic extends CRUDController[school.Topics, school.Topic] {
/**
* @inheritdoc
*/
def resourceCollection =
school.Topics
}
| Xanho/xanho-api | app/controllers/school/Topic.scala | Scala | apache-2.0 | 238 |
package de.htwg.zeta.parser
import scala.util.parsing.combinator.Parsers
trait UniteParsers extends Parsers {
override type Elem = Char
def include[T, UP <: UniteParsers](other: UP#Parser[T]) = new UniteParser[T, UP](other)
protected class UniteParser[T, UP <: UniteParsers] private[UniteParsers](other: UP#Pa... | Zeta-Project/zeta | api/parser/src/main/scala/de/htwg/zeta/parser/UniteParsers.scala | Scala | bsd-2-clause | 650 |
package org.decaf.httplist
sealed trait RequestPartial
sealed trait HttpVerb extends RequestPartial
case object Get extends HttpVerb
case object Put extends HttpVerb
case object Post extends HttpVerb
case object Delete extends HttpVerb
case class Url(url: String) extends HttpVerb
object Url {
def empty = Url("")
}... | adamdecaf/httplist | src/main/scala/http.scala | Scala | apache-2.0 | 1,126 |
/**
* Copyright (C) 2017 Orbeon, Inc.
*
* 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
* 2.1 of the License, or (at your option) any later version.
*
* This p... | brunobuzzi/orbeon-forms | form-builder/js/src/main/scala/org/orbeon/builder/DialogItemset.scala | Scala | lgpl-2.1 | 2,148 |
/*
* Copyright 2014 Databricks
*
* 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... | fvlankvelt/spark-avro | src/test/scala/com/databricks/spark/avro/TestUtils.scala | Scala | apache-2.0 | 4,612 |
package eu.brosbit.opos.model
import _root_.net.liftweb.mongodb._
import org.bson.types.ObjectId
import _root_.net.liftweb.json.JsonDSL._
object ThemesPlan extends MongoDocumentMeta[ThemesPlan] {
override def collectionName = "themesplan"
override def formats = super.formats + new ObjectIdSerializer + new DateSe... | mikolajs/osp | src/main/scala/eu/brosbit/opos/model/ThemesPlan.scala | Scala | agpl-3.0 | 702 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* See the LICENCE.txt 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... | Webtrends/wookiee-metrics | src/main/scala/com/webtrends/harness/component/metrics/messages/MetricMessage.scala | Scala | apache-2.0 | 975 |
/*
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package com.typesafe.coffeescript
import com.typesafe.jse.{Rhino, CommonNode, Node, Engine}
import com.typesafe.jse.Engine.{ExecuteJs, JsExecutionResult}
import java.io.{InputStream, File}
import java.util.concurrent.TimeUnit
import _root_.sbt.I... | richdougherty/sbt-coffeescript-plugin | src/main/scala/com/typesafe/coffeescript/CoffeeScriptCompiler.scala | Scala | apache-2.0 | 5,123 |
/***********************************************************************
* Copyright (c) 2013-2022 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | locationtech/geomesa | geomesa-utils/src/test/scala/org/locationtech/geomesa/utils/uuid/TimeSortedUuidGeneratorTest.scala | Scala | apache-2.0 | 1,319 |
package pl.newicom.dddd.process
import akka.actor.{ActorPath, ActorSystem}
import org.joda.time.DateTime.now
import org.joda.time.{DateTime, Period}
import pl.newicom.dddd.aggregate._
import pl.newicom.dddd.delivery.protocol.DeliveryHandler
import pl.newicom.dddd.messaging.{Message, MetaData, MetaDataPropagationPolicy... | AndreyLadniy/akka-ddd | akka-ddd-core/src/main/scala/pl/newicom/dddd/process/SagaCollaboration.scala | Scala | mit | 2,336 |
package domain
import play.api.libs.json.Json
case class User(id: String, username: String, full_name: String, profile_picture: String)
object User {
implicit val format = Json.format[User]
} | sofiaaacole/socialDashboard | app/domain/User.scala | Scala | mit | 195 |
package com.sksamuel.elastic4s.searches.queries
import com.sksamuel.elastic4s.DefinitionAttributes.{DefinitionAttributeBoost, DefinitionAttributeRewrite}
import com.sksamuel.elastic4s.searches.QueryDefinition
import org.elasticsearch.index.query.QueryBuilders
case class WildcardQueryDefinition(field: String, query: A... | ulric260/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/queries/WildcardQueryDefinition.scala | Scala | apache-2.0 | 644 |
package org.liquidizer.model
import _root_.net.liftweb.mapper._
import _root_.net.liftweb.util._
import _root_.net.liftweb.common._
import org.liquidizer.lib.ssl._
/** Representation of a user of the Liquidizer system */
object User extends User
with LongKeyedMetaMapper[User]
with MetaMegaProtoUser[User] {
... | liquidizer/liquidizer | src/main/scala/org/liquidizer/model/User.scala | Scala | mit | 1,376 |
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.