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 |
|---|---|---|---|---|---|
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | accounts/src/main/scala/com/precog/accounts/ResetToken.scala | Scala | agpl-3.0 | 1,804 |
package org.jetbrains.plugins.scala
package annotator.template
import org.jetbrains.plugins.scala.annotator.{AnnotatorTestBase, Error}
/**
* @author Alefas
* @since 17.10.12
*/
class NeedsToBeMixinTest extends AnnotatorTestBase(NeedsToBeMixin) {
def testProblem() {
val Message = NeedsToBeMixin.message (
... | LPTK/intellij-scala | test/org/jetbrains/plugins/scala/annotator/template/NeedsToBeMixinTest.scala | Scala | apache-2.0 | 987 |
package com.twitter.finagle.partitioning
/**
* Provides hashing key information of the [[com.twitter.hashing.HashNode]]s
* on consistent-hashing hash ring.
*/
sealed trait HashNodeKey {
/** HashNode hashing key identifier, either "host:port" or custom format. */
def identifier: String
}
/**
* Constructs Hash... | twitter/finagle | finagle-partitioning/src/main/scala/com/twitter/finagle/partitioning/HashNodeKey.scala | Scala | apache-2.0 | 1,105 |
package annotation
import org.springframework.beans.factory.BeanFactory
import org.springframework.context.support.ClassPathXmlApplicationContext
object HelloWorldSpringWithAnnotation extends App {
@throws(classOf[Exception])
val factory: BeanFactory = getBeanFactory
val mr: MessageRenderer = factory.getBean("r... | BBK-PiJ-2015-67/sdp-portfolio | exercises/week02/springdi_scala/src/annotation/HelloWorldSpringWithAnnotation.scala | Scala | unlicense | 506 |
/*
* Copyright (c) 2014 Ben Whitehead.
*
* 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 ... | BenWhitehead/finch-server | src/main/scala/io/github/benwhitehead/finch/JacksonWrapper.scala | Scala | apache-2.0 | 2,105 |
/*
* 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 ... | chgm1006/spark-app | src/main/scala/org/apache/spark/examples/sql/UserDefinedUntypedAggregation.scala | Scala | apache-2.0 | 4,212 |
package controllers
import org.specs2.specification.Scope
import scala.concurrent.Future
import com.overviewdocs.messages.DocumentSetCommands
import com.overviewdocs.models.{DocumentCloudImport,DocumentSet}
import com.overviewdocs.test.factories.{PodoFactory=>factory}
import controllers.backend.DocumentSetBackend
imp... | overview/overview-server | web/test/controllers/DocumentCloudImportJobControllerSpec.scala | Scala | agpl-3.0 | 2,549 |
package traits
trait T/*<-traits::T#*/ {
def x/*<-traits::T#x().*/ = 2
}
sealed trait U/*<-traits::U#*/
object U/*<-traits::U.*/ {
def u/*<-traits::U.u().*/: U/*->traits::U#*/ = new U/*->traits::U#*/ {}
}
class C/*<-traits::C#*/
trait V/*<-traits::V#*/ { self/*<-local1*/: C/*->traits::C#*/ =>
}
| som-snytt/dotty | tests/semanticdb/expect/Traits.expect.scala | Scala | apache-2.0 | 303 |
package co.s4n
object Main extends App {
println(Calculadora.sumar(1, 2))
println(Calculadora.multiplicar(1, 2))
println(Calculadora.potenciar(1, 2))
println(Calculadora.restar(1, 2))
println(Calculadora.dividir(1, 2))
println("Hello world!")
def method01: String = "Hello world!"
}
| sanllanta/scala-test | src/main/scala/co/s4n/Main.scala | Scala | unlicense | 300 |
package nvim.internal
import msgpack4z._
import msgpack4z.CodecInstances.all._
import nvim.UnexpectedResponse
final case class Request(tpe: Int, id: Int, name: String, params: MsgpackUnion = MsgpackUnion.array(List())) {
override def toString = {
val sb = new StringBuilder
sb.append("Request(\\n")
sb.ap... | sschaef/tooling-research | nvim/src/main/scala/nvim/internal/Protocol.scala | Scala | mit | 3,912 |
package ru.pravo.qa.gatling.remote
import java.io.File
import net.schmizz.sshj.SSHClient
import net.schmizz.sshj.common.IOUtils
import net.schmizz.sshj.transport.verification.PromiscuousVerifier
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.{Future, blocking}
object SSHHelper {
... | Pravoru/gatling-remote-sbt | src/main/scala/ru/pravo/qa/gatling/remote/SSHHelper.scala | Scala | mit | 1,177 |
//traits são como as interfaces.
// Porém, eles podem ter implementações próprias.
// Classes poder extender vários traits
trait Greeter{
def imprimir(msg : String) : Unit = println(msg)
}
//SimpleGreeter implementa o comportamento de Greeter
class SimpleGreeter(str: String) extends Greeter{
def imprimir1(): Unit ... | luisgandrade/Aprendendo_Scala | src/main/scala/Basics.scala | Scala | mit | 2,488 |
object App {
trait Nat
case object Zero extends Nat
case class Succ[N <: Nat](n: N) extends Nat
inline def toInt(n: => Nat): Int = inline n match {
case Zero => 0
case Succ(n1) => toInt(n1) + 1
}
val natTwo = toInt(Succ(Succ(Zero)))
}
| som-snytt/dotty | tests/pos/scala-days-2019-slides/metaprogramming-1-match.scala | Scala | apache-2.0 | 259 |
package smtlib
package common
import org.scalatest.FunSuite
class BinaryTests extends FunSuite {
test("toIntBits works with one bit") {
assert(Binary(List(true)).toIntBits === 1)
assert(Binary(List(false)).toIntBits === 0)
}
test("toIntBits works with a few bits") {
assert(Binary(List(true, true))... | colder/scala-smtlib | src/test/scala/smtlib/common/BinaryTests.scala | Scala | mit | 2,290 |
package models
import scalikejdbc.DBSession
case class Account(id: AccountId, name: String, hashedPassword: String) {
}
object Account {
def findById(id: AccountId)(implicit session: DBSession): Option[Account] = Some(Account(1, "test", "test"))
}
| xuwei-k/stackable-controller | sample/app/models/Account.scala | Scala | apache-2.0 | 256 |
/**
* This file is part of mycollab-scheduler.
*
* mycollab-scheduler 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.
*
* mycol... | maduhu/mycollab | mycollab-scheduler/src/main/scala/com/esofthead/mycollab/schedule/email/project/service/ProjectTaskRelayEmailNotificationActionImpl.scala | Scala | agpl-3.0 | 13,098 |
/** Copyright 2015 TappingStone, 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 ... | alex9311/PredictionIO | data/src/main/scala/org/apache/predictionio/data/api/EventServerPluginContext.scala | Scala | apache-2.0 | 1,765 |
/*
* 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 ... | mylog00/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/calls/FunctionGenerator.scala | Scala | apache-2.0 | 20,782 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | mahak/spark | mllib/src/main/scala/org/apache/spark/ml/feature/VectorSlicer.scala | Scala | apache-2.0 | 7,403 |
import scala.xml._
import scala.xml.transform._
val namespaceStrippingRewriteRule = new RewriteRule {
override def transform(n: Node) = n match {
case Elem(prefix, label, attributes, scope, children@_*) =>
Elem(prefix, /*start*/label/*end*/, attributes, TopScope, transform(children): _*)
case x => x
... | ilinum/intellij-scala | testdata/typeInference/bugs5/SCL3817.scala | Scala | apache-2.0 | 407 |
package com.github.pheymann.scala.bft.messaging
import cats.data.Xor
import scala.util.control.NonFatal
object RequestStream {
final case class RequestStreamState(sequenceNumber: Long) {
val chunks = collection.mutable.Queue[Array[Byte]]()
}
def generateChunks(delivery: RequestDelivery, chunkSize: Int)... | pheymann/scala.bft | bft-replica/src/main/scala/com/github/pheymann/scala/bft/messaging/RequestStream.scala | Scala | mit | 928 |
package scala.util
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Test
import org.junit.Assert._
/* Test Try's withFilter method, which was added along with the fix for scala/bug#6455 */
@RunWith(classOf[JUnit4])
class TryTest {
@Test
def withFilterFail(): Unit = {
val fail ... | martijnhoekstra/scala | test/junit/scala/util/TryTest.scala | Scala | apache-2.0 | 872 |
// Copyright (C) 2011-2012 the original author or authors.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You ... | chrisjwwalker/cjww-diagnostics | app/controllers/IndexController.scala | Scala | apache-2.0 | 826 |
import types.{MalList, _list_Q, MalVector, MalHashMap, MalFunction}
import env.Env
object step3_env {
// read
def READ(str: String): Any = {
reader.read_str(str)
}
// eval
def eval_ast(ast: Any, env: Env): Any = {
ast match {
case s : Symbol => env.get(s)
case v: MalVector => v.map(E... | h3rald/mal | scala/step3_env.scala | Scala | mpl-2.0 | 2,546 |
package sangria.schema
import sangria.ast.{
AstLocation,
Document,
NamedType,
NotNullType,
ObjectTypeDefinition,
ObjectTypeExtensionDefinition,
UnionTypeDefinition,
UnionTypeExtensionDefinition
}
import sangria.execution._
import sangria.introspection
import sangria.marshalling.{CoercedScalaResultMars... | OlegIlyenko/sangria | modules/core/src/main/scala/sangria/schema/SchemaValidationRule.scala | Scala | apache-2.0 | 25,984 |
package is.solidninja
package openshift
package client
import java.nio.file.{Files, Paths}
import io.circe._
import cats.effect._
import cats.implicits._
import org.http4s.client.blaze.{BlazeClientConfig, PooledHttp1Client}
import org.scalatest.{FreeSpec, Matchers}
import is.solidninja.openshift.client.impl.OAuthClus... | solidninja/openshift-scala-api | src/test/scala/is/solidninja/openshift/client/LocalClusterOpenshiftClientTest.scala | Scala | mit | 2,933 |
/*
* RunningWindowSum.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.fscape
pac... | Sciss/FScape-next | core/shared/src/main/scala/de/sciss/fscape/graph/RunningWindowSum.scala | Scala | agpl-3.0 | 2,239 |
/*
* Copyright 2016 OSBI 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 applicable law or agreed to in writ... | OSBI/meteorite-core | api/src/main/scala/bi/meteorite/core/api/objects/MeteoriteRole.scala | Scala | apache-2.0 | 1,334 |
package com.twitter.querulous.unit
import com.twitter.querulous._
import java.util.concurrent.{CountDownLatch, TimeUnit}
import java.sql.Connection
import com.twitter.querulous.database.{SqlDatabaseTimeoutException, TimingOutDatabase}
import com.twitter.querulous.test.FakeDatabase
import compat.Platform
import scala.c... | kievbs/querulous210 | src/test/scala/com/twitter/querulous/unit/TimingOutDatabaseSpec.scala | Scala | apache-2.0 | 1,639 |
/*
* 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 ... | eyalfa/spark | resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/KubernetesConfSuite.scala | Scala | apache-2.0 | 8,836 |
package org.apache.activemq.apollo.broker.store.leveldb
/**
* 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 th... | chirino/activemq-apollo | apollo-leveldb/src/test/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStoreTest.scala | Scala | apache-2.0 | 1,294 |
package calc
/**
* Aaron, Calvin, David, and Peter each live in one of 4 adjacent townhouses in a row, each of a single color.
* Each owns one pet and imbibes one kind of drink.
*
* Aaron owns the dog.
* The bird lives in the red house.
* Calvin lives in the blue house.
* David does not live in the red h... | ebowman/calc | src/main/scala/calc/Calc23.scala | Scala | unlicense | 4,099 |
package com.krux.hyperion.precondition
import com.krux.hyperion.adt.HString
import com.krux.hyperion.aws.AdpDynamoDBDataExistsPrecondition
import com.krux.hyperion.common.{ BaseFields, PipelineObjectId }
import com.krux.hyperion.HyperionContext
/**
* A precondition to check that data exists in a DynamoDB table.
*
... | hoangelos/hyperion | core/src/main/scala/com/krux/hyperion/precondition/DynamoDBDataExistsPrecondition.scala | Scala | apache-2.0 | 1,497 |
/* sbt -- Simple Build Tool
* Copyright 2010 Mark Harrah
*/
package sbt
import java.io.PrintWriter
import java.io.File
import LogManager._
import std.Transform
import Def.ScopedKey
import Scope.GlobalScope
import BasicKeys.explicitGlobalLogLevels
import Keys.{ logLevel, logManager, persistLogLevel, persistTraceLevel... | mdedetrich/sbt | main/src/main/scala/sbt/LogManager.scala | Scala | bsd-3-clause | 6,068 |
/* package biology.fish
import com.github.nscala_time.time.Imports._
import locals._
import maths.ContinuousRange
import org.mockito.Mockito._
import org.scalatestplus.mockito.MockitoSugar
import org.scalatest.{FlatSpec, PrivateMethodTester}
import physical.GeoCoordinate
import physical.habitat.GeometryAdaptor
import ... | shawes/zissou | src/test/scala/biology/fish/FishTest.scala | Scala | mit | 10,898 |
package chessagents
import akka.actor.Actor
import akka.actor.Props
import akka.actor.ActorRef
import akka.pattern.ask
import akka.util.Timeout
import scala.concurrent.{Await, Future}
import scala.concurrent.duration._
import scala.util.control.Breaks
import Array._
import chessagents.protocols.PlayerPiecesProtocol.... | m-kostrzewa/ChessAgents | src/chessagents/GameController.scala | Scala | mit | 19,649 |
package mesosphere.marathon
package core.deployment
import com.wix.accord._
import mesosphere.UnitTest
import mesosphere.marathon.core.instance.TestInstanceBuilder
import mesosphere.marathon.state.PathId._
import mesosphere.marathon.state.VersionInfo._
import mesosphere.marathon.state._
import mesosphere.marathon.test... | janisz/marathon | src/test/scala/mesosphere/marathon/core/deployment/DeploymentPlanTest.scala | Scala | apache-2.0 | 21,302 |
/*
* Happy Melly Teller
* Copyright (C) 2013, Happy Melly http://www.happymelly.com
*
* This file is part of the Happy Melly Teller.
*
* Happy Melly Teller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundatio... | cvogt/teller | app/views/Countries.scala | Scala | gpl-3.0 | 9,044 |
/*
* Copyright 2017 Radek Gruchalski
*
* 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 agree... | radekg/kafka-cluster-tools | src/test/scala/com/gruchalski/kafka/test/SerializersTest.scala | Scala | apache-2.0 | 5,669 |
/*
* Ported from https://github.com/junit-team/junit
*/
package org.junit.function
trait ThrowingRunnable {
def run(): Unit
}
| scala-js/scala-js | junit-runtime/src/main/scala/org/junit/function/ThrowingRunnable.scala | Scala | apache-2.0 | 131 |
package mesosphere.mesos.simulation
import java.util
import akka.actor.{ ActorRef, ActorSystem, Props }
import com.typesafe.config.{ Config, ConfigFactory }
import org.apache.mesos.Protos._
import org.apache.mesos.SchedulerDriver
import org.slf4j.LoggerFactory
import scala.collection.JavaConversions._
/**
* The f... | Kosta-Github/marathon | mesos-simulation/src/main/scala/mesosphere/mesos/simulation/SimulatedDriver.scala | Scala | apache-2.0 | 3,974 |
/*
* 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 ... | aokolnychyi/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala | Scala | apache-2.0 | 54,941 |
package io.buoyant.namerd.iface
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.{Namer, Path, Stack, ThriftMux}
import com.twitter.finagle.naming.NameInterpreter
import com.twitter.finagle.param
import com.twitter.scrooge.ThriftService
import... | pawelprazak/linkerd | namerd/iface/interpreter-thrift/src/main/scala/io/buoyant/namerd/iface/ThriftInterpreterInterfaceConfig.scala | Scala | apache-2.0 | 2,884 |
/*
* Copyright 2014 Databricks
*
* 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... | databricks/spark-avro | src/main/scala/com/databricks/spark/avro/DefaultSource.scala | Scala | apache-2.0 | 10,223 |
/**
* 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... | eribeiro/kafka | core/src/main/scala/kafka/coordinator/GroupCoordinator.scala | Scala | apache-2.0 | 36,252 |
/**
* Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.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
*
*... | Tjoene/thesis | Case_Programs/gatling-1.4.0/gatling-http/src/main/scala/com/excilys/ebi/gatling/http/check/body/HttpBodyJsonPathCheckBuilder.scala | Scala | gpl-2.0 | 2,191 |
package colonlc.mcl
private[mcl] class Result(val functions: List[Function])
| colonlc/mcl | src/main/scala/colonlc/mcl/Result.scala | Scala | mit | 78 |
// Copyright (c) 2010, Stephen D. Strowes
// 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 ... | sdstrowes/scala-util | DistanceTable.scala | Scala | bsd-3-clause | 3,182 |
/*
* 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/src/test/scala/org/apache/flink/table/runtime/batch/sql/TableSourceITCase.scala | Scala | apache-2.0 | 2,842 |
/*
* Copyright (C) 2012 Pavel Fatin <http://pavelfatin.com>
*
* 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.
*
... | pavelfatin/toyfs | src/main/scala/com/pavelfatin/fs/manager/ProgressDialog.scala | Scala | gpl-3.0 | 1,848 |
package Authentication
/**
* Copyright: Copyright (C) 2016, Jaguar Land Rover
* License: MPL-2.0
*/
import play.api.test.Helpers._
import org.scalatestplus.play._
import play.api.libs.ws.WSClient
/**
* Test routing of users based on whether they have been authenticated
*/
class LoginFunTest extends PlaySpec with ... | PDXostc/rvi_sota_server | web-server/test/Authentication/LoginFunTest.scala | Scala | mpl-2.0 | 1,178 |
/*
* Copyright (c) 2014 Paul Bernard
*
* 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... | quantintel/spectrum | financial/src/main/scala/org/quantintel/ql/time/calendars/Italy.scala | Scala | apache-2.0 | 4,474 |
package org.apache.spark.metrics
import scala.collection.parallel.ForkJoinTaskSupport
import scala.concurrent.duration._
import org.apache.spark.executor.TaskMetrics
import org.apache.spark.metrics.source.Source
import org.apache.spark.{SparkConf, TaskContext}
import org.mockito.Mockito._
import org.scalatest.concurre... | datastax/spark-cassandra-connector | connector/src/test/scala/org/apache/spark/metrics/InputMetricsUpdaterSpec.scala | Scala | apache-2.0 | 4,959 |
package com.sksamuel.elastic4s
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper
import org.scalatest.Matchers
import org.scalatest.matchers.{Matcher, MatchResult}
trait JsonSugar ext... | tyth/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/JsonSugar.scala | Scala | apache-2.0 | 1,663 |
package io.coding.me.m2p2.core.actor.artifact
import akka.actor.Actor
import akka.actor.ActorLogging
import akka.actor.Props
import akka.actor.actorRef2Scala
import io.coding.me.m2p2.core.MavenFile
import io.coding.me.m2p2.core.actor.InsertArtifactRequest
import io.coding.me.m2p2.core.actor.InsertArtifactResponse
impo... | coding-me/maven-p2-view | core/src/main/scala/io/coding/me/m2p2/core/actor/artifact/InsertArtifactCollector.scala | Scala | mit | 1,193 |
package fpinscala.datastructures
sealed trait Tree[+A] {
def fold[B](l: A => B)(b: (B, B) => B): B
}
case class Leaf[A](value: A) extends Tree[A] {
def fold[B](l: (A) => B)(b: (B, B) => B): B = l(value)
}
case class Branch[A](left: Tree[A], right: Tree[A]) extends Tree[A] {
def fold[B](l: (A) => B)(b: (B, B) =... | coughlac/fpinscala | exercises/src/main/scala/fpinscala/datastructures/Tree.scala | Scala | mit | 993 |
package dotty.tools.dotc
package transform
import core._
import Types._
import Symbols._
import Contexts._
import Flags._
import StdNames._
import SymUtils._
/** Methods that apply to user-defined value classes */
object ValueClasses {
def isDerivedValueClass(sym: Symbol)(implicit ctx: Context): Boolean = {
va... | som-snytt/dotty | compiler/src/dotty/tools/dotc/transform/ValueClasses.scala | Scala | apache-2.0 | 2,517 |
package net.scalax.cpoi.test
import java.util.Date
import net.scalax.cpoi.exception.{CellNotExistsException, ExpectBooleanCellException, ExpectDateException, ExpectNumericCellException}
import net.scalax.cpoi.api._
import org.apache.poi.hssf.usermodel.HSSFWorkbook
import org.scalatest._
class HSSFWorkbookBlankString... | scalax/poi-collection | src/test/scala/net/scalax/cpoi/read/HSSFWorkbookBlankStringCellTest.scala | Scala | mit | 3,894 |
/*
* 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 ... | lzbj/openwhisk | tests/src/test/scala/whisk/core/controller/test/ActivationsApiTests.scala | Scala | apache-2.0 | 16,803 |
package codecheck.github.operations
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
import org.json4s.{JArray, JString}
import codecheck.github.api.GitHubAPI
import codecheck.github.exceptions.NotFoundException
import codecheck.github.utils.ToDo
import codecheck.github.models.... | code-check/github-api-scala | src/main/scala/codecheck/github/operations/RepositoryOp.scala | Scala | mit | 3,436 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2013-2014 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition... | digimead/digi-TABuddy-desktop | part-logic/src/main/scala/org/digimead/tabuddy/desktop/logic/payload/view/Filter.scala | Scala | agpl-3.0 | 10,414 |
package com.typesafe.akka.http.benchmark.handlers
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import com.typesafe.akka.http.benchmark.Infrastructure
import com.typesafe.akka.http.benchmark.datastore.DataStore
import com.typesafe.akka.http.benchmark.util.RandomGenerator
import ... | jeevatkm/FrameworkBenchmarks | frameworks/Scala/akka-http/src/main/scala/com/typesafe/akka/http/benchmark/handlers/QueriesHandler.scala | Scala | bsd-3-clause | 1,167 |
/*
Copyright 2013 Lance Gatlin
Author: lance.gatlin@gmail.com
This file is part of org.s_mach library.
org.s_mach library 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... | lancegatlin/s_mach.fsm | src/main/scala/org/s_mach/StateMachine.scala | Scala | gpl-3.0 | 8,409 |
/*
* Licensed to Intel Corporation under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Intel Corporation licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use t... | SeaOfOcean/BigDL | dl/src/test/scala/com/intel/analytics/bigdl/torch/SpatialContrastiveNormalizationSpec.scala | Scala | apache-2.0 | 8,652 |
package com.ruimo.scoins
import com.ruimo.scoins.LoanPattern._
import java.io.{PrintWriter, StringWriter}
object Throwables {
def stackTrace(t: Throwable): String = using(new StringWriter()) { sw =>
using(new PrintWriter(sw)) { pw =>
t.printStackTrace(pw)
}.get
sw.toString
}.get
}
| ruimo/scoins | src/main/scala/com/ruimo/scoins/Throwables.scala | Scala | apache-2.0 | 306 |
#!/usr/bin/env scala
def calc(index: Int): Double = {
val denom_mid: Long = 2 * index + 1;
val denom_small: Long = denom_mid - 1;
val denom_big: Long = denom_mid + 1;
val sign = getSign(index);
val denominator = denom_small * denom_mid * denom_big;
return sign * 4.0 / (denominator);
}
def getSign(index: Int):... | alewang/Projects | scala/numbers/pi-to-nth-digit.scala | Scala | mit | 873 |
package fr.renoux.gaston.engine
import java.time.Instant
/**
* @param stopAtScore Stop any improvement once you reach this value.
* @param maxImprovementRounds Max number of rounds to try to improve.
* @param timeout Once reached, stop creating schedules and terminate the runner.
* @param maxIterations Once r... | gaelrenoux/gaston | src/main/scala/fr/renoux/gaston/engine/OptimParams.scala | Scala | apache-2.0 | 644 |
package japgolly.scalajs.react.vdom
import scala.language.`3.0`
trait TagLite[Top <: TopNode] {
final opaque type Tag[+N <: Top] = String
@inline def apply[N <: Top](name: String): Tag[N] =
name
extension [N <: Top](self: Tag[N]) {
@inline def name: String =
self
def apply(xs: TagMod*): Tag... | japgolly/scalajs-react | coreGeneric/src/main/scala-3/japgolly/scalajs/react/vdom/TagLite.scala | Scala | apache-2.0 | 741 |
package com.github.mitallast.nsq.protocol
import java.util
import io.netty.buffer.ByteBuf
import io.netty.channel.ChannelHandlerContext
import io.netty.handler.codec.ReplayingDecoder
import io.netty.util.CharsetUtil
import com.github.mitallast.nsq._
import org.slf4j.LoggerFactory
private[nsq] sealed trait STATE
pri... | mitallast/scala-nsq | src/main/scala/com/github/mitallast/nsq/protocol/NSQDecoder.scala | Scala | mit | 4,161 |
/*
* Copyright 2016 Sumo Logic
*
* 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... | SumoLogic/epigraph | scala/codegen/src/main/scala/ws/epigraph/scala/PrimitiveGen.scala | Scala | apache-2.0 | 3,436 |
/*
* 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 ... | actuaryzhang/spark | core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala | Scala | apache-2.0 | 45,479 |
package org.podval.families.numbers.simple.monolithic
trait CalendarNumberSystem extends NumberSystem {
import NumberSystem.Raw
trait CalendarNumber extends NumberBase {
final def days: Int = digit(0)
final def days(value: Int): Number = digit(0, value)
final def hours: Int = digit(1)
final def... | dubinsky/podval-families | src/main/scala/org/podval/families/numbers/simple/monolithic/CalendarNumberSystem.scala | Scala | apache-2.0 | 479 |
/***********************************************************************
* 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-spark/geomesa-spark-core/src/main/scala/org/apache/spark/geomesa/GeoMesaSparkKryoRegistratorEndpoint.scala | Scala | apache-2.0 | 5,302 |
package simplestreams
import akka.stream._
import akka.stream.scaladsl._
import akka.actor.ActorSystem
import akka.util.ByteString
import scala.concurrent._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
object MaterializedSink extends App {
implicit val system = Actor... | sushruta/Akka-Exploration | usage/streamscontinued/src/main/scala/MaterializedSink.scala | Scala | mit | 808 |
/*
- anonymous Function syntax is allowed anywhere
a value of that Function's type is allowed.
*/
val f = (x: Int) => x > 2
ArrayUtils.filter(Array(1,2,3,4), (x: Int) => x > 2)
val g =
if (keepOnlyBig) { (x: Int) => x > 2 }
else { (x: Int) => true }
val h: Int => Boolean =
if (keepOnlyBig) { _ > 2 ... | agconti/scala-school | 04-functions-as-values/slides/slide067.scala | Scala | mit | 344 |
package org.jetbrains.plugins.scala
package project
/**
* @author Pavel Fatin
*/
sealed case class ScalaLanguageLevel(ordinal: Int, version: String) extends Named {
def name: String = version
override def getName: String = name
private[project] def proxy: ScalaLanguageLevelProxy = ScalaLanguageLevel.LevelToP... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/project/ScalaLanguageLevel.scala | Scala | apache-2.0 | 1,879 |
/*
* Copyright 2007-2010 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | jeppenejsum/liftweb | examples/hellolift/src/main/scala/com/hellolift/snippet/HelloWorld.scala | Scala | apache-2.0 | 763 |
/**
* Bolt
* TimestampParser
*
* Copyright (c) 2017 Osamu Takahashi
*
* This software is released under the MIT License.
* http://opensource.org/licenses/mit-license.php
*
* @author Osamu Takahashi
*/
package com.sopranoworks.bolt
import org.joda.time.{DateTime, DateTimeZone}
import scala.util.par... | OsamuTakahashi/bolt | src/main/scala/com/sopranoworks/bolt/TimestampParser.scala | Scala | mit | 2,624 |
package scalaprops
import scalaz.std.anyVal._
import ScalapropsScalaz._
object NeedTest extends Scalaprops {
val test = Properties.list(
scalazlaws.traverse1.all[scalaz.Need],
scalazlaws.monad.all[scalaz.Need],
scalazlaws.bindRec.all[scalaz.Need],
scalazlaws.zip.all[scalaz.Need],
scalazlaws.alig... | scalaprops/scalaprops | scalaz/src/test/scala/scalaprops/NeedTest.scala | Scala | mit | 386 |
object X {
def x() = println(this)
x()
}
| vijaykiran/fpis | chapter2/code/PrintThis.scala | Scala | cc0-1.0 | 46 |
package com.paypal.genio
/**
* Created by akgoel on 03/07/15.
*/
object Main extends App {
var r = new Reader()
r.readSpec("/swagger.json") match {
case (SpecTypeGDD, parsedSpec) => {
val gddService = new SpecGDD(parsedSpec)
println(gddService)
}
case (SpecTypeSwagger, parsedSpec) => {
... | piyush-verma/genio-scala | src/main/scala/Main.scala | Scala | apache-2.0 | 473 |
/*
* 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/src/main/scala/org/apache/flink/table/catalog/InMemoryExternalCatalog.scala | Scala | apache-2.0 | 4,174 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot 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 req... | rfranco/play-silhouette | silhouette/app/com/mohiva/play/silhouette/api/LoginInfo.scala | Scala | apache-2.0 | 1,344 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon.purescala
import Common._
import Types._
import TypeOps._
import Definitions._
import Extractors._
import Constructors._
import ExprOps.replaceFromIDs
/** Expression definitions for Pure Scala.
*
* If you are looking for things such as function or class defin... | regb/leon | src/main/scala/leon/purescala/Expressions.scala | Scala | gpl-3.0 | 38,848 |
package tasks
import java.io.{BufferedReader, File, InputStreamReader}
import java.nio.file
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import com.jcraft.jsch.OpenSSHConfig
import com.typesafe.config.{Config, ConfigFactory, ConfigValueType}
import fr.janalyse.ssh.{SSH, _}
import DeployTas... | Somewater/sbt-onebutton-deploy | src/main/scala/com/somewater/onebutton/DeployTask.scala | Scala | mit | 9,733 |
/*
* Copyright 2015 Databricks
*
* 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... | huaxingao/spark-redshift | src/test/scala/com/databricks/spark/redshift/FilterPushdownSuite.scala | Scala | apache-2.0 | 3,448 |
package io.continuum.bokeh
package sampledata
import org.joda.time.{LocalDate=>Date}
object USHolidays extends ICalSampleData {
implicit val DateOrdering: Ordering[Date] = Ordering.fromLessThan(_ isBefore _)
def load(): List[Holiday] = {
loadEvents("USHolidays.ics").map { event =>
Holiday... | bokeh/bokeh-scala | sampledata/src/main/scala/USHolidays.scala | Scala | mit | 468 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pronix/spark | streaming/src/main/scala/org/apache/spark/streaming/dstream/ReceiverInputDStream.scala | Scala | apache-2.0 | 6,427 |
/*
* 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 ... | davidzchen/samza | samza-kv/src/test/scala/org/apache/samza/storage/kv/TestCachedStore.scala | Scala | apache-2.0 | 2,701 |
package org.mitre.mandolin
/*
* Copyright (c) 2014-2015 The MITRE Corporation
*/
/**
* This package includes provides an entry point into Mandolin. It
* also serves as a location for future Mandolin-based applications to be included
* in the Mandolin code base.
*/
package object app {
}
| project-mandolin/mandolin | mandolin-core/src/main/scala/org/mitre/mandolin/app/package.scala | Scala | apache-2.0 | 299 |
package org.fathens.wercker.deploy.googleplay
import java.io.File
import scala.collection.JavaConversions._
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport
import com.google.api.client.http.FileContent
import com.google.api.... | sawatani/wercker-step-deploy-GooglePlay | src/main/scala/org/fathens/wercker/deploy/googleplay/Main.scala | Scala | mit | 2,088 |
/*
* WalkSAT.scala
* A WalkSAT-like procedure for finding a valid state on a set of factors.
*
* Created By: William Kretschmer (kretsch@mit.edu)
* Creation Date: July 20, 2015
*
* Copyright 2015 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for infor... | scottcb/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/factored/gibbs/WalkSAT.scala | Scala | bsd-3-clause | 6,096 |
package samples
import tu.model.knowledge.primitive.Number
import org.junit.runner.RunWith
import org.specs._
import org.specs.matcher._
import runner.{ScalaTest, JUnitSuiteRunner, JUnit}
import scala.collection.immutable.Range.Double
import tu.model.knowledge.KnowledgeURI
//import org.scalacheck.Gen
/**
* Sample ... | keskival/2 | model.knowledge/src/test/scala/samples/specs.scala | Scala | gpl-3.0 | 1,501 |
/*
* 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 | core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala | Scala | apache-2.0 | 14,708 |
package epic.ontonotes
import epic.trees.Span
/**
* Represents a Span in a particular sentence in a particular Document
*/
case class DSpan(doc: String, sentence: Int, begin: Int, end: Int) {
def length = end - begin
def span = Span(begin, end)
/**
* Returns the words associated with this dspan as a stri... | briantopping/epic | src/main/scala/epic/ontonotes/DSpan.scala | Scala | apache-2.0 | 1,859 |
package org.inosion.dadagen
import org.scalatest.{FlatSpec, Matchers}
class NullListCheckTest extends FlatSpec with Matchers {
"A null Generator List" should "throw a require error" in {
try {
val gen = MapOfStringsGenerator(null)
fail("did not error when null list provided")
} cat... | inosion/dadagen | dadagen-core/src/test/scala/org/inosion/dadagen/NullListCheckTest.scala | Scala | apache-2.0 | 400 |
package esp.eventstore
import scalaz._
import Scalaz._
trait UserValidation {
type Email = String
private def nonEmptyEmail(email: Email) = if (email.nonEmpty) email.successNel else "empty email".failureNel
private def emailContainsAt(email: Email) = if (email.contains('@')) email.successNel else "email doesn... | scala-guild/event-sourcing-playground | src/main/scala/esp/eventstore/UserValidation.scala | Scala | gpl-2.0 | 526 |
package blockplus.context
import interfaces.move.MoveInterface
import scala.collection.immutable.Stack
import blockplus.Color
import blockplus.move.Move
import blockplus.move.Moves
import blockplus.piece.PieceType
final case class MoveHistory(val data: Stack[Move] = Stack.empty) {
def this() = this(Stack.empty)
... | arie-benichou/blockplus | src/main/scala/blockplus/context/MoveHistory.scala | Scala | gpl-3.0 | 618 |
import skinny._
import skinny.controller._
import _root_.controller._
class ScalatraBootstrap extends SkinnyLifeCycle {
// If you prefer more logging, configure this settings
// http://scalikejdbc.org/documentation/configuration.html
scalikejdbc.GlobalSettings.loggingSQLAndTime = scalikejdbc.LoggingSQLAndTimeS... | tsukaby/anime-lineup | src/main/scala/ScalatraBootstrap.scala | Scala | mit | 742 |
/*
* Facsimile: A Discrete-Event Simulation Library
* Copyright © 2004-2020, Michael J Allen.
*
* This file is part of Facsimile.
*
* Facsimile 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, eithe... | MichaelJAllen/facsimile | core/src/main/scala/org/facsim/App.scala | Scala | lgpl-3.0 | 6,305 |
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.