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 |
|---|---|---|---|---|---|
import Filter.Fragments
import scalaz.concurrent.Task
import scalaz._, Scalaz._
import scalaz.stream.Process
import scalaz.stream.Process._
object Fold {
trait Fold[T] {
type S
def sink: Sink[Task, T]
def fold: (S, T) => S
def init: S
def last(s: S): Task[Unit]
}
object Fold {
def fro... | etorreborre/lambdajam-2014 | src/main/scala/Fold.scala | Scala | mit | 2,470 |
/*
* 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... | wangyixiaohuihui/spark2-annotation | mllib/src/main/scala/org/apache/spark/mllib/pmml/export/PMMLModelExport.scala | Scala | apache-2.0 | 1,581 |
/*
* 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/test/scala/org/apache/spark/carbondata/iud/DeleteCarbonTableSubqueryTestCase.scala | Scala | apache-2.0 | 2,972 |
package org.jetbrains.plugins.scala
package testingSupport.test.specs2
import com.intellij.openapi.project.Project
import com.intellij.execution.configurations.{RunConfiguration, ConfigurationType}
import testingSupport.test.AbstractTestRunConfigurationFactory
/**
* User: Alexander Podkhalyuzin
* Date: 03.05.2009
... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/testingSupport/test/specs2/Specs2RunConfigurationFactory.scala | Scala | apache-2.0 | 622 |
/*
* Copyright 2001-2008 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... | hubertp/scalatest | src/test/scala/org/scalatest/matchers/ShouldBeSymbolSpec.scala | Scala | apache-2.0 | 27,685 |
package org.skrushingiv
import play.api.libs.json._
import scala.collection.MapLike
import scala.language.implicitConversions
package object json {
implicit class PathAdditions(val path: JsPath) extends AnyVal {
/**
* Determines the correct empty JsValue to use for a collection type.
*
* @para... | srushingiv/org.skrushingiv | src/main/scala/org/skrushingiv/json/package.scala | Scala | mit | 3,669 |
/*
* 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 ... | sh-cho/cshSpark | util/collection/SizeTrackingAppendOnlyMap.scala | Scala | apache-2.0 | 1,396 |
/*
* The MIT License
*
* Copyright (c) 2016 Fulcrum Genomics LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to us... | fulcrumgenomics/fgbio | src/main/scala/com/fulcrumgenomics/umi/VanillaUmiConsensusCaller.scala | Scala | mit | 14,127 |
package epic.features
import epic.framework.Feature
import breeze.linalg.Counter
import scala.Array
import scala.collection.mutable.ArrayBuffer
import StandardSpanFeatures._
case class FirstWordCapsAnd(f: Feature) extends Feature
case class NthWordCapsAnd(f: Feature) extends Feature
case class SentenceLengthFeature(l... | jovilius/epic | src/main/scala/epic/features/StandardSurfaceFeaturizer.scala | Scala | apache-2.0 | 844 |
/*
* Test file for immutable queues.
*/
import scala.collection.immutable.Queue
object iq {
def main(): Unit = {
/* Create an empty queue. */
val q: Queue[Int] = Queue.empty
/* Test isEmpty.
* Expected: Empty
*/
if (q.isEmpty) {
Console.println("Empty")
}
/* Test enqueuei... | scala/scala | test/files/run/iq.scala | Scala | apache-2.0 | 2,835 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Sun Sep 23 21:14:14 EDT 2012
* @see LICENSE (MIT style license file).
*/
package scalation.analytics
import scalation.linalgebra.{VectorD, VectorI}
//:::::::::::::::::::::::::... | mvnural/scalation | src/main/scala/scalation/analytics/Classifier.scala | Scala | mit | 3,508 |
package com.azavea.opentransit.indicators.calculators
import com.azavea.gtfs._
import com.azavea.opentransit._
import com.azavea.opentransit.indicators._
import com.github.nscala_time.time.Imports._
import org.joda.time._
object TimeTraveledStops extends Indicator
with AggregatesByAll {
... | WorldBank-Transport/open-transit-indicators | scala/opentransit/src/main/scala/com/azavea/opentransit/indicators/calculators/TimeTraveledStops.scala | Scala | gpl-3.0 | 1,135 |
/*
* Copyright (c) 2018 OVO Energy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish,... | ovotech/comms-kafka-messages | modules/core/src/main/scala/com/ovoenergy/comms/model/sms/ComposedSMSV2.scala | Scala | mit | 2,630 |
package scalamachine.core.tests
import org.specs2._
import mock._
import org.mockito.{Matchers => MM}
import scalamachine.core._
import Resource._
import v3.WebmachineDecisions
import HTTPHeaders._
import HTTPMethods._
import ReqRespData.Metadata
class V3ColCDEFSpecs extends Specification with Mockito with SpecsHelpe... | stackmob/scalamachine | core/src/test/scala/scalamachine/core/tests/V3ColCDEFSpecs.scala | Scala | apache-2.0 | 14,534 |
/*
* Copyright © 2016 - 2020 Schlichtherle IT Services
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | christian-schlichtherle/neuron-di | core-scala/src/main/scala/global/namespace/neuron/di/scala/NeuronAnnotation.scala | Scala | apache-2.0 | 6,199 |
package slinky.web
import slinky.core.ComponentWrapper
import slinky.core.facade.ReactElement
import org.scalajs.dom.{Element, document}
import scala.scalajs.js
import html._
import org.scalatest.funsuite.AnyFunSuite
object TestComponent extends ComponentWrapper {
type Props = Unit
type State = Unit
class De... | shadaj/slinky | tests/src/test/scala/slinky/web/ReactDOMTest.scala | Scala | mit | 1,753 |
package com.sksamuel.elastic4s.searches.queries
case class BoostingQueryDefinition(positiveQuery: QueryDefinition,
negativeQuery: QueryDefinition,
queryName: Option[String] = None,
boost: Option[Double] = None,
... | aroundus-inc/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/queries/BoostingQueryDefinition.scala | Scala | apache-2.0 | 816 |
/*
Copyright (c) 2015, Raymond Dodge
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, this list of conditions and the fo... | rayrobdod/script | src/main/scala/com/rayrobdod/scriptSample/ScriptFromXml.scala | Scala | bsd-3-clause | 2,655 |
package com.harrys.hyppo.worker.data
import javax.inject.Inject
import akka.actor.{Actor, ActorLogging, ActorRef}
import com.harrys.hyppo.worker.api.proto.RemoteStorageLocation
import scala.concurrent.Future
import scala.util.{Failure, Success}
final class JarLoadingActor @Inject() (factory: JarFileLoader.Factory) ... | harrystech/hyppo-worker | worker/src/main/scala/com/harrys/hyppo/worker/data/JarLoadingActor.scala | Scala | mit | 1,329 |
package com.arcusys.learn.controllers.api
import com.arcusys.learn.facades.QuizFacadeContract
import com.arcusys.learn.ioc.Configuration
import com.arcusys.learn.liferay.permission._
import com.arcusys.learn.models.request.{ QuizActionType, QuizRequest }
import com.arcusys.learn.models.{ QuizQuestionPreviewContent, Qu... | ViLPy/Valamis | learn-portlet/src/main/scala/com/arcusys/learn/controllers/api/QuizApiController.scala | Scala | lgpl-3.0 | 5,448 |
// Starter Code for Exercise 1
// From "Fields" atom
import com.atomicscala.AtomicTest._
val cup2 = new Cup2
cup2.add(45) is 45
cup2.add(-15) is 30
cup2.add(-50) is -20
| P7h/ScalaPlayground | Atomic Scala/atomic-scala-solutions/16_Fields/Starter-1.scala | Scala | apache-2.0 | 170 |
/**
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.routing
import scala.collection.immutable
import akka.actor.ActorContext
import akka.actor.Props
import akka.dispatch.Dispatchers
import com.typesafe.config.Config
import akka.actor.SupervisorStrategy
import akka.japi.Util.immutabl... | jmnarloch/akka.js | akka-js-actor/jvm/src/main/scala/akka/routing/ConsistentHashing.scala | Scala | bsd-3-clause | 17,278 |
package ee.cone.c4proto
import java.nio.charset.StandardCharsets.UTF_8
import ee.cone.c4di.TypeKey
import okio.ByteString
import collection.immutable.Seq
import scala.annotation.StaticAnnotation
case class Id(id: Long) extends StaticAnnotation
case class ShortName(name: String) extends StaticAnnotation
class Gen... | conecenter/c4proto | base_lib/src/main/scala/ee/cone/c4proto/Protocol.scala | Scala | apache-2.0 | 2,173 |
/*
* 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 ... | mzl9039/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala | Scala | apache-2.0 | 20,428 |
package com.github.meln1k.reactive.telegrambot.api
import java.util.UUID
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model._
import akka.http.scaladsl.model.HttpMethods._
import akka.http.scaladsl.unmarshalling.Unmarshal
import a... | meln1k/reactive-telegrambot | src/main/scala/com/github/meln1k/reactive/telegrambot/api/TelegramRequestConsumer.scala | Scala | mit | 3,817 |
package shredzzz.kirkwood.junit.tests.vector.ints
import org.junit.Test
import shredzzz.kirkwood.cumath.CuValue
import shredzzz.kirkwood.cumath.tensor.CuVector
import shredzzz.kirkwood.junit._
class CuVectorBitwiseOpsTest extends IntCuVectorTester
{
@Test def testVal_unary_:~@() {
withCuContext(
implicit ... | shredzzz/kirkwood | src/test/scala/shredzzz/kirkwood/junit/tests/vector/ints/CuVectorBitwiseOpsTest.scala | Scala | apache-2.0 | 13,560 |
package com.github.vladminzatu.surfer
import com.github.vladminzatu.surfer.persist.{UpdatePersistenceStrategy, RestPersister}
import org.apache.spark._
import org.apache.spark.streaming._
object App {
val checkpointDir = "spark-checkpoint"
val mappingFunc = (key: String, timestamp: Option[Long], state: State[Sc... | VladMinzatu/surfer | src/main/scala/com/github/vladminzatu/surfer/App.scala | Scala | mit | 1,304 |
/*
* 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
* distribute... | wvlet/wvlet | wvlet-server/src/main/scala/wvlet/dataflow/server/coordinator/NodeManager.scala | Scala | apache-2.0 | 1,789 |
/*
* 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 ... | jnhagelberg/incubator-atlas | typesystem/src/main/scala/org/apache/atlas/typesystem/json/TypesSerialization.scala | Scala | apache-2.0 | 10,580 |
package com.git.huanghaifeng.spark.load
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import com.datastax.spark.connector._
object LoadCassandra {
def main(args: Array[String]) {
val sparkMaster = args(0)
val cassandraHost = args(1)
val conf = new SparkConf(true)
... | prucehuang/quickly-start-spark | src/main/scala/com/git/huanghaifeng/spark/load/LoadCassandra.scala | Scala | apache-2.0 | 1,092 |
package wdl
import org.scalatest.{Matchers, FlatSpec}
class WdlWorkflowOutputDeclarationSpec extends FlatSpec with Matchers {
"WorkflowOutputDeclaration" should "match outputs" in {
val declaration = WorkflowOutputWildcard("wf.mytask", wildcard = true, null)
declaration.outputMatchesDeclaration("wf.mytask... | ohsu-comp-bio/cromwell | wdl/src/test/scala/wdl/WdlWorkflowOutputDeclarationSpec.scala | Scala | bsd-3-clause | 697 |
package fp_in_scala.chapter_02
import org.scalatest.{Matchers, FlatSpec}
class HigherOrderFunctionsSpec extends FlatSpec with Matchers {
// Types for making the intent of the function types clearer
type Curried = Int => Long => Double
type Uncurried = (Int, Long) => Double
it should "give a curried version ... | jankeesvanandel/fp-in-scala | src/test/scala/fp_in_scala/chapter_02/HigherOrderFunctionsSpec.scala | Scala | apache-2.0 | 986 |
package pl.touk.nussknacker.engine.flink.test
import java.util.concurrent.CompletableFuture
import org.apache.flink.api.common.{JobID, JobStatus}
import org.apache.flink.client.program.ClusterClient
import org.apache.flink.configuration._
import org.apache.flink.runtime.client.JobStatusMessage
import org.apache.flink... | TouK/nussknacker | engine/flink/test-utils/src/main/scala/pl/touk/nussknacker/engine/flink/test/FlinkMiniClusterHolder.scala | Scala | apache-2.0 | 4,236 |
package io.github.finagle.smtp
import com.twitter.concurrent.AsyncQueue
import com.twitter.finagle.transport.QueueTransport
import com.twitter.util.Await
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class ClientDispatcherTest exten... | finagle/finagle-smtp | src/test/scala/io/github/finagle/smtp/ClientDispatcherTest.scala | Scala | apache-2.0 | 3,406 |
/*
* Copyright 2015 the original author or 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 applicab... | arkadius/lift-ng-workshop | src/main/scala/code/api/Routes.scala | Scala | apache-2.0 | 995 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Mon Sep 28 11:18:16 EDT 2015
* @see LICENSE (MIT style license file).
*/
package scalation.linalgebra.mem_mapped.bld
import java.io.{File, PrintWriter}
//:::::::::::::::::::... | scalation/fda | scalation_1.2/src/main/scala/scalation/linalgebra/mem_mapped/bld/BldMatrix.scala | Scala | mit | 66,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 ... | spark-test/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala | Scala | apache-2.0 | 35,598 |
package org.pdfextractor.algorithm.config
import java.util.Locale
import org.pdfextractor.algorithm.io._
object PdfFilesListing {
def getPdfInvoicesListing(lang: Locale): Seq[String] = {
getFolderAsFile(lang.getLanguage)
.listFiles
.filter(_.isFile)
.filter(_.getName.endsWith(".pdf"))
... | kveskimae/pdfalg | src/test/scala/org/pdfextractor/algorithm/config/PdfFilesListing.scala | Scala | mit | 373 |
/**
* Copyright 2015, 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/doperables/SparkSingleColumnModelWrapper.scala | Scala | apache-2.0 | 6,945 |
/*
* 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/performance-test-runner | src/test/scala/uk/gov/hmrc/performance/feeder/CsvFeederSpec.scala | Scala | apache-2.0 | 4,007 |
package sheetkram.model
case class Sheet private (
name : String,
columns : IndexedSeq[ Column ],
rows : IndexedSeq[ Row ] ) {
def updateCell( colIdx : Int, rowIdx : Int, cell : Cell ) : Sheet = {
val _columns : IndexedSeq[ Column ] =
if ( colIdx >= columns.size ) {
if ( rowIdx >= rows... | kfwalkow/sheetkram | src/main/scala/sheetkram/model/Sheet.scala | Scala | bsd-3-clause | 1,936 |
/*
* VETest.scala
* Variable elimination tests.
*
* Created By: Avi Pfeffer ([email protected])
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email [email protected] for information.
*
* See http://www.github.com/p2t2/figaro f... | jyuhuan/figaro | Figaro/src/test/scala/com/cra/figaro/test/algorithm/factored/VETest.scala | Scala | bsd-3-clause | 16,981 |
package org.phenoscape.kb.matrix.reports
import java.io.File
import scala.collection.JavaConversions._
import org.obo.datamodel.impl.OBOSessionImpl
import org.phenoscape.io.NeXMLReader
import org.phenoscape.model.AssociationSupport
import org.phenoscape.model.DataSet
object CharacterReport {
def report(filePath:... | phenoscape/ontotrace | src/main/scala/org/phenoscape/kb/matrix/reports/CharacterReport.scala | Scala | mit | 839 |
/* sbt -- Simple Build Tool
* Copyright 2010 Mark Harrah
*/
package sbt
package inc
import xsbti.api.Source
import java.io.File
import APIs.getAPI
trait APIs
{
/** The API for the source file `src` at the time represented by this instance.
* This method returns an empty API if the file had no API or is not known... | gilt/xsbt | compile/inc/APIs.scala | Scala | bsd-3-clause | 2,289 |
import java.lang.reflect.ParameterizedType
object Test {
def main(args: Array[String]): Unit = {
val objectB = classOf[Foo[Any]].getClasses
val returnType = objectB(1).getDeclaredMethod("m").getGenericReturnType.asInstanceOf[ParameterizedType]
val out1 = "Test$Foo.Test$Foo$A<Test.Test$Foo<T1>.B$>" // Win... | dotty-staging/dotty | tests/generic-java-signatures/derivedNames.scala | Scala | apache-2.0 | 678 |
package hello
object world extends App {
println("hello dotty!")
/*/* one
*/
two
*/
println("foo")
}
| lampepfl/dotty | tests/pos/i1052.scala | Scala | apache-2.0 | 114 |
package net.paploo.diestats.expression.evaluator
/**
* The base trait for evaluators over a numeric domain.
*
* Defines functionality that is expected of a numeric domain.
*
* Note that plus is almost always a synonym for convolution.
*
* @tparam A The domain type
* @tparam R The evaluation result type... | paploo/DieStats | src/main/scala/net/paploo/diestats/expression/evaluator/NumericEvaluator.scala | Scala | bsd-3-clause | 605 |
package com.timgroup.matchless
import MatcherMatchers._
import org.specs2.matcher.MustMatchers._
import org.specs2.Specification
class MatcherMatcherSpec extends Specification {
def is =
"A MatcherMatcher expecting success" ^
"matches when the matcher matches the value" ! {
contain("hello") must matc... | tim-group/matchless | src/test/scala/com/timgroup/matchless/MatcherMatcherSpec.scala | Scala | mit | 1,428 |
/*
* Copyright (c) 2013-2017 Snowplow Analytics Ltd.
* All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache
* License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at
* http://www.apac... | aldemirenes/snowplow | 3-enrich/stream-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich.stream/sources/NsqSource.scala | Scala | apache-2.0 | 3,067 |
package eu.stratosphere.peel.flink
import org.apache.flink.api.scala._
/**
* Example Apache Flink Job that counts the word occurrences in a given dataset.
*
* This example is built on top of the Apache Flink Scala API.
*/
object Wordcount {
def main (args: Array[String]) {
if (args.length != 2) {
ret... | carabolic/peel-wordcount-bundle | peel-wordcount-flink-jobs/src/main/scala/eu/stratosphere/peel/flink/Wordcount.scala | Scala | apache-2.0 | 637 |
/*
* 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 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala | Scala | apache-2.0 | 12,835 |
package gie.utils
package object loan {
def acquire[T <: AutoCloseable, U](resource: =>T)(fun: T=>U):U = {
val allocatedResource = resource
val r = try {
fun(allocatedResource)
} catch {
case ex: Throwable =>
try{
allocatedResource.close()
} catch {
c... | gienanesobaka/ggdrive | src/main/scala/gie/utils/try_with_stream.scala | Scala | gpl-2.0 | 670 |
/***********************************************************************
* 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-utils/src/main/scala/org/locationtech/geomesa/utils/stats/Z3Histogram.scala | Scala | apache-2.0 | 6,517 |
package graphique.backends
import graphique.images.ImageAttributes
/**
* A Graphique backend.
*
*/
class Backend(images: ImageManager, urls: UrlProvider) {
/**
* Submits a new image.
*
* @param image the image content
* @throws InvalidImageError when the submitted content is not a valid image
* @... | amrhassan/graphique | src/main/scala/graphique/backends/Backend.scala | Scala | mit | 1,944 |
package com.twitter.finagle.http
import com.twitter.conversions.time._
import org.jboss.netty.buffer.ChannelBuffers
import org.specs.SpecificationWithJUnit
import org.specs.util.DataTables
class MessageSpec extends SpecificationWithJUnit with DataTables {
"Message" should {
"empty message" in {
val respo... | JustinTulloss/finagle | finagle-http/src/test/scala/com/twitter/finagle/http/MessageSpec.scala | Scala | apache-2.0 | 7,093 |
package com.shocktrade.services
import com.shocktrade.server.services.yahoo.YahooFinanceKeyStatisticsService
._
import io.scalajs.nodejs.console
import utest._
import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue
/**
* Yahoo Finance! Statistics Service Test
* @author Lawrence Daniels <lawrence.dani... | ldaniels528/shocktrade.js | app/server/services/src/test/scala/com/shocktrade/services/YahooFinanceStatisticsServiceTests.scala | Scala | apache-2.0 | 834 |
/*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distri... | flaminem/flamy | src/main/scala/com/flaminem/flamy/utils/MergeableNamed.scala | Scala | apache-2.0 | 662 |
object Atbash {
private val org = "abcdefghijklmnopqrstuvwxyz12345679".split("")
private val shifted = "zyxwvutsrqponmlkjihgfedcba12345679"split("")
val cipherMap = org.zip(shifted).toMap
}
case class Atbash() {
import Atbash._
def encode(in: String): String =
in.toLowerCase
.split("")
... | daewon/til | exercism/scala/atbash-cipher/src/main/scala/atbashCipher.scala | Scala | mpl-2.0 | 437 |
package org.derekwyatt.shorty
import com.github.mauricio.async.db.QueryResult
import scala.collection.mutable
import scala.concurrent.{ExecutionContext, Future, future}
import scala.reflect.runtime.universe._
trait TestShortyDBComponent extends ShortyDBComponent with NilDBComponent {
val hashToUrl = mutable.Map.emp... | derekwyatt/shorty-dqw | src/test/scala/org/derekwyatt/shorty/TestShortyDB.scala | Scala | apache-2.0 | 1,659 |
package com.persist.logging
import com.persist.JsonOps._
import scala.collection.mutable
import scala.concurrent.Promise
private[logging] object TimeActorMessages {
private[logging] trait TimeActorMessage
private[logging] case class TimeStart(id: RequestId, name: String, uid: String, time: Long) extends TimeAct... | nestorpersist/logging | logger/src/main/scala/com/persist/logging/TimeActor.scala | Scala | apache-2.0 | 3,069 |
import sbt._
class ArgumentTest(info: ProjectInfo) extends DefaultProject(info)
{
val st = "org.scalatest" % "scalatest" % "1.3"
override def testOptions =
super.testOptions ++
args("success1", "-n", "test2 test3") ++
args("success2", "-n", "test2") ++
args("success3", "-n", "test3") ++
args("failure1", "... | gilt/xsbt | sbt/src/sbt-test/tests/arguments/project/build/ArgumentTest.scala | Scala | bsd-3-clause | 533 |
package skinny.engine.base
import java.net.URI
import javax.servlet.http.{ HttpServletRequest, HttpServletResponse }
import skinny.engine.Handler
import skinny.engine.implicits.ServletApiImplicits
/**
* Redirects unsecured requests to the corresponding secure URL.
*/
trait UnsecuredRequestRedirector extends Handle... | holycattle/skinny-framework | engine/src/main/scala/skinny/engine/base/UnsecuredRequestRedirector.scala | Scala | mit | 1,045 |
package com.jrende.commands
case class Exit(params : Seq[String]) extends Command {
}
| Jrende/Skvitter | src/main/scala/com/jrende/commands/Exit.scala | Scala | mit | 87 |
package gitbucket.core.view
import gitbucket.core.controller.Context
import gitbucket.core.service.RepositoryService.RepositoryInfo
import org.scalatest.FunSpec
import org.scalatest.mockito.MockitoSugar
import java.util.Date
import java.util.TimeZone
class HelpersSpec extends FunSpec with MockitoSugar {
private im... | McFoggy/gitbucket | src/test/scala/gitbucket/core/view/HelpersSpec.scala | Scala | apache-2.0 | 4,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 ... | jkbradley/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcScanBuilder.scala | Scala | apache-2.0 | 2,895 |
package org.pico.disposal
import java.io.Closeable
import java.util.concurrent.atomic.{AtomicBoolean, AtomicReference}
import org.pico.atomic.syntax.std.atomicBoolean._
import org.pico.atomic.syntax.std.atomicReference._
import org.pico.disposal.std.autoCloseable._
import org.pico.disposal.syntax.disposable._
/** A ... | pico-works/pico-disposal | pico-disposal/src/main/scala/org/pico/disposal/SimpleDisposer.scala | Scala | bsd-3-clause | 1,206 |
trait A { type Result }
class PolyTests {
def wrong(x: A { type Result = Int })
: A { type Result = String} = x
}
| yusuke2255/dotty | tests/untried/neg/t8177a.scala | Scala | bsd-3-clause | 130 |
package de.fosd.typechef.crewrite
import de.fosd.typechef.featureexpr.FeatureExprFactory
import de.fosd.typechef.conditional.{Choice, Opt}
import de.fosd.typechef.parser.c.{EnforceTreeHelper, AST}
import org.kiama.rewriting.Rewriter._
object ProductDerivation extends EnforceTreeHelper {
def deriveProduct[T <: Pro... | ckaestne/TypeChef | CRewrite/src/main/scala/de/fosd/typechef/crewrite/ProductDerivation.scala | Scala | lgpl-3.0 | 1,249 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pgandhi999/spark | mllib/src/test/scala/org/apache/spark/ml/tuning/ValidatorParamsSuiteHelpers.scala | Scala | apache-2.0 | 3,448 |
package org.vitrivr.adampro.communication
import java.util.concurrent.TimeUnit
import scalapb.json4s.JsonFormat
import io.grpc.internal.DnsNameResolverProvider
import io.grpc.netty.NettyChannelBuilder
import io.grpc.stub.StreamObserver
import io.grpc.{ManagedChannel, ManagedChannelBuilder}
import org.vitrivr.adampro.... | dbisUnibas/ADAMpro | grpcclient/src/main/scala/org/vitrivr/adampro/communication/RPCClient.scala | Scala | mit | 26,696 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.scala2_11.scalatest2_2_1
import org.jetbrains.plugins.scala.base.libraryLoaders._
import org.jetbrains.plugins.scala.testingSupport.scalatest.ScalaTestTestCase
/**
* @author Roman.Shein
* @since 22.01.2015
*/
abstract class Scalatest2_11_2_2_1_Base exten... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/scalatest/scala2_11/scalatest2_2_1/Scalatest2_11_2_2_1_Base.scala | Scala | apache-2.0 | 543 |
/*
* Copyright (C) 2016 DANS - Data Archiving and Networked Services ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
... | DANS-KNAW/easy-process-sip | src/test/scala/nl.knaw.dans.easy.multideposit/actions/AddPropertiesToDepositSpec.scala | Scala | apache-2.0 | 7,169 |
/*
* 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 ... | Intel-bigdata/OAP | oap-cache/oap/src/test/scala/org/apache/spark/sql/test/OapSharedSQLContext.scala | Scala | apache-2.0 | 4,391 |
package mesosphere.marathon
package core.deployment
import com.typesafe.scalalogging.StrictLogging
import mesosphere.marathon.core.condition.Condition
import mesosphere.marathon.core.condition.Condition.UnreachableInactive
import mesosphere.marathon.core.instance.{Goal, Instance}
import mesosphere.marathon.state.{Kill... | gsantovena/marathon | src/main/scala/mesosphere/marathon/core/deployment/ScalingProposition.scala | Scala | apache-2.0 | 4,692 |
package io.eels.component.kudu
import com.sksamuel.exts.Logging
import io.eels.schema._
import io.eels.{CloseableIterator, Part, Row, Source}
import org.apache.kudu.client.{KuduClient, RowResultIterator}
import scala.collection.JavaConverters._
case class KuduSource(tableName: String)(implicit client: KuduClient) ex... | stheppi/eel | eel-kudu/src/main/scala/io/eels/component/kudu/KuduSource.scala | Scala | apache-2.0 | 2,593 |
/*
* 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 ... | jianran/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala | Scala | apache-2.0 | 5,169 |
/*
* 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/main/scala/uk/gov/hmrc/ct/computations/CP501.scala | Scala | apache-2.0 | 1,123 |
/*
* Copyright 2016 Nikolay Donets
*
* 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 ... | nikdon/telepooz | src/main/scala/com/github/nikdon/telepooz/model/payments/SuccessfulPayment.scala | Scala | apache-2.0 | 1,899 |
package controllers
import java.util.concurrent.CopyOnWriteArrayList
import com.bryzek.apidoc.test.full.v0.models._
import com.bryzek.apidoc.test.full.v0.models.json._
import play.api.libs.json.{JsError, JsSuccess, Json}
import play.api.mvc._
import scala.collection.JavaConversions._
class Users @javax.inject.Inje... | mbryzek/apidoc-test | full/app/controllers/Users.scala | Scala | mit | 2,057 |
package com.dominikgruber.scalatorrent.actor
import akka.actor.{ActorRef, Props, Actor}
import akka.io.{IO, Tcp}
import com.dominikgruber.scalatorrent.tracker.{Peer => PeerInformation}
import java.net.InetSocketAddress
object ConnectionHandler {
case class CreatePeerConnection(peer: PeerInformation)
case class Pe... | TheDom/scala-torrent | src/main/scala/com/dominikgruber/scalatorrent/actor/ConnectionHandler.scala | Scala | mit | 1,347 |
package scorex.crypto.hash
/**
* Thread-unsafe hash classes may be used for performance purposes
*/
trait ThreadUnsafeHash[D <: Digest] extends CryptographicHash[D]
| ScorexProject/scrypto | src/main/scala/scorex/crypto/hash/ThreadUnsafeHash.scala | Scala | cc0-1.0 | 171 |
package main.scala
import java.io.BufferedInputStream
import java.io.BufferedOutputStream
import java.net.Socket
import java.io.ByteArrayOutputStream
class ClientRequestHandler {
def execRemoteObject(data: Array[Byte], socket: Socket): Array[Byte] = {
var is:BufferedInputStream = new BufferedInputStream(sock... | labs2/FLiMSy | ServerFLiMSy/src/main/scala/ClientRequestHandler.scala | Scala | apache-2.0 | 1,453 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package scalaguide
// #scalaexample
import javax.inject.Inject
import javax.net.ssl._
import play.core.ApplicationProvider
import play.server.api._
class CustomSSLEngineProvider @Inject() (appProvider: ApplicationProvider) extends SSLEngineProvider {... | benmccann/playframework | documentation/manual/working/commonGuide/production/code/scalaguide/CustomSSLEngineProvider.scala | Scala | apache-2.0 | 594 |
/*
* 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 ... | shaneknapp/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/ProjectEstimation.scala | Scala | apache-2.0 | 1,633 |
#!/usr/bin/env scalas
/***
scalaVersion := "2.11.6"
*/
/*
題目:
下面算式中,不同字母代表不同的數字,
相同的字母表示相同的數字,
範圍是 1 到 9 不含 0,
請問可能的解有幾種?
A B
- C D
-------
E F
+ G H
-------
P P P
*/
/*
解法概要:
因為任意二位數的正數相加一定不可能超過200,所以推得 P = 1,然後把二位數字合併成一個數字
W
- X
-----
Y
+ Z
-----
111
因為 0 和 1 已經不能用了,所以 W,X,Y,Z 必定是大於 20 的數字
... | hotdog929/interesting-question | InterestingQuestion1.scala | Scala | mit | 1,861 |
package org.rebeam.boxes.core.demo
//
//import org.rebeam.boxes.core.{Txn, TxnR, ShelfDefault}
//
//object TransactDemo {
//
// def thread(f: => Unit) = new Thread(new Runnable{
// def run() = f
// }).start()
//
// def main(args: Array[String]): Unit = {
// val s = ShelfDefault()
//
// val a = s.now.create(... | trepidacious/boxes-core | src/main/scala/org/rebeam/boxes/core/demo/TransactDemo.scala | Scala | gpl-2.0 | 1,816 |
object Solution {
import scala.collection.mutable.HashMap
case class Memo[I <% K, K, O](f: I => O) extends (I => O) {
val cache = HashMap.empty[K, O]
def apply(x: I) = cache getOrElseUpdate (x, f(x))
}
type I = (Int, Int)
type K = I
type O = Int
type Choices = Memo[I, K, O]
val p = 1e9.toInt
... | advancedxy/hackerrank | algorithms/combinatorics/KCandyStore.scala | Scala | mit | 745 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/compendium/types/Giantese.scala | Scala | apache-2.0 | 849 |
package app.adapters.database
import org.scalatest.{Matchers, WordSpec}
import scala.slick.jdbc.meta.MTable
/**
* User: asalvadore
*/
class DbInitializerSpec extends WordSpec with Matchers with DbSpec {
import dbProfile.profile.simple._
"createTable" should {
conn.withSession { implicit session =>
... | mericano1/spray-akka-slick-postgres | src/test/scala/app/adapters/database/DbInitializerSpec.scala | Scala | mit | 667 |
// Copyright: 2010 - 2018 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.util
import shapeless._
// workaround lack of automatic enums for sealed traits by using shapeless
package enums {
trait SingletonByName[A, C <: Coproduct] {
def l... | yyadavalli/ensime-server | util/src/main/scala/org/ensime/util/enums.scala | Scala | gpl-3.0 | 1,314 |
/**
* Copyright 2013-2015, AlwaysResolve Project (alwaysresolve.org), MOYD.CO LTD
* This file incorporates work covered by the following copyright and permission notice:
*
* Copyright 2012 silenteh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complianc... | Moydco/AlwaysResolveDNS | src/main/scala/models/NullHost.scala | Scala | apache-2.0 | 2,200 |
/*
* GeneralizedEM.scala
* Expectation maximization algorithm using any ProbQueryAlgorithm as the inference algorithm.
*
* Created By: Michael Howard ([email protected])
* Creation Date: Jun 1, 2013
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email fi... | lfkellogg/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/learning/GeneralizedEM.scala | Scala | bsd-3-clause | 22,764 |
package builder
import me.apidoc.swagger.SwaggerServiceValidator
import me.apidoc.avro.AvroIdlServiceValidator
import api_json.{ApiJsonServiceValidator, ServiceJsonServiceValidator}
import lib.{ServiceConfiguration, ServiceValidator}
import core.{ServiceFetcher, VersionMigration}
import com.bryzek.apidoc.api.v0.models... | Seanstoppable/apidoc | core/src/main/scala/core/builder/OriginalValidator.scala | Scala | mit | 1,779 |
/*
* Copyright 2015 Dennis Vriend
*
* 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... | dnvriend/reactive-programming | src/test/scala/com/test/week2/observer/Subscriber.scala | Scala | apache-2.0 | 688 |
import sbt._
import sbt.Keys._
object Dependencies {
// Some common dependencies here so they don't need to be declared over and over
val specsBuild = "org.specs2" %% "specs2" % "2.1.1"
val specsSbt = specsBuild
val scalaIoFile = "com.github.scala-incubator.io" %% "scala-io-file" % "0.4.2"
val guava = "com... | vangav/vos_backend | play-2.2.6/framework/project/Dependencies.scala | Scala | mit | 6,799 |
/*******************************************************************************
Copyright (c) 2013-2014, KAIST, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
**********************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/analysis/typing/models/DOMHtml/HTMLLegendElement.scala | Scala | bsd-3-clause | 5,043 |
package controllers
import javax.inject.Inject
import models.Table
import play.api.i18n.MessagesApi
import scala.concurrent.ExecutionContext.Implicits.global
class Tables @Inject() (val messagesApi: MessagesApi) extends api.ApiController {
def list = ApiAction { implicit request =>
Table.list.flatMap { list =... | davidgraig/foosball | server/app/controllers/Tables.scala | Scala | mit | 1,246 |
package japgolly.scalajs.react.test.raw
import scala.scalajs.js
import scala.scalajs.js.annotation._
import japgolly.scalajs.react.raw._
/** https://facebook.github.io/react/docs/test-utils.html */
@JSImport("react-dom/test-utils", JSImport.Namespace, "ReactTestUtils")
@js.native
object ReactTestUtils extends ReactTe... | matthughes/scalajs-react | test/src/main/scala/japgolly/scalajs/react/test/raw/ReactTestUtils.scala | Scala | apache-2.0 | 3,818 |
package testcases
object UnificationTest {
sealed abstract class Tree
case class Leaf() extends Tree
case class Node(left: Tree, value: Int, right: Tree) extends Tree
// Proved by unifier
def mkTree(a: Int, b: Int, c: Int) = {
Node(Node(Leaf(), a, Leaf()), b, Node(Leaf(), c, Leaf()))
/... | epfl-lara/leon | testcases/graveyard/UnificationTest.scala | Scala | gpl-3.0 | 1,579 |
package fpinscala.datastructures
trait L[+A]
case object N extends L[Nothing]
case class C[+A](head: A, tail: L[A]) extends L[A] {
override def toString: String = {
@annotation.tailrec
def loop(cons: L[A], string: String, ending: String): String = {
cons match {
case N =>
... | pjberry/functional-programming-in-scala | src/com/bitmotif/part_1/Listing_3_1_1.scala | Scala | mit | 1,021 |
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.