code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package com.imadethatcow.hipchat.common.caseclass
import com.imadethatcow.hipchat.common.HipchatValueObject
case class From(id: Long, links: FromLinks, mention_name: String, name: String) extends HipchatValueObject
case class FromLinks(self: String) extends HipchatValueObject
| poweld/hipchat-scala | src/main/scala/com/imadethatcow/hipchat/common/caseclass/From.scala | Scala | mit | 279 |
package rescala.parrp
class Backoff(val initialBackoff: Long = 100L * 1000L, val maxBackoff: Long = 10L * 1000L * 1000L, val factor: Double = 1.2D) {
var currentBackoff = initialBackoff
def backoff(): Unit = {
if (currentBackoff < 1000000L) {
val start = System.nanoTime()
while (System.nanoTime() <... | volkc/REScala | Main/jvm/src/main/scala/rescala/parrp/Backoff.scala | Scala | apache-2.0 | 578 |
package io.transwarp.midas.constant.rapidminer
/**
* Created by liusheng on 5/23/16.
*/
import java.util
import io.transwarp.midas.constant.midas.ColumnTypes
object TypeMap {
val map = new util.HashMap[String, String]()
map.put("nominal", ColumnTypes.Nominal)
map.put("text", ColumnTypes.Nominal)
map.put("... | transwarpio/rapidminer | api-driver/src/main/scala/io/transwarp/midas/constant/rapidminer/TypeMap.scala | Scala | gpl-3.0 | 825 |
/*
* 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... | zhangxiaoli73/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/mkldnn/SoftMax.scala | Scala | apache-2.0 | 6,530 |
package es.upm.oeg.pnk.actions
import es.upm.oeg.pnk.validators.WordValidator
import org.apache.spark.mllib.feature.Word2VecModel
import org.simmetrics.StringMetrics
/**
* Created by cbadenes on 13/08/15.
*/
object SimilarityFinder {
val WORD2VEC_THRESOLD = 0.6 //0.5,0.6
val SMITH_WATERMAN_THRESOLD = 0.7... | cbadenes/pnk | src/main/scala/es/upm/oeg/pnk/actions/SimilarityFinder.scala | Scala | gpl-2.0 | 1,778 |
package com.campudus.tableaux.helper
import com.campudus.tableaux.helper.IdentifierFlattener._
import org.junit.Assert._
import org.junit.Test
import org.skyscreamer.jsonassert.{JSONAssert, JSONCompareMode}
import org.vertx.scala.core.json.Json
class IsMultiLanguageValueTest {
@Test
def containsMultiLanguageValu... | campudus/tableaux | src/test/scala/com/campudus/tableaux/helper/IdentifierFlattenerTest.scala | Scala | apache-2.0 | 6,719 |
/*
* 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 ... | kimoonkim/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes/InitContainerResourceStagingServerSecretPlugin.scala | Scala | apache-2.0 | 2,482 |
package com.danielasfregola.twitter4s.http.clients.rest.friends.parameters
import com.danielasfregola.twitter4s.http.marshalling.Parameters
private[twitter4s] final case class FriendParameters(user_id: Option[Long],
screen_name: Option[String],
... | DanielaSfregola/twitter4s | src/main/scala/com/danielasfregola/twitter4s/http/clients/rest/friends/parameters/FriendParameters.scala | Scala | apache-2.0 | 532 |
package org.nedervold.grammareditor.models
import java.util.concurrent.TimeUnit
import scala.swing.Reactor
import org.scalatest.FlatSpec
import org.scalatest.DoNotDiscover
@DoNotDiscover
class DebouncingModelSpec extends FlatSpec {
behavior of "a DebouncingModel"
/*
* All of these tests are problematic i... | nedervold/GrammarEditor | src/test/scala/org/nedervold/grammareditor/models/DebouncingModelSpec.scala | Scala | apache-2.0 | 4,480 |
/*
* MIT License
*
* Copyright (c) 2016 Gonçalo Marques
*
* 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, ... | gonmarques/slick-repo | src/test/scala/com/byteslounge/slickrepo/test/db2/DB2LongVersionedRepositoryTest.scala | Scala | mit | 1,355 |
package com.aurelpaulovic.fiit.ec_dstm.net.commands
case class Foo () extends Command {
override def apply(c: Command) {
println("apply foo")
}
} | AurelPaulovic/ec_dstm | src/main/scala/com/aurelpaulovic/fiit/ec_dstm/net/commands/Foo.scala | Scala | lgpl-3.0 | 153 |
/*
* 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/releaser | src/main/scala/uk/gov/hmrc/releaser/Versions.scala | Scala | apache-2.0 | 2,482 |
/*
* 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... | hmost1/incubator-toree | communication/src/main/scala/org/apache/toree/communication/socket/SocketRunnable.scala | Scala | apache-2.0 | 2,092 |
package test
import tarjan.Graph
import tarjan.Node
import tarjan.Tarjan
object Test {
def main(args: Array[String]): Unit = {
val tarjan = new Tarjan(buildExampleGraph)
print(tarjan.findComponents())
}
def buildExampleGraph (): Graph[String] = {
val graph = new Graph[String]()
val n1 = new ... | ordinarygithubuser/TarjanAlgorithm | src/test/Test.scala | Scala | mit | 665 |
import scala.language.dynamics // originally used the flag -language:dynamics in t5040.flags, .flags are currently ignored
abstract class Prova2 extends Dynamic {
def applyDynamic(m: String)(): Unit
private def privateMethod() = println("private method")
}
object Test extends App {
val prova= new Prova2 {
de... | som-snytt/dotty | tests/run/t5040.scala | Scala | apache-2.0 | 404 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | indhub/mxnet | scala-package/examples/src/main/scala/org/apache/mxnetexamples/imclassification/TrainMnist.scala | Scala | apache-2.0 | 8,668 |
package benchmarks
import org.HdrHistogram.Histogram
import scala.annotation.tailrec
//runMain benchmarks.InterThreadVolatileLatency
object InterThreadVolatileLatency {
val iterations = 100 * 1000 * 1000
@volatile var ping = -1
@volatile var pong = -1
def main(args: Array[String]) = {
var i = 5
whil... | haghard/streams-recipes | src/main/scala/benchmarks/InterThreadVolatileLatency.scala | Scala | apache-2.0 | 1,412 |
/**
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.http.util
import scala.annotation.tailrec
import scala.collection.immutable
/**
* INTERNAL API
*/
private[http] class EnhancedString(val underlying: String) extends AnyVal {
/**
* Splits the underlying string into the seg... | bblfish/akka.http.model.Uri | akka.UriJS/src/main/scala/akka/http/util/EnhancedString.scala | Scala | apache-2.0 | 4,333 |
package aos.kafka
import kafka.producer.Partitioner
class MemberIdPartitioner extends Partitioner[MemberIdLocation] {
def partition(data: MemberIdLocation, numPartitions: Int): Int = {
(data.location.hashCode % numPartitions)
}
}
| xuzhikethinker/t4f-data | pubsub/kafka/src/main/scala/aos/kafka/MemberIdPartitioner.scala | Scala | apache-2.0 | 242 |
package blaze.techempower.benchmark
import java.net.InetSocketAddress
import java.nio.ByteBuffer
import java.nio.charset.StandardCharsets.UTF_8
import org.http4s.blaze.http._
import org.http4s.blaze.http.HttpServerStageConfig
import org.http4s.blaze.http.http1.server.Http1ServerStage
import org.http4s.blaze.pipeline.... | treefrogframework/FrameworkBenchmarks | frameworks/Scala/blaze/src/main/scala/Main.scala | Scala | bsd-3-clause | 1,688 |
package scalaxy
import scala.language.dynamics
import scala.language.implicitConversions
import scala.language.experimental.macros
import scala.reflect.ClassTag
import scala.reflect.NameTransformer
import scala.reflect.macros.blackbox.Context
/**
Syntactic sugar to instantiate Java beans with a very Scala-friendly... | nativelibs4java/Scalaxy | Beans/src/main/scala/scalaxy/beans.scala | Scala | bsd-3-clause | 3,900 |
object Test {
val LIMIT = 10
def test1 {
var d = 2
var i = 0 // avoid infinite loops
while (d < LIMIT && i < LIMIT) {
lazy val b = d + 1
d = b
i += 1
println("test1: " + d)
}
}
def test2 {
var d = 2
var i = 0
while (true) {
lazy val b = d + 1
d =... | felixmulder/scala | test/files/run/t3877.scala | Scala | bsd-3-clause | 1,236 |
/*
* Copyright 2009 Ilja Booij
*
* This file is part of GarminTrainer.
*
* GarminTrainer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any lat... | chmandrade/garmintrainer | src/test/scala/nl/iljabooij/garmintrainer/model/TrackTest.scala | Scala | gpl-3.0 | 2,117 |
package com.nekogata.backlogger.application.query.project
import com.nekogata.backlogger.domain.project.{Project, ProjectRepository}
import scala.scalajs.js
trait ProjectQuery {
val projectRepository: ProjectRepository
import js.JSConverters._
def all(): js.Array[js.Any] = projectRepository.getAll().map((p) =... | Shinpeim/BackLogger | scala/src/main/scala/com/nekogata/backlogger/application/query/project/ProjectQuery.scala | Scala | mit | 428 |
/***********************************************************************
* Copyright (c) 2013-2017 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... | ronq/geomesa | geomesa-fs/geomesa-fs-tools/src/main/scala/org/locationtech/geomesa/fs/tools/ingest/UpdateMetadataCommand.scala | Scala | apache-2.0 | 1,396 |
package notebook.front
import scala.util.Random
import scala.xml.{NodeSeq, UnprefixedAttribute, Null}
import play.api.libs.json._
import com.vividsolutions.jts.geom.Geometry
import org.wololo.geojson.GeoJSON
import notebook._
import notebook.JsonCodec._
import notebook.front.widgets.magic
import notebook.front.widgets... | antonkulaga/spark-notebook | modules/common/src/main/scala/notebook/front/widgets/package.scala | Scala | apache-2.0 | 647 |
package com.example.akka.add
import akka.actor.ActorRef
import akka.http.scaladsl.server.{Directives, Route}
import akka.pattern.ask
import akka.util.Timeout
import com.example.akka.DefaultJsonFormats
import com.example.akka.add.AddActor._
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotat... | pjfanning/swagger-akka-http-sample | src/main/scala/com/example/akka/add/AddService.scala | Scala | apache-2.0 | 1,859 |
package tastytest
class CurriedCtor[A,B](val a: A)(val s: String)(val b: B)
| scala/scala | test/tasty/run/src-3/tastytest/CurriedCtor.scala | Scala | apache-2.0 | 77 |
package com.twitter.finagle.memcached.replication
import _root_.java.lang.{Boolean => JBoolean, Long => JLong}
import com.twitter.conversions.time._
import com.twitter.finagle.builder.{Cluster, ClientBuilder, ClientConfig}
import com.twitter.finagle.Group
import com.twitter.finagle.memcached._
import com.twitter.finag... | firebase/finagle | finagle-memcached/src/main/scala/com/twitter/finagle/memcached/replication/ReplicationClient.scala | Scala | apache-2.0 | 18,948 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 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 of t... | digimead/digi-TABuddy-desktop | part-logic/src/main/scala/org/digimead/tabuddy/desktop/logic/command/package.scala | Scala | agpl-3.0 | 2,823 |
package knot.data.bufferPools
import java.nio.ByteOrder
import knot.data.buffers.FixedBuffer
import org.scalatest.FunSpec
import org.scalatest.Matchers._
class UnsafeArrayBufferPoolSpec extends FunSpec {
describe("UnsafeArrayBufferPool") {
it("borrow empty pool") {
val pool = UnsafeArrayBufferPool(128, 1... | defvar/knot | knot-data/src/test/scala/knot/data/bufferPools/UnsafeArrayBufferPoolSpec.scala | Scala | mit | 1,179 |
/*
* Sentilab SARE: a Sentiment Analysis Research Environment
* Copyright (C) 2013 Sabanci University Sentilab
* http://sentilab.sabanciuniv.edu
*
* This file is part of SARE.
*
* SARE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published b... | musabhusaini/sare | sare-lib/modules/sare-base/src/main/scala/edu/sabanciuniv/sentilab/sare/models/base/document/DocumentLike.scala | Scala | gpl-3.0 | 1,449 |
package org.arnoldc
import scala.collection.mutable
import org.parboiled.errors.ParsingException
import org.objectweb.asm.Opcodes._
case class SymbolTable(upperLevel: Option[SymbolTable], currentMethod: String) {
val FirstSymbolTableAddress = 0
private val variableTable = new mutable.HashMap[String, Integer]()
... | khodges42/DovahkiinC | src/main/scala/org/dovahkiinc/SymbolTable.scala | Scala | apache-2.0 | 2,289 |
/*
* Copyright 2016 Nikolay Donets
*
* 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 ... | nikdon/telepooz | src/main/scala/com/github/nikdon/telepooz/model/Update.scala | Scala | apache-2.0 | 2,677 |
package com.github.radium226.nio
import java.nio.ByteBuffer
import akka.actor.ActorSystem
import akka.stream.javadsl.Flow
import akka.stream.scaladsl.{Keep, Sink, Source}
import akka.stream.{ActorMaterializer, Attributes, FlowShape, Inlet, Outlet}
import akka.stream.stage.{AsyncCallback, GraphStageLogic, GraphStageWi... | radium226/face-recognizer | video-stream/src/test/scala/com/github/radium226/nio/NIOSpec.scala | Scala | gpl-2.0 | 6,025 |
package iterator
class ShapeStorage {
var shapes = new Array[Shape](5)
private var index: Int = 0
def addShape(name: String): Unit = {
shapes(index) = new Shape(index, name)
index += 1
}
} | BBK-PiJ-2015-67/sdp-portfolio | exercises/week10/src/main/scala/iterator/ShapeStorage.scala | Scala | unlicense | 209 |
/*
* Copyright 2001-2014 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... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/ShouldCompileSpec.scala | Scala | apache-2.0 | 5,403 |
package org.scalatest.tools
import java.io.File
import java.util.regex.Matcher.quoteReplacement
import scala.collection.mutable
import scala.xml.XML
import scala.xml.NodeSeq
private[scalatest] case class Durations(file: File) {
val suites = mutable.Set[Suite]()
if (file.exists) {
val durationsXml = XML.load... | vivosys/scalatest | src/main/scala/org/scalatest/tools/Durations.scala | Scala | apache-2.0 | 5,343 |
package com.twitter.inject.thrift.integration.snakeCase
import com.twitter.finatra.thrift.EmbeddedThriftServer
import com.twitter.inject.server.PortUtils
object ExtendedMultiServerDarkTrafficFilterFeatureTest {
protected val clientId = "client123"
protected val darkExtendedSnakeCaseThriftServer =
new Embedded... | twitter/finatra | inject/inject-thrift-client/src/test/scala/com/twitter/inject/thrift/integration/snakeCase/ExtendedMultiServerDarkTrafficFilterFeatureTest.scala | Scala | apache-2.0 | 1,140 |
package tu.model.knowledge.annotator
import tu.model.knowledge.{Probability, KnowledgeURI}
import tu.model.knowledge.primitive.KnowledgeString
import tu.model.knowledge.domain.Concept
/**
* Stores word and it's concepts.
* @author max
* date 2012-05-31
* time: 11:32 PM
*/
case class AnnotatedWor... | keskival/2 | model.knowledge/src/main/scala/tu/model/knowledge/annotator/AnnotatedWord.scala | Scala | gpl-3.0 | 1,573 |
package com.microsoft.azure.documentdb.spark
import org.apache.spark.annotation.DeveloperApi
import scala.language.implicitConversions
/**
* :: DeveloperApi ::
*
* A helper containing the sealed `DefaultsTo` trait which is used to determine the default type for a given method.
*
* @since 1.0
*/
@Develop... | khdang/azure-documentdb-spark | src/main/scala/com/microsoft/azure/documentdb/spark/DefaultHelper.scala | Scala | mit | 2,843 |
/*
* 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 ... | chenc10/Spark-PAF | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIService.scala | Scala | apache-2.0 | 3,595 |
/*
* 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 ... | WindCanDie/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/shuffle/ContinuousShuffleSuite.scala | Scala | apache-2.0 | 14,646 |
package net.walend.disentangle.scalagraph.semiring
import scala.util.Random
import scalax.collection.immutable.Graph
import scalax.collection.GraphPredef._
import scalax.collection.GraphEdge.DiEdge
/**
* Create various types of graphs.
*
* @author dwalend
* @since v0.0.0
*/
object GraphFactory {
/**
* Crea... | dwalend/Disentangle | toScalaGraph/src/test/scala/net/walend/disentangle/scalagraph/semiring/GraphFactory.scala | Scala | mit | 1,090 |
package cobase.group
import java.util.UUID
import javax.inject.Inject
import cobase.DBTableDefinitions
import play.api.db.slick._
import slick.driver.JdbcProfile
import slick.jdbc.GetResult
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
/**
* Give access to the user object... | Cobase/cobase-pro | app/cobase/group/GroupDAO.scala | Scala | mit | 1,651 |
package io.kevinlee.skala.math
import io.kevinlee.skala.testing.PredefForTesting
import org.scalatest.WordSpec
/**
* @author Lee, SeongHyun (Kevin)
* @since 2015-03-22
*/
@SuppressWarnings(Array("org.wartremover.warts.NonUnitStatements"))
class BigDecimalsSpec extends WordSpec {
import PredefForTesting._
"Big... | Kevin-Lee/skala | src/test/scala/io/kevinlee/skala/math/BigDecimalsSpec.scala | Scala | mit | 22,990 |
//
// OrcLexical.scala -- Scala class OrcLexical
// Project OrcScala
//
// $Id: OrcLexical.scala 3023 2012-04-20 02:55:50Z laurenyew $
//
// Created by jthywiss on Jun 1, 2010.
//
// Copyright (c) 2011 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the l... | laurenyew/cOrcS | src/orc/compile/parse/OrcLexical.scala | Scala | bsd-3-clause | 6,350 |
object Problem {
def main(args: Array[String]) {
println(Math.pow(1 to 100 sum, 2).toInt - ((1 to 100).map(x => x * x) sum))
}
}
| Jiri-Kremser/euler | 006/Problem.scala | Scala | gpl-2.0 | 138 |
object Macros {
def foo(x: String): Unit = macro Impls.fooObjectString
def foo(x: Int): Unit = macro Impls.fooObjectInt
def foo(x: Boolean): Unit = println("fooObjectBoolean")
}
class Macros {
def foo(x: String): Unit = macro Impls.fooClassString
def foo(x: Int): Unit = macro Impls.fooClassInt
def foo(x: B... | som-snytt/dotty | tests/disabled/macro/run/macro-expand-overload/Macros_Test_2.scala | Scala | apache-2.0 | 521 |
/*
* 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/annotator/JawaAnnotator.scala | Scala | epl-1.0 | 1,645 |
package com.ubirch.avatar.model.rest.device
import java.util.UUID
import com.ubirch.avatar.model.rest.MessageVersion
import com.ubirch.util.uuid.UUIDUtil
import org.joda.time.DateTime
import org.json4s._
/**
* Created by derMicha on 28/10/16.
*
* @param version verison Id which identifies the... | ubirch/ubirch-avatar-service | model-rest/src/main/scala/com/ubirch/avatar/model/rest/device/TransformedDeviceMessage.scala | Scala | apache-2.0 | 1,512 |
package spark.broadcast
import java.util.BitSet
import spark._
/**
* Used to keep and pass around information of peers involved in a broadcast
*/
private[spark] case class SourceInfo (hostAddress: String,
listenPort: Int,
totalBlocks: Int = SourceInfo.UnusedParam,
... | koeninger/spark | core/src/main/scala/spark/broadcast/SourceInfo.scala | Scala | bsd-3-clause | 1,026 |
package Concurrency
import Concurrency.Actors.UrlActor
import Concurrency.CaseClasses.{CalculateDuration, PrintSize}
import Concurrency.Loaders.PageLoader
import akka.actor.{ActorSystem, Props}
object MyApp extends App{
val urls = List(
"http://mastermindzh.com/",
"http://linfinity.nl",
"http://go8.nl"... | Mastermindzh/Seven-Languages-in-Seven-Weeks | Scala/Day 3/src/Concurrency/MyApp.scala | Scala | mit | 1,156 |
import akka.actor.{Actor, Props}
import akka.event.Logging
import com.pi4j.io.gpio._
/**
* Actor class to simulate a relay hooked to a GPIO pin. Send the actor a Boolean to control whether the relay is
* sent a high or low signal.
*/
object RelayActor {
/**
* Create a props object to init the actor
* ... | jasoncwik/garage-thermostat | src/main/scala/Relay.scala | Scala | mit | 1,199 |
import scala.quoted._
object Macros {
inline def (inline self: StringContext) xyz(args: => String*): String = ${impl('self, 'args)}
private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = {
self match {
case '{ StringContext($parts: _*) } =>
'{ ... | som-snytt/dotty | tests/run-macros/i6253/quoted_1.scala | Scala | apache-2.0 | 410 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/ExpandCodeGenerator.scala | Scala | apache-2.0 | 2,653 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.pubsub
import java.io.NotSerializableException
import akka.NotUsed
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.NoSerializationVerificationNeeded
import akka.pattern.ask
import akka.s... | lagom/lagom | pubsub/scaladsl/src/main/scala/com/lightbend/lagom/scaladsl/pubsub/PubSubRef.scala | Scala | apache-2.0 | 4,287 |
/*
* 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/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuiteBase.scala | Scala | apache-2.0 | 55,951 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/test/scala/org/apache/carbondata/integration/spark/testsuite/binary/TestBinaryDataType.scala | Scala | apache-2.0 | 75,088 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | rmihael/squants | shared/src/test/scala/squants/photo/LuminousEnergySpec.scala | Scala | apache-2.0 | 2,450 |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... | elastic/elasticsearch-hadoop | spark/sql-30/src/main/scala/org/elasticsearch/spark/sql/ScalaEsRow.scala | Scala | apache-2.0 | 1,902 |
/*
* 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... | fjsc/sparta | serving-api/src/main/scala/com/stratio/sparta/serving/api/actor/DriverActor.scala | Scala | apache-2.0 | 2,609 |
/*
* 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... | cheeseng/scalatest | scalatest/src/main/scala/org/scalatest/matchers/Matcher.scala | Scala | apache-2.0 | 112,049 |
/*
* 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 ... | dotunolafunmiloye/spark | core/src/main/scala/org/apache/spark/storage/BlockManagerId.scala | Scala | apache-2.0 | 3,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 may... | fluetm/kafka | core/src/main/scala/kafka/server/DelayedFetch.scala | Scala | apache-2.0 | 6,666 |
/**
* 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... | ollie314/kafka | core/src/main/scala/kafka/controller/KafkaController.scala | Scala | apache-2.0 | 84,989 |
package com.bwsw.cloudstack.pulse.influx
import scala.collection._
/**
* Created by Ivan Kudryavtsev on 27.07.17.
*/
object QueryBuilder {
def apply() = new QueryBuilder
}
class QueryBuilder {
def select: Select = new Select
}
class Expr {
override def toString: String = super.toString
}
class WhereExpr... | bwsw/cs-pulse-server | src/main/scala-2.12/com/bwsw/cloudstack/pulse/influx/QueryBuilder.scala | Scala | apache-2.0 | 2,089 |
package ch.ninecode.model
import com.esotericsoftware.kryo.Kryo
import com.esotericsoftware.kryo.Serializer
import com.esotericsoftware.kryo.io.Input
import com.esotericsoftware.kryo.io.Output
import org.apache.spark.sql.Row
import ch.ninecode.cim.CIMClassInfo
import ch.ninecode.cim.CIMContext
import ch.ninecode.cim.... | derrickoswald/CIMScala | CIMReader/src/main/scala/ch/ninecode/model/PowerSystemStabilizerDynamics.scala | Scala | mit | 215,077 |
package example
object Main extends App {
println(Lists.max(List(1, 3, 2)))
}
| huajianmao/learning | coursera/bigdata/week01/example/src/main/scala/example/Main.scala | Scala | mit | 82 |
package org.typedsolutions.aws.kinesis.converters
import com.amazonaws.services.kinesis.model.{DescribeStreamResult => UnderlyingDescribeStreamResult}
import com.amazonaws.services.kinesis.model.{Shard => UnderlyingShard}
import com.amazonaws.services.kinesis.model.{HashKeyRange => UnderlyingHashKeyRange}
import com.a... | mattroberts297/akka-kinesis | src/main/scala/org/typedsolutions/aws/kinesis/converters/FromAwsKinesis.scala | Scala | mit | 3,645 |
/*
* scala-swing (https://www.scala-lang.org)
*
* Copyright EPFL, Lightbend, Inc., contributors
*
* 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... | scala/scala-swing | src/main/scala/scala/swing/Orientation.scala | Scala | apache-2.0 | 581 |
/*
* 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 ... | ahnqirage/spark | resource-managers/kubernetes/core/src/test/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocatorSuite.scala | Scala | apache-2.0 | 8,297 |
/**
* 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 not... | guozhangwang/kafka | core/src/test/scala/integration/kafka/api/SaslPlaintextConsumerTest.scala | Scala | apache-2.0 | 1,386 |
package se.blea.flexiconf
import se.blea.flexiconf.parser.gen.SchemaParser.DirectiveListContext
/** Not all data can be carried on the stack, so we have an additional context object that carries this state */
private[flexiconf] case class SchemaVisitorContext(var groupsByNode: Map[DefaultSchemaNode, Map[String, Dire... | thetristan/flexiconf | flexiconf-core/src/main/scala/se/blea/flexiconf/SchemaVisitorContext.scala | Scala | mit | 765 |
package com.softwaremill.bootzooka.service.data
case class EntryJson(id: String, var text: String, var author: String, var entered: String)
| umitunal/bootzooka | backend/src/main/scala/com/softwaremill/bootzooka/service/data/EntryJson.scala | Scala | apache-2.0 | 141 |
object Test {
def update(index: Int, value: Int): Unit = { }
def foo(): Unit = {
this(<ref>index = 1) = 2
}
} | JetBrains/intellij-scala | scala/scala-impl/testdata/resolve/failed/namedArgument/SCL13063.scala | Scala | apache-2.0 | 120 |
package ch.epfl.bbp.uima.topicmodels.dca
import java.io.File
import java.util.regex.PatternSyntaxException
import scala.Array.canBuildFrom
import scala.collection.immutable.HashMap
import scala.io.Source
import org.slf4j.LoggerFactory
import ch.epfl.bbp.uima.topicmodels.mallet.MalletUtils
/**
* A collection of fun... | BlueBrain/bluima | modules/bluima_topic_models/src/main/scala/ch/epfl/bbp/uima/topicmodels/dca/DCAFiles.scala | Scala | apache-2.0 | 6,409 |
package fpinscala.testing
import org.junit.runner.RunWith
import org.scalacheck.{Gen => SCGen, Prop => SCProp, Test => SCTest}
import org.scalatest.FlatSpec
import org.scalatest.prop.PropertyChecks
import fpinscala.state.RNG
import org.scalatest.BeforeAndAfterEach
import Prop._
import fpinscala.parallelism.Par
@RunWi... | fpinscala-muc/fpinscala-abo64 | exercises/src/test/scala/fpinscala/testing/GenSpec.scala | Scala | mit | 8,624 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | goldmedal/spark | core/src/test/scala/org/apache/spark/ui/UISuite.scala | Scala | apache-2.0 | 16,041 |
/*
* @author Philip Stutz
*
* Copyright 2012 University of Zurich
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* U... | hicolour/signal-collect | src/test/scala/com/signalcollect/features/SnapshotSpec.scala | Scala | apache-2.0 | 2,422 |
package com.googlecode.kanbanik.commands
import com.googlecode.kanbanik.builders.ClassOfServiceBuilder
import com.googlecode.kanbanik.db.HasEntityLoader
import com.googlecode.kanbanik.messages.ServerMessages
import com.googlecode.kanbanik.dtos.{PermissionType, ErrorDto, EmptyDto, ClassOfServiceDto}
import com.googleco... | gudtago/kanbanik | kanbanik-server/src/main/scala/com/googlecode/kanbanik/commands/DeleteClassOfServiceCommand.scala | Scala | apache-2.0 | 1,643 |
package org.bitcoins.core.script.bitwise
import org.bitcoins.core.script.constant._
import org.bitcoins.core.script.result.ScriptErrorInvalidStackOperation
import org.bitcoins.core.script.{ExecutedScriptProgram, ScriptProgram}
import org.bitcoins.core.util.TestUtil
import org.scalatest.{FlatSpec, MustMatchers}
/**
... | bitcoin-s/bitcoin-s-core | core-test/src/test/scala/org/bitcoins/core/script/bitwise/BitwiseInterpreterTest.scala | Scala | mit | 3,927 |
/*
* 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 ... | tejasapatil/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/ShuffleExchangeExec.scala | Scala | apache-2.0 | 15,425 |
package com.idyria.osi.ooxoo.db.tests
import com.idyria.osi.ooxoo.model.ModelBuilder
import com.idyria.osi.ooxoo.model.producers
import com.idyria.osi.ooxoo.model.producer
import com.idyria.osi.ooxoo.model.out.markdown.MDProducer
import com.idyria.osi.ooxoo.model.out.scala.ScalaProducer
import com.idyria.osi.ooxoo.cor... | richnou/ooxoo-core | ooxoo-db-examples/src/main/scala/com/idyria/osi/ooxoo/db/tests/TryJPAModel.xmodel.scala | Scala | agpl-3.0 | 822 |
package com.oglowo.callfire.entity
case class PhoneNumberConfiguration(callFeature: Option[PhoneNumberFeature],
textFeature: Option[PhoneNumberFeature],
inboundCallConfiguration: Option[InboundCallConfiguration[_]]) | oGLOWo/callfire-scala-client | src/main/scala/com/oglowo/callfire/entity/PhoneNumberConfiguration.scala | Scala | apache-2.0 | 288 |
package argonaut.derive
import shapeless.Witness
// Put under the argonaut.derive namespace, not to pollute argonaut, for lack of a better namespace around
trait Widen[S] {
type T
def to(s: S): T
def from(t: T): Option[S]
}
// Non subtyping widen: Symbol (the way shapeless does it)
class SubTypingWiden[S, T0... | fthomas/argonaut-shapeless | core/src/main/scala/argonaut/derive/Widen.scala | Scala | bsd-3-clause | 1,744 |
package com.thangiee.lolhangouts.ui.core
import android.view.{View, ViewGroup}
import com.thangiee.lolhangouts.ui.utils._
import org.scaloid.common.{TagUtil, TraitViewGroup}
trait CustomView extends TraitViewGroup[ViewGroup] with TagUtil {
self: ViewGroup =>
override def basis: ViewGroup = self
protected def p... | Thangiee/LoL-Hangouts | src/com/thangiee/lolhangouts/ui/core/CustomView.scala | Scala | apache-2.0 | 1,127 |
package controllers
import java.util.UUID
import com.google.inject.AbstractModule
import com.mohiva.play.silhouette.api.{ Environment, LoginInfo }
import com.mohiva.play.silhouette.test._
import models.User
import net.codingwell.scalaguice.ScalaModule
import org.specs2.execute.{ ErrorException, FailureException }
imp... | mohiva/play-silhouette-seed | test/controllers/ApplicationControllerSpec.scala | Scala | apache-2.0 | 3,045 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | ddworak/monix | monix-execution/shared/src/main/scala/monix/execution/CancelableFuture.scala | Scala | apache-2.0 | 16,116 |
object Test {
class X(i: Int)
implicit def int2x(i: Int): X = new X(i)
val x: X = Byte.MinValue
}
| densh/dotty | tests/pos/implicits.scala | Scala | bsd-3-clause | 108 |
//
// CounterProxy.scala -- Scala trait CounterProxyManager
// Project PorcE
//
// Created by jthywiss on Aug 15, 2017.
//
// Copyright (c) 2019 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the license terms in
// the LICENSE file found in the project'... | orc-lang/orc | PorcE/src/orc/run/distrib/porce/CounterProxy.scala | Scala | bsd-3-clause | 18,195 |
/*
* 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... | alessandrolulli/reforest | src/main/scala/reforest/data/WorkingData.scala | Scala | apache-2.0 | 2,724 |
package com.ruiandrebatista.dbiocats
import org.scalatest._
import org.scalatest.concurrent.ScalaFutures
import dbio._
import scala.concurrent.ExecutionContext.Implicits._
import slick.driver.H2Driver.api._
import cats.data.WriterT
import cats.std.all._
class WritertSpec extends FlatSpec with DatabaseSupport with Mat... | ragb/dbio-cats | src/test/scala/com/ruiandrebatista/dbiocats/WritertSpec.scala | Scala | apache-2.0 | 864 |
package fpinscala.errorhandling
import org.scalatest.FlatSpec
import org.scalatest.Matchers._
class OptionSpec extends FlatSpec {
import Option._
//4.1
"map" should "return None when when used on a None" in {
None.map(x => x) shouldBe None
}
it should "return a mapped Some when used on a Some" in {
... | onewheelonly/fpinscala | exercises/src/test/scala/fpinscala/errorhandling/OptionSpec.scala | Scala | mit | 3,016 |
/*
* 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... | scala/scala | src/compiler/scala/tools/nsc/transform/Delambdafy.scala | Scala | apache-2.0 | 20,879 |
/*
* 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... | pncampbell/ct-calculations | src/test/scala/uk/gov/hmrc/ct/computations/CP79Spec.scala | Scala | apache-2.0 | 1,349 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monix/monix | monix-eval/jvm/src/test/scala/monix/eval/TaskBlockingSuite.scala | Scala | apache-2.0 | 2,056 |
/*
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 to in writing, software
distr... | lucamilanesio/scalding | scalding-core/src/test/scala/com/twitter/scalding/FileSourceTest.scala | Scala | apache-2.0 | 5,790 |
package akka.cluster.pubsub
import akka.actor.{ActorRef, ActorSystem, Deploy, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider, Props, Stash, Terminated}
import akka.cluster.Cluster
import akka.cluster.pubsub.DistributedPubSubMediator.Internal._
import akka.cluster.pubsub.DistributedPubSubMediator.{Sub... | qqbbyq/controller | opendaylight/md-sal/sal-distributed-datastore/src/main/java/akka/cluster/pubsub/ModifiedDistributedPubSubMediator.scala | Scala | epl-1.0 | 9,356 |
/*
* Part of GDL book_api.
* Copyright (C) 2017 Global Digital Library
*
* See LICENSE
*/
package io.digitallibrary.bookapi.service
import java.time.{LocalDate, ZonedDateTime}
import java.util.UUID
import com.typesafe.scalalogging.LazyLogging
import io.digitallibrary.bookapi.BookApiProperties
import io.digitall... | GlobalDigitalLibraryio/book-api | src/main/scala/io/digitallibrary/bookapi/service/FeedService.scala | Scala | apache-2.0 | 11,681 |
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.