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 org.scalajs.testsuite.javalib.time.chrono
import java.time.LocalDate
import org.scalajs.jasminetest.JasmineTest
import org.scalajs.testsuite.utils.ExpectExceptions
import java.time.chrono.ChronoPeriod
object ChronoPeriodTest extends JasmineTest with ExpectExceptions {
describe("java.time.chrono.ChronoPerio... | jasonchaffee/scala-js | test-suite/js/src/test/require-jdk8/org/scalajs/testsuite/javalib/time/chrono/ChronoPeriodTest.scala | Scala | bsd-3-clause | 590 |
package dao
import com.novus.salat.dao.SalatDAO
import se.radley.plugin.salat._
import model.{SortMode, Article}
import play.api.Play.current
import org.bson.types.ObjectId
import com.mongodb.casbah.commons.MongoDBObject
import org.joda.time.DateTime
/**
* The Class ArticleDao.
*
* @author Nguyen Duc Dung
* @sinc... | SunriseSoftVN/hayhayblog | core/app/dao/ArticleDao.scala | Scala | gpl-2.0 | 4,303 |
package api.hue.dao.attribute
import play.api.libs.json._
/**
* Represents on/off state
*
* @author ddexter
*/
case class On(on: Boolean) extends Attribute {
import On._
override def name:String = NAME
override def toJs: JsObject = Json.obj("on" -> on)
}
object On {
val NAME: String = "on"
implici... | ddexter/HomeBackend | src/main/scala/api/hue/dao/attribute/On.scala | Scala | apache-2.0 | 384 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | patrick-nicholson/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala | Scala | apache-2.0 | 56,145 |
package org.jetbrains.plugins.scala.failed.types.existentialSimplification
import org.jetbrains.plugins.scala.PerfCycleTests
import org.jetbrains.plugins.scala.lang.types.existentialSimplification.ExistentialSimplificationTestBase
import org.junit.experimental.categories.Category
@Category(Array(classOf[PerfCycleTest... | whorbowicz/intellij-scala | test/org/jetbrains/plugins/scala/failed/types/existentialSimplification/ExistentialSimplificationAllRulesTest.scala | Scala | apache-2.0 | 514 |
/*
* 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 ... | hhbyyh/spark | mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala | Scala | apache-2.0 | 25,758 |
package io.buoyant.linkerd.clientTls
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle.{Path, ServiceFactory, Stack, Stackable}
import com.twitter.finagle.buoyant.TlsClientPrep
import com.twitter.finagle.client.AddrMetadataExtraction.AddrMetadata
import com.twitter.finagle.ssl.Engine
import... | hhtpcd/linkerd | linkerd/tls/src/main/scala/io/buoyant/linkerd/clientTls/BoundPathInitializer.scala | Scala | apache-2.0 | 2,868 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | yiheng/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/UpSampling1DSpec.scala | Scala | apache-2.0 | 1,071 |
package com.basrikahveci
package cardgame.messaging.response
import cardgame.messaging.Response
class InviteUserResponse(val success: Boolean, val reason: Int) extends Response
| metanet/cardgame-server-scala | src/main/scala/com/basrikahveci/cardgame/messaging/response/InviteUserResponse.scala | Scala | mit | 179 |
package org.talg
import org.talg.home.entities.{Person, Address}
import com.mongodb.casbah.Imports._
/**
* User: talg
*/
package object home {
def ADDRESS = Address(
street = "Lombard",
zipCode = 12345,
city = "San Francisco",
country = "United States"
)
def PERSON = Person(
_id = new Obj... | talgendler/casbah | src/test/scala/org/talg/home/package.scala | Scala | mit | 484 |
package com.github.nethad.clustermeister.integration.sc06
import akka.dispatch.Await
import java.lang.reflect.InvocationHandler
import java.lang.reflect.Proxy
import java.lang.reflect.Method
import akka.actor.ActorRef
import akka.util.Timeout
import akka.util.Duration
import akka.util.duration._
import java.util.concu... | nethad/clustermeister | integration-tests/src/main/scala/com/github/nethad/clustermeister/integration/sc06/AkkaProxy.scala | Scala | apache-2.0 | 2,721 |
package com.jwd.scala.sample.concurrency
import akka.actor.Actor
import akka.actor.ActorSystem
import akka.actor.Props
import akka.actor.ActorLogging
case class Greeting(who: String)
class GreetingActor extends Actor with ActorLogging {
def receive = {
case Greeting(who) => log.info("Hello " + who)
case val... | williamjwd/learn-scala | learn-scala-sample/src/main/scala/com/jwd/scala/sample/concurrency/AkkaSample.scala | Scala | apache-2.0 | 739 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | trueyao/spark-lever | mllib/src/main/scala/org/apache/spark/ml/feature/Tokenizer.scala | Scala | apache-2.0 | 1,649 |
package test
import scala.language.higherKinds
trait Functor[F[_]] {
def map[A, B](f: A => B, fa: F[A]): F[B]
}
object Functor {
implicit def function[A]: Functor[({ type l[B] = A => B })#l] =
new Functor[({ type l[B] = A => B })#l] {
def map[C, B](cb: C => B, ac: A => C): A => B = cb compose ac
}
... | som-snytt/dotty | tests/pos/t2712-5.scala | Scala | apache-2.0 | 587 |
package org.jetbrains.plugins.scala
package annotator.quickfix
import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.openapi.project.Project
import com.intellij.openapi.editor.Editor
import com.intellij.psi.PsiFile
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression
import org.jet... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/annotator/quickfix/WrapInOptionQuickFix.scala | Scala | apache-2.0 | 2,018 |
package cats.scalatest
import org.scalatest.exceptions.{ TestFailedException, StackDepthException }
import cats.data.Validated
import Validated.{ Valid, Invalid }
import org.scalactic.source
trait ValidatedValues {
import scala.language.implicitConversions
/**
* Implicit conversion that adds a `value` method... | coltfred/cats-scalatest | src/main/scala/cats/scalatest/ValidatedValues.scala | Scala | apache-2.0 | 2,566 |
package se.gigurra.renderer
import scalaxy.streams.optimize
class TextModel(val text: String, vertices: Array[Float], colors: Array[Float], font: Font)
extends Model(PrimitiveType.TRIANGLES, vertices, colors) {
val width = (text map font.get).foldLeft(0.0f)(_ + _.advanceWidth)
override def toString(): String ... | GiGurra/gigurra-scala-2drenderer | src/main/scala/se/gigurra/renderer/TextModel.scala | Scala | mit | 1,585 |
/***********************************************************************
* 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-features/geomesa-feature-kryo/src/main/scala/org/locationtech/geomesa/features/kryo/impl/KryoFeatureSerialization.scala | Scala | apache-2.0 | 7,444 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package base
package types
import org.jetbrains.plugins.scala.extensions.ObjectExt
/**
* @author Alexander Podkhalyuzin
* Date: 13.03.2008
*/
trait ScParenthesisedTypeElement extends ScTypeElement with ScParenthesizedElement {
override prote... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/api/base/types/ScParenthesisedTypeElement.scala | Scala | apache-2.0 | 695 |
/*
* 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 ... | hortonworks-spark/cloud-integration | cloud-examples/src/test/scala/com/cloudera/spark/cloud/adl/AdlBasicIOSuite.scala | Scala | apache-2.0 | 1,077 |
package json.schema.codegen
import java.io.File
import java.net.URI
import json.schema.parser.SchemaDocument
import scala.util.control.NonFatal
import scalaz.Scalaz._
trait Naming {
implicit class StringToolsO(v: Option[String]) {
def noneIfEmpty: Option[String] =
v match {
case Some(s) if s == ... | VoxSupplyChain/json-schema-codegen | codegen/src/main/scala/json/schema/codegen/Naming.scala | Scala | apache-2.0 | 3,074 |
package controllers.images
import javax.inject._
import com.mohiva.play.silhouette.api.Silhouette
import controllers.WebJarAssets
import controllers.images.FormsData._
import controllers.blog.FormsData.categoryForm
import models.goods.Category
import models.images.{ Image, ImageCategoriesDAO, ImageInfo, ImagesDAO }
i... | stanikol/walnuts | server/app/controllers/images/ImagesAdmin.scala | Scala | apache-2.0 | 6,729 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/amls-frontend | app/controllers/businessactivities/WhoIsYourAccountantIsUkController.scala | Scala | apache-2.0 | 3,782 |
package achilles
/**
* Created by panda on 3/24/15.
*/
import breeze.linalg._
trait Message
case class DocTopicDist(docTopic: SparseVector[Double]) extends Message
case class TermTopicDist(termTopic: SparseVector[Double]) extends Message
case class UpdateDocTopic(from: Long, to: Long, timestamp: Long) extends M... | yinxusen/achilles | src/main/scala/achilles/Message.scala | Scala | apache-2.0 | 789 |
/*
* Copyright 2014โ2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/Quasar | mongodb/src/main/scala/quasar/physical/mongodb/planner/mapBeforeSort.scala | Scala | apache-2.0 | 2,277 |
package scalajsreact.template.routes
import japgolly.scalajs.react.ReactElement
import japgolly.scalajs.react.extra.router.RouterConfigDsl
import scalajsreact.template.components.items.{ItemsInfo, Item1Data, Item2Data}
import scalajsreact.template.pages.ItemsPage
sealed abstract class Item(val title: String,
val rou... | christobill/scalajs-react-template | src/main/scala/scalajsreact/template/routes/Item.scala | Scala | apache-2.0 | 842 |
/*
* 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 ... | frankfzw/varys | core/src/main/scala/varys/ui/JettyUtils.scala | Scala | apache-2.0 | 5,168 |
/*
* Copyright 2014โ2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | slamdata/slamengine | qsu/src/main/scala/quasar/qsu/QSUGraph.scala | Scala | apache-2.0 | 22,315 |
/*
* Copyright ยฉ 2014 TU Berlin (emma@dima.tu-berlin.de)
*
* 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... | emmalanguage/emma | emma-lib/src/main/scala/org/emmalanguage/lib/linalg/BLAS.scala | Scala | apache-2.0 | 22,062 |
/*
* 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... | pncampbell/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC7110A.scala | Scala | apache-2.0 | 1,440 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | Wogan/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/DropByTimespanSuite.scala | Scala | apache-2.0 | 2,030 |
/*
* 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 ... | mike0sv/spark | core/src/main/scala/org/apache/spark/rdd/CoalescedRDD.scala | Scala | apache-2.0 | 16,974 |
package org.apache.spot.utilities.data.validation
import org.apache.spark.sql.types.{DataType, StructType}
import scala.collection.mutable.ListBuffer
/**
* Input schema routines
*/
object InputSchema {
/**
* Validate the incoming data schema matches the schema required for model creation and scoring.
... | brandon-edwards/incubator-spot | spot-ml/src/main/scala/org/apache/spot/utilities/data/validation/InputSchema.scala | Scala | apache-2.0 | 1,832 |
package provingground.library
import provingground._
import HoTT._
import induction._
import implicits._
import shapeless._
import Fold._
object iffInd {
lazy val value = Subst.Lambda(
"$abel" :: Prop,
Subst.Lambda(
"$abem" :: Prop,
ConstructorSeqTL(
ConstructorSeqDom.Cons(
Appln... | siddhartha-gadgil/ProvingGround | leanlib/src/main/scala/provingground/library/inductive-types/iffInd.scala | Scala | mit | 1,478 |
package com.twitter.finagle.service
import RetryPolicy._
import com.twitter.conversions.time._
import com.twitter.finagle.{ChannelClosedException, Failure, TimeoutException, WriteException}
import com.twitter.util._
import org.junit.runner.RunWith
import org.scalatest.FunSpec
import org.scalatest.junit.JUnitRunner
@R... | kristofa/finagle | finagle-core/src/test/scala/com/twitter/finagle/service/RetryPolicyTest.scala | Scala | apache-2.0 | 5,395 |
package org.jetbrains.plugins.scala.lang
package transformation
package annotations
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.extensions.{&&, Parent}
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScFunctionExpr
import org.jetbrains.plugins.scala.lang.psi.api.statements.params.{ScPara... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/transformation/annotations/AddTypeToFunctionParameter.scala | Scala | apache-2.0 | 1,140 |
package me.yingrui.segment.neural
import me.yingrui.segment.math.Matrix
object SoftmaxLayer {
class BPSoftmaxLayer(var weight: Matrix, var bias: Matrix, val immutable: Boolean) extends BPLayer {
def layer = new SingleLayer(weight, Softmax(), bias, false)
def size = layer.size
def calculateDelta(actu... | yingrui/mahjong | lib-segment/src/main/scala/me/yingrui/segment/neural/SoftmaxLayer.scala | Scala | gpl-3.0 | 587 |
/*
* Copyright 2013 - 2015, Daniel Krzywicki <daniel.krzywicki@agh.edu.pl>
*
* 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
... | ros3n/IntOb | core/src/main/scala/pl/edu/agh/scalamas/random/ConcurrentRandomGeneratorComponent.scala | Scala | mit | 2,187 |
package services.crunch
import controllers.ArrivalGenerator
import drt.shared.FlightsApi.Flights
import drt.shared.PaxTypesAndQueues._
import drt.shared.SplitRatiosNs.{SplitRatio, SplitRatios, SplitSources}
import drt.shared.Terminals.T1
import drt.shared._
import server.feeds.ArrivalsFeedSuccess
import services.{Opti... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/test/scala/services/crunch/CrunchEgateBanksSpec.scala | Scala | apache-2.0 | 2,473 |
package chessagents
import akka.actor.Actor
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.Props
import swing._
import event._
import Swing._
import swing.Publisher
import swing.BorderPanel.Position._
import swing.event.Event
import swing.Swing.onEDT
import javax.swing.ImageIcon;
import j... | m-kostrzewa/ChessAgents | src/chessagents/GuiActor.scala | Scala | mit | 6,403 |
package org.retistruen
import java.math.BigInteger
/** Type-class for things that can be read from String */
abstract class ReadableFromString[T] {
def read(s: String): T
}
/** Basic [[org.retistruen.ReadableFromString]] implementations */
object ReadableFromString {
implicit val DoubleIsReadableFromString = new... | plalloni/retistruen | src/main/scala/org/retistruen/OpenSource.scala | Scala | mit | 913 |
package com.codebook.akka
import akka.event.NoLogging
import akka.http.scaladsl.model.ContentTypes._
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.testkit.ScalatestRouteTest
import akka.util.Timeout
import com.codebook.akka.model.User
import org.scalatest.{Matchers, WordSpec}
import scala.co... | flopezlasanta/akka-services | src/test/scala/com/codebook/akka/ServicesSpec.scala | Scala | mit | 1,019 |
package im.actor.server.api.rpc.service
import im.actor.api.rpc._
import im.actor.api.rpc.counters.UpdateCountersChanged
import im.actor.api.rpc.groups._
import im.actor.api.rpc.messaging._
import im.actor.api.rpc.misc.ResponseSeqDate
import im.actor.api.rpc.peers.{ ApiPeer, ApiOutPeer, ApiPeerType, ApiUserOutPeer }
i... | ljshj/actor-platform | actor-server/actor-tests/src/test/scala/im/actor/server/api/rpc/service/GroupsServiceSpec.scala | Scala | mit | 41,633 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js tools **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2014, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | colinrgodsey/scala-js | tools/shared/src/main/scala/org/scalajs/core/tools/classpath/builder/AbstractJarLibClasspathBuilder.scala | Scala | bsd-3-clause | 1,934 |
/*
* 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 ma... | harperjiang/enc-selector | src/main/scala/edu/uchicago/cs/encsel/dataset/feature/Sortness.scala | Scala | apache-2.0 | 4,692 |
package controllers
import java.io.File
import java.net.URLDecoder
import java.util.UUID
import akka.actor._
import akka.pattern.ask
import akka.util.Timeout
import notebook.NBSerializer.Metadata
import notebook._
import notebook.server._
import play.api.Play.current
import play.api._
import play.api.http.HeaderNames... | shankar-reddy/spark-notebook | app/controllers/Application.scala | Scala | apache-2.0 | 20,860 |
package com.twitter.scalding
import cascading.flow.{ FlowDef, FlowProcess }
import cascading.stats.CascadingStats
import java.util.{ Collections, WeakHashMap }
import org.slf4j.{ Logger, LoggerFactory }
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import scala.collection.mutable
i... | wanyifu/scaldingtest | scalding-core/src/main/scala/com/twitter/scalding/Stats.scala | Scala | apache-2.0 | 5,122 |
/**
* Copyright (C) 2010 Orbeon, Inc.
*
* This program 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
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | orbeon/orbeon-forms | xforms/jvm/src/test/scala/org/orbeon/oxf/xforms/ClientEventsTest.scala | Scala | lgpl-2.1 | 2,540 |
/**
* Created on: Mar 2, 2013
*/
package com.tubros.constraints.core.spi.solver.heuristic
import scala.language.{
higherKinds,
postfixOps
}
import scalaz._
import com.tubros.constraints.api.solver._
/**
* The '''EstimatedSearchSpace''' type is a heuristic for approximating how
* large an exhaustive search of... | osxhacker/smocs | smocs-core/src/main/scala/com/tubros/constraints/core/spi/solver/heuristic/EstimatedSearchSpace.scala | Scala | bsd-3-clause | 1,028 |
/**
* Created by Variant on 16/4/8.
*/
object ListBuffer_Internals {
def main(args: Array[String]) {
val list =List(1,2,3,4,5,6,7,8,9)
increment(list,1)
increment_MoreEffective(list,2)
increment_MostEffective(list,3)
}
/**
* ไผๅๅปบๅพๅคๆฐ็Listๅ ๆ ,็พไธๆฐๆฎๅๅ้ๆ็
*
* @param list
* @param i
... | sparkLiwei/ProgrammingNote | scalaLearning/scalaInSpark/ListBuffer_Internals.scala | Scala | cc0-1.0 | 1,052 |
sealed trait List[+A]
case object Nil extends List[Nothing]
case class Cons[+A](head: A, tail: List[A]) extends List[A]
object List {
def apply[A](as: A*): List[A] = {
if(as.isEmpty) Nil
else Cons(as.head, apply(as.tail: _*))
}
def tail[A](items: List[A]): List[A] = ???
def setHead[A](items: List[A], n: A)... | wkimeria/fp_scala_for_mortals | chapter_3/exercises/exercise_16.scala | Scala | mit | 1,353 |
package qidong.runtime
import org.scalatest.FunSuite
import scalaz.{ \/-, -\/ }
import scalaz.Scalaz._
import scalaz.concurrent.Task
class StateUpdateTest extends FunSuite {
import qidong.pipeline.{ MCompleted, MFailNode, MSuccNode ,MRecoveredByErrorHandlerNode}
import qidong.pipeline.ops._
val m0 = ((i: Int) ... | chenharryhua/qidong | src/test/scala/qidong/runtime/StateUpdateTest.scala | Scala | apache-2.0 | 3,136 |
/*
* 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/Versioned.scala | Scala | apache-2.0 | 12,395 |
import org.apache.spark.sql.SparkSession
object Spark {
val spark = SparkSession
.builder()
.appName("BDD Example")
.master("local[8]")
.config("spark.sql.shuffle.partitions", "8")
.config("spark.default.parallelism", "8")
.config("spark.sql.shuffle.partitions", "8")
.getOrCreate()
}
| DanteLore/bdd-spark | src/main/scala/Spark.scala | Scala | mit | 316 |
/*
* 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-jmx/src/main/scala/wvlet/airframe/jmx/MBeanParameter.scala | Scala | apache-2.0 | 1,336 |
/*
* Copyright 2011-2020 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/framework | persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/BsonRecord.scala | Scala | apache-2.0 | 7,825 |
/*
* 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 ... | rabbah/openwhisk | core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala | Scala | apache-2.0 | 43,785 |
/* sbt -- Simple Build Tool
* Copyright 2009 Mark Harrah
*/
package xsbt
package datatype
import java.io.File
import sbt.IO.readLines
import Function.tupled
import java.util.regex.Pattern
class DatatypeParser extends NotNull
{
val WhitespacePattern = Pattern compile """\\s*"""//(?>\\#(.*))?"""
val EnumPattern = ... | harrah/xsbt | util/datatype/src/main/scala/xsbt/datatype/DatatypeParser.scala | Scala | bsd-3-clause | 3,479 |
/*
* Copyright (c) 2019. Yuriy Stul
*/
package com.stulsoft.kafka.admin
import java.time.Duration
import java.util.Properties
import com.typesafe.scalalogging.LazyLogging
import org.apache.kafka.clients.consumer.KafkaConsumer
/**
* @author Yuriy Stul
*/
class AdminConsumer(val servers: String) extends LazyLog... | ysden123/poc | pkafka/kafka-admin/src/main/scala/com/stulsoft/kafka/admin/AdminConsumer.scala | Scala | mit | 1,149 |
package org.jetbrains.plugins.scala
package lang.psi.light.scala
import com.intellij.psi.impl.light.LightElement
import com.intellij.psi.{PsiAnnotation, PsiElement}
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement
import org.jetbrains.plugins.scala.lang.psi.api.base.ScModifierList
import org.jetbrains.plugi... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/light/scala/ScLightTypeAliasDefinition.scala | Scala | apache-2.0 | 3,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 ... | shuangshuangwang/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala | Scala | apache-2.0 | 170,405 |
package org.brandonhaynes.schimmy
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.io.Writable
import org.apache.hadoop.mapreduce
import org.apache.hadoop.mapreduce.InputFormat
import org.brandonhaynes.support.ComposablePartitionedIterativeJob
/** Base class for a Schimmy-enabled map/reduce job (L... | BrandonHaynes/timr | src/org/brandonhaynes/schimmy/SchimmyJob.scala | Scala | mit | 2,793 |
package example
import domala._
import example.util.prettyPrint
object ExampleApp extends App {
implicit val config: jdbc.Config = ExampleConfig
val dao: PersonDao = PersonDao.impl
def myPrint(title: String, x: Any): Unit = println(s"[$title]: ${prettyPrint(x)}")
Required {
dao.create()
myPrint("i... | bakenezumi/domala | example/src/main/scala/example/ExampleApp.scala | Scala | apache-2.0 | 1,327 |
import sbt.Keys.{name, _}
object Settings {
lazy val commonSettings = Seq(
organization := "org.gscopelliti",
scalaVersion := "2.11.9"
)
lazy val apiGatewaySettings = Seq(
name := "Api Gateway",
version := "1.0",
javacOptions ++= Seq("-source", "1.8", "-target", "1.8"), //, "-Xmx2G"),
s... | PScopelliti/ProjectTracker | project/Settings.scala | Scala | apache-2.0 | 603 |
package com.github.gigurra.glasciia
import com.badlogic.gdx.files.FileHandle
import com.badlogic.gdx.graphics.g2d.TextureRegion
import com.badlogic.gdx.graphics.{Pixmap, Texture}
object StaticImage {
def fromFile(fileHandle: FileHandle,
useMipMaps: Boolean = true,
minFilter: Texture.T... | GiGurra/glasciia | glasciia-core/src/main/scala/com/github/gigurra/glasciia/StaticImage.scala | Scala | mit | 1,014 |
package com.prediction
import akka.actor.Actor
class UpdateTrieActor extends Actor {
override def receive: Receive = {
case sentenceTokens: SentenceTokens =>
val tokens = sentenceTokens.tokens
val remainingTokens = tokens.tail
tokens.headOption
.foreach(primaryKey => {
val ... | vineetfrozeninferno/ActorBasedWordPrediction | app/com/prediction/UpdateTrieActor.scala | Scala | gpl-3.0 | 627 |
/*
* 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 ... | maismail/HiBench | sparkbench/ml/src/main/scala/com/intel/sparkbench/ml/SVMWithSGDExample.scala | Scala | apache-2.0 | 3,293 |
/*
* 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 ... | kimoonkim/spark | resource-managers/kubernetes/integration-tests-spark-jobs/src/main/scala/org/apache/spark/deploy/kubernetes/integrationtest/jobs/FileExistenceTest.scala | Scala | apache-2.0 | 2,009 |
/*
* Copyright 2013 Akiyoshi Sugiki, University of Tsukuba
*
* 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 a... | axi-sugiki/kumoi | src/kumoi/impl/oflow/OFlowCommon.scala | Scala | apache-2.0 | 978 |
package models
import play.api.db.slick.Config.driver.simple._
case class EGAAccession(id: Option[Int], resourceType: String, accession: String, refname: String, releaseName: String, created: java.sql.Timestamp)
class EGAAccessionTable(tag: Tag) extends Table[EGAAccession](tag, "ega_accession") {
def id = column[... | seqprodbio/restoule | app/models/EGAAccession.scala | Scala | gpl-3.0 | 791 |
/**
* Copyright 2015 Peter Nerg
*
* 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... | pnerg/java-scala-util-converter | src/main/scala/javascalautils/converters/j2s/package.scala | Scala | apache-2.0 | 775 |
package org.scalaide.util.internal
/** Utility to unify how we convert settings to preference names */
object SettingConverterUtil {
val USE_PROJECT_SETTINGS_PREFERENCE="scala.compiler.useProjectSettings"
val SCALA_DESIRED_INSTALLATION="scala.compiler.installation"
/** Warning:
* This should no longer be us... | Kwestor/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/util/internal/SettingConverterUtil.scala | Scala | bsd-3-clause | 760 |
package doobie.enum
import doobie.util.invariant._
import java.sql.Connection._
import scalaz.Equal
import scalaz.std.anyVal.intInstance
object transactionisolation {
/** @group Implementation */
sealed abstract class TransactionIsolation(val toInt: Int)
/** @group Values */ case object TransactionNone ... | jamescway/doobie | core/src/main/scala/doobie/enum/transactionisolation.scala | Scala | mit | 1,609 |
package io.surfkit.data
import play.api.libs.json.Json
object Data {
case class Anchor(text: String, href: String, title: String)
implicit val anchorWrites = Json.writes[Anchor]
implicit val anchorReads = Json.reads[Anchor]
case class TopicAnchor( topic: String, url: String, links: List[Anchor])
implicit ... | coreyauger/scala-alltop-to-rss | src/main/scala/io/surfkit/data/Data.scala | Scala | mit | 1,839 |
package dotty.tools.scaladoc
import dotty.tools.scaladoc.tasty.ScaladocTastyInspector
import collection.JavaConverters._
import transformers._
case class Module(rootPackage: Member, members: Map[DRI, Member])
object ScalaModuleProvider:
def mkModule()(using ctx: DocContext): Module =
val (result, rootDoc) = Sc... | lampepfl/dotty | scaladoc/src/dotty/tools/scaladoc/ScalaModuleProvider.scala | Scala | apache-2.0 | 1,106 |
package vaadin.scala
import vaadin.scala.mixins.AbstractSelectMixin
import vaadin.scala.mixins.AbstractFieldMixin
import vaadin.scala.mixins.ContainerMixin
import vaadin.scala.mixins.ContainerViewerMixin
import vaadin.scala.internal.WrapperUtil
import vaadin.scala.mixins.NewItemHandlerMixin
package mixins {
trait A... | CloudInABox/scalavaadinutils | src/main/scala/vaadin/scala/AbstractSelect.scala | Scala | mit | 4,902 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller, Vishnu Gowda Harish, Vinay Kumar Bingi
* @version 1.3
* @date Thu Dec 15 12:47:37 EST 2016
* @see LICENSE (MIT style license file).
*/
package testing.linalgebra
import org.junit.Test
import scal... | scalation/fda | scalation_1.3/scalation_mathstat/src/test/scala/testing/linalgebra/RleMatrixD_T.scala | Scala | mit | 10,763 |
/** Adapted from https://github.com/sbt/sbt/blob/0.13/compile/interface/src/test/scala/xsbt/ScalaCompilerForUnitTesting.scala */
package xsbt
import xsbti.compile.SingleOutput
import java.io.File
import xsbti._
import sbt.io.IO
import xsbti.api.{ ClassLike, Def, DependencyContext }
import DependencyContext._
import xs... | som-snytt/dotty | sbt-bridge/test/xsbt/ScalaCompilerForUnitTesting.scala | Scala | apache-2.0 | 7,909 |
package is.hail.backend
import is.hail.annotations.RegionPool
import is.hail.utils._
abstract class HailTaskContext {
def stageId(): Int
def partitionId(): Int
def attemptNumber(): Int
private lazy val thePool = RegionPool()
def getRegionPool(): RegionPool = thePool
def partSuffix(): String = {
v... | hail-is/hail | hail/src/main/scala/is/hail/backend/HailTaskContext.scala | Scala | mit | 880 |
package redbot.utils
import play.api.libs.json.Format
import scala.collection.Map
import scala.collection.mutable
import scala.collection.immutable.Set
class JoinMap[L, R] private (private val backingL: mutable.Map[L, Set[R]],
private val backingR: mutable.Map[R, Set[L]]) {
def getL(ke... | JamesGallicchio/RedBot | src/main/scala/redbot/utils/JoinMap.scala | Scala | mit | 2,426 |
package de.endrullis.sta
import java.awt.Color
import collection.mutable
import scala.language.implicitConversions
/**
* Implicit casts for some base variable types.
*
* @author Stefan Endrullis <stefan@endrullis.de>
*/
trait BaseVarIC extends PosIC {
implicit def value2var[T,TM](value: T): V... | xylo/scala-tikz-animations | src/de/endrullis/sta/BaseVarIC.scala | Scala | apache-2.0 | 2,891 |
package com.oomagnitude.metrics.model
case class ExperimentId(experiment: String) {
override val toString: String = experiment
}
| oomagnitude/metrics-shared | metrics/shared/src/main/scala/com/oomagnitude/metrics/model/ExperimentId.scala | Scala | apache-2.0 | 132 |
package com.hilverd.simcallstack.unit
import org.scalatest.{Matchers, FunSpec}
import com.hilverd.simcallstack.CollatzSequence
class CollatzSequenceTest extends FunSpec with Matchers {
it("should compute the total stopping time") {
val n = 27
val result = 111
CollatzSequence.stoppingTimeRecursive(n) sh... | hilverd/simulated-call-stack | src/test/scala/com/hilverd/simcallstack/unit/CollatzSequenceTest.scala | Scala | mit | 396 |
package controllers
import java.io.FileInputStream
import org.squeryl.PrimitiveTypeMode.__thisDsl
import org.squeryl.PrimitiveTypeMode.long2ScalarLong
import org.squeryl.PrimitiveTypeMode.transaction
import play.api.Play.current
import play.api.data.Forms.boolean
import play.api.data.Forms.list
import play.api.data.Fo... | lukaszbudnik/hackaton-portal | app/controllers/Sponsor.scala | Scala | apache-2.0 | 10,720 |
package chapter24
/**
* 24.5 ์ํ์ค ํธ๋ ์ดํธ: Seq, IndexedSeq, LinearSeq
*
* Seq ํธ๋ ์ดํธ๋ ์ํ์ค๋ฅผ ํํํ๋ค. ์ํ์ค๋ ๊ธธ์ด๊ฐ ์ ํด์ ธ ์๊ณ , ๊ฐ ์์์ ์์น๋ฅผ 0๋ถํฐ ์์ํ๋
* ์ ํด์ง ์ธ๋ฑ์ค๋ก ์ง์ ํ ์ ์๋ ์ผ์ข
์ Iterable์ด๋ค.
*
* - ์ธ๋ฑ์ค์ ๊ธธ์ด ์ฐ์ฐ: apply, isDefinedAt, length, indices, lengthCompare.
* Seq์ ๊ฒฝ์ฐ apply๋ ์ธ๋ฑ์ค๋ก ์์๋ฅผ ์ฐพ๋ ๊ฒ์ ์๋ฏธํ๋ค. Seq[T] ํ์
์ํ์ค๋ Int๋ฅผ ๋ฐ์์
* T ํ์
์ ์์๋ฅผ... | seraekim/srkim-lang-scala | src/main/java/chapter24/c24_i05.scala | Scala | bsd-3-clause | 3,636 |
package org.jetbrains.plugins.scala
package highlighter
package usages
import java.util
import java.util.Collections
import com.intellij.codeInsight.highlighting.HighlightUsagesHandlerBase
import com.intellij.openapi.editor.Editor
import com.intellij.psi.{PsiElement, PsiFile}
import com.intellij.util.Consumer
import ... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/highlighter/usages/ScalaHighlightPrimaryConstructorExpressionsHandler.scala | Scala | apache-2.0 | 1,631 |
/*
* 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 ... | shaneknapp/spark | resource-managers/kubernetes/core/src/test/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsLifecycleManagerSuite.scala | Scala | apache-2.0 | 7,031 |
/*
* Copyright 2013 Commonwealth Computer Research, 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 applica... | jwkessi/geomesa | geomesa-core/src/main/scala/org/locationtech/geomesa/core/index/Formatters.scala | Scala | apache-2.0 | 4,429 |
package flowlib
import java.util.concurrent.ForkJoinPool
import Site._
import DefaultSite._
trait DefaultSite extends Site with SiteForkJoin with SiteFailFast with SiteLogAll
object DefaultSite {
lazy val forkJoin = new ForkJoinPool
trait SiteForkJoin extends Monitored { this: Site with SiteForkJoin =>
def... | arnolddevos/FlowLib | src/jvm/scala/flowlib/DefaultSite.scala | Scala | lgpl-2.1 | 717 |
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache... | scray/scray | scray-loader/src/main/scala/scray/loader/configparser/ScrayUserConfigurationParser.scala | Scala | apache-2.0 | 3,757 |
/**
* 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... | unix1986/universe | tool/kafka-0.8.1.1-src/core/src/main/scala/kafka/network/InvalidRequestException.scala | Scala | bsd-2-clause | 946 |
package org.scanamo
import cats.implicits._
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.time.{ Millis, Seconds, Span }
import org.scalatest.BeforeAndAfterAll
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import software.amazon.awssdk.services.dynamodb.model... | scanamo/scanamo | scanamo/src/test/scala-2.x/org/scanamo/ScanamoAsyncTest.scala | Scala | apache-2.0 | 25,321 |
/**
* Copyright (C) 2014 Orbeon, Inc.
*
* This program 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
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | wesley1001/orbeon-forms | src/main/scala/org/orbeon/oxf/xml/JXQName.scala | Scala | lgpl-2.1 | 1,214 |
/*
* Copyright (C) 2009 Lalit Pant <pant.lalit@gmail.com>
*
* The contents of this file are subject to the GNU General Public License
* Version 3 (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.gnu.org/copyleft/gpl.html
*
*... | richardfontana/fontana2007-t | KojoEnv/test/unit/src/net/kogics/kojo/staging/ColorTest.scala | Scala | gpl-3.0 | 15,935 |
/*
* 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 | plugins/src/main/scala/com/stratio/sparta/plugin/input/websocket/WebSocketInput.scala | Scala | apache-2.0 | 1,257 |
package sttp.client3.asynchttpclient
import sttp.client3._
import _root_.zio._
import sttp.capabilities.zio.ZioStreams
import sttp.capabilities.{Effect, WebSockets}
import sttp.client3.impl.zio.{ExtendEnv, SttpClientStubbingBase}
package object zio {
/** ZIO-environment service definition, which is an SttpBackend.... | softwaremill/sttp | async-http-client-backend/zio/src/main/scala/sttp/client3/asynchttpclient/zio/package.scala | Scala | apache-2.0 | 2,502 |
import sbt._
import sbt.Keys._
object LiftModuleBuild extends Build {
import BuildSettings._
val project = Project("squerylauth", file("."))
.settings(basicSettings:_*)
.settings(publishSettings:_*)
.settings(libraryDependencies <++= (liftVersion, scalaVersion) { (liftVersion, scalaVersion) =>
... | gensosrl/squeryl-auth-module | project/Build.scala | Scala | apache-2.0 | 929 |
class TC
object A {
given tc as TC
def foo(using TC) = ()
}
object B {
import A._
foo // error: no implicit argument was found
foo(using tc) // error: not found: tc
foo(using A.tc) // ok
}
object C {
import A._
import A.tc
foo // ok
foo(using tc) // ok
}
object D {
import... | som-snytt/dotty | tests/neg/import-implied.scala | Scala | apache-2.0 | 469 |
package services.forms
import models.ClaimForm
/**
* Service providing logic related to forms and their data elements.
*/
trait ClaimService {
def calculateProgress(claimForm: ClaimForm): ClaimForm
}
| vetafi/vetafi-web | app/services/forms/ClaimService.scala | Scala | apache-2.0 | 207 |
package lectures
package dataparallelism
import org.scalameter._
object WordCount {
val standardConfig = config(
Key.exec.minWarmupRuns -> 50,
Key.exec.maxWarmupRuns -> 100,
Key.exec.benchRuns -> 40,
Key.verbose -> true
) withWarmer(new Warmer.Default)
val txt = "A short text... " * 250000
... | twistedgut/scala_coursera | parprog-snippets/src/main/scala/lectures/dataparallelism/WordCount.scala | Scala | gpl-3.0 | 1,524 |
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.