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 |
|---|---|---|---|---|---|
object Test {
def main(args: Array[String]): Unit = {
new Foo().foo
new Bar().bar
new Bar().bar2
new Baz().baz
}
}
class Foo {
def foo: Unit = {
object Inner {
println(this.getClass)
}
Inner
}
}
class Bar {
def bar: Unit = {
object Inner {
println(this.getClass)
... | lampepfl/dotty | tests/run/i2964d.scala | Scala | apache-2.0 | 533 |
package example
/**
* Created by akhil on 8/18/15.
*/
import spray.routing.HttpService
import scala.concurrent.duration._
import akka.io.Tcp
import akka.actor._
import spray.http._
import MediaTypes._
import HttpMethods._
trait DemoRoute extends HttpService {
val demoRoute = {
path("ping") {
complete... | akhil/spray-servlet | src/main/scala/example/DemoService.scala | Scala | gpl-2.0 | 1,113 |
package com.twitter.zipkin.common.json
import com.codahale.jerkson.Json
import org.codehaus.jackson.map.annotate.JsonCachable
import com.fasterxml.jackson.databind.{SerializerProvider, JsonSerializer}
import com.fasterxml.jackson.core.{JsonGenerator=>JacksonGenerator}
import com.fasterxml.jackson.databind.module.Simpl... | AnSavvides/zipkin | zipkin-web/src/main/scala/com/twitter/zipkin/common/json/ZipkinJson.scala | Scala | apache-2.0 | 1,218 |
package product.simulations
import io.gatling.core.Predef._
import utils.Configurations
/**
* Created by os-desislava.slavova on 25/09/2015.
*/
class deleteProductShopCategoriesSimulation extends Simulation{
val config= new Configurations
val scn = scenario("Delete Product Shop Categories").exec(Actions.deleteProdu... | desislavaSlavova/Open-Api | src/test/scala/product/simulations/deleteProductShopCategoriesSimulation.scala | Scala | mit | 395 |
package info.pot420.lucene
//import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer
import org.apache.lucene.document.Document
import org.apache.lucene.document.Field
//import org.apache.lucene.document.LongField;
import org.apache.lucene.document.StringField
import or... | Ervii/garage-time | pajamas/taste/lucene/src/main/scala/info/pot420/lucene/Lunar.scala | Scala | apache-2.0 | 1,562 |
/*
Copyright 2014 Twitter, 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 in writing, software... | twitter/summingbird | summingbird-core/src/main/scala/com/twitter/summingbird/planner/ComposedFunctions.scala | Scala | apache-2.0 | 5,066 |
package mesosphere.marathon.api.v2
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.marathon.api.{ JsonTestHelper, TaskKiller }
import mesosphere.marathon.api.v2.json.Formats._
import mesosphere.marathon.core.appinfo.EnrichedTask
import mesosphere.marathon.health.HealthCheckManager
import mesosphere.ma... | Yhgenomics/marathon | src/test/scala/mesosphere/marathon/api/v2/AppTasksResourceTest.scala | Scala | apache-2.0 | 4,498 |
package gitbucket.core.servlet
import java.io.{File, FileOutputStream}
import akka.event.Logging
import com.typesafe.config.ConfigFactory
import gitbucket.core.GitBucketCoreModule
import gitbucket.core.plugin.{PluginRegistry, PluginRepository}
import gitbucket.core.service.{ActivityService, SystemSettingsService}
imp... | gencer/gitbucket | src/main/scala/gitbucket/core/servlet/InitializeListener.scala | Scala | apache-2.0 | 7,026 |
package ui.widgets
import japgolly.scalajs.react.vdom.prefix_<^._
import japgolly.scalajs.react.{BackendScope, ReactComponentB}
import org.scalajs.jquery.jQuery
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
object Button {
case class State(running: Boolean = false)
ca... | felixgborrego/simple-docker-ui | src/main/scala/ui/widgets/Button.scala | Scala | mit | 2,150 |
package com.anchortab.constantcontact.model
import net.liftweb._
import json._
import ext._
import Extraction._
import JsonDSL._
import util._
import Helpers._
import org.joda.time._
import com.anchortab.constantcontact.ConstantContact
object Contacts {
import ContactLists._
implicit val fo... | farmdawgnation/anchortab | src/main/scala/com/anchortab/constantcontact/model/Contact.scala | Scala | apache-2.0 | 6,640 |
//https://www.hackerrank.com/challenges/remove-duplicates
object RemoveDuplicates extends App {
val line = io.StdIn.readLine
println(line.distinct)
// other options:
//line.toSet.mkString
//scala.collection.mutable.SortedSet[Char]()
//line.foldLeft[List[Char]] (List.empty) { (list, current) => { i... | flopezlasanta/hackerrank | src/functional_programming/adhoc/RemoveDuplicates.scala | Scala | mit | 402 |
package opennlp.scalabha.classify
import scala.collection.mutable.{ Map => MMap }
import org.apache.commons.logging.LogFactory
import opennlp.scalabha.util.CollectionUtils._
import opennlp.scalabha.util.CollectionUtil._
import opennlp.scalabha.util.LogNum._
trait ClassifierEvaluator[L, T] {
def apply(classifier: ... | eponvert/Scalabha | src/main/scala/opennlp/scalabha/classify/ClassifierEvaluator.scala | Scala | apache-2.0 | 2,283 |
/*
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | danielcsant/sparta | serving-core/src/main/scala/com/stratio/sparta/serving/core/helpers/ResourceManagerLink.scala | Scala | apache-2.0 | 2,711 |
package gitbucket.core.controller
import java.io.{File, FileInputStream, FileOutputStream}
import scala.util.Using
import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
import gitbucket.core.repo.html
import gitbucket.core.helper
import gitbucket.core.model.activity.DeleteBranchInfo
import gitbucket.core... | gitbucket/gitbucket | src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala | Scala | apache-2.0 | 51,769 |
/*
* 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 ... | ueshin/apache-spark | sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowNamespacesParserSuite.scala | Scala | apache-2.0 | 2,598 |
/*
* The MIT License (MIT)
*
* Copyright (C) 2012 47 Degrees, LLC http://47deg.com hello@47deg.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 with... | 47deg/mvessel | core/src/test/scala/com/fortysevendeg/mvessel/resultset/ResultSetSpec.scala | Scala | mit | 15,334 |
/**
* Copyright (c) 2013, The National Archives <digitalpreservation@nationalarchives.gov.uk>
* http://www.nationalarchives.gov.uk
*
* 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://mozi... | digital-preservation/dali | src/main/scala/uk/gov/tna/dri/preingest/loader/auth/BasicAuthenticationSupport.scala | Scala | mpl-2.0 | 959 |
package com.joescii
import java.io.{BufferedReader, InputStream, InputStreamReader}
import scala.util.Try
object Solution extends App {
def parseInput(is: InputStream): Option[List[(String, String)]] = Try {
val r = new BufferedReader(new InputStreamReader(is))
val lines = Iterator.continually(r.readLine()... | joescii/hackerrank-palindrome | src/main/scala/Solution.scala | Scala | apache-2.0 | 1,353 |
/***********************************************************************
* 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 ... | mcharles/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/iterators/AttributeIndexIteratorTest.scala | Scala | apache-2.0 | 14,611 |
package se.gigurra.dcs.remote.dcsclient
import java.net.InetSocketAddress
import akka.actor._
import akka.io.Tcp._
import akka.io.{IO, Tcp}
import akka.util.ByteString
import com.fasterxml.jackson.core.{JsonFactory, JsonToken}
import com.twitter.io.Buf
import se.gigurra.serviceutils.json.JSON
import se.gig... | GiGurra/dcs-remote2 | src/main/scala/se/gigurra/dcs/remote/dcsclient/AkkaTcpClient.scala | Scala | mit | 4,158 |
package org.http4s
package server
package tomcat
import cats.effect.IO
import org.apache.catalina.webresources.TomcatURLStreamHandlerFactory
class TomcatServerSpec extends {
// Prevents us from loading jar and war URLs, but lets us
// run Tomcat twice in the same JVM. This makes me grumpy.
//
// Needs to run... | reactormonk/http4s | tomcat/src/test/scala/org/http4s/tomcat/TomcatServerSpec.scala | Scala | apache-2.0 | 511 |
package de.choffmeister.secpwd
import java.util.UUID
import de.choffmeister.secpwd.utils.RichFile._
import de.choffmeister.secpwd.utils.Clipboard
import de.choffmeister.secpwd.security.PasswordUtils
import de.choffmeister.securestring.SecureString
import de.choffmeister.secpwd.security.PasswordCharacters
import java.u... | choffmeister/secpwd | src/main/scala/de/choffmeister/secpwd/Commands.scala | Scala | apache-2.0 | 10,429 |
package interretis.advanced.mlib
import interretis.utils.SparkContextBuilder._
import interretis.utils.Resources
import org.apache.spark.mllib.recommendation.Rating
import org.apache.spark.mllib.recommendation.ALS
import scala.io.Source
import language.postfixOps
import org.apache.spark.SparkContext
import org.apache.... | MarekDudek/spark-certification | src/main/scala/interretis/advanced/mlib/MovieRatings.scala | Scala | mit | 5,593 |
/*
* Copyright 2015 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... | scottcutts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/CP283.scala | Scala | apache-2.0 | 1,562 |
package play.sockjs.core.json
import akka.util.{ByteString, ByteStringBuilder}
import com.fasterxml.jackson.core.json.JsonWriteFeature
import com.fasterxml.jackson.core.{JsonEncoding, JsonFactory, JsonGenerator}
import play.sockjs.api.Frame._
private[sockjs] object JsonByteStringEncoder {
private val jsonFactory... | fdimuccio/play2-sockjs | src/main/scala/play/sockjs/core/json/JsonByteStringEncoder.scala | Scala | apache-2.0 | 1,244 |
package com.arcusys.learn.quiz.storage.impl.liferay
import com.arcusys.learn.storage.impl.KeyedEntityStorage
import com.arcusys.learn.persistence.liferay.service.LFQuizTreeElementLocalServiceUtil
import com.arcusys.learn.persistence.liferay.model.LFQuizTreeElement
import com.arcusys.valamis.quiz.model.QuizTreeElement
... | ViLPy/Valamis | learn-persistence-liferay-wrapper/src/main/scala/com/arcusys/learn/quiz/storage/impl/liferay/LFQuizTreeStorageImpl.scala | Scala | lgpl-3.0 | 3,860 |
/*
* Copyright 2017 Workday, Inc.
*
* This software is available under the MIT license.
* Please see the LICENSE.txt file in this project.
*/
package com.workday.esclient
import java.io.StringWriter
import java.lang.reflect.{ParameterizedType, Type}
import com.fasterxml.jackson.core.`type`.TypeReference
import ... | Workday/escalar | src/main/scala/com/workday/esclient/JsonUtils.scala | Scala | mit | 3,364 |
package com.twitter.finagle.exp
import com.twitter.conversions.time._
import com.twitter.util.{Duration, Time, Stopwatch}
import org.junit.runner.RunWith
import org.scalatest.{Matchers, FunSuite}
import org.scalatest.junit.JUnitRunner
import scala.util.Random
@RunWith(classOf[JUnitRunner])
class LatencyHistogramTest ... | rojanu/finagle | finagle-exp/src/test/scala/com/twitter/finagle/exp/LatencyHistogramTest.scala | Scala | apache-2.0 | 3,156 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/ ... | S-Mach/s_mach.concurrent | src/test/scala/s_mach/concurrent/ScheduledExecutionContextTest.scala | Scala | mit | 9,960 |
package com.datawizards.sparklocal.rdd.pair
import com.datawizards.sparklocal.SparkLocalBaseTest
import com.datawizards.sparklocal.rdd.RDDAPI
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class KeysValuesTest extends SparkLocalBaseTest {
test("Keys result") {... | piotr-kalanski/spark-local | src/test/scala/com/datawizards/sparklocal/rdd/pair/KeysValuesTest.scala | Scala | apache-2.0 | 804 |
package io.github.mandar2812.dynaml.kernels
import breeze.linalg.{DenseMatrix, norm, DenseVector}
/**
* Implementation of the Normalized Exponential Kernel
*
* K(x,y) = exp(beta*(x.y))
*/
class LaplacianKernel(be: Double = 1.0)
extends SVMKernel[DenseMatrix[Double]]
with LocalSVMKernel[DenseVector[Double]]
... | sisirkoppaka/bayeslearn | src/main/scala/io/github/mandar2812/dynaml/kernels/LaplacianKernel.scala | Scala | apache-2.0 | 1,324 |
package controllers.s_employment
import org.specs2.mutable._
import utils.WithBrowser
import controllers.ClaimScenarioFactory
import utils.pageobjects.s_employment._
import utils.pageobjects.PageObjects
import utils.pageobjects.your_income.GYourIncomePage
class GPensionAndExpensesIntegrationSpec extends Specification... | Department-for-Work-and-Pensions/ClaimCapture | c3/test/controllers/s_employment/GPensionAndExpensesIntegrationSpec.scala | Scala | mit | 1,163 |
package es.weso.rdf.validator.jena
import org.apache.jena.rdf.model.Model
import es.weso.rdf.jena.RDFAsJenaModel
import es.weso.shex._
import es.weso.rdf.validator._
import es.weso.rdf.nodes._
import util._
/**
* JenaValidator. Validator based on Jena
*
*/
object JenaValidator {
/**
* Creates an RDFValida... | labra/ShExcala | src/main/scala/es/weso/rdf/validator/jena/JenaValidator.scala | Scala | mit | 786 |
package eu.timepit.refined.pureconfig
import com.typesafe.config.{ConfigOriginFactory, ConfigValueType}
import eu.timepit.refined.types.numeric.PosInt
import org.scalacheck.Prop._
import org.scalacheck.Properties
import pureconfig._
import pureconfig.error.{CannotConvert, ConfigReaderFailures, ConvertFailure, WrongTyp... | fthomas/refined | modules/pureconfig/shared/src/test/scala/eu/timepit/refined/pureconfig/RefTypeConfigConvertSpec.scala | Scala | mit | 2,570 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/test/scala/org/apache/spark/JobCancellationSuite.scala | Scala | apache-2.0 | 10,312 |
/* Code Pulse: a real-time code coverage tool, for more information, see <http://code-pulse.com/>
*
* Copyright (C) 2014-2017 Code Dx, Inc. <https://codedx.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 ... | secdec/codepulse | hq/src/test/scala/com/secdec/bytefrog/hq/connect/test/ClientGreeterSpec.scala | Scala | apache-2.0 | 10,916 |
package margn.compiler
class CompileError(msg: String) extends Error(msg)
| chatsftd/margn | src/main/scala/margn/compiler/CompileError.scala | Scala | gpl-2.0 | 75 |
package com.twitter.finagle.http.filter
import com.twitter.finagle.Service
import com.twitter.finagle.http.{MediaType, Method, Request, Response, Status}
import com.twitter.util.{Await, Future}
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitR... | koshelev/finagle | finagle-http/src/test/scala/com/twitter/finagle/http/filter/JsonpFilterTest.scala | Scala | apache-2.0 | 2,048 |
package org.jetbrains.jps.incremental.scala.remote.play
import java.io._
import java.util.concurrent.{Executors, Future}
/**
* User: Dmitry.Naydanov
* Date: 12.02.15.
*/
class LocalSbtWatcherExec extends SbtWatcherExec {
private val myExecutor = Executors.newSingleThreadExecutor()
private var descriptor: Optio... | triplequote/intellij-scala | scala/compiler-shared/src/org/jetbrains/jps/incremental/scala/remote/play/LocalSbtWatcherExec.scala | Scala | apache-2.0 | 2,670 |
package net.rrm.ehour.ui.common.header
import net.rrm.ehour.ui.common.panel.AbstractBasePanel
import net.rrm.ehour.ui.common.session.EhourWebSession
import net.rrm.ehour.ui.common.util.AuthUtil
import net.rrm.ehour.ui.login.page.Logout
import net.rrm.ehour.ui.userprefs.page.UserPreferencePage
import org.apache.wicket.... | momogentoo/ehour | eHour-wicketweb/src/main/scala/net/rrm/ehour/ui/common/header/LoggedInAsPanel.scala | Scala | gpl-2.0 | 1,850 |
/*
* 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 | core/src/test/scala/org/apache/spark/util/ClosureCleanerSuite.scala | Scala | apache-2.0 | 16,671 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/test/scala/com/waz/model/MessageDataDaoSpec.scala | Scala | gpl-3.0 | 3,634 |
/*
* 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 ... | debugger87/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala | Scala | apache-2.0 | 33,083 |
package mesosphere.marathon
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.fge.jackson.JsonLoader
import com.github.fge.jsonschema.main.JsonSchemaFactory
import mesosphere.marathon.api.v2.json.V2AppDefinition
import mesosphere.marathon.state.AppDefinition
import mesosphere.marathon.state.PathId._... | spacejam/marathon | src/test/scala/mesosphere/marathon/MarathonTestHelper.scala | Scala | apache-2.0 | 4,798 |
/* Copyright 2017-18, Emmanouil Antonios Platanios. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | eaplatanios/tensorflow | tensorflow/scala/api/src/main/scala/org/platanios/tensorflow/api/learn/Counter.scala | Scala | apache-2.0 | 4,500 |
import sbt._
import sbt.Keys._
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
/**
* Defines settings for the projects:
*/
object Settings {
object versions {
val akka = "2.4.1"
val akkaHttp = "1.0"
val autowire = "0.2.5"
val sigarLoader = "1.6.6-rev002"
val akkaLog4j = "0.2.0"
va... | boldradius/cluster-console | project/Settings.scala | Scala | bsd-3-clause | 4,463 |
/*
* 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 ... | manuzhang/incubator-gearpump | core/src/main/scala/org/apache/gearpump/util/Util.scala | Scala | apache-2.0 | 6,146 |
import leon.lang._
import leon.collection._
import leon.lang.synthesis._
object Diffs {
def diffs(l: List[BigInt]): List[BigInt] =
choose((res: List[BigInt]) =>
res.size == l.size && undiff(res) == l
)
def undiff(l: List[BigInt]) = {
l.scanLeft(BigInt(0))(_ + _).tail
}
}
| regb/leon | testcases/synthesis/current/Diffs/Diffs.scala | Scala | gpl-3.0 | 303 |
package com.ilunin.disconsul.http
import scala.concurrent.Future
trait HttpClient {
val host = "localhost"
val port = 8500
def get(path: String): Future[HttpResponse]
}
| ddelautre/disconsul | src/main/scala/com/ilunin/disconsul/http/HttpClient.scala | Scala | mit | 180 |
package beyond.route
object RoutingTableConfig {
val RoutingTablePath: String = "/routing-table"
}
| SollmoStudio/beyond | core/app/beyond/route/RoutingTableConfig.scala | Scala | apache-2.0 | 102 |
package deburnat.transade.gui.components
import swing.{TextArea, TextField}
import java.awt.Color
import deburnat.transade.gui.admins.GuiAdmin.monoFont
/**
* Project name: transade
* @author Patrick Meppe (tapmeppe@gmail.com)
* Description:
* An algorithm for the transfer of selected/adapted data
* from one r... | deburnatshazem/transade | gui/src/main/scala/deburnat/transade/gui/components/TextGuis.scala | Scala | apache-2.0 | 1,043 |
import com.amazonaws.auth.InstanceProfileCredentialsProvider
import ohnosequences.sbt.SbtS3Resolver
import ohnosequences.sbt.SbtS3Resolver._
import sbt._
import Keys._
import sbtassembly.Plugin._
import AssemblyKeys._
import com.typesafe.sbt.SbtScalariform._
import net.virtualvoid.sbt.graph.Plugin.graphSettings
import ... | EasonYi/marathon | project/build.scala | Scala | apache-2.0 | 12,467 |
/**
* 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"); yo... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/test/scala/unit/kafka/admin/TestAdminUtils.scala | Scala | apache-2.0 | 1,493 |
package org.unisonweb
/*
A tutorial explaining how the Unison runtime works.
We will start with very simple examples of compilers
based on partial evaluation, and work up to the more
complicated representation used in the actual Unison
runtime.
Good background on compilation via partial evaluation
is this Scala World... | paulp/unison | runtime-jvm/main/src/test/scala/RuntimeTutorial.scala | Scala | mit | 9,944 |
package diversos
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.FunSuite
@RunWith(classOf[JUnitRunner])
class DoubleTest extends FunSuite{
test("falha ao somar tipo Double"){
var valor = 0.0
for (i <- 1 to 10)
valor += 0.1
assert(10.0 != valor)
}
... | celioeduardo/scala-impatient | src/test/scala/diversos/DoubleTest.scala | Scala | mit | 322 |
package blended.testsupport.pojosr
import org.osgi.framework.BundleActivator
import org.scalatest.{BeforeAndAfterAll, TestSuite}
abstract class SimplePojoContainerSpec
extends TestSuite
with BeforeAndAfterAll { this: PojoSrTestHelper =>
/**
* Factory for bundles.
* A `Seq` of bundle name and activator cl... | lefou/blended | blended.testsupport.pojosr/src/main/scala/blended/testsupport/pojosr/SimplePojoContainerSpec.scala | Scala | apache-2.0 | 1,275 |
package scavlink.sbt.mavgen
import org.scalatest.{Matchers, WordSpec}
import scavlink.sbt.mavgen.EnumGenerator._
class EnumFunctionSpec extends WordSpec with Matchers {
def value(n: Int) = EnumValue("val" + n, "value " + n, n.toString)
def altValue(n: Int) = EnumValue("ALT_val" + n, "value " + n, n.toString)
v... | nickolasrossi/sbt-mavgen | src/test/scala/scavlink/sbt/mavgen/EnumFunctionSpec.scala | Scala | mit | 6,631 |
package metal
trait Updatable2[V2] extends Values2[V2] {
def ptrUpdate2[@specialized W2](ptr: VPtr[Updatable2.this.type], v: W2): Unit
def ptrUpdate2FromArray(ptr: VPtr[Updatable2.this.type], array: Array[_], i: Int): Unit =
array match {
case a: Array[Double] => ptrUpdate2[Double](ptr, a.asInstanceOf[... | denisrosset/ptrcoll | core/src/main/scala/metal/Updatable2.scala | Scala | mit | 1,085 |
/*
* 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 ... | bavardage/spark | core/src/main/scala/spark/scheduler/cluster/TaskInfo.scala | Scala | apache-2.0 | 1,977 |
/*
* 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 ... | mkolod/incubator-spark | core/src/test/scala/org/apache/spark/MapOutputTrackerSuite.scala | Scala | apache-2.0 | 6,459 |
/*
* 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 ... | hengyicai/OnlineAggregationUCAS | sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataTypeConversions.scala | Scala | apache-2.0 | 2,701 |
package NN
import breeze.linalg.{
Matrix => BM,
CSCMatrix => BSM,
DenseMatrix => BDM,
Vector => BV,
DenseVector => BDV,
SparseVector => BSV
}
import org.apache.spark.rdd.RDD
/**
* label£ºÄ¿±ê¾ØÕó
* features£ºÌØÕ÷¾ØÕó
* predict_label£ºÔ¤²â¾ØÕó
* error£ºÎó²î
*/
case class PredictNNLabel(label: BDM[Doub... | XiaoqingWang/SparkMLlibDeepLearn | src/NN/NeuralNetModel.scala | Scala | apache-2.0 | 1,905 |
package org.scalameter
import scala.Numeric.Implicits._
class Errors[T: Numeric](measurement: Measurement[T]) {
import measurement._
/** [[http://en.wikipedia.org/wiki/Average Average]] of the set of measurements */
lazy val average = complete.sum.toDouble() / complete.length
/** [[http://en.wikipedia.org/wi... | kjanosz/scalameter | src/main/scala/org/scalameter/Errors.scala | Scala | bsd-3-clause | 635 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* 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 your option) any later version.
*
* This... | beangle/webmvc | core/src/main/scala/org/beangle/webmvc/config/spi.scala | Scala | lgpl-3.0 | 1,053 |
package colossus.extensions.protocols.mongo.message
import java.nio.ByteOrder
import java.util.concurrent.atomic.AtomicInteger
import akka.util.ByteString
import colossus.extensions.util.bson.Writable
trait Message extends Writable {
implicit val byteOrder = ByteOrder.LITTLE_ENDIAN
val requestID: Int = Request... | fehmicansaglam/colossus-extensions | mongo/src/main/scala/colossus/extensions/protocols/mongo/message/Message.scala | Scala | apache-2.0 | 688 |
package springnz.sparkplug.util
import com.typesafe.config.Config
import scala.collection.JavaConversions._
object ConfigUtils {
def configFields(appConfig: Config): Map[String, String] = {
appConfig.entrySet
.map {
case entry ⇒
val key = entry.getKey
(key, appConfig.getStrin... | springnz/sparkplug | sparkplug-core/src/main/scala/springnz/sparkplug/util/ConfigUtils.scala | Scala | mit | 358 |
/* _____ _ __ ________ ___ *\\
** / ___/(_) |/ / ___/ |__ \\ Simple Mechanics Simulator 2 **
** \\__ \\/ / /|_/ /\\__ \\ __/ / copyright (c) 2011 Jakob Odersky **
** ___/ / / / / /___/ / / __/ **
** /____/_/_/ /_/... | jodersky/sims2 | src/main/scala/sims/collision/AABB.scala | Scala | bsd-3-clause | 1,884 |
package com.twitter.finagle.mysql
import com.twitter.finagle._
import com.twitter.finagle.mysql.codec.{PacketFrameDecoder, Endec}
import com.twitter.finagle.mysql.protocol._
import com.twitter.finagle.mysql.protocol.Capability._
import com.twitter.util.Future
import org.jboss.netty.channel._
import org.jboss.netty.han... | foursquare/finagle | finagle-mysql/src/main/scala/com/twitter/finagle/mysql/Codec.scala | Scala | apache-2.0 | 2,856 |
package scala.reflect
package quasiquotes
import java.lang.UnsupportedOperationException
import scala.reflect.reify.{Reifier => ReflectReifier}
import scala.reflect.internal.Flags._
trait Reifiers { self: Quasiquotes =>
import global._
import global.build._
import global.definitions._
import Rank._
import u... | felixmulder/scala | src/compiler/scala/reflect/quasiquotes/Reifiers.scala | Scala | bsd-3-clause | 24,219 |
package tv.camfire.media_server.session
import javax.servlet._
/**
* User: jonathan
* Date: 6/6/13
* Time: 12:57 PM
*/
class SessionFilter extends Filter {
//TODO: Use this instead of an atmosphere interceptor
def init(filterConfig: FilterConfig) {}
def doFilter(request: ServletRequest, response: ServletRe... | jgrowl/camfire-signaling | signaling-server/src/main/scala/tv/camfire/media_server/session/SessionFilter.scala | Scala | mit | 373 |
/*
* Copyright 2012 Typesafe Inc. <http://www.typesafe.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | sangohan/pact-jvm | pact-jvm-logging/src/main/scala/au/com/dius/pact/com/typesafe/scalalogging/Logger.scala | Scala | apache-2.0 | 4,312 |
/**
* Copyright (c) 2014-2016 Tim Bruijnzeels
* 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 list of... | timbru/rpki-ca | src/test/scala/nl/bruijnzeels/tim/rpki/ca/TrustAnchorTest.scala | Scala | bsd-3-clause | 5,121 |
/* *\
** \ \ / _) \ \ / \ | **
** \ \ / | __ \ _ \ __| \ \ / |\/ | **
** \ \ / | | | __/ | \ \ / | | **
** \_/ _| .__/ \___| _| \_/ _| _| **
** _| ... | hsyl20/Scala_ViperVM | src/main/scala/org/vipervm/platform/DataTransfer.scala | Scala | gpl-3.0 | 1,008 |
package scalaj.http
import org.junit.Assert._
import org.junit.Test
case class BinResponse(files: Map[String, String], form: Map[String, String], args: Map[String, String], headers: Map[String, String])
class HttpBinTest {
@Test
def headRequest {
val response = Http("http://httpbin.org/status/200").method("... | beritou/scalaj-http | src/test/scala/scalaj/http/HttpBinTest.scala | Scala | apache-2.0 | 3,606 |
// Copyright: 2010 - 2017 https://github.com/ensime/ensime-server/graphs
// License: http://www.apache.org/licenses/LICENSE-2.0
package org.ensime.api
import java.io.File
/**
* There should be exactly one `RpcResponseEnvelope` in response to an
* `RpcRequestEnvelope`. If the `callId` is empty, the response is
* an... | pascr/ensime-server | api/src/main/scala/org/ensime/api/outgoing.scala | Scala | gpl-3.0 | 15,243 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/calcite/TableAggregate.scala | Scala | apache-2.0 | 4,045 |
/*
* Copyright 2014-15 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 agr... | intelix/eventstreams | es-core/es-api/src/main/scala/eventstreams/core/actors/ActorWithTicks.scala | Scala | apache-2.0 | 1,827 |
package cromwell.engine.backend
import akka.actor.ActorSystem
import com.google.api.client.util.ExponentialBackOff
import com.typesafe.config.Config
import cromwell.engine._
import cromwell.engine.backend.jes.JesBackend
import cromwell.engine.backend.local.LocalBackend
import cromwell.engine.backend.runtimeattributes.... | dgtester/cromwell | src/main/scala/cromwell/engine/backend/Backend.scala | Scala | bsd-3-clause | 6,299 |
/*
---------------------------------------------------------------------------
This software is released under a BSD license, adapted from
http://opensource.org/licenses/bsd-license.php
Copyright (c) 2010-2018, Brian M. Clapper
All rights reserved.
See the accompanying license file for details.
--------... | bmc/markwrap | src/test/scala/org/clapper/markwrap/MarkWrapSpec.scala | Scala | bsd-3-clause | 2,425 |
/*
* 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 ... | sgururajshetty/carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/detailquery/ColumnPropertyValidationTestCase.scala | Scala | apache-2.0 | 2,064 |
/*
* Copyright (c) 2011 ScalaStuff.org (joint venture of Alexander Dvorkovyy and Ruud Diterwich)
*
* 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.a... | scalastuff/scalabeans | src/test/scala/org/scalastuff/util/LoanTest.scala | Scala | apache-2.0 | 5,433 |
/*
* 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 ... | PredictionIO/PredictionIO | tools/src/main/scala/org/apache/predictionio/tools/Runner.scala | Scala | apache-2.0 | 10,673 |
package x7c1.linen.modern.action.observer
import x7c1.linen.modern.action.observer.CallbackTaskRunner.runAsync
import x7c1.linen.modern.action.{Actions, OutlineFocusedEvent, EntrySkipStopped, EntrySkippedEvent}
import x7c1.linen.modern.display.unread.{OutlineSelectedEvent, OnOutlineSelectedListener}
import x7c1.wheat.... | x7c1/Linen | linen-modern/src/main/scala/x7c1/linen/modern/action/observer/outline.scala | Scala | mit | 2,023 |
package reactivemongo.api
import java.util.UUID
import scala.util.Try
import scala.reflect.ClassTag
import reactivemongo.bson.buffer.{
ReadableBuffer,
WritableBuffer => LegacyWritable
}
import reactivemongo.core.protocol.Response
import reactivemongo.core.netty.ChannelBufferReadableBuffer
/** The default seri... | cchantep/ReactiveMongo | core/src/main/scala/api/BSONSerializationPack.scala | Scala | apache-2.0 | 6,446 |
/***********************************************************************
* 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-convert/geomesa-convert-all/src/test/scala/org/locationtech/geomesa/convert/FindConvertersTest.scala | Scala | apache-2.0 | 3,144 |
package com.nabijaczleweli.minecrasmer.reference
import com.nabijaczleweli.minecrasmer.block.BlockLiquidCrystalFluid
import com.nabijaczleweli.minecrasmer.creativetab.CreativeTabMineCrASMer
import com.nabijaczleweli.minecrasmer.resource.MineCrASMerLocation
import com.nabijaczleweli.minecrasmer.util.IOreDictRegisterabl... | nabijaczleweli/ASMifier | src/main/scala/com/nabijaczleweli/minecrasmer/reference/Container.scala | Scala | mit | 1,710 |
/*
* 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 ... | starpit/openwhisk | common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/logging/SplunkLogStore.scala | Scala | apache-2.0 | 8,099 |
abstract class C2 extends T2 {
override def foo(): Unit = {}
/*s*/foo/*e*/()
}
| dragos/scala-ide | org.scala-ide.sdt.core.tests/test-workspace/pc_doc/src/inherit-2.scala | Scala | bsd-3-clause | 84 |
package lila.msg
import org.joda.time.DateTime
import lila.user.User
case class Msg(
text: String,
user: User.ID,
date: DateTime
) {
def asLast =
Msg.Last(
text = text take 60,
user = user,
date = date,
read = false
)
}
object Msg {
case class Id(value: String) exte... | luanlv/lila | modules/msg/src/main/Msg.scala | Scala | mit | 749 |
package org.scalatra
package json
import org.json4s._
import util._
import io._
import org.scalatra.ActionResult
import java.io.{FileInputStream, File}
import org.scalatra.ActionResult
import xml.{Node, NodeSeq}
trait JValueResult extends ScalatraBase { self: JsonSupport[_] =>
implicit protected def jsonFormats: F... | etorreborre/scalatra | json/src/main/scala/org/scalatra/json/JValueResult.scala | Scala | bsd-2-clause | 1,742 |
/*
* 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 ... | witgo/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala | Scala | apache-2.0 | 62,844 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | underscorenico/squants | shared/src/main/scala/squants/electro/MagneticFluxDensity.scala | Scala | apache-2.0 | 2,115 |
package org.ai4fm.proofprocess.ui.features
import org.ai4fm.proofprocess.{ProofStep, Term}
import org.ai4fm.proofprocess.core.util.PProcessUtil.getAdapter
import org.ai4fm.proofprocess.ui.TermSelectionSourceProvider
import org.ai4fm.proofprocess.ui.internal.PProcessUIPlugin.plugin
import org.ai4fm.proofprocess.ui.util... | andriusvelykis/proofprocess | org.ai4fm.proofprocess.ui/src/org/ai4fm/proofprocess/ui/features/SubTermSelectionDialog.scala | Scala | epl-1.0 | 8,199 |
package org.jetbrains.plugins.scala.util
import junit.framework.TestCase
import org.junit.Assert._
import org.jetbrains.plugins.scala.util.EnumSet._
class EnumSetTest extends TestCase {
import JavaEnum._
def testEnumSet(): Unit = {
val ab = EnumSet(A, B, B, B, B, A, B)
val ab2 = EnumSet.empty[JavaEnum] ... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/util/EnumSetTest.scala | Scala | apache-2.0 | 1,219 |
package org.jetbrains.plugins.scala.debugger.evaluateExpression
import org.jetbrains.plugins.scala.DependencyManagerBase._
import org.jetbrains.plugins.scala.base.libraryLoaders.{IvyManagedLoader, LibraryLoader}
import org.jetbrains.plugins.scala.debugger.ScalaDebuggerTestCase
/**
* @author Nikolay.Tropin
*/
//TO... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/debugger/evaluateExpression/InAsyncTestBase.scala | Scala | apache-2.0 | 2,513 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/TextSocketMicroBatchStream.scala | Scala | apache-2.0 | 6,156 |
package com.v_standard.scalikejdbc.orm.dao
import com.typesafe.scalalogging.slf4j.Logging
import com.v_standard.scalikejdbc.orm.SqlBuilder
import com.v_standard.scalikejdbc.orm.adapter.DBAdapter
import com.v_standard.scalikejdbc.orm.condition.Condition
import com.v_standard.scalikejdbc.orm.definition.{AbstractEntityDe... | VanishStandard/scalikejdbc-orm | src/main/scala/com/v_standard/scalikejdbc/orm/dao/WriteDao.scala | Scala | bsd-3-clause | 5,903 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-redis/geomesa-redis-tools/src/main/scala/org/locationtech/geomesa/redis/tools/ingest/RedisIngestCommand.scala | Scala | apache-2.0 | 1,284 |
/*
* 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 ... | style95/openwhisk | common/scala/src/main/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStoreProvider.scala | Scala | apache-2.0 | 3,669 |
package com.github.dtaniwaki.akka_pusher
import java.math.BigInteger
import java.security.MessageDigest
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
import akka.http.scaladsl.model.Uri
object Utils {
val HEX = 16
val LENGTH = 32
def byteArrayToString(data: Array[Byte]): String = {
val bi... | dtaniwaki/akka-pusher | src/main/scala/com/github/dtaniwaki/akka_pusher/Utils.scala | Scala | mit | 1,212 |
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.