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 io.circe.generic.util.macros
import io.circe.{ Codec, Decoder, Encoder }
import scala.reflect.macros.blackbox
abstract class JsonCodecMacros {
val c: blackbox.Context
import c.universe._
protected[this] def semiautoObj: Symbol
protected[this] def deriveMethodPrefix: String
private[this] def isCas... | travisbrown/circe | modules/generic/shared/src/main/scala-2/io/circe/generic/util/macros/JsonCodecMacros.scala | Scala | apache-2.0 | 4,498 |
/*
* 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 ... | himanshudhami/PredictionIO | core/src/main/scala/org/apache/predictionio/controller/PDataSource.scala | Scala | apache-2.0 | 2,322 |
/*
* 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 ... | jackylk/incubator-carbondata | index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestAlterTableColumnRenameWithSecondaryIndex.scala | Scala | apache-2.0 | 4,502 |
/*
* 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 ... | h2oai/sparkling-water | examples/src/main/scala/ai/h2o/sparkling/examples/CraigslistJobTitlesStructuredStreamingApp.scala | Scala | apache-2.0 | 2,307 |
package utils
import models.ZkKafka
import models.ZkKafka._
import org.apache.commons.codec.digest.DigestUtils
import org.joda.time.DateTime
import org.joda.time.format.DateTimeFormat
import org.joda.time.DateTime
import play.api.i18n.Messages
import play.api.libs.json.Json._
import play.api.libs.json._
object JsonFo... | evertrue/capillary | app/utils/JsonFormats.scala | Scala | mit | 1,112 |
package com.appliedscala.events
import java.util.UUID
import org.joda.time.DateTime
import play.api.libs.json.{JsObject, Json}
/**
*
* AnswerUpdated class
* <p/>
*/
case class AnswerUpdated(answerId: UUID, answerText: String, questionId: UUID, updatedBy: UUID, updated: DateTime)
extends EventData {
over... | getArtemUsername/play-and-events | events/src/main/scala/com/appliedscala/events/AnswerUpdated.scala | Scala | mit | 548 |
package org.glotaran.kernel.types.messages.supervisor
/**
* Send to supervisor to add a spefific number of workeractors
*/
case class AddWorker(number: Int)
| glotaran/glotaran-kernel | glotaran-kernel-types/src/main/scala/org/glotaran/kernel/types/messages/supervisor/AddWorker.scala | Scala | gpl-3.0 | 164 |
//############################################################################
// Exceptions
//############################################################################
//############################################################################
abstract class IntMap[A] {
def lookup(key: Int): A = this match... | scala/scala | test/files/run/exceptions.scala | Scala | apache-2.0 | 1,468 |
package controllers
import play.api._
import play.api.mvc._
import play.api.data._
import play.api.data.Forms._
import java.util.{Date}
import models._
import views._
/**
* Manage tasks related operations.
*/
class Tasks extends Controller with Secured {
/**
* Display the tasks panel for this project.
*/... | scoverage/scoverage-maven-samples | playframework/singlemodule/zentasks/zentasks-scala-2.10/app/controllers/Tasks.scala | Scala | apache-2.0 | 2,278 |
/**
* 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... | SumoLogic/shellbase | shellbase-core/src/test/scala/com/sumologic/shellbase/ShellCommandSetTest.scala | Scala | apache-2.0 | 6,069 |
package mesosphere.marathon.core.launcher.impl
import mesosphere.marathon.core.launcher.TaskOp
import mesosphere.marathon.core.matcher.base.util.OfferOperationFactory
import mesosphere.marathon.core.task.Task
import mesosphere.marathon.core.task.Task.LocalVolume
import mesosphere.util.state.FrameworkId
import org.apac... | pgkelley4/marathon | src/main/scala/mesosphere/marathon/core/launcher/impl/TaskOpFactoryHelper.scala | Scala | apache-2.0 | 1,464 |
package org.fedoraproject.mobile
import Implicits._
import android.content.Context
import android.os.Bundle
import android.util.Log
import android.view.{ LayoutInflater, Menu, MenuItem, View, ViewGroup }
import android.widget.{ AdapterView, ArrayAdapter, LinearLayout, TextView, Toast }
import argonaut._, Argonaut._
... | fedora-infra/mobile | src/main/scala/fragment/status/StatusFragment.scala | Scala | mpl-2.0 | 2,286 |
/*package parsequery
import org.scalameter.api._
import org.scalameter.picklers.Implicits._
import org.scalameter.Measurer.{RelativeNoise, OutlierElimination, PeriodicReinstantiation, MemoryFootprint}
import org.scalameter.Key
import java.text.SimpleDateFormat
import java.util.Calendar
import parsec._
import parsec.... | manojo/parsequery | macros/src/bench/scala/parsequery/ParsequeryBenchmark.scala | Scala | mit | 1,999 |
/***********************************************************************
* Copyright (c) 2013-2017 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... | ronq/geomesa | geomesa-index-api/src/test/scala/org/locationtech/geomesa/index/utils/bin/BinSorterTest.scala | Scala | apache-2.0 | 5,042 |
package com.emstlk.nacl4s.crypto.box
import com.emstlk.nacl4s.crypto.Utils._
import com.emstlk.nacl4s.crypto.core.HSalsa20
import com.emstlk.nacl4s.crypto.scalarmult.Curve25519
import com.emstlk.nacl4s.crypto.secretbox.XSalsa20Poly1305
object Curve25519XSalsa20Poly1305 {
val seedBytes = 32
val publicKeyBytes = 3... | emstlk/nacl4s | src/main/scala/com/emstlk/nacl4s/crypto/box/Curve25519XSalsa20Poly1305.scala | Scala | mit | 1,642 |
/*
* Copyright 2016 http4s.org
*
* 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... | http4s/http4s | testing/shared/src/test/scala/org/http4s/Http4sSuite.scala | Scala | apache-2.0 | 1,916 |
package com.twitter.finatra.thrift.filters
import com.twitter.finagle.{Filter, Service}
import com.twitter.finatra.thrift.exceptions.ExceptionManager
import com.twitter.util.Future
import javax.inject.{Inject, Singleton}
/**
* A [[ThriftFilter]] which handles exceptions by rescuing the exception and passing
* it to... | twitter/finatra | thrift/src/main/scala/com/twitter/finatra/thrift/filters/ExceptionMappingFilter.scala | Scala | apache-2.0 | 834 |
/**
* Copyright 2011-2016 GatlingCorp (http://gatling.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 appli... | thkluge/gatling | gatling-core/src/main/scala/io/gatling/core/json/Boon.scala | Scala | apache-2.0 | 1,291 |
/**
* Copyright (C) 2016 Verizon. 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 required by applicable law o... | Verizon/trapezium | sparkcassandra-connector/src/main/scala/com/verizon/bda/trapezium/dal/spark/cassandra/CassandraDAO.scala | Scala | apache-2.0 | 3,468 |
/*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | arkadius/reliable-http-client | rhttpc-amqp/src/main/scala/rhttpc/transport/amqp/AmqpTransport.scala | Scala | apache-2.0 | 6,783 |
/*
* 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 ... | pronix/spark | core/src/test/scala/org/apache/spark/deploy/RPackageUtilsSuite.scala | Scala | apache-2.0 | 6,337 |
package com.caibowen.prma.webface
import java.io.IOException
import java.sql.ResultSet
import ch.qos.logback.classic.Level
import ch.qos.logback.classic.spi.LoggingEvent
import com.caibowen.prma.api.LogLevel
import com.caibowen.prma.api.model.EventVO
import com.caibowen.prma.logger.logback.LogbackEventAdaptor
import ... | xkommando/PRMA | webface/src/main/scala/com/caibowen/prma/webface/_Mock.scala | Scala | lgpl-3.0 | 1,370 |
/*
* 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 ... | jfeltesse-mdsol/zipkin | zipkin-common/src/test/scala/com/twitter/zipkin/common/DependenciesTest.scala | Scala | apache-2.0 | 1,637 |
// 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,... | travisbrown/zipkin | zipkin-cassandra/src/main/scala/com/twitter/cassie/ColumnsIteratee.scala | Scala | apache-2.0 | 4,420 |
/*
* 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 ... | lgscofield/SparkOnHBase | src/main/scala/com/cloudera/spark/hbase/example/HBaseBulkPutTimestampExample.scala | Scala | apache-2.0 | 2,719 |
package model
trait PluginComponent extends TemplateComponent { self: Profile =>
import profile.simple._
import self._
lazy val Plugins = TableQuery[Plugins]
class Plugins(tag: Tag) extends Table[Plugin](tag, "PLUGIN"){
val pluginId = column[String]("PLUGIN_ID", O PrimaryKey)
val version = column[Str... | mqshen/gitbucketTest | src/main/scala/model/Plugin.scala | Scala | apache-2.0 | 469 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogx/compiler/codegenerator/opencl/cpukernels/UnpipelinedColorActuatorKernel.scala | Scala | apache-2.0 | 3,131 |
package gh.test.gh2013.event
import gh2013.events.{GollumEventParser}
import net.liftweb.json._
import org.scalatest.{FlatSpec, Matchers}
class GollumEventTest extends FlatSpec with Matchers
{
"A valid GollumEvent" must "be correctly parsed" in {
val json = parse(
"""
| {
| ... | mgoeminne/github_etl | src/test/scala/gh/test/gh2013/event/GollumEventTest.scala | Scala | mit | 4,599 |
package com.stulsoft.ysps.peither
import scala.io.StdIn
/**
* Playing with Either.
*
* Convention dictates that Left is used for failure and Right is used for success.
*
* Created by Yuriy Stul on 9/14/2016.
*/
object EitherSample {
def main(args: Array[String]): Unit = {
println("==>main")
test... | ysden123/ysps | src/main/scala/com/stulsoft/ysps/peither/EitherSample.scala | Scala | mit | 1,887 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | SRGOM/scalatest | scalatest-test/src/us/US.scala | Scala | apache-2.0 | 26,241 |
/*
Copyright 2013 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | rangadi/summingbird | summingbird-storm-test/src/main/scala/com/twitter/summingbird/storm/TestStore.scala | Scala | apache-2.0 | 3,489 |
package gruenewa.grid
import gruenewa.prelude._
class GridRunException(cause: Throwable) extends Exception(cause)
object GridRun {
trait Executor {
def apply[A, B](func: A => B)(arg: A): B
def close()
}
def startScanner(callback: (String, Int) => Unit) = Discovery.startListener(callback)
def st... | gruenewa/gruenewa-grid | src/main/scala/gruenewa/grid/GridRun.scala | Scala | gpl-3.0 | 933 |
package com.peterpotts.snake.predicate
case class And[T](predicates: Seq[Predicate[T]]) extends Predicate[T] {
def apply(value: T) = predicates.map(_(value)).reduce(_ && _)
override def toString() = predicates.mkString(" && ")
}
| peterpotts/snake | src/main/scala/com/peterpotts/snake/predicate/And.scala | Scala | mit | 235 |
package me.apidoc.swagger.translators
import lib.Primitives
import io.apibuilder.spec.v0.{ models => apidoc }
import me.apidoc.swagger.Util
import io.swagger.{ models => swagger }
object Response {
def apply(
resolver: Resolver,
code: String,
response: swagger.Response
): apidoc.Response = {
val ... | gheine/apidoc | swagger/src/main/scala/me/apidoc/swagger/translators/Response.scala | Scala | mit | 887 |
package com.datawizards.sparklocal.session
import com.datawizards.sparklocal.SparkLocalBaseTest
import com.datawizards.sparklocal.dataset.DataSetAPI
import com.datawizards.sparklocal.rdd.RDDAPI
import com.datawizards.sparklocal.implicits._
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWit... | piotr-kalanski/spark-local | src/test/scala/com/datawizards/sparklocal/session/CreateDatasetTest.scala | Scala | apache-2.0 | 2,312 |
/*
* 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 ... | deroneriksson/incubator-systemml | src/test/scala/org/apache/sysml/api/ml/LogisticRegressionSuite.scala | Scala | apache-2.0 | 4,519 |
/*
* Copyright (c) 2014-2016
* nonblocking.at gmbh [http://www.nonblocking.at]
*
* This file is part of Cliwix.
*
* Cliwix 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... | nonblocking/cliwix | cliwix-core/src/main/scala/at/nonblocking/cliwix/core/validation/UniqueIdsLiferayConfigValidator.scala | Scala | agpl-3.0 | 8,350 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | garyKeorkunian/squants | shared/src/main/scala/squants/electro/ElectricCharge.scala | Scala | apache-2.0 | 4,829 |
package delta.jdbc.mysql
import java.sql.Connection
import java.sql.SQLException
import delta.jdbc.AbstractJdbcStore
/**
* MySQL syntax adapter for stream process stores.
*/
trait MySQLSyntax {
self: AbstractJdbcStore =>
import MySQLDialect._
override protected def schemaDDL(schema: String): String =
se... | nilskp/delta | delta-jdbc/src/main/scala/delta/jdbc/mysql/MySQLSyntax.scala | Scala | mit | 893 |
/**
* Copyright 2017 Interel
*
* 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... | Interel-Group/core3 | src/test/scala/core3/test/specs/unit/config/DynamicConfigSpec.scala | Scala | apache-2.0 | 1,480 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package statements
import org.jetbrains.plugins.scala.lang.psi.api.base.ScIdList
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.ScTypedDefinition
/**
* @author Alexander Podkhalyuzin
*/
trait ScVariableDeclaration extends ScVariable wi... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/statements/ScVariableDeclaration.scala | Scala | apache-2.0 | 419 |
/*
* 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/ui/jobs/UIData.scala | Scala | apache-2.0 | 4,303 |
package knot.data
object ByteArrayIterator {
def apply(bytes: Array[Byte]): ByteArrayIterator = new ByteArrayIterator(bytes, 0, bytes.length)
def apply(bytes: Array[Byte], from: Int, until: Int) = new ByteArrayIterator(bytes, from, until)
}
class ByteArrayIterator(private var bytes: Array[Byte], private var from... | defvar/knot | knot-data/src/main/scala/knot/data/ByteArrayIterator.scala | Scala | mit | 985 |
package equellatests
import com.tle.webtests.framework.{PageContext, ScreenshotTaker, TestConfig}
import com.tle.webtests.pageobject.LoginPage
import equellatests.TestChecker.withBrowserDriver
import equellatests.domain.TestLogon
import org.scalacheck.{Prop, Properties}
import scala.util.{Success, Try}
abstract clas... | equella/Equella | autotest/Tests/src/test/scala/equellatests/ShotProperties.scala | Scala | apache-2.0 | 1,384 |
/**
* 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... | sslavic/kafka | core/src/test/scala/unit/kafka/server/ServerStartupTest.scala | Scala | apache-2.0 | 4,690 |
package io.udash.demos.files.rpc
import io.udash.utils.{CallbacksHandler, Registration}
class RPCService extends MainClientRPC {
private val listeners = new CallbacksHandler[Unit]
def listenStorageUpdate(callback: () => Unit): Registration =
listeners.register({ case () => callback() })
override def fileS... | UdashFramework/udash-demos | file-upload/frontend/src/main/scala/io/udash/demos/files/rpc/RPCService.scala | Scala | gpl-3.0 | 370 |
package lv.addresses.index
import com.typesafe.scalalogging.Logger
import org.slf4j.LoggerFactory
import java.util
import scala.collection.AbstractIterator
import scala.collection.mutable.{ArrayBuffer => AB}
import scala.collection.mutable.{Map => MM}
import scala.language.postfixOps
object Index {
protected val ... | mrumkovskis/addresses | indexer/src/main/scala/index/Index.scala | Scala | mit | 34,452 |
package blended.prickle.akka.http
import akka.http.scaladsl.marshalling.{Marshaller, ToEntityMarshaller}
import akka.http.scaladsl.model.{ContentTypeRange, MediaTypes}
import akka.http.scaladsl.unmarshalling.{FromEntityUnmarshaller, Unmarshaller}
import blended.util.logging.Logger
import microjson.JsValue
import prick... | woq-blended/blended | blended.prickle.akka.http/src/main/scala/blended/prickle/akka/http/PrickleSupport.scala | Scala | apache-2.0 | 1,679 |
package com.mesosphere.universe.v3.model
import com.mesosphere.Generators.nonNegNum
import org.scalacheck.Gen
import org.scalatest.FreeSpec
import org.scalatest.prop.PropertyChecks
final class PackageDefinitionSpec extends FreeSpec with PropertyChecks {
"PackageDefinition$.ReleaseVersion" - {
"ReleaseVersion$... | dcos/cosmos | cosmos-test-common/src/test/scala/com/mesosphere/universe/v3/model/PackageDefinitionSpec.scala | Scala | apache-2.0 | 1,281 |
package com.technophobia.substeps.intellij.parser
import com.intellij.lang.{ASTNode, PsiBuilder, PsiParser}
import com.intellij.psi.tree.IElementType
import com.technophobia.substeps.intellij.lexer._
import scala.util.parsing.combinator.Parsers
import com.technophobia.substeps.nodes._
import com.technophobia.substeps.... | rickybarefield/Substeps-IDEA-Plugin | src/main/scala/com/technophobia/substeps/intellij/parser/FeaturePsiParser.scala | Scala | mit | 4,072 |
/*
* 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 ... | matthewfranglen/spark | sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala | Scala | mit | 17,665 |
package euler
import scala.reflect.internal.MissingRequirementError
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{ universe => ru }
import Utils._
object ProjectEuler extends App {
implicit val m = ru.runtimeMirror(getClass.getClassLoader)
val eulerProblems = Iterator.from(1).map(eulerPro... | TrustNoOne/Euler | scala/src/main/scala/euler/ProjectEuler.scala | Scala | mit | 1,101 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | yiheng/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/tf/ShapeSpec.scala | Scala | apache-2.0 | 1,797 |
package breeze.linalg.operators
import breeze.generic.{ MappingUFunc, UFunc }
import breeze.generic.UFunc.UImpl
import breeze.math.{ Field, Ring, Semiring }
/*
Copyright 2012 Daniel Ramage
Licensed under the Apache License, Version 2.0 (the "License")
you may not use this file except in compliance with the Licens... | claydonkey/breeze | math/src/main/scala/breeze/linalg/operators/OpType.scala | Scala | apache-2.0 | 7,346 |
/*
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... | avibryant/algebird | algebird-test/src/test/scala/com/twitter/algebird/AdJoinedUnitRing.scala | Scala | apache-2.0 | 1,360 |
package slamdata.engine.physical.mongodb
import slamdata.Predef._
import org.scalacheck._
import org.specs2.mutable._
import org.specs2.ScalaCheck
import scalaz._
import slamdata.engine._
import slamdata.specs2._
class PipelineSpec extends Specification with ScalaCheck with ArbBsonField with PendingWithAccurateCove... | wemrysi/quasar | core/src/test/scala/slamdata/engine/physical/mongodb/pipeline.scala | Scala | apache-2.0 | 6,572 |
/**
* Created on February 17, 2011
* Copyright (c) 2011, Wei-ju Wu
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* ... | weiju/adf-tools | adf-core/src/main/scala/org/dmpp/adf/logical/ReadsBcplStrings.scala | Scala | bsd-3-clause | 2,452 |
package org.template.recommendation
import org.apache.predictionio.controller.PDataSource
import org.apache.predictionio.controller.EmptyEvaluationInfo
import org.apache.predictionio.controller.EmptyActualResult
import org.apache.predictionio.controller.Params
import org.apache.predictionio.data.storage.{DataMap, Even... | alex9311/PredictionIO | examples/scala-parallel-recommendation/custom-query/src/main/scala/DataSource.scala | Scala | apache-2.0 | 2,580 |
package com.malaska.spark.training.windowing.big
import org.apache.log4j.{Level, Logger}
import org.apache.spark.Partitioner
import org.apache.spark.sql.SparkSession
/**
* Big windowing. This is when you have over 50k records per key or the
* records can be on bound, but you still have many keys.
*
* If you ... | TedBear42/spark_training | src/main/scala/com/malaska/spark/training/windowing/big/BigWindowing.scala | Scala | apache-2.0 | 2,007 |
/*
* Copyright (C) 2012 Pavel Fatin <http://pavelfatin.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 by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
... | pavelfatin/toyfs | src/main/scala/com/pavelfatin/fs/internal/wrapfs/EntryWrapper.scala | Scala | gpl-3.0 | 2,431 |
package ai.agnos.sparql.util
import java.net.ServerSocket
/**
* HttpEndpoint construction factory
*/
object HttpEndpoint {
/**
* Get an HTTP endpoint bound to 'localhost' where a free port is automatically assigned
* and can be used to be bound to.
*
* The generated endpoint will be '''http://l... | modelfabric/reactive-sparql | src/main/scala/ai/agnos/sparql/util/HttpEndpoint.scala | Scala | mit | 5,291 |
package geek.lawsof.physics.lib.machine.recipes
import net.minecraft.inventory.InventoryCrafting
import net.minecraft.item.ItemStack
import net.minecraft.world.World
/**
* Created by anshuman on 22-07-2014.
*/
trait MachineRecipe[I <: MachineRecipeInput, O <: MachineRecipeOutput] {
def matches(input: I): Boolean
... | GeckoTheGeek42/TheLawsOfPhysics | src/main/scala/geek/lawsof/physics/lib/machine/recipes/MachineRecipe.scala | Scala | mit | 376 |
/*
* Copyright 2016 Miroslav Janíček
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | mjanicek/rembulan | rembulan-tests/src/test/scala/net/sandius/rembulan/test/FragmentExecTestSuite.scala | Scala | apache-2.0 | 8,867 |
/*
* _ _
* _ __ ___ | |__ | | ___
* | '_ \\ / _ \\| '_ \\| |/ _ \\ noble :: norcane blog engine
* | | | | (_) | |_) | | __/ Copyright (c) 2016-2018 norcane
* |_| |_|\\___/|_.__/|_|\\___|
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file... | norcane/noble | sdk/noble-api/src/main/scala/com/norcane/noble/api/models/BlogConfig.scala | Scala | apache-2.0 | 1,292 |
/*
* 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 ... | u2009cf/spark-radar | core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala | Scala | apache-2.0 | 23,526 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | FusionWorks/adam | adam-core/src/test/scala/org/bdgenomics/adam/algorithms/consensus/ConsensusGeneratorFromReadsSuite.scala | Scala | apache-2.0 | 1,576 |
package com.twitter.zipkin.storage.hbase.mapping
import org.apache.hadoop.hbase.util.Bytes
case class SpanNameMapping(id: Long, value: Array[Byte], parent: Option[ServiceMapping]) extends Mapping {
val mappingType: Byte = 1
lazy val name = Bytes.toString(value)
}
| pteichman/zipkin | zipkin-hbase/src/main/scala/com/twitter/zipkin/storage/hbase/mapping/SpanNameMapping.scala | Scala | apache-2.0 | 270 |
import sbt._
import Keys._
object TestProjectBuild extends Build {
lazy val root = Project(id = "root", base = file("."))
lazy val footprint = Project(id = "foo", base = file("foo"))
lazy val bar = Project(id = "bar", base = file("bar"))
val deleteFileOnExitHook = Command.single("deleteFileOnExitHook") { (sta... | luismfonseca/sbt-autojump | src/sbt-test/global/avoid-execute-exit-hooks/project/Build.scala | Scala | mit | 505 |
/*
* 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 ... | tophua/spark1.52 | core/src/test/scala/org/apache/spark/ExternalShuffleServiceSuite.scala | Scala | apache-2.0 | 4,181 |
package monocle.std
import monocle.function.{At, Empty}
import monocle.{Lens, Prism}
import scalaz.{ISet, Order}
object iset extends ISetOptics
trait ISetOptics {
implicit def emptyISet[A]: Empty[ISet[A]] = new Empty[ISet[A]] {
def empty = Prism[ISet[A], Unit](s => if(s.isEmpty) Some(()) else None)(_ => ISet... | NightRa/Monocle | core/src/main/scala/monocle/std/ISet.scala | Scala | mit | 584 |
package drt.shared
object SplitRatiosNs {
// type SplitRatios = List[SplitRatio]
case class SplitRatios(splits: List[SplitRatio]=Nil)
object SplitRatios {
def apply(ratios: SplitRatio*): SplitRatios = SplitRatios(ratios.toList)
}
case class SplitRatio(paxType: PaxTypeAndQueue, ratio: Double)
}
| somanythings/drt-scalajs-spa-exploration | shared/src/main/scala/spatutorial/shared/SplitRatiosNs.scala | Scala | apache-2.0 | 310 |
def combine(x: M): (M => M) | hmemcpy/milewski-ctfp-pdf | src/content/3.6/code/scala/snippet04.scala | Scala | gpl-3.0 | 27 |
package org.littlewings.infinispan.persistence
import org.infinispan.Cache
import org.infinispan.configuration.cache.{CacheMode, ConfigurationBuilder}
import org.infinispan.manager.DefaultCacheManager
import org.scalatest.FunSpec
import org.scalatest.Matchers._
class SimpleMapCacheStoreSpec extends FunSpec {
descr... | kazuhira-r/infinispan-examples | infinispan-persistence/src/test/scala/org/littlewings/infinispan/persistence/SimpleMapCacheStoreSpec.scala | Scala | mit | 2,522 |
val cont: Unit => Unit = null
/*start*/cont/*end*/
//(Unit) => Unit | LPTK/intellij-scala | testdata/typeInference/bugs4/SCL2816.scala | Scala | apache-2.0 | 67 |
package com.antiparagon.cvexperimenter.chessscanner
import org.opencv.core.{Core, Rect}
import org.opencv.imgcodecs.Imgcodecs
import org.scalatest._
/**
* This test file is meant to test all the example chessboard images saved in the
* 'CVExperimenter/images/Chess Scanner/Starting Position/Chessboard Failures' fo... | antiparagon/CVExperimenter | src/test/scala/com/antiparagon/cvexperimenter/chessscanner/ChessboardFinderFailuresTester.scala | Scala | mit | 8,419 |
/**
* Copyright (c) 2015, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. 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/LIC... | superwaiwjia/spark-timeseries | src/main/scala/com/cloudera/sparkts/Lag.scala | Scala | apache-2.0 | 3,062 |
package net.reactivecore.mongofaker
import java.io.{IOException, File}
import org.apache.commons.io.FileUtils
import java.nio.file.Files
private[mongofaker] class ManagedDatabaseDirException (msg : String, cause : Throwable = null) extends MongoFakerException (msg, cause)
/**
* Managed Database Directory.
*/
priva... | reactivecore/mongofaker | src/main/scala/net/reactivecore/mongofaker/ManagedDatabaseDir.scala | Scala | mit | 1,083 |
package org.http4s
package server
import cats.Monad
import cats.data.{Kleisli, OptionT}
object ContextMiddleware {
def apply[F[_]: Monad, T](
getContext: Kleisli[OptionT[F, ?], Request[F], T]): ContextMiddleware[F, T] =
_.compose(Kleisli((r: Request[F]) => getContext(r).map(ContextRequest(_, r))))
}
| ChristopherDavenport/http4s | server/src/main/scala/org/http4s/server/ContextMiddleware.scala | Scala | apache-2.0 | 315 |
package com.orendainx.trucking.storm.bolts
import java.nio.charset.StandardCharsets
import java.util
import com.typesafe.scalalogging.Logger
import org.apache.nifi.storm.NiFiDataPacket
import org.apache.storm.task.{OutputCollector, TopologyContext}
import org.apache.storm.topology.OutputFieldsDeclarer
import org.apac... | orendain/trucking-iot | storm-topology/src/main/scala/com/orendainx/trucking/storm/bolts/NiFiPacketToSerialized.scala | Scala | apache-2.0 | 1,474 |
package is.hail.utils.richUtils
import is.hail.annotations.Region
import is.hail.asm4s._
import is.hail.expr.ir.EmitCodeBuilder
import is.hail.types.physical._
import is.hail.io.OutputBuffer
import is.hail.types.physical.stypes.{SCode, SValue}
import is.hail.types.virtual._
class RichCodeOutputBuffer(
val ob: Value... | hail-is/hail | hail/src/main/scala/is/hail/utils/richUtils/RichCodeOutputBuffer.scala | Scala | mit | 2,376 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | haowu80s/spark | examples/src/main/scala/org/apache/spark/examples/SparkALR/SparkALR.scala | Scala | apache-2.0 | 6,725 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/ml/classification/ProbabilisticClassifier.scala | Scala | apache-2.0 | 8,325 |
/*
* 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 ... | wmz7year/ignite | modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala | Scala | apache-2.0 | 40,645 |
import org.scalatest.{FunSuite, Matchers}
/**
* Created by inieto on 27/04/15.
*/
class _03_Options extends FunSuite with Matchers {
test("Option[A] is a container for an optional value of type A." +
" If the value of type A is present, the Option[A] is an instance of Some[A], containing the present value... | inieto/scala-47deg | ScalaExercises/src/test/scala-2.11/_03_Options.scala | Scala | mit | 2,038 |
package ml.combust.bundle.test
import java.io.File
import java.net.URI
import java.nio.file.{Files, Paths}
import ml.combust.bundle.fs.BundleFileSystem
import scala.util.Try
class TestBundleFileSystem extends BundleFileSystem {
override def schemes: Seq[String] = Seq("test")
override def load(uri: URI): Try[Fi... | combust-ml/mleap | bundle-ml/src/test/scala/ml/combust/bundle/test/TestBundleFileSystem.scala | Scala | apache-2.0 | 484 |
/***********************************************************************
* 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-datastore/src/test/scala/org/locationtech/geomesa/accumulo/index/S2IndexTest.scala | Scala | apache-2.0 | 11,176 |
package com.transgee.ebook.pdf
import java.io.{File, FileOutputStream}
import org.scalatest._
class FigureIteratorSpec extends FlatSpec with Matchers {
"FigureIterator" should "extract images" in {
extractFigures("pdf/OReilly.Mobile.and.Web.Messaging.pdf")
}
private def extractFigures(filePath: String) = ... | zenkiezhu/scala-ebook-clipper | src/test/scala/com/transgee/ebook/pdf/FigureIteratorSpec.scala | Scala | apache-2.0 | 953 |
package scala.slick.lifted
import scala.annotation.implicitNotFound
import scala.collection.generic.CanBuildFrom
import scala.slick.ast.{Join => AJoin, _}
import scala.slick.util.CollectionLinearizer
/**
* A query monad which contains the AST for a query's projection and the accumulated
* restrictions and other mod... | zefonseca/slick-1.0.0-scala.2.11.1 | src/main/scala/scala/slick/lifted/Query.scala | Scala | bsd-2-clause | 7,130 |
package scife.enumeration
package member
package testcase
import scife.{ enumeration => e }
import dependent._
import scife.util.logging._
import scife.util._
import org.scalatest._
import org.scalatest.prop._
import org.scalacheck.Gen
class BinarySearchTreeTest extends FunSuite with Matchers with GeneratorDrivenPr... | kaptoxic/SciFe | src/test/scala/scife/enumeration/member/testcase/BinarySearchTreeTest.scala | Scala | gpl-2.0 | 5,573 |
/*
* 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 ... | duynguyen/incubator-openwhisk | core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala | Scala | apache-2.0 | 18,224 |
// NOTE: copy/pasted from https://github.com/lampepfl/dotty/tree/1962ada58fcd2333a2e40179ab0ac6efb6167ed2
package scala.meta
package internal.hosts.scalac
package tasty
import collection.mutable
import TastyBuffer._
import scala.io.Codec
import TastyName._
import TastyFormat._
class NameBuffer extends TastyBuffer(10... | mdemarne/scalahost | interface/src/main/scala/scala/meta/internal/hosts/scalac/tasty/NameBuffer.scala | Scala | bsd-3-clause | 2,277 |
package com.lvxingpai.model.misc
import javax.validation.constraints.Min
import com.lvxingpai.model.mixin.ObjectIdEnabled
import org.hibernate.validator.constraints.NotBlank
import java.util.Date
import scala.beans.BeanProperty
/**
* Created by pengyt on 2015/10/21.
*/
class Feedback extends ObjectIdEnabled {
/... | Lvxingpai/core-model | src/main/scala/com/lvxingpai/model/misc/Feedback.scala | Scala | apache-2.0 | 668 |
package alternatives.breeze
import breeze.util.BloomFilter
import org.openjdk.jmh.annotations.{Benchmark, Param, Scope, State}
import scala.util.Random
@State(Scope.Benchmark)
class ArrayByteItemBenchmark {
private val itemsExpected = 1000000L
private val falsePositiveRate = 0.01
private val random = new Rand... | alexandrnikitin/bloom-filter-scala | benchmarks/src/main/scala/alternatives/breeze/ArrayByteItemBenchmark.scala | Scala | mit | 693 |
package edu.gemini.phase2.template.factory.impl.flamingos2
import edu.gemini.pot.sp._
import edu.gemini.phase2.template.factory.impl._
import edu.gemini.spModel.gemini.flamingos2.Flamingos2
import edu.gemini.spModel.gemini.flamingos2.blueprint.SpFlamingos2BlueprintImaging
import scala.collection.JavaConverters._
cas... | spakzad/ocs | bundle/edu.gemini.phase2.skeleton.servlet/src/main/scala/edu/gemini/phase2/template/factory/impl/flamingos2/Flamingos2Imaging.scala | Scala | bsd-3-clause | 2,181 |
package org.example1.usage
import org.example1.declaration.{Y => Y_Renamed, _}
trait Usage_NoOther_Imports_Wildcard_WithRename_OtherClass {
val x: X = ???
val y: Y_Renamed = ???
val z: Z = ???
} | JetBrains/intellij-scala | scala/scala-impl/testdata/move/allInOne/before/org/example1/usage/Usage_NoOther_Imports_Wildcard_WithRename_OtherClass.scala | Scala | apache-2.0 | 202 |
package rolodato.genetics.impl
import rolodato.genetics.{Crossover, Gene}
import scala.language.postfixOps
import scala.math.abs
import scala.util.Random
trait OnePointCrossover extends Crossover {
/**
* Given two parents, creates two children by applying a one-point
* crossover algorithm.
*
* Unless o... | rolodato/genetics | shared/src/main/scala/rolodato/genetics/impl/OnePointCrossover.scala | Scala | mit | 1,387 |
// Starter Code for Exercise 1
// From "Constructors" atom
import com.atomicscala.AtomicTest._
val doubleHalfCaf = new Coffee(shots=2, decaf=1)
val tripleHalfCaf = new Coffee(shots=3, decaf=2)
doubleHalfCaf.decaf is 1
doubleHalfCaf.caf is 1
doubleHalfCaf.shots is 2
tripleHalfCaf.decaf is 2
tripleHalfCaf.caf is 1
trip... | P7h/ScalaPlayground | Atomic Scala/atomic-scala-solutions/25_Constructors/Starter-1.scala | Scala | apache-2.0 | 341 |
/*
* 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 ... | trueyao/spark-lever | streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala | Scala | apache-2.0 | 31,252 |
package quotes
import models._
object QuoteBuilderSingleton extends QuoteBuilder
class QuoteBuilder {
def buildQuote(quoteProfile: QuoteProfile, distanceResult: DistanceResult, fuelSurchargeProfile: FuelSurchargeProfile): Quote = {
val fares = quoteProfile.fareProfiles.map(x => {
val calculatedFare: B... | greghxc/shakespeare | src/main/scala/quotes/QuoteBuilder.scala | Scala | mit | 1,970 |
/*
* Copyright (c) 2013 Aviat Networks.
* This file is part of DocReg+Web. Please refer to the NOTICE.txt file for license details.
*/
package vvv.docreg.backend
import net.liftweb.common.Loggable
import vvv.docreg.model._
import vvv.docreg.agent.SubscriberInfo
import org.squeryl.PrimitiveTypeMode._
trait Subscri... | scott-abernethy/docreg-web | src/main/scala/vvv/docreg/backend/SubscriptionReconcile.scala | Scala | gpl-3.0 | 1,922 |
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.