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 works.weave.socks.aws.orders
import com.fasterxml.jackson.annotation.JsonAutoDetect
import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.annotation.PropertyAccessor
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import... | Compositional/orders-aws | src/main/scala/works.weave.socks.aws.orders/ProjectDefaultJacksonMapper.scala | Scala | apache-2.0 | 1,142 |
/**
* Copyright 2014-2015 Martin Cooper
*
* 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 ... | martincooper/scala-datatable | src/test/scala/com/github/martincooper/datatable/DataRowSpecs/DataRowSpec.scala | Scala | apache-2.0 | 1,761 |
package freeslick.profile.utils
import slick.driver.JdbcDriver
trait FreeslickSequenceDDLBuilder {
jdbcDriver: JdbcDriver =>
def buildSeqDDL(seq: Sequence[_]): DDL = {
val b = new StringBuilder append "create sequence " append quoteIdentifier(seq.name)
seq._increment.foreach { i =>
b append " incre... | fommil/freeslick | src/main/scala/freeslick/profile/utils/FreeslickSequenceDDLBuilder.scala | Scala | lgpl-3.0 | 1,236 |
package org.kokho.scheduling.multicritical.system
import org.kokho.scheduling.{PeriodicTask, PeriodicTaskBehavior, TaskBehavior}
import org.scalatest.FlatSpec
/**
* Created with IntelliJ IDEA on 5/28/15.
* @author: Mikhail Kokho
*/
class HiCriticalTaskTestSuite extends FlatSpec with TaskBehavior with PeriodicTaskB... | mkokho/dynoslack | src/test/scala/org/kokho/scheduling/multicritical/system/HiCriticalTaskTestSuite.scala | Scala | apache-2.0 | 801 |
/*
* This file is a part of the "sur la plaque" toolkit for cycling
* data analytics and visualization.
*
* Copyright (c) 2013--2014 William C. Benton and Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You m... | willb/sur-la-plaque | analysis/src/main/scala/com/freevariable/surlaplaque/geometry/annotatable.scala | Scala | apache-2.0 | 978 |
package de.kappmeier.asnarc
import de.kappmeier.asnarc.board.{AsnarcBoard, Point}
import de.kappmeier.asnarc.render.{AsnarcJSEditorRenderer, AsnarcJSRenderer}
import de.kappmeier.asnarc.render.localization.AsnarcLocalizationDe
import org.scalajs.dom
import org.scalajs.dom.html
import scala.scalajs.js.annotation.{JSEx... | kappmeier/asnarc | src/main/scala/de/kappmeier/asnarc/AsnarcJSEditor.scala | Scala | apache-2.0 | 1,510 |
import scala.tools.partest._
import java.io.File
// used to crash with an assertion failure in flatten because the type symbol created for the missing
// package was a ClassSymbol, not a PackageClassSymbol
// - isFlattenablePrefix(vanishingPackage) was true (wrongly)
// - therefore flatten tried to flatten the cla... | felixmulder/scala | test/files/run/t8502b.scala | Scala | bsd-3-clause | 1,488 |
/*
* This software is licensed under the GNU Affero General Public License, quoted below.
*
* This file is a part of PowerAPI.
*
* Copyright (C) 2011-2016 Inria, University of Lille 1.
*
* PowerAPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public Lice... | Spirals-Team/powerapi | powerapi-core/src/main/scala/org/powerapi/core/Component.scala | Scala | agpl-3.0 | 2,650 |
/**
* Created by Mathieu Leclaire on 19/04/18.
*
* 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.
*
* This... | openmole/openmole | openmole/gui/plugins/org.openmole.gui.plugin.wizard.r/src/main/scala/org/openmole/gui/plugin/wizard/r/RWizardApiImpl.scala | Scala | agpl-3.0 | 2,062 |
import sbt._
import Keys._
object Quiet {
// Workaround sbt issue described:
//
// https://github.com/scala/scala-dev/issues/100
def silenceScalaBinaryVersionWarning = ivyConfiguration := {
ivyConfiguration.value match {
case c: InlineIvyConfiguration =>
val delegate = c.log
val log... | felixmulder/scala | project/Quiet.scala | Scala | bsd-3-clause | 1,204 |
package com.github.pedrovgs.haveaniceday.smiles
import com.github.pedrovgs.haveaniceday.smiles.model.Smile
import generators.smiles._
import extensions.futures._
import com.github.pedrovgs.haveaniceday.smiles.storage.SmilesRepository
import com.github.pedrovgs.haveaniceday.utils.model.ItemNotFound
import org.scalachec... | pedrovgs/HaveANiceDay | src/test/scala/com/github/pedrovgs/haveaniceday/smiles/GetSmileByIdSpec.scala | Scala | gpl-3.0 | 1,739 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | jmnarloch/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/javalib/ShortTest.scala | Scala | bsd-3-clause | 2,174 |
/*
* 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 ... | daewon/incubator-s2graph | s2core/src/main/scala/org/apache/s2graph/core/types/HBaseType.scala | Scala | apache-2.0 | 5,539 |
package com.arcusys.valamis.web.listener
import java.util.UUID
import com.arcusys.learn.liferay.LiferayClasses.{LBaseModelListener, LSocialActivity}
import com.arcusys.learn.liferay.LogFactoryHelper
import com.arcusys.learn.liferay.services.{CompanyHelper, UserLocalServiceHelper}
import com.arcusys.learn.liferay.util... | igor-borisov/JSCORM | valamis-portlets/src/main/scala/com/arcusys/valamis/web/listener/ActivityListener.scala | Scala | gpl-3.0 | 4,934 |
/**
* Exercise 2:
*
* Write a loop that swaps adjacent elements of an array of integers. For example
* , Array(1, 2, 3, 4, 5) becomes Array(2, 1, 4, 3, 5).
*
**/
// 1
val a = Array(1, 2, 3, 4, 5)
val result = for(i <- 0 until a.length by 2 if (i < a.length -1)) {
val temp = a(i)
a(i) = a(i + 1)
a(i + 1) = temp
}... | ragmha/scala-impatient | solutions/working-with-arrays/ex2.scala | Scala | mit | 813 |
package main.scala.org.cc.asm
import main.scala.org.cc.asm.Pos._
import main.scala.org.cc.asm.Pruner._
import scala.util.parsing.combinator.PackratParsers
import main.scala.org.cc.asm.Tokens._
import main.scala.org.cc.asm.AST._
import collection.immutable.PagedSeq
object UASMParser extends PackratParsers {
type E... | christophe-calves/alpha | src/main/scala/org/cc/asm/UASMParser.scala | Scala | gpl-3.0 | 3,429 |
/*
* 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/main/scala/com/wegtam/tensei/agent/writers/NetworkFileWriterActor.scala | Scala | agpl-3.0 | 15,719 |
package dispatch.spec
import org.scalacheck._
object RetrySpecification
extends Properties("Retry Handling")
with DispatchCleanup {
import Prop.{forAll,AnyOperators}
import Gen._
val server = {
import unfiltered.netty
import unfiltered.response._
import unfiltered.request._
object Echo extends... | maiflai/reboot | core/src/test/scala/retry.scala | Scala | lgpl-3.0 | 2,615 |
package almhirt.configuration
import scala.concurrent.duration.FiniteDuration
sealed trait RetrySettings { def pause: FiniteDuration; def infiniteLoopPause: Option[FiniteDuration] }
final case class TimeLimitedRetrySettings(pause: FiniteDuration, maxTime: FiniteDuration, infiniteLoopPause: Option[FiniteDuration]) ex... | chridou/almhirt | almhirt-common/src/main/scala/almhirt/configuration/RetrySettings.scala | Scala | apache-2.0 | 492 |
package net.rrm.ehour.ui.common.panel.multiselect
import java.{util => ju}
import com.google.common.collect.Lists
import net.rrm.ehour.domain.User
import net.rrm.ehour.ui.common.border.GreyBlueRoundedBorder
import net.rrm.ehour.ui.common.panel.AbstractBasePanel
import net.rrm.ehour.ui.common.wicket.WicketDSL._
import... | momogentoo/ehour | eHour-wicketweb/src/main/scala/net/rrm/ehour/ui/common/panel/multiselect/MultiUserSelect.scala | Scala | gpl-2.0 | 4,601 |
package play.api.libs.json.ops
import play.api.libs.json._
import scala.language.experimental.macros
import scala.reflect.macros.Context
object JsonMacroOps {
/**
* Creates a [[Format]] at compile time with Play's [[Json.format]] macro, but returns it as an [[OFormat]].
*
* [[OFormat]]s have writes that ... | jeffmay/play-json-ops | play23-json-ops/src/main/scala/play/api/libs/json/ops/JsonMacroOps.scala | Scala | apache-2.0 | 2,109 |
package aug.profile
import java.awt.Component
import java.io.File
import java.lang.Boolean
import java.util
import java.util.concurrent.PriorityBlockingQueue
import java.util.concurrent.atomic.{AtomicBoolean, AtomicLong}
import javax.swing.{BorderFactory, JSplitPane, SwingUtilities}
import aug.gui.text.{ConsoleTextAr... | austinmiller/augustmc | src/main/scala/aug/profile/Profile.scala | Scala | apache-2.0 | 15,685 |
package org.usagram.clarify.validator
import org.usagram.clarify.error.ShouldBeGreaterThanOrEqualTo
import org.scalatest._
import org.scalatest.OptionValues._
class GreaterThanOrEqualToSpec extends FunSpec {
import Matchers._
describe(".apply") {
it("returns a GreaterThanOrEqualTo with given that") {
... | takkkun/clarify | core/src/test/scala/org/usagram/clarify/validator/GreaterThanOrEqualToSpec.scala | Scala | mit | 1,581 |
/* Copyright 2009-2011 Jay Conrod
*
* This file is part of Tungsten.
*
* Tungsten 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 of
* the License, or (at your option) any late... | jayconrod/tungsten | llvm/src/main/scala/tungsten/llvm/Lexer.scala | Scala | gpl-2.0 | 6,106 |
package com.darkknight.analytics.textsummary.textmodel
/**
* Created by apple on 1/20/17.
*/
object Main {
def main(args: Array[String]): Unit = {
val stories = new CSVFileReader(args(0))
//each story --> break into sentences --> phrases
//this is a list of stories from the csv file
val corpus ... | raviguntur/TextAnalytics | src/main/scala/com/darkknight/analytics/textsummary/textmodel/Main.scala | Scala | apache-2.0 | 1,158 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this thing 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... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/ShouldBeDefinedLogicalOrImplicitSpec.scala | Scala | apache-2.0 | 13,299 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/planner/logical/steps/verifyBestPlan.scala | Scala | apache-2.0 | 4,855 |
package com.mz.training.jdbc
import java.sql.ResultSet
import akka.actor.ActorSystem
import akka.testkit.{ImplicitSender, TestKit}
import com.mz.training.common.jdbc.JDBCConnectionActor
import com.mz.training.common.jdbc.JDBCConnectionActor.{JdbcSelect, JdbcSelectResult}
import com.mz.training.common.supervisors.Data... | michalzeman/angular2-training | akka-http-server/src/test/scala/com/mz/training/jdbc/JDBCConnectionActorTest.scala | Scala | mit | 1,704 |
package repositories
import com.google.inject.Inject
import common.slick.SchemaInitializer
import models.MessageAttachmentTable
import models.MessageAttachmentTable.MessageAttachmentTable
import scala.concurrent.ExecutionContext
class MessageAttachmentSchemaInitializer @Inject()(implicit val executionContext: Execut... | sysgears/apollo-universal-starter-kit | modules/chat/server-scala/src/main/scala/repositories/MessageAttachmentSchemaInitializer.scala | Scala | mit | 528 |
package me.axiometry.blocknet.entity
trait FishingBob extends Projectile | Axiometry/Blocknet | blocknet-api/src/main/scala/me/axiometry/blocknet/entity/FishingBob.scala | Scala | bsd-2-clause | 73 |
/*
* 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/test/scala/org/apache/toree/communication/socket/JeroMQSocketSpec.scala | Scala | apache-2.0 | 2,878 |
package com.mesosphere.universe
/**
* Conforms to: https://github.com/mesosphere/universe/blob/version-2.x/repo/meta/schema/resource-schema.json
*/
case class Resource(
assets: Option[Assets] = None,
images: Option[Images] = None
)
| movicha/cosmos | cosmos-model/src/main/scala/com/mesosphere/universe/Resource.scala | Scala | apache-2.0 | 241 |
/*
* 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 ... | chenc10/Spark-PAF | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala | Scala | apache-2.0 | 30,473 |
/***********************************************************************
* 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-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/iterators/RowFilterIterator.scala | Scala | apache-2.0 | 2,899 |
package exsplay.examples.sprayactor
import akka.actor.{Props, ActorSystem}
import akka.io.IO
import spray.can.Http
import exsplay.tools.IF
/**
* User: wert
* Date: 21.07.13
* Time: 16:06
*/
object SimpleActorServer extends App {
implicit val system = ActorSystem()
val serviceActor = system.actorOf(Props[Simp... | wertlex/exsplay | examples/src/main/scala/exsplay/examples/sprayactor/SimpleActorServer.scala | Scala | apache-2.0 | 498 |
/*
We group all exceptions in a single file.
See the Scala style guide: http://docs.scala-lang.org/style/files.html
*/
package at.forsyte.apalache.tla.imp
/**
* This exception is thrown, whenever a call to SANY resulted in an error.
* For more detailed causes, see the exceptions that inherit from SanyExceptio... | konnov/apalache | tla-import/src/main/scala/at/forsyte/apalache/tla/imp/exceptions.scala | Scala | apache-2.0 | 1,101 |
package io.scrapeyard
import akka.actor._
import akka.testkit.{ImplicitSender, TestKit, TestProbe}
import io.scrapeyard.Models._
import org.joda.time.{Duration, DateTime}
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
import scala.concurrent.duration._
import scala.util.Success
class DispatcherTest... | zoltanmaric/scrapeyard | server/src/test/scala/io/scrapeyard/DispatcherTest.scala | Scala | gpl-2.0 | 4,094 |
/*
Copyright (c) 2009-2012, The 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, this lis... | cdlib/weari | src/main/scala/org/cdlib/was/weari/webgraph/Outlink.scala | Scala | bsd-3-clause | 1,742 |
package scala.tools.nsc
import org.junit.Assert._
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
@RunWith(classOf[JUnit4])
class ScriptRunnerTest {
@Test
def testEmptyScriptSucceeds: Unit = {
val s = new GenericRunnerSettings(s => ())
s.nc.value = true
s.usejavac... | felixmulder/scala | test/junit/scala/tools/nsc/ScriptRunnerTest.scala | Scala | bsd-3-clause | 523 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v3/B735.scala | Scala | apache-2.0 | 807 |
package com.madgag.git.bfg.model
import java.nio.charset.Charset
import com.madgag.git._
import com.madgag.git.bfg.cleaner._
import org.eclipse.jgit.lib.Constants.OBJ_COMMIT
import org.eclipse.jgit.lib._
import java.nio.charset.IllegalCharsetNameException
import org.eclipse.jgit.revwalk.{RevWalk, RevCommit}
/*
* Cop... | javabrett/bfg-repo-cleaner | bfg-library/src/main/scala/com/madgag/git/bfg/model/Commit.scala | Scala | gpl-3.0 | 3,086 |
package com.thoughtworks.datacommons.prepbuddy.surrogateKeyGeneration
import com.thoughtworks.datacommons.prepbuddy.SparkTestCase
import com.thoughtworks.datacommons.prepbuddy.rdds.TransformableRDD
import org.apache.spark.rdd.RDD
class SurrogateKeyGenerationTest extends SparkTestCase {
test("should add surrogate ... | data-commons/prep-buddy | src/test/scala/com/thoughtworks/datacommons/prepbuddy/surrogateKeyGeneration/SurrogateKeyGenerationTest.scala | Scala | apache-2.0 | 1,479 |
/*
* Copyright [2014] [Jason Nerothin]
*
* 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 ... | jasonnerothin/projectit | src/main/scala/com/jasonnerothin/project/hrmodel/Employee.scala | Scala | apache-2.0 | 782 |
package com.sksamuel.scapegoat.inspections.string
import com.sksamuel.scapegoat._
/**
* @author
* Zack Grannan
*/
class UnsafeStringContains
extends Inspection(
text = "Unsafe string contains",
defaultLevel = Levels.Error,
description = "Checks for String.contains(value) for invalid types."... | sksamuel/scapegoat | src/main/scala/com/sksamuel/scapegoat/inspections/string/UnsafeStringContains.scala | Scala | apache-2.0 | 1,996 |
/*
* 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/controllers/registration/deceased/DeceasedAddressDetailsUKController.scala | Scala | apache-2.0 | 4,617 |
/***********************************************************************
* 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 ... | MutahirKazmi/geomesa | geomesa-spark/geomesa-spark-core/src/main/scala/org/apache/spark/geomesa/GeoMesaSparkKryoRegistratorEndpoint.scala | Scala | apache-2.0 | 5,298 |
package ooyala.common.akka.metrics
import com.yammer.metrics.Metrics
import com.yammer.metrics.core.{Histogram, Meter, Gauge}
import java.util.concurrent.TimeUnit
/**
* Utility trait to make metrics creation slightly less verbose
*/
trait YammerMetrics {
def meter(name: String, eventType: String): Meter =
Met... | nachiketa-shukla/spark-jobserver | akka-app/src/ooyala.common.akka/metrics/YammerMetrics.scala | Scala | apache-2.0 | 651 |
import play.api.mvc.WithFilters
object Global extends WithFilters(new play.modules.statsd.api.StatsdFilter()) {
}
| relrod/fedakka | app/Global.scala | Scala | apache-2.0 | 115 |
object Const { final val VAL = 1 ; final val VAR = 2 }
import Const._
object Test {
def test(i: Int) = i match { case v @ (VAR | VAL) => v == VAR case _ => "default" }
def main(args: Array[String]): Unit = {
println(test(VAR))
println(test(VAL))
println(test(-1))
}
}
| scala/scala | test/files/run/sd455.scala | Scala | apache-2.0 | 286 |
package org.transkop.ast
import org.objectweb.asm.MethodVisitor
import org.objectweb.asm.Opcodes._
import org.transkop.SymbolTable
case class MainMethodNode(statements: List[StatementNode]) extends AbstractMethodNode {
val methodName: String = "main"
val arguments = Nil
val returnsValue = false
def generate... | dzinot/transkOP | src/main/scala/org/transkop/ast/MainMethodNode.scala | Scala | mit | 518 |
package com.example.http4s
package jetty
import javax.servlet._
import com.codahale.metrics.MetricRegistry
import org.http4s.server.ServerApp
import org.http4s.server.jetty.JettyBuilder
import org.http4s.server.metrics._
object JettyExample extends ServerApp {
val metrics = new MetricRegistry
def server(args: L... | m4dc4p/http4s | examples/jetty/src/main/scala/com/example/http4s/jetty/JettyExample.scala | Scala | apache-2.0 | 557 |
package eva4s
import language.higherKinds
package object util {
implicit class MA[M[_],A](val value: M[A]) extends AnyVal {
// ---------------------------------------------------------------------------------------------
// sorting
// -------------------------------------------------------------------... | wookietreiber/eva4s-old | core/main/scala/util/package.scala | Scala | gpl-3.0 | 2,840 |
import org.apache.spark.ml.classification.MultilayerPerceptronClassifier
import org.apache.spark.mllib.feature.StandardScalerModel
import org.apache.spark.mllib.linalg.{Vector, Vectors}
import org.apache.spark.sql.types.IntegerType
import org.apache.spark.sql.{DataFrame, SQLContext}
import org.apache.spark.{SparkConf, ... | iXeption/spark-titanic | src/test/scala/NeuralNetworkTest.scala | Scala | apache-2.0 | 2,952 |
package services.support
import akka.pattern.FutureTimeoutSupport
import org.mockito.Mockito._
import org.scalatest.{BeforeAndAfter, FunSuiteLike}
import org.specs2.mock.Mockito
import play.api.inject._
import play.api.inject.guice.GuiceApplicationBuilder
import services.EnvironmentHelper
trait TestBase extends FunSu... | phdezann/connectus | connectus-backend/test/services/support/TestBase.scala | Scala | mit | 640 |
package sylvestris.example.service
import akka.actor.{ Actor, ActorSystem, Props }
import spray.can.Http
import akka.io.IO
import scalaz.EitherT
import sylvestris._, core._, Graph._, example.model._
object boot {
def populate = {
for {
o1 <- addNode(Node[Organization](Id("org1"), Organization("Org 1")))
... | drostron/sylvestris | example/src/main/scala/sylvestris/example/service/boot.scala | Scala | mit | 1,366 |
package com.sksamuel.elastic4s.requests.searches.aggs.builders
import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory}
import com.sksamuel.elastic4s.requests.searches.aggs.{AggMetaDataFn, NestedAggregation, SubAggsBuilderFn}
object NestedAggregationBuilder {
def apply(agg: NestedAggregation): XContent... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/aggs/builders/NestedAggregationBuilder.scala | Scala | apache-2.0 | 539 |
/**********************************************************************************************************************
* This file is part of Scrupal, a Scalable Reactive Web Application Framework for Content Management *
* ... | scrupal/scrupal | scrupal-utils/src/test/scala/scrupal/utils/ClassHelpersSpec.scala | Scala | apache-2.0 | 1,914 |
package net.hasor.little.db
import java.io.{InputStreamReader, BufferedReader}
import java.net.Socket
import java.util.Map
import com.alibaba.fastjson.JSON
import org.apache.spark.storage.StorageLevel
import org.apache.spark.streaming.receiver.Receiver
import scala.collection.JavaConversions._
import scala.collection.... | zycgit/configuration | hasor-garbage/demo-all/demo-Scala/src/main/scala/net/hasor/little/db/UserDataCustomReceiver.scala | Scala | apache-2.0 | 1,920 |
import sbt._
class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
lazy val eclipse = "de.element34" % "sbt-eclipsify" % "0.6.1"
val proguard = "org.scala-tools.sbt" % "sbt-proguard-plugin" % "0.0.5"
}
| spendchart/banksync | project/plugins/Plugins.scala | Scala | apache-2.0 | 219 |
package com.pwootage.sor1k.registers
import com.pwootage.sor1k.IllegalSRStateException
/**
* Basic read-only SPR
*/
class ReadOnlySPR(val value: Int) extends SpecialPurposeRegister {
def get = value
def set(v: Int) = throw new IllegalSRStateException("Attempted to write to read-only SPR")
}
| Pwootage/sor1k | src/main/scala/com/pwootage/sor1k/registers/ReadOnlySPR.scala | Scala | mit | 301 |
/*
* Copyright (c) 2012-2017 by its authors. Some rights reserved.
* See the project homepage at: https://github.com/monix/shade
*
* Licensed under the MIT License (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy
* of the License at:
*
* https://github.co... | zaneli/shade | src/test/scala/shade/tests/InMemoryCacheVer2Suite.scala | Scala | mit | 6,006 |
package org.openurp.edu.eams.teach.program.majorapply.service
import org.beangle.security.blueprint.User
import org.openurp.edu.eams.teach.program.majorapply.exception.MajorPlanAuditException
import org.openurp.edu.eams.teach.program.majorapply.model.MajorCourseGroupModifyBean
//remove if not needed
trait MajorCours... | openurp/edu-eams-webapp | plan/src/main/scala/org/openurp/edu/eams/teach/program/majorapply/service/MajorPlanCourseGroupModifyAuditService.scala | Scala | gpl-3.0 | 495 |
package com.crealytics.spark.excel
import java.sql.Timestamp
import java.text.SimpleDateFormat
import com.norbitltd.spoiwo.natures.xlsx.Model2XlsxConversions._
import com.norbitltd.spoiwo.model._
import org.apache.hadoop.fs.{FileSystem, Path}
import org.apache.spark.sql.DataFrame
import scala.collection.JavaConverte... | 3Dragan/spark-excel | src/main/scala/com/crealytics/spark/excel/ExcelFileSaver.scala | Scala | apache-2.0 | 1,923 |
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
package com.krux.hyperion.contrib.activity.file
import java.io.{File, FilenameFilter}
impo... | realstraw/hyperion | contrib/activity/file/src/main/scala/com/krux/hyperion/contrib/activity/file/RepartitionFile.scala | Scala | bsd-3-clause | 9,121 |
package com.stovokor.editor.state
import com.jme3.app.Application
import com.jme3.app.state.AppState
import com.jme3.app.state.AppStateManager
import com.jme3.scene.Spatial.CullHint
import com.stovokor.util.EditModeSwitch
import com.stovokor.util.EditorEvent
import com.stovokor.util.EditorEventListener
import com.stov... | jcfandino/leveleditor | src/main/scala/com/stovokor/editor/state/Edit2DModeState.scala | Scala | bsd-3-clause | 4,838 |
package org.elastic.rest.scala.driver.json.tests
import io.circe._
import io.circe.parser.parse
import org.elastic.rest.scala.driver.RestBase
import org.elastic.rest.scala.driver.RestBase._
import org.elastic.rest.scala.driver.RestBaseImplicits._
import org.elastic.rest.scala.driver.RestResources._
import org.... | Alex-At-Home/rest_client_library | rest_json_circe_module/shared/src/test/scala/org/elastic/rest/scala/driver/json/tests/CirceTypeModuleTests.scala | Scala | apache-2.0 | 4,630 |
package org.lanyard.dist.cont
import org.lanyard._
import org.lanyard.dist.Distribution
import org.lanyard.random.RNG
import org.lanyard.util.LogGamma
/** The beta distribution is a continuous probability distribution. It
* is defined over the range [0,1] so it distributes other
* probabilities.
*
* @constru... | perian/Lanyard | src/main/scala/org/lanyard/dist/cont/Beta.scala | Scala | gpl-2.0 | 2,354 |
/*
* Copyright 2017 PayPal
*
* 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 writin... | paypal/squbs | squbs-admin/src/main/scala/org/squbs/admin/AdminSvc.scala | Scala | apache-2.0 | 2,518 |
package com.typesafe.akka.http.benchmark.handlers
import akka.http.scaladsl.server.Directives._
import com.typesafe.akka.http.benchmark.Infrastructure
import com.typesafe.akka.http.benchmark.datastore.DataStore
import com.typesafe.akka.http.benchmark.entity.World
import com.typesafe.akka.http.benchmark.util.RandomGene... | actframework/FrameworkBenchmarks | frameworks/Scala/akka-http/src/main/scala/com/typesafe/akka/http/benchmark/handlers/UpdatesHandler.scala | Scala | bsd-3-clause | 1,227 |
package mesosphere.marathon.core.task.tracker.impl
import akka.actor.{ Status, ActorRef }
import akka.event.EventStream
import akka.testkit.TestProbe
import com.codahale.metrics.MetricRegistry
import com.google.inject.Provider
import mesosphere.marathon.core.CoreGuiceModule
import mesosphere.marathon.core.launchqueue.... | ss75710541/marathon | src/test/scala/mesosphere/marathon/core/task/tracker/impl/TaskOpProcessorImplTest.scala | Scala | apache-2.0 | 19,761 |
package com.optrak.testakka.impl
import com.lightbend.lagom.scaladsl.server.LocalServiceLocator
import com.lightbend.lagom.scaladsl.testkit.ServiceTest
import com.optrak.testakka.api.{GreetingMessage, PersistentService}
import org.scalatest.{AsyncWordSpec, BeforeAndAfterAll, Matchers}
class PersistentServiceSpec exte... | Optrak/lagom-testbed | test-akka-integration/persistent/impl/src/test/scala/com/optrak/testakka/impl/PersistentServiceSpec.scala | Scala | apache-2.0 | 684 |
/*
* 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/nisp-frontend | app/uk/gov/hmrc/nisp/services/NationalInsuranceService.scala | Scala | apache-2.0 | 2,447 |
import scala.quoted.*
opaque type EmailAddress = String
object EmailAddress extends EmailAddressOps[EmailAddress]:
given (using s: ToExpr[String]): ToExpr[EmailAddress] = s
def parse(s: String): Either[String, EmailAddress] =
if (s contains "@") Right(s)
else Left("No @ symbol")
| dotty-staging/dotty | tests/run/opaque-inline/EmailAddress.scala | Scala | apache-2.0 | 295 |
package org.pfcoperez.dailyalgorithm.applications
import scala.collection.immutable.Queue
import org.pfcoperez.dailyalgorithm.datastructures.graphs.directed.trees.binary._
object BFSAndApps extends App {
/**
* Level in-order traversal: First last level, from left to right,...
* ... then second to last, from ... | pfcoperez/algorithmaday | src/main/scala/org/pfcoperez/dailyalgorithm/applications/BFSAndApps.scala | Scala | gpl-3.0 | 1,833 |
/*
* Copyright 2012 Eike Kettner
*
* 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... | eikek/publet | scalate/src/main/scala/org/eknet/publet/engine/scalate/ScalateEngine.scala | Scala | apache-2.0 | 1,568 |
package howitworks.cats
import cats.Id
import cats.data.{Reader, ReaderT}
class ReaderDemo extends wp.Spec {
"hello reader" in {
//Let's say there are some functions from
// f: String => Whatever
val size: String => Int = _.size
val ovalLettersCount: String => Int = _.count(List('q', 'Q', 'o', '... | jawp/wicked-playground | modules/server/src/test/scala/howitworks/cats/ReaderDemo.scala | Scala | mit | 2,519 |
/*
* 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 ... | minixalpha/spark | mllib/src/test/scala/org/apache/spark/ml/feature/MinMaxScalerSuite.scala | Scala | apache-2.0 | 4,353 |
package com.blockcypher.api.events
import com.blockcypher.api.config.{BlockCypherTestNet, ActorSystemConfig}
import com.blockcypher.api.util.TestUtil
import org.scalacoin.protocol.BitcoinAddress
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.{FlatSpec, MustMatchers}
import scala.concurrent.Future
i... | Christewart/blockcypher-api | src/test/scala/com/blockcypher/api/events/BlockCypherEventApiTest.scala | Scala | mit | 3,483 |
import java.{util, io}
import java.text.SimpleDateFormat
import java.util.{Calendar, Properties}
import kafka.serializer.StringDecoder
import scala.collection.mutable.ArrayBuffer
import scala.util.matching.Regex
//import SQLContextSingleton
import com.typesafe.config.ConfigFactory
import kafka.producer.{KeyedMessage... | faganpe/KafkaStreamingPOC | src/main/scala/SparkStreamingNetflow.scala | Scala | apache-2.0 | 22,928 |
package controllers
import org.specs2.specification.Scope
import org.specs2.matcher.JsonMatchers
import play.api.mvc.Result
import scala.concurrent.Future
import controllers.auth.AuthorizedRequest
import controllers.backend.{DocumentNodeBackend,SelectionBackend}
import models.InMemorySelection
class DocumentNodeCont... | overview/overview-server | web/test/controllers/DocumentNodeControllerSpec.scala | Scala | agpl-3.0 | 2,449 |
/*
* Copyright (c) 2014 - 2015 Contributor. All rights reserved.
*/
package org.scalaide.debug.internal.expression
package proxies.phases
import Names.Debugger
import scala.reflect.NameTransformer
import scala.reflect.runtime.universe
import scala.util.Success
import org.scalaide.debug.internal.expression.Names.De... | Kwestor/scala-ide | org.scala-ide.sdt.debug.expression/src/org/scalaide/debug/internal/expression/proxies/phases/MockPrimitivesOperations.scala | Scala | bsd-3-clause | 3,085 |
/*
* Copyright (c) 2011-2012, Alex McGuire, Louis Botterill
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, th... | syl20bnr/maker | utils/src/maker/utils/os/OsUtils.scala | Scala | bsd-2-clause | 1,789 |
package akka.persistence.cassandra.journal
import java.util.concurrent.Executors
import akka.actor.{ActorRef, ActorSystem, PoisonPill, Props}
import akka.persistence._
import akka.persistence.cassandra.{CassandraLifecycle, CassandraPluginConfig}
import akka.testkit.{ImplicitSender, TestKit}
import com.datastax.driver... | jparkie/akka-persistence-cassandra | src/test/scala/akka/persistence/cassandra/journal/CassandraConfigCheckerSpec.scala | Scala | apache-2.0 | 5,749 |
package at.logic.gapt.provers.maxsat
import at.logic.gapt.proofs.resolution.FClause
/**
* Created by frain on 3/31/15.
*/
class ToySAT extends MaxSATSolverBinary {
def format() = Format.ToySAT
def noBinaryWarn() = "Please put the toysat binary (available at https://github.com/msakai/toysolver) into PATH"
def ... | gisellemnr/gapt | src/main/scala/at/logic/gapt/provers/maxsat/ToySAT.scala | Scala | gpl-3.0 | 501 |
/*
* 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 ... | darionyaphet/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/ConsoleWriteSupportSuite.scala | Scala | apache-2.0 | 4,263 |
package java.nio
private[nio] final class HeapByteBufferDoubleView private (
_capacity: Int,
override private[nio] val _byteArray: Array[Byte],
override private[nio] val _byteArrayOffset: Int,
_initialPosition: Int, _initialLimit: Int,
_readOnly: Boolean, override private[nio] val isBigEndian: Bool... | colinrgodsey/scala-js | javalib/src/main/scala/java/nio/HeapByteBufferDoubleView.scala | Scala | bsd-3-clause | 2,689 |
/* sbt -- Simple Build Tool
* Copyright 2009, 2010, 2011 Mark Harrah
*/
package xsbt.boot
import Pre._
import java.io.{File, FileFilter}
import java.net.{URL, URLClassLoader}
import java.util.concurrent.Callable
trait Provider
{
def configuration: UpdateConfiguration
def baseDirectories: List[File]
def testLoadC... | kuochaoyi/xsbt | launch/Provider.scala | Scala | bsd-3-clause | 2,657 |
package applicant.etl
import applicant.nlp._
import applicant.ml.score._
import applicant.ml.regression._
import java.text.DecimalFormat
import java.net.{URL, HttpURLConnection}
import scala.io._
import scala.util._
import scala.collection.mutable.{ListBuffer, Map, LinkedHashMap}
import org.apache.spark.mllib.feature.... | dataworks/internship-2016 | etl/src/scala/applicant/etl/ApplicantData.scala | Scala | apache-2.0 | 10,151 |
package jp.opap.material.resource
import java.util.UUID
import akka.Done
import akka.actor.ActorRef
import akka.http.scaladsl.marshalling.sse.EventStreamMarshalling.toEventStream
import akka.http.scaladsl.model.HttpMethods._
import akka.http.scaladsl.model.sse.ServerSentEvent
import akka.http.scaladsl.model.{HttpEnti... | opap-jp/material-explorer | rest/src/main/scala/jp/opap/material/resource/AppResources.scala | Scala | mit | 3,575 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | tzulitai/flink | flink-streaming-scala/src/test/scala/org/apache/flink/streaming/api/scala/CoGroupedStreamsTest.scala | Scala | apache-2.0 | 1,816 |
package scwebapp.header
import scutil.core.implicits.*
import scwebapp.HeaderType
// TODO not typesafe
object CacheControl extends HeaderType[CacheControl] {
val key = "Cache-Control"
def parse(it:String):Option[CacheControl] =
Some(CacheControl(it splitAroundChar ','))
def unparse(it:CacheControl):String =
... | ritschwumm/scwebapp | modules/core/src/main/scala/scwebapp/header/CacheControl.scala | Scala | bsd-2-clause | 407 |
package skidbladnir
import scala.collection.mutable.{Map => MutMap}
trait Assembly {
//Fields
private val runtime = new Runtime
//Components construction
implicit def C2NB (b:Base):NB = {new NB(b)}
protected final class NB(val b:Base) {
def named(n:String) = {
runtime.newStaticBase(b, n)
} ... | AlexCAB/CompoDev | skidbladnir/Assembly.scala | Scala | mit | 2,710 |
package scalaz.stream.mongodb.userguide
import org.specs2.Specification
import scalaz.stream.mongodb.aggregate.{PipelineSpec, MapReduceSpec, BasicAggregationSpec}
class AggregationUsageSpec extends Specification{
def is =
s2"""
${"Aggregation framework".title}
Mongo Streams has support for... | Spinoco/scalaz-stream-mongodb | core/src/test/scala/scalaz/stream/mongodb/userguide/AggregationUsageSpec.scala | Scala | mit | 1,208 |
package engine
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import play.modules.reactivemongo.ReactiveMongoPlugin
import reactivemongo.api._
import reactivemongo.api.collections.default.BSONCollectionProducer
import reactivemongo.bson._
import play.api.Play.current
import... | dohzya/Hackinder | app/engine/Projects.scala | Scala | agpl-3.0 | 3,028 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | tzulitai/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/StreamTableEnvironmentTest.scala | Scala | apache-2.0 | 14,761 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2006-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://www.scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/collection/convert/WrapAsJava.scala | Scala | bsd-3-clause | 12,844 |
package com.cds.learnscala.test.numeric
import org.slf4j.{Logger, LoggerFactory}
import scala.collection.mutable.ArrayBuffer
object NumericTest {
def OptionTest(option: Option[Long]) = {
if (option.isEmpty) {
None
}
option match {
case None => None
case Some(_) => None
}
}
... | anancds/scala-project | learn-scala/src/main/scala/com/cds/learnscala/test/numeric/NumericTest.scala | Scala | mit | 1,027 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2007-2014, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | SethTisue/scala-swing | examples/src/main/scala/scala/swing/examples/ColorChooserDemo.scala | Scala | bsd-3-clause | 2,112 |
package org.machine.engine.graph
import org.scalatest._
import org.scalatest.mock._
import java.io.File;
import java.io.IOException;
import org.neo4j.graphdb._
import org.neo4j.graphdb.factory.GraphDatabaseFactory
import org.neo4j.io.fs.FileUtils
import org.machine.engine.Engine
import org.machine.engine.TestUtils
i... | sholloway/graph-engine | src/test/scala/org/machine/engine/graph/EngineStatementBuilderSpec.scala | Scala | mit | 2,024 |
/*
* Copyright 2017 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | pncampbell/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC135.scala | Scala | apache-2.0 | 1,120 |
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.