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 |
|---|---|---|---|---|---|
// Project: angulate2-examples
// Module:
// Description:
// Copyright (c) 2016. Distributed under the MIT License (see included LICENSE file).
package heroes
import angulate2.ext.inMemoryWebApi.InMemoryDbService
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSExport, ScalaJSDefined}
@JSExport... | jokade/angulate2-examples | heroes/src/main/scala/heroes/HeroesData.scala | Scala | mit | 700 |
package org.vitrivr.adampro.data.index.structures.mi
import org.apache.spark.annotation.Experimental
import org.apache.spark.sql.DataFrame
import org.apache.spark.sql.functions.udf
import org.vitrivr.adampro.config.AttributeNames
import org.vitrivr.adampro.data.datatypes.bitstring.BitString
import org.vitrivr.adampro.... | vitrivr/ADAMpro | src/main/scala/org/vitrivr/adampro/data/index/structures/mi/MIIndex.scala | Scala | mit | 2,648 |
/*
* Copyright 2014 Adam Rosenberger
*
* 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... | arosenberger/nalloc_2.10 | sandbox/src/main/scala/org/nalloc/bitb/kcits/sandbox/memoryusage/ForeachMemoryUsage.scala | Scala | apache-2.0 | 2,374 |
package com.atomist.param
import scala.language.postfixOps
trait ParameterValues {
/**
* Parameters exposed to template. Will include input parameters
* but there may be additional computed or other parameters.
*/
def parameterValues: Seq[ParameterValue]
def parameterValueMap: Map[String, Paramete... | atomist/rug | src/main/scala/com/atomist/param/ParameterValues.scala | Scala | gpl-3.0 | 1,342 |
/*
* 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... | yiheng/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/utils/tf/loaders/Rint.scala | Scala | apache-2.0 | 1,183 |
/*
* Copyright 2011-2018 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | wiacekm/gatling | gatling-app/src/main/scala/io/gatling/app/Selection.scala | Scala | apache-2.0 | 5,707 |
package colossus.examples
import java.net.InetSocketAddress
import akka.util.ByteString
import colossus.core.{IOSystem, ServerContext, ServerRef}
import colossus.protocols.http.HttpMethod._
import colossus.protocols.http.UrlParsing._
import colossus.protocols.http._
import colossus.protocols.redis._
import colossus.s... | tumblr/colossus | colossus-examples/src/main/scala/colossus.examples/HttpExample.scala | Scala | apache-2.0 | 1,891 |
/*
* 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 ... | trueyao/spark-lever | mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala | Scala | apache-2.0 | 8,047 |
/*
* 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 ... | chuckchen/spark | resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/DecommissionSuite.scala | Scala | apache-2.0 | 8,449 |
package no.netcompany.testdatagen.generators.app
// Copyright (C) 2014 Lars Reed -- GNU GPL 2.0 -- see LICENSE.txt
import no.netcompany.testdatagen.aggreg.{SequenceOf, SomeNulls, TwoFromFunction, TwoWithPredicate, UniqueWithFallback}
import no.netcompany.testdatagen.dsl.DslLikeSyntax
import no.netcompany.testdatagen.... | lre-mesan/testdata | src/test/scala/no/netcompany/testdatagen/generators/app/Sykmelding.scala | Scala | gpl-2.0 | 1,213 |
/*
* 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 ... | hhbyyh/spark | core/src/test/scala/org/apache/spark/scheduler/OutputCommitCoordinatorSuite.scala | Scala | apache-2.0 | 14,637 |
package reactiverogue.core
import play.api.libs.json.Json
object JsonFormats {
implicit val latLongFormat = Json.format[LatLong]
implicit val commentFormat = Json.format[OneComment]
}
| whisklabs/reactiverogue | reactiverogue-record-dsl/src/test/scala/reactiverogue/core/JsonFormats.scala | Scala | apache-2.0 | 192 |
/*
* 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 ... | MLnick/spark | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala | Scala | apache-2.0 | 11,275 |
package com.twitter.util.validation.internal.validators.size
import jakarta.validation.constraints.Size
import jakarta.validation.{ConstraintValidator, ConstraintValidatorContext}
/**
* Intended to work exactly like [[org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForArray]]
* but for Sc... | twitter/util | util-validator/src/main/scala/com/twitter/util/validation/internal/validators/size/SizeValidatorForIterable.scala | Scala | apache-2.0 | 1,410 |
package com.jackbeasley.wordFind
class Word(
word:String,
coordinates:Array[(Int,Int)]
) extends Iterable[Word]{
// Define outer class for iterator nested subclass
outer =>
/*
* Gets the string of the word
*/
def getWord:String = word
/*
* Gets an array of the coordinates
*/
def getCoordin... | jackbeasley/wordFind | src/main/scala/Word.scala | Scala | mit | 1,433 |
package special.collection {
import scalan._
trait Sizes extends Base { self: Library =>
import Coll._;
import Size._;
import WOption._;
import WRType._;
@Liftable @WithMethodCallRecognizers trait Size[Val] extends Def[Size[Val]] {
implicit def eVal: Elem[Val];
def dataSize: Ref[Lon... | ScorexFoundation/sigmastate-interpreter | library/src/main/scala/special/collection/SizesUnit.scala | Scala | mit | 1,491 |
/*
* 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 ... | bdrillard/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/ContinuousRecordEndpoint.scala | Scala | apache-2.0 | 2,711 |
/**
* Copyright 2011-2017 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | MykolaB/gatling | gatling-recorder/src/main/scala/io/gatling/recorder/config/RecorderMode.scala | Scala | apache-2.0 | 1,193 |
package com.progfun.worksheet
//import reflect.runtime.universe._
object TestFor {
def main(args: Array[String]) {
val list = List("A", "B", "C")
//reify(for (e <- list; x = e; y = e) { println(x + y)})
// reify(for (e <- list; x = e; y = e) {
// println(x + y)
// })
}
}
| lispmind/progfun | src/main/scala/com/progfun/worksheet/TestFor.scala | Scala | mit | 298 |
import EasyJson.{EasyJson, ParseError}
import org.scalatest._
class RootObjectTest extends FlatSpec {
"EasyJson" should "be able to load an empty list" in {
EasyJson.loads("[]")
}
it should "be able to load an empty object" in {
EasyJson.loads("{}")
}
it should "be able to load list... | Dentosal/EasyJson | src/test/scala/Parse.scala | Scala | mit | 6,047 |
package org.scalatest.examples.featurespec.composingbeforeandaftereach
import org.scalatest._
import collection.mutable.ListBuffer
trait Builder extends BeforeAndAfterEach { this: Suite =>
val builder = new StringBuilder
override def beforeEach() {
builder.append("ScalaTest is designed to ")
super.befor... | hubertp/scalatest | examples/src/main/scala/org/scalatest/examples/featurespec/composingbeforeandaftereach/ExampleSpec.scala | Scala | apache-2.0 | 1,363 |
package dotty.tools
package dotc
package transform
import core._
import Flags._, Symbols._, Contexts._, Scopes._, Decorators._, Types.Type
import NameKinds.DefaultGetterName
import NullOpsDecorator._
import collection.immutable.BitSet
import scala.annotation.tailrec
/** A module that can produce a kind of iterator (`... | lampepfl/dotty | compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala | Scala | apache-2.0 | 9,418 |
package org.scalameta.paradise
package typechecker
import org.scalameta.paradise.converters.Converter
trait Expanders extends Converter { self: AnalyzerPlugins =>
import scala.{Seq => _}
import scala.collection.immutable.Seq
import scala.util.control.ControlThrowable
import global._
import analyzer._
imp... | olafurpg/paradise | plugin/src/main/scala/org/scalameta/paradise/typechecker/Expanders.scala | Scala | bsd-3-clause | 13,306 |
// Jubatus: Online machine learning framework for distributed environment
// Copyright (C) 2014-2015 Preferred Networks and Nippon Telegraph and Telephone Corporation.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License version 2.1... | jubatus/jubatus-on-yarn | jubatusonyarn/jubatus-on-yarn-test/src/main/scala/us/jubat/yarn/test/TestTool.scala | Scala | lgpl-2.1 | 4,646 |
package breeze.stats
import util.Sorting
import breeze.util.{quickSelectImpl, quickSelect}
/*
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://... | calippo/breeze | math/src/main/scala/breeze/stats/DescriptiveStats.scala | Scala | apache-2.0 | 12,198 |
abstract class Monoid[A] {
def add(x: A, y: A): A
def unit: A
}
def sum[A](xs: List[A])(m: Monoid[A]): A =
if (xs.isEmpty) m.unit
else m.add(xs.head, /*start*/sum(xs.tail)(m)/*end*/)
//A | ilinum/intellij-scala | testdata/typeInference/bugs5/SCL4163G.scala | Scala | apache-2.0 | 195 |
package org.macrogl
import scala.language.dynamics
import scala.collection._
class Program(val name: String)(val shaders: Program.Shader*)(implicit val gl: Macrogl)
extends Handle {
private var ptoken = Token.Program.invalid
private val result = new Array[Int](1)
private val floatData = Macrogl.createFloatD... | storm-enroute/macrogl | src/macrogl/scala/org/macrogl/Program.scala | Scala | bsd-3-clause | 5,509 |
val x: List[List[_]] = null
val y: List[List[T] forSome {type T}] = x
//True | triggerNZ/intellij-scala | testdata/typeConformance/existential/InnerPlaceholderBack.scala | Scala | apache-2.0 | 76 |
package com.twitter.finagle.stats
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.concurrent.{Eventually, IntegrationPatience}
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class InMemoryStatsReceiverTest extends FunSuite
with Eventually
with IntegrationP... | BuoyantIO/twitter-util | util-stats/src/test/scala/com/twitter/finagle/stats/InMemoryStatsReceiverTest.scala | Scala | apache-2.0 | 3,200 |
package beer
import scala.io.Source
/**
* @author milos
*/
case class InteractiveConfig(
model : String = "default",
threads : Int = 1
)
object InteractiveApp {
def main(args:Array[String]) : Unit = {
val parser = new scopt.OptionParser[InteractiveConfig]("BEER") {
head("BEER", "2.0")
... | qingsongma/blend | tools/beer_2.0/src/beer/InteractiveApp.scala | Scala | gpl-3.0 | 2,082 |
package otherscope {
class Foo {
// a method that takes a function and a string, and passes the string into
// the function, and then executes the function
def exec(f:(String) => Unit, name: String) {
f(name)
}
}
}
object ClosureExample extends App {
var hello = ... | fbartnitzek/notes | 7_languages/Scala/ClosureExample.scala | Scala | apache-2.0 | 678 |
package be.angelcorp.glsl.glsl410
import be.angelcorp.glsl._
@Glsl
trait FS410Core extends Glsl410 {
"#version 410 core"
// in
@GlslSymbolOnly def gl_FragCoord: vec4 = ???
@GlslSymbolOnly def gl_FrontFacing: bool = ???
@GlslSymbolOnly def gl_ClipDistance: Array[float] = ???
@GlslSymbolOnly def gl_PointCo... | AODtorusan/scala-glsl | core/src/main/scala/be/angelcorp/glsl/glsl410/FS410Core.scala | Scala | mit | 595 |
/**
* Copyright 2014-2015 Martin Cooper
*
* 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 ... | martincooper/scala-datatable | src/main/scala/com/github/martincooper/datatable/DataTable.scala | Scala | apache-2.0 | 3,628 |
package cn.edu.neu.chiewen.cknn.site
import cn.edu.neu.chiewen.cknn.server.Server
class NeighboredSiteDisk(val mid: Long, val id: Int, val position: (Double, Double)) extends NeighboredSite {
def getNeighbors(implicit server: Server) = server.get(mid).getNeighbors
override def hashCode = (41 * (41 + mid)).toInt
... | chiewen/CkNN | CkNN/src/main/scala/cn/edu/neu/chiewen/cknn/site/NeighboredSiteDisk.scala | Scala | gpl-2.0 | 466 |
package net.fwbrasil.activate.storage.relational.async
import net.fwbrasil.activate.storage.Storage
import com.github.mauricio.async.db.postgresql.pool.PostgreSQLConnectionFactory
import com.github.mauricio.async.db.Configuration
import net.fwbrasil.activate.storage.StorageFactory
import net.fwbrasil.activate.Activate... | avramirez/activate | activate-jdbc-async/src/main/scala/net/fwbrasil/activate/storage/relational/async/AsyncPostgreSQLStorage.scala | Scala | lgpl-2.1 | 1,898 |
/**
* Copyright 2015 Frank Austin Nothaft
*
* 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 ... | fnothaft/fig | src/main/scala/net/fnothaft/fig/models/ReferencePromoter.scala | Scala | apache-2.0 | 5,336 |
package scala.collection.immutable
import org.junit.Assert._
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
@RunWith(classOf[JUnit4])
class ListMapTest {
@Test
def t7445(): Unit = {
val m = ListMap(1 -> 1, 2 -> 2, 3 -> 3, 4 -> 4, 5 -> 5)
assertEquals(ListMap(2 -> 2,... | martijnhoekstra/scala | test/junit/scala/collection/immutable/ListMapTest.scala | Scala | apache-2.0 | 1,709 |
package coursier.launcher
import java.nio.file.{Files, Path}
object DummyNativeGenerator extends Generator[Parameters.DummyNative] {
def generate(parameters: Parameters.DummyNative, output: Path): Unit =
Files.write(output, Array.emptyByteArray)
}
| alexarchambault/coursier | modules/launcher/src/main/scala/coursier/launcher/DummyNativeGenerator.scala | Scala | apache-2.0 | 256 |
package repo
import com.ovoenergy.comms.model.email._
import org.scalatest.{FlatSpec, Matchers}
import org.scalacheck.Shapeless._
import org.scalacheck._
import _root_.utilities.TestGenerators
import aws.s3.AmazonS3ClientWrapper.{S3Config, S3FileDetails}
class EmailBodyRepoSpec extends FlatSpec with Matchers with Tes... | ovotech/comms-audit-log | test/repo/EmailBodyRepoSpec.scala | Scala | mit | 4,775 |
package demo.pages
import com.acework.js.components.bootstrap._
import demo.examples.ContainedModal
import demo.examples.util.CodeContent
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
import org.scalajs.dom.window
/**
* Created by weiyin on 16/03/15.
*/
object Modals {
val exampl... | weiyinteo/scalajs-react-bootstrap | demo/src/main/scala/demo/pages/Modals.scala | Scala | mit | 7,665 |
/*
* 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/main/scala/org/apache/spark/deploy/history/HistoryPage.scala | Scala | apache-2.0 | 4,137 |
package de.bookstore.main.traits
trait Export {
def isEncoded() = println(encode)
def encode: Boolean;
def exportCSV(): String;
} | JohannesDienst/Scala_JAXEnter_Tutorial | src/main/scala/de/bookstore/main/traits/Export.scala | Scala | mit | 136 |
/*
* Copyright 2012 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | Comcast/money | money-core/src/main/scala/com/comcast/money/core/concurrent/TraceFriendlyExecutionContextExecutor.scala | Scala | apache-2.0 | 1,922 |
//
// Scaled - a scalable editor extensible via JVM languages
// http://github.com/scaled/scaled/blob/master/LICENSE
package scaled.impl
import com.sun.nio.file.SensitivityWatchEventModifier
import java.nio.file.{FileSystems, Path, WatchKey, WatchEvent}
import java.util.concurrent.ConcurrentHashMap
import scala.annot... | swhgoon/scaled | editor/src/main/scala/scaled/impl/WatchManager.scala | Scala | bsd-3-clause | 3,148 |
/*
* 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/vat-registration-frontend | test/services/BankAccountReputationServiceSpec.scala | Scala | apache-2.0 | 4,382 |
package p1 {
private[p1] case class Foo(a: Int)
object Foo {
def m = 1
}
}
package p2 {
class Test {
p1.Foo.m
p1.Foo(42)
}
}
| scala/scala | test/files/pos/t11273-case-class-access-boundary.scala | Scala | apache-2.0 | 148 |
package com.mesosphere.universe.v2.model
import io.circe.Decoder
import io.circe.Encoder
import io.circe.syntax._
case class UniverseVersion(override val toString: String) extends AnyVal
object UniverseVersion {
implicit val decodeV2UniverseVersion: Decoder[UniverseVersion] =
Decoder.decodeString.map(UniverseV... | dcos/cosmos | cosmos-common/src/main/scala/com/mesosphere/universe/v2/model/UniverseVersion.scala | Scala | apache-2.0 | 440 |
package troy
package cql.parser
import org.scalatest.{ FlatSpec, Matchers }
import troy.cql.ast._
import troy.cql.ast.dml.Insert.NamesValues
object ParserTestUtils extends FlatSpec with Matchers {
def parseSchema(statement: String) =
handleParseFailure(CqlParser.parseSchema(statement))
def parseSchemaAs[T](s... | schemasafe/troy | cql-parser/src/test/scala/troy/cql/parser/ParserTestUtils.scala | Scala | apache-2.0 | 1,904 |
/*
* 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 | connector/src/main/scala/quasar/qscript/analysis/Cardinality.scala | Scala | apache-2.0 | 5,168 |
/*
* 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 ... | nkhuyu/Spark-SQL-on-HBase | src/main/scala/org/apache/spark/sql/hbase/HBaseSQLParser.scala | Scala | apache-2.0 | 10,492 |
package org.geneticmachine.navigation.generators
import org.geneticmachine.navigation._
import scala.util.Random
final case class RandomWalkGenerator(lineLenDelta: Int, minLineLen: Int)
(size: Point) extends LabyrinthGenerator {
override def toString: String = s"RandomWalkGener... | maxim-borisyak/genetic-machine | src/main/scala/org/geneticmachine/navigation/generators/RandomWalkGenerator.scala | Scala | mit | 1,045 |
/*
* 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... | wangyixiaohuihui/spark2-annotation | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InMemoryFileIndex.scala | Scala | apache-2.0 | 12,903 |
/*
* 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 ... | avulanov/scalable-deeplearning | src/test/scala/scaladl/tensor/TypedClassTest.scala | Scala | apache-2.0 | 1,738 |
package jsky.app.ot.gemini.editor.auxfile
import edu.gemini.auxfile.api.AuxFile
import edu.gemini.spModel.core.SPProgramID
import scala.swing.event.Event
object AuxFileState {
sealed trait ActionStatus
case object Busy extends ActionStatus
case object Idle extends ActionStatus
def apply(pid: SPProgramID): A... | spakzad/ocs | bundle/jsky.app.ot/src/main/scala/jsky/app/ot/gemini/editor/auxfile/AuxFileState.scala | Scala | bsd-3-clause | 585 |
package controllers
import javax.inject.Inject
import models.Widget
import play.api.data._
import play.api.i18n._
import play.api.mvc._
import scala.collection._
/**
* The classic WidgetController using MessagesAbstractController.
*
* Instead of MessagesAbstractController, you can use the I18nSupport trait,
* w... | play2-maven-plugin/play2-maven-test-projects | play28/scala/forms-example/app/controllers/WidgetController.scala | Scala | apache-2.0 | 2,285 |
package scala.collection.immutable
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
import org.openjdk.jmh.infra.Blackhole
import scala.util.Random
@BenchmarkMode(Array(Mode.AverageTime))
@Fork(1)
@Threads(1)
@Warmup(iterations = 6)
@Measurement(iterations = 6)
@OutputTimeUnit(TimeUnit.NANO... | scala/scala | test/benchmarks/src/main/scala/scala/collection/immutable/BitSetBenchmark.scala | Scala | apache-2.0 | 811 |
/*
* 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 ... | bwsw/sj-platform | core/sj-crud-rest/src/test/scala-2.12/com/bwsw/sj/crud/rest/instance/starter/InstanceStarterTestSuit.scala | Scala | apache-2.0 | 22,251 |
/**
* © 2019 Refinitiv. 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 required by applicable l... | dudi3001/CM-Well | server/cmwell-data-tools/src/main/scala/cmwell/tools/data/sparql/TokenReporter.scala | Scala | apache-2.0 | 7,066 |
package com.arcusys.valamis.lesson.scorm.model.manifest
/**
* An activity from the activity tree. Can be a content organization, container activity or leaf activity
* @param id Manifest-wide unique identifier of activity
* @param title Title of the activity
* @param paren... | igor-borisov/valamis | valamis-scorm-lesson/src/main/scala/com/arcusys/valamis/lesson/scorm/model/manifest/Activity.scala | Scala | gpl-3.0 | 6,847 |
package collins
package callbacks
import java.beans.{PropertyChangeEvent, PropertyChangeListener, PropertyChangeSupport}
import play.api.{Application, Configuration, Logger, Plugin}
import play.api.Play.current
import play.api.libs.concurrent._
import akka.actor.Props
class CallbackManagerPlugin(app: Application) ext... | Shopify/collins | app/collins/callbacks/CallbackManagerPlugin.scala | Scala | apache-2.0 | 2,163 |
package com.rumblesan.scalaexperiments.scalaztypes.monadtransformers.readertoption
import scalaz._, Scalaz._, Kleisli._
object ScalazReaderTOptionExample {
type ReaderTO[C, R] = ReaderT[Option, C, R]
case class Config(value: Int)
def addValue(input: Int):ReaderTO[Config, Int] = kleisli{c =>
Some(c.value ... | lachatak/scala-experiments | src/main/scala/ScalazTypes/MonadTransformers/ReaderT.scala | Scala | bsd-2-clause | 475 |
package salve.combatlog
import skadistats.clarity.`match`.Match
import skadistats.clarity.model.{StringTable, GameEventDescriptor, GameEvent}
import scala.collection.JavaConversions._
import skadistats.clarity.Clarity
import skadistats.clarity.parser.Profile
import java.lang.reflect.Field
case class LogEvent(id: Int,... | stoke/Salve | src/main/scala/LogEntry.scala | Scala | mit | 1,790 |
/*
* Copyright 2016 Coursera 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... | vkuo-coursera/naptime | naptime/src/main/scala/org/coursera/naptime/router2/AttributesProvider.scala | Scala | apache-2.0 | 2,622 |
package cgta.oscala
package util
//////////////////////////////////////////////////////////////
// Copyright (c) 2014 Ben Jackman
// All Rights Reserved
// please contact ben@jackman.biz
// for licensing inquiries
// Created by bjackman @ 6/18/14 4:30 PM
//////////////////////////////////////////////////////////////
... | cgta/open | oscala/shared/src/main/scala/cgta/oscala/util/OBinarySearch.scala | Scala | mit | 6,844 |
package org.jetbrains.plugins.scala
package codeInspection.booleans
import com.intellij.codeInspection.{ProblemHighlightType, ProblemsHolder}
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.codeInspection.{AbstractFixOnPsiElement, AbstractInspection}
im... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/codeInspection/booleans/DoubleNegationInspection.scala | Scala | apache-2.0 | 3,584 |
package justin.db.kryo
import java.util.UUID
import com.esotericsoftware.kryo.io.{Input, Output}
import com.esotericsoftware.kryo.{Kryo, Serializer}
import justin.db.Data
import justin.db.actors.protocol._
object StorageNodeReadResponseSerializer extends Serializer[StorageNodeReadResponse] {
private object Discri... | speedcom/JustinDB | justin-core/src/main/scala/justin/db/kryo/StorageNodeReadResponseSerializer.scala | Scala | apache-2.0 | 1,695 |
/*
* 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 ... | duynguyen/incubator-openwhisk | tests/src/test/scala/whisk/core/loadBalancer/test/LoadBalancerServiceObjectTests.scala | Scala | apache-2.0 | 6,618 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2013-2014 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition... | digimead/digi-TABuddy-desktop | part-core-ui/src/main/scala/org/digimead/tabuddy/desktop/core/ui/block/builder/StackTabBuilder.scala | Scala | agpl-3.0 | 6,670 |
package services.support
import java.time.{Clock, ZoneId, Instant}
class FixedClock(val instant: Instant, val zone: ZoneId) extends Clock {
override def millis = instant.toEpochMilli
override def getZone = zone
override def withZone(zoneId: ZoneId) = {
instant.atZone(zoneId)
this
}
}
| phdezann/connectus | connectus-backend/test/services/support/FixedClock.scala | Scala | mit | 303 |
package com.overviewdocs.db_evolution_applier
import com.typesafe.config.{Config,ConfigFactory}
import java.sql.{Connection,SQLException}
import java.util.logging.{Logger,Level}
import org.flywaydb.core.Flyway
import org.postgresql.ds.PGSimpleDataSource
/** Simple program to run Play evolutions.
*
* This can't be... | overview/overview-server | db-evolution-applier/src/main/scala/com/overviewdocs/db_evolution_applier/Main.scala | Scala | agpl-3.0 | 3,469 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/iht-frontend | app/iht/controllers/filter/AnyAssetsController.scala | Scala | apache-2.0 | 3,024 |
/**
* Copyright (C) 2014 Kaj Magnus Lindberg (born 1979)
*
* 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.
... | debiki/debiki-server-old | test/debiki/NotificationGeneratorSpec.scala | Scala | agpl-3.0 | 14,921 |
import akka.actor.ActorSystem
import akka.event.{LoggingAdapter, Logging}
import akka.http.scaladsl.Http
import akka.http.scaladsl.client.RequestBuilding
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.marshalling.ToResponseMarshallable
import akka.http.scaladsl.model._
impo... | script2013/my-akka-http-microservice | src/main/scala/AkkaHttpMicroservice.scala | Scala | apache-2.0 | 3,375 |
/*
* 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 ... | manishgupta88/incubator-carbondata | integration/spark-common/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala | Scala | apache-2.0 | 38,402 |
/*
* 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 ... | akopich/spark | streaming/src/main/scala/org/apache/spark/streaming/ui/UIUtils.scala | Scala | apache-2.0 | 6,576 |
package net.sansa_stack.inference.spark.rules.plan
import scala.collection.mutable
import org.apache.jena.graph.{Node, Triple}
import net.sansa_stack.inference.utils.RuleUtils
/**
* @author Lorenz Buehmann
*/
class SQLQuery(triple: Triple) {
val selectedVars = mutable.Set[Node]()
def selectableVariables: ... | SANSA-Stack/SANSA-RDF | sansa-inference/sansa-inference-spark/src/main/scala/net/sansa_stack/inference/spark/rules/plan/SQLQuery.scala | Scala | apache-2.0 | 423 |
/*
* 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/core/src/main/scala/org/apache/spark/sql/execution/stat/StatFunctions.scala | Scala | apache-2.0 | 13,676 |
package smarthouse.restapi.models
import java.util.Date
case class DeviceEntity(id: Option[Long] = None, name: String, identifier: String, created: Date) {
require(!name.isEmpty, "name.empty")
require(!identifier.isEmpty, "identifier.empty")
} | andrewobukhov/smart-house | src/main/scala/smarthouse/restapi/models/DeviceEntity.scala | Scala | mit | 249 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/iht-frontend | app/iht/controllers/filter/EstimateController.scala | Scala | apache-2.0 | 4,167 |
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/ZoomConditionRepository.scala | Scala | gpl-3.0 | 1,142 |
package org.jetbrains.plugins.scala
package actions
import java.util.Properties
import com.intellij.ide.IdeView
import com.intellij.ide.actions.{CreateFileFromTemplateDialog, CreateTemplateInPackageAction}
import com.intellij.ide.fileTemplates.{FileTemplate, FileTemplateManager, JavaTemplateUtil}
import com.intellij.... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/actions/NewScalaTypeDefinitionAction.scala | Scala | apache-2.0 | 6,544 |
package unfiltered.request
object Path {
def unapply[T](req: HttpRequest[T]) = Some(req.requestURI.substring(req.contextPath.length))
}
object Seg {
def unapply(path: String): Option[List[String]] = path.split("/").toList match {
case "" :: rest => Some(rest) // skip a leading slash
case all => Some(all)
... | softprops/Unfiltered | library/src/main/scala/request/paths.scala | Scala | mit | 325 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* See the LICENCE.txt 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... | Webtrends/wookiee-metrics | src/main/scala/com/webtrends/harness/component/metrics/UpdatableGauge.scala | Scala | apache-2.0 | 1,132 |
/*
* Copyright 2017 Max Meldrum
*
* 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 w... | Max-Meldrum/SpaceTurtle | agent/src/test/scala/HttpSpec.scala | Scala | apache-2.0 | 1,532 |
/*
* Copyright 2016 org.NLP4L
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | fubuki/nlp4l | app/org/nlp4l/lucene/ISearcher.scala | Scala | apache-2.0 | 2,439 |
package com.oni.udash
import com.oni.udash.views.BindingDemoViewPresenter
import com.oni.udash.views.ComingSoonViewPresenter
// import com.oni.udash.views.MainHomeViewPresenter
import com.oni.udash.views.DemoStylesViewPresenter
import com.oni.udash.views.ErrorViewPresenter
import com.oni.udash.views._
import com.oni.u... | ObjectNirvana/oni-web | frontend/src/main/scala/com/oni/udash/StatesToViewPresenterDef.scala | Scala | epl-1.0 | 1,222 |
val l = List("a", "bb", "ccc")
/*start*/l zip (l map (_.length))/*end*/
//List[(String, Int)] | ilinum/intellij-scala | testdata/typeInference/bugs2/SCL2152.scala | Scala | apache-2.0 | 93 |
/*
* Copyright 2020 ABSA Group Limited
*
* 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... | AbsaOSS/spline | persistence/src/main/scala/com/arangodb/internal/InternalArangoDatabaseOps.scala | Scala | apache-2.0 | 2,582 |
package com.eevolution.context.dictionary.domain.api.service
import com.eevolution.context.dictionary._
import com.eevolution.context.dictionary.domain.model.ReplicationOrganizationAccess
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you ... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/service/ReplicationOrganizationAccessService.scala | Scala | gpl-3.0 | 1,277 |
/*
* Copyright 2016 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600e/v3/E30.scala | Scala | apache-2.0 | 822 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.3
* @date Sun Feb 16 21:30:20 EST 2014
* @see LICENSE (MIT style license file).
*/
package apps.process
import collection.mutable.ListBuffer
import scalation.process._
import scalatio... | NBKlepp/fda | scalation_1.3/scalation_models/src/main/scala/apps/process/Traffic.scala | Scala | mit | 3,838 |
class Raw_1[T]{
def raw(): Raw_1[_] = { new Raw_1[String] { def t() = "" } }
def t(): T
}
class X extends Raw_1[X] {
override def t() = this
def exxx = 0
}
object Test extends App {
def c(s: X) = {
val raw = s.raw
raw.t.exxx
}
c(new X())
}
| scala/scala | test/files/neg/t8244c.scala | Scala | apache-2.0 | 265 |
/*
* Copyright (c) 2012 Michael Rose
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this work except in compliance with the License.
* You may obtain a copy of the License in the LICENSE file, or at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... | Xorlev/Simon | simon-http-server/src/main/scala/com/xorlev/simon/util/HeaderUtil.scala | Scala | apache-2.0 | 1,833 |
package com.dt.scala.dataset
/**
* Author: Wang Jialin
* Contact Information:
* WeChat: 18610086859
* QQ: 1740415547
* Email: 18610086859@126.com
* Tel: 18610086859
*/
object List_FirstOrder_Ops {
def main(args: Array[String]) {
println(List (1,2,3,4) ::: List (4,5,6,7,8) ::: List (10,11... | slieer/scala-tutorials | src/main/scala/com/dt/scala/dataset/List_FirstOrder_Ops.scala | Scala | apache-2.0 | 1,450 |
package enums
import enumeratum.values.{IntEnum, IntEnumEntry}
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
import slick.lifted.Isomorphism
class ValueEnumIsomorphismTests extends AnyFunSuite with Matchers {
sealed abstract class IntGreeting(val value: Int) extends IntEnu... | theiterators/kebs | slick/src/test/scala/enums/ValueEnumIsomorphismTests.scala | Scala | mit | 838 |
/**
* Copyright 2015 Otto (GmbH & Co KG)
*
* 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... | utzwestermann/schedoscope | schedoscope-core/src/main/scala/org/schedoscope/scheduler/driver/DriverRunState.scala | Scala | apache-2.0 | 2,353 |
// These are meant to be typed into the REPL. You can also run
// scala -Xnojline < repl-session.scala to run them all at once.
import scala.io.Source
def readWord(iter: BufferedIterator[Char]) = {
val builder = new StringBuilder
while (iter.hasNext && !Character.isWhitespace(iter.head))
builder += iter.next(... | P7h/ScalaPlayground | Scala for the Impatient/examples/ch09/sec02/repl-session.scala | Scala | apache-2.0 | 530 |
/*
* Copyright (c) 2014-2015 by its authors. Some rights reserved.
* See the project homepage at: http://www.monifu.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://... | virtualirfan/monifu | monifu/shared/src/main/scala/monifu/reactive/observables/LiftOperators2.scala | Scala | apache-2.0 | 18,908 |
/*
* Copyright 2013 Maurício Linhares
*
* Maurício Linhares licenses this file to you 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 ... | carlosFattor/postgresql-async | postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/messages/backend/AuthenticationMessage.scala | Scala | apache-2.0 | 792 |
package com.googlecode.kanbanik.builders
import org.bson.types.ObjectId
import com.googlecode.kanbanik.model.Board
import com.googlecode.kanbanik.model.Project
import com.googlecode.kanbanik.commons._
import com.googlecode.kanbanik.dtos.{ProjectDto => NewProjectDto}
class ProjectBuilder {
def buildDto(project: Pro... | kanbanik/kanbanik | kanbanik-server/src/main/scala/com/googlecode/kanbanik/builders/ProjectBuilder.scala | Scala | apache-2.0 | 1,046 |
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.