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 |
|---|---|---|---|---|---|
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/Quasar | common/src/main/scala/quasar/common/JoinType.scala | Scala | apache-2.0 | 1,223 |
package com.datastax.spark.connector.japi
import com.datastax.driver.core.{ProtocolVersion, Row}
import com.datastax.spark.connector.GettableData
final class CassandraRow(val columnNames: IndexedSeq[String], val columnValues: IndexedSeq[AnyRef])
extends JavaGettableData with Serializable {
private[spark] def thi... | Stratio/spark-cassandra-connector | spark-cassandra-connector-java/src/main/scala/com/datastax/spark/connector/japi/CassandraRow.scala | Scala | apache-2.0 | 1,820 |
/*
* 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 ... | errantlinguist/phonecontroller | src/main/scala/com/github/errantlinguist/snom/gui/SettingsFrame.scala | Scala | apache-2.0 | 4,160 |
package com.bolour.boardgame.scala.server.domain.json
import org.slf4j.LoggerFactory
import spray.json._
import com.bolour.boardgame.scala.server.domain.{Play, SwapPlay, WordPlay}
import com.bolour.boardgame.scala.server.domain.json.CaseClassFormats._
object PlayJsonProtocol extends DefaultJsonProtocol {
val logg... | azadbolour/boardgame | scala-server/app/com/bolour/boardgame/scala/server/domain/json/PlayJsonProtocol.scala | Scala | agpl-3.0 | 995 |
/**
* Mapping Selector
* Mapping Selector
* Copyright (C) 01/04/16 echinopsii
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your opti... | echinopsii/net.echinopsii.ariane.community.core.mapping | ds/dsl/src/main/scala/net/echinopsii/ariane/community/core/mapping/ds/sdsl/SelectorExecutor.scala | Scala | agpl-3.0 | 2,470 |
package tests.rescala.dynamic
import tests.rescala.testtools.RETests
class ObserverCreation extends RETests {
multiEngined { engine =>
import engine._
test("add Event After") {
var res = 0
val e0 = Evt[Int]()("source")
val e1 = e0.map(identity)("firstMap")
e1.map(_ => e0.map { _ +... | guidosalva/REScala | Code/Main/shared/src/test/scala-2/tests/rescala/dynamic/ObserverCreation.scala | Scala | apache-2.0 | 754 |
package com.twitter.finagle.postgres
import java.nio.charset.Charset
import com.twitter.concurrent.AsyncStream
import com.twitter.finagle.Status
import com.twitter.finagle.postgres.messages.SelectResult
import com.twitter.finagle.postgres.values.Types
import com.twitter.util.Future
trait PostgresClient {
def chars... | finagle/finagle-postgres | src/main/scala/com/twitter/finagle/postgres/PostgresClient.scala | Scala | apache-2.0 | 4,890 |
/*
* Copyright 2014 Kevin Herron
*
* 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 ... | digitalpetri/scala-ethernet-ip | enip-core/src/main/scala/com/digitalpetri/ethernetip/encapsulation/cpf/items/SockaddrItem.scala | Scala | apache-2.0 | 2,249 |
package com.monochromeroad.play.xwiki.rendering.plugin
import play.api._
import com.monochromeroad.play.xwiki.rendering._
import macros.XWikiMacroManager
import scala.Some
/**
* Play Plugin to configure XWiki default renderers
*
* @author Masatoshi Hayashi
*/
class DefaultXWikiRenderingPlugin(app: Application) ex... | literalice/play-xwiki-rendering | src/main/scala/com/monochromeroad/play/xwiki/rendering/plugin/DefaultXWikiRenderingPlugin.scala | Scala | lgpl-2.1 | 1,627 |
package com.mycompany.scalcium.transformers
import scala.io.Source
import scala.util.control.Breaks.{break, breakable}
import com.mycompany.scalcium.tokenizers.Tokenizer
object NegationHandler {
val NegationPrefix = "negate0"
val phraseSrc = Source.fromInputStream(getClass.getResourceAsStream("/negator_phra... | sujitpal/scalcium | src/main/scala/com/mycompany/scalcium/transformers/NegationHandler.scala | Scala | apache-2.0 | 1,181 |
/*
* Copyright 2018-2020 Jan Bessai
*
* 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... | JanBessai/shapeless-feat | src/main/scala-2.13+/shapeless/feat/VersionCompatibility.scala | Scala | apache-2.0 | 712 |
package io.ino.solrs
/**
* Created by magro on 4/29/14.
*/
private[solrs] object HttpUtils {
private val ContentTypePattern = "([a-z]+/[a-z]+)(?:;\\\\s*charset=([^;]+))?".r
def getContentCharSet(contentType: String): Option[String] = {
if (contentType != null) {
// e.g. application/xml; charset=UTF-8
... | inoio/solrs | src/main/scala/io/ino/solrs/HttpUtils.scala | Scala | apache-2.0 | 717 |
//package com.sksamuel.avro4s.schema
//
//import java.time.Instant
//
//import com.sksamuel.avro4s.AvroSchema
//import org.scalatest.matchers.should.Matchers
//import org.scalatest.wordspec.AnyWordSpec
//
//case class Foo(gg: String = "wibble")
//
//class DefaultValueSchemaTest extends AnyWordSpec with Matchers {
//
//... | sksamuel/avro4s | avro4s-core/src/test/scala/com/sksamuel/avro4s/schema/DefaultValueSchemaTest.scala | Scala | apache-2.0 | 6,910 |
package unfiltered.filter
import unfiltered.response.HttpResponse
import unfiltered.request.HttpRequest
import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
import unfiltered.Cookie
import scala.collection.JavaConverters._
class RequestBinding(req: HttpServletRequest) extends HttpRequest(req) {
def i... | omarkilani/unfiltered | filter/src/main/scala/bindings.scala | Scala | mit | 1,979 |
/*
* Copyright (c) <2015-2016>, see CONTRIBUTORS
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list... | amanjpro/languages-a-la-carte | ooj/src/main/scala/typechecker/labelcheckers.scala | Scala | bsd-3-clause | 4,291 |
package org.vertx.scala.router
/**
* @author <a href="http://www.campudus.com/">Joern Bernhardt</a>
*/
case class RouterException(message: String = "",
cause: Throwable = null,
id: String = "UNKNOWN_SERVER_ERROR",
statusCode: Int = 500)... | vert-x/mod-lang-scala | src/main/scala/org/vertx/scala/router/RouterException.scala | Scala | apache-2.0 | 357 |
package com.trifectalabs.polyline
import scala.math.BigDecimal.RoundingMode
object Polyline {
implicit def double2BigDecimal(d: Double): BigDecimal = BigDecimal(d)
implicit def bigDecimal2Double(bd: BigDecimal): Double = bd.toDouble
def encode(coordinates: List[LatLng]): String = {
coordinates.foldLeft[Lis... | trifectalabs/polyline-scala | src/main/scala/Polyline.scala | Scala | mit | 2,858 |
package lila.common
import play.api.http.HeaderNames
import play.api.mvc.RequestHeader
object HTTPRequest {
def isXhr(req: RequestHeader): Boolean =
(req.headers get "X-Requested-With") contains "XMLHttpRequest"
def isSocket(req: RequestHeader): Boolean =
(req.headers get HeaderNames.UPGRADE) ?? (_.toLo... | terokinnunen/lila | modules/common/src/main/HTTPRequest.scala | Scala | mit | 3,324 |
package com.ybrikman.ping.scalaapi.dedupe
import scala.concurrent.ExecutionContext
/**
* Any time you use the DedupingCache, you must add this CacheFilter to your filter chain. This filter will initialize
* the cache for each incoming request and cleanup the cache after you're done processing the request. To avoid ... | carlosFattor/ping-play | big-pipe/src/main/scala/com/ybrikman/ping/scalaapi/dedupe/CacheFilter.scala | Scala | mit | 800 |
/*
* 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 ... | bowenli86/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/table/validation/TemporalTableJoinValidationTest.scala | Scala | apache-2.0 | 3,920 |
/*
* 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... | asorianostratio/incubator-toree | protocol/src/main/scala/org/apache/toree/kernel/protocol/v5/content/ClearOutput.scala | Scala | apache-2.0 | 1,907 |
package org.denigma.threejs.extensions.controls
import org.denigma.threejs._
import org.scalajs.dom
trait IntersectionControls
{
def camera:Camera
def scene:Object3D
val raycaster = new Raycaster()
var intersections = List.empty[Intersection]
var underMouse = Map.empty[Object3D, List[Intersection]]
var... | waman/threejs-facade | facade/src/main/scala/org/denigma/threejs/extensions/controls/IntersectionControls.scala | Scala | mpl-2.0 | 1,466 |
package org.apache.spark.asyspark.core.serialization
/**
* A very fast primitive serializer using sun's Unsafe to directly read/write memory regions in the JVM
*
* @param size The size of the serialized output (in bytes)
*/
private class FastPrimitiveSerializer(size: Int) {
val bytes = new Array[Byte](size)... | CASISCAS/asyspark | src/main/scala/org/apache/spark/asyspark/core/serialization/FastPrimitiveSerializer.scala | Scala | mit | 2,452 |
package net.thereturningvoid.bladebot.command
import net.dv8tion.jda.MessageBuilder
import net.dv8tion.jda.events.message.MessageReceivedEvent
import scala.collection.JavaConversions._
class AvatarCommand extends Command {
override def getName: String = "Get User Avatars"
override def getDescription: String = "... | TheReturningVoid/BladeBot | src/main/scala/net/thereturningvoid/bladebot/command/AvatarCommand.scala | Scala | mit | 1,577 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author Matthew Saltz, John Miller
* @version 1.2
* @date Fri Jul 10 12:39:33 EDT 2015
* @see LICENSE (MIT style license file).
*/
package scalation.graphalytics
import java.io.PrintWriter
import scala.collection.immut... | NBKlepp/fda | scalation_1.2/src/main/scala/scalation/graphalytics/GraphIO.scala | Scala | mit | 9,236 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Algolia
* http://www.algolia.com/
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation... | algolia/algoliasearch-client-scala | src/test/scala/algolia/dsl/SendTest.scala | Scala | mit | 6,117 |
package com.twitter.finagle.netty4
import org.scalatest.FunSuite
import com.twitter.finagle.Stack
class ParamTest extends FunSuite {
test("WorkerPool is global") {
val params = Stack.Params.empty
// make sure that we have referential equality across
// param invocations.
val e0 = params[param.Worker... | luciferous/finagle | finagle-netty4/src/test/scala/com/twitter/finagle/netty4/ParamTest.scala | Scala | apache-2.0 | 421 |
package organizing_data.change_value_to_reference.before
class Order(private var customerName: String){
//Custmoer对象还是值对象。就算多份订单属于同一客户,但每个Order对象还是拥有各自的Customer对象。
//改成每个客户名称对应一个Customer对象。
private var _customer: Customer = new Customer(customerName)
def setCustomerName(customerName: String) = {
_customer... | zj-lingxin/refactoring | src/main/scala/organizing_data/change_value_to_reference/before/Order.scala | Scala | mit | 655 |
package ch.becompany.social.github
import com.typesafe.scalalogging.LazyLogging
import org.scalatest.FlatSpec
import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
class GithubClientSpec extends FlatSpec with LazyLogging {
import GithubClient._
... | becompany/akka-social-stream | src/test/scala/ch/becompany/social/github/GithubClientSpec.scala | Scala | apache-2.0 | 517 |
package spray.client
import akka.actor.ActorSystem
import helpers.WithoutEqualizer
import org.scalatest.FunSpec
import spray.httpx.SprayJsonSupport
import spray.json.DefaultJsonProtocol._
import spray.json.JsonFormat
class SendReceiveSpec extends FunSpec with SprayJsonSupport with WithoutEqualizer {
it("Example us... | msimav/spray-contrib-scalaz | src/test/scala/spray/client/SendReceiveSpec.scala | Scala | mit | 1,783 |
package org.scalatra.test
import java.io.InputStream
import collection.DefaultMap
case class ResponseStatus(code: Int, message: String)
import collection.JavaConverters._
abstract class ClientResponse {
def bodyBytes: Array[Byte]
def inputStream: InputStream
def statusLine: ResponseStatus
def headers: Map[S... | etorreborre/scalatra | test/src/main/scala/org/scalatra/test/ClientResponse.scala | Scala | bsd-2-clause | 1,813 |
package integration
import org.joda.time.DateTime
import org.scalatestplus.play.OneAppPerSuite
import traits.TestBuilder
/**
* Created by unoedx on 06/05/16.
*/
class ListPerformanceTest extends TestBuilder {
var list:List[DateTime] = List()
for(i <- 1 to 100000) {
list = DateTime.now().minusSeconds(i)... | waveinch/ses-transactional | test/integration/ListPerformanceTest.scala | Scala | apache-2.0 | 545 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Algolia
* http://www.algolia.com/
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation... | algolia/algoliasearch-client-scala | src/main/scala/algolia/AlgoliaClient.scala | Scala | mit | 9,430 |
/*
* 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 ... | pgandhi999/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeTestUtils.scala | Scala | apache-2.0 | 3,367 |
package castalia.matcher
import akka.actor._
import akka.http.scaladsl.model.StatusCodes._
import akka.pattern.{ask, pipe}
import akka.util.Timeout
import castalia.matcher.MatchResultGatherer.{MatchFound, MatchNotFound}
import castalia.model.Model.StubResponse
import scala.concurrent.ExecutionContext.Implicits.global... | TimSoethout/stubserver | src/main/scala/castalia/matcher/MatchResultGatherer.scala | Scala | mit | 2,436 |
package scalaz.stream
import scalaz.\\/
import scalaz.stream.Process.Halt
import Cause._
/**
* Defines termination cause for the process.
* Cause is always wrapped in `Halt` and controls process flow.
*/
sealed trait Cause {
/**
* Produces a cause that was caused by `cause`
* @param cause
* @return
*... | drostron/scalaz-stream | src/main/scala/scalaz/stream/Cause.scala | Scala | mit | 3,415 |
/*
* 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 ... | fhueske/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/stream/table/TwoStageAggregateTest.scala | Scala | apache-2.0 | 3,664 |
import controllers.ControllerSupport
import play.api.libs.concurrent.Akka
import play.api.mvc.RequestHeader
import play.api.{Application, GlobalSettings}
import scala.concurrent.Future
object Global extends GlobalSettings with ControllerSupport{
override def onStart(app: Application) {
super.onStart(app)
pla... | semberal/homelibrary | app/Global.scala | Scala | apache-2.0 | 860 |
package org.tearne.crosser.cross
import org.junit.runner.RunWith
import org.tearne.crosser.plant.ConcretePlant
import org.tearne.crosser.plant.Species
import org.tearne.crosser.plant.Plant
import org.scalatest.FreeSpec
import org.scalatest.mock.MockitoSugar
import org.mockito.Mockito._
class CrossTest extends FreeSpe... | tearne/Crosser | src/test/scala/org/tearne/crosser/cross/CrossTest.scala | Scala | apache-2.0 | 2,224 |
package jp.co.bizreach.play2handlebars
import org.scalatest.FunSpec
class Product2MapSpec extends FunSpec {
describe("Product2Map") {
describe("when the case class has symbolic name fields") {
it("should extract values") {
case class TestClass(** : String, && : Int, !! : Boolean)
val valu... | bizreach/play2-handlebars | src/test/scala/jp/co/bizreach/play2handlebars/Product2MapSpec.scala | Scala | apache-2.0 | 462 |
package examples.extended
import java.lang.Integer.{MAX_VALUE, MIN_VALUE}
import com.twitter.finagle.Service
import com.twitter.finagle.http.Method.Get
import com.twitter.finagle.http.{Request, Status}
import io.fintrospect.ContentTypes.APPLICATION_JSON
import io.fintrospect.RouteSpec
import io.fintrospect.formats.Ar... | daviddenton/fintrospect | src/main/scala/examples/extended/BookTermSearch.scala | Scala | apache-2.0 | 975 |
import scala.meta._
object Test {
val v = Version()
}
| som-snytt/dotty | tests/pos/i2551/test_2.scala | Scala | apache-2.0 | 57 |
/*
* Copyright 2019 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/frontend-bootstrap | src/main/scala/uk/gov/hmrc/play/frontend/filters/CacheControlFilter.scala | Scala | apache-2.0 | 2,041 |
package dpla.ingestion3.mappers.providers
import dpla.ingestion3.mappers.utils.Document
import dpla.ingestion3.messages.{IngestMessage, MessageCollector}
import dpla.ingestion3.model._
import dpla.ingestion3.utils.FlatFileIO
import org.json4s.JsonAST.JValue
import org.json4s.jackson.JsonMethods.parse
import org.scalat... | dpla/ingestion3 | src/test/scala/dpla/ingestion3/mappers/providers/NYPLMappingTest.scala | Scala | mit | 4,624 |
package mgoeminne.scalaggplot.coord
/**
* The Cartesian coordinate system is the most familiar, and common, type of coordinate system.
* Setting limits on the coordinate system will zoom the plot (like you're looking at it with a magnifying glass),
* and will not change the underlying data like setting limits on a ... | mgoeminne/scala-ggplot | src/main/scala/mgoeminne/scalaggplot/coord/cartesian.scala | Scala | lgpl-3.0 | 619 |
/*
* 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 ... | bravo-zhang/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala | Scala | apache-2.0 | 41,103 |
package controllers
import java.sql.Connection
import javax.inject.{Inject, Singleton}
import constraints.FormConstraints
import controllers.NeedLogin.Authenticated
import helpers.Sanitize.{forUrl => sanitize}
import models._
import play.api.data.Form
import play.api.data.Forms._
import play.api.data.validation.Const... | ruimo/store2 | app/controllers/EntryUserEntry.scala | Scala | apache-2.0 | 7,222 |
/*
* 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 ... | drubbo/SparkGIS | src/main/scala/org/betterers/spark/gis/package.scala | Scala | apache-2.0 | 967 |
package elea
import elea.term._
import scalaz._
import Scalaz._
sealed trait Statement {
def apply(program: Program): Program
}
case class OldTermDef(name: String, term: Term) extends Statement {
def apply(program: Program) = program + (name -> term.withName(name))
def modifyTerm(f: Term => Term)... | wsonnex/elea | src/main/scala/elea/OldParser.scala | Scala | mit | 6,630 |
package finatra.quickstart
import com.google.inject.testing.fieldbinder.Bind
import com.twitter.finagle.http.Status._
import com.twitter.finatra.http.test.{EmbeddedHttpServer, HttpTest}
import com.twitter.inject.Mockito
import com.twitter.inject.server.FeatureTest
import com.twitter.util.Future
import finatra.quicksta... | joecwu/finatra | examples/twitter-clone/src/test/scala/finatra/quickstart/TwitterCloneFeatureTest.scala | Scala | apache-2.0 | 2,816 |
/*
* Copyright 2012 OneCalendar
*
* 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... | OneCalendar/OneCalendar | app/controllers/EventsController.scala | Scala | apache-2.0 | 2,921 |
/*
* Copyright 2014–2017 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | drostron/quasar | effect/src/main/scala/quasar/effect/LiftedOps.scala | Scala | apache-2.0 | 934 |
package org.company.app.models
import com.plasmaconduit.json.codegen.traits._
case class User(id: Int, username: String, password: String, email: String, items: List[Item], lastPurchase: Option[Item]) extends GenWriter with GenReader {
override val writerRep = GenObjectRep(Ignore("password"))
}
| Agrosis/jcg | examples/src/main/scala/org/company/app/models/User.scala | Scala | mit | 300 |
/*
* 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 ... | ueshin/apache-flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/Optimizer.scala | Scala | apache-2.0 | 1,696 |
/*
* 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 | airframe-benchmark/src/main/scala/wvlet/airframe/benchmark/BenchmarkMain.scala | Scala | apache-2.0 | 4,341 |
package net.gadgil
object Stub {
def main(args: Array[String]) {
// do something
}
}
class Stub {
// do something
}
| navaidya/optionpricing | scenariomodeling/src/main/scala/Stub.scala | Scala | mit | 127 |
package de.tu_berlin.formic.gatling.action.linear
import de.tu_berlin.formic.client.FormicSystem
import de.tu_berlin.formic.common.DataStructureInstanceId
import de.tu_berlin.formic.datastructure.linear.client.FormicString
import de.tu_berlin.formic.gatling.action.TimeMeasureCallback.CreateResponseTimeMeasureListener
... | rbraeunlich/formic | formic-gatling/src/main/scala/de/tu_berlin/formic/gatling/action/linear/LinearCreation.scala | Scala | apache-2.0 | 1,739 |
/*
* Copyright (C) 2014 - 2019 Dennis Vriend <https://github.com/dnvriend>
* Copyright (C) 2019 - 2021 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.persistence.jdbc.journal
import scala.concurrent.duration._
import akka.actor.Props
import akka.persistence.CapabilityFlag
import akka.persistence.jdbc.... | dnvriend/akka-persistence-jdbc | core/src/test/scala/akka/persistence/jdbc/journal/JdbcJournalPerfSpec.scala | Scala | apache-2.0 | 4,049 |
package com.emotioncity.soriento
import com.emotioncity.soriento.ReflectionUtils._
import com.emotioncity.soriento.testmodels._
import com.orientechnologies.orient.core.id.ORecordId
import org.scalatest.{BeforeAndAfter, FunSuite, Matchers}
/**
* Created by stream on 25.12.14.
*/
class ReflectionTest extends FunSu... | b0c1/Soriento | src/test/scala/com/emotioncity/soriento/ReflectionTest.scala | Scala | apache-2.0 | 2,372 |
package pep_043
object solution {
@deprecated("Check not needed", "ever")
def isPandigital09(n: Seq[Int]): Boolean = n.forall(_ < 10) && n.toSet.size == 10
def primaryProperty(n: Seq[Int]): Boolean = {
val divisors = Seq(2, 3, 5, 7, 11, 13, 17)
val triplets = n.sliding(3).drop(1).map(_.mkString).map(_... | filippovitale/pe | pe-solution/src/main/scala/pep_043/solution.scala | Scala | mit | 572 |
/*
* 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/computations/CP99.scala | Scala | apache-2.0 | 1,465 |
package org.jetbrains.plugins.scala
package util.macroDebug
import java.awt.event.MouseEvent
import java.util
import com.intellij.psi._
import lang.psi.api.ScalaFile
import org.jetbrains.plugins.scala.icons.Icons
import com.intellij.codeHighlighting.Pass
import com.intellij.codeInsight.daemon._
import com.intellij.co... | SergeevPavel/intellij-scala | src/org/jetbrains/plugins/scala/util/macroDebug/GoToExpandedMacroCallProviderExt.scala | Scala | apache-2.0 | 3,310 |
import scala.reflect.runtime.universe._
class ImaginaryCanBuildFrom[-From, -Elem, +To]
class CompletelyIndependentList[+A] {
type Repr <: CompletelyIndependentList[A]
def map[B, That](f: A => B)(implicit cbf: ImaginaryCanBuildFrom[Repr, B, That]): That = ???
def distinct(): CompletelyIndependentList[A] = ???
}
... | folone/dotty | tests/pending/run/fail-non-value-types.scala | Scala | bsd-3-clause | 1,378 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.scaladsl.registry
import java.net.URI
import akka.NotUsed
import akka.util.ByteString
import com.lightbend.lagom.scaladsl.api.deser.MessageSerializer.{ NegotiatedDeserializer, NegotiatedSerializer }
impor... | edouardKaiser/lagom | dev/service-registry/devmode-scaladsl/src/main/scala/com/lightbend/lagom/internal/scaladsl/registry/ServiceRegistry.scala | Scala | apache-2.0 | 3,449 |
package gie.ut
import org.scalatest._
import org.scalatest.matchers.ShouldMatchers._
import net.liftweb.common.{Full, Loggable}
import net.liftweb.util.Props
import java.io.FileInputStream
class dummy_test extends FlatSpec with PrivateMethodTester with Loggable {
} | igorge/gbb | src/test/scala/dummy_ut.scala | Scala | gpl-2.0 | 269 |
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "networkblame"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
//jdbc,
//anorm
"org.reactivemongo" %% "play2-reactivemongo" % "0.... | lukiano/networkblame | project/Build.scala | Scala | mit | 481 |
package edu.uw.at.iroberts.wirefugue.pcap
import akka.util.ByteString
import edu.uw.at.iroberts.wirefugue.protocol.overlay.EtherType
import org.apache.kafka.common.serialization.Serializer
import scala.collection.mutable.ArrayBuffer
/**
* Created by Ian Robertson <iroberts@uw.edu> on 4/5/17.
*/
/** IP proto... | robertson-tech/wirefugue | sensor/src/main/scala/edu/uw/at/iroberts/wirefugue/pcap/Datagram.scala | Scala | gpl-3.0 | 6,326 |
/**
* Copyright (C) 2010 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 pr... | orbeon/orbeon-forms | src/main/scala/org/orbeon/oxf/xml/ElementFilterXMLReceiver.scala | Scala | lgpl-2.1 | 2,387 |
// scalac: -opt:l:none
//
// See comment in BCodeBodyBuilder
// -target:jvm-1.6 -opt:l:none
// target enables stack map frame generation
class C {
// can't just emit a call to ???, that returns value of type Nothing$ (not Int).
def f1: Int = ???
def f2: Int = throw new Error("")
def f3(x: Boolean) = {
v... | lrytz/scala | test/files/run/nothingTypeNoOpt.scala | Scala | apache-2.0 | 1,211 |
/*
* 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 | prac/src/main/scala/org/openurp/prac/innovation/model/StageType.scala | Scala | lgpl-3.0 | 1,224 |
package com.sksamuel.avro4s
import org.apache.avro.Schema
import org.apache.avro.generic.IndexedRecord
/**
* Brings together [[ToRecord]] and [[FromRecord]] in a single interface.
*/
trait RecordFormat[T] extends ToRecord[T] with FromRecord[T] with Serializable
/**
* Returns a [[RecordFormat]] that will conver... | sksamuel/avro4s | avro4s-core/src/main/scala/com/sksamuel/avro4s/RecordFormat.scala | Scala | apache-2.0 | 654 |
/*
Copyright 2013 Ilya Lakhin (Илья Александрович Лахин)
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... | Eliah-Lakhin/papa-carlo | src/main/scala/name.lakhin.eliah.projects/papacarlo/lexis/Matcher.scala | Scala | apache-2.0 | 4,190 |
package com.eevolution.context.dictionary.infrastructure.repository
import com.eevolution.context.dictionary.domain.model.MigrationStep
import com.eevolution.context.dictionary.infrastructure.db.DbContext._
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is ... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/repository/MigrationStepMapping.scala | Scala | gpl-3.0 | 2,060 |
/* Copyright (C) 2011 Mikołaj Sochacki mikolajsochacki AT gmail.com
* This file is part of VRegister (Virtual Register - Wirtualny Dziennik)
* LICENCE: GNU AFFERO GENERAL PUBLIC LICENS Version 3 (AGPLv3)
* See: <http://www.gnu.org/licenses/>.
*/
package eu.brosbit.opos.model.page
import _root_.net.liftweb.... | mikolajs/osp | src/main/scala/eu/brosbit/opos/model/page/ForumThreadContent.scala | Scala | agpl-3.0 | 1,145 |
package builder
import builder.api_json.{ApiJsonServiceValidator, ServiceJsonServiceValidator}
import io.apibuilder.api.v0.models.{Original, OriginalType}
import io.apibuilder.spec.v0.models.Service
import core.{ServiceFetcher, VersionMigration}
import lib.{ServiceConfiguration, ServiceValidator}
import io.apibuilder.... | apicollective/apibuilder | core/src/main/scala/core/builder/OriginalValidator.scala | Scala | mit | 1,783 |
package org.orbeon.oxf.xforms
import org.orbeon.oxf.util.StaticXPath
import org.orbeon.oxf.xml.dom.Converter._
import org.scalatest.funspec.AnyFunSpec
class XFormsStaticElementValueTest extends AnyFunSpec {
describe("Extract expression or constant from LHHA element") {
val Expected = List(
(
"e... | orbeon/orbeon-forms | xforms-compiler/jvm/src/test/scala/org/orbeon/oxf/xforms/XFormsStaticElementValueTest.scala | Scala | lgpl-2.1 | 3,715 |
package com.krux.hyperion.activity
import com.typesafe.config.ConfigFactory
import org.scalatest.FlatSpec
import org.scalatest.Matchers._
import com.krux.hyperion.adt.HString
import com.krux.hyperion.HyperionContext
import com.krux.hyperion.resource.SparkCluster
class SparkTaskActivitySpec extends FlatSpec {
impli... | sethyates/hyperion | core/src/test/scala/com/krux/hyperion/activity/SparkTaskActivitySpec.scala | Scala | apache-2.0 | 1,143 |
package com.sksamuel.elastic4s.indexes
import com.sksamuel.elastic4s.http.ElasticDsl
import com.sksamuel.elastic4s.testkit.ResponseConverterImplicits._
import com.sksamuel.elastic4s.testkit.{DualClient, DualElasticSugar}
import org.scalatest.{Matchers, WordSpec}
class DeleteIndexTest extends WordSpec with Matchers wi... | aroundus-inc/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/indexes/DeleteIndexTest.scala | Scala | apache-2.0 | 1,750 |
package pl.arapso.scaffoldings.scala.funproginscala
abstract class MyBoolean {
def ifThenElse[T](t: T, e: T): T
def && (other: MyBoolean) = ifThenElse(MyTrue, other)
}
object MyTrue extends MyBoolean {
override def ifThenElse[T](t: T, e: T): T = t
}
object MyFalse extends MyBoolean {
override def ifThenEl... | arapso-scaffoldings/scala | scala-tutor/custom/src/main/scala/pl/arapso/scaffoldings/scala/funproginscala/Boolean.scala | Scala | apache-2.0 | 461 |
trait Elems {
sealed class Elem[A] extends Dummy
val UnitElement: Elem[Unit]
trait Dummy
}
class BadMatch[A <: Elems](a: A) {
private def toLuaValue(eX: a.Elem[_]): String = eX match {
case a.UnitElement => "" // type mismatch
}
} | som-snytt/dotty | tests/patmat/t9779.scala | Scala | apache-2.0 | 247 |
/*
* Copyright 2010 Michael Fortin <mike@brzy.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 la... | m410/calista | src/main/scala/org/brzy/calista/results/Row.scala | Scala | apache-2.0 | 2,043 |
package circumflex
package web
import core._
import collection.Iterator
import collection.mutable.Map
/*!# Parameters
The `param` object of is a convenient helper which is used to
retrieve the parameters of current match or current request:
* the parameters are first resolved from `MatchResult` objects fou... | inca/circumflex | web/src/main/scala/param.scala | Scala | bsd-2-clause | 1,606 |
/*
* The Simplified BSD Licence follows:
* Copyright (c) 2014, Jeshan G. BABOOA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above ... | jeshan/log4janalyser | src/main/scala/co/jeshan/code/log4janalyser/utils/extended/LogFilePatternReceiverExtended.scala | Scala | bsd-2-clause | 3,101 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.scala2_11.scalatest2_1_7
import org.jetbrains.plugins.scala.testingSupport.scalatest.finders.FindersApiTest
/**
* @author Roman.Shein
* @since 10.02.2015.
*/
class Scalatest2_11_2_1_7_FindersApiTest extends Scalatest2_11_2_1_7_Base with FindersApiTest {
... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/scalatest/scala2_11/scalatest2_1_7/Scalatest2_11_2_1_7_FindersApiTest.scala | Scala | apache-2.0 | 322 |
package com.campudus.scycle.vdom
import com.campudus.scycle.dom._
import com.campudus.scycle.vdom.VirtualDom.{Insertion, Path, Replacement}
import org.scalajs.dom
import org.scalatest.FunSpec
class VirtualDomTest extends FunSpec {
describe("scalajs test setup") {
it("can tell if two divs are the same") {
... | Narigo/scalajs-fun | scycle/src/test/scala/com/campudus/scycle/vdom/VirtualDomTest.scala | Scala | mit | 17,132 |
/***********************************************************************
* Copyright (c) 2013-2015 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 is ... | drackaer/geomesa | geomesa-features/geomesa-feature-avro/src/main/scala/org/locationtech/geomesa/features/avro/serde/Version2Deserializer.scala | Scala | apache-2.0 | 1,378 |
/*
* Copyright 2017 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | liquidarmour/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/CP278.scala | Scala | apache-2.0 | 962 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | mdzimmerman/geomesa | geomesa-kafka/geomesa-kafka-08-utils/src/main/scala/org/locationtech/geomesa/kafka08/ZkUtils08.scala | Scala | apache-2.0 | 3,336 |
/*
* 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... | monifu/monifu | monix-reactive/shared/src/main/scala/monix/reactive/Observable.scala | Scala | apache-2.0 | 250,934 |
/*
* Copyright (c) 2014 Contributor. All rights reserved.
*/
package dotty.tools.dotc.classpath
import java.io.File
import java.net.URL
import dotty.tools.io.{ AbstractFile, FileZipArchive }
import FileUtils.AbstractFileOps
import dotty.tools.io.{ClassPath, ClassRepresentation}
/**
* A trait allowing to look for ... | som-snytt/dotty | compiler/src/dotty/tools/dotc/classpath/ZipArchiveFileLookup.scala | Scala | apache-2.0 | 2,779 |
package org.littlewings.lucene.kuromoji
import scala.language.postfixOps
import scala.sys.process._
import java.io.{File, ByteArrayInputStream, StringReader}
import java.nio.charset.StandardCharsets
import org.apache.lucene.analysis.ja.dict.ConnectionCosts
import org.apache.lucene.analysis.ja.{GraphvizFormatter, Jap... | kazuhira-r/lucene-examples | lucene-kuromoji-viterbi/src/main/scala/org/littlewings/lucene/kuromoji/KuromojiViterbi.scala | Scala | mit | 1,085 |
package org.flowpaint.model2
/**
*
*/
case class Vec2i(var x: Int, var y: Int) {
def swap(other: Vec2i) {
val tx = other.x
val ty = other.y
other.x = x
other.y = y
x = tx
y = ty
}
}
| zzorn/flowpaint | src/main/scala/org/flowpaint/model2/Vec2i.scala | Scala | gpl-2.0 | 215 |
package demo.components.semanticui
import chandu0101.macros.tojs.GhPagesMacros
import chandu0101.scalajs.react.components.ReactMouseEventB
import chandu0101.scalajs.react.components.materialui._
import chandu0101.scalajs.react.components.semanticui.SuiButton
import demo.components.CodeExample
import japgolly.scalajs.r... | rleibman/scalajs-react-components | demo/src/main/scala/demo/components/semanticui/SuiButtonDemo.scala | Scala | apache-2.0 | 1,007 |
import sbt._
import sbt.Keys._
object BuildSettings {
val buildVersion = "0.12.0-SNAPSHOT"
val buildSettings = Defaults.defaultSettings ++ Seq(
organization := "org.reactivemongo",
version := buildVersion,
scalaVersion := "2.11.6",
scalacOptions ++= Seq("-unchecked", "-deprecation", "-target:jvm-1... | fr3akX/Play-ReactiveMongo | project/Play2-ReactiveMongo.scala | Scala | apache-2.0 | 6,668 |
package sttp.client3
import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException}
import sttp.monad.MonadError
import scala.annotation.tailrec
/** Known exceptions that might occur when using a backend. Currently this covers:
* - connect exceptions: when a connection (tcp socket) can't be established ... | softwaremill/sttp | core/src/main/scala/sttp/client3/SttpClientException.scala | Scala | apache-2.0 | 3,448 |
/*
* 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/ShouldFullyMatchSpec.scala | Scala | apache-2.0 | 94,133 |
package im.tox.antox.callbacks
import android.content.Context
class AntoxOnGroupJoinRejectedCallback(private var ctx: Context) /* extends GroupJoinRejectedCallback */ {
private var reconnecting = false
/* override def groupJoinRejected(groupNumber: Int, reason: ToxGroupJoinRejected): Unit = {
if (reason == T... | Ansa89/Antox | app/src/main/scala/im/tox/antox/callbacks/AntoxOnGroupJoinRejectedCallback.scala | Scala | gpl-3.0 | 1,026 |
/*
* Copyright (C) 2012 Julien Letrouit
*
* 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... | jletroui/frac | src/main/scala/frac/StringRenderer.scala | Scala | apache-2.0 | 964 |
package org.lolczak.common.util
import org.scalatest.{FlatSpec, Matchers}
class ResourceHelperSpec extends FlatSpec with Matchers {
"A resource helper" should "load string content of resource" in {
import Resources._
resource"test.txt" shouldBe "test"
}
}
| lolczak/scala-commons | src/test/scala/org/lolczak/common/util/ResourceHelperSpec.scala | Scala | apache-2.0 | 272 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | heuermh/bdg-avocado | avocado-core/src/main/scala/org/bdgenomics/avocado/util/RewriteHets.scala | Scala | apache-2.0 | 5,901 |
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.