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 fr.renoux.gaston.engine
import com.typesafe.scalalogging.Logger
import fr.renoux.gaston.engine.PlanningSpaceNavigator.Move
import fr.renoux.gaston.model._
import scala.collection.View
import scala.util.Random
/** Tools to explore the space solution for plannings (ie, not doing the assignment). Schedules ret... | gaelrenoux/gaston | src/main/scala/fr/renoux/gaston/engine/PlanningSpaceNavigator.scala | Scala | apache-2.0 | 8,340 |
package be.objectify.batch.concurrent
import scala.collection.{immutable, mutable}
import akka.actor.{Terminated, ActorLogging, Actor, ActorRef}
/**
*
* @param eventListener
*/
class Master(eventListener: ActorRef) extends Actor with ActorLogging {
import Protocol._
val consumers = mutable.Map.empty[ActorRef... | schaloner/akka-batch | src/main/scala/be/objectify/batch/concurrent/Master.scala | Scala | apache-2.0 | 4,666 |
package pl.touk.nussknacker.ui.api.helpers
import cats.data.NonEmptyList
import pl.touk.nussknacker.engine.api.definition._
import pl.touk.nussknacker.engine.api.process.{ProcessName, VersionId}
import pl.touk.nussknacker.engine.api.typed.typing.Typed
import pl.touk.nussknacker.engine.api.{FragmentSpecificData, MetaDa... | TouK/nussknacker | ui/server/src/test/scala/pl/touk/nussknacker/ui/api/helpers/ProcessTestData.scala | Scala | apache-2.0 | 12,897 |
/** Copyright 2015, Metreta Information Technology s.r.l. */
package com.metreta.spark.orientdb.connector.api
import com.metreta.spark.orientdb.connector.utils.BaseOrientDbFlatSpec
class OrientDBConnectorConfSpec extends BaseOrientDbFlatSpec {
it should "match a configuration with the same settings" in {
val... | metreta/spark-orientdb-connector | spark-orientdb-connector/src/test/scala/com/metreta/spark/orientdb/connector/api/OrientDBConnectorConfSpec.scala | Scala | apache-2.0 | 461 |
/**
* Angles
* Copyright (C) 2014 Sebastian Schelter
*
* 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) any later version.
*
* Thi... | sscdotopen/angles | src/main/scala/io/ssc/angles/pipeline/CrawlUris.scala | Scala | gpl-3.0 | 1,862 |
package nest.sparkle.http
import spray.http.StatusCodes
import spray.httpx.marshalling.Marshaller
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success, Try}
import spray.routing._
import nest.sparkle.measure.StartedSpan
import nest.sparkle.util.Log
/** Directives to add timing mea... | mighdoll/sparkle | http-common/src/main/scala/nest/sparkle/http/TimingDirectives.scala | Scala | apache-2.0 | 1,413 |
package com.zobot.client.packet.definitions.clientbound.play
import com.zobot.client.packet.Packet
case class EntityStatus(entityId: Any, entityStatus: Any) extends Packet {
override lazy val packetId = 0x1B
override lazy val packetData: Array[Byte] =
fromAny(entityId) ++
fromAny(entityStatus)
}
| BecauseNoReason/zobot | src/main/scala/com/zobot/client/packet/definitions/clientbound/play/EntityStatus.scala | Scala | mit | 312 |
/*
* Copyright 2009-2011 WorldWide Conferencing, 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 applica... | pbrant/framework | web/webkit/src/main/scala/net/liftweb/sitemap/XmlMenu.scala | Scala | apache-2.0 | 1,545 |
package opennlp.scalabha.ccg
import scala.collection.breakOut
/** A CkyParser that uses the given lexicon and set of rules. */
class CkyParser(lexicon: Map[String, Set[Cat]], rules: List[Rule]) {
def apply(sentence: String): Set[Cat] = apply(sentence.split(" ").toIndexedSeq)
def apply(tokens: IndexedSeq[String]... | utcompling/Scalabha | src/main/scala/opennlp/scalabha/ccg/Cky.scala | Scala | apache-2.0 | 1,373 |
package turksem.util
trait PackagePlatformExtensions
| julianmichael/mturk-semantics | turksem/js/src/main/scala/turksem/util/package.scala | Scala | mit | 54 |
package io.github.rlazoti.tictactoe.models
sealed trait BoardState {
def settings: GameSettings
def player: Player
def opponentPlayer: Player
def positions: Array[Array[String]]
def lastMove: Option[Move]
def blanks(): Int =
positions.flatten.count { value =>
value.equals(settings.emptyPosition... | rlazoti/tictactoe-scala-react | src/main/scala/io/github/rlazoti/tictactoe/models/BoardState.scala | Scala | apache-2.0 | 3,362 |
/*
* 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 ... | actuaryzhang/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/ReduceNumShufflePartitionsSuite.scala | Scala | apache-2.0 | 22,063 |
package bindings
import com.google.inject.AbstractModule
import crypto.{HashService, MessageDigestHashService}
import daos._
import audits.{ EventDao, EventDaoSlick }
/**
* User: Eduardo Barrientos
* Date: 21/09/16
* Time: 05:55 PM
*/
class DefaultBindings extends AbstractModule {
def configure() = {
b... | kdoomsday/doomcart | app/bindings/DefaultBindings.scala | Scala | unlicense | 767 |
/**
* 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... | dchenbecker/kafka-sbt | core/src/main/scala/kafka/tools/VerifyConsumerRebalance.scala | Scala | apache-2.0 | 5,536 |
package au.com.dius.pact.provider.scalatest
import java.net.URL
import au.com.dius.pact.model.{MockProviderConfig, PactSpecVersion}
import io.netty.channel.ChannelHandler.Sharable
import unfiltered.netty.cycle.Plan.Intent
import unfiltered.netty.cycle.{Plan, SynchronousExecution}
import unfiltered.netty.{Server, Serv... | algra/pact-jvm | pact-jvm-provider-scalatest/src/test/scala/au/com/dius/pact/provider/scalatest/TestServer.scala | Scala | apache-2.0 | 1,161 |
/*
* 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 ... | pgandhi999/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsTestUtils.scala | Scala | apache-2.0 | 12,315 |
/*
* 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... | chipsenkbeil/incubator-toree | sparkr-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/sparkr/SparkRService.scala | Scala | apache-2.0 | 4,419 |
package net.elodina.mesos.zipkin.mesos
import java.util
import java.util.{Collections, Date}
import net.elodina.mesos.zipkin.Config
import net.elodina.mesos.zipkin.http.HttpServer
import net.elodina.mesos.zipkin.storage.Cluster
import net.elodina.mesos.zipkin.utils.Str
import net.elodina.mesos.zipkin.components._
im... | elodina/zipkin-mesos-framework | src/main/scala/net/elodina/mesos/zipkin/mesos/Scheduler.scala | Scala | apache-2.0 | 12,654 |
package specs
import io.youi.net._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class URLSpec extends AnyWordSpec with Matchers {
"URL" when {
"parsing" should {
"properly parse a simple URL" in {
val url = URL("http://www.outr.com")
url.host shou... | outr/youi | core/shared/src/test/scala/specs/URLSpec.scala | Scala | mit | 10,425 |
package net.liftmodules
import net.liftweb._
import http._
import org.specs2.mutable.Specification
object FoBoGCPSpec extends Specification {
"FoBoGCPSpec Specification".title
sequential
//PrettifyJun201
"With fobogcp.Toolkit.init set to fobogcp.Toolkit.PrettifyJun2011 the ResourceServer" should {
"all... | karma4u101/FoBo | Google-Code-Prettify/Google-Code-Prettify/src/test/scala/net/liftmodules/fobogcp/FoBoGCPSpec.scala | Scala | apache-2.0 | 1,953 |
import leon.lang._
import leon.lang.synthesis._
object Matching {
def t1(a: NatList) = choose( (x: Nat) => Cons(x, Nil()) == a)
abstract class Nat
case class Z() extends Nat
case class Succ(n: Nat) extends Nat
abstract class NatList
case class Nil() extends NatList
case class Cons(head: Nat, tail: NatL... | regb/leon | testcases/synthesis/archives/Matching.scala | Scala | gpl-3.0 | 343 |
package controllers
import twentysix.playr._
import twentysix.playr.simple._
import play.api.mvc._
import play.api.libs.json.Json
import models._
import play.api.cache.CacheApi
import javax.inject.Inject
class CompanyController @Inject() (implicit companyContainer: CompanyContainer, employeeContainer: EmployeeContain... | 26lights/PlayR | samples/playr-tutorial/app/controllers/CompanyController.scala | Scala | bsd-3-clause | 1,383 |
object ScalaMain extends App {
println("Hello World! from Scala")
}
| Codewars/codewars-runner | frameworks/gradle/src/main/scala/ScalaMain.scala | Scala | mit | 70 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-filter/src/main/scala/org/locationtech/geomesa/filter/function/DateToLong.scala | Scala | apache-2.0 | 1,027 |
package com.logikujo.www
package model
import reactivemongo.api.indexes.{Index, IndexType}
import reactivemongo.bson._
import reactivemongo.api._
import reactivemongo.api.collections.default.BSONCollection
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.{Success, Failure}
import org.slf4j.L... | AitorATuin/UnfilteredM | unfilteredMCore/src/main/scala/com/logikujo/www/model/Mongo.scala | Scala | mit | 1,818 |
package monocle.function
import monocle.MonocleSuite
import monocle.law.discipline.function.IndexTests
class IndexSpec extends MonocleSuite {
implicit def mmapIndex[K, V]: Index[MMap[K, V], K, V] = Index.fromIso(MMap.toMap)
checkAll("fromIso", IndexTests[MMap[Int, String], Int, String])
}
| rperry/Monocle | test/shared/src/test/scala/monocle/function/IndexSpec.scala | Scala | mit | 299 |
// Copyright 2016 Sam Halliday
// License: http://www.apache.org/licenses/LICENSE-2.0
import com.typesafe.sbt.SbtScalariform._
import java.util.concurrent.atomic.AtomicLong
import sbt.Keys._
import sbt._
import scala.util.Properties
/**
* A bunch of sensible defaults that fommil typically uses.
*/
object Sensible {... | sugakandrey/ensime-server | project/SensibleSettings.scala | Scala | gpl-3.0 | 6,028 |
package io.getquill.util
import scala.reflect.macros.whitebox.Context
import scala.util.Try
object LoadObject {
def apply[T](c: Context)(tpe: c.Type): Try[T] =
Try {
val cls = Class.forName(tpe.typeSymbol.fullName + "$")
val field = cls.getField("MODULE$")
field.get(cls).asInstanceOf[T]
}... | mentegy/quill | quill-core/src/main/scala/io/getquill/util/LoadObject.scala | Scala | apache-2.0 | 323 |
package knot.net.http.models.headers
import knot.net.http.models.{HttpHeader, HttpHeaderNames}
import knot.net.http.rendering.Rendering
case class Server(product: String) extends HttpHeader {
override type Self = Server
override def name = HttpHeaderNames.Server
override def renderValue[R <: Rendering](r: R):... | defvar/knot | knot-net/src/main/scala/knot/net/http/models/headers/Server.scala | Scala | mit | 344 |
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright 2016-2020 Daniel Urban and contributors listed in NOTICE.txt
*
* 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... | durban/exp-reagents | bench/src/main/scala/dev/tauri/choam/kcas/bench/Reset.scala | Scala | apache-2.0 | 920 |
package objsets
import TweetReader._
/**
* A class to represent tweets.
*/
class Tweet(val user: String, val text: String, val retweets: Int) {
override def toString: String =
"User: " + user + "\\n" +
"Text: " + text + " [" + retweets + "]"
}
/**
* This represents a set of objects of type `Tweet` in th... | comprakash/learning-scala | objsets/src/main/scala/objsets/TweetSet.scala | Scala | gpl-3.0 | 7,355 |
/*
* Copyright 2015 - 2016 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - 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... | ianclegg/eventuate | eventuate-core/src/it/scala/com/rbmhtechnology/eventuate/EventsourcedProcessorIntegrationSpec.scala | Scala | apache-2.0 | 7,584 |
package org.scalex
package model
case class Block(
txt: String,
// let empty if similar to txt
html: Option[String])
object Block extends Function2[String, Option[String], Block] {
def apply(txt: String, html: String): Block = {
val t = txt.trim
val h = trimHtml(html)
val ho = (h != t) option h f... | kzys/scalex | src/main/scala/model/Block.scala | Scala | mit | 620 |
package sample.cluster.transformation
//#messages
case class TransformationJob(text: String)
case class TransformationResult(text: String)
case class JobFailed(reason: String, job: TransformationJob)
case object BackendRegistration
//#messages
| linearregression/social_data_collector | src/main/scala/sample/cluster/transformation/TransformationMessages.scala | Scala | cc0-1.0 | 245 |
package one.lockstep.util.crypto
import one.lockstep.util._
class EncryptThenMac(hkdf: Hkdf, hmac: Hmac, cipher: Cipher) extends AuthCipher {
override def bitStrength: Int = Seq(hkdf, hmac, cipher).map(_.bitStrength).min
override def keygen(): SecretKey = hkdf.keygen()
override def keyLength: Int = hkdf.keyLen... | lockstep-one/vault | vault-common/src/main/scala/one/lockstep/util/crypto/EncryptThenMac.scala | Scala | agpl-3.0 | 1,850 |
package com.btcontract.wallet
import android.content.Intent
import android.os.{Build, Bundle}
import android.view.{View, ViewGroup}
import android.widget._
import com.btcontract.wallet.BaseActivity.StringOps
import com.btcontract.wallet.BuildConfig.{VERSION_CODE, VERSION_NAME}
import com.btcontract.wallet.Colors._
imp... | btcontract/wallet | app/src/main/java/com/btcontract/wallet/SettingsActivity.scala | Scala | apache-2.0 | 15,076 |
/***********************************************************************
* 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-memory/geomesa-cqengine/src/main/scala/org/locationtech/geomesa/memory/cqengine/GeoCQEngine.scala | Scala | apache-2.0 | 6,148 |
//**************************************************************************
//--------------------------------------------------------------------------
// ercesiMIPS Single Cycle Processor ALU Test
//
// Meng zhang
// version 0.1
//--------------------------------------------------------------------------
//*********... | zavs/ercesiMIPS | src/test/scala/SingleCycle/ALUTests.scala | Scala | gpl-3.0 | 2,705 |
package com.github.ponkin.bloom.server
import com.twitter.util.{ Future, FuturePool }
import scala.collection.Set
import scala.collection.concurrent.TrieMap
import scala.util.{ Try, Success, Failure }
import collection.JavaConverters._
import java.util.concurrent.Executors
import java.io.File
import java.nio.file.{... | ponkin/bloom | server/src/main/scala/com/github/ponkin/bloom/server/BloomFilterStoreImpl.scala | Scala | apache-2.0 | 4,815 |
package org.openmole.gui.client.core
import scaladget.tools._
import org.openmole.gui.ext.data._
import org.scalajs.dom.raw.HTMLElement
import rx._
import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue
import scala.concurrent.Future
import scala.util.{ Success, Failure }
import scalatags.JsDom.all._
impor... | openmole/openmole | openmole/gui/client/org.openmole.gui.client.core/src/main/scala/org/openmole/gui/client/core/Waiter.scala | Scala | agpl-3.0 | 3,164 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.tools.nsc
packag... | scala/scala | src/compiler/scala/tools/nsc/ast/TreeGen.scala | Scala | apache-2.0 | 17,531 |
package se.lu.nateko.cp.meta.icos
import java.time.Instant
import akka.stream.scaladsl.Source
import se.lu.nateko.cp.meta.api.UriId
import se.lu.nateko.cp.meta.core.data.{Position, Orcid, Station}
import se.lu.nateko.cp.meta.core.data.{Organization, Funding, Funder}
import se.lu.nateko.cp.meta.services.CpVocab
import... | ICOS-Carbon-Portal/meta | src/main/scala/se/lu/nateko/cp/meta/icos/TcMetadata.scala | Scala | gpl-3.0 | 4,594 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2007-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | benhutchison/scala-swing | src/main/scala/scala/swing/Table.scala | Scala | bsd-3-clause | 12,806 |
package sharry.backend.mail
import cats.data.OptionT
import sharry.common._
import sharry.store.doobie.DoobieMeta._
import sharry.store.doobie._
import sharry.store.records._
import doobie._
import doobie.implicits._
import emil.MailAddress
object Queries {
def findNotifyData(aliasId: Ident, shareId: Ident): Con... | eikek/sharry | modules/backend/src/main/scala/sharry/backend/mail/Queries.scala | Scala | gpl-3.0 | 3,078 |
/*
* 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.
*/
package org.scalajs.testsuite.library
import ... | scala-js/scala-js | test-suite/js/src/test/scala-new-collections/org/scalajs/testsuite/library/WrappedArrayToTest.scala | Scala | apache-2.0 | 595 |
package uk.co.pragmasoft.graphdb
import com.tinkerpop.blueprints.{Edge, TransactionalGraph, Vertex}
import org.mockito.Matchers.{any => anyArg, anyString, eq => argEq}
import org.mockito.Mockito.{verify, when}
import org.scalatest.mock.MockitoSugar
import org.scalatest.{FlatSpec, Matchers}
import uk.co.pragmasoft.grap... | galarragas/sgal | sgal-core/src/test/scala/uk/co/pragmasoft/graphdb/GraphDAOSpec.scala | Scala | apache-2.0 | 7,532 |
package com.twitter.finagle.http
import com.twitter.finagle.builder.{ClientBuilder, ServerBuilder}
import com.twitter.finagle.tracing._
import com.twitter.finagle.Service
import com.twitter.util.{Await, Closable, Future}
import java.net.{InetAddress, InetSocketAddress}
import org.junit.runner.RunWith
import org.scalat... | spockz/finagle | finagle-http/src/test/scala/com/twitter/finagle/http/TraceInitializationTest.scala | Scala | apache-2.0 | 3,654 |
// アクターのaskでタイムアウトを超過した場合どうなるかを試せるサンプル
package playground.actor.example5
import akka.actor._
import akka.pattern.ask
import akka.util.Timeout
import scala.concurrent.Await
import scala.concurrent.duration.Duration
import scala.concurrent.duration._
import scala.util.{ Success, Failure, Try }
class SlowActor extends... | suin/scala-playground | src/main/scala/playground/actor/example5/TimeoutAsk.scala | Scala | mit | 1,774 |
/*
* 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 ... | Dax1n/spark-core | core/src/main/scala/org/apache/spark/shuffle/hash/HashShuffleWriter.scala | Scala | apache-2.0 | 4,042 |
package org.openapitools.models
import io.circe._
import io.finch.circe._
import io.circe.generic.semiauto._
import io.circe.java8.time._
import org.openapitools._
import org.openapitools.models.PipelineRunartifacts
import scala.collection.immutable.Seq
/**
*
* @param Underscoreclass
* @param artifacts
* @para... | cliffano/swaggy-jenkins | clients/scala-finch/generated/src/main/scala/org/openapitools/models/PipelineRun.scala | Scala | mit | 1,533 |
/*^
===========================================================================
Helios - Core
===========================================================================
Copyright (C) 2013-2016 Gianluca Costa
===========================================================================
Licensed under the Apac... | giancosta86/Helios-core | src/main/scala/info/gianlucacosta/helios/files/FileUtils.scala | Scala | apache-2.0 | 2,337 |
package com.arcusys.valamis.util.export
import java.io.FileInputStream
import com.arcusys.valamis.util.serialization.JsonHelper
import com.arcusys.valamis.util.{FileSystemUtil, ZipBuilder}
trait ExportProcessor[T, R] {
protected def exportItemsImpl(zip: ZipBuilder, items: Seq[T]): Seq[R]
def exportItems(items: ... | igor-borisov/valamis | valamis-util/src/main/scala/com/arcusys/valamis/util/export/ExportProcessor.scala | Scala | gpl-3.0 | 625 |
package org.scalaide.extensions
package saveactions
import org.scalaide.core.text.Remove
import org.scalaide.util.eclipse.RegionUtils._
object RemoveDuplicatedEmptyLinesSetting extends SaveActionSetting(
id = ExtensionSetting.fullyQualifiedName[RemoveDuplicatedEmptyLines],
name = "Remove duplicated empty lines",
... | Kwestor/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/extensions/saveactions/RemoveDuplicatedEmptyLines.scala | Scala | bsd-3-clause | 1,151 |
/*
* Copyright (C) 2013-2015 by Michael Hombre Brinkmann
*/
package net.twibs.web
import javax.servlet.ServletContext
trait FilterResponderTrait extends CombiningResponder {
override def staticContentResponders(): List[Responder] = servletContextResponder :: super.staticContentResponders()
def servletContextR... | hombre/twibs | twibs-web/src/main/scala/net/twibs/web/FilterResponder.scala | Scala | apache-2.0 | 597 |
/*
* Copyright (C) 2013 Alcatel-Lucent.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
* Licensed to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of th... | sbocq/mbench | mbench/src/main/scala/mbench/fs/package.scala | Scala | apache-2.0 | 771 |
package scala.in.programming.packazee.three
/**
* @author loustler
* @since 03/31/2017 20:38
*/
package launch {
class Booster3
}
package bobsrockets {
package navigation {
package launch {
class Booster1
}
class MissionControl {
val booster1 = new launch.Booster1
val booster2... | loustler/scala | src/main/scala/scala/in/programming/packazee/PackageTrick.scala | Scala | mit | 493 |
package com.typesafe.slick.testkit.tests
import org.junit.Assert._
import com.typesafe.slick.testkit.util.{RelationalTestDB, TestkitTest}
class UnionTest extends TestkitTest[RelationalTestDB] {
import tdb.profile.simple._
override val reuseInstance = true
class Managers(tag: Tag) extends Table[(Int, String, St... | retronym/slick | slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/UnionTest.scala | Scala | bsd-2-clause | 3,456 |
package downstream
import japgolly.microlibs.compiletime._
import scala.reflect.macros.blackbox.Context
object DownstreamMacros {
def mainInit: Unit = macro DownstreamMacros.mainInitImpl
}
class DownstreamMacros(val c: Context) extends MacroUtils {
import c.universe._
private def sysProp(key: String): Option[... | japgolly/scalajs-react | downstream-tests/macros/src/main/scala-2/downstream/DownstreamMacros.scala | Scala | apache-2.0 | 821 |
package com.twitter.finagle.redis.exp
import com.twitter.finagle.dispatch.GenSerialClientDispatcher
import com.twitter.finagle.redis.protocol._
import com.twitter.finagle.transport.Transport
import com.twitter.util.{Future, Promise, Return, Throw}
import java.util.concurrent.atomic.AtomicReference
import scala.util.co... | mkhq/finagle | finagle-redis/src/main/scala/com/twitter/finagle/redis/exp/SubscribeDispatcher.scala | Scala | apache-2.0 | 1,815 |
/*
* Copyright 2015 Foundational Development
*
* 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 ... | rssvihla/datastax_work | spark_commons/commons/src/main/scala/pro/foundev/commons/benchmarking/Timer.scala | Scala | apache-2.0 | 864 |
package com.sandinh.couchbase.access
import com.couchbase.client.java.document.Document
import com.couchbase.client.java.error.DocumentDoesNotExistException
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
/** internal */
trait WithCaoKey2[T, A, B, U, D <: Document[U]] { self: ... | giabao/couchbase-scala | core/src/main/scala/com/sandinh/couchbase/access/WithCaoKey2.scala | Scala | apache-2.0 | 1,754 |
package com.textteaser.summarizer
class Config {
def lang = "EN"
object words {
def ideal = 20
}
object db {
def host = "localhost"
def port = 27017
def name = "tt_db"
def username = ""
def password = ""
}
} | ahmadassaf/Text-Teaser | src/main/scala/com/textteaser/summarizer/Config.scala | Scala | mit | 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 ... | goldmedal/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryStatusAndProgressSuite.scala | Scala | apache-2.0 | 12,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 may ... | brad-kaiser/spark | sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala | Scala | apache-2.0 | 26,917 |
package org.jetbrains.plugins.scala
package statistics
import java.util
import com.intellij.ide.plugins.PluginManager
import com.intellij.internal.statistic.AbstractApplicationUsagesCollector
import com.intellij.internal.statistic.beans.{GroupDescriptor, UsageDescriptor}
import com.intellij.openapi.extensions.PluginI... | LPTK/intellij-scala | src/org/jetbrains/plugins/scala/statistics/ScalaApplicationUsagesCollector.scala | Scala | apache-2.0 | 3,744 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.server
import akka.stream.Materializer
import com.lightbend.lagom.internal.scaladsl.server.{ ScaladslServerMacroImpl, ScaladslServiceRouter }
import com.lightbend.lagom.scaladsl.api.{ Descriptor, Service,... | rstento/lagom | service/scaladsl/server/src/main/scala/com/lightbend/lagom/scaladsl/server/LagomServer.scala | Scala | apache-2.0 | 7,471 |
package com.mycompany.scalcium.drugdosage
import java.io.File
import java.io.FileWriter
import java.io.PrintWriter
import scala.Array.canBuildFrom
import scala.collection.mutable.ArrayBuffer
import scala.io.Source
import org.junit.Ignore
import org.junit.Test
import com.mycompany.scalcium.utils.DictNER
import com.m... | sujitpal/scalcium | src/test/scala/com/mycompany/scalcium/drugdosage/DrugDosagePFSMTest.scala | Scala | apache-2.0 | 4,329 |
package rpg
/** Base class of attributes. Almost all RPG systems use a very limited set of attributes, so it is
* useful to implement them using a sealed class hierarchy and case objects:
*
* {{{
* sealed abstract class MyAttribute extends Attribute
*
* case object Strength extends MyAttribute
* case... | wookietreiber/arpgt | src/main/scala/Attribute.scala | Scala | gpl-3.0 | 894 |
package org.jetbrains.plugins.scala.worksheet.ammonite
import org.jetbrains.plugins.scala.editor.importOptimizer.ImportInfoProvider
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.ScImportExpr
final class AmmoniteImportInfoProvider extends Imp... | JetBrains/intellij-scala | scala/worksheet/src/org/jetbrains/plugins/scala/worksheet/ammonite/AmmoniteImportInfoProvider.scala | Scala | apache-2.0 | 544 |
package com.faacets.qalg
import org.scalatest.{FunSuite, NonImplicitAssertions}
import spire.math.Rational
import spire.syntax.eq._
import spire.syntax.innerProductSpace._
import spire.std.long._
import algebra._
import algos._
import math._
import syntax.all._
import Matrix.packs._
import optional.vecProductOrder._
... | denisrosset/qalg | tests/src/test/scala/qalg/algos/DeterminantSuite.scala | Scala | mit | 716 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.filters.csrf
import play.api.Application
import play.api.libs.ws.WSClient
import play.api.libs.ws.WSRequest
import play.api.libs.ws.WSResponse
import play.api.mvc._
import scala.concurrent.Future
/**
* Specs for the Scala per action CS... | benmccann/playframework | web/play-filters-helpers/src/test/scala/play/filters/csrf/ScalaCSRFActionSpec.scala | Scala | apache-2.0 | 2,251 |
object Test extends App {
val emptyTuple: Tuple = ()
val tuple: Tuple = ("1", "2", "3", "4", "5")
val tupleXXL: Tuple = ("11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35")
println(emptyTuple.splitAt(0))
printl... | som-snytt/dotty | tests/run/tuple-split.scala | Scala | apache-2.0 | 747 |
// Copyright: 2010 - 2017 https://github.com/ensime/ensime-server/graphs/contributors
// License: http://www.gnu.org/licenses/lgpl-3.0.en.html
package spray.json
import org.scalatest._
import Matchers._
import JsReader.ops._
import JsWriter.ops._
class BasicFormatsSpec extends WordSpec {
"The Int formats" should... | fommil/ensime-server | json/src/test/scala/spray/json/BasicFormatsSpec.scala | Scala | gpl-3.0 | 3,950 |
package api
import javax.inject.{Inject, Singleton}
import play.api.mvc._
@Singleton
class ApiDocController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {
def api: Action[AnyContent] = Action {
Redirect("/assets/lib/swagger-ui/index.html?url=/assets/openapi.json")
}
}
| cliffano/swaggy-jenkins | clients/scala-play-server/generated/app/api/ApiDocController.scala | Scala | mit | 301 |
package framian
class UntypedColumnSpec extends FramianSpec {
"ConcatColumn" should {
"be stable after reindex" in {
val col1 = TypedColumn(Column.dense(Array(1, 2)))
val col2 = TypedColumn(Column.dense(Array(3, 4)))
val col3 = ConcatColumn(col1, col2, 2)
val col = col3.reindex(Array(0,1,... | tixxit/framian | framian/src/test/scala/framian/UntypedColumnSpec.scala | Scala | apache-2.0 | 975 |
package com.jamontes79.scala.movielist.utils
import com.jamontes79.scala.movielist.preferences.impl.PreferenceServicesComponentImpl
import com.jamontes79.scala.movielist.utils.json.impl.JsonServicesComponentImpl
import com.jamontes79.scala.movielist.utils.net.impl.NetServicesComponentImpl
/**
* Created by alberto ... | jamontes79/movieList | src/main/scala/com/jamontes79/scala/movielist/utils/ComponentRegistryImpl.scala | Scala | apache-2.0 | 502 |
def prodToSum[A, B, C]: ((A, Either[B, C])) => Either[(A, B), (A, C)] = {
case (x, e) => e match {
case Left(y) => Left((x, y))
case Right(z) => Right((x, z))
}
} | hmemcpy/milewski-ctfp-pdf | src/content/1.6/code/scala/snippet34.scala | Scala | gpl-3.0 | 174 |
package org.jetbrains.plugins.scala.lang.psi.impl
import com.intellij.psi._
import org.jetbrains.plugins.scala.ScalaLanguage
object ScalaPsiChangeListener {
def apply(onPsiChange: PsiElement => Unit,
onPropertyChange: () => Unit): PsiTreeChangeListener = {
new ScalaPsiChangeListenerImpl(onPsiChang... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/impl/ScalaPsiChangeListener.scala | Scala | apache-2.0 | 3,132 |
package com.peterpotts.snake
import akka.actor.ActorSystem
import akka.testkit._
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
import scala.concurrent.Await
import scala.util.Random
@RunWith(classOf[JUnitRunner])
class ActorSna... | peterpotts/snake | src/test/scala/com/peterpotts/snake/ActorSnakeTest.scala | Scala | mit | 2,155 |
/**
* 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
* dist... | DigitalAssetCom/hlp-candidate | server/stresstest/src/main/scala/org/hyperledger/stresstest/Blocks2.scala | Scala | apache-2.0 | 3,411 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2016 Matthias Langer (t3l@threelights.de)
*
* 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.apa... | bashimao/ltudl | base/src/main/scala/edu/latrobe/RangeEx.scala | Scala | apache-2.0 | 14,973 |
package com.indix.pail
import com.indix.pail.PailLockType._
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
import org.slf4j.LoggerFactory
/**
* <b>Motivation</b> - When I have some jobs that are reading out of a pail location, consolidator runs and moves the
* files aroun... | ind9/dfs-datastores | dfs-datastores/src/main/scala/com/indix/pail/PailLock.scala | Scala | bsd-3-clause | 3,882 |
package com.intenthq.pucket.thrift.mapreduce
import com.intenthq.pucket.Pucket
import com.intenthq.pucket.TestUtils._
import com.intenthq.pucket.mapreduce.PucketOutputFormatSpec
import com.intenthq.pucket.test.model.ThriftTest
import com.intenthq.pucket.thrift.ThriftTestUtils._
import com.intenthq.pucket.thrift.{Thrif... | intenthq/pucket | thrift/src/test/scala/com/intenthq/pucket/thrift/mapreduce/ThriftPucketOutputFormatSpec.scala | Scala | mit | 1,126 |
package com.shrbank.bigdata.examples
/**
* Created by ShaoJie.Wu on 2017/4/14 15:19.
* 功能:
*
* 备注:
*/
object TCurrentTime {
def main(args: Array[String]): Unit = {
val num = 10000
var end:Long = 0
val start = System.currentTimeMillis()
for(i<-0 until num) {
end = System.currentTimeMil... | shrbank/SyncSpout | examples/src/main/scala/com/shrbank/bigdata/examples/TCurrentTime.scala | Scala | gpl-2.0 | 408 |
package fpinscala.parallelism
import java.util.concurrent._
import language.implicitConversions
object Par {
type Par[A] = ExecutorService => Future[A]
def run[A](s: ExecutorService)(a: Par[A]): Future[A] = a(s)
def unit[A](a: A): Par[A] = (es: ExecutorService) => UnitFuture(a) // `unit` is represented as a... | benen/fpinscala | exercises/src/main/scala/fpinscala/parallelism/Par.scala | Scala | mit | 7,791 |
package fs2
package async
package mutable
import fs2.Async.Change
import fs2._
import fs2.Stream._
import fs2.async.immutable
import fs2.util.Monad
/**
* A signal whose value may be set asynchronously. Provides continuous
* and discrete streams for responding to changes to it's value.
*/
trait Signal[F[_],A] exten... | japgolly/scalaz-stream | core/src/main/scala/fs2/async/mutable/Signal.scala | Scala | mit | 2,689 |
/*
* Copyright 2010-2011 Vilius Normantas <code@norma.lt>
*
* This file is part of Crossbow library.
*
* Crossbow 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 ... | ViliusN/Crossbow | crossbow-core/src/lt/norma/crossbow/indicators/WithHistory.scala | Scala | gpl-3.0 | 1,159 |
package com.sksamuel.elastic4s.handlers.index
import com.fasterxml.jackson.annotation.JsonProperty
import com.sksamuel.elastic4s.analysis.AnalysisBuilder
import com.sksamuel.elastic4s.handlers.ElasticErrorParser
import com.sksamuel.elastic4s.handlers.index.mapping.MappingBuilderFn
import com.sksamuel.elastic4s.handler... | sksamuel/elastic4s | elastic4s-handlers/src/main/scala/com/sksamuel/elastic4s/handlers/index/IndexTemplateHandlers.scala | Scala | apache-2.0 | 4,983 |
package org.bm.storesystem
import java.io.IOException
import java.nio.file.{FileSystems, Files, Path}
import org.bm.storesystem.{StoreSystemConfigReader => r}
/**
* .
* @author Baptiste Morin
*/
trait Config {
def storagePath: String = r.config.getProperty("storage.path", "./storesystem/storage")
def indexPa... | morinb/scala-store-system | src/main/scala/org/bm/storesystem/Config.scala | Scala | lgpl-3.0 | 1,001 |
import org.firedancer3d.math
object Main {
def main(args: Array[String]): Unit = {
}
}
| cyberthinkers/FireDancer3D | firedancer3d_jvm/src/main/scala/Main.scala | Scala | mit | 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 ... | rednaxelafx/apache-spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala | Scala | apache-2.0 | 43,014 |
package controllers
import javax.inject.Inject
import javax.inject.Singleton
import com.fang.{ErrorMessage, FriendModel}
import models.FriendDAO
import play.api.mvc.{Action, ActionBuilder, AnyContent, Controller}
import util.MyActions.MyAction
import util.{MyActions, ValidUser}
import upickle.default.write
import sc... | TianhaoFang/online-go | app/controllers/FriendController.scala | Scala | mit | 3,183 |
/*
* Copyright 2017 Workday, Inc.
*
* This software is available under the MIT license.
* Please see the LICENSE.txt file in this project.
*/
package com.workday.esclient
import com.fasterxml.jackson.core.JsonParseException
import com.fasterxml.jackson.databind.JsonMappingException
import com.google.common.annot... | Workday/escalar | src/main/scala/com/workday/esclient/JestUtils.scala | Scala | mit | 4,364 |
package org.rz.fps.week2.assignment
/**
* Main app.
*
* @author github.com/rozasdev
*/
object Main extends App {
import FunSets._
assert(contains(x => true, 100))
assert(contains(singletonSet(1), 1))
// unionSet = 1,2
val unionSet = union(singletonSet(1), singletonSet(2))
assert(contains(unionSe... | rozasdev/FPS | code/Week2/src/org/rz/fps/week2/assignment/Main.scala | Scala | apache-2.0 | 1,830 |
/*
* 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.interp... | scala/scala | src/repl-frontend/scala/tools/nsc/interpreter/jline/Reader.scala | Scala | apache-2.0 | 15,204 |
/*
* Copyright 2015 Simin You
*
* 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 ... | syoummer/SpatialSpark | src/main/scala/spatialspark/operator/SpatialOperator.scala | Scala | apache-2.0 | 807 |
/**
* 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... | serejja/kafka | src/test/ly/stealth/mesos/kafka/ClusterTest.scala | Scala | apache-2.0 | 3,317 |
/*
* 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/RequestPreludeSuite.scala | Scala | apache-2.0 | 892 |
/*
* Copyright 2015 Rik van der Kleij
*
* 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... | ericssmith/intellij-haskell | src/com/powertuple/intellij/haskell/util/HaskellProjecUtil.scala | Scala | apache-2.0 | 893 |
/*
* 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 ... | vadopolski/ignite | modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/top/VisorActivationCommandSpec.scala | Scala | apache-2.0 | 2,250 |
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.