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 |
|---|---|---|---|---|---|
/******************************************************************************************************************\\
* Rapture JSON, version 2.0.0. Copyright 2010-2015 Jon Pretty, Propensive Ltd. *
* ... | joescii/rapture-json | src/formatters.scala | Scala | apache-2.0 | 3,879 |
/*
* 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 ... | pronix/spark | sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala | Scala | apache-2.0 | 9,601 |
import compiletime.*
import compiletime.ops.int.*
object Test extends App {
inline def toInt[N]: Int =
inline constValue[N] match {
case _: S[n1] => 1 + toInt[n1]
case 0 => 0
}
println(toInt[0])
println(toInt[1])
println(toInt[2])
locally {
inline def toInt[N]: Int =
inline ... | dotty-staging/dotty | tests/run/typelevel-peano.scala | Scala | apache-2.0 | 863 |
/**
* Copyright 2010-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 agr... | jedesah/scalatest-website | app/examples/FunSuiteExamples.scala | Scala | apache-2.0 | 12,501 |
/*
* Copyright 2015 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 agreed to in ... | tutufool/squbs | squbs-unicomplex/src/test/scala/org/squbs/unicomplex/UnicomplexTimeoutSpec.scala | Scala | apache-2.0 | 2,937 |
package edu.gemini.phase2.template.factory.impl.phoenix
import edu.gemini.spModel.gemini.phoenix.PhoenixParams
sealed trait PhoenixFilterGroup
object PhoenixFilterGroup {
case object JHK extends PhoenixFilterGroup
case object L extends PhoenixFilterGroup
case object M extends PhoenixFilterGroup
def for... | arturog8m/ocs | bundle/edu.gemini.phase2.skeleton.servlet/src/main/scala/edu/gemini/phase2/template/factory/impl/phoenix/PhoenixFilterGroup.scala | Scala | bsd-3-clause | 793 |
package com.github.opengrabeso.mixtio
package frontend
package views.settings_base
import java.time.ZonedDateTime
import io.udash.properties.model.ModelProperty
import org.scalajs.dom
trait SettingsPresenter {
def init(
model: ModelProperty[SettingsModel], userContextService: services.UserContextService
): U... | OndrejSpanel/Stravamat | frontend/src/main/scala/com/github/opengrabeso/mixtio/frontend/views/settings_base/SettingsPresenter.scala | Scala | gpl-2.0 | 964 |
package streams
import common._
/**
* This trait represents the layout and building blocks of the game
*
* @TODO: SHOULD RENAME `x` and `y` in class Pos to `row` and `col`. It's
* confusing to have `x` being the vertical axis.
*/
trait GameDef {
/**
* The case class `Pos` encodes positions in the terrain... | gvamos/MilanOpera | streams/src/main/scala/streams/GameDef.scala | Scala | gpl-2.0 | 4,822 |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package scaps.sbtPlugin
import sbt.{ url => sbtUrl, _ }
import sbt.Keys._
import sbt.APIMappings
import scaps.bui... | scala-search/scaps | sbtPlugin/src/main/scala/scaps/sbtPlugin/ApiSearchPlugin.scala | Scala | mpl-2.0 | 3,272 |
package chandu0101.scalajs.react.components
package elementalui
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import japgolly.scalajs.react.raw.React
import japgolly.scalajs.react.vdom.VdomNode
import scala.scalajs.js
case class Dropdown(alignRight: js.UndefOr[Boolean] = js.undefined,
... | rleibman/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/elementalui/Dropdown.scala | Scala | apache-2.0 | 1,866 |
package fyrie
import net.fyrie.redis._
import akka.actor.{ ActorSystem, Actor, Props, ActorRef }
import akka.bita.{ RandomScheduleHelper, Scheduler }
import akka.bita.pattern.Patterns._
import akka.util.duration._
import akka.util.Timeout
import akka.dispatch.Await
import bita.util.{ FileHelper, TestHelper }
import... | Tjoene/thesis | benchmark/src/test/scala/fyrie/InsertSpec.scala | Scala | gpl-2.0 | 1,856 |
import org.apache.spark.sql.SQLContext
:load /home/ealmansi/dev/yavi/spark/jobs/utility.scala
def runJob(workDirectory: String, sqlContext: SQLContext): Unit = {
loadTable("page_similarity", workDirectory, sqlContext)
saveTableCsv("page_similarity", workDirectory, sqlContext)
}
| ealmansi/yavi | spark/jobs/export_page_similarity.scala | Scala | mit | 288 |
package com.datastax.spark.connector.util
import scala.annotation.tailrec
/**
* A HashMap and a PriorityQueue hybrid.
* Works like a HashMap but offers additional O(1) access to the entry with
* the highest value. As in a standard HashMap, entries can be looked up by
* key in O(1) time. Adding, removing and updat... | Stratio/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/util/PriorityHashMap.scala | Scala | apache-2.0 | 14,306 |
// https://leetcode.com/problems/find-the-duplicate-number
object Solution {
def findDuplicate(numbers: Array[Int]): Int = {
def next = numbers
def race(x: Int, y: Int): Int =
if (x == y) next(x) else race(next(x), next(next(y)))
def walk(x: Int, y: Int): Int =
if (x == y) x else walk(next(x... | airtial/Codegames | leetcode/287-find-the-duplicate-number.scala | Scala | gpl-2.0 | 440 |
object Test extends App {
trait SpecialException extends Throwable {}
try {
throw new Exception
} catch {
case e : SpecialException => {
println("matched SpecialException: " + e)
assume(e.isInstanceOf[SpecialException])
}
case e : Exception => {
assume(e.isInstanceOf[Exception]... | lampepfl/dotty | tests/pos/t1168.scala | Scala | apache-2.0 | 334 |
package com.github.ligangty.scala.jsoup.nodes
import com.github.ligangty.scala.jsoup.helper.Strings
import TextNode._
import com.github.ligangty.scala.jsoup.helper.Validator._
/**
* A text node.
*/
class TextNode extends Node {
private[nodes] var textVal: String = null
/**
* Create a new TextNode represent... | ligangty/scalajsoup | src/main/scala/com/github/ligangty/scala/jsoup/nodes/TextNode.scala | Scala | mit | 5,605 |
package com.gilt.thehand
import com.gilt.thehand.rules._
import com.gilt.thehand.rules.logical.{Or, Not, And}
import com.gilt.thehand.rules.typed.{StringIn, LongIn}
/**
* A place to drop general tests that cross class lines.
*/
class RuleParserSpec extends AbstractRuleSpec {
val testCases = Map(
And(Or(Strin... | gilt/the-hand | src/test/scala/com/gilt/thehand/RuleParserSpec.scala | Scala | apache-2.0 | 812 |
/*
* Copyright 2015 Roberto Tyley
*
* 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... | rtyley/play-git-hub | src/main/scala/com/madgag/playgithub/auth/Actions.scala | Scala | gpl-3.0 | 2,142 |
import sbt._
import Keys._
import scala.util.{Failure, Success}
object FMPP {
def preprocessorSettings = inConfig(Compile)(Seq(sourceGenerators += fmpp.taskValue, fmpp := fmppTask.value)) ++ Seq(
libraryDependencies ++= Seq(
("net.sourceforge.fmpp" % "fmpp" % "0.9.16" % FmppConfig.name).intransitive,
... | slick/slick | project/FMPP.scala | Scala | bsd-2-clause | 2,218 |
package models
import com.datastax.spark.connector.mapper.JavaBeanColumnMapper
/**
* Created by cenk on 25/02/15.
*/
object Metrics {
implicit object Mapper extends JavaBeanColumnMapper[Metric]
} | cenkbircanoglu/sparkScala | src/main/scala/models/Metrics.scala | Scala | mit | 203 |
package com.stackmob.customcode.dev
package test
package server
package sdk
package data
package dataservice
import org.specs2.Specification
import org.specs2.mock.Mockito
trait CountObjects extends BaseTestGroup { this: Specification with Mockito with CustomMatchers =>
case class CountObjects() extends BaseTestCo... | matthewfarwell/stackmob-customcode-dev | src/test/scala/com/stackmob/customcode/dev/test/server/sdk/data/dataservice/CountObjects.scala | Scala | apache-2.0 | 1,068 |
package lib
import cats.data.NonEmptyChain
import cats.data.Validated.Invalid
import helpers.BasePlaySpec
import scala.io.Source
class ServerParserSpec extends BasePlaySpec {
def configParser: ConfigParser = app.injector.instanceOf[ConfigParser]
val uri = "file:///test"
val source = ProxyConfigSource(
u... | flowvault/proxy | test/lib/ServerParserSpec.scala | Scala | mit | 4,978 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | witgo/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/ContinuousSuite.scala | Scala | apache-2.0 | 14,180 |
package com.eevolution.context.dictionary.domain.api.repository
import com.eevolution.context.dictionary._
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Publi... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/repository/ViewAttributeRepository.scala | Scala | gpl-3.0 | 1,143 |
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
object Test extends dotty.runtime.LegacyApp {
val tb = cm.mkToolBox()
val idsym = tb.typecheck(q"type Id[X] = X").symbol.asType
val idTC1 = idsym.info
println(idTC1)
println(appliedTy... | yusuke2255/dotty | tests/pending/run/reflection-idtc.scala | Scala | bsd-3-clause | 529 |
package org.bitcoins.commons.serializers
import org.bitcoins.commons.jsonmodels.bitcoind.GetBlockHeaderResult
import org.bitcoins.commons.jsonmodels.bitcoind.RpcOpts.LockUnspentOutputParameter
import org.bitcoins.commons.serializers.JsonReaders.jsToSatoshis
import org.bitcoins.core.api.dlc.wallet.db.IncomingDLCOfferDb... | bitcoin-s/bitcoin-s | app-commons/src/main/scala/org/bitcoins/commons/serializers/Picklers.scala | Scala | mit | 55,369 |
package filodb.core.reprojector
import filodb.core.Types._
/**
* FlushPolicy's check for new flush cycle opportunities by looking at the active memtables and using
* some heuristics to determine what datasets to flush next. Flush means to flipBuffers() and cause
* the Active table to be swapped into Locked state.... | YanjieGao/FiloDB | core/src/main/scala/filodb.core/reprojector/FlushPolicy.scala | Scala | apache-2.0 | 1,827 |
package net.selenate.server
import com.typesafe.config.ConfigFactory
import com.typesafe.config.{ Config, ConfigValueFactory }
import scala.collection.JavaConversions._
import settings.PoolSettings
object C extends CUtils {
val CONFIG = ConfigFactory.empty()
.withFallback(loadAppUser)
.withFallback(load... | tferega/selenate | code/Server/src/main/scala/net/selenate/server/C.scala | Scala | bsd-3-clause | 1,577 |
/*
* Copyright 2013 - 2017 Outworkers 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 or... | websudos/util | util-samplers/src/test/scala/org/outworkers/domain/test/domain.scala | Scala | bsd-2-clause | 2,777 |
/*
* Copyright 2017 Datamountaineer.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | datamountaineer/stream-reactor | kafka-connect-hbase/src/main/scala/com/datamountaineer/streamreactor/connect/hbase/config/HBaseConfigConstants.scala | Scala | apache-2.0 | 2,656 |
package com.twitter.server.handler
import com.twitter.finagle.Service
import com.twitter.io.Buf
import com.twitter.server.util.HttpUtils._
import com.twitter.server.util.JsonConverter
import com.twitter.server.view.ThreadsView
import com.twitter.util.Future
import java.lang.management.ManagementFactory
import scala.co... | travisbrown/twitter-server | src/main/scala/com/twitter/server/handler/ThreadsHandler.scala | Scala | apache-2.0 | 3,319 |
package de.mineformers.core.client.renderer.shape
import de.mineformers.core.client.renderer.RenderParams
/**
* Sphere
*
* @author PaleoCrafter
*/
class Sphere(radius: Double, accuracy: Int, filled: Boolean = true) extends Shape(List(new Circle(radius, accuracy, filled)), RenderParams.start().face().build())
| MineFormers/MFCore | src/main/scala/de/mineformers/core/client/renderer/shape/Sphere.scala | Scala | mit | 316 |
package demo
import org.scalajs.dom._
/*
* Copyright (C) 24/08/16 // mathieu.leclaire@openmole.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License... | openmole/scaladget | bootstrapDemo/src/main/scala/demo/ToastDemo.scala | Scala | agpl-3.0 | 1,903 |
package taczombie.model
import taczombie.model.util.Logger
trait GameObject extends Logger {
val id : Int
val coords : (Int, Int)
override def hashCode(): Int = id
}
trait StaticGameObject extends GameObject
trait VersatileGameObject extends GameObject {
/// Calculate and return a leftover pair for (ho... | mahieke/TacZombie | model/src/main/scala/taczombie/model/GameObject.scala | Scala | gpl-2.0 | 5,536 |
/*
* (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/cogx/compiler/codegenerator/opencl/hyperkernels/discretecosinetransform/DCTPlanner.scala | Scala | apache-2.0 | 27,429 |
package io.finch
import cats.Eval
import com.twitter.finagle.OAuth2
import com.twitter.finagle.http.Status
import com.twitter.finagle.oauth2.{AuthInfo, DataHandler, GrantHandlerResult, OAuthError}
package object oauth2 {
private[this] val handleOAuthError: PartialFunction[Throwable, Output[Nothing]] = {
case e... | travisbrown/finch | oauth2/src/main/scala/io/finch/oauth2/package.scala | Scala | apache-2.0 | 1,423 |
package org.jetbrains.plugins.scala.lang.psi.implicits
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.autoImport.GlobalExtensionMethod
import org.jetbrains.pl... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/implicits/ExtensionMethodData.scala | Scala | apache-2.0 | 5,806 |
package app.components.semanticui
import japgolly.scalajs.react
import japgolly.scalajs.react.Children
import japgolly.scalajs.react.vdom.VdomNode
import scala.scalajs.js
object Container {
val component = react.JsComponent[js.Object, Children.Varargs, Null](SemanticUiComponents.Container)
def apply()(children:... | Igorocky/lesn | client/src/main/scala/app/components/semanticui/Container.scala | Scala | mit | 419 |
package test.containters
import org.scalatest.Spec
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.mock.MockitoSugar
import org.mockito.Mockito._
import vog.substance.Substance
import vog.substance.containers.{NoLayerException, BaseContainer}
import java.awt.image.ImageObserver
import swing.Graphics2... | ivyl/vog-engine | test/containters/BaseContainerSpec.scala | Scala | mit | 2,732 |
package com.containant.casestudies
/** This example shows how ContainAnt encompasses all of
* the Hoos-Hsu' Programming-by-Optimization examples, by
* solving their DHeap optimization problem.
*/
import com.containant._
import com.containant.heuristics._
import com.containant.casestudies.util._
object CS5DHea... | zaklogician/ContainAnt-devel | src/main/scala/com/containant/casestudies/CS5DHeap.scala | Scala | bsd-3-clause | 3,850 |
/*
* 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... | liquidarmour/http-verbs | src/main/scala/uk/gov/hmrc/play/audit/http/HeaderCarrier.scala | Scala | apache-2.0 | 7,567 |
package com.joshcough.minecraft
/**
* This plugin and this code is not intended for use.
* It is just an empty plugin that is required for turning this library
* into a plugin, so that the API and Ermine can be on the classpath for
* plugins that want to use this API.
*/
class ErmineLibPlugin extends org.bukkit.p... | joshcough/ErMinecraft | ermineLibPlugin/src/main/scala/com/joshcough/minecraft/ErmineLibPlugin.scala | Scala | mit | 420 |
/*
* 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/observers/BufferedSubscriber.scala | Scala | apache-2.0 | 4,559 |
package uk.vitalcode.dateparser.token
import java.text.DateFormatSymbols
import java.time.DayOfWeek
import java.util.Locale
import scala.util.Try
final case class WeekDay(value: DayOfWeek, index: Int = 0) extends DateToken
object WeekDay extends TokenCompanion[WeekDay] {
private val weekdays: Seq[String] = new D... | vitalcode/date-time-range-parser | src/main/scala/uk/vitalcode/dateparser/token/WeekDay.scala | Scala | mit | 1,079 |
object Solution extends App {
def f[A](xs: List[A]) = xs.foldLeft(0)((i,_) => i + 1)
println(f(io.Source.stdin.getLines.toList.map(_.trim).map(_.toInt)))
}
| itsbruce/hackerrank | func/intro/length.scala | Scala | unlicense | 160 |
package com.themillhousegroup.sausagefactory
import org.specs2.mutable.Specification
import java.lang.{ IllegalArgumentException, UnsupportedOperationException }
import scala.Predef._
import com.themillhousegroup.sausagefactory.test.CaseClassSpecification
import com.themillhousegroup.sausagefactory.test.CaseClassFixtu... | themillhousegroup/sausagefactory | src/test/scala/com/themillhousegroup/sausagefactory/ReadIntoFlatCaseClassSpec.scala | Scala | mit | 3,592 |
package scala.c.engine
class StagingAreaPrimitive extends StandardTest {
"bool test" should "print the correct results" in {
val code = """
#include <stdbool.h>
void main() {
bool x = false;
printf("%d\\n", x);
}"""
checkResults(code)
}
}
class RobustPrimitiveTest... | bdwashbu/cEngine | tests/scala/c/engine/PrimitiveTest.scala | Scala | apache-2.0 | 11,363 |
package dpla.ingestion3.mappers.providers
import dpla.ingestion3.mappers.utils.Document
import dpla.ingestion3.messages.{IngestMessage, MessageCollector}
import dpla.ingestion3.model._
import org.scalatest.{BeforeAndAfter, FlatSpec}
import scala.xml.NodeSeq
class P2PMappingTest extends FlatSpec with BeforeAndAfter {... | dpla/ingestion3 | src/test/scala/dpla/ingestion3/mappers/providers/P2PMappingTest.scala | Scala | mit | 13,196 |
/**
* 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... | brunobuzzi/orbeon-forms | src/main/scala/org/orbeon/oxf/processor/pdf/PDFTemplateProcessor.scala | Scala | lgpl-2.1 | 22,644 |
/**
* SparklineData, Inc. -- http://www.sparklinedata.com/
*
* Scala based Audience Behavior APIs
*
* Copyright 2014-2015 SparklineData, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the Lice... | cubefyre/audience-behavior-semantic-etl | etl/src/main/scala/org/sparkline/etl/operators/PerformJoin.scala | Scala | apache-2.0 | 2,610 |
package cook.actor
import cook.actor.TargetStatus
import cook.actor.TaskType
import cook.error.CookException
trait ConsoleOutputter {
def printError(e: CookException)
def printUnknownError(e: Throwable)
def update(targetStatus: TargetStatus, taskInfo: Set[(TaskType.Value, String)])
def stopStatusUpdate
// ... | timgreen/cook | src/cook/actor/ConsoleOutputter.scala | Scala | apache-2.0 | 419 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | Wogan/monix | monix-tail/shared/src/test/scala/monix/tail/IterantMapBatchSuite.scala | Scala | apache-2.0 | 9,362 |
import sbt._
import Keys._
object BuildSettings {
val buildOrganization = "liberty"
val buildVersion = "0.0.1"
val buildScalaVersion = "2.10.4"
val buildSettings = Defaults.defaultSettings ++ Seq (
organization := buildOrganization,
version := buildVersion,
scalaVersion := buildScalaVers... | tmrts/Liberty | project/Build.scala | Scala | mit | 1,198 |
package nl.rabobank.oss.rules.dsl.nl.grammar.meta
import nl.rabobank.oss.rules.derivations.Derivation
import nl.rabobank.oss.rules.dsl.nl.grammar.{DslCondition, GegevenWord, ListBerekenStart, SingularBerekenStart}
import nl.rabobank.oss.rules.facts.{ListFact, SingularFact}
import nl.rabobank.oss.rules.utils.FileSource... | scala-rules/scala-rules | engine/src/main/scala/nl/rabobank/oss/rules/dsl/nl/grammar/meta/DslMacros.scala | Scala | mit | 4,661 |
/**
* The core trait of this library is [[conduit.GenPipe]] which represents a
* single piece of computation. It's implementation is hidden, all operations
* on its instances are performed using methods in [[conduit.Pipe$ conduit.Pipe]] object.
*/
package object conduit {
/**
* A simplified pipe that doesn't c... | ppetr/scala-conduit | src/main/scala/conduit/package.scala | Scala | gpl-3.0 | 1,382 |
package org.jetbrains.plugins.scala.lang.resolve
import com.intellij.psi.PsiReference
import org.junit.Assert._
/**
* Created by katejim on 5/26/16.
*/
class ResolvePackagesWithBacktickeds extends ScalaResolveTestCase {
override def folderPath: String = s"${super.folderPath}resolve/packages/backtickeds"
over... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/resolve/ResolvePackagesWithBacktickeds.scala | Scala | apache-2.0 | 860 |
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt
package internal
package scripted
import java.io.File
import sbt.util.{ Logger, LoggerContext, Level }
import sbt.internal.util.{ Appender, ManagedLogger, Consol... | xuwei-k/xsbt | internal/util-scripted/src/main/scala/sbt/internal/scripted/ScriptedTests.scala | Scala | apache-2.0 | 8,183 |
// See the LICENCE.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.
// You may obtain a copy of the License at
//
// http://www.apache... | scray/scray | scray-hdfs/modules/scray-hdfs-writer/src/main/scala/scray/hdfs/io/write/WriteResult.scala | Scala | apache-2.0 | 927 |
package org.broadinstitute.dsde.vault.datamanagement.model
object Properties {
val CreatedBy = "createdBy"
val CreatedDate = "createdDate"
val ModifiedBy = "modifiedBy"
val ModifiedDate = "modifiedDate"
} | broadinstitute/vault-datamanagement | src/main/scala/org/broadinstitute/dsde/vault/datamanagement/model/Properties.scala | Scala | bsd-3-clause | 213 |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.abondar.scalabasic
import Element.elem;
//case class
sealed abstract class Expr
case class Var(name:String) extends E... | Dr762/ScalaBase | src/main/scala/org/abondar/scalabasic/Expr.scala | Scala | apache-2.0 | 2,141 |
/*
* 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/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/offPayRollWorking/package.scala | Scala | apache-2.0 | 1,310 |
/*
* Copyright 2018 Analytics Zoo Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... | intel-analytics/analytics-zoo | zoo/src/main/scala/com/intel/analytics/zoo/pipeline/api/keras/layers/UpSampling1D.scala | Scala | apache-2.0 | 1,918 |
// Copyright 2014 Commonwealth Bank of Australia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ap... | tresata/scalding | scalding-core/src/main/scala/com/twitter/scalding/typed/PartitionSchemed.scala | Scala | apache-2.0 | 3,469 |
package ca.andrewmcburney.skeleton.files
import org.scalatest._
/**
* Test suite for SkeletonFile.scala
*/
class SkeletonFileSpec extends FlatSpec with Matchers {
"SkeletonFile" should "true should be true" in {
true should be (true)
}
}
| skeleton-cli/skeleton | src/test/scala/ca/andrewmcburney/skeleton/files/SkeletonFileSpec.scala | Scala | apache-2.0 | 254 |
/*
* Copyright 2016 Coral realtime streaming analytics (http://coral-streaming.github.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2... | coral-streaming/coral | src/main/scala/io/coral/actors/transform/SampleActor.scala | Scala | apache-2.0 | 1,671 |
/*
* Copyright University of Basel, Graphics and Vision Research Group
*
* 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 ... | unibas-gravis/scalismo-faces | src/test/scala/scalismo/faces/io/ImageIOTests.scala | Scala | apache-2.0 | 4,866 |
/*
* Copyright 2016 University of Basel, Graphics and Vision Research Group
*
* 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
*
* Unl... | unibas-gravis/scalismo-faces | src/main/scala/scalismo/faces/image/pyramid/LaplacePyramid.scala | Scala | apache-2.0 | 3,189 |
/*
* Removes.scala
*
* Copyright 2017 wayfarerx <x@wayfarerx.net> (@thewayfarerx)
*
* 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
... | wayfarerx/dreamsleeve | shared/data/src/main/scala/net/wayfarerx/dreamsleeve/data/binary_data/Removes.scala | Scala | apache-2.0 | 1,394 |
package org.scalacheck.ops.time.joda
import org.joda.time.DateTime
import org.scalacheck.Arbitrary
import org.scalacheck.ops.time.GenericDateTimeGeneratorsSpec
import scala.reflect.ClassTag
final class JodaDateTimeGeneratorsSpec extends GenericDateTimeGeneratorsSpec(JodaDateTimeGenerators) {
override protected val... | AudaxHealthInc/scalacheck-ops | joda/src/test/scala/org/scalacheck/ops/time/joda/JodaDateTimeGeneratorsSpec.scala | Scala | apache-2.0 | 608 |
package scalariform.formatter
import scalariform.parser._
abstract class AbstractExpressionFormatterTest extends AbstractFormatterTest {
type Result = Expr
def format(formatter: ScalaFormatter, result: Result): FormatResult = formatter.format(result)(FormatterState())
def parse(parser: ScalaParser): Result =... | mdr/scalariform | scalariform/src/test/scala/scalariform/formatter/AbstractExpressionFormatterTest.scala | Scala | mit | 338 |
package wakfutcp.protocol.messages.client
import wakfutcp.protocol.{ClientMessage, Codec}
final case class CharacterDeletionMessage(
characterId: Long
) extends ClientMessage {
override val id = 2051
override val arch = 2
}
object CharacterDeletionMessage {
import Codec._
import cats.syntax.invariant._
... | OpenWakfu/wakfutcp | protocol/src/main/scala/wakfutcp/protocol/messages/client/CharacterDeletionMessage.scala | Scala | mit | 423 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | cemcatik/play-silhouette | project/BuildSettings.scala | Scala | apache-2.0 | 7,633 |
/*
* 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/core/src/test/scala/org/apache/spark/sql/streaming/StreamingJoinSuite.scala | Scala | apache-2.0 | 59,197 |
package io.sqooba.oss.timeseries.zio
import io.sqooba.oss.timeseries.immutable.TSEntry
import zio.stream._
import zio.{Queue, Task, UIO, ZIO}
class AppendableEntryStream[T](
finalizedSink: Queue[Take[Nothing, TSEntry[T]]],
val finalizedEntries: Stream[Nothing, TSEntry[T]],
fitter: ZEntryFitter[T]
) {
d... | Shastick/tslib | src/main/scala/io/sqooba/oss/timeseries/zio/AppendableEntryStream.scala | Scala | mit | 1,791 |
package jp.pigumer.sbt.cloud.aws.autoscaling
import com.amazonaws.services.autoscaling.AmazonAutoScaling
import sbt._
trait AutoScalingKeys {
lazy val awsAutoScaling = taskKey[AmazonAutoScaling]("AWS AutoScaling tasks")
}
| PigumerGroup/sbt-aws-cloudformation | src/main/scala/jp/pigumer/sbt/cloud/aws/autoscaling/AutoScalingKeys.scala | Scala | mit | 228 |
package com.mesosphere.universe.v3.model
import com.mesosphere.cosmos.circe.Decoders._
import com.twitter.util.Return
import com.twitter.util.Throw
import com.twitter.util.Try
import io.circe.syntax.EncoderOps
import io.circe.Decoder
import io.circe.DecodingFailure
import io.circe.Encoder
import io.circe.HCursor
impor... | dcos/cosmos | cosmos-common/src/main/scala/com/mesosphere/universe/v3/model/Tag.scala | Scala | apache-2.0 | 1,382 |
package com.kasonchan.share
import android.os.Bundle
import android.app.Activity
import android.view.Menu
import android.widget.SeekBar
import android.widget.EditText
import android.widget.TextView
import android.widget.TextView._
import android.text.TextWatcher
import android.text.Editable
import android.widget.SeekB... | KasonChan/tips_and_share | src/com/kasonchan/share/MainActivity.scala | Scala | mit | 7,828 |
package cakesolutions.kafka
import cakesolutions.kafka.KafkaTopicPartition.{Partition, Topic}
import org.apache.kafka.clients.producer.ProducerRecord
import org.apache.kafka.common.TopicPartition
/**
* Helper functions for creating Kafka's `ProducerRecord`s.
*
* The producer records hold the data that is to be ... | simonsouter/scala-kafka-client | client/src/main/scala/cakesolutions/kafka/KafkaProducerRecord.scala | Scala | mit | 6,092 |
package com.github.probe.android
import android.app.Service
trait RichService { this: Service =>
def application = getApplication.asInstanceOf[XApplication]
def settings = application.settings
}
| khernyo/freezing-ninja | android/src/main/scala/com/github/probe/android/RichService.scala | Scala | apache-2.0 | 201 |
/*
* Copyright 2014 the original author or 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 applicab... | galderz/mod-lang-scala | src/main/scala/org/vertx/scala/core/http/HttpServerFileUpload.scala | Scala | apache-2.0 | 1,997 |
/*
* Copyright 2015 ligaDATA
*
* 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 ... | traytonwhite/Kamanja | trunk/MetadataAPIService/src/main/scala/com/ligadata/metadataapiservice/UpdateSourceModelService.scala | Scala | apache-2.0 | 4,162 |
package webhooq.model.dao
import com.hazelcast.nio.DataSerializable
import webhooq.logging.WebhooqLogger
import java.net.{URISyntaxException, URI}
import java.io.{IOException, DataInput, DataOutput}
/**
*/
case class DeliveryRef (var message_id:Option[MessageRef]=None, var uri:Option[URI]=None) extends DataSerializa... | webhooq/webhooq | src/main/scala/webhooq/model/dao/DeliveryRef.scala | Scala | apache-2.0 | 1,343 |
package cpup.mc.tweak.content
import cpup.mc.lib.CPupModHolder
import cpup.mc.lib.content.CPupRecipe
import cpup.mc.tweak.CPupTweak
trait BaseRecipe extends CPupRecipe with CPupModHolder[CPupTweak.type] {
def mod = CPupTweak
}
| CoderPuppy/cpup-tweak-mc | src/main/scala/cpup/mc/tweak/content/BaseRecipe.scala | Scala | mit | 230 |
/**
* 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... | griddynamics/kafka | core/src/main/scala/kafka/consumer/storage/MemoryOffsetStorage.scala | Scala | apache-2.0 | 1,530 |
/*
* 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 ... | ueshin/apache-flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/expressions/validation/MapTypeValidationTest.scala | Scala | apache-2.0 | 1,601 |
/* TestUtils: Lots of implicit conversions to easy Denotation tests
*
* The Denotation intermediate representation is fairly verbose, and fairly painful
* to write when constructing unit tests. TestUtils provides a large number of
* implicit conversions for making this easier, such as converting the scala literal
... | eddysystems/eddy | tests/src/tarski/TestUtils.scala | Scala | bsd-2-clause | 5,414 |
package com.teambytes.shadow
import akka.actor.{Status, ActorRef, Actor, ActorLogging}
import akka.util.Timeout
import spray.can.Http
import spray.http._
trait ClientActor extends Actor with ActorLogging {
protected implicit def timeout: Timeout
protected def host: String
protected def port: Int
protected... | grahamar/shadow | src/main/scala/com/teambytes/shadow/ClientActor.scala | Scala | mit | 2,199 |
/*
* 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/models/businessmatching/BusinessActivitiesSpec.scala | Scala | apache-2.0 | 13,670 |
package test.utils.scalacheck
import scodec.bits.BitVector
import org.scalacheck._
object Generators {
def genLSB() = for {
n ← Gen.choose(1, 0x7f)
} yield BitVector(n.toByte)
def genMSB() = for {
n ← Gen.choose(0x80, 0xff)
tail ← genBV()
} yield BitVector(n.toByte) ++ tail
def genBV(): Gen[Bi... | hardikamal/actor-platform | actor-server/actor-tests/src/test/scala/test/utils/scalacheck/Generators.scala | Scala | mit | 384 |
/*
* Copyright (C) 2012 The Regents of The University California.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENS... | sameeragarwal/blinkdb_dev | src/main/scala/shark/memstore2/TablePartitionBuilder.scala | Scala | apache-2.0 | 2,346 |
package hooktest
object Locale {
private val logger = Logger.getLogger()
def getLanguage(): String = {
java.util.Locale.getDefault().getLanguage() match {
case "ja" => "ja" // Japanese
case _ => "en" // Other
}
}
def convLang(lang: String, msg: String):... | ykon/w10wheel | src/main/scala/hooktest/Locale.scala | Scala | mit | 5,107 |
/*
* Copyright 2006 - 2013
* Stefan Balev <stefan.balev@graphstream-project.org>
* Julien Baudry <julien.baudry@graphstream-project.org>
* Antoine Dutot <antoine.dutot@graphstream-project.org>
* Yoann Pigné <yoann.pigne@graphstream-project.org>
* Guilhelm Savin <guilhelm.savin... | prismsoul/gedgraph | sources/prismsoul.genealogy.gedgraph/gs-ui/org/graphstream/ui/j2dviewer/renderer/shape/swing/BaseShapes.scala | Scala | gpl-2.0 | 12,584 |
package se.gigurra.wallace.comm
import scala.collection.mutable
object TopicManager {
trait Client[MessageType] {
def post(topic: String, message: MessageType)
def subscribed(topic: String)
def unsubscribed(topic: String)
}
}
class TopicManager[MessageType](topicFactory: String => Topic[MessageType])... | GiGurra/Wall-Ace | lib_comm/src/main/scala/se/gigurra/wallace/comm/TopicManager.scala | Scala | gpl-2.0 | 1,570 |
package spray.json
package lenses
/**
* The read lens can extract child values out of a JsValue hierarchy. A read lens
* is parameterized with a type constructor. This allows to extracts not only scalar
* values but also sequences or optional values.
* @tparam M
*/
trait ReadLens[M[_]] {
/**
* Given a parent... | savulchik/json-lenses | src/main/scala/spray/json/lenses/ReadLens.scala | Scala | apache-2.0 | 1,074 |
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author Paul Phillips
*/
package scala.tools.nsc
package interpreter
import scala.language.implicitConversions
import scala.reflect.api.{Universe => ApiUniverse}
import scala.reflect.runtime.{universe => ru}
/** A class which the repl utilizes to expo... | felixmulder/scala | src/repl/scala/tools/nsc/interpreter/ReplVals.scala | Scala | bsd-3-clause | 3,080 |
package meerkat
import scala.reflect.BeanProperty
// configuration
object Config extends ul.Props {
var serverIsRunning = false
var server:ul.netx.ServerJetty = null
// parsed command line arguments
object Args extends ul.GetArgs {
@BeanProperty var help = false
... | edartuz/meerkat | repo/src/meerkat/Config.scala | Scala | mit | 2,468 |
package example
import scala.scalajs.js
import org.scalajs.dom
object ScalaJSExample extends js.JSApp {
def main(): Unit = {
dom.document.getElementById("scalajsShoutOut").textContent = "heyyy"
}
}
| intelix/eventstreams | es-iface/es-web-scripts/src/main/scala/example/ScalaJSExample.scala | Scala | apache-2.0 | 208 |
/**
* Copyright 2016 Matthew Farmer
*
* 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 ... | farmdawgnation/scyig-judicial | src/test/scala/frmr/scyig/Generators.scala | Scala | apache-2.0 | 2,587 |
package pureconfig.module.cats
import cats._
import com.typesafe.config.{Config, ConfigFactory, ConfigValue}
import pureconfig._
import pureconfig.error.{ConfigReaderFailure, ConfigReaderFailures}
package object instances {
implicit val configReaderInstance: ApplicativeError[ConfigReader, ConfigReaderFailures] =
... | pureconfig/pureconfig | modules/cats/src/main/scala/pureconfig/module/cats/instances/package.scala | Scala | mpl-2.0 | 2,821 |
package com.nabijaczleweli.minecrasmer.entity
import com.nabijaczleweli.minecrasmer.reference.Reference
import com.nabijaczleweli.minecrasmer.reference.Reference._
import com.nabijaczleweli.minecrasmer.util.IConfigurable
import net.minecraftforge.common.config.Configuration
import net.minecraftforge.fml.common.registr... | nabijaczleweli/ASMifier | src/main/scala/com/nabijaczleweli/minecrasmer/entity/Villager.scala | Scala | mit | 1,132 |
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.