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 fp_in_scala.chapter_04
/**
* Created by jankeesvanandel on 14/11/15.
*/
sealed trait Validation[+E, +A] {
def map[B](f: A => B): Validation[E, B] = this match {
case l: Errors[E] => l
case Success(a) => Success(f(a))
}
def map2[EE >: E, B, C](b: => Validation[EE, B])(f: (A, B) => C): Validat... | jankeesvanandel/fp-in-scala | src/main/scala/fp_in_scala/chapter_04/Validation.scala | Scala | apache-2.0 | 946 |
package eveapi.data.crest
import java.time._
case class FleetUrl[L](href: L) extends GetLink[L, Fleet[L]] with PutLink[L, FleetUpdate]
case class FleetUpdate(isFreeMove: Option[Boolean] = None, motd: Option[String] = None)
// TODO write circe/argonaut codecs for this one
sealed abstract class InviteMember[L] extends... | scala-eveapi/eveapi | data/src/main/scala/eveapi/data/crest/fleet.scala | Scala | mit | 2,648 |
package org.jetbrains.plugins.scala
package format
import org.jetbrains.plugins.scala.base.SimpleTestCase
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory.createExpressionFromText
import org.junit.Assert._
/**
* Pavel Fatin
*/
... | jastice/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/format/InterpolatedStringFormatterTest.scala | Scala | apache-2.0 | 4,481 |
package chandu0101.scalajs.facades.examples.pages.components.leaflet
import chandu0101.scalajs.facades.examples.pages.common.CodeExample
import chandu0101.scalajs.facades.leaflet._
import japgolly.scalajs.react.ReactComponentB
import japgolly.scalajs.react.vdom.all._
import scala.scalajs.js.Dynamic.{global => g, lite... | chandu0101/scalajs-facades | examples/src/main/scala/chandu0101/scalajs/facades/examples/pages/components/leaflet/LMarkersDemo.scala | Scala | mit | 1,763 |
package spgui.widgets
import java.time._
import java.text.SimpleDateFormat
import java.util.UUID
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.html_<^._
import japgolly.scalajs.react.ReactDOM
import spgui.SPWidget
import spgui.widgets.css.{WidgetStyles => Styles}
import spgui.communication._
impo... | kristoferB/SP | sperica/frontend/src/main/scala/spgui/widgets/PlaceWidget.scala | Scala | mit | 10,265 |
package org.opencompare.io.bestbuy
import org.opencompare.hac.agglomeration.{CompleteLinkage, AgglomerationMethod}
import org.opencompare.api.java.Product
import org.opencompare.api.java.clustering.HierarchicalClusterer
import scala.collection.JavaConversions._
/**
* Created by gbecan on 4/10/15.
*/
class ProductC... | OpenCompare/OpenCompare | org.opencompare/io-best-buy/src/main/scala/org/opencompare/io/bestbuy/ProductClusterer.scala | Scala | apache-2.0 | 2,877 |
/*
* Licensed to Intel Corporation under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Intel Corporation licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use t... | SeaOfOcean/BigDL | dl/src/main/scala/com/intel/analytics/bigdl/utils/Util.scala | Scala | apache-2.0 | 1,709 |
/*
* Copyright 2017 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | pncampbell/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC209B.scala | Scala | apache-2.0 | 1,131 |
package api.hue
import api.hue.dao.attribute.{Attribute, TransitionTime}
import api.hue.endpoint.{Groups, Lights}
import com.google.inject.Inject
import com.github.nscala_time.time.Imports._
import play.api.libs.json.JsValue
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
/**... | ddexter/HomeBackend | src/main/scala/api/hue/State.scala | Scala | apache-2.0 | 2,424 |
/**
* 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/symbols/CypherType.scala | Scala | gpl-3.0 | 3,050 |
/*
* 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 ... | steveloughran/spark-timeline-integration | yarn-timeline-history/src/main/scala/org/apache/spark/deploy/history/yarn/YarnEventListener.scala | Scala | apache-2.0 | 1,570 |
package skinny
import org.scalatest.FlatSpec
class DBSettingsSpec extends FlatSpec with DBSettingsInitializer {
behavior of "DBSettings"
it should "have #initialize" in {
val originalValue = System.getProperty(SkinnyEnv.EnvKey)
try {
System.setProperty(SkinnyEnv.EnvKey, "test")
initialize(fa... | seratch/skinny-framework | orm/src/test/scala/skinny/DBSettingsSpec.scala | Scala | mit | 496 |
package com.arcusys.learn.liferay.services
import com.arcusys.learn.liferay.LiferayClasses.LAssetEntry
import com.liferay.portal.kernel.dao.orm.{DynamicQuery, RestrictionsFactoryUtil}
import com.liferay.portal.util.PortalUtil
import com.liferay.portlet.asset.model.AssetEntry
import com.liferay.portlet.asset.service.{A... | igor-borisov/valamis | learn-liferay620-services/src/main/scala/com/arcusys/learn/liferay/services/AssetEntryLocalServiceHelper.scala | Scala | gpl-3.0 | 3,075 |
package stagerwr
import squid.utils._
import Embedding.Predef._
import Embedding.Quasicodes._
import squid.lib.{transparent,transparencyPropagating}
import Math.{pow,sqrt}
// FIXME: accessors and ctor not set @transparent...
//case class Position(@transparent x: Double, @transparent y: Double)
//case class Positi... | epfldata/squid | example/src/main/scala/experimentation/stagerwr/Power.scala | Scala | apache-2.0 | 1,411 |
/*
* 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 ... | esi-mineset/spark | mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala | Scala | apache-2.0 | 10,826 |
/*
* Copyright 2014 Michael Krolikowski
*
* 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 ag... | mkroli/shurl | src/main/scala/com/github/mkroli/shurl/AkkaComponent.scala | Scala | apache-2.0 | 881 |
import sbt.Keys._
import sbt._
object RootBuild extends Build {
val liftVersion = SettingKey[String]("liftVersion", "Full version number of the Lift Web Framework")
val liftEdition = SettingKey[String]("liftEdition", "Lift Edition (short version number to append to artifact name)")
lazy val project = Project(
... | joescii/type-prog-impress | project/Build.scala | Scala | apache-2.0 | 543 |
/*
* foundweekends project
*
* 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 writin... | foundweekends/giter8 | cli-git/src/main/scala/Home.scala | Scala | apache-2.0 | 790 |
package ml.sparkling.graph
/**
* API of Sparkling Graph library.
* Created by Roman Bartusiak ([email protected] http://riomus.github.io).
*/
package object api
| sparkling-graph/sparkling-graph | api/src/main/scala/ml/sparkling/graph/api/package.scala | Scala | bsd-2-clause | 174 |
package co.spendabit.webapp.forms.v3.controls
import org.apache.commons.fileupload.FileItem
import scala.xml.NodeSeq
class FileUpload extends FileBasedInput[FileItem] {
def validate(fileItem: Option[FileItem]): Either[String, FileItem] = {
fileItem match {
case Some(fi) => Right(fi)
case None => L... | spendabit/webapp-tools | src/co/spendabit/webapp/forms/v3/controls/FileUpload.scala | Scala | unlicense | 508 |
/*
* Copyright 2009-2014 LinkedIn, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | linkedin/norbert | network/src/test/scala/com/linkedin/norbert/network/partitioned/loadbalancer/DefaultClusteredLoadBalancerFactorySpec.scala | Scala | apache-2.0 | 9,544 |
package uk.co.sprily
package btf.webjs
import scala.concurrent.duration.FiniteDuration
import scala.scalajs.js
import scala.scalajs.js.Date
import scala.scalajs.js.typedarray.ArrayBuffer
import monifu.reactive._
import monifu.reactive.channels._
import org.scalajs.dom
import upickle._
sealed trait WSState
case ob... | sprily/brush-training | web-js/src/main/scala/WS.scala | Scala | gpl-3.0 | 4,179 |
/*
* 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 ... | WilliamDo/ignite | modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala | Scala | apache-2.0 | 1,713 |
package com.twitter.concurrent
import org.scalatest.FunSuite
import org.scalatest.concurrent.Eventually
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import com.twitter.util.{Promise, Await}
import com.twitter.conversions.time._
@RunWith(classOf[JUnitRunner])
class LocalSchedulerTest extends ... | mosesn/util | util-core/src/test/scala/com/twitter/concurrent/SchedulerTest.scala | Scala | apache-2.0 | 1,599 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package expr
import _root_.org.jetbrains.plugins.scala.lang.resolve.ScalaResolveResult
import com.intellij.lang.ASTNode
import com.intellij.openapi.util.TextRange
import com.intellij.psi._
import com.intellij.psi.util.PsiTreeUtil
import com.inte... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScSuperReferenceImpl.scala | Scala | apache-2.0 | 6,469 |
package com.realizationtime.btdogg.tcphashes
import akka.actor.{Actor, ActorLogging, ActorRef, ActorSystem, Props}
import akka.stream.{Materializer, OverflowStrategy}
import akka.stream.scaladsl.{Flow, Sink, Source, Tcp}
import com.realizationtime.btdogg.BtDoggConfiguration.TcpHashSourceConfig
import com.realizationti... | bwrega/btdogg | src/main/scala/com/realizationtime/btdogg/tcphashes/TcpHashesSource.scala | Scala | mit | 3,365 |
/*
* Copyright 2016-2017 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... | uts-cic/tap | src/main/scala/tap/analysis/languagetool/Languages.scala | Scala | apache-2.0 | 867 |
package com.acrussell.lambda
sealed abstract class Expression
case class Identifier(identifier: String) extends Expression
case class Abstraction(identifier: Identifier, expression: Expression) extends Expression
case class Application(e1: Expression, e2: Expression) extends Expression
| euclio/scala-lambda | src/main/scala/IntermediateRepresentation.scala | Scala | mit | 289 |
package org.automanlang.core.logging.tables
import java.util.UUID
import org.automanlang.core.info.QuestionType._
import scala.slick.driver.H2Driver.simple._
object DBQuestion {
val questionTypeMapper =
MappedColumnType.base[QuestionType, Int](
{
case CheckboxQuestion => 0
case CheckboxDistribut... | dbarowy/AutoMan | libautoman/src/main/scala/org/automanlang/core/logging/tables/DBQuestion.scala | Scala | gpl-2.0 | 1,436 |
/*
* Copyright 2015 Nicolas Rinaudo
*
* 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... | nrinaudo/scala-csv | generic/shared/src/test/scala/kantan/csv/generic/RegressionTests.scala | Scala | mit | 1,287 |
package webapp
import derive.key
case class DealWrapperDAO(@key("status") status: String,
@key("deal") deal: DealDAO)
case class DealDAO(@key("uid") uid: String,
@key("left") left: Int,
@key("right") right: Int)
case class DishDAO(@key("name") title: String,
@key("image") image: String,
... | pikkle/FoodMatch | client/src/main/scala/webapp/DAO.scala | Scala | apache-2.0 | 394 |
package au.com.agiledigital.rest.controllers.transport
import java.net.InetAddress
import java.security.cert.X509Certificate
import play.api.libs.typedmap.TypedMap
import play.api.mvc.request.{ RemoteConnection, RequestTarget }
import play.api.mvc.{ Headers, RequestHeader }
/**
* Empty request header implementatio... | agiledigital/play-rest-support | core/src/main/scala/au/com/agiledigital/rest/controllers/transport/EmptyRequestHeader.scala | Scala | apache-2.0 | 883 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2016 Matthias Langer ([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.apa... | bashimao/ltudl | blaze/src/main/scala/edu/latrobe/blaze/batchpools/Repeat.scala | Scala | apache-2.0 | 4,859 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package utils
import scala.annotation.implicitNotFound
@implicitNotFound("No implicit debug section found in scope. You need define an implicit DebugSection to use debug/ifDebug")
sealed abstract class DebugSection(val name: String, val mask: Int)
case object De... | regb/leon | src/main/scala/leon/utils/DebugSections.scala | Scala | gpl-3.0 | 2,193 |
/**
* Original work: SecureSocial (https://github.com/jaliss/securesocial)
* Copyright 2013 Jorge Aliss (jaliss at gmail dot com) - twitter: @jaliss
*
* Derivative work: Silhouette (https://github.com/mohiva/play-silhouette)
* Modifications Copyright 2015 Mohiva Organisation (license at mohiva dot com)
*
* Licen... | cemcatik/play-silhouette | silhouette/app/com/mohiva/play/silhouette/impl/providers/OAuth2Provider.scala | Scala | apache-2.0 | 10,354 |
package com.github.vooolll.serialization
import com.typesafe.scalalogging.LazyLogging
import com.github.vooolll.domain.oauth.FacebookError.FacebookErrorType
import com.github.vooolll.domain.oauth._
import io.circe._
import io.circe.Decoder._
import FacebookError._
object FacebookErrorCodeDecoders extends LazyLogging ... | vooolll/facebook4s | src/main/scala/com/github/vooolll/serialization/FacebookErrorCodeDecoders.scala | Scala | apache-2.0 | 1,529 |
/*
* 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/CP108.scala | Scala | apache-2.0 | 945 |
object Main extends App {
val source = scala.io.Source.fromFile(args(0))
val lines = source.getLines.filter(_.length > 0)
for (l <- lines)
println(BigInt(l).bitCount % 3)
}
| nikai3d/ce-challenges | moderate/predict_the_number.scala | Scala | bsd-3-clause | 184 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | cheeseng/scalatest | scalatest-test/src/test/scala/org/scalatest/ShouldBeShorthandForAllSpec.scala | Scala | apache-2.0 | 46,600 |
package lila.tv
import chess.Color
import scala.concurrent.duration._
import scala.concurrent.Promise
import lila.common.LightUser
import lila.game.Game
import lila.hub.SyncActor
final private[tv] class ChannelSyncActor(
channel: Tv.Channel,
onSelect: TvSyncActor.Selected => Unit,
proxyGame: Game.ID => F... | luanlv/lila | modules/tv/src/main/ChannelSyncActor.scala | Scala | mit | 3,929 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | tdanford/bdg-utils | utils-minhash/src/main/scala/org/bdgenomics/utils/minhash/MinHashSignature.scala | Scala | apache-2.0 | 3,896 |
/** Copyright 2014 TappingStone, 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 ... | TheDataShed/PredictionIO | engines/src/main/scala/base/PEventsDataSource.scala | Scala | apache-2.0 | 7,812 |
package services.elasticsearch.elastic4s
import java.nio.charset.Charset
import com.sksamuel.elastic4s.http.{JacksonSupport, ResponseHandler}
import org.apache.http.HttpEntity
import org.elasticsearch.client.{Response, ResponseException}
import play.api.libs.json.{JsValue, Json}
import scala.io.{Codec, Source}
impor... | MUSIT-Norway/musit | service_backend/app/services/elasticsearch/elastic4s/MusitResponseHandler.scala | Scala | gpl-2.0 | 1,731 |
/*
* 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/main/scala/org/apache/flink/table/plan/cost/FlinkCostFactory.scala | Scala | apache-2.0 | 1,638 |
/*
Copyright 2013 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | rangadi/summingbird | summingbird-example/src/main/scala/com/twitter/summingbird/example/Serialization.scala | Scala | apache-2.0 | 3,049 |
package jgo.tools.compiler
package interm
package expr
package bfunc
import types._
import instr._
import codeseq.CodeBuilder
object Make extends BuiltinTypeFunc {
def name = "make"
private def intCode(e: Expr, desc: String)(pos: Pos): Err[CodeBuilder] = e match {
case UntypedIntegralConst(i) => result(P... | thomasmodeneis/jgo | src/src/main/scala/jgo/tools/compiler/interm/expr/bfunc/Make.scala | Scala | gpl-3.0 | 1,858 |
/*
* Copyright 2007-2010 WorldWide Conferencing, LLC
*
* 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... | jeppenejsum/liftweb | examples/example/src/main/scala/bootstrap/liftweb/Boot.scala | Scala | apache-2.0 | 10,685 |
package scala.scalajs.runtime
import scala.scalajs.js
import StackTrace.JSStackTraceElem
/** Information about the JavaScript environment Scala.js runs in.
*
* Holds configuration for the Scala.js internals and should not be used
* directly (could be retrieved via [[runtime.environmentInfo]]).
*
* This facad... | CapeSepias/scala-js | library/src/main/scala/scala/scalajs/runtime/EnvironmentInfo.scala | Scala | bsd-3-clause | 1,673 |
package io.fintrospect.parameters
import com.twitter.finagle.http.{Message, Request}
trait HeaderParameter[T]
extends Parameter with Rebindable[Message, T, RequestBinding] {
override val where = "header"
}
object HeaderExtractAndRebind extends ParameterExtractAndBind[Message, String, RequestBinding] {
def new... | daviddenton/fintrospect | core/src/main/scala/io/fintrospect/parameters/HeaderParameter.scala | Scala | apache-2.0 | 686 |
package io.iohk.ethereum.rlp
import java.nio.ByteBuffer
import scala.annotation.{switch, tailrec}
import scala.collection.immutable.Queue
/**
* Recursive Length Prefix (RLP) encoding.
* <p>
* The purpose of RLP is to encode arbitrarily nested arrays of binary data, and
* RLP is the main encoding method used ... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/rlp/RLP.scala | Scala | mit | 10,932 |
package org.igye.logic.predicates.common
import org.igye.logic.Predicate
case class eqTo(left: Predicate, right: Predicate) extends Predicate(left, right) {
override def copy(orderedChildren: List[Predicate]): eqTo = eqTo(orderedChildren(0), orderedChildren(1))
override def toString: String = s"$left ==> $r... | Igorocky/logicproc | src/main/scala/org/igye/logic/predicates/common/eqTo.scala | Scala | mit | 327 |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribute... | wvlet/airframe | airframe-sql/src/main/scala/wvlet/airframe/sql/model/LogicalPlan.scala | Scala | apache-2.0 | 18,249 |
/*
* Copyright (c) 2010 by Alexander Grünewald
*
* This file is part of gruenewa-grid, a grid computing runtime.
*
* gruenewa-grid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of th... | gruenewa/gruenewa-grid | src/main/scala/gruenewa/grid/Server.scala | Scala | gpl-3.0 | 4,317 |
package org.jetbrains.plugins.scala.failed.annotator
import org.jetbrains.plugins.scala.PerfCycleTests
import org.jetbrains.plugins.scala.annotator.OverridingAnnotatorTestBase
import org.junit.experimental.categories.Category
/**
* Created by mucianm on 22.03.16.
*/
@Category(Array(classOf[PerfCycleTests]))
class... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/failed/annotator/OverridingAnnotatorTest.scala | Scala | apache-2.0 | 3,604 |
/*
* Copyright (c) 2012-2019 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.apach... | RetentionGrid/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/utils/ConversionUtils.scala | Scala | apache-2.0 | 18,462 |
package com.verizon.trapezium.api.akkahttp.utils
import com.typesafe.config.ConfigFactory
/**
* Created by chundch on 4/25/17.
*/
object HttpServicesConstants {
lazy val REQUEST_SIZE_LIMIT = 100 * 1024 * 1024
lazy val LIVE_STATUS_MSG = "Live!"
lazy val HTTPS_PROTOCAL = "https://"
lazy val HTTP_PROTOCOL ... | Verizon/trapezium | api-akkahttp/src/main/scala/com/verizon/trapezium/api/akkahttp/utils/HttpServicesConstants.scala | Scala | apache-2.0 | 1,320 |
package genericFunctionRDD.impl
import genericFunctionRDD.SpatialRDDPartition
import org.apache.spark.Logging
import com.newbrightidea.util.RTree
import scala.collection.mutable.ArrayBuffer
import scala.reflect.ClassTag
/**
* Created by merlin on 2/9/16.
*/
class RtreePartition [K, V]
(protected val tree: RTree[V... | merlintang/genericFunctionOverSpark | src/main/scala/genericFunctionRDD/impl/RtreePartition.scala | Scala | apache-2.0 | 2,542 |
package server
import java.io._
import java.net._
/**
* Represents a user, as viewed from the server. Users should be unique by username.
* A user is only authenticated by socket connection while online, and once offline
* the user no longer exists.
*/
class User(userSocket: Socket, val username: String, inFromCl... | Berthur/Chat | src/server/User.scala | Scala | gpl-3.0 | 3,361 |
package com.github.mdr.mash.ns.collections
import com.github.mdr.mash.functions.{ BoundParams, MashFunction, Parameter, ParameterModel }
import com.github.mdr.mash.runtime.MashList
object ChunkedFunction extends MashFunction("collections.chunked") {
object Params {
val Size = Parameter(
nameOpt = Some("s... | mdr/mash | src/main/scala/com/github/mdr/mash/ns/collections/ChunkedFunction.scala | Scala | mit | 1,375 |
/*
* 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/src/main/scala/org/apache/flink/table/sources/tsextractors/ExistingField.scala | Scala | apache-2.0 | 2,872 |
/**
* Copyright (C) 2011 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... | orbeon/orbeon-forms | xforms-runtime/shared/src/main/scala/org/orbeon/oxf/xforms/processor/handlers/xhtml/XHTMLHeadHandler.scala | Scala | lgpl-2.1 | 8,291 |
package cz.jenda.pidifrky.data.dao
import cz.jenda.pidifrky.data.pojo.{Card, Merchant}
import cz.jenda.pidifrky.data.{CardsTable, MerchantsTable}
/**
* @author Jenda Kolena, [email protected]
*/
sealed trait InsertCommand {
def query: String
def args: Array[AnyRef]
}
case class CardInsertCommand(card: Car... | jendakol/pidifrky | client/src/main/scala/cz/jenda/pidifrky/data/dao/insertcommands.scala | Scala | apache-2.0 | 1,901 |
package fr.acinq.bitcoin
import fr.acinq.bitcoin.Crypto._
import scodec.bits.ByteVector
import java.io.{ByteArrayInputStream, ByteArrayOutputStream, InputStream, OutputStream}
import scala.annotation.tailrec
import scala.collection.mutable.ArrayBuffer
/**
* script execution flags
*/
object ScriptFlags {
val SCRI... | ACINQ/bitcoin-lib | src/main/scala/fr/acinq/bitcoin/Script.scala | Scala | apache-2.0 | 58,954 |
package camelinaction
import akka.actor.Actor._
import akka.camel._
/**
* @author Martin Krasser
*/
object SectionE4 extends Application {
import SampleActors._
val service = CamelServiceManager.startCamelService
val httpConsumer2 = actorOf[HttpConsumer2]
val httpProducer1 = actorOf[HttpProducer1].start
... | sprklinginfo/camelinaction2 | old_chapters/appendixE/src/main/scala/SectionE4.scala | Scala | apache-2.0 | 1,011 |
package fpinscala
import fpinscala.datastructures._
object Ch03 {
val a = List(1, 2, 3, 4, 5) match {
case Cons(x, Cons(2, Cons(4, _))) => x
case Nil => 42
case Cons(x, Cons(y, Cons(3, Cons(4, _)))) => x + y
case Cons(h, t) => h + List.sum(t)
case _ => 101
}
def main(args: Array[String]): U... | mebubo/fpinscala | exercises/src/main/scala/fpinscala/Ch03.scala | Scala | mit | 349 |
package org.jetbrains.plugins.scala.lang.rearranger
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi.codeStyle.arrangement.std.StdArrangementTokens.EntryType._
import com.intellij.psi.codeStyle.arrangement.std.StdArrangementTokens.Modifier._
import com.intellij.psi.codeStyle.arrangement.std.{Ar... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/rearranger/RearrangerUtils.scala | Scala | apache-2.0 | 5,659 |
/*
* Copyright 2014 Alan Rodas Bonjour
*
* 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 ... | alanrodas/scaland | cli/src/test/scala/com/alanrodas/scaland/cli/BuildersSpec.scala | Scala | apache-2.0 | 29,738 |
package scutil.lang
import scutil.lang.tc._
// TODO 213 PartialFunction will have unapply there, do we still need this?
object Extractor {
def total[S,T](func:S=>T):Extractor[S,T] =
Extractor(s => Some(func(s)))
def partial[S,T](func:PartialFunction[S,T]):Extractor[S,T] =
Extractor(func.lift)
def filtered[T]... | ritschwumm/scutil | modules/core/src/main/scala/scutil/lang/Extractor.scala | Scala | bsd-2-clause | 2,026 |
import scala.quoted._
object MacroRuntime {
def impl()(using q: Quotes): Expr[Unit] = {
import quotes.reflect._
report.error("some error", Position.ofMacroExpansion)
'{ println("Implementation in MacroCompileError") }
}
}
| dotty-staging/dotty | sbt-test/source-dependencies/macro-expansion-dependencies-2/changes/MacroRuntimeCompileError.scala | Scala | apache-2.0 | 249 |
package chapter08
object CodeReduction {
def main(args: Array[String]): Unit = {
val nos = List(-11, 10, -2, 5, 25, -32, 55)
//filtering the list
println(nos.filter((x: Int) => x > 0))
//target typing in the filter
println(nos.filter(x => x > 0))
//using _ instead of variable(placeholder s... | aakashmathai/ScalaTutorial | src/main/scala/chapter08/CodeReduction.scala | Scala | apache-2.0 | 483 |
package wow.realm.events
import scodec.bits.BitVector
import wow.realm.entities.CharacterRef
import wow.realm.protocol.payloads.ClientMovement
import scala.collection.mutable
/**
* World events
*/
sealed trait WorldEvent
case class PlayerJoined(character: CharacterRef) extends WorldEvent
case class Tick(number... | SKNZ/SpinaciCore | wow/core/src/main/scala/wow/realm/events/WorldEvent.scala | Scala | mit | 588 |
/*
* 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 ... | hortonworks-spark/cloud-integration | cloud-examples/src/test/scala/org/apache/spark/sql/hive/orc/abfs/AbfsOrcPartitionSuite.scala | Scala | apache-2.0 | 1,228 |
package mesosphere.marathon
package api
import java.util.concurrent.atomic.AtomicInteger
import javax.inject.Provider
import akka.event.EventStream
import mesosphere.AkkaUnitTestLike
import mesosphere.marathon.core.group.GroupManagerModule
import mesosphere.marathon.state.RootGroup
import mesosphere.marathon.storage.... | janisz/marathon | src/test/scala/mesosphere/marathon/api/TestGroupManagerFixture.scala | Scala | apache-2.0 | 1,593 |
package com.catinthedark.yoba.records
import scala.math.Ordering.FloatOrdering
/**
* Created by over on 23.08.15.
*/
case class Record(time: Int, name: String, country: String) extends Ordered[Record] {
val floatOrdering = new FloatOrdering {}
override def compare(that: Record): Int =
floatOrdering.compare(... | cat-in-the-dark/old48_33_game | src/main/scala/com/catinthedark/yoba/records/Record.scala | Scala | mit | 339 |
package com.lyrx.latex
import java.io.File
import com.lyrx.text.{Context, GenBase, StringSerializer}
/**
* Created by alex on 28.12.16.
*/
trait LaTeXOutputter {
val generator:GenBase[String]
def assertLaTeX(output: Either[File, String]) = output match {
case Left(aFile: File) => println ("Wrote " +aFi... | lyrx/lyrxgenerator | src/main/scala/com/lyrx/latex/LaTeXOutputter.scala | Scala | gpl-3.0 | 856 |
package priv.sp.house
import priv.sp._
import priv.sp.CardSpec._
import priv.sp.GameCardEffect._
import priv.sp.update.{SlotUpdate, PlayerUpdate}
import priv.util.FuncDecorators
object Kinetician extends ChangeTarget {
val manipulator = new Creature("kinetician.manipulator", Attack(3), 28,
I18n("kinetician.man... | illim/freespectrogdx | core/src/main/scala/priv/sp/house/Kinetician.scala | Scala | gpl-3.0 | 5,726 |
package fpinscala.state2
trait RNG {
def nextInt: (Int, RNG)
}
case class SimpleRNG(seed: Long) extends RNG {
def nextInt: (Int, RNG) = {
val newSeed = (seed * 0x5DEECE66DL + 0xBL) & 0xFFFFFFFFFFFFL
val nextRNG = SimpleRNG(newSeed)
val n = (newSeed >>> 16).toInt
(n, nextRNG)
}
}
object RNG {
... | mebubo/fpinscala | exercises/src/main/scala/fpinscala/state2/State.scala | Scala | mit | 1,132 |
/*
* OpenURP, Open University Resouce Planning
*
* Copyright (c) 2013-2014, OpenURP Software.
*
* OpenURP is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your ... | openurp/edu-attendance-core | attendance/src/main/scala/org/openurp/ws/services/teach/attendance/impl/BaseDataService.scala | Scala | gpl-3.0 | 3,538 |
package objsets
/**
* The interface used by the grading infrastructure. Do not change signatures
* or your submission will fail with a NoSuchMethodError.
*/
trait TweetSetInterface {
def incl(tweet: Tweet): TweetSet
def remove(tweet: Tweet): TweetSet
def contains(tweet: Tweet): Boolean
def foreach(f: Tweet ... | rusucosmin/courses | fp/4-object-oriented-sets-rusucosmin/src/main/scala/objsets/TweetSetInterface.scala | Scala | mit | 439 |
import scala.quoted._
import scala.quoted.autolift
object Macros {
implicit inline def withSource(arg: Any): (String, Any) = ${ impl('arg) }
private def impl(arg: Expr[Any])(using qctx: QuoteContext) : Expr[(String, Any)] = {
import qctx.tasty._
val source = arg.unseal.underlyingArgument.pos.sourceCode.t... | som-snytt/dotty | tests/run-macros/tasty-original-source/Macros_1.scala | Scala | apache-2.0 | 364 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | andrewor14/iolap | sql/core/src/main/scala/org/apache/spark/sql/execution/SQLExecution.scala | Scala | apache-2.0 | 4,443 |
// Copyright 2017 EPFL DATA Lab (data.epfl.ch)
//
// 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... | epfldata/squid | core/src/main/scala/squid/utils/Lazy.scala | Scala | apache-2.0 | 1,636 |
package org.jetbrains.plugins.scala.util
object JvmOptions {
def addOpens(modulePackageList: String*): Seq[String] =
modulePackageList.flatMap { modulePackage =>
Seq("--add-opens", s"$modulePackage=ALL-UNNAMED")
}
}
| JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/util/JvmOptions.scala | Scala | apache-2.0 | 234 |
/**
* Created on: Dec 7, 2013
*/
package com.iteamsolutions.angular.models.atom
/**
* The '''Person''' type is the Domain Object Model reification of the
* [[http://www.ietf.org/rfc/rfc4287.txt Person]] concept.
*
* @author svickers
*
*/
trait Person
{
/// Instance Properties
def name : String;
def uri : O... | osxhacker/angular-codegen | src/main/scala/com/iteamsolutions/angular/models/atom/Person.scala | Scala | bsd-2-clause | 361 |
package uk.org.nbn.nbnv.importer.validation
import uk.org.nbn.nbnv.importer.records.NbnRecord
import uk.org.nbn.nbnv.importer.fidelity.{ResultLevel, Result}
import uk.org.nbn.nbnv.importer.utility.StringParsing._
import collection.mutable.ListBuffer
//validate the "<D" date type
class Nbnv194Validator extends... | JNCC-dev-team/nbn-importer | importer/src/main/scala/uk/org/nbn/nbnv/importer/validation/Nbnv194Validator.scala | Scala | apache-2.0 | 1,020 |
package io.taig.android.monix.syntax
import io.taig.android.monix.operation
import monix.eval.Task
import scala.language.implicitConversions
trait task {
implicit def monixTaskSyntax[T](
task: Task[T]
): operation.task[T] = new operation.task[T](task)
implicit def monixTaskCompanionSyntax(
task: T... | Taig/Toolbelt | monix/src/main/scala/io/taig/android/monix/syntax/task.scala | Scala | mit | 424 |
/**
* 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... | tempbottle/kafka | core/src/test/scala/unit/kafka/integration/FetcherTest.scala | Scala | apache-2.0 | 2,949 |
package com.mogproject.mogami.core.state
import com.mogproject.mogami._
import com.mogproject.mogami.core.PieceConstant._
import com.mogproject.mogami.core.SquareConstant._
import com.mogproject.mogami.core.state.State.PromotionFlag._
import com.mogproject.mogami.util.Implicits._
import com.mogproject.mogami.util.MapU... | mogproject/mog-core-scala | shared/src/test/scala/com/mogproject/mogami/core/state/StateSpec.scala | Scala | apache-2.0 | 60,166 |
package com.tbrown.twitterStream
import jsonz._
import org.joda.time.DateTime
case class User (
location: Option[String],
statusesCount: Int,
lang: String,
id: Long,
favouritesCount: Int,
description: Option[String],
name: String,
createdAt: DateTime,
followersCount: Int,
friendsCount: Int,
scree... | tbrown1979/Tweeper | src/main/scala/models/Tweet.scala | Scala | mit | 1,835 |
/*
* Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
*
* 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
*
* Unle... | telefonicaid/fiware-cosmos-platform | infinity/common/src/test/scala/es/tid/cosmos/infinity/common/util/TimeBoundTest.scala | Scala | apache-2.0 | 2,118 |
/*
* 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-elastic6/src/main/scala/com/datamountaineer/streamreactor/connect/elastic6/Transform.scala | Scala | apache-2.0 | 4,862 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | nevillelyh/algebird | algebird-bijection/src/main/scala/com/twitter/algebird/bijection/AlgebirdBijections.scala | Scala | apache-2.0 | 3,615 |
package org.qirx.cms.elasticsearch.index
import play.api.libs.json.JsValue
import play.api.libs.json.JsObject
import org.qirx.cms.i18n.Messages
import scala.language.implicitConversions
import org.qirx.cms.metadata.PropertyMetadata
object Implicits {
import scala.language.implicitConversions
implicit def addMapp... | EECOLOR/play-cms | elasticsearch/src/main/scala/org/qirx/cms/elasticsearch/index/Implicits.scala | Scala | mit | 975 |
package ml.sparkling.graph.operators.algorithms.random.ctrw.processor
import ml.sparkling.graph.operators.algorithms.random.ctrw.factory.MessageFactory
import ml.sparkling.graph.operators.algorithms.random.ctrw.struct.{CTRWMessage, CTRWVertex}
import org.apache.spark.graphx._
import scala.reflect.ClassTag
/**
* Cr... | sparkling-graph/sparkling-graph | operators/src/main/scala/ml/sparkling/graph/operators/algorithms/random/ctrw/processor/CTRWProcessor.scala | Scala | bsd-2-clause | 2,329 |
/*
* 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/FilterOperator.scala | Scala | apache-2.0 | 1,965 |
package org.jetbrains.plugins.scala.failed.annotator
import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter
/**
* @author Anton Yalyshev
*/
class OverloadingBadCodeGreenTest extends ScalaLightCodeInsightFixtureTestAdapter {
override protected def shouldPass: Boolean = false
def test... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/failed/annotator/OverloadingBadCodeGreenTest.scala | Scala | apache-2.0 | 1,188 |
def forLoop {
println("For loop using java-style iteration")
println("argument size = " + args.length.toString)
for (i <- 0 until args.length) {
println(args(8))
}
}
forLoop
| skywind3000/language | scala/for_loop.scala | Scala | mit | 200 |
/**
* Digi-Lib - base library for Digi components
*
* Copyright (c) 2012-2014 Alexey Aksenov [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.... | ezh/digi-lib | src/main/scala/org/digimead/digi/lib/log/api/XMessage.scala | Scala | apache-2.0 | 1,051 |
package org.bitcoins.core.protocol.ln.currency
import org.bitcoins.core.currency.{CurrencyUnit, Satoshis}
import org.bitcoins.core.number.{BasicArithmetic, UInt64}
import org.bitcoins.core.protocol.NetworkElement
import scodec.bits.ByteVector
import scala.math.BigDecimal.RoundingMode
/**
* The common currency unit... | bitcoin-s/bitcoin-s-core | core/src/main/scala/org/bitcoins/core/protocol/ln/currency/MilliSatoshis.scala | Scala | mit | 3,708 |
/**
* 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... | engagepoint/camel | components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/OnExceptionTest.scala | Scala | apache-2.0 | 3,220 |
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.