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 io.coding.me.m2p2.core.analyzer
import java.io.File
import java.io.FileInputStream
import scala.collection.JavaConversions.asScalaIterator
import scala.collection.mutable.MutableList
import scala.util.Try
import com.typesafe.scalalogging.LazyLogging
import io.coding.me.m2p2.core.internal.extension.StringExt... | tssp/maven-p2-view | core/src/main/scala/io/coding/me/m2p2/core/analyzer/P2Metadata.scala | Scala | mit | 4,287 |
// Starter Code for Exercise 4
// From "Parameterized Types" atom
import com.atomicscala.AtomicTest._
val weather = Vector(100, 80, 20, 100, 20)
historicalData(weather) is "Sunny=2, Mostly Sunny=1, Mostly Cloudy=2"
| P7h/ScalaPlayground | Atomic Scala/atomic-scala-solutions/30_ParameterizedTypes/Starter-4.scala | Scala | apache-2.0 | 216 |
import sbt._
object BuildTarget {
private sealed trait DeploymentRuntime
private case object ConductR extends DeploymentRuntime
private case object Kubernetes extends DeploymentRuntime
private val deploymentRuntime: DeploymentRuntime = sys.props.get("buildTarget") match {
case Some(v) if v.toLowerCase == ... | TimMoore/activator-lagom-java-chirper-jpa | project/BuildTarget.scala | Scala | apache-2.0 | 720 |
package scodec.codecs
import org.scalacheck.{Arbitrary, Gen}
import scodec._
import scodec.bits._
class MultiplexedCodecTest extends CodecSuite {
"listDelimited codec" should {
val codec = listDelimited(BitVector(' '), ascii)
val bits = ascii.encode("i am delimited").require
val list = List("i", "am", ... | alissapajer/scodec | shared/src/test/scala/scodec/codecs/MultiplexedCodecTest.scala | Scala | bsd-3-clause | 1,989 |
import sbt.Keys._
import sbt._
object DebuggerTest {
/** Test-specific project settings. */
val settings = Seq(
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % "1.7.5",
"org.slf4j" % "slf4j-log4j12" % "1.7.5" % "test,it",
"log4j" % "log4j" % "1.2.17" % "test,it",
"org.scalatest... | ensime/scala-debugger | project/DebuggerTest.scala | Scala | apache-2.0 | 449 |
package vegas.data
import java.text.SimpleDateFormat
/**
* Base trait for transforming Any values into primitive types that are accepted by vega-lite. Default implementation
* does a pass through for primitives, converts dates to ISO8601, and uses toString for everything else.
*/
trait ValueTransformer {
def... | aishfenton/Vegas | core/src/main/scala/vegas/data/ValueTransformer.scala | Scala | mit | 974 |
/*
* Copyright 2022 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/iht-frontend | app/iht/models/des/ihtReturn/SpousesEstate.scala | Scala | apache-2.0 | 1,293 |
package scalan.primitives
import scala.annotation.unchecked.uncheckedVariance
import scalan._
import scala.reflect.runtime.universe._
import scalan.common.OverloadHack.{Overloaded2, Overloaded1}
trait StructItems extends ViewsDsl with Entities { self: StructsDsl with Scalan =>
trait StructItem[@uncheckedVariance ... | PCMNN/scalan-ce | core/src/main/scala/scalan/primitives/StructItems.scala | Scala | apache-2.0 | 3,724 |
package jp.co.bizreach.play2handlebars
import org.scalatest.FunSpec
class HelpersSpec extends FunSpec with FakePlayHelper {
case class Who(who:String)
describe("Handlebars Iterable aware helper") {
describe("when the template has each and feed scala.Iterable") {
it("should list values") {
run... | bizreach/play2-handlebars | src/test/scala/jp/co/bizreach/play2handlebars/HelpersSpec.scala | Scala | apache-2.0 | 895 |
package com.cloudwick.generator.logEvents
/**
* Class for wrapping default command line options
* @author ashrith
*/
case class OptionsConfig(
awsAccessKey: String = "",
awsSecretKey: String = "",
awsEndPoint: String = "",
eventsPerSec: Int = 0,
destination: String = "file",
kafkaBrokerList: String = "l... | Arpit1286/generator | src/main/scala/com/cloudwick/generator/logEvents/OptionsConfig.scala | Scala | apache-2.0 | 750 |
package vn.myfeed.parser.processor
import vn.myfeed.parser.model.{LinkElement, ArticleElement, MediaElement, Article}
import vn.myfeed.parser.util.VideoSitePattern
/**
* Thi class will mark an image what has the previous or next potential element is become potential.
*
* @author Nguyen Duc Dung
* @since 12/24/12 ... | SunriseSoftVN/hayhayblog | parser/app/vn/myfeed/parser/processor/MediaBaseFilter.scala | Scala | gpl-2.0 | 2,078 |
package utils
import scala.util.Random
import play.api.Play
import models._
/**
* Add some functionalities to existing classes, such as list. Is mainly
* used for the TweetManager.
*/
object Enrichments {
/** Enrich a list with some functionalities */
implicit class RichList[T](lst: List[T]) {
/** Shuffle... | TweetAggregator/CrossTalk | app/utils/Enrichments.scala | Scala | gpl-2.0 | 4,097 |
import org.scalatest.{BeforeAndAfter, FeatureSpec, OneInstancePerTest, Matchers}
class FakeTestSpec
extends FeatureSpec
with Matchers
{
info("As a User")
info("I want to be able to test 1+1=2")
feature("Validate Math") {
scenario("test 1+1 = 2") {
(1+1) shouldBe 2
}
}
}
| telegraph/sbt-pipeline.playframework.g8 | src/main/g8/component-test/src/test/scala/$package$/FakeTestSpec.scala | Scala | apache-2.0 | 301 |
package spatial.models.characterization
import spatial.metadata._
import spatial.dsl._
import spatial._
import virtualized._
trait RegFiles extends Benchmarks {
self: SpatialCompiler =>
case class RegFile1DOp[T:Num:Type](depth: scala.Int, len: scala.Int, p: scala.Int)(val N: scala.Int) extends Benchmark {
va... | stanford-ppl/spatial-lang | spatial/core/src/spatial/models/characterization/RegFiles.scala | Scala | mit | 2,561 |
// Copyright (C) 2019 MapRoulette contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
package org.maproulette.models
import org.joda.time.DateTime
import play.api.libs.json.{JsValue, Json, Reads, Writes}
import play.api.libs.json.JodaWrites._
import play.api.libs.json.J... | mvexel/maproulette2 | app/org/maproulette/models/ClusteredPoint.scala | Scala | apache-2.0 | 2,946 |
import java.io.File
import scala.io.Source
import org.fedoraproject.javadeptools._
import org.fedoraproject.javadeptools.DatabaseBuilder
import org.scalatest.FlatSpec
import org.scalatest.Matchers
import com.zaxxer.hikari.HikariDataSource
import anorm.SQL
import anorm.SqlStringInterpolation
import anorm.sqlToSimple... | msimacek/java-deptools | core/src/test/scala/Test.scala | Scala | apache-2.0 | 3,198 |
package mesosphere.marathon
import java.io.{ IOException, FileInputStream }
import com.google.protobuf.ByteString
import mesosphere.chaos.http.HttpConf
import org.apache.mesos.Protos.{ Credential, FrameworkInfo, FrameworkID }
import org.apache.mesos.{ MesosSchedulerDriver, SchedulerDriver }
import org.slf4j.LoggerFac... | quamilek/marathon | src/main/scala/mesosphere/marathon/MarathonSchedulerDriver.scala | Scala | apache-2.0 | 2,732 |
/*
* 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/integration/torch/ColorJitterSpec.scala | Scala | apache-2.0 | 5,483 |
import sbt._
import sbt.Keys._
object ProjectBuild extends Build {
lazy val root = Project(
id = "root",
base = file("."),
settings = Project.defaultSettings ++ Seq(
name := "Sandoc",
organization := "org.hocdoc",
version := "0.1",
scalaVersion := "2.10.0"
)
)
}
| Hocdoc/sandoc | project/Build.scala | Scala | apache-2.0 | 311 |
package com.whitepages.framework.client.riak
import java.net.UnknownHostException
import java.util.concurrent.{LinkedBlockingQueue, ThreadPoolExecutor, TimeUnit}
import akka.actor._
import com.basho.riak.client.api.cap.{ConflictResolverFactory, Quorum}
import com.basho.riak.client.api.commands.kv.{DeleteValue, FetchV... | whitepages/scala-riak-client | src/main/scala/com/whitepages/framework/client/riak/Riak2Client.scala | Scala | apache-2.0 | 10,308 |
/*
* Copyright 2018 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/paac-frontend | app/connector/CalculatorConnector.scala | Scala | apache-2.0 | 2,834 |
/**
* Copyright (C) 2015 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/HTMLFragmentSerializer.scala | Scala | lgpl-2.1 | 1,914 |
/*
* Copyright 2007-2010 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 applica... | wsaccaco/lift | examples/example/src/main/scala/net/liftweb/example/snippet/Wiki.scala | Scala | apache-2.0 | 4,447 |
/*
* Copyright 2012-2014 Comcast Cable Communications Management, 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
*
* Unl... | Comcast/sirius | src/main/scala/com/comcast/xfinity/sirius/uberstore/data/UberStoreBinaryFileOps.scala | Scala | apache-2.0 | 2,188 |
package at.forsyte.apalache.tla.tooling.opt
import java.io.File
import org.backuity.clist.{Command, _}
/**
* This command initiates the 'check' command line.
*
* @author Igor Konnov
*/
class CheckCmd extends Command(name = "check",
description = "Check a TLA+ specification") with General {
var file: Fil... | konnov/apalache | mod-tool/src/main/scala/at/forsyte/apalache/tla/tooling/opt/CheckCmd.scala | Scala | apache-2.0 | 2,022 |
package org.elasticmq.actor
import org.elasticmq.actor.reply._
import org.elasticmq._
import org.elasticmq.msg._
import org.elasticmq.actor.test.{DataCreationHelpers, QueueManagerForEachTest, ActorTest}
import org.joda.time.{Duration, DateTime}
class QueueActorMsgOpsTest extends ActorTest with QueueManagerForEachTest... | kubek2k/elasticmq | core/src/test/scala/org/elasticmq/actor/QueueActorMsgOpsTest.scala | Scala | apache-2.0 | 14,976 |
package org.orbeon.oxf.xml.xerces
import org.orbeon.oxf.xml.ParserConfiguration
/*
* An improvement over org.orbeon.apache.xerces.parsers.SAXParser. Every time
* org.orbeon.apache.xerces.parsers.SAXParser is constructed it looks in
* META-INF/services/orbeon.apache.xerces.xni.parser.XMLParserConfiguration to figure ... | orbeon/orbeon-forms | src/main/scala/org/orbeon/oxf/xml/xerces/XercesSAXParser.scala | Scala | lgpl-2.1 | 1,813 |
package com.github.ldaniels528.trifecta.sjs
import io.scalajs.npm.angularjs._
import io.scalajs.util.ScalaJsHelper._
import scala.scalajs.js
/**
* Trifecta AngularJS Filters
* @author lawrence.daniels@gmail.com
*/
object Filters {
private val timeUnits = Seq("min", "hour", "day", "month", "year")
private v... | ldaniels528/trifecta | app-js/src/main/scala/com/github/ldaniels528/trifecta/sjs/Filters.scala | Scala | apache-2.0 | 2,345 |
package acolyte.jdbc.play
private[play] trait AcolyteDatabaseCompat { db: AcolyteDatabase ⇒
}
| cchantep/acolyte | play-jdbc/src/main/play-2.6/AcolyteDatabaseCompat.scala | Scala | lgpl-2.1 | 97 |
package ar.com.pablitar
import ar.com.pablitar.point.Point
case class Bounds[P<:Point[P]](val lowerBound:P, val upperBound: P) {
def bound(p:P) = p.max(lowerBound).min(upperBound)
}
| pablitar/fun-spaces | fun-spaces-alt2/src/ar/com/pablitar/Bounds.scala | Scala | mit | 189 |
package org.freeour.app.config
import java.util.Properties
import scala.io.Source
/**
* Created by Bill Lv on 2/25/15.
*/
class BaseConfig(propFileName: String) {
protected var properties: Properties = null
val url = getClass.getResource(propFileName)
if (url != null) {
val source = Source.fromURL(url)
... | ideaalloc/freeour | src/main/scala/org/freeour/app/config/BaseConfig.scala | Scala | gpl-2.0 | 406 |
import sbt._
import sbt.Configuration
import sbt.Keys._
import de.johoop.jacoco4sbt._
import JacocoPlugin._
import scala.util.Properties
trait BuildSettings {
import Dependencies._
val Organization = "be.wegenenverkeer"
val Version = "0.1.0-SNAPSHOT"
val ScalaVersion = "2.10.3"
val ScalaBuildOptions = Se... | kwark/RxHttpClient | project/BuildSettings.scala | Scala | mit | 2,714 |
package scala.meta
package internal
package prettyprinters
import scala.meta.classifiers._
import scala.meta.prettyprinters._
import Show.{ sequence => s, repeat => r, indent => i, newline => n, meta => m, wrap => w, function => fn }
import scala.meta.internal.trees.{root => _, branch => _, _}
import scala.meta.intern... | olafurpg/scalameta | scalameta/trees/shared/src/main/scala/scala/meta/internal/prettyprinters/TreeSyntax.scala | Scala | bsd-3-clause | 39,419 |
/*
* Copyright (C) 2016 Nikos Katzouris
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is d... | nkatzz/OLED | src/main/scala/oled/mwua/Runner_Streaming.scala | Scala | gpl-3.0 | 3,102 |
package org.jetbrains.plugins.scala.testingSupport.locationProvider
import java.util.Collections
import java.{util => ju}
import com.intellij.execution.testframework.sm.runner.SMTestLocator
import com.intellij.execution.{Location, PsiLocation}
import com.intellij.openapi.editor.Document
import com.intellij.openapi.pr... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/testingSupport/locationProvider/ScalaTestLocationProvider.scala | Scala | apache-2.0 | 8,141 |
package womtool
import wom.graph.GraphNodePort.{InputPort, OutputPort}
import wom.graph._
import wom.graph.expression.ExpressionNode
package object graph {
private[graph] def dotSafe(s: String) = s""""${s.replaceAllLiterally("\\"", "\\\\\\"")}""""
private[graph] implicit class GraphNodeGraphics(val graphNode: G... | ohsu-comp-bio/cromwell | womtool/src/main/scala/womtool/graph/package.scala | Scala | bsd-3-clause | 2,509 |
package org.soic.eac
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.ml.Pipeline
import org.apache.spark.ml.classification.RandomForestClassifier
import org.apache.spark.ml.feature.{VectorAssembler, StringIndexer}
import org.apache.spark.ml.tuning.{TrainValidationSplit, P... | vahidj/eac | src/main/scala/org/soic/eac/CreditReader.scala | Scala | apache-2.0 | 4,744 |
package prototype
import scalafx.application.JFXApp
import scalafx.event.ActionEvent
import scalafx.Includes._
import scalafx.application.JFXApp.PrimaryStage
import scalafx.scene.Scene
import scalafx.scene.control._
import scalafx.scene.layout.GridPane
import scalafx.scene.paint.Color
import scalafx.geometry.Insets
o... | dadarakt/jamon | src/main/scala/prototype/Gui.scala | Scala | apache-2.0 | 1,659 |
// 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
// distributed unde... | cloudant-labs/clouseau | src/test/scala/com/cloudant/clouseau/IndexCleanupServiceSpec.scala | Scala | apache-2.0 | 1,790 |
package com.redhat.samples.camel
import org.apache.camel.builder.RouteBuilder
import org.apache.camel.support.builder.Namespaces
import org.apache.camel.test.junit4.CamelTestSupport
import org.junit.Test
class CBRTest extends CamelTestSupport {
override def createRouteBuilder = new RouteBuilder {
override def ... | tadayosi/samples-camel | basic/src/test/scala/com/redhat/samples/camel/CBRTest.scala | Scala | apache-2.0 | 2,116 |
package com.datastax.spark.connector.cql.sai
import com.datastax.spark.connector.SparkCassandraITWordSpecBase
import com.datastax.spark.connector.ccm.CcmConfig.V6_8_3
import com.datastax.spark.connector.cluster.DefaultCluster
class IndexedSetSpec extends SparkCassandraITWordSpecBase with DefaultCluster with SaiColle... | datastax/spark-cassandra-connector | connector/src/it/scala/com/datastax/spark/connector/cql/sai/IndexedSetSpec.scala | Scala | apache-2.0 | 1,708 |
package quizleague.web.site
import scalajs.js
import js.Dynamic.literal
import js.JSConverters._
import com.felstar.scalajs.vue._
import java.time.format.{DateTimeFormatter, DateTimeFormatterBuilder}
import quill.VueQuillEditor
import quizleague.web.util.rx._
import rxscalajs.Observable
import showdown.VueShowdown
i... | gumdrop/quizleague-maintain | js/src/main/scala/quizleague/web/site/SiteApp.scala | Scala | mit | 1,620 |
/*
* 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 ... | lincoln-lil/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/ExplainTest.scala | Scala | apache-2.0 | 6,638 |
//package request-bodies
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import akka.util.duration._
import bootstrap._
import util.parsing.json.JSONObject
class CreateRelationships extends Simulation {
val httpConf = httpConfig
.baseURL("http://localhost:7474")
.a... | maxdemarzi/gatling_neo | src/test/resources/request-bodies/CreateRelationships.scala | Scala | mit | 1,330 |
case class C(d: Double) { }
case class D[T, U, V](bingo: Int, donkey: String, private val vegas: Set[A])(jehovah: Int) { }
class A {
def f = (new C(5)) match {
case C => true
case _ => false
}
def g[T, U, V](x: D[T, U, V]) = x match {
case D => true
case _ => false
}
}
| yusuke2255/dotty | tests/untried/neg/t4879.scala | Scala | bsd-3-clause | 301 |
/**
* Copyright (C) 2015 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* 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-ingest | command/src/test/scala/nl.knaw.dans.easy.ingest.command/CustomMatchers.scala | Scala | apache-2.0 | 1,577 |
/*
* In6Out3Shape.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.fscape.stream.... | Sciss/FScape-next | core/shared/src/main/scala/de/sciss/fscape/stream/impl/shapes/In6Out3Shape.scala | Scala | agpl-3.0 | 1,725 |
package org.openapitools.server.model
/**
* @param `class` for example: ''null''
* @param displayName for example: ''null''
* @param estimatedDurationInMillis for example: ''null''
* @param fullDisplayName for example: ''null''
* @param fullName for example: ''null''
* @param name for example: ''null''
*... | cliffano/swaggy-jenkins | clients/scala-akka-http-server/generated/src/main/scala/org/openapitools/server/model/BranchImpl.scala | Scala | mit | 1,112 |
/*******************************************************************************
Copyright (c) 2013, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
*********************************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/analysis/typing/models/Tizen/TIZENCalendarAttendee.scala | Scala | bsd-3-clause | 8,801 |
package taczombie.client.view.gui
import java.awt.Color
import scala.swing.Label
import javax.swing.border.CompoundBorder
import javax.swing.border.EmptyBorder
import javax.swing.border.EtchedBorder
import javax.swing.border.TitledBorder
import taczombie.client.model.ViewModel
import taczombie.client.util.Observer
cl... | mahieke/TacZombie | gui/src/main/scala/taczombie/client/view/gui/GameMessage.scala | Scala | gpl-2.0 | 638 |
package reactivemongo.api.gridfs
private[gridfs] trait GridFSCompat {
/* Concats two array - fast way */
protected def concat[T](a1: Array[T], a2: Array[T])(implicit m: scala.reflect.ClassTag[T]): Array[T] = {
var i, j = 0
val result = new Array[T](a1.length + a2.length)
while (i < a1.length) {
r... | ReactiveMongo/ReactiveMongo | driver/src/main/scala-3/api/gridfs/GridFSCompat.scala | Scala | apache-2.0 | 454 |
package com.btcontract.wallet.utils
import android.content.{Context, Intent}
import com.btcontract.wallet.{ClassNames, R}
import android.app.{NotificationManager, PendingIntent, Service}
import androidx.core.app.NotificationCompat
object AwaitService {
val awaitServiceClass: Class[AwaitService] = classOf[AwaitServ... | btcontract/wallet | app/src/main/java/com/btcontract/wallet/utils/AwaitService.scala | Scala | apache-2.0 | 2,077 |
package api
import akka.actor.ActorDSL._
import com.softwaremill.macwire.tagging.Tagger
import core.UserActor._
import core.UserTag
import core.model.{UserDeleted, PageParams, User, UserCreated}
import spray.http.StatusCodes
class UserEndpointTest extends BaseApiTest {
"UserEndpoint" should {
"return OK when ... | DamianJureczko/user-service | src/test/scala/api/UserEndpointTest.scala | Scala | apache-2.0 | 2,527 |
package com.mentatlabs.nsa
package scalac
package options
/* -Yinfer-debug
* =============
* 2.9.1 - 2.11.8: Trace type inference and implicit search.
* 2.12.0: !! missing !!
*/
case object ScalacYInferDebug
extends ScalacOptionBoolean("-Yinfer-debug", ScalacVersions.`2.9.1`) {
override val dep... | mentat-labs/sbt-nsa | nsa-core/src/main/scala/com/mentatlabs/nsa/scalac/options/private/deprecated/ScalacYInferDebug.scala | Scala | bsd-3-clause | 417 |
package io.vamp.model.reader
import scala.reflect._
import scala.util.{ Failure, Try }
sealed trait UnitValue[T] {
def value: T
def normalized: String
override def toString = normalized
}
object UnitValue {
def of[V <: Any: ClassTag](value: Any): Try[V] = value match {
case _ if classTag[V].runtimeCla... | magneticio/vamp | model/src/main/scala/io/vamp/model/reader/UnitValue.scala | Scala | apache-2.0 | 4,855 |
package com.typesafe.sbt
package packager
package rpm
import sbt._
import linux._
import java.nio.charset.Charset
import SbtNativePackager.Linux
import sbt.Keys.{ name, version, sourceDirectory, target, packageBin, streams }
import linux.LinuxPlugin.autoImport.{ linuxPackageMappings, linuxPackageSymlinks, serverLoadi... | giabao/sbt-native-packager | src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala | Scala | bsd-2-clause | 4,741 |
// Copyright 2014,2015,2016,2017,2018,2019,2020 Commonwealth Bank of Australia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... | CommBank/grimlock | grimlock-core/src/main/scala/commbank/grimlock/spark/CutRules.scala | Scala | apache-2.0 | 2,758 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.jdk
import org.... | lrytz/scala | test/junit/scala/jdk/StepperConversionTest.scala | Scala | apache-2.0 | 29,242 |
/*
* Contributions:
* Jean-Francois GUENA: implement "suffixed collection name" feature (issue #39 partially fulfilled)
* ...
*/
package akka.contrib.persistence.mongodb
import java.util.concurrent.ConcurrentHashMap
import akka.actor._
import akka.stream.Materializer
import com.codahale.metrics.MetricRegistry
... | JeanFrancoisGuena/akka-persistence-mongo | common/src/main/scala/akka/contrib/persistence/mongodb/MongoPersistenceExtension.scala | Scala | apache-2.0 | 5,789 |
/** This file contains all HBase related types, instances, and functions (on
* interim basis until it is extracted into its own plugin).
*/
package dsmigrator
trait HBaseTypes extends Classes with Types with Instances {
// TODO: Create product type value constructor for Table type
trait Table
// TODO: Create... | mbbx6spp/dsmigrator | src/main/scala/dsmigrator/hbase.scala | Scala | bsd-3-clause | 596 |
package forms
import models.Product
import play.api.data.Form
import play.api.data.Forms._
import play.api.data.format.Formats._
/**
* The form which handles the sign up process.
*/
object ProductForm {
/**
* A play framework form.
*/
val form = Form(
mapping(
"id" -> optional(longNumber),
... | Wirwing/hello-conekta-play-framework | app/forms/ProductForm.scala | Scala | mit | 457 |
/*
* 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/main/scala/akka/persistence/jdbc/journal/dao/JournalDao.scala | Scala | apache-2.0 | 1,706 |
import com.github.play2war.plugin.{Play2WarKeys, Play2WarPlugin}
import sbt._
object ApplicationBuild extends Build {
val appName = "PlayingWithPlayJava"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
)
val main = play.Project(appName, a... | bpupadhyaya/PlayingWithPlay | PlayingWithPlayJava/project/Build.scala | Scala | mit | 509 |
/*
Copyright The MITRE Corporation 2010. All rights reserved.
*/
package org.mitre.jcarafe.dparser
import org.mitre.jcarafe.crf.{AbstractInstance,Feature,DenseTrainable,CoreModel,AccessSeq,DecodingAlgorithm,InstanceSequence}
import org.mitre.jcarafe.util.FastLoops._
import org.mitre.jcarafe.jama._
abst... | wellner/jcarafe | jcarafe-ext/src/main/scala/org/mitre/jcarafe/dparser/MstInference.scala | Scala | bsd-3-clause | 15,471 |
// Copyright (c) 2015 Contributors to Ars Terra
//
// This file is part of Ars Terrae.
//
// Ars Terrae is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option)... | HarvestMoon/HarvestMoon | src/main/scala/mc/arsterra/ArsTerra.scala | Scala | mit | 1,907 |
/*
* 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... | travisbrown/scalatest | src/test/scala/org/scalactic/FreshConversionCheckedSetEqualityConstraintsSpec.scala | Scala | apache-2.0 | 3,185 |
/*
* 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 ... | pkuwm/incubator-eagle | eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/core/StreamGroupbyExpansion.scala | Scala | apache-2.0 | 2,987 |
package vggames.regex.task
import org.junit.runner.RunWith
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner
import vggames.regex.Escaper;
import vggames.regex.Escaper
@RunWith(classOf[JUnitRunner])
class EscaperSpec extends Specification {
"the escaper" should {
"transform space to ... | vidageek/games | games/regex/src/test/scala/vggames/regex/task/EscaperSpec.scala | Scala | gpl-3.0 | 1,227 |
/**
* 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-UI-Vaadin/src/main/scala/com/magmanics/licensing/ui/content/user/UserSelectionTable.scala | Scala | gpl-3.0 | 1,835 |
package com.sksamuel.elastic4s.requests.indexes
import com.sksamuel.elastic4s.fields.ElasticField
import com.sksamuel.elastic4s.requests.analyzers.{AnalyzerDefinition, TokenFilter, Tokenizer}
import com.sksamuel.elastic4s.requests.mappings.{FieldDefinition, MappingDefinition}
trait CreateIndexApi {
def createIndex... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/indexes/CreateIndexApi.scala | Scala | apache-2.0 | 2,185 |
object P1246 extends App {
def area(a: (Float, Float), b: (Float, Float)) =
a._1 * b._2 - a._2 * b._1
def vec(ax: Float, ay: Float, bx: Float, by: Float) =
(bx - ax, by - ay)
val n = readLine.toInt
val vs = (0 until n).map(i =>
readLine.split(" ").map(_.toFloat)
).view
val xs = vs.map(_(0))
... | waterlink/sc-playground | 1246.scala | Scala | mit | 664 |
package org.jetbrains.plugins.scala
package codeInsight
package intention
package matcher
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.e... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/codeInsight/intention/matcher/ConvertToTypedPatternIntention.scala | Scala | apache-2.0 | 2,523 |
package com.github.mdr.mash.compiler
import com.github.mdr.mash.parser.AbstractSyntax._
import com.github.mdr.mash.parser.{ Abstractifier, MashParser, Provenance }
import org.scalatest.{ FlatSpec, Matchers }
class DesugarPipesTest extends FlatSpec with Matchers {
"a | b" desugarsTo "b a"
"a | b c" desugarsTo "b ... | mdr/mash | src/test/scala/com/github/mdr/mash/compiler/DesugarPipesTest.scala | Scala | mit | 1,275 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package genc
package ir
/*
* Print an IR tree
*/
final class IRPrinter[S <: IR](val ir: S) {
import ir._
case class Context(indent: Int) {
val pad = " " * indent
val newLine = s"\n$pad"
def +(i: Int) = copy(indent = indent + i)
}
// Entry... | regb/leon | src/main/scala/leon/genc/ir/IRPrinter.scala | Scala | gpl-3.0 | 5,013 |
package cz.cvut.fit.palicand.vocloud.ssl.ml.classification
import cz.cvut.fit.palicand.vocloud.ssl.utils.{MatrixUtils, DataframeUtils}
import org.apache.spark.ml.PredictionModel
import org.apache.spark.ml.classification.{RandomForestClassifier, ProbabilisticClassificationModel}
import org.apache.spark.ml.feature.OneHo... | palicand/graph_ssl | src/main/scala/cz/cvut/fit/palicand/vocloud/ssl/ml/classification/LabelSpreadingClassifier.scala | Scala | mit | 3,016 |
package sgl.util
import scala.concurrent.ExecutionContext.Implicits.global
class FutureLoaderSuite extends LoaderAbstractSuite {
override def makeLoader[A](body: => A): Loader[A] = FutureLoader(body)
}
| regb/scala-game-library | jvm-shared/src/test/scala/sgl/util/FutureLoaderSuite.scala | Scala | mit | 208 |
/*
* 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 | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesExecutorBackend.scala | Scala | apache-2.0 | 8,041 |
package progscala2.introscala.shapes
/**
* Created by younggi on 7/7/16.
*/
object Messages {
object Exit
object Finished
case class Response(message: String)
}
import akka.actor.Actor
class ShapesDrawingActor extends Actor {
import Messages._
override def receive: Receive = {
case s: Shape =>
... | younggi/books | programming_scala/progscala2/src/main/scala/progscala2/introscala/shapes/ShapesDrawingActor.scala | Scala | mit | 735 |
package uk.gov.dvla.vehicles.acquire.gatling
object Headers {
val headers_accept_html = Map(
"Accept" -> """text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"""
)
val headers_accept_png = Map(
"Accept" -> """image/png,image/*;q=0.8,*/*;q=0.5"""
)
val headers_x_www_form_urlencoded = M... | dvla/vehicles-acquire-online | gatling-tests/src/test/scala/uk/gov/dvla/vehicles/acquire/gatling/Headers.scala | Scala | mit | 479 |
package fr.ramiro.sfuzzy
object FunctionsUtils {
lazy val min: OperationFuzzy = (_: FuzzyEvaluationType).min(_)
lazy val max: OperationFuzzy = (_: FuzzyEvaluationType).max(_)
def cog(min: FuzzyEvaluationType, max: FuzzyEvaluationType, step: FuzzyEvaluationType)(func: (FuzzyEvaluationType) => FuzzyEvaluationType)... | rrramiro/sFuzzyLogic | src/main/scala/fr/ramiro/sfuzzy/FunctionsUtils.scala | Scala | apache-2.0 | 467 |
/**
* Copyright 2009 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 agree... | OpeningDesign/SketchSpace | infrastructure/net.appjet.oui/dynamicvar.scala | Scala | apache-2.0 | 1,497 |
package courier
object Compat {
def asJava[T](set: Set[T]): java.util.Set[T] = {
import scala.jdk.CollectionConverters._
set.asJava
}
}
| softprops/courier | src/main/scala-3/compat.scala | Scala | mit | 149 |
/**
* Copyright 2014 Dropbox, 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... | mknejp/djinni | src/source/ObjcppGenerator.scala | Scala | apache-2.0 | 15,681 |
/*
* 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/ct600/v2/calculations/LoansToParticipatorsCalculatorSpec.scala | Scala | apache-2.0 | 28,062 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-features/geomesa-feature-kryo/src/main/scala/org/locationtech/geomesa/features/kryo/serialization/SimpleFeatureSerializer.scala | Scala | apache-2.0 | 1,675 |
class DevelopApp {
}
| Rovak/ScalaWebscraper | scraper-demo/src/main/scala/DevelopApp.scala | Scala | mit | 22 |
/*
* Copyright 2014 Lars Edenbrandt
*
* 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... | slicebox/slicebox | src/main/scala/se/nimsa/sbx/dicom/DicomProperty.scala | Scala | apache-2.0 | 2,605 |
/**
* Copyright (c) 2012-2013, Tomasz Kaczmarzyk.
*
* This file is part of BeanDiff.
*
* BeanDiff 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 3 of the License, or
* (at your o... | tkaczmarzyk/beandiff | src/main/scala/org/beandiff/core/FieldRoutePlanner.scala | Scala | lgpl-3.0 | 2,446 |
package au.id.cxd.math.count
/**
* ##import MathJax
* Permutation operation (select without replacement) $P_r^n$
*
* $$
* \\frac{n!}{(n-k)!}
* $$
*
* Created by cd on 6/09/2014.
*/
class Permutation {
def op(n: Double)(r: Double) = {
if (r <= n) {
Factorial(n) / Factorial(n - r)
} els... | cxd/scala-au.id.cxd.math | math/src/main/scala/au/id/cxd/math/count/Permutation.scala | Scala | mit | 418 |
object Script {
val rl = loopInduction(
parseFormula(
"(A() > 0 & b()>0 & B() > 0 & B() > b() & ~(f() = l()) & eps() > 0) &" +
"(((b()*B()*x(l()) > b()*B()*x(f()) + " +
"(1/2) * (B()*v(f())^2 - b()*v(l())^2) & " +
"x(l()) > x(f()) &" +
"v(f()) >= 0 &" +
"v(l()) >= 0 ) ) )"))
val cut... | keymaerad/KeYmaeraD | examples/llcsimple.dl.scala | Scala | bsd-3-clause | 3,883 |
package com.rcirka.play.dynamodb
import java.util.UUID
import scala.concurrent.{Await, Future}
import scala.concurrent.duration._
package object util {
def awaitResult[T](future: Future[T]) : T = Await.result(future, 10 seconds)
def newKey() = UUID.randomUUID().toString.replace("-", "")
}
| rcirka/Play-DynamoDB | src/test/scala/com/rcirka/play/dynamodb/util/package.scala | Scala | mit | 299 |
package com.peterpotts.snake.mapreduce
import com.peterpotts.snake.coercion.Compare
import com.peterpotts.snake.predicate.Extractor
case class ExtractorOrdering[T](extractor: Extractor[T]) extends Ordering[T] {
def compare(left: T, right: T): Int = Compare(extractor(left), extractor(right))
override def toString... | peterpotts/snake | src/main/scala/com/peterpotts/snake/mapreduce/ExtractorOrdering.scala | Scala | mit | 345 |
/*
* Copyright 2011-2019 Asakusa Framework Team.
*
* 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 ... | ueshin/asakusafw-spark | runtime/src/main/scala/com/asakusafw/spark/runtime/graph/TransactionManager.scala | Scala | apache-2.0 | 4,460 |
/*
* 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 not u... | witgo/zen | ml/src/main/scala/com/github/cloudml/zen/ml/neuralNetwork/MLPModel.scala | Scala | apache-2.0 | 6,392 |
package kartograffel.server
import java.time._
import eu.timepit.refined.api.Refined
import eu.timepit.refined.collection.NonEmpty
import eu.timepit.refined.scalacheck.any.arbitraryFromValidate
import eu.timepit.refined.types.string.NonEmptyString
import kartograffel.server.domain.model._
import kartograffel.shared.do... | fthomas/kartograffel | modules/server/jvm/src/test/scala/kartograffel/server/ArbitraryInstances.scala | Scala | apache-2.0 | 2,388 |
package dotty.tools
package dotc
package typer
import ast.{tpd, untpd}
import ast.Trees._
import core._
import util.SimpleMap
import Symbols._, Names._, Denotations._, Types._, Contexts._, StdNames._, Flags._
import Decorators.StringInterpolators
object ImportInfo {
/** The import info for a root import from given ... | AlexSikia/dotty | src/dotty/tools/dotc/typer/ImportInfo.scala | Scala | bsd-3-clause | 4,067 |
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved
package io.fsq.twofishes.server
import io.fsq.twitter.ostrich.stats.Stats
import io.fsq.twofishes.util.{NameNormalizer, TwofishesLogger}
case class ParseParams(
tokens: List[String] = Nil,
originalTokens: List[String] = Nil,
connectorStart: Int = 0,
... | foursquare/fsqio | src/jvm/io/fsq/twofishes/server/QueryParser.scala | Scala | apache-2.0 | 2,046 |
package co.ledger.wallet.web.ripple
import biz.enef.angulate.ext.{Route, RouteProvider}
/**
*
* Routes
* ledger-wallet-ripple-chrome
*
* Created by Pierre Pollastri on 03/05/2016.
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ledger
*
* Permission is hereby granted, free of charge, to any per... | LedgerHQ/ledger-wallet-ripple | src/main/scala/co/ledger/wallet/web/ripple/Routes.scala | Scala | mit | 2,595 |
package hr.fer.ztel.thesis.spark
import java.time.Instant
import hr.fer.ztel.thesis.measure.ItemPairSimilarityMeasure
import hr.fer.ztel.thesis.measure.ItemPairSimilarityMeasure._
import org.apache.spark.sql.SparkSession
class SparkSessionHandler(args: Array[String]) extends Serializable {
if (args.length != 8) {... | fpopic/master_thesis | src/main/scala/hr/fer/ztel/thesis/spark/SparkSessionHandler.scala | Scala | mit | 1,614 |
package controllers
import models.Address
import org.jsoup.Jsoup
import org.mockito.Matchers
import org.mockito.Mockito.{reset, times, verify, when}
import org.scalatest.BeforeAndAfterEach
import org.scalatest.mock.MockitoSugar
import org.scalatestplus.play.{OneServerPerSuite, PlaySpec}
import play.api.i18n.Messages
i... | avinash-anand/PlayScala1 | test/controllers/AddressControllerSpec.scala | Scala | gpl-3.0 | 4,831 |
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.