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 ml.combust.mleap.tensor
import java.util
import java.util.Comparator
import scala.language.implicitConversions
import scala.reflect.{ClassTag, classTag}
/**
* Created by hollinwilkins on 1/12/17.
*/
object Tensor {
val BooleanClass: Class[Boolean] = classOf[Boolean]
val ByteClass: Class[Byte] = class... | combust/mleap | mleap-tensor/src/main/scala/ml/combust/mleap/tensor/Tensor.scala | Scala | apache-2.0 | 5,448 |
/*
* Copyright (c) 2017 Magomed Abdurakhmanov, Hypertino
* 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 com.hypertino.facade.utils
import com.hyper... | hypertino/hyperfacade | src/main/scala/com/hypertino/facade/utils/RequestUtils.scala | Scala | mpl-2.0 | 966 |
package fpinscala.datastructures
import scala.annotation.tailrec
sealed trait List[+A] // `List` data type
case object Nil extends List[Nothing] // data constructor for `List`
case class Cons[+A](head: A, tail: List[A]) extends List[A]
object List { // `List` companion object
def sum(ints: List[Int]): Int = ints m... | ShokuninSan/fpinscala | exercises/src/main/scala/fpinscala/datastructures/List.scala | Scala | mit | 8,624 |
package com.lorandszakacs.sg.reifier
import com.lorandszakacs.sg.http.{SGClient, SGClientAssembly}
import com.lorandszakacs.sg.reifier.impl.{SGReifierImpl, SessionDaoImpl}
import com.lorandszakacs.util.mongodb.Database
import com.lorandszakacs.util.effects._
/**
*
* @author Lorand Szakacs, lsz@lorandszakacs.com
... | lorandszakacs/sg-downloader | sg-harvester/src/main/scala/com/lorandszakacs/sg/reifier/ReifierAssembly.scala | Scala | apache-2.0 | 749 |
package kafka.message
import junit.framework.TestCase
import kafka.utils.TestUtils
class CompressionUtilTest extends TestCase {
def testSimpleCompressDecompress() {
val messages = List[Message](new Message("hi there".getBytes), new Message("I am fine".getBytes), new Message("I am not so well today".getByt... | tcrayford/hafka | kafka/core/src/test/scala/unit/kafka/message/CompressionUtilsTest.scala | Scala | bsd-3-clause | 1,269 |
/*
* 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 ... | Yelp/zipkin | zipkin-scrooge/src/test/scala/com/twitter/zipkin/adapter/ThriftConversionsTest.scala | Scala | apache-2.0 | 3,147 |
object Test {
object MyEnum extends Enumeration {
val Foo = Value(2000000000)
val Bar = Value(-2000000000)
val X = Value(Integer.MAX_VALUE)
val Y = Value(Integer.MIN_VALUE)
}
import MyEnum.*
def main(args: Array[String]): Unit = {
println(Foo > Bar)
println(X > Y)
}
}
| dotty-staging/dotty | tests/run/t5588.scala | Scala | apache-2.0 | 308 |
package build.unstable.sonicd.source
import java.sql.{Connection, DriverManager, ResultSet, Statement}
import akka.actor._
import akka.stream.actor.ActorPublisher
import akka.stream.actor.ActorPublisherMessage.Request
import build.unstable.sonic.JsonProtocol._
import build.unstable.sonic.model._
import build.unstable... | ernestrc/sonicd | server/src/main/scala/build/unstable/sonicd/source/JdbcSource.scala | Scala | mit | 15,477 |
/*
* Copyright 2012 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package io.escalante.quickstarts.lift.jpa
import java.util.Date
import javax.persistence._
import javax.validation.constraints.Size
/**
... | escalante/escalante-quickstart | library-lift-jpa/src/main/scala/io/escalante/quickstarts/lift/jpa/Book.scala | Scala | apache-2.0 | 1,039 |
package org.openurp.edu.eams.teach.lesson.service
import java.io.Serializable
import org.beangle.data.model.Entity
import org.openurp.base.Department
import org.openurp.base.Semester
import org.openurp.edu.base.Project
import org.openurp.edu.base.Teacher
import org.openurp.edu.base.code.CourseType
import org.openurp... | openurp/edu-eams-webapp | core/src/main/scala/org/openurp/edu/eams/teach/lesson/service/LessonService.scala | Scala | gpl-3.0 | 1,348 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/main/scala/uk/gov/hmrc/ct/CATO19.scala | Scala | apache-2.0 | 758 |
package io.scalac.amqp.impl
import com.rabbitmq.client.{Connection, ShutdownListener, ShutdownSignalException}
import io.scalac.amqp.Delivery
import org.reactivestreams.{Publisher, Subscriber}
import scala.concurrent.stm.Ref
import scala.util.control.NonFatal
import scala.util.{Failure, Success, Try}
private[amqp] ... | ScalaConsultants/reactive-rabbit | src/main/scala/io/scalac/amqp/impl/QueuePublisher.scala | Scala | apache-2.0 | 2,342 |
package com.yetu.oauth2provider
package oauth2
package object OAuth2Protocol {
/**
* OAuth2 Specification for Response types used in the /authorize endpoint.
* See http://tools.ietf.org/html/rfc6749 for the full spec
*/
object ResponseTypes {
/**
* "code" is used in the authorization grant flow ... | yetu/oauth2-provider | app/com/yetu/oauth2provider/oauth2/OAuth2Protocol.scala | Scala | mit | 946 |
/*
* 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 ... | maropu/spark | core/src/main/scala/org/apache/spark/storage/RDDInfo.scala | Scala | apache-2.0 | 2,653 |
import java.io.InputStream
import scala.io.Source
import net.liftweb.json.{DefaultFormats, parse}
object Util {
val birthdaysPath: String = "/birthdays.txt" // where birthdays are stored
/**
* @param birthdaysPath: file path to people with their birthdays in json format
* @return all people from birthd... | Flooorent/remainder | src/main/scala/Util.scala | Scala | mit | 652 |
package funsets
import common._
/**
* 2. Purely Functional Sets.
*/
object FunSets {
/**
* We represent a set by its characteristic function, i.e.
* its `contains` predicate.
*/
type Set = Int => Boolean
/**
* Indicates whether a set contains a given element.
*/
def contains(s: Set, elem: In... | ByzanTine/Coursera-Scala | funsets/src/main/scala/funsets/FunSets.scala | Scala | mit | 2,186 |
/*
* Copyright 2014-2021 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | brharrington/atlas | atlas-jmh/src/main/scala/com/netflix/atlas/core/validation/TagRules.scala | Scala | apache-2.0 | 3,221 |
package scredis
import akka.actor.ActorSystem
import com.typesafe.config.Config
import scredis.commands._
import scredis.io.SubscriberAkkaConnection
import scredis.protocol.AuthConfig
import scala.concurrent.Future
import scala.concurrent.duration._
/**
* Defines a Pub/Sub Redis client capable of subscribing to cha... | scredis/scredis | src/main/scala/scredis/SubscriberClient.scala | Scala | apache-2.0 | 10,427 |
package com.productfoundry.akka.journal
import java.util.concurrent.Callable
import akka.dispatch.Futures
import akka.persistence.journal.SyncWriteJournal
import akka.persistence.{PersistentConfirmation, PersistentId, PersistentRepr}
import akka.serialization.SerializationExtension
import scala.collection.immutable.... | odd/akka-cqrs | inmem/src/main/scala/com/productfoundry/akka/journal/InMemoryJournal.scala | Scala | apache-2.0 | 4,399 |
import akka.actor.ActorSystem
import akka.event.Logging
import akka.event.Logging.InfoLevel
import akka.http.scaladsl.Http
import akka.http.scaladsl.Http.ServerBinding
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server._
import akka.stream.ActorMaterializer
import com.mz.training.common.rest... | michalzeman/angular2-training | akka-http-server/src/main/scala/Main.scala | Scala | mit | 2,061 |
package org.bitcoins.testkit.oracle
import org.bitcoins.dlc.oracle.config.DLCOracleAppConfig
import org.bitcoins.testkit.util.FileUtil
import scala.concurrent.{ExecutionContext, Future}
object OracleTestUtil {
def destroyDLCOracleAppConfig(config: DLCOracleAppConfig)(implicit
ec: ExecutionContext): Future[U... | bitcoin-s/bitcoin-s | testkit/src/main/scala/org/bitcoins/testkit/oracle/OracleTestUtil.scala | Scala | mit | 464 |
/**
* 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... | davidwilliams1978/camel | components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/SLogProcessorTest.scala | Scala | apache-2.0 | 1,722 |
// scalastyle:off line.size.limit
/*
* Ported by Alistair Johnson from
* https://github.com/gwtproject/gwt/blob/master/user/test/com/google/gwt/emultest/java/math/BigDecimalArithmeticTest.java
*/
// scalastyle:on line.size.limit
package org.scalajs.testsuite.javalib.math
import java.math._
import org.scalajs.jasm... | andreaTP/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/javalib/math/BigDecimalArithmeticTest.scala | Scala | bsd-3-clause | 56,814 |
import scala.language.experimental.macros
object Macros {
def foo(xs: Int*): Unit = macro Impls.foo
}
object Test extends App {
val numbers = List(1, 2, 3, 4, 5)
Macros.foo(numbers: _*)
}
| scala/scala | test/files/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala | Scala | apache-2.0 | 195 |
package gov.uk.dvla.vehicles.keeper.stepdefs.runner
import cucumber.api.CucumberOptions
import cucumber.api.junit.Cucumber
import org.junit.runner.RunWith
@RunWith(classOf[Cucumber])
@CucumberOptions(
features = Array("acceptance-tests/src/test/resources/gherkin/PrivateKeeperOptionalFieldsValidation.feature"),
gl... | dvla/vehicles-change-keeper-online | acceptance-tests/src/test/scala/gov/uk/dvla/vehicles/keeper/stepdefs/runner/PrivateKeeperOptionalFieldsValidation.scala | Scala | mit | 445 |
package com.monsanto.arch.cloudformation.model.resource
import com.monsanto.arch.cloudformation.model.{ResourceRef, ConditionRef, Token, `Fn::GetAtt`}
import spray.json.DefaultJsonProtocol._
import spray.json.{JsString, JsValue, JsonFormat}
case class `AWS::ElasticBeanstalk::Application`(
... | MonsantoCo/cloudformation-template-generator | src/main/scala/com/monsanto/arch/cloudformation/model/resource/ElasticBeanStalk.scala | Scala | bsd-3-clause | 7,370 |
/*
* This file is part of openisetl
*
* Copyright (c) Arnaud Le Blanc
*/
package openisetl.runtime
class ExecuteException(msg:String) extends Exception(msg) {
} | arnaud-lb/OpenISETL | src/main/scala/openisetl/runtime/ExecuteException.scala | Scala | mit | 167 |
/*
* Copyright 2015 Tarık Yılmaz
*
* 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... | trK54Ylmz/aegeus | aegeus-engine/src/main/scala/com/aegeus/engine/io/CloudFrontLog.scala | Scala | apache-2.0 | 1,834 |
package metronome.chrono
/**
* A date-based amount of time, such as '3 years, 4 months and 5 days' in an
* arbitrary chronology, intended for advanced globalization use cases.
* <p>
* This interface models a date-based amount of time in a calendar system.
* While most calendar systems use years, months and days, ... | javierg1975/metronome | src/main/scala/metronome/chrono/Period.scala | Scala | gpl-2.0 | 18,492 |
/*
* 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 ... | ueshin/apache-spark | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/VectorizedHashMapGenerator.scala | Scala | apache-2.0 | 9,165 |
package sbtikvm
import sbt.Keys._
import sbt._
object Keys {
val netOutputPath = SettingKey[File]("netOutputPath", "Path in which to place .NET build products.")
val ikvmPath = TaskKey[File]("ikvmPath", "Path to IKVM installation.")
val netFrameworkVersion = TaskKey[String]("netFrameworkVersion", "Version of .... | HevyLight/sbt-ikvm | src/main/scala/sbtikvm/Keys.scala | Scala | apache-2.0 | 1,668 |
/*
* Copyright 2011-2021 Asakusa Framework Team.
*
* 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 ... | asakusafw/asakusafw-spark | compiler/src/main/scala/com/asakusafw/spark/compiler/graph/CoGroupInstantiator.scala | Scala | apache-2.0 | 3,772 |
package mesosphere.marathon.event.http
import akka.actor._
import com.google.inject.Inject
import mesosphere.marathon.api.LeaderInfo
import mesosphere.marathon.event.LocalLeadershipEvent
import mesosphere.marathon.event.http.HttpEventStreamActor._
import mesosphere.marathon.metrics.Metrics.AtomicIntGauge
import mesosp... | sepiroth887/marathon | src/main/scala/mesosphere/marathon/event/http/HttpEventStreamActor.scala | Scala | apache-2.0 | 4,894 |
/*
* 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/keras/layers/AddConstantSpec.scala | Scala | apache-2.0 | 2,175 |
package au.com.dius.pact.consumer.specs2
import java.util.concurrent.TimeUnit.MILLISECONDS
import au.com.dius.pact.consumer.PactSpec
import au.com.dius.pact.model.PactFragment
import org.junit.runner.RunWith
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner
import scala.concurrent.Await
im... | Fitzoh/pact-jvm | pact-jvm-consumer-specs2/src/test/scala/au/com/dius/pact/consumer/specs2/DifferentStatesPactSpec.scala | Scala | apache-2.0 | 1,773 |
package im.actor.server
import java.net.InetSocketAddress
import akka.contrib.pattern.DistributedPubSubExtension
import akka.stream.ActorMaterializer
import com.amazonaws.services.s3.transfer.TransferManager
import com.typesafe.config.ConfigFactory
import im.actor.api.rpc.auth._
import im.actor.api.rpc.codecs.Request... | yangchenghu/actor-platform | actor-server/actor-tests/src/test/scala/im/actor/server/SimpleServerE2eSpec.scala | Scala | mit | 11,798 |
package slick.test.collection.heterogenous
import org.junit.Test
import slick.collection.heterogeneous._
import syntax._
import org.junit.Assert._
class HListTest {
@Test
def testHList: Unit = {
val l1 = 42 :: "foo" :: Some(1.0) :: "bar" :: HNil
val l1a = l1.head
val l1b = l1.tail.head
val l1c = l... | kwark/slick | slick-testkit/src/test/scala/slick/test/collection/heterogenous/HListTest.scala | Scala | bsd-2-clause | 1,254 |
package com.maxmind.gatling.gen
import io.gatling.core.feeder.Feeder
import org.scalacheck.{Arbitrary, Gen, Prop}
import scalaz.Scalaz._
import scalaz._
import com.maxmind.gatling.rng.FakeRandom
import com.maxmind.gatling.test.{BaseSpec, SampleSize}
class ThirdPartySpec extends BaseSpec {
"Specs2, ScalaCheck, and... | maxmind/gatling-gen | src/test/scala/com/maxmind/gatling/gen/ThirdPartySpec.scala | Scala | apache-2.0 | 2,825 |
/*
* 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 ... | SRGOM/scalatest | project/GenLoneElement.scala | Scala | apache-2.0 | 3,841 |
/*
* Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | wesley1001/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/EtlPipeline.scala | Scala | apache-2.0 | 2,948 |
package com.kostassoid.serializers
import scala.pickling.Defaults._
import scala.pickling.json._
import scala.reflect.ClassTag
class PicklingSerializer extends CanSerialize {
override def write[T <: AnyRef : ClassTag](obj: T): String = {
obj.asInstanceOf[Any].pickle.value
}
override def read[T <: AnyRef :... | Kostassoid/scala-serializers-sandbox | src/main/scala/com/kostassoid/serializers/PicklingSerializer.scala | Scala | apache-2.0 | 456 |
/*
* Copyright (C) 2015 Stratio (http://stratio.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 app... | danielcsant/sparta | serving-core/src/main/scala/com/stratio/sparta/serving/core/models/StreamingContextStatus.scala | Scala | apache-2.0 | 856 |
package hmm
// Taken from https://github.com/typelevel/kind-projector/blob/7ad46d6ca995976ae2ff18215dbb32cd7ad0dd7a/src/test/scala/hmm.scala
// As a regression test for the issue spotted in https://github.com/scala/community-build/pull/1400
class TC[A]
object TC {
def apply[A]: Unit = ()
}
object test {
sealed... | scala/scala | test/files/pos/t12312-hmm.scala | Scala | apache-2.0 | 1,964 |
package com.github.diegopacheco.sandbox.scala.akka.mailboxes
import akka.actor.Actor
import akka.dispatch.RequiresMessageQueue
import akka.dispatch.BoundedMessageQueueSemantics
import akka.actor.ActorSystem
import akka.actor.Props
/**
UnboundedMailbox - The default mailbox
Backed by a java.util.concurrent.Con... | diegopacheco/scala-playground | scala_11_akka_23_full_playground/src/main/scala/com/github/diegopacheco/sandbox/scala/akka/mailboxes/ActorMailBoxMainApp.scala | Scala | unlicense | 1,707 |
package com.creatifcubed.clavier;
import scala.math;
import scala.util.Random;
import scala.math.BigInt;
import java.math.BigInteger;
object Scalability {
/*
* - mapHashToId is an (attempt at an efficent) implementation of a deterministic mapping with versions
* (e.g. number of nodes increase, mod old user ids... | Raekye/The-Modern-Clavier | scala/src/main/scala/com/creatifcubed/clavier/Scalability.scala | Scala | mit | 3,709 |
package controllers
import play.api.mvc._
class Application extends Controller {
// def index = Action {
// Ok(views.html.main())
// }
//
// def home = Action {
// Ok(views.html.home())
// }
}
| elarib/cvManager | app/controllers/Application.scala | Scala | mit | 221 |
package dtos.report.row
import scala.beans.BeanProperty
/**
* Created by dungvn3000 on 9/11/2014.
*/
class ChungTuLuongRow {
@BeanProperty var stt: String = null
@BeanProperty var danhMuc: String = null
@BeanProperty var donVi: String = null
var khoiLuong: Double = _
var donGia: Double = _
var khongThuo... | SunriseSoftVN/sunerp | app/dtos/report/row/ChungTuLuongRow.scala | Scala | apache-2.0 | 599 |
/*
* Exponential.scala
* Elements representing exponential distributions.
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: Feb 25, 2011
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http:... | bruttenberg/figaro | Figaro/src/main/scala/com/cra/figaro/library/atomic/continuous/Exponential.scala | Scala | bsd-3-clause | 2,051 |
/*
* Copyright (c) 2013 Lars Hupel
*
* 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 ... | non/shapeless | core/src/main/scala/shapeless/typeclass.scala | Scala | apache-2.0 | 1,927 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/delegation/BatchPlanner.scala | Scala | apache-2.0 | 6,508 |
package colossus
package protocols.http
import akka.util.ByteString
case class HttpRequest(head: HttpHead, entity: Option[ByteString]) {
import head._
import HttpCodes._
def respond(code: HttpCode, data: String, headers: List[(String, String)] = Nil) = {
import HttpResponseHeader.Conversions._
HttpResp... | noikiy/colossus | colossus/src/main/scala/colossus/protocols/http/HttpRequest.scala | Scala | apache-2.0 | 1,825 |
package spark.scheduler.cluster
import java.lang.{Boolean => JBoolean}
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.HashMap
import scala.collection.mutable.HashSet
import spark._
import spark.TaskState.TaskState
import spark.scheduler._
import java.nio.ByteBuffer
import java.util.concu... | baeeq/incubator-spark | core/src/main/scala/spark/scheduler/cluster/ClusterScheduler.scala | Scala | bsd-3-clause | 24,277 |
/*
* Copyright 2010-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | lift/lift | framework/lift-base/lift-webkit/src/test/scala/net/liftweb/http/js/JsExpSpec.scala | Scala | apache-2.0 | 1,120 |
package picasso.frontend.compilerPlugin
object Annotations {
class Predicate extends StaticAnnotation
}
| dzufferey/picasso | frontend/compilerPlugin/src/main/scala/picasso/frontend/compilerPlugin/Annotations.scala | Scala | bsd-2-clause | 109 |
/*
* 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 not u... | tophua/spark1.52 | sql/core/src/main/scala/org/apache/spark/sql/DataFrameHolder.scala | Scala | apache-2.0 | 1,392 |
package pl.msitko.xml.printing
import pl.msitko.xml.entities.{Attribute, Element, LabeledElement, NamespaceDeclaration}
import pl.msitko.xml.printing.Syntax._
private [printing] trait ElementWriter extends Resolver {
def writeElement[M : InternalMonoid](element: LabeledElement, level: Int)(writer: M): M
def writ... | note/xml-lens | io/shared/src/main/scala/pl/msitko/xml/printing/ElementWriter.scala | Scala | mit | 3,328 |
/*
* 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 ... | ueshin/apache-spark | sql/core/src/test/scala/org/apache/spark/sql/execution/GroupedIteratorSuite.scala | Scala | apache-2.0 | 3,147 |
package org.http4s
import cats.{Applicative, Functor}
import cats.data.EitherT
import cats.implicits._
object DecodeResult {
def apply[F[_], A](fa: F[Either[DecodeFailure, A]]): DecodeResult[F, A] =
EitherT(fa)
def success[F[_], A](fa: F[A])(implicit F: Functor[F]): DecodeResult[F, A] =
EitherT(fa.map(Ri... | ChristopherDavenport/http4s | core/src/main/scala/org/http4s/DecodeResult.scala | Scala | apache-2.0 | 683 |
package pl.pholda.malpompaaligxilo.dsl.parser
import pl.pholda.malpompaaligxilo.Context
import pl.pholda.malpompaaligxilo.dsl._
import pl.pholda.malpompaaligxilo.dsl.form.DslFormSpecification
import pl.pholda.malpompaaligxilo.dsl.parser.expr.{FormSpecStdTokenParsers, FormExprParser}
import pl.pholda.malpompaaligxilo.f... | pholda/MalpompaAligxilo | dsl/shared/src/main/scala/pl/pholda/malpompaaligxilo/dsl/parser/FormSpecificationParser.scala | Scala | gpl-3.0 | 2,242 |
/*
* 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 ... | PredictionIO/PredictionIO | core/src/main/scala/org/apache/predictionio/controller/EngineParams.scala | Scala | apache-2.0 | 5,391 |
package com.mesosphere.cosmos.rpc.v2.model
import com.mesosphere.universe
import io.circe.JsonObject
case class DescribeResponse(
packagingVersion: universe.v3.model.PackagingVersion,
name: String,
version: universe.v3.model.PackageDefinition.Version,
maintainer: String,
description: String,
tags: List[un... | movicha/cosmos | cosmos-model/src/main/scala/com/mesosphere/cosmos/rpc/v2/model/DescribeResponse.scala | Scala | apache-2.0 | 960 |
package mesosphere.marathon.upgrade
import akka.event.EventStream
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.marathon.state.PathId
import mesosphere.marathon.tasks.TaskTracker
import org.apache.mesos.Protos.TaskID
import org.apache.mesos.SchedulerDriver
import scala.collection.mutable
import sca... | tnachen/marathon | src/main/scala/mesosphere/marathon/upgrade/TaskKillActor.scala | Scala | apache-2.0 | 880 |
/**
* @author Petri Kivikangas
* @date 6.2.2012
*
*/
package cdl.parser.test
import scala.io.Source
import org.junit.runner.RunWith
import org.scalatest.FunSpec
import org.scalatest.junit.JUnitRunner
import cdl.parser.CDLParser
import cdl.objects.Attribute
import cdl.objects.Constraint
import cdl.objects.UW
@RunW... | Valafar/cdl-parser | src/test/scala/cdl/parser/test/ConceptParsingTest.scala | Scala | gpl-3.0 | 6,820 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/DamageReductionColdIron.scala | Scala | apache-2.0 | 1,634 |
package com.github.gigurra.glasciia.impl
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.files.FileHandle
import com.badlogic.gdx.graphics.{Cursor, Pixmap}
import com.github.gigurra.glasciia.Glasciia._
import com.github.gigurra.math.Vec2
/**
* Created by johan on 2016-10-08.
*/
trait CursorCreation... | GiGurra/glasciia | glasciia-core/src/main/scala/com/github/gigurra/glasciia/impl/CursorCreation.scala | Scala | mit | 779 |
/**
* Angles
* Copyright (C) 2014 Sebastian Schelter
*
* 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.
*
* Thi... | nwolber/angles | src/main/scala/io/ssc/angles/pipeline/ExtractStatusData.scala | Scala | gpl-3.0 | 1,182 |
/*
* Copyright 2016 Oleg Morozenkov
*
* 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... | reo7sp/Face3dMatch | src/main/scala/ru/reo7sp/f3m/math/geometry/Rect.scala | Scala | apache-2.0 | 1,437 |
/*******************************************************************************/
/* */
/* Copyright (C) 2017 by Max Lv <max.c.lv@gmail.com> */
/* Copyright (C) 2017 by Mygod Studio <contact-shadowsocks-android@mygod.... | hangim/shadowsocks-android | mobile/src/main/scala/com/github/shadowsocks/utils/Utils.scala | Scala | gpl-3.0 | 6,483 |
// scalac: -Yno-predef
import scala.Predef.implicitly
class A(val a: Int)
class B(implicit F: Int) extends A( implicitly[Int] )
class C(implicit F: Int) extends A( {
val v = implicitly[Int]
v
})
class A1(val a: Int)(implicit val F: Int)
class B1(implicit F: Int) extends A1(implicitly[Int])
class C1(implicit F: ... | lrytz/scala | test/files/pos/t9717.scala | Scala | apache-2.0 | 600 |
package scala.slick.jdbc
import scala.slick.SlickException
trait MutatingInvoker[-P,R] extends Invoker[P,R] { self =>
/**
* Transform a query's results with an updatable result set.
*/
def mutate(param: P, f: ResultSetMutator[R] => Unit, end: ResultSetMutator[R] => Unit)(implicit session: JdbcBackend#Sessio... | boldradius/slick | src/main/scala/scala/slick/jdbc/MutatingInvoker.scala | Scala | bsd-2-clause | 3,362 |
package io.github.mandar2812.dynaml.examples
import java.io.File
import breeze.linalg.{DenseMatrix, DenseVector}
import com.github.tototoshi.csv.CSVWriter
import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}
import io.github.mandar2812... | Koldh/DynaML | src/main/scala/io/github/mandar2812/dynaml/examples/TestForestCover.scala | Scala | apache-2.0 | 2,948 |
/** Copyright 2015 TappingStone, 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 ... | ydanilenko/PredictionIO | tools/src/main/scala/io/prediction/tools/console/App.scala | Scala | apache-2.0 | 16,987 |
/*
Copyright 2012 Anton Kraievoy akraievoy@gmail.com
This file is part of Holonet.
Holonet 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 vers... | akraievoy/holonet | src/main/scala/org/akraievoy/holonet/exp/store/StoreLens.scala | Scala | gpl-3.0 | 3,888 |
/*
* 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 ... | ebruchez/darius-xml.js | xerces/shared/src/main/scala/org/orbeon/apache/xerces/xni/parser/XMLPullParserConfiguration.scala | Scala | apache-2.0 | 2,964 |
/*
* 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-log-cassandra/src/main/scala/com/rbmhtechnology/eventuate/log/cassandra/CassandraIndex.scala | Scala | apache-2.0 | 5,133 |
package scalanlp.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... | MLnick/scalanlp-core | learn/src/main/scala/scalanlp/stats/distributions/Polya.scala | Scala | apache-2.0 | 2,650 |
/*
* 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 ... | gioenn/xSpark | mllib/src/test/scala/org/apache/spark/ml/feature/Word2VecSuite.scala | Scala | apache-2.0 | 8,061 |
/*
* Copyright (c) 2014-2015 by its authors. Some rights reserved.
* See the project homepage at: http://www.monifu.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://... | virtualirfan/monifu | monifu/shared/src/main/scala/monifu/reactive/internals/operators/drop.scala | Scala | apache-2.0 | 4,967 |
/*
Copyright 2016-17, Hasso-Plattner-Institut fuer Softwaresystemtechnik GmbH
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... | bpn1/ingestion | src/main/scala/de/hpi/ingestion/graphframes/GraphExtractor.scala | Scala | apache-2.0 | 3,642 |
package org.killbill.billing.client.actor
import java.util.UUID
import akka.actor.{Actor, ActorRef}
import akka.event.Logging
import org.killbill.billing.client.model._
import spray.client.pipelining._
import spray.http.HttpHeader
import spray.httpx.SprayJsonSupport
import scala.util.{Failure, Success}
/**
* Creat... | jgomez-vp/killbill-client-scala | src/main/scala/org/killbill/billing/client/actor/InvoiceActor.scala | Scala | apache-2.0 | 17,978 |
package io.shaka.http
object Status {
//INFORMATIONAL = set(100, 199}
case object CONTINUE extends Status {val code = 100; val description = "Continue"}
case object SWITCHING_PROTOCOLS extends Status {val code = 101; val description = "Switching Protocols"}
//SUCCESSFUL = set(200, 299}
case obje... | stacycurl/naive-http | src/main/scala/io/shaka/http/Status.scala | Scala | apache-2.0 | 5,953 |
/*
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
distr... | sengt/summingbird-batch | summingbird-builder/src/main/scala/com/twitter/summingbird/builder/package.scala | Scala | apache-2.0 | 4,377 |
package mpilquist_training
/**
* Simple Domain show-case
*/
object FirstExample {
type User = String
trait SocialService {
def getFollowerStatsByUser(u: User): FollowerStats
}
case class FollowerStats(nrFollowers: Int, nrFollowing: Int)
case class Cache(
statistics: Map[User, FollowerStats],
... | speedcom/scala-state-training | src/main/scala/mpilquist_training/FirstExample.scala | Scala | apache-2.0 | 732 |
class BipClass { }
trait BipTrait {
self: BipClass =>
private[this] def foo() = 5
def bar() = this.foo()
}
// error: value foo is not a member of BipTrait with BipClass
// def bar() = this.foo()
// ^
| AlexSikia/dotty | tests/untried/pos/t3837.scala | Scala | bsd-3-clause | 228 |
package org.workcraft.plugins.petrify
import org.workcraft.gui.services.GuiTool
import org.workcraft.gui.services.ToolClass
import org.workcraft.gui.MainWindow
import org.workcraft.scala.Expressions
import org.workcraft.scala.effects.IO
import org.workcraft.scala.effects.IO._
import org.workcraft.scala.Express... | mechkg/workcraft | PetrifyPlugin2/src/main/scala/org/workcraft/plugins/petrify/StateGraphTool.scala | Scala | gpl-3.0 | 2,446 |
/*
* This file is part of Kiama.
*
* Copyright (C) 2010-2013 Anthony M Sloane, Macquarie University.
*
* Kiama is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or ... | matachi/rangeFix | lib/kiama_2.9.2-1.4.0-sources/org/kiama/util/Console.scala | Scala | mit | 3,421 |
package models
import scala.collection.mutable.{Stack,Map}
import scala.util._
/**
* Abstract class modeling the "mill" of the calculator.
* Please note:
* <ul>
* <list>Instances of this class are stateful (stack and store) and thus should be invoked only within actors.</list>
* </list>Methods of this class thro... | rchillyard/Scalaprof | RPN/app/models/MillNumeric.scala | Scala | gpl-2.0 | 1,368 |
package example.cache
import example.models.{AuthSession, User}
import scala.concurrent.Future
import scala.language.implicitConversions
trait UserClient {
def fetchUser(implicit authInfo: AuthSession): Future[User]
}
| jeffmay/scala-context-passing | example/app/example/cache/UserClient.scala | Scala | apache-2.0 | 224 |
/*
* 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 ... | StephanEwen/incubator-flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/CodeGenUtils.scala | Scala | apache-2.0 | 37,616 |
package ml.wolfe.term.simplified
import ml.wolfe.WolfeSpec
import org.scalautils.Good
/**
* @author riedel
*/
class CaseClassTermSpecs extends WolfeSpec {
import BaseEval._
import Wolfe._
"A term macro" should {
"provide getters on terms" in {
@term case class Stack[C](store: Seq[C], strength: Seq... | wolfe-pack/wolfe | wolfe-core/src/test/scala/ml/wolfe/term/simplified/CaseClassTermSpecs.scala | Scala | apache-2.0 | 1,398 |
/**
* 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-data-tools/src/main/scala/cmwell/tools/data/utils/akka/Retry.scala | Scala | apache-2.0 | 17,166 |
import freestyle.FreestylePlugin
import org.scalajs.sbtplugin.cross.{CrossProject, CrossType}
import sbt._
import sbt.Keys._
import sbtorgpolicies.OrgPoliciesPlugin.autoImport._
import sbtorgpolicies.runnable.syntax._
import scoverage.ScoverageKeys._
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
i... | frees-io/freestyle | project/ProjectPlugin.scala | Scala | apache-2.0 | 2,919 |
/*******************************************************************************
* Copyright (c) 2019. Carl Minden
*
* 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 ... | carlminden/anathema-roguelike | src/com/anathema_roguelike/fov/VisibleLightBackgroundShader.scala | Scala | gpl-3.0 | 1,734 |
package com.eevolution.context.dictionary.infrastructure.service
import java.util.UUID
import akka.NotUsed
import com.eevolution.context.dictionary.domain._
import com.eevolution.context.dictionary.domain.model.PrintFormatItemTrl
import com.eevolution.utils.PaginatedSequence
import com.lightbend.lagom.scaladsl.api.{S... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/service/PrintFormatItemTrlService.scala | Scala | gpl-3.0 | 2,154 |
package akka.s3
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.model.HttpEntity
trait DeleteObject { self: AuthorizedContext =>
def doDeleteObject(bucketName: String, keyName: String) = {
val hl = req.listFromQueryParams
val versionId: ... | akiradeveloper/akka-s3 | src/main/scala/akka/s3/api/DeleteObject.scala | Scala | apache-2.0 | 1,014 |
/*
* Copyright 2014 Frugal Mechanic (http://frugalmechanic.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... | frugalmechanic/fm-common | jvm/src/main/scala/fm/common/TaskRunner.scala | Scala | apache-2.0 | 3,472 |
type A2B = String => Int
val y: A2B = Integer./*resolved: true*/parseInt _ | ilinum/intellij-scala | testdata/resolve2/bug3/SCL3982.scala | Scala | apache-2.0 | 75 |
/*
* Bindings.scala
*/
package see
/** A Resolver enables See to perform some kind of I/O.
* It is a pure trait to allow subclassing from Java as regular interface.
*
* A user may provide a custom implementation for this interface and
* set it as parent of a See context. Any variable name thst cannot be re... | acruise/see | src/main/scala/see/Bindings.scala | Scala | bsd-3-clause | 3,790 |
package com.rikmuld.camping.common.inventory
import com.rikmuld.corerm.gui.slots.SlotOnly
import net.minecraft.inventory.{IInventory, Slot}
import net.minecraft.item.Item
class SlotItem(inv: IInventory, index: Int, x: Int, y: Int, item: Item) extends Slot(inv, index, x, y) with SlotOnly {
override def getAllowedIte... | Rikmuld/MC-Camping | scala/com/rikmuld/camping/common/inventory/SlotItem.scala | Scala | gpl-3.0 | 357 |
object HelloWorld { // declaring singleton object
// main function (scala is based off the JVM afterall
// accept arguments as an Array of strings
// A method with return type Unit is analogous to a
// Java method which is declared void
// http://www.scala-lang.org/api/current/scala/Unit.html
val x = "Hello... | code-for-coffee/learning-scala | wk1/HelloWorld.scala | Scala | mit | 387 |
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.