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.github.tminglei.slickpg
import org.scalatest.FunSuite
import slick.jdbc.GetResult
import scala.concurrent.Await
import scala.concurrent.duration._
class PgJsonSupportSuite extends FunSuite {
import MyPostgresDriver.api._
val db = Database.forURL(url = dbUrl, driver = "org.postgresql.Driver")
cas... | bearrito/slick-pg | src/test/scala/com/github/tminglei/slickpg/PgJsonSupportSuite.scala | Scala | bsd-2-clause | 5,898 |
/*
* 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... | travisbrown/scalatest | src/main/scala/org/scalatest/words/StartWithWord.scala | Scala | apache-2.0 | 3,354 |
/**
* MIT License
*
* Copyright (c) 2016-2018 James Sherwood-Jones <[email protected]>
*
* 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, includi... | jSherz/lsd-members | backend/src/test/scala/com/jsherz/luskydive/dao/StubCourseDao.scala | Scala | mit | 3,783 |
package com.github.sparkfy.rpc
import com.github.sparkfy.{SparkfyException, Logging}
import com.github.sparkfy.util.RpcUtils
import scala.concurrent.Future
import scala.reflect.ClassTag
/**
* A reference for a remote [[RpcEndpoint]]. [[RpcEndpointRef]] is thread-safe.
*/
abstract class RpcEndpointRef(conf: Map[Str... | sparkfy/sparkfy | sparkfy-common/src/main/scala/com/github/sparkfy/rpc/RpcEndpointRef.scala | Scala | apache-2.0 | 3,774 |
package ui
import java.awt.event.{ActionEvent, ActionListener}
import javax.swing.{JComboBox, AbstractButton}
import scala.language.reflectiveCalls
/**
* Created by weijiayi on 2/29/16.
*/
object MySwing {
def addAction(jButton: AbstractButton, action: ()=>Unit): Unit ={
jButton.addActionListener(new Actio... | MrVPlussOne/Muse-CGH | src/ui/MySwing.scala | Scala | mit | 1,309 |
package com.marmoush.scalasamples.concepts
object Linearization {
trait Furry extends Animal
trait HasLegs extends Animal
trait FourLegged extends HasLegs
class Animal
class Cat extends Animal with Furry with FourLegged
// Animal, AnyRef, Any
// Furry, Animal, AnyRef, Any
// FourLegged, HasLegs, A... | IsmailMarmoush/scala-samples | scalalang/src/main/scala/com/marmoush/scalasamples/concepts/Linearization.scala | Scala | agpl-3.0 | 434 |
package ems.util
import java.net.{URLDecoder, URI, URLEncoder}
import scala.Option
case class URIBuilder(scheme: Option[String], host: Option[String], port: Option[Int], path: List[Segment], params: Map[String, Seq[String]], pathEndsWithSlash: Boolean = false) {
def withScheme(scheme: String) = copy(scheme = Some(s... | chrissearle/ems-redux | src/main/scala/ems/util/URIBuilder.scala | Scala | apache-2.0 | 3,487 |
/*
* 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 ... | WindCanDie/spark | sql/core/src/test/scala/org/apache/spark/sql/DatasetAggregatorSuite.scala | Scala | apache-2.0 | 17,010 |
/***********************************************************************
* 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-arrow/geomesa-arrow-tools/src/main/scala/org/locationtech/geomesa/arrow/tools/stats/ArrowStatsCountCommand.scala | Scala | apache-2.0 | 1,509 |
package io.iohk.ethereum.crypto
import akka.util.ByteString
import org.bouncycastle.crypto.BufferedBlockCipher
import org.bouncycastle.crypto.engines.AESEngine
import org.bouncycastle.crypto.modes.{CBCBlockCipher, SICBlockCipher}
import org.bouncycastle.crypto.paddings.{PKCS7Padding, PaddedBufferedBlockCipher}
import... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/crypto/SymmetricCipher.scala | Scala | mit | 1,598 |
package dotty.tools.scaladoc
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.util.{Success,Failure}
import org.scalajs.dom._
import org.scalajs.dom.ext._
import scala.scalajs.js.annotation.JSExportTopLevel
import org.scalajs.dom.ext.Ajax
import scala.scalajs.js
im... | lampepfl/dotty | scaladoc-js/main/src/versions-dropdown/DropdownHandler.scala | Scala | apache-2.0 | 3,216 |
package com.gwf.datalake.util
import java.io.StringWriter
import java.io.PrintWriter
object ScalaUtil {
def getStackTraceAsStr(t: Throwable): String = {
val sw = new StringWriter
t.printStackTrace(new PrintWriter(sw))
sw.toString()
}
}
| k-ayada/SparkETL | pub/ayada/scala/sparkUtils/cmn/ScalaUtil.scala | Scala | apache-2.0 | 254 |
package mesosphere.mesos
import mesosphere.marathon.Protos.Constraint
import mesosphere.marathon.Protos.Constraint.Operator
import mesosphere.marathon.state.DiskSource
import mesosphere.mesos.ResourceUtil.RichResource
import org.apache.mesos.Protos.Resource
object VolumeConstraints {
class VolumeConstraintsMatcher... | timcharper/marathon | src/main/scala/mesosphere/mesos/VolumeConstraints.scala | Scala | apache-2.0 | 1,261 |
/**
* 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... | WillCh/cs286A | dataMover/kafka/core/src/main/scala/kafka/api/OffsetCommitRequest.scala | Scala | bsd-2-clause | 7,345 |
package org.allenai.plugins.archetypes
import org.allenai.plugins.CoreSettingsPlugin
import org.allenai.plugins.CoreDependencies._
import org.allenai.plugins.DeployPlugin
import spray.revolver.RevolverPlugin.Revolver
import sbt._
import sbt.Keys._
object WebServicePlugin extends AutoPlugin {
override def requires... | non/sbt-plugins | src/main/scala/org/allenai/plugins/archetypes/WebServicePlugin.scala | Scala | apache-2.0 | 694 |
/*
* Copyright 2012-2014 Kieron Wilkinson.
*
* 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... | vyadh/viper | ui/src/main/scala/viper/ui/RecordTableFormat.scala | Scala | apache-2.0 | 1,486 |
package models
import play.api.libs.json._
case class Category(
id: Long,
name: String,
description: String,
lastUpdated: String)
/**
* Companion object for Category class.
*/
object Category {
implicit val categoryFormat = Json.format[Category]
}
| kelleyb/RPI-Tours-Backend | app/models/Category.scala | Scala | mit | 267 |
package com.recursivity.commons.bean
import collection.immutable._
import collection.{TraversableLike}
import collection.mutable.{DoubleLinkedList, LinkedList, Builder, MutableList}
import java.lang.reflect.{Field, Constructor, ParameterizedType}
import scalap.{Member, ClassSignature}
/**
* Utility class that is abl... | bowler-framework/recursivity-commons | src/main/scala/com/recursivity/commons/bean/BeanUtils.scala | Scala | bsd-3-clause | 8,497 |
/*
* 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 ... | ksimar/incubator-carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/detailquery/SubqueryWithFilterAndSortTestCase.scala | Scala | apache-2.0 | 3,401 |
/*
* 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 ... | sequenceiq/spark-native-yarn | src/main/scala/org/apache/spark/tez/TezBroadcast.scala | Scala | apache-2.0 | 2,455 |
package play.api.cache.redis.impl
import java.util.Optional
import scala.concurrent.duration.Duration
import play.api.cache.redis._
import play.cache.redis._
import org.specs2.concurrent.ExecutionEnv
import org.specs2.mutable.Specification
class AsyncJavaRedisSpec(implicit ee: ExecutionEnv) extends Specification w... | KarelCemus/play-redis | src/test/scala/play/api/cache/redis/impl/AsyncJavaRedisSpec.scala | Scala | mpl-2.0 | 14,771 |
package com.krux.hyperion.expression
case class ParameterFields(
id: String,
description: Option[String] = None
)(implicit val pv: ParameterValues)
| hoangelos/hyperion | core/src/main/scala/com/krux/hyperion/expression/ParameterFields.scala | Scala | apache-2.0 | 153 |
/**
* Copyright (C) 2014-2015 Really Inc. <http://really.io>
*/
package io.really.gorilla
import scala.collection.mutable.Map
import akka.actor._
import _root_.io.really.RequestContext
import _root_.io.really.rql.RQL.Query
import _root_.io.really.Result
import _root_.io.really.model.FieldKey
import _root_.io.really... | reallylabs/really | modules/really-core/src/main/scala/io/really/gorilla/SubscriptionManager.scala | Scala | apache-2.0 | 4,959 |
package zzb.srvdemo.test
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfter, BeforeAndAfterEach, WordSpec}
import org.scalatest.MustMatchers
import com.typesafe.config.ConfigFactory
import zzb.srvdemo.schema._
import zzb.srvdemo.entites._
import zzb.db.{DBPools, DBAccess}
import zzb.srvdemo.DBOperate
import spra... | stepover/zzb | examples/srvbox-demoService/src/test/scala/zzb/srvdemo/test/DBOperatorTest.scala | Scala | mit | 2,132 |
class IndexedText(val text: Vector[Int],
val indexToWord: Vector[String],
val wordToIndex: Map[String, Int],
val wordIndexToOccurrences: Vector[Vector[Int]]) {
def numWords = indexToWord.length
def uniqueWords = indexToWord
def wordIndex(word: String) = word... | Leksyk/ml | similar-words/src/main/scala/IndexedText.scala | Scala | gpl-2.0 | 2,543 |
package org.loudkicks.console
import org.loudkicks._
import org.loudkicks.service.{PostSubscriber, Walls}
class FollowCommandSpec extends UnitSpec {
"FollowCommand" when {
"parsing a valid command line" should {
var bobFollowing: Set[User] = Set.empty
val walls = new Walls with NoPostsShouldBeRe... | timothygordon32/loudkicks | src/test/scala/org/loudkicks/console/FollowCommandSpec.scala | Scala | apache-2.0 | 1,036 |
package breeze.linalg
/*
Copyright 2012 David Hall
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... | sheide/breeze | math/src/main/scala/breeze/linalg/SparseVector.scala | Scala | apache-2.0 | 13,836 |
package com.scalableQuality.quick.surface.commandLineOptions
import com.scalableQuality.quick.core.fileComponentDescriptions.OrderedRowDescription
import com.scalableQuality.quick.core.fileProcessingPhase.{
MatchRows,
RowsProcessingPhase,
CheckAndValidateAndMatchRows
}
import com.scalableQuality.quick.mantle.par... | MouslihAbdelhakim/Quick | src/main/scala/com/scalableQuality/quick/surface/commandLineOptions/QuickState.scala | Scala | apache-2.0 | 1,708 |
package com.bitmotif.part_1
object Exercise_2_1 {
def fib(n: Int): Int = {
@annotation.tailrec
def loop(end: Int, loopCount: Int, fibN_Minus1: Int, fibN_Minus2: Int): Int =
if (end == loopCount) fibN_Minus1 + fibN_Minus2 else loop(end, loopCount + 1, fibN_Minus1 + fibN_Minus2, fibN_Minus1)
... | pjberry/functional-programming-in-scala | src/com/bitmotif/part_1/Exercise_2_1.scala | Scala | mit | 529 |
package com.benkolera.Rt.Parser
import scalaz._
import syntax.applicative._
object NewTicket {
val ticketIdRe = """# Ticket (\\d+) created.""".r
def parseId( responseStr: String ):Parser[Int] = {
parseResponse( responseStr ).flatMap( lines =>
lines match {
case ticketIdRe(id)::xs => id.toInt.p... | benkolera/scala-rt | src/main/scala/Rt/Parser/NewTicket.scala | Scala | mit | 428 |
/**
* 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"); yo... | sebadiaz/kafka | core/src/test/scala/unit/kafka/server/MetadataCacheTest.scala | Scala | apache-2.0 | 14,231 |
package com.nextgendata.framework.maps
/**
* Created by Craig on 2016-04-26.
*
* This is the generic trait (or interface) for all ref & map lookup objects. To make the Mapper
* objects more natural and flexible it extends the built-in Scala immutable Map interface and
* adds additional functions required to... | craigjar/nextgendata | src/main/scala/com/nextgendata/framework/maps/Mapper.scala | Scala | apache-2.0 | 1,560 |
/*
* 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 ... | vinodkc/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/BasicConnectionProvider.scala | Scala | apache-2.0 | 2,332 |
/*
* Copyright 2016 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/kantan.regex | java8/src/test/scala/kantan/regex/java8/InstantDecoderTests.scala | Scala | apache-2.0 | 1,255 |
package com.sksamuel.scapegoat.inspections.collections
import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}
class UnsafeTraversableMethods
extends Inspection(
text = "Use of unsafe Traversable methods.",
defaultLevel = Levels.Error,
description = "Checks for use of un... | sksamuel/scalac-scapegoat-plugin | src/main/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeTraversableMethods.scala | Scala | apache-2.0 | 1,279 |
/*
* 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 ... | pgandhi999/spark | core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedClusterMessage.scala | Scala | apache-2.0 | 5,283 |
package main
class Region(
val id: Int,
val superRegion: SuperRegion,
playerNameInit: String,
armiesInit: Int
) {
def this(id: Int, superRegion: SuperRegion) = {
this(id, superRegion, "", 0)
}
private var myNeighbors = Set.empty[Region]
var playerName: String = ""
var armies: Int = 0
def ad... | ramn/warlight-starterbot-scala | src/main/scala/main/Region.scala | Scala | apache-2.0 | 505 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/main/scala/org/apache/spark/rdd/CoalescedRDD.scala | Scala | apache-2.0 | 15,001 |
/*
* Copyright 2014–2020 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | slamdata/quasar | api/src/main/scala/quasar/api/Label.scala | Scala | apache-2.0 | 1,256 |
package net.liftmodules.staticsitemap
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.FunSpec
import net.liftweb.sitemap.Loc.LocParam
import net.liftweb.common.Full
import net.liftweb.sitemap.NormalLocPath
import path._
import path.PathBuilder._
// TODO: Test url param escaping
class TestSubRoutes ... | jeffmay/lift-staticsitemap | src/test/scala/net/liftmodules/staticsitemap/TestSubRoutes.scala | Scala | apache-2.0 | 8,283 |
package chess
package opening
final class FullOpening(
val eco: String,
val name: String,
val fen: String
) {
def ecoName = s"$eco $name"
override def toString = ecoName
def atPly(ply: Int) = FullOpening.AtPly(this, ply)
}
object FullOpening {
case class AtPly(opening: FullOpening, ply: Int)
}... | niklasf/scalachess | src/main/scala/opening/FullOpening.scala | Scala | mit | 321 |
/**
* 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... | kavink92/kafka-0.8.0-beta1-src | core/src/main/scala/kafka/log/LogSegment.scala | Scala | apache-2.0 | 6,623 |
import collection.mutable._
object Euler32 {
var answers = Set[Int]()
def main(args: Array[String]) {
for {
i1 <- 0 to 8
i2 <- 0 to 7
i3 <- 0 to 6
i4 <- 0 to 5
i5 <- 0 to 4
i6 <- 0 to 3
i7 <- 0 to 2
i8 <- 0 to 1
i9 <- 0 to 0
} {
val avail = ListBuffer[Int](1, 2, 3, 4, 5, 6, 7, 8, ... | pdbartlett/misc-stuff | euler/scala/Euler32.scala | Scala | apache-2.0 | 1,937 |
package sttp.client3.impl.zio
import sttp.ws.{WebSocket, WebSocketClosed, WebSocketFrame}
import zio.stream.{Stream, ZStream}
import zio.{Ref, ZIO}
object ZioWebSockets {
def compilePipe[R](
ws: WebSocket[ZIO[R, Throwable, *]],
pipe: ZStream[R, Throwable, WebSocketFrame.Data[_]] => ZStream[R, Throwable,... | softwaremill/sttp | effects/zio/src/main/scala/sttp/client3/impl/zio/ZioWebSockets.scala | Scala | apache-2.0 | 1,882 |
/*
* 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 ... | esi-mineset/spark | core/src/main/scala/org/apache/spark/scheduler/MapStatus.scala | Scala | apache-2.0 | 8,390 |
/*
* Copyright (C) 2016-2020 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.persistence.cassandra.query
import java.nio.ByteBuffer
import java.time.{ LocalDateTime, ZoneOffset }
import java.util.UUID
import akka.actor.ActorSystem
import akka.persistence.PersistentRepr
import akka.persistence.cassandra.... | chbatey/akka-persistence-cassandra | core/src/test/scala/akka/persistence/cassandra/query/TestTagWriter.scala | Scala | apache-2.0 | 3,526 |
/*
* Copyright (c) 2012 Roberto Tyley
*
* This file is part of 'BFG Repo-Cleaner' - a tool for removing large
* or troublesome blobs from Git repositories.
*
* BFG Repo-Cleaner is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Fr... | rbramwell/bfg-repo-cleaner | bfg-library/src/test/scala/com/madgag/git/bfg/TreeEntrySpec.scala | Scala | gpl-3.0 | 1,319 |
/*
* Copyright 2010 Red Hat, Inc.
*
* Red Hat licenses this file to you 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... | janstey/fuse | fmc/fmc-rest/src/main/scala/org/fusesource/fabric/webui/util/Support.scala | Scala | apache-2.0 | 3,811 |
package net.rrm.ehour.persistence.mail.dao
import net.rrm.ehour.domain.MailLog
import net.rrm.ehour.persistence.dao.{AbstractGenericDaoHibernateImpl, GenericDao}
import org.springframework.stereotype.Repository
trait MailLogDao extends GenericDao[Integer, MailLog] {
def find(event: String): List[MailLog]
def find... | momogentoo/ehour | eHour-persistence/src/main/scala/net/rrm/ehour/persistence/mail/dao/MailLogDao.scala | Scala | gpl-2.0 | 835 |
package model
import skinny.DBSettings
import skinny.test._
import org.scalatest.fixture.FlatSpec
import org.scalatest._
import scalikejdbc._
import scalikejdbc.scalatest._
import org.joda.time._
class SchoolContentSpec extends FlatSpec with Matchers with DBSettings with AutoRollback {
}
| yoshitakes/skinny-task-example | src/test/scala/model/SchoolContentSpec.scala | Scala | mit | 291 |
package pl.touk.nussknacker.engine.util.config
import java.io.File
import java.net.URI
trait URIExtensions {
implicit class ExtendedURI(uri: URI) {
def withFileSchemeDefault: URI = if (uri.isAbsolute) uri else new File(uri.getSchemeSpecificPart).toURI
def withTrailingSlash: URI = if (uri.getPath.endsWith("/... | TouK/nussknacker | utils/utils/src/main/scala/pl/touk/nussknacker/engine/util/config/URIExtensions.scala | Scala | apache-2.0 | 369 |
import com.ketalo.EmberJsKeys
import sbt._
object ApplicationBuild extends Build with EmberJsKeys {
val appName = "play-emberjs-sample"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq.empty
val main = play.Project(appName, appVersion, appDependencies).settings(
emberJsVersion := "... | ACenterAInc/play-emberjs | samples-pre-1.0/sample-1.0.0-rc.4/project/Build.scala | Scala | mit | 339 |
/**
* CPSTextInterpreter - parses and interprets the CPSText DSL.
* Copyright (C) 2011 Max Leuthaeuser
*
* 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 version 3 of the Licen... | max-leuthaeuser/CPSTextInterpreter | src/main/scala/de/qualitune/transformator/RoleTransformator.scala | Scala | gpl-3.0 | 2,492 |
package scarla.domain
import scala.collection.immutable.Vector
object State {
final case class Transition(s: State, aid: Int, r: Double, ns: State)
}
case class State(val values: Vector[Double],
val availableActions: Vector[Int],
val isTerminal: Boolean = false) extends Serializab... | tspooner/scaRLa | src/main/scala/scarla/domain/State.scala | Scala | mit | 323 |
package lean1
/**
* Created by oot on 2014/11/18.
* 重载方法
*/
class EvenMoreScientficCalculator(brand:String) extends Calculator(brand){
//def log(m:Int): Double = log(m,math.exp(1))
}
| HYToop/Scala | Base1/src/lean1/EvenMoreScientficCalculator.scala | Scala | unlicense | 197 |
/*
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.iteratee
import org.specs2.mutable._
import java.io.{ ByteArrayInputStream, File, FileOutputStream, OutputStream }
import java.util.concurrent.{ CountDownLatch, TimeUnit }
import java.util.concurrent.atomic.AtomicInteger
im... | jyotikamboj/container | pf-framework/src/iteratees/src/test/scala/play/api/libs/iteratee/EnumeratorsSpec.scala | Scala | mit | 13,972 |
// #Sireum
/*
MIT License
Copyright (c) 2020 brainhub
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, merg... | sireum/v3-logika-runtime | library/shared/src/main/scala/org/sireum/crypto/SHA3.scala | Scala | bsd-2-clause | 7,217 |
package pl.newicom.dddd.test.dummy
import akka.actor.{ActorPath, Props}
import pl.newicom.dddd.actor.PassivationConfig
import pl.newicom.dddd.aggregate._
import pl.newicom.dddd.messaging.correlation.EntityIdResolution
import pl.newicom.dddd.messaging.event.EventMessage
import pl.newicom.dddd.process.{Saga, SagaActorFa... | ahjohannessen/akka-ddd | akka-ddd-test/src/test/scala/pl/newicom/dddd/test/dummy/DummySaga.scala | Scala | mit | 2,410 |
package org.cmt
object Common {
val aCommonValue: Int = 123
}
| lightbend-training/course-management-tools | course-templates/scala3-cmt-template-common/common/src/main/scala/org/cmt/Common.scala | Scala | apache-2.0 | 64 |
/*
* Copyright 2011-2018 GatlingCorp (http://gatling.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 applic... | wiacekm/gatling | gatling-core/src/main/scala/io/gatling/core/akka/BaseActor.scala | Scala | apache-2.0 | 1,477 |
package controllers.backend
import play.api.libs.json.Json
import com.overviewdocs.models.StoreObject
import com.overviewdocs.models.tables.{StoreObjects,DocumentStoreObjects}
class DbStoreObjectBackendSpec extends DbBackendSpecification {
trait BaseScope extends DbBackendScope {
import database.api._
val... | overview/overview-server | web/test/controllers/backend/DbStoreObjectBackendSpec.scala | Scala | agpl-3.0 | 11,794 |
package monocle.generic
import language.higherKinds
import monocle.PTraversal
import monocle.function.Each
import monocle.{ Iso, Traversal }
import monocle.generic.internal.TupleGeneric
import cats.Applicative
import cats.syntax.cartesian._
import shapeless.{ ::, Generic, HList, HNil }
object product extends ProductO... | fkz/Monocle | generic/shared/src/main/scala/monocle/generic/Product.scala | Scala | mit | 1,292 |
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "Taurus"
val appVersion = "2.0-SNAPSHOT"
val appDependencies = Seq(
"postgresql" % "postgresql" % "9.1-901-1.jdbc4",
"com.typesafe.play.extras" % "iteratees-extras_2.10" % "1.0.1",
... | radonsky/Taurus | project/Build.scala | Scala | apache-2.0 | 473 |
package org.gbougeard.model.changes
/**
* Created with IntelliJ IDEA.
* User: gbougeard
* Date: 13/07/13
* Time: 21:23
* To change this template use File | Settings | File Templates.
*/
case class SubmitInput(wait_for_merge: Option[Boolean] = Some(false))
object SubmitInput {
import play.api.libs.json.Json
... | gbougeard/gas | src/main/scala/org/gbougeard/model/changes/SubmitInput.scala | Scala | apache-2.0 | 414 |
package controllers
import java.util.concurrent.TimeoutException
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.concurrent.duration._
import javax.inject.Inject
import models.Category
import play.api.Logger
import play.api.i18n.I18nSupport
import play.api.i18n.Mes... | carlosFattor/DoceTentacaoScala | app/controllers/CategoryControl.scala | Scala | apache-2.0 | 3,375 |
package controllers.services
import javax.inject.Inject
import _root_.util.ClusterAgentRepoProvider
import akka.util.Timeout
import api.FactorialService.Compute
import play.api.mvc._
import akka.pattern.ask
import play.api.libs.json._
import api.FactorialService
import scala.concurrent.duration._
import play.api.libs... | kailuowang/asobu | example/frontend/app/controllers/services/Factorial.scala | Scala | apache-2.0 | 1,244 |
package sbt
package appmacro
import scala.reflect._
import macros._
import scala.tools.nsc.Global
import ContextUtil.{ DynamicDependencyError, DynamicReferenceError }
object ContextUtil {
final val DynamicDependencyError = "Illegal dynamic dependency"
final val DynamicReferenceError = "Illegal dynamic reference"
... | pdalpra/sbt | util/appmacro/src/main/scala/sbt/appmacro/ContextUtil.scala | Scala | bsd-3-clause | 11,673 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.annotation.extern
import leon.lang._
object OptionFromLib {
case class Dummy1(val x: Int)
case class Dummy2(val opt: Option[Int])
def foo(x: Int): Option[Int] = {
require(x >= 0)
if (x % 2 == 1) Some(x)
else None[Int]
}
def bar(x:... | epfl-lara/leon | src/test/resources/regression/genc/valid/OptionFromLib.scala | Scala | gpl-3.0 | 2,428 |
package name.ambidextrous.rorganize
// Reads the user input
import java.io.File
class UserInterface {
def getDirectoryName(): String = {
println("Enter a directory name: ")
val dir = readLine()
dir
}
def getFilePattern(): String = {
println("What pattern of files? ")
val pattern = readLine()
... | ambidextrousTx/ROrganize | UserInterface.scala | Scala | bsd-2-clause | 700 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/nodes/physical/batch/BatchExecExchange.scala | Scala | apache-2.0 | 11,266 |
/*
@meta {
"processorId": "org.helgoboss.scala_bundle:1.0.0",
"projectId": "org.helgoboss:mini-obr-runtime:1.0-SNAPSHOT",
"dependencies": [
"com.weiglewilczek.scala-lang-osgi:scala-library:2.9.1",
"org.helgoboss:commandlet:1.0-SNAPSHOT"
],
"transformers": [
"org.helgoboss.my_oss:... | helgoboss/mini-obr-runtime | org.helgoboss.mini-obr-runtime.scala | Scala | mit | 516 |
package com.spann
import com.spann.models.Station
import com.spann.utils.{RacerStatus, StationStatus}
import scala.collection.mutable
class StationHandler {
}
object StationHandler {
var stationList = mutable.MutableList[Station]()
var stationStatus = mutable.HashMap[String, StationStatus]()
def initialize... | sunil-123/SpannRace | src/main/scala/com/spann/StationHandler.scala | Scala | mit | 4,220 |
package com.twitter.inject.utils
import com.twitter.finagle.{FailedFastException, SourcedException, TimeoutException}
import com.twitter.util.Throwables._
import com.twitter.util.{Throw, Try}
object ExceptionUtils {
def stripNewlines(e: Throwable): String = {
stripNewlines(e.toString)
}
def stripNewlines(... | twitter/finatra | inject/inject-utils/src/main/scala/com/twitter/inject/utils/ExceptionUtils.scala | Scala | apache-2.0 | 1,229 |
package com.andre_cruz.collection
import com.andre_cruz.OptionUtils.optionIf
object TraversableOnceUtils {
implicit class RichTraversableOnce[+A](underlying: TraversableOnce[A]) {
def minOption[B >: A](implicit cmp: Ordering[B]): Option[A] = optionIf(underlying.nonEmpty) {
underlying.min(cmp)
}
... | codecruzer/scala-utils | src/main/scala/com/andre_cruz/collection/TraversableOnceUtils.scala | Scala | apache-2.0 | 734 |
package org.odfi.indesign.module.git
import org.odfi.indesign.core.harvest.Harvester
import org.odfi.indesign.core.harvest.fs.HarvestedFile
import java.io.File
import org.odfi.indesign.core.harvest.fs.FileSystemHarvester
object GitHarvester extends FileSystemHarvester {
this.onDeliverFor[HarvestedFile] {
... | opendesignflow/indesign | indesign-git/src/main/scala/org/odfi/indesign/module/git/GitHarvester.scala | Scala | gpl-3.0 | 507 |
/*
* 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 ... | aosagie/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala | Scala | apache-2.0 | 27,543 |
/***********************************************************************
* Copyright (c) 2013-2016 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is ... | nagavallia/geomesa | geomesa-utils/src/test/scala/org/locationtech/geomesa/utils/stats/StatTestHelper.scala | Scala | apache-2.0 | 1,627 |
import scala.Tuple._
trait Trait1
trait Trait2
case class Box[+T](t: T)
type N[x] = x match {
case Box[String] => Trait1
case Box[Int] => Trait2
}
trait Cov[+T]
type M[t] = t match {
case Cov[x] => N[x]
}
trait Root[A] {
def thing: M[A]
}
class Asploder extends Root[Cov[Box[Int & String]]] {
def thing =... | som-snytt/dotty | tests/neg/6570-1.scala | Scala | apache-2.0 | 511 |
package geotrellis.statistics.op.stat
import scala.math.max
import geotrellis._
case class Max(r:Op[Raster]) extends logic.Reducer1(r)({
r =>
var zmax = Int.MinValue
r.foreach(z => if (z != NODATA) zmax = max(z, zmax))
zmax
})({
zs => zs.reduceLeft(max)
})
| Tjoene/thesis | Case_Programs/geotrellis-0.7.0/src/main/scala/geotrellis/statistics/op/stat/Max.scala | Scala | gpl-2.0 | 270 |
package org.zeroturnaround.geckoboard
object Highcharts {
type SeriesType = String
val Line: SeriesType = "line"
val Bar: SeriesType = "bar"
val Spline: SeriesType = "spline"
val Column: SeriesType = "column"
type PlotOptions = Map[SeriesType, SeriesTypePlotOptions]
implicit def axis2list(axis: Axis) =... | Villane/geckoboard-scala | src/main/scala/org/zeroturnaround/geckoboard/Highcharts.scala | Scala | apache-2.0 | 1,190 |
package org.dy.lint.warning
class Unused(fileName: String, lineNumber: Int, msg: String) extends Warning(fileName, lineNumber, msg) {
override val dctype = Type.tp2
}
object Unused {
val pattern = "\\\\[warn]\\\\s(.*.scala):(\\\\d*):\\\\s(.*is never used)".r
}
| at15/scalac-log-formatter | src/main/scala/org/dy/lint/warning/Unused.scala | Scala | mit | 259 |
/**
* 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... | trustedanalytics/spark-tk | sparktk-core/src/test/scala/org/trustedanalytics/sparktk/graph/internal/ops/SingleSourceShortestPathTest.scala | Scala | apache-2.0 | 4,476 |
package com.twitter.finatra.http.test
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.ObjectNode
import com.twitter.finagle.httpx.{Request, Response}
import com.twitter.finatra.json.FinatraObjectMapper
import com.twitter.finatra.test.EmbeddedTwitterServer
import com.twitter.in... | jaume-pinyol/finatra | http/src/test/scala/com/twitter/finatra/http/test/HttpTest.scala | Scala | apache-2.0 | 3,991 |
package org.jetbrains.plugins.scala
package lang.refactoring.changeSignature
import com.intellij.openapi.project.Project
import com.intellij.psi._
import com.intellij.psi.codeStyle.JavaCodeStyleManager
import com.intellij.refactoring.changeSignature.JavaParameterInfo
import com.intellij.refactoring.util.CanonicalTypes... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/refactoring/changeSignature/ScalaParameterInfo.scala | Scala | apache-2.0 | 4,543 |
package odelay.jdk
import java.util.concurrent.{
Future => JFuture,
RejectedExecutionHandler, ScheduledExecutorService,
ScheduledThreadPoolExecutor, ThreadFactory }
import java.util.concurrent.atomic.AtomicInteger
import odelay.{ Delay, PeriodicDelay, PeriodicPromisingDelay, PromisingDelay, Timer }
import scala.... | softprops/odelay | odelay-core/jvm/src/main/scala/jdk/JdkTimer.scala | Scala | mit | 3,191 |
/*
* 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 ... | jlopezmalla/spark | core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala | Scala | apache-2.0 | 35,985 |
package io.github.electricmind
import java.io.ByteArrayInputStream
import io.github.electricmind.autocomplete._
import org.scalatest.{FlatSpec, Matchers}
class testVocabulary extends FlatSpec with Matchers {
val sample = """
Only a few flies was flying around a corpse at the morning.
"""
... | electricmind/autocomplete | src/test/scala/autocomplete/testVocabulary.scala | Scala | apache-2.0 | 553 |
/**
* 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
* distributed ... | ksmpartners/ernie | ernie-server/src/main/scala/com/ksmpartners/ernie/server/DispatchRestAPI.scala | Scala | apache-2.0 | 4,634 |
/*
* Copyright 2001-2009 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... | svn2github/scalatest | src/test/scala/org/scalatest/fixture/FixturePropSpecSpec.scala | Scala | apache-2.0 | 36,070 |
trait Parameters {
def InverterDelay = 2
def AndGateDelay = 3
def OrGateDelay = 5
}
| tobal/scala-course | examples/discrete_event_simulation/Parameters.scala | Scala | gpl-3.0 | 91 |
package perm.tryfuture.exchange
import perm.tryfuture.exchange.ExchangeServer.{BuyOrder, SellOrder}
import perm.tryfuture.exchange.OrderBook.Trade
import scala.collection.SortedSet
case class OrderBook(buyOrders: SortedSet[BuyOrder], sellOrders: SortedSet[SellOrder], trades: List[Trade]) {
def processBuyOrder(buyO... | ipostanogov/akka-stock-exchange | src/main/scala/perm/tryfuture/exchange/OrderBook.scala | Scala | mit | 2,611 |
package io.surfkit.modules
import java.util.Date
import io.surfkit.core.common.PostgresService
import io.surfkit.model.Chat.{DbEntry, ChatID}
import io.surfkit.model._
import org.joda.time.LocalDateTime
import play.api.libs.json._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Futu... | coreyauger/surfkit | modules/sexwax/src/main/scala/io/surfkit/modules/ChatStore.scala | Scala | mit | 8,139 |
/*
* Copyright 2010 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 l... | lift/lift | framework/lift-persistence/lift-mapper/src/test/scala/net/liftweb/mapper/MappedDateSpec.scala | Scala | apache-2.0 | 1,661 |
/* *********************************************************************************************************************
*
* Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with... | stratosphere/stratosphere-tpch | src/main/scala/eu/stratosphere/tpch/Job.scala | Scala | apache-2.0 | 2,851 |
package fpinscala.datastructures
import scala.annotation.tailrec
sealed trait Tree[+A]
case class Leaf[A](value: A) extends Tree[A]
case class Branch[A](left: Tree[A], right: Tree[A]) extends Tree[A]
object Tree {
def size(tree: Tree[_]): Int =
tree match {
case (Leaf(value)) => 1
case (Branch(le... | RawToast/fpinscala | exercises/src/main/scala/fpinscala/datastructures/Tree.scala | Scala | mit | 1,362 |
/*
* 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... | uncleGen/aliyun-emapreduce-sdk | external/emr-dts/src/main/scala/org/apache/spark/streaming/aliyun/dts/DtsUtils.scala | Scala | artistic-2.0 | 8,382 |
object Test {
trait Foo[S[_[_], _[_]]] extends Bar[S] {
def m[F[_]](x: S[({ type G[A] = Bar[S] })#G, F]): Unit
}
trait Bar[S[_[_], _[_]]] {
def m[F[_]](x: S[({ type G[A] = Bar[S] })#G, F]): Unit
}
}
| lrytz/scala | test/files/pos/t12187.scala | Scala | apache-2.0 | 215 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2018 Helge Holzmann (L3S) and Vinay Goel (Internet Archive)
*
* 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, inc... | helgeho/ArchiveSpark | src/main/scala/org/archive/archivespark/sparkling/warc/WarcHeaders.scala | Scala | mit | 5,422 |
package com.github.mdr.ascii.common
object Point {
private def sameColumn(p1: Point, p2: Point, p3: Point) = p1.column == p2.column && p2.column == p3.column
private def sameRow(p1: Point, p2: Point, p3: Point) = p1.row == p2.row && p2.row == p3.row
private def colinear(p1: Point, p2: Point, p3: Point) = sameCo... | jlmauduy/ascii-graphs | src/main/scala/com/github/mdr/ascii/common/Point.scala | Scala | mit | 1,306 |
package vct.col.util
import hre.ast.Origin
import vct.col.ast.ASTNode
trait VisitorHelper {
def getOrigin() : Origin
/**
* This function is used in many AST classes to handle/print exceptions when
* executing a visitor pattern over the AST.
*/
def handle_throwable(t:Throwable) = {
if (ASTNode.t... | sccblom/vercors | vercors/src/main/java/vct/col/util/VisitorHelper.scala | Scala | mpl-2.0 | 448 |
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.