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 |
|---|---|---|---|---|---|
/*
* 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 ... | WindCanDie/spark | core/src/main/scala/org/apache/spark/storage/BlockManager.scala | Scala | apache-2.0 | 70,722 |
package org.littlewings.javaee7.batch
import java.io.Serializable
import javax.batch.api.chunk.ItemReader
import javax.enterprise.context.Dependent
import javax.inject.Named
import org.jboss.logging.Logger
@Dependent
@Named("MyItemReader")
class MyItemReader extends ItemReader {
private val logger: Logger = Logger... | kazuhira-r/javaee7-scala-examples | jbatch-chunked-with-tx/src/main/scala/org/littlewings/javaee7/batch/MyItemReader.scala | Scala | mit | 858 |
/*
* Copyright 2015 Commonwealth Computer Research, 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 applicabl... | jnh5y/geomesa | geomesa-feature/src/main/scala/org/locationtech/geomesa/feature/serialization/AbstractReader.scala | Scala | apache-2.0 | 4,571 |
package rpgboss.editor.uibase
import scala.swing._
import scala.swing.event._
import java.awt.event.MouseEvent
import javax.swing.UIManager
import javax.swing.BorderFactory
import java.awt.Font
import scala.collection.mutable.ArrayBuffer
import rpgboss.editor.Internationalized._
import scala.reflect.ClassTag
import ja... | hendrik-weiler/rpgboss | editor/src/main/scala/rpgboss/editor/uibase/InlineWidgetArrayEditor.scala | Scala | agpl-3.0 | 4,863 |
package com.github.blemale.scaffeine
import java.util.concurrent.Executor
object DirectExecutor extends Executor {
override def execute(command: Runnable): Unit = command.run()
}
| blemale/scaffeine | src/test/scala/com/github/blemale/scaffeine/DirectExecutor.scala | Scala | apache-2.0 | 183 |
package com.ebay.neutrino.datasource
import com.ebay.neutrino.config.{LoadBalancer, Configuration}
import com.typesafe.config.Config
/**
* Created by blpaul on 2/24/2016.
*/
trait DataSource {
// refresh the datasource
def load() : LoadBalancer
}
class FileReader extends DataSource {
override def load():... | eBay/Neutrino | src/main/scala/com/ebay/neutrino/datasource/DataSource.scala | Scala | apache-2.0 | 447 |
/*
* 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 | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/SubstituteUnresolvedOrdinalsSuite.scala | Scala | apache-2.0 | 2,766 |
package net.sf.latexdraw.glib.models.impl
import scala.collection.JavaConversions.asScalaBuffer
import net.sf.latexdraw.glib.models.interfaces.IGroup
import net.sf.latexdraw.glib.models.interfaces.IPoint
import net.sf.latexdraw.glib.models.interfaces.IStandardGrid
/**
* This trait encapsulates the code of the group... | arnobl/latexdraw-mutants | GUImutants/original/net.sf.latexdraw/src/main/net/sf/latexdraw/glib/models/impl/LGroupStdGrid.scala | Scala | gpl-2.0 | 5,989 |
/*
* 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... | jenniew/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/TanhSpec.scala | Scala | apache-2.0 | 3,469 |
/*
* Copyright 2019 Spotify AB.
*
* 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 ... | spotify/scio | scio-repl/src/it/resources/word-count-repl.scala | Scala | apache-2.0 | 864 |
/*
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | darroyocazorla/crossdata | testsIT/src/test/scala/com/stratio/crossdata/driver/DriverStandaloneIT.scala | Scala | apache-2.0 | 1,216 |
import leon.lang._
import leon.lang.synthesis._
import leon.annotation._
object Numerals {
sealed abstract class Num
case object Z extends Num
case class S(pred: Num) extends Num
def value(n: Num): BigInt = {
n match {
case Z => BigInt(0)
case S(p) => 1 + value(p)
}
} ensuring (_ >= 0)
... | epfl-lara/leon | testcases/web/synthesis/19_UnaryNumerals_Distinct.scala | Scala | gpl-3.0 | 561 |
/*
* 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... | travisbrown/scalatest | src/test/scala/org/scalatest/EveryShouldContainOneOfLogicalAndSpec.scala | Scala | apache-2.0 | 49,773 |
/*
* Copyright 2014-2021 Netflix, 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 agr... | brharrington/atlas | atlas-core/src/main/scala/com/netflix/atlas/core/util/IntIntHashMap.scala | Scala | apache-2.0 | 4,482 |
/*
* 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 ... | ZxlAaron/mypros | mllib/src/main/scala/org/apache/spark/ml/feature/MinHashLSH.scala | Scala | apache-2.0 | 7,303 |
/*
* 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 ... | TiVo/kafka | core/src/test/scala/unit/kafka/cluster/PartitionTest.scala | Scala | apache-2.0 | 88,036 |
package com.twitter.finagle.loadbalancer
import com.twitter.finagle.{Address, ClientConnection, Service}
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.util.DefaultTimer
import com.twitter.util.{Duration, Future, Time}
import java.util.concurrent.atomic.AtomicInteger
private trait Server ex... | koshelev/finagle | finagle-benchmark/src/main/scala/com/twitter/finagle/loadbalancer/ServerFactory.scala | Scala | apache-2.0 | 1,876 |
package org.psesd.srx.shared.core.exceptions
/** SIF request or response body does not match specified content type.
*
* @version 1.0
* @since 1.0
* @author Stephen Pugmire (iTrellis, LLC)
**/
class SifContentTypeInvalidException(val description: String) extends IllegalArgumentException(
description
)
| PSESD/srx-shared-core | src/main/scala/org/psesd/srx/shared/core/exceptions/SifContentTypeInvalidException.scala | Scala | mit | 316 |
import leon.annotation._
import leon.lang._
import leon.lang.synthesis._
object AddressBookMake {
case class Address[A](info: A, priv: Boolean)
sealed abstract class AddressList[A] {
def size: BigInt = {
this match {
case Nil() => BigInt(0)
case Cons(head, tail) => BigInt(1) + tail.size... | epfl-lara/leon | testcases/synthesis/etienne-thesis/AddressBook/Make.scala | Scala | gpl-3.0 | 1,737 |
/*
* Copyright (c) 2014 François Cabrol.
*
* This file is part of MURAL.
*
* MURAL 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... | francoiscabrol/MURAL | src/main/scala/com/cabrol/francois/mural/generator/rulebased/method/Methods.scala | Scala | gpl-3.0 | 1,353 |
package com.sksamuel.scapegoat.inspections.math
import com.sksamuel.scapegoat.InspectionTest
/** @author Matic Potočnik */
class UseCbrtTest extends InspectionTest {
override val inspections = Seq(new UseCbrt)
"using pow instead of cbrt" - {
"should report warning" in {
val code = """object Test {
... | sksamuel/scapegoat | src/test/scala/com/sksamuel/scapegoat/inspections/math/UseCbrtTest.scala | Scala | apache-2.0 | 764 |
package models
import scala.collection.immutable
import org.specs2.mutable.Specification
import play.api.test._
import play.api.test.Helpers._
import com.ruimo.scoins.Scoping._
import helpers.InjectorSupport
import play.api.Application
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.db.Database
im... | ruimo/store2 | test/models/TransactionSummarySpec.scala | Scala | apache-2.0 | 18,623 |
package com.github.mdr.mash.ns.core
import com.github.mdr.mash.Singletons
import com.github.mdr.mash.classes.{ Field, MashClass, NewStaticMethod }
import com.github.mdr.mash.compiler.CompilationUnit
import com.github.mdr.mash.evaluator._
import com.github.mdr.mash.functions.{ BoundParams, MashMethod, ParameterModel }
... | mdr/mash | src/main/scala/com/github/mdr/mash/ns/core/HistoryEntryClass.scala | Scala | mit | 2,297 |
/* Copyright (C) 2008-2010 Univ of Massachusetts Amherst, Computer Science Dept
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://code.google.com/p/factorie/
This software is provided under the terms of the Eclipse Public License 1.0
as published by... | andrewmilkowski/factorie | src/main/scala/cc/factorie/VariableBoolean.scala | Scala | epl-1.0 | 4,265 |
package codechicken.multipart.handler
import cpw.mods.fml.common.Mod
import cpw.mods.fml.common.event.FMLPostInitializationEvent
import cpw.mods.fml.common.event.FMLPreInitializationEvent
import cpw.mods.fml.common.event.FMLInitializationEvent
import cpw.mods.fml.common.Mod.EventHandler
import cpw.mods.fml.common.even... | Chicken-Bones/ForgeMultipart | src/codechicken/multipart/handler/MultipartMod.scala | Scala | lgpl-2.1 | 1,119 |
package text.vector.wordembedding.fastText
import java.io.{File, IOException, PrintWriter}
import java.nio.charset.StandardCharsets
import java.nio.file.{Files, Path, Paths}
import ir.fulltext.indri.{IndriResult, TrecText}
import text.analyzer.JapaneseSentenceSplitter
import text.analyzer.mor.mecab.UnidicMecab
import... | ktr-skmt/FelisCatusZero | src/main/scala/text/vector/wordembedding/fastText/FastTextVectorGenerator.scala | Scala | apache-2.0 | 4,061 |
package scutil.text.extension
import scutil.text._
object StringContextImplicits extends StringContextImplicits
trait StringContextImplicits {
implicit final class TextStringContextExt(peer:StringContext) {
/** applies Text.stripMarginOnly */
def strip(args:String*):String = Text stripMarginOnly peer.s(args:_*)... | ritschwumm/scutil | modules/core/src/main/scala/scutil/text/extension/StringContextImplicits.scala | Scala | bsd-2-clause | 492 |
package ucesoft.cbm.formats
import ucesoft.cbm.peripheral.bus.BusDataIterator
import ucesoft.cbm.peripheral.drive.Floppy
import ucesoft.cbm.cpu.Memory
import java.io.RandomAccessFile
import scala.collection.mutable.ListBuffer
import java.util.StringTokenizer
import java.io.FileNotFoundException
import java.io.IOExcept... | abbruzze/kernal64 | Kernal64/src/ucesoft/cbm/formats/Diskette.scala | Scala | mit | 10,842 |
package fpinscala.testing
import fpinscala.laziness.Stream
import fpinscala.state._
import fpinscala.parallelism._
import fpinscala.parallelism.Par.Par
import Gen._
import Prop._
import java.util.concurrent.{Executors,ExecutorService}
/*
The library developed in this chapter goes through several iterations. This file... | 724399396/function-programming-in-scala | exercises/src/main/scala/fpinscala/testing/Gen.scala | Scala | mit | 5,497 |
package com.plasmaconduit.convergence.counters
import com.twitter.algebird._
import com.twitter.algebird.Operators._
final case class GACounter(actors: Map[String, GCounter]) {
def inc(actor: String): GACounter = {
val counter = actors.get(actor).map(_.inc).getOrElse(GCounter(1))
GACounter(actors + Map(act... | plasmaconduit/convergence | src/main/scala/com/plasmaconduit/convergence/counters/GACounter.scala | Scala | mit | 921 |
package io.citrine.lolo.trees.multitask
import io.citrine.lolo.PredictionResult
import io.citrine.lolo.linear.GuessTheMeanLearner
import io.citrine.lolo.trees.regression.RegressionTrainingLeaf
import io.citrine.lolo.trees.splits.{MultiTaskSplitter, NoSplit}
import io.citrine.lolo.trees.{InternalModelNode, ModelNode, T... | CitrineInformatics/lolo | src/main/scala/io/citrine/lolo/trees/multitask/MultiTaskTrainingNode.scala | Scala | apache-2.0 | 6,580 |
/*
* 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... | nilbody/sparkling-water | examples/src/main/scala/org/apache/spark/examples/h2o/HamOrSpamDemo.scala | Scala | apache-2.0 | 6,861 |
package poly.algebra
import poly.algebra.factory._
import poly.algebra.specgroup._
/**
* Represents a multiplicative commutative monoid.
*
* An instance of this typeclass should satisfy the following axioms:
* - $lawMultiplicativeAssociativity
* - $lawMultiplicativeIdentity
* - $lawMultiplicativeCommutativit... | ctongfei/poly-algebra | src/main/scala/poly/algebra/MultiplicativeCMonoid.scala | Scala | mit | 852 |
import org.apache.spark.{rdd, SparkContext, SparkConf}
object simpleSpark {
def main(args: Array[String])
{
val conf = new SparkConf().setAppName("Simple Application")
val logFile = "FlumeData.1457910781124" // Should be some file on your system
val sc = new SparkContext(conf)
val lines = sc.textFile(lo... | alexciobanu/ExpertSummit | Streeming/src/main/scala/simpleSpark.scala | Scala | apache-2.0 | 545 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monifu/monifu | monix-reactive/shared/src/test/scala/monix/reactive/observers/ContramapObserverSuite.scala | Scala | apache-2.0 | 2,497 |
package co.rc.authmanager.persistence.daos
import co.rc.authmanager.persistence.daos.base.DAO
import io.strongtyped.active.slick.Lens
import io.strongtyped.active.slick.Lens._
import slick.ast.BaseTypedType
/**
* Class that defines DAO implementation for RolesIps
*/
class RolesIpsDAO extends DAO {
import jdbcP... | rodricifuentes1/authentication-manager | src/main/scala/co/rc/authmanager/persistence/daos/RolesIpsDAO.scala | Scala | mit | 786 |
package org.bitcoins.core.number
import org.bitcoins.testkitcore.util.BitcoinSUnitTest
import scodec.bits.ByteVector
class UInt8Test extends BitcoinSUnitTest {
"UInt8" must "convert a byte to a UInt8 correctly" in {
UInt8.toUInt8(0.toByte) must be(UInt8.zero)
UInt8.toUInt8(1.toByte) must be(UInt8.one)
... | bitcoin-s/bitcoin-s | core-test/src/test/scala/org/bitcoins/core/number/UInt8Test.scala | Scala | mit | 567 |
package com.twitter.finatra.http.marshalling
import com.twitter.finagle.http.Message
import com.twitter.util.jackson.ScalaObjectMapper
object mapper {
implicit class RichObjectMapper[M <: ScalaObjectMapper](val self: M) extends AnyVal {
def parseMessageBody[T: Manifest](message: Message): T = {
if (messa... | twitter/finatra | http-core/src/main/scala/com/twitter/finatra/http/marshalling/mapper.scala | Scala | apache-2.0 | 870 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.annotation._
import leon.lang._
object BitsTricks {
def bitAt(x: Int, n: Int): Boolean = {
require(n >= 0 && n < 32)
((x >> n) & 1) == 1
}
def isEven(x: Int): Boolean = {
(x & 1) == 0
} ensuring(res => res == (x % 2 == 0))
def isNegative(x:... | epfl-lara/leon | src/test/resources/regression/verification/newsolvers/valid/BitsTricks.scala | Scala | gpl-3.0 | 2,635 |
package mlbigbook.math
import breeze.math.Semiring
import breeze.linalg.operators._
import breeze.storage.Zero
import scala.language.{higherKinds, implicitConversions}
import scala.reflect.ClassTag
/**
* An abstraction specifying operations one may perform using vectors and
* scalar values. These operations incl... | malcolmgreaves/bigmlbook | fp4ml-main/src/main/scala/mlbigbook/math/MathVectorOps.scala | Scala | lgpl-3.0 | 4,111 |
package util
import Functors._
import scala.annotation.tailrec
/**
* Just the usual fold grammar
*/
abstract class Foldable[+T, F[_]: Functor] extends java.io.Serializable { self =>
def fold[R](z: R, combine: (R, T) => R): F[R]
/**
* map. Pretty nice, cause we can forward the map
* function over to the ... | manojo/parsequery | macros/src/main/scala/util/Foldable.scala | Scala | mit | 4,179 |
package builder
import play.api.libs.json.{Json, JsUndefined}
import org.scalatest.{FunSpec, Matchers}
class JsonUtilSpec extends FunSpec with Matchers {
it("asOptString") {
JsonUtil.asOptString(Json.toJson("")) should be(None)
JsonUtil.asOptString(Json.toJson(" ")) should be(None)
JsonUtil.asOptStrin... | Seanstoppable/apidoc | core/src/test/scala/core/builder/JsonUtilSpec.scala | Scala | mit | 1,891 |
package css
import java.net.{InetAddress, InetSocketAddress}
import java.nio.channels.AsynchronousChannelGroup
import java.nio.charset.Charset
import java.nio.file.Paths
import java.util.concurrent.Executors
import cats.effect.IO
import css.CssStreamHandler._
import fs2._
import fs2.io.tcp
import fs2.io.tcp.serverWi... | scalavision/scunicorn | ideaWorkbench/src/main/scala/css/CssProcessor.scala | Scala | apache-2.0 | 3,518 |
/*
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 use this f... | mandar2812/DynaML | dynaml-core/src/main/scala/io/github/tailhq/dynaml/kernels/MLPKernel.scala | Scala | apache-2.0 | 3,558 |
/*
* Copyright 2017 Datamountaineer.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | datamountaineer/stream-reactor | kafka-connect-cassandra/src/test/scala/com/datamountaineer/streamreactor/connect/cassandra/source/TestCqlGenerator.scala | Scala | apache-2.0 | 7,183 |
/*
* 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 ... | bharathkk/samza | samza-core/src/test/scala/org/apache/samza/container/TestRunLoop.scala | Scala | apache-2.0 | 11,518 |
package ch.epfl.lamp.grading
import java.io.{ File, PrintWriter }
import scala.Predef.{ any2stringadd => _, _ }
import scala.util.Try
import scala.collection.mutable
import scala.pickling.directSubclasses
import scala.pickling.Defaults._
import scala.pickling.json._
import Entry._
final case class GradingSummary(scor... | sbt-coursera/scala-grading | runtime/src/main/scala/ch/epfl/lamp/grading/GradingSummary.scala | Scala | bsd-3-clause | 3,830 |
package gapt.proofs.lk.reductions
import gapt.expr.formula.Bottom
import gapt.expr.formula.Top
import gapt.expr.subst.Substitution
import gapt.proofs.lk.LKProof
import gapt.proofs.lk.rules.AndLeftRule
import gapt.proofs.lk.rules.AndRightRule
import gapt.proofs.lk.rules.BottomAxiom
import gapt.proofs.lk.rules.CutRule
i... | gapt/gapt | core/src/main/scala/gapt/proofs/lk/reductions/gradeReduction.scala | Scala | gpl-3.0 | 8,702 |
/*
* Copyright 2017 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... | VlachJosef/bforms-frontend | app/uk/gov/hmrc/bforms/models/VerificationResult.scala | Scala | apache-2.0 | 813 |
package com.nekogata.backlogger.js_exports.commands.setting
import com.nekogata.backlogger.application.command.setting.SaveSettingCommand
import scala.scalajs.js.annotation.{JSExport, JSExportTopLevel}
@JSExportTopLevel("SaveSettingCommand")
class SaveSettingCommandImpl extends SaveSettingCommand {
@JSExport
ove... | Shinpeim/BackLogger | scala/src/main/scala/com/nekogata/backlogger/js_exports/commands/setting/SaveSettingCommandImpl.scala | Scala | mit | 465 |
/*
* 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 ... | SHASHANKB/spark | sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala | Scala | apache-2.0 | 11,760 |
package akka.persistence.jdbc.migrator.integration
import akka.persistence.jdbc.migrator.MigratorSpec._
import akka.persistence.jdbc.migrator.JournalMigratorTest
class PostgresJournalMigratorTest extends JournalMigratorTest("postgres-application.conf") with PostgresCleaner
class MySQLJournalMigratorTest extends Jour... | dnvriend/akka-persistence-jdbc | migrator/src/it/scala/akka/persistence/jdbc/migrator/integration/JournalMigratorTest.scala | Scala | apache-2.0 | 603 |
/*
* Copyright 2018 Analytics Zoo 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... | intel-analytics/analytics-zoo | zoo/src/main/scala/com/intel/analytics/zoo/pipeline/nnframes/XGBoostHelper.scala | Scala | apache-2.0 | 1,116 |
package com.sksamuel.elastic4s.searches.queries.funcscorer
import org.elasticsearch.index.query.functionscore.{ExponentialDecayFunctionBuilder, ScoreFunctionBuilders}
import com.sksamuel.exts.OptionImplicits._
import org.elasticsearch.search.MultiValueMode
case class ExponentialDecayScoreDefinition(field: String,
... | ulric260/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/queries/funcscorer/ExponentialDecayScoreDefinition.scala | Scala | apache-2.0 | 1,493 |
package kuaixue.scala.book.chapter_12
import java.util.Arrays
object ParamInfer extends App {
import scala.math._
val num = 3.14
val fun = ceil _
println("fun=" + fun) //<function1>
fun(num)
val ar = Array(3.14, 1.42, 2.0).map(fun)
println("array=" + (Arrays toString ar))
val triple ... | slieer/scala-tutorials | src/main/scala/kuaixue/scala/book/chapter_12/ParamInfer.scala | Scala | apache-2.0 | 1,503 |
/*
* 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 ... | h2oai/sparkling-water | core/src/main/scala/ai/h2o/sparkling/H2OFrame.scala | Scala | apache-2.0 | 16,369 |
package com.oct.sclaav
import java.io.File
import com.oct.sclaav.cli.Parser
import com.oct.sclaav.visual.assembly.mosaic.{DoMosaicOfMosaics, DoMosaic}
import com.oct.sclaav.visual.search.MatchesByArgbAverageThresh
import org.slf4j.LoggerFactory
object Main {
val log = LoggerFactory.getLogger(getClass)
def main... | ogeagla/sclaav | src/main/scala/com/oct/sclaav/Main.scala | Scala | apache-2.0 | 2,429 |
package com.twitter.inject.app.internal
import com.google.inject.TypeLiteral
import com.google.inject.spi.TypeConverter
import com.twitter.util.{Duration => TwitterDuration}
import org.joda.time.Duration
private[app] object JodatimeDurationTypeConvertor extends TypeConverter {
def convert(value: String, toType: Typ... | syamantm/finatra | inject/inject-app/src/main/scala/com/twitter/inject/app/internal/JodatimeDurationTypeConvertor.scala | Scala | apache-2.0 | 454 |
package examples.miscellanea
import java.awt.{Dimension, Graphics2D, Point}
import rescala._
import scala.collection.mutable.ListBuffer
import scala.swing.{MainFrame, Panel, SimpleSwingApplication, Swing}
object PulsingCircle extends SimpleSwingApplication {
lazy val application = new PulsingCircle
def top = ap... | volkc/REScala | Examples/examples/src/main/scala/examples/miscellanea/PulsingCircle.scala | Scala | apache-2.0 | 1,967 |
package org.http4s
import cats._
import cats.data._
import cats.functor.Contravariant
import cats.implicits._
final case class QueryParameterKey(value: String) extends AnyVal
final case class QueryParameterValue(value: String) extends AnyVal
/**
* type class defining the key of a query parameter
* Usually used in... | ZizhengTai/http4s | core/src/main/scala/org/http4s/QueryParam.scala | Scala | apache-2.0 | 6,917 |
import scala.quoted._
import scala.quoted.staging._
object Test {
def main(args: Array[String]): Unit = {
given Toolbox = Toolbox.make(getClass.getClassLoader)
val f = run {
f1
}
println(f(42))
println(f(43))
}
def f1(using QuoteContext): Expr[Int => Int] = '{ n => ${Expr.betaReduce(f... | som-snytt/dotty | tests/run-staging/quote-fun-app-1.scala | Scala | apache-2.0 | 565 |
package rros
////////////////////////////////////////////////////////////////////////////////
/**
* In order for other socket to use the RROS protocol, developer needs to implement
* a small adapter which implement the SocketInterface.
* Created by namnguyen on 3/1/15.
*/
trait SocketAdapter extends AutoCloseable{
... | namhnguyen/RROS | src/main/scala/rros/SocketAdapter.scala | Scala | apache-2.0 | 1,397 |
package concrete
package constraint
package semantic
import java.util
import bitvectors.BitVector
import cspom.compiler.QueueSet
import scala.collection.mutable
/**
* Constraint x(i) = j <=> x(j) = i
*/
final class Channel(x: Array[Variable], offset: Int) extends Constraint(x)
with StatefulConstraint[Map[Int,... | concrete-cp/concrete | src/main/scala/concrete/constraint/semantic/Channel.scala | Scala | lgpl-2.1 | 3,158 |
package eu.leadowl.rd.axon.quickstart.aggregate
import eu.leadowl.rd.axon.quickstart.commands.{MarkCompletedCommand, CreateToDoItemCommand}
import eu.leadowl.rd.axon.quickstart.events.{ToDoItemCompletedEvent, ToDoItemCreatedEvent}
import org.axonframework.scynapse.test.EventMatchers
import org.axonframework.test.Fixtu... | leadowl/axon-quickstart-scala | src/test/scala/eu/leadowl/rd/axon/quickstart/aggregate/ToDoItemTest.scala | Scala | mit | 1,217 |
/**
* Copyright (C) 2014 TU Berlin (peel@dima.tu-berlin.de)
*
* 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... | lauritzthamsen/peel | peel-extensions/src/main/scala/org/peelframework/zookeeper/beans/system/Zookeeper.scala | Scala | apache-2.0 | 4,281 |
/*
* 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 ... | ron8hu/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeRowJoinerSuite.scala | Scala | apache-2.0 | 4,565 |
package com.ldaniels528.ricochet.entity
import java.util.Random
import com.ldaniels528.ricochet.Direction
import com.ldaniels528.ricochet.Direction._
/**
* Represents a moving entity within the virtual world
* @author "Lawrence Daniels" <lawrence.daniels@gmail.com>
*/
trait MovingEntity extends Entity {
private... | ldaniels528/ricochet | src/main/scala/com/ldaniels528/ricochet/entity/MovingEntity.scala | Scala | apache-2.0 | 916 |
package com.actors
import akka.actor.{Actor, ActorRef}
import akka.cluster.Cluster
import akka.cluster.pubsub.DistributedPubSubMediator._
import system.ontologies.Topic
import system.ontologies.messages.Location._
import system.ontologies.messages.MessageType.Init
import system.ontologies.messages.{AriadneMessage, Gre... | albertogiunta/arianna | src/main/scala/com/actors/BasicPubSub.scala | Scala | gpl-3.0 | 2,541 |
package com.websudos.phantom.builder.ops
import org.scalatest.{Matchers, FlatSpec}
class OperatorsTest extends FlatSpec with Matchers {
}
| nkijak/phantom | phantom-dsl/src/test/scala/com/websudos/phantom/builder/ops/OperatorsTest.scala | Scala | bsd-2-clause | 141 |
/***********************************************************************
* Copyright (c) 2013-2019 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | elahrvivaz/geomesa | geomesa-kudu/geomesa-kudu-datastore/src/main/scala/org/locationtech/geomesa/kudu/result/FilteringAdapter.scala | Scala | apache-2.0 | 3,574 |
package io.getquill.mysql
import io.getquill.MonixSpec
import monix.eval.Task
class MonixJdbcContextSpec extends MonixSpec {
val context = testContext
import testContext._
"provides transaction support" - {
"success" in {
(for {
_ <- testContext.run(qr1.delete)
_ <- testContext.trans... | mentegy/quill | quill-jdbc-monix/src/test/scala/io/getquill/mysql/MonixJdbcContextSpec.scala | Scala | apache-2.0 | 1,950 |
/*
* 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 ... | witgo/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/console.scala | Scala | apache-2.0 | 3,295 |
package breeze.integrate
import org.scalatest.FunSuite
import breeze.integrate
import breeze.linalg._
import breeze.numerics._
import scala.math.Pi
/**
*
* @author jaketimothy
**/
class NonstiffOdeTest extends FunSuite {
// allowable percent difference
val limit = 0.005
// Euler Equations vs. Matlab ode1... | claydonkey/breeze | math/src/test/scala/breeze/integrate/NonstiffOdeTest.scala | Scala | apache-2.0 | 2,926 |
package gx.answers
/** Question:
* http://stackoverflow.com/questions/40149010/does-this-specific-exercise-lend-itself-well-to-a-functional-style-design-patt/40150083#40150083
*/
object answer001 extends App {
val input = List(Map("abc" -> "123", "xy" -> "yz", "s12" -> "13"), Map("abc" -> "1", "s" -> "33"))
va... | josephguan/scala-stackoverflow | src/main/scala/gx/answers/answer001.scala | Scala | apache-2.0 | 663 |
/*
* Copyright 2011-2019 Asakusa Framework Team.
*
* 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 ... | ueshin/asakusafw-spark | extensions/iterativebatch/runtime/iterative/src/main/scala/com/asakusafw/spark/extensions/iterativebatch/runtime/iterative/listener/Logger.scala | Scala | apache-2.0 | 1,881 |
package models
// import scala.slick.driver.Postgres.simple._
import service.EncryptionService
// class User(val email: String, var name: String, var description: String) extends DomainEntity {
// var encryptedPassword: String = ""
// def encryptPassword(password: String) = {
// encryptedPassword = Encryptio... | hsihealth/aim_prototype | src/main/scala/models/user.scala | Scala | apache-2.0 | 527 |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed... | EntilZha/spark-s3 | src/main/scala/io/entilzha/spark/s3/S3Context.scala | Scala | apache-2.0 | 1,789 |
/**
* Copyright (C) 2017 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This p... | orbeon/orbeon-forms | common/shared/src/main/scala/org/orbeon/oxf/util/NumericUtils.scala | Scala | lgpl-2.1 | 867 |
/*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distri... | flaminem/flamy | src/test/scala/com/flaminem/flamy/parsing/hive/CreateTableParser$Test.scala | Scala | apache-2.0 | 2,476 |
package io.estatico.generic.traits
import org.scalatest.{FlatSpec, Matchers}
import shapeless._
class TraitInstancesTest extends FlatSpec with Matchers {
import TraitInstancesTest._
"TraitInstances" should "create a valid Generic instance" in {
val g = Generic[Foo]
g.to(foo) shouldEqual fooHList
val... | estatico/generic-traits | src/test/scala/io/estatico/generic/traits/TraitInstancesTest.scala | Scala | apache-2.0 | 3,660 |
package at.magiun.core.service
import at.magiun.core.TestData._
import at.magiun.core.model.{BlockInput, BlockType}
import at.magiun.core.repository.{BlockEntity, BlockRepository}
import at.magiun.core.{MainModule, UnitTest}
import scala.concurrent.{Await, Future}
class BlockServiceTest extends UnitTest {
private... | Mihai238/magiun | core/src/test/scala/at/magiun/core/service/BlockServiceTest.scala | Scala | apache-2.0 | 1,265 |
/*
* 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 ... | HuaweiBigData/astro | src/test/scala/org/apache/spark/sql/hbase/TestHbase.scala | Scala | apache-2.0 | 2,125 |
package me.eax.akka_examples
import akka.actor._
import akka.pattern.ask
import akka.event.LoggingReceive
import akka.routing.FromConfig
import scala.concurrent.duration._
import me.eax.akka_examples.commons._
package object profile {
case class ProfileInfo(uid: Long, username: String, email: String)
object Pro... | afiskon/akka-cluster-router-example | src/main/scala/me/eax/akka_examples/profile/package.scala | Scala | mit | 2,068 |
import com.thesamet.pb.EnumOptions.{EnumBase, EnumCompanionBase, ValueMixin}
import com.thesamet.proto.e2e.enum_options._
import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.must.Matchers
class EnumOptionsSpec extends AnyFlatSpec with Matchers with OptionValues {
"companion... | scalapb/ScalaPB | e2e/src/test/scala/EnumOptionsSpec.scala | Scala | apache-2.0 | 1,352 |
package io.github.rollenholt.scala.email.sender
import akka.actor.SupervisorStrategy.{Escalate, Resume}
import akka.actor._
import akka.event.{Logging, LoggingAdapter}
import akka.routing.{DefaultResizer, RoundRobinPool}
import scala.concurrent.duration._
import scala.language.postfixOps
/**
* @author rollenholt
... | rollenholt/scala-email-sender | src/main/scala/io/github/rollenholt/scala/email/sender/EmailSenderActor.scala | Scala | mit | 1,141 |
/*
* Copyright 2014 Kate von Roeder (katevonroder at gmail 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 requ... | Damiya/legendary | LibFateClasher/src/test/scala/com/itsdamiya/fateclasher/platform/encoding/EncodingSpec.scala | Scala | apache-2.0 | 2,532 |
/*
* 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 ... | chuckchen/spark | core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala | Scala | apache-2.0 | 71,967 |
package frameless
package ops
package deserialized
import org.scalacheck.Prop
import org.scalacheck.Prop._
class FlatMapTests extends TypedDatasetSuite {
test("flatMap") {
def prop[A: TypedEncoder, B: TypedEncoder](flatMapFunction: A => Vector[B], data: Vector[A]): Prop =
TypedDataset.create(data).
... | adelbertc/frameless | dataset/src/test/scala/frameless/ops/deserialized/FlatMapTests.scala | Scala | apache-2.0 | 557 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.singleTest
import org.jetbrains.plugins.scala.testingSupport.scalatest.generators.WordSpecGenerator
/**
* @author Roman.Shein
* @since 20.01.2015.
*/
trait WordSpecSingleTestTest extends WordSpecGenerator {
val wordSpecTestPath = List("[root]", "WordSp... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/scalatest/singleTest/WordSpecSingleTestTest.scala | Scala | apache-2.0 | 724 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/ ... | S-Mach/aeondb | src/test/scala/s_mach/aeondb/AeonMapTest.scala | Scala | apache-2.0 | 1,207 |
package org.jetbrains.plugins.scala.testingSupport.scalatest
/**
* @author Roman.Shein
* @since 11.02.2015.
*/
trait ScalaTest1GoToSourceTest extends ScalaTestGoToSourceTest {
def getSuccessfulTestPath: List[String] = List("[root]", "Successful test should run fine")
def getPendingTestPath: List[String] = List(... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/scalatest/ScalaTest1GoToSourceTest.scala | Scala | apache-2.0 | 848 |
package org.nd4s.ops
import org.nd4j.autodiff.samediff.SDVariable
import org.nd4j.linalg.api.complex.IComplexNumber
import org.nd4j.linalg.api.ndarray.INDArray
import org.nd4j.linalg.api.ops.{Op, BaseScalarOp}
import org.nd4j.linalg.factory.Nd4j
import org.nd4s.Implicits._
object BitFilterOps {
def apply(x:INDArray... | deeplearning4j/nd4s | src/main/scala/org/nd4s/ops/BitFilterOps.scala | Scala | apache-2.0 | 1,555 |
val list = List("ala", "ma", "kota")
val size = (0 /: list) { (sum, s) => sum + s.size }
// println size
println(size)
println(list.map(_.size).reduceLeft(_+_))
println(list.map(_.size).sum)
| rkj/7langs7weeks | 4scala/2day/foldl.scala | Scala | mit | 192 |
/*
* -╥⌐⌐⌐⌐ -⌐⌐⌐⌐-
* ≡╢░░░░⌐\\░░░φ ╓╝░░░░⌐░░░░╪╕
* ╣╬░░` `░░░╢┘ φ▒╣╬╝╜ ░░╢╣Q
* ║╣╬░⌐ ` ╤▒▒▒Å` ║╢╬╣
* ╚╣╬░⌐ ╔▒▒▒▒`«╕ ╢╢╣▒
* ╫╬░░╖ .░ ╙╨╨ ╣╣╬░φ ╓φ░╢╢Å
* ╙╢░░░░⌐"░░░╜ ╙Å░░░░⌐░░░░╝`
* ``˚¬ ⌐ ˚˚⌐´
*
* ... | Flipkart/connekt | commons/src/main/scala/com/flipkart/connekt/commons/dao/TUserInfo.scala | Scala | mit | 895 |
package io.reactivecqrs.core.projection
abstract class AggregateListenerActor extends ProjectionActor {
protected def receiveQuery: Receive = {
case m => ()
}
protected override def onClearProjectionData(): Unit = {
// override by child if needed
}
}
| marpiec/ReactiveCQRS | core/src/main/scala/io/reactivecqrs/core/projection/AggregateListenerActor.scala | Scala | apache-2.0 | 271 |
/*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distri... | flaminem/flamy | src/main/scala/com/flaminem/flamy/utils/io/OutputInterceptor.scala | Scala | apache-2.0 | 3,601 |
/*
* Copyright (c) 2015 Andreas Wolf
*
* See te LICENSE file in the project root for further copyright information.
*/
package info.andreaswolf.roadhopper.simulation.control
import akka.actor.{ActorLogging, ActorRef}
import akka.pattern.ask
import info.andreaswolf.roadhopper.simulation.signals.SignalBus.UpdateSig... | andreaswolf/roadhopper | src/main/scala/info/andreaswolf/roadhopper/simulation/control/PT1.scala | Scala | mit | 2,267 |
package ksp
class Vessel(self: ksp.Object) extends WrappedObject(self) {
assert(self.kind == "VESSEL")
def root = new Part(self.getChild("PART", self.getProperty("root").toInt))
/* Two VESSELs are equal if:
- they have the same name, and
- they have the same root part
*/
override def equals(oth... | ToxicFrog/kessler | libksp/src/Vessel.scala | Scala | mit | 1,301 |
//
// Copyright (c) 2014 Ole Krause-Sparmann
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge,... | pixelogik/postwall | postwall/api/src/main/scala/com/postwall/api/actors/APIServiceActor.scala | Scala | mit | 4,569 |
/*
* Copyright 2019 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | nicf82/play-ui | src/test/scala/uk/gov/hmrc/play/binders/ContinueUrlSpec.scala | Scala | apache-2.0 | 3,413 |
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.