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 io.scalajs.nodejs
/**
* tty package object
* @author [email protected]
*/
package object tty {
/**
* Write Stream Events
* @param stream the given [[WriteStream stream]]
*/
implicit class WriteStreamEvents(val stream: WriteStream) extends AnyVal {
/**
* The 'resize' e... | scalajs-io/nodejs | app/common/src/main/scala/io/scalajs/nodejs/tty/package.scala | Scala | apache-2.0 | 663 |
package cromwell.engine.io.gcs
import com.google.api.client.util.DateTime
import com.google.api.services.storage.model.Bucket.Owner
case class GcsBucketInfo(bucketName: String, location: String, timeCreated: DateTime, owner: Owner) | dgtester/cromwell | src/main/scala/cromwell/engine/io/gcs/GcsBucketInfo.scala | Scala | bsd-3-clause | 233 |
package articles.config
import articles.ArticleComponents
import articles.models.{Article, ArticleId}
import articles.repositories.ArticleRepo
import commons.repositories.ActionRunner
import testhelpers.TestUtils
import scala.concurrent.duration.DurationInt
trait ArticleTestComponents {
_: ArticleComponents =>
... | Dasiu/play-framework-test-project | test/articles/config/ArticleTestComponents.scala | Scala | mit | 942 |
package blended.testsupport.retry
import scala.concurrent.Await
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import scala.concurrent.duration._
import akka.actor.Scheduler
import blended.util.logging.Logger
object Retry {
/**
* Executed and in case of an failure retries an operation ... | lefou/blended | blended.testsupport/src/main/scala/blended/testsupport/retry/Retry.scala | Scala | apache-2.0 | 2,513 |
package com.korpisystems.SimpleANN
import Math._
abstract class Activator {
def activation(x: NodeSignal): NodeSignal
def derivative(x: NodeSignal): NodeSignal
}
object sigmoid extends Activator {
def activation(x: NodeSignal): NodeSignal = {
1 / (1 + pow(E, -x))
}
def derivative(x: NodeSignal): Node... | rdtaylor/SimpleANN | src/main/scala/com/korpisystems/SimpleANN/Activator.scala | Scala | mit | 353 |
package de.metacoder.edwardthreadlocal.analysis.datamodel
import de.metacoder.edwardthreadlocal.analysis.AnalysisSetup
sealed trait ValueInstanceID {
def refersToNull:Boolean
}
object ValueInstanceID {
def of(value:AnyRef)(implicit setup:AnalysisSetup):ValueInstanceID = setup idOfValue value
private[analysis] ... | metacoder/edward-tl | agent-impl/src/main/scala/de/metacoder/edwardthreadlocal/analysis/datamodel/ValueInstanceID.scala | Scala | apache-2.0 | 856 |
/*
* 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 ... | mike0sv/spark | sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala | Scala | apache-2.0 | 23,837 |
package collins.callbacks
/**
* Represents the results of a regular expression.
*
* This exists to capture the results of applying a regular expression against a source string. For
* example assume the source string is: 'run_command --tag=<tag> --withStatus=<status>'
*
* The results of applying a regular express... | discordianfish/collins | app/collins/callbacks/MethodReplacement.scala | Scala | apache-2.0 | 1,305 |
package retry
import odelay.{ Delay, Timer }
import scala.concurrent.{ Future, ExecutionContext }
import scala.concurrent.duration.{ Duration, FiniteDuration }
import scala.language.implicitConversions
import scala.util.control.NonFatal
import java.util.concurrent.TimeUnit
// This case class and its implicit conversi... | ExNexu/retry | src/main/scala/Policy.scala | Scala | mit | 6,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... | dchenbecker/kafka-sbt | core/src/main/scala/kafka/server/KafkaServer.scala | Scala | apache-2.0 | 5,058 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | armeniaca/rudder | rudder-core/src/main/scala/com/normation/cfclerk/services/GitUtils.scala | Scala | gpl-3.0 | 2,846 |
package mypipe.util
import org.slf4j.LoggerFactory
object Lists {
protected val log = LoggerFactory.getLogger(getClass)
def processList[T](
list: List[T],
listOp: (T) ⇒ Boolean,
onError: (List[T], T) ⇒ Boolean
): Boolean = {
list.forall(item ⇒ {
val res = try { listOp(item) } catch ... | mardambey/mypipe | mypipe-api/src/main/scala/mypipe/util/Lists.scala | Scala | apache-2.0 | 600 |
package scuff.web
import scuff.Document
import scuff.js._
import scuff.concurrent.{ ResourcePool, Threads, UnboundedResourcePool }
import java.io.Writer
import java.net.URL
import java.util.concurrent.ScheduledFuture
import java.util.concurrent.ScheduledExecutorService
import javax.script._
import scala.concurrent.d... | nilskp/scuff | src/main/scala/scuff/web/CoffeeScriptServlet.scala | Scala | mit | 3,929 |
package doodle
import org.scalacheck.{Arbitrary, Gen}
object arbitrary {
import doodle.core._
import doodle.core.Color.{RGBA,HSLA}
val genAngle: Gen[Angle] =
Gen.choose(-36.0, 36.0).map { angle => Angle(angle) }
val genPoint: Gen[Point] =
for {
x <- Gen.choose(-1000.0, 1000.0)
y <- Gen.c... | underscoreio/doodle | core/shared/src/test/scala/doodle/arbitrary.scala | Scala | apache-2.0 | 2,053 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This... | beangle/commons | core/src/main/scala/org/beangle/commons/conversion/converter/MapConverterFactory.scala | Scala | lgpl-3.0 | 1,872 |
package im.actor.server.bot
import akka.actor._
import akka.cluster.singleton.{ ClusterSingletonManager, ClusterSingletonManagerSettings }
import akka.http.scaladsl.util.FastFuture
import akka.pattern.pipe
import akka.stream.scaladsl.{ Sink, Source }
import akka.stream.{ ActorMaterializer, OverflowStrategy }
import ak... | ufosky-server/actor-platform | actor-server/actor-bots/src/main/scala/im/actor/server/bot/InternalBot.scala | Scala | agpl-3.0 | 2,486 |
package basinet
import scala.annotation.tailrec
object LineWire {
def isNewline(c: Character) = {
val code = c.toInt
if(code >= 10 && code <= 13) true else false
}
}
package line {
final class Source {
private[this] var _builder = new StringBuilder
private[this] var _complete = false
privat... | sopindm/basinet | scala/LineWire.scala | Scala | epl-1.0 | 3,442 |
package wow.realm.protocol.payloads
import wow.realm.protocol._
import scodec.Codec
import scodec.codecs._
/**
* Server time sync request
*/
case class ServerTimeSyncRequest(number: Long) extends Payload with ServerSide {
require(number >= 0)
}
object ServerTimeSyncRequest {
implicit val opCodeProvider: OpCo... | SKNZ/SpinaciCore | wow/core/src/main/scala/wow/realm/protocol/payloads/ServerTimeSyncRequest.scala | Scala | mit | 484 |
package chandu0101.scalajs.react.components.util
import japgolly.scalajs.react.TopNode
import org.scalajs.dom.Event
import scala.scalajs.js
import scala.scalajs.js.Dynamic.{global => g}
object CssEvents {
def testSupportedProps(props: Map[String, String]) = {
val el = g.document.createElement("div")
prop... | mproch/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/util/CssEvents.scala | Scala | apache-2.0 | 1,143 |
package latis.dm
import latis.data.Data
import latis.metadata.Metadata
import java.nio.ByteBuffer
import latis.util.DataUtils
/**
* A single variable (Scalar) that represents an arbitrary binary 'blob'.
*/
trait Binary extends Scalar
object Binary {
/**
* Construct a Binary variable from a ByteBuffer.
... | dlindhol/LaTiS | src/main/scala/latis/dm/Binary.scala | Scala | epl-1.0 | 2,953 |
package com.scrumwall.dao.item
import com.scrumwall.domain.Item
import com.scrumwall.domain.Column
import com.scrumwall.dao.BaseDao
import com.scrumwall.identifiers.ItemRemoveMode
import java.util.List
trait ItemDao extends BaseDao {
def get(itemId: Int) : Item
/**
* Based on whether the item has id or not, eith... | johnnyyen/scrumwall | src/main/java/com/scrumwall/dao/item/ItemDao.scala | Scala | gpl-3.0 | 646 |
package my.delite.framework.codegen.cuda
import my.delite.framework.codegen.MyTarget
trait MyTargetCuda extends MyTarget {
import IR._
val name = "Cuda"
}
| alsam/simple-delite-project | src/cudagen/simple/mydelite/MyTargetCuda.scala | Scala | mit | 162 |
import scala.util.parsing.combinator._
class ExprParser extends RegexParsers {
val number = "[0-9]+".r
def expr: Parser[Int] = term ~ rep(
("+" | "-") ~ term ^^ {
case "+" ~ t => t
case "-" ~ t => -t
}) ^^ { case t ~ r => t + r.sum }
def term: Parser[Int] = factor into { first =>
rep("*... | yeahnoob/scala-impatient-2e-code | src/ch20/sec07/ExprParser.scala | Scala | gpl-3.0 | 609 |
package de.frosner.ddq.reporters
import java.io.PrintStream
import de.frosner.ddq.core.CheckResult
/**
* A class which produces a markdown report of [[CheckResult]].
*
* @param stream The [[java.io.PrintStream]] to put the output. The stream will not be closed internally and can
* be reused.
**/
c... | FRosner/drunken-data-quality | src/main/scala/de/frosner/ddq/reporters/MarkdownReporter.scala | Scala | apache-2.0 | 1,073 |
package com.twitter.finagle.filter
import com.twitter.concurrent.AsyncSemaphore
import com.twitter.finagle._
import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver}
import com.twitter.util.{Future, Return, Throw}
object RequestSemaphoreFilter {
val role = Stack.Role("RequestConcurrencyLimit")
case cl... | luciferous/finagle | finagle-core/src/main/scala/com/twitter/finagle/filter/RequestSemaphoreFilter.scala | Scala | apache-2.0 | 1,518 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package expr
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.lang.psi.api.statements.params._
/**
* @author Alexander Podkhalyuzin, ilyas
*/
trait ScFunctionExpr extends ScExpression with ScControlFlowOwner {
def par... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/api/expr/ScFunctionExpr.scala | Scala | apache-2.0 | 813 |
package org.workcraft.dom.visual.connections
import java.awt.Color
import java.awt.Graphics2D
import java.awt.Shape
import java.awt.geom.Point2D
import java.awt.geom.Rectangle2D
import org.workcraft.graphics.ColorisableGraphicalContent
import org.workcraft.graphics.Touchable
import org.workcraft.scala.Expressions._
im... | tuura/workcraft-2.2 | ScalaGraphEditorUtil/src/main/scala/org/workcraft/dom/visual/connections/VisualConnectionGui.scala | Scala | gpl-3.0 | 4,458 |
package org.jetbrains.plugins.scala.lang.parameterInfo.functionParameterInfo
class FunctionParameterInfoConstructorsTest extends FunctionParameterInfoTestBase {
override def getTestDataPath: String =
s"${super.getTestDataPath}constructors/"
def testAnnotations(): Unit = doTest()
def testMemberModifiers():... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/parameterInfo/functionParameterInfo/FunctionParameterInfoConstructorsTest.scala | Scala | apache-2.0 | 956 |
object ScalaHelloWorld extends App{
println("Hello World from Scala!!!")
}
| javavsscala/compare | day-1/src/main/scala/ScalaHelloWorld.scala | Scala | apache-2.0 | 78 |
package com.arcusys.valamis.lesson.service
import java.io.File
import com.arcusys.valamis.lesson.model.Lesson
/**
* Created by mminin on 16.02.16.
*/
trait CustomPackageUploader {
def isValidPackage(fileName: String, packageFile: File): Boolean
def upload(title: String,
description: String,
... | arcusys/Valamis | valamis-lesson/src/main/scala/com/arcusys/valamis/lesson/service/CustomPackageUploader.scala | Scala | gpl-3.0 | 447 |
package io.buoyant.linkerd
package protocol
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.core.{JsonParser, TreeNode}
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer, JsonNode}
import com.... | hhtpcd/linkerd | linkerd/protocol/h2/src/main/scala/io/buoyant/linkerd/protocol/H2Config.scala | Scala | apache-2.0 | 5,996 |
package org.ucombinator.jaam.main
import org.rogach.scallop._
import java.io._
import scala.collection.JavaConverters._
import org.ucombinator.jaam.util.Log
class Main(args : Seq[String]) extends ScallopConf(args = args) with JaamConf {
shortSubcommandsHelp(true)
// TODO: version: jvm version? Jaam-file header ha... | Ucombinator/jaam | src/main/scala/org/ucombinator/jaam/main/Main.scala | Scala | bsd-2-clause | 16,259 |
package uk.gov.gds.ier.mustache
import uk.gov.gds.ier.guice.{WithRemoteAssets, WithConfig}
trait ErrorPageMustache extends InheritedGovukMustache {
self: WithRemoteAssets
with WithConfig =>
object ErrorPage {
case class ServerError() extends ArticleMustachio ("error/serverError")
case class NotFoun... | michaeldfallen/ier-frontend | app/uk/gov/gds/ier/mustache/ErrorPageMustache.scala | Scala | mit | 519 |
package ml.combust.mleap.core.util
import ml.combust.mleap.tensor.{DenseTensor, SparseTensor}
import org.scalatest.FunSpec
class VectorConvertersSpec extends FunSpec {
describe("mleapTensorToSparkVector works when") {
it("using a Sparse Tensor") {
val vec = Seq(1.0, 0, 3.0)
val indices = Seq(0, 2).... | combust/mleap | mleap-core/src/test/scala/ml/combust/mleap/core/util/VectorConvertersSpec.scala | Scala | apache-2.0 | 1,160 |
package org.jetbrains.plugins.scala.lang.psi.api.statements
import com.intellij.psi.PsiComment
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScDocCommentOwner
import org.jetbrains.plugins.scala.lang.scaladoc.psi.api.ScDocComment
/**
* @au... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/statements/ScCommentOwner.scala | Scala | apache-2.0 | 802 |
package models.services
import java.util.UUID
import javax.inject.Inject
import com.mohiva.play.silhouette.api.LoginInfo
import com.mohiva.play.silhouette.impl.providers.CommonSocialProfile
import models.{DefaultRole, User}
import models.daos.UserDAO
import play.api.libs.concurrent.Execution.Implicits._
import scala... | OpenCompare/OpenCompare | org.opencompare/play-app/app/models/services/UserServiceImpl.scala | Scala | apache-2.0 | 2,014 |
import com.hypertino.binders.json.JsonBinders
import org.scalatest.{FlatSpec, Matchers}
case class TestBoolean(booleanVal: Boolean)
case class TestBooleanN(booleanValN1: Option[Boolean], booleanValN2: Option[Boolean])
case class TestBooleanArray(booleanArray: Seq[Boolean])
case class TestBooleanArrayN(booleanArrayN: ... | hypertino/json-binders | jsonBinders/shared/src/test/scala/TestBooleanJsonSerializer.scala | Scala | bsd-3-clause | 2,045 |
/*
* 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... | anilgursel/squbs | squbs-ext/src/main/scala/org/squbs/streams/circuitbreaker/impl/AtomicCircuitBreakerState.scala | Scala | apache-2.0 | 14,850 |
/*
* Copyright 2014 Frugal Mechanic (http://frugalmechanic.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... | frugalmechanic/fm-lazyseq | src/main/scala-2.12/fm/lazyseq/LazySeqIterator.scala | Scala | apache-2.0 | 912 |
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt
import scala.concurrent.{ Promise => XPromise }
final class PromiseWrap[A] {
private[sbt] val underlying: XPromise[A] = XPromise()
def complete(result: Resu... | xuwei-k/xsbt | main-settings/src/main/scala/sbt/PromiseWrap.scala | Scala | apache-2.0 | 644 |
package org.jetbrains.sbt.project.data
import java.io.File
import java.net.URI
import com.intellij.openapi.externalSystem.model.project.AbstractExternalEntityData
import com.intellij.openapi.externalSystem.model.{Key, ProjectKeys}
import org.jetbrains.plugins.scala.project.Version
import org.jetbrains.sbt.project.Sbt... | loskutov/intellij-scala | src/org/jetbrains/sbt/project/data/dataObjects.scala | Scala | apache-2.0 | 4,201 |
/*
* 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 ... | ron8hu/spark | core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala | Scala | apache-2.0 | 13,359 |
/*
* 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 ... | tillrohrmann/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/utils/UserDefinedTableFunctions.scala | Scala | apache-2.0 | 14,832 |
/*
* 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 ... | chaordic/ignition-core | src/main/scala/ignition/core/testsupport/spark/SharedSparkContext.scala | Scala | mit | 1,563 |
package lila.pref
import play.api.data._
import play.api.data.Forms._
import lila.user.User
private[pref] final class DataForm {
val pref = Form(mapping(
"autoQueen" -> number.verifying(Pref.AutoQueen.choices.toMap contains _),
"autoThreefold" -> number.verifying(Pref.AutoThreefold.choices.toMap contains ... | pavelo65/lila | modules/pref/src/main/DataForm.scala | Scala | mit | 4,948 |
/*
* Copyright 2015 Philip L. McMahon
*
* Philip L. McMahon 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 ... | rascql/rascql | src/main/scala/rascql/postgresql/stream/Startup.scala | Scala | apache-2.0 | 2,490 |
package commons.utils
import slick.dbio.DBIO
object DbioUtils {
def optionToDbio[A](someVal: Option[A], failureReason: Throwable = new NoSuchElementException): DBIO[A] = {
someVal match {
case Some(v) => DBIO.successful(v)
case None => DBIO.failed(failureReason)
}
}
}
| Dasiu/play-framework-test-project | app/commons/utils/DbioUtils.scala | Scala | mit | 295 |
package codegen
import protocbridge.codegen._
import com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse.File
object LocalGen extends CodeGenApp {
def process(request: CodeGenRequest): CodeGenResponse = {
CodeGenResponse.succeed(
Seq(
File.newBuilder
.setName("LocalGen.scala"... | thesamet/sbt-protoc | src/sbt-test/settings/caching/codegen/src/main/scala/codegen/LocalGen.scala | Scala | apache-2.0 | 421 |
package br.unb.cic.poo.gol.base
import scala.io.StdIn.{readInt, readLine}
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.glutils.ShapeRende... | labm1997/Gol | base/src/main/scala/br/unb/cic/poo/gol/base/GameView.scala | Scala | gpl-3.0 | 6,952 |
package org.refptr.iscala
package object msg {
type Metadata = Map[String, String]
val Metadata = Map
}
| nkhuyu/IScala | src/main/scala/Types.scala | Scala | mit | 113 |
package permute
import scala.Predef.intWrapper
import scala.Predef.augmentString
import scala.{Int, Boolean, Unit}
import java.lang.String
object PermuteBenchmark extends communitybench.Benchmark {
val inputOutput: (String, String) = ("6", "720")
def run(input: String): Int = {
val size = input.toInt
... | sjrd/scalajs-benchmarks | permute/src/main/scala/permute/PermuteBenchmark.scala | Scala | bsd-3-clause | 626 |
/**
* 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... | flange/drift-dev | kafka/00-kafka_2.11-0.10.1.0/libs/tmp/kafka/controller/PartitionLeaderSelector.scala | Scala | apache-2.0 | 11,876 |
package fpinscala.errorhandling
import scala.{Option => _, Some => _, Either => _, _} // hide std library `Option`, `Some` and `Either`, since we are writing our own in this chapter
sealed trait Option[+A] {
def map[B](f: A => B): Option[B] = this match {
case Some(a) => Some(f(a))
case none => None
}
... | HolyHaddock/fpinscala | exercises/src/main/scala/fpinscala/errorhandling/Option.scala | Scala | mit | 3,585 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
import api.base.ScFieldId
import com.intellij.psi.stubs.{NamedStub}
/**
* User: Alexander Podkhalyuzin
* Date: 19.07.2009
*/
trait ScFieldIdStub extends NamedStub[ScFieldId] {
} | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/ScFieldIdStub.scala | Scala | apache-2.0 | 259 |
package es.weso.shex
import es.weso.shex.ShapeSyntax._
import es.weso.rdfgraph.nodes._
import es.weso.rdfgraph.statements._
import es.weso.rdfgraph._
import org.scalatest._
import org.scalatest.prop.PropertyChecks
import org.scalatest.prop.Checkers
import es.weso.shex.Typing._
import es.weso.shex.Context._
import es.w... | jorgeyp/ShExcala | src/test/scala/es/weso/shex/ShapeValidatorRule.scala | Scala | mit | 2,982 |
package chandu0101.scalajs.react.components
package materialui
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import scala.scalajs.js
import scala.scalajs.js.`|`
/**
* This file is generated - submit issues instead of PR against it
*/
case class MuiGridList(
key: js.UndefOr[Stri... | elacin/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/materialui/MuiGridList.scala | Scala | apache-2.0 | 1,279 |
/**
* Copyright (C) 2014 TU Berlin ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required... | peelframework/peel | peel-extensions/src/main/scala/org/peelframework/hadoop/beans/system/Yarn.scala | Scala | apache-2.0 | 5,659 |
package org.jetbrains.plugins.scala
package codeInspection.collections
import java.awt.{Component, GridLayout}
import java.util
import javax.swing._
import javax.swing.border
import javax.swing.event.{ChangeEvent, ChangeListener}
import com.intellij.codeInspection.{ProblemHighlightType, ProblemsHolder}
import com.int... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/collections/OperationOnCollectionInspectionBase.scala | Scala | apache-2.0 | 7,508 |
package org.bitcoins.core.script.stack
import org.bitcoins.core.script.{ ExecutedScriptProgram, ScriptProgram }
import org.bitcoins.core.script.bitwise.OP_EQUAL
import org.bitcoins.core.script.constant._
import org.bitcoins.core.util.{ BitcoinSUtil, ScriptProgramTestUtil, TestUtil }
import org.scalatest.{ FlatSpec, Mu... | Christewart/bitcoin-s-core | src/test/scala/org/bitcoins/core/script/stack/StackInterpreterTest.scala | Scala | mit | 18,249 |
package org.dmpp.adf.command
import scopt.OptionParser
import org.dmpp.adf.app._
import java.io.{File, FileOutputStream}
case class Config(command: String="dir", verbose: Boolean=false, files: Seq[File]=Seq())
object Main {
def executeCommand(config: Config) {
config.command match {
case "create" =>
... | weiju/adf-tools | app/src/main/scala/org/dmpp/adf/command/Command.scala | Scala | bsd-3-clause | 2,048 |
package de.tu_berlin.impro3.core
import net.sourceforge.argparse4j.inf.{Namespace, Subparser}
object Algorithm {
abstract class Command[A <: Algorithm](implicit val m: scala.reflect.Manifest[A]) {
/**
* Algorithm key.
*/
def name: String
/**
* Algorithm name.
*/
def descriptio... | joroKr21/spatio-temporal-dynamics | impro3-ws14-core/src/main/scala/de/tu_berlin/impro3/core/Algorithm.scala | Scala | apache-2.0 | 899 |
package com.nekopiano.scala.processing.sandbox.sample.glow
import com.nekopiano.scala.processing.{ScalaPAppCompanion, TwoDimensionalPApp}
/**
* Created on 07/08/2016.
*/
class WaveClockApp extends TwoDimensionalPApp {
// Jan 2009
// http://www.abandonedart.org
// http://www.zenbullets.com
//
// This wo... | lamusique/ScalaProcessing | samples/src/test/scala/com/nekopiano/scala/processing/sandbox/sample/glow/WaveClock.scala | Scala | apache-2.0 | 2,659 |
import collection.immutable.{RedBlackTree => RB}
import org.scalacheck._
import Prop._
import Gen._
/*
Properties of a Red & Black Tree:
A node is either red or black.
The root is black. (This rule is used in some definitions and not others. Since the
root can always be changed from red to black but not necessarily v... | felixmulder/scala | test/files/scalacheck/redblacktree.scala | Scala | bsd-3-clause | 9,865 |
package java.util
import scalajs.js
import scala.annotation.tailrec
import scala.reflect.ClassTag
import scala.collection.immutable
object Arrays {
@inline
private final implicit def naturalOrdering[T <: AnyRef]: Ordering[T] = {
new Ordering[T] {
def compare(x: T, y: T): Int = x.asInstanceOf[Compara... | lrytz/scala-js | javalib/src/main/scala/java/util/Arrays.scala | Scala | bsd-3-clause | 25,438 |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import java.util.concurrent.TimeUnit
import akka.actor.ActorSystem
import akka.pattern.ask
import akka.util.Timeou... | cqrs-endeavour/cqrs-framework-sample | src/main/scala/ReadModelMain.scala | Scala | mpl-2.0 | 2,195 |
/*
* 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 ... | maropu/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonParsingOptionsSuite.scala | Scala | apache-2.0 | 5,035 |
package com.sfxcode.sapphire.core.el
import javax.el.MethodNotFoundException
object ObjectExpressionHelper {
val TempObjectName = "_self"
val TempValueName = "_tempValue"
val ExpressionPrefix = "${"
val FxmlExpressionPrefix: String = "!{"
def getValue(obj: AnyRef, expressionString: String, clazz: Class[Any... | sfxcode/sapphire-core | src/main/scala/com/sfxcode/sapphire/core/el/ObjectExpressionHelper.scala | Scala | apache-2.0 | 2,111 |
/**
* 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 not us... | zzwlstarby/mykafka | core/src/test/scala/integration/kafka/api/ProducerBounceTest.scala | Scala | apache-2.0 | 7,965 |
package defend.shard
import akka.actor.{ ActorSystem, PoisonPill, Props, Terminated }
import akka.testkit.{ TestKit, TestProbe }
import com.typesafe.config.ConfigFactory
import defend.game.GameEngine.Protocol.RocketFired
import defend.model._
import defend.shard.TowerActor.Protocol.{ ExperienceGained, Ping, Situation ... | otrebski/reactive-missile-defend | src/test/scala/defend/shard/TowerActorTest.scala | Scala | apache-2.0 | 4,787 |
/*
* Copyright 2017 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | GoogleCloudDataproc/cloud-dataproc | spark-tensorflow/prepare/src/test/scala/com/google/cloud/ml/samples/criteo/CriteoImporterTest.scala | Scala | apache-2.0 | 1,470 |
/*
* 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 ... | vinodkc/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala | Scala | apache-2.0 | 100,019 |
/*
* #%L
* Core runtime for OOXOO
* %%
* Copyright (C) 2006 - 2017 Open Design Flow
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License,... | richnou/ooxoo-core | ooxoo-core/src/main/scala/com/idyria/osi/ooxoo/core/buffers/datatypes/URIBuffer.scala | Scala | agpl-3.0 | 2,750 |
/*
* 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 ... | WindCanDie/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/LocalDirsFeatureStep.scala | Scala | apache-2.0 | 3,039 |
package scala.meta
package tokens
import scala.math.ScalaNumber
import scala.meta.internal.tokens._
import scala.meta.inputs._
import scala.meta.classifiers._
import scala.meta.prettyprinters._
import scala.meta.internal.prettyprinters._
// NOTE: `start` and `end` are String.substring-style,
// i.e. `start` is inclus... | scalameta/scalameta | scalameta/tokens/shared/src/main/scala/scala/meta/tokens/Token.scala | Scala | bsd-3-clause | 8,031 |
/*
* Copyright (c) 2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org... | jramos/iglu-scala-client | src/test/scala/com.snowplowanalytics.iglu.client/SchemaCriterionSpec.scala | Scala | apache-2.0 | 3,077 |
import scala.tools.partest._
// Type constructors for FunctionN and TupleN should not be considered as function type / tuple types.
object Test extends DirectTest {
def code = ""
def show(): Unit = {
val global = newCompiler()
new global.Run()
import global._, definitions._
val function0TC = Func... | scala/scala | test/files/run/t7876.scala | Scala | apache-2.0 | 754 |
object BobAndBombs extends App {
val in = io.Source.stdin.getLines()
val t = in.next.toInt
for(_ <- (1 to t)){
val mapping = " " + in.next + " "
var count = 0
for (i <- (2 until mapping.size - 2)){
if(mapping.charAt(i) == 'W'){
if(mapping.substring(i-2, i+3).exists(_ == 'B')) count +=... | clemus90/competitive-programming | hackerEarth/practice/basicProgramming/implementation/BobAndBombs.scala | Scala | mit | 362 |
package io.scalac.amqp
import com.typesafe.config.ConfigFactory
import org.scalatest.{FlatSpec, Matchers}
import scala.collection.immutable.Seq
import scala.concurrent.duration._
class ConnectionSettingsSpec extends FlatSpec with Matchers {
val referenceSettings =
ConnectionSettings(
addresses =... | davidwrpayne/reactive-rabbit | src/test/scala/io/scalac/amqp/ConnectionSettingsSpec.scala | Scala | apache-2.0 | 1,303 |
/*
* Copyright 2007-2008 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | beni55/liftweb | lift-util/src/test/scala/net/liftweb/util/BoxSpec.scala | Scala | apache-2.0 | 9,702 |
package multithreading
/**
* Created by Om Prakash C on 16-06-2017.
*/
object ParallelCollection extends App {
def fib(n: Int): Int = if (n<2) 1 else fib(n-1)+fib(n-2)
for (i <- (30 to 15 by -1).par) {
println(fib(i))
}
}
| comprakash/learning-scala | concurrency/src/main/scala/multithreading/ParallelCollection.scala | Scala | gpl-3.0 | 238 |
package org.jetbrains.plugins.scala.lang.psi.impl
import com.intellij.psi.search.{GlobalSearchScope, LocalSearchScope, PackageScope, SearchScope}
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.psi.{PsiElement, PsiNamedElement, PsiPackage, PsiReference}
import org.jetbrains.plugins.scala.extensions._
impo... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/impl/ScalaUseScope.scala | Scala | apache-2.0 | 7,807 |
import java.util.Collections
import java.util.concurrent._
/**
* Created by yangguo on 15/9/28.
*/
class Task(val id:Int) extends Runnable{
override def equals(obj: scala.Any): Boolean = {
var res=false
if(obj!=null&&obj.isInstanceOf[Task]) {
val _tmp=obj.asInstanceOf[Task]
if(_tmp.id==this.id)... | guoyang2011/flashbird | src/test/scala-2.10/TestExcutores.scala | Scala | apache-2.0 | 1,662 |
package io.udash.web.homepage
import io.udash._
class RoutingRegistryDef extends RoutingRegistry[RoutingState] {
def matchUrl(url: Url): RoutingState =
url2State.applyOrElse("/" + url.value.stripPrefix("/").stripSuffix("/"), (_: String) => ErrorState)
def matchState(state: RoutingState): Url =
Url(state2... | UdashFramework/udash-core | guide/homepage/.js/src/main/scala/io/udash/web/homepage/RoutingRegistryDef.scala | Scala | apache-2.0 | 469 |
package org.jetbrains.plugins.scala.lang.psi.api.expr
import com.intellij.openapi.project.DumbService
import com.intellij.psi.{PsiAnnotation, ResolveResult}
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement
import org.jetbrains.plugins.scala.lang.psi.api.base.types.ScTypeElement
import org.jetbrains.plugins.... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/psi/api/expr/ScAnnotation.scala | Scala | apache-2.0 | 1,331 |
package com.stripe.bonsai
package layout
import java.io.{ DataOutput, DataInput }
case class DisjunctionLayout[A, B, C](
leftLayout: Layout[A],
rightLayout: Layout[B],
unpack: C => Either[A, B],
mkLeft: A => C,
mkRight: B => C
) extends Layout[C] {
def newBuilder: DisjunctionBuilder[A, B, C] =
new Dis... | stripe/bonsai | bonsai-core/src/main/scala/com/stripe/bonsai/layout/DisjunctionLayout.scala | Scala | mit | 2,669 |
package org.jetbrains.plugins.scala.lang.psi.implicits
import com.intellij.psi.{PsiElement, PsiFile}
import org.jetbrains.plugins.scala.extensions.{PsiElementExt, childOf}
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
import org.jetbrains.plugins.scala.lang.psi.api.base.{ScMethodLike, ScPrimaryConstructor}... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/implicits/ImplicitSearchScope.scala | Scala | apache-2.0 | 2,043 |
package breeze.polynomial
import breeze.numerics._
import breeze.generic._
import breeze.linalg.{DenseVector, DenseMatrix}
import spire.math._
import spire.math.poly._
import spire.algebra._
import spire.implicits._
trait DensePolynomial {
object densePolyval extends UFunc {
implicit object doubleImpl extends I... | wavelets/breeze | src/main/scala/breeze/polynomial/DensePolynomial.scala | Scala | apache-2.0 | 2,511 |
/*
* 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 ... | abhishekshivanna/samza | samza-core/src/test/scala/org/apache/samza/container/TestSamzaContainer.scala | Scala | apache-2.0 | 15,365 |
package io.youi.form
import org.scalajs.dom.{Event, html}
class FormInput(formSupport: FormSupport, val element: html.Element) {
val error: FieldError = formSupport.createFieldError(this)
element.addEventListener("focus", (_: Event) => {
if (formSupport.clearErrorOnFocus) {
error.clear()
}
})
e... | outr/youi | dom/src/main/scala/io/youi/form/FormInput.scala | Scala | mit | 3,493 |
/*
* 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 ... | goldmedal/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala | Scala | apache-2.0 | 28,823 |
package org.apache.datacommons.prepbuddy.examples
import org.apache.datacommons.prepbuddy.smoothers.SimpleMovingAverageMethod
import org.apache.datacommons.prepbuddy.types.CSV
import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}
object SmootherMain {
def main(args: Array[String]) {
... | blpabhishek/prep-buddy | src/main/scala/org/apache/datacommons/prepbuddy/examples/SmootherMain.scala | Scala | apache-2.0 | 1,308 |
package com.portia
import com.portia.algorithms.PageRank
/**
* Ranker main program
* @author duytd
*/
object RankerMain {
def main(args:Array[String]): Unit = {
val ranker = new PageRank
ranker.run()
}
}
| duytd/blackspider | src/main/scala/com/portia/RankerMain.scala | Scala | gpl-3.0 | 221 |
package filodb.gateway.conversion
import com.typesafe.scalalogging.StrictLogging
import debox.Buffer
import filodb.core.binaryrecord2.RecordBuilder
import filodb.core.metadata.{Schema, Schemas}
import filodb.memory.BinaryRegion
import filodb.memory.format.UnsafeUtils
import filodb.memory.format.vectors.{CustomBuckets... | tuplejump/FiloDB | gateway/src/main/scala/filodb/gateway/conversion/InfluxRecord.scala | Scala | apache-2.0 | 10,977 |
/***********************************************************************
* 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-fs/geomesa-fs-storage/geomesa-fs-storage-parquet/src/main/scala/org/locationtech/geomesa/parquet/AttributeWriter.scala | Scala | apache-2.0 | 7,189 |
package org.scaladebugger.api.profiles.traits.info.events
import com.sun.jdi.{Location, ObjectReference, ThreadReference, VirtualMachine}
import com.sun.jdi.event._
import com.sun.jdi.request.EventRequest
import org.scaladebugger.test.helpers.ParallelMockFunSpec
class MonitorEventSpec extends ParallelMockFunSpec {
... | ensime/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/profiles/traits/info/events/MonitorEventSpec.scala | Scala | apache-2.0 | 5,597 |
package glasskey.spray
import glasskey.model.OAuthErrorHelper
import spray.httpx.SprayJsonSupport
import spray.routing.HttpService
trait OAuthRejectionUnwrapper extends HttpService with SprayJsonSupport with OAuthErrorHelper {
import glasskey.model.ValidationError
import glasskey.spray.model.OAuthRejection
imp... | MonsantoCo/glass-key | glass-key-spray/src/main/scala/glasskey/spray/OAuthRejectionUnwrapper.scala | Scala | bsd-3-clause | 1,345 |
/**
* Copyright 2012-2014 Jorge Aliss (jaliss at gmail dot com) - twitter: @jaliss
*
* 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
*... | txbits/txbits | txbits/app/securesocial/core/UsernamePasswordProvider.scala | Scala | agpl-3.0 | 2,702 |
import java.io.File
trait Base {
val marker = new File("marker")
}
| mdedetrich/sbt | sbt/src/sbt-test/tests/test-quick/src/test/scala/Base.scala | Scala | bsd-3-clause | 69 |
package org.jetbrains.plugins.scala.worksheet.processor
import com.intellij.openapi.editor.Document
import com.intellij.psi._
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
private class WorksheetInterpretExprsIterator(
file: ScalaFile,
document: Document... | JetBrains/intellij-scala | scala/worksheet/src/org/jetbrains/plugins/scala/worksheet/processor/WorksheetInterpretExprsIterator.scala | Scala | apache-2.0 | 2,106 |
/*
* 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-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/CoGroupedStreams.scala | Scala | apache-2.0 | 8,456 |
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.