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 |
|---|---|---|---|---|---|
trait CompilerInterface {
type Tree22
}
class Reflect(val internal: CompilerInterface) {
opaque type Tree22 = internal.Tree22
def show(t: Tree22): String = ???
}
object App {
val refl: Reflect = ???
import refl.*
show(??? : Tree22)
} | dotty-staging/dotty | tests/pos/i7159.scala | Scala | apache-2.0 | 248 |
package br.unb.cic.sma.sade.fipa
case class Subscribe(parameters: Map[ACLMessageParameter.ACLMessageParameter, Any]) extends ACLMessage(parameters: Map[ACLMessageParameter.ACLMessageParameter, Any]) {
override def getParameters = (parameters - ACLMessageParameter.PERFORMATIVE) + (ACLMessageParameter.PERFORMATIVE -> ... | brenoxp/SADE | src/br/unb/cic/sma/sade/fipa/Subscribe.scala | Scala | mit | 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 ... | jianran/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryRelation.scala | Scala | apache-2.0 | 5,922 |
/*
* 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/main/scala/org/apache/flink/table/planner/codegen/LookupJoinCodeGenerator.scala | Scala | apache-2.0 | 16,367 |
package dk.gp.cogp.model
import breeze.linalg.DenseMatrix
import breeze.linalg.DenseVector
case class Task(x:DenseMatrix[Double],y:DenseVector[Double])
object Task {
def apply(x:DenseVector[Double],y:DenseVector[Double]) = new Task(x.toDenseMatrix.t,y)
} | danielkorzekwa/bayes-scala-gp | src/main/scala/dk/gp/cogp/model/Task.scala | Scala | bsd-2-clause | 263 |
/*
Copyright 2013 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | zirpins/summingbird | summingbird-storm-test/src/main/scala/com/twitter/summingbird/storm/StormTestRun.scala | Scala | apache-2.0 | 3,683 |
package com.github.izmailoff.mongo.schema
import net.liftweb.mongodb.{MongoIdentifier, MongoDB}
import org.springframework.core.io.{Resource, ClassPathResource}
import org.mongeez.Mongeez
/**
* Defines all MongoDB schema migrations using Mongeez.
* Requires: default MongoDB connection to be initialized prior to use... | izmailoff/Spray-mongo-record | mongoconnect/src/main/scala/com/github/izmailoff/mongo/schema/DbSchemaMigration.scala | Scala | mit | 725 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/dataset/LabeledSentenceSpec.scala | Scala | apache-2.0 | 5,769 |
trait A {
type m[+x]
}
trait A2 {
type m[+x <: String]
}
trait A3 {
type m[x]
}
trait FooCov[+x]
trait FooCon[-x]
trait FooBound[+x <: String]
trait BOk1 extends A {
type m[+x] = FooCov[x]
}
trait BOk2 extends A2 {
type m[+x <: String] = FooBound[x]
}
trait BOk3 extends A2 {
type m[+x] = FooCov[x] // ... | AlexSikia/dotty | tests/untried/neg/tcpoly_typealias.scala | Scala | bsd-3-clause | 846 |
package davidkellis.seven
import scala.math.BigDecimal.RoundingMode
object MathUtil {
def ceil(decimal: Double): Double = Math.ceil(decimal)
def ceil(decimal: BigDecimal): BigDecimal = decimal.setScale(0, RoundingMode.CEILING)
def intCeil(decimal: Double): Int = ceil(decimal).toInt
def intCeil(decimal: BigDe... | davidkellis/seven | src/main/scala/davidkellis/seven/MathUtil.scala | Scala | mit | 1,087 |
class C1 {
object O
}
class C2 extends C1 {
object O
println(/* resolved: false */ O.getClass)
}
| LPTK/intellij-scala | testdata/resolve2/inheritance/override/Object.scala | Scala | apache-2.0 | 105 |
package services
import java.io.File
import java.io.FileNotFoundException
import java.io.FileInputStream
import java.io.FileOutputStream
import com.sksamuel.scrimage.ScaleMethod._
import com.sksamuel.scrimage._
import org.slf4j.Logger
import org.slf4j.LoggerFactory
// need the image
// image path
// new location w... | odnanref/carros | app/services/ImageReduce.scala | Scala | apache-2.0 | 2,093 |
package sword.langbook.db.registers
import sword.db.StorageManager.Key
import sword.db._
import sword.langbook.db.registers.Language.ConceptReferenceField
object Alphabet extends RegisterDefinition[Alphabet] {
object ConceptReferenceField extends ConceptReferenceFieldDefinition {
override def newField = apply
... | carlos-sancho-ramirez/generic-scala-langbook | src/main/scala/sword/langbook/db/registers/Alphabet.scala | Scala | mit | 1,360 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package types
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.util.ParserUtils
import scala.annota... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/parser/parsing/types/Refinement.scala | Scala | apache-2.0 | 1,297 |
/*******************************************************************************/
/* */
/* Copyright (C) 2017 by Max Lv <max.c.lv@gmail.com> */
/* Copyright (C) 2017 by Mygod Studio <contact-shadowsocks-android@mygod.... | KublaikhanGeek/shadowsocks-android | mobile/src/main/scala/com/github/shadowsocks/TaskerActivity.scala | Scala | gpl-3.0 | 5,119 |
/*
* 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 | external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/DirectKafkaInputDStream.scala | Scala | apache-2.0 | 13,287 |
package geotrellis.osme.server
import akka.actor._
import geotrellis.vector._
import geotrellis.vector.io._
import geotrellis.vector.io.json._
import org.apache.spark._
import spray.http.HttpHeaders.RawHeader
import spray.routing._
import spray.json._
import spray.httpx.SprayJsonSupport._
class OsmeServiceActor(
sc... | longcmu/geotrellis-osm-elevation | server/src/main/scala/geotrellis/osme/server/OsmeServiceActor.scala | Scala | apache-2.0 | 1,376 |
package org.workcraft.gui.tasks
import java.awt.BorderLayout
import java.awt.Color
import java.awt.Dimension
import java.awt.Rectangle
import java.awt.event.ActionEvent
import java.awt.event.ActionListener
import java.lang.reflect.InvocationTargetException
import javax.swing.BorderFactory
import javax.swing.JButton
im... | tuura/workcraft-2.2 | Gui/src/main/scala/org/workcraft/gui/tasks/TaskManagerWindow.scala | Scala | gpl-3.0 | 1,832 |
package example
object Hello {
val greeting: String = "hello"
val thisShouldFail: String = trickCompiler(true)
def trickCompiler(tricked: Boolean): String = {
if (tricked) {
throw new IllegalArgumentException("Test TC sbt logger plugin")
} else {
"never happens"
}
}
}
| JetBrains/sbt-tc-logger | test/testdata/TW-50753_initErrorInTests/src/main/scala/example/Hello.scala | Scala | apache-2.0 | 304 |
//package com.sksamuel.avro4s.github
//
//import com.sksamuel.avro4s.{AvroName, AvroSchema}
//import org.apache.avro.SchemaNormalization
//import org.scalatest.{FunSuite, Matchers}
//
//class GithubIssue260 extends FunSuite with Matchers {
// test("Schema generated is not always the same (#260)") {
// val fingerpri... | 51zero/avro4s | avro4s-core/src/test/scala/com/sksamuel/avro4s/github/GithubIssue260.scala | Scala | mit | 3,496 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | goldmedal/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveExplainSuite.scala | Scala | apache-2.0 | 9,022 |
package provingground.interface
import provingground._
// import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent._
// import MantleService._
import io.undertow.websockets.WebSocketConnectionCallback
import io.undertow.websockets.core.{
AbstractReceiveListener,
BufferedTextMessage,
Web... | siddhartha-gadgil/ProvingGround | mantle/src/main/scala/provingground/interface/MantleCask.scala | Scala | mit | 10,109 |
package edu.mit.cci.wikilanguage.main
import edu.mit.cci.wikilanguage.io.FileExporter
import edu.mit.cci.wikilanguage.db.DAO
/**
* @author pdeboer
* First created on 16/12/13 at 13:12
*/
object GraphVizExporter extends App {
val exporter = new FileExporter()
exporter.init(DAO.getAllPeopleIDsWithBirthdate... | pdeboer/wikilanguage | src/main/scala/edu/mit/cci/wikilanguage/main/GraphVizExporter.scala | Scala | mit | 435 |
package org.apache.mesos.chronos.notification
import java.util.logging.Logger
import org.apache.mesos.chronos.scheduler.jobs.BaseJob
import net.kencochrane.raven.RavenFactory
import net.kencochrane.raven.event.{Event, EventBuilder}
/**
* Notification client that uses sentry / raven to transmit its messages
* @auth... | rapidoo/chronos | src/main/scala/org/apache/mesos/chronos/notification/RavenClient.scala | Scala | apache-2.0 | 1,582 |
package scala.in.programming.limit.expression
/**
* Let's learn why scala not allow some expression.
*
* @author loustler
* @since 01/14/2017 16:25
*/
class Ambiguity {}
class B {}
object A {
def apply(myB: B): Unit = {
println("apply")
}
def b: Unit = {
println("b")
}
}
/**
* Do below... | loustler/scala | src/main/scala/scala/in/programming/limit/expression/Ambiguity.scala | Scala | mit | 728 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package expr
import com.intellij.psi.PsiElement
/**
* @author Alexander Podkhalyuzin
* Date: 06.03.2008
*/
trait ScIfStmt extends ScExpression {
def condition: Option[ScExpression]
def thenBranch : Option[ScExpression]
def elseBranch : ... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/api/expr/ScIfStmt.scala | Scala | apache-2.0 | 520 |
/*import shallow.optigraph._; import lifted._; object SCC extends LanguageOps {
optiGraphAnalysis {
val G = RandUniformGraph(100000, 800000, 1997L)
val CompID = NodeProperty[Int](G)
val start_time = wall_time()
var numC = 0
val P = NodeOrder()
CompID.setAll(-1)
For /*[Node, GIterable[Nod... | vjovanov/scala-yinyang | components/delite-test/test/benchmarks/SCC.scala | Scala | bsd-3-clause | 954 |
/**
* Copyright (c) 2014-2016 Tim Bruijnzeels
* 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 of... | timbru/rpki-ca | src/test/scala/nl/bruijnzeels/tim/rpki/ca/provisioning/ProvisioningCommunicatorTest.scala | Scala | bsd-3-clause | 4,028 |
package co.ledger.wallet.core.wallet.ripple
import scala.scalajs.js
/**
*
* XRP
* ledger-wallet-ripple-chrome
*
* Created by Pierre Pollastri on 13/06/2016.
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ledger
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
... | LedgerHQ/ledger-wallet-ripple | src/main/scala/co/ledger/wallet/core/wallet/ripple/XRP.scala | Scala | mit | 2,776 |
package ru.wordmetrix.novel
import scala.annotation.implicitNotFound
import scala.concurrent.{ ExecutionContext, Future }
import scala.concurrent.duration.DurationInt
import akka.actor.{ Actor, ActorRef, Props, actorRef2Scala }
import akka.util.Timeout
import akka.pattern.pipe
import akka.pattern.ask
import spray.rou... | electricmind/novel | src/main/scala/ru/wordmetrix/novel/ArticleActor.scala | Scala | mit | 2,264 |
/*
* Licensed to STRATIO (C) under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. The STRATIO (C) licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file... | Stratio/stratio-connector-sparkSQL | mongodbProvider/src/main/scala/com/stratio/connector/sparksql/mongodb/MongoDB.scala | Scala | apache-2.0 | 1,104 |
package views.html
import play.templates._
import play.templates.TemplateMagic._
import play.api.templates._
import play.api.templates.PlayMagic._
import models._
import controllers._
import play.api.i18n._
import play.api.mvc._
import play.api.data._
import views.html._
/* userSignup Template File */
object userSig... | pamu/FooService | FooService1/target/scala-2.10/src_managed/main/views/html/userSignup.template.scala | Scala | apache-2.0 | 3,608 |
package stormlantern.consul.client.dao
import java.util
case class BinaryData(data: Array[Byte]) {
override def equals(other: Any): Boolean = {
if (this.canEqual(other)) {
util.Arrays.equals(this.data, other.asInstanceOf[BinaryData].data)
} else {
false
}
}
override def hashCode(): Int... | dlouwers/reactive-consul | client/src/main/scala/stormlantern/consul/client/dao/BinaryData.scala | Scala | mit | 467 |
class Context
given Context = ??? // ok
given: Context = ??? // error
| dotty-staging/dotty | tests/neg/i10074.scala | Scala | apache-2.0 | 75 |
package com.truecar.mleap.runtime.transformer
import com.truecar.mleap.core.regression.RandomForestRegression
import com.truecar.mleap.runtime.attribute.{ContinuousAttribute, AttributeSchema}
import com.truecar.mleap.runtime.transformer.builder.TransformBuilder
import com.truecar.mleap.runtime.types.{VectorType, Doubl... | TrueCar/mleap | mleap-runtime/src/main/scala/com/truecar/mleap/runtime/transformer/RandomForestRegressionModel.scala | Scala | apache-2.0 | 1,097 |
package scorex.account
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import scorex.crypto.encode.Base58
import scorex.crypto.hash.SecureCryptographicHash._
class AccountSpecification extends PropSpec with PropertyChecks with GeneratorDrivenProperty... | ConsensusResearch/Scorex-Lagonaki | scorex-basics/src/test/scala/scorex/account/AccountSpecification.scala | Scala | cc0-1.0 | 1,178 |
package main.scala
import spark._
import spark.SparkContext._
import io.Source
import java.io._
/**
* Give natural language text and a mapping from string tokens to floats (polarities)
* Calculate the distribution over the labels
*/
class CalculatePolarities(sc: SparkContext, polarities: Map[String, Polarity])... | AustinBGibbons/emoticat | polarity/src/main/scala/CalculatePolarities.scala | Scala | bsd-3-clause | 5,801 |
package org.infinispan.spark.test
import java.io.{ObjectInput, ObjectOutput, Serializable}
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder
import org.infinispan.client.hotrod.{RemoteCache, RemoteCacheManager}
import org.infinispan.commons.marshall.Externalizer
import org.infinispan.commons.mars... | infinispan/infinispan-spark | src/test/scala/org/infinispan/spark/test/ClusterSample.scala | Scala | apache-2.0 | 3,773 |
package org.scalaide.ui.internal.editor.outline
import org.scalaide.ui.internal.editor.ScalaCompilationUnitEditor
import org.eclipse.jface.viewers.ISelection
import org.eclipse.jface.viewers.IStructuredSelection
trait OutlinePageEditorExtension extends ScalaCompilationUnitEditor {
private var outlinePage: ScalaOutl... | scala-ide/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/internal/editor/outline/OutlinePageEditorExtension.scala | Scala | bsd-3-clause | 1,286 |
package io.buoyant.router
import com.twitter.finagle.{Filter, Path, Stack, Stackable, ServiceFactory, param}
import com.twitter.finagle.buoyant.Dst
import com.twitter.finagle.service.StatsFilter
import com.twitter.finagle.stats.{ExceptionStatsHandler, StatsReceiver}
import io.buoyant.router.context.ResponseClassifierC... | denverwilliams/linkerd | router/core/src/main/scala/io/buoyant/router/PerDstPathStatsFilter.scala | Scala | apache-2.0 | 1,649 |
package uk.ac.ncl.openlab.intake24.sql.tools.food.localisation
import java.io.{File, FileWriter, OutputStreamWriter}
import au.com.bytecode.opencsv.CSVWriter
import uk.ac.ncl.openlab.intake24.api.data.admin.NewLocalFoodRecord
import uk.ac.ncl.openlab.intake24.api.data.{AssociatedFood, UserFoodHeader}
trait RecodingT... | digitalinteraction/intake24 | DatabaseTools/src/main/scala/uk/ac/ncl/openlab/intake24/sql/tools/food/localisation/RecodingTableParser.scala | Scala | apache-2.0 | 2,598 |
/*
* Copyright 2012 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | cogitate/twitter-zipkin-uuid | zipkin-scrooge/src/test/scala/com/twitter/zipkin/adapter/ThriftConversionsTest.scala | Scala | apache-2.0 | 4,035 |
package org.jetbrains.plugins.scala.lang.transformation
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.codeInsight.intention.types.UpdateStrategy
import org.jetbrains.plugins.scala.extensions.{&&, FirstChild}
import org.jetbrains.plugins.scala.lang.psi.api.base.ScReferenceElement
import org.jetb... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/transformation/annotations/package.scala | Scala | apache-2.0 | 1,498 |
package com.twitter.finagle.example.thrift
import com.twitter.finagle.example.thriftscala.Hello
import com.twitter.finagle.Thrift
import com.twitter.util.{Await, Future}
object ThriftServer {
def main(args: Array[String]): Unit = {
//#thriftserverapi
val server = Thrift.server.serveIface("localhost:8080", n... | luciferous/finagle | finagle-example/src/main/scala/com/twitter/finagle/example/thrift/ThriftServer.scala | Scala | apache-2.0 | 435 |
package chapter.seventeen
import ExerciseTwo.Pair
import org.scalatest._
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
@RunWith(classOf[JUnitRunner])
class ExerciseTwoSpec extends FlatSpec with Matchers {
"Pair" should "define a method that swaps the components of a pair" in {
val pai... | deekim/impatient-scala | src/test/scala/chapter/seventeen/ExerciseTwoSpec.scala | Scala | apache-2.0 | 417 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.core.j
import java.util.concurrent.CompletionStage
import java.util.concurrent.Executor
import play.api.libs.Files.TemporaryFile
import akka.stream.Materializer
import scala.collection.JavaConverters._
import play.api.mvc._
import play... | benmccann/playframework | core/play/src/main/scala/play/core/j/JavaParsers.scala | Scala | apache-2.0 | 2,245 |
/*
* Copyright (C) 2007-2008 Artima, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | peachyy/scalastu | traits/IntQueue.scala | Scala | apache-2.0 | 873 |
/*
* Copyright 2015 Heiko Seeberger
*
* 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... | lomigmegard/akka-http-json | akka-http-play-json/src/main/scala/de/heikoseeberger/akkahttpplayjson/PlayJsonSupport.scala | Scala | apache-2.0 | 3,063 |
package org.scalgebra
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest._
import algebra.instances.int._
import org.scalgebra.generation.VectorGen._
/**
* @author Daniyar Itegulov
*/
class VectorProps extends PropSpec with Matchers with GeneratorDrivenPropertyChecks {
property("hash ... | itegulov/scalgebra | src/test/scala/org/scalgebra/VectorProps.scala | Scala | mit | 1,646 |
package leo.modules.calculus
import leo.datastructures._
/**
* Rule for an easy call to the TrivRule to minimize Clauses in other Rules.
*
* @author Max Wisniewski
* @since 1/13/15
*/
object TrivRule {
/**
* Removes all Literals of the form [ T = F ] or [ F = T ]
*
* @param c - sequence of literals
... | Ryugoron/Leonora | src/main/scala/leo/modules/calculus/TrivRule.scala | Scala | mit | 1,819 |
import sbt._
import Keys._
object Dependencies {
object V {
final lazy val scalaLogging = "3.1.0"
final lazy val slf4j = "1.7.12"
final lazy val typesafeConfig = "1.2.1"
final lazy val scalatest = "2.2.4"
final lazy val scaldi = "0.5.6"
final lazy val mavenArtifact = "3.3.3"
final lazy v... | chainkite/chk-commons | project/Dependencies.scala | Scala | mit | 859 |
package breeze.linalg
import scala.reflect.ClassTag
/**
* A SliceVector is a vector that is a view of another underlying tensor. For instance:
* {{{
* val m = DenseMatrix(...)
* m( (1,2), (3,4), (4,5))
* }}}
*
* will give a SliceVector such that apply/update at index 0 will map to m(1,2), index 1 to m(3,4), et... | eponvert/breeze | src/main/scala/breeze/linalg/SliceVector.scala | Scala | apache-2.0 | 1,015 |
package codeforces.round_281_div2
import java.io.InputStream
import java.io.PrintStream
import java.util.Scanner
import scala.annotation.tailrec
object A_VasyaAndFootbal {
def main(args: Array[String]) {
parseSolveAndPrint(System.in, System.out)
}
def parseSolveAndPrint(in: InputStream, out: PrintStream)... | VitalyKalinkin/stdout_sites_scala | src/main/scala/codeforces/round_281_div2/A_VasyaAndFootbal.scala | Scala | bsd-2-clause | 1,720 |
/*
* Copyright 1998-2019 Linux.org.ru
* 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... | fat0troll/lorsource | src/main/scala/ru/org/linux/search/SearchOrder.scala | Scala | apache-2.0 | 1,828 |
/*
* 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 ... | asurve/arvind-sysml | src/main/scala/org/apache/sysml/api/ml/LogisticRegression.scala | Scala | apache-2.0 | 5,811 |
/*
* Copyright 2011-2019 Asakusa Framework 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 ... | ashigeru/asakusafw-spark | compiler/src/test/scala/com/asakusafw/spark/compiler/operator/OutputFragmentClassBuilderSpec.scala | Scala | apache-2.0 | 2,376 |
/*
* 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 ... | rikima/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/python/ExtractPythonUDFs.scala | Scala | apache-2.0 | 9,325 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | monix-tail/shared/src/test/scala/monix/tail/IterantChannelSuite.scala | Scala | apache-2.0 | 4,776 |
import scala.reflect.macros.blackbox.Context
object Impls {
def foo(c: Context)(xs: c.Expr[Int]*) = {
import c.universe._
val stripped_xs = xs.map(_.tree).toList match {
case List(Typed(stripped, Ident(wildstar))) if wildstar == typeNames.WILDCARD_STAR => List(stripped)
case _ => ???
}
va... | scala/scala | test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala | Scala | apache-2.0 | 439 |
/*
* 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 | it/src/test/scala/quasar/fs/FileSystemUT.scala | Scala | apache-2.0 | 2,605 |
package net.liftmodules.ng
package test.snippet
import Angular._
import net.liftweb.common.Empty
import net.liftweb.http.{SessionVar, S}
import net.liftweb.util.Schedule
object Server2ClientBindTests {
case class ListWrap(l:List[String] = List.empty[String]) extends NgModel {
def :+ (a:String) = ListWrap(l :+ a... | extirpate/lift-ng | test-project/src/main/scala/net/liftmodules/ng/test/snippet/Server2ClientBindTests.scala | Scala | apache-2.0 | 1,319 |
/**
* Copyright 2015 Thomson Reuters
*
* 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... | bryaakov/CM-Well | server/cmwell-data-tools/src/main/scala/cmwell/tools/data/downloader/streams/Downloader.scala | Scala | apache-2.0 | 18,519 |
/*
* Copyright (c) 2013. Regents of the University of California
*
* 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... | fnothaft/adam | adam-cli/src/main/scala/edu/berkeley/cs/amplab/adam/cli/Args4j.scala | Scala | apache-2.0 | 1,827 |
package jsrecord
import scalaz.Liskov
import Liskov.<~<
import shapeless._
trait OrphanInstances {
implicit def hconsLiskov[LH, LT <: HList, RH, RT <: HList](
implicit
h: LH <~< RH,
t: LT <~< RT
): (LH :: LT) <~< (RH :: RT) =
// We can't provide a good instance because of type bounds
Lisko... | nigredo-tori/jsrecord | src/main/scala/org/jsrecord/OrphanInstances.scala | Scala | unlicense | 330 |
/**
* Copyright (C) 2013 Stefan Niederhauser (nidin@gmx.ch)
*
* 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... | nidi3/simple-remote-atlassian | src/main/scala/guru/nidi/atlassian/remote/query/QueryProjectList.scala | Scala | apache-2.0 | 1,579 |
package org.tribbloid.spookystuff.integration
import org.tribbloid.spookystuff.SpookyContext
import org.tribbloid.spookystuff.actions.Visit
import org.tribbloid.spookystuff.dsl._
/**
* Created by peng on 12/5/14.
*/
class ExploreIT extends IntegrationSuite {
override lazy val drivers = Seq(
PhantomJSDriverFa... | chenUT/spookystuff | integration/src/test/scala/org/tribbloid/spookystuff/integration/ExploreIT.scala | Scala | apache-2.0 | 1,712 |
/*
* Copyright ixias.net All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license
* For the full copyright and license information,
* please view the LICENSE file that was distributed with this source code.
*/
package ixias.aws.sns
import scala.util.{ Try, Success, Failure }
import s... | sp1rytus/ixias | framework/ixias-aws-sns/src/main/scala/ixias/aws/sns/AmazonSNS.scala | Scala | mit | 2,388 |
package org.vaslabs.granger
import java.util.concurrent.Executors
import akka.actor.typed.eventstream.{ Publish, Subscribe }
import akka.actor.typed.scaladsl.Behaviors
import akka.actor.typed.{ ActorRef, Behavior }
import io.circe.generic.semiauto.{ deriveDecoder, deriveEncoder }
import io.circe.{ Decoder, Encoder }
... | vaslabs/granger | src/main/scala/org/vaslabs/granger/RememberInputAgent.scala | Scala | lgpl-3.0 | 4,845 |
package util.specs
import java.sql.DriverManager
import akka.actor.ActorSystem
import akka.stream.Materializer
import net.scalytica.symbiotic.config.ConfigReader
import net.scalytica.symbiotic.test.specs.PostgresSpec
import org.scalatest.exceptions.TestFailedException
import org.scalatestplus.play.PlaySpec
import org... | kpmeen/symbiotic | examples/symbiotic-server/test/util/specs/ServerPostgresSpec.scala | Scala | apache-2.0 | 2,080 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | garyKeorkunian/squants | shared/src/main/scala/squants/time/Time.scala | Scala | apache-2.0 | 5,627 |
/*******************************************************************************
Copyright (c) 2012-2013, KAIST, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
***************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/interpreter/objects/JSGlobal.scala | Scala | bsd-3-clause | 11,828 |
package io.questions.model.questionnaire
import io.circe.{ Decoder, Encoder }
import io.questions.model.EncoderHelpers
sealed trait Validation extends Product with Serializable
object Validation extends EncoderHelpers {
case object AlwaysValid extends Validation
... | channingwalton/qanda | questionnaire/src/main/scala/io/questions/model/questionnaire/Validation.scala | Scala | mit | 548 |
package fpinscala.answers.parallelism
import java.util.concurrent.{Callable, CountDownLatch, ExecutorService}
import java.util.concurrent.atomic.AtomicReference
object Nonblocking:
opaque type Future[+A] = (A => Unit) => Unit
opaque type Par[+A] = ExecutorService => Future[A]
object Par:
extension [A](p... | fpinscala/fpinscala | src/main/scala/fpinscala/answers/parallelism/Nonblocking.scala | Scala | mit | 5,642 |
/*
* 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/test/scala/uk/gov/hmrc/ct/ct600/v3/calculations/LoansToParticipatorsCalculatorSpec.scala | Scala | apache-2.0 | 43,745 |
package com.github.tminglei.slickpg
import org.scalatest.FunSuite
import slick.jdbc.GetResult
import scala.concurrent.Await
import scala.concurrent.duration._
class PgNetSupportSuite extends FunSuite {
import MyPostgresDriver.api._
val db = Database.forURL(url = dbUrl, driver = "org.postgresql.Driver")
case... | bearrito/slick-pg | src/test/scala/com/github/tminglei/slickpg/PgNetSupportSuite.scala | Scala | bsd-2-clause | 7,383 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | patverga/factorie | src/main/scala/cc/factorie/app/nlp/segment/TokenNormalizer.scala | Scala | apache-2.0 | 8,444 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
// Developer note:
// scala ... | scala/scala | src/library/scala/sys/process/package.scala | Scala | apache-2.0 | 11,464 |
/*
* Copyright 2009-2010 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | geggo98/json4s | scalaz/src/main/scala/org/json4s/scalaz/Lifting.scala | Scala | apache-2.0 | 3,264 |
trait SimpleTrait[T] {
def myMethod(t: T): Int
def doIt(t: T): Unit = {
myMethod(t) // java.lang.AbstractMethodError: Method BadClass.myMethod(Ljava/lang/Object;)I is abstract
}
}
abstract class SimpleClass[T] extends SimpleTrait[T] {
def myMethod(t: String): Int = 5
}
class BadClass extends SimpleClass[St... | dotty-staging/dotty | tests/run/i13087a.scala | Scala | apache-2.0 | 416 |
package breeze.stats.distributions
/*
Copyright 2009 David Hall, Daniel Ramage
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 ... | scalanlp/breeze | math/src/test/scala/breeze/stats/distributions/StudentsTTest.scala | Scala | apache-2.0 | 1,256 |
package com.twitter.finagle.http.filter
import com.twitter.finagle.Service
import com.twitter.finagle.http.{Method, Request, Response, Status}
import com.twitter.util.{Await, Future}
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
cla... | sveinnfannar/finagle | finagle-http/src/test/scala/com/twitter/finagle/http/filter/HeadFilterTest.scala | Scala | apache-2.0 | 1,253 |
/*
* 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 ... | dubeejw/openwhisk | common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBConfig.scala | Scala | apache-2.0 | 3,447 |
package guru.nidi.geo
/**
*
*/
trait Model[T] {
def getData(p0: LatLng, p1: LatLng): T
}
| nidi3/mineedit | geo/src/main/scala/guru/nidi/geo/Model.scala | Scala | apache-2.0 | 94 |
package varys.util
/**
* An extractor object for parsing strings into integers.
*/
private[varys] object IntParam {
def unapply(str: String): Option[Int] = {
try {
Some(str.toInt)
} catch {
case e: NumberFormatException => None
}
}
}
| frankfzw/varys | core/src/main/scala/varys/util/IntParam.scala | Scala | apache-2.0 | 265 |
package org.kuleuven.mai.vision.image
import java.io.File
import java.util.Calendar
import com.sksamuel.scrimage.Format.PNG
import com.sksamuel.scrimage.io.TiffReader
import org.apache.commons.io.FileUtils
import org.kuleuven.mai.vision.filters.MedianFilter
/**
* @author mandar
*/
object SmoothRadiograms {
def m... | mandar2812/ScalaImageToolbox | ImageDenoising/src/main/scala-2.11/org/kuleuven/mai/vision/image/SmoothRadiograms.scala | Scala | apache-2.0 | 1,674 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/test/scala/com/waz/service/otr/OtrSyncHandlerSpec.scala | Scala | gpl-3.0 | 8,191 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-api-scala-bridge/src/main/scala/org/apache/flink/table/api/scala/TableConversions.scala | Scala | apache-2.0 | 4,056 |
package nl.rabobank.oss.rules.dsl.nl.datum
import java.util.Date
import nl.rabobank.oss.rules.dsl.core.temporal.LocalDate
import org.joda.time.format.DateTimeFormat
import org.joda.time.{LocalDate => JodaLocalDate}
/**
* Provides the implicit conversions to DslDate for the NL version of the DSL.
* It defines a D... | scala-rules/scala-rules | engine/src/main/scala/nl/rabobank/oss/rules/dsl/nl/datum/DatumImplicits.scala | Scala | mit | 1,111 |
package controllers
object FakeData {
val `36Characters` = (1 to 36).foldLeft("x")((x, _) => x + "x").mkString
val `101Characters` = (1 to 101).foldLeft("x")((x, _) => x + "x").mkString
}
| Department-for-Work-and-Pensions/ClaimCapture | c3/test/controllers/FakeData.scala | Scala | mit | 194 |
package org.scaladebugger.api.dsl.info
import com.sun.jdi.VirtualMachine
import org.scaladebugger.api.lowlevel.ManagerContainer
import org.scaladebugger.api.profiles.ProfileManager
import org.scaladebugger.api.profiles.traits.DebugProfile
import org.scaladebugger.api.profiles.traits.info.{ObjectInfo, ValueInfo}
import... | ensime/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/dsl/info/ValueInfoDSLWrapperSpec.scala | Scala | apache-2.0 | 5,567 |
/*
* 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 ... | bwsw/sj-platform | contrib/benchmarks/sj-batch-performance-benchmark/src/main/scala/com/bwsw/sj/benchmarks/module/batch/Executor.scala | Scala | apache-2.0 | 2,994 |
package ilc
package feature
package base
import org.scalatest.FunSuite
class TypeInversionTest
extends FunSuite
with functions.Syntax // for application
with Pretty
{
case object Bot extends Type
case class T1(inner: Type) extends Type
case class T2(inner: Type) extends Type
object OperatorT1 extends Co... | inc-lc/ilc-scala | src/test/scala/ilc/feature/base/TypeInversionTest.scala | Scala | mit | 1,050 |
package state
case class Robot() extends RoboticState {
var roboticOn: RoboticState = RoboticOn(this)
var roboticCook: RoboticState = RoboticCook(this)
var roboticOff: RoboticState = RoboticOff(this)
var roboticStandby: RoboticState = RoboticStandby(this)
var state: RoboticState = roboticOn
override def ... | BBK-PiJ-2015-67/sdp-portfolio | exercises/week11/src/main/scala/state/Robot.scala | Scala | unlicense | 540 |
package main
import person.Person
object testPerson {
def main(args: Array[String]) {
val john = new Person("John", "Smith", "Analyst")
println(john)
val bill = new Person("Bill", "Walker")
println(bill)
}
}
| akxs14/TinyWeb | Classes/testPerson.scala | Scala | apache-2.0 | 230 |
/*
* 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 java.util.function
@FunctionalInterfa... | scala-js/scala-js | javalib/src/main/scala/java/util/function/LongFunction.scala | Scala | apache-2.0 | 377 |
package filodb.timeseries
import java.net.URLEncoder
import java.nio.charset.StandardCharsets
import scala.concurrent.Future
import scala.concurrent.duration._
import scala.util.Random
import com.typesafe.config.Config
import com.typesafe.scalalogging.StrictLogging
import monix.reactive.Observable
import filodb.coo... | tuplejump/FiloDB | gateway/src/main/scala/filodb/timeseries/TestTimeseriesProducer.scala | Scala | apache-2.0 | 8,490 |
/***********************************************************************
* 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-metrics/src/main/scala/org/locationtech/geomesa/metrics/config/MetricsConfig.scala | Scala | apache-2.0 | 5,837 |
/*
* 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 ... | ZxlAaron/mypros | sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileFormat.scala | Scala | apache-2.0 | 11,253 |
package controllers.s_about_you
import org.specs2.mutable._
import utils.WithBrowser
import utils.pageobjects.common.ClaimHelpPage
import utils.pageobjects.preview.PreviewPage
import utils.pageobjects.s_about_you._
import utils.pageobjects.s_eligibility.GApprovePage
import controllers.{PreviewTestUtils, ClaimScenarioF... | Department-for-Work-and-Pensions/ClaimCapture | c3/test/controllers/s_about_you/GYourDetailsIntegrationSpec.scala | Scala | mit | 4,696 |
package almond.interpreter.util
import cats.effect.IO
import scala.util.{Failure, Success}
/**
* Handles cancellation of prior running requests, in case a new one is incoming.
*
* This only applies if `asyncOpt` returns non-empty results, meaning [[B]] is asynchronously calculated,
* and that this calculatio... | alexarchambault/jupyter-scala | modules/shared/interpreter/src/main/scala/almond/interpreter/util/Cancellable.scala | Scala | apache-2.0 | 1,638 |
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.