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 breeze.linalg.operators
/*
Copyright 2012 David Hall
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... | ktakagaki/breeze | src/main/scala/breeze/linalg/operators/BinaryUpdateOp.scala | Scala | apache-2.0 | 3,160 |
package com.github.mrpowers.spark.daria.sql.types
import org.apache.spark.sql.types.StructField
object StructFieldHelpers {
def customEquals(s1: StructField, s2: StructField, ignoreNullable: Boolean = false): Boolean = {
if (ignoreNullable) {
s1.name == s2.name &&
s1.dataType == s2.dataType
} e... | MrPowers/spark-daria | src/main/scala/com/github/mrpowers/spark/daria/sql/types/StructFieldHelpers.scala | Scala | mit | 558 |
package forms
import com.google.inject.Inject
import models.LoginInfo
import play.api.data.Forms._
import play.api.data._
import services.hash.PasswordHasher
import services.user.UserDAO
class LoginForm @Inject()(userDAO: UserDAO,
passwordHasher: PasswordHasher) {
val form = Form(
mapp... | GMadorell/play-jwt | app/forms/LoginForm.scala | Scala | mit | 777 |
/*
* Copyright 2015 - 2016 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - 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... | RBMHTechnology/eventuate | eventuate-core/src/main/scala/com/rbmhtechnology/eventuate/PersistOnEvent.scala | Scala | apache-2.0 | 6,724 |
package actorthread.v2
import akka.actor.ActorLogging
import akka.actor.Actor
import akka.actor.ActorRef
object Forwarder {
case class Ping(id: Int, origin: ActorRef)
}
class Forwarder(returner: ActorRef) extends Actor with ActorLogging {
import Forwarder._
def receive: Receive = {
case p: Ping =>
... | sebastian-dasse/uni-scala | ScalaKurs(Knabe)_S_sbt/src/main/scala/actorthread/v2/Forwarder.scala | Scala | mit | 403 |
package breeze.linalg.functions
import breeze.linalg.{DenseVector, SparseVector, argsort, argtopk}
import org.scalacheck.Prop
import org.scalatest.FunSuite
import org.scalatest.prop.Checkers
/**
* Created by dlwh on 9/18/15.
*/
class argsortTest extends FunSuite with Checkers {
test("argsort dv") {
check(Prop... | crealytics/breeze | math/src/test/scala/breeze/linalg/functions/argsortTest.scala | Scala | apache-2.0 | 1,013 |
package edu.gemini.model.p1.targetio
import api._
import uk.ac.starlink.table.{TableBuilder, StarTableWriter}
import uk.ac.starlink.fits.{FitsTableBuilder, FitsTableWriter}
import uk.ac.starlink.table.formats._
import uk.ac.starlink.votable.{VOTableBuilder, VOTableWriter}
import edu.gemini.model.p1.targetio.api.FileT... | arturog8m/ocs | bundle/edu.gemini.model.p1.targetio/src/main/scala/edu/gemini/model/p1/targetio/table/package.scala | Scala | bsd-3-clause | 836 |
/* Copyright 2017-19, Emmanouil Antonios Platanios. 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 ... | eaplatanios/tensorflow_scala | modules/api/src/test/scala/org/platanios/tensorflow/api/io/events/EventFileReaderSuite.scala | Scala | apache-2.0 | 3,300 |
/**
* 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... | sebadiaz/kafka | core/src/test/scala/unit/kafka/integration/UncleanLeaderElectionTest.scala | Scala | apache-2.0 | 12,036 |
package scalarank.datapoint
import org.nd4j.linalg.api.ndarray.INDArray
/**
* A data point, this is typically a feature vector containing query-document features
*/
abstract class Datapoint {
/**
* The features as a dense vector
*/
val features: INDArray
}
/**
* For labeling data points with rele... | rjagerman/scalarank | src/main/scala/scalarank/datapoint/Datapoint.scala | Scala | mit | 468 |
package org.bitcoins.explorer.model
import org.bitcoins.crypto.SchnorrPublicKey
case class Oracle(pubkey: SchnorrPublicKey, oracleName: String)
| bitcoin-s/bitcoin-s | oracle-explorer-client/src/main/scala/org/bitcoins/explorer/model/Oracle.scala | Scala | mit | 146 |
/*
* Copyright 2014 DataGenerator Contributors
*
* 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 l... | Brijeshrpatel9/SingleThreaderProcessingDG | dg-common/src/main/code/org/finra/datagenerator/common/SocialNetwork_Example/scala/UserType.scala | Scala | apache-2.0 | 7,966 |
package breeze.stats.distributions;
/*
Copyright 2009 David Hall, Daniel Ramage
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by... | wavelets/breeze | src/test/scala/breeze/stats/distributions/Beta.scala | Scala | apache-2.0 | 2,831 |
package com.airbnb.common.ml.xgboost.data
import org.apache.spark.sql.Row
trait ScoringModelData extends Serializable {
def parseRowToXgboostLabeledPointAndData(row: Row): ScoringLabeledPoint
}
| airbnb/aerosolve | airlearner/airlearner-xgboost/src/main/scala/com/airbnb/common/ml/xgboost/data/ScoringModelData.scala | Scala | apache-2.0 | 199 |
/*
* 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 ... | aniketadnaik/carbondataStreamIngest | integration/spark-common/src/main/scala/org/apache/carbondata/spark/rdd/CarbonIUDMergerRDD.scala | Scala | apache-2.0 | 5,227 |
/*
* Copyright 2011-2022 GatlingCorp (https://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... | gatling/gatling | gatling-core/src/main/scala/io/gatling/core/controller/inject/open/UserStream.scala | Scala | apache-2.0 | 2,202 |
/*
* 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 ... | sryza/spark | core/src/main/scala/org/apache/spark/network/ReceiverTest.scala | Scala | apache-2.0 | 1,423 |
/**
* Copyright (C) 2015 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* 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... | DANS-KNAW/easy-update-solr-index | lib/src/main/scala/nl.knaw.dans.easy.solr/SolrProviderImpl.scala | Scala | apache-2.0 | 1,394 |
/**
* Copyright 2015 Thomson Reuters
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | bryaakov/CM-Well | server/cmwell-dc/src/main/scala/cmwell/dc/stream/TsvRetriever.scala | Scala | apache-2.0 | 15,385 |
package model
import skinny.DBSettings
import skinny.test._
import org.scalatest.fixture.FlatSpec
import org.scalatest._
import scalikejdbc._
import scalikejdbc.scalatest._
import org.joda.time._
class GoogleUsersSpec extends FlatSpec with Matchers with DBSettings with AutoRollback {
}
| yoshitakes/skinny-task-example | src/test/scala/model/GoogleUsersSpec.scala | Scala | mit | 289 |
/*
* 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-cache/oap/src/main/scala/org/apache/spark/sql/execution/datasources/oap/io/OapDataReaderWriter.scala | Scala | apache-2.0 | 7,752 |
/*
* 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/main/scala/com/intel/analytics/bigdl/tensor/DenseTensorApply.scala | Scala | apache-2.0 | 14,797 |
package spire
package std
import spire.algebra.{Eq, EuclideanRing, IsIntegral, NRoot, Order, Signed, TruncatedDivisionCRing}
import spire.math.BitString
import spire.util.Opt
import java.lang.Math
trait LongIsEuclideanRing extends EuclideanRing[Long] {
override def minus(a:Long, b:Long): Long = a - b
def negate(... | adampingel/spire | core/src/main/scala/spire/std/long.scala | Scala | mit | 4,149 |
/*
* 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
* distribute... | wvlet/airframe | airframe-rx-html/src/main/scala/wvlet/airframe/rx/html/RxHtmlMacros.scala | Scala | apache-2.0 | 1,633 |
package org.orbeon.oxf.xml
import javax.xml.transform.{Result, Source}
import org.orbeon.saxon.event._
import org.orbeon.saxon.trans.XPathException
import org.orbeon.saxon.{Configuration, Controller}
import org.xml.sax.SAXParseException
// Custom version of Saxon's IdentityTransformer which hooks up a `ComplexConten... | brunobuzzi/orbeon-forms | src/main/scala/org/orbeon/oxf/xml/IdentityTransformerWithFixup.scala | Scala | lgpl-2.1 | 2,122 |
package mavigator.uav
package mock
import scala.util.Random
import org.mavlink.Mavlink
import org.mavlink.enums._
import org.mavlink.messages._
class RandomFlightPlan {
private var time: Double = 0 //current time in seconds
private def millis = (time * 1000).toInt
private def micros = (time * 1E6).toInt
//... | project-condor/mavigator | mavigator-uav/src/main/scala/mavigator/uav/mock/RandomFlightPlan.scala | Scala | gpl-3.0 | 2,790 |
package provingground.induction
import provingground._, HoTT._
import shapeless._
object SubstInstances {
implicit def indConsShape[S <: HList,
H <: Term with Subs[H],
Fb <: Term with Subs[Fb],
ConstructorType <: Term with Subs[Con... | siddhartha-gadgil/ProvingGround | core/src/main/scala/provingground/induction/SubstInstances.scala | Scala | mit | 2,103 |
package gh2013.payloads
import gh2013.models.User
import net.liftweb.json.JsonAST.JValue
case class MemberEventPayload(action: String, member: User)
object MemberEventPayload
{
def apply(json: JValue): Option[MemberEventPayload] =
{
val n2s = gh3.node2String(json)(_)
val action = n2s("action")
... | mgoeminne/github_etl | src/main/scala/gh2013/payloads/MemberEventPayload.scala | Scala | mit | 517 |
package org.scalajs.testsuite.javalib.time
import java.time._
import java.time.chrono.{IsoEra, IsoChronology}
import java.time.format.DateTimeParseException
import java.time.temporal._
import org.junit.Test
import org.junit.Assert._
import org.scalajs.testsuite.utils.AssertThrows._
class LocalDateTest extends Tempor... | sjrd/scala-js-java-time | testSuite/shared/src/test/scala/org/scalajs/testsuite/javalib/time/LocalDateTest.scala | Scala | bsd-3-clause | 37,688 |
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "shorty"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
"postgresql" % "postgresql" % "9.1-901.jdbc4",
jdbc,
anorm,
"org.sca... | Tigermelville/laughing-octo-nemesis | project/Build.scala | Scala | mit | 783 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/nn/ReshapeSpec.scala | Scala | apache-2.0 | 5,284 |
/*
* 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 ... | aosagie/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala | Scala | apache-2.0 | 43,456 |
package com.twitter.finagle.buoyant.h2
package netty4
import com.twitter.logging.Logger
import io.netty.buffer.ByteBuf
import io.netty.channel._
import io.netty.handler.codec.http.{HttpServerCodec, HttpServerUpgradeHandler}
import io.netty.handler.codec.http2._
import io.netty.util.AsciiString
object ServerUpgradeHan... | linkerd/linkerd | finagle/h2/src/main/scala/com/twitter/finagle/buoyant/h2/netty4/ServerUpgradeHandler.scala | Scala | apache-2.0 | 2,476 |
package edu.utsa.tl13
import edu.utsa.tl13._
import UnitTest._
import ParseTests._
import ScanTests._
/** All compiler unit tests */
object CompilerTests extends App {
val tests =
TestGroup("Compiler",
ParseTests.tests,
ScanTests.tests)
simpleReport(tests.run)
}
| jwtouron/tl13 | src/edu/utsa/tl13/CompilerTests.scala | Scala | mit | 304 |
/*
* Skylark
* http://skylark.io
*
* Copyright 2012-2017 Quantarray, 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
*
* Unl... | quantarray/skylark | skylark-measure/src/main/scala/com/quantarray/skylark/measure/AnyMeasureConverter.scala | Scala | apache-2.0 | 1,183 |
package physical.flow
class FlowPolygonContainer(polygon: FlowPolygon, index: Int) {
}
| shawes/zissou | src/main/scala/physical/flow/FlowPolygonContainer.scala | Scala | mit | 89 |
/*
* 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 agreed to in writ... | SRGOM/scalatest | scalatest-test/src/test/scala/org/scalatest/ListShouldContainAllOfLogicalOrSpec.scala | Scala | apache-2.0 | 42,860 |
/*
* 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 | mllib/src/test/scala/org/apache/spark/mllib/pmml/export/KMeansPMMLModelExportSuite.scala | Scala | apache-2.0 | 2,314 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/MergeManySuite.scala | Scala | apache-2.0 | 2,949 |
/*
* 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
* distribute... | wvlet/airframe | airframe-control/src/main/scala/wvlet/airframe/control/Retry.scala | Scala | apache-2.0 | 10,955 |
package com.lysdev.transperthcached.livetimes;
import org.joda.time.DateTime;
class TimesForStation(
station_name: String,
last_updated: DateTime,
trips: List[Trip]) {
def getTrips() = this.trips
def getLastUpdated() = this.last_updated
def getStationName() = this.station_n... | Mause/TransperthCached | src/com/lysdev/transperthcached/livetimes/TimesForStation.scala | Scala | apache-2.0 | 437 |
/*
* 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 ... | aokolnychyi/spark | core/src/main/scala/org/apache/spark/deploy/security/HBaseDelegationTokenProvider.scala | Scala | apache-2.0 | 2,755 |
package rxscala.subscriptions
import org.junit.Assert._
import org.junit.Test
import org.scalatest.junit.JUnitSuite
import rxscala.Subscription
class SubscriptionTests extends JUnitSuite {
@Test
def anonymousSubscriptionCreate() {
val subscription = Subscription{}
assertNotNull(subscription)
}
@Tes... | kevinwright/RxScala | src/test/scala/rxscala/subscriptions/SubscriptionTests.scala | Scala | apache-2.0 | 2,652 |
package system.cell.sensormanagement.sensors
import org.scalatest.{FlatSpec, Matchers}
import system.ontologies.sensor.SensorCategories
/**
* Created by Matteo Gabellini on 31/07/2017.
*/
class SmokeSensorTest extends FlatSpec with Matchers {
val sensorName = "smokeSensor"
val minValue = 0.0
val maxVa... | albertogiunta/arianna | src/test/scala/system/cell/sensormanagement/sensors/SmokeSensorTest.scala | Scala | gpl-3.0 | 2,477 |
/*
* Copyright (C) 2012 reuillon
*
* 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 program is distribut... | ISCPIF/PSEExperiments | openmole-src/openmole/plugins/org.openmole.plugin.environment.egi/src/main/scala/org/openmole/plugin/environment/egi/RemoteGliteStorage.scala | Scala | agpl-3.0 | 2,423 |
/*
Copyright The MITRE Corporation 2009-2010. All rights reserved.
*/
package org.mitre.jcarafe.posttagger
import org.mitre.jcarafe.tagger.TaggerTask
import org.mitre.jcarafe.crf.FactoredTrainer
import org.mitre.jcarafe.crf.FactoredDecoder
import org.mitre.jcarafe.crf.TrainingSeqGen
import org.mitre.jcarafe.crf.F... | wellner/jcarafe | jcarafe-ext/src/main/scala/org/mitre/jcarafe/posttagger/SummaryTagger.scala | Scala | bsd-3-clause | 2,237 |
package dbtarzan.config.util
import org.scalatest.flatspec.AnyFlatSpec
class ByteArrayHexTest extends AnyFlatSpec {
"converting to hex and back" should "give the original value" in {
val original = "F263575E7B00A977A8E9A37E08B9C215FEB9BFB2F992B2B8F11E"
val bytes = ByteArrayHex.fromHex(original)
println(by... | aferrandi/dbtarzan | src/test/scala/dbtarzan/config/util/ByteArrayHexTest.scala | Scala | apache-2.0 | 397 |
/***********************************************************************
* 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-features/geomesa-feature-common/src/main/scala/org/locationtech/geomesa/features/serialization/GenericMapSerialization.scala | Scala | apache-2.0 | 2,588 |
package com.cave.metrics.data.influxdb
import org.joda.time.DateTime
import org.joda.time.format.ISODateTimeFormat
import org.scalatest.mockito.MockitoSugar
import org.scalatest.{FlatSpec, Matchers}
import scala.concurrent.duration._
class InfluxClientSpec extends FlatSpec with Matchers with MockitoSugar {
val Som... | gilt/cave | core/src/test/scala/com/cave/metrics/data/influxdb/InfluxClientSpec.scala | Scala | mit | 6,975 |
package jauter
import org.scalatest._
class RoutingSpec extends FlatSpec with Matchers {
import StringMethodRouter.router
"A router" should "ignore slashes at both ends" in {
router.route(Method.GET, "articles").target should be ("index")
router.route(Method.GET, "/articles").target should be ("index")
... | sinetja/jauter | src/test/scala/jauter/RoutingSpec.scala | Scala | mit | 3,390 |
package coltfred.jsongenerator
import scalaz.effect.IO
import scalaz._, Scalaz._
import com.nicta.rng.Rng
object Main extends scalaz.effect.SafeApp {
//implicit vals to allow closing of Source and the output stream.
implicit val resource = new scalaz.effect.Resource[scala.io.BufferedSource] { def close(b: scala.i... | coltfred/jsongenerator | src/main/scala/coltfred/jsongenerator/Main.scala | Scala | apache-2.0 | 2,520 |
package basics
object PartialApplication {
val add = (x: Int, y: Int) => x + y
val addPartial = add(2, _: Int)
def doAddPartial(x:Int) = addPartial(x)
} | szaqal/KitchenSink | Scala/01/src/main/scala/basics/PartialApplication.scala | Scala | gpl-3.0 | 167 |
package team16.euler
/**
* 10001st prime
* Problem 7
* By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
*
* What is the 10,001st prime number?
*/
import Stream._
object Problem007 extends App {
def isPrime(primes: List[Long], x: Long) = pr... | gatesy/euler-scala | src/team16/euler/Problem007.scala | Scala | gpl-2.0 | 789 |
/**
* Copyright 2013-2015 PayPal
*
* 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 ... | 2rs2ts/cascade | http/src/test/scala/com/paypal/cascade/http/tests/matchers/RefAndProbeMatchers.scala | Scala | apache-2.0 | 2,601 |
package net.batyuk.akkahttp.examples.api
import akka.http.marshallers.xml.ScalaXmlSupport
import akka.http.server.directives.AuthenticationDirectives._
import com.typesafe.config.{ ConfigFactory, Config }
import akka.actor.ActorSystem
import akka.pattern._
import scala.concurrent.duration._
import akka.util.Timeout
im... | abatyuk/akka-http-examples | multiProject/api/src/main/scala/net/batyuk/akkahttp/examples/api/TestServer.scala | Scala | apache-2.0 | 2,699 |
/*
* Copyright 2006-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-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/Driver.scala | Scala | apache-2.0 | 15,343 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | Kegeruneku/rudder | rudder-web/src/main/scala/com/normation/rudder/web/components/RuleEditForm.scala | Scala | agpl-3.0 | 22,572 |
package org.scalafmt.rewrite
import org.scalafmt.rewrite.TokenPatch.{Add, Remove}
import scala.meta._
import scala.meta.tokens.Token
sealed abstract class Patch
abstract class TreePatch extends Patch
abstract class TokenPatch(val tok: Token, val newTok: String) extends TreePatch
object TokenPatch {
case class Rem... | Daxten/scalafmt | core/src/main/scala/org/scalafmt/rewrite/Patch.scala | Scala | apache-2.0 | 1,917 |
package com.microsoft.awt.components
import com.microsoft.awt.models.Group
import org.scalajs.angularjs.Service
import org.scalajs.angularjs.http.Http
import scala.concurrent.ExecutionContext
import scala.scalajs.js
/**
* Groups Service
* @author lawrence.daniels@gmail.com
*/
class GroupService($http: Http) ex... | ldaniels528/awt | app-angularjs/src/main/scala/com/microsoft/awt/components/GroupService.scala | Scala | apache-2.0 | 2,601 |
/*
* 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... | aniketadnaik/carbondataStreamIngest | integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/V3offheapvectorTestCase.scala | Scala | apache-2.0 | 18,580 |
package io.koff.lenses
import io.koff.model.{GeneralInfo, ProblemExample, User}
/**
* Example of usage of quicklens
*/
object QuickLensExample {
def main(args: Array[String]) {
/**
* Use of scalaz.Lens is quite difficult
* but if we are not afraid to use macros in a project we might use `quicklens` ... | coffius/koffio-lenses | src/main/scala/io/koff/lenses/QuickLensExample.scala | Scala | mit | 2,335 |
package som
trait CustomHash {
def customHash(): Int
}
| cedricviaccoz/scala-native | benchmarks/src/main/scala/som/CustomHash.scala | Scala | bsd-3-clause | 58 |
package com.bigchange.mllib
import breeze.linalg.SparseVector
import org.apache.log4j.{Logger, Level}
import org.apache.spark.mllib.evaluation.{RankingMetrics, RegressionMetrics}
import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkContext, SparkConf}
import org.apache.spark.mllib.linalg.{SparseVector => SV}
... | bigchange/AI | src/main/scala/com/bigchange/mllib/MoviesLensALS.scala | Scala | apache-2.0 | 10,652 |
package skinny.http
/**
* Request body from a text value.
*/
case class TextInput(textBody: String, charset: String = HTTP.DEFAULT_CHARSET)
/**
* No text input
*/
object NoTextInput extends TextInput(null, null)
| BlackPrincess/skinny-framework | http-client/src/main/scala/skinny/http/TextInput.scala | Scala | mit | 218 |
/**
* Copyright (c) 2014, MoonGene. All rights reserved.
*
* This source code is licensed under the GPL license found in the
* LICENSE_GPL file in the root directory of this source tree. An alternative
* commercial license is also available upon request.
*/
package com.moongene.models.track
import org.joda.time... | MoonGene/Analytics | src/gene/src/main/scala/com/moongene/models/track/ExitObj.scala | Scala | gpl-3.0 | 1,015 |
package org.apache.spark.ml.classification
import org.apache.spark.SparkException
import org.apache.spark.ml.knn.KNN.{RowWithVector, VectorWithNorm}
import org.apache.spark.ml.knn.{DistanceMetric, EuclideanDistanceMetric, KNNModel, KNNParams}
import org.apache.spark.ml.param.ParamMap
import org.apache.spark.ml.util.{I... | saurfang/spark-knn | spark-knn-examples/src/main/scala/org/apache/spark/ml/classification/NaiveKNN.scala | Scala | apache-2.0 | 6,144 |
package linter.linters
import java.io.File
import linter.{Language, OutputGenerator}
import json_parser.Error
import scala.collection.mutable
import scala.io.Source
/**
* A linter that checks if a line goes over 80 characters
* <p> Inherits everything from BaseLinter </p>
*/
class LengthCheckerLinter(path: Fil... | ke00n/alabno | backend/linter/src/main/scala/linter/linters/LengthCheckerLinter.scala | Scala | mit | 1,014 |
package org.apache.spark.examples.mllib
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.mllib.linalg.Matrices
import org.apache.spark.mllib.linalg.Matrix
import org.apache.spark.mllib.linalg.Vector
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib... | tophua/spark1.52 | examples/src/main/scala/org/apache/spark/examples/mllib/DataTypes.scala | Scala | apache-2.0 | 6,365 |
package dk.gp.cogp.testutils
import breeze.linalg.DenseMatrix
import breeze.linalg.DenseVector
import breeze.linalg._
import dk.gp.cogp.model.Task
object loadToyModelDataIncomplete {
def apply(): Array[Task] = {
val y0Filter = (x: Double) => (x < -7 || x > -3)
val y1Filter = (x: Double) => (x < 4 || x > 8)... | danielkorzekwa/bayes-scala-gp | src/test/scala/dk/gp/cogp/testutils/loadToyModelDataIncomplete.scala | Scala | bsd-2-clause | 407 |
package endpoints.testsuite
import endpoints.algebra
trait JsonFromCodecTestApi
extends algebra.Endpoints
with algebra.JsonEntitiesFromCodec {
implicit def userCodec: JsonCodec[User]
implicit def addressCodec: JsonCodec[Address]
val jsonCodecEndpoint = endpoint(
post(path / "user-json-codec", jsonRe... | Krever/endpoints | testsuite/testsuite/src/main/scala/endpoints/testsuite/JsonFromCodecTestApi.scala | Scala | mit | 799 |
/*
* Copyright (c) 2015-16 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 agr... | rorygraves/perf_tester | corpus/shapeless/src/main/scala/shapeless/generic1.scala | Scala | apache-2.0 | 14,718 |
package me.archdev.restapi.utils.db
import com.zaxxer.hikari.{ HikariConfig, HikariDataSource }
class DatabaseConnector(jdbcUrl: String, dbUser: String, dbPassword: String) {
private val hikariDataSource = {
val hikariConfig = new HikariConfig()
hikariConfig.setJdbcUrl(jdbcUrl)
hikariConfig.setUsername... | ArchDev/akka-http-rest | src/main/scala/me/archdev/restapi/utils/db/DatabaseConnector.scala | Scala | mit | 564 |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package cqrs.command
/**
* A marker trait for commands handled by the aggregates on the write side.
*/
trait Do... | cqrs-endeavour/cqrs-endeavour | cqrs-framework/src/main/scala/cqrs/command/DomainCommand.scala | Scala | mpl-2.0 | 331 |
/**
* 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 | cassandra-dao/src/test/scala/com/verizon/bda/trapezium/dal/core/cassandra/CassandraDAOUnitTest.scala | Scala | apache-2.0 | 1,540 |
package core.shapes.dim1
import core.main._, core.pieces._, core.shapes.dim0._, core.shapes.dim1._, core.shapes.dim2._, core.shapes.forces._
class LineSegmentImpl(p_start: Point, val p_end: Point, override val rawDir: Vector2) extends RayImpl(p_start,rawDir) with LineSegment {
override lazy val dir = rawDir.unit
... | radiotech/FlatLand | src/core/shapes/dim1/LineSegmentImpl.scala | Scala | mit | 355 |
package lila.app
package templating
import lila.bookmark.Env.{ current => bookmarkEnv }
import lila.game.Game
import lila.user.User
trait BookmarkHelper {
def isBookmarked(game: Game, user: User): Boolean =
bookmarkEnv.api.bookmarked(game, user)
}
| r0k3/lila | app/templating/BookmarkHelper.scala | Scala | mit | 259 |
/*
* 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 ... | mkolod/incubator-spark | streaming/src/test/scala/org/apache/spark/streaming/TestSuiteBase.scala | Scala | apache-2.0 | 13,605 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | ragnarok/src/main/scala/com/precog/ragnarok/test/ArrayObjectSuite.scala | Scala | agpl-3.0 | 1,631 |
package org.lanyard.dist.disc
import org.scalatest.FunSpec
import org.scalatest.Matchers
import org.scalatest.prop.GeneratorDrivenPropertyChecks
class DiscreteTest extends FunSpec with Matchers with GeneratorDrivenPropertyChecks {
describe( "The class for discrete types" ) {
sealed trait DNA
case object A... | perian/Lanyard | src/test/scala/org/lanyard/dist/disc/DiscreteTest.scala | Scala | gpl-2.0 | 970 |
/*
* 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 ... | kiszk/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala | Scala | apache-2.0 | 60,257 |
package com.esri.dbscan
import com.esri.dbscan.Status.Status
import scala.collection.mutable
/**
* Density Based Clusterer.
*
* @param minPoints the min number of points in a cluster.
* @param nnSearch a reference to a NNSearch implementation.
*/
class DBSCAN[T <: DBSCANPoint](minPoints: Int, nnSearch: NNSearc... | mraad/dbscan-scala | src/main/scala/com/esri/dbscan/DBSCAN.scala | Scala | apache-2.0 | 3,810 |
package com.xah.chat.comms
import android.content.{Context, ServiceConnection, ComponentName}
import android.os.IBinder
import android.util.Log
class XServiceConnection extends ServiceConnection {
val TAG = "XServiceConnection"
var mService: XService = _
var mBound: Boolean = false
override def onServiceCon... | lemonxah/xaHChat | src/main/scala/com/xah/chat/comms/XServiceConnection.scala | Scala | mit | 695 |
import org.scalatest.{Matchers, FunSuite}
/** @version 1.1.0 */
class MinesweeperTest extends FunSuite with Matchers {
test("no rows") {
Minesweeper.annotate(List()) should be(List())
}
test("no columns") {
pending
Minesweeper.annotate(List("")) should be(List(""))
}
test("no mines") {
pen... | exercism/xscala | exercises/practice/minesweeper/src/test/scala/MinesweeperTest.scala | Scala | mit | 2,849 |
package com.roundeights.skene.response
import scala.io.Codec
import scala.actors.Actor
import scala.collection.mutable.MutableList
import java.util.concurrent.atomic.AtomicReference
import java.util.zip.GZIPOutputStream
import javax.servlet.http.{HttpServletResponse, HttpServletRequest}
import javax.servlet.AsyncCont... | Nycto/Skene | src/main/scala/skene/response/Servlet.scala | Scala | mit | 2,534 |
package com.github.novamage.svalidator.validation.simple.internals
class ConditionedGroupValidationRuleBuilderWrapper[A](conditionalExpression: A => Boolean, ruleBuilders: List[RuleBuilder[A]]) extends RuleBuilder[A] {
protected[validation] def buildRules(instance: A): RuleStreamCollection[A] = {
if (condition... | NovaMage/SValidator | src/main/scala/com/github/novamage/svalidator/validation/simple/internals/ConditionedGroupValidationRuleBuilderWrapper.scala | Scala | mit | 547 |
package slinky.native
import slinky.core.ExternalComponent
import slinky.core.annotations.react
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.|
@react object Picker extends ExternalComponent {
case class Props(
onValueChange: js.UndefOr[(String | Int, Int) => Unit]... | shadaj/slinky | native/src/main/scala/slinky/native/Picker.scala | Scala | mit | 1,017 |
package nars.logic.entity
import nars.io.Symbols
import TruthValue._
//remove if not needed
import scala.collection.JavaConversions._
object TruthValue {
/**
The charactor that marks the two ends of a truth value
*/
private val DELIMITER = Symbols.TRUTH_VALUE_MARK
/**
The charactor that separates the... | printedheart/opennars | nars_lab_x/nars_scala/src/main/scala/nars/entity/TruthValue.scala | Scala | agpl-3.0 | 3,004 |
/*
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/main/scala/org/apache/spark/rdd/cl/ObjectNativeInputBuffers.scala | Scala | bsd-3-clause | 3,107 |
package skinny.mailer
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
import javax.mail.Session
import org.joda.time.DateTime
import skinny.mailer.implicits.SkinnyMailerImplicits
class SkinnyMessageSpec extends FlatSpec with ShouldMatchers with SkinnyMailerImplicits {
behavior of "SkinnyM... | BlackPrincess/skinny-framework | mailer/src/test/scala/skinny/mailer/SkinnyMessageSpec.scala | Scala | mit | 3,104 |
package org.sisioh.aws4s.dynamodb.model
import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest
import org.sisioh.aws4s.PimpedType
object DeleteTableRequestFactory {
def create(): DeleteTableRequest = new DeleteTableRequest()
def create(tableName: String): DeleteTableRequest = new DeleteTableRequest(t... | everpeace/aws4s | aws4s-dynamodb/src/main/scala/org/sisioh/aws4s/dynamodb/model/RichDeleteTableRequest.scala | Scala | mit | 744 |
/*
* 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 ... | spark0001/spark2.1.1 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala | Scala | apache-2.0 | 6,220 |
/*
* 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 ... | rednaxelafx/apache-spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala | Scala | apache-2.0 | 36,209 |
/*
* ParticleBeliefPropagation.scala
* Trait to TBD
*
* Created By: Brian Ruttenberg (bruttenberg@cra.com)
* Creation Date: Oct 20, 2014
*
* Copyright 2014 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http://www.github.c... | agarbuno/figaro | Figaro/src/main/scala/com/cra/figaro/experimental/particlebp/ParticleBeliefPropagation.scala | Scala | bsd-3-clause | 16,059 |
/*
* 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 ... | iiisthu/sparkSdn | core/src/main/scala/org/apache/spark/rdd/RDD.scala | Scala | apache-2.0 | 39,761 |
// Copyright 2017 EPFL DATA Lab (data.epfl.ch)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law... | epfldata/squid | src/test/scala/squid/feature/NestedQuoting.scala | Scala | apache-2.0 | 1,474 |
package infra.piece.text
import infra.piece.core.{Piece, PieceKind}
import play.api.{Mode, Plugin}
import play.api.libs.json.{Json, Format}
import play.api.templates.Html
import scala.concurrent.{Future, ExecutionContext}
import akka.actor.{PoisonPill, Props, ActorRef, Actor}
import org.pegdown.{Extensions, PegDownPro... | alari/play-content | module-code/app/infra/piece/text/TextKind.scala | Scala | mit | 1,764 |
package com.github.akajuvonen.neuralnet_scala
import scala.math.exp
/** Sigmoid help tools used by NeuralNetwork class. */
object SigmoidTools {
/** Sigmoid function 1 / (1 + exp(-x)).
*
* @param x Input parameter x.
* @return Result of the sigmoid function.
*/
def sigmoid(x: Double): Double =
1... | akajuvonen/simple-neuralnet-scala | src/main/scala/SigmoidTools.scala | Scala | gpl-3.0 | 538 |
package mesosphere.util.state.mesos
import mesosphere.marathon.StoreCommandFailedException
import mesosphere.util.BackToTheFuture.Timeout
import mesosphere.util.ThreadPoolContext
import mesosphere.util.state.{ PersistentEntity, PersistentStore }
import org.apache.log4j.Logger
import org.apache.mesos.state.{ Variable, ... | EasonYi/marathon | src/main/scala/mesosphere/util/state/mesos/MesosStateStore.scala | Scala | apache-2.0 | 4,050 |
package by.verkpavel.grafolnet.service
import by.verkpavel.grafolnet.model.{ImageRequest, ImageResponse}
import spray.json.{DefaultJsonProtocol, JsFalse, JsNumber, JsString, JsTrue, JsValue, JsonFormat}
trait ServiceJsonProtocol extends DefaultJsonProtocol {
implicit object AnyJsonFormat extends JsonFormat[Any] {
... | VerkhovtsovPavel/BSUIR_Labs | Diploma/diploma-latex/src/fulllisting/ServiceJsonProtocol.scala | Scala | mit | 864 |
package org.monarchinitiative.dosdp
import zio.logging._
import zio.test.Assertion._
import zio.test._
object RegexTest extends DefaultRunnableSpec {
def spec = suite("Missing columns and cell values")(
testM("RegexSub should replace values correctly") {
val definition = RegexSub("regulated_activity", "r... | INCATools/dosdp-tools | src/test/scala/org/monarchinitiative/dosdp/RegexTest.scala | Scala | mit | 1,103 |
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.