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 wandou.math.random
/**
* Strategy interface for seeding random number generators.
* @author Daniel Dyer
*/
trait SeedGenerator {
/**
* Generate a seed value for a random number generator.
* @param length The length of the seed to generate (in bytes).
* @return A byte array containing the seed dat... | wandoulabs/wandou-math | wandou-math/src/main/scala/wandou/math/random/SeedGenerator.scala | Scala | apache-2.0 | 2,178 |
package controllers.dht
sealed trait DHTPutError {
val description: String
}
object DHTPutNotInitialized extends DHTPutError {
val description: String = "DHTが初期化されていません"
}
object DHTPutUnknownError extends DHTPutError {
val description = "不明なエラーによりDHTにデータを挿入できませんでした。"
} | windymelt/p2p2ch | app/controllers/dht/DHTPutError.scala | Scala | bsd-3-clause | 351 |
/*
* Copyright 2015 Nicolas Rinaudo
*
* 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... | nrinaudo/tabulate | laws/jvm/src/main/scala/kantan/csv/laws/KnownFormatsReaderLaws.scala | Scala | mit | 1,530 |
package controllers
import java.io.File
import javax.inject.{Singleton, Inject}
import play.api.Play
import play.api.Play.current
import services.UUIDGenerator
import org.slf4j.{LoggerFactory, Logger}
import play.api.mvc._
/**
* Instead of declaring an object of Application as per the template project, we must decla... | ranraj/reactive-play-angular | app/controllers/Application.scala | Scala | apache-2.0 | 1,928 |
/*
* Copyright 2014 IBM Corp.
*
* 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... | bpburns/spark-kernel | kernel/src/main/scala/com/ibm/spark/kernel/protocol/v5/magic/MagicManager.scala | Scala | apache-2.0 | 2,834 |
package akka.persistence.couchbase
import java.util.concurrent.TimeUnit
import java.util.Date
import akka.actor.{ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider}
import akka.event.Logging
import com.couchbase.client.java._
import com.couchbase.client.java.document.json.JsonObject
import com.couchbase... | Product-Foundry/akka-persistence-couchbase | src/main/scala/akka/persistence/couchbase/CouchbaseExtension.scala | Scala | apache-2.0 | 6,442 |
package at.logic.gapt.proofs.lksk
import at.logic.gapt.expr._
import at.logic.gapt.proofs.lk.{ BinaryLKProof, CutRule, UnaryLKProof, LKToExpansionProof }
import at.logic.gapt.proofs.lk.base.LKProof
import at.logic.gapt.proofs.expansionTrees.{ merge => mergeTree, _ }
import at.logic.gapt.proofs.occurrences.FormulaOccur... | loewenheim/gapt | src/main/scala/at/logic/gapt/proofs/lksk/LKskToExpansionProof.scala | Scala | gpl-3.0 | 2,752 |
package fpgatidbits.streams
import Chisel._
import fpgatidbits.axi._
// takes in two streams (<element> and <repCnt>) and repeats each
// element in <element> <repCnt> times. example:
// <element> = A B C D E F
// <repCnt> = 2 1 0 3
// <out> = A A B D D D
object StreamRepeatElem {
def apply(inElem: DecoupledIO[UI... | maltanar/fpga-tidbits | src/main/scala/fpgatidbits/streams/StreamRepeatElem.scala | Scala | bsd-2-clause | 3,666 |
/*
* 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 ... | ron8hu/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala | Scala | apache-2.0 | 33,702 |
/**
* Copyright (C) 2011 Havoc Pennington
*
* Derived from mongo-java-driver,
*
* Copyright (C) 2008 10gen 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
*
* ... | havocp/beaucatcher | base/src/main/scala/org/beaucatcher/bson/ObjectId.scala | Scala | apache-2.0 | 5,299 |
/*
* Copyright (C) 2016 Christopher Batey and Dogan Narinc
*
* 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 appli... | mikefero/cpp-driver | gtests/src/integration/scassandra/server/server/src/test/scala/org/scassandra/server/e2e/query/TuplePriming.scala | Scala | apache-2.0 | 5,705 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | sryza/spark | core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala | Scala | apache-2.0 | 19,051 |
package gitbucket.core.controller
import gitbucket.core.api._
import gitbucket.core.issues.html
import gitbucket.core.model.Issue
import gitbucket.core.service.IssuesService._
import gitbucket.core.service._
import gitbucket.core.util.ControlUtil._
import gitbucket.core.util.Implicits._
import gitbucket.core.util._
im... | intermezzo-fr/gitbucket | src/main/scala/gitbucket/core/controller/IssuesController.scala | Scala | apache-2.0 | 20,641 |
package com.twitter.finagle.netty4
import com.twitter.io.Buf
import io.netty.buffer.{ByteBuf, Unpooled}
import io.netty.util.CharsetUtil
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
import java.nio.{ByteBuffer, ReadOnlyBufferException}
import java.util._
import org.junit.Assert._
import org.junit.runne... | spockz/finagle | finagle-netty4/src/test/scala/com/twitter/finagle/netty4/BufAsByteBufTest.scala | Scala | apache-2.0 | 48,733 |
import stainless.math.BitVectors._
object BitVectors2 {
def test1(n1: Int3, n2: Int3, n3: Int3) = {
require(n2 >= (0: Int3) && n2 <= n3 && n1 <= n3 - n2 && n1 + n2 == n3)
assert(n3 - n1 == n2)
}
def test2(n: Int10) = {
assert((n ^ n) == (0: Int10))
}
def test3(n: Int100) = {
assert((n & n... | epfl-lara/stainless | frontends/benchmarks/verification/valid/MicroTests/dotty/BitVectors2.scala | Scala | apache-2.0 | 1,340 |
/*
* 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... | SRGOM/scalatest | scalatest-test/src/test/scala/org/scalatest/tools/ScalaTestRunnerSuite.scala | Scala | apache-2.0 | 27,192 |
/*
* Copyright 2015 Foundational Development
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | rssvihla/datastax_work | spark_commons/commons/src/main/scala/pro/foundev/commons/benchmarking/Benchmark.scala | Scala | apache-2.0 | 748 |
/*
* 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 | mllib/src/test/scala/org/apache/spark/ml/feature/BucketedRandomProjectionLSHSuite.scala | Scala | apache-2.0 | 8,043 |
package bad.robot.radiate.ui
import java.beans.{PropertyChangeEvent, PropertyChangeListener}
class PropertyChangeListenerStub extends PropertyChangeListener {
private val results = new scala.collection.mutable.MutableList[String]
def propertyChange(event: PropertyChangeEvent) {
results += event.toString
}... | tobyweston/radiate | src/test/scala/bad/robot/radiate/ui/PropertyChangeListenerStub.scala | Scala | apache-2.0 | 418 |
import sbt._
import Keys._
import xerial.sbt.Sonatype.sonatypeSettings
object Publish {
lazy val settings = sonatypeSettings ++ Seq(
scmInfo := Some(
ScmInfo(url("https://github.com/pawelkaczor/schale"), "scm:git:git@github.com:pawelkaczor/schale.git</")
),
pomExtra :=
<developers>
<d... | pawelkaczor/schale | project/Publish.scala | Scala | bsd-2-clause | 495 |
/**
* Copyright (C) 2012 Inria, University Lille 1.
*
* This file is part of PowerAPI.
*
* PowerAPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your... | abourdon/powerapi-akka | formulae/formula-powerspy/src/main/scala/fr/inria/powerapi/formula/powerspy/PowerSpyFormula.scala | Scala | agpl-3.0 | 1,703 |
package com.github.diegopacheco.scalaplayground.tinylog
object TinyLogApp extends App {
import org.pmw.tinylog.Logger
Logger.info("Hello World!")
}
| diegopacheco/scala-playground | tinylog-fun/src/main/scala/com/github/diegopacheco/scalaplayground/tinylog/TinyLogApp.scala | Scala | unlicense | 155 |
package observatory
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import org.scalatest.prop.Checkers
@RunWith(classOf[JUnitRunner])
class ManipulationTest extends FunSuite with Checkers with Config {
lazy val locateTemperatures = Extraction.locateTemperatures(... | yurii-khomenko/fpScalaSpec | c5w1observatory/src/test/scala/observatory/ManipulationTest.scala | Scala | gpl-3.0 | 1,028 |
package mesosphere.util.state.zk
import java.util.UUID
import com.fasterxml.uuid.impl.UUIDUtil
import com.google.protobuf.{ ByteString, InvalidProtocolBufferException }
import com.twitter.util.{ Future => TWFuture }
import com.twitter.zk.{ ZNode, ZkClient }
import mesosphere.marathon.{ Protos, StoreCommandFailedExcep... | sledigabel/marathon | src/main/scala/mesosphere/util/state/zk/ZKStore.scala | Scala | apache-2.0 | 5,750 |
package com.tribbloids.spookystuff.utils
import java.util.concurrent.LinkedBlockingDeque
import scala.language.implicitConversions
case class CircularDeque[T](size: Int = 10) {
import scala.collection.JavaConverters._
lazy val delegate = new LinkedBlockingDeque[T](size)
def forceAddFirst(v: T): Unit = deleg... | tribbloid/spookystuff | mldsl/src/main/scala/com/tribbloids/spookystuff/utils/CircularDeque.scala | Scala | apache-2.0 | 1,023 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.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... | Wogan/monix | monix-execution/shared/src/main/scala/monix/execution/cancelables/SingleAssignCancelable.scala | Scala | apache-2.0 | 4,470 |
/*
* 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/webmvc | core/src/main/scala/org/beangle/webmvc/view/i18n/ActionTextResourceProvider.scala | Scala | lgpl-3.0 | 1,578 |
package scala.swing
import java.awt.{Adjustable => JAdjustable}
object Adjustable {
trait Wrapper extends Oriented.Wrapper with Adjustable {
def peer: JAdjustable with OrientedMixin
def unitIncrement = peer.getUnitIncrement
def unitIncrement_=(i: Int) = peer.setUnitIncrement(i)
def blockIncrement =... | benhutchison/scala-swing | src/main/scala/scala/swing/Adjustable.scala | Scala | bsd-3-clause | 1,372 |
/*
* Copyright 2016 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... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600e/v2/E26.scala | Scala | apache-2.0 | 862 |
/*
* 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 ... | witgo/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala | Scala | apache-2.0 | 60,845 |
package com.outr.stripe.card
import com.outr.stripe.TokenError
import scala.scalajs.js
@js.native
trait CardTokenInfo extends js.Object {
def id: String = js.native
def card: StripeCardResponse = js.native
def created: Long = js.native
def livemode: Boolean = js.native
def `type`: String = js.native
def ... | outr/scala-stripe | core/js/src/main/scala/com/outr/stripe/card/CardTokenInfo.scala | Scala | mit | 419 |
// /////////////////////////////////////////// //
// Fureteur - https://github.com/gip/fureteur //
// /////////////////////////////////////////// //
package fureteur.config
import scala.collection.mutable._
import com.rabbitmq.client._
import fureteur.data._
class Config(d:Data) {
val data= d
def apply(s:Stri... | gip/fureteur | src/main/scala/config.scala | Scala | mit | 1,360 |
package x7c1.linen.modern.init.inspector
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.support.v4.app.{DialogFragment, FragmentActivity}
import android.support.v7.app.AlertDialog
import android.widget.Button
import x7c1.linen.glue.res.layout.SourceSearchStart
import x... | x7c1/Linen | linen-modern/src/main/scala/x7c1/linen/modern/init/inspector/StartSearchDialog.scala | Scala | mit | 2,971 |
package org.littlewings.javaee7.cdi
import javax.inject.Inject
import org.apache.deltaspike.core.api.projectstage.ProjectStage
import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner
import org.junit.Test
import org.junit.runner.RunWith
import org.scalatest.Matchers
import org.scalatest.junit.JUnitSuite
@Ru... | kazuhira-r/javaee7-scala-examples | cdi-deltaspike-project-stage/src/test/scala/org/littlewings/javaee7/cdi/SimpleProjectStageSpec.scala | Scala | mit | 860 |
package com.blinkbox.books.test
import org.mockito.stubbing.Answer
import org.mockito.invocation.InvocationOnMock
import scala.language.implicitConversions
/**
* A convenient pair of wrappers that lets you pass in closures to Mockito's doAnswer/thenAnswer methods.
* See http://henningpetersen.com/post/10/using-mock... | blinkboxbooks/common-test.scala | src/main/scala/com/blinkbox/books/test/AnswerSugar.scala | Scala | mit | 871 |
import consumer.kafka.ReceiverLauncher
import org.apache.spark.streaming.{Seconds, StreamingContext}
import org.apache.spark.{SparkContext, SparkConf}
/**
* Created by akhld on 11/12/14.
*/
object LowLevelKafkaConsumer {
def main(arg: Array[String]): Unit = {
import org.apache.log4j.Logger
import org.ap... | jedisct1/kafka-spark-consumer | examples/scala/LowLevelKafkaConsumer.scala | Scala | apache-2.0 | 2,328 |
/*
* 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 ... | bravo-zhang/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/streaming/InternalOutputModesSuite.scala | Scala | apache-2.0 | 1,887 |
package collins.controllers.actions.asset
import scala.concurrent.Future
import play.api.data.Form
import play.api.data.Forms.of
import play.api.data.Forms.optional
import play.api.data.Forms.tuple
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import collins.controllers.Api
import collins.contro... | funzoneq/collins | app/collins/controllers/actions/asset/UpdateStatusAction.scala | Scala | apache-2.0 | 4,784 |
package frameless
package object functions extends Udf {
object aggregate extends AggregateFunctions
}
| bamine/frameless | dataset/src/main/scala/frameless/functions/package.scala | Scala | apache-2.0 | 106 |
package io.github.mandar2812.PlasmaML.dynamics.diffusion
import breeze.linalg.DenseVector
import io.github.mandar2812.dynaml.pipes._
import io.github.mandar2812.dynaml.utils.combine
/**
* <h3>Phase Space Density: Basis Expansions</h3>
* A basis function expansion (φ) of the plasma
* Phase Space Density (&f... | mandar2812/PlasmaML | mag-core/src/main/scala/io/github/mandar2812/PlasmaML/dynamics/diffusion/PSDBasis.scala | Scala | lgpl-2.1 | 6,276 |
/*
* Copyright (c) 2014. Regents of the University of California
*
* 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 require... | fnothaft/avocado | avocado-core/src/main/scala/edu/berkeley/cs/amplab/avocado/postprocessing/PostprocessingStage.scala | Scala | apache-2.0 | 2,465 |
package org.leialearns.logic.utilities
trait Bit {
def asInt: Int
def asBoolean: Boolean
}
case object ZERO extends Bit {
def asInt = 0
def asBoolean = false
}
case object ONE extends Bit {
def asInt = 1
def asBoolean = true
}
| jeroenvanmaanen/leia | prefixencoding/src/main/java/org/leialearns/logic/utilities/Bit.scala | Scala | lgpl-2.1 | 240 |
package uk.gov.gds.ier.transaction.overseas.parentName
import uk.gov.gds.ier.config.Config
import uk.gov.gds.ier.model.{OverseasParentName, Name, PreviousName}
import uk.gov.gds.ier.security.EncryptionService
import uk.gov.gds.ier.serialiser.JsonSerialiser
import uk.gov.gds.ier.test._
import uk.gov.gds.ier.assets.Remo... | michaeldfallen/ier-frontend | test/uk/gov/gds/ier/transaction/overseas/parentName/ParentNameStepTests.scala | Scala | mit | 1,395 |
package com.bryanjos.lovecouch
import scala.concurrent.duration._
import scala.concurrent.Await
import org.scalatest._
import play.api.libs.json.Json
import akka.actor.ActorSystem
class DocumentSpec extends FunSpec with BeforeAndAfterAll {
implicit val system = ActorSystem()
implicit val context = system.dispatch... | bryanjos/lovecouch | src/test/scala/com/bryanjos/lovecouch/DocumentSpec.scala | Scala | mit | 3,247 |
package scredis
import org.scalameter.api._
import akka.actor.ActorSystem
import scala.concurrent.{ Future, Await }
import scala.concurrent.duration._
/*
object ClientBenchmark extends PerformanceTest {
private var system: ActorSystem = _
private var client: Client = _
/* configuration */
lazy val exec... | rileyberton/scredis | src/test/scala/scredis/ClientBenchmark.scala | Scala | apache-2.0 | 2,743 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/ ... | S-Mach/s_mach.explain | explain_play_json/src/main/scala/s_mach/explain_play_json/impl/ExplainPlayJsonMacroBuilder.scala | Scala | mit | 2,221 |
/*
* 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.util
abstract private[util] clas... | scala-js/scala-js | javalib/src/main/scala/java/util/AbstractRandomAccessListIterator.scala | Scala | apache-2.0 | 1,348 |
package elevators.queue.sweep
import elevators._
import elevators.queue.RequestQueue
case class ScanQueue(position: Int, lowerBound: Int, upperBound: Int,
requests: List[Int], direction: SeekDirection) extends RequestQueue[Int] {
private lazy val compare = eligibleRequestFilter(position, direction)
privat... | wohanley/elevators | src/main/scala/elevators/queue/sweep/ScanQueue.scala | Scala | agpl-3.0 | 1,322 |
package filodb.memory.data
import debox.Buffer
import filodb.memory.BinaryRegion.NativePointer
/**
* An unboxed iterator over SortedIDMap elements which are native 64-bit Long pointers.
* When constructed, the iterator holds a shared lock over the backing collection, to protect
* the contents of the native pointe... | tuplejump/FiloDB | memory/src/main/scala/filodb.memory/data/ElementIterator.scala | Scala | apache-2.0 | 2,219 |
/*
* Copyright 2014, by Vladimir Kostyukov and Contributors.
*
* This file is a part of a Finch library that may be found at
*
* https://github.com/finagle/finch
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
* You may... | penland365/finch | core/src/main/scala/io/finch/request/ValidationRule.scala | Scala | apache-2.0 | 3,441 |
package org.openjdk.jmh.samples
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations.{Benchmark, BenchmarkMode, CompilerControl, Fork, Measurement, Mode, OutputTimeUnit, Param, Scope, Setup, State, Warmup}
import org.openjdk.jmh.infra.Blackhole
object JMHSample_34_SafeLooping {
/*
* JMHSampl... | bantonsson/sbt-jmh | src/sbt-test/sbt-jmh/run/src/main/scala/org/openjdk/jmh/samples/JMHSample_34_SafeLooping.scala | Scala | apache-2.0 | 1,874 |
package play.core.j
import play.api.mvc._
import play.templates._
/** Defines a magic helper for Play templates in a Java context. */
object PlayMagicForJava {
import scala.collection.JavaConverters._
/** Transforms a Play Java `Option` to a proper Scala `Option`. */
implicit def javaOptionToScala[T](x: play.... | noel-yap/setter-for-catan | play-2.1.1/framework/src/play-java/src/main/scala/play/core/TemplateMagicForJava.scala | Scala | apache-2.0 | 1,564 |
/*
* Copyright (C) 2015 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... | darroyocazorla/crossdata | core/src/test/scala/org/apache/spark/sql/crossdata/catalog/persistent/MySQLCatalogSpec.scala | Scala | apache-2.0 | 2,985 |
//Copyright 2014, Alex Khilko.
//This file is part of MoonGene which is released under MIT.
//See file LICENSE.TXT or go to www.alexkhilko.com for full license details.
package com.moongene.models.load
import play.api._
import scala.util.Random
case class PhoneDevice(vendor: String,
model: St... | InfiniteCode/MoonGene | src/gene/src/main/scala/com/moongene/models/load/PhoneDevice.scala | Scala | mit | 4,082 |
package reftree.util
object Reflection {
/** A utility for accessing private fields */
implicit class PrivateFields[A](val value: A) extends AnyVal {
def privateField[B](name: String) = {
val field = value.getClass.getDeclaredField(name)
field.setAccessible(true)
field.get(value).asInstanceOf... | stanch/reftree | core/jvm/src/main/scala/reftree/util/Reflection.scala | Scala | gpl-3.0 | 336 |
/*
* Copyright 2008-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | rozza/mongo-scala-driver | driver/src/main/scala/org/mongodb/scala/internal/FoldLeftObservable.scala | Scala | apache-2.0 | 2,103 |
package sample
import akka.actor._
import org.springframework.context.ApplicationContext
object SpringExtension {
/**
* The identifier used to access the SpringExtension.
*/
def apply() : SpringExtension= new SpringExtension
}
class SpringExtension extends AbstractExtensionId[SpringExtentionImpl] {
impor... | alanktwong/typesafe_activators | akka-scala-spring/app/sample/SpringExtension.scala | Scala | mit | 703 |
package algorithms
import types.Types._
import scala.util.Random
object TabuSearch {
type TabuAction = (Int, Int) // (i x(i))
def apply(inputs: ProblemData, random: Random) = {
val (n, m1, m2) = inputs
val memory = new LongMemory(n)
val reInitIterations = 8 * n
val maxReinitializations = 4
... | Truji92/MH-algoritmos-basados-en-trayectorias | src/main/scala/algorithms/TabuSearch.scala | Scala | mit | 4,188 |
package com.scalaAsm.x86
package Instructions
package General
// Description: Set Byte on Condition - not below or equal/above (CF=0 AND ZF=0)
// Category: general/datamov
trait SETA extends InstructionDefinition {
val mnemonic = "SETA"
}
object SETA extends OneOperand[SETA] with SETAImpl
trait SETAImpl extends S... | bdwashbu/scala-x86-inst | src/main/scala/com/scalaAsm/x86/Instructions/General/SETA.scala | Scala | apache-2.0 | 447 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.google.protobuf.struct
object StructProto extends _root_.scalapb.GeneratedFileObject {
lazy val dependencies: Seq[_root_.scalapb.GeneratedFileObject] = Seq.empty
lazy val messagesCompanion... | trueaccord/ScalaPB | scalapb-runtime/src/main/scalajvm/com/google/protobuf/struct/StructProto.scala | Scala | apache-2.0 | 2,607 |
/*
* 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.cmd
impor... | scala/scala | src/compiler/scala/tools/cmd/CommandLineParser.scala | Scala | apache-2.0 | 3,095 |
// Copyright 2014 Foursquare Labs Inc. All Rights Reserved.
package io.fsq.spindle.rogue
import io.fsq.field.Field
import io.fsq.rogue.{BSONType, Rogue}
import io.fsq.spindle.runtime.{Enum, EnumIntField, EnumStringField, MetaRecord, Record}
trait SpindleRogue {
// EnumIntField: Query (base, list, & set)
implicit... | foursquare/fsqio | src/jvm/io/fsq/spindle/rogue/SpindleRogue.scala | Scala | apache-2.0 | 4,484 |
package org.eoin.akkaneural
import java.util.{Random => JRandom}
import akka.actor.Props
import akka.testkit.{TestActorRef, TestKit}
import org.eoin._
import org.junit.{Ignore, Test}
import org.scalacheck.Gen
import org.scalatest.Matchers._
import org.scalatest.junit.JUnitSuite
import org.scalatest.prop.GeneratorDriv... | eoinparker/SimpleAkkaNeuralNetwork | src/test/scala/org/eoin/akkaneural/ProjectUnitTestSuite1.scala | Scala | mit | 2,772 |
package com.bot4s.telegram.api.declarative
/**
* Declarative interface.
*/
trait Declarative[F[_]]
extends Updates[F]
with Messages[F]
with ChannelPosts[F]
with Callbacks[F]
with InlineQueries[F]
with Payments[F]
| mukel/telegrambot4s | core/src/com/bot4s/telegram/api/declarative/Declarative.scala | Scala | apache-2.0 | 240 |
//Example from https://github.com/spray/spray/blob/master/examples/spray-can/simple-http-client/src/main/scala/spray/examples/ConnectionLevelApiDemo.scala
//2014-06-20 Christoph Knabe
package demo
import scala.concurrent.Future
import scala.concurrent.duration._
import akka.io.IO
import akka.util.Timeout
import akka.... | ChristophKnabe/sprayreactivedemo | src/main/scala/demo/ConnectionLevelApiDemo.scala | Scala | lgpl-3.0 | 3,081 |
/*
* 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 ... | zhangjunfang/eclipse-dir | spark/core/src/main/scala/org/apache/spark/ui/jobs/PoolTable.scala | Scala | bsd-2-clause | 2,446 |
package org.veripacks
case class ClassUsage(cls: ClassName, usedIn: ClassName, detail: ClassUsageDetail)
sealed trait ClassUsageDetail {
val sourceFileName: String
}
case class MethodSignatureUsageDetail(sourceFileName: String, methodName: String) extends ClassUsageDetail {
override def toString = s"$methodName ... | adamw/veripacks | verifier/src/main/scala/org/veripacks/ClassUsage.scala | Scala | apache-2.0 | 1,169 |
package mesosphere.marathon.state
import java.util.concurrent.atomic.AtomicInteger
import javax.validation.ConstraintViolationException
import akka.actor.ActorSystem
import akka.event.EventStream
import akka.testkit.TestKit
import mesosphere.marathon.io.storage.StorageProvider
import mesosphere.marathon.state.PathId.... | lelezi/marathon | src/test/scala/mesosphere/marathon/state/GroupManagerTest.scala | Scala | apache-2.0 | 6,911 |
package eu.radusw
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import api._
import eu.radusw.services._
import monix.eval.Task
import monix.execution.Scheduler
import monix.execution.schedulers.SchedulerService
class Components(config: AppConfig.Config) {
implicit val clientSystem: ActorSystem... | radusw/SantaEMail | src/main/scala/eu/radusw/Components.scala | Scala | apache-2.0 | 772 |
/*
* 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... | 122689305/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/utils/caffe/LayerConverter.scala | Scala | apache-2.0 | 8,213 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | jzmq/scalding | scalding-core/src/test/scala/com/twitter/scalding/filecache/DistributedCacheFileSpec.scala | Scala | apache-2.0 | 2,372 |
/*
Copyright 2017-2018 EconomicSL
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
... | EconomicSL/mechanisms | src/main/scala/org/economicsl/mechanisms/voting/package.scala | Scala | apache-2.0 | 619 |
// vim: expandtab shiftwidth=2 softtabstop=2
/*
* Copyright 2011 杨博 (Yang Bo)
*
* 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
*
... | Atry/zero-log | src/test/scala/com/dongxiguo/zeroLog/test/formatting/compileTimeConfiguration/privateAccess/typed/FinalValLoggerTest.scala | Scala | apache-2.0 | 2,690 |
package arena.foundation
/**
* @author Bhupendra Bhudia <bhupendra.bhudia@quedex.co>
* 18/11/2015 13:35
*/
object Direction extends Enum[Direction]
sealed trait Direction extends Direction.Value
case object TOP extends Direction
case object RIGHT extends Direction
case object BOTTOM extends Direction
case ... | quedexco/arena-scala | src/main/scala/arena/foundation/Direction.scala | Scala | apache-2.0 | 352 |
/*
* MIT License
*
* Copyright (c) 2016 Ramjet Anvil
*
* 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, mod... | RamjetAnvil/padrone | server/src/main/scala/com/ramjetanvil/padrone/util/scheduling/ActorRescheduler.scala | Scala | mit | 2,971 |
/**
* Created by Romain Reuillon on 04/11/16.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
... | ISCPIF/doors | server/src/main/scala/fr/iscpif/doors/server/DSL.scala | Scala | agpl-3.0 | 6,408 |
package rexstream.events
import rexstream.collections._
import scala.collection.mutable
/**
* Created by GregRos on 06/02/2016.
*/
trait AbsEvent[TParam] extends AutoCloseable {
final def +=(f: (TParam) => Unit): AutoCloseable = {
this.subscribe(f)
}
final def -=(f: (TParam) => Unit) = {
... | GregRos/Rexstream | ScalaFBL/src/rexstream/events/AbsEvent.scala | Scala | mit | 812 |
/*******************************************************************************
* Copyright (c) Nikolai Koudelia
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available... | nikoudel/easyfit | easyFit/src/test/scala/easyfit.test/VariableInitialization.scala | Scala | epl-1.0 | 1,834 |
/**
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package akka
import sbt._
import sbt.Keys._
import java.io.File
import sbtrelease.ReleasePlugin.autoImport.releasePublishArtifactsAction
import com.typesafe.sbt.pgp.PgpKeys
object Publish extends AutoPlugin {
val defaultPublishTo = settingK... | ktoso/akka-persistence-cassandra | project/Publish.scala | Scala | apache-2.0 | 2,330 |
/*
* Copyright (c) <2015-2016>, see CONTRIBUTORS
* 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... | amanjpro/languages-a-la-carte | primj/src/main/scala/phases/NamerFamily.scala | Scala | bsd-3-clause | 2,311 |
/*
* 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/ct600/v2/B30.scala | Scala | apache-2.0 | 968 |
package com.getjenny.starchat.entities.io
import com.getjenny.starchat.entities.persistents.QADocument
/**
* Created by Angelo Leto <angelo@getjenny.com> on 18/02/19.
*/
case class Conversation (
count: Long = 0,
docs: List[QADocument] = List.empty[QADocument]
... | GetJenny/starchat | src/main/scala/com/getjenny/starchat/entities/io/Conversations.scala | Scala | gpl-2.0 | 531 |
package com.lightbend
/**
* Copyright © 2016 Lightbend, 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 requir... | lightbend-training/course-management-tools | core/src/main/scala/com/lightbend/coursegentools/package.scala | Scala | apache-2.0 | 2,376 |
import Macros._
object Test {
/** Object with a docstring */
object Obj
/** Val with a docstring */
val x: Null = null
val y: Null = null // val without a docstring
def main(args: Array[String]): Unit = {
printComment(Obj)
printComment(x)
printComment(y)
}
}
| som-snytt/dotty | tests/pending/run/tasty-comments/quoted_2.scala | Scala | apache-2.0 | 290 |
package funsets
import scala.annotation.tailrec
/**
* 2. Purely Functional Sets.
*/
object FunSets {
/**
* We represent a set by its characteristic function, i.e.
* its `contains` predicate.
*/
type FunSet = Int => Boolean
/**
* Indicates whether a set contains a given element.
*/
def contai... | PiSurQuatre/fp-scala-public | funsets/src/main/scala/funsets/FunSets.scala | Scala | mit | 3,268 |
package sql.migration
import java.sql.SQLException
import akka.actor.ActorSystem
import akka.stream.Materializer
import akka.stream.scaladsl._
import com.google.protobuf.ByteString
import com.typesafe.scalalogging.Logger
import im.actor.server.db.DbExtension
import im.actor.server.model.{ SerializedUpdate, UpdateMapp... | EaglesoftZJ/actor-platform | actor-server/actor-core/src/main/scala/sql/migration/V20151108011300__FillUserSequence.scala | Scala | agpl-3.0 | 5,686 |
package models
import play.api.libs.json._
case class User(
appId: Int, // The client app identifier
username: String, // The user identifier, expecting a custom "name" claim in JWT (could use "sub" instead?)
group: Option[String] = None,
isActive: Boolean = false,
isAdmin: Boolean = false
)
o... | chuv-ssrc/bam-server-scala | app/models/User.scala | Scala | gpl-3.0 | 381 |
/*
* Copyright 2014 Treode, 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... | Treode/store | demos/movies/server/src/movies/SearchResult.scala | Scala | apache-2.0 | 1,797 |
// Databricks notebook source
// MAGIC %md
// MAGIC
// MAGIC # [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/)
// COMMAND ----------
// MAGIC %md
// MAGIC
// MAGIC # Introduction to Spark Streaming
// MAGIC
// MAGIC Spark Streaming is an extension of the core Spark API t... | lamastex/scalable-data-science | db/2/2/024_SparkStreamingIntro.scala | Scala | unlicense | 13,901 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | steveloughran/chill | chill-scala/src/main/scala/com/twitter/chill/ScalaKryoInstantiator.scala | Scala | apache-2.0 | 7,444 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO2
package com.google.protobuf.descriptor
import _root_.scalapb.internal.compat.JavaConverters._
/** @param ctype
* The ctype option instructs the C++ code generator to use a different
* representati... | dotty-staging/ScalaPB | scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FieldOptions.scala | Scala | apache-2.0 | 28,022 |
/*
* 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.collection
packa... | martijnhoekstra/scala | src/library/scala/collection/mutable/CollisionProofHashMap.scala | Scala | apache-2.0 | 30,330 |
package monocle.bench
import java.util.concurrent.TimeUnit
import monocle.Lens
import monocle.bench.BenchModel._
import monocle.bench.input.Nested0Input
import org.openjdk.jmh.annotations._
import cats.instances.option._
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@State(Scope.Ben... | julien-truffaut/Monocle | bench/src/main/scala/monocle/bench/MonocleLensBench.scala | Scala | mit | 2,080 |
/*
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2015
*/
package com.ibm.streamsx.topology.test.scala
import com.ibm.streamsx.topology.Topology
import com.ibm.streamsx.topology.TStream
import com.ibm.streamsx.topology.streams.StringStreams
import com.ibm.streamsx.topology.test.TestTopology
import or... | IBMStreams/streamsx.topology | test/scala/src/com/ibm/streamsx/topology/test/scala/ScalaWindowTest.scala | Scala | apache-2.0 | 1,345 |
/*
* Copyright 2014 JHC Systems Limited
*
* 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... | andrewjskatz/sqlest | src/test/scala/sqlest/ast/SelectSpec.scala | Scala | apache-2.0 | 2,269 |
/***********************************************************************
* Copyright (c) 2013-2022 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | locationtech/geomesa | geomesa-process/geomesa-process-vector/src/main/scala/org/locationtech/geomesa/process/analytic/UniqueProcess.scala | Scala | apache-2.0 | 11,675 |
package protocol.body
import java.nio.ByteBuffer
import com.github.romangrebennikov.columnize.protocol._
import com.github.romangrebennikov.columnize.protocol.Frame._
import com.github.romangrebennikov.columnize.protocol.Opcode._
import com.github.romangrebennikov.columnize.protocol.body._
import org.apache.commons.c... | shuttie/columnize | src/test/scala/protocol/body/SupportedBodySpec.scala | Scala | bsd-2-clause | 918 |
import sbt._
import Keys._
object Commons {
val appVersion = "2.1.0-SNAPSHOT"
val appOrganization = "space.spacelift"
val settings: Seq[Def.Setting[_]] = Seq(
version := appVersion,
organization := appOrganization,
scalaVersion := "2.12.1",
scalacOptions ++= Seq("-feature", "-language:postfixO... | Spacelift/akka-mq-proxies | project/commons.scala | Scala | mit | 1,467 |
/*
* 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/QueryEngine.scala | Scala | apache-2.0 | 1,013 |
/*
* Copyright 2009-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law o... | geggo98/json4s | tests/src/test/scala/org/json4s/XmlExamples.scala | Scala | apache-2.0 | 6,859 |
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.