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 |
|---|---|---|---|---|---|
// scalac: -opt:l:inline -opt-inline-from:**
//
/*
* filter: optimizer warnings;
*/
import java.lang.Thread.holdsLock
import scala.collection.mutable.StringBuilder
object Util {
def checkLocks(held: AnyRef*)(notHeld: AnyRef*) = {
val sb = new StringBuilder
for (lock <- held) {
sb.append(if (holdsLock... | lrytz/scala | test/files/run/synchronized.scala | Scala | apache-2.0 | 19,276 |
package source
import akka.NotUsed
import akka.stream.scaladsl.Source
import logic._
import logic.game._
object InitialGameStateSource {
def getInitialGameStateSource: Source[GameState, NotUsed] = Source.single(
Running(
foodPosition = initialFoodPosition,
snake = initialSnake,
seed = initialS... | margorczynski/stateless-snake | src/main/scala/source/InitialGameStateSource.scala | Scala | apache-2.0 | 709 |
package org.f100ded.play.fakews
import akka.stream.Materializer
import akka.stream.scaladsl.Source
import akka.util.ByteString
import play.api.libs.ws.{EmptyBody, InMemoryBody, SourceBody, WSBody}
import scala.concurrent.Await
import scala.concurrent.duration._
private[fakews] object BodyUtils {
def bodyAsBytes(b... | f100ded/play-fake-ws-standalone | src/main/scala/org/f100ded/play/fakews/BodyUtils.scala | Scala | apache-2.0 | 918 |
package views.forms
import views.html.helper.FieldElements
object FormHelpers {
import views.html.helper.FieldConstructor
implicit val bootstrapVerticalFormFieldConstructor =
FieldConstructor(views.html.forms.bootstrapVerticalFormFieldConstrutor.f)
} | Bhashit/play-commerce | app/views/forms/FormHelpers.scala | Scala | mit | 261 |
package com.celexus.conniption
import org.scalatest.junit.AssertionsForJUnit
import org.junit.Test
import org.junit.Assert._
class TradeKingAPITest extends AssertionsForJUnit {
@Test
def params = {
val tk = new TradeKingAPI
assertEquals(tk.getAccessTokenEndpoint, "https://developers.tradeking.com/oauth/a... | Ccook/conniption4s | src/test/scala/com/celexus/conniption/TradeKingAPITest.scala | Scala | apache-2.0 | 555 |
package controllers
import ornicar.scalalib.Zero
import play.api.data._
import play.api.data.Forms._
import play.api.mvc._
import scala.annotation.nowarn
import views._
import lila.api.{ BodyContext, Context }
import lila.app._
import lila.chat.Chat
import lila.common.{ EmailAddress, HTTPRequest, IpAddress }
import l... | luanlv/lila | app/controllers/Mod.scala | Scala | mit | 21,028 |
package notebook
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpec}
class JobTrackingTests extends WordSpec with Matchers with BeforeAndAfterAll {
"encodes jobGroup" in {
JobTracking.jobGroupId(cellId = "abc") shouldBe "cell-abc"
}
"decodes cellId" in {
JobTracking.toCellId(Option("cell-abc")... | andypetrella/spark-notebook | test/notebook/JobTrackingTests.scala | Scala | apache-2.0 | 959 |
/**
* 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 not... | guozhangwang/kafka | core/src/test/scala/integration/kafka/api/SaslMultiMechanismConsumerTest.scala | Scala | apache-2.0 | 4,486 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.sbt.routes
import play.routes.compiler.RoutesCompiler.GeneratedSource
import sbt._
import xsbti.Position
import java.util.Optional
import scala.collection.mutable
import scala.language.implicitConversions
/**
* Fix compatibil... | Shenker93/playframework | framework/src/sbt-plugin/src/main/scala-sbt-1.0/play/sbt/routes/RoutesCompilerCompat.scala | Scala | apache-2.0 | 1,995 |
package services
import play.api.mvc.{Security, Action, Controller}
import play.modules.reactivemongo.MongoController
import play.api.libs.concurrent.Execution.Implicits._
import play.api.Logger
import play.modules.reactivemongo.json.BSONFormats
import play.api.libs.json._
import play.api.libs.json.Json._
import scala... | michaelahlers/team-awesome-wedding | app/services/Statistics.scala | Scala | mit | 1,958 |
package org.openurp.edu.eams.teach.lesson.service.limit.impl
import org.openurp.edu.teach.lesson.LessonLimitMeta
import org.openurp.edu.eams.teach.lesson.service.limit.LessonLimitMetaFilter
import org.openurp.edu.teach.lesson.LessonLimitMeta.LimitMeta
import org.openurp.edu.eams.teach.lesson.service.limit.LessonLimitM... | openurp/edu-eams-webapp | core/src/main/scala/org/openurp/edu/eams/teach/lesson/service/limit/impl/DefaultCourseLimitMetaEnumProvider.scala | Scala | gpl-3.0 | 1,657 |
/*
* 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 | sql/core/src/main/scala/org/apache/spark/sql/jdbc/TeradataDialect.scala | Scala | apache-2.0 | 2,140 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package expr
import com.intellij.psi.{PsiAnnotationMemberValue, PsiElement}
import org.jetbrains.plugins.scala.lang.parser.ScalaElementTypes
import org.jetbrains.plugins.scala.lang.psi.api.base.ScConstructor
import org.jetbrains.plugins.scala.lan... | LPTK/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/expr/ScAnnotationExpr.scala | Scala | apache-2.0 | 1,525 |
package examples
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class ConstantUsersSimulation extends Simulation {
val httpProtocol = http.baseURL("https://www.google.com")
val numberOfUsers = 10
val duration = 10
val scn = scenario("Constant Users traffi... | stelmod/gatling-quickstart | src/test/scala/examples/ConstantUsersSimulation.scala | Scala | mit | 512 |
package lore.compiler.semantics.modules
import lore.compiler.core.Position
import lore.compiler.semantics.modules.LocalModule.ImportMap
import lore.compiler.semantics.{NameKind, NamePath}
import lore.compiler.syntax.DeclNode
/**
* A LocalModule is a lexical object that contains the import maps and names of local de... | marcopennekamp/lore | compiler/src/lore/compiler/semantics/modules/LocalModule.scala | Scala | mit | 3,628 |
class DelayedInit2 extends DelayedInit {
println("in constructor")
var initialization: () => Unit = _
override def delayedInit(body: => Unit) {
initialization = () => body
}
}
| grzegorzbalcerek/scala-book-examples | examples/DelayedInit2.scala | Scala | mit | 188 |
package com.twitter.finatra.multiserver.CombinedServer
import javax.inject.Singleton
@Singleton
class AdderService {
def add1(number: Int): Int = {
number + 1
}
def add1String(number: String): String = {
(number.toInt + 1).toString
}
}
| syamantm/finatra | inject-thrift-client-http-mapper/src/test/scala/com/twitter/finatra/multiserver/CombinedServer/AdderService.scala | Scala | apache-2.0 | 256 |
package hr.element.beepo.client
import email._
import sms._
import io._
import xml._
sealed trait Action
case object Persist extends Action
case object Send extends Action {
def apply(id: String, otherIDs: String*): Send =
Send(id +: otherIDs)
}
case class Send(val ids: Seq[String]) extends xml.SendXMLConvert... | element-doo/beepo | code/scala/client/src/main/scala/hr/element/beepo/client/Task.scala | Scala | bsd-3-clause | 1,403 |
package main
import util.control.Exception.allCatch
/**
* @author Tobin Yehle
*/
object Main {
def main(args: Array[String]): Unit =
parseCommandLine(args).extract(println(s"Got ${args.mkString(", ")}, expected a single number"),
n => println(largestPalindrome(n)))
/** De... | tyehle/programming-studio | 2017-W27/tobin/src/main/scala/main/Main.scala | Scala | mit | 1,760 |
/*
* 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 ... | PredictionIO/PredictionIO | core/src/main/scala/org/apache/predictionio/controller/Metric.scala | Scala | apache-2.0 | 8,129 |
/**
* © 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... | e-orz/CM-Well | server/cmwell-common/src/main/scala/cmwell/common/formats/AbstractJsonSerializer.scala | Scala | apache-2.0 | 1,669 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | mdedetrich/scala-js | scalalib/overrides/scala/Symbol.scala | Scala | bsd-3-clause | 3,678 |
package safe.dsp
import safe.SafeVector
/**
* Functions for calculating spectral shape statistics including:
* $ - Centroid
* $ - Spread
* $ - Skewness
* $ - Kurtosis
*
* Based on spectral shape parameters outlined in:
*
* 1. "Automatic Transcription of Drum Loops"
* O. Gillet and G. Richard
* ... | devonbryant/safe | safe-core/src/main/scala/safe/dsp/SpectralShape.scala | Scala | epl-1.0 | 2,061 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogdebugger/ui/fieldvisualizations/symmetrictensor/SticknessOrientationSubpanel.scala | Scala | apache-2.0 | 4,508 |
////////////////////////////////////////////////////////////////////////////////
// //
// OpenSolid is a generic library for the representation and manipulation //
// of geometric objects such as points, curves, surfaces, and volumes. ... | ianmackenzie/opensolid-core | src/main/scala/org/opensolid/core/Interval.scala | Scala | mpl-2.0 | 20,109 |
package com.mogproject.mogami.core.attack
import com.mogproject.mogami._
/**
*
*/
trait DirectAttack {
def getDirectAttack(piece: Piece, square: Square): BitBoard =
baseAttack.getOrElse(piece.ptype, baseAttack(GOLD)).flipByPlayer(piece.owner).shiftRight(5 - square.file).shiftUp(5 - square.rank)
private[t... | mogproject/mog-core-scala | shared/src/main/scala/com/mogproject/mogami/core/attack/DirectAttack.scala | Scala | apache-2.0 | 972 |
package fpinscala.gettingstarted
// A comment!
/* Another comment */
/** A documentation comment */
object MyModule {
def abs(n: Int): Int =
if (n < 0) -n
else n
private def formatAbs(x: Int) = {
val msg = "The absolute value of %d is %d"
msg.format(x, abs(x))
}
def main(args: Array[String]):... | fpinscala-muc/fpinscala-g-fresh | exercises/src/main/scala/fpinscala/gettingstarted/GettingStarted.scala | Scala | mit | 5,366 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | travisbrown/scalatest | src/test/scala/org/scalatest/BeforeAndAfterAllConfigMapSpec.scala | Scala | apache-2.0 | 14,531 |
package mojave
import shapeless.Lens
trait Traversal[S, A] {
def modify(s: S)(f: A => A): S
def set(s: S)(x: A) = modify(s)(Function.const(x))
def compose[T](g: Traversal[T, S]) = {
val self = this
new Traversal[T, A] {
override def modify(t: T)(f: (A) => A): T = g.modify(t) { s: S => self.modif... | raimohanska/mojave | src/main/scala/mojave/Traversal.scala | Scala | mit | 2,795 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
import sbt._
object Generators {
// Generates a scala file that contains the Lagom version for use at runtime.
def version(lagomVersion: String, dir: File): Seq[File] = {
val file = dir / "com"/ "lightbend" / "lagom" / "core" / "Lagom... | rstento/lagom | project/Tasks.scala | Scala | apache-2.0 | 665 |
package puck.parser.gen
import puck.parser.{SymId, RuleSemiring, RuleStructure}
import scala.collection.JavaConverters._
import puck.linalg.CLMatrix
import com.nativelibs4java.opencl._
import org.bridj.Pointer
import java.util.zip.{ZipOutputStream, ZipFile}
import puck.util.{PointerFreer, ZipUtil}
import scala.Array
... | malcolmgreaves/puck | src/main/scala/puck/parser/gen/CLMaskKernels.scala | Scala | apache-2.0 | 8,333 |
package org.repwatch.alexa.handlers
import com.amazon.speech.speechlet.SpeechletResponse
import com.amazon.speech.ui.PlainTextOutputSpeech
import org.repwatch.alexa.FindRepresentativeIntent
import org.repwatch.models.User
import org.repwatch.repositories.LegislatorRepository
import scala.concurrent.Await
import scala... | csunwold/repwatch | alexa/src/main/scala/org/repwatch/alexa/handlers/FindRepresentativeIntentHandler.scala | Scala | gpl-3.0 | 1,162 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO2
package com.google.protobuf.descriptor
import _root_.scalapb.internal.compat.JavaConverters._
/** Describes a service.
*/
@SerialVersionUID(0L)
final case class ServiceDescriptorProto(
name: _root_.... | scalapb/ScalaPB | scalapb-runtime/src/main/scalajvm/com/google/protobuf/descriptor/ServiceDescriptorProto.scala | Scala | apache-2.0 | 12,083 |
package spire.algebra
import spire.math.{ Rational, NumberTag }
import spire.std.int._
import spire.std.long._
import spire.std.float._
import spire.std.double._
import spire.syntax.euclideanRing._
import spire.syntax.isReal.{ eqOps => _, _ }
import scala.reflect.ClassTag
import org.scalatest.FunSuite
import org.sca... | guersam/spire | tests/src/test/scala/spire/algebra/GCDTest.scala | Scala | mit | 2,127 |
package org.efset.writer
import org.efset.ContextConfig
import org.efset.Model.ModelThing
import org.efset.writer.ElasticsearchDataWriterComponent._
class TestSessionElasticsearchDataWriterComponent extends ElasticsearchDataWriterComponent {
override val dataWriter: DataWriter[ModelThing] = new ElasticsearchDataWr... | ef-ice/cassandra-exporter | src/main/scala/org/efset/writer/TestSessionElasticsearchDataWriterComponent.scala | Scala | mit | 403 |
/***********************************************************************
* 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-tools/src/main/scala/org/locationtech/geomesa/tools/export/ExportCommand.scala | Scala | apache-2.0 | 24,346 |
package org.scalarules.finance.nl
// scalastyle:off method.name
/**
* Representeert een periode in maanden.
*/
case class Periode private[finance](inMaanden: Int) {
require (inMaanden >= 0)
/** Returnt de som van deze periode en n. */
def + (n: Periode): Periode = Periode(inMaanden + n.inMaanden)
/** Retu... | scala-rules/finance-dsl | src/main/scala/org/scalarules/finance/nl/Periode.scala | Scala | mit | 1,475 |
/*
* Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
*
* 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
*
* Unles... | telefonicaid/fiware-cosmos-platform | ambari-service-manager/src/main/scala/es/tid/cosmos/servicemanager/ambari/AmbariDynamicPropertiesFactory.scala | Scala | apache-2.0 | 2,591 |
import leon.invariant._
import leon.instrumentation._
object BigNums {
sealed abstract class BigNum
case class Cons(head: BigInt, tail: BigNum) extends BigNum
case class Nil() extends BigNum
def incrTime(l: BigNum) : BigInt = {
l match {
case Nil() => 1
case Cons(x, tail) =>
if(x == 0)... | epfl-lara/leon | testcases/web/resourcebounds/11_Amortized_BigNums.scala | Scala | gpl-3.0 | 1,215 |
package pio.refactor
import io.prediction.controller.PDataSource
import io.prediction.controller.EmptyEvaluationInfo
import io.prediction.controller.EmptyActualResult
import io.prediction.controller.Params
import io.prediction.controller._
import io.prediction.data.storage.Event
import io.prediction.data.storage.Stora... | ch33hau/PredictionIO | examples/experimental/scala-refactor-test/src/main/scala/DataSource.scala | Scala | apache-2.0 | 1,373 |
package org.jetbrains.plugins.scala.project
import java.io.File
import com.intellij.openapi.vfs.{VirtualFile, VirtualFileListener, VirtualFileSystem}
/**
* @author Pavel Fatin
*/
class AbsentLocalFile(url: String, path: String) extends VirtualFile {
def getName = throw new UnsupportedOperationException()
def ... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/project/AbsentLocalFile.scala | Scala | apache-2.0 | 2,766 |
package com.twitter.finagle.thrift.transport.netty4
import com.twitter.finagle.thrift.transport.ExceptionFactory
import io.netty.buffer.Unpooled
import io.netty.channel.{
ChannelHandler, ChannelHandlerContext, ChannelOutboundHandlerAdapter,
ChannelPromise, CombinedChannelDuplexHandler}
import io.netty.channel.Chan... | koshelev/finagle | finagle-thrift/src/main/scala/com/twitter/finagle/thrift/transport/netty4/ServerByteBufCodec.scala | Scala | apache-2.0 | 1,299 |
package arx.macros
import scala.annotation.Annotation
/**
* Any field annotated with this will be ignored by the @NetworkedAuxData annotation when it modifies a class. We use
* this on fields that do not warrant a full sync when they change, or fields that we manage manually.
*/
class NonTriggering extends Annotat... | nonvirtualthunk/arx-macros | src/main/scala/arx/macros/NonTriggering.scala | Scala | apache-2.0 | 324 |
/*
* 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 ... | greghogan/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/utils/TableTestBase.scala | Scala | apache-2.0 | 44,306 |
package drt.client.services
import drt.client.SPAMain
import drt.client.logger.LoggerFactory
import drt.client.logger.log
import drt.client.modules.GoogleEventTracker
import org.scalajs.dom
import org.scalajs.dom.Event
object ErrorHandler {
def registerGlobalErrorHandler(): Unit = {
LoggerFactory.getLogger("Err... | UKHomeOffice/drt-scalajs-spa-exploration | client/src/main/scala/drt/client/services/ErrorHandler.scala | Scala | apache-2.0 | 1,143 |
object Macros {
def foo(x: Any) = macro Impls.foo
}
object Test extends App {
import Macros._
foo(x)
} | felixmulder/scala | test/files/neg/macro-noexpand/Macros_Test_2.scala | Scala | bsd-3-clause | 109 |
package com.michalrus.nofatty.ui
import java.awt.{ BorderLayout, Dimension, Toolkit }
import javax.swing._
import com.michalrus.nofatty.Logging
import com.michalrus.nofatty.data.{ Days, Products }
import com.michalrus.nofatty.ui.utils._
import org.jfree.chart.ChartPanel
import org.joda.time.LocalDate
object Ui exten... | michalrus/nofatty | src/main/scala/com/michalrus/nofatty/ui/Ui.scala | Scala | apache-2.0 | 3,462 |
package uk.gov.bis.levyApiMock.actions
import play.api.mvc.Results._
import play.api.mvc.{ActionBuilder, Request, Result, WrappedRequest}
import uk.gov.bis.levyApiMock.data.oauth2.AuthRecord
import scala.concurrent.{ExecutionContext, Future}
case class AuthRequest[+A](authRecord: AuthRecord, request: Request[A]) ext... | SkillsFundingAgency/das-alpha-hmrc-api-mock | src/main/scala/uk/gov/bis/levyApiMock/actions/AuthAction.scala | Scala | mit | 1,237 |
object Test {
def main(args: Array[String]): Unit = {
import scala.tools.reflect.ToolBox
val m = reflect.runtime.currentMirror
val u = m.universe
import u._
val tb = m.mkToolBox();
tb.compile(q"new p.Varargs(null, null)")
tb.compile(q"p.Varargs.staticMethod(null, null)")
tb.com... | felixmulder/scala | test/files/run/toolbox-varargs/Test.scala | Scala | bsd-3-clause | 381 |
package com.blinkbox.books.spray
import com.codahale.metrics.health.HealthCheck
import org.json4s.JsonAST.{JBool, JString}
import org.json4s.jackson.JsonMethods._
import org.mockito.Mockito.when
import org.scalatest.mock.MockitoSugar
import org.scalatest.{FunSuite, Matchers}
import spray.http.CacheDirectives._
import ... | blinkboxbooks/common-spray.scala | src/test/scala/com/blinkbox/books/spray/HealthCheckHttpServiceTests.scala | Scala | mit | 4,346 |
/*
* Copyright 2012 Eike Kettner
*
* 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... | eikek/publet | auth/src/main/scala/org/eknet/publet/auth/store/PermissionStore.scala | Scala | apache-2.0 | 1,433 |
package vexriscv
import spinal.core._
import spinal.lib.bus.bmb.{Bmb, BmbAccessCapabilities, BmbAccessParameter, BmbImplicitDebugDecoder, BmbInvalidationParameter, BmbParameter, BmbInterconnectGenerator}
import spinal.lib.bus.misc.AddressMapping
import spinal.lib.com.jtag.{Jtag, JtagTapInstructionCtrl}
import spinal.l... | SpinalHDL/VexRiscv | src/main/scala/vexriscv/VexRiscvBmbGenerator.scala | Scala | mit | 6,346 |
package im.actor.server.file.local.http
import java.time.{ Duration, Instant }
import akka.actor.ActorSystem
import akka.event.Logging
import akka.http.scaladsl.model.{ HttpResponse, StatusCodes }
import akka.http.scaladsl.model.StatusCodes.OK
import akka.http.scaladsl.model.headers.ContentDispositionTypes.attachment... | y0ke/actor-platform | actor-server/actor-fs-adapters/src/main/scala/im/actor/server/file/local/http/FilesHttpHandler.scala | Scala | agpl-3.0 | 5,067 |
/*
* Copyright 2015 – 2018 Paul Horn
*
* 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... | knutwalker/akka-stream-json | http-json/src/main/scala/de/knutwalker/akka/http/JsonSupport.scala | Scala | apache-2.0 | 3,399 |
package examples.demo
import java.awt.Dimension
import examples.demo.GModularClockCircle.Clock
import examples.demo.ui.ShapesPanel
import scala.swing.{MainFrame, SimpleSwingApplication, UIElement}
abstract class Main extends SimpleSwingApplication {
val panel: ShapesPanel
override lazy val top = {
panel.pr... | volkc/REScala | Examples/examples/src/main/scala/examples/demo/Main.scala | Scala | apache-2.0 | 704 |
/*
* 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 | core/src/test/scala/org/apache/spark/FutureActionSuite.scala | Scala | apache-2.0 | 1,773 |
/***********************************************************************
* Copyright (c) 2013-2022 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | locationtech/geomesa | geomesa-utils/src/test/scala/org/locationtech/geomesa/utils/conf/SemanticVersionTest.scala | Scala | apache-2.0 | 2,475 |
object Test {
def foo[A] = implicitly[OptManifest[A]] // was "unpositioned tree" under -Yrangepos
// These did not crash, but testing for good measure.
implicitly[OptManifest[String]]
implicitly[Manifest[String]]
implicitly[reflect.ClassTag[String]]
implicitly[reflect.runtime.universe.TypeTag[String]]
}
| loskutov/intellij-scala | testdata/scalacTests/pos/t8617.scala | Scala | apache-2.0 | 319 |
/*
*
* 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 writing, software
* distri... | flaminem/flamy | src/main/scala/com/flaminem/flamy/exec/hive/HiveRunner.scala | Scala | apache-2.0 | 12,816 |
/*
* Copyright 2014–2018 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... | jedesah/Quasar | foundation/src/main/scala/quasar/contrib/spire/random/dist.scala | Scala | apache-2.0 | 1,301 |
package org.amcgala.vr
import akka.actor.{ PoisonPill, ActorRef, ActorSystem, Props }
import scala.util.Random
import org.amcgala._
import org.amcgala.shape.Rectangle
import org.amcgala.math.Vertex3f
import org.amcgala.vr.building.{ BuildingType, TownHall, Building }
/**
* The absolute position of an entity in the ... | th-koeln/amcgala-vr | src/main/scala/org/amcgala/vr/Simulation.scala | Scala | apache-2.0 | 7,925 |
// Copyright 2014-2016 Leonardo Schwarz (leoschwarz.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 required by applicab... | evotopid/quest_on | src/main/scala/com/leoschwarz/quest_on/data/survey_ast/Page.scala | Scala | apache-2.0 | 2,548 |
/*
* 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/self-assessment-api | test/mocks/services/MockPropertyEopsObligationsService.scala | Scala | apache-2.0 | 1,434 |
package sampleclean.clean.extraction
import sampleclean.api.SampleCleanContext
import org.apache.spark.SparkContext._
import org.apache.spark.sql.SQLContext
import sampleclean.clean.algorithm.SampleCleanAlgorithm
import sampleclean.clean.algorithm.AlgorithmParameters
import org.apache.spark.rdd.RDD
import org.apache... | sjyk/sampleclean-async | src/main/scala/sampleclean/clean/extract/AbstractExtraction.scala | Scala | apache-2.0 | 2,592 |
package utilities
/**
* Created by weijiayi on 3/6/16.
*/
trait ChangeSource {
private val listeners = scala.collection.mutable.ListBuffer[ChangeListener]()
def addListener(l: ChangeListener) = {
listeners += l
l.editingUpdated()
}
def notifyListeners() = listeners.foreach(_.editingUpdated())
... | MrVPlusOne/Muse-CGH | src/utilities/ChangeSource.scala | Scala | mit | 699 |
/**
* This file is part of agora_elections.
* Copyright (C) 2014-2016 Agora Voting SL <agora@agoravoting.com>
* agora_elections 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... | agoravoting/agora_elections | app/commands/DemoVotes.scala | Scala | agpl-3.0 | 2,049 |
package org.coursera.naptime.courier
import com.linkedin.data.DataMap
import com.linkedin.data.codec.JacksonDataCodec
import com.linkedin.data.schema.RecordDataSchema
import com.linkedin.data.schema.TyperefDataSchema
import com.linkedin.data.schema.UnionDataSchema
import com.linkedin.data.template.DataTemplateUtil
imp... | josh-newman/naptime | naptime-models/src/test/scala/org/coursera/naptime/courier/CourierTestFixtures.scala | Scala | apache-2.0 | 15,031 |
package pl.iterators.kebs.support
import pl.iterators.kebs.macros.CaseClass1Rep
trait PartialOrderingSupport {
implicit def partialOrderingFromCaseClass1Rep[A, Rep](implicit cc1Rep: CaseClass1Rep[A, Rep],
partialOrderingRep: PartialOrdering[Rep]): PartialOrde... | theiterators/kebs | macro-utils/src/main/scala-3/pl/iterators/kebs/support/PartialOrderingSupport.scala | Scala | mit | 612 |
package monocle.function
import monocle.std.tuple2._
import monocle.{Iso, Lens}
import scala.annotation.implicitNotFound
@implicitNotFound("Could not find an instance of Cons1[${S}, ${H}, ${T}], please check Monocle instance location policy to " +
"find out which import is necessary")
trait Cons1[S, H, T] extends ... | malcolmgreaves/Monocle | core/src/main/scala/monocle/function/Cons1.scala | Scala | mit | 1,248 |
/*
* 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 ... | jiangxb1987/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/v2ResolutionPlans.scala | Scala | apache-2.0 | 6,910 |
/*
* 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 ... | godfreyhe/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/delegation/StreamPlanner.scala | Scala | apache-2.0 | 9,450 |
import sio.core._
import sio.teletype._
import sio.core.syntax.st._
object callbacks {
def func(f: () => Unit): Impure[Unit] = {
(0 until 3).foreach(_ => f())
}
def run: ST[RW, Unit] = for {
ref <- IORef.create(0)
cb <- ref.modify(_ + 1).map(_ => ()).asCallback
_ <- IO { func(cb) }
i <-... | alexknvl/sio | example/src/main/scala/callbacks.scala | Scala | mit | 378 |
/*
* Licensed to STRATIO (C) under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. The STRATIO (C) licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file... | ccaballe/crossdata | crossdata-driver/src/main/scala/com/stratio/crossdata/driver/BasicDriver.scala | Scala | apache-2.0 | 7,824 |
package es.pirita.techfest2015
/**
* @author Ignacio Navarro Martin
* @version 1.0
*/
object StringUtils{
implicit class StringImprove(val s: String){
def plusN(n: Int) : String = s"$s $n"
}
}
object Part9 extends App{
////
///Implicits
///
//View
//implicit def strToInt(x: String): Int = x.toI... | pirita/TechFest2015 | src/es/pirita/techfest2015/Part9.scala | Scala | apache-2.0 | 561 |
package org.jetbrains.plugins.scala.annotator.template
import org.jetbrains.plugins.scala.annotator.{AnnotatorTestBase, Error}
/**
* Pavel Fatin
*/
class ObjectCreationImpossibleTest extends AnnotatorTestBase(ObjectCreationImpossible) {
def testFineNew {
assertNothing(messages("class C; new C"))
assertNo... | LPTK/intellij-scala | test/org/jetbrains/plugins/scala/annotator/template/ObjectCreationImpossibleTest.scala | Scala | apache-2.0 | 2,708 |
/*
* Copyright (C) 2010 Lalit Pant <pant.lalit@gmail.com>
*
* The contents of this file are subject to the GNU General Public License
* Version 3 (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.gnu.org/copyleft/gpl.html
*
*... | dotta/kojo | KojoEnv/src/net/kogics/kojo/KojoCtx.scala | Scala | gpl-3.0 | 2,115 |
package mesosphere.marathon.upgrade
import com.wix.accord._
import mesosphere.marathon._
import mesosphere.marathon.api.v2.ValidationHelper
import mesosphere.marathon.state.AppDefinition.VersionInfo
import mesosphere.marathon.state.AppDefinition.VersionInfo.FullVersionInfo
import mesosphere.marathon.state.PathId._
imp... | timcharper/marathon | src/test/scala/mesosphere/marathon/upgrade/DeploymentPlanTest.scala | Scala | apache-2.0 | 20,454 |
package ohnosequences.tabula
case object attributes {
import ohnosequences.cosas._, typeUnions._, properties._
import scala.reflect.ClassTag
trait AnyAttribute extends AnyProperty {
// should be provieded implicitly:
val rawTag: ClassTag[Raw]
val validRaw: Raw isOneOf ValidValues
}
class Att... | ohnosequences/tabula | src/main/scala/tabula/attributes.scala | Scala | agpl-3.0 | 483 |
/*
* 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 ... | ueshin/apache-spark | core/src/test/scala/org/apache/spark/ui/UISuite.scala | Scala | apache-2.0 | 19,503 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/runtime/batch/sql/TableSourceITCase.scala | Scala | apache-2.0 | 3,650 |
package org.jetbrains.plugins.scala.annotator
class ScCharLiteralAnnotatorTest extends ScalaHighlightingTestBase {
def testEmptyCharLiteral(): Unit = {
val scalaText =
"""
|val test = ''
""".stripMargin
assertMatches(errorsFromScalaCode(scalaText)){
case Error("''", "Missing char v... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/annotator/ScCharLiteralAnnotatorTest.scala | Scala | apache-2.0 | 349 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogdebugger/ui/ProbeToolbar.scala | Scala | apache-2.0 | 1,513 |
package exercise.ex2
object SortUtil extends App {
def isSorted[A](as: Array[A], ordered: (A, A) => Boolean): Boolean = {
@annotation.tailrec
def loop(n: Int): Boolean = {
if (n >= as.length - 1) true
else if (ordered(as(n), as(n + 1))) loop(n + 1)
else false
}
loop(0)
}
}
| pluselc/fpinscala | src/main/scala/exercise/ex2/SortUtil.scala | Scala | mit | 314 |
import sbt._, Keys._
import bintray.BintrayKeys._
object Publish {
val coreSettings = Seq(
bintrayOrganization := Some("iheartradio"),
bintrayPackageLabels := Seq("play-framework", "swagger", "rest-api", "API", "documentation"),
publishMavenStyle := true,
licenses := Seq("Apache-2.0" -> url("https:/... | kbedel/play-swagger | project/Publish.scala | Scala | apache-2.0 | 871 |
package dotty.tools.dotc.config
object Printers {
class Printer {
def println(msg: => String): Unit = System.out.println(msg)
def echo[T](msg: => String, value: T): T = { println(msg + value); value }
}
object noPrinter extends Printer {
override def println(msg: => String): Unit = ()
override ... | reactormonk/dotty | src/dotty/tools/dotc/config/Printers.scala | Scala | bsd-3-clause | 978 |
package bbc.locator
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
class ReverseGeocode extends Simulation {
val httpProtocol = http
.baseURL("https://open.stage.bbc.co.uk")
.acceptHeader("application/xml")
val longLat = csv("locator/ds_030-points-210... | bestscarper/gatling-load-tests | src/test/scala/bbc/locator/ReverseGeocode.scala | Scala | apache-2.0 | 686 |
package scife
package enumeration
package benchmarks
import org.scalameter.api._
import org.scalameter.reporting.DsvReporter
import scife.{ enumeration => e }
import dependent._
import scife.util._
import scife.util.logging._
trait DependentMemoizedBenchmark[I, DepEnumType] extends PerformanceTest.OfflineReport
w... | kaptoxic/SciFe | src/test/scala/scife/enumeration/benchmarks/DependentBenchmark.scala | Scala | gpl-2.0 | 4,547 |
package app
import service._
import jp.sf.amateras.scalatra.forms._
import util.Implicits._
import util.StringUtil._
import util.Keys
class SignInController extends SignInControllerBase with SystemSettingsService with AccountService
trait SignInControllerBase extends ControllerBase { self: SystemSettingsSe... | loveshell/gitbucket | src/main/scala/app/SignInController.scala | Scala | apache-2.0 | 1,636 |
object igame_stub {
def main(args: Array[String]) {
// Put code here
}
}
| LoyolaChicagoBooks/introcs-scala-examples | igame_stub/igame_stub.scala | Scala | gpl-3.0 | 81 |
package blog
import skinny.orm._, feature._
import scalikejdbc._
import org.joda.time._
case class Tag(
id: Long,
name: String,
createdAt: DateTime,
updatedAt: Option[DateTime] = None
)
object Tag extends SkinnyCRUDMapper[Tag] with TimestampsFeature[Tag] {
override val connectionPoolName = Symbol("... | skinny-framework/skinny-framework | orm/src/test/scala/blog/Tag.scala | Scala | mit | 521 |
package com.geishatokyo.sqlgen.validator
import com.geishatokyo.sqlgen.SQLGenException
import com.geishatokyo.sqlgen.loader.CSVLoader
import com.geishatokyo.sqlgen.meta.{ColumnMeta, ExportStrategy, Metadata, SheetMeta}
import org.scalatest.{FlatSpec, Matchers}
/**
* Created by takezoux2 on 2017/07/06.
*/
class Me... | geishatokyo/sql-generator | src/test/scala/com/geishatokyo/sqlgen/validator/MetadataValidatorTest.scala | Scala | mit | 1,113 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | patverga/factorie | src/main/scala/cc/factorie/directed/DirectedFactor.scala | Scala | apache-2.0 | 7,652 |
package repositories.storage.dao.events
import com.google.inject.{Inject, Singleton}
import models.storage.event.EventTypeRegistry.TopLevelEvents
import models.storage.event.EventTypeRegistry.TopLevelEvents.{
MoveNodeType,
MoveObjectType
}
import models.storage.event.move._
import no.uio.musit.MusitResults.MusitRe... | MUSIT-Norway/musit | service_backend/app/repositories/storage/dao/events/MoveDao.scala | Scala | gpl-2.0 | 4,820 |
package org.gark87.yajom.macros
import org.gark87.yajom.base.BaseMapper
import language.experimental.macros
import scala.reflect.macros.Context
object Facade {
def yajomMap[T, F, M <: BaseMapper[_]](setter: (T) => _)(from: F)(implicit m: M): Unit = macro yajomMapImpl[T, F, M]
def yajom[T, M <: BaseMapper[_]](se... | gark87/yajom | yajom-macros/src/main/scala/org/gark87/yajom/macros/Facade.scala | Scala | mit | 3,505 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller, Zhe Jin
* @version 1.2
* @date Sat Jul 2 01:27:00 EDT 2016
* @see LICENSE (MIT style license file).
*/
package scalation.analytics.classifier
import scala.collection.mutable
//:::::::::::::::::::::... | NBKlepp/fda | scalation_1.2/src/main/scala/scalation/analytics/classifier/TabuFeatures.scala | Scala | mit | 1,813 |
/*
* Copyright 2010-2014 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed t... | sortable/framework | persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/PatternField.scala | Scala | apache-2.0 | 2,573 |
// Wei Chen - K Mean Cluster Test
// 2016-06-04
import com.scalaml.TestData._
import com.scalaml.general.MatrixFunc._
import com.scalaml.algorithm.KMean
import org.scalatest.funsuite.AnyFunSuite
class KMeanSuite extends AnyFunSuite {
val km = new KMean()
test("KMean Test : Clustering Tiny Data") {
as... | Wei-1/Scala-Machine-Learning | src/test/scala/algorithm/clustering/KMeanTest.scala | Scala | mit | 1,130 |
/*
* 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/aaa/bill/ColdRate.scala | Scala | apache-2.0 | 1,039 |
/*
* Copyright 2020 Precog Data
*
* 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 ... | djspiewak/quasar | frontend/src/main/scala/quasar/frontend/logicalplan/LogicalPlanR.scala | Scala | apache-2.0 | 6,935 |
package worker
import scala.collection.immutable.Queue
import akka.actor.Actor
import akka.actor.Terminated
import akka.actor.ActorLogging
import akka.actor.ActorRef
import akka.contrib.pattern.DistributedPubSubExtension
import akka.contrib.pattern.DistributedPubSubMediator
import akka.contrib.pattern.DistributedPubSu... | sriddell/akka-distributed-workers | src/main/scala/worker/Master.scala | Scala | cc0-1.0 | 5,740 |
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.