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 |
|---|---|---|---|---|---|
/****************************************************************************
* Copyright Fabien Sartor
* Contributors: Fabien Sartor ([email protected])
* http://fasar.fr
*
* This software is a computer program whose purpose to compute differences
* between two files.
*
****************... | fasar/diffTools | model/diffTools/src/test/scala/fsart/diffTools/csvDsl/CsvRulesDslTest.scala | Scala | apache-2.0 | 7,675 |
package scavlink.task
import scala.reflect.runtime.universe._
package object schema {
type SchemaDef = Either[Pointer, Schema]
def definitionNameOf(typ: Type): String = typ.typeSymbol.name.decodedName.toString
def propertyNameOf(typ: Type): String = lowercaseName(definitionNameOf(typ))
def propertyNameOf[T: ... | nickolasrossi/scavlink | src/main/scala/scavlink/task/schema/package.scala | Scala | mit | 454 |
// AORTA is copyright (C) 2012 Dustin Carlino, Mike Depinet, and Piyush
// Khandelwal of UT Austin
// License: GNU GPL v2
package utexas.aorta.map.make
import scala.collection.mutable
import utexas.aorta.map.{Coordinate, Road}
import utexas.aorta.common.Util
class PreGraph2(old_graph: PreGraph1) {
// (v1, v2, ro... | dabreegster/aorta | utexas/aorta/map/make/Pass2_Part1.scala | Scala | gpl-2.0 | 2,917 |
package com.getjenny.starchat.resources
/**
* Created by Angelo Leto <[email protected]> on 27/06/16.
*/
import akka.http.scaladsl.server.Route
import com.getjenny.starchat.routing._
import com.getjenny.starchat.services.{ConversationLogsService, QuestionAnswerService}
trait ConversationLogsResource extends Star... | GetJenny/starchat | src/main/scala/com/getjenny/starchat/resources/ConversationLogsResource.scala | Scala | gpl-2.0 | 1,508 |
/*
* The MIT License
*
* Copyright (c) 2017 Fulcrum Genomics LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to us... | fulcrumgenomics/dagr | tasks/src/main/scala/dagr/tasks/picard/IlluminaBasecallsToSam.scala | Scala | mit | 5,087 |
/*
* A real-time collaborative tool to develop files over the network.
* Copyright (C) 2010 Mauro Ciancio and Leandro Gilioli
* {maurociancio,legilioli} at gmail dot com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Publi... | maurociancio/parallel-editor | src/parallel-editor-client/src/main/scala/ar/noxit/paralleleditor/client/converter/ResponseConverter.scala | Scala | gpl-3.0 | 1,106 |
/*
* Copyright 2012-2014 Kieron Wilkinson.
*
* 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 o... | vyadh/viper | source-log/src/test/scala/viper/source/log/jul/xml/JULXMLConsumerTest.scala | Scala | apache-2.0 | 2,153 |
package com.example
import akka.NotUsed
import com.lightbend.lagom.scaladsl.api._
import com.lightbend.lagom.scaladsl.server._
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import play.api.libs.ws.ahc.AhcWSComponents
import sc... | rstento/lagom | dev/sbt-plugin/src/sbt-test/sbt-plugin/external-project-scaladsl/a/src/main/scala/com/example/A.scala | Scala | apache-2.0 | 1,231 |
package monocle.std
import monocle.MonocleSuite
import monocle.law.discipline.function.{Cons1Tests, EachTests, IndexTests}
import scalaz.OneAnd
class OneAndSpec extends MonocleSuite {
checkAll("each OneAnd", EachTests[OneAnd[List, Int], Int])
checkAll("index OneAnd", IndexTests[OneAnd[List, Int], Int, Int])
ch... | rperry/Monocle | test/shared/src/test/scala/monocle/std/OneAndSpec.scala | Scala | mit | 392 |
/**
* Created by Romain Reuillon on 22/09/16.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This ... | openmole/openmole | openmole/core/org.openmole.core.market/src/main/scala/org/openmole/core/market/package.scala | Scala | agpl-3.0 | 2,218 |
package org.ensime.test
import org.scalatest.Spec
import org.scalatest.matchers.ShouldMatchers
import util.Helpers._
class PackageInspectionSpec extends Spec with ShouldMatchers{
describe("Package Info") {
it("should get a package description that includes the member 'Vector'") {
withPresCompiler{ cc =>... | bbatsov/ensime | src/test/scala/org/ensime/test/PackageInspectionSpec.scala | Scala | gpl-3.0 | 713 |
/*
* Copyright (c) 2016. Fengguo (Hugo) Wei and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Detailed co... | arguslab/argus-cit-intellij | src/main/scala/org/argus/cit/intellij/jawa/lang/psi/stubs/impl/JawaMethodStubImpl.scala | Scala | epl-1.0 | 2,223 |
/*
* Stratio Meta
*
* Copyright (c) 2014, Stratio, All rights reserved.
*
* This library 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.0 of the License, or (at your option) ... | dhiguero/stratio-meta | meta-driver/src/main/scala/com/stratio/meta/driver/BasicDriver.scala | Scala | gpl-3.0 | 9,481 |
/*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictio... | adamcin/vltpack-maven-plugin | src/main/scala/net/adamcin/vltpack/mojo/PutBundleFileMojo.scala | Scala | unlicense | 2,075 |
package spark.metrics.source
import com.codahale.metrics.MetricRegistry
trait Source {
def sourceName: String
def metricRegistry: MetricRegistry
}
| vax11780/spark | core/src/main/scala/spark/metrics/source/Source.scala | Scala | apache-2.0 | 153 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/index/TemporalIndexCheckTest.scala | Scala | apache-2.0 | 4,580 |
/*
* 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
* distrib... | fusepoolP3/p3-silk | silk-core/src/test/scala/de/fuberlin/wiwiss/silk/plugins/transformer/ReplaceTransformerTest.scala | Scala | apache-2.0 | 1,378 |
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt
import java.io.File
import sbt.Def.{ ScopedKey, Setting }
import sbt.Keys._
import sbt.SlashSyntax0._
import sbt.internal.Act
import sbt.internal.CommandStrings... | xuwei-k/xsbt | main/src/main/scala/sbt/Cross.scala | Scala | apache-2.0 | 15,125 |
package model
import org.scalatest.{FlatSpec, Matchers}
/**
* Created by salim on 16/09/2016.
*/
class PlayerSpec extends FlatSpec with Matchers {
"Player" should "be able to add pokemon" in {
val game = Game.boot()
val player: Player = game.spawnPlayer.named("Pootle")
val pikachu = Pokemon.spawn(g... | salimfadhley/scalamoo | src/test/scala/model/PlayerSpec.scala | Scala | mit | 1,655 |
package tastytest
object DelayedChained {
sealed trait Root
object Internal {
sealed trait Branch extends Root
object Deeper {
final class LeafA extends Branch
final class LeafB extends Branch
}
}
}
| scala/scala | test/tasty/pos/src-3/tastytest/DelayedChained.scala | Scala | apache-2.0 | 236 |
package teststate.core
import teststate.core.Types.CheckShapeA
import teststate.data.Sack
import teststate.typeclass.PolyComposable
import teststate.typeclass.PolyComposable._
/**
* P = Point
* @ = Around
* I = Invariant
* C = Check
* A = Action
*
* P & P = P
* @ & @ = @
* I & I = I
* C & C = I
... | japgolly/test-state | core/shared/src/main/scala/teststate/core/CoreComposition.scala | Scala | apache-2.0 | 1,215 |
package com.github.zarkus13.slickgenerator.sbt
import com.etsy.sbt.CompileQuick._
import sbt._
import sbt.Keys._
/**
* Created by Alexis on 22/03/2014.
*/
object SlickGenerationSbtPlugin extends Plugin {
lazy val generatorPath = settingKey[String]("Path to the object containing a main method and generating the s... | Zarkus13/Slick-Generator | slick-generation-sbt-plugin/src/main/scala/com/github/zarkus13/slickgenerator/sbt/SlickGenerationSbtPlugin.scala | Scala | mit | 1,569 |
package euler
package til70
import euler._
import contfract._
object Euler66 extends EulerProblem {
override def result = {
val res = (2 to 1000) filterNot isPerfectSquare map { d => (d, solveDiophantine(d).get._1) }
res.maxBy(_._2)._1
}
// The fundamental solution is the first convergent that is also... | TrustNoOne/Euler | scala/src/main/scala/euler/til70/Euler66.scala | Scala | mit | 601 |
package io.getquill.quotation
import io.getquill.ast._
import io.getquill.ast.Implicits._
import collection.immutable.Set
case class State(seen: Set[IdentName], free: Set[IdentName])
case class FreeVariables(state: State)
extends StatefulTransformer[State] {
override def apply(ast: Ast): (Ast, StatefulTransform... | getquill/quill | quill-core-portable/src/main/scala/io/getquill/quotation/FreeVariables.scala | Scala | apache-2.0 | 4,233 |
/*
* Licensed to Metamarkets Group Inc. (Metamarkets) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Metamarkets licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); ... | druid-io/tranquility | core/src/test/scala/com/metamx/tranquility/test/common/DruidIntegrationSuite.scala | Scala | apache-2.0 | 10,089 |
package org.orbeon.oxf.fr
import org.orbeon.oxf.fr.datamigration.PathElem
import org.orbeon.oxf.fr.process.SimpleProcessCommon
import org.orbeon.saxon.om.NodeInfo
trait FormRunnerCommon
extends FormRunnerPersistence
with FormRunnerPermissionsOps
with FormRunnerEmail
with FormRunnerLang
with FormRunnerBas... | orbeon/orbeon-forms | form-runner/shared/src/main/scala/org/orbeon/oxf/fr/FormRunnerCommon.scala | Scala | lgpl-2.1 | 1,383 |
/*
* 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 ... | caneGuy/spark | core/src/main/scala/org/apache/spark/network/netty/NettyBlockTransferService.scala | Scala | apache-2.0 | 8,353 |
/**
* *************************************************************************
* This file is part of GTuring. *
* *
* GTuring is free software: you can redistribute it and/or modify *
* it u... | satabin/gniehturing | bytecode/src/main/scala/gnieh/turing/bytecode/BytecodeFormatException.scala | Scala | gpl-3.0 | 1,526 |
package ch.epfl.gsn.data
import org.scalatest.FunSpec
import org.scalatest.Matchers
import ch.epfl.gsn.data.DoubleType;
import ch.epfl.gsn.data.LongType;
import ch.epfl.gsn.data.Sensor;
import ch.epfl.gsn.data.format.XmlSerializer
class XmlTest extends FunSpec with Matchers {
describe("xml write"){
val f... | LSIR/gsn | gsn-tools/src/test/scala/ch/epfl/gsn/data/XmlTest.scala | Scala | gpl-3.0 | 968 |
package edu.umass.ciir.galago
import java.io.{StringReader, File, IOException}
import org.lemurproject.galago.core.retrieval.query.{AnnotatedNode, StructuredQuery, Node}
import org.lemurproject.galago.utility.Parameters
import org.lemurproject.galago.core.parse.Document
import scala.collection.JavaConversions.... | daltonj/CIIRShared | src/main/scala/edu/umass/ciir/galago/GalagoSearcher.scala | Scala | apache-2.0 | 10,589 |
package nasa.nccs.cdas.engine
import java.io.{IOException, PrintWriter, StringWriter}
import java.nio.file.{ Paths, Files }
import scala.xml
import java.io.File
import nasa.nccs.cdapi.cdm.{Collection, PartitionedFragment, _}
import nasa.nccs.cdas.loaders.{Collections, Masks}
import nasa.nccs.esgf.process._
import sca... | nasa-nccs-cds/CDAS2 | src/main/scala/nasa/nccs/cdas/engine/manager.scala | Scala | gpl-2.0 | 43,404 |
/*
* Copyright 2019 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/frontend-bootstrap | src/test/scala/uk/gov/hmrc/play/frontend/bootstrap/ShowErrorPageSpec.scala | Scala | apache-2.0 | 3,133 |
import scala.reflect.ClassManifest
// #1435
object t1435 {
implicit def a(s:String):String = sys.error("")
implicit def a(i:Int):String = sys.error("")
implicit def b(i:Int):String = sys.error("")
}
class C1435 {
val v:String = {
import t1435.a
2
}
}
// #1492
class C1492 {
class X
def foo(x: ... | scala/scala | test/files/pos/implicits-old.scala | Scala | apache-2.0 | 1,533 |
package com.softwaremill.bootzooka.passwordreset.application
import java.time.temporal.ChronoUnit
import java.time.{Instant, ZoneOffset}
import java.util.UUID
import com.softwaremill.bootzooka.passwordreset.domain.PasswordResetCode
import com.softwaremill.bootzooka.test.{FlatSpecWithDb, TestHelpersWithDb}
import com.... | ldrygala/bootzooka | backend/src/test/scala/com/softwaremill/bootzooka/passwordreset/application/PasswordResetServiceSpec.scala | Scala | apache-2.0 | 3,424 |
package gitbucket.core.api
import gitbucket.core.util.JGitUtil.TagInfo
import gitbucket.core.util.RepositoryName
import org.eclipse.jgit.lib.Ref
case class ApiRefCommit(
sha: String,
`type`: String,
url: ApiPath
)
case class ApiRef(
ref: String,
node_id: String = "",
url: ApiPath,
`object`: ApiRefCommi... | gitbucket/gitbucket | src/main/scala/gitbucket/core/api/ApiRef.scala | Scala | apache-2.0 | 1,683 |
/*
* Copyright 2016 Cisco Systems, 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 l... | cisco/elsy | examples/sbt-scala/src/main/scala/HelloWorldMain.scala | Scala | apache-2.0 | 1,241 |
/*
* Derived from https://github.com/spray/spray/blob/v1.1-M7/spray-http/src/main/scala/spray/http/parser/AuthorizationHeader.scala
*
* Copyright (C) 2011-2012 spray.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... | ZizhengTai/http4s | core/src/main/scala/org/http4s/parser/AuthorizationHeader.scala | Scala | apache-2.0 | 2,545 |
/**
* FILE: UpgradeBuilding.scala
* PERCORSO /Codice/sgad/servertier/src/main/scala/sgad/servertier/businesslogic/operations
* DATA CREAZIONE: 25 Febbraio 2014
* AUTORE: ProTech
* EMAIL: [email protected]
*
* Questo file è proprietà del gruppo ProTech, viene rilasciato sotto licenza Apache v2.
*
* DIARIO... | protechunipd/SGAD | Codice/sgad/servertier/src/main/scala/sgad/servertier/businesslogic/operations/UpgradeBuilding.scala | Scala | apache-2.0 | 5,493 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/index/ConfigurableIndexesTest.scala | Scala | apache-2.0 | 5,799 |
/*
* Copyright 2012 Twitter 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... | vdt/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/common/Span.scala | Scala | apache-2.0 | 5,290 |
/*
* Copyright (C) 2015 Language Technology Group
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* ... | tudarmstadt-lt/DIVID-DJ | common/src/main/scala/model/Relationship.scala | Scala | agpl-3.0 | 1,580 |
import stainless.annotation._
object MutateInside2 {
case class Mut[@mutable T](var t: T)
case class Thing(var field: Int)
def resetThing(m: Mut[Thing]): Unit = {
m.t = Thing(0)
}
def main(): Unit = {
val thing = Thing(123)
resetThing(Mut(thing))
assert(thing.field == 123)
}
}
| epfl-lara/stainless | frontends/benchmarks/imperative/valid/MutateInside2.scala | Scala | apache-2.0 | 309 |
package ucesoft.cbm.misc
import ucesoft.cbm.cpu.Memory
import java.awt.Desktop
import java.io.PrintWriter
import java.io.FileWriter
object BasicListExplorer {
private[this] val TOKEN_MAP = Map(
0x80 -> "END",
0x81 -> "FOR",
0x82 -> "NEXT",
0x83 -> "DATA",
0x84 -> "INPUT#",
0x85 -... | abbruzze/kernal64 | Kernal64/src/ucesoft/cbm/misc/BasicListExplorer.scala | Scala | mit | 9,222 |
/* Copyright 2017-19, Emmanouil Antonios Platanios. 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.org/licenses/LICENSE-2.0
*
* Unless ... | eaplatanios/tensorflow_scala | modules/api/src/test/scala/org/platanios/tensorflow/api/ops/TextSuite.scala | Scala | apache-2.0 | 3,362 |
/*
* 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/scalautils/ConversionCheckedMapEqualityConstraintsSpec.scala | Scala | apache-2.0 | 3,323 |
/*
* 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
* distribut... | granturing/spark-power-bi | src/test/scala/com/granturing/spark/powerbi/PowerBISuite.scala | Scala | apache-2.0 | 4,851 |
///*
// * Copyright 2009-2010 LinkedIn, 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 appli... | linkedin-sna/norbert | network/src/test/scala/com/linkedin/norbert/network/common/MessageRegistrySpec.scala | Scala | apache-2.0 | 2,616 |
package scala.lms
package epfl
package test4
import common.{BlockExp,EffectExp}
import common.ScalaGenEffect // don't import FunctionsExp
import test2._
import test3._
import util.ClosureCompare
import scala.reflect.SourceContext
import scala.collection.{immutable, mutable}
trait FunctionsExpClever extends test3.Fun... | astojanov/virtualization-lms-core | test-src/epfl/test4-functions/Functions.scala | Scala | bsd-3-clause | 5,901 |
import akka.actor.ActorSystem
import akka.testkit.TestKit
import models.{Stock, LimitAskOrder, AskOrderBook}
import org.scalatest.{BeforeAndAfterAll, FeatureSpecLike, GivenWhenThen, Matchers}
import scala.util.Random
class AskOrderBookSpec extends TestKit(ActorSystem("AskOrderBookSpec")) with
FeatureSpecLike with
... | davidrpugh/play-securities-exchange | test/AskOrderBookSpec.scala | Scala | apache-2.0 | 6,744 |
package peregin.gpv.gui.gauge
import peregin.gpv.model.Telemetry
/**
* In addition to the gauge painter the chart painter is initialized with the current telemetry data, thus allowing
* to paint a chart based on a specific data (such as elevation, speed, heart rate, etc).
*/
trait ChartPainter extends GaugePainter... | peregin/gps-overlay-on-video | src/main/scala/peregin/gpv/gui/gauge/ChartPainter.scala | Scala | mit | 495 |
package models
import java.net.URI
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{Path, FileSystem}
import org.apache.spark.sql.SQLContext
import org.apache.spark.{SparkConf, SparkContext}
import play.api.Play.current
/**
* Handles configuration, context and so
*
* @author Daniel Voigt G... | dvgodoy/play-benford-analysis | app/models/SparkCommons.scala | Scala | apache-2.0 | 1,953 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | mdzimmerman/geomesa | geomesa-tools/src/main/scala/org/locationtech/geomesa/tools/accumulo/commands/DescribeCommand.scala | Scala | apache-2.0 | 3,151 |
package controllers
import org.scalatest._
import play.api.test._
import play.api.test.Helpers._
/**
* You can mock out a whole application including requests, plugins etc.
* For more information, consult the wiki.
*/
class ApplicationIT extends FunSpec with Matchers {
describe ("Application") {
it ("shou... | phosphene/play-slick-silhouette-scalatest | test/controllers/ApplicationIT.scala | Scala | apache-2.0 | 757 |
def typePattern1(value: Any):String =
value match {
case _ :Int => "Int matched"
case x :String => "String matched. "+x.toUpperCase
case _ :Boolean => "Boolean matched"
case _ => "Another type matched"
}
| grzegorzbalcerek/scala-book-examples | examples/PatternsTypes1.scala | Scala | mit | 224 |
/*
* 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 ... | darionyaphet/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala | Scala | apache-2.0 | 52,008 |
package algorithms.Datastructures
import scala.annotation.tailrec
sealed trait HeapType
case object MaxHeap extends HeapType
case object MinHeap extends HeapType
class Heap(lst: Seq[Int], heapType: HeapType) {
import Heap.{insert, swapTwoElementsByIndex}
private val length: Int = lst.length
privat... | ghostrider77/Bioinformatics | Bioinformatics/src/main/scala-2.11/algorithms/Datastructures/Heap.scala | Scala | mit | 3,088 |
/*
* 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 ... | cin/spark | core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala | Scala | apache-2.0 | 12,437 |
package com.seanshubin.schulze.persistence
import datomic.{Entity, Database}
import com.seanshubin.schulze.persistence.datomic_util.ScalaAdaptor._
import com.seanshubin.schulze.domain.{Ranking, Candidate}
import java.lang.{Long=>JavaLong}
class DatomicPersistenceSnapshotApi(db: Database) extends PersistenceSnapshotAp... | SeanShubin/schulze | persistence/src/main/scala/com/seanshubin/schulze/persistence/DatomicPersistenceSnapshotApi.scala | Scala | unlicense | 4,931 |
package edu.gemini.sp.vcs2
import org.scalacheck.Prop.forAll
import org.scalacheck.Gen
import org.specs2.ScalaCheck
import org.specs2.mutable.Specification
object SortSpec extends Specification with ScalaCheck {
case class Test(merged: List[Char], preferred: List[Char], alternate: List[Char]) {
val sorted = Sor... | arturog8m/ocs | bundle/edu.gemini.sp.vcs/src/test/scala/edu/gemini/sp/vcs2/SortSpec.scala | Scala | bsd-3-clause | 2,579 |
// Worker.scala
//
//
package com.example.piakka
import akka.actor.{Actor, ActorRef, ActorPath, ActorLogging}
import scala.annotation.tailrec
import akka.pattern.pipe
import scala.concurrent.Future
object Worker {
case class WorkerCreated(worker: ActorRef)
case class SendWork(worker: ActorRef)
case clas... | dtinblack/Scala-AKKACluster | PiWorkerPull/src/main/scala/Worker.scala | Scala | mit | 2,021 |
package com.geishatokyo.smartmerger.injection
/**
* Created by takeshita on 2014/06/03.
*/
class InjectionRule {
/**
*
*/
var ignoreNotExistMergeBlock = false
/**
*
*/
var leftNotMergedBlock = true
}
| geishatokyo/smart-merger | src/main/scala/com/geishatokyo/smartmerger/injection/InjectionRule.scala | Scala | mit | 225 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package expr
import com.intellij.lang.ASTNode
import com.intellij.psi._
import com.intellij.psi.scope._
import org.jetbrains.plugins.scala.lang.psi.api.base.patterns.ScPattern
import org.jetbrains.plugins.scala.lang.psi.api.expr._
import org.jet... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScEnumeratorsImpl.scala | Scala | apache-2.0 | 2,171 |
import org.specs2.mutable._
class MaxSumSubsetTests extends Specification {
import MaxSumSubset._
"maxSumSubArray" should {
"return 12 for [1, -3, 5, -2, 9, -8, -6, 4]" in {
maxSumSubArray(Array(1, -3, 5, -2, 9, -8, -6, 4)) must_== 12
}
}
}
| eflan/practice | TreesAndGraphs/eliot/scala/src/test/scala/MaxSumSubsetTests.scala | Scala | apache-2.0 | 263 |
abstract class Q[T] {
type t <: T
}
class User(q: Q[String]) {
def r(v : q.t) = {
v.<ref>toLowerCase
}
}
| ilinum/intellij-scala | testdata/resolve/nonlocal/substAliasBound.scala | Scala | apache-2.0 | 116 |
/*
* 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 ... | aosagie/spark | core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala | Scala | apache-2.0 | 13,533 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author Usman Nisar, Aravind Kalimurthy, John Miller
* @version 1.3
* @date Tue Dec 20 15:10:55 EST 2016
* @see LICENSE (MIT style license file).
*
* @see www2012.wwwconference.org/proceedings/proceedings/p949.pdf
... | scalation/fda | scalation_1.3/scalation_modeling/src/main/scala/scalation/graphalytics/mutable/GraphSimCAR.scala | Scala | mit | 4,526 |
package slamdata.engine.api
import slamdata.Predef._
import slamdata.engine._; import Backend._
import slamdata.engine.analysis.fixplate.{Term}
import slamdata.engine.config._
import slamdata.engine.fp._
import slamdata.engine.fs._; import Path._
import scala.concurrent.duration._
import scalaz._
import scalaz.concu... | wemrysi/quasar | web/src/test/scala/slamdata/engine/api/fs.scala | Scala | apache-2.0 | 58,541 |
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.json
import java.io.InputStream
import play.api.libs.iteratee.Execution.Implicits.defaultExecutionContext
import play.api.libs.json.jackson.JacksonJson
/**
* Helper functions to handle JsValues.
*/
object Json {
/**
... | jeantil/play-json-extra | play-json-extra/js/src/main/scala/play/api/libs/json/Json.scala | Scala | apache-2.0 | 8,623 |
package com.aristocrat.mandrill.requests.Urls
import com.aristocrat.mandrill.requests.MandrillRequest
case class TrackingDomains(key: String) extends MandrillRequest
| aristocratic/mandrill | src/main/scala/com/aristocrat/mandrill/requests/Urls/TrackingDomains.scala | Scala | mit | 168 |
package se.meldrum.machine
import se.meldrum.machine.utils.Config
trait PsqlTestConfig extends Config {
val host = config.getString("postgres-test.host")
val port = config.getInt("postgres-test.port")
val dbName = config.getString("postgres-test.dbname")
val user = config.getString("postgres-test.user")
va... | Max-Meldrum/machine | src/test/scala/se/meldrum/machine/PsqlTestConfig.scala | Scala | apache-2.0 | 428 |
package es.weso.computex
import org.scalatest._
import org.scalatest.matchers.ShouldMatchers
import com.typesafe.config.ConfigFactory
import com.typesafe.config.Config
import es.weso.utils.JenaUtils._
import es.weso.utils.JenaUtils
import CexUtils._
import PREFIXES._
import scala.io.Source
import scala.util.parsing.js... | weso/wiCompute | src/test/scala/es/weso/computex/SimpleNormalizationSuite.scala | Scala | mit | 1,332 |
/*
* 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... | SRGOM/scalatest | scalatest-test/src/test/scala/org/scalatest/ShouldCollectedTripleEqualsSpec.scala | Scala | apache-2.0 | 37,744 |
package lila.round
import actorApi._
import actorApi.round._
import akka.actor.{ ActorSystem, Cancellable, CoordinatedShutdown, Scheduler }
import chess.format.Uci
import chess.{ Black, Centis, Color, MoveMetrics, Speed, White }
import play.api.libs.json._
import scala.concurrent.duration._
import scala.concurrent.{ E... | luanlv/lila | modules/round/src/main/RoundSocket.scala | Scala | mit | 18,948 |
/**
* 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 ... | tomwhite/adam | adam-core/src/main/scala/org/bdgenomics/adam/util/HadoopUtil.scala | Scala | apache-2.0 | 2,236 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package index
import _root_.org.jetbrains.plugins.scala.lang.psi.impl.search.ScSourceFilterScope
import api.statements.{ScValue, ScVariable}
import com.intellij.openapi.project.Project
import com.intellij.psi.search.GlobalSearchScope
import com... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/index/ScVariableNameIndex.scala | Scala | apache-2.0 | 849 |
package org.nisshiee.toban.controller.api
import play.api._
import play.api.mvc._
import play.api.db._
import play.api.Play.current
import play.api.libs.json._, Json._
import play.api.libs.Jsonp
import org.nisshiee.toban.model._
import org.nisshiee.toban.controller.ControllerHelper
object TaskController extends Cont... | nisshiee/to-ban | app/controllers/api/TaskController.scala | Scala | mit | 581 |
package me.rjfarmer.rlh.client
import me.rjfarmer.rlh.api.CacheableResponse
/** history items have text with time information about the response */
class HistoryItem[T <: CacheableResponse] (val item: T ) extends HasResponseTimeAgo {
updateResponseTimestamp(item.timestamp)
}
/**
* Maintains result history for T... | random-j-farmer/little-helper | app/js/src/main/scala/me/rjfarmer/rlh/client/History.scala | Scala | mit | 1,200 |
/**
* Copyright (C) 2012 Typesafe, Inc. <http://www.typesafe.com>
*/
package org.pantsbuild.zinc
import java.io.File
import sbt.{ Hash, IO }
object Util {
//
// Time
//
/**
* Current timestamp and time passed since start time.
*/
def timing(start: Long): String = {
val end = System.currentTime... | kwlzn/pants | src/scala/org/pantsbuild/zinc/Util.scala | Scala | apache-2.0 | 7,058 |
/*
* 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 ... | tkpanther/ignite | modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/VisorTopologyCommand.scala | Scala | apache-2.0 | 14,991 |
import scala.quoted.*
object Macro {
inline def foo: Unit = ${ fooImpl }
def fooImpl(using Quotes): Expr[Unit] = '{}
}
| lampepfl/dotty | tests/run-macros/i4515b/Macro_1.scala | Scala | apache-2.0 | 124 |
package com.github.ghik.silencer
import scala.tools.nsc.Settings
object CrossTestUtils {
def enableUnusedImports(settings: Settings): Unit = {
settings.warnUnused.enable(settings.UnusedWarnings.Imports)
}
}
| ghik/silencer | silencer-plugin/src/test/scala-2.12-13/com/github/ghik/silencer/CrossTestUtils.scala | Scala | apache-2.0 | 217 |
/*
* Copyright 2008 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... | wso2as-developer/scala-samples | lift-jpa/web/src/main/scala/org/wso2/as/snippet/Author.scala | Scala | apache-2.0 | 2,428 |
package ee.cone.c4actor
import ee.cone.c4assemble.ToPrimaryKey
trait ModelAccessFactoryApp {
def modelAccessFactory: ModelAccessFactory = modelAccessFactoryImpl
private lazy val modelAccessFactoryImpl = ModelAccessFactoryImpl
}
object ModelAccessFactoryImpl extends ModelAccessFactory {
def to[P <: Product](pr... | wregs/c4proto | c4actor-base/src/main/scala/ee/cone/c4actor/AccessImpl.scala | Scala | apache-2.0 | 2,203 |
/*
* Copyright (C) 2012 The Regents of The University California.
* 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.org/licenses/LICEN... | uclaabs/abs | src/main/scala/shark/execution/GroupByPreShuffleOperator.scala | Scala | apache-2.0 | 13,150 |
/*
* Licensed to Tuplejump Software Pvt. Ltd. under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Tuplejump Software Pvt. Ltd. licenses this file
* to you under the Apache License, Version 2.0 (the
* "Li... | brenttheisen/calliope | src/main/scala/com/tuplejump/calliope/thrift/ThriftCassandraRDD.scala | Scala | apache-2.0 | 4,099 |
package lila.event
import play.api.Configuration
import com.softwaremill.macwire._
import lila.common.config.CollName
import lila.common.config._
final class Env(
appConfig: Configuration,
db: lila.db.Db,
cacheApi: lila.memo.CacheApi
)(implicit ec: scala.concurrent.ExecutionContext) {
private lazy val... | luanlv/lila | modules/event/src/main/Env.scala | Scala | mit | 422 |
package org.orbeon.oxf.portlet.liferay
import org.orbeon.oxf.portlet.{RequestPrependHeaders, RequestRemoveHeaders}
import org.orbeon.oxf.util.CollectionUtils
import javax.portlet.filter._
import javax.portlet._
class AddLiferayUserHeadersFilter
extends PortletFilter
with RenderFilter
with ActionFilter
... | orbeon/orbeon-forms | portlet-support/src/main/scala/org/orbeon/oxf/portlet/liferay/AddLiferayUserHeadersFilter.scala | Scala | lgpl-2.1 | 2,757 |
package com.programmaticallyspeaking.ncd.testing
import java.nio.charset.Charset
import java.util.Base64
object StringUtils {
private val encoder = Base64.getEncoder
private val decoder = Base64.getDecoder
private val utf8 = Charset.forName("utf-8")
def toBase64(s: String): String = encoder.encodeToString(s.... | provegard/ncdbg | src/test/scala/com/programmaticallyspeaking/ncd/testing/StringUtils.scala | Scala | bsd-3-clause | 412 |
package org.jetbrains.plugins.scala
package refactoring.changeSignature
import com.intellij.psi.PsiMember
import com.intellij.refactoring.changeSignature.{ChangeSignatureProcessorBase, ParameterInfo}
import org.jetbrains.plugins.scala.lang.psi.api.base.ScMethodLike
import org.jetbrains.plugins.scala.lang.psi.types.api... | whorbowicz/intellij-scala | test/org/jetbrains/plugins/scala/refactoring/changeSignature/ChangeSignatureInScalaTest.scala | Scala | apache-2.0 | 4,917 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala | Scala | apache-2.0 | 11,992 |
case class i1[i1](i1:i1=>Either[i1,Nothing]){def i1(}
| lampepfl/dotty | tests/pending/fuzzy/E-61466476fb2b670ec310e86fc2692b75ce455b09.scala | Scala | apache-2.0 | 54 |
/*
* Copyright 2013 http4s.org
*
* 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... | http4s/http4s | core/shared/src/main/scala/org/http4s/InvalidResponseException.scala | Scala | apache-2.0 | 862 |
package org.jetbrains.plugins.scala
package codeInspection
package collections
import com.intellij.testFramework.EditorTestUtil
/**
* @author Nikolay.Tropin
*/
class SizeToLengthTest extends OperationsOnCollectionInspectionTest {
import EditorTestUtil.{SELECTION_END_TAG => END, SELECTION_START_TAG => START}
o... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/codeInspection/collections/SizeToLengthTest.scala | Scala | apache-2.0 | 1,627 |
/*
* 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 ... | boneman1231/org.apache.felix | trunk/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/webconsole/Servlet.scala | Scala | apache-2.0 | 2,447 |
/*
* Copyright 2014–2017 SlamData 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... | drostron/quasar | mongodb/src/main/scala/quasar/physical/mongodb/expression/package.scala | Scala | apache-2.0 | 1,967 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.mvc
import java.io.File
import java.nio.file.FileSystem
import java.nio.file.Path
import java.nio.file.{ Files => JFiles }
import com.google.common.jimfs.Configuration
import com.google.common.jimfs.Jimfs
import play.api.libs.Files.T... | wegtam/playframework | core/play/src/test/scala/play/api/mvc/InMemoryTemporaryFileCreator.scala | Scala | apache-2.0 | 1,287 |
/**
* COPYRIGHT (C) 2015 Alpine Data Labs Inc. All Rights Reserved.
*/
package com.alpine.plugin.core.dialog
import com.alpine.plugin.core.annotation.AlpineSdkApi
/**
* :: AlpineSdkApi ::
*/
@AlpineSdkApi
trait DoubleBox extends DialogElement {
def setValue(value: Double): Unit
def getValue: Double
def get... | holdenk/PluginSDK | plugin-core/src/main/scala/com/alpine/plugin/core/dialog/DoubleBox.scala | Scala | apache-2.0 | 417 |
package de.guderlei.spray.database
import org.squeryl.{Session, SessionFactory}
import org.squeryl.adapters.{MySQLAdapter, H2Adapter}
import de.guderlei.spray.domain.TodoItem
import java.util.Date
import org.squeryl.PrimitiveTypeMode._
import scala.Some
import com.jolbox.bonecp.{BoneCP, BoneCPConfig}
import org.slf4j.... | KizuRos/spray-example | src/main/scala/de/guderlei/spray/database/DatabaseHandling.scala | Scala | mit | 1,913 |
/**
* Created by Romain Reuillon on 07/02/16.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This ... | openmole/openmole | openmole/plugins/org.openmole.plugin.environment.desktopgrid/src/main/scala/org/openmole/plugin/environment/desktopgrid/DesktopGridAuthentication.scala | Scala | agpl-3.0 | 1,496 |
/*
* 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 ... | gyfora/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/logical/FlinkLogicalDataStreamTableScan.scala | Scala | apache-2.0 | 3,655 |
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.