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 services
import models.Location.LocationBSONWriter
import models.{Location, Site}
import play.Logger
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import reactivemongo.api.Cursor
import reactivemongo.bson.{BSONDocument, BSONRegex}
import scala.concurrent.Future
/**
* User: Louis TOURNAY... | louidji/eventual | app/services/SitesDAO.scala | Scala | gpl-3.0 | 2,275 |
/*
* MUSIT is a museum database to archive natural and cultural history data.
* Copyright (C) 2016 MUSIT Norway, part of www.uio.no (University of Oslo)
*
* 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 Softw... | kpmeen/musit | service_storagefacility/app/models/storage/LifeCycle.scala | Scala | gpl-2.0 | 1,056 |
package com.twitter.zipkin.collector
import com.twitter.conversions.time._
import com.twitter.finagle.stats.{DefaultStatsReceiver, StatsReceiver}
import com.twitter.logging.Logger
import com.twitter.util.{Duration, Future}
/**
* This queue inherits from ItemQueue but instead of throwing an exception when its full it... | srijs/zipkin | zipkin-collector/src/main/scala/com/twitter/zipkin/collector/BlockingItemQueue.scala | Scala | apache-2.0 | 1,147 |
import java.net.InetSocketAddress
import akka.actor.{ActorSystem, Props}
import scavlink.ScavlinkInstance
import scavlink.connection.serial.{Serial, SerialClientSettings}
import scavlink.connection.tcp.TcpClientSettings
import scavlink.connection.udp.UdpListenerSettings
import scavlink.test.PacketPrinter
import scala... | nickolasrossi/scavlink | src/it/scala/Headless.scala | Scala | mit | 1,142 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ddseapy/geomesa | geomesa-arrow/geomesa-arrow-gt/src/test/scala/org/locationtech/geomesa/arrow/io/DictionaryBuildingWriterTest.scala | Scala | apache-2.0 | 2,257 |
/*
* Copyright © 2015-2019 the contributors (see Contributors.md).
*
* This file is part of Knora.
*
* Knora 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
*... | musicEnfanthen/Knora | webapi/src/main/scala/org/knora/webapi/routing/v2/SearchRouteV2.scala | Scala | agpl-3.0 | 20,696 |
/*
* 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 | text/src/test/scala/org/beangle/commons/text/inflector/en/EnNounPluralizerTest.scala | Scala | lgpl-3.0 | 1,080 |
package com.krrrr38.halty
sealed trait Chunk
sealed trait Block extends Chunk
sealed trait TemporaryBlock extends Block // only for parsing
sealed trait HeaderTag
case object H3 extends HeaderTag
case object H4 extends HeaderTag
case object H5 extends HeaderTag
case class Header(tag: HeaderTag, inline: Inline) extend... | krrrr38/halty | src/main/scala/com/krrrr38/halty/Chunk.scala | Scala | mit | 1,568 |
package com.github.comco.amsconc
object PGA {
type Label = String
sealed trait Instruction {
import Instruction._
// Returns a string representation of this instruction.
lazy val toCompactString: String = this match {
case Basic(label) => label
case Termination => "!"
case PositiveT... | comco/amsconc | src/main/scala/com/github/comco/amsconc/PGA.scala | Scala | apache-2.0 | 9,932 |
/*******************************************************************************
* Copyright 2017 Capital One Services, LLC and Bitwise, 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... | capitalone/Hydrograph | hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/components/AWSS3FileTransferComponent.scala | Scala | apache-2.0 | 1,880 |
/*******************************************************************************
* Copyright (c) 2014 Łukasz Szpakowski.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MP... | luckboy/Purfuncor | src/main/scala/pl/luckboy/purfuncor/frontend/typer/TypeInferenceEnvironmentState.scala | Scala | mpl-2.0 | 3,325 |
/*
mls: basic machine learning algorithms for Scala
Copyright (C) 2014 Davi Pereira dos Santos
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | javadba/mls | src/main/scala/ml/classifiers/Learner.scala | Scala | gpl-3.0 | 2,484 |
/**
* Copyright (c) 2016 LIBBLE team supervised by Dr. Wu-Jun LI at Nanjing University.
* All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/lic... | syh6585/LIBBLE-Spark | src/main/scala/linalg/VectorsOp.scala | Scala | apache-2.0 | 13,447 |
object Test {
def main(args: Array[String]) {
/*start*/CaseClass.curried/*end*/
}
}
// the companion object extends AbstractFunction2 which has for example the 'curried' method
case class CaseClass(x: Int, y: Int)
//Int => Int => CaseClass | triplequote/intellij-scala | scala/scala-impl/testdata/typeInference/bugs5/SCL3801A.scala | Scala | apache-2.0 | 248 |
package com.tribbloids.spookystuff.utils.io
object WriteMode extends Enumeration {
sealed abstract class Effective extends WriteMode
object CreateOnly extends Effective
object Overwrite extends Effective
object Append extends Effective
//TODO: add back with some high-level implementation using apache-io N... | tribbloid/spookystuff | mldsl/src/main/scala/com/tribbloids/spookystuff/utils/io/WriteMode.scala | Scala | apache-2.0 | 400 |
/*
* 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 ... | chuckchen/spark | sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala | Scala | apache-2.0 | 28,138 |
class X
val x = new X
val y = x : x.type
object Overload {
def foo(arg: Any) = 1
def foo(arg: x.type) = 2
}
println(Overload.foo(x))
println(Overload.foo(y : y.type))
/*
Šta je rezultat rada programa?
(A)
1
1
(B)
1
2
(C)
2
1
(D)
2
2
*/ | HeapSpace/brainiacs | mozgalice/scala/02-OverloadLord.scala | Scala | bsd-3-clause | 249 |
/*
* Packet.scala
* (ScalaOSC)
*
* Copyright (c) 2008-2021 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.osc
import java.io.Pr... | Sciss/ScalaOSC | shared/src/main/scala/de/sciss/osc/Packet.scala | Scala | lgpl-2.1 | 12,304 |
package org.camunda.feel.syntaxtree
import org.camunda.feel._
/**
* @author Philipp Ossler
*/
sealed trait Exp
sealed trait Comparison extends Exp {
val x: Exp
val y: Exp
}
case object ConstNull extends Exp
case object ConstInputValue extends Exp
case class ConstNumber(value: Number) extends Exp
case cla... | saig0/feel | feel-engine/src/main/scala/org/camunda/feel/syntaxtree/Exp.scala | Scala | apache-2.0 | 3,359 |
package org.scalatest.concurrent
import org.scalatest.FeatureSpec
import org.scalatest.time.{Millis, Seconds, Span}
class IntegrationPatienceSpec extends FeatureSpec with Eventually with IntegrationPatience {
feature("IntegrationPatience") {
scenario("User mixes in after Eventually") {
// It should compil... | svn2github/scalatest | src/test/scala/org/scalatest/concurrent/IntegrationPatienceSpec.scala | Scala | apache-2.0 | 566 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.docs
import java.io.Closeable
import akka.stream.scaladsl.StreamConverters
import play.api.http._
import play.api.mvc._
import play.core.{ BuildDocHandler, PlayVersion }
import play.doc._
/**
* Used by the DocumentationApplic... | Shenker93/playframework | framework/src/play-docs/src/main/scala/play/docs/DocumentationHandler.scala | Scala | apache-2.0 | 4,169 |
/*
* 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 ... | ing-bank/scruid | src/main/scala/com/ing/wbaa/druid/definitions/Dimension.scala | Scala | apache-2.0 | 2,284 |
/*
* 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/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala | Scala | apache-2.0 | 22,066 |
/*
* 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/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeRowJoiner.scala | Scala | apache-2.0 | 12,134 |
package lila.video
import org.joda.time.DateTime
import play.api.libs.json._
import play.api.libs.ws.JsonBodyReadables._
import play.api.libs.ws.StandaloneWSClient
import scala.concurrent.Future
import lila.common.config._
final private[video] class Youtube(
ws: StandaloneWSClient,
url: String,
apiKey: S... | luanlv/lila | modules/video/src/main/Youtube.scala | Scala | mit | 3,214 |
/*
* Copyright (c) 2015 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org... | snowplow/spark-streaming-example-project | src/main/scala/com.snowplowanalytics.spark/streaming/SimpleEvent.scala | Scala | apache-2.0 | 2,185 |
/*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictio... | adamcin/scalamojo-maven-plugin | src/main/scala/net/adamcin/scalamojo/ScalaDocStringer.scala | Scala | unlicense | 13,445 |
package im.tox.antox.activities
import java.io.{File, IOException}
import java.util.Date
import android.app.{Activity, AlertDialog}
import android.content.{CursorLoader, DialogInterface, Intent, SharedPreferences}
import android.database.Cursor
import android.net.Uri
import android.os.{Build, Bundle, Environment}
imp... | afkgeek/Antox | app/src/main/scala/im/tox/antox/activities/ChatActivity.scala | Scala | gpl-3.0 | 9,611 |
package beam.agentsim.agents
import beam.integration.IntegrationSpecCommon
import beam.sim.config.{BeamConfig, MatSimBeamConfigBuilder}
import beam.sim.population.DefaultPopulationAdjustment
import beam.sim.{BeamHelper, BeamScenario, BeamServices}
import beam.utils.FileUtils
import org.matsim.api.core.v01.Scenario
imp... | colinsheppard/beam | src/test/scala/beam/agentsim/agents/GenericEventsSpec.scala | Scala | gpl-3.0 | 2,037 |
package spire.std
import scala.collection.TraversableLike
import scala.collection.generic.CanBuildFrom
import spire.algebra.Monoid
@SerialVersionUID(0L)
final class IterableMonoid[A, SA <: TraversableLike[A, SA]](implicit cbf: CanBuildFrom[SA, A, SA])
extends Monoid[SA] with Serializable {
def id: SA = cbf().resul... | woparry/spire | core/src/main/scala/spire/std/iterable.scala | Scala | mit | 561 |
package parsing.multi
/**
* Created by hongdi.ren.
*/
case class Token(`type`: Int, text: String) {
override def toString: String = s"""<'$text',${LookaheadLexer.tokenNames(`type`)}>"""
}
| Ryan-Git/LangImplPatterns | src/main/scala/parsing/multi/Token.scala | Scala | apache-2.0 | 196 |
/*
* Copyright (c) 2010-2011 Belmont Technology Pty Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* U... | GrahamLea/SodaTest | sodatest-examples/basic/src/main/scala/org/sodatest/examples/basic/BankAccountService.scala | Scala | apache-2.0 | 2,274 |
package com.sksamuel.avro4s.record.encoder
import com.sksamuel.avro4s.examples.UppercasePkg.ClassInUppercasePackage
import com.sksamuel.avro4s.{AvroSchema, DefaultNamingStrategy, Encoder, ImmutableRecord, NamingStrategy, SchemaFor}
import org.apache.avro.Schema
import org.apache.avro.generic.{GenericFixed, GenericReco... | 51zero/avro4s | avro4s-core/src/test/scala/com/sksamuel/avro4s/record/encoder/BasicEncoderTest.scala | Scala | mit | 3,097 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-utils/src/test/scala/org/locationtech/geomesa/utils/collection/IntBitSetTest.scala | Scala | apache-2.0 | 3,226 |
/* Copyright 2009-2021 EPFL, Lausanne */
package stainless
package extraction
package methods
class FieldAccessors(override val s: Trees, override val t: oo.Trees)
(using override val context: inox.Context)
extends oo.CachingPhase
with SimpleSorts
with oo.SimpleClasses
with Simply... | epfl-lara/stainless | core/src/main/scala/stainless/extraction/methods/FieldAccessors.scala | Scala | apache-2.0 | 2,816 |
package nl.malienkolders.htm.lib.model
import net.liftweb.mapper.MappedPoliteString
import net.liftweb.mapper.Mapper
import net.liftweb.common.Box
import scala.collection.immutable.List
import java.lang.reflect.Method;
class MappedRequiredPoliteString[T <: Mapper[T]](towner: T, theMaxLen: Int) extends MappedPoliteStr... | hema-tournament-manager/htm | htm-lib/src/main/scala/nl/malienkolders/htm/lib/model/MappedRequiredPoliteString.scala | Scala | apache-2.0 | 471 |
package chapter.twenty
object ExerciseSix extends App {
}
| deekim/impatient-scala | src/main/scala/chapter/twenty/ExerciseSix.scala | Scala | apache-2.0 | 61 |
/*
* Copyright (c) 2014, Brook 'redattack34' Heisler
* 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, t... | Redattack34/ModularRayguns | src/main/scala/com/castlebravostudios/rayguns/items/frames/MantisFrame.scala | Scala | bsd-3-clause | 2,290 |
package com.example.db.api
import com.example.db.datamodel.{UserMeta, User, Tweet, TweetMeta}
import net.liftweb.mongodb.MongoIdentifier
import net.liftweb.mongodb.record.MongoMetaRecord
import com.github.izmailoff.mongo.connection.DbConnectionIdentifier
/**
* Defines all available CRUD interfaces for collections. T... | izmailoff/Spray_Mongo_REST_service | engine/src/main/scala/com/example/db/api/DbCrudProvider.scala | Scala | apache-2.0 | 887 |
package org.jetbrains.plugins.scala.lang.scaladoc
import com.intellij.codeInsight.generation.surroundWith.SurroundWithHandler
import com.intellij.lang.surroundWith.SurroundDescriptor
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter
import org.jetbrains.... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/scaladoc/SurroundWithWikiSyntaxTest.scala | Scala | apache-2.0 | 5,548 |
/**
* Copyright 2015, deepsense.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 applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | workflowexecutor/src/main/scala/io/deepsense/workflowexecutor/executor/WorkflowExecutor.scala | Scala | apache-2.0 | 14,454 |
package org.jetbrains.plugins.scala.codeInsight.template.macros
import com.intellij.codeInsight.lookup.LookupElement
import com.intellij.codeInsight.template._
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.search.searches.ClassInheritorsSearch
import org.jetbrains.plugins.scala.codeInsight.t... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/codeInsight/template/macros/ScalaSubtypesMacro.scala | Scala | apache-2.0 | 2,268 |
package com.twitter.finagle.buoyant.h2
import com.twitter.util.{Future, Promise}
/**
* A generic HTTP2 message.
*
* The message itself includes the Headers that initiated the message
* (comprising all HEADERS frames sent to initiate the message).
*
* Furthermore, messages have an (optional) Stream of data and t... | pawelprazak/linkerd | finagle/h2/src/main/scala/com/twitter/finagle/buoyant/h2/Message.scala | Scala | apache-2.0 | 5,109 |
/*
* Copyright 2021 ABSA Group Limited
*
* 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... | AbsaOSS/spline | consumer-services/src/main/scala/za/co/absa/spline/consumer/service/model/Label.scala | Scala | apache-2.0 | 777 |
package lectures.part4implicits
object PimpMyLibrary extends App {
// This is an implicit class that wraps an Int.
implicit class RichInt(val value: Int) extends AnyVal {
def isEven: Boolean = value % 2 == 0
def isOdd: Boolean = !isEven
def sqrt: Double = Math.sqrt(value)
}
// This is called type ... | guhemama/moocs | RockTheJVMScalaAdvanced/src/main/scala/lectures/part4implicits/PimpMyLibray.scala | Scala | bsd-3-clause | 822 |
/*
* 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... | travisbrown/scalatest | src/main/scala/org/scalatest/fixture/Spec.scala | Scala | apache-2.0 | 12,907 |
package okapies.finagle.kafka
package protocol
import org.scalatest._
import org.scalatest.matchers._
import java.nio.ByteBuffer
import java.util.concurrent.atomic.AtomicLong
import org.jboss.netty.buffer.ChannelBuffers
class MessageSetTest extends FlatSpec with Matchers {
import kafka.message.{
ByteBufferMe... | yonglehou/finagle-kafka | src/test/scala/okapies/finagle/kafka/protocol/MessageSetTest.scala | Scala | apache-2.0 | 3,571 |
package singleton.twoface
import singleton.twoface.math._
import org.scalacheck.Properties
import shapeless.test.illTyped
import singleton.TestUtils._
import singleton.ops._
class TwoFaceFloatSpec extends Properties("TwoFace.Float") {
property("Implicit Creation[]") = {
val a = implicitly[TwoFace.Float[W.`2.0f`... | soronpo/singleton-ops | src/test/scala/singleton/twoface/TwoFaceFloatSpec.scala | Scala | apache-2.0 | 32,283 |
class A1 {
class B
}
class A2 {
object B
}
object A3 {
class B1
object B2
}
class A4 {
def f(l: List[String]): List[String] = {
l map (_ + "1") : @noinline // inlining adds a reference to the nested class scala/collection/generic/GenTraversableFactory$GenericCanBuildFrom
}
}
class A5 {
def f(): Ob... | scala/scala | test/files/jvm/innerClassAttribute/Classes_1.scala | Scala | apache-2.0 | 7,444 |
package zzb.shell.remote
import zzb.shell.ActionStat
import akka.actor.ActorRef
/**
* Created with IntelliJ IDEA.
* User: Simon Xiao
* Date: 13-10-16
* Time: 下午2:07
* Copyright baoxian.com 2012~2020
*/
object ShellProtocol {
case class Login(userName: String, passWord: String,peer:ActorRef)
case class Log... | stepover/zzb | zzb-shell/src/main/scala/zzb/shell/remote/ShellProtocol.scala | Scala | mit | 575 |
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Author: Spiros Tzavellas
*/
package com.tzavellas.coeus.http
import java.util.Date
import javax.servlet.http.HttpServletResponse
/**
* Methods to add HTTP headers to a WebResponse.
*/
trait HttpResponseH... | sptz45/coeus | src/main/scala/com/tzavellas/coeus/http/HttpResponseHeaders.scala | Scala | apache-2.0 | 1,137 |
// Databricks notebook source exported at Tue, 23 Feb 2016 07:22:49 UTC
// MAGIC %md
// MAGIC # filter
// MAGIC Return a new RDD containing only elements of this RDD that satisfy a predicate.
// MAGIC
// MAGIC Let us look at the [legend and overview of the visual RDD Api](/#workspace/scalable-data-science/xtraResource... | lamastex/scalable-data-science | db/xtraResources/visualRDDApi/recall/transformations/filter.scala | Scala | unlicense | 1,527 |
/*
* Copyright 2015 Matt Massie
*
* 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... | massie/avrotuples | src/main/scala/com/github/massie/avrotuples/AvroTuple16.scala | Scala | apache-2.0 | 7,558 |
/************************************************************************
Tinaviz
*************************************************************************
This application is part of the Tinasoft project: http://tinasoft.eu
Tinaviz main developer: julian.bilcke @ iscpif.fr (twitter... | moma/tinaviz | src/main/scala/eu/tinasoft/tinaviz/util/Maths.scala | Scala | gpl-3.0 | 3,124 |
object test {
trait A { def apply(x: Int) = x}
trait B { def apply(x: Int) = x}
trait C { }
implicit def A2B(a: A): B = null
implicit def C2B(a: C): B = null
def foo: C = null
/*start*/foo(1)/*end*/
}
//Int | triplequote/intellij-scala | scala/scala-impl/testdata/typeInference/bugs4/SCL12337_2.scala | Scala | apache-2.0 | 222 |
package com.github.j5ik2o.forseti.domain.json.jwk
object JsonImplicits extends JsonImplicits
trait JsonImplicits
extends PublicKeyUseJsonImplicits
with KeyOperationTypeJsonImplicits
with KeyOperationsImplicits
with KeyTypeImplicits
with JWKIdImplicits
with JWKImplicits
with JWKSetImplicits... | j5ik2o/forseti | domain/src/main/scala/com/github/j5ik2o/forseti/domain/json/jwk/JsonImplicits.scala | Scala | mit | 385 |
trait MyTrait:
def a(): String = ""
class MyClass:
var myTrait: MyTrait|Null = null
def printA(): Unit = println(myTrait.nn.a())
@main def runTest(): Unit =
val mt = new MyTrait:
override def a(): String = "hello world"
val mc = MyClass()
mc.myTrait = mt
mc.printA()
| dotty-staging/dotty | tests/pos/i11631b.scala | Scala | apache-2.0 | 289 |
package ru.org.codingteam.horta.plugins.pet.commands
import akka.actor.ActorRef
import ru.org.codingteam.horta.localization.Localization._
import ru.org.codingteam.horta.plugins.pet.{PtcUtils, PetData}
import ru.org.codingteam.horta.security.Credential
class HealCommand extends AbstractCommand {
private val LOWHEA... | codingteam/horta-hell | src/main/scala/ru/org/codingteam/horta/plugins/pet/commands/HealCommand.scala | Scala | mit | 1,175 |
/*
* 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 ... | michalsenkyr/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeExtractors.scala | Scala | apache-2.0 | 13,336 |
package ua.nure.lab4
import java.io.{ByteArrayInputStream, InputStream}
/**
* Class MyBufferedInputStreamImpl implementation.
*
* @author Bohdan_Suprun
*/
class MyBufferedInputStreamImpl(inputStream: InputStream, bufferSize: Int) extends MyBufferedInputStream {
override def read(): Array[Byte] = {
val... | isCompetent/spp | src/main/scala/ua/nure/lab4/MyBufferedInputStreamImpl.scala | Scala | mit | 953 |
package sample.snippet
import scala.xml.NodeSeq
import net.liftweb.util.Helpers._
import net.liftweb.http.SHtml
class BasicExample {
def sample = {
var message = "Change this text"
"type=text" #> SHtml.text(message, message = _) &
"type=submit" #> SHtml.onSubmitUnit(() => println(message))
}
}
class... | timperrett/lift-in-action | chapter-6/src/main/scala/sample/snippet/CSSTransformerExamples.scala | Scala | apache-2.0 | 1,427 |
/*
* 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 ... | Zhangshunyu/incubator-carbondata | integration/spark/src/test/scala/org/apache/carbondata/integration/spark/testsuite/emptyrow/TestEmptyRows.scala | Scala | apache-2.0 | 3,065 |
package mgoeminne.scalaggplot.geom
import mgoeminne.scalaggplot.position.Position
import mgoeminne.scalaggplot.stat.Statistic
import mgoeminne.scalaggplot.{position, aes, stat}
import org.saddle.Frame
/**
* Single line segments.
*
* == Aesthetics
*
* This function understands the following aesthetics:
*
* - '... | mgoeminne/scala-ggplot | src/main/scala/mgoeminne/scalaggplot/geom/segment.scala | Scala | lgpl-3.0 | 1,767 |
package org.jetbrains.plugins.scala
package codeInsight.intention.booleans
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction
import com.intellij.openapi.project.Project
import com.intellij.openapi.editor.Editor
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.openapi.util.TextRange
im... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/codeInsight/intention/booleans/ReplaceEqualsOrEqualityInMethodCallExprIntention.scala | Scala | apache-2.0 | 3,099 |
package models.webservice
import java.sql.Timestamp
import _root_.util.Extensions._
import models.admin._
import play.api.Play
import play.api.db.slick.DatabaseConfigProvider
import play.api.libs.json._
import slick.driver.JdbcProfile
import slick.driver.MySQLDriver.api._
import slick.lifted.{TableQuery, Tag}
import... | mustafin/ent-quiz-server | modules/webservice/app/models/webservice/Game.scala | Scala | apache-2.0 | 6,259 |
/*
* ============= Ryft-Customized BSD License ============
* Copyright (c) 2015, Ryft Systems, Inc.
* 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... | getryft/spark-ryft-connector | spark-ryft-connector/src/test/scala/com/ryft/spark/connector/DateValueSpec.scala | Scala | bsd-3-clause | 3,534 |
package com.tribbloids.spookystuff.uav.actions
import com.tribbloids.spookystuff.Const
import com.tribbloids.spookystuff.extractors.Col
import com.tribbloids.spookystuff.row.{FetchedRow, SpookySchema}
import com.tribbloids.spookystuff.session.Session
import com.tribbloids.spookystuff.uav.UAVConf
import com.tribbloids.... | tribbloid/spookystuff | uav/src/main/scala/com/tribbloids/spookystuff/uav/actions/Takeoff.scala | Scala | apache-2.0 | 3,967 |
package example
import java.nio.file.{Files, Path, Paths}
import scala.collection.JavaConverters._
object Calculator {
def main(args: Array[String]): Unit = {
args.toList match {
case Nil => println(s"Usage: Expected either two ints or a file path")
case List(filePath) =>
println(apply(Pat... | Tapad/sbt-docker-compose | examples/basic-with-tests-cucumber/src/main/scala/example/Calculator.scala | Scala | bsd-3-clause | 1,148 |
/*
* 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 ... | gioenn/xSpark | sql/core/src/main/scala/org/apache/spark/sql/streaming/Trigger.scala | Scala | apache-2.0 | 4,044 |
def unitTest = testMacro
| lampepfl/dotty | tests/pos-macros/i13095/Test_2.scala | Scala | apache-2.0 | 25 |
/*
* This file is part of Sonar.
*
* Sonar 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, version 2 of the License
*
* Sonar is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRAN... | dsp/projectsonar | centralities/edu/kit/ipd/sonar/server/centralities/WeightedIndegreeCentrality.scala | Scala | gpl-2.0 | 1,735 |
package fpinscala.chap02.gettingstarted
// Comment - start off with something familiar to OO programmer
/*
Longer Multi-line comment
Using the MyModule "singular" object as
a mamespace.
*/
/** Documentation comment for MyModule */
object myModule {
// Note that "if ... else ..." is a an expression
// ... | grscheller/scheller-linux-archive | grok/Scala2/fpinscala/src/main/scala/fpinscala/gettingstarted/myModules.scala | Scala | bsd-3-clause | 2,015 |
package edu.gemini.sp.vcs2
import edu.gemini.pot.sp._
import edu.gemini.pot.sp.version._
import edu.gemini.shared.util.VersionComparison
import edu.gemini.shared.util.VersionComparison.{Newer, Conflicting}
import edu.gemini.spModel.obs.ObservationStatus
import edu.gemini.spModel.rich.pot.sp._
import scala.collection.... | arturog8m/ocs | bundle/edu.gemini.sp.vcs/src/main/scala/edu/gemini/sp/vcs2/ObsEdit.scala | Scala | bsd-3-clause | 5,495 |
package org.webant.commons.processor
/**
* Created by bill on 2016/11/15.
*/
trait BaseProcessor[IN, OUT, DATA] {
protected def init()
protected def prepare(in: IN): IN
protected def process(in: IN): OUT
protected def extract(out: OUT): DATA
protected def filter(data: DATA): DATA
protected def write(da... | sutine/webant | webant-commons/src/main/scala/org/webant/commons/processor/BaseProcessor.scala | Scala | apache-2.0 | 356 |
/*
* 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/schema/InlineTable.scala | Scala | apache-2.0 | 3,815 |
package com.overviewdocs.database
import com.overviewdocs.models.NodeDocument
import com.overviewdocs.models.tables.{DanglingNodes,NodeDocuments,Nodes}
import com.overviewdocs.test.DbSpecification
class DanglingNodeDeleterSpec extends DbSpecification {
trait BaseScope extends DbScope {
protected implicit val ec... | overview/overview-server | worker/src/test/scala/com/overviewdocs/database/DanglingNodeDeleterSpec.scala | Scala | agpl-3.0 | 2,846 |
package com.sksamuel.scapegoat.inspections
import com.sksamuel.scapegoat.PluginRunner
import com.sksamuel.scapegoat.inspections.unneccesary.ConstantIf
import org.scalatest.{ FreeSpec, Matchers, OneInstancePerTest }
/** @author Stephen Samuel */
class ConstantIfTest extends FreeSpec with Matchers with PluginRunner wi... | pwwpche/scalac-scapegoat-plugin | src/test/scala/com/sksamuel/scapegoat/inspections/ConstantIfTest.scala | Scala | apache-2.0 | 1,866 |
package edu.stanford.graphics.shapenet.colors
import java.awt.Color
import javax.imageio.ImageIO
import java.io.File
import edu.stanford.graphics.shapenet.Constants
/**
* A color palette
* @author Angel Chang
*/
trait ColorPalette {
def getColor(id: Int): Color
def getColorCount(): Int = -1
def getColor(id... | ShapeNet/shapenet-viewer | src/main/scala/edu/stanford/graphics/shapenet/colors/ColorPalette.scala | Scala | mit | 1,930 |
/*
* 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 ... | GJL/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/runtime/harness/SortProcessFunctionHarnessTest.scala | Scala | apache-2.0 | 11,703 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | sql/core/src/main/scala/org/apache/spark/sql/DataFrameNaFunctions.scala | Scala | apache-2.0 | 19,897 |
/*
* Copyright 2011-2017 Chris de Vreeze
*
* 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 agree... | dvreeze/yaidom | jvm/src/test/scala/eu/cdevreeze/yaidom/integrationtest/DocumentParserTest.scala | Scala | apache-2.0 | 10,394 |
import com.sun.mail.smtp.SMTPTransport
import java.io.{InputStreamReader, BufferedReader, PrintWriter}
import java.net.Socket
import java.util.Properties
import javax.mail._
import javax.mail.internet.InternetAddress
import javax.mail.internet.MimeBodyPart
import javax.mail.internet.MimeMessage
import javax.mail.in... | jlcanela/sample-smtp | src/main/scala/MyApp.scala | Scala | apache-2.0 | 1,016 |
/*
* 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 | core/src/main/scala/org/apache/spark/scheduler/TaskScheduler.scala | Scala | apache-2.0 | 4,636 |
package aecor.tests
import java.util.UUID
import aecor.encoding.WireProtocol
import aecor.macros.boopickle.BoopickleWireProtocol
import aecor.tests.BoopickleWireProtocolTest._
import cats.implicits._
import cats.tagless.syntax.functorK._
import cats.tagless.{ Derive, FunctorK }
import cats.{ Applicative, Functor, Id,... | notxcain/aecor | modules/tests/src/test/scala/aecor/tests/BoopickleWireProtocolTest.scala | Scala | mit | 2,344 |
/*
* 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 ... | greghogan/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/rules/logical/PushPartitionIntoLegacyTableSourceScanRuleTest.scala | Scala | apache-2.0 | 6,292 |
package edu.gemini.util.security.auth.ui
import edu.gemini.util.security.auth.keychain.KeyChain
import edu.gemini.util.security.auth.keychain.KeyException
import edu.gemini.util.security.auth.keychain.KeyFailure
import edu.gemini.util.security.auth.keychain.Action.ActionOps
import edu.gemini.util.security.auth.keychai... | arturog8m/ocs | bundle/edu.gemini.util.security/src/main/scala/edu/gemini/util/security/auth/ui/AddKeyDialog.scala | Scala | bsd-3-clause | 9,939 |
package org.leialearns.crystallize.util
import java.io.{IOException, Reader}
import java.math.BigInteger
import grizzled.slf4j.Logging
import scala.language.implicitConversions
import Integral.Implicits._
import Ordering.Implicits._
class PrefixFreeIntegral[T](implicit val num: Integral[T]) extends Logging {
type... | jeroenvanmaanen/crystallize | src/main/scala/org/leialearns/crystallize/util/PrefixFreeIntegral.scala | Scala | lgpl-2.1 | 4,412 |
package code.comet
import net.liftweb.actor._
import net.liftweb.http._
import js._
import JsCmds._
import JE._
import scala.xml.NodeSeq
object Presentation extends LiftActor with ListenerManager {
object Ask
var currentStep:String = "bored"
def createUpdate = currentStep
override def lowPriority = {
... | joescii/presentera | src/main/scala/code/comet/Presentation.scala | Scala | apache-2.0 | 685 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | Kegeruneku/rudder | rudder-core/src/main/scala/com/normation/rudder/services/marshalling/XmlUnserialisation.scala | Scala | agpl-3.0 | 13,047 |
package com.eevolution.context.dictionary.domain.api.repository
import com.eevolution.context.dictionary._
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Publi... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/repository/PrintColorRepository.scala | Scala | gpl-3.0 | 1,133 |
/*
*
* * Copyright 2015 Skymind,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
* *
* * U... | Mageswaran1989/aja | src/main/scala/org/aja/dhira/src/main/scala/org/dhira/core/optimize/solvers/ConjugateGradient.scala | Scala | apache-2.0 | 3,135 |
/*
* 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 ... | techaddict/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala | Scala | apache-2.0 | 45,807 |
/**
* Copyright 2015, 2016 Gianluca Amato <gianluca.amato@unich.it>
*
* This file is part of ScalaFix.
* ScalaFix 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... | jandom-devel/ScalaFix | core/src/test/scala/it/unich/scalafix/infinite/InfiniteEquationSystemTest.scala | Scala | gpl-3.0 | 3,384 |
package me.laiseca.opt4s
private[opt4s] case class OptionDef[T](val long: Option[String] = Option.empty,
val short: Option[Char] = Option.empty, val flag: Boolean, val optional: Boolean = true) {
def required() = this.copy(optional = false)
private[opt4s] lazy val options: List[String] =
short.map(c ... | xabierlaiseca/opt4s | src/main/scala/me/laiseca/opt4s/Model.scala | Scala | apache-2.0 | 375 |
package de.surfice.smacrotools
abstract class ExtendableMacro extends MacroAnnotationHandler {
/// the names of all extension classes to be loaded
def extensionClasses: Seq[String]
val extensions: Seq[MacroAnnotationHandler] = extensionClasses map { cls =>
getClass.getClassLoader.loadClass(cls).getConstruct... | jokade/smacrotools | shared/src/main/scala/de/surfice/smacrotools/ExtendableMacro.scala | Scala | mit | 719 |
object H {
def unapplySeq(m: Any): Seq[_] = List("")
}
object Test {
def unapply(m: Any) = m match {
case H(v) =>
case _ =>
}
// now: too many patterns for object H offering Boolean: expected 0, found 1
// was: result type Seq[_$2] of unapplySeq defined in method unapplySeq in object H does not conf... | felixmulder/scala | test/files/neg/t8127a.scala | Scala | bsd-3-clause | 339 |
/**
* 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... | stealthly/scala-sbt | src/main/scala/Stub.scala | Scala | apache-2.0 | 904 |
package com.twitter.finagle
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}
import org.mockito.Matchers._
import com.twitter.util._
import scala.Some
import org.mockito.invocatio... | JustinTulloss/finagle | finagle-core/src/test/scala/com/twitter/finagle/ServiceTest.scala | Scala | apache-2.0 | 2,563 |
/*
* 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 org.scalajs.testing.common
private[te... | gzm0/scala-js | test-common/src/main/scala/org/scalajs/testing/common/FrameworkMessage.scala | Scala | apache-2.0 | 808 |
package com.github.ligangty.scala.jsoup.helper
/**
*/
object Validator {
/**
* Validates that the object is not null
* @param obj object to test
*/
def notNull(obj: AnyRef) {
require(obj != null, "Object must not be null")
}
/**
* Validates that the object is not null
* @param obj object... | ligangty/scalajsoup | src/main/scala/com/github/ligangty/scala/jsoup/helper/Validator.scala | Scala | mit | 2,311 |
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.