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 |
|---|---|---|---|---|---|
/*
* fsc-analytics
*/
package de.pc2.dedup.analysis
import scala.collection.mutable.Map
import de.pc2.dedup.chunker.Digest
import de.pc2.dedup.util.Log
class ContainerCacheStatistics {
var hits: Int = 0
var misses: Int = 0
var hitRatio: Double = 0.0
var fetchCount: Int = 0
def finish() {
hitRatio = ... | dmeister/fs-c-analytics | src/main/scala/de/pc2/dedup/analysis/ContainerCache.scala | Scala | bsd-3-clause | 2,008 |
package bootstrap.liftweb
import net.liftweb._
import util._
import Helpers._
import common._
import http._
import sitemap._
import Loc._
import net.liftmodules.JQueryModule
import net.liftweb.http.js.jquery._
import code.rest.PonyRest
/**
* A class that's instantiated early and run. It allows the application
* ... | htmldoug/ng-lift-proxy | src/main/scala/bootstrap/liftweb/Boot.scala | Scala | apache-2.0 | 1,827 |
/*
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/dataimport/dbpedia/models/Relation.scala | Scala | apache-2.0 | 978 |
import java.io.File
import org.scalatest.FlatSpec
import scala.io.Source
class RunfileSpec extends FlatSpec {
"The text property" should "point to a runfile" in {
Option(System.getProperty("text"))
.map { path =>
val bufferedSource = Source.fromFile(path)
for (line <- bufferedSource.getLin... | smparkes/rules_scala | test/ScalaTestData.scala | Scala | apache-2.0 | 490 |
package robotichoover.service
import org.scalatest.{Matchers, FlatSpec}
import robotichoover.domain.{Instruction, RoomStatus}
class HooverServiceTest extends FlatSpec with Matchers {
"clean" should "clean the current hoover position if it's dirty" in {
val roomStatus = RoomStatus((5, 5), (1, 2), Set((1, 2), (3,... | xlbilbao/robotic-hoover-tray-io | src/test/scala/robotichoover/service/HooverServiceTest.scala | Scala | apache-2.0 | 1,195 |
package scala.compiletime.testing
/** Represents a compile-time error.
*
* @see scala.compiletime.testing.typeCheckErrors
*
* IMPORTANT: No stability guarantees are provided on the format of these
* errors. This means the format and the API may change from
* version to version. This API is to be used for tes... | som-snytt/dotty | library/src/scala/compiletime/testing/Error.scala | Scala | apache-2.0 | 439 |
package ammonite.runtime
import java.io.File
import ammonite.ops.{read, _}
import ammonite.runtime.tools.DependencyThing
import ammonite.util.Util.CodeSource
import ammonite.util._
/**
* An extensible hook into the Ammonite REPL's import system; allows the end
* user to hook into `import $foo.bar.{baz, qux => q... | alexarchambault/ammonium | amm/runtime/src/main/scala/ammonite/runtime/ImportHook.scala | Scala | mit | 9,136 |
/**
* Copyright 2015 Thomson Reuters
*
* 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... | nruppin/CM-Well | server/cmwell-cons/src/main/scala/Deployment.scala | Scala | apache-2.0 | 24,718 |
package com.twitter.gizzard.proxy
import scala.reflect.Manifest
import com.twitter.util.{Duration, Time, Future}
import com.twitter.gizzard.{Stats, TransactionalStatsConsumer}
import com.twitter.gizzard.scheduler.JsonJob
/**
* Wrap an object's method calls in a logger that sends the method name, arguments, and elap... | kmiku7/gizzard | src/main/scala/com/twitter/gizzard/proxy/LoggingProxy.scala | Scala | apache-2.0 | 2,517 |
package lang.main_entry
class HelloClass {
def main(args: Array[String]) {
println("Hello Scala!")
}
}
| congdepeng/scalab | src/main/scala/lang/main_entry/HelloClass.scala | Scala | apache-2.0 | 114 |
/*
active-learning-scala: Active Learning library for Scala
Copyright (c) 2014 Davi Pereira dos Santos
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
... | active-learning/active-learning-scala | src/main/scala/novo/Dist.scala | Scala | gpl-2.0 | 7,881 |
import sbt._
import Keys._
import Import._
object build extends Build {
val defaultSettings = Seq(
libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-reflect" % _ ),
incOptions := incOptions.value.withNameHashing(true)
)
lazy val root = Project(
base = file("."),
id = "macro",
aggregate... | dansanduleac/sbt | sbt/src/sbt-test/source-dependencies/macro-arg-dep/project/build.scala | Scala | bsd-3-clause | 773 |
/*
* Copyright 2014–2017 SlamData 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 agr... | drostron/quasar | blueeyes/src/test/scala/quasar/blueeyes/HttpNumberSpec.scala | Scala | apache-2.0 | 859 |
package org.beaucatcher.driver
import akka.dispatch.Future
import akka.dispatch.ExecutionContext
import org.beaucatcher.mongo._
private[beaucatcher] trait ReadOnlyDriverCollection {
protected[beaucatcher] def context: DriverContext
final def database: DriverDatabase = context.database
def name: String
... | havocp/beaucatcher | driver/src/main/scala/org/beaucatcher/driver/DriverCollection.scala | Scala | apache-2.0 | 6,103 |
package com.twitter.finagle
import java.net.SocketAddress
import org.apache.thrift.protocol.{TProtocolFactory, TBinaryProtocol}
import org.jboss.netty.buffer.{ChannelBuffer, ChannelBuffers}
import com.twitter.finagle.netty3.Netty3Listener
import com.twitter.finagle.server.DefaultServer
import com.twitter.finagle.thrif... | firebase/finagle | finagle-thriftmux/src/main/scala/com/twitter/finagle/thriftmux/ThriftMuxServer.scala | Scala | apache-2.0 | 2,929 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.lang._
object MyMap {
def map1(): Int = {
val m = Map(1 -> 2, 2 -> 3, 3 -> 4)
m(2)
} ensuring(_ == 3)
// Empty maps are not well supported in CVC4, because of lack of quantifiers
//def map2(): Boolean = {
// val m1 = Map[Int, Int]()
// val m... | epfl-lara/leon | src/test/resources/regression/verification/purescala/valid/MyMap.scala | Scala | gpl-3.0 | 374 |
package mesosphere.marathon.core
/**
* This package provides a mechanism to start/stop actors according to leadership changes.
*/
package object leadership
| vivekjuneja/marathon | src/main/scala/mesosphere/marathon/core/leadership/package.scala | Scala | apache-2.0 | 161 |
package com.lightning.walletapp.test
import com.lightning.walletapp.ln.crypto.Hmac256
import fr.acinq.bitcoin.Protocol
import scodec.bits.ByteVector
class MacSpec {
def allTests = {
{
println("HMAC-256 mac/verify")
val keys = Seq(
ByteVector.fromValidHex("0000000000000000000000000000000000... | btcontract/lnwallet | app/src/main/java/com/lightning/walletapp/test/MacSpec.scala | Scala | apache-2.0 | 2,240 |
package common.models
import anorm.{Macro, NamedParameter, RowParser}
import common.api.bitTracking.BitTrackingMode
import common.api.bitTracking.BitTrackingMode.BitTrackingMode
import common.api.{MTRModelAccessor, Model}
case class BitTrackingSettings(guildId: Long, currentMode: Int = 0, bitGameMessage: String = "",... | Cobbleopolis/MonsterTruckBot | modules/common/app/common/models/BitTrackingSettings.scala | Scala | mit | 720 |
/*
* 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/join/OuterJoinITCase.scala | Scala | apache-2.0 | 12,240 |
/*
* Copyright (c) 2016 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.apache.org... | snowplow/kinesis-tee | src/main/scala/com/snowplowanalytics/kinesistee/transformation/TransformationStrategy.scala | Scala | apache-2.0 | 947 |
package pamflet
import java.io.File
class Pamflet extends xsbti.AppMain {
def run(config: xsbti.AppConfiguration) = {
Exit(Pamflet.run(config.arguments))
}
case class Exit(val code: Int) extends xsbti.Exit
}
object Pamflet {
def main(args: Array[String]): Unit = {
System.exit(run(args))
}
private ... | xuwei-k/pamflet | app/src/main/scala/app.scala | Scala | lgpl-3.0 | 1,516 |
package core
import org.scalatest.{FunSpec, Matchers}
class UnionTypeSpec extends FunSpec with Matchers {
val baseJson = """
{
"name": "Union Types Test",
"unions": {
"user": { %s
"types": [
{ "type": "%s", "description": "foobar" },
{ "type": "%s" }
... | Seanstoppable/apidoc | core/src/test/scala/core/UnionTypeSpec.scala | Scala | mit | 9,580 |
import sbt._
import Keys._
object BuildSettings {
val buildSettings = Defaults.defaultSettings ++ Seq(
organization := "ch.epfl.lamp",
version := "0.1-SNAPSHOT",
scalaOrganization := "org.scala-lang.virtualized",
scalaVersion := "2.10.2-RC1",
resolvers += Resolver.sonatypeRepo("snapshots"),
s... | sstucki/odds | project/Build.scala | Scala | bsd-3-clause | 1,610 |
package momijikawa.p2pscalaproto
import org.specs2.mutable._
import momijikawa.p2pscalaproto._
class StabilizationStrategiesSpec extends Specification {
"failableRecursiveList" should {
"単純な0..9のリスト" in {
Utility.failableRecursiveList[Int](i => Some(i + 1), Some(0), 10) must_== Some(List[Int](0, 1, 2, 3... | windymelt/p2pScalaProto | src/test/scala/momijikawa/p2pscalaproto/StabilizationStrategiesSpec.scala | Scala | bsd-3-clause | 703 |
package org.jetbrains.plugins.scala
package lang
package resolve
import java.util.Objects
import com.intellij.psi._
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import org.jetbrains.plugins.scala.lang.psi.api.base.pat... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/resolve/ScalaResolveResult.scala | Scala | apache-2.0 | 12,307 |
package collins.util.config
object GpuConfig extends Configurable {
override val namespace = "gpu"
override val referenceConfigFilename = "gpu_reference.conf"
def supportedVendorStrings= getStringSet("supportedVendorStrings", Set("NVIDIA Corporation"))
override protected def validateConfig() {
supportedV... | defect/collins | app/collins/util/config/GpuConfig.scala | Scala | apache-2.0 | 339 |
package br.moneda
import javax.jms._
import com.google.gson.Gson
import org.apache.activemq.ActiveMQConnectionFactory
import org.apache.activemq.command.ActiveMQBytesMessage
/**
* Created by philippe on 02/12/15.
*/
object ActiveMqToSpark {
val activeMqUrl: String = "tcp://192.168.1.211:61616"
val queueNam... | PMoneda/spark-cassandra-activemq-jetty | src/main/scala-2.10/br/moneda/ActiveMqToSpark.scala | Scala | mit | 1,534 |
package domain.time
import java.time.ZonedDateTime
object MockedTime {
var now: ZonedDateTime = DateUtil.now()
}
| rysh/scalatrader | scalatrader/app/domain/time/MockedTime.scala | Scala | mit | 117 |
/*
* 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 n... | gf53520/kafka | core/src/test/scala/unit/kafka/admin/ConsumerGroupCommandTest.scala | Scala | apache-2.0 | 6,989 |
package eu.brosbit.opos.snippet.register
import java.util.Date
import scala.xml.Unparsed
import _root_.net.liftweb.util._
import _root_.net.liftweb.common._
import _root_.eu.brosbit.opos.model._
import _root_.eu.brosbit.opos.lib.Formater
import _root_.net.liftweb.http.{S, SHtml}
import Helpers._
import _root_.net.lift... | mikolajs/osp | src/main/scala/eu/brosbit/opos/snippet/register/OpinionsSn.scala | Scala | agpl-3.0 | 2,503 |
package system.admin.controller
import javafx.fxml.FXML
import javafx.scene.control.Label
import javafx.scene.text.Text
import system.ontologies.messages.SensorInfo
import system.ontologies.sensor.SensorCategories
/**
* This class represents the controller for the Sensor element inside the main interface
*
**/... | albertogiunta/arianna | src/main/scala/system/admin/controller/SensorTemplateController.scala | Scala | gpl-3.0 | 1,103 |
package uk.zebington.junkcraft.common.containers.slots
import net.minecraft.inventory.Slot
import uk.zebington.junkcraft.common.tileentities.TileEntitySpikeStation
/**
* Created by Charlotte on 23/02/2015.
*/
class SlotSpikeStationInput(te: TileEntitySpikeStation, ind: Int, x: Int, y: Int) extends Slot(te, ind, x, ... | zebington/JunkCraft | src/main/scala/uk/zebington/junkcraft/common/containers/slots/SlotSpikeStationInput.scala | Scala | gpl-3.0 | 711 |
/*
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | trask/glowroot | agent/plugins/play-plugin/src/test/app-2.3.x-scala/scala/controllers/HomeController.scala | Scala | apache-2.0 | 977 |
package org.scalaide.util.internal.ui
trait UIThread {
/** Asynchronously run `f` on the UI thread. */
def asyncExec(f: => Unit): Unit
/** Synchronously run `f` on the UI thread. */
def syncExec(f: => Unit): Unit
/** Retrieve the UI Thread instance */
private [scalaide] def get: Thread
}
| Kwestor/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/util/internal/ui/UIThread.scala | Scala | bsd-3-clause | 306 |
package katas.scala.w1
/**
* User: dima
* Date: 22/09/2012
*/
object Newton {
def main(args: Array[String]) {
println("result " + sqrt(2))
println("result " + sqrt(4))
println("result " + sqrt(0.001)) // returns 0.04
println("result " + sqrt(0.1e-20)) // returns 0.03
// println(0.03125 * 0.03125 - 0.1e... | dkandalov/katas | scala/src/katas/scala/w1/Newton.scala | Scala | unlicense | 739 |
/*
* This file is part of the diffson project.
* Copyright (c) 2019 Lucas Satabin
*
* 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 req... | gnieh/diffson | sprayJson/src/main/scala/gnieh/diffson/sprayJson/DiffsonProtocol.scala | Scala | apache-2.0 | 6,518 |
/*
* 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 ... | bharathkk/samza | samza-kafka/src/main/scala/org/apache/samza/system/kafka/KafkaSystemAdminUtilsScala.scala | Scala | apache-2.0 | 4,670 |
package hephaestus
package lunarg
package tutorial
import hephaestus.platform._
import java.nio._
/** Draws a coloured cube */
object Step15 extends Utils {
def main(args: Array[String]): Unit = {
glfw.init()
val instance = initInstanceExtensionsDump()
glfw.windowHint(GLFW.CLIENT_API, GLFW.NO_API)
... | to-ithaca/hephaestus | samples/src/main/scala/hephaestus/lunarg/tutorial/Step15.scala | Scala | apache-2.0 | 7,976 |
package com.ing.baker.runtime.serialization.protomappings
import cats.implicits._
import com.ing.baker.runtime.akka.actor.protobuf
import com.ing.baker.runtime.serialization.ProtoMap.{ctxFromProto, ctxToProto, versioned}
import com.ing.baker.runtime.scaladsl.EventInstance
import com.ing.baker.runtime.serialization.Pro... | ing-bank/baker | core/baker-interface/src/main/scala/com/ing/baker/runtime/serialization/protomappings/RuntimeEventMapping.scala | Scala | mit | 1,271 |
package se.lu.nateko.cp.data.test.formats.wdcgg
import java.io.File
import akka.actor.ActorSystem
import akka.stream.{Materializer, IOResult}
import akka.stream.scaladsl._
import akka.util.ByteString
import org.scalatest.BeforeAndAfterAll
import org.scalatest.funsuite.AnyFunSuite
import se.lu.nateko.cp.data.formats._... | ICOS-Carbon-Portal/data | src/test/scala/se/lu/nateko/cp/data/test/formats/wdcgg/WdcggStreamsTests.scala | Scala | gpl-3.0 | 4,329 |
import scala.collection.immutable.TreeMap
object Encryption extends App {
val input = io.Source.stdin.bufferedReader().readLine()
val height = Math.ceil(Math.sqrt(input.length))
val width = Math.floor(Math.sqrt(input.length))
val groupByColumn = TreeMap(input.indices.toList.groupBy(_ % height).toArray:_*).valu... | PaulNoth/hackerrank | practice/algorithms/implementation/encryption/Encryption.scala | Scala | mit | 430 |
package rere.driver.connection
import akka.Done
import akka.actor.ActorSystem
import akka.event.Logging
import akka.stream.scaladsl.{Flow, Keep}
import akka.stream.testkit.scaladsl.{TestSink, TestSource}
import akka.stream.{ActorMaterializer, ActorMaterializerSettings}
import akka.testkit.TestKit
import akka.util.Byte... | pbaun/rere | modules/driver/src/test/scala/rere/driver/connection/LogicalConnectionTest.scala | Scala | apache-2.0 | 3,132 |
package monocle.macros
import monocle.Iso
import scala.reflect.internal.SymbolTable
import scala.reflect.macros.{blackbox, whitebox}
object GenIso {
/** Generate an [[Iso]] between a case class `S` and its unique field of type `A`. */
def apply[S, A]: Iso[S, A] = macro GenIsoImpl.genIso_impl[S, A]
/** Genera... | aoiroaoino/Monocle | macro/src/main/scala/monocle/macros/GenIso.scala | Scala | mit | 5,182 |
package scala.xml.quote
class ScalacBugParitySuite extends XmlQuoteSuite {
test("empty CharRef") {
assert(xml"""<a b="&#;"/>""" ≈ <a b="&#;"/>)
assert(xml"""<a b="&#x;"/>""" ≈ <a b="&#x;"/>)
assert(xml"""<a>&#;</a>""" ≈ <a>&#;</a>)
assert(xml"""<a>&#x;</a>""" ≈ <a>&#x;</a>)
}
test("closing PCDa... | densh/scala-xml-quote | src/test/scala/scala/xml/quote/ScalacBugParitySuite.scala | Scala | bsd-3-clause | 732 |
package advancedScala.chapter8
import org.scalatest.FunSuite
class UptimeSpec extends FunSuite {
test("it works") {
val hosts = Map("host1" -> 10, "host2" -> 6)
val client = new TestUptimeClient(hosts)
val service = new UptimeService(client)
val actual = service.getTotalUptime(hosts.keys.toL... | mikegehard/advanced-scala-with-cats-exercises | src/test/scala/advancedScala/chapter8/UptimeSpec.scala | Scala | mit | 398 |
package org.jetbrains.plugins.scala.testingSupport.utest
/**
* @author Roman.Shein
* @since 04.09.2015.
*/
trait UTestStaticStringTest extends UTestTestCase {
protected def staticStringTestName = "UTestStaticStringTest"
protected def staticStringTestFileName = staticStringTestName + ".scala"
protected d... | whorbowicz/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/utest/UTestStaticStringTest.scala | Scala | apache-2.0 | 2,374 |
// Generated by <a href="http://scalaxb.org/">scalaxb</a>.
package eveapi.xml.account.char.CharacterInfo
import scala.concurrent.Future
/**
usage:
val obj = scalaxb.fromXML[eveapi.xml.account.char.CharacterInfo.Foo](node)
val document = scalaxb.toXML[eveapi.xml.account.char.CharacterInfo.Foo](obj, "foo", eveapi.xml.a... | scala-eveapi/eveapi | xml/src/main/scala/eveapi/xml/char/CharacterInfo/xmlprotocol.scala | Scala | mit | 28,679 |
package com.twitter.finagle.http
import com.twitter.io.Buf
import java.net.URL
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class RequestBuilderTest extends FunSuite {
val URL0 = new URL("http://joe:blow@www.google.com:77/xxx?foo... | spockz/finagle | finagle-base-http/src/test/scala/com/twitter/finagle/http/RequestBuilderTest.scala | Scala | apache-2.0 | 11,168 |
/*
* -╥⌐⌐⌐⌐ -⌐⌐⌐⌐-
* ≡╢░░░░⌐\\░░░φ ╓╝░░░░⌐░░░░╪╕
* ╣╬░░` `░░░╢┘ φ▒╣╬╝╜ ░░╢╣Q
* ║╣╬░⌐ ` ╤▒▒▒Å` ║╢╬╣
* ╚╣╬░⌐ ╔▒▒▒▒`«╕ ╢╢╣▒
* ╫╬░░╖ .░ ╙╨╨ ╣╣╬░φ ╓φ░╢╢Å
* ╙╢░░░░⌐"░░░╜ ╙Å░░░░⌐░░░░╝`
* ``˚¬ ⌐ ˚˚⌐´
*
* ... | Flipkart/connekt | commons/src/main/scala/com/flipkart/connekt/commons/services/TStencilService.scala | Scala | mit | 1,761 |
/**
* This source code file is the intellectual property of KSM Technology Partners LLC.
* The contents of this file may not be reproduced, published, or distributed in any
* form, except as allowed in a license agreement between KSM Technology Partners LLC
* and a licensee. Copyright 2012 KSM Technology Partners L... | ksmpartners/ernie | ernie-util/src/test/scala/com/ksmpartners/ernie/util/MapperUtilityTest.scala | Scala | apache-2.0 | 731 |
object Test extends App {
object Truc {
override def toString() = "oui"
def toString(bool: Boolean) = "chaispas"
}
val tata: String = Truc.toString
}
| yusuke2255/dotty | tests/untried/pos/t514.scala | Scala | bsd-3-clause | 164 |
package play.sockjs.core
import play.api.http.HttpVerbs
import play.api.mvc.Handler
import play.sockjs.core.transports._
/**
* Dispatch SockJS request to the right protocol handler.
*/
private[sockjs] final class Dispatcher(server: Server) extends HttpVerbs {
import Dispatcher._
private[this] val websocket =... | fdimuccio/play2-sockjs | src/main/scala/play/sockjs/core/Dispatcher.scala | Scala | apache-2.0 | 1,743 |
package dk.tennis.compare.rating.trueskill
import scala.collection._
import scala.math._
import dk.bayes.infer.ep.GenericEP
import dk.bayes.model.factor.GaussianFactor
import com.typesafe.scalalogging.slf4j.Logger
import org.slf4j.LoggerFactory
import dk.bayes.infer.ep.calibrate.fb.ForwardBackwardEPCalibrate
... | danielkorzekwa/tennis-player-compare | trueskill/src/main/scala/dk/tennis/compare/rating/trueskill/GenericTrueSkill.scala | Scala | bsd-2-clause | 2,464 |
/*
* Copyright (C) 2012 The Regents of The University California.
* 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/LICENS... | sameeragarwal/blinkdb | src/test/scala/shark/memstore2/column/CompressedColumnIteratorSuite.scala | Scala | apache-2.0 | 6,891 |
package geotrellis.network
class Time(private val secondsFromMidnight:Int) extends Serializable {
def toInt = secondsFromMidnight
def >(other:Time) = {
this.toInt > other.toInt
}
def <(other:Time) = {
this.toInt < other.toInt
}
def -(other:Time) = {
new Duration(this.toInt - other.toInt)
}... | flibbertigibbet/open-transit-indicators | scala/geotrellis-transit/src/main/scala/geotrellis/network/time.scala | Scala | gpl-3.0 | 3,976 |
class Foo[A] {
def map(f: (A) => Int)(i: Int)(j: Int): A = null.asInstanceOf[A]
def fooz(i: Int)(s: String) = 42
def fooz(i: Int)(j: Int) = 43
def puk[A, B](a:A)(b:B) = null
def gul[A](a:A): A = null.asInstanceOf[A]
def gul(i:Int) : Int = i
def pal(i: Int)(s: Int) = null
def pal(i: Int)(s: String... | ilinum/intellij-scala | testdata/resolve/functions/multi1/multi1.scala | Scala | apache-2.0 | 486 |
package com.haskforce.features.intentions
import com.haskforce.utils.FileUtil
import com.intellij.codeInsight.intention.impl.BaseIntentionAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile
class EnableOrphanInstances extends BaseIntentionAction... | carymrobbins/intellij-haskforce | src/com/haskforce/features/intentions/EnableOrphanInstances.scala | Scala | apache-2.0 | 827 |
/*
* 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 ... | bdrillard/spark | core/src/main/scala/org/apache/spark/storage/BlockManager.scala | Scala | apache-2.0 | 75,676 |
trait FlowOps[+Out] {
type Repr[+O] <: FlowOps[O]
}
trait Flow[-In, +Out] extends FlowOps[Out] {
override type Repr[+O] <: Flow[In, O]
def map[T](f: Out => T): Repr[T] /* workaround: expand alias Flow[In, T] */
}
class Test {
def slowFlow: Unit = {
(null: Flow[String, String])
.map(b => b)
.ma... | yusuke2255/dotty | tests/pos/flow.scala | Scala | bsd-3-clause | 553 |
package fpinscala.ch02_structuringprograms
import annotation.tailrec
case class Box(height: Double, width: Double)
object Exercises {
def greaterBy(x: Box, y: Box, f: Box => Double): Box =
if (f(x) > f(y)) x else y
type Pred[A] = A => Boolean
// Exercise 2.1.a
def taller(x: Box, y: Box): Box = gre... | shajra/fpinscala-exercises-shajra | answers/src/main/scala/fpinscala/ch02_structuringprograms/Exercises.scala | Scala | mit | 8,394 |
package edu.rice.habanero.benchmarks.banking
import akka.actor.{ActorRef, Props}
import akka.pattern.ask
import akka.util.Timeout
import edu.rice.habanero.actors.{AkkaActor, AkkaActorState}
import edu.rice.habanero.benchmarks.banking.BankingConfig._
import edu.rice.habanero.benchmarks.{Benchmark, BenchmarkRunner, Pseu... | shamsmahmood/savina | src/main/scala/edu/rice/habanero/benchmarks/banking/BankingAkkaAwaitActorBenchmark.scala | Scala | gpl-2.0 | 3,809 |
package com.equalinformation.fpps.week4
/**
* Created by bpupadhyaya on 9/30/15.
*/
trait ListVariance[+T] { // Co-variant
def isEmpty: Boolean
def head: T
def tail: ListVariance[T]
def prepend[U >: T] (elem: U): ListVariance[U] = new Cons(elem, this)
}
class Cons[T](val head: T, val tail: ListVariance[T])... | bpupadhyaya/fpps | src/main/scala/com/equalinformation/fpps/week4/ListVariance.scala | Scala | mit | 689 |
/**
* Copyright 2015 Thomson Reuters
*
* 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... | hochgi/CM-Well | server/cmwell-ws/app/filters/TrafficShapingFilter.scala | Scala | apache-2.0 | 3,546 |
/*
* This file is part of the \BlueLaTeX 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 applicable l... | tdurieux/bluelatex | blue-sync/src/main/scala/gnieh/blue/sync/impl/EditCommandParser.scala | Scala | apache-2.0 | 1,323 |
package nars.logic.entity
import nars.logic._
import nars.io.Symbols
import nars.main._
import BudgetValue._
//remove if not needed
import scala.collection.JavaConversions._
object BudgetValue {
/**
The character that marks the two ends of a budget value
*/
private val MARK = Symbols.BUDGET_VALUE_MARK
/... | printedheart/opennars | nars_lab_x/nars_scala/src/main/scala/nars/entity/BudgetValue.scala | Scala | agpl-3.0 | 4,963 |
transparent inline def default(inline name: String): Any =
inline if name == "Int" then 0
else inline if name == "String" then ""
else ???
def test =
default("Int")
| dotty-staging/dotty | tests/pos/i10521.scala | Scala | apache-2.0 | 175 |
// Copyright (c) 2011-2015 ScalaMock Contributors (https://github.com/paulbutcher/ScalaMock/graphs/contributors)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, inc... | hypertino/ScalaMock | core/shared/src/main/scala/org/scalamock/handlers/UnorderedHandlers.scala | Scala | mit | 1,713 |
package com.karasiq.shadowcloud.api.js
import scala.concurrent.Future
import scala.language.higherKinds
import akka.util.ByteString
import boopickle.Pickler
import org.scalajs.dom.ext.Ajax
import play.api.libs.json._
import com.karasiq.shadowcloud.api.{SCApiClient, SCApiUtils}
import com.karasiq.shadowcloud.api.boop... | Karasiq/shadowcloud | server/autowire-api/.js/src/main/scala/com/karasiq/shadowcloud/api/js/SCAjaxApiClient.scala | Scala | apache-2.0 | 1,177 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package elements
import com.intellij.psi.PsiElement
import com.intellij.psi.stubs._
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScValue
import org.jetbrains.plugins.scala.lang.psi.stubs.impl.ScValueStubImpl
import org.jetbrains.p... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/elements/ScValueElementType.scala | Scala | apache-2.0 | 1,884 |
package org.jetbrains.plugins.scala
package refactoring.rename2
import org.junit.Assert
/**
* User: Jason Zaugg
*
* Tests functionality in [[org.jetbrains.plugins.scala.findUsages.ScalaAliasedImportedElementSearcher]]
* and [[org.jetbrains.plugins.scala.lang.refactoring.rename.ScalaRenameUtil.filterAliasedReferen... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/refactoring/rename2/ScalaRenameAliasedTest.scala | Scala | apache-2.0 | 6,589 |
package com.joypeg.scamandrill.client
import akka.actor.ActorSystem
import akka.http.scaladsl._
import akka.http.scaladsl.model._
import akka.stream.ActorMaterializer
import scala.concurrent.{Await, Future}
import scala.concurrent.duration._
import com.joypeg.scamandrill.utils.SimpleLogger
/**
* This trait abstract ... | dtaniwaki/scamandrill | src/main/scala/com/joypeg/scamandrill/client/ScamandrillSendReceive.scala | Scala | apache-2.0 | 2,781 |
package sgl.html5
package themes
import org.scalajs.dom
import dom.html
/** Specify how the canvas app interact with the web page.
*
* This is some re-usable bit of code, that can be configured when setting up
* the HTML5 app. It's only relevant to html5 based games, so the interface is
* not visible to the r... | regb/scala-game-library | html5/src/main/scala/sgl/html5/themes/Theme.scala | Scala | mit | 2,028 |
/*
* Copyright (C) 2015 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progra... | ISCPIF/PSEExperiments | openmole-src/openmole/bin/org.openmole.site/src/main/scala/org/openmole/site/Resource.scala | Scala | agpl-3.0 | 2,353 |
package org.scalajs.testinterface.internal
import scala.scalajs.js
import js.Dynamic.{literal => lit}
import js.JSConverters._
import js.annotation.JSExport
@JSExport
final class InfoSender(frameworkName: String) {
@JSExport
def initAndSend(): Unit = {
Com.init((_: String) => ())
sendFrameworkInfo()
... | jmnarloch/scala-js | test-interface/src/main/scala/org/scalajs/testinterface/internal/InfoSender.scala | Scala | bsd-3-clause | 678 |
package com.soteradefense.datawake.trails.topology.rank.data
import backtype.storm.tuple.Values
import com.soteradefense.datawake.trails.data.StormData
/**
* Helper object for defining a link to update rank.
* @param org Org the link belongs to
* @param domain Domain the link belongs to
* @param trail Trail the l... | Sotera/datawake-prefetch | trail-specific-search/src/main/scala/com/soteradefense/datawake/trails/topology/rank/data/DatawakeLink.scala | Scala | apache-2.0 | 554 |
/*
* Copyright (c) 2013 Christos KK Loverdos
*
* 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... | loverdos/thrift3r | src/main/scala/com/ckkloverdos/thrift3r/collection/descriptor/ScalaDescriptor.scala | Scala | apache-2.0 | 7,915 |
package org.lolhens.renderengine.test
import java.awt.BorderLayout
import java.awt.event.{WindowAdapter, WindowEvent}
import com.jogamp.opengl.awt.GLCanvas
import javax.swing.JFrame
import org.lolhens.renderengine.model.Model
import org.lolhens.renderengine.scene.{DefaultSceneRenderer, Scene}
/**
* Created by LolH... | LolHens/LibRenderEngine | src/test/scala/org/lolhens/renderengine/test/Window.scala | Scala | gpl-2.0 | 972 |
/*
* 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/test/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/relatedPartyTransactions/AC302ASpec.scala | Scala | apache-2.0 | 1,422 |
/* SViewer.scala
*
* Jim McBeath, June 10, 2008
*/
package net.jimmc.mimprint
import net.jimmc.swing.AboutWindow
import net.jimmc.swing.SButton
import net.jimmc.swing.SCheckBoxMenuItem
import net.jimmc.swing.SFrame
import net.jimmc.swing.SMenuItem
import net.jimmc.swing.SwingS
import net.jimmc.swing.ToolPrompter
i... | jimmc/mimprint | src/net/jimmc/mimprint/SViewer.scala | Scala | gpl-2.0 | 32,602 |
/*
* 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/main/scala/com/intel/analytics/bigdl/dllib/keras/layers/GaussianDropout.scala | Scala | apache-2.0 | 1,998 |
package com.getjenny.starchat.services.esclient.crud
import akka.event.{Logging, LoggingAdapter}
import com.getjenny.starchat.SCActorSystem
import com.getjenny.starchat.entities.io._
import com.getjenny.starchat.entities.persistents.{ReadEntityManager, WriteEntityManager}
import com.getjenny.starchat.services.esclient... | GetJenny/starchat | src/main/scala/com/getjenny/starchat/services/esclient/crud/IndexLanguageCrud.scala | Scala | gpl-2.0 | 9,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 ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/main/scala/org/apache/spark/deploy/master/ui/MasterWebUI.scala | Scala | apache-2.0 | 3,549 |
package amailp.intellij.robot.extensions
import com.intellij.pom.PomTarget
import com.intellij.psi.PsiElement
import com.intellij.util.Consumer
import amailp.intellij.robot.psi.KeywordName
class DeclarationSearcher extends com.intellij.pom.PomDeclarationSearcher {
def findDeclarationsAt(element: PsiElement, offsetI... | puhnastik/robot-plugin | src/main/scala/amailp/intellij/robot/extensions/DeclarationSearcher.scala | Scala | gpl-3.0 | 509 |
package com.aimplicits.gallery
import java.nio.ByteBuffer
import java.nio.charset.Charset
import java.security.KeyFactory
import java.security.spec.PKCS8EncodedKeySpec
import java.util.{Base64, Date}
import com.amazonaws.serverless.proxy.internal.model.AwsProxyResponse
import com.amazonaws.services.cloudfront.CloudFr... | paul-lysak/gallery-proto | gallery_cookies_lambda/src/main/scala/com/aimplicits/gallery/CloudFrontAuthorizationLambda.scala | Scala | apache-2.0 | 7,978 |
package io.taig.android.widget.syntax
trait all
extends animation
with view
with viewGroup
with viewPager
with viewSwitcher
object all extends all
| Taig/Toolbelt | widget/src/main/scala/io/taig/android/widget/syntax/all.scala | Scala | mit | 169 |
package com.unicornsummer.weixin.scala.utility
/**
* @author ${user.name}
*/
object App {
def foo(x : Array[String]) = x.foldLeft("")((a,b) => a + b)
def main(args : Array[String]) {
println( "Hello World!" )
println("concat arguments = " + foo(args))
}
}
| junspace/weixin-scala-sdk | weixin-scala-sdk/weixin-scala-utility/src/main/scala/com/unicornsummer/weixin/scala/utility/App.scala | Scala | apache-2.0 | 280 |
package edu.arizona.sista.twitter4food
import scala.io.Source
/**
* Created by dfried on 5/21/14.
*/
object FoodWords {
lazy val words: Set[String] = {
def source = Source.fromURL(getClass.getResource("food_words.txt"))
source.getLines.map(_.trim.toLowerCase).toSet
}
}
| VivianLuwenHuangfu/twitter4food | src/main/scala/edu/arizona/sista/twitter4food/FoodWords.scala | Scala | apache-2.0 | 286 |
package es.tid.ML
import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.SparkContext._
object CountWords {
def main(args: Array[String]) {
val conf = new SparkConf().setAppName("CountWords")
val sc = new SparkContext(conf)
// text file in HDFS
val textFile = "hdfs:///user/samson... | paulovn/spark-dojo | scala/CountingWords.2/src/main/scala/es/tid/ML/CountWords2.scala | Scala | apache-2.0 | 1,367 |
package provingground
import provingground.HoTT._
// import provingground.HoTT.Deprec._
//import scala.reflect.runtime.universe.{Try => UnivTry, Function => FunctionUniv, _}
import annotation._
import provingground.InductiveTypes._
import MiniVerse._
object MiniVerse {
/**
* returns type family, but needs a un... | siddhartha-gadgil/ProvingGround | digressions/src/main/scala/provingground/Context.scala | Scala | mit | 15,981 |
/*
* 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 ... | tribbloid/ISpark | core/src/test/scala/org/apache/spark/repl/ReplSuite.scala | Scala | apache-2.0 | 12,076 |
package com.eevolution.context.dictionary.domain.api.service
import com.eevolution.context.dictionary._
import com.eevolution.context.dictionary.domain.model.SchedulerLog
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribute ... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/service/SchedulerLogService.scala | Scala | gpl-3.0 | 1,208 |
/*
* 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 ... | matthewfranglen/spark | core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala | Scala | mit | 38,026 |
package org.bitcoins.script.constant
import org.bitcoins.util.BitcoinSUtil
import org.scalatest.{MustMatchers, FlatSpec}
/**
* Created by chris on 4/4/16.
*/
class ScriptNumberFactoryTest extends FlatSpec with MustMatchers {
"ScriptNumber" must "create the same number using from hex and from bytes" in {
val ... | Christewart/scalacoin | src/test/scala/org/bitcoins/script/constant/ScriptNumberFactoryTest.scala | Scala | mit | 1,375 |
/*
* 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/test/scala/org/apache/spark/ContextCleanerSuite.scala | Scala | apache-2.0 | 21,846 |
package fs2.io
import java.net.InetSocketAddress
import java.nio.channels.AsynchronousChannelGroup
import fs2._
package object tcp {
/**
* Process that connects to remote server (TCP) and runs the stream `ouput`.
*
* @param to Address of remote server
* @param reuseAddress ... | japgolly/scalaz-stream | io/src/main/scala/fs2/io/tcp/tcp.scala | Scala | mit | 3,127 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot 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 req... | mohiva/play-silhouette | silhouette/app/com/mohiva/play/silhouette/api/util/HTTPLayer.scala | Scala | apache-2.0 | 2,434 |
/*
* 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/tabulate | core/shared/src/test/scala/kantan/csv/ListCodecTests.scala | Scala | mit | 1,017 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller, Naman Fatehpuria
* @version 1.2
* @date Mon Jul 29 14:09:25 EDT 2013
* @see LICENSE (MIT style license file).
*/
package scalation.analytics
import scala.math.{ceil, min}
import scalation.linalge... | NBKlepp/fda | scalation_1.2/src/main/scala/scalation/analytics/NMFactorization.scala | Scala | mit | 4,267 |
package org.channing.simple
abstract class Store[C[_]] {
def runStoreIO[T](storeIO: StoreIO[C, T]): Throwable Either T
def get(k: String): StoreIO[C, Option[String]]
def put(k: String, v: String): StoreIO[C, Int]
def postCommit(pc: PostCommit): StoreIO[C, Unit]
def createSchema(): StoreIO[C, Int]
de... | channingwalton/doobie-play | src/main/scala/org/channing/simple/Store.scala | Scala | unlicense | 363 |
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.