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.doanduyhai.elevator
import java.io.File
trait FileContentReader {
def readContentFromFile(filename: String):String = {
val classLoader = getClass().getClassLoader()
val file = new File(classLoader.getResource(filename).getFile())
val source = scala.io.Source.fromFile(file.getAbsolutePath)
... | doanduyhai/elevator-control-system | src/test/scala/com/doanduyhai/elevator/FileContentReader.scala | Scala | apache-2.0 | 409 |
package frameless
package ml
import org.scalacheck.Prop._
import org.apache.spark.ml.linalg._
import org.apache.spark.ml.regression.DecisionTreeRegressor
import Generators._
import scala.util.Random
class TypedEncoderInstancesTests extends FramelessMlSuite {
test("Vector encoding is injective using collect()") {
... | adelbertc/frameless | ml/src/test/scala/frameless/ml/TypedEncoderInstancesTests.scala | Scala | apache-2.0 | 1,568 |
/*
* 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 ... | WangTaoTheTonic/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/ScalarFunction.scala | Scala | apache-2.0 | 4,692 |
/**
* Copyright 2015, deepsense.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 applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | commons/src/main/scala/io/deepsense/commons/datetime/DateTimeConverter.scala | Scala | apache-2.0 | 2,017 |
package com.greencatsoft.d3.event
import scala.scalajs.js
import scala.scalajs.js.Any.jsArrayOps
import scala.scalajs.js.UndefOr
import scala.scalajs.js.UndefOr.undefOr2ops
import org.scalajs.dom.{ Event, Node }
import org.scalajs.dom.ext.Castable
import com.greencatsoft.d3.common.Point
import com.greencatsoft.d3.se... | greencatsoft/scalajs-d3 | src/main/scala/com/greencatsoft/d3/event/EventChain.scala | Scala | apache-2.0 | 1,598 |
/*
* Copyright 2014 nidkil
*
* 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 ... | nidkil/scala-downloader | src/main/scala/com/nidkil/downloader/splitter/Splitter.scala | Scala | apache-2.0 | 1,262 |
/*
* 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 ... | GJL/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/logical/rel/LogicalTableAggregate.scala | Scala | apache-2.0 | 2,076 |
/*
* Copyright 2014 – 2015 Paul Horn
*
* 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... | knutwalker/rx-redis | modules/client/src/main/scala/rx/redis/pipeline/RxChannelInitializer.scala | Scala | apache-2.0 | 1,416 |
/* Copyright 2009-2021 EPFL, Lausanne */
package stainless
package extraction
package termination
trait Trees extends extraction.Trees { self =>
case object Induct extends Flag("induct", Seq())
override def extractFlag(name: String, args: Seq[Expr]): Flag = (name, args) match {
case ("induct", Seq()) => Ind... | epfl-lara/stainless | core/src/main/scala/stainless/extraction/termination/Trees.scala | Scala | apache-2.0 | 1,350 |
package com.arcusys.valamis.certificate.storage
import com.arcusys.valamis.certificate.model.goal.CourseGoal
import com.arcusys.valamis.model.PeriodTypes
/**
* Created by mminin on 04.03.15.
*/
trait CourseGoalStorage {
def create(certificateId: Long,
courseId: Long,
periodValue: Int,
... | igor-borisov/valamis | valamis-certificate/src/main/scala/com/arcusys/valamis/certificate/storage/CourseGoalStorage.scala | Scala | gpl-3.0 | 675 |
package org.jetbrains.plugins.scala
package annotator
import com.intellij.codeInspection.ProblemHighlightType
import com.intellij.lang.annotation.HighlightSeverity
import com.intellij.psi.impl.source.tree.LeafPsiElement
import com.intellij.psi.{PsiElement, PsiErrorElement, PsiFile, PsiNamedElement}
import org.jetbrain... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/annotator/AnnotatorUtils.scala | Scala | apache-2.0 | 9,473 |
package fpinscala.exercises.monoids
import fpinscala.exercises.parallelism.Nonblocking.*
import language.higherKinds
trait Monoid[A]:
def combine(a1: A, a2: A): A
def empty: A
object Monoid:
val stringMonoid: Monoid[String] = new:
def combine(a1: String, a2: String) = a1 + a2
val empty = ""
def lis... | fpinscala/fpinscala | src/main/scala/fpinscala/exercises/monoids/Monoid.scala | Scala | mit | 2,190 |
/*
* Copyright 2011-2019 Asakusa Framework Team.
*
* 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 ... | ueshin/asakusafw-spark | compiler/src/main/scala/com/asakusafw/spark/compiler/operator/user/join/BroadcastMasterJoinOperatorCompiler.scala | Scala | apache-2.0 | 4,017 |
/*
* Copyright (C) 2014 AyaIB Developers (http://github.com/fauu/AyaIB)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. I... | fauu/AyaIB | app/context/AyaIBContext.scala | Scala | gpl-3.0 | 1,342 |
package framian.csv
case class Input(offset: Long, data: String, isLast: Boolean, mark: Long) {
private def check(i: Long): Int = if ((i < offset) || (i > (offset + data.length))) {
throw new IndexOutOfBoundsException()
} else {
val j = i - offset
if (j <= Int.MaxValue) {
j.toInt
} else {
... | codeaudit/framian | framian/src/main/scala/framian/csv/Input.scala | Scala | apache-2.0 | 1,304 |
package Problems
object p32 extends Problem {
val numbers = for {
a <- 2 to 100
b <- 2 to (10000 / a)
p = a * b
s = f"$a$b$p"
if s.length == 9
if (1 to 9).mkString.forall(s.contains(_))
} yield p
override def solve(): Long = numbers.distinct.sum
}
| catap/scala-euler | src/main/scala/Problems/p32.scala | Scala | unlicense | 281 |
package templemore.onx.version5
/**
* @author Chris Turner
*/
trait Lines {
this: TokensWithPositions =>
def lines = rows.toList ::: columns.toList ::: List(leftToRightDiagonal) ::: List(rightToLeftDiagonal)
private[this] def rows = buildLines((row: Int, position: Position) => position match {
case Posit... | skipoleschris/OandX | src/main/scala/templemore/onx/version5/Lines.scala | Scala | apache-2.0 | 1,108 |
/*
* 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 ... | USCDataScience/sparkler | project/Dependencies.scala | Scala | apache-2.0 | 3,926 |
package org.pfcoperez.cci.treesandgraphs
object FirstCommonAncestor extends App {
trait BinaryTree[+T]
case class Node[T](value: T, var leftFatherRight: (BinaryTree[T], BinaryTree[T], BinaryTree[T])) extends BinaryTree[T] {
def setFather(node: Node[T]): Unit = {
leftFatherRight = leftFatherRight.copy(_2... | pfcoperez/cci | src/main/scala/org/pfcoperez/cci/treesandgraphs/FirstCommonAncestor.scala | Scala | gpl-3.0 | 1,705 |
/*
* 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 ... | bdrillard/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/ForeachWriterTable.scala | Scala | apache-2.0 | 5,912 |
/**
* 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
* distributed ... | ksmpartners/ernie | ernie-server/src/main/scala/com/ksmpartners/ernie/server/JsonTranslator.scala | Scala | apache-2.0 | 2,496 |
package bad.robot.temperature.task
import java.util.concurrent.{ScheduledExecutorService, ScheduledFuture}
import bad.robot.logging._
import scala.concurrent.duration.Duration
object Scheduler {
implicit class ScheduledExecutorServiceOps(executor: ScheduledExecutorService) {
def schedule(frequency: Duration,... | tobyweston/temperature-machine | src/main/scala/bad/robot/temperature/task/Scheduler.scala | Scala | apache-2.0 | 1,101 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pronix/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala | Scala | apache-2.0 | 13,849 |
package main.java.piratebot.pirates
import main.java.piratebot._
class Carpenter(game: Game, player: Player) extends Pirate(game, player) {
val rank = 9
val name = "Carpenter"
override def dayAction(round : Round): RetriableMethodResponse.Value = {
player.doubloons = player.doubloons / 2 + player... | ItCouldHaveBeenGreat/Eyepatch | src/main/java/piratebot/pirates/carpenter.scala | Scala | gpl-3.0 | 716 |
package scalaxy.react
import org.scalajs.dom
import scala.scalajs.js
import js.annotation._
trait ReactClass extends js.Object
trait ReactElement extends js.Object
trait ReactComponent extends js.Object
trait ReactComponentThis extends js.Object {
def instance: Any = js.native
def instance_=(c: Any): Unit = js.n... | nativelibs4java/Scalaxy | Experiments/React/src/main/scala/scalaxy/react/ReactExterns.scala | Scala | bsd-3-clause | 887 |
package com.marmoush.scalasamples.underscore_advancedscala
object Dummy {
def main(args: Array[String]): Unit = {
val l = List(1, 3, 3, 5)
val l2 = List(2, 3, 4, 5)
l.map((i: Int) => println(i))(List.canBuildFrom)
}
}
| IsmailMarmoush/scala-samples | scalalang/src/main/scala/com/marmoush/scalasamples/underscore_advancedscala/Dummy.scala | Scala | agpl-3.0 | 237 |
package org.jetbrains.plugins.scala.lang.formatter.tests.scalafmt
trait UseConfig_2_7 extends ScalaFmtTestBase {
override def setUp(): Unit = {
super.setUp()
setScalafmtConfig("empty_config_2_7_5.conf")
scalaSettings.SCALAFMT_FALLBACK_TO_DEFAULT_SETTINGS = false
}
}
| JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/formatter/tests/scalafmt/UseConfig_2_7.scala | Scala | apache-2.0 | 286 |
package me.sgrouples.rogue
import org.bson.{BsonArray, BsonValue}
import scala.annotation.{StaticAnnotation, implicitNotFound}
@implicitNotFound("implicit BsonFormat not found for ${T}")
trait BsonFormat[T] {
def read(b: BsonValue): T
def readArray(b: BsonArray): Seq[T]
def write(t: T): BsonValue
def flds: M... | sgrouples/rogue-fsqio | bsonformats/src/main/scala/me/sgrouples/rogue/BsonFormats.scala | Scala | apache-2.0 | 850 |
package org.dsa.test
import org.apache.commons.lang.RandomStringUtils
import scala.util.Random
/**
* Created by xubo on 2016/10/31.
*/
object Test1 {
def main(args: Array[String]) {
println(1.compareTo(2))
println(produceRandomString(10))
}
def produceRandomString(length: Int): String = {
va... | xubo245/CloudSW | src/test/scala/org/dsa/test/Test1.scala | Scala | gpl-2.0 | 1,508 |
package com.twitter.inject.thrift.integration.modules
import com.twitter.finagle.thrift.MethodMetadata
import com.twitter.inject.Injector
import com.twitter.inject.thrift.modules.ReqRepDarkTrafficFilterModule
import com.twitter.test.thriftscala.EchoService
object DoEverythingThriftServerDarkTrafficFilterModule
ex... | twitter/finatra | inject/inject-thrift-client/src/test/scala/com/twitter/inject/thrift/integration/modules/DoEverythingThriftServerDarkTrafficFilterModule.scala | Scala | apache-2.0 | 714 |
package scorex.api.http.assets
import com.google.common.base.Charsets
import io.swagger.annotations.{ApiModel, ApiModelProperty}
import play.api.libs.functional.syntax._
import play.api.libs.json.{JsPath, Writes}
import scorex.crypto.encode.Base58
import scorex.transaction.assets._
/**
*/
object BroadcastResponses ... | B83YPoj/Waves | src/main/scala/scorex/api/http/assets/BroadcastResponses.scala | Scala | apache-2.0 | 8,844 |
package text.search
/**
* @author ynupc
* Created on 2016/08/21
*/
object ForwardDawgMatching extends Search {
override def indexOf[T](source: Array[T], target: Array[T]): Int = {
-1
}
override def indicesOf[T](source: Array[T], target: Array[T]): Array[Int] = {
Array()
}
}
| ynupc/scalastringcourseday6 | src/main/scala/text/search/ForwardDawgMatching.scala | Scala | apache-2.0 | 307 |
package com.boldradius.astrolabe.client.components.graph
import com.boldradius.astrolabe.client.d3.Layout._
import com.boldradius.astrolabe.client.d3._
import com.boldradius.astrolabe.client.domain._
import com.boldradius.astrolabe.client.modules._
import com.boldradius.astrolabe.client.services.ClusterService
import ... | boldradius/cluster-console | js/src/main/scala/com/boldradius/astrolabe/client/components/graph/Graph.scala | Scala | bsd-3-clause | 17,416 |
package com.seanshubin.learn.spark.core
// add dataframe/dataset example
class WordCounterImpl(pathSpecification: String,
resilientDistributedDatasetLoader: ResilientDistributedDatasetLoader,
notifications: Notifications) extends WordCounter {
override def calculateWordHis... | SeanShubin/learn-spark | core/src/main/scala/com/seanshubin/learn/spark/core/WordCounterImpl.scala | Scala | unlicense | 1,233 |
/**
* Copyright 2011-2017 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 appli... | timve/gatling | gatling-core/src/test/scala/io/gatling/core/test/BlockingExitAction.scala | Scala | apache-2.0 | 1,158 |
package io.udash.web.guide.views.ext
import io.udash._
import io.udash.css.CssView
import io.udash.web.commons.components.{CodeBlock, ForceBootstrap}
import io.udash.web.guide._
import io.udash.web.guide.styles.partials.GuideStyles
import io.udash.web.guide.views.ext.demo.{DynamicRemoteTranslationsDemo, FrontendTransl... | UdashFramework/udash-core | guide/guide/.js/src/main/scala/io/udash/web/guide/views/ext/I18NExtView.scala | Scala | apache-2.0 | 7,993 |
/**
* 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... | themarkypantz/kafka | core/src/test/scala/unit/kafka/coordinator/group/GroupMetadataTest.scala | Scala | apache-2.0 | 16,749 |
/*
* bytefrog: a tracing framework for the JVM. For more information
* see http://code-pulse.com/bytefrog
*
* Copyright (C) 2014 Applied Visions - http://securedecisions.avi.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
... | secdec/bytefrog-clients | common/src/main/scala/com/secdec/bytefrog/clients/common/data/processing/MethodIdProcessor.scala | Scala | apache-2.0 | 1,783 |
/*
* Copyright (C) 2015 Stratio (http://stratio.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 app... | Stratio/crossdata | core/src/main/scala/org/apache/spark/sql/crossdata/session/XDSessionProvider.scala | Scala | apache-2.0 | 6,594 |
/**
* Copyright (C) 2010-2011 LShift Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... | lshift/diffa | kernel/src/main/scala/net/lshift/diffa/kernel/frontend/DomainDef.scala | Scala | apache-2.0 | 930 |
package datacollector
import java.io.{ BufferedWriter, File, FileOutputStream, OutputStreamWriter }
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.zip.GZIPOutputStream
import akka.actor.{ Actor, Props }
import akka.event.Logging
/**
* Saves received strings to gzipped files.
*
* @aut... | emrecelikten/foursquare-data-collector | src/main/scala/datacollector/SaverActor.scala | Scala | gpl-3.0 | 1,858 |
/*
* 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 ... | markusthoemmes/openwhisk | core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorderTests.scala | Scala | apache-2.0 | 5,878 |
package org.bfn.ninetynineprobs
object P43 {
// TODO
}
| bfontaine/99Scala | src/main/scala/P43.scala | Scala | mit | 60 |
package rocks.muki.graphql.codegen
import org.scalatest.wordspec.AnyWordSpec
import org.scalatest.matchers.should.Matchers
import scala.meta._
class ScalametaUtilsSpec extends AnyWordSpec with Matchers {
"The ScalametaUtils" should {
"generate valid imports" when {
"a single member is imported" in {
... | muuki88/sbt-graphql | src/test/scala/rocks/muki/graphql/codegen/ScalametaUtilsSpec.scala | Scala | apache-2.0 | 1,193 |
/*
* 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 ... | daewon/incubator-s2graph | spark/src/main/scala/org/apache/s2graph/spark/spark/SubscriberListener.scala | Scala | apache-2.0 | 1,592 |
package net.liftweb {
package osgi {
import http.Bootable
/**
* Special Bootable for lift-osgi bundle: Do nothing!
*/
class OsgiBootable extends Bootable {
/** Do nothing! */
override def boot() {}
}
}
}
| lift/lift | framework/lift-modules/lift-osgi/src/main/scala/net/liftweb/osgi/OsgiBootable.scala | Scala | apache-2.0 | 214 |
package mesosphere.marathon.state
import mesosphere.marathon.MarathonSpec
class TimestampedTest extends MarathonSpec {
class A(val version: Timestamp = Timestamp.now) extends Timestamped
test("Ordering") {
val a1 = new A(Timestamp(1393989019980L))
val a2 = new A(Timestamp(1393989019981L))
val a3 = n... | HardikDR/marathon | src/test/scala/mesosphere/marathon/state/TimestampedTest.scala | Scala | apache-2.0 | 478 |
package streams
import common._
/**
* This trait represents the layout and building blocks of the game
*
* @TODO: SHOULD RENAME `x` and `y` in class Pos to `row` and `col`. It's
* confusing to have `x` being the vertical axis.
*/
trait GameDef {
/**
* The case class `Pos` encodes positions in the terrain.
... | juliengrimault/Scala-Class | streams/src/main/scala/streams/GameDef.scala | Scala | mit | 4,382 |
package biology
import org.apache.commons.math3.distribution.NormalDistribution
import locals.DistributionType.DistributionType
import locals.PelagicLarvalDurationType
import io.config._
import utilities.Time
import locals.Constants
class PelagicLarvalDuration(val config: PelagicLarvalDurationConfig) {
private val ... | shawes/zissou | src/main/scala/biology/PelagicLarvalDuration.scala | Scala | mit | 639 |
object Main {
def min0[A](less: (A, A) => Boolean, xs: List[A]): Option[A] = xs match {
case List() => None
case List(x) => Some(x)
case y :: ys => (min0(less, ys): @unchecked) match {
case Some(m) => if (less(y, m)) Some(y) else Some(m)
}
}
def min(xs: List[I... | yusuke2255/dotty | tests/pos/t0082.scala | Scala | bsd-3-clause | 442 |
/*
* Copyright (C) 2016 University of Basel, Graphics and Vision Research Group
*
* 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) an... | unibas-gravis/scalismo-ui | src/main/scala/scalismo/ui/view/perspective/ThreeDOnlyPerspective.scala | Scala | gpl-3.0 | 1,418 |
/*
* 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 ... | Dax1n/spark-core | core/src/main/scala/org/apache/spark/rdd/ParallelCollectionRDD.scala | Scala | apache-2.0 | 5,845 |
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt
package std
import Def.Initialize
import sbt.internal.util.Types.{ Id, idFun }
import sbt.internal.util.AList
import sbt.internal.util.appmacro.{
Convert,
Co... | xuwei-k/xsbt | main-settings/src/main/scala/sbt/std/SettingMacro.scala | Scala | apache-2.0 | 2,602 |
/*
* Copyright (C) 2016 University of Basel, Graphics and Vision Research Group
*
* 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) an... | unibas-gravis/scalismo-ui | src/main/scala/scalismo/ui/view/properties/ColorPropertyPanel.scala | Scala | gpl-3.0 | 4,723 |
package jp.rotaryo.whitespace
protected[whitespace] object DuplicateOperation extends Operation {
override def getSource(): String = {
return stackManipulation + "\\n "
}
override def getParameter(): Option[Parameter] = {
return None
}
override def preRun(container: Container, index: Int): Unit = ... | rotary-o/scala2ws | src/main/scala/jp/rotaryo/whitespace/DuplicateOperation.scala | Scala | mit | 476 |
package com.azavea.maml.eval
import com.azavea.maml.ast
import com.azavea.maml.ast._
import com.azavea.maml.dsl._
import com.azavea.maml.error._
import com.azavea.maml.eval.directive.OpDirectives._
import com.azavea.maml.ast.codec.tree.ExpressionTreeCodec
import geotrellis.raster._
import geotrellis.vector._
import g... | geotrellis/maml | jvm/src/test/scala/eval/ConcurrentEvaluationSpec.scala | Scala | apache-2.0 | 14,752 |
object Bug {
abstract class FChain {
type T
def chain(constant:String) =
new FConstant[this.type](constant, this) //removing [this.type], everything compiles
}
case class FConstant[E <: FChain](constant:String, tail:E) extends FChain {
type T = tail.T
}
object FNil extends FChain {
ty... | dotty-staging/dotty | tests/pos/t2435.scala | Scala | apache-2.0 | 607 |
package com.eharmony.aloha.models.multilabel.json
import com.eharmony.aloha.id.ModelId
import com.eharmony.aloha.models.multilabel.PluginInfo
import com.eharmony.aloha.models.reg.json.{Spec, SpecJson}
import spray.json.DefaultJsonProtocol._
import spray.json.{JsObject, JsonFormat, RootJsonFormat}
import scala.collect... | eHarmony/aloha | aloha-core/src/main/scala/com/eharmony/aloha/models/multilabel/json/MultilabelModelJson.scala | Scala | mit | 1,790 |
package org.jetbrains.plugins.hocon.editor
import com.intellij.codeInsight.editorActions.{JavaLikeQuoteHandler, SimpleTokenSetQuoteHandler}
import com.intellij.openapi.editor.highlighter.HighlighterIterator
import com.intellij.psi.PsiElement
import com.intellij.psi.tree.{IElementType, TokenSet}
import org.jetbrains.pl... | ilinum/intellij-scala | src/org/jetbrains/plugins/hocon/editor/HoconQuoteHandler.scala | Scala | apache-2.0 | 981 |
package dundertext.editor.cmd
import org.junit.Test
import org.junit.Assert._
class BlurOnEmptyLastTest extends CommandTestBase {
@Test
def should_remove_empty_row_and_blur(): Unit = {
implicit val editor = given("""
Rad 1
Rad 2
╎
""")
// when
def cmd = new BlurOnEmptyLast
... | dundertext/dundertext | editor/src/test/scala/dundertext/editor/cmd/BlurOnEmptyLastTest.scala | Scala | gpl-3.0 | 589 |
package com.github.jmcs.domain.unaryexpression
import com.github.jmcs.domain.Expression
import com.github.jmcs.domain.UnaryExpression
/**
* Created with IntelliJ IDEA.
* User: Marcelo
* Date: 30/07/13
* Time: 22:53
* To change this template use File | Settings | File Templates.
*/
class CommonLogari... | MarceloPortilho/jmc-scala | src/main/java/com/github/jmcs/domain/unaryexpression/CommonLogarithmExpression.scala | Scala | apache-2.0 | 585 |
/*
* 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/gmp-frontend | app/models/CalculationType.scala | Scala | apache-2.0 | 887 |
package org.jetbrains.plugins.scala.codeInsight.intention.controlflow
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction
import com.intellij.openapi.project.Project
import com.intellij.openapi.editor.Editor
import com.intellij.psi.{PsiDocumentManager, PsiElement}
import org.jetbrains.plugins.scala... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/codeInsight/intention/controlflow/SplitIfIntention.scala | Scala | apache-2.0 | 3,303 |
package net.jcazevedo.moultingyaml
trait DefaultYamlProtocol
extends BasicFormats
with StandardFormats
with CollectionFormats
with ProductFormats
with AdditionalFormats
object DefaultYamlProtocol extends DefaultYamlProtocol
| DDuarte/moultingyaml | src/main/scala/net/jcazevedo/moultingyaml/DefaultYamlProtocol.scala | Scala | mit | 236 |
package play.boilerplate.parser.model
sealed trait ResponseCode
case object DefaultResponse extends ResponseCode
final case class StatusResponse(code: Int) extends ResponseCode
case class Response(code: ResponseCode,
description: Option[String],
schema: Option[Definition],
... | Romastyi/sbt-play-boilerplate | sbt-plugin/lib/src/main/scala/play/boilerplate/parser/model/Response.scala | Scala | apache-2.0 | 803 |
/*
* Copyright 2013 Maurício Linhares
*
* Maurício Linhares licenses this file to you 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 ... | anand-singh/postgresql-async | mysql-async/src/test/scala/com/github/mauricio/async/db/mysql/QueryTimeoutSpec.scala | Scala | apache-2.0 | 3,000 |
/*
* 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 ... | janewangfb/spark | external/flume/src/main/scala/org/apache/spark/streaming/flume/PollingFlumeTestUtils.scala | Scala | apache-2.0 | 6,633 |
/*
* Copyright 2007-2009 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... | andreum/liftweb | lift/src/main/scala/net/liftweb/http/Req.scala | Scala | apache-2.0 | 15,991 |
package de.kaufhof.pillar.cli
import java.io.File
import org.scalatest.FunSpec
import org.scalatest.matchers.ShouldMatchers
class CommandLineConfigurationSpec extends FunSpec with ShouldMatchers {
val sep = File.separator
describe(".buildFromArguments") {
describe("command initialize") {
describe("dat... | j-potts/pillar | src/test/scala/de/kaufhof/pillar/cli/CommandLineConfigurationSpec.scala | Scala | mit | 2,130 |
package org.http4s
package parser
import org.http4s.headers._
import org.specs2.mutable.Specification
class ProxyAuthenticateHeaderSpec
extends Specification
with HeaderParserHelper[`Proxy-Authenticate`] {
def hparse(value: String): ParseResult[`Proxy-Authenticate`] =
HttpHeaderParser.PROXY_AUTHENTICATE... | aeons/http4s | tests/src/test/scala/org/http4s/parser/ProxyAuthenticateHeaderSpec.scala | Scala | apache-2.0 | 1,634 |
package cpup.poland.runtime.userdata
import cpup.poland.runtime.PObject
case class InjectObjectInstruction(obj: PObject) extends Userdata with TInstruction {
override def activate(context: SendContext, seq: InstructionSeq) = obj
} | CoderPuppy/poland-scala | src/main/scala/cpup/poland/runtime/userdata/InjectObjectInstruction.scala | Scala | mit | 233 |
package org.labrad.manager
import java.io.File
import java.net.URI
import org.labrad.crypto.CertConfig
import org.labrad.util.cli.Environment
import org.scalatest.FunSuite
class ManagerConfigTest extends FunSuite {
// If not otherwise specified, use empty environment for these tests.
implicit val defaultEnv = En... | labrad/scalabrad | manager/src/test/scala/org/labrad/manager/ManagerConfigTest.scala | Scala | mit | 8,020 |
package sample.model.asset
import java.time.LocalDate
import sample.context._
import sample.util.Calculator
import scalikejdbc._
import scalikejdbc.jsr310.Implicits._
/**
* 口座の資産概念を表現します。
* asset配下のEntityを横断的に取り扱います。
* low: 実際の開発では多通貨や執行中/拘束中のキャッシュフローアクションに対する考慮で、サービスによってはかなり複雑になります。
*/
case class Asset(/** 口座ID... | jkazama/sample-boot-scala | src/main/scala/sample/model/asset/Asset.scala | Scala | mit | 1,737 |
import com.typesafe.sbt.less.Import.LessKeys
import com.typesafe.sbt.web.Import._
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import play.sbt.routes.RoutesKeys._
import playscalajs.PlayScalaJS.autoImport._
import sbt.Keys._
import sbt._
object Settings {
val applicationName = "scalajs-play-demo"
val ap... | b0c1/scalajs-play-core-react | project/Settings.scala | Scala | apache-2.0 | 4,256 |
package im.actor.server.webactions
import akka.actor.ActorSystem
import im.actor.api.rpc.collections.{ ApiStringValue, ApiInt32Value, ApiMapValueItem, ApiMapValue }
import scala.concurrent.Future
object CorrectWebaction {
val uri = "https://google.com/"
val regex = "https://mail.google.com"
val completeUri = "... | EaglesoftZJ/actor-platform | actor-server/actor-testkit/src/main/scala/im/actor/server/webactions/CorrectWebaction.scala | Scala | agpl-3.0 | 845 |
/*
* Copyright 2017 Exon IT
*
* 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... | exon-it/redmine-scala-client | client-api/src/main/scala/by/exonit/redmine/client/Wiki.scala | Scala | apache-2.0 | 1,613 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | yiheng/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/transform/vision/image/augmentation/Saturation.scala | Scala | apache-2.0 | 2,249 |
import org.scalatest.{Matchers, FunSuite}
/** @version 1.2.0 */
class DifferenceOfSquaresTest extends FunSuite with Matchers {
test("square of sum 1") {
DifferenceOfSquares.squareOfSum(1) should be (1)
}
test("square of sum 5") {
pending
DifferenceOfSquares.squareOfSum(5) should be (225)
}
tes... | exercism/xscala | exercises/practice/difference-of-squares/src/test/scala/DifferenceOfSquaresTest.scala | Scala | mit | 1,089 |
package unfiltered.request
import java.io.{File => JFile}
trait MultiPartMatcher[T] {
def unapply(req: T): Option[T]
}
/** Multipart file upload utilities should extract data
* using this common format */
case class MultipartData[W](
params: String => Seq[String], files: String => W)
/** Describes an uploaded... | jarin/unfiltered | uploads/src/main/scala/request/uploads.scala | Scala | mit | 2,896 |
class A {
1 match {
case t => /*caret*/
}
}
/*
abstract
case
class
def
do
false
final
for
if
implicit
import
lazy
new
null
object
override
private
protected
return
sealed
super
this
throw
trait
true
try
type
val
var
while
*/ | ilinum/intellij-scala | testdata/keywordCompletion/modifiers/caseClause.scala | Scala | apache-2.0 | 232 |
package DistRDF2ML_Evaluation
import java.io.{File, PrintWriter}
import java.util.Calendar
import net.sansa_stack.examples.spark.ml.DistRDF2ML.DistRDF2ML_Evaluation
import net.sansa_stack.ml.spark.featureExtraction.{SmartVectorAssembler, SparqlFrame}
import net.sansa_stack.ml.spark.utils.ML2Graph
import net.sansa_sta... | SANSA-Stack/SANSA-RDF | sansa-examples/sansa-examples-spark/src/main/scala/net/sansa_stack/examples/spark/ml/DistRDF2ML/DistRDF2ML_Regression.scala | Scala | apache-2.0 | 7,358 |
package com.wbillingsley.handy.appbase
case class IdentityLookup(service:String,
value:Option[String],
username:Option[String])
| wbillingsley/handy | handy-appbase-core/src/main/scala/com/wbillingsley/handy/appbase/IdentityLookup.scala | Scala | mit | 181 |
package com.eevolution.context.dictionary.domain.model
import ai.x.play.json.Jsonx
import com.eevolution.context.dictionary.api.{ActiveEnabled, DomainModel, Identifiable, Traceable}
import org.joda.time.DateTime
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This progra... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/model/ChangeLog.scala | Scala | gpl-3.0 | 4,151 |
package mesosphere.marathon.core.task.tracker
import mesosphere.marathon.core.task.TaskStateOp
import scala.concurrent.Future
/**
* Notifies the [[TaskTracker]] of task creation and termination.
*/
trait TaskCreationHandler {
/**
* Create a new task.
*
* If the task exists already, the existing tas... | ss75710541/marathon | src/main/scala/mesosphere/marathon/core/task/tracker/TaskCreationHandler.scala | Scala | apache-2.0 | 680 |
package org.scalawiki.bots
import java.time.{LocalDate, ZoneOffset, ZonedDateTime}
import com.typesafe.config.{Config, ConfigFactory}
import net.ceedubs.ficus.Ficus._
import net.ceedubs.ficus.readers.ArbitraryTypeReader._
import org.scalawiki.dto.{Namespace, Page, User}
import org.scalawiki.query.QueryLibrary
import ... | intracer/scalawiki | scalawiki-bots/src/main/scala/org/scalawiki/bots/MessageBot.scala | Scala | apache-2.0 | 3,510 |
object Test {
def main(args: Array[String]): Unit = {
// constant fold will fail for non-bootstrapped Dotty
assert(!(Float.NaN > 0.0))
assert(!(Float.NaN < 0.0))
assert(!(Double.NaN > 0.0))
assert(!(Double.NaN < 0.0))
val f: Float = Float.NaN
val d: Double = Double.NaN
assert(!(f > 0.... | som-snytt/dotty | tests/run/i6710.scala | Scala | apache-2.0 | 1,774 |
import org.scalatest._
class Suite extends FunSuite {
test("test factorial") {
assert(Main.factorial(0) === 1)
assert(Main.factorial(1) === 1)
assert(Main.factorial(2) === 2)
assert(Main.factorial(3) === 6)
assert(Main.factorial(4) === 24)
}
}
| carsonpun/learn-scala | practice1/src/test/scala/test.scala | Scala | apache-2.0 | 269 |
/*
* Copyright 2013 agwlvssainokuni
*
* 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... | agwlvssainokuni/lifelog | lifelog-website/app/controllers/ProfileForm.scala | Scala | apache-2.0 | 1,557 |
package geotwine
object Geohash {
private[geotwine] val Alphabet = "0123456789bcdefghjkmnpqrstuvwxyz"
case class Box(
minLon: Double, minLat: Double, maxLat: Double, maxLon: Double) {
def center: (Double, Double) =
((minLat + maxLat) / 2.0, (minLon + maxLon) / 2.0)
}
}
| softprops/geo-twine | src/main/scala/Geohash.scala | Scala | mit | 291 |
package mesosphere.marathon.api.v2
import javax.ws.rs._
import javax.ws.rs.core.{ MediaType, Response }
import com.codahale.metrics.annotation.Timed
import org.apache.log4j.Logger
import mesosphere.marathon.api.{ MarathonMediaType, RestResource }
import mesosphere.marathon.state.PathId._
import mesosphere.marathon.s... | MrMarvin/marathon | src/main/scala/mesosphere/marathon/api/v2/AppVersionsResource.scala | Scala | apache-2.0 | 1,250 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | Panos-Bletsos/spark-cost-model-optimizer | mllib/src/test/scala/org/apache/spark/ml/classification/OneVsRestSuite.scala | Scala | apache-2.0 | 11,061 |
/*
* Copyright (c) 2017 joesan @ http://github.com/joesan
*
* 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 appl... | joesan/plant-simulator | test/com/inland24/plantsim/core/AppBindingsTest.scala | Scala | apache-2.0 | 1,498 |
/**
* Copyright 2013-2014. Genome Bridge 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 applicable law or ... | fnothaft/adam | adam-core/src/main/scala/edu/berkeley/cs/amplab/adam/models/SequenceDictionary.scala | Scala | apache-2.0 | 17,865 |
/**
* Copyright (C) 2014 TU Berlin (peel@dima.tu-berlin.de)
*
* 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... | carabolic/peel | peel-core/src/main/scala/org/peelframework/core/cli/command/experiment/Run.scala | Scala | apache-2.0 | 7,356 |
package ingress.submission
import com.rabbitmq.client.AMQP.BasicProperties
import com.rabbitmq.client.{QueueingConsumer, Channel, Connection}
import play.api.test.FakeApplication
import submission.SubmissionService
import submission.messaging.{MessageSender, ConnectionManager}
import utils.WithServer
import play.api._... | Department-for-Work-and-Pensions/ClaimReceived | cr/test/ingress/submission/WithServerConfig.scala | Scala | mit | 2,168 |
package wp
import org.scalatest.FunSuite
class Discipline extends FunSuite with org.typelevel.discipline.scalatest.Discipline
| jawp/wicked-playground | modules/shared/.jvm/src/test/scala/wp/Discipline.scala | Scala | mit | 129 |
package com.forged.server
import com.forged.data.PortfolioProject
import spray.httpx.PlayTwirlSupport._
import spray.routing.HttpServiceActor
/**
* Created by visitor15 on 11/28/15.
*/
class ServerActor extends HttpServiceActor {
override def receive: Receive = runRoute {
path("home") {
get {
c... | Visitor15/webPresence-scala | src/main/scala/com/forged/server/ServerActor.scala | Scala | mit | 2,382 |
package controllers
import scala.io.Source
/**
* Currently not in use.
* Could be used for loading templates from the server.
*/
class TemplateHandler {
val filePathTemplates = "server/app/controllers/templates.txt"
val nbrOfTemplates = getAmountOfTemplates
def getTemplate(templateNbr: Int): Option[Str... | reqT/reqT-webapp | server/app/controllers/TemplateHandler.scala | Scala | apache-2.0 | 923 |
def f = {}
def f = {}
println(/* resolved: false */ f)
println(classOf[/* resolved: false */f]) | ilinum/intellij-scala | testdata/resolve2/element/clash/FunctionDefinition.scala | Scala | apache-2.0 | 96 |
/*
* Copyright (C) 2017. envisia GmbH
* All Rights Reserved.
*/
package de.envisia.postgresql.message.backend
import akka.util.ByteString
case class DataRowMessage(values: Array[ByteString]) extends ServerMessage {
override val kind: Int = ServerMessage.DataRow
} | schmitch/akka-pg | src/main/scala/de/envisia/postgresql/message/backend/DataRowMessage.scala | Scala | apache-2.0 | 270 |
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.