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
import compiletime.summonAll @main def Test = given Int = 10 given String = "foo" given Double = 1.2 println(summonAll[Int *: String *: Double *: EmptyTuple])
dotty-staging/dotty
tests/run/summonAll.scala
Scala
apache-2.0
168
package forimpatient.chapter03 /** * Created by Iryna Kharaborkina on 7/28/16. * * Solution to the Chapter 03 Exercise 07 'Scala for the Impatient' by Horstmann C.S. * * Write a code snippet that produces all values from an array with duplicates removed. (Hint: Look at Scaladoc.) */ object Exercise07 exte...
Kiryna/Scala-for-the-Impatient
src/forimpatient/chapter03/Exercise07.scala
Scala
apache-2.0
488
package jigg.pipeline /* Copyright 2013-2017 Hiroshi Noji 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...
mynlp/jigg
src/main/scala/jigg/pipeline/CandCAnnotator.scala
Scala
apache-2.0
6,704
package io.taig.android.widget.operation import android.support.v4.view.ViewPager final class viewPager(viewPager: ViewPager) { def next(smoothly: Boolean = true) = viewPager.setCurrentItem(viewPager.getCurrentItem + 1) def previous(smoothly: Boolean = true): Unit = viewPager.setCurrentItem(viewPager.get...
Taig/Toolbelt
widget/src/main/scala/io/taig/android/widget/operation/viewPager.scala
Scala
mit
339
/*********************************************************************** * 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/main/scala/org/locationtech/geomesa/accumulo/data/AccumuloQueryPlan.scala
Scala
apache-2.0
10,060
/* * Copyright (c) 2002-2018 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j 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 Foundatio...
HuangLS/neo4j
community/cypher/cypher-compiler-2.3/src/test/scala/org/neo4j/cypher/internal/compiler/v2_3/ast/conditions/ContainsNoNodesOfTypeTest.scala
Scala
apache-2.0
1,731
/** * 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 TabularDatasetColumnDropdownBox extends DropdownBox
holdenk/PluginSDK
plugin-core/src/main/scala/com/alpine/plugin/core/dialog/TabularDatasetColumnDropdownBox.scala
Scala
apache-2.0
270
package metaconfig import metaconfig.generic.Surface case class Inner(a: String = "a", b: Boolean = true) object Inner { implicit val surface: Surface[Inner] = generic.deriveSurface[Inner] implicit val codec: ConfCodec[Inner] = generic.deriveCodec(Inner()) }
olafurpg/metaconfig
metaconfig-tests/jvm/src/test/scala/metaconfig/Inner.scala
Scala
apache-2.0
265
/* * Copyright 2011 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 t...
hydro2k/ostrich
src/main/scala/com/twitter/ostrich/stats/StatsListener.scala
Scala
apache-2.0
6,910
object Foo val x: Foo.type = Foo val y: Foo.type | Nothing = x val z: Foo.type = y val a: 1 | Nothing = 1 val b: 1 = a val intSuper = summon[(Int | Nothing) <:< Int] val intSub = summon[Int <:< (Int | Nothing)] val intEq = summon[Int =:= (Int | Nothing)] val fooSuper = summon[(Foo.type | Nothing) <:< Foo.type] val f...
dotty-staging/dotty
tests/pos/i11003.scala
Scala
apache-2.0
550
package nodes.misc import nodes.util.{SparseFeatureVectorizer, AllSparseFeatures, CommonSparseFeatures} import org.apache.spark.SparkContext import org.scalatest.FunSuite import pipelines.Logging import workflow.PipelineContext class SparseFeatureVectorizerSuite extends FunSuite with PipelineContext with Logging { ...
tomerk/keystone
src/test/scala/nodes/misc/SparseFeatureVectorizerSuite.scala
Scala
apache-2.0
1,982
package org.broadinstitute.clio.client.webclient import java.time.OffsetDateTime import java.util.Date import com.google.auth.oauth2.{AccessToken, GoogleCredentials} import org.scalatest.{FlatSpec, Matchers} import scala.concurrent.duration._ import scala.util.Random class GoogleCredentialsGeneratorSpec extends Fla...
broadinstitute/clio
clio-client/src/test/scala/org/broadinstitute/clio/client/webclient/GoogleCredentialsGeneratorSpec.scala
Scala
bsd-3-clause
2,023
/* * 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 ...
ueshin/apache-spark
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala
Scala
apache-2.0
3,688
package scadla.examples import scadla._ import scadla.InlineOps._ import scadla.utils.extrusion._ import scadla.EverythingIsIn.millimeters object ExtrusionDemo { def main(args: Array[String]): Unit = { val r = scadla.backends.Renderer.default val objects = List( _2020(100), C(20,20,10,4)(100), ...
dzufferey/scadla
src/main/scala/scadla/examples/ExtrusionDemo.scala
Scala
apache-2.0
550
/* * Copyright 2022 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or a...
hmrc/iht-frontend
test/iht/controllers/application/assets/stocksAndShares/StocksAndSharesListedControllerTest.scala
Scala
apache-2.0
6,755
package me.lignum.lambdacraft.computer.instructions import me.lignum.lambdacraft.computer.{CPU, Instruction, InstructionType} class Jmp extends Instruction { def canJump(p: CPU): Boolean = true override def getType: Byte = InstructionType.Jmp override def execute(p: CPU): Unit = { val stack = p.processor....
Lignumm/LambdaCraft
src/main/scala/me/lignum/lambdacraft/computer/instructions/Jmp.scala
Scala
mit
490
/* Copyright 2017-18, 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
tensorflow/scala/api/src/main/scala/org/platanios/tensorflow/api/learn/layers/rnn/cell/package.scala
Scala
apache-2.0
2,834
package service import models.support.UserId import models.user.User sealed abstract class Access extends Ordered[Access] { val v: Short def read: Boolean def write: Boolean def compare(that: Access): Int = this.v.compare(that.v) def ceilEdit = Seq(this, Edit).min def read[T](block: () => T): Option[T] = if ...
kristiankime/web-education-games
app/service/Access.scala
Scala
mit
1,654
/** * Copyright (C) 2009-2011 the original author or authors. * See the notice.md file distributed with this work for additional * information regarding copyright ownership. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
scalate/scalate
scalate-core/src/test/scala/org/fusesource/scalate/TemplateTestSupport.scala
Scala
apache-2.0
6,228
package scalax.collection.io import net.liftweb.json.JValue import scalax.collection.GraphEdge._ import scalax.collection.GraphPredef._ import scalax.collection.edge.LBase._ import scalax.collection.edge.WBase._ import scalax.collection.edge.WLBase._ import scalax.collection.edge._ import scalax.collection.generic.Gra...
scala-graph/scala-graph
json/src/main/scala/scalax/collection/io/json/package.scala
Scala
apache-2.0
8,263
package com.github.dcapwell.docker.builder import com.github.dcapwell.docker.builder.lang._ import scala.annotation.tailrec import scalaz.syntax.show._ import lang.Instruction.docker._ object Dockerfile { def generate(traits: List[Trait]): List[String] = { @tailrec def loop(traits: List[Trait], accum: List...
dcapwell/docker-builder
dockerbuilder/src/main/scala/com/github/dcapwell/docker/builder/Dockerfile.scala
Scala
mit
620
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
practice-vishnoi/dev-spark-1
mllib/src/test/scala/org/apache/spark/mllib/regression/LinearRegressionSuite.scala
Scala
apache-2.0
6,441
package dispatch.spec import org.scalacheck._ object BasicSpecification extends Properties("Json4s Native Json") with DispatchCleanup { import Prop.forAll import org.json4s._ import org.json4s.native.JsonMethods._ import JsonDSL._ object Json { import unfiltered.response._ def jsonToString(json: J...
dispatch/reboot
json4snative/src/test/scala/json.scala
Scala
lgpl-3.0
1,315
package com.twitter.finagle.postgres.values import com.twitter.finagle.postgres.Spec import io.netty.buffer.{ByteBuf, Unpooled} import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks import com.twitter.finagle.postgres.Generators._ class UtilsSpec extends Spec with ScalaCheckDrivenPropertyChecks { "Buff...
finagle/finagle-postgres
src/test/scala/com/twitter/finagle/postgres/values/UtilsSpec.scala
Scala
apache-2.0
3,268
package org.raml.domain class DocItem(title: String, content: String)
larroy/Scala_raml_parser
src/main/scala/org/raml/domain/DocItem.scala
Scala
apache-2.0
71
package breeze.linalg import org.scalacheck._ import org.scalatest._ import org.scalatest.junit._ import org.scalatest.prop._ import org.junit.runner.RunWith import breeze.math.{DoubleValuedTensorSpaceTestBase, TensorSpace, TensorSpaceTestBase} /** * * @author dlwh */ class VectorTest { } /** * * @author dl...
wavelets/breeze
src/test/scala/breeze/linalg/VectorTest.scala
Scala
apache-2.0
4,202
package org.bitcoins.core.script.control import org.bitcoins.testkitcore.util.BitcoinSUnitTest /** Created by chris on 1/8/16. */ class ControlOperationsFactoryTest extends BitcoinSUnitTest { "ControlOperationsFactory" must "match a string with a control operation" in { ControlOperations.fromStringOpt("OP_EL...
bitcoin-s/bitcoin-s
core-test/src/test/scala/org/bitcoins/core/script/control/ControlOperationsFactoryTest.scala
Scala
mit
773
package controllers import play.api._ import play.api.mvc._ object Application extends Controller { def index = Action { Ok(views.html.index("Your new application is ready.")) } def healthCheck = Action(Ok("Running")) }
taraxe/gcloud-play-sample
app/controllers/Application.scala
Scala
apache-2.0
233
// // Copyright 2014-2020 Paytronix 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 ...
paytronix/utils-open
interchange/json/src/main/scala/com/paytronix/utils/interchange/format/json/deriveImpl.scala
Scala
apache-2.0
32,471
package scalamachine.scalaz import scalaz.{Monad, Traverse, Applicative} import scalamachine.core.{HaltRes, ValueRes, Res, EmptyRes, ErrorRes} package object res { implicit val resScalazInstances = new Traverse[Res] with Monad[Res] { def point[A](a: => A): Res[A] = ValueRes(a) def traverseImpl[G[_],A,B](fa...
stackmob/scalamachine
scalaz7/src/main/scala/scalamachine/scalaz/res/package.scala
Scala
apache-2.0
696
package org.powlab.jeye.decode.graph import scala.collection.mutable.ArrayBuffer import scala.collection.mutable.Buffer import scala.collection.mutable.Map import org.powlab.jeye.core.Opcodes import org.powlab.jeye.decode.expression._ import org.powlab.jeye.decode.expression.Expressions._ import org.powlab.jeye.decode...
powlab/jeye
src/main/scala/org/powlab/jeye/decode/graph/OpcodeTree.scala
Scala
apache-2.0
16,919
package com.amichalo.smooolelo.providers import com.typesafe.config.Config import com.typesafe.scalalogging.LazyLogging import scala.collection.JavaConversions._ class ConfigValuesProvider(config: Config) extends ConfigurationProvider with LazyLogging { private lazy val configuration: Map[String, String] = initia...
amichalo/smooolelo
src/main/scala/com/amichalo/smooolelo/providers/ConfigValuesProvider.scala
Scala
apache-2.0
598
class Outer { class Inner { def foo: Unit = assert(Outer.this ne null) } }
scala/scala
test/files/run/t10423/A_2.scala
Scala
apache-2.0
84
/** * 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...
KevinLiLu/kafka
core/src/main/scala/kafka/utils/KafkaScheduler.scala
Scala
apache-2.0
5,506
import play.api._ /** * Copyright (c) Nikita Kovaliov, maizy.ru, 2014 * See LICENSE.txt for details. */ object Global extends GlobalSettings { override def configuration = Configuration.from( Map("ws" -> Map("useragent" -> s"keemun/${keemun.Version.SYMBOLIC}")) ) }
maizy/keemun
app/Global.scala
Scala
mit
278
package chapter.eighteen import ExerciseFour._ import org.scalatest._ import org.scalatest.junit.JUnitRunner import org.junit.runner.RunWith @RunWith(classOf[JUnitRunner]) class ExerciseFourSpec extends FlatSpec with Matchers { "function" should "" in { } }
deekim/impatient-scala
src/test/scala/chapter/eighteen/ExerciseFourSpec.scala
Scala
apache-2.0
266
/* * 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...
jjlopezm/crossdata
driver/src/main/scala/com/stratio/crossdata/driver/shell/ShellArgsReader.scala
Scala
apache-2.0
2,154
/* * 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/main/scala/org/apache/flink/table/planner/plan/utils/UpdatingPlanChecker.scala
Scala
apache-2.0
1,945
/* * Copyright (c) 2013. Regents of the University of California * * 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 require...
fnothaft/adam
adam-core/src/main/scala/edu/berkeley/cs/amplab/adam/converters/SAMRecordConverter.scala
Scala
apache-2.0
5,452
package org.geow.util.test import org.geow.generator.OsmObjectGenerator import org.geow.model.OsmId import org.geow.model.geometry.Point import org.geow.util.Denormalizer import org.specs2.ScalaCheck import org.specs2.mutable.Specification class GeowUtilsSpec extends Specification with ScalaCheck { sequential v...
geow-org/api
src/test/scala/org/geow/util/test/GeowUtilsSpec.scala
Scala
apache-2.0
1,564
object main { def main(args: Array[String]){ /* * A shadow variable is a variable inside a function or a method that is of the same name * as the outer variable, but it is not visible to the outer part of the program * Examples below: */ val a = 1 /* * 1) Uncommenting line below ...
arcyfelix/Courses
18-10-18-Programming-in-Scala-by-Martin-Odersky-Lex-Spoon-and-Bill-Venners/23-ShadowVariable/src/main.scala
Scala
apache-2.0
708
package com.cloudray.scalapress.plugin.listings.controller import org.springframework.stereotype.Controller import org.springframework.web.bind.annotation.{ModelAttribute, RequestMethod, PathVariable, ResponseBody, RequestMapping} import javax.servlet.http.HttpServletRequest import org.springframework.beans.factory.an...
vidyacraghav/scalapress
src/main/scala/com/cloudray/scalapress/plugin/listings/controller/ListingEditController.scala
Scala
apache-2.0
2,356
/* * 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 ...
deroneriksson/systemml
src/main/scala/org/apache/sysml/api/dl/DMLGenerator.scala
Scala
apache-2.0
17,292
package akka import akka.actor.{Actor, ActorSystem, Props} import scala.concurrent.duration._ /** * Created by Om Prakash C on 20-06-2017. */ object SchedulerExample extends App { case object Count class SchedulerActor extends Actor { var n = 0 def receive = { case Count => n += 1 ...
comprakash/learning-scala
concurrency/src/main/scala/akka/SchedulerExample.scala
Scala
gpl-3.0
707
package org.nisshiee.crowd4s case class CrowdConnection ( urlPrefix: String ,appname: String ,password: String )
nisshiee/crowd4s
src/main/scala/types/CrowdConnection.scala
Scala
mit
121
/* * 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/filters/LoggingFilterSpec.scala
Scala
apache-2.0
2,903
package org.jetbrains.plugins.scala package lang package psi package api package base package patterns import com.intellij.psi.PsiElement import com.intellij.psi.tree.TokenSet import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes import org.jetbrains.plugins.scala.lang.psi.api.expr.{ScBlock, ScExpression, ScGu...
JetBrains/intellij-scala
scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/api/base/patterns/ScCaseClause.scala
Scala
apache-2.0
1,360
package s_mach.validate.impl import s_mach.validate._ import scala.reflect.ClassTag case class ValueClassValidator[V <: IsValueClass[A],A]( va: Validator[A] )(implicit ca: ClassTag[A], cv: ClassTag[V] ) extends ValidatorImpl[V] { def apply(a: V) = va(a.underlying) def rules = va.rules def descendantSchem...
S-Mach/s_mach.validate
validate-core/src/main/scala/s_mach/validate/impl/ValueClassValidator.scala
Scala
mit
474
/* * Scala (https://www.scala-lang.org) * * Copyright EPFL and Lightbend, Inc. * * Licensed under Apache License 2.0 * (http://www.apache.org/licenses/LICENSE-2.0). * * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ package scala.tools.nsc packag...
martijnhoekstra/scala
src/scaladoc/scala/tools/nsc/doc/model/MemberLookup.scala
Scala
apache-2.0
2,823
package com.jantvrdik.scala.app import scalafx.event.ActionEvent import scalafx.scene.canvas.Canvas import scalafx.scene.control.TextField import scalafx.scene.input.MouseButton import scalafx.scene.paint.Color import scalafxml.core.macros.sfxml @sfxml class MainWindowController( private v...
JanTvrdik/pisqworks
src/main/scala/com/jantvrdik/scala/app/MainWindowController.scala
Scala
mit
3,540
import sbt._ object Build extends sbt.Build { lazy val root = Project( id = "asterisque", base = file(".") ) aggregate(ri) lazy val ri = Project( id = "asterisque-ri", base = file("ri") ) }
torao/asterisque
core-scala/project/Build.scala
Scala
apache-2.0
205
package play.api.libs { /** * The Iteratee monad provides strict, safe, and functional I/O. */ package object iteratee { type K[E, A] = Input[E] => Iteratee[E, A] } } package play.api.libs.iteratee { private[iteratee] object internal { import play.api.libs.iteratee.Iteratee import scala....
michaelahlers/team-awesome-wedding
vendor/play-2.2.1/framework/src/iteratees/src/main/scala/play/api/libs/iteratee/package.scala
Scala
mit
1,831
/* * Copyright 2017 Sumo Logic * * 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...
SumoLogic/epigraph
java/codegen/src/main/scala/ws/epigraph/java/service/assemblers/RecordAsmGen.scala
Scala
apache-2.0
8,179
package de.tu_berlin.formic.datastructure.json /** * @author Ronny Bräunlich */ case class JsonPath(path: String*){ def dropFirstElement = JsonPath(path.drop(1):_*) }
rbraeunlich/formic
json/shared/src/main/scala/de/tu_berlin/formic/datastructure/json/JsonPath.scala
Scala
apache-2.0
177
/* Copyright 2009-2016 EPFL, Lausanne */ package leon package solvers package unrolling import leon.utils._ import purescala.Common._ import purescala.Definitions._ import purescala.Extractors._ import purescala.Constructors._ import purescala.Expressions._ import purescala.ExprOps._ import purescala.Types._ import p...
regb/leon
src/main/scala/leon/solvers/unrolling/QuantificationManager.scala
Scala
gpl-3.0
47,462
package org.broadinstitute.dsde.vault.datamanagement.model import com.wordnik.swagger.annotations.{ApiModel, ApiModelProperty} import scala.annotation.meta.field @ApiModel(value = "An entity search result") case class EntitySearchResult ( @(ApiModelProperty@field)(value = "The unique id for this entity.", required...
broadinstitute/vault-datamanagement
src/main/scala/org/broadinstitute/dsde/vault/datamanagement/model/EntitySearchResult.scala
Scala
bsd-3-clause
443
/** Run with : * * ./test * mvn scala:compile && scala -cp target/classes Test * mvn scala:compile && scala -cp target\\classes Test * javap -c -classpath target\\classes Test$ */ object TestIntRangeLoops { import TestUtils._ def main(args: Array[String]): Unit = { val name = if (args.isE...
nativelibs4java/ScalaCL
Old/Test/src/main/scala/TestIntRangeLoops.scala
Scala
bsd-3-clause
2,033
package at.forsyte.apalache.tla.pp import at.forsyte.apalache.tla.lir._ import at.forsyte.apalache.tla.lir.oper._ import at.forsyte.apalache.tla.lir.transformations.standard.FlatLanguagePred import at.forsyte.apalache.tla.lir.transformations.{LanguageWatchdog, TlaExTransformation, TransformationTracker} import at.fors...
konnov/apalache
tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/ConstSimplifier.scala
Scala
apache-2.0
7,160
package com.zinnia.hackthon /** * Author: madhu * Internal representation of record */ class Record() extends Serializable { var id: Long = _ var date : String = _ var time : String = _ var day: Int = _ var hourofDay: Long = _ var month: Int = _ var year: Long = _ var activePower: Double = _ var...
zinniasystems/spark-energy-prediction
src/main/java/com/zinnia/hackthon/Record.scala
Scala
apache-2.0
1,061
import models.Note import org.junit.runner._ import org.specs2.mutable._ import org.specs2.runner._ import _root_.anorm.SqlParser._ import _root_.anorm._ import _root_.anorm.~ import play.api.db.DB import play.api.test.FakeApplication import play.api.test.Helpers._ import play.api.Play.current @RunWith(classOf[JUnitRu...
Nectarius/taffeit
test/DraftSpec.scala
Scala
mit
836
/******************************************************************************* * This file is part of tiscaf. * * tiscaf 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 Li...
gnieh/tiscaf
rest/src/main/scala/tiscaf/rest/HRest.scala
Scala
lgpl-3.0
3,663
/* * 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 ...
oscarceballos/flink-1.3.2
flink-libraries/flink-ml/src/main/scala/org/apache/flink/ml/math/SparseVector.scala
Scala
apache-2.0
8,588
import sbt._ import Keys._ import com.typesafe.sbt.packager.docker.{Cmd, DockerKeys} object CommonDockerSettingsPlugin extends AutoPlugin with DockerKeys { override def trigger = allRequirements override def requires = com.typesafe.sbt.packager.docker.DockerPlugin override lazy val projectSettings = Seq( d...
odd/ddd-leaven-akka-v2
project/CommonDockerSettingsPlugin.scala
Scala
mit
555
/* * Copyright (c) 2002-2018 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j 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 Foundatio...
HuangLS/neo4j
community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/pipes/ExpandAllPipe.scala
Scala
apache-2.0
3,136
val legs = for (a <- 1 to 1000; b <- 1 to 1000 if a <= b) yield (a, b) def quadratic(a: Int, b: Int) = { math.sqrt(a * a + b * b) } val results = legs .map(x => (x._1, x._2, quadratic(x._1, x._2))) .filter(_._3.isWhole) .map(x => x._1 + x._2 + x._3.toInt) .filter(_ <= 1000) .groupBy(identity) .maxBy(_._...
brandonhorst/project-euler-scala
039.scala
Scala
mit
353
package io.skysail.server.app.bookmarks.resources import java.util.UUID import akka.actor.{ActorSelection, ActorSystem} import akka.http.scaladsl.model.HttpMethods import akka.http.scaladsl.server.Directives._ import akka.http.scaladsl.server.Route import io.skysail.domain._ import io.skysail.domain.messages.ProcessC...
evandor/skysail-apps
skysail.server.app.bookmarks/src/io/skysail/server/app/bookmarks/resources/bookmarks.scala
Scala
apache-2.0
4,550
package malgo import org.apache.spark.mllib.feature.StandardScaler import org.apache.spark.mllib.util.MLUtils._ import org.apache.spark.{SparkException, Logging} import org.apache.spark.annotation.{DeveloperApi, Experimental} import org.apache.spark.mllib.classification.ClassificationModel import org.apache.spark.mlli...
hu17889/mllib_subpackage
src/main/scala/malgo/LR.scala
Scala
apache-2.0
8,193
package memnets.model trait GridBase[+T <: Yb] extends GridLike[T] with GridData { def owner: DynamicSystem def act(te: Tick, r: Int, c: Int): Double def yScale: Float = apply(0).ui.scale.getOrElse(YRange.scaleF) override def subGrid(rDivs: Int, cDivs: Int): GridBase[T] = { val rDim = if (rDivs < rows) rD...
MemoryNetworks/memnets
api/src/main/scala/memnets/model/GridBase.scala
Scala
apache-2.0
1,728
/* * 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 ...
hortonworks-spark/spark-llap
src/test/scala/org/apache/spark/deploy/yarn/FakeYARNHadoopDelegationTokenManager.scala
Scala
apache-2.0
1,655
import scala.reflect.runtime.universe._ import scala.annotation._ class sann(x: Int, y: List[Int]) extends StaticAnnotation class jann(x: Int, y: Array[Int]) extends ClassfileAnnotation @sann(1, List(1, 2)) class S @jann(y = Array(1, 2), x = 2) class J object Test extends App { println(symbolOf[S].annotations.hea...
som-snytt/dotty
tests/disabled/reflect/run/reflection-scala-annotations.scala
Scala
apache-2.0
375
package org.mozartoz.bootcompiler package oz /** Compile-time constant */ sealed trait OzValue { def syntax(): String override def toString() = syntax() } /** Compile-time constant that can be used as a feature */ sealed trait OzFeature extends OzValue { /** Compare two features for their ordering in a record ...
yjaradin/mozart2
bootcompiler/src/main/scala/org/mozartoz/bootcompiler/oz/OzValue.scala
Scala
bsd-2-clause
6,597
package com.arcusys.valamis.persistence.impl.settings import com.arcusys.valamis.persistence.common.SlickProfile import com.arcusys.valamis.settings.model.StatementToActivity import com.arcusys.valamis.settings.storage.StatementToActivityStorage import scala.slick.driver.JdbcProfile import scala.slick.jdbc.JdbcBacken...
arcusys/Valamis
valamis-slick-persistence/src/main/scala/com/arcusys/valamis/persistence/impl/settings/StatementToActivityStorageImpl.scala
Scala
gpl-3.0
1,563
/* ************************************************************************************* * Copyright 2011 Normation SAS ************************************************************************************* * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero Ge...
Kegeruneku/rudder
rudder-core/src/main/scala/com/normation/rudder/repository/ImportLibrary.scala
Scala
agpl-3.0
5,249
package com.hacktheburgh.commlog.actors import akka.actor.{ActorRef, Actor} import akka.event.Logging import com.hacktheburgh.commlog.actors.messages.Commit /** * WebSocket handler actor for pushing JSON to clients. * * @author Arkan <arkan@drakon.io> */ class SocketActor(out: ActorRef) extends Actor { val log...
compsoc-edinburgh/Commlogs
app/com/hacktheburgh/commlog/actors/SocketActor.scala
Scala
mit
659
package io.scalajs.nodejs.timers import io.scalajs.nodejs.clearTimeout import scala.scalajs.js /** * Timeout Handle * @author lawrence.daniels@gmail.com */ @js.native trait Timeout extends js.Object { /** * Indicates whether the timeout has been called * @return true, if the timeout has already been...
scalajs-io/nodejs
app/common/src/main/scala/io/scalajs/nodejs/timers/Timeout.scala
Scala
apache-2.0
695
/* * Copyright (c) 2014 koiroha.org. * All sources and related resources are available under Apache License 2.0. * http://www.apache.org/licenses/LICENSE-2.0.html */ package org.asterisque import org.specs2.Specification // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
torao/asterisque
core-scala/src/test/scala/org/asterisque/PrioritySpec.scala
Scala
apache-2.0
1,068
package bytecode.model abstract class ElementValue case class ConstValueIndex(constValueIndex: Integer) extends ElementValue case class EnumConstValue(typeNameIndex: Integer, constNameIndex: Integer) case class ClassInfoIndex(classInfoIndex: Integer) extends ElementValue case class AnnotationValue(annotationValue: An...
AndrewHancock/scala-bytecode-disassembler
src/main/scala/bytecode/model/Annotation.scala
Scala
apache-2.0
520
package operations.network.analysis import models.Tag import operations.persistance.Neo4j import scala.collection.mutable.ListBuffer object Metrics { private def numberOfTagsRelatedTo(tagName1: String, tagName2: String): Long = { val query1 = """match (t1:Tag)-[:`models.RelatedTagsEdge`]-(n:Tag)-[:`mod...
QuietOne/StackExchangeAnalysis
src/main/scala/operations/network/analysis/Metrics.scala
Scala
artistic-2.0
4,195
/* * Copyright (c) 2016 BBC Design and Engineering * * 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, copy, modify,...
bbc/scheduler-plus
src/main/scala/bbc/schedulerplus/SchedulerPlusActor.scala
Scala
mit
2,007
package scodec.protocols package mpeg package transport package psi import shapeless.Typeable case class TableBuildingError(tableId: Int, message: String) extends MpegError class TableBuilder private (cases: Map[Int, List[TableSupport[_]]]) { def supporting[T <: Table](implicit ts: TableSupport[T]): TableBuilder ...
scodec/scodec-protocols
src/main/scala/scodec/protocols/mpeg/transport/psi/TableBuilder.scala
Scala
bsd-3-clause
2,004
package jsky.app.ot.plugin import edu.gemini.pot.sp.{ISPObservation, SPObservationID, ISPProgram} import edu.gemini.sp.vcs2.VcsFailure import edu.gemini.spModel.core.SPProgramID import scalaz._ trait OtViewerService { def registerView(view: AnyRef) def unregisterView(view: AnyRef) def load(pid: SPProgramID): \...
spakzad/ocs
bundle/jsky.app.ot.plugin/src/main/scala/jsky/app/ot/plugin/OtViewerService.scala
Scala
bsd-3-clause
565
/** * 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 ...
bikash/guacamole
src/main/scala/org/hammerlab/guacamole/filters/FishersExactTest.scala
Scala
apache-2.0
1,236
// Reverse a list. // Example: // scala> reverse(List(1, 1, 2, 3, 5, 8)) // res0: List[Int] = List(8, 5, 3, 2, 1, 1) object P05 { def reverse[A](items: List[A]): List[A] = { def f(from: List[A], to: List[A]): List[A] = from match { case Nil => to case _ => f(from.tail, from.head :: to) } f(...
pilu/scala99
src/main/scala/P05.scala
Scala
mit
338
/** * Copyright (C) 2011 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...
brunobuzzi/orbeon-forms
xforms/jvm/src/main/scala/org/orbeon/oxf/xforms/processor/handlers/xhtml/XXFormsDynamicHandler.scala
Scala
lgpl-2.1
5,197
/* sbt -- Simple Build Tool * Copyright 2010 Mark Harrah */ package sbt package std import sbt.internal.util.Types._ import sbt.internal.util.{ ~>, AList, DelegatingPMap, RMap } import Task._ import TaskExtra.{ all, existToAny } import Execute._ object Transform { def fromDummy[T](original: Task[T])(action: => T)...
mdedetrich/sbt
tasks/standard/src/main/scala/sbt/std/System.scala
Scala
bsd-3-clause
2,598
/* * 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 ...
witgo/spark
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveInlineTables.scala
Scala
apache-2.0
4,234
package cs1.lx02b import org.scalatest._ import LX02B._ class Test extends FlatSpec with Matchers { }
titech-is-cs115/lecture
test/lx02b-puzzle.scala
Scala
cc0-1.0
104
package sri.core import scala.scalajs.js import scala.scalajs.js.ConstructorTag trait ElementFactoryLegacy { /** * add types to js constructor */ @deprecated("Use getTypedConstructor[Component]", "0.6.0") def getTypedConstructor[P, S](ctor: js.Dynamic, clz: Class[_ <: ReactComponent[P, S]]) = { ctor...
chandu0101/sri
core/src/main/scala/sri/core/ElementFactory.scala
Scala
apache-2.0
7,259
package com.toscaruntime.it.openstack.standalone import com.toscaruntime.it.AbstractSpec import com.toscaruntime.it.TestConstant._ import com.toscaruntime.it.steps.AgentsSteps._ import com.toscaruntime.it.steps.CsarsSteps._ import com.toscaruntime.it.steps.DeploymentsSteps._ import com.toscaruntime.it.util.URLChecker....
vuminhkh/tosca-runtime
test/src/it/scala/com/toscaruntime/it/openstack/standalone/WordpressSpec.scala
Scala
mit
2,005
/* * Copyright 2017 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...
liquidarmour/ct-calculations
src/main/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/ACQ5021.scala
Scala
apache-2.0
1,340
package at.fh.swengb.resifo_android /** * Created by Florian on 05.01.2017. */ case class RegForm(person: Person, zmr:Zmr, reisepass: Reisepass, anmUnterkunft: AnmUnterkunft, hauptwohnsitzBleibt: HauptwohnsitzBleibt, abmUnterkunft: AbmUnterkunft, unterkunftgeber: Unterkunftgeber) extends Seriali...
FlorianReinprecht/resifo-android
app/src/main/scala/at/fh/swengb/resifo_android/RegForm.scala
Scala
gpl-3.0
468
package core.processing import akka.actor.{ PoisonPill, Actor } import core.HubId import eu.delving.schema.SchemaVersion import models.OrganizationConfiguration import java.util.concurrent.atomic.AtomicBoolean import play.api.Logger import com.yammer.metrics.scala.Instrumented import org.w3c.dom.Node /** * * @autho...
delving/culture-hub
web-core/app/core/processing/RecordIndexer.scala
Scala
apache-2.0
1,486
package au.com.dius.pact.provider.specs2 import java.io.{StringReader, File, InputStream, Reader} import java.util.concurrent.Executors import au.com.dius.pact.model.{FullResponseMatch, RequestResponsePact, PactReader, ResponseMatching} import au.com.dius.pact.provider.sbtsupport.HttpClient import org.specs2.Specific...
Fitzoh/pact-jvm
pact-jvm-provider-specs2/src/main/scala/au/com/dius/pact/provider/specs2/ProviderSpec.scala
Scala
apache-2.0
2,473
package sss.ancillary object Results { trait ResultOrMsg[R] { def orErrMsg[E](msg: => E): Result[R, E] } type Result[+R, E] = Either[R, Errors[E]] type Errors[E] = List[E] type ErrMsg = String type Error[E] = Result[_, E] type OkResult = Either[_, Errors[ErrMsg]] def ok[R](r: R = ()) = Left(r) ...
mcsherrylabs/sss.ancillary
src/main/scala/sss/ancillary/Results.scala
Scala
gpl-3.0
1,759
trait BankAccount { def closeAccount(): Unit def getBalance: Option[Int] def incrementBalance(increment: Int): Option[Int] } protected case class Account(var balance: Option[Int] = Some(0)) extends BankAccount { private def runThreadSafe[A](block: => A): A = this.synchronized(block) override def closeAc...
exercism/xscala
exercises/practice/bank-account/.meta/Example.scala
Scala
mit
672
package code import java.io.File import scala.xml.XML import org.specs.Specification import org.specs.runner.JUnit4 import net.liftweb.common.Full import net.liftweb.util.PCDataXmlParser class XmlSourceSpecsTest extends JUnit4(XmlSourceSpecs) object XmlSourceSpecs extends Specification { "XML Sources" should {...
TopicQuests/IBISLift
src/test/scala/code/XmlSourceSpecs.scala
Scala
apache-2.0
1,644
package org.zouzias.spark.lucenerdd.aws.utils // CAUTION: Do not remove this (sbt-build-info) import org.apache.spark.rdd.RDD import org.apache.spark.sql.SparkSession import org.joda.time.DateTime import org.joda.time.format.DateTimeFormat import org.zouzias.spark.lucenerdd.aws.BuildInfo object Utils { val FuzzyEd...
zouzias/spark-lucenerdd-aws
src/main/scala/org/zouzias/spark/lucenerdd/aws/utils/Utils.scala
Scala
apache-2.0
1,043
package net.fwbrasil.activate object EnumerationValue extends Enumeration { case class EnumerationValue(name: String) extends Val(name) val value1a = EnumerationValue("v1") val value2 = EnumerationValue("v2") val value3 = EnumerationValue("v3") }
xdevelsistemas/activate
activate-test/src/test/scala/net/fwbrasil/activate/EnumerationValue.scala
Scala
lgpl-2.1
263
/* * 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 * distribute...
wvlet/airframe
airframe-parquet/src/main/scala/wvlet/airframe/parquet/ParquetRecordReader.scala
Scala
apache-2.0
6,157
/* * 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
core/src/test/scala/org/apache/spark/deploy/StandaloneDynamicAllocationSuite.scala
Scala
apache-2.0
24,881