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 skuber
import java.io._
import org.apache.commons.io.IOUtils
/**
* @author David O'Riordan
*/
case class Secret(
val kind: String ="Secret",
override val apiVersion: String = v1,
val metadata: ObjectMeta,
data: Map[String, Array[Byte]] = Map(),
val `type`: String = "")
extends ObjectRe... | minatjanster/skuber | client/src/main/scala/skuber/Secret.scala | Scala | apache-2.0 | 995 |
package org.scalacoin.currency
import org.scalatest.{MustMatchers, Matchers, FlatSpec}
/**
* Created by chris on 12/21/15.
*/
class CurrencyUnitsTest extends FlatSpec with MustMatchers {
"One satoshi" should ("be equivalent to 0.00000001 BTC") in {
CurrencyUnits.sataoshisToBitcoin(Satoshis(1)).value must... | scalacoin/scalacoin | src/test/scala/org/scalacoin/currency/CurrencyUnitsTest.scala | Scala | mit | 4,968 |
package com.karasiq.shadowcloud.crypto
import scala.collection.concurrent.TrieMap
import scala.concurrent.Future
import akka.Done
import com.karasiq.shadowcloud.ShadowCloudExtension
import com.karasiq.shadowcloud.model.keys.{KeyChain, KeyId, KeyProps, KeySet}
import com.karasiq.shadowcloud.model.keys.KeyProps.Region... | Karasiq/shadowcloud | core/src/main/scala/com/karasiq/shadowcloud/crypto/TestKeyProvider.scala | Scala | apache-2.0 | 1,678 |
package net.sf.latexdraw.actions.shape
import org.malai.action.Action
import org.malai.undo.Undoable
import net.sf.latexdraw.actions.Modifying
import net.sf.latexdraw.actions.ShapeAction
import net.sf.latexdraw.glib.models.interfaces.GLibUtilities
import net.sf.latexdraw.glib.models.interfaces.IPoint
import net.sf.la... | arnobl/latexdraw-mutants | GUImutants/mutant22/net.sf.latexdraw.mutant22/src/main/net/sf/latexdraw/actions/shape/RotateShapes.scala | Scala | gpl-2.0 | 2,596 |
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt
import java.io.File
import java.net.URI
import java.util.Locale
import Project._
import BasicKeys.serverLogLevel
import Keys.{
stateBuildStructure,
bspEnable... | sbt/sbt | main/src/main/scala/sbt/Project.scala | Scala | apache-2.0 | 37,837 |
object O {
def m1(a: Int*) = (a*) // error
def m2(a: Int*) = {
val b = (a*) // error
b
}
def m3(a: Int*): Any = {
val b = (a*) // error
b
}
def m4(a: 2*) = (a*) // error
}
class O(a: Int*) {
val m = (a*) // error
} | dotty-staging/dotty | tests/neg/i7972.scala | Scala | apache-2.0 | 247 |
/**
* 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... | dchenbecker/kafka-sbt | perf/src/main/scala/kafka/perf/PerfConfig.scala | Scala | apache-2.0 | 2,594 |
/*
* 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 ... | StephanEwen/incubator-flink | flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/DataStream.scala | Scala | apache-2.0 | 47,673 |
package com.zobot.client.packet.definitions.serverbound.play
import com.zobot.client.packet.Packet
case class ClientStatus(actionId: Int) extends Packet {
override lazy val packetId = 0x03
override lazy val packetData: Array[Byte] =
fromVarInt(actionId)
}
| BecauseNoReason/zobot | src/main/scala/com/zobot/client/packet/definitions/serverbound/play/ClientStatus.scala | Scala | mit | 267 |
/*
* 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 ... | eyalfa/spark | external/avro/src/main/scala/org/apache/spark/sql/avro/AvroSerializer.scala | Scala | apache-2.0 | 8,392 |
package com.fanhood.presentation.main
import org.scalatra._
import scalate.ScalateSupport
class Fanhood extends FanhoodUtilsStack {
get("/") {
<html>
<body>
<h1>Hello, world!</h1>
Say <a href="hello-scalate">hello to Scalate</a>.
</body>
</html>
}
}
| gvillarroel/fanhood | fanhood-utils/src/main/scala/com/fanhood/presentation/main/Fanhood.scala | Scala | gpl-2.0 | 296 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2006-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/collection/generic/TraversableFactory.scala | Scala | bsd-3-clause | 1,683 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundatio... | HuangLS/neo4j | manual/cypher/refcard-tests/src/test/scala/org/neo4j/cypher/docgen/refcard/CreateUniqueTest.scala | Scala | apache-2.0 | 2,162 |
/*
* Copyright 2017 PayPal
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | akara/squbs | squbs-pattern/src/main/scala/org/squbs/pattern/stream/BroadcastBufferBase.scala | Scala | apache-2.0 | 4,705 |
import scala.io.Source
object Test {
def main(args: Array[String]) {
val lines = Source.fromString(
"""|
|This is a file
|it is split on several lines.
|
|isn't it?
|""".stripMargin).getLines.toList
println("lines.size = " + lines.size)
lines.foreach(pri... | felixmulder/scala | test/files/jvm/unittest_io_Jvm.scala | Scala | bsd-3-clause | 332 |
package org.jetbrains.plugins.scala.lang.psi.impl.base.types
import com.intellij.lang.ASTNode
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElementVisitor
import org.jetbrains.plugins.scala.lang.psi.api.base.types.{ScTypeElement, ScTypeLambdaTypeElement}
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsi... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/impl/base/types/ScTypeLambdaTypeElementImpl.scala | Scala | apache-2.0 | 1,132 |
/*
* Copyright 2001-2008 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... | svn2github/scalatest | src/main/scala/org/scalatest/tools/IconEmbellishedListCellRenderer.scala | Scala | apache-2.0 | 10,151 |
package net.categoricaldata.load
object SQLDumpLoader extends DataLoader {
def fromLines(lines: Iterable[String]): DataTables = ???
} | JasonGross/categoricaldata | src/main/scala/net/categoricaldata/load/SQLDumpLoader.scala | Scala | mit | 135 |
/***********************************************************************
* Copyright (c) 2013-2022 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | locationtech/geomesa | geomesa-jobs/src/main/scala/org/locationtech/geomesa/jobs/JobUtils.scala | Scala | apache-2.0 | 1,578 |
package org.scala_tools.maven.mojo.util
sealed trait Resource[+T] {
val value: T
def close: Unit
def use[X](f: T => X) = try { f(value) } finally { close }
}
object Resource {
type Closable = { def close(); }
implicit def pimpClosable[A <: Closable](x : A) = new Resource[A] {
override val value = x
... | jacekszymanski/mvnplugins | scala-mojo-support/src/main/java/org/scala_tools/maven/mojo/util/Resource.scala | Scala | apache-2.0 | 1,056 |
package org.GutenburgNLP.utils
import java.nio.charset.MalformedInputException
import java.util.zip.ZipException
import scala.annotation.tailrec
/**
* Collection of basic NLP-ish functions
*
*/
object NLPUtils {
/**
* Count the number of words in a .zip file
*
* @param filename filepath of the f... | dandxy89/SparkScalaGutenburgNLP | src/main/scala/org/GutenburgNLP/utils/NLPUtils.scala | Scala | apache-2.0 | 5,038 |
/*
* Copyright (c) 2017-2022 Lymia Alusyia <lymia@lymiahugs.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use,... | Lymia/PrincessEdit | modules/princess-edit/src/main/scala/moe/lymia/princess/CLI.scala | Scala | mit | 3,882 |
/*
* Copyright 2011-2018 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | wiacekm/gatling | gatling-metrics/src/main/scala/io/gatling/metrics/types/HistogramRequestMetricsBuffer.scala | Scala | apache-2.0 | 2,742 |
package com.tribbloids.spookystuff.dsl
import com.tribbloids.spookystuff.caching.ExploreRunnerCache
import com.tribbloids.spookystuff.execution.ExplorePlan.Params
import com.tribbloids.spookystuff.execution.NodeKey
import com.tribbloids.spookystuff.row._
import com.tribbloids.spookystuff.utils.CachingUtils.ConcurrentM... | tribbloid/spookystuff | core/src/main/scala/com/tribbloids/spookystuff/dsl/ExploreAlgorithm.scala | Scala | apache-2.0 | 6,279 |
/*
* 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 ... | ConeyLiu/spark | sql/core/src/test/scala/org/apache/spark/sql/FileBasedDataSourceSuite.scala | Scala | apache-2.0 | 36,971 |
package scala.tools.testing
import scala.reflect.runtime._
import scala.tools.reflect.ToolBox
trait RunTesting extends ClearAfterClass {
def compilerArgs = "" // to be overridden
val runner = cached("toolbox", () => Runner.make(compilerArgs))
}
class Runner(val toolBox: ToolBox[universe.type]) {
def run[T](cod... | felixmulder/scala | test/junit/scala/tools/testing/RunTesting.scala | Scala | bsd-3-clause | 536 |
/**
* Licensed to Gravity.com under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Gravity.com licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this fil... | davidyanez/goose | src/main/scala/com/gravity/goose/Article.scala | Scala | apache-2.0 | 3,751 |
/*
* Copyright 2011-2012 Jonathan Anderson
*
* 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... | trombonehero/Footlights | Client/Core/src/main/scala/me/footlights/core/kernel.scala | Scala | apache-2.0 | 5,341 |
package cz.jenda.pidifrky.data
import android.app.Activity
import cz.jenda.pidifrky.data.pojo.Card
/**
* Created <b>30.9.13</b><br>
*
* @author Jenda Kolena, jendakolena@gmail.com
* @version 0.1
* @since 0.2
*/
class CardTiles(context: Activity, card: Card) {
// private final val table: Array[Array[Int]] = n... | jendakol/pidifrky | client/src/main/scala/cz/jenda/pidifrky/data/CardTiles.scala | Scala | apache-2.0 | 2,581 |
/*******************************************************************************
Copyright (c) 2013, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
**********************************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/analysis/typing/debug/commands/CmdHelp.scala | Scala | bsd-3-clause | 1,094 |
package is.hail.stats
import is.hail.utils._
import org.apache.commons.math3.util.CombinatoricsUtils.factorialLog
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test
class LeveneHaldaneSuite extends TestNGSuite {
def LH(n: Int, nA: Int)(nAB: Int): Double = {
assert(nA >= 0 && nA <= n)
... | cseed/hail | hail/src/test/scala/is/hail/stats/LeveneHaldaneSuite.scala | Scala | mit | 2,889 |
// See LICENSE.txt for license details.
package problems
import chisel3._
// Problem:
//
// Implement a 16-bit Fibonacci Linear-feedback shift register
// with polynomial x^16 + x^14 + x^13 + x^11 + 1
// State change is allowed only when 'inc' is asserted
//
class LFSR16 extends Module {
val io = IO(new Bundle {
... | timtian090/Playground | chiselTutorial/src/main/scala/problems/LFSR16.scala | Scala | mit | 469 |
package sbt.std.neg
import org.scalatest.FunSuite
import sbt.std.TaskLinterDSLFeedback
import sbt.std.TestUtil._
class TaskNegSpec extends FunSuite {
import tools.reflect.ToolBoxError
def expectError(errorSnippet: String,
compileOptions: String = "",
baseCompileOptions: String ... | Duhemm/sbt | main-settings/src/test/scala/sbt/std/neg/TaskNegSpec.scala | Scala | bsd-3-clause | 9,965 |
package sparklyr
import java.io.{ByteArrayInputStream, ByteArrayOutputStream, DataInputStream, DataOutputStream}
import scala.collection.mutable.HashMap
import scala.language.existentials
import io.netty.channel.{ChannelHandlerContext, SimpleChannelInboundHandler}
import io.netty.channel.ChannelHandler.Sharable
imp... | kevinykuo/sparklyr | java/spark-1.5.2/stream.scala | Scala | apache-2.0 | 3,771 |
/*
* 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/core/src/test/scala/org/apache/spark/sql/streaming/StateStoreMetricsTest.scala | Scala | apache-2.0 | 3,183 |
package samples.scalaexchange.step6
import akka.http.scaladsl.Http
import akka.http.scaladsl.server._
import samples.scalaexchange.utils.SampleApp
import scala.io.StdIn
object IncomingStreamsHttpServiceApp extends SampleApp
with IncomingStreamsService {
// our routes:
val route: Route =
incomingStreams
... | ktoso/akka-scala-exchange | src/main/scala/samples/scalaexchange/step6/IncomingStreamsHttpServiceApp.scala | Scala | apache-2.0 | 419 |
package org.trpleo.thirstyyonath.matching
import org.trpleo.thirstyyonath.model.offer.Offer
import org.trpleo.thirstyyonath.model.orderbook.OrderBook
/**
* Created by ipapp on 02/03/16.
*/
trait MatchingAlgorithm {
def doMatching(orderBook: OrderBook): OrderBook
def sellSideCompare(thisOffer: Offer, thatOffer: ... | trpleo/thirsty-yonath | src/main/scala/org/trpleo/thirstyyonath/matching/MatchingAlgorithm.scala | Scala | mit | 386 |
package typeclass
import typeclass.Prelude._
trait Applicative[F[_]] extends Functor[F]{
def pure[A](a: A): F[A]
def ap[A, B](fab: F[A => B], fa: F[A]): F[B]
def map[A, B](fa: F[A])(f: A => B): F[B] =
ap(pure(f), fa)
def map2[A, B, C](fa: F[A], fb: F[B])(f: (A, B) => C): F[C] =
ap(map(fa)((a: A) => ... | julien-truffaut/Typeclass | answer/src/main/scala/typeclass/Applicative.scala | Scala | mit | 2,288 |
package system.cell.core
import java.net.InetAddress
import akka.actor.{ActorRef, Props}
import com.actors.TemplateActor
import com.utils.Practicability
import spray.json._
import system.cell.cluster.{CellClusterSupervisor, CellPublisher, CellSubscriber}
import system.cell.processor.route.actors.RouteManager
import s... | albertogiunta/arianna | src/main/scala/system/cell/core/CellCoreActor.scala | Scala | gpl-3.0 | 11,986 |
package com.atomicscala.Bodies
class NoBody {
def who():String = {
"Nobody's home"
}
}
class SomeBody {
def name():String = {
"Janet Doe"
}
println(name + " is SomeBody")
}
class EveryBody {
val all = Vector(new SomeBody, new SomeBody, new SomeBody)
}
| P7h/ScalaPlayground | Atomic Scala/atomic-scala-solutions/20_Summary2/ClassBodies.scala | Scala | apache-2.0 | 275 |
/*
* This file is part of Evo2DSim.
*
* Evo2DSim 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 3 of the License, or
* (at your option) any later version.
*
* Evo2DSim is distrib... | vchuravy/Evo2DSim | core/src/main/scala/org/vastness/evo2dsim/core/evolution/genomes/standard/STDGenome.scala | Scala | mit | 2,191 |
/*
* 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 ... | jiangxb1987/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocator.scala | Scala | apache-2.0 | 21,557 |
package lila.activity
import activities._
import model._
import org.joda.time.Interval
import lila.game.LightPov
import lila.practice.PracticeStudy
import lila.simul.Simul
import lila.study.Study
import lila.swiss.Swiss
import lila.tournament.LeaderboardApi.{ Entry => TourEntry }
import lila.ublog.UblogPost
case cla... | luanlv/lila | modules/activity/src/main/ActivityView.scala | Scala | mit | 1,278 |
package preact
import org.scalajs.dom
object Preact {
val raw = preact.raw.RawPreact
type VNode = raw.VNode
type Child = raw.Child
type Component[Props, State] = preact.Component[Props, State]
val FunctionFactory = preact.FunctionFactory
object FunctionComponent {
trait WithProps[Props] {
... | LMnet/scala-js-preact | core/src/main/scala/preact/Preact.scala | Scala | mit | 794 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | bravo-zhang/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnVectorSuite.scala | Scala | apache-2.0 | 12,379 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.3
* @date Fri Jan 29 15:43:08 EST 2016
* @see LICENSE (MIT style license file).
*/
package scalation.linalgebra
import scala.collection.Traversable
import scala.collection.mutable.Inde... | NBKlepp/fda | scalation_1.3/scalation_mathstat/src/main/scala/scalation/linalgebra/VectoQ.scala | Scala | mit | 24,237 |
import sbt._
object Versions {
val scalaVersion = "2.11.6"
val ideaVersion = "142.4859.6"
val sbtStructureVersion = "4.2.0"
val luceneVersion = "4.8.1"
val aetherVersion = "1.0.0.v20140518"
val sisuInjectVersion = "2.2.3"
val wagonVersion = "2.6"
val httpComponentsVersion = "4.3.1"
}
object Dependenc... | SergeevPavel/intellij-scala | project/dependencies.scala | Scala | apache-2.0 | 6,428 |
package com.heluna.filter
import com.typesafe.scalalogging.slf4j.Logging
import com.heluna.cache.Redis
import com.heluna.util.MailDropConfig
import com.heluna.model.{Continue, Reject}
import java.util.Date
import com.redis.serialization.Parse.Implicits.parseLong
/**
* Created with IntelliJ IDEA.
* User: mark
* Dat... | ministryofjustice/maildrop | smtp/src/main/scala/com/heluna/filter/SubjectFloodFilter.scala | Scala | mit | 1,919 |
package com.tirthal.learning.java2scala.scalaway.classobj
// Scala way - basic syntax
// Java developers to be aware that ---> read next comments...
object Abc {
def main(args: Array[String])
{
// In Scala, semicolons are pretty much optional.
/*
* Scala is a pure object-oriented language in t... | tirthalpatel/Learning-Scala | ScalaQuickStart/src/main/scala/com/tirthal/learning/java2scala/scalaway/classobj/Abc.scala | Scala | mit | 2,229 |
/*
* 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 ... | rmetzger/flink | flink-examples/flink-examples-table/src/main/scala/org/apache/flink/table/examples/scala/basics/WordCountTable.scala | Scala | apache-2.0 | 2,135 |
package es.weso.rbe.deriv
import es.weso.rbe._
import es.weso.collection._
case class DerivChecker[A](rbe: Rbe[A]) extends BagChecker[A] {
def check(bag:Bag[A], open: Boolean): Either[String, Bag[A]] = {
val d = rbe.derivBag(bag, open, rbe.symbols)
if (d.nullable) Right(bag)
else {
d match {
... | labra/rbe | src/main/scala/es/weso/rbe/deriv/DerivChecker.scala | Scala | mit | 465 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | Wogan/monix | monix-tail/shared/src/main/scala/monix/tail/internal/IterantDistinctUntilChanged.scala | Scala | apache-2.0 | 3,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... | TiVo/kafka | core/src/test/scala/unit/kafka/log/LogCleanerParameterizedIntegrationTest.scala | Scala | apache-2.0 | 16,692 |
package org.precompiler.scala101.ch03
/**
* Created by RL on 6/2/17.
*/
object StringDemo {
def main(args:Array[String]): Unit = {
val multilineStr =
"""
SELECT *
FROM dual;
"""
val multilineStr2 =
"""
|SELECT *
|FROM emp;
""".stripMargin
prin... | precompiler/scala-101 | learning-scala/src/main/scala/org/precompiler/scala101/ch03/StringDemo.scala | Scala | apache-2.0 | 497 |
/*
* 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 agree... | rodzyn0688/zipkin | zipkin-server/src/main/scala/com/twitter/zipkin/collector/processor/StorageProcessor.scala | Scala | apache-2.0 | 987 |
package com.catinthedark.lib
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.ShapeRenderer
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType
import com.badlogic.gdx.math.{Rectangle, Vector2}
/**
* Created by over on 13.... | cat-in-the-dark/old48_33_game | src/main/scala/com/catinthedark/lib/Magic.scala | Scala | mit | 1,793 |
/*
* 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 ... | yanboliang/spark | core/src/main/scala/org/apache/spark/util/random/XORShiftRandom.scala | Scala | apache-2.0 | 2,609 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/ml/feature/LabeledPoint.scala | Scala | apache-2.0 | 1,368 |
/*
* Copyright 2014 Commonwealth Computer Research, 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 applica... | mmatz-ccri/geomesa | geomesa-core/src/main/scala/org/locationtech/geomesa/core/data/AccumuloDataStoreFactory.scala | Scala | apache-2.0 | 9,576 |
object That {
trait A {
type T <: I;
trait I {}
}
trait B {
type T <: J;
trait J {}
}
trait C extends A with B {
type T <: I with J;
}
}
| AlexSikia/dotty | tests/untried/pos/scoping2.scala | Scala | bsd-3-clause | 207 |
/*
* Copyright 2015 eleflow.com.br.
*
* 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 ... | eleflow/uberdata | iuberdata_core/src/main/scala/eleflow/uberdata/core/IUberdataContext.scala | Scala | apache-2.0 | 11,413 |
package org.scalawiki.dto.cmd
trait WatchParam[+T] extends Parameter[T]
case class Watch(override val arg: Boolean = true) extends BooleanParameter("watch",
"Add the page to your watchlist. Deprecated. Use the watchlist argument") with WatchParam[Boolean]
case class UnWatch(override val arg: Boolean = true) extend... | intracer/scalawiki | scalawiki-core/src/main/scala/org/scalawiki/dto/cmd/WatchParam.scala | Scala | apache-2.0 | 1,231 |
/**
* Copyright (C) 2018 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 | form-runner/jvm/src/main/scala/org/orbeon/oxf/fr/xbl/FormRunnerXblSupport.scala | Scala | lgpl-2.1 | 2,663 |
/*
* Copyright 2015-2018 Snowflake Computing
* Copyright 2015 Databricks
*
* 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
*
* Unles... | snowflakedb/spark-snowflake | src/main/scala/net/snowflake/spark/snowflake/TableName.scala | Scala | apache-2.0 | 1,004 |
/*
* 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 ... | nchammas/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogVersionsSuite.scala | Scala | apache-2.0 | 14,823 |
package mdtags
import org.specs2.mutable.Specification
class MarkDownSpec extends Specification {
"Empty MarkDown" should {
"return an empty string" in {
MarkDown().toMarkdown() must equalTo("")
}
}
"MarkDown" should {
"have a h1 title and return the appropriate MarkDown" in {
MarkD... | timo-schmid/mdtags | src/test/scala/mdtags/MarkDownSpec.scala | Scala | apache-2.0 | 3,610 |
abstract class Shape {
def centerPoint:(Double, Double)
}
class Rectangle(val x: Double, val y:Double, val width:Double, val height:Double) extends Shape {
def centerPoint = (x + width / 2, y + height / 2)
}
class Circle(override val centerPoint: (Double, Double), val radius:Double) extends Shape {
}
println(ne... | Gerhut/scala-for-the-impatient | Chapter8/6.scala | Scala | unlicense | 400 |
package latis.ops.filter
import latis.dm.Scalar
import latis.dm.Tuple
import latis.ops.OperationFactory
/*
* Removes all data points of a given name from the dataset
* that differ more than 'maxDelta' in value from their preceding points.
*/
class MaxDeltaFilter(val name: String, val maxDelta: Double) extends F... | dlindhol/LaTiS | src/main/scala/latis/ops/filter/MaxDeltaFilter.scala | Scala | epl-1.0 | 1,792 |
package feh.tec.nxt
import feh.tec.nxt.LegoRobotRubik.{Motors, remotely}
import feh.tec.rubik.RubikCube._
import feh.tec.rubik.RubikCubeImage
import feh.tec.rubik.RubikCubeImage.{Side, SidesMap, ColorMap}
import feh.util._
import lejos.nxt.LightSensor
object RubikCubeImageNXT{
def readCubes[T, C](gatherColor: => T... | fehu/int-sis--Rubik | nxt/src/main/scala/feh/tec/nxt/RubikCubeImageNXT.scala | Scala | mit | 2,961 |
package net.xylophones.planetoid.game.logic
import net.xylophones.planetoid.game.model.GameEvent._
import net.xylophones.planetoid.game.model.{GameEvent, PlayerInput, GamePhysics, GameModelUpdateResult}
class RoundCompleteCountdownUpdater(currentTimeSource: CurrentTimeSource) extends GameModelResultUpdater {
overr... | wjsrobertson/planetoid3d | game/src/main/scala/net/xylophones/planetoid/game/logic/RoundCompleteCountdownUpdater.scala | Scala | apache-2.0 | 1,187 |
package org.scaladebugger.api.profiles.traits.info
import com.sun.jdi.{ThreadGroupReference, ThreadReference}
import scala.util.Try
/**
* Represents the interface for thread-based interaction.
*/
trait ThreadGroupInfo extends ObjectInfo with CommonInfo {
/**
* Converts the current profile instance to a repre... | ensime/scala-debugger | scala-debugger-api/src/main/scala/org/scaladebugger/api/profiles/traits/info/ThreadGroupInfo.scala | Scala | apache-2.0 | 2,080 |
package amora.backend.indexer
import org.junit.Test
import amora.converter.protocol.Artifact
import amora.converter.protocol.Project
class ScalaRefTest extends RestApiTest {
@Test
def return_type_at_members() = {
indexRegionData("""
prefix ref:<http://amora.center/kb/amora/Schema/Ref/>
selec... | sschaef/tooling-research | backend/src/test/scala/amora/backend/indexer/ScalaRefTest.scala | Scala | mit | 27,049 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package elements
import com.intellij.psi.PsiElement
import com.intellij.psi.stubs.{IndexSink, StubElement, StubInputStream, StubOutputStream}
import com.intellij.util.io.StringRef
import org.jetbrains.plugins.scala.lang.psi.api.statements.{ScFu... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/elements/ScFunctionElementType.scala | Scala | apache-2.0 | 3,155 |
package com.github.mdr.mash.ns.view
import com.github.mdr.mash.classes.{ AbstractObjectWrapper, Field, MashClass, NewStaticMethod }
import com.github.mdr.mash.inference.Type
import com.github.mdr.mash.ns.core.BooleanClass
import com.github.mdr.mash.runtime.{ MashBoolean, MashObject, MashValue }
import scala.collectio... | mdr/mash | src/main/scala/com/github/mdr/mash/ns/view/ViewClass.scala | Scala | mit | 2,714 |
package io.hydrosphere.mist.api
trait MLMistJob extends ContextSupport
| KineticCookie/mist | mist-lib/src/main/scala/io/hydrosphere/mist/api/MLMistJob.scala | Scala | apache-2.0 | 72 |
/*
* 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 ... | ueshin/apache-spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientSuite.scala | Scala | apache-2.0 | 39,915 |
package org.judal.storage.scala
import javax.jdo.FetchGroup
import javax.jdo.JDOUserException
import org.judal.storage.Param
import org.judal.storage.EngineFactory
import org.judal.storage.table.AbstractIndexableTableOperation
import org.judal.storage.table.Record
import org.judal.storage.table.RecordSet
import org.j... | sergiomt/judal | scala-adaptor/src/main/scala/org/judal/storage/scala/IndexableTableOperation.scala | Scala | apache-2.0 | 2,263 |
/*
* 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... | fjsc/sparta | serving-core/src/test/scala/com/stratio/sparta/serving/core/helpers/JarsHelpersTest.scala | Scala | apache-2.0 | 1,801 |
/*
* 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 | core/src/test/scala/org/apache/spark/metrics/MetricsSystemSuite.scala | Scala | apache-2.0 | 6,868 |
package com.twitter.finagle
import com.twitter.app.Flaggable
import com.twitter.io.Buf
import com.twitter.finagle.util.Showable
import java.nio.charset.Charset
import java.util.BitSet
/**
* A Path comprises a sequence of byte buffers naming a
* hierarchically-addressed object.
*
* @see The [[http://twitter.github... | sveinnfannar/finagle | finagle-core/src/main/scala/com/twitter/finagle/Path.scala | Scala | apache-2.0 | 4,195 |
package com.awesomesauce.lib
object Duplex {
def apply[A, B](o1: A, o2: B) = { new Duplex(o1, o2) }
}
class Duplex[A, B](o1: A, o2: B) extends Product2[A, B] {
def _1 = o1
def _2 = o2
def canEqual(that:Any):Boolean = {that.isInstanceOf[Duplex[A, B]]}
} | AwesomeSauceMods/AwesomeSauceCore | main/scala/com/awesomesauce/lib/Duplex.scala | Scala | mit | 270 |
import org.jmotor.tools.MavenSearchClient
import org.jmotor.tools.dto.MavenSearchRequest
import org.scalatest._
import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
class AppTest extends FunSuite {
private[this] val client = MavenSearchClient()
... | aiyanbo/search.maven.org-scala-sdk | src/test/scala/AppTest.scala | Scala | apache-2.0 | 1,306 |
package org.atnos
package origami
import org.specs2._
import folds._
import cats.implicits._
class InferenceSpec extends Specification { def is = s2"""
issue #53 with existential types $e1
another example for issue #53 $e2
"""
def e1 = {
(mean[Double].map(_ * 100), plus[Double]).tupled
ok
}
def ... | atnos-org/origami | lib/src/test/scala-2.13/org/atnos/origami/InferenceSpec.scala | Scala | mit | 396 |
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Sergio Gutiérrez Mota
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
... | Serchinastico/Charades | src/main/scala/com/serchinastico/charades/base/math/MathExtension.scala | Scala | mit | 1,448 |
/*
* 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/pensions-lifetime-allowance-frontend | test/views/pages/ip2016/PsoDetailsViewSpec.scala | Scala | apache-2.0 | 4,002 |
/*
* 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... | 122689305/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/models/rnn/Train.scala | Scala | apache-2.0 | 4,984 |
/*
* 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 | sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala | Scala | apache-2.0 | 49,974 |
package de.hpi.asg.breezetestgen.testgeneration.constraintsolving
sealed trait ArithOperator
case object Plus extends ArithOperator
case object Minus extends ArithOperator
case object And extends ArithOperator
case object Or extends ArithOperator
| 0x203/BreezeTestGen | src/main/scala/de/hpi/asg/breezetestgen/testgeneration/constraintsolving/ArithOperator.scala | Scala | mit | 248 |
/*
* Copyright 2011 BigData Mx
*
* 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... | bigdata-mx/DataLib | src/main/scala/mx/bigdata/datalib/sql/QueryBuilder.scala | Scala | apache-2.0 | 3,049 |
package api
import com.typesafe.config.{ Config, ConfigFactory }
import com.typesafe.scalalogging.LazyLogging
import core.ConsoleEventPublisher
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import persistence.dal.{ JobsDal, ProjectsDal, TestsDal }
import spray.testkit.{ RouteTest, Specs2Interf... | ShiftForward/ridgeback | src/test/scala/api/AbstractAPISpec.scala | Scala | mit | 981 |
package model
import play.api.libs.json._
/**
* Represents the Swagger definition for PipelineFolderImpl.
* @param additionalProperties Any additional properties this model may have.
*/
@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2022-... | cliffano/swaggy-jenkins | clients/scala-play-server/generated/app/model/PipelineFolderImpl.scala | Scala | mit | 1,692 |
package asobu.distributed.gateway.enricher
import asobu.distributed.RequestEnricherDefinition
import asobu.distributed.RequestEnricherDefinition.{OrElse, AndThen}
import asobu.distributed.gateway._
import asobu.dsl.Extractor._
import play.api.mvc.{Request, AnyContent, Results}, Results.InternalServerError
import scal... | iheartradio/asobu | distributed/src/main/scala/asobu/distributed/gateway/enricher/Interpreter.scala | Scala | apache-2.0 | 1,481 |
/*
* Happy Melly Teller
* Copyright (C) 2013 - 2016, Happy Melly http://www.happymelly.com
*
* This file is part of the Happy Melly Teller.
*
* Happy Melly Teller 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 Fo... | HappyMelly/teller | app/models/repository/core/payment/CreditCardRepository.scala | Scala | gpl-3.0 | 2,601 |
package chehao.myscala.func
object Example {
def main(args: Array[String]): Unit = {
val list = List(1, 2, 3, 4)
println("list contains Odd ? " + containsOdd(list))
println("list exist Odd? " + list.exists { (x: Int) => x % 2 == 1 })
println("list exist Odd? " + list.exists { _ % 2 == 1 })
val ... | Chehao/Akkala | quickstart/src/main/scala/chehao/myscala/func/WordCountExample.scala | Scala | apache-2.0 | 1,189 |
package org.skycastle.ui.components
import java.awt.event.{ActionEvent, ActionListener}
import javax.swing.event.{DocumentEvent, DocumentListener}
import javax.swing.JTextField
import org.skycastle.content.composite.CompositeEntity
import org.skycastle.ui.Ui
import org.skycastle.util.Parameters
/**
*
*
* @autho... | weimingtom/skycastle | src/main/scala/org/skycastle/ui/components/FieldUi.scala | Scala | gpl-2.0 | 1,209 |
package controllers
trait IdTokenValidator {
def validate(aud: String): Boolean
}
| j5ik2o/forseti | app/relying-party/app/controllers/IdTokenValidator.scala | Scala | mit | 87 |
/*
* Copyright 2012-2014 Comcast Cable Communications Management, 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
*
* Unl... | mattinger/sirius | src/test/scala/com/comcast/xfinity/sirius/api/impl/status/StatusWorkerTest.scala | Scala | apache-2.0 | 2,381 |
/*
* 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 ... | zhangjunfang/eclipse-dir | spark/core/src/main/scala/org/apache/spark/deploy/ExecutorState.scala | Scala | bsd-2-clause | 1,083 |
package io.swagger.client.model
import io.swagger.client.core.ApiModel
import org.joda.time.DateTime
case class Permission (
/* Grant permission to target user or public so they may access measurements within the given parameters. TODO: Rename target to something more intuitive. */
target: Int,
/* ORIGINAL Var... | QuantiModo/QuantiModo-SDK-Akka-Scala | src/main/scala/io/swagger/client/model/Permission.scala | Scala | gpl-2.0 | 868 |
/*
* 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 ... | mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/vta/hardware/chisel/src/main/scala/core/TensorStore.scala | Scala | apache-2.0 | 6,676 |
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.