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 chandu0101.scalajs.react.components
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
import scala.scalajs.js
import scalacss.Defaults._
import scalacss.ScalaCssReact._
object ReactSearchBox {
class Style extends StyleSheet.Inline {
import dsl._
val searchBox = style... | elacin/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/ReactSearchBox.scala | Scala | apache-2.0 | 1,342 |
package com.thetestpeople.trt.webdriver
import org.junit.runner.RunWith
import com.thetestpeople.trt.model.impl.DummyData
import com.thetestpeople.trt.mother.{ IncomingFactory ⇒ F }
import com.thetestpeople.trt.tags.SlowTest
import org.scalatest.junit.JUnitRunner
import com.github.nscala_time.time.Imports._
@SlowTest... | thetestpeople/trt | test/com/thetestpeople/trt/webdriver/StaleTestsScreenTest.scala | Scala | mit | 1,198 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | sebadiaz/kafka | core/src/test/scala/unit/kafka/utils/TestUtils.scala | Scala | apache-2.0 | 67,082 |
// Distributed under the MIT license, see: http://www.opensource.org/licenses/MIT
package org.orbeon.errorified
// Exceptions utilities
// Uses reflection to find nested causes when exceptions don't support Java's getCause
object Exceptions {
// Returns the exception directly nested
// This first tries reflec... | orbeon/errorified | src/main/scala/org/orbeon/errorified/Exceptions.scala | Scala | mit | 2,840 |
package com.mattrjacobs.rxscala.slides
import rx.lang.scala.Observable
trait Slide91 extends App {
type SomeData
val a: Observable[SomeData]
val b: Observable[String]
a.zip(b).subscribe(
pair => println("a: " + pair._1 + " b: " + pair._2),
ex => println("error occurred: " + ex.getMessage),
() => ... | mattrjacobs/RxScalaDemo | src/main/scala/slides/Slide91.scala | Scala | apache-2.0 | 345 |
package mesosphere.marathon.core.matcher.base
import mesosphere.marathon.core.launcher.TaskOp
import mesosphere.marathon.core.task.Task
import mesosphere.marathon.state.{ PathId, Timestamp }
import org.apache.mesos.{ Protos => Mesos }
import scala.concurrent.Future
object OfferMatcher {
/**
* A TaskOp with a ... | ss75710541/marathon | src/main/scala/mesosphere/marathon/core/matcher/base/OfferMatcher.scala | Scala | apache-2.0 | 3,492 |
import akka.actor._
object Guess2 {
def main(args: Array[String]) {
println("Guess2: begin")
val system = ActorSystem("Guess2")
val server = ActorDSL.actor(system,"GuessServer2")(new GuessServer2)
val client = ActorDSL.actor(system)(new GuessClient2)
import scala.concurrent.duration._
implicit... | grzegorzbalcerek/scala-book-examples | examples/Guess2.scala | Scala | mit | 1,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 may ... | HuaweiBigData/carbondata | integration/spark-common/src/main/scala/org/apache/carbondata/spark/PartitionFactory.scala | Scala | apache-2.0 | 2,609 |
package repositories.analysis.dao
import com.google.inject.{Inject, Singleton}
import models.analysis.Treatment
import no.uio.musit.MusitResults.{MusitResult, MusitSuccess}
import no.uio.musit.repositories.DbErrorHandlers
import play.api.Logger
import play.api.db.slick.DatabaseConfigProvider
import scala.concurrent.{... | MUSIT-Norway/musit | service_backend/app/repositories/analysis/dao/TreatmentDao.scala | Scala | gpl-2.0 | 856 |
package slinky.core
import org.scalajs.dom.document
import slinky.core.facade.{React, ReactElement}
import slinky.web.ReactDOM
import org.scalatest.funsuite.AnyFunSuite
class FunctionalComponentTest extends AnyFunSuite {
test("Can render a functional component") {
val container = document.createElement("div")
... | shadaj/slinky | tests/src/test/scala/slinky/core/FunctionalComponentTest.scala | Scala | mit | 3,222 |
package util
import org.apache.abdera.model.Feed
/**
*
* @author ponkotuy
* Date: 14/12/08.
*/
object Abdera {
private[this] val instance = new org.apache.abdera.Abdera()
def newFeed(): Feed = instance.newFeed()
}
| ponkotuy/MyFleetGirls | server/app/util/Abdera.scala | Scala | mit | 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 may ... | MLnick/spark | sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala | Scala | apache-2.0 | 17,406 |
package net.surguy.filerenamer
import org.specs2.mutable.SpecificationWithJUnit
import java.io.File
import java.nio.file.Paths
import com.google.common.io.Files
import com.google.common.base.Charsets
import scala.collection.JavaConversions._
class HashRecorderTest extends SpecificationWithJUnit {
val recorder = ne... | inigo/file-renamer-hash | src/test/scala/net/surguy/filerenamer/HashRecorderTest.scala | Scala | gpl-3.0 | 1,075 |
package resources
import javax.inject.Inject
import javax.inject.Singleton
import akka.stream.Materializer
import org.coursera.example.Course
import org.coursera.naptime.Fields
import org.coursera.naptime.GetGraphQLRelation
import org.coursera.naptime.MultiGetGraphQLRelation
import org.coursera.naptime.Ok
import org.... | coursera/naptime | examples/src/main/scala/resources/CoursesResource.scala | Scala | apache-2.0 | 3,037 |
/*
* Copyright 2016-2018 Michal Harish, michal.harish@gmail.com
*
* 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 u... | amient/affinity | kafka/test-util-kafka/src/main/scala/io/amient/affinity/kafka/EmbeddedKafka.scala | Scala | apache-2.0 | 1,144 |
/*
* 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 ... | SparklineData/spark-druid-olap | src/main/scala/org/sparklinedata/druid/client/CuratorConnection.scala | Scala | apache-2.0 | 8,857 |
package bozzy.steno
/**
* Created by ted on 2016-02-08.
*/
abstract class Translation(val raw: String, val format: DictionaryFormat.Value) {
val word_count: Int = (raw split ' ').length
def toJSON: String
def toRTF: String
}
class RTFTranslation(override val raw: String) extends Translation(raw, DictionaryF... | Germanika/Bozzy | src/main/scala/bozzy/steno/Translation.scala | Scala | gpl-3.0 | 571 |
package mesosphere.marathon.io
import java.math.BigInteger
import java.net.{ URLConnection, HttpURLConnection, URL }
import java.security.MessageDigest
import scala.collection.JavaConverters._
import scala.concurrent.Future
import org.apache.commons.io.FilenameUtils.getName
import scala.concurrent.ExecutionContext.I... | timcharper/marathon | src/main/scala/mesosphere/marathon/io/PathFun.scala | Scala | apache-2.0 | 1,445 |
/*
* Copyright 2012 Comcast Cable Communications Management, 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 require... | Comcast/money | money-core/src/main/scala/com/comcast/money/core/CoreSpanInfo.scala | Scala | apache-2.0 | 1,504 |
package com.getjenny.starchat.services.esclient
/**
* Created by Angelo Leto <angelo@getjenny.com> on 01/07/16.
*/
object DecisionTableElasticClient extends ElasticClient {
override val indexName: String = ""
override val indexSuffix: String = config.getString("es.dt_index_suffix")
val queryMinThreshold : Fl... | GetJenny/starchat | src/main/scala/com/getjenny/starchat/services/esclient/DecisionTableElasticClient.scala | Scala | gpl-2.0 | 1,543 |
package org.scalajs.nio
import org.scalajs.dom
abstract class ByteBuffer extends Buffer with TypedBuffer[Byte, ByteBuffer] with Comparable[ByteBuffer] {
// Defining this one here instead of TypedBuffer because of the type erasure conflict
def put(src: Array[Byte]): ByteBuffer = this.put(src, 0, src.length)
def... | storm-enroute/macrogl | src/buffer/scala/org/scalajs/nio/ByteBuffer.scala | Scala | bsd-3-clause | 1,922 |
package mr.merc.ui.world
import mr.merc.economics.WorldStateParliamentActions
import mr.merc.local.Localization._
import mr.merc.local.Localization
import mr.merc.politics._
import mr.merc.ui.common.{LazyPane, SceneManager}
import mr.merc.ui.dialog.ModalDialog._
import mr.merc.ui.world.PieChartBuilder.PiePart
import s... | RenualdMarch/merc | src/main/scala/mr/merc/ui/world/ParliamentPane.scala | Scala | gpl-3.0 | 10,728 |
/*
* Copyright (c) 2014-2021 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... | monifu/monifu | monix-eval/shared/src/test/scala/monix/eval/TaskLiftSuite.scala | Scala | apache-2.0 | 3,058 |
package test
import org.specs2.mutable._
import play.api.test._
import play.api.test.Helpers._
class ModelSpec extends Specification {
import models._
// -- Date helpers
def dateIs(date: java.util.Date, str: String) = new java.text.SimpleDateFormat("yyyy-MM-dd").format(date) == str
// --
"Comp... | sturtesm/redhat-openshift-play-demo | test/ModelSpec.scala | Scala | gpl-3.0 | 1,386 |
package blended.security.ssl.internal
import blended.security.ssl.{SslContextInfo => SslContextInfoTrait}
import javax.net.ssl.SSLContext
trait SslContextInfoMBean extends SslContextInfoTrait
class SslContextInfo(
sslContext : SSLContext,
cyphers : List[String]
) extends SslContextInfoMBean {
override def get... | woq-blended/blended | blended.security.ssl/src/main/scala/blended/security/ssl/internal/SslContextInfo.scala | Scala | apache-2.0 | 664 |
/*
* 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/internal/plugin/PluginEndpoint.scala | Scala | apache-2.0 | 2,387 |
/*
* Copyright (c) 2013 Aviat Networks.
* This file is part of DocReg+Web. Please refer to the NOTICE.txt file for license details.
*/
package vvv.docreg.backend
import akka.actor.{ActorRef, Actor}
import vvv.docreg.model.{FilteredRevision, Project, Revision, Document}
import akka.event.Logging
import net.liftweb.... | scott-abernethy/docreg-web | src/main/scala/vvv/docreg/backend/DocumentStream.scala | Scala | gpl-3.0 | 4,665 |
package spark.streaming.api.java
import spark.streaming.{Duration, Time, DStream}
import spark.api.java.function.{Function => JFunction}
import spark.api.java.JavaRDD
import spark.storage.StorageLevel
import spark.RDD
/**
* A Discretized Stream (DStream), the basic abstraction in Spark Streaming, is a continuous
* ... | koeninger/spark | streaming/src/main/scala/spark/streaming/api/java/JavaDStream.scala | Scala | bsd-3-clause | 3,929 |
package csvside
import au.com.bytecode.opencsv.{ CSVReader => OpenCSVReader }
import au.com.bytecode.opencsv.{ CSVWriter => OpenCSVWriter }
/*
* This code from Apache 2.0 Licensed mighty-csv
*
* https://github.com/t-pleasure/mighty-csv/ at version 2dcee78
*/
object Mighty {
type Row = Array[String]
class CSV... | davegurnell/csvside | src/main/scala/csvside/Mighty.scala | Scala | apache-2.0 | 2,350 |
/*
* Copyright 2022 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/fset-faststream | test/services/events/EventsConfigRepositorySpec.scala | Scala | apache-2.0 | 5,449 |
/*
* The MIT License
*
* Copyright (c) 2020 Fulcrum Genomics
*
* 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, c... | fulcrumgenomics/fgbio | src/test/scala/com/fulcrumgenomics/util/AssignPrimersTest.scala | Scala | mit | 8,507 |
package org.scalafmt.cli
import scala.io.Source
import java.io.InputStream
import java.nio.file.{Path, Paths}
import org.scalafmt.Error.MisformattedFile
import org.scalafmt.sysops.AbsoluteFile
sealed abstract class InputMethod {
def readInput(options: CliOptions): String
def path: Path
protected def print(te... | scalameta/scalafmt | scalafmt-cli/src/main/scala/org/scalafmt/cli/InputMethod.scala | Scala | apache-2.0 | 3,342 |
package officeladder
import japgolly.scalajs.react.vdom.prefix_<^._
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.all.div
import japgolly.scalajs.react.vdom.all.`class`
object HomePage {
val container = ReactComponentB[Unit]("homePage")
.render(P => {
div(`class` := "container", con... | yzernik/office-ladder | client/src/main/scala/officeladder/HomePage.scala | Scala | mit | 476 |
package com.lambdista.config
import scala.language.dynamics
/**
* This class lets you walk across a configuration dynamically. Nonetheless it manages possible errors within
* [[com.lambdista.config.Result]].
*
* @author Alessandro Lacava (@lambdista)
* @since 2016-11-23
*/
final case class ConfigWalker(va... | lambdista/config | core/src/main/scala/com/lambdista/config/ConfigWalker.scala | Scala | apache-2.0 | 902 |
/*
* Copyright 2019 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/emailaddress | src/test/scala/uk/gov/hmrc/emailaddress/EmailAddressSpec.scala | Scala | apache-2.0 | 5,794 |
package sangria.schema
import sangria.ast
import sangria.execution.WithViolations
import sangria.validation._
import sangria.macros._
import sangria.macros.derive.{
InputObjectTypeName,
ObjectTypeName,
deriveInputObjectType,
deriveObjectType
}
import sangria.util.Pos
import scala.util.{Failure, Success, Try}
... | sangria-graphql/sangria | modules/derivation/src/test/scala/sangria/schema/SchemaConstraintsSpec.scala | Scala | apache-2.0 | 28,341 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | zouzias/spark-lucenerdd | src/main/scala/org/zouzias/spark/lucenerdd/facets/package.scala | Scala | apache-2.0 | 5,294 |
package pl.writeonly.re.shared.scalapipe
import utest._
object ScalaPipeOptWithTraitTest extends TestSuite with ScalaPipeOps {
def add2(x: Int): Int = x + 2
override val tests: Tests = Tests {
'into_with_lambda - {
val result = 1 |> (_ + 2)
result ==> 3
}
'into_with_method - {
val r... | writeonly/resentiment | re/shared/src/test/scala/pl/writeonly/re/shared/scalapipe/ScalaPipeOptWithTraitTest.scala | Scala | mit | 369 |
package org.jetbrains.plugins.scala.lang.psi.api.base.types
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement
/**
* @author Alexander Podkhalyuzin
* Date: 22.02.2008
*/
trait ScRefineStat extends ScalaPsiElement {
} | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/psi/api/base/types/ScRefineStat.scala | Scala | apache-2.0 | 229 |
/*
* 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... | manishgupta88/carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonSessionCatalog.scala | Scala | apache-2.0 | 4,887 |
package spinoco.protocol.http.codec
import java.time.ZonedDateTime
import org.scalacheck.Prop._
import org.scalacheck.Properties
import scodec.{Attempt, DecodeResult}
import scodec.bits.BitVector
import spinoco.protocol.http.{HttpResponseHeader, HttpStatusCode, HttpVersion}
import spinoco.protocol.http.header._
impor... | Spinoco/protocol | http/src/test/scala/spinoco/protocol/http/codec/HttpResponseHeaderCodecSpec.scala | Scala | mit | 4,753 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.testing.common
/** Mode i... | scala-js/scala-js | test-common/src/main/scala/org/scalajs/testing/common/TestBridgeMode.scala | Scala | apache-2.0 | 1,162 |
/*
Copyright 2017-2020 Erik Erlandson
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
di... | isarn/isarn-sketches-spark | src/test/scala/org/isarnproject/pipelines/spark/fi.scala | Scala | apache-2.0 | 1,943 |
/*
* 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-logservice/src/main/scala/org/apache/spark/streaming/aliyun/logservice/LoghubRDD.scala | Scala | artistic-2.0 | 6,133 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/nn/mkldnn/MemoryDataSpec.scala | Scala | apache-2.0 | 1,651 |
package com.ing.bakery.testing
import java.net.InetSocketAddress
import cats.effect.{ContextShift, IO, Resource, Timer}
import com.ing.bakery.smoke.printGreen
import org.scalactic.source
import org.scalatest.compatible.Assertion
import org.scalatest.funspec.FixtureAsyncFunSpecLike
import org.scalatest.{ConfigMap, Fut... | ing-bank/baker | bakery/integration-tests/src/test/scala/com/ing/bakery/testing/BakeryFunSpec.scala | Scala | mit | 3,852 |
package tw.joecwu.sumologic.scala.client
import scala.util.parsing.json.JSONFormat
import com.ning.http.client.Response
import org.json4s._
import org.json4s.native.JsonMethods._
import java.util.zip.GZIPInputStream
object JsonHelper{
implicit def stringToJsonStr(v:String) = new {
def toJsonStr = if(v!=null) "\... | joecwu/sumologic-scala-client | src/main/scala/tw/joecwu/sumologic/scala/client/JsonHelper.scala | Scala | apache-2.0 | 704 |
/*
* 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 ... | andrewor14/iolap | mllib/src/main/scala/org/apache/spark/mllib/evaluation/MultilabelMetrics.scala | Scala | apache-2.0 | 5,659 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | garyKeorkunian/squants | shared/src/main/scala/squants/motion/Yank.scala | Scala | apache-2.0 | 1,974 |
package smr
package collection
import storage._;
import util._;
import scala.collection.generic.CanBuildFrom
import scala.collection.mutable.{Buffer, ArrayBuffer, ArrayBuilder, Builder}
import scala.collection._
/**
*
* @author dlwh
*/
trait DistributedIterable[+T] extends GenIterable[T] with DistributedIterabl... | dlwh/smr | src/main/scala/smr/collection/DistributedIterable.scala | Scala | apache-2.0 | 9,707 |
package com.ignition.frame
import org.junit.runner.RunWith
import org.specs2.runner.JUnitRunner
@RunWith(classOf[JUnitRunner])
class KafkaOutputSpec extends FrameFlowSpecification {
"KafkaOutput" should {
"construct with defaults" in {
val step = KafkaOutput("field", "topic")
step.field === "field"... | uralian/ignition | src/test/scala/com/ignition/frame/KafkaOutputSpec.scala | Scala | apache-2.0 | 1,536 |
// Databricks notebook source exported at Sat, 26 Dec 2015 13:47:34 UTC
// MAGIC %md # Step 1: Understand your Data
// MAGIC
// MAGIC The first step of doing anything with data is taking a look at it.
// MAGIC - What's the schema
// MAGIC - What's the distribution of data
// MAGIC - Is it dense or sparse
// MAGIC
... | brkyvz/spark-pipeline | scala/step-1/Exploration.scala | Scala | mit | 3,717 |
/*
* 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 ... | chuckchen/spark | sql/core/src/test/scala/org/apache/spark/sql/SparkSessionExtensionSuite.scala | Scala | apache-2.0 | 38,118 |
package is.hail.variant.vsm
import is.hail.HailSuite
import is.hail.annotations.BroadcastRow
import is.hail.expr.ir
import is.hail.expr.ir.{ExecuteContext, Interpret, MatrixAnnotateRowsTable, TableLiteral, TableRange, TableValue}
import is.hail.types._
import is.hail.types.virtual.{TInt32, TStruct}
import is.hail.rvd.... | danking/hail | hail/src/test/scala/is/hail/variant/vsm/PartitioningSuite.scala | Scala | mit | 1,598 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/main/scala/com/waz/sync/otr/OtrSyncHandler.scala | Scala | gpl-3.0 | 10,511 |
package scalapb.compiler
import com.google.protobuf.Descriptors._
import scala.jdk.CollectionConverters._
import com.google.protobuf.Descriptors.FieldDescriptor.Type
private[compiler] class ParseFromGenerator(
implicits: DescriptorImplicits,
generator: ProtobufGenerator,
message: Descriptor
) {
import i... | scalapb/ScalaPB | compiler-plugin/src/main/scala/scalapb/compiler/ParseFromGenerator.scala | Scala | apache-2.0 | 10,476 |
package test
import java.util
import scala.collection.JavaConversions
/**
*
*
* @author TheTemportalist 2/1/15
*/
object Scala {
def foreach[T](collection: util.Collection[T], callback:(T) => Unit): Unit = {
collection match {
case list: util.List[T] =>
for (item <- JavaConversions.asScalaBuffer(list)... | TheTemportalist/Test | src/main/scala/test/Scala.scala | Scala | apache-2.0 | 555 |
/*
* Copyright (C) 2012-2013 Age Mooij (http://scalapenos.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 a... | agemooij/riak-scala-client | src/main/scala/com/scalapenos/riak/DefaultConflictResolver.scala | Scala | apache-2.0 | 981 |
package com.socrata.soql.functions
import org.scalatest.MustMatchers
import org.scalatest.FunSuite
class SoQLFunctionsTest extends FunSuite with MustMatchers {
test("all functions have distinct identities") {
SoQLFunctions.functionsByIdentity.size must equal (SoQLFunctions.allFunctions.size)
}
test("fixed-... | socrata-platform/soql-reference | soql-stdlib/src/test/scala/com/socrata/soql/functions/SoQLFunctionsTest.scala | Scala | apache-2.0 | 774 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | mimir/src/main/scala/com/precog/mimir/CondRewriter.scala | Scala | agpl-3.0 | 1,502 |
package eu.brosbit.opos.snippet.page
import net.liftweb.json.JsonDSL._
import eu.brosbit.opos.model.page.FlashTile
import scala.xml.Unparsed
trait FlashTileSn {
def appendTile(url: String) = {
val tiles = FlashTile.findAll("page" -> url).map(
ft =>
<div id="flashTile" style={"background-image: ur... | mikolajs/osp | src/main/scala/eu/brosbit/opos/snippet/page/FlashTileSn.scala | Scala | agpl-3.0 | 722 |
/*
* 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/src/main/scala/org/apache/flink/table/factories/StreamTableSinkFactory.scala | Scala | apache-2.0 | 1,547 |
package io.getquill.context.cassandra
import io.getquill._
class DecodeNullSpec extends Spec {
"no default values when reading null" - {
"sync" in {
import testSyncDB._
val writeEntities = quote(querySchema[DecodeNullTestWriteEntity]("DecodeNullTestEntity"))
testSyncDB.run(writeEntities.del... | getquill/quill | quill-cassandra/src/test/scala/io/getquill/context/cassandra/DecodeNullSpec.scala | Scala | apache-2.0 | 1,254 |
object Zipper {
// A zipper for a binary tree.
// ??? Zipper[A] ???
// Get a zipper focussed on the root node.
def fromTree[A](bt: BinTree[A]): Zipper[A] = ???
// Get the complete tree from a zipper.
def toTree[A](zipper: Zipper[A]): BinTree[A] = ???
// Get the value of the focus node.
def value[A](z... | daewon/til | exercism/scala/zipper/src/main/scala/Zipper.scala | Scala | mpl-2.0 | 1,099 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* 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.
* Yo... | Webtrends/wookiee-cluster | src/main/scala/com/webtrends/harness/component/cluster/communication/MessagingTopicActor.scala | Scala | apache-2.0 | 6,239 |
/*
* Copyright 2011-2014 Chris de Vreeze
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | EBPI/yaidom | src/main/scala/nl/ebpi/yaidom/queryapi/package.scala | Scala | apache-2.0 | 1,302 |
package client.appstate.groups.policies
import autowire._
import client.appstate.GroupPolicies
import client.services.AjaxClient
import diode.data._
import diode.{Effect, _}
import shared._
import shared.requests.groups.policies._
import boopickle.Default._
import shared.responses.groups.policies.PoliciesAssociatedToG... | beikern/foulkon-ui | client/src/main/scala/client/appstate/groups/policies/DiodeGroupPolicy.scala | Scala | apache-2.0 | 2,603 |
/*
* Copyright 2017 TWO SIGMA OPEN SOURCE, 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 applicable... | jpallas/beakerx | kernel/scala/src/test/scala/com/twosigma/beakerx/scala/chart/categoryplot/plotitem/CategoryStemsPropertiesTest.scala | Scala | apache-2.0 | 1,153 |
/*
* Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option)... | Tensei-Data/tensei-agent | src/test/scala/com/wegtam/tensei/agent/transformers/LowerOrUpperTest.scala | Scala | agpl-3.0 | 17,273 |
/*
* Copyright 2013 websudos ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | nosheenzaza/phantom-data-centric | phantom-dsl/src/test/scala/com/websudos/phantom/dsl/crud/ListOperatorsTest.scala | Scala | gpl-2.0 | 17,894 |
/*
* 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 ... | JerryLead/spark | sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala | Scala | apache-2.0 | 12,474 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.playjson
import java.io.{ ByteArrayInputStream, ByteArrayOutputStream }
import java.nio.charset.StandardCharsets
import java.util.zip.{ GZIPInputStream, GZIPOutputStream }
import akka.actor.ExtendedActor... | rstento/lagom | play-json/src/main/scala/com/lightbend/lagom/scaladsl/playjson/PlayJsonSerializer.scala | Scala | apache-2.0 | 6,501 |
package net.n12n.momo.couchbase
import akka.actor.{ActorLogging, Props, Actor}
import net.n12n.momo.util.RichConfig._
object MetricSampleActor {
case class Action(name: String, time: Long)
case object Tick
def props() = Props[MetricSampleActor]
}
class MetricSampleActor extends Actor with ActorMonitoring wit... | ngrossmann/momo | src/main/scala/net/n12n/momo/couchbase/MetricSampleActor.scala | Scala | apache-2.0 | 1,549 |
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright 2016-2020 Daniel Urban and contributors listed in NOTICE.txt
*
* 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... | durban/exp-reagents | bench/src/main/scala/dev/tauri/choam/bench/util/XorShift.scala | Scala | apache-2.0 | 1,200 |
package specs.fast
import org.scalacheck.{Arbitrary, Gen}
import scala.util.Random
import org.json4s.ast.fast._
object Generators {
def jIntGenerator = Arbitrary.arbitrary[BigInt].map(JNumber.apply)
def jStringGenerator = Arbitrary.arbitrary[String].map(JString.apply)
def jBooleanGenerator = Arbitrary.arbitra... | json4s/json4s-ast | jvm/src/test/scala/specs/fast/Generators.scala | Scala | apache-2.0 | 1,029 |
/*******************************************************************************
Copyright (c) 2013, S-Core, 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/analysis/typing/models/DOMCore/DOMLocator.scala | Scala | bsd-3-clause | 2,573 |
package i0
package i1 {}
object i2 {
val i3: Any
}
abstract class i4 extends i0 {
override type i1 = Nothing
type i3 <: i2
type i4 <: i2
type i5 <: i3
type i6 <: i2
type i7 = { val i8: i4 }
val i9 = { val i1: i2 }
type i11 = List[this, i7]
trait i12 {
type i16 <: i11;
class i16 extends i1 {
type i2 <: i1
type i7 <: i5.... | lampepfl/dotty | tests/fuzzy/597a43d8b9d210fe6fb04bf3059811776e7f20d9.scala | Scala | apache-2.0 | 727 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | hlin117/factorie | src/main/scala/cc/factorie/util/ScriptingUtils.scala | Scala | apache-2.0 | 1,591 |
package unfiltered.response
import unfiltered.Cookie
case class ResponseCookies(cookies: Cookie*) extends Responder[Any] {
def respond(res: HttpResponse[Any]) = res.cookies(cookies)
}
| softprops/Unfiltered | library/src/main/scala/response/cookies.scala | Scala | mit | 188 |
package org.scalex
package object model extends instances {
type TypeEntity = String
type Flag = String
type Variance = String
type Expression = String
type QualifiedName = String
}
| ornicar/scalex | src/main/scala/model/package.scala | Scala | mit | 194 |
package chandu0101.scalajs.react.components
import japgolly.scalajs.react._
import japgolly.scalajs.react.extra.Reusability
import japgolly.scalajs.react.vdom.prefix_<^._
import org.scalajs.dom
import org.scalajs.dom._
import scala.scalajs.js
import scalacss.Defaults._
import scalacss.ScalaCssReact._
case class RPoi... | elacin/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/ReactDraggable.scala | Scala | apache-2.0 | 12,573 |
package pl.msitko.xml.dsl
trait Examples {
val inputWithComments =
"""<?xml version="1.0" encoding="UTF-8"?>
|<a>
| <c1>
| <f>item1</f>
| <g>item2</g>
| </c1>
| <c1>
| <!--
|something
|something more
|even more
|
|-
... | note/xml-lens | optics/shared/src/test/scala/pl/msitko/xml/dsl/Examples.scala | Scala | mit | 681 |
// @SOURCE:E:/GitHub/Backgammon-Web-master_for_2.1.5/Backgammon-Web-master/conf/routes
// @HASH:353440427f3d1a0ce23433309259e3c33c6493ec
// @DATE:Mon Jan 13 10:56:46 CET 2014
import play.core._
import play.core.Router._
import play.core.j._
import play.api.mvc._
import play.libs.F
import Router.queryString
object ... | bfcmyxa/Backgammon-Web-master_for_2.1.5 | target/scala-2.10/src_managed/main/routes_routing.scala | Scala | gpl-2.0 | 3,559 |
package dotty.tools.dotc
package transform
import core._
import Contexts._, Symbols._, Types._, Flags._, Decorators._, StdNames._, Constants._
import SymDenotations.SymDenotation
import TreeTransforms._
import SymUtils._
import ast.untpd
import ast.Trees._
/** Expand SAM closures that cannot be represented by the JVM... | folone/dotty | src/dotty/tools/dotc/transform/ExpandSAMs.scala | Scala | bsd-3-clause | 3,821 |
/*
* Copyright 2016 by Simba Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | InitialDLab/Simba | src/main/scala/org/apache/spark/sql/simba/execution/join/BDJSpark.scala | Scala | apache-2.0 | 3,189 |
package models
import play.api.mvc.PathBindable
import uk.gov.hmrc.domain.EmpRef
import scala.util.{Failure, Success, Try}
object EmprefBindable extends PathBindable[EmpRef] {
override def bind(key: String, value: String): Either[String, EmpRef] = Try(EmpRef.fromIdentifiers(value)) match {
case Success(e) => R... | UKGovernmentBEIS/das-alpha-client-mock | src/main/scala/models/PlayBindings.scala | Scala | mit | 552 |
package breeze.linalg.support.codegen
/*
Copyright 2012 David Hall
Licensed under the Apache License, Version 2.0 (the "License")
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law... | tjhunter/scalanlp-core | math/src/main/scala/breeze/linalg/support/codegen/GenOperators.scala | Scala | apache-2.0 | 43,060 |
/* *\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, Ga... | derekmorr/squants | shared/src/test/scala/squants/RatioSpec.scala | Scala | apache-2.0 | 2,242 |
// -----------------------------------------------------------------------------
//
// Scalax - The Scala Community Library
// Copyright (c) 2005-8 The Scalax Project. All rights reserved.
//
// The primary distribution site is http://scalax.scalaforge.org/
//
// This software is released under the terms of the Rev... | LPTK/intellij-scala | scalap/src/scalap/scalax/rules/Rules.scala | Scala | apache-2.0 | 4,596 |
package coursera.usgs
import retrofit.http.GET
import retrofit.{RetrofitError, RestAdapter, Callback}
import rx.lang.scala.Observable
import rx.lang.scala.subjects.AsyncSubject
import retrofit.client.Response
object Usgs {
private val restAdapter = new RestAdapter.Builder().setServer("http://earthquake.usgs.gov").... | mitochon/hexercise | src/mooc/reactive/week4.codesamples/src/test/scala/coursera/usgs/Usgs.scala | Scala | mit | 937 |
package dao.sitedata
import scala.concurrent.Future
import javax.inject.Inject
import play.api.db.slick.DatabaseConfigProvider
import play.api.db.slick.HasDatabaseConfigProvider
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import slick.driver.JdbcProfile
import slick.jdbc.GetResult
import models.... | tnddn/iv-web | portal/rest-portal/app/dao/sitedata/EquipmentModelDao.scala | Scala | apache-2.0 | 2,974 |
// Import library
import Jama._
object DoMultiplyMatrices_jama {
def main(args: Array[String]) {
val N = 2000
// Create the matrix
val A = new Matrix(N, N)
val B = new Matrix(N, N)
// Fill the matrix with random numbers
val r = new scala.util.Random(0)
for(i <- 0... | scienceopen/numba-examples | NASA_JulesKouatchou/Problem2/DoMultiplyMatrices_jama.scala | Scala | mit | 1,108 |
/*
# Copyright 2016 Georges Lipka
#
# 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 wri... | glipka/Easy-React-With-ScalaJS | src/main/scala/com/glipka/easyReactJS/reactRedux/Options.scala | Scala | apache-2.0 | 1,334 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala | Scala | apache-2.0 | 37,952 |
package com.blinkbox.books.search.ingester
import com.blinkbox.books.config._
import com.blinkbox.books.rabbitmq.RabbitMqConsumer
import com.blinkbox.books.rabbitmq.RabbitMqConfirmedPublisher
import com.blinkbox.books.rabbitmq.RabbitMqConfirmedPublisher.PublisherConfiguration
import com.typesafe.config.Config
import j... | blinkboxbooks/search-ingester-service.scala | src/main/scala/com/blinkbox/books/search/ingester/AppConfig.scala | Scala | mit | 1,712 |
val fibs: Stream[BigInt] = BigInt(0) #:: BigInt(1) #:: fibs.zip(fibs.tail).map { n => n._1 + n._2 }
fibs take 5 foreach println
| samendez/atom-script | examples/fibo.scala | Scala | mit | 129 |
/*******************************************************************************
Copyright (c) 2012-2013, S-Core, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
***************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/tests/TypingOperatorJUTest.scala | Scala | bsd-3-clause | 82,485 |
import java.util.UUID
import cats.effect.IO
import scala.util.Try
case class Person(name: String, age: Int)
object Endpoints {
import org.http4s._
import org.http4s.dsl.io._
val helloWorldService = HttpRoutes.of[IO] {
case GET -> Root / "hello" / IntVar(number) =>
Ok(s"Hello, your number is $number"... | denisftw/advanced-scala-code | http4s/src/main/scala/Http4sMain.scala | Scala | apache-2.0 | 2,072 |
package net.badgerhunt.shares.render
class UserLogin extends Page {
val url = "login"
def render = Right(
<p>
<form method="post" action="/logging_in" name="login" id="login_form">
<p>Username: <input type="text" name="username"></input></p>
<p>Password: <input type="password" name="password"></i... | Synesso/tofucube | src/main/scala/net/badgerhunt/shares/render/UserLogin.scala | Scala | bsd-2-clause | 456 |
package core.models.services
import scala.concurrent.Future
/**
* Service to get the health state of the app.
*/
trait HealthService {
/**
* Gets the health state of the app.
*
* @return True if the app is healthy, false otherwise.
*/
def get(): Future[Boolean]
}
| akkie/silhouette-play-react-seed | app-core/src/main/scala/core/models/services/HealthService.scala | Scala | mit | 285 |
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.