code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package com.olegych.scastie.client
package components
import com.olegych.scastie.api.SnippetId
import japgolly.scalajs.react._, vdom.all._, extra._
final case class DownloadButton(snippetId: SnippetId) {
@inline def render: VdomElement = DownloadButton.component(this)
}
object DownloadButton {
implicit val reus... | OlegYch/scastie | client/src/main/scala/com.olegych.scastie.client/components/DownloadButton.scala | Scala | apache-2.0 | 974 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | ddseapy/geomesa | geomesa-accumulo/geomesa-accumulo-security/src/test/scala/org/locationtech/geomesa/accumulo/security/TestAuthorizationsProvider.scala | Scala | apache-2.0 | 1,205 |
/*
* Copyright (c) 2012, 2013 Roberto Tyley
*
* This file is part of 'BFG Repo-Cleaner' - a tool for removing large
* or troublesome blobs from Git repositories.
*
* BFG Repo-Cleaner is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* ... | NeilBryant/bfg-repo-cleaner | bfg-library/src/main/scala/com/madgag/git/bfg/model/package.scala | Scala | gpl-3.0 | 1,055 |
package rxgpio
import rxgpio.pigpio.PigpioLibrary
import scala.util.control.NonFatal
import scala.util.{Failure, Success, Try}
/**
*
*/
trait DigitalIO {
def gpioGetMode(gpio: Gpio)(implicit pigpio: PigpioLibrary): Try[PinMode]
def gpioSetMode(gpio: Gpio, mode: PinMode)(implicit pigpio: PigpioLibrary): Try... | jw3/rxgpio | core/src/main/scala/rxgpio/DigitalIO.scala | Scala | apache-2.0 | 1,642 |
/*
* Copyright (c) 2011 Orderly 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/licenses/L... | orderly/narcolepsy-scala | project/NarcolepsyBuild.scala | Scala | apache-2.0 | 1,413 |
/*******************************************************************************/
/* */
/* Copyright (C) 2017 by Max Lv <max.c.lv@gmail.com> */
/* Copyright (C) 2017 by Mygod Studio <contact-shadowsocks-android@mygod.... | 126ium/shadowsocks-android | plugin/src/main/scala/be/mygod/preference/SummaryPreference.scala | Scala | gpl-3.0 | 2,418 |
/*
* Copyright 2013 Maurício Linhares
*
* Maurício Linhares licenses this file 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 the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | outbrain/postgresql-async | postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/codec/MessageDecoder.scala | Scala | apache-2.0 | 2,602 |
/*
* Copyright 2017 Spotify AB.
*
* 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 ... | spotify/featran | examples/src/main/scala/Examples.scala | Scala | apache-2.0 | 8,290 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 Wes Lanning
*
* 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, ... | yareally/json-to-csv | src/com/cc/json2csv/Json2Csv.scala | Scala | mit | 9,347 |
/*
* 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 ... | HuaweiBigData/carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/datacompaction/CompactionSupportGlobalSortBigFileTest.scala | Scala | apache-2.0 | 5,729 |
package io.coppermine
package internal
sealed trait ManagerOut
case class MgrSend(pkg: Package) extends ManagerOut
case class MgrRetry(cmd: Command) extends ManagerOut
case object MgrNoop extends ManagerOut
case class ManagerM[A](k: Manager => (Manager, A)) {
def apply(mgr: Manager): (Manager, A) = k(mgr)
def m... | YoEight/scala-eventstore-lean | src/test/scala/io/coppermine/internal/ManagerM.scala | Scala | bsd-3-clause | 1,299 |
/*
* 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 ... | bOOm-X/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala | Scala | apache-2.0 | 26,774 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | Kegeruneku/rudder | rudder-core/src/main/scala/com/normation/rudder/repository/DirectiveRepository.scala | Scala | agpl-3.0 | 15,612 |
package fpinscala.datastructures
sealed trait List[+A] // `List` data type
case object Nil extends List[Nothing] // data constructor for `List`
case class Cons[+A](head: A, tail: List[A]) extends List[A]
object List { // `List` companion object
def sum(ints: List[Int]): Int = ints match { // Pattern matching exampl... | akkomar/fp-scala | exercises/src/main/scala/fpinscala/datastructures/List.scala | Scala | mit | 1,960 |
/*
* Copyright 2020 Precog Data
*
* 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 ... | djspiewak/quasar | common/src/main/scala/quasar/common/SortDir.scala | Scala | apache-2.0 | 1,063 |
/*
* 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/LastQuote.scala | Scala | gpl-3.0 | 1,427 |
package com.persist.logging
import akka.actor._
import LogActor.{AkkaMessage, LogActorMessage}
import scala.language.existentials
import scala.concurrent.Promise
import scala.collection.mutable
import TimeActorMessages._
/**
* Global state info for logging. Use with care!
*/
private[logging] object LoggingState ext... | nestorpersist/logging | logger/src/main/scala/com/persist/logging/LoggingState.scala | Scala | apache-2.0 | 2,009 |
package eu.daxiongmao.training.scala.chp7
object ControlStructures extends App{
println("from x to y (scala: TO y)")
for (i <- 1 to 4)
println("i = " + i)
println("from x to y-1 (scala: UNTIL y)")
for (i <- 1 until 4)
println("i = " + i)
println("from x to y-1 (scala: UNTIL y) with single condit... | guihome-diaz/training | progInScala/src/main/scala/eu/daxiongmao/training/scala/chp7/ControlStructures.scala | Scala | gpl-2.0 | 1,233 |
/**
* Copyright 2013-2015 PayPal
*
* 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 ... | 2rs2ts/cascade | http/src/main/scala/com/paypal/cascade/http/resource/NoParsing.scala | Scala | apache-2.0 | 1,227 |
/*
* 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 | streaming/src/test/scala/org/apache/spark/streaming/ui/StreamingJobProgressListenerSuite.scala | Scala | apache-2.0 | 12,043 |
package com.ecfront.ez.framework.core
import java.lang.reflect.ParameterizedType
import com.ecfront.common.{JsonHelper, Resp}
import com.ecfront.ez.framework.core.logger.Logging
import scala.reflect.runtime._
/**
* EZ服务适配器,用于将服务整合到EZ框架中
* 此对象路径要求为:`com.ecfront.ez.framework.service.服务标识.ServiceAdapter`
*
* @... | gudaoxuri/ez-framework | services/core/src/main/scala/com/ecfront/ez/framework/core/EZServiceAdapter.scala | Scala | apache-2.0 | 1,862 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | travisbrown/scalatest | src/test/scala/org/scalatest/DocSpecSpec.scala | Scala | apache-2.0 | 8,700 |
/*
* Copyright 2014-2016 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 ap... | amuramatsu/Laika | core/src/main/scala/laika/factory/RenderResultProcessor.scala | Scala | apache-2.0 | 1,634 |
package HackerRank.Training.DynamicProgramming
import java.io.{ByteArrayInputStream, IOException, InputStream, PrintWriter}
import java.util.InputMismatchException
import scala.collection.generic.CanBuildFrom
import scala.collection.mutable
import scala.language.higherKinds
/**
* Copyright (c) 2017 A. Roberto Fisc... | robertoFischer/hackerrank | src/main/scala/HackerRank/Training/DynamicProgramming/UnboundedKnapsack.scala | Scala | mit | 9,784 |
package org.bitcoins.gui.dlc
import org.bitcoins.core.protocol.dlc.models.DLCStatus
import scalafx.collections.ObservableBuffer
object GlobalDLCData {
var lastContractId: String = ""
var lastOracleSig: String = ""
var lastOracleAnnouncement: String = ""
var lastContractInfo: String = ""
val dlcs: Observabl... | bitcoin-s/bitcoin-s | app/gui/src/main/scala/org/bitcoins/gui/dlc/GlobalDLCData.scala | Scala | mit | 381 |
package adt.bson
import org.bson.types.ObjectId
import org.joda.time.{DateTimeZone, DateTime}
import scala.annotation.implicitNotFound
import scala.collection.generic
import scala.language.implicitConversions
import scala.language.higherKinds
import scala.reflect.ClassTag
import scala.util.Try
import scala.util.match... | jeffmay/bson-adt | bson-adt-core/src/main/scala/adt/bson/BsonReads.scala | Scala | apache-2.0 | 12,579 |
package io.aecor.liberator.macros
import scala.collection.immutable.Seq
import scala.meta._
class free extends scala.annotation.StaticAnnotation {
inline def apply(defn: Any): Any = meta {
defn match {
case Term.Block(Seq(t: Defn.Trait, companion: Defn.Object)) =>
FreeMacro(t, Some(companion))
... | aecor/liberator | macros/src/main/scala/io/aecor/liberator/macros/free.scala | Scala | mit | 2,292 |
package com.twitter.server.handler
import com.twitter.finagle.{Announcer, Service}
import com.twitter.finagle.http.{Request, Response}
import com.twitter.util.Future
import com.twitter.server.util.HttpUtils.newOk
class AnnouncerHandler extends Service[Request, Response] {
def apply(req: Request): Future[Response] =... | BuoyantIO/twitter-server | src/main/scala/com/twitter/server/handler/AnnouncerHandler.scala | Scala | apache-2.0 | 574 |
package scala.tasty.reflect // TODO move to scala.internal.tasty.reflect
import scala.quoted.QuoteContext
import scala.tasty.Reflection
import scala.internal.quoted.Unpickler
/** Tasty reflect abstract types
*
* ```none
*
* +- Tree -+- PackageClause
* +- Import
* +- Statement -+- Definitio... | som-snytt/dotty | library/src/scala/tasty/reflect/CompilerInterface.scala | Scala | apache-2.0 | 59,735 |
package ru.yandex.mysqlDiff
package diff
import model._
import script._
import Implicits._
/**
* Serialize diff model to script.
*/
class DiffSerializer(val context: Context) {
import context._
import TableDdlStatement._
protected def alterColumnScript(cd: ColumnDiff, table: TableModel) =
... | hkerem/mysql-diff | src/main/scala/ru/yandex/mysqlDiff/diff/DiffSerializer.scala | Scala | bsd-3-clause | 14,061 |
package com.twitter.finagle.integration
import com.twitter.concurrent.AsyncQueue
import com.twitter.finagle._
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finagle.http.codec.HttpClientDispatcher
import com.twitter.finagle.http.exp.IdentityStreamTransport
import com.twitter.finagle.stats.NullS... | adriancole/finagle | finagle-integration/src/test/scala/com/twitter/finagle/integration/ClientSessionTest.scala | Scala | apache-2.0 | 3,470 |
package proxy
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.webapp.WebAppContext
import org.scalatra.servlet.ScalatraListener
object JettyLauncher extends App {
val port = 8082
val server: Server = new Server(port)
val context = new WebAppContext()
context.setContextPath("/")
context.setR... | salimfadhley/megaproxy | src/main/scala/proxy/JettyLauncher.scala | Scala | mit | 515 |
/**
* 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... | cloudera/kafka | core/src/test/scala/unit/kafka/integration/UncleanLeaderElectionTest.scala | Scala | apache-2.0 | 12,127 |
package org.allenai.common
import java.nio.ByteBuffer
import java.nio.channels.FileChannel
import java.util.NoSuchElementException
import scala.io.Codec
/** A class that provides seekability to an interface similar to scala.io.Source. This is required
* because scala.io.Source only provides character offsets, whil... | jkinkead/common | core/src/main/scala/org/allenai/common/SeekableSource.scala | Scala | apache-2.0 | 13,670 |
package io.relayr.amqp
/** The queue server found nowhere to route the message */
case class UndeliveredException() extends Exception
| relayr/rabbitmq-scala-client | src/main/scala/io/relayr/amqp/UndeliveredException.scala | Scala | mit | 135 |
package com.ponkotuy.config
import java.io.File
import com.ponkotuy.data.MyFleetAuth
import com.typesafe.config.ConfigFactory
import org.apache.http.HttpHost
import scala.util.Try
/**
*
* @author ponkotuy
* Date: 14/02/23
*/
object ClientConfig {
lazy val config = {
val file = new File("application.conf")... | nekoworkshop/MyFleetGirls | client/src/main/scala/com/ponkotuy/config/ClientConfig.scala | Scala | mit | 1,817 |
class C(x: Int) { def foo = x }
object Test {
val c = new C(0)
import c.x
println(x)
}
| AlexSikia/dotty | tests/untried/neg/t2773.scala | Scala | bsd-3-clause | 95 |
package enumeratum
import UrlBinders._
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import org.scalatest.OptionValues._
import org.scalatest.EitherValues._
/** Created by Lloyd on 2/3/15.
*/
class UrlBindersSpec extends AnyFunSpec with Matchers {
describe(".pathBinder") {... | lloydmeta/enumeratum | enumeratum-play/src/test/scala/enumeratum/UrlBindersSpec.scala | Scala | mit | 8,319 |
/**
* 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"... | Chasego/kafka | core/src/test/scala/integration/kafka/server/GssapiAuthenticationTest.scala | Scala | apache-2.0 | 11,900 |
package com.seanshubin.builder.domain
import java.nio.charset.Charset
import java.nio.file.Path
import scala.collection.JavaConverters._
class StatefulLoggerImpl(pathToStoreState: Path, files: FilesContract, charset: Charset) extends StatefulLogger {
override def emitLines(lines: Seq[String]): Unit = {
val jav... | SeanShubin/builder | domain/src/main/scala/com/seanshubin/builder/domain/StatefulLoggerImpl.scala | Scala | unlicense | 402 |
// diversity-maximization: Diversity maximization in Streaming and MapReduce
// Copyright (C) 2016 Matteo Ceccarello <ceccarel@dei.unipd.it>
//
// 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... | Cecca/diversity-maximization | experiments/src/main/scala/it/unipd/dei/diversity/words/UCIBagOfWordsDataset.scala | Scala | gpl-3.0 | 6,396 |
/*
* Copyright (c) 2016. Fengguo 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 contribut... | arguslab/jawa-compiler | src/main/scala/org/argus/jawa/compiler/lexer/Keywords.scala | Scala | epl-1.0 | 962 |
package parameter
trait EnumCaseClass {
enum TypeParameter {
case Class[A]()
}
enum TypeParameters {
case Class[A, B]()
}
enum ValueParameter {
case Class(x: Int)
}
enum ValueParameters {
case Class(x: Int, y: Long)
}
enum EmptyClause {
case Class()
}
enum MultipleClauses... | JetBrains/intellij-scala | tasty/runtime/data/parameter/EnumCaseClass.scala | Scala | apache-2.0 | 423 |
package com.sksamuel.elastic4s.mappings
import com.sksamuel.elastic4s.{IndexType, Executable, ProxyClients}
import org.elasticsearch.action.admin.indices.mapping.delete.DeleteMappingResponse
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse
import org.elasticsearch.action.admin.indices.mapp... | alexander-svendsen/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/mappings/MappingDsl.scala | Scala | apache-2.0 | 2,334 |
/*
* Copyright 2009-2016 DigitalGlobe, 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 ag... | akarmas/mrgeo | mrgeo-core/src/main/scala/org/mrgeo/spark/FocalBuilder.scala | Scala | apache-2.0 | 4,246 |
package com.catinthedark.lib.network
trait IMessageBus {
def send(message: Message): Unit
def subscribe[T](clazz: Class[T], callback: (T, String) => Unit)
}
case class Wrapper(data: Any, className: String, sender: String)
trait Transport {
def send(message: Message): Unit
def setReceiver(receiver: (Wrapper)... | cat-in-the-dark/old48_36_game | core/src/main/scala/com/catinthedark/lib/network/IMessageBus.scala | Scala | mit | 337 |
package org.jetbrains.plugins.scala
package lang
package parser
/**
* @author ilyas
*/
import com.intellij.lang.PsiBuilder
import com.intellij.psi.tree.IElementType
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
trait ParserNode extends ScalaTokenTypes {
def lookAhead(builder: PsiBuilder, elems: IE... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/ParserNode.scala | Scala | apache-2.0 | 714 |
package org.lanyard.test
/** The T-Test */
case class TTest( ) {
}
| perian/Lanyard | src/main/scala/org/lanyard/test/TTest.scala | Scala | gpl-2.0 | 70 |
package com.lambtors.poker_api.module.poker.infrastructure.stub
import com.lambtors.poker_api.module.poker.domain.model.{Card, GameId, Player, PlayerId}
object PlayerStub {
def create(
playerId: PlayerId = PlayerIdStub.random(),
gameId: GameId = GameIdStub.random(),
firstCard: Card = CardStub.rand... | lambtors/poker-api | src/test/scala/com/lambtors/poker_api/module/poker/infrastructure/stub/PlayerStub.scala | Scala | mit | 468 |
package com.sksamuel.scrimage
import com.sksamuel.scrimage.scaling.ResampleOpScala
import org.apache.commons.io.IOUtils
import javax.imageio.ImageIO
import java.io.ByteArrayInputStream
import java.awt.image.BufferedImage
import scala.concurrent.ExecutionContext
// import org.imgscalr.Scalr
// import org.imgscalr.Sca... | carlosFattor/scrimage | scrimage-core/src/test/scala/com/sksamuel/scrimage/ScalingBenchmark.scala | Scala | apache-2.0 | 4,360 |
package mesosphere.marathon
package core.launchqueue.impl
import akka.Done
import akka.actor.ActorRef
import akka.pattern.ask
import akka.util.Timeout
import com.typesafe.scalalogging.StrictLogging
import mesosphere.marathon.core.async.ExecutionContexts
import mesosphere.marathon.core.instance.update.InstanceChange
im... | Caerostris/marathon | src/main/scala/mesosphere/marathon/core/launchqueue/impl/LaunchQueueDelegate.scala | Scala | apache-2.0 | 5,000 |
package io.reactors
import io.reactors.common.UnrolledRing
/** An event buffer that is simultaneously an event stream.
*
* Events are stored into the buffer with the `enqueue` method.
* Events are dequeued and simultaneously emitted with the `dequeue` method.
* Calling `unsubscribe` unreacts.
*
* '''Not... | storm-enroute/reactive-collections | reactors-core/shared/src/main/scala/io/reactors/EventBuffer.scala | Scala | bsd-3-clause | 2,225 |
import scala.quoted._
class Foo {
def f[T](t: Type[T])(using QuoteContext) = t match {
case '[ Int *: Unit ] =>
}
}
| som-snytt/dotty | tests/pos/i7262.scala | Scala | apache-2.0 | 124 |
def foldMap[A,B:Monoid,F[A]:Foldable](fa: F[A])(g: A => B) =
implicitly[Foldable[F]].foldMap(fa)(g)
| grzegorzbalcerek/scala-exercises | Foldable/stepFoldableFoldMap.scala | Scala | bsd-2-clause | 102 |
package atto.fs2
import atto._
import Atto._
import cats.implicits._
import _root_.fs2._
import org.scalacheck._
@SuppressWarnings(Array("org.wartremover.warts.NonUnitStatements", "org.wartremover.warts.Any"))
object Fs2PipesTest extends Properties("Pipes") {
import Prop._
property("parse1 parses single value c... | tpolecat/atto | modules/fs2/src/test/scala/atto/fs2/PipesTest.scala | Scala | mit | 2,371 |
/*
* 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 ... | yu-iskw/criteo-display-advertising-challenge-with-spark | src/test/scala/org/apache/spark/util/LocalClusterSparkContext.scala | Scala | apache-2.0 | 1,477 |
/*
* 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/main/scala/uk/gov/hmrc/ct/ct600a/v2/LPQ08.scala | Scala | apache-2.0 | 888 |
package mesosphere.marathon
package api.v2.json
import mesosphere.UnitTest
import mesosphere.marathon.api.JsonTestHelper
import mesosphere.marathon.core.readiness.{ HttpResponse, ReadinessCheckResult }
import mesosphere.marathon.core.task.Task
import mesosphere.marathon.state.PathId
import play.api.libs.json.Json
cla... | guenter/marathon | src/test/scala/mesosphere/marathon/api/v2/json/ReadinessCheckResultFormatTest.scala | Scala | apache-2.0 | 1,469 |
/**
* 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/server/DelayedOperationKey.scala | Scala | apache-2.0 | 1,929 |
import com.google.inject.{Guice, AbstractModule}
import play.api.GlobalSettings
import services.{SimpleUUIDGenerator, UUIDGenerator}
/**
* Set up the Guice injector and provide the mechanism for return objects from the dependency graph.
*/
object Global extends GlobalSettings {
/**
* Bind types such that whene... | lancearlaus/vega-factor-scratchpad | app/Global.scala | Scala | apache-2.0 | 929 |
package com.szadowsz.cadisainmduit.ships.uboat
import java.io.{File, StringReader}
import java.sql.Date
import java.text.SimpleDateFormat
import com.szadowsz.common.io.delete.DeleteUtil
import com.szadowsz.common.io.read.{CsvReader, FReader}
import com.szadowsz.common.io.write.CsvWriter
import com.szadowsz.common.io.... | zakski/project-cadisainmduit | module/dataprep-ships/src/main/scala/com/szadowsz/cadisainmduit/ships/uboat/UboatPreparer.scala | Scala | apache-2.0 | 5,784 |
package knot.core.stream.flows
import java.util.concurrent.{TimeUnit, TimeoutException}
import knot.core.Done
import knot.core.stream.ops.FlowOps
import knot.core.stream.ops.StreamOps.{Completed, ErrorEmitted}
import knot.core.stream.plugs.Input
import knot.core.stream.{Flow, Schedulable}
import scala.concurrent.dur... | defvar/knot | knot-core/src/main/scala/knot/core/stream/flows/IdleTimeout.scala | Scala | mit | 1,675 |
/*
* 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 ... | manuzhang/incubator-gearpump | streaming/src/main/scala/org/apache/gearpump/streaming/ClusterMessage.scala | Scala | apache-2.0 | 2,975 |
/*
Copyright 2013 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | twitter/iago | src/main/scala/com/twitter/parrot/server/FinagleService.scala | Scala | apache-2.0 | 2,410 |
package edu.gemini.ags.gems.mascot
import breeze.linalg._
import breeze.util._
/**
* Constants taken from mascot.conf in the Yorick version.
* These were added only as needed, so the order is a bit different.
*/
object MascotConf {
// MASCOT PARAMETERS
val mag_min_threshold = 6.5 // XXX allan: changed from... | arturog8m/ocs | bundle/edu.gemini.ags/src/main/scala/edu/gemini/ags/gems/mascot/MascotConf.scala | Scala | bsd-3-clause | 2,921 |
package model
import org.joda.time.DateTime
trait BaseEntity[T <: BaseEntity[T]] {
self: T =>
val ref: Option[Long]
val ts: Option[DateTime]
val deleted: Boolean
def withRef(ref: Long): T
def withTimestamp(ts: DateTime): T
def withDeleted(deleted: Boolean): T
}
case class Product(ref: Option[Long], ... | lukaszbudnik/slick-multitenant | src/main/scala/model/Model.scala | Scala | apache-2.0 | 958 |
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
package ducttape.hyperdag
/**
* Walkers support asynchronous foreach style traversal of HyperDAGs
* and MetaHyperDAGs.
... | jhclark/ducttape | src/main/scala/ducttape/hyperdag/walker/package.scala | Scala | mpl-2.0 | 347 |
object Test {
def main(args: Array[String]): Unit = {
val a: Int = fun1
()
}
implicit def foo: Int = {
println("foo")
42
}
def fun1 (using erased boo: Int): Int = {
println("fun1")
43
}
}
| som-snytt/dotty | tests/run-custom-args/erased/erased-22.scala | Scala | apache-2.0 | 227 |
package fr.unice.polytech.ogl.championships
import eu.ace_design.island.dsl.DiSLand
import eu.ace_design.island.game._
import eu.ace_design.island.map.IslandMap
import eu.ace_design.island.stdlib.POIGenerators.WithCreeks
import eu.ace_design.island.stdlib.Resources._
import fr.unice.polytech.ogl.championships.library.... | mosser/ogl-2015 | src/main/scala/fr/unice/polytech/ogl/championships/Week19.scala | Scala | lgpl-3.0 | 1,508 |
/*
# Copyright 2016 Georges Lipka
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | glipka/Easy-React-With-ScalaJS | src/main/scala/com/glipka/easyReactJS/reactBootstrap/MediaList.scala | Scala | apache-2.0 | 809 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.javadsl.api
import java.net.URI
import java.util.concurrent.TimeUnit
import com.typesafe.config.ConfigFactory
import org.scalatest.{ Matchers, WordSpec }
import scala.compat.java8.OptionConverters._
class Confi... | rstento/lagom | service/javadsl/api/src/test/scala/com/lightbend/lagom/javadsl/api/ConfigurationServiceLocatorSpec.scala | Scala | apache-2.0 | 1,060 |
package com.databricks.spark.sql.perf.mllib.feature
import org.apache.spark.ml
import org.apache.spark.ml.linalg.Vector
import org.apache.spark.ml.PipelineStage
import org.apache.spark.sql._
import com.databricks.spark.sql.perf.mllib.OptionImplicits._
import com.databricks.spark.sql.perf.mllib.data.DataGenerator
impo... | databricks/spark-sql-perf | src/main/scala/com/databricks/spark/sql/perf/mllib/feature/OneHotEncoder.scala | Scala | apache-2.0 | 1,131 |
package com.darkside.darkcore
import Chisel._
object main {
def main(args: Array[String]): Unit = {
chiselMainTest(args, () => Module(new (32))) {
c => new TopTest(c)
}
}
}
| darksideos/darkcore | src/main/scala/com/darkside/darkcore/Main.scala | Scala | gpl-3.0 | 183 |
/*
* Copyright 2016-2020 47 Degrees Open Source <https://www.47deg.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 ... | scala-exercises/evaluator | server/src/main/scala/org/scalaexercises/evaluator/services.scala | Scala | apache-2.0 | 4,924 |
package com.karasiq.bootstrap.icons
import scala.language.implicitConversions
import com.karasiq.bootstrap.components.BootstrapComponents
import com.karasiq.bootstrap.context.{ClassModifiers, RenderingContext}
trait UniversalIcons { self: RenderingContext with Icons with ClassModifiers with BootstrapComponents ⇒
i... | Karasiq/scalajs-bootstrap | library/shared/src/main/scala/com/karasiq/bootstrap/icons/UniversalIcons.scala | Scala | mit | 3,615 |
/*
* stateless-future-util
* Copyright 2014 深圳岂凡网络有限公司 (Shenzhen QiFun Network Corp., LTD)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LIC... | Atry/stateless-future-util | src/main/scala/com/qifun/statelessFuture/util/io/SocketInputStream.scala | Scala | apache-2.0 | 5,626 |
package core
import org.specs2.mutable.SpecificationLike
import akka.actor.{Props, ActorSystem}
import akka.routing.RoundRobinRouter
import domain.Tweet
import java.util.Date
import core.TweetReaderActor.CountAll
import scala.concurrent.Await
import akka.util.Timeout
import org.specs2.execute.Result
class TweetActors... | alanktwong/typesafe_activators | activators-akka-cassandra/src/test/scala/core/TweetActorsPerformanceSpec.scala | Scala | mit | 1,366 |
package controllers.registration.transactor
import forms.DeclarationCapacityForm.{accountant, declarationCapacity, other, otherRole}
import itutil.ControllerISpec
import models.{ApplicantDetails, DeclarationCapacityAnswer, Other, TransactorDetails}
import org.jsoup.Jsoup
import play.api.libs.ws.WSResponse
import play... | hmrc/vat-registration-frontend | it/controllers/registration/transactor/DeclarationCapacityControllerISpec.scala | Scala | apache-2.0 | 2,638 |
/*
* 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 | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLMetricsSuite.scala | Scala | apache-2.0 | 5,100 |
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2010 Travis Brown, The University of Texas at Austin
//
// 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 ... | utcompling/fieldspring | src/main/scala/opennlp/fieldspring/tr/app/Preprocess.scala | Scala | apache-2.0 | 1,761 |
package akka.contrib.persistence.mongodb
import akka.actor.Props
import akka.persistence.query.{EventEnvelope, Hint}
import reactivemongo.api.commands.Command
import reactivemongo.api.{BSONSerializationPack, Cursor, QueryOpts}
import reactivemongo.bson._
import scala.concurrent.Future
object AllEvents {
def props(... | twillouer/akka-persistence-mongo | rxmongo/src/main/scala/akka/contrib/persistence/mongodb/RxMongoReadJournaller.scala | Scala | apache-2.0 | 2,833 |
/*
* 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 ... | sryza/spark | core/src/test/scala/org/apache/spark/ShuffleNettySuite.scala | Scala | apache-2.0 | 1,262 |
package xitrum.routing
import java.lang.reflect.Modifier
import scala.collection.mutable.{Map => MMap}
import scala.reflect.runtime.universe
import xitrum.Action
import xitrum.annotation.ActionAnnotations
/**
* This class is intended to be used by RouteCollector and to be serialized to
* routes.cache. xitrumVersio... | xitrum-framework/xitrum | src/main/scala/xitrum/routing/ActionTreeBuilder.scala | Scala | mit | 4,975 |
/*
* 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 ... | andrewor14/iolap | external/flume-sink/src/main/scala/org/apache/spark/streaming/flume/sink/Logging.scala | Scala | apache-2.0 | 4,083 |
/*
* Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.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
*
... | mapcode-foundation/mapcode-scala | src/test/scala/com/mapcode/scala/MapcodeTest.scala | Scala | apache-2.0 | 4,321 |
/*
* 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 ... | neoremind/kraps-rpc | kraps-core/src/test/scala/com/neoremind/kraps/SimpleClientTest.scala | Scala | apache-2.0 | 1,713 |
/*
* 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 ... | houshengbo/openwhisk | core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/PrimitiveActions.scala | Scala | apache-2.0 | 31,117 |
package scavlink.connection.marshal
import scavlink.message.common.Heartbeat
import scavlink.message.{Bundle, Message}
import akka.util.{ByteIterator, ByteStringBuilder}
/**
* A bare-bones marshaller that only knows how to convert a Heartbeat message.
*/
object HeartbeatMarshaller extends BundleMarshaller {
val b... | nickolasrossi/scavlink | src/main/scala/scavlink/connection/marshal/HeartbeatMarshaller.scala | Scala | mit | 818 |
/*
Copyright (C) 2013-2018 Expedia Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | mikkokar/styx | system-tests/e2e-suite/src/test/scala/com/hotels/styx/proxy/https/EmptyTlsProtocolsListSpec.scala | Scala | apache-2.0 | 3,123 |
package org.jetbrains.plugins.scala.util
import java.util.concurrent.ConcurrentHashMap
import com.intellij.util.containers.ContainerUtil
import scala.jdk.CollectionConverters._
import scala.collection.mutable
object ScalaCollectionsUtil {
def newConcurrentMap[K, V]: scala.collection.concurrent.Map[K, V] = {
... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/util/ScalaCollectionsUtil.scala | Scala | apache-2.0 | 464 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | laserson/adam | adam-core/src/test/scala/org/bdgenomics/adam/rdd/InnerShuffleRegionJoinSuite.scala | Scala | apache-2.0 | 4,680 |
package sangria
import sangria.parser.QueryParser
import sangria.schema._
import scala.util.Success
package object introspection {
object TypeKind extends Enumeration {
val Scalar, Object, Interface, Union, Enum, InputObject, List, NonNull = Value
}
val __TypeKind = EnumType("__TypeKind", Some("An enum de... | narahari92/sangria | src/main/scala/sangria/introspection/package.scala | Scala | apache-2.0 | 10,819 |
package beer.data.judgments
import scala.collection.mutable.{Map => MutableMap}
class PairsSelector (min_agreement:Double, min_judgments:Int) {
def selectPairs(judgments:List[Judgment]) : List[PairwiseJudgment] = {
val pairs = MutableMap[String, MutableMap[String, MutableMap[String, MutableMap[String, M... | qingsongma/blend | tools/beer_2.0/src/beer/data/judgments/PairsSelector.scala | Scala | gpl-3.0 | 2,752 |
package controllers.cadmin
import play.api.mvc._
import play.api.i18n._
import play.api.data._
import play.api.data.Forms._
import views._
import controllers._
import loom.models._
import loom.utils._
import loom.models.admin._
import loom.models.{Status => UStatus}
/**
* manage account
* @author chaosky
*/
objec... | chaosky/loom | app/controllers/cadmin/Admins.scala | Scala | mit | 3,586 |
/*
* ScanImage.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.fscape
package gr... | Sciss/FScape-next | core/shared/src/main/scala/de/sciss/fscape/graph/ScanImage.scala | Scala | agpl-3.0 | 4,000 |
package scala
package internal
import scala.runtime.TupleXXL
object TupledFunction {
def tupledFunction0[F, G]: TupledFunction[F, G] = scala.TupledFunction[F, G](
tupledImpl = (f: F) => ((args: Unit) => f.asInstanceOf[() => Any].apply()).asInstanceOf[G],
untupledImpl = (g: G) => (() => g.asInstanceOf[Unit ... | som-snytt/dotty | library/src/scala/internal/TupledFunction.scala | Scala | apache-2.0 | 11,477 |
package models
import java.util.UUID
import play.api.libs.functional.syntax._
import play.api.libs.json._
import utils.Ops.JsPathX
sealed trait AssignmentEntryLike extends UniqueEntity {
def labworkId: UUID
}
case class AssignmentEntry(labwork: UUID, index: Int, label: String, types: Set[AssignmentEntryType], dur... | THK-ADV/lwm-reloaded | app/models/AssignmentEntry.scala | Scala | mit | 2,181 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/gmp-frontend | test/views/html/BulkWrongUserSpec.scala | Scala | apache-2.0 | 1,494 |
object Test {
import scalatest.*
case class Box[T](v: T) {
def >(that: Box[T]): Boolean = this == that
}
trait EqInt
implicit val eq: EqInt = new EqInt {}
implicit class AnyOps[T](x: T) {
def === (y: T)(implicit c: EqInt) = x == y
}
def main(args: Array[String]): Unit = {
val a = Box(Som... | dotty-staging/dotty | tests/run-macros/reflect-select-symbol-constructor/test_2.scala | Scala | apache-2.0 | 602 |
/***********************************************************************
* 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-kafka/geomesa-kafka-datastore/src/main/scala/org/locationtech/geomesa/kafka/index/FeatureStateFactory.scala | Scala | apache-2.0 | 12,360 |
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.