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 pl.touk.nussknacker.defaultmodel.migrations
import pl.touk.nussknacker.engine.api.MetaData
import pl.touk.nussknacker.engine.graph.node.{CustomNode, NodeData}
import pl.touk.nussknacker.engine.migration.NodeMigration
object GroupByMigration extends NodeMigration {
override val description = "GroupByMigrati... | TouK/nussknacker | defaultModel/src/main/scala/pl/touk/nussknacker/defaultmodel/migrations/GroupByMigration.scala | Scala | apache-2.0 | 796 |
/**
* Created by chanjinpark on 2016. 9. 12..
*/
val trainint = Array(("I love this sandwich.", 1),
("this is an amazing place!", 1),
("I feel very good about these beers.", 1),
("this is my best work.", 1),
("what an awesome view", 1),
("I do not like this restaurant", 0),
("I am tired of this stuff."... | chanjin/NRFAnalysis | scalascript/naivebayesmulticlass.scala | Scala | apache-2.0 | 646 |
package controllers
import play.api.mvc.Security.Authenticated
import play.api.mvc.Request
import play.api.mvc.RequestHeader
import play.api.mvc.Results
import play.api.mvc.Result
import play.api.mvc.AnyContent
import play.api.mvc.Action
import play.api.mvc.BodyParser
trait Secured {
val SessionKey = "u... | PaulKeeble/MissionUpload | app/controllers/Secured.scala | Scala | gpl-2.0 | 840 |
import com.monsanto.arch.cloudformation.model._
import com.monsanto.arch.cloudformation.model.resource._
import org.scalatest.FunSpec
import org.scalatest.Matchers
import spray.json._
/**
* Created by Ryan Richt on 2/26/15
*/
class ResourceRef_UT extends FunSpec with Matchers {
describe("ResourceRefs"){
it("... | joewing/cloudformation-template-generator | src/test/scala/com/monsanto/arch/cloudformation/model/ResourceRef_UT.scala | Scala | bsd-3-clause | 1,955 |
package input
import java.io.{PrintWriter, File}
import java.time.LocalDate
import com.typesafe.config.Config
import harness.UnitSpec
import input.AsanaConfig.AccessTokenKey
import input.Validators._
class ValidatorsSpec extends UnitSpec {
"getConfigurationFromFile" should "return error when file does not exists"... | hhimanshu/asanaweeklyreport | src/test/scala/input/ValidatorsSpec.scala | Scala | apache-2.0 | 3,848 |
/*************************************************************************
* *
* This file is part of the 20n/act project. *
* 20n/act enables DNA prediction for synthetic biology/bioengineering. *
* Copyright (C) 201... | 20n/act | reachables/src/main/scala/com/act/biointerpretation/rsmiles/chemicals/abstract_chemicals/AbstractChemicals.scala | Scala | gpl-3.0 | 5,648 |
object Test extends App {
val s = "Scala"
val d = 8
val b = false
val f = 3.14159
val c = 'c'
val t = new java.util.Date
val x = new java.util.Formattable {
def formatTo(ff: java.util.Formatter, g: Int, w: Int, p: Int): Unit = ff format "xxx"
}
// 1) number of arguments
new StringContext().f()
... | som-snytt/dotty | tests/untried/neg/stringinterpolation_macro-neg.scala | Scala | apache-2.0 | 1,267 |
package maker.project
import maker.task._
import maker._
import maker.task.compile._
import java.io._
import maker.utils._
import maker.utils.FileUtils._
import maker.task.tasks._
import maker.utils.RichString._
import java.net.URLClassLoader
import java.lang.reflect.Modifier
import scala.xml.{Elem, NodeSeq}
import ja... | cage433/maker | maker/src/maker/project/ProjectTrait.scala | Scala | bsd-2-clause | 8,533 |
/*
* Copyright 2009-2015 LinkedIn, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | linkedin/norbert | network/src/main/scala/com/linkedin/norbert/network/partitioned/loadbalancer/gcaware/GcAwarePartitionedLoadBalancerHelper.scala | Scala | apache-2.0 | 1,714 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | cran/rkafkajars | java/scala/collection/DefaultMap.scala | Scala | apache-2.0 | 1,572 |
package org.jetbrains.plugins.scala.lang.psi.stubs.impl
import com.intellij.psi.PsiElement
import com.intellij.psi.stubs.StubElement
import com.intellij.util.SofterReference
import com.intellij.util.io.StringRef
import org.jetbrains.plugins.scala.lang.psi.api.base.types.ScTypeElement
import org.jetbrains.plugins.scala... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/impl/ScTypeElementOwnerStub.scala | Scala | apache-2.0 | 1,382 |
object coinv {
def up[F[+_]](fa: F[String]): F[Object] = fa
def down[F[-_]](fa: F[Object]): F[String] = fa
up(List("hi"))
// [error] type A is covariant, but type _ is declared contravariant
down(List('whatever: Object))
}
| folone/dotty | tests/untried/neg/t7872c.scala | Scala | bsd-3-clause | 234 |
package org.scalaide.ui.internal.editor.decorators.semicolon
import java.util.Date
import java.util.concurrent.locks.ReentrantLock
import org.scalaide.util.ui.DisplayThread
import org.scalaide.util.internal.ThreadUtils.withLock
object TypingDelayHelper {
val DelayInMillis = 300
}
/**
* Provides callbacks after... | stephenh/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/internal/editor/decorators/semicolon/TypingDelayHelper.scala | Scala | bsd-3-clause | 2,082 |
package org.bitcoins.core.serializers.p2p.headers
import org.bitcoins.core.number.UInt32
import org.bitcoins.core.p2p.NetworkPayload
import org.bitcoins.testkitcore.node.P2PMessageTestUtil
import org.bitcoins.testkitcore.util.BitcoinSUnitTest
import scodec.bits._
class RawNetworkHeaderSerializerTest extends BitcoinSU... | bitcoin-s/bitcoin-s | core-test/src/test/scala/org/bitcoins/core/serializers/p2p/headers/RawNetworkHeaderSerializerTest.scala | Scala | mit | 1,572 |
object Test extends App {
val res0 = 1 #:: Stream.empty
res0 match { case 1 #:: xs => xs }
}
| yusuke2255/dotty | tests/pos/t2234.scala | Scala | bsd-3-clause | 97 |
package cvx
import breeze.linalg.DenseVector
import cvx.SimpleOptimizationProblems._
/** Main class, runs all tests from main method.
**/
object Runner extends App {
/** Run the various tests and benchmarks.*/
override def main(args: Array[String]) {
println("Doing test problems."); Console.flush()
... | spyqqqdia/cvx | src/test/scala/cvx/Runner.scala | Scala | mit | 3,806 |
package controllers
import akka.actor.ActorRef
import org.apache.commons.lang3.exception.ExceptionUtils
import org.slf4j.LoggerFactory
import play.api.libs.json._
import play.api.mvc.{InjectedController, Request, Result}
import services.AppServices
import store.{ObjectStore, Violation}
import store.violations._
import... | leandrocruz/morbid | backend/src/main/scala/controllers/ControllerSupport.scala | Scala | gpl-2.0 | 3,116 |
package shop.model
import shop.infrastructure._
case class Shopper(id: Option[Long], username: String) extends Logging {
def this(id: Long, username: String) = this(Some(id),username)
def this(username: String) = this(None,username)
def findList(listId: Long)(implicit registry: ComponentRegistry): Option... | flurdy/shoppinglist | shopservice/src/main/scala/model/Shopper.scala | Scala | mit | 1,825 |
class I0(I0: (Double) with I0) extends AnyVal
| lampepfl/dotty | tests/pending/fuzzy/SOE-9b36f1e16d7d70fba2a0ccbccd7834342fb61719.scala | Scala | apache-2.0 | 46 |
package org.jetbrains.plugins.scala.worksheet
import com.intellij.lang.Language
trait WorksheetLanguageLike { self: Language =>
}
| JetBrains/intellij-scala | scala/worksheet/src/org/jetbrains/plugins/scala/worksheet/WorksheetLanguageLike.scala | Scala | apache-2.0 | 132 |
package rescala.macros
import rescala.core.{CreationTicket, DynamicTicket, LowPriorityCreationImplicits, Struct}
import rescala.reactives.{Event, Signal}
import retypecheck._
import scala.language.experimental.macros
import scala.reflect.macros.blackbox
object ReactiveMacros {
def Signal[A, S <: Struct](expressio... | volkc/REScala | Main/shared/src/main/scala/rescala/macros/ReactiveMacros.scala | Scala | apache-2.0 | 14,220 |
package models
import java.util.UUID
import anorm.{ RowParser, SQL }
import anorm.SqlParser.{ double, long, str, get }
import anorm.ResultSetParser
import anorm.SqlQuery
import anorm.~
import com.datastax.driver.core.DataType._
import com.datastax.driver.core.Row
import com.datastax.driver.core.querybuilde... | allixender/journal-text-mining | app/models/AbstractHydro.scala | Scala | apache-2.0 | 8,530 |
package de.fosd.typechef.crewrite
import de.fosd.typechef.featureexpr.FeatureExpr
import de.fosd.typechef.conditional.{Opt, ConditionalMap, Conditional}
import de.fosd.typechef.parser.c._
import scala.Some
// interprocedural control flow graph (cfg) implementation based on the
// intraprocedural cfg implementation (s... | ckaestne/TypeChef | CRewrite/src/main/scala/de/fosd/typechef/crewrite/InterCFG.scala | Scala | lgpl-3.0 | 2,901 |
package com.twitter.finagle.server
import com.twitter.concurrent.AsyncSemaphore
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.Stack.Module0
import com.twitter.finagle._
import com.twitter.finagle.context.{Contexts, Deadline}
import com.twitter.finagle.filter.{RequestSemaphoreFilter, ServerAdm... | luciferous/finagle | finagle-core/src/test/scala/com/twitter/finagle/server/StackServerTest.scala | Scala | apache-2.0 | 10,786 |
/*
* Copyright 2012 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
*
* Unless require... | Comcast/money | money-core/src/test/scala/com/comcast/money/core/samplers/TestData.scala | Scala | apache-2.0 | 1,090 |
package io.vamp.model.notification
import io.vamp.common.notification.Notification
object NoTagEventError extends Notification
case class EventTypeError(`type`: String) extends Notification
case class EventTimestampError(timestamp: String) extends Notification
object EventQueryTimeError extends Notification
case ... | magneticio/vamp | model/src/main/scala/io/vamp/model/notification/EventReaderNotification.scala | Scala | apache-2.0 | 395 |
package me.eax.examples.akka.stash
import akka.actor._
import akka.pattern.ask
import scala.concurrent._
import scala.collection.immutable._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.Try
case object Introspection extends AskHelper {
case class QueueEntry(msg: Any, sender: ActorRe... | afiskon/akka-introspection | src/main/scala/me/eax/examples/akka/stash/Introspection.scala | Scala | mit | 3,413 |
// !< 作用域<scope>
package bobsrockets
{
package navigation
{
// !< 指定类型Navigator在bobsrockets的作用域中访问为public
private[bobsrockets] class Navigator
{
protected[navigation] def useStarChart() {}
class LegOfJourney
{
private[Navigator] val distance = 100
}
// !< 只能在同一实例中访问!
private[this] var spee... | fangguanya/study | Java/scala_shell/scope.scala | Scala | mit | 502 |
package sbtavro
import filesorter.AvscFileSorter
import java.io.File
import org.apache.avro.compiler.idl.Idl
import org.apache.avro.compiler.specific.SpecificCompiler
import org.apache.avro.compiler.specific.SpecificCompiler.FieldVisibility
import org.apache.avro.generic.GenericData.StringType
import org.apache.avro... | cavorite/sbt-avro | src/main/scala/sbtavro/SbtAvro.scala | Scala | bsd-3-clause | 5,564 |
package com.sksamuel.avro4s
import java.io.ByteArrayOutputStream
import org.apache.avro.file.CodecFactory
import org.scalatest.{Matchers, WordSpec}
class AvroDataOutputStreamTest extends WordSpec with Matchers {
case class Composer(name: String, birthplace: String, compositions: Seq[String])
val ennio = Compose... | YuvalItzchakov/avro4s | avro4s-core/src/test/scala/com/sksamuel/avro4s/AvroDataOutputStreamTest.scala | Scala | mit | 1,730 |
package com.twitter.finagle.http
import com.twitter.util.TwitterDateFormat
import java.text.SimpleDateFormat
import java.util.{Date, Locale, TimeZone}
import scala.annotation.varargs
import scala.collection.JavaConverters._
import scala.collection.mutable
/**
* Mutable message headers map.
*
* Header names are cas... | adriancole/finagle | finagle-http/src/main/scala/com/twitter/finagle/http/HeaderMap.scala | Scala | apache-2.0 | 5,625 |
package at.logic.gapt.proofs.lk
import at.logic.gapt.expr._
import at.logic.gapt.expr.schema.SchemaFormula
import at.logic.gapt.proofs.lk._
import at.logic.gapt.proofs.lk.base.{ LKProof, OccSequent }
import at.logic.gapt.proofs.occurrences.{ FormulaOccurrence, _ }
import at.logic.gapt.proofs.shlk._
import scala.colle... | loewenheim/gapt | src/main/scala/at/logic/gapt/proofs/lk/clone.scala | Scala | gpl-3.0 | 23,015 |
package models.export.rows
import akka.stream.scaladsl.{Sink,Source}
import org.specs2.specification.Scope
import play.api.libs.json.Json
import play.api.test.{DefaultAwaitTimeout,FutureAwaits}
import scala.collection.immutable
import com.overviewdocs.metadata.{Metadata,MetadataField,MetadataFieldType,MetadataSchema}... | overview/overview-server | web/test/models/export/rows/DocumentsWithColumnTagsSpec.scala | Scala | agpl-3.0 | 3,927 |
/**
* 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... | flange/drift-dev | kafka/00-kafka_2.11-0.10.1.0/libs/tmp/kafka/javaapi/TopicMetadataRequest.scala | Scala | apache-2.0 | 2,706 |
package com.clarifi.reporting
package object sql {
type SqlColumn = String
type Subquery = (SqlQuery, TableName, Header)
object SqlType extends scala.Enumeration {
val String = Value("String")
val Int = Value("Int")
val Double = Value("Double")
val Long = Value("Long")
val Date = Value("Dat... | ermine-language/ermine-legacy | src/main/scala/com/clarifi/reporting/sql.scala | Scala | bsd-2-clause | 332 |
package lists
import java.security.InvalidParameterException
/*
Reverse a list.
Example:
scala> reverse(List(1, 1, 2, 3, 5, 8))
res0: List[Int] = List(8, 5, 3, 2, 1, 1)
*/
object P05 {
def reverse[A](list: List[A]): List[A] = {
list match {
case h :: tail => reverse(tail) ++ List(h)
... | luizpericolo/s-99 | src/main/scala/lists/P05.scala | Scala | mit | 361 |
/*
* Copyright 2015 Rik van der Kleij
*
* 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... | ericssmith/intellij-haskell | src/com/powertuple/intellij/haskell/navigate/HaskellDeclarationContributor.scala | Scala | apache-2.0 | 1,368 |
package com.wallace.demo.app.parsercombinators.parsers
/**
* Created by 10192057 on 2018/4/11 0011.
*/
object ParserFactory {
def newInstance(methodKey: String): AbstractParser = {
methodKey match {
case MethodKeyType.default => new ExtractFieldsParser
case MethodKeyType.split => new SplitFieldsP... | BiyuHuang/CodePrototypesDemo | demo/ScalaDemo/src/main/scala/com/wallace/demo/app/parsercombinators/parsers/ParserFactory.scala | Scala | apache-2.0 | 1,027 |
package score.discord.canti.wrappers.jda
import net.dv8tion.jda.api.{EmbedBuilder, MessageBuilder}
import net.dv8tion.jda.api.entities.Message
object MessageConversions:
trait MessageFromX:
def toMessage: Message
class MessageFromString(me: String) extends MessageFromX:
def toMessage = MessageBuilder().a... | ScoreUnder/canti-bot | src/main/scala/score/discord/canti/wrappers/jda/MessageConversions.scala | Scala | agpl-3.0 | 854 |
package cfc.shale.redis_client.containers
import cfc.shale.redis_client.commands._
class RedisBooleanOption(key: String)
extends RedisContainer[Option[Boolean]] {
override def get: RedisCommand[Option[Boolean]] =
RedisGetBooleanOption(key)
override def set(value: Option[Boolean]): RedisCommand[Unit] =
... | cardforcoin/shale-scala | redis-client/src/main/scala/cfc/shale/redis_client/containers/RedisBooleanOption.scala | Scala | mit | 427 |
package skinny.controller
import scala.language.dynamics
/**
* org.scalatra.FlashMap wrapper.
*
* @param underlying scalatra's FlashMap
*/
case class Flash(underlying: org.scalatra.FlashMap) extends Dynamic {
/**
* Returns value if exists.
*
* @param key key
* @return value if exists
*/
def ge... | BlackPrincess/skinny-framework | framework/src/main/scala/skinny/controller/Flash.scala | Scala | mit | 651 |
/*
* Copyright 2008-present MongoDB, 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... | rozza/mongo-java-driver | driver-scala/src/main/scala/org/mongodb/scala/Subscription.scala | Scala | apache-2.0 | 2,476 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package sbt.testing
/** Represents one run of... | gzm0/scala-js | test-interface/src/main/scala/sbt/testing/Runner.scala | Scala | apache-2.0 | 7,081 |
object Test {
def foo(i: Int): Unit = {}
}
class A {
import Test.foo
foo(0)
}
class B {
import Test.{foo => baz}
baz(0)
} | loskutov/intellij-scala | testdata/changeSignature/inScala/Imported_after.scala | Scala | apache-2.0 | 137 |
package ch.ninecode.model
import com.esotericsoftware.kryo.Kryo
import com.esotericsoftware.kryo.Serializer
import com.esotericsoftware.kryo.io.Input
import com.esotericsoftware.kryo.io.Output
import org.apache.spark.sql.Row
import ch.ninecode.cim.CIMClassInfo
import ch.ninecode.cim.CIMContext
import ch.ninecode.cim.... | derrickoswald/CIMScala | CIMReader/src/main/scala/ch/ninecode/model/Core.scala | Scala | mit | 211,690 |
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.test._
import play.api.test.Helpers._
/**
* add your integration spec here.
* An integration test will fire up a whole play application in a real (or headless) browser
*/
@RunWith(classOf[JUnitRunner])
class Integratio... | michaeldfallen/sbt-mustache | plugin/src/sbt-test/play-app/play-tests/test-src/IntegrationSpec.scala | Scala | mit | 554 |
package io.github.hamsters
import scala.concurrent.{ExecutionContext, Future}
import scala.language.higherKinds
trait Functor[Box[_]] {
def map[In, Out](boxA: Box[In])(f: In => Out): Box[Out]
}
object Functor {
implicit val functorOption : Functor[Option] = new Functor[Option] {
override def m... | dgouyette/hamsters | shared/src/main/scala/io/github/hamsters/Functor.scala | Scala | apache-2.0 | 772 |
package net.liftmodules.extras
package snippet
import scala.xml._
import net.liftweb._
import common._
import http.{LiftRules, Req, S}
import sitemap.{Loc, SiteMap}
import util._
import util.Helpers._
object BsMenu extends BsMenu
trait BsMenu extends SnippetHelper {
/**
* Produces a menu UL from a group, for... | eltimn/lift-extras | src/main/scala/net/liftmodules/extras/snippet/BsMenu.scala | Scala | apache-2.0 | 1,591 |
package com.rasterfoundry.database.util
object Email {
def obfuscate(email: String): String = email.split("@").headOption match {
case Some(emailName) if emailName.length != 0 => emailName
case _ => "Anonymous"
}
}
| azavea/raster-foundry | app-backend/db/src/main/scala/util/Email.scala | Scala | apache-2.0 | 267 |
package au.com.agiledigital.toolform.command.generate.docker
import java.io.{BufferedWriter, File, FileWriter}
import java.nio.file.Path
import au.com.agiledigital.toolform.app.ToolFormError
import au.com.agiledigital.toolform.command.generate.Formatting._
import au.com.agiledigital.toolform.command.generate.docker.D... | agiledigital/toolform | src/main/scala/au/com/agiledigital/toolform/command/generate/docker/GenerateDockerComposeV3Command.scala | Scala | apache-2.0 | 6,998 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | yggdrasil/src/main/scala/com/precog/yggdrasil/table/cf/Util.scala | Scala | agpl-3.0 | 25,703 |
package spark
import java.io.EOFException
import java.io.ObjectInputStream
import java.net.URL
import java.util.{Date, HashMap => JHashMap}
import java.util.concurrent.atomic.AtomicLong
import java.text.SimpleDateFormat
import scala.collection.Map
import scala.collection.mutable.ArrayBuffer
import scala.collection.mu... | joeywen/spark_cpp_api | core/src/main/scala/spark/PairRDDFunctions.scala | Scala | bsd-3-clause | 26,257 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ericvandenbergfb/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/ui/ExecutionPage.scala | Scala | apache-2.0 | 5,285 |
package com.softwaremill.bootzooka.auth
import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
import com.softwaremill.bootzooka.auth.AuthOps._
import com.softwaremill.bootzooka.common.{StringJsonWrapper, Utils}
import com.softwaremill.bootzooka.api.Halting
import com.softwaremill.bootzooka.service.data.... | umitunal/bootzooka | backend/src/main/scala/com/softwaremill/bootzooka/auth/AuthenticationSupport.scala | Scala | apache-2.0 | 2,743 |
package scavlink.sbt.mavgen
import java.io.FileWriter
import org.fusesource.scalate.TemplateEngine
import sbt._
import scala.collection.immutable.ListMap
import scala.xml.{Elem, XML}
/**
* sbt task for generating Scala source files from MAVLink protocol definitions.
*/
object MavGen {
/**
* Invoke the plugin... | nickolasrossi/sbt-mavgen | src/main/scala/scavlink/sbt/mavgen/MavGen.scala | Scala | mit | 2,685 |
/**
* See <a href="https://www.codeeval.com/open_challenges/109/">Bay bridges</a>
*/
object BayBridges extends Challenge {
val lines = scala.io.Source.fromFile(args(0)).getLines().filter(_.length > 0)
case class Segment(x1: Double, y1: Double, x2: Double, y2: Double, a: Double, b: Double)
val segments = li... | zelca/codeeval | src/BayBridges.scala | Scala | mit | 1,534 |
object Container {
def hello = println("hello")
val hi: T = "Hi"
var x: T = "?"
type T = String
object Welcome {
def welcome = "Welcome" + x
}
class Greeting(name: String) {
def greet = println("Hello "+name)
}
}
| grzegorzbalcerek/scala-book-examples | examples/Objects6.scala | Scala | mit | 237 |
/*
* 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 ... | shuangshuangwang/spark | resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/LocalityPlacementStrategySuite.scala | Scala | apache-2.0 | 3,375 |
package com.github.suzuki0keiichi.nomorescript.annotation
import scala.annotation.Annotation
class global extends Annotation
| suzuki0keiichi/nomorescript | nomorescript-plugin/src/main/scala/com/github/suzuki0keiichi/nomorescript/annotation/global.scala | Scala | mit | 127 |
/**
*
*/
package log
import utils.Transition
import auth.models.User
import utils.TransacMode
import utils.JdbcTransacMode
import anorm._
import anorm.SqlParser.get
import settings.membership.Organization
/**
* @author Gustavo
*
*/
class LogDaoImpl extends LogDao {
override def insert(): Transition[TransacMode... | readren/coc-war-organizer | app/log/LogDaoImpl.scala | Scala | apache-2.0 | 743 |
package io.buoyant.namer
import com.twitter.finagle.{Name, NameTree, Path, Namer}
import com.twitter.util.{Activity, Future}
trait EnumeratingNamer extends Namer {
def getAllNames: Activity[Set[Path]]
}
| hhtpcd/linkerd | namer/core/src/main/scala/io/buoyant/namer/EnumeratingNamer.scala | Scala | apache-2.0 | 207 |
package slamdata.engine
import scala.reflect.ClassTag
import org.specs2.mutable._
import org.specs2.matcher._
import scalaz._
trait ValidationMatchers {
def beSuccess[E, A] = new Matcher[Validation[E, A]] {
def apply[S <: Validation[E, A]](s: Expectable[S]) = {
val v = s.value
result(
v.f... | sellout/slamengine-old | src/test/scala/slamdata/engine/matchers.scala | Scala | agpl-3.0 | 3,862 |
package org.jetbrains.plugins.scala.testingSupport.specs2.specs2_2_11_3_1M
import org.jetbrains.plugins.scala.testingSupport.specs2.Specs2TestCase
/**
* @author Roman.Shein
* @since 11.01.2015.
*/
trait Specs2_2_11_3_1_M_Base extends Specs2TestCase {
/**
* Intended for loading libraries different from scala-c... | LPTK/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/specs2/specs2_2_11_3_1M/Specs2_2_11_3_1_M_Base.scala | Scala | apache-2.0 | 2,012 |
package at.droelf.gui.entities
import java.util.UUID
import at.droelf.backend.DateTimeUtil
import org.joda.time.{DateTimeZone, DateTime}
import models.{Track, TrackMetaData, TrackPoint}
import play.api.Logger
case class GuiTrack(trackId: UUID, name: Option[String], activity: String, metaData: GuiTrackMetaData, track... | dr03lf/travel-log | app/at/droelf/gui/entities/GuiTrackEntities.scala | Scala | apache-2.0 | 4,651 |
/*
* Copyright 2016 Scalalaz Podcast Team
*
* 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 ... | scalalaz-podcast/scalalaz-gen | src/main/scala/ru/scalalaz/gen/data.scala | Scala | apache-2.0 | 2,047 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js API **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2015, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | mdedetrich/scala-js | library/src/main/scala/scala/scalajs/js/Promise.scala | Scala | bsd-3-clause | 2,689 |
package scaladex.infra.sql
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import scaladex.infra.BaseDatabaseSuite
class ProjectSettingsTableTests extends AnyFunSpec with BaseDatabaseSuite with Matchers {
describe("should generate query for") {
it("check insertOrUpdate")(ch... | scalacenter/scaladex | modules/infra/src/test/scala/scaladex/infra/sql/ProjectSettingsTableTests.scala | Scala | bsd-3-clause | 368 |
/*
* Copyright 2016 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... | SkillsFundingAgency/das-alpha-hmrc-api-mock | src/main/scala/uk/gov/bis/levyApiMock/controllers/DateRange.scala | Scala | mit | 2,345 |
package com.sksamuel.elastic4s.searches.aggs
case class ChildrenAggregation(name: String,
childType: String,
subaggs: Seq[AbstractAggregation] = Nil,
metadata: Map[String, AnyRef] = Map.empty)
extends Aggregation {
type... | Tecsisa/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/aggs/ChildrenAggregation.scala | Scala | apache-2.0 | 547 |
package collins.controllers
import java.util.Date
import play.api.libs.json.JsArray
import play.api.libs.json.JsBoolean
import play.api.libs.json.JsNumber
import play.api.libs.json.JsObject
import play.api.libs.json.JsString
import play.api.libs.json.JsValue
import play.api.libs.json.Json
import play.api.mvc.Action
i... | funzoneq/collins | app/collins/controllers/Api.scala | Scala | apache-2.0 | 4,071 |
/** This file is part of TextCompose, a program for producing PDF from text files.
* Copyright 2014 Jesper S Villadsen <jeschvi@gmail.com>
* License: GNU Affero General Public License version 3 or later.
* For full license text see LICENSE.txt or <http://www.gnu.org/licenses/>.
*/
package textcompose.modals
... | jvilladsen/TextCompose | src/main/scala/modals/LaidOutPanel.scala | Scala | agpl-3.0 | 3,293 |
package com.github.arschles.futurepatterns
import com.stackmob.newman._
import com.stackmob.newman.dsl._
import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
import scala.language.postfixOps
object FanOut extends App {
implicit val client = new Ap... | arschles/newman-example | src/main/scala/com/github/arschles/futurepatterns/FanOut.scala | Scala | apache-2.0 | 665 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | som-snytt/scala-xml | src/main/scala/scala/xml/XML.scala | Scala | bsd-3-clause | 4,169 |
/*
* This file is 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... | TresAmigosSD/SMV | src/main/scala/org/tresamigos/smv/package.scala | Scala | apache-2.0 | 6,758 |
package whilelang
/** Terms. The only type in the language is Int. */
sealed abstract class Term
case class Constant(c: Int) extends Term
case class Variable(v: String) extends Term
case class Plus(t1: Term, t2: Term) extends Term
case class Minus(t1: Term, t2: Term) extends Term
case class Times(c: Int, t: Term) exte... | sana/WorkAtEPFL | WhiteLanguageProgramVerifier/compiler/src/whilelang/Tree.scala | Scala | gpl-3.0 | 4,686 |
package net.liftweb.util
/*
* Copyright 2006-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 requir... | andreum/liftweb | lift-util/src/main/scala/net/liftweb/util/ControlHelpers.scala | Scala | apache-2.0 | 3,914 |
package com.lightning.walletapp.lnutils.olympus
import spray.json._
import com.lightning.walletapp.R.string._
import com.github.kevinsawicki.http.HttpRequest._
import com.lightning.walletapp.lnutils.JsonHttpUtils._
import com.lightning.walletapp.lnutils.ImplicitJsonFormats._
import com.lightning.walletapp.lnutils.olym... | btcontract/lnwallet | app/src/main/java/com/lightning/walletapp/lnutils/olympus/OlympusWrap.scala | Scala | apache-2.0 | 6,725 |
package com.rasterfoundry.database.notification.templates
final case class EmailData(
subject: String,
plainBody: String,
richBody: String
)
| azavea/raster-foundry | app-backend/db/src/main/scala/notification/templates/EmailData.scala | Scala | apache-2.0 | 154 |
package fpscala.chapter4
import fpscala.chapter3.{BList, BNil, BCons}
import fpscala.chapter4
import org.scalactic.Tolerance
import org.scalatest.{Matchers, FlatSpec}
import fpscala.chapter4._
import Tolerance._
/**
* Created
* by sajit on 9/19/15.
*/
class Chapter4Scala extends FlatSpec with Matchers{
it sho... | sajit/learnyou | scala/minimal-scala/src/test/scala/fpscala/chapter4/Chapter4Scala.scala | Scala | mit | 2,498 |
package mockws
import org.scalatest.{OptionValues, FreeSpec, Matchers}
import play.api.libs.concurrent.Execution.Implicits._
import play.api.libs.ws.WSClient
import play.api.mvc.Action
import play.api.mvc.Results._
import play.api.test.Helpers._
import scala.concurrent.Future
import scala.util.Try
class Example exte... | matterche/play-mockws | src/test/scala/mockws/Example.scala | Scala | mit | 2,404 |
package benchmarks.lattices.delta.crdt
import org.openjdk.jmh.annotations._
import rescala.extra.lattices.delta.crdt.reactive.{EWFlag, GMap}
import kofre.decompose.interfaces.EWFlagInterface
import java.util.concurrent.TimeUnit
@BenchmarkMode(Array(Mode.Throughput))
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Warmup(ite... | guidosalva/REScala | Code/Microbenchmarks/src/main/scala/benchmarks/lattices/delta/crdt/GMapBench.scala | Scala | apache-2.0 | 1,401 |
package controllers
import java.util.UUID
import play.api.libs.json.JsValue
import play.api.mvc.{Request,RequestHeader}
import scala.collection.immutable
import scala.util.control.Exception.catching
import models.pagination.PageRequest
import models.IdList
import _root_.util.BitSetUtil
/** Utilities that don't depen... | overview/overview-server | web/app/controllers/ControllerHelpers.scala | Scala | agpl-3.0 | 6,453 |
/**
* 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... | KevinLiLu/kafka | core/src/main/scala/kafka/security/auth/ResourceType.scala | Scala | apache-2.0 | 3,050 |
package nl.surfnet.nsiv2.messages
import Generators._
import javax.xml.datatype.XMLGregorianCalendar
import nl.surfnet.bod.nsi.Nillable
import org.ogf.schemas.nsi._2013._12.connection.types.{ ReservationConfirmCriteriaType, ReservationRequestCriteriaType }
class ReservationRequestCriteriaTypeOpsSpec extends org.specs... | BandwidthOnDemand/play-nsi-support | src/test/scala/nl/surfnet/nsiv2/messages/ReservationRequestCriteriaTypeOpsSpec.scala | Scala | bsd-3-clause | 3,434 |
package org.macrogl
import scala.collection._
abstract class Matrix(val array: Array[Double]) {
def mode: Int
def matrixMode: Int
override def toString = {
val invbases = array.map(v => f"$v%.5f").grouped(4).toArray.transpose
"%s(\\n%s)".format(
this.getClass.getSimpleName,
invbases.m... | storm-enroute/macrogl | src/macrogl/scala/org/macrogl/Matrix.scala | Scala | bsd-3-clause | 7,740 |
package hackco.frontend
import spray.json.DefaultJsonProtocol
import hackco.frontend.MessageTypes.{FailedRequest, DoubleNumberReply}
/**
* Created by robert courtney on 12/03/15
*/
case class Person(name: String, age: Int)
case class DoubleReply(number: Long, result: Long)
object SprayRequests {
object MyJsonPr... | nuclearcop/restapi | src/main/scala/hackco/frontend/SprayRequests.scala | Scala | gpl-2.0 | 573 |
/**
* Hyrid Julian Gregorian calendar.
*
* @author Yujian Zhang <yujian{dot}zhang[at]gmail(dot)com>
*
* License:
* GNU General Public License v2
* http://www.gnu.org/licenses/gpl-2.0.html
* Copyright (C) 2015 Yujian Zhang
*/
package net.whily.chinesecalendar
import java.util.Calendar
import scala.util.m... | whily/chinesecalendar | src/main/scala/JulianGregorianCalendar.scala | Scala | gpl-2.0 | 7,766 |
package com.twitter.finagle.http.exp
import com.twitter.finagle.http.{Request, Response}
package object routing {
type Route = com.twitter.finagle.exp.routing.Route[Request, Response, Schema]
}
| twitter/finagle | finagle-http/src/main/scala/com/twitter/finagle/http/exp/routing/package.scala | Scala | apache-2.0 | 200 |
/*
* 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 ... | lxsmnv/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/dsl/package.scala | Scala | apache-2.0 | 17,719 |
package io.koff.actors
import akka.actor.Actor
case class helloMsg(name: String)
case class goodByeMsg(name: String)
class SimpleServiceActor extends Actor {
def receive = {
case helloMsg(name) =>
sender ! "hello " + name
case goodByeMsg(name) =>
sender ! "goodbye " + name
}
}
| coffius/macro-actors | src/main/scala/io/koff/actors/SimpleServiceActor.scala | Scala | mit | 305 |
package com.evojam.mongodb.evolutions
import com.evojam.mongodb.evolutions.model.evolution.{Evolution, State, Action}
case class MongoEvolutionsException(msg: String) extends Exception(msg)
class MongoEvolutions extends MongoEvolutionsComponent {
def applyUp(evolution: Evolution) {
logger.info(s"Applying up: $... | evojam/mongodb-evolutions-scala | src/main/scala/com/evojam/mongodb/evolutions/MongoEvolutions.scala | Scala | apache-2.0 | 1,655 |
package com.collective.sparkext
import scala.util.Random
package object example {
val rnd = new Random()
}
| codeaudit/spark-ext | sparkext-example/src/main/scala/com/collective/sparkext/example/package.scala | Scala | apache-2.0 | 112 |
package ru.org.codingteam.horta.plugins.pet.commands
import akka.actor.ActorRef
import org.joda.time.{DateTime, Period}
import ru.org.codingteam.horta.core.Clock
import ru.org.codingteam.horta.localization.Localization._
import ru.org.codingteam.horta.plugins.pet.PetData
import ru.org.codingteam.horta.security.Credent... | codingteam/horta-hell | src/main/scala/ru/org/codingteam/horta/plugins/pet/commands/StatsCommand.scala | Scala | mit | 943 |
package com.twitter.finatra.kafkastreams.integration.wordcount
import com.twitter.conversions.DurationOps._
import com.twitter.finatra.kafka.serde.ScalaSerdes
import com.twitter.finatra.kafkastreams.config.KafkaStreamsConfig
import com.twitter.finatra.kafkastreams.internal.stats.KafkaStreamsFinagleMetricsReporter
impo... | twitter/finatra | kafka-streams/kafka-streams/src/test/scala/com/twitter/finatra/kafkastreams/integration/wordcount/WordCountServerFeatureTest.scala | Scala | apache-2.0 | 6,049 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | dotty-staging/scalatest | examples/src/test/scala/org/scalatest/examples/fixture/testdatafixture/ExampleSpec.scala | Scala | apache-2.0 | 987 |
package controllers
import play.api.Logger
trait Logging {
val log = Logger(this.getClass)
}
| vuminhkh/tosca-runtime | deployer/app/controllers/Logging.scala | Scala | mit | 97 |
package com.sksamuel.elastic4s.requests.cluster
import com.sksamuel.elastic4s.requests.cluster.ClusterStateResponse.Index
import com.sksamuel.elastic4s.testkit.DockerTests
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import scala.util.Try
class ClusterStateTest extends AnyW... | stringbean/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/cluster/ClusterStateTest.scala | Scala | apache-2.0 | 1,193 |
class Foo {
import foo.Annot
@Annot def bla = ()
}
| som-snytt/dotty | tests/pos-java-interop/i2109/Foo.scala | Scala | apache-2.0 | 56 |
package tv.camfire.media_server.serialization.jackson
import com.fasterxml.jackson.databind.ObjectMapper
import us.spectr.webrtc.serialization.jackson.WebrtcSerializationSupport
/**
* User: jonathan
* Date: 7/27/13
* Time: 3:48 PM
*/
trait CamfireSerializationSupport extends WebrtcSerializationSupport {
def map... | jgrowl/camfire-signaling | signaling-server/src/main/scala/tv/camfire/media_server/serialization/jackson/CamfireSerializationSupport.scala | Scala | mit | 384 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | zzcclp/carbondata | index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestQueryWithSkipSI.scala | Scala | apache-2.0 | 1,954 |
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.