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 ml.combust.mleap.executor.error
class ExecutorException(message: String,
cause: Throwable) extends RuntimeException(message, cause) {
def this(message: String) = this(message, null)
def this(err: Throwable) = this(err.getMessage, err)
}
| combust/mleap | mleap-executor/src/main/scala/ml/combust/mleap/executor/error/ExecutorException.scala | Scala | apache-2.0 | 274 |
package reftree.geometry
import monocle.{Lens, Optional}
import scala.collection.immutable.ListMap
/**
* Semi-interpolation varies a single value over time.
* It can be seen as an [[Interpolation]] with one end fixed (left or right).
*/
trait SemiInterpolation[A] { self β
/** Produce the value at time `t` (from ... | stanch/reftree | core/shared/src/main/scala/reftree/geometry/Interpolation.scala | Scala | gpl-3.0 | 9,036 |
package com.sksamuel.scapegoat
import java.io.File
import java.util.concurrent.atomic.AtomicInteger
import com.sksamuel.scapegoat.io.IOUtils
import scala.tools.nsc._
import scala.tools.nsc.plugins.{ Plugin, PluginComponent }
import scala.tools.nsc.transform.{ Transform, TypingTransformers }
class ScapegoatPlugin(va... | pwwpche/scalac-scapegoat-plugin | src/main/scala/com/sksamuel/scapegoat/plugin.scala | Scala | apache-2.0 | 8,705 |
package boatcraft.compatibility.industrialcraft2.modifiers.materials
import boatcraft.api.modifiers.Material
import net.minecraft.util.ResourceLocation
import ic2.api.item.IC2Items
object Carbon extends Material {
override def getTexture = new ResourceLocation("ic2", "textures/models/boatCarbon.png")
override def ... | Open-Code-Developers/BoatCraft | src/main/scala/boatcraft/compatibility/industrialcraft2/modifiers/materials/Carbon.scala | Scala | mit | 666 |
package com.typesafe.akka.http.benchmark.datastore
import scala.collection.immutable
import com.typesafe.akka.http.benchmark.entity.{ Fortune, World }
import scala.concurrent.Future
trait DataStore {
def findWorldById(id: Int): Future[Option[World]]
def requireWorldById(id: Int): Future[World]
def updateWorld(... | saturday06/FrameworkBenchmarks | frameworks/Scala/akka-http/src/main/scala/com/typesafe/akka/http/benchmark/datastore/DataStore.scala | Scala | bsd-3-clause | 404 |
/*
* This file is part of pelam-scala-csv
*
* Copyright Β© Peter Lamberg 2015 (pelam-scala-csv@pelam.fi)
*
* 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/... | pelamfi/pelam-scala-csv | src/main/scala/fi/pelam/csv/cell/IntegerCell.scala | Scala | apache-2.0 | 3,152 |
package scala.scalajs.js.typedarray
import scala.scalajs.js
/** <span class="badge badge-ecma6" style="float: right;">ECMAScript 6</span>
* A [[TypedArray]] of signed 32-bit integers
*/
@js.native
class Int32Array private extends TypedArray[Int, Int32Array] {
/** Constructs a Int32Array with the given length. I... | lrytz/scala-js | library/src/main/scala/scala/scalajs/js/typedarray/Int32Array.scala | Scala | bsd-3-clause | 1,016 |
package com.overviewdocs.background.filegroupcleanup
import scala.concurrent.Future
import akka.actor.{ Actor, ActorRef, Props }
import akka.pattern.pipe
import com.overviewdocs.background.filegroupcleanup.FileGroupRemovalRequestQueueProtocol._
/**
* Looks for deleted [[FileGroup]]s on start up, and sends removal r... | overview/overview-server | worker/src/main/scala/com/overviewdocs/background/filegroupcleanup/DeletedFileGroupCleaner.scala | Scala | agpl-3.0 | 1,617 |
/**
* (C) Copyright IBM Corp. 2015 - 2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... | SparkTC/spark-bench | cli/src/test/scala/com/ibm/sparktc/sparkbench/datageneration/KMeansDataGenTest.scala | Scala | apache-2.0 | 2,891 |
package picasso.frontend.compilerPlugin
import scala.tools.nsc
import scala.tools.nsc.{Global,Phase}
import scala.tools.nsc.plugins.{Plugin,PluginComponent}
import picasso.utils.{LogCritical, LogError, LogWarning, LogNotice, LogInfo, LogDebug, Logger}
import picasso.frontend.compilerPlugin.transform._
/** This class ... | dzufferey/picasso | frontend/compilerPlugin/src/main/scala/picasso/frontend/compilerPlugin/PicassoPlugin.scala | Scala | bsd-2-clause | 3,981 |
package com.eevolution.context.dictionary.infrastructure.repository
import java.util.UUID
import com.eevolution.context.dictionary.domain._
import com.eevolution.context.dictionary.domain.model.OrganizationInfo
import com.eevolution.context.dictionary.infrastructure.db.DbContext._
import com.eevolution.utils.Paginate... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/repository/OrganizationInfoRepository.scala | Scala | gpl-3.0 | 2,882 |
package at.logic.gapt.formats.shlk_parsing
import at.logic.gapt.formats.simple.TypeParsers
import at.logic.gapt.proofs.HOLSequent
import at.logic.gapt.proofs.lk.solve
import scala.util.parsing.combinator._
import scala.util.matching.Regex
import java.io.InputStreamReader
import at.logic.gapt.expr.schema._
import at.l... | loewenheim/gapt | src/main/scala/at/logic/gapt/formats/shlk/sFOparserCNT.scala | Scala | gpl-3.0 | 38,743 |
package skinny
/**
* Model interface for SkinnyResource.
*
* @tparam Id id
* @tparam Model model
*/
trait SkinnyModel[Id, Model] {
/**
* Extracts raw value from Identity.
*
* @param id id
* @return raw value
*/
def idToRawValue(id: Id): Any
/**
* Converts raw value to Identity.
*
... | BlackPrincess/skinny-framework | common/src/main/scala/skinny/SkinnyModel.scala | Scala | mit | 1,512 |
package org.scalatest.prop
/*
* Copyright 2001-2022 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 requir... | scalatest/scalatest | jvm/core/src/main/scala/org/scalatest/prop/Seed.scala | Scala | apache-2.0 | 1,747 |
package edu.utdallas
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.spark.util.Vector
import org.apache.spark.rdd.RDD
import scala.io.Source
import java.util.Properties
object Resystem {
def parse(a:Array[String]) : Array[String]=
{
... | cyjj/Big-data | Resystem.scala | Scala | gpl-2.0 | 2,315 |
/*^
===========================================================================
Helios - FX
===========================================================================
Copyright (C) 2013-2016 Gianluca Costa
===========================================================================
Licensed under the Apache... | giancosta86/Helios-fx | src/main/scala/info/gianlucacosta/helios/fx/application/StartupThread.scala | Scala | apache-2.0 | 1,801 |
/**
* Copyright (C) 2010-2011 LShift Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | aprescott/diffa | kernel/src/main/scala/net/lshift/diffa/kernel/notifications/NotificationEvent.scala | Scala | apache-2.0 | 1,233 |
/*
* Copyright 2016 Nicolas Rinaudo
*
* 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... | nrinaudo/kantan.regex | java8/src/test/scala/kantan/regex/java8/LocalTimeDecoderTests.scala | Scala | apache-2.0 | 1,275 |
/*
* Copyright (C) 2011-2017 Interfaculty Department of Geoinformatics, University of
* Salzburg (Z_GIS) & Institute of Geological and Nuclear Sciences Limited (GNS Science)
* in the SMART Aquifer Characterisation (SAC) programme funded by the New Zealand
* Ministry of Business, Innovation and Employment (MBIE)
*
... | ZGIS/smart-owc-geojson | src/test/scala/info/smart/models/owc100/OwcResourceSpec.scala | Scala | apache-2.0 | 16,447 |
package com.joshcough.minecraft
import org.bukkit.block.Block
import org.bukkit.entity.{Arrow, Entity, Player}
import org.bukkit.event.{EventHandler => EH, Listener}
import org.bukkit.event.block.{BlockBreakEvent, BlockDamageEvent}
import org.bukkit.event.block.Action._
import org.bukkit.event.entity.{ProjectileHitEve... | joshcough/MinecraftPlugins | core/src/main/scala/com/joshcough/minecraft/Listeners.scala | Scala | mit | 5,780 |
/*
* 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... | lresende/incubator-toree | kernel/src/main/scala/org/apache/toree/kernel/protocol/v5/interpreter/tasks/CodeCompleteTaskActor.scala | Scala | apache-2.0 | 1,658 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2010-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/collection/generic/HasNewCombiner.scala | Scala | bsd-3-clause | 732 |
package grasshopper.test.streams
import akka.stream.ActorAttributes._
import akka.stream.Supervision._
import akka.stream.scaladsl.Flow
import akka.util.ByteString
import feature.Feature
import grasshopper.test.model.TestGeocodeModel.{ PointInputAddress, PointInputAddressTract }
trait FlowUtils {
val numProcessors... | awolfe76/grasshopper | test-harness/src/main/scala/grasshopper/test/streams/FlowUtils.scala | Scala | cc0-1.0 | 578 |
package com.thetestpeople.trt.importer.jenkins
import org.joda.time.Duration
import org.joda.time.DateTime
import java.net.URI
case class JenkinsBuildSummary(
url: URI,
durationOpt: Option[Duration],
nameOpt: Option[String],
timestampOpt: Option[DateTime],
resultOpt: Option[String],
hasTestReport: Boolean... | thetestpeople/trt | app/com/thetestpeople/trt/importer/jenkins/JenkinsBuildSummary.scala | Scala | mit | 345 |
/*
* 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/PropSpecSpec.scala | Scala | apache-2.0 | 52,716 |
package com.thangiee.lolhangouts.data.usecases.entities
import java.util.Date
case class Message(
friendName: String,
text: String,
isSentByUser: Boolean,
isRead: Boolean,
date: Date
)
| Thangiee/LoL-Hangouts | src/com/thangiee/lolhangouts/data/usecases/entities/Message.scala | Scala | apache-2.0 | 200 |
class Foo:
private var blah: Double = 0L | lampepfl/dotty | tests/pos-special/i7296.scala | Scala | apache-2.0 | 42 |
package scoverage.report
import java.io.File
import scala.xml.Node
import scala.xml.PrettyPrinter
import scoverage._
/** @author Stephen Samuel */
class ScoverageXmlWriter(
sourceDirectories: Seq[File],
outputDir: File,
debug: Boolean
) extends BaseReportWriter(sourceDirectories, outputDir) {
def thi... | scoverage/scalac-scoverage-plugin | scalac-scoverage-plugin/src/main/scala/scoverage/report/ScoverageXmlWriter.scala | Scala | apache-2.0 | 4,934 |
package com.github.ponkin.bloom.spark
import com.github.ponkin.bloom.driver.Client
import com.twitter.util.{ Await, Future }
import org.apache.spark.{ TaskContext, SparkContext }
import org.apache.spark.rdd.RDD
/**
* Enrich standart RDD with additional
* functions to put rdd in remote bloom filter
*/
class BloomFu... | ponkin/bloom | spark-connector/src/main/scala/com/github/ponkin/bloom/spark/BloomFunctions.scala | Scala | apache-2.0 | 1,865 |
/*
* 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.testsuite.javalib.lang
im... | scala-js/scala-js | test-suite/js/src/test/scala/org/scalajs/testsuite/javalib/lang/ObjectJSTest.scala | Scala | apache-2.0 | 4,079 |
/*
* 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 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVUtils.scala | Scala | apache-2.0 | 5,070 |
class Person(name: String) {
val Array(firstName, lastName) = name.split(' ')
}
val person = new Person("Samurai Jack")
println("First name: " + person.firstName)
println("Last name: " + person.lastName)
| demiazz/scala-impatient | chapter-05/exercise-07/main.scala | Scala | unlicense | 208 |
/*
* Copyright 2020 ACINQ SAS
*
* 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... | ACINQ/eclair | eclair-core/src/test/scala/fr/acinq/eclair/payment/relay/ChannelRelayerSpec.scala | Scala | apache-2.0 | 27,852 |
package fpinscala
package parsing
import SliceableTypes._
import scala.util.matching.Regex
/*
This implementation is a bit trickier than the one in `Reference.scala`.
The main change is to add another piece of state to `ParseState`,
an `isSliced` flag, and an additional `Slice` constructor to `Result`.
If the `isSlic... | damien-neveu/functional-programming-in-scala | answers/src/main/scala/fpinscala/parsing/instances/Sliceable.scala | Scala | mit | 9,959 |
/*
* Copyright 2011-2022 GatlingCorp (https://gatling.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 appli... | gatling/gatling | gatling-core/src/main/scala/io/gatling/core/action/GroupStart.scala | Scala | apache-2.0 | 1,303 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | goldmedal/spark | sql/core/src/test/scala/org/apache/spark/sql/DatasetPrimitiveSuite.scala | Scala | apache-2.0 | 19,111 |
package demo
/*
* Copyright (C) 24/08/16 // mathieu.leclaire@openmole.org
*
* 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) a... | mathieuleclaire/scaladget | demo/src/main/scala/demo/PopoverDemo.scala | Scala | agpl-3.0 | 4,311 |
package com.datastax.spark.connector
import java.nio.ByteBuffer
import com.datastax.driver.core.{ProtocolVersion, Row, UDTValue => DriverUDTValue}
import com.datastax.spark.connector.types.TypeConverter.StringConverter
import scala.collection.JavaConversions._
import com.datastax.spark.connector.util.ByteBufferUtil... | willgalen/REVEL | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/AbstractGettableData.scala | Scala | apache-2.0 | 4,278 |
/*
* 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 ... | himanshudhami/PredictionIO | examples/experimental/scala-local-helloworld/HelloWorld.scala | Scala | apache-2.0 | 2,851 |
package com.geocommit
import com.surftools.BeanstalkClient.Job
import net.liftweb.json.JsonAST._
import net.liftweb.json.Printer._
object Implicit {
implicit def job2RichJob(j: Job): RichJob =
new RichJob(j)
implicit def json2ByteArray(j: JValue): Array[Byte] =
compact(render(j)).getBytes("UT... | dsp/geocommit-web | fetchservice/src/main/scala/com/geocommit/Implicit.scala | Scala | mit | 530 |
/***
* Copyright 2014 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... | tylerroyal/api-checker | core/src/main/scala/com/rackspace/com/papi/components/checker/step/startend/MethodFailMatch.scala | Scala | apache-2.0 | 2,228 |
package uk.gov.homeoffice.rabbitmq
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.{Future, Promise}
import org.json4s.JValue
import org.json4s.JsonAST.JNothing
import org.json4s.jackson.JsonMethods._
import org.scalactic.{Bad, Good, Or}
import com.rabbitmq.client.{Channel, ConfirmLis... | UKHomeOffice/rtp-rabbit-lib | src/main/scala/uk/gov/homeoffice/rabbitmq/Publisher.scala | Scala | mit | 2,471 |
package com.krux.hyperion.contrib.activity.email
import java.io.{ File, FilenameFilter }
import java.nio.file.{ Files, Paths }
import javax.activation.{ DataHandler, FileDataSource }
import javax.mail.Message.RecipientType
import javax.mail._
import javax.mail.internet.{ InternetAddress, MimeBodyPart, MimeMessage, Mim... | sethyates/hyperion | contrib/activity/email/src/main/scala/com/krux/hyperion/contrib/activity/email/SendEmailActivity.scala | Scala | apache-2.0 | 6,736 |
package controllers
import javax.inject.Inject
import actors.RequestActor
import actors.RequestActor._
import akka.actor.ActorSystem
import akka.pattern.ask
import akka.util.Timeout
import models.db.Tables.customReads
import play.api.Logger
import play.api.libs.json._
import play.api.libs.ws.WSClient
import play.api.... | alexFrankfurt/nest-api | app/controllers/Application.scala | Scala | mit | 1,035 |
package com.ironcorelabs.davenport
package error
import com.couchbase.client.core.CouchbaseException
import codec.DecodeError
sealed trait CouchbaseError extends CouchbaseException
//Splitting these ADT entries didn't work well.
// scalastyle:off line.size.limit
final case class InvalidPasswordException(bucketName: St... | IronCoreLabs/davenport | src/main/scala/com/ironcorelabs/davenport/error/CouchbaseError.scala | Scala | mit | 2,094 |
/*
* -β₯ββββ -ββββ-
* β‘β’βββββ\\βββΟ ββββββββββββͺβ
* β£β¬ββ` `ββββ’β Οββ£β¬ββ βββ’β£Q
* ββ£β¬ββ ` β€βββΓ
` ββ’β¬β£
* ββ£β¬ββ βββββ`Β«β β’β’β£β
* β«β¬βββ .β ββ¨β¨ β£β£β¬βΟ βΟββ’β’Γ
* ββ’βββββ"ββββ βΓ
ββββββββββ`
* ``ΛΒ¬ β ΛΛβΒ΄
*
* ... | Flipkart/connekt | commons/src/test/scala/com/flipkart/connekt/commons/tests/dao/UserConfigurationDaoTest.scala | Scala | mit | 1,461 |
package com.sothr.imagetools.ui.util
import java.awt.Desktop
import java.io.File
import com.sothr.imagetools.engine.util.PropertiesService
import grizzled.slf4j.Logging
/**
* Created by Drew Short on 8/31/2014.
*/
object FileUtil extends Logging {
def openInEditor(file: File) = {
PropertiesService.OS.toLowe... | warricksothr/ImageTools | gui/src/main/scala/com/sothr/imagetools/ui/util/FileUtil.scala | Scala | mit | 863 |
package com.cloudera.sa.sparkstreaming.seqwriter
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.streaming.StreamingContext
import org.apache.spark.streaming.Seconds
import org.apache.hadoop.io.Text
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.io.N... | tmalaska/SparkStreamingSeqSink | src/main/scala/com/cloudera/sa/sparkstreaming/seqwriter/Example.scala | Scala | apache-2.0 | 1,684 |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... | xjrk58/elasticsearch-hadoop | spark/sql-20/src/main/scala/org/elasticsearch/spark/sql/DataFrameFieldExtractor.scala | Scala | apache-2.0 | 1,633 |
package com.cyrusinnovation.computation
/*
* Copyright 2014 Cyrus Innovation, LLC. Licensed under Apache license 2.0.
*/
import com.cyrusinnovation.computation.util.Log
/** Operates on a set of facts (contained in a Map[Symbol, Any] to return a result in
* the same form. Implementers must extend the `compute` meth... | psfblair/computation-engine | core/src/main/scala/com/cyrusinnovation/computation/Computation.scala | Scala | apache-2.0 | 9,029 |
package com.sksamuel.elastic4s.searches.aggs
import com.sksamuel.elastic4s.script.ScriptDefinition
import com.sksamuel.elastic4s.searches.aggs.pipeline.PipelineAggregationDefinition
import com.sksamuel.exts.OptionImplicits._
case class PercentilesAggregationDefinition(name: String,
... | tyth/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/aggs/PercentilesAggregationDefinition.scala | Scala | apache-2.0 | 1,924 |
/*
* Copyright 2015-2016 Snowflake Computing
*
* 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 ... | snowflakedb/spark-snowflakedb | src/it/scala/net/snowflake/spark/snowflake/benchmarks/PerformanceSuite.scala | Scala | apache-2.0 | 11,781 |
package org.coroutines
import org.coroutines.common._
import scala.collection._
import scala.language.experimental.macros
import scala.reflect.macros.whitebox.Context
/** Declares basic data types and analysis utilities.
*/
trait Analyzer[C <: Context] {
val c: C
import c.universe._
case class Zipper(abo... | storm-enroute/coroutines | src/main/scala/org/coroutines/Analyzer.scala | Scala | bsd-3-clause | 16,080 |
package concrete
package constraint
package linear
import bitvectors.BitVector
import com.typesafe.scalalogging.LazyLogging
import concrete.constraint.extension.BinaryExt
import concrete.generator.ACBC
import concrete.util.Interval
object Eq {
def apply(neg: Boolean, x: Variable, b: Int, y: Variable): ACBC =
if... | concrete-cp/concrete | src/main/scala/concrete/constraint/linear/Eq.scala | Scala | lgpl-2.1 | 7,263 |
/*
* Copyright 2008 WorldWide Conferencing, LLC
*
* 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 la... | wso2as-developer/scala-samples | lift-jpa/web/src/main/scala/org/wso2/as/model/Model.scala | Scala | apache-2.0 | 775 |
package pl.edu.agh.iosr.iosr2015.data.streaming.twitter.client
import java.util.UUID
//
//import com.websudos.phantom.sample.ExampleModel
//import com.websudos.phantom.dsl._
//
//case class TDIDF(
// id: Int,
// name: String,
// props: Map[Stri... | IOSR-Streaming-data/IOSR2015-twitter-streaming-data-client | src/main/scala/pl/edu/agh/iosr/iosr2015/data/streaming/twitter/client/models.scala | Scala | apache-2.0 | 1,013 |
/*
* Copyright (C) 2014-2015 by Nokia.
* See the LICENCE.txt 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.
* You may obtain a copy o... | elyast/wookie | app-api/src/main/scala/wookie/Bools.scala | Scala | apache-2.0 | 1,543 |
import com.typesafe.sbt.packager.docker.{DockerPlugin, Cmd, DockerKeys}
import sbt._
object CommonDockerSettingsPlugin extends AutoPlugin with DockerKeys {
override def trigger = allRequirements
override def requires = DockerPlugin
def appLogLevel = sys.props.getOrElse("ECOMMERCE_LOG_LEVEL", default = "INFO")
... | pawelkaczor/ddd-leaven-akka-v2 | project/CommonDockerSettingsPlugin.scala | Scala | mit | 562 |
package com.twitter.finagle.http2.transport.server
import com.twitter.finagle.Stack.Params
import com.twitter.finagle.netty4.http.handler.UriValidatorHandler
import com.twitter.finagle.netty4.http.{Http2CodecName, HttpCodecName}
import com.twitter.finagle.param.Stats
import com.twitter.finagle.stats.InMemoryStatsRecei... | twitter/finagle | finagle-http2/src/test/scala/com/twitter/finagle/http2/transport/server/ServerNpnOrAlpnHandlerTest.scala | Scala | apache-2.0 | 2,615 |
package com.seanshubin.todo.persistence.domain
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
import java.nio.charset.StandardCharsets
import javax.servlet.{ServletInputStream, ServletOutputStream}
import org.eclipse.jetty.server.{HttpChannel, HttpInput, Request}
import org.scalatest.FunSuite
import sc... | SeanShubin/todo-persistence | domain/src/test/scala/com/seanshubin/todo/persistence/domain/HandlerAdapterTest.scala | Scala | unlicense | 3,209 |
/*
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs
import org.apache.commons.codec.digest.DigestUtils
import org.apache.commons.codec.binary.Hex
/**
* Utilities for Codecs operations.
*/
object Codecs {
/**
* Computes the SHA-1 digest for a byte array.
*
* @p... | jyotikamboj/container | pf-framework/src/play/src/main/scala/play/api/libs/Codecs.scala | Scala | mit | 1,425 |
package almhirt.streaming
import almhirt.common._
import almhirt.tracking.TrackingTicket
sealed trait DeliveryStatus { def isSuccess: Boolean }
object DeliveryStatus {
implicit class DeliveryStatusOps(self: DeliveryStatus) {
def onFailure(f: Problem β Unit) {
self match {
case d: DeliveryJobFaile... | chridou/almhirt | almhirt-core/src/main/scala/almhirt/streaming/DeliveryStatus.scala | Scala | apache-2.0 | 2,120 |
package ml.wolfe.term
import ml.wolfe.{Vect, WolfeSpec}
/**
* @author riedel
*/
class TermSpecs extends WolfeSpec {
import ml.wolfe.term.TermImplicits._
import ml.wolfe.util.Math._
"A matrix variable term" should {
"evaluate to a matrix" in {
val x = Matrices(2, 3).Var
val tensor2 = matrix(... | wolfe-pack/wolfe | wolfe-core/src/test/scala/ml/wolfe/term/TermSpecs.scala | Scala | apache-2.0 | 10,531 |
package weaponmark
import com.diogonunes.jcdp.color.ColoredPrinter
import com.diogonunes.jcdp.color.api.Ansi.{Attribute, BColor, FColor}
/** Prints multiple command line examples with explanations. */
case class Example(cp: ColoredPrinter) {
private def print() = {
val cmdColor = FColor.YELLOW
val descColor... | locke8/weaponmark | src/main/scala/weaponmark/Example.scala | Scala | mit | 2,384 |
/*
* 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 ... | bavardage/spark | core/src/main/scala/spark/scheduler/TaskScheduler.scala | Scala | apache-2.0 | 2,113 |
package br.gov.lexml.parser.pl.linker
import akka.actor._
import scala.language.postfixOps
import br.gov.lexml.parser.pl.block._
import br.gov.lexml.parser.pl.rotulo._
import scala.xml._
import scala.concurrent.duration._
import akka.actor.SupervisorStrategy._
import grizzled.slf4j.Logger
import scala.concurrent.Aw... | lexml/lexml-parser-projeto-lei | src/main/scala/br/gov/lexml/parser/pl/linker/Linker.scala | Scala | gpl-2.0 | 2,374 |
package pl.touk.nussknacker.test
import org.scalatest.concurrent.{Eventually, ScalaFutures}
import org.scalatest.time.{Millis, Seconds, Span}
/**
* Default ScalaFutures patient is set to timeout = 150ms and interval = 15ms. It is a good setting in the perfect scenario
* when asynchronous tasks are very short and gl... | TouK/nussknacker | utils/test-utils/src/main/scala/pl/touk/nussknacker/test/PatientScalaFutures.scala | Scala | apache-2.0 | 748 |
package IFDS
class TestHelper {
val foo = Method("foo")
val bar = Method("bar")
val a = Node("a")
val b = Node("b")
val b1 = Node("b1")
val b2 = Node("b2")
val c = Node("c")
val c0 = Node("c0")
val d = Node("d")
val e = Node("e")
val f = Node("f")
val g = Node("g")
val h = Node("h")
val i =... | packlnd/IFDS-RA | src/test/scala/IFDS/TestHelper.scala | Scala | mit | 11,479 |
/**
* Copyright (C) 2012-2013 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 | app/debiki/Debiki.scala | Scala | agpl-3.0 | 3,024 |
package org.broadinstitute.dsde.snoop
import javax.sql.DataSource
import akka.actor.{ActorSystem, Props}
import akka.io.IO
import com.mchange.v2.c3p0.ComboPooledDataSource
import com.wordnik.swagger.model.ApiInfo
import org.broadinstitute.dsde.snoop.dataaccess.SnoopSubmissionController
import org.broadinstitute.dsde.... | broadinstitute/snoop | src/main/scala/org/broadinstitute/dsde/snoop/Boot.scala | Scala | bsd-3-clause | 3,966 |
// See LICENSE for license details.
package librefpga.test
import Chisel.iotesters.{ChiselFlatSpec, Driver, PeekPokeTester}
import librefpga.LUTn
import chisel3._
class LUTnUnitTester(c: LUTn) extends PeekPokeTester(c) {
private val lutn = c
poke(lutn.io.cfg.sen, 0)
step(1)
/* test default outputs (0) */... | xfguo/librefpga | src/test/scala/fpga/test/LUT4UnitTest.scala | Scala | apache-2.0 | 1,342 |
package modules
import com.google.inject.{ AbstractModule, Provides }
import com.mohiva.play.silhouette.api.repositories.AuthInfoRepository
import com.mohiva.play.silhouette.api.services._
import com.mohiva.play.silhouette.api.util._
import com.mohiva.play.silhouette.api.{ Environment, EventBus }
import com.mohiva.pla... | leannenorthrop/play-mantra-accumulations | app/modules/SilhouetteModule.scala | Scala | apache-2.0 | 14,451 |
/**
* 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... | coderczp/camel | components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/RollbackTest.scala | Scala | apache-2.0 | 2,476 |
package com.originate.scalypher
import com.originate.scalypher.action.ActionItem
import com.originate.scalypher.action.ReturnAction
import com.originate.scalypher.action.ReturnAll
import com.originate.scalypher.action.ReturnDistinct
import com.originate.scalypher.action.ReturnReference
import com.originate.scalypher.p... | Originate/scalypher | src/main/scala/query/MatchCreateQuery.scala | Scala | mit | 2,603 |
package ca.uqam.euler.nicolas
import Util.gcd
object Problem033 {
case class Fraction(n: Int, d: Int) {
override def toString = n + "/" + d
def *(x: Fraction) = new Fraction(n * x.n, d * x.d)
def simplified = {
val g = gcd(n, d)
new Fraction(n / g, d / g)
}
def equivalent(that: Frac... | nicolaspayette/project-euler | src/main/scala/ca/uqam/euler/nicolas/Problem033.scala | Scala | mit | 814 |
package org.jetbrains.plugins.scala
package codeInspection
package collections
import com.intellij.testFramework.EditorTestUtil.{SELECTION_END_TAG => END, SELECTION_START_TAG => START}
/**
* Nikolay.Tropin
* 5/30/13
*/
class FindIsDefinedTest extends OperationsOnCollectionInspectionTest {
override val classOfIns... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/codeInspection/collections/FindIsDefinedTest.scala | Scala | apache-2.0 | 2,474 |
package adt.bson.mongo.async.client
import java.util.concurrent.TimeUnit
import adt.bson.mongo.MongoBlock
import adt.bson.mongo.async.{AsyncBatchCursor, MongoSingleCallback}
import adt.bson.{BsonJavaScript, BsonObject}
import com.mongodb.CursorType
import com.mongodb.client.model.MapReduceAction
import play.api.libs.... | jeffmay/bson-adt | bson-adt-mongo3-async/src/main/scala/adt/bson/mongo/async/client/MongoIterables.scala | Scala | apache-2.0 | 7,467 |
/*
* 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/test/scala/uk/gov/hmrc/ct/computations/CP87aSpec.scala | Scala | apache-2.0 | 1,618 |
object NegativeId extends Enumeration {
val Negative = Value(-1, "minus")
val Zero = Value(0, "zero")
val Positive = Value(1, "plus")
def fromInt(id: Int) = values find (_.id == id) match {
case Some(v) => v
case None => null
}
}
object Test extends App {
println(NegativeId.fromInt(-1))
println... | som-snytt/dotty | tests/run/t3950.scala | Scala | apache-2.0 | 379 |
package se.lu.nateko.cp.job
import scala.util.Try
import java.util.UUID
object ReportValidator {
val WAIT_TIME = 5
private val emailRegex = """^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}$""".r
def validate(report: Report): Try[CandidateInfo] = for{
_ <- validateCandidateInfo(report.candidateInfo);
_ <-... | ICOS-Carbon-Portal/meta | jobAd/src/main/scala/se/lu/nateko/cp/job/ReportValidator.scala | Scala | gpl-3.0 | 1,636 |
/**
* Magmanics Licensing. This web application allows for centralized control
* of client application activation, with optional configuration parameters
* to control licensable features, and storage of supplementary information
* about the client machine. Client applications may interface with this
* central serv... | manicmonkey/licensing | Licensing-Server/src/test/scala/com/magmanics/licensing/datalayer/model/CustomerTest.scala | Scala | gpl-3.0 | 1,766 |
package gitbucket.core.plugin
import gitbucket.core.controller.Context
import gitbucket.core.service.RepositoryService
import gitbucket.core.view.Markdown
import play.twirl.api.Html
/**
* A render engine to render content to HTML.
*/
trait Renderer {
/**
* Render the given request to HTML.
*/
def render(... | intermezzo-fr/gitbucket | src/main/scala/gitbucket/core/plugin/Renderer.scala | Scala | apache-2.0 | 1,088 |
/***********************************************************************
* Copyright (c) 2013-2022 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | locationtech/geomesa | geomesa-index-api/src/test/scala/org/locationtech/geomesa/index/InMemoryMetadata.scala | Scala | apache-2.0 | 2,207 |
package scalashop
import org.scalameter._
import common._
import java.util.concurrent._
object HorizontalBoxBlurRunner {
val standardConfig = config(
Key.exec.minWarmupRuns -> 5,
Key.exec.maxWarmupRuns -> 10,
Key.exec.benchRuns -> 10,
Key.verbose -> true
) withWarmer(new Warmer.Default)
def m... | huajianmao/learning | coursera/parprog1/week1/scalashop/src/main/scala/scalashop/HorizontalBoxBlur.scala | Scala | mit | 2,312 |
package eu.timepit.refined.cats
import eu.timepit.refined.api.{Max, Min}
import org.scalacheck.{Arbitrary, Prop, Properties}
import org.scalacheck.Prop._
class NonNegShiftSpec extends Properties("NonNegShift") {
final def createProperty[A: Arbitrary: Min: NonNegShift](implicit num: Numeric[A]): Prop = {
import ... | fthomas/refined | modules/cats/shared/src/test/scala/eu/timepit/refined/cats/ShiftSpec.scala | Scala | mit | 1,327 |
package org.tomahna.scalaresume.resume
import play.api.libs.json.JsSuccess
import play.api.libs.json.Reads
case class Resume(
basics: Basics,
work: List[Work],
volunteer: List[Volunteer],
education: List[Education],
awards: List[Award],
publications: List[Publication],
skills: List[Skill],
languages: ... | Tomahna/scalaresume | resume/src/main/scala/org/tomahna/scalaresume/resume/Resume.scala | Scala | mit | 1,021 |
package me.enkode.j8
import java.util.Optional
trait JavaOptionalSupport[T] {
def jOptional: Optional[T]
def asScala = if (jOptional.isPresent) {
Option(jOptional.get())
} else {
None
}
}
| kender/java8-converters | src/main/scala/me/enkode/j8/JavaOptionalSupport.scala | Scala | mit | 207 |
package uk.gov.gds.location.importer.helpers
import org.joda.time.DateTime
import uk.gov.gds.location.importer.model._
import uk.gov.gds.location.importer.model.CodeLists._
import scala.Some
object TestHelpers {
lazy val startDate = new DateTime().minusDays(100)
lazy val lastUpdatedDate = new DateTime().minusDays... | alphagov/location-data-importer | src/test/scala/uk/gov/gds/location/importer/helpers/TestHelpers.scala | Scala | mit | 2,497 |
/*
Copyright (c) 2017 KAPSARC
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
dist... | EconomicSL/auctions | src/main/scala/org/economicsl/auctions/messages/PriceQuantitySchedule.scala | Scala | apache-2.0 | 1,127 |
package db
import java.util.UUID
import models.TileCacheExpiration
import com.trifectalabs.roadquality.v0.models._
import models.{MiniSegment, MiniSegmentToSegment}
import org.joda.time.DateTime
import com.vividsolutions.jts.geom.Geometry
object Tables {
import MyPostgresDriver.api._
import TablesHelper._
cla... | trifectalabs/roadquality | api/app/db/Tables.scala | Scala | bsd-3-clause | 3,878 |
package se.citerus.dddsample.infrastructure.persistence.hibernate
class VoyageRepositoryHibernate {
} | oluies/ddd-sample-scala | src/main/scala/se/citerus/dddsample/infrastructure/persistence/hibernate/VoyageRepositoryHibernate.scala | Scala | mit | 107 |
/* Copyright (c) 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | mjanson/gdata-scala-client | tests/com/google/xml/combinators/PicklerTest.scala | Scala | apache-2.0 | 5,429 |
/*
* Copyright Β© 2014 Teo Klestrup, Carl Dybdahl
*
* This file is part of Republix.
*
* Republix 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 op... | teozkr/republix-online | republix/src/main/scala/republix/game/SimVote.scala | Scala | agpl-3.0 | 1,217 |
object `gadt-no-approx` {
def fo[U](u: U): U =
(0 : Int) match {
case _: u.type =>
val i: Int = (??? : U) // error
// potentially could compile
// val i2: Int = u
u
}
}
| som-snytt/dotty | tests/neg/gadt-no-approx.scala | Scala | apache-2.0 | 217 |
/*
* Copyright 2016 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... | gavares/akka-persistence-jdbc | src/test/scala/akka/persistence/jdbc/SimpleSpec.scala | Scala | apache-2.0 | 1,383 |
package pimpathon.argonautTests
import _root_.argonaut._
import pimpathon.PSpec
import pimpathon.argonaut._
class DecodeJsonSpec extends PSpec with JsonUtil {
"beforeDecode" in decoder.beforeDecode(reverse).decodeJson(json) β‘ decoder.decodeJson(reverse(json))
"compose" in decoder.compose(reverse).decodeJson... | stacycurl/pimpathon | src/test/scala/pimpathon/argonautTests/DecodeJsonTest.scala | Scala | apache-2.0 | 907 |
package ru.dgolubets.reactjs.server.util
import java.io.{File, FileInputStream, InputStream}
import java.security.MessageDigest
import akka.util.ByteString
private[server] object MD5 {
def ofStream(stream: InputStream, bufferSize: Int = 4096): ByteString = {
val md = MessageDigest.getInstance("MD5")
val b... | DGolubets/reactjs-server | src/main/scala/ru/dgolubets/reactjs/server/util/MD5.scala | Scala | mit | 743 |
package spark.util
import java.util.concurrent.ConcurrentHashMap
import scala.collection.JavaConversions
import scala.collection.mutable.Map
/**
* This is a custom implementation of scala.collection.mutable.Map which stores the insertion
* time stamp along with each key-value pair. Key-value pairs that are older th... | koeninger/spark | core/src/main/scala/spark/util/TimeStampedHashMap.scala | Scala | bsd-3-clause | 2,713 |
package org.scalawebtest.integration.doc._104
import org.scalawebtest.integration.json.{FitsTypeMismatchBehavior, ScalaWebTestJsonBaseSpec}
import play.api.libs.json.{JsValue, Json}
class FitsValuesIgnoringArrayOrderSpec extends ScalaWebTestJsonBaseSpec with FitsTypeMismatchBehavior {
config.useBaseUri("http://loca... | unic/ScalaWebTest | scalawebtest-integration/src/it/scala/org/scalawebtest/integration/doc/_104/FitsValuesIgnoringArrayOrderSpec.scala | Scala | apache-2.0 | 1,087 |
// Since `State` is a binary type constructor, we need to partially apply it
// with the `S` type argument. Thus, it is not just one monad, but an entire
// family of monads, one for each type `S`. One solution is to create a class
// `StateMonads` that accepts the `S` type argument and then has a _type member_
// ... | lucaviolanti/scala-redbook | answerkey/monads/02.answer.scala | Scala | mit | 1,208 |
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.