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 scalaguide.sql
import javax.inject.Inject
import play.api.db.{ Database, NamedDatabase }
import play.api.mvc.Controller
// inject "orders" database instead of "default"
class ScalaInjectNamed @Inject()(
@NamedDatabase("orders") db: Database) extends Controller {
// do whatever you need with the db
}
| ktoso/playframework | documentation/manual/working/scalaGuide/main/sql/code/ScalaInjectNamed.scala | Scala | apache-2.0 | 315 |
/**
* Copyright 2019 Gianluca Amato <gianluca.amato@unich.it>
*
* This file is part of ScalaFix.
* ScalaFix 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
* (... | jandom-devel/ScalaFix | core/src/main/scala/it/unich/scalafix/assignments/InputAssignment.scala | Scala | gpl-3.0 | 4,097 |
package com.artclod.markup
import com.artclod.mathml.TextToHtmlGraph
import laika.api.Transform
import laika.parse.markdown.Markdown
import laika.render.HTML
import play.twirl.api.Html
import scala.collection.mutable
import scala.util.Try
object LaikaParser {
val gt = TextToHtmlGraph.graphIndicators
val mt = """... | kristiankime/calc-tutor | app/com/artclod/markup/LaikaParser.scala | Scala | mit | 1,911 |
package lila.video
import akka.actor.{ ActorSelection, ActorSystem }
import com.typesafe.config.Config
import scala.concurrent.duration._
import lila.common.PimpedConfig._
final class Env(
config: Config,
scheduler: lila.common.Scheduler,
db: lila.db.Env,
isDev: Boolean) {
private val settings = n... | r0k3/lila | modules/video/src/main/Env.scala | Scala | mit | 1,683 |
package org.jetbrains.plugins.scala.compiler
import java.io.File
import org.jetbrains.jps.incremental.messages.CustomBuilderMessage
import org.jetbrains.jps.incremental.scala.Client
import org.jetbrains.plugins.scala.compiler.CompilerEventType.CompilerEventType
import org.jetbrains.plugins.scala.util.{CompilationId, ... | JetBrains/intellij-scala | scala/compiler-shared/src/org/jetbrains/plugins/scala/compiler/CompilerEvent.scala | Scala | apache-2.0 | 3,190 |
// scalastyle:off println
package wordcountscala
import scala.math.random
import org.apache.spark._
object WordCount {
def main(args: Array[String]) {
val conf = new SparkConf().setAppName("Word Count")
val sc = new SparkContext(conf)
// create a SparkContext
//val sc = new SparkContext("local[*]"... | DavidContrerasICAI/sparkCode | wordcountscalaSBT/src/main/scala/wordcountscala/WordCount.scala | Scala | mit | 1,399 |
package net.truerss.services
import org.specs2.mutable.Specification
import truerss.plugins_discrovery.Discovery
import truerss.util.TaskImplicits
class DiscoveryTests extends Specification {
import TaskImplicits._
private val url = "https://github.com/truerss/plugins/releases/tag/1.0.0"
"fetch" in {
Disc... | truerss/truerss | src/real/scala/net/truerss/services/DiscoveryTests.scala | Scala | mit | 373 |
package examples
import weightedroundrobin.RoundRobinUtils.{divByFivePenalizer, plusOneRewarder}
import weightedroundrobin.{RoundRobin, WeightedResource}
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
import scala.concurrent.Future
import scala.language.higherKinds
import scala.concurrent.... | TharinduDG/weightedroundrobin | src/main/scala/examples/SimpleRoundRobin.scala | Scala | apache-2.0 | 1,620 |
/*
* Copyright 2013 Commonwealth Computer Research, 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 applica... | jwkessi/geomesa | geomesa-plugin/src/main/scala/org/locationtech/geomesa/plugin/wms/CoverageReader.scala | Scala | apache-2.0 | 10,729 |
/*
* Copyright (C) 2014 Stratio (http://stratio.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 app... | Stratio/cassandra-lucene-index | plugin/src/main/scala/com/stratio/cassandra/lucene/mapping/ColumnsMapper.scala | Scala | apache-2.0 | 9,987 |
package extruder.instances
import cats.Eq
import cats.instances.either._
import cats.instances.int._
import cats.instances.string._
import cats.laws.discipline.AlternativeTests
import extruder.core.{Parser, Show}
import org.scalacheck.Arbitrary
import org.scalatest.funsuite.AnyFunSuite
import org.scalatestplus.scalach... | janstenpickle/extruder | core/src/test/scala/extruder/instances/ParserInstancesSuite.scala | Scala | mit | 1,280 |
/*
* Copyright (C) 2015 Cotiviti Labs (nexgen.admin@cotiviti.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.org/licenses/LICENSE-2.0
*
* Unless req... | uzh/triplerush | src/main/scala/com/signalcollect/triplerush/vertices/query/TicketSynchronization.scala | Scala | apache-2.0 | 3,651 |
package nestapp.websocketserver
import akka.actor.{Actor, ActorLogging, Props}
import spray.can.Http
/**
* Actor which acts as simple WebSocketServer
* For documentation look spray.io and spray-websocket
*/
class WebSocketServer extends Actor with ActorLogging {
def receive = {
// when a new connection c... | rafaelkyrdan/nest-app | src/main/scala/nestapp/websocketserver/WebSocketServer.scala | Scala | mit | 801 |
/*
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2017-2018 Alexis Seigneurin.
*
* 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 o... | KevinLiLu/kafka | streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/WordCountTest.scala | Scala | apache-2.0 | 9,577 |
package outwatch
import cats.effect.IO
import monix.reactive.subjects.PublishSubject
import monix.reactive.Observable
import org.scalajs.dom.{html, _}
import outwatch.dsl._
import colibri.ext.monix._
import org.scalajs.dom.raw.EventInit
import outwatch.reactive.handlers.monix._
import outwatch.util.LocalStorage
impor... | OutWatch/outwatch | tests/src/test/scala/outwatch/DomEventSpec.scala | Scala | apache-2.0 | 20,253 |
package org.brandonhaynes.iterators
import scala.language.{implicitConversions, reflectiveCalls}
import org.apache.hadoop.mapreduce.ReduceContext
import org.brandonhaynes.support.Implicits._
/** Implicit helper method for getting an iterator containing the pairs resulting from the intermediate shuffle
*
* Usage: ... | BrandonHaynes/timr | src/org/brandonhaynes/iterators/IntermediatePairIterator.scala | Scala | mit | 1,724 |
/*
* Copyright 2016 Coursera 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 t... | vkuo-coursera/naptime | naptime-graphql/src/main/scala/org/coursera/naptime/ari/graphql/SangriaGraphQlSchemaBuilder.scala | Scala | apache-2.0 | 10,286 |
/*
* 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 ... | rikima/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala | Scala | apache-2.0 | 57,961 |
package org.scalawiki.dto.cmd.email
import org.scalawiki.dto.cmd._
case class EmailUser(override val params: EmailParam[Any]*)
extends EnumArgument[ActionArg]("emailuser", "Email a user.")
with ActionArg
with ArgWithParams[EmailParam[Any], ActionArg]
trait EmailParam[+T] extends Parameter[T]
case class Targe... | intracer/scalawiki | scalawiki-core/src/main/scala/org/scalawiki/dto/cmd/email/EmailUser.scala | Scala | apache-2.0 | 975 |
/*******************************************************************************
* Copyright (c) 2016 Logimethods
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the MIT License (MIT)
* which accompanies this distribution, and is available at
* http://open... | Logimethods/nats-connector-gatling | src/main/scala/com/logimethods/connector/gatling/to_nats/NatsAction.scala | Scala | mit | 6,209 |
/*
* 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 ... | mahak/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/TryEvalSuite.scala | Scala | apache-2.0 | 2,262 |
/**
* 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... | Chasego/kafka | core/src/test/scala/unit/kafka/server/FetchSessionTest.scala | Scala | apache-2.0 | 43,796 |
package org.workcraft.plugins.petri.tools
import java.awt.Component
import java.awt.event.ActionEvent
import java.awt.event.ActionListener
import javax.swing.JButton
import javax.swing.JSlider
import javax.swing.Timer
import javax.swing.event.ChangeEvent
import javax.swing.event.ChangeListener
import org.workcraft.swi... | tuura/workcraft-2.2 | ScalaGraphEditorUtil/src/main/scala/org/workcraft/plugins/petri/tools/SimulationControlPanel.scala | Scala | gpl-3.0 | 4,805 |
/* sbt -- Simple Build Tool
* Copyright 2010 Mark Harrah
*/
package sbt
import Types._
import scala.reflect.Manifest
// T must be invariant to work properly.
// Because it is sealed and the only instances go through AttributeKey.apply,
// a single AttributeKey instance cannot conform to AttributeKey[T] for differ... | jamesward/xsbt | util/collection/Attributes.scala | Scala | bsd-3-clause | 5,014 |
/*
*
* 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
* "Licens... | atomicjets/distributed-graph-analytics | dga-graphx/src/main/scala/com/soteradefense/dga/graphx/louvain/LouvainData.scala | Scala | apache-2.0 | 2,131 |
package org.tribbloid.ispark
import org.tribbloid.ispark.Util.{debug, getpid, log}
import org.tribbloid.ispark.display.{Data, IScala}
import org.tribbloid.ispark.interpreters.{Results, SparkInterpreter}
import org.tribbloid.ispark.json.JsonUtil._
import org.tribbloid.ispark.msg._
import org.zeromq.ZMQ
import sun.misc.... | tribbloid/ISpark | core/src/main/scala/org/tribbloid/ispark/Main.scala | Scala | apache-2.0 | 5,990 |
// Project: angulate2 (https://github.com/jokade/angulate2)
// Description:
// Copyright (c) 2016 Johannes.Kastner <jokade@karchedon.de>
// Distributed under the MIT License (see included LICENSE file)
package angulate2.router
import rxjs.{Observable, RxPromise}
import scala.scalajs.js
import scala... | jokade/angulate2 | bindings/src/main/scala/angulate2/router/Router.scala | Scala | mit | 2,325 |
package com.sksamuel.elastic4s.searches.queries
import com.sksamuel.elastic4s.searches.QueryDefinition
import org.elasticsearch.common.geo.GeoDistance
import org.elasticsearch.common.unit.DistanceUnit
import org.elasticsearch.common.unit.DistanceUnit.Distance
import org.elasticsearch.index.query.QueryBuilders
case cl... | ulric260/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/queries/GeoDistanceQueryDefinition.scala | Scala | apache-2.0 | 1,304 |
package com.wlangiewicz.bitcoin4s
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model._
import akka.stream.ActorMaterializer
import scala.concurrent.Future
class AkkaHttpClient(user: String, password: String, host: String, port: Int)(implicit system: ActorSystem, materializer... | wlk/bitcoin4s | src/main/scala/com/wlangiewicz/bitcoin4s/AkkaHttpClient.scala | Scala | apache-2.0 | 510 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | tkunicki/geomesa | geomesa-kafka/geomesa-kafka-datastore/geomesa-kafka-08-datastore/src/test/scala/org/locationtech/geomesa/kafka08/consumer/KafkaConsumerTest.scala | Scala | apache-2.0 | 7,118 |
package org.vs.puzzle
import org.scalatest.{FlatSpec, Matchers}
class PuzzleTableSpec extends FlatSpec with Matchers {
}
| VlasShatokhin/puzzle-app | src/test/scala/org/vs/puzzle/PuzzleTableSpec.scala | Scala | apache-2.0 | 124 |
/**
* © 2019 Refinitiv. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | e-orz/CM-Well | server/cmwell-util/src/main/scala/cmwell/util/Box.scala | Scala | apache-2.0 | 5,585 |
package com.blogspot.ramannanda.scala.algorithms.cp3.adhoc.rl
import scala.collection.mutable.ListBuffer
import scala.io.StdIn
import scala.util.control.Breaks._
//uva 00161
object TrafficLights {
def solveFirstGreenAfterOrange(cycles: Seq[Int]): Int = {
val time = Array.ofDim[Int](cycles.size)
var s = cy... | ramannanda9/algorithms-in-scala | src/main/scala/com/blogspot/ramannanda/scala/algorithms/cp3/adhoc/rl/TrafficLights.scala | Scala | gpl-3.0 | 1,699 |
/*
* 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 ... | tophua/spark1.52 | core/src/main/scala/org/apache/spark/ui/PagedTable.scala | Scala | apache-2.0 | 9,056 |
package katas.scala.techstock
import org.scalatest.Matchers
import org.junit.Test
import scala.annotation.tailrec
// rbs techstock 2013
class SumOfPrimes extends Matchers {
@Test def `find sum of primes below 2 million`() {
// too slow for 2M
def from(n: Int): Stream[Int] = Stream.cons(n, from(n + 1))
def siev... | dkandalov/katas | scala/src/katas/scala/techstock/SumOfPrimes.scala | Scala | unlicense | 813 |
package wow.common.codecs
import wow.utils.BigIntExtensions._
import scodec.bits.{BitVector, ByteVector}
import scodec.{Attempt, Codec, DecodeResult, Err, SizeBound}
/**
* Encodes a unsigned big integer in a fixed number of bytes
*/
private[codecs] final class FixedUnsignedLBigIntCodec(sizeInBytes: Long) extends ... | SKNZ/SpinaciCore | wow/core/src/main/scala/wow/common/codecs/FixedUnsignedLBigIntCodec.scala | Scala | mit | 1,296 |
/*
* Copyright 2019 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/scio | scio-jdbc/src/main/scala/com/spotify/scio/jdbc/syntax/AllSyntax.scala | Scala | apache-2.0 | 703 |
package org.denigma.kappa.notebook.views.editor
import org.denigma.binding.binders.GeneralBinder
import org.denigma.binding.views.CollectionMapView
import org.denigma.controls.code.CodeBinder
import org.denigma.kappa.messages.KappaSourceFile
import org.denigma.kappa.messages.WebSimMessages.WebSimError
import org.denig... | antonkulaga/kappa-notebook | app/js/src/main/scala/org/denigma/kappa/notebook/views/editor/KappaCodeEditor.scala | Scala | mpl-2.0 | 2,553 |
package com.tam.cobol_interpreter.parser.schema.expressions
import com.tam.cobol_interpreter.parser.exceptions.SchemaException
import com.tam.cobol_interpreter.parser.schema.expressions.ExpressionMatcher._
/**
* Created by tamu on 1/4/15.
*/
object ExpressionGenerator {
def recGenerateCases(schemaLines: Array[S... | tamsanh/scala-cobol-interpreter | src/main/scala/com/tam/cobol_interpreter/parser/schema/expressions/ExpressionGenerator.scala | Scala | apache-2.0 | 4,302 |
/*
* Copyright 1998-2017 Linux.org.ru
* 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... | kloun/lorsource | src/test/scala/ru/org/linux/search/ElasticsearchIndexServiceIntegrationSpec.scala | Scala | apache-2.0 | 2,808 |
/**
* 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... | patricklucas/kafka-manager | app/kafka/manager/utils/PreferredReplicaLeaderElectionCommand.scala | Scala | apache-2.0 | 4,325 |
package be.wegenenverkeer.atomium.server
import be.wegenenverkeer.atomium.api.FeedPage
import be.wegenenverkeer.atomium.format.Url
/**
* A feed store is responsible for the persistence of feeds.
* This abstract class serves as a base class for more specific FeedStore implementations.
*
* @tparam E type of the ele... | kwark/atomium | modules/server/src/main/scala/be/wegenenverkeer/atomium/server/AbstractFeedStore.scala | Scala | mit | 4,194 |
package org.jetbrains.plugins.scala.project.template
import java.awt.event.{ActionEvent, ActionListener}
import javax.swing.JComponent
import com.intellij.openapi.ui.Messages
import org.jetbrains.plugins.scala.extensions
import org.jetbrains.plugins.scala.project.{Platform, Version, Versions}
/**
* @author Pavel F... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/project/template/VersionDialog.scala | Scala | apache-2.0 | 1,392 |
import com.github.acrisci.commander.Program
val program = new Program()
.version("0.0.1")
.usage("./run-example.sh math.scala [options]")
.description("A program that can sum or multiply a list of numbers")
.option("-o, --operation [operation]", "The operation to perform on the numbers [sum|multiply]", default... | acrisci/commander-scala | examples/math.scala | Scala | mit | 822 |
package lila.pref
import play.api.data._
import play.api.data.Forms._
import lila.user.User
private[pref] final class DataForm {
val pref = Form(mapping(
"autoQueen" -> number.verifying(Pref.AutoQueen.choices.toMap contains _),
"autoThreefold" -> number.verifying(Pref.AutoThreefold.choices.toMap contains ... | ccampo133/lila | modules/pref/src/main/DataForm.scala | Scala | mit | 4,982 |
package org.zapto.jablo.myml
case object True extends Const {
override def ==(c: Const): Const = c match {
case True => True
case False => False
}
override def !=(c: Const): Const = c match {
case True => False
case False => True
}
override def &&(c: Const): Const = c match {
case True ... | jablo/myml | src/main/scala/org/zapto/jablo/myml/Bool.scala | Scala | artistic-2.0 | 1,041 |
/*
* 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 ... | gioenn/xSpark | graphx/src/main/scala/org/apache/spark/graphx/lib/TriangleCount.scala | Scala | apache-2.0 | 4,483 |
package org.bitcoins.core.script.flag
/** Created by chris on 4/6/16.
*/
trait ScriptFlagUtil {
/** Checks if the strict encoding is required in the set of flags
* given to us
* https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#DER_encoding
* @param flags
* @return
*/
def requir... | bitcoin-s/bitcoin-s | core/src/main/scala/org/bitcoins/core/script/flag/ScriptFlagUtil.scala | Scala | mit | 3,714 |
package sw.streaming
import org.apache.spark._
import org.apache.spark.streaming.StreamingContext
import org.apache.spark.streaming.StreamingContext._
import org.apache.spark.streaming.dstream.DStream
import org.apache.spark.streaming.Duration
import org.apache.spark.streaming.Seconds
object SimpleStreaming extends A... | rabbitonweb/spark-workshop | src/main/scala/sw/streaming/SimpleStreaming.scala | Scala | apache-2.0 | 1,397 |
package com.artclod.mathml.scalar.apply
import com.artclod.mathml._
import com.artclod.mathml.scalar._
import com.artclod.mathml.scalar.concept.Constant
import scala.util._
case class ApplyPlus(val values: MathMLElem*)
extends MathMLElem(MathML.h.prefix, "apply", MathML.h.attributes, MathML.h.scope, false, (Seq[Mat... | kristiankime/calc-tutor | app/com/artclod/mathml/scalar/apply/ApplyPlus.scala | Scala | mit | 1,497 |
package com.krux.hyperion.aws
import com.github.nscala_time.time.Imports.DateTime
/**
* Defines the timing of a scheduled event, such as when an activity runs.
*
* ref: http://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-object-schedule.html
*
*/
case class AdpOnDemandSchedule(
id: String,
name:... | hoangelos/hyperion | core/src/main/scala/com/krux/hyperion/aws/AdpSchedule.scala | Scala | apache-2.0 | 2,046 |
package org.apache.mesos.chronos.scheduler.jobs
import com.codahale.metrics.{Counter, Histogram, MetricRegistry}
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.module.SimpleModule
import com.google.inject.Inject
import org.apache.mesos.chronos.scheduler.api.HistogramSerializer... | vixns/chronos | src/main/scala/org/apache/mesos/chronos/scheduler/jobs/JobMetrics.scala | Scala | apache-2.0 | 1,974 |
package djinni
import djinni.ast._
import djinni.generatorTools._
import djinni.meta._
class JNIMarshal(spec: Spec) extends Marshal(spec) {
// For JNI typename() is always fully qualified and describes the mangled Java type to be used in field/method signatures
override def typename(tm: MExpr): String = javaType... | happybits/djinni | src/source/JNIMarshal.scala | Scala | apache-2.0 | 5,349 |
package com.spike.giantdataanalysis.flink.example.streamingledger
import java.nio.file.Paths
import java.util.SplittableRandom
import com.dataartisans.streamingledger.sdk.api.AccessType.READ_WRITE
import com.dataartisans.streamingledger.sdk.api.{StreamingLedger, TransactionProcessFunction}
import com.spike.giantdataa... | zhoujiagen/giant-data-analysis | temporal-data-and-realtime-algorithm/scala-temporal-apache-flink/src/main/scala/com/spike/giantdataanalysis/flink/example/streamingledger/ExampleStreamingLedger.scala | Scala | mit | 12,637 |
import cats.instances.future._
import cats.syntax.functor._
import com.bot4s.telegram.api.declarative.Commands
import com.bot4s.telegram.future.Polling
import com.bot4s.telegram.models.Message
import scala.concurrent.Future
/**
* Simple extension for having stateful Telegram Bots (per chat).
* The main issue is loc... | mukel/telegrambot4s | examples/src/StatefulBot.scala | Scala | apache-2.0 | 1,370 |
/*
* Copyright (c) 2015-2018 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | snowplow/snowplow-scala-tracker | modules/core/src/main/scala/com.snowplowanalytics.snowplow/scalatracker/Buffer.scala | Scala | apache-2.0 | 3,624 |
/*
* 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 ... | SHASHANKB/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala | Scala | apache-2.0 | 28,178 |
package com.seanshubin.builder.domain
import java.nio.file.Path
class ProcessLoggerFactoryImpl(files: FilesContract,
directory: Path,
rootLogger: String => Unit) extends ProcessLoggerFactory {
override def createAction(action: String): ProcessLogger = {
... | SeanShubin/builder | domain/src/main/scala/com/seanshubin/builder/domain/ProcessLoggerFactoryImpl.scala | Scala | unlicense | 659 |
/*
* Copyright (c) 2016 SnappyData, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License. You
* may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | vjr/snappydata | core/src/main/scala/org/apache/spark/streaming/StreamUtils.scala | Scala | apache-2.0 | 1,835 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* See the LICENCE.txt file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | Webtrends/wookiee-metrics | src/test/scala/com/webtrends/harness/component/monitoring/MonitoringSettingsSpec.scala | Scala | apache-2.0 | 2,620 |
package akka.s3
import akka.http.scaladsl.model.HttpRequest
import scala.util.Try
case class AuthV2Presigned(req: HttpRequest, getSecretKey: String => String) extends Auth {
val hl = HeaderList.Aggregate(Seq(req.listFromQueryParams, req.listFromHeaders))
override def run = Try {
val accessKey = hl.get("AWS... | akiradeveloper/akka-s3 | src/main/scala/akka/s3/auth/AuthV2Presigned.scala | Scala | apache-2.0 | 664 |
package scala.meta.tests
package ast
import org.scalatest._
import java.io._
import scala.meta._
import scala.meta.dialects.Scala211
import scala.meta.parsers._
// TODO: find a way to move this test back to trees
class SerializationSuite extends FunSuite {
private def tryRoundtrip(x: Any): Unit = {
val baos = n... | beni55/scalameta | scalameta/parsers/src/test/scala/scala/meta/tests/parsers/SerializationSuite.scala | Scala | bsd-3-clause | 1,207 |
package sativum
import org.joda.time.LocalDate
abstract class DatedDag(_dt: String) extends Dag {
val dt = new LocalDate(_dt)
def runDated() {
endpoints.map(sativum(_))
while (!ready()) {
Thread.sleep(waitTime)
}
endpoints.flatMap(_.parents).foreach {
case d: DatedTask => d.delete()
... | mindfulmachines/sativum | src/main/scala/sativum/DatedDag.scala | Scala | mit | 386 |
/*
* Copyright 2021 ACINQ SAS
*
* 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... | ACINQ/eclair | eclair-core/src/main/scala/fr/acinq/eclair/db/DbEventHandler.scala | Scala | apache-2.0 | 9,019 |
/*
* This file is part of EasyForger which is released under GPLv3 License.
* See file LICENSE.txt or go to http://www.gnu.org/licenses/gpl-3.0.en.html for full license details.
*/
package com.easyforger.samples.items
import com.easyforger.items.EFItemSword
import net.minecraft.entity.EntityLivingBase
import net.mi... | easyforger/easyforger | mods/src/main/scala/com/easyforger/samples/items/ItemVenomSword.scala | Scala | gpl-3.0 | 987 |
package objektwerks.app
import java.time.LocalTime
import java.util.concurrent.Executors
import cats.data.Kleisli
import cats.effect._
import io.circe.generic.auto._
import io.circe.syntax._
import org.http4s._
import org.http4s.circe._
import org.http4s.dsl.impl.Root
import org.http4s.dsl.io._
import org.http4s.im... | objektwerks/typelevel | src/main/scala/objektwerks/app/Http4sApp.scala | Scala | apache-2.0 | 2,373 |
package com.prezi.haskell.gradle.extension.impl
import java.io.File
import com.prezi.haskell.gradle.ApiHelper._
import com.prezi.haskell.gradle.Names
import com.prezi.haskell.gradle.extension._
import com.prezi.haskell.gradle.external.{Git, HaskellTools}
import com.prezi.haskell.gradle.io.packers.GradleZipPacker
impo... | prezi/gradle-haskell-plugin | src/main/scala/com/prezi/haskell/gradle/extension/impl/HaskellProjectImpl.scala | Scala | apache-2.0 | 2,385 |
/*
* Copyright 2017 David Schmitz
*
* 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... | dschmitz/recipe-service | src/main/scala/io/uport/recipe/model/Difficulty.scala | Scala | apache-2.0 | 796 |
package com.github.rgafiyatullin.creek_xml.dom_query
import com.github.rgafiyatullin.creek_xml.dom.Node
import scala.collection.immutable.Queue
case class Path(predicates: Queue[Predicate]) {
def headOption: Option[Predicate] = predicates.headOption
def isLast: Boolean = predicates.nonEmpty && predicates.tail.is... | RGafiyatullin/creek-xml | src/main/scala/com/github/rgafiyatullin/creek_xml/dom_query/Path.scala | Scala | mit | 520 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/nodes/exec/BatchExecNode.scala | Scala | apache-2.0 | 1,229 |
package spire
package math
import org.scalatest.FunSuite
import org.scalatest.Matchers
import org.scalacheck.Arbitrary._
import org.scalatest._
import prop._
class NumberPropertiesTest extends PropSpec with Matchers with GeneratorDrivenPropertyChecks {
property("Number.apply(Long)") {
forAll { (n: Long) => Num... | tixxit/spire | tests/src/test/scala/spire/math/NumberTest.scala | Scala | mit | 4,522 |
package doodle
package golden
import doodle.algebra.{Algebra, Picture}
import doodle.java2d._
import doodle.effect.Writer._
import java.awt.image.BufferedImage
import javax.imageio.ImageIO
import munit._
import doodle.effect.Writer
trait Golden { self: FunSuite =>
val goldenDir = "golden/src/test/golden"
def pix... | underscoreio/doodle | golden/src/test/scala/doodle/golden/Golden.scala | Scala | apache-2.0 | 4,759 |
package dates
import io.circe.{Decoder, Encoder}
/**
* A typeclass around dates that allow dates to be handled in the same way in the JVM and in JS.
**/
trait DateLike[D] {
/**
* Serialise this date.
* @param d The date to serialise.
* @return An ISO 8601 representation of this date.
*/
def s... | unclealex72/west-ham-calendar | shared/src/main/scala/dates/DateLike.scala | Scala | apache-2.0 | 1,423 |
package main.scala.HackerRank.WeekOfCode36
import java.io.{ByteArrayInputStream, IOException, InputStream, PrintWriter}
import java.util.InputMismatchException
import scala.collection.generic.CanBuildFrom
import scala.language.higherKinds
import scala.reflect.ClassTag
/**
* Copyright (c) 2017 A. Roberto Fischer
... | robertoFischer/hackerrank | src/main/scala/HackerRank/WeekOfCode36/RevisedRussianRoulette.scala | Scala | mit | 6,867 |
/*
* 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 ... | shivangi1015/incubator-carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/dataload/TestBatchSortDataLoad.scala | Scala | apache-2.0 | 9,038 |
import scala.collection.{immutable, mutable}
import java.nio.file.Paths
class repeatedArgs {
def bar(xs: String*): Int = xs.length
def test(xs: immutable.Seq[String], ys: collection.Seq[String], zs: Array[String]): Unit = {
bar("a", "b", "c")
bar(xs: _*)
bar(ys: _*) // error: immutable.Seq expected, f... | som-snytt/dotty | tests/neg/repeatedArgs213.scala | Scala | apache-2.0 | 596 |
package services
import models.{ MovieReservationDetail, ReservationCounter, ReservationCreate, ReservationCreateResult }
import utils.CacheConstants
import scala.concurrent.{ ExecutionContext, Future }
import scala.language.postfixOps
trait ReservationService {
def makeReservation(reservation: ReservationCreate):... | ziyasal/Reserveon | src/main/scala/services/ReservationService.scala | Scala | mit | 3,351 |
/*
* Copyright 2014–2020 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | slamdata/quasar | connector/src/main/scala/quasar/connector/evaluate/FederatedQuery.scala | Scala | apache-2.0 | 1,752 |
package server
import database.DocumentTag
/**
* Created by jannis on 12/6/15.
*
* Contains classes which are just for communication to fulfil the API
*/
object Protocol {
case class MessagePost(message: String)
case class TagPost(name: String, language: String)
case class AddTagsPost(tags: Seq[DocumentTag]... | dadarakt/hack4good | hack2godly/src/main/scala/server/Protocol.scala | Scala | apache-2.0 | 485 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package kafka.manager
import java.util.Properties
import java.util.concurrent.atomic.AtomicBoolean
import com.typesafe.config.{Config, ConfigFactory}
import kafka.manager.features.KMDeleteTopicFeature... | radicalbit/kafka-manager | test/kafka/manager/TestKafkaManager.scala | Scala | apache-2.0 | 22,433 |
import org.specs2._
trait MockOutput extends Output {
var messages: Seq[String] = Seq()
override def print(s: String) = messages = messages :+ s
}
class QuickStartSpec extends Specification {
def is = s2"""
Testing hw
contains print | as ground $e1
"""
def ground = new Ground with MockOutput
... | chuajiesheng/scala-dino | src/test/scala/test_ground.scala | Scala | gpl-2.0 | 383 |
/*
* Copyright 2016 okumin
*
* 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 wr... | okumin/influent | influent-java/src/test/scala/influent/internal/msgpack/MsgpackUnpackerArbitrary.scala | Scala | apache-2.0 | 3,468 |
package types
import Types._
/**
* Created by Truji on 09/06/2016.
*/
object SemanticTableau {
/**
* Indica si una fórmula es una doble negación
*
* @param prop fórmula
*/
def isDoubleNeg(prop: Prop) = prop match {
case Neg(Neg(_)) => true
case _ => false
}
/**
* Indica si un... | Truji92/Logic | src/main/scala/types/SemanticTableau.scala | Scala | mit | 4,113 |
/*
* Copyright 2014 - 2015 SlamData 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 a... | wemrysi/quasar | core/src/main/scala/slamdata/engine/analysis/package.scala | Scala | apache-2.0 | 3,323 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/integration/torch/MultiLabelMarginCriterionSpec.scala | Scala | apache-2.0 | 3,436 |
package io.youi.paint
import io.youi.Color
case class GradientStop(color: Color, offset: Double)
| outr/youi | gui/src/main/scala/io/youi/paint/GradientStop.scala | Scala | mit | 99 |
/*
* 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 ... | Fiware/context.Cosmos | src/main/scala/org/fiware/cosmos/orion/flink/connector/OrionHttpServerLD.scala | Scala | agpl-3.0 | 3,425 |
package com.daxin
object TestPerson {
def main(args :Array[String]){
val p1=new Person
println("Person中的Gnder是private权限,所以在其他文件中不可以访问")
println(p1.id +" "+p1.name)
// println(p1.country)// private[this] var country:String=_
println(p1.getCountry())
// cat的定义:private[daxin] ... | Dax1n/Scala | ObjectOrientedDemo/src/com/daxin/TestPerson.scala | Scala | apache-2.0 | 548 |
package org.sofi.deadman.test.event
import akka.actor._
import com.rbmhtechnology.eventuate.EventsourcedView
import org.sofi.deadman.messages.command._
import org.sofi.deadman.messages.event._
import org.sofi.deadman.test.TestSystem
import scala.concurrent.duration._
final class TaskWarningTest extends TestSystem {
... | SocialFinance/deadman-switch | core/src/test/scala/org/sofi/deadman/test/event/TaskWarningTest.scala | Scala | bsd-3-clause | 1,197 |
package scala.collection.hmap
package test
import org.scalacheck._
import org.scalacheck.Prop._
import org.scalacheck.Gen._
import org.scalacheck.Arbitrary._
object WithPhantomProperties extends Properties("WithPhantom") {
/** Value1 and Value2 must be different types */
def prop_typeMiss[T, Value1: Manifest, Va... | kennknowles/scala-heterogeneous-map | src/test/scala/WithPhantomProperties.scala | Scala | apache-2.0 | 498 |
package a05
trait 自然数 {
type 后继[T] <: 自然数
def 后继[T](item: T): 后继[T]
type 消融1[T <: 自然数] <: 整数定义
def 消融1[T <: 自然数](item: T): 消融1[T]
type 消融2[T <: 自然数, I] <: 整数定义
def 消融2[T <: 自然数, I](item: T, i: I): 消融2[T, I]
type Plus[T <: 自然数] <: 自然数
def plus[T <: 自然数](h: T): Plus[T]
}
trait 整数定义 {
type 正数部分 <:... | djx314/ubw | a08-整数加法/src/main/scala/HList.scala | Scala | bsd-3-clause | 3,527 |
package org.jetbrains.plugins.scala
package editor.smartEnter.fixers
import com.intellij.openapi.editor.Editor
import com.intellij.psi._
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.editor.smartEnter.ScalaSmartEnterProcessor
import org.jetbrains.plugins.scala.extensions.PsiElementExt
imp... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/editor/smartEnter/fixers/ScalaWhileConditionFixer.scala | Scala | apache-2.0 | 2,544 |
/**
* Copyright (C) 2013 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | brunobuzzi/orbeon-forms | form-runner/jvm/src/db/scala/org/orbeon/oxf/fr/persistence/ddl/DDLTest.scala | Scala | lgpl-2.1 | 4,826 |
package metal
/** Non-null pointer on a container element.
*
* This class is a value class only in Scala 2.11, due to bugs in the generation
* of bridge methods when overloading methods that take/return a value class.
*/
final class VPtr[C <: Pointable with Singleton](val raw: Long) extends PtrVersions.Base ... | denisrosset/ptrcoll | core/src/main/scala/metal/VPtr.scala | Scala | mit | 4,918 |
package core.db.users
import java.util.UUID
import core.db.PostgreSQLExtensions
import core.entities.{CredentialSet, UserID, UserSecret}
import scalikejdbc._
case class CredentialsDaoEntity(userId: String, password: String, salt: String, algorithm: String)
object CredentialsDaoEntity extends SQLSyntaxSupport[Creden... | lymr/fun-chat | fun-chat-server/src/main/scala/core/db/users/SqlUserCredentialsDao.scala | Scala | mit | 2,635 |
/*
Copyright (c) 2010, Tobias Knerr
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the foll... | tordanik/TemplatesToTables | src/org/openstreetmap/wiki/tttbot/config/OutputConfig.scala | Scala | bsd-2-clause | 1,818 |
package client.appstate.groups
import autowire._
import diode._
import diode.data._
import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue
import boopickle.Default._
import client.MessageFeedback
import client.appstate.{GroupFeedbackReporting, Groups}
import client.services.AjaxClient
import shared._
impo... | beikern/foulkon-ui | client/src/main/scala/client/appstate/groups/DiodeGroup.scala | Scala | apache-2.0 | 5,643 |
package lore.compiler.core
import lore.compiler.syntax.Node.Index
/**
* A position identifies a code location across a whole Lore project.
*/
case class Position(fragment: Fragment, startIndex: Index, endIndex: Index) {
def <(other: Position): Boolean = {
this.fragment.name < other.fragment.name || (this.fr... | marcopennekamp/lore | compiler/src/lore/compiler/core/Position.scala | Scala | mit | 3,248 |
/*
* 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 ... | shaneknapp/spark | streaming/src/main/scala/org/apache/spark/streaming/StreamingConf.scala | Scala | apache-2.0 | 6,279 |
/*
* Copyright 2017 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | liquidarmour/ct-calculations | src/test/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC161Spec.scala | Scala | apache-2.0 | 1,003 |
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.