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 |
|---|---|---|---|---|---|
/*
* 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 ... | TiVo/samza | samza-core/src/main/scala/org/apache/samza/config/SystemConfig.scala | Scala | apache-2.0 | 2,493 |
package hello
/** Hello, world! */
object Hello {
def main(args: Array[String]): Unit = {
val dotty: Int | String = "dotty"
println(s"Hello $dotty!")
}
}
| dotty-staging/dotty | sbt-test/sbt-dotty/scaladoc/src/main/scala/hello/Hello.scala | Scala | apache-2.0 | 166 |
/* Try POH
* author: Leonardone @ NEETSDKASU
*/
object Main extends App {
def gs() = scala.io.StdIn.readLine
def gi() = gs.toInt
def gss() = gs.split(' ')
def gis() = gss.map( _.toInt )
def ngt[T](n :Int, f: ()=>T) = (1 to n).map( (_) => f() )
def ngs(n :Int) = ngt(n, gs)
def ngi(n :I... | neetsdkasu/Paiza-POH-MyAnswers | POH7/Megane/Main.scala | Scala | mit | 717 |
package com.twitter.web.dashboard
import com.google.inject.Module
import com.twitter.finatra.http.HttpServer
import com.twitter.finatra.http.filters.CommonFilters
import com.twitter.finatra.http.routing.HttpRouter
import com.twitter.finatra.http.modules.MustacheModule
import com.twitter.web.dashboard.controllers.Dashb... | twitter/finatra | examples/advanced/web-dashboard/src/main/scala/com/twitter/web/dashboard/Server.scala | Scala | apache-2.0 | 635 |
/**
* Copyright 2011-2017 GatlingCorp (http://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... | MykolaB/gatling | gatling-commons/src/main/scala/io/gatling/commons/util/NonStandardCharsets.scala | Scala | apache-2.0 | 757 |
package com.eevolution.context.dictionary.infrastructure.repository
import com.eevolution.context.dictionary.domain.model.SchedulerParameter
import com.eevolution.context.dictionary.infrastructure.db.DbContext._
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This progra... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/repository/SchedulerParameterMapping.scala | Scala | gpl-3.0 | 1,748 |
package poly.collection
trait RangeGroupQueryable[T] extends RangeMonoidQueryable[T] {
def group: Group[T]
def monoid = group
}
| ctongfei/poly-collection | rangequery/src/main/scala/poly/collection/RangeGroupQueryable.scala | Scala | mit | 136 |
package io.policarp.scala.credstash
import io.policarp.scala.credstash.reader.{ CredValueReader, Readers }
object BaseClient {
type EncryptionContext = Map[String, String]
val EmptyEncryptionContext: EncryptionContext = Map()
val MostRecentVersion = ""
val DefaultCredentialTableName = "credential-store"
... | kdrakon/scala-credstash | src/main/scala/io/policarp/scala/credstash/BaseClient.scala | Scala | apache-2.0 | 1,037 |
package visceljs
import scala.scalajs.js.URIUtils.encodeURIComponent
import scala.scalajs.js.URIUtils.decodeURIComponent
import viscel.shared.Vid
import visceljs.AppState.ViewState
sealed abstract class AppState(val urlhash: String) {
def transformPos(f: Int => Int) =
this match {
case ViewState(id, pos) ... | rmgk/viscel | code/js/src/main/scala/visceljs/AppState.scala | Scala | agpl-3.0 | 1,252 |
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt.internal.inc
import java.io.File
import java.net.URLClassLoader
import sbt.io.IO
import sbt.io.syntax._
import sbt.librarymanagement._
import sbt.librarymanagem... | xuwei-k/xsbt | zinc-lm-integration/src/test/scala/sbt/internal/inc/IvyBridgeProviderSpecification.scala | Scala | apache-2.0 | 3,785 |
/*
* 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 ... | yanboliang/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/ForeachWriterTable.scala | Scala | apache-2.0 | 5,362 |
package com.jasonnerothin.project
/** Created by IntelliJ IDEA.
* User: jason
* Date: 2/18/14
* Time: 11:12 AM
*
* Copyright [2014] [Jason Nerothin]
*
* 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 ... | jasonnerothin/projectit | src/main/scala/com/jasonnerothin/project/Projection.scala | Scala | apache-2.0 | 3,137 |
/*
* Copyright (C) 2012 Romain Reuillon
*
* 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 di... | ISCPIF/PSEExperiments | openmole-src/openmole/plugins/org.openmole.plugin.task.statistic/src/main/scala/org/openmole/plugin/task/statistic/StatisticTask.scala | Scala | agpl-3.0 | 1,399 |
package org.renci.blazegraph
import java.io.OutputStream
import org.openrdf.rio.RDFWriter
import org.openrdf.rio.nquads.NQuadsWriter
import org.openrdf.rio.ntriples.NTriplesWriter
import org.openrdf.rio.rdfxml.RDFXMLWriter
import org.openrdf.rio.turtle.TurtleWriter
trait RDFOutputting extends Common {
def createOu... | balhoff/blazegraph-runner | src/main/scala/org/renci/blazegraph/RDFOutputting.scala | Scala | bsd-3-clause | 768 |
/*
This file is part of Intake24.
Copyright 2015, 2016 Newcastle University.
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 appl... | digitalinteraction/intake24 | ApiPlayServer/app/controllers/system/NotificationAdminController.scala | Scala | apache-2.0 | 3,545 |
import scala.concurrent.Future
import init.Init
import org.apache.commons.logging.LogFactory
import play.api._
import play.api.mvc._
import play.api.mvc.Results._
object Global extends GlobalSettings {
override def onHandlerNotFound(request: RequestHeader) = {
Future.successful(NotFound)
}
override def on... | gilt/cave | worker/app/Global.scala | Scala | mit | 731 |
package com.arcusys.valamis.web.servlet
import com.arcusys.valamis.exception.EntityNotFoundException
import com.arcusys.valamis.lrssupport.lrs.service.util.{TinCanVerb, TinCanVerbs}
import com.arcusys.valamis.slide.service.SlideService
import com.arcusys.valamis.uri.model.TincanURIType
import com.arcusys.valamis.uri.s... | arcusys/Valamis | valamis-portlets/src/main/scala/com/arcusys/valamis/web/servlet/UriServlet.scala | Scala | gpl-3.0 | 1,647 |
package org.littlewings.javaee7.batch
import javax.batch.api.{BatchProperty, AbstractBatchlet}
import javax.batch.runtime.context.JobContext
import javax.enterprise.context.Dependent
import javax.inject.{Inject, Named}
import org.jboss.logging.Logger
import org.littlewings.javaee7.service.LanguageService
@Named
@Dep... | kazuhira-r/javaee7-scala-examples | jbatch-getting-started/src/main/scala/org/littlewings/javaee7/batch/MyBatchlet.scala | Scala | mit | 1,237 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package expr
import com.intellij.lang.ASTNode
import com.intellij.psi.PsiElementVisitor
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElementVisitor
import org.jetbrains.plugins.scala.lang.psi.api.expr._
/**
* @author Alexander.Podkhalyu... | LPTK/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScConstrBlockImpl.scala | Scala | apache-2.0 | 754 |
package specs.fast
import specs.Spec
import org.json4s.ast.fast._
class JBoolean extends Spec { def is = s2"""
The JBoolean value should
read a Boolean $readBooleanJBoolean
pattern match with JTrue $readBooleanJBooleanPatternMatchJTrue
pattern match with JTrue and fail with scala.MatchError $readBooleanJBo... | json4s/json4s-ast | jvm/src/test/scala/specs/fast/JBoolean.scala | Scala | apache-2.0 | 3,163 |
package com.fuckingaroundwithspray
import akka.actor.{ActorContext, Actor}
import spray.routing._
import spray.http.MediaTypes._
/**
* Actor to hold and run our service. All we have to say now is "Release the
* Actors!" and watch an application magically appear.
*/
class FuckingServiceActor extends Actor with Fuck... | jbirch/fuckin-about-with-scala | src/main/scala/com/fuckingaroundwithspray/FuckingService.scala | Scala | bsd-3-clause | 737 |
/*
* Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
*
* 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... | telefonicaid/fiware-cosmos-platform | infinity/server/src/main/scala/es/tid/cosmos/infinity/server/hadoop/NameNode.scala | Scala | apache-2.0 | 5,983 |
package scodec.protocols.mpeg
package transport
import scalaz.{ \\/, -\\/, \\/- }
import \\/.{ left, right }
import scalaz.stream.{ Process1, Process }
import scodec.{ Attempt, Codec, DecodeResult, DecodingContext, Err, SizeBound }
import scodec.bits._
import scodec.stream.decode.{ StreamDecoder, many => decodeMany }... | jrudnick/scodec-protocols | src/main/scala/scodec/protocols/mpeg/transport/Demultiplexer.scala | Scala | bsd-3-clause | 8,597 |
package fix
package v0_8_0
import com.spotify.scio.bigquery._
import com.spotify.scio.jdbc._
import com.spotify.scio.jdbc.syntax.JdbcScioContextOps
import com.spotify.scio.transforms.BaseAsyncLookupDoFn
object Ops {
import java.util.Date
import com.spotify.scio.jdbc.{CloudSqlOptions, JdbcConnectionOptions, JdbcRe... | spotify/scio | scalafix/output-0_8/src/main/scala/fix/FixSyntaxImports.scala | Scala | apache-2.0 | 532 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/ ... | S-Mach/s_mach.concurrent | src/main/scala/s_mach/concurrent/impl/CollectionAsyncTaskRunner.scala | Scala | mit | 5,628 |
package breeze.optimize
import breeze.linalg.norm
import breeze.math.{MutableEnumeratedCoordinateField, MutableFiniteCoordinateField, NormedModule}
import breeze.optimize.FirstOrderMinimizer.ConvergenceCheck
import breeze.stats.distributions.{RandBasis, ThreadLocalRandomGenerator}
import breeze.util.Implicits._
import... | scalanlp/breeze | math/src/main/scala/breeze/optimize/FirstOrderMinimizer.scala | Scala | apache-2.0 | 16,156 |
package eu.inn.binders.naming
class UppercaseConverter extends Converter {
def convert(identifier: String): String = identifier.toUpperCase
}
| InnovaCo/binders | src/main/scala/eu/inn/binders/naming/UppercaseConverter.scala | Scala | bsd-3-clause | 145 |
import stainless.lang._
import stainless.annotation._
import stainless.collection._
object StateMachine {
sealed trait StateMachine {
type State
type Letter
def initial: State
def next(s: State, l: Letter): Option[State]
def isFinal(s: State): Boolean
@extern @pure
final def isEmpty: Bo... | epfl-lara/stainless | frontends/benchmarks/verification/valid/StateMachine.scala | Scala | apache-2.0 | 1,637 |
/**
* 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... | ajw625/orbeon-forms | src/main/scala/org/orbeon/oxf/fr/FormRunnerWizard.scala | Scala | lgpl-2.1 | 877 |
package com.kuwalla.app.service.dao
import com.kuwalla.app.dto.User
/**
* Created by roei.azar on 23/06/2017
*/
trait UserDao {
def get(name: String): User
def update(userDto: User): Boolean
}
| roei/kuwalla-app | kuwalla-app-core/src/main/java/com/kuwalla/app/service/dao/UserDao.scala | Scala | mit | 205 |
package org.scalacheck.ops
package time
import org.scalacheck.Gen
import org.scalatest.freespec.AnyFreeSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks._
import java.time.{Instant, LocalDateTime}
import java.time.temporal.{ChronoField, ChronoUnit}
class TruncatedJavaTimeSpec extends AnyFreeSpec {
... | gloriousfutureio/scalacheck-ops | core/src/test/scala/org/scalacheck/ops/time/TruncatedJavaTimeSpec.scala | Scala | apache-2.0 | 1,740 |
/*
* Copyright 2017 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | spinnaker/kayenta | kayenta-judge/src/main/scala/com/netflix/kayenta/judge/detectors/BaseOutlierDetector.scala | Scala | apache-2.0 | 895 |
package club.diybio.bank.templates
import scalacss.Defaults._
import scalacss.ScalatagsCss._
import scalatags.Text._
import scalatags.Text.all._
object Index {
lazy val items = for(e <- 0 until 5) yield a(`class` :="item",i(`class`:="lab icon"),s"Item #$e") //some test data
lazy val HEAD = head(
title := "P... | antonkulaga/plasmid-bank | backend/src/main/scala/club/diybio/bank/templates/Index.scala | Scala | mpl-2.0 | 1,461 |
import org.apache.log4j.{Level, Logger}
import org.apache.spark.graphx._
import org.apache.spark.graphx.util.GraphGenerators
import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}
import scala.collection.immutable.Map
object ClusterWildV03Dimitris {
def main(args: Array[String]) = {
... | anadim/clusterWild | src/main/scalaPre20150324/ClusterWildV03Dimitris.scala | Scala | apache-2.0 | 6,578 |
/**
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016 ScalateKids
* <p/>
* 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 ... | ScalateKids/Actorbase-Client | src/main/scala/com/actorbase/driver/data/ActorbaseCollection.scala | Scala | mit | 29,038 |
package com.aristocrat.mandrill.requests.Templates
import com.aristocrat.mandrill.requests.MandrillRequest
case class List(key: String, label: String) extends MandrillRequest
| aristocratic/mandrill | src/main/scala/com/aristocrat/mandrill/requests/Templates/List.scala | Scala | mit | 177 |
package scribe.json
import fabric.parse.Json
import scribe.LogRecord
import scribe.output.{LogOutput, TextOutput}
import scribe.output.format.OutputFormat
import scribe.writer.Writer
import perfolation._
import fabric.rw._
import fabric._
import scribe.message.Message
case class JsonWriter(writer: Writer, compact: Bo... | outr/scribe | json/shared/src/main/scala/scribe/json/JsonWriter.scala | Scala | mit | 2,957 |
object Wrap1 {
class E
object E {
final val A = E()
val $values = Array(A)
}
}
object Wrap2 {
class E
object E {
final val A = E()
val ref = A
}
}
| dotty-staging/dotty | tests/init/pos/i9664.scala | Scala | apache-2.0 | 175 |
package dbpedia.dataparsers.util.wikiparser
/**
* Represents plain text.
*
* @param text The text
* @param line The source line number where this text begins
*/
case class TextNode(text : String, override val line : Int) extends Node(List.empty, line)
{
def toWikiText = text
def toPlainText = text
... | FnOio/dbpedia-parsing-functions-scala | src/main/scala/dbpedia/dataparsers/util/wikiparser/TextNode.scala | Scala | gpl-2.0 | 458 |
package common.las
import math._
abstract class Method(L: Array[Array[Double]], r: Array[Double]) {
val fmt = "%10.6f"
def matrixRepr(a: Array[Array[Double]]): String = {
val s = StringBuilder.newBuilder
for (row <- a) s ++= row map (el => fmt.format(el)) mkString("(", " ", ")\\n")
s.result
}
... | dnoskov/cm | src/main/scala/common/las/Method.scala | Scala | mit | 778 |
package warsztat
import java.io.OutputStream
import scala.util.Try
object RichByteArray {
implicit class RichByteArray(ba: Array[Byte]) {
def render(prefix: String): String = {
prefix + new String(ba)
}
def writeTo(in: OutputStream): Try[Unit] = ???
}
}
| bjankie1/warsztat-scala | src/main/scala/warsztat/RichByteArray.scala | Scala | apache-2.0 | 283 |
/*
* 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 ... | wangyixiaohuihui/spark2-annotation | mllib/src/main/scala/org/apache/spark/ml/feature/Bucketizer.scala | Scala | apache-2.0 | 8,024 |
trait Equalizer[T]
trait Gen[A]
class Broken {
implicit def const[T](x: T): Gen[T] = ???
implicit def convertToEqualizer[T](left: T): Equalizer[T] = ???
def in(a: Any) = ()
in {
import scala.None // any import will do..
"" == "" // this no longer triggers the bug, as Object#== now overrides Any#==
}... | lampepfl/dotty | tests/pos/t8219.scala | Scala | apache-2.0 | 410 |
/*
* 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... | asual/summer | samples/scala/src/main/scala/com/asual/summer/sample/web/TechnologyController.scala | Scala | apache-2.0 | 3,735 |
/*
* Cakemix
*
* Copyright Xebia BV and Wehkamp BV
*
* 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 cakemix
import akka.actor.{ Actor, Scheduler }
/... | xebia/cakemix | src/main/scala/cakemix/SchedulerProvider.scala | Scala | mit | 675 |
package io.iohk.ethereum.db.components
import io.iohk.ethereum.db.storage._
import io.iohk.ethereum.db.storage.pruning.PruningMode
import io.iohk.ethereum.domain.BlockchainStorages
trait StoragesComponent {
val storages: Storages
trait Storages extends BlockchainStorages {
val blockHeadersStorage: BlockHea... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/db/components/StoragesComponent.scala | Scala | mit | 892 |
package clean.run.uti
import al.strategies.{RandomSampling, HTUFixo, DensityWeightedTrainingUtilityFixo}
import clean.lib.{CM, Ds}
import ml.classifiers._
import scala.util.Random
object plotaTUvsMarvsATU extends App with CM {
val context: String = ""
val ds = Ds("banana", readOnly = true)
ds.open()
val m = ... | active-learning/active-learning-scala | src/main/scala/clean/run/uti/plotaTUvsMarvsATU.scala | Scala | gpl-2.0 | 992 |
/*
* 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/item/HeldItem/Shield.scala | Scala | apache-2.0 | 1,103 |
// These are meant to be typed into the REPL. You can also run
// scala -Xnojline < repl-session.scala to run them all at once.
8 * 5 + 2
0.5 * res0
"Hello, " + res0
res2.toUpperCase
| nmt1994/Scala-Practica | src/week1/codes/ch01/sec01/repl-session.scala | Scala | mit | 188 |
package edu.berkeley.cs.amplab.mlmatrix
import org.scalatest.FunSuite
import breeze.linalg._
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.{SQLContext, DataFrame, Row}
import org.apache.spark.sql.types._
class RowPartitionedMatrixSuite extends FunSuite with LocalSp... | amplab/ml-matrix | src/test/scala/edu/berkeley/cs/amplab/mlmatrix/RowPartitionedMatrixSuite.scala | Scala | apache-2.0 | 4,810 |
/*
* 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... | qiuxin2012/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/keras/KerasRunner.scala | Scala | apache-2.0 | 6,207 |
/***********************************************************************
* 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... | ddseapy/geomesa | geomesa-features/geomesa-feature-avro/src/main/scala/org/locationtech/geomesa/features/avro/AvroDataFileReader.scala | Scala | apache-2.0 | 1,575 |
/*
* Copyright 2015 org.NLP4L
*
* 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... | fubuki/nlp4l | app/org/nlp4l/framework/builtin/InternalProcessors.scala | Scala | apache-2.0 | 4,689 |
/*
* Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
*
* 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... | telefonicaid/fiware-cosmos-platform | cosmos-api/app/es/tid/cosmos/api/controllers/infinity/InfinityAuthenticationResource.scala | Scala | apache-2.0 | 4,350 |
package de.sciss.fscape
import de.sciss.kollflitz
import de.sciss.kollflitz.Vec
import de.sciss.fscape.Ops._
import scala.concurrent.Promise
class DifferentiateSpec extends UGenSpec {
"The Differentiate UGen" should "work as intended" in {
for {
len <- Seq(0, 1, 10, 63, 64, 65)
} {
val p = ... | Sciss/FScape-next | core/jvm/src/test/scala/de/sciss/fscape/DifferentiateSpec.scala | Scala | agpl-3.0 | 817 |
import org.scalatest.FunSuite
import utils._
import scala.math._
class SetSuite extends FunSuite {
test("count1") {
val input = Array("+1 あ い い")
val clfr = new Classifier(input)
val expected = Map[(String, Cls), Int](("あ", Pos) -> 1, ("い", Pos) -> 2)
val actual = clfr.count
assert(expected ===... | sakabar/naiveBayesClassifierCL | src/test/scala/test.scala | Scala | gpl-3.0 | 2,869 |
/**
* 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... | MyPureCloud/kafka | core/src/main/scala/kafka/log/LogSegment.scala | Scala | apache-2.0 | 25,638 |
package mesosphere.marathon.integration
import mesosphere.marathon.integration.setup.{ MarathonClusterIntegrationTest, IntegrationFunSuite, WaitTestSupport }
import play.api.libs.json.Json
import scala.concurrent.duration._
import org.scalatest.{ GivenWhenThen, Matchers }
class LeaderIntegrationTest extends Integrati... | sepiroth887/marathon | src/test/scala/mesosphere/marathon/integration/LeaderIntegrationTest.scala | Scala | apache-2.0 | 1,538 |
package blended.updater.config
case class FeatureRef(
name: String,
version: String,
url: Option[String] = None) {
override def toString(): String = s"${getClass().getSimpleName()}(name=${name},version=${version},url=${url})"
}
| lefou/blended | blended.updater.config/shared/src/main/scala/blended/updater/config/FeatureRef.scala | Scala | apache-2.0 | 239 |
package scala.collection
/** Contains types that increase access to some `private[scala]` members of
* `scala.collection` in order to make them reusable in any package.
*/
object Abstract {
type Traversable[A] = scala.collection.AbstractTraversable[A]
type Iterable[A] = scala.collection.AbstractItera... | Calavoow/scala-graph | core/src/main/scala/scala/collection/Abstract.scala | Scala | bsd-3-clause | 605 |
package scales.dom
import scala.scalajs.js
trait Observer extends js.Object {
def observe[A](obj: A, callback: js.Function1[js.Array[ChangeEvent], Unit]): A = js.native
def observe[A](obj: A, callback: js.Function1[js.Array[ChangeEvent], Unit], acceptList: js.Array[String]): A = js.native
def unobserve[A](ob... | greencatsoft/scales | core/src/main/scala/scales/dom/Observer.scala | Scala | apache-2.0 | 668 |
package org.scalarules.dsl.core
import org.scalarules.finance.nl._
import org.scalarules.dsl.nl.grammar._
import TableSelectorGlossary._
import org.scalarules.dsl.nl.grammar.DslCondition._
import org.scalarules.dsl.nl.grammar.DslTableSelector.prikken
import org.scalarules.engine._
class TableSelectorBerekening extend... | scala-rules/rule-engine | engine/src/test/scala/org/scalarules/dsl/core/TableSelectorBerekening.scala | Scala | mit | 524 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | mllib/src/test/scala/org/apache/spark/ml/feature/OneHotEncoderSuite.scala | Scala | apache-2.0 | 7,714 |
package sangria.cats
import sangria.util.CatsSupport
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class ValidationSpec extends AnyWordSpec with Matchers with CatsSupport {
generateTests("validation")
}
| OlegIlyenko/sangria | modules/core/src/test/scala/sangria/cats/ValidationSpec.scala | Scala | apache-2.0 | 251 |
/**
* Copyright (C) 2013 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... | joansmith/orbeon-forms | src/main/scala/org/orbeon/oxf/fb/AlertsAndConstraintsOps.scala | Scala | lgpl-2.1 | 23,756 |
package org.emailscript.dkim
import java.security.spec.X509EncodedKeySpec
import java.security.{KeyFactory, PublicKey}
import java.util.Base64
import org.emailscript.helpers.{DnsHelper, LoggerFactory}
import scala.collection.concurrent.RDCSS_Descriptor
object DkimDnsLookup {
val logger = LoggerFactory.getLogger(g... | OdysseusLevy/emailscript | src/main/scala/org/emailscript/dkim/DkimDnsLookup.scala | Scala | lgpl-3.0 | 1,692 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js IR **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2014, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | matthughes/scala-js | ir/src/main/scala/org/scalajs/core/ir/Serializers.scala | Scala | bsd-3-clause | 30,408 |
package org.vitrivr.adampro.storage.engine
import java.io.Serializable
import org.apache.spark.annotation.Experimental
import org.apache.spark.sql.{DataFrame, SaveMode}
import org.vitrivr.adampro.data.datatypes.AttributeTypes
import org.vitrivr.adampro.data.entity.AttributeDefinition
import org.vitrivr.adampro.proces... | dbisUnibas/ADAMpro | src/main/scala/org/vitrivr/adampro/storage/engine/CompoundEngine.scala | Scala | mit | 4,434 |
// Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
package org.pantsbuild.zinc.logging
import java.io.{ File, PrintWriter, StringWriter }
import com.google.common.base.Charsets
import com.google.common.io.Files
import sbt.{ ConsoleOut... | laurentgo/pants | tests/scala/org/pantsbuild/zinc/logging/LoggersSpec.scala | Scala | apache-2.0 | 1,189 |
class Ennemi(var nomo: String) extends Personnage(nomo, 2, 10) {
def battre(perso: PersonnagePrincipal) {
perso coup puissance
}
} | r0mdau/mario-chance-game | src/Ennemi.scala | Scala | apache-2.0 | 142 |
/**
* Copyright 2016 Matthew Farmer
*
* 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 ... | farmdawgnation/scyig-judicial | src/main/scala/frmr/scyig/matching/ParticipantSuggester.scala | Scala | apache-2.0 | 8,003 |
/*
* 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 ... | lxsmnv/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala | Scala | apache-2.0 | 7,716 |
/*
* 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 ... | ueshin/apache-flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/ExternalCatalogTest.scala | Scala | apache-2.0 | 6,914 |
package models.oauth2
import java.util.Date
import play.api.db.slick.Config.driver.simple._
import scala.slick.lifted.Tag
import play.api.db.slick.DB
import play.api.Play.current
/**
* Created by Alper on 29.01.2015.
*/
case class AuthCode(authorizationCode: String, userId: Long, redirectUri: Option[String], created... | ZKTecoEu/ZKRestApi | ZKRestServer/app/models/oauth2/AuthCode.scala | Scala | mit | 1,353 |
package skinny.micro.request
import java.io.BufferedReader
import java.security.Principal
import java.util.Locale
import javax.servlet._
import javax.servlet.http._
import skinny.micro.{ UnstableAccessException, UnstableAccessValidation }
import scala.collection.JavaConverters._
import scala.collection.concurrent.Tri... | xerial/skinny-micro | micro/src/main/scala/skinny/micro/request/StableHttpServletRequest.scala | Scala | bsd-2-clause | 12,444 |
/*
* @author Philip Stutz
*
* Copyright 2014 University of Zurich
*
* 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
*
* U... | hicolour/triplerush | src/test/scala/com/signalcollect/triplerush/EfficientIndexPatternSpec.scala | Scala | apache-2.0 | 1,848 |
package org.oc.ld32.entity
import org.lengine.render.{Sprite, Texture}
class EntityBaguettePiece(val value: Float) extends BaguetteEntity {
private val sprite: Sprite = new Sprite(new Texture("assets/textures/entities/baguette.png"))
sprite.width *= 2f
sprite.height *= 2f
sprite.getCenter *= 2f
override d... | OurCraft/LD32 | src/main/scala/org/oc/ld32/entity/EntityBaguettePiece.scala | Scala | apache-2.0 | 849 |
/*
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | danielcsant/sparta | driver/src/main/scala/com/stratio/sparta/driver/cube/CubeMaker.scala | Scala | apache-2.0 | 1,920 |
/*
* Copyright 2020 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/vat-registration-frontend | it/controllers/registration/attachments/PostalCoverSheetControllerISpec.scala | Scala | apache-2.0 | 2,631 |
package views.vrm_retention
import models.CacheKeyPrefix
object Retain {
final val RetainCacheKey = s"${CacheKeyPrefix}retain"
}
| dvla/vrm-retention-online | app/views/vrm_retention/Retain.scala | Scala | mit | 134 |
package models
import java.util.UUID
import com.mohiva.play.silhouette.api.{Identity, LoginInfo}
/**
* The user object.
*
* @param userID The unique ID of the user.
* @param loginInfo The linked login info.
* @param firstName Maybe the first name of the authenticated user.
* @param lastName Maybe the last name... | OpenCompare/OpenCompare | org.opencompare/play-app/app/models/User.scala | Scala | apache-2.0 | 785 |
package chana.script
import akka.actor.Actor
import akka.actor.ActorLogging
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.ExtendedActorSystem
import akka.actor.Extension
import akka.actor.ExtensionId
import akka.actor.ExtensionIdProvider
import akka.actor.Props
import akka.contrib.datarepl... | matthewtt/chana | src/main/scala/chana/script/DistributedScriptBoard.scala | Scala | apache-2.0 | 7,679 |
package org.scaladebugger.api.lowlevel.watchpoints
import java.util.concurrent.atomic.AtomicBoolean
import com.sun.jdi.event.AccessWatchpointEvent
import org.scaladebugger.api.lowlevel.events.EventType._
import org.scaladebugger.api.utils.JDITools
import org.scaladebugger.api.virtualmachines.DummyScalaVirtualMachine
... | ensime/scala-debugger | scala-debugger-api/src/it/scala/org/scaladebugger/api/lowlevel/watchpoints/StandardAccessWatchpointManagerIntegrationSpec.scala | Scala | apache-2.0 | 1,821 |
package edu.gemini.pit.catalog.votable
object CooSys {
def apply(e: Elem): CooSys = {
val id = e.attr("ID")
val equinox = e.attr("equinox")
val epoch = e.attr("epoch")
val system = e.attr("system")
CooSys(id, equinox, epoch, system)
}
}
case class CooSys(id:String, equinox:String, epoch:St... | arturog8m/ocs | bundle/edu.gemini.pit/src/main/scala/edu/gemini/pit/catalog/votable/CooSys.scala | Scala | bsd-3-clause | 342 |
/*
* 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 ... | bravo-zhang/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/ScriptTransformationSuite.scala | Scala | apache-2.0 | 5,601 |
/*
* Copyright 2011-2014 Chris de Vreeze
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | EBPI/yaidom | src/main/scala/nl/ebpi/yaidom/core/Declarations.scala | Scala | apache-2.0 | 7,508 |
package com.twitter.finagle.mysql
import com.twitter.finagle.FailureFlags
import com.twitter.finagle.mysql.transport.Packet
import com.twitter.finagle.transport.Transport
import com.twitter.util.Future
import java.lang.IllegalStateException
import java.nio.charset.StandardCharsets
private object AuthNegotiation {
... | twitter/finagle | finagle-mysql/src/main/scala/com/twitter/finagle/mysql/AuthNegotiation.scala | Scala | apache-2.0 | 11,037 |
/*
* 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 ... | wangmiao1981/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/CommandSuiteBase.scala | Scala | apache-2.0 | 2,577 |
package mesosphere.marathon
import java.util.concurrent.atomic.AtomicBoolean
import java.util.{ Timer, TimerTask }
import akka.actor.{ ActorRef, ActorSystem }
import akka.event.EventStream
import akka.testkit.{ TestKit, TestProbe }
import com.codahale.metrics.MetricRegistry
import com.twitter.common.base.ExceptionalC... | MrMarvin/marathon | src/test/scala/mesosphere/marathon/MarathonSchedulerServiceTest.scala | Scala | apache-2.0 | 11,326 |
/*
* Copyright 2016 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | andywhardy/address-reputation-ingester | test/unit/fetch/SardineWrapperSketch.scala | Scala | apache-2.0 | 1,260 |
#!/bin/bash
exec ${SCALA_HOME}/bin/scala "$0" "$@" 2>&1
!#
import sfc.board._
/*
* @author [email protected]
*/
object `setter-for-catan` {
def main(args: Array[String]) {
args.length match {
case 1 => {
// TODO: use graphics to display board
println(args(0) match {
case "small... | noel-yap/setter-for-catan | setter-for-catan.scala | Scala | apache-2.0 | 1,083 |
package com.github.novamage.svalidator.validation
/** Contains an error message and any values to be formatted with it
*
* @param messageKey Raw error message or a key string to be used in localization files
* @param messageFormatValues Arguments to interpolate into the string.
*/
case class MessageParts(messa... | NovaMage/SValidator | src/main/scala/com/github/novamage/svalidator/validation/MessageParts.scala | Scala | mit | 1,028 |
package leibniz.inhabitance
//import cats.~>
import leibniz.variance.{Constant, Injective}
import leibniz.{=!=, WeakApart}
sealed abstract class PartiallyInhabited[F[_]] {
import PartiallyInhabited._
/**
* A positive type argument. `F[Positive]` is inhabited.
*/
type Positive
/**
* A negative ty... | alexknvl/leibniz | src/main/scala/leibniz/inhabitance/PartiallyInhabited.scala | Scala | mit | 2,414 |
/*
* Copyright 2012 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 applicable law or agr... | pniederw/expecty | src/main/scala/org/expecty/Recorder.scala | Scala | apache-2.0 | 932 |
object MergeIntervals extends App {
def time[R](block: => R): R = {
val t0 = System.currentTimeMillis()
val result = block // call-by-name
val t1 = System.currentTimeMillis()
println("Elapsed time: " + (t1 - t0) + "ms")
result
}
implicit val orderRanges = Ordering.by {range: Range => range.h... | marcosfede/algorithms | array/merge_intervals/merge_intervals.scala | Scala | gpl-3.0 | 1,050 |
package pl.arapso.scaffoldings.scala.custom.ip
import java.io.{BufferedWriter, File, FileWriter}
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
import scala.util.Random
object App {
val MinSize: Int = 1 * 1024
val MaxSize: Int = 10 * 1024
def main(args: Array[Strin... | arapso-scaffoldings/scala | scala-tutor/custom/src/main/scala/pl/arapso/scaffoldings/scala/custom/ip/IpGenerator.scala | Scala | apache-2.0 | 1,827 |
/*
* 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/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/InterpretedUnsafeProjection.scala | Scala | apache-2.0 | 11,219 |
trait A
trait B
val AB: A with B { type a } = new A with B
// False | katejim/intellij-scala | testdata/typeConformance/compound/AWithBWithMissingType.scala | Scala | apache-2.0 | 68 |
/*
* 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 ... | gustavoanatoly/hbase | hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/datasources/SchemaConverters.scala | Scala | apache-2.0 | 17,741 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogx/compiler/codegenerator/opencl/hyperkernels/FFT3DHyperKernel.scala | Scala | apache-2.0 | 8,078 |
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.