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.global.snapshot.actors
import akka.actor.{Actor, ActorLogging, ActorRef}
abstract class CargoActor
extends Actor with ActorLogging {
val name = getName(self)
override def receive = {
case event =>
log.error(s"$name received an unknown event $event")
}
protected def getName(actor: A... | NorthernDemon/Cargo-Global-Snapshot | src/main/scala/com/global/snapshot/actors/CargoActor.scala | Scala | mit | 373 |
/*
* Copyright (c) 2011, Todd Cook.
* 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 ... | todd-cook/Effective-Scala-with-Project-Euler | src/main/scala/com/wordtrellis/projecteuler/problem_48.scala | Scala | mit | 2,192 |
package scalanlp.data;
/*
Copyright 2009 David Hall, Daniel Ramage
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicab... | MLnick/scalanlp-core | data/src/main/scala/scalanlp/data/Example.scala | Scala | apache-2.0 | 2,094 |
package org.sgine.ui.theme
import org.sgine.ui.font.BitmapFont
import org.powerscala.property.Property
import org.sgine.ui.{Button, Component}
import org.powerscala.{Color, Resource}
/**
* @author Matt Hicks <mhicks@sgine.org>
*/
object WindowsTheme extends Theme("windows") {
val font = Property[BitmapFont]("_fon... | Axiometry/sgine | ui/src/main/scala/org/sgine/ui/theme/WindowsTheme.scala | Scala | bsd-3-clause | 1,993 |
package scala.meta.internal.semanticdb.scalac
import scala.meta.internal.scalacp._
import scala.meta.internal.{semanticdb => s}
import scala.meta.internal.semanticdb.Scala._
import scala.reflect.internal.{Flags => gf}
trait TypeOps { self: SemanticdbOps =>
implicit class XtensionGTypeSType(gtpe: g.Type) {
def t... | olafurpg/scalameta | semanticdb/scalac/library/src/main/scala/scala/meta/internal/semanticdb/scalac/TypeOps.scala | Scala | bsd-3-clause | 6,328 |
/*
* Copyright 2019 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-node/src/main/scala/fr/acinq/eclair/api/directives/ErrorResponse.scala | Scala | apache-2.0 | 674 |
package org.allenai.common
import ch.qos.logback.classic.Level
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback.classic.html.HTMLLayout
import ch.qos.logback.classic.spi.ILoggingEvent
import ch.qos.logback.core._
import ch.qos.logback.core.encoder.{ Encoder, LayoutWrappingEncoder }
impo... | allenai/common | core/src/main/scala/org/allenai/common/Logging.scala | Scala | apache-2.0 | 4,947 |
package com.codahale.jerkson.deser
import com.fasterxml.jackson.databind.JavaType
import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
import com.fasterxml.jackson.core.{JsonToken, JsonParser}
import collection.MapFactory
import com.fasterxml.jackson.databind.deser.ResolvableDeserializer
c... | rememberthemilk/jerkson | src/main/scala/com/codahale/jerkson/deser/ImmutableMapDeserializer.scala | Scala | mit | 1,331 |
import Common._
import PokeApiRequester.PokeApiClient
import PokemonsDataStore.{Pokedex, PokemonBase}
import PokemonsDataStore.PokemonModel.PokemonStat
import akka.actor.{Actor, ActorRef, ActorSystem, Props}
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.HttpRequest
import akka.stream.scaladsl.Flow
/**... | Sid3way/SuperRadHomework | src/main/scala/Bootstrapper.scala | Scala | unlicense | 1,253 |
package org.scalaide.core.internal.builder
package zinc
import java.io.File
import java.lang.ref.SoftReference
import java.util.concurrent.atomic.AtomicReference
import scala.collection.mutable
import scala.tools.nsc.Settings
import org.eclipse.core.resources.IContainer
import org.eclipse.core.resources.IFile
import... | mlangc/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/core/internal/builder/zinc/EclipseSbtBuildManager.scala | Scala | bsd-3-clause | 10,560 |
package features
trait Transformer {
def transform: String => Seq[String]
}
object Transformers {
object default {
implicit object DefaultTransformer extends Transformer {
override def transform: String => Seq[String] =
SentimentNormalizer andThen
ShortFormNormalizer andThen
... | openforce/spark-mllib-scala-play | app/features/Transformer.scala | Scala | apache-2.0 | 482 |
package mesosphere.marathon
package util
import akka.actor.Scheduler
import mesosphere.util.DurationToHumanReadable
import akka.pattern.after
import scala.concurrent.duration.{Duration, FiniteDuration}
import scala.concurrent.{ExecutionContext, Future, blocking => blockingCall}
/**
* Function transformations to ma... | gsantovena/marathon | src/main/scala/mesosphere/marathon/util/Timeout.scala | Scala | apache-2.0 | 1,946 |
package sample.async_native
import skinny.micro._
import skinny.micro.contrib.ScalateSupport
import skinny.micro.contrib.jackson.JSONSupport
import scala.concurrent.Future
class EchoApp extends AsyncWebApp with JSONSupport with ScalateSupport {
get("/echo.json") { implicit ctx =>
contentType = "application/js... | xerial/skinny-micro | samples/src/main/scala/sample/async_native/EchoApp.scala | Scala | bsd-2-clause | 859 |
package quisp.enums
/**
* @author rodneykinney
*/
object HcSeriesType {
val AREA = area
val AREASPLINE = areaspline
val BAR = bar
val BOXPLOT = boxplot
val COLUMN = column
val LINE = line
val PIE = pie
val SCATTER = scatter
val SPLINE = spline
case object area extends HcSeriesType
case object... | rodneykinney/quisp | src/main/scala/quisp/enums/HcSeriesType.scala | Scala | apache-2.0 | 695 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala | Scala | apache-2.0 | 9,998 |
package hr.element.beepo.client
package xml
import email._
import scala.xml.NodeSeq
import hr.element.etb.Pimps._
import org.apache.commons.codec.binary.Base64
trait AttachmentXMLConverter extends XMLConverter { this: Attachment =>
def toXml =
<Attachment>
<fileName>{ filename }</fileName>
<mimeType>{ mimeTyp... | element-doo/beepo | code/scala/client/src/main/scala/hr/element/beepo/client/xml/AttachmentXMLConverter.scala | Scala | bsd-3-clause | 445 |
package com.redbubble.pricer.http
import cats.data.NonEmptyList
import com.redbubble.pricer.common.{Pricer, _}
import com.twitter.finagle.Http
import com.twitter.util.Await
final class PricingServer(pricer: Pricer) extends Endpoints(pricer) {
def start(): Unit = {
val server = Http.server.serve(":8081", api.toS... | tomjadams/scala-workshop | example_code/src/main/scala/com/redbubble/pricer/http/HttpApp.scala | Scala | bsd-3-clause | 551 |
/*
* Copyright 2016 rdbc contributors
*
* 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... | rdbc-io/rdbc-pgsql | rdbc-pgsql-core/src/main/scala/io/rdbc/pgsql/core/internal/fsm/WarningCollection.scala | Scala | apache-2.0 | 1,335 |
package de.htwg.zeta.persistence.mongo
import play.api.libs.json.JsError
import play.api.libs.json.JsObject
import play.api.libs.json.JsSuccess
import play.api.libs.json.OWrites
import play.api.libs.json.Reads
private[mongo] object MongoPlayConversionHelper {
def writePlayJson[E](entity: E)(implicit writes: OWrit... | Zeta-Project/zeta | api/persistence/src/main/scala/de/htwg/zeta/persistence/mongo/MongoPlayConversionHelper.scala | Scala | bsd-2-clause | 634 |
package org.jetbrains.plugins.scala.testingSupport.utest.scala2_11.utest_0_5_4
import org.jetbrains.plugins.scala.testingSupport.utest.UTestSimpleTest
import org.jetbrains.plugins.scala.SlowTests
import org.junit.experimental.categories.Category
/**
* @author Roman.Shein
* @since 04.09.2015.
*/
@Category(Array(... | triplequote/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/testingSupport/utest/scala2_11/utest_0_5_4/UTestSimpleTest_2_11_0_5_4.scala | Scala | apache-2.0 | 433 |
package hello
object HelloWorld {
def main(args: Array[String]) {
println("Hello World!")
}
} | quchunguang/test | testjava/hello/src/hello/HelloWorld.scala | Scala | mit | 104 |
package bifrost.transaction
/**
* Created by cykoz on 5/11/2017.
*/
import java.util.UUID
import bifrost.program.ExecutionBuilder
import bifrost.transaction.bifrostTransaction.BifrostTransaction.Nonce
import bifrost.transaction.box.{CodeBox, ExecutionBox, StateBox}
import bifrost.{BifrostGenerators, ValidGenerat... | Topl/Project-Bifrost | src/test/scala/bifrost/transaction/ProgramTransactionSpec.scala | Scala | mpl-2.0 | 10,444 |
package spike.hystrix
import com.netflix.hystrix.{HystrixCommand, HystrixCommandGroupKey}
class FooCommand(name: String)
extends HystrixCommand[String](HystrixCommandGroupKey.Factory.asKey("FooGroup")) {
override def run() = s"Foo $name!"
}
| Dan-Dongcheol-Lee/spike-hystrix | src/main/scala/spike/hystrix/FooCommand.scala | Scala | apache-2.0 | 248 |
package com.github.j5ik2o.spetstore.adaptor.aggregate
import akka.actor.{ Actor, ActorRef, Props }
import com.github.j5ik2o.spetstore.infrastructure.domainsupport.EntityId
import com.github.j5ik2o.spetstore.infrastructure.domainsupport.EntityProtocol.CommandRequest
abstract class AbstractMessageBroker[ID <: EntityId,... | j5ik2o/spetstore-cqrs-es-akka | write-interface/src/main/scala/com/github/j5ik2o/spetstore/adaptor/aggregate/AbstractMessageBroker.scala | Scala | mit | 839 |
package mypipe.avro.schema
import scala.collection.mutable
import java.util.logging.Logger
import com.google.common.collect.{HashBiMap, BiMap}
import org.schemarepo.client.RESTRepositoryClient
import org.schemarepo.json.GsonJsonUtil
import org.schemarepo.{BaseRepository, Subject, SchemaEntry}
trait SchemaRepository[I... | mardambey/mypipe | mypipe-avro/src/main/scala/mypipe/avro/schema/GenericSchemaRepository.scala | Scala | apache-2.0 | 9,601 |
/* Copyright 2009-2021 EPFL, Lausanne */
package stainless
package transformers
import inox.transformers.TransformerOp
trait Transformer extends inox.transformers.Transformer { self =>
val s: ast.Trees
val t: ast.Trees
// required override to get access to the pattern deconstructor
override lazy val deconst... | epfl-lara/stainless | core/src/main/scala/stainless/transformers/Transformer.scala | Scala | apache-2.0 | 3,887 |
package controllers
import org.scalatestplus.play._
import org.scalatestplus.play.guice._
import play.api.test._
import play.api.test.Helpers._
/**
* Add your spec here.
* You can mock out a whole application including requests, plugins etc.
*
* For more information, see https://www.playframework.com/documentatio... | lightbend-training/course-management-tools | course-templates/play-cmt-template-no-common/exercise_001_http_routes/test/controllers/HomeControllerSpec.scala | Scala | apache-2.0 | 1,741 |
package com.blinkboxbooks.resourceserver
import org.eclipse.jetty.servlet.{ServletHolder, ServletMapping}
import org.junit.runner.RunWith
import org.scalatra.util.RicherString._
import org.scalatra.test.scalatest.ScalatraSuite
import org.scalatest.mock.MockitoSugar
import org.scalatest.junit.JUnitRunner
import org.sca... | blinkboxbooks/resource-server.scala | src/test/scala/com/blinkboxbooks/resourceserver/ResourceServletUnitTest.scala | Scala | mit | 12,656 |
package ls
object Git {
object GhRepo {
val GHRemote = """^git@github.com[:](\\S+)/(\\S+)[.]git$""".r
def unapply(line: String) = line.split("""\\s+""") match {
case Array(_, GHRemote(user, repo), _) => Some(user, repo)
case _ => None
}
}
val CurrentBranch = """^([*]\\S+)(.*)$""".r
... | Rhinofly/ls | plugin/src/main/scala/git.scala | Scala | mit | 957 |
package com.avsystem.scex
package compiler.xmlfriendly
import java.{lang => jl, util => ju}
import com.avsystem.scex.compiler.ScexFunSuite
/**
* Created: 23-04-2014
* Author: ghik
*/
class XmlFriendlyTranslatorTest extends ScexFunSuite {
import com.avsystem.scex.compiler.xmlfriendly.XmlFriendlyTranslator.trans... | pnf/scex | scex-derived/src/test/scala/com/avsystem/scex/compiler/xmlfriendly/XmlFriendlyTranslatorTest.scala | Scala | apache-2.0 | 1,490 |
//package com.sksamuel.elastic4s.search.suggestions
//
//import com.sksamuel.elastic4s.{ElasticDsl, Indexable}
//import com.sksamuel.elastic4s.testkit.{DiscoveryLocalNodeProvider, ElasticSugar}
//import org.elasticsearch.search.suggest.phrase.DirectCandidateGeneratorBuilder
//import org.scalatest.{Matchers, WordSpec}
/... | stringbean/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/suggestions/PhraseSuggestionsTest.scala | Scala | apache-2.0 | 4,252 |
package com.feynmanliang.optala.examples
import java.io.File
import breeze.linalg.{DenseVector, Matrix, Vector, csvwrite}
import breeze.stats.distributions.{RandBasis, ThreadLocalRandomGenerator, Uniform}
import org.apache.commons.math3.random.MersenneTwister
import com.feynmanliang.optala.Solution
import com.feynma... | feynmanliang/optala | src/main/scala/com/feynmanliang/optala/examples/ExampleUtils.scala | Scala | mit | 1,471 |
package chapter02
import java.util.concurrent.PriorityBlockingQueue
/*
Extend the PriorityTaskPool class from the previous exercise so that
it supports any number of worker threads p.
The parameter p is specified in the constructor of the PriorityTaskPool class.
*/
object Exercise09 {
class PriorityTaskPool(numW... | vsuharnikov/books-exercises | scala/learning-concurrent-programming-in-scala/src/main/scala/chapter02/Exercise09.scala | Scala | mit | 1,566 |
package shapes.typeclasses
import shapes.untouchable.{Square, Circle}
object Main extends App {
def area[T](shape: T)(implicit calc: Calculator[T]): Double = {
calc.area(shape)
}
def area[T](shapes: List[T])(implicit calc: Calculator[T]): List[Double] = {
shapes.map(calc.area(_))
}
println(area(... | tupol/scala-patterns-tc-pml | src/main/scala/shapes/typeclasses/Main.scala | Scala | apache-2.0 | 565 |
package com.oct.sclaav.visual.assembly.genetic
import com.oct.sclaav.visual.computation.{ComputesMeanAndStddev, Distance2, ImageSimilarityArgbDistance2, ImageSimilarityRgbDistance2}
import com.oct.sclaav.visual.manipulators._
import com.oct.sclaav.{CompleteAssembler, ImageManipulator, IterationStats}
import com.sksamu... | ogeagla/sclaav | src/main/scala/com/oct/sclaav/visual/assembly/genetic/SimpleCompleteGeneticAssembler.scala | Scala | apache-2.0 | 12,067 |
package org.apache.hadoop.mapred
trait HadoopMapRedUtil {
def newJobContext(conf: JobConf, jobId: JobID): JobContext = new JobContext(conf, jobId)
def newTaskAttemptContext(conf: JobConf, attemptId: TaskAttemptID): TaskAttemptContext = new TaskAttemptContext(conf, attemptId)
}
| koeninger/spark | core/src/hadoop1/scala/org/apache/hadoop/mapred/HadoopMapRedUtil.scala | Scala | bsd-3-clause | 284 |
package com.dazito.scala.dakkabase.messages
/**
* Created by daz on 29/02/2016.
*/
case class DeleteMessage(key: String)
case class GetRequest (key: String)
case class KeyNotFoundException(key: String) extends Exception
case class SetIfNotExists(key: String, value: Object)
case class SetRequest(key: String, value: O... | dazito/LearningAkkaScalaServer | akkademy-db/src/main/scala/com/dazito/scala/dakkabase/messages/Messages.scala | Scala | mit | 552 |
package com.twitter.finagle.http
import com.twitter.conversions.DurationOps._
import com.twitter.io.Buf
import java.time.ZonedDateTime
import java.util.Date
import org.scalatest.funsuite.AnyFunSuite
class MessageTest extends AnyFunSuite {
private def defaultMessages(): Seq[Message] = Seq(Request(), Response())
... | twitter/finagle | finagle-base-http/src/test/scala/com/twitter/finagle/http/MessageTest.scala | Scala | apache-2.0 | 11,256 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | hpe-cct/cct-core | src/main/scala/cogx/runtime/execution/KernelProxyActor.scala | Scala | apache-2.0 | 5,772 |
implicit class ArrayString(sc: StringContext) {
def arr(args: Any*): Array[String] = sc.parts(0).split(" ")
}
| grzegorzbalcerek/scala-book-examples | examples/ArrayString.scala | Scala | mit | 112 |
/*
Author:
Kristal Curtis
*/
package siren.test
import org.scalatest._
import siren._
class SAMTagsTest extends FunSuite {
val tagStr = "XC:i:100 XT:A:U NM:i:0 SM:i:29 AM:i:29 X0:i:1 X1:i:0 XM:i:0 XO:i:0 XG:i:0 MD:Z:100 RG:Z:VenterC"
val tagList = tagStr.split("\\t").toList
val samTags = new SAMTags(tagL... | fnothaft/siren-release | src/test/scala/SAMTagsTest.scala | Scala | bsd-2-clause | 2,480 |
package com.varunvats.practice.tree
import com.varunvats.practice.sorting.UnitSpec
class PathsWithSumSpec extends UnitSpec {
val theTreeContains = afterWord("the tree contains")
"The number of paths with the given sum" must {
"be zero" when theTreeContains {
"only one node and its value is lower than ... | varunvats/practice | jvm/src/test/scala/com/varunvats/practice/tree/PathsWithSumSpec.scala | Scala | mit | 4,173 |
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* The Apereo Foundation licenses this file to you under the Apache License,
* Version 2.0, (the "License"); you ma... | equella/Equella | Source/Plugins/Core/com.equella.core/scalasrc/com/tle/core/item/serializer/impl/SearchDetailsSerializer.scala | Scala | apache-2.0 | 4,490 |
package com.getjenny.starchat.entities.io
import scalaz.Scalaz._
object ObservedDataSources extends Enumeration {
type ObservedDataSource = Value
val KNOWLEDGEBASE, CONV_LOGS, unknown = Value
def value(enumValue: String) = values.find(_.toString === enumValue).getOrElse(unknown)
}
| GetJenny/starchat | src/main/scala/com/getjenny/starchat/entities/io/ObservedDataSources.scala | Scala | gpl-2.0 | 290 |
package com.sksamuel.elastic4s.handlers.index.mapping
import com.sksamuel.elastic4s.handlers.ElasticErrorParser
import com.sksamuel.elastic4s.requests.indexes.{FieldMapping, IndexFieldMapping, IndexMappings, PutMappingResponse}
import com.sksamuel.elastic4s.requests.mappings.{GetFieldMappingRequest, GetMappingRequest,... | sksamuel/elastic4s | elastic4s-handlers/src/main/scala/com/sksamuel/elastic4s/handlers/index/mapping/MappingHandlers.scala | Scala | apache-2.0 | 4,347 |
package views.vrm_retention
object Timeout {
final val ExitId = "exit"
}
| dvla/vrm-retention-online | app/views/vrm_retention/Timeout.scala | Scala | mit | 80 |
package com.sksamuel.elastic4s.search.aggs
import com.sksamuel.elastic4s.http.search.Aggregations
import com.sksamuel.elastic4s.searches.DateHistogramInterval
import com.sksamuel.elastic4s.RefreshPolicy
import com.sksamuel.elastic4s.testkit.DockerTests
import org.scalatest.{FreeSpec, Matchers}
import scala.util.Try
... | Tecsisa/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/aggs/SerialDiffPipelineAggHttpTest.scala | Scala | apache-2.0 | 2,106 |
package com.bot4s.telegram.models
/**
* This object represents a sticker.
*
* @param fileId Identifier for this file
* @param fileUniqueId Unique identifier for this file
* @param width Sticker width
* @param height Sticker height
* @param isAnimated Boolean True, if the sticker is ani... | mukel/telegrambot4s | core/src/com/bot4s/telegram/models/Sticker.scala | Scala | apache-2.0 | 1,047 |
/**
* 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... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/test/scala/unit/kafka/log/OffsetIndexTest.scala | Scala | apache-2.0 | 7,064 |
package com.sksamuel.elastic4s.analyzers
import org.scalatest.{Matchers, WordSpec}
class SnowballTokenFilterTest extends WordSpec with TokenFilterDsl with Matchers {
"SnowballTokenFilter builder" should {
"set language" in {
snowballTokenFilter("testy").lang("vulcan").json.string shouldBe """{"type":"sno... | FabienPennequin/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analyzers/SnowballTokenFilterTest.scala | Scala | apache-2.0 | 363 |
package com.jackbeasley.enigma
class CLI {
}
| jackbeasley/enigma | src/main/scala/CLI.scala | Scala | gpl-3.0 | 47 |
package org.scaladebugger.api.profiles.java.info
import com.sun.jdi._
import org.scaladebugger.api.profiles.traits.info.{ArrayTypeInfo, _}
import org.scaladebugger.api.virtualmachines.ScalaVirtualMachine
/**
* Represents a java implementation of a array type profile that adds no
* custom logic on top of the standar... | ensime/scala-debugger | scala-debugger-api/src/main/scala/org/scaladebugger/api/profiles/java/info/JavaArrayTypeInfo.scala | Scala | apache-2.0 | 3,004 |
class C[A](private val a: Any) extends AnyVal
object Test {
val f = (x: C[Any]) => {println(s"f($x)"); x}
trait T[A] {
def apply(a: A): A
}
val g = new T[C[Any]] { def apply(a: C[Any]) = { println(s"g($a)"); a } }
def main(args: Array[String]) {
f(new C("."))
val methods = f.getClass.getDeclare... | felixmulder/scala | test/files/run/t6260c.scala | Scala | bsd-3-clause | 437 |
package epam.idobrovolskiy.wikipedia.trending.document
/**
* Created by Igor_Dobrovolskiy on 21.07.2017.
*/
class BasicBodyStats(
//bodyLines: Seq[String]
val linesCount: Int,
val topNTokens: Map[String, Int])
{
private lazy val topNTokensString = topNTokens.toList
.map { //TODO: remove after finalize... | igor-dobrovolskiy-epam/wikipedia-analysis-scala-core | src/main/scala/epam/idobrovolskiy/wikipedia/trending/document/BasicBodyStats.scala | Scala | apache-2.0 | 877 |
package ru.pavkin.todoist.api.core.model
import org.scalacheck.Arbitrary._
import org.scalacheck.Gen
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest.{FunSuite, Matchers}
class IndentSpec extends FunSuite with Matchers with GeneratorDrivenPropertyChecks {
test("Indent.unsafeBy returns i... | vpavkin/scalist | tests/src/test/scala/ru/pavkin/todoist/api/core/model/IndentSpec.scala | Scala | mit | 632 |
/**
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.dispatch
import akka.actor.{ ActorCell, ActorRef }
import akka.dispatch.sysmsg._
import scala.annotation.tailrec
import scala.concurrent.duration.Duration
import akka.util.Helpers
import java.util.{ Comparator, Iterator }
import j... | Fincore/org.spark-project.akka | actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala | Scala | mit | 4,105 |
import scala.swing._
import event._
import java.io._
object UnicodeEditor extends SimpleSwingApplication {
def top = new MainFrame {
title = "Unicode Editor"
menuBar = AppMenuBar
contents = AppPanel
}
}
object AppMenuBar extends MenuBar {
contents += FileMenu
object FileMenu extends Menu("File") {
... | grzegorzbalcerek/scala-book-examples | examples/UnicodeEditor.scala | Scala | mit | 5,090 |
/*
* 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
* distribute... | xerial/silk | silk-core/src/main/scala/xerial/silk/core/Silk.scala | Scala | apache-2.0 | 787 |
package model
import org.joda.time.DateTime
case class TaxiRide(minutesAboveLimit: Int, milesBelowLimit: Int, dateOfStart: DateTime)
| Gneotux/taxifarecalculator | app/model/TaxiRide.scala | Scala | apache-2.0 | 136 |
import sbt.Keys.{publishArtifact, _}
import sbt._
object Common {
val Settings: Seq[Def.Setting[_]] = Seq(
organization := "net.dericbourg.daily-utils",
version := "0.1.8",
scalaVersion := "2.12.1",
crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.1"),
scalacOptions ++= Seq("-deprecation", "-... | adericbourg/daily-utils | project/Common.scala | Scala | gpl-3.0 | 1,892 |
package de.uni_potsdam.hpi.coheel
import de.uni_potsdam.hpi.coheel.wiki.{WikiPageReader, Extractor}
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import scala.io.Source
@RunWith(classOf[JUnitRunner])
class PlainTextExtractionTest extends FunSuite {
def fixture... | stratosphere/coheel | src/test/scala/de/uni_potsdam/hpi/coheel/PlainTextExtractionTest.scala | Scala | apache-2.0 | 1,145 |
/*
* Copyright (c) 2016 Mashin (http://mashin.io). 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 ... | mashin-io/rich-spark | main/src/test/scala/io/mashin/rich/spark/RichPairRDDFunctionsSuite.scala | Scala | apache-2.0 | 2,003 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-process/geomesa-process-vector/src/main/scala/org/locationtech/geomesa/process/query/KNearestNeighborSearchProcess.scala | Scala | apache-2.0 | 21,553 |
/** Copyright 2015, Metreta Information Technology s.r.l. */
package com.metreta.spark.orientdb.connector.rdd
import com.orientechnologies.orient.core.sql.query.{OResultSet, OSQLSynchQuery}
import org.apache.spark.{SparkContext, _}
import scala.collection.JavaConversions._
import scala.reflect.ClassTag
import com.or... | metreta/spark-orientdb-connector | spark-orientdb-connector/src/main/scala/com/metreta/spark/orientdb/connector/rdd/OrientClassRDD.scala | Scala | apache-2.0 | 5,632 |
package org.jetbrains.plugins.scala
package lang
package completion
package filters.definitions
import com.intellij.psi.filters.ElementFilter
import org.jetbrains.annotations.NonNls
import com.intellij.psi._
import org.jetbrains.plugins.scala.lang.psi.api.expr._
import org.jetbrains.plugins.scala.lang.psi.api.toplevel... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/completion/filters/definitions/DefinitionsFilter.scala | Scala | apache-2.0 | 2,812 |
/**
* Copyright 2015, deepsense.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 required by applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | workflowexecutor/src/main/scala/io/deepsense/workflowexecutor/pythongateway/PythonGateway.scala | Scala | apache-2.0 | 4,499 |
package downstream
import japgolly.scalajs.react.util.DefaultEffects._
object ScalafixTest {
def x: Sync[Int] = Sync.delay(1)
}
| japgolly/scalajs-react | downstream-tests/generic/src/main/scala/downstream/ScalafixTest.scala | Scala | apache-2.0 | 132 |
/*
* Copyright (c) 2014.
*
* This file is part of picture-classifier.
*
* picture-classifier 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 ... | meisam/photo-classifier | core/src/test/scala/edu/osu/cse/ai/photoclassifier/TestPhotoMetadataExtractor.scala | Scala | gpl-3.0 | 5,038 |
package models.summary
import scala.language.implicitConversions
/**
* @author zepeng.li@gmail.com
*/
case class Daily[K, V](
data: Map[K, V] = Map()
) extends AnyVal
object Daily {
implicit def DailyToMap[K, V](daily: Daily[K, V]): Map[K, V] = daily.data
}
case class Monthly[K, V](
data: Map[K, V] = Map()... | lizepeng/app.io | modules/models/app/models/summary/Period.scala | Scala | apache-2.0 | 937 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/PurityOfBody.scala | Scala | apache-2.0 | 1,261 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This... | beangle/data | jdbc/src/main/scala/org/beangle/data/jdbc/vendor/driver.scala | Scala | lgpl-3.0 | 1,830 |
/*
* Copyright 2017-2020 Aleksey Fomkin
*
* 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... | fomkin/korolev | modules/korolev/src/main/scala/korolev/Router.scala | Scala | apache-2.0 | 1,093 |
/*
* 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/test/scala/org/apache/flink/table/plan/rules/logical/JoinDependentConditionDerivationRuleTest.scala | Scala | apache-2.0 | 3,918 |
package objsets
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import java.util.NoSuchElementException
@RunWith(classOf[JUnitRunner])
class TweetSetSuite extends FunSuite {
trait TestSets {
val set1 = new Empty
val set2 = set1.incl(new Tweet("a", "a bod... | xfornesa/progfun | objsets/src/test/scala/objsets/TweetSetSuite.scala | Scala | mit | 2,298 |
package org.gbougeard.model.changes
/**
* Created with IntelliJ IDEA.
* User: gbougeard
* Date: 13/07/13
* Time: 21:12
* To change this template use File | Settings | File Templates.
*/
case class ReviewerInfo(kind: String,
approvals: Map[String,String])
object ReviewerInfo {
import p... | gbougeard/gas | src/main/scala/org/gbougeard/model/changes/ReviewerInfo.scala | Scala | apache-2.0 | 486 |
package org.scalaide.ui.editor
import org.scalaide.core.internal.hyperlink.DeclarationHyperlinkDetector
import org.scalaide.core.internal.hyperlink.ImplicitHyperlinkDetector
import org.scalaide.core.internal.hyperlink.ScalaHyperlink
import org.eclipse.jface.text.IRegion
import org.eclipse.jface.text.hyperlink.IHyperli... | Kwestor/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/editor/SourceConfiguration.scala | Scala | bsd-3-clause | 2,426 |
/**
* 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... | vkroz/kafka | core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala | Scala | apache-2.0 | 12,503 |
/**
* Copyright (c) 2007-2011 Eric Torreborre <etorreborre@yahoo.com>
*
* 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 ... | Muki-SkyWalker/specs | src/main/scala/org/specs/specification/PendingUntilFixed.scala | Scala | mit | 3,360 |
/*
* 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 ... | nlalevee/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala | Scala | apache-2.0 | 62,765 |
package quisp.highcharts
import quisp.{ExtensibleJsObjectAPI, ExtensibleJsObject}
import quisp.enums.{DashStyle, HcSymbol, Stacking}
import spray.json.{JsValue, JsonWriter}
import java.awt.Color
import javax.jws.WebMethod
/**
* @author rodneykinney
*/
case class PlotSpecificSettings(
area: SeriesSettings = null,... | rodneykinney/quisp | src/main/scala/quisp/highcharts/PlotSettingsAPI.scala | Scala | apache-2.0 | 2,911 |
package at.linuxhacker.procmetrics.tests.global
import org.junit.runner.RunWith
import org.junit.Test
import org.scalatest.junit.JUnitRunner
import org.scalatest.FlatSpec
import at.linuxhacker.procmetrics.global._
import at.linuxhacker.procmetrics.values._
import at.linuxhacker.procmetrics.lib.ProcInfo
@Test
@RunWith... | hstraub/ProcMetrics | src/test/scala/at/linuxhacker/procmetrics/tests/global/Tests.scala | Scala | gpl-3.0 | 3,343 |
/*
* 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... | kapil-malik/incubator-toree | protocol/src/main/scala/org/apache/toree/kernel/protocol/v5/content/CompleteReply.scala | Scala | apache-2.0 | 1,663 |
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import sbt._
/**
* Application settings. Configure the build for your application here.
* You normally don't have to touch the actual build definition after this.
*/
object Settings {
/** The name of your application */
val name = "scalajs-synereo"
/... | LivelyGig/ProductWebUI | project/Settings.scala | Scala | apache-2.0 | 3,653 |
package regolic.analysis
import Preamble._
import regolic.algebra.Rational
class Summation(
val variable: Variable,
val from: Term,
val to: Term,
val body: Term) {
require(!contains(from, variable) && !contains(to, variable))
def closedFormula: Option[Term] = {
val newVar = variable
val newBod... | regb/scabolic | src/main/scala/regolic/analysis/Summation.scala | Scala | mit | 7,089 |
object Test extends App {
trait Ord[X]
type TL1 = [X <: Ord[X]] =>> (X, X) // OK
type TL2 = [X >: Ord[X]] =>> (X, X) // error: illegal cyclic reference: lower bound Test.Ord[X] of type X refers back to the type itself
}
| som-snytt/dotty | tests/neg/type-lambdas.scala | Scala | apache-2.0 | 229 |
package com.eevolution.context.dictionary.domain.api.repository
import com.eevolution.context.dictionary._
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Publi... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/repository/TreeBarRepository.scala | Scala | gpl-3.0 | 1,125 |
/**
*
* Copyright (c) 2015-2017 Rodney S.K. Lai
* https://github.com/rodney-lai
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
*
* THE SOFTW... | rodney-lai/test-site | lib/com/rodneylai/stackc/RequireSSL.scala | Scala | isc | 1,970 |
import sbt._
import Keys._
object CoreBuild {
import Dependencies._
val settings = BuildSettings.common ++ Seq(
libraryDependencies ++= Seq(
Akka.actor,
Akka.slf4j,
Spray.can,
Spray.client,
Spray.routing,
Spray.json,
specs2,
Spray.testkit,
Akka.testkit
... | OmniaGM/activator-spray-twitter | project/CoreBuild.scala | Scala | apache-2.0 | 390 |
package com.vwo.oldmonk.free
import scalaz._
import Scalaz._
import com.vwo.oldmonk.datastructures.CovariantSet
import spire.algebra.{Order => SpireOrder, _}
import spire.implicits._
trait FreeBoolAlgebra[F[_]] extends Applicative[F] with Functor[F] with Monad[F] with Traverse[F] {
// A Free Boolean Algebra has a B... | wingify/Oldmonk | src/main/scala/com/vwo/oldmonk/free/FreeBool.scala | Scala | gpl-3.0 | 14,457 |
package sdroid
trait Types {
type AService = android.app.Service
type AActivity = android.app.Activity
}
object Types extends Types | sdb/cloudr | sdroid/src/Types.scala | Scala | gpl-3.0 | 137 |
package com.twitter.inject
import com.google.inject.assistedinject.FactoryModuleBuilder
import com.google.inject.matcher.{Matcher, Matchers}
import com.google.inject.spi.TypeConverter
import com.google.inject.{Module, _}
import com.twitter.app.Flaggable
import com.twitter.util.logging.Logging
import java.lang.annotati... | twitter/util | util-inject/src/main/scala/com/twitter/util/inject/TwitterModule.scala | Scala | apache-2.0 | 16,734 |
package com.insweat.hssd.lib.essence
import com.insweat.hssd.lib.util._
import com.insweat.hssd.lib.util.logging.Logger
import scala.collection.immutable.HashMap
import scala.annotation.tailrec
import com.insweat.hssd.lib.tree.EntryTree
import java.net.URI
class DBException(msg: String, cause: Throwable = nu... | insweat/hssd | com.insweat.hssd.lib/src/com/insweat/hssd/lib/essence/Database.scala | Scala | lgpl-3.0 | 3,942 |
package com.github.izmailoff.marshalling.mongo.record
import net.liftweb.json._
import net.liftweb.mongodb.record.BsonRecord
import spray.http.ContentTypes._
import spray.httpx.LiftJsonSupport
import spray.httpx.marshalling.Marshaller
trait MongoRecordMarshalling
extends LiftJsonSupport {
implicit val BsonRecordMa... | izmailoff/Spray-mongo-record | marshallers/src/main/scala/com/github/izmailoff/marshalling/mongo/record/MongoRecordMarshalling.scala | Scala | mit | 605 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | minixalpha/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala | Scala | apache-2.0 | 19,024 |
package HandlerSocket.Protocol
object MySQLErrorCodes {
val errCodeMap = Array[(String,Long,String)] (("121",100L,"Primary key conflict"),
("open_table",101L,"Table not exist."),("stmtnum",102L,"Statement number incorrect."),
("135",103L,"No more room in record file."),("fld",104L,"Index of set not match db ... | Mevolutrix/MevoFramework | Utils/src/main/scala/HandlerSocket/Protocol/HandlerSocketException.scala | Scala | apache-2.0 | 697 |
package cmdreader.std
import cmdreader._
import types._
import util._
class Ixsc extends CommandOperator {
def getName = "ixsc"
def getOpAlias = "@%*|"
def isValidArg0(n: Int) = n == 2 || n == 3
def getPrecedence = PStandard.RELATION
def hasAssignmentEquiv = false
def isReversed = false
def getDoubleBa... | bluebear94/bag | src/main/scala/cmdreader/std/Ixsc.scala | Scala | gpl-3.0 | 761 |
//
// KilledException.scala -- Scala exception KilledException
// Project PorcE
//
// Copyright (c) 2017 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the license terms in
// the LICENSE file found in the project's top-level directory and also found at
... | orc-lang/orc | PorcE/src/orc/run/porce/runtime/KilledException.scala | Scala | bsd-3-clause | 667 |
package mgoeminne.scalaggplot.coord
/**
* Flipped cartesian coordinates.
*
* Flipped cartesian coordinates so that horizontal becomes vertical, and vertical, horizontal.
* This is primarily useful for converting geoms and statistics which display y conditional on x, to x conditional on y.
*
* == Examples ==
*
... | mgoeminne/scala-ggplot | src/main/scala/mgoeminne/scalaggplot/coord/flip.scala | Scala | lgpl-3.0 | 531 |
object Test {
case class C(x: Int)
case class D(x: Int)
def f(x: Int)(using c: C) = x + c.x
def g0(x: Int)(using c: C) (y: Int) = x + c.x + y
def g(x: Int)(using c: C)(using D) = x + c.x + summon[D].x // OK
def h(x: Int) given () = x // error: missing return type
given C as C(11)
given D as D(11)... | som-snytt/dotty | tests/neg/implicit-params.scala | Scala | apache-2.0 | 531 |
package postgresweb.models
/**
* Created by andreaminetti on 23/02/16.
*/
case class Table(headers:Vector[String],rows: Vector[Vector[String]], schema:JSONSchema)
object Table{
def empty = Table(Vector(),Vector(),JSONSchema.empty)
} | minettiandrea/postgres-web | src/main/scala/postgresweb/models/Table.scala | Scala | apache-2.0 | 238 |
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.