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 models import scala.concurrent._ import scala.concurrent.ExecutionContext.Implicits.global import play.api.libs.json._ object Game extends models.Base("game") { def isExist(gid: String): Future[Boolean] = { val query = Json.obj("id" -> gid) isExist(query) } }
noraesae/tenhou-analysis-play
app/models/Game.scala
Scala
mit
282
/* * Copyright (C) Lightbend Inc. <https://www.lightbend.com> */ package com.lightbend.lagom.scaladsl.persistence.slick import com.lightbend.lagom.internal.scaladsl.persistence.jdbc.JdbcPersistentEntityRegistry import com.lightbend.lagom.scaladsl.persistence.TestEntity.Evt import com.lightbend.lagom.scaladsl.persis...
lagom/lagom
persistence-jdbc/scaladsl/src/test/scala/com/lightbend/lagom/scaladsl/persistence/slick/SlickReadSideSpec.scala
Scala
apache-2.0
1,041
// test that dependent types work // TODO: def apply(x: String): x.type does NOT work yet object Test { val s: String = "" trait T { def apply(x: s.type): s.type } val preservedResult: s.type = ((x => x): T)(s) }
yusuke2255/dotty
tests/untried/pos/sammy_single.scala
Scala
bsd-3-clause
221
package controllers import com.github.mrmechko.service.{TripsHierarchyQueryImpl$, TripsHierarchyQuery, WordLookupQuery, WordLookupQueryImpl$} import play.api.libs.json.Json import play.api.mvc.{Action, Controller} import com.github.mrmechko.protocol.QueryJson._ object QueryController extends Controller{ val wordLo...
mrmechko/OntologyManager
server/app/controllers/QueryController.scala
Scala
mit
825
/* Copyright (C) 2008-2014 University of Massachusetts Amherst. This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible) http://factorie.cs.umass.edu, http://github.com/factorie Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with...
patverga/factorie
src/main/scala/cc/factorie/model/Template3.scala
Scala
apache-2.0
5,156
/* * 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...
TiVo/kafka
core/src/main/scala/kafka/raft/RaftManager.scala
Scala
apache-2.0
9,218
/* * SPDX-License-Identifier: Apache-2.0 * Copyright 2016-2020 Daniel Urban and contributors listed in NOTICE.txt * * 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.ap...
durban/exp-reagents
core/src/test/scala/dev/tauri/choam/CtrieSpec.scala
Scala
apache-2.0
5,604
package info.armado.ausleihe.client.transport.dataobjects.information import info.armado.ausleihe.client.transport.dataobjects.LendGameStatusDTO import info.armado.ausleihe.client.transport.requests.GameInformationRequestDTO import javax.xml.bind.annotation.{XmlAccessType, XmlAccessorType, XmlRootElement} @XmlRootEle...
Spielekreis-Darmstadt/lending
lending-client-interfaces/src/main/scala/info/armado/ausleihe/client/transport/dataobjects/information/GameInformationDTO.scala
Scala
apache-2.0
1,120
// -*- mode: Scala;-*- // Filename: Bard.scala // Authors: lgm // Creation: Wed May 27 17:12:47 2009 // Copyright: Not supplied // Description: // ------------------------------------------------------------------------ package net.liftweb.amqp; ...
leithaus/strategies
src/main/scala/net/liftweb/amqp/Bard.scala
Scala
cc0-1.0
4,694
package io.getquill.context.sql.norm import io.getquill.ast.FlatMap import io.getquill.ast.Join import io.getquill.ast.Map import io.getquill.ast.Query import io.getquill.ast.StatelessTransformer object MergeSecondaryJoin extends StatelessTransformer { override def apply(q: Query) = q match { case FlatMap(curr...
jcranky/quill
quill-sql/src/main/scala/io/getquill/context/sql/norm/MergeSecondaryJoin.scala
Scala
apache-2.0
1,061
/*列表是不可变的,值一旦被定义了就不能改变*/ object ListTest{ //字符串列表 val site1: List[String] = List("Runoob", "Google", "Baidu") val site2 = "Runoob" :: ("Google" :: ("Baidu" :: Nil)) //整型列表 val nums1: List[Int] = List(1, 2, 3, 4) val nums2 = 1 :: (2 :: (3 :: (4 :: Nil))) //二维列表 val dim1: List[L...
PengLiangWang/Scala
Collection/ListTest.scala
Scala
gpl-3.0
1,177
// Copyright: 2010 - 2018 https://github.com/ensime/ensime-server/graphs // License: http://www.gnu.org/licenses/gpl-3.0.en.html package org.ensime.indexer import java.nio.charset.Charset import scala.concurrent.duration._ import akka.testkit._ import org.apache.commons.vfs2._ import org.ensime.fixture._ import org.e...
yyadavalli/ensime-server
core/src/test/scala/org/ensime/indexer/FileWatcherSpec.scala
Scala
gpl-3.0
15,611
package spire.algebra import annotation.tailrec import scala.{specialized => spec} /** * Ring represents a set (A) that is a group over addition (+) and a monoid * over multiplication (*). Aside from this, the multiplication must distribute * over addition. * * Ring implements some methods (for example fromInt) ...
woparry/spire
core/src/main/scala/spire/algebra/Ring.scala
Scala
mit
1,133
/* * Copyright 2001-2016 Artima, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
dotty-staging/scalatest
scalactic-test/src/test/scala/org/scalactic/anyvals/NonZeroIntSpec.scala
Scala
apache-2.0
14,828
package org.apache.spark.streaming.talos.util object Utils { def md5(s: String): String = { val m = java.security.MessageDigest.getInstance("MD5") val b = s.getBytes("UTF-8") m.update(b, 0, b.length) new java.math.BigInteger(1, m.digest()).toString(16) } }
XiaoMi/galaxy-sdk-java
galaxy-talos-client/galaxy-talos-spark/src/main/scala/org/apache/spark/streaming/talos/util/Utils.scala
Scala
apache-2.0
280
/** * 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...
vidhyaarvind/kafka-mesos
src/scala/ly/stealth/mesos/kafka/Cluster.scala
Scala
apache-2.0
5,328
package de.fosd.typechef.crefactor.backend.codeselection import de.fosd.typechef.crefactor.Morpheus import de.fosd.typechef.crefactor.frontend.util.CodeSelection import de.fosd.typechef.parser.c._ import java.util.Collections import scala.collection.JavaConversions._ import scala.Some import de.fosd.typechef.crefactor...
joliebig/Morpheus
src/main/scala/de/fosd/typechef/crefactor/backend/codeselection/CExtractSelection.scala
Scala
lgpl-3.0
4,009
/******************************************************************************* * 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/inventory/PrimaryWeapon.scala
Scala
gpl-3.0
1,254
package com.github.vooolll.services import akka.http.scaladsl.model.StatusCodes import com.github.vooolll.base.{AsyncResourceSpec, TestUrls} class AsyncRequestServiceSpec extends AsyncResourceSpec { val asyncRequest = AsyncRequest() "Should send GET request" in { val responseContext = asyncRequest(TestUrls.a...
vooolll/facebook4s
src/test/scala/com/github/vooolll/services/AsyncRequestServiceSpec.scala
Scala
apache-2.0
682
package lila.video import play.api.libs.ws.StandaloneWSClient import play.api.Mode import com.softwaremill.macwire._ import io.methvin.play.autoconfig._ import play.api.Configuration import scala.concurrent.duration._ import lila.common.config._ @Module private class VideoConfig( @ConfigName("collection.video") ...
luanlv/lila
modules/video/src/main/Env.scala
Scala
mit
1,918
package org.scalamu.plugin import org.scalamu.common.filtering.{InverseRegexFilter, NameFilter} import org.scalamu.plugin.fixtures.IsolatedScalamuCompilerFixture import org.scalamu.plugin.mutators.controllflow.{NegateConditionals, NeverExecuteConditionals, ReplaceCaseWithWildcard} import org.scalamu.plugin.mutators.me...
sugakandrey/scalamu
scalac-plugin/src/test/scala/org/scalamu/plugin/ScalamuPluginSpec.scala
Scala
gpl-3.0
7,197
package demo import java.util.concurrent.Executors import doobie.imports._ import io.circe._ import io.circe.generic.auto._ import io.circe.java8.time._ import io.circe.parser._ import io.circe.syntax._ import org.http4s._ import org.http4s.circe._ import org.http4s.dsl._ import scalaz.concurrent.Task import scalaz....
fiadliel/http4s-talk
src/main/scala/DemoService.scala
Scala
mit
1,459
package com.scalaAsm.x86 package Instructions package General // Description: Conditional Move - less/not greater (SF!=OF) // Category: general/datamov trait CMOVL extends InstructionDefinition { val mnemonic = "CMOVL" } object CMOVL extends TwoOperands[CMOVL] with CMOVLImpl trait CMOVLImpl extends CMOVL { impl...
bdwashbu/scala-x86-inst
src/main/scala/com/scalaAsm/x86/Instructions/General/CMOVL.scala
Scala
apache-2.0
734
package org.cloudio.morpheus.dci.gambling.whist4.uses import org.morpheus._ import org.morpheus.Morpheus._ import org.cloudio.morpheus.dci.gambling.whist4.data._ import org.cloudio.morpheus.dci.gambling.objects._ import scala.util.Random /** * * Created by zslajchrt on 23/06/15. */ // objective roles @fragment tra...
zslajchrt/morpheus-tutor
src/main/scala/org/cloudio/morpheus/dci/gambling/whist4/uses/Whist.scala
Scala
apache-2.0
8,133
def map[B](f: A => B): Either[E, B] = this match { case Right(a) => Right(f(a)) case Left(e) => Left(e) } def flatMap[EE >: E, B](f: A => Either[EE, B]): Either[EE, B] = this match { case Left(e) => Left(e) case Right(a) => f(a) } def orElse[EE >: E, AA >: A](b: => Either[EE, AA]): Either[EE...
ud3sh/coursework
functional-programming-in-scala-textbook/answerkey/errorhandling/06.answer.scala
Scala
unlicense
517
package com.kakao.cuesheet.deps import java.io.{BufferedOutputStream, File, FileOutputStream, IOException} import java.net.{URL, URLDecoder} import java.nio.file.{Files, Paths} import java.util.zip.{ZipEntry, ZipOutputStream} import com.kakao.mango.io.FileSystems import com.kakao.mango.logging.Logging import com.kaka...
kakao/cuesheet
src/main/scala/com/kakao/cuesheet/deps/DependencyNode.scala
Scala
apache-2.0
2,901
/** * 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...
unix1986/universe
tool/kafka-0.8.1.1-src/core/src/main/scala/kafka/producer/ProducerTopicStats.scala
Scala
bsd-2-clause
2,485
package com.github.ldaniels528.trifecta.messages import com.github.ldaniels528.trifecta.TxConfig /** * Provides implementing classes with the capability of displaying binary messages */ trait BinaryMessaging { /** * Displays the contents of the given message * @param offset the offset of the given message ...
ldaniels528/trifecta
src/main/scala/com/github/ldaniels528/trifecta/messages/BinaryMessaging.scala
Scala
apache-2.0
2,741
package com.twitter.finagle.netty4.ssl.server import com.twitter.finagle.netty4.ssl.Netty4SslConfigurations import com.twitter.finagle.ssl.{ ApplicationProtocols, Engine, KeyCredentials, SslConfigurationException } import com.twitter.finagle.ssl.server.{SslServerConfiguration, SslServerEngineFactory} import co...
mkhq/finagle
finagle-netty4/src/main/scala/com/twitter/finagle/netty4/ssl/server/Netty4ServerSslConfigurations.scala
Scala
apache-2.0
4,072
package org.jetbrains.plugins.scala.lang.resolve2 class Scala29Test extends ResolveTestBase { override def folderPath: String = { super.folderPath + "scala29/" } def testSCL2913 = doTest def testSCL3212 = doTest }
triggerNZ/intellij-scala
test/org/jetbrains/plugins/scala/lang/resolve2/Scala29Test.scala
Scala
apache-2.0
229
package com.tribbloids.spookystuff.dsl import com.tribbloids.spookystuff.SpookyEnvFixture import com.tribbloids.spookystuff.utils.locality.PartitionIdPassthrough import com.tribbloids.spookystuff.utils.serialization.NOTSerializable import org.apache.spark.{HashPartitioner, TaskContext} import org.apache.spark.rdd.RDD ...
tribbloid/spookystuff
core/src/test/scala/com/tribbloids/spookystuff/dsl/GenPartitionerSuite.scala
Scala
apache-2.0
2,094
package hclu.hreg.dao import java.util.UUID import com.typesafe.scalalogging.LazyLogging import hclu.hreg.test.{DocTestHelpers, FlatSpecWithSql} import org.joda.time.{DateTime, DateTimeZone} import org.scalatest.Matchers import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.Future import ...
tsechov/hclu-registry
backend/src/test/scala/hclu/hreg/dao/DocDaoSpec.scala
Scala
apache-2.0
1,418
package org.jetbrains.plugins.scala.codeInsight.intention.types import com.intellij.codeInsight.completion.{InsertHandler, InsertionContext} import com.intellij.codeInsight.lookup._ import com.intellij.codeInsight.template.impl.TemplateManagerImpl import com.intellij.codeInsight.template.{Expression, ExpressionContext...
ilinum/intellij-scala
src/org/jetbrains/plugins/scala/codeInsight/intention/types/ChooseValueExpression.scala
Scala
apache-2.0
3,505
package models.audit import com.vividsolutions.jts.geom.{Coordinate, LineString} import java.sql.Timestamp import java.util.{UUID, Calendar, Date} import models.street.{StreetEdgeAssignmentCountTable, StreetEdge, StreetEdgeTable} import models.user.User import models.utils.MyPostgresDriver import models.utils.MyPostgr...
danZzyy/SidewalkWebpage
sidewalk-webpage/app/models/audit/AuditTaskTable.scala
Scala
mit
17,524
/* * Copyright 2011 WorldWide Conferencing, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable l...
lzpfmh/framework-2
persistence/mapper/src/test/scala/net/liftweb/mapper/MapperSpecsModel.scala
Scala
apache-2.0
11,828
/* * Copyright 2019 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...
nicf82/play-ui
src/main/twirl/uk/gov/hmrc/play/views/helpers/model.scala
Scala
apache-2.0
1,990
package com.karasiq.shadowcloud.actors.internal import scala.collection.mutable import scala.concurrent.Future import akka.event.Logging import akka.pattern.ask import com.karasiq.shadowcloud.ShadowCloudExtension import com.karasiq.shadowcloud.actors.{RegionIndex, StorageIndex} import com.karasiq.shadowcloud.actors....
Karasiq/shadowcloud
core/src/main/scala/com/karasiq/shadowcloud/actors/internal/RegionIndexTracker.scala
Scala
apache-2.0
7,374
/* Copyright 2009-2011 Jay Conrod * * This file is part of Tungsten. * * Tungsten 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 of * the License, or (at your option) any late...
jayconrod/tungsten
llvm/src/main/scala/tungsten/llvm/Module.scala
Scala
gpl-2.0
2,099
package controllers import java.time.OffsetDateTime import play.api.mvc.{Action, AnyContent} import controllers.sugar.Requests.AuthRequest import form.OreForms import ore.data.user.notification.NotificationType import ore.db.access.ModelView import ore.db.impl.OrePostgresDriver.api._ import ore.db.impl.schema.{Organ...
SpongePowered/Ore
ore/app/controllers/Reviews.scala
Scala
mit
10,219
/* * Copyright 2001-2013 Artima, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
SRGOM/scalatest
scalatest/src/main/scala/org/scalatest/DiagrammedAssertions.scala
Scala
apache-2.0
14,940
package actors import akka.actor.{Actor, Props} import play.api.libs.iteratee.Concurrent import play.api.libs.json.JsValue object WebSocketActor { def props(channel: Concurrent.Channel[JsValue]):Props = Props(new WebSocketActor(channel)) } class WebSocketActor(channel: Concurrent.Channel[JsValue]) extends Actor { ...
JetChat/JetChat
app/actors/WebSocketActor.scala
Scala
apache-2.0
382
package org.talend.jira.test import net.liftweb.json._ import scala.io.Source import org.talend.jira.internal.JiraParser import org.talend.jira.JiraIssue object TestParseLinkedIssues { val files = Array(("pmdq256.json", "PMDQ-256"), ("TDQ-9794.json", "TDQ-9794"), ("TDQ-10045.json", "TDQ-10045"), ("QAI-43445.json", ...
scorreia/jira-tools
src/test/scala/org/talend/jira/test/TestParseLinkedIssues.scala
Scala
apache-2.0
863
package com.github.usql import com.github.usql.ASTNode._ import com.github.kmizu.scomb import com.github.kmizu.scomb.{Result, SCombinator} import scala.util.matching.Regex import scala.collection.mutable /** * @author Kota Mizushima */ class Parser extends Pass[String, ASTNode.USQL] { private object USQLParse...
usql/usql
src/main/scala/com/github/usql/Parser.scala
Scala
mit
6,394
/* * 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 ...
alec-heif/MIT-Thesis
spark-bin/examples/src/main/scala/org/apache/spark/examples/ml/VectorAssemblerExample.scala
Scala
mit
1,798
/* Copyright (c) 2013-2016 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
KarolS/units
units/src/main/scala/io/github/karols/units/MUnit.scala
Scala
mit
2,090
package me.heaton.profun.week2.homework import org.scalatest.FunSuite import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner /** * This class is a test suite for the methods in object FunSets. To run * the test suite, you can either: * - run the "test" command in the SBT console * - right-click t...
SanCoder-Q/hello-scala
src/test/scala/me/heaton/profun/week2/homework/FunSetSuite.scala
Scala
mit
4,815
package com.taig.tmpltr.engine.html import com.taig.tmpltr._ import play.api.mvc.Content class table( val attributes: Attributes, val content: Content ) extends markup.table with Tag.Body[table, Content] object table extends Tag.Body.Appliable[table, Content]
Taig/Play-Tmpltr
app/com/taig/tmpltr/engine/html/table.scala
Scala
mit
263
/* * 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 ...
citlab/vs.msc.ws14
flink-0-7-custom/flink-examples/flink-scala-examples/src/main/scala/org/apache/flink/examples/scala/graph/TransitiveClosureNaive.scala
Scala
apache-2.0
3,623
package ark import scala.math.BigDecimal.double2bigDecimal import ark.TrapAlign._ case class Hit(val trap: Trap, val bonusMultiplier: BigDecimal = 0.0) { def align = trap.align def damage = trap.damage def elaborate = points(Elaborate) def sadistic = points(Sadistic) def humiliating = points(Humiliating) ...
lucaster/ark-calc
src/main/scala/ark/Hit.scala
Scala
mit
683
/* __ *\ ** ________ ___ / / ___ __ ____ Scala.js Benchmarks ** ** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister ** ** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ 2012, Google, Inc ** ** /____/\___/_/ |_/...
sjrd/scalajs-benchmarks
tracerFloat/shared/src/main/scala/org/scalajs/benchmark/tracer/RenderScene.scala
Scala
bsd-3-clause
2,204
import org.specs._ object MeetupSpec extends Specification { import dispatch._ import meetup._ import dispatch.liftjson.Js._ import oauth._ val conf = new java.io.File("meetup.test.properties") if (conf.exists) { val config = { val stm = new java.io.FileInputStream(conf) val props = new ja...
cmc333333/Databinder-Dispatch
meetup/src/test/scala/MeetupSpec.scala
Scala
lgpl-2.1
2,710
package orz.mongo.tochka.dsl private[tochka] class BoolField(protected val __prefix: String = "") extends Field { protected type FieldType = Boolean }
fkmt-disk/tochka
src/main/scala/orz/mongo/tochka/dsl/BoolField.scala
Scala
mit
162
/* * Copyright 2016 rdbc contributors * * 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...
rdbc-io/rdbc-pgsql
rdbc-pgsql-core/src/main/scala/io/rdbc/pgsql/core/internal/typecodec/sco/IgnoreSessionParams.scala
Scala
apache-2.0
941
package ru.dgolubets.reactjs.server.actors import java.io.File import java.nio.file.{Path, WatchEvent} import java.util.concurrent.Executors import scala.concurrent.duration._ import akka.actor.{Actor, ActorRef, Cancellable, Props} import akka.util.ByteString import better.files.{File => BetterFile} import ru.dgolube...
DGolubets/reactjs-server
src/main/scala/ru/dgolubets/reactjs/server/actors/SourcesMonitorActor.scala
Scala
mit
3,025
package net.danielkza.http2.api import akka.http.scaladsl.model.HttpHeader import scala.language.implicitConversions import akka.util.ByteString import akka.http.scaladsl.{model => akkaModel} sealed trait Header { def name: ByteString def value: ByteString def secure: Boolean } object Header extends { objec...
danielkza/h2scala
core/src/main/scala/net/danielkza/http2/api/Header.scala
Scala
apache-2.0
2,301
/** * Copyright (c) 2013, The National Archives <digitalpreservation@nationalarchives.gov.uk> * http://www.nationalarchives.gov.uk * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozi...
valydia/csv-validator
csv-validator-core/src/test/scala/uk/gov/nationalarchives/csv/validator/schema/v1_1/AnyRuleSpec.scala
Scala
mpl-2.0
2,272
package com.twitter.finagle.loadbalancer.aperture import com.twitter.finagle._ import com.twitter.finagle.loadbalancer.EndpointFactory import com.twitter.finagle.util.Rng import com.twitter.util._ import scala.collection.mutable private[loadbalancer] trait ApertureSuite { class Empty extends Exception /** * A...
koshelev/finagle
finagle-core/src/test/scala/com/twitter/finagle/loadbalancer/aperture/ApertureSuite.scala
Scala
apache-2.0
3,365
package com.phasmid.laScala.cache import akka.event.LoggingAdapter import com.phasmid.laScala.fp.FP import org.scalatest._ import org.scalatest.concurrent._ import scala.language.implicitConversions import scala.util._ /** * Created by scalaprof on 3/28/16. */ class CacheSpec extends FlatSpec with Matchers with...
rchillyard/LaScala
src/test/scala/com/phasmid/laScala/cache/CacheSpec.scala
Scala
lgpl-2.1
4,127
package scaredy.api import scaredy.data._ import scaredy.http.HttpClient import scaredy.utils.Opt import scala.concurrent.{ExecutionContext, Future} class Link(val client: HttpClient, val id: String)(implicit val ec: ExecutionContext) { import scaredy.utils.ResponseHelpers._ private implicit val _: HttpClient = c...
jjpatel/scaredy
src/main/scala/scaredy/api/Link.scala
Scala
mit
1,367
package io.coral.actors import io.coral.actors.Messages._ import scala.collection.immutable.SortedMap import akka.actor._ import scaldi.Injector class RuntimeActor(implicit injector: Injector) extends Actor with ActorLogging { def actorRefFactory = context var actors = SortedMap.empty[Long, ActorPath] var count...
daishichao/coral
runtime-api/src/main/scala/io/coral/actors/RuntimeActor.scala
Scala
apache-2.0
1,377
package provingground import HoTT._ import scalahott._ import org.scalatest._, flatspec._ import induction.implicits._ import provingground.library.{ DoubleEvenSym, LocalConstImpliesConstSym, SuccNOrNEvenSym } // import Fold._ import shapeless._ import NatRing._ import spire.math.SafeLong class InductionSpecSy...
siddhartha-gadgil/ProvingGround
mantle/src/test/scala/provingground/InductionSpecSym.scala
Scala
mit
1,785
package com.betfair.domain import play.api.libs.json.{Writes, Reads} object PriceData extends Enumeration { type PriceData = Value val SP_AVAILABLE, SP_TRADED, EX_BEST_OFFERS, EX_ALL_OFFERS, EX_TRADED = Value implicit val enumReads: Reads[PriceData] = EnumUtils.enumReads(PriceData) implicit def enumWrites: ...
city81/betfair-service-ng
src/main/scala/com/betfair/domain/PriceData.scala
Scala
bsd-2-clause
362
/* * Copyright (c) 2017 sadikovi * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, d...
sadikovi/riff
format/src/test/scala/com/github/sadikovi/riff/io/ByteBufferStreamSuite.scala
Scala
mit
2,465
import sbt._ object Dependencies { val _ScalaVersion_ = "2.11.7" val _SbtVersion_ = "0.13.8" //Versions private val _AkkaVersion_ = "2.4-M2" private val _AkkaStreamsVersion_ = "1.0" private val _JUnitVersion_ = "4.12" private val _PlayPluginsMailerVersion_ = "2.3.1" private val _ScalaJsDomV...
georgenicoll/monkey-barrel
old20150804/project/Dependencies.scala
Scala
gpl-2.0
2,030
package io.swagger.client.model import io.swagger.client.core.ApiModel import org.joda.time.DateTime case class VariableCategory ( /* id */ id: Option[Int], /* Name of the category */ name: String, /* Value for replacing null measurements */ fillingValue: Option[Float], /* Maximum recorded value of thi...
QuantiModo/QuantiModo-SDK-Akka-Scala
src/main/scala/io/swagger/client/model/VariableCategory.scala
Scala
gpl-2.0
1,478
/* sbt -- Simple Build Tool * Copyright 2010 Mark Harrah */ package sbt import complete.HistoryCommands import scala.annotation.tailrec import java.io.File import Path._ object BasicCommandStrings { val HelpCommand = "help" val Exit = "exit" val Quit = "quit" /** The command name to terminate the program.*/ ...
jamesward/xsbt
main/command/BasicCommandStrings.scala
Scala
bsd-3-clause
4,048
package proxy.protectedproxy object TestProtectionProxy extends App { val owner: Owner = new Owner() var reportGenerator: ReportGeneratorProxy = new ReportGeneratorProtectionProxy(owner) owner.setReportGenerator(reportGenerator) val employee: Employee = new Employee() reportGenerator = new ReportGenerato...
BBK-PiJ-2015-67/sdp-portfolio
exercises/week11/src/main/scala/proxy/protectedproxy/TestProtectionProxy.scala
Scala
unlicense
528
/* * 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 ...
chenc10/Spark-PAF
core/src/main/scala/org/apache/spark/broadcast/TorrentBroadcast.scala
Scala
apache-2.0
9,220
package com.localytics.sbt.s3 import java.io.File import java.net.URL import java.util.zip.ZipFile import sbt.Keys.TaskStreams import scala.sys.process._ import scala.util.Try object DownloadS3Proxy { private[s3] def validJar(file: File): Boolean = Try(new ZipFile(file)).isSuccess def apply(ver: String, url: ...
localytics/sbt-s3
src/main/scala/com/localytics/sbt/s3/DownloadS3Proxy.scala
Scala
mit
823
import api.{WebsiteApiConfig, WebsiteApi} import models.WebsiteDb import play.Play import play.api._ object Global extends GlobalSettings { override def onStart(app: Application): Unit = { val config = new play.Configuration(app.configuration) val websiteApiConfig : WebsiteApiConfig = WebsiteApiConfig(con...
jlcanela/fastcms
app/Global.scala
Scala
apache-2.0
1,228
package uk.ac.ncl.openlab.intake24.sql.tools import java.io.BufferedReader import java.io.InputStreamReader trait WarningMessage { def displayWarningMessage(message: String) = { val len = message.length() val bar = Seq.fill(len)('=').mkString println(bar) println(message) println(...
digitalinteraction/intake24
DatabaseTools/src/main/scala/uk/ac/ncl/openlab/intake24/sql/tools/WarningMessage.scala
Scala
apache-2.0
765
/* * Copyright 2014 - 2015 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 a...
wemrysi/quasar
core/src/main/scala/slamdata/engine/javascript/jscore.scala
Scala
apache-2.0
16,570
package lectures package algorithms import scala.annotation.tailrec sealed trait Conc[@specialized(Int, Long, Float, Double) +T] { def level: Int def size: Int def left: Conc[T] def right: Conc[T] def normalized = this } object Conc { case class <>[+T](left: Conc[T], right: Conc[T]) extends Conc[T] { ...
twistedgut/scala_coursera
parprog-snippets/src/main/scala/lectures/algorithms/Conc.scala
Scala
gpl-3.0
3,862
/* 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 law or agreed to in writing, software distr...
MansurAshraf/scalding
scalding-core/src/main/scala/com/twitter/scalding/typed/Sketched.scala
Scala
apache-2.0
4,970
package org.oneugene.log.play import java.time.Month import org.oneugene.log.model.{BDate, User} import org.openjdk.jmh.annotations.{Scope, State} @State(Scope.Benchmark) class TestConstants { var originalUser = User("Ievgenii", BDate(1978, Month.OCTOBER, 3)) var newName = "Test" var newYear = 1990 var newMo...
oneugene/evgeniy-portfolio
jmhtests/src/main/scala/org/oneugene/log/play/TestConstants.scala
Scala
mit
366
/* Copyright (c) 2017, Qvantel 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 of conditions and the following di...
qvantel/jsonapi-scala
core/src/test/scala/com/qvantel/jsonapi/PolyToOneSpec.scala
Scala
bsd-3-clause
14,232
package Tutorial import Chisel._ import Node._ import Literal._ import scala.collection.mutable.HashMap import scala.collection.mutable.ArrayBuffer class point_t extends Bundle { val x = UFix(width = 64) val y = UFix(width = 64) val z = UFix(width = 64) } class KEngineIO_t extends Bundle { val centeroidsFinished =...
seyedmaysamlavasani/GorillaPP
chisel/Gorilla++/emulator/src/k-means.scala
Scala
bsd-3-clause
901
/*********************************************************************** * Copyright (c) 2013-2018 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...
jahhulbert-ccri/geomesa
geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/conf/SchemaProperties.scala
Scala
apache-2.0
723
package org.apache.predictionio.examples.pfriendrecommendation import org.apache.spark.SparkContext._ import org.apache.spark.graphx._ import org.apache.spark.rdd.RDD import scala.collection.mutable.{ListBuffer, ArraySeq, HashSet} import scala.util.Random import scala.collection.mutable.HashSet import scala.collectio...
alex9311/PredictionIO
examples/experimental/scala-parallel-friend-recommendation/src/main/scala/Sampling.scala
Scala
apache-2.0
4,949
/* ************************************************************************************* * Copyright 2016 Normation SAS ************************************************************************************* * * This file is part of Rudder. * * Rudder is free software: you can redistribute it and/or modify * it under the...
armeniaca/rudder
rudder-templates-cli/src/main/scala/com/normation/templates/cli/TemplateCli.scala
Scala
gpl-3.0
13,592
package com.thetestpeople.trt.utils import org.apache.commons.validator.routines._ import org.joda.time.Duration import play.api.data._ import play.api.data.format.Formatter import play.api.data.validation._ import java.net.URI import com.thetestpeople.trt.model.Configuration object FormUtils { private lazy val du...
thetestpeople/trt
app/com/thetestpeople/trt/utils/FormUtils.scala
Scala
mit
2,119
package slick.jdbc import java.net.URI import java.sql.PreparedStatement import com.typesafe.config.ConfigException import scala.concurrent.Await import scala.concurrent.duration.Duration import scala.language.experimental.macros import scala.language.implicitConversions import scala.reflect.ClassTag import scala.re...
AtkinsChang/slick
slick/src/main/scala/slick/jdbc/StaticQuery.scala
Scala
bsd-2-clause
4,660
import sbt._ import Keys._ final class ReactiveMongo(scalacPlugin: Project) { self => import Dependencies._ import Format._ val reactiveResolvers = Seq( Resolver.typesafeRepo("snapshots"), Resolver.sonatypeRepo("snapshots")) lazy val generatedClassDirectory = settingKey[File]( "Directory where cl...
cchantep/acolyte
project/ReactiveMongo.scala
Scala
lgpl-2.1
2,909
def flatMap[A, B](ra: Reader[E, A])(k: A => Reader[E, B]): Reader[E, B] = Reader { e => val a = runReader(ra)(e) val rb = k(a) runReader(rb)(e) }
hmemcpy/milewski-ctfp-pdf
src/content/3.5/code/scala/snippet11.scala
Scala
gpl-3.0
161
package org.jetbrains.plugins.scala package project import com.intellij.openapi.roots.libraries.LibraryType import com.intellij.openapi.roots.libraries.ui.{LibraryPropertiesEditor, LibraryEditorComponent} import com.intellij.openapi.vfs.VirtualFile import com.intellij.openapi.project.Project import org.jetbrains.plugi...
triggerNZ/intellij-scala
src/org/jetbrains/plugins/scala/project/ScalaLibraryType.scala
Scala
apache-2.0
1,237
package com.nice.zoocache /** * Copyright (C) 2012 NICE Systems ltd. * <p/> * 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 * <p/> * http://www.apache.org/licenses/LICENSE-2.0 * <p/> *...
NiceSystems/zcache
src/test/scala/com/nice/zoocache/Test.scala
Scala
apache-2.0
798
/* Copyright 2017-19, Emmanouil Antonios Platanios. All Rights Reserved. * * 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 ...
eaplatanios/tensorflow_scala
modules/api/src/main/scala/org/platanios/tensorflow/api/ops/lookup/LookupTableTensorInitializer.scala
Scala
apache-2.0
2,254
package edu.utexas.cs.sdao.reyes.core import scala.math._ import edu.utexas.cs.sdao.reyes.anim.Animatable /** * Defines a 4x4 matrix. * @param data a 16-item array containing the matrix in row-major * order, i.e. indices 0-3 are the first row, 4-7 the second row, etc. */ class Matrix4(val data: Array[...
sdao/hugo-reyes
src/main/edu/utexas/cs/sdao/reyes/core/Matrix4.scala
Scala
mit
15,699
package org.cvogt.slick_mongo_light import scala.language.implicitConversions import org.cvogt.slick_mongo_light.expressions._ import org.cvogt.slick_mongo_light.dialect.Dialect class Evaluator[D <: Dialect](val js: D){ evaluator => def splitFields(field: String) = field.split("\\\\.").reverse.toList def nestFie...
cvogt/slick-mongo-light
src/main/scala/Evaluator.scala
Scala
bsd-2-clause
2,234
/* * 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 * distribute...
xerial/silk
silk-macros/src/main/scala/xerial/silk/macro/Ref.scala
Scala
apache-2.0
1,969
package poly.collection.mut import poly.collection._ /** * Represents a mutable priority queue. * @since 0.1.0 * @author Tongfei Chen */ trait PriorityQueue[T] extends Queue[T] { /** * Returns an iterable collection of the elements in this priority queue. * @note The elements are not guaranteed to be sor...
ctongfei/poly-collection
core/src/main/scala/poly/collection/mut/PriorityQueue.scala
Scala
mit
506
package io.github.rollenholt.application.center.base.model import java.util.Date import scala.beans.BeanProperty /** * @author rollenholt */ @SerialVersionUID(1L) class OperationLog() extends Serializable { @BeanProperty var id: Int = 0 @BeanProperty var applicationCode: String = _ @BeanProperty var opera...
rollenholt/application-center
src/main/scala/io/github/rollenholt/application/center/base/model/OperationLog.scala
Scala
gpl-2.0
577
package almond import almond.TestUtil.SessionRunner import almond.amm.AlmondPreprocessor import almond.kernel.KernelThreads import almond.util.SequentialExecutionContext import almond.util.ThreadUtil.{attemptShutdownExecutionContext, singleThreadedExecutionContext} import utest._ object EvaluatorTests extends TestSui...
alexarchambault/jupyter-scala
modules/scala/scala-interpreter/src/test/scala/almond/EvaluatorTests.scala
Scala
apache-2.0
3,781
/*********************************************************************** * Copyright (c) 2013-2019 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...
elahrvivaz/geomesa
geomesa-index-api/src/test/scala/org/locationtech/geomesa/index/geoserver/ViewParamsTest.scala
Scala
apache-2.0
2,073
package breeze.linalg import breeze.generic.UFunc import scala.reflect.ClassTag import spire.implicits._ import breeze.storage.Zero /** * split the array * * @author stucchio */ object split extends UFunc { implicit def implIntVec[T: ClassTag]: Impl2[DenseVector[T], Int, IndexedSeq[DenseVector[T]]] = { new...
claydonkey/breeze
math/src/main/scala/breeze/linalg/functions/split.scala
Scala
apache-2.0
4,623
import sbt._ import Keys._ import org.scalatra.sbt._ import org.scalatra.sbt.PluginKeys._ import com.earldouglas.xwp.JettyPlugin import com.mojolly.scalate.ScalatePlugin._ import com.typesafe.sbt.packager.archetypes.JavaAppPackaging import ScalateKeys._ object Quest_onBuild extends Build { val Organization = "com.le...
evotopid/quest_on
project/build.scala
Scala
apache-2.0
2,447
package org.jetbrains.plugins.scala package lang package psi package types import com.intellij.psi._ import com.intellij.psi.impl.PsiSubstitutorImpl import org.jetbrains.plugins.scala.extensions._ import org.jetbrains.plugins.scala.lang.psi.api.statements._ import org.jetbrains.plugins.scala.lang.psi.api.toplevel.type...
jastice/intellij-scala
scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/types/ScalaPsiTypeBridge.scala
Scala
apache-2.0
10,308
/* 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...
manishgupta88/carbondata
integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestCreateDDLForComplexMapType.scala
Scala
apache-2.0
16,868
package com.soundcloud.spdt import scala.math object Bin extends Pickling[Bin] { def pickle(b: Bin) = List(b.p, b.m).map(Formatting.formatDecimal(_)).mkString(",") def fromPickle(s: String): Bin = { val Array(p, m) = s.split(',').map(_.toDouble) Bin(p, m) } } case class Bin(p: Double, m: Double) ...
soundcloud/spdt
compute/src/main/scala/com.soundcloud.spdt/Histogram.scala
Scala
mit
6,791
/** * Copyright (C) 2007 Orbeon, Inc. * * 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 * 2.1 of the License, or (at your option) any later version. * * This prog...
orbeon/orbeon-forms
xforms-runtime/shared/src/main/scala/org/orbeon/oxf/xforms/control/Controls.scala
Scala
lgpl-2.1
23,712