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 |
|---|---|---|---|---|---|
// goseumdochi: experiments with incarnation
// Copyright 2016 John V. Sichi
//
// 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
//
// Un... | lingeringsocket/goseumdochi | base/src/main/scala/org/goseumdochi/control/Actuator.scala | Scala | apache-2.0 | 1,289 |
package notebook
import akka.actor.{ActorSystem, ActorRef, ActorRefFactory}
import play.api.mvc._
import play.api.libs.json._
import play.api.Play.current
import notebook.util._
object ObservableController extends Controller {
} | vitan/spark-notebook | modules/observable/src/main/scala/notebook/ObservableController.scala | Scala | apache-2.0 | 235 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
import sbt._
import sbt.Keys._
import sbt.complete.Parsers
object Generators {
// Generates a scala file that contains the play version for use at runtime.
def PlayVersion(version: String, scalaVersion: String, sbtVersion: String, dir: F... | aradchykov/playframework | framework/project/Tasks.scala | Scala | apache-2.0 | 1,915 |
object HOInvocations {
def switch (x: Int, f: (Int) => Int, g: (Int) => Int) = if (x > 0) f else g
def failling_1 (f: (Int) => Int) = {
switch(-10, (x: Int) => x + 1, f)(2)
} ensuring { res => res > 0}
def failling_2 (x: Int, f: (Int) => Int, g: (Int) => Int) = {
require(x > 0)
switch(1, switch(x,... | ericpony/scala-examples | testcases/verification/higher-order/invalid/HOInvocations.scala | Scala | mit | 370 |
import sbt._
object Dependency {
object V {
val Scala = "2.11.7"
}
val json4s = "org.json4s" %% "json4s-native" % "3.2.11" % "provided"
val typesafeConfig = "com.typesafe" % "config" % "1.3.0" % "provided"
val scalatest = "org.scalatest" %% "scalatest" % "2.2.5" % "test"
}
| oxy-development/util | project/Dependency.scala | Scala | lgpl-3.0 | 291 |
package org.littlewings.javaee7.service
import javax.enterprise.context.RequestScoped
@RequestScoped
class CalcService {
def add(a: Int, b: Int): Int = a + b
def multiply(a: Int, b: Int): Int = a * b
}
| kazuhira-r/javaee7-scala-examples | arquillian-wildfly-container-embedded/src/main/scala/org/littlewings/javaee7/service/CalcService.scala | Scala | mit | 209 |
package recfun
import common._
object Main
{
def main(args: Array[String])
{
println("Pascal's Triangle")
for (row <- 0 to 10) {
for (col <- 0 to row)
print(pascal(col, row) + " ")
println()
}
}
/**
* Exercise 1:
* Here, I simply determine if the number its on an edge o... | andrucuna/scala | progfun-coursera/progfun-assignment1/src/main/scala/recfun/Main.scala | Scala | gpl-2.0 | 1,768 |
/*
* 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... | darroyocazorla/crossdata | core/src/test/scala/org/apache/spark/sql/crossdata/test/SharedXDContextTypesTest.scala | Scala | apache-2.0 | 9,164 |
package com.twitter.finagle.mysql.transport
import com.twitter.finagle.client.Transporter
import com.twitter.finagle.framer.LengthFieldFramer
import com.twitter.finagle.netty3.Netty3Transporter
import com.twitter.finagle.netty4.Netty4Transporter
import com.twitter.finagle.Stack
import com.twitter.finagle.transport.Tra... | adriancole/finagle | finagle-mysql/src/main/scala/com/twitter/finagle/mysql/transport/TransportImpl.scala | Scala | apache-2.0 | 1,703 |
package freecli
package option
package dsl
import cats.free.FreeApplicative
import shapeless._
import shapeless.ops.hlist.Prepend
import core.api.{CanProduce, Description}
import option.api._
case class HelpDslBuilder[H <: HList](list: H) {
def --(
name: String)
(implicit ev: Prepend[H, OptionFieldName :: ... | pavlosgi/freecli | core/src/main/scala/freecli/option/dsl/HelpDslBuilder.scala | Scala | apache-2.0 | 1,364 |
package ee.cone.c4actor
import ee.cone.c4actor.Types.{ClName, SrcId}
import ee.cone.c4assemble.{AssembledKey, IndexUtil}
trait DefaultKeyFactoryApp {
def indexUtil: IndexUtil
def byPKKeyFactory: KeyFactory = DefaultKeyFactory(indexUtil)()
def origKeyFactoryOpt: Option[KeyFactory] = None
}
case class DefaultKe... | wregs/c4proto | c4actor-base/src/main/scala/ee/cone/c4actor/OrigKeyFactoryApp.scala | Scala | apache-2.0 | 571 |
/***********************************************************************
* Copyright (c) 2013-2015 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 is ... | drackaer/geomesa | geomesa-plugin/src/main/scala/org/locationtech/geomesa/plugin/wcs/GeoMesaCoverageStoreEditPanel.scala | Scala | apache-2.0 | 3,820 |
/*
* Sonar Scoverage Plugin
* Copyright (C) 2013 Rado Buransky
* dev@sonar.codehaus.org
*
* 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 3 of the License, or (at... | Sagacify/sonar-scala | src/main/scala/com/buransky/plugins/scoverage/language/Scala.scala | Scala | lgpl-3.0 | 1,180 |
package exceptions
class BadIntException(val msg: String) extends RuntimeException(msg)
| j-c-w/mlc | src/main/scala/exceptions/BadIntException.scala | Scala | gpl-3.0 | 89 |
package com.felixmilea.vorbit.actors
import com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException
import com.felixmilea.vorbit.data.DBConnection
class NgramProcessor extends ManagedActor {
import NgramProcessor._
private[this] lazy val db = new DBConnection(true)
private[this] lazy val addBigramsPr... | felixmc/Felix-Milea-Ciobanu-Vorbit | code/com/felixmilea/vorbit/actors/NgramProcessor.scala | Scala | mit | 1,301 |
/*
* 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 viper.silicon.interfaces
import viper.silver.ast
import viper.silver.components.StatefulComponent
imp... | sccblom/vercors | viper/silicon/src/main/scala/interfaces/Preamble.scala | Scala | mpl-2.0 | 555 |
package org.jetbrains.plugins.scala
package components
import java.awt.event.MouseEvent
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.keymap.KeymapUtil
import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.StatusBarWidget.WidgetPresentation
import com.intellij... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/components/TypeAwareWidgetFactory.scala | Scala | apache-2.0 | 3,752 |
package com.eevolution.context.dictionary.infrastructure.repository
import java.util.UUID
import com.eevolution.context.dictionary.domain._
import com.eevolution.context.dictionary.domain.model.Desktop
import com.eevolution.context.dictionary.infrastructure.db.DbContext._
import com.eevolution.utils.PaginatedSequence... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/repository/DesktopRepository.scala | Scala | gpl-3.0 | 2,669 |
/*
* 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/service/AbstractReadOperationGen.scala | Scala | apache-2.0 | 3,811 |
package de.fosd.typechef
import org.junit.Test
import de.fosd.typechef.featureexpr.FeatureExprFactory
import de.fosd.typechef.parser.c._
import de.fosd.typechef.conditional.Opt
import FeatureExprFactory._
import java.io.File
class SerializationTest {
@Test
def testSerializationBDD() {
FeatureExprFa... | mbeddr/TypeChef | Frontend/src/test/scala/de/fosd/typechef/SerializationTest.scala | Scala | lgpl-3.0 | 2,341 |
import java.net.URL
import bintry.Client
import dispatch.{FunctionHandler, Http}
import org.apache.ivy.core.module.descriptor.Artifact
import org.apache.ivy.plugins.repository.{AbstractRepository, Repository}
import org.apache.ivy.plugins.resolver.IBiblioResolver
import sbt.{RawRepository, Resolver, _}
import scala.c... | shnapz/service | project/bintray.scala | Scala | apache-2.0 | 2,430 |
package models
import skinny.DBSettings
import skinny.test._
import org.scalatest.fixture.FlatSpec
import org.scalatest._
import scalikejdbc._
import scalikejdbc.scalatest._
import org.joda.time._
class ArticlesSpec extends FlatSpec with Matchers with DBSettings with AutoRollback {
}
| yamitzky/nonplay-play | test/models/ArticlesSpec.scala | Scala | cc0-1.0 | 287 |
package uk.gov.dvla.vehicles.presentation.common.clientsidesession
case class CookieKeyValue(key: String, value: String)
| dvla/vehicles-presentation-common | app/uk/gov/dvla/vehicles/presentation/common/clientsidesession/CookieKeyValue.scala | Scala | mit | 122 |
package com.mesosphere.universe.v2.model
import io.lemonlabs.uri.Uri
import io.circe.Decoder
import io.circe.Encoder
import io.circe.JsonObject
import io.circe.generic.semiauto.deriveDecoder
import io.circe.generic.semiauto.deriveEncoder
import com.mesosphere.cosmos.circe.Encoders.encodeUri
import com.mesosphere.cosmo... | dcos/cosmos | cosmos-common/src/main/scala/com/mesosphere/universe/v2/model/PackageFiles.scala | Scala | apache-2.0 | 799 |
package lists
import java.util._
object test {
def singleton[T](elem: T) = new Cons[T](elem, new Nil[T])
//> singleton: [T](elem: T)lists.Cons[T]
def nth[T](n: Int, xs: List[T]): T =
if (xs.isEmpty) throw new IndexOutOfBoundsException
else if(n == 0) xs... | akxs14/TinyWeb | Classes/type_parameters/TypeParameters.scala | Scala | apache-2.0 | 1,167 |
/*
* 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/dataset/ImageSpec.scala | Scala | apache-2.0 | 1,896 |
package au.com.dius.pact.matchers
import java.text.ParseException
import com.typesafe.scalalogging.StrictLogging
import io.gatling.jsonpath.AST._
import io.gatling.jsonpath.Parser
import org.apache.commons.lang3.time.{DateFormatUtils, DateUtils}
import scala.xml.Elem
object Matchers extends StrictLogging {
def m... | flaregames/pact-jvm | pact-jvm-matchers/src/main/scala/au/com/dius/pact/matchers/Matchers.scala | Scala | apache-2.0 | 15,272 |
/*
* Copyright 2014-2021 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | brharrington/atlas | atlas-chart/src/main/scala/com/netflix/atlas/chart/model/Palette.scala | Scala | apache-2.0 | 4,933 |
/*
* Copyright 2010 Michael Fortin <mike@brzy.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 la... | m410/brzy | src/main/scala/org/brzy/webapp/BrzyFilter.scala | Scala | apache-2.0 | 2,798 |
package gapt.expr.ty
object ->: {
/**
* Interprets the given type as an arrow type.
*
* @param ty The type to be interpreted as an arrow type.
* @return Returns Some( (t,r) ) if `ty` = t -> r, otherwise None is
* returned.
*/
def unapply( ty: Ty ): Option[( Ty, Ty )] =
ty match {
case ... | gapt/gapt | core/src/main/scala/gapt/expr/ty/->:.scala | Scala | gpl-3.0 | 393 |
/*
* 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 ... | yanboliang/spark | streaming/src/test/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManagerSuite.scala | Scala | apache-2.0 | 17,108 |
package io.mth.unfiltered.cors
import unfiltered.request.{Connection => _, _}
import unfiltered.response._
import unfiltered.kit._
import unfiltered.Cycle
case class CorsConfig(
validateOrigin: String => Boolean,
validateMethod: String => Boolean,
validateHeaders: List[String] => Boolean,
allowCredentials: Bo... | rgladwell/unfiltered-cors | src/main/scala/io/mth/unfiltered/cors/CorsConfig.scala | Scala | bsd-3-clause | 731 |
package helpers
import play.api.Play
import scala.collection.immutable
import models._
import java.sql.Connection
import play.api.libs.concurrent.Akka
import play.api.Play.current
import scala.concurrent.duration._
import play.api.i18n.{Messages, MessagesProvider}
import play.api.libs.mailer._
import akka.actor._
i... | ruimo/store2 | app/helpers/ItemInquiryMail.scala | Scala | apache-2.0 | 5,491 |
/*
* 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... | mike0sv/spark | sql/core/src/test/scala/org/apache/spark/sql/sources/FilteredScanSuite.scala | Scala | apache-2.0 | 13,139 |
package djinni
import djinni.ast._
import djinni.generatorTools._
import djinni.meta._
class ObjcMarshal(spec: Spec) extends Marshal(spec) {
override def typename(tm: MExpr): String = {
val (name, _) = toObjcType(tm)
name
}
def typename(name: String, ty: TypeDef): String = idObjc.ty(name)
override d... | mrdomino/djinni | src/source/ObjcMarshal.scala | Scala | apache-2.0 | 4,963 |
package com.aristocrat.mandrill.requests.Webhooks
import com.aristocrat.mandrill.requests.MandrillRequest
case class Add(
key: String,
url: String,
description: String,
// @OneOf(Events)
events: Seq[String] = Seq()) extends MandrillRequest
| aristocratic/mandrill | src/main/scala/com/aristocrat/mandrill/requests/Webhooks/Add.scala | Scala | mit | 262 |
/**
* Copyright 2015, deepsense.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 applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | commons/src/test/scala/io/deepsense/commons/utils/VersionSpec.scala | Scala | apache-2.0 | 3,076 |
package com.leeavital
import org.jboss.netty.handler.codec.http._
import collection.mutable.Map
import org.jboss.netty.buffer.ChannelBuffer
import com.twitter.util.Future
import com.leeavital.util.ChannelBufferHelper
import scala.collection.mutable
/**
* Created by lee on 10/4/14.
*/
class UnfangledResponse(val con... | leeavital/unfangled | src/main/scala/com/leeavital/unfangled/UnfangledResponse.scala | Scala | mit | 1,981 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | mdzimmerman/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/data/AccumuloFeatureReader.scala | Scala | apache-2.0 | 5,256 |
package scala.reflect
import org.junit.Assert._
import org.junit.Test
class FieldAccessTest {
class TestClass {
private val x = 123
locally {
() => x
}
}
/** scala/bug#9306 */
@Test
def testFieldAccess(): Unit = {
import scala.reflect.runtime.universe._
import scala.reflect.runti... | scala/scala | test/junit/scala/reflect/FieldAccessTest.scala | Scala | apache-2.0 | 604 |
package tastytest
object TestMethodDeps {
def test = MethodDeps.parent
}
| scala/scala | test/tasty/neg-isolated/src-2/TestMethodDeps_fail.scala | Scala | apache-2.0 | 78 |
// The MIT License (MIT)
//
// Copyright (c) 2015 David Heidrich, BowlingX <me@bowlingx.com>
//
// 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 limit... | BowlingX/commentp | src/main/scala/com/bowlingx/commentp/BaseController.scala | Scala | mit | 2,635 |
package se.chimps.bitziness.core.endpoints.persistence.redis.endpoint
import se.chimps.bitziness.core.Endpoint
import se.chimps.bitziness.core.endpoints.persistence.redis.RedisFactory
trait RedisEndpoint extends Endpoint with RedisFactory
| Meduzz/Bitziness | src/main/scala/se/chimps/bitziness/core/endpoints/persistence/redis/endpoint/RedisEndpoint.scala | Scala | apache-2.0 | 241 |
import org.scalatest.{FlatSpec, Matchers}
import play.api.libs.json.Json
import scala.io.Source
import scala.utils.JsonFile
class SbtJsonPluginTests extends FlatSpec with Matchers {
"JSON Object with one field" should "deserialized with correct field value" in {
import my.json.models.foo._
val json = JsonF... | battermann/sbt-json | test-project/src/test/scala/SbtJsonPluginTests.scala | Scala | mit | 2,574 |
package de.choffmeister.microserviceutils.auth
import java.time.Instant
import akka.Done
import akka.http.scaladsl.model.{StatusCodes, Uri}
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.{Directive1, ExceptionHandler, Route, StandardRoute}
import akka.http.scaladsl.settings.RoutingSetti... | choffmeister/microservice-utils | microservice-utils-auth/src/main/scala/de/choffmeister/microserviceutils/auth/AuthProviderAuthorizationCodeFlow.scala | Scala | mit | 9,013 |
package dsmoq.services
/**
* データセットのアクセス権を表すケースクラス
*
* @param id ユーザID/グループID
* @param ownerType オーナー種別(@see dsmoq.persistence.OwnerType)
* @param accessLevel アクセスレベル(@see dsmoq.persistence.UserAccessLevel、GroupAccessLevel)
*/
case class DataSetAccessControlItem(id: String, ownerType: Int, accessLevel: Int)
| nkawa/dsmoq | server/apiServer/src/main/scala/dsmoq/services/DataSetAccessControlItem.scala | Scala | apache-2.0 | 400 |
# Copyright (c) 2010 Andrew Wild (akohdr@gmail.com)
# Licensed under the MIT (MIT-LICENSE.txt) licence.
package ternary;
object Primes {
implicit def bigInt2BigInteger(b: BigInt) = b.bigInteger
implicit def bigInteger2BigInt(b: java.math.BigInteger) = new BigInt(b)
def divisors(n: Int): List[Int] = for (val ... | akohdr/examples | ScalaTernary/src/ternary/Primes.scala | Scala | mit | 920 |
/*
* Copyright (c) 2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org... | mdavid/lessig-bigdata | lib/snowplow/4-storage/kinesis-elasticsearch-sink/project/BuildSettings.scala | Scala | mit | 2,275 |
/*
* Copyright 2014 – 2018 Paul Horn
*
* 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... | knutwalker/transducers-scala | tests/src/test/scala/scalax/transducers/internal/CappedEvictingQueueSpec.scala | Scala | apache-2.0 | 3,904 |
package io.dylemma.spac
package example
import cats.syntax.apply._
import io.dylemma.spac.xml.JavaxSupport._
import io.dylemma.spac.xml._
import java.time.LocalDate
import java.time.format.DateTimeFormatter
object Example_FromReadme extends App {
case class Post(date: LocalDate, author: Author, stats: Stats, body:... | dylemma/xml-spac | examples/src/main/scala/io/dylemma/spac/example/Example_FromReadme.scala | Scala | mit | 2,486 |
/*
* 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... | lresende/incubator-toree | communication/src/main/scala/org/apache/toree/communication/socket/SocketOption.scala | Scala | apache-2.0 | 2,355 |
package com.criteo.dev.cluster.s3
import com.criteo.dev.cluster.aws.AwsUtilities
import com.criteo.dev.cluster.command.SshHiveAction
import com.criteo.dev.cluster.copy.CopyUtilities
import com.criteo.dev.cluster.{Node, NodeFactory}
import org.slf4j.LoggerFactory
/**
* Attaches a given cluster to a S3 bucket, by run... | criteo/berilia | src/main/scala/com/criteo/dev/cluster/s3/RunS3DdlAction.scala | Scala | apache-2.0 | 1,537 |
/*
* 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 ... | avulanov/scalable-deeplearning | src/main/scala/scaladl/optimization/Updater.scala | Scala | apache-2.0 | 1,853 |
package net.fwbrasil.activate
import net.fwbrasil.activate.migration.Migration
import net.fwbrasil.activate.entity.EntityHelper
trait StoppableActivateContext extends ActivateContext {
var running = false
def start = synchronized {
ActivateContext.clearCaches()
running = true
Migrati... | avramirez/activate | activate-core/src/main/scala/net/fwbrasil/activate/StoppableActivateContext.scala | Scala | lgpl-2.1 | 538 |
package main.scala.projectEulerScala
import scala.collection.mutable
object LatticePaths {
val memo: mutable.Map[(Int, Int), BigInt] = mutable.HashMap()
def count(x: Int, y: Int): BigInt = {
val key = (x, y)
if (x == 0 || y == 0) {
memo(key) = 1
} else if (!memo.contains(key)) {
memo(key)... | rck109d/projectEuler | src/main/scala/projectEulerScala/LatticePaths.scala | Scala | lgpl-3.0 | 457 |
package com.olegych.scastie.client.components.editor
import codemirror.TextAreaEditor
import com.olegych.scastie.api
private[editor] case class EditorState(
editor: Option[TextAreaEditor] = None,
problemAnnotations: Map[api.Problem, Annotation] = Map(),
renderAnnotations: Map[api.Instrumentation, Annotati... | scalacenter/scastie | client/src/main/scala/com.olegych.scastie.client/components/editor/EditorState.scala | Scala | apache-2.0 | 466 |
/*
* Copyright 2017-2022 John Snow Labs
*
* 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... | JohnSnowLabs/spark-nlp | src/main/scala/com/johnsnowlabs/nlp/pretrained/ResourceMetadata.scala | Scala | apache-2.0 | 4,452 |
package shade.memcached
import internals._
import concurrent.{Future, ExecutionContext}
import net.spy.memcached.{FailureMode => SpyFailureMode, _}
import net.spy.memcached.ConnectionFactoryBuilder.{Protocol => SpyProtocol}
import net.spy.memcached.auth.{PlainCallbackHandler, AuthDescriptor}
import concurrent.duration... | kazzna/shade | src/main/scala/shade/memcached/MemcachedImpl.scala | Scala | mit | 10,416 |
package rpgboss.model
import rpgboss.lib._
import rpgboss.model.battle.BattleStatus
import rpgboss.model.battle.Hit
/**
* Because effects have different meanings in different contexts, we provide
* a way to get the validity and meaning of an effect in this context.
*/
object EffectContext extends Enumeration {
v... | DrDub/rpgboss | core/src/main/scala/rpgboss/model/Effect.scala | Scala | agpl-3.0 | 12,649 |
package composing_methods
/**
* Created by lingx on 2015/10/27.
*/
class ReplaceMethodWithMethodObject {
}
| zj-lingxin/refactoring | src/main/scala/composing_methods/ReplaceMethodWithMethodObject.scala | Scala | mit | 111 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-index-api/src/test/scala/org/locationtech/geomesa/index/InMemoryMetadata.scala | Scala | apache-2.0 | 2,081 |
package testUtils
import org.qirx.cms.Cms
import play.api.test.FakeApplication
import play.api.GlobalSettings
import play.api.mvc.Handler
import play.api.mvc.RequestHeader
import play.api.Mode
object TestApplication {
def fakeApplication(global: Option[GlobalSettings] = None) =
new FakeApplication(withGlobal =... | EECOLOR/play-cms | cms/src/test/scala/testUtils/TestApplication.scala | Scala | mit | 588 |
package mesosphere.marathon
package core.instance
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.marathon.core.condition.Condition
import mesosphere.marathon.core.pod.MesosContainer
import mesosphere.marathon.core.task.bus.MesosTaskStatusTestHelper
import mesosphere.marathon.core.task.state.{ Network... | Caerostris/marathon | src/test/scala/mesosphere/marathon/core/instance/TestTaskBuilder.scala | Scala | apache-2.0 | 21,656 |
package spark.examples
import java.util.Random
import scala.math.exp
import spark.util.Vector
import spark._
/**
* Logistic regression based classification.
*/
object SparkLR {
val N = 10000 // Number of data points
val D = 10 // Numer of dimensions
val R = 0.7 // Scaling factor
val ITERATIONS = 5
val... | koeninger/spark | examples/src/main/scala/spark/examples/SparkLR.scala | Scala | bsd-3-clause | 1,411 |
/*
* Copyright (c) 2015 Miles Sabin
*
* 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... | adelbertc/macro-compat | core/src/main/scala_2.10/macrocompat/macrocompat.scala | Scala | apache-2.0 | 2,220 |
/*§
===========================================================================
Chronos
===========================================================================
Copyright (C) 2015-2016 Gianluca Costa
===========================================================================
Licensed under the Apache Lic... | giancosta86/Chronos | src/main/scala/info/gianlucacosta/chronos/ast/expressions/Condition.scala | Scala | apache-2.0 | 1,177 |
/**
* Copyright 2009 Jorge Ortiz
*
* 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... | jorgeortiz85/scala-javautils | src/main/scala/org/scala_tools/javautils/j2s/JMutableMapWrapper.scala | Scala | apache-2.0 | 949 |
package uk.gov.gds.ier.transaction.forces.nationality
import uk.gov.gds.ier.validation.ErrorTransformForm
import uk.gov.gds.ier.step.StepTemplate
import uk.gov.gds.ier.validation.constants.NationalityConstants
import uk.gov.gds.ier.transaction.forces.InprogressForces
trait NationalityMustache extends StepTemplate[In... | michaeldfallen/ier-frontend | app/uk/gov/gds/ier/transaction/forces/nationality/NationalityMustache.scala | Scala | mit | 2,095 |
/*
* ProbQueryAlgorithm.scala
* Algorithms that compute conditional probabilities of queries.
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for informatio... | bruttenberg/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/ProbQueryAlgorithm.scala | Scala | bsd-3-clause | 4,911 |
package org.scaladebugger.api.profiles.java.info.events
import com.sun.jdi._
import com.sun.jdi.event._
import org.scaladebugger.api.lowlevel.JDIArgument
import org.scaladebugger.api.lowlevel.events.JDIEventArgument
import org.scaladebugger.api.lowlevel.requests.JDIRequestArgument
import org.scaladebugger.api.profiles... | ensime/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/profiles/java/info/events/JavaAccessWatchpointEventInfoSpec.scala | Scala | apache-2.0 | 3,800 |
/*
* 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 ... | yanboliang/spark | core/src/test/scala/org/apache/spark/util/UtilsSuite.scala | Scala | apache-2.0 | 51,198 |
package aia.testdriven
import akka.testkit.{ CallingThreadDispatcher, EventFilter, TestKit }
import akka.actor.{ Props, ActorSystem }
import com.typesafe.config.ConfigFactory
import org.scalatest.WordSpecLike
import Greeter01Test._
class Greeter01Test extends TestKit(testSystem)
with WordSpecLike
with StopSystem... | RayRoestenburg/akka-in-action | chapter-testdriven/src/test/scala/aia/testdriven/Greeter01Test.scala | Scala | mit | 939 |
/*
* Copyright (c) 2013.
* Tinkoff Credit Systems.
* All rights reserved.
*/
package ru.tcsbank.utils
import java.sql.{Timestamp, Connection, ResultSet}
import scala.collection.{immutable, mutable}
package object database {
// Simple notion of the connection pool. `Database` needn't to know more.
trait Con... | TinkoffCreditSystems/ScalaDatabase | src/main/scala/ru/tcsbank/utils/database/package.scala | Scala | mit | 7,817 |
package scredis.commands
import scredis.io.NonBlockingConnection
import scredis.protocol.Decoder
import scredis.protocol.requests.ScriptingRequests._
import scredis.serialization.{ Reader, Writer }
import scala.concurrent.Future
import scala.concurrent.duration._
/**
* This trait implements scripting commands.
*
... | rileyberton/scredis | src/main/scala/scredis/commands/ScriptingCommands.scala | Scala | apache-2.0 | 3,268 |
/*
* 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 ... | mayunSaicmotor/incubator-carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonMetastore.scala | Scala | apache-2.0 | 35,751 |
/* Copyright (C) 2008-2016 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... | Craigacp/factorie | src/main/scala/cc/factorie/model/Template2.scala | Scala | apache-2.0 | 8,566 |
package cobase.user
import javax.inject.Inject
import cobase.DBTableDefinitions
import com.mohiva.play.silhouette.api.LoginInfo
import com.mohiva.play.silhouette.api.util.PasswordInfo
import com.mohiva.play.silhouette.impl.daos.DelegableAuthInfoDAO
import play.api.db.slick.{DatabaseConfigProvider, HasDatabaseConfigPr... | Cobase/cobase-pro | app/cobase/user/PasswordInfoDAO.scala | Scala | mit | 4,254 |
package io.getquill.context.jdbc
import java.sql.{ Date, Timestamp, Types }
import java.time.{ LocalDate, LocalDateTime }
import java.util.{ Calendar, TimeZone }
import java.{ sql, util }
trait Encoders {
this: JdbcContextBase[_, _] =>
type Encoder[T] = JdbcEncoder[T]
protected val dateTimeZone = TimeZone.get... | mentegy/quill | quill-jdbc/src/main/scala/io/getquill/context/jdbc/Encoders.scala | Scala | apache-2.0 | 2,844 |
package com.twitter.finagle.memcached.unit
import com.twitter.concurrent.Broker
import com.twitter.conversions.time._
import com.twitter.finagle._
import com.twitter.finagle.memcached._
import com.twitter.finagle.service.Backoff
import com.twitter.finagle.service.exp.FailureAccrualPolicy
import com.twitter.finagle.sta... | a-manumohan/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/unit/KetamaFailureAccrualFactoryTest.scala | Scala | apache-2.0 | 6,315 |
/*
* 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 ... | vldpyatkov/ignite | modules/scalar/src/main/scala/org/apache/ignite/scalar/ScalarConversions.scala | Scala | apache-2.0 | 37,024 |
package com.github.aselab.activerecord.inner
import com.github.aselab.activerecord._
import com.github.aselab.activerecord.dsl._
import org.specs2.specification.Scope
package onetomany {
case class User(name: String) extends ActiveRecord {
val groupId: Long = 0
val otherKey: Option[Long] = None
lazy va... | xdougx/scala-activerecord | activerecord/src/test/scala/inner/OneToManyAssociationSpec.scala | Scala | mit | 5,483 |
package vault
import scalaz.stream._
import java.sql.{Connection, SQLException, PreparedStatement, ResultSet}
import scalaz._, Scalaz._, effect._, Effect._, concurrent._
import DbValue.db
import Db._
object Execute {
def list[A: ToDb, B: FromDb](sql: String, a: A): Db[List[B]] =
process[A, B](sql, a).runLog.map... | markhibberd/vault | src/main/scala/vault/Execute.scala | Scala | bsd-3-clause | 2,964 |
/*
* Copyright (c) 2016, Innoave.com
* All rights reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN... | innoave/soda | l10n/src/main/scala/com/innoave/soda/l10n/format/JavaMessageFormat.scala | Scala | apache-2.0 | 1,816 |
/*
* Copyright (c) 2013-2016 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0, and
* you may not use this file except in compliance with the Apache License
* Version 2.0. You may obtain a copy of the Apache License Version 2.0 at
* http://www.... | bigdecisions/snowplow | 2-collectors/scala-stream-collector/src/main/scala/com.snowplowanalytics.snowplow.collectors/scalastream/ScalaCollectorApp.scala | Scala | apache-2.0 | 6,820 |
/**
* Enumerate graphs based on a given set of nodes and their connectivity
*/
package uk.ac.cdrc.mintsearch.graph
import org.neo4j.graphdb.Path
import uk.ac.cdrc.mintsearch._
import uk.ac.cdrc.mintsearch.neo4j.GraphDBContext
import scala.annotation.tailrec
import scala.collection.JavaConverters._
/**
* This c... | spacelis/mint-search | neo4j-plugin/src/main/scala/uk/ac/cdrc/mintsearch/graph/SubGraphEnumeratorContext.scala | Scala | apache-2.0 | 3,178 |
/*
* 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/model/assessmentscores/AssessmentScoresAllExercisesExamples.scala | Scala | apache-2.0 | 2,477 |
package scadla.assembly
import scadla._
import squants.space.Millimeters
case class Frame(translation: Vector, orientation: Quaternion) {
def compose(f: Frame): Frame = {
val t = translation + orientation.rotate(f.translation)
val o = orientation * f.orientation //TODO is that the right order
Frame(t... | dzufferey/scadla | src/main/scala/scadla/assembly/Frame.scala | Scala | apache-2.0 | 1,249 |
object Test extends App {
def testList = {
val list = new java.util.ArrayList[Int]
list.add(1)
list.add(2)
list.add(3)
import scala.collection.JavaConverters._
val next = list.asScala ++ List(4,5,6)
assert(next != list.asScala)
val raw = list.asScala
val cloned = raw.clone
lis... | som-snytt/dotty | tests/run/t6114.scala | Scala | apache-2.0 | 1,415 |
package io.buoyant.linkerd
package protocol
import com.twitter.finagle.buoyant.linkerd.Headers
import com.twitter.finagle.http.{Method, Response, Request}
import com.twitter.finagle.stats.{InMemoryStatsReceiver, NullStatsReceiver}
import com.twitter.finagle._
import com.twitter.io.Buf
import com.twitter.util.{Future, ... | pawelprazak/linkerd | linkerd/protocol/http/src/e2e/scala/io/buoyant/linkerd/protocol/RetriesEndToEndTest.scala | Scala | apache-2.0 | 21,875 |
/*
* 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 ... | rednaxelafx/apache-spark | core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala | Scala | apache-2.0 | 41,095 |
package mr.merc.image
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.BeforeAndAfter
class MImageCacheTest extends AnyFunSuite with BeforeAndAfter {
before {
MImageCache.clear();
}
test("can load image") {
val image = MImageCache.get("/testImages/testImage.png")
assert(image.width.v... | RenualdMarch/merc | src/test/scala/mr/merc/image/MImageCacheTest.scala | Scala | gpl-3.0 | 798 |
/**
* 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... | dchenbecker/kafka-sbt | core/src/main/scala/kafka/server/RequestPurgatory.scala | Scala | apache-2.0 | 9,442 |
package temportalist.esotericraft.galvanization.common.task.ai.world
import net.minecraft.block.state.IBlockState
import net.minecraft.entity.EntityCreature
import net.minecraft.util.EnumFacing
import net.minecraft.util.EnumFacing.Axis
import net.minecraft.util.math.BlockPos
import net.minecraft.world.World
import tem... | TheTemportalist/EsoTeriCraft | src/main/scala/temportalist/esotericraft/galvanization/common/task/ai/world/TaskHarvest.scala | Scala | apache-2.0 | 3,376 |
/*§
===========================================================================
Chronos
===========================================================================
Copyright (C) 2015-2016 Gianluca Costa
===========================================================================
Licensed under the Apache Lic... | giancosta86/Chronos | src/main/scala/info/gianlucacosta/chronos/interpreter/io/ConsoleInput.scala | Scala | apache-2.0 | 1,510 |
package org.scalaide.core.quickassist
import org.junit.Test
class CreateClassTests {
import UiQuickAssistTests._
@Test
def createClassQuickFixes(): Unit = {
withQuickFixes("createclass/UsesMissingClass.scala")("Create class 'ThisClassDoesNotExist'")
}
}
| Kwestor/scala-ide | org.scala-ide.sdt.core.tests/src/org/scalaide/core/quickassist/CreateClassTests.scala | Scala | bsd-3-clause | 269 |
package dk.gp.gp
import dk.bayes.dsl.infer
import dk.bayes.dsl.variable.gaussian.multivariate.MultivariateGaussian
import dk.bayes.dsl.variable.Gaussian
import breeze.linalg.DenseMatrix
import breeze.linalg.DenseVector
import dk.gp.cov.CovFunc
import breeze.linalg.cholesky
/**
* Returns p(y) = integral of p(f)*p(y|f... | danielkorzekwa/bayes-scala-gp | src/main/scala/dk/gp/gp/GPPredictSingle.scala | Scala | bsd-2-clause | 1,261 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package scalaguide.tests
package models
// #scalatest-models
case class Role(name:String)
case class User(id: String, name: String, email:String)
// #scalatest-models
| wsargent/playframework | documentation/manual/working/scalaGuide/main/tests/code/models/User.scala | Scala | apache-2.0 | 247 |
/*
* 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 ... | bravo-zhang/spark | external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisRecordProcessor.scala | Scala | apache-2.0 | 8,427 |
package se.lu.nateko.cp.meta.ingestion.badm
import scala.concurrent.Future
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model.HttpMethods
import akka.http.scaladsl... | ICOS-Carbon-Portal/meta | src/main/scala/se/lu/nateko/cp/meta/ingestion/badm/EtcEntriesFetcher.scala | Scala | gpl-3.0 | 1,441 |
package org.dele.text.maen
import org.dele.text.maen.matchers.TMatcher
/**
* Created by jiaji on 2016-08-15.
*/
sealed trait MatchFromMagnet {
type Result = AtomSeqMatch
def apply():Result
}
object MatchFromMagnet {
implicit def fromRange(tp:(TMatchResultPool, Range, TMatcher)) = new MatchFromMagnet {
... | new2scala/text-util | maen/src/main/scala/org/dele/text/maen/MatchFromMagnet.scala | Scala | apache-2.0 | 1,218 |
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.