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 is part of ltlfo2mon (https://github.com/jckuester/ltlfo2mon).
*
* Copyright (c) 2013 by Jan-Christoph Kuester <kuester@sdf.org>
*
* Ltlfo2mon is free software: you can redistribute it and/or modify
* it under the term... | jckuester/ltlfo2mon | src/main/scala/ltlfo2mon/Conf.scala | Scala | gpl-3.0 | 6,134 |
package com.rasterfoundry.api.utils
import com.rasterfoundry.notification.intercom.Model._
import com.typesafe.config.ConfigFactory
trait Config {
val config = ConfigFactory.load()
private val httpConfig = config.getConfig("http")
private val auth0Config = config.getConfig("auth0")
private val clientConfig =... | raster-foundry/raster-foundry | app-backend/api/src/main/scala/utils/Config.scala | Scala | apache-2.0 | 2,585 |
/*
* 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 | test/services/notifications/v1m0/MessageDetailsSpec.scala | Scala | apache-2.0 | 18,042 |
/*
* macroRules.scala
*/
package at.logic.gapt.proofs.lk
import at.logic.gapt.expr._
import at.logic.gapt.expr.hol.{ isPrenex, instantiate, HOLPosition }
import at.logic.gapt.proofs.HOLSequent
import at.logic.gapt.proofs.expansionTrees._
import at.logic.gapt.proofs.lk.base._
import at.logic.gapt.proofs.occurrences.... | loewenheim/gapt | src/main/scala/at/logic/gapt/proofs/lk/macroRules.scala | Scala | gpl-3.0 | 69,363 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api
import java.io._
import javax.inject.Inject
import akka.actor.ActorSystem
import akka.stream.{ ActorMaterializer, Materializer }
import javax.inject.Singleton
import play.api.http._
import play.api.i18n.I18nComponents
impor... | aradchykov/playframework | framework/src/play/src/main/scala/play/api/Application.scala | Scala | apache-2.0 | 11,930 |
/*
* Copyright 2016 Dennis Vriend
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | dnvriend/akka-http-test | app/com/github/dnvriend/component/helloworld/repository/entity/HelloWorld.scala | Scala | apache-2.0 | 2,838 |
package japgolly.scalajs.react.extra
class ReusableVal2[A, S](a: () => A, val src: S)(implicit val reusability: Reusability[S]) {
lazy val value: A = a()
}
object ReusableVal2 {
implicit def reusability[A, S]: Reusability[ReusableVal2[A, S]] =
Reusability.internal((_: ReusableVal2[A, S]).src)(_.reusability)
... | beni55/scalajs-react | extra/src/main/scala/japgolly/scalajs/react/extra/ReusableVal2.scala | Scala | apache-2.0 | 599 |
/*
* 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 | sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala | Scala | apache-2.0 | 17,648 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | ccri/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/process/transform/ArrowConversionProcessTest.scala | Scala | apache-2.0 | 5,595 |
/*
* Copyright 2019 Frugal Mechanic (http://frugalmechanic.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... | frugalmechanic/fm-common | shared/src/main/scala/fm/common/rich/RichChar.scala | Scala | apache-2.0 | 794 |
package polynomial
import core.NegativeInfinity
import integer.IntegersModN
import org.scalatest.{FunSuite, Matchers}
import polynomial.Predef.X
class PolynomialTest extends FunSuite with Matchers {
implicit val intsMod4 = IntegersModN(4)
val zero = intsMod4.classOf(0)
val one = intsMod4.classOf(1)
val two ... | dkettlestrings/thunder | src/test/scala/polynomial/PolynomialTest.scala | Scala | gpl-3.0 | 2,875 |
package org.eoin
import org.eoin.Chapter10.exercise9.{Part, Stub, WC}
object Chapter10 {
trait Monoid[A] {
def op(a1: A, a2: A): A
def zero: A
}
object exercise1 {
val stringMonoid = new Monoid[String] {
def op(a1: String, a2: String) = a1 + a2
def zero = ""
}
def listMonoid[... | eoinparker/FunctionalProgrammingRedBook | src/main/scala/org/eoin/chapter10.scala | Scala | mit | 6,535 |
package com.github.dakatsuka.akka.http.oauth2.client.strategy
import akka.NotUsed
import akka.http.scaladsl.model.headers.RawHeader
import akka.http.scaladsl.model._
import akka.stream.scaladsl.Source
import com.github.dakatsuka.akka.http.oauth2.client.{ ConfigLike, GrantType }
class ClientCredentialsStrategy extends... | dakatsuka/akka-http-oauth2-client | src/main/scala/com/github/dakatsuka/akka/http/oauth2/client/strategy/ClientCredentialsStrategy.scala | Scala | apache-2.0 | 1,121 |
package scala.collection.mutable
class Qu[A] protected (array: Array[AnyRef], start: Int, end: Int):
def this(initialSize: Int = ArrayDeque.DefaultInitialSize) =
this(ArrayDeque.alloc(initialSize), start = 0, end = 0)
object Qu:
def f[A](array: Array[AnyRef], start: Int, end: Int) = 1
def f[A](initialSize: ... | lampepfl/dotty | tests/pos/i8920/Qu_1.scala | Scala | apache-2.0 | 333 |
package pl.project13.scala.akka.raft.protocol
/**
* States used by the Raft FSM.
*
* Use by importing the protocol package:
* {{{import akka.raft.protocol._}}}
*/
trait RaftStates {
sealed trait RaftState
/** In this phase the member awaits to get it's [[pl.project13.scala.akka.raft.ClusterConfiguration]] *... | colin-scott/akka-raft | src/main/scala/pl/project13/scala/akka/raft/protocol/RaftStates.scala | Scala | apache-2.0 | 859 |
/*
* #%L
* GatlingCql
* %%
* Copyright (C) 2014 Mikhail Stepura
* %%
* 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... | infomaven/GatlingCql | src/main/scala/io/github/gatling/cql/CqlProtocol.scala | Scala | mit | 1,430 |
/**
* Copyright 2011 James Lindstorff
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | industria/solrprocessors | src/main/scala/dk/industria/solr/processors/PatternReplaceRule.scala | Scala | apache-2.0 | 3,056 |
/*
* Copyright 2010 Guardian News and Media
*
* 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 a... | guardian/guardian-configuration | src/test/scala/com.gu.conf/impl/PropertiesLoaderTest.scala | Scala | apache-2.0 | 1,882 |
package at.bioinform.webapp.directive
import akka.http.scaladsl.marshalling.GenericMarshallers._
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model.HttpResponse
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import at.bioinform.webapp.Env
import at.bioin... | peri4n/bIO | subprojects/webapp/src/main/scala/at/bioinform/webapp/directive/Sequences.scala | Scala | apache-2.0 | 1,049 |
package io.youi.path
import scala.collection.mutable.ListBuffer
case class Path(actions: List[PathAction]) extends PathBuilder with PathAction {
lazy val boundingBox: BoundingBox = Path.boundingBox(actions)
lazy val path2d: Val[Path2D] = Val(createPath2d(ui.ratio))
override def draw(context: Context, x: Double... | outr/youi | ui/js/src/main/scala/io/youi/path/Path.scala | Scala | mit | 6,079 |
package akka.rtcweb.protocol.scodec
import akka.rtcweb.CodecSpec
import org.specs2.mutable.Specification
import scodec.Attempt.Successful
import scodec.{ Attempt, DecodeResult }
import scodec.bits.BitVector.{ empty => emptyVector }
import scodec.bits.BitVector._
import scodec.bits._
import scodec.codecs._
import shape... | danielwegener/akka-rtcweb | src/test/scala/akka/rtcweb/protocol/scodec/SCodecContribSpec.scala | Scala | apache-2.0 | 2,765 |
/*
* 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/vat-registration-frontend | app/forms/PartOfOrganisationForm.scala | Scala | apache-2.0 | 917 |
package scommons.client.showcase.table
import scommons.react._
import scommons.react.test.TestSpec
import scommons.react.test.util.ShallowRendererUtils
class TablePanelDemoSpec extends TestSpec with ShallowRendererUtils {
it should "render component" in {
//given
val component = <(TablePanelDemo())()()
... | viktor-podzigun/scommons | showcase/src/test/scala/scommons/client/showcase/table/TablePanelDemoSpec.scala | Scala | apache-2.0 | 707 |
/*
Copyright (C) 2012-2013 the original author or authors.
See the LICENSE.txt file distributed with this work for additional
information regarding copyright ownership.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
... | davidhoyt/scalaopts | src/main/scala/scalaopts/ParserStrategy.scala | Scala | apache-2.0 | 1,146 |
/*
* 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... | pncampbell/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frs102/validation/DirectorsReportEnabledCalculator.scala | Scala | apache-2.0 | 1,532 |
object Main {
def test[T] = ?//test // error
} | lampepfl/dotty | tests/neg/i10268.scala | Scala | apache-2.0 | 48 |
/*
Copyright (c) 2016, Rice University
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2.... | agrippa/spark-swat | functional-tests/two-dense-vector-input/src/main/scala/dense-vector-input/GenerateInput.scala | Scala | bsd-3-clause | 2,654 |
/*
* BasicRendering.scala
* (Mellite)
*
* Copyright (c) 2012-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.mellite
im... | Sciss/Mellite | core/src/main/scala/de/sciss/mellite/GraphemeRendering.scala | Scala | agpl-3.0 | 617 |
package com.twitter.inject.thrift.modules
import com.twitter.inject.TwitterModule
import com.twitter.inject.thrift.AndThenService
import com.twitter.inject.thrift.internal.DefaultAndThenServiceImpl
object AndThenServiceModule extends TwitterModule {
override def configure: Unit = {
bindSingleton[AndThenService... | syamantm/finatra | inject/inject-thrift-client/src/main/scala/com/twitter/inject/thrift/modules/AndThenServiceModule.scala | Scala | apache-2.0 | 357 |
package com.github.chengpohi.indexer
import akka.actor.Actor
import com.github.chengpohi.model.IndexPage
import org.slf4j.LoggerFactory
/**
* Created by xiachen on 1/17/15.
*/
class PageIndexerService extends Actor {
lazy val LOG = LoggerFactory.getLogger(getClass.getName)
val htmlPageIndexer = new impl.HtmlPa... | chengpohi/secer | indexer/src/main/scala/com/github/chengpohi/indexer/PageIndexerService.scala | Scala | apache-2.0 | 425 |
package org.jetbrains.plugins.scala.refactoring.introduceParameter
import java.io.File
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.fileEditor.{FileEditorManager, OpenFileDescriptor}
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.io.FileUtil
import com.intellij.o... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/refactoring/introduceParameter/IntroduceParameterTestBase.scala | Scala | apache-2.0 | 6,341 |
/*
* 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/main/scala/com/spotify/scio/repl/ScioReplSysProps.scala | Scala | apache-2.0 | 899 |
/**
* Copyright 2012-2013 StackMob
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | stackmob/scaliak | src/test/scala/com/stackmob/scaliak/tests/util/MockitoArgumentExtractor.scala | Scala | apache-2.0 | 876 |
package org.apache.spark.sql.cassandra
import org.scalatest.{FlatSpec, Matchers}
import com.datastax.spark.connector.cql._
import com.datastax.spark.connector.types.{IntType, TimeUUIDType}
class PredicatePushDownSpec extends FlatSpec with Matchers {
// We don't want this test to rely on any Spark code,
// so we'... | christobill/spark-cassandra-connector | spark-cassandra-connector/src/test/scala/org/apache/spark/sql/cassandra/PredicatePushDownSpec.scala | Scala | apache-2.0 | 10,643 |
package logcluster.alg
import java.io.File
import java.io.PrintStream
import java.io.FileOutputStream
import logcluster.util.createDirOrCheckEmpty
import java.io.IOException
import scala.collection.mutable
import com.typesafe.scalalogging.StrictLogging
import org.joda.time.DateTime
import logcluster.persistence.ErrorP... | despegar/logcluster | src/main/scala/logcluster/alg/CassReporter.scala | Scala | bsd-2-clause | 540 |
package org.jetbrains.plugins.hocon.ref
import com.intellij.openapi.util.TextRange
import com.intellij.psi.{ElementManipulators, PsiElement, PsiReference}
import org.jetbrains.plugins.hocon.psi.HKey
/**
* @author ghik
*/
class HKeySelfReference(key: HKey) extends PsiReference {
override def getVariants: Array[A... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/hocon/ref/HKeySelfReference.scala | Scala | apache-2.0 | 855 |
/**
* 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... | chicagozer/rheosoft | components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/ScalaTestSupport.scala | Scala | apache-2.0 | 2,246 |
// scalac: -Xfatal-warnings
//
object Test {
0 match {
case _ => 0 == ""
}
}
| scala/scala | test/files/neg/t7756b.scala | Scala | apache-2.0 | 85 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-accumulo/geomesa-accumulo-tools/src/main/scala/org/locationtech/geomesa/accumulo/tools/data/AccumuloManagePartitionsCommand.scala | Scala | apache-2.0 | 3,640 |
package fos
abstract class TypeInferencers {
import Type._
type Env = List[(String, TypeScheme)]
case class TypeError(msg: String) extends Exception(msg)
/** Lookup variable <code>name</code> in the given environment. */
def lookup(env: Env, name: String): TypeScheme = env match {
case Nil => null
... | sana/WorkAtEPFL | HindleyMillerTypeInference/src/fos/TypeInferencers.scala | Scala | gpl-3.0 | 661 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | caneGuy/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/DemoteBroadcastHashJoin.scala | Scala | apache-2.0 | 2,648 |
package scaladex.dom
import scala.scalajs.js
import org.scalajs.dom.html.Element
@js.native // https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry
trait IntersectionObserverEntry extends js.Object {
def intersectionRatio: Double = js.native
def target: Element = js.native
}
| scalacenter/scaladex | modules/webclient/src/main/scala/scaladex/dom/IntersectionObserverEntry.scala | Scala | bsd-3-clause | 305 |
package com.advancedspark.streaming.rating.ml.incremental.model
import edu.berkeley.cs.amplab.spark.indexedrdd.IndexedRDD
import edu.berkeley.cs.amplab.spark.indexedrdd.IndexedRDD._
case class StreamingLatentMatrixFactorizationModel(
override val rank: Int,
override val userFactors: IndexedRDD[Long, LatentFac... | fluxcapacitor/source.ml | apachespark.ml/demos/streaming/src/main/scala/com/advancedspark/streaming/rating/ml/incremental/model/StreamingLatentMatrixFactorizationModel.scala | Scala | apache-2.0 | 683 |
//package io.skysail.core.app
//
//import io.skysail.api.text.TranslationRenderService
//import io.skysail.core.Constants
//import org.slf4j.LoggerFactory
//
//case class ScalaTranslationRenderServiceHolder(val service: TranslationRenderService, props: Map[String, String]) {
//
// val log = LoggerFactory.getLogger(thi... | evandor/skysail-core | skysail.core/src/io/skysail/core/app/TranslationRenderServiceHolder.scala | Scala | apache-2.0 | 753 |
/*
* ******************************************************************************
* Copyright 2012-2013 SpotRight
*
* 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
*
* ... | SpotRight/Polidoro | src/main/scala/com/spotright/polidoro/model/Operation.scala | Scala | apache-2.0 | 2,585 |
/**
* 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... | ollie314/kafka | core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala | Scala | apache-2.0 | 16,760 |
/*
* Copyright: Copyright (C) 2016, ATS Advanced Telematic Systems GmbH
* License: MPL-2.0
*/
package org.genivi.sota.resolver.db
import akka.stream.stage.{GraphStage, GraphStageLogic, InHandler, OutHandler}
import akka.stream.{Attributes, FlowShape, Inlet, Outlet}
import cats.data.NonEmptyList
import scala.colle... | PDXostc/rvi_sota_server | external-resolver/src/main/scala/org/genivi/sota/resolver/db/GroupedByPredicate.scala | Scala | mpl-2.0 | 2,075 |
package sw.rdds
import org.apache.spark._
object SomeTransformations extends App {
val sparkConf = new SparkConf()
.setAppName(this.getClass.getName)
.setMaster("local[*]")
val sc = new SparkContext(sparkConf)
val evenNumbers = sc.parallelize(1 to 1000).filter(_ % 2 == 0)
println("sum: " + evenNumb... | rabbitonweb/spark-workshop | src/main/scala/sw/rdds/SomeOperations.scala | Scala | apache-2.0 | 1,092 |
package task
import org.apache.samza.system.IncomingMessageEnvelope
import org.apache.samza.task.{TaskCoordinator, MessageCollector, StreamTask}
/**
* Created by mike on 17/06/15.
*/
class EventCounterStreamTask extends StreamTask {
override def process(envelope: IncomingMessageEnvelope, collector: MessageCollect... | mikehancock/kafka-sample | app/task/EventCounterStreamTask.scala | Scala | mit | 508 |
package com.roundeights.s3cala
/** Thrown when an S3 request fails */
class S3Failed (
message: String, cause: Throwable
) extends Exception( message, cause ) {
/** Alternate constructor */
def this ( cause: Throwable ) = this( null, cause )
/** Alternate constructor */
def this ( message: String... | Nycto/S3cala | src/main/scala/s3cala/Err.scala | Scala | mit | 532 |
// java: -Dneeds.forked.jvm.maybe.because.context.classloader
/**
* Checks that serialization of hash-based collections works correctly if the hashCode
* changes on deserialization.
*/
object Test {
import collection._
def main(args: Array[String]): Unit = {
for (i <- Seq(0, 1, 2, 10, 100)) {
def ent... | scala/scala | test/files/jvm/t1600.scala | Scala | apache-2.0 | 2,778 |
package com.cloudera.hue.livy.server.sessions
import java.net.URL
import java.util.concurrent.TimeUnit
import com.cloudera.hue.livy._
import com.cloudera.hue.livy.msgs.ExecuteRequest
import com.cloudera.hue.livy.server.Statement
import com.cloudera.hue.livy.server.sessions.Session._
import dispatch._
import org.json4... | nvoron23/hue | apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/sessions/WebSession.scala | Scala | apache-2.0 | 3,878 |
/*
* 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 ... | style95/openwhisk | core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/Scheduler.scala | Scala | apache-2.0 | 15,934 |
package rovak.steamkit.steam.gc
import java.io.IOException
import lombok.Getter
import rovak.steamkit.steam.AMsgBase
import rovak.steamkit.steam.language.internal.IGCSerializableHeader
import rovak.steamkit.types.JobID
/**
* This is the abstract base class for all available game coordinator messages.
* It's used to... | Rovak/scala-steamkit | steam/src/main/scala/rovak/steamkit/steam/gc/GCMsgBase.scala | Scala | mit | 964 |
package info.rnowak.simplega.operators.selection
import info.rnowak.simplega.fitness.IndividualWithFitness
import info.rnowak.simplega.population.Population
import scala.collection.parallel.ParSeq
trait SelectionOperator[PopulationType <: Population] {
def select(individualsWithFitness: ParSeq[IndividualWithFitnes... | rafalnowak/simplega | src/main/scala/info/rnowak/simplega/operators/selection/SelectionOperator.scala | Scala | mit | 388 |
/*
* 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 ... | cloud-fan/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala | Scala | apache-2.0 | 16,486 |
/*
* This software is licensed under the GNU Affero General Public License, quoted below.
*
* This file is a part of BitWatts.
*
* Copyright (C) 2011-2015 Inria, University of Lille 1,
* University of Neuchâtel.
*
* BitWatts is free software: you can redistribute it and/or modify
* it under the terms of the GN... | Spirals-Team/bitwatts | bitwatts-core/src/main/scala/org/powerapi/bitwatts/reporter/VirtioDisplay.scala | Scala | agpl-3.0 | 2,859 |
package hclu.hreg.dao
import java.util.UUID
import hclu.hreg.dao.sql.SqlDatabase
import hclu.hreg.domain.Doc
import org.joda.time.DateTime
import scala.concurrent.{Await, ExecutionContext, Future}
import scala.concurrent.duration._
class DocDao(protected val database: SqlDatabase)(implicit val ec: ExecutionContext)... | tsechov/hclu-registry | backend/src/main/scala/hclu/hreg/dao/DocDao.scala | Scala | apache-2.0 | 3,131 |
package com.twitter.sbt
import scala.reflect.Manifest
import _root_.sbt._
class WrappedDefaultProject(val underlying: DefaultProject)
extends StandardProject(underlying.info)
{
override def name = underlying.name
override def version = underlying.version
override def organization ... | twitter/standard-project | src/main/scala/com/twitter/sbt/ProjectWrapper.scala | Scala | apache-2.0 | 5,521 |
/*
* 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 ... | ueshin/apache-spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala | Scala | apache-2.0 | 38,880 |
package org.typeclassopedia
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.must.Matchers
import scala.language.implicitConversions
import org.typeclassopedia.std.Lists.{given _, _}
import org.typeclassopedia.std.Options.{given _, _}
class CopointedSpec extends AnyFlatSpec with Matchers {
"... | channingwalton/typeclassopedia | src/test/scala/org/typeclassopedia/CopointedSpec.scala | Scala | mit | 521 |
/*
* Copyright (c) 2011, Daniel Spiewak
* 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 of cond... | arktekk/anti-xml | src/main/scala/com/codecommit/antixml/conversion.scala | Scala | bsd-3-clause | 8,103 |
package sbt.internal.util
package complete
import java.io.File
import sbt.io.IO._
class FileExamplesTest extends UnitSpec {
"listing all files in an absolute base directory" should
"produce the entire base directory's contents" in {
val _ = new DirectoryStructure {
fileExamples().toList should co... | Duhemm/util | internal/util-complete/src/test/scala/sbt/complete/FileExamplesTest.scala | Scala | bsd-3-clause | 3,391 |
package com.sksamuel.elastic4s.http.search.queries
import com.sksamuel.elastic4s.searches.queries.matches.{MatchAllQueryDefinition, MatchNoneQueryDefinition}
import org.elasticsearch.common.xcontent.{XContentBuilder, XContentFactory}
object MatchAllBodyFn {
def apply(q: MatchAllQueryDefinition): XContentBuilder = {... | aroundus-inc/elastic4s | elastic4s-http/src/main/scala/com/sksamuel/elastic4s/http/search/queries/MatchAllBodyFn.scala | Scala | apache-2.0 | 842 |
package io.buoyant.namer
import com.twitter.finagle.{NameTree, Dentry, Path}
sealed trait DelegateTree[+T] {
def path: Path
def map[U](f: T => U): DelegateTree[U] = DelegateTree.map(this, f)
def flatMap[U >: T](f: DelegateTree.Leaf[T] => DelegateTree[U]) = DelegateTree.flatMap(this, f)
def simplified: Delegat... | linkerd/linkerd | namer/core/src/main/scala/io/buoyant/namer/DelegateTree.scala | Scala | apache-2.0 | 9,240 |
package com.dominikgruber.fpinscala.chapter04
import org.scalatest._
class Exercise02Spec extends FlatSpec with Matchers {
"variance" should "multiply by 2" in {
Chapter04.variance(Seq(1.0, 2.0, 3.0)) should be (Some(2.0 / 3.0))
}
it should "be None" in {
Chapter04.variance(Seq[Double]()) should be (N... | TheDom/functional-programming-in-scala | src/test/scala/com/dominikgruber/fpinscala/chapter04/Exercise02Spec.scala | Scala | mit | 330 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | travisbrown/scalatest | src/main/scala/org/scalatest/junit/RunNotifierReporter.scala | Scala | apache-2.0 | 6,329 |
/*
* 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 ... | rmetzger/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionConverter.scala | Scala | apache-2.0 | 26,544 |
package cpup.mc.tweak.content.tools
import cpup.mc.lib.util.serialization.SingletonSerialization
import cpup.mc.tweak.CPupTweak
object GenericParts {
def mod = CPupTweak
final val binding = Part.Shape("binding")
final val handle = Part.Shape("handle")
}
| CoderPuppy/cpup-tweak-mc | src/main/scala/cpup/mc/tweak/content/tools/GenericParts.scala | Scala | mit | 260 |
package net.fwbrasil.bond
class ObjectsSpec extends Spec {
new ValidatorTest(IsNull) {
def valids = List(null)
def invalids = List(1, "a", new Object)
}
new ValidatorTest(IsNotNull) {
def valids = List(1, "a", new Object)
def invalids = List(null)
}
}
| fwbrasil/bond | src/test/scala/net/fwbrasil/bond/ObjectsSpec.scala | Scala | lgpl-2.1 | 279 |
/*******************************************************************************
* Copyright (c) 2014 Guillaume DUBUISSON DUPLESSIS <guillaume.dubuisson_duplessis@insa-rouen.fr>.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* ... | GuillaumeDD/scala99problems | src/main/scala/binaryTree/P63/P63.scala | Scala | gpl-3.0 | 4,106 |
class Foo private() {
inline def foo = new Foo // error
}
| som-snytt/dotty | tests/neg/i2564b.scala | Scala | apache-2.0 | 60 |
#!/bin/sh
exec scala -nocompdaemon -savecompiled $0 $@
!#
import scala.io.Source.{fromFile, fromInputStream}
import scala.util.Sorting
/**
* Call with <column> <list-of-files> ('-' for stdin)
*
* Selects a single line for each set of aligned lines from a set of tsv files based on the smallest
* value in the giv... | boggle/souffleuse | bin/merge-join-tsv.scala | Scala | mit | 2,398 |
package com.github.mdr.mash.compiler
import com.github.mdr.mash.parser.AbstractSyntax._
object AddHolesToHeadlessMembers {
def addHoles(program: Program): Program = program.transform {
case HeadlessMemberExpr(member, isSafe, sourceInfoOpt) ⇒ MemberExpr(Hole(1, None), member, isSafe, sourceInfoOpt)
}.asInstan... | mdr/mash | src/main/scala/com/github/mdr/mash/compiler/AddHolesToHeadlessMembers.scala | Scala | mit | 338 |
package org.bitcoins.core.serializers.blockchain
import org.bitcoins.core.crypto.DoubleSha256Digest
import org.bitcoins.core.number.{UInt32, UInt64}
import org.bitcoins.core.protocol.CompactSizeUInt
import org.bitcoins.core.protocol.blockchain.MerkleBlock
import org.bitcoins.core.serializers.RawBitcoinSerializer
impor... | bitcoin-s/bitcoin-s-core | core/src/main/scala/org/bitcoins/core/serializers/blockchain/RawMerkleBlockSerializer.scala | Scala | mit | 3,376 |
package com.nyavro.manythanks.ws.microservice
import javax.inject.Inject
import com.google.inject.{AbstractModule, Guice}
import org.scalatest.{Matchers, WordSpec}
class MicroserviceTest extends WordSpec with Matchers {
"Guice" should {
"inject dependencies" in {
val injector = Guice.createInjector(
... | nyavro/manythanks | webService/src/test/scala/com/nyavro/manythanks/ws/microservice/MicroserviceTest.scala | Scala | apache-2.0 | 1,526 |
/*
* 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 ... | jz3707/gradient_descent_variants | src/main/scala/org.apache.spark.mllib.optimization/GradientDescentWithLargeMemory.scala | Scala | apache-2.0 | 7,431 |
package fabricator
import org.testng.annotations.{DataProvider, Test}
import scala.collection.mutable
class WordsTestSuite extends BaseTestSuite {
@DataProvider(name = "languageDp")
def languageDp(): Array[Array[Any]] = {
Array(Array("nl"),
Array("de")
)
}
@Test(dataProvider = "languageDp")
... | edombowsky/fabricator | src/test/scala/fabricator/WordsTestSuite.scala | Scala | apache-2.0 | 2,541 |
package class_instance_extractor
import java.io.BufferedWriter
import java.io.FileOutputStream
import java.io.OutputStreamWriter
import scala.collection.JavaConversions.asScalaBuffer
import scala.collection.mutable.Map
import com.hp.hpl.jena.rdf.model.ResourceFactory
import com.hp.hpl.jena.util.FileManager
object R... | t-morita/JWO_Refinement_Tools | src/main/scala/class_instance_extractor/RoleStatementsExtractor.scala | Scala | apache-2.0 | 1,683 |
/*
* Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file
*
* 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 option)... | Tensei-Data/tensei-agent | src/it/scala/databases/firebird/ForeignKeysTest.scala | Scala | agpl-3.0 | 25,251 |
package ulang.syntax
import arse.Fixity
import arse._
sealed trait Expr {
def abs(x: FreeVar, index: Int): Expr
def bind(stack: List[FreeVar]): Expr
def free: Set[FreeVar]
def vars: Set[FreeVar]
def mapFree(f: FreeVar => Expr): Expr
def ===(that: Expr): Boolean = (this == that)
def replace(e1: Expr, e2... | gernst/ulang | src/ulang/syntax/Expr.scala | Scala | mit | 3,497 |
/**
* Copyright (c) 2016 Intel Corporation
*
* 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... | ashaarunkumar/spark-tk | sparktk-core/src/main/scala/org/trustedanalytics/sparktk/frame/internal/ops/sortedk/SortedKFunctions.scala | Scala | apache-2.0 | 2,388 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package frontends.scalac
import scala.tools.nsc.Settings
import scala.tools.nsc.reporters.AbstractReporter
import scala.reflect.internal.util.{Position, NoPosition, FakePos, StringOps}
import utils.{Position => LeonPosition, NoPosition => LeonNoPosition, OffsetPo... | epfl-lara/leon | src/main/scala/leon/frontends/scalac/SimpleReporter.scala | Scala | gpl-3.0 | 2,264 |
package controllers
import anorm.Row
import play.api.libs.json.{JsNumber, JsObject, JsValue}
object Month extends REST {
val tableName: String = "months"
val parameters: Map[String, (String, String) => ValidationResult] = Map(
"number" -> validateInt,
"year_id" -> validateInt
)
protected def sin... | ishakir/PokeStat | app/controllers/Month.scala | Scala | mit | 690 |
/*
* 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
* distribute... | wvlet/airframe | airframe-http-router/src/main/scala/wvlet/airframe/http/router/HttpEndpointExecutionContext.scala | Scala | apache-2.0 | 3,726 |
package metaconfig.docs
import metaconfig.ConfEncoder
import scalatags.Text.all._
import metaconfig.generic.Setting
import metaconfig.generic.Settings
object Docs {
def htmlSetting(setting: Setting, defaultValue: Any) = tr(
td(code(setting.name)),
td(code(setting.field.tpe)),
td(setting.description),
... | olafurpg/metaconfig | metaconfig-docs/src/main/scala/metaconfig/docs/Docs.scala | Scala | apache-2.0 | 812 |
package com.weather.scalacass.util
object CassandraUnitInfo {
val cassYaml = "cu-cassandra-rndport-with-fix-3.yaml"
}
| thurstonsand/fast-cass | src/test/scala_cass3/com/weather/scalacass/util/CassandraUnitInfo.scala | Scala | mit | 121 |
package com.github.vitalsoftware.scalaredox
import com.github.vitalsoftware.scalaredox.models._
import org.specs2.mutable.Specification
import scala.concurrent.Await
import scala.concurrent.duration._
/**
* Created by apatzer on 3/23/17.
*/
class PatientSearchTest extends Specification with RedoxTest {
"query Pa... | vital-software/scala-redox | src/test/scala/com/github/vitalsoftware/scalaredox/PatientSearchTest.scala | Scala | mit | 2,355 |
/*
* Copyright 2014–2020 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... | slamdata/quasar | run/src/test/scala/quasar/RegressionQScriptEvaluator.scala | Scala | apache-2.0 | 1,162 |
package model
case class TransmittalSheet(
id: Int) {
require(id == 1)
}
| jmarin/pilotazo | src/main/scala/model/TransmittalSheet.scala | Scala | cc0-1.0 | 80 |
@main def test: Unit = {
class Foo
class Bar extends Foo
trait S[-A] {
type T >: A
}
trait PFoo extends S[Foo]
trait PBar extends S[Bar] {
override type T = Bar
}
class PFooBar extends PBar with PFoo { // error
override type T >: Bar // error
}
def patmat[A](s: S[A]): s.T = s match {
... | lampepfl/dotty | tests/neg/i11130.scala | Scala | apache-2.0 | 470 |
/*
* Copyright (c) 2012 Twitter, Inc.
*
* 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.apache.org/licenses/LICENSE-2.0.
*
* Un... | iulianu/avro-scala-macro-annotations | tests/src/test/scala/AvroTypeProviderTests/datatypetests/AvroTypeProviderUserDefinedTypesTest.scala | Scala | apache-2.0 | 9,372 |
package ml.combust.mleap.avro
import java.nio.charset.Charset
import ml.combust.mleap.core.types._
import ml.combust.mleap.runtime.MleapContext
import ml.combust.mleap.runtime.types._
import ml.combust.mleap.tensor.{ByteString, Tensor}
import org.apache.avro.Schema
import scala.language.implicitConversions
import sc... | combust-ml/mleap | mleap-avro/src/main/scala/ml/combust/mleap/avro/SchemaConverter.scala | Scala | apache-2.0 | 7,878 |
/**
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package sbt.protocol.codec
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait ExecutionEventFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val Execut... | sbt/sbt | protocol/src/main/contraband-scala/sbt/protocol/codec/ExecutionEventFormats.scala | Scala | apache-2.0 | 1,151 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/factories/utils/TestExternalCatalogFactory.scala | Scala | apache-2.0 | 2,480 |
package notebook.kernel
import java.io.{StringWriter, PrintWriter}
import java.net.URLDecoder
import java.util.ArrayList
import notebook.kernel.repl.common._
import scala.collection.JavaConversions._
import scala.xml.{NodeSeq, Text}
import scala.util.control.NonFatal
import tools.nsc.Settings
import tools.nsc.inter... | meh-ninja/spark-notebook | modules/spark/src/main/scala_2.11/spark-pre1.5/notebook/kernel/Repl.scala | Scala | apache-2.0 | 12,106 |
package models
case class Permission(_id: String,
permissionType: String,
permission: String,
accessRule: AccessRule) extends BaseModel[Permission] {
override def withId(_id: String): Permission = copy(_id = _id)
}
| metaxmx/FridayNightBeer | modules/datamodel/src/main/scala/models/Permission.scala | Scala | apache-2.0 | 296 |
/*
* 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 ... | icexelloss/spark | core/src/main/scala/org/apache/spark/TestUtils.scala | Scala | apache-2.0 | 13,094 |
package com.airbnb.aerosolve.training
import com.typesafe.config.Config
import org.slf4j.{Logger, LoggerFactory}
import org.apache.spark.rdd.RDD
import scala.util.Random
/*
* A logistic regression trainer for generating Platt's scaling weights (slope and offset)
* The objective function to minimize is the negative log... | zcqqq/aerosolve | training/src/main/scala/com/airbnb/aerosolve/training/ScoreCalibrator.scala | Scala | apache-2.0 | 5,952 |
/**Copyright (c) 2012-2015 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.apache.... | aldemirenes/snowplow | 3-enrich/scala-common-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.common/enrichments/registry/WeatherEnrichmentSpec.scala | Scala | apache-2.0 | 5,071 |
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.