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 org.scalacheck.derive
import org.scalacheck.Gen
sealed abstract class Recursive[T] {
/**
* If scalacheck's size parameter prevents generating an arbitrary `T`, generate a value
* with this `Gen[T]` instead.
*/
def default: Gen[T]
}
object Recursive {
/**
* Flags type `T` as recursive. R... | alexarchambault/scalacheck-shapeless | core/shared/src/main/scala/org/scalacheck/derive/Recursive.scala | Scala | apache-2.0 | 884 |
package com.fhuertas.string.comparator.model.imp
import com.fhuertas.string.comparator.model.Character
import com.fhuertas.string.comparator.model.Character._
import com.fhuertas.string.comparator.utils.Generators
import org.scalatest.{Matchers, WordSpec}
import play.api.libs.json.Json
class ParsedStringDoubleTest ex... | fhuertas/scala-exercice | src/test/scala/com/fhuertas/string/comparator/model/imp/ParsedStringDoubleTest.scala | Scala | apache-2.0 | 7,202 |
package org.bitcoins.core.script.flag
import org.scalatest.{ FlatSpec, MustMatchers }
/**
* Created by chris on 3/23/16.
*/
class ScriptFlagFactoryTest extends FlatSpec with MustMatchers {
"ScriptFlagFactory" must "find a NONE script flag" in {
ScriptFlagFactory.fromString("NONE").get must be(ScriptVerifyNon... | Christewart/bitcoin-s-core | src/test/scala/org/bitcoins/core/script/flag/ScriptFlagFactoryTest.scala | Scala | mit | 2,348 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/mllib/stat/test/ChiSqTest.scala | Scala | apache-2.0 | 10,627 |
package org.jetbrains.plugins.scala.traceLogViewer.selection
import com.intellij.icons.AllIcons
import com.intellij.openapi.actionSystem.{ActionManager, AnAction, AnActionEvent, DefaultActionGroup}
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.fileChooser.{FileChooser, FileType... | JetBrains/intellij-scala | scala/traceLogViewer/src/org/jetbrains/plugins/scala/traceLogViewer/selection/TraceLogSelectionView.scala | Scala | apache-2.0 | 4,028 |
/*
* 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 | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/NormalizeFloatingPointNumbersSuite.scala | Scala | apache-2.0 | 5,705 |
package com.datastax.spark.connector.sql
import java.sql.Date
import java.time.LocalDate
import java.util.TimeZone
import com.datastax.oss.driver.api.core.DefaultProtocolVersion
import com.datastax.spark.connector.SparkCassandraITSpecBase
import com.datastax.spark.connector.cql.CassandraConnector
import org.apache.sp... | datastax/spark-cassandra-connector | connector/src/it/scala/com/datastax/spark/connector/sql/CassandraDataFrameDateBehaviors.scala | Scala | apache-2.0 | 2,739 |
/*
* 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... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/CATO15.scala | Scala | apache-2.0 | 1,359 |
package epic.parser
package projections
import breeze.util.{Encoder, Index}
import collection.mutable.ArrayBuffer
import scala.reflect.ClassTag
/**
* For computing projections from a fine grammar to a coarse grammar.
*
* There are two indexes maintained for the fine symbols: a globally unique
* id, and a local p... | langkilde/epic | src/main/scala/epic/parser/projections/ProjectionIndexer.scala | Scala | apache-2.0 | 4,904 |
package remotely.transport.aeron
import remotely.transport.aeron.tests.server.Test1Client
import remotely.{Remote, Endpoint}
import scalaz.concurrent.Task
import remotely.codecs._
package object tests {
def stringsTest(endpoint: Endpoint): Unit = {
val size = 1000000//More then 2000000 requires multi-term f... | lech-glowiak/remotely-aeron | test/src/main/scala/remotely/transport/aeron/tests/package.scala | Scala | apache-2.0 | 1,659 |
package edu.berkeley.nlp.coref.sem
import edu.berkeley.nlp.futile.fig.basic.IOUtils
import edu.berkeley.nlp.futile.util.Counter
import edu.berkeley.nlp.futile.util.Logger
import java.io.File
@SerialVersionUID(1L)
class QueryCountsBundle(val wordCounts: Counter[String],
val pairCounts: Counter[(... | nate331/jbt-berkeley-coref-resolution | src/main/java/edu/berkeley/nlp/coref/sem/QueryCountsBundle.scala | Scala | gpl-3.0 | 1,240 |
package object plumitive {
type ImageBytes = Array[Byte]
}
| ostapneko/plumitive | src/main/scala/plumitive/package.scala | Scala | mit | 61 |
package models.db
class DatabaseException(message: String = null, reason: Throwable = null) extends RuntimeException(message, reason)
class ObjectNotFoundException(message: String = null, reason: Throwable = null) extends DatabaseException(message, reason)
| vatt2001/finprocessor | app/models/db/Exception.scala | Scala | mit | 259 |
package gapt.formats.prover9
import scala.util.parsing.combinator.{ PackratParsers, RegexParsers }
import gapt.expr._
import gapt.expr.formula.All
import gapt.expr.formula.And
import gapt.expr.formula.Bottom
import gapt.expr.formula.Eq
import gapt.expr.formula.Ex
import gapt.expr.formula.Imp
import gapt.expr.formula.N... | gapt/gapt | core/src/main/scala/gapt/formats/prover9/Prover9TermParser.scala | Scala | gpl-3.0 | 6,005 |
//: ----------------------------------------------------------------------------
//: Copyright (C) 2015 Verizon. 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 Licen... | neigor/funnel | chemist-static/src/test/scala/StaticTest.scala | Scala | apache-2.0 | 1,710 |
package modules
import com.google.inject.Provider
import com.typesafe.config.ConfigFactory
import pl.edu.agh.iet.akka_tracing.config.ConfigurationReader
import pl.edu.agh.iet.akka_tracing.visualization.data.DataSource
import play.api.inject.{ Binding, Module }
import play.api.{ Configuration, Environment }
class Data... | akka-tracing-tool/akka-tracing-visualization | app/modules/DatabaseModule.scala | Scala | gpl-2.0 | 851 |
package com.kumar.wordfinder
object FindWord {
class Letter(val x: Int, val y: Int, val letter: Char, var used: Boolean = false) {
override def toString = s"($x, $y) -> $letter"
}
object Board {
def apply(board: Board): Board = {
val b = new Board(board.width, board.height)
for(i <-... | skumargithub/Stuff | src/main/scala/com/kumar/wordfinder/FindWord.scala | Scala | gpl-3.0 | 3,511 |
/**
* Copyright (C) 2015 Stratio (http://stratio.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 ap... | luismcl/crossdata | cassandra/src/test/scala/com/stratio/crossdata/connector/cassandra/CassandraImportTablesIT.scala | Scala | apache-2.0 | 6,185 |
/*
* 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/CooperatingNumeric.scala | Scala | apache-2.0 | 4,789 |
/*
* 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... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/ListShouldContainAtLeastOneElementOfSpec.scala | Scala | apache-2.0 | 31,815 |
/*
* 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 ... | tillrohrmann/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/LegacyTableSourceITCase.scala | Scala | apache-2.0 | 12,321 |
package intellij.haskell.spellchecker
import intellij.haskell.HaskellLanguage
import com.intellij.psi.PsiElement
import com.intellij.spellchecker.tokenizer.{Tokenizer, SpellcheckingStrategy}
/**
* Provide spellchecker support for Haskell sources.
*/
class HaskellSpellcheckingStrategy extends SpellcheckingStrategy {... | rikvdkleij/intellij-haskell | src/main/scala/intellij/haskell/spellchecker/HaskellSpellcheckingStrategy.scala | Scala | apache-2.0 | 431 |
/*
* 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 ... | ahnqirage/spark | sql/core/src/test/scala/org/apache/spark/sql/util/DataFrameCallbackSuite.scala | Scala | apache-2.0 | 9,575 |
package io.youi
trait MessageException {
def message: String
}
| outr/youi | core/shared/src/main/scala/io/youi/MessageException.scala | Scala | mit | 66 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package base
package types
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScAnnotationExpr
import org.jetbrains.plugins.scala.lang.resolve.ScalaResolveResult
/**
* Author: Alex... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/api/base/types/ScSimpleTypeElement.scala | Scala | apache-2.0 | 1,344 |
package skinny.engine.csrf
import java.security.SecureRandom
/**
* CSRF token value generator.
*/
object CsrfTokenGenerator {
def apply(): String = generateCsrfToken()
private[this] def hexEncode(bytes: Array[Byte]): String = {
((new StringBuilder(bytes.length * 2) /: bytes) { (sb, b) =>
if ((b.toIn... | holycattle/skinny-framework | engine/src/main/scala/skinny/engine/csrf/CsrfTokenGenerator.scala | Scala | mit | 590 |
package org.jetbrains.plugins.scala.lang.checkers.checkPrivateAccess
package generated
class CheckPrivateAccessSimpleTest extends CheckPrivateAccessTestBase {
//This class was generated by build script, please don't change this
override def folderPath: String = super.folderPath + "simple/"
def testCompanionAcce... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/lang/checkers/checkPrivateAccess/generated/CheckPrivateAccessSimpleTest.scala | Scala | apache-2.0 | 442 |
/***********************************************************************
* 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 ... | nagavallia/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/index/Z3IdxStrategyTest.scala | Scala | apache-2.0 | 16,588 |
/*
* 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 | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterManager.scala | Scala | apache-2.0 | 5,870 |
package sp.system
import akka.actor._
import akka.testkit._
import com.typesafe.config._
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
import sp.domain.Logic._
import sp.domain._
import sp.system.messages._
import scala.concurrent.duration._
/**
* Created by Kristofer on 2014-06-17.
*/
class Ser... | kristoferB/SP | sp1/src/test/scala/sp/system/ServiceTalkerTest.scala | Scala | mit | 6,930 |
import scala.util.control.Breaks._
object Solution {
val N = readLine().toLong
val MOD = 10007
def power(base: Int, exponent: Int): Int = {
if (exponent == 0) return 1;
if (exponent == 1) return base;
var answer = power(base, exponent / 2);
answer = (answer * answer)
if (exponent % 2 == 1) answer = (... | shengmin/coding-problem | hackerrank/how-many-matrices/src/Solution.scala | Scala | mit | 719 |
package org.killbill.billing.client.model
import org.killbill.billing.client.model.ObjectType.ObjectType
import org.killbill.billing.client.util.JsonHelper
import spray.json.{DefaultJsonProtocol, JsonFormat}
case class CustomField(
customFieldId: Option[String],
objectId: Option[String],
objectType: Option[Obje... | jgomez-vp/killbill-client-scala | src/main/scala/org/killbill/billing/client/model/CustomField.scala | Scala | apache-2.0 | 844 |
/*
* Copyright 2012 @peltchu
*
* 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 ... | peltchu/scatter | src/test/scala/org/scatter/TransformationsSuite.scala | Scala | apache-2.0 | 4,159 |
package dotty.tools
package dotc
package parsing
import dotty.tools.dotc.core.Constants.Constant
import dotty.tools.dotc.core.Flags
import dotty.tools.dotc.core.Flags.FlagSet
import scala.language.implicitConversions
import JavaTokens._
import JavaScanners._
import Parsers._
import core._
import Contexts._
import Na... | yusuke2255/dotty | src/dotty/tools/dotc/parsing/JavaParsers.scala | Scala | bsd-3-clause | 30,382 |
/*
* Copyright (C) 2016 Piotr Tarsa ( http://github.com/tarsa )
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the author be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for a... | jawp/wicked-playground | modules/server/src/main/scala/wp/IndexPage.scala | Scala | mit | 1,507 |
/*
* Copyright 2017 Chen Hua (Harry)
*
* 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... | chenharryhua/qidong | src/main/scala/qidong/pipeline/MMs.scala | Scala | apache-2.0 | 5,998 |
/*
* Created on 2010/10/14
* Copyright (c) 2010-2011, Wei-ju Wu.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, ... | logicmoo/zmpp2 | zmpp-tads3/src/main/scala/org/zmpp/tads3/BigNumber.scala | Scala | bsd-3-clause | 3,587 |
package frameless
package functions
import org.scalacheck.Prop
import org.scalacheck.Prop._
class UdfTests extends TypedDatasetSuite {
test("one argument udf") {
def prop[A: TypedEncoder, B: TypedEncoder](data: Vector[X1[A]], f1: A => B): Prop = {
val dataset: TypedDataset[X1[A]] = TypedDataset.create(da... | adelbertc/frameless | dataset/src/test/scala/frameless/functions/UdfTests.scala | Scala | apache-2.0 | 6,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 ... | mahak/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/NoSuchItemException.scala | Scala | apache-2.0 | 4,322 |
package com.codeseq.mcdc
import akka.io.{PipelineContext, SymmetricPipePair, SymmetricPipelineStage}
import akka.util.{ByteString, ByteIterator}
import scala.annotation.{implicitNotFound, tailrec}
import scala.concurrent.duration._
class MarshallingException(reason: String) extends RuntimeException(reason)
case clas... | derekwyatt/akka-memcached | src/main/scala/com/codeseq/mcdc/protocol.scala | Scala | apache-2.0 | 12,101 |
/*
* 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 ... | hengyicai/OnlineAggregationUCAS | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala | Scala | apache-2.0 | 2,856 |
package com.imaginea.activegrid.core.models
/**
* Created by ranjithrajd on 25/10/16.
*/
import com.typesafe.scalalogging.Logger
import org.neo4j.graphdb.Node
import org.slf4j.LoggerFactory
case class UserGroup(override val id: Option[Long]
, name: String
, users: Set[User... | nagulmeeras/activeGrid | src/main/scala/com/imaginea/activegrid/core/models/UserGroup.scala | Scala | apache-2.0 | 2,795 |
package knot.data.buffers
import java.nio.ByteOrder
import knot.data.ByteNode
import scala.collection.mutable.ArrayBuffer
class ArrayOutputSink(bufferSize: Int, byteOrder: ByteOrder) extends OutputSink {
private[this] val _out = ArrayBuffer.empty[UnsafeArrayBuffer]
private[this] var _last: UnsafeArrayBuffer = _... | defvar/knot | knot-data/src/main/scala/knot/data/buffers/ArrayOutputSink.scala | Scala | mit | 1,350 |
package net.kamekoopa.play.plugin.sbt.flyway
import sbt.Keys._
import com.googlecode.flyway.core.util.logging.LogCreator
import com.googlecode.flyway.core.util.logging
import sbt.{Logger => SbtLogger}
/**
* ログ出力用のヘルパ
*/
object Logger {
/**
* [[sbt.Keys.TaskStreams]]ロガー
*
* @param streams taskStream
*... | kamekoopa/play-sbt-flyway-plugin | src/main/scala/net/kamekoopa/play/plugin/sbt/flyway/Logger.scala | Scala | apache-2.0 | 2,175 |
package sqltyped.json4s
import org.scalatest._
import shapeless._
import sqltyped._
class JSONExampleSuite extends FunSuite with matchers.ShouldMatchers {
test("Record to JSON") {
val SomeTag = Witness("SomeTag")
val addr = ("street" ->> "Boulevard") :: ("city" ->> tag[SomeTag.T]("Helsinki")) :: HNil
v... | jonifreeman/sqltyped | json4s/src/test/scala/jsonexample.scala | Scala | apache-2.0 | 1,867 |
/*
* 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 ... | UBOdin/mimir | src/main/scala/org/apache/spark/sql/execution/datasources/ubodin/csv/CSVOptions.scala | Scala | apache-2.0 | 8,207 |
package provingground.scalahott
import provingground._, HoTT._
import EnumType._
import ScalaRep._
import provingground.scalahott.ScalaUniv._
object EnumFuncs {
def allMaps[U, V](dom: List[U], codom: List[V]): List[Map[U, V]] =
dom match {
case List() => List(Map())
case x :: List() => for (y <-... | siddhartha-gadgil/ProvingGround | core/src/main/scala/provingground/scalahott/EnumFuncs.scala | Scala | mit | 3,494 |
package com.sksamuel.scrimage.filter
import com.sksamuel.scrimage.ImmutableImage
import com.sksamuel.scrimage.nio.PngWriter
import org.scalatest.{FunSuite, Matchers}
class PointillizeFilterTest extends FunSuite with Matchers {
implicit private val writer: PngWriter = PngWriter.MaxCompression
private val origina... | sksamuel/scrimage | scrimage-filters/src/test/scala/com/sksamuel/scrimage/filter/PointillizeFilterTest.scala | Scala | apache-2.0 | 2,087 |
package scray.hdfs.compaction.data
/**
* TODO: adapt to key class which is used to group aggregates for your job
*/
case class AggregationKey(access: String, typ: String, category: String, direction: String) extends Ordered[AggregationKey] {
import scala.math.Ordering._
override def compare(that: AggregationKey)... | scray/scray | scray-hdfs/modules/scray-hdfs-compaction-job/src/main/scala/scray/hdfs/compaction/data/AggregationKey.scala | Scala | apache-2.0 | 502 |
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package io.fsq.twofishes.indexer.importers.geonames
import io.fsq.twofishes.util.{FeatureNamespace, StoredFeatureId}
import java.io.File
import org.slf4s.Logging
trait TsvHelperFileParserLogger {
def logUnused: Iterable[String]
}
class GeoIdTsvHelperFileP... | foursquare/fsqio | src/jvm/io/fsq/twofishes/indexer/importers/geonames/TsvHelperFileParser.scala | Scala | apache-2.0 | 3,873 |
/*
* 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 ... | tillrohrmann/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/plan/rules/logical/SplitPythonConditionFromJoinRuleTest.scala | Scala | apache-2.0 | 2,951 |
package alexadewit_on_github.unit_converter
import argonaut._, Argonaut._, DecodeResult._
import scalaz._, Scalaz._
import MeasurementSystemCodecs._
class MeasurementSystemFileRepository( filePath: String ) extends MeasurementSystemRepository {
private lazy val fileContents = readFile( filePath )
private lazy v... | AlexaDeWit/UnitConverter | src/main/scala/MeasurementSystemFileRepository.scala | Scala | bsd-3-clause | 1,514 |
package com.strava.domain
case class Gear(id: String,
primary: Boolean,
name: String,
distance: Int,
brand_name: Option[String] = None,
model_name: Option[String] = None,
frame_type: Option[String] = None,
d... | city81/strava-service | src/main/scala/com/strava/domain/Gear.scala | Scala | bsd-2-clause | 391 |
/*
* 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/main/scala/org/apache/spark/storage/TachyonBlockManager.scala | Scala | apache-2.0 | 5,707 |
package sample.kamon
import java.util.concurrent.TimeUnit
import scala.concurrent.duration.FiniteDuration
class SimpleBackoffStrategy(
private val backoffDelta: Long = 3000,
private val maxBackoff: Long = 30000
) extends BackoffStra... | frossi85/akka-kamon-sample | src/main/scala/sample/kamon/SimpleBackoffStrategy.scala | Scala | apache-2.0 | 656 |
/*
* Copyright (c) 2012 Sony Pictures Imageworks Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, thi... | imageworks/scala-migrations | src/test/scala/com/imageworks/migration/tests/grant_and_revoke/Migrate_20121013072344_EmptyPrivilegeList.scala | Scala | bsd-3-clause | 2,005 |
/*
* 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... | lhfei/spark-in-action | spark-2.x/src/main/scala/org/apache/spark/examples/ml/FPGrowthExample.scala | Scala | apache-2.0 | 2,037 |
package com.arcusys.valamis.web.servlet.slides
import javax.servlet.http.HttpServletResponse
import com.arcusys.learn.liferay.services.{PermissionHelper, UserLocalServiceHelper}
import com.arcusys.learn.liferay.util.PortletName.LessonStudio
import com.arcusys.valamis.content.exceptions.NoContentException
import com.a... | arcusys/Valamis | valamis-portlets/src/main/scala/com/arcusys/valamis/web/servlet/slides/SlideSetServlet.scala | Scala | gpl-3.0 | 6,205 |
/*
* Copyright (c) 2014 Pwootage
*
* This file is part of SASM.
*
* SASM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ... | Pwootage/SASM | src/main/scala/com/pwootage/sasm/parser/AssemblerParser.scala | Scala | gpl-3.0 | 3,440 |
/* Copyright 2012 Elias Ponvert
*
* 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... | eponvert/corpora | src/main/scala/multiword/corpus/treebank/constituent/tree/package.scala | Scala | apache-2.0 | 740 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.linker.backend.javascript
... | SebsLittleHelpers/scala-js | linker/shared/src/main/scala/org/scalajs/linker/backend/javascript/JSBuilders.scala | Scala | apache-2.0 | 2,706 |
package net.orfjackal.dimdwarf.auth
import net.orfjackal.dimdwarf.mq.MessageSender
import net.orfjackal.dimdwarf.controller.Hub
import net.orfjackal.dimdwarf.actors._
import javax.inject.Inject
@ActorScoped
class AuthenticatorActor @Inject()(@Hub toHub: MessageSender[Any], checker: CredentialsChecker[Credentials]) ex... | orfjackal/dimdwarf | dimdwarf-core/src/main/scala/net/orfjackal/dimdwarf/auth/AuthenticatorActor.scala | Scala | apache-2.0 | 832 |
package tasseldata
class TasselAssertion(asN3Resource: String, sourceVueID: Int, subj: TasselObj, pred: TasselObj, obj: TasselObj)
extends TasselObj(asN3Resource, sourceVueID) {
def subj(): TasselObj = subj
def pred(): TasselObj = pred
def obj(): TasselObj = obj
override def toStr: String = { ... | wbhicks/annotated-configs | OvenSuitTassel/src/tasseldata/TasselAssertion.scala | Scala | gpl-3.0 | 426 |
/**
* License
* =======
*
* The MIT License (MIT)
*
*
* Copyright (c) 2017 Antoine DOERAENE @sherpal
*
* 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 restrictio... | sherpal/scalajs-ui | src/main/scala/gui/Point.scala | Scala | mit | 1,698 |
/*
* Copyright 2015 Rik van der Kleij
*
* 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... | ericssmith/intellij-haskell | src/com/powertuple/intellij/haskell/external/GhcModiInfo.scala | Scala | apache-2.0 | 7,661 |
package isabelle.eclipse.core.text
/** Utilities to perform `diff` on text: find differences between two strings and calculate replacements
* to bring the one of the strings to match the other one.
*
* @author Andrius Velykis
*/
object DiffUtils {
/** Finds differences between the given string arguments. ... | andriusvelykis/isabelle-eclipse | isabelle.eclipse.core/src/isabelle/eclipse/core/text/DiffUtils.scala | Scala | epl-1.0 | 3,501 |
package controllers
import play.api._
import play.api.libs.ws._
import play.api.mvc._
import scala.concurrent.ExecutionContext.Implicits.global
import models.{Session, User, FacebookUser}
import scala.concurrent.Future
/**
* Facebook Login controller which controls everything about Facebook Login flow
*/
object Fac... | mehmetakiftutuncu/twittercik | app/controllers/FacebookLogin.scala | Scala | apache-2.0 | 6,621 |
package org.yotchang4s.ch2.board
import org.yotchang4s.ch2._
import org.yotchang4s.ch2.Ch2Config
trait BoardComponent {
val board: BoardRepository
trait BoardRepository {
def findCategories(implicit config: Ch2Config): Either[Ch2Exception, List[Category]]
}
} | yotchang4s/gikolet | src/org/yotchang4s/ch2/board/BoardComponent.scala | Scala | bsd-3-clause | 273 |
package controllers
import play.api._
import play.api.mvc._
import play.api.libs.concurrent.Execution.Implicits._
import play.api.libs.ws.WS
import play.mvc.Http
import org.omg.CosNaming.NamingContextPackage.NotFound
import models._
import play.api.libs.json._
object Application extends Controller with ProvidesHeader... | tegonal/hydroapp | app/controllers/Application.scala | Scala | lgpl-3.0 | 643 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.annotation._
import leon.lang._
object OperatorEquals7 {
def test(a: String, b: String) = a == b
def _main(): Int = {
val str1 = "Hello"
val str2 = "GenC"
if (test(str1, str1) && test(str2, str2)) {
if (test(str1, str2)) 1
else 0
}... | epfl-lara/leon | src/test/resources/regression/genc/valid/OperatorEquals7.scala | Scala | gpl-3.0 | 415 |
package vault
import java.sql.SQLException
import scalaz._, Scalaz._, Free._
case class DbValueT[F[+_], +A](run: F[DbValue[A]]) {
type DbValueTF[+A] = DbValueT[F, A]
def fold[X](fail: DbFailure => X, ok: A => X)(implicit F: Functor[F]): F[X] =
run.map(_.fold(fail, ok))
def toOption(implicit F: Functor[F])... | markhibberd/vault | src/main/scala/vault/DbValueT.scala | Scala | bsd-3-clause | 1,460 |
package com.datastax.spark.connector.rdd.partitioner
import scala.collection.JavaConversions._
import scala.collection.parallel.ForkJoinTaskSupport
import scala.concurrent.forkjoin.ForkJoinPool
import org.apache.cassandra.thrift.Cassandra
import org.apache.spark.Partition
import com.datastax.driver.core.{Metadata, T... | nvoron23/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/rdd/partitioner/CassandraRDDPartitioner.scala | Scala | apache-2.0 | 7,312 |
case class CaseClass(x: Float)
22f match {
case CaseClass(<caret>) =>
}
//x: Float | loskutov/intellij-scala | testdata/parameterInfo/patternParameterInfo/caseClasses/CaseClass.scala | Scala | apache-2.0 | 85 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monifu/monifu | monix-reactive/shared/src/test/scala/monix/reactive/consumers/TransformInputConsumerSuite.scala | Scala | apache-2.0 | 3,275 |
package aws.daleks.eager
import com.amazonaws.auth.AWSCredentialsProvider
import com.amazonaws.regions.Region
import com.amazonaws.services.s3.AmazonS3Client
import com.amazonaws.regions.ServiceAbbreviations
import scala.collection.JavaConverters._
import com.amazonaws.services.s3.model.{ Region => S3Region }
import c... | ggallego/aws-daleks | src/main/scala/aws/daleks/eager/EagerDynamoDBDalek.scala | Scala | apache-2.0 | 905 |
package skinny.controller
import scala.language.dynamics
import skinny._
import skinny.util.DateTimeUtil
object Params {
val Year = "Year"
val Month = "Month"
val Day = "Day"
val Hour = "Hour"
val Minute = "Minute"
val Second = "Second"
val Date = "Date"
val Time = "Time"
val _year =... | seratch/skinny-framework | common/src/main/scala/skinny/controller/Params.scala | Scala | mit | 5,347 |
object Solution {
def main(args: Array[String]) = {
val n = readLine.toInt
val xs = readLine.split(" ").map(_.toInt).toArray
val q = readLine.toInt
for (ix <- 1 to q) {
val List(x, y) = readLine.split(" ").map(_.toInt).toList
if (x > y || xs(x - 1) % 2 == 1 ||... | pbl64k/HackerRank-Contests | 2014-06-16-Weekly/EvenOddQuery/eoq.scala | Scala | bsd-2-clause | 474 |
package nodescala
import scala.language.postfixOps
import scala.concurrent._
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
import scala.async.Async.{async, await}
import dispatch.retry.Success
object Main {
def main(args: Array[String]) {
// TO IMPLEMENT
// 1. instantiate the ... | 4DD8A19D69F5324F9D49D17EF78BBBCC/Princip_les_of_Rea_ctive_Progra_mming | nodescala/src/main/scala/nodescala/Main.scala | Scala | mit | 1,583 |
package im.mange.shoreditch.engine
import org.joda.time.LocalDateTime
import im.mange.shoreditch.engine.hipster._
import im.mange.shoreditch.engine.hipster.Action
import im.mange.shoreditch.engine.hipster.Check
//TODO: we should notify if the script ultimately passed or failed (i.e was aborted after n attempts
trait ... | alltonp/shoreditch-engine | src/main/scala/im/mange/shoreditch/engine/ScriptEventListener.scala | Scala | apache-2.0 | 990 |
/*
* 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 ... | jkbradley/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveHintsSuite.scala | Scala | apache-2.0 | 9,663 |
import java.util.UUID
import io.finch._
import io.finch.syntax.get
case class Person(name: String, age: Int)
case class PersonInfo(id: Long, firstName: String, lastName: String, age: Int)
object HtmlEndpoints {
import com.twitter.finagle.http.Response
import com.twitter.io.Buf
private def htmlResponse(documen... | denisftw/advanced-scala-code | finch/src/main/scala/FinchMain.scala | Scala | apache-2.0 | 3,150 |
/**
* Digi-Lib - base library for Digi components
*
* Copyright (c) 2012-2015 Alexey Aksenov ezh@ezh.msk.ru
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.... | ezh/digi-lib | src/main/scala/org/digimead/digi/lib/log/api/XRichLogger.scala | Scala | apache-2.0 | 23,403 |
package io.continuum.bokeh
package tests
import org.specs2.mutable._
sealed trait MyEnum extends EnumType
@enum object MyEnum extends Enumerated[MyEnum] {
case object Foo extends MyEnum
case object Bar extends MyEnum
case object Baz extends MyEnum
}
class EnumSpec extends Specification {
"Enumerated[... | bokeh/bokeh-scala | core/src/test/scala/Enum.scala | Scala | mit | 799 |
import jp.ijufumi.openreports.controller.Controllers
import jp.ijufumi.openreports.controller.settings.{
Controllers => SettingsController
}
import skinny._
import skinny.controller.AssetsController
import skinny.session.SkinnySessionInitializer
class Bootstrap extends SkinnyLifeCycle {
// If you prefer more logg... | ijufumi/openreports_scala | src/main/scala/Bootstrap.scala | Scala | mit | 1,144 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/UpdatingSessionsExec.scala | Scala | apache-2.0 | 3,247 |
/**
* Copyright (C) 2015 Stratio (http://stratio.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 ap... | pmadrigal/spark-mongodb | spark-mongodb/src/main/scala/com/stratio/datasource/mongodb/client/MongodbClientFactory.scala | Scala | apache-2.0 | 6,564 |
package io.actorbase.actor.main
import akka.actor.ActorRef
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 - 2017 Riccardo Cardin
*
* 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 S... | rcardin/actorbase | src/main/scala/io/actorbase/actor/main/Collection.scala | Scala | mit | 1,352 |
package spark.storage
import java.io.{InputStream, OutputStream}
import java.nio.{ByteBuffer, MappedByteBuffer}
import scala.collection.mutable.{HashMap, ArrayBuffer, HashSet}
import akka.actor.{ActorSystem, Cancellable, Props}
import akka.dispatch.{Await, Future}
import akka.util.Duration
import akka.util.duration.... | baeeq/incubator-spark | core/src/main/scala/spark/storage/BlockManager.scala | Scala | bsd-3-clause | 37,536 |
package breeze.features
import breeze.linalg._
import java.util
import breeze.linalg.operators._
/**
* Represents a feature vector of indicator (i.e. binary) features.
* Not a full vector. Only supports dot and addition with a real vector.
*
* TODO: possibly rename to IndicatorVector?
*
* @author dlwh
*/
class... | wavelets/breeze | src/main/scala/breeze/features/FeatureVector.scala | Scala | apache-2.0 | 2,286 |
/*
* Copyright 2014-2022 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | Netflix/atlas | atlas-core/src/test/scala/com/netflix/atlas/core/util/StringsSuite.scala | Scala | apache-2.0 | 20,968 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | monix-tail/shared/src/test/scala/monix/tail/IterantTakeWhileSuite.scala | Scala | apache-2.0 | 4,928 |
/*
* 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 ... | eyalfa/spark | core/src/main/scala/org/apache/spark/scheduler/local/LocalSchedulerBackend.scala | Scala | apache-2.0 | 6,039 |
package com.twitter.finagle.toggle
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class WriteOnceTest extends FunSuite {
test("write does not allow null") {
val wo = new WriteOnce[Int](1234)
intercept[IllegalArgumentExcept... | adriancole/finagle | finagle-toggle/src/test/scala/com/twitter/finagle/toggle/WriteOnceTest.scala | Scala | apache-2.0 | 887 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package kafka.manager.utils
import java.util.Properties
import LogkafkaErrors._
import kafka.manager.BaseTest
import kafka.manager.model.ActorModel
import ActorModel.{LogkafkaIdentity}
import kafka.ma... | patelh/kafka-manager | test/kafka/manager/utils/TestCreateLogkafka.scala | Scala | apache-2.0 | 6,842 |
package io.fintrospect.formats
import java.io.OutputStream
import java.nio.charset.Charset.defaultCharset
import com.twitter.finagle.http.Status
import com.twitter.io.{Buf, Bufs}
import io.fintrospect.ContentType
import io.fintrospect.util.HttpRequestResponseUtil.statusAndContentFrom
import io.netty.buffer.Unpooled.c... | daviddenton/fintrospect | core/src/test/scala/io/fintrospect/formats/AbstractResponseBuilderSpec.scala | Scala | apache-2.0 | 9,124 |
/*
* This file is part of Apparat.
*
* Copyright (C) 2010 Joa Ebert
* http://www.joa-ebert.com/
*
* This library 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 2.1 of the Lice... | joa/apparat | apparat-core/src/main/scala/apparat/abc/AbcMetadata.scala | Scala | lgpl-2.1 | 1,332 |
package com.tpl.hamcraft.compat
import cpw.mods.fml.common.{ModAPIManager, ModContainer, Loader}
import com.tpl.hamcraft.HamCraftMod
import java.util
import com.tpl.hamcraft.config.Tuning
object PowerProxy {
final val IC2_MOD_ID = "IC2"
final val BC_MOD_ID = "BuildCraftAPI|power"
final val TE_MOD_ID = "CoFHCore... | piotrb/hamcraft | src/main/scala/com/tpl/hamcraft/compat/PowerProxy.scala | Scala | bsd-2-clause | 1,984 |
/*
* Copyright (c) 2014 Paul Bernard
*
* 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... | quantintel/spectrum | financial/src/main/scala/org/quantintel/ql/time/calendars/Indonesia.scala | Scala | apache-2.0 | 7,344 |
package com.greencatsoft.greenlight.matcher
import com.greencatsoft.greenlight.TestFailureException
import com.greencatsoft.greenlight.grammar.Verb.Be
trait EqualityMatcher extends Matcher[Any, Be, Any] {
override def matches(actual: Any, expected: Any): Unit =
if (actual != expected)
throw TestFailureEx... | greencatsoft/greenlight | shared/main/scala/com/greencatsoft/greenlight/matcher/EqualityMatcher.scala | Scala | apache-2.0 | 549 |
/*
* ScalaRay - Ray tracer based on pbrt (see http://pbrt.org) written in Scala
* Copyright (C) 2009, 2010, 2011 Jesper de Jong
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either ve... | jesperdj/scalaray | src/main/scala/org/jesperdj/scalaray/raster/Raster.scala | Scala | gpl-3.0 | 1,237 |
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.