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 bootstrap.liftweb
import scala.xml.{Null, UnprefixedAttribute}
import javax.mail.internet.MimeMessage
import net.liftweb._
import common._
import http._
import util._
import util.Helpers._
import net.liftweb.squerylrecord.RecordTypeMode._
import mapmartadero.config._
import mapmartadero.model.{DbSchema, Syste... | jgenso/mapamartadero | src/main/scala/bootstrap/liftweb/Boot.scala | Scala | apache-2.0 | 4,705 |
package io.sqooba.oss.timeseries.entity
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import scala.util.{Failure, Try}
class TsLabelSpec extends AnyFlatSpec with Matchers {
"TsLabel.unit" should "be derived from label name" in {
implicit val physicsParser: LabelUnitM... | Shastick/tslib | src/test/scala/io/sqooba/oss/timeseries/entity/TsLabelSpec.scala | Scala | mit | 1,677 |
/*
* SpringMusic.scala
* (Configuration)
*
* Copyright (c) 2015 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* [email protected]
*/
package de.sciss.configuration.video
... | Sciss/Configuration | video/src/main/scala/de/sciss/configuration/video/SpringMusic.scala | Scala | gpl-3.0 | 3,423 |
/*
* This file is part of Kiama.
*
* Copyright (C) 2008-2015 Anthony M Sloane, Macquarie University.
*
* Kiama 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 ... | solomono/kiama | library/src/org/kiama/attribution/Attribution.scala | Scala | gpl-3.0 | 1,436 |
/**
*
* @author Richard Li
*/
object puzzle7 extends App {
val seqInSeq = Seq(Seq("a", "b", "c"), Seq("d", "e", "f"), Seq("g", "h"), Seq("i", "j", "k"))
val seqList = for (Seq(x, y, z) <- seqInSeq) yield x + y + z
//val obj = seqInSeq.map{ case Seq(x, y, z) => x + y + z} // error
println(seqList)
// 0 t... | precompiler/scala-101 | puzzles/src/main/scala/puzzle7.scala | Scala | apache-2.0 | 703 |
package guru.nidi.minecraft.core
import java.io._
import scala.collection.mutable
/**
*
*/
object NbtWriter {
def write(root: Tag): Array[Byte] = {
val writer = new NbtWriter
writer.writeTag(root)
writer.baos.toByteArray
}
}
private class NbtWriter {
val baos = new ByteArrayOutputStream()
pri... | nidi3/mineedit | minecraft-core/src/main/scala/guru/nidi/minecraft/core/NbtWriter.scala | Scala | apache-2.0 | 2,327 |
package com.twitter.gizzard.nameserver
import com.twitter.conversions.time._
import com.twitter.gizzard.shards._
import com.twitter.gizzard.test.NameServerDatabase
import com.twitter.gizzard.ConfiguredSpecification
import org.specs.Specification
import org.specs.mock.{ClassMocker, JMocker}
class MemoryShardSpec exte... | kmiku7/gizzard | src/test/scala/com/twitter/gizzard/nameserver/MemoryShardSpec.scala | Scala | apache-2.0 | 8,866 |
package pomf.core.actors
import akka.actor._
class UnhandledMessageListener extends CommonActor {
context.system.eventStream.subscribe(self, classOf[UnhandledMessage])
val unhandledReceived = metrics.meter("events")
override def receive = {
case message: UnhandledMessage ⇒
unhandledReceived.mark()
... | agourlay/post-on-my-fridge | src/main/scala/pomf/core/actors/UnhandledMessageListener.scala | Scala | apache-2.0 | 516 |
package com.xenopsconsulting.gamedayapi
import org.scalatest.junit.AssertionsForJUnit
import org.junit.Test
import org.junit.Assert._
import org.junit.Before
import java.text.SimpleDateFormat
import java.util.Date
class InningTest extends AssertionsForJUnit {
var game: Game = _
var innings: Innings = _
var inni... | ecopony/scala-gameday-api | src/test/scala/com/xenopsconsulting/gamedayapi/InningTest.scala | Scala | mit | 2,260 |
package net.scalaleafs.test
import net.scalaleafs.Template
import net.scalaleafs.Ident
import net.scalaleafs.Var
import net.scalaleafs.implicits._
import net.scalaleafs.Context
import net.scalaleafs.Noop
class BootstrapShowcase extends Template {
val isActive = Var(false)
def render =
"#biggest-buttons" #... | scalastuff/scalaleafs | src/main/scala/net/scalaleafs/test/BootstrapShowcase.scala | Scala | apache-2.0 | 501 |
/*
* Copyright © 2014 TU Berlin ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | aalexandrov/emma | emma-flink/src/main/scala/org/emmalanguage/api/flink/FlinkOps.scala | Scala | apache-2.0 | 4,142 |
/*
* Copyright (c) 2014 Dufresne Management Consulting LLC.
*/
package com.nickelsoftware.bettercare4me.hedis;
import org.joda.time.LocalDate
import org.scalatestplus.play.OneAppPerSuite
import org.scalatestplus.play.PlaySpec
import com.nickelsoftware.bettercare4me.models.MedClaim
import com.nickelsoftware.bettercar... | reactivecore01/bettercare4.me | play/test/com/nickelsoftware/bettercare4me/hedis/HEDISRulesTestSpec.scala | Scala | apache-2.0 | 6,516 |
package json.source
import java.io.File
import java.net.URI
import argonaut.Argonaut._
import argonaut.Json
import scalaz.{-\/, \/, \/-}
import scala.collection.mutable
import scala.util.control.NonFatal
import scalaz.syntax.std.either._
trait JsonSource[A] {
def uri(addr: A): URI
def json(addr: A): String \/ ... | VoxSupplyChain/json-schema-parser | src/main/scala/json/source/JsonSource.scala | Scala | apache-2.0 | 1,932 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | Wogan/monix | monix-reactive/shared/src/main/scala/monix/reactive/internal/operators/FilterOperator.scala | Scala | apache-2.0 | 1,984 |
package de.qlextension
object StartNetLogo {
def main (args: Array[String]) {
// starting the NetLogo GUI
org.nlogo.app.App.main(args)
}
} | JZschache/NetLogo-QLearning-Extension | src/de/qlextension/StartNetLogo.scala | Scala | gpl-2.0 | 163 |
/*
* Copyright 2014 IBM Corp.
*
* 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 ... | yeghishe/spark-kernel | kernel/src/test/scala/test/utils/NoArgSparkKernelTestKit.scala | Scala | apache-2.0 | 900 |
/*
* Artificial Intelligence for Humans
* Volume 2: Nature Inspired Algorithms
* Java Version
* http://www.aifh.org
* http://www.jeffheaton.com
*
* Code repository:
* https://github.com/jeffheaton/aifh
*
* Copyright 2014 by Jeff Heaton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* y... | PeterLauris/aifh | vol2/vol2-scala-examples/src/main/scala/com/heatonresearch/aifh/examples/util/WorldPanel.scala | Scala | apache-2.0 | 3,217 |
package dielectric.spark
import org.apache.spark.rdd.RDD
import scala.reflect.ClassTag
import spire.algebra.Semigroup
trait RDDInstances {
implicit def rddInstance[A : ClassTag]: Semigroup[RDD[A]] =
new Semigroup[RDD[A]] {
def op(x: RDD[A], y: RDD[A]): RDD[A] = x ++ y
}
}
| adelbertc/dielectric | src/main/scala/dielectric/spark/RDD.scala | Scala | apache-2.0 | 293 |
package scife.enumeration
package iterable
package lzy
object Empty extends scife.enumeration.Empty with ResetIter[Nothing] with Touchable[Nothing] {
override def next =
throw new RuntimeException
override def hasNext = false
} | kaptoxic/SciFe | src/main/scala/scife/enumeration/iterable/lzy/Empty.scala | Scala | gpl-2.0 | 249 |
package pl.newicom.dddd.delivery
import akka.actor.ActorPath
import akka.persistence.AtLeastOnceDelivery.AtLeastOnceDeliverySnapshot
import akka.persistence._
import pl.newicom.dddd.aggregate.EntityId
import pl.newicom.dddd.delivery.protocol.alod.Delivered
import pl.newicom.dddd.messaging.{AddressableMessage, Message}... | pawelkaczor/akka-ddd | akka-ddd-core/src/main/scala/pl/newicom/dddd/delivery/AtLeastOnceDeliverySupport.scala | Scala | mit | 3,610 |
package com.lynbrookrobotics.potassium.commons.drivetrain.twoSided
import com.lynbrookrobotics.potassium.Signal
import com.lynbrookrobotics.potassium.commons.drivetrain.unicycle.{UnicycleDrive, UnicycleSignal}
import com.lynbrookrobotics.potassium.streams.Stream
import com.lynbrookrobotics.potassium.units._
import squ... | Team846/potassium | commons/src/main/scala/com/lynbrookrobotics/potassium/commons/drivetrain/twoSided/TwoSidedDrive.scala | Scala | mit | 3,033 |
package uk.gov.digital.ho.proving.financialstatus.domain
import java.time.{LocalDate, Period}
object CourseLengthCalculator {
val MONTHS_IN_YEAR = 12
def differenceInMonths(firstDate: LocalDate, secondDate: LocalDate): Int = {
val (startDate, endDate) = if (secondDate.isAfter(firstDate)) (firstDate, secondD... | UKHomeOffice/pttg-fs-api | src/main/scala/uk/gov/digital/ho/proving/financialstatus/domain/CourseLengthCalculator.scala | Scala | mit | 608 |
/**
* Copyright (C) 2012 Typesafe, Inc. <http://www.typesafe.com>
*/
package org.pantsbuild.zinc
import java.io.File
import java.util.{ List => JList, Map => JMap }
import sbt.Logger
import sbt.Path._
import sbt.inc.{ Analysis, ZincPrivateAnalysis }
import scala.collection.JavaConverters._
import xsbti.compile.Com... | kwlzn/pants | src/scala/org/pantsbuild/zinc/Inputs.scala | Scala | apache-2.0 | 6,033 |
package com.olegych.scastie
package sbt
import akka.actor.Actor
import com.olegych.scastie.api.FormatRequest
import com.olegych.scastie.api.FormatResponse
import com.olegych.scastie.api.ScalaTarget
import org.scalafmt.Formatted
import org.scalafmt.Scalafmt
import org.scalafmt.config.ScalafmtConfig
import org.scalafmt.... | scalacenter/scastie | sbt-runner/src/main/scala/com.olegych.scastie.sbt/FormatActor.scala | Scala | apache-2.0 | 1,752 |
package ingraph.compiler.cypher2gplan
import java.util.concurrent.atomic.AtomicLong
import ingraph.compiler.cypher2gplan.util.TransformUtil
import ingraph.compiler.exceptions._
import ingraph.model.expr.{PropertyAttribute, ResolvableName}
import ingraph.model.expr.types.{TResolvedName, TSortOrder}
import ingraph.mode... | FTSRG/ingraph | compiler/src/main/scala/ingraph/compiler/cypher2gplan/GPlanResolver.scala | Scala | epl-1.0 | 28,263 |
package im.actor.server.api.http.groups
import scala.concurrent.duration._
import scala.concurrent.{ ExecutionContext, Future }
import scala.util.{ Failure, Success }
import akka.actor.ActorSystem
import akka.http.scaladsl.model.HttpResponse
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.serv... | boneyao/actor-platform | actor-server/actor-http-api/src/main/scala/im/actor/server/api/http/groups/GroupsHandler.scala | Scala | mit | 3,448 |
/*
* 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 ... | indhub/mxnet | scala-package/core/src/main/scala/org/apache/mxnet/LRScheduler.scala | Scala | apache-2.0 | 2,456 |
package org.allenai.pnp
import ExecutionScore.ExecutionScore
import org.allenai.pnp.AuxiliaryLoss.AuxiliaryLoss
/** A training example for neural probabilistic programs. An example
* consists of a conditional and an unconditional program, and an
* environment in which these programs execute. An additional
* fil... | jayantk/pnp | src/main/scala/org/allenai/pnp/PnpExample.scala | Scala | apache-2.0 | 800 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ian McIntosh
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use,... | cranst0n/f3 | modules/core/src/main/scala/f3/core/stats/package.scala | Scala | mit | 1,184 |
/*
* Copyright 2011 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 l... | pbrant/framework | persistence/mongodb/src/main/scala/net/liftweb/mongodb/BsonDSL.scala | Scala | apache-2.0 | 1,235 |
package com.twitter.inject.server.tests
import com.twitter.finagle.stats.{
Counter,
Gauge,
InMemoryStatsReceiver,
MetricBuilder,
Stat,
StatsReceiver
}
import java.io.PrintStream
import scala.collection.mutable
/* Fake stats receiver for testing integration */
private[tests] class TestStatsReceiver extends... | twitter/finatra | inject/inject-server/src/test/scala/com/twitter/inject/server/tests/TestStatsReceiver.scala | Scala | apache-2.0 | 2,370 |
/*
* Copyright 2015 - 2016 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - all rights reserved.
*
* 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... | RBMHTechnology/eventuate | src/sphinx/code/ReliableDeliveryDoc.scala | Scala | apache-2.0 | 3,057 |
package intellij.haskell.alex.lang.psi.impl
import com.intellij.extapi.psi.ASTWrapperPsiElement
import com.intellij.lang.ASTNode
import intellij.haskell.alex.lang.psi.AlexElement
/**
* @author ice1000
*/
class AlexElementImpl private[impl](node: ASTNode) extends ASTWrapperPsiElement(node) with AlexElement {
}
| rikvdkleij/intellij-haskell | src/main/scala/intellij/haskell/alex/lang/psi/impl/AlexElementImpl.scala | Scala | apache-2.0 | 317 |
package elea.term
import elea._
import elea.term.CriticalPair.Induction
import scalaz.{ICons, IList, ISet}
// Also, you can make fix indices unique thingies now, since it's just used for the coupling check
case class CriticalPair(
path: IList[Case.Index],
action: CriticalPair.Action) {
def isFol... | wsonnex/elea | src/main/scala/elea/term/CriticalPair.scala | Scala | mit | 4,369 |
package org.renci.blazegraph
import java.io.{BufferedOutputStream, File, FileOutputStream, OutputStream}
import com.bigdata.rdf.sail.BigdataSailRepositoryConnection
import org.backuity.clist._
import org.openrdf.query.QueryLanguage
import org.openrdf.query.resultio.TupleQueryResultWriter
import org.openrdf.query.resu... | balhoff/blazegraph-runner | src/main/scala/org/renci/blazegraph/Select.scala | Scala | bsd-3-clause | 1,397 |
import sbt._
import Keys._
import org.json4s._
import org.json4s.jackson.JsonMethods._
object SbtAngularSeedKeys {
val AngularSeed = config("angularSeed") extend Compile
val targetFile = SettingKey[File]("target-file","where the Angular JS seed is compiled to, please make sure extension is a js file")
val jsonE... | mdedetrich/sbt-angular-seed | src/main/scala/SbtAngularSeedPlugin.scala | Scala | bsd-2-clause | 2,018 |
package mimir.ctables;
import optimus.optimization._
import optimus.algebra._
import optimus.algebra.AlgebraOps._
import optimus.optimization.enums._
import optimus.optimization.model._
import mimir.ctables._
import mimir.models._
import mimir.algebra._
class Oracle(time : Double, trcmap : collection.mutable.LinkedHa... | UBOdin/mimir | src/main/scala/mimir/ctables/CTPrioritizer.scala | Scala | apache-2.0 | 3,592 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | laserson/adam | adam-apis/src/main/scala/org/bdgenomics/adam/api/java/GenomicRDDConverters.scala | Scala | apache-2.0 | 16,773 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | tdanford/avocado | avocado-core/src/main/scala/org/bdgenomics/avocado/postprocessing/PostprocessingStage.scala | Scala | apache-2.0 | 2,553 |
package com.esri
import org.apache.spark.SparkConf
import org.slf4j.LoggerFactory
private[esri] abstract class AbstractNumeReader(name: String, index: Int, throwException: Boolean)
extends FieldReader {
val missingSeq: Seq[(String, Any)]
override def readField(splits: Array[String], lineno: Long): Seq[(String... | mraad/spark-csv-es | src/main/scala/com/esri/NumeReaderFactory.scala | Scala | apache-2.0 | 2,298 |
/*
* Copyright 2014-2022 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 agr... | Netflix/atlas | atlas-core/src/test/scala/com/netflix/atlas/core/model/DesSuite.scala | Scala | apache-2.0 | 5,058 |
/*
* 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.codecs | enumeratum/laws/shared/src/main/scala/kantan/codecs/enumeratum/laws/discipline/package.scala | Scala | apache-2.0 | 721 |
package cn.gridx.scala.lang.types.traits
/**
* Created by tao on 11/20/15.
*/
trait Vehicle {
def getBrand():String
def getType(): String = "Type <vehicle>"
def getProduct():String
}
| TaoXiao/Scala | lang/src/main/scala/cn/gridx/scala/lang/types/traits/Vehicle.scala | Scala | apache-2.0 | 198 |
package com.eevolution.context.dictionary.domain.api.repository
import com.eevolution.context.dictionary._
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Publi... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/repository/WorkflowBlockRepository.scala | Scala | gpl-3.0 | 1,142 |
package org.homermultitext.edmodel
import org.scalatest._
class MidOrthographySpec extends FlatSpec {
"The library" should "include case objects for all edition types" in {
assert(HmtNamedEntityEdition.label == "named entities")
assert(HmtNamedEntityEdition.label == "named entities")
assert (HmtDipl... | homermultitext/edmodel | src/test/scala/org/homermultitext/edmodel/MidOrthographySpec.scala | Scala | gpl-3.0 | 533 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackendSuite.scala | Scala | apache-2.0 | 14,298 |
// scalac: -Xsource:3
class K { def x(y: Int) = 0 }
class Test {
def bad = {
(new K)
x 42
}
}
| scala/scala | test/files/neg/infixed.scala | Scala | apache-2.0 | 108 |
/***********************************************************************
* 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-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/index/ConfigureShardsTest.scala | Scala | apache-2.0 | 3,010 |
/**
* Copyright (C) 2016 Nicola Justus <[email protected]>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package de.thm.move.views.dialogs
import j... | THM-MoTE/MoVE | src/main/scala/de/thm/move/views/dialogs/Dialogs.scala | Scala | mpl-2.0 | 5,935 |
package lila.report
import play.api.data.Form
import play.api.data.Forms.{ single, text }
import lila.common.Ints
import lila.memo.SettingStore.{ Formable, StringReader }
case class ScoreThresholds(mid: Int, high: Int)
private case class Thresholds(score: () => ScoreThresholds, discord: () => Int)
private object R... | luanlv/lila | modules/report/src/main/ReportThresholds.scala | Scala | mit | 1,446 |
/**
* 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"... | aliyun/aliyun-spark-sdk | core/src/main/scala/org/apache/spark/aliyun/helper/EMRExtendRDD.scala | Scala | artistic-2.0 | 2,274 |
package org.scaladebugger.api.pipelines
import org.scaladebugger.test.helpers.ParallelMockFunSpec
class CloseOperationSpec extends ParallelMockFunSpec {
describe("CloseOperation") {
describe("#process") {
it("should invoke the constructor-provided close function") {
val mockCloseFunction = mockFun... | chipsenkbeil/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/pipelines/CloseOperationSpec.scala | Scala | apache-2.0 | 522 |
/*
* Copyright (c) 2015 Mind Eratosthenes Kft.
* License: AGPL v3
*/
package com.mind_era.underscore
import scala.scalajs._
import org.scalatest._
/**
* Tests Underscore
*
* @author Gabor Bakos
*/
class TestUnderscore extends FlatSpec with Matchers {
"Unique" should "return unique values" in {
val list... | aborg0/underscore.scala.js | src/test/scala/underscore/TestUnderscore.scala | Scala | mit | 621 |
/*
* Ported from https://github.com/junit-team/junit
*/
package org.junit.runner
trait Describable {
def getDescription(): Description
}
| nicolasstucki/scala-js-junit | runtime/src/main/scala/org/junit/runner/Describable.scala | Scala | bsd-3-clause | 142 |
package com.tribbloids.spookystuff.utils
import java.io.File
import com.tribbloids.spookystuff.testutils.{FunSpecx, TestHelper}
import org.apache.spark.TaskContext
import org.apache.spark.rdd.RDD
import scala.collection.immutable.Seq
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.TimeoutExceptio... | tribbloid/spookystuff | core/src/test/scala/com/tribbloids/spookystuff/utils/SpookyUtilsSuite.scala | Scala | apache-2.0 | 5,045 |
/*
* 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/queryapi/HasText.scala | Scala | apache-2.0 | 1,153 |
// if が値を返す
object FizzBuzz02 {
def main(args: Array[String]) {
for (i <- 1 to 20) {
val line = if (i % 3 == 0 && i % 5 ==0) {
"FizzBuzz"
} else if (i % 3 == 0) {
"Fizz"
} else if (i % 5 == 0) {
"Buzz"
} else {
i
}
println(line)
}
}
} | mzkrelx/wakuwaku-scala1 | FizzBuzz02.scala | Scala | mit | 328 |
package drt.users
import java.util.UUID
import akka.http.scaladsl.model._
import drt.shared.KeyCloakApi.{KeyCloakGroup, KeyCloakUser}
import drt.users.KeyCloakUserParserProtocol._
import services.crunch.CrunchTestLike
import scala.concurrent.duration._
import scala.concurrent.{Await, Future}
class KeyCloakApiSpec e... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/test/scala/drt/users/KeyCloakApiSpec.scala | Scala | apache-2.0 | 8,638 |
import org.jobimtext.run.SparkRunner
/*
*
* Copyright 2015.
*
* 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 requ... | tudarmstadt-lt/JoBimTextCT | org.jobimtext.ct/src/main/scala/run.scala | Scala | apache-2.0 | 764 |
// Copyright (c) 2011-2015 ScalaMock Contributors (https://github.com/paulbutcher/ScalaMock/graphs/contributors)
//
// 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, inc... | paulbutcher/ScalaMock | shared/src/main/scala/org/scalamock/matchers/Matcher.scala | Scala | mit | 1,598 |
/*
* Copyright (c) 2020. StulSoft
*/
package com.stulsoft.ysps.pcollection.mutable
import scala.collection.mutable.{ArrayBuffer, ListBuffer}
/**
* @author Yuriy Stul
*/
object BufferExc1 extends App {
arrayBufferEx1()
listBufferEx1()
def arrayBufferEx1(): Unit = {
println("==>arrayBufferEx1")
val ... | ysden123/ysps | src/main/scala/com/stulsoft/ysps/pcollection/mutable/BufferExc1.scala | Scala | mit | 578 |
/*******************************************************************************
* Copyright (c) 2019. Carl Minden
*
* 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 ... | carlminden/anathema-roguelike | src/com/anathema_roguelike/entities/characters/player/perks/abilities/spells/inquisitor/IllusoryWall.scala | Scala | gpl-3.0 | 1,426 |
package com.github.jeroenr.bson.reader
import java.nio.ByteBuffer
import com.github.jeroenr.bson.element.BsonArray
object BsonArrayReader extends Reader[BsonArray] {
def read(buffer: ByteBuffer): Option[BsonArray] = {
val name = readCString(buffer)
BsonDocumentReader.read(buffer).map(BsonArray(name, _))
... | jeroenr/tepkin | bson/src/main/scala/com/github/jeroenr/bson/reader/BsonArrayReader.scala | Scala | apache-2.0 | 325 |
package org.http4s.ember.core
import org.specs2.mutable.Specification
import cats.implicits._
import cats.effect.{IO, Sync}
import org.http4s._
class EncoderSpec extends Specification {
private object Helpers {
def stripLines(s: String): String = s.replace("\\r\\n", "\\n")
// Only for Use with Text Request... | ChristopherDavenport/http4s | ember-core/src/test/scala/org/http4s/ember/core/EncoderSpec.scala | Scala | apache-2.0 | 2,282 |
package com.twitter.zk.coordination
import com.twitter.util.Future
import com.twitter.concurrent.Permit
import org.apache.zookeeper.{CreateMode, KeeperException}
import java.util.concurrent.RejectedExecutionException
import ZkAsyncSemaphore.{PermitNodeException, PermitMismatchException, LackOfConsensusException}
impor... | mosesn/util | util-zk/src/main/scala/com/twitter/zk/coordination/ShardCoordinator.scala | Scala | apache-2.0 | 4,457 |
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */
package avro.examples.flight
final case class Pilot(number: Int, first_name: String, last_name: String, nicknames: Seq[Handle]) | julianpeeters/avrohugger | avrohugger-tools/src/test/compiler/output/Pilot.scala | Scala | apache-2.0 | 192 |
/**
* Copyright 2015 ICT.
*
* 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
... | DataSysLab/netflow | core/src/main/scala/cn/ac/ict/acs/netflow/rest/RestServer.scala | Scala | apache-2.0 | 886 |
package edu.berkeley.veloxms.util
object Utils extends Serializable {
def nonNegativeMod(x: Int, mod: Int): Int = {
val rawMod = x % mod
rawMod + (if (rawMod < 0) mod else 0)
}
}
| kcompher/velox-modelserver | veloxms-core/src/main/scala/edu/berkeley/veloxms/util/Utils.scala | Scala | apache-2.0 | 192 |
object ch10 {
import scala.language.higherKinds
trait Monoid[A] {
def op(a1: A, a2: A): A
def zero: A
}
trait Foldable[F[_]] {
import Monoid._
def foldRight[A,B](as: F[A])(z: B)(f: (A,B) => B): B =
foldMap(as)(f.curried)(endoMonoid[B])(z)
def foldLeft[A,B](as: F[A])(z: B)(f: (B,A) => B... | rucka/fpinscala | src/main/scala/fpinscala/ch10/Monoid.scala | Scala | gpl-2.0 | 2,777 |
trait IPerson {
def getName(): String
} | gradle/gradle | subprojects/scala/src/integTest/resources/org/gradle/scala/compile/IncrementalScalaCompileIntegrationTest/restoresClassesOnCompilationFailure/src/main/scala/IPerson.scala | Scala | apache-2.0 | 43 |
// Copyright: 2010 - 2018 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.core
import akka.actor.ActorSystem
import akka.testkit.TestActorRef
import org.ensime.api._
import org.ensime.fixture._
import org.ensime.util.EnsimeSpec
class DocResolve... | yyadavalli/ensime-server | core/src/it/scala/org/ensime/core/DocResolverSpec.scala | Scala | gpl-3.0 | 33,974 |
package uk.gov.dvla.vehicles.presentation.common.controllers.k2kacquire
import org.scalatest.mock.MockitoSugar
import play.api.data.Form
import play.api.mvc.{Request, Result}
import scala.collection.mutable.ArrayBuffer
import uk.gov.dvla.vehicles.presentation.common.clientsidesession.ClientSideSessionFactory
import uk... | dvla/vehicles-presentation-common | test/uk/gov/dvla/vehicles/presentation/common/controllers/k2kacquire/NewKeeperEnterAddressManuallyTesting.scala | Scala | mit | 2,453 |
package controller
import skinny.controller.SkinnyServlet
import skinny.controller.feature.{ CSRFProtectionFeature, FileUploadFeature }
/**
* AjaxによるファイルアップロードControllerの基底クラス.
*/
class UploadController extends SkinnyServlet with FileUploadFeature with DiInjector with CSRFProtectionFeature {
addErrorFilter {
... | nemuzuka/vss-kanban | src/main/scala/controller/UploadController.scala | Scala | mit | 439 |
/*
* 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 ... | apache/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/plan/batch/table/stringexpr/CorrelateStringExpressionTest.scala | Scala | apache-2.0 | 3,065 |
/*
* 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/main/scala/com/intel/analytics/bigdl/nn/Masking.scala | Scala | apache-2.0 | 3,203 |
package mesosphere.marathon.core.launcher.impl
import org.apache.mesos.{ Protos => MesosProtos }
case class ResourceLabels(labels: Map[String, String]) {
lazy val mesosLabels: MesosProtos.Labels = {
val labelsBuilder = MesosProtos.Labels.newBuilder()
labels.foreach {
case (k, v) =>
labelsBuild... | ss75710541/marathon | src/main/scala/mesosphere/marathon/core/launcher/impl/ResourceLabels.scala | Scala | apache-2.0 | 1,101 |
package mm4s.examples.proxy
import akka.actor.{Actor, ActorLogging, ActorRef}
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.model.ws.{Message, TextMessage}
import akka.http.scaladsl.server.Directives._
import akka.stream.OverflowStrategy
import akka.stream.scaladsl.{Flow, Sink, Source}
import m... | jw3/mm4s-examples | proxybot/src/main/scala/mm4s/examples/proxy/ProxyBot.scala | Scala | apache-2.0 | 3,215 |
/*
* ============= Ryft-Customized BSD License ============
* Copyright (c) 2015, Ryft Systems, Inc.
* All rights reserved.
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must... | getryft/spark-ryft-connector | examples/src/main/scala/com/ryft/spark/connector/examples/DateQueryExample.scala | Scala | bsd-3-clause | 2,603 |
package mesosphere.marathon
package raml
import mesosphere.marathon.core.pod
import mesosphere.marathon.stream.Implicits._
import mesosphere.mesos.protos.Implicits._
import org.apache.mesos.Protos.ContainerInfo.DockerInfo.{Network => DockerNetworkMode}
trait NetworkConversion {
import NetworkConversionMessages._
... | gsantovena/marathon | src/main/scala/mesosphere/marathon/raml/NetworkConversion.scala | Scala | apache-2.0 | 6,262 |
package com.bitmotif.part_1
object Exercise_3_5 {
import fpinscala.datastructures._
@annotation.tailrec
def dropWhile[A](list: List[A], f: A => Boolean): List[A] =
list match {
case Nil => list
case Cons(head, tail) =>
if ( !f(head) ) list
else dropWhile(tail, f)
}
}... | pjberry/functional-programming-in-scala | src/com/bitmotif/part_1/Exercise_3_5.scala | Scala | mit | 321 |
package breeze.util
/*
Copyright 2009 David Hall, Daniel Ramage
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 l... | wavelets/breeze | src/main/scala/breeze/util/Index.scala | Scala | apache-2.0 | 12,304 |
package com.supergloo.utils
import com.supergloo.models._
/**
* https://www.supergloo.com
*/
object Utils {
private val httpStatuses = List(
"100", "101", "103",
"200", "201", "202", "203", "204", "205", "206",
"300", "301", "302", "303", "304", "305", "306", "307", "308",
"400", "401", "402", ... | tmcgrath/spark-scala | accessloganalyzer/src/main/scala/com/supergloo/utils/Utils.scala | Scala | cc0-1.0 | 1,026 |
package com.twitter.finagle.memcached.partitioning
import com.twitter.concurrent.Broker
import com.twitter.finagle._
import com.twitter.finagle.addr.WeightedAddress
import com.twitter.finagle.liveness.FailureAccrualFactory
import com.twitter.finagle.loadbalancer.LoadBalancerFactory
import com.twitter.finagle.memcached... | mkhq/finagle | finagle-memcached/src/main/scala/com/twitter/finagle/memcached/partitioning/KetamaNodeManager.scala | Scala | apache-2.0 | 9,699 |
package beamly.core.lang.future
package extensions
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext, Future}
import scala.util.{Failure, Success, Try}
import scala.util.control.NonFatal
final class FutureW[+A](val underlying: Future[A]) extends AnyVal {
/**
* Maps a [[scala.ut... | beamly/beamly.core.lang | src/main/scala/beamly/core/lang/future/extensions/FutureW.scala | Scala | apache-2.0 | 3,998 |
/*
* Artificial Intelligence for Humans
* Volume 2: Nature Inspired Algorithms
* Java Version
* http://www.aifh.org
* http://www.jeffheaton.com
*
* Code repository:
* https://github.com/jeffheaton/aifh
*
* Copyright 2014 by Jeff Heaton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* y... | PeterLauris/aifh | vol2/vol2-scala-examples/src/main/scala/com/heatonresearch/aifh/evolutionary/genome/BasicGenome.scala | Scala | apache-2.0 | 1,818 |
package vultura.factor
import org.specs2._
/**
* Test parsing of *.uai files into [[vultura.factor.Problem]].
*/
class UAIParserTest extends Specification {
def is =
"parse all example uai files" ! (SampleProblems.examples must contain((p: SampleProblems.Example) => {
f"${p.filename} is ok" ==> (p.probl... | ziggystar/vultura-factor | src/test/scala/vultura/factor/UAIParserTest.scala | Scala | mit | 371 |
package com.twitter.finagle.pushsession
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.pushsession.utils.MockChannelHandle
import com.twitter.finagle.{Failure, IndividualRequestTimeoutException => FinagleTimeoutException}
import com.twitter.finagle.stats.{InMemoryStatsReceiver, NullStatsReceiv... | luciferous/finagle | finagle-core/src/test/scala/com/twitter/finagle/pushsession/PipeliningClientPushSessionTest.scala | Scala | apache-2.0 | 4,436 |
package d04
trait Collect[T]
case class CollectS[T](tail: Collect[T], head: T) extends Collect[T]
case class CollectT[T]() extends Collect[T]
trait Number[A] {
def execute[T <: TypeContext](contexts: Context[T, A])(s: T#Parameter, t: T#toDataType): Collect[T#Result]
}
case class NumberS[A](... | djx314/ubw | a58-jysg项目存档/src/main/scala/d04/Counter.scala | Scala | bsd-3-clause | 1,237 |
/*
* Copyright 2012-2020 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 ap... | planet42/Laika | core/shared/src/main/scala/laika/bundle/ParserBundle.scala | Scala | apache-2.0 | 5,563 |
package model
import scala.slick.driver.MySQLDriver.simple._
import scala.slick.ast.ColumnOption.{Default, NotNull}
/**
* CREATE TABLE IF NOT EXISTS `wordnet31_snapshot`.`adjpositiontypes` (
`position` ENUM('a','p','ip') NOT NULL,
`positionname` VARCHAR(24) NOT NULL,
PRIMARY KEY (`position`))
ENGINE = InnoDB
D... | gaoyike/WordNet-Scala-Slick-Model | src/main/scala/model/adjpositiontypes.scala | Scala | bsd-2-clause | 815 |
package pl.writeonly.re.main
import pl.writeonly.re.shared.core._
import slogging._
import slogging.TerminalLoggerFactory.TerminalControlCode
object Main extends App {
LoggerConfig.factory = TerminalLoggerFactory()
TerminalLoggerFactory.infoCode = TerminalControlCode.green
TerminalLoggerFactory.debugCode = Term... | writeonly/resentiment | re/native/src/main/scala/pl/writeonly/re/main/Main.scala | Scala | mit | 497 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2002-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | jmnarloch/scala-js | scalalib/overrides/scala/Array.scala | Scala | bsd-3-clause | 21,526 |
package com.giyeok.gitexplorer.model
import com.giyeok.commons.io.EndianRandomAccessFile
import com.giyeok.gitexplorer.Util._
trait GitPackfiles {
this: GitRepository =>
class GitPackfile(val idxpath: String, val packpath: String) extends GitObjectStore {
def this(path: String) = this(path + ".idx", ... | Joonsoo/gitexplorer | src/main/scala/com/giyeok/gitexplorer/model/GitPackfiles.scala | Scala | mit | 17,973 |
package integrationtest
import controller.Controllers
import skinny.test.{ SkinnyFlatSpec, SkinnyTestSupport }
import unit.DBSettings
class FileUploadControllerSpec extends SkinnyFlatSpec with SkinnyTestSupport with DBSettings {
addServlet(Controllers.fileUpload, "/*")
it should "redirect users as expected" in ... | holycattle/skinny-framework | example/src/test/scala/integrationtest/FileUploadControllerSpec.scala | Scala | mit | 416 |
package im.tox.antox.activities
import java.io.File
import android.content.Intent
import android.graphics.PorterDuff
import android.os.{Build, Bundle}
import android.support.v7.app.AppCompatActivity
import android.text.{Editable, TextWatcher}
import android.view.View
import android.widget.{EditText, TextView}
import... | Astonex/Antox | app/src/main/scala/im/tox/antox/activities/FriendProfileActivity.scala | Scala | gpl-3.0 | 4,043 |
package slate.bindings
import scala.scalajs.js
import scala.scalajs.js.annotation.JSName
import scala.scalajs.js.typedarray.Uint8Array
@js.native
@JSName("LZString")
object LZString extends js.Any {
@js.native
def compressToUint8Array(str: String): Uint8Array = js.native
@js.native
def decompressFromUint8Arr... | edmundnoble/dashboarder | ui/src/main/scala/slate/bindings/LZString.scala | Scala | mit | 630 |
package de.sciss.fscape
import de.sciss.kollflitz.Vec
import scala.concurrent.Promise
class ZipWindowNSpec extends UGenSpec {
"The ZipWindowN UGen" should "work as specified" in {
for {
winLen <- Seq(1, 4, 15, 16, 17)
seqLen <- Seq(0, 4, 15, 16, 17)
numCh <- Seq(1, 2, 3)
} {
val... | Sciss/FScape-next | core/jvm/src/test/scala/de/sciss/fscape/ZipWindowNSpec.scala | Scala | agpl-3.0 | 1,043 |
package org.jetbrains.sbt.shell
import java.io.File
import java.util
import java.util.UUID
import com.intellij.build.events.{SuccessResult, Warning}
import com.intellij.compiler.impl.CompilerUtil
import com.intellij.debugger.DebuggerManagerEx
import com.intellij.debugger.settings.DebuggerSettings
import com.intellij.... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/sbt/shell/SbtProjectTaskRunner.scala | Scala | apache-2.0 | 10,949 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | Panos-Bletsos/spark-cost-model-optimizer | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala | Scala | apache-2.0 | 52,063 |
sealed abstract class Base
case class First(name: String) extends Base
case class Second(name: String) extends Base
case class Third(name: String) extends Base
val value: Base = Second("hello")
value match {
case First(name) => println("It was first! " + name)
case Second(name) => println("It was second! " + na... | BinaryMuse/icebreaker | notes/case_class.scala | Scala | mit | 386 |
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.