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 |
|---|---|---|---|---|---|
/*
* 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.
*/
// GENERATED CODE: DO NOT EDIT... | scala/scala | src/library/scala/runtime/AbstractFunction11.scala | Scala | apache-2.0 | 549 |
package sgl.util
import java.util.concurrent.Executors
import java.io.{StringWriter, PrintWriter}
import scala.collection.mutable.Queue
trait ThreadPoolSchedulerProvider extends SchedulerProvider {
this: LoggingProvider =>
private implicit val Tag = Logger.Tag("threadpool-scheduler")
class ThreadPoolScheduler... | regb/scala-game-library | jvm-shared/src/main/scala/sgl/util/ThreadPoolSchedulerProvider.scala | Scala | mit | 3,783 |
/**
* Copyright 2015 Thomson Reuters
*
* 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... | hochgi/CM-Well | server/cmwell-rts/src/main/scala/cmwell/rts/Subscriber.scala | Scala | apache-2.0 | 11,124 |
/*
* 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 ... | icexelloss/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetPartitionDiscoverySuite.scala | Scala | apache-2.0 | 41,532 |
package breeze.linalg
package operators
import breeze.macros.expand
import java.util
import scala.math.BigInt
import breeze.math.{Semiring, Complex}
trait BitVectorOps {
@expand
@expand.valify
implicit def bv_bv_UpdateOp[@expand.args(OpAnd, OpOr, OpXor, OpSet) Op <: OpType]
(implicit @expand.sequence[Op]({... | wavelets/breeze | src/main/scala/breeze/linalg/operators/BitVectorOps.scala | Scala | apache-2.0 | 5,343 |
package sbt
import java.io.File
import Def.Classpath
import scala.annotation.implicitNotFound
import sbt.internal.util.Attributed
object Append {
@implicitNotFound(msg = "No implicit for Append.Value[${A}, ${B}] found,\\n so ${B} cannot be appended to ${A}")
sealed trait Value[A, B] {
def appendValue(a: A, b... | pocketberserker/sbt | main/settings/src/main/scala/sbt/Append.scala | Scala | bsd-3-clause | 2,785 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// Licence: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.util
import java.io._
import java.net.URI
import java.nio.charset.Charset
import org.apache.commons.vfs2.FileObject
import org.ensime.api._
import org.ensime.util.file._... | d6y/ensime-server | core/src/main/scala/org/ensime/util/FileUtil.scala | Scala | gpl-3.0 | 3,209 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | mahak/spark | mllib/src/main/scala/org/apache/spark/mllib/linalg/EigenValueDecomposition.scala | Scala | apache-2.0 | 6,457 |
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{universe => ru}
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
import internal._
// Note: If you're looking at this test and you don't know why, you may
// have accidentally changed the way type tags reify. If... | som-snytt/dotty | tests/disabled/macro/run/toolbox_typecheck_macrosdisabled2.scala | Scala | apache-2.0 | 1,222 |
package aiouniya.spark.util
import java.text._
import java.util.Date
import java.util.Calendar
import scala.collection.mutable
/**
* Created by zstorm on 2017/4/13.
*/
object DateUtil {
private val defaultSdf = "yyyy-MM-dd HH:mm:ss"
private val sdfMap = new mutable.HashMap[String, SimpleDateForm... | 7u/spark-learning | aiouniya.spark/src/main/scala/aiouniya/spark/util/DateUtil.scala | Scala | apache-2.0 | 2,456 |
/*
* 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 ... | WangTaoTheTonic/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionUtils.scala | Scala | apache-2.0 | 7,725 |
package com.arcusys.valamis.updaters.version310.certificate
import com.arcusys.valamis.persistence.common.DbNameUtils._
import com.arcusys.valamis.persistence.common.SlickProfile
import com.arcusys.valamis.updaters.common.model.PeriodTypes
import com.arcusys.valamis.updaters.common.model.PeriodTypes.PeriodType
trait ... | arcusys/Valamis | valamis-updaters/src/main/scala/com/arcusys/valamis/updaters/version310/certificate/CertificateGoalGroupTableComponent.scala | Scala | gpl-3.0 | 1,531 |
/*
* 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/amls-frontend | test/models/supervision/SupervisionStartSpec.scala | Scala | apache-2.0 | 7,281 |
package me.enkode.j8
import org.scalatest.{Matchers, FlatSpec}
class ScalaFunction2BooleanSupportTest extends FlatSpec with Matchers {
case class Fixture(scalaFunction2: (String, String) ⇒ Boolean) extends ScalaFunction2BooleanSupport[String, String]
object Compare extends Fixture((a, b) ⇒ a equalsIgnoreCase b)
... | kender/java8-converters | src/test/scala/me/enkode/j8/ScalaFunction2BooleanSupportTest.scala | Scala | mit | 526 |
package com.automatatutor.model
import net.liftweb.mapper._
import net.liftweb.common.Full
import net.liftweb.common.Empty
import net.liftweb.common.Box
class ProblemSet extends LongKeyedMapper[ProblemSet] with IdPK {
def getSingleton = ProblemSet
protected object posedProblem extends MappedLongForeignKey(this, Po... | AutomataTutor/automatatutor-frontend | src/main/scala/com/automatatutor/model/ProblemSet.scala | Scala | mit | 4,297 |
/*
* 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 ... | fhueske/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/join/JoinITCase.scala | Scala | apache-2.0 | 30,839 |
package org.jetbrains.plugins.scala.lang.completion.postfix.templates
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.lang.completion.postfix.templates.selector.{SelectorConditions, AncestorSelector}
import org.jetbrains.plugins.scala.lang.completion.postfix.templates.selector.SelectorType._
/**... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/completion/postfix/templates/ScalaOptionPostfixTemplate.scala | Scala | apache-2.0 | 621 |
////////////////////////////////////////////////////////////////////////////////
// //
// OpenSolid is a generic library for the representation and manipulation //
// of geometric objects such as points, curves, surfaces, and volumes. ... | ianmackenzie/opensolid-core | src/main/scala/org/opensolid/core/Translation3d.scala | Scala | mpl-2.0 | 1,672 |
package com.felixmilea.vorbit.actors
import java.util.Date
import akka.actor.ActorSelection
import com.felixmilea.vorbit.actors.ManagedActor.WorkCommand
import com.felixmilea.vorbit.actors.RedditDownloader._
import com.felixmilea.vorbit.reddit.mining.config.PostType
import com.felixmilea.vorbit.reddit.models.ModelPars... | felixmc/Felix-Milea-Ciobanu-Vorbit | code/com/felixmilea/vorbit/actors/RedditPostValidator.scala | Scala | mit | 4,426 |
package demo
package components
package reacttable
import chandu0101.macros.tojs.GhPagesMacros
import chandu0101.scalajs.react.components.ReactTable
import demo.util.{Person, SampleData}
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.html_<^._
object ReactTableCustomCell {
val code = GhPagesMac... | chandu0101/scalajs-react-components | demo/src/main/scala/demo/components/reacttable/ReactTableCustomCell.scala | Scala | apache-2.0 | 1,587 |
package cfc.shale.redis_client
import org.joda.time.Duration
sealed trait DurationInt
sealed trait DurationIntOkay extends DurationInt
case class TooLarge(duration: Duration) extends DurationInt
case class MillisDuration(millis: Int) extends DurationIntOkay
case class SecondsDuration(value: Int) extends DurationIntOk... | cardforcoin/shale-scala | redis-client/src/main/scala/cfc/shale/redis_client/DurationInt.scala | Scala | mit | 1,112 |
package dotty.tools.dotc
package sbt
import java.io.File
import java.util.{Arrays, EnumSet}
import dotty.tools.dotc.ast.Trees._
import dotty.tools.dotc.ast.tpd
import dotty.tools.dotc.core.Contexts._
import dotty.tools.dotc.core.Decorators._
import dotty.tools.dotc.core.Flags._
import dotty.tools.dotc.core.NameOps._
... | som-snytt/dotty | compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala | Scala | apache-2.0 | 17,649 |
/**
* 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 to us... | stuhood/specs | src/test/scala/org/specs/matcher/iterableMatchersSpec.scala | Scala | mit | 9,748 |
package org.pfcoperez.sparkmandelbrot.tools
import org.pfcoperez.geometry.Primitives2D.Pixel
import scala.util.Try
import java.io.File
object ImageIndex {
case class Section(position: Pixel, sector: Int)
}
class ImageIndex(directory: File) {
require(directory.exists && directory.isDirectory, s"${directory.getNa... | pfcoperez/mandelbrot_spark | mandelviewer/src/main/scala/org/pfcoperez/sparkmandelbrot/tools/ImageIndex.scala | Scala | gpl-3.0 | 1,676 |
/*
* 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 p
class Canonical
| scala/scala | test/scaladoc/resources/canonical.scala | Scala | apache-2.0 | 317 |
package japgolly.scalajs.react.extra
import japgolly.scalajs.react._
package object router {
type Router [P] = ReactComponentC.ConstProps[Unit, Resolution[P], OnUnmount.Backend, TopNode]
type RouterU[P] = ReactComponentU [Unit, Resolution[P], OnUnmount.Backend, TopNode]
type RouterM[P] = ReactCompone... | zlangbert/scalajs-react | extra/src/main/scala/japgolly/scalajs/react/extra/router/package.scala | Scala | apache-2.0 | 1,361 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.javadsl.persistence.protobuf
import akka.actor.ExtendedActorSystem
import akka.protobufv3.internal.ByteString
import akka.serialization.BaseSerializer
import akka.serialization.Serialization
import akka.serializati... | lagom/lagom | persistence/javadsl/src/main/scala/com/lightbend/lagom/internal/javadsl/persistence/protobuf/PersistenceMessageSerializer.scala | Scala | apache-2.0 | 6,340 |
/*
* Copyright 2015 Scopely
*
* 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... | scopely/affqis | src/main/scala/com/scopely/affqis/JawampaRouter.scala | Scala | apache-2.0 | 1,739 |
package org.jetbrains.plugins.scala
package codeInspection
package packageNameInspection
import com.intellij.codeInspection._
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiFile
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
import org.jetbr... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/codeInspection/packageNameInspection/ChainedPackageInspection.scala | Scala | apache-2.0 | 2,403 |
package controllers
import play.api._
import play.api.mvc._
import play.api.data._
import play.api.data.Forms._
import views._
import models._
import helpers._
import com.mongodb.casbah.Imports._
object SignUp extends Controller {
val signupForm = Form(
mapping(
"email" -> email,
"refcode" -> opt... | alexanderjarvis/viral | app/controllers/SignUp.scala | Scala | apache-2.0 | 1,444 |
package name.kghost.android.lyrics
import android.view.ViewGroup
import android.app.Activity
import android.widget.ImageView
import android.widget.ImageView.ScaleType
import name.kghost.android.lyrics.utils.With
object Utils {
def ImageView(activity: Activity, resource: Int): ImageView = With(new ImageView(activity... | kghost/android-lyrics | src/main/scala/name/kghost/android/lyrics/Utils.scala | Scala | gpl-2.0 | 719 |
package structures
import simulacrum.{ typeclass, op }
/**
* Type class that describes type constructors which can provide a `Semigroup[F[A]]` for any type `A`.
*/
@typeclass trait SemigroupK[F[_]] extends Any { self =>
@op("<+>")
def combine[A](x: F[A], y: => F[A]): F[A]
def toSemigroup[A]: Semigroup[F[A]]... | mpilquist/Structures | core/shared/src/main/scala/structures/SemigroupK.scala | Scala | bsd-3-clause | 409 |
package scredis.protocol.requests
import org.scalatest._
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import scredis.{Server, ClusterNode}
class RequestSpec extends WordSpec with GeneratorDrivenPropertyChecks with Inside
with GivenWhenThen
with BeforeAndAfterAll
with Matchers {
"bla" should {
... | 1and1/scredis | src/test/scala/scredis/protocol/requests/RequestSpec.scala | Scala | apache-2.0 | 1,721 |
/*start*/Some(1).fold(throw new RuntimeException(""))(_.toString)/*end*/
//String | ilinum/intellij-scala | testdata/typeInference/bugs5/SCL5736.scala | Scala | apache-2.0 | 81 |
package org.openurp.edu.eams.teach.program.major.web.action
NotFoundException
import org.beangle.commons.lang.Strings
import org.beangle.struts2.convention.route.Action
import com.ekingstar.eams.base.Department
import com.ekingstar.eams.teach.Course
import org.openurp.edu.teach.plan.CourseGroup
import org.openurp.edu... | openurp/edu-eams-webapp | plan/src/main/scala/org/openurp/edu/eams/teach/program/major/web/action/MajorPlanCourseAction.scala | Scala | gpl-3.0 | 5,915 |
object PathVariantDefns {
sealed trait AtomBase {
sealed trait Atom
case class Zero(value: String) extends Atom
}
trait Atom1 extends AtomBase {
case class One(value: String) extends Atom
}
trait Atom2 extends AtomBase {
case class Two(value: String) extends Atom
}
object Atoms01 extend... | som-snytt/dotty | tests/patmat/i3574.scala | Scala | apache-2.0 | 966 |
package fpinscala.testing
import fpinscala.laziness.Stream
import fpinscala.state._
import fpinscala.parallelism._
import fpinscala.parallelism.Par.Par
import Gen._
import Prop._
import java.util.concurrent.{Executors,ExecutorService}
/*
The library developed in this chapter goes through several iterations. This file... | boechat107/fpinscala | exercises/src/main/scala/fpinscala/testing/Gen.scala | Scala | mit | 4,405 |
package time
import org.joda.time.{DateTimeZone, DateTime}
object DateTimeUtils {
def now = DateTime.now(DateTimeZone.UTC)
}
| timothygordon32/reactive-todolist | app/time/DateTimeUtils.scala | Scala | mit | 129 |
/*
* 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 ... | pronix/spark | examples/src/main/scala/org/apache/spark/examples/mllib/LDAExample.scala | Scala | apache-2.0 | 11,415 |
/*
* 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 n... | guozhangwang/kafka | core/src/test/scala/unit/kafka/raft/RaftManagerTest.scala | Scala | apache-2.0 | 5,309 |
package net.gutefrage.filter
/** Credit: http://stevenskelton.ca/finagle-query-cache-with-guava/ */
import com.google.common.hash.Hashing
import org.apache.commons.codec.binary.Base64
class ThriftByteArray(requestOrResponse: Array[Byte]) {
def bytesToInt(bytes: Array[Byte]): Int = java.nio.ByteBuffer.wrap(bytes)... | gutefrage/the-finagle-docs | example/src/main/scala/net/gutefrage/filter/ThriftByteArray.scala | Scala | mit | 1,546 |
package com.rockymadden.stringmetric.filter
import com.rockymadden.stringmetric.StringFilter
/** Ensures only ASCII control characters matter. */
trait AsciiControlOnlyFilter extends StringFilter {
abstract override def filter(charArray: Array[Char]): Array[Char] =
super.filter(charArray.filter(c => (c <= 31 || c ... | cocoxu/multip | src/main/scala/com/rockymadden/stringmetric/filter/AsciiControlOnlyFilter.scala | Scala | gpl-3.0 | 425 |
/*
* Copyright 2015 PayPal
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... | keshin/squbs | squbs-pipeline/src/test/scala/org/squbs/pipeline/PipelineHandlerManagerSpec.scala | Scala | apache-2.0 | 3,082 |
/**
* Copyright 2016, 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 | deeplang/src/main/scala/io/deepsense/deeplang/doperations/spark/wrappers/estimators/CreateDecisionTreeRegression.scala | Scala | apache-2.0 | 1,556 |
package fr.acinq.eclair.wire.protocol
import fr.acinq.bitcoin.Crypto.PublicKey
import fr.acinq.eclair.crypto.Sphinx
import fr.acinq.eclair.wire.protocol.RouteBlindingEncryptedDataTlv._
import fr.acinq.eclair.{ShortChannelId, UInt64, randomKey}
import org.scalatest.funsuite.AnyFunSuiteLike
import scodec.bits.{ByteVecto... | ACINQ/eclair | eclair-core/src/test/scala/fr/acinq/eclair/wire/protocol/RouteBlindingSpec.scala | Scala | apache-2.0 | 7,565 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package base
package patterns
import com.intellij.lang.ASTNode
import com.intellij.psi._
import com.intellij.psi.scope.PsiScopeProcessor
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.extensions._
import org.jetbrain... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/base/patterns/ScReferencePatternImpl.scala | Scala | apache-2.0 | 4,188 |
/*
* Copyright 2016 Dennis Vriend
*
* 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... | gavares/akka-persistence-jdbc | src/test/scala/akka/persistence/jdbc/query/MultipleReadJournalTest.scala | Scala | apache-2.0 | 1,704 |
/*
* Copyright 2018 Analytics Zoo 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... | intel-analytics/analytics-zoo | zoo/src/main/scala/com/intel/analytics/zoo/pipeline/api/keras/layers/SparseEmbedding.scala | Scala | apache-2.0 | 4,600 |
package com.ecfront.ez.framework.core
import com.ecfront.ez.framework.core.logger.Logging
/**
* 系统启动类,使用此类直接启动EZ服务
*/
object EZStartup extends App with Logging {
EZManager.start()
}
| gudaoxuri/ez-framework | services/core/src/main/scala/com/ecfront/ez/framework/core/EZStartup.scala | Scala | apache-2.0 | 226 |
/*
* Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* 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/... | yuyupapa/OpenSource | scouter.server/src/scouter/server/management/RemoteControlManager.scala | Scala | apache-2.0 | 2,535 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | bmwjanos/rudder | rudder-web/src/main/scala/com/normation/rudder/web/snippet/BaseUrl.scala | Scala | gpl-3.0 | 2,480 |
package com.lookout.borderpatrol.test.sessionx
import java.util.concurrent.TimeUnit
import com.lookout.borderpatrol.sessionx._
import com.lookout.borderpatrol.test._
import com.twitter.util.{Time, Duration}
class SecretSpec extends BorderPatrolSuite {
import coreTestHelpers.secrets._
behavior of "Secret"
it ... | rikesh-chouhan/borderpatrol | core/src/test/scala/com/lookout/borderpatrol/test/sessionx/SecretSpec.scala | Scala | mit | 1,241 |
/*
Impromptu, version 1.0.0. Copyright 2018 Jon Pretty, Propensive Ltd.
The primary distribution site is: https://propensive.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
... | propensive/impromptu | src/core/actor.scala | Scala | apache-2.0 | 7,058 |
package lila.game
// events are kept in insertion/addition order
case class Progress(origin: Game, game: Game, events: List[Event] = Nil) {
def map(f: Game => Game) = copy(game = f(game))
def flatMap(f: Game => Progress) =
f(game) match {
case Progress(_, g2, e2) => copy(game = g2, events = events ::: ... | luanlv/lila | modules/game/src/main/Progress.scala | Scala | mit | 1,016 |
package is.hail.types.physical
import is.hail.annotations._
import is.hail.asm4s.Code
import is.hail.expr.ir.EmitCodeBuilder
import is.hail.types.physical.stypes.SValue
import is.hail.types.physical.stypes.primitives.{SBoolean, SBooleanValue}
import is.hail.types.virtual.TBoolean
import is.hail.utils.toRichBoolean
ca... | hail-is/hail | hail/src/main/scala/is/hail/types/physical/PBoolean.scala | Scala | mit | 1,644 |
/*
* 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/agents/integration/sophisticated/ProducerSubscriberMixedCheckpointCancelWorkloadTest.scala | Scala | apache-2.0 | 3,298 |
package model
import scala.slick.driver.MySQLDriver.simple._
import Database.threadLocalSession
import java.sql.Date
import scala.slick.direct._
import scala.slick.direct.AnnotationMapper._
import scala.reflect.runtime.universe
import scala.slick.jdbc.StaticQuery.interpolation
import org.joda.time.DateTime
import com.... | peq/peeeq.de | app/model/CodePaste.scala | Scala | apache-2.0 | 1,285 |
package is.hail.utils
import scala.reflect.ClassTag
object ArrayBuilder {
final val defaultInitialCapacity: Int = 16
}
final class ArrayBuilder[@specialized T](initialCapacity: Int)(implicit tct: ClassTag[T]) extends Serializable {
private[utils] var b: Array[T] = new Array[T](initialCapacity)
private[utils] v... | danking/hail | hail/src/main/scala/is/hail/utils/ArrayBuilder.scala | Scala | mit | 2,306 |
/*
Copyright (c) 2016, Rice University
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2.... | agrippa/spark-swat | swat/src/test/scala/org/apache/spark/rdd/cl/tests/Tuple2DenseInputTest.scala | Scala | bsd-3-clause | 3,456 |
package org.mbari.vars.arctic
import java.io.File
import java.text.SimpleDateFormat
import java.util.Date
import org.mbari.vars.arctic.SpecialShipLogReader1._
import org.slf4j.LoggerFactory
import scala.io.Source
/**
*
*
* @author Brian Schlining
* @since 2015-04-20T15:48:00
*/
object SpecialShipLogReader2 {
... | hohonuuli/vars | vars-standalone/src/main/scala/org/mbari/vars/arctic/SpecialShipLogReader2.scala | Scala | lgpl-2.1 | 1,125 |
package sigma.types
import scalan.{Internal, Nullable}
import special.collection.Coll
@Internal
private[types] trait PrimView[@specialized Val] {
private[types] def value: Val
}
trait Boolean extends PrimView[scala.Boolean] {
/** Convert true to 1 and false to 0
* @since 2.0
*/
def toByte: Byte
/** ... | ScorexFoundation/sigmastate-interpreter | sigma-api/src/main/scala/sigma/types/Types.scala | Scala | mit | 1,343 |
package pi
import akka.actor.{ ActorRef, Props, Actor }
import akka.routing.RoundRobinRouter
import akka.util.duration._
// Use master.prop in the code or Master()
// See http://doc.akka.io/docs/akka/snapshot/scala/actors.html#Recommended_Practices
object Master {
def props(nrOfWorkers: Int, nrOfElements: Int, nr... | Tjoene/thesis | Case_TestKit/src/main/scala/pi/Master.scala | Scala | gpl-2.0 | 1,524 |
//
// Copyright 2011-2012, Boundary
//
// 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 ... | boundary/ordasity | src/main/scala/com/boundary/ordasity/balancing/CountBalancingPolicy.scala | Scala | apache-2.0 | 3,630 |
package controllers
/**
* GraPHPizer source code analytics engine
* Copyright (C) 2015 Martin Helmich <kontakt@martin-helmich.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either... | martin-helmich/graphpizer-server | app/controllers/Model.scala | Scala | gpl-3.0 | 2,590 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | mllib/src/test/scala/org/apache/spark/mllib/feature/PCASuite.scala | Scala | apache-2.0 | 2,245 |
package com.identityblitz.saml.action
import com.identityblitz.saml.ws.transport.{PlayResponseAdapter, PlayRequestAdapter}
import play.api.mvc.Request
import edu.internet2.middleware.shibboleth.idp.session.Session
import org.opensaml.ws.transport.http.HTTPTransportUtils
import org.opensaml.xml.util.Base64
import org.j... | brainysmith/idp-play-bridge | src/main/scala/com/identityblitz/saml/action/SessionBridge.scala | Scala | mit | 4,105 |
package com.twitter.scalding.estimation
import cascading.flow.FlowStep
import cascading.tap.hadoop.Hfs
import cascading.tap.{CompositeTap, Tap}
import com.twitter.scalding.tap.GlobHfs
import org.apache.hadoop.mapred.JobConf
import org.slf4j.LoggerFactory
import scala.collection.JavaConverters._
object Common {
priv... | twitter/scalding | scalding-core/src/main/scala/com/twitter/scalding/estimation/Common.scala | Scala | apache-2.0 | 1,187 |
package wandou.indicator.function
import wandou.math.StatsFunctions
import wandou.math.timeseries.Null
import wandou.math.timeseries.TBaseSer
import wandou.math.timeseries.TVar
import wandou.math.indicator.Factor
/**
*
* @author Caoyuan Deng
*/
class MAFunction(_baseSer: TBaseSer, var baseVar: TVar[Double], var pe... | wandoulabs/wandou-math | wandou-indicator/src/main/scala/wandou/indicator/function/MAFunction.scala | Scala | apache-2.0 | 1,039 |
package org.deeplearning4j.ui.views.html.defaultPage
import play.twirl.api._
import play.twirl.api.TemplateMagic._
object DefaultPage_Scope0 {
import models._
import controllers._
import play.api.i18n._
import views.html._
import play.api.templates.PlayMagic._
import play.api.mvc._
import play.api.data._
clas... | xuzhongxing/deeplearning4j | deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/defaultPage/DefaultPage.template.scala | Scala | apache-2.0 | 9,763 |
/*
* Copyright 2014 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 l... | joychugh/storehaus | storehaus-hbase/src/test/scala/com/twitter/storehaus/hbase/HBaseStringStoreProperties.scala | Scala | apache-2.0 | 2,577 |
package com.twitter.finagle.util
import org.scalatest.FunSuite
class DrvTest extends FunSuite {
val N = 100000
test("Drv.newVose(weights)") {
val rng = Rng(87654321L)
val weights = Seq.range(1, 11) map (_.toDouble)
val drv = Drv.fromWeights(weights)
val histo = new Array[Int](10)
for (_ <- 0 ... | luciferous/finagle | finagle-core/src/test/scala/com/twitter/finagle/util/DrvTest.scala | Scala | apache-2.0 | 1,171 |
import com.typesafe.sbt.web.SbtWeb.autoImport._
import play.Play.autoImport._
import play.sbt.PlayImport._
import play.twirl.sbt.Import._
import PlayKeys._
import sbt._, Keys._
object ApplicationBuild extends Build {
import BuildSettings._
import Dependencies._
lazy val root = Project("lila", file(".")) enable... | systemovich/lila | project/Build.scala | Scala | mit | 10,498 |
/*
Copyright 2013 Ilya Lakhin (Илья Александрович Лахин)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | Eliah-Lakhin/papa-carlo | src/main/scala/name.lakhin.eliah.projects/papacarlo/lexis/Tokenizer.scala | Scala | apache-2.0 | 3,747 |
package model
trait PullRequestComponent extends TemplateComponent { self: Profile =>
import profile.simple._
lazy val PullRequests = TableQuery[PullRequests]
class PullRequests(tag: Tag) extends Table[PullRequest](tag, "PULL_REQUEST") with IssueTemplate {
val branch = column[String]("BRANCH")
val requ... | campolake/gitbucketV2.1 | src/main/scala/model/PullRequest.scala | Scala | apache-2.0 | 1,325 |
package com.twitter.finagle.exp.mysql.transport
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class BufferTest extends FunSuite {
val bytes = Array[Byte](0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x78)
test("read Byte") {
val br =... | sveinnfannar/finagle | finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/transport/BufferTest.scala | Scala | apache-2.0 | 4,386 |
package com.nidkil.downloader.queue
import org.scalatest.WordSpec
class GroupedQueueSpec extends WordSpec {
def fixtureEmpty =
new {
val gq = new GroupedQueue()
}
def fixtureOneGroup =
new {
val gq = new GroupedQueue()
gq.createQueue("group-1", 2)
gq.enqueue("group-1", null, ... | nidkil/akka-downloader | src/test/scala/com/nidkil/downloader/queue/GroupedQueueSpec.scala | Scala | apache-2.0 | 10,307 |
package org.broadinstitute.clio.sbt
import com.typesafe.sbt.SbtGit._
import sbt.Def.Initialize
import sbt.Keys._
import sbt._
/** Versioning information for builds of clio, based on the git hash. */
object Versioning {
/** Generate a version using the full git hash, or "UNKNOWN". */
lazy val gitShaVersion: Initi... | broadinstitute/clio | project/src/main/scala/org/broadinstitute/clio/sbt/Versioning.scala | Scala | bsd-3-clause | 1,008 |
// Copyright 2014 Commonwealth Bank of Australia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ap... | CommBank/maestro | maestro-scalding/src/main/scala/au/com/cba/omnia/maestro/task/ViewExecution.scala | Scala | apache-2.0 | 3,015 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala | Scala | apache-2.0 | 20,053 |
/*
* Copyright 2015 Alex Garella
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | agarella/RxKinesis | src/main/scala/com/alexgarella/RxKinesis/RxKinesisConsumer.scala | Scala | apache-2.0 | 3,252 |
/**
* Copyright (C) 2014 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | mt0803/streaming-cep-engine | api/src/main/scala/com/stratio/streaming/api/zookeeper/ZookeeperConsumer.scala | Scala | apache-2.0 | 1,800 |
/**
* (c) Copyright 2012 WibiData, Inc.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of... | alexandre-normand/kiji-schema-shell | src/test/scala/org/kiji/schema/shell/IntegrationTestKijiSystem.scala | Scala | apache-2.0 | 8,941 |
package slinky.native
import slinky.core.ExternalComponent
import slinky.core.annotations.react
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
@react object TouchableOpacity extends ExternalComponent {
case class Props(onPress: js.UndefOr[() => Unit], style: js.UndefOr[js.Object] = js.undefine... | shadaj/slinky | native/src/main/scala/slinky/native/TouchableOpacity.scala | Scala | mit | 462 |
package org.lodsb.scales
/*
+1>> This source code is licensed as GPLv3 if not stated otherwise.
>> NO responsibility taken for ANY harm, damage done
>> to you, your data, animals, etc.
>>
+2>>
>> Last modified: 2013-11-06 :: 00:22
>> Origin:
>>
+3>>
>> Copyright (c) 2013:
... | lodsb/scales | src/main/scala/Tuning.scala | Scala | gpl-3.0 | 878 |
package com.ubirch.avatar.core.device
import java.util.UUID
import com.typesafe.scalalogging.StrictLogging
import com.ubirch.avatar.config.Config
import com.ubirch.avatar.model.rest.device.DeviceDataRaw
import com.ubirch.util.elasticsearch.{EsBulkClient, EsSimpleClient}
import com.ubirch.util.json.{Json4sUtil, MyJson... | ubirch/ubirch-avatar-service | core/src/main/scala/com/ubirch/avatar/core/device/DeviceDataRawAnchoredManager.scala | Scala | apache-2.0 | 1,800 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/frontend-2.3/src/main/scala/org/neo4j/cypher/internal/frontend/v2_3/ast/ReturnItem.scala | Scala | apache-2.0 | 3,550 |
package org.senkbeil.debugger.akka.messages.structures
case class JDIClassLoader(
entryCount: Option[Int] = None,
isCollected: Option[Boolean] = None,
owningThread: Option[JDIThread] = None,
referenceType: Option[JDIReferenceType] = None,
uniqueId: ... | chipsenkbeil/scala-debugger-akka | src/main/scala/org/senkbeil/debugger/akka/messages/structures/JDIClassLoader.scala | Scala | apache-2.0 | 555 |
package com.rasterfoundry.database
import com.rasterfoundry.datamodel._
import com.rasterfoundry.common.Generators.Implicits._
import doobie._
import doobie.implicits._
import org.scalacheck.Prop.forAll
import org.scalatest._
import org.scalatestplus.scalacheck.Checkers
class AuthorizationSpec
extends FunSuite
... | azavea/raster-foundry | app-backend/db/src/test/scala/com/azavea/rf/database/AuthorizationSpec.scala | Scala | apache-2.0 | 15,904 |
package tutorials.basics
package step4
import tutorials.basics.step1.Article
import tutorials.basics.step3.Database
import scala.util.Try
object Repl extends App {
var exitFlag = false
val databases: Map[String, Database] = Map.empty
var currentDb: Option[Database] = None
println("Welcome to NewbieDB! Type ... | btmorr/scala-boost | src/main/scala/tutorials/basics/step4/Repl.scala | Scala | mit | 3,907 |
package uk.gov.dvla.vehicles.presentation.common.pages
import org.openqa.selenium.{WebElement, By, SearchContext}
import uk.gov.dvla.vehicles.presentation.common.helpers.webbrowser.Page
import uk.gov.dvla.vehicles.presentation.common.helpers.webbrowser.WebDriverFactory
class AlertWarningPage(implicit driver: SearchCo... | dvla/vehicles-presentation-common | common-test/test/uk/gov/dvla/vehicles/presentation/common/pages/AlertWarningPage.scala | Scala | mit | 790 |
package com.catinthedark.lib.animation
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.math.Vector2
/**
* Created by over on 15.03.15.
*/
class RotateAnimation(val tex: Texture, val pos: Vector2,
val interpolator: (Float, Float)... | cat-in-the-dark/old48_32_game | src/main/scala/com/catinthedark/lib/animation/RotateAnimation.scala | Scala | apache-2.0 | 828 |
package dao
import play.modules.reactivemongo.ReactiveMongoPlugin
import play.api.Play.current
trait Dao {
/** Returns the current instance of the driver. */
def driver = ReactiveMongoPlugin.driver
/** Returns the current MongoConnection instance (the connection pool manager). */
def connection = ReactiveMo... | benhalton/angular-play-mongo-starter | app/dao/Dao.scala | Scala | gpl-3.0 | 540 |
package com.thetestpeople.trt.service.indexing
import com.thetestpeople.trt.model.EnrichedExecution
import com.thetestpeople.trt.model.Id
import com.thetestpeople.trt.model.Execution
trait LogIndexer {
def addExecutions(executions: Seq[EnrichedExecution])
def searchExecutions(query: String, startingFrom: Int = ... | thetestpeople/trt | app/com/thetestpeople/trt/service/indexing/LogIndexer.scala | Scala | mit | 580 |
package org.bitcoins.core.serializers.p2p.messages
import org.bitcoins.core.gcs.FilterType
import org.bitcoins.core.number.UInt32
import org.bitcoins.core.p2p.GetCompactFilterHeadersMessage
import org.bitcoins.core.serializers.RawBitcoinSerializer
import org.bitcoins.crypto.DoubleSha256Digest
import scodec.bits.ByteVe... | bitcoin-s/bitcoin-s | core/src/main/scala/org/bitcoins/core/serializers/p2p/messages/RawGetCompactFilterHeadersMessageSerializer.scala | Scala | mit | 1,231 |
package scaspell
import org.scalatest._
import com.twitter.util.Duration
import java.util.concurrent.TimeUnit
import com.twitter.util.{Await,Future}
import com.twitter.finagle.Service
import com.twitter.util.Closable
import scaspell.util.FutureUtils._
import com.twitter.finagle.httpx.Http
import com.twitter.finagle.bu... | KimStebel/scalpel | src/test/scala/scaspell/api/ServerSpec.scala | Scala | apache-2.0 | 1,674 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
import java.util
import java.util.Collections
import java.util.concurrent.atomic.AtomicLong
import com.intellij.ProjectTopics
import com.intellij.openapi.components.ProjectComponent
import com.intellij.openapi.project.{DumbService, Project}
imp... | jeantil/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/ScalaPsiManager.scala | Scala | apache-2.0 | 16,958 |
package agilesites.web
import java.io.File
import sbt._
/**
* Created by msciab on 04/07/15.
*/
object AgileSitesWebKeys {
lazy val webStatics = settingKey[String]("Statics Extensions")
lazy val webStaticPrefix = settingKey[String]("Web Prefix for statics and fingerprinting")
lazy val webFolder = taskKey[Fil... | agilesites/agilesites2-build | src/main/scala/agilesites/web/AgileSitesWebKeys.scala | Scala | mit | 681 |
/**************************************************************************
*
* Copyright (c) 2019 Jorge Nunes
*
**************************************************************************/
package com.varmateo.jeedemos.swing.demo02
import javax.swing.JFrame
import javax.swing.JLabel
import javax.swing.JPanel
impo... | jorgefranconunes/jeedemos | swing/swing-scala-HelloWorld/demos/src/main/scala/com/varmateo/jeedemos/swing/demo02/Demo02App.scala | Scala | gpl-3.0 | 1,281 |
package kuaixue.scala.book.chapter5
import scala.beans.BeanProperty
/**
*
Scala对setter和getter的控制
如果字段是私有的,则getter和setter方法也是私有的
如果字段是val,则只有getter方法被生成
如果你不需要任何getter和setter,可以将字段声明为private[this]
*/
class BeanSeterGeterTest {
private val privVal:Int = 10
@BeanProperty
var num:Int = 10
@BeanPro... | slieer/scala-tutorials | src/main/scala/kuaixue/scala/book/chapter5/BeanSeterGeterTest.scala | Scala | apache-2.0 | 743 |
package org.wquery.lang.operations
import scalaz._
import Scalaz._
import org.wquery.model.{DataSet, WordNet}
import org.wquery.lang.Context
abstract class AlgebraOp extends ProvidesTypes with ProvidesTupleSizes with ReferencesVariables {
def evaluate(wordNet: WordNet, bindings: Bindings, context: Context): DataSet... | marekkubis/wquery | src/main/scala/org/wquery/lang/operations/AlgebraOp.scala | Scala | bsd-3-clause | 435 |
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.