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 |
|---|---|---|---|---|---|
/*******************************************************************************
* Copyright (c) 2019. Carl Minden
*
* 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 ... | carlminden/anathema-roguelike | src/com/anathema_roguelike/entities/characters/player/perks/abilities/spells/shadow/UmbralAura.scala | Scala | gpl-3.0 | 1,384 |
package controllers
import javax.inject._
import models.City
import play.api.Logger
import play.api.libs.json._
import play.api.mvc._
import play.modules.reactivemongo._
import reactivemongo.api.ReadPreference
import reactivemongo.play.json._
import reactivemongo.play.json.collection._
import utils.Errors
import sca... | LiebelJ/YellowDuckyChat | backend/app/controllers/CityController.scala | Scala | mit | 2,822 |
package com.amadornes.modcast.bot
import akka.actor.{ActorSystem, Props}
import akka.stream.ActorMaterializer
import com.amadornes.modcast.bot.discord.commands._
import com.amadornes.modcast.bot.discord.{CommandDispatcher, DiscordActor, DiscordNotifier}
import com.amadornes.modcast.bot.helpers.ShutdownHelper
import co... | Modcast/ModcastBot | src/main/scala/com/amadornes/modcast/bot/Actors.scala | Scala | mit | 1,324 |
/*
* 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 not u... | nvoron23/sparkling-water | core/src/main/scala/org/apache/spark/h2o/H2OContextUtils.scala | Scala | apache-2.0 | 8,652 |
package scalaz.stream
import org.scalacheck.Properties
import org.scalacheck.Prop._
import scalaz.concurrent.Task
import scalaz.{-\\/, \\/-, \\/}
import java.lang.Exception
import scalaz.syntax.monad._
import scala.concurrent.SyncVar
import scalaz.stream.async.mutable.Signal
import scalaz.stream.Process.End
objec... | Spinoco/scalaz-stream | src/test/scala/scalaz/stream/AsyncRefSpec.scala | Scala | mit | 5,805 |
package sangria.benchmarks
import org.openjdk.jmh.annotations._
import org.openjdk.jmh.infra.Blackhole
import sangria.ast.Document
import sangria.parser.QueryParser
import sangria.schema.Schema
import sangria.validation.rules
import sangria.validation.{QueryValidator, RuleBasedQueryValidator, Violation}
@State(Scope.... | OlegIlyenko/sangria | modules/benchmarks/src/main/scala/sangria/benchmarks/OverlappingFieldsCanBeMergedBenchmark.scala | Scala | apache-2.0 | 6,264 |
/*
* Copyright (C) 2011-2013 org.bayswater
*
* 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... | newlandsvalley/musicrest | src/test/scala/org/bayswater/musicrest/AuthenticationSpec.scala | Scala | apache-2.0 | 5,016 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.filters.cors
import javax.inject.Inject
import play.api.Application
import play.api.http.HttpFilters
import play.api.inject.bind
import play.api.mvc.DefaultActionBuilder
import play.api.mvc.Results
import play.api.routing.sird._
import p... | benmccann/playframework | web/play-filters-helpers/src/test/scala/play/filters/cors/CORSFilterSpec.scala | Scala | apache-2.0 | 2,007 |
package is.hail.utils
import is.hail.annotations.{Annotation, RegionValueBuilder}
import is.hail.types.virtual.Type
import scala.collection.mutable
class MissingAnnotationArrayBuilder extends Serializable {
private var len = 0
private var elements = new ArrayBuilder[Annotation]()
private var isMissing = new mu... | danking/hail | hail/src/main/scala/is/hail/utils/MissingAnnotationArrayBuilder.scala | Scala | mit | 1,342 |
package org.clulab.utils
import collection.mutable.ArrayBuffer
/**
* Simple code profiler
* User: peter
* Date: 5/15/13
*/
object Profiler {
val startTimes = new ArrayBuffer[BigInt]()
val deltas = new ArrayBuffer[BigInt]()
val numSamples = new ArrayBuffer[BigInt]()
val ids = new ArrayBuffer[String]()
... | sistanlp/processors | main/src/main/scala/org/clulab/utils/Profiler.scala | Scala | apache-2.0 | 1,699 |
/****************************************************************************
* Copyright Fabien Sartor
* Contributors: Fabien Sartor (fabien.sartor@gmail.com)
* http://fasar.fr
*
* This software is a computer program whose purpose to compute differences
* between two files.
*
****************... | fasar/diffTools | core/console/src/main/scala/fsart/diffTools/helper/HtmlPages.scala | Scala | apache-2.0 | 3,590 |
/*
* Copyright 2017 Datamountaineer.
*
* 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... | datamountaineer/stream-reactor | kafka-connect-cassandra/src/main/scala/com/datamountaineer/streamreactor/connect/cassandra/CassandraConnection.scala | Scala | apache-2.0 | 5,851 |
package controllers
import models.MainTemplate
import lib.{UrlKey, Util, VersionedName, VersionTag}
import com.bryzek.apidoc.api.v0.models.{Application, OriginalForm, OriginalType, Organization, User, Version, VersionForm, Visibility, WatchForm}
import com.bryzek.apidoc.spec.v0.models.Service
import com.bryzek.apidoc.... | movio/apidoc | www/app/controllers/Versions.scala | Scala | mit | 14,243 |
package 练习14
trait 被除数 {
type 除以[T <: 除数, H] <: 商
def 除以[T <: 除数, H](t: T, h: H): 除以[T, H]
}
class 被除数Positive[Tail <: 被除数, Head](val tail: Tail, val head: Head) extends 被除数 {
override type 除以[T <: 除数, H] = T#除[Tail]
override def 除以[T <: 除数, H](t: T, h: H): T#除[Tail] = t.除(tail)
}
class 被除数Zero extends 被除数 {
... | djx314/ubw | a28-练习/src/main/scala/练习14/除法.scala | Scala | bsd-3-clause | 1,910 |
package gitbucket.core.service
import gitbucket.core.model._
import gitbucket.core.service.IssuesService._
import org.scalatest.FunSuite
class IssuesServiceSpec extends FunSuite with ServiceSpecBase {
test("getCommitStatues") {
withTestDB { implicit session =>
val user1 = generateNewUserWithDBRepository(... | gencer/gitbucket | src/test/scala/gitbucket/core/service/IssuesServiceSpec.scala | Scala | apache-2.0 | 2,117 |
package yuuto.enhancedinventories.block
import java.util.List
import net.minecraftforge.common.util.ForgeDirection
import net.minecraft.tileentity.TileEntity
import yuuto.enhancedinventories.tile.TileLocker
import net.minecraft.world.World
import net.minecraft.block.material.Material
import net.minecraft.nbt.NBTTagCom... | Joccob/EnhancedInventories | src/main/scala/yuuto/enhancedinventories/block/BlockLocker.scala | Scala | gpl-2.0 | 4,461 |
package com.scalapenos.myapp
package api
import akka.actor.ActorSystem
object Boot extends App {
val system = ActorSystem("my-app-api")
// start some actors
}
| RayRoestenburg/nljug2013 | src/main/scala/com/scalapenos/myapp.api/Boot.scala | Scala | apache-2.0 | 175 |
/*
* Copyright 2017 Exon IT
*
* 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 w... | exon-it/redmine-scala-client | client-core/src/main/scala/by/exonit/redmine/client/serialization/RedmineDateParser.scala | Scala | apache-2.0 | 2,981 |
package io.ino.solrs.future
import java.util.concurrent.atomic.AtomicReference
import java.util.concurrent.{CompletionStage, ExecutionException, TimeUnit}
import com.twitter.util.{Future => TFuture}
import io.ino.solrs.FutureAwaits
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
i... | inoio/solrs | src/test/scala/io/ino/solrs/future/FutureFactorySpec.scala | Scala | apache-2.0 | 7,277 |
package deploymentzone.actor
import net.ceedubs.ficus.FicusConfig._
import java.net.InetSocketAddress
import com.typesafe.config.ConfigFactory
import scala.concurrent.duration._
private[actor] class Config(private val _hostname: Option[String],
private val _port: Option[Int],
... | cfeduke/akka-actor-statsd | src/main/scala/deploymentzone/actor/Config.scala | Scala | mit | 1,739 |
/*
* Copyright (c) 2015 Robert Conrad - All Rights Reserved.
* Unauthorized copying of this file, via any medium is strictly prohibited.
* This file is proprietary and confidential.
* Last modified by rconrad, 1/3/15 6:50 PM
*/
package base.socket.message
import org.json4s.JsonAST._
import org.json4s.native.Json... | robconrad/base-api | project-socket/src/main/scala/base/socket/message/JsonServerMessage.scala | Scala | mit | 892 |
/*
* Spans.scala
* (LucreEvent)
*
* Copyright (c) 2011-2014 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss
package lucre
p... | Sciss/LucreEvent | expr/src/test/scala/de/sciss/lucre/expr/Spans.scala | Scala | lgpl-2.1 | 8,021 |
/*
* 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 ... | ueshin/apache-flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/MapRelDataType.scala | Scala | apache-2.0 | 1,715 |
package com.aristocrat.mandrill.requests.Ips
import com.aristocrat.mandrill.requests.MandrillRequest
case class CreatePool(key: String, pool: String) extends MandrillRequest
| aristocratic/mandrill | src/main/scala/com/aristocrat/mandrill/requests/Ips/CreatePool.scala | Scala | mit | 176 |
package org.jmespike.input
import org.jmespike.controls.ControlConf
/**
*
*/
class SteeringConf extends ControlConf {
def createControl(seed: Int) = new SteeringControl()
} | zzorn/skycastle | src/main/scala/org/jmespike/input/SteeringConf.scala | Scala | gpl-2.0 | 180 |
package microfluidic
import scala.concurrent.duration._ // We would use our own. This is a proof of concept.
package object sensors {
// Note: this is an example how one can add sensors.
implicit class SensorPack(f: Fluid) {
def conductivity: Measurement = Measurement(f, "conductivity")
}
}
| vjovanov/microfluidic | src/main/scala/microfluidic/sensors.scala | Scala | bsd-3-clause | 303 |
package jp.co.cyberagent.aeromock.data
import java.nio.file.Path
import jp.co.cyberagent.aeromock.util.ResourceUtil
import jp.co.cyberagent.aeromock.{AeromockInvalidDataFileException, AeromockResourceNotFoundException}
import org.json4s.JsonAST.JValue
import org.json4s.native.JsonMethods.parse
import org.json4s.{JArr... | CyberAgent/aeromock | aeromock-server/src/main/scala/jp/co/cyberagent/aeromock/data/JsonDataFileReader.scala | Scala | mit | 1,066 |
/*
* 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 ... | GJL/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/nodes/dataset/DataSetAggregate.scala | Scala | apache-2.0 | 5,537 |
package org.bowlerframework.jpa
import org.bowlerframework.persistence.AbstractDao
import com.recursivity.jpa.Jpa._
import com.recursivity.jpa.PersistenceUnit
import scala.collection.JavaConverters._
import collection.mutable.MutableList
class JpaDao[T <: {def id: K}, K](persistenceUnit: String = PersistenceUnit.unit... | rkpandey/Bowler | jpa-mapper/src/main/scala/org/bowlerframework/jpa/JpaDao.scala | Scala | bsd-3-clause | 1,564 |
/*
* Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | mdavid/lessig-bigdata | lib/snowplow/3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/enrichments/web/PageEnrichments.scala | Scala | mit | 2,911 |
/*
* 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... | danielcsant/sparta | serving-api/src/main/scala/com/stratio/sparta/serving/api/service/http/BaseHttpService.scala | Scala | apache-2.0 | 1,436 |
// scalac: -opt:unreachable-code
//
// See comment in BCodeBodyBuilder
// -opt:unreachable-code
class C {
// can't just emit a call to ???, that returns value of type Nothing$ (not Int).
def f1: Int = ???
def f2: Int = throw new Error("")
def f3(x: Boolean) = {
var y = 0
// cannot assign an object o... | scala/scala | test/files/run/nothingTypeDce.scala | Scala | apache-2.0 | 1,292 |
package com.noelcurtis.greencard.bullitenscraper
import com.amazonaws.services.lambda.runtime.Context
import com.typesafe.config.{Config, ConfigFactory}
class BulletinManagerApp {
implicit val jsoupManager: JsoupManager = new WrappingJsoupManager()
val config: Config = ConfigFactory.load()
val bulletinManager:... | noelcurtis/greencard-tracker-service | bulletinscraper/src/main/scala/com/noelcurtis/greencard/bullitenscraper/BulletinManagerApp.scala | Scala | mit | 726 |
/*
* 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... | wzhongyuan/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/ClampSpec.scala | Scala | apache-2.0 | 1,041 |
/*
* 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/commons | text/src/main/scala/org/beangle/commons/text/i18n/TextBundle.scala | Scala | lgpl-3.0 | 1,149 |
/*
* 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 ... | starpit/openwhisk | tests/src/test/scala/org/apache/openwhisk/core/database/test/CleanUpActivationsTest.scala | Scala | apache-2.0 | 5,240 |
/**
* Copyright (C) 2013 Kaj Magnus Lindberg (born 1979)
*
* 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.
... | debiki/debiki-server-old | app/controllers/ForumController.scala | Scala | agpl-3.0 | 5,321 |
package gov.uk.dvla.vehicles.acquire.runner
import cucumber.api.CucumberOptions
import cucumber.api.junit.Cucumber
import org.junit.runner.RunWith
@RunWith(classOf[Cucumber])
@CucumberOptions(
features = Array("acceptance-tests/src/test/resources/gherkin/NewKeeperChooseYourAddressFromPrivateKeeper.feature"),
glue... | dvla/vehicles-acquire-online | acceptance-tests/src/test/scala/gov/uk/dvla/vehicles/acquire/runner/NewKeeperChooseYourAddressFromPrivateKeeper.scala | Scala | mit | 466 |
object O
println(/* file: this, offset: 7, type: org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScObject */ O.getClass)
println(classOf[ /* resolved: false */ O]) | ilinum/intellij-scala | testdata/resolve2/element/Object.scala | Scala | apache-2.0 | 174 |
package net.paploo.diestats.statistics.frequency
import net.paploo.diestats.test.SpecTest
class FrequencyDistributionTest extends SpecTest {
describe("object methods") {
it("should construct an empty frequency") {
val freq: FrequencyDistribution[String] = FrequencyDistribution.empty[String]
freq.s... | paploo/DieStats | src/test/scala/net/paploo/diestats/statistics/frequency/FrequencyDistributionTest.scala | Scala | bsd-3-clause | 2,780 |
/**
* <p>This package provides deterministic, repeatable, pseudo-random number
* generators, a set of strategies for seeding them, and classes for generating
* values from different probability distributions.</p>
* This Scala version is ported by Caoyuan Deng from Daniel Dyer's Java version
*/
package wandou.math.... | wandoulabs/wandou-math | wandou-math/src/main/scala/wandou/math/random/package-info.scala | Scala | apache-2.0 | 327 |
/*
* 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 ... | Dax1n/spark-core | core/src/main/scala/org/apache/spark/rdd/SampledRDD.scala | Scala | apache-2.0 | 2,705 |
/*
* 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... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/BeforeAndAfterAllSpec.scala | Scala | apache-2.0 | 17,955 |
val input = scala.io.Source.fromFile("input.txt").getLines.map(_.split("x").map(_.toInt)).toList
def dimsToSides(dims: Array[Int]) = {
// A shame - can't use Array.combinations, because it returns the set of unique
// combinations, which would potentially discard one or more sides
// val sides = dims.combi... | dbjohnson/advent-of-code | solutions/day02/solution.scala | Scala | mit | 956 |
/*
* Copyright 2013 Joachim Hofer
*
* 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... | jmhofer/rxjava-akka | src/test/scala/rx/schedulers/AkkaSchedulerSpec.scala | Scala | apache-2.0 | 5,651 |
/*
* 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 | robustj/src/main/scala/ast/trees.scala | Scala | bsd-3-clause | 4,071 |
/*
* Copyright 2017 Datamountaineer.
*
* 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... | datamountaineer/stream-reactor | kafka-connect-hazelcast/src/main/scala/com/datamountaineer/streamreactor/connect/hazelcast/HazelCastConnection.scala | Scala | apache-2.0 | 4,082 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/ ... | S-Mach/s_mach.explain | metadata/src/main/scala/s_mach/metadata/impl/TypeMetadataOps.scala | Scala | mit | 5,568 |
/*
* 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... | yiheng/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/Reverse.scala | Scala | apache-2.0 | 3,836 |
/**
* Copyright (C) 2014 Kaj Magnus Lindberg (born 1979)
*
* 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.
... | debiki/debiki-server-old | app/controllers/SpecialContentController.scala | Scala | agpl-3.0 | 6,802 |
/*
* 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/status/api/v1/AllRDDResource.scala | Scala | apache-2.0 | 3,547 |
package mesosphere.marathon
package core.appinfo
import mesosphere.UnitTest
import mesosphere.marathon.core.base.ConstantClock
import mesosphere.marathon.core.health.Health
import mesosphere.marathon.core.instance.Instance.AgentInfo
import mesosphere.marathon.core.instance.{ Instance, LegacyAppInstance, TestTaskBuilde... | natemurthy/marathon | src/test/scala/mesosphere/marathon/core/appinfo/TaskStatsByVersionTest.scala | Scala | apache-2.0 | 4,531 |
import collection.immutable._
import collection.parallel._//immutable._
class SeqCoder(words: List[String]) {
private val m = Map(
'2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL",
'6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ")
/** Invert the mnemonics map to give a map f... | felixmulder/scala | test/disabled/run/coder2/Coder2.scala | Scala | bsd-3-clause | 7,082 |
package com.softwaremill.macwire
import scala.reflect.macros.blackbox
private[macwire] class PositionUtil[C <: blackbox.Context](val c: C) {
import c.universe._
def samePosition(pos1: Position, pos2: Position): Boolean = {
// sometimes same positions are represented as different case classes (e.g. offset-pos... | rcirka/macwire | macros/src/main/scala/com/softwaremill/macwire/PositionUtil.scala | Scala | apache-2.0 | 529 |
package de.htwg.zeta.common.format.project.gdsl.style
import de.htwg.zeta.common.models.project.gdsl.style.Style
import play.api.libs.json.JsObject
import play.api.libs.json.JsResult
import play.api.libs.json.JsValue
import play.api.libs.json.Json
import play.api.libs.json.OFormat
class StyleFormat(
backgroundFor... | Zeta-Project/zeta | api/common/src/main/scala/de/htwg/zeta/common/format/project/gdsl/style/StyleFormat.scala | Scala | bsd-2-clause | 1,588 |
package models.generator.javaAwsLambdaPojos
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class JavaAwsLambdaPOJOUtilTest
extends AnyFlatSpec
with Matchers
with JavaAwsLambdaPOJOUtil{
"toParameterName" should "convert array" in {
toParamName("[some_param]", false... | gheine/apidoc-generator | java-aws-lambda-pojos/src/test/scala/models/generator/javaAwsLambdaPojos/JavaAwsLambdaPOJOUtilTest.scala | Scala | mit | 5,667 |
/*
* Copyright 2015 Heiko Seeberger
*
* 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... | hseeberger/constructr | core/src/main/scala/de/heikoseeberger/constructr/Constructr.scala | Scala | apache-2.0 | 3,927 |
package com.ponkotuy.restype
import com.netaporter.uri.Uri
import com.ponkotuy.config.ClientConfig
import com.ponkotuy.data
import com.ponkotuy.data.{MyFleetAuth, Auth}
import com.ponkotuy.http.MFGHttp
import com.ponkotuy.parser.Query
import com.ponkotuy.value.KCServer
import org.json4s._
import org.json4s.native.Seri... | nekoworkshop/MyFleetGirls | client/src/main/scala/com/ponkotuy/restype/Basic.scala | Scala | mit | 1,446 |
/*
* 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 ... | shaneknapp/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowCreateTableSuite.scala | Scala | apache-2.0 | 5,734 |
/*
* This file is part of Apparat.
*
* Copyright (C) 2010 Joa Ebert
* http://www.joa-ebert.com/
*
* This library 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 2.1 of the Lice... | joa/apparat | apparat-core/src/main/scala/apparat/bytecode/analysis/StackAnalysis.scala | Scala | lgpl-2.1 | 2,316 |
/*
Copyright 2011 Ben Biddington
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
d... | ben-biddington/Coriander.OAuth | src/org/coriander/QueryParser.scala | Scala | apache-2.0 | 1,751 |
package com.krux.hyperion.aws
import org.json4s.JsonDSL._
import org.scalatest.WordSpec
class AdpDatabasesSpec extends WordSpec {
"AdpRedshiftDatabase" should {
"converts to Json" in {
val testObj = AdpRedshiftDatabase(
id = "red",
name = None,
clusterId = "datascience-redshift-id... | hoangelos/hyperion | core/src/test/scala/com/krux/hyperion/aws/AdpDatabasesSpec.scala | Scala | apache-2.0 | 2,436 |
// Copyright (c) 2011-2015 ScalaMock Contributors (https://github.com/paulbutcher/ScalaMock/graphs/contributors)
//
// 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... | paulbutcher/ScalaMock | shared/src/test/scala/com/paulbutcher/test/UserDatabase.scala | Scala | mit | 1,427 |
/*
* Copyright (c) 2014-2020 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... | alexandru/monifu | monix-eval/shared/src/main/scala/monix/eval/internal/TaskStartAndForget.scala | Scala | apache-2.0 | 1,390 |
package com.yuvimasory.tostring
object SpeedTest {
val numObjects = 100000000
val numTrials = 5
def main(args: Array[String]) = {
for (i <- 1 to numTrials) {
println("trial " + i + " of " + numTrials)
runTrial()
}
}
def runTrial() {
def createObjects(objectCreate: => Unit, desc:... | ymasory/labeled-tostring | src/main/scala/SpeedTest.scala | Scala | gpl-3.0 | 1,651 |
/*
*
* Copyright 2016 alh Technology
*
* 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 la... | Abiy/distGatling | gatling-uber-example/src/main/scala/com/alh/store/gatling/simulation/BasicSimulation.scala | Scala | apache-2.0 | 3,652 |
package object eidos {
type Id[A] = id.Id[A]
// Labels
type MakeLabel = id.Label.MakeLabel
type CustomLabel = id.Label.CustomLabel
// Formats
type NonBlank = id.Format.NonBlank
type AlphaNum = id.Format.AlphaNum
type Num = id.Format.Num
type UUID = id.Format.UUID
type Regex = id.Format.Regex
val ... | SystemFw/eidos | src/main/scala/package.scala | Scala | mit | 333 |
/*
* Copyright 2016 Guy Van den Broeck and Wannes Meert (UCLA and KU Leuven)
*
* 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
*
* Un... | UCLA-StarAI/Forclift | src/main/scala/edu/ucla/cs/starai/forclift/compiler/IJCAICompiler.scala | Scala | apache-2.0 | 17,352 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Tue May 29 14:45:32 EDT 2012
* @see LICENSE (MIT style license file).
*/
package scalation.analytics
import util.control.Breaks.{breakable, break}
import collection.mutable.Set... | mvnural/scalation | src/main/scala/scalation/analytics/KMeansClustering.scala | Scala | mit | 8,425 |
package repositories.analysis.dao
import java.util.UUID
import models.analysis.events.AnalysisTypeId
import models.analysis.events.EventCategories.Dating
import no.uio.musit.models.{ActorId, GroupId, MuseumId}
import no.uio.musit.models.MuseumCollections.Entomology
import no.uio.musit.security._
import no.uio.musit.t... | MUSIT-Norway/musit | service_backend/test/repositories/analysis/dao/AnalysisTypeDaoSpec.scala | Scala | gpl-2.0 | 3,232 |
/*
* Copyright (C) 2015 47 Degrees, LLC http://47deg.com hello@47deg.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 r... | jamontes79/movieList | src/main/scala/com/jamontes79/scala/movielist/utils/CircularTransformation.scala | Scala | apache-2.0 | 1,620 |
object A {
def f0[T](x: T): T = x
def f1[T](x: => T): T = x
def f2[T](x: () => T): T = x()
f0(this.getClass) // ok
f1(this.getClass)
f2(this.getClass) // ok
// a.scala:7: error: type mismatch;
// found : Class[_ <: A.type]
// required: Class[?0(in value x1)] where type ?0(in value x1) <: A.typ... | yusuke2255/dotty | tests/untried/pos/t5886.scala | Scala | bsd-3-clause | 564 |
/**
* Copyright 2011-2017 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 appli... | timve/gatling | gatling-commons/src/test/scala/io/gatling/commons/util/MapsSpec.scala | Scala | apache-2.0 | 6,196 |
package org.scalatra
import _root_.akka.actor._
import org.scalatra.test.specs2.MutableScalatraSpec
import scala.concurrent.Future
import scala.concurrent.duration._
class AkkaSupportServlet extends ScalatraServlet with FutureSupport {
val system = ActorSystem()
protected implicit val executor = system.dispatche... | Alefas/Scalatra | core/src/test/scala/org/scalatra/AkkaSupportSpec.scala | Scala | bsd-2-clause | 2,346 |
package macro
object Foo {
val c = Client.RealClient
}
| twitter-forks/sbt | sbt/src/sbt-test/source-dependencies/inherited-macros/macro-client/src/main/scala/Foo.scala | Scala | bsd-3-clause | 57 |
/**
* 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 not us... | Tony-Zhang03/kafka | core/src/test/scala/integration/kafka/api/ConsumerBounceTest.scala | Scala | apache-2.0 | 5,737 |
package org.pinky.guice
import com.google.inject.servlet.ServletModule
import com.google.inject.Injector
import org.scalatest.Spec
import org.scalatest.matchers.ShouldMatchers
/**
* DSLFixes module tests
*
* @author fede silva gmail com { fedesilva }
*/
class DSLFixesTest extends Spec with ShouldMatchers {
... | d5nguyenvan/pinky | src/test/scala/org/pinky/guice/DSLFixesTest.scala | Scala | bsd-3-clause | 1,555 |
/*
* Copyright 2020 LINE Corporation
*
* LINE Corporation 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:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless r... | minwoox/armeria | examples/grpc-scala/src/main/scala/example/armeria/grpc/scala/GrpcScalaDocServicePlugin.scala | Scala | apache-2.0 | 2,221 |
package org.eknet.spray.openid.model
import scala.xml._
import scala.concurrent.{ExecutionContext, Future}
import akka.actor.ActorRefFactory
import spray.http._
import spray.http.HttpRequest
object Discovery {
import spray.client.pipelining._
def discover(idUrl: String)(implicit refFactory: ActorRefFactory, ec: ... | eikek/spray-openid | src/main/scala/org/eknet/spray/openid/model/Discovery.scala | Scala | apache-2.0 | 5,887 |
package de.tototec.sbuild
import org.scalatest.FunSuite
import de.tototec.sbuild.test.TestSupport
class TargetRefTest extends FunSuite {
implicit val project = TestSupport.createMainProject
val pDir = project.projectDirectory
private[this] var count = 0
def testToString(expected: String, targetRefs: Targ... | SBuild-org/sbuild | de.tototec.sbuild/src/test/scala/de/tototec/sbuild/TargetRefTest.scala | Scala | apache-2.0 | 843 |
package com.cloudray.scalapress.folder.controller.admin
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.{ModelAttribute, RequestMethod, RequestMapping}
import org.springframework.beans.factory.annotation.Autowired
import scala.Array
import javax.servlet.http.HttpServletR... | vidyacraghav/scalapress | src/main/scala/com/cloudray/scalapress/folder/controller/admin/FolderSettingsController.scala | Scala | apache-2.0 | 1,347 |
package com.hhcache.core
import java.util.UUID
import java.util.concurrent.TimeUnit
import akka.actor.ActorRef
import akka.util.Timeout
import akka.util.Timeout._
import scala.concurrent.Await
import scala.concurrent.duration._
import akka.pattern.ask
/**
* Created by huhong on 15/4/30.
*/
trait CacheEntity[T] ex... | wuxihuhong/HHCache | src/main/scala/com/hhcache/core/CacheEntity.scala | Scala | apache-2.0 | 1,410 |
package my.delite.framework.codegen.delite.generators
import collection.mutable.{ArrayBuffer, ListBuffer, HashMap}
import java.io.{StringWriter, FileWriter, File, PrintWriter}
import scala.virtualization.lms.common.LoopFusionOpt
import scala.virtualization.lms.internal.{GenericCodegen, CLikeCodegen, ScalaCodegen, Gene... | alsam/simple-delite-project | src/cudagen/simple/mydelite/DeliteGenTaskGraph.scala | Scala | mit | 33,779 |
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author Martin Odersky
*/
package scala
package reflect
package internal
trait InfoTransformers {
self: SymbolTable =>
/* Syncnote: This should not need to be protected, as reflection does not run in multiple phases.
*/
abstract class InfoTr... | felixmulder/scala | src/reflect/scala/reflect/internal/InfoTransformers.scala | Scala | bsd-3-clause | 1,387 |
package controllers
import java.nio.file.Files
import akka.stream.scaladsl.FileIO
import javax.inject.{ Inject, Singleton }
import models.Roles
import net.lingala.zip4j.ZipFile
import net.lingala.zip4j.model.ZipParameters
import net.lingala.zip4j.model.enums.{ CompressionLevel, EncryptionMethod }
import org.elastic4... | CERT-BDF/TheHive | thehive-backend/app/controllers/AttachmentCtrl.scala | Scala | agpl-3.0 | 4,203 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.inject.guice
import org.specs2.mutable.Specification
import com.google.inject.AbstractModule
import com.typesafe.config.Config
import play.api.i18n.I18nModule
import play.{ Environment => JavaEnvironment }
import play.api.{ A... | wsargent/playframework | framework/src/play-guice/src/test/scala/play/api/inject/guice/GuiceApplicationLoaderSpec.scala | Scala | apache-2.0 | 3,984 |
package com.portia.algorithms
import com.portia.models._
import com.portia.tokenizer.Tokenizer
import com.portia.models.{CategoryDAO, TokenScoreDAO, TokenScore, Category}
import scala.collection.mutable.ArrayBuffer
import com.portia.lib.Utils
import org.jsoup.Jsoup
import com.mongodb.casbah.commons.MongoDBObject
impor... | duytd/blackspider | src/main/scala/com/portia/algorithms/NaiveBayesClassifier.scala | Scala | gpl-3.0 | 6,111 |
/*
* Copyright 2017 Pere Villega
*
* 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... | pvillega/scalachain | src/main/scala/com/aracon/scalachain/network/Wallet.scala | Scala | apache-2.0 | 4,525 |
package entities
/**
* marker trait for classes with implicit JSON converters in their companion objects
*/
trait JsonMessage {
}
| alanktwong/typesafe_activators | redis-twitter-clone/app/entities/JsonMessage.scala | Scala | mit | 133 |
package lila.common
import java.util.regex.Matcher.quoteReplacement
import ornicar.scalalib.Random
import play.api.mvc.{ Cookie, Session, RequestHeader }
object LilaCookie {
private val domainRegex = """^.+(\\.[^\\.]+\\.[^\\.]+)$""".r
private def domain(req: RequestHeader): String =
domainRegex.replaceAllI... | clarkerubber/lila | modules/common/src/main/LilaCookie.scala | Scala | agpl-3.0 | 1,236 |
package org.killbill.billing.client.model
/**
* Created by jgomez on 28/10/2015.
*/
object ProductCategory extends Enumeration {
type ProductCategory = Value
val BASE = Value("BASE")
val ADD_ON = Value("ADD_ON")
val STANDALONE = Value("STANDALONE")
} | jgomez-vp/killbill-client-scala | src/main/scala/org/killbill/billing/client/model/ProductCategory.scala | Scala | apache-2.0 | 261 |
/* Copyright 2015 White Label Personal Clouds Pty Ltd
*
* 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 a... | welcomer/framework | src/main/scala/me/welcomer/framework/eventedgateway/ExternalEventedGateway.scala | Scala | apache-2.0 | 9,920 |
package org.jetbrains.plugins.scala
package findUsages
import com.intellij.openapi.application.ReadActionProcessor
import com.intellij.openapi.project.IndexNotReadyException
import com.intellij.openapi.roots.FileIndexFacade
import com.intellij.openapi.util.Condition
import com.intellij.openapi.vfs.VirtualFile
import c... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/findUsages/OperatorAndBacktickedSearcher.scala | Scala | apache-2.0 | 4,679 |
/* The Computer Language Benchmarks Game
http://benchmarksgame.alioth.debian.org/
contributed by Isaac Gouy
modified and updated for 2.8 by Rex Kerr
*/
import java.io._
object regexdna {
def main(args: Array[String]) {
var sequence = readFully()
val initialLength = sequence.length
def matching(... | dc-uba/metrika_benchs_game | benchs/regexdna/regexdna.scala | Scala | mit | 1,745 |
package com.twitter.storehaus.redis
import com.twitter.bijection.{ Bijection, Injection }
import com.twitter.finagle.redis.util.{ CBToString, StringToChannelBuffer }
import com.twitter.storehaus.algebra.MergeableStore
import com.twitter.storehaus.testing.CloseableCleanup
import com.twitter.util.{ Await, Future }
impor... | sdjamaa/storehaus | storehaus-redis/src/test/scala/com/twitter/storehaus/redis/RedisSortedSetSpec.scala | Scala | apache-2.0 | 3,096 |
/*
* Copyright 2016 LinkedIn 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 i... | shankar37/dr-elephant | app/com/linkedin/drelephant/spark/fetchers/FSFetcher.scala | Scala | apache-2.0 | 1,529 |
import sbt._
import Keys._
import sbtbuildinfo.BuildInfoKey
import sbtbuildinfo.BuildInfoKeys._
object Common {
val Xsd = config("xsd") extend(Compile)
val Wsdl = config("wsdl") extend(Compile)
val Soap11 = config("soap11") extend(Compile)
val Soap12 = config("soap12") extend(Compile)
val scalaxbCodegenSett... | eed3si9n/scalaxb | project/common.scala | Scala | mit | 2,731 |
package example
import akka.actor.{Actor, ActorRef}
import example.StudentMessages._
import example.TeacherMessages._
class StudentActor(teacher: ActorRef) extends Actor {
def receive = {
case Study => teacher ! Question("Did Pythagoras have a beard?")
case Answer(answer) => println(s"I got answer: $answer"... | jvorhauer/akka-workshop | src/main/scala/example/StudentActor.scala | Scala | apache-2.0 | 328 |
/**
* 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... | thomsonreuters/CM-Well | server/cmwell-domain/src/main/scala/cmwell/domain/InfotonSerializer.scala | Scala | apache-2.0 | 26,981 |
package cl.asa.yaml.cchart
class Dict {
var dict:Array[Cchart] = Array.empty
def getCchart(ctype: String): Option[Cchart] = {
val cchart = dict.find { cchart =>
cchart.ctype.equals(ctype)
}
return cchart
}
def setDict(list:Array[Cchart]){
this.dict = list
}
} | Takeuchi-Lab-LM/scala_asa3 | ASA/src/main/scala/cl/asa/yaml/cchart/Dict.scala | Scala | mit | 281 |
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.