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 sss.ancillary
import java.util.Base64
/**
* Created by alan on 4/5/16.
*/
object ByteArrayEncodedStrOps {
implicit class ByteArrayToBase64UrlStr(bs: Array[Byte]) {
def toBase64Str: String = Base64.getUrlEncoder.withoutPadding.encodeToString(bs)
}
implicit class Base64StrToByteArray(hex:String) ... | mcsherrylabs/sss.ancillary | src/main/scala/sss/ancillary/ByteArrayEncodedStrOps.scala | Scala | gpl-3.0 | 398 |
object Seidel extends App{
def method(a:Array[Array[Double]],b:Array[Double]) ={
val n = a.length
val eps = 0.00001
var p = Array.empty[Double]
val x = new Array[Double](n)
def converge(xk:Array[Double], xkp:Array[Double]):Boolean = {
var norm:Double = 0
for (i <- 0 until n)
n... | dnoskov/cm | Iterative/src/main/scala/Seidel.scala | Scala | mit | 850 |
package tutorial.webapp
import scala.scalajs.js.JSApp
import scala.scalajs.js.annotation.JSExport
import org.scalajs.jquery._
import scala.scalajs.js
object TutorialApp extends JSApp {
def afficheIti(iti:js.Dynamic): String = {
if(iti.status.toString == "OK"){
val r = iti.routes.asInstanceOf[js.Dictionary... | GIorfindel/transports | requete_ajax_scalajs/scalajs_to_javascript/src/main/scala/tutorial/webapp/TutorialApp.scala | Scala | gpl-3.0 | 2,091 |
package models
import controllers.external.ChannelLong
import org.joda.time.{DateTime, DateTimeZone}
import org.scalatest.MustMatchers
import org.scalatestplus.play.PlaySpec
class TVChannelSpec extends PlaySpec with MustMatchers {
val channel = ChannelLong(TVChannel("CHANNEL 1 PLUS", List(), List(), None))("http://... | tvlive/tv-api | test/unit/models/TVChannelSpec.scala | Scala | apache-2.0 | 1,205 |
/***********************************************************************
* 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-cassandra/geomesa-cassandra-tools/src/main/scala/org/locationtech/geomesa/cassandra/tools/commands/CassandraCreateSchemaCommand.scala | Scala | apache-2.0 | 1,438 |
class Cell[T](x0: T) {
type U = T
var x1: U = x0
}
object Test {
val str: Cell[String] = new Cell("a")
val other: Cell[Int] = new Cell(0)
def main(args: Array[String]): Unit = {
List(str, other) foreach (_.x1 = new AnyRef)
str.x1.length
}
}
// another way demonstrating the same underlying problem... | felixmulder/scala | test/files/neg/t5120.scala | Scala | bsd-3-clause | 639 |
/**
* Generated by apidoc - http://www.apidoc.me
* Service version: 0.2.12
* apidoc:0.11.84 http://www.apidoc.me/flow/error/0.2.12/play_2_x_json
*/
package io.flow.error.v0.models {
/**
* An error of some type has occured. The most common error will be validation on
* input. See messages for details.
*/... | flowcommerce/splashpage | api/app/generated/FlowErrorV0Models.scala | Scala | mit | 7,468 |
/*
* 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 | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesExecutorBuilder.scala | Scala | apache-2.0 | 2,768 |
package com.nulabinc.backlog.r2b.cli
import com.nulabinc.backlog.migration.common.modules.{ServiceInjector => BacklogInjector}
import com.nulabinc.backlog.migration.common.service.SpaceService
import com.nulabinc.backlog.migration.common.utils.{ConsoleOut, Logging}
import com.nulabinc.backlog.r2b.conf.AppConfiguration... | nulab/BacklogMigration-Redmine | src/main/scala/com/nulabinc/backlog/r2b/cli/ParameterValidator.scala | Scala | mit | 5,061 |
/*
* Copyright (c) 2014 Snowplow Analytics Ltd.
* All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache
* License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at
* http://www.... | mdavid/lessig-bigdata | lib/snowplow/4-storage/kinesis-elasticsearch-sink/src/main/scala/com.snowplowanalytics.snowplow.storage.kinesis/elasticsearch/sinks/KinesisSink.scala | Scala | mit | 4,670 |
/* This file is part of ZikDroid.
* Copyright (C) 2015 Sacha Delanoue <[email protected]>
*
* ZikDroid 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... | Shaac/ZikDroid | src/Connection.scala | Scala | gpl-3.0 | 2,609 |
/*
* 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/src/main/scala/org/scalatest/DistributedTestSorter.scala | Scala | apache-2.0 | 2,667 |
/*
* Copyright 2016 rdbc contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | rdbc-io/rdbc-pgsql | rdbc-pgsql-core/src/main/scala/io/rdbc/pgsql/core/internal/protocol/messages/frontend/CloseStatement.scala | Scala | apache-2.0 | 750 |
package com.citypay.pan.search.io
case class FileSignature(name: String, extensions: List[String], signature: Array[Byte], offset: Int) {
/**
* Checks to see if a signature matches
*
* @param arr array to test against the signature
* @return true if the full signature byte length
*/
//noinspe... | citypay/citypay-pan-search | src/main/scala/com/citypay/pan/search/io/FileSignature.scala | Scala | mit | 599 |
/*start*/1 == 1/*end*/
//Boolean | ilinum/intellij-scala | testdata/typeInference/methodCall/InfixIntegers.scala | Scala | apache-2.0 | 32 |
package org.programmiersportgruppe.scala.commons
package basics
object Lists {
implicit final class AugmentedList[A](val self: List[A]) extends AnyVal {
/** Removes the first occurrence of a value from the list.
*
* This method uses a stack frame per element until it finds a matching value or the e... | programmiersportgruppe/scala-commons | basics/src/main/scala/org/programmiersportgruppe/scala/commons/basics/Lists.scala | Scala | bsd-2-clause | 625 |
package uk.ac.ncl.openlab.intake24.services.fooddb.admin
import uk.ac.ncl.openlab.intake24.api.data.admin._
import uk.ac.ncl.openlab.intake24.errors._
trait CategoriesAdminService {
def getCategoryRecord(code: String, locale: String): Either[LocalLookupError, CategoryRecord]
def isCategoryCodeAvailable(code: St... | digitalinteraction/intake24 | FoodDataServices/src/main/scala/uk/ac/ncl/openlab/intake24/services/fooddb/admin/CategoriesAdminService.scala | Scala | apache-2.0 | 1,130 |
package de.m7w3.signal
import de.m7w3.signal.messages.MessageSender
import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage
import scala.collection.mutable
object TestMessageSender extends MessageSender {
val queue = mutable.Queue.empty[SignalServiceSyncMessage]
override def s... | ayoub-benali/signal-desktop-client | src/test/scala/de/m7w3/signal/TestMessageSender.scala | Scala | apache-2.0 | 396 |
package rescala.fullmv.mirrors
import rescala.fullmv.sgt.synchronization.{LockStateResult0, SubsumableLock}
import scala.concurrent.Future
sealed trait RemoteTryLockResult
case class RemoteLocked(newRoot: SubsumableLock) extends RemoteTryLockResult
sealed trait RemoteTrySubsumeResult
case object RemoteSubsumed exte... | guidosalva/REScala | Code/Main/jvm/src/main/scala/rescala/fullmv/mirrors/SubsumableLockProxy.scala | Scala | apache-2.0 | 1,457 |
package edu.rice.habanero.benchmarks.fjthrput
import edu.rice.habanero.actors.{JetlangActor, JetlangActorState, JetlangPool}
import edu.rice.habanero.benchmarks.{Benchmark, BenchmarkRunner}
/**
*
* @author <a href="http://shams.web.rice.edu/">Shams Imam</a> ([email protected])
*/
object ThroughputJetlangActorBenchmar... | shamsmahmood/savina | src/main/scala/edu/rice/habanero/benchmarks/fjthrput/ThroughputJetlangActorBenchmark.scala | Scala | gpl-2.0 | 1,617 |
import com.typesafe.config._
import simplelib._
object ComplexApp extends App {
// This app is "complex" because we load multiple separate app
// configs into a single JVM and we have a separately-configurable
// context for simple lib.
// using a custom Config with the simple-lib library
// (sim... | jasonchaffee/config | examples/scala/complex-app/src/main/scala/ComplexApp.scala | Scala | apache-2.0 | 2,837 |
package gapt.cli
import gapt.examples.Script
import gapt.formats.ClasspathInputFile
import scala.tools.nsc.interpreter._
import scala.tools.nsc.Settings
import ammonite.ops._
object CLIMain {
class ScriptsResultHolder( var result: Seq[Script] = Seq() ) {
def add( script: Script ): Unit = result :+= script
}... | gapt/gapt | cli/src/main/scala/CLIMain.scala | Scala | gpl-3.0 | 626 |
package definiti.core.end2end.controls
import definiti.common.ast.Root
import definiti.common.program.Ko
import definiti.common.tests.{ConfigurationMock, LocationPath}
import definiti.core.Constants
import definiti.core.ProgramResultMatchers._
import definiti.core.end2end.EndToEndSpec
import definiti.core.validation.c... | definiti/definiti-core | src/test/scala/definiti/core/end2end/controls/TypeReferenceParametersControlSpec.scala | Scala | mit | 2,800 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package termination
import purescala.Path
import purescala.Expressions._
import purescala.ExprOps._
import purescala.Types._
import purescala.TypeOps._
import purescala.Constructors._
import purescala.Common._
trait ChainComparator { self : StructuralSize =>
va... | epfl-lara/leon | src/main/scala/leon/termination/ChainComparator.scala | Scala | gpl-3.0 | 6,937 |
/*
* Copyright 2012 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... | srijs/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/common/Annotation.scala | Scala | apache-2.0 | 1,847 |
package de.leanovate.swaggercheck.schema
import com.fasterxml.jackson.annotation.{JsonCreator, JsonProperty}
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import de.leanovate.swaggercheck.SwaggerChecks
import de.leanovate.swaggercheck.schema.Operation.RequestBuilder
import de.leanovate.swaggercheck.... | leanovate/swagger-check | swagger-check-core/src/main/scala/de/leanovate/swaggercheck/schema/OperationParameter.scala | Scala | mit | 3,560 |
package skinny
package object util {
type TimeLogging = skinny.logging.TimeLogging
}
| xerial/skinny-micro | micro-common/src/main/scala/skinny/util/package.scala | Scala | bsd-2-clause | 90 |
package eu.timepit.refined.scalacheck
import eu.timepit.refined.W
import eu.timepit.refined.api.Refined
import eu.timepit.refined.boolean.Or
import eu.timepit.refined.char._
import eu.timepit.refined.numeric.Interval
import eu.timepit.refined.scalacheck.boolean._
import eu.timepit.refined.scalacheck.char._
import eu.t... | fthomas/refined | modules/scalacheck/shared/src/test/scala-3.0-/eu/timepit/refined/scalacheck/CharArbitrarySpec.scala | Scala | mit | 1,122 |
class A extends (Int => i1) // error
class B extends (Int => this) // error
trait C {
val bar: Int => this // error
}
// Test that function types ending in SIP-23 singleton types are understood correctly.
class D extends (Int => 1) {
def apply(x: Int) = 2 // error
}
class Wrap(x: Int)
class E extends (Wrap)(
// ... | lampepfl/dotty | tests/neg/parser-stability-25.scala | Scala | apache-2.0 | 325 |
/*
* Copyright 2011-2021 Asakusa Framework Team.
*
* 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 ... | asakusafw/asakusafw-spark | extensions/iterativebatch/runtime/core/src/test/scala/com/asakusafw/spark/extensions/iterativebatch/runtime/graph/DirectOutputCommitForIterativeSpec.scala | Scala | apache-2.0 | 7,137 |
/*
* 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 ... | sh-cho/cshSpark | status/api/v1/AllJobsResource.scala | Scala | apache-2.0 | 3,721 |
package pl.newicom.dddd.test.ar
import akka.actor._
import akka.testkit.TestKit
import org.scalacheck.{Arbitrary, Gen}
import org.scalatest.{BeforeAndAfter, BeforeAndAfterAll, WordSpecLike}
import org.slf4j.Logger
import org.slf4j.LoggerFactory.getLogger
import pl.newicom.dddd.actor.{ActorFactory, BusinessEntityActorF... | pawelkaczor/akka-ddd | akka-ddd-test/src/main/scala/pl/newicom/dddd/test/ar/ARSpec.scala | Scala | mit | 2,843 |
package scjson.codec
import scjson.ast.*
private object JsonEncoder {
/** unparse a JsonValue into a String */
def encode(v:JsonValue, pretty:Boolean):String = {
val builder = new StringBuilder
val encoder = new JsonEncoder(builder, pretty)
v.visit(encoder)
builder.toString
}
private val indention = "\t"... | ritschwumm/scjson | modules/codec/src/main/scala/JsonEncoder.scala | Scala | bsd-2-clause | 2,634 |
// ** Representing a MongoDB collection as a DataFrame **
//Import the relevant packages and classes
import com.mongodb.casbah.{WriteConcern => MongodbWriteConcern}
import com.stratio.provider._
import com.stratio.provider.mongodb._
import com.stratio.provider.mongodb.schema._
import com.stratio.provider.mongodb.writ... | matthewkalan/mongodb-analytics-examples | spark-scala-dataframe-example.scala | Scala | apache-2.0 | 4,720 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | aokolnychyi/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/types/ShortType.scala | Scala | apache-2.0 | 2,163 |
package at.forsyte.apalache.tla.typecheck.etc
import at.forsyte.apalache.tla.typecheck.VarT1
class TypeVarPool(start: Int = 0) {
/**
* The counter that we use to produce fresh variables
*/
private var nextVarNum = start
def fresh: VarT1 = {
val fresh = VarT1(nextVarNum)
nextVarNum += 1
fres... | konnov/apalache | tla-types/src/main/scala/at/forsyte/apalache/tla/typecheck/etc/TypeVarPool.scala | Scala | apache-2.0 | 474 |
package com.plz.scala.functionvaluesandclosures
/**
* @author lover
*/
object ObjectTest {
} | piaolinzhi/fight | scala-learning/src/main/scala/com/plz/scala/functionvaluesandclosures/ObjectTest.scala | Scala | gpl-2.0 | 98 |
/**
* Generated by Scrooge
* version: 3.14.1
* rev: a996c1128a032845c508102d62e65fc0aa7a5f41
* built at: 20140501-114733
*/
package cn.changhong.app.webapi.core
import com.twitter.finagle.{SourcedException, Service => FinagleService}
import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver}
import... | guoyang2011/myfinagle | finagle-thrift-zipkin-cluster/src/main/scala/cn/changhong/app/webapi/core/IndexNewsOperatorServices$FinagleClient.scala | Scala | apache-2.0 | 4,968 |
package com.geeksville.flight
import org.mavlink.messages.ardupilotmega.msg_mission_item
import org.mavlink.messages.MAV_CMD
import org.mavlink.messages.MAV_FRAME
/**
* A wrapper for waypoints - to provide a higher level API
*/
case class Waypoint(val msg: msg_mission_item) {
private val frameCodes = Map(
MA... | geeksville/arduleader | common/src/main/scala/com/geeksville/flight/Waypoint.scala | Scala | gpl-3.0 | 7,098 |
/**
* Copyright (c) 2016 Intel Corporation
*
* 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 applicabl... | ashaarunkumar/spark-tk | sparktk-core/src/test/scala/org/trustedanalytics/sparktk/frame/internal/ops/cumulativedist/EcdfTest.scala | Scala | apache-2.0 | 3,281 |
package mesosphere.marathon
package core.appinfo
trait Selector[A] {
def matches(a: A): Boolean
}
object Selector {
def apply[A](f: A => Boolean): Selector[A] =
new Selector[A] {
override def matches(a: A): Boolean = f(a)
}
def all[A]: Selector[A] = Selector[A] { _ => true }
def none[A]: Sel... | mesosphere/marathon | src/main/scala/mesosphere/marathon/core/appinfo/Selector.scala | Scala | apache-2.0 | 510 |
package com.mesosphere.cosmos
import com.mesosphere.cosmos.http.RequestSession
import com.mesosphere.cosmos.thirdparty.marathon.model.{AppId, MarathonAppResponse, MarathonAppsResponse}
import com.mesosphere.cosmos.thirdparty.marathon.circe.Decoders._
import com.netaporter.uri.Uri
import com.netaporter.uri.dsl._
import... | movicha/cosmos | cosmos-server/src/main/scala/com/mesosphere/cosmos/MarathonClient.scala | Scala | apache-2.0 | 1,874 |
/*
* 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/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala | Scala | apache-2.0 | 23,518 |
// Project: angulate2-examples
// Module:
// Description:
// Copyright (c) 2017. Distributed under the MIT License (see included LICENSE file).
package routing.admin
import angulate2.std._
import angulate2.ext.tags.simple._
import angulate2.router.ActivatedRoute
import rxjs.Observable
import scala.scalajs.j... | jokade/angulate2-examples | routing/src/main/scala/routing/admin/AdminDashboardComponent.scala | Scala | mit | 870 |
package com.kadwa.cassandraexport
import com.asimma.ScalaHadoop._
import org.apache.hadoop.io.{Text, LongWritable}
import ImplicitConversion._
import scala.collection.JavaConversions._
/*
* Created by Neville Kadwa.
*/
object MapReduceMain extends ScalaHadoopTool {
object CassandraExportAttributeMapper extends ... | kadwanev/cassandra-export | src/main/scala/com/kadwa/cassandraexport/MapReduceMain.scala | Scala | gpl-2.0 | 2,669 |
package org.pico.twiddle
import scala.language.higherKinds
trait ArrayIndexed[F[_], @specialized(Byte, Short, Int, Long) E] {
def setAtIndex(indexed: F[E], i: Bits, v: E): Unit
def getAtIndex(indexed: F[E], i: Bits): E
}
| newhoggy/pico-cuckoo-filter | pico-twiddle/src/main/scala/org/pico/twiddle/ArrayIndexed.scala | Scala | bsd-3-clause | 228 |
package edu.rit.csh.scaladb.serialization.binary
import scala.language.experimental.macros
import scala.reflect.macros.blackbox
/**
* Generates BinarySerializers for case classes. This will have compile time failures if
* tried to be used on other type of classes
*/
object BinaryMacro {
def impl[T: c.WeakTypeTag... | JDrit/RaftService | serialization/src/main/scala/edu/rit/csh/scaladb/serialization/binary/BinaryMacro.scala | Scala | apache-2.0 | 2,961 |
package skinny.engine.test
import java.io.OutputStream
object NullOut extends OutputStream {
def write(b: Int) {}
}
| holycattle/skinny-framework | engine-test/src/main/scala/skinny/engine/test/NullOut.scala | Scala | mit | 122 |
/*
* 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 ... | tillrohrmann/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/trait/ModifyKindSetTrait.scala | Scala | apache-2.0 | 3,070 |
package org.bitcoins.core.wallet.builder
import org.bitcoins.core.config.{BitcoinNetwork, NetworkParameters}
import org.bitcoins.core.crypto.{
ECDigitalSignature,
EmptyDigitalSignature,
TransactionSignatureSerializer,
WitnessTxSigComponentP2SH
}
import org.bitcoins.core.currency.{CurrencyUnit, CurrencyUnits, S... | bitcoin-s/bitcoin-s-core | core/src/main/scala/org/bitcoins/core/wallet/builder/TxBuilder.scala | Scala | mit | 40,701 |
package dregex
import dregex.impl.RegexTree
import scala.collection.mutable.ArrayBuffer
import dregex.impl.UnicodeChar
/**
* Generates, given a regex tree, sample strings that match the regex.
*/
object StringGenerator {
import RegexTree._
def generate(regex: Node, maxAlternatives: Int, maxRepeat: Int): Seq... | marianobarrios/dregex | src/test/scala/dregex/StringGenerator.scala | Scala | bsd-2-clause | 2,403 |
package io.mth.dross
import org.scalatest.FunSuite
// FIX Replace with an automated scalacheck test.
class DrossManualTest extends FunSuite {
test("manual test") {
}
}
| markhibberd/dross | src/test/io/mth/dross/DrossManualTest.scala | Scala | bsd-3-clause | 174 |
/**
* Copyright 2015 ICT.
*
* 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
... | DataSysLab/netflow | common/src/main/scala/cn/ac/ict/acs/netflow/ha/PersistenceEngine.scala | Scala | apache-2.0 | 1,833 |
/*
* Copyright (c) 2012-2016 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | acgray/snowplow | 3-enrich/scala-common-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.common/enrichments/registry/apirequest/CacheSpec.scala | Scala | apache-2.0 | 2,127 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// Licence: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.core
import Predef.{any2stringadd => _}
import scala.reflect.internal.util.Position
/**
* Simulate methods that were added in later versions of the scalac
* API, or to... | d1egoaz/ensime-sbt | src/sbt-test/sbt-ensime/ensime-server/core/src/main/scala-2.11/org/ensime/core/PresentationCompilerBackCompat.scala | Scala | apache-2.0 | 690 |
/**
* Digi-Lib - base library for Digi components
*
* Copyright (c) 2012-2014 Alexey Aksenov [email protected]
*
* 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.... | ezh/digi-lib | src/main/scala/org/digimead/digi/lib/log/Message.scala | Scala | apache-2.0 | 1,136 |
package 除.step1
trait 商
class 商Zero extends 商
class 商Positive[I <: 商] extends 商
trait 被除数 {
type 除以[N <: 除数] <: 商
}
class 被除数Zero extends 被除数 {
override type 除以[N <: 除数] = 商Zero
}
class 被除数Positive[Tail <: 被除数, Head] extends 被除数 {
override type 除以[N <: 除数] = N#除[Tail]
}
trait 除数 {
type 除[CTail ... | djx314/ubw | a24-五法/src/main/scala/除/step1/除.scala | Scala | bsd-3-clause | 671 |
package com.sksamuel.scapegoat.inspections.empty
import com.sksamuel.scapegoat.{ Inspection, InspectionContext, Inspector, Levels }
/** @author Stephen Samuel */
class EmptyWhileBlock extends Inspection {
def inspector(context: InspectionContext): Inspector = new Inspector(context) {
override def postTyperTrav... | pwwpche/scalac-scapegoat-plugin | src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyWhileBlock.scala | Scala | apache-2.0 | 732 |
// Card types
abstract class BrownOrGreyCard extends Card {
val res: Resources
override def benefit(p: PlayerState, g: GameState) = p addResources res
}
abstract class BrownCard extends BrownOrGreyCard {
override def toString = SevenCli.brown + super.toString + Console.RESET
}
abstract class GreyCard extend... | Valodim/SevenWonders | Cards.scala | Scala | gpl-3.0 | 14,137 |
/*
* 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 ... | irudyak/ignite | modules/scalar/src/main/scala/org/apache/ignite/scalar/pimps/ScalarGridPimp.scala | Scala | apache-2.0 | 3,663 |
package com.electronwill.niol.buffer.storage
/** Provides [[com.electronwill.niol.buffer.storage.BytesStorage]]s */
trait StorageProvider {
/** @return a storage with a capacity of at least `minCapacity` */
def getStorage(minCapacity: Int): BytesStorage
}
| TheElectronWill/Niol | main/src/com/electronwill/niol/buffer/storage/StorageProvider.scala | Scala | lgpl-3.0 | 261 |
package com.github.opengrabeso.mixtio
package moveslink
import Main.ActivityEvents
import common.Util._
import scala.annotation.tailrec
object MovesLinkUploader {
private def autodetectSport(data: ActivityEvents): ActivityEvents = {
// TODO: use differences from data.dist.stream instead of computing data.gps.... | OndrejSpanel/Stravamat | backend/src/main/scala/com/github/opengrabeso/mixtio/moveslink/MovesLinkUploader.scala | Scala | gpl-2.0 | 3,575 |
/**
* Created by MKucijan on 9.5.2017..
*/
object CryptographicConstantsExtended {
def getCryptoAPIs: Set[String] = getKeyParametarInitAPIs ++ getPBEKeySpecAPIs ++ getSecureRandomApis
/**
* Rule 3.
*/
final val Cipher_init_API_1="Ljavax/crypto/Cipher;.init:(ILjava/security/Key;)V"
final val Ciphe... | mkucijan/Android-crypto-misuse-checker | src/main/scala/CryptographicConstantsExtended.scala | Scala | gpl-3.0 | 2,119 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package expr
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement
/**
* @author Alexander Podkhalyuzin
*/
trait ScGuard extends ScalaPsiElement {
def expr: Option[ScExpression]
override def accept(visitor: ScalaElementVisitor) = v... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/api/expr/ScGuard.scala | Scala | apache-2.0 | 345 |
/**
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.util
import language.implicitConversions
import java.util.concurrent.TimeUnit
import java.lang.{ Double ⇒ JDouble }
import scala.concurrent.duration.{ Duration, FiniteDuration }
@SerialVersionUID(1L)
case class Timeout(duration:... | jmnarloch/akka.js | akka-js-actor/jvm/src/main/scala/akka/util/Timeout.scala | Scala | bsd-3-clause | 1,002 |
package com.twitter.finatra.conversions
import com.github.nscala_time.time.{DurationBuilder, Implicits}
import com.twitter.util.{Duration => TwitterDuration, Time}
import org.joda.time.{DateTime, DateTimeZone, Duration}
/**
* Add additional conversions to 'scala-time' and also
* overcome issues with scala time joda... | tom-chan/finatra | utils/src/main/scala/com/twitter/finatra/conversions/time.scala | Scala | apache-2.0 | 1,773 |
package io.digitalmagic.akka.dsl
import scala.reflect.ClassTag
trait Event extends Product with Serializable {
type TimestampType
var timestamp: TimestampType
}
trait PersistentState extends Product with Serializable {
Self =>
type EventType <: Event
}
trait PersistentStateProcessor[T <: PersistentState] {
... | digital-magic-io/akka-cqrs-dsl | akka-cqrs-dsl-core/src/main/scala/io/digitalmagic/akka/dsl/EventSourced.scala | Scala | apache-2.0 | 653 |
/*
* 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 | resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/DecommissionSuite.scala | Scala | apache-2.0 | 5,525 |
package com.datastax.spark.connector.types
import com.datastax.driver.core.DataType
trait CustomDriverConverter {
val fromDriverRowExtension: PartialFunction[DataType, ColumnType[_]]
}
| ponkin/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/types/CustomDriverConverter.scala | Scala | apache-2.0 | 191 |
package databus
import api._
import com.google.inject.AbstractModule
import net.codingwell.scalaguice.ScalaModule
class DatabusModule extends AbstractModule with ScalaModule {
override def configure(): Unit = {
val usersServiceBinding = bind[UserService].to[UsersServiceImpl]
val gamesServiceBinding = bind[G... | salceson/toik-games-price-comparator | app/databus/DatabusModule.scala | Scala | mit | 360 |
package com.twitter.finagle.stats
import com.twitter.common.metrics.Metrics
import com.twitter.finagle.toggle.flag
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import scala.collection.JavaConverters._
@RunWith(classOf[JUnitRunner])
class StatsFormatterTest exten... | adriancole/finagle | finagle-stats/src/test/scala/com/twitter/finagle/stats/StatsFormatterTest.scala | Scala | apache-2.0 | 3,548 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | wzhongyuan/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/ops/FloorDivSpec.scala | Scala | apache-2.0 | 1,135 |
package piecewise.intervaltree
import cats.instances.double._
import org.scalacheck.Gen._
import org.scalacheck.Prop._
import org.scalacheck.{Gen, Properties}
import piecewise.intervaltree.Gens._
object IntervalTreeFold extends Properties("Interval Tree Fold"){
def segments(s: Int, n: Int): Gen[List[Int]] =
if ... | daniil-timofeev/gridsplines | piecewise/src/test/scala/piecewise/intervaltree/IntervalTreeFold.scala | Scala | apache-2.0 | 3,188 |
package newton
object Newton {
def sqrt(x: Double): Double = {
def sqrtIter(guess: Double): Double =
if (isGoodEnough(guess)) guess
else sqrtIter(improve(guess))
def improve(guess: Double): Double =
(guess + x / guess) / 2
def isGoodEnough(guess: Double): Boolean =
abs((guess *... | timtian090/Playground | Scala/scalabyexample/src/main/scala/Newton.scala | Scala | mit | 430 |
/*
* 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 ... | sh-cho/cshSpark | ui/scope/RDDOperationGraphListener.scala | Scala | apache-2.0 | 6,259 |
// Copyright (C) 2015 IBM Corp. All Rights Reserved.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may ob... | kane77/watson-scala-wrapper | src/main/scala/com/ibm/watson/developer_cloud/visual_insights/v1/model/VisualInsightsProtocol.scala | Scala | apache-2.0 | 1,100 |
package com.twitter.finagle.toggle
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.toggle.Toggle.Metadata
import com.twitter.logging.Logger
import java.nio.charset.StandardCharsets.UTF_8
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicReference
import ja... | twitter/finagle | finagle-toggle/src/main/scala/com/twitter/finagle/toggle/ToggleMap.scala | Scala | apache-2.0 | 19,043 |
package com.shocktrade.server.services.yahoo
import com.shocktrade.server.services.yahoo.YahooFinanceCSVHistoryService._
import io.scalajs.npm.moment.Moment
import io.scalajs.npm.request.Request
import scala.concurrent.{ExecutionContext, Future}
import scala.language.postfixOps
import scala.scalajs.js
import scala.sc... | ldaniels528/shocktrade.js | app/server/services/src/main/scala/com/shocktrade/server/services/yahoo/YahooFinanceCSVHistoryService.scala | Scala | apache-2.0 | 2,711 |
package com.xhachi.gae4s.datastore
import java.math
import java.math.BigInteger
import java.util.Date
import com.google.appengine.api.blobstore.BlobKey
import com.google.appengine.api.datastore._
import com.google.appengine.api.users
import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfi... | thachi/gae4s | core/src/test/scala/com/xhachi/gae4s/datastore/SimpleValueEntityTest.scala | Scala | apache-2.0 | 6,708 |
package P { // `X' bound by package clause
import Console._ // `println' bound by wildcard import
object A {
println("L4: " + X) // `X' refers to `P.X' here
object B {
import Q._ // `X' bound by wildcard import
println("L7: " + X) // `X' refers to `Q.X' here
import X._ // `x' and `y' bound... | reactormonk/dotty | tests/neg/typedIdents/typedIdents.scala | Scala | bsd-3-clause | 1,121 |
package lore.compiler.assembly.functions
import lore.compiler.core.{CompilationException, Position}
import lore.compiler.poem.{Poem, PoemInstruction}
import scala.collection.immutable.HashMap
object LabelResolver {
/**
* Resolves all label locations in the given instructions and transforms them into absolute ... | marcopennekamp/lore | compiler/src/lore/compiler/assembly/functions/LabelResolver.scala | Scala | mit | 3,045 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/nn/tf/FillSpec.scala | Scala | apache-2.0 | 2,296 |
/* Copyright 2009-2021 EPFL, Lausanne */
object MyTuple2 {
sealed abstract class A
case class B(i: Int) extends A
case class C(a: A) extends A
def foo(): Int = {
val t = (B(2), C(B(3)))
t match {
case (B(x), C(y)) => x
}
} ensuring(_ == 2)
}
| epfl-lara/stainless | frontends/benchmarks/verification/valid/MicroTests/MyTuple2.scala | Scala | apache-2.0 | 274 |
package edu.illinois.wala.ipa.callgraph
import com.ibm.wala.classLoader.{ClassLoaderFactoryImpl, JavaLanguage, Language}
import com.ibm.wala.ipa.callgraph.Entrypoint
import com.ibm.wala.ipa.callgraph.impl.DefaultEntrypoint
import com.ibm.wala.ipa.cha.ClassHierarchy
import com.ibm.wala.ipa.cha.ClassHierarchyFactory
imp... | cos/WALAFacade | src/main/scala/edu/illinois/wala/ipa/callgraph/AnalysisOptions.scala | Scala | epl-1.0 | 3,471 |
/*
* Copyright (C) 2005, The OpenURP 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... | openurp/api | qos/src/main/scala/org/openurp/qos/evaluation/clazz/model/FinalTeacherScore.scala | Scala | lgpl-3.0 | 1,160 |
package org.bfn.ninetynineprobs
import org.scalatest._
class P57Spec extends UnitSpec {
// TODO
}
| bfontaine/99Scala | src/test/scala/P57Spec.scala | Scala | mit | 105 |
package truerss.dto
case class SourceStatusDto(sourceId: Long, errorsCount: Int)
| truerss/truerss | dtos/src/main/scala/truerss/dto/SourceStatusDto.scala | Scala | mit | 82 |
package com.seanshubin.detangler.scanner
import java.nio.file.Path
trait FileScanner {
def loadBytes(jarOrDirectory: Path): Iterable[Seq[Byte]]
}
| SeanShubin/detangler | scanner/src/main/scala/com/seanshubin/detangler/scanner/FileScanner.scala | Scala | unlicense | 150 |
/*
* 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/src/main/scala/org/scalatest/time/SpanSugar.scala | Scala | apache-2.0 | 19,825 |
package im.actor.server.enrich
import scala.concurrent.ExecutionContextExecutor
import scala.util.{ Failure, Success, Try }
import akka.actor._
import akka.contrib.pattern.DistributedPubSubMediator
import akka.event.Logging
import akka.http.scaladsl.model.Uri
import akka.stream.Materializer
import com.sksamuel.scrima... | TimurTarasenko/actor-platform | actor-server/actor-enrich/src/main/scala/im/actor/server/enrich/RichMessageWorker.scala | Scala | mit | 4,669 |
/*
* Copyright 2009-2011 WorldWide Conferencing, LLC
*
* 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 o... | nornagon/json4s | tests/src/test/scala/org/json4s/Examples.scala | Scala | apache-2.0 | 6,888 |
package org.fayalite.agg.yahoo.finance
import java.io.File
import com.github.tototoshi.csv.CSVReader
import scala.collection.mutable
import scala.util.Try
import fa._
/**
* Quick converter for taking save output and building
* a per-day per-file index.
*/
trait YahooTestUtils {
val yahooSave : java.io.Fil... | ryleg/fayalite | agg/src/main/scala/org/fayalite/agg/yahoo/finance/YahooTestUtils.scala | Scala | mit | 1,695 |
/*
* 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
* distrib... | fusepoolP3/p3-silk | silk-learning/src/main/scala/de/fuberlin/wiwiss/silk/learning/active/linkselector/EntropySelector.scala | Scala | apache-2.0 | 1,421 |
import sbt._
import Keys._
import Import._
object B extends Build
{
override def rootProject = Some(a)
lazy val a = Project("a", file("a")) settings(
TaskKey[Unit]("taskA") := {}
)
lazy val b = Project("b", file("b")) settings(
TaskKey[Unit]("taskB") := {}
)
}
| dansanduleac/sbt | sbt/src/sbt-test/project/root-project/changes/RootA.scala | Scala | bsd-3-clause | 272 |
package org.cloudio.morpheus.square
import java.io.PrintWriter
import org.morpheus._
import org.morpheus.Morpheus._
/**
* Created by zslajchrt on 27/09/15.
*/
trait ShapeVisitor {
def visitRectangle(r: Rectangle): Unit
def visitSquare(s: Rectangle with Square): Unit
}
trait Shape {
def accept(sv: Shape... | zslajchrt/morpheus-tutor | src/main/scala/org/cloudio/morpheus/square/Square.scala | Scala | apache-2.0 | 13,232 |
package com.aesireanempire.eplus.gui.elements
import net.minecraft.enchantment.EnchantmentData
abstract class DataProvider[T] {
var dataSet: Array[T]
var hasUpdated: Boolean = false
def setData(data: Array[T]) = {
if(!dataSet.equals(data)) {
dataSet = data.clone()
hasUpda... | darkhax/EnchantingPlus-Scala | src/main/scala/com/aesireanempire/eplus/gui/elements/DataProvider.scala | Scala | lgpl-3.0 | 349 |
/*
* 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/metrics/JvmMetricsSet.scala | Scala | apache-2.0 | 1,830 |
/*
* Copyright 2015 The SIRIS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | simulator-x/feature | src/simx/components/ai/feature/recording/storage/xml/PullParsingSerialization.scala | Scala | apache-2.0 | 4,482 |
package com.munchii.sbt.resolver
import com.amazonaws.services.s3.{AmazonS3, AmazonS3URI}
import com.amazonaws.services.s3.model.{ListObjectsRequest, S3Object}
import java.io.{ByteArrayInputStream, File}
import java.nio.file.{Files, StandardCopyOption}
import java.util.List
import org.apache.ivy.plugins.repository.{Ab... | munchii/sbt-s3-resolver | src/main/scala/com/munchii/sbt/resolver/S3Repository.scala | Scala | apache-2.0 | 2,853 |
package rpm4s.build
import java.time.Instant
import rpm4s.data.FileEntry
import scodec.bits.ByteVector
case class FileInfo(
fileEntry: FileEntry,
content: ByteVector,
modtime: Instant,
user: String,
group: String
)
| lucidd/rpm4s | shared/src/main/scala/rpm4s/build/FileInfo.scala | Scala | mit | 228 |
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.