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 |
|---|---|---|---|---|---|
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/ ... | S-Mach/effectful | src/main/scala/effectful/impl/EffectIteratorOps.scala | Scala | mit | 5,607 |
/**
* 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... | chirino/activemq-apollo | apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala | Scala | apache-2.0 | 5,755 |
/*
* 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 ... | akosiaris/kafka | core/src/main/scala/kafka/tools/GetOffsetShell.scala | Scala | apache-2.0 | 3,396 |
// TODO: re-enable once the linker doesn't flip out anymore
/*
package spec
import io.circe.Json
import io.youi.communication.{Connection, Hookup, Message, MessageType}
import org.scalatest.wordspec.AnyWordSpec
import org.scalatest.BeforeAndAfterEach
import org.scalatest.matchers.should.Matchers
import scala.concurre... | outr/youi | communication/src/test/scala/spec/HookupSpec.scala | Scala | mit | 5,958 |
/*
* 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.jsenv
/** A JavaScript ex... | nicolasstucki/scala-js | js-envs/src/main/scala/org/scalajs/jsenv/JSEnv.scala | Scala | apache-2.0 | 3,211 |
/*
* Copyright (C) 2016 Lightbend Inc. <http://www.lightbend.com>
*/
package sample.chirper.chirp.impl
import com.google.inject.AbstractModule
import com.lightbend.lagom.javadsl.server.ServiceGuiceSupport
import sample.chirper.chirp.api.ChirpService
class ChirpModule extends AbstractModule with ServiceGuiceSupport... | dotta/activator-lagom-scala-chirper | chirp-impl/src/main/scala/sample/chirper/chirp/impl/ChirpModule.scala | Scala | apache-2.0 | 456 |
package protocbridge
import scala.concurrent.Future
import dev.dirs.ProjectDirectories
import java.util.concurrent.ConcurrentHashMap
import scala.concurrent.Promise
import java.io.File
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.Try
import java.nio.file.{Files, Path}
/** Cache for file... | scalapb/protoc-bridge | bridge/src/main/scala/protocbridge/FileCache.scala | Scala | apache-2.0 | 2,307 |
/*
* Copyright (c) 2014-2018 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... | Wogan/monix | monix-reactive/shared/src/main/scala/monix/reactive/internal/operators/DistinctUntilChangedByKeyOperator.scala | Scala | apache-2.0 | 2,415 |
/***
* Copyright 2016 Rackspace US, 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 applica... | rackerlabs/api-checker | core/src/test/scala/com/rackspace/com/papi/components/checker/wadl/WADLCheckerCompSpecSaxonEE.scala | Scala | apache-2.0 | 4,110 |
package cpup.poland.runtime
import cpup.poland.runtime.userdata.Send
object BasicMetaFn extends ((Send, PObject) => Option[PObject]) {
def apply(send: Send, self: PObject) = {
val obj = self(send.msg.name)
Some(if(obj.isActivatable) {
obj.activate(send)
} else { obj })
}
} | CoderPuppy/poland-scala | src/main/scala/cpup/poland/runtime/BasicMetaFn.scala | Scala | mit | 287 |
/**
* Copyright (C) 2014 Orbeon, Inc.
*
* 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
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | wesley1001/orbeon-forms | src/main/scala/org/orbeon/oxf/xml/FilterReceiver.scala | Scala | lgpl-2.1 | 2,441 |
/*
* 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 | mllib/src/test/scala/org/apache/spark/ml/optim/aggregator/HuberBlockAggregatorSuite.scala | Scala | apache-2.0 | 11,986 |
package com.databricks.spark.avro
import java.io.File
import java.util.concurrent.TimeUnit
import org.apache.spark.SparkContext
import org.apache.spark.sql.SQLContext
/**
* This object runs a simple benchmark test on the avro files in benchmarkFilesDir. It measures
* how long does it take to convert them into Dat... | fvlankvelt/spark-avro | src/test/scala/com/databricks/spark/avro/AvroReadBenchmark.scala | Scala | apache-2.0 | 1,489 |
package polyite.schedule.schedule_tree
import polyite.schedule.Dependence
import isl.Isl.TypeAliases._
import scala.collection.mutable.ListBuffer
import polyite.schedule.ScheduleUtils
import isl.Isl
import polyite.schedule.schedule_tree.normalization.RebuildDimSchedsVisitor
import isl.VoidCallback1
import isl.Conversi... | stganser/polyite | src/polyite/schedule/schedule_tree/GroupDimsVisitor.scala | Scala | mit | 6,763 |
package org.jetbrains.plugins.scala
package lang
package formatting
package processors
import com.intellij.formatting.Spacing
import com.intellij.lang.ASTNode
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.util.TextRange
import com.intellij.psi.codeStyle.CommonCodeStyleSettings
import com.in... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/formatting/processors/ScalaSpacingProcessor.scala | Scala | apache-2.0 | 64,570 |
package model
import scala.slick.driver.H2Driver.simple._
object Activities extends Table[Activity]("ACTIVITY") with BasicTemplate {
def activityId = column[Int]("ACTIVITY_ID", O AutoInc)
def activityUserName = column[String]("ACTIVITY_USER_NAME")
def activityType = column[String]("ACTIVITY_TYPE")
def message... | milligramme/gitbucket | src/main/scala/model/Activity.scala | Scala | apache-2.0 | 996 |
package lms
import com.oracle.truffle.api._
import com.oracle.truffle.api.frame._
import com.oracle.truffle.api.nodes._
import com.oracle.truffle.api.nodes.Node._
import scala.annotation.target.field
import org.scalatest._
trait ControlFlow extends Primitives with Base {
case class Loop(shy: Boolean, @(Child @fie... | RomanTsegelskyi/lms-truffle | src/main/scala/lms/ControlFlow.scala | Scala | gpl-2.0 | 1,670 |
/*
* 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 ... | jasonpet/openwhisk | core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/StandaloneDockerContainerFactory.scala | Scala | apache-2.0 | 5,123 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala | Scala | apache-2.0 | 53,725 |
package net.methvin.sudoku
import collection.IndexedSeqOptimized
import collection.generic.CanBuildFrom
import collection.mutable.{ArrayBuffer, Builder}
/**
* An immutable data structure representing a Sudoku board.
*
* @author Greg Methvin (greg@methvin.net)
*
* @param cells A sequence of cells (left to right, ... | gmethvin/sudoku | src/main/scala/net/methvin/sudoku/Board.scala | Scala | mit | 5,601 |
package compiler
import scala.collection.immutable.Set
import scala.collection.immutable.Map
// (Type, Set String) -> TyScheme
sealed case class TyScheme(t: Type, tvars: Set[String])
// Map (String, TyScheme) -> Env
sealed case class Env(d: Map[String, TyScheme])
object Environments {
// getTVarsOfType :: type ->... | holoed/ScalaCompilerTools | src/main/scala/compiler/Environments.scala | Scala | apache-2.0 | 1,025 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | jahhulbert-ccri/geomesa | geomesa-kafka/geomesa-kafka-datastore/src/main/scala/org/locationtech/geomesa/kafka/utils/GeoMessageSerializer.scala | Scala | apache-2.0 | 5,310 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | twitter/scalding | scalding-core/src/main/scala/com/twitter/scalding/ReduceOperations.scala | Scala | apache-2.0 | 16,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 ... | bdrillard/spark | core/src/test/scala/org/apache/spark/ExecutorAllocationManagerSuite.scala | Scala | apache-2.0 | 47,576 |
/**
* Copyright (C) 2011-2012 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 vers... | debiki/debiki-server-old | modules/debiki-core/src/main/scala/com/debiki/core/statistics.scala | Scala | agpl-3.0 | 5,157 |
package com.itszuvalex.femtocraft.power
import com.itszuvalex.femtocraft.Femtocraft
import com.itszuvalex.femtocraft.implicits.IDImplicits._
import net.minecraft.init.{Blocks, Items}
import net.minecraft.item.ItemStack
import scala.collection.mutable
/**
* Created by Chris on 8/19/2014.
*/
object FissionReactorReg... | Itszuvalex/Femtocraft-alpha-1 | src/main/java/com/itszuvalex/femtocraft/power/FissionReactorRegistry.scala | Scala | gpl-2.0 | 2,391 |
/***********************************************************************
* Copyright (c) 2013-2020 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | aheyne/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/geohash/GeohashUtils.scala | Scala | apache-2.0 | 48,961 |
package model.dao
import slick.driver.JdbcProfile
/**
* Created by lukasz on 13.11.16.
*/
trait DBComponent {
val driver: JdbcProfile
import driver.api._
val db: Database
}
| lszku/ProductDatabase | app/model/dao/DBComponent.scala | Scala | bsd-3-clause | 188 |
package utils.generator
import org.hibernate.SessionFactory
import org.hibernate.cfg.AnnotationConfiguration
import domain.{DirectManager, Person}
object SQLDatabase extends Enumeration {
type SQLDatabase = Value
val MySQL, MSSQL = Value
}
trait RDBMSBuilderComponent extends Builder {
self: OrganizationBuilder... | EqualExperts/Apiary-Neo4j-RDBMS-Comparison | src/main/scala/utils/generator/RDBMSBuilderComponent.scala | Scala | bsd-2-clause | 2,383 |
/*
* 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... | pncampbell/ct-calculations | src/test/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC106ASpec.scala | Scala | apache-2.0 | 2,956 |
package com.twitter.util.jackson.caseclass
import com.twitter.util.WrappedValue
import com.twitter.util.jackson.ScalaObjectMapper
import com.twitter.util.jackson.caseclass.exceptions.CaseClassMappingException
import com.twitter.util.validation.MethodValidation
import com.twitter.util.validation.constraints.OneOf
impor... | twitter/util | util-jackson/src/test/scala/com/twitter/util/jackson/caseclass/OptionalValidationTest.scala | Scala | apache-2.0 | 2,772 |
package shapeless
import org.junit.Test
object LowPriorityTests {
object Simple {
trait TC[T] {
def prop: Boolean
}
object TC {
def apply[T](implicit tc: TC[T]): TC[T] = tc
implicit val intTC: TC[Int] = new TC[Int] { def prop = true }
}
case class CC(s: String)
object ... | rorygraves/perf_tester | corpus/shapeless/src/test/scala/shapeless/lowpriority.scala | Scala | apache-2.0 | 2,261 |
package org.eknet.publet.ext.graphdb
import org.fusesource.scalate.util.Logging
import org.eknet.scue.GraphDsl
import java.io.{InputStream, OutputStream}
import com.tinkerpop.blueprints.util.io.graphml.{GraphMLReader, GraphMLWriter}
/**
* @author Eike Kettner eike.kettner@gmail.com
* @since 23.06.12 16:19
*/
class... | eikek/publet | ext/src/main/scala/org/eknet/publet/ext/graphdb/GraphDb.scala | Scala | apache-2.0 | 1,742 |
package colossus.extensions.util.bson.reader
import java.nio.ByteBuffer
import colossus.extensions.util.bson.element.BsonArray
case class BsonArrayReader(buffer: ByteBuffer) extends Reader[BsonArray] {
def read: Option[BsonArray] = {
val name = readCString()
BsonDocumentReader(buffer).read.map(BsonArray(n... | fehmicansaglam/colossus-extensions | mongo/src/main/scala/colossus/extensions/util/bson/reader/BsonArrayReader.scala | Scala | apache-2.0 | 335 |
package diffson
package playJson
import jsonpointer._
class PlayJsonTestJsonPointer extends TestJsonPointer[play.api.libs.json.JsValue] with PlayJsonTestProtocol
| gnieh/diffson | playJson/shared/src/test/scala/diffson/playJson/TestJsonPointer.scala | Scala | apache-2.0 | 164 |
/*
* 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 ... | JihongMA/incubator-carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/sortexpr/AllDataTypesTestCaseSort.scala | Scala | apache-2.0 | 2,793 |
import stainless.annotation._
import stainless.collection._
import stainless.lang._
object AbstractRefinementMap {
case class ~>>[A,B](pre: A => Boolean, private val f: A => B, post: B => Boolean) {
def apply(a: A): B = {
require(pre(a))
f(a)
} ensuring(post)
}
def map[A, B](l: List[A], f:... | epfl-lara/stainless | frontends/benchmarks/verification/invalid/AbstractRefinementMap.scala | Scala | apache-2.0 | 576 |
package uk.co.pragmasoft.validate
import scala.reflect._
trait TypeValidationDSL[Type] extends TypeValidationSupport {
protected final def it(implicit classTag: ClassTag[Type]) = entity[Type]
protected def property(description: String) = typeProperty[Type](description)
implicit class ImplicitPropertyDef(va... | galarragas/ValiData | src/main/scala/uk/co/pragmasoft/validate/TypeValidationDSL.scala | Scala | apache-2.0 | 452 |
/*
* 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 ... | cloudml/zen | ml/src/main/scala/com/github/cloudml/zen/ml/clustering/algorithm/LDATrainer.scala | Scala | apache-2.0 | 7,294 |
package fpscala.chapter7
import java.util.concurrent._
import java.util.concurrent.atomic.AtomicReference
import java.lang.Exception
object NonBlocking {
type NBPar[A] = ExecutorService => Future[A]
def unit[A](a: A): NBPar[A] = es => new Future[A] {
def apply(cb: A => Unit): Unit = cb(a)
}
def choice... | sajit/learnyou | scala/minimal-scala/src/main/scala/fpscala/chapter7/NonBlocking.scala | Scala | mit | 1,550 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/stream/CarbonCreateStreamCommand.scala | Scala | apache-2.0 | 11,858 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.core.j
import javax.inject.Inject
import play.api.http.HttpErrorHandler
import play.api.mvc.RequestHeader
import play.core.Execution
import play.http.{ HttpErrorHandler => JHttpErrorHandler }
import scala.compat.java8.FutureConverters
... | benmccann/playframework | core/play/src/main/scala/play/core/j/JavaHttpErrorHandlerAdapter.scala | Scala | apache-2.0 | 1,108 |
package sorm.tableSorters
import sorm._
import reflection._
import mappings._
import sext._, embrace._
import util.Random
import org.scalatest.FunSuite
import org.scalatest.matchers.ShouldMatchers
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class DropTest ext... | sorm/sorm | src/test/scala/sorm/tableSorters/DropTest.scala | Scala | mit | 1,464 |
package org.hammerlab.guacamole.filters.somatic
import org.apache.spark.rdd.RDD
import org.hammerlab.guacamole.variants.CalledSomaticAllele
/**
* Filter to remove genotypes where the somatic likelihood is low
*/
object SomaticMinimumLikelihoodFilter {
def hasMinimumLikelihood(genotype: CalledSomaticAllele,
... | hammerlab/guacamole | src/main/scala/org/hammerlab/guacamole/filters/somatic/SomaticMinimumLikelihoodFilter.scala | Scala | apache-2.0 | 1,107 |
package challenge8a
import core._
import org.scalacheck.{Arbitrary, Gen}, Arbitrary._, Gen._
object HttpArbitraries {
def HeaderGen: Gen[(String, String)] =
for {
h <- Gen.alphaStr
v <- Gen.alphaStr
} yield h -> v
def HeadersGen: Gen[Headers] =
Gen.listOf(HeaderGen) map (hs => Headers(hs.... | Kimply/scala-challenge | src/test/scala/challenge8a/HttpArbitraries.scala | Scala | mit | 1,356 |
/**
* 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... | fluetm/kafka | core/src/main/scala/kafka/api/OffsetResponse.scala | Scala | apache-2.0 | 3,494 |
/*
* 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 ... | ksimar/incubator-carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/sortexpr/AllDataTypesTestCaseSort.scala | Scala | apache-2.0 | 3,450 |
package net.selenate.server
import org.slf4j.LoggerFactory
trait Loggable {
lazy val clazz: Class[_] = this.getClass
lazy val logPrefix: Option[String] = None
lazy val logger = LoggerFactory.getLogger(clazz)
private def p(s: String) =
logPrefix.map("[%s] => " format _).getOrElse("") + s
protected def... | tferega/selenate | code/Server/src/main/scala/net/selenate/server/Loggable.scala | Scala | bsd-3-clause | 1,008 |
/*
* 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 ... | USCDataScience/sparkler | sparkler-app/src/main/scala/edu/usc/irds/sparkler/storage/solr/StatusUpdateSolrTransformer.scala | Scala | apache-2.0 | 4,483 |
package mesosphere.marathon.api
import com.codahale.metrics.servlets.MetricsServlet
import com.google.inject.Scopes
import com.google.inject.name.Names
import com.google.inject.servlet.ServletModule
import com.sun.jersey.guice.spi.container.servlet.GuiceContainer
import mesosphere.chaos.ServiceStatus
import mesosphere... | ss75710541/marathon | src/main/scala/mesosphere/marathon/api/BaseRestModule.scala | Scala | apache-2.0 | 1,773 |
package spoiwo.natures.streaming.xlsx
import java.io.ByteArrayOutputStream
import Model2XlsxConversions._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import spoiwo.model._
class ExportWorkbookStreamingSpec extends AnyFlatSpec with Matchers {
"Writing workbook to an outpu... | norbert-radyk/spoiwo | core/src/test/scala/spoiwo/natures/streaming/xlsx/ExportWorkbookStreamingSpec.scala | Scala | mit | 881 |
package pl.touk.nussknacker.engine.kafka.source.delayed
import org.scalatest.{FunSuite, Matchers}
class DelayCalculatorSpec extends FunSuite with Matchers {
test("should calculate fixed delay") {
val fixedDelayCalculator = new FixedDelayCalculator(1000)
fixedDelayCalculator.calculateDelay(5000, 4000) shoul... | TouK/nussknacker | utils/kafka-components-utils/src/test/scala/pl/touk/nussknacker/engine/kafka/source/delayed/DelayCalculatorSpec.scala | Scala | apache-2.0 | 463 |
package io.flow.lint
import io.apibuilder.spec.v0.models._
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
class GetQuerySpec extends AnyFunSpec with Matchers {
private[this] val linter = linters.Get
val model = Services.buildSimpleModel(
"organization",
fields = Se... | flowcommerce/api-lint | src/test/scala/io/flow/lint/GetQuerySpec.scala | Scala | mit | 1,736 |
package org.dagre.euler
import org.scalatest.{FlatSpec, Matchers}
class Euler27Spec extends FlatSpec with Matchers {
"Euler 27" should "solve the problem for the given input" in {
Euler27(999, 999) should be (-59231)
}
} | dagre/euler | src/test/scala-2.12/org/dagre/euler/Euler27Spec.scala | Scala | apache-2.0 | 232 |
package qrygraph.client.wrapper
import qrygraph.shared.data.Edge
import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
import scala.util.Random
/**
* The JS representation of a Edge
*/
@ScalaJSDefined
class JSEdge(from: JSOutput, to: JSInput, newId: String = Random.nextInt().toString, routeCo... | Starofall/QryGraph | qrygraph/js/src/main/scala/qrygraph/client/wrapper/JSEdge.scala | Scala | mit | 893 |
package controllers
import com.google.inject.Inject
import models.CacheKeyPrefix
import play.api.mvc.Request
import uk.gov.dvla.vehicles.presentation.common
import common.clientsidesession.ClientSideSessionFactory
import common.webserviceclients.addresslookup.AddressLookupService
import common.clientsidesession.Cookie... | dvla/vrm-assign-online | app/controllers/AddressLookup.scala | Scala | mit | 738 |
/*
* 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 ... | JerryLead/spark | core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala | Scala | apache-2.0 | 33,798 |
package scala.slick.driver
import java.sql.PreparedStatement
import scala.slick.session.{Session, PositionedParameters, PositionedResult}
import scala.slick.lifted.Shape
import scala.slick.ast.Node
import scala.slick.jdbc.StatementInvoker
import scala.collection.mutable.Builder
import slick.util.{ValueLinearizer, Coll... | zefonseca/slick-1.0.0-scala.2.11.1 | src/main/scala/scala/slick/driver/BasicExecutorComponent.scala | Scala | bsd-2-clause | 1,801 |
// Copyright (C) 2014-2016 Miquel Sabaté Solà <mikisabate@gmail.com>
// This file is licensed under the MIT license.
// See the LICENSE file.
/*
* Strings. Defined with double quotes. Character can also be declared
* with single quote characters.
*/
println("ABCDEF".length)
println("ABCDEF".substring(2, 6))
print... | mssola/programs | lang/scala/basics.scala | Scala | mit | 4,353 |
/*
* 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/ObservableLikeConversionsSuite.scala | Scala | apache-2.0 | 9,308 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | MansurAshraf/scalding | scalding-core/src/test/scala/com/twitter/scalding/examples/WeightedPageRankFromMatrixTest.scala | Scala | apache-2.0 | 5,398 |
/***********************************************************************
* Copyright (c) 2013-2017 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... | ronq/geomesa | geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/utils/bin/BinSorter.scala | Scala | apache-2.0 | 18,830 |
package org.jetbrains.plugins.scala.lang.formatting.settings
import com.intellij.openapi.components.ProjectComponent
import com.intellij.openapi.project.Project
import com.intellij.psi.codeStyle.CodeStyleScheme
import com.intellij.psi.impl.source.codeStyle.CodeStyleSchemesImpl
import org.jetbrains.plugins.scala.ScalaL... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/formatting/settings/LegacyCodeStyleSettingsComponent.scala | Scala | apache-2.0 | 1,267 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | tdyas/scalding | scalding-commons/src/test/scala/com/twitter/scalding/commons/VersionedKeyValSourceTest.scala | Scala | apache-2.0 | 5,743 |
package lila.api
import chess.format.pgn.Pgn
import lila.game.Game
import play.api.libs.iteratee._
final class PgnDump(
dumper: lila.game.PgnDump,
relayName: String => Option[String],
simulName: String => Option[String],
tournamentName: String => Option[String]) {
def apply(game: Game, initialFen: ... | systemovich/lila | modules/api/src/main/PgnDump.scala | Scala | mit | 1,174 |
/*
* Copyright 2014 - 2015 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | wemrysi/quasar | web/src/main/scala/slamdata/engine/api/package.scala | Scala | apache-2.0 | 5,515 |
package controllers
import com.bryzek.apidoc.example.union.types.discriminator.v0.Client
import com.bryzek.apidoc.example.union.types.discriminator.v0.errors.UnitResponse
import com.bryzek.apidoc.example.union.types.discriminator.v0.models._
import com.bryzek.apidoc.example.union.types.discriminator.v0.models.json._
... | Seanstoppable/apidoc-generator | example-union-types-discriminator/api/test/controllers/UsersSpec.scala | Scala | mit | 4,148 |
package com.meetup.timeywimey
import java.sql.Timestamp
import java.time._
import java.util.Calendar
import java.util.Date
import org.scalatest._
import LegacyConverterImplicits._
class LegacyConverterImplicitsTest extends FunSpec with Matchers {
describe("JodaConverterImplicits") {
it("should convert Date to Z... | meetup/timeywimey | timeywimey-scala/src/test/scala/com/meetup/timeywimey/LegacyConverterImplicitsTest.scala | Scala | mit | 591 |
package info.lindblad.prometheus.cloudwatch.proxy.actor
import akka.actor.ActorRef
import info.lindblad.prometheus.cloudwatch.proxy.directives.{PrometheusDirective, CloudWatchDirective}
import info.lindblad.prometheus.cloudwatch.proxy.util.Logging
import spray.http.{HttpRequest, HttpResponse, Timedout}
import spray.ro... | nlindblad/prometheus-cloudwatch-proxy | src/main/scala/info/lindblad/prometheus/cloudwatch/proxy/actor/HttpRequestActor.scala | Scala | apache-2.0 | 1,108 |
/*
* 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 ... | mkolod/incubator-spark | core/src/main/scala/org/apache/spark/Aggregator.scala | Scala | apache-2.0 | 2,127 |
package org.scalawiki.dto.markup
import org.sweble.wikitext.engine.utils.DefaultConfigEnWp
import org.sweble.wikitext.parser.nodes.WikitextNodeFactoryImpl
object NodeFactory extends WikitextNodeFactoryImpl(DefaultConfigEnWp.generate.getParserConfig) | intracer/scalawiki | scalawiki-core/src/main/scala/org/scalawiki/dto/markup/NodeFactory.scala | Scala | apache-2.0 | 251 |
/*
* Copyright 2021 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/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frs10x/boxes/AC13.scala | Scala | apache-2.0 | 1,256 |
package akka.persistence.pg.util
import akka.actor.ActorSystem
import akka.persistence.pg.PluginConfig
import slick.jdbc.JdbcBackend
class PluginTestConfig(system: ActorSystem) extends PluginConfig(system.settings.config) {
override lazy val database: JdbcBackend.DatabaseDef = {
PgPluginTestUtil.initialize(cre... | kwark/akka-persistence-postgresql | modules/akka-persistence-pg/src/main/scala/akka/persistence/pg/util/PluginTestConfig.scala | Scala | mit | 347 |
package com.coiney.akka.rabbit.actors
import akka.actor.{Actor, ActorLogging, Props}
import com.rabbitmq.client._
import scala.util.Try
private[rabbit] object ChannelHandler {
def apply(channel: Channel): ChannelHandler =
new ChannelHandler(channel) with AMQPRabbitFunctions with RequestHandler
def props(ch... | Coiney/akka-rabbit | akka-rabbit-core/src/main/scala/com/coiney/akka/rabbit/actors/ChannelHandler.scala | Scala | bsd-3-clause | 4,206 |
package caustic
import scala.language.implicitConversions
package object runtime extends Builder {
// Implicit Conversions.
implicit def bol2flag(value: Boolean): Flag = if (value) True else False
implicit def num2real[T](value: T)(implicit num: Numeric[T]): Real = Real(num.toDouble(value))
implicit def str2... | ashwin153/caustic | caustic-runtime/src/main/scala/caustic/runtime/package.scala | Scala | apache-2.0 | 392 |
import rx.lang.scala.Observable
object CreateFromSource {
def create() {
val o1 = Observable.just("a", "b", "c")
def list = List(5, 6, 7, 8)
val o2 = Observable.from(list)
val o3 = Observable.just("one object")
}
}
| abersnaze/RxJava | language-adaptors/rxjava-scala/src/examples/reactivex/getting-started/CreateFromSource.scala | Scala | apache-2.0 | 239 |
package de.sciss.fscape
import de.sciss.proc.FScape
import de.sciss.serial.{DataInput, DataOutput}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
/*
sbt 'testOnly de.sciss.fscape.SerializationSpec2'
*/
class SerializationSpec2 extends AnyFlatSpec with Matchers {
FScape.... | Sciss/FScape-next | lucre/jvm/src/test/scala/de/sciss/fscape/SerializationSpec2.scala | Scala | agpl-3.0 | 973 |
package lostvaults.server
/**
* CheatActor.scala
* @Author Felix Färsjö, Jimmy Holm, Fredrik Larsson, Anna Nilsson, Philip Åkerfeldt
* @Version 1.0
*/
import lostvaults.Parser
import akka.event.Logging
import akka.actor.{ Actor, ActorRef }
import akka.util.ByteString
import akka.io.{ Tcp }
import scala.util.Random... | senilica/LostVaults | src/lostvaults/server/CheatActor.scala | Scala | mit | 7,018 |
/*
* 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 ... | pronix/spark | project/SparkBuild.scala | Scala | apache-2.0 | 25,945 |
package com.nrinaudo.fetch
import org.scalatest.{Matchers, FunSpec}
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalacheck.{Arbitrary, Gen}
import Arbitrary._
import java.io.{OutputStream, InputStream, ByteArrayInputStream, ByteArrayOutputStream}
import java.nio.charset.Charset
import scala.io.S... | nrinaudo/fetch | core/src/test/scala/com/nrinaudo/fetch/EncodingSpec.scala | Scala | mit | 3,462 |
/*
* Copyright (c) 2014-2018 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... | Wogan/monix | monix-execution/shared/src/test/scala/monix/execution/misc/InlineMacrosTest.scala | Scala | apache-2.0 | 3,449 |
package propositional.schema
import parsing._
import propositional._
import propositional.schema._
class ConnectiveSchemaTestSuite extends ParsableTestSuite[ConnectiveSchema] {
val parsable = ConnectiveSchema
val parameters = ConnectiveSchemaTestParameters
}
object ConnectiveSchemaTestParameters extends Parsable... | julianmichael/deduction | src/test/scala/propositional/schema/ConnectiveSchemaTestSuite.scala | Scala | mit | 1,052 |
package fr.univ_lille.cristal.emeraude.chasqui.porting
import java.awt.event.{ActionEvent, WindowAdapter, WindowEvent}
import java.awt.{Component, Dimension, FlowLayout}
import javax.swing._
import javax.swing.event.ListSelectionEvent
import javax.swing.table.AbstractTableModel
import fr.univ_lille.cristal.emeraude.c... | guillep/chasqui | src/main/scala/fr/univ_lille/cristal/emeraude/chasqui/porting/NodeInspector.scala | Scala | mit | 6,473 |
/***********************************************************************
* 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 ... | MutahirKazmi/geomesa | geomesa-kafka/geomesa-kafka-datastore/geomesa-kafka-08-datastore/src/test/scala/org/locationtech/geomesa/kafka08/KafkaDataStoreTest.scala | Scala | apache-2.0 | 8,992 |
/*
* Copyright 2011-2014 Chris de Vreeze
*
* 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... | EBPI/yaidom | src/main/scala/nl/ebpi/yaidom/print/DocumentPrinterUsingDom.scala | Scala | apache-2.0 | 9,267 |
package ml.sparkling.graph.operators.measures.vertex.betweenness.flow.generator.impl
import ml.sparkling.graph.operators.measures.vertex.betweenness.flow.factory.FlowFactory
import ml.sparkling.graph.operators.measures.vertex.betweenness.flow.generator.FlowGenerator
import ml.sparkling.graph.operators.measures.vertex.... | sparkling-graph/sparkling-graph | operators/src/main/scala/ml/sparkling/graph/operators/measures/vertex/betweenness/flow/generator/impl/RandomFlowGenerator.scala | Scala | bsd-2-clause | 964 |
package hlist
/**
* @author bogdanski
* @since 07.06.16
*/
object Liftable extends Lift[Σ] {
implicit def r[A]: A => Σ[A] = a => Σ(a)
}
object Transformable extends Trans[Σ, Option] {
implicit def r[A]: (Σ[A]) => Option[A] = a => a.send
}
object ShowableAlphabet {
import Alphabet._
implicit object sho... | zenecture/techtalk | hlist/src/main/scala/hlist/Instances.scala | Scala | apache-2.0 | 2,785 |
val input = scala.io.Source.fromFile("input.txt").toList.map(x => if (x == '(') 1 else -1)
println(s"part 1: ${input.sum}")
val cumsum = input.map{var s = 0; d => {s += d; s}}
println(s"part 2: ${cumsum.indexOf(-1) + 1}")
| dbjohnson/advent-of-code | solutions/day01/solution.scala | Scala | mit | 223 |
package org.jetbrains.sbt
package project.structure
import java.io._
import java.nio.charset.Charset
import java.util.Properties
import java.util.concurrent.atomic.AtomicBoolean
import java.util.jar.{JarEntry, JarFile}
import com.intellij.execution.process.OSProcessHandler
import org.jetbrains.sbt.project.structure.S... | SergeevPavel/intellij-scala | src/org/jetbrains/sbt/project/structure/SbtRunner.scala | Scala | apache-2.0 | 8,458 |
package su.wps.modelfactory.reflection
import org.specs2.mutable.Specification
case class Customer(name: String)
class FieldReflectorSpec extends Specification {
"FieldReflector should" >> {
"set value correctly" >> {
val name = "me"
val customer = Customer(name)
customer.name mustEqual name
... | reactivemaster/model-factory | src/test/scala/su/wps/modelfactory/reflection/FieldReflectorSpec.scala | Scala | apache-2.0 | 686 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2019 Helge Holzmann (Internet Archive) <helge@archive.org>
*
* 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, incl... | helgeho/ArchiveSpark | src/main/scala/org/archive/archivespark/util/Json.scala | Scala | mit | 2,560 |
package com.raquo.domtypes.generic.defs.tags
import com.raquo.domtypes.generic.builders.HtmlTagBuilder
trait DocumentTags[T[_ <: DomHtmlElement], DomHtmlElement, Html <: DomHtmlElement, HtmlHead <: DomHtmlElement, HtmlBase <: DomHtmlElement, HtmlLink <: DomHtmlElement, HtmlMeta <: DomHtmlElement, HtmlScript <: DomHtm... | raquo/scala-dom-types | shared/src/main/scala/com/raquo/domtypes/generic/defs/tags/DocumentTags.scala | Scala | mit | 1,681 |
package org.jetbrains.plugins.scala
package refactoring.extractMethod
/**
* Nikolay.Tropin
* 2014-04-21
*/
class ScalaExtractMethodOutputTest extends ScalaExtractMethodTestBase {
override def folderPath: String = super.folderPath + "output/"
def testNoReturnNoOutput(): Unit = doTest()
def testNoReturnOneOut... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/refactoring/extractMethod/ScalaExtractMethodOutputTest.scala | Scala | apache-2.0 | 803 |
// - Project: scalajs-angulate (https://github.com/jokade/scalajs-angulate)
// Description: Macros to support using a scala class as Angular directive
//
// Distributed under the MIT License (see included file LICENSE)
package biz.enef.angulate.impl
import acyclic.file
import scala.reflect.macros.blackbox
protected... | CapeSepias/scalajs-angulate | src/main/scala/biz/enef/angulate/impl/DirectiveMacros.scala | Scala | mit | 3,295 |
package com.arcusys.learn.liferay.update.version260.migrations
import com.arcusys.learn.liferay.LogFactoryHelper
import com.arcusys.learn.liferay.update.version260.slide.SlideTableComponent
import com.arcusys.valamis.content.model.QuestionType.QuestionType
import com.arcusys.valamis.content.model._
import com.arcusys.... | igor-borisov/valamis | learn-portlet/src/main/scala/com/arcusys/learn/liferay/update/version260/migrations/ContentManagerMigration.scala | Scala | gpl-3.0 | 9,177 |
package com.github.ponkin.bloom.server
import java.io.{ OutputStream, InputStream }
import scala.util.Try
trait Serializer[T] {
def readFrom(input: InputStream): Option[T]
def writeTo(meta: T, output: OutputStream): Try[Unit]
}
| ponkin/bloom | server/src/main/scala/com/github/ponkin/bloom/server/Serializer.scala | Scala | apache-2.0 | 238 |
/**
* Copyright (C) 2009-2011 the original author or authors.
* See the notice.md file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | scalate/scalate | scalate-util/src/test/scala/org/fusesource/scalate/util/LogTest.scala | Scala | apache-2.0 | 1,806 |
/*
* Copyright 2021 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/gmp-frontend | test/controllers/BulkReferenceControllerSpec.scala | Scala | apache-2.0 | 5,415 |
package org.littlewings.infinispan.lucene
import scala.io.StdIn
import org.apache.lucene.analysis.ja.JapaneseAnalyzer
import org.apache.lucene.document.{ Document, Field, TextField }
import org.apache.lucene.index.{ IndexWriter, IndexWriterConfig }
import org.apache.lucene.store.Directory
import org.apache.lucene.uti... | kazuhira-r/infinispan-getting-started | embedded-lucene-distributed-directory/src/main/scala/org/littlewings/infinispan/lucene/Indexer.scala | Scala | mit | 2,449 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/nn/LocallyConnected1DSpec.scala | Scala | apache-2.0 | 1,122 |
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.