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 |
|---|---|---|---|---|---|
/**
* Created by hganev on 06/01/17.
*/
class WaterPouring(capacity: Vector[Int]) {
type State = Vector[Int]
val initialState = capacity map (x => 0)
// Moves
trait Move {
def change(state: State): State
}
case class Empty(glass: Int) extends Move {
def change(state: State): State = state upd... | hganev/FunWithScala | WaterPouringProblem/WaterPouring.scala | Scala | mit | 2,033 |
import scala.scalajs.js
import scala.scalajs.js.annotation.*
object Names {
val a = "Hello"
final val b = "World"
val sym = js.Symbol("foo")
}
class NamesClass {
val a = js.Symbol("foo")
}
@js.native
@JSGlobal
class B1 extends js.Object {
@JSName(Names.a) // error
def foo: Int = js.native
@JSName(Names... | dotty-staging/dotty | tests/neg-scalajs/jsname-argument.scala | Scala | apache-2.0 | 1,143 |
/*
* Created by IntelliJ IDEA.
* User: williamlee
* Date: 31/03/2011
* Time: 17:18
*/
package com.breezecapsule.scalarest
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.FlatSpec
import io.Source
import java.io.{IOException, FileNotFoundException}
import java.net.{HttpURLConnection, URL}
import ... | breezecapsule/scalarest | src/test/scala/com/breezecapsule/scalarest/HTTPSpec.scala | Scala | apache-2.0 | 8,046 |
/**
* 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... | cran/rkafkajars | java/kafka/message/CompressionFactory.scala | Scala | apache-2.0 | 2,227 |
package com.sageserpent.americium
import cats.Traverse
import cats.free.Free
import cats.implicits.*
import com.sageserpent.americium.TrialsImplementation.{
Choice,
NoteComplexity,
ResetComplexity
}
import com.sageserpent.americium.java.CaseFactory
import com.sageserpent.americium.{
Trials as ScalaTrials,
Tri... | sageserpent-open/americium | src/main/scala/com/sageserpent/americium/TrialsApiImplementation.scala | Scala | mit | 8,513 |
//
// Copyright 2016 Commonwealth Bank of Australia
//
// 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 ... | CommBank/coppersmith | scalding/src/test/scala/commbank/coppersmith/scalding/TestFeatureSets.scala | Scala | apache-2.0 | 4,292 |
/*
* 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 ... | kimihe/Swallow | swallow-benchmark/HiBench-master/sparkbench/ml/src/main/scala/com/intel/sparkbench/ml/LDADataGenerator.scala | Scala | apache-2.0 | 3,970 |
package sri.universal.components
import chandu0101.macros.tojs.JSMacro
import sri.core.{React, ReactElement}
import sri.universal.ReactUniversal
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.Dynamic.{literal => json}
case class ListView[T, H](zoomScale: js.UndefOr[Int] = js.undefined,
... | chandu0101/sri | universal/src/main/scala/sri/universal/components/ListView.scala | Scala | apache-2.0 | 4,842 |
/*
* saxophone - a markup processing program
* Copyright (C) 2015 Haak Saxberg
*
* This program 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) a... | haaksmash/saxophone | src/main/scala/com/haaksmash/saxophone/emitters/ConsoleEmitter.scala | Scala | gpl-3.0 | 891 |
/**
* Copyright (c) 2012-2013, Tomasz Kaczmarzyk.
*
* This file is part of BeanDiff.
*
* BeanDiff is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your o... | tkaczmarzyk/beandiff | src/main/scala/org/beandiff/core/TransformingDiffEngine.scala | Scala | lgpl-3.0 | 3,293 |
package net.debasishg.sw15.algebra
package domain.trade
package algebra
import scalaz._
import Scalaz._
trait Trading[Account, Trade, ClientOrder, Order, Execution, Market] {
def clientOrders: Kleisli[Valid, ClientOrder, Order]
def execute(market: Market, brokerAccount: Account): Kleisli[Valid, Order, Execution]... | debasishg/scalaworld15 | src/main/scala/sw15/algebra/algebra/trading.scala | Scala | apache-2.0 | 758 |
package com.twitter.finagle.stats
import com.twitter.app.GlobalFlag
import scala.collection.{Map, mutable}
import scala.util.matching.Regex
object format
extends GlobalFlag[String](
"commonsmetrics",
"Format style for metric names (ostrich|commonsmetrics|commonsstats)"
) {
private[stats] val Ost... | mkhq/finagle | finagle-stats/src/main/scala/com/twitter/finagle/stats/StatsFormatter.scala | Scala | apache-2.0 | 6,828 |
/*
* 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 ... | zimmermatt/flink | flink-runtime/src/main/scala/org/apache/flink/runtime/clusterframework/ContaineredJobManager.scala | Scala | apache-2.0 | 7,254 |
package lila.api
import akka.actor._
import com.typesafe.config.Config
import lila.common.PimpedConfig._
import lila.simul.Simul
import scala.collection.JavaConversions._
import scala.concurrent.duration._
final class Env(
config: Config,
db: lila.db.Env,
renderer: ActorSelection,
router: ActorSelecti... | JimmyMow/lila | modules/api/src/main/Env.scala | Scala | mit | 4,951 |
package com.twitter.finagle.http.codec
import org.jboss.netty.channel.{Channel, ChannelHandler, ChannelHandlerContext,
ChannelStateEvent, MessageEvent, SimpleChannelHandler}
import org.jboss.netty.handler.codec.http.{HttpRequest, HttpResponse}
import org.jboss.netty.handler.ssl.SslHandl... | enachb/finagle_2.9_durgh | finagle-http/src/main/scala/com/twitter/finagle/http/codec/AnnotateCipher.scala | Scala | apache-2.0 | 962 |
/*
* 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 o... | jahnaviancha/scouter | scouter.server/src/scouter/server/netio/service/handle/TagCountService.scala | Scala | apache-2.0 | 15,348 |
/*
* Copyright 2013 http4s.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | http4s/http4s | tests/shared/src/test/scala/org/http4s/CharsetRangeSuite.scala | Scala | apache-2.0 | 1,412 |
/*
* Copyright 2014-2022 Netflix, 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... | Netflix/atlas | atlas-core/src/main/scala/com/netflix/atlas/core/db/BlockStore.scala | Scala | apache-2.0 | 6,687 |
package org.purview.errorlevelanalyser
import java.awt.image.BufferedImage
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import javax.imageio.IIOImage
import javax.imageio.ImageIO
import javax.imageio.ImageWriteParam
import org.purview.core.analysis.HeatMapImageAnalyser
import org.purview.co... | KenanSulayman/purview-retribute | purview-analysers/error-level-analyser/src/main/scala/org/purview/errorlevelanalyser/AnalyserImplementation.scala | Scala | apache-2.0 | 3,149 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-tools/src/main/scala/org/locationtech/geomesa/tools/utils/StatusCallback.scala | Scala | apache-2.0 | 3,731 |
package com.gilt.gfc.concurrent
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.{ScheduledExecutorService => JScheduledExecutorService, CyclicBarrier, CountDownLatch, Executors, Callable, TimeUnit}
import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.duration._
import... | gheine/gfc-concurrent | src/test/scala/com/gilt/gfc/concurrent/ScheduledExecutorServiceTest.scala | Scala | apache-2.0 | 8,323 |
package io.toolsplus.atlassian.connect.play.actions.symmetric
import io.toolsplus.atlassian.connect.play.TestSpec
import io.toolsplus.atlassian.connect.play.actions.{JwtActionRefiner, JwtRequest, symmetric}
import io.toolsplus.atlassian.connect.play.api.models.DefaultAtlassianHostUser
import io.toolsplus.atlassian.con... | toolsplus/atlassian-connect-play | modules/core/test/io/toolsplus/atlassian/connect/play/actions/symmetric/SymmetricallySignedAtlassianHostUserActionSpec.scala | Scala | apache-2.0 | 14,273 |
package org.jetbrains.sbt
import java.io.File
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.IconLoader
/**
* @author Pavel Fatin
*/
object Sbt {
val Name = "SBT"
val FileExtension = "sbt"
val FileDescription = "SBT files"
val BuildFile = "build.sbt"
val PluginsFile = "p... | LPTK/intellij-scala | src/org/jetbrains/sbt/Sbt.scala | Scala | apache-2.0 | 1,612 |
package notebook
package kernel
package remote
import akka.actor._
import akka.remote.transport.Transport.{InboundAssociation, AssociationEvent}
import akka.remote.{DisassociatedEvent, RemoteScope}
import pfork.ProcessFork
import com.typesafe.config.ConfigFactory
import collection.JavaConversions._
import akka.actor.D... | vitan/spark-notebook | modules/subprocess/src/main/scala/notebook/kernel/remote/SingleVM.scala | Scala | apache-2.0 | 5,132 |
/*
* Copyright 2014 Treode, 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... | Treode/store | store/test/com/treode/store/stubs/StubStoreSpec.scala | Scala | apache-2.0 | 1,389 |
/*
* Copyright 2013 Sanjin Sehic
*
* 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... | tuwiendsg/CAPA | core/test/scala/RemoteProcessingSpec.scala | Scala | apache-2.0 | 1,383 |
/*
* Copyright 2015 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... | andrewgee/domain | src/main/scala/uk/gov/hmrc/domain/PayeAgentReference.scala | Scala | apache-2.0 | 1,090 |
/*
* Copyright 2017 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | liquidarmour/ct-calculations | src/test/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC81Spec.scala | Scala | apache-2.0 | 1,398 |
package io.straight.radg
import io.straight.radg.randomtypes.DataGenerator
import scala.collection.mutable.{ HashMap => MHashMap }
abstract class RandomDataGenerator[A] {
def generators: Seq[DataGenerator[_]]
def generate(): A
case class SimpleNode(name:String,deps:List[String])
/**
* This is NOT the mos... | rbuckland/random-data-generator | src/main/scala/io/straight/radg/RandomDataGenerator.scala | Scala | apache-2.0 | 1,939 |
package io.scalac.amqp.impl
import java.io.IOException
import java.util.UUID
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Sink, Source}
import io.scalac.amqp._
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.time.{Millis, Span}
import org.scalatest.... | davidwrpayne/reactive-rabbit | src/test/scala/io/scalac/amqp/impl/RabbitConnectionSpec.scala | Scala | apache-2.0 | 3,552 |
package models.billing
import scalaz._
import Scalaz._
import scalaz.effect.IO
import scalaz.Validation
import scalaz.Validation.FlatMap._
import scalaz.NonEmptyList._
import cache._
import db._
import models.Constants._
import io.megam.auth.funnel.FunnelErrors._
import com.datastax.driver.core.{ ResultSet, Row }
im... | megamsys/verticegateway | app/models/billing/Billedhistories.scala | Scala | mit | 8,804 |
package org.jetbrains.plugins.scala
package lang
package refactoring
package introduceVariable
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.command.impl.StartMarkAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.markup.RangeHighlighter
import com.in... | SergeevPavel/intellij-scala | src/org/jetbrains/plugins/scala/lang/refactoring/introduceVariable/ScalaIntroduceVariableHandler.scala | Scala | apache-2.0 | 3,858 |
package org.jetbrains.plugins.scala
import org.jetbrains.annotations.Nullable
import org.jetbrains.plugins.scala.lang.psi.api.base.ScReference
package object uast {
implicit class ReferenceExt(private val ref: ScReference) extends AnyVal {
@Nullable
def resolveTo[T >: Null : reflect.ClassTag]: T = ref.reso... | JetBrains/intellij-scala | scala/uast/src/org/jetbrains/plugins/scala/uast/package.scala | Scala | apache-2.0 | 472 |
package test
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import reactify._
import scala.language.implicitConversions
class DepSpecialSpec extends AnyWordSpec with Matchers {
"Deps Special Use-Cases" when {
"combining Ints" should {
"do simple addition" in {
... | outr/reactify | reactify/src/test/scala/test/DepSpecialSpec.scala | Scala | mit | 2,330 |
package io.eels.component.orc
import io.eels.schema._
import org.apache.orc.TypeDescription
import org.scalatest.{FunSuite, Matchers}
// tests that the eel <-> orc schemas are compatible
class OrcSchemaCompatibilityTest extends FunSuite with Matchers {
test("orc schemas should be cross compatible with eel structs"... | eel-lib/eel | eel-orc/src/test/scala/io/eels/component/orc/OrcSchemaCompatibilityTest.scala | Scala | mit | 2,372 |
package com.cds.learnscala.test.classtest
object ClassTest {
def testNetwork(): Unit = {
val chatter = new Network
val myFace = new Network
val fred = chatter.join("Fred")
println(fred)
}
def main(args: Array[String]) {
// val cds = new People
// cds.age = 30
// println(cds.age)
// ... | anancds/scala-project | learn-scala/src/main/scala/com/cds/learnscala/test/classtest/ClassTest.scala | Scala | mit | 447 |
package de.tu_berlin.formic.gatling.builder
import de.tu_berlin.formic.gatling.action.json._
import io.gatling.core.session.Expression
import upickle.default._
/**
* @author Ronny Bräunlich
*/
case class FormicJsonBuilderBase(dataTypeInstanceId: Expression[String]) {
def insert[T](toInsert: T)(implicit writer: ... | rbraeunlich/formic | formic-gatling/src/main/scala/de/tu_berlin/formic/gatling/builder/FormicJsonBuilderBase.scala | Scala | apache-2.0 | 1,179 |
package com.github.jeroenr.tepkin.examples
import akka.stream.ActorMaterializer
import akka.util.Timeout
import com.github.jeroenr.bson.BsonDocument
import com.github.jeroenr.tepkin.MongoClient
import scala.concurrent.duration._
import scala.util.{Failure, Success}
import language.postfixOps
object CopyExample exten... | jeroenr/tepkin | examples/src/main/scala/com/github/jeroenr/tepkin/examples/CopyExample.scala | Scala | apache-2.0 | 1,371 |
package org.jetbrains.plugins.scala
package lang
package transformation
package implicits
/**
* @author Pavel Fatin
*/
class InscribeImplicitParametersTest extends TransformerTest(new InscribeImplicitParameters()) {
override protected val header: String =
"implicit val v: A = _"
def testReferenceExpressi... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/lang/transformation/implicits/InscribeImplicitParametersTest.scala | Scala | apache-2.0 | 2,003 |
package io.cloudslang.content.google.utils.action
import io.cloudslang.content.constants.BooleanValues.TRUE
import io.cloudslang.content.google.utils.Constants.COMMA
/**
* Created by victor on 28.02.2017.
*/
object DefaultValues {
final val DEFAULT_CONSOLE_PORT = "1"
final val DEFAULT_START_INDEX = "0"
fina... | victorursan/cs-actions | cs-google/src/main/scala/io/cloudslang/content/google/utils/action/DefaultValues.scala | Scala | apache-2.0 | 902 |
package com.shocktrade.client.contest
import com.shocktrade.client.models.contest.{Contest, ContestSearchOptions}
import com.shocktrade.common.forms.{ContestCreateForm, PlayerInfoForm}
import io.scalajs.npm.angularjs.Service
import io.scalajs.npm.angularjs.http.{Http, HttpResponse}
import io.scalajs.util.PromiseHelper... | ldaniels528/shocktrade.js | app/client/angularjs/src/main/scala/com/shocktrade/client/contest/ContestService.scala | Scala | apache-2.0 | 2,429 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | aosagie/spark | core/src/test/scala/org/apache/spark/executor/ExecutorSuite.scala | Scala | apache-2.0 | 22,319 |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package simx.core.helper
import simx.core.entity.typeconversion.TypeInfo._
import simx.core.svaractor.TimedRingBuffer.Now
import simx.core.svaractor.semantictrait.base.BaseValueDescription
import scala.collection._
i... | simulator-x/core | src/simx/core/helper/SVarUpdateFunctionMap.scala | Scala | apache-2.0 | 12,768 |
package chat
import akka.NotUsed
import akka.actor.typed.{ActorRef, ActorSystem, Props, SpawnProtocol}
import akka.actor.typed.scaladsl.ActorContext
import akka.actor.typed.scaladsl.Behaviors
import akka.actor.typed.scaladsl.adapter._
import akka.http.scaladsl._
import akka.http.scaladsl.model.ws.Message
import akka.h... | johanandren/chat-with-akka-http-websockets | src/main/scala/chat/Server.scala | Scala | apache-2.0 | 4,251 |
/*
* Copyright 2015 the original author or 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 applicab... | arkadius/scala-phases-chain | src/main/scala/phase/OperationStatus.scala | Scala | apache-2.0 | 1,105 |
package turkey.tasks
import scalajs.js
import scalajs.js.JSApp
import org.scalajs.jquery.jQuery
import upickle.default._
/** Trait to be inherited by the main class for the JS client.
* Dispatches to the appropriate task's client code using the defined
* mapping from task keys to main methods.
*/
trait TaskDis... | julianmichael/turkey | turkey/js/src/main/scala/turkey/tasks/TaskDispatcher.scala | Scala | mit | 935 |
package ru.maizy.dev.heartbeat.role
import akka.actor.{ Props, ActorRef, ActorSystem }
import akka.cluster.Cluster
import ru.maizy.dev.heartbeat.actor.{ StartUp, BaseSupervisor }
/**
* Copyright (c) Nikita Kovaliov, maizy.ru, 2015
* See LICENSE.txt for details.
*/
class Stat(val startUpAmountOfStatNodes: Int) ext... | maizy/akka-cluster-heartbeat | src/main/scala/ru/maizy/dev/heartbeat/role/Stat.scala | Scala | mit | 647 |
package com.rasterfoundry.datamodel
import io.circe._
import cats.syntax.either._
sealed abstract class UserVisibility(val repr: String) {
override def toString = repr
}
object UserVisibility {
case object Public extends UserVisibility("PUBLIC")
case object Private extends UserVisibility("PRIVATE")
def from... | azavea/raster-foundry | app-backend/datamodel/src/main/scala/UserVisibility.scala | Scala | apache-2.0 | 827 |
package com.softwaremill.session
import java.security.{KeyPairGenerator, PrivateKey}
import java.util.Base64
import com.softwaremill.session.JwsAlgorithm.HmacSHA256
import com.softwaremill.session.SessionConfig.{JwsConfig, JwtConfig}
import org.json4s.JsonAST.{JObject, JString}
import org.json4s.{JValue, _}
import or... | softwaremill/akka-http-session | jwt/src/test/scala/com/softwaremill/session/SessionManagerJwtEncoderTest.scala | Scala | apache-2.0 | 10,353 |
package redis.commands
import redis._
import scala.concurrent.Await
import akka.util.ByteString
import redis.actors.ReplyErrorException
class ConnectionSpec extends RedisStandaloneServer {
sequential
"Connection commands" should {
"AUTH" in {
Await.result(redis.auth("no password"), timeOut) must throw... | etaty/rediscala | src/test/scala/redis/commands/ConnectionSpec.scala | Scala | apache-2.0 | 1,821 |
package com.rockymadden.stringmetric.filter
import com.rockymadden.stringmetric.StringFilter
/** Ensures only ASCII letters and numbers matter. */
trait AsciiLetterNumberOnlyFilter extends StringFilter {
abstract override def filter(charArray: Array[Char]): Array[Char] =
super.filter(
charArray.filter(c =>
... | cocoxu/multip | src/main/scala/com/rockymadden/stringmetric/filter/AsciiLetterNumberOnlyFilter.scala | Scala | gpl-3.0 | 498 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogx/platform/types/ConvolutionSamplingPolicy.scala | Scala | apache-2.0 | 1,433 |
trait Base {
private val secure_# = 10l
}
class TestUser extends Base {
def clsMeth(x: Int) = x
private def foo(x: Int) = x
}
object TestUser extends TestUser {
def objMeth = "a"
private def foo(x: Int) = x
}
object Test {
def main(args: Array[String]) {
TestUser.objMeth
// no-op, just check th... | felixmulder/scala | test/files/run/duplicate-meth.scala | Scala | bsd-3-clause | 377 |
package edu.gemini.spModel.core
import scalaz._, Scalaz._
/**
* Unique Horizons designation, which should allow for reproduceable ephemeris queries <b>if</b> the
* values passed to the constructors are extracted correctly from search results. See `horizons.md`
* in the bundle source for more information.
*/
seal... | fnussber/ocs | bundle/edu.gemini.spModel.core/src/main/scala/edu/gemini/spModel/core/HorizonsDesignation.scala | Scala | bsd-3-clause | 2,040 |
/*
* 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... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/feature/text/TextSet.scala | Scala | apache-2.0 | 32,127 |
package net.mentalarray.doozie.DSL
/**
* Created by kdivincenzo on 9/29/14.
*/
object Replace {
def apply(replacements: (String,Any)*) = {
val instance = ReplacementParameters()
replacements.foreach(r => instance.replace(r))
instance
}
}
| antagonist112358/tomahawk | workflow-engine/src/net/mentalarray/doozie/DSL/Replace.scala | Scala | apache-2.0 | 259 |
/*
* ChannelConfigBuilderImpl.scala
* (ScalaOSC)
*
* Copyright (c) 2008-2021 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.osc
... | Sciss/ScalaOSC | shared/src/main/scala/de/sciss/osc/impl/ChannelConfigBuilderImpl.scala | Scala | lgpl-2.1 | 713 |
package de.htw.pgerhard.domain.tweets.errors
import de.htw.pgerhard.domain.generic.{MyTwitterError, UserFacingError}
sealed trait TweetError extends MyTwitterError
case class TweetNotFound(tweetId: String) extends TweetError with UserFacingError {
override def getMessage(): String = s"Tweet '$tweetId' not found."
... | peter-gerhard/my-twitter-playground | src/main/scala/de/htw/pgerhard/domain/tweets/errors/TweetError.scala | Scala | apache-2.0 | 889 |
def factorial(n: Int): Int = n match {
case 0 => 1
case x if x > 0 => factorial(n - 1) * n
}
println(factorial(3))
println(factorial(0))
| nmcl/scratch | scala/factorial.scala | Scala | apache-2.0 | 146 |
package skulks.memory
import scodec.bits.{BitVector, ByteVector}
import scodec.Decoder
import scodec.codecs.uint32
case class CallStub(
destType: Long,
destAddr: Long,
pc: Long,
framePtr: Long
)
object CallStub {
val decoder = for {
destType <- uint32
destAddr <- uint32
pc <- uint32... | paulmr/skulks | src/main/scala/frame.scala | Scala | gpl-2.0 | 1,227 |
/**
* © 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... | e-orz/CM-Well | server/cmwell-ws/app/ld/exceptions/ServerComponentNotAvailableException.scala | Scala | apache-2.0 | 1,044 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | caneGuy/spark | external/kafka-0-10/src/test/scala/org/apache/spark/streaming/kafka010/KafkaDataConsumerSuite.scala | Scala | apache-2.0 | 5,401 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/... | S-Mach/s_mach.concurrent | src/test/scala/s_mach/concurrent/Tuple14AsyncTaskRunnerTest.scala | Scala | mit | 5,699 |
package com.twitter.hashing
import com.twitter.io.TempFile
import java.util.Base64
import scala.collection.mutable.ListBuffer
import java.nio.charset.StandardCharsets.UTF_8
import org.scalatest.wordspec.AnyWordSpec
class KeyHasherTest extends AnyWordSpec {
def readResource(name: String) = {
var lines = new List... | twitter/util | util-hashing/src/test/scala/com/twitter/hashing/KeyHasherTest.scala | Scala | apache-2.0 | 1,485 |
package arx.core.graphics.data
/**
* Created by IntelliJ IDEA.
* User: nvt
* Date: 6/15/12
* Time: 8:53 AM
* Created by nonvirtualthunk
*/
import java.util.concurrent.Executors
import arx.core.{ResourceManager, Application, Moddable}
trait TToImage {
def image : Image
}
class WrappedImage(val img:Image) exten... | nonvirtualthunk/arx-core | src/main/scala/arx/core/graphics/data/TToImage.scala | Scala | bsd-2-clause | 1,794 |
import sbt._
object LibDependencies {
import play.sbt.PlayImport._
import play.core.PlayVersion
val akkaVersion = "2.5.18"
val compile = Seq(
filters,
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" ... | hmrc/frontend-bootstrap | project/LibDependencies.scala | Scala | apache-2.0 | 2,572 |
import scala.collection.{ Seq => A, Seq => B } // error: Seq is renamed twice
| som-snytt/dotty | tests/neg/i3745c.scala | Scala | apache-2.0 | 78 |
package ml.combust.mleap.core.classification
import ml.combust.mleap.core.annotation.SparkCode
import ml.combust.mleap.core.types.{ScalarType, StructType, TensorType}
import org.apache.spark.ml.linalg.{Vector, Vectors}
import org.apache.spark.ml.linalg.mleap.BLAS
object LinearSVCModel
{
val defaultThreshold = 0.0... | combust/mleap | mleap-core/src/main/scala/ml/combust/mleap/core/classification/LinearSVCModel.scala | Scala | apache-2.0 | 1,695 |
package org.clulab.twitter4food
import org.clulab.twitter4food.featureclassifier.HumanClassifier
import org.clulab.twitter4food.twitter4j.TwitterAPI
import java.io.{BufferedWriter, File, FileWriter, IOException}
// TODO refactor to use new read-only TwitterAcount
/**
* Created by adikou on 1/21/16.
*/
object Te... | clulab/twitter4food | src/test/scala/org/clulab/twitter4food/TestTwitterAPI.scala | Scala | apache-2.0 | 2,494 |
package se.marcuslonnberg.stark.utils
sealed trait Validation[+S, +E] {
def map[T](f: S => T): Validation[T, E]
def flatMap[SN, EN >: E](f: S => Validation[SN, EN]): Validation[SN, EN]
def toOption: Option[S]
}
case class Success[+S, +E](value: S) extends Validation[S, E] {
def map[T](f: S => T) = Success(f... | FredrikWendt/stark | src/main/scala/se/marcuslonnberg/stark/utils/validation.scala | Scala | mit | 631 |
/*
* 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... | monixio/monix | monix-execution/shared/src/test/scala/monix/execution/CancelableFutureSuite.scala | Scala | apache-2.0 | 20,267 |
/*
* 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 ... | vjagadish/samza-clone | samza-kv/src/main/scala/org/apache/samza/storage/kv/SerializedKeyValueStore.scala | Scala | apache-2.0 | 4,786 |
package com.twitter.finagle.http2.transport
import io.netty.channel.{ChannelDuplexHandler, ChannelPromise, ChannelHandlerContext}
import io.netty.channel.ChannelHandler.Sharable
import io.netty.handler.codec.http.{HttpMessage, HttpHeaders, HttpHeaderNames}
import io.netty.handler.codec.http2.Http2CodecUtil
/**
* Net... | luciferous/finagle | finagle-http2/src/main/scala/com/twitter/finagle/http2/transport/StripHeadersHandler.scala | Scala | apache-2.0 | 2,570 |
/*
* 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 ... | aokolnychyi/spark | core/src/test/scala/org/apache/spark/DistributedSuite.scala | Scala | apache-2.0 | 13,872 |
package com.harrys.hyppo.worker.actor.amqp
import com.harrys.hyppo.worker.TestConfig
import org.apache.commons.io.Charsets
import org.scalatest.{Matchers, WordSpecLike}
/**
* Created by jpetty on 11/12/15.
*/
class AMQPEncryptionTest extends WordSpecLike with Matchers {
val config = TestConfig.workerWithRandom... | harrystech/hyppo-worker | worker/src/test/scala/com/harrys/hyppo/worker/actor/amqp/AMQPEncryptionTest.scala | Scala | mit | 689 |
package controllers
import javax.inject._
import play.api._
import play.api.mvc._
import services.Counter
/**
* This controller demonstrates how to use dependency injection to
* bind a component into a controller class. The class creates an
* `Action` that shows an incrementing count to users. The [[Counter]]
... | enjoyear/X | play-app/app/controllers/CountController.scala | Scala | apache-2.0 | 793 |
package p04Euler
object LongestCollatzSequenceWeb {
def from(n: Long, c: Int = 0): Int = if (n == 1) c + 1 else
from(if (n % 2 == 0) n / 2 else 3 * n + 1, c + 1)
val r = (1 until 100).view
.map(n => (n, from(n)))
.reduceLeft((a, b) => if (a._2 > b._2) a else b).... | vkubicki/ScalaTest | src/main/scala/p04Euler/014 - LongestCollatzWeb.scala | Scala | mit | 351 |
package ru.pavkin.todoist.api.core
import java.util.UUID
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest.{FunSuite, Matchers}
import shapeless.test.illTyped
class IsResourceIdSpec extends FunSuite with Matchers with GeneratorDrivenPropertyChecks {
test("Int and UUID is resource id") {... | vpavkin/scalist | tests/src/test/scala/ru/pavkin/todoist/api/core/IsResourceIdSpec.scala | Scala | mit | 546 |
package com.daverstevens.sql
import org.specs2.ScalaCheck
import org.specs2.mutable.Specification
import org.scalacheck.{Gen, Prop}
class DriverTypeTests extends Specification with ScalaCheck {
def urlsAndDriverType = for {
(driverName, driverType) <- Gen.oneOf[(String, Option[DriverType])](
Gen.const("m... | drstevens/slick-testing | src/test/scala/com/daverstevens/sql/DriverTypeTests.scala | Scala | apache-2.0 | 701 |
/*
* Artificial Intelligence for Humans
* Volume 1: Fundamental Algorithms
* Scala Version
* http://www.aifh.org
* http://www.jeffheaton.com
*
* Code repository:
* https://github.com/jeffheaton/aifh
* Copyright 2013 by Jeff Heaton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you ma... | PeterLauris/aifh | vol2/vol2-scala-examples/src/main/scala/com/heatonresearch/aifh/randomize/LinearCongruentialRandom.scala | Scala | apache-2.0 | 4,080 |
package chess
import swing._, actors.Actor, java.awt.{Rectangle,Font}
class App(playerColor: Color) extends SimpleSwingApplication {
def top = new MainFrame {
title = "Chess game. Player: " + playerColor +
". Computer: " + playerColor.other + "."
contents = new GamePanel(playerColor) }
}
object PlayWh... | grzegorzbalcerek/scala-book-examples | examples/Gui.scala | Scala | mit | 4,620 |
package io.finch.endpoint
import cats.effect.Sync
import com.twitter.finagle.http.{Cookie => FinagleCookie}
import io.finch._
private[finch] abstract class Cookie[F[_], A](name: String)(implicit
protected val F: Sync[F]
) extends Endpoint[F, A] {
protected def missing(name: String): F[Output[A]]
protected def ... | ImLiar/finch | core/src/main/scala/io/finch/endpoint/cookie.scala | Scala | apache-2.0 | 1,401 |
package de.unihamburg.vsis.sddf.test.examples
import org.scalatest.FunSuite
import de.unihamburg.vsis.sddf.logging.Logging
import de.unihamburg.vsis.sddf.examples.PipeWordcount
import de.unihamburg.vsis.sddf.test.util.LocalSparkContext
import de.unihamburg.vsis.sddf.pipe.context.SddfPipeContext
/**
* Test wether log... | numbnut/sddf | src/test/scala/de/unihamburg/vsis/sddf/test/examples/WordcountTest.scala | Scala | gpl-3.0 | 809 |
/*
* 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
* distributed u... | white1033/spark-deployer | core/src/main/scala/sparkdeployer/ClusterConf.scala | Scala | apache-2.0 | 2,366 |
package com.insweat.hssd.lib.util
trait Qualified {
private var _qname: String = null
def qname: String = {
if(_qname == null) {
_qname = computeQName
}
val s = _qname
_qname
}
protected def resetQName() {
_qname = null
}
p... | insweat/hssd | com.insweat.hssd.lib/src/com/insweat/hssd/lib/util/Qualified.scala | Scala | lgpl-3.0 | 358 |
package utils.captcha
import com.typesafe.config.{ConfigFactory, Config}
import scala.language.postfixOps
import scala.util.Try
/**
* Geetest Config
*/
object GeetestConfig {
val config = ConfigFactory.load("captcha")
def getCaptchaId: String = Try {
config.getString("geetest.captcha_id")
} recover ... | sczyh30/samsara-aquarius | app/utils/captcha/GeetestConfig.scala | Scala | mit | 469 |
package sbtmarathon
import org.json4sbt._
import org.json4sbt.jackson.Serialization.{read, write}
import org.scalatest.{FlatSpec, Matchers}
class ValueMapDeserializerSpec extends FlatSpec with Matchers {
behavior of "ValueMapDeserializer"
it should "extract data values from serialized driver data" in {
impl... | Tapad/sbt-marathon | templating-lib/src/test/scala/sbtmarathon/ValueMapDeserializerSpec.scala | Scala | bsd-3-clause | 967 |
package com.daodecode.scalaj.collection.test
import scala.collection.mutable.{Buffer => MBuffer, Map => MMap, Seq => MSeq, Set => MSet}
import com.daodecode.scalaj.collection._
import org.scalatest.{Matchers, WordSpec}
class ComplexJConvertersTest extends WordSpec with Matchers {
"AsJava collection converters" sh... | jozic/scalaj | scalaj-collection/src/test/scala/com/daodecode/scalaj/collection/test/ComplexJConvertersTest.scala | Scala | bsd-3-clause | 2,180 |
/*
* 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.ast.pa... | scala/scala | src/compiler/scala/tools/nsc/ast/parser/Change.scala | Scala | apache-2.0 | 447 |
/**
* Copyright (c) 2016 Intel 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 applicabl... | ashaarunkumar/spark-tk | sparktk-core/src/main/scala/org/trustedanalytics/sparktk/frame/internal/ops/topk/TopK.scala | Scala | apache-2.0 | 3,145 |
/*
* Copyright (c) 2016 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org... | snowplow/sauna | src/main/scala/com.snowplowanalytics.sauna/observers/AmazonS3Observer.scala | Scala | apache-2.0 | 4,745 |
package org.monarchinitiative.clique
import java.io.File
import org.apache.jena.graph.Triple
import org.apache.jena.riot.RDFDataMgr
import org.apache.jena.riot.system.StreamRDF
import org.apache.jena.sparql.core.Quad
import org.backuity.clist._
import com.bigdata.rdf.store.DataLoader
import org.apache.commons.io.File... | balhoff/clique-merge | src/main/scala/org/monarchinitiative/clique/Load.scala | Scala | mit | 2,271 |
/* _____ _
* | ___| __ __ _ _ __ ___ (_) __ _ _ __
* | |_ | '__/ _` | '_ ` _ \\| |/ _` | '_ \\
* | _|| | | (_| | | | | | | | (_| | | | |
* |_| |_| \\__,_|_| |_| |_|_|\\__,_|_| |_|
*
* Copyright 2014 Pellucid Analytics
*
* Licensed under the Apache License, Version 2.0 (the "License");
*... | longcao/framian | framian/src/main/scala/framian/reduce/SimpleReducer.scala | Scala | apache-2.0 | 1,315 |
package pl.touk.nussknacker.engine.kafka.source.flink
import com.typesafe.config.ConfigFactory
import com.typesafe.config.ConfigValueFactory.fromAnyRef
import com.typesafe.scalalogging.LazyLogging
import io.circe.Json.{Null, fromString, obj}
import org.apache.kafka.common.record.TimestampType
import org.scalatest.{Fun... | TouK/nussknacker | engine/flink/kafka-components-utils/src/test/scala/pl/touk/nussknacker/engine/kafka/source/flink/TestFromFileSpec.scala | Scala | apache-2.0 | 2,901 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This... | beangle/commons | csv/src/main/scala/org/beangle/commons/csv/CsvConstants.scala | Scala | lgpl-3.0 | 1,062 |
package chess
package format.pgn
import cats.syntax.option._
class RenderTest extends ChessTest {
private def glyphs(id: Int) =
Glyph.find(id).fold(Glyphs.empty) { g =>
Glyphs fromList List(g)
}
/*
[Event "WCh"]
[Site "Bonn GER"]
[Date "2008.10.14"]
[Round "1"]
[White "Kramnik,V"]
[Black "Anand,V"... | niklasf/scalachess | src/test/scala/format/pgn/RenderTest.scala | Scala | mit | 9,859 |
package com.ripjar.spark.process
import com.ripjar.spark.data._
import com.ripjar.spark.job.SparkJobException
import com.ripjar.spark.job.SparkJobErrorType
import org.apache.tika.Tika
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.apache.spark.streaming.dstream.DStream
import java.io.InputStream
imp... | Yingmin-Li/spark-stream | src/main/scala/com/ripjar/spark/process/TextExtract.scala | Scala | gpl-2.0 | 5,300 |
package com.colingodsey.logos.utils
/*
import java.util
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.{AbstractExecutorService, ExecutorService, ThreadFactory}
import javafx.application.Platform
import scala.concurrent.duration._
class JfxExecutor(config: Config,
prerequisites: Dispat... | colinrgodsey/logos | utils/shared/src/main/scala/com/colingodsey/logos/utils/JfxExecutor.scala | Scala | gpl-2.0 | 1,670 |
/**
* Copyright (C) 2013 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | brunobuzzi/orbeon-forms | form-runner/jvm/src/main/scala/org/orbeon/oxf/fr/FormRunnerPermissionsOps.scala | Scala | lgpl-2.1 | 9,463 |
/**
* Copyright: Copyright (C) 2016, ATS Advanced Telematic Systems GmbH
* License: MPL-2.0
*/
package org.genivi.sota.core.data
import java.time.Instant
import org.genivi.sota.data.Uuid
case class BlockedInstall(id: Uuid, blockedAt: Instant)
object BlockedInstall {
def from(id: Uuid): BlockedInstall = Bloc... | PDXostc/rvi_sota_server | core/src/main/scala/org/genivi/sota/core/data/BlockedInstall.scala | Scala | mpl-2.0 | 352 |
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.