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 |
|---|---|---|---|---|---|
object g_c_d_euclid_recursive {
def main(args: Array[String]) {
// Put code here
}
}
| LoyolaChicagoBooks/introcs-scala-examples | g_c_d_euclid_recursive/g_c_d_euclid_recursive.scala | Scala | gpl-3.0 | 93 |
package org.jetbrains.plugins.scala
package debugger.evaluateExpression
import org.jetbrains.plugins.scala.debugger._
/**
* Nikolay.Tropin
* 8/5/13
*/
class VariablesFromPatternsEvaluationTest extends VariablesFromPatternsEvaluationTestBase {
override implicit val version: ScalaVersion = Scala_2_11
}
class Vari... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/debugger/evaluateExpression/VariablesFromPatternsEvaluationTest.scala | Scala | apache-2.0 | 5,292 |
/**
* Copyright 2011-2017 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | MykolaB/gatling | gatling-core/src/test/scala/io/gatling/core/util/cache/CacheSpec.scala | Scala | apache-2.0 | 2,719 |
package vexriscv
import vexriscv.plugin._
import spinal.core._
import scala.collection.mutable.ArrayBuffer
import scala.collection.Seq
object VexRiscvConfig{
def apply(withMemoryStage : Boolean, withWriteBackStage : Boolean, plugins : Seq[Plugin[VexRiscv]]): VexRiscvConfig = {
val config = VexRiscvConfig()
... | SpinalHDL/VexRiscv | src/main/scala/vexriscv/VexRiscv.scala | Scala | mit | 5,185 |
package capitulo03
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.FunSuite
import scala.collection.mutable.ArrayBuffer
import scala.util.Sorting
@RunWith(classOf[JUnitRunner])
class AlgoritmosComuns extends FunSuite{
test("Soma de elementos da array"){
assert(19 =... | celioeduardo/scala-impatient | src/test/scala/capitulo03/AlgoritmosComuns.scala | Scala | mit | 1,462 |
package com.ctask
import org.scalatest.{FlatSpec, Matchers}
/**
* Spec file for settings.
*/
class ServerPropertiesSpec extends FlatSpec with Matchers {
behavior of "ServerProperties"
val defaultValueStr = "def"
val defaultValueInt = 3
it should "return the default value if a property is not in the con... | modsrm/ctask | server/src/test/scala/com/ctask/ServerPropertiesSpec.scala | Scala | gpl-3.0 | 1,224 |
object patternUnsoundness extends App {
class C[+T]
case class D[S](_s: S) extends C[S] {
var s: S = _s
}
val x = new D[String]("abc")
val y: C[Object] = x
y match {
case d @ D(x) => d.s = new Integer(1)
}
val z: String = x.s // ClassCast exception
} | DarkDimius/dotty | tests/neg/patternUnsoundness.scala | Scala | bsd-3-clause | 287 |
/*
* Copyright 2017 by Simba Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | InitialDLab/Simba | src/test/scala/org/apache/spark/sql/simba/index/TreapSuite.scala | Scala | apache-2.0 | 2,091 |
/*
* Copyright (c) 2010-2011 Belmont Technology Pty Ltd. 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
*
* U... | GrahamLea/SodaTest | sodatest-api/src/main/scala/org/sodatest/api/SodaFixture.scala | Scala | apache-2.0 | 3,405 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-tools/src/main/scala/org/locationtech/geomesa/tools/export/formats/FileSystemExporter.scala | Scala | apache-2.0 | 2,990 |
package poly.collection
/**
* @author Tongfei Chen
*/
object specgroup {
type unsp = scala.annotation.unspecialized
type sp = scala.specialized
final val fd = new Specializable.Group((Float, Double))
final val di = new Specializable.Group((Int, Double))
final val fdi = new Specializable.Group((Int, Float,... | ctongfei/poly-collection | core/src/main/scala/poly/collection/specgroup.scala | Scala | mit | 1,648 |
/*
* 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... | liquidarmour/ct-calculations | src/test/scala/uk/gov/hmrc/ct/ct600e/v3/E170Spec.scala | Scala | apache-2.0 | 1,757 |
/*
* Copyright 2010-2014 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 applica... | lzpfmh/framework-2 | persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/field/EnumFieldSpec.scala | Scala | apache-2.0 | 3,848 |
package models
import play.api.libs.json.{Json, OFormat}
import reactivemongo.bson.BSONObjectID
import reactivemongo.play.json._
/**
* Created by Ankesh on 3/28/2017.
*/
case class Blog(_id: Option[BSONObjectID],title:String, author:String, body:String) {
}
object Blog {
implicit val formatter: OFormat[Blog] = ... | Dashbrd/scala-blog | app/models/Blog.scala | Scala | apache-2.0 | 340 |
package com.gigaspaces.csvwriter
import org.springframework.transaction.annotation.{Propagation, Transactional}
import com.gigaspaces.document.SpaceDocument
import org.openspaces.core.GigaSpace
import com.gigaspaces.csvwriter.AppSettings._
/**
* Created by IntelliJ IDEA.
* User: jason
* Date: 4/11/14
* Time:... | jasonnerothin/gs-csvwriter | src/main/scala/com/gigaspaces/csvwriter/SpaceDocumentWriter.scala | Scala | apache-2.0 | 668 |
package com.stefansavev.randomprojections.implementation
import com.stefansavev.randomprojections.datarepr.sparse.SparseVector
object HadamardUtils {
//assume k is a power of 2
//TODO: make it work without k being a power of 2
val eps = 0.0001
def recurse(from: Int, to: Int, input: Array[Double], output: Arr... | codeaudit/random-projections-at-berlinbuzzwords | src/main/scala/com/stefansavev/randomprojections/implementation/HadamardUtils.scala | Scala | apache-2.0 | 5,810 |
/*
* Copyright 2016 Nikolay Donets
*
* 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 ... | nikdon/telepooz | src/main/scala/com/github/nikdon/telepooz/model/Animation.scala | Scala | apache-2.0 | 1,332 |
package generator.graphql
import cats.data.Validated.{Invalid, Valid}
import io.apibuilder.generator.v0.models.{File, InvocationForm}
import io.apibuilder.graphql.GraphQLCodeGenerator
import io.apibuilder.validation.{ApiBuilderService, MultiService}
import lib.generator.CodeGenerator
object GraphQLApolloGenerator ext... | mbryzek/apidoc-generator | graphql-generator/src/main/scala/generator/graphql/GraphQLApolloGenerator.scala | Scala | mit | 802 |
/*
* Copyright 2022 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/iht-frontend | app/iht/viewmodels/estateReports/YourEstateReportsRowViewModel.scala | Scala | apache-2.0 | 4,673 |
package co.ledger.wallet.web.ripple.content
import co.ledger.wallet.web.ripple.core.database.{DatabaseDeclaration, Model, ModelCreator, QueryHelper}
/**
*
* SampleModel
* ledger-wallet-ripple-chrome
*
* Created by Pierre Pollastri on 07/06/2016.
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ledge... | LedgerHQ/ledger-wallet-ripple | src/main/scala/co/ledger/wallet/web/ripple/content/SampleModel.scala | Scala | mit | 1,888 |
/*
* LKExporterTest.scala
*/
package at.logic.gapt.formats.calculi.xml
import at.logic.gapt.formats.xml.{ HOLTermXMLExporter, LKExporter }
import at.logic.gapt.proofs.HOLSequent
import org.specs2.mutable._
import scala.xml.Utility.trim
import at.logic.gapt.proofs.lk.base._
import at.logic.gapt.expr._
import at.lo... | loewenheim/gapt | src/test/scala/at/logic/gapt/formats/calculi/xml/LKExporterTest.scala | Scala | gpl-3.0 | 13,561 |
/*
* Copyright (c) 2013 Aviat Networks.
* This file is part of DocReg+Web. Please refer to the NOTICE.txt file for license details.
*/
package vvv.docreg.model
import net.liftweb._
import util._
import common._
import Helpers._
import http._
import provider.HTTPCookie
import vvv.docreg.util.{Environment, StringUti... | scott-abernethy/docreg-web | src/main/scala/vvv/docreg/model/User.scala | Scala | gpl-3.0 | 9,426 |
package lila.gameSearch
import com.sksamuel.elastic4s.ElasticDsl._
import org.elasticsearch.search.sort.SortOrder
case class Sorting(f: String, order: String) {
def definition =
field sort (Sorting.fieldKeys contains f).fold(f, Sorting.default.f) order
(order.toLowerCase == "asc").fold(SortOrder.ASC, Sor... | pavelo65/lila | modules/gameSearch/src/main/Sorting.scala | Scala | mit | 652 |
package ca.hyperreal.sscheme
import org.scalatest._
import prop.PropertyChecks
class Examples extends FreeSpec with PropertyChecks with Matchers
{
"sort" in
{
val env = environment( """
(define sort #f)
(let ()
(define dosort
(lambda (pred? ls n)
(if (= n 1)
(list (car ls))
(let ((i (q... | edadma/sscheme | src/test/scala/Examples.scala | Scala | mit | 1,005 |
package opennlp.scalabha.tag.hmm
import org.apache.commons.logging.LogFactory
import opennlp.scalabha.tag.support._
import opennlp.scalabha.tag._
import opennlp.scalabha.util.CollectionUtils._
import opennlp.scalabha.util.LogNum._
import opennlp.scalabha.util.Pattern
import opennlp.scalabha.util.Pattern.{ -> }
import ... | dhgarrette/type-supervised-tagging-2012emnlp | src/main/scala/opennlp/scalabha/tag/hmm/UnsupervisedHmmTaggerTrainer.scala | Scala | apache-2.0 | 19,871 |
package com.ubirch.auth.model
/**
* author: cvandrei
* since: 2017-04-25
*/
case class UserUpdate(displayName: String)
| ubirch/ubirch-auth-service | model/src/main/scala/com/ubirch/auth/model/UserUpdate.scala | Scala | apache-2.0 | 126 |
/**
* Copyright (c) 2007-2011 Eric Torreborre <etorreborre@yahoo.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
* the rights ... | Muki-SkyWalker/specs | src/test/scala/org/specs/mock/mockitoSpecification.scala | Scala | mit | 6,583 |
//-----------------------------------------------------------------------
// FILE : Processor.scala
// SUBJECT : Abstract superclass representing tree processors.
// AUTHOR : (C) Copyright 2011 by Peter C. Chapin <PChapin@vtc.vsc.edu>
//
//-----------------------------------------------------------------------
pack... | pchapin/sprocket | src/edu/uvm/sprocket/Processor.scala | Scala | bsd-3-clause | 409 |
package com.github.sedovalx.cassandra.service.generation.builders
import javax.lang.model.element.Modifier
import com.datastax.driver.core.{Statement, ResultSetFuture, ResultSet}
import com.datastax.driver.mapping.{Result, MappingManager}
import com.github.sedovalx.cassandra.services.base.AbstractAccessorJava8Adapter... | sedovalx/cassandra-service-generator | cassandra-service-generator/src/main/scala/com/github/sedovalx/cassandra/service/generation/builders/AccessorAdapterSpecBuilder.scala | Scala | apache-2.0 | 6,055 |
package com.github.novamage.svalidator.binding.binders.typed
import com.github.novamage.svalidator.binding.binders.{JsonTypedBinder, TypedBinder}
import com.github.novamage.svalidator.binding.{BindingConfig, BindingFailure, BindingPass, BindingResult}
import io.circe.ACursor
/** Performs binding of a double field
*... | NovaMage/SValidator | src/main/scala/com/github/novamage/svalidator/binding/binders/typed/DoubleBinder.scala | Scala | mit | 1,745 |
package ohnosequences.loquat.test
import ohnosequences.loquat._
import ohnosequences.awstools._, regions._, ec2._, autoscaling._, s3._
import ohnosequences.statika._
import test.dataProcessing._
import scala.concurrent._, duration._
case object config {
val defaultAMI = AmazonLinuxAMI(Ireland, HVM, InstanceStore)
... | ohnosequences/loquat | src/test/scala/ohnosequences/loquat/test/config.scala | Scala | agpl-3.0 | 1,424 |
package org.jetbrains.plugins.scala
package codeInspection.collections
import com.intellij.testFramework.EditorTestUtil
import org.jetbrains.plugins.scala.codeInspection.InspectionBundle
/**
* Nikolay.Tropin
* 5/30/13
*/
class MapGetOrElseTest extends OperationsOnCollectionInspectionTest {
import EditorTestUtil... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/codeInspection/collections/MapGetOrElseTest.scala | Scala | apache-2.0 | 2,945 |
/**
* Copyright 2015, deepsense.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/it/scala/io/deepsense/deeplang/doperations/GridSearchIntegSpec.scala | Scala | apache-2.0 | 5,989 |
package com.clackjones.connectivitymap.spark
import com.clackjones.connectivitymap.UnitSpec
import scala.util.{Failure, Success, Try}
class SparkCmapHelperFunctionsSpec extends UnitSpec {
"filenameToRefsetName" should "return a Success with the ReferenceSet name generated from the filename" in {
val path = "/p... | hiraethus/scala-connectivity-map | src/test/scala/com/clackjones/connectivitymap/spark/SparkCmapHelperFunctionsSpec.scala | Scala | gpl-3.0 | 949 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot 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 req... | akkie/play-silhouette | silhouette-testkit/app/com/mohiva/play/silhouette/test/Fakes.scala | Scala | apache-2.0 | 8,027 |
/*
* Copyright 2001-2013 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... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/ShouldTripleEqualsSpec.scala | Scala | apache-2.0 | 14,043 |
package io.sphere.util
import java.util.Locale
/** Extractor for Locales, e.g. for use in pattern-matching request paths. */
object LangTag {
final val UNDEFINED: String = "und"
class LocaleOpt(val locale: Locale) extends AnyVal {
// if toLanguageTag returns "und", it means the language tag is undefined
... | sphereio/sphere-scala-libs | util/src/main/scala/LangTag.scala | Scala | apache-2.0 | 590 |
package com.insweat.hssd.lib.tree
import com.insweat.hssd.lib.tree.structured.StructuredTree
import com.insweat.hssd.lib.tree.structured.StructuredTreeNode
import com.insweat.hssd.lib.essence.SchemaLike
import com.insweat.hssd.lib.essence.EntryData
import scala.collection.immutable.HashMap
import scala.util.control.Br... | insweat/hssd | com.insweat.hssd.lib/src/com/insweat/hssd/lib/tree/EntryTree.scala | Scala | lgpl-3.0 | 1,231 |
/*============================================================================
This Chisel source file is part of a pre-release version of the HardFloat IEEE
Floating-Point Arithmetic Package, by John R. Hauser (with some contributions
from Yunsup Lee and Andrew Waterman, mainly concerning testing).
Copyright 2017 S... | stanford-ppl/spatial-lang | spatial/core/resources/chiselgen/template-level/templates/hardfloat/DivSqrtRecFN_small.scala | Scala | mit | 12,861 |
package com.github.j5ik2o.forseti.adaptor.handler.model
import com.github.j5ik2o.forseti.domain.exception.InvalidRequestException
import com.github.j5ik2o.forseti.domain.{GrantType, Message, Scope}
import scalaz.{Maybe, \\/}
trait AuthorizationGrant extends Message {
def grantType: InvalidRequestException \\/ Gra... | j5ik2o/forseti | server/server-use-case-port/src/main/scala/com/github/j5ik2o/forseti/adaptor/handler/model/AuthorizationGrant.scala | Scala | mit | 503 |
package ninja.fangs.github
import org.eclipse.egit.github.core.client.GitHubClient
import org.eclipse.egit.github.core.service.RepositoryService
import scalafx.event.ActionEvent
import scalafx.geometry.{Insets, Pos}
import scalafx.scene.Scene
import scalafx.scene.control.{Button, PasswordField, TextField}
import scala... | kfang/scalafx-github | src/main/scala/ninja/fangs/github/LoginScene.scala | Scala | gpl-3.0 | 1,295 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/cloud/CacheRefreshTestCase.scala | Scala | apache-2.0 | 2,202 |
package org.jetbrains.plugins.scala.externalLibraries.kindProjector.inspections
import com.intellij.codeInspection.{LocalQuickFix, ProblemDescriptor, ProblemsHolder}
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.codeInspection.{AbstractFixOnPsiElement... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/externalLibraries/kindProjector/inspections/KindProjectorUseCorrectLambdaKeywordInspection.scala | Scala | apache-2.0 | 3,781 |
/*
* 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 | io/src/main/scala/laika/io/config/IncludeHandler.scala | Scala | apache-2.0 | 6,767 |
package org.crockeo.genericplatformer.assets
import com.badlogic.gdx.audio.Music
import com.badlogic.gdx.Gdx
object MusicManager extends AssetManager[Music] {
// The backend for loading an asset
protected def loadBackend(path: String): Music =
Gdx.audio.newMusic(Gdx.files.local(path))
// Loading all asse... | crockeo/generic-platformer | src/org/crockeo/genericplatformer/assets/MusicManager.scala | Scala | gpl-3.0 | 349 |
/**
* 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... | MyPureCloud/kafka | core/src/test/scala/unit/kafka/producer/SyncProducerTest.scala | Scala | apache-2.0 | 11,080 |
package org.scalaide.core.internal.lexical
import scalariform.lexer.ScalaLexer
import org.scalaide.ui.syntax.ScalaSyntaxClasses
import org.scalaide.ui.syntax.ScalariformToSyntaxClass
import scala.annotation.tailrec
import scalariform.ScalaVersion
import scalariform.lexer.{ Token => ScalariformToken }
import scalarifor... | scala-ide/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/core/internal/lexical/ScalaCodeTokenizerScalariformBased.scala | Scala | bsd-3-clause | 2,054 |
package zeroformatter.benchmark
import cats.Eval
import zeroformatter._
@ZeroFormattable
case class Bar(
@Index(0) s: Eval[String],
@Index(1) d: Eval[Double],
@Index(2) i: Eval[Int],
@Index(3) l: Eval[Long],
@Index(4) bs: Eval[Vector[Boolean]]
)
object Bar extends ZeroFormatterBarInstances {
}
| pocketberserker/scala-zero-formatter | benchmark/src/main/scala/zeroformatter/benchmark/Bar.scala | Scala | mit | 308 |
package controllers
import scalaz._
import Scalaz._
import scalaz.Validation._
import net.liftweb.json._
import io.megam.auth.funnel._
import io.megam.auth.funnel.FunnelErrors._
import play.api.mvc._
import controllers.stack.Results
object EventsVm extends Controller with controllers.stack.APIAuthElement {
def post... | indykish/vertice_gateway | app/controllers/events/EventsVm.scala | Scala | mit | 4,525 |
// Unicode newline in a single-line comment?
// Compiler will expect code on the line.
// Here the code is valid.
/* \n object foo */
// \n object foo
/* \12 object foo */
// \12 object foo
/* \u000a object foo */
// object foo \u000a
// \u000a object foo
/* \n foo */
// \n foo
/* \12 foo */
// \12 foo
/* \u000a foo *... | lrytz/scala | test/files/pos/u000a.scala | Scala | apache-2.0 | 350 |
/*
* 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 ... | dmlc/mxnet | scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostInference.scala | Scala | apache-2.0 | 3,551 |
package net.liftmodules.ng
package test
import Angular.NgModel
package object model {
case class Test2Obj(str1:String, str2:String) extends NgModel
case class BroadcastObj(num:Int, char:String)
case class StringInt(str:String, num:Int)
}
| extirpate/lift-ng | test-project/src/main/scala/net/liftmodules/ng/test/model/package.scala | Scala | apache-2.0 | 246 |
/*
* 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 | sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/commands.scala | Scala | apache-2.0 | 10,344 |
/**
* Copyright 2015 Thomson Reuters
*
* 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... | thomsonreuters/CM-Well | server/cmwell-it/src/it/scala/cmwell/it/SearchTests.scala | Scala | apache-2.0 | 20,465 |
package collins.controllers.actions.state
import scala.concurrent.Future
import play.api.data.Form
import play.api.data.Forms.tuple
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import collins.controllers.validators.ParamValidation
import collins.controllers.SecureController
import collins.contr... | funzoneq/collins | app/collins/controllers/actions/state/UpdateAction.scala | Scala | apache-2.0 | 5,396 |
/*
Deduction Tactics
Copyright (C) 2012-2015 Raymond Dodge
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 progra... | rayrobdod/boardGame | ViewSwing/src/test/scala/FlattenLayersTest.scala | Scala | gpl-3.0 | 3,102 |
trait Transition[From, To]
infix type ==>[From, To] = Transition[From, To]
type A = A.type
object A
type B = B.type
object B
type C = C.type
object C
// Compiles
given (A ==> B) = ???
// was Compile error
given (A ==> C) = ???
| dotty-staging/dotty | tests/pos/i10927.scala | Scala | apache-2.0 | 233 |
package controllers
import play.api._
import play.api.mvc._
import play.api.Logger
class Application extends Controller {
def wildCardFunction = Action { implicit request =>
Logger.debug("===========================================")
Logger.debug("METHOD:")
Logger.debug(" |-- "+request.method)
Logg... | nerorevenge/httpPlayground | app/controllers/Application.scala | Scala | apache-2.0 | 546 |
package com.magmanics.licensing.ui.content.product
import com.magmanics.licensing.model._
import com.vaadin.data.util.BeanItemContainer
import com.vaadin.ui.AbstractSelect.ItemCaptionMode
import com.vaadin.ui.Table
import scala.beans.BeanInfo
/**
* @author James Baxter - 23/09/2014.
*/
class ProductOptionsTable ex... | manicmonkey/licensing | Licensing-UI-Vaadin/src/main/scala/com/magmanics/licensing/ui/content/product/ProductOptionsTable.scala | Scala | gpl-3.0 | 1,315 |
package com.eevolution.context.dictionary.infrastructure.service
import java.util.UUID
import akka.NotUsed
import com.eevolution.context.dictionary.domain._
import com.eevolution.context.dictionary.domain.model.User
import com.eevolution.utils.PaginatedSequence
import com.lightbend.lagom.scaladsl.api.{Service, Servic... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/service/UserService.scala | Scala | gpl-3.0 | 1,951 |
/* Copyright (C) 2012-2013 Treode, 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... | Treode/cps | src/stub/scala/com/treode/cps/stub/scheduler/executors.scala | Scala | apache-2.0 | 5,362 |
/*
* 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/linalg/MatrixUDT.scala | Scala | apache-2.0 | 4,306 |
/*
* Copyright 2016 Jesper de Jong
*
* 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 ... | jesperdj/spring-cloud-demo | whiteboard-client/src/main/scala/com/jesperdj/example/client/whiteboard/WhiteboardClientController.scala | Scala | apache-2.0 | 1,408 |
package dregex
import java.util.regex.Pattern
import dregex.TestUtil.using
import org.scalatest.funsuite.AnyFunSuite
class CaseInsensitiveTest extends AnyFunSuite {
test("case insensitive") {
using(Regex.compile("a", Pattern.CASE_INSENSITIVE)) { r =>
assertResult(true)(r.matches("A"))
assertResul... | marianobarrios/dregex | src/test/scala/dregex/CaseInsensitiveTest.scala | Scala | bsd-2-clause | 881 |
package org.openurp.edu.eams.system.firstlogin.impl
import org.beangle.commons.lang.Chars
import org.openurp.edu.eams.system.firstlogin.PasswordValidator
class DefaultPasswordValidator extends PasswordValidator {
def validate(password: String): String = {
if (password.length < 6) return "密码的长度不应小于六位"
var... | openurp/edu-eams-webapp | web/src/main/scala/org/openurp/edu/eams/system/firstlogin/impl/DefaultPasswordValidator.scala | Scala | gpl-3.0 | 812 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | Dax1n/spark-core | core/src/main/scala/org/apache/spark/rdd/CoGroupedRDD.scala | Scala | apache-2.0 | 7,565 |
package de.frosner.ddq.constraints
sealed trait ConstraintStatus {
val stringValue: String
}
object ConstraintSuccess extends ConstraintStatus {
val stringValue = "Success"
}
object ConstraintFailure extends ConstraintStatus {
val stringValue = "Failure"
}
case class ConstraintError(throwable: Throwable) exte... | FRosner/drunken-data-quality | src/main/scala/de/frosner/ddq/constraints/ConstraintStatus.scala | Scala | apache-2.0 | 373 |
package se.uu.farmbio.cp
import java.io.Serializable
import org.apache.spark.Logging
import org.apache.spark.mllib.linalg.Vector
import org.apache.spark.mllib.regression.LabeledPoint
object ICPClassifierModel {
def deserialize[A <: UnderlyingAlgorithm](
model: String,
algDeserializer: Deserializer[A... | mcapuccini/spark-cp | cp/src/main/scala/se/uu/farmbio/cp/ICPClassifierModel.scala | Scala | apache-2.0 | 3,360 |
package com.zkay
import com.zkay.Listing1_13.Balance
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
/*
* Portfolio Statement - event driven (pg 37, listing 1.14)
*/
object Listing1_14 {
def getCurrencyBalance: Future[Balance] = Future.successful(1000)
def getEquityBal... | zkay/bookclub_notes | FunctionalAndReactiveDomainModeling/chapter1/src/main/scala/Listing1_14.scala | Scala | apache-2.0 | 979 |
/*
* 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 org.scalajs.testsuite.javalib.lang
im... | scala-js/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/lang/ObjectTest.scala | Scala | apache-2.0 | 4,267 |
package container
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.HashMap
import scala.collection.mutable.ListBuffer
import org.scalatest.junit.JUnitRunner
import common.CommonTest
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import java.io.File
import container.api.SkillFi... | skill-lang/skillScalaTestSuite | src/test/scala/container/FullTest.scala | Scala | bsd-3-clause | 2,786 |
package is.hail.expr.ir.functions
import is.hail.asm4s
import is.hail.asm4s.{coerce => _, _}
import is.hail.expr.ir._
import is.hail.types.physical._
import is.hail.utils._
import is.hail.types.virtual._
import org.apache.spark.sql.Row
import scala.reflect.ClassTag
object UtilFunctions extends RegistryFunctions {
... | danking/hail | hail/src/main/scala/is/hail/expr/ir/functions/UtilFunctions.scala | Scala | mit | 13,036 |
package org.vitrivr.adampro.query.distance
import org.vitrivr.adampro.data.datatypes.vector.Vector._
import org.vitrivr.adampro.query.distance.Distance._
/**
* ADAMpro
*
* Ivan Giangreco
* June 2016
*
* from Julia: sum(p .* log(p ./ q))
*/
object KullbackLeiblerDivergence extends ElementwiseSummedDistan... | dbisUnibas/ADAMpro | src/main/scala/org/vitrivr/adampro/query/distance/KullbackLeiblerDivergence.scala | Scala | mit | 571 |
package commons.repositories
trait WithId[Underlying, Id <: BaseId[Underlying]] {
def id: Id
}
| Dasiu/play-framework-test-project | app/commons/repositories/WithId.scala | Scala | mit | 100 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.javadsl.persistence.testkit
import akka.actor.{ ActorRef, ActorSystem, Props, actorRef2Scala }
import akka.persistence.PersistentActor
import akka.testkit.{ ImplicitSender, TestKitBase }
import com.lightbend.lagom... | rstento/lagom | persistence/javadsl/src/test/scala/com/lightbend/lagom/javadsl/persistence/testkit/AbstractEmbeddedPersistentActorSpec.scala | Scala | apache-2.0 | 1,875 |
/*
* 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 ... | cloud-fan/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala | Scala | apache-2.0 | 19,275 |
package ml.wolfe.term
/**
* @author riedel
*/
trait ConvertValueTerm[A <: Term[Dom], D <: Dom] extends Term[D] with NAry {
val term:A
val domain:D
def f(arg:term.domain.Value):domain.Value
type ArgumentType = A
def arguments = IndexedSeq(term)
private var currentExecution:Execution = null
private ... | wolfe-pack/wolfe | wolfe-core/src/main/scala/ml/wolfe/term/ConvertValueTerm.scala | Scala | apache-2.0 | 2,016 |
package spark
import java.io.ByteArrayInputStream
import java.io.EOFException
import java.net.URL
import java.util.concurrent.LinkedBlockingQueue
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.atomic.Ato... | jperla/spark-advancers | core/src/main/scala/spark/ParallelShuffleFetcher.scala | Scala | bsd-3-clause | 4,412 |
package dotty.tools.dotc.util
/** Defines a key type with which to tag properties, such as attachments
* or context properties
*/
object Property {
/** The class of keys for properties of type V */
class Key[+V]
/**
* The class of keys for sticky properties of type V
*
* Sticky properties are prope... | som-snytt/dotty | compiler/src/dotty/tools/dotc/util/Property.scala | Scala | apache-2.0 | 435 |
package java.nio
import scala.scalajs.js.typedarray._
object ShortBuffer {
private final val HashSeed = 383731478 // "java.nio.ShortBuffer".##
def allocate(capacity: Int): ShortBuffer =
wrap(new Array[Short](capacity))
def wrap(array: Array[Short], offset: Int, length: Int): ShortBuffer =
HeapShortBuf... | jmnarloch/scala-js | javalib/src/main/scala/java/nio/ShortBuffer.scala | Scala | bsd-3-clause | 2,925 |
/**
* 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... | Ishiihara/kafka | core/src/test/scala/unit/kafka/server/FetchSessionTest.scala | Scala | apache-2.0 | 15,623 |
/*
* Copyright 2016-2017 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 applicab... | uts-cic/tap | src/main/scala/tap/data/TapAnalytics.scala | Scala | apache-2.0 | 721 |
/**
* 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"); yo... | justinleet/metron | metron-platform/metron-integration-test/src/main/scala/org/apache/metron/integration/wrapper/TestUtilsWrapper.scala | Scala | apache-2.0 | 1,423 |
import scala.io.Source
object Solution extends App {
val lines = Source.stdin.getLines().toList
val s = lines.tail.head
val characters = s.distinct
val strings = (for {
i <- 0 until characters.length - 1
j <- i + 1 until characters.length
} yield {
val c1 = characters(i)
val c2 = characters(j... | PaulNoth/hackerrank | practice/algorithms/strings/two_characters/solution.scala | Scala | mit | 606 |
package dtc.cats.instances
import java.time._
import cats.Invariant
import dtc.Local
object local extends CatsLocalInstances
trait CatsLocalInstances {
implicit val localInvariant: Invariant[Local] = new Invariant[Local] {
def imap[A, B](ev: Local[A])(f: A => B)(g: B => A): Local[B] = new Local[B] {
def... | vpavkin/dtc | cats/shared/src/main/scala/dtc/cats/instances/local.scala | Scala | apache-2.0 | 2,695 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Enterprise Data Management Council
*
* 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... | edmcouncil/rdf-serializer | src/main/scala/org/edmcouncil/rdf_toolkit/owlapi_serializer/RdfXmlSorter.scala | Scala | mit | 2,169 |
/*
* 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/main/scala/org/apache/flink/table/planner/calcite/FlinkTypeSystem.scala | Scala | apache-2.0 | 6,484 |
package io.udash.web.server
import io.udash.rest._
import io.udash.rpc._
import io.udash.rpc.utils.{CallLogging, DefaultAtmosphereFramework}
import io.udash.web.guide.demos.activity.{Call, CallLogger}
import io.udash.web.guide.demos.rest.MainServerREST
import io.udash.web.guide.rest.ExposedRestInterfaces
import io.uda... | UdashFramework/udash-core | guide/backend/src/main/scala/io/udash/web/server/ApplicationServer.scala | Scala | apache-2.0 | 3,764 |
/*
* 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 ... | sachintyagi22/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/LimitPushdownSuite.scala | Scala | apache-2.0 | 6,646 |
package day9
import cats._
import cats.data._
import cats.implicits._
import scala.util.Try
import scala.annotation.tailrec
case class Prob[A](list: List[(A, Double)])
trait ProbInstances { self =>
def flatten[B](xs: Prob[Prob[B]]): Prob[B] = {
def multall(innerxs: Prob[B], p: Double) =
innerxs.list map... | wgx731/learning-cats | src/main/scala/day9.scala | Scala | unlicense | 4,705 |
package controllers
import models.User
import play.Logger
import play.api.mvc.{Action, Controller}
import play.api.data._
import play.api.data.Forms._
import services.UserServiceImpl._
import play.api.mvc._
import play.filters.csrf._
/**
* Created by svirdi on 1/11/15.
*/
object Users extends Controller {
case cl... | virdis/functional-imperative.com | app/controllers/Users.scala | Scala | gpl-2.0 | 1,162 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package statements
import org.jetbrains.plugins.scala.lang.psi.api.base.ScIdList
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.ScTypedDefinition
/**
* @author Alexander Podkhalyuzin
*/
trait ScVariableDeclaration extends ScVariable wi... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/api/statements/ScVariableDeclaration.scala | Scala | apache-2.0 | 470 |
package views.html
import play.templates._
import play.templates.TemplateMagic._
import play.api.templates._
import play.api.templates.PlayMagic._
import models._
import controllers._
import java.lang._
import java.util._
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import play.... | bfcmyxa/Backgammon-Web-master_for_2.1.5 | target/scala-2.10/src_managed/main/views/html/game.template.scala | Scala | gpl-2.0 | 4,904 |
/*
Copyright 2015 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | twitter/scalding | scalding-serialization/src/main/scala/com/twitter/scalding/serialization/OrderedSerialization.scala | Scala | apache-2.0 | 8,123 |
package uk.gov.dvla.vehicles.presentation.common.views
import org.scalatest.selenium.WebBrowser.go
import org.scalatest.selenium.WebBrowser.pageTitle
import uk.gov.dvla.vehicles.presentation.common.composition.TestHarness
import uk.gov.dvla.vehicles.presentation.common.helpers.UiSpec
import uk.gov.dvla.vehicles.presen... | dvla/vehicles-presentation-common | common-test/test/uk/gov/dvla/vehicles/presentation/common/views/ValtechInputTextAreaIntegrationSpec.scala | Scala | mit | 1,549 |
/*
* Dac_~.scala
* (Cord)
*
* Copyright (c) 2015-2020 Hanns Holger Rutz.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.cord
package objects
import de.sciss.cord.a... | Sciss/Cord | src/main/scala/de/sciss/cord/objects/Dac_~.scala | Scala | lgpl-2.1 | 1,923 |
package org.kangmo.tradeapi
import org.kangmo.http._
import org.kangmo.helper._
import java.math.BigDecimal
import scala.concurrent.{Future,Await}
import scala.concurrent.duration._
case class Version (
major : Int,
minor : Int,
revision : Int
)
case class Constants (
transactionFee : BigDecimal,
minKrwWithdra... | Kangmo/korbit-nodejs-sdk | main/src/main/scala/scala/API.scala | Scala | apache-2.0 | 1,931 |
/**
* 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"... | stealthly/exhibitor-mesos-framework | src/main/scala/net/elodina/mesos/exhibitor/Util.scala | Scala | apache-2.0 | 8,370 |
package ru.maizy.cheesecake.server.tests.bodyparser
/**
* Copyright (c) Nikita Kovaliov, maizy.ru, 2016
* See LICENSE.txt for details.
*/
import com.typesafe.config.ConfigFactory
import org.scalatest.FlatSpecLike
import org.scalatest.prop.TableDrivenPropertyChecks._
import org.scalatest.prop.Tables.Table
import ru... | maizy/cheesecake | server/src/test/scala/ru/maizy/cheesecake/server/tests/bodyparser/RegexpParserSpecSpec.scala | Scala | apache-2.0 | 1,809 |
package android
import java.io.File
import sbt.{Configuration, Task, Def, Setting}
import scala.language.experimental.macros
import scala.util.{Failure, Success, Try}
package object dsl {
def list[A](body: Seq[A]): List[A] = macro dsl.Macros.listImplN[A]
def list[A](body: A): List[A] = macro dsl.Macros.list... | dant3/android-sdk-plugin | src/dsl.scala | Scala | bsd-3-clause | 6,054 |
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.