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 com.alexitc.coinalerts.models
import com.alexitc.playsonify.models.{WrappedInt, WrappedString}
import play.api.libs.json.{JsPath, Json, Reads, Writes}
/**
* [[ExchangeCurrency]] represents a currency that can be traded in
* the [[Market]] supported by the [[Exchange]].
*
* For example, I could go to BITTR... | AlexITC/crypto-coin-alerts | alerts-server/app/com/alexitc/coinalerts/models/exchangeCurrency.scala | Scala | gpl-3.0 | 1,096 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | ddseapy/geomesa | geomesa-arrow/geomesa-arrow-tools/src/main/scala/org/locationtech/geomesa/arrow/tools/stats/ArrowStatsCountCommand.scala | Scala | apache-2.0 | 1,208 |
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... | mkhq/finagle | finagle-netty3/src/main/scala/com/twitter/finagle/netty3/ChannelBufferBuf.scala | Scala | apache-2.0 | 4,574 |
/**
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package sbt.protocol.codec
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait ChannelAcceptedEventFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val ... | xuwei-k/xsbt | protocol/src/main/contraband-scala/sbt/protocol/codec/ChannelAcceptedEventFormats.scala | Scala | apache-2.0 | 1,080 |
package org.twistednoodle.json_api
import java.net.URL
import scala.collection.immutable
// Created by iwaisman on 12/29/16.
/**
* This trait encompasses all data structures representing json:api objects.
*
* There remain restrictions in the specification which have not yet been
* encoded into the type syst... | iwaisman/json_api-scala | src/main/scala/org/twistednoodle/json_api/Model.scala | Scala | mit | 5,669 |
package com.arcusys.valamis.persistence.impl.social.schema
import com.arcusys.valamis.persistence.common.DbNameUtils._
import com.arcusys.valamis.persistence.common.{LongKeyTableComponent, SlickProfile, TypeMapper}
import com.arcusys.valamis.social.model.Comment
import org.joda.time.DateTime
import com.arcusys.valamis... | igor-borisov/valamis | valamis-slick-persistence/src/main/scala/com/arcusys/valamis/persistence/impl/social/schema/CommentTableComponent.scala | Scala | gpl-3.0 | 1,290 |
package com.twitter.finagle.client
import com.twitter.finagle._
import com.twitter.finagle.Namer.AddrWeightKey
import com.twitter.util._
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
final class EndpointRecorderTest extends FunSuite... | spockz/finagle | finagle-core/src/test/scala/com/twitter/finagle/client/EndpointRecorderTest.scala | Scala | apache-2.0 | 1,806 |
/*
* Copyright (c) 2014-2021 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... | monifu/monix | monix-eval/shared/src/main/scala/monix/eval/internal/TaskShift.scala | Scala | apache-2.0 | 2,268 |
package mesosphere.marathon.core.storage.store.impl.cache
import java.io.NotActiveException
import java.time.OffsetDateTime
import akka.http.scaladsl.marshalling.Marshaller
import akka.http.scaladsl.unmarshalling.{ Unmarshal, Unmarshaller }
import akka.stream.Materializer
import akka.stream.scaladsl.Source
import akk... | timcharper/marathon | src/main/scala/mesosphere/marathon/core/storage/store/impl/cache/LoadTimeCachingPersistenceStore.scala | Scala | apache-2.0 | 8,187 |
package scorex.transaction
import scorex.account.Account
trait BalanceSheet {
def balance(account: Account, height: Option[Int] = None): Long
/**
*
* @return Minimum balance from current block to balance confirmation blocks ago
*/
def balanceWithConfirmations(account: Account, confirmations: Int): Lo... | alexeykiselev/WavesScorex | scorex-basics/src/main/scala/scorex/transaction/BalanceSheet.scala | Scala | cc0-1.0 | 325 |
package com.arcusys.learn.models.request
object QuizActionType extends Enumeration {
val GetAll = Value("GETALL")
val GetContent = Value("GETCONTENT")
val Add = Value("ADD")
val Publish = Value("PUBLISH")
val Delete = Value("DELETE")
val Update = Value("UPDATE")
val UpdateLogo = Value("UPDATELOGO")
va... | ViLPy/Valamis | learn-portlet/src/main/scala/com/arcusys/learn/models/request/QuizActionType.scala | Scala | lgpl-3.0 | 1,493 |
package com.github.vonnagy.service.container.health
import java.net.InetAddress
import java.util.jar.Attributes.Name
import java.util.jar.{Attributes, JarFile, Manifest}
import com.github.vonnagy.service.container.log.LoggingAdapter
/**
* Created by Ivan von Nagy on 1/12/15.
*/
object ContainerInfo extends Logging... | vonnagy/service-container | service-container/src/main/scala/com/github/vonnagy/service/container/health/ContainerInfo.scala | Scala | apache-2.0 | 3,678 |
package com.sksamuel.scapegoat.inspections.exception
import com.sksamuel.scapegoat.PluginRunner
import org.scalatest.{ FreeSpec, Matchers, OneInstancePerTest }
/** @author Stephen Samuel */
class UnreachableCatchTest
extends FreeSpec
with Matchers
with PluginRunner
with OneInstancePerTest {
overrid... | pwwpche/scalac-scapegoat-plugin | src/test/scala/com/sksamuel/scapegoat/inspections/exception/UnreachableCatchTest.scala | Scala | apache-2.0 | 1,366 |
package com.letstalkdata.hexiles
package game
import com.letstalkdata.hexiles.shapes.Cube
import scala.language.postfixOps
/**
* A snapshot of the game at a point in time.
*
* Author: Phillip Johnson
* Date: 4/30/15
*/
class State(board: Board, pieces: Seq[Piece]) {
def isTerminal: Boolean = {
isBoardCov... | SeriousSoftware/ScalaJS-Hexiles-web | src/main/scala-2.11/com/letstalkdata/hexiles/game/State.scala | Scala | mit | 879 |
import org.apache.spark.SparkContext
import org.apache.spark.SparkConf
object KmeansSpark {
type Point = (Double, Double)
var centroids: Array[Point] = Array[Point]()
//Receives each point and clusters, returns cluster(closest to that point and the point itself)
def assignment(x: Point, centers: Array[Point]... | fegaras/DIQL | tests/diablo/spark/KMeansSpark.scala | Scala | apache-2.0 | 1,766 |
/**
* 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... | tc-dc/kafka-mesos | src/scala/iface/0_9/ly/stealth/mesos/kafka/interface/impl/ZkUtils.scala | Scala | apache-2.0 | 2,616 |
class UpdateOnly {
def update(x: Int, y: Int) {
}
}
val x = new UpdateOnly
x(2/*caret*/) = 3
//x: Int | triggerNZ/intellij-scala | testdata/parameterInfo/functionParameterInfo/update/UpdateOnly.scala | Scala | apache-2.0 | 111 |
package patterns
trait Functor[C[_]] {
def map[A, B](f : A => B) : C[B]
}
trait Applicative[F[_]] extends Functor[F] {
def pure[A](a: A) : F[A]
def apply[A, B](f: F[A => B]) : F[B]
override def map[A, B](f: A => B): F[B] = apply(pure(f))
}
object ApplicativeVsMonad {
case class Foo(s: Symbol, n: Int)
... | dongarerahul/FunctionalProgrammingInScala | src/patterns/ApplicativeVsMonad.scala | Scala | apache-2.0 | 1,256 |
/**
* 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... | CiscoCloud/exhibitor-mesos-framework | src/main/test/ly/stealth/mesos/exhibitor/ExhibitorServerTest.scala | Scala | apache-2.0 | 8,702 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | Kegeruneku/rudder | rudder-core/src/test/scala/com/normation/rudder/migration/XmlDataMigration_2.scala | Scala | agpl-3.0 | 13,715 |
package net.paploo.diestats.expression.evaluator
/**
* The base trait for evaluators of expressions.
*
* Defines functionality that is expected of every domain.
*
* @tparam A The domain type
* @tparam R The evaluation result type
*/
trait Evaluator[A, R] {
def fromValues(as: Iterable[A]): R
def conv... | paploo/DieStats | src/main/scala/net/paploo/diestats/expression/evaluator/Evaluator.scala | Scala | bsd-3-clause | 694 |
package org.jetbrains.plugins.scala
package codeInspection.collections
import org.jetbrains.plugins.scala.codeInspection.InspectionBundle
import org.jetbrains.plugins.scala.lang.psi.api.expr.{ScExpression, ScMethodCall}
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory
import org.jetbrains.plugin... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/collections/MapGetOrElseInspection.scala | Scala | apache-2.0 | 2,978 |
import org.scalacheck.{Gen, Arbitrary}
import org.specs2._
import org.scalacheck.Prop._
class ScalaCheckSpec extends Specification with ScalaCheck { def is = s2"""
A ScalaCheck property inside example ${ forAll { (i: Int) => i > 0 || i <= 0 } }
A `prop` method to create a property from a function
retur... | jaceklaskowski/specs2-sandbox | src/test/scala/ScalaCheckSpec.scala | Scala | apache-2.0 | 853 |
/*
* Copyright 2014 Kevin Herron
*
* 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 ... | digitalpetri/scala-ethernet-ip | logix-services/src/main/scala/com/digitalpetri/ethernetip/cip/logix/TemplateInstance.scala | Scala | apache-2.0 | 1,641 |
package com.mlh.sprayswaggersample
import com.wordnik.swagger.annotations._
import javax.ws.rs.Path
import spray.routing.HttpService
import spray.json._
import spray.json.DefaultJsonProtocol._
import org.json4s.JsonAST.JObject
// check more here https://github.com/mhamrah/spray-swagger-sample/blob/master/src/main/sca... | michaelgruczel/spray-swagger-angularjs-example | src/main/scala/TodoListHttpService.scala | Scala | mit | 2,655 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/BlindingSpeed.scala | Scala | apache-2.0 | 973 |
package org.vaadin.addons.rinne.mixins
import com.vaadin.ui.{Alignment, Component, Layout}
trait LayoutAlignmentHandlerMixin {
this: Layout.AlignmentHandler =>
def componentAlignment(component: Component): Alignment = getComponentAlignment(component)
def componentAlignment_=(component: Component, alignment: A... | LukaszByczynski/rinne | src/main/scala/org/vaadin/addons/rinne/mixins/LayoutAlignmentHandlerMixin.scala | Scala | apache-2.0 | 605 |
// Project: angulate2 (https://github.com/jokade/angulate2)
// Description:
// Copyright (c) 2017 Johannes.Kastner <[email protected]>
// Distributed under the MIT License (see included LICENSE file)
package angulate2.platformBrowser.animations
import scala.scalajs.js
import scala.scalajs.js.annot... | jokade/angulate2 | bindings/src/main/scala/angulate2/platformBrowser/animations/BrowserAnimationsModule.scala | Scala | mit | 471 |
/**
* Copyright (C) 2016 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 | form-runner/jvm/src/main/scala/org/orbeon/oxf/fr/persistence/relational/search/SearchLogic.scala | Scala | lgpl-2.1 | 7,930 |
package sbt
/*
TODO:
- index all available AutoPlugins to get the tasks that will be added
- error message when a task doesn't exist that it would be provided by plugin x, enabled by natures y,z, blocked by a, b
*/
import logic.{Atom, Clause, Clauses, Formula, Literal, Logic, Negated}
import Logic.{CyclicNegation, Ini... | pdalpra/sbt | main/src/main/scala/sbt/Plugins.scala | Scala | bsd-3-clause | 16,090 |
/*
* Copyright 2015 Heiko Seeberger
*
* 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... | sbt/sbt-header | src/main/scala/de/heikoseeberger/sbtheader/License.scala | Scala | apache-2.0 | 21,592 |
package models.annotation
import com.scalableminds.util.accesscontext.DBAccessContext
import com.scalableminds.util.tools.{Fox, FoxImplicits, JsonHelper}
import com.scalableminds.webknossos.schema.Tables._
import com.scalableminds.webknossos.tracingstore.tracings.TracingType
import javax.inject.Inject
import models.an... | scalableminds/webknossos | app/models/annotation/Annotation.scala | Scala | agpl-3.0 | 23,477 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js tools **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2014, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | jmnarloch/scala-js | tools/shared/src/main/scala/org/scalajs/core/tools/classpath/LinkedClasspath.scala | Scala | bsd-3-clause | 1,100 |
/*
* =========================================================================================
* Copyright © 2013-2018 the kamon project <http://kamon.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... | kamon-io/kamon-agent | agent-test/src/test/scala/app/kanela/instrumentation/MultiMixinsInstrumentation.scala | Scala | apache-2.0 | 1,303 |
/**
* MIT License
*
* Copyright (c) 2016-2018 James Sherwood-Jones <[email protected]>
*
* 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, includi... | jSherz/lsd-members | backend/src/main/scala/com/jsherz/luskydive/util/EitherFutureExts.scala | Scala | mit | 1,884 |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\\
* @ @ *
* # # # # (c) 2017 CAB *
* # # # # # # ... | AlexCAB/MathAct | mathact_core/src/main/scala/mathact/core/sketch/view/visualization/Visualization.scala | Scala | mit | 2,158 |
package io.koff.expressions
import com.github.jedesah.Expression
import com.github.jedesah.Expression._
import scalaz._
import Scalaz._
import scalaz.std.scalaFuture.futureInstance
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
import scala.concurrent.{Await, Future}
/**
... | coffius/koffio-expression-example | src/main/scala/io/koff/expressions/SimpleExpressionExample.scala | Scala | mit | 1,794 |
/*
* 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 ... | wgpshashank/spark | streaming/src/main/scala/spark/streaming/StreamingContext.scala | Scala | apache-2.0 | 21,232 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-process/geomesa-process-vector/src/test/scala/org/locationtech/geomesa/process/query/KnnProcessTest.scala | Scala | apache-2.0 | 19,810 |
package io.github.shogowada.scalajs.reactjs.example.interactive.helloworld
import io.github.shogowada.scalajs.reactjs.VirtualDOM._
import io.github.shogowada.scalajs.reactjs.elements.ReactElement
import io.github.shogowada.scalajs.reactjs.events.FormSyntheticEvent
import io.github.shogowada.scalajs.reactjs.example.int... | shogowada/scalajs-reactjs | example/interactive-helloworld/src/main/scala/io/github/shogowada/scalajs/reactjs/example/interactive/helloworld/Main.scala | Scala | mit | 3,386 |
package org.lancegatlin
object Try1 {
case class Person(id: Int, name: String, age: Int)
trait Schema[C] {
class Field[A](val unapply: C => A) {
def name: String = {
// org.lancegatlin.Try1$PersonSchema$id$
val name = getClass.getName
// Try1$PersonSchema$id
val simpleNam... | lancegatlin/caseclass_ql | src/main/scala/org/lancegatlin/Try1.scala | Scala | mit | 2,371 |
package uk.co.bbc.redux
import java.util.Date
import java.io.InputStream
import java.io.BufferedInputStream
import java.awt.image.BufferedImage
import javax.imageio.ImageIO
import scala.xml._
import scala.xml.factory.XMLLoader
class Client extends Http {
var htmlParser:XMLLoader[Elem] = XML.withSAXParser(new org.c... | bbcsnippets/redux-client-scala | src/main/scala/uk/co/bbc/redux/Client.scala | Scala | apache-2.0 | 6,916 |
import scala
object Foo {
val x = "this should be long to compile or the test may fail."
} | twitter-forks/sbt | sbt/src/sbt-test/actions/task-cancel/src/main/scala/test.scala | Scala | bsd-3-clause | 92 |
/*
* $Id$
*
* Copyright 2015 Valentyn Kolesnikov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... | javadev/ukrainiantolatin | src/test/scala/UkrainianToLatinTest.scala | Scala | apache-2.0 | 6,951 |
package pimpathon
import _root_.java.io.{InputStream, OutputStream}
import _root_.java.math.BigInteger
import _root_.java.nio.charset.Charset
import pimpathon.any._
import pimpathon.string._
object array {
implicit class ArrayPimps[A](val self: Array[A]) extends AnyVal {
def copyTo(srcPos: Int, dest: Array[A]... | raymanoz/pimpathon | src/main/scala/pimpathon/array.scala | Scala | apache-2.0 | 1,051 |
package com.codahale.jerkson.deser
import com.fasterxml.jackson.databind.{ DeserializationContext, JsonDeserializer }
import com.fasterxml.jackson.core.{ JsonToken, JsonParser }
import com.fasterxml.jackson.databind.JavaType
import scala.collection.immutable.LongMap
import com.fasterxml.jackson.databind.deser.Resolvab... | mDialog/jerkson | src/main/scala/com/codahale/jerkson/deser/LongMapDeserializer.scala | Scala | mit | 1,373 |
package org.jetbrains.plugins.scala
package highlighter
package usages
import com.intellij.codeInsight.highlighting.HighlightUsagesHandlerBase
import com.intellij.util.Consumer
import com.intellij.openapi.editor.Editor
import com.intellij.psi.{PsiFile, PsiElement}
import java.util.List
import collection.JavaConversion... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/highlighter/usages/ScalaHighlightPrimaryConstructorExpressionsHandler.scala | Scala | apache-2.0 | 1,602 |
package suiryc
import suiryc.scala.misc.EnumerationWithAliases
package object scala {
// Note: class defined in package object so that we can make it 'implicit'
/** Enrich Enumeration with case-insensitive name resolver. */
implicit class RichEnumeration[A <: Enumeration](val enum: A) extends AnyVal {
pr... | suiryc/suiryc-scala | core/src/main/scala/suiryc/scala/package.scala | Scala | gpl-3.0 | 800 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | slamdata/slamengine | sst/src/main/scala/quasar/sst/strings.scala | Scala | apache-2.0 | 3,569 |
/*
* Copyright 2014-2022 Netflix, 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... | Netflix-Skunkworks/iep-apps | atlas-persistence/src/main/scala/com/netflix/atlas/persistence/HourlyRollingWriter.scala | Scala | apache-2.0 | 5,135 |
package pl.newicom.dddd.process
import pl.newicom.dddd.office.LocalOfficeId
trait SagaSupport {
implicit def officeListener[E <: Saga : LocalOfficeId : ReceptorActorFactory]: CoordinationOfficeListener[E] =
new CoordinationOfficeListener[E]
}
| pawelkaczor/akka-ddd | akka-ddd-core/src/main/scala/pl/newicom/dddd/process/SagaSupport.scala | Scala | mit | 254 |
/*
* Copyright (c) 2016 SnappyData, Inc. 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/LICENSE-2.0
*
* Unless required by ap... | vjr/snappydata | core/src/main/scala/org/apache/spark/sql/DataFrameJavaFunctions.scala | Scala | apache-2.0 | 2,677 |
/*
* cramersv.scala
* author: RJ Nowling <[email protected]>
*
* Copyright (c) 2016 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org... | willb/silex | src/main/scala/com/redhat/et/silex/statistics/cramersv.scala | Scala | apache-2.0 | 3,581 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/table/validation/CorrelateValidationTest.scala | Scala | apache-2.0 | 6,613 |
package com.nulabinc.backlog.r2b.exporter.convert
import javax.inject.Inject
import com.nulabinc.backlog.migration.common.conf.BacklogConstantValue
import com.nulabinc.backlog.migration.common.convert.{Convert, Writes}
import com.nulabinc.backlog.migration.common.domain.{
BacklogAttachment,
BacklogAttributeInfo,
... | nulab/BacklogMigration-Redmine | src/main/scala/com/nulabinc/backlog/r2b/exporter/convert/JournalDetailWrites.scala | Scala | mit | 8,397 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package search
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.util.Computable
import com.intellij.psi.PsiClass
import com.intellij.psi.search.GlobalSea... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/search/ScalaDirectClassInheritorsSearcher.scala | Scala | apache-2.0 | 1,672 |
/*
* Copyright (C) 2017 Michael Dippery <[email protected]>
*
* 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 requi... | mdippery/jupiter | src/main/scala/com/mipadi/jupiter/io/package.scala | Scala | apache-2.0 | 736 |
/*
* 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 | external/mqtt/src/main/scala/org/apache/spark/streaming/mqtt/MQTTInputDStream.scala | Scala | apache-2.0 | 3,175 |
package debop4s.mongo.datetime
import debop4s.core.conversions.jodatime._
import debop4s.core.{TimestampZoneText, ToStringHelper}
import debop4s.mongo.AbstractMongoDocument
import org.joda.time.DateTime
import org.springframework.data.mongodb.core.mapping.Document
@Document
class Timeseries extends AbstractMongoDocum... | debop/debop4s | debop4s-mongo/src/test/scala/debop4s/mongo/datetime/Timeseries.scala | Scala | apache-2.0 | 655 |
package paperdoll.arm
import resource.Resource
import paperdoll.core.effect.Arrs.compose
import paperdoll.core.effect.Effects
import scalaz.Leibniz
import paperdoll.core.layer.Member
import paperdoll.core.layer.Layers
import shapeless.Coproduct
import scalaz.Leibniz.===
import paperdoll.core.effect.Pure
imp... | m50d/paperdoll | arm/src/main/scala/paperdoll/arm/Region.scala | Scala | apache-2.0 | 3,414 |
package com.github.j5ik2o.forseti.domain.accessToken
object AccessTokenType extends Enumeration {
val Bearer, Mac, Unknown = Value
}
| j5ik2o/forseti | domain/src/main/scala/com/github/j5ik2o/forseti/domain/accessToken/AccessTokenType.scala | Scala | mit | 138 |
/*
* Copyright 2013-2014 JetBrains s.r.o.
*
* 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... | JetBrains/sbt-tc-logger | test/testdata/jacoco/src/main/scala/Point.scala | Scala | apache-2.0 | 803 |
val x@"foo" = "foo"
/*start*/x/*end*/
//String | ilinum/intellij-scala | testdata/typeInference/bugs5/SCL4558.scala | Scala | apache-2.0 | 46 |
/***********************************************************************
* 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-utils/src/test/scala/org/locationtech/geomesa/utils/stats/Z3HistogramTest.scala | Scala | apache-2.0 | 4,325 |
/*
* 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 ... | guoxiaolongzte/spark | core/src/test/scala/org/apache/spark/util/collection/ExternalAppendOnlyMapSuite.scala | Scala | apache-2.0 | 20,009 |
package io.github.pauljamescleary.petstore.infrastructure.endpoint
import org.http4s.QueryParamDecoder
import org.http4s.dsl.impl.OptionalQueryParamDecoderMatcher
object Pagination {
/* Necessary for decoding query parameters */
import QueryParamDecoder._
/* Parses out the optional offset and page size params ... | pauljamescleary/scala-pet-store | src/main/scala/io/github/pauljamescleary/petstore/infrastructure/endpoint/Pagination.scala | Scala | apache-2.0 | 503 |
package scuff
import java.lang.management.ManagementFactory
import scala.reflect.{ ClassTag, classTag }
import scala.jdk.CollectionConverters._
import java.net.InetSocketAddress
import java.net.InetAddress
import java.util.concurrent.atomic.AtomicInteger
import javax.management._
import javax.management.remote.JMXS... | nilskp/scuff | src/main/scala/scuff/JMX.scala | Scala | mit | 8,642 |
/*
Copyright 2016 Tunalytics Foundation
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... | tunalytics/loader | transformer/src/main/scala/org/tunalytics/loader/transformer/topology/signals/SignalSpout.scala | Scala | apache-2.0 | 2,241 |
/*
* Copyright 2016 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... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600e/v3/E125.scala | Scala | apache-2.0 | 1,423 |
import com.google.inject.AbstractModule
import service._
class Module extends AbstractModule {
override def configure() = {
bind(classOf[WsConsumer]).to(classOf[WsConsumerImpl]).asEagerSingleton()
bind(classOf[TeaserService]).to(classOf[TeaserServiceImpl]).asEagerSingleton()
bind(classOf[CarouselService... | splink/pagelets-seed | app/Module.scala | Scala | apache-2.0 | 469 |
import scala.collection.immutable.HashSet
object Test extends App {
var hashCount = 0
/**
* A key that produces lots of hash collisions, to exercise the part of the code that deals with those
*/
case class Collision(value: Int) {
override def hashCode = {
// we do not check hash counts for Col... | felixmulder/scala | test/files/run/t6253a.scala | Scala | bsd-3-clause | 2,545 |
package tshrdlu.util.index
/**
* Copyright 2013 Nick Wilson
*
* 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... | utcompling/tshrdlu | src/main/scala/tshrdlu/util/index/Reader.scala | Scala | apache-2.0 | 6,107 |
package exceptions
case class FileNotFoundException(message: String) extends Throwable
| arpanchaudhury/SFD | src/main/scala/exceptions/FileNotFoundException.scala | Scala | mit | 88 |
/*
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package play.routes.compiler
import java.io.File
import org.apache.commons.io.FileUtils
import scala.util.parsing.combinator._
import scala.util.parsing.input._
import scala.language.postfixOps
object RoutesFileParser {
/**
* Parse the... | jyotikamboj/container | pf-framework/src/routes-compiler/src/main/scala/play/routes/compiler/RoutesFileParser.scala | Scala | mit | 11,914 |
/*
* Copyright 2011-2018 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | wiacekm/gatling | gatling-core/src/main/scala/io/gatling/core/structure/Execs.scala | Scala | apache-2.0 | 1,564 |
package edu.cmu.cs.oak.lib.array
import java.nio.file.Path
import com.caucho.quercus.expr.Expr
import edu.cmu.cs.oak.lib.InterpreterPluginProvider
import edu.cmu.cs.oak.core.OakInterpreter
import edu.cmu.cs.oak.env.Environment
import edu.cmu.cs.oak.lib.InterpreterPlugin
import edu.cmu.cs.oak.value.ArrayValue
import ... | smba/oak | edu.cmu.cs.oak/src/main/scala/edu/cmu/cs/oak/lib/array/IsArray.scala | Scala | lgpl-3.0 | 910 |
/*
* 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 ... | ksattler/piglet | src/main/scala/dbis/pig/plan/rewriting/internals/WindowSupport.scala | Scala | apache-2.0 | 6,707 |
package net.fehmicansaglam.tepkin
import akka.actor.{ActorRefFactory, ActorSystem}
import net.fehmicansaglam.tepkin.TepkinMessage.ShutDown
import net.fehmicansaglam.tepkin.protocol.ReadPreference
import scala.concurrent.ExecutionContext
class MongoClient(val context: ActorRefFactory, uri: MongoClientUri, nConnectio... | danielwegener/tepkin | tepkin/src/main/scala/net/fehmicansaglam/tepkin/MongoClient.scala | Scala | apache-2.0 | 1,248 |
/*
* Copyright 2016 rdbc contributors
*
* 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... | rdbc-io/rdbc-pgsql | rdbc-pgsql-core/src/main/scala/io/rdbc/pgsql/core/internal/protocol/Argument.scala | Scala | apache-2.0 | 977 |
package scripts
import java.io.File.pathSeparatorChar
import java.net.URLClassLoader
import java.nio.file.{Files, Paths}
import io.bazel.rulesscala.worker.Worker
import protocbridge.{ProtocBridge, ProtocCodeGenerator}
import scala.sys.process._
object ScalaPBWorker extends Worker.Interface {
private val protoc =... | bazelbuild/rules_scala | src/scala/scripts/ScalaPBWorker.scala | Scala | apache-2.0 | 1,579 |
package org.brijest.storm.engine.model.components
import collection._
import mutable.Buffer
package immutable {
trait Quad[+T] extends Traversable[T] {
def default: (Int, Int) => Option[T]
def dimensions: (Int, Int)
def size: Int
def apply(x: Int, y: Int): T
def within(p: Quad.Area): Seq[... | axel22/scala-2d-game-editor | src/main/scala/org/brijest/storm/engine/model/components/Quad.scala | Scala | bsd-3-clause | 19,148 |
package org.scalaide.ui.editor
import scala.collection.JavaConverters._
import scala.collection.breakOut
import org.eclipse.jdt.core.ICompilationUnit
import org.eclipse.jdt.core.compiler.IProblem
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.ProblemAnnotation
import org.eclipse.jface.t... | scala-ide/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/editor/DecoratedInteractiveEditor.scala | Scala | bsd-3-clause | 3,083 |
package coder.simon.ch6
trait State[S, +A] { self =>
def run: S => (A, S)
def map[B](f: A => B) = new State[S, B] {
def run = { s =>
val (a, s2) = self.run(s)
(f(a), s2)
}
}
def flatMap[B](f: A => State[S, B]) = new State[S, B] {
def run = { s =>
val (a, s2) = self.run(s)
... | erlangxk/fpscala | src/main/scala/coder/simon/ch6/State.scala | Scala | mit | 1,968 |
/*
* 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 ... | lincoln-lil/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/catalog/CatalogViewITCase.scala | Scala | apache-2.0 | 15,232 |
/*
* Copyright (c) 2002-2018 "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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/planner/logical/idp/IDPTable.scala | Scala | apache-2.0 | 2,756 |
package dotty.tools
package dotc
package reporting
import core._
import Contexts.Context
import Decorators._, Symbols._, Names._, NameOps._, Types._, Flags._
import Denotations.SingleDenotation
import SymDenotations.SymDenotation
import util.SourcePosition
import parsing.Scanners.Token
import parsing.Tokens
import pri... | som-snytt/dotty | compiler/src/dotty/tools/dotc/reporting/messages.scala | Scala | apache-2.0 | 99,657 |
package edu.berkeley.nlp.entity.sem
import edu.berkeley.nlp.entity.coref.DocumentGraph
import edu.berkeley.nlp.futile.util.Logger
import edu.berkeley.nlp.entity.coref.Mention
import scala.collection.mutable.ArrayBuffer
import edu.berkeley.nlp.entity.WordNetInterfacer
import scala.collection.JavaConverters._
object Fa... | malcolmgreaves/berkeley-entity | src/main/java/edu/berkeley/nlp/entity/sem/FancyHeadMatcher.scala | Scala | gpl-3.0 | 8,838 |
/***********************************************************************
* Copyright (c) 2013-2022 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | locationtech/geomesa | geomesa-z3/src/test/scala/org/locationtech/geomesa/curve/XZ2SFCTest.scala | Scala | apache-2.0 | 4,884 |
package com.tradeshift.reaktive.xsd
import akka.stream.scaladsl.StreamConverters
import com.tradeshift.reaktive.testkit.SharedActorSystemSpec
import java.io.FileInputStream
import org.scalatest.Matchers
import org.scalatest.FunSpecLike
import akka.stream.scaladsl.StreamConverters
import akka.stream.scaladsl.FileIO
imp... | Tradeshift/ts-reaktive | ts-reaktive-xsd/src/test/scala/com/tradeshift/reaktive/xsd/SchemaLoaderSpec.scala | Scala | mit | 5,041 |
package typeclasses.homebrew
import shapeless._
import shapeless.record.FieldType
/**
* Created by eap on 7/31/14.
*/
trait TypeClassImpl[C[_]] {
def emptyProduct: C[HNil]
def product[H, T <: HList](
name: String,
CHead: C[H],
CTail: C[T]): C[H :: T]
def emptyCoproduct: C[CNil]
def coproduct[L,... | pierzchalski/HomebrewTypeClasses | src/main/scala/typeclasses/homebrew/TypeClass.scala | Scala | mit | 2,712 |
// 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... | toddmowen/maestro | maestro-schema/src/main/scala/au/com/cba/omnia/maestro/schema/syntax/Currency.scala | Scala | apache-2.0 | 2,709 |
/* Copyright 2012 Christian Douven
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | chridou/almhirt | almhirt-common/src/main/scala/almhirt/syntax/almxml.scala | Scala | apache-2.0 | 658 |
package cats.examples.datatypes
/**
* Kleisli enables composition of functions that return a monadic value, for
* instance an Option[Int] or a Either[String, List[Double]], without having
* functions take an Option or Either as a parameter, which can be strange and
* unwieldy.
*
* We may also have several ... | carwynellis/cats-examples | src/main/scala/cats/examples/datatypes/KleisliExample.scala | Scala | mit | 13,664 |
package io.getquill
import io.getquill.context.Context
// Testing we are passing type params explicitly into JdbcContextBase, otherwise
// this file will fail to compile
trait BaseExtensions {
val context: Context[PostgresDialect, _]
}
trait JDBCExtensions extends BaseExtensions {
override val context: Postgres... | getquill/quill | quill-jdbc-zio/src/test/scala/io/getquill/TypeParamExtensionTest.scala | Scala | apache-2.0 | 340 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.annotation.extern
object Option {
sealed abstract class Option[T] {
def get: T = {
require(isDefined)
//this match { case Some(x) => x }
this.asInstanceOf[Some[T]].x // slightly more efficient than pattern matching: no type checking
}
... | epfl-lara/leon | src/test/resources/regression/genc/valid/Option.scala | Scala | gpl-3.0 | 1,473 |
package rxthings.sensors
import spray.json.{DefaultJsonProtocol, RootJsonFormat}
object DS18B20ReadingModels {
case class ValidDS18B20Reading(device: String, value: Int) extends DS18B20Reading {
val t = System.currentTimeMillis()
lazy val c: Double = value / 1000
lazy val f: Double = c * 1.8 + 32
}
... | jw3/DS18B20 | src/main/scala/rxthings/sensors/Models.scala | Scala | apache-2.0 | 715 |
/*
* Copyright 2015 [See AUTHORS file for list of 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 require... | pxinghao/ParallelCorrelationClustering | src/main/scala/AuxiliaryFunctions.scala | Scala | apache-2.0 | 11,709 |
package org.scalatra
package servlet
import java.net.{ MalformedURLException, URL }
import java.{ util => jutil }
import javax.servlet.http.{ HttpServlet, HttpServletRequest }
import javax.servlet.{ DispatcherType, Filter, ServletContext }
import scala.collection.mutable
/**
* Extension methods to the standard Serv... | lightvector/scalatra | core/src/main/scala/org/scalatra/servlet/RichServletContext.scala | Scala | bsd-2-clause | 7,594 |
package us.feliscat.time
import scala.collection.mutable.ListBuffer
/**
* <pre>
* Created on 3/14/15.
* </pre>
*
* @author K.Sakamoto
*/
object TimeMerger {
def needToUpdate(yAOpt: Option[Int], yBOpt: Option[Int], isALessThanB: Boolean): Boolean = {
yAOpt match {
case Some(yA) =>
yBOpt mat... | ktr-skmt/FelisCatusZero-multilingual | libraries/src/main/scala/us/feliscat/time/TimeMerger.scala | Scala | apache-2.0 | 1,694 |
package org.jetbrains.plugins.dotty.lang.parser.parsing.types
import org.jetbrains.plugins.dotty.lang.parser.DottyElementTypes._
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
/**
* @author adkozlov
*/
/*
* RefinedType ::= WithType {[nl] Refinement}
*/
object RefinedType extends... | ilinum/intellij-scala | src/org/jetbrains/plugins/dotty/lang/parser/parsing/types/RefinedType.scala | Scala | apache-2.0 | 850 |
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.