code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package edu.depauw.escalator
import swing._
import Dialog._
import java.io._
import javax.swing._
import javax.swing.text._
import javax.swing.text.html.HTMLEditorKit
import javax.swing.undo._
import javax.swing.event.{DocumentListener, DocumentEvent, UndoableEditListener, UndoableEditEvent, HyperlinkListener, Hyperl... | bhoward/EscalatorOld | Escalator/src/edu/depauw/escalator/Editor.scala | Scala | apache-2.0 | 7,020 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package elements
import com.intellij.psi.PsiElement
import com.intellij.psi.stubs.{IndexSink, StubElement, StubInputStream, StubOutputStream}
import com.intellij.util.io.StringRef
import org.jetbrains.plugins.scala.lang.psi.api.statements.{ScTy... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/elements/ScTypeAliasElementType.scala | Scala | apache-2.0 | 3,082 |
package com.arcusys.valamis.updaters.version320
import com.arcusys.valamis.persistence.common.DatabaseLayer
import com.arcusys.valamis.updaters.common.BaseDBUpdater
import com.arcusys.valamis.updaters.schema.v3201.LessonTableComponent
class DBUpdater3201 extends BaseDBUpdater
with LessonTableComponent
with Datab... | arcusys/Valamis | valamis-updaters/src/main/scala/com/arcusys/valamis/updaters/version320/DBUpdater3201.scala | Scala | gpl-3.0 | 486 |
package org.singlespaced.d3js
import org.scalajs.dom
import org.singlespaced.d3js.Ops._
import utest._
import scala.scalajs.js
object SvgAreaTest extends TestSuite {
val elem=dom.document.createElement("svg")
dom.document.body.appendChild(elem)
val tests = TestSuite {
'd3_area_xy {
//arrange
... | spaced/scala-js-d3 | src/test/scala/org/singlespaced/d3js/SvgAreaTest.scala | Scala | bsd-3-clause | 1,008 |
/*
* This file is part of Sloth, an SMT solver for strings.
* Copyright (C) 2017 Philipp Ruemmer, Petr Janku
*
* 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 th... | uuverifiers/sloth | src/main/scala/SMTLIBStringTheory.scala | Scala | gpl-3.0 | 4,711 |
/*
* Copyright (C) 2016 University of Basel, Graphics and Vision Research Group
*
* 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) an... | unibas-gravis/scalismo-ui | src/main/scala/scalismo/ui/control/SlicingPosition.scala | Scala | gpl-3.0 | 4,893 |
/*
* 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... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/ShouldExistLogicalOrImplicitSpec.scala | Scala | apache-2.0 | 12,178 |
package com.ldaniels528.broadway.core.resources
/**
* Represents a iterable resource
* @author Lawrence Daniels <[email protected]>
*/
trait IterableResource[T] extends Resource {
def iterator: Iterator[T]
}
| ldaniels528/shocktrade-broadway-server | src/main/scala/com/ldaniels528/broadway/core/resources/IterableResource.scala | Scala | apache-2.0 | 225 |
package models
import conversions._
import org.squeryl.PrimitiveTypeMode._
import org.squeryl.dsl.ast.{BinaryOperatorNodeLogicalBoolean, LogicalBoolean}
import collins.solr._
import IpmiInfo.Enum._
import util.views.Formatter
import java.util.Date
case class AssetFinder(
tag: Option[String],
status: Option[Sta... | Shopify/collins | app/models/AssetFinder.scala | Scala | apache-2.0 | 3,300 |
/*============================================================================
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 2010, ... | stanford-ppl/spatial-lang | spatial/core/resources/chiselgen/template-level/templates/hardfloat/tests.scala | Scala | mit | 10,167 |
/*
* Copyright 2017 Exon IT
*
* 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 w... | exon-it/redmine-scala-client | client-play26-ws/src/main/scala/by/exonit/redmine/client/play26ws/Play26WSWebClient.scala | Scala | apache-2.0 | 5,458 |
package org.jetbrains.plugins.scala.editor.folding
import com.intellij.openapi.util.TextRange
import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter
import org.jetbrains.plugins.scala.lang.folding.ScalaFoldingBuilder
import org.jetbrains.plugins.scala.util.MultilineStringUtil
import scala.col... | whorbowicz/intellij-scala | test/org/jetbrains/plugins/scala/editor/folding/ScalaEditorFoldingTest.scala | Scala | apache-2.0 | 6,537 |
package ${package}
import better.files.File
import org.apache.commons.configuration.PropertiesConfiguration
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import scala.collection.JavaConverters._
class DebugConfigSpec extends AnyFlatSpec with Matchers {
val configDir: File... | DANS-KNAW/easy-module-archetype | src/main/resources/archetype-resources/src/test/scala/DebugConfigSpec.scala | Scala | apache-2.0 | 1,110 |
package com.github.akiomik.leap_scala
import com.leapmotion.leap.Config
object StaticConfig extends StaticConfig
trait StaticConfig {
type ValueType = Config.ValueType
val ValueType = StaticValueType
}
| akiomik/leap-scala | src/main/scala/com/github/akiomik/leap_scala/StaticConfig.scala | Scala | mit | 211 |
package reactivemongo.api
import scala.language.higherKinds
import scala.util.Try
import reactivemongo.bson.buffer.{ ReadableBuffer, WritableBuffer }
trait SerializationPack { self: Singleton =>
type Value
type ElementProducer
type Document <: Value
type Writer[A]
type Reader[A]
type NarrowValueReader[A... | maxime-gautre/ReactiveMongo | driver/src/main/scala/api/serializationpack.scala | Scala | apache-2.0 | 3,047 |
package test.scala.systemTestingDSL
object HipTestCaseData {
val arr_sumOutput = """!!!Full processing file "hip/array/arr_sum.ss"
Parsing file "hip/array/arr_sum.ss" by default parser...
WARNING : parsing problem dom is neither a ranking function nor a relation nor a heap predicate
WARNING : parsing problem dom is... | rohitmukherjee/High-Performance-DSLs | src/test/scala/systemTestingDSL/HipTestCaseData.scala | Scala | mit | 2,534 |
package scalan.meta
import com.typesafe.scalalogging.slf4j.StrictLogging
class BoilerplateTool extends StrictLogging {
val scalanTypeSynonyms = Map(
"Conv" -> "Converter"
)
lazy val scalanConfig = CodegenConfig(
name = "scalan",
srcPath = "../core/src/main/scala",
entityFiles = List(
"scal... | PCMNN/scalan-ce | meta/src/main/scala/scalan/meta/BoilerplateTool.scala | Scala | apache-2.0 | 6,130 |
/*
* Copyright (c) 2015 Daniel Higuero.
*
* 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... | dhiguero/scala-exercises | src/main/scala/org/scala/examples/basics/visibility/Visibility.scala | Scala | apache-2.0 | 1,430 |
package com.twitter.finagle.http
import java.util.{Map => JMap, List => JList, Collections}
import scala.collection.JavaConverters._
object Uri {
/**
* Constructs a Uri from the Host header and path component of a Request.
*/
def fromRequest(req: Request): Uri = {
val uri = req.uri
uri.indexOf('?')... | luciferous/finagle | finagle-base-http/src/main/scala/com/twitter/finagle/http/Uri.scala | Scala | apache-2.0 | 1,421 |
package com.cloudray.scalapress.folder.controller.admin
import com.cloudray.scalapress.section.{Section, SectionDao}
/** @author Stephen Samuel */
trait SectionSorting {
val sectionDao: SectionDao
def reorderSections(order: String, sections: Iterable[Section]) {
val ids = order.split("-")
if (ids.size =... | vidyacraghav/scalapress | src/main/scala/com/cloudray/scalapress/folder/controller/admin/SectionSorting.scala | Scala | apache-2.0 | 503 |
package nl.bridgeworks.akka.rete
sealed trait Op
case object Equals extends Op
case object LessThan extends Op
case object GreaterThan extends Op
sealed trait Expr
case class Simple(concept: String) extends Expr
case class ValueOp(concept: String, op: Op, value: AnyVal) extends Expr
//TODO is this the right way to h... | bridgeworks-nl/scala-rete | src/main/scala/nl/bridgeworks/akka/rete/Fact.scala | Scala | mit | 1,037 |
package com.github.bluenote
import org.lwjgl.opengl.GL11
import org.lwjgl.opengl.GL20
import org.lwjgl.opengl.GL11
trait VertexData {
val rawData: Array[Float]
val primitiveType: Int
val floatsPerVertex: Int
val numVertices: Int
val strideInBytes: Int
def setVertexAttribArrayAndPointer(shader: ... | bluenote10/ScalaOculusRiftExample | src/main/scala/com/github/bluenote/VertexData.scala | Scala | apache-2.0 | 21,141 |
package com.trafficland.augmentsbt.generators
import sbt._
import scala.collection.Seq
import java.io.File
import sbt.Keys._
import ConfigurationDirectory.autoImport._
import sbt.plugins.JvmPlugin
object LogbackConfigurationPlugin extends AutoPlugin with FileGenerator {
import autoImport._
override lazy val re... | ereichert/augment-sbt | src/main/scala/com/trafficland/augmentsbt/generators/LogbackConfigurationPlugin.scala | Scala | apache-2.0 | 1,622 |
package peli
import siirrot._
import java.lang.StackOverflowError
import pelikomponentit.Auto
import scala.collection.mutable.Buffer
//Lähteet:
// min-funktion Ordering: http://www.scala-lang.org/old/node/7529
class AI(pelitilanne_ : Pelitilanne) {
var pelitilanne = pelitilanne_
def siirto(): Koordinaatti ... | MrAurela/Formula | Formula/src/peli/AI.scala | Scala | mit | 4,582 |
/*
* 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... | dotty-staging/scalatest | scalatest.js/src/main/scala/org/scalatest/JavaClassesWrappers.scala | Scala | apache-2.0 | 2,391 |
/*
* 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... | Webtrends/wookiee-spray | example-rest/src/main/scala/com/webtrends/service/sockorest/SDelete.scala | Scala | apache-2.0 | 2,629 |
/*
* Copyright (c) 2014 Contributor. All rights reserved.
*/
package org.scalaide.debug.internal.expression.proxies.primitives.operations.numeric
import org.junit.Test
import org.scalaide.debug.internal.expression.Names.Java
import org.scalaide.debug.internal.expression.BaseIntegrationTest
import org.scalaide.debug.... | Kwestor/scala-ide | org.scala-ide.sdt.debug.expression.tests/src/org/scalaide/debug/internal/expression/proxies/primitives/operations/numeric/AdditionTest.scala | Scala | bsd-3-clause | 3,961 |
package monocle.function
import monocle.MonocleSuite
import scala.annotation.nowarn
@nowarn
class InitExample extends MonocleSuite {
test("init creates a Lens from a 2-6 tuple to its tail") {
assertEquals(((2, false) applyLens init get), 2)
assertEquals((('r', false, "lala", 5.6, 7, 4) applyLens init get),... | julien-truffaut/Monocle | example/src/test/scala/monocle/function/InitExample.scala | Scala | mit | 457 |
class Context
class ContextBase { def settings = 1 }
class Test {
implicit def toBase(ctx: Context): ContextBase = ???
def test(ctx0: Context) = {
implicit val ctx = { ctx0.settings; ??? } // error
}
def f: Unit = { implicitly[Int]; implicit val i = implicitly[Int] } // error
}
| som-snytt/dotty | tests/neg/i4709.scala | Scala | apache-2.0 | 293 |
/**
*
* PairedDongleTest
* Ledger wallet
*
* Created by Pierre Pollastri on 06/02/15.
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Ledger
*
* 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... | Morveus/ledger-wallet-android | app/src/androidTest/scala/com/ledger/ledgerwallet/model/PairedDongleTest.scala | Scala | mit | 4,146 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.filters.csrf
import java.net.{ URLDecoder, URLEncoder }
import java.util.Locale
import javax.inject.Inject
import akka.stream._
import akka.stream.scaladsl.{ Flow, Keep, Sink, Source }
import akka.stream.stage._
import akka.util... | aradchykov/playframework | framework/src/play-filters-helpers/src/main/scala/play/filters/csrf/CSRFActions.scala | Scala | apache-2.0 | 22,445 |
package epam.idobrovolskiy.wikipedia.trending.time
import java.time.Month
import org.scalatest.FunSuite
/**
* Created by Igor_Dobrovolskiy on 02.08.2017.
*/
class WikiDateTest extends FunSuite {
test("Test WikiDate after Ser-De results in source value") {
val wd = WikiDate.AD(123, Month.AUGUST, 31)
as... | igor-dobrovolskiy-epam/wikipedia-analysis-scala-core | src/test/scala/epam/idobrovolskiy/wikipedia/trending/time/WikiDateTest.scala | Scala | apache-2.0 | 2,033 |
package models
import com.novus.salat._
import com.novus.salat.dao.{ SalatDAO, ModelCompanion }
import com.novus.salat.annotations._
import com.mongodb.casbah.Imports._
import mongoContext._
import se.radley.plugin.salat._
import se.radley.plugin.salat.Binders._
import play.api.Play.current
//分为三种status:open,finish... | kandole/simple_reservation | app/models/OrderControl.scala | Scala | gpl-2.0 | 698 |
package mimir.data
import mimir.algebra.ID
object FileFormat {
type T = ID
val CSV = ID("csv")
val JSON = ID("json")
val XML = ID("com.databricks.spark.xml")
val EXCEL = ID("com.crealytics.spark.excel")
val JDBC = ... | UBOdin/mimir | src/main/scala/mimir/data/FileFormat.scala | Scala | apache-2.0 | 705 |
/*
* 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 ... | szhem/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala | Scala | apache-2.0 | 22,391 |
package services.history
import java.util.UUID
import com.github.mauricio.async.db.Connection
import models.database.queries.history.RequestLogQueries
import models.history.RequestLog
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import services.database.Database
object RequestHistoryService {
... | agilemobiledev/boilerplay | app/services/history/RequestHistoryService.scala | Scala | apache-2.0 | 883 |
/**
* <pre>
* scala> (new AndOrSpec).execute()
* AndOrSpec:
* The ScalaTest Matchers DSL
* should provide
* an and operator that
* - returns silently when evaluating true and true
* - throws a TestFailedException when evaluating true and false
* - that throws a TestFailedException when evalua... | felixmulder/scala | test/scaladoc/resources/SI_4507.scala | Scala | bsd-3-clause | 701 |
/**
* Copyright (C) 2017 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | brunobuzzi/orbeon-forms | form-runner/jvm/src/main/scala/org/orbeon/oxf/fr/persistence/relational/rest/LockUnlock.scala | Scala | lgpl-2.1 | 5,066 |
package okapies.finagle.kafka.protocol
import _root_.kafka.common.ErrorMapping
case class KafkaError(code: Short /* int16 */) {
def throwException() = ErrorMapping.maybeThrowException(code)
override def toString = code match {
case ErrorMapping.UnknownCode => "Unknown"
case ErrorMapping.NoError => "NoEr... | yonglehou/finagle-kafka | src/main/scala/okapies/finagle/kafka/protocol/KafkaError.scala | Scala | apache-2.0 | 3,016 |
package io.finch.internal
import scala.concurrent.ExecutionContext
object DummyExecutionContext extends ExecutionContext {
def execute(runnable: Runnable): Unit = runnable.run()
def reportFailure(cause: Throwable): Unit = throw new NotImplementedError()
}
| finagle/finch | core/src/main/scala/io/finch/internal/DummyExecutionContext.scala | Scala | apache-2.0 | 262 |
/**
* Illustrates a simple aggregate in scala to compute the average of an RDD
*/
package com.oreilly.learningsparkexamples.scala
import org.apache.spark._
import org.apache.spark.rdd.RDD
object BasicAvg {
def main(args: Array[String]) {
val master = args.length match {
case x: Int if x > 0 => args(0)
... | huydx/learning-spark | src/main/scala/com/oreilly/learningsparkexamples/scala/BasicAvg.scala | Scala | mit | 724 |
package net.ruippeixotog.ebaysniper.util
import akka.http.scaladsl.model.HttpEntity
import akka.http.scaladsl.server.Directive0
import akka.http.scaladsl.server.Directives._
import org.slf4j.LoggerFactory
trait Logging {
lazy val log = LoggerFactory.getLogger(getClass.getName)
}
trait RoutingLogging extends Loggin... | ruippeixotog/ebay-snipe-server | src/main/scala/net/ruippeixotog/ebaysniper/util/Logging.scala | Scala | mit | 618 |
/*
This file is part of Intake24.
Copyright 2015, 2016 Newcastle University.
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 appl... | digitalinteraction/intake24 | DataExportService/app/uk/ac/ncl/openlab/intake24/services/dataexport/guice/AmazonWebServicesModule.scala | Scala | apache-2.0 | 1,074 |
package se.gigurra.leavu3.mfd
import com.badlogic.gdx.graphics.Color
import com.google.common.base.Splitter
import se.gigurra.leavu3.datamodel.{Configuration, CounterMeasures, DlinkData, EngineIndicators, GameData, Payload, Vec2, self}
import se.gigurra.leavu3.gfx.{Blink, CountDown}
import se.gigurra.leavu3.gfx.... | GiGurra/leavu3 | src/main/scala/se/gigurra/leavu3/mfd/SmsPage.scala | Scala | mit | 6,628 |
package org.broadinstitute.dsde.workbench.test.api
import java.util.UUID
import akka.actor.ActorSystem
import akka.http.scaladsl.model.HttpMethods.GET
import akka.http.scaladsl.model.{HttpRequest, StatusCodes}
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.testkit.TestKitBase
import org.broadinstitute.... | broadinstitute/sam | automation/src/test/scala/org/broadinstitute/dsde/test/api/SamApiSpec.scala | Scala | bsd-3-clause | 26,374 |
/*
* 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 ... | JihongMA/incubator-carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/emptyrow/TestEmptyRows.scala | Scala | apache-2.0 | 2,841 |
/*
* 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/threading/DispatchQueue.scala | Scala | gpl-3.0 | 4,855 |
import language.higherKinds
trait Functor[F[_]] {
def map[A,B](functor: F[A])(g: A => B): F[B]
}
object Functor {
def map[F[_]:Functor,A,B](a: F[A])(g: A => B): F[B] =
implicitly[Functor[F]].map(a)(g)
implicit object FunctorOption extends Functor[Option] {
override def map[A,B](option: Option[A])(g: A => ... | grzegorzbalcerek/scala-exercises | Travers/Functor.scala | Scala | bsd-2-clause | 902 |
package org.scalatra
import javax.servlet.http.HttpServletResponse
import test.scalatest.ScalatraFunSuite
class AfterTestServlet extends ScalatraServlet {
after() {
response.setStatus(204)
}
after("/some/path") {
response.setStatus(202)
}
after("/other/path") {
response.setStatus(206)
}
... | kuochaoyi/scalatra | core/src/test/scala/org/scalatra/AfterTest.scala | Scala | bsd-2-clause | 777 |
/*
* 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 ... | zohar-mizrahi/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/plan/RetractionRulesTest.scala | Scala | apache-2.0 | 9,070 |
package io.youi.paint
import io.youi.Updates
import io.youi.drawable.{Context, Drawable}
import io.youi.util.CanvasPool
import org.scalajs.dom.CanvasPattern
class DrawablePaint[D <: Drawable](drawable: D,
repetition: Repetition,
width: => Double,
... | outr/youi | gui/src/main/scala/io/youi/paint/DrawablePaint.scala | Scala | mit | 1,026 |
/*
* 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... | yyuu/scalatest | src/main/scala/org/scalatest/TestCanceledException.scala | Scala | apache-2.0 | 8,468 |
/*
* 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/HMRCFiling.scala | Scala | apache-2.0 | 795 |
object ImpureLazy2 {
def f(): Int = {
var counter = 0
lazy val x = {
counter = counter + 1
counter
}
counter + x + x
} ensuring (_ == 2)
}
| epfl-lara/stainless | frontends/benchmarks/extraction/invalid/ImpureLazy2.scala | Scala | apache-2.0 | 171 |
package controllers.school
import controllers.helpers.CRUDController
import models.school
class MicrodegreeRevisionProposal extends CRUDController[school.MicrodegreeRevisionProposals, school.MicrodegreeRevisionProposal] {
/**
* @inheritdoc
*/
def resourceCollection =
school.MicrodegreeRevisionProposa... | Xanho/xanho-api | app/controllers/school/MicrodegreeRevisionProposal.scala | Scala | apache-2.0 | 326 |
package org.vaadin.addons.rinne
import com.vaadin.ui.BrowserFrame
import org.vaadin.addons.rinne.mixins.{ComponentMixin, AbstractComponentMixin, AbstractEmbeddedMixin}
class VBrowserFrame extends BrowserFrame with AbstractEmbeddedMixin
| LukaszByczynski/rinne | src/main/scala/org/vaadin/addons/rinne/VBrowserFrame.scala | Scala | apache-2.0 | 238 |
package eu.semberal.parsercombinatorsexample
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.FunSuite
import eu.semberal.parsercombinatorsexample.IPParser
@RunWith(classOf[JUnitRunner])
class IPTest extends FunSuite {
test("Test if IP parsing using regexps and parser com... | semberal/blog-examples | parser-combinators-and-what-if-regular-expressions-are-not-enough/src/test/scala/eu/semberal/parsercombinatorsexample/IPTest.scala | Scala | apache-2.0 | 690 |
package chat.tox.antox.utils
import java.io._
import android.content.Context
import android.graphics.Bitmap
import chat.tox.antox.utils.StorageType._
object FileUtils {
val imageExtensions = List("jpg", "jpeg", "gif", "png")
/**
* Gets the directory designated by 'path' from the appropriate place based on ... | wiiam/Antox | app/src/main/scala/chat/tox/antox/utils/FileUtils.scala | Scala | gpl-3.0 | 1,905 |
object lib_gen {
import lib_stream.Stream
import lib_state._
import lib_par._
import lib_par.Par.Par
import Gen._
import Prop._
import java.util.concurrent.{Executors,ExecutorService}
import language.postfixOps
import language.implicitConversions
case class Prop(run: (MaxSize,TestCases,RNG) => Resu... | rucka/fpinscala | src/main/scala/fpinscala/lib/Gen.scala | Scala | gpl-2.0 | 9,892 |
package controllers.helpers
import java.util.UUID
import _root_.play.api.http.ContentTypes
import _root_.play.api.libs.json.{JsValue, Json}
import _root_.play.api.mvc.{Action, Controller}
import models.Helpers.Columns
import slick.driver.MySQLDriver.api._
import system.helpers.PropertyValidators.PropertyErrorCodes
im... | Xanho/xanho-api | app/controllers/helpers/CRUDController.scala | Scala | apache-2.0 | 2,999 |
package com.itszuvalex.itszulib.implicits
import com.itszuvalex.itszulib.util.StringUtils
import net.minecraft.item.ItemStack
import net.minecraft.nbt.NBTTagCompound
import net.minecraftforge.oredict.OreDictionary
import scala.collection.JavaConversions._
/**
* Created by Christopher Harris (Itszuvalex) on 10/11/14... | BlockWorker/ItszuLib | src/main/scala/com/itszuvalex/itszulib/implicits/ItemStackImplicits.scala | Scala | gpl-2.0 | 1,250 |
package com.tajpure.scheme.compiler.parser
import com.tajpure.scheme.compiler.Constants
import com.tajpure.scheme.compiler.Scope
import com.tajpure.scheme.compiler.ast.Argument
import com.tajpure.scheme.compiler.ast.Block
import com.tajpure.scheme.compiler.ast.Call
import com.tajpure.scheme.compiler.ast.Define
import ... | tajpure/SoScheme | src/main/scala/com/tajpure/scheme/compiler/parser/Parser.scala | Scala | gpl-3.0 | 6,686 |
package org.kokho.scheduling.rts.multicritical
import org.kokho.scheduling.{PeriodicTask, SynchronousTask, ImplicitDeadlineTask, Task}
/**
* Created with IntelliJ IDEA on 5/28/15.
* @author: Mikhail Kokho
*/
trait MulticriticalTask extends Task
with ImplicitDeadlineTask
{
}
| mkokho/dynoslack | old_sources/main/scala/kokho/scheduling/rts/multicritical/MulticriticalTask.scala | Scala | apache-2.0 | 282 |
package edu.gemini.spModel.rich.pot.spdb
/**
*
*/
import edu.gemini.pot.sp.{ISPProgram, ISPNode}
import edu.gemini.pot.spdb.{IDBDatabaseService, DBAbstractQueryFunctor}
import scala.collection.mutable.ListBuffer
import java.security.Principal
/**
* Creates a Stream of science programs from the database. Restricte... | arturog8m/ocs | bundle/edu.gemini.pot/src/main/scala/edu/gemini/spModel/rich/pot/spdb/OdbProgramList.scala | Scala | bsd-3-clause | 1,007 |
package org.scalatra
import java.io.{ ByteArrayOutputStream, ObjectOutputStream }
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.{ BeforeAndAfterEach, FunSuite, Matchers }
import skinny.micro.contrib.flash.FlashMap
@RunWith(classOf[JUnitRunner])
class FlashMapTest extends... | xerial/skinny-micro | micro/src/test/scala/org/scalatra/FlashMapTest.scala | Scala | bsd-2-clause | 3,987 |
package com.datawizards.dqm.result
case class ValidationResult(
invalidRecords: Seq[InvalidRecord],
tableStatistics: TableStatistics,
columnsStatistics: Seq[ColumnStatistics],
groupByStatisticsList: Seq[... | piotr-kalanski/data-quality-monitoring | src/main/scala/com/datawizards/dqm/result/ValidationResult.scala | Scala | apache-2.0 | 540 |
package com.jasperdenkers.play.auth
import play.api.mvc.{Request, WrappedRequest}
class AuthenticatedRequest[A, B](val identity: A, val request: Request[B]) extends WrappedRequest[B](request)
object AuthenticatedRequest {
def apply[A, B](identity: A, request: Request[B]) = new AuthenticatedRequest(identity, reque... | jasperdenkers/play-auth | core/app/com/jasperdenkers/play/auth/AuthenticatedRequest.scala | Scala | mit | 470 |
package com.typesafe.slick.testkit.tests
import com.typesafe.slick.testkit.util.{RelationalTestDB, AsyncTest}
import scala.concurrent.Future
class NestingTest extends AsyncTest[RelationalTestDB] {
import tdb.profile.api._
def testNestedTuples = {
import TupleMethods._
class T(tag: Tag) extends Table[(I... | AtkinsChang/slick | slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/NestingTest.scala | Scala | bsd-2-clause | 10,299 |
/*
* Copyright (C) 2007-2008 Artima, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | peachyy/scalastu | modules/SimpleFoods.scala | Scala | apache-2.0 | 928 |
package com.chrisomeara.pillar.core
import java.io.{File, FileInputStream}
import java.util.Date
object Registry {
def apply(migrations: Seq[Migration]): Registry = {
new Registry(migrations)
}
def fromDirectory(directory: File, reporter: Reporter): Registry = {
new Registry(parseMigrationsInDirectory(... | comeara/pillar-core | src/main/scala/com/chrisomeara/pillar/core/Registry.scala | Scala | mit | 1,956 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2007-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/reflect/NoManifest.scala | Scala | bsd-3-clause | 1,034 |
/*
* Copyright 2012-2014 Comcast Cable Communications Management, 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
*
* Unl... | Comcast/sirius | src/test/scala/com/comcast/xfinity/sirius/api/impl/paxos/PaxosSupervisorTest.scala | Scala | apache-2.0 | 4,650 |
package org.backuity.puppet
import java.io.{File, FileNotFoundException}
import java.nio.file.{StandardCopyOption, CopyOption, Files, Path}
trait Git {
/** @return true if dir is a git repository */
def isGit(dir: Path) : Boolean
def update(source: String, ref: Option[String], destination: Path): Unit
def cl... | backuity/puppet-module-installer | src/main/scala/org/backuity/puppet/Git.scala | Scala | apache-2.0 | 4,702 |
package org.jetbrains.plugins.scala.worksheet.ui
import com.intellij.openapi.editor.impl.FoldingModelImpl
import com.intellij.openapi.editor.{Document, Editor, VisualPosition}
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi.PsiDocumentManager
import ... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/worksheet/ui/WorksheetEditorPrinterBase.scala | Scala | apache-2.0 | 4,289 |
package org.jetbrains.sbt
package project.data
import com.intellij.openapi.externalSystem.model.{ProjectKeys, DataNode}
import com.intellij.openapi.externalSystem.model.project.ModuleData
import com.intellij.openapi.externalSystem.service.project.{ProjectStructureHelper, PlatformFacade}
import com.intellij.openapi.mod... | consulo/consulo-scala | SBT/src/main/scala/org/jetbrains/sbt/project/data/SbtModuleDataService.scala | Scala | apache-2.0 | 1,168 |
package tests
import org.scalatest.FlatSpec
class NonParallelTest extends FlatSpec {
it should "Write Passing Tests" in {
}
it should "Write Failing Tests" in {
fail("Test failed")
}
}
| JetBrains/sbt-tc-logger | test/testdata/testsupport/parallelTestExecutionTW43578/src/src/test/scala/tests/NonParallelTest.scala | Scala | apache-2.0 | 203 |
package scaldi
import scala.util.Random
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class WordBinderSpec extends AnyWordSpec with Matchers {
"WordBinder" should {
"require to bind something" in {
val binder = new WordBinder {
bind[String] identifiedBy S... | scaldi/scaldi | src/test/scala/scaldi/WordBinderSpec.scala | Scala | apache-2.0 | 8,749 |
/*
* Copyright 2012 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... | kevinyang0906/zipkin | zipkin-query-core/src/main/scala/com/twitter/zipkin/query/QueryService.scala | Scala | apache-2.0 | 16,233 |
package truerss.db.driver
import java.time.{Clock, LocalDateTime}
import com.zaxxer.hikari.{HikariConfig, HikariDataSource}
import slick.ast.FieldSymbol
import slick.dbio.DBIO
import slick.jdbc.{JdbcBackend, JdbcProfile}
import slick.jdbc.meta.{MColumn, MQName, MTable}
import slick.migration.api.{Dialect, GenericDiale... | truerss/truerss | src/main/scala/truerss/db/driver/DbInitializer.scala | Scala | mit | 7,110 |
/*
* Copyright (c) 2014 Paul Bernard
*
* 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 t... | pmularien/spectrum-old | financial/src/main/scala/org/quantintel/ql/instruments/bonds/CpiBond.scala | Scala | apache-2.0 | 782 |
/**
* Copyright (c) 2016 Intel Corporation
*
* 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 applicabl... | trustedanalytics/spark-tk | sparktk-core/src/main/scala/org/trustedanalytics/sparktk/graph/internal/ops/orientdb/Statistics.scala | Scala | apache-2.0 | 4,410 |
package pl.edu.agh.mplt.visitors.translator.latex
import pl.edu.agh.mplt.parser.declaration.data.DataDeclaration
import pl.edu.agh.mplt.visitors.translator.Translator
import pl.edu.agh.mplt.parser.phrase.set.{IndexedSet, Indexing}
class DataTranslator extends Translator[DataDeclaration] {
override def a... | marek1840/MPLT | src/main/scala/pl/edu/agh/mplt/visitors/translator/latex/DataTranslator.scala | Scala | mit | 968 |
/*
* 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 ... | zohar-mizrahi/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala | Scala | apache-2.0 | 54,644 |
package com.rocketfuel.sdbc.base.jdbc
import org.scalatest.FunSuite
import shapeless._
import TestDbms._
import shapeless.record.Record
/**
* Test cases taken from https://github.com/tpolecat/doobie/blob/c8a273c365edf5a583621fbfd77a49297986d82f/core/src/test/scala/doobie/util/composite.scala
*/
class CompositeGette... | rocketfuel/sdbc | jdbc/src/test/scala/com/rocketfuel/sdbc/base/jdbc/CompositeGetterSpec.scala | Scala | bsd-3-clause | 1,691 |
package at.logic.gapt.proofs.ceres
import at.logic.gapt.algorithms.rewriting.DefinitionElimination
import at.logic.gapt.expr._
import at.logic.gapt.formats.llk.HybridLatexParser
import at.logic.gapt.proofs.ceres.projections.Projections
import at.logic.gapt.proofs.ceres.struct.StructCreators
import at.logic.gapt.proofs... | loewenheim/gapt | src/test/scala/at/logic/gapt/proofs/ceres/ceres_omegaTest.scala | Scala | gpl-3.0 | 3,112 |
object Absolute1 {
def absolute(f: Int => Int): Int => Int =
n => f(n).abs // This uses the built-in `abs` method on `Int`
} | ryo-murai/fpinscala-exercises | answerkey/structuringprograms/2.answer.scala | Scala | mit | 130 |
package com.twitter.finagle.mux
import com.twitter.finagle.{Context, Dtab, Service, WriteException, NoStacktrace}
import com.twitter.finagle.netty3.BufChannelBuffer
import com.twitter.finagle.mux.lease.Acting
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.tracing.{Trace, Annotation}
import c... | yancl/finagle-6.22.0 | finagle-mux/src/main/scala/com/twitter/finagle/mux/Client.scala | Scala | apache-2.0 | 7,236 |
object Minimized {
trait Literal {
type F[T]
}
trait Addition { self: Literal =>
def foo: F[Int]
}
object Main {
def expression(adder: Addition & Literal) = { // error: adder.F is not defined in inferred type
adder.foo
}
}
}
| som-snytt/dotty | tests/pos/i3083.scala | Scala | apache-2.0 | 261 |
package com.twitter.finagle.memcached.integration
import com.twitter.common.application.ShutdownRegistry.ShutdownRegistryImpl
import com.twitter.common.zookeeper.ServerSet.EndpointStatus
import com.twitter.common.zookeeper.testing.ZooKeeperTestServer
import com.twitter.common.zookeeper.{CompoundServerSet, ZooKeeperUti... | cogitate/twitter-finagle-uuid | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/CacheNodeGroupTest.scala | Scala | apache-2.0 | 9,475 |
package mesosphere.marathon
package api.v2
import java.util
import javax.inject.Inject
import javax.servlet.http.HttpServletRequest
import javax.ws.rs._
import javax.ws.rs.core.{ Context, MediaType, Response }
import mesosphere.marathon.api.v2.json.Formats._
import mesosphere.marathon.api.{ EndpointsHelper, MarathonM... | natemurthy/marathon | src/main/scala/mesosphere/marathon/api/v2/TasksResource.scala | Scala | apache-2.0 | 7,003 |
package com.thoughtworks.deeplearning
import scalaz.{ContT, Trampoline}
import scalaz.Free.Trampoline
import scalaz.concurrent.Future
/**
* @author 杨博 (Yang Bo) <[email protected]>
*/
object FutureIsomorphism extends scalaz.Isomorphism.IsoFunctorTemplate[Future, ContT[Trampoline, Unit, ?]] {
override def... | Atry/DeepLearning.scala | FutureIsomorphism/src/main/scala/com/thoughtworks/deeplearning/FutureIsomorphism.scala | Scala | apache-2.0 | 613 |
/*
* 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/test/scala/com/waz/znet2/HttpClientSpec.scala | Scala | gpl-3.0 | 9,618 |
package scala.slick.jdbc.meta
import java.sql._
import scala.slick.jdbc.ResultSetInvoker
import scala.slick.ql.TypeMapperDelegate
/**
* A wrapper for a row in the ResultSet returned by DatabaseMetaData.getVersionColumns().
*/
case class MVersionColumn(
column: String, sqlType: Int, typeName: String,
columnSize:... | szeiger/scala-query | src/main/scala/scala/slick/jdbc/meta/MVersionColumn.scala | Scala | bsd-2-clause | 920 |
package basics.patterns
object PatternMatching {
def doMatchnigValue(value: Int): String = {
value match {
case 1 => "one"
case 2 => "two"
case _ => "unknown"
}
}
def doMatchnigType(value: Any): String = {
value match {
case _: Int => "int"
case _: Double => "double"
... | szaqal/KitchenSink | Scala/01/src/main/scala/basics/patterns/PatternMatching.scala | Scala | gpl-3.0 | 874 |
package is.hail.expr.ir.lowering
import is.hail.backend.ExecuteContext
import is.hail.expr.ir.{BaseIR, TypeCheck}
import is.hail.utils._
case class LoweringPipeline(lowerings: LoweringPass*) {
assert(lowerings.nonEmpty)
final def apply(ctx: ExecuteContext, ir: BaseIR): BaseIR = {
var x = ir
lowerings.fo... | hail-is/hail | hail/src/main/scala/is/hail/expr/ir/lowering/LoweringPipeline.scala | Scala | mit | 3,746 |
package helpers
import play.api.Application
import scala.reflect.ClassTag
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.test.Helpers._
trait InjectorSupport {
Option(System.getenv("GECKO_DRIVER_PATH")) match {
case None => println(
"*** You do not set environment variable GECKO_DRIV... | ruimo/store2 | test/helpers/InjectorSupport.scala | Scala | apache-2.0 | 923 |
/*
* 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 ... | brad-kaiser/spark | core/src/main/scala/org/apache/spark/ui/jobs/AllStagesPage.scala | Scala | apache-2.0 | 5,904 |
package japgolly.scalajs.react.extra.router2
import org.scalajs.dom
import scalaz.Equal
import japgolly.scalajs.react._
import japgolly.scalajs.react.extra.assertWarn
// =====================================================================================================================
// URLs
abstract class PathLi... | beni55/scalajs-react | extra/src/main/scala/japgolly/scalajs/react/extra/router2/types.scala | Scala | apache-2.0 | 4,867 |
import java.io.File
import testgen.TestSuiteBuilder._
import testgen._
object HighScoresTestGenerator {
def main(args: Array[String]): Unit = {
val file = new File("src/main/resources/high-scores.json")
val code = TestSuiteBuilder.build(file,
fromLabeledTestAltFromInput(
"scores" -> Seq("scor... | ricemery/xscala | testgen/src/main/scala/HighScoresTestGenerator.scala | Scala | mit | 561 |
/*
* Copyright (c) 2017. Yuriy Stul
*/
package com.stulsoft.typeinfo
import org.scalatest.{FlatSpec, Matchers}
/** Unit tests for YSTypeInfo class
*
* @author Yuriy Stul
*/
class YSTypeInfoTest extends FlatSpec with Matchers {
behavior of "YSTypeInfoTest"
"declaredFields" should "return declared fields... | ysden123/poc | ys-type-info/src/test/scala/com/stulsoft/typeinfo/YSTypeInfoTest.scala | Scala | mit | 2,597 |
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.