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 2013-2016 the original author or 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 ap... | amuramatsu/Laika | core/src/test/scala/laika/tree/DocumentAPISpec.scala | Scala | apache-2.0 | 3,329 |
package org.jetbrains.plugins.scala.lang.psi.api.statements
import javax.swing.Icon
import com.intellij.psi.tree.IElementType
import org.jetbrains.plugins.scala.icons.Icons
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes.kVAR
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScBlock
import org.jetbra... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/psi/api/statements/ScVariable.scala | Scala | apache-2.0 | 1,124 |
package com.twitter.util
/**
* The Try type represents a computation that may either result in an exception
* or return a success value. It is analogous to the Either type but encodes
* common idioms for handling exceptional cases (such as rescue/ensure which
* is analogous to try/finally).
*/
object Try {
case... | luciferous/util | util-core/src/main/scala/com/twitter/util/Try.scala | Scala | apache-2.0 | 7,058 |
/*
Copyright (c) 2015, Robby, Kansas State University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions... | sireum/v3 | cli/jvm/src/main/scala/org/sireum/pilar/parser/Parser.scala | Scala | bsd-2-clause | 6,723 |
package io.mpjsons
import org.scalatest.FlatSpec
import org.scalatest.MustMatchers._
// For now singleton objects are not supported!
//class User(val name: String)
//
//case object UserMarcin extends User("Marcin")
//
//case object UserRegisterMessage
//
//class SingletonObjectSpec extends FlatSpec {
//
// "Serial... | marpiec/mpjsons | src/test/scala/io/mpjsons/SingletonObjectTest.scala | Scala | apache-2.0 | 1,150 |
package net.particlez
import scala.util.Random
/**
* A square shaped configuration where particle locations are described by integer vectors.
* The top left point of the configuration has coordinates (0,0,...,0) the bottom right point is represented by a limits vector provided.
* The configuration is filled by the... | bbiletskyy/particlez | src/main/scala/net/particlez/PosConfiguration.scala | Scala | apache-2.0 | 3,793 |
package lila.team
import org.joda.time.Period
import actorApi._
import akka.actor.ActorSelection
import lila.db.api._
import lila.hub.actorApi.forum.MakeTeam
import lila.hub.actorApi.timeline.{ Propagate, TeamJoin, TeamCreate }
import lila.user.tube.userTube
import lila.user.{ User, UserContext }
import tube._
final ... | ccampo133/lila | modules/team/src/main/TeamApi.scala | Scala | mit | 5,910 |
package org.akoshterek.backgammon.move
import org.akoshterek.backgammon.board.PositionClass
import org.akoshterek.backgammon.eval.Reward
/**
* @author Alex
* date 20.07.2015.
*/
object Move extends Ordering[Move] {
def compare(x: Move, y: Move): Int = {
if (x eq y) {
0
} else if (x.rSco... | akoshterek/MultiGammonJava | multi-gammon-core/src/main/java/org/akoshterek/backgammon/move/Move.scala | Scala | gpl-3.0 | 876 |
package utils
import java.text.DecimalFormat
import models.{Purse, PurseBalance, Transaction}
class AmountHelper {
def formatAmount(amount: Long): String = {
new DecimalFormat("#,###,###,##0").format(amount)
}
def formatSrcPurseAmount(transaction: Transaction): String =
formatTransactionPurse(transacti... | vatt2001/finprocessor | app/utils/AmountHelper.scala | Scala | mit | 814 |
/*
* 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 ... | lhfei/spark-in-action | spark-3.x/src/main/scala/org/apache/spark/examples/LogQuery.scala | Scala | apache-2.0 | 3,831 |
package lib
import com.amazonaws.services.simpleworkflow.model.ActivityType
import swarmize.Swarm
import swarmize.aws.SimpleWorkflowConfig
import swarmize.json.SubmittedData
import scala.concurrent.Future
trait Activity {
def name: String
def version: String
def activityType = new ActivityType().withName(name... | FreeSchoolHackers/swarmize | processor/app/lib/Activities.scala | Scala | apache-2.0 | 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 ... | mkolod/incubator-spark | yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterScheduler.scala | Scala | apache-2.0 | 2,323 |
package org.ffmmx.example.androidsqlite2.activity
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.HashMap
import scala.collection.mutable.Map
import org.ffmmx.example.androidsqlite2.R
import org.ffmmx.example.androidsqlite2.business.Note
import org.ffmmx.example.andro... | firefoxmmx2/AndroidSqlite | src/org/ffmmx/example/androidsqlite2/activity/NoteActivity.scala | Scala | apache-2.0 | 4,229 |
package io.youi.model
case class ImageInfo(center: Double, middle: Double, rotation: Double, scale: Double)
| outr/youi | core/shared/src/main/scala/io/youi/model/ImageInfo.scala | Scala | mit | 109 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
import sbt._
import scala.annotation.tailrec
import java.net.HttpURLConnection
import java.io.BufferedReader
import java.io.InputStreamReader
object DevModeBuild {
val ConnectTimeout = 10000
val ReadTimeout = 10000
def callFoo():... | rcavalcanti/lagom | dev/sbt-plugin/src/sbt-test/sbt-plugin/services-intra-communication/project/Build.scala | Scala | apache-2.0 | 1,300 |
package io.waylay.kairosdb.driver
import java.io.ByteArrayOutputStream
import java.util.zip.GZIPOutputStream
import io.waylay.kairosdb.driver.models._
import io.waylay.kairosdb.driver.models.HealthCheckResult._
import io.lemonlabs.uri.typesafe.dsl._
import com.typesafe.scalalogging.StrictLogging
import io.waylay.kair... | waylayio/kairosdb-scala | src/main/scala/io/waylay/kairosdb/driver/KairosDB.scala | Scala | mit | 7,819 |
package org.openurp.edu.eams.teach.schedule.web.action
import org.beangle.commons.collection.Collections
import org.beangle.commons.collection.Order
import org.beangle.data.jpa.dao.OqlBuilder
import org.beangle.commons.lang.BitStrings
import org.beangle.commons.lang.Strings
import org.beangle.commons.transfer.export... | openurp/edu-eams-webapp | schedule/src/main/scala/org/openurp/edu/eams/teach/schedule/web/action/ScheduleSearchAction.scala | Scala | gpl-3.0 | 4,849 |
package org.scalajs.jsenv
object NullJSConsole extends JSConsole {
def log(msg: Any): Unit = {}
}
| jmnarloch/scala-js | js-envs/src/main/scala/org/scalajs/jsenv/NullJSConsole.scala | Scala | bsd-3-clause | 101 |
/*
* Copyright (c) 2010 Thorsten Berger <[email protected]>
*
* 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 License, or
* (at your option) any late... | ckaestne/KBuildMiner | src/main/scala/gsd/buildanalysis/linux/PersistenceManager.scala | Scala | gpl-3.0 | 6,685 |
package tbox
import org.scalatest.FunSuite
class TBoxSpec extends FunSuite {
case class Foo(a : String)
object Foo {
implicit val Foo_ToJson : ToJson[Foo] = new ToJson[Foo] {
def toJson(foo : Foo) = s"""{"a":"${foo.a}"}"""
}
implicit val Foo_Show : Show[Foo] = new Show[Foo] {
... | ChrisNeveu/TBox | src/test/scala/TBoxTest.scala | Scala | bsd-3-clause | 2,253 |
/*
* Licensed to Tuplejump Software Pvt. Ltd. under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Tuplejump Software Pvt. Ltd. licenses this file
* to you under the Apache License, Version 2.0 (the
* "Li... | brenttheisen/calliope-public | src/main/scala/com/tuplejump/calliope/examples/Transformers.scala | Scala | apache-2.0 | 11,700 |
/*
* Licensed to STRATIO (C) under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. The STRATIO (C) licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this ... | ccaballe/spark-mongodb | spark-mongodb/src/main/scala/com/stratio/provider/schema/SchemaProvider.scala | Scala | apache-2.0 | 1,092 |
/*
* 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... | sgururajshetty/carbondata | integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/OffheapSort1TestCase.scala | Scala | apache-2.0 | 15,442 |
def takeWhile_1(f: A => Boolean): Stream[A] =
foldRight(empty[A])((h,t) =>
if (f(h)) cons(h,t)
else empty) | ud3sh/coursework | functional-programming-in-scala-textbook/answerkey/laziness/05.answer.scala | Scala | unlicense | 122 |
package vm.interpreter.impl
import ea.{NoEscape, ObjectNode}
import org.apache.bcel.generic.{BasicType, LDC, ReferenceType}
import sai.vm.{DontCare, Reference}
import vm.Frame
import vm.interpreter.{Id, InstructionInterpreter, InterpreterBuilder}
private[interpreter] object LdcInterpreter extends InterpreterBuilder[L... | oliverhaase/sai | src/sai/vm/interpreter/impl/LdcInterpreter.scala | Scala | mit | 1,010 |
package pl.writeonly.son2.apis.config
import com.fasterxml.jackson.annotation.JsonCreator
sealed abstract class WStyle(it: Boolean)
extends PartialFunction[Boolean, WStyle] {
override def isDefinedAt(x: Boolean): Boolean = x == it
override def apply(v1: Boolean): WStyle = this
override def toString: Strin... | writeonly/son2 | scallions-core/scallions-apis/src/main/scala/pl/writeonly/son2/apis/config/WStyle.scala | Scala | apache-2.0 | 629 |
/*
* Copyright 2016 agido GmbH
*
* 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... | agido/pageobject | examples/src/test/scala/org/pageobject/examples/angularjs/todo/TodoTemplates.scala | Scala | apache-2.0 | 735 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | matthughes/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/niocharset/UTF16Test.scala | Scala | bsd-3-clause | 5,984 |
/*
* 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-http/src/test/scala/io/gatling/http/WsCompileTest.scala | Scala | apache-2.0 | 3,098 |
/*
* Artificial Intelligence for Humans
* Volume 1: Fundamental Algorithms
* Scala Version
* http://www.aifh.org
* http://www.jeffheaton.com
*
* Code repository:
* https://github.com/jeffheaton/aifh
* Copyright 2013 by Jeff Heaton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you ma... | HairyFotr/aifh | vol1/scala-examples/src/main/scala/com/heatonresearch/aifh/general/fns/link/package.scala | Scala | apache-2.0 | 989 |
package gv
package isi
package convertible
trait Conversions extends ImplicitResolutionOrder.Conversions
| mouchtaris/jleon | src/main/scala-2.12/gv/isi/convertible/Conversions.scala | Scala | mit | 106 |
/*
* 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/test/scala/org/scalatest/fixture/WordSpecSpec.scala | Scala | apache-2.0 | 126,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 may ... | Sephiroth-Lin/incubator-carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/test/Spark2TestQueryExecutor.scala | Scala | apache-2.0 | 2,378 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala | Scala | apache-2.0 | 19,857 |
package ch.ethz.inf.da.tipstersearch.scoring
/**
* Abstract class representing a basic relevance model.
* It provdides access to useful functions.
*/
abstract class RelevanceModel {
/**
* Override this function to compute the score of given document and given query
*
* @param q... | rjagerman/TipsterSearch | src/main/scala/scoring/RelevanceModel.scala | Scala | mit | 1,006 |
package io.ubiqesh.uplink.disruptor.persistence.actions
import io.ubiqesh.uplink.vertx.event.StateChangeEvent
import io.ubiqesh.uplink.vertx.json.Node
import io.ubiqesh.uplink.persistence.Persistence
import org.vertx.java.core.json.JsonObject
class UpdateAction(private var persistence: Persistence) {
def handle(ev... | ubiqesh/ubiqesh | uplink/src/main/scala/io/ubiqesh/uplink/disruptor/persistence/actions/UpdateAction.scala | Scala | apache-2.0 | 838 |
import sbt._
//Taken from the xsbt sbt project. (that is, the build config used by the sbt source itself)
//I have modified this, of course.
trait Sxr extends BasicScalaProject {
val sxrConf = config("sxr") hide
val sxrDep = "org.scala-tools.sxr" %% "sxr" % "[0.2.7,)" % sxrConf.name jar()
def deepSources: Pa... | thomasmodeneis/jgo | src/project/build/Sxr.scala | Scala | gpl-3.0 | 1,326 |
/* Copyright 2009-2018 EPFL, Lausanne */
package inox
package transformers
trait Transformer {
val s: ast.Trees
val t: ast.Trees
type Env
lazy val deconstructor: ast.TreeDeconstructor {
val s: Transformer.this.s.type
val t: Transformer.this.t.type
} = s.getDeconstructor(t)
def transform(id: Ide... | romac/inox | src/main/scala/inox/transformers/Transformer.scala | Scala | apache-2.0 | 7,830 |
package io.flow.delta.actors
import akka.actor.{Actor, ActorSystem}
import db._
import io.flow.akka.SafeReceive
import io.flow.delta.api.lib.EventLogProcessor
import io.flow.delta.v0.models.{Build, StateForm}
import io.flow.log.RollbarLogger
import k8s.KubernetesService
import k8s.KubernetesService.toDeploymentName
i... | flowcommerce/delta | api/app/actors/K8sBuildActor.scala | Scala | mit | 3,211 |
package mesosphere.marathon
package core.task.jobs
import akka.actor.{ ActorRef, PoisonPill, Terminated }
import akka.event.LoggingAdapter
import akka.testkit.TestProbe
import mesosphere.AkkaUnitTest
import mesosphere.marathon.core.base.{ Clock, ConstantClock }
import mesosphere.marathon.core.condition.Condition
impor... | natemurthy/marathon | src/test/scala/mesosphere/marathon/core/task/jobs/ExpungeOverdueLostTasksActorTest.scala | Scala | apache-2.0 | 9,860 |
/*
* 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/ems | core/src/main/scala/org/beangle/ems/core/user/model/Role.scala | Scala | lgpl-3.0 | 1,735 |
package raft
import scala.language.postfixOps
import akka.actor.{ Actor, ActorRef/*, FSM, LoggingFSM*/ }
import scala.concurrent.duration._
import scala.concurrent.Promise
import math.random
import akka.actor.ActorSystem
import akka.actor.Props
import akka.worker._
/* messages */
sealed trait Message
case object Time... | jmnarloch/akka.js | akka-js-worker/raft/src/main/scala/raft/Raft.scala | Scala | bsd-3-clause | 13,490 |
/*
* 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 | sql/hive/src/test/scala/org/apache/spark/sql/hive/ParquetHiveCompatibilitySuite.scala | Scala | apache-2.0 | 5,393 |
abstract class Base {
def f: Int
val a = f // error
}
class Derived extends Base {
def f = g
private def g: Int = 30
}
class Derived2 extends Base {
val b = 30 // error
def f = g
def g: Int = b + a
} | som-snytt/dotty | tests/init/neg/override27.scala | Scala | apache-2.0 | 238 |
/*
* Copyright 2015 eleflow.com.br.
*
* 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 writin... | eleflow/sparknotebook | src/main/scala/eleflow/sparknotebook/Main.scala | Scala | apache-2.0 | 1,198 |
/*
* 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-jms/src/main/scala/io/gatling/jms/action/JmsAction.scala | Scala | apache-2.0 | 2,936 |
package scala.collection.parallel
import org.scalacheck._
import org.scalacheck.Gen
import org.scalacheck.Gen._
import org.scalacheck.Prop._
import org.scalacheck.Properties
import scala.collection._
import scala.collection.parallel._
abstract class ParallelMapCheck[K, V](collname: String) extends ParallelItera... | shimib/scala | test/scalacheck/scala/collection/parallel/ParallelMapCheck1.scala | Scala | bsd-3-clause | 811 |
package com.atomist.source.git.domain
import com.atomist.source.FileArtifact
private[git] case class FileWithBlobRef(fa: FileArtifact, ref: GitHubRef) | atomist/artifact-source | src/main/scala/com/atomist/source/git/domain/FileWithBlobRef.scala | Scala | gpl-3.0 | 152 |
/*
* Copyright 2012 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | netconstructor/zipkin | zipkin-hadoop/src/main/scala/com/twitter/zipkin/hadoop/FindDuplicateTraces.scala | Scala | apache-2.0 | 2,268 |
/*
* 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 ... | gioenn/xSpark | sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala | Scala | apache-2.0 | 21,070 |
package org.scalafmt.internal
import scala.meta.tokens.Token
import org.scalafmt.internal.Length.Num
import org.scalafmt.internal.Policy.NoPolicy
import org.scalafmt.util.TokenOps
case class OptimalToken(token: Token, killOnFail: Boolean = false)
/**
* A Split is the whitespace between two non-whitespace tokens.
... | Daxten/scalafmt | core/src/main/scala/org/scalafmt/internal/Split.scala | Scala | apache-2.0 | 3,418 |
package org.iainhull.resttest.driver
import com.sun.jersey.api.client.Client
import com.sun.jersey.api.client.ClientResponse
import com.sun.jersey.api.client.WebResource
import org.iainhull.resttest.Api
import org.iainhull.resttest.TestDriver
import scala.collection.JavaConverters
/**
* Provides the Jersey httpClien... | IainHull/resttest | src/main/scala/org/iainhull/resttest/driver/Jersey.scala | Scala | apache-2.0 | 2,799 |
package uk.co.turingatemyhamster.shortbol.pragma
import java.io.IOException
import org.scalajs.dom.raw.XMLHttpRequest
import scalaz._
import scalaz.Scalaz._
/**
*
*
* @author Matthew Pocock
*/
object Platform {
val cache = scala.collection.mutable.Map.empty[String, Throwable \\/ String]
def slurp(url:... | drdozer/shortbol | shortbol/core/js/src/main/scala/uk/co/turingatemyhamster/shortbol/pragma/Platform.scala | Scala | apache-2.0 | 1,027 |
package com.softwaremill.quicklens
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
case class Named(name: String)
case class Aged(age: Int)
case class Eithers(e: Either[Named, Aged])
case class MoreEithers(e1: Either[Eithers, MoreEithers], e2: Either[Eithers, MoreEithers])
... | adamw/quicklens | quicklens/src/test/scala/com/softwaremill/quicklens/ModifyEitherTest.scala | Scala | apache-2.0 | 2,576 |
package nest.sparkle.time.server
import java.io.{File, FileInputStream, FileOutputStream}
import java.nio.file.Path
import com.typesafe.config.Config
import scala.collection.JavaConverters._
import scala.concurrent.Future
import scala.concurrent.duration._
import spray.http.HttpHeaders.{RawHeader, _}
import spray.htt... | mighdoll/sparkle | protocol/src/main/scala/nest/sparkle/time/server/FileUploadHandler.scala | Scala | apache-2.0 | 3,395 |
package code
package snippet
import scala.xml.{NodeSeq, Text}
import net.liftweb.util._
import net.liftweb.common._
import java.util.Date
import code.lib._
import Helpers._
import net.liftweb.http._
import js._
class HelloWorld {
lazy val date: Box[Date] = DependencyFactory.inject[Date] // inject the date
// re... | saikitanabe/lidtest | src/main/scala/code/snippet/HelloWorld.scala | Scala | apache-2.0 | 721 |
package play.api.cache.redis.connector
import scala.concurrent.Future
import scala.concurrent.duration.Duration
import scala.reflect.ClassTag
/**
* Internal non-blocking Redis API implementing REDIS protocol
*
* Subset of REDIS commands, basic commands.
*
* @see https://redis.io/commands
*/
private[redis]... | KarelCemus/play-redis | src/main/scala/play/api/cache/redis/connector/RedisConnector.scala | Scala | mpl-2.0 | 19,919 |
/*
* Copyright (c) 2010 Pedro Matiello <[email protected]>
*
* Integration tests.
*
* These tests aim for checking the interaction between different parts of the framework.
*/
package pistache.integration
import pistache.runner.threaded.ThreadedRunner
import org.scalatest.Spec
import org.scalatest.matche... | pmatiello/pistache | test/pistache/integration/IntegrationTests.scala | Scala | mit | 2,511 |
package rpm4s.data
case class PayloadDigest(checksum: Checksum) | lucidd/rpm4s | shared/src/main/scala/rpm4s/data/PayloadDigest.scala | Scala | mit | 64 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.client
import akka.discovery.Lookup
import com.typesafe.config.ConfigFactory
import org.scalatest.Matchers
import org.scalatest.WordSpec
class ServiceNameMapperSpec extends WordSpec with Matchers {
private val d... | lagom/lagom | akka-service-locator/core/src/test/scala/com/lightbend/lagom/internal/client/ServiceNameMapperSpec.scala | Scala | apache-2.0 | 10,477 |
object O {
val x: Function1[String, String] = a => a
val x2: Function1[String, String] = a => "1"
}
| yusuke2255/dotty | tests/pos/i480.scala | Scala | bsd-3-clause | 104 |
/**
* This file is part of the "eidolon" project.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the LICENSE is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* For the full copyright and license informati... | eidolon/eidolon-scala | project/Dependencies.scala | Scala | mit | 1,499 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.tools.nsc.interp... | lrytz/scala | src/repl/scala/tools/nsc/interpreter/ExprTyper.scala | Scala | apache-2.0 | 4,288 |
package org.deepdive.inference
import akka.actor._
import scala.sys.process._
import scala.util.{Success, Failure}
/* Companion object for the Sampler actor. Use the props method to create a new Sampler */
object Sampler {
def props = Props[Sampler]
// Tells the Sampler to run inference
case class Run(samplerC... | dennybritz/deepdive | src/main/scala/org/deepdive/inference/Sampler.scala | Scala | apache-2.0 | 1,943 |
package health
import org.specs2.mutable._
import spray.testkit.Specs2RouteTest
import spray.http._
import StatusCodes._
import scala.concurrent.Future
class CheckerSpec extends Specification with Specs2RouteTest with Checker {
sequential
def actorRefFactory = system
var rawEndpointsOption: Option[String] = ... | ExpatConnect/health | src/test/scala/health/CheckerSpec.scala | Scala | mit | 1,910 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/gmp-frontend | test/helpers/RandomNino.scala | Scala | apache-2.0 | 1,706 |
package scalatags
package generic
import utest._
import TestUtil.strCheck
class ExampleTests[Builder, Output <: FragT, FragT](
bundle: Bundle[Builder, Output, FragT])
extends TestSuite {
val tests = TestSuite {
'manualImports - strCheck({
// bundle is scalatags.Text or scalatags.JsDom
impo... | tzbob/scalatags-hokko | modules/core/src/test/scala/scalatags/generic/ExampleTests.scala | Scala | mit | 17,540 |
/*
* 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 ... | u2009cf/spark-radar | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentile.scala | Scala | apache-2.0 | 12,987 |
package org.scaladebugger.api.profiles
import _root_.java.util.concurrent.ConcurrentHashMap
import _root_.java.util.concurrent.atomic.AtomicInteger
import com.sun.jdi.event.Event
import org.scaladebugger.api.lowlevel.events.EventType.EventType
import org.scaladebugger.api.lowlevel.events.data.JDIEventDataResult
impor... | ensime/scala-debugger | scala-debugger-api/src/main/scala/org/scaladebugger/api/profiles/RequestHelper.scala | Scala | apache-2.0 | 9,374 |
/*
* 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/selenium/WebBrowser.scala | Scala | apache-2.0 | 177,684 |
package hevs.especial.simulation
import hevs.especial.dsl.components.core.{Constant, Mux2, TickToggle}
import hevs.especial.dsl.components.target.stm32stk.Stm32stkIO
import hevs.especial.dsl.components.{bool, uint8}
import hevs.especial.generator.STM32TestSuite
/**
* Test case for the QEMU simulation.
* Use [[TickT... | hevs-isi/especial-frontend | src/test/scala/hevs/especial/simulation/Sch6SimCode.scala | Scala | mit | 1,483 |
package org.coursera.naptime.ari.graphql.schema
import com.linkedin.data.DataMap
import com.linkedin.data.schema.NamedDataSchema
import com.linkedin.data.schema.RecordDataSchema.{Field => RecordDataSchemaField}
import com.linkedin.data.schema.UnionDataSchema
import org.coursera.naptime.ari.graphql.SangriaGraphQlContex... | vkuo-coursera/naptime | naptime-graphql/src/main/scala/org/coursera/naptime/ari/graphql/schema/NaptimeUnionField.scala | Scala | apache-2.0 | 3,900 |
package dao.postgres.marshalling
import java.sql.{Connection, PreparedStatement, ResultSet}
import java.util.UUID
import dao.postgres.common.{ProcessTriggerRequestTable, TaskTriggerRequestTable}
import model.ProcessTriggerRequest
import util.JdbcUtil._
object ProcessTriggerRequestMarshaller {
def marshal(request:... | gilt/sundial | app/dao/postgres/marshalling/ProcessTriggerRequestMarshaller.scala | Scala | mit | 1,597 |
/**
* Copyright 2014 Gianluca Amato <[email protected]>
*
* This filteq is part of JANDOM: JVM-based Analyzer for Numerical DOMains
* JANDOM 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... | amato-gianluca/Jandom | core/src/test/scala/it/unich/jandom/objectmodels/ObjectModelSuite.scala | Scala | lgpl-3.0 | 12,724 |
package org.openmole.core.workflow.test
import org.openmole.core.context.Context
import org.openmole.core.workflow.builder.DefinitionScope
import org.openmole.core.workflow.task.ClosureTask
object TestTask {
def apply(f: Context ⇒ Context)(implicit name: sourcecode.Name, definitionScope: DefinitionScope) =
Clo... | openmole/openmole | openmole/core/org.openmole.core.workflow/src/main/scala/org/openmole/core/workflow/test/TestTask.scala | Scala | agpl-3.0 | 370 |
package com.scout24.pipedsl.model
class S3DataNode(id : String, path : FileOrDirectoryPath, sched : Schedule)
extends DataNode(id, "S3DataNode")
{
path match {
case FilePath(path) => addValueField("filePath", path)
case DirectoryPath(path) => addValueField("directoryPath", path)
case ManifestFilePath(... | matey-jack/pipe-dsl | src/main/scala/com/scout24/pipedsl/model/S3DataNode.scala | Scala | gpl-2.0 | 684 |
package chandu0101.scalajs.react.components
package materialui
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import japgolly.scalajs.react.raw.React
import japgolly.scalajs.react.vdom.{VdomElement, VdomNode}
import scala.scalajs.js
import scala.scalajs.js.`|`
/**
* This file is generated - ... | rleibman/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/materialui/MuiTab.scala | Scala | apache-2.0 | 5,474 |
package com.github.gigurra.glasciia
import scala.concurrent.ExecutionContext
/**
* Created by johan on 2017-01-04.
*/
object SameThreadExecutionContext extends ExecutionContext {
override def execute(runnable: Runnable): Unit = runnable.run()
override def reportFailure(cause: Throwable): Unit = throw cause
}
| GiGurra/glasciia | glasciia-core/src/main/scala/com/github/gigurra/glasciia/SameThreadExecutionContext.scala | Scala | mit | 320 |
package net.mentalarray.doozie.PigSupport
import java.util.UUID
import scala.concurrent.Promise
/**
* Created by kdivincenzo on 2/18/15.
*/
protected[PigSupport] class PigWorkItem(task: PigTask) {
// The work ID
private val workId = UUID.randomUUID
def id : UUID = workId
// The PigTask
def pigTask = ta... | antagonist112358/tomahawk | workflow-engine/src/net/mentalarray/doozie/PigSupport/PigWorkItem.scala | Scala | apache-2.0 | 663 |
//https://www.hackerrank.com/challenges/stocks-prediction
object StocksPrediction extends App {
case class Query(d: Int, m: Int)
import scala.collection.mutable.{HashMap ⇒ MMap}
val cache = MMap[Query, Int]() // let's cache prev results
// reading inputs like this is faster than following io.Source.stdin.getLin... | flopezlasanta/hackerrank | src/functional_programming/functional_structures/StocksPrediction.scala | Scala | mit | 1,066 |
/*
* Copyright (C) 2010-2014 GRNET S.A.
*
* 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 License, or
* (at your option) any later version.
*
* This program is di... | grnet/snf-cdmi | src/main/scala/gr/grnet/cdmi/service/StdCdmiPithosServer.scala | Scala | gpl-3.0 | 28,506 |
package models
import org.specs2.mutable._
import anorm._
import anorm.SqlParser
import play.api.test._
import play.api.test.Helpers._
import helpers.InjectorSupport
import play.api.Application
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.db.Database
import java.time.Instant
class UserAddress... | ruimo/store2 | test/models/UserAddressSpec.scala | Scala | apache-2.0 | 2,525 |
/*
* Copyright (c) 2012 Crown Copyright
* Animal Health and Veterinary Laboratories Agency
*
* 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.apach... | tsaratoon/Sampler | sampler-core/src/main/scala/sampler/data/EmpiricalSeq.scala | Scala | apache-2.0 | 2,155 |
/*
* 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 ... | yew1eb/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/SortUtil.scala | Scala | apache-2.0 | 7,093 |
/*
* 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 t... | cogitate/twitter-zipkin-uuid | zipkin-common/src/main/scala/com/twitter/zipkin/storage/util/SpanStoreValidator.scala | Scala | apache-2.0 | 9,947 |
/*
* 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 ... | caneGuy/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala | Scala | apache-2.0 | 8,790 |
package gsn.data.rdf
import gsn.data._
import com.hp.hpl.jena.rdf.model.Model
import com.hp.hpl.jena.rdf.model.ModelFactory
import gsn.vocab.Ssn
import com.hp.hpl.jena.vocabulary.RDF
import com.hp.hpl.jena.vocabulary.RDFS
import com.hp.hpl.jena.vocabulary.DCTerms
import gsn.vocab.Qu
import com.hp.hpl.jena.rdf.model.Re... | TheCroak/gsn | gsn-tools/src/main/scala/gsn/data/rdf/SsnModel.scala | Scala | gpl-3.0 | 1,203 |
trait ElementSeed {
val elementType: String
def buildLayer(height, width, scale)
}
| KeithCissell/SCOUt | THESIS/Latex-Template/tex/codes/ElementSeed.scala | Scala | mit | 87 |
package com.bolour.boardgame.scala.server.service
import spray.json._
import com.bolour.boardgame.scala.server.domain.{Game, Player}
import com.bolour.util.scala.common.CommonUtil.ID
import com.bolour.boardgame.scala.server.domain.json.CaseClassFormats._
import com.bolour.boardgame.scala.server.service.json.CaseClassF... | azadbolour/boardgame | scala-server/app/com/bolour/boardgame/scala/server/service/GamePersisterJsonBridge.scala | Scala | agpl-3.0 | 2,354 |
package com.twitter.inject.thrift.filtered_integration.http_server
import com.twitter.finatra.http.HttpServer
import com.twitter.finatra.http.filters.CommonFilters
import com.twitter.finatra.http.routing.HttpRouter
import com.twitter.inject.thrift.ThriftClientIdModule
class GreeterHttpServer extends HttpServer {
ov... | joecwu/finatra | inject/inject-thrift-client/src/test/scala/com/twitter/inject/thrift/filtered_integration/http_server/GreeterHttpServer.scala | Scala | apache-2.0 | 575 |
package gh2011.models
case class SHA(id: Option[String], mail: Option[String], message: Option[String])
| mgoeminne/github_etl | src/main/scala/gh2011/models/SHA.scala | Scala | mit | 105 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/play-auditing | src-common/main/scala/uk/gov/hmrc/audit/serialiser/AuditSerialiser.scala | Scala | apache-2.0 | 2,262 |
package spgui.widgets.services
import java.util.UUID
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.html_<^._
import spgui.communication._
import sp.domain._
import sp.domain.Logic._
object ServiceListWidget {
case class State(services: List[APISP.StatusResponse])
private class Backend($: Ba... | kristoferB/SP | gui/src/main/scala/spgui/widgets/services/ServiceListWidget.scala | Scala | mit | 2,701 |
package models.data
import scalikejdbc._
case class Approver(id: Long, name: String, email: String)
object Approver extends SQLSyntaxSupport[Approver] {
override val tableName = "approver"
def apply(a: ResultName[Approver])(rs: WrappedResultSet): Approver =
new Approver(rs.long(a.id), rs.string(a.name), rs.st... | codingteam/loglist | scalajvm/app/models/data/Approver.scala | Scala | mit | 337 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/util/control/Exception.scala | Scala | bsd-3-clause | 14,641 |
package com.workingtheory.scala
import org.apache.logging.log4j.{LogManager, Logger}
/**
* This class demonstrates 'how to write main method' in Scala and print a hello world.
*
* Unfortunately, Scala doesn't support class level 'static' variables or methods.
* Instead, it has a concept of 'object' to hold al... | kedar-joshi/baby-steps | hello-scala/src/main/scala/com/workingtheory/scala/HelloWorld.scala | Scala | apache-2.0 | 1,108 |
package co.blocke.scalajack
package typeadapter
import model._
import co.blocke.scala_reflection.impl.Clazzes._
import co.blocke.scala_reflection.info._
import co.blocke.scala_reflection.impl.PrimitiveType
import co.blocke.scala_reflection._
import scala.collection.mutable
object PermissiveBigDecimalTypeAdapterFactor... | gzoller/ScalaJack | core/src/main/scala/co.blocke.scalajack/typeadapter/PermissiveScalaPrimitives.scala | Scala | mit | 7,267 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogx/platform/opencl/OpenCLAbstractKernel.scala | Scala | apache-2.0 | 8,546 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | common/src/main/scala/com/precog/common/security/APIKeyManager.scala | Scala | agpl-3.0 | 7,576 |
/*
* Copyright (c) 2014-2015 by its authors. Some rights reserved.
* See the project homepage at: http://www.monifu.org
*
* 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://... | sergius/monifu | core/shared/src/main/scala/monifu/concurrent/cancelables/SingleAssignmentCancelable.scala | Scala | apache-2.0 | 3,279 |
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.