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.thisisfranklin.crdt
package collection
import com.thisisfranklin.crdt.numeric.MaximumLattice
object LMap {
def bottom[K, L <: Lattice[_, L]] = LMap[K, L](Map.empty)
}
case class LMap[K, L <: Lattice[_, L]](value: Map[K, L]) extends Lattice[Map[K, L], LMap[K, L]] {
def merge(other: LMap[K, L]): LMap[... | franklinhu/crdt | src/main/scala/com/thisisfranklin/crdt/collection/LMap.scala | Scala | apache-2.0 | 1,847 |
package akka.persistence.hbase.snapshot
import akka.actor.ActorLogging
import akka.persistence.{ SelectedSnapshot, SnapshotSelectionCriteria, SnapshotMetadata }
import akka.persistence.snapshot.SnapshotStore
import scala.concurrent.Future
class HadoopSnapshotStore extends SnapshotStore with ActorLogging {
val snap... | hossx/akka-persistence-hbase | src/main/scala/akka/persistence/hbase/snapshot/HadoopSnapshotStore.scala | Scala | apache-2.0 | 1,440 |
package dotty.tools
package dotc
package ast
import core._
import util.Positions._, Types._, Contexts._, Constants._, Names._, NameOps._, Flags._
import SymDenotations._, Symbols._, StdNames._, Annotations._, Trees._
import Decorators._
import language.higherKinds
import collection.mutable.ListBuffer
import config.Pri... | AlexSikia/dotty | src/dotty/tools/dotc/ast/Desugar.scala | Scala | bsd-3-clause | 38,584 |
package debop4s.data.slick3.schema
import java.sql.Timestamp
import debop4s.core.cryptography.RC2Encryptor
import debop4s.data.slick3.customtypes.EncryptedString
import org.joda.time.DateTime
/**
* SlickColumnMapper
* @author sunghyouk.bae@gmail.com 15. 3. 22.
*/
trait SlickColumnMapper {
self: SlickProfile =>
... | debop/debop4s | debop4s-data-slick3/src/main/scala/debop4s/data/slick3/schema/SlickColumnMapper.scala | Scala | apache-2.0 | 1,000 |
class A {
trait T[A]
def usetHk[T[_], A](ta: T[A]) = 0
usetHk(new T[Int]{}: T[Int])
usetHk(new T[Int]{}) // fails with: found: java.lang.Object with T[Int], required: ?T[ ?A ]
}
| yusuke2255/dotty | tests/untried/pos/t2693.scala | Scala | bsd-3-clause | 186 |
/*
* 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 ... | pkuwm/incubator-eagle | eagle-core/eagle-data-process/eagle-stream-process-base/src/main/scala/org/apache/eagle/datastream/StormStreamExecutor.scala | Scala | apache-2.0 | 2,607 |
package com.atomist.source.git.domain
import java.time.OffsetDateTime
import com.fasterxml.jackson.annotation.JsonProperty
case class Commit(url: String,
sha: String,
@JsonProperty("html_url") htmlUrl: String,
commit: CommitObject,
author: User,... | atomist/artifact-source | src/main/scala/com/atomist/source/git/domain/Commit.scala | Scala | gpl-3.0 | 585 |
package $organization$.$project$.server
import unfiltered.netty.Http
import $organization$.$project$.resources.$project;format="Camel"$Resource
import org.apache.commons.daemon.{DaemonContext, Daemon}
trait $project;format="Camel"$Config {
val port = 8889
}
object $project;format="Camel"$App extends App {
$proje... | mindcandy/unfiltered-rest-gatling.g8 | src/main/g8/$project__norm$-server/src/main/scala/$organization__packaged$/$project__packaged$/server/$project__Camel$App.scala | Scala | apache-2.0 | 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 ... | esi-mineset/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/python/ExtractPythonUDFs.scala | Scala | apache-2.0 | 8,557 |
package scala.lms
package common
import java.io.PrintWriter
import scala.reflect.SourceContext
trait LiftNumeric {
this: Base =>
implicit def numericToNumericRep[T:Numeric:Typ](x: T) = unit(x)
}
trait NumericOps extends Variables {
this: PrimitiveOps =>
// workaround for infix not working with manifests
... | TiarkRompf/virtualization-lms-core | src/common/NumericOps.scala | Scala | bsd-3-clause | 6,183 |
package org.template.similarproduct
import io.prediction.data.storage.BiMap
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.rdd.RDD
import org.apache.spark.mllib.recommendation.ALS
import org.apache.spark.mllib.recommendation.{Rating => MLlibRating}
import grizzled... | beni55/PredictionIO | examples/scala-parallel-similarproduct/multi/src/main/scala/LikeAlgorithm.scala | Scala | apache-2.0 | 3,666 |
///////////////////////////////////////////////////////////////////////////////
// WikiRelFreqs.scala
//
// Copyright (C) 2012 Mike Speriosu, The University of Texas at Austin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//... | utcompling/fieldspring | src/main/scala/opennlp/fieldspring/util/WikiRelFreqs.scala | Scala | apache-2.0 | 1,893 |
package org.jetbrains.plugins.scala.lang.parser.parsing.statements
import org.jetbrains.plugins.scala.ScalaBundle
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.parsing.params.Ty... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/parser/parsing/statements/TypeDcl.scala | Scala | apache-2.0 | 1,988 |
//
// Copyright 2011, Glen Ford
//
// Apache 2.0 License
// Please see README.md, LICENSE and NOTICE
//
import sbt._
class JettyEmbedPluginProject(info: ProjectInfo) extends PluginProject(info) with IdeaProject {
val publishTo = Resolver.file("sbt-jetty-embed-repo", new java.io.File("repo-out"))
val jetty6Vers... | glenford/sbt-jetty-embed | plugin/project/build/JettyEmbedPlugin.scala | Scala | apache-2.0 | 983 |
/*
* 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/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/EquivalentExpressions.scala | Scala | apache-2.0 | 7,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 ... | tophua/spark1.52 | mllib/src/test/scala/org/apache/spark/mllib/rdd/RDDFunctionsSuite.scala | Scala | apache-2.0 | 2,691 |
package org.jetbrains.plugins.scala.lang.psi.types.recursiveUpdate
import org.jetbrains.plugins.scala.lang.psi.types.api.{TypeParameterType, UndefinedType}
import org.jetbrains.plugins.scala.lang.psi.types.api.designator.{ScDesignatorType, ScThisType}
import org.jetbrains.plugins.scala.lang.psi.types.recursiveUpdate.A... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/types/recursiveUpdate/Substitution.scala | Scala | apache-2.0 | 1,095 |
package models
import play.api.libs.functional.syntax._
import play.api.libs.json.{JsPath, Writes}
case class Account(id: Option[Long],
emailAddress: Option[String],
password: Option[String],
linkedInAccountId: Option[String],
creationTimesta... | PanzerKunst/workdimension | website/app/models/Account.scala | Scala | gpl-3.0 | 692 |
/*
* 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 ... | gioenn/xSpark | sql/core/src/main/scala/org/apache/spark/sql/catalog/interface.scala | Scala | apache-2.0 | 4,491 |
/*
* 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... | liquidarmour/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frs105/boxes/AC415.scala | Scala | apache-2.0 | 1,103 |
object Solution extends App {
val n = readInt
//recommended
(1 to n).map(i => readLine.split(" ").map(_.toInt).sum).foreach(println)
/*
another way
for (i <- 1 to n) {
val Array(a, b) = readLine.split(" ").map(_.toInt)
println(a + b)
}
*/
}
| advancedxy/hackerrank | algorithms/warmup/SolveMeSecond.scala | Scala | mit | 264 |
package models.persistance
import models.Sample
import models.SampleTable
import play.api.db.slick.Config.driver.simple._
object SampleDAO {
val samples = TableQuery[SampleTable]
def getSampleFromId(id: Int) = { implicit session: Session =>
samples.filter(s => s.id === id).first
}
def createSamp... | seqprodbio/restoule | app/models/persistance/SampleDAO.scala | Scala | gpl-3.0 | 2,176 |
package org.scaladebugger.api.profiles.java.requests.watchpoints
import com.sun.jdi.event.ModificationWatchpointEvent
import org.scaladebugger.api.lowlevel.JDIArgument
import org.scaladebugger.api.lowlevel.events.EventManager
import org.scaladebugger.api.lowlevel.events.EventType.ModificationWatchpointEventType
import... | ensime/scala-debugger | scala-debugger-api/src/main/scala/org/scaladebugger/api/profiles/java/requests/watchpoints/JavaModificationWatchpointRequest.scala | Scala | apache-2.0 | 8,791 |
package com.laserfiche
import org.apache.predictionio.controller.OptionAverageMetric
import org.apache.predictionio.controller.EmptyEvaluationInfo
import org.apache.predictionio.controller.Evaluation
case class Precision(label: Double)
extends OptionAverageMetric[EmptyEvaluationInfo, Query, PredictedResult, ActualR... | michaelzzh/LF_PredictionIO | engines/baseGBRT/src/main/scala/PrecisionEvaluation.scala | Scala | apache-2.0 | 876 |
/*
Copyright 2013 Cristian Vrabie, Evelina Vrabie
This file is part of UKGist.
UKGist is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.... | CodeAndMagic/ukgist-server | src/main/scala/com/codeandmagic/ukgist/tools/PoliceKmlImport.scala | Scala | gpl-3.0 | 6,433 |
package org.eobjects.analyzer.beans.transform
import org.scalatest.junit.AssertionsForJUnit
import org.junit.Test
import org.junit.Assert
class RemoveUnwantedCharsTransformerTest extends AssertionsForJUnit {
@Test
def testTransform() = {
val trans = new RemoveUnwantedCharsTransformer()
Assert.assertEqual... | datacleaner/AnalyzerBeans | components/basic-transformers/src/test/scala/org/eobjects/analyzer/beans/transform/RemoveUnwantedCharsTransformerTest.scala | Scala | lgpl-3.0 | 915 |
/*
*************************************************************************************
* 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/main/scala/com/normation/rudder/services/path/PathComputer.scala | Scala | agpl-3.0 | 2,776 |
package org.firedancer3d.scenegraph.groupingnodes
class Group {
} | cyberthinkers/FireDancer3D | firedancer3d_shared/src/main/scala/org/firedancer3d/scenegraph/groupingnodes/Group.scala | Scala | mit | 71 |
package modelfunctions
class ModelFunctions {
// Checks whether weights is empty or not. If not, the function
// continues to build a new grammar based on the whether the first
// value in weights is equal to w
def updateGrammarGo(w: Double, weights: List[Double], newGrammar: List[Char]): List[Char] = {
we... | malancas/CUNY-CoLAG-Sims-2016-17 | Yang-weighted-model/src/main/scala/ModelFunctions.scala | Scala | gpl-3.0 | 2,744 |
/**
*
* UnpluggedSetupKeyCardActivity
* Ledger wallet
*
* Created by Pierre Pollastri on 16/09/15.
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Ledger
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), ... | LedgerHQ/ledger-wallet-android | app/src/main/scala/co/ledger/wallet/app/ui/unplugged/UnpluggedSetupKeyCardActivity.scala | Scala | mit | 5,539 |
package processes
import scala.concurrent.Future
import play.api.data.validation.ValidationError
import play.api.libs.json.JsPath
import play.api.libs.json.JsResult
import play.api.libs.json.JsValue
import play.api.libs.json.Json.obj
import play.api.mvc.Action
import play.api.mvc.AnyContent
import play.api.mvc.Request... | EECOLOR/scala-clean-code-patterns | src/main/scala/processes/PatchAssignment.scala | Scala | mit | 2,342 |
/*
* Copyright (C) FuseSource, Inc.
* http://fusesource.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 required by ... | janstey/fuse | sandbox/fabric-monitor/src/main/scala/org/fusesource/fabric/monitor/plugins/jmx/JmxDataSourceRegistry.scala | Scala | apache-2.0 | 3,650 |
/*
* Copyright ASCII Soup (Nils Luxton) (c) 2016.
*
* GNU GPL v3 - See LICENSE.txt for details
*/
package com.asciisoup.advent.DayFour
case class CircularList[T](list: List[T], startAt: T) {
private var index: Int = list.indexOf(startAt)
def next: T = {
if (index + 1 == list.length) {
index = -1
... | ascii-soup/AdventOfCode2016 | src/main/scala/com/asciisoup/advent/DayFour/CircularList.scala | Scala | gpl-3.0 | 476 |
package com.github.verhoevenv.fiasco.domain
case class Category(id: Int, name: String, pathToImg: String) {
}
| verhoevenv/fiasco | src/main/scala/com/github/verhoevenv/fiasco/domain/Category.scala | Scala | mit | 113 |
package de.tu_berlin.impro3.flink.spatio_temporal_dynamics.io
import java.io.IOException
import org.apache.flink.api.common.io.OutputFormat
import org.apache.flink.configuration.Configuration
import org.apache.hadoop.hbase._
import org.apache.hadoop.hbase.client._
import org.apache.hadoop.hbase.util.Bytes
class Loca... | joroKr21/spatio-temporal-dynamics | impro3-ws14-flink/src/main/scala/de/tu_berlin/impro3/flink/spatio_temporal_dynamics/io/LocationsOutputFormat.scala | Scala | apache-2.0 | 2,166 |
/*
* 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-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/RelShuttles.scala | Scala | apache-2.0 | 7,318 |
package slick.compiler
import slick.ast.Library.AggregateFunctionSymbol
import slick.SlickTreeException
import slick.ast._
import slick.ast.QueryParameter.constOp
import slick.ast.Util._
import slick.ast.TypeUtil._
import slick.util.{ConstArray, Ellipsis}
/** This phase merges nested nodes of types Bind, Filter, Grou... | nafg/slick | slick/src/main/scala/slick/compiler/MergeToComprehensions.scala | Scala | bsd-2-clause | 19,811 |
package com.timgroup.eventstore.api.legacy
import com.timgroup.eventstore.api._
import javax.annotation.ParametersAreNonnullByDefault
import scala.collection.JavaConverters._
/**
* @deprecated uaw LegacyMysqlEventSource instead
*/
@Deprecated
class LegacyEventStoreEventStreamWriterAdapter(eventstore: EventStore,... | tim-group/tg-eventstore | api-legacy/src/main/scala/com/timgroup/eventstore/api/legacy/LegacyEventStoreEventStreamWriterAdapter.scala | Scala | bsd-2-clause | 1,596 |
package org.mitre.mandolin.mselect
import java.util.concurrent.Executors
import akka.actor.{Props, ActorSystem}
import org.mitre.mandolin.mlp.{MMLPTrainerBuilder, MandolinMLPSettings, ANNetwork, MMLPFactor}
import org.mitre.mandolin.mselect.WorkPullingPattern.RegisterWorker
import org.mitre.mandolin.transform.Feature... | project-mandolin/mandolin | mandolin-core/src/main/scala/org/mitre/mandolin/mselect/ModelSelectionDriver.scala | Scala | apache-2.0 | 1,955 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/test/scala/org/apache/carbondata/view/plans/ModularToSQLSuite.scala | Scala | apache-2.0 | 4,416 |
package chapter4
import akka.actor.SupervisorStrategy.Resume
import akka.actor.{OneForOneStrategy, SupervisorStrategy, Actor, Props}
/**
* Created by y28yang on 1/29/2016.
*/
class LogProcSupervisor(dbSupervisorProps:Props) extends Actor{
//if file corrupted,keep deal the next msg
override def supervisor... | wjingyao2008/firsttry | myarchtype/src/main/scala/chapter4/LogProcSupervisor.scala | Scala | apache-2.0 | 734 |
/*
* 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 ... | SteamShon/incubator-s2graph | s2core/src/test/scala/org/apache/s2graph/core/S2EdgeTest.scala | Scala | apache-2.0 | 8,803 |
/*
* 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/ct600j/v2/J5.scala | Scala | apache-2.0 | 768 |
package preact.dsl
import preact.Preact
import scala.scalajs.js
package object symbol extends EntryImplicits {
implicit class SymbolOps(val self: Symbol) extends AnyVal {
def apply(): Preact.VNode = {
Preact.raw.h(self.name, null)
}
def apply(entries: Entry*): Preact.VNode = {
val zeroAc... | LMnet/scala-js-preact | dsl/symbol/src/main/scala/preact/dsl/symbol/package.scala | Scala | mit | 1,256 |
/**
* Copyright (c) Lambda Innovation, 2013-2016
* This file is part of LambdaLib modding library.
* https://github.com/LambdaInnovation/LambdaLib
* Licensed under MIT, see project root for more information.
*/
package cn.lambdalib.vis.editor
import java.lang.reflect.{Modifier, Field}
import cn.lambdalib.cgui.gui.Wid... | LambdaInnovation/LambdaLib | src/editor/scala/cn/lambdalib/vis/editor/ObjectEditor.scala | Scala | mit | 5,624 |
/**
* Main program for the Klondike Solitaire game.
*
* @author Joe Carnahan
*/
package solitaire
object Main {
def nl = System.getProperty("line.separator")
def main(args: Array[String]) = println(generateStats(100))
//def main(args: Array[String]) =
//for (size <- List(100, 150, 200, 250, 300, -1)... | joecarnahan/scalataire | src/main/scala/solitaire/Main.scala | Scala | mit | 641 |
package services
import models.{MatchResult, Match, User}
object PlayerService {
// ===== Interface =====
def findMostRecentOpponents(implicit user: User): Seq[String] = {
Match.findRecentForPlayer(user.name, 1).headOption match {
case Some(foosMatch) => MatchResult.findByMatch(foosMatch.id.get).map(_... | PriscH/Foosball | app/services/PlayerService.scala | Scala | gpl-3.0 | 375 |
/*
* This file is part of the \\BlueLaTeX 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 ... | tdurieux/bluelatex | blue-core/src/main/scala/gnieh/blue/core/impl/paper/ModifyPermissionsLet.scala | Scala | apache-2.0 | 3,950 |
/***********************************************************************
* Copyright (c) 2013-2017 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 ... | spandanagrawal/geomesa | geomesa-hbase/geomesa-hbase-datastore/src/test/scala/org/locationtech/geomesa/hbase/data/HBaseTestRunnerTest.scala | Scala | apache-2.0 | 2,092 |
// Copyright (c) 2013, Johns Hopkins University. All rights reserved.
// This software is released under the 2-clause BSD license.
// See /LICENSE.txt
// Travis Wolfe, twolfe18@gmail.com, 30 July 2013
package edu.jhu.hlt.parma.util
import edu.jhu.hlt.parma.types._
import edu.jhu.hlt.parma.diagnostics.GeneralDiagnost... | hltcoe/parma | src/main/scala/edu/jhu/hlt/parma/util/AnnotationAligner.scala | Scala | bsd-2-clause | 7,753 |
package com.twitter.util
import com.twitter.concurrent.Scheduler
import java.util.concurrent.atomic.AtomicBoolean
/**
* Wait for the result of some action. Awaitable is not used
* directly, but through the `Await` object.
*/
trait Awaitable[+T] {
import Awaitable._
/**
* Support for `Await.ready`. The use ... | mosesn/util | util-core/src/main/scala/com/twitter/util/Awaitable.scala | Scala | apache-2.0 | 3,818 |
/*
* Copyright (c) 2013 University of Massachusetts Amherst
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
package edu.umass.cs.iesl.bibmogrify.writer
import java.lang.String
import edu.umass.cs.iesl.bibmogrify.pipeline.Transformer
import edu.umass.cs.iesl.bibmog... | iesl/bibmogrify | src/main/scala/edu/umass/cs/iesl/bibmogrify/writer/BibTexWriter.scala | Scala | apache-2.0 | 3,369 |
package com.github.gdefacci.raz
trait FragmentAdd[A] {
type Out
def addFragment(a:A, fragment:String):Out
}
trait FragmentAddAux[A, O] extends FragmentAdd[A] {
final type Out = O
def addFragment(a:A, fragment:String):Out
}
object FragmentAdd {
import PathPosition._
private def app... | gdefacci/raz | raz/src/main/scala/com/github/gdefacci/raz/FragmentAdd.scala | Scala | mit | 2,447 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.mvc.request
import java.net.URI
/**
* The target of a request, as defined in RFC 7230 section 5.3, i.e. the URI or path that has been requested
* by the client.
*/
trait RequestTarget {
top =>
/**
* The parsed UR... | Shenker93/playframework | framework/src/play/src/main/scala/play/api/mvc/request/RequestTarget.scala | Scala | apache-2.0 | 3,510 |
package controllers
import org.specs2.specification.Scope
import com.overviewdocs.test.factories.{PodoFactory=>factory}
class NodeControllerSpec extends ControllerSpecification {
trait TestScope extends Scope {
val mockStorage = mock[NodeController.Storage]
val controller = new NodeController(mockStorage, ... | overview/overview-server | web/test/controllers/NodeControllerSpec.scala | Scala | agpl-3.0 | 1,270 |
package org.tuubes.core.tasks
import java.util.concurrent.TimeUnit
/**
* @author TheElectronWill
*/
trait DelayedTask extends CancellableTask {
def getDelay(unit: TimeUnit): Long
}
| mcphoton/Photon-Server | core/src/main/scala/org/tuubes/core/tasks/DelayedTask.scala | Scala | lgpl-3.0 | 187 |
/**
* 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... | eljefe6a/kafka | core/src/test/scala/unit/kafka/metrics/MetricsTest.scala | Scala | apache-2.0 | 3,685 |
/*
* 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/main/scala/com/cloudera/spark/cloud/common/StoreTestOperations.scala | Scala | apache-2.0 | 2,876 |
package org.scaladebugger.api.profiles.traits.requests.vm
import org.scaladebugger.api.lowlevel.JDIArgument
import org.scaladebugger.api.lowlevel.events.data.JDIEventDataResult
import org.scaladebugger.api.pipelines.Pipeline
import org.scaladebugger.api.pipelines.Pipeline.IdentityPipeline
import org.scaladebugger.api.p... | ensime/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/profiles/traits/requests/vm/VMStartRequestSpec.scala | Scala | apache-2.0 | 4,160 |
package com.github.kamekoopa.scacure
import org.joda.time.DateTime
import TransformStatus._
case class Girl(
identifier: String,
statuses: Map[State, String],
transformMessage: String,
currentState: State = Human,
createdDate: DateTime
) {
def name: String = {
statuses.get(currentState) match {
... | kamekoopa/scacure | src/main/scala/com/github/kamekoopa/scacure/Girl.scala | Scala | apache-2.0 | 1,015 |
package se.uu.farmbio.vs
import org.apache.spark.Logging
import org.apache.spark.broadcast.Broadcast
import openeye.oechem.OEFormat
import openeye.oechem.OEGraphMol
import openeye.oechem.OEMol
import openeye.oechem.OEUCharArray
import openeye.oechem.oechem
import openeye.oechem.oeistream
import openeye.oechem.oemolis... | laeeq80/spark-vs | vs/src/main/scala/se/uu/farmbio/vs/OEChemLambdas.scala | Scala | apache-2.0 | 5,054 |
package examples.demo
import java.awt.Color
import examples.demo.LFullyModularBall.BouncingBall
import examples.demo.MPlayingFieldBall.PlayingField
import examples.demo.ui.{Rectangle, Shape, ShapesPanel}
import rescala.default._
/** Lastly, we implement a Racket module, that implements a Rectangle
* positioned on ... | guidosalva/REScala | Code/Examples/examples/src/main/scala/examples/demo/ORacketMultiBall.scala | Scala | apache-2.0 | 2,982 |
/*
* (c) Copyright 2020 Micro Focus, L.P.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... | CloudSlang/cs-actions | cs-google/src/main/scala/io/cloudslang/content/google/actions/databases/sql/instances/StartSQLInstance.scala | Scala | apache-2.0 | 7,152 |
trait Resolver:
def resolve(label: String): Any
class ResolvingSelectable extends Selectable:
def selectDynamic(label: String)(using r: Resolver): Any =
r.resolve(label)
def applyDynamic(label: String)(args: Any*)(using r: Resolver): Any =
r.resolve(label).asInstanceOf[Any => Any].apply(args.head)
type ... | dotty-staging/dotty | tests/run/structural-contextual.scala | Scala | apache-2.0 | 755 |
/*
* Copyright 2015-2016 IBM Corporation
*
* 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... | CrowdFlower/incubator-openwhisk | tests/src/test/scala/services/PingTests.scala | Scala | apache-2.0 | 3,153 |
package filodb.core.store
import java.nio.ByteBuffer
import com.typesafe.scalalogging.StrictLogging
import kamon.Kamon
import monix.eval.Task
import monix.reactive.Observable
import filodb.core._
import filodb.core.memstore.{PartLookupResult, SchemaMismatch, TimeSeriesShard}
import filodb.core.metadata.{Schema, Sche... | tuplejump/FiloDB | core/src/main/scala/filodb.core/store/ChunkSource.scala | Scala | apache-2.0 | 8,406 |
package im.actor.server.api.rpc.service
import java.nio.file.{ Files, Paths }
import im.actor.server.file.ImageUtils
import scala.concurrent.Await
import scala.concurrent.duration._
import scalaz.-\\/
import com.sksamuel.scrimage.AsyncImage
import org.scalatest.Inside._
import im.actor.api.rpc._
import im.actor.ap... | liruqi/actor-platform | actor-server/actor-tests/src/test/scala/im/actor/server/api/rpc/service/ProfileServiceSpec.scala | Scala | mit | 8,097 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package impl
import api.FooService
import com.lightbend.lagom.scaladsl.api.ServiceCall
import scala.concurrent.Future
class FooServiceImpl extends FooService {
override def foo = ServiceCall { _ =>
Future.successful("ack foo")
}
}
| lagom/lagom | dev/sbt-plugin/src/sbt-test/sbt-plugin/akka-remote-in-dev/a/impl/src/main/scala/impl/FooServiceImpl.scala | Scala | apache-2.0 | 310 |
class B extends A2
| lampepfl/dotty | sbt-test/source-dependencies/class-based-inheritance/src/main/scala/B.scala | Scala | apache-2.0 | 19 |
package com.rzethon.marsexp.event
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import spray.json.DefaultJsonProtocol
trait EventMarshalling extends SprayJsonSupport with DefaultJsonProtocol {
import com.rzethon.marsexp.event.DevicesActor._
implicit val deviceInfoFormat = jsonFormat8(DeviceIn... | bmagrys/rzethon-mars-exped-stream | backend/src/main/scala/com/rzethon/marsexp/event/EventMarshalling.scala | Scala | mit | 326 |
package object core {
private[core] object Keyspaces {
val test = "testks"
}
private[core] object ColumnFamilies {
val test4 = "test4"
val test23 = "test23"
}
}
| instcode/cassandra-mapper | src/main/scala/core/package.scala | Scala | apache-2.0 | 184 |
/***********************************************************************
* 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... | jahhulbert-ccri/geomesa | geomesa-filter/src/main/scala/org/locationtech/geomesa/filter/Bounds.scala | Scala | apache-2.0 | 6,033 |
package app
import com.typesafe.config.ConfigFactory
import org.slf4j.{ Logger, LoggerFactory }
object Configs {
val c = ConfigFactory.load()
val interface = c.getString("app.interface")
val appPort = c.getInt("app.port")
val pgHost = c.getString("postgres.host")
val pgPort = c.getInt... | cfmcgrady/spray-akka-slick-postgres | src/main/scala/app/Configs.scala | Scala | mit | 503 |
/*
* 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 ... | michalsenkyr/spark | core/src/test/scala/org/apache/spark/shuffle/sort/ShuffleExternalSorterSuite.scala | Scala | apache-2.0 | 4,910 |
import _root_.io.gatling.core.scenario.Simulation
import ch.qos.logback.classic.{Level, LoggerContext}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
/**
* Performance test for the Author entity.
*/
class AuthorGatlingTest extends Si... | EnricoSchw/readthisstuff.com | src/test/gatling/simulations/AuthorGatlingTest.scala | Scala | mit | 3,393 |
/*
* Copyright 2022 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/iht-frontend | app/iht/controllers/registration/deceased/DeceasedPermanentHomeController.scala | Scala | apache-2.0 | 3,553 |
package com.twitter.inject.app.internal
import com.google.inject.{Guice, Module, Stage}
import com.twitter.app.{Flag, Flags}
import com.twitter.inject.{Injector, TwitterBaseModule}
import com.twitter.inject.conversions.iterable._
import scala.collection.JavaConverters._
private[app] object Modules {
/**
* De-du... | twitter/finatra | inject/inject-app/src/main/scala/com/twitter/inject/app/internal/Modules.scala | Scala | apache-2.0 | 4,555 |
package dotty.tools.dotc
import dotty.tools.FatalError
import config.CompilerCommand
import core.Contexts.{Context, ContextBase}
import util.DotClass
import reporting._
import scala.util.control.NonFatal
/** Run the Dotty compiler.
*
* Extending this class lets you customize many aspect of the compilation
* proc... | densh/dotty | src/dotty/tools/dotc/Driver.scala | Scala | bsd-3-clause | 5,503 |
/*
* 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/atlas | atlas-core/src/main/scala/com/netflix/atlas/core/norm/UpdateValueFunction.scala | Scala | apache-2.0 | 902 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.testsuite.jsinterop
impor... | scala-js/scala-js | test-suite/js/src/test/require-multi-modules/org/scalajs/testsuite/jsinterop/MultiExportsTest.scala | Scala | apache-2.0 | 1,431 |
/*
ASIB - A Scala IRC Bot
Copyright (C) 2012 Iain Cambridge
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later versio... | icambridge-old/asib | src/main/scala/asib/util/logger/LoggerAbstract.scala | Scala | gpl-3.0 | 800 |
package org.kiji.commons.scala
import com.google.common.base.Optional
import org.junit.Assert
import org.junit.Test
class TestJavaConverters {
private def testScalaToJava[T](
option: Option[T]
): Unit = {
import org.kiji.commons.scala.JavaConverters.OptionAsOptional
val optional: Optional[T] = opti... | iafek/kiji-base | kiji-commons/kiji-commons-scala/src/test/scala/org/kiji/commons/scala/TestJavaConverters.scala | Scala | apache-2.0 | 1,287 |
package org.scalarules.finance.nl
import org.scalatest.{FlatSpec, Matchers}
class PeriodeTest extends FlatSpec with Matchers {
val x = 5.maanden
val y = 2.maanden
it should "not accept a negative amount of months" in {
intercept[IllegalArgumentException] {
(-1).maand
}
}
it should "do addit... | scala-rules/finance-dsl | src/test/scala/org/scalarules/finance/nl/PeriodeTests.scala | Scala | mit | 2,157 |
/*
* 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 ... | bravo-zhang/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/LimitPushdownSuite.scala | Scala | apache-2.0 | 7,645 |
class A {
@JavaAnnot def foo: Int = 1
@ScalaAnnot def bar: Int = 1
}
| dotty-staging/dotty | sbt-test/source-dependencies/missing-annot/a/A.scala | Scala | apache-2.0 | 73 |
package scala.meta
package internal
package tokens
import scala.language.experimental.macros
import scala.annotation.StaticAnnotation
import scala.reflect.macros.whitebox.Context
import scala.collection.mutable.ListBuffer
import org.scalameta.internal.MacroHelpers
// @freeform and @fixed are specialized versions of @... | Dveim/scalameta | scalameta/common/src/main/scala/scala/meta/internal/tokens/token.scala | Scala | bsd-3-clause | 6,431 |
package it.agilelab.bigdata.spark.search.impl.analyzers
import it.agilelab.bigdata.spark.search.impl.LuceneConfig
/**
* Configurable analyzer for English which is aware of Wikipedia syntax.
*
* @author Nicolò Bidotti
*/
class EnglishWikipediaAnalyzer(cfg: LuceneConfig) extends ConfigurableAnalyzer(cfg) {
val ana... | agile-lab-dev/sparksearchengine | src/main/scala/it/agilelab/bigdata/spark/search/impl/analyzers/EnglishWikipediaAnalyzer.scala | Scala | apache-2.0 | 404 |
/*
* 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/atlas | atlas-core/src/main/scala/com/netflix/atlas/core/validation/HasKeyRule.scala | Scala | apache-2.0 | 2,107 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.persistence.testkit
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.Props
import akka.actor.actorRef2Scala
import akka.persistence.PersistentActor
import akka.testkit.ImplicitSe... | rcavalcanti/lagom | persistence/scaladsl/src/test/scala/com/lightbend/lagom/scaladsl/persistence/testkit/AbstractEmbeddedPersistentActorSpec.scala | Scala | apache-2.0 | 2,556 |
package dotty.tools
package dotc
import dotty.tools.dotc.core.Types.Type
import dotty.tools.dotc.core.tasty.{TastyUnpickler, TastyBuffer, TastyPickler}
import util.SourceFile
import ast.{tpd, untpd}
import dotty.tools.dotc.core.Symbols._
class CompilationUnit(val source: SourceFile) {
override def toString = sourc... | densh/dotty | src/dotty/tools/dotc/CompilationUnit.scala | Scala | bsd-3-clause | 814 |
package ml.combust.mleap.core.sklearn
import ml.combust.mleap.core.types.{StructField, TensorType}
import org.apache.spark.ml.linalg.Vectors
import org.scalatest.FunSpec
class PolynomialFeaturesModelSpec extends FunSpec {
val model = new PolynomialFeaturesModel("[x0,x1,x0^2,x0 x1,x1^2,x0^3,x0^2 x1,x0 x1^2,x1^3]")
... | combust/mleap | mleap-core/src/test/scala/ml/combust/mleap/core/sklearn/PolynomialFeaturesModelSpec.scala | Scala | apache-2.0 | 880 |
object Main {
def main(args: Array[String]) {
var expr1 = - 7 + 6 * 5 - 4 / 3 - 2; // 20
var expr2 = (7 + 6) * (5 - 4) / 3 - 2; // 2
var expr3 = 7 + 6 * (5 - 4 / (3 - 2)); // 13
var sum = expr1 % 8 + expr2 + expr3; // 19
print(sum); print("\\n")
}
}
| tobast/compil-petitscala | tests/exec/arith2.scala | Scala | gpl-3.0 | 282 |
/**
* TABuddy-Model - a human-centric K,V framework
*
* Copyright (c) 2012-2013 Alexey Aksenov ezh@ezh.msk.ru
*
* 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.apach... | digimead/digi-TABuddy-model | src/main/scala/org/digimead/tabuddy/model/element/Location.scala | Scala | apache-2.0 | 1,697 |
package io.reactors
import io.reactors.common.freshId
import io.reactors.concurrent._
import java.util.concurrent._
import java.util.concurrent.atomic.AtomicReference
import java.util.TimerTask
import scala.annotation.tailrec
import scala.collection._
import scala.concurrent.ExecutionContext
object JvmScheduler {... | storm-enroute/reactors | reactors-core/jvm/src/main/scala/io/reactors/JvmScheduler.scala | Scala | bsd-3-clause | 14,841 |
package com.twitter.finagle.buoyant.linkerd
import com.twitter.finagle.{Dtab => FDtab, Status => _, _}
import com.twitter.finagle.buoyant.{Dst => BuoyantDst}
import com.twitter.finagle.context.{Contexts, Deadline => FDeadline}
import com.twitter.finagle.http._
import com.twitter.finagle.tracing._
import com.twitter.ut... | hhtpcd/linkerd | linkerd/protocol/http/src/main/scala/com/twitter/finagle/buoyant/linkerd/LinkerdHeaders.scala | Scala | apache-2.0 | 16,279 |
// Copyright: 2010 - 2017 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/lgpl-3.0.en.html
package org.ensime.sexp.formats
import collection.generic.CanBuildFrom
import collection.breakOut
import collection.{ immutable => im }
import org.ensime.sexp._
import scala.collection.Gen... | pascr/ensime-server | s-express/src/main/scala/org/ensime/sexp/formats/CollectionFormats.scala | Scala | gpl-3.0 | 7,218 |
/**
* 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"... | KevinLiLu/kafka | core/src/test/scala/integration/kafka/server/ScramServerStartupTest.scala | Scala | apache-2.0 | 2,819 |
package org.eol.globi.traits
import java.io.StringWriter
import org.scalatest._
import play.api.libs.json._
import scala.io.Source
class TraitExtractorCLI$Test extends FlatSpec with Matchers {
"a request for eol taxa" should "return a list of page ids" in {
val rows: Array[String] = generateConsumerProviders... | jhpoelen/backwarden | src/test/scala/org/eol/globi/traits/TraitExtractorCLI$Test.scala | Scala | mit | 1,321 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package java.util
import scala.collection.mut... | nicolasstucki/scala-js | javalib/src/main/scala/java/util/Compat.scala | Scala | apache-2.0 | 1,775 |
package com.socrata.datacoordinator.common.soql.csvreps
import com.socrata.datacoordinator.truth.csv.CsvColumnRep
import com.socrata.soql.types.{SoQLValue, SoQLText, SoQLType}
object TextRep extends CsvColumnRep[SoQLType, SoQLValue] {
val size = 1
val representedType = SoQLText
def decode(row: IndexedSeq[Stri... | socrata-platform/data-coordinator | coordinatorlib/src/main/scala/com/socrata/datacoordinator/common/soql/csvreps/TextRep.scala | Scala | apache-2.0 | 449 |
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.