code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
/*
Copyright 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... | erikerlandson/coulomb | coulomb/shared/src/main/scala/coulomb/infra/singleton.scala | Scala | apache-2.0 | 2,888 |
package examples.strictcontenttypes
import com.twitter.finagle.http.Method.Post
import com.twitter.finagle.http.Request
import com.twitter.finagle.http.filter.Cors
import com.twitter.finagle.http.filter.Cors.HttpFilter
import com.twitter.finagle.http.path.Root
import com.twitter.finagle.{Http, Service}
import com.twit... | daviddenton/fintrospect | src/main/scala/examples/strictcontenttypes/MultiBodyTypeRoute.scala | Scala | apache-2.0 | 1,400 |
package org.denigma.kappa.notebook.graph
import scala.util.Random
object Colors {
val green = 0xA1CF64
val red = 0xD95C5C
val blue = 0x6ECFF5
val orange = 0xF05940
val purple = 0x564F8A
val teal = 0x00B5AD
}
object Defs extends Randomizable
{
val colors = List("green","red","blue",/*"orange",*/"purpl... | antonkulaga/kappa-notebook | app/js/src/main/scala/org/denigma/kappa/notebook/graph/LineParams.scala | Scala | mpl-2.0 | 945 |
package org.jetbrains.plugins.scala.codeInspection.collections
import org.jetbrains.plugins.scala.codeInspection.InspectionBundle
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression
/**
* @author Nikolay.Tropin
*/
class MapKeysInspection extends OperationOnCollectionInspection {
override def possibl... | LPTK/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/collections/MapKeysInspection.scala | Scala | apache-2.0 | 1,248 |
/*
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
package org.maproulette.models.utils
import java.sql.{PreparedStatement, SQLException}
import anorm._
import org.apache.commons.lang3.StringUtils
import org.joda.time.DateTime
... | mgcuthbert/maproulette2 | app/org/maproulette/models/utils/DALHelper.scala | Scala | apache-2.0 | 12,083 |
/*
* 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 ... | hvanhovell/spark | streaming/src/main/scala/org/apache/spark/status/api/v1/streaming/ApiStreamingApp.scala | Scala | apache-2.0 | 2,108 |
package argon.codegen.chiselgen
import argon.core._
import argon.codegen.{Codegen, FileDependencies}
import argon.NoBitWidthException
import scala.collection.mutable
import scala.language.postfixOps
import sys.process._
trait ChiselCodegen extends Codegen with FileDependencies { // FileDependencies extends Codegen a... | stanford-ppl/spatial-lang | spatial/core/src/spatial/codegen/chiselgen/ChiselCodegen.scala | Scala | mit | 16,537 |
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.event
import language.implicitConversions
import akka.actor.{ ActorRef, ActorSystem }
import akka.event.Logging.simpleName
import akka.util.Subclassification
import java.util.concurrent.atomic.AtomicReference
import scala.annota... | rorygraves/perf_tester | corpus/akka/akka-actor/src/main/scala/akka/event/EventStream.scala | Scala | apache-2.0 | 5,754 |
package com.sksamuel.elastic4s.analyzers
import com.sksamuel.elastic4s.anaylzers.TokenFilterDsl
import org.scalatest.{Matchers, WordSpec}
class CommonGramsTokenFilterTest extends WordSpec with TokenFilterDsl with Matchers {
"CommonGramsTokenFilter builder" should {
"set common words" in {
commonGramsToke... | beni55/elastic4s | elastic4s-core-tests/src/test/scala/com/sksamuel/elastic4s/analyzers/CommonGramsTokenFilterTest.scala | Scala | apache-2.0 | 927 |
package com.github.tweets.common
private[tweets] case class ProjectData(project: GitHubProjectInfo, tweets: Seq[TweetInfo]) | andrei-l/tweets-for-github-projects-gatherer | src/main/scala/com/github/tweets/common/ProjectData.scala | Scala | mit | 124 |
/*
* Copyright 2017 Nicolas Rinaudo
*
* 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... | nrinaudo/kantan.mongodb | generic/src/test/scala/kantan/mongodb/generic/DerivedBsonValueCodecTests.scala | Scala | apache-2.0 | 1,012 |
/*
* Copyright (c) 2018. Fengguo Wei and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0
* which accompanies this distribution, and is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* Detailed contributors ar... | arguslab/Argus-SAF | amandroid/src/test/scala/org/argus/amandroid/summary/model/IntentSuTest.scala | Scala | apache-2.0 | 103,583 |
package animation
//import something with pictures
//import something with MediaType
import java.util.Date
import edu.depauw.csc.scala.graphics._
import java.util.Timer
import java.util.TimerTask
import scala.actors.Actor
class Animation(canvas: AnimatedCanvas)
{
//fps: Frames Per Second, duration: Seconds, v0 i... | bhoward/EscalatorOld | ScalesEngine/src/animation/Animation.scala | Scala | apache-2.0 | 1,340 |
package com.verizon.trapezium.datasimulation
import com.verizon.bda.trapezium.framework.ApplicationManagerStartup
/**
* Created by v708178 on 5/4/17.
*/
object SimulationStartup extends ApplicationManagerStartup{
override def init(envMgr: String, configDirMgr: String, persistSchemaMgr: String): Unit = {
}
}
| Verizon/trapezium | simulation/src/main/scala/com/verizon/trapezium/datasimulation/SimulationStartup.scala | Scala | apache-2.0 | 320 |
/*
* 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 ... | Dax1n/spark-core | core/src/test/scala/org/apache/spark/util/collection/SorterSuite.scala | Scala | apache-2.0 | 9,814 |
/* Title: Pure/Thy/present.scala
Author: Makarius
Theory presentation: HTML.
*/
package isabelle
import java.io.{File => JFile}
import scala.collection.immutable.SortedMap
object Present
{
/* maintain chapter index -- NOT thread-safe */
private val sessions_path = Path.basic(".sessions")
pr... | larsrh/libisabelle | modules/pide/2019-RC4/src/main/scala/Thy/present.scala | Scala | apache-2.0 | 10,731 |
object a {
object home { def /(s: String) = createDir }
object createDir {
def createDirectoryIfNotExists(createParents: Boolean = false)(using attributes: Seq[String] = Seq.empty, linkOptions: Seq[String] = Seq.empty): Unit =
println("done")
}
//this line causes the crash
@main def Test = (home/"t... | dotty-staging/dotty | tests/run/i8903.scala | Scala | apache-2.0 | 356 |
package mesosphere.marathon.tasks
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.marathon.state.AppDefinition
import org.apache.mesos.Protos.{ TaskInfo, Offer }
/** Create tasks from app definitions and offers. */
trait TaskFactory {
import TaskFactory.CreatedTask
/**
* Return the correspon... | Kosta-Github/marathon | src/main/scala/mesosphere/marathon/tasks/TaskFactory.scala | Scala | apache-2.0 | 587 |
package ee.cone.c4gate
import ee.cone.c4actor._
import ee.cone.c4assemble.Assemble
import ee.cone.c4proto.Protocol
trait SessionAttrApp extends SessionDataProtocolApp
with SessionDataAssembleApp
with SessionAttrAccessFactoryImplApp
trait SessionDataProtocolApp extends ProtocolsApp {
override def protocols: Lis... | wregs/c4proto | c4gate-client/src/main/scala/ee/cone/c4gate/SessionAttrMix.scala | Scala | apache-2.0 | 933 |
/**
* Copyright 2011-2017 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | MykolaB/gatling | gatling-charts/src/main/scala/io/gatling/charts/stats/LogFileReader.scala | Scala | apache-2.0 | 13,057 |
/*
Copyright (C) 2012-2013 the original author or authors.
See the LICENSE.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.
... | davidhoyt/scalaopts | src/main/scala/scalaopts/common/Arch.scala | Scala | apache-2.0 | 3,574 |
import org.scalacheck._
object TestForked extends Properties("Forked loader") {
property("Loaded from application loader") = Prop.secure {
CheckLoader()
true
}
} | pdalpra/sbt | sbt/src/sbt-test/run/fork-loader/src/test/scala/TestForked.scala | Scala | bsd-3-clause | 168 |
/*
* 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 ... | SnappyDataInc/spark | core/src/test/scala/org/apache/spark/scheduler/PoolSuite.scala | Scala | apache-2.0 | 8,388 |
// These are meant to be typed into the REPL. You can also run
// scala -Xnojline < repl-session.scala to run them all at once.
val immutableMap: collection.immutable.Map[String, Int] =
Map("Hello" -> 42) // Nobody can change it
val mutableMap = new collection.mutable.HashMap[String, Int]
val map: collection.Map[... | yeahnoob/scala-impatient-2e-code | src/ch13/sec02/repl-session.scala | Scala | gpl-3.0 | 665 |
package com.identityblitz.login
/**
* Constants of the login flow status
*/
object LoginStatus {
val SUCCESS = 0
val FAIL = -1
val PROCESSING = 1
}
| brainysmith/login-framework | src/main/scala/com/identityblitz/login/LoginStatus.scala | Scala | mit | 161 |
/*
* Copyright 2014 http4s.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://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | http4s/blaze | examples/src/main/scala/org/http4s/blaze/examples/ExampleKeystore.scala | Scala | apache-2.0 | 2,262 |
package stackoverflow
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.rdd.RDD
import annotation.tailrec
import scala.reflect.ClassTag
/** A raw stackoverflow posting, either a question or an answer */
case class Posting(postingType:... | masipauskas/coursera-scala | scala-spark-big-data/stackoverflow/src/main/scala/stackoverflow/StackOverflow.scala | Scala | unlicense | 9,983 |
/*
* 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 ... | nehabhardwaj01/incubator-carbondata | integration/spark-common/src/main/scala/org/apache/carbondata/spark/rdd/UpdateDataLoad.scala | Scala | apache-2.0 | 2,495 |
package main.java.piratebot.pirates
import main.java.piratebot._
class Recruiter(game: Game, player: Player) extends Pirate(game, player) {
val rank = 4
val name = "Recruiter"
override def dayAction(round : Round): RetriableMethodResponse.Value = {
if (player.pirates.count ( p => p.state == Pirat... | ItCouldHaveBeenGreat/Eyepatch | src/main/java/piratebot/pirates/recruiter.scala | Scala | gpl-3.0 | 1,235 |
/*
* 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 ... | apache/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/nodes/calcite/LogicalSink.scala | Scala | apache-2.0 | 2,712 |
package util.date
import hirondelle.date4j.{DateTime => HDT}
import java.text.SimpleDateFormat
import TimeZoneFormat._
import java.util.{UUID, Date, Locale, TimeZone}
import java.util
import com.fasterxml.uuid.{EthernetAddress, Generators}
// this idea could use some more refining... right now the default state of an... | javierg1975/Datamation | src/main/scala/util/date/DateTime.scala | Scala | mit | 5,357 |
package endpoints.akkahttp.server
import akka.http.scaladsl.marshalling.{Marshaller, ToEntityMarshaller}
import akka.http.scaladsl.model.{HttpEntity, MediaTypes}
import akka.http.scaladsl.server.Directives
import akka.http.scaladsl.unmarshalling.{FromEntityUnmarshaller, Unmarshaller}
import endpoints.algebra.Codec
/**... | Krever/endpoints | akka-http/server/src/main/scala/endpoints/akkahttp/server/JsonEntitiesFromCodec.scala | Scala | mit | 1,238 |
/*
*************************************************************************************
* Copyright 2016 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | armeniaca/rudder | rudder-core/src/main/scala/com/normation/rudder/repository/ComplianceRepository.scala | Scala | gpl-3.0 | 2,142 |
/*
* 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 ... | himanshudhami/PredictionIO | examples/experimental/scala-cleanup-app/src/main/scala/Preparator.scala | Scala | apache-2.0 | 1,362 |
package models.gitolite
import scalikejdbc._
case class SchemaMigrations(
version: String) {
def save()(implicit session: DBSession = SchemaMigrations.autoSession): SchemaMigrations = SchemaMigrations.save(this)(session)
def destroy()(implicit session: DBSession = SchemaMigrations.autoSession): Unit = SchemaM... | thomaschoo/gitolite-to-gitbucket | src/main/scala/models/gitolite/SchemaMigrations.scala | Scala | mit | 2,964 |
package de.choffmeister.microserviceutils.http
import java.util
import akka.Done
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.{ExceptionHandler, RejectionHandler}
import akka.http.scaladsl.testkit.ScalatestRouteTest
import org.scalatest.con... | choffmeister/microservice-utils | microservice-utils/src/test/scala/de/choffmeister/microserviceutils/http/LoggingDirectiveTest.scala | Scala | mit | 8,065 |
package com.box.castle.core.config
import org.joda.time.Duration
import BatchSizeManagerConfig._
case class BatchSizeManagerConfig(samplingSlots: Int = DefaultSamplingSlots,
samplingInterval: Duration = DefaultSamplingInterval,
maxWaitTime: Duration = ... | Box-Castle/core | src/main/scala/com/box/castle/core/config/BatchSizeManagerConfig.scala | Scala | apache-2.0 | 1,390 |
package com.yuzhouwan.hacker.annotation
import java.io.{BufferedReader, FileNotFoundException, FileReader, IOException}
/**
* Copyright @ 2019 yuzhouwan.com
* All right reserved.
* Function:annotation
*
* @author Benedict Jin
* @since 2015/11/20 0020
*/
class AnnotationExample(fileName: String) {
pri... | asdf2014/yuzhouwan | yuzhouwan-hacker/src/main/scala/com/yuzhouwan/hacker/annotation/AnnotationExample.scala | Scala | apache-2.0 | 964 |
package com.fitbit.service
import akka.actor.Props
import com.fitbit.client.FitbitClient
import com.fitbit.model.activities._
import spray.httpx.SprayJsonSupport
import spray.json.DefaultJsonProtocol
import spray.routing._
import spray.util.LoggingContext
import scala.concurrent.Future
import scala.language.implicitC... | richardE353/fitbit_rest | src/main/scala/com/fitbit/service/FitbitHttpService.scala | Scala | apache-2.0 | 3,911 |
object Test extends dotty.runtime.LegacyApp {
val a = Array(Array(1, 2), Array("a","b"))
println("a(0) = Array(" + (a(0) mkString ", ") + ")")
println("a(1) = Array(" + (a(1) map (s => "\\"" + s + "\\"") mkString ", ") + ")")
}
| yusuke2255/dotty | tests/pending/run/t2386-new.scala | Scala | bsd-3-clause | 232 |
/**
* Copyright (C) 2014 Kaj Magnus Lindberg (born 1979)
*
* 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) any later version.
... | debiki/debiki-server-old | app/controllers/SettingsController.scala | Scala | agpl-3.0 | 2,746 |
/**
* 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... | wesley1001/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/function/XFormsFunction.scala | Scala | lgpl-2.1 | 10,779 |
package io.youi.paint
import io.youi.drawable.Context
import io.youi.path.{Path, PathAction}
import scala.scalajs.js
case class Stroke(paint: Paint,
path: Option[Path] = None,
lineWidth: Double = 1.0,
lineDash: List[Double] = Nil,
lineDashOffset... | outr/youi | gui/src/main/scala/io/youi/paint/Stroke.scala | Scala | mit | 2,312 |
package com.github.diegopacheco.sandbox.scala.akka.routing
import akka.actor.ActorSystem
import com.github.diegopacheco.sandbox.scala.akka.util.Try
import akka.actor.ActorRef
import akka.actor.Props
import akka.routing.FromConfig
import com.github.diegopacheco.sandbox.scala.akka.util.GenericActor
object SimpleBalanci... | diegopacheco/scala-playground | scala_11_akka_23_full_playground/src/main/scala/com/github/diegopacheco/sandbox/scala/akka/routing/SimpleBalancingPoolRouterConfigApp.scala | Scala | unlicense | 708 |
package com.flowy.common.services
import com.flowy.common.api.Bittrex.ExchangeBalance
import com.flowy.common.database.TheEverythingBagelDao
import com.flowy.common.models.{Balance, Exchange}
import java.util.UUID
import scala.concurrent.{ExecutionContext, Future}
class BalanceService(bagel: TheEverythingBagelDao)(... | asciiu/fomo | common/src/main/scala/com/flowy/common/services/BalanceService.scala | Scala | apache-2.0 | 1,690 |
package me.krobinson.mealplan
import java.io.FileInputStream
import java.net.URL
import java.util.Properties
import scala.util.{Random, Try}
import scalaz.{-\/, \/-}
import scalaz.syntax.id._
import argonaut._, Argonaut._
import me.krobinson.mealplan.model._
import me.krobinson.mealplan.model.json._
object MealPl... | robinske/mealplanner | src/main/scala/MealPlan.scala | Scala | mit | 1,657 |
/*
* Copyright 2020 David Edwards
*
* 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... | davidledwards/scalop | src/test/scala/com/loopfor/scalop/OptTest.scala | Scala | apache-2.0 | 3,667 |
/*
* Copyright 2015 Nicolas Rinaudo
*
* 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... | nrinaudo/scala-csv | generic/shared/src/test/scala/kantan/csv/generic/DerivedRowCodecTests.scala | Scala | mit | 1,480 |
package com.tecniplast.canopen.SDOManagement
import java.nio.ByteBuffer
import com.tecniplast.canopen.SDOManagement.SDO.SDORequestResponseOK
import com.tecniplast.canopen._
/**
* Created by fbignardi on 5/19/15.
*/
trait UInt32Extractor extends TwoWordExtractor{
me: SDORequestResponseOK =>
def getUInt32Value ... | TPTeam/CanOpen_Scala | src/main/scala/com/tecniplast/canopen/SDOManagement/UInt32Extractor.scala | Scala | lgpl-2.1 | 558 |
package scalan.common
import scala.collection.Seq
import scalan.Scalan
import scala.reflect.runtime.universe._
trait KindsExamples extends Scalan with KindsDsl {
type Id[A] = A
implicit val functorId: Functor[Id] = new Functor[Id] {
def tag[A](implicit evA: WeakTypeTag[A]) = weakTypeTag[Id[A]]
def lift[A... | scalan/scalan | core/src/test/scala/scalan/common/KindsExamples.scala | Scala | apache-2.0 | 770 |
package ru.maizy.influxdbclient
/**
* Copyright (c) Nikita Kovaliov, maizy.ru, 2016-2017
* See LICENSE.txt for details.
*/
import ru.maizy.influxdbclient.data.{ NumberValue, StringValue }
class SimpleValueSpec extends BaseSpec {
"SimpleValueSpec" should "implements equals & hashCode for all subtypes" in {
... | maizy/ambient7 | influxdb-client/src/test/scala/ru/maizy/influxdbclient/SimpleValueSpec.scala | Scala | apache-2.0 | 632 |
package com.airbnb.common.ml.search
import org.junit.Assert._
import org.junit.Test
import com.airbnb.common.ml.util.ScalaLogging
class MonteCarloSearchTest extends ScalaLogging {
@Test
def testParams(): Unit = {
val randomizer = scala.util.Random
val paramMap = List(
"gamma" -> List(0.1, 0.2),
... | TDDFT/aerosolve | airlearner/airlearner-xgboost/src/test/scala/com/airbnb/common/ml/search/MonteCarloSearchTest.scala | Scala | apache-2.0 | 1,264 |
/*
* 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/iht-frontend | app/iht/models/des/ihtReturn/Spouse.scala | Scala | apache-2.0 | 1,531 |
//
// JavaSiteForm.scala -- Scala object JavaSiteForm
// Project OrcScala
//
// $Id: JavaSiteForm.scala 2933 2011-12-15 16:26:02Z jthywissen $
//
// Created by jthywiss on May 30, 2010.
//
// Copyright (c) 2011 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed... | laurenyew/cOrcS | src/orc/values/sites/JavaSiteForm.scala | Scala | bsd-3-clause | 1,118 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.filters.headers
import javax.inject.Inject
import com.typesafe.config.ConfigFactory
import play.api.Application
import play.api.Configuration
import play.api.http.HttpFilters
import play.api.inject.bind
import play.api.inject.guice.Guice... | mkurz/playframework | web/play-filters-helpers/src/test/scala/play/filters/headers/SecurityHeadersFilterSpec.scala | Scala | apache-2.0 | 9,900 |
package io.relayr.amqp
import org.scalatest.{ FlatSpec, Matchers }
import scala.language.postfixOps
class ByteArraySpec extends FlatSpec with Matchers {
"ByteArray" should "produce an array of what was put in" in {
val ByteArray(copy) = ByteArray(Array(1: Byte))
copy should be (Array(1: Byte))
}
it s... | relayr/rabbitmq-scala-client | src/test/scala/io/relayr/amqp/ByteArraySpec.scala | Scala | mit | 998 |
/*
* 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... | anthonyccri/geomesa | geomesa-core/src/test/scala/geomesa/core/iterators/AbstractIteratorTest.scala | Scala | apache-2.0 | 1,885 |
/**********************************************************************************************************************
* This file is part of Scrupal, a Scalable Reactive Web Application Framework for Content Management *
* ... | scrupal/scrupal | scrupal-api/src/main/scala/scrupal/api/EventHandler.scala | Scala | apache-2.0 | 3,445 |
package org.jetbrains.plugins.scala.debugger.evaluation.evaluator
import java.util
import com.intellij.debugger.DebuggerBundle
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl
import com.intellij.debugger.engine.evaluation.expression.{Evaluator, Modifier, TypeEvaluator}
import com.intellij.debugge... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/debugger/evaluation/evaluator/ScalaInstanceofEvaluator.scala | Scala | apache-2.0 | 1,781 |
package dotty
package tools
package vulpix
import java.io.{ File => JFile, InputStreamReader, BufferedReader, PrintStream }
import java.nio.file.Paths
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.TimeoutException
import scala.concurrent.duration.Duration
import scala.concurrent.{ Await... | som-snytt/dotty | compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala | Scala | apache-2.0 | 7,128 |
package net.liftweb.util
import scala.xml.{Elem, NodeSeq}
import net.liftweb.common.Box
import net.liftweb.markdown.ThreadLocalTransformer
object MarkdownParser {
lazy val matchMetadata = """(?m)\A(:?[ \t]*\n)?(?:-{3,}+\n)?(^([a-zA-Z0-9 _\-]+)[=:]([^\n]*)\n+(:?[ \t]*\n)?)+(:?-{3,}+\n)?""".r
lazy val topMetadata ... | lift/framework | core/util/src/main/scala/net/liftweb/util/MarkdownParser.scala | Scala | apache-2.0 | 1,342 |
package com.goyeau.kubernetes.client.crd
import io.circe.syntax._
import io.circe.{Decoder, Encoder}
final case class JSON(value: String)
object JSON {
implicit val encode: Encoder[JSON] = _.value.asJson
implicit val decode: Decoder[JSON] = _.as[String].map(JSON(_))
}
| joan38/kubernetes-client | kubernetes-client/src/com/goyeau/kubernetes/client/crd/JSON.scala | Scala | apache-2.0 | 276 |
/**
* Copyright 2013 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 agreed to i... | TracyLu/RxScala | src/test/scala/rx/lang/scala/observables/BlockingObservableTest.scala | Scala | apache-2.0 | 4,458 |
package uima.fc
import org.apache.uima.analysis_engine.{AnalysisEngineProcessException, TypeOrFeature}
import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData
import org.apache.uima.cas.CAS
import org.apache.uima.flow._
import org.apache.uima.resource.metadata.Capability
import org.apache.uima.util.Leve... | ktr-skmt/FelisCatusZero | src/main/scala/uima/fc/InformationRetrieverFlowController.scala | Scala | apache-2.0 | 2,739 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-fs/geomesa-fs-storage/geomesa-fs-storage-orc/src/main/scala/org/locationtech/geomesa/fs/storage/orc/utils/OrcSearchArguments.scala | Scala | apache-2.0 | 6,022 |
/**
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.pattern
object AbstractPromiseActorRef {
final val stateOffset = 8
final val watchedByOffset = 9
}
| unicredit/akka.js | akka-js-actor/js/src/main/scala/akka/pattern/AbstractPromiseActorRef.scala | Scala | bsd-3-clause | 192 |
/*******************************************************************************
* 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/entities/characters/inventory/Inventory.scala | Scala | gpl-3.0 | 3,120 |
/*
* Copyright 2015 Nicolas Rinaudo
*
* 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... | nrinaudo/tabulate | core/shared/src/test/scala/kantan/csv/StringCodecTests.scala | Scala | mit | 967 |
package io.finch
import java.nio.charset.Charset
import cats.Eq
import com.twitter.finagle.http.{Method, Request}
import com.twitter.finagle.netty3.ChannelBufferBuf
import com.twitter.io.{Charsets, ConcatBuf}
import org.jboss.netty.handler.codec.http.{DefaultHttpRequest, HttpMethod, HttpVersion}
import org.jboss.nett... | ilya-murzinov/finch | core/src/main/scala/io/finch/Input.scala | Scala | apache-2.0 | 4,238 |
import cats.implicits._
import treelog.LogTreeSyntaxWithoutAnnotations._
object QuadraticRootsExample extends App {
case class Parameters(a: Double, b: Double, c: Double)
// Roots are real
println("Success case:")
println(root(Parameters(2, 5, 3)).value.written.show)
/*
Extracting root
Calculating Numer... | lancewalton/treelog | src/test/scala/QuadraticRootsExample.scala | Scala | mit | 3,158 |
package wookie
import com.amazonaws.Request
import com.amazonaws.auth._
object signer {
trait Signer {
def endpoint: String
def serviceName: String
def credentials: AWSCredentials
lazy val signer = {
val s = new AWS4Signer(true)
s.setServiceName(serviceName)
s
}
def si... | pepegar/wookie | wookie-core/src/main/scala/wookie/signer.scala | Scala | mit | 707 |
package queries
case class ResetPassword(secret: String, password: String)
| ponkotuy/train-stamp-rally | app/queries/ResetPassword.scala | Scala | apache-2.0 | 76 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | aokolnychyi/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala | Scala | apache-2.0 | 42,869 |
/*
* Copyright 2017 Sumo Logic
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | SumoLogic/epigraph | java/codegen/src/main/scala/ws/epigraph/java/AnonMapGen.scala | Scala | apache-2.0 | 1,607 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
// Copyright (c) 2011-2015 ScalaMock Contributors (https://github.com/paulbutcher/ScalaMock/graphs/contributors)
//
// Permission is hereby granted, free of charge, to any person obtaining a ... | sugakandrey/ensime-server | testutil/src/main/scala/org/scalamock/scalatest/AbstractMockFactory.scala | Scala | gpl-3.0 | 2,424 |
package org.jetbrains.plugins.scala.lang.macros.expansion
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer
import com.intellij.openapi.compiler.{CompileContext, CompileStatusNotification, CompilerManager}
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/macros/expansion/RecompileAnnotationAction.scala | Scala | apache-2.0 | 1,209 |
/*
* 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 ... | sachintyagi22/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala | Scala | apache-2.0 | 33,885 |
/*
* 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 swave.core.impl.stages.inout
import scala.util.control.NonFatal
import swave.core.Stage
import swave.... | sirthias/swave | core/src/main/scala/swave/core/impl/stages/inout/FoldStage.scala | Scala | mpl-2.0 | 1,808 |
package uk.co.turingatemyhamster.consbol
import Unifier._
import Interpretation._
import monocle.macros._
@Lenses
case class Model[R, V, I](i: InterpModel[V, I],
ord: OrdModel[I],
index: IndexModel[I],
range: RangeModel[R, I],
... | drdozer/consbol | consbol/core/shared/src/main/scala/uk/co/turingatemyhamster/consbol/Model.scala | Scala | apache-2.0 | 2,056 |
package ecommerce.sales.view
import com.typesafe.config.{Config, ConfigFactory}
import ecommerce.shipping.ShipmentCreated
import ecommerce.shipping.ShippingStatus.Waiting
import ecommerce.shipping.view.{ShipmentDao, ShipmentProjection}
import org.scalatest._
import pl.newicom.dddd.messaging.event.{AggregateSnapshotId,... | dominhtung/ddd-leaven-akka-v2 | shipping/read-back/src/test/scala/ecommerce/sales/view/ShipmentProjectionSpec.scala | Scala | mit | 1,373 |
/*
* 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 ... | Sephiroth-Lin/incubator-carbondata | integration/spark-common/src/main/scala/org/apache/carbondata/api/CarbonStore.scala | Scala | apache-2.0 | 6,461 |
package examples.graphx
import org.apache.spark.{ SparkConf, SparkContext }
import org.apache.spark.rdd.RDD
import org.apache.spark.graphx.{ Edge, Graph }
/**
* Employee relationship analysis with GraphX.
*/
object EmployeeRelationship {
def main(args: Array[String]): Unit = {
// vertex format: vertex_id, data
... | prithvirajbose/spark-dev | src/main/scala/examples/graphx/EmployeeRelationship.scala | Scala | gpl-3.0 | 2,203 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ian McIntosh
*
* 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,... | cranst0n/f3 | modules/web/src/main/scala/f3/web/view/powerrankings.scala | Scala | mit | 5,745 |
package scalalab.utils
object Props extends PropertiesParser {
var props: Map[String, String] = Map()
/* Throws FileNotFoundException if the file was not found
* Throws IOException on other errors
*/
def loadProps(file: String) {
import scala.io.Source
import scala.util.matching.Regex
val sett... | scalalab/scalalab | source/src/main/scala/scalalab/utils/Props.scala | Scala | mit | 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 ... | fhueske/flink | flink-table/flink-table-api-scala-bridge/src/main/scala/org/apache/flink/table/api/scala/DataSetConversions.scala | Scala | apache-2.0 | 2,358 |
package repository.index
import play.api.Logger
import play.api.libs.concurrent.Promise
import play.modules.reactivemongo.json.collection.JSONCollection
import reactivemongo.api.indexes.{Index, IndexType}
import reactivemongo.bson._
import reactivemongo.core.commands.{BSONCommandResultMaker, Command, CommandError}
im... | timothygordon32/reactive-todolist | app/repository/index/Indexed.scala | Scala | mit | 2,620 |
/*
* 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/DataTreeNodeTest.scala | Scala | agpl-3.0 | 7,786 |
/*
* Copyright 2014 Intelix Pty 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... | mglukh/ehub | modules/core/src/main/scala/agent/flavors/files/Indexer.scala | Scala | apache-2.0 | 10,595 |
package com.github.kimutansk.akka.exercise.persistence
import akka.actor.{ActorDSL, Props, ActorSystem}
import com.typesafe.config.ConfigFactory
import akka.persistence.Recover
/**
* Akka-Persistenceの確認を行うサンプルアプリケーション
*/
object PersistenceApp extends App {
override def main(args: Array[String]): Unit = {
val ... | togusafish/kimutansk-_-scala-exercise | akka-exercise/src/main/scala/com/github/kimutansk/akka/exercise/persistence/PersistenceApp.scala | Scala | mit | 1,067 |
/**
* 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... | samaitra/kafka | core/src/test/scala/unit/kafka/utils/UtilsTest.scala | Scala | apache-2.0 | 4,972 |
/*
* Copyright 2016 rdbc contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | rdbc-io/rdbc | rdbc-tck/src/main/scala/io/rdbc/tck/ForValueSpec.scala | Scala | apache-2.0 | 2,120 |
/*
* Copyright (c) 2014 Robert Conrad - All Rights Reserved.
* Unauthorized copying of this file, via any medium is strictly prohibited.
* This file is proprietary and confidential.
* Last modified by rconrad, 12/25/14 10:16 AM
*/
package base.entity.auth.mock
import base.common.service.ServiceImpl
import base.c... | robconrad/base-api | project-entity/src/test/scala/base/entity/auth/mock/AuthServiceMock.scala | Scala | mit | 2,115 |
package com.sksamuel.elastic4s.analyzers
import org.scalatest.{Matchers, WordSpec}
class KeywordTokenizerTest extends WordSpec with TokenizerApi with Matchers {
"KeywordTokenizer builder" should {
"set buffer size" in {
keywordTokenizer("testy").bufferSize(123).json.string shouldBe """{"type":"keyword","... | FabienPennequin/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analyzers/KeywordTokenizerTest.scala | Scala | apache-2.0 | 352 |
package ru.biocad.ig.alicont.common
import java.io.File
import scala.io.Source
import java.net.URL
/**
* Created with IntelliJ IDEA.
* User: mactep
* Date: 28.10.13
* Time: 12:49
*/
object Scoring {
def loadMatrix(source : Source) : Array[Array[Double]] = {
val result = Array.fill(256, 256)(.0)
var let... | zmactep/igcat | lib/ig-alicont/src/main/scala/ru/biocad/ig/alicont/common/Scoring.scala | Scala | bsd-2-clause | 1,532 |
package com.scalaz.model
import org.joda.time.DateTime
case class Destination(
id: Int,
name: String,
code: String,
country: String)
case class Trip(
id: Int,
userId: Long,
fromDate: DateTime,
toDate: DateTime,
destinations: Seq[Destination],
description: String,
amendedDate: DateTime) | rvijayan/scalaz-validations-example | src/main/scala/com/scalaz/model/Model.scala | Scala | mit | 311 |
/*
* Copyright 2021 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/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/nn/VflNNEstimator.scala | Scala | apache-2.0 | 6,569 |
/**
* Copyright (c) 2013, Regents of the University of California
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, ... | andyk/cluster-scheduler-simulator | src/main/scala/Util.scala | Scala | bsd-3-clause | 1,742 |
package org.sstudio.bulldozer.exceptions
private[bulldozer] final class InvalidDirPathException(message: String) extends Exception(message) | avril23/bulldozer | bulldozer/src/main/scala/org/sstudio/bulldozer/exceptions/InvalidDirPathException.scala | Scala | bsd-3-clause | 140 |
/*
*
* Copyright (c) 2016 LIBBLE team supervised by Dr. Wu-Jun LI at Nanjing University.
* 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.apac... | syh6585/LIBBLE-Spark | src/main/scala/collaborativeFiltering/MatrixFactorizationByScope.scala | Scala | apache-2.0 | 11,026 |
package org.boidflow
import com.jme3.app.SimpleApplication
/**
*
*/
object Boidflow extends SimpleApplication {
def simpleInitApp() {
}
} | zzorn/boidflow | src/main/scala/org/boidflow/Boidflow.scala | Scala | gpl-2.0 | 151 |
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.