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.pauldoo.euler.puzzle
import com.pauldoo.euler.common.Primes
import com.pauldoo.euler.common.LowestCommonMultiple.lowestCommonMultiple
import java.math.BigInteger
object Puzzle5 extends Puzzle {
def answer(): BigInt = {
lowestCommonMultiple(Range(1, 20).map{n => new BigInt(BigInteger.valueOf(n))});
... | pauldoo/projecteuler | src/com/pauldoo/euler/puzzle/Puzzle5.scala | Scala | isc | 323 |
/***********************************************************************
* 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-fs/geomesa-fs-storage/geomesa-fs-storage-parquet/src/main/scala/org/locationtech/geomesa/parquet/io/SimpleFeatureParquetSchemaV0.scala | Scala | apache-2.0 | 3,954 |
package pigpio
import org.scalatest.Tag
package object scaladsl {
/**
* a pitest will only be run once deployed to a pi
*/
val pitest = Tag("pigpio.scaladsl.PiIntegrationTest")
}
| jw3/pigpio-scala | src/test/scala/pigpio/scaladsl/package.scala | Scala | apache-2.0 | 192 |
package com.twitter.finagle.stats
/**
* The default behavior for formatting, align with Commons Metrics.
*/
private[twitter] object HistogramFormatter {
def labelPercentile(p: Double): String = {
// this has a strange quirk that p999 gets formatted as p9990
// Round for precision issues; e.g. 0.9998999... ... | twitter/util | util-stats/src/main/scala/com/twitter/finagle/stats/HistogramFormatter.scala | Scala | apache-2.0 | 705 |
package jk_5.nailed.ipc.codec
import io.netty.handler.codec.MessageToMessageEncoder
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame
import io.netty.channel.ChannelHandlerContext
import com.nexus.data.json.JsonObject
import java.util
/**
* No description given
*
* @author jk-5
*/
class JsonObjectE... | nailed/nailed-legacy | src/main/scala/jk_5/nailed/ipc/codec/JsonObjectEncoder.scala | Scala | unlicense | 525 |
package jp.co.bizreach.play2stub
import java.net.URL
import jp.co.bizreach.play2stub.RoutesCompiler.Route
import org.apache.commons.io.FileUtils
import play.api.Play._
import play.api._
import scala.collection.JavaConverters._
import scala.reflect.ClassTag
/**
*
*/
class StubPlugin(app: Application) extends Plugi... | bizreach/play2-stub | src/main/scala/jp/co/bizreach/play2stub/StubPlugin.scala | Scala | apache-2.0 | 6,556 |
/* *\
** _____ __ _____ __ ____ **
** / ___/ / / /____/ / / / \ FieldKit **
** / ___/ /_/ /____/ / /__ / / / (c) 2009, field.io ... | field/FieldKit.scala | src.physics/field/kit/physics/Space.scala | Scala | lgpl-3.0 | 1,966 |
/*
* Copyright 2008-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | rozza/mongo-scala-driver | examples/src/test/scala/reactivestreams/Implicits.scala | Scala | apache-2.0 | 2,319 |
package splendid.execution
import java.util.concurrent.ArrayBlockingQueue
import org.openrdf.query.BindingSet
import org.openrdf.query.QueryEvaluationException
import akka.actor.Actor
import akka.actor.ActorLogging
import akka.actor.ActorSystem
import akka.actor.Props
import info.aduna.iteration.CloseableIteration
i... | goerlitz/splendid | src/main/scala/splendid/execution/BindingSetIteration.scala | Scala | lgpl-3.0 | 2,204 |
package linkchecker.errorKernel
import akka.actor.Actor
import scala.concurrent.duration._
import akka.actor.ReceiveTimeout
import akka.actor.ActorSystem
import akka.actor.Props
object MainActor {
def props = Props[MainActor]
}
class MainActor extends Actor {
import Receptionist._
val receptionist = context.... | fabiofumarola/akka-tutorial | src/main/scala/linkchecker/errorKernel/MainActor.scala | Scala | cc0-1.0 | 1,158 |
/*
* Copyright (c) 2011-13 Miles Sabin
*
* 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... | mandubian/shapeless | core/src/main/scala/shapeless/ops/nat.scala | Scala | apache-2.0 | 6,831 |
import System.{currentTimeMillis => now}
import scala.util.Random
object par extends App {
val n = 50 * 1000 * 1000
val max = 2 * n
def random = Random nextInt max
val col = Vector.fill(n)(random).par
val target = random
val start = now
col.count(math.sqrt(_) == target)
val middle = now
col.count(math.sq... | bwmcadams/lambdaconf-2015 | speakers/marconilanna/whats_new_in_scala/par.scala | Scala | artistic-2.0 | 470 |
import sbt._
class UsePlugin(info: ProjectInfo) extends DefaultProject(info)
{
import antlr.Tool // verify that antlr is on compile classpath
lazy val check = task { Class.forName("antlr.Tool"); None } // verify antlr is on runtime classpath
} | sbt/sbt-zero-seven | src/sbt-test/project/plugins/project/build/UsePlugin.scala | Scala | bsd-3-clause | 246 |
package example
import org.scalatest._
import scala.collection.mutable.ListBuffer
import scala.language.reflectiveCalls
import example.model.Card
import example.model.Deck
import example.model.Player
import example.model.Prefab
class SimSpec extends FlatSpec with Matchers with BeforeAndAfterEach {
var cards = new ... | osake/EternalCardGameSimulator | src/test/scala/example/SimSpec.scala | Scala | gpl-3.0 | 3,845 |
/*
* Copyright 2014-2022 Netflix, 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... | Netflix/atlas | atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GraphUriSuite.scala | Scala | apache-2.0 | 2,927 |
package us.theatr.akka.quartz
import org.specs2.execute._
import org.specs2.mutable._
import akka.testkit.TestActorRef
import akka.actor.{Props, ActorSystem, Actor}
import akka.util.Timeout
import akka.pattern.ask
import scala.concurrent.duration.Duration
import scala.util.{Success}
class QuartzActor$Test extends Spe... | theatrus/akka-quartz | src/test/scala/us/theatr/akka/quartz/QuartzActor$Test.scala | Scala | apache-2.0 | 3,202 |
package pl.pholda.malpompaaligxilo.i18n
object EmptytTranslationsJSTest extends EmptyTranslationsTest
| pholda/MalpompaAligxilo | core/js/src/test/scala/pl/pholda/malpompaaligxilo/i18n/EmptytTranslationsJSTest.scala | Scala | gpl-3.0 | 103 |
import scala.io.StdIn
object TreasureHunting {
def main(args: Array[String]): Unit = {
val Array(x, y) = StdIn.readLine().split(" ").map(_.toDouble)
val Array(a, b) = StdIn.readLine().split(" ").map(_.toDouble)
val k = ((a * x) + (b * y)) / (math.pow(a, 2)+math.pow(b, 2))
val n = ((a * y) - (b ... | everyevery/programming_study | hackerrank/contest/2016w23/TreasureHunting/TreasureHunting.scala | Scala | mit | 437 |
/*
* Copyright 2022 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/iht-frontend | it/utils/WiremockHelper.scala | Scala | apache-2.0 | 2,867 |
package com.aristocrat.mandrill.services
import com.aristocrat.mandrill.MandrillClient
import com.google.inject.{Inject, Singleton}
import com.aristocrat.mandrill.requests.Tags._
import com.twitter.finagle.httpx.Response
import com.twitter.util.Future
@Singleton
class TagsService @Inject()(client: MandrillClient) {
... | aristocratic/mandrill | src/main/scala/com/aristocrat/mandrill/services/TagsService.scala | Scala | mit | 786 |
/**
* 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 | deeplang/src/it/scala/io/deepsense/deeplang/doperations/examples/SplitExample.scala | Scala | apache-2.0 | 1,012 |
/*
* 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 ... | WindCanDie/spark | sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala | Scala | apache-2.0 | 96,610 |
/*
* Copyright 2015 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | anand-singh/mongo-scala-driver | driver/src/main/scala/org/mongodb/scala/internal/FilterObservable.scala | Scala | apache-2.0 | 1,291 |
package io.getquill.context.sql.norm
import io.getquill.ast.Visibility.Hidden
import io.getquill.ast._
import io.getquill.quat.Quat
import io.getquill.quat.QuatNestingHelper._
object ExpandDistinct {
def apply(q: Ast): Ast =
q match {
case Distinct(q) =>
Distinct(apply(q))
case q =>
... | getquill/quill | quill-sql-portable/src/main/scala/io/getquill/sql/norm/ExpandDistinct.scala | Scala | apache-2.0 | 3,175 |
package net.hamnaberg.json.collection
import org.json4s._
sealed trait Value[A] extends ToJson {
def value: A
def toJson: JValue = {
Value.toJson(this)
}
}
object Value {
case class StringValue(value: String) extends Value[String]
case class NumberValue(value: BigDecimal) extends Value[BigDecimal]
c... | hamnis/scala-collection-json | src/main/scala/net/hamnaberg/json/collection/Value.scala | Scala | apache-2.0 | 2,192 |
package dispatch.spec
import java.nio.charset.Charset
import org.scalacheck._
object BasicSpecification
extends Properties("Basic")
with DispatchCleanup {
import java.net.{URLEncoder,URLDecoder}
import Prop.{forAll,AnyOperators}
val server = {
import unfiltered.netty
import unfiltered.response._
i... | maiflai/reboot | core/src/test/scala/basic.scala | Scala | lgpl-3.0 | 5,197 |
/*
* Copyright 2013 Maurício Linhares
*
* Maurício Linhares licenses this file to you 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 ... | dripower/postgresql-async | db-async-common/src/main/scala/com/github/mauricio/async/db/pool/ConnectionPool.scala | Scala | apache-2.0 | 3,869 |
package vultura.factor.inference.calibration
import vultura.factor.inference.calibration.ConvergenceStatistic.ValuedEdge
trait ConvergenceStatistic[-E <: Edge, +S]{
def apply(e: E)(old: e.TOut, updated: e.TOut): S
}
object ConvergenceStatistic{
type ValuedEdge[A] = Edge{type TOut <: A}
}
trait ConvergenceTest[-... | ziggystar/vultura-factor | src/main/scala/vultura/factor/inference/calibration/ConvergenceTest.scala | Scala | mit | 679 |
/**
* Digi-Lib-Mesh - distributed mesh library for Digi components
*
* Copyright (c) 2012-2013 Alexey Aksenov [email protected]
*
* 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
*
* h... | ezh/digi-lib-mesh | src/main/scala/org/digimead/digi/lib/mesh/hexapod/AppHexapod.scala | Scala | apache-2.0 | 4,370 |
/*
* Copyright (C) 2019 Mikhail Vorozhtsov
*
* 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... | mvv/routineer | core/src/main/scala/com/github/mvv/routineer/PathParser.scala | Scala | apache-2.0 | 959 |
/*
* 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 ... | manuzhang/incubator-gearpump | services/jvm/src/main/scala/org/apache/gearpump/services/SecurityService.scala | Scala | apache-2.0 | 10,574 |
package ch.epfl.scala.index
package server
package routes
import model._
import release._
import data.project.ProjectForm
import model.misc._
import com.softwaremill.session._, SessionDirectives._, SessionOptions._
import TwirlSupport._
import akka.http.scaladsl._
import model._
import server.Directives._
import Ur... | adamwy/scaladex | server/src/main/scala/ch.epfl.scala.index.server/routes/ProjectPages.scala | Scala | bsd-3-clause | 6,103 |
package com.cds.learnscala.extractors
import com.cds.learnscala.extractors.Fraction
object Main {
def testcase(): Unit = {
val test = Currency(29.22, "abc")
test match {
case Currency(29.23, "abc") => println("$" + 29.22)
case _ => println("not match")
}
}
case class Currency(value: D... | anancds/scala-project | learn-scala/src/main/scala/com/cds/learnscala/extractors/Main.scala | Scala | mit | 397 |
package dk.tennis.compare.rating.multiskill.model.pointcormodel
import org.junit.Assert._
import org.junit.Ignore
import org.junit.Test
import breeze.linalg.DenseMatrix
import breeze.linalg.DenseVector
import dk.bayes.math.gaussian.canonical.DenseCanonicalGaussian
import dk.bayes.math.linear.isIdentical
class Generic... | danielkorzekwa/tennis-player-compare | multiskill/src/test/scala/dk/tennis/compare/rating/multiskill/model/pointcormodel/GenericPointCorModelTest.scala | Scala | bsd-2-clause | 3,581 |
package com.cds.learnscala.json4s
import org.json4s._
import org.json4s.jackson.JsonMethods._
object Json4sDemo {
def main(args: Array[String]) {
//=========== 通过字符串解析为json AST ==============
val json1 = """ {"name":"test", "numbers" : [1, 2, 3, 4] } """
println(parse(json1))
//============= 通过DSL解... | anancds/scala-project | learn-scala/src/main/scala/com/cds/learnscala/json4s/Json4sDemo.scala | Scala | mit | 3,841 |
package com.twitter.finagle.memcached.integration
import collection.JavaConversions._
import com.twitter.conversions.time._
import com.twitter.util.{Stopwatch, Duration, RandomSocket}
import java.net.{InetAddress, BindException, ServerSocket, InetSocketAddress}
import scala.collection._
import scala.util.control.NonFa... | koshelev/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/ExternalMemcached.scala | Scala | apache-2.0 | 4,008 |
package se.gigurra.leavu3.datamodel
import se.gigurra.leavu3.interfaces.{Dlink, GameIn}
/**
* Created by kjolh on 3/30/2016.
*/
object self {
def dlinkCallsign: String = Dlink.config.callsign
def planeId: Int = GameIn.snapshot.metaData.planeId
def modelTime: Double = GameIn.snapshot.metaData.modelTime
def... | GiGurra/leavu3 | src/main/scala/se/gigurra/leavu3/datamodel/self.scala | Scala | mit | 653 |
/*
* 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 ... | practice-vishnoi/dev-spark-1 | streaming/src/main/scala/org/apache/spark/streaming/dstream/ShuffledDStream.scala | Scala | apache-2.0 | 1,745 |
package com.eevolution.context.dictionary.infrastructure.repository
import com.eevolution.context.dictionary.domain.model.PrintLabel
import com.eevolution.context.dictionary.infrastructure.db.DbContext._
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is fre... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/repository/PrintLabelMapping.scala | Scala | gpl-3.0 | 1,863 |
import sbt._
import Keys._
object ScorexBuild extends Build {
lazy val buildSettings = Seq(
organization := "org.consensusresearch",
version := "1.0.4-SNAPSHOT",
scalaVersion := "2.11.7"
)
def subModule(id: String): Project = Project(id = id, base = file(s"scorex-$id"))
lazy val root = Project(i... | pozharko/Scorex-Lagonaki | project/ScorexBuild.scala | Scala | cc0-1.0 | 432 |
/*
*
* Copyright (c) 2016 Sylvain Julmy
*
* 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) any later version.
*
* This program is... | SnipyJulmy/MSE_1617_PA | KlugHDL/src/main/scala/klughdl/core/model/Port.scala | Scala | gpl-2.0 | 2,294 |
package org.pinky.code.util.jdbc
import java.sql.DriverManager
import DriverManager.{getConnection => connect}
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.Spec
import org.pinky.util.ARM.using
import org.pinky.util.jdbc.ConnectionWrapper
/**
* Created by IntelliJ IDEA.
* User: phausel
* ... | pk11/pinky-util | src/test/scala/org/pinky/util/jdbc/DBSpec.scala | Scala | bsd-3-clause | 1,860 |
package io.udash.generator.plugins.jetty
import java.io.File
import io.udash.generator.exceptions.InvalidConfiguration
import io.udash.generator.plugins._
import io.udash.generator.plugins.sbt.{SBTModulesPlugin, SBTProjectFiles}
import io.udash.generator.plugins.utils.{FrontendPaths, UtilPaths}
import io.udash.genera... | UdashFramework/udash-generator | core/src/main/scala/io/udash/generator/plugins/jetty/JettyLauncherPlugin.scala | Scala | apache-2.0 | 6,398 |
/*
* 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
*... | fusepoolP3/p3-silk | silk-mapreduce/src/main/scala/de/fuberlin/wiwiss/silk/hadoop/impl/SilkInputSplit.scala | Scala | apache-2.0 | 1,972 |
/*
* Copyright 2014-2022 Netflix, 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... | Netflix/atlas | atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/HostSource.scala | Scala | apache-2.0 | 4,069 |
// Copyright (C) 2014 Open Data ("Open Data" refers to
// one or more of the following companies: Open Data Partners LLC,
// Open Data Research LLC, or Open Data Capital LLC.)
//
// This file is part of Hadrian.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in ... | opendatagroup/hadrian | hadrian/src/test/scala/lib/cast.scala | Scala | apache-2.0 | 28,961 |
/*
* 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 ... | paulcastro/openwhisk | tests/src/test/scala/system/basic/WskRestBasicNode6Tests.scala | Scala | apache-2.0 | 1,070 |
package com.thangiee.lolhangouts.ui.sidedrawer
import android.content.Context
import android.graphics.Typeface
import android.view.{View, ViewGroup}
import android.widget.{BaseAdapter, ImageView, TextView}
import at.markushi.ui.RevealColorView
import com.thangiee.lolhangouts.R
import com.thangiee.lolhangouts.ui.sidedr... | Thangiee/LoL-Hangouts | src/com/thangiee/lolhangouts/ui/sidedrawer/DrawerItemAdapter.scala | Scala | apache-2.0 | 2,651 |
package com.gu.automation.api
import org.scalatest._
import scala.concurrent.Await
import scala.concurrent.duration._
/**
* Created by jduffell on 12/06/2014.
*/
class AuthApiTest extends FlatSpec with Matchers {
val apiRoot = "https://idapi.code.dev-theguardian.com"
"The auth api" should "let us log in as a... | guardian/scala-automation-api-client | src/test/scala/com/gu/support/api/AuthApiTest.scala | Scala | apache-2.0 | 1,095 |
package part2actors
import akka.actor.{Actor, ActorRef, ActorSystem, Props}
/**
* How to change actor behaviour programmatically.
*/
object ActorBehavior extends App {
object FussyKid {
case object KidAccept
case object KidReject
val HAPPY = "happy"
val SAD = "sad"
}
class FussyKid extends... | guhemama/moocs | RockAkka/src/main/scala/part2actors/ActorBehavior.scala | Scala | bsd-3-clause | 5,254 |
package ch5
import scala.annotation.tailrec
import Stream._
object Exercise6 {
implicit class StreamExt[+A](val self: Stream[A]) extends AnyVal {
def foldRight[B](z: => B)(f: (A, => B) => B): B = self match {
case Cons(h, t) => f(h(), t().foldRight(z)(f))
case _ => z
}
def headOption: Optio... | rucka/fpinscala | src/main/scala/fpinscala/ch5/Exercise6.scala | Scala | gpl-2.0 | 725 |
/*
* This file is part of AnyMime, a program to help you swap files
* wirelessly between mobile devices.
*
* Copyright (C) 2011 Timur Mehrvarz, timur.mehrvarz(a)gmail(.)com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published... | mehrvarz/Anymime | src/org/timur/anymime/ShowSelectedFilesActivity.scala | Scala | gpl-3.0 | 16,807 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.javadsl.broker.kafka
import java.io.Closeable
import java.io.File
import java.util.concurrent.atomic.AtomicLong
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import akka... | ignasi35/lagom | service/javadsl/kafka/server/src/test/scala/com/lightbend/lagom/internal/javadsl/broker/kafka/JavadslKafkaApiSpec.scala | Scala | apache-2.0 | 19,108 |
package com.goibibo.sqlshift.commons
import java.util.Properties
import java.util.regex._
import com.goibibo.sqlshift.models.Configurations.{DBConfiguration, S3Config}
import com.goibibo.sqlshift.models.InternalConfs.{IncrementalSettings, InternalConfig, TableDetails, DBField}
import org.apache.spark.sql._
import org... | goibibo/SqlShift | src/main/scala/com/goibibo/sqlshift/commons/MySQLToRedshiftMigrator.scala | Scala | mit | 23,986 |
/**
* 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... | usakey/kafka | core/src/test/scala/other/kafka/StressTestLog.scala | Scala | apache-2.0 | 3,792 |
package com.twitter.jvm
import com.twitter.conversions.StorageUnitOps._
import com.twitter.util.Time
object NilJvm extends Jvm {
val opts: Opts = new Opts {
def compileThresh: Option[Int] = None
}
def forceGc(): Unit = System.gc()
val snapCounters: Map[String, String] = Map()
val snap: Snapshot = Snapsh... | twitter/util | util-jvm/src/main/scala/com/twitter/jvm/NilJvm.scala | Scala | apache-2.0 | 622 |
/*
* Part of NDLA article-api.
* Copyright (C) 2016 NDLA
*
* See LICENSE
*
*/
package no.ndla.articleapi.model.domain
import com.sksamuel.elastic4s.analyzers._
import no.ndla.articleapi.ArticleApiProperties.DefaultLanguage
import no.ndla.language.model.LanguageTag
object Language {
val UnknownLanguage: Langu... | NDLANO/article-api | src/main/scala/no/ndla/articleapi/model/domain/Language.scala | Scala | gpl-3.0 | 4,198 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009 Mark Harrah
*/
package xsbt
import scala.tools.nsc.{io, plugins, symtab, Global, Phase}
import io.{AbstractFile, PlainFile, ZipArchive}
import plugins.{Plugin, PluginComponent}
import symtab.Flags
import scala.collection.mutable.{HashMap, HashSet, Map, Set}
import ... | harrah/xsbt | compile/interface/src/main/scala/xsbt/Analyzer.scala | Scala | bsd-3-clause | 4,950 |
package android
import java.io.File
import android.Dependencies.{AarLibrary, ApkLibrary, LibraryDependency}
import com.android.builder.core.{AaptPackageProcessBuilder, AndroidBuilder, VariantType}
import com.android.builder.model.AaptOptions
import com.android.builder.dependency.{LibraryDependency => AndroidLibrary}
... | dant3/android-sdk-plugin | src/resources.scala | Scala | bsd-3-clause | 20,902 |
/*
* Copyright 2016 Dennis Vriend
*
* 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... | wwwiiilll/akka-persistence-jdbc | src/main/scala/akka/persistence/jdbc/query/journal/JdbcReadJournalProvider.scala | Scala | apache-2.0 | 1,041 |
package com.twitter.util
import com.twitter.conversions.DurationOps._
import java.util.concurrent.ConcurrentLinkedQueue
import java.util.concurrent.ExecutionException
import java.util.concurrent.{Future => JFuture}
import java.util.concurrent.atomic.AtomicInteger
import org.mockito.ArgumentMatchers.any
import org.mock... | twitter/util | util-core/src/test/scala/com/twitter/util/FutureTest.scala | Scala | apache-2.0 | 60,883 |
package model
import com.google.gdata.client.calendar.CalendarService
import com.google.gdata.client.calendar.CalendarQuery
import org.joda.time.LocalDate
import java.text.SimpleDateFormat
import java.net.URL
import org.joda.time.DateTime
import com.google.gdata.data.calendar.CalendarEventFeed
import play.api.libs.jso... | Sorokan/LeosStartpage | app/model/GoogleCalendar.scala | Scala | gpl-3.0 | 2,548 |
package beyond.engine.javascript.lib.database
import reactivemongo.bson.BSONObjectID
case class ObjectId(bson: BSONObjectID) {
def this(id: String) = this(BSONObjectID(id))
override val toString: String = bson.stringify
def toJSON(key: String): String = s"ObjectId($toString)"
}
| SollmoStudio/beyond | core/app/beyond/engine/javascript/lib/database/ObjectId.scala | Scala | apache-2.0 | 288 |
/*
* Receive.scala
* (Cord)
*
* Copyright (c) 2015-2020 Hanns Holger Rutz.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* [email protected]
*/
package de.sciss.cord
package objects
import de.sciss.cord... | Sciss/Cord | src/main/scala/de/sciss/cord/objects/Receive.scala | Scala | lgpl-2.1 | 900 |
object Test extends App {
class Bar[T]
implicit def barInt: Bar[Int] = {
println("barInt")
new Bar[Int]
}
implicit def bar[T]: Bar[T] = {
println("bar")
new Bar[T]
}
implicitly[Bar[Int]]
locally {
def barInt: Unit = ???
implicitly[Bar[Int]]
// used to resolve to bar, but
... | som-snytt/dotty | tests/run/i5224.scala | Scala | apache-2.0 | 394 |
/*
* Copyright 2010-2020 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... | lift/framework | persistence/mongodb/src/main/scala/net/liftweb/mongodb/MongoDocument.scala | Scala | apache-2.0 | 9,047 |
package simulations
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class EpidemySuite extends FunSuite {
test("population"){
val es = new EpidemySimulator
assert(es.persons.size == es.SimConfig.population)
... | kailuowang/PrinciplesOfReactiveProgramming | simulations/src/test/scala/simulations/EpidemySuite.scala | Scala | mit | 4,881 |
/**
* 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... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/main/scala/kafka/server/DelayedDeleteRecords.scala | Scala | apache-2.0 | 5,089 |
/* Title: Pure/Concurrent/event_timer.scala
Author: Makarius
Initiate event after given point in time.
Note: events are run as synchronized action within a dedicated thread
and should finish quickly without further ado.
*/
package isabelle
import java.util.{Timer, TimerTask, Date => JDate}
object E... | larsrh/libisabelle | modules/pide/2017/src/main/scala/Concurrent/event_timer.scala | Scala | apache-2.0 | 715 |
package io.vamp.operation.controller
import java.time.OffsetDateTime
import java.time.temporal.ChronoUnit
import akka.actor.{ ActorRef, Props }
import akka.pattern.ask
import akka.stream.actor.ActorPublisher
import akka.stream.actor.ActorPublisherMessage.{ Cancel, Request }
import akka.stream.scaladsl.Source
import a... | magneticio/vamp | operation/src/main/scala/io/vamp/operation/controller/EventApiController.scala | Scala | apache-2.0 | 4,654 |
package pl.pholda.malpompaaligxilo.dsl.expr.logical
import pl.pholda.malpompaaligxilo.dsl.DslFormExpr
import pl.pholda.malpompaaligxilo.form.FormInstance
case class Negation(expr: DslFormExpr[_]) extends DslFormExpr[Any] {
override def apply(formInstance: FormInstance[_]): Any = {
expr(formInstance) match {
... | pholda/MalpompaAligxilo | dsl/shared/src/main/scala/pl/pholda/malpompaaligxilo/dsl/expr/logical/Negation.scala | Scala | gpl-3.0 | 375 |
/*
* 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 ... | Intel-bigdata/OAP | oap-native-sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala | Scala | apache-2.0 | 19,739 |
import sbt._
import Keys._
object BuildSettings {
val paradiseVersion = "2.0.1"
val buildSettings = Defaults.defaultSettings ++ Seq(
version := "1.0.0",
scalacOptions ++= Seq(""),
scalaVersion := "2.11.4",
resolvers += Resolver.sonatypeRepo("snapshots"),
resolvers += Resolver.sonatypeRepo("rele... | twitter-forks/sbt | sbt/src/sbt-test/source-dependencies/macro-annotation/project/Build.scala | Scala | bsd-3-clause | 1,209 |
/*
* 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... | jeppenejsum/liftweb | framework/lift-base/lift-webkit/src/main/scala/net/liftweb/builtin/snippet/Loc.scala | Scala | apache-2.0 | 1,009 |
abstract class Foo {
def bar(): Unit = this match {
case Foo_1() => //do something
case Foo_2() => //do something
// Works fine
}
def baz(that: Foo): Unit = (this, that) match {
case (Foo_1(), _) => //do something
case (Foo_2(), _) => //do something
//... | dotty-staging/dotty | tests/pos-special/fatal-warnings/t10373.scala | Scala | apache-2.0 | 417 |
package chess
import Pos._
import format.Visual.addNewLines
class GameTest extends ChessTest {
"capture a piece" should {
"add it to the dead pieces" in {
val game = Game().playMoves(
E2 -> E4,
D7 -> D5,
E4 -> D5)
game must beSuccess.like {
case g ⇒ g.deads must have... | cxd4/scalachess | src/test/scala/GameTest.scala | Scala | mit | 1,278 |
package org.jetbrains.plugins.scala
package lang
package refactoring
package namesSuggester
import java.util.regex.{Matcher, Pattern}
import com.intellij.openapi.project.Project
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.{JavaPsiFacade, PsiClass, PsiNamedElement}
import org.atteo.evo.inf... | katejim/intellij-scala | src/org/jetbrains/plugins/scala/lang/refactoring/namesSuggester/NameSuggester.scala | Scala | apache-2.0 | 12,068 |
/*
* 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/HiveUDAFSuite.scala | Scala | apache-2.0 | 11,674 |
package com.twitter.finatra.json.internal.caseclass.validation.validators
import com.twitter.finatra.json.internal.caseclass.validation.validators.TimeGranularityValidator._
import com.twitter.finatra.validation.{ErrorCode, TimeGranularity, ValidationMessageResolver, ValidationResult, Validator}
import java.util.concu... | deanh/finatra | jackson/src/main/scala/com/twitter/finatra/json/internal/caseclass/validation/validators/TimeGranularityValidator.scala | Scala | apache-2.0 | 1,827 |
/*
* 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 ... | windeye/spark | core/src/main/scala/org/apache/spark/deploy/master/ui/MasterWebUI.scala | Scala | apache-2.0 | 2,789 |
/*
* 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 ... | vinodkc/spark | core/src/main/scala/org/apache/spark/SparkContext.scala | Scala | apache-2.0 | 131,049 |
package model
import com.wordnik.swagger.annotations.{ ApiModelProperty, ApiModel }
import spray.json.DefaultJsonProtocol
import scala.annotation.meta.field
/**
* Created by gneotux on 16/07/15.
*/
@ApiModel(description = "An Company entity")
case class Company(
@(ApiModelProperty @field)(value = "unique identif... | Gneotux/pfc | src/main/scala/model/Company.scala | Scala | apache-2.0 | 1,031 |
/*
* 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/init-repository | src/main/scala/uk/gov/hmrc/initrepository/HttpTransport.scala | Scala | apache-2.0 | 2,152 |
package org.bitcoins.script.control
import org.bitcoins.script.arithmetic.OP_ADD
import org.bitcoins.script.bitwise.OP_EQUAL
import org.bitcoins.script.constant.{OP_2, OP_1, OP_0}
import org.scalatest.{MustMatchers, FlatSpec}
/**
* Created by chris on 1/6/16.
*/
class ControlOperationsTest extends FlatSpec with Mus... | Christewart/scalacoin | src/test/scala/org/bitcoins/script/control/ControlOperationsTest.scala | Scala | mit | 799 |
/* 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... | iesl/fuse_ttl | src/factorie-factorie_2.11-1.1/src/main/scala/cc/factorie/la/Tensor1.scala | Scala | apache-2.0 | 23,200 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/math/Ordering.scala | Scala | bsd-3-clause | 19,852 |
package com.example.pingpong
import android.view.{Gravity, ViewGroup, LayoutInflater}
import android.os.Bundle
import android.widget.{FrameLayout, Button}
import android.view.ViewGroup.LayoutParams._
import macroid._
import macroid.FullDsl._
import macroid.contrib.TextTweaks
import macroid.Ui
import macroid.akka.Akka... | macroid/macroid-akka-pingpong | src/main/scala/com/example/pingpong/RacketFragment.scala | Scala | apache-2.0 | 1,679 |
package net.revenj.server
case class CommandResultDescription[TFormat](
requestID: String,
result: CommandResult[TFormat],
start: Long) {
val duration: Long = (System.nanoTime - start) / 1000
}
| ngs-doo/revenj | scala/revenj-akka/src/main/scala/net/revenj/server/CommandResultDescription.scala | Scala | bsd-3-clause | 211 |
import sbt._
object Globals {
val name = "akka-rabbit"
val scalaVersion = "2.10.4"
val crossScalaVersions = Seq("2.10.4", "2.11.1")
val jvmVersion = "1.7"
val homepage = Some(url("http://www.coiney.com"))
val startYear = Some(2014)
val sum... | Coiney/akka-rabbit | project/Globals.scala | Scala | bsd-3-clause | 1,678 |
package pcap.streams
import org.scalatest._
import scodec.bits.BitVector
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import pcap.codec.Codecs.WithHeaderDecoder
import scodec.bits.ByteVector
import akka.util.ByteString
import akka.stream.scaladsl.Source
import scala.collection.immutable.Seq
impo... | searler/pcap | src/test/scala/pcap/streams/SingleBinaryStructuredStreamSpec.scala | Scala | apache-2.0 | 4,688 |
package tuner.gui
import scala.swing.Button
import scala.swing.BoxPanel
import scala.swing.Orientation
import scala.swing.Publisher
import scala.swing.TextField
import scala.swing.event.ButtonClicked
import scala.swing.event.ValueChanged
/**
* Element for selecting either a file or directory path
*
* Sends ValueC... | gabysbrain/tuner | src/main/scala/tuner/gui/PathPanel.scala | Scala | mit | 1,099 |
package info.siddhuw.factors
import java.text.SimpleDateFormat
import com.github.tototoshi.csv.CSVReader
import com.typesafe.scalalogging.LazyLogging
import info.siddhuw._
import info.siddhuw.factors.ResultType.ResultType
import info.siddhuw.factors.utils.ClubPerformanceUtils
/**
* This factor works as follows.:
*... | siddhuwarrier/intl-odds-calculator | src/main/scala/info/siddhuw/factors/ClubPerformanceFactor.scala | Scala | apache-2.0 | 3,662 |
/*
* Copyright (c) $date.year. Webtrends (http://www.webtrends.com)
* @author $user on $date.get('MM/dd/yyyy hh:mm a')
*/
package com.webtrends.service
import com.webtrends.harness.app.Harness
import org.specs2.mutable.Specification
class ${service-name}Integration extends Specification {
//TODO TestHarness nee... | Crashfreak/wookiee | archetypes/wookiee-service-archetype/src/main/resources/archetype-resources/src/test/scala/com/webtrends/service/__service-name__Integration.scala | Scala | apache-2.0 | 648 |
package modules.text.term.en
import modules.ner.en.EnglishNamedEntityRecognizerInGlossary
import modules.text.term.MultiLingualTermNormalizerInGlossary
import us.feliscat.m17n.English
import us.feliscat.ner.NamedEntity
import us.feliscat.text.StringOption
/**
* <pre>
* Created on 2017/02/09.
* </pre>
*
* @a... | ktr-skmt/FelisCatusZero-multilingual | src/main/scala/modules/text/term/en/EnglishTermNormalizerInGlossary.scala | Scala | apache-2.0 | 579 |
package it.unich.jandom.utils.numberext
import breeze.math.Field
import breeze.storage.Zero
import breeze.linalg._
import breeze.linalg.operators._
import org.netlib.util.intW
import it.unich.jandom.utils.breeze.countNonZero
import breeze.linalg.support.CanTraverseValues
import breeze.linalg.support.CanTraverseValues.... | rubino22/JDBeta | core/src/main/scala/it/unich/jandom/utils/numberext/ModInteger.scala | Scala | lgpl-3.0 | 5,688 |
package mimir.util
import java.io.{Reader,File}
import org.jline.terminal.{Terminal,TerminalBuilder}
import org.jline.reader.{LineReader,LineReaderBuilder,EndOfFileException,UserInterruptException}
import com.typesafe.scalalogging.LazyLogging
class LineReaderInputSource(
terminal: Terminal,
historyFile: String =... | UBOdin/mimir | src/main/scala/mimir/util/LineReaderInputSource.scala | Scala | apache-2.0 | 1,561 |
package util
import jp.sf.amateras.scalatra.forms._
import org.scalatra.i18n.Messages
trait Validations {
/**
* Constraint for the identifier such as user name, repository name or page name.
*/
def identifier: Constraint = new Constraint(){
override def validate(name: String, value: String, messages: M... | unixcrh/gitbucket | src/main/scala/util/Validations.scala | Scala | apache-2.0 | 1,018 |
package mimir.demo
import java.io._
import org.specs2.reporter.LineLogger
import org.specs2.specification.core.{Fragment,Fragments}
import mimir.test._
import mimir.util._
import mimir.algebra.ID
object TimeSeqScenarios
extends SQLTestSpecification("TimeSeq")
{
sequential
"The Trivial Time Series" should {
... | UBOdin/mimir | src/test/scala/mimir/demo/TimeSeqScenarios.scala | Scala | apache-2.0 | 1,155 |
/*
* 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 ... | liutang123/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ExpressionTypeCheckingSuite.scala | Scala | apache-2.0 | 10,020 |
package org.example
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.spark.streaming._
import org.apache.spark.streaming.twitter._
import org.apache.spark.streaming.StreamingContext._
import org.atilika.kuromoji._
import org.atilika.kuromoj... | j138/handle-spark | src/main/scala/org/example/Handlespark.scala | Scala | apache-2.0 | 3,585 |
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.