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 pl.newicom.dddd.office
import org.slf4j.LoggerFactory._
class OfficeListener[A : LocalOfficeId] {
lazy val log = getLogger(getClass.getName)
def officeStarted(office: Office): Unit = {
log.info("{} Office of {} Department- started up successfully.", office.id, office.department:Any)
}
}
| AndreyLadniy/akka-ddd | akka-ddd-core/src/main/scala/pl/newicom/dddd/office/OfficeListener.scala | Scala | mit | 318 |
package service
import akka.actor.Actor
import api.Marshalling
import domain.{ Todo, Item }
import spray.http.StatusCodes
import spray.json.ProductFormats
import core.DatabaseCfg._
import scala.slick.driver.H2Driver.simple._
/**
* Case classes for Akka messaging
*/
case class CreateTodoList(todo: Todo)
case class ... | adrianpredam/ScalaTest | src/main/scala/service/todo.scala | Scala | cc0-1.0 | 3,113 |
package no.nr.edvard.osiris.analysis
import org.scalatest.FunSuite
import no.nr.edvard.osiris.testutil.TestCompiler
import org.objectweb.asm.tree.{AnnotationNode, MethodNode}
import no.nr.edvard.osiris.model.JavaMethod
class CreatorCorpusAcceptanceTest extends FunSuite {
test("Correct interpretation of a complex ... | edwkar/edwbsc | projects/Osiris/src/test/scala/no/nr/edvard/osiris/analysis/CreatorCorpusAcceptanceTest.scala | Scala | gpl-2.0 | 8,373 |
package org.orbeon.oxf.util
import org.orbeon.datatypes.{ExtendedLocationData, LocationData}
import org.orbeon.oxf.common.{OrbeonLocationException, ValidationException}
import org.orbeon.oxf.util.StaticXPath.{SaxonConfiguration, ValueRepresentationType, makeStringExpression}
import org.orbeon.oxf.util.XPath.{adjustCon... | orbeon/orbeon-forms | xforms-runtime/js/src/main/scala/org/orbeon/oxf/util/XPathCache.scala | Scala | lgpl-2.1 | 20,304 |
package models.entity
object Tasks {
}
| LeonardoZ/SAEB | app/models/entity/Tasks.scala | Scala | mit | 50 |
/*
* Copyright 2016 by Eugene Yokota
*
* 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... | eed3si9n/gigahorse | okhttp/src/main/scala/gigahorse/support/okhttp/OkhCompletionHandler.scala | Scala | apache-2.0 | 896 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.linker.interface
import s... | scala-js/scala-js | linker-interface/shared/src/main/scala/org/scalajs/linker/interface/Fingerprint.scala | Scala | apache-2.0 | 2,107 |
import akka.Done
import akka.actor.ActorSystem
import com.lightbend.lagom.scaladsl.playjson.JsonSerializerRegistry
import com.lightbend.lagom.scaladsl.testkit.PersistentEntityTestDriver
import demo.api.basket.{Basket, Item}
import demo.impl.basket._
import org.scalactic.TypeCheckedTripleEquals
import org.scalatest.{Bef... | tommpy/demo-lagom-checkout | exercise_040_clear_basket/basket-impl/src/test/scala/BasketSpec.scala | Scala | apache-2.0 | 2,078 |
package kafka.log
import scala.math._
import java.io.File
import kafka.message._
import kafka.utils._
/**
* A segment of the log. Each segment has two components: a log and an index. The log is a FileMessageSet containing
* the actual messages. The index is an OffsetIndex that maps from logical offsets to physical ... | dchenbecker/kafka-sbt | core/src/main/scala/kafka/log/LogSegment.scala | Scala | apache-2.0 | 5,745 |
package awsprog
import scala.util.Random
import javax.swing.JFrame
class GameOfLife(frame: Window) {
val ymax = 100
val xmax = 150
val probabilityOfLife = 0.08
val generationInterval = 100
val numberOfNeighboursToCreateLife ... | awsprog/game-of-life | src/main/scala/awsprog/GameOfLife.scala | Scala | mit | 2,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 ... | Lewuathe/neurallib | src/main/scala/com/lewuathe/dllib/layer/FlattenLayer.scala | Scala | mit | 3,009 |
/*
Demo: A lightweight unit-testing framework.
Author: Matthew Might
Site: http://matt.might.net/
http://www.ucombinator.org/
A home-grown unit-testing library, demonstrating the utility of
by-name parameters.
*/
/**
Thrown when checkThat fails.
*/
case class CheckException extends RuntimeExcept... | henry-hz/learn-scala | intro/DemoTesting.scala | Scala | mit | 2,028 |
package jp.t2v.lab.play2.auth.social.providers.twitter
import jp.t2v.lab.play2.auth.social.core.OAuth10aController
import jp.t2v.lab.play2.auth.{ AuthConfig, Login, OptionalAuthElement }
import play.api.libs.oauth.RequestToken
trait TwitterController extends OAuth10aController
with AuthConfig
with OptionalAut... | kuenzaa/play2-auth | social/src/main/scala/jp/t2v/lab/play2/auth/social/providers/twitter/TwitterController.scala | Scala | apache-2.0 | 569 |
package io.finch.test
import com.twitter.finagle.{Http, ListeningServer, Service}
import com.twitter.finagle.http.{Request, Response}
import com.twitter.util.Await
import org.scalatest.{fixture, Outcome}
/**
* Extends [[ServiceSuite]] to support integration testing for services.
*/
trait ServiceIntegrationSuite ext... | ilya-murzinov/finch | test/src/main/scala/io/finch/test/ServiceIntegrationSuite.scala | Scala | apache-2.0 | 1,115 |
package com.github.jeanadrien.evrythng.scala.rest
import com.github.jeanadrien.evrythng.scala.json.SecretKey
import org.specs2.concurrent.ExecutionEnv
import org.specs2.specification.BeforeAll
/**
*
*/
class TrustedApplicationRestApiSpec(implicit val ee : ExecutionEnv)
extends TestApplicationContext with Befo... | jeanadrien/evrythng-scala-sdk | src/test/scala/com/github/jeanadrien/evrythng/scala/rest/TrustedApplicationRestApiSpec.scala | Scala | apache-2.0 | 954 |
/*
* 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 | core/src/main/scala/org/apache/spark/broadcast/TorrentBroadcast.scala | Scala | apache-2.0 | 12,278 |
/**
* Traits for adding Lua scripting to Node actors.
*/
package curiodb
import akka.actor.{Actor, ActorContext, ActorLogging, Props}
import akka.event.LoggingAdapter
import akka.pattern.ask
import akka.util.Timeout
import java.io.ByteArrayInputStream
import java.security.MessageDigest
import org.luaj.vm2.{LuaValue... | shichaoyuan/curiodb | src/main/scala/Scripting.scala | Scala | bsd-2-clause | 12,393 |
package org.deeplearning4s.nn.conf.layers
import org.deeplearning4j.nn.conf.layers.{Layer => jLayer}
import org.deeplearning4j.nn.conf.Updater
import org.deeplearning4j.nn.conf.distribution.Distribution
import org.deeplearning4j.nn.weights.WeightInit
import org.deeplearning4s.nn.conf.ActivationFunction
trait Layer {
... | everpeace/deeplearning4s | src/main/scala/org/deeplearning4s/nn/conf/layers/Layer.scala | Scala | apache-2.0 | 528 |
/*
* Copyright (C) 2017 Vincibean <Andrea Bessi>
*
* 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.
*
* Thi... | Vincibean/ScalaForTheImpatient-Solutions | src/main/scala/org/vincibean/scala/impatient/chapter14/exercise4/package.scala | Scala | gpl-3.0 | 1,536 |
/*
* 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/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/calculations/WritingDownAllowanceCalculator.scala | Scala | apache-2.0 | 3,072 |
package com.twitter.finatra.thrift
import com.google.inject.Stage
import com.twitter.inject.server.PortUtils._
import com.twitter.inject.server.{EmbeddedTwitterServer, PortUtils, Ports}
/**
* EmbeddedThriftServer allows a [[com.twitter.server.TwitterServer]] serving thrift endpoints to be started
* locally (on ephe... | syamantm/finatra | thrift/src/test/scala/com/twitter/finatra/thrift/EmbeddedThriftServer.scala | Scala | apache-2.0 | 2,869 |
package com.github.bootlog.models
import org.joda.time._
import org.joda.time.format.DateTimeFormat
import com.github.bootlog.util.markdown.PegDown._
import java.io.File
case class Post(
title: String,
tagline: String,
name: String, // filename
category: String,
tags: List[String],
date: DateTime,
html:... | jasonqu/reading-notes | src/main/scala/com/github/bootlog/models/Post.scala | Scala | cc0-1.0 | 1,321 |
/**
* Copyright (C) 2015 Turi
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD license. See the LICENSE file for details.
*/
package org.graphlab.create
import java.io.File
import java.nio.file.Files
import java.sql.Date
import org.apache.spark.{SparkConf, Sp... | dato-code/spark-sframe | src/test/scala/org/graphlab/create/GraphLabUtilTestSuite.scala | Scala | bsd-2-clause | 8,933 |
/*
* 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 ... | publicRoman/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/rest/k8s/ResourceStagingService.scala | Scala | apache-2.0 | 4,603 |
/* ___ _ ___ _ _ *\\
** / __| |/ (_) | | The SKilL Generator **
** \\__ \\ ' <| | | |__ (c) 2013-16 University of Stuttgart **
** |___/_|\\_\\_|_|____| see LICENSE ... | skill-lang/skill | src/main/scala/de/ust/skill/generator/skill/GeneralOutputMaker.scala | Scala | bsd-3-clause | 1,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 ... | aliyun/aliyun-emapreduce-sdk | emr-oss/src/main/scala/org/apache/spark/aliyun/helper/package.scala | Scala | artistic-2.0 | 918 |
package scutil.collection.extension
import scala.annotation.tailrec
object ListImplicits extends ListImplicits
trait ListImplicits {
implicit final class ListExt[T](peer:List[T]) {
def cata[U](nil: =>U, cons:(T,List[T])=>U):U =
peer match {
case head :: tail => cons(head, tail)
case Nil => nil
}
... | ritschwumm/scutil | modules/core/src/main/scala/scutil/collection/extension/ListImplicits.scala | Scala | bsd-2-clause | 884 |
package models.data
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
import scalikejdbc._
case class Quote(id: Long, source: String, sourceUrl: Option[String], time: ZonedDateTime, content: Option[String], rating: Int) {
def formattedTime: String =
time.format(DateTimeFormatter.ISO_OFFS... | codingteam/loglist | scalajvm/app/models/data/Quote.scala | Scala | mit | 696 |
package com.atomist.tree.pathexpression
import com.atomist.graph.GraphNode
import com.atomist.rug.runtime.js.ExecutionContext
import com.atomist.tree.TreeNode
import com.atomist.tree.pathexpression.ExecutionResult.ExecutionResult
/**
* Convenience superclass that uses a predicate to handle sourced nodes
*
* @pa... | atomist/rug | src/main/scala/com/atomist/tree/pathexpression/PredicatedNodeTest.scala | Scala | gpl-3.0 | 1,964 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/functions/utils/AggSqlFunction.scala | Scala | apache-2.0 | 8,997 |
/*
*
* * Copyright 2015 Skymind,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
* *
* * U... | Mageswaran1989/aja | src/main/scala/org/aja/dhira/src/main/scala/org/dhira/core/nnet/api/Layer.scala | Scala | apache-2.0 | 7,332 |
/*
Copyright 2009 David Hall, Daniel Ramage
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 writi... | MLnick/scalanlp-core | data/src/main/scala/scalanlp/collection/LazyIterable.scala | Scala | apache-2.0 | 12,731 |
/*
* 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 ... | fhueske/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/utils/MemoryTableSourceSinkUtil.scala | Scala | apache-2.0 | 6,732 |
package pl.jozwik.mvn2sbt
import java.io.File
class DirProjectExtractorSpec extends AbstractSpec {
val first = Some("ee")
val second = Some("tt")
"DirProjectExtractor " should {
"Get first option " in {
compare(DirProjectExtractor.valueFromOptions(first, second), first)
}
"Get first option2" ... | ajozwik/mvn2sbt | converter/src/test/scala/pl/jozwik/mvn2sbt/DirProjectExtractorSpec.scala | Scala | apache-2.0 | 1,110 |
package clasp.core
import scala.collection.JavaConverters.asScalaBufferConverter
import scala.collection.TraversableOnce.flattenTraversableOnce
import scala.collection.mutable.ListBuffer
import scala.collection.mutable.MutableList
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.durat... | hamiltont/clasp | src/clasp/core/node_launcher.scala | Scala | mit | 17,382 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); yo... | sslavic/kafka | core/src/test/scala/unit/kafka/server/ApiVersionsRequestTest.scala | Scala | apache-2.0 | 2,947 |
/*
* Copyright 2011-2022 GatlingCorp (https://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | gatling/gatling | gatling-charts/src/main/scala/io/gatling/charts/component/ErrorsTableComponent.scala | Scala | apache-2.0 | 2,115 |
package com.seanshubin.detangler.report
import com.seanshubin.detangler.model.Standalone
trait StandaloneTemplateRules {
def generate(standaloneTemplate: HtmlElement, context: Standalone, standalone: Standalone): HtmlElement
}
| SeanShubin/detangler | report/src/main/scala/com/seanshubin/detangler/report/StandaloneTemplateRules.scala | Scala | unlicense | 231 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/keras/layers/Cropping1D.scala | Scala | apache-2.0 | 2,271 |
package yang.flexmapping.enrich
import akka.actor.{Actor, ActorLogging, ActorRef}
import com.nsn.oss.nbi.interfaces.{AlarmNotificationFlow, InterfaceType}
/**
* Created by y28yang on 4/12/2016.
*/
class EnrichActor(var enrich:Enrich,flexMappingActor: ActorRef) extends Actor with ActorLogging{
override def rece... | wjingyao2008/firsttry | NextGenAct/src/main/scala/yang/flexmapping/enrich/EnrichActor.scala | Scala | apache-2.0 | 544 |
/*
* 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 ... | sh-cho/cshSpark | rdd/RDDOperationScope.scala | Scala | apache-2.0 | 6,418 |
package reactivemongo
import java.util.UUID
import reactivemongo.core.errors.GenericDriverException
import reactivemongo.api.{
DistributedSession,
NodeSetSession,
Session,
SessionTransaction,
WriteConcern
}
final class SessionSpec extends org.specs2.mutable.Specification {
"Session" title
sequential
... | ornicar/ReactiveMongo | driver/src/test/scala/SessionSpec.scala | Scala | apache-2.0 | 4,987 |
package metal
import metal.mutable.{HashMap2 => MHashMap2}
import metal.syntax._
class Map2OpsSuite extends MetalSuite {
def testMap2 = MHashMap2(1 -> ((2, 3)), 4 -> ((5, 6)))
// SearchableOps
test("contains") {
val m = testMap2
assert(m.contains(1))
assert(!m.contains(6))
}
// RemovableSearc... | denisrosset/ptrcoll | library/src/test/scala/metal/Map2OpsSuite.scala | Scala | mit | 1,836 |
/*
* 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 ... | jinglining/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/batch/sql/validation/InsertIntoValidationTest.scala | Scala | apache-2.0 | 4,418 |
package main.abstraction
import rescala._
trait SignalWrappable[WrappedType, WrapperType] {
def wrap(unwrapped: Signal[WrappedType]): WrapperType
}
| volkc/REScala | Extensions/Datastructures/src/main/scala/main/abstraction/SignalWrappable.scala | Scala | apache-2.0 | 154 |
// Invalid because nested hk type parameters are no longer allowed
import language._
object Test {
def foo = (null: Any) match {
case a: A[k] =>
// error: kinds of the type arguments (k) do not conform to the
// expected kinds of the type parameters (type K) in class B.
new B[k]()
}
}
class... | densh/dotty | tests/invalid/pos/t8023.scala | Scala | bsd-3-clause | 494 |
/*
* 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 ... | Intel-bigdata/OAP | oap-cache/oap/src/test/scala/org/apache/spark/sql/execution/vectorized/VectorizedOapIOSuite.scala | Scala | apache-2.0 | 10,394 |
package memnets.fx.games
package object wta {}
| MemoryNetworks/memnets | fx/src/main/scala/memnets/fx/games/wta/package.scala | Scala | apache-2.0 | 48 |
/*
* Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | RetentionGrid/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/enrichments/registry/RefererParserEnrichment.scala | Scala | apache-2.0 | 3,470 |
/*
Copyright 2012 Georgia Tech Research Institute
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 Foundatio... | lancegatlin/s_mach.fsm | src/test/scala/org/s_mach/test/LogEntry.scala | Scala | gpl-3.0 | 1,496 |
package com.twitter.finagle.http
import com.twitter.finagle.{param, Http => FHttp, Service}
import com.twitter.finagle.builder.{ClientBuilder, ServerBuilder}
import com.twitter.finagle.tracing._
import com.twitter.util.{Await, Future, RandomSocket}
import java.net.InetSocketAddress
import org.jboss.netty.handler.codec... | yancl/finagle-6.22.0 | finagle-http/src/test/scala/com/twitter/finagle/http/TraceInitializationTest.scala | Scala | apache-2.0 | 2,712 |
// See https://github.com/scalameta/scalameta/issues/1749
package example
import scala.math.Ordered.orderingToOrdered
class Issue1749 {
val x1 = 42
val x2 = 42
(x1, x1)
.compare((x2, x2))
}
class Issue1854 {
val map = collection.mutable.Map.empty[String, String]
map("a") = "b"
}
| som-snytt/dotty | tests/semanticdb/expect/Issue1749.scala | Scala | apache-2.0 | 297 |
/*
// Copyright 2012/2013 de Gustavo Steinberg, Flavio Soares, Pierre Andrews, Gustavo Salazar Torres, Thomaz Abramo
//
// Este arquivo é parte do programa Vigia Político. O projeto Vigia
// Político é um software livre; você pode redistribuí-lo e/ou
// modificá-lo dentro dos termos da GNU Affero General Public License... | cidadao-automatico/cidadao-server | app/models/Vote.scala | Scala | agpl-3.0 | 5,603 |
package com.mesosphere.cosmos.rpc.v2.model
import com.mesosphere.universe
import io.circe.Decoder
import io.circe.Encoder
import io.circe.JsonObject
import io.circe.generic.semiauto.deriveDecoder
import io.circe.generic.semiauto.deriveEncoder
case class DescribeResponse(
packagingVersion: universe.v3.model.Packagin... | dcos/cosmos | cosmos-common/src/main/scala/com/mesosphere/cosmos/rpc/v2/model/DescribeResponse.scala | Scala | apache-2.0 | 1,317 |
package spark.network
import java.nio.ByteBuffer
import java.net.InetAddress
private[spark] object SenderTest {
def main(args: Array[String]) {
if (args.length < 2) {
println("Usage: SenderTest <target host> <target port>")
System.exit(1)
}
val targetHost = args(0)
val targetPo... | koeninger/spark | core/src/main/scala/spark/network/SenderTest.scala | Scala | bsd-3-clause | 1,797 |
package noiselib
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import NoiseTest._
@RunWith(classOf[JUnitRunner]) class FractalBrownianMotionTest extends ParallelTestBase {
val noise = new WhiteNoise with LinearInterp with FractalBrownianMotion
"2D fractal brownian motion noise" must "only ... | flaviut/noiselib | src/test/scala/noiselib/FractalBrownianMotionTest.scala | Scala | mit | 625 |
package cc.kevinlee.sbt.onejar
import org.scalatest.WordSpec
/**
* @author Lee, Seong Hyun (Kevin)
* @since 2015-06-11
*/
class MainApp$Test extends WordSpec {
"MainApp$Test" should {
"doSomething" in {
// fail("Just failed for testing build!")
}
}
}
| Kevin-Lee/sbt-github-release-example | src/test/scala/cc/kevinlee/sbt/onejar/MainApp$Test.scala | Scala | apache-2.0 | 276 |
/*
* 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 ... | matthewfranglen/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/CoalesceShufflePartitionsSuite.scala | Scala | mit | 15,218 |
object Test extends App {
class Result(_str: => String) {
lazy val str = _str
}
def foo(str: => String)(i: Int) = new Result(str)
def bar(f: Int => Result) = f(42)
var test: String = null
val result = bar(foo(test))
test = "bar"
if (result.str == null) {
println("Destroy ALL THE THINGS!!!")
... | som-snytt/dotty | tests/run/t5610a.scala | Scala | apache-2.0 | 368 |
package mesosphere.marathon
package core.deployment.impl
import akka.Done
import akka.actor.ActorRef
import akka.stream.scaladsl.Source
import akka.testkit.TestProbe
import akka.util.Timeout
import mesosphere.AkkaUnitTest
import mesosphere.marathon.core.condition.Condition
import mesosphere.marathon.core.deployment._
... | gsantovena/marathon | src/test/scala/mesosphere/marathon/core/deployment/impl/DeploymentActorTest.scala | Scala | apache-2.0 | 13,656 |
class Foo
object Foo {
val ss/*ref*/ = ""
ss.charAt(0)
} | Kwestor/scala-ide | org.scala-ide.sdt.core.tests/test-workspace/find-references/ex1/src/Ex1.scala | Scala | bsd-3-clause | 60 |
/*§
===========================================================================
Chronos IDE
===========================================================================
Copyright (C) 2015-2017 Gianluca Costa
===========================================================================
Licensed under the Apache... | giancosta86/Chronos-IDE | src/main/scala/info/gianlucacosta/chronos/ide/ChronosCodeEditor.scala | Scala | apache-2.0 | 2,791 |
package models
import play.api.libs.json._
case class User(id: Long, name: String, favThings: List[String])
object Protocol {
implicit object UserFormat extends Format[User] {
def writes(o: User): JsValue = JsObject(
List("id" -> JsNumber(o.id),
"name" -> JsString(o.name),
... | michaelahlers/team-awesome-wedding | vendor/play-2.2.1/framework/test/integrationtest/app/models/User.scala | Scala | mit | 628 |
/*
* MkIntVector.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
package ... | Sciss/FScape-next | lucre/shared/src/main/scala/de/sciss/fscape/lucre/stream/MkIntVector.scala | Scala | agpl-3.0 | 2,413 |
package fr.inria.spirals.sigma.ttc14.fixml.objlang.support
import fr.inria.spirals.sigma.ttc14.fixml.objlang.Constructor;
import fr.inria.spirals.sigma.ttc14.fixml.objlang.ConstructorCall;
import fr.inria.spirals.sigma.ttc14.fixml.objlang.Expression;
import fr.unice.i3s.sigma.support.EMFProxyBuilder;
import fr.unice.... | fikovnik/ttc14-fixml-sigma | ttc14-fixml-extension-3/src-gen/fr/inria/spirals/sigma/ttc14/fixml/objlang/support/ConstructorCallScalaSupport.scala | Scala | epl-1.0 | 1,261 |
package uk.co.pollett.flink.newsreader.rss
import org.apache.flink.streaming.api.functions.source.RichParallelSourceFunction
import org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext
class Source(url: String) extends RichParallelSourceFunction[Entry] {
var running = true
override def ca... | pollett/flink-newsreader | src/main/scala/uk/co/pollett/flink/newsreader/rss/Source.scala | Scala | mit | 624 |
class C { inline final def f: Int => Int = (x: Int) => x + 1 }
object Test extends App {
import java.io.*
def serialize(obj: AnyRef): Array[Byte] = {
val buffer = new ByteArrayOutputStream
val out = new ObjectOutputStream(buffer)
out.writeObject(obj)
buffer.toByteArray
}
def deserialize(a: Arr... | dotty-staging/dotty | tests/run/inlineAddDeserializeLambda.scala | Scala | apache-2.0 | 598 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pgandhi999/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/trees/TreeNodeSuite.scala | Scala | apache-2.0 | 23,332 |
package org.apache.predictionio.examples.experimental.cleanupapp
import org.apache.predictionio.controller.P2LAlgorithm
import org.apache.predictionio.controller.Params
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.rdd.RDD
import grizzled.slf4j.Logger
//case cla... | alex9311/PredictionIO | examples/experimental/scala-cleanup-app/src/main/scala/Algorithm.scala | Scala | apache-2.0 | 839 |
package scala.pickling.generics.simple
import org.scalatest.FunSuite
import scala.pickling._, scala.pickling.Defaults._, json._
case class C[T](x: T)
class GenericsSimpleTest extends FunSuite {
test("main") {
val c = C(2)
val p = c.pickle
assert(p.toString === """
|JSONPickle({
| "tpe": "s... | eed3si9n/pickling-historical | core/src/test/scala/pickling/run/generics-simple.scala | Scala | bsd-3-clause | 460 |
import sbt._
import Keys._
object build extends Build {
val sbtXjc = Project(
id = "sbt-onejar",
base = file("."),
settings = Defaults.defaultSettings ++ ScriptedPlugin.scriptedSettings ++ Seq[Project.Setting[_]](
organization := "com.github.retronym",
version := "0.8-SNAPSHOT",
sbtPlug... | retronym/sbt-onejar | project/build.scala | Scala | mit | 601 |
package core
import core.indexing.IndexableField
/**
* The system fields used by the CultureHub.
*
* Don't touch this class unless there has been a consensus amongst the core developers.
*
* @author Manuel Bernhardt <bernhardt.manuel@gmail.com>
*/
case class SystemField(name: String) extends IndexableField {
... | delving/culture-hub | web-core/app/core/SystemField.scala | Scala | apache-2.0 | 1,420 |
package yoda.orm.generator
import java.io.{File, FileWriter, StringReader}
import com.typesafe.scalalogging.LazyLogging
import org.apache.velocity.runtime.RuntimeSingleton
import org.apache.velocity.{Template, VelocityContext}
import yoda.commons.{Closer, Naming}
import yoda.orm.definitions.NamingConvention
import s... | nuboat/yoda-orm | src/main/scala/yoda/orm/generator/Generator.scala | Scala | mit | 5,058 |
package fr.neuville.lombok.util
import com.intellij.psi.{PsiAnnotation, PsiModifierListOwner}
import fj.data.{Option => FJOpt}
object AnnotUtil {
def findLbkAnnotation(owner: PsiModifierListOwner, annotationName: String): FJOpt[PsiAnnotation] =
findLbkAnnot(owner, annotationName).fold(FJOpt.none[PsiAnnotation]... | gneuvill/lombok-intellij-plugin | processor-core/src/main/scala/fr/neuville/lombok/util/AnnotUtil.scala | Scala | bsd-2-clause | 1,125 |
package com.twitter.server.util
private[server] object Json {
import com.fasterxml.jackson.core.`type`.TypeReference
import com.fasterxml.jackson.databind.{ObjectMapper, JsonNode}
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import java.lang.reflect.{Type, ParameterizedType}
val mapper: Obje... | travisbrown/twitter-server | src/main/scala/com/twitter/server/util/Json.scala | Scala | apache-2.0 | 1,079 |
package com.arcusys.valamis.web.service.export
import com.liferay.portal.kernel.log.LogFactoryUtil
import scala.collection.mutable.HashMap
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
object TaskManager {
private val futures = HashMap[String, Future[_]]()
private va... | arcusys/Valamis | valamis-portlets/src/main/scala/com/arcusys/valamis/web/service/export/TaskManager.scala | Scala | gpl-3.0 | 1,157 |
/*
* 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 agreed to in writ... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/ListShouldContainTheSameElementsInOrderAsLogicalAndSpec.scala | Scala | apache-2.0 | 56,320 |
class A {
var a = false
}
object B {
var b = false
}
class C {
var c = false
}
object C extends A {
def test = {
a = true
C.a = true
this.a = true
C.this.a = true
import B._
b = true
val c0 = new C
import c0._
c = true
}
}
| som-snytt/dotty | tests/pos/i3917.scala | Scala | apache-2.0 | 274 |
// - Project: surf (https://github.com/jokade/surf)
// Module: shared
// Description: Provides a base class for CRUD data services
//
// Copyright (c) 2015 Johannes Kastner <jokade@karchedon.de>
// Distributed under the MIT License (see included file LICENSE)
package surf.service
import surf.Servi... | jokade/surf | archive/core/CRUDService.scala | Scala | mit | 7,159 |
package com.avsystem.scex
package compiler.xmlfriendly
import com.google.common.io.ByteStreams
import org.scalatest.FunSuite
/**
* Created: 23-04-2014
* Author: ghik
*/
class XmlFriendlyTranslatorTest extends FunSuite {
import com.avsystem.scex.compiler.xmlfriendly.XmlFriendlyTranslator.translate
test("va... | AVSystem/scex | scex-core/src/test/scala/com/avsystem/scex/compiler/xmlfriendly/XmlFriendlyTranslatorTest.scala | Scala | mit | 2,407 |
//https://www.hackerrank.com/challenges/fp-sum-of-odd-elements
object Solution extends App {
def f(arr : List[Int]) : Int = {
return arr.filter(x => (x & 1) == 1).sum
}
println(f(io.Source.stdin.getLines.toList.map(_.trim).map(_.toInt)))
} | hongyegong/hackerrank | functional_programming/introduction/fp-sum-of-odd-elements.scala | Scala | mit | 253 |
package com.sksamuel.elastic4s.searches.aggs
import com.sksamuel.elastic4s.script.ScriptDefinition
import com.sksamuel.elastic4s.searches.aggs.pipeline.PipelineAggregationDefinition
import com.sksamuel.exts.OptionImplicits._
case class StatsAggregationDefinition(name: String,
fie... | tyth/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/aggs/StatsAggregationDefinition.scala | Scala | apache-2.0 | 1,548 |
/**
* Copyright (c) 2015, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"). You may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LIC... | kamir/spark-timeseries | src/main/scala/com/cloudera/finance/examples/SimpleTickDataExample.scala | Scala | apache-2.0 | 2,910 |
package edu.colorado.plv.cuanto.scoot.jimple
/**
* @author Jared Wright
*/
class Local private[jimple] (private val dt: soot.Local) extends Value
object Local {
def unapply(l: Local): Option[String] = Some(l.dt.getName())
} | cuplv/cuanto | src/main/scala/edu/colorado/plv/cuanto/scoot/jimple/Local.scala | Scala | apache-2.0 | 231 |
package computerdatabase.advanced
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class AdvancedSimulationStep01 extends Simulation {
// Let's split this big scenario into composable business processes, like one would do with PageObject pattern with Selenium
//... | whitewalter/breaking-load | user-files/simulations/computerdatabase/advanced/AdvancedSimulationStep01.scala | Scala | apache-2.0 | 2,224 |
package io.skysail.app.facebook.resources
import io.skysail.server.restlet.resources.EntityServerResource
import io.skysail.domain.GenericIdentifiable
import io.skysail.app.facebook.FacebookApplication
class FacebookMeResource extends EntityServerResource[GenericIdentifiable] {
def getEntity(): GenericIdentifiable ... | evandor/skysail | skysail.app.facebook/src/io/skysail/app/facebook/resources/FacebookMeResource.scala | Scala | apache-2.0 | 486 |
package org.jetbrains.plugins.scala.lang.transformation
package general
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.format.{Injection, InterpolatedStringParser, StringPart, Text}
import org.jetbrains.plugins.scala.lang.psi.api.base.ScInterpolatedStringLiteral
import org.jetbrains.plugins.scal... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/transformation/general/ExpandStringInterpolation.scala | Scala | apache-2.0 | 2,388 |
/*
* Copyright 2020 Precog Data
*
* 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 ... | quasar-analytics/quasar | api/src/main/scala/quasar/api/push/TypeCoercion.scala | Scala | apache-2.0 | 2,475 |
/**
* 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... | Mszak/kafka | core/src/main/scala/kafka/common/ZkNodeChangeNotificationListener.scala | Scala | apache-2.0 | 5,580 |
package org.scalajs.testsuite.javalib.lang
import org.junit.Assume._
import org.junit.Assert._
import org.junit.Test
import org.scalajs.testsuite.utils.AssertThrows._
import org.scalajs.testsuite.utils.Platform._
class MathTestOnJDK8 {
@Test def addExact(): Unit = {
assertEquals(0, Math.addExact(0, 0))
as... | mdedetrich/scala-js | test-suite/shared/src/test/require-jdk8/org/scalajs/testsuite/javalib/lang/MathTestOnJDK8.scala | Scala | bsd-3-clause | 15,794 |
package com.github.novamage.svalidator.html
/** Default implementation for [[com.github.novamage.svalidator.html.HtmlAttributeDecorator HtmlAttributeDecorator]]
*/
object DefaultHtmlAttributeDecorator extends HtmlAttributeDecorator {
override def decorateAttributes(elementType: FormElementType,
... | NovaMage/SValidator | src/main/scala/com/github/novamage/svalidator/html/DefaultHtmlAttributeDecorator.scala | Scala | mit | 656 |
/*
* 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 | resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala | Scala | apache-2.0 | 31,442 |
package com.twitter.zipkin.receiver.kafka
import com.twitter.logging.Logger
import com.twitter.ostrich.admin.{Service => OstrichService, ServiceTracker}
import com.twitter.util.{Closable, CloseAwaitably, Future, FuturePool, Time}
import com.twitter.zipkin.common._
import java.net.{SocketAddress, InetSocketAddress}
imp... | junfeihu/zipkin | zipkin-receiver-kafka/src/main/scala/com/twitter/zipkin/receiver/kafka/KafkaProcessor.scala | Scala | apache-2.0 | 1,722 |
/*
* 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 ... | bwsw/sj-platform | core/sj-common/src/main/scala/com/bwsw/sj/common/engine/core/input/InputStreamingExecutor.scala | Scala | apache-2.0 | 5,012 |
import sbt.Keys._
import sbt._
object CodisScalaClientBuild extends Build {
val basicSettings = Seq(
organization := "com.CodisLabs.codis",
version := "0.0.1-SNAPSHOT",
scalaVersion := "2.10.5",
publishMavenStyle := true,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isS... | Neeke/codis | extern/scala-client/project/Build.scala | Scala | mit | 1,241 |
package com.github.davidhoyt.playground.learn
class FreeMonads extends App {
trait Monad[F[_]] {
def point[A](a: A): F[A]
def bind[A, B](given: F[A])(fn: A => F[B]): F[B]
def flatMap[A, B](given: F[A])(fn: A => F[B]): F[B] = bind(given)(fn)
def map[A, B](given: F[A])(fn: A => B): F[B] = bind[A, B](g... | davidhoyt/playground-scala | src/main/scala/com/github/davidhoyt/playground/learn/FreeMonads.scala | Scala | apache-2.0 | 797 |
package webshop.webservice
import cats.effect.{IO, Timer}
import webshop.webservice.CheckoutFlowEvents.ShippingConfirmed
import webshop.webservice.CheckoutFlowIngredients.{ReservedItems, ShippingAddress}
import webshop.webservice.CheckoutFlowInteractions.ShipItems
import scala.concurrent.Future
import scala.concurren... | ing-bank/baker | examples/baker-example/src/main/scala/webshop/webservice/ShipItemsInstance.scala | Scala | mit | 615 |
package spire
package laws
import spire.algebra._
import spire.algebra.lattice._
import spire.implicits._
import org.typelevel.discipline.Laws
import org.scalacheck.{Arbitrary, Prop}
import org.scalacheck.Prop._
import InvalidTestException._
object LatticePartialOrderLaws {
def apply[A : Eq : Arbitrary] = new La... | non/spire | laws/src/main/scala/spire/laws/LatticePartialOrderLaws.scala | Scala | mit | 3,525 |
/*
* Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* 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/... | yuyupapa/OpenSource | scouter.server/src/scouter/server/db/VisitorHourlyDB.scala | Scala | apache-2.0 | 4,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 not u... | gioenn/xSpark | sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala | Scala | apache-2.0 | 4,715 |
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.