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 cobase.play.user
import play.api.data.Form
import play.api.data.Forms._
/**
* The form which handles the sign up process.
*/
object SignUpForm {
/**
* A play framework form.
*/
val form = Form(
mapping(
"firstName" -> nonEmptyText,
"lastName" -> nonEmptyText,
"email" -> email... | Cobase/cobase-pro | app/cobase/play/user/SignUpForm.scala | Scala | mit | 690 |
/*
* 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/accounts/frs10x/boxes/ProfitAndLossStatementRequired.scala | Scala | apache-2.0 | 1,686 |
//
// OverloadedType.scala -- Scala class OverloadedType
// Project OrcScala
//
// $Id: OverloadedType.scala 2933 2011-12-15 16:26:02Z jthywissen $
//
// Created by dkitchin on Nov 30, 2010.
//
// Copyright (c) 2011 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is gov... | laurenyew/cOrcS | src/orc/types/OverloadedType.scala | Scala | bsd-3-clause | 1,978 |
/** Copyright 2014 TappingStone, 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 ... | TheDataShed/PredictionIO | data/src/main/scala/storage/mongodb/MongoEngineInstances.scala | Scala | apache-2.0 | 5,576 |
/*
* Copyright (C) 2005, The OpenURP Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This... | openurp/api | edu/src/main/scala/org/openurp/edu/clazz/model/Subclazz.scala | Scala | lgpl-3.0 | 1,036 |
package breeze.linalg
import breeze.generic.UFunc
import org.netlib.util.intW
import com.github.fommil.netlib.LAPACK.{getInstance=>lapack}
/**
* Eigenvalue decomposition (right eigenvectors)
*
* This function returns the real and imaginary parts of the eigenvalues,
* and the corresponding eigenvectors. For most ... | dlwh/breeze | math/src/main/scala/breeze/linalg/functions/eig.scala | Scala | apache-2.0 | 4,694 |
// Copyright (C) 2014 Open Data ("Open Data" refers to
// one or more of the following companies: Open Data Partners LLC,
// Open Data Research LLC, or Open Data Capital LLC.)
//
// This file is part of Hadrian.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in ... | opendatagroup/hadrian | hadrian/src/test/scala/lib/model/neighbor.scala | Scala | apache-2.0 | 5,842 |
/* checkAll and friends were copied from the scalaz-specs2 project.
* Source file: src/main/scala/Spec.scala
* Project address: https://github.com/typelevel/scalaz-specs2
* Copyright (C) 2013 Lars Hupel
* License: MIT. https://github.com/typelevel/scalaz-specs2/blob/master/LICENSE.txt
* Commit df921e18cf8bf0fd0bb5... | hvesalai/http4s | core/src/test/scala/org/http4s/Http4sSpec.scala | Scala | apache-2.0 | 3,153 |
import scala.collection.mutable.PriorityQueue
object Solution {
case class Edge(src:Int, dst:Int, wt:Int) {
def swap() = new Edge(dst,src,wt)
}
object EdgeOrdering extends Ordering[Edge] {
override def compare(a:Edge, b:Edge) = b.wt compare a.wt
}
def arrayToEdge(arr:Array[Int]): Edge = new Edge(a... | marcos-sb/hacker-rank | algorithms/graph-theory/primsmstsub/Solution.scala | Scala | apache-2.0 | 1,301 |
package org.orbroker.util
import org.orbroker._
/**
* Extract single [[Long]] column.
*/
object LongExtractor extends RowExtractor[Long] {
def extract(row: Row) = row("1").as[Long]
}
| nilskp/orbroker | src/main/scala/org/orbroker/util/LongExtractor.scala | Scala | mit | 198 |
package demy.mllib.text
import demy.mllib.linalg.SemanticVector
case class Doc(text:String, docId:Int
);case class Word(word:String, simplified:String, isWord:Boolean, index:Int, phraseId:Int, docId:Int, root:String=null, tags:Array[Short]=null
, wordType:String=null, semantic:SemanticVector=null,... | forchard-epi/demy | mllib/src/main/scala/text/Word.scala | Scala | bsd-3-clause | 8,714 |
package test_data.v22
import scala.xml.Elem
case class XMLDataFields(xml: Elem) extends utils.TestUtils {
val rootPath = xml \\\\ "DWPCATransaction" \\\\ "DWPCAClaim"
val transactionPath = xml \\\\ "DWPCATransaction" \\\\ "TransactionId"
val serviceVersion = xml \\\\ "Version"
val titleQuestion = rootPath... | Department-for-Work-and-Pensions/RenderingService | test/test_data/v22/XMLDataFields.scala | Scala | mit | 5,533 |
package nimrod
import java.io._
import java.util.ArrayList
import java.util.zip.{GZIPInputStream,GZIPOutputStream}
import org.apache.commons.compress.compressors.bzip2.{BZip2CompressorInputStream,BZip2CompressorOutputStream}
import collection.JavaConversions._
/**
* The Opts class represents the arguments to be pass... | jmccrae/nimrod | src/main/scala/nimrod/Opts.scala | Scala | apache-2.0 | 23,634 |
package controllers
import java.sql.DriverAction
import javassist.tools.web.BadHttpRequest
import javax.inject._
import models.{DatabaseAO, SessionUtils}
import play.api.data._
import play.api.data.validation.Constraints._
import play.api.data.Forms._
import play.api.mvc.{Action, Controller}
import play.api.libs.conc... | jimmy00784/eventorganizer | app/controllers/Contact.scala | Scala | lgpl-2.1 | 10,282 |
/* ___ _ ___ _ _ *\\
** / __| |/ (_) | | The SKilL Generator **
** \\__ \\ ' <| | | |__ (c) 2013 University of Stuttgart **
** |___/_|\\_\\_|_|____| see LICENSE ... | XyzNobody/skill | src/main/scala/de/ust/skill/generator/scala/internal/RestrictionsMaker.scala | Scala | bsd-3-clause | 1,681 |
package core.util
/**
* This class calculates some standard statistics that can be used in other continuous-value algorithms.
* It makes use of dynamic programming to be more efficient.
* @param values the matrix of values representing a list of continuous-valued rows.
*/
// Arrays are more efficient that othe... | fernandoj92/ScalaML | src/main/scala/core/util/Statistics.scala | Scala | gpl-3.0 | 1,307 |
package models.gitolite
import scalikejdbc._
case class Tags(
id: Int,
name: Option[String] = None) {
def save()(implicit session: DBSession = Tags.autoSession): Tags = Tags.save(this)(session)
def destroy()(implicit session: DBSession = Tags.autoSession): Unit = Tags.destroy(this)(session)
}
object Tags... | thomaschoo/gitolite-to-gitbucket | src/main/scala/models/gitolite/Tags.scala | Scala | mit | 2,604 |
package com.github.btmorr.harmonia.models
// see http://stanfordnlp.github.io/CoreNLP/simple.html
import edu.stanford.nlp.simple._
import collection.JavaConversions._
case object SentenceSegmenter extends Model[String, List[Sentence]] {
def apply(in: String) = new Document(in).sentences().toList
}
| btmorr/ideal-spork | mastermind/src/main/scala/com/github/btmorr/harmonia/models/SentenceSegmenter.scala | Scala | gpl-3.0 | 303 |
package org.example1_1.declaration.data
class Y | JetBrains/intellij-scala | scala/scala-impl/testdata/move/allInOne_1_MoveXYZ/after/org/example1_1/declaration/data/Y.scala | Scala | apache-2.0 | 48 |
/*
* Copyright 2014 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 agreed to... | Treode/store | disk/test/com/treode/disk/PageSpec.scala | Scala | apache-2.0 | 5,931 |
package example
import scala.jdk.CollectionConverters._
object ScalaStuff {
val listOfPersons = List(PersonCaseClass("a", "b", "c"), PersonCaseClass("d", "e", "f"))
val listOfStrings: List[String] = List("Canada", "United States")
val javaListOfStrings: java.util.List[String] = List("Canada", "United States").a... | sullis/java-scala-interop-examples | src/test/scala/example/ScalaStuff.scala | Scala | apache-2.0 | 585 |
/*
* Copyright 2014 IBM Corp.
*
* 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... | bpburns/spark-kernel | protocol/src/test/scala/com/ibm/spark/kernel/protocol/v5/content/ExecuteReplyErrorSpec.scala | Scala | apache-2.0 | 2,466 |
/**
* Copyright 2014 Dropbox, 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... | iRobotCorporation/djinni | src/source/parser.scala | Scala | apache-2.0 | 12,044 |
import sbt._
import sbt.Keys._
import sbtassembly.Plugin._
import AssemblyKeys._
/**
* Build settings for MLlib. To build against a specific Spark version (e.g., 1.1.0), use
* {{{
* sbt -Dspark.version=1.1.0 clean ...
* }}}
*/
object MLlibTestsBuild extends Build {
val sparkVersion = settingKey[String]("Spark ... | arijitt/spark-perf | mllib-tests/project/MLlibTestsBuild.scala | Scala | apache-2.0 | 2,470 |
/*
* Copyright 2001-2014 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... | matterche/scalatest | scalactic-test/src/test/scala/org/scalactic/algebra/CommutativeSpec.scala | Scala | apache-2.0 | 2,485 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/functionResources.scala | Scala | apache-2.0 | 2,373 |
package org.pantsbuild.tools.junit.lib
import org.scalatest.FreeSpec
class MockScalaTest2 extends FreeSpec {
"test" - {
"should pass" in {
TestRegistry.registerTestCall("MockScalaTest-3")
}
}
}
| tdyas/pants | tests/scala/org/pantsbuild/tools/junit/lib/MockScalaTest2.scala | Scala | apache-2.0 | 214 |
package x7c1.linen.modern.init.inspector
import x7c1.linen.database.struct.HasSourceId
object SubscribeClickedEvent {
implicit object source extends HasSourceId[SubscribeClickedEvent] {
override def toId = _.sourceId
}
}
case class SubscribeClickedEvent(
sourceId: Long
)
| x7c1/Linen | linen-modern/src/main/scala/x7c1/linen/modern/init/inspector/SubscribeClickedEvent.scala | Scala | mit | 287 |
/**
* Copyright (C) 2014 Kaj Magnus Lindberg (born 1979)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
... | debiki/debiki-server-old | modules/debiki-tck-dao/src/main/scala/com/debiki/tck/dao/specs/UserPageSettingsSpec.scala | Scala | agpl-3.0 | 3,961 |
/**
* 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... | themarkypantz/kafka | core/src/test/scala/integration/kafka/api/TransactionsTest.scala | Scala | apache-2.0 | 25,671 |
/*
Scala allows programmers to define custom case constructors and deconstructors using the apply
and unapply methods.
Deconstructors are invoked to take a value apart during pattern matching with 'match' and 'case'/
If the method apply has type X -> Y, then the method unapply should hava the type Y -> Option[X].
T... | winse/learning-scala-in-small-bites | src/main/scala/DemoAlgebra.scala | Scala | apache-2.0 | 2,183 |
package yugioh.action
import yugioh.Location
import yugioh.action.card.CardMovedAction
import yugioh.card.Card.AnyCard
import yugioh.card.SpellOrTrap
import yugioh.card.monster.Monster
import yugioh.events.{ActionEvent, EventsModule, Subscription}
trait Target[Card <: AnyCard] {
val card: Card
val location: Locat... | micseydel/yugioh | src/main/scala/yugioh/action/Target.scala | Scala | mit | 991 |
package formats.json
import java.sql.Timestamp
import models.audit.AuditTaskTable.AuditTaskWithALabel
import models.audit.{AuditTask, AuditTaskInteraction}
import play.api.libs.json._
import play.api.libs.functional.syntax._
object TaskFormats {
// case class AuditTask(auditTaskId: Int, amtAssignmentId: Option[I... | ProjectSidewalk/SidewalkWebpage | app/formats/json/TaskFormats.scala | Scala | mit | 2,640 |
package org.apache.hadoop.mapred
import org.apache.hadoop.fs.FileSystem
import org.apache.hadoop.fs.Path
import org.apache.hadoop.util.ReflectionUtils
import org.apache.hadoop.io.NullWritable
import org.apache.hadoop.io.Text
import java.text.SimpleDateFormat
import java.text.NumberFormat
import java.io.IOException
im... | javelinjs/spark | core/src/main/scala/spark/HadoopWriter.scala | Scala | bsd-3-clause | 5,371 |
package bulu.actor.build
import akka.routing.RoundRobinRouter
import akka.actor.Actor
import akka.actor.ActorRef
import akka.actor.ActorLogging
import akka.actor.Props
import bulu.util._
import org.apache.hadoop.hbase.KeyValue
import org.apache.hadoop.hbase.util.Bytes
import bulu.core.BitKey
class CubeD... | hwzhao/bulu | src/main/scala/bulu/actor/build/CubeDispatcher.scala | Scala | apache-2.0 | 1,912 |
package com.xhachi.gae4s.datastore
import com.google.appengine.api.datastore.Transaction
import scala.language.implicitConversions
import scala.reflect.ClassTag
trait EntityStoreContext {
def ancestor: Option[Key[_]]
}
case class SimpleEntityStoreContext[T](key: Key[T]) extends EntityStoreContext {
def ancestor... | thachi/gae4s | store-extension/src/main/scala/com/xhachi/gae4s/datastore/EntityStore.scala | Scala | apache-2.0 | 16,179 |
package io
import model._
import scala.util.Try
/**
* Created by ghseeli on 1/15/17.
*/
class GamePlay[A >: NDimlCoordinate <: Coordinate](gameEngine: GameEngine[A], output: GameOutput = ASCIIOutputEngine) {
def playGame(players: Seq[Player], inBoard: Board[A]): Option[(Option[Player],Seq[A])] = {
var curr... | ghseeli/four-dim-tic-tac-toe | src/main/scala/io/GamePlay.scala | Scala | gpl-3.0 | 2,358 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package expr
import psi.ScalaPsiElementImpl
import com.intellij.lang.ASTNode
import api.expr._
import java.lang.String
import api.statements.params.ScTypeParam
import types._
import api.statements.ScFunction
import collection.mutable.ArrayBuffer... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScInfixExprImpl.scala | Scala | apache-2.0 | 3,463 |
import sbt._
object Common {
import Keys._
private[this] val unusedWarnings = (
"-Ywarn-unused" ::
"-Ywarn-unused-import" ::
Nil
)
val settings: Seq[Setting[_]] = Defaults.coreDefaultSettings ++ Seq(
organization := "ws.unfiltered",
crossScalaVersions := Seq("2.12.1", "2.11.8", "2.10.6")... | jarin/unfiltered | project/common.scala | Scala | mit | 3,031 |
package cz.kamenitxan.jakon.validation.validators
import java.lang.annotation.Annotation
import java.lang.reflect.Field
import cz.kamenitxan.jakon.validation.{ValidationResult, Validator}
class AssertFalseValidator extends Validator {
private val error = "NOT_FALSE"
override def isValid(value: String, a: Annotati... | kamenitxan/Jakon | modules/backend/src/main/scala/cz/kamenitxan/jakon/validation/validators/AssertFalseValidator.scala | Scala | bsd-3-clause | 571 |
/*
* 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 ... | aokolnychyi/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala | Scala | apache-2.0 | 4,462 |
/*
* Copyright 2009-2016 DigitalGlobe, 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 ag... | akarmas/mrgeo | mrgeo-mapalgebra/mrgeo-mapalgebra-rastermath/src/main/scala/org/mrgeo/mapalgebra/unarymath/UnaryMinusMapOp.scala | Scala | apache-2.0 | 1,487 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala | Scala | apache-2.0 | 79,403 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package kafka.test
import java.util.concurrent.atomic.AtomicInteger
import kafka.manager.Kafka_0_8_2_0
import kafka.manager.utils.AdminUtils
import org.apache.curator.framework.imps.CuratorFrameworkSt... | vvutharkar/kafka-manager | test/kafka/test/SeededBroker.scala | Scala | apache-2.0 | 2,216 |
package chapter4
import chapter4.Option._
import org.scalatest._
class OptionTest extends FlatSpec with Matchers with OptionValues with Inside with Inspectors {
"4.0 map with Some(4) add 4 " should "Some(8)" in {
assert(Some(4).map(_ + 4) == Some(8))
}
"4.3 map2 None, None " should "be None" in {
a... | mattjtodd/fp-in-scala | src/test/scala/chapter4/OptionTest.scala | Scala | apache-2.0 | 2,278 |
package net.lshift.diffa.agent.itest.support
import net.lshift.diffa.kernel.differencing.PairScanState
import org.junit.Assert._
import net.lshift.diffa.agent.client.ScanningRestClient
object ScanningHelper {
def waitForScanStatus(scanClient:ScanningRestClient, pairKey:String, state:PairScanState, n:Int = 50, wait... | lshift/diffa | agent/src/test/scala/net/lshift/diffa/agent/itest/support/ScanningHelper.scala | Scala | apache-2.0 | 910 |
/*
* Copyright 2020 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/reactive-circuit-breaker | src/main/scala/uk/gov/hmrc/circuitbreaker/UsingCircuitBreaker.scala | Scala | apache-2.0 | 3,101 |
package org.oneugene.log.replay
import monocle.Lens
import org.oneugene.log.PropertyChange
trait PropertyChangeReplay[A] {
/**
* Replays a change on the object instance
*
* @param value object value to replay changes for
* @param change change description to replay
* @tparam B type of property ... | oneugene/evgeniy-portfolio | changelog/src/main/scala/org/oneugene/log/replay/PropertyChangeReplay.scala | Scala | mit | 1,868 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | prateekm/samza | samza-core/src/main/scala/org/apache/samza/system/StreamMetadataCache.scala | Scala | apache-2.0 | 4,942 |
/*
* Copyright (c) 2017 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org... | haensel-ams/snowplow | 5-data-modeling/event-manifest-populator/project/Dependencies.scala | Scala | apache-2.0 | 2,370 |
package wookie.akkahttp
import java.io.ByteArrayInputStream
import java.net.URLEncoder
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.client.RequestBuilding._
import akka.http.scaladsl.model.MediaType.NotCompressible
import akka.http.scaladsl.model._
import akka.http.scaladsl.m... | pepegar/wookie | client/wookie-akka-http/src/main/scala/wookie/akkahttp/client.scala | Scala | mit | 6,169 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | lrytz/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/compiler/CharTest.scala | Scala | bsd-3-clause | 1,441 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2016 Matthias Langer (t3l@threelights.de)
*
* 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 | cublaze/src/main/scala/edu/latrobe/cublaze/modules/PoolingLayer_CUDA_CUDNN.scala | Scala | apache-2.0 | 3,918 |
object Test {
Some(Some(1)) collect {
case Some(a) => 2
case Some(b) => 3 // no warning was emitted
}
(Some(1): @ unchecked) match {
case Some(a) => 2
case Some(b) => 3 // no warning was emitted
}
// A variation of SI-6011, which eluded the fix
// in 2.10.0.
//
// duplicate keys in SWI... | felixmulder/scala | test/files/neg/t6902.scala | Scala | bsd-3-clause | 684 |
object Foo {
def f(z: => (Int, String)) = {
val (x, y) = z
}
}
object Test { def main(args: Array[String]): Unit = { Foo.f { (1, "a") } } }
| som-snytt/dotty | tests/run/i4558.scala | Scala | apache-2.0 | 149 |
/**
* Copyright 2011 Pablo Mendes, Max Jakob
*
* 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... | Skunnyk/dbpedia-spotlight-model | core/src/main/scala/org/dbpedia/spotlight/io/FileOccurrenceSource.scala | Scala | apache-2.0 | 6,149 |
package com.blinkbox.books.messaging
import javax.xml.transform.stream.StreamSource
import org.joda.time.DateTimeConstants
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import Xml.NodeSeqWrapper
import org.xml.sax.SAXParseException
@RunWith(classOf[JUnitRunner]... | blinkboxbooks/common-messaging.scala | src/test/scala/com/blinkbox/books/messaging/XmlTest.scala | Scala | mit | 4,392 |
/*
* 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 ... | jkbradley/spark | sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala | Scala | apache-2.0 | 122,284 |
package models
case class SearchResults(total: Int, page: Int, items: List[Repo])
object SearchResults {
import org.json4s.{DefaultFormats}
import play.api.libs.json.{Reads, Writes, JsPath, Json, __}
import play.api.libs.functional.syntax._
import models.Repo.{modelRepoReads, modelRepoWrites}
implicit val... | stankoua/giran | app/models/SearchResults.scala | Scala | mit | 729 |
/*
* 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 ... | gridgain/apache-ignite | examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarScheduleExample.scala | Scala | apache-2.0 | 2,209 |
import quoted.*
def foo()(using Quotes) = {
class C
Type[C] // error
}
| dotty-staging/dotty | tests/neg-macros/i7013.scala | Scala | apache-2.0 | 76 |
/*
* Copyright 2015 - 2016 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - 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... | ianclegg/eventuate | eventuate-log-leveldb/src/main/scala/com/rbmhtechnology/eventuate/log/leveldb/LeveldbDeletionMetadataStore.scala | Scala | apache-2.0 | 2,451 |
/*
* 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/ELU.scala | Scala | apache-2.0 | 3,330 |
/*
* 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/computations/AP2Spec.scala | Scala | apache-2.0 | 2,588 |
/*
Copyright 2014 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... | avibryant/algebird | algebird-test/src/test/scala/com/twitter/algebird/ApplicativeProperties.scala | Scala | apache-2.0 | 2,431 |
import ml.classifiers._
import util.Datasets
import scala.util.Random
/*
elm-scala: an implementation of ELM in Scala using MTJ
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
th... | Crespo911/elm-scala | src/main/scala/incELMExample.scala | Scala | gpl-3.0 | 2,187 |
/*
* Copyright 2016 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 applicable l... | trask/glowroot | agent/plugins/play-plugin/src/test/app-2.3.x-scala/scala/controllers/AsyncController.scala | Scala | apache-2.0 | 1,400 |
/*
* Copyright 2001-2015 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... | SRGOM/scalatest | scalactic/src/main/scala/org/scalactic/equalities/RecursiveTryEquality.scala | Scala | apache-2.0 | 1,383 |
package scalajsreact.template.pages
import scalacss.Defaults._
import scalacss.ScalaCssReact._
import scalajsreact.template.components.LeftNav
import scalajsreact.template.routes.Item
import japgolly.scalajs.react._
import japgolly.scalajs.react.extra.router.RouterCtl
import japgolly.scalajs.react.vdom.html_<^._
obj... | chandu0101/scalajs-react-template | src/main/scala/scalajsreact/template/pages/ItemsPage.scala | Scala | apache-2.0 | 1,019 |
package skuber
/**
* @author David O'Riordan
*/
case class EnvVar(
name: String,
value: EnvVar.Value = "")
object EnvVar {
sealed trait Value
case class StringValue(s:String) extends Value
sealed trait Source extends Value
case class FieldRef(fieldPath: String, apiVersion: String = "") extends Sourc... | minatjanster/skuber | client/src/main/scala/skuber/EnvVar.scala | Scala | apache-2.0 | 588 |
/**
* (c) Copyright 2013 WibiData, Inc.
*
* See the NOTICE 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 may obtain a copy of... | kijiproject/kiji-express | kiji-express/src/main/scala/org/kiji/express/flow/TimeRangeSpec.scala | Scala | apache-2.0 | 5,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 You under the Apache License, Version 2.0
* (the "License"); you may ... | zouzias/spark-lucenerdd-examples | data/rawData/linkage/runProductBenchmark.scala | Scala | apache-2.0 | 3,396 |
package com.nabijaczleweli.minecrasmer.block
import java.util.Random
import com.google.common.base.Predicate
import com.nabijaczleweli.minecrasmer.reference.{Container, Reference}
import net.minecraft.block.Block
import net.minecraft.block.properties.PropertyDirection
import net.minecraft.block.state.{BlockState, IBl... | nabijaczleweli/ASMifier | src/main/scala/com/nabijaczleweli/minecrasmer/block/ComputerGeneric.scala | Scala | mit | 3,425 |
package net.wrap_trap.goju
import java.io.File
import java.util.concurrent.TimeUnit
import net.wrap_trap.goju.Constants.Value
import org.scalatest._
import org.slf4j.LoggerFactory
import scala.concurrent.Await
import scala.concurrent.duration.Duration
/**
* goju: HanoiDB(LSM-trees (Log-Structured Merge Trees) Inde... | masayuki038/goju | src/test/scala/net/wrap_trap/goju/FoldSpec.scala | Scala | mit | 6,950 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | jahhulbert-ccri/geomesa | geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/conf/splitter/DefaultSplitter.scala | Scala | apache-2.0 | 9,742 |
package name.denyago.yasc
import akka.actor.{Actor, ActorLogging, ActorRef, PoisonPill, Props}
import akka.stream.ActorMaterializer
import name.denyago.yasc.chat.ChatRoom
import name.denyago.yasc.config.{Factory => ConfigFactory}
import name.denyago.yasc.http.Service
import name.denyago.yasc.http.messages.{ChatRoomSta... | denyago/yet-another-simple-chat | src/main/scala/name/denyago/yasc/Server.scala | Scala | mit | 2,032 |
package de.fuberlin.wiwiss.silk.execution.methods
import de.fuberlin.wiwiss.silk.entity.{Index, Entity}
import de.fuberlin.wiwiss.silk.linkagerule.LinkageRule
import de.fuberlin.wiwiss.silk.execution.ExecutionMethod
/**
* Full execution method.
*/
case class Full() extends ExecutionMethod {
override def indexE... | fusepoolP3/p3-silk | silk-core/src/main/scala/de/fuberlin/wiwiss/silk/execution/methods/Full.scala | Scala | apache-2.0 | 387 |
package au.gov.dva.sopapi.sopref.parsing.traits
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import au.gov.dva.sopapi.dtos.StandardOfProof
import au.gov.dva.sopapi.exceptions.SopParserRuntimeException
import au.gov.dva.sopapi.interfaces.model.{DefinedTerm, InstrumentNumber}
import au.gov.dva.s... | govlawtech/dva-sop-api | app/src/main/scala/au/gov/dva/sopapi/sopref/parsing/traits/PreAugust2015SoPParser.scala | Scala | apache-2.0 | 4,663 |
/* This code is based on the SOM class library.
*
* Copyright (c) 2001-2016 see AUTHORS.md file
*
* 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 ... | cedricviaccoz/scala-native | benchmarks/src/main/scala/list/ListBenchmark.scala | Scala | bsd-3-clause | 2,241 |
package skinny.engine
/**
* Represents an exception happened inside skinny-engine.
*/
class SkinnyEngineException(message: String)
extends Exception(message)
| holycattle/skinny-framework | engine/src/main/scala/skinny/engine/SkinnyEngineException.scala | Scala | mit | 163 |
object Foo {
class A
class B
class C
class X
class Y
class Z
}
object Test {
import Foo.{ A, B, C, D, E, X, Y, Z }
val a = new A
val b = new B
val c = new C
val d = new D
val w = new W
val x = new X
val y = new Y
val z = new Z
}
| AlexSikia/dotty | tests/untried/neg/t6340.scala | Scala | bsd-3-clause | 261 |
// scalac: -Xfatal-warnings
//
import java.lang.Thread.State
import java.lang.Thread.State._
object Test {
def f(state: State) = state match {
case NEW | WAITING => true
case RUNNABLE => false
// and I forget the rest
}
}
| scala/scala | test/files/neg/sealed-java-enums.scala | Scala | apache-2.0 | 246 |
package io.vamp.persistence
import akka.actor.Actor
import akka.util.Timeout
import io.vamp.common.akka._
import io.vamp.common.http.HttpClient
import io.vamp.common.notification.{ ErrorNotification, Notification }
import io.vamp.common.vitals.InfoRequest
import io.vamp.common.{ CacheStore, Config, ConfigMagnet }
impo... | magneticio/vamp | persistence/src/main/scala/io/vamp/persistence/KeyValueStoreActor.scala | Scala | apache-2.0 | 3,389 |
package org.zalando.jsonapi.json
import org.scalatest.{ MustMatchers, WordSpec }
import org.zalando.jsonapi.json.sprayjson.SprayJsonJsonapiProtocol
import org.zalando.jsonapi.model.JsonApiObject.StringValue
import org.zalando.jsonapi.model.RootObject.ResourceObject
import org.zalando.jsonapi.model.{ Attribute, Links, ... | wlk/scala-jsonapi | src/test/scala/org/zalando/jsonapi/json/ExampleSpec.scala | Scala | mit | 3,509 |
import stainless.math.BitVectors._
object BitVectors2 {
def test1(n1: Int3, n2: Int3, n3: Int3) = {
require(n2 >= 0 && n2 <= n3 && n1 <= n3 - n2 && n1 + n2 == n3)
assert(n3 - n1 == n2)
}
def test2(n: Int10) = {
assert((n ^ n) == 0)
}
def test3(n: Int100) = {
assert((n & n) == n)
asser... | epfl-lara/stainless | frontends/benchmarks/verification/valid/MicroTests/scalac/BitVectors2.scala | Scala | apache-2.0 | 1,209 |
/*******************************************************************************
Copyright (c) 2012-2013, S-Core, KAIST.
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/analysis/cfg/CapturedVariableCollector.scala | Scala | bsd-3-clause | 7,462 |
package peregin.gpv.util
import org.json4s.{jackson, DefaultFormats}
object JsonConverter {
implicit val formats = DefaultFormats //+ FieldSerializer[Setup](ignore("telemetry"))
def generate[T <: AnyRef](obj: T): String = {
val ast = jackson.Json(formats)
ast.writePretty(obj)
}
def parse[T](json: ... | peregin/gps-overlay-on-video | src/main/scala/peregin/gpv/util/JsonConverter.scala | Scala | mit | 444 |
package com.github.siskape.conf4s.parser
import org.parboiled2._
import scala.util.{Success, Failure}
object Pokus {
def main(in: Array[String]): Unit = {
val data1 =
"""p1 = "q1"
|r2 = "z2"
|
| c1 :"d4"
| c2 += "d5"
|
| # juu
| e1.ee2 = "sdf"
... | siskape/conf4s | core/src/main/scala/com/github/siskape/conf4s/parser/Test.scala | Scala | apache-2.0 | 1,073 |
package caustic.library.math
import caustic.library.typing._
import caustic.library.typing.Value._
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.{FunSuite, Matchers}
@RunWith(classOf[JUnitRunner])
class PackageTest extends FunSuite with Matchers {
test("Expressions ar... | ashwin153/caustic | caustic-library/src/test/scala/caustic/library/math/PackageTest.scala | Scala | apache-2.0 | 866 |
/*
* Copyright 2015 - 2016 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - 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... | ianclegg/eventuate | eventuate-core/src/main/scala/com/rbmhtechnology/eventuate/VersionedAggregate.scala | Scala | apache-2.0 | 6,460 |
package lore.compiler.transformation
import lore.compiler.feedback.Reporter
import lore.compiler.semantics.Registry
import lore.compiler.semantics.expressions.Expression._
import lore.compiler.semantics.expressions.{Expression, ExpressionIdentityVisitor, ExpressionVisitor}
import lore.compiler.semantics.members.Member... | marcopennekamp/lore | compiler/src/lore/compiler/transformation/TypeRehydrationVisitor.scala | Scala | mit | 4,795 |
package io.github.finagle.smtp
/* Differentiating by success */
trait PositiveCompletionReply extends Reply
trait PositiveIntermediateReply extends Reply
trait TransientNegativeCompletionReply extends SmtpError
trait PermanentNegativeCompletionReply extends SmtpError
/* Differentiating by context */
trait SyntaxRep... | finagle/finagle-smtp | src/main/scala/io/github/finagle/smtp/ReplyGroups.scala | Scala | apache-2.0 | 1,116 |
package reshapes
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.OutputStreamWriter
import java.net.ConnectException
import java.net.InetAddress
import java.net.ServerSocket
import java.net.Socket
import scala.xml.Elem
import scala.xml.NodeSeq.seqToNodeSeq
import scala.xml.XML
object Re... | volkc/REScala | Examples/Shapes/src/main/scala/reshapes/ReShapesServer.scala | Scala | apache-2.0 | 3,819 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | Wogan/monix | monix-reactive/shared/src/main/scala/monix/reactive/internal/operators/IsEmptyOperator.scala | Scala | apache-2.0 | 1,524 |
package com.cloudray.scalapress.account
import com.cloudray.scalapress.framework.ScalapressContext
/** @author Stephen Samuel */
class EditProfileAccountLink extends AccountLink {
override def accountLinkPriority: Int = -1000
def accountLinkEnabled(context: ScalapressContext): Boolean = true
def profilePageLink... | vidyacraghav/scalapress | src/main/scala/com/cloudray/scalapress/account/EditProfileAccountLink.scala | Scala | apache-2.0 | 536 |
package de.vorb.namcap.game.world
import de.vorb.namcap.game.world.TileType.Type
import scala.collection.mutable.ListBuffer
class Tile(val typeOf: Type) {
def *(times: Int) = {
val lbuf = new ListBuffer[Tile]
for (i <- 1 to times)
lbuf += new Tile(typeOf)
lbuf.toList
}
}
| pvorb/NamCap | src/main/scala/de/vorb/namcap/game/world/Tile.scala | Scala | mit | 297 |
package com.speedledger.measure.graphite
import spray.client.pipelining._
import spray.http.{HttpRequest, GenericHttpCredentials}
import org.parboiled.common.{Base64 => ParboiledBase64}
import com.typesafe.config.Config
import java.io.{PrintWriter, File}
import scala.io.Source
object Utils {
implicit class Base64S... | speedledger/graphite-importer | src/main/scala/com/speedledger/measure/graphite/Utils.scala | Scala | mit | 1,656 |
package com.gigaspaces.sbp
import org.springframework.transaction.annotation.{Isolation, Propagation, Transactional}
import com.gigaspaces.query.IdQuery
import org.openspaces.remoting.RemotingService
import com.gigaspaces.client.ChangeSet
import javax.annotation.Resource
import org.openspaces.core.GigaSpace
import sca... | jasonnerothin/gs-gigaspace-api | src/main/scala/com/gigaspaces/sbp/TxnMakerServerSideService.scala | Scala | apache-2.0 | 1,472 |
/*
* Copyright 2014 http4s.org
*
* 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... | http4s/http4s | server/shared/src/main/scala/org/http4s/server/staticcontent/NoopCacheStrategy.scala | Scala | apache-2.0 | 1,026 |
package org.http4s
package headers
class LinkSpec extends HeaderLaws {
// FIXME Uri does not round trip properly: https://github.com/http4s/http4s/issues/1651
// checkAll(name = "Link", headerLaws(Link))
val link = """</feed>; rel="alternate"; type="text/*"; title="main"; rev="previous""""
"parse" should {
... | aeons/http4s | tests/src/test/scala/org/http4s/headers/LinkSpec.scala | Scala | apache-2.0 | 1,034 |
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.