code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package ee.cone.c4actor.tests
import ee.cone.c4actor.{RawSnapshot, SnapshotUtilImpl}
object SnapshotUtilTest {
def main(args: Array[String]): Unit = {
val sn = "snapshots/0000000000009b70-ff5a4654-8a0f-377e-9616-d3d64cfa0131-gzip-a-u-u"
println(SnapshotUtilImpl.hashFromName(RawSnapshot(sn)))
}
}
| conecenter/c4proto | extra_examples/src/main/scala/ee/cone/c4actor/tests/SnapshotUtilTest.scala | Scala | apache-2.0 | 311 |
/*
* This file is part of Kiama.
*
* Copyright (C) 2011-2015 Anthony M Sloane, Macquarie University.
*
* Kiama 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 3 of the License, or ... | solomono/kiama | library/src/org/kiama/example/oberon0/L2/NameAnalyser.scala | Scala | gpl-3.0 | 1,334 |
package sharry.backend
import cats.effect.Sync
import org.mindrot.jbcrypt.BCrypt
object Common {
def genSaltString[F[_]: Sync]: F[String] =
Sync[F].delay(BCrypt.gensalt())
}
| eikek/sharry | modules/backend/src/main/scala/sharry/backend/Common.scala | Scala | gpl-3.0 | 185 |
package com.blackboxsociety.http.crypto
import com.blackboxsociety.waterhouse._
object Signed {
def sign(secret: String, text: String): String =
HMAC.stringDigest[HMAC.Sha256.type](HMAC.Secret(secret), "")
def verify(secret: String, signed: String): Option[String] = {
val text = signed.drop(64)
... | blackboxsociety/blackbox-http | src/main/scala/com/blackboxsociety/http/crypto/Signed.scala | Scala | mit | 507 |
/*
* Copyright 2019 http4s.org
*
* 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... | rossabaker/http4s | ember-core/jvm/src/main/scala/org/http4s/ember/core/h2/HpackPlatform.scala | Scala | apache-2.0 | 3,003 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/Command.scala | Scala | apache-2.0 | 1,222 |
/* Generated File */
package models.queries.film
import com.kyleu.projectile.models.database.{DatabaseField, Row}
import com.kyleu.projectile.models.database.DatabaseFieldType._
import com.kyleu.projectile.models.queries.{BaseQueries, ResultFieldHelper}
import com.kyleu.projectile.models.result.data.DataField
import c... | KyleU/boilerplay | app/models/queries/film/FilmActorRowQueries.scala | Scala | cc0-1.0 | 4,495 |
// Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
package io.fsq.spindle.rogue.test
import io.fsq.rogue.index.{Asc, Desc, Hashed, MongoIndex}
import io.fsq.spindle.rogue.SpindleIndexSubField
import io.fsq.spindle.rogue.test.gen.{ThriftVenue, ThriftVenueClaimBson, ThriftVenueMeta}
import org.junit.Test
impor... | foursquare/fsqio | test/jvm/io/fsq/spindle/rogue/test/SpindleMongoIndexTest.scala | Scala | apache-2.0 | 1,208 |
package dotty.tools.repl
/** Main entry point to the REPL */
object Main {
def main(args: Array[String]): Unit =
new ReplDriver(args).runUntilQuit()
}
| som-snytt/dotty | compiler/src/dotty/tools/repl/Main.scala | Scala | apache-2.0 | 158 |
package org.bitcoins.core.number
import org.scalatest.{ FlatSpec, MustMatchers }
/**
* Created by chris on 6/14/16.
*/
class UInt32Test extends FlatSpec with MustMatchers {
"UInt32" must "create the number zero as an unsigned 32 bit integer" in {
val zero = UInt32(Seq(0x0.toByte))
zero.toLong must be(0)
... | Christewart/bitcoin-s-core | src/test/scala/org/bitcoins/core/number/UInt32Test.scala | Scala | mit | 2,041 |
package com.twitter.finagle.netty3
import com.twitter.io.Buf
import org.jboss.netty.buffer.{ChannelBuffers, ChannelBuffer}
/**
* A [[com.twitter.io.Buf]] wrapper for
* Netty [[org.jboss.netty.buffer.ChannelBuffer ChannelBuffers]].
*
* @note Since `ChannelBuffer`s are mutable, modifying the wrapped buffer
* withi... | koshelev/finagle | finagle-netty3/src/main/scala/com/twitter/finagle/netty3/ChannelBufferBuf.scala | Scala | apache-2.0 | 4,563 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.linker
/** ECMAScript fea... | SebsLittleHelpers/scala-js | linker/shared/src/main/scala/org/scalajs/linker/ESFeatures.scala | Scala | apache-2.0 | 2,885 |
package elea.rewrite
import elea.term.{Substitution, Term}
import scalaz.IList
case class Ripple(
skeletons: IList[Term],
goal: Term,
generalisation: Substitution) {
def mapGoal(f: Term => Term) = copy(goal = f(goal))
}
| wsonnex/elea | src/main/scala/elea/rewrite/Ripple.scala | Scala | mit | 245 |
/**
* Copyright (c) 2002-2012 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundati... | dksaputra/community | cypher/src/main/scala/org/neo4j/cypher/internal/commands/expressions/HeadFunction.scala | Scala | gpl-3.0 | 1,663 |
package com.awesomesauce.minecraft.forge.openautomation.common.lasers.te
import com.awesomesauce.minecraft.forge.core.lib.item.{TActivatedTileEntity, TRedstonePulseActivated}
import com.awesomesauce.minecraft.forge.core.lib.util.PlayerUtil
import com.awesomesauce.minecraft.forge.openautomation.api.lasers.{LaserAPI, La... | AwesomeSauceMods/OpenAutomation | main/scala/com/awesomesauce/minecraft/forge/openautomation/common/lasers/te/TileEntityCallbackLaserEmitter.scala | Scala | mit | 2,677 |
package looty
package chrome
import scala.scalajs.js.annotation.JSName
import scala.scalajs.js
import scala.concurrent.{Promise, Future}
//////////////////////////////////////////////////////////////
// Created by bjackman @ 12/11/13 12:49 AM
//////////////////////////////////////////////////////////////
object Ch... | benjaminjackman/looty | looty/src/main/scala/looty/chrome/ChromeStorage.scala | Scala | gpl-2.0 | 1,879 |
/**
* Copyright (C) 2010-2011 LShift 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-2.0
*
* Unless required by applicable law... | lshift/diffa | kernel/src/test/scala/net/lshift/diffa/kernel/participants/IntegerPartitionTest.scala | Scala | apache-2.0 | 3,741 |
package org.scalaide.core.ui
import org.eclipse.jdt.ui.text.IJavaPartitions
import org.eclipse.jface.text.Document
import org.eclipse.jface.text.IDocument
import org.eclipse.jface.text.IDocumentExtension3
import org.junit.ComparisonFailure
import org.scalaide.CompilerSupportTests
import org.scalaide.core.lexical.Scala... | stephenh/scala-ide | org.scala-ide.sdt.core.tests/src/org/scalaide/core/ui/TextEditTests.scala | Scala | bsd-3-clause | 5,747 |
/*
* 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-blink/src/main/scala/org/apache/flink/table/plan/util/aggregation.scala | Scala | apache-2.0 | 5,053 |
package org.squeryl.test
import java.util.UUID
import org.squeryl._
import org.squeryl.framework.{DBConnector, RunTestsInsideTransaction, SchemaTester}
import org.squeryl.test.PrimitiveTypeModeForTests._
object SubQueryTestSchema{
class Entity(
val name: String) extends KeyedEntity[UUID] {
var id: UUID = n... | xuwei-k/Squeryl | src/test/scala/org/squeryl/test/SubQueryTests.scala | Scala | apache-2.0 | 1,675 |
package org.jscalaexample
import org.jscala._
/**
* @author Alexander Nemish
*/
object AesExample {
def main(args: Array[String]) {
val data = Array(22, 13, 8, 123456789)
println("Input data " + data.mkString(","))
val key = Array(1, 1, 1, 1)
val aes = new Aes(key)
aes.init()
val encrypte... | xeno-by/jscala | jscala-examples/src/main/scala/org/jscalaexample/AES.scala | Scala | mit | 5,251 |
sealed abstract class TrafficLightColor
case object Red extends TrafficLightColor
case object Yellow extends TrafficLightColor
case object Green extends TrafficLightColor
object Main extends App {
for (color <- Array(Red, Yellow, Green))
println(
color match {
case Red => "stop"
case Yello... | yeahnoob/scala-impatient-2e-code | src/ch14/sec15/TrafficLightColor.scala | Scala | gpl-3.0 | 374 |
package org.jetbrains.plugins.scala.lang.resolve2
/**
* Pavel.Fatin, 02.02.2010
*/
class ScopeElementTest extends ResolveTestBase {
override def folderPath: String = {
super.folderPath + "scope/element/"
}
def testBlock(): Unit = doTest()
def testCaseClass(): Unit = doTest()
def testClass(): Unit = ... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/resolve2/ScopeElementTest.scala | Scala | apache-2.0 | 439 |
package org.openurp.edu.eams.teach.grade.service.stat
import org.beangle.commons.collection.Collections
import org.beangle.commons.lang.Objects
import org.openurp.base.Semester
import org.openurp.edu.base.Adminclass
import org.openurp.edu.base.Student
import org.openurp.edu.base.Course
import org.openurp.edu.teach.gra... | openurp/edu-eams-webapp | core/src/main/scala/org/openurp/edu/eams/teach/grade/service/stat/MultiStdGrade.scala | Scala | gpl-3.0 | 3,742 |
package es.weso.computex.profile
import org.scalatest._
import org.scalatest.matchers.ShouldMatchers
import com.typesafe.config._
import com.hp.hpl.jena.rdf.model.ModelFactory
import com.hp.hpl.jena.query._
import com.hp.hpl.jena.query.Query._
import com.hp.hpl.jena.rdf.model._
import com.hp.hpl.jena.util.FileManager
... | weso/computex | test/es/weso/computex/ProfileParserSuite.scala | Scala | apache-2.0 | 5,982 |
package com.evojam.mongodb.evolutions.manager
import scalaz._, Scalaz._
import java.io.{FilenameFilter, File}
import com.evojam.mongodb.evolutions.config.ConfigurationComponent
import com.evojam.mongodb.evolutions.dao.EvolutionsDaoComponent
import com.evojam.mongodb.evolutions.model.evolution.{Action, Evolution}
imp... | evojam/mongodb-evolutions-scala | src/main/scala/com/evojam/mongodb/evolutions/manager/EvolutionsManagerComponent.scala | Scala | apache-2.0 | 3,863 |
package fpis.option
/*
* Implement all of the preceding functions on Option. As you implement each function,
* try to think about what it means and in what situations you’d use it. We’ll explore when
* to use each of these functions next. Here are a few hints for solving this exercise:
* - It’s fine to use patte... | TGITS/programming-workouts | scala/basic/fpis_chap4_option/src/main/scala/fpis/option/Option.scala | Scala | mit | 3,334 |
/*
* 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 ... | joseph-torres/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/memoryV2.scala | Scala | apache-2.0 | 6,066 |
package whisk.docker
import org.scalatest._
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.time._
class DockerServiceSpec extends FlatSpec with Matchers with BeforeAndAfterAll with GivenWhenThen with ScalaFutures
with PingContainerKit {
implicit val pc = PatienceConfig(Span(20, Seconds), Spa... | kiequoo/docker-it-scala | src/test/scala/whisk/docker/DockerServiceSpec.scala | Scala | mit | 1,209 |
package la.aquare.sample
class Main() {
val msg = "Hello world!"
}
object Main extends App {
println(new Main().msg)
}
| marcoshs/sbt-templates | sample/src/main/scala/la/aquare/sample/Main.scala | Scala | bsd-3-clause | 125 |
package org.scalawiki.wikitext
import org.scalawiki.dto.markup.{SwTemplate, Template}
import org.sweble.wikitext.engine.config.WikiConfig
import org.sweble.wikitext.engine.utils.DefaultConfigEnWp
import org.sweble.wikitext.parser.nodes.WtTemplate
import scala.collection.mutable
object TemplateParser extends SweblePa... | intracer/scalawiki | scalawiki-core/src/main/scala/org/scalawiki/wikitext/TemplateParser.scala | Scala | apache-2.0 | 984 |
package isuda
import com.typesafe.config.ConfigFactory
import java.security.{MessageDigest, SecureRandom}
import java.util.regex.Pattern
import org.joda.time.LocalDateTime
import scala.util.{Random, Try}
import scala.util.control.Exception.catching
import scalikejdbc.{DB, WrappedResultSet}
import scalikejdbc.config.DB... | dekokun/isucon6-qualify | webapp/scala/isuda/src/main/scala/isuda/Web.scala | Scala | mit | 10,769 |
package models.consumer
class ConsumerGroup {
} | alanlavintman/kafka-admin | app/models/consumer/ConsumerGroup.scala | Scala | mit | 49 |
package de.metacoder.edwardthreadlocal.analysis
import scala.language.postfixOps
import de.metacoder.edwardthreadlocal.analysis.datamodel.CallData
import scala.language.postfixOps
object CallDataProcessor {
def addToCurrentSeries(cd:CallData)(implicit setup:AnalysisSetup):Unit =
currentSeriesOpt filter (_ rec... | metacoder/edward-tl | agent-impl/src/main/scala/de/metacoder/edwardthreadlocal/analysis/CallDataProcessor.scala | Scala | apache-2.0 | 2,491 |
package me.aihe.dataframe.types
/**
* Created by aihe on 11/25/15.
*/
class IntType extends IntegralType{
}
object IntType extends IntType | AiHe/DataFrame | src/main/scala/me/aihe/dataframe/types/IntType.scala | Scala | apache-2.0 | 143 |
package com.sksamuel.elastic4s
import com.sksamuel.elastic4s.ElasticDsl._
import com.sksamuel.elastic4s.source.Indexable
import org.scalatest.mock.MockitoSugar
import org.scalatest.{Matchers, WordSpec}
import com.sksamuel.elastic4s.testkit.ElasticSugar
/** @author Stephen Samuel */
class IndexTest extends WordSpec wi... | tototoshi/elastic4s | elastic4s-core-tests/src/test/scala/com/sksamuel/elastic4s/IndexTest.scala | Scala | apache-2.0 | 2,222 |
package lambdacart.util.typealigned
import scala.annotation.tailrec
import scalaz.Compose
/**
* `FreeCompose` is a non-empty type-aligned sequence represented
* as a (non-balanced) binary tree, in order to support O(1) addition
* to either side and O(1) concatenation.
*/
sealed abstract class FreeCompose[=>:[_, _... | TomasMikula/LambdaCart | src/main/scala/lambdacart/util/typealigned/FreeCompose.scala | Scala | apache-2.0 | 2,486 |
//package cafesat
//package sat
//
//import asts.core.Trees.Formula
//import asts.core.Manip._
//import asts.fol.Trees._
//import asts.fol.Manip._
//
///* Naive and (surely) correct sat solver. Useful for unit test with simple formulas. */
//object NaiveSolver {
//
// def isSat(cnf: Set[Set[Literal]]): Option[Array[Bo... | regb/cafesat | src/main/scala/cafesat/sat/NaiveSolver.scala | Scala | mit | 1,330 |
object Moo {
def test[F[_]](): Unit = {}
t@test@est[E@either@ither[Thr@throwable@owable, *]]()
}
| non/kind-projector | src/test/resources/moo.scala | Scala | mit | 101 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | aokolnychyi/spark | core/src/main/scala/org/apache/spark/rdd/ReliableCheckpointRDD.scala | Scala | apache-2.0 | 11,842 |
package com.sksamuel.elastic4s.mappings
import com.sksamuel.elastic4s.{IndexesAndType, Executable, IndexesAndTypes, ProxyClients}
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse
import org.elasticsearch.action.admin.indices.mapping.put.{PutMappingAction, PutMappingRequest, PutMappingReque... | muuki88/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/mappings/MappingDsl.scala | Scala | apache-2.0 | 2,951 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package top
import _root_.org.jetbrains.plugins.scala.lang.parser.parsing.params.TypeParamClause
import com.intellij.lang.PsiBuilder
import lexer.ScalaTokenTypes
import builder.ScalaPsiBuilder
/**
* @author Alexander Podkhalyuzin
* Date: ... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/top/TraitDef.scala | Scala | apache-2.0 | 964 |
/***********************************************************************
* Copyright (c) 2013-2016 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 ... | MutahirKazmi/geomesa | geomesa-features/geomesa-feature-avro/src/main/scala/org/locationtech/geomesa/features/avro/AvroDataFileReader.scala | Scala | apache-2.0 | 1,447 |
package org.tianlangstudio.data.hamal.server.http
import akka.actor.ActorSystem
import org.tianlangstudio.data.hamal.common.Logging
import org.tianlangstudio.data.hamal.core.{Constants, HamalConf}
import org.tianlangstudio.data.hamal.core.handler.{ITaskHandler, LocalServerHandler}
import org.tianlangstudio.data.hamal.... | TianLangStudio/DataXServer | httpserver/src/main/scala/org/tianlangstudio/data/hamal/server/http/HttpServerApp.scala | Scala | apache-2.0 | 961 |
package mark_marker
import java.io.File
import edu.stanford.nlp.classify.{Classifier, ColumnDataClassifier}
import json_parser.{MicroServiceInputParser, MicroServiceOutputParser}
import mark_marker.trainer.{DatabaseConnector, Trainer}
import scala.collection.JavaConverters._
import scala.collection.mutable.ArrayBuff... | ke00n/alabno | backend/mark_marker/src/main/scala/mark_marker/App.scala | Scala | mit | 1,722 |
/*
* 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/utils/tf/loaders/Max.scala | Scala | apache-2.0 | 1,670 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | bwsw/sj-platform | core/sj-crud-rest/src/test/scala-2.12/com/bwsw/sj/crud/rest/instance/destroyer/InstanceDestroyerMock.scala | Scala | apache-2.0 | 1,819 |
package com.lucidchart.piezo
import com.lucidchart.piezo.TriggerMonitoringPriority.TriggerMonitoringPriority
import java.util.{Date, Properties}
import org.quartz.{Trigger, TriggerKey}
import org.slf4j.LoggerFactory
object TriggerMonitoringPriority extends Enumeration {
type TriggerMonitoringPriority = Value
val ... | lucidsoftware/piezo | worker/src/main/scala/com/lucidchart/piezo/TriggerMonitoringModel.scala | Scala | apache-2.0 | 3,956 |
/*
* Copyright 2017-2022 John Snow Labs
*
* 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... | JohnSnowLabs/spark-nlp | src/main/scala/com/johnsnowlabs/nlp/annotators/spell/context/ContextSpellCheckerApproach.scala | Scala | apache-2.0 | 25,438 |
/*
* Copyright 2017 PayPal
*
* 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... | Harikiranvuyyuru/squbs | squbs-unicomplex/src/test/scala/org/squbs/unicomplex/UnicomplexBootSpec.scala | Scala | apache-2.0 | 9,592 |
package knot.core.dispatch
import java.util
import java.util.concurrent.{Callable, Future, TimeUnit}
import scala.concurrent.ExecutionContextExecutorService
object SameThreadDispatcher {
def apply(): Dispatcher = {
implicit val ec: ExecutionContextExecutorService = new SameThreadExecutionContextExecutorService... | defvar/knot | knot-core/src/main/scala/knot/core/dispatch/SameThreadDispatcher.scala | Scala | mit | 1,841 |
/*-------------------------------------------------------------------------*\\
** ScalaCheck **
** Copyright (c) 2007-2014 Rickard Nilsson. All rights reserved. **
** http://www.scalacheck.org **
** ... | jedws/scalacheck | src/main/scala/org/scalacheck/Properties.scala | Scala | bsd-3-clause | 3,289 |
package hercules.api
import akka.actor.ActorSystem
import akka.util.Timeout
import com.typesafe.config.ConfigFactory
import scala.concurrent.duration.Duration
/**
* Core is type containing the ``system: ActorSystem`` and ``timeout: Timeout`` members.
* This enables us to use it in our apps as well as in our tests.... | johandahlberg/hercules | src/main/scala/hercules/api/Core.scala | Scala | mit | 1,033 |
/*
* BullsEye.scala
* (Configuration)
*
* Copyright (c) 2015 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.configuration.video
imp... | Sciss/Configuration | video/src/main/scala/de/sciss/configuration/video/BullsEye.scala | Scala | gpl-3.0 | 3,747 |
package teststate.domzipper.selenium
import cats.instances.option._
import cats.instances.set._
import cats.instances.string._
import cats.instances.vector._
import japgolly.microlibs.testutil.TestUtil._
import java.util.concurrent.TimeUnit
import org.openqa.selenium.chrome.{ChromeDriver, ChromeOptions}
import teststa... | japgolly/test-state | dom-zipper-selenium/src/test/scala/teststate/domzipper/selenium/DomZipperSeleniumTest.scala | Scala | apache-2.0 | 3,628 |
package skinny.micro.routing
import javax.servlet.http.HttpServletRequest
import skinny.micro._
import skinny.micro.constant._
import skinny.micro.context.SkinnyContext
/**
* The core SkinnyMicro DSL.
*/
trait RoutingDsl extends RoutingDslBase {
/**
* The SkinnyMicro DSL core methods take a list of [[skinny.... | xerial/skinny-micro | micro/src/main/scala/skinny/micro/routing/RoutingDsl.scala | Scala | bsd-2-clause | 3,779 |
/*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distri... | flaminem/flamy | src/main/scala/com/flaminem/flamy/exec/utils/SkipAction.scala | Scala | apache-2.0 | 1,040 |
package com.twitter.zk
import java.net.InetSocketAddress
import scala.collection.JavaConverters._
import scala.collection.{Map, Set}
import com.google.common.collect.ImmutableSet
import com.twitter.common.net.pool.DynamicHostSet.HostChangeMonitor
import com.twitter.common.zookeeper.{ServerSetImpl, ZooKeeperClient, ... | travisbrown/util | util-zk-common/src/main/scala/com/twitter/zk/ServerSet.scala | Scala | apache-2.0 | 2,892 |
package org.scalajs.jsenv.test
import org.junit.Test
import org.junit.Assert._
/** Tests that should succeed on any JSEnv */
trait BasicJSEnvTests extends JSEnvTest {
@Test
def failureTest: Unit = {
"""
var a = {};
a.foo();
""".fails()
}
@Test
def syntaxErrorTest: Unit = {
"""
{... | lrytz/scala-js | js-envs-test-kit/src/main/scala/org/scalajs/jsenv/test/BasicJSEnvTests.scala | Scala | bsd-3-clause | 613 |
/*
*
* o o o o o
* | o | |\\ /| | /
* | o-o o--o o-o oo | | O | oo o-o OO o-o o o
* | | | | | | | | | | | | | | | | \\ | | \\ /
* O---oo-o o--O | o-o o-o-o o o o-o-o o o o-o o
* |
... | anskarl/LoMRF | src/test/scala/lomrf/mln/learning/supervision/metric/StructureMetricSpecTest.scala | Scala | apache-2.0 | 12,025 |
package com.sksamuel.elastic4s.requests.searches.aggs.builders
import com.sksamuel.elastic4s.handlers
import com.sksamuel.elastic4s.handlers.script.ScriptBuilderFn
import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory}
import com.sksamuel.elastic4s.requests.searches.aggs.ValueCountAggregation
object Va... | sksamuel/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/aggs/builders/ValueCountAggregationBuilder.scala | Scala | apache-2.0 | 695 |
/*
* (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-nn | src/main/scala/toolkit/neuralnetwork/policy/StandardLearningRule.scala | Scala | apache-2.0 | 1,418 |
package scalaz.stream
import collection.immutable.Vector
import java.nio.charset.Charset
import scalaz.{\\/, -\\/, \\/-, Monoid, Semigroup, Equal}
import scalaz.\\/._
import scalaz.syntax.equal._
import Process._
import scalaz.stream.processes._
import scalaz.stream.Process.Emit
import scala.Some
import scalaz.strea... | aindlq/scalaz-stream | src/main/scala/scalaz/stream/process1.scala | Scala | mit | 15,244 |
package ch.epfl.yinyang
package transformers
import ch.epfl.yinyang._
import ch.epfl.yinyang.analysis._
import scala.reflect.macros.blackbox.Context
import language.experimental.macros
import scala.collection.mutable
/**
* Converts Scala features that can not be overridden to method calls that can be given
* arbitr... | scala-yinyang/scala-yinyang | components/core/src/transformers/LanguageVirtualization.scala | Scala | bsd-3-clause | 12,381 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | aokolnychyi/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelation.scala | Scala | apache-2.0 | 3,646 |
/*
* Copyright (c) 2013-2014 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.a... | jramos/snowplow | 2-collectors/scala-stream-collector/src/main/scala/com.snowplowanalytics.snowplow.collectors/scalastream/ResponseHandler.scala | Scala | apache-2.0 | 9,102 |
import sbt._
import Keys._
object ModulaBuild extends Build {
lazy val root = Project(id = "modula",
base = file(".")) settings (ScctPlugin.mergeReportSettings: _*) aggregate(api, impl, factory, osgi, main)
lazy val api = Project(id = "modula-api",
base =... | davemssavage/modula | project/Build.scala | Scala | apache-2.0 | 1,206 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | underscorenico/squants | shared/src/main/scala/squants/mass/Density.scala | Scala | apache-2.0 | 1,919 |
object A
{
def x = 3
//def x: String = 3
//def x: String = "3"
} | jamesward/xsbt | sbt/src/sbt-test/source-dependencies/intermediate-error/A.scala | Scala | bsd-3-clause | 67 |
package net.rfc1149.harassme
object Compatibility {
// Call Android facilities in a backward compatible way
def dataChanged() =
try {
val cl = Class.forName("android.app.backup.BackupManager")
val m = cl.getDeclaredMethod("dataChanged", classOf[String])
m.invoke(null, Prefs.appli)
} cat... | samueltardieu/harassme | src/main/scala/net/rfc1149/harassme/Compatibility.scala | Scala | gpl-3.0 | 426 |
package com.sksamuel.elastic4s.searches.queries.funcscorer
import com.sksamuel.elastic4s.ScriptBuilder
import org.elasticsearch.index.query.functionscore.{ScoreFunctionBuilders, ScriptScoreFunctionBuilder}
object ScriptScoreBuilderFn {
def apply(d: ScriptScoreDefinition): ScriptScoreFunctionBuilder = {
val buil... | tyth/elastic4s | elastic4s-tcp/src/main/scala/com/sksamuel/elastic4s/searches/queries/funcscorer/ScriptScoreBuilderFn.scala | Scala | apache-2.0 | 461 |
// src/main/scala/progscala2/typelessdomore/package-example1.scala
package com.example.mypkg
class MyClass {
// ...
}
| sunilrebel/programming-scala | examples/src/main/scala/progscala2/typelessdomore/package-example1.scala | Scala | mpl-2.0 | 121 |
package slick.jdbc
import com.typesafe.config.Config
import scala.concurrent.ExecutionContext
import slick.SlickException
import slick.ast._
import slick.ast.Util._
import slick.ast.TypeUtil._
import slick.basic.Capability
import slick.compiler.{Phase, ResolveZipJoins, CompilerState}
import slick.jdbc.meta.{MPrimary... | AtkinsChang/slick | slick/src/main/scala/slick/jdbc/MySQLProfile.scala | Scala | bsd-2-clause | 14,557 |
package models
import util.{ OrganizationConfigurationResourceHolder, OrganizationConfigurationHandler }
import com.novus.salat.dao.SalatDAO
import com.novus.salat
import models.HubMongoContext._
import com.mongodb.casbah.Imports._
import play.api.Logger
import reflect.ClassTag
/**
* Multi-tenancy capable model. Imp... | delving/culture-hub | web-core/app/models/MultiModel.scala | Scala | apache-2.0 | 2,212 |
/*
* Copyright 2011-2018 Chris de Vreeze
*
* 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 agree... | dvreeze/nta | src/main/scala/eu/cdevreeze/nta/ntarule/rules_2_02/Validator_2_02_00_22.scala | Scala | apache-2.0 | 2,785 |
package main
abstract class A {
def foo(s: String): Unit //= {}
}
| stephenh/scala-ide | org.scala-ide.sdt.core.tests/test-workspace/javaDependsOnScala/src/main/A.scala | Scala | bsd-3-clause | 69 |
object Foo {
def isGood(x: Int): Boolean = { x % 2 == 0 }
}
object ArrayUtils {
def filter(xs: Array[Int], strat: IntFilterStrategy): Array[Int] = ???
}
// let's do it the Java7 way
trait IntFilterStrategy {
def isGood(x: Int): Boolean
}
| agconti/scala-school | 04-functions-as-values/slides/slide009.scala | Scala | mit | 251 |
/*
* CheckBoxSelectedExpandedPlatform.scala
* (LucreSwing)
*
* Copyright (c) 2014-2021 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/LucreSwing | jvm/src/main/scala/de/sciss/lucre/swing/graph/impl/CheckBoxSelectedExpandedPlatform.scala | Scala | agpl-3.0 | 982 |
package spray.contrib
import akka.actor.ActorRef
import akka.event.LoggingAdapter
import akka.pattern.ask
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import scala.concurrent.duration._
import scala.util.Failure
impor... | wandoulabs/spray-socketio | spray-socketio/src/main/scala/spray/contrib/socketio/package.scala | Scala | apache-2.0 | 7,712 |
/*
* 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 | tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala | Scala | apache-2.0 | 68,293 |
package evaluation
import breeze.linalg.DenseVector
import org.scalatest.FunSuite
import pipelines.LocalSparkContext
import org.apache.spark.SparkContext
import utils.Stats
class MeanAveragePrecisionSuite extends FunSuite with LocalSparkContext {
test("random map test") {
sc = new SparkContext("local", "test"... | shivaram/keystone | src/test/scala/evaluation/MeanAveragePrecisionSuite.scala | Scala | apache-2.0 | 984 |
/*
* The MIT License
*
* Copyright (c) 2016 Fulcrum Genomics LLC
*
* 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 us... | fulcrumgenomics/dagr | tasks/src/main/scala/dagr/tasks/fgbio/ExtractUmisFromBam.scala | Scala | mit | 2,252 |
package breeze.linalg
import org.netlib.blas.Ddot
import org.scalacheck._
import org.scalatest._
import org.scalatest.junit._
import org.scalatest.prop._
import org.junit.runner.RunWith
import breeze.math._
import breeze.stats.mean
import java.util
/**
*
* @author dlwh
*/
@RunWith(classOf[JUnitRunner])
class Dense... | jaredk-porch/breeze | math/src/test/scala/breeze/linalg/DenseVectorTest.scala | Scala | apache-2.0 | 17,644 |
package com.haskforce.codeInsight
import com.haskforce.constants.GhcFlags
import com.intellij.psi.PsiFile
object CompilerFlagsProviderFactory {
def get(psiFile: PsiFile): Option[CompilerFlagsProvider] = {
cached
}
private val cached = Some(GhcCompilerFlagsProvider)
}
trait CompilerFlagsProvider {
def ge... | carymrobbins/intellij-haskforce | src/com/haskforce/codeInsight/CompilerFlagsProviderFactory.scala | Scala | apache-2.0 | 466 |
/*
* Copyright 2018 Analytics Zoo Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... | intel-analytics/analytics-zoo | zoo/src/test/scala/com/intel/analytics/zoo/pipeline/api/keras/layers/BatchNormalizationSpec.scala | Scala | apache-2.0 | 2,962 |
/*
* Copyright (c) 2014-2020 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... | alexandru/monifu | monix-reactive/shared/src/main/scala/monix/reactive/internal/operators/UncancelableObservable.scala | Scala | apache-2.0 | 1,453 |
package wop.server
import korolev.Effects
import wop.game.WopState
import wop.server.actors.PlayerActor
import scala.concurrent.Future
import korolev.blazeServer.defaultExecutor
sealed trait UserState
object UserState {
val effects = Effects[Future, UserState, PlayerActor.Command]
case class EnterNickName(loa... | ognick/wizards-of-portal | server/src/main/scala/wop/server/UserState.scala | Scala | gpl-3.0 | 746 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.testsuite.javalib.util
im... | SebsLittleHelpers/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/NavigableSetTest.scala | Scala | apache-2.0 | 4,021 |
/*
* 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/wvlet | wvlet-core/src/main/scala/wvlet/workflow/macros/CodeRef.scala | Scala | apache-2.0 | 2,533 |
package one.lockstep.util.crypto
import one.lockstep.util._
import scodec.bits._
class Hkdf(hmac: Hmac,
defaultDerivedSecretKeyLength: Int) extends Cryptosystem {
override lazy val bitStrength: Int = hmac.bitStrength
override lazy val keyLength: Int = hmac.keyLength
def saltLength: Int = hmac.blockLe... | lockstep-one/vault | vault-common/src/main/scala/one/lockstep/util/crypto/Hkdf.scala | Scala | agpl-3.0 | 1,616 |
package scalaj
package collection
package s2j
import java.{lang => jl, util => ju}
import scala.{collection => sc, math => sm}
import scala.collection.{immutable => sci, mutable => scm}
object Implicits extends Implicits
trait Implicits {
implicit def RichSOrdered[A](underlying: sm.Ordered[A]): RichOrdered[A] = ne... | scalaj/scalaj-collection | src/main/scala/scalaj/collection/s2j/Implicits.scala | Scala | apache-2.0 | 2,758 |
package spatial.analysis
import argon.core._
import spatial.aliases._
import spatial.metadata._
import spatial.utils._
// This is separated out for now because I don't know if it fully works or not
trait AffineMemoryAnalysis { this: MemoryAnalyzer =>
/*def mergeMismatchedBanking(mem: Exp[_], a: Banking, b: Banking... | stanford-ppl/spatial-lang | spatial/core/src/spatial/analysis/AffineMemoryAnalysis.scala | Scala | mit | 3,430 |
import org.scalatest.FlatSpec
class SetSpec extends FlatSpec {
"A Poisson(10.0)" should "have mean 10.0" in {
import breeze.stats.distributions.Poisson
val p = Poisson(10.0)
val m = p.mean
assert(math.abs(m - 10.0) < 0.000001)
}
}
| darrenjw/scala-course | examples/C7-Vegas/src/test/scala/C7-Vegas-test.scala | Scala | gpl-3.0 | 254 |
package io.getquill.quotation
import scala.annotation.StaticAnnotation
import scala.reflect.ClassTag
import scala.reflect.macros.whitebox.Context
import io.getquill.ast._
import io.getquill.util.Messages.RichContext
import io.getquill.norm.BetaReduction
case class QuotedAst(ast: Ast) extends StaticAnnotation
trait ... | jcranky/quill | quill-core/src/main/scala/io/getquill/quotation/Quotation.scala | Scala | apache-2.0 | 1,840 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package expr
import com.intellij.lang.ASTNode
import com.intellij.psi._
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElementVisitor
import org.jetbrains.plugins.scala.lang.psi.api.base.ScMethodLik... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScSelfInvocationImpl.scala | Scala | apache-2.0 | 4,180 |
package org.jetbrains.plugins.scala
package lang
package scaladoc
package psi
package api
import _root_.org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement
import com.intellij.psi.javadoc.PsiDocTag
/**
* User: Alexander Podkhalyuzin
* Date: 22.07.2008
*/
trait ScDocTag extends ScalaPsiElement with PsiDocTag {
} | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/scaladoc/psi/api/ScDocTag.scala | Scala | apache-2.0 | 320 |
/*
* Copyright (c) 2013 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.org... | snowplow/spark-example-project | project/Dependencies.scala | Scala | apache-2.0 | 1,729 |
package xyz.nabijaczleweli.scala_game_of_life.util
import scala.collection.mutable
import scala.util.Random
/** @author Jędrzej
* @since 06.05.14
*/
class RandomSeq[stored] extends Seq[stored] {self =>
private final val rand = new Random
private final var storedSeq = Vector[stored]()
override def length... | nabijaczleweli/Scala-Game-of-Life | src/main/scala/xyz/nabijaczleweli/scala_game_of_life/util/RandomSeq.scala | Scala | mit | 1,111 |
/*
* Copyright 2015 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... | scottcutts/crypto | src/test/scala/uk/gov/hmrc/crypto/OneWayCryptoFromConfigSpec.scala | Scala | apache-2.0 | 2,152 |
package ir.ast
import ir.ArrayTypeWSWC
import lift.arithmetic.SizeVar
import opencl.ir._
import org.junit.Assert._
import org.junit.Test
class TestPartialReduce {
@Test
def testUnapply0(): Unit = {
val lambda = fun((x,y) => add(x, y))
val f = fun(
ArrayTypeWSWC(Float, SizeVar("N")),
input =... | lift-project/lift | src/test/ir/ast/TestPartialReduce.scala | Scala | mit | 827 |
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.