code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package com.googlecode.furnace.util.process
import java.io.File
import util.io.FilePath
sealed trait CommandLineProcess {
import Argument._
def apply(option: String): CommandLineProcess = this match {
case CommandLineProcess_(path, args) => CommandLineProcess_(path, args ::: List(argument(option)))
}
de... | tomjadams/furnace | src/main/scala/com/googlecode/furnace/util/process/CommandLineProcess.scala | Scala | apache-2.0 | 1,396 |
package com.twitter.finagle.netty4.channel
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.Stack
import com.twitter.finagle.Stack.Params
import com.twitter.finagle.client.Transporter
import com.twitter.finagle.netty4.proxy.Netty4ProxyConnectHandler
import com.twitter.util.{Await, Promise}
impor... | luciferous/finagle | finagle-netty4/src/test/scala/com/twitter/finagle/netty4/channel/Netty4ClientChannelInitializerTest.scala | Scala | apache-2.0 | 3,576 |
object Test extends App {
implicit def _1: Long = 1L
implicit def _2: Int = 0
println(implicitly[AnyVal])
}
| som-snytt/dotty | tests/run/implicits-numeric.scala | Scala | apache-2.0 | 116 |
package mix.kafka.monitor
import java.time.Duration
import java.util.concurrent.TimeUnit
import com.codahale.metrics.{Gauge, MetricRegistry, ScheduledReporter}
import com.quantifind.kafka.OffsetGetter
import kafka.utils.Logging
class LibratoOffsetReporter(metricRegistry: MetricRegistry,
r... | mix/kafka-librato-monitor | src/main/scala/mix/kafka/monitor/LibratoOffsetReporter.scala | Scala | mit | 4,004 |
package com.socrata.soql.types
import java.lang.reflect.Modifier
import com.socrata.soql.collection._
import com.socrata.soql.ast.SpecialFunctions
import com.socrata.soql.environment.FunctionName
import com.socrata.soql.functions._
sealed abstract class TestFunctions
object TestFunctions {
private val log = org.s... | socrata-platform/soql-reference | soql-analyzer/src/test/scala/com/socrata/soql/types/TestFunctions.scala | Scala | apache-2.0 | 10,553 |
/*
* Copyright 2008-2010 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | wsaccaco/lift | examples/example/src/main/scala/net/liftweb/example/snippet/ValidateSession.scala | Scala | apache-2.0 | 1,482 |
package org.fathens.colorworks.iccprofile.tag
import java.io._
import _root_.org.fathens.colorworks.binarychain._
import _root_.org.fathens.colorworks.iccprofile._
object TypeProfileSequenceDesc extends ElementBuilder[TypeProfileSequenceDesc] {
val typeSignature = "pseq"
def build(commons: TagElement.CommonHeads,... | sawatani/ColorWorks | src/main/scala/org/fathens/colorworks/iccprofile/tag/TypeProfileSequenceDesc.scala | Scala | mit | 1,695 |
/*
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | nkhuyu/scrooge | scrooge-generator/src/main/scala/com/twitter/scrooge/backend/ScalaGenerator.scala | Scala | apache-2.0 | 8,132 |
package dtos.report.row
import scala.beans.BeanProperty
import java.util
import java.lang.Double
import dtos.report.TaskDto
import dtos.report.qlkh.TaskReportBean
/**
* The Class DonViKhoiLuongRow.
*
* @author Nguyen Duc Dung
* @since 4/17/14 4:10 PM
*
*/
class DonViKhoiLuongRow {
@BeanProperty
var taskId:... | SunriseSoftVN/sunerp | app/dtos/report/row/DonViKhoiLuongRow.scala | Scala | apache-2.0 | 2,380 |
package filodb.core.memstore
import com.googlecode.javaewah.{EWAHCompressedBitmap, IntIterator}
import com.typesafe.scalalogging.StrictLogging
import org.jctools.maps.NonBlockingHashMap
import scalaxy.loops._
import filodb.core.binaryrecord2.MapItemConsumer
import filodb.core.metadata.{Column, Dataset}
import filodb.... | velvia/FiloDB | core/src/main/scala/filodb.core/memstore/PartitionKeyIndex.scala | Scala | apache-2.0 | 5,932 |
package io.swagger.client.model
case class Inline_response_200_4 (
data: Connection,
success: Boolean)
| QuantiModo/QuantiModo-SDK-Scala | src/main/scala/io/swagger/client/model/Inline_response_200_4.scala | Scala | gpl-2.0 | 114 |
package org.jetbrains.plugins.scala.editor.documentationProvider
import com.intellij.codeInsight.javadoc.JavaDocInfoGenerator
import com.intellij.lang.documentation.DocumentationMarkup
import com.intellij.psi.util.PsiUtil
import com.intellij.psi.{PsiClass, PsiDocCommentOwner, PsiElement}
import org.jetbrains.plugins.s... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/editor/documentationProvider/ScalaDocUtil.scala | Scala | apache-2.0 | 5,275 |
/*
* 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/t-streams | src/main/scala/com/bwsw/tstreams/env/defaults/TStreamsFactoryCommonDefaults.scala | Scala | apache-2.0 | 1,234 |
/*
* Copyright 2021 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/amls-frontend | app/models/moneyservicebusiness/UsesForeignCurrencies.scala | Scala | apache-2.0 | 2,065 |
package demesne
import scala.concurrent.ExecutionContext
import scala.concurrent.duration._
import akka.actor.{ ActorRef, ActorSystem, Cancellable, NotInfluenceReceiveTimeout }
import omnibus.identifier.Id
object SnapshotSpecification {
case object DoNotSnapshot extends SnapshotSpecification {
override val snap... | dmrolfs/demesne | core/src/main/scala/demesne/SnapshotSpecification.scala | Scala | apache-2.0 | 1,168 |
/**
* Copyright (C) 2016 Hurence (support@hurence.com)
*
* 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 a... | Hurence/log-island | logisland-components/logisland-processors/logisland-processor-outlier-detection/src/main/scala/com/caseystella/analytics/distribution/DistributionUtils.scala | Scala | apache-2.0 | 1,412 |
import org.scalatest.{Matchers, FunSuite}
/** @version 1.1.0 */
class WordyTest extends FunSuite with Matchers {
test("addition") {
Wordy.answer("What is 1 plus 1?") should be(Some(2))
}
test("more addition") {
pending
Wordy.answer("What is 53 plus 2?") should be(Some(55))
}
test("addition wit... | ricemery/xscala | exercises/wordy/src/test/scala/WordyTest.scala | Scala | mit | 1,958 |
import scala.tools.partest._
import scala.tools.nsc._
object Test extends DirectTest {
def code = """
class testAnn extends annotation.TypeConstraint
class A(param: Double) extends { val x: Int = 1; val y = "two" } with AnyRef {
type T = A
val inferField = ("str": @testAnn)
val annotFiel... | lrytz/scala | test/files/run/analyzerPlugins.scala | Scala | apache-2.0 | 3,298 |
package com.siqueries.zion.churn
/**
* Created by ebot on 12/18/16.
*/
class Churn {
}
| siqueries/zion | src/main/scala/com/siqueries/zion/churn/Churn.scala | Scala | apache-2.0 | 91 |
/*
* 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 ... | ddna1021/spark | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSource.scala | Scala | apache-2.0 | 14,356 |
import scala.tools.nsc._
import scala.tools.nsc.interpreter._
val n = new IMain(new Settings())
n.bind("label", "Int", new Integer(4));
n.interpret("println(2+label)");
n.close();
class SomeClass
val settings = new Settings
settings.embeddedDefaults[SomeClass] // only needed in sbt
val n = new IMain(settings)
n.int... | themerius/msc | Code/mwe/scalaInterpreterBasic.scala | Scala | mit | 400 |
package net.cosmo0920.irc.messageEventListener
import org.pircbotx.PircBotX
import org.pircbotx.hooks.ListenerAdapter
import org.pircbotx.hooks.events._
import net.cosmo0920.irc.version._
import net.cosmo0920.irc.botConfig._
import java.util.Date
class messageEventListener extends ListenerAdapter[PircBotX] {
overri... | cosmo0920/scala-ircbot-pircbotx | src/main/scala/irc/messageEventListener.scala | Scala | mit | 711 |
trait AuthFlows extends UserStore
with SessionStore
with ExecutionContextSupport {
def login(data: LoginData): Future[LoginResponse] = {
findUser(data.username).flatMap {
case None => successful(LoginFailed)
case Some(user) => {
if (!validateP... | RayRoestenburg/nljug2013 | AuthFlowFuture.scala | Scala | apache-2.0 | 627 |
/*
* This file is part of AckCord, licensed under the MIT License (MIT).
*
* Copyright (c) 2019 Katrix
*
* 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 ... | Katrix-/AckCord | data/src/main/scala/ackcord/data/getterMixins.scala | Scala | mit | 2,922 |
sealed trait Exp[T]
case class Num(n: Int) extends Exp[Int]
case class Plus(e1: Exp[Int], e2: Exp[Int]) extends Exp[Int]
case class Var[T](name: String) extends Exp[T]
case class Lambda[T, U](x: Var[T], e: Exp[U]) extends Exp[T => U]
case class App[T, U](f: Exp[T => U], e: Exp[T]) extends Exp[U]
abstract class Env { o... | som-snytt/dotty | tests/pos-special/isInstanceOf/gadt.scala | Scala | apache-2.0 | 986 |
package com.twitter.finagle.http.codec
import com.twitter.concurrent.AsyncQueue
import com.twitter.finagle.{ChannelClosedException, Service, Status}
import com.twitter.finagle.http
import com.twitter.finagle.http.{BadHttpRequest, Request, Response, Version}
import com.twitter.finagle.netty3.ChannelBufferBuf
import com... | a-manumohan/finagle | finagle-http/src/test/scala/com/twitter/finagle/http/codec/HttpServerDispatcherTest.scala | Scala | apache-2.0 | 3,412 |
package com.twitter.finatra.benchmarks
import com.twitter.inject.Test
class RouteBenchmarkTest extends Test {
"test" in {
val benchmark = new RouteBenchmark()
benchmark.testRoute()
benchmark.testRouteWithPathParams()
}
}
| tom-chan/finatra | benchmarks/src/test/scala/com/twitter/finatra/benchmarks/RouteBenchmarkTest.scala | Scala | apache-2.0 | 240 |
package breeze.linalg
import breeze.generic.UFunc
import breeze.macros.expand
import breeze.storage.Zero
import scala.reflect.ClassTag
/**
* Returns a reversed copy of the DenseVector.
* @author ktakagaki
*/
object reverse extends UFunc {
implicit def dvReverse[T:ClassTag]: Impl[DenseVector[T], DenseVector[T]] =... | nikdon/breeze | math/src/main/scala/breeze/linalg/functions/reverse.scala | Scala | apache-2.0 | 970 |
import io.hydrosphere.mist.api._
import io.hydrosphere.mist.api.ml._
import org.apache.spark.ml.Pipeline
import org.apache.spark.ml.feature.MaxAbsScaler
import org.apache.spark.ml.linalg.Vectors
import org.apache.spark.sql.SparkSession
object MaxAbsScalerJob extends MLMistJob {
def session: SparkSession = SparkSess... | KineticCookie/mist | examples-spark2/src/main/scala/MaxAbsScalerJob.scala | Scala | apache-2.0 | 1,323 |
package drt.server.feeds.lcy
import akka.NotUsed
import akka.actor.{ActorSystem, Cancellable}
import akka.stream.Materializer
import akka.stream.scaladsl.Source
import org.slf4j.{Logger, LoggerFactory}
import server.feeds.{ArrivalsFeedFailure, ArrivalsFeedResponse, ArrivalsFeedSuccess}
import scala.concurrent.Executi... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/main/scala/drt/server/feeds/lcy/LCYFeed.scala | Scala | apache-2.0 | 1,202 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.persistence.cassandra.compaction
import com.typesafe.config.{ Config, ConfigFactory }
import scala.collection.JavaConverters._
/*
* Based upon https://github.com/apache/cassandra/blob/cassandra-2.2/src/java/org/apache/cassandr... | ktoso/akka-persistence-cassandra | core/src/main/scala/akka/persistence/cassandra/compaction/BaseCompactionStrategy.scala | Scala | apache-2.0 | 3,169 |
//package latis.writer
//
//import org.junit._
//import latis.reader.tsml.TsmlReader
//import latis.ops.filter.Selection
//
//class TestInfoWriter extends WriterTest{
//
// @Test
// def test_dap2 {
// test_writer(getDataset("dap2"),"info")
// }
// @Test
// def test_fof {
// test_writer(getDataset(fof),"inf... | dlindhol/LaTiS | src/test/scala/latis/writer/TestInfoWriter.scala | Scala | epl-1.0 | 729 |
/*
* Accio is a platform to launch computer science experiments.
* Copyright (C) 2016-2018 Vincent Primault <v.primault@ucl.ac.uk>
*
* Accio 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... | privamov/accio | accio/java/fr/cnrs/liris/lumos/domain/Value.scala | Scala | gpl-3.0 | 6,946 |
package filters
import javax.inject.Inject
import akka.stream.Materializer
import controllers.routes
import models.SessionUtils
import play.api.mvc.Results._
import play.api.mvc.{Filter, RequestHeader, Result}
import scala.concurrent.{ExecutionContext, Future}
/**
* Created by karim on 4/29/16.
*/
class CheckSe... | jimmy00784/eventorganizer | app/filters/CheckSession.scala | Scala | lgpl-2.1 | 2,341 |
package metamorphic.dsl
case class Response(content: Any, code: StatusCode) | frroliveira/metamorphic | metamorphic/src/main/scala/metamorphic/dsl/Response.scala | Scala | mit | 76 |
package gx.answers
/** Question:
* http://stackoverflow.com/questions/40239959/stub-a-val-of-a-trait-with-scalamock
*/
class Location {
def continuousFeatureValues: String = "location"
}
class MyClass() {
val location: Location = new Location
}
class MyTrait extends MyClass
| josephguan/scala-stackoverflow | src/main/scala/gx/answers/answer005.scala | Scala | apache-2.0 | 290 |
package org.ai4fm.proofprocess.zeves.core.analysis
import org.ai4fm.proofprocess.Term
import org.ai4fm.proofprocess.Trace
import org.ai4fm.proofprocess.core.analysis.FeatureEqualityHelper
import org.ai4fm.proofprocess.core.analysis.ProofEntryMatcher
import org.ai4fm.proofprocess.zeves.CztTerm
import org.ai4fm.proofpro... | andriusvelykis/proofprocess | org.ai4fm.proofprocess.zeves.core/src/org/ai4fm/proofprocess/zeves/core/analysis/ZEvesProofEntryMatcher.scala | Scala | epl-1.0 | 1,434 |
package scala.meta.internal.semanticdb.scalac
import java.net.URLEncoder
import java.nio.CharBuffer
import java.nio.charset.StandardCharsets.UTF_8
import java.security.MessageDigest
import scala.collection.mutable
import scala.{meta => m}
import scala.meta.internal.io._
import scala.reflect.internal.util.{Position => ... | olafurpg/scalameta | semanticdb/scalac/library/src/main/scala/scala/meta/internal/semanticdb/scalac/InputOps.scala | Scala | bsd-3-clause | 2,724 |
package com.highcharts
import scala.language.implicitConversions
import scala.scalajs.js
import scala.scalajs.js.{`|`, UndefOr}
import com.highcharts.HighchartsAliases.SeriesCfgData
trait HighchartsImplicits {
type Cfg[T <: js.Object] = UndefOr[CleanJsObject[T]]
type CfgArray[T <: js.Object] = UndefOr[js.Array[... | Karasiq/scalajs-highcharts | src/main/scala/com/highcharts/HighchartsImplicits.scala | Scala | mit | 2,256 |
/*
* konpare
* Copyright (C) 2015 Alexander Fefelov <https://github.com/alexanderfefelov>
*
* 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 ... | alexanderfefelov/konpare | src/main/scala/com/github/alexanderfefelov/konpare/Analyzer.scala | Scala | gpl-3.0 | 13,887 |
/*
* Copyright 2014 Frugal Mechanic (http://frugalmechanic.com)
*
* 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... | frugalmechanic/fm-http | src/main/scala/fm/http/MimeTypes.scala | Scala | apache-2.0 | 6,414 |
package me.flygare
import akka.http.scaladsl.Http
import me.flygare.routes.MainRouter
import me.flygare.traits.SparkConnection
import me.flygare.utils.{HttpConfig, HttpConnection}
object ProfileService extends App with SparkConnection with HttpConnection with HttpConfig {
Http().bindAndHandle(MainRouter.routes, s"$... | flygare/Minopt | ProfileService/src/main/scala/me/flygare/ProfileService.scala | Scala | mit | 388 |
package models
import org.bson.types.ObjectId
import com.mongodb.casbah.Imports._
import com.novus.salat.dao.SalatDAO
import HubMongoContext._
import play.api.Play
import play.api.Play.current
/**
*
* @author Manuel Bernhardt <bernhardt.manuel@gmail.com>
*/
case class HubUser(_id: ObjectId = new ObjectId,
use... | delving/culture-hub | web-core/app/models/HubUser.scala | Scala | apache-2.0 | 4,525 |
/* Copyright 2012 Elias Ponvert
*
* 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... | eponvert/corpora | src/main/scala/multiword/corpus/package.scala | Scala | apache-2.0 | 747 |
package com.gu.scalaschool.class3
import java.util.concurrent.{TimeUnit, Future}
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.{Matchers, FlatSpec}
import promises._
class PromisesSpec extends FlatSpec with Matchers with ScalaFutures {
"requestWhizzBangWallopFuture" should "return a failed Futu... | guardian/scala-school | intermediate-exercises/3-promises-futures/src/test/scala/com/gu/scalaschool/class3/PromisesSpec.scala | Scala | apache-2.0 | 1,886 |
import sbt._
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
//scalaJs version is setinto the plugin.sbt file
/**
* Application settings. Configure the build for your application here.
* You normally don't have to touch the actual build definition after this.
*/
object Settings {
/** The name of you... | minettiandrea/postgres-restify | project/Settings.scala | Scala | apache-2.0 | 4,061 |
package scalaz.stream
import java.util.zip.{Deflater, Inflater}
import scala.annotation.tailrec
import scodec.bits.ByteVector
import Process._
import process1._
/**
* @define MutableProcess1 [[https://github.com/scalaz/scalaz-stream/blob/master/src/test/scala/scalaz/stream/examples/MutableProcess1.scala `MutablePro... | shawjef3/scalaz-stream | src/main/scala/scalaz/stream/compress.scala | Scala | mit | 3,370 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | Panos-Bletsos/spark-cost-model-optimizer | core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferServiceSuite.scala | Scala | apache-2.0 | 3,248 |
package scala.collection.scalatest
import scala.collection.immutable._
import org.scalatest._
import scala.collection
import scala.collection
import scala.util.hashing.Hashing
abstract class IntBagBucketTest extends FlatSpec with IntBagBucketBehaviours {
def emptyBagBucket: collection.BagBucket[Int]
def bagWit... | nicolasstucki/multisets | src/test/scala/scala/collection/scalatest/IntBagBucketTest.scala | Scala | bsd-3-clause | 1,696 |
package com.harrys.hyppo.config
import com.harrys.hyppo.worker.exec.{AvroFileCodec, ExecutorSetup, TaskLogStrategy}
import com.typesafe.config.{Config, ConfigValue, ConfigValueFactory}
import scala.collection.JavaConversions
import scala.concurrent.duration._
/**
* Created by jpetty on 8/27/15.
*/
final class Work... | harrystech/hyppo-worker | worker/src/main/scala/com/harrys/hyppo/config/WorkerConfig.scala | Scala | mit | 3,533 |
package com.sk.app.proxmock.application.domain
import com.sk.app.proxmock.application.configuration.ConfigurationContext
import org.springframework.context.ConfigurableApplicationContext
/**
* Created by Szymon on 18.05.2016.
*/
case class Config(
name: String,
port: String = "8080",
endpoints: List[Endpoi... | szymonkudzia/proxmock | sources/src/main/scala/com/sk/app/proxmock/application/domain/Config.scala | Scala | mit | 558 |
package giter8
trait Apply { self: Giter8 =>
import java.io.File
import org.apache.commons.io.FileUtils
import org.eclipse.jgit.api._
import scala.util.control.Exception.{allCatch,catching}
private val tempdir =
new File(FileUtils.getTempDirectory, "giter8-" + System.nanoTime)
/** Clean temporary dir... | Rhinofly/giter8 | app/src/main/scala/apply.scala | Scala | lgpl-3.0 | 1,343 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/main/scala/org/apache/spark/deploy/master/ApplicationState.scala | Scala | apache-2.0 | 1,032 |
package se.citerus.dddsample.application
import scala.collection.mutable.ListBuffer
import junit.framework.TestCase
import junit.framework.Assert._
import org.easymock.EasyMock._
import org.scalatest.junit.AssertionsForJUnit
import org.scalatest.mock.EasyMockSugar;
import se.citerus.dddsample.application.i... | oluies/ddd-sample-scala | src/test/scala/se/citerus/dddsample/application/BookingServiceTest.scala | Scala | mit | 2,133 |
/*
* Copyright (c) 2018. Yuriy Stul
*/
package com.stulsoft.ysps.ptypes
/**
* @author Yuriy Stul
*/
object GetTypeInRuntime extends App {
test1(new SomeClass1)
test1(new SomeClass2)
test1(new String)
test1(Long.box(1))
test1(Int)
test1(Long)
test1("Long text")
def test1(o: AnyRef): Unit = {
... | ysden123/ysps | src/main/scala/com/stulsoft/ysps/ptypes/GetTypeInRuntime.scala | Scala | mit | 450 |
package controllers
trait SessionUpdateListener {
def onSessionUpdate(update:Map[String,String])
def onSessionDrop()
} | richardchankiyin/sysdashboard | Portal/app/controllers/SessionUpdateListener.scala | Scala | gpl-3.0 | 126 |
package com.dataintuitive.luciuscore
package model.v3
package lenses
import genes._
import scalaz.Lens
object OptionLenses extends Serializable {
val stringLens = Lens.lensu[Option[String], String](
(a, value) => Some(value),
_.getOrElse("N/A")
)
def safeStringLens(fallback: String = "OO... | data-intuitive/LuciusCore | src/main/scala/com/dataintuitive/luciuscore/model/v3/lenses/OptionLenses.scala | Scala | apache-2.0 | 778 |
/*
* 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 ... | guoxiaolongzte/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2StreamingScanExec.scala | Scala | apache-2.0 | 4,830 |
package object models {
type AccountId = Int
type MessageId = Int
}
| xuwei-k/stackable-controller | sample/app/models/package.scala | Scala | apache-2.0 | 74 |
package org.finra.datagenerator.scaffolding.random
import org.finra.datagenerator.scaffolding.utils.TypeUtils
import scala.reflect.runtime.universe._
/**
* Created by dkopel on 1/12/17.
*/
case class Parameter[T <: Any](value: T)(implicit typeTag: TypeTag[T]) {
val clazz: Class[T] = TypeUtils.mirror.runtimeCl... | FINRAOS/DataGenerator | rubber-scaffolding/rubber-commons/src/main/scala/org/finra/datagenerator/scaffolding/random/Parameter.scala | Scala | apache-2.0 | 525 |
package org.example
package object algorithms {
def eq[T, U](pair: (T, U)): Boolean = pair._1 == pair._2
}
| sayon/scala-algorithm | src/org/example/algorithms/package.scala | Scala | bsd-3-clause | 112 |
package io.buoyant.router.http
import com.twitter.finagle.buoyant.Dst
import com.twitter.finagle.http.Request
import com.twitter.finagle.{Dtab, Path}
import com.twitter.util.Future
import io.buoyant.router.RoutingFactory
import io.buoyant.router.RoutingFactory.{IdentifiedRequest, RequestIdentification, UnidentifiedReq... | linkerd/linkerd | router/http/src/main/scala/io/buoyant/router/http/PathIdentifier.scala | Scala | apache-2.0 | 1,487 |
package gapt.provers.vampire
import java.io.IOException
import gapt.formats.StringInputFile
import gapt.formats.tptp.TptpFOLExporter
import gapt.formats.tptp.TptpProofParser
import gapt.proofs.resolution.ResolutionProof
import gapt.proofs.resolution.fixDerivation
import gapt.proofs.sketch.RefutationSketchToResolution... | gapt/gapt | core/src/main/scala/gapt/provers/vampire/vampire.scala | Scala | gpl-3.0 | 2,981 |
package com.mesosphere.universe.bijection
import com.mesosphere.universe
import com.mesosphere.universe.bijection.UniverseConversions._
import com.mesosphere.universe.test.TestingPackages
import com.twitter.bijection.Bijection
import com.twitter.bijection.Conversion.asMethod
import com.twitter.bijection.Injection
impo... | dcos/cosmos | cosmos-test-common/src/test/scala/com/mesosphere/universe/bijection/PackagingVersionConverterSpec.scala | Scala | apache-2.0 | 6,588 |
package org.scalajs.testinterface
import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobalScope
import scala.scalajs.reflect.Reflect
import org.scalajs.testinterface.internal.TaskDefSerializer
import sbt.testing._
/** Fetches test definitions and frameworks. */
private[scalajs] object TestDetector {
de... | xuwei-k/scala-js | test-interface/src/main/scala/org/scalajs/testinterface/TestDetector.scala | Scala | bsd-3-clause | 2,485 |
package models
import java.sql.Connection
import play.api.db.Database
case class ChangeItemTextMetadataTable(
itemTextMetadatas: Seq[ChangeItemTextMetadata]
) {
def update(itemId: Long)(implicit conn: Connection) {
itemTextMetadatas.foreach {
_.update(itemId)
}
}
}
case class ChangeItemTextMetad... | ruimo/store2 | app/models/ChangeItemTextMetadata.scala | Scala | apache-2.0 | 773 |
package com.scalableQuality.quick.core.checks.errorMessages
import com.scalableQuality.quick.mantle.error.{
DependencyError,
UnrecoverableError
}
object CheckColumnValueErrorMessages {
def invalidChecksAttributesValues(errors: List[UnrecoverableError]) = {
val errorMessage = DependencyError(
"validati... | MouslihAbdelhakim/Quick | src/main/scala/com/scalableQuality/quick/core/checks/errorMessages/CheckColumnValueErrorMessages.scala | Scala | apache-2.0 | 391 |
// Copyright (C) 2019 MapRoulette contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
package org.maproulette.exception
import play.api.libs.json.{JsValue, Json, Reads, Writes}
/**
* @author cuthbertm
*/
trait StatusMessages {
implicit val statusMessageWrites = S... | mvexel/maproulette2 | app/org/maproulette/exception/StatusMessage.scala | Scala | apache-2.0 | 681 |
/*
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* 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 app... | danielcsant/sparta | plugins/src/test/scala/com/stratio/sparta/plugin/field/defaultField/DefaultFieldTest.scala | Scala | apache-2.0 | 1,532 |
/*
* Copyright (c) 2013 Habla Computing
*
* 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... | hablapps/app-dofollow | src/test/scala/org/hablapps/dofollow/test/portal/project/task/SetUpTaskTest.scala | Scala | apache-2.0 | 9,791 |
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "computer-database"
val appVersion = "1.0"
val appDependencies = Seq(
// Add your project dependencies here,
)
val main = PlayProject(appName, appVersion, appDependencies, mai... | CMULib/CMULib | project/Build.scala | Scala | apache-2.0 | 416 |
/*
* 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/test/scala/org/apache/spark/sql/catalyst/optimizer/TransposeWindowSuite.scala | Scala | apache-2.0 | 4,250 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// Licence: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.sexp.formats
import org.ensime.sexp._
import shapeless._
class ProductFormatsSpec extends FormatSpec
with BasicFormats with StandardFormats with ProductFormats {
c... | d1egoaz/ensime-sbt | src/sbt-test/sbt-ensime/ensime-server/s-express/src/test/scala/org/ensime/sexp/formats/ProductFormatsSpec.scala | Scala | apache-2.0 | 3,761 |
/*
* Monkeyman static web site generator
* Copyright (C) 2013 Wilfred Springer
*
* 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 2
* of the License, or (at your option) an... | wspringer/monkeyman | src/main/scala/nl/flotsam/monkeyman/MonkeymanConfiguration.scala | Scala | gpl-2.0 | 9,142 |
/*
* Copyright 2013 - 2015, Daniel Krzywicki <daniel.krzywicki@agh.edu.pl>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
... | ros3n/IntOb | core/src/main/scala/pl/edu/agh/scalamas/mas/logic/BehaviourStrategy.scala | Scala | mit | 1,499 |
package io.koff.hll.facade.impl.prasanthj
import hyperloglog.HyperLogLog
import hyperloglog.HyperLogLog.HyperLogLogBuilder
import io.koff.hll.facade.{HLL, HLLBuilder}
/**
* Implementation for prasanthj/hyperloglog hll counters
* @author coffius@gmail.com
*/
class PrasanthjHLLBuilder extends HLLBuilder{
private v... | coffius/koffio-hll | src/main/scala/io/koff/hll/facade/impl/prasanthj/PrasanthjHLLBuilder.scala | Scala | mit | 1,400 |
package fi.helsinki.cs.nodes.libubispark
import collection.JavaConverters._
/**
* Created by lagerspe on 21.2.2017.
*/
object Utils {
/**
* Counts the number of elements of an iterator using a while loop rather than calling
* [[scala.collection.Iterator#size]] because it uses a for loop, which is slight... | lagerspetz/ubispark-api | LibUbispark/libubispark/src/main/java/fi/helsinki/cs/nodes/libubispark/Utils.scala | Scala | apache-2.0 | 938 |
package render_tests
import java.io.File
import com.sun.javafx.application.PlatformImpl
trait RenderUtils {
/**
* used as the last path segment for the folder in which this spec's output is generated
*/
def componentId: String
PlatformImpl.startup(() => {})
val baseDir = new File(s"target/render-tes... | arnohaase/a-diagram | src/test-render/scala/render_tests/RenderUtils.scala | Scala | apache-2.0 | 507 |
package extruder.metrics.conversions
import extruder.metrics.data.TimerValue
trait TimerConversions {
implicit def longToTimer(l: Long): TimerValue[Long] = TimerValue(l)
implicit def tupleToTimer(ll: (Long, Long)): TimerValue[Long] = TimerValue(ll._1, Some(ll._2))
}
| janstenpickle/extruder | metrics/core/src/main/scala/extruder/metrics/conversions/TimerConversions.scala | Scala | mit | 273 |
/*
* Copyright (c) 2012, The Broad Institute
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, me... | iontorrent/Torrent-Variant-Caller-stable | public/scala/qscript/org/broadinstitute/sting/queue/qscripts/examples/DevNullOutput.scala | Scala | mit | 1,826 |
package chapter.eighteen
object ExerciseTen extends App {
}
| deekim/impatient-scala | src/main/scala/chapter/eighteen/ExerciseTen.scala | Scala | apache-2.0 | 63 |
package gapt.prooftool
import ch.randelshofer.tree.sunburst.{ SunburstNode, SunburstTree, SunburstView, SunburstModel }
import ch.randelshofer.tree.{ NodeInfo, TreeNode }
import scala.swing.Publisher
import scala.swing.event.Event
/**
* This is a wrapper around the Sunburst Tree from the treeviz library. It provides... | gapt/gapt | core/src/main/scala/gapt/prooftool/ReactiveSunburstTree.scala | Scala | gpl-3.0 | 1,192 |
// Copyright 2012 Brennan Saeta
//
// This file is part of Axess
//
// Axess 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 option) any later version.
... | saeta/axess | project/Build.scala | Scala | agpl-3.0 | 1,290 |
package filodb.memory.format.vectors
import java.nio.ByteBuffer
import com.typesafe.scalalogging.StrictLogging
import debox.Buffer
import org.agrona.{DirectBuffer, ExpandableArrayBuffer, MutableDirectBuffer}
import org.agrona.concurrent.UnsafeBuffer
import spire.syntax.cfor._
import filodb.memory.{BinaryRegion, MemF... | tuplejump/FiloDB | memory/src/main/scala/filodb.memory/format/vectors/HistogramVector.scala | Scala | apache-2.0 | 30,245 |
package cpup.mc.tweak.content
import cpup.mc.lib.content.CPupContent
import cpup.mc.tweak.CPupTweak
import cpup.mc.tweak.content.tools.Tools
import cpw.mods.fml.common.event.FMLPreInitializationEvent
object Content extends CPupContent[CPupTweak.type] {
override def mod = CPupTweak
override def preInit(e: FMLPreIni... | CoderPuppy/cpup-tweak-mc | src/main/scala/cpup/mc/tweak/content/Content.scala | Scala | mit | 388 |
package dotty.tools
package dotc
package ast
import dotty.tools.dotc.transform.{ExplicitOuter, Erasure}
import typer.ProtoTypes
import transform.SymUtils._
import transform.TypeUtils._
import core._
import util.Spans._, Types._, Contexts._, Constants._, Names._, Flags._, NameOps._
import Symbols._, StdNames._, Annotat... | som-snytt/dotty | compiler/src/dotty/tools/dotc/ast/tpd.scala | Scala | apache-2.0 | 59,416 |
package com.twitter.finatra.kafkastreams.transformer.domain
trait CompositeKey[P, S] {
def primary: P
def secondary: S
}
| twitter/finatra | kafka-streams/kafka-streams/src/main/scala/com/twitter/finatra/kafkastreams/transformer/domain/CompositeKey.scala | Scala | apache-2.0 | 126 |
/**
* (c) Copyright 2014 WibiData, Inc.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* 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... | kijiproject/kiji-express | kiji-express/src/main/scala/org/kiji/express/flow/framework/BaseLocalKijiScheme.scala | Scala | apache-2.0 | 8,048 |
/* Copyright 2009-2016 EPFL, Lausanne */
object Array1 {
def foo(): Int = {
(Array.fill(5)(5))(2) = 3
0
}
}
| epfl-lara/leon | src/test/resources/regression/xlang/error/Array1.scala | Scala | gpl-3.0 | 123 |
package rovak.steamkit.steam
import rovak.steamkit.steam.language.EMsg
import rovak.steamkit.types.JobID
import rovak.steamkit.types.steamid.SteamID
trait IClientMsg {
def isProto: Boolean
var msgType: EMsg
var sessionId: Int
var steamId: SteamID
var targetJobId: JobID
var sourceJobId: JobID
def seri... | Rovak/scala-steamkit | steam/src/main/scala/rovak/steamkit/steam/IClientMsg.scala | Scala | mit | 386 |
package rwsscala.ichiba
sealed trait AsurakuArea {
def name: String
def code: Int
}
object AsurakuArea {
case object AllArea extends AsurakuArea {
val name = "全地域"
val code = 0
}
case object AllHokkaido extends AsurakuArea {
val name = "北海道エリアのすべて"
val code = 100
}
case object Hokkaido ... | nisshiee/rws-scala | core/src/main/scala/core/ichiba/AsurakuArea.scala | Scala | mit | 8,354 |
/*
* 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/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala | Scala | apache-2.0 | 28,093 |
/**
* Copyright (c) 2013 Saddle Development 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 ... | jyt109/saddle | saddle-core/src/main/scala/org/saddle/locator/LocatorDouble.scala | Scala | apache-2.0 | 1,603 |
package ch.epfl.bluebrain.nexus.iam
import java.nio.file.Paths
import _root_.io.circe.Json
import akka.actor.{ActorSystem, Address, AddressFromURIString}
import akka.cluster.Cluster
import akka.event.Logging
import akka.http.scaladsl.Http
import akka.http.scaladsl.server.RouteResult
import akka.stream.ActorMaterializ... | hygt/nexus-iam | src/main/scala/ch/epfl/bluebrain/nexus/iam/Main.scala | Scala | apache-2.0 | 5,048 |
package slack
import javax.inject.Inject
import net.gpedro.integrations.slack.{SlackAttachment, SlackMessage, SlackApi}
import org.joda.time.DateTime
import org.joda.time.Duration
import org.quartz.{JobExecutionContext, Job}
import phabricator.PhabricatorReporter
import scala.concurrent.{Await, ExecutionContext}
impo... | rsumbaly/phabricator-report | app/slack/SlackJob.scala | Scala | apache-2.0 | 2,383 |
/*
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 applicable law or agreed to in writi... | MLnick/scalanlp-core | data/src/main/scala/scalanlp/serialization/TableCellSerialization.scala | Scala | apache-2.0 | 5,550 |
package de.axeclbr.shoushiling.menu
import de.axeclbr.shoushiling.rules.VanillaGameMode
import org.scalatest.{FunSuite, Matchers}
class GameModeMenuTest extends FunSuite with Matchers {
test("createGameModeMenu should produce the correct MenuEntry") {
class Test1GameMode extends VanillaGameMode {
overrid... | axeclbr/ShouShiLing | src/test/scala/de/axeclbr/shoushiling/menu/GameModeMenuTest.scala | Scala | mit | 926 |
package controllers
import db.generators.GeneratorsDao
import io.apibuilder.api.v0.models.json._
import play.api.mvc._
import play.api.libs.json._
import java.util.UUID
import javax.inject.{Inject, Singleton}
@Singleton
class GeneratorWithServices @Inject() (
val apibuilderControllerComponents: ApibuilderController... | gheine/apidoc | api/app/controllers/GeneratorWithServices.scala | Scala | mit | 1,194 |
package scorex.transaction.state.database.blockchain
import com.google.common.primitives.Longs
import org.h2.mvstore.MVStore
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Assertions, Matchers, PropSpec}
import scorex.transaction.TransactionGen
import scorex.transaction... | B83YPoj/Waves | src/test/scala/scorex/transaction/state/database/blockchain/AssetsExtendedStateSpecification.scala | Scala | apache-2.0 | 7,382 |
package scala.concurrent.stm.svstm
import svstm.transactions.{ Transaction, TopLevelReadTransaction, TopLevelReadWriteTransaction }
import svstm.exceptions.{ WriteOnReadTransactionException, CommitException, SVSTMException }
import scala.concurrent.stm._
import scala.concurrent.stm.stubs.StubTxnExecutor
import java.ut... | fcristovao/SVSTM | src/main/scala/scala/concurrent/stm/svstm/SVSTMTxnExecutor.scala | Scala | apache-2.0 | 1,524 |
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.