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 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.PinStance
import com.eevolution.utils.PaginatedSequence
import com.lightbend.lagom.scaladsl.api.{Service, S... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/service/PinStanceService.scala | Scala | gpl-3.0 | 2,035 |
import stainless.annotation.{ghost => ghostAnnot}
import stainless.lang._
import stainless.collection._
object GhostFlow1 {
case class Ghost(@ghostAnnot var p: BigInt) {
def f(x: BigInt) = {
ghost {
p = p + 1
}
}
}
}
| epfl-lara/stainless | frontends/benchmarks/extraction/valid/GhostFlow1.scala | Scala | apache-2.0 | 250 |
import jgo.tools.compiler._
import parser.BlockLang
import parser.combinatorExten._
import lexer.Scanner
import interm.codeseq._
class ParserTests(val tests: String*) extends ParserTestSuite
trait ParserTestSuite extends App {
testAll()
val tests: Seq[String]
def testAll() {
tests foreach test
}... | thomasmodeneis/jgo | src/src/test/scala/ParserTest.scala | Scala | gpl-3.0 | 1,054 |
package net.aicomp.sample.sbt
object Main {
def main(args: Array[String]) {
var line = ""
System.out.println("SampleSbt")
while ({ line = readLine(); line ne null }) {
Iterator.continually(readLine()).takeWhile(_ != "EOS").toList
System.out.println("finish")
}
}
}
| AI-comp/Terraforming | SampleAI/sbt/src/main/scala/net/aicomp/sample/sbt/Main.scala | Scala | apache-2.0 | 298 |
/*
* 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 ... | shivangi1015/incubator-carbondata | integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonMetastore.scala | Scala | apache-2.0 | 22,499 |
object P09 {
private def packHelper[A](l:List[A], curr:List[A], out:List[List[A]]):List[List[A]] = (l, curr) match {
case (Nil, _) => curr::out
case (h::tail, _) =>
if (h == curr.head)
packHelper[A](tail, h::curr, out)
else
packHelper[A](tail, List(h), curr::out)
}
def pac... | liefswanson/S-99 | src/main/scala/09.scala | Scala | gpl-2.0 | 684 |
package org.precompiler.spark101.utils
import com.typesafe.config.{Config, ConfigFactory}
/**
*
* @author Richard Li
*/
trait ParameterizedApp {
def loadProperties(path: String = "application.properties"): Config = {
ConfigFactory.load(path)
}
}
| precompiler/spark-101 | learning-spark/src/main/scala/org/precompiler/spark101/utils/ParameterizedApp.scala | Scala | apache-2.0 | 262 |
package com.github.gdefacci.briscola.presentation.player
import org.obl.raz.Path
import com.github.gdefacci.briscola.presentation.ADT
object PlayerEventKind extends Enumeration {
val playerLogOn, playerLogOff = Value
}
sealed trait PlayerEvent extends ADT[PlayerEventKind.type] {
def kind: PlayerEventKind.Value
}... | gdefacci/briscola | ddd-briscola-web/src/main/scala/com/github/gdefacci/briscola/presentation/player/playerEvents.scala | Scala | bsd-3-clause | 550 |
/*
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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 Fou... | TiarkRompf/lancet | src/test/scala/lancet/analysis/test6.scala | Scala | agpl-3.0 | 6,743 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | mllib/src/main/scala/org/apache/spark/ml/feature/Instance.scala | Scala | apache-2.0 | 1,210 |
/**
* @author Victor Caballero (vicaba)
* @author Xavier Domingo (xadobu)
*/
package actors.node
import actors._
import akka.actor.ActorRef
import net.message.{ContentMessage, ControlMessage, DiscoveryAndLookupMessage, Message}
import transaction.{ReadOnlyTransaction, ReadWriteTransaction, Transaction}
import sc... | vicobu/DistributedSystem | src/main/scala/actors/node/CDNMaster.scala | Scala | mit | 7,071 |
package de.sciss.fscape
package tests
import de.sciss.fscape.Ops._
object RotateWindowTest extends App {
val g = Graph {
import graph._
def sin = SinOsc(1.0 / 8).take(16384)
val rL = RotateWindow(sin, size = 24, amount = -2)
val rR = RotateWindow(sin, size = 24, amount = +2)
Plot1D(sin, 72, "s... | Sciss/FScape-next | core/jvm/src/test/scala/de/sciss/fscape/tests/RotateWindowTest.scala | Scala | agpl-3.0 | 516 |
package osgifelix
import aQute.bnd.version.Version
import sbt._
import sbt.librarymanagement.DependencyFilter
/**
* Created by jolz on 13/08/15.
*/
trait InstructionFilters {
def rewrite(moduleName: String, imports: String = "*", exports: String = "*;version=VERSION"): InstructionFilter =
rewriteFilter(modul... | doolse/sbt-osgi-felix | src/main/scala/osgifelix/InstructionFilter.scala | Scala | apache-2.0 | 2,300 |
/*
* Copyright (c) 2014-2021 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... | monixio/monix | monix-execution/shared/src/test/scala/monix/execution/cancelables/AssignableCancelableSuite.scala | Scala | apache-2.0 | 1,876 |
/*
* 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 ... | jackylk/incubator-carbondata | integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala | Scala | apache-2.0 | 24,714 |
package com.komanov.junk.mockito
import org.specs2.matcher.{Matcher, Matchers}
import org.specs2.mock.Mockito
import org.specs2.mutable.SpecificationWithJUnit
import org.specs2.specification.Scope
class MockitoAndMutableTest extends SpecificationWithJUnit with Mockito {
"doBusiness" should {
"replace 'a' with '... | dkomanov/stuff | src/com/komanov/junk/mockito/MockitoAndMutableTest.scala | Scala | mit | 2,258 |
package com.twitter.finagle.httpproxy
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import org.scalatest.mock.MockitoSugar
import org.mockito.Mockito.{times, verify, when, atLeastOnce}
import org.mockito.ArgumentCaptor
import org.mockito.Matchers._
import org.jbos... | JustinTulloss/finagle | finagle-core/src/test/scala/com/twitter/finagle/httpproxy/HttpConnectHandlerTest.scala | Scala | apache-2.0 | 5,368 |
// Copyright 2011 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | twitter/joauth | src/test/scala/com/twitter/joauth/testhelpers/MockRequestFactory.scala | Scala | apache-2.0 | 3,876 |
/*
* 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 ... | kimihe/Swallow | swallow-benchmark/HiBench-master/gearpumpbench/streaming/src/main/scala/com/intel/hibench/gearpumpbench/task/Identity.scala | Scala | apache-2.0 | 1,528 |
package mesosphere.marathon
package core.health
import akka.Done
import mesosphere.marathon.core.instance.Instance
import mesosphere.marathon.state.{ AppDefinition, PathId, Timestamp }
import org.apache.mesos.Protos.TaskStatus
import org.slf4j.LoggerFactory
import scala.concurrent.Future
import scala.collection.immut... | guenter/marathon | src/main/scala/mesosphere/marathon/core/health/HealthCheckManager.scala | Scala | apache-2.0 | 1,827 |
package com.wavesplatform.transaction
import cats.instances.either._
import cats.instances.lazyList._
import cats.syntax.traverse._
import com.wavesplatform.transaction.TxValidationError.InvalidSignature
import monix.eval.Coeval
trait Signed extends Authorized {
protected val signatureValid: Coeval[Boolean]
prot... | wavesplatform/Waves | node/src/main/scala/com/wavesplatform/transaction/Signed.scala | Scala | mit | 878 |
package blackboard.monitor.connection
abstract trait DataSource {}
sealed case class PostgresqlDataSource(host: String, port: String, db: String, username: String, password: String)
extends DataSource {
override def equals(that: Any): Boolean = {
if (that.isInstanceOf[PostgresqlDataSource]) {
val dst = ... | blackboard/monitor-bridge | src/main/scala/blackboard/monitor/connection/DataSources.scala | Scala | bsd-3-clause | 1,900 |
object Darts {
def score(x: Double, y: Double): Int = {
val distance = math.sqrt(x * x + y * y)
distance match {
case _ if distance <= 1.0 => 10
case _ if distance <= 5.0 => 5
case _ if distance <= 10.0 => 1
case _ => 0
}
}
}
| exercism/xscala | exercises/practice/darts/.meta/Example.scala | Scala | mit | 267 |
/*
* 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 ... | suchang/zipkin | zipkin-common/src/test/scala/com/twitter/zipkin/common/DependenciesSpec.scala | Scala | apache-2.0 | 2,930 |
/*
* 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 | test/iht/forms/application/gifts/GiftFormsTest.scala | Scala | apache-2.0 | 2,337 |
import scala.io.Source
case class Point(val x: Int, val y: Int) {
def reflection(midPoint: Point): Point = {
val rx = 2 * midPoint.x - x
val ry = 2 * midPoint.y - y
Point(rx, ry)
}
}
object FindPoint extends App {
val coordinates = Source.stdin.getLines().drop(1)
coordinates.foreach {
lines =>... | PaulNoth/hackerrank | practice/mathematics/fundamentals/find_point/FindPoint.scala | Scala | mit | 581 |
/*
* Copyright 2013 - 2017 Outworkers Ltd.
*
* 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... | websudos/morpheus | morpheus-dsl/src/main/scala/com/outworkers/morpheus/builder/QueryBuilder.scala | Scala | bsd-2-clause | 16,474 |
package cromwell.engine.backend.io.filesystem.gcs
import java.lang.Iterable
import java.nio.file._
import java.nio.file.attribute.UserPrincipalLookupService
import java.nio.file.spi.FileSystemProvider
import java.util.{Collections, Set => JSet}
import scala.language.postfixOps
case class NotAGcsPathException(path: S... | cowmoo/cromwell | engine/src/main/scala/cromwell/engine/backend/io/filesystem/gcs/GcsFileSystem.scala | Scala | bsd-3-clause | 2,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 ... | ron8hu/spark | sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala | Scala | apache-2.0 | 25,941 |
/*
* 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 ... | bOOm-X/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/SQLExecution.scala | Scala | apache-2.0 | 5,310 |
package com.featurefm.riversong.health
import com.featurefm.riversong.health.HealthState.HealthState
import org.joda.time.DateTime
import HealthState._
case class InternalContainerHealth(applicationName: String,
time: DateTime,
state: HealthState,
... | ListnPlay/RiverSong | src/main/scala/com/featurefm/riversong/health/ContainerHealth.scala | Scala | mit | 1,311 |
import quoted.*
import scala.quoted.staging.*
object Test {
given Compiler = Compiler.make(getClass.getClassLoader)
def main(args: Array[String]): Unit = withQuotes {
val q = '{ (q: Quotes) ?=> '{3} }
println(q.show)
}
}
| dotty-staging/dotty | tests/run-staging/quote-nested-1.scala | Scala | apache-2.0 | 236 |
/*
* 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... | cheeseng/scalatest | scalactic-test/src/test/scala/org/scalactic/DecidersSpec.scala | Scala | apache-2.0 | 4,561 |
package examples
import models.dataframe.DataFrame
object ExampleTitanic {
// Data from https://www.kaggle.com/c/titanic/data
import models.dataframe._
// Reading a plain text file with passenger data (tab separated)
val passenger_data: DataFrame = DataFrame("data/plain_text/input/passenger.tsv")
// Filt... | OriolLopezMassaguer/DataFrame | src/main/scala/examples/Examples.scala | Scala | gpl-3.0 | 2,308 |
/*
* 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 ... | wgpshashank/spark | core/src/test/scala/spark/SharedSparkContext.scala | Scala | apache-2.0 | 1,357 |
/*
* 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 ... | DieBauer/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/UserDefinedScalarFunctionTest.scala | Scala | apache-2.0 | 8,663 |
package eventstore
package operations
import OperationError._
import Inspection.Decision._
private[eventstore] case class TransactionWriteInspection(out: TransactionWrite)
extends ErrorInspection[TransactionWriteCompleted, OperationError] {
def decision(error: OperationError) = {
error match {
case P... | pawelkaczor/EventStore.JVM | src/main/scala/eventstore/operations/TransactionWriteInspection.scala | Scala | bsd-3-clause | 671 |
/**
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016 ScalateKids
* <p/>
* 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 ... | ScalateKids/Actorbase-Server | src/main/scala/com/actorbase/actorsystem/messages/ClientActorMessages.scala | Scala | mit | 4,382 |
/*
* 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 ... | dbtsai/spark | resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/RTestsSuite.scala | Scala | apache-2.0 | 1,719 |
package org.datacleaner.visualization
import org.datacleaner.result.html.HtmlRenderingContext
import org.datacleaner.result.html.HeadElement
import scala.collection.mutable.Map
import scala.collection.mutable.ListBuffer
import java.awt.Color
/**
* Head element that writes a script specific to the rendering of a sing... | anandswarupv/DataCleaner | components/visualization/src/main/scala/org/datacleaner/visualization/DensityAnalyzerChartScriptHeadElement.scala | Scala | lgpl-3.0 | 1,799 |
/*
* 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 | code/src/main/scala/org/openurp/code/geo/model/nation.scala | Scala | lgpl-3.0 | 1,468 |
package org.scalameta.paradise
import scala.tools.nsc.{Global, Phase, SubComponent}
import scala.tools.nsc.plugins.{Plugin => NscPlugin, PluginComponent => NscPluginComponent}
import scala.collection.{mutable, immutable}
import org.scalameta.paradise.converters.Converter
import org.scalameta.paradise.reflect.ReflectTo... | scalameta/paradise | plugin/src/main/scala/org/scalameta/paradise/Plugin.scala | Scala | bsd-3-clause | 931 |
package ch.epfl.bluebrain.nexus.iam.types
import java.time.Instant
import ch.epfl.bluebrain.nexus.iam.types.Identity.Subject
import ch.epfl.bluebrain.nexus.rdf.Iri.AbsoluteIri
object ResourceMetadata {
/**
* Constructs a [[ResourceF]] where the value is of type Unit
*
* @param id the identifie... | hygt/nexus-iam | src/main/scala/ch/epfl/bluebrain/nexus/iam/types/ResourceMetadata.scala | Scala | apache-2.0 | 996 |
package org.littlewings.infinispan.mapreduce
import scala.collection.JavaConverters._
import org.infinispan.distexec.mapreduce.{Collator, Collector, Mapper, Reducer}
@SerialVersionUID(1L)
class ReplicatedCacheMapper extends Mapper[String, String, String, Set[String]] {
override def map(key: String, value: String, ... | kazuhira-r/infinispan-examples | infinispan-mapreduce-clustering-type/src/main/scala/org/littlewings/infinispan/mapreduce/ReplicatedCacheMapperReducer.scala | Scala | mit | 742 |
package me.breidenbach.asyncmailer
import org.springframework.stereotype.Service
import scala.concurrent.duration.FiniteDuration
/**
* Copyright © Kevin E. Breidenbach, 5/29/15.
*/
// A wrapper to make it easy for Spring systems to use it
@Service("amMailSupervisor")
class MailerSupervisorControl {
val superviso... | kbreidenbach/akka-emailer | src/main/scala/me/breidenbach/asyncmailer/MailerSupervisorControl.scala | Scala | mit | 907 |
package ctlmc.bddgraph
import ctlmc.spec._
import ctlmc._
class GraphFactorySpec extends UnitSpec {
test("Creation") {
val factory = new GraphFactory()
}
}
class GraphSpec extends UnitSpec {
val factory = new GraphFactory()
factory.setParameters(Array(
("v1", (Array("F", "T").zipWithIndex.toMap, 0)),
("v2",... | fpoli/ctlmc | src/test/scala/bddgraph/GraphSpec.scala | Scala | gpl-3.0 | 3,242 |
/*
* Copyright (c) 2013 University of Massachusetts Amherst
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
package edu.umass.cs.iesl.bibmogrify.pipeline
import com.typesafe.scalalogging.slf4j.Logging
import collection.GenTraversableOnce
/**
* @author <a href="m... | iesl/bibmogrify | src/main/scala/edu/umass/cs/iesl/bibmogrify/pipeline/PipelineTraits.scala | Scala | apache-2.0 | 3,380 |
package xi.examples
import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}
object Ex3 {
def main(args: Array[String]): Unit = {
val conf = new SparkConf()
.setAppName("Task 3")
.setMaster("local")
val sc = new SparkContext(conf)
val tweetsPath = args(0)
val s... | SnipyJulmy/mcs_notes_and_resume | bdi/s06/lab06/src/main/scala/xi/examples/Ex3.scala | Scala | lgpl-3.0 | 1,300 |
package com.twitter.scrooge.android_generator
import com.twitter.scrooge.ast.{Identifier, Enum}
import com.twitter.scrooge.java_generator.TypeController
class EnumConstant(val name: String, val value: Int, val last: Boolean)
class EnumController(e: Enum, generator: AndroidGenerator, ns: Option[Identifier])
extends... | thirstycrow/scrooge | scrooge-generator/src/main/scala/com/twitter/scrooge/android_generator/EnumController.scala | Scala | apache-2.0 | 489 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ronq/geomesa | geomesa-accumulo/geomesa-accumulo-raster/src/main/scala/org/locationtech/geomesa/raster/wcs/GeoMesaCoverageFormat.scala | Scala | apache-2.0 | 2,537 |
package benchmark.unsafe
import org.scalameter._
import scalajson.ast.unsafe
object Generators {
def jBoolean: Gen[unsafe.JBoolean] =
for {
size <- Gen.range("seed")(300000, 1500000, 300000)
} yield {
if (size % 2 == 0)
unsafe.JBoolean(true)
else
unsafe.JBoolean(false)
... | mdedetrich/scalajson | benchmark/jvm/src/test/scala/benchmark/unsafe/Generators.scala | Scala | bsd-3-clause | 1,851 |
/*
* 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
* distribute... | wvlet/airframe | examples/src/main/scala/wvlet/airframe/examples/di/DI_91_Stats.scala | Scala | apache-2.0 | 1,333 |
package zeroformatter
package unsafe
object ZeroFormatter {
def serialize[T](value: T)(implicit F: Formatter[T]): Array[Byte] = {
val encoder = UnsafeEncoder(new Array[Byte](F.length.getOrElse(0)))
val byteSize = F.serialize(encoder, 0, value)
val result = encoder.toByteArray
if(result.length != byt... | pocketberserker/scala-zero-formatter | unsafe/src/main/scala/zeroformatter/unsafe/ZeroFormatter.scala | Scala | mit | 501 |
package controllers
import play.api._
import play.api.mvc._
import models.{Movie, Movies}
import play.api.libs.json.Json
import play.api.db.slick.DBAction
object Application extends Controller {
def index = Action {
Ok(views.html.index())
}
implicit val messageJsonWriter = Json.writes[Movie]
def movies... | rockneurotiko/madness-things | Scala/Play/movies-example/app/controllers/Application.scala | Scala | mpl-2.0 | 846 |
/*
* Copyright 2007-2008 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 applicable law or... | andreum/liftweb | sites/example/src/main/scala/net/liftweb/example/snippet/CountGame.scala | Scala | apache-2.0 | 2,038 |
package io.scalajs.nodejs.readline
import io.scalajs.nodejs.events.IEventEmitter
import scala.scalajs.js
/**
* Readline Interface
* @see https://nodejs.org/api/readline.html#readline_class_interface
* @author [email protected]
*/
@js.native
trait Interface extends IEventEmitter {
/**
* Closes... | scalajs-io/nodejs | app/common/src/main/scala/io/scalajs/nodejs/readline/Interface.scala | Scala | apache-2.0 | 6,151 |
package com.github.pockethub
import java.io._
import java.util.zip.GZIPOutputStream
import android.util.Log
/**
* Created by chentao on 15/12/10.
*
* @author [email protected]
*
* ___====-_ _-====___
* _--^^^#####// \\\\#####^^^--_
* ... | JLLK/PocketHub-scala | app/src/main/scala/com/github/pockethub/RequestWriter.scala | Scala | apache-2.0 | 2,220 |
package scala.virtualization.lms
package internal
import java.io._
import scala.tools.nsc._
import scala.tools.nsc.util._
import scala.tools.nsc.reporters._
import scala.tools.nsc.io._
import scala.tools.nsc.interpreter.AbstractFileClassLoader
trait ScalaCompile extends Expressions {
val codegen: ScalaCodegen {... | afernandez90/virtualization-lms-core | src/internal/ScalaCompile.scala | Scala | bsd-3-clause | 2,853 |
package ssscs.outputter
import com.itextpdf.text._
import com.itextpdf.text.pdf.PdfWriter
import java.io.{FileOutputStream, File}
import java.text.SimpleDateFormat
import scala.Some
import ssscs.{Article, PdfUtils}
class PdfOutputter extends Outputter {
override protected def outputToDir(articles: IndexedSeq[Art... | raincole/ssscs | src/main/scala/ssscs/outputter/PdfOutputter.scala | Scala | mit | 1,245 |
/*
* Copyright 2019 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... | rossabaker/http4s | ember-core/js/src/main/scala/org/http4s/ember/core/h2/HpackPlatform.scala | Scala | apache-2.0 | 1,947 |
/*
* 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 ... | goldmedal/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala | Scala | apache-2.0 | 7,441 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.lang._
import leon.collection._
import leon._
object BVDivision {
def divByZero(x: Int): Boolean = {
(x / 0 == 10)
}
}
| epfl-lara/leon | src/test/resources/regression/verification/newsolvers/invalid/BVDivision.scala | Scala | gpl-3.0 | 186 |
/*
* 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 ... | rmetzger/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala | Scala | apache-2.0 | 93,299 |
package cuckoo_egg
class BirdNest extends Nest {
def layEgg: Egg = {
new BirdEgg
}
} | PaulNoth/scala_ao_patterns | cuckoo_egg/bird_nest.scala | Scala | mit | 93 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | monix-eval/shared/src/test/scala/monix/eval/CoevalMemoizeSuite.scala | Scala | apache-2.0 | 3,851 |
/*
* 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 | streaming/src/main/scala/org/apache/spark/streaming/receiver/ReceiverMessage.scala | Scala | apache-2.0 | 1,147 |
/*
* 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 ... | pronix/spark | core/src/main/scala/org/apache/spark/rdd/PartitionPruningRDD.scala | Scala | apache-2.0 | 3,031 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | miklagard/jdbc/src/main/scala/com/precog/shard/jdbc/JDBCShardServer.scala | Scala | agpl-3.0 | 2,715 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/keras/layers/RReLUSpec.scala | Scala | apache-2.0 | 2,104 |
/*
* Copyright 2020 Precog Data
*
* 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 ... | quasar-analytics/quasar | qscript/src/main/scala/quasar/qscript/Hole.scala | Scala | apache-2.0 | 1,108 |
/*
* Copyright (c) 2014-2021 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... | monixio/monix | monix-tail/shared/src/main/scala/monix/tail/internal/IterantIntersperse.scala | Scala | apache-2.0 | 3,946 |
package tuner.test.functional
import org.scalatest.FeatureSpec
import org.scalatest.GivenWhenThen
import org.scalatest.Matchers._
import tuner.test.Util._
import tuner.Tuner
import tuner.project.Project
class OpenProjectSpec extends FeatureSpec with GivenWhenThen {
feature("Opening a viewable project shouldn't c... | gabysbrain/tuner | src/test/scala/tuner/functional/OpenProjectSpec.scala | Scala | mit | 660 |
package com.twitter.finatra.http.marshalling
trait DefaultMessageBodyWriter
extends MessageBodyWriter[Any]
| nkhuyu/finatra | http/src/main/scala/com/twitter/finatra/http/marshalling/DefaultMessageBodyWriter.scala | Scala | apache-2.0 | 110 |
package org.openurp.edu.eams.system.report.service.internal
import org.beangle.commons.dao.impl.BaseServiceImpl
import org.beangle.data.jpa.dao.OqlBuilder
import org.openurp.edu.base.Project
import org.openurp.edu.eams.system.report.ReportTemplate
import org.openurp.edu.eams.system.report.service.ReportTemplateServic... | openurp/edu-eams-webapp | core/src/main/scala/org/openurp/edu/eams/system/report/service/internal/ReportTemplateServiceImpl.scala | Scala | gpl-3.0 | 1,038 |
package cmdreader
import types._
/**
* A class to represent a preloaded command.
* @author bluebear94
*/
abstract class Command {
/**
* Returns the name of the command.
* @return the name of the command
*/
def getName(): String// = ""
/**
* Returns whether a given arity is valid.
* @param n the ... | bluebear94/bag | src/main/scala/cmdreader/Command.scala | Scala | gpl-3.0 | 581 |
/*
* Copyright 2007-2010 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... | wsaccaco/lift | framework/lift-base/lift-util/src/main/scala/net/liftweb/util/FatLazy.scala | Scala | apache-2.0 | 4,304 |
package core.clustering.kmeans
import core.DataSet
import core.clustering.model.{CentroidCluster, CentroidModel}
import core.util.Distances.DistanceFunc
import scala.annotation.tailrec
import scala.util.Random
/**
* Implementation of the Kmeans algorithm.
*
* @param distance the distance function that is goi... | fernandoj92/ScalaML | src/main/scala/core/clustering/kmeans/KMeans.scala | Scala | gpl-3.0 | 4,168 |
package x7c1.linen.modern.init.settings.preset
import x7c1.linen.database.struct.HasAccountId
case class PresetChannelSubscriptionChanged(
channelId: Long,
accountId: Long,
isSubscribed: Boolean,
from: PresetEventLocation
)
object PresetChannelSubscriptionChanged {
implicit object account extends HasAccou... | x7c1/Linen | linen-modern/src/main/scala/x7c1/linen/modern/init/settings/preset/PresetChannelSubscriptionChanged.scala | Scala | mit | 402 |
// Project: angulate2 (https://github.com/jokade/angulate2)
// Description:
// Copyright (c) 2017 Johannes.Kastner <[email protected]>
// Distributed under the MIT License (see included LICENSE file)
package angulate2.platformBrowser.animations
import scala.scalajs.js
import scala.scalajs.js.annot... | jokade/angulate2 | bindings/src/main/scala/angulate2/platformBrowser/animations/NoopAnimationsModule.scala | Scala | mit | 468 |
package io.flow.lint.linters
import io.apibuilder.spec.v0.models.{Field, Model, Service}
import io.flow.lint.Linter
/**
* Mapping models create qualified associations between two models. We enforce
* naming such that <model1>_<model2>_mapping must have the fields:
*
* a. id
* b. model1 of type model1_r... | flowcommerce/api-lint | src/main/scala/io/flow/lint/linters/MappingModels.scala | Scala | mit | 2,832 |
package actors_and_concurrency
import akka.actor.{Actor, ActorSystem, PoisonPill, Props, Terminated}
object DeathWatchTest extends App {
// create the ActorSystem instance
val system = ActorSystem("DeathWatchTest")
// create the Parent that will create Denny
val parent = system.actorOf(Props[Parent], name = "... | rafaelkyrdan/cookbook | src/main/scala/actors_and_concurrency/DeathWatchTest.scala | Scala | mit | 976 |
package org.opencommercesearch.cache
/*
* Licensed to OpenCommerceSearch under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. OpenCommerceSearch licenses this
* file to you under the Apache License, Version 2.0 ... | madickson/opencommercesearch | opencommercesearch-api/test/org/opencommercesearch/cache/DefaultMemoizerSpec.scala | Scala | apache-2.0 | 5,183 |
/*
* Copyright (C) 2005, The Beangle 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... | beangle/commons | dbf/src/test/scala/org/beangle/commons/dbf/ReaderTest.scala | Scala | lgpl-3.0 | 1,286 |
package graphique.backends.dummybackend
import graphique.backends._
/**
* A fully functional backend that stores the file content in memory.
*/
object DummyBackend {
def apply(): Backend = {
val io = new DummyIO
val urls = new DummyUrlProvider(io, DummyPaths)
val images = new ImageManager(io, DummyPa... | amrhassan/graphique | src/test/scala/graphique/backends/dummybackend/DummyBackend.scala | Scala | mit | 361 |
/*
* Copyright 2014 Michael Krolikowski
*
* 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... | mesosphere/dns4s | netty/src/main/scala/com/github/mkroli/dns4s/netty/DnsPacket.scala | Scala | apache-2.0 | 1,153 |
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author James Iry
*/
// $Id$
package scala
package tools.nsc.settings
/**
* Represents a single Scala version in a manner that
* supports easy comparison and sorting.
*/
sealed abstract class ScalaVersion extends Ordered[ScalaVersion] {
def unpar... | felixmulder/scala | src/compiler/scala/tools/nsc/settings/ScalaVersion.scala | Scala | bsd-3-clause | 5,444 |
/**
* 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-charts/src/main/scala/io/gatling/charts/template/GlobalPageTemplate.scala | Scala | apache-2.0 | 898 |
package com.sksamuel.elastic4s
import scala.language.implicitConversions
/** @author Stephen Samuel */
case class IndexType(index: String, `type`: String)
case class IndexesTypes(indexes: Seq[String], types: Seq[String]) {
def index = indexes.headOption.getOrElse(throw new RuntimeException("Specify at least one ind... | l15k4/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/IndexType.scala | Scala | apache-2.0 | 1,384 |
/*
* 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/sync/handler/AddressBookSyncHandler.scala | Scala | gpl-3.0 | 2,011 |
package dotty.tools
package dotc
package typer
import backend.sjs.JSDefinitions
import core._
import Contexts._, Types._, Symbols._, Names._, Decorators._, ProtoTypes._
import Flags._, SymDenotations._
import NameKinds.FlatName
import StdNames._
import config.Printers.{implicits, implicitsDetailed}
import ast.{untpd, ... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/typer/ImportSuggestions.scala | Scala | apache-2.0 | 14,269 |
/*
* 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 ... | HuaweiBigData/carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/datacompaction/DataCompactionCardinalityBoundryTest.scala | Scala | apache-2.0 | 4,465 |
package com.github.jeanadrien.gatling.mqtt.protocol
import akka.actor.{ActorRef, ActorSystem}
import com.github.jeanadrien.gatling.mqtt.client.{FuseSourceMqttClient, MqttClient}
import com.typesafe.scalalogging.StrictLogging
import io.gatling.commons.validation.Validation
import io.gatling.core.protocol.ProtocolCompon... | jeanadrien/gatling-mqtt-protocol | src/main/scala/com/github/jeanadrien/gatling/mqtt/protocol/MqttComponents.scala | Scala | apache-2.0 | 1,369 |
package io.circe.generic.simple.decoding
import cats.Apply
import io.circe.{ Decoder, DecodingFailure, HCursor }
import shapeless.{ :+:, ::, CNil, Coproduct, HList, HNil, Inl, Inr, Witness }
import shapeless.labelled.{ FieldType, field }
/**
* A decoder for a generic representation of a case class or ADT.
*
* Note... | travisbrown/circe | modules/generic-simple/src/main/scala/io/circe/generic/simple/decoding/ReprDecoder.scala | Scala | apache-2.0 | 2,530 |
package com.omega.service
import java.util.{ List => JList }
import org.springframework.transaction.annotation.Transactional
import com.omega.domain.Book
import com.omega.repository.BookDao
import com.omega.util.BeanLifeCycle
@Transactional
class BookServiceImpl(val bookDao: BookDao) extends BookService with BeanLi... | milind-chawla/Omega | src/main/scala/com/omega/service/BookServiceImpl.scala | Scala | mit | 531 |
/*
* Copyright 2014 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 applicab... | CarloMicieli/first-steps-with-scala | src/test/scala/io/github/carlomicieli/scalakoans/AboutAsserts.scala | Scala | apache-2.0 | 1,357 |
package pureconfig.generic
import scala.reflect.macros.blackbox
import pureconfig._
/** Macros used to circumvent divergence checker restrictions in the compiler.
*/
class ExportMacros(val c: blackbox.Context) {
import c.universe._
final def exportDerivedReader[A](implicit a: c.WeakTypeTag[A]): c.Expr[Exporte... | pureconfig/pureconfig | modules/generic/src/main/scala/pureconfig/generic/ExportMacros.scala | Scala | mpl-2.0 | 1,153 |
package com.softwaremill.streams
import java.io.File
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.io.Framing
import akka.stream.scaladsl.{FileIO, Keep}
import akka.util.ByteString
import com.softwaremill.streams.util.TestFiles
import com.softwaremill.streams.util.Timed._
impo... | softwaremill/streams-tests | src/main/scala/com/softwaremill/streams/TransferTransformFile.scala | Scala | apache-2.0 | 2,318 |
/*
* 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 ... | manuzhang/incubator-gearpump | examples/streaming/wordcount/src/test/scala/org/apache/gearpump/streaming/examples/wordcount/WordCountSpec.scala | Scala | apache-2.0 | 2,195 |
package scala.meta.internal.metabrowse
import scala.meta.internal.semanticdb.Scala._
object ScalametaInternals {
def ownerAndDesc(symbol: String): (String, Descriptor) = {
DescriptorParser(symbol).swap
}
}
| scalameta/metadoc | metabrowse-cli/src/main/scala/scala/meta/internal/metabrowse/ScalametaInternals.scala | Scala | apache-2.0 | 216 |
/*
* 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 ... | dotunolafunmiloye/spark | core/src/main/scala/org/apache/spark/util/TimeStampedHashMap.scala | Scala | apache-2.0 | 4,602 |
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.