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 controllers
/*
* Copyright 2010 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... | wolfe-pack/moro | app/controllers/string.scala | Scala | bsd-2-clause | 5,266 |
import scala.tools.partest.SessionTest
// Taking unary ids as plain
object Test extends SessionTest
| scala/scala | test/files/run/t8918-unary-ids.scala | Scala | apache-2.0 | 102 |
package bhoot
import Utils._
case class Upload(id:Int, userId:Long, creator:String, createdAt:java.util.Date, viewCount:Int, viewLoggedCount:Int, descr:String)
case class Comment(screenName:String, comment:String)
/** Evertying related to the database */
object dbHelper {
import java.sql.ResultSet
private lazy ... | rocketeerbkw/tdash | framework/src/main/scala/db.scala | Scala | gpl-3.0 | 26,613 |
package scalacookbook.chapter11
/**
* Created by liguodong on 2016/7/31.
*/
object DeleteElementList extends App{
val originalList = List(5, 1, 4, 3, 2)
//List是不可变的,因此想要删除元素,需要过滤掉出想要的结果到一个新的变量。
val newList = originalList.filter(_ > 2) //List(5, 4, 3)
println(newList)
//ListBuffer
import scala.colle... | liguodongIOT/java-scala-mix-sbt | src/main/scala/scalacookbook/chapter11/DeleteElementList.scala | Scala | apache-2.0 | 847 |
/**
* 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... | Chasego/kafka | core/src/test/scala/unit/kafka/log/BrokerCompressionTest.scala | Scala | apache-2.0 | 3,726 |
/*
* 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/main/scala/org/apache/spark/rpc/RpcCallContext.scala | Scala | apache-2.0 | 1,885 |
package com.bostontechnologies.amqp
import com.typesafe.scalalogging.slf4j.Logging
import com.rabbitmq.client.AMQP.BasicProperties
import akka.pattern.ask
import scalaz._
import Scalaz._
import ChannelModel._
import ConsumerModel._
import ConnectionModel._
import akka.util.duration._
import akka.dispatch.Await
import ... | Forexware/scala-amqp | src/main/scala/com/bostontechnologies/amqp/Consumer.scala | Scala | apache-2.0 | 7,975 |
package au.id.cxd.math.example.probability.regression
import java.awt.GridLayout
import java.io.File
import javax.swing.JFrame
import au.id.cxd.math.data.MatrixReader
import au.id.cxd.math.example.charting.ChartHelper
import au.id.cxd.math.probability.regression.LogisticLeastSquares
import breeze.linalg.{DenseMatrix,... | cxd/scala-au.id.cxd.math | examples/src/test/scala/au/id/cxd/math/example/probability/regression/ExampleCarsLogitRegression.scala | Scala | mit | 6,432 |
package com.robocubs4205.cubscout.i18n
case class Configuration(
localeConfigs: Map[Locale,LocaleConfiguration],
fallbacks: Map[Either[Locale,String],Either[Locale,String]],
defaultLocale:Locale
) {
def +(configuration: Configuration) = Configuration(
for{
(locale1,config1) <- localeConfigs
(lo... | robocubs4205/cubscout-server | client/app/com/robocubs4205/cubscout/i18n/Configuration.scala | Scala | mit | 500 |
package io.getquill.context.jdbc.sqlite
import io.getquill.context.sql.OptionQuerySpec
import org.scalatest.matchers.should.Matchers._
class OptionJdbcSpec extends OptionQuerySpec {
val context = testContext
import testContext._
override def beforeAll = {
testContext.transaction {
testContext.run(qu... | getquill/quill | quill-jdbc/src/test/scala/io/getquill/context/jdbc/sqlite/OptionJdbcSpec.scala | Scala | apache-2.0 | 1,728 |
/**
* Copyright 2009 Google 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... | masterx2/noop | interpreter/src/main/scala/noop/types/NoopBoolean.scala | Scala | apache-2.0 | 1,884 |
package pl.touk.nussknacker.ui.api
import akka.http.scaladsl.server.{Directives, Route}
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport
import io.circe.{Decoder, Encoder}
import io.circe.generic.JsonCodec
import pl.touk.nussknacker.ui.config.{AnalyticsConfig, FeatureTogglesConfig}
import pl.touk.nussknacke... | TouK/nussknacker | ui/server/src/main/scala/pl/touk/nussknacker/ui/api/SettingsResources.scala | Scala | apache-2.0 | 4,020 |
package pong
import java.awt.Font
import java.io.File
import scala.swing.event.Key
object Pong {
// Game configurations
val DEF_WIDTH = 800
val DEF_HEIGHT = 600
val TIME_BETWEEN_FRAMES = 1f / 60f * 1000f // milliseconds
val FONT = Font.createFont(Font.TRUETYPE_FONT, new File("press_start_2p.ttf"))
val PL... | jponf/scala-pong | src/pong/Pong.scala | Scala | gpl-2.0 | 472 |
// scalac: -Ydelambdafy:inline
//
import scala.language.{ postfixOps }
import java.{ lang => jl }
trait T[A] {
def f(): A
}
class C extends T[Char] {
def f(): Char = 'a'
}
class Arr {
def arr1(xs: Array[Int]): List[Int] = xs.toList
def arr2(xs: Array[jl.Character]): List[jl.Character] = xs.toList
def arr3(x... | scala/scala | test/files/run/primitive-sigs-2-old.scala | Scala | apache-2.0 | 1,361 |
/*
* Copyright 2016 rdbc contributors
*
* 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... | rdbc-io/rdbc | rdbc-java-adapter/src/main/scala/io/rdbc/jadapter/package.scala | Scala | apache-2.0 | 854 |
/*
Copyright 2015 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 to in writing, software
distr... | MansurAshraf/scalding | scalding-core/src/main/scala/com/twitter/scalding/serialization/Boxed.scala | Scala | apache-2.0 | 19,638 |
/*
* 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 ... | WindCanDie/spark | sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationSuite.scala | Scala | apache-2.0 | 6,430 |
package com.avsystem.commons
package macros.misc
import com.avsystem.commons.macros.AbstractMacroCommons
import scala.reflect.macros.blackbox
class DelegationMacros(ctx: blackbox.Context) extends AbstractMacroCommons(ctx) {
import c.universe._
final def DelegationCls: Tree = tq"$MiscPkg.Delegation"
def dele... | AVSystem/scala-commons | commons-macros/src/main/scala/com/avsystem/commons/macros/misc/DelegationMacros.scala | Scala | mit | 2,222 |
package pimpathon.java.io
import java.io._
import java.util.zip.GZIPInputStream
import org.junit.Test
import scala.util.{Failure, Success}
import pimpathon.util._
import pimpathon.any._
class OutputStreamTest {
@Test def attemptClose(): Unit = {
createOutputStream().attemptClose() === Success(())
new Byte... | raymanoz/pimpathon | src/test/scala/pimpathon/java/io/OutputStream.scala | Scala | apache-2.0 | 3,388 |
/**
* Copyright (c) 2002-2014, OnPoint Digital, Inc. All rights reserved
*
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS... | phantomspectre/timez | src/main/scala/timez/syntax/time/MonthDaySyntax.scala | Scala | bsd-3-clause | 1,054 |
package im.actor.server.dialog
import cats.data.Xor
import im.actor.api.rpc.messaging._
import im.actor.api.rpc.peers.{ ApiOutPeer, ApiPeer, ApiPeerType }
import im.actor.api.rpc.{ AuthData, ClientData, Ok, PeersImplicits }
import im.actor.server._
import im.actor.server.acl.ACLUtils
import im.actor.server.api.rpc.ser... | EaglesoftZJ/actor-platform | actor-server/actor-tests/src/test/scala/im/actor/server/dialog/DialogProcessorSpec.scala | Scala | agpl-3.0 | 18,038 |
/*
* Copyright 2016 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/fset-faststream | it/repositories/AssessmentScoresRepositorySpec.scala | Scala | apache-2.0 | 11,117 |
package hello
import org.springframework.context.annotation.Configuration
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.context.annotation.ComponentScan
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.Respon... | harsh00008/hello-world-scala | src/main/scala/hello/HelloConfig.scala | Scala | mit | 690 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package base
package patterns
import _root_.org.jetbrains.plugins.scala.lang.psi.types._
import com.intellij.lang.ASTNode
import com.intellij.psi._
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElementVisitor
import org.jetbrains.plugins.... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/base/patterns/ScConstructorPatternImpl.scala | Scala | apache-2.0 | 6,195 |
package akka.s3
import akka.http.scaladsl.model.HttpRequest
import scala.util.Try
case class AuthV2(req: HttpRequest, getSecretKey: String => String) extends Auth {
override def run = Try {
val hl = HeaderList.Aggregate(Seq(req.listFromHeaders, req.listFromQueryParams))
// AWS AccessKey:Signature
def ... | akiradeveloper/akka-s3 | src/main/scala/akka/s3/auth/AuthV2.scala | Scala | apache-2.0 | 1,824 |
import scala.reflect.macros.blackbox.Context
object Impls {
def foo(c: Context)(x: c.Expr[Int]) = {
import c.universe._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))
c.Expr[Int](body)
}
} | felixmulder/scala | test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala | Scala | bsd-3-clause | 238 |
/*
* Copyright 2017 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... | liquidarmour/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/calculations/NetProfitsChargeableToCtCalculator.scala | Scala | apache-2.0 | 1,355 |
/**
* Copyright (C) 2015 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* 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... | DANS-KNAW/easy-ingest | command/src/test/scala/nl.knaw.dans.easy.ingest.command/CommandLineOptionsSpec.scala | Scala | apache-2.0 | 2,472 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | tdanford/adam | adam-core/src/main/scala/org/bdgenomics/adam/util/ReferenceContigMap.scala | Scala | apache-2.0 | 2,838 |
package org.spixi.flink.generation.function
import io.radicalbit.flink.pmml.scala.models.control.{AddMessage, ServingMessage}
import org.apache.flink.api.common.functions.MapFunction
class ControlStreamer(modelApp: String) extends MapFunction[String, ServingMessage] {
override def map(value: String): ServingMessag... | spi-x-i/flink-handson | flink-jpmml-ff/src/main/scala/org/spixi/flink/generation/function/ControlStreamer.scala | Scala | gpl-3.0 | 494 |
package com.szadowsz.spark.ml.feature
import org.apache.spark.ml.Transformer
import org.apache.spark.ml.param.shared.HasInputCols
import org.apache.spark.ml.param.{Param, ParamMap, ParamValidators}
import org.apache.spark.ml.util.Identifiable
import org.apache.spark.sql.types.StructType
import org.apache.spark.sql.{Da... | zakski/project-cadisainmduit | module/spark/src/main/scala/com/szadowsz/spark/ml/feature/ColRenamerTransformer.scala | Scala | apache-2.0 | 1,370 |
package edu.depauw.scales.graphics
import javax.imageio.ImageIO
import java.io.File
import java.awt.image.BufferedImage
// (x,y) is the upper left corner, (w,h) is the size
case class Image(path : String,
x : Double, y : Double, w : Double, h : Double) extends Graphic {
val img : BufferedImage = Im... | bhoward/EscalatorOld | Scales2/src/edu/depauw/scales/graphics/Image.scala | Scala | apache-2.0 | 427 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos.spark
class CosmosCatalogException(msg: String) extends RuntimeException(msg)
| Azure/azure-sdk-for-java | sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosCatalogException.scala | Scala | mit | 201 |
/*
* 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... | matterche/scalatest | scalactic/src/main/scala/org/scalactic/PrettyMethods.scala | Scala | apache-2.0 | 2,620 |
/*
* Copyright (c) 2011 Belmont Technology Pty Ltd. 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... | GrahamLea/SodaTest | sodatest-runtime/src/test/scala/org/sodatest/runtime/processing/execution/FixtureThatCausesErrorsWhenCreatingStuff.scala | Scala | apache-2.0 | 1,776 |
/*
* 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.
*/
/* !!!!!
* THIS FILE IS ALMOST COPY-PASTED IN... | SebsLittleHelpers/scala-js | library/src/main/scala/scala/scalajs/js/typedarray/TypedArrayBufferBridge.scala | Scala | apache-2.0 | 2,138 |
/*
* (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/CompositeViewer.scala | Scala | apache-2.0 | 4,907 |
package moving_features_between_objects.move_field.after
abstract class AccountType {
var _interestRate = 0.02
}
| zj-lingxin/refactoring | src/main/scala/moving_features_between_objects/move_field/after/AccountType.scala | Scala | mit | 117 |
package org.cg.spark.databroker
import akka.actor.ActorLogging
import akka.cluster.Cluster
import akka.cluster.ClusterEvent.CurrentClusterState
import akka.actor.Address
import akka.cluster.ClusterEvent.MemberUp
import akka.cluster.ClusterEvent.MemberRemoved
import akka.cluster.ClusterEvent.MemberEvent
import akka.act... | CodeGerm/spark-databroker | src/main/scala/org/cg/spark/databroker/ChannelCluster.scala | Scala | apache-2.0 | 2,750 |
package io.github.finagle.smtp.extension.chunking
import com.twitter.finagle.{Service, SimpleFilter}
import io.github.finagle.smtp.{Reply, Request}
/**
* Filter that is applied when ''CHUNKING'' extension is supported.
* Resets the session in case of failed ''BDAT'' and ''DATA'' commands.
*/
object ChunkingFilter ... | finagle/finagle-smtp | src/main/scala/io/github/finagle/smtp/extension/chunking/ChunkingFilter.scala | Scala | apache-2.0 | 873 |
package de.fosd.typechef.crefactor.backend.engine
import java.util.Collections
import org.kiama.rewriting.Rewriter._
import de.fosd.typechef.conditional._
import de.fosd.typechef.crewrite.IntraCFG
import de.fosd.typechef.featureexpr.{FeatureExprFactory, FeatureExpr}
import de.fosd.typechef.parser.c._
import de.fosd.... | joliebig/Morpheus | src/main/scala/de/fosd/typechef/crefactor/backend/engine/CExtractFunction.scala | Scala | lgpl-3.0 | 37,786 |
/**
* Copyright (C) 2010-2012 LShift Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... | aprescott/diffa | agent/src/main/scala/net/lshift/diffa/agent/rest/exceptions/MissingMandatoryFieldExceptionMapper.scala | Scala | apache-2.0 | 1,111 |
package blended.testsupport.camel
import java.util.UUID
import java.util.concurrent.atomic.AtomicInteger
import akka.actor.{Actor, ActorLogging}
import akka.camel.{CamelExtension, CamelMessage}
import blended.testsupport.camel.protocol._
import org.apache.camel.builder.RouteBuilder
import org.apache.camel.{Exchange, ... | lefou/blended | blended.testsupport/src/main/scala/blended/testsupport/camel/CamelMockActor.scala | Scala | apache-2.0 | 4,036 |
package org.shapelogic.sc.polygon
import org.scalatest._
import scala.reflect.ClassTag
import scala.specialized
import spire.math.Numeric
class Calculator2DSpec extends FunSuite with BeforeAndAfterEach {
import Calculator2D._
val origin = new CPointInt(0, 0)
val xAxis1 = new CPointInt(1, 0)
val xAxis2 = new ... | sami-badawi/shapelogic-scala | src/test/scala/org/shapelogic/sc/polygon/Calculator2DSpec.scala | Scala | mit | 4,419 |
package io.ddf.spark.content
import io.ddf.spark.ATestSuite
/**
*/
class ListDDFSuite extends ATestSuite {
createTableMtcars()
createTableAirline()
test("test list ddf") {
val ddf1 = manager.sql2ddf("select * from mtcars", "SparkSQL")
val ddf2 = manager.sql2ddf("select * from airline", "SparkSQL")
... | ubolonton/DDF | spark/src/test/scala/io/ddf/spark/content/ListDDFSuite.scala | Scala | apache-2.0 | 636 |
package com.atomist.source.git.domain
import java.time.OffsetDateTime
import com.fasterxml.jackson.annotation.JsonFormat
case class Tagger(name: String,
email: String,
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXXX") date: OffsetDateTime) | atomist/artifact-source | src/main/scala/com/atomist/source/git/domain/Tagger.scala | Scala | gpl-3.0 | 311 |
package dotty.tools.dotc
package transform
import core._
import Types._
import Contexts._
import Symbols._
import SymDenotations._
import Decorators._
import Names._
import StdNames._
import NameOps._
import Flags._
import Annotations._
import language.implicitConversions
object SymUtils {
implicit def decorateSymb... | yusuke2255/dotty | src/dotty/tools/dotc/transform/SymUtils.scala | Scala | bsd-3-clause | 3,568 |
package entities
/**
* Classe compagnion du post
* Pour jsonifier
*/
object Post {
implicit val format = ""
}
/**
* Represents a message
*
* @param postid Message identifier
* @param timestamp time of creation
* @param msg the body of the message
*/
case class Post(postId: String,... | ojbruce/Moot | app/entities/Post.scala | Scala | mit | 367 |
package org.dagre.euler
import org.scalatest.{FlatSpec, Matchers}
class Euler26Spec extends FlatSpec with Matchers {
"Euler 26" should "return the value under the given maximum for which 1/n has the largest recurring cycle in its decimal fractional part" in {
Euler26(10) should be (7)
}
it should "solve t... | dagre/euler | src/test/scala-2.12/org/dagre/euler/Euler26Spec.scala | Scala | apache-2.0 | 397 |
package monocle.std
@deprecated("instances have been move to typeclass companion object", since = "1.4.0")
object tuple4
@deprecated("instances have been move to typeclass companion object", since = "1.4.0")
trait Tuple4Optics
| rperry/Monocle | core/shared/src/main/scala/monocle/std/Tuple4.scala | Scala | mit | 229 |
package org.jetbrains.plugins.scala.lang.psi.types
import com.intellij.openapi.progress.ProgressManager
import org.jetbrains.plugins.scala.lang.psi.api.base.ScFieldId
import org.jetbrains.plugins.scala.lang.psi.api.base.patterns.ScBindingPattern
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScFunction
imp... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/psi/types/ScExistentialType.scala | Scala | apache-2.0 | 23,514 |
package sharry.restserver.webapp
import cats.effect._
import org.http4s.HttpRoutes
import org.http4s.server.staticcontent._
object WebjarRoutes {
def appRoutes[F[_]: Async]: HttpRoutes[F] =
webjarServiceBuilder[F]
.withCacheStrategy(NoopCacheStrategy[F])
.withWebjarAssetFilter(assetFilter)
.... | eikek/sharry | modules/restserver/src/main/scala/sharry/restserver/webapp/WebjarRoutes.scala | Scala | gpl-3.0 | 655 |
package org.openapitools.client.api
import argonaut._
import argonaut.EncodeJson._
import argonaut.DecodeJson._
import org.http4s.{EntityDecoder, EntityEncoder}
import org.http4s.argonaut._
import org.joda.time.DateTime
import GithubContent._
case class GithubContent (
name: Option[String],
sha: Option[String],
... | cliffano/swaggy-jenkins | clients/scalaz/generated/src/main/scala/org/openapitools/client/api/GithubContent.scala | Scala | mit | 803 |
/*
* Copyright 2017 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... | liquidarmour/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frsse2008/boxes/ACQ8108.scala | Scala | apache-2.0 | 834 |
package xyz.hyperreal.sprolog
import org.scalatest._
import prop.PropertyChecks
import Prolog.{program, query, queryOnce}
class Problems extends FreeSpec with PropertyChecks with Matchers
{
"ackermann" in
{
val p = program( """
between( I, J, I ) :- I =< J.
between( I, J, K ) :- I < J, I1 is I + 1, between( ... | edadma/sprolog | src/test/scala/Problems.scala | Scala | mit | 11,385 |
/*
* Copyright 2014 Commonwealth Computer Research, 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 applicabl... | mmatz-ccri/geomesa | geomesa-core/src/main/scala/org/locationtech/geomesa/core/process/proximity/ProximitySearchProcess.scala | Scala | apache-2.0 | 5,139 |
package io.hydrosphere.mist.master.data
import java.nio.charset.Charset
import java.nio.file.Paths
import io.hydrosphere.mist.master
import io.hydrosphere.mist.master.TestUtils
import io.hydrosphere.mist.master.models.{ContextConfig, RunMode}
import org.apache.commons.io.FileUtils
import org.scalatest.{BeforeAndAfter... | Hydrospheredata/mist | mist/master/src/test/scala/io/hydrosphere/mist/master/data/ContextsStorageSpec.scala | Scala | apache-2.0 | 3,075 |
/*
* 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 ... | goldmedal/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/LoggingPodStatusWatcher.scala | Scala | apache-2.0 | 3,366 |
package org.kimbasoft.akka.eventbus
import akka.actor.{ActorSystem, DeadLetter}
import com.typesafe.config.ConfigFactory
import org.kimbasoft.akka.eventbus.bustype.LookupBus.{LookupBusImpl, LookupEvent}
import org.kimbasoft.akka.eventbus.bustype.SubchannelBus.{SubchannelBusImpl, SubchannelEvent}
import org.kimbasoft.a... | kimba74/sandbox-scala | src/main/scala/org/kimbasoft/akka/eventbus/EventBusClient.scala | Scala | gpl-3.0 | 4,273 |
/*
* stateless-future-util
* Copyright 2014 深圳岂凡网络有限公司 (Shenzhen QiFun Network Corp., LTD)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LIC... | Atry/stateless-future-util | src/main/scala/com/qifun/statelessFuture/util/Blocking.scala | Scala | apache-2.0 | 1,549 |
/**
* *****************************************************************************
* Copyright 2016 Katja Hahn
*
* 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... | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/sections/rsrc/version/Var.scala | Scala | apache-2.0 | 1,210 |
/*
* 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/main/scala/org/scalactic/CheckedEquality.scala | Scala | apache-2.0 | 13,838 |
/*
* 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 ... | ashokblend/incubator-carbondata | integration/spark-common/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala | Scala | apache-2.0 | 13,892 |
/*
* 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 ... | caneGuy/spark | core/src/main/scala/org/apache/spark/ui/JettyUtils.scala | Scala | apache-2.0 | 19,709 |
package io.finch.petstore
import _root_.argonaut._
import _root_.argonaut.Argonaut._
import org.scalatest.prop.Checkers
import org.scalatest.{FlatSpec, Matchers}
/*
Tests for User
*/
class UserSpec extends FlatSpec with Matchers with Checkers{
"The User codec" should "correctly decode JSON to User" in {
check... | peel/finch | petstore/src/test/scala/io/finch/petstore/UserSpec.scala | Scala | apache-2.0 | 579 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This... | beangle/commons | text/src/main/scala/org/beangle/commons/text/seq/NbspGenerator.scala | Scala | lgpl-3.0 | 1,128 |
package com.datasift.dropwizard.scala
import java.io.File
import java.util.UUID
import javax.ws.rs.client.Entity
import com.codahale.metrics.MetricRegistry
import com.datasift.dropwizard.jdbi.tweak.BindProduct
import com.datasift.dropwizard.scala.test.{ApplicationTest, BeforeAndAfterAllMulti, LiquibaseTest, MySQLTest... | datasift/dropwizard-scala | core/src/test/scala/com/datasift/dropwizard/scala/ScalaApplicationSpecIT.scala | Scala | apache-2.0 | 13,375 |
object Trinary {
def trinaryToInt(in: String): Int =
if (in.exists(_.toString.toInt > 2)) throw new IllegalArgumentException
else if (in.toInt == 0) 0 // if `in` contains non-digit char, `toInt` throw IllegalArgumentException
else {
val pows = Stream.iterate(Math.pow(3, in.size-1).toInt)(_ / 3)
... | daewon/til | exercism/scala/trinary/src/main/scala/trinary.scala | Scala | mpl-2.0 | 562 |
package antwar
case class GameParameters(loadTime: Int = 2000, turnTime: Int = 2000, rows: Int = 20, cols: Int = 20, seed: Int = 0,
turns: Int = 500, viewRadius: Int = 93, attackRadius: Int = 6, spawnRadius: Int = 6)
| vjousse/aichallenge-scala | src/main/scala/GameParameters.scala | Scala | mit | 244 |
/*
* 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 ... | bravo-zhang/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSessionStateSuite.scala | Scala | apache-2.0 | 1,975 |
package org.http4s.client.asynchttpclient
import org.reactivestreams.tck.SubscriberWhiteboxVerification.{SubscriberPuppet, WhiteboxSubscriberProbe}
import org.reactivestreams.{Subscription, Subscriber}
/** Stackable trait to ease creating whitebox subscriber tests. */
trait WhiteboxSubscriber[A] extends Subscriber[A]... | m4dc4p/http4s | async-http-client/src/test/scala/org/http4s/client/asynchttpclient/WhiteboxSubscriber.scala | Scala | apache-2.0 | 1,003 |
package org.broadinstitute.dsde.firecloud.test.workspace
import java.util.UUID
import org.broadinstitute.dsde.firecloud.fixture.UserFixtures
import org.broadinstitute.dsde.firecloud.page.workspaces.methodconfigs.WorkspaceMethodConfigListPage
import org.broadinstitute.dsde.workbench.auth.AuthToken
import org.broadinst... | broadinstitute/firecloud-ui | automation/src/test/scala/org/broadinstitute/dsde/firecloud/test/workspace/WorkspaceReaderSpec.scala | Scala | bsd-3-clause | 5,718 |
package edu.nus.maxsmtplay
import com.microsoft.z3._
import scala.collection.mutable.Stack
/**
* Implementation of Fast-Diag algorithm
*
* For more information on the Fast-Diag procedure:
*
* Felfernig, A. and Schubert, M. and Zehentner, C. An Efficient Diagnosis
* Algorithm for Inconsistent Constraint Se... | mechtaev/maxsmt-playground | src/main/scala/edu/nus/maxsmtplay/FastDiag.scala | Scala | mit | 3,672 |
object Test {
assert(Main.msg == "Hello, World!")
} | sbt/sbt | sbt-app/src/sbt-test/project/scala3-semanticdb/src/test/scala/Test.scala | Scala | apache-2.0 | 53 |
/*
* 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 agr... | SRGOM/scalatest | scalatest-test/src/test/scala/org/scalatest/concurrent/DoOverSuite.scala | Scala | apache-2.0 | 9,318 |
package com.dmanchester.playfop.sinternal
import java.io.ByteArrayOutputStream
import java.io.OutputStream
import java.io.StringReader
import java.io.StringWriter
import scala.xml.Elem
import scala.xml.Node
import scala.xml.XML
import org.apache.fop.apps.FOUserAgent
import org.apache.fop.apps.Fop
import org.slf4j.Lo... | dmanchester/playfop | library/src/main/scala/com/dmanchester/playfop/sinternal/PlayFopImpl.scala | Scala | apache-2.0 | 3,399 |
package akka.persistence.pg
import java.util.concurrent.TimeUnit
import javax.naming.{Context, InitialContext}
import akka.actor._
import akka.persistence.pg.TestActor.{Alter, GetState, TheState}
import akka.persistence.pg.journal.JournalTable
import akka.persistence.pg.util.{CreateTables, RecreateSchema}
import akka... | kwark/akka-persistence-postgresql | modules/akka-persistence-pg/src/test/scala/akka/persistence/pg/PersistUsingJndiTest.scala | Scala | mit | 2,440 |
package isabelle.eclipse.launch.tabs
import org.eclipse.swt.widgets.Widget
/**
* Various utility methods related to SWT components and UI interaction.
*
* (Copied from [[isabelle.eclipse.ui.util.SWTUtil]] to avoid adding dependency)
*
* @author Andrius Velykis
*/
object SWTUtil {
/**
* Asynchronously r... | andriusvelykis/isabelle-eclipse | isabelle.eclipse.launch/src/isabelle/eclipse/launch/tabs/SWTUtil.scala | Scala | epl-1.0 | 895 |
package org.bfn.ninetynineprobs
import org.scalatest._
class P19Spec extends UnitSpec {
"rotate" should "return an empty list if called with an empty list" in {
assert(P19.rotate(0, List()) == List())
assert(P19.rotate(1, List()) == List())
assert(P19.rotate(42, List()) == List())
assert(P19.rotate... | bfontaine/99Scala | src/test/scala/P19Spec.scala | Scala | mit | 1,976 |
package jitd.codegen
import jitd.spec._
object RenderFunction
{
def body(ctx: Render, fn: FunctionDefinition, indent: String = ""): String =
{
indent+s"${fn.ret.map { ctx.cType(_) }.getOrElse("void")} ${fn.name}("+
fn.args.map { case (name, t, inout) =>
val const = FunctionArgType.isConst(inout... | UBOdin/jitd-synthesis | src/main/scala/jitd/codegen/RenderFunction.scala | Scala | apache-2.0 | 665 |
/*
* 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 ... | sachintyagi22/spark | sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala | Scala | apache-2.0 | 28,316 |
package com.holdenkarau.spark.testing
import org.apache.spark.sql.{Dataset, SQLContext}
import org.scalacheck.{Gen, Arbitrary}
import org.scalacheck.Prop.forAll
import org.scalatest.FunSuite
import org.scalatest.prop.Checkers
import org.apache.spark.sql.SparkSession
class SampleDatasetGeneratorTest extends FunSuite
... | holdenk/spark-testing-base | core/src/test/2.0/scala/com/holdenkarau/spark/testing/SampleDatasetGeneratorTest.scala | Scala | apache-2.0 | 1,999 |
package com.nthportal.euler.h0
import com.nthportal.euler.h0.t4._
import org.junit.Test
import org.scalatest.junit.JUnitSuite
class P04xTests extends JUnitSuite {
@Test
def problem40Test(): Unit = assert(Problem40() == 210)
@Test
def problem41Test(): Unit = assert(Problem41() == 7652413)
@Test
def probl... | NthPortal/euler-n-scala | src/test/scala/com/nthportal/euler/h0/P04xTests.scala | Scala | mit | 872 |
import calculator.Calculator
import org.scalatest._
/**
* Informations for all IDE:
* - http://www.scalatest.org/user_guide/running_your_tests
* - download scalatest_2.11-2.2.6.jar from http://www.scalatest.org/install
*
* Instructions for Eclipse Scala IDE
* - add lib to the build path
* - run the test ... | ValentinMinder/scala-labs-HEIG | lab02/src/calculator/test/CalculatorTest.scala | Scala | mit | 4,162 |
/*
* Copyright (c) 2018 OVO Energy
*
* 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,... | ovotech/comms-kafka-messages | modules/core/src/main/scala/com/ovoenergy/comms/model/sms/ComposedSMSV4.scala | Scala | mit | 2,686 |
/**
* 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... | flange/drift-dev | kafka/00-kafka_2.11-0.10.1.0/libs/tmp/kafka/producer/ProducerTopicStats.scala | Scala | apache-2.0 | 3,060 |
package cd
import scala.Int
import java.lang.Comparable
final class CallSign(val value: Int) extends Comparable[CallSign] {
override def compareTo(other: CallSign) =
if (value == other.value) 0
else if (value < other.value) -1
else 1
}
| sjrd/scalajs-benchmarks | cd/src/main/scala/cd/CallSign.scala | Scala | bsd-3-clause | 252 |
package com.eevolution.context.dictionary.infrastructure.service.impl
import java.util.UUID
import com.eevolution.context.dictionary.infrastructure.repository.FieldTrlRepository
import com.eevolution.context.dictionary.infrastructure.service.FieldTrlService
import com.lightbend.lagom.scaladsl.api.ServiceCall
import c... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/service/impl/FieldTrlServiceImpl.scala | Scala | gpl-3.0 | 2,022 |
package gloving
import java.net.URI
import java.io.File
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import org.apache.spark.util.StatCounter
import org.apache.spark.mllib.clustering.{KMeans, KMeansModel}
import breeze.linalg.DenseVector
import org.slf4j.LoggerFactory
import com.typesafe.sc... | anelson/gloving | src/main/scala/GloVeWordVectorLoader.scala | Scala | apache-2.0 | 1,369 |
package notebook.kernel
import java.io.{StringWriter, PrintWriter, ByteArrayOutputStream}
import java.net.{URLDecoder, JarURLConnection}
import java.util.ArrayList
import notebook.kernel.repl.common._
import scala.collection.JavaConversions
import scala.collection.JavaConversions._
import scala.xml.{NodeSeq, Text}
im... | deanwampler/spark-notebook | modules/spark/src/main/scala_2.11/spark-last/notebook/kernel/Repl.scala | Scala | apache-2.0 | 13,172 |
object Solution {
def main(args: Array[String]) {
for(line <- io.Source.stdin.getLines.drop(1)) {
println(line.split(" ").map(_.toInt).sum)
}
}
}
| marcos-sb/hacker-rank | algorithms/warmup/simple-array-sum/Solution.scala | Scala | apache-2.0 | 183 |
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Sun Jan 4 23:09:27 EST 2015
* @see LICENSE (MIT style license file).
*/
package scalation.analytics.par
import scalation.linalgebra.{MatriD, VectorD, VectorI}
import scalatio... | mvnural/scalation | src/main/scala/scalation/analytics/par/ANCOVA.scala | Scala | mit | 6,759 |
package moe.nightfall.srails.common.block.property
import net.minecraft.block.properties.PropertyDirection
object PropertyRotatable {
final val ROTATION = PropertyDirection.create("facing")
}
| Nightfall/SRails | src/main/scala/moe/nightfall/srails/common/block/property/PropertyRotatable.scala | Scala | bsd-2-clause | 196 |
/***********************************************************************
* 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-kafka/geomesa-kafka-datastore/src/main/scala/org/locationtech/geomesa/kafka/index/KafkaQueryRunner.scala | Scala | apache-2.0 | 1,383 |
package scalan.seq
import scala.language.implicitConversions
import scala.runtime.{BoxedUnit, ScalaRunTime}
import scalan.{Base, ScalanStd}
trait BaseStd extends Base { self: ScalanStd =>
type Rep[+A] = A
override protected def stagingExceptionMessage(message: String, syms: Seq[Rep[_]]) = message
override def... | scalan/scalan | core/src/main/scala/scalan/seq/BaseStd.scala | Scala | apache-2.0 | 2,196 |
package com.sksamuel.elastic4s
import org.slf4j.{Logger, LoggerFactory}
/**
* A typeclass that an underlying http client can implement, so that it can be used
* by the [[ElasticClient]] implementation by elastic4s.
*
* In other words, this is a wrapper trait so that HTTP libraries such as Apache HTTP commons,... | sksamuel/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/HttpClient.scala | Scala | apache-2.0 | 1,266 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This... | beangle/data | transfer/src/main/scala/org/beangle/data/transfer/importer/listener/DebugListener.scala | Scala | lgpl-3.0 | 1,383 |
package scalariform.parser
import scalariform.lexer._
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
// format: +preserveSpaceBeforeArguments
class ParserTest extends FlatSpec with ShouldMatchers {
"Parser" should "throw a parse exception" in {
evaluating { parseExpression("for {x ... | jkinkead/scalariform | scalariform/src/test/scala/scalariform/parser/ParserTest.scala | Scala | mit | 1,781 |
/*
* OnePole.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.fscape
package stre... | Sciss/FScape-next | core/shared/src/main/scala/de/sciss/fscape/stream/OnePole.scala | Scala | agpl-3.0 | 2,122 |
package org.sparkpipe.sql.types
import scala.collection.mutable.ArrayBuffer
import org.apache.spark.sql.types.{ArrayType, DataType, LongType, UserDefinedType}
/**
* Custom buffer type to speed up execution of collection function. It is not recommended to use it
* outside of this package. Underlying SQL structure is... | sadikovi/sparkpipe | src/main/scala/org/sparkpipe/sql/types/BufferType.scala | Scala | mit | 1,151 |
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.