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 ... | goldmedal/spark | mllib/src/main/scala/org/apache/spark/ml/stat/SelectionTestResult.scala | Scala | apache-2.0 | 3,082 |
package com.mogproject.mogami.core.io.kif
import com.mogproject.mogami.core.io.{IOFactoryLike, Lines, NonEmptyLines}
import com.mogproject.mogami.core.state.StateCache
object KifFactory {
/**
* @note do not ignore comments (* or #) here
*/
def normalizeString(s: Seq[String]): Lines = for {
(ln, n) <- ... | mogproject/mog-core-scala | shared/src/main/scala/com/mogproject/mogami/core/io/kif/KifFactory.scala | Scala | apache-2.0 | 1,295 |
package com.andre_cruz.utils
import com.andre_cruz.utils.OptionUtils.optionIf
object TraversableOnceUtils {
implicit class RichTraversableOnce[+A](underlying: TraversableOnce[A]) {
def minOption[B >: A](implicit cmp: Ordering[B]): Option[A] = optionIf(underlying.nonEmpty) {
underlying.min(cmp)
}
... | codecruzer/scala-caching | src/main/scala/com/andre_cruz/utils/TraversableOnceUtils.scala | Scala | apache-2.0 | 735 |
package com.scripts
import org.apache.spark.sql.DataFrame
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions.array
import org.apache.spark.sql.functions.col
import org.apache.spark.sql.functions.explode
import org.apache.spark.sql.functions.lit
import org.apache.spark.sql.functions.struct
i... | sum-coderepo/spark-scala | src/main/scala/com/scripts/Excel_read.scala | Scala | apache-2.0 | 2,992 |
/*
* 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... | cheeseng/scalatest | scalatest-test/src/test/scala/org/scalatest/ShouldEqualNullSpec.scala | Scala | apache-2.0 | 5,956 |
package net.fehmicansaglam.tepkin
import akka.stream.ActorMaterializer
import akka.util.Timeout
import net.fehmicansaglam.bson.BsonDocument
import org.scalatest._
import org.scalatest.concurrent.ScalaFutures
import scala.concurrent.duration._
class MongoDatabaseSpec
extends FlatSpec
with Matchers
with ScalaFut... | fehmicansaglam/tepkin | tepkin/src/test/scala/net/fehmicansaglam/tepkin/MongoDatabaseSpec.scala | Scala | apache-2.0 | 1,047 |
package aia.stream
import java.nio.file.{ Path, Paths }
object FileArg {
def shellExpanded(path: String): Path = {
if(path.startsWith("~/")) {
Paths.get(System.getProperty("user.home"), path.drop(2))
} else {
Paths.get(path)
}
}
} | RayRoestenburg/akka-in-action | chapter-stream/src/main/scala/aia/stream/FileArg.scala | Scala | mit | 266 |
package dotty.tools
package dotc
package ast
import dotty.tools.dotc.transform.ExplicitOuter
import dotty.tools.dotc.typer.ProtoTypes.FunProtoTyped
import transform.SymUtils._
import core._
import util.Positions._, Types._, Contexts._, Constants._, Names._, Flags._
import SymDenotations._, Symbols._, StdNames._, Annot... | spetz911/dotty | src/dotty/tools/dotc/ast/tpd.scala | Scala | bsd-3-clause | 38,695 |
//package org.aja.tantra.examples.concurrency.akka
//
///**
// * Created by mdhandapani on 29/10/15.
// */
//import akka.actor._
//import akka.routing.RoundRobinRouter
//import scala.concurrent.duration._
//
//object Pi extends App {
//
// calculate(nrOfWorkers = 4, nrOfElements = 10000, nrOfMessages = 10000)
//
// s... | Mageswaran1989/aja | src/examples/scala/org/aja/tantra/examples/concurrency/akka/PI.scala | Scala | apache-2.0 | 2,769 |
class CrashTest {
def foo = ()
trait CrashTestTable {
def cols = foo
}
// This was leading to a class between the mixed in
// outer accessor and the outer accessor of this object.
object CrashTestTable extends CrashTestTable {
foo
cols
}
}
class CrashTest1 {
def foo = ()
class CrashTestTa... | felixmulder/scala | test/files/run/t7242.scala | Scala | bsd-3-clause | 987 |
package scalaguide.ws.scalaopenid
import play.api.test._
//#dependency
import javax.inject.Inject
import scala.concurrent.Future
import play.api._
import play.api.mvc._
import play.api.data._
import play.api.data.Forms._
import play.api.libs.openid._
class Application @Inject() (openIdClient: OpenIdClient) extends ... | jyotikamboj/container | pf-documentation/manual/working/scalaGuide/main/ws/code/ScalaOpenIdSpec.scala | Scala | mit | 1,973 |
package tut
import java.io.File
import tut.Zed._
object TutMain {
def main(args: Array[String]): Unit = runl(args.toList).unsafePerformIO()
def runl(args: List[String]): IO[Unit] = {
val (in, out) = (args(0), args(1)).umap(new File(_))
val filter = args(2).r
val opts = args.drop(3)
for {
... | tpolecat/tut | modules/core/src/main/scala/tut/TutMain.scala | Scala | mit | 567 |
package org.openurp.edu.eams.teach.grade.transcript.service.impl
import org.beangle.commons.collection.Collections
import org.beangle.commons.dao.impl.BaseServiceImpl
import org.openurp.edu.base.Student
import org.openurp.edu.eams.teach.grade.transcript.service.TranscriptDataProvider
import org.openurp.edu.teach.pl... | openurp/edu-eams-webapp | grade/src/main/scala/org/openurp/edu/eams/teach/grade/transcript/service/impl/TranscriptPlanCourse.scala | Scala | gpl-3.0 | 1,657 |
object Test extends dotty.runtime.LegacyApp {
def test[T](t1 : T, t2 : T)(implicit ord : Ordering[T]) = {
val cmp = ord.compare(t1, t2);
val cmp2 = ord.compare(t2, t1);
assert((cmp == 0) == (cmp2 == 0))
assert((cmp > 0) == (cmp2 < 0))
assert((cmp < 0) == (cmp2 > 0))
}
def testAll[T](t1 : T, ... | yusuke2255/dotty | tests/run/OrderingTest.scala | Scala | bsd-3-clause | 1,134 |
/*
* 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... | dotty-staging/scalatest | scalatest/src/main/scala/org/scalatest/time/Units.scala | Scala | apache-2.0 | 10,213 |
/*
* 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/Partitioner.scala | Scala | apache-2.0 | 11,268 |
package com.nthportal.shell.async
import scala.concurrent.Future
/**
* Something which provides input (asynchronously) for an [[AsyncShell]].
*/
trait InputProvider {
/**
* Returns a [[Future]] which will contain the next [[InputAction action]]
* to be executed (by an [[AsyncShell]]).
*
* Succes... | NthPortal/app-shell | src/main/scala/com/nthportal/shell/async/InputProvider.scala | Scala | apache-2.0 | 647 |
/*
* Copyright 2015 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 agreed to ... | anand-singh/mongo-scala-driver | driver/src/main/scala/org/mongodb/scala/model/PushOptions.scala | Scala | apache-2.0 | 846 |
package HackerRank.Training.DataStructures.Arrays
import java.io.{ByteArrayInputStream, IOException, InputStream, PrintWriter}
import java.util.InputMismatchException
import scala.collection.generic.CanBuildFrom
import scala.collection.mutable.ListBuffer
import scala.language.higherKinds
/**
* Copyright (c) 2017 A... | robertoFischer/hackerrank | src/main/scala/HackerRank/Training/DataStructures/Arrays/DynamicArray.scala | Scala | mit | 8,999 |
class Yiibai(xc: Int, yc: Int){
var x: Int = xc
var y: Int = yc
def move(dx: Int, dy: Int){
x = x + dx
y = y + dy
println("Yiibai x location : " + x)
println("Yiibai y location : " + y)
}
}
| cmonkey/scala-school | src/main/scala/Yiibai.scala | Scala | gpl-3.0 | 216 |
import scala.math.pow
object ExactlyAthrid {
def main(arg: Array[String]) {
val digits = List(1, 2, 3, 4, 5, 6, 7, 8, 9);
for (c <- digits.combinations(4)) {
for(d <- c.permutations) {
// Get the numerator
var numerator = 0;
for((digit, place) <- d.zipWithIndex) {
nume... | MartinThoma/LaTeX-examples | documents/Programmierparadigmen/scripts/scala/04-ExactlyAThird.scala | Scala | mit | 917 |
/*
* Copyright (c) 2017 Clement Trosa <me@trosa.io>
*
* 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... | iomonad/avian | src/main/scala/io/trosa/avian/network/Request.scala | Scala | mit | 1,481 |
package com.chriswk.bnet.wow.model
/**
* A Wow Character
*/
case class Spec(name: Option[String], role: String, backgroundImage: String, icon: String, description: String, order: Int)
case class Character(name: String,
achievementPoints: Int,
battlegroup: String,
... | chriswk/sbnetapi | src/main/scala/com/chriswk/bnet/wow/model/Character.scala | Scala | mit | 584 |
package lila
object log {
def apply(name: String): Logger = new Logger(name)
val boot = apply("boot")
val sameThread = apply("same-thread")
final class Logger(name: String) extends play.api.LoggerLike {
val logger = org.slf4j.LoggerFactory getLogger name
def branch(childName: String) = new Logger... | clarkerubber/lila | modules/common/src/main/log.scala | Scala | agpl-3.0 | 355 |
/*
* 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/test/scala/org/scalatest/ShouldStartWithRegexSpec.scala | Scala | apache-2.0 | 140,978 |
/*
* LambdaCalculusTest.scala
*/
package at.logic.gapt.expr
import org.specs2.mutable._
import scala.collection.immutable.{ HashSet, HashMap }
import scala.math.signum
class LambdaCalculusTest extends Specification {
"TypedLambdaCalculus" should {
"make implicit conversion from String to Name" in {
(... | loewenheim/gapt | src/test/scala/at/logic/gapt/expr/LambdaCalculusTest.scala | Scala | gpl-3.0 | 9,626 |
trait MyRange {
inline def foreach(inline f: Int => Unit): Unit
}
transparent inline def MyRange(inline start: Int, inline end: Int): MyRange = new {
inline def foreach(inline f: Int => Unit) = // error: Implementation restriction
var i = start
val e = end
while (i < e) {
f(i)
i += 1
}
... | dotty-staging/dotty | tests/neg/inline-foreach.scala | Scala | apache-2.0 | 508 |
package net.fwbrasil.scala
import scala.IndexOutOfBoundsException
object Product29 {
def unapply[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29](x: Product29[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T1... | xdevelsistemas/activate | activate-core/src/main/scala/net/fwbrasil/scala/Product29.scala | Scala | lgpl-2.1 | 2,113 |
// Copyright (c) 2016 PSForever.net to present
package net.psforever.packet.game
import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacket}
import scodec.Codec
import scodec.codecs._
/**
* Report the raw numerical population for a zone (continent).<br>
* <br>
* Populations are displayed ... | Fate-JH/PSF-Server | common/src/main/scala/net/psforever/packet/game/ZonePopulationUpdateMessage.scala | Scala | gpl-3.0 | 4,278 |
/*
* Copyright 2015 LG CNS.
*
* 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... | jahnaviancha/scouter | scouter.server/src/scouter/server/core/cache/CacheHelper.scala | Scala | apache-2.0 | 733 |
package com.microsoft.partnercatalyst.fortis.spark.analyzer
import java.net.URL
import com.github.catalystcode.fortis.spark.streaming.facebook.dto.FacebookPost
import facebook4j.Post
import org.mockito.Mockito
import org.scalatest.FlatSpec
import org.scalatest.mock.MockitoSugar
class FacebookPostAnalyzerTestSpec ext... | CatalystCode/project-fortis-spark | src/test/scala/com/microsoft/partnercatalyst/fortis/spark/analyzer/FacebookPostAnalyzerTestSpec.scala | Scala | mit | 1,696 |
/*
* 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/Flatten.scala | Scala | apache-2.0 | 2,437 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package toplevel
package imports
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement
import org.jetbrains.plugins.scala.lang.psi.api.base.ScStableCodeReferenceElement
/**
* @author Alexander Podkhalyuz... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/api/toplevel/imports/ScImportExpr.scala | Scala | apache-2.0 | 1,277 |
package io.continuum.bokeh
package examples
package models
import math.{Pi=>pi,sin}
object DateAxis extends Example {
val now = System.currentTimeMillis.toDouble/1000
val x = -2*pi to 2*pi by 0.1
object source extends ColumnDataSource {
val times = column(x.indices.map(3600000.0*_ + now))
... | bokeh/bokeh-scala | examples/src/main/scala/models/DateAxis.scala | Scala | mit | 1,219 |
/*
* 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-2.0
*
... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/session/Synchronization.scala | Scala | apache-2.0 | 705 |
package edu.nus.maxsmtplay
import com.microsoft.z3._
abstract class MaxSMT {
this: Z3 =>
def solve(soft: List[BoolExpr], hard: List[BoolExpr]): Option[List[BoolExpr]] = {
solveAndGetModel(soft, hard) match {
case None => None
case Some((clauses, _)) => Some(clauses)
}
}
def solveAndGetMo... | mechtaev/maxsmt-playground | src/main/scala/edu/nus/maxsmtplay/MaxSMT.scala | Scala | mit | 404 |
package support.bulkImport
import org.joda.time.DateTime
/**
* Created with IntelliJ IDEA.
* User: matthijs
* Date: 6/29/13
* Time: 7:46 PM
* To change this template use File | Settings | File Templates.
*/
object WorkerResultStatus extends Enumeration {
type Status = Value
val DONE, FAILED, TIMEOUT, READ... | plamola/sendR | app/support/bulkImport/WorkerResult.scala | Scala | gpl-2.0 | 817 |
/*
* 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 ... | sgururajshetty/carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/aggquery/IntegerDataTypeTestCase.scala | Scala | apache-2.0 | 7,306 |
package com.asto.dmp.shu.service.impl
import com.asto.dmp.shu.base.Constants
import com.asto.dmp.shu.dao.impl.BizDao
import com.asto.dmp.shu.mq.{MsgWrapper, MQAgent, Msg}
import com.asto.dmp.shu.service.Service
import com.asto.dmp.shu.util.FileUtils
import org.apache.spark.Logging
object TrendDataService extends Logg... | zj-lingxin/Dmp_shu | src/main/scala/com/asto/dmp/shu/service/impl/TrendDataService.scala | Scala | mit | 1,875 |
package com.lucaongaro.similaria.lmdb
import scala.language.implicitConversions
import java.nio.ByteBuffer
case class Key( int: Int )
object Key {
def unapply( bytes: Array[Byte] ) = {
if ( bytes == null )
None
else {
val int = ByteBuffer.wrap( bytes ).getInt
Some( int )
}
}
impl... | lucaong/similaria | src/main/scala/com/lucaongaro/similaria/lmdb/Key.scala | Scala | mit | 431 |
/*
* This file is part of the "consigliere" toolkit for sosreport
* and SAR data analytics and visualization.
*
* Copyright (c) 2014 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 th... | willb/c9e | common/src/main/scala/com/redhat/et/c9e/sar/analysis/specialized.scala | Scala | apache-2.0 | 4,020 |
/**
* Copyright (C) 2010 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 program i... | evlist/orbeon-forms | src/main/scala/org/orbeon/oxf/common/PEVersion.scala | Scala | lgpl-2.1 | 9,908 |
package me.gregd.cineworld.domain.repository
import me.gregd.cineworld.domain.model.Cinema
trait CinemaRepository[F[_]] {
def fetchAll(): F[Seq[Cinema]]
def persist(cinemas: Seq[Cinema]): F[Unit]
}
| Grogs/cinema-service | domain/src/main/scala/me/gregd/cineworld/domain/repository/CinemaRepository.scala | Scala | gpl-3.0 | 205 |
object Ranges {
// (1 to 10). // (1) this works as expected
(1 to 10).toS /*!*/ // (2) this fails
} | felixmulder/scala | test/disabled/presentation/ide-bug-1000450/src/Ranges.scala | Scala | bsd-3-clause | 106 |
import scala.reflect.runtime.universe._
class C {
val f1 = 2
var f2 = 3
def m1 = 4
def m2() = 5
def m3[T >: String <: Int]: T = ???
def m4[A[_], B <: A[Int]](x: A[B])(implicit y: Int) = ???
def m5(x: => Int, y: Int*): String = ???
class C
object M
override def toString = "an instance of C"
}
obj... | scala/scala | test/files/run/reflection-allmirrors-tostring.scala | Scala | apache-2.0 | 1,481 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | patverga/factorie | src/main/scala/cc/factorie/directed/ExpectationMaximization.scala | Scala | apache-2.0 | 2,323 |
/**
* Copyright (c) 2013 Bernard Leach
*
* 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, publ... | leachbj/hsm-emulator | hsmsim-akka/src/main/scala/org/leachbj/hsmsim/commands/GenerateZpk.scala | Scala | mit | 2,291 |
package scalajsjest
import scala.concurrent.Future
import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue
import scala.scalajs.js.JSConverters._
private[scalajsjest] trait BaseSuite {
def test(name: String)(block: => Unit): Unit =
JestGlobal.test(name,() => block)
def testAsync(name: String)(blo... | scalajs-jest/core | src/main/scala/scalajsjest/BaseSuite.scala | Scala | apache-2.0 | 1,157 |
package doodle.examples
import doodle.core._
import doodle.syntax._
object ColorPalette {
// Type alias for cell constructor functions.
// Takes a hue and a lightness as parameters:
type CellFunc = (Int, Double) => Image
// Different types of cell:
def squareCell(size: Int): CellFunc =
(hue: Int, lig... | Angeldude/doodle | shared/src/main/scala/doodle/examples/ColorPalette.scala | Scala | apache-2.0 | 1,199 |
/*
* Process.scala
* Trait to map indices to elements over values
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: Oct 14, 2014
*
* Copyright 2014 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http://www.githu... | agarbuno/figaro | Figaro/src/main/scala/com/cra/figaro/library/collection/Process.scala | Scala | bsd-3-clause | 6,593 |
/*
* 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/flowmanagement/pagerouters/businessmatching/subsectors/NoPsrNumberPageRouterSpec.scala | Scala | apache-2.0 | 1,234 |
/*
* 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 agr... | datamountaineer/kafka-connect-common | src/test/scala/com/datamountaineer/streamreactor/connect/errors/TestErrorHandlerThrow.scala | Scala | apache-2.0 | 1,224 |
package org.jetbrains.plugins.scala.lang.completion.weighter
import com.intellij.codeInsight.completion._
import org.jetbrains.plugins.scala.lang.completion.{ScalaAfterNewCompletionUtil, ScalaCompletionUtil}
import org.jetbrains.plugins.scala.lang.refactoring.util.ScalaNamesUtil
/**
* Created by Kate Ustyuzhanina o... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/completion/weighter/ScalaCompletionSorting.scala | Scala | apache-2.0 | 2,614 |
package pt.org.apec.services.books.api
import spray.routing._
import pt.org.apec.services.books.common.PublicationSorting
trait PublicationOrderDirectives extends Directives {
import PublicationSorting._
def publicationsSorted: Directive1[PublicationOrder] = readParameter("sortBy") map (_.getOrElse(PublicationOr... | apecpt/apec-books-service | service/src/main/scala/pt/org/apec/services/books/api/PublicationOrderDirectives.scala | Scala | apache-2.0 | 566 |
package com.mohiva.play.silhouette.api.util
import play.api.libs.json.Json
import play.api.test._
/**
* Test case for the [[com.mohiva.play.silhouette.api.util.Base64]] object.
*/
class Base64Spec extends PlaySpecification {
"The `decode` method" should {
"decode a Base64 string" in {
Base64.decode("SG... | cemcatik/play-silhouette | silhouette/test/com/mohiva/play/silhouette/api/util/Base64Spec.scala | Scala | apache-2.0 | 679 |
/*
* stateless-future
* Copyright 2014 深圳岂凡网络有限公司 (Shenzhen QiFun Network Corp., LTD)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-... | Atry/stateless-future | src/main/scala/com/qifun/statelessFuture/ANormalForm.scala | Scala | apache-2.0 | 30,131 |
package sri.universal.components
import sri.core._
import scalajsplus.macros.{FunctionObjectMacro,exclude,rename}
import scalajsplus.{ OptDefault => NoValue, OptionalParam => OP}
import sri.universal.MergeJSObjects
import scala.scalajs.js
import scala.scalajs.js.Dynamic.{literal => json}
import scala.scalajs.js.JSCon... | scalajs-react-interface/universal | src/main/scala/sri/universal/components/AnimatedView.scala | Scala | apache-2.0 | 1,634 |
package varys.framework.master.scheduler
import scala.collection.mutable.{HashMap, ArrayBuffer}
import varys.framework.master.{CoflowInfo, SlaveInfo}
/**
* Primary interface of coflow schedulers.
*
* Callbacks methods from master must be defined here to address various events.
*
* User(s) of this must *not* b... | frankfzw/varys | core/src/main/scala/varys/framework/master/scheduler/coflowScheduler.scala | Scala | apache-2.0 | 955 |
package test
import javafx.application.Application
import javafx.animation.AnimationTimer
import javafx.scene.canvas.Canvas
import javafx.scene.layout.StackPane
import javafx.scene.Scene
import javafx.stage.Stage
import javafx.scene.media.MediaPlayer
import javafx.scene.media.Media
import javafx.scene.image.Image
impo... | MyForteIsTimeTravel/PanamaEngine | src/test/SpriteTest.scala | Scala | mit | 3,429 |
//package com.sksamuel.avro4s
//
//import com.sksamuel.avro4s.SchemaUpdate.{FullSchemaUpdate, NamespaceUpdate, NoUpdate}
//import com.sksamuel.avro4s.ValueTypes._
//import magnolia.{CaseClass, Param}
//import org.apache.avro.{Schema, SchemaBuilder}
//import scala.reflect.runtime.universe._
//
//class ValueTypeEncoder[T... | sksamuel/avro4s | avro4s-core/src/main/scala/com/sksamuel/avro4s/ValueTypes.scala | Scala | apache-2.0 | 6,198 |
/*
* Copyright 2015 Stephan Rehfeld
*
* 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 ... | stephan-rehfeld/scaladelray | src/test/scala/test/scaladelray/texture/ChessboardTextureSpec.scala | Scala | apache-2.0 | 1,445 |
/*
* 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 ... | vinodkc/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/ColumnAccessor.scala | Scala | apache-2.0 | 7,035 |
package io.gatling.amqp.check
import io.gatling.core.check.extractor.xpath.{ JdkXPathExtractorFactory, SaxonXPathExtractorFactory }
import io.gatling.core.session.Expression
// TODO: use Expression
trait AmqpCheckSupport {
// def simpleCheck = AmqpSimpleCheck
// def xpath(expression: Expression[String], namespace... | maiha/gatling-amqp | src/main/scala/io/gatling/amqp/check/AmqpCheckSupport.scala | Scala | mit | 532 |
import scala.reflect.runtime.{ universe => ru }
object Test extends dotty.runtime.LegacyApp {
trait FormTrait {
val runtimeMirror = ru.runtimeMirror(this.getClass.getClassLoader)
val instanceMirror = runtimeMirror.reflect(this)
val members = instanceMirror.symbol.typeSignature.members
def fields =... | folone/dotty | tests/pending/run/t8196.scala | Scala | bsd-3-clause | 1,080 |
/***********************************************************************
* 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... | aheyne/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/geometry/GeometryPrecision.scala | Scala | apache-2.0 | 1,759 |
package com.seanshubin.uptodate.logic
case class SummaryReport(totalArtifacts: Int,
artifactsToUpgrade: Int,
notFound: Int,
apply: Int,
ignore: Int,
alreadyUpToDateCount: Int,
... | SeanShubin/up-to-date | logic/src/main/scala/com/seanshubin/uptodate/logic/SummaryReport.scala | Scala | unlicense | 356 |
package talos
import scala.language.implicitConversions
import scala.reflect.macros.blackbox
import scala.language.experimental.macros
trait DefaultConstraints {
def constraint[T >: Null](fn: T => Constraint[T]): Constraint[T] = fn(null)
implicit class ConstraintOperators[T](self: Constraint[T]) {
def &&(oth... | daniel-uzunu/talos | core/src/main/scala/talos/DefaultConstraints.scala | Scala | mit | 2,541 |
package org.genericConfig.admin.shared.user
import org.genericConfig.admin.shared.common.ErrorDTO
import play.api.libs.functional.syntax._
import play.api.libs.json.{Format, JsPath}
case class UserResultDTO(
userId: Option[String],
username : Option[String],
... | gennadij/admin | shared/src/main/scala/org/genericConfig/admin/shared/user/UserResultDTO.scala | Scala | apache-2.0 | 720 |
package build
import java.io.{File => JFile}
import java.util.UUID
import scala.io.Codec
import models._
import settings.Global
import dao.util.FileHelper
import org.apache.commons.io.{FilenameUtils, FileUtils}
import org.apache.commons.lang3.StringEscapeUtils
sealed trait DocTypeBuilder {
def supportedFileExten... | grahamar/Giles | app/build/DocTypeBuilders.scala | Scala | apache-2.0 | 3,033 |
package org.scalaide.core.internal.jdt.model
import java.util.{ HashMap => JHashMap }
import java.util.{ Map => JMap }
import org.eclipse.core.resources.IFile
import org.eclipse.core.resources.IResource
import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.jdt.core.IBuffer
import org.eclipse.jdt.core.ICo... | romanowski/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/core/internal/jdt/model/ScalaSourceFile.scala | Scala | bsd-3-clause | 6,951 |
package play.json.extra
import scala.language.experimental.macros
import org.cvogt.scala.constraint.boolean.!
import scala.reflect.macros.blackbox
import play.api.libs.json._
import collection.immutable.ListMap
sealed trait AdtEncoder
object AdtEncoder{
trait TypeTagAdtEncoder extends AdtEncoder{
import scala.r... | aparo/scalajs-supler | supler/shared/src/main/scala/play/json/extra/extra.scala | Scala | apache-2.0 | 7,686 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | yggdrasil/src/test/scala/com/precog/yggdrasil/table/SliceSpec.scala | Scala | agpl-3.0 | 6,582 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogdebugger/ui/fieldvisualizations/scalar/AcceleratedStackedTimeseriesPanel.scala | Scala | apache-2.0 | 5,960 |
/*******************************************************************************
Copyright (c) 2012-2013, KAIST, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
**********************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/analysis/typing/domain/AbsBase.scala | Scala | bsd-3-clause | 649 |
package au.com.agiledigital.toolform.command.generate.kubernetes.minishift
import java.io.{BufferedWriter, File, FileWriter}
import java.nio.file.Path
import au.com.agiledigital.toolform.app.ToolFormError
import au.com.agiledigital.toolform.command.generate.kubernetes.DeploymentWriter.writeDeployment
import au.com.ag... | agiledigital/toolform | src/main/scala/au/com/agiledigital/toolform/command/generate/kubernetes/minishift/GenerateMinishiftCommand.scala | Scala | apache-2.0 | 5,760 |
package com.manning.androidhacks.hack050.tests
import junit.framework.Assert._
import _root_.android.test.AndroidTestCase
class UnitTests extends AndroidTestCase {
def testPackageIsCorrect {
assertEquals("com.manning.androidhacks.hack050", getContext.getPackageName)
}
} | ZhQYuan/50AH-code | hack034/tests/src/main/scala/UnitTests.scala | Scala | mit | 280 |
// FilterTweets.scala
//
// Copyright (C) 2014 Ben Wing, The University of Texas at Austin
//
// 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/L... | utcompling/textgrounder | src/main/scala/opennlp/textgrounder/preprocess/FilterTweets.scala | Scala | apache-2.0 | 4,548 |
package com.scalaAsm.x86
package Instructions
package System
// Description: Store Task Register
// Category: general
trait STR extends InstructionDefinition {
val mnemonic = "STR"
}
object STR extends OneOperand[STR] with STRImpl
trait STRImpl extends STR {
implicit object _0 extends OneOp[m16] {
val opcod... | bdwashbu/scala-x86-inst | src/main/scala/com/scalaAsm/x86/Instructions/System/STR.scala | Scala | apache-2.0 | 959 |
package im.actor.server.enrich
import scala.concurrent.ExecutionContextExecutor
import scala.concurrent.duration._
import scala.util.{ Failure, Success, Try }
import akka.actor._
import akka.contrib.pattern.DistributedPubSubMediator
import akka.event.Logging
import akka.http.scaladsl.model.Uri
import akka.stream.Mate... | supertanglang/actor-platform | actor-server/actor-enrich/src/main/scala/im/actor/server/enrich/RichMessageWorker.scala | Scala | mit | 4,881 |
package scalaxy.enums
import scala.language.experimental.macros
class EnumValueNames(
val names: Array[String],
val initializer: AnyRef => Array[AnyRef])
extends Serializable
object EnumValueNames {
implicit def enumValueNames: EnumValueNames =
macro internal.enumValueNames[EnumValueNames]
}
| nativelibs4java/Scalaxy | Enum/src/main/scala/scalaxy/enums/EnumValueNames.scala | Scala | bsd-3-clause | 310 |
/*
* Copyright © 2015 Lukas Rosenthaler, Benjamin Geer, Ivan Subotic,
* Tobias Schweizer, André Kilchenmann, and Sepideh Alassi.
*
* This file is part of Knora.
*
* Knora 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 F... | nie-ine/Knora | webapi/src/test/scala/org/knora/webapi/util/PermissionUtilV1Spec.scala | Scala | agpl-3.0 | 12,122 |
package com.lorandszakacs.sg.model.impl
import com.lorandszakacs.sg.model._
import com.lorandszakacs.util.mongodb._
import com.lorandszakacs.util.effects._
/**
*
* @author Lorand Szakacs, lsz@lorandszakacs.com
* @since 14 Jul 2017
*
*/
private[impl] class RepoSGs(override protected val db: Database)(
impl... | lorandszakacs/sg-downloader | sg-repo/src/main/scala/com/lorandszakacs/sg/model/impl/RepoSGs.scala | Scala | apache-2.0 | 619 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package expressions
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.parsing.patterns.{Guard, Patter... | advancedxy/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/expressions/Enumerator.scala | Scala | apache-2.0 | 2,019 |
package hooktest
/*
* Copyright (c) 2016 Yuki Ono
* Licensed under the MIT License.
*/
//import java.util.concurrent.ArrayBlockingQueue
import java.util.concurrent._
import com.sun.jna.Pointer
import com.sun.jna.WString
import com.sun.jna.Memory;
import com.sun.jna.ptr.IntByReference
import com.sun.jna.platform.w... | ykon/w10wheel | src/main/scala/hooktest/Windows.scala | Scala | mit | 20,754 |
package domala.jdbc
import java.sql.Connection
import javax.sql.DataSource
import domala.internal.macros.reflect.DaoProviderMacro
import scala.reflect.ClassTag
import scala.language.experimental.macros
/** A provider of Dao instance. */
object DaoProvider {
def get[T](implicit config: Config, classTag: ClassTag[T... | bakenezumi/domala | core/src/main/scala/domala/jdbc/DaoProvider.scala | Scala | apache-2.0 | 728 |
// Expression-oriented Language
// Scala favors expressions over statements.
// This idea is present in constructs throughout Scala
// - try/catch
// - loops
// - return values
// - ...
// Note: You can turn a series of statements and
// expressions into an expression using curly braces!
val baz = {
va... | agconti/scala-school | 01-intro-to-scala/slides/slide005.scala | Scala | mit | 412 |
package com.cevaris.hashes
trait HashOperation
object Remove extends HashOperation
object Set extends HashOperation
object Get extends HashOperation
object HashedMap {
implicit class Sieve(val N: Int) extends AnyVal {
def primes: Seq[Int] = {
val isPrime = collection.mutable.BitSet(2 to N: _*) -- (4 to... | cevaris/hashes | src/main/scala/com/cevaris/hashes/HashedMap.scala | Scala | apache-2.0 | 867 |
/*
* 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 ... | hvanhovell/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/MountVolumesFeatureStep.scala | Scala | apache-2.0 | 4,943 |
package metamorphic.dsl.util
object Instantiator {
def instance[T](className: String): T = {
val clasz = Class.forName(className)
val constructor = clasz.getConstructor()
constructor.newInstance().asInstanceOf[T]
}
def instance[T](className: Option[String]): Option[T] = {
className match {
... | frroliveira/metamorphic | metamorphic/src/main/scala/metamorphic/dsl/util/Instantiator.scala | Scala | mit | 415 |
package com.github.cthulhu314.scalaba.auth
trait Authentication[T,+User] {
def authenticate(userContext : T) : Stream[User]
}
| cthulhu314/scalaba | src/main/scala/com/github/cthulhu314/scalaba/auth/Authentication.scala | Scala | mit | 128 |
/*
* Drop.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.fscape
package graph
... | Sciss/FScape-next | core/shared/src/main/scala/de/sciss/fscape/graph/Drop.scala | Scala | agpl-3.0 | 1,338 |
/**
* This file is part of mycollab-services.
*
* mycollab-services is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* mycolla... | maduhu/mycollab | mycollab-services/src/main/scala/com/esofthead/mycollab/schedule/email/MailStyles.scala | Scala | agpl-3.0 | 1,356 |
/*
* 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 ... | jackylk/incubator-carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestCreateTableAsSelect.scala | Scala | apache-2.0 | 18,900 |
package rwt.spritz
import java.io._
import com.waywardcode.crypto._
object RePass {
def repass(f : File, oldkey : String, newkey : String): String = {
val headerBytes = new Array[Byte](SpritzHeader.size);
val raf = new RandomAccessFile(f, "rw")
try {
raf.seek(0)
... | rwtodd/spritz_cipher | scala_version/cmd/repass.scala | Scala | gpl-2.0 | 1,847 |
/*
* 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... | svn2github/scalatest | src/test/scala/org/scalatest/ShouldFullyMatchSpec.scala | Scala | apache-2.0 | 26,822 |
/*
* Copyright (C) 2012 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is di... | ISCPIF/PSEExperiments | openmole-src/openmole/plugins/org.openmole.plugin.task.external/src/main/scala/org/openmole/plugin/task/external/ExternalTaskBuilder.scala | Scala | agpl-3.0 | 3,584 |
/*
* Copyright (C) 2012-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package com.qifun.statelessFuture
package test
package run
package ifelse2
import language.{reflectiveCalls, postfixOps}
import scala.concurrent.{ExecutionContext, Await}
import scala.concurrent.duration._
import com.qifun.statelessFuture.test.... | Atry/stateless-future-test | test/src/test/scala/com/qifun/statelessFuture/test/run/ifelse2/ifelse2.scala | Scala | bsd-3-clause | 972 |
/*
* 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 ... | sgururajshetty/carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/CarbonDatasourceHadoopRelation.scala | Scala | apache-2.0 | 8,545 |
package at.logic.gapt.utils.logging
import org.slf4j.LoggerFactory
trait Logger {
protected def loggerName = getClass.getName
protected val log = LoggerFactory.getLogger( loggerName )
// Ordered by level of importance.
// E.g. if the logging level is chosen to be info, info, warn and error
// messages will... | loewenheim/gapt | src/main/scala/at/logic/gapt/utils/logging/Logger.scala | Scala | gpl-3.0 | 1,001 |
/*
* 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 ... | taroplus/spark | sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala | Scala | apache-2.0 | 53,775 |
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.