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 |
|---|---|---|---|---|---|
/*
* Copyright (c) 2014 Ben Whitehead.
* 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 ... | samklr/finch-server | src/test/scala/io/github/benwhitehead/finch/FinchServerTest.scala | Scala | apache-2.0 | 4,221 |
/**
* 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... | kingargyle/turmeric-bot | components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SDelayDefinition.scala | Scala | apache-2.0 | 1,629 |
/*
* 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 ... | WilliamDo/ignite | modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala | Scala | apache-2.0 | 81,667 |
/*
* Copyright 2015 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... | keithhall/ct-calculations | src/test/scala/uk/gov/hmrc/ct/box/retriever/FilingAttributesBoxValueRetrieverSpec.scala | Scala | apache-2.0 | 2,862 |
package model
import model.battle.Status
import model.pokedex.Pokedex
import org.scalatest.FlatSpec
/**
* Created by salim on 16/09/2016.
*/
class PokemonSpec extends FlatSpec {
"Pokemon" should "be creatable by id" in {
val pokedex: Pokedex = Pokedex.boot
val p: Pokemon = Pokemon.spawn(pokedex, 25).nam... | salimfadhley/scalamoo | src/test/scala/model/PokemonSpec.scala | Scala | mit | 1,042 |
/**
* Licensed to the Minutemen Group under one or more contributor license
* agreements. See the COPYRIGHT file distributed with this work for
* additional information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in complian... | mohiva/silhouette | modules/crypto-jca/src/main/scala/silhouette/crypto/jca/JcaCrypter.scala | Scala | apache-2.0 | 4,243 |
/*
* Copyright 2009-2010 LinkedIn, 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 agreed ... | rhavyn/norbert | cluster/src/test/scala/com/linkedin/norbert/cluster/NodeSpec.scala | Scala | apache-2.0 | 2,843 |
def foo(a: String) = 0
val z: String => Unit = /*start*/foo(_)/*end*/ // good code red
//(String) => Unit | triggerNZ/intellij-scala | testdata/typeInference/bugs5/SCL3549A.scala | Scala | apache-2.0 | 105 |
package com.google.cloud.spark.bigquery.pushdowns
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.expressions.{Attribute, UnsafeProjection}
import org.apache.spark.sql.execution.SparkPlan
import org.apache.spark.sql.types.{StructField, StructType}
... | GoogleCloudDataproc/spark-bigquery-connector | spark-bigquery-pushdown/pushdown_common_src/main/scala/com/google/cloud/spark/bigquery/pushdowns/BigQueryPlan.scala | Scala | apache-2.0 | 811 |
/*
* 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... | zhangxiaoli73/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/integration/torch/VolumetricFullConvolutionSpec.scala | Scala | apache-2.0 | 18,040 |
object Test {
inline def power(x: Double, inline n: Int): Double = // ok
inline if n == 0 then ??? else ???
inline val N = 10
def X = 20
power(2.0, N) // ok, since it's an inline parameter
power(2.0, X) // error: cannot reduce inline if
}
| dotty-staging/dotty | tests/neg/inlinevals-3.scala | Scala | apache-2.0 | 257 |
/*
* 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 ... | minixalpha/spark | sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala | Scala | apache-2.0 | 30,433 |
package com.wavesplatform.it.sync.transactions
import com.typesafe.config.Config
import com.wavesplatform.account.AddressScheme
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.common.utils.EitherExt2
import com.wavesplatform.it.api.SyncHttpApi._
import com.wavesplatform.it.api.TransactionInfo
im... | wavesplatform/Waves | node-it/src/test/scala/com/wavesplatform/it/sync/transactions/SponsorshipSuite.scala | Scala | mit | 29,282 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | yiheng/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/keras/nn/Convolution1DSpec.scala | Scala | apache-2.0 | 3,080 |
package in.lambda_hc.furious_cyclist.rest.undertow.handlers.auth
import java.util.Date
import in.lambda_hc.furious_cyclist.utils.SecurityUtils
import io.undertow.server.{HttpHandler, HttpServerExchange}
import spray.json.{JsObject, JsString}
/**
* Created by vishnu on 12/6/16.
*/
class LogoutHandler extends Htt... | lambda-hc/furious-cyclist | src/main/scala/in/lambda_hc/furious_cyclist/rest/undertow/handlers/auth/LogoutHandler.scala | Scala | apache-2.0 | 718 |
package lila.common
import akka.actor._
import scala.concurrent.duration._
// do NOT embed me in an actor
// for it would likely create a memory leak
final class Debouncer[A: Manifest](length: FiniteDuration, function: A => Unit) extends Actor {
private case object DelayEnd
private var delayed: Option[A] = none... | r0k3/lila | modules/common/src/main/Debouncer.scala | Scala | mit | 777 |
trait IStringPair[T] {
def a : String
def b : String
def build(a : String, b : String) : T
def cat(that : IStringPair[T]) = build(this.a + that.a, this.b + that.b)
override def toString = a + b
}
class StringPair(val a : String, val b : String) extends IStringPair[StringPair] {
def build(a : String, b : St... | yusuke2255/dotty | tests/run/t3452.scala | Scala | bsd-3-clause | 559 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* See the LICENCE.txt file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | mjwallin1/wookiee | wookiee-core/src/main/scala/com/webtrends/harness/service/ServiceManager.scala | Scala | apache-2.0 | 8,107 |
package com.kubukoz.scala99
/**
* P06 (*) Find out whether a list is a palindrome.
* Example:
* scala> isPalindrome(List(1, 2, 3, 2, 1))
* res0: Boolean = true
*/
object P06 {
/**
* Simple and doesn't reverse the whole list but half of it.
**/
def isPalindrome(l: List[Any]): Boolean = {
val l... | kubukoz/scala-99 | src/main/scala/com/kubukoz/scala99/P06.scala | Scala | apache-2.0 | 568 |
/*
* Copyright 2012 Eike Kettner
*
* 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... | eikek/publet | web/src/main/scala/org/eknet/publet/web/shiro/AuthzFilter.scala | Scala | apache-2.0 | 2,732 |
package org.apache.spark.ml.bundle.ops.classification
import ml.combust.bundle.BundleContext
import ml.combust.bundle.dsl._
import ml.combust.bundle.op.{OpModel, OpNode}
import org.apache.spark.ml.bundle.{ParamSpec, SimpleParamSpec, SimpleSparkOp, SparkBundleContext}
import org.apache.spark.ml.classification.Multilaye... | combust/mleap | mleap-spark/src/main/scala/org/apache/spark/ml/bundle/ops/classification/MultiLayerPerceptronClassifierOp.scala | Scala | apache-2.0 | 2,704 |
package chapter.fourteen
import ExerciseEight.{ Node, Leaf, eval }
import org.scalatest._
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
@RunWith(classOf[JUnitRunner])
class ExerciseEightSpec extends FlatSpec with Matchers {
"eval" should "the value of a tree" in {
val tree = Node('+',... | deekim/impatient-scala | src/test/scala/chapter/fourteen/ExerciseEightSpec.scala | Scala | apache-2.0 | 564 |
/*
* 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 ... | pgandhi999/spark | mllib/src/main/scala/org/apache/spark/mllib/fpm/AssociationRules.scala | Scala | apache-2.0 | 5,833 |
/*
* 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 ... | fhueske/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/stream/sql/validation/OverWindowValidationTest.scala | Scala | apache-2.0 | 2,196 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | bdrillard/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/command/InsertIntoDataSourceDirCommand.scala | Scala | apache-2.0 | 2,989 |
package org.jetbrains.plugins.scala.annotator.gutter
/**
* Pavel.Fatin, 21.01.2010
*/
class GroupMultilineControlTest extends LineMarkerTestBase {
protected override def getBasePath = super.getBasePath + "/group/multiline/control/"
def testDo = doTest
def testFor = doTest
def testIf = doTest
def testIte... | LPTK/intellij-scala | test/org/jetbrains/plugins/scala/annotator/gutter/GroupMultilineControlTest.scala | Scala | apache-2.0 | 409 |
package spray.oauth.endpoints
/**
* Created by hasanozgan on 06/06/14.
*/
trait OAuth2Services extends TokenService with AuthorizeService {
val defaultOAuth2Routes = defaultTokenRoutes ~ defaultAuthorizeRoutes
}
| hasanozgan/spray-oauth | core/src/main/scala/spray/oauth/endpoints/OAuth2Services.scala | Scala | apache-2.0 | 219 |
/*
* This software is licensed under the GNU Affero General Public License, quoted below.
*
* This file is a part of PowerAPI.
*
* Copyright (C) 2011-2016 Inria, University of Lille 1.
*
* PowerAPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public Lice... | Spirals-Team/powerapi | powerapi-sampling-cpu/src/main/scala/org/powerapi/sampling/cpu/SamplingConfiguration.scala | Scala | agpl-3.0 | 3,371 |
/***********************************************************************
* 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... | ddseapy/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/util/AccumuloSftBuilderTest.scala | Scala | apache-2.0 | 2,041 |
import scala.io.StdIn
object Enclosure {
def main(args: Array[String]): Unit = {
val n = StdIn.readInt()
val ls = StdIn.readLine().split(" ").map(_.toDouble)
val r = solve(ls)
val head = ls.head
val ls2 = ls.tail.init
println("%.6f\\n%.6f\\n".format(0.0,0.0))
println("%.6f\\n%.6f\\n".... | everyevery/programming_study | hackerrank/contest/2016w23/Enclosure/Enclosure.scala | Scala | mit | 1,232 |
package scrupal.utils
import org.specs2.mutable.Specification
class DomainNamesSpec extends Specification {
"DomainNames" should {
"recognize top level domain names" in {
val result = DomainNames.tldPattern.findPrefixMatchOf("com")
result.isDefined must beTrue
result.get.source must beEqualTo... | scrupal/scrupal-core | scrupal-server/src/test/scala/scrupal/utils/DomainNamesSpec.scala | Scala | apache-2.0 | 2,268 |
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */
package example.idl
import shapeless.{:+:, CNil}
final case class Event1()
final case class Event2()
final case class Event3()
final case class Event4()
final case class ShouldRenderAsOption1(value: Option[Event1])
final case class ShouldRenderAsOpt... | julianpeeters/avrohugger | avrohugger-core/src/test/expected/standard/example/idl/AllUnionsWithOptionShapelessCoproduct.scala | Scala | apache-2.0 | 1,176 |
package com.basrikahveci
package cardgame.messaging.request
import cardgame.messaging.Request
import cardgame.core.{OnlineUsers, Session}
import cardgame.domain.User
class InviteUserRequest(val invitedUserId: Long) extends Request with OnlineUsers {
def handle(session: Session, user: User) = inviteFriend(user, invi... | metanet/cardgame-server-scala | src/main/scala/com/basrikahveci/cardgame/messaging/request/InviteUserRequest.scala | Scala | mit | 333 |
// Copyright (C) 2011-2012 the original author or authors.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You ... | chrisjwwalker/cjww-auth-service | app/controllerTraits/RegisterCtrl.scala | Scala | apache-2.0 | 2,175 |
/*
* Copyright (C) 2012 Mikołaj Sochacki mikolajsochacki AT gmail.com
* This file is part of VRegister (Virtual Register)
* Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
*/
package eu.brosbit.opos.lib
import javax.mail._
import javax.mail.internet._
import _root_.net.liftweb.util... | mikolajs/osp | src/main/scala/eu/brosbit/opos/lib/MailConfig.scala | Scala | agpl-3.0 | 2,292 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.core
import akka.actor._
import com.google.common.io.ByteStreams
import java.io.{ File, IOException }
import java.util.jar.JarFile
import org.ensime.api._
class DocResolv... | sugakandrey/ensime-server | core/src/main/scala/org/ensime/core/DocResolver.scala | Scala | gpl-3.0 | 6,584 |
package org.jetbrains.plugins.scala.worksheet.cell
import com.intellij.openapi.components.AbstractProjectComponent
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi.{PsiComment, PsiElement, PsiFile, PsiWhiteSpace}
import org.jetbrains.plugins.scala.lan... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/worksheet/cell/BasicCellManager.scala | Scala | apache-2.0 | 5,188 |
/*
* 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... | kevinwright/scalatest | src/main/scala/org/scalatest/Suite.scala | Scala | apache-2.0 | 100,196 |
package de.tudarmstadt.lt.flinkdt.tasks
import de.tudarmstadt.lt.flinkdt.types._
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.api.scala._
import scala.reflect.ClassTag
/**
* Created by Steffen Remus
*/
object N11Sum {
def apply[C <: CT2 : ClassTag : TypeInformation, T1 :... | remstef/flinkfun | src/main/scala/de/tudarmstadt/lt/flinkdt/tasks/N11Sum.scala | Scala | apache-2.0 | 721 |
import Predef.{augmentString => _, wrapString => _, _}
import scala.reflect.ClassTag
object Test {
import colltest5.strawman.collections._
import CollectionStrawMan5._
def seqOps(xs: Seq[Int]) = {
val x1 = xs.foldLeft("")(_ + _)
val y1: String = x1
val x2 = xs.foldRight("")(_ + _)
val y2: String... | som-snytt/dotty | tests/run/colltest5/CollectionTests_2.scala | Scala | apache-2.0 | 4,538 |
package pages.common
import org.openqa.selenium.WebDriver
import org.scalatest.selenium.WebBrowser.{find, id}
import views.vrm_assign.Main.BackId
object MainPanel {
/** back button is removed from the panel. This is left here is case of refactoring */
def back(implicit driver: WebDriver) = find(id(BackId)).get
} | dvla/vrm-assign-online | test/pages/common/MainPanel.scala | Scala | mit | 320 |
/*
* Copyright 2017 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | pncampbell/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v3/B960_3.scala | Scala | apache-2.0 | 1,191 |
/*
* Copyright 2009-2010 LinkedIn, 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 agreed ... | linkedin/norbert | network/src/main/scala/com/linkedin/norbert/network/NetworkingException.scala | Scala | apache-2.0 | 2,639 |
/*
* 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 | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryTableScanExec.scala | Scala | apache-2.0 | 12,719 |
package latis.reader.tsml
import latis.reader.tsml.ml.Tsml
/**
* Use column index properties to parse ascii tabular data.
* Map Variable names to zero-based column index(s).
* Each variable spec will be separated by ";" and
* column indices for multiple column variables will
* be separated by ",". e.g. columns="... | dlindhol/LaTiS | src/main/scala/latis/reader/tsml/ColumnarAdapter.scala | Scala | epl-1.0 | 1,076 |
/*
* 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/amls-frontend | test/controllers/renewal/SummaryControllerSpec.scala | Scala | apache-2.0 | 5,280 |
package io.github.electricmind
import java.io.ByteArrayInputStream
import io.github.electricmind.autocomplete.{Autocomplete, NGram2Probabilities, NGram2Words, NGrams, Vocabulary}
import org.scalatest.{FlatSpec, Matchers}
class testAutocomplete extends FlatSpec with Matchers {
val ac = new Autocomplete(0.8, 2, _ =... | electricmind/autocomplete | src/test/scala/autocomplete/testAutocomplete.scala | Scala | apache-2.0 | 1,294 |
// Copyright 2015 Ricardo Gladwell.
// Licensed under the GNU Affero General Public License.
// See the LICENSE file for more information.
package com.is_hosted_by.api
import org.specs2.mutable.{After, Specification}
import dispatch.classic._
import java.net.InetAddress
import unfiltered.specs2.netty.Served
import or... | rgladwell/is-aws-api | src/test/scala/com/is_hosted_by/api/ApiSpec.scala | Scala | agpl-3.0 | 6,429 |
package yuima.algovis.maze.gen
import yuima.algovis.maze.core.FieldType._
import yuima.algovis.maze.core.{Direction, MazeOnGeneration}
import scala.annotation.tailrec
import scala.util.Random
/** A maze generator with depth-first search algorithm.
*
* @author Yuichiroh Matsubayashi
* Created on 15/08/2... | Yuichiroh/algovis | src/main/scala/yuima/algovis/maze/gen/DepthFirst.scala | Scala | mit | 1,829 |
/*
* 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 ... | jeremiaswerner/openwhisk | tests/src/test/scala/org/apache/openwhisk/common/NestedSemaphoreTests.scala | Scala | apache-2.0 | 2,917 |
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
object Test extends dotty.runtime.LegacyApp {
class A {
private[this] var x: Int = 42
}
val a = new A
val im: InstanceMirror = cm.reflect(a)
val cs = im.symbol
val f = cs.info.decl(TermName("x")).asTerm
val f... | folone/dotty | tests/pending/run/reflection-fieldmirror-privatethis.scala | Scala | bsd-3-clause | 433 |
/**
* 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 ... | tdanford/bdg-utils | utils-metrics/src/test/scala/org/bdgenomics/utils/instrumentation/MetricsListenerSuite.scala | Scala | apache-2.0 | 2,131 |
object Test extends App {
def foo(x: Int)(y: Int): Unit = macro Impls.foo
foo(40)(2)
} | som-snytt/dotty | tests/disabled/macro/run/macro-expand-multiple-arglists/Macros_Test_2.scala | Scala | apache-2.0 | 90 |
package japgolly.scalajs.react.test
import scala.scalajs.js
import scala.scalajs.js.Dynamic
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NOTE: Do not use UndefOr for arguments below; undefined causes Phantom-bloody-JS to crash.
///////////... | matthughes/scalajs-react | test/src/main/scala/japgolly/scalajs/react/test/SimEvent.scala | Scala | apache-2.0 | 16,549 |
/*
* Copyright (c) 2012-14 Miles Sabin
*
* 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 ag... | mandubian/shapeless | examples/src/main/scala/shapeless/examples/optics.scala | Scala | apache-2.0 | 3,314 |
package org.scaladebugger.api.lowlevel.monitors
import org.scaladebugger.api.lowlevel.requests.JDIRequestArgument
import org.scaladebugger.api.utils.PendingActionManager
import scala.util.{Success, Try}
/**
* Provides pending monitor waited capabilities to an existing
* monitor waited manager.
*/
trait PendingMon... | ensime/scala-debugger | scala-debugger-api/src/main/scala/org/scaladebugger/api/lowlevel/monitors/PendingMonitorWaitedSupport.scala | Scala | apache-2.0 | 2,740 |
package cuando.time
import play.api.libs.json.JsSuccess
import play.api.libs.json.Reads
import play.api.libs.json.Writes
import play.api.libs.json.JsResult
import play.api.libs.json.JsValue
import continuum.Interval
import org.joda.time.DateTime
import play.api.libs.json.Json
import play.api.libs.json.JsArray
import p... | cuando-db/cuando-db | src/main/scala/cuando/time/TemporalContext.scala | Scala | mit | 1,141 |
package com.imaginea.activegrid.core.models
import com.imaginea.activegrid.core.models.{ApplicationTier => AppTier, Neo4jRepository => Neo}
import com.imaginea.activegrid.core.utils.ActiveGridUtils
import com.typesafe.scalalogging.Logger
import org.neo4j.graphdb.Node
import org.slf4j.LoggerFactory
/**
* Created by ... | eklavya/activeGrid | src/main/scala/com/imaginea/activegrid/core/models/ApplicationTier.scala | Scala | apache-2.0 | 2,565 |
package n4g
object Model {
type Id = String
type Timestamp = Int
case class File(repo: String, // repo origin url
path: String,
lines: Int,
name: String,
ext: String, // file extension (.scala, .js, ...)
purpose: String) ... | by-dam/neo4git | src/main/scala/n4g/Model.scala | Scala | mit | 781 |
package com.solarmosaic.client.utilityApi.json
/**
* Stringified JSON.
*
* @param json The underlying JSON String.
*/
case class JsonString(json: String) {
override def toString = json
}
| solarmosaic/utility-api-client | src/main/scala/com/solarmosaic/client/utilityApi/json/JsonString.scala | Scala | mit | 194 |
/*
* Copyright 2010 Red Hat, Inc.
*
* Red Hat 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 required... | alexeev/jboss-fuse-mirror | sandbox/fmc/fmc-rest/src/main/scala/org/fusesource/fabric/webui/agents/jvm/JVMResource.scala | Scala | apache-2.0 | 6,299 |
package lila.round
import scala.concurrent.duration._
import akka.actor._
import akka.pattern.{ ask, pipe }
import chess.{ Color, White, Black }
import play.api.libs.iteratee._
import play.api.libs.json._
import actorApi._
import lila.common.LightUser
import lila.game.actorApi.{ StartGame, UserStartGame }
import lil... | JimmyMow/lila | modules/round/src/main/Socket.scala | Scala | mit | 7,460 |
package scalaz.stream.mongodb.update
import org.specs2.Specification
import org.specs2.specification.Snippets
import com.mongodb.{DBCollection, DBObject, BasicDBObjectBuilder, WriteConcern}
import org.bson.types.ObjectId
import org.specs2.matcher.MatchResult
import scalaz.stream.mongodb.collectionSyntax._
import scala... | Spinoco/scalaz-stream-mongodb | core/src/test/scala/scalaz/stream/mongodb/update/CollectionRemoveSpec.scala | Scala | mit | 2,042 |
package org.bitcoins.core.protocol.blockchain
import org.bitcoins.testkitcore.gen.BlockchainElementsGenerator
import org.scalacheck.{Prop, Properties}
/** Created by tom on 7/6/16.
*/
class BlockHeaderSpec extends Properties("BlockHeaderSpec") {
property("serialization symmetry") =
Prop.forAll(BlockchainEleme... | bitcoin-s/bitcoin-s | core-test/src/test/scala/org/bitcoins/core/protocol/blockchain/BlockHeaderSpec.scala | Scala | mit | 406 |
package com.keba.scala.bank.services
import java.util.Currency
import com.keba.scala.bank.account.BankAccount
import com.keba.scala.bank.exceptions.{BankAccountAlreadyExists, BankAccountNotFound, BankAccountOverdraft}
import com.keba.scala.bank.money.Money
import com.keba.scala.bank.repositories.BankAccountRepository... | alexp82/ddd-banking-system | src/main/scala/com/keba/scala/bank/services/BankingService.scala | Scala | apache-2.0 | 9,765 |
package shopping.products
case object Apple extends Product {
override val id: Int = 0
override val cost: Double = 0.60
}
| scottkwalker/shopping-cart | src/main/scala/shopping/products/Apple.scala | Scala | cc0-1.0 | 127 |
/*
mls: basic machine learning algorithms for Scala
Copyright (C) 2014 Davi Pereira dos Santos
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | machine-learning-scala/mls | src/main/scala/ml/models/RandomRank.scala | Scala | gpl-3.0 | 1,378 |
package io.buoyant.telemetry
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.timgroup.statsd.NonBlockingStatsDClient
import com.twitter.finagle.Stack
import com.twitter.finagle.util.DefaultTimer
import com.twitter.logging.Logger
import io.b... | linkerd/linkerd | telemetry/statsd/src/main/scala/io/buoyant/telemetry/StatsDInitializer.scala | Scala | apache-2.0 | 2,486 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/ml/tree/impl/TimeTracker.scala | Scala | apache-2.0 | 2,374 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.api
import java.lang.reflect.{ InvocationHandler, Type }
import java.util
import java.util.{ Optional, UUID }
import java.util.concurrent.CompletionStage
import akka.util.ByteString
import com.lightbend.l... | edouardKaiser/lagom | service/javadsl/api/src/test/scala/com/lightbend/lagom/internal/api/ServiceReaderSpec.scala | Scala | apache-2.0 | 7,155 |
/**
* 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... | CiscoCloud/exhibitor-mesos-framework | src/main/test/ly/stealth/mesos/exhibitor/ConstraintTest.scala | Scala | apache-2.0 | 5,405 |
package com.example.app
import com.example.service.{HttpServiceComponent, TwitterServiceComponent}
/**
* Created by takao on 2016/11/03.
*/
object ComponentRegistry extends
TwitterImageAppComponent with
ConfigComponent with
TwitterServiceComponent with
FlowsComponent with
HttpServiceComponen... | SakaiTakao/TwitterImageDownloader | src/main/scala/com/example/app/ComponentRegistry.scala | Scala | bsd-2-clause | 554 |
/* NEST (New Scala Test)
* Copyright 2007-2013 LAMP/EPFL
* @author Philipp Haller
*/
// $Id$
package scala.tools.partest
package nest
import java.io.{
File,
FilenameFilter,
IOException,
StringWriter,
FileInputStream,
FileOutputStream,
BufferedReader,
FileReader,
PrintWriter,
FileWriter
}
impor... | adriaanm/scala-partest | src/main/scala/scala/tools/partest/nest/FileManager.scala | Scala | bsd-3-clause | 5,055 |
/*
* Copyright (c) 2014-16 Miles Sabin
*
* 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... | rorygraves/perf_tester | corpus/shapeless/src/main/scala/shapeless/test/package.scala | Scala | apache-2.0 | 1,170 |
package slate
package util
class DelimitTransformSuite extends SlateSuite {
import DelimitTransform._
"simple" - {
"string" in {
string.to("hello").value shouldBe "hello"
string.from("hello") shouldBe "hello"
}
"arr" in {
string.splitBy("d").to("hello").value.toVector shouldBe Vecto... | edmundnoble/slate | ui/src/test/scala/slate/util/DelimitTransformSuite.scala | Scala | mit | 801 |
package com.fuscus.seien.infra.util
import java.io.ByteArrayInputStream
import java.nio.charset.StandardCharsets
import java.security.cert.{ CertificateFactory, X509Certificate }
trait SSLUtil {
/**
* get expired from certificate
*
* @param certificateString unescaped string
* @return
*/
def expire... | watawuwu/seien-backend | modules/infra/app/com/fuscus/seien/infra/util/SSLUtil.scala | Scala | mit | 848 |
/*
* Copyright 2017 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | pncampbell/ct-calculations | src/test/scala/uk/gov/hmrc/ct/accounts/frs102/AC8033Spec.scala | Scala | apache-2.0 | 1,677 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | GJL/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/stream/StreamExecPythonCorrelate.scala | Scala | apache-2.0 | 2,959 |
package saz2
class Teste {
val nome = "jcranky"
private var _idade = 99
def idade_=(x: Int) = {
require(x < 100)
_idade = x
}
def idade = _idade
}
object MainTeste extends App {
val t = new Teste()
t.idade = 109
println(t.nome)
println(t.idade)
}
| jcranky/saz | src/main/scala/saz2/Teste.scala | Scala | gpl-3.0 | 279 |
object NamingExtractorPattern {
class A
object A {
def unapply(a: A): Option[Int] = Some(3)
}
new A match {
case a@A(3) => /*start*/a/*end*/
}
}
//NamingExtractorPattern.A | katejim/intellij-scala | testdata/typeInference/pattern/NamingExtractorPattern.scala | Scala | apache-2.0 | 189 |
/*
* 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 ... | andrewor14/iolap | core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala | Scala | apache-2.0 | 18,570 |
/***********************************************************************
* 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-convert/geomesa-convert-common/src/test/scala/org/locationtech/geomesa/convert2/TypeInferenceTest.scala | Scala | apache-2.0 | 8,293 |
package models
import models.common.ReferenceTo
import models.customer.{ShopIn, AgentIn}
import play.api.libs.json._
import play.api.libs.functional.syntax._
case class User(username: String, agentId: Option[ReferenceTo[AgentIn]])
object User {
implicit val format = Json.format[User]
}
case class UserCredential(u... | tsechov/shoehorn | app/models/user.scala | Scala | apache-2.0 | 433 |
/*
* Copyright (c) 2013-2014, ARM Limited
*
* 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, p... | carpproject/vobla | src/scala/com/arm/carp/frontends/vobla/ValueTransformer.scala | Scala | mit | 3,632 |
package pomodoro
import org.eclipse.swt.widgets.Display
sealed trait PomodoroState {
val targetTimeOption: Option[Long]
}
case class InPomodoro(targetTime: Long) extends PomodoroState {
val targetTimeOption = Some(targetTime)
}
case class PomodoroComplete(targetTime: Long) extends PomodoroState {
val targetTim... | mdr/pomodoro4eclipse | pomodoro4eclipse/src/pomodoro/PomodoroTimerService.scala | Scala | mit | 3,974 |
package org.apache.spark.streaming.talos.offset
import java.io.{File, FileOutputStream}
import scala.collection.mutable
import org.apache.commons.io.{FileUtils, IOUtils}
import org.apache.hadoop.conf.Configuration
import org.apache.spark.streaming.Time
import org.apache.spark.streaming.talos.{TalosCluster, TopicPart... | XiaoMi/galaxy-sdk-java | galaxy-talos-client/galaxy-talos-spark/src/test/scala/org/apache/spark/streaming/talos/offset/HDFSOffsetDAOSuite.scala | Scala | apache-2.0 | 3,627 |
package jp.ijufumi.openreports.service.settings
import java.nio.file.{FileSystems, Files}
import jp.ijufumi.openreports.model.{TReportTemplate, TReportTemplateHistory}
import jp.ijufumi.openreports.service.OutputFilePath
import jp.ijufumi.openreports.service.enums.StatusCode
import jp.ijufumi.openreports.service.supp... | ijufumi/openreports_scala | src/main/scala/jp/ijufumi/openreports/service/settings/ReportTemplateSettingsService.scala | Scala | mit | 2,875 |
package arx.core.vec;
@SerialVersionUID(9223372036854770000L)
class Vec2f extends ReadVec2f{
def this(xa : Float,ya : Float){
this()
xi = xa
yi = ya
}
override def x_= ( s : Float ) { xi = s }
override def y_= ( s : Float ) { yi = s }
def +=(v : ReadVec2f) { xi += v.xi;yi += v.yi}
def +=(s : Float) {xi += ... | nonvirtualthunk/arx-core | src/main/scala/arx/core/vec/Vec2f.scala | Scala | bsd-2-clause | 1,910 |
/*
* Copyright 2012-2020 the original author or 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 ap... | planet42/Laika | core/shared/src/main/scala/laika/parse/text/PrefixedParser.scala | Scala | apache-2.0 | 6,283 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ronq/geomesa | geomesa-hbase/geomesa-hbase-tools/src/main/scala/org/locationtech/geomesa/hbase/tools/status/HBaseDescribeSchemaCommand.scala | Scala | apache-2.0 | 1,162 |
import java.awt.{Container, BorderLayout, Dimension}
import java.awt.event.{ActionEvent, ActionListener}
import java.nio.file.{Paths, Files}
import javax.swing._
import play.api.libs.json.Json
import scala.util.Try
case class Question(id: String, prompt: Seq[String], text: Seq[String], options: Seq[String])
object ... | EDawg878/LastDream | src/main/scala/LastDream.scala | Scala | gpl-2.0 | 3,497 |
/*
* Copyright 2017 Zhang Di
*
* 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 ... | statgenetics/seqspark | src/main/scala/org/dizhang/seqspark/ds/Bed.scala | Scala | apache-2.0 | 1,679 |
/*
* 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/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v3/REPAYMENTSQ1.scala | Scala | apache-2.0 | 1,027 |
package com.hackerforfuture.codeprototypes.dataloader.utils
import java.io.File
import java.util
import com.hackerforfuture.codeprototypes.dataloader.common.{FileContextV1, PathInfo}
import scala.util.matching.Regex
/**
* com.hackerforfuture.codeprototypes.dataloader.Utils
* Created by 10192057 on 2018/1/23 002... | BiyuHuang/CodePrototypesDemo | demo/DataLoader/src/main/scala/com/hackerforfuture/codeprototypes/dataloader/utils/LoaderUtils.scala | Scala | apache-2.0 | 2,523 |
package memnets.model.impl
import memnets.model._
private final class FImpl(
val owner: Y,
override val description: String,
var inputs: Iterable[Y]
)(f: TickFunction)
extends ElementBase
with F {
var _lastEval = 0.0
var _scale: Option[Float] = None
def act = _lastEval
def eval(te: Tick) ... | MemoryNetworks/memnets | api/src/main/scala/memnets/model/impl/FImpl.scala | Scala | apache-2.0 | 579 |
/*
* Copyright 2014 Edulify.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 applicable law or agreed to ... | apismensky/play-hikaricp.edulify.com | test/com/edulify/play/hikaricp/HikariCPDBApiSpec.scala | Scala | apache-2.0 | 5,559 |
/**
* Copyright (C) 2016 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* 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/LIC... | rvanheest-DANS-KNAW/easy-license-creator | src/test/scala/nl/knaw/dans/easy/license/DatasetLoaderSpec.scala | Scala | apache-2.0 | 8,214 |
/*
* 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 ... | yelshater/hadoop-2.3.0 | spark-core_2.10-1.0.0-cdh5.1.0/src/main/scala/org/apache/spark/network/netty/ShuffleSender.scala | Scala | apache-2.0 | 2,409 |
package com.monsanto.arch.cloudformation.model
import java.io.File
import org.scalatest.{Matchers, FunSpec}
import spray.json._
/**
* Created by djdool on 6/30/15.
*/
class VPCWriter_UT extends FunSpec with Matchers {
case class Currency(value: Int)
object Currency extends DefaultJsonProtocol {
implicit v... | MonsantoCo/cloudformation-template-generator | src/test/scala/com/monsanto/arch/cloudformation/model/VPCWriter_UT.scala | Scala | bsd-3-clause | 976 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/main/scala/com/waz/utils/events/Observable.scala | Scala | gpl-3.0 | 1,853 |
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.