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 builder
case class CarDirector(carBuilder: CarBuilder) {
def build: CarBuilder = {
carBuilder
.buildBodyStyle
.buildEngine
.buildPower
.buildFuelType
.buildBreaks
.buildSeats
.buildWindows
}
}
| BBK-PiJ-2015-67/sdp-portfolio | exercises/week08/src/main/scala/builder/CarDirector.scala | Scala | unlicense | 252 |
package org.jetbrains.plugins.scala.decompiler.scalasig
import java.io.IOException
import java.lang.Double.longBitsToDouble
import java.lang.Float.intBitsToFloat
import org.jetbrains.plugins.scala.decompiler.scalasig.PickleFormat._
import org.jetbrains.plugins.scala.decompiler.scalasig.TagGroups._
import scala.annot... | jastice/intellij-scala | scala/decompiler/src/org/jetbrains/plugins/scala/decompiler/scalasig/Parser.scala | Scala | apache-2.0 | 10,302 |
package com.holdenkarau.spark.validator
import java.sql.Timestamp
import scala.collection.immutable.Seq
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.types.{LongType, StringType, StructField, StructType}
import org.apache.spark.sql.{DataFrame, Row, SQLContext, SparkSession, functions}
case class Histo... | holdenk/spark-validator | src/main/scala/com/holdenkarau/spark/validator/HistoricData.scala | Scala | apache-2.0 | 2,921 |
package coursier.cli.options
import caseapp.{ExtraName => Short, HelpMessage => Help, ValueDescription => Value, _}
import coursier.core.{Classifier, Resolution, Type}
import coursier.install.RawAppDescriptor
// format: off
final case class ArtifactOptions(
@Group(OptionGroup.fetch)
@Hidden
@Help("Classifiers ... | coursier/coursier | modules/cli/src/main/scala/coursier/cli/options/ArtifactOptions.scala | Scala | apache-2.0 | 2,712 |
// Copyright: 2010 - 2018 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/lgpl-3.0.en.html
package org.ensime.sexp.formats
import org.ensime.sexp._
class BasicFormatsSpec extends FormatSpec with BasicFormats {
"BasicFormats" should "support Int" in {
assertFormat(13, Sexp... | yyadavalli/ensime-server | s-express/src/test/scala/org/ensime/sexp/formats/BasicFormatsSpec.scala | Scala | gpl-3.0 | 2,183 |
package simx.core.helper
import simplex3d.math.double._
/**
* Created by martin
* on 30/07/15.
*/
object Vector3 {
def centerOf(vectors : Iterable[ConstVec3]) : ConstVec3 =
vectors.foldLeft(Vec3.Zero)(_ + _) / vectors.size
}
| simulator-x/core | src/simx/core/helper/Vector3.scala | Scala | apache-2.0 | 237 |
package uk.co.turingatemyhamster
package owl2
/**
* An abstraction of: http://www.w3.org/TR/2012/REC-owl2-syntax-20121211/#Entity_Declarations_and_Typing
*
* @author Matthew Pocock
*/
trait DeclarationModule {
importedModules : owl2.IriModule with owl2.OntologyModule =>
type Declaration <: Axiom
}
| drdozer/owl2 | core/src/main/scala/uk/co/turingatemyhamster/owl2/DeclarationModule.scala | Scala | apache-2.0 | 311 |
package io.iohk.ethereum.ets.vm
import akka.util.ByteString
import io.iohk.ethereum.domain.Address
import io.iohk.ethereum.ets.common.AccountState
case class VMScenario(
env: Env,
exec: Exec,
callcreates: Option[List[CallCreate]],
pre: Map[Address, AccountState],
post: Option[Map[Address, AccountState]],
... | input-output-hk/etc-client | src/ets/scala/io/iohk/ethereum/ets/vm/scenario.scala | Scala | mit | 870 |
package net.bmjames.opts.test.example
import net.bmjames.opts._
import scalaz.syntax.apply._
case class Options(globalOpt: String, globalFlag: Boolean, command: Command)
sealed trait Command
case class Add(paths: List[String]) extends Command
case class Commit(message: String) extends Command
object SubparserExam... | bmjames/scala-optparse-applicative | src/test/scala/net/bmjames/opts/test/example/SubparserExample.scala | Scala | bsd-3-clause | 1,273 |
/**
* Copyright (C) 2010 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 prog... | orbeon/orbeon-forms | xforms-analysis/shared/src/main/scala/org/orbeon/oxf/xforms/analysis/controls/SelectionControlTrait.scala | Scala | lgpl-2.1 | 2,537 |
package org.hammerlab.guacamole.readsets.rdd
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import org.hammerlab.genomics.reference.test.{RegionsUtil, TestRegion}
trait RegionsRDDUtil
extends RegionsUtil {
def sc: SparkContext
def makeRegionsRDD(numPartitions: Int, reads: (String, Int, I... | hammerlab/guacamole | src/test/scala/org/hammerlab/guacamole/readsets/rdd/RegionsRDDUtil.scala | Scala | apache-2.0 | 412 |
/*
* 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.
*/
import scala.language.implicit... | scala/scala-parser-combinators | shared/src/test/scala/scala/util/parsing/combinator/gh72.scala | Scala | apache-2.0 | 1,156 |
/*
* 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 ... | minixalpha/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala | Scala | apache-2.0 | 8,768 |
object Main{
def main(args: Array[String]){
println("Hello 99 Scala Problem World!")
}
}
| sakabar/ninetyNineScala | src/main/scala/Main.scala | Scala | gpl-3.0 | 97 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala | Scala | apache-2.0 | 4,062 |
class Test {
def remove[S](a: S | Int, f: Int => S):S = a match {
case a: S => a // error
case a: Int => f(a)
}
val t: Int | String = 5
val t1 = remove[String](t, _.toString)
}
| som-snytt/dotty | tests/neg-custom-args/isInstanceOf/1828.scala | Scala | apache-2.0 | 206 |
package chandu0101.scalajs.rn.components
import chandu0101.scalajs.rn.ReactNative
import japgolly.scalajs.react.ReactComponentU_
import scala.scalajs.js
import scala.scalajs.js.{UndefOr, undefined}
/**
*
*
* key: PropTypes.string,
style: PropTypes.js.Any,
ref: PropTypes.String,
maximumTrackTintColor: PropTypes.... | beni55/scalajs-react-native | core/src/main/scala/chandu0101/scalajs/rn/components/SliderIOS.scala | Scala | apache-2.0 | 2,020 |
package sexamples.basics.pingpong;
import se.sics.kompics.sl._
// #header_and_port
// #header_only
class Pinger extends ComponentDefinition {
// #header_only
val ppp = requires(PingPongPort);
// #header_and_port
ctrl uponEvent {
case _: Start => {
trigger(Ping -> ppp);
}
}
ppp uponEvent {
... | kompics/kompics-scala | docs/src/main/scala/sexamples/basics/pingpong/Pinger.scala | Scala | gpl-2.0 | 478 |
package controllers
import io.apibuilder.api.v0.models.UserUpdateForm
import javax.inject.Inject
import play.api.data._
import play.api.data.Forms._
import scala.concurrent.Future
class AccountProfileController @Inject() (
val apibuilderControllerComponents: ApibuilderControllerComponents
) extends ApibuilderCont... | mbryzek/apidoc | app/app/controllers/AccountProfileController.scala | Scala | mit | 2,301 |
package org.mandrake.runners.slick2d
import org.mandrake.simulation.{Event, Simulation}
import org.newdawn.slick.{AppGameContainer, BasicGame, GameContainer, Graphics}
object Slick2DRunner {
def run(rootSimulation: Simulation): Unit = {
val app = new AppGameContainer(new BasicGame("") {
private var curren... | louis-mon/mandrake | src/main/scala/org/mandrake/runners/slick2d/Slick2DRunner.scala | Scala | mit | 1,296 |
package gov.uk.dvla.vehicles.acquire.runner
import cucumber.api.CucumberOptions
import cucumber.api.junit.Cucumber
import org.junit.runner.RunWith
@RunWith(classOf[Cucumber])
@CucumberOptions(
features = Array("acceptance-tests/src/test/resources/gherkin/BruteForceForVehicleKeeperLookUpService.feature"),
glue = A... | dvla/vehicles-acquire-online | acceptance-tests/src/test/scala/gov/uk/dvla/vehicles/acquire/runner/BruteForceForVehicleKeeperLookUpService.scala | Scala | mit | 458 |
package com.twitter.finagle.memcached.protocol.text
import org.jboss.netty.buffer.ChannelBuffer
sealed abstract class Decoding
case class Tokens(tokens: Seq[ChannelBuffer]) extends Decoding
case class TokensWithData(
tokens: Seq[ChannelBuffer],
data: ChannelBuffer,
casUnique: ... | olix0r/finagle | finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/Decodings.scala | Scala | apache-2.0 | 553 |
package com.glowingavenger.plan.impl
import com.glowingavenger.plan.model.Problem
import scala.collection.immutable.Queue
import org.jgrapht.DirectedGraph
import com.glowingavenger.plan.{ActionEdge, PlanDescription}
import com.glowingavenger.plan.util.ReachGraph._
import com.glowingavenger.plan.model.action.Question
i... | dreef3/glowing-avenger | src/main/scala/com/glowingavenger/plan/impl/AbstractPlanner.scala | Scala | mit | 1,174 |
//package io.skysail.server.demo
//
//import java.net.URL
//
//import io.skysail.domain.resources.AsyncStaticResource
//import io.skysail.domain.{HtmlResponseEvent, RequestEvent}
//
//abstract case class DocResource() extends AsyncStaticResource {
// protected def getHtml(requestEvent: RequestEvent, path: String) = {
... | evandor/skysail-server | skysail.server.demo/src/io/skysail/server/demo/MetaDocResource.scala | Scala | apache-2.0 | 1,082 |
package co.rc.tokenmanager.hmac.base
import net.ceedubs.ficus.Ficus._
import net.ceedubs.ficus.readers.ValueReader
/**
* Utility class that defines finite time duration
* @param unit Time unit
* @param length Time length value
*/
case class TimeDuration( unit: String, length: Int ) {
require( List(
"s", "se... | rodricifuentes1/token-manager | src/main/scala/co/rc/tokenmanager/hmac/base/TimeDuration.scala | Scala | mit | 757 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.javadsl.persistence
import java.util.concurrent.CompletionStage
import java.util.{ Optional, UUID }
import akka.japi.Pair
import akka.stream.javadsl
import akka.{ Done, NotUsed }
import com.lightbend.lagom.javadsl... | edouardKaiser/lagom | persistence/javadsl/src/main/scala/com/lightbend/lagom/javadsl/persistence/PersistentEntityRegistry.scala | Scala | apache-2.0 | 3,922 |
package whitespace
import skinny.orm._, feature._
import scalikejdbc._
import org.joda.time._
case class Tag(
id: Long,
name: String,
createdAt: DateTime,
updatedAt: Option[DateTime] = None
)
object Tag extends SkinnyCRUDMapper[Tag] with TimestampsFeature[Tag] {
override val connectionPoolName = Sy... | skinny-framework/skinny-framework | factory-girl/src/test/scala/whitespace/Tag.scala | Scala | mit | 643 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package toplevel
package typedef
import com.intellij.execution.junit.JUnitUtil
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.project.DumbService
import com.intellij.openapi.util.Key
import com.intellij.pom.java.... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/toplevel/typedef/ScTemplateDefinition.scala | Scala | apache-2.0 | 22,059 |
package pl.touk.nussknacker.ui.definition.additionalproperty
import pl.touk.nussknacker.engine.api.definition.{SimpleParameterEditor, StringParameterEditor}
import pl.touk.nussknacker.engine.api.component.AdditionalPropertyConfig
object UiAdditionalPropertyEditorDeterminer {
def determine(config: AdditionalPropert... | TouK/nussknacker | ui/server/src/main/scala/pl/touk/nussknacker/ui/definition/additionalproperty/UiAdditionalPropertyEditorDeterminer.scala | Scala | apache-2.0 | 492 |
/*
* Copyright (c) 2018 OVO Energy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish,... | ovotech/comms-kafka-messages | modules/core/src/main/scala/com/ovoenergy/comms/model/email/EmailProgressedV2.scala | Scala | mit | 2,286 |
package com.pourtois.symbolette.expr
import Expr._
import org.scalatest._
/**
* Created by manu on 24.10.16.
*/
class TestUnary extends FunSuite {
test("Soon your pocahontas compilable test name here") {
val z = symbol("z")
val r = symbol("r")
val x = symbol("x", r :: z :: Nil)
val diff = -(... | ManuelPourtois/Symbolette | src/com/pourtois/symbolette/expr/TestUnary.scala | Scala | mit | 1,568 |
package latis.reader.adapter
import latis.data._
import latis.metadata._
import latis.util.StringUtils
import java.security.cert.X509Certificate
import scala.io.Source
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.HttpsURLConnection
import javax.net.ssl.SSLContext
import javax.net.ssl.SSLSession
import ja... | dlindhol/LaTiS | src/main/scala/latis/reader/adapter/AsciiAdapter3.scala | Scala | epl-1.0 | 5,168 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | goldmedal/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala | Scala | apache-2.0 | 12,211 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
/* NOTE
* Most of this file is copy-pasted fr... | scala-js/scala-js | partest/src/main/scala/scala/tools/partest/scalajs/PartestInterface.scala | Scala | apache-2.0 | 5,931 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | KevinLiLu/kafka | core/src/main/scala/kafka/cluster/BrokerEndPoint.scala | Scala | apache-2.0 | 3,003 |
/*
* 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 ... | esi-mineset/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/TypeUtils.scala | Scala | apache-2.0 | 2,913 |
package me.lsbengine.api.public
import com.github.nscala_time.time.Imports.DateTime
import me.lsbengine.api.ProjectsAccessor
import me.lsbengine.database.DatabaseAccessor
import me.lsbengine.database.model.{MongoCollections, Project}
import me.lsbengine.database.model.MongoFormats._
import reactivemongo.api.DefaultDB
... | jrabasco/LSBEngine | src/main/scala/me/lsbengine/api/public/PublicProjectsAccessor.scala | Scala | mit | 1,087 |
trait Observable {
type Handle
protected var callbacks = Map[Handle, this.type => Unit]()
def observe(callback : this.type => Unit) : Handle = {
val handle = createHandle(callback)
callbacks += (handle -> callback)
handle
}
def unobserve(handle : Handle) : Unit = {
callbacks -= handle
}
... | XClouded/t4f-core | scala/src/tmp/chapter6/dependent-types/callbacks.scala | Scala | apache-2.0 | 2,212 |
package beer.data.judgments
import java.io.File
import scala.io.Source
import scala.collection.mutable.{Map => MutableMap}
private class WMT14 (dir:String) {
val csv = dir+"/judgements-2014-05-14.csv"
val references_dir = dir+"/baselines/data/plain/references" // newstest2014-ref.en-fr
val system_dir = dir+"... | qingsongma/blend | tools/beer_2.0/src/beer/data/judgments/WMT14.scala | Scala | gpl-3.0 | 3,575 |
package name.abhijitsarkar.akka.service
import akka.NotUsed
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.HttpMethods.GET
import akka.http.scaladsl.model.HttpRequest
import akka.http.scaladsl.model.Uri.apply
import akka.stream.scaladsl.Source
import akka.stream.{Graph, SinkShape}
import akka.util.Byte... | asarkar/akka | akka-streams-learning/meetup-streaming/src/main/scala/name/abhijitsarkar/akka/service/MeetupStreamingService.scala | Scala | gpl-3.0 | 1,017 |
package vonsim.webapp
import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
import scala.scalajs.js.annotation.JSName
import com.scalawarrior.scalajs.ace.Editor
import com.scalawarrior.scalajs.ace.Annotation
import com.scalawarrior.scalajs.ace.Position
import com.scalawarrior.scalajs.ace.Range
@... | facundoq/vonsim | src/main/scala/vonsim/webapp/MyAce.scala | Scala | agpl-3.0 | 983 |
package uk.gov.bis.levyApiMock.data.oauth2
import org.joda.time.{DateTime}
import scala.concurrent.{ExecutionContext, Future}
case class AuthRecord(
accessToken: String,
refreshToken: Option[String],
refreshedAt: Option[DateTime],
... | SkillsFundingAgency/das-alpha-hmrc-api-mock | src/main/scala/uk/gov/bis/levyApiMock/data/oauth2/AuthRecordOps.scala | Scala | mit | 1,724 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/codegen/calls/MultiTypeMethodCallGen.scala | Scala | apache-2.0 | 1,648 |
package com.sksamuel.elastic4s.requests.security.roles.admin
case class DeleteRoleResponse(found: Boolean) | sksamuel/elastic4s | elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/security/roles/admin/DeleteRoleResponse.scala | Scala | apache-2.0 | 107 |
package paperdoll.scalaz
import scalaz.ReaderT
import scalaz.Reader
import paperdoll.core.effect.Effects.sendTU
import scalaz.Functor
import paperdoll.core.effect.Effects
import paperdoll.core.layer.Layer
object ReaderTLayer {
def sendReaderT[F[_]: Functor, I, A](readerT: ReaderT[F, I, A]): Effects.Two[Reader_[I],... | m50d/paperdoll | scalaz/src/main/scala/paperdoll/scalaz/ReaderTLayer.scala | Scala | apache-2.0 | 398 |
package co.ledger.wallet.web.ripple.debug
import co.ledger.wallet.core.device.Device
import co.ledger.wallet.core.device.ripple.LedgerApi
import co.ledger.wallet.core.utils.{DerivationPath, HexUtils}
import co.ledger.wallet.core.wallet.ripple.{XRP, RippleAccount}
import co.ledger.wallet.web.ripple.services.{DeviceServ... | LedgerHQ/ledger-wallet-ripple | src/main/scala/co/ledger/wallet/web/ripple/debug/TransactionDebugInterface.scala | Scala | mit | 4,545 |
package com.wuyuntao.aeneas.migration.example.migrations
import com.wuyuntao.aeneas.migration.Migration
import com.wuyuntao.aeneas.migration.dsl.DbModifier
class CreateUserByIdViewTable extends Migration {
def version = 20151030185645595L
def up(db: DbModifier) = {
db.executeSql("""CREATE TABLE user_b... | wuyuntao/Aeneas | aeneas-migration-example/src/main/scala/com/wuyuntao/aeneas/migration/example/migrations/V20151030185645595_CreateUserByIdViewTable.scala | Scala | apache-2.0 | 583 |
/*
* Copyright 2001-2009 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... | kevinwright/scalatest | src/examples/scala/org/scalatestexamples/fixture/funsuite/WithTempFileFromConfigMapExampleSuite.scala | Scala | apache-2.0 | 1,830 |
// Copyright 2014-2018 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 ... | CommBank/answer | project/build.scala | Scala | apache-2.0 | 2,369 |
package aia.channels
// start with multi-jvm:test-only aia.channels.ReliableProxySampleSpec
import org.scalatest.{WordSpecLike, BeforeAndAfterAll, MustMatchers}
import akka.testkit.ImplicitSender
import akka.actor.{Props, Actor}
/**
* Hooks up MultiNodeSpec with ScalaTest
*/
import akka.remote.testkit.MultiNodeS... | RayRoestenburg/akka-in-action | chapter-channels/src/multi-jvm/scala/aia/channels/ProxyMultiJvm.scala | Scala | mit | 2,518 |
package bot.line.model.event
trait Source {
val `type`: String
}
case class UserSource(id: String) extends Source {
override val `type`: String = "user"
}
case class GroupSource(id: String) extends Source {
override val `type`: String = "group"
}
case class RoomSource(id: String) extends Source {
override v... | xoyo24/akka-http-line-bot | src/main/scala/bot/line/model/event/Source.scala | Scala | mit | 349 |
import scala.collection.immutable.Map
import scala.collection.Seq
object ETL {
def transform(data: Map[Int, Seq[String]]): Map[String, Int] = {
Map(
data
.map { case (k, v) => v.zip(List.fill(v.length)(k)) }
.toSeq
.flatMap(x => x)
.map(t => (t._1.toLowerCase, t._2)): _*)
... | stanciua/exercism | scala/etl/src/main/scala/Etl.scala | Scala | mit | 324 |
package net.tomasherman.specus.common.api.grid.config
/**
* This file is part of Specus.
*
* Specus 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)... | tomasherman/specus | common_api/src/main/scala/grid/config/Constants.scala | Scala | gpl-3.0 | 841 |
package com.geteit.rcouch.actors
import akka.actor.{Props, Actor, ActorLogging}
import com.geteit.rcouch.Settings.NodeConfig
import java.net.InetSocketAddress
import com.geteit.rcouch.memcached.Memcached
import com.geteit.rcouch.actors.NodeActor.MemcachedAddress
import com.geteit.rcouch.couchbase.Couchbase.Node
/**
... | zbsz/reactive-couch | src/main/scala/com/geteit/rcouch/actors/NodeActor.scala | Scala | apache-2.0 | 1,225 |
package nl.lpdiy.incubator.gpio
import akka.actor.{Actor, Cancellable}
import scala.concurrent.duration.{FiniteDuration, _}
import scala.language.postfixOps
trait TimerTaskActor {
this: Actor =>
private var timer: Option[Cancellable] = None
def startTimer(callback: () => Unit, interval: FiniteDuration) = {
... | dragoslav/incubator | core/src/main/scala/nl/lpdiy/incubator/gpio/TimerTaskActor.scala | Scala | apache-2.0 | 560 |
package controllers
import models.Product
import play.api.data.Form
import play.api.data.Forms._
import play.api.i18n.Messages
import play.api.mvc.{Flash, Action, Controller}
/**
* Authors: Hilton et al., 2013
* Re-Created by bpupadhyaya on 7/9/16.
*/
object Products extends Controller {
/**
*
* @pa... | bpupadhyaya/PlayingWithPlay | PlayingWithPlayScala/app/controllers/Products.scala | Scala | mit | 3,467 |
/*
* Copyright 2011 Simple Finance, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | KirinDave/Clipping | src/main/scala/com/banksimple/clipping/ManagementStrategies/SynchronousManagementStrategy.scala | Scala | apache-2.0 | 2,786 |
package org.scalacoin.util
import org.scalacoin.protocol.script.ScriptSignature
import org.scalacoin.protocol.CompactSizeUIntImpl
import org.scalacoin.script.constant.ScriptNumberImpl
import org.scalatest.{FlatSpec, MustMatchers}
/**
* Created by chris on 2/8/16.
*/
class NumberUtilTest extends FlatSpec with MustM... | TomMcCabe/scalacoin | src/test/scala/org/scalacoin/util/NumberUtilTest.scala | Scala | mit | 5,732 |
/*
* 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/extensions/package.scala | Scala | epl-1.0 | 6,680 |
package org.sandbox.chat.cluster
import scala.concurrent.duration.DurationInt
import org.sandbox.chat.SettingsActor
import akka.actor.Actor
import akka.actor.ActorLogging
import akka.actor.ActorRef
import akka.actor.OneForOneStrategy
import akka.actor.Props
import akka.actor.SupervisorStrategy
import akka.actor.Term... | hustbill/ScalaDemo | src/main/scala/org/sandbox/chat/cluster/ChatClusterReaper.scala | Scala | gpl-2.0 | 1,939 |
/*
* 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 ... | foryou2030/incubator-carbondata | integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala | Scala | apache-2.0 | 12,626 |
package engine
trait Cache {
private var _cache: Map[String, Any] = Map()
def put[T](name: String, value: T) = _cache += (name -> value)
def get[T](name: String): Option[T] = {
if (_cache contains name)
Some(_cache(name).asInstanceOf[T])
else
None
}
def contains(name: String): Boolean ... | mpod/scala-workflow | backend/src/main/scala/engine/Cache.scala | Scala | gpl-3.0 | 346 |
package io.coral.lib
import scala.collection.mutable.{ArrayBuffer, Queue, Stack}
case class Node[K](value:K, var left:Option[Node[K]], var right:Option[Node[K]],var parent:Option[Node[K]]) {
def hasLeft:Boolean = if (left!=None) true else false
def hasRight:Boolean = if (right!=None) true else false
def hasPare... | daishichao/coral | runtime-api/src/main/scala/io/coral/lib/Tree.scala | Scala | apache-2.0 | 6,212 |
import java.lang.System._
import java.text.DecimalFormat
import com.datastax.driver.core.exceptions.InvalidQueryException
import com.datastax.spark.connector._
import com.datastax.spark.connector.cql.CassandraConnector
import kafka.serializer.StringDecoder
import org.apache.spark.SparkConf
import org.apache.spark.stre... | kgrodzicki/cloud-computing-specialization | capstone/workspace/task2/task2group2q2/src/main/scala/App.scala | Scala | mit | 4,861 |
//-*- coding: utf-8-unix -*-
/**
* (C) IT Sky Consulting GmbH 2014
* http://www.it-sky-consulting.com/
* Author: Karl Brodowsky
* Date: 2014-05-20
* License: GPL v2 (See https://de.wikipedia.org/wiki/GNU_General_Public_License )
*
*/
object ClosureWithoutClass {
def main(args : Array[String]) : Unit = {
va... | 8l/sysprogramming-examples | scala/ClosureWithoutClass.scala | Scala | gpl-2.0 | 541 |
package org.http4s
import org.http4s.Uri.{Authority, Host, IPv4, IPv6, RegName, Scheme}
import org.http4s.UriTemplate._
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
import scala.util.{Failure, Success, Try}
/**
* Simple representation of a URI Template that can be rendered as RFC6570
... | hvesalai/http4s | core/src/main/scala/org/http4s/UriTemplate.scala | Scala | apache-2.0 | 21,189 |
package io.sqooba.oss.timeseries
import java.util.concurrent.TimeUnit
import io.sqooba.oss.timeseries.immutable.{ContiguousTimeDomain, EmptyTimeSeries, TSEntry}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should
// scalastyle:off magic.number
// scalastyle:off file.size.limit
trait TimeSe... | Shastick/scala-timeseries-lib | src/test/scala/io/sqooba/oss/timeseries/TimeSeriesTestBench.scala | Scala | apache-2.0 | 42,660 |
/*
* Copyright 2014 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 | blaze-core/src/main/scala/org/http4s/blazecore/util/FlushingChunkWriter.scala | Scala | apache-2.0 | 1,795 |
package org.garage.guru.domain
import org.scalacheck.{Properties, Gen}
import org.scalacheck.Prop._
object VehicleIdProperties extends Properties("Vehicle id"){
val validVehicleIdStrGen = Gen.identifier
val validVehicleIdGen = validVehicleIdStrGen.map(Vehicle.id)
val invalidVehicleIdGen = Gen.oneOf("", " "... | ddd-fun/garage-guru-fun | src/test/scala/org/garage/guru/domain/VehicleProperties.scala | Scala | apache-2.0 | 1,157 |
package thistle.core
case class MatchSequence[T](sequence: Seq[T]) {
private lazy implicit val series =
sequence.toVector
def filter(ep: ElementPredicate[T]) =
series
.view
.zipWithIndex
.filter{case(k, i) => ep(new ElementState(i){override lazy val value = k})}
.map(_._1)
.f... | smarden1/thistle | src/main/scala/thistle/core/MatchSequence.scala | Scala | mit | 1,203 |
package io.therealbuggy.remotechest
import java.io.File
import java.util.logging.Logger
import io.therealbuggy.remotechest.api.{RemoteChestAPI, API}
import io.therealbuggy.remotechest.configuration.Configuration
import io.therealbuggy.remotechest.listeners.RemoteChestListener
import io.therealbuggy.remotechest.saver.... | JonathanxD/RemoteChest | src/io/therealbuggy/remotechest/RemoteChest.scala | Scala | agpl-3.0 | 3,367 |
/*
* Copyright 2016 Baltnet Communications LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... | theranger/sbt-wsdl2java | src/main/scala/ee/risk/sbt/plugins/wsdl2java/ssl/TrustStore.scala | Scala | apache-2.0 | 2,236 |
/*
* Copyright (c) 2015-2022 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.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.ap... | opencypher/openCypher | tools/tck-inspection/src/test/scala/org/opencypher/tools/tck/inspection/diff/TckTreeDiffTest.scala | Scala | apache-2.0 | 13,244 |
package avrohugger
package generators
import avrohugger.format.abstractions.SourceFormat
import avrohugger.input.DependencyInspector
import avrohugger.input.NestedSchemaExtractor
import avrohugger.input.reflectivecompilation.schemagen._
import avrohugger.input.parsers.{ FileInputParser, StringInputParser}
import avroh... | julianpeeters/avrohugger | avrohugger-core/src/main/scala/generators/FileGenerator.scala | Scala | apache-2.0 | 3,657 |
package api
import akka.testkit.TestActorRef
import domain._
import org.specs2.matcher.Scope
import org.specs2.mock._
import org.specs2.mutable.Specification
import spray.http.StatusCodes
import spray.httpx.Json4sSupport
import spray.testkit.Specs2RouteTest
import scala.concurrent.duration.FiniteDuration
import akka.... | sbondor/sunwatch | server/src/test/scala/api/WeatherApiSpecs.scala | Scala | mit | 1,943 |
package com.codesimples.objectives.persistence.adapter.user
trait NewUserPersistenceAdapter {
def saveUser(map: Map[String, AnyRef])
def findUserById(id: String): Map[String, AnyRef]
}
| agnaldo4j/estudos_arquitetura_limpa_scala | planner-usecases/src/main/scala/com/codesimples/objectives/persistence/adapter/user/NewUserPersistenceAdapter.scala | Scala | mit | 190 |
/*
* # Trove
*
* This file is part of Trove - A FREE desktop budgeting application that
* helps you track your finances, FREES you from complex budgeting, and
* enables you to build your TROVE of savings!
*
* Copyright © 2016-2019 Eric John Fredericks.
*
* Trove is free software: you can redistribute it ... | emanchgo/budgetfree | src/main/scala/trove/ui/tracking/AccountPane.scala | Scala | gpl-3.0 | 1,648 |
package com.plasmaconduit.framework.routes.destinations
import com.plasmaconduit.framework.mvc.Controller
import com.plasmaconduit.framework.{HttpRouteResult, HttpRoute, HttpRequest}
import com.plasmaconduit.framework.string.StringMatcher
final case class HttpVhostRoute[R <: HttpRequest[R]](host: StringMatcher, contr... | plasmaconduit/plasmaconduit-framework | src/main/scala/com/plasmaconduit/framework/routes/destinations/HttpVhostRoute.scala | Scala | mit | 572 |
/**
* 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/equality/DiffEqualityInvestigator.scala | Scala | lgpl-3.0 | 1,071 |
/*
* 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... | wzhongyuan/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/ops/MultplySpec.scala | Scala | apache-2.0 | 1,244 |
package huffman
import collection.mutable.PriorityQueue
sealed abstract class Tree[T] extends Ordered[Tree[T]] {
def weight: Int
override def compare(that: Tree[T]): Int = that.weight compare this.weight
}
case class Leaf[T](item: T, weight: Int) extends Tree[T]
case class Fork[T](left: Tree[T], right: Tree[... | anishathalye/huffman | src/main/scala/huffman/Tree.scala | Scala | mit | 774 |
import com.twitter.finagle.Mysql
import com.twitter.finagle.mysql.{ResultSet, Row, QueryRequest, LongValue, IntValue}
import com.twitter.util.Await
import com.twitter.finagle.client.DefaultPool
import com.twitter.conversions.DurationOps._
object Shared {
//#processRow
def processRow(row: Row): Option[Long] =
r... | luciferous/finagle | doc/src/sphinx/code/protocols/mysql.scala | Scala | apache-2.0 | 1,695 |
/*
* Commentary
* Copyright (C) 2017 Michael Dippery <[email protected]>
*
* 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) an... | mdippery/commentary | src/main/scala/com/mipadi/commentary/reddit/db/mongodb/internal.scala | Scala | gpl-3.0 | 1,529 |
/*
* 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-eval/shared/src/test/scala/monix/eval/CoevalNowSuite.scala | Scala | apache-2.0 | 3,541 |
/*
* Copyright 2012 IL <iron9light AT gmali DOT 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 applicabl... | iron9light/ideacolorschemes-plugin | src/main/scala/com/ideacolorschemes/ideacolor/Sandbox.scala | Scala | apache-2.0 | 3,099 |
package scray.hdfs.index.format
import java.util.ArrayList
import java.util.concurrent.Executors
import java.util.concurrent.Future
import com.typesafe.scalalogging.LazyLogging
class Buffer(batchSize: Int, path: String) extends LazyLogging {
var idxBuffer = new ArrayList[IndexFileRecord](batchSize)
var previousI... | scray/scray | scray-hdfs/modules/scray-hdfs-service-adapter/src/main/scala/scray/hdfs/index/format/Buffer.scala | Scala | apache-2.0 | 2,048 |
package com.wlangiewicz
import java.net.InetAddress
import java.util.concurrent.Future
import org.bitcoinj.core._
import org.bitcoinj.params.TestNet3Params
import org.bitcoinj.store.{MemoryBlockStore, BlockStore}
import org.bitcoinj.utils.BriefLogFormatter
/**
* Downloads the block given a block hash from the localh... | wlk/bitcoinj-scala-examples | src/main/scala/FetchBlockTestNet.scala | Scala | apache-2.0 | 1,773 |
import org.scalatest._
import pushka._
import pushka.annotation.pushka
import scala.annotation.StaticAnnotation
object SealedTraitSpec {
abstract class Rgb(r: Int, g: Int, b: Int)
@pushka sealed trait Color
object Color {
case object Red extends Rgb(255, 0, 0) with Color
case object Green extends Rgb... | fomkin/pushka | core/src/test/scala/SealedTraitSpec.scala | Scala | apache-2.0 | 2,576 |
package org.jetbrains.plugins.scala.dfa
import org.jetbrains.plugins.scala.dfa.BoolSemiLat.{False, Top, True}
import org.jetbrains.plugins.scala.dfa.lattice.{JoinSemiLattice, JoinSemiLatticeSpec, HasBottom}
import org.scalatest.prop.TableFor3
class BoolSemiLatSpec extends JoinSemiLatticeSpec[BoolSemiLat] {
import B... | JetBrains/intellij-scala | scala/dfa/test/org/jetbrains/plugins/scala/dfa/BoolSemiLatSpec.scala | Scala | apache-2.0 | 1,913 |
/*******************************************************************************
* Copyright 2017 Capital One Services, LLC and Bitwise, 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... | capitalone/Hydrograph | hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/components/utils/SchemaUtils.scala | Scala | apache-2.0 | 2,962 |
package com.twitter.finagle.cacheresolver
import com.twitter.common.quantity.{Time, Amount}
import com.twitter.common.zookeeper.ZooKeeperClient
import com.twitter.concurrent.Broker
import com.twitter.conversions.time._
import com.twitter.finagle.service.Backoff
import com.twitter.finagle.stats.StatsReceiver
import com... | lukiano/finagle | finagle-cacheresolver/src/main/scala/com/twitter/finagle/cacheresolver/ZookeeperStateMonitor.scala | Scala | apache-2.0 | 7,225 |
package ru.maizy.ambient7.core.tests
/**
* Copyright (c) Nikita Kovaliov, maizy.ru, 2016-2017
* See LICENSE.txt for details.
*/
import java.nio.file.Paths
import org.scalatest.{ FlatSpec, Matchers }
abstract class BaseSpec extends FlatSpec with Matchers {
def getResourcePathString(relPath: String): String = {
... | maizy/ambient7 | core/src/test/scala/ru/maizy/ambient7/core/tests/BaseSpec.scala | Scala | apache-2.0 | 468 |
package regolic.dpllt.qfeuf
import regolic.asts.core.Trees._
import regolic.asts.core.Manip._
import regolic.asts.fol.Trees._
/*
* Flatten nested function calls by introducing auxiliary variables
* Needs one extra equality compared to "Fast congruence closure with
* extensions" paper
*/
object Flattener {
priv... | regb/scabolic | src/main/scala/regolic/dpllt/qfeuf/Flattener.scala | Scala | mit | 3,681 |
import com.mohiva.play.silhouette.api.actions.SecuredErrorHandler
import javax.inject._
import play.api.http.DefaultHttpErrorHandler
import play.api._
import play.api.i18n.{I18nSupport, Messages, MessagesApi}
import play.api.mvc.Results.{Forbidden, Unauthorized}
import play.api.mvc._
import play.api.routing.Router
imp... | scalableminds/webknossos | app/ErrorHandler.scala | Scala | agpl-3.0 | 1,058 |
package org.neilconcepts
import scalaz._; import Scalaz._
import org.scalameter._
import scalaz.Memo._
object SimpleKeyStore extends App {
private val mutCache = scala.collection.mutable.Map[Int, String]()
private def setCache(a: Int): String = s"entry:$a"
private val cache = immutableHashMapMemo {
entry: I... | bneil/scalaz_playground | src/main/scala/org/neilconcepts/SimpleKeyStore.scala | Scala | mit | 773 |
package mesosphere.marathon.upgrade
import akka.actor.{ ActorLogging, ActorRef, Actor }
import mesosphere.marathon.core.readiness.{ ReadinessCheckExecutor, ReadinessCheckResult }
import mesosphere.marathon.core.task.Task
import mesosphere.marathon.core.task.tracker.TaskTracker
import mesosphere.marathon.core.event.{ D... | timcharper/marathon | src/main/scala/mesosphere/marathon/upgrade/ReadinessBehavior.scala | Scala | apache-2.0 | 6,823 |
package com.taxis99.aws
import scala.collection.JavaConversions._
import com.amazonaws.{ Protocol, ClientConfiguration }
import com.amazonaws.auth.BasicAWSCredentials
import com.amazonaws.services.s3.AmazonS3Client
/**
* Helper to handle S3 Interface
*/
class S3Helper(accessKey: String, secretKey: String, bucketNa... | mtrovo/awsscala | src/main/scala/com/taxis99/aws/S3Helper.scala | Scala | apache-2.0 | 809 |
package com.github.dronegator.nlp.vocabulary
import com.github.dronegator.nlp.common.Probability
import com.github.dronegator.nlp.component.tokenizer.Tokenizer.{Token, Word}
/**
* Created by cray on 9/18/16.
*/
object VocabularyImplStored {
def apply(vocabulary: Vocabulary) =
new VocabularyImplStored(
... | dronegator/nlp | wordmetrix/src/main/scala/com/github/dronegator/nlp/vocabulary/VocabularyImplStored.scala | Scala | apache-2.0 | 2,674 |
def canEqual(other: Any) = other.isInstanceOf[Rectangle]
override def equals(other: Any) =
if (other.isInstanceOf[Rectangle]) {
val otherRectangle = other.asInstanceOf[Rectangle]
otherRectangle.canEqual(this) &&
this.a == otherRectangle.a &&
this.b == otherRectangle.b
}
else false
override def has... | grzegorzbalcerek/scala-exercises | Figures/stepRectangleEquals.scala | Scala | bsd-2-clause | 342 |
/*
* 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 ... | saltstar/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/ContinuousSuite.scala | Scala | apache-2.0 | 10,382 |
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.