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.twitter.finagle.tracing
import com.twitter.finagle.tracing.Annotation.Message
import com.twitter.logging.{Level, LogRecord}
import org.specs.SpecificationWithJUnit
class TracingLogHandlerSpec extends SpecificationWithJUnit {
"TracingLogHandler" should {
doBefore { Trace.clear() }
"send messages... | foursquare/finagle | finagle-core/src/test/scala/com/twitter/finagle/tracing/TracingLogHandlerSpec.scala | Scala | apache-2.0 | 698 |
package misc.sudoku
/**
* Created by sajit on 1/1/15.
*/
class Board(cells:Array[Array[Int]]) {
// def solve(boardState:Array[Array[Int]]):Array[Array[Int]] = {
//
// if(SudokuHelperUtils.isSolved(boardState)){
// boardState
// }
// else{
// boardState.zipWithIndex.map{
// case(row,row... | sajit/skalad | scala/src/main/scala/misc/sudoku/Board.scala | Scala | apache-2.0 | 1,044 |
package concrete.constraint.extension
import java.util
import bitvectors.BitVector
import concrete._
import concrete.constraint.{Constraint, StatefulConstraint}
import concrete.util.SparseSet
import mdd.{MDD, MDD0, MDDLeaf, TSSet}
/* MDDRelation comes with its own timestamp */
class MDDC(_scope: Array[Variable], val... | concrete-cp/concrete | src/main/scala/concrete/constraint/extension/MDDC.scala | Scala | lgpl-2.1 | 2,796 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.tools.nsc
packag... | scala/scala | src/compiler/scala/tools/nsc/backend/jvm/analysis/InstructionStackEffect.scala | Scala | apache-2.0 | 9,815 |
package com.buransky.plugins.scoverage.samples.sbt.multiModule.module1
import scala.util.Random
trait Beer {
val volume: Double
def isGood: Boolean = (volume > 0.0)
}
case object EmptyBeer extends {
val volume = 0.0
} with Beer
trait SlovakBeer extends Beer {
override def isGood = Random.nextBoolean
}
trai... | zenderol/sonar-scoverage-plugin | samples/sbt/multi-module/module1/src/main/scala/com/buransky/plugins/scoverage/samples/sbt/multiModule/module1/Beer.scala | Scala | lgpl-3.0 | 626 |
/*
* 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 ... | jasonpet/openwhisk | common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/RetryMetricsCollector.scala | Scala | apache-2.0 | 5,024 |
package momijikawa.lacquer
import akka.actor._
import akka.agent.Agent
import KanColleMessage.{ ApiStart2, Port, Slot_item }
import spray.can.Http
object KanColleWebSocketServer {
final case class Push(msg: String)
def props() = Props(classOf[KanColleWebSocketServer])
}
class KanColleWebSocketServer extends Acto... | windymelt/lacquer | src/main/scala/momijikawa/lacquer/KanColleWebSocketServer.scala | Scala | bsd-3-clause | 3,162 |
/**
* Copyright (c) 2016 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... | dmsuehir/spark-tk | sparktk-core/src/main/scala/org/trustedanalytics/sparktk/frame/internal/ops/flatten/FlattenColumnsFunctions.scala | Scala | apache-2.0 | 4,888 |
package mr.merc.economics
import mr.merc.politics.{Election, Elites, Party, Province, Regime, State, StateElectionReport}
import MapUtil.FloatOperations._
import mr.merc.politics.VotersPolicy.NoVoting
import WorldConstants.Population._
class PoliticalSystem(startingRulingParty: Party, state: State, creationTurn: Int)... | RenualdMarch/merc | src/main/scala/mr/merc/economics/PoliticalSystem.scala | Scala | gpl-3.0 | 4,779 |
package org.http4s
package server
package middleware
import cats.effect._
import cats.implicits._
import fs2._
import java.io.ByteArrayOutputStream
import java.util.zip.GZIPOutputStream
import org.http4s.dsl.io._
import org.http4s.headers._
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
class GZip... | reactormonk/http4s | server/src/test/scala/org/http4s/server/middleware/GZipSpec.scala | Scala | apache-2.0 | 2,643 |
/*
* 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... | qiuxin2012/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/StaticGraph.scala | Scala | apache-2.0 | 4,665 |
/*
* CorrelatorCore.scala
* (LeereNull)
*
* Copyright (c) 2011-2014 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* [email protected]
*/
package de.sciss.leerenull
import... | Sciss/LeereNull | src/main/scala/de/sciss/leerenull/CorrelatorSelector.scala | Scala | gpl-3.0 | 8,372 |
/*
* LaScala
* Copyright (c) 2017. Phasmid Software
*/
package com.phasmid.laScala.fp
import org.scalatest.{FlatSpec, Matchers}
/**
* Created by scalaprof on 4/7/17.
*/
class LazySpec extends FlatSpec with Matchers {
behavior of "AtomicLazyNumber"
it should "work" in {
// val x = AtomicLazyNumber
... | rchillyard/LaScala | src/test/scala/com/phasmid/laScala/fp/LazySpec.scala | Scala | lgpl-2.1 | 327 |
package org.scalameter
package reporting
import java.util.Date
import java.io._
import java.awt.Color
import org.jfree.chart._
import collection._
import xml._
import utils.Tree
import Key._
case class HtmlReporter(val renderers: HtmlReporter.Renderer*) extends Reporter {
val sep = File.separator
def head =... | lossyrob/scalpel | src/main/scala/org/scalameter/reporting/HtmlReporter.scala | Scala | bsd-3-clause | 5,834 |
package org.beaucatcher.bobject
import org.beaucatcher.bobject.Implicits._
import org.beaucatcher.bson._
import org.beaucatcher.mongo._
import org.beaucatcher.caseclass.ClassAnalysis
/**
* The idea of this trait is to implement a backbone.js-style set of methods
* for a MongoDB collection. backbone.js just seems li... | havocp/beaucatcher | bobject/src/main/scala/org/beaucatcher/bobject/JsonMethods.scala | Scala | apache-2.0 | 11,782 |
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 ProjectColorSpec extends FunSuite with Matchers with GeneratorDrivenPropertyChecks {
test("ProjectColor.unsafe... | vpavkin/scalist | tests/src/test/scala/ru/pavkin/todoist/api/core/model/ProjectColorSpec.scala | Scala | mit | 718 |
package org.pinky.core
import com.google.inject.servlet.ServletModule
import com.google.inject.Injector
import org.scalatest.Spec
import org.scalatest.matchers.ShouldMatchers
import org.pinky.guice.PinkyServletContextListener
/**
* Created by IntelliJ IDEA.
* User: phausel
* Date: Jan 21, 2009
* Time: 2:09:37 PM
... | d5nguyenvan/pinky | src/test/scala/org/pinky/core/PinkyServletContextListenerTest.scala | Scala | bsd-3-clause | 1,328 |
package com.github.morikuni.locest.frequency.application.service
import com.github.morikuni.locest.frequency.application.dto.MorphemeDto
import scala.concurrent.Future
trait MorphologicalAnalysisService {
/** 形態素解析をする
*
* @param sentence 形態素解析をする文章
* @return Future.successful(Seq(MorphemeDto)) 成功時
*... | morikuni/locest | frequency/app/com/github/morikuni/locest/frequency/application/service/MorphologicalAnalysisService.scala | Scala | mit | 620 |
package sampler.abc.actor.children
import akka.testkit.TestKit
import org.scalatest.FreeSpecLike
import akka.actor.ActorSystem
class ReceiveActorTest extends TestKit(ActorSystem("ABC-test")) with FreeSpecLike {
"TODO" in fail("TODO")
} | tearne/Sampler | sampler-abc/src/test/scala/sampler/abc/actor/children/ReceiveActorTest.scala | Scala | apache-2.0 | 239 |
/*
* 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 ... | bwsw/t-streams | src/test/scala/com/bwsw/tstreams/common/RoundRobinPartitionIterationPolicyTests.scala | Scala | apache-2.0 | 1,365 |
/*
* Copyright 2013 Werner Punz
*
* 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 writ... | werpu/scalaelresolver | elresolvertest/src/main/scala/com/github/werpu/scalaelresolver/scalaelresolvertest/Bean2.scala | Scala | apache-2.0 | 870 |
package com.bayesianwitch.injera.deduplication
import scala.collection.mutable.HashMap
import com.google.common.cache._
import java.util.concurrent.TimeUnit
import com.google.common.hash.{BloomFilter,Funnel, PrimitiveSink}
class SimpleRepeatAvoider[T <: Object] extends RepeatAvoider[T] {
//This will likely overload... | bayesianwitch/injera | src/main/scala/injera/deduplication/RepeatAvoiders.scala | Scala | gpl-3.0 | 1,177 |
package org.rplsd.condalang.data
/**
* Created by Luqman on 11/28/2015.
*/
case class RecipeJumlah (nama_resep:String, jumlah:Int)
object RecipeJumlah {
def nama_resep = "nama_resep"
def jumlah = "jumlah"
}
| luqmankusnadi/Tugas-RPLSD-DSL | src/main/scala/org/rplsd/condalang/data/RecipeJumlah.scala | Scala | mit | 217 |
package org.kirhgoff.ap.core
import org.kirhgoff.ap.model.lifegame.LifeGameElement
trait Element {
//TODO remove from element
def x:Int
def y:Int
def getStrategy(environment: Environment): Strategy
def isAlive: Boolean
}
class EmptyElement(val x:Int, val y:Int) extends Element {
override def getStrategy... | kirhgoff/life-server | app/org/kirhgoff/ap/core/Element.scala | Scala | mit | 428 |
/*
* 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... | jenniew/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/torch/SoftSignSpec.scala | Scala | apache-2.0 | 3,006 |
package scredis.io
import java.util.concurrent.locks.ReentrantLock
import akka.actor._
import scredis.exceptions._
import scredis.protocol._
import scredis.util.UniqueNameGenerator
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.util.Try
/**
* This trait represents a blocking connecti... | scredis/scredis | src/main/scala/scredis/io/AkkaBlockingConnection.scala | Scala | apache-2.0 | 2,533 |
package io.github.yzernik.bitcoinscodec.structures
import io.github.yzernik.bitcoinscodec.CodecSuite
import scodec.bits.ByteVector
class InvVectSpec extends CodecSuite {
import InvVect._
"InvVect codec" should {
"roundtrip" in {
roundtrip(InvVect(ERROR, Hash(ByteVector.fill(32)(0x42))))
roundtri... | yzernik/bitcoin-scodec | src/test/scala/io/github/yzernik/bitcoinscodec/structures/InvVectSpec.scala | Scala | mit | 453 |
/**
* Copyright 2013 Israel Freitas ([email protected])
*
* 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... | ifreitas/brain | src/main/scala/brain/web/WebAppListener.scala | Scala | apache-2.0 | 1,823 |
package com.rouesnel.typedsql.examples
package coppersmith
import org.apache.hadoop.fs.Path
import com.twitter.scalding.{Config, Execution, TypedPipe}
import org.joda.time.DateTime
import commbank.coppersmith.api.{DataSource => _, _}
import scalding._
import Coppersmith._
import EavtText.{EavtEnc, eavtByDay}
import co... | laurencer/typedsql | examples/src/main/scala/com/rouesnel/typedsql/examples/CoppersmithExample.scala | Scala | apache-2.0 | 2,632 |
/**
* Author:
* Yujian Zhang <yujian{dot}zhang[at]gmail(dot)com>
* Description:
* Definition related to bitboard.
* License:
* GNU General Public License v2
* http://www.gnu.org/licenses/gpl-2.0.html
* Copyright (C) 2010-2012 Yujian Zhang
*/
package net.whily.unichess.engine
/// *******************... | whily/unichess | src/main/scala/net/whily/unichess/engine/BitBoard.scala | Scala | gpl-2.0 | 3,685 |
package com.twitter.finagle.netty4.pushsession
import com.twitter.finagle.{Stack, param}
import com.twitter.finagle.netty4.channel.RawNetty4ClientChannelInitializer
import com.twitter.finagle.netty4.ConnectionBuilder
import com.twitter.finagle.pushsession.{PushChannelHandle, PushSession, PushTransporter}
import com.tw... | twitter/finagle | finagle-netty4/src/main/scala/com/twitter/finagle/netty4/pushsession/Netty4PushTransporter.scala | Scala | apache-2.0 | 2,445 |
/*
* 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 ... | stanzhai/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala | Scala | apache-2.0 | 20,690 |
/*
* Copyright 2009 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 t... | foursquare/fsqio | src/jvm/io/fsq/twitter/ostrich/stats/Stats.scala | Scala | apache-2.0 | 2,206 |
package com.twitter.io
import java.io.{ByteArrayOutputStream, InputStream, OutputStream}
import scala.annotation.tailrec
object StreamIO {
/**
* Copy an InputStream to an OutputStream in chunks of the given
* buffer size (default = 1KB).
*/
@tailrec
final def copy(
inputStream: InputStream,
o... | travisbrown/util | util-core/src/main/scala/com/twitter/io/StreamIO.scala | Scala | apache-2.0 | 878 |
package com.github.wkennedy.detroitpast.model
import net.liftweb.mongodb.{JsonObject, JsonObjectMeta}
case class ErrorMessage(userMessage:String, developerMessage: String, code: Int, additionalInfo: Option[String]) extends JsonObject[ErrorMessage] with Serializable {
def meta = ErrorMessage
}
object ErrorMessage e... | wkennedy/DetroitPast | src/main/scala/com/github/wkennedy/detroitpast/model/ErrorMessage.scala | Scala | mit | 362 |
// Databricks notebook source exported at Sun, 28 Aug 2016 15:46:03 UTC
// MAGIC %md
// MAGIC
// MAGIC # [Scalable Data Science](http://www.math.canterbury.ac.nz/~r.sainudiin/courses/ScalableDataScience/)
// MAGIC
// MAGIC
// MAGIC ### prepared by [Raazesh Sainudiin](https://nz.linkedin.com/in/raazesh-sainudiin-4595... | raazesh-sainudiin/scalable-data-science | db/week1/01_introduction/003_scalaCrashCourse.scala | Scala | unlicense | 25,129 |
package com.github.dzhg.tedis.storage
/**
* @author dzhg 8/11/17
*/
case class TedisKeyInfo(name: String, ttl: Option[Long], createdAt: Long)
case class TedisEntry(keyInfo: TedisKeyInfo, value: TedisValue)
| dzhg/tedis | src/main/scala/com/github/dzhg/tedis/storage/TedisModels.scala | Scala | mit | 213 |
/*
*
* ____ __ ____________ ______
* / __/______ _/ /__ /_ __/ _/ //_/_ /
* _\\ \\/ __/ _ `/ / _ `// / _/ // ,< / /_
* /___/\\__/\\_,_/_/\\_,_//_/ /___/_/|_| /___/
*
* A PGF/TIKZ plot library for Scala.
*
*/
package scalatikz.pgf.plots.enums
import enumeratum._
import scala.collection.i... | vagmcs/ScalaTIKZ | src/main/scala/scalatikz/pgf/plots/enums/AxisScale.scala | Scala | lgpl-3.0 | 646 |
/*
* Copyright (c) 2016 JLCM
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distr... | beikern/quilltests | src/main/scala/de/beikern/quilltests/daos/Dao.scala | Scala | mit | 1,250 |
/*
* 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/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/CP998.scala | Scala | apache-2.0 | 1,525 |
/*
* 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 ... | javadba/p2p | src/main/scala/org/openchai/spark/util/AddLicense.scala | Scala | apache-2.0 | 2,137 |
package com.blinkbox.books.auth.server.data
import com.blinkbox.books.auth.server.sso.SsoUserId
import com.blinkbox.books.auth.server.{PasswordHasher, UserRegistration}
import com.blinkbox.books.slick.{TablesSupport, SlickTypes}
import com.blinkbox.books.time.{Clock, TimeSupport}
import scala.slick.driver.JdbcProfile... | blinkboxbooks/auth-service.scala | src/main/scala/com/blinkbox/books/auth/server/data/UserRepository.scala | Scala | mit | 4,042 |
package com.tribbloids.spookystuff.integration
import com.tribbloids.spookystuff.SpookyEnvFixture
import com.tribbloids.spookystuff.actions.{Trace, Wget}
import com.tribbloids.spookystuff.extractors.{FR, GenExtractor}
import com.tribbloids.spookystuff.rdd.FetchedDataset
import com.tribbloids.spookystuff.utils.CommonCo... | tribbloid/spookystuff | integration/src/test/scala/com/tribbloids/spookystuff/integration/SnapshotRunner.scala | Scala | apache-2.0 | 2,453 |
/*
* 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... | dotty-staging/scalatest | scalatest/src/main/scala/org/scalatest/enablers/KeyMapping.scala | Scala | apache-2.0 | 7,116 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package java.nio.charset
import java.nio.char... | scala-js/scala-js | javalib/src/main/scala/java/nio/charset/StandardCharsets.scala | Scala | apache-2.0 | 646 |
package object hephaestus
extends IntInstances
with ListInstances
with MonocleInstances
with CatsInstances
| to-ithaca/hephaestus | core/src/main/scala/hephaestus/package.scala | Scala | apache-2.0 | 123 |
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "play-reactive-mongo"
val appVersion = "0.0.6"
val appDependencies = Seq(
"reactive_mongo_plugin" %% "reactive_mongo_plugin" % "0.0.43"
)
val main = play.Project(appName, appVersion, a... | TPTeam/reactive_mongo_example | project/Build.scala | Scala | mit | 697 |
/*
* 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 ... | manishgupta88/carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestNonTransactionalCarbonTableJsonWriter.scala | Scala | apache-2.0 | 14,587 |
/*
* 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 ... | PredictionIO/PredictionIO | tests/pio_tests/engines/recommendation-engine/src/main/scala/Preparator.scala | Scala | apache-2.0 | 1,281 |
package nikhil.tcp
/**
* @author Nikhil
*/
package object client {
type Host = String
type Port = Int
type NumberOfClients = Int
}
| nikhilRP/akka_requests | src/main/scala/nikhil/tcp/client/package.scala | Scala | apache-2.0 | 140 |
/*
* 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 ... | saturday-shi/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/StateStoreConf.scala | Scala | apache-2.0 | 2,111 |
/*
* 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 ... | PangZhi/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/stream/table/SetOperatorsITCase.scala | Scala | apache-2.0 | 3,639 |
package main
import models.Question
import operations.network.analysis.Metrics
import operations.persistance.Neo4j
import operations.recommendations.Recommender
import operations.stack.exchange.DownloadingProcedures
object Main extends App {
/**
* Example function for showing tag similarity between Java, Scala... | QuietOne/StackExchangeAnalysis | src/main/scala/main/Main.scala | Scala | artistic-2.0 | 2,703 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package docs.scaladsl.services.headerfilters
package compose {
import com.lightbend.lagom.scaladsl.api.transport.HeaderFilter
import com.lightbend.lagom.scaladsl.api.transport.RequestHeader
import com.lightbend.lagom.scaladsl.api.transport.Respo... | lagom/lagom | docs/manual/scala/guide/services/code/HeaderFilters.scala | Scala | apache-2.0 | 1,678 |
/*
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
package org.maproulette.framework.model
import org.apache.commons.lang3.StringUtils
import org.joda.time.DateTime
import org.maproulette.data.{ChallengeType, ItemType}
import or... | mgcuthbert/maproulette2 | app/org/maproulette/framework/model/Challenge.scala | Scala | apache-2.0 | 11,433 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala
package math
im... | scala/scala | src/library/scala/math/BigDecimal.scala | Scala | apache-2.0 | 30,300 |
/*
* Copyright 2013 Stephan Rehfeld
*
* 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 ... | stephan-rehfeld/scaladelray | src/test/scala/test/scaladelray/optimization/OctreeSpec.scala | Scala | apache-2.0 | 3,586 |
package org.openurp.edu.eams.teach.election.model.constraint
import org.openurp.base.Semester
import org.openurp.edu.base.Student
@SerialVersionUID(-6627564288570998553L)
class StdCreditConstraint extends AbstractCreditConstraint {
var semester: Semester = _
var std: Student = _... | openurp/edu-eams-webapp | election/src/main/scala/org/openurp/edu/eams/teach/election/model/constraint/StdCreditConstraint.scala | Scala | gpl-3.0 | 358 |
package utils
import javax.inject.Inject
import com.mohiva.play.silhouette.api.SecuredErrorHandler
import controllers.routes
import play.api.http.DefaultHttpErrorHandler
import play.api.i18n.Messages
import play.api.mvc.Results._
import play.api.mvc.{ Result, RequestHeader }
import play.api.routing.Router
import play... | leannenorthrop/play-mantra-accumulations | app/utils/ErrorHandler.scala | Scala | apache-2.0 | 1,752 |
package im.mange.flyby
import im.mange.driveby.{BrowserCommand, CommandExecutor}
import im.mange.common.ConditionNotMetException
class RemoteExecutor(space: FlySpace, browserId: Long) extends CommandExecutor {
def execute(command: BrowserCommand): BrowserCommand = {
val toWrite = RemoteCommand(command, browserI... | alltonp/driveby | src/main/scala/im/mange/flyby/RemoteExecutor.scala | Scala | apache-2.0 | 800 |
package com.debasish.nlp.posTaggers
import edu.stanford.nlp.pipeline.DefaultPaths
import edu.stanford.nlp.tagger.maxent.MaxentTagger
/**
* Created by Debasish Kaushik on 5/21/16.
*/
private[posTaggers] class StanfordPOSTagger extends POSTagger {
private[this] val tagger = new MaxentTagger(DefaultPaths.DEFAULT... | DEK11/MoreNLP | src/main/scala/com/debasish/nlp/posTaggers/StanfordPOSTagger.scala | Scala | apache-2.0 | 554 |
package org.allenai.common
/** Various convenient utilities for Scala constructs. */
object ScalaUtils {
/** A common use case for groupBy. Takes in a sequence of pairs, groups them by the first
* element, and returns a map from the group identifier to a sequence of second elements
* of the matching pairs. ... | jkinkead/common | core/src/main/scala/org/allenai/common/ScalaUtils.scala | Scala | apache-2.0 | 529 |
package mesosphere.marathon.core.flow
import org.rogach.scallop.ScallopConf
trait ReviveOffersConfig extends ScallopConf {
//scalastyle:off magic.number
lazy val minReviveOffersInterval = opt[Long]("min_revive_offers_interval",
descr = "Do not ask for all offers (also already seen ones) more often than this ... | sepiroth887/marathon | src/main/scala/mesosphere/marathon/core/flow/ReviveOffersConfig.scala | Scala | apache-2.0 | 365 |
package io.github.steefh.amorphous
import scala.annotation.implicitNotFound
package object patch {
import shapeless._
import labelled._
import record._
import ops.record._
@implicitNotFound("Cannot patch a field of type ${Value} with a field of type ${ValuePatch}")
trait FieldPatcher[Value, ValuePatch] {... | SteefH/amorphous | src/main/scala/io/github/steefh/amorphous/patch.scala | Scala | mit | 5,875 |
package java.nio
object CharBuffer {
private final val HashSeed = -182887236 // "java.nio.CharBuffer".##
def allocate(capacity: Int): CharBuffer =
wrap(new Array[Char](capacity))
def wrap(array: Array[Char], offset: Int, length: Int): CharBuffer =
HeapCharBuffer.wrap(array, 0, array.length, offset, len... | cedricviaccoz/scala-native | javalib/src/main/scala/java/nio/CharBuffer.scala | Scala | bsd-3-clause | 4,379 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | CapeSepias/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/javalib/util/AbstractListTest.scala | Scala | bsd-3-clause | 2,436 |
object Solution {
def isPerfectSquare(n: Long) = {
// http://stackoverflow.com/questions/295579/fastest-way-to-determine-if-an-integers-square-root-is-an-integer
if (n <= 0) false else n & 0x3F match {
case 0x00 | 0x01 | 0x04 | 0x09 | 0x10 | 0x11
| 0x19 | 0x21 | 0x24 | 0x29 | 0x31 | 0x39 =>
... | advancedxy/hackerrank | project-euler/problem-61/CyclicalFigurateNumbers.scala | Scala | mit | 1,775 |
package com.twitter.finagle.exp.mysql.integration
import com.twitter.finagle.exp.Mysql
import com.twitter.finagle.exp.mysql._
import com.twitter.finagle.param
import com.twitter.finagle.tracing._
import com.twitter.util.Await
import com.twitter.util.Local
import org.junit.runner.RunWith
import org.scalatest.FunSuite
i... | Krasnyanskiy/finagle | finagle-mysql/src/test/scala/com/twitter/finagle/mysql/integration/MysqlBuilderTest.scala | Scala | apache-2.0 | 1,492 |
package stamina.testkit
import org.scalatest._
import events._
class EventRecordingReporter extends Reporter {
private var eventList: List[Event] = List()
def findResultEvent(testName: String): Option[Event] = {
eventList.find {
case evt: TestSucceeded if evt.testName == testName => true
case evt... | scalapenos/stamina | stamina-testkit/src/test/scala/stamina/testkit/EventRecordingReporter.scala | Scala | mit | 2,089 |
/*
* 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... | CodingCat/spark-eventhubs | core/src/test/scala/org/apache/spark/sql/streaming/eventhubs/EventHubsOffsetSuite.scala | Scala | apache-2.0 | 1,693 |
/*
* 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 | mllib/src/test/scala/org/apache/spark/mllib/linalg/BLASSuite.scala | Scala | apache-2.0 | 12,234 |
package japgolly.scalajs.react.test
import scala.scalajs.js
/**
* Allows composition and abstraction of `ReactTestUtils.Simulate` procedures.
*/
class Simulation(_run: (() => ReactOrDomNode) => Unit) {
def run(n: => ReactOrDomNode): Unit =
_run(() => n)
def andThen(f: Simulation) =
new Simulation(n =>... | matthughes/scalajs-react | test/src/main/scala/japgolly/scalajs/react/test/Simulation.scala | Scala | apache-2.0 | 8,626 |
package org.jetbrains.plugins.scala
package lang.psi.light
import com.intellij.openapi.project.Project
import com.intellij.psi._
import com.intellij.psi.impl.light.LightField
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScAnnotationsHolder
import org.jetbra... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/light/LightUtil.scala | Scala | apache-2.0 | 3,892 |
package com.gu.notificationschedule.notifications
import java.nio.charset.StandardCharsets
import java.time.Instant
import java.util.UUID
import com.amazonaws.services.cloudwatch.model.StandardUnit
import com.gu.notificationschedule.NotificationScheduleConfig
import com.gu.notificationschedule.cloudwatch.{CloudWatchM... | guardian/mobile-n10n | schedulelambda/src/test/scala/com/gu/notificationschedule/notifications/RequestNotificationImplSpec.scala | Scala | apache-2.0 | 4,905 |
package actors
import akka.actor.{ActorRef, Props}
import akka.agent.Agent
import markets.orders.Order
import markets.participants.LiquidityDemander
import markets.tickers.Tick
import markets.tradables.Tradable
import strategies.placement.PoissonOrderPlacementStrategy
import strategies.trading.ZIMarketOrderTradingStr... | ScalABM/models-library | farmer-patelli-zovko/src/main/scala-2.11/actors/ZILiquidityDemander.scala | Scala | apache-2.0 | 1,673 |
package io.github.shogowada.scalajs.reactjs.classes
import scala.scalajs.js
@js.native
class ReactClass extends js.Object
| a1russell/scalajs-reactjs | core/src/main/scala/io/github/shogowada/scalajs/reactjs/classes/ReactClass.scala | Scala | mit | 124 |
import sbt._
import Keys._
object B extends Build {
lazy val root = Project("root", file("."))
.configs( IntegrationTest )
.settings( Defaults.itSettings : _*)
}
| colder/scala-smtlib | project/Build.scala | Scala | mit | 206 |
package org.jetbrains.plugins.scala
package lang.refactoring.changeSignature
import com.intellij.psi.PsiElement
import com.intellij.refactoring.changeSignature.{ChangeInfo, JavaChangeInfo, OverriderUsageInfo}
import com.intellij.util.containers.MultiMap
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import o... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/refactoring/changeSignature/ConflictsUtil.scala | Scala | apache-2.0 | 3,224 |
import scala.quoted.*
object Foo {
inline def foo(x: Int): Int = ${ bar('{ 'x; x }) } // error
def bar(i: Expr[Int]): Expr[Int] = i
}
| lampepfl/dotty | tests/neg-macros/quote-pcp-in-arg.scala | Scala | apache-2.0 | 139 |
// This software is Copyright 2012, Mike (stew) O'Connor <[email protected]>
//
// This software is dual licensed under the GPL-3 and the Apache 2.0
// license. Feel free to use, modify, and redistribute this software
// under the terms of either license. Both licenses appear verbatim in
// the file named COPYING... | stew/scatur | src/main/scala/turing.scala | Scala | gpl-3.0 | 7,187 |
package spark.jobserver.stress
import akka.actor.{ActorSystem, Props}
import akka.pattern.ask
import akka.util.Timeout
import com.typesafe.config.ConfigFactory
import org.joda.time.DateTime
import scala.concurrent.Await
import spark.jobserver._
import spark.jobserver.io.JobFileDAO
/**
* A stress test for launching m... | nachiketa-shukla/spark-jobserver | job-server/test/spark.jobserver/stress/SingleContextJobStress.scala | Scala | apache-2.0 | 2,637 |
/*
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... | gardleopard/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/storm/Serialization.scala | Scala | apache-2.0 | 1,350 |
/*
* Copyright (C) 2011 Mathias Doenitz
*
* 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... | backchatio/http-parsers | src/main/scala/io/backchat/http/parser/AdditionalRules.scala | Scala | apache-2.0 | 1,221 |
package org.scaladebugger.tool.frontend.history
/**
* Represents the interface for storing and loading terminal history.
*/
trait HistoryManager {
/**
* Adds a new line to the current history and updates the persistent history.
*
* @param line The line to add
*/
def writeLine(line: String): Unit
/... | ensime/scala-debugger | scala-debugger-tool/src/main/scala/org/scaladebugger/tool/frontend/history/HistoryManager.scala | Scala | apache-2.0 | 1,343 |
package com.github.caiiiycuk.async4s.test
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
import com.github.caiiiycuk.async4s.dsl.Async4sDSL
import com.github.caiiiycuk.async4s.impl.Async4sTestClient
import com.github.caiiiycuk.async4s.request.RequestUrl
class GET extends FlatSpec with Shou... | caiiiycuk/async4s-http-client | src/test/scala/com/github/caiiiycuk/async4s/test/GET.scala | Scala | mit | 1,296 |
package rewriting.rules
import ir._
import ir.ast._
import lift.arithmetic._
import opencl.ir.pattern._
import rewriting.utils.Utils
object Rules {
import rewriting.utils.Utils.isTranspose
/* Rules required for 2D stencil rewrite *///TODO find appropriate names
/* Slide-promotion *///TODO not really because ... | lift-project/lift | src/main/rewriting/rules/Rules.scala | Scala | mit | 10,354 |
package org.jetbrains.plugins.scala.codeInspection.implicits
import com.intellij.codeInspection.ProblemsHolder
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.codeInsight.intention.types.ConvertImplicitBoundsToImplicitParameter._
import org.jetbrains.pl... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/codeInspection/implicits/DeprecatedViewBoundInspection.scala | Scala | apache-2.0 | 1,535 |
package com.hunorkovacs.koauth.domain.mapper
import com.hunorkovacs.koauth.domain.KoauthRequest
import scala.concurrent.{ExecutionContext, Future}
trait RequestMapper[RequestType] {
def map(source: RequestType): Future[KoauthRequest]
}
| kovacshuni/koauth | src/main/scala/com/hunorkovacs/koauth/domain/mapper/RequestMapper.scala | Scala | apache-2.0 | 241 |
package gdg.blaze.godaddy
import com.google.common.io.Resources
import com.google.common.net.HostAndPort
import gdg.blaze._
import gdg.feed.netty.FeedSpec
import gdg.feed.proto.gen.Feed.Envelope
import gdg.feed.proto.gen.Feed.ServiceHeader.Subscribe.Offsets
import gdg.feed.proto.gen.Feed.ServiceHeader.Subscribe.Starti... | micahrupersburg/blaze-of-glory | src/main/scala/gdg/blaze/godaddy/FeedInput.scala | Scala | apache-2.0 | 1,285 |
package scorex.transaction
import scorex.block.{Block, BlockProcessingModule}
trait TransactionModule[TransactionBlockData] extends BlockProcessingModule[TransactionBlockData] {
val blockStorage: BlockStorage
val utxStorage: UnconfirmedTransactionsStorage
def isValid(block: Block): Boolean
/**
* Check... | alexeykiselev/WavesScorex | scorex-basics/src/main/scala/scorex/transaction/TransactionModule.scala | Scala | cc0-1.0 | 1,151 |
// Hello, World
object HelloWorld extends App {
println("Hello, World! in file.")
}
| wnoguchi/my-workspace | 2014_summer/scala/src/main/scala/HelloWorld.scala | Scala | mit | 86 |
/*
* ResolutionParser.scala
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package at.logic.gapt.formats.simple
import at.logic.gapt.formats.InputParser
import at.logic.gapt.proofs.lk.base._
trait ResolutionParser extends InputParser {
def clauseList: Pa... | gisellemnr/gapt | src/main/scala/at/logic/gapt/formats/simple/ResolutionParser.scala | Scala | gpl-3.0 | 512 |
package com.scalableminds.webknossos.datastore.helpers
import com.scalableminds.util.geometry.{Vec3Int, Vec3Double}
import com.scalableminds.webknossos.datastore.SkeletonTracing.{Node, SkeletonTracing}
object SkeletonTracingDefaults extends ProtoGeometryImplicits {
private val dataSetName = ""
private val trees =... | scalableminds/webknossos | webknossos-datastore/app/com/scalableminds/webknossos/datastore/helpers/SkeletonElementDefaults.scala | Scala | agpl-3.0 | 1,518 |
package com.autodesk.tct.utilities
import java.util.{UUID, Date}
import org.joda.time.DateTime
import play.api.libs.json.Json._
import play.api.libs.json._
import scala.language.postfixOps
/**
* Json helper
*
* Converts a Map or String to Json
*/
object AsJson {
/**
* Converts a Map to Json
*
* @par... | adsk-cp-tct/challenger-backend | app/com/autodesk/tct/utilities/AsJson.scala | Scala | gpl-3.0 | 1,806 |
class C1 {
def f {}
}
class C2 extends C1 {
override def f {}
println(/* line: 6 */f)
println(super./* line: 2 */f)
} | ilinum/intellij-scala | testdata/resolve2/inheritance/super/single/ClashClass.scala | Scala | apache-2.0 | 127 |
package com.ml.algorithm
import com.ml._
import scala.util.Random
import scala.util.control.Breaks._
class Annealing(
trials: Int,
Tmax: Float)
extends Optimizer{
val rand = new Random()
def apply(p: Problem)(implicit ds: Diagnostic[p.SolutionType]): (p.SolutionType) = {
def bypass(d: Doub... | BrettAM/EvCompHW | src/main/scala/ml/algorithm/Annealing.scala | Scala | apache-2.0 | 952 |
/**
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package sbt.internal.util.codec
import _root_.sjsonnew.JsonFormat
trait AbstractEntryFormats { self: sjsonnew.BasicJsonProtocol with sbt.internal.util.codec.StringEventFormats with sbt.internal.ut... | sbt/sbt | internal/util-logging/src/main/contraband-scala/sbt/internal/util/codec/AbstractEntryFormats.scala | Scala | apache-2.0 | 688 |
/*
* Copyright 2015-2016 IBM Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | nwspeete-ibm/openwhisk | core/controller/src/main/scala/whisk/core/loadBalancer/InvokerHealth.scala | Scala | apache-2.0 | 5,411 |
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */
package example.shanested.foo
import example.shanested.{Prop, Sha256}
final case class HashRecord(my_hash: Sha256, prop: Prop) | julianpeeters/avrohugger | avrohugger-core/src/test/expected/standard/example/shanested/foo/HashRecord.scala | Scala | apache-2.0 | 192 |
import sbt._
object Dependencies {
lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.0.8"
object logger {
lazy val scalaLogging = "com.typesafe.scala-logging" %% "scala-logging" % "3.9.2"
lazy val logback = "ch.qos.logback" % "logback-classic" % "1.2.3"
}
}
| nil2013/LIlib | project/Dependencies.scala | Scala | mit | 285 |
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.