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 io.mpjsons.impl.deserializer import io.mpjsons.JsonTypeDeserializer import io.mpjsons.impl.StringIterator import io.mpjsons.impl.util.{ObjectConstructionUtil, TypesUtil} import scala.reflect.runtime.universe._ class SingletonObjectDeserializer(tpe: Type) extends JsonTypeDeserializer[AnyRef] { override def...
marpiec/mpjsons
src/main/scala/io/mpjsons/impl/deserializer/SingletonObjectDeserializer.scala
Scala
apache-2.0
764
/* * Copyright (c) 2014-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.a...
Propertyfinder/snowplow
2-collectors/scala-stream-collector/src/test/scala/com.snowplowanalytics.snowplow.collectors.scalastream/PostSpec.scala
Scala
apache-2.0
8,426
/* * Copyright 2017 PayPal * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
anilgursel/squbs
squbs-zkcluster/src/main/scala/org/squbs/cluster/ZkPartitionsManager.scala
Scala
apache-2.0
9,717
/* * Derived from https://github.com/spray/spray/blob/v1.1-M7/spray-http/src/main/scala/spray/http/parser/CookieHeaders.scala * * Copyright (C) 2011-2012 spray.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 obtai...
hvesalai/http4s
core/src/main/scala/org/http4s/parser/CookieHeader.scala
Scala
apache-2.0
3,545
// see ticket #3651 object Test { def main(args: Array[String]): Unit = { val s = new Extended("s") println(s.foo) //works val i = new Extended(1) println(i.foo) //infinite loop with StackOverflowError println(runtime.BoxesRunTime.integerBoxCount) } } class Base[@specialized(Int) T](val t: T...
martijnhoekstra/scala
test/files/specialized/spec-super.scala
Scala
apache-2.0
447
package breeze.stats.distributions /* Copyright 2009 David Hall, Daniel Ramage 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...
crealytics/breeze
math/src/main/scala/breeze/stats/distributions/Rand.scala
Scala
apache-2.0
10,374
package geotrellis.network.graph import geotrellis.network._ import spire.syntax.cfor._ sealed abstract class VertexType case object StationVertex extends VertexType { def apply(location:Location,name:String) = Vertex(location,name,StationVertex) } case object StreetVertex extends VertexType { def apply(locati...
flibbertigibbet/open-transit-indicators
scala/geotrellis-transit/src/main/scala/geotrellis/network/graph/Vertex.scala
Scala
gpl-3.0
717
/* * 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/test/scala/org/apache/samza/config/TestStorageConfig.scala
Scala
apache-2.0
1,512
/* This file is part of Intake24. Copyright 2015, 2016 Newcastle University. 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 appl...
digitalinteraction/intake24
DataExportService/app/uk/ac/ncl/openlab/intake24/services/dataexport/controllers/SurveyDataExportController.scala
Scala
apache-2.0
12,489
import scala.quoted.* import scala.language.implicitConversions case class Xml(parts: String, args: List[Any]) object XmlQuote { // Encoding for // // implicit class SCOps(s: StringContext) { // object xml { // def apply(exprs: Any*) = ... // def unapplySeq(...) = ... // } // } object ...
lampepfl/dotty
tests/run-macros/xml-interpolation-7/Macros_1.scala
Scala
apache-2.0
928
/* * Copyright 2012 Twitter Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
siddhaism/zipkin
zipkin-query/src/main/scala/com/twitter/zipkin/query/ThriftQueryService.scala
Scala
apache-2.0
12,265
package mesosphere.marathon package raml import mesosphere.UnitTest import mesosphere.marathon.core.launcher.OfferMatchResult import mesosphere.marathon.core.launchqueue.LaunchStats.QueuedInstanceInfoWithStatistics import mesosphere.marathon.state.{AbsolutePathId, AppDefinition, Timestamp} import mesosphere.marathon.t...
mesosphere/marathon
src/test/scala/mesosphere/marathon/raml/QueueInfoConversionTest.scala
Scala
apache-2.0
5,343
package controllers import javax.inject._ import play.api._ import play.api.libs.json._ import play.api.mvc._ import play.api.mvc.Results._ import models._ import dal._ import scala.concurrent.{ExecutionContext, Future} import scala.concurrent.forkjoin._ import scala.language.postfixOps import ExecutionContext.I...
kelleyb/RPI-Tours-Backend
app/controllers/ApiController.scala
Scala
mit
7,786
import scala.language.{ higherKinds, existentials } object Test extends App { def get[T](x: T) = { println("get: "+ x); x } // TESTS // re-order using names, call-site evaluation order test1(1, "@") test1(b = get("$"), a = get(2)) test1(a = get(3), b = get("**")) // should not transform into a block. ho...
felixmulder/scala
test/files/run/names-defaults.scala
Scala
bsd-3-clause
12,683
/* Copyright (c) 2012 Joshua Garnett 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, modify, merge, publish, distri...
joshgarnett/Astar-Scala
test/com/adverserealms/astar/basic2d/MockSquareGridMap.scala
Scala
mit
4,723
package ru.dgolubets import ru.dgolubets.neo4s.util.CypherStringContext import scala.language.implicitConversions package object neo4s { // here I import types that should be used often implicit def cypherStringContext(sc: StringContext): CypherStringContext = new CypherStringContext(sc) }
DGolubets/neo4s
src/main/scala/ru/dgolubets/neo4s/package.scala
Scala
apache-2.0
299
/* __ *\\ ** ________ ___ / / ___ __ ____ Scala.js API ** ** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL ** ** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-lang.org/ ** ** /____/\\___/...
lrytz/scala-js
library/src/main/scala/scala/scalajs/js/JSConverters.scala
Scala
bsd-3-clause
3,383
package com.github.cuzfrog.scmd.runtime import com.github.cuzfrog.scmd.ScmdUtils._ private[runtime] trait ArgTreeUtils { implicit class ArgTreeOps(a: ArgTree) { } implicit class CmdNodeOps(a: CmdNode) { def getMandatoriesDownstream: Seq[Node] = { val params: Seq[Node] = a.params.filter(_.entity.isM...
cuzfrog/simple-cmd
src/main/scala/com/github/cuzfrog/scmd/runtime/ArgTreeUtils.scala
Scala
apache-2.0
1,325
package wandou.util.pinyin import wandou.util.pinyin.format.HanyuPinyinCaseType import wandou.util.pinyin.format.HanyuPinyinOutputFormat import wandou.util.pinyin.format.HanyuPinyinToneType import wandou.util.pinyin.format.HanyuPinyinVCharType import wandou.util.pinyin.format.exception.BadHanyuPinyinOutputFormat...
wandoulabs/wandou-math
wandou-util/src/main/scala/wandou/util/pinyin/PinyinFormatter.scala
Scala
apache-2.0
5,330
package com.twitter.finagle.mux.transport import com.twitter.concurrent.{AsyncQueue, Broker, Offer} import com.twitter.finagle.mux.transport.Message.{Rdiscarded, Tdiscarded} import com.twitter.finagle.stats.StatsReceiver import com.twitter.finagle.transport.{LegacyContext, Transport, TransportContext} import com.twitt...
mkhq/finagle
finagle-mux/src/main/scala/com/twitter/finagle/mux/transport/MuxFramer.scala
Scala
apache-2.0
13,424
/* * # Trove * * This file is part of Trove - A FREE desktop budgeting application that * helps you track your finances, FREES you from complex budgeting, and * enables you to build your TROVE of savings! * * Copyright © 2016-2021 Eric John Fredericks. * * Trove is free software: you can redistribute it ...
emanchgo/trove
src/main/scala/trove/package.scala
Scala
gpl-3.0
1,490
package skuber.apps import skuber.ResourceSpecification.{Names, Scope} import skuber._ import play.api.libs.functional.syntax._ import play.api.libs.json.{Format, JsPath, Json} import skuber.json.format._ // reuse some core skuber json formatters /** * Created by hollinwilkins on 4/5/17. * The api version of thi...
doriordan/skuber
client/src/main/scala/skuber/apps/StatefulSet.scala
Scala
apache-2.0
6,325
object exercise2_3 { def curry[A, B, C](f: (A, B) => C): A => (B => C) = (a: A) => ((b: B) => f(a, b)) def add(a: Int, b: Int): Int = a + b def main(args: Array[String]): Unit = { val c1 = curry(add)(3) println(c1) val c2 = c1(4) println(c2) } }
joonjeong/shadow-boxing
fp-in-scala/exercise2/currying.scala
Scala
mit
277
package org.jetbrains.plugins.scala package compiler import java.io.{File, IOException} import javax.swing.event.HyperlinkEvent import com.intellij.notification.{Notification, NotificationListener, NotificationType, Notifications} import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi....
igrocki/intellij-scala
src/org/jetbrains/plugins/scala/compiler/CompileServerLauncher.scala
Scala
apache-2.0
9,010
package scala.pickling package tags private[pickling] final case class SimpleFastTypeTag[T]( typeConstructor: String, typeArgs: List[FastTypeTag[_]]) extends FastTypeTag[T] { override def isSimpleType = typeArgs.isEmpty override val key = if (typeArgs.isEmpty) typeConstructor else s"$typeConstru...
scala/pickling
core/src/main/scala/scala/pickling/tags/SimpleFastTypeTag.scala
Scala
bsd-3-clause
366
package com.example.db import slick.driver.H2Driver.api._ import scala.concurrent.Await import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.duration.Duration // Demonstrates various ways of reading data object QueryActions extends App { // A simple dictionary table with keys and valu...
waxmittmann/finatra-sandbox
old/QueryActions.scala
Scala
apache-2.0
2,099
package delta.testing import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit.{ MILLISECONDS, SECONDS } import scala.collection.concurrent.TrieMap import scala.collection.immutable.Seq import scala.concurrent.{ Future, Promise } import scala.concurrent.Await import scala.concurrent.duration.{ D...
nilskp/delta
src/test/scala/delta/testing/TestEventStoreRepository.scala
Scala
mit
14,346
/** * 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...
chicagozer/rheosoft
components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/RecipientListRouteTest.scala
Scala
apache-2.0
2,066
package org.mitre.mandolin.mx import ml.dmlc.mxnet._ import com.typesafe.config.{Config, ConfigValue} import net.ceedubs.ficus.Ficus._ /** * Provides functionality for building up MXNet network/symbol objects from JSON-syntax * specification. * Structure, example: * * {"type":"variable", "name": "input"} // d...
project-mandolin/mandolin
mandolin-mx/src/main/scala/org/mitre/mandolin/mx/SymbolBuilder.scala
Scala
apache-2.0
11,988
package reactivemongo.core import java.nio.ByteOrder import akka.util.{ByteStringBuilder, ByteString} import reactivemongo.bson.buffer.{WritableBuffer, ReadableBuffer} /** * Created by sh1ng on 29/04/15. */ class AkkaReadableBuffer(buffer: ByteString) extends ReadableBuffer { val byteBuffer = buffer.toByteBuffe...
sh1ng/ReactiveMongo
driver/src/main/scala/core/akka.scala
Scala
apache-2.0
1,695
package org.jetbrains.plugins.scala package lang package psi package impl package expr import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElementImpl import com.intellij.lang.ASTNode import org.jetbrains.plugins.scala.lang.psi.api.expr._ import com.intellij.psi.PsiElementVisitor import api.ScalaElementVisitor /** *...
consulo/consulo-scala
src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScGuardImpl.scala
Scala
apache-2.0
722
package com.arcusys.valamis.persistence.impl.scorm.model case class ActivityStateNodeModel(id: Option[Long], parentId: Option[Long], treeId: Option[Long], availableChildrenIds: Option[String])
igor-borisov/valamis
valamis-slick-persistence/src/main/scala/com/arcusys/valamis/persistence/impl/scorm/model/ActivityStateNodeModel.scala
Scala
gpl-3.0
257
class C(val x: Int, val next: C|Null) def f = { var xs: C|Null = C(1, C(2, null)) while (xs != null) { val xsx: Int = xs.x val xscpy: C = xs xs = xscpy // Since xscpy is non-nullable, after the assign, xs is still non-nullable val xscpyx: Int = xscpy.x xs = xs.next // xs.next is nullable, after...
dotty-staging/dotty
tests/explicit-nulls/neg/flow-after-assign.scala
Scala
apache-2.0
392
/** * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
CloudVLab/professional-services
examples/dataflow-scala-kafka2avro/src/test/scala/com/google/cloud/pso/kafka2avro/Kafka2AvroSpec.scala
Scala
apache-2.0
3,724
package com.twitter.algebird package benchmark import org.openjdk.jmh.annotations._ object BloomFilterQueryBenchmark { @State(Scope.Benchmark) class BloomFilterState { @Param(Array("100", "1000", "10000")) var nbrOfElements: Int = 0 @Param(Array("0.001", "0.01")) var falsePositiveRate: Double =...
nevillelyh/algebird
algebird-benchmark/src/main/scala/com/twitter/algebird/benchmark/BloomFilterQueryBenchmark.scala
Scala
apache-2.0
820
/* * Copyright 2017 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/kantan.mongodb
core/src/main/scala/kantan/mongodb/options/ValidationOpts.scala
Scala
apache-2.0
2,193
package object CDS { // import nasa.nccs.cds2.kernels.kernelManager // import nasa.nccs.cds2.modules.CDS._ val name = "CDS" val version = "1.0-SNAPSHOT" val organization = "nasa.nccs" val author = "Thomas Maxwell" val contact = "thomas.maxwell@nasa.gov" // kernelManager.addKernel( average ) }
nasa-nccs-cds/CDS2
src/main/scala/nasa/nccs/cds2/modules/CDS/package.scala
Scala
gpl-2.0
310
package io.relayr.amqp /** * The message and any routing information that is included when it is received from a queue. * @param exchange * @param routingKey * @param message */ case class Envelope(exchange: String, routingKey: String, message: Message)
relayr/rabbitmq-scala-client
src/main/scala/io/relayr/amqp/Envelope.scala
Scala
mit
260
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().fol...
danielgrigg/fpinscala
exercises/src/main/scala/fpinscala/laziness/Stream.scala
Scala
mit
3,514
package com.arcusys.valamis.lesson.storage import com.arcusys.valamis.lesson.model.PackageScopeRule import com.arcusys.valamis.model.ScopeType trait PackageScopeRuleStorage { def get(packageID: Long, scope: ScopeType.Value, scopeID: Option[String]): Option[PackageScopeRule] def getAll(packageID: Long, scope: Scop...
ViLPy/Valamis
valamis-core/src/main/scala/com/arcusys/valamis/lesson/storage/PackageScopeRuleStorage.scala
Scala
lgpl-3.0
1,000
package org.bitcoins.core.crypto import org.bitcoins.core.number.UInt32 import org.bitcoins.testkitcore.gen.CryptoGenerators import org.bitcoins.testkitcore.util.BitcoinSUnitTest import org.scalacheck.{Gen, Prop} import scala.util.Success class ExtKeySpec extends BitcoinSUnitTest { private val nonHardened: Gen[UI...
bitcoin-s/bitcoin-s
core-test/src/test/scala/org/bitcoins/core/crypto/ExtKeySpec.scala
Scala
mit
2,587
package quizleague.web.service.chat import java.time.LocalDateTime import quizleague.web.service.EntityService import quizleague.web.model._ import quizleague.domain.{ChatMessage => Dom, Key => DomKey} import quizleague.domain.Ref import quizleague.web.names.ComponentNames import scala.scalajs.js.JSConverters._ impo...
gumdrop/quizleague-maintain
js/src/main/scala/quizleague/web/service/chat/ChatMessageService.scala
Scala
mit
1,667
package views.html import play.templates._ import play.templates.TemplateMagic._ import play.api.templates._ import play.api.templates.PlayMagic._ import models._ import controllers._ import play.api.i18n._ import play.api.mvc._ import play.api.data._ import views.html._ /* * This template takes a single argument, ...
trask/glowroot
agent/plugins/play-plugin/src/test/app-2.2.x-scala/scala/views/html/index.template.scala
Scala
apache-2.0
2,017
package com.peterpotts.common.sample class SampleIdentity[A](sampleA: Sample[A]) extends Sample[A] { def next(): A = sampleA.next() }
peterpotts/mobius
src/main/scala/com/peterpotts/common/sample/SampleIdentity.scala
Scala
mit
137
/* * MOIS: Reaction Network * Copyright (C) 2014 University of Edinburgh School of Informatics * * 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 *...
edinburgh-rbm/mois
src/main/scala/uk/ac/ed/inf/mois/reaction/ReactionNetwork.scala
Scala
gpl-3.0
4,485
/* * Copyright (C) 2016-2020 Lightbend Inc. <https://www.lightbend.com> */ package akka.persistence.cassandra.snapshot import scala.compat.java8.FutureConverters._ import scala.concurrent.ExecutionContext import scala.concurrent.Future import akka.Done import akka.annotation.InternalApi import akka.event.LoggingAd...
chbatey/akka-persistence-cassandra
core/src/main/scala/akka/persistence/cassandra/snapshot/CassandraSnapshotStatements.scala
Scala
apache-2.0
4,470
/* * Copyright 2014–2020 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...
slamdata/quasar
qsu/src/main/scala/quasar/qsu/minimizers/MergeCartoix.scala
Scala
apache-2.0
31,750
package io.hydrosphere.mist.master.execution.status import akka.actor.ActorSystem import io.hydrosphere.mist.core.logging.LogEvent import io.hydrosphere.mist.master.{EventsStreamer, JobDetails} import io.hydrosphere.mist.master.Messages.StatusMessages._ import io.hydrosphere.mist.master.logging.LogService import io.hy...
Hydrospheredata/mist
mist/master/src/main/scala/io/hydrosphere/mist/master/execution/status/StatusReporter.scala
Scala
apache-2.0
1,251
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
maropu/spark
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala
Scala
apache-2.0
50,979
package lila.history import scala.concurrent.duration._ import scala.math.round import org.joda.time.DateTime import play.api.libs.json._ import lila.rating.{ Glicko, PerfType } import lila.user.{ User, Perfs } final class RatingChartApi( historyApi: HistoryApi, mongoCache: lila.memo.MongoCache.Builder, ...
Happy0/lila
modules/history/src/main/RatingChartApi.scala
Scala
mit
1,634
package org.jetbrains.plugins.scala.codeInsight.implicits.menu import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent, CommonDataKeys} import org.jetbrains.plugins.scala.codeInsight.implicits.{Hint, MouseHandler} import org.jetbrains.plugins.scala.extensions.inWriteCommandAction class RemoveExplicitArgumen...
jastice/intellij-scala
scala/scala-impl/src/org/jetbrains/plugins/scala/codeInsight/implicits/menu/RemoveExplicitArguments.scala
Scala
apache-2.0
719
package io.getquill import io.getquill.context.sql.idiom.SqlIdiom import io.getquill.context.sql.idiom.QuestionMarkBindVariables import io.getquill.context.sql.idiom.ConcatSupport trait MirrorSqlDialect extends SqlIdiom with QuestionMarkBindVariables with ConcatSupport object MirrorSqlDialect extends MirrorSql...
mentegy/quill
quill-sql/src/main/scala/io/getquill/MirrorSqlDialect.scala
Scala
apache-2.0
390
package aims.samples import aims.MicroServiceSystem import aims.samples.services.CouponOperationResource import akka.actor.ActorSystem import akka.stream.FlowMaterializer import akka.util.Timeout import scala.concurrent.duration._ /** * Component: * Description: * Date: 2014/12/26 * @author Andy Ai */ object Ma...
aiyanbo/aims
aims-samples/src/main/scala/aims/samples/Main.scala
Scala
mit
612
package chandu0101.scalajs.react.components.demo.util /** * Created by chandrasekharkode . */ object SampleData { val personJson = """ |[{"fname":"Joshua","lname":"Myers","email":"jmyers0@trellian.com","country":"France"}, |{"fname":"Gloria","lname":"Porter","email":"gporter1@hatena.ne.jp","countr...
coreyauger/scalajs-react-components
demo/src/main/scala/chandu0101/scalajs/react/components/demo/util/SampleData.scala
Scala
apache-2.0
20,963
package com.geeksville.json import org.json4s.CustomSerializer import java.util.UUID import org.json4s.JsonAST._ object UUIDSerializer extends CustomSerializer[UUID](format => ( { case JString(s) => UUID.fromString(s) }, { case x: UUID => JString(x.toString) }))
dronekit/dronekit-server
src/main/scala/com/geeksville/json/UUIDSerializer.scala
Scala
gpl-3.0
292
package com.tozny import java.util.Date import org.apache.commons.codec.binary.Base64.decodeBase64 import play.api.libs.json.Json.toJson import play.api.libs.json.{JsObject, JsValue, Reads, Writes} import scala.concurrent.{Await, Future, ExecutionContext} import scala.concurrent.duration._ import scala.util.{Failur...
tozny/sdk-scala
src/main/scala/com/tozny/Realm.scala
Scala
apache-2.0
2,190
package parsers.exercises import scala.util.parsing.combinator.JavaTokenParsers trait Exercise3 extends JavaTokenParsers { def alt[A](p1: => Parser[A], p2: => Parser[A]): Parser[A] = sys.error("TODO") }
julienrf/scala-lessons
highlights/parsers/code/src/main/scala/parsers/exercises/Exercise3.scala
Scala
mit
208
package repositories.musitobject.dao object SearchFieldValues { sealed trait IntervalBoundary {} case class Value(v: Long) extends IntervalBoundary case class Infinite() extends IntervalBoundary def boundaryAsString(intervalBoundary: IntervalBoundary) = { intervalBoundary match { case Value(v) ...
MUSIT-Norway/musit
service_backend/app/repositories/musitobject/dao/SearchFieldValues.scala
Scala
gpl-2.0
1,124
package text.vector import util.Config /** * @author ynupc * Created on 2016/05/22 */ object VectorType extends Enumeration { val None, Binary, Frequency = Value def get: VectorType.Value = { if (Config.isFrequencyOtherwiseBinary) { Frequency } else { Binary } } }
ynupc/scalastringcourseday6
src/main/scala/text/vector/VectorType.scala
Scala
apache-2.0
315
package org.scalajs.openui5.sap.ui.core import org.scalajs.dom import org.scalajs.openui5.sap.ui.base.Object import scala.scalajs.js import scala.scalajs.js.annotation.JSName import scala.scalajs.js.| @JSName("sap.ui.core.RenderManager") @js.native /** RenderManager that will take care for rendering Controls. * ...
lastsys/scalajs-openui5
src/main/scala/org/scalajs/openui5/sap/ui/core/RenderManager.scala
Scala
mit
9,468
/** * Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.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 * *...
Tjoene/thesis
Case_Programs/gatling-1.4.0/gatling-http/src/main/scala/com/excilys/ebi/gatling/http/check/after/HttpBodyResponseTimeCheckBuilder.scala
Scala
gpl-2.0
2,152
/* * Copyright 2015-2016 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
xin-cai/openwhisk
core/controller/src/main/scala/whisk/core/controller/WebActions.scala
Scala
apache-2.0
30,415
/*********************************************************************** * Copyright (c) 2013-2020 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...
aheyne/geomesa
geomesa-lambda/geomesa-lambda-datastore/src/main/scala/org/locationtech/geomesa/lambda/stream/stats/TransientStats.scala
Scala
apache-2.0
3,513
package org.scalacoin.marshallers.transaction import org.scalacoin.protocol.transaction.TransactionInput import org.scalatest.{MustMatchers, FlatSpec} import spray.json._ import DefaultJsonProtocol._ /** * Created by chris on 12/27/15. */ class TransactionInputMarshallerTest extends FlatSpec with MustMatchers { v...
scalacoin/scalacoin
src/test/scala/org/scalacoin/marshallers/transaction/TransactionInputMarshallerTest.scala
Scala
mit
3,104
/* * 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 ...
minixalpha/spark
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/RateSourceSuite.scala
Scala
apache-2.0
7,166
package cromwell.engine.workflow import akka.actor.ActorSystem import cromwell.core.WorkflowId import cromwell.engine import cromwell.engine._ import cromwell.engine.backend.{CallMetadata, WorkflowDescriptor} import cromwell.engine.db.slick._ import cromwell.engine.db.{ExecutionDatabaseKey, ExecutionInfosByExecution} ...
cowmoo/cromwell
engine/src/main/scala/cromwell/engine/workflow/WorkflowMetadataBuilder.scala
Scala
bsd-3-clause
7,302
package com.datlinq.datafiniti.config import com.datlinq.datafiniti.config.DatafinitiAPITypes._ /** * Created by Tom Lous on 30/08/2017. * Copyright © 2017 Datlinq B.V.. */ object DatafinitiAPIViewsV4 { sealed trait APIViewV4 { def name: String def apiType: APIType override def toString: Strin...
datlinq/scalafiniti
src/main/scala/com/datlinq/datafiniti/config/DatafinitiAPIViewsV4.scala
Scala
mit
3,299
package gapt.proofs.lkt import gapt.cutintro.CutIntroduction import gapt.examples.{ Pi2Pigeonhole, Pi3Pigeonhole, nTape4 } import gapt.expr.{ normalize => norm, _ } import gapt.expr.formula.hol.containsQuantifierOnLogicalLevel import gapt.proofs.context.Context import gapt.proofs.lk.transformations.eliminateDefinition...
gapt/gapt
tests/src/test/scala/gapt/proofs/lkt/LktTest.scala
Scala
gpl-3.0
3,173
/* * Copyright 2016 The BigDL Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
intel-analytics/BigDL
scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/nn/keras/UpSampling1DSpec.scala
Scala
apache-2.0
1,818
import scala.reflect.{ClassTag, classTag} class Foo[@specialized A: ClassTag] { // conflicting in bounds, expect a normalized member calling m // and bridge + implementation in specialized subclasses // and overloads here according to specialization on A def m1[@specialized B <: A](x: B, y: A) = goal(x) ...
yusuke2255/dotty
tests/untried/pos/spec-params-new.scala
Scala
bsd-3-clause
1,123
/* * 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 ...
lhaiesp/samza
samza-kafka/src/test/scala/org/apache/samza/system/kafka/TestKafkaSystemFactory.scala
Scala
apache-2.0
3,547
/** * Copyright 2011-2016 GatlingCorp (http://gatling.io) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
GabrielPlassard/gatling
gatling-recorder/src/main/scala/io/gatling/recorder/http/HttpProxy.scala
Scala
apache-2.0
2,469
/* * Copyright (c) 2014-2021 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...
monixio/monix
monix-reactive/shared/src/test/scala/monix/reactive/consumers/LoadBalanceConsumerSuite.scala
Scala
apache-2.0
11,295
package scalapb.grpc import io.grpc.StatusException import io.grpc.stub.StreamObserver import org.mockito.{ArgumentMatchers, Mockito} import org.mockito.Mockito.mock import scala.util.{Failure, Success} import munit.FunSuite class GrpcSpec extends FunSuite { test("Complete observer should wrap an exception as a St...
scalapb/ScalaPB
scalapb-runtime-grpc/src/test/scala/scalapb/grpc/GrpcSpec.scala
Scala
apache-2.0
965
import scala.collection.mutable.ListBuffer object Solution { private val inverse = Map[Char,Char](']' -> '[',')' -> '(', '}' -> '{') private def balanced(s: String): Boolean = { val l = new ListBuffer[Char]() for(c <- s) c match { case lparen @ ('['|'('|'{') => lparen +=: l case rparen @ (']...
marcos-sb/hacker-rank
data-structures/stacks/balanced-parentheses/Solution.scala
Scala
apache-2.0
685
/* * Copyright 2014 Netflix, 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 t...
ouyangkongtong/archaius
archaius-scala/src/test/scala/com/netflix/config/scala/DynamicFloatPropertyTest.scala
Scala
apache-2.0
1,178
/*§ =========================================================================== EighthBridge =========================================================================== Copyright (C) 2016 Gianluca Costa =========================================================================== Licensed under the Apache Lic...
giancosta86/EighthBridge
src/main/scala/info/gianlucacosta/eighthbridge/graphs/point2point/visual/VisualLink.scala
Scala
apache-2.0
1,498
trait Bifunctor[F[_, _]] { def bimap[A, B, C, D](g: A => C)(h: B => D): F[A, B] => F[C, D] = first(g) compose second(h) def first[A, B, C](g: A => C): F[A, B] => F[C, B] = bimap(g)(identity[B]) def second[A, B, D](h: B => D): F[A, B] => F[A, D] = bimap(identity[A])(h) }
hmemcpy/milewski-ctfp-pdf
src/content/1.8/code/scala/snippet01.scala
Scala
gpl-3.0
290
// Scala for the Impatient / Chapter 9 / Exercise 2: // Write a Scala program that reads a file with tabs, replaces each tab with spaces so that tab // stops are at n-column boundaries, and writes the result to the same file. import java.io.File import java.nio.file.Paths import scala.collection.JavaConverters._ impo...
eallik/scalaimpatient
chapter09/ex02.scala
Scala
unlicense
1,664
// // ChannelType.scala -- Scala object ChannelType // Project OrcScala // // $Id: BoundedChannelType.scala 2933 2011-12-15 16:26:02Z jthywissen $ // // Created by dkitchin on Dec 1, 2010. // // Copyright (c) 2011 The University of Texas at Austin. All rights reserved. // // Use and redistribution of this file is gover...
laurenyew/cOrcS
src/orc/lib/state/types/BoundedChannelType.scala
Scala
bsd-3-clause
1,379
package com.marketmaker.formula /** * Created by wacharint on 5/19/15. */ import java.util.Date import com.marketmaker.helper.{Configuration, RepositoryHelper} import com.marketmaker.math._ import com.marketmaker.repositories.{OrderValue, Order, Strategy, Phy} trait FormulaCalculatorTrait extends MarketParameters...
ougnt/StrategiesGenerator
src/main/scala/com/marketmaker/formula/FormulaCalculator.scala
Scala
mit
14,435
package ch.bsisa.hyperbird.patman.simulations.model import ch.bsisa.hyperbird.Implicits._ import ch.bsisa.hyperbird.dao.ElfinDAO import ch.bsisa.hyperbird.model.ELFIN import ch.bsisa.hyperbird.model.format.ElfinFormat import ch.bsisa.hyperbird.model.format.Implicits._ import ch.bsisa.hyperbird.patman.simulations.Cons...
bsisa/hb-api
app/ch/bsisa/hyperbird/patman/simulations/model/HospitalHelper.scala
Scala
gpl-2.0
41,640
package org.jetbrains.plugins.scala import com.intellij.openapi.extensions.ExtensionPointName import scala.jdk.CollectionConverters._ /** * Handy base class for declaring extension points. */ abstract class ExtensionPointDeclaration[T](private val name: String) { private val extensionPointName = ExtensionPointN...
JetBrains/intellij-scala
scala/scala-impl/src/org/jetbrains/plugins/scala/ExtensionPointDeclaration.scala
Scala
apache-2.0
435
//############################################################################ // Serialization //############################################################################ object Serialize { @throws(classOf[java.io.IOException]) def write[A](o: A): Array[Byte] = { val ba = new java.io.ByteArrayOutputStream(...
lampepfl/dotty
tests/run/serialization-new.scala
Scala
apache-2.0
14,415
/* ************************************************************************************* * 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-core/src/main/scala/com/normation/rudder/services/policies/DeploymentService.scala
Scala
agpl-3.0
38,506
/* * Copyright (c) 2012 Dame Ningen. * All rights reserved. * * This file is part of Gausel. * * Gausel 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 o...
Uchuu/Gausel
trunk/src/main/scala/lib/Library.scala
Scala
gpl-3.0
1,529
package io.github.yzernik.bitcoinscodec.messages import io.github.yzernik.bitcoinscodec.CodecSuite import io.github.yzernik.bitcoinscodec.structures._ import scodec.bits.ByteVector class GetBlocksSpec extends CodecSuite { val getblocks = GetBlocks( 1L, List(Hash(ByteVector.fill(32)(0x42))), Hash(ByteVe...
yzernik/bitcoin-scodec
src/test/scala/io/github/yzernik/bitcoinscodec/messages/GetBlocksSpec.scala
Scala
mit
521
/* * 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 ...
yanboliang/spark
resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/BasicTestsSuite.scala
Scala
apache-2.0
4,419
package isabelle.eclipse.launch.actions import org.eclipse.debug.ui.actions.OpenLaunchDialogAction import isabelle.eclipse.launch.IsabelleLaunchConstants.ISABELLE_LAUNCH_GROUP /** * Opens the launch config dialog on the Isabelle configurations launch group. */ class OpenIsabelleLaunchConfigurations extends OpenLa...
andriusvelykis/isabelle-eclipse
isabelle.eclipse.launch/src/isabelle/eclipse/launch/actions/OpenIsabelleLaunchConfigurations.scala
Scala
epl-1.0
360
/* * 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
util/SparkUncaughtExceptionHandler.scala
Scala
apache-2.0
2,350
/* * Copyright 2009-2010 LinkedIn, 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 ...
thesiddharth/norbert
cluster/src/main/scala/com/linkedin/norbert/cluster/memory/InMemoryClusterClient.scala
Scala
apache-2.0
1,034
package com.ubeeko.htalk.hbase import org.apache.hadoop.hbase._ import org.apache.hadoop.hbase.client.{BufferedMutator, Table} case class HTalkOptions(prefix: Option[String] = None) class HTalkContext(val hbaseManager: HBaseManager, val options: Option[HTalkOptions]) extends AutoCloseable { final def tableName...
eric-leblouch/htalk
src/main/scala/com/ubeeko/htalk/hbase/HTalkContext.scala
Scala
apache-2.0
1,708
/* * 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 ...
dbtsai/spark
core/src/main/scala/org/apache/spark/scheduler/ExecutorLossReason.scala
Scala
apache-2.0
2,594
// 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. // You may obtain a copy of the License at // // http://www.apache...
scray/scray
scray-hdfs/modules/scray-hdfs-writer/src/main/scala/scray/hdfs/io/configure/CoordinatedWriterConf.scala
Scala
apache-2.0
8,298
/* * 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 ...
mahak/spark
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala
Scala
apache-2.0
49,042
package sample.stream.experiments import akka.actor.ActorSystem import akka.stream.ActorMaterializer import akka.stream.scaladsl._ final case class Author(handle: String) final case class Hashtag(name: String) final case class Tweet(author: Author, timestamp: Long, body: String) { def hashtags: Set[Hashtag] = ...
pallavig/akka-examples
src/main/scala/sample/stream/experiments/ReactiveTweets.scala
Scala
cc0-1.0
3,859
object Test { def foo() { try { for (i <- 1 until 5) return } catch { case _: NullPointerException | _: RuntimeException => // was: "catch block may intercept non-local return from method check" } } }
loskutov/intellij-scala
testdata/scalacTests/pos/t7433.scala
Scala
apache-2.0
237
/* * Copyright 2022 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/vat-registration-frontend
app/common/enums/VatRegStatus.scala
Scala
apache-2.0
990
package geek.lawsof.physics.lib.block.te.nbt import net.minecraft.nbt.NBTTagCompound /** * Created by anshuman on 28-05-2014. */ trait ISyncableObject { def writeToNBT(nbt: NBTTagCompound, name: String) def readFromNBT(nbt: NBTTagCompound, name: String) var dirty = false def markDirty() = dirty = true ...
GeckoTheGeek42/TheLawsOfPhysics
src/main/scala/geek/lawsof/physics/lib/block/te/nbt/ISyncableObject.scala
Scala
mit
695
package edu.mit.cci.wikilanguage.main import java.util.concurrent.Executors import edu.mit.cci.wikilanguage.db.DAO import edu.mit.cci.wikilanguage.wiki.{PersonLinkAnnotationProcessor, PersonLinkProcessor} /** * @author pdeboer * First created on 04/12/13 at 11:56 */ object PersonLinkAnnotator extends App {...
pdeboer/wikilanguage
src/main/scala/edu/mit/cci/wikilanguage/main/PersonLinkAnnotator.scala
Scala
mit
686