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 |
|---|---|---|---|---|---|
/***********************************************************************
* Copyright (c) 2013-2018 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... | jahhulbert-ccri/geomesa | geomesa-utils/src/test/scala/org/locationtech/geomesa/utils/geotools/SimpleFeatureTypesTest.scala | Scala | apache-2.0 | 27,532 |
/*
* 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 ... | esi-mineset/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/VectorizedHashMapGenerator.scala | Scala | apache-2.0 | 10,233 |
package zzb.db
import com.mongodb.casbah._
import Mongos._
/**
* mongo操作
* Created by blackangel on 2014/7/18.
*/
trait MongoAccess {
def db[A](name:String)(f: MongoDB =>A)={
f(_db(name))
}
}
trait ExpressionNode{
def parent:Some[ExpressionNode]
def children:List[ExpressionNode]
}
trait LogicalBoolea... | stepover/zzb | zzb-dbaccess/src/main/scala/zzb/db/MongoAccess.scala | Scala | mit | 352 |
/**
* This file is part of mycollab-web.
*
* mycollab-web 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.
*
* mycollab-web is d... | uniteddiversity/mycollab | mycollab-web/src/main/scala/com/esofthead/mycollab/module/project/events/ProjectContentEvent.scala | Scala | agpl-3.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 ... | caneGuy/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala | Scala | apache-2.0 | 73,875 |
/*******************************************************************************
* Copyright (c) 2014 Guillaume DUBUISSON DUPLESSIS <guillaume.dubuisson_duplessis@insa-rouen.fr>.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* ... | GuillaumeDD/scala99problems | src/main/scala/logicAndCodes/P49/P49.scala | Scala | gpl-3.0 | 1,830 |
package net.liftmodules.ng
package comet
import Angular.{FutureId, ReturnData}
import net.liftweb._
import http._
import common._
import js._
import JE._
import JsCmds._
import net.liftweb.json.{Formats, JsonAST}
import scala.xml.NodeSeq
class LiftNgFutureActor extends CometActor {
def render = NodeSeq.Empty
de... | joescii/lift-ng | src/main/scala/net/liftmodules/ng/FutureActor.scala | Scala | apache-2.0 | 768 |
/*
* Copyright 2014 Kevin Herron
*
* 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 ... | digitalpetri/scala-ethernet-ip | enip-core/src/main/scala/com/digitalpetri/ethernetip/cip/CipServiceCodes.scala | Scala | apache-2.0 | 1,224 |
package com.productfoundry.akka.cqrs.project
import com.productfoundry.akka.cqrs.publish.EventSubscriber
/**
* Projects events onto a projection.
*/
trait Projector extends EventSubscriber with ProjectionUpdateHandler {
/**
* Uniquely identifies a projection created by the projector.
*/
def projectionId:... | odd/akka-cqrs | core/src/main/scala/com/productfoundry/akka/cqrs/project/Projector.scala | Scala | apache-2.0 | 802 |
package es.um.nosql.streaminginference.spark.input
import scala.collection.JavaConversions.asScalaBuffer
import org.apache.spark.internal.Logging
import org.apache.spark.storage.StorageLevel
import org.apache.spark.streaming.receiver.Receiver
import org.ektorp.CouchDbConnector
import org.ektorp.CouchDbInstance
import... | catedrasaes-umu/NoSQLDataEngineering | projects/es.um.nosql.streaminginference.json2dbschema/src/es/um/nosql/streaminginference/spark/input/CouchDBReceiver.scala | Scala | mit | 3,857 |
package scopeA {
class ProtectedClass1(protected val protectedField1: Int) {
protected val protectedField2 = 1
def equalFields(other: ProtectedClass1) =
(protectedField1 == other.protectedField1) &&
(protectedField2 == other.protectedField2) &&
(nested == other.nested)
class Nested {
... | younggi/books | programming_scala/progscala2/src/main/scala/progscala2/visibility/protected.scala | Scala | mit | 1,192 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | Panos-Bletsos/spark-cost-model-optimizer | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/LimitPushdownSuite.scala | Scala | apache-2.0 | 6,578 |
/*
* Scala classfile decoder (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 scal... | scala/scala | src/scalap/scala/tools/scalap/scalax/rules/scalasig/Flags.scala | Scala | apache-2.0 | 2,523 |
/*
* Copyright 2015 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... | kristapsmelderis/accessibility-driver | src/main/scala/uk/gov/hmrc/accessibility/AccessibilityDriver.scala | Scala | apache-2.0 | 3,182 |
package japgolly.scalajs.react.extra
import monocle._
import scalaz.effect.IO
import japgolly.scalajs.react._, ScalazReact._
/**
* Reusable version of [[ExternalVar]].
*/
final class ReusableVar[A](val value: A, val set: A ~=> IO[Unit])(implicit val reusability: Reusability[A]) {
override def toString =
s"Re... | beni55/scalajs-react | extra/src/main/scala/japgolly/scalajs/react/extra/ReusableVar.scala | Scala | apache-2.0 | 1,509 |
package models.tenant
import java.time.LocalDateTime
case class MedicalIncident(datetime: LocalDateTime, description: String)
| SBP07/backend | app/models/tenant/MedicalIncident.scala | Scala | gpl-2.0 | 128 |
package se.culvertsoft.mgen.jspack.generator
import scala.collection.JavaConversions.asScalaBuffer
import se.culvertsoft.mgen.api.model.GeneratedSourceFile
import se.culvertsoft.mgen.api.model.Project
import se.culvertsoft.mgen.api.plugins.Generator
import se.culvertsoft.mgen.compiler.util.SourceCodeBuffer
import se.... | culvertsoft/mgen | mgen-javascriptgenerator/src/main/scala/se/culvertsoft/mgen/jspack/generator/JavascriptGenerator.scala | Scala | mit | 1,022 |
/*
* 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 ... | chenc10/Spark-PAF | core/src/main/scala/org/apache/spark/storage/DiskBlockObjectWriter.scala | Scala | apache-2.0 | 7,704 |
package org.bitcoins.core.gen
import org.bitcoins.core.crypto._
import org.bitcoins.core.currency.CurrencyUnit
import org.bitcoins.core.number.UInt32
import org.bitcoins.core.policy.Policy
import org.bitcoins.core.protocol.script._
import org.bitcoins.core.protocol.transaction._
import org.bitcoins.core.script.crypto.... | Christewart/bitcoin-s-core | src/main/scala/org/bitcoins/core/gen/WitnessGenerators.scala | Scala | mit | 13,819 |
/*
* Copyright 2014 Lars Edenbrandt
*
* 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... | slicebox/slicebox | src/main/scala/se/nimsa/sbx/metadata/PropertiesDAO.scala | Scala | apache-2.0 | 33,205 |
package org.me.hotel
class HotelTest extends UnitTest("Hotel") {
it should "forbid creating a Hotel with no rooms" in {
Hotel()
an [IllegalArgumentException] should be thrownBy {
Hotel(rooms = List())
}
}
it should "forbid checking in if there are no free rooms" in {
val hotel = Hotel(List(Room(1).chec... | rnowley/SonicScrewDriver | example/scala/unitTestExample/src/test/scala/org/me/hotel/HotelTest.scala | Scala | mit | 644 |
/*
* The MIT License (MIT)
* <p>
* Copyright (c) 2018
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy... | amannocci/streamy | plugin-tcp/src/main/scala/io/techcode/streamy/tcp/event/TcpEvent.scala | Scala | mit | 2,596 |
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{universe => ru}
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
object foo {
class Expression {
override def toString = "Expression"
}
}
object Test extends dotty.runtime.LegacyApp {
val code = reify ... | yusuke2255/dotty | tests/disabled/macro/run/reify_typerefs_3a.scala | Scala | bsd-3-clause | 490 |
val t: String => String = _.toUpperCase
t(/*caret*/)
//v1: String | triggerNZ/intellij-scala | testdata/parameterInfo/functionParameterInfo/functionType/FunctionType.scala | Scala | apache-2.0 | 66 |
package org.yotchang4s.pixiv.novel
trait NovelComponent {
val novel: NovelRepository
trait NovelRepository {
}
} | yotchang4s/yapix | src/org/yotchang4s/pixiv/novel/NovelComponent.scala | Scala | bsd-3-clause | 120 |
package me.rjfarmer.rlh.retriever
import akka.actor._
import me.rjfarmer.rlh.api.HasTimestamp
import me.rjfarmer.rlh.cache.EhcCache
import scala.concurrent.duration._
import scala.util.{Failure, Success, Try}
object Collector {
def props[K, V <: HasTimestamp](cache: EhcCache[K,V], cached: Map[K,V], numItems: Int... | random-j-farmer/little-helper | app/jvm/src/main/scala/me/rjfarmer/rlh/retriever/Collector.scala | Scala | mit | 1,969 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | manuzhang/incubator-gearpump | streaming/src/main/scala/org/apache/gearpump/streaming/state/impl/InMemoryCheckpointStore.scala | Scala | apache-2.0 | 1,717 |
package util
import org.joda.time.DateTime
object Joda {
implicit def dateTimeOrdering: Ordering[DateTime] = Ordering.fromLessThan(_ isBefore _)
}
| metaxmx/FridayNightBeer | modules/datamodel/src/main/scala/util/Joda.scala | Scala | apache-2.0 | 164 |
/**
* ---------------------------------------------------------------------------
*
* Copyright (c) 2011 Dan Simpson
*
* 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 restricti... | dansimpson/satchel | scalatra/src/test/scala/org/ds/satchel/ServletSpec.scala | Scala | mit | 1,484 |
package org.helgoboss.scala_osgi_metatype
/**
* Contains adapters which translate the Scala OSGi Metatype interfaces to the ones defined in the native OSGi API.
*/
package object adapters {
}
| helgoboss/scala-osgi-metatype | src/main/scala/org/helgoboss/scala_osgi_metatype/adapters/package.scala | Scala | mit | 196 |
package com.twitter.util
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
import java.util.zip.{GZIPInputStream, GZIPOutputStream}
import org.apache.commons.codec.binary.Base64
import com.twitter.io.StreamIO
trait StringEncoder {
def encode(bytes: Array[Byte]): String = new String(bytes)
def decode(... | luciferous/util | util-codec/src/main/scala/com/twitter/util/StringEncoder.scala | Scala | apache-2.0 | 1,847 |
package haru.dao
import scala.slick.driver.MySQLDriver.simple._
import scala.slick.lifted.ProvenShape
import scala.slick.lifted.Tag
import java.sql.SQLIntegrityConstraintViolationException
import scala.slick.jdbc.{ GetResult, StaticQuery => Q }
import Q.interpolation
object WebHookDao extends DatabasePool {
val La... | haruio/haru-admin | src/main/scala/haru/dao/WebHookDao.scala | Scala | mit | 1,819 |
package org.littlewings.javaee7
import java.io.File
import org.apache.catalina.startup.Tomcat
import org.apache.tomcat.util.descriptor.web.ContextResource
import org.scalatest.{BeforeAndAfterAll, Suite}
trait EmbeddedTomcatCdiSupport extends Suite with BeforeAndAfterAll {
protected val port: Int = 8080
protected... | kazuhira-r/javaee7-scala-examples | cdi-programmatic-lookup/src/test/scala/org/littlewings/javaee7/EmbeddedTomcatCdiSupport.scala | Scala | mit | 1,832 |
/*
* This file is part of the "silex" library of helpers for Apache Spark.
*
* Copyright (c) 2016 Red Hat, 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.ap... | erikerlandson/silex | src/main/scala/com/redhat/et/silex/rdd/split.scala | Scala | apache-2.0 | 3,098 |
object SCL9473 {
trait Sys[S <: Sys[S]] {
type I
def foo(tx: Any): Int
}
def prepare[S <: Sys[S], I1 <: Sys[I1]](system: S { type I = I1 }): Any = {
/*start*/system.foo(123)/*end*/
}
}
//Int | ilinum/intellij-scala | testdata/typeInference/bugs5/SCL9473.scala | Scala | apache-2.0 | 212 |
package org.jetbrains.plugins.scala
package codeInspection.booleans
import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter
/**
* Nikolay.Tropin
* 4/24/13
*/
class SimplifyBooleanInspectionTest extends ScalaLightCodeInsightFixtureTestAdapter {
val s = ScalaLightCodeInsightFixtureTestAdapt... | LPTK/intellij-scala | test/org/jetbrains/plugins/scala/codeInspection/booleans/SimplifyBooleanInspectionTest.scala | Scala | apache-2.0 | 4,149 |
package HourRank_6
import utils.SetInt
/**
* Created by yujieshui on 2016/3/3.
*/
object KittyAndKatty {
def readSeqInt() = io.StdIn.readLine().split(" ").toList.map(_.toInt)
type User = Boolean
object Gamer extends Enumeration {
val kitty = Value("Kitty")
val katty = Value("Katty")
}
import... | 1178615156/hackerrank | src/main/scala/HourRank_6/KittyAndKatty.scala | Scala | apache-2.0 | 4,725 |
package capitulo09
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.FunSuite
import scala.io.Source
/**
* Para ler todas as linhas de um arquivo
* chame o método getLines de um objeto
* scala.io.Source
*/
@RunWith(classOf[JUnitRunner])
class LendoLinhasArquivo extends Fu... | celioeduardo/scala-impatient | src/test/scala/capitulo09/LeituraLinhasArquivo.scala | Scala | mit | 1,469 |
package keystoneml.nodes.util
import breeze.linalg.DenseVector
import org.apache.spark.rdd.RDD
import keystoneml.pipelines._
import keystoneml.workflow.Transformer
/**
* Given a class label, returns a binary vector that indicates when that class is present.
*
* Expects labels in the range [0, numClasses) and numCl... | amplab/keystone | src/main/scala/keystoneml/nodes/util/ClassLabelIndicators.scala | Scala | apache-2.0 | 1,638 |
package com.sksamuel.avro4s.schema
import com.sksamuel.avro4s.AvroSchema
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class PrimitiveSchemaTest extends AnyWordSpec with Matchers {
"SchemaEncoder" should {
"support top level Booleans" in {
val expected = new org.a... | sksamuel/avro4s | avro4s-core/src/test/scala/com/sksamuel/avro4s/schema/PrimitiveSchemaTest.scala | Scala | apache-2.0 | 1,817 |
package com.ovoenergy.comms.monitor
package metrics
import fs2._
import cats._, implicits._
import com.ovoenergy.comms.model.Feedback
import com.ovoenergy.comms.logging.core.Logger
import model._
object CommsStatus {
def pipeline[F[_]: Monad: Logger: Reporter](msg: Feedback): Stream[F, Unit] =
getInfo(msg).ev... | ovotech/comms-monitor-service | src/main/scala/com/ovoenergy/comms/monitor/metrics/CommsStatus.scala | Scala | mit | 1,410 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package views.js
import play.api.libs.json.Writes
import play.api.libs.json.Json
import play.twirl.api.JavaScript
/**
* Contains helpers intended to be used in JavaScript templates
*/
package object helper {
/**
* Generates a JavaScript value... | playframework/playframework | core/play/src/main/scala/views/js/helper/package.scala | Scala | apache-2.0 | 608 |
package one.lockstep.vault
import one.lockstep.lock.client.LockErr.Cancelled
import one.lockstep.lock.client._
import one.lockstep.util.Bytes
import scala.concurrent.duration.Duration
import scala.concurrent._
private class OnlineOperationFutureAdapter[A](preparing: Future[OnlineOperation[A]])
... | lockstep-one/vault | vault-client/src/main/scala/one/lockstep/vault/OnlineOperationFutureAdapter.scala | Scala | agpl-3.0 | 1,154 |
package com.twitter.finagle.memcached.stress
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.memcached.protocol._
import com.twitter.finagle.memcached.protocol.text.Memcached
import com.twitter.finagle.memcached.Server
import com.twitter.finagle.memcached.util.ChannelBufferUtils._
import co... | stevegury/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/stress/InterpreterServiceSpec.scala | Scala | apache-2.0 | 1,438 |
package breeze.maxent
import breeze.util.Index
import breeze.util.Encoder
import breeze.util.Profiling
import breeze.optimize.{FirstOrderMinimizer, DiffFunction}
import breeze.linalg._
import breeze.collection.mutable.SparseArray
/**
*
* @author dlwh
*/
abstract class MaxEntObjectiveFunction extends DiffFunction[... | tjhunter/scalanlp-core | learn/src/main/scala/breeze/maxent/MaxEntObjectiveFunction.scala | Scala | apache-2.0 | 9,299 |
import sbt._
import Keys._
import org.scalatra.sbt._
import org.scalatra.sbt.PluginKeys._
import com.mojolly.scalate.ScalatePlugin._
import sbtassembly.Plugin._
import AssemblyKeys._
import ScalateKeys._
object DruidiaBuild extends Build {
val ScalatraVersion = "2.2.0"
lazy val project = Project ("druidia", file(... | modcloth-labs/druidia | project/build.scala | Scala | mit | 1,201 |
/*
* 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... | SRGOM/scalatest | scalatest/src/main/scala/org/scalatest/fixture/AsyncFunSpecLike.scala | Scala | apache-2.0 | 2,701 |
/*******************************************************************************
Copyright (c) 2013, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
***********************************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/nodes_util/SpanInfo.scala | Scala | bsd-3-clause | 772 |
package com.onion.view
import com.onion.model._
import com.onion.mongo.DB.UserDao
import spray.json.DefaultJsonProtocol
import sprest.util.enum.{EnumCompanion, Enum}
import scala.concurrent.Future
import com.onion.util.FutureUtil._
import com.onion.util.OptionUtil._
import scala.concurrent.ExecutionContext.Implicits.... | jasoncao/onion-ring | src/main/scala/com/onion/view/ViewObject.scala | Scala | apache-2.0 | 5,915 |
import reflect.ClassTag
class Co[+S]
object Co {
def empty[X: ClassTag]: Co[X] = ???
}
class Contra[-S]
object Contra {
def empty[X: ClassTag]: Contra[X] = ???
}
class Foo[+FT](x: FT) {
def fooArray: Foo[Array[String]] = new Foo(Array.empty)
val y1: Array[String] = Array.empty
def fooCo: Foo[Co[String]] = new... | som-snytt/dotty | tests/pos/i6127.scala | Scala | apache-2.0 | 471 |
/*
* Copyright 2017 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... | liquidarmour/ct-calculations | src/test/scala/uk/gov/hmrc/ct/box/retriever/BoxRetrieverSpec.scala | Scala | apache-2.0 | 1,840 |
package com.twitter.finagle.thrift
import com.twitter.finagle.Service
import com.twitter.util.Future
import org.specs.mock.Mockito
import org.specs.SpecificationWithJUnit
class ClientIdRequiredFilterSpec extends SpecificationWithJUnit with Mockito {
"ClientIdRequiredFilter" should {
val underlying = mock[Servic... | joshbedo/finagle | finagle-thrift/src/test/scala/com/twitter/finagle/thrift/ClientIdRequiredFilterSpec.scala | Scala | apache-2.0 | 940 |
/*
* 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 ... | bowenli86/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/MethodCallGen.scala | Scala | apache-2.0 | 2,743 |
package logic
import scalaz._
trait MonadLogic[F[_]] extends MonadPlus[F] {
private def maybe[A, B](m: Option[A], default: => B)(f: A => B): B =
m match {
case None => default
case Some(a) => f(a)
}
def split[A](m: F[A]): F[Option[(A, F[A])]]
def interleave[A](m1: F[A], m2: F[A]): F[A] =
... | xuwei-k/scala-logic | src/main/scala/logic/MonadLogic.scala | Scala | mit | 5,620 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | typelevel/squants | shared/src/test/scala/squants/market/CurrencyExchangeRateSpec.scala | Scala | apache-2.0 | 2,169 |
/*
* 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 ... | chenc10/Spark-PAF | sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala | Scala | apache-2.0 | 18,953 |
package org.flowpaint.pixelprocessors
import _root_.org.flowpaint.property.Data
import _root_.scala.collection.Map
import org.flowpaint.pixelprocessor.PixelProcessor
import org.flowpaint.util.DataSample
/**
*
*
* @author Hans Haggstrom
*/
class Noise2D extends PixelProcessor(
"", "",
"""
float no... | zzorn/flowpaint | src/main/scala/org/flowpaint/pixelprocessors/Noise2D.scala | Scala | gpl-2.0 | 565 |
/*
* 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 ... | zhangminglei/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/descriptors/FunctionDescriptorValidator.scala | Scala | apache-2.0 | 1,844 |
package views.html.bootstrap3
import play.twirl.api._
import play.twirl.api.TemplateMagic._
import play.api.templates.PlayMagic._
import models._
import controllers._
import java.lang._
import java.util._
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import play.api.i18n._
import... | yoni206/ducking-octo-wallhack | target/scala-2.11/twirl/main/views/html/bootstrap3/password.template.scala | Scala | mit | 3,052 |
package controllers.parsing
import models.db.build.DbSaveDismissal
import models.DismissalType.fromString
import play.api.libs.json.JsValue
import play.api.Logger
object DismissalParser {
val highfieldDismissalsName = "highfield_dismissals"
val nonHighfieldDismissalsName = "opposition_dismissals"
val bats... | ishakir/cric-stat | app/controllers/parsing/DismissalParser.scala | Scala | epl-1.0 | 1,535 |
/*
* Copyright (C) FuseSource, Inc.
* http://fusesource.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | Jitendrakry/fuse | fabric/fabric-monitor/src/main/scala/org/fusesource/fabric/monitor/MonitorDeamon.scala | Scala | apache-2.0 | 5,123 |
package com.taig.tmpltr.markup
import com.taig.tmpltr._
import play.api.mvc.Content
trait caption
extends Tag.Body[caption, Content]
{
val tag = "caption"
} | Taig/Play-Tmpltr | app/com/taig/tmpltr/markup/caption.scala | Scala | mit | 160 |
package ddp_sequencial
import java.io.File
import scala.xml.{Elem, Node, XML}
class GMLDDPReader(xml:Elem) extends DDPReader(xml) {
def producePolygon(xml:Node) = {
xml match {
case s @ <Polygon>{contents @ _*}</Polygon> => {
val posElem = s \\\\ "posList"
val areaIdElem = s \\ "@{http:/... | chandonbrut/lrit-ddp-gml-viz | app/util/GMLDDPReader.scala | Scala | apache-2.0 | 682 |
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{universe => ru}
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
class C
object Test extends App {
val Block(List(ValDef(_, _, tpt: CompoundTypeTree, _)), _) = reify{ val x: C{} = ??? }.tree
println(tpt)
p... | som-snytt/dotty | tests/disabled/macro/run/t7235.scala | Scala | apache-2.0 | 400 |
package com.datastax.example.spark.cassandra
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.sql.hive.HiveContext
object AccessingCassandraDataFromSparkInIDE {
def main(args: Array[String]) {
val jars = List("./target/dse-scala-examples-1.0-SNAPSHOT.jar")
val ... | matt-atwater/DSECodeSamples | ScalaExamples/src/main/scala/com/datastax/example/spark/cassandra/AccessingCassandraDataFromSparkInIDE.scala | Scala | mit | 867 |
/*
* 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-blink/src/main/scala/org/apache/flink/table/plan/cost/FlinkCostBase.scala | Scala | apache-2.0 | 1,166 |
package com.intel.analytics.zoo.tutorial
import scopt.OptionParser
object Utils {
case class TestParams(
dimInput: Int = 70,
nHidden: Int = 100,
recordSize: Long = 1e5.toLong,
maxEpoch: Int = 2,
... | intel-analytics/BigDL | apps/SimpleMlp/src/main/scala/com/intel/analytics/zoo/tutorial/Utils.scala | Scala | apache-2.0 | 1,324 |
object Test {
def res(x: quoted.Expr[Int])(using scala.quoted.QuoteContext): quoted.Expr[Int] = x match {
case '{ val a: Int = ${ Foo('{ val b: Int = $y; b }) }; a } => y // owner of y is res
}
object Foo {
def unapply(x: quoted.Expr[Int]): Option[quoted.Expr[Int]] = Some(x)
}
}
| som-snytt/dotty | tests/pos/i6214b.scala | Scala | apache-2.0 | 296 |
/*
* 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/main/scala/com/intel/analytics/bigdl/dllib/nn/internal/Cropping2D.scala | Scala | apache-2.0 | 3,016 |
package edu.neu.coe.csye._7200
import org.scalatest.{ FlatSpec, Matchers }
import scala.util._
import edu.neu.coe.csye._7200.trial._
class TrialSpec extends FlatSpec with Matchers {
"First" should """transform "2" into 2""" in {
val trial: Trial[String,Int] = Identity() :| {x: String => Try(x.toInt)}
trial(... | rchillyard/Scalaprof | FunctionalProgramming/src/test/scala/edu/neu/coe/csye/_7200/TrialSpec.scala | Scala | gpl-2.0 | 3,127 |
/**
* Copyright 2014 Reverb Technologies, 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... | noboomu/swagger-play24 | app/pl/matisoft/swagger/SwaggerModule.scala | Scala | apache-2.0 | 988 |
/*
* Copyright 2014 IBM Corp.
*
* 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... | yeghishe/spark-kernel | kernel-api/src/main/scala/com/ibm/spark/global/StreamState.scala | Scala | apache-2.0 | 2,496 |
package dresden.crdt
package object json {
// Project-wide typedefs
type ReplicaId = String
}
| jarlopez/dresden | src/main/scala-2.11/dresden/crdt/json/package.scala | Scala | mit | 103 |
package detector
import image._
import file._
class Detector(img:Image) {
def markFaces():Image = {
???
}
}
object Detector{
val haarList = File.readLines("features.txt").map(Haar.fromFileString).toList
val sortedFeatures = haarList.sortBy { x => 1.0-x.weight }
def isFace(original:Image) = {
val ... | AlexLamson/Face-Detection | src/detector/Detector.scala | Scala | mit | 629 |
/*
* (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/gpu_operator/function/FieldBuffer.scala | Scala | apache-2.0 | 11,084 |
/*
Author:
Kristal Curtis
*/
package siren
case class SAMTag(tagName: String, tagType: String, value: String) {
override def toString = tagName + ":" + tagType + ":" + value
}
object SAMTag {
val TAG_REGEX = """([A-Za-z][A-Za-z0-9]):(.+):(.+)""".r
def getSAMTag(t: String): SAMTag = {
val TAG_REGEX(t... | fnothaft/siren-release | src/main/scala/siren/SAMTags.scala | Scala | bsd-2-clause | 1,784 |
trait Foo {
def a = 1
def b = 1
def c = 1
}
class Bar(foo: Foo) {
export foo.{a => _, b => _, _}
val x1 = a // error
val x2 = b // error
}
| som-snytt/dotty | tests/neg/i8368.scala | Scala | apache-2.0 | 152 |
package persistence.dal
import com.typesafe.scalalogging.LazyLogging
import persistence.entities.{ Job, Jobs }
import slick.driver.JdbcProfile
import utils.DbModule
import scala.concurrent.Future
trait JobsDal {
def save(job: Job): Future[Int]
def getJobs(): Future[Seq[Job]]
def getJobsByTestId(testId: Int): F... | ShiftForward/ridgeback | src/main/scala/persistence/dal/JobsDal.scala | Scala | mit | 1,523 |
package maker.utils
import java.io.{OutputStream, File}
import java.io.FileOutputStream
import java.io.PrintStream
import org.apache.commons.io.output.TeeOutputStream
case class TeeToFileOutputStream(file : File, os : OutputStream = Console.out) extends OutputStream {
protected def makeTeeStream = {
new PrintSt... | cage433/maker | maker/src/maker/utils/TeeToFileOutputStream.scala | Scala | bsd-2-clause | 574 |
case class Test1(); case class Test2(); case class Test3();
case class Test4(); case class Test5(); case class Test6();
sealed abstract class DSL {
def cont [P1 >: this.type <: DSL, P2 <: DSL](continuation: => P2) =
Continue[P1, P2](() => this, () => continuation)
}
case class Continue [P1 <: DSL, P2 <: DSL](p1:... | dotty-staging/dotty | tests/pos/i12141.scala | Scala | apache-2.0 | 1,495 |
/**
* 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... | cloudera/crunch | scrunch/src/main/scripts/imports.scala | Scala | apache-2.0 | 836 |
package com.shocktrade.client.contest
import com.shocktrade.client.MySessionService
import io.scalajs.npm.angularjs._
import io.scalajs.npm.angularjs.toaster.Toaster
import io.scalajs.util.JsUnderOrHelper._
import io.scalajs.util.OptionHelper._
import io.scalajs.util.PromiseHelper.Implicits._
import io.scalajs.util.Du... | ldaniels528/shocktrade.js | app/client/angularjs/src/main/scala/com/shocktrade/client/contest/MarginAccountController.scala | Scala | apache-2.0 | 4,965 |
/*
* Copyright 2014 Databricks
*
* 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... | karenyyng/spark-csv | src/test/scala/com/databricks/spark/csv/CsvSuite.scala | Scala | apache-2.0 | 15,283 |
/*
* 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 ... | aliyun/aliyun-emapreduce-sdk | emr-sql/src/main/scala/org/apache/spark/sql/aliyun/udfs/tablestore/ResolveTableStoreBinlogUDF.scala | Scala | artistic-2.0 | 3,896 |
/**
* 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"); yo... | sslavic/kafka | core/src/test/scala/integration/kafka/api/SaslEndToEndAuthorizationTest.scala | Scala | apache-2.0 | 3,730 |
package com.richardchankiyin.os
import org.scalatest.FlatSpec
import com.typesafe.scalalogging.Logger
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
import scala.concurrent.duration.Duration
class SchedulerJobTest extends FlatSpec{
val logger = Logger(LoggerFactory.getLogger(this.getClass))
... | richardchankiyin/sysdashboard | HealthCheck/src/test/scala/com/richardchankiyin/os/SchedulerJobTest.scala | Scala | gpl-3.0 | 1,589 |
package controllers
import javax.inject.Inject
import play.api.mvc.{BaseController, ControllerComponents}
import views.About
import scala.concurrent.ExecutionContext
/**
*
* @author ponkotuy
* Date: 14/10/11.
\\*/
class ViewAbout @Inject()(val controllerComponents: ControllerComponents, implicit val ec: Executi... | ttdoda/MyFleetGirls | server/app/controllers/ViewAbout.scala | Scala | mit | 610 |
/*
* Copyright (C) 2009-2013 Mathias Doenitz, Alexander Myltsev
*
* 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 ... | ZizhengTai/http4s | parboiled2/src/test/scala/org/http4s/internal/parboiled2/CharUtilsSpec.scala | Scala | apache-2.0 | 1,746 |
package net.liftweb.util
/*
* Copyright 2007-2009 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
*
* U... | beni55/liftweb | lift-util/src/main/scala/net/liftweb/util/Props.scala | Scala | apache-2.0 | 6,091 |
// Equites, a Scala chess playground
// Copyright © 2013-2014 Frank S. Thomas <frank@timepit.eu>
//
// 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 ... | equites-chess/equites-core | src/main/scala/eu/timepit/equites/implicits/PlacedImplicits.scala | Scala | gpl-3.0 | 888 |
/*
* 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/integration/torch/SoftMinSpec.scala | Scala | apache-2.0 | 5,278 |
package lila.search
import com.sksamuel.elastic4s.ElasticDsl._
final class Range[A] private (val a: Option[A], val b: Option[A]) {
def queries(name: String) =
a.fold(b.toList map { bb => rangeQuery(name) lte bb.toString }) { aa =>
b.fold(List(rangeQuery(name) gte aa.toString)) { bb =>
List(rangeQ... | ornicar/lila-search | app/Range.scala | Scala | agpl-3.0 | 1,085 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/nodes/logical/FlinkLogicalSnapshot.scala | Scala | apache-2.0 | 3,287 |
package info.mornlight.oneopus.ui
import javafx.scene.layout.HBox
import javafx.scene.control.{TextField, Label}
/**
* Created by alfred on 11/8/13.
*/
class FilterBar extends HBox with ListerBar {
private val label = new Label("Command:")
private val input = new TextField
getChildren.addAll(label, input)
... | xiaodongw/oneopus | app/src/main/scala/info/mornlight/oneopus/ui/FilterBar.scala | Scala | apache-2.0 | 371 |
/*
*
* * Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*
*/
package play.api.libs.ws.ssl
object Protocols {
/**
* Protocols which are known to be insecure.
*/
val deprecatedProtocols = Set("SSL", "SSLv2Hello", "SSLv3")
val recommendedProtocols = Array("TLSv1.2", "TLSv1.1", "TLSv1")... | jyotikamboj/container | pf-framework/src/play-ws/src/main/scala/play/api/libs/ws/ssl/Protocols.scala | Scala | mit | 586 |
package jp.bracken.scalastro
/* Copyright (C) 2013 Chris Bracken
*
* This file is part of Scalastro.
*
* Scalastro 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
* ... | cbracken/scalastro | src/test/scala/jp/bracken/scalastro/JulianDateTest.scala | Scala | gpl-3.0 | 2,386 |
package com.github.jmccrae
import java.sql.{Connection, PreparedStatement, ResultSet}
import org.scalatest._
import org.scalamock.scalatest.MockFactory
class RDFSQLUtilsTest extends WordSpec with Matchers with MockFactory {
import sqlutils._
"A SQL string" when {
"without variables" should {
"produce a... | jmccrae/yuzu | scala/src/test/scala/yuzu/test_rdfsql.scala | Scala | apache-2.0 | 3,001 |
package lila.tournament
import akka.stream.Materializer
import akka.stream.scaladsl._
import BSONHandlers._
import org.joda.time.DateTime
import reactivemongo.akkastream.{ cursorProducer, AkkaStreamCursor }
import reactivemongo.api.bson._
import reactivemongo.api.ReadPreference
import lila.db.dsl._
import lila.game.G... | luanlv/lila | modules/tournament/src/main/PairingRepo.scala | Scala | mit | 6,774 |
package org.workcraft.tasks
import scalaz.Scalaz
import scalaz.Scalaz._
import org.workcraft.scala.effects.IO._
import org.workcraft.scala.effects.IO
import Task._
object Test {
def step1 : Task[Unit, Nothing] = Task( tc => {
System.out.print("Step 1")
Range(0,30).foreach( x => {
Thread.sleep(100)
... | tuura/workcraft-2.2 | Tasks/src/main/scala/org/workcraft/tasks/Test.scala | Scala | gpl-3.0 | 1,544 |
import sbt._
import Keys._
object BuildSettings {
val ScalaVersion = "2.11.1"
val buildSettings = Defaults.coreDefaultSettings ++ Seq(
organization := "com.softwaremill.scalaval",
version := "0.2-SNAPSHOT",
scalaVersion := ScalaVersion,
crossScalaVersions := Seq("2.10.2", "2.11.1"),
// Sonatyp... | mostr/scalaval | project/Build.scala | Scala | apache-2.0 | 1,669 |
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.