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 edu.gemini.ags.api
import edu.gemini.ags.api.AgsAnalysis.NotReachable
import edu.gemini.ags.api.AgsMagnitude.{MagnitudeCalc, MagnitudeTable}
import edu.gemini.catalog.api.CatalogQuery
import edu.gemini.pot.ModelConverters._
import edu.gemini.spModel.ags.AgsStrategyKey
import edu.gemini.spModel.core.{Angle, Ban... | spakzad/ocs | bundle/edu.gemini.ags/src/main/scala/edu/gemini/ags/api/AgsStrategy.scala | Scala | bsd-3-clause | 4,653 |
/*
* Copyright (c) 2015, Nightfall Group
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions a... | Nightfall/Instrumentality | core/src/main/scala/moe/nightfall/instrumentality/editor/gui/ModelChooserElement.scala | Scala | bsd-2-clause | 10,875 |
package scala.meta.tests
package contrib
import org.scalatest.FunSuite
import scala.meta._
import scala.meta.contrib._
class ModReplacementTest extends FunSuite {
test("Test replace class mods with no existing mods") {
val newClass = q"class Foo".withMods(mod"final" :: Nil)
assert(newClass.hasMod(mod"final... | DavidDudson/scalameta | tests/shared/src/test/scala/scala/meta/tests/contrib/ModReplacementTest.scala | Scala | bsd-3-clause | 1,200 |
class Bar extends JavaFoo with Foo {
def read(): Int = ???
}
@main def Test =
val stdout = new Bar
| som-snytt/dotty | tests/run/i8101/Test.scala | Scala | apache-2.0 | 104 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | monix-java/src/main/scala/monix/java8/execution/package.scala | Scala | apache-2.0 | 3,293 |
abstract class PsiStackOverflowError {
case class TGItem(tg: String) extends TreeItem[SportsmanItem] {
def children = List()
}
case class SportsmanItem(user: String) extends TreeItem[SportsmanItem] {
def children = List()
}
val tree = new Tree[TreeItem.Min]() {
def setContent(trainingGroups: It... | ilinum/intellij-scala | testdata/resolve2/bug3/SOE.scala | Scala | apache-2.0 | 875 |
/*
* Copyright 2009 Ilja Booij
*
* This file is part of GarminTrainer.
*
* GarminTrainer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any lat... | chmandrade/garmintrainer | src/test/scala/nl/iljabooij/garmintrainer/model/StartTrackPointTest.scala | Scala | gpl-3.0 | 2,076 |
/*
* Copyright 2014–2017 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | drostron/quasar | web/src/test/scala/quasar/api/MessageFormatGen.scala | Scala | apache-2.0 | 2,126 |
package at.fabricate.liftdev.common
package model
import net.liftweb.mapper.KeyedMetaMapper
import net.liftweb.mapper.LongKeyedMapper
import net.liftweb.mapper.By
import net.liftweb.mapper.KeyedMapper
trait MatchByID [T <: (KeyedMapper[Long,T]) ] {
self: T =>
// add an Object for pattern matching
final ... | Fabricate/OpenthingsImplementation | src/main/scala/at/fabricate/liftdev/common/model/MatchByID.scala | Scala | lgpl-3.0 | 455 |
import org.scalatest.FlatSpec
import org.scalatest.Matchers
import Utils.java2js
class InfixSpec extends FlatSpec with Matchers {
import Utils._
"An InfixExpression" should " with extended ops should translate cleanly" in {
val java =
"""
class Test {
int calc() {
return 1 + 2 + 3;
... | bjornharrtell/java2estree | src/test/scala/InfixSpec.scala | Scala | mit | 1,537 |
package de.sciss.fscape
import de.sciss.kollflitz.Vec
import de.sciss.numbers
import scala.concurrent.Promise
import scala.math.{cos, pow}
class DEnvGenSpec extends UGenSpec {
"The DEnvGen UGen" should "work as intended" in {
val p = Promise[Vec[Double]]()
val levels = Seq(0.0, -1.0, 1.0, 0.1)
val l... | Sciss/FScape-next | core/jvm/src/test/scala/de/sciss/fscape/DEnvGenSpec.scala | Scala | agpl-3.0 | 1,592 |
/*
* 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 ... | jatin9896/incubator-carbondata | streaming/src/main/scala/org/apache/carbondata/streaming/parser/FieldConverter.scala | Scala | apache-2.0 | 4,017 |
/*
* Copyright (c) 2015 Steven Soloff
*
* 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, copy, modify, merge, publi... | ssoloff/polyhedra-jvm | src/test/scala/io/github/ssoloff/polyhedra/ExpressionSpec.scala | Scala | mit | 11,475 |
/*
* 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/test/scala/org/apache/spark/sql/execution/streaming/sources/TextSocketStreamSuite.scala | Scala | apache-2.0 | 15,024 |
package es.codemotion.akkaships.common.domain
case class Result(message: String)
| miguel0afd/Akkaships | Common/src/main/scala/es/codemotion/akkaships/common/domain/Result.scala | Scala | apache-2.0 | 83 |
package mesosphere.marathon
package core.appinfo
import java.time.{OffsetDateTime, ZoneOffset}
import mesosphere.UnitTest
import mesosphere.marathon.core.health.Health
import mesosphere.marathon.core.instance.Instance.AgentInfo
import mesosphere.marathon.core.instance.{Instance, TestInstanceBuilder, TestTaskBuilder}
... | gsantovena/marathon | src/test/scala/mesosphere/marathon/core/appinfo/TaskStatsByVersionTest.scala | Scala | apache-2.0 | 4,554 |
package edu.jhu.hlt.probe
import scala.collection._
import edu.jhu.hlt.probe.util._
/**
* @author Tongfei Chen ([email protected]).
* @since 0.4.0
*/
class FeatureVector[A] {
private val g = mutable.HashMap[String, FeatureGroup[A]]()
def +=(fg: FeatureGroup[A]) = {
if (g contains fg.name) g(fg.name) ... | ctongfei/probe | core/src/main/scala/edu/jhu/hlt/probe/FeatureVector.scala | Scala | mit | 3,042 |
package edu.depauw.csc.scala.graphics;
import java.awt.Graphics
import java.awt.Graphics2D
import java.awt.geom.Rectangle2D
import java.awt.geom.Area
import java.awt.geom.AffineTransform
/**
Companion object for the square class which handles constructors.
@author Cory Boatright, [email protected]
@versi... | bhoward/EscalatorOld | ScalaGraphics/src/edu/depauw/csc/scala/graphics/Square.scala | Scala | apache-2.0 | 5,411 |
/*******************************************************************************
Copyright (c) 2012-2013, KAIST, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
**********************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/tests/FileTests.scala | Scala | bsd-3-clause | 20,705 |
/*
* Copyright (C) 2016 Lightbend Inc. <http://www.lightbend.com>
*/
package sample.chirper.load.api
import akka.NotUsed
import com.lightbend.lagom.javadsl.api.Descriptor
import com.lightbend.lagom.javadsl.api.ScalaService._
import com.lightbend.lagom.javadsl.api.Service
import com.lightbend.lagom.javadsl.api.Servic... | dotta/activator-lagom-scala-chirper | load-test-api/src/main/scala/sample/chirper/load/api/LoadTestService.scala | Scala | apache-2.0 | 1,035 |
package cxx
import scala.math._
object Example1 {
def main(args: Array[String]) {
//val用于声明可变变量
var count = 0
count += 1
println(count)
// val用于常量声明,不可改变
val constant = 0
//constant=1会报错
//apply方法可看作()重载
println("Hello"(4))
println("Hello".apply(4))
println(BigInt.apply("... | cxxspark/TEST | Example1.scala | Scala | apache-2.0 | 882 |
object Build extends sbt.Build {
lazy val root = (Project(id = "cronos", base = file("."))
aggregate(client, common, commonTest, gui, server, test)
settings(ScoverageSbtPlugin.instrumentSettings: _*)
)
lazy val common = (Project(id = "common", base = file("cronos-common"))
settings(ScoverageSbtPl... | D4RK0studio/cronos | project/Build.scala | Scala | gpl-3.0 | 357 |
package org.openurp.edu.eams.teach.web.action.selector
import org.beangle.data.jpa.dao.OqlBuilder
import org.beangle.commons.lang.Strings
import org.openurp.edu.base.code.StdLabel
import org.openurp.edu.base.Course
import org.openurp.edu.eams.web.action.BaseAction
class CourseSelector extends BaseAction {
def se... | openurp/edu-eams-webapp | web/src/main/scala/org/openurp/edu/eams/teach/web/action/selector/CourseSelector.scala | Scala | gpl-3.0 | 737 |
package com.twitter.finagle.stats
import com.twitter.finagle.benchmark.StdBenchAnnotations
import java.util.Random
import org.openjdk.jmh.annotations._
import org.openjdk.jmh.infra.Blackhole
// ./sbt 'project finagle-benchmark' 'run .*BucketedHistogramBenchmark.*'
class BucketedHistogramBenchmark extends StdBenchAnno... | cogitate/twitter-finagle-uuid | finagle-benchmark/src/main/scala/com/twitter/finagle/stats/BucketedHistogramBenchmark.scala | Scala | apache-2.0 | 1,368 |
/*
* Copyright 2015 Simin You
*
* 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 ... | giserh/SpatialSpark | src/main/scala/spatialspark/partition/stp/SortTilePartitionConf.scala | Scala | apache-2.0 | 982 |
/*
* Copyright 2015 Johan Andrén
*
* 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... | johanandren/futiles | src/test/scala/markatta/futiles/Spec.scala | Scala | apache-2.0 | 1,021 |
package com.twitter.finagle.thrift.transport.netty3
import org.apache.thrift.transport.TTransport
import org.jboss.netty.buffer.ChannelBuffer
/**
* Adapts a single Netty ChannelBuffer to a Thrift TTransport
*
* @param underlying a netty channelBuffer
*
*/
private[thrift] class ChannelBufferToTransport(underlyi... | BuoyantIO/finagle | finagle-thrift/src/main/scala/com/twitter/finagle/thrift/transport/netty3/ChannelBufferToTransport.scala | Scala | apache-2.0 | 1,612 |
/**
* Copyright (C) 2010 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 pr... | orbeon/orbeon-forms | xforms-runtime/shared/src/main/scala/org/orbeon/oxf/xforms/processor/handlers/xhtml/XFormsGroupHandler.scala | Scala | lgpl-2.1 | 2,522 |
package parser
import java.io._
import tokyocabinet._
import scala.util.Random
/**
* Generates the results file by pulling data from the Tokyo Cabinet
* databases created by other objects
*/
object ResultsGenerator {
import sbinary.DefaultProtocol._
import sbinary.Operations._
import scala.collection.jcl.Con... | eedrummer/gh-contest | src/parser/ResultsGenerator.scala | Scala | apache-2.0 | 1,953 |
package com.github.mdr.mash.utils
object Region {
def zeroWidth(offset: Int): Region = Region(offset, length = 0)
def apply(range: Range): Region = Region(range.start, range.length)
def fromStartEnd(start: Int, end: Int) = Region(start, end - start)
}
case class Region(offset: Int, length: Int) {
require(l... | mdr/mash | src/main/scala/com/github/mdr/mash/utils/Region.scala | Scala | mit | 2,091 |
package list
import list.P12.decode
import org.scalatest.{FlatSpec, ShouldMatchers}
class P12Spec extends FlatSpec with ShouldMatchers {
"decode" must "return an empty list when given an empty list" in {
val list = List()
decode(list) should be(Nil)
}
it must "return a list of one element when given a... | zjt1114/scala99 | src/test/scala/list/P12Spec.scala | Scala | apache-2.0 | 653 |
// Copyright (c) 2013-2020 Rob Norris and Contributors
// This software is licensed under the MIT License (MIT).
// For more information see LICENSE or https://opensource.org/licenses/MIT
package doobie.enumerated
import java.sql.Types._
import cats.Show
import cats.kernel.Order
import cats.kernel.instances.int._
/... | tpolecat/doobie | modules/core/src/main/scala/doobie/enumerated/jdbctype.scala | Scala | mit | 6,862 |
package com.faacets.qalg
package algos
package impl
import scala.{specialized => sp}
import spire.algebra._
import spire.math._
import spire.syntax.all._
import algebra._
import syntax.all._
final class DenseMutableRrefImpl[M, @sp(Double, Long) A](implicit val M: MatField[M, A], val MM: MatMut[M, A], pivotA: Pivot[... | denisrosset/qalg | core/src/main/scala/qalg/algos/impl/DenseMutableRrefImpl.scala | Scala | mit | 1,933 |
package controllers
import javax.inject.Inject
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc._
/**
* Created by akyao on 2015/11/19.
*/
class MiniC @Inject()(val messagesApi: MessagesApi) extends Controller with I18nSupport {
def imageLoad = Action {
Ok(views.html.mini.image_load())
... | akyao/ketsuco | app/controllers/MiniC.scala | Scala | mit | 324 |
package org.dmonix.area51.akka.cluster.extensions
import akka.actor.{Actor, ActorLogging, ActorSystem, Props}
import akka.cluster.Cluster
import akka.cluster.pubsub.DistributedPubSub
import akka.cluster.pubsub.DistributedPubSubMediator._
import org.dmonix.area51.akka.cluster.ClusterSettings
import org.dmonix.area51.ak... | pnerg/area51-akka | src/main/scala/org/dmonix/area51/akka/cluster/extensions/Subscriber.scala | Scala | apache-2.0 | 1,738 |
/* sbt -- Simple Build Tool
* Copyright 2011 Mark Harrah
*/
package sbt
import Def.{ showRelativeKey, ScopedKey }
import Project.showContextKey
import Keys.{ sessionSettings, thisProject }
import complete.{ DefaultParsers, Parser }
import Aggregation.{ KeyValue, Values }
import DefaultParsers._
import Types.idFun
i... | som-snytt/xsbt | main/src/main/scala/sbt/Act.scala | Scala | bsd-3-clause | 15,503 |
package org.orbeon.oxf.fr
import cats.syntax.option._
import io.circe.generic.auto._
import io.circe.syntax._
import org.orbeon.io.{CharsetNames, IOUtils}
import org.orbeon.oxf.externalcontext.URLRewriter
import org.orbeon.oxf.fr.Names.{FormInstance, FormResources, MetadataInstance}
import org.orbeon.oxf.fr.library.FR... | orbeon/orbeon-forms | form-runner/jvm/src/main/scala/org/orbeon/oxf/fr/FormRunnerCompiler.scala | Scala | lgpl-2.1 | 11,098 |
/***********************************************************************
* Copyright (c) 2013-2016 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is ... | mdzimmerman/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/data/tables/Z2Table.scala | Scala | apache-2.0 | 9,372 |
/*
* 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 ... | jatin9896/incubator-carbondata | store/search/src/main/scala/org/apache/spark/rpc/Master.scala | Scala | apache-2.0 | 11,610 |
package genericFunctionRDD
/**
* Created by merlin on 2/9/16.
*/
import scala.reflect.ClassTag
abstract class SpatialRDDPartition [K, V] extends Serializable {
protected implicit def kTag: ClassTag[K]
protected implicit def vTag: ClassTag[V]
def size: Long
def isDefined(k: K): Boolean
def iterator: I... | merlintang/genericFunctionOverSpark | src/main/scala/genericFunctionRDD/SpatialRDDPartition.scala | Scala | apache-2.0 | 1,012 |
/*
* 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/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala | Scala | apache-2.0 | 18,915 |
package com.monsanto.arch.cloudformation.model
import spray.json.{JsValue, JsonWriter}
/**
* Wrapper for anything that can be written to Json. Useful to allow specifying
* a Map of String -> JsonWritable that can take any value that can be written out as Json.
*/
case class JsonWritable[T: JsonWriter](thing: ... | MonsantoCo/cloudformation-template-generator | src/main/scala/com/monsanto/arch/cloudformation/model/JsonUtils.scala | Scala | bsd-3-clause | 655 |
package com.imaginea.activegrid.core.models
import org.scalamock.scalatest.MockFactory
import org.scalatest.{Suite, PrivateMethodTester, FlatSpec}
/**
* Created by ranjithrajd on 18/11/16.
*/
class SSHBasedStrategyTest extends FlatSpec with PrivateMethodTester with MockFactory with Suite {
"resolveOS " should "r... | eklavya/activeGrid | src/test/scala/com/imaginea/activegrid/core/models/SSHBasedStrategyTest.scala | Scala | apache-2.0 | 4,788 |
package org.http4s
package headers
import org.http4s.parser.HttpHeaderParser
import org.http4s.util.Writer
import java.lang.{Long => JLong}
object `X-B3-ParentSpanId` extends HeaderKey.Internal[`X-B3-ParentSpanId`] with HeaderKey.Singleton {
override def parse(s: String): ParseResult[`X-B3-ParentSpanId`] =
Http... | ZizhengTai/http4s | core/src/main/scala/org/http4s/headers/X-B3-ParentSpanId.scala | Scala | apache-2.0 | 592 |
/**
* Digi-Lib-Mesh - distributed mesh library for Digi components
*
* Copyright (c) 2012-2013 Alexey Aksenov [email protected]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* h... | ezh/digi-lib-mesh | src/test/scala/org/digimead/digi/lib/mesh/endpoint/EndpointSpec.scala | Scala | apache-2.0 | 1,801 |
package queries
import java.time.{LocalDate, LocalDateTime}
import datamodel.Priority
import datamodel.Priority.Priority
import datamodel.columnDataMappers._
import datamodel.dataModel._
import slick.driver.H2Driver.api._
object queries {
val selectAllTasksQuery: Query[TaskTable, Task, Seq] = Tasks
// val fin... | shekhargulati/52-technologies-in-2016 | 05-slick/tasky/src/main/scala/queries/queries.scala | Scala | mit | 1,616 |
package com.stefansavev.randomprojections.implementation
class SplitIntoKProjection {
}
import java.util.Random
import com.stefansavev.randomprojections.datarepr.dense.DataFrameView
import com.stefansavev.randomprojections.datarepr.sparse.SparseVector
import com.stefansavev.randomprojections.utils.RandomUtils
impo... | codeaudit/random-projections-at-berlinbuzzwords | src/main/scala/com/stefansavev/randomprojections/implementation/SplitIntoKProjection.scala | Scala | apache-2.0 | 2,333 |
/*
* 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/play-async | src/main/scala/uk/gov/hmrc/play/asyncmvc/async/AsyncTask.scala | Scala | apache-2.0 | 5,869 |
package scodec
package codecs
class DiscriminatorCodecTest extends CodecSuite {
"the discriminator combinators" should {
"support building a codec using typecases" in {
val codec =
discriminated[AnyVal].by(uint8)
.typecase(0, int32)
.typecase(1, bool)
roundtrip(codec, true)... | alvaroc1/scodec | shared/src/test/scala/scodec/codecs/DiscriminatorCodecTest.scala | Scala | bsd-3-clause | 5,501 |
package example
import akka.actor.{ActorSystem, Props}
import akka.http.scaladsl.server.directives.Credentials
import example.Commands.{CheckBalance, Deposit, OpenAccount, Withdraw}
import example.Events.{AccountOpened, BalanceChecked, Deposited, Withdrawn}
import fission.Fission
import fission.Fission._
import fissio... | davidcaseria/fission | src/test/scala/example/Main.scala | Scala | mit | 3,595 |
package week4.primitives
abstract class Nat {
def isZero: Boolean
def predecessor: Nat
def successor: Nat = new Succ(this)
def + (that: Nat): Nat
def - (that: Nat): Nat
} | juliocnsouzadev/scala_datascience | fuctional_programming_principles/fpps-notes/src/week4/primitives/Nat.scala | Scala | mit | 193 |
package utils
import org.junit.Assert._
import org.junit.Test
import org.apache.commons.lang.RandomStringUtils
class ParseUtilsTest {
@Test
def testAsLong() {
val value = ParseUtils.asLong("10").get
assertEquals(10L, value)
}
@Test
def testAsLongWithNotANumber() {
val value = ParseUtils.asLong... | tiborbotos/domino | domino-crawler/src/test/scala/utils/ParseUtilsTest.scala | Scala | lgpl-3.0 | 1,579 |
package org.broadinstitute.clio.transfer.model.ubam
import org.broadinstitute.clio.transfer.model.IndexKey
import org.broadinstitute.clio.util.model.Location
case class UbamKey(
location: Location,
flowcellBarcode: String,
lane: Int,
libraryName: String
) extends IndexKey {
override def getUrlSegments: Seq... | broadinstitute/clio | clio-transfer-model/src/main/scala/org/broadinstitute/clio/transfer/model/ubam/UbamKey.scala | Scala | bsd-3-clause | 406 |
/*
* 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 ... | publicRoman/spark | resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/submitsteps/MountSmallLocalFilesStepSuite.scala | Scala | apache-2.0 | 6,825 |
/*
Copyright 2012 Georgia Tech Research Institute
Author: [email protected]
This file is part of org.gtri.util.scala.xmlbuilder library.
org.gtri.util.scala.xmlbuilder library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License a... | gtri-iead/org.gtri.util.scala | xmlbuilder/src/main/scala/org/gtri/util/scala/xmlbuilder/package.scala | Scala | gpl-3.0 | 3,490 |
package io.iohk.ethereum.blockchain.sync.regular
import java.net.InetSocketAddress
import akka.actor.{ActorRef, ActorSystem, PoisonPill}
import akka.pattern.ask
import akka.testkit.TestActor.AutoPilot
import akka.testkit.{TestKitBase, TestProbe}
import akka.util.{ByteString, Timeout}
import cats.Eq
import cats.implic... | input-output-hk/etc-client | src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncFixtures.scala | Scala | mit | 12,710 |
/*
* Copyright (c) 2012 Orderly 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/licenses/L... | orderly/narcolepsy-scala | src/main/scala/co/orderly/narcolepsy/marshallers/Marshaller.scala | Scala | apache-2.0 | 1,924 |
package aiouniya.spark
import com.redislabs.provider.redis.{RedisConfig, RedisEndpoint}
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
import org.apache.hadoop.hbase.client.Scan
import org.apache.hadoop.hbase.protobuf.ProtobufUtil
import org.apache.hadoop.hbase.util.B... | 7u/spark-learning | spark.learning/src/main/scala/aiouniya/spark/MyRDDFunctions.scala | Scala | apache-2.0 | 5,531 |
/*
* 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 ... | Intel-bigdata/OAP | oap-native-sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala | Scala | apache-2.0 | 44,621 |
class C {
def =+(n: Int): C = new C
def =++(n: Int): C = new C
}
var v = new C
v /* resolved: false */ =+= 1
v /* resolved: false */ =++= 1
v /* line: 2 */ =+ 1
v /* line: 3 */ =++ 1
| katejim/intellij-scala | testdata/resolve2/function/assignment/StartsWithEqual.scala | Scala | apache-2.0 | 191 |
package io.youi.task
import scala.concurrent.duration.FiniteDuration
case class AnimateIn(get: () => Double,
apply: Double => Unit,
destination: () => Double,
duration: FiniteDuration,
easing: Easing) extends DurationTask {
private ... | outr/youi | ui/shared/src/main/scala/io/youi/task/AnimateIn.scala | Scala | mit | 838 |
package com.goyeau.kubernetes.client.crd
import cats.syntax.either._
import io.circe.syntax._
import io.circe.{Decoder, Encoder}
import io.k8s.apiextensionsapiserver.pkg.apis.apiextensions.v1.JSONSchemaProps
trait JSONSchemaPropsOrArray
case class SchemaNotArrayValue(value: JSONSchemaProps) extends JSONSchemaPropsOrA... | joan38/kubernetes-client | kubernetes-client/src/com/goyeau/kubernetes/client/crd/JSONSchemaPropsOrArray.scala | Scala | apache-2.0 | 897 |
/**
* Copyright (C) 2015-2016 DANS - Data Archiving and Networked Services ([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/LICENS... | PaulBoon/easy-stage-dataset | src/main/scala/nl/knaw/dans/easy/stage/dataset/Util.scala | Scala | apache-2.0 | 3,340 |
package breeze.linalg
import breeze.generic.UFunc
import breeze.macros.cforRange
/**
* Computes the determinant of the given real matrix.
*/
object det extends UFunc {
implicit def canDetUsingLU[T](implicit luImpl: LU.primitive.Impl[T, (DenseMatrix[Double], Array[Int])]): Impl[T, Double] = {
new Impl[T, Doubl... | scalanlp/breeze | math/src/main/scala/breeze/linalg/functions/det.scala | Scala | apache-2.0 | 1,403 |
package model
case class Status(status: String, time: String, hostname: String) | jmarin/microservice-template | src/main/scala/model/Status.scala | Scala | apache-2.0 | 80 |
/**
* For copyright information see the LICENSE document.
*/
package entice.server.world.systems
import entice.server._
import entice.server.utils._
import entice.server.world._
import entice.server.physics._, Geometry._
import entice.protocol._, MoveState._
import akka.actor._
import shapeless._
class MovementSy... | entice/old-server | src/main/scala/entice/server/world/systems/MovementSystem.scala | Scala | bsd-3-clause | 3,751 |
/*
Copyright 2014 - 2015 Janek Bogucki
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 o... | janekdb/scalacraft-domain | src/main/scala/com/scalacraft/domain/v2/internal/Reflections.scala | Scala | apache-2.0 | 1,094 |
/**
* Copyright 2012-2013 StackMob
*
* 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 i... | stackmob/scaliak | src/test/scala/com/stackmob/scaliak/tests/ScaliakBucketSpecs.scala | Scala | apache-2.0 | 59,255 |
package mr.merc.ui.common.geom
import org.scalatest.funsuite.AnyFunSuite
class PolygonTest extends AnyFunSuite {
test("check inside triangle") {
val polygon = new Polygon((0, 0), (5, 5), (5, 0))
assert(polygon.isInside(3, 0) === true)
assert(polygon.isInside(1, 0.5) === true)
assert(polygon.isInside... | RenualdMarch/merc | src/test/scala/mr/merc/ui/common/geom/PolygonTest.scala | Scala | gpl-3.0 | 673 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | tempbottle/kafka | core/src/test/scala/unit/kafka/consumer/TopicFilterTest.scala | Scala | apache-2.0 | 4,144 |
import com.td.utils.{GoogleSearchAPI, TwitterAPI}
import java.net.{HttpURLConnection, URL}
import scala.io.Source
import scalaj.http.Token
object Main {
def main(args: Array[String]) {
val tweetRegex = """(@[a-zA-Z0-9_]+) to (@[a-zA-Z0-9_]+) ([a-zA-Z0-9 .]+)""".r
// Tweet a Gif Tokens
val consumer = To... | tonyd3/TweetAGIF | src/main/scala/com/td/tweetagif/Main.scala | Scala | mit | 3,360 |
package scalainvoice
object DocumentItemCalculator {
val round = Rounding.rounder
def calculateItemTotals(item : DocumentItem) : DocumentItem = {
val beforeTaxes = round(item.unitPrice * item.quantity)
val taxes = round(beforeTaxes * item.taxFactor)
item.copy(
total = round(beforeTaxes + taxe... | donbonifacio/scala-invoice | src/main/scala/scalainvoice/DocumentItemCalculator.scala | Scala | mit | 400 |
package controllers
import scala.Left
import scala.Right
import play.api._
import play.api.mvc._
import play.api.Play.current
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import scala.concurrent.Future
import play.api.mvc.WebSocket
import play.api.libs.iteratee._
import actors.GamerActor
import a... | terdong/CustomRPS7ServerForPlay | custom_rps7_server/app/controllers/Application.scala | Scala | mit | 1,770 |
package org.jetbrains.plugins.scala.lang.refactoring.rename
import java.util
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.util.Pass
import com.intellij.psi.PsiElement
import com.intellij.refactoring.listeners.RefactoringElementListener
import com.intellij.refactoring.rename.RenamePsiElementPr... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/refactoring/rename/RenameLightProcessor.scala | Scala | apache-2.0 | 2,655 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.3
* @date Wed Jul 31 13:54:40 EDT 2013
* @see LICENSE (MIT style license file).
*/
package scalation.graphalytics
import scala.collection.immutable.{Set => SET}
import scalation.linalge... | NBKlepp/fda | scalation_1.3/scalation_modeling/src/main/scala/scalation/graphalytics/Convert.scala | Scala | mit | 2,281 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2016 Matthias Langer ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apa... | bashimao/ltudl | blaze/src/main/scala/edu/latrobe/blaze/objectives/OutputRedirection.scala | Scala | apache-2.0 | 4,227 |
package ml.wolfe.nlp.io
import ml.wolfe.nlp.{Sentence, CharOffsets, Token}
import org.json4s.JsonAST.JArray
import org.json4s.reflect.TypeInfo
import org.json4s.{Extraction, MappingException, Formats, Serializer}
/**
* @author Sebastian Riedel
*/
object JsonIO {
class IndexedSeqSerializer extends Serializer[Inde... | wolfe-pack/wolfe | wolfe-nlp/src/main/scala/ml/wolfe/nlp/io/JsonIO.scala | Scala | apache-2.0 | 1,457 |
package eu.timepit.refined.benchmark
import eu.timepit.refined.types.numeric.PosInt
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations.{Benchmark, BenchmarkMode, Mode, OutputTimeUnit}
@BenchmarkMode(Array(Mode.AverageTime))
class PosIntBenchmark {
@Benchmark
@OutputTimeUnit(TimeUnit.NANOSECO... | fthomas/refined | modules/benchmark/src/main/scala/eu/timepit/refined/benchmark/PosIntBenchmark.scala | Scala | mit | 378 |
package org.jetbrains.plugins.scala
package lang.scaladoc
import com.intellij.codeInsight.generation.surroundWith.SurroundWithHandler
import com.intellij.lang.surroundWith.SurroundDescriptor
import com.intellij.psi.PsiElement
import com.intellij.testFramework.EditorTestUtil.{SELECTION_END_TAG => END, SELECTION_START_T... | jastice/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/scaladoc/SurroundWithWikiSyntaxTest.scala | Scala | apache-2.0 | 6,274 |
package org.jetbrains.plugins.scala.lang.resolve2
/**
* Pavel.Fatin, 02.02.2010
*/
class InheritanceOverrideTest extends ResolveTestBase {
override def folderPath: String = {
super.folderPath + "inheritance/override/"
}
//TODO answer?
// def testCaseClass = doTest
def testClass = doTest
def testCla... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/lang/resolve2/InheritanceOverrideTest.scala | Scala | apache-2.0 | 800 |
package scalaz.stream
import Cause._
import java.util.concurrent.atomic.{AtomicBoolean, AtomicReference}
import scala.annotation.tailrec
import scala.collection.SortedMap
import scala.concurrent.duration._
import scala.Function.const
import scalaz.stream.async.immutable.Signal
import scalaz.{\/-, Catchable, Functor... | shawjef3/scalaz-stream | src/main/scala/scalaz/stream/Process.scala | Scala | mit | 59,169 |
// Copyright: 2010 - 2017 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.server
import java.io.{ FileOutputStream, PrintStream }
import java.net.InetSocketAddress
import java.nio.file.Paths
import scala.concurrent.Await
import scala.concurrent... | ensime/ensime-server | server/src/main/scala/org/ensime/server/Server.scala | Scala | gpl-3.0 | 7,213 |
/**
* See <a href="https://www.codeeval.com/open_challenges/6/">Longest common sequence</a>
*/
object CommonSequence extends Challenge {
val lines = scala.io.Source.fromFile(args(0)).getLines().filter(_.length > 0)
lines.collect {
case Input(left, right) => eval(left, right, Nil)
} foreach {
result ... | zelca/codeeval | src/CommonSequence.scala | Scala | mit | 892 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.scalajs
object LinkingInfo {
... | scala-js/scala-js | library/src/main/scala/scala/scalajs/LinkingInfo.scala | Scala | apache-2.0 | 9,189 |
package utils
import javax.inject.Inject
import play.api.http.HttpFilters
import play.api.mvc.EssentialFilter
/**
* Provides filters.
*/
//class Filters @Inject() (csrfFilter: play.filters.csrf.CSRFFilter, securityHeadersFilter: SecurityHeadersFilter) extends HttpFilters {
class Filters @Inject() (csrfFilter: play... | scify/DemocracIT-Web | app/utils/Filters.scala | Scala | apache-2.0 | 483 |
/* ====================================================================
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 Y... | orbeon/orbeon-forms | form-runner/jvm/src/main/scala/org/orbeon/oxf/fr/excel/NumberToTextConverter.scala | Scala | lgpl-2.1 | 6,861 |
/*
* 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 ... | bavardage/spark | mllib/src/main/scala/spark/mllib/clustering/KMeans.scala | Scala | apache-2.0 | 12,036 |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... | costin/elasticsearch-hadoop | spark/sql-12/src/itest/scala/org/elasticsearch/spark/integration/AbstractScalaEsSparkSQL.scala | Scala | apache-2.0 | 17,551 |
/*
* 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 ... | stanzhai/spark | resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackendUtil.scala | Scala | apache-2.0 | 7,360 |
package org.eichelberger.sfc.utils
import java.awt.Color
import java.io.{PrintStream, PrintWriter}
import org.eichelberger.sfc.SpaceFillingCurve._
trait RenderTarget {
def qw(s: String) = "\\"" + s + "\\""
def beforeRendering(sfc: RenderSource): Unit = {}
def beforeSlice(sfc: RenderSource, slice: OrdinalVector... | cne1x/sfseize | src/main/scala/org/eichelberger/sfc/utils/RenderSource.scala | Scala | apache-2.0 | 11,013 |
package mesosphere.util.state
import mesosphere.marathon.state.{ Timestamp, EntityStore, MarathonState }
import org.apache.mesos.Protos
import org.apache.mesos.Protos.FrameworkID
import org.slf4j.LoggerFactory
import scala.concurrent.duration.Duration
import scala.concurrent.{ Await, Future }
/**
* Utility class f... | ss75710541/marathon | src/main/scala/mesosphere/util/state/FrameworkIdUtil.scala | Scala | apache-2.0 | 1,514 |
package fpinscala.structuringprograms
case class Box(height: Double, width: Double)
object Answers {
def greaterBy(x: Box, y: Box, f: Box => Double): Box =
if (f(x) > f(y)) x else y
type Pred[A] = A => Boolean
def wider(x: Box, y: Box): Box =
greaterBy(x, y, _.width)
def taller(x: Box, y: Box) =
... | ryo-murai/fpinscala-exercises | answers/src/main/scala/fpinscala/structuringprograms/Answers.scala | Scala | mit | 3,373 |
package colossus
//where should this go...
import service._
import metrics._
import MetricAddress._
import akka.actor._
import akka.util.Timeout
import scala.concurrent.duration._
import protocols.http._
import java.net.InetSocketAddress
import net.liftweb.json._
class JsonMetricSenderActor(io: IOSystem, host: S... | noikiy/colossus | colossus/src/main/scala/colossus/metrics/JsonMetricSender.scala | Scala | apache-2.0 | 1,339 |
/*
* Licensed to Intel Corporation under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Intel Corporation licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use t... | SeaOfOcean/BigDL | dl/src/main/scala/com/intel/analytics/bigdl/nn/RoiPooling.scala | Scala | apache-2.0 | 14,465 |
/*
* Distributed as part of Scalala, a linear algebra library.
*
* Copyright (C) 2008- Daniel Ramage
*
* This library 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 ... | scalala/Scalala | src/test/scala/scalala/tensor/dense/DenseMatrixTest.scala | Scala | lgpl-2.1 | 7,232 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | bigdatagenomics/PacMin | pacmin-core/src/main/scala/org/bdgenomics/pacmin/graph/ObservedSite.scala | Scala | apache-2.0 | 1,353 |
package com.codahale.jerkson.tests
import com.codahale.jerkson.Json._
import java.io.ByteArrayInputStream
import com.codahale.simplespec.Spec
import org.junit.Test
class StreamingSpec extends Spec {
class `Parsing a stream of objects` {
val json = """[
{"id":1, "name": "Coda"},
{"id":2, "name": "Nik... | cphylabs/jerkson-old | src/test/scala/com/codahale/jerkson/tests/StreamingSpec.scala | Scala | mit | 686 |
package com.github.opengrabeso.mixtio
package frontend.routing
import io.udash._
import common.model._
import scala.scalajs.js.URIUtils
class RoutingRegistryDef extends RoutingRegistry[RoutingState] {
def matchUrl(url: Url): RoutingState =
url2State("/" + url.value.stripPrefix("/").stripSuffix("/"))
def mat... | OndrejSpanel/Stravamat | frontend/src/main/scala/com/github/opengrabeso/mixtio/frontend/routing/RoutingRegistryDef.scala | Scala | gpl-2.0 | 1,261 |
def alpha[A]: (A => ?) ~> F | hmemcpy/milewski-ctfp-pdf | src/content/2.5/code/scala/snippet04.scala | Scala | gpl-3.0 | 27 |
/*
* 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 | core/src/test/scala/org/apache/spark/JobCancellationSuite.scala | Scala | apache-2.0 | 16,892 |
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.