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 |
|---|---|---|---|---|---|
case class A private (i: Int)
object A
object ATest {
def a0: A = new A(0) // error: constructor is private
def a1: A = A(1) // error: apply is private
def a2: A = a1.copy(2) // error: copy is private
}
case class B private (i: Int) // ok: no user-defined companion object
object BTest {
def b0: B = new B(0) //... | dotty-staging/dotty | tests/neg/caseclass-access.scala | Scala | apache-2.0 | 1,604 |
package com.yetu.notification.client
import org.scalamock.scalatest.MockFactory
import org.scalatest.concurrent.{AsyncAssertions, Eventually, ScalaFutures}
import org.scalatest.time.SpanSugar._
import org.scalatest.time.{Millis, Seconds, Span}
import scala.concurrent.ExecutionContext.Implicits.global
class Notificati... | yetu/yetu-notification-client-scala | src/test/scala/com/yetu/notification/client/NotificationManagerTest.scala | Scala | mit | 1,255 |
package io.transwarp.midas.constant.midas.params.timeseries
/**
* Created by endy on 16-12-21.
*/
object HoltWintersParams {
val MaxEval = "maxEval"
val MaxIter = "maxIter"
val Period = "period"
val ModelType = "modelType"
}
| transwarpio/rapidminer | api-driver/src/main/scala/io/transwarp/midas/constant/midas/params/timeseries/HoltWintersParams.scala | Scala | gpl-3.0 | 238 |
/*
* 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 ... | DieBauer/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/DataSetSessionWindowAggReduceGroupFunction.scala | Scala | apache-2.0 | 8,184 |
/*
* 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 ... | Dax1n/spark-core | core/src/test/scala/org/apache/spark/FileServerSuite.scala | Scala | apache-2.0 | 8,398 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// Licence: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.sexp
import org.scalatest.FunSpec
class SexpPrettyPrinterSpec extends FunSpec {
private val foo = SexpString("foo")
private val foosym = SexpSymbol("foo")
private ... | j-mckitrick/ensime-sbt | src/sbt-test/ensime-sbt/ensime-server/s-express/src/test/scala/org/ensime/sexp/SexpPrettyPrinterSpec.scala | Scala | apache-2.0 | 1,714 |
package it.unich.jandom.domains.numerical.apron
import it.unich.jandom.domains.numerical.LinearForm
import it.unich.jandom.domains.numerical.NumericalProperty
import it.unich.jandom.utils.numberext.RationalExt
import it.unich.jandom.domains.numerical.Inequalities
import apron._
trait ApronNumericalDomainAdapter [A <:... | amato-gianluca/Jandom | core/src/main/apron/it/unich/jandom/domains/numerical/apron/ApronProperty.scala | Scala | lgpl-3.0 | 5,620 |
// Copyright 2014 Commonwealth Bank of Australia
//
// 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 ap... | shyam334/ebenezer | example/src/main/scala/au/com/cba/omnia/ebenezer/example/HiveExampleStep1.scala | Scala | apache-2.0 | 1,614 |
/*
* 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 | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala | Scala | apache-2.0 | 3,845 |
/*
* 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 ... | BryanCutler/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/NumberConverter.scala | Scala | apache-2.0 | 5,843 |
package codecheck.github.models
import org.json4s._
import org.json4s.jackson.JsonMethods
import codecheck.github.utils.Json4s.formats
trait AbstractInput {
val value: JValue = Extraction.decompose(this)
override def toString = JsonMethods.pretty(value)
}
| code-check/github-api-scala | src/main/scala/codecheck/github/models/AbstractInput.scala | Scala | mit | 262 |
package other.kafka
import org.I0Itec.zkclient.ZkClient
import kafka.api._
import kafka.utils.{ShutdownableThread, ZKStringSerializer}
import org.apache.kafka.common.protocol.SecurityProtocol
import scala.collection._
import kafka.client.ClientUtils
import joptsimple.OptionParser
import kafka.common.{ErrorMapping, Off... | crashlytics/kafka | core/src/test/scala/other/kafka/TestOffsetManager.scala | Scala | apache-2.0 | 10,266 |
import com.typesafe.sbt.jshint.Import.JshintKeys
import sbt._
import sbt.Keys._
import sbt.Project.projectToRef
import playscalajs.PlayScalaJS.autoImport._
import com.typesafe.sbt.digest.Import._
import com.typesafe.sbt.GitVersioning
import com.typesafe.sbt.gzip.Import._
import com.typesafe.sbt.jse.JsEngineImport.JsE... | bradegler/boilerplay | project/Server.scala | Scala | apache-2.0 | 3,426 |
package dontblock.actors
import akka.actor._
import akka.routing._
object BlockingActor {
case class Block(delay: Long)
}
import BlockingActor._
class BlockingActor extends Actor {
def receive = {
case Block(delay) =>
println(s"blocking-${self.path.name} will be blocking ${Thread.currentThread.getNam... | zcox/iascala-dont-block | src/main/scala/block_actors.scala | Scala | mit | 1,495 |
package com.twitter.finagle.http
import com.twitter.finagle
import com.twitter.finagle.Service
import com.twitter.finagle.liveness.FailureDetector
import com.twitter.util.Future
/**
* This is really a HTTP/1.x test suite because the server only speaks HTTP/1.x
*/
class ClientFailHttp2UpgradeTest extends AbstractHtt... | twitter/finagle | finagle-http/src/test/scala/com/twitter/finagle/http/ClientFailHttp2UpgradeTest.scala | Scala | apache-2.0 | 1,101 |
package com.avsystem.commons
package redis
import akka.util.ByteString
import com.avsystem.commons.redis.RawCommand.Level
import com.avsystem.commons.redis.exception.ForbiddenCommandException
import com.avsystem.commons.redis.protocol.{ArrayMsg, BulkStringMsg, RedisMsg, RedisReply}
import scala.collection.mutable
/*... | AVSystem/scala-commons | commons-redis/src/main/scala/com/avsystem/commons/redis/raw.scala | Scala | mit | 5,126 |
package gapt.provers.viper.grammars
import cats.instances.list._
import cats.syntax.traverse._
import gapt.expr.VarOrConst
import gapt.expr._
import gapt.expr.ty.FunctionType
import gapt.expr.ty.TBase
import gapt.expr.ty.Ty
import gapt.expr.ty.baseTypes
import gapt.proofs.context.Context
import gapt.proofs.context.fac... | gapt/gapt | core/src/main/scala/gapt/provers/viper/grammars/enumerateTerms.scala | Scala | gpl-3.0 | 3,038 |
/*
* Part of NDLA article-api.
* Copyright (C) 2017 NDLA
*
* See LICENSE
*
*/
package no.ndla.articleapi.model.api
import java.util.Date
import no.ndla.validation.ValidationMessage
import org.scalatra.swagger.annotations._
import org.scalatra.swagger.runtime.annotations.ApiModelProperty
import scala.annotatio... | NDLANO/article-api | src/main/scala/no/ndla/articleapi/model/api/ValidationError.scala | Scala | gpl-3.0 | 879 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | spandanagrawal/geomesa | geomesa-features/geomesa-feature-all/src/test/scala/org/locationtech/geomesa/features/SimpleFeatureSerializersTest.scala | Scala | apache-2.0 | 15,453 |
package org.brijest.storm
package engine.model
package characters
import components._
import rules.{Stats, Inventory}
class Rock(val id: EntityId, sz: (Int, Int) = (3, 3)) extends Character {
dimensions := sz
def manager = IdleManager
def canWalk(from: Slot, to: Slot) = false
def chr = '#'
def color ... | axel22/scala-2d-game-editor | src/main/scala/org/brijest/storm/engine/model/characters/standard.scala | Scala | bsd-3-clause | 16,757 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | external/kafka-0-10/src/test/scala/org/apache/spark/streaming/kafka010/KafkaRDDSuite.scala | Scala | apache-2.0 | 6,068 |
package fif
import scala.language.{higherKinds, implicitConversions}
import scala.reflect.ClassTag
object ArrayData extends Data[Array] {
/** Transform a dataset by applying f to each element. */
override def map[A, B: ClassTag](data: Array[A])(f: (A) => B): Array[B] =
data.map(f)
override def mapParition... | malcolmgreaves/abstract_data | data-tc-scala/src/main/scala/fif/ArrayData.scala | Scala | apache-2.0 | 2,453 |
package mypipe.avro
import mypipe.avro.schema.GenericSchemaRepository
import org.schemarepo.{ValidatorFactory, InMemoryRepository}
abstract class InMemorySchemaRepo[ID, SCHEMA] extends GenericSchemaRepository[ID, SCHEMA] {
// Configuration
override protected def getRepositoryURL: String = "InMemoryRepository"
... | mardambey/mypipe | mypipe-avro/src/main/scala/mypipe/avro/InMemorySchemaRepo.scala | Scala | apache-2.0 | 412 |
package com.twitter.finagle.service
import com.twitter.conversions.time._
import com.twitter.finagle._
import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver}
import com.twitter.util.{Duration, Time, Timer, TimerTask, Try}
import scala.util.Random
object FailureAccrualFactory {
private[finagle] def wrap... | folone/finagle | finagle-core/src/main/scala/com/twitter/finagle/service/FailureAccrualFactory.scala | Scala | apache-2.0 | 7,958 |
package ru.freefry.furniture_factory.rest
import akka.actor._
import ru.freefry.furniture_factory.core._
import spray.http.StatusCodes.InternalServerError
import spray.routing.{ExceptionHandler, RoutingSettings}
import scala.concurrent.Promise
import scala.util.Try
import scala.util.control.NonFatal
/**
* Actor lis... | freefry/furniture-factory | src/main/scala/ru/freefry/furniture_factory/rest/factoryService.scala | Scala | apache-2.0 | 1,382 |
package controllers
import models.Office
import play.api.db.DB
import play.api.mvc.{Action, Controller}
import play.api.Play.current
class Offices extends Controller{
def list = Action {
var officeList : List[Office] = List()
val conn = DB.getConnection()
try {
val stmt = conn.createStatement
... | CSStudents/MyAdvisor | app/controllers/Offices.scala | Scala | mit | 2,555 |
/*
* Copyright (c) 2015 Robert Conrad - All Rights Reserved.
* Unauthorized copying of this file, via any medium is strictly prohibited.
* This file is proprietary and confidential.
* Last modified by rconrad, 1/4/15 4:13 PM
*/
package base.server.service.impl
import base.common.service.{ CommonServicesBootstrap... | robconrad/base-api | project-server/src/main/scala/base/server/service/impl/ServerServiceImpl.scala | Scala | mit | 2,932 |
package nexus.diff.execution
import nexus.diff._
import nexus._
import nexus.diff.collection._
/**
* @author Tongfei Chen
*/
trait Backward[F[_]] {
def compute[R](loss: F[R])(implicit R: IsReal[R]): BoxMap[F, Id]
}
| ctongfei/nexus | diff/src/main/scala/nexus/diff/execution/Backward.scala | Scala | mit | 223 |
package reasonable
import scalaz.Monad
import scalaz.{-\\/, \\/-}
import Algebra._
object Tester {
type Tester[+A] = Map[String, String] => (List[String], EitherType[A])
implicit val testerMonad = new Monad[Tester] {
def point[A](a: => A) = _ => (List(), \\/-(a))
def bind[A, B](t: Tester[A])(f: A => Test... | enpassant/scalaz | src/test/scala/reasonable/Tester.scala | Scala | apache-2.0 | 551 |
/**
* Copyright 2015 Thomson Reuters
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | hochgi/CM-Well | server/cmwell-controller/src/main/scala/cmwell/ctrl/controllers/CwController.scala | Scala | apache-2.0 | 996 |
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
package ducttape.syntax
import ducttape.util.AbstractTest
import ducttape.syntax.GrammarParser.Parser
import org.junit.run... | jhclark/ducttape | src/test/scala/ducttape/syntax/TaskSpecTest.scala | Scala | mpl-2.0 | 12,718 |
package actors
import akka.NotUsed
import akka.actor.typed.scaladsl.Behaviors
import akka.actor.typed.{ ActorRef, Behavior, Scheduler }
import akka.stream.scaladsl.Flow
import akka.util.Timeout
import com.google.inject.Provides
import play.api.Configuration
import play.api.libs.concurrent.ActorModule
import play.api.l... | play2-maven-plugin/play2-maven-test-projects | play28/scala/websocket-example-using-webjars-assets/app/actors/UserParentActor.scala | Scala | apache-2.0 | 1,442 |
package org.bitcoins.core.protocol.blockchain
import org.bitcoins.core.bloom.BloomFilter
import org.bitcoins.core.crypto.DoubleSha256Digest
import org.bitcoins.core.number.{ UInt32, UInt64 }
import org.bitcoins.core.protocol.transaction.Transaction
import org.bitcoins.core.protocol.{ CompactSizeUInt, NetworkElement }
... | Christewart/bitcoin-s-core | src/main/scala/org/bitcoins/core/protocol/blockchain/MerkleBlock.scala | Scala | mit | 4,274 |
/*
* Deterministic.scala
* Elements with no randomness.
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http://www.github.com/p2... | agarbuno/figaro | Figaro/src/main/scala/com/cra/figaro/language/Deterministic.scala | Scala | bsd-3-clause | 779 |
package sma.booting
import akka.actor.Props
import akka.stream.scaladsl.Source
import sma.Settings.{networks, theUsers}
import sma.eventsourcing.EventSourcing
import sma.reactive.ReactiveStreamWrapper
import sma.twitter.TwitterFeeder
trait FeedersBoot extends EventSourcing {
def wakeupFeeders: Unit = {
Source(t... | eduardo-lago-aguilar/sma | src/main/scala/sma/booting/FeedersBoot.scala | Scala | mit | 600 |
package com.twitter.finagle.exp.mysql.protocol
object Capability {
val LongPassword = 0x0001 // new more secure passwords
val FoundRows = 0x0002 // Found instead of affected rows
val LongFlag = 0x0004 // Get all column flags
val ConnectWithDB = 0x0008 // One can specify db on connect
va... | firebase/finagle | finagle-mysql/src/main/scala/com/twitter/finagle/mysql/protocol/Capability.scala | Scala | apache-2.0 | 2,443 |
/*
* @author Genc Mazlami
*
* Copyright 2013 University of Zurich
*
* 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
*
* U... | gmazlami/dcop-maxsum | src/main/scala/com/signalcollect/dcop/evaluation/MeasuringInstrument.scala | Scala | apache-2.0 | 1,129 |
/**
* 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... | YMartsynkevych/camel | components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/ConvertBodyToAsTest.scala | Scala | apache-2.0 | 1,217 |
package lila
import ornicar.scalalib
import ornicar.scalalib.Zero
trait Steroids
extends scalalib.Validation
with scalalib.Common
with scalalib.Regex
with scalalib.OrnicarMonoid.Instances
with scalalib.Zero.Syntax
with scalalib.Zero.Instances
with scalalib.OrnicarOption
with scalalib.OrnicarNonEmptyL... | r0k3/lila | modules/common/src/main/Steroids.scala | Scala | mit | 2,735 |
package sims.test.gui
package scenes
import sims.dynamics._
import sims.math._
import sims.dynamics._
object LongCollisionScene extends Scene {
override def description = "A test to verify conservation in a collision."
def makeBodies() = (for (i <- 0 until 10) yield {
new Circle(0.2) {
position = Vector2D(0 ... | jodersky/sims2 | src/test/scala/sims/test/gui/scenes/LongCollisionScene.scala | Scala | bsd-3-clause | 1,258 |
object Roman {
val ones = Vector("I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX")
val tens = Vector("X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC")
val hundreds = Vector("C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM")
val thousands = Vector("M", "MM", "MMM")
val toRoman = Vector(ones, t... | dkowis/CodingDojo | KataRomanNumerals/src/main/scala/Roman.scala | Scala | mit | 1,607 |
package is.hail.expr.ir
import is.hail.asm4s.{HailClassLoader, theHailClassLoaderForSparkWorkers}
import is.hail.HailContext
import is.hail.annotations._
import is.hail.backend.{BroadcastValue, ExecuteContext}
import is.hail.expr.TableAnnotationImpex
import is.hail.expr.ir.lowering.{RVDToTableStage, TableStage, TableS... | hail-is/hail | hail/src/main/scala/is/hail/expr/ir/TableValue.scala | Scala | mit | 7,683 |
package org.scalawiki.dto.cmd.query.prop
import org.scalawiki.dto.cmd._
import org.scalawiki.dto.cmd.query.Module
/**
* ?action=query&prop=categories
*
*/
case class Categories(override val params: CategoriesParam[Any]*)
extends Module[PropArg]("cl", "categories", "Gets a list of all categories used on the p... | intracer/scalawiki | scalawiki-core/src/main/scala/org/scalawiki/dto/cmd/query/prop/Categories.scala | Scala | apache-2.0 | 658 |
package com.alexitc.coinalerts.data.anorm.dao
import java.sql.Connection
import anorm._
import com.alexitc.coinalerts.data.anorm.parsers.ExchangeCurrencyParsers
import com.alexitc.coinalerts.models.{CreateExchangeCurrencyModel, _}
class ExchangeCurrencyPostgresDAO {
import ExchangeCurrencyParsers._
def create(... | AlexITC/crypto-coin-alerts | alerts-server/app/com/alexitc/coinalerts/data/anorm/dao/ExchangeCurrencyPostgresDAO.scala | Scala | gpl-3.0 | 3,459 |
package org.broadinstitute.clio.util.auth
import java.util.Collections
import com.google.auth.oauth2.GoogleCredentials
import org.scalamock.scalatest.MockFactory
import org.scalatest.{FlatSpec, Matchers}
class ClioCredentialsSpec extends FlatSpec with Matchers with MockFactory {
behavior of "ClioCredentials"
it... | broadinstitute/clio | clio-util/src/test/scala/org/broadinstitute/clio/util/auth/ClioCredentialsSpec.scala | Scala | bsd-3-clause | 1,364 |
package com.azavea.usace.programanalysis.geop
import geotrellis.raster.rasterize.{Callback, Rasterizer}
import geotrellis.raster.{RasterExtent, Tile}
import geotrellis.spark.{SpatialKey, TileLayerRDD}
import geotrellis.vector.{MultiPolygon, MultiPolygonResult, PolygonResult}
import org.apache.spark.rdd.RDD
import sc... | azavea/usace-program-analysis-geoprocessing | geop/src/main/scala/com/azavea/usace/programanalysis/geop/RasterGroupedCount.scala | Scala | apache-2.0 | 3,818 |
/*
* 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 ... | gioenn/xSpark | yarn/src/main/scala/org/apache/spark/deploy/yarn/config.scala | Scala | apache-2.0 | 11,007 |
/*
* 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... | pfcoperez/crossdata | crossdata-server/src/main/scala/com/stratio/crossdata/server/config/NumberActorConfig.scala | Scala | apache-2.0 | 2,381 |
package filodb.core.query
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import filodb.core.binaryrecord2.RecordSchema
import filodb.core.metadata.Column.ColumnType
import filodb.memory.format.{ZeroCopyUTF8String => UTF8Str}
import filodb.memory.format.vectors.{CustomBuckets, Hi... | filodb/FiloDB | core/src/test/scala/filodb.core/query/SerializedRangeVectorSpec.scala | Scala | apache-2.0 | 4,875 |
package spire.laws.shadows
import cats.kernel.Comparison
import spire.algebra.PartialOrder
trait ShadowPartialOrder[A, S] extends ShadowEq[A, S] with PartialOrder[Shadow[A, S]] {
implicit def A: PartialOrder[A]
implicit def S: PartialOrder[S]
override def eqv(x: Shadow[A, S], y: Shadow[A, S]): Boolean = super[... | non/spire | laws/src/main/scala/spire/laws/shadows/ShadowPartialOrder.scala | Scala | mit | 2,305 |
package app
import service._
import util._
import util.StringUtil._
import util.Directory._
import util.ControlUtil._
import jp.sf.amateras.scalatra.forms._
import org.apache.commons.io.FileUtils
import org.scalatra.i18n.Messages
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.lib.{FileMode, Constants}
import ... | wangsicong/gitbucket | src/main/scala/app/AccountController.scala | Scala | apache-2.0 | 16,908 |
package io.iohk.ethereum
object KeyTool {
def main(args: Array[String]): Unit = sun.security.tools.keytool.Main.main(args)
}
| input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/KeyTool.scala | Scala | mit | 129 |
/* Copyright (C) 2012-2013 Treode, 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... | Treode/cps | src/test/scala/com/treode/cps/io/FileChecks.scala | Scala | apache-2.0 | 2,749 |
def catalan(n: Int): Int =
if (n <= 1) 1
else (0 until n).map(i => catalan(i) * catalan(n - i - 1)).sum
/* to test
*var c = catalan(3)
*println(c)
*/ | euronautic/cosmos | code/mathematical-algorithms/catalan_number/catlan.scala | Scala | gpl-3.0 | 162 |
package piecewise
package intervaltree
import cats.instances.double._
import org.specs2._
class IntervalSpecs extends Specification {def is = s2"""
Correct creation of non empty interval $nonEmptyInterval
Correct creation of empty interval $emptyInterval
Correct behaviour of left closed right open interval $left... | daniil-timofeev/gridsplines | piecewise/src/test/scala/piecewise/intervaltree/IntervalSpecs.scala | Scala | apache-2.0 | 3,312 |
package pl.touk.nussknacker.engine.flink.api.process
import org.apache.flink.api.common.functions.{AbstractRichFunction, MapFunction, RuntimeContext}
import org.apache.flink.configuration.Configuration
import pl.touk.nussknacker.engine.api.Lifecycle
import pl.touk.nussknacker.engine.api.runtimecontext.EngineRuntimeCon... | TouK/nussknacker | engine/flink/components-api/src/main/scala/pl/touk/nussknacker/engine/flink/api/process/RichLifecycleFunction.scala | Scala | apache-2.0 | 1,052 |
import sbt._
import Keys._
import sbtassembly.Plugin.AssemblyKeys._
object Deploy {
val deployPackTask = TaskKey[Unit]("deploy-pack")
val deployPack = deployPackTask <<= (assembly, jarName in assembly, target, baseDirectory) map { (_, jarName, target, base) =>
IO.delete(target / "deploy")
IO.createDirector... | julienschmidt/FrameworkBenchmarks | lift-stateless/project/Deploy.scala | Scala | bsd-3-clause | 2,049 |
package com.twitter.finatra.http.test
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.ObjectNode
import com.twitter.finagle.httpx.{Request, Response}
import com.twitter.finatra.json.FinatraObjectMapper
import com.twitter.finatra.test.EmbeddedTwitterServer
import com.twitter.in... | yonglehou/finatra | http/src/test/scala/com/twitter/finatra/http/test/HttpTest.scala | Scala | apache-2.0 | 3,832 |
/**
* Copyright 2016, deepsense.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 applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/main/scala/io/deepsense/deeplang/params/exceptions/EmptyColumnNameException.scala | Scala | apache-2.0 | 747 |
package com.socrata.geospace.lib.shapefile
object ShapeFileConstants {
/** Shape file extension */
val ShapeFormat = "shp"
/** Shape index file extension */
val ShapeIndexFormat = "shx"
/** Attribute file extension */
val AttributeFormat = "dbf"
/** Projection file extension */
val ProjectionFormat ... | socrata-platform/geospace | src/main/scala/com/socrata/geospace/lib/shapefile/ShapeFileConstants.scala | Scala | apache-2.0 | 614 |
import org.scalatest.{Matchers, FlatSpec}
class AlmostPrimeCaseSolverTest extends FlatSpec with Matchers {
it should "return the amount of almost prime numbers in the case interval" in {
AlmostPrimeCaseSolver.solve(AlmostPrimeCase(1, 10)) should be (4)
AlmostPrimeCaseSolver.solve(AlmostPrimeCase(10, 20)) sho... | GMadorell/programming-challenges | tuenti-2015/02-AlmostPrime/src/test/scala/AlmostPrimeCaseSolverTest.scala | Scala | mit | 337 |
/*
* 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 ... | h2oai/sparkling-water | core/src/main/scala/ai/h2o/sparkling/backend/exceptions/WrongSparkVersion.scala | Scala | apache-2.0 | 965 |
package org.automanlang.core.question
import java.util.{Date, UUID}
import org.automanlang.core.AutomanAdapter
import org.automanlang.core.answer.{AbstractEstimate, EstimationOutcome}
import org.automanlang.core.mock.MockResponse
import org.automanlang.core.policy.aggregation.BootstrapEstimationMetaPolicy
cas... | dbarowy/AutoMan | libautoman/src/main/scala/org/automanlang/core/question/EstimationMetaQuestion.scala | Scala | gpl-2.0 | 1,569 |
package io.finch.benchmarks
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Warmup(iterations = 10, time = 3, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 10, time = 3, timeUnit = TimeUnit.SECONDS)
@For... | travisbrown/finch | benchmarks/src/main/scala/io/finch/benchmarks/FinchBenchmark.scala | Scala | apache-2.0 | 355 |
package org.apache.mesos.chronos.scheduler.mesos
import mesosphere.mesos.protos.Implicits._
import mesosphere.mesos.protos._
import org.apache.mesos.Protos
import org.apache.mesos.chronos.scheduler.jobs.constraints.{ConstraintSpecHelper, EqualsConstraint, LikeConstraint}
import org.specs2.mock.Mockito
import org.specs... | vixns/chronos | src/test/scala/org/apache/mesos/chronos/scheduler/mesos/ConstraintCheckerSpec.scala | Scala | apache-2.0 | 2,627 |
package io.buoyant.router.http
import com.twitter.finagle._
import com.twitter.finagle.http.{Request, Response}
import com.twitter.util.Future
import io.buoyant.router.ForwardedHeaderLabeler
import io.buoyant.router.ForwardedHeaderLabeler.Enabled
import java.net._
import scala.collection.mutable
/**
* Appends the [F... | linkerd/linkerd | router/http/src/main/scala/io/buoyant/router/http/AddForwardedHeader.scala | Scala | apache-2.0 | 2,593 |
package org.scalameta
import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context
import scala.reflect.{ClassTag, classTag}
import org.scalameta.internal.MacroHelpers
package object invariants {
// This macro behaves like `Predef.require` with an additional twist
// of taking apart `req... | Dveim/scalameta | scalameta/common/src/main/scala/org/scalameta/invariants/package.scala | Scala | bsd-3-clause | 8,318 |
package net.gree.aurora.scala
import java.io.{IOException, File}
import java.sql.{Connection, DriverManager, ResultSet}
import net.gree.aurora.scala.application.AuroraShardingService
import net.gree.aurora.scala.domain.cluster.AbstractClusterIdResolver
import net.gree.aurora.scala.domain.datasource.JDBCDataSource
imp... | gree/aurora | aurora-scala-example/src/main/scala/net/gree/aurora/scala/Main.scala | Scala | mit | 2,710 |
// src/main/scala/progscala2/basicoop/Zipcode.scala
package progscala2.basicoop
case class ZipCode(zip: Int, extension: Option[Int] = None) {
require(valid(zip, extension), // <1>
s"Invalid Zip+4 specified: $toString")
protected def valid(z: Int, e: Option[Int]): Boolean = ... | sunilrebel/programming-scala | examples/src/main/scala/progscala2/basicoop/zipcode.scala | Scala | mpl-2.0 | 868 |
package jigg.pipeline
/*
Copyright 2013-2015 Hiroshi Noji
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... | sakabar/jigg | src/main/scala/jigg/pipeline/CabochaAnnotator.scala | Scala | apache-2.0 | 10,333 |
package filodb.query.exec.rangefn
import com.typesafe.config.{Config, ConfigFactory}
import monix.execution.Scheduler.Implicits.global
import monix.reactive.Observable
import org.scalatest.concurrent.ScalaFutures
import filodb.core.MetricsTestData
import filodb.core.query._
import filodb.memory.format.ZeroCopyUTF8Str... | tuplejump/FiloDB | query/src/test/scala/filodb/query/exec/rangefn/LableJoinSpec.scala | Scala | apache-2.0 | 11,935 |
package ch.epfl.perfNetwork.jsfacade
import scala.scalajs.js
import org.scalajs.dom.raw.TextMetrics
@js.native
trait Window extends js.Object {
val document: DOMDocument
def alert(msg: String): Unit
def setInterval[U](function: js.Function0[U], interval: Number)
}
@js.native
trait DOMDocument extends js.Objec... | ThibaultUrien/SemesterProject | js/src/main/scala/ch/epfl/perfNetwork/jsfacade/JSComponents.scala | Scala | bsd-3-clause | 2,270 |
package cats
private trait Functor[F[_]] {
def map[A, B](fa: F[A])(f: A => B): F[B]
}
private object Functor {
def fmap[F[_] : Functor, A, B](fa: F[A])(f: A => B): F[B] =
implicitly[Functor[F]].map(fa)(f)
implicit val functorForList: Functor[List] = new Functor[List] {
override def map[A, B](fa: List... | cuzfrog/scala_sbt_template | src/main/scala/cats/Functor.scala | Scala | apache-2.0 | 583 |
/*
* 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 ... | guoxiaolongzte/spark | core/src/test/scala/org/apache/spark/memory/MemoryManagerSuite.scala | Scala | apache-2.0 | 14,855 |
package com.sksamuel.elastic4s.searches.aggs.pipeline
import com.sksamuel.elastic4s.script.ScriptDefinition
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder
trait PipelineAggregationDsl {
def avgBucketAggregation(name: String,
bucketsPath: String): AvgBucketDefinit... | ulric260/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/aggs/pipeline/PipelineAggDsl.scala | Scala | apache-2.0 | 2,090 |
package com.twitter.finagle.memcached.protocol.text.client
import com.twitter.finagle.memcached.protocol._
import com.twitter.io.Buf
/**
* Used by the client.
*/
private[finagle] class CommandToBuf extends AbstractCommandToBuf[Command] {
private[this] val GET = Buf.Utf8("get")
private[this] val GETS = Buf.Utf8... | mkhq/finagle | finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/client/CommandToBuf.scala | Scala | apache-2.0 | 2,790 |
package com.github.bimv.skife
object Density {
type DensitySpec = (String, Int)
val Ldpi = "ldpi" -> 120
val Mdpi = "mdpi" -> 160
val Hdpi = "hdpi" -> 240
val Xhdpi = "xhdpi" -> 320
val Xxhdpi = "xxhdpi" -> 480
val Xxxhdpi = "xxxhdpi" -> 640
val Densities = Map(Ldpi, Mdpi, Hdpi, Xhdpi, Xxhdpi, Xxxhdp... | bimv/skife | src/main/scala/com/github/bimv/skife/Density.scala | Scala | apache-2.0 | 1,218 |
package org.firedancer3d.surface
import org.scalajs.dom
import org.scalajs.dom.{html, webgl}
import scala.scalajs.js.annotation.JSExport
class WebGLCanvas {
}
object WebGLCanvas {
def getRenderingContext(canvas: html.Canvas): webgl.RenderingContext = {
var gl = canvas.getContext("webgl").asInstan... | cyberthinkers/FireDancer3D | firedancer3d_js/src/main/scala/org/firedancer3d/surface/WebGLCanvas.scala | Scala | mit | 466 |
/*
* 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 ... | michalsenkyr/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/AggregateBenchmark.scala | Scala | apache-2.0 | 18,505 |
/*
* 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 ... | takezoe/incubator-predictionio | examples/scala-parallel-recommendation/train-with-view-event/src/main/scala/Serving.scala | Scala | apache-2.0 | 1,105 |
package com.jrende.commands
import com.jrende.model.TweetManager
import twitter4j.Status
import scala.collection.JavaConversions
import com.jrende.Colors._
case class Open(params: Seq[String]) extends Command() {
override def execute(): Unit = {
if (params.isEmpty) {
return
}
val id = params.head... | Jrende/Skvitter | src/main/scala/com/jrende/commands/Open.scala | Scala | mit | 1,829 |
package sorm.core
import sorm._
import core._
import query._
import mappings._
import sext._, embrace._
import Query.{Filter => QFilter, _}
object Path {
sealed trait Part
object Part {
case class Dotted ( name : String ) extends Part
case class Braced ( name : String ) extends Part
}
def parts
... | sorm/sorm | src/main/scala/sorm/core/Path.scala | Scala | mit | 4,432 |
// Copyright (C) 2014 Open Data ("Open Data" refers to
// one or more of the following companies: Open Data Partners LLC,
// Open Data Research LLC, or Open Data Capital LLC.)
//
// This file is part of Hadrian.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in ... | opendatagroup/hadrian | hadrian/src/main/scala/com/opendatagroup/hadrian/lib/bytes.scala | Scala | apache-2.0 | 19,683 |
package com.github.novamage.svalidator.utils
import scala.reflect.runtime.{universe => ru}
/** Convenience class to create type safe case object enumerations
*
* @tparam A Base type of the enumerated value
*/
abstract class TypeBasedEnumeration[A: ru.TypeTag] {
trait Value {
self: A =>
/** Returns a... | NovaMage/SValidator | src/main/scala/com/github/novamage/svalidator/utils/TypeBasedEnumeration.scala | Scala | mit | 2,470 |
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/... | felixmulder/scala | src/library/scala/collection/parallel/immutable/ParSeq.scala | Scala | bsd-3-clause | 1,798 |
package reductions
import org.scalameter._
import common._
object LineOfSightRunner {
val standardConfig = config(
Key.exec.minWarmupRuns -> 40,
Key.exec.maxWarmupRuns -> 80,
Key.exec.benchRuns -> 100,
Key.verbose -> true
) withWarmer(new Warmer.Default)
def main(args: Array[String]) {
v... | jeffreylloydbrown/classwork | ParallelProgrammingInScala/reductions/src/main/scala/reductions/LineOfSight.scala | Scala | unlicense | 10,740 |
package com.seanshubin.detangler.bytecode
import java.io.DataInputStream
import com.seanshubin.detangler.collection.SetDifference
import org.scalatest.FunSuite
class ClassParserTest extends FunSuite {
test("parse simple class") {
val classParser = new ClassParserImpl()
val className = "com/seanshubin/detan... | SeanShubin/detangler | bytecode/src/test/scala/com/seanshubin/detangler/bytecode/ClassParserTest.scala | Scala | unlicense | 1,287 |
/*
* 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 ... | witgo/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/TableIdentifierParserSuite.scala | Scala | apache-2.0 | 8,678 |
package todomvc.example
import com.greencatsoft.angularjs.Angular
import com.searchmvc.{DmdCtrl, DmdService, SearchCtrl, SearchService}
import scala.scalajs.js.JSApp
import scala.scalajs.js.annotation.JSExport
@JSExport
object TodoApp extends JSApp {
override def main() {
Angular.module("searchmvc")
.co... | pharmpress/DmdBrowserScalaJs | js/src/main/scala/todomvc/example/TodoApp.scala | Scala | apache-2.0 | 447 |
package net.sansa_stack.query.spark.graph.jena.util
import org.apache.jena.graph.Triple
import org.apache.spark.SparkContext
/**
* Class that generate GraphX graph for input triples
*
* @param triples input triples to generate graph patterns
*
* @author Zhe Wang
*/
class BasicGraphPattern(triples: Iterato... | SANSA-Stack/SANSA-RDF | sansa-query/sansa-query-spark/src/main/scala/net/sansa_stack/query/spark/graph/jena/util/BasicGraphPattern.scala | Scala | apache-2.0 | 689 |
/*
* 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 ... | sanjeevtripurari/HiBench | src/sparkbench/src/main/scala/com/intel/sparkbench/datagen/convert/KmeansConvert.scala | Scala | apache-2.0 | 2,006 |
package be.wegenenverkeer.atomium.server.play
import be.wegenenverkeer.atomium.format.Feed
import be.wegenenverkeer.atomium.play.PlayJsonSupport
import play.api.http.MimeTypes
import play.api.libs.json.Writes
import be.wegenenverkeer.atomium.play.PlayJsonFormats.feedWrites
/**
* A Feed marshaller backed by a `play j... | joachimvda/atomium | modules/server-play/src/main/scala/be/wegenenverkeer/atomium/server/play/PlayJsonFeedMarshaller.scala | Scala | mit | 863 |
package scala.pickling.generics.tough
import org.scalatest.FunSuite
import scala.pickling._, scala.pickling.Defaults._, binary._
class C[T]
case class D[T](x: T) extends C[T]
class GenericsToughTest extends FunSuite {
test("main") {
val c: C[Int] = D(2)
val p = c.pickle
// TODO - We shouldn't really fo... | beni55/pickling | core/src/test/scala/pickling/run/generics-tough.scala | Scala | bsd-3-clause | 609 |
package is.hail.expr.ir
import is.hail.expr.JSONAnnotationImpex
import is.hail.expr.ir.agg.{AggElementsAggSig, AggStateSig, ArrayLenAggSig, GroupedAggSig, PhysicalAggSig}
import is.hail.expr.ir.functions.RelationalFunctions
import is.hail.types.virtual.{TArray, TInterval, Type}
import is.hail.utils.{space => _, _}
imp... | danking/hail | hail/src/main/scala/is/hail/expr/ir/Pretty.scala | Scala | mit | 21,267 |
/**
* Copyright (C) 2014 Kaj Magnus Lindberg (born 1979)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
... | debiki/debiki-server-old | modules/debiki-core/src/main/scala/com/debiki/core/PostsReadStats.scala | Scala | agpl-3.0 | 1,272 |
/*
* Copyright 2013 http4s.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | http4s/http4s | tests/shared/src/test/scala/org/http4s/parser/QueryParserSpec.scala | Scala | apache-2.0 | 4,041 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/package.scala | Scala | apache-2.0 | 1,395 |
/*
* ContinuousTest.scala
* Atomic continuous element tests.
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http://www.github... | lfkellogg/figaro | Figaro/src/test/scala/com/cra/figaro/test/library/atomic/continuous/ContinuousTest.scala | Scala | bsd-3-clause | 48,935 |
package lila.insight
import lila.pref.Pref
import lila.security.Granter
import lila.user.User
final class Share(
getPref: String => Fu[Pref],
areFriends: (String, String) => Fu[Boolean]) {
def getPrefId(insighted: User) = getPref(insighted.id) map (_.insightShare)
def grant(insighted: User, to: Option[U... | terokinnunen/lila | modules/insight/src/main/Share.scala | Scala | mit | 754 |
/**
* Copyright 2012-2013 StackMob
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | megamsys/newman | src/main/scala/com/stackmob/newman/concurrent/InMemoryAsyncMutex.scala | Scala | apache-2.0 | 1,099 |
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.