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 io.gatling.core.Predef._
import io.gatling.core.scenario.Simulation
import io.gatling.http.Predef._
import scala.concurrent.duration._
class GetDocumentExt extends Simulation {
val httpConf = http
.baseURL("http://localhost:7474")
.acceptHeader("application/json")
/* Uncomment to see the respons... | maxdemarzi/neo_bench | performance/src/test/scala/GetDocumentExt.scala | Scala | mit | 946 |
/*
* Copyright 2012 The SIRIS Project
*
* 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 applica... | simulator-x/core | src/simx/core/svaractor/SVar.scala | Scala | apache-2.0 | 3,813 |
package org.bitcoins.spvnode
import org.bitcoins.core.config.NetworkParameters
import org.bitcoins.core.protocol.NetworkElement
import org.bitcoins.core.util.Factory
import org.bitcoins.spvnode.headers.NetworkHeader
import org.bitcoins.spvnode.messages.NetworkPayload
import org.bitcoins.spvnode.serializers.RawNetworkM... | bitcoin-s/bitcoin-s-spv-node | src/main/scala/org/bitcoins/spvnode/NetworkMessage.scala | Scala | mit | 1,759 |
/**
* (C) Copyright IBM Corp. 2015, 2016
*
* 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... | SparkTC/spark-netezza | src/test/scala/com/ibm/spark/netezza/DataConversionSuite.scala | Scala | apache-2.0 | 5,602 |
package io.dylemma.spac
/** Marker trait used by `SpacTraceElement.InInput` to extract location information from inputs that cause parsing exceptions.
*
* @group errors
*/
trait HasLocation {
def location: ContextLocation
}
| dylemma/xml-spac | core/src/main/scala/io/dylemma/spac/HasLocation.scala | Scala | mit | 232 |
package auction
import akka.actor._
import akka.util.Timeout
import auction.Notifier.Notify
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.language.postfixOps
import akka.pattern.ask
class NotifierRequest(publisher: ActorRef, notify: Notify) extends Actor {
implicit val timeout = Time... | mjoniak/scala-reactive | src/main/scala/auction/NotifierRequest.scala | Scala | mit | 467 |
package spark.scheduler.cluster
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.HashMap
import spark.Logging
import spark.scheduler.cluster.SchedulingMode.SchedulingMode
/**
* An Schedulable entity that represent collection of Pools or TaskSetManagers
*/
private[spark] class Pool(
... | baeeq/incubator-spark | core/src/main/scala/spark/scheduler/cluster/Pool.scala | Scala | bsd-3-clause | 2,915 |
package io.github.loustler.traitt.mixin
/**
* @author loustler
* @since 09/04/2018
*/
trait Queue[T] {
def get(): T
def put(x: T): Unit
def size: Int
}
| loustler/sKaLa | src/main/scala/io/github/loustler/traitt/mixin/Queue.scala | Scala | apache-2.0 | 165 |
package io.scalajs.npm.mongodb
import scala.scalajs.js
/**
* Delete Write Operation Result
* @author lawrence.daniels@gmail.com
*/
@js.native
trait DeleteWriteOpResult extends js.Object {
/** The raw result returned from MongoDB, field will vary depending on server version. */
var result: DeleteWriteOpResu... | scalajs-io/mongodb | src/main/scala/io/scalajs/npm/mongodb/DeleteWriteOpResult.scala | Scala | apache-2.0 | 867 |
/*
* 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... | monifu/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/ReduceSuite.scala | Scala | apache-2.0 | 2,239 |
package hashedcomputation
import hashedcomputation.Fingerprint.Entry
import org.jetbrains.annotations.{NotNull, Nullable}
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
import scala.util.control.Breaks
import scala.util.control.Breaks.{break, tryBreakable}
object Fingerprint {
final cas... | dominique-unruh/qrhl-tool | hashedcomputation/src/main/scala/hashedcomputation/Fingerprint.scala | Scala | mit | 6,512 |
/*
* This file is part of the "silex" library of helpers for Apache Spark.
*
* Copyright (c) 2015 Red Hat, 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.... | erikerlandson/silex | src/test/scala/com/redhat/et/silex/frame/labeledPointSuite.scala | Scala | apache-2.0 | 2,590 |
package org.bitcoins.core.protocol.ln.channel
import org.bitcoins.core.number.UInt64
import org.bitcoins.crypto.{Factory, NetworkElement}
import scodec.bits.ByteVector
case class ShortChannelId(u64: UInt64) extends NetworkElement {
override def bytes: ByteVector = u64.bytes
val blockHeight: UInt64 = (u64 >> 40) ... | bitcoin-s/bitcoin-s | core/src/main/scala/org/bitcoins/core/protocol/ln/channel/ShortChannelId.scala | Scala | mit | 2,196 |
/*
* Copyright 2014 websudos ltd.
* 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... | websudos/reactiveneo | reactiveneo-dsl/src/test/scala/com/websudos/reactiveneo/client/RestClientSpec.scala | Scala | gpl-2.0 | 3,039 |
def ConfigOut(in: GE) = Out.ar(0, Pan2.ar(Limiter.ar(LeakDC.ar(in))))
def EnvGen_Triangle(dur: GE = 1.0f, level: GE = 1.0f, gate: GE = 1,
levelScale: GE = 1.0f, levelBias: GE = 0.0f, timeScale: GE = 1.0f): GE = {
val mkEnv: Env = Env.triangle(dur = dur, level = level)
EnvGen.ar(mkEnv, gate = gate, levelScal... | Sciss/Grenzwerte | individual_sounds/1820_133.scala | Scala | gpl-3.0 | 1,798 |
package com.iheart.playSwagger
object Domain {
type Path = String
type Method = String
case class Definition( name: String,
properties: Seq[SwaggerParameter],
description: Option[String] = None)
case class SwaggerParameter( name: String,
... | Product-Foundry/play-swagger | src/main/scala/com/iheart/playSwagger/Domain.scala | Scala | apache-2.0 | 614 |
/*
* Copyright 2017 Datamountaineer.
*
* 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... | datamountaineer/stream-reactor | kafka-connect-hbase/src/test/scala/com/datamountaineer/streamreactor/connect/hbase/writers/HbaseReaderHelper.scala | Scala | apache-2.0 | 1,796 |
package com.rklaehn.interval
import java.util.Arrays
import org.scalacheck.{Arbitrary, Properties}
import org.scalacheck.Prop._
import spire.implicits._
import scala.reflect.ClassTag
object QuickArrayMergeCheck extends Properties("QuickArrayMerge") {
implicit val arbitraryArray = implicitly[Arbitrary[Array[Int]]... | non/intervalset | src/test/scala/com/rklaehn/interval/QuickArrayMergeCheck.scala | Scala | apache-2.0 | 1,349 |
package zalgo
import math._
// Code courtesy of Textgrounder: https://bitbucket.org/utcompling/textgrounder
object DistanceUtil {
/** *** Fixed values *****/
val minimum_latitude = -90.0
val maximum_latitude = 90.0
val minimum_longitude = -180.0
val maximum_longitude = 180.0 - 1e-10
// Radius of the e... | itszero/neo4j-astar-example | src/main/scala/zalgo/DistanceUtil.scala | Scala | mit | 4,394 |
/*
Copyright (c) 2009, 2010 Hanno Braun <mail@hannobraun.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 applicable law or... | hannobraun/ScalableDynamics | src/main/scala/com/hannobraun/sd/dynamics/PositionConstraintSolver.scala | Scala | apache-2.0 | 1,622 |
package io.github.mandar2812.dynaml.optimization
import breeze.linalg.{Tensor}
import com.tinkerpop.blueprints.Edge
import com.tinkerpop.frames.EdgeFrame
/**
* Trait for optimization problem solvers.
*
* @tparam K The type indexing the Parameter vector, should be Int in
* most cases.
* @tparam P The ty... | mandar2812/bayeslearn | src/main/scala/io/github/mandar2812/dynaml/optimization/Optimizer.scala | Scala | apache-2.0 | 1,833 |
package blended.updater.config
import com.typesafe.config.ConfigFactory
import org.scalatest.{FreeSpecLike, Matchers}
import scala.util.Success
class ResolvedRuntimeConfigSpec
extends FreeSpecLike
with Matchers {
"A Config with features references" - {
val config = """
|name = name
|versio... | lefou/blended | blended.updater.config/jvm/src/test/scala/blended/updater/config/ResolvedRuntimeConfigSpec.scala | Scala | apache-2.0 | 2,999 |
package unfiltered.request
import scala.util.control.Exception.{ allCatch, catching }
trait DateParser extends (String => java.util.Date)
object DateFormatting {
import java.text.SimpleDateFormat
import java.util.{ Date, Locale, TimeZone }
def format(date: Date) =
new SimpleDateFormat("E, dd MMM yyyy HH:m... | jarin/unfiltered | library/src/main/scala/request/headers.scala | Scala | mit | 8,378 |
/*
* Copyright 2015 Textocat
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... | Denis220795/Textokit | Textokit.PhraseRecognizer/src/main/scala/com/textocat/textokit/phrrecog/parsing/NPParsers.scala | Scala | apache-2.0 | 9,533 |
object exercise2_1 {
def fib(n: Int): Int = {
@annotation.tailrec
def loop(n: Int, prev: Int, current: Int): Int =
if(n == 0) prev
else loop(n-1, current, prev + current)
loop(n, 0, 1)
}
def main(args: Array[String]): Unit = {
for(i <- 0 to 10) println(fib(i))
}
}
| joonjeong/shadow-boxing | fp-in-scala/exercise2/fib.scala | Scala | mit | 302 |
package coursier.core
object Orders {
@deprecated("Will likely be removed at some point in future versions", "2.0.0-RC3")
trait PartialOrdering[T] extends scala.math.PartialOrdering[T] {
def lteq(x: T, y: T): Boolean =
tryCompare(x, y)
.exists(_ <= 0)
}
/** All configurations that each conf... | alexarchambault/coursier | modules/core/shared/src/main/scala/coursier/core/Orders.scala | Scala | apache-2.0 | 7,972 |
/**
* Copyright (c) 2011, Andrew Shewring
* Licensed under the new BSD License (see the LICENSE.txt file for details).
*/
package com.github.ashewring.sbttycho
import java.io.File
object SbtTychoConstants {
val TychoBuildUsage = "\\nUsage:\\ntycho-build <maven arguments>"
val BundleVersionKey = "Bundle-Version"... | ashewring/sbt-tycho | src/main/scala/com/github/ashewring/sbttycho/SbtTychoConstants.scala | Scala | bsd-3-clause | 386 |
/**
* 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 ... | FusionWorks/avocado | avocado-core/src/main/scala/org/bdgenomics/avocado/algorithms/hmm/Aligner.scala | Scala | apache-2.0 | 1,254 |
/*
* 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 ... | gustavoanatoly/samza | samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala | Scala | apache-2.0 | 14,149 |
import scala.language.implicitConversions
trait TripleEqualsSupport:
class Equalizer[L](val leftSide: L)
def convertToEqualizer[T](left: T): Equalizer[T]
trait TripleEquals extends TripleEqualsSupport:
implicit override def convertToEqualizer[T](left: T): Equalizer[T] = new Equalizer(left)
class GraphDB[Id]:
... | dotty-staging/dotty | tests/neg/i11466.scala | Scala | apache-2.0 | 499 |
package com.rasterfoundry.api.user
import com.dropbox.core.DbxSessionStore
import io.circe.generic.JsonCodec
import scala.beans.BeanProperty
import scala.util.Random
import java.util.Base64
@JsonCodec
final case class DropboxAuthRequest(
authorizationCode: String,
redirectURI: String
)
/** Mock a DbxSessio... | raster-foundry/raster-foundry | app-backend/api/src/main/scala/user/DropboxUser.scala | Scala | apache-2.0 | 1,338 |
/*
* -╥⌐⌐⌐⌐ -⌐⌐⌐⌐-
* ≡╢░░░░⌐\\░░░φ ╓╝░░░░⌐░░░░╪╕
* ╣╬░░` `░░░╢┘ φ▒╣╬╝╜ ░░╢╣Q
* ║╣╬░⌐ ` ╤▒▒▒Å` ║╢╬╣
* ╚╣╬░⌐ ╔▒▒▒▒`«╕ ╢╢╣▒
* ╫╬░░╖ .░ ╙╨╨ ╣╣╬░φ ╓φ░╢╢Å
* ╙╢░░░░⌐"░░░╜ ╙Å░░░░⌐░░░░╝`
* ``˚¬ ⌐ ˚˚⌐´
*
* ... | Flipkart/connekt | busybees/src/test/scala/com/flipkart/connekt/busybees/tests/streams/topologies/KafkaBenchmarkTest.scala | Scala | mit | 2,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 ... | scrawford/osgi-embedded-scala | script-engine-tests/src/test/scala/osgi/embedded/scala/JcrFSTest.scala | Scala | apache-2.0 | 5,155 |
package org.scalajs.testinterface.internal
import scala.scalajs.js
import js.annotation.JSName
@JSName("scalajsCom")
object Com extends js.Object {
def init(onReceive: js.Function1[String, Unit]): Unit = js.native
def send(msg: String): Unit = js.native
def close(): Unit = js.native
}
| jmnarloch/scala-js | test-interface/src/main/scala/org/scalajs/testinterface/internal/Com.scala | Scala | bsd-3-clause | 294 |
/*
* Copyright 2015 LG CNS.
*
* 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... | jw0201/scouter | scouter.server/src/scouter/server/db/xlog/XLogDataWriter.scala | Scala | apache-2.0 | 2,808 |
package mdtags
import org.specs2.mutable.Specification
class ListSpec extends Specification {
"A List" should {
"render correctly" in {
list(
"item 1",
"item 2",
"item 3"
).toMarkdown() must equalTo(
"""* item 1
|* item 2
|* item 3""".stripMargin... | timo-schmid/mdtags | src/test/scala/mdtags/ListSpec.scala | Scala | apache-2.0 | 1,397 |
/*
* @author Philip Stutz
*
* Copyright 2014 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... | danihegglin/DynDCO | src/main/scala/com/signalcollect/deployment/DeployableAlgorithm.scala | Scala | apache-2.0 | 821 |
/*
# Copyright 2016 Georges Lipka
#
# 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 wri... | glipka/Easy-React-With-ScalaJS | src/main/scala/com/glipka/easyReactJS/react/ShallowRenderer.scala | Scala | apache-2.0 | 1,173 |
/*
* package.scala
* Definitions of solvers.
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: March 1, 2015
*
* Copyright 2015 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http://www.github.com/p2t2... | scottcb/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/structured/solver/package.scala | Scala | bsd-3-clause | 4,815 |
package circumflex
package orm
import collection.mutable.ListBuffer
/*!# Predicates
`Predicate` is essentially a parameterized expression which yields boolean
value when executed by database.
Predicates are designed to participate in `WHERE` clauses of SQL queries.
*/
trait Predicate extends Expression
object Pred... | inca/circumflex | orm/src/main/scala/predicate.scala | Scala | bsd-2-clause | 5,588 |
/*
* This file is part of the "consigliere" toolkit for sosreport
* and SAR data analytics and visualization.
*
* Copyright (c) 2014 Red Hat, 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 th... | willb/c9e | common/src/main/scala/com/redhat/et/c9e/common/preprocess.scala | Scala | apache-2.0 | 10,358 |
package org.denigma.graphs.ui.views
import org.denigma.binding.extensions._
import org.denigma.binding.messages._
import org.denigma.binding.picklers._
import org.denigma.semantic.storages.Storage
import org.scalajs.spickling.PicklerRegistry
import org.scalax.semweb.rdf.{IRI, Quad, Res}
import org.scalax.semweb.sparql... | antonkulaga/semantic-graph | ui/src/main/scala/org/denigma/graphs/ui/views/GraphStorage.scala | Scala | mpl-2.0 | 935 |
/*
* 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/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Sum.scala | Scala | apache-2.0 | 3,056 |
/*
* 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... | poplav/incubator-toree | scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala | Scala | apache-2.0 | 11,582 |
/*
* 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 | common/scala/src/main/scala/whisk/common/Logging.scala | Scala | apache-2.0 | 9,082 |
package breeze.collection.immutable
/*
Copyright 2009 David Hall, Daniel Ramage
Licensed under the Apache License, Version 2.0 (the "License")
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by ... | scalanlp/breeze | math/src/main/scala_2.11_2.12/breeze/collection/immutable/BinomialHeap.scala | Scala | apache-2.0 | 4,309 |
/*
* Copyright (c) 2016 SnappyData, Inc. 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 ap... | vjr/snappydata | cluster/src/test/scala/org/apache/spark/sql/SingleNodeTest.scala | Scala | apache-2.0 | 5,945 |
/*
* Copyright 2015-2016 IBM Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | xin-cai/openwhisk | common/scala/src/main/scala/whisk/core/entity/ActivationResult.scala | Scala | apache-2.0 | 9,578 |
package app
import javax.ws.rs.{DefaultValue, GET, Path, Produces, QueryParam}
import javax.ws.rs.core.MediaType
@Path("hello")
class Hello {
@GET
@Produces(Array(MediaType.TEXT_PLAIN))
def say(@QueryParam("name") @DefaultValue("world") name: String): String =
s"Hello, $name"
}
| kazuhira-r/javaee7-scala-examples | jersey-standalone-example/src/main/scala/app/Hello.scala | Scala | mit | 291 |
package com.twitter.hello.heroku
import com.codahale.metrics.MetricFilter
import com.google.inject.Stage
import com.twitter.finagle.metrics.MetricsStatsReceiver
import com.twitter.finatra.http.EmbeddedHttpServer
import com.twitter.inject.server.FeatureTest
class HelloWorldStartupTest extends FeatureTest {
override... | syamantm/finatra | examples/hello-world-heroku/src/test/scala/com/twitter/hello/heroku/HelloWorldStartupTest.scala | Scala | apache-2.0 | 716 |
package com.minalien.mffs
import net.minecraftforge.common.config.Configuration
/**
* Stores all configuration data for MFFS.
*/
object ModConfig {
object WorldGen {
var enableMonazitOre = true
var monazitOrePerVein = 8
var monazitOreVeinsPerChunk = 5
var monazitOreMinHeight = 10
var monazitOreMaxHeight... | Vexatos/MFFS | src/main/scala/com/minalien/mffs/ModConfig.scala | Scala | gpl-3.0 | 2,454 |
package com.joshcough.minecraft.examples
import com.joshcough.minecraft.{CommandsPlugin, ListenersPlugin}
import org.bukkit.{Location, Material}
import org.bukkit.block.Block
import org.bukkit.entity.Player
import Material.WOOD_AXE
class WorldEditDemo extends ListenersPlugin with CommandsPlugin {
val corners = col... | joshcough/MinecraftPlugins | examples/src/main/scala/com/joshcough/minecraft/examples/WorldEditDemo.scala | Scala | mit | 1,707 |
class PersonOneLiner(firstName: String, lastName: String);
new PersonOneLiner("Johnny", "Cash");
class Compass {
val directions = List("north" , "east" , "south" , "west" )
var bearing = 0
println("Initial bearing: " + direction)
// uses bearing and prints element in directions list
def direction... | Mastermindzh/Seven-Languages-in-Seven-Weeks | Scala/Day 1/classes.scala | Scala | mit | 1,132 |
package expr
sealed trait Expr
case class Var(name: String) extends Expr
case class Number(num: Double) extends Expr
case class UnOp(operator: String, arg: Expr) extends Expr
case class BinOp(operator: String, left: Expr, right: Expr) extends Expr
| mhotchen/programming-in-scala | src/expr/Expr.scala | Scala | apache-2.0 | 249 |
/*
* 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 ... | nchammas/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala | Scala | apache-2.0 | 34,953 |
package org.jetbrains.plugins.scala.components.libextensions.ui
import java.awt.BorderLayout
import java.awt.event.ActionEvent
import java.util
import java.util.Collections
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.{DialogBuilder, InputValidatorEx, Messages}
import com.intellij.ui._
i... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/components/libextensions/ui/LibExtensionsSettingsPanelWrapper.scala | Scala | apache-2.0 | 6,575 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package base
package patterns
import com.intellij.psi._
import com.intellij.psi.util.PsiModificationTracker
import com.intellij.psi.util.PsiModificationTracker._
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.l... | JetBrains/intellij-scala-historical | src/org/jetbrains/plugins/scala/lang/psi/api/base/patterns/ScPattern.scala | Scala | apache-2.0 | 17,824 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | hlin117/factorie | src/main/scala/cc/factorie/util/StringExtras.scala | Scala | apache-2.0 | 2,303 |
/**
* Copyright (c) 2012 Petr Kozelek <petr.kozelek@gmail.com>
*
* The full copyright and license information is presented
* in the file LICENSE that was distributed with this source code.
*/
package mql.gui.comparer
object Utilities {
def resource(name: String) = ClassLoader.getSystemClassLoader.getResource(na... | footcha/MQL | src/main/scala/mql/gui/comparer/Utilities.scala | Scala | bsd-3-clause | 325 |
/*
* 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 ... | 1ambda/zeppelin | spark/src/main/scala/org/apache/spark/SparkRBackend.scala | Scala | apache-2.0 | 1,435 |
package models.submission
import
scala.concurrent.duration._
import
models.filemanager.FileManager
/**
* Created with IntelliJ IDEA.
* User: Jason
* Date: 11/1/12
* Time: 1:52 PM
*/
object SubmissionFileManager extends FileManager {
override def MyFolderName = "uploads"
override protected de... | NetLogo/SimServer | app/models/submission/SubmissionFileManager.scala | Scala | gpl-2.0 | 799 |
/*
* 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 ... | brad-kaiser/spark | core/src/test/scala/org/apache/spark/util/UtilsSuite.scala | Scala | apache-2.0 | 47,846 |
/*
* 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 | core/src/main/scala/org/apache/spark/ui/WebUI.scala | Scala | apache-2.0 | 8,983 |
// See LICENSE.txt for license details.
package templates
import chisel3._
import chisel3.iotesters.{PeekPokeTester, Driver, ChiselFlatSpec}
import chisel3.testers.BasicTester
import org.scalatest._
import org.scalatest.prop._
/**
* Mem1D test harness
*/
class Mem1DTests(c: Mem1D) extends PeekPokeTester(c) {
step... | stanford-ppl/spatial-lang | spatial/core/resources/chiselgen/template-level/tests/templates/SRAM.scala | Scala | mit | 9,019 |
/*
* 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 ... | eBay/Eagle | eagle-security/eagle-security-userprofile/training/src/test/scala/org/apache/eagle/security/userprofile/daemon/UtilsSpec.scala | Scala | apache-2.0 | 1,977 |
package com.github.cmanou.scrimage.utils.dithering.filters
import org.scalatest.{ OneInstancePerTest, BeforeAndAfter, FunSuite }
import com.sksamuel.scrimage.Image
class BurkesFilterTest extends FunSuite with BeforeAndAfter with OneInstancePerTest {
val original = Image.fromStream(getClass.getResourceAsStream("/ma... | cmanou/scrimage-utils | src/test/scala/com/github/cmanou/scrimage/utils/dithering/filters/BurkesFilterTest.scala | Scala | mit | 593 |
package com.bot4s.telegram.methods
import ParseMode.ParseMode
import com.bot4s.telegram.models.{ Message, ReplyMarkup }
import com.bot4s.telegram.models.ChatId
/**
* Use this method to edit text messages sent by the bot or via the bot (for inline bots).
* On success, if edited message is sent by the bot, the edited... | mukel/telegrambot4s | core/src/com/bot4s/telegram/methods/EditMessageText.scala | Scala | apache-2.0 | 1,953 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/MaximizeSpell.scala | Scala | apache-2.0 | 1,177 |
package com.wavesplatform.state.diffs
import cats._
import com.wavesplatform.BlocksTransactionsHelpers
import com.wavesplatform.block.Block
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.common.utils.EitherExt2
import com.wavesplatform.db.WithDomain
import com.wavesplatform.features.BlockchainF... | wavesplatform/Waves | node/src/test/scala/com/wavesplatform/state/diffs/AssetTransactionsDiffTest.scala | Scala | mit | 21,120 |
package com.sageserpent.plutonium
import java.lang.reflect.{InvocationTargetException, Method}
import com.sageserpent.plutonium.ItemExtensionApi.UniqueItemSpecification
import com.sageserpent.plutonium.Patch.MethodPieces
import scala.reflect.runtime.universe
import scala.reflect.runtime.universe._
import scalaz.{-\\... | sageserpent-open/open-plutonium | src/main/scala/com/sageserpent/plutonium/Patch.scala | Scala | mit | 3,706 |
/*
* 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 | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIService.scala | Scala | apache-2.0 | 5,150 |
package deburnat.transade.gui.north
import swing.{Publisher, Point, event}
import event._
import javax.swing.{JFileChooser, filechooser}
import filechooser.FileNameExtensionFilter
import deburnat.transade.gui.admins.GuiAdmin.{xml, _xml, view, tRead}
import java.io.File
import deburnat.transade.gui.components.MonoText... | deburnatshazem/transade | gui/src/main/scala/deburnat/transade/gui/north/TransFileChooser.scala | Scala | apache-2.0 | 4,241 |
/*
* 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 | docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MySQLIntegrationSuite.scala | Scala | apache-2.0 | 7,057 |
/*
* Copyright 2010 LinkedIn
*
* 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... | tcrayford/hafka | kafka/core/src/test/scala/unit/kafka/integration/ProducerConsumerTestHarness.scala | Scala | bsd-3-clause | 1,593 |
package io.fintrospect.parameters
import com.twitter.finagle.http._
import com.twitter.finagle.http.exp.{Multipart, MultipartDecoder}
import io.fintrospect.ContentTypes.MULTIPART_FORM
import io.fintrospect.util.{Extraction, ExtractionError, ExtractionFailed, Extractor}
import scala.collection.MapView
import scala.uti... | daviddenton/fintrospect | core/src/main/scala/io/fintrospect/parameters/MultiPartFormBody.scala | Scala | apache-2.0 | 1,961 |
package pimpathon.java.util
import java.util.{Calendar, Date}
import pimpathon.PSpec
import pimpathon.any._
import pimpathon.java.util.date._
class DateSpec extends PSpec {
"addDay" in
on(-1, 1, 7).calling(date(2015, 3, 24).addDay).produces(date(2015, 3, 23), date(2015, 3, 25), date(2015, 4, 1))
private def... | stacycurl/pimpathon | src/test/scala/pimpathon/java/util/DateTest.scala | Scala | apache-2.0 | 473 |
import sbt._
import Keys._
import scala.annotation.tailrec
import bintray.Plugin.bintrayPublishSettings
import bintray.Keys.{repository, bintrayOrganization, bintray}
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import com.typesafe.tools.mima.plugin.MimaKeys.{previousArtifact, binaryIssueFilt... | ummels/scala-js | project/Build.scala | Scala | bsd-3-clause | 48,019 |
package worker
import akka.actor.Actor
import akka.actor.ActorLogging
import akka.cluster.pubsub.DistributedPubSub
import akka.cluster.pubsub.DistributedPubSubMediator
class PostProcessor extends Actor with ActorLogging {
val mediator = DistributedPubSub(context.system).mediator
mediator ! DistributedPubSubMedia... | oel/akka-iot-mqtt | src/main/scala/worker/PostProcessor.scala | Scala | lgpl-3.0 | 562 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/test/scala/org/apache/spark/api/python/PythonRDDSuite.scala | Scala | apache-2.0 | 1,919 |
package cache
import db.{Authorization, ResolversDao}
import io.flow.dependency.v0.models.Resolver
import io.flow.util.CacheWithFallbackToStaleData
@javax.inject.Singleton
case class ResolversCache @javax.inject.Inject()(
resolversDao: ResolversDao
) extends CacheWithFallbackToStaleData[String, Option[Resolver]] {
... | flowcommerce/dependency | api/app/cache/ResolversCache.scala | Scala | mit | 539 |
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... | advancedxy/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/booleans/SimplifyBooleanInspection.scala | Scala | apache-2.0 | 6,104 |
package gamelogic
import gameserver.GameServer
import networkcom._
import scala.collection.mutable
import scala.scalajs.js.timers.setTimeout
/**
* A Game Hosted by a server.
* Manages all communications and game states during a game.
*/
class GamePlaying(val gameName: String, val password: Int,
... | sherpal/oh-hell-card-game | server/src/main/scala/gamelogic/GamePlaying.scala | Scala | mit | 7,813 |
package business
import models.{Pastes, Profiles}
/**
* Created by justin on 4/15/15.
*/
trait BaseDaoTrait {
def pastes: Pastes
def profiles: Profiles
}
| maximx1/lecarton | app/business/BaseDaoTrait.scala | Scala | mit | 162 |
package com.twitter.diffy
import com.twitter.diffy.analysis._
import com.twitter.diffy.thriftscala._
import com.twitter.diffy.lifter.JsonLifter
import scala.language.postfixOps
object Renderer {
def differences(diffs: Map[String, String]) =
diffs map { case (k, v) => k -> JsonLifter.decode(v) }
def differenc... | NateChambers/diffy | src/main/scala/com/twitter/diffy/Renderer.scala | Scala | apache-2.0 | 2,237 |
package org.example.remoting
import java.util.concurrent.atomic.AtomicInteger
import akka.actor._
import akka.util.Timeout
import com.typesafe.config.ConfigFactory
import org.example.remoting.RemotingProtocol._
import scala.concurrent.duration._
/**
* Created by kailianghe on 1/18/15.
*/
// http://tersesystems.com... | hekailiang/akka-play | actor-samples/src/main/scala/org/example/remoting/TransformationFrontend.scala | Scala | apache-2.0 | 2,665 |
package scjson.converter
import minitest.*
import scutil.lang.*
import scjson.ast.*
import JsonFormat.given
object CollectionTest extends SimpleTestSuite {
test("special collections should serialize string maps") {
assertEquals(
JsonWriter[Map[String,Int]] convert Map("a" -> 1),
Validated.valid(JsonValue.... | ritschwumm/scjson | modules/converter/src/test/scala/CollectionTest.scala | Scala | bsd-2-clause | 3,417 |
package net.composmin.akkahttp
import org.scalatest.{BeforeAndAfterEach, FunSuite}
/**
* Created by cfegan on 5/06/2016.
*/
class EnvDumperTest extends FunSuite with BeforeAndAfterEach {
override def beforeEach() {
}
override def afterEach() {
}
test("testDumpEnv") {
println(EnvDumper.dumpEnv()... | ComposMin/akka-http-example | src/test/scala/net/composmin/akkahttp/EnvDumperTest.scala | Scala | mit | 329 |
/**********************************************************************************
* Copyright (c) 2011, Monnet Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributi... | monnetproject/kap | gelato/src/main/scala/eu/monnetproject/gelato/statements/GelatoStatement.scala | Scala | bsd-3-clause | 4,397 |
package org.allenai.common
import org.allenai.common.JsonFormats._
import org.allenai.common.testkit.UnitSpec
import spray.json._
import spray.json.DefaultJsonProtocol._
import scala.util.{ Try, Success, Failure }
class JsonFormatsSpec extends UnitSpec {
case class Foo(name: String)
implicit val fooFormat = js... | ryanai3/common | core/src/test/scala/org/allenai/common/JsonFormatsSpec.scala | Scala | apache-2.0 | 1,097 |
package ch.acmesoftware.orientDbScalaDsl
import com.orientechnologies.orient.core.metadata.schema.OType._
import scala.collection.JavaConverters._
class VertexTypeDslSpec extends Spec {
"VertexTypeDsl" should "create vertex type by label" in {
notTx(g => {
g.dsl createVertexType "NoProp"
})
tx(... | acme-software/orientdb-scala-dsl | src/test/scala/ch/acmesoftware/orientDbScalaDsl/VertexTypeDslSpec.scala | Scala | mit | 1,737 |
package domino.configuration_watching
import domino.capsule.CapsuleContext
import org.osgi.framework.{ServiceRegistration, BundleContext}
import domino.scala_osgi_metatype.interfaces.{ObjectClassDefinition, MetaTypeProvider}
import domino.scala_osgi_metatype.builders.SingleMetaTypeProvider
import domino.service_consum... | helgoboss/domino | src/main/scala/domino/configuration_watching/ConfigurationWatching.scala | Scala | mit | 4,599 |
/*
* Copyright 2021 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/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600e/v2/E1010.scala | Scala | apache-2.0 | 843 |
package org.automanlang.core.exception
case class FailedComputationException(err: String) extends Exception
| dbarowy/AutoMan | libautoman/src/main/scala/org/automanlang/core/exception/FailedComputationException.scala | Scala | gpl-2.0 | 109 |
import sbt._
/**
* Copied, with some modifications, from https://github.com/milessabin/shapeless/blob/master/project/Boilerplate.scala
*
* Generate a range of boilerplate classes, those offering alternatives with 0-22 params
* and would be tedious to craft by hand
*/
object Boilerplate {
import scala.Stri... | Hydrospheredata/mist | project/Boilerplate.scala | Scala | apache-2.0 | 10,437 |
package scalaprops
import scalaprops.derive.Singletons
object Util {
def compareGenHelper[T](first: Gen[T], second: Gen[T])(
len: Int
): Boolean = {
val seed = System.currentTimeMillis()
val generated = first.infiniteStream(seed = seed).zip(second.infiniteStream(seed = seed)).take(len)
generated.f... | scalaprops/scalaprops-shapeless | test/shared/src/test/scala-2/scalaprops/Util.scala | Scala | apache-2.0 | 1,686 |
package play_crawler
import org.apache.log4j.{Level, Logger}
import org.apache.spark.sql.{SQLContext, SaveMode}
import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.sql.functions._
/**
* Created by mukul on 22/1/17.
*/
object scrap {
def main(args: Array[String]): Unit = {
val conf = ne... | devmukul44/Play_Crawler | play-analytics-core/src/main/scala/play_crawler/scrap.scala | Scala | mit | 3,171 |
package com.mdsol.mauth
import java.nio.charset.StandardCharsets
import java.security.Security
import java.util.UUID
import com.mdsol.mauth.test.utils.FixturesLoader
import com.mdsol.mauth.util.MAuthKeysHelper.{getPrivateKeyFromString, getPublicKeyFromString}
import com.mdsol.mauth.util.MAuthSignatureHelper
import or... | mdsol/mauth-java-client | modules/mauth-common/src/test/scala/com/mdsol/mauth/MAuthSignatureHelperSpec.scala | Scala | mit | 8,679 |
/*
* 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 ... | LantaoJin/spark | sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala | Scala | apache-2.0 | 41,239 |
/*
* 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 ... | tinkoff-dwh/zeppelin | r/src/main/scala/org/apache/zeppelin/rinterpreter/RInterpreter.scala | Scala | apache-2.0 | 6,722 |
package epic.parser.models
/*
Copyright 2012 David Hall
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... | langkilde/epic | src/main/scala/epic/parser/models/ParserTrainer.scala | Scala | apache-2.0 | 11,079 |
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.