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 |
|---|---|---|---|---|---|
/*
* This file is part of the "silex" library of helpers for Apache Spark.
*
* Copyright (c) 2015 Red Hat, 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.... | jyt109/silex | src/main/scala/com/redhat/et/silex/util/regexImplicits.scala | Scala | apache-2.0 | 965 |
def f(arr: List[Int]): List[Int] = arr.map(math.abs)
| advancedxy/hackerrank | functional-programming/intro/UpdateList.scala | Scala | mit | 53 |
import scala.concurrent.{ Await, Future }
import scala.concurrent.duration.{ DurationInt, FiniteDuration, MILLISECONDS }
import reactivemongo.bson.BSONDocument
import reactivemongo.core.errors.DetailedDatabaseException
import reactivemongo.api.{ Cursor, CursorFlattener, CursorProducer }
import reactivemongo.api.collec... | maxime-gautre/ReactiveMongo | driver/src/test/scala/Cursor1Spec.scala | Scala | apache-2.0 | 11,644 |
package forimpatient.chapter06
/**
* Created by Iryna Kharaborkina on 8/3/16.
*
* Solution to the Chapter 06 Exercise 08 'Scala for the Impatient' by Horstmann C.S.
*
* Write an enumeration describing the eight corners of the RGB color cube. As IDs, use the color values
* (for example, 0xff0000 for Red).
... | Kiryna/Scala-for-the-Impatient | src/forimpatient/chapter06/Exercise08.scala | Scala | apache-2.0 | 774 |
package org.danielnixon.playwarts
import java.io.File
import akka.actor.ActorSystem
import akka.stream.Materializer
import com.typesafe.config.{ Config, ConfigFactory }
import org.scalatest.FunSuite
import org.wartremover.test.WartTestTraverser
import play.api
import play.api.http.{ HttpErrorHandler, HttpRequestHandl... | danielnixon/playwarts | core/src/test/scala/org/danielnixon/playwarts/JavaApiTest.scala | Scala | apache-2.0 | 12,615 |
package org.nlogo.extensions.webview
import javafx.scene.web.WebEngine
import netscape.javascript.JSObject
import org.nlogo.core.LogoList
class JsTranslator(webEngine: WebEngine) {
val ObjectProto =
webEngine.executeScript("Object").asInstanceOf[JSObject]
val unrollJsArray: PartialFunction[JSObject, Seq[An... | NetLogo/webview | src/main/scala/JsTranslator.scala | Scala | cc0-1.0 | 1,454 |
/*
* Copyright 2008-present MongoDB, 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 ag... | rozza/mongo-scala-driver | driver/src/main/scala/org/mongodb/scala/model/CollationMaxVariable.scala | Scala | apache-2.0 | 1,633 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | jooooooon/rudder | rudder-web/src/main/scala/com/normation/rudder/web/snippet/administration/ClearCache.scala | Scala | agpl-3.0 | 4,636 |
/*
* 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 ... | vjagadish/samza-clone | samza-kv/src/test/scala/org/apache/samza/storage/kv/MockKeyValueStore.scala | Scala | apache-2.0 | 2,715 |
package argonaut
import Data._
import org.specs2._, org.specs2.specification._
import org.specs2.matcher._
import scalaz._, Scalaz._
import Argonaut._
object CodecNumberSpecification extends Specification with ScalaCheck {
def is = s2"""
Codec Numbers
double that is not NaN or infinity encodes to number $dou... | travisbrown/argonaut | src/test/scala/argonaut/CodecNumberSpecification.scala | Scala | bsd-3-clause | 796 |
package scabot
package lightbend
import spray.json.{RootJsonFormat, DefaultJsonProtocol}
trait LightbendApi extends LightbendApiTypes with DefaultJsonProtocol with LightbendApiActions
trait LightbendApiTypes {
case class CLARecord(user: String, signed: Boolean, version: Option[String], currentVersion: String)
}
t... | adriaanm/scabot | lightbend/src/main/scala/scabot/lightbend/LightbendApi.scala | Scala | bsd-3-clause | 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 ... | hengyicai/OnlineAggregationUCAS | sql/core/src/test/scala/org/apache/spark/sql/columnar/compression/TestCompressibleColumnBuilder.scala | Scala | apache-2.0 | 1,672 |
package battle
import battle.Equippable.{Defense, Attack}
import org.scalatest.{Matchers, FlatSpecLike}
class EquippableSpec extends Matchers with FlatSpecLike {
"An Equippable" should "add 1 to attackRoll when defined with attack + 1 " in {
object TestSword extends Equippable {
attack + 1
}
Te... | bbalser/gladiator-actors | src/test/scala/battle/EquippableSpec.scala | Scala | cc0-1.0 | 1,642 |
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{universe => ru}
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
object Test extends dotty.runtime.LegacyApp {
val code = reify {
def x = 2
println(x)
};
val toolbox = cm.mkToolBox()
val evaluate... | yusuke2255/dotty | tests/disabled/macro/run/t5266_1.scala | Scala | bsd-3-clause | 388 |
import org.specs2.mutable.Specification
class HelloWorldSpec extends Specification {
skipAllIf(true)
"The 'Hello world' string" should {
"contain 11 characters" in {
"Hello world" must have size(11)
}
"start with 'Hello'" in {
"Hello world" must startWith("Hello")
}
"end with 'world... | JetBrains/sbt-tc-logger | test/testdata/ignoredTest/src/test/scala/HelloWorldSpec.scala | Scala | apache-2.0 | 381 |
package com.rbmhtechnology.eventuate.tools.healthcheck.dropwizard
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.Props
import com.codahale.metrics.health.HealthCheck
import com.codahale.metrics.health.HealthCheckRegistry
import com.rbmhtechnology.eventuate.tools.healthcheck.dropwizard.Healt... | RBMHTechnology/eventuate-tools | dropwizard-healthchecks/src/main/scala/com/rbmhtechnology/eventuate/tools/healthcheck/dropwizard/AvailabilityMonitor.scala | Scala | apache-2.0 | 4,389 |
package io.udash.web.guide.views.ext.demo.charts
import io.udash.wrappers.highcharts.config.HighchartsConfig
import io.udash.wrappers.highcharts.config.axis.{XAxis, YAxis}
import io.udash.wrappers.highcharts.config.chart.Chart
import io.udash.wrappers.highcharts.config.credits.Credits
import io.udash.wrappers.highchar... | UdashFramework/udash-guide | guide/src/main/scala/io/udash/web/guide/views/ext/demo/charts/Spiderweb.scala | Scala | gpl-3.0 | 1,814 |
/*
* Copyright 2022 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/iht-frontend | app/iht/utils/pdf/FopURIResolver.scala | Scala | apache-2.0 | 1,361 |
package chandu0101.scalajs.react.components
package materialui
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import scala.scalajs.js
/**
* This file is generated - submit issues instead of PR against it
*/
case class MuiFontIcon(key: js.UndefOr[String] = js.undefined,
... | rleibman/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/materialui/MuiFontIcon.scala | Scala | apache-2.0 | 1,251 |
/*
* Copyright (c) <2015-2016>, see CONTRIBUTORS
* 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... | amanjpro/languages-a-la-carte | primj/src/main/scala/types/types.scala | Scala | bsd-3-clause | 2,724 |
/*
* 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-ftp/src/main/scala/com/datamountaineer/streamreactor/connect/ftp/source/FileConverter.scala | Scala | apache-2.0 | 1,693 |
/*
* Copyright 2017 Beikern
*
* 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 w... | beikern/functional-programming-scala | handling-errors-without-exceptions/src/main/scala/es/beikern/functional/programming/datatypes/Either.scala | Scala | apache-2.0 | 1,498 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/Quasar | frontend/src/test/scala/quasar/std/StdLibTypeCoherenceSpec.scala | Scala | apache-2.0 | 8,645 |
package com.github.j5ik2o.forseti.domain.user
case class Address(
streetAddress: String,
locality: String,
region: String,
postalCode: String,
country: String
) {
val formatted = s"$streetAddress, $locality, $region, $postalCode, $country"
}
| j5ik2o/forseti | domain/src/main/scala/com/github/j5ik2o/forseti/domain/user/Address.scala | Scala | mit | 265 |
/*
* 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/BatchNormalization.scala | Scala | apache-2.0 | 5,525 |
/*
* Copyright (C) 2017 Fabrizio Colonna
*
* 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 ag... | ColOfAbRiX/tankwar | src/main/scala/com/colofabrix/scala/gfx/Drawing.scala | Scala | apache-2.0 | 3,342 |
/*
* Copyright 2010 LinkedIn
*
* 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... | tcrayford/hafka | kafka/core/src/main/scala/kafka/tools/SimpleConsumerShell.scala | Scala | bsd-3-clause | 3,777 |
package org.invisibletech.myfpscala.errorhandling
//hide std library `Option` and `Either`, since we are writing our own in this chapter
import scala.{ Option => _, Either => _, _ }
import scala.util._
sealed trait Either[+E, +A] {
def map[B](f: A => B): Either[E, B] = this match {
case Left(e) => Left(e)
... | InvisibleTech/my-fp-scala | src/main/scala/chapitre-3/Either.scala | Scala | mit | 1,636 |
package org.ciroque.ccr
import scala.concurrent.ExecutionContext.Implicits.global
import org.ciroque.ccr.core.{Commons, CcrService}
import org.ciroque.ccr.datastores.DataStoreResults._
import org.ciroque.ccr.datastores.SettingsDataStore
import org.ciroque.ccr.logging.ImplicitLogging._
import org.ciroque.ccr.models.Con... | ciroque/central-configuration-repository | src/main/scala/org/ciroque/ccr/BulkConfigurationSchedulingService.scala | Scala | mit | 4,085 |
/*
* 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 ... | mzl9039/spark | core/src/main/scala/org/apache/spark/shuffle/BlockStoreShuffleReader.scala | Scala | apache-2.0 | 5,224 |
package org.langmeta
package semanticdb
import scala.annotation.switch
import scala.runtime.AbstractFunction4
final class Denotation(
val flags: Long,
val name: String,
val signature: String,
val names: List[ResolvedName],
val members: List[Signature]
) extends HasFlags
with Product
with S... | DavidDudson/scalameta | langmeta/langmeta/shared/src/main/scala/org/langmeta/semanticdb/Denotation.scala | Scala | bsd-3-clause | 3,097 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | derekmorr/squants | shared/src/test/scala/squants/experimental/json/MoneySerializer.scala | Scala | apache-2.0 | 1,728 |
/* DO NOT EDIT THIS FILE - it is machine generated */
/* Copyright 2017-19, Emmanouil Antonios Platanios. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* h... | eaplatanios/tensorflow_scala | modules/jni/src/main/scala/org/platanios/tensorflow/jni/generated/tensors/Basic.scala | Scala | apache-2.0 | 6,487 |
/*
* _ _
* _ __ ___ | |__ | | ___
* | '_ \ / _ \| '_ \| |/ _ \ noble :: norcane blog engine
* | | | | (_) | |_) | | __/ Copyright (c) 2016-2018 norcane
* |_| |_|\___/|_.__/|_|\___|
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file excep... | norcane/noble | sdk/noble-api/src/main/scala/com/norcane/noble/api/models/dates/Month.scala | Scala | apache-2.0 | 2,164 |
/***********************************************************************
* Copyright (c) 2013-2015 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 is ... | drackaer/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/stats/QueryStat.scala | Scala | apache-2.0 | 5,212 |
import scalanative.unsafe._
import scalanative.unsigned._
import sdl2.SDL._
import sdl2.Extras._
import gl.GL._
import gl.Extras._
object Chapter1A {
def main(args: Array[String]): Unit = {
SDL_Init(SDL_INIT_VIDEO)
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1)
SDL_GL_SetAttribute(SDL_GL_CONTEX... | regb/scalanative-graphics-bindings | examples/red-book/Chapter1.scala | Scala | mit | 3,899 |
/*
* Copyright (c) 2015-6 Miles Sabin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | milessabin/macro-compat | core/src/main/scala_2.10/macrocompat/compatcontext.scala | Scala | apache-2.0 | 18,534 |
/*
* Licensed to Metamarkets Group Inc. (Metamarkets) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Metamarkets licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); ... | druid-io/tranquility | flink/src/main/scala/com/metamx/tranquility/flink/BeamSink.scala | Scala | apache-2.0 | 3,049 |
/**
* SparklineData, Inc. -- http://www.sparklinedata.com/
*
* Scala based Audience Behavior APIs
*
* Copyright 2014-2015 SparklineData, 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 Lice... | cubefyre/audience-behavior-semantic-etl | etl/src/main/scala/org/sparkline/etl/operators/AddColumns.scala | Scala | apache-2.0 | 1,363 |
package slick.jdbc.meta
import slick.jdbc.ResultSetAction
/** A wrapper for a row in the ResultSet returned by DatabaseMetaData.getClientInfoProperties(). */
case class MClientInfoProperty(name: String, maxLen: Int, defaultValue: String, description: String)
object MClientInfoProperty {
def getClientInfoProperties... | jkutner/slick | slick/src/main/scala/slick/jdbc/meta/MClientInfoProperty.scala | Scala | bsd-2-clause | 546 |
/*
* Copyright (C) 2011 Leclaire Mathieu <mathieu.Mathieu Leclaire at openmole.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your... | ISCPIF/PSEExperiments | openmole-src/openmole/plugins/org.openmole.plugin.hook.file/src/main/scala/org/openmole/plugin/hook/file/DeleteFileHook.scala | Scala | agpl-3.0 | 1,733 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api
import java.time.format.DateTimeFormatter
import java.time.ZoneId
/**
* Contains standard HTTP constants.
* For example:
* {{{
* val text = ContentTypes.TEXT
* val ok = Status.OK
* val accept = HeaderNames.ACCEPT
* }... | Shenker93/playframework | framework/src/play/src/main/scala/play/api/http/package.scala | Scala | apache-2.0 | 549 |
/*
* 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/amls-frontend | app/controllers/responsiblepeople/address/NewHomeAddressUKController.scala | Scala | apache-2.0 | 3,236 |
package com.github.chengpohi.domain.user
import java.util.Date
import com.github.chengpohi.dsl.annotation.{Alias, Index}
case class Info(name: String,
@Index("not_analyzed") email: String,
@Index("not_analyzed") password: String,
@Alias("created_at") createdAt: Date)
| chengpohi/coolmarks | modules/core-service/src/main/scala/com.github.chengpohi/domain/user/Info.scala | Scala | apache-2.0 | 319 |
package debop4s.core.utils
import java.io.InputStream
import debop4s.core.{ AbstractCoreFunSuite, _ }
/**
* ResourcesFunSuite
* @author Sunghyouk Bae
*/
class ResourcesFunSuite extends AbstractCoreFunSuite {
test("load resources") {
using(Resources.getClassPathResourceStream("globalization.xml")) { is =>
... | debop/debop4s | debop4s-core/src/test/scala/debop4s/core/utils/ResourcesFunSuite.scala | Scala | apache-2.0 | 616 |
package org.crudible.lift.binding.model
import scala.xml.NodeSeq
import net.liftweb.http.js.JsCmd
trait LiftControl {
def render(): NodeSeq
def updateViewByCurrentValidationContext(): JsCmd
} | rehei/crudible | crudible-lift/src/main/scala/org/crudible/lift/binding/model/LiftControl.scala | Scala | apache-2.0 | 200 |
/*
* 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/report/StatsReportGenerator.scala | Scala | apache-2.0 | 8,458 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | cran/rkafkajars | java/scala/collection/TraversableView.scala | Scala | apache-2.0 | 1,649 |
/*
* 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-test-framework/src/main/scala/io/gatling/sbt/GatlingTask.scala | Scala | apache-2.0 | 3,573 |
package eu.liderproject.functionalsparql
import com.hp.hpl.jena.graph.{Node, NodeFactory, Triple}
import com.hp.hpl.jena.query.{Query, QueryFactory}
import com.hp.hpl.jena.sparql.core._
import com.hp.hpl.jena.sparql.expr._
import com.hp.hpl.jena.sparql.expr.nodevalue._
import com.hp.hpl.jena.sparql.syntax._
import jav... | jmccrae/functionalsparql | src/main/scala/functionalsparql/Planner.scala | Scala | apache-2.0 | 30,670 |
trait X {
// error: in XML literal: name expected, but char '!' cannot start a name
def x = <![CDATA[hi & bye]]> <![CDATA[red & black]]>
}
| loskutov/intellij-scala | testdata/scalacTests/pos/t3368.scala | Scala | apache-2.0 | 144 |
package com.vivint.ceph
import java.util.UUID
import org.apache.mesos.Protos
import com.vivint.ceph.model.{ Location, TaskState }
import com.vivint.ceph.model.{ JobRole, Job }
import JobFSM._
import Behavior._
import scala.concurrent.duration._
import scaldi.Injector
import scaldi.Injectable._
import ProtoHelpers._
im... | vivint-smarthome/ceph-on-mesos | src/main/scala/com/vivint/ceph/Behaviors.scala | Scala | apache-2.0 | 12,423 |
package models.elasticsearch
import org.joda.time.DateTime
case class IndexStatus(
alias: String,
indexed: DateTime,
updated: Option[DateTime]
)
| MUSIT-Norway/musit | service_backend/app/models/elasticsearch/IndexStatus.scala | Scala | gpl-2.0 | 159 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/table/TemporalTableJoinTest.scala | Scala | apache-2.0 | 9,734 |
/*
* 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 ... | maropu/spark | resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala | Scala | apache-2.0 | 27,970 |
package dk.bayes.clustergraph.factor
/**
* Factor utilities.
*
* @author Daniel Korzekwa
*/
object FactorUtil {
/**
* Returns vector normalised to 1.
*/
def normalise(vector: Array[Double]): Array[Double] = {
var normalisation = 0d
val normalisedVector = new Array[Double](vector.size)
var i... | danielkorzekwa/bayes-scala | src/main/scala/dk/bayes/clustergraph/factor/FactorUtil.scala | Scala | bsd-2-clause | 1,385 |
package com.mentatlabs.nsa
package scalac
package dsl
package experimental
trait ScalacXDevDSL
extends ScalacExperimentalDSL {
object Xdev {
val unary_- = options.ScalacXDev
}
}
| mentat-labs/sbt-nsa | nsa-dsl/src/main/scala/com/mentatlabs/nsa/scalac/dsl/experimental/advanced/ScalacXDevDSL.scala | Scala | bsd-3-clause | 192 |
package com.sk.app.proxmock.application.domain.providers.headers
import com.fasterxml.jackson.annotation.{JsonCreator, JsonIgnoreProperties}
import com.sk.app.proxmock.application.configuration.ConfigurationContext
import com.sk.app.proxmock.toolset.serialization.Yaml
import org.springframework.messaging.Message
impor... | szymonkudzia/proxmock | sources/src/main/scala/com/sk/app/proxmock/application/domain/providers/headers/StaticFromFileHeadersProvider.scala | Scala | mit | 921 |
/*******************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
... | RobAltena/deeplearning4j | scalnet/src/main/scala/org/deeplearning4j/scalnet/layers/pooling/GlobalAvgPooling1D.scala | Scala | apache-2.0 | 1,951 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | lhfei/spark-in-action | spark-3.x/src/main/scala/org/apache/spark/examples/streaming/StatefulNetworkWordCount.scala | Scala | apache-2.0 | 2,976 |
package djinni
import djinni.ast._
import djinni.generatorTools._
import djinni.meta._
class ObjcppMarshal(spec: Spec) extends Marshal(spec) {
final val objcBaseLibIncludePrefix = "djinni/objc/"
private val cppMarshal = new CppMarshal(spec)
private val objcMarshal = new ObjcMarshal(spec)
override def typena... | cross-language-cpp/djinni-generator | src/main/scala/djinni/ObjcppMarshal.scala | Scala | apache-2.0 | 4,485 |
/**
* All rights reserved.
* @author Qiuzhuang.Lian
*/
package com.spark.ades
import com.spark.ades.Step1ETL._
import com.spark.ades.Step2JoinAll._
import com.spark.ades.Step3DrugReactStat._
import com.spark.ades.Step4ApplyEbgm._
import org.apache.spark._
object SparkADES {
def main(args: Array[String]) = {
... | Qiuzhuang/spark-ades | src/main/scala/com/spark/ades/SparkADES.scala | Scala | apache-2.0 | 1,110 |
package eu.ace_design.island.arena.utils
import java.io.{ByteArrayOutputStream, FileDescriptor, FileOutputStream, PrintStream}
import eu.ace_design.island.arena.exporters._
import eu.ace_design.island.game._
import eu.ace_design.island.map.resources.Resource
import eu.ace_design.island.stdlib.POIGenerators.{WithCreek... | ace-design/island | arena/src/main/scala/eu/ace_design/island/arena/utils/Runner.scala | Scala | lgpl-3.0 | 4,258 |
package xml.claim
import controllers.mappings.Mappings
import models.domain._
import scala.xml.NodeSeq
import app.XMLValues._
import xml.XMLHelper._
import models.domain.Claim
import xml.XMLComponent
import utils.helpers.HtmlLabelHelper.displayPlaybackDatesFormat
import play.api.i18n.Lang
object Partner extends XMLCo... | Department-for-Work-and-Pensions/ClaimCapture | c3/app/xml/claim/Partner.scala | Scala | mit | 3,401 |
// Copyright: 2010 - 2016 Rory Graves, Sam Halliday
// License: http://www.apache.org/licenses/LICENSE-2.0
package org.ensime.pcplod
import org.scalatest._
import Matchers._
import org.slf4j.LoggerFactory
import org.slf4j.bridge.SLF4JBridgeHandler
trait Logging {
SLF4JBridgeHandler.removeHandlersForRootLogger()
S... | ensime/pcplod | pcplod/src/test/scala/org/ensime/pcplod/PcPlodTest.scala | Scala | apache-2.0 | 2,384 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/repo/CharacterRepo.scala | Scala | apache-2.0 | 809 |
/*
* 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 | sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala | Scala | apache-2.0 | 23,773 |
package shield.actors.listeners
import akka.actor.{Actor, ActorLogging}
import org.joda.time.format.DateTimeFormat
import org.joda.time.{DateTime, DateTimeZone}
import shield.actors.RestartLogging
import shield.aws.AWSImplicits._
import shield.aws.AWSSigningConfig
import shield.metrics.Instrumented
import spray.client... | RetailMeNot/shield | src/main/scala/shield/actors/listeners/ConsoleLogger.scala | Scala | mit | 676 |
package p {
trait TCon[+CC[X]] {
def fPublic: CC[Int] = ???
private[p] def fPackagePrivate: CC[Int] = ???
protected[p] def fPackageProtected: CC[Int] = ???
}
trait Iterable[+A] extends TCon[Iterable]
trait Set[A] extends Iterable[A] with TCon[Set]
trait Seq[+A] extends I... | martijnhoekstra/scala | test/files/run/inferred-type-constructors.scala | Scala | apache-2.0 | 4,381 |
/*
* Copyright 2014 Treode, 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... | Treode/store | disk/src/com/treode/disk/DiskSystemDigest.scala | Scala | apache-2.0 | 837 |
package org.typeclassopedia
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.must.Matchers
import scala.language.implicitConversions
class FunctorSpec extends AnyFlatSpec with Matchers {
val inc: Int => Int = 1 + _
val double: Int => Int = 2 * _
"A functor" must "map stuff" in { Blub... | channingwalton/typeclassopedia | src/test/scala/org/typeclassopedia/FunctorSpec.scala | Scala | mit | 594 |
package org.quantintel.ql.time.daycounters
import org.scalatest.{FlatSpec, Matchers}
import org.quantintel.ql.time.Date
/**
* Created by Paul Bernard on 8/4/14.
*
* 1. 01/31/90 - 03/16/91
* 2. 05/06/94 - 10/30/94
* 3. 01/01/93 - 02/21/93
* 4. 02/01/93 - 03/01/93
* 5. 02/01/96 - 03/01/96
* 6. 01/01/93 - ... | pmularien/spectrum-old | financial/src/test/scala/org/quantintel/ql/time/daycounters/Act365FTest.scala | Scala | apache-2.0 | 5,215 |
/*
* Copyright (c) 2014-2021 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... | snowplow/kinesis-s3 | src/test/scala/com/snowplowanalytics/s3/loader/serializers/GZipSerializerSpec.scala | Scala | apache-2.0 | 2,373 |
/*
biojava-adam BioJava and ADAM integration.
Copyright (c) 2017-2022 held jointly by the individual authors.
This library 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 versi... | heuermh/biojava-adam | scripts/loadFastaDna.scala | Scala | lgpl-3.0 | 1,784 |
/*
* 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 ... | bdrillard/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala | Scala | apache-2.0 | 36,912 |
package com.arcusys.valamis.certificate.schema
import com.arcusys.valamis.certificate.model.Certificate
import com.arcusys.valamis.core.DbNameUtils._
import com.arcusys.valamis.core.SlickProfile
import com.arcusys.valamis.model.PeriodTypes
import com.github.tototoshi.slick.GenericJodaSupport
import org.joda.time.DateT... | ViLPy/Valamis | valamis-slick-persistence/src/main/scala/com/arcusys/valamis/certificate/schema/CertificateTableComponent.scala | Scala | lgpl-3.0 | 2,832 |
package tv.kazu.chatwork4s.models
case class Room(
roomId: Int,
name: String,
`type`: String,
role: String,
sticky: Boolean,
unreadNum: Int,
mentionNum: Int,
mytaskNum: Int,
messageNum: Int,
fileNum: Int,
taskNum: Int,
iconPath: String,
lastUpdateTime: Int,
/**
* /rooms/<room id> の... | k4200/chatwork4s | src/main/scala/tv/kazu/chatwork4s/models/Room.scala | Scala | apache-2.0 | 388 |
import java.util.Arrays
import org.k33nteam.jade.solver._
import org.scalatest.FunSuite
import soot.jimple.Stmt
import soot.jimple.internal.JAssignStmt
import soot.jimple.toolkits.pointer.{LocalMayEquivValueAnalysis, LocalMayAliasAnalysis, LocalMustAliasAnalysis}
import soot.toolkits.graph.BriefUnitGraph
import soot.... | flankerhqd/JAADAS | jade/test/scala/IntraIPCSuite.scala | Scala | gpl-3.0 | 5,672 |
package pureconfig.module.magnolia
import scala.language.higherKinds
import scala.reflect.macros.whitebox
import magnolia.Magnolia
import pureconfig.Exported
// Wrap the output of Magnolia in an Exported to force it to a lower priority.
// This seems to work, despite magnolia hardcode checks for `macroApplication` ... | melrief/pureconfig | modules/magnolia/src/main/scala/pureconfig/module/magnolia/ExportedMagnolia.scala | Scala | mpl-2.0 | 727 |
package org.scalatra
import _root_.akka.actor._
import scala.concurrent.{Future, Await}
import _root_.akka.pattern.ask
import _root_.akka.actor.SupervisorStrategy._
import scala.concurrent.duration._
import _root_.akka.util.Timeout
import test.specs2.MutableScalatraSpec
import scala.util.control.ControlThrowable
impo... | etorreborre/scalatra | core/src/test/scala/org/scalatra/AkkaSupportSpec.scala | Scala | bsd-2-clause | 2,532 |
/*
Copyright 2015 Coursera Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | coursera/courier | scala/generator/src/main/scala/org/coursera/courier/generator/specs/ArrayDefinition.scala | Scala | apache-2.0 | 2,186 |
/*
* 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 ... | andrewor14/iolap | core/src/main/scala/org/apache/spark/serializer/Serializer.scala | Scala | apache-2.0 | 7,067 |
package utils
import io.flow.reference.data.Timezones
object DigitalElementSampleData {
val IpTimezones = Map(
"37.187.99.146" -> Timezones.EuropeParis,
"23.16.0.0" -> Timezones.AmericaEdmonton,
"185.236.200.99" -> Timezones.AmericaLosAngeles,
"173.63.71.187" -> Timezones.AmericaNewYork
)
} | flowcommerce/location | api/test/utils/DigitalElementSampleData.scala | Scala | mit | 314 |
package mr.merc.map.pathfind
import scala.collection.mutable.ArrayBuffer
class Node[T](val t: T, val selfPrice: Double, var parent: Option[Node[T]]) {
def path: List[Node[T]] = {
val result = ArrayBuffer(this)
var current = parent
while (current.isDefined) {
val next = current.get
result +=... | RenualdMarch/merc | src/main/scala/mr/merc/map/pathfind/Node.scala | Scala | gpl-3.0 | 623 |
package it.milczarek.gpwquoter
import java.nio.file.{NoSuchFileException, Paths}
import java.time.LocalDate
import akka.actor.{Actor, ActorRef, Props}
import it.milczarek.gpwquoter.domain.Quote
import it.milczarek.gpwquoter.file.FileDataProvider
import it.milczarek.gpwquoter.jdbc.QuoteDao
import org.apache.http.clien... | milczarekIT/gpw-quoter | src/main/scala/it/milczarek/gpwquoter/GPWQuoteLoader.scala | Scala | apache-2.0 | 3,432 |
package vexriscv.plugin
import spinal.core._
import spinal.lib._
import vexriscv.{DecoderService, Stageable, VexRiscv}
/**
* The AesPlugin allow to reduce the instruction count of each AES round by providing the following instruction :
* 1) aes_enc_round(rs1, rs2, sel). rd = rs1 ^ quad_mul(sel, sbox(byte_sel... | SpinalHDL/VexRiscv | src/main/scala/vexriscv/plugin/AesPlugin.scala | Scala | mit | 14,832 |
package fly.play.s3
import java.util.Date
import scala.concurrent.{ Await, Future }
import scala.concurrent.duration.Duration
import scala.util.{ Failure, Success }
import fly.play.aws.AwsUrlEncoder
import fly.play.aws.acl.{ CanonicalUser, FULL_CONTROL, Grant, Group, READ }
import fly.play.aws.policy.Condition
import... | margussipria/play-s3 | src/test/scala/fly/play/s3/S3BucketSpec.scala | Scala | mit | 15,221 |
import sbt._
import Keys._
object BuildBuild extends Build{
override lazy val settings = super.settings ++ Seq(
scalacOptions ++= Seq(
"-feature", "-deprecation", "-unchecked"
)
)
}
| cvogt/slick-mongo-light | project/project/Build.scala | Scala | bsd-2-clause | 200 |
/*
* Copyright (c) 2014-2018 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... | Wogan/monix | monix-tail/shared/src/test/scala/monix/tail/IterantDistinctUntilChangedSuite.scala | Scala | apache-2.0 | 4,174 |
package reactiverogue.record
package field
class StringField[OwnerType <: BsonRecord[OwnerType]](rec: OwnerType)
extends DirectBsonField[String]
with RequiredRecordField[String, OwnerType] {
override def defaultValue = null.asInstanceOf[String]
def this(rec: OwnerType, value: String) = {
this(rec)
... | whisklabs/reactiverogue | reactiverogue-core/src/main/scala/reactiverogue/record/field/StringField.scala | Scala | apache-2.0 | 638 |
package webshop.webservice
import webshop.webservice.OrderStatus._
trait OrderStatus {
override def toString: String = this match {
case InfoPending(pending) => "info-pending:" + pending.mkString(",")
case UnavailableItems(items) => "unavailable-items:" + items.length
case PaymentFailed => "payment-fai... | ing-bank/baker | examples/baker-example/src/main/scala/webshop/webservice/OrderStatus.scala | Scala | mit | 817 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.sbt
import sbt.ForkOptions
trait LagomImportCompat {
def getForkOptions(options: Vector[String]): ForkOptions = ForkOptions().withRunJVMOptions(options)
}
| ignasi35/lagom | dev/sbt-plugin/src/main/scala-sbt-1.0/com/lightbend/lagom/sbt/LagomImportCompat.scala | Scala | apache-2.0 | 265 |
package reactivemongo.api
import scala.util.{ Try, Failure, Success }
import scala.concurrent.{ ExecutionContext, Future, Promise }
import scala.concurrent.duration.{ Duration, FiniteDuration }
import akka.pattern.after
import reactivemongo.core.actors.{
CheckedWriteRequestExpectingResponse,
ExpectingResponse,
... | maxime-gautre/ReactiveMongo | driver/src/main/scala/api/Failover.scala | Scala | apache-2.0 | 7,953 |
/*
* Distributed as part of Scalala, a linear algebra library.
*
* Copyright (C) 2008- Daniel Ramage
*
* This library 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 ... | scalala/Scalala | src/main/scala/scalala/operators/Ops.scala | Scala | lgpl-2.1 | 23,866 |
/*
* Copyright 2014 Lars Edenbrandt
*
* 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... | slicebox/slicebox | src/main/scala/se/nimsa/sbx/metadata/MetaDataServiceActor.scala | Scala | apache-2.0 | 7,761 |
package at.forsyte.apalache.tla.lir.oper
import at.forsyte.apalache.tla.lir.TlaOperDecl
/**
* A control-flow operator.
*/
abstract class TlaControlOper extends TlaOper {
override def interpretation: Interpretation.Value = Interpretation.Predefined
}
object TlaControlOper {
/**
* A case operator without t... | konnov/dach | tlair/src/main/scala/at/forsyte/apalache/tla/lir/oper/TlaControlOper.scala | Scala | apache-2.0 | 1,915 |
/*
* 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 ... | shuangshuangwang/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreCatalogSuite.scala | Scala | apache-2.0 | 14,272 |
package org.wegtam
import org.wegtam.sugarcrm.client.Connection
package object sugarcrm {
implicit val crmConnection = new Connection(new java.net.URL(sys.props("url").toString), sys.props("username").toString, sys.props("password").toString)
def getTestCRMConnection = crmConnection
}
| glidester/SugarCRM-Client-Scala-Library | src/test/scala/org/wegtam/sugarcrm/package.scala | Scala | bsd-3-clause | 293 |
/**
* File: CountersTest.scala
* Package: tests
* Autore: Francesco Burato
* Creazione: 31/lug/2013
*/
package tests
import org.scalatest.{FunSuite, BeforeAndAfter}
import solver._
/**
* Test di funzionamento dei contatori
* @author Francesco Burato
*
*/
class CountersTest extends FunSuite with BeforeAndAfter... | fburato/CPNetSolver | CPNetSolver/src/tests/CountersTest.scala | Scala | gpl-3.0 | 2,057 |
/**
* Copyright 2014 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 ap... | lzpfmh/framework-2 | persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/AsMongoRecord.scala | Scala | apache-2.0 | 1,093 |
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.