code
stringlengths
5
1M
repo_name
stringlengths
5
109
path
stringlengths
6
208
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
5
1M
package com.twitter.scalding.estimation import cascading.flow.{Flow, FlowStep} import com.twitter.algebird.Monoid import org.apache.hadoop.mapred.JobConf import org.slf4j.LoggerFactory import scala.util.{Failure, Success} case class FlowStrategyInfo( flow: Flow[JobConf], predecessorSteps: Seq[FlowStep[JobConf...
twitter/scalding
scalding-core/src/main/scala/com/twitter/scalding/estimation/Estimator.scala
Scala
apache-2.0
2,108
package dreamer.conceptnet import java.net.URL import scala.util.parsing.json.JSON import dreamer.concept._ import Concept._ import Relation._ import util.Util._ private object ConceptNet { val defaultBaseURL = "http://conceptnet5.media.mit.edu/data/5.2" val defaultTimeout = 20l val defaultMinWeight = 1.0 va...
tcoxon/dreamer
src/dreamer/conceptnet.scala
Scala
mit
6,516
package org.scalaide.ui.internal.actions import scala.collection.mutable.Set import org.eclipse.ui.IObjectActionDelegate import org.eclipse.core.resources.IProject import scala.collection.mutable.HashSet import org.eclipse.jface.action.IAction import org.eclipse.jface.viewers.ISelection import org.eclipse.jface.viewer...
dragos/scala-ide
org.scala-ide.sdt.core/src/org/scalaide/ui/internal/actions/ScalaInstallationAction.scala
Scala
bsd-3-clause
4,471
package org.opendronecontrol package drone package video import java.awt.image.BufferedImage trait VideoStream { def start(){} def stop(){} def apply() = getFrame() def getFrame():BufferedImage def config(key:String, value:Any){} }
IDMNYU/Creative-Coding-UG-Fall-2014
Class25/dronestuff/odc-master/odc/src/main/scala/drone/video/VideoStream.scala
Scala
gpl-2.0
246
/* * Copyright (C) 2015 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - 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/li...
RBMHTechnology/eventuate-chaos
src/main/scala/com/rbmhtechnology/eventuate/chaos/ChaosActor.scala
Scala
apache-2.0
3,880
package io.shaka.http import io.shaka.http.Https.{DoNotUseKeyStore, HttpsConfig, TrustServersByTrustStore, UseKeyStore} import io.shaka.http.Request.GET import io.shaka.http.Response.respond import io.shaka.http.Status.OK import io.shaka.http.TestCerts._ import org.scalatest.{BeforeAndAfterAll, FunSuite} class SslAu...
stacycurl/naive-http
src/test/scala/io/shaka/http/SslAuthSpec.scala
Scala
apache-2.0
1,683
/* * 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 ...
nchammas/spark
core/src/test/scala/org/apache/spark/status/AppStatusListenerSuite.scala
Scala
apache-2.0
77,116
import java.util.{Calendar, Date} import Common.{Account, Balance} import util.{Failure, Success, Try} import scala.util.Try object Common { type Amount = BigDecimal def today = Calendar.getInstance.getTime sealed trait Currency case class Balance(amount: Amount = 0) case class Money(amount: BigDecimal) ...
dongarerahul/FunctionalProgrammingInScala
FunctionalReactiveModelling/src/main/scala/Chapter3.scala
Scala
apache-2.0
3,934
/* * 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...
wangyixiaohuihui/spark2-annotation
sql/core/src/main/scala/org/apache/spark/sql/execution/CoGroupedIterator.scala
Scala
apache-2.0
3,642
package smarthouse import akka.http.scaladsl.testkit.ScalatestRouteTest import de.heikoseeberger.akkahttpcirce.CirceSupport import smarthouse.restapi.http.HttpService import smarthouse.restapi.models.UserEntity import smarthouse.restapi.services.{AuthService, DevicesService, EventsService, UsersService} import smartho...
andrewobukhov/smart-house
src/test/scala/smarthouse/BaseServiceTest.scala
Scala
mit
1,546
// Copyright 2014 Foursquare Labs Inc. All Rights Reserved. package io.fsq.twofishes.indexer.scalding import com.twitter.scalding._ import com.twitter.scalding.typed.{MultiJoin, TypedSink} import io.fsq.twofishes.gen._ import io.fsq.twofishes.indexer.util.SpindleSequenceFileSource import org.apache.hadoop.io.LongWrita...
foursquare/fsqio
src/jvm/io/fsq/twofishes/indexer/scalding/BaseFeatureMergeIntermediateJob.scala
Scala
apache-2.0
8,208
/* # # MIT License # # Copyright (c) 2016 Saniya Tech Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and # associated documentation files (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modi...
saniyatech/spark-app
src/main/scala/SparkApp.scala
Scala
mit
1,617
/** * © 2019 Refinitiv. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable l...
dudi3001/CM-Well
server/cmwell-controller/src/main/scala/cmwell/ctrl/hc/HealthActor.scala
Scala
apache-2.0
19,735
package ga import org.scalatest._ import sGeneticAlgorithm.ga.GA._ import sGeneticAlgorithm.ga._ import sGeneticAlgorithm.utils.SimRandom class EvolverSpec extends FlatSpec { val random = new SimRandom(0) //Create a population with uniform genomes val pop: Population[Long, Vector[Long]] = (for (i <- 1 to 100) y...
rkewley/sGeneticAlgorithm
src/test/scala/ga/EvolverSpec.scala
Scala
apache-2.0
4,196
/* * Copyright 2016 LinkedIn Corp. * * 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...
bretlowery/dr-elephant-mapr
test/com/linkedin/drelephant/spark/heuristics/StagesHeuristicTest.scala
Scala
apache-2.0
7,601
package com.twitter.finagle.kestrelx.protocol import com.twitter.io.Buf sealed abstract class Response case class NotFound() extends Response case class Stored() extends Response case class Deleted() extends Response case class Error() extends ...
kristofa/finagle
finagle-kestrelx/src/main/scala/com/twitter/finagle/kestrelx/protocol/Response.scala
Scala
apache-2.0
425
import java.io.File import org.apache.commons.vfs2._ object VTest extends App { import com.intridea.io.vfs.provider.s3.S3FileProvider import org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider val bucket: String = { if (args.length!=1) { println("Usage: VTest bucketName") System.exi...
mslinn/vfs-s3Test
src/main/scala/VTest.scala
Scala
apache-2.0
1,770
/* * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * 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 Fou...
TiarkRompf/lancet
src/test/scala/lancet/advanced/test2-delite.scala
Scala
agpl-3.0
8,088
/******************************************************************************* * Copyright (c) 2015-2018 Skymind, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at * https://www.apache.org/licenses/LICENSE-2.0. ...
RobAltena/deeplearning4j
scalnet/src/main/scala/org/deeplearning4j/scalnet/layers/core/WrapperLayer.scala
Scala
apache-2.0
1,012
/* * 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 ...
vjagadish/samza-clone
samza-core/src/main/scala/org/apache/samza/container/SamzaContainerMetrics.scala
Scala
apache-2.0
2,443
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
hvanhovell/spark
sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveInspectorSuite.scala
Scala
apache-2.0
10,291
/* * Scala.js (https://www.scala-js.org/) * * Copyright EPFL. * * Licensed under Apache License 2.0 * (https://www.apache.org/licenses/LICENSE-2.0). * * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ package org.scalajs.linker.backend.emitter im...
scala-js/scala-js
linker/shared/src/main/scala/org/scalajs/linker/backend/emitter/KnowledgeGuardian.scala
Scala
apache-2.0
23,844
import scala.io.Source import java.io.File import scala.collection.mutable object Main { def main(args:Array[String]) { val input = Source.fromFile(new File(args(0))) val parsedLines = for(line <- input.getLines) yield BIParser.parse(line) val threadsToEntries = entryMap(parsedLines) ...
PaulKeeble/BIProfileSummary
src/main/scala/Main.scala
Scala
gpl-2.0
1,212
import scala.reflect.macros.blackbox.Context import language.experimental.macros object MyAttachment object Macros { def impl(c: Context) = { import c.universe._ import internal._ val ident = updateAttachment(Ident(TermName("bar")), MyAttachment) assert(attachments(ident).get[MyAttachment.type].isDe...
scala/scala
test/files/pos/attachments-typed-ident/Impls_1.scala
Scala
apache-2.0
524
/** * Copyright: Copyright (C) 2016, ATS Advanced Telematic Systems GmbH * License: MPL-2.0 */ package org.genivi.sota.data import cats.{Eq, Show} import eu.timepit.refined.api.Validate import com.typesafe.config.ConfigFactory case class PackageId(name : PackageId.Name, version: PackageId.V...
PDXostc/rvi_sota_server
common-data/src/main/scala/org/genivi/sota/data/PackageId.scala
Scala
mpl-2.0
2,252
import sbt._ import Keys._ object BuildSettings { val buildSettings = Defaults.defaultSettings ++ Seq( organization := "org.scala-lang.macroparadise", version := "1.0.0", scalacOptions ++= Seq(), scalaVersion := "2.11.0-SNAPSHOT", resolvers += Resolver.sonatypeRepo("snapshots"), addCompilerPl...
pascohen/ScalaAnnotationsMacro
project/Build.scala
Scala
apache-2.0
968
package com.socrata.datacoordinator.resources import com.rojoma.json.v3.util.JsonUtil import com.socrata.datacoordinator.id.DatasetId import com.socrata.datacoordinator.service.ServiceUtil._ import com.socrata.datacoordinator.truth.metadata.RollupInfo import com.socrata.http.server.HttpRequest import com.socrata.http....
socrata-platform/data-coordinator
coordinator/src/main/scala/com/socrata/datacoordinator/resources/DatasetRollupResource.scala
Scala
apache-2.0
1,004
/** * User: Aditya Vishwakarma * Date: 06/11/13 * Time: 4:03 PM * Note: */ import org.specs2._ class Chapter6tests extends Specification { import Chapter6.State._ def is = s2""" Test for Vendor Machine series of (Coin, Turn)*3 $a1" """ val machine1 = Machine(true,10, 10) val machine2 = Machine(f...
adityav/fpPractice
src/test/scala/Chapter6tests.scala
Scala
gpl-3.0
550
package lila.setup import chess.Clock import chess.format.FEN import chess.variant.{ FromPosition, Variant } import lila.game.{ Game, IdGenerator, Player, Pov, Source } import lila.lobby.Color import lila.user.User final case class ApiAiConfig( variant: Variant, clock: Option[Clock.Config], daysO: Option...
luanlv/lila
modules/setup/src/main/ApiAiConfig.scala
Scala
mit
2,386
package org.talkingpuffin.ui import java.awt.event.KeyEvent import javax.swing.{JToolBar, JFrame, SwingUtilities} import scala.swing.{Action} import org.talkingpuffin.Session import org.talkingpuffin.state.{PrefKeys, GlobalPrefs} import org.talkingpuffin.ui.filter.FiltersDialog import util.{ToolBarHelpers} /** * Sta...
dcbriccetti/talking-puffin
desktop/src/main/scala/org/talkingpuffin/ui/StatusToolBar.scala
Scala
mit
2,790
package biology.fish import grizzled.slf4j._ import io.config.ConfigMappings._ import io.config.LarvaConfig import locals._ import maths.{RandomNumberGenerator} import org.apache.commons.math3.distribution.NormalDistribution import com.github.nscala_time.time.Imports._ import physical.GeoCoordinate import biology._ im...
shawes/zissou
src/main/scala/biology/fish/FishFactory.scala
Scala
mit
3,605
object Version { val scalaTestVersion = "3.0.1" val scalacheckVersion = "1.13.4" val jtsVersion = "1.13" val proj4jVersion = "0.1.0" val sprayJsonVersion = "1.3.3" val dbfVersion = "0.4.0" }
jmarin/scale
project/Version.scala
Scala
apache-2.0
203
package scala.tasty.internal.dotc package util import language.implicitConversions /** Position format in little endian: * Start: unsigned 26 Bits (works for source files up to 64M) * End: unsigned 26 Bits * Point: unsigned 12 Bits relative to start * NoPosition encoded as -1L (this is a normally invalid posit...
VladimirNik/tasty
plugin/src/main/scala/scala/tasty/internal/dotc/util/Positions.scala
Scala
bsd-3-clause
5,982
/* * Copyright 1998-2015 Linux.org.ru * 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...
ymn/lorsource
src/main/scala/ru/org/linux/tag/TagInfo.scala
Scala
apache-2.0
708
object select { def either[A](a: => A) = new { import scala.util.Random def or[B >: A](b: => B) = if (Random.nextBoolean) a else b } }
grzegorzbalcerek/scala-book-examples
examples/EitherOr5.scala
Scala
mit
147
package swag_pact package properties import java.util.UUID import io.circe.Json import io.circe.syntax._ import org.scalatest.EitherValues import org.scalatest.FunSpec class PropertiesJsonSpec extends FunSpec with EitherValues { describe("Properties from Json") { describe("null") { it("should convert t...
guymers/swag-pact
core/src/test/scala/swag_pact/properties/PropertiesJsonSpec.scala
Scala
apache-2.0
3,252
package com.sksamuel.elastic4s.http.search.queries import com.sksamuel.elastic4s.http.search.queries.term.RegexQueryBodyFn import com.sksamuel.elastic4s.searches.queries.{RegexQuery, RegexpFlag} import org.scalatest.{FunSuite, Matchers} class RegexQueryBodyFnTest extends FunSuite with Matchers { test("regex query ...
Tecsisa/elastic4s
elastic4s-http/src/test/scala/com/sksamuel/elastic4s/http/search/queries/RegexQueryBodyFnTest.scala
Scala
apache-2.0
817
package fpinscala.laziness import Stream._ trait Stream[+A] { def foldRight[B](z: => B)(f: (A, => B) => B): B = // The arrow `=>` in front of the argument type `B` means that the function `f` takes its second argument by name and may choose not to evaluate it. this match { case Cons(h,t) => f(h(), t().fo...
lshlyapnikov/fpinscala
exercises/src/main/scala/fpinscala/laziness/Stream.scala
Scala
mit
6,000
/* * Scala.js (https://www.scala-js.org/) * * Copyright EPFL. * * Licensed under Apache License 2.0 * (https://www.apache.org/licenses/LICENSE-2.0). * * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ package org.scalajs.testsuite.javalib.lang im...
scala-js/scala-js
test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/lang/ShortTest.scala
Scala
apache-2.0
3,937
package models import play.api.db._ import play.api.Play.current import anorm._ import anorm.SqlParser._ import java.util.{Date} import java.security._ import scala.util._ case class User(id: Option[Long] = None, email: String, name: String, password: String) case class UserEmail(email: String) case class UserCr...
cbsrbiobank/tempmonServer
app/models/User.scala
Scala
bsd-2-clause
6,222
package net.benchmark.akka.http.world import akka.NotUsed import akka.http.scaladsl.common.{EntityStreamingSupport, JsonEntityStreamingSupport} import akka.http.scaladsl.server.Directives._ import akka.stream.scaladsl.Source import de.heikoseeberger.akkahttpcirce.ErrorAccumulatingCirceSupport._ import scala.concurrent...
nbrady-techempower/FrameworkBenchmarks
frameworks/Scala/akka-http/akka-http-slick-postgres/src/main/scala/net/benchmark/akka/http/world/UpdateRoute.scala
Scala
bsd-3-clause
1,359
package gapt.provers.prover9 import java.io.IOException import gapt.expr._ import gapt.expr.formula.Bottom import gapt.expr.formula.Neg import gapt.expr.formula.Or import gapt.expr.formula.Top import gapt.expr.formula.fol.FOLAtom import gapt.expr.formula.fol.FOLFunction import gapt.expr.formula.fol.FOLVar import gapt...
gapt/gapt
core/src/main/scala/gapt/provers/prover9/prover9.scala
Scala
gpl-3.0
6,238
package memnets.model import java.lang.Math._ import memnets.model.impl._ import scala.beans.BeanProperty trait Goal extends Element with TickFunction { type T <: AnyRef def startTick: Int def startTick_=(tick: Int): Unit def completedTick: Int def completedTick_=(tick: Int): Unit def owner: Goals def...
MemoryNetworks/memnets
api/src/main/scala/memnets/model/Goal.scala
Scala
apache-2.0
1,817
/* * Copyright 2013 Akiyoshi Sugiki, University of Tsukuba * * 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 a...
axi-sugiki/kumoi
src/kumoi/shell/vm/store/VMVolumeFormat.scala
Scala
apache-2.0
1,248
/* * Copyright 2010 Michael Fortin <[email protected]> * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
m410/calista
src/test/scala/org/brzy/calista/schema/CountTest.scala
Scala
apache-2.0
1,356
/* * Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com> */ package com.lightbend.lagom.maven import java.io.File import java.util import java.util.Collections import javax.inject.{ Inject, Singleton } import org.apache.maven.RepositoryUtils import org.apache.maven.artifact.ArtifactUtils import org....
rstento/lagom
dev/maven-plugin/src/main/scala/com/lightbend/lagom/maven/MavenFacade.scala
Scala
apache-2.0
10,553
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
pgandhi999/spark
core/src/main/scala/org/apache/spark/util/collection/WritablePartitionedPairCollection.scala
Scala
apache-2.0
3,385
/* * 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 ...
sh-cho/cshSpark
deploy/SparkSubmit.scala
Scala
apache-2.0
46,264
/* * Scala.js (https://www.scala-js.org/) * * Copyright EPFL. * * Licensed under Apache License 2.0 * (https://www.apache.org/licenses/LICENSE-2.0). * * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ /** * All doc-comments marked as "MDN" are by...
SebsLittleHelpers/scala-js
library/src/main/scala/scala/scalajs/js/JSON.scala
Scala
apache-2.0
2,158
package com.seanshubin.schulze.persistence import java.util.{Collection => JavaCollection, List => JavaList, Map => JavaMap} import scala.collection.JavaConverters._ import datomic.{Connection, Util, Peer} import com.seanshubin.schulze.persistence.datomic_util.ScalaAdaptor._ object DatomicUtil { type Ref = Long t...
SeanShubin/schulze
persistence/src/main/scala/com/seanshubin/schulze/persistence/DatomicUtil.scala
Scala
unlicense
1,995
package org.salgo.geometry.structures import org.salgo.common.Comparison case class Point2D(x: Double, y: Double) { def + (toAdd: Point2D) : Vector2D = { Vector2D(this.x + toAdd.x, this.y + toAdd.y) } def - (subtrahend: Point2D) : Vector2D = { Vector2D(this.x - subtrahend.x, this.y - subtrahend.y) } ...
ascensio/salgo
src/org.salgo/geometry/structures/Point2D.scala
Scala
apache-2.0
3,246
import sbt._ import sbt.Keys._ import bintray.Plugin._ import bintray.Keys._ object Build extends Build { val customBintraySettings = bintrayPublishSettings ++ Seq( packageLabels in bintray := Seq("observable", "try"), bintrayOrganization in bintray := Some("plasmaconduit"), repository in bintray...
plasmaconduit/try-to-observable
project/Build.scala
Scala
mit
1,149
/** * Swaggy Jenkins * Jenkins API clients generated from Swagger / Open API specification * * The version of the OpenAPI document: 1.1.2-pre.0 * Contact: [email protected] * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not ed...
cliffano/swaggy-jenkins
clients/scala-akka/generated/src/main/scala/org/openapitools/client/core/ApiSettings.scala
Scala
mit
2,216
package breeze.stats package distributions import scala.collection.compat._ import breeze.linalg.Axis._1 import breeze.linalg.Counter import breeze.numerics._ import breeze.optimize.DiffFunction /* Copyright 2009 David Hall, Daniel Ramage Licensed under the Apache License, Version 2.0 (the "License") you may not ...
scalanlp/breeze
math/src/main/scala/breeze/stats/distributions/Bernoulli.scala
Scala
apache-2.0
2,855
package com.github.ldaniels528.trifecta.modules.etl import java.io.File import org.slf4j.LoggerFactory import scala.concurrent.ExecutionContext import scala.concurrent.duration._ /** * Story Processor * @author [email protected] */ class StoryProcessor() { private val logger = LoggerFactory.getLogg...
ldaniels528/trifecta
app-modules/etl/src/main/scala/com/github/ldaniels528/trifecta/modules/etl/StoryProcessor.scala
Scala
apache-2.0
972
package com.sksamuel.elastic4s import org.scalatest.{ FlatSpec, OneInstancePerTest } import org.scalatest.mock.MockitoSugar import ElasticDsl._ /** @author Stephen Samuel */ class PercolateDslTest extends FlatSpec with MockitoSugar with JsonSugar with OneInstancePerTest { "the percolate dsl" should "should generat...
l15k4/elastic4s
elastic4s-core/src/test/scala/com/sksamuel/elastic4s/PercolateDslTest.scala
Scala
apache-2.0
1,089
package argonaut import scala.math.{ Ordering => ScalaOrdering } import scala.collection.generic.CanBuildFrom import scala.collection.immutable.{ SortedSet, SortedMap, MapLike } import scala.util.control.Exception.catching import scalaz._, std.string._, syntax.either._, syntax.applicative._ import Json._ trait Decode...
etorreborre/argonaut
src/main/scala/argonaut/DecodeJson.scala
Scala
bsd-3-clause
12,525
package com.zobot.client.packet.definitions.serverbound.login import com.zobot.client.packet.Packet case class EncryptionResponse(sharedSecretLength: Int, sharedSecret: Any, verifyTokenLength: Int, verifyToken: Any) extends Packet { override lazy val packetId = 0x01 override lazy val packetData: Array[Byte] = ...
BecauseNoReason/zobot
src/main/scala/com/zobot/client/packet/definitions/serverbound/login/EncryptionResponse.scala
Scala
mit
449
/* Copyright 2009-2016 EPFL, Lausanne */ import leon.lang._ import leon.annotation._ object SearchLinkedList { sealed abstract class List case class Cons(head : BigInt, tail : List) extends List case class Nil() extends List def size(list : List) : BigInt = (list match { case Nil() => BigInt(0) case ...
regb/leon
src/test/resources/regression/verification/newsolvers/valid/SearchLinkedList.scala
Scala
gpl-3.0
1,266
object exec{ trait Runner[T]{ def run(t: T): Unit } object Runner{ def run[T: Runner](t: T): Unit = implicitly[Runner[T]].run(t) implicit inline def runImplicitly[T]: Runner[T] = new { def run(t: T) = List(()).map(x => x).head // <<< } } }
dotty-staging/dotty
tests/pos/i5793/A.scala
Scala
apache-2.0
270
def mapper(l: List[AnyRef], f: (AnyRef) => Any) = { l.map(f(_)) } println(mapper("a" :: "b" :: Nil, (x:AnyRef) => x.getClass)) // println(mapper("a" :: "b" :: Nil, // (x:String) => x.toUpperCase)) println(mapper("a" :: "b" :: Nil, (x:Any) => x.isInstanceOf[Int])) println(mapper("a" :: "b" :: Nil, (x:An...
deanwampler/SeductionsOfScalaTutorial
code-examples/mapper.scala
Scala
apache-2.0
339
package org.jetbrains.sbt.shell /** * Created by Roman.Shein on 13.04.2017. */ trait CommunicationListener { def onCommandQueued(command: String): Unit def onCommandPolled(command: String): Unit def onCommandFinished(command: String): Unit }
ilinum/intellij-scala
src/org/jetbrains/sbt/shell/CommunicationListener.scala
Scala
apache-2.0
253
package exercises.ch03 object Ex12 { def reverse[A](as: List[A]): List[A] = List.foldLeft(as, List[A]())((l, a) => Cons(a, l)) def main(args: Array[String]): Unit = { println(reverse(List())) println(reverse(List(1))) println(reverse(List(1,2))) println(reverse(List(1,2,3))) println(reverse(L...
VladMinzatu/fpinscala-exercises
src/main/scala/exercises/ch03/Ex12.scala
Scala
mit
621
/* * 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 ...
chuckchen/spark
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkPlan.scala
Scala
apache-2.0
20,812
package com.socrata.datacoordinator.id import com.rojoma.json.v3.codec.{DecodeError, JsonDecode, JsonEncode} import com.rojoma.json.v3.ast.{JValue, JNumber} class DatasetId(val underlying: Long) extends AnyVal { override def toString = s"DatasetId($underlying)" } object DatasetId { implicit val jCodec = new Json...
socrata-platform/data-coordinator
coordinatorlib/src/main/scala/com/socrata/datacoordinator/id/DatasetId.scala
Scala
apache-2.0
689
package mesosphere.marathon package raml import mesosphere.UnitTest import mesosphere.marathon.core.base.ConstantClock import mesosphere.marathon.core.condition.Condition import mesosphere.marathon.core.health.{ MesosCommandHealthCheck, MesosHttpHealthCheck, PortReference } import mesosphere.marathon.core.instance.Ins...
natemurthy/marathon
src/test/scala/mesosphere/marathon/raml/PodStatusConversionTest.scala
Scala
apache-2.0
21,541
package org.dbpedia.spotlight.db.stem import org.junit.Assert._ import org.junit.Test /** * Tests SnowballStemmer * @author dav009 */ class SnowballStemmerTest { @Test def englishStemmer(){ val snowballStemmer = new SnowballStemmer("EnglishStemmer") assertTrue( "buy".equals(snowballStemmer.stem("buyin...
Skunnyk/dbpedia-spotlight-model
core/src/test/scala/org/dbpedia/spotlight/db/stem/SnowballStemmerTest.scala
Scala
apache-2.0
395
/* * SPDX-License-Identifier: Apache-2.0 * * Copyright 2015-2021 Andre White. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE...
adarro/ddo-calc
subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/DamageReductionLevel.scala
Scala
apache-2.0
798
/* * SPDX-License-Identifier: Apache-2.0 * * Copyright 2015-2021 Andre White. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE...
adarro/ddo-calc
subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/TacticalSupremacy.scala
Scala
apache-2.0
1,316
/* * 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-reactive/shared/src/main/scala/monix/reactive/subjects/ReplaySubject.scala
Scala
apache-2.0
7,804
package com.twitter.finagle import com.twitter.conversions.time._ import com.twitter.finagle.stats.InMemoryStatsReceiver import com.twitter.util.{Future, Await} import java.net.{UnknownHostException, InetAddress} import org.junit.runner.RunWith import org.scalatest.FunSuite import org.scalatest.junit.JUnitRunner @Run...
adriancole/finagle
finagle-core/src/test/scala/com/twitter/finagle/InetResolverTest.scala
Scala
apache-2.0
2,600
package chandu0101.scalajs.react.components.demo.components.materialui import chandu0101.scalajs.react.components.demo.components.CodeExample import chandu0101.scalajs.react.components.fascades.LatLng import chandu0101.scalajs.react.components.materialui._ import japgolly.scalajs.react._ import japgolly.scalajs.react....
coreyauger/scalajs-react-components
demo/src/main/scala/chandu0101/scalajs/react/components/demo/components/materialui/MuiDialogDemo.scala
Scala
apache-2.0
2,067
package org.vaadin.addons.rinne import com.vaadin.ui.{Alignment, Component, GridLayout} import org.vaadin.addons.rinne.mixins._ class VGridLayout extends GridLayout with AbstractLayoutMixin with LayoutSpacingHandlerMixin with LayoutMarginHandlerMixin with LayoutAlignmentHandlerMixin with LayoutClickNotifierMixin { ...
LukaszByczynski/rinne
src/main/scala/org/vaadin/addons/rinne/VGridLayout.scala
Scala
apache-2.0
1,174
/* * 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
app/controllers/responsiblepeople/PersonNonUKPassportController.scala
Scala
apache-2.0
3,963
/* * 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 ...
shubhamchopra/spark
core/src/main/scala/org/apache/spark/network/netty/NettyBlockTransferService.scala
Scala
apache-2.0
7,073
package org.dele.misc /** * Created by jiaji on 11/26/2016. */ class PH { }
new2scala/text-util
misc/src/main/scala/org/dele/misc/PH.scala
Scala
apache-2.0
81
// Databricks notebook source // MAGIC %md // MAGIC # [SDS-2.2-360-in-525-01: Intro to Apache Spark for data Scientists](https://lamastex.github.io/scalable-data-science/360-in-525/2018/01/) // MAGIC ### [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/) // COMMAND ---------- ...
lamastex/scalable-data-science
db/2/2/360-in-525-01/004_RDDsTransformationsActions.scala
Scala
unlicense
26,752
/* * Copyright 2019 ACINQ SAS * * 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...
ACINQ/eclair
eclair-node/src/main/scala/fr/acinq/eclair/api/handlers/Node.scala
Scala
apache-2.0
2,167
package org.scalatest.examples.fixture.wordspec.sharing import java.util.concurrent.ConcurrentHashMap import org.scalatest.fixture import DbServer._ import java.util.UUID.randomUUID object DbServer { // Simulating a database server type Db = StringBuffer private val databases = new ConcurrentHashMap[String, Db] ...
hubertp/scalatest
examples/src/main/scala/org/scalatest/examples/fixture/wordspec/sharing/ExampleSpec.scala
Scala
apache-2.0
1,645
package mesosphere.marathon package api import java.io.{ IOException, InputStream, OutputStream } import java.net._ import javax.inject.Named import javax.net.ssl._ import javax.servlet._ import javax.servlet.http.{ HttpServletRequest, HttpServletResponse } import akka.Done import com.google.inject.Inject import meso...
natemurthy/marathon
src/main/scala/mesosphere/marathon/api/LeaderProxyFilter.scala
Scala
apache-2.0
12,427
package edu.gemini.model.p1.immutable import edu.gemini.model.p1.{ mutable => M } import scala.collection.JavaConverters._ import java.util.UUID object Investigator { def apply(m:M.Investigator) = m match { case pi:M.PrincipalInvestigator => PrincipalInvestigator.apply(pi) case coi:M.CoInvestigator =>...
arturog8m/ocs
bundle/edu.gemini.model.p1/src/main/scala/edu/gemini/model/p1/immutable/Investigator.scala
Scala
bsd-3-clause
3,604
package com.avsystem.scex package util import org.slf4j.{Logger, LoggerFactory} import scala.reflect.{ClassTag, classTag} /** * Created: 06-12-2013 * Author: ghik */ trait LoggingUtils { protected case class LazyLogger(underlying: Logger) { def trace(msg: => String, cause: Throwable = null): Unit = { ...
AVSystem/scex
scex-core/src/main/scala/com/avsystem/scex/util/LoggingUtils.scala
Scala
mit
1,140
/* * 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 ...
manuzhang/incubator-gearpump
streaming/src/main/scala/org/apache/gearpump/streaming/state/impl/NonWindowState.scala
Scala
apache-2.0
1,866
/* NSC -- new Scala compiler * Copyright 2005-2015 LAMP/EPFL * @author Martin Odersky */ package scala.tools.nsc.interpreter import scala.reflect.internal.util.RangePosition import scala.reflect.io.AbstractFile import scala.tools.nsc.backend.JavaPlatform import scala.tools.nsc.util.ClassPath import scala.tools.nsc....
felixmulder/scala
src/repl/scala/tools/nsc/interpreter/PresentationCompilation.scala
Scala
bsd-3-clause
4,505
package com.stulsoft.ysps.pfuture import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.duration._ import scala.concurrent.{Await, Future} import scala.util.{Failure, Success} /** * Created by Yuriy Stul on 10/8/2016. */ object FutureWithCallback extends App { test1() test2() de...
ysden123/ysps
src/main/scala/com/stulsoft/ysps/pfuture/FutureWithCallback.scala
Scala
mit
1,174
trait i0 { type i1 val i2: Int = 1 } class i3 extends i0 { override def i1 = 1 } object i4 { def i5(i6: i0) = i4 } object i7 { def i8 = new i2 { type i2 <: i3.i4 with i5 def i9: i6 = i9 } } object i1 { implicit def i11[i4](i6: i9[i2]): i2[i5] = i4[i2, i4](i5) def i15[i15](i13: i14[i7]): i1[i12] = null var i13: i10[i6] ...
dotty-staging/dotty
tests/fuzzy/87b1e375168a7888470eefc1fb867d0c9f550865.scala
Scala
apache-2.0
972
/* * 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 ...
tophua/spark1.52
sql/core/src/main/scala/org/apache/spark/sql/SparkSQLParser.scala
Scala
apache-2.0
4,678
package ca.dubey.music.theory object Tonality { val fromByte : (Byte) => Tonality = { case 0 => Major case 1 => Minor } } abstract class Tonality { def toByte : Byte } case object Major extends Tonality { override def toByte : Byte = 0 } case object Minor extends Tonality { override def toByte : Byt...
adubey/music
src/main/scala/theory/Tonality.scala
Scala
gpl-2.0
329
/* * 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 ...
mike0sv/spark
streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaMapWithStateDStream.scala
Scala
apache-2.0
1,911
package com.twitter.util.lint import org.junit.runner.RunWith import org.scalatest.FunSuite import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) class RulesTest extends FunSuite { private var flag = false private val maybeRule = Rule.apply(Category.Performance, "R1", "Maybe") { if (flag) Se...
BuoyantIO/twitter-util
util-lint/src/test/scala/com/twitter/util/lint/RulesTest.scala
Scala
apache-2.0
1,472
package uk.gov.dvla.vehicles.presentation.common.views import org.scalatest.selenium.WebBrowser.pageTitle import org.scalatest.selenium.WebBrowser.go import uk.gov.dvla.vehicles.presentation.common.composition.TestHarness import uk.gov.dvla.vehicles.presentation.common.helpers.UiSpec import uk.gov.dvla.vehicles.presen...
dvla/vehicles-presentation-common
common-test/test/uk/gov/dvla/vehicles/presentation/common/views/ValtechInputDigitsIntegrationSpec.scala
Scala
mit
1,036
/* * ReaderFactory.scala * (LucreMatrix) * * Copyright (c) 2014-2017 Institute of Electronic Music and Acoustics, Graz. * Copyright (c) 2014-2017 by Hanns Holger Rutz. * * This software is published under the GNU Lesser General Public License v2.1+ * * * For further information, please contact Hanns Holge...
iem-projects/LucreMatrix
core/src/main/scala/de/sciss/lucre/matrix/impl/ReaderFactoryImpl.scala
Scala
lgpl-2.1
13,490
package logful.server import io.gatling.charts.stats.LogFileReader import io.gatling.core.Predef._ import logful.server.config.LogFileReqConfig class SmallLogSimulation extends Simulation { // val users = 40000 // val users = 10000 val users = 1 val c = new LogFileReqConfig(users) setUp(c.scn.inject(atOnceUs...
foxundermoon/gatling-test
src/gatling/scala/logful/server/SmallLogSimulation.scala
Scala
mit
363
import sbt._ import Keys._ object ArtifactTest extends Build { lazy val root = Project("root", file(".")) settings( ivyPaths <<= (baseDirectory, target)( (dir, t) => new IvyPaths(dir, Some(t / "ivy-cache"))), publishTo := Some(Resolver.file("Test Publish Repo", file("test-repo"))), resolvers <+= baseDirectory...
pdalpra/sbt
sbt/src/sbt-test/dependency-management/artifact/project/ArtifactTest.scala
Scala
bsd-3-clause
1,971
/* * 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 ...
steveloughran/spark-timeline-integration
yarn-timeline-history/src/test/scala/org/apache/spark/deploy/history/yarn/unit/MockHistoryFlushingSuite.scala
Scala
apache-2.0
3,094
package com.yammer.metrics.scala import java.util.concurrent.TimeUnit import com.yammer.metrics.{MetricRegistry, Gauge} /** * A helper class for creating and registering metrics. */ class MetricsGroup(val klass: Class[_], val metricRegistry: MetricRegistry) { /** * Registers a new gauge metric. * * @par...
hailcode/metrics-scala
src/main/scala/com/yammer/metrics/scala/MetricsGroup.scala
Scala
apache-2.0
1,624
/*********************************************************************** * 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-features/geomesa-feature-kryo/src/main/scala/org/locationtech/geomesa/features/kryo/serialization/KryoUserDataSerialization.scala
Scala
apache-2.0
8,093
/* * Copyright 2016 MongoDB, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
jCalamari/mongo-scala-driver
bson/src/main/scala/org/mongodb/scala/bson/codecs/Macros.scala
Scala
apache-2.0
3,207
package chapter27 /** * 27.2 애노테이션 문법 * * @deprecated def bigMistake() = //... * 애노테이션을 bigMistake 전체에 대해 적용했다. * * 애노테이션은 val, var, def, class, object, trait, type 등 * 모든 종류의 선언이나 정의에 사용 가능하다. 표현식에도 사용할 수 있는데 패턴 매치에서 * @unchecked 를 사용한 적이 있다 * (e: @unchecked) match { ... } * * 일반적인 애노테이션 형식은 다음과 같다. * ...
seraekim/srkim-lang-scala
src/main/java/chapter27/c27_i02.scala
Scala
bsd-3-clause
1,978
package com.twitter.zk import com.twitter.conversions.time._ import com.twitter.util.{Duration, Future, Timer} import org.apache.zookeeper.KeeperException /** Pluggable retry strategy. */ trait RetryPolicy { def apply[T](op: => Future[T]): Future[T] } /** Matcher for connection-related KeeperExceptions. */ object ...
mosesn/util
util-zk/src/main/scala/com/twitter/zk/RetryPolicy.scala
Scala
apache-2.0
1,994