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 com.seanshubin.learn.datomic.domain
case class SeqComparison(same: Boolean, messageLines: Seq[String])
object SeqComparison {
def compare(left: Seq[String], right: Seq[String]): SeqComparison = {
compareRecursive(left.toList, right.toList, 0, Nil)
}
private def compareRecursive(actualSeq: List[Stri... | SeanShubin/learn-datomic | domain/src/main/scala/com/seanshubin/learn/datomic/domain/SeqComparison.scala | Scala | unlicense | 1,434 |
package com.olegych.scastie.client.components.editor
import org.scalajs.dom
import org.scalajs.dom.raw.HTMLElement
import codemirror.{Editor => CMEditor}
import codemirror.CodeMirror.{Pos => CMPosition}
private[editor] class LoadingMessage() {
private val message = {
val ul = dom.document
.createElement(... | OlegYch/scastie | client/src/main/scala/com.olegych.scastie.client/components/editor/LoadingMessage.scala | Scala | apache-2.0 | 1,088 |
/*
* Copyright 2011-2014 Chris de Vreeze
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | EBPI/yaidom | src/test/scala/nl/ebpi/yaidom/integrationtest/TheCaseForYaidomTest.scala | Scala | apache-2.0 | 23,921 |
/*
* Nodes that affect control flow.
*/
package see.nodes
import see.EvalError
import see.ResultException
import see.Scope
import see.SeeException
import see.values.Bool
import see.values.Val
// Node for the conditional operator. This takes three parameters (p1 ? p2 : p3)
private[see] object Condition extends Fa... | RayRacine/scee | src/main/scala/see/nodes/Flow.scala | Scala | bsd-3-clause | 4,453 |
package services
import com.avaje.ebean.Expr
import edu.cmu.lti.ws4j.impl.{Resnik, Lin}
import edu.cmu.lti.ws4j.util.StopWordRemover
import scala.collection.JavaConversions
import JavaConversions._
import edu.cmu.lti.lexical_db.NictWordNet
import models.{User, Match}
/**
* Created by Adam on 11/15/2014.
*/
object ... | kylewetherald/blindlove | app/services/MatcherService.scala | Scala | mit | 1,835 |
// ' Project: smath
// Module: API / ode
// Description: Interface for first-order ODE systems
//
// Copyright (c) 2015 Johannes Kastner <jokade@karchedon.de>
// Distributed under the MIT License (see included file LICENSE)
package biz.enef.smath.ode
import biz.enef.smath.ArrayX
import biz.enef.sm... | jokade/smath | shared/src/main/scala/biz/enef/smath/ode/FirstOrderSystem.scala | Scala | mit | 1,352 |
package svstm.transactions
import scala.concurrent.stm.InTxn
import scala.concurrent.stm.stubs.StubInTxn
import scala.concurrent.stm.svstm.SVSTMTxnExecutor
import svstm.vbox.VBox
object Transaction {
def apply(readOnly: Boolean = false, parent: Transaction = null): Transaction = {
(parent, readOnly) match {
ca... | fcristovao/SVSTM | src/main/scala/svstm/transactions/Transaction.scala | Scala | apache-2.0 | 1,050 |
//===========================================================================
// Copyright 2014 Delving B.V.
//
// 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://ww... | delving/narthex | app/mapping/SkosVocabulary.scala | Scala | apache-2.0 | 8,098 |
/*
* Copyright 2001-2013 Artima, 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 agre... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/NoneOfContainMatcherSpec.scala | Scala | apache-2.0 | 7,752 |
package dao.generic
/**
* Identifyable base for all Strong Entity Model types i.e. every Strong entity is expected to have a
* primary key column with name "id"
* @tparam PK Primary key type
* @tparam E Actual case class EntityRow type
*/
trait EntityAutoInc[PK, E <: EntityAutoInc[PK, E]] extends Entity[PK] ... | bravegag/play-authenticate-usage-scala | app/dao/generic/EntityAutoInc.scala | Scala | apache-2.0 | 890 |
package org.concurrency.ch2
import scala.collection._
object SynchronizedPool extends App {
private val tasks = mutable.Queue[() => Unit]()
object Worker extends java.lang.Thread {
setDaemon(true)
def poll() = tasks.synchronized {
while(tasks.isEmpty) tasks.wait()
tasks.dequeue()
}
ove... | marcos-sb/concurrent-programming-scala | src/main/scala-2.11/org/concurrency/ch2/SynchronizedPool.scala | Scala | apache-2.0 | 628 |
package org.f100ded.play.fakews
import org.specs2.mutable._
class FakeRequestExtractorsSpec extends Specification {
"extractors" should {
"extract GET method" in {
val request = FakeRequest("GET", "http://localhost")
GET.unapply(request) must beSome(request)
POST.unapply(request) must beNone
... | f100ded/play-fake-ws-standalone | src/test/scala/org/f100ded/play/fakews/FakeRequestExtractorsSpec.scala | Scala | apache-2.0 | 2,023 |
package nak.liblinear
/**
* Configure the options for Liblinear training.
*/
case class LiblinearConfig(
solverType: SolverType = SolverType.L2R_LR,
cost: Double = 1.0,
eps: Double = 0.01,
showDebug: Boolean = false)
/**
* Set up a problem to be solved.
*/
object LiblinearProblem {
def apply(respons... | scalanlp/nak | src/main/scala/nak/liblinear/LiblinearClassifier.scala | Scala | apache-2.0 | 3,161 |
/*
* BSD License
*
* Copyright (c) 2015, University of Barcelona
* 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 noti... | GuillermoBlasco/gmX | src/test/scala/edu/ub/guillermoblascojimenez/gmx/impl/BeliefPropagationTest.scala | Scala | bsd-3-clause | 8,810 |
package services
import akka.actor.ActorSystem
import javax.inject.{Inject, Singleton}
import models.{ConversionStatus, StatusString, Task, Work}
import play.api.inject.ApplicationLifecycle
import play.api.{Configuration, Logger}
import org.slf4j.MDC
import scala.concurrent.duration.Duration
import scala.concurrent.{... | kuhnuri/kuhnuri-worker | common/app/services/SimpleWorkerService.scala | Scala | apache-2.0 | 6,200 |
/*
* Copyright 2001-2013 Artima, 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 agre... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/DeprecatedTestNameProp.scala | Scala | apache-2.0 | 23,385 |
/*
* 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/dataload/TestLoadDataFrame.scala | Scala | apache-2.0 | 13,049 |
package com.seanshubin.schulze.server.data_transfer
case class AlternativesAndPaths(alternatives: Seq[Seq[Any]], paths: Seq[Seq[Any]])
| SeanShubin/schulze | server/src/main/scala/com/seanshubin/schulze/server/data_transfer/AlternativesAndPaths.scala | Scala | unlicense | 136 |
package com.aergonaut.lifeaquatic.tileentity
import com.aergonaut.lib.core.TInitializer
import com.aergonaut.lifeaquatic.constants.Names
import cpw.mods.fml.common.registry.GameRegistry
object ModTileEntities extends TInitializer {
override def preInit(): Boolean = {
GameRegistry.registerTileEntity(classOf[Tile... | aergonaut/LifeAquatic | src/main/scala/com/aergonaut/lifeaquatic/tileentity/ModTileEntities.scala | Scala | mit | 470 |
package slogger.services.processing.aggregation
import scala.util.Try
import scala.util.Failure
import play.api.libs.json.JsObject
import scala.util.Success
import scala.util.control.NonFatal
trait AggregatorResolver {
def resolve(aggregatorClass: String, config: JsObject): Try[Aggregator]
}
class AggregatorReso... | IvanMykhailov/stats-logger | core/src/main/scala/slogger/services/processing/aggregation/AggregatorResolver.scala | Scala | mit | 1,096 |
package iso8601
| softprops/iso8601 | src/main/scala/show.scala | Scala | mit | 16 |
package org.scalameter
import java.util.Date
import org.scalameter.picklers.Pickler
import org.scalameter.utils.Tree
import scala.language.existentials
import scala.util.DynamicVariable
/** Abstract required for the [[org.scalameter.ScalaMeterFramework]] to find all performance tests.
*/
sealed trait AbstractPerf... | kjanosz/scalameter | src/main/scala/org/scalameter/performanceTest.scala | Scala | bsd-3-clause | 3,863 |
package lila.security
object Spam {
def detect(texts: String*) = {
val text = texts mkString " "
blacklist exists text.contains
}
private val blacklist = List(
/* While links to other chess websites are welcome,
* refer links grant the referrer money,
* effectively inducing spam */
"v... | JimmyMow/lila | modules/security/src/main/Spam.scala | Scala | mit | 745 |
package mesosphere.marathon.core.task.tracker.impl.steps
import mesosphere.marathon.MarathonTestHelper
import mesosphere.marathon.core.launchqueue.LaunchQueue
import mesosphere.marathon.core.task.bus.MarathonTaskStatus
import mesosphere.marathon.core.task.bus.TaskStatusObservables.TaskStatusUpdate
import mesosphere.ma... | Kosta-Github/marathon | src/test/scala/mesosphere/marathon/core/task/tracker/impl/steps/NotifyLaunchQueueStepImplTest.scala | Scala | apache-2.0 | 2,090 |
package org.crashstars.spark.streaming
import org.apache.spark.streaming.StreamingContextState._
import org.apache.spark.streaming.{Duration, Seconds, StreamingContext}
import org.apache.spark.{SparkConf, SparkContext}
import org.crashstars.common.Logging
/**
* Created by anavidad on 13/10/15.
*/
class SparkStreami... | anavidad3/PoC-spark-scala-maven | src/main/scala/org/crashstars/spark/streaming/SparkStreamingUtils.scala | Scala | apache-2.0 | 1,075 |
package com.wincom.dcim.sharded
import akka.actor.{Actor, ActorRef, Props}
import akka.cluster.sharding.{ClusterSharding, ClusterShardingSettings}
import akka.event.Logging
import com.wincom.dcim.domain.Settings
import com.wincom.dcim.message.common.Command
object ShardedDevices {
def props = Props(new ShardedDevic... | xtwxy/mysc | dcim-cluster/cluster/src/main/scala/com/wincom/dcim/sharded/ShardedDevices.scala | Scala | apache-2.0 | 1,318 |
/*
* 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... | haraldmaida/ScalaTestFX | scalatestfx/src/main/scala/io/scalatestfx/zzznolongerused/SfxRobotException.scala | Scala | apache-2.0 | 977 |
package org.sisioh.aws4s.sts.model
import com.amazonaws.services.securitytoken.model.{AssumedRoleUser, Credentials, AssumeRoleResult}
import org.sisioh.aws4s.PimpedType
class RichAssumeRoleResult(val underlying: AssumeRoleResult)
extends AnyVal with PimpedType[AssumeRoleResult] {
def credentialsOpt: Option[Cre... | everpeace/aws4s | aws4s-sts/src/main/scala/org/sisioh/aws4s/sts/model/RichAssumeRoleResult.scala | Scala | mit | 1,008 |
package com.redislabs.provider.redis.streaming
import java.util.AbstractMap.SimpleEntry
import com.redislabs.provider.redis.util.PipelineUtils.foreachWithPipeline
import com.redislabs.provider.redis.util.{Logging, StreamUtils}
import com.redislabs.provider.redis.{ReadWriteConfig, RedisConfig}
import org.apache.curator... | RedisLabs/spark-redis | src/main/scala/com/redislabs/provider/redis/streaming/RedisStreamReceiver.scala | Scala | bsd-3-clause | 6,325 |
package ar.edu.unq.tpi.qsim.parser
/**
* Copyright 2014 Tatiana Molinari.
* Copyright 2014 Susana Rosito
*
* 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
* ... | molinarirosito/QSim | src/main/scala/ar/edu/unq/tpi/qsim/parser/Parser.scala | Scala | gpl-3.0 | 3,803 |
/*
* 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 ... | chgm1006/spark-app | src/main/scala/org/apache/spark/examples/graphx/Analytics.scala | Scala | apache-2.0 | 6,900 |
package sectery.producers
import org.slf4j.LoggerFactory
import sectery.Producer
import sectery.Rx
import sectery.Tx
import zio.Clock
import zio.Queue
import zio.ZIO
class Help(producers: List[Producer]) extends Producer:
private val usage = """^@help\s+(.+)\s*$""".r
private val helpMessage: String =
s"""${... | earldouglas/sectery | modules/producers/src/main/scala/sectery/producers/Help.scala | Scala | mit | 1,170 |
package euler.contfract
/**
* Iterator for convergents of a generalized continued fraction:
*
* @see http://en.wikipedia.org/wiki/Convergent_(continued_fraction)
*/
class ConvergentsIterator(asIt: Iterator[Int], bsIt: Iterator[Int]) extends Iterator[(BigInt, BigInt)] {
def this(as: Seq[Int], bs: Seq[Int]) = this... | TrustNoOne/Euler | scala/src/main/scala/euler/contfract/ConvergentsIterator.scala | Scala | mit | 981 |
/*
* 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 ... | jeremiaswerner/openwhisk | tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ActivationStoreCRUDBehaviors.scala | Scala | apache-2.0 | 3,468 |
/*
* Copyright 2011-2022 GatlingCorp (https://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | gatling/gatling | gatling-core/src/main/scala/io/gatling/core/structure/Errors.scala | Scala | apache-2.0 | 1,474 |
package eventstore
package operations
import scala.util.Try
private[eventstore] trait Inspection {
def expected: Class[_]
def pf: PartialFunction[Try[In], Inspection.Decision]
}
private[eventstore] object Inspection {
sealed trait Decision
object Decision {
case object Stop extends Decision
case obj... | pawelkaczor/EventStore.JVM | src/main/scala/eventstore/operations/Inspection.scala | Scala | bsd-3-clause | 453 |
/*
* Copyright 2012 OneCalendar
*
* 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 w... | mdia/OneCalendar | app/dao/ICalStreamDao.scala | Scala | apache-2.0 | 1,169 |
package com.github.btmorr.harmonia
import org.apache.spark._
import org.apache.spark.streaming._
import org.apache.spark.streaming.kafka010.ConsumerStrategies.Subscribe
import org.apache.spark.streaming.kafka010.LocationStrategies.PreferConsistent
import org.apache.spark.streaming.kafka010._
import org.apache.kafka.co... | btmorr/ideal-spork | mastermind/src/main/scala/com/github/btmorr/harmonia/Mastermind.scala | Scala | gpl-3.0 | 3,992 |
package test
import com.sun.jdi.request.ExceptionRequest
import org.scaladebugger.api.lowlevel.exceptions.{ExceptionRequestInfo, ExceptionManager}
import org.scaladebugger.api.lowlevel.requests.JDIRequestArgument
import scala.util.Try
/**
* Test exception manager that merely invokes the provided exception manager
... | ensime/scala-debugger | scala-debugger-api/src/test/scala/test/TestExceptionManager.scala | Scala | apache-2.0 | 2,377 |
package scuff
/**
* Finite state machines.
* This package was primarily made to
* have an easy DSL that maps well from
* diagram to code (and vice versa),
* and uses the type system to make sure
* the transitions are sound.
*/
package object fsm
| nilskp/scuff | src/main/scala/scuff/fsm/package.scala | Scala | mit | 261 |
package observatory
import java.lang.Math._
import org.apache.spark.sql.types._
import org.apache.spark.sql.{Encoder, Encoders}
import scala.math.{acos => _, atan => _, cos => _, pow => _, sin => _, sinh => _, sqrt => _, toDegrees => _, _}
import scala.reflect.ClassTag
object Implicits {
implicit class F2C(f: Do... | yurii-khomenko/fpScalaSpec | c5w1observatory/src/main/scala/observatory/models.scala | Scala | gpl-3.0 | 3,980 |
/*
* 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 ... | kiszk/spark | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala | Scala | apache-2.0 | 10,794 |
/*
* 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 ... | ptkool/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetScan.scala | Scala | apache-2.0 | 4,074 |
/*
* 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 ... | goldmedal/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/arrow/ArrowConvertersSuite.scala | Scala | apache-2.0 | 44,232 |
package com.ttpresentation.endpoint
import spray.routing.HttpService
import com.typesafe.scalalogging.slf4j.Logging
import spray.httpx.Json4sJacksonSupport
import scala.concurrent.ExecutionContext
import spray.http.MediaTypes._
import spray.http.StatusCodes._
import akka.actor.Actor
import com.ttpresentation.dao.UserD... | ctcarrier/ttpresentation | src/main/scala/com/ttpresentation/endpoint/UserEndpoint.scala | Scala | mit | 1,300 |
package com.brkyvz.spark.linalg
import com.holdenkarau.spark.testing.PerTestSparkContext
import org.scalatest.FunSuite
import org.apache.spark.mllib.linalg.{DenseMatrix, Matrices}
class MatricesSuite extends FunSuite with PerTestSparkContext {
private val a = Matrices.dense(2, 2, Array(1, 2, 3, 4))
private val ... | brkyvz/lazy-linalg | src/test/scala/com/brkyvz/spark/linalg/MatricesSuite.scala | Scala | apache-2.0 | 4,052 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | hlin117/factorie | src/test/scala/cc/factorie/app/nlp/parse/TestTransitionBasedParser.scala | Scala | apache-2.0 | 10,382 |
package org.broadinstitute.dsde.firecloud
import java.io.{File, FileNotFoundException, FileOutputStream, InputStream}
import java.net.{HttpURLConnection, URL}
import java.text.SimpleDateFormat
import java.util.zip.{ZipEntry, ZipException, ZipFile}
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl... | broadinstitute/firecloud-orchestration | src/main/scala/org/broadinstitute/dsde/firecloud/EntityService.scala | Scala | bsd-3-clause | 20,370 |
package is.hail.types.physical.stypes.interfaces
import is.hail.annotations.Region
import is.hail.asm4s.{Settable, TypeInfo, Value}
import is.hail.expr.ir.EmitCodeBuilder
import is.hail.expr.ir.streams.StreamProducer
import is.hail.types.physical.PType
import is.hail.types.physical.stypes._
import is.hail.types.virtua... | hail-is/hail | hail/src/main/scala/is/hail/types/physical/stypes/interfaces/SStream.scala | Scala | mit | 1,842 |
package com.meteorcode.pathway.io
import org.scalactic.{AbstractStringUniformity, Uniformity}
import scala.language.postfixOps
/**
* Scalactic normalizations for strings that represent paths
*
* Created by hawk on 2/2/16.
*/
trait PathNormalizations {
/**
* Produces a <code>Uniformity[String]</code> w... | MeteorCode/Pathway | src/main/scala/com/meteorcode/pathway/io/PathNormalizations.scala | Scala | mit | 978 |
package org.scalaide.ui.internal.editor.decorators.indentguide
import org.eclipse.jface.preference.PreferenceConverter
import org.eclipse.jface.text.source.ISourceViewer
import org.eclipse.swt.SWT
import org.eclipse.swt.events.PaintEvent
import org.eclipse.swt.graphics.Color
import org.eclipse.swt.graphics.GC
import o... | romanowski/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/internal/editor/decorators/indentguide/IndentGuidePainter.scala | Scala | bsd-3-clause | 7,146 |
package memnets.model
import scala.collection.mutable.ArrayBuffer
trait GoalHandler {
def goalStart(g: Goal): Unit
def goalOver(g: Goal): Unit
def goalGroupOver(grp: Goals): Unit
}
trait Goals extends IndexedSeq[Goal] {
def +=(g: Goal): Unit
/**
* subclass to change bonus points default.
* bonus poi... | MemoryNetworks/memnets | api/src/main/scala/memnets/model/Goals.scala | Scala | apache-2.0 | 2,361 |
package net.danielkza.http2.stream
import scala.collection.immutable
import akka.stream._
import akka.stream.stage._
import akka.http.scaladsl.model.HttpEntity.{LastChunk, ChunkStreamPart, Chunk}
import net.danielkza.http2.protocol.{HTTP2Error, Frame}
import net.danielkza.http2.protocol.Frame.{Data, Headers}
import ne... | danielkza/h2scala | core/src/main/scala/net/danielkza/http2/stream/ChunkedDataDecodeStage.scala | Scala | apache-2.0 | 2,329 |
package es.ucm.fdi.sscheck.matcher {
package specs2 {
import org.apache.spark.rdd.RDD
import org.specs2.matcher.Matcher
import org.specs2.matcher.MatchersImplicits._
import scalaz.syntax.std.boolean._
object RDDMatchers {
/** Number of records to show on failing predicates
* */
... | juanrh/sscheck | src/main/scala/es/ucm/fdi/sscheck/matcher/specs2/package.scala | Scala | apache-2.0 | 3,939 |
package analysis
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.mllib.regression.LinearRegressionModel
import org.apache.spark.mllib.... | ramannanda9/restaurant-hotspots | Analytics/Regression.scala | Scala | gpl-3.0 | 1,773 |
package com.moon
/**
* 距离度量方法接口
* 度量空间
* Created by Paul on 2016/12/20.
*/
trait MetricSpace[T] {
def distance(a:T,b:T):Double
}
| linpingchuan/misc | scala/BK-tree/src/main/scala-2.11/com/moon/MetricSpace.scala | Scala | gpl-2.0 | 164 |
package com.despegar.soffheap.perftest
import com.despegar.soffheap.map.SoffHeapMapBuilder
import java.lang.management.ManagementFactory
import com.despegar.soffheap.SoffHeap
import com.despegar.soffheap.SnapshotValue
import scala.collection.mutable.ListBuffer
object LotOfObjects extends App {
val arrays = System.... | despegar/soffheap | src/test/java/com/despegar/soffheap/perftest/LotOfObjects.scala | Scala | bsd-2-clause | 1,249 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monifu/monifu | monix-reactive/shared/src/test/scala/monix/reactive/internal/builders/CreateObservableSuite.scala | Scala | apache-2.0 | 1,856 |
import scala.collection.immutable.HashSet
object FilterStructuralSharing extends App {
val mm = new org.github.jamm.MemoryMeter()
val a = HashSet(0 until 1000:_*)
val b = a.filter(_ => true)
require(a eq b)
println(mm.measureDeep(a))
println(mm.measureDeep(b))
println(mm.measureDeep((a,b)))
}
| rklaehn/scalamuc_20150707 | scala211/src/main/scala/FilterStructuralSharing.scala | Scala | apache-2.0 | 309 |
package net.rfc1149.harassme
import android.content.{BroadcastReceiver, ContentResolver, Context, Intent}
import android.media.AudioManager._
import android.provider.CallLog.Calls
import android.telephony.TelephonyManager._
import org.scaloid.common.{SIntent, audioManager}
class HarassMeListener extends BroadcastRece... | samueltardieu/harassme | src/main/scala/net/rfc1149/harassme/HarassMeListener.scala | Scala | gpl-3.0 | 2,499 |
package org.openurp.edu.eams.teach.service.impl
import org.openurp.edu.base.Student
import org.openurp.edu.eams.teach.service.StudentSource
class StaticStudentSource extends StudentSource {
var students: Set[Student] = _
}
| openurp/edu-eams-webapp | core/src/main/scala/org/openurp/edu/eams/teach/service/impl/StaticStudentSource.scala | Scala | gpl-3.0 | 230 |
package org.cloudio.morpheus.test
import org.morpheus.Morpheus._
import org.morpheus.Morpher._
import org.morpheus._
import org.cloudio.morpheus.test.samples._
import org.junit.Assert._
import org.junit.Test
import org.morpheus.test.illTyped
/**
* Created by zslajchrt on 01/03/15.
*/
class EssentialCasesTests {
// ... | zslajchrt/morpheus-tests | src/test/scala/org/cloudio/morpheus/test/EssentialCasesTests.scala | Scala | apache-2.0 | 42,423 |
package de.choffmeister.microserviceutils.test.first
object ErrorFirst {
def apply(): Throwable = new RuntimeException("Error")
}
| choffmeister/microservice-utils | microservice-utils/src/test/scala/de/choffmeister/microserviceutils/test/first/ErrorFirst.scala | Scala | mit | 133 |
/**
* Created by cravefm on 9/14/15.
*/
package object models {
object JsonFormats {
import play.api.libs.json.Json
// Generates Writes and Reads for Feed and User thanks to Json Macros
implicit val balanceFormat = Json.format[Balance]
}
}
| setrar/rbchackaton | backend/app/models/package.scala | Scala | apache-2.0 | 262 |
package org.rebeam.tree.demo
import japgolly.scalajs.react.extra.router.StaticDsl._
import japgolly.scalajs.react.extra.router._
import org.rebeam.tree.view.Navigation
import org.rebeam.tree.view.pages._
import org.rebeam.tree.demo.DemoData._
import org.rebeam.tree.sync._
import japgolly.scalajs.react.vdom.html_<^._
... | trepidacious/tree-material-ui | js/src/main/scala/org/rebeam/tree/demo/DemoRoutes.scala | Scala | gpl-3.0 | 4,434 |
/*
* 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/frontend-2.3/src/main/scala/org/neo4j/cypher/internal/frontend/v2_3/Ref.scala | Scala | apache-2.0 | 1,381 |
package com.ticketmaster.api.commerce
object domain {
case class EventOffers(limits: Limits)
case class Limits(max: Int)
}
| ticketmaster-api/sdk-scala | commerce/src/main/scala/com/ticketmaster/api/commerce/domain.scala | Scala | mit | 131 |
package net.litola
import play.PlayAssetsCompiler
import sbt.Keys._
import sbt._
object SassPlugin extends AutoPlugin with PlayAssetsCompiler {
override def requires = sbt.plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val sassEntryPoints = settingKey[PathFinder]("Paths to Sa... | jlitola/play-sass | src/main/scala/net/litola/SassPlugin.scala | Scala | mit | 1,202 |
package gorillas.collection.immutable
import gorillas.collection.generic.KeyTransformation
import collection.{ SortedMap, IndexedSeqLike, GenTraversableOnce }
final class SortedArrayNavigableMap[K, V](protected[this] val sortedKeys: Array[K],
protected[this] val sortedValues: Array[V])(implicit val ordering: Orderi... | rmleon/GorillasCollection | maps/src/main/scala/gorillas/collection/immutable/SortedArrayNavigableMap.scala | Scala | bsd-3-clause | 4,279 |
/*
* Copyright 2015 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 ... | keshin/squbs | squbs-zkcluster/src/test/scala/org/squbs/cluster/DataCenterAwarenessSpec.scala | Scala | apache-2.0 | 5,154 |
/*
* 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-blink/src/main/scala/org/apache/flink/table/planner/codegen/agg/batch/SortAggCodeGenerator.scala | Scala | apache-2.0 | 5,116 |
package net.koofr.driveby.resources
case class DirCreate(name: String, description: String)
object DirCreate {
import spray.json.DefaultJsonProtocol._
implicit val format = jsonFormat2(DirCreate.apply)
}
| koofr/driveby | src/main/scala/net/koofr/driveby/resources/DirCreate.scala | Scala | mit | 213 |
/*
* CurveCmdLine.scala
* (Mellite)
*
* Copyright (c) 2012-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.mellite.impl.... | Sciss/Mellite | app/src/main/scala/de/sciss/mellite/impl/objview/CmdLineSupport.scala | Scala | agpl-3.0 | 2,576 |
/*
* 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 ... | HeartSaVioR/incubator-zeppelin | cassandra/src/main/scala/org/apache/zeppelin/cassandra/TextBlockHierarchy.scala | Scala | apache-2.0 | 5,475 |
package lolchat
import cats.data.EitherT
import scala.concurrent.{ExecutionContext, Future}
package object data {
type AsyncResult[A] = EitherT[Future, Error, A]
type ExeCtx = ExecutionContext
}
| Thangiee/League-of-Legend-Chat-Lib-Scala | core/src/main/scala/lolchat/data/package.scala | Scala | mit | 202 |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
*/
package... | cliffano/swaggy-jenkins | clients/scalatra/generated/src/main/scala/org/openapitools/server/model/PipelineRunNodeedges.scala | Scala | mit | 438 |
/*
* 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 | examples/src/main/scala/org/apache/spark/examples/CassandraTest.scala | Scala | apache-2.0 | 10,089 |
/***********************************************************************
* 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-utils/src/main/scala/org/locationtech/geomesa/utils/collection/SelfClosingIterator.scala | Scala | apache-2.0 | 1,938 |
/*
* 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 ... | ahnqirage/spark | sql/core/src/main/scala/org/apache/spark/sql/expressions/UserDefinedFunction.scala | Scala | apache-2.0 | 4,728 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package base
import com.intellij.openapi.util.TextRange
import com.intellij.psi.tree.IElementType
import com.intellij.psi.{PsiAnnotationOwner, PsiElement, PsiLanguageInjectionHost, PsiLiteral}
import org.jetbrains.plugins.scala.lang.lexer.ScalaTo... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/base/ScLiteral.scala | Scala | apache-2.0 | 2,102 |
import java.util.UUID
import play.api.data.FormError
import play.api.data.format.{Formats, Formatter}
import play.api.mvc._
/**
* @author zepeng.li@gmail.com
*/
package object controllers {
implicit class RequestWithPreviousURI(req: RequestHeader) {
def previousURI(implicit req: Request[AnyContent]): Option... | lizepeng/app.io | app/controllers/package.scala | Scala | apache-2.0 | 995 |
/*
* 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... | hmost1/incubator-toree | kernel/src/test/scala/org/apache/toree/kernel/protocol/v5/kernel/ActorLoaderSpec.scala | Scala | apache-2.0 | 3,523 |
package com.rocketfuel.sdbc.postgresql
import com.rocketfuel.sdbc.base.jdbc.statement.{DateParameter, ParameterValue}
import java.time.LocalTime
import java.time.format.DateTimeFormatter
import org.postgresql.util.PGobject
/**
* This gives us better precision than the JDBC time type.
*
* @param localTime
*/
pr... | rocketfuel/sdbc | postgresql/src/main/scala/com/rocketfuel/sdbc/postgresql/PGLocalTime.scala | Scala | bsd-3-clause | 1,100 |
package org.locationtech.geomesa.core.util
import java.util.concurrent.TimeUnit
import com.typesafe.scalalogging.slf4j.Logging
import org.apache.accumulo.core.client.BatchWriterConfig
import scala.util.Try
object GeoMesaBatchWriterConfig extends Logging {
val WRITER_LATENCY_SECONDS = "geomesa.batchwriter.latency.... | mmatz-ccri/geomesa | geomesa-core/src/main/scala/org/locationtech/geomesa/core/util/GeoMesaBatchWriterConfig.scala | Scala | apache-2.0 | 2,416 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.staticStringTest
import org.jetbrains.plugins.scala.testingSupport.scalatest.ScalaTestTestCase
/**
* @author Roman.Shein
* @since 24.06.2015.
*/
trait FeatureSpecStaticStringTest extends ScalaTestTestCase {
val featureSpecClassName = "FeatureSpecStr... | double-y/translation-idea-plugin | test/org/jetbrains/plugins/scala/testingSupport/scalatest/staticStringTest/FeatureSpecStaticStringTest.scala | Scala | apache-2.0 | 2,064 |
package com.dwolla.cloudflare.domain.model.logpush
import java.time.Instant
import com.dwolla.cloudflare.domain.model.{LogpullOptions, LogpushDestination, LogpushId}
case class LogpushJob(
id: LogpushId,
enabled: Boolean,
name: Option[String],
logpullOptions: Option[LogpullOptions],
destinationConf: Logpus... | Dwolla/scala-cloudflare | client/src/main/scala/com/dwolla/cloudflare/domain/model/logpush/LogpushJob.scala | Scala | mit | 617 |
package module
import integration._
import skinny.SkinnyConfig
class IntegrationsModule extends scaldi.Module {
private val DEFAULT_SERVICE = "Null"
val service = SkinnyConfig.stringConfigValue("externalIntegration.service").map { configValue =>
configValue.capitalize
} getOrElse DEFAULT_SERVICE
import... | atware/sharedocs | src/main/scala/module/IntegrationsModule.scala | Scala | mit | 676 |
package mesosphere.marathon
import java.util.concurrent.TimeoutException
import akka.actor.{ ActorRef, ActorSystem, Props }
import akka.event.EventStream
import akka.testkit._
import akka.util.Timeout
import mesosphere.marathon.MarathonSchedulerActor._
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.... | spacejam/marathon | src/test/scala/mesosphere/marathon/MarathonSchedulerActorTest.scala | Scala | apache-2.0 | 18,982 |
package com.twitter.finagle.memcached.integration
import com.twitter.conversions.time._
import com.twitter.finagle.memcached.util.AtomicMap
import com.twitter.finagle._
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.memcached.protocol.ClientError
import com.twitter.finagle.memcached.{Clien... | spockz/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/MemcachedTest.scala | Scala | apache-2.0 | 17,197 |
package cracker
@serializable
class CrackerTreeMessageRedPhase (val first : Option[CrackerTreeMessageIdentification], val second : Option[CrackerTreeMessageTree]) extends CrackerMessageSize
{
def getMessageSize = first.getOrElse(CrackerTreeMessageIdentification.empty).getMessageSize + second.getOrElse(CrackerTreeMess... | hpclab/cracker | src/cracker/CrackerMessageRedPhase.scala | Scala | mit | 625 |
//
// Logger.scala -- Scala object Logger
// Project OrcScala
//
// Created by jthywiss on Aug 21, 2010.
//
// Copyright (c) 2016 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the license terms in
// the LICENSE file found in the project's top-level dir... | orc-lang/orc | OrcScala/src/orc/compile/Logger.scala | Scala | bsd-3-clause | 545 |
package edu.neu.coe.csye._7200.util
import scala.util.{Try,Failure}
/**
* Classes which provide chaining of Try operations where each operation is (typically) a function which takes
* the same parameter.
* There are two distinct forms:
* <ul><li>the Trial/Match classes where the function given is of the form V=>T... | rchillyard/Scalaprof | FunctionalProgramming/src/main/scala/edu/neu/coe/csye/_7200/util/Trial.scala | Scala | gpl-2.0 | 3,597 |
package com.socrata.balboa.server
import com.socrata.balboa.server.ResponseWithType.json
import com.typesafe.scalalogging.StrictLogging
import org.eclipse.jetty.http.HttpStatus.INTERNAL_SERVER_ERROR_500
import org.scalatra.json.JacksonJsonSupport
import org.scalatra.{InternalServerError, ScalatraServlet}
trait Unexpe... | socrata-platform/balboa | balboa-http/src/main/scala/com/socrata/balboa/server/UnexpectedErrorFilter.scala | Scala | apache-2.0 | 739 |
package db
import java.util.concurrent.Executors
import cats.effect.{Async, Blocker, ContextShift, IO}
import com.zaxxer.hikari.{HikariConfig, HikariDataSource}
import doobie.Transactor
import play.api.inject.ApplicationLifecycle
import scala.concurrent.{ExecutionContext, Future}
case class JdbcConfig(
driverClas... | guardian/mobile-n10n | common/src/main/scala/db/DatabaseConfig.scala | Scala | apache-2.0 | 2,205 |
package ingraph.sandbox
import ingraph.compiler.test.{CompilerTest, CompilerTestConfig}
class JsaTest extends CompilerTest {
override val config = CompilerTestConfig(querySuitePath = Some("jsa")
, compileGPlanOnly = true
, skipGPlanResolve = false
, skipGPlanBeautify = false
, printQuery = false
... | FTSRG/ingraph | compiler/src/test/scala/ingraph/sandbox/JsaTest.scala | Scala | epl-1.0 | 5,900 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.testsuite.utils
import or... | scala-js/scala-js | test-suite/js/src/test/scala/org/scalajs/testsuite/utils/Requires.scala | Scala | apache-2.0 | 711 |
/**
* Copyright (c) 2014 Mark S. Kolich
* http://mark.koli.ch
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
... | markkolich/kolich-twitter | project/Build.scala | Scala | mit | 5,681 |
package com.ponkotuy.http
import java.io._
import java.nio.charset.Charset
import java.util.concurrent.TimeUnit
import javax.net.ssl.SSLContext
import com.ponkotuy.build.BuildInfo
import com.ponkotuy.config.ClientConfig
import com.ponkotuy.data.{Auth, MyFleetAuth}
import com.ponkotuy.restype._
import com.ponkotuy.too... | nekoworkshop/MyFleetGirls | client/src/main/scala/com/ponkotuy/http/MFGHttp.scala | Scala | mit | 6,861 |
/**Copyright 2012 University of Helsinki, Daria Antonova, Herkko Virolainen, Panu Klemola
*
*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 ... | Herkko/ElasticWorkflow | app/format/ModelFormat.scala | Scala | apache-2.0 | 1,283 |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\\
* @ @ *
* # # # # (c) 2017 CAB *
* # # # # # # ... | AlexCAB/MathAct | mathact_tools/src/main/scala/mathact/tools/math/BooleanLogic.scala | Scala | mit | 2,469 |
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.