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.rcirka.play.dynamodb.models.enums
import play.api.libs.json._
object AttributeType extends Enumeration {
type AttributeType = Value
val Numeric = Value("N")
val String = Value("S")
implicit val attributeTypeWrites = new Writes[AttributeType] {
def writes(value: AttributeType): JsValue = JsSt... | rcirka/Play-DynamoDB | src/main/scala/com/rcirka/play/dynamodb/models/enums/AttributeType.scala | Scala | mit | 347 |
package io.finch
import com.twitter.finagle.http.Request
import com.twitter.util.{Await, Future, Return, Throw}
import org.scalacheck.Prop.BooleanOperators
import org.scalatest.prop.Checkers
import org.scalatest.{FlatSpec, Matchers}
class RequestReaderValidationSpec extends FlatSpec with Matchers with Checkers {
v... | BenWhitehead/finch | core/src/test/scala/io/finch/RequestReaderValidationSpec.scala | Scala | apache-2.0 | 8,310 |
/**
* Copyright 2014 Dropbox, 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... | DEGoodmanWilson/djinni | src/source/CxCppGenerator.scala | Scala | apache-2.0 | 10,480 |
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/... | cran/rkafkajars | java/scala/collection/immutable/Traversable.scala | Scala | apache-2.0 | 1,470 |
/*
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 to in writing, software
distr... | danosipov/scalding | scalding-commons/src/main/scala/com/twitter/scalding/commons/source/VersionedKeyValSource.scala | Scala | apache-2.0 | 8,633 |
package com.looker.logDataWebinar
import com.typesafe.config.Config
// define Settings class to get application.conf values
class Settings(config: Config) {
val location = config.getString("hdfs.location")
val file_format = config.getString("hdfs.file_format")
val output_type = config.getString("hdfs.output_... | looker/spark_log_data | src/main/scala/Settings.scala | Scala | mit | 328 |
/*
* This file is part of Evo2DSim.
*
* Evo2DSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Evo2DSim is distrib... | vchuravy/Evo2DSim | core/src/main/scala/org/vastness/evo2dsim/core/evolution/genomes/NodeTag.scala | Scala | mit | 1,085 |
/*
* IntegrateIHHEntity.scala for SparkXpehh
* Copyright (c) 2015-2016 Wei Zhou, Changchun Liu, Haibin Xie All Rights Reserved.
*
* 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... | zhouweiyg/SparkXpehh | src/main/scala/com/ynu/entity/IntegrateIHHEntity.scala | Scala | mit | 1,830 |
/*
* 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 | sql/core/src/main/scala/org/apache/spark/sql/sources/filters.scala | Scala | apache-2.0 | 4,233 |
package nl.iljabooij.garmintrainer.parser.digester
import org.joda.time.DateTime
import org.joda.time.format.ISODateTimeFormat
import org.junit.Assert._
import org.mockito.Mockito._
import org.scalatest.junit.{JUnit3Suite,AssertionsForJUnit}
import org.scalatest.mock.MockitoSugar
import org.xml.sax.Attributes
class L... | chmandrade/garmintrainer | src/test/scala/nl/iljabooij/garmintrainer/parser/digester/LapBuilderFactoryTest.scala | Scala | gpl-3.0 | 999 |
/*
* Copyright © 2015-2019 the contributors (see Contributors.md).
*
* This file is part of Knora.
*
* Knora is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
*... | musicEnfanthen/Knora | webapi/src/test/scala/org/knora/webapi/responders/v2/ValuesResponderV2Spec.scala | Scala | agpl-3.0 | 180,173 |
package com.wlangiewicz.workouttracker.dao
import com.github.nscala_time.time.Imports._
import com.wlangiewicz.workouttracker.WorkoutTrackerSpec
import com.wlangiewicz.workouttracker.domain._
import org.scalatest.BeforeAndAfter
class WorkoutDaoSpec extends WorkoutTrackerSpec with BeforeAndAfter {
before {
def ... | wlk/workout-tracker-akka-http | src/test/scala/com/wlangiewicz/workouttracker/dao/WorkoutDaoSpec.scala | Scala | mit | 3,181 |
package uk.co.turingatemyhamster
package owl2
package ast
/**
*
*
* @author Matthew Pocock
*/
trait AnnotationsModuleAst extends owl2.AnnotationsModule {
importedModules : owl2.EntitiesLiteralsAnonymousIndividualsModule with owl2.OntologyModule with owl2.IriModule =>
override final type Annotation = ast.Anno... | drdozer/owl2 | core/src/main/scala/uk/co/turingatemyhamster/owl2/ast/AnnotationsModuleAst.scala | Scala | apache-2.0 | 544 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot 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 req... | rfranco/play-silhouette | silhouette-testkit/test/com/mohiva/play/silhouette/test/FakesSpec.scala | Scala | apache-2.0 | 10,644 |
package scala.lms
package epfl
package test14
import common._
import test1._
import util.OverloadHack
import java.io.{PrintWriter,StringWriter,FileOutputStream}
class TestCGen extends FileDiffSuite {
val prefix = home + "test-out/epfl/test14-"
trait DSL extends ScalaOpsPkg with TupledFunctions with Unch... | cedricbastin/copy-virtualization-lms-core | test-src/epfl/test14-scratch/TestCGen.scala | Scala | bsd-3-clause | 2,932 |
/**
* Copyright 2009 Jorge Ortiz
*
* 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... | jorgeortiz85/scala-javautils | src/main/scala/org/scala_tools/javautils/s2j/SIteratorWrapper.scala | Scala | apache-2.0 | 922 |
{{#hasEnums}}
// ----- enums
{{#enums}}
{{>enum}}
{{/enums}}
{{/hasEnums}}
| elipoz/scrooge | scrooge-generator/src/main/resources/scalagen/enums.scala | Scala | apache-2.0 | 76 |
package anomalydetection.spec
import anomalydetection.util.UtilFunctions._
/**
* Created by Seif-Eddine Benkabou on 28/08/2017.
*/
trait L2GAD{
def l2gad(DI:Array[Array[Double]],beta:Double):(Array[Array[Double]],Array[Array[Double]])= {
val DI_adjusted= for (d<-DI)
yield
{ d map (_+Double.M... | B-Seif/anomaly-detection-time-series | anomalydetection/spec/L2GAD.scala | Scala | gpl-3.0 | 1,003 |
package example
object Lists {
/**
* This method computes the sum of all elements in the list xs. There are
* multiple techniques that can be used for implementing this method, and
* you will learn during the class.
*
* For this example assignment you can use the following methods in class
* `Lis... | huajianmao/learning | coursera/parprog1/week1/example/src/main/scala/example/Lists.scala | Scala | mit | 1,898 |
object Test {
@annotation.tailrec
def bar : Nothing = {
try {
throw new RuntimeException
} catch {
case _: Throwable => bar
} finally {
bar
}
}
@annotation.tailrec
def baz : Nothing = {
try {
throw new RuntimeException
} catch {
case _: Throwable => baz
... | scala/scala | test/files/neg/t1672b.scala | Scala | apache-2.0 | 862 |
package coursier.benchmark
import java.io.ByteArrayInputStream
import java.nio.charset.StandardCharsets
import java.util.concurrent.TimeUnit
import coursier.maven.MavenRepository
import coursier.moduleString
import org.apache.maven.model.io.xpp3.MavenXpp3Reader
import org.openjdk.jmh.annotations._
import scala.concu... | alexarchambault/coursier | modules/benchmark/src/main/scala/coursier/benchmark/ParseTests.scala | Scala | apache-2.0 | 2,050 |
package actors
import akka.actor.{Actor, ActorLogging, ActorSystem}
import io.apibuilder.api.v0.models.{Diff, DiffBreaking, DiffNonBreaking, DiffUndefinedType, Publication, Version}
import io.apibuilder.internal.v0.models.{Task, TaskDataDiffVersion, TaskDataIndexApplication, TaskDataUndefinedType}
import db.{Applicati... | gheine/apidoc | api/app/actors/TaskActor.scala | Scala | mit | 6,588 |
/**
* (c) Copyright 2013 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-schema-shell | src/main/scala/org/kiji/schema/shell/DDLException.scala | Scala | apache-2.0 | 999 |
package org.jetbrains.plugins.scala
package lang.surroundWith.surrounders.scaladoc
/**
* User: Dmitry Naydanov
* Date: 3/8/12
*/
class ScalaDocWithSubscriptSurrounder extends ScalaDocWithSyntaxSurrounder {
def getSyntaxTag: String = ",,"
def getTemplateDescription: String = "Subscript: ,, ,,"
}
| ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/surroundWith/surrounders/scaladoc/ScalaDocWithSubscriptSurrounder.scala | Scala | apache-2.0 | 306 |
package com.codesimples.simple.restapi.model
case class CalculateDeductionRequestObject(jsonObject:Map[String,Any]) {
def gender(): String = {
requestBody().getOrElse("gender", "").asInstanceOf[String]
}
def height(): Int = {
requestBody().getOrElse("height", 0).asInstanceOf[Int]
}
def weight(): I... | agnaldo4j/estudos_arquitetura_limpa_scala | planner-restapi/src/main/scala/com/codesimples/simple/restapi/model/CalculateDeductionRequestObject.scala | Scala | mit | 1,649 |
/*
* Copyright (c) 2014-2018 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... | Wogan/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/ConcatOneSuite.scala | Scala | apache-2.0 | 9,472 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pgandhi999/spark | mllib/src/main/scala/org/apache/spark/ml/evaluation/MulticlassClassificationEvaluator.scala | Scala | apache-2.0 | 6,135 |
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package sbt.protocol.testing.codec
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait TestItemDetailFormats { self: sbt.internal.testing.StatusFormats with sjsonne... | Duhemm/sbt | testing/src/main/contraband-scala/sbt/protocol/testing/codec/TestItemDetailFormats.scala | Scala | bsd-3-clause | 1,396 |
package com.bigm.bot.engine
import akka.actor.{Actor, ActorLogging}
import com.bigm.bot.events.{IntentVote, Say, TextResponse}
import com.bigm.bot.services.ApiAiService
import com.google.inject.Inject
class ApiAiIntentActor @Inject()(service: ApiAiService)
extends Actor with ActorLogging {
import context.dispatc... | bigmlab/bigm-bot | src/main/scala/com/bigm/bot/engine/ApiAiIntentActor.scala | Scala | apache-2.0 | 924 |
package lila.analyse
import chess.format.pgn.{ Pgn, Tag, Turn, Move }
import chess.OpeningExplorer.Opening
import chess.{ Status, Color, Clock }
private[analyse] final class Annotator(netDomain: String) {
def apply(
p: Pgn,
analysis: Option[Analysis],
opening: Option[Opening],
winner: Option[Color]... | danilovsergey/i-bur | modules/analyse/src/main/Annotator.scala | Scala | mit | 2,266 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/index/s3/package.scala | Scala | apache-2.0 | 1,317 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-accumulo/geomesa-accumulo-compute/src/main/scala/org/locationtech/geomesa/compute/spark/GeoMesaSpark.scala | Scala | apache-2.0 | 2,676 |
package com.sksamuel.elastic4s.cat
import com.sksamuel.elastic4s.RefreshPolicy
import com.sksamuel.elastic4s.testkit.DockerTests
import org.scalatest.{FlatSpec, Matchers}
class CatNodesTest extends FlatSpec with Matchers with DockerTests {
client.execute {
bulk(
indexInto("catnodes1/landmarks").fields("n... | Tecsisa/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/cat/CatNodesTest.scala | Scala | apache-2.0 | 761 |
// These are meant to be typed into the REPL. You can also run
// scala -Xnojline < repl-session.scala to run them all at once.
def box(s : String) { // Look carefully: no =
val border = "-" * s.length + "--\n"
println("\n" + border + "|" + s + "|\n" + border)
}
box("Fred")
box("Wilma")
| nmt1994/Scala-Practica | src/week1/codes/ch02/sec10/repl-session.scala | Scala | mit | 295 |
/**
* 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... | Zhiqiang-He/kafka-0914-edit | core/src/main/scala/kafka/utils/ReplicationUtils.scala | Scala | apache-2.0 | 4,780 |
package com.github.shadowsocks
import android.content.Intent
import android.os.Bundle
import android.support.design.widget.Snackbar
import android.support.v7.app.{AlertDialog, AppCompatActivity}
import android.support.v7.widget.RecyclerView.ViewHolder
import android.support.v7.widget.Toolbar.OnMenuItemClickListener
im... | tenwx/shadowsocks-android | src/main/scala/com/github/shadowsocks/ProfileManagerActivity.scala | Scala | gpl-3.0 | 7,585 |
/*
* 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 ... | ConeyLiu/spark | mllib/src/main/scala/org/apache/spark/ml/classification/ClassificationSummary.scala | Scala | apache-2.0 | 8,384 |
package org.bitcoins.core.number
import org.bitcoins.testkitcore.gen.NumberGenerator
import org.scalacheck.{Prop, Properties}
import scala.util.Try
/** Created by chris on 6/21/16.
*/
class Int64Spec extends Properties("Int64Spec") {
property("Symmetrical serialization") = Prop.forAll(NumberGenerator.int64s) {
... | bitcoin-s/bitcoin-s | core-test/src/test/scala/org/bitcoins/core/number/Int64Spec.scala | Scala | mit | 3,086 |
package us.feliscat.ir.fulltext.indri.ja
import us.feliscat.converter.MultiLingualNgramSegmentator
import us.feliscat.converter.ja.JapaneseNgramSegmentator
import us.feliscat.ir.fulltext.indri.MultiLingualTrecTextFileFormatReviser
import us.feliscat.m17n.Japanese
import us.feliscat.sentence.ja.JapaneseSentenceSplitter... | ktr-skmt/FelisCatusZero-multilingual | libraries/src/main/scala/us/feliscat/ir/fulltext/indri/ja/JapaneseTrecTextFileFormatReviser.scala | Scala | apache-2.0 | 1,349 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.javadsl.cluster.typed
import akka.actor.ActorSystem
import akka.cluster.sharding.typed.javadsl.ClusterSharding
import javax.inject.Inject
import javax.inject.Provider
import play.api.Configuration
import play.api.E... | lagom/lagom | cluster/javadsl/src/main/scala/com/lightbend/lagom/internal/javadsl/cluster/typed/ClusterShardingTypedModule.scala | Scala | apache-2.0 | 970 |
package net.defoo
import akka.actor.{Props, Actor}
import org.apache.commons.io.FileUtils
import java.nio.file.{Paths, StandardCopyOption, Files}
import java.io.File
/**
* Created by derek on 23/02/14.
*/
class FileCopyActor extends Actor {
def receive = {
case BackupFile(jobId, srcFile, dest, Some(lastBac... | kcderek/scala-time-machine | src/main/scala/net/defoo/CopyFileActor.scala | Scala | apache-2.0 | 2,158 |
/*
* 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 | test/models/declaration/RenewRegistrationSpec.scala | Scala | apache-2.0 | 2,904 |
package sbt
package internals
import Def._
/** This reprsents a `Setting` expression configured by the sbt DSL. */
sealed trait DslEntry {
/** Called by the parser. Sets the position where this entry was defined in the build.sbt file. */
def withPos(pos: RangePosition): DslEntry
}
object DslEntry {
implicit de... | som-snytt/xsbt | main/src/main/scala/sbt/internals/DslAst.scala | Scala | bsd-3-clause | 2,725 |
package model
import java.io.File
import play.api.Play
import play.router.{DynamicPart, Parsers, StaticPart}
import scala.util.Try
/** Transforms the play Routes AST -> a representation of a model that we can use internally. */
object Transformer {
val DefaultEndpoint = "http://localhost:9000"
def <<<(routesF... | tikurahul/play-explorer | app/model/play.scala | Scala | mit | 3,154 |
/*
* Shadowsocks - A shadowsocks client for Android
* Copyright (C) 2013 <[email protected]>
*
* 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 y... | Austinpb/shadowsocks-android | src/main/scala/com/github/shadowsocks/database/DBHelper.scala | Scala | gpl-3.0 | 3,304 |
/*
* 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 to in writ... | jameswei/zipkin | zipkin-hadoop-job-runner/src/main/scala/com/twitter/zipkin/hadoop/config/WorstRuntimesPerTraceClientConfig.scala | Scala | apache-2.0 | 932 |
package com.sksamuel.elastic4s
import org.elasticsearch.action.admin.indices.recovery.{RecoveryRequest, RecoveryResponse}
import org.elasticsearch.client.Client
import scala.concurrent.Future
trait IndexRecoveryDsl {
implicit object IndexRecoveryDefinitionExecutable
extends Executable[IndexRecoveryDefinition,... | beni55/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/IndexRecoveryDsl.scala | Scala | apache-2.0 | 658 |
package xitrum.util
import java.util.{Collections, LinkedHashMap}
import java.util.Map.Entry
/**
* Non-threadsafe, non-distributed LRU cache.
*
* http://stackoverflow.com/questions/221525/how-would-you-implement-an-lru-cache-in-java-6
*/
private class NonThreadsafeLocalLruCache[K, V](capacity: Int) extends Linked... | georgeOsdDev/xitrum | src/main/scala/xitrum/util/LocalLruCache.scala | Scala | mit | 868 |
package navarrus
/**
* Represents a currency. Currencies are identified by their ISO 4217 currency codes.
*
* @param code the ISO 4217 code of the currency
* @param symbol the symbol of this currency (e.g. for the US Dollar, the symbol is "$")
* @param scale the default number of fraction digits used with this cu... | angiolep/navarrus | src/main/scala/navarrus/Currency.scala | Scala | apache-2.0 | 1,283 |
package io.fintrospect.templating
import com.twitter.finagle.Service
import com.twitter.finagle.http.{Request, Status}
import com.twitter.io.Bufs
import com.twitter.util.Await.result
import io.fintrospect.formats.Html
import io.fintrospect.templating.View.Redirect
import org.scalatest.{FunSpec, Matchers}
class Render... | daviddenton/fintrospect | core/src/test/scala/io/fintrospect/templating/RenderViewTest.scala | Scala | apache-2.0 | 1,381 |
package edu.mit.csail.cap.query
import scala.collection.mutable
import util._
/** Cumulative counts */
trait Statistics {
def traces: List[Trace]
/** Group events by a function: event => T */
def eventsBy[T](f: PartialFunction[Event, T])(implicit top: Int = 20): List[(T, Int)] = {
val out = new mutable.Ope... | kyessenov/semeru | src/main/scala/Statistics.scala | Scala | gpl-3.0 | 5,879 |
package com.sksamuel.elastic4s.requests.searches.aggs
import com.sksamuel.elastic4s.requests.common.FetchSourceContext
import com.sksamuel.elastic4s.requests.script.Script
import com.sksamuel.elastic4s.requests.searches.sort.Sort
import com.sksamuel.elastic4s.ext.OptionImplicits._
case class TopHitsAggregation(name: ... | sksamuel/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/aggs/TopHitsAggregation.scala | Scala | apache-2.0 | 2,572 |
package com.azavea.opentransit.indicators.stations
import com.azavea.opentransit._
import com.azavea.opentransit.database._
import org.apache.commons.csv.CSVPrinter
import org.apache.commons.csv.CSVStrategy.DEFAULT_STRATEGY
import java.io.{ByteArrayOutputStream, OutputStreamWriter, FileOutputStream}
import java.util.... | flibbertigibbet/open-transit-indicators | scala/opentransit/src/main/scala/com/azavea/opentransit/indicators/stations/StationStats.scala | Scala | gpl-3.0 | 2,212 |
package wiro
package client.akkaHttp
import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context
trait ClientDerivationModule extends TypePathMacro {
def deriveClientContext[A]: RPCClientContext[A] = macro ClientDerivationMacro.deriveClientContextImpl[A]
}
object ClientDerivationMacro ex... | federico-pellegatta/wiro | clientAkkaHttp/src/main/scala/ClientDerivation.scala | Scala | mit | 729 |
package example
import com.typesafe.scalalogging.slf4j.Logging
import com.typesafe.config.ConfigFactory
object Configurator extends Logging {
val conf = ConfigFactory.load( "~/testcluster" )
.withFallback(ConfigFactory.load("./testcluster"))
.withFallback(ConfigFactory.load("testcluster"))
conf.checkVa... | johanprinsloo/akka-cassandra-cluster-test | src/main/scala/example/Configurator.scala | Scala | apache-2.0 | 450 |
package com.epicport.db
import scala.slick.driver.MySQLDriver.simple._
object Db {
val db = Database.forURL("jdbc:mysql://localhost/epicport?useUnicode=true&characterEncoding=UTF-8",
driver = "com.mysql.jdbc.Driver",
user = "root",
password = "simple")
}
trait Db {
implicit val db = Db.db
} | caiiiycuk/epicport | web/src/main/scala/com/epicport/db/Db.scala | Scala | gpl-2.0 | 310 |
package edu.gsu.cs.kgem.model
import java.lang.Math.min
import edu.gsu.cs.kgem.exec.log
import scala.collection.mutable
/**
* Created with IntelliJ IDEA.
* User: aartyomenko
* Date: 4/13/13
* Time: 1:43 PM
* Class to wrap derandomized KGEM, i. e. initialization with maximizing distance between
* seeds and det... | night-stalker/2SNV | src/main/edu/gsu/cs/2snv/model/MaxDistanceSeedFinder.scala | Scala | gpl-2.0 | 2,917 |
package io.eels.cli
import java.io.PrintStream
import io.eels.{Constants, SourceParser}
import io.eels.component.avro.AvroSchemaFn
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.FileSystem
import org.apache.hadoop.hive.conf.HiveConf
object ShowSchemaMain {
implicit val fs = FileSystem.get... | sksamuel/hadoop-streams | eel-cli/src/main/scala/io/eels/cli/ShowSchemaMain.scala | Scala | apache-2.0 | 1,146 |
package polynomial
import algebra.ring.CommutativeRing
import polynomial.AdjoiningOperations._
import core.InfixOps._
trait PolynomialRing[A] extends CommutativeRing[Polynomial[A]] {
def parameter: FormalParameter
def coefficients: CommutativeRing[A]
private implicit val delegate = coefficients r_adjoin para... | dkettlestrings/thunder | src/main/scala/polynomial/PolynomialRing.scala | Scala | gpl-3.0 | 926 |
// Copyright 2015 Willem Meints
//
// 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... | wmeints/ReactivePI | core/src/main/scala/nl/fizzylogic/reactivepi/gpio/OutputPin.scala | Scala | apache-2.0 | 1,624 |
/*
Deduction Tactics
Copyright (C) 2012-2017 Raymond Dodge
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 progra... | rayrobdod/boardGame | View/src/main/scala/HashcodeColorTilesheet.scala | Scala | gpl-3.0 | 2,431 |
package de.tu_berlin.formic.example
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.model.headers.BasicHttpCredentials
import akka.http.scaladsl.server.AuthenticationFailedRejection
import akka.http.scaladsl.testkit.{ScalatestRouteTest, WSProbe}
import akka.stream.ActorMaterializer
import akka.st... | rbraeunlich/formic | example/jvm/src/test/scala/de/tu_berlin/formic/example/NetworkRouteSpec.scala | Scala | apache-2.0 | 2,190 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/frontend-2.3/src/test/scala/org/neo4j/cypher/internal/frontend/v2_3/ast/AstConstructionTestSupport.scala | Scala | apache-2.0 | 1,763 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pgandhi999/spark | mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala | Scala | apache-2.0 | 13,166 |
trait A {
type R = Int
}
def fop[R](parameter: A): parameter./*resolved: true*/R = 0
def fop[R](parameter: A): parameter./*resolved: true*/R | LPTK/intellij-scala | testdata/resolve2/bug3/SCL3773.scala | Scala | apache-2.0 | 143 |
/*
* Copyright 2015 [See AUTHORS file for list of 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 require... | pxinghao/ParallelCorrelationClustering | src/main/scala/Example.scala | Scala | apache-2.0 | 14,705 |
package com.github.mauricio.async.db.mysql
import org.specs2.mutable.Specification
import scala.concurrent.duration.Duration
import com.github.mauricio.async.db.RowData
class ZeroDatesSpec extends Specification with ConnectionHelper {
val createStatement =
"""CREATE TEMPORARY TABLE dates (
|`name` varcha... | outbrain/postgresql-async | mysql-async/src/test/scala/com/github/mauricio/async/db/mysql/ZeroDatesSpec.scala | Scala | apache-2.0 | 1,798 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | techaddict/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/v2/LookupCatalogSuite.scala | Scala | apache-2.0 | 8,636 |
// Copyright 2015,2016,2017,2018,2019,2020 Commonwealth Bank of Australia
//
// 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 req... | CommBank/grimlock | grimlock-core/src/test/scala/commbank/grimlock/TestGrimlock.scala | Scala | apache-2.0 | 2,390 |
package jp.co.cyberagent.aeromock.server.http
import io.netty.channel.ChannelHandlerContext
import io.netty.handler.codec.http.{FullHttpRequest, HttpResponse, HttpResponseStatus}
import jp.co.cyberagent.aeromock.config.Project
import jp.co.cyberagent.aeromock.core.el.VariableHelper
import jp.co.cyberagent.aeromock.cor... | CyberAgent/aeromock | aeromock-server/src/main/scala/jp/co/cyberagent/aeromock/server/http/JsonApiHttpRequestProcessor.scala | Scala | mit | 2,077 |
/*
* 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... | slamdata/slamengine | impl/src/main/scala/quasar/impl/datasource/local/LocalDatasource.scala | Scala | apache-2.0 | 1,667 |
/*
* 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 ... | akrabat/openwhisk | core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorderTests.scala | Scala | apache-2.0 | 7,591 |
package edu.neu.coe.csye._7200
package animal
trait Animal {
def alive: Boolean
}
trait Dog extends Animal {
def name: String
def alive = true
}
case class CairnTerrier(name: String, var stripped: Boolean = false) extends Dog
case class Chuweenie(name: String) extends Dog
trait Grooming[A <: Dog, B >: Dog] exten... | rchillyard/Scalaprof | FunctionalProgramming/src/main/scala/edu/neu/coe/csye/_7200/Animal.scala | Scala | gpl-2.0 | 918 |
import sbt._
object Resolvers {
val boundlessResolver = Seq(
"Boundless Repository" at "http://repo.boundlessgeo.com/main")
}
| jmarin/scale | project/Resolvers.scala | Scala | apache-2.0 | 133 |
/*
* 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.
*/
package scala.tools.partest
i... | martijnhoekstra/scala | src/partest/scala/tools/partest/TestUtil.scala | Scala | apache-2.0 | 1,216 |
package com.mpakhomov.model
import java.sql.Timestamp
// this class represents a candlestick. this what we parse incoming messages to.
// candlesticks are aggregated and sent to the clients
case class Candlestick(
ticker: String,
timestamp: Timestamp,
open: Double,
high: Double,
low: Double,
close: Double... | mpakhomov/akka-io-demo | src/main/scala/com/mpakhomov/model/Candlestick.scala | Scala | apache-2.0 | 433 |
/* Copyright 2012 Christian Douven
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | chridou/almhirt | almhirt-common/src/main/scala/almhirt/xml/XmlFunctions.scala | Scala | apache-2.0 | 13,072 |
package spinoco.protocol.mgcp.mgcppackage
trait MGCPPackage
| Spinoco/protocol | mgcp/src/main/scala/spinoco/protocol/mgcp/mgcppackage/MGCPPackage.scala | Scala | mit | 62 |
package sample.standalone_app
import skinny.micro._
import skinny.micro.contrib.jackson.JSONSupport
import scala.util._
/**
* Simple JSON formatter application.
*
* How to run:
*
* sbt samples/run
*/
object OnlineJSONFormatter extends App {
WebServer.mount(
new AsyncWebApp with JSONSupport {
post("... | xerial/skinny-micro | samples/src/main/scala/sample/standalone_app/OnlineJSONFormatter.scala | Scala | bsd-2-clause | 1,713 |
/**
* Copyright (c) 2012-2013, Tomasz Kaczmarzyk.
*
* This file is part of BeanDiff.
*
* BeanDiff is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your o... | tkaczmarzyk/beandiff | src/main/scala/org/beandiff/support/FieldSupport.scala | Scala | lgpl-3.0 | 1,251 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pgandhi999/spark | core/src/main/scala/org/apache/spark/util/SizeEstimator.scala | Scala | apache-2.0 | 15,793 |
/**
* Copyright: Copyright (C) 2016, ATS Advanced Telematic Systems GmbH
* License: MPL-2.0
*/
package org.genivi.sota.core.campaigns
import akka.actor.ActorSystem
import cats.implicits._
import org.genivi.sota.common.DeviceRegistry
import org.genivi.sota.core.UpdateService
import org.genivi.sota.core.data.{Camp... | PDXostc/rvi_sota_server | core/src/main/scala/org/genivi/sota/core/campaigns/CampaignLauncher.scala | Scala | mpl-2.0 | 3,618 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | ueshin/apache-flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala | Scala | apache-2.0 | 39,271 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-fs/geomesa-fs-storage/geomesa-fs-storage-convert/src/main/scala/org/locationtech/geomesa/fs/storage/converter/ConverterMetadataFactory.scala | Scala | apache-2.0 | 3,065 |
package com.twitter.scrooge.java_generator
import com.twitter.scrooge.ast._
import com.twitter.scrooge.frontend.ScroogeInternalException
// The rendered represents what gets printed to the output stream. value is what render_const_value returns
class ConstValue(val rendered: String, val value: String)
class PrintCo... | benhoyt/scrooge | scrooge-generator/src/main/scala/com/twitter/scrooge/java_generator/PrintConstController.scala | Scala | apache-2.0 | 5,192 |
package com.soteradefense.datawake.trails.topology.search.bolts
import java.sql.{Connection, DriverManager, PreparedStatement}
import java.util
import backtype.storm.task.TopologyContext
import backtype.storm.topology.{BasicOutputCollector, OutputFieldsDeclarer}
import backtype.storm.tuple.Tuple
import com.soteradefe... | Sotera/datawake-prefetch | trail-specific-search/src/main/scala/com/soteradefense/datawake/trails/topology/search/bolts/UpdateRankKafkaProducer.scala | Scala | apache-2.0 | 2,388 |
/*
* Copyright 2012 Pellucid and Zenexity
*
* 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... | Enalmada/datomisca | core/src/main/scala/datomisca/dbFunctions.scala | Scala | apache-2.0 | 2,395 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | bravo-zhang/spark | graphx/src/main/scala/org/apache/spark/graphx/util/PeriodicGraphCheckpointer.scala | Scala | apache-2.0 | 4,263 |
/***********************************************************************
* Copyright (c) 2017-2020 IBM
* Copyright (c) 2013-2020 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 ac... | aheyne/geomesa | geomesa-cassandra/geomesa-cassandra-datastore/src/main/scala/org/locationtech/geomesa/cassandra/index/SharedAttributeColumnMapper.scala | Scala | apache-2.0 | 4,356 |
package hu.frankdavid.ranking.strategy.util
object RichDouble {
case class Precision(p: Double)
implicit class DoubleWithAlmostEquals(val d: Double) extends AnyVal {
def ~=(d2: Double)(implicit p: Precision) = (d - d2).abs < p.p
}
}
| frankdavid/ranking | src/main/scala/hu/frankdavid/ranking/strategy/util/RichDouble.scala | Scala | apache-2.0 | 245 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.http
import java.io.File
import akka.util.ByteString
import org.specs2.mutable.Specification
import play.api.libs.Files.TemporaryFile
import play.api.mvc.Codec
import play.api.mvc.MultipartFormData
import play.api.mvc.MultipartFormDa... | benmccann/playframework | core/play/src/test/scala/play/api/http/WriteableSpec.scala | Scala | apache-2.0 | 3,394 |
/*
* Copyright 2016 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... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v3/B170.scala | Scala | apache-2.0 | 1,019 |
/*
* Copyright 2001-2014 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | cheeseng/scalatest | scalactic/src/main/scala/org/scalactic/HashingEquality.scala | Scala | apache-2.0 | 2,478 |
package io.finch.internal
import java.nio.charset.Charset
import scala.annotation.implicitNotFound
import com.twitter.concurrent.AsyncStream
import com.twitter.finagle.http.{Response, Status, Version}
import com.twitter.io.Buf
import io.finch._
import shapeless._
/**
* Represents a conversion from `A` to [[Response... | ilya-murzinov/finch | core/src/main/scala/io/finch/internal/ToResponse.scala | Scala | apache-2.0 | 3,016 |
package org.ngseq.metagenomics
import Codondict._
/**
* Created by davbzh on 2017-05-01.
*/
object ORF {
//Reverse complement dna string
def reverscomplement(seq: String): String = {
val reversecomp = new StringBuilder
val result = new StringBuilder
/*
for (nuceotide <- seq ) {
if (n... | NGSeq/ViraPipe | src/main/scala/org/ngseq/metagenomics/ORF.scala | Scala | mit | 5,864 |
package coursier.ivy
import coursier.core._
import coursier.maven.{MavenAttributes, MavenComplete}
import coursier.util.{Artifact, EitherT, Monad}
import dataclass._
@data class IvyRepository(
pattern: Pattern,
metadataPatternOpt: Option[Pattern] = None,
changingOpt: Option[Boolean] = None,
withChecksums: Boo... | alexarchambault/coursier | modules/core/shared/src/main/scala/coursier/ivy/IvyRepository.scala | Scala | apache-2.0 | 12,419 |
/*
Copyright (c) 2016, Rice University
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2.... | agrippa/spark-swat | swat/src/test/scala/org/apache/spark/rdd/cl/tests/AsyncMapTest.scala | Scala | bsd-3-clause | 2,347 |
package io.hnfmr.chapter10
import cats.Semigroup
import cats.data.Validated.{Valid, Invalid}
import cats.data.Validated
import cats.syntax.semigroup._
import cats.syntax.apply._
sealed trait Check[E, A, B] {
def apply(a: A)(implicit s: Semigroup[E]): Validated[E, B]
def map[C](f: B => C): Check[E, A, C] = Map[E... | hnfmr/advanced-scala | src/main/scala/io/hnfmr/chapter10/Check.scala | Scala | mit | 1,724 |
package us.feliscat.time
import us.feliscat.m17n.MultiLingual
import us.feliscat.text.StringOption
/**
* <pre>
* Created on 2017/02/09.
* </pre>
*
* @author K.Sakamoto
*/
trait MultiLingualJapaneseEraNameParser extends MultiLingual {
def convertToRomanCalendar(text: StringOption): StringOption
}
| ktr-skmt/FelisCatusZero-multilingual | libraries/src/main/scala/us/feliscat/time/MultiLingualJapaneseEraNameParser.scala | Scala | apache-2.0 | 313 |
/*
* 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 | collections/Capitals.scala | Scala | apache-2.0 | 1,366 |
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.