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 quizleague.web.maintain.util
import scalajs.js
import quizleague.web.model.Team
import quizleague.web.util.component.SelectWrapper
import quizleague.web.util.rx.RefObservable
class TeamManager(var teams: js.Array[SelectWrapper[Team]]) {
private var usedTeams = Set[String]()
def unusedTeams(other: RefOb... | gumdrop/quizleague-maintain | js/src/main/scala/quizleague/web/maintain/util/TeamManager.scala | Scala | mit | 613 |
/*
* Copyright 2014-2015
*
* 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 writ... | piyush-verma/genio-scala | src/main/scala/Reader.scala | Scala | apache-2.0 | 2,658 |
package io.fintrospect.renderers.simplejson
import com.twitter.finagle.http.path.Path
import com.twitter.finagle.http.{Request, Response}
import io.fintrospect.formats.Argo
import io.fintrospect.formats.Argo.JsonFormat.{Field, obj}
import io.fintrospect.formats.Argo.ResponseBuilder._
import io.fintrospect.renderers.{J... | daviddenton/fintrospect | core/src/main/scala/io/fintrospect/renderers/simplejson/SimpleJson.scala | Scala | apache-2.0 | 1,257 |
package util.enrich_my_library
/**
* @author ynupc
* Created on 2017/05/01
*/
trait StringUtilsConversions {
protected def str: String
def replaceAllLiteratim(target: CharSequence, replacement: CharSequence): String
def quote(quotation: (String, String)): String
def codePointNumber: Int
def... | ynupc/scalastringcourseday4 | src/main/scala/util/enrich_my_library/StringUtilsConversions.scala | Scala | apache-2.0 | 9,180 |
/*
* 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 ... | SnappyDataInc/spark | core/src/main/scala/org/apache/spark/ui/storage/StoragePage.scala | Scala | apache-2.0 | 6,391 |
/*
* =========================================================================================
* Copyright © 2015 the khronus project <https://github.com/hotels-tech/khronus>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You m... | despegar/khronus | khronus-core/src/main/scala/com/searchlight/khronus/model/MetricMeasurement.scala | Scala | apache-2.0 | 1,810 |
/*
* Copyright 2013 Akiyoshi Sugiki, University of Tsukuba
*
* 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... | axi-sugiki/kumoi | src/kumoi/core/mr/DWorker2.scala | Scala | apache-2.0 | 9,634 |
package com.microsoft.chgeuer
object TrackingSample {
def data() : Array[(Long, Double, Double)] = {
val normal : Long = 1000
val longDelay : Long = 3000
Array[(Long, Double, Double)](
(normal, 48.80175, 2.637859),
(normal, 48.8018, 2.637719),
(normal, 48.80186, 2.637579),
(nor... | DXTEDStreamHack2017/nrt17 | containers/flink/master/src/main/scala/com/microsoft/chgeuer/TrackingSample.scala | Scala | apache-2.0 | 60,011 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2015 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition of t... | digimead/digi-TABuddy-desktop | part-core-ui/src/main/scala/org/digimead/tabuddy/desktop/core/ui/operation/OperationViewSelect.scala | Scala | agpl-3.0 | 6,598 |
package scala.meta.tests.tokenizers
import java.nio.charset.StandardCharsets
import scala.meta.internal.io.InputStreamIO
import scala.meta.testkit.DiffAssertions
import org.scalameta.logger
class UnicodeEscapeSuite extends BaseTokenizerSuite with DiffAssertions {
// Read tests from external file because scalac proc... | xeno-by/scalameta | tests/jvm/src/test/scala/scala/meta/tests/tokenizers/UnicodeEscapeSuite.scala | Scala | bsd-3-clause | 1,007 |
package io.scrapeyard
import org.jvnet.mock_javamail.Mailbox
import org.scalatest.concurrent.Eventually
import org.scalatest.{Matchers, WordSpecLike}
import scala.concurrent.duration._
import scala.language.postfixOps
class ScrapeMailerSpec extends WordSpecLike with Matchers with Eventually {
"send an email" in ... | zoltanmaric/scrapeyard | server/src/test/scala/io/scrapeyard/ScrapeMailerSpec.scala | Scala | gpl-2.0 | 739 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2010, 2011 Mark Harrah
*/
package sbt.complete
import Parser._
import sbt.Types.{ left, right, some }
import sbt.Util.{ makeList, separate }
/**
* A String parser that provides semi-automatic tab completion.
* A successful parse results in a value of type `T`.
* The... | jaceklaskowski/sbt | util/complete/src/main/scala/sbt/complete/Parser.scala | Scala | bsd-3-clause | 38,246 |
import com.google.inject.AbstractModule
import db.dao._
import services._
import play.api.{Configuration, Environment}
class Module(environment: Environment, configuration: Configuration) extends AbstractModule {
override def configure(): Unit = {
// DAOs
bind(classOf[MapDao]).to(classOf[PostgresMapDao])
... | trifectalabs/roadquality | api/app/Module.scala | Scala | bsd-3-clause | 824 |
/*
* Copyright 2014 Aurel Paulovic (aurel.paulovic@gmail.com) (aurelpaulovic.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
* ... | AurelPaulovic/crdt | src/main/scala/com/aurelpaulovic/crdt/util/TotalTimeClock.scala | Scala | apache-2.0 | 2,196 |
package com.gu.notifications.worker.delivery.fcm.oktransport
import java.io.ByteArrayInputStream
import java.util.concurrent.ConcurrentLinkedQueue
import com.google.api.client.http.{LowLevelHttpRequest, LowLevelHttpResponse}
import okhttp3.{Headers, MediaType, OkHttpClient, Request, RequestBody, Response, ResponseBod... | guardian/mobile-n10n | notificationworkerlambda/src/main/scala/com/gu/notifications/worker/delivery/fcm/oktransport/OkGoogleHttpRequest.scala | Scala | apache-2.0 | 3,666 |
import scala.collection.mutable.ArrayBuffer
// ****************************************************************************
class FastqIterator( file_name: String ) extends InputFile( file_name ) {
var fastq: FastqSequence = null
// **************************************************************************
def... | annashcherbina/sherlockstoolkit | scala_snp_caller/src/FastqIterator.scala | Scala | gpl-3.0 | 2,295 |
/**
* Copyright 2016, deepsense.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/it/scala/io/deepsense/deeplang/doperations/examples/GetFromVectorExample.scala | Scala | apache-2.0 | 1,660 |
package scorex.integration
import java.nio.ByteBuffer
import scorex.Controller
import Controller._
import org.scalatest.FunSuite
import scorex.block.Block
import scorex.consensus.{ConsensusModuleNxt, ConsensusModuleQora}
import scorex.network.message.{Message, BlockMessage}
import scorex.settings.{Constants, Settings}... | Pole-he/Scorex-Lagonaki | src/test/scala/scorex/integration/ValidChainGenerationSpecification.scala | Scala | cc0-1.0 | 1,927 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/Quasar | web/src/main/scala/quasar/api/zip.scala | Scala | apache-2.0 | 6,022 |
/***********************************************************************
* Copyright (c) 2013-2020 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | aheyne/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/filter/BoundsFilterVisitorTest.scala | Scala | apache-2.0 | 1,312 |
/*
* 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 ma... | harperjiang/enc-selector | src/main/scala/edu/uchicago/cs/encsel/dataset/feature/AdjInvertPair.scala | Scala | apache-2.0 | 2,490 |
package com.thoughtworks.deeplearning
package plugins
import com.thoughtworks.deeplearning.scalatest.ThoughtworksFutureToScalaFuture
import com.thoughtworks.each.Monadic._
import com.thoughtworks.feature.{Factory, ImplicitApply}
import com.thoughtworks.raii.asynchronous._
import org.nd4j.linalg.api.ndarray.INDArray
im... | izhangzhihao/DeepLearning.scala | plugins-CumulativeINDArrayLayers/src/test/scala-2.11/com/thoughtworks/deeplearning/plugins/CumulativeINDArrayLayersSpec.scala | Scala | apache-2.0 | 28,145 |
package edu.gemini.pit.ui.util
import edu.gemini.pit.ui.util.SimpleToolbar.IconButton
import javax.swing.Icon
import scala.swing.Button
import scala.swing.event.ButtonClicked
object ToolButton {
def apply(icon: Icon, disabledIcon: Icon, tooltipText: String)(f: => Unit) =
new ToolButton(icon, disabledIcon, toolt... | arturog8m/ocs | bundle/edu.gemini.pit/src/main/scala/edu/gemini/pit/ui/util/ToolButton.scala | Scala | bsd-3-clause | 641 |
package jitd.rewrite
import jitd.spec._
object MatchToStatement
{
type VarName = String
type NodeType = String
def unroll(
definition: Definition,
pattern: MatchPattern,
extractName: VarName,
targetExpression: Expression,
addornot:Boolean
):
Seq[ (VarName, NodeType, Expression) ]... | UBOdin/jitd-synthesis | src/main/scala/jitd/rewrite/MatchToStatement.scala | Scala | apache-2.0 | 9,261 |
package net.tomasherman.specus.common.api.plugin.config
/**
* This file is part of Specus.
*
* Specus 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 optio... | tomasherman/specus | common_api/src/main/scala/plugin/config/pluginConfig.scala | Scala | gpl-3.0 | 1,405 |
import at.logic.gapt.algorithms.rewriting.TermReplacement
import at.logic.gapt.expr.fol.reduceHolToFol
import at.logic.gapt.expr.hol.{CNFp, removeAllQuantifiers, CNFn, instantiate}
import at.logic.gapt.expr._
import at.logic.gapt.formats.tip.TipSmtParser
import at.logic.gapt.grammars._
import at.logic.gapt.proofs.expan... | loewenheim/gapt | examples/induction/prod_prop_31.scala | Scala | gpl-3.0 | 4,728 |
/** Copyright 2015 TappingStone, 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 ... | beni55/PredictionIO | data/src/test/scala/io/prediction/data/webhooks/exampleform/ExampleFormConnectorSpec.scala | Scala | apache-2.0 | 4,823 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | ddseapy/geomesa | geomesa-hbase/geomesa-hbase-tools/src/main/scala/org/locationtech/geomesa/hbase/tools/stats/HBaseStatsCountCommand.scala | Scala | apache-2.0 | 1,352 |
/*
* 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 ... | big-pegasus/spark | core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala | Scala | apache-2.0 | 29,020 |
package io.scalac.frees.login.obsolete
import freestyle.free
import io.scalac.frees.login.algebras.GitHubData
import io.scalac.frees.login.types._
sealed trait UserInsertionResult
case class UserInserted(id: UserId) extends UserInsertionResult
case object AlreadyExists extends UserInsertionResult
case class DBFail... | LGLO/freestyle-login | src/main/scala/io/scalac/frees/login/obsolete/Database.scala | Scala | apache-2.0 | 922 |
/*
* 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 ... | mandar2812/bayeslearn | src/main/scala/io/github/mandar2812/dynaml/models/KernelBayesianModel.scala | Scala | apache-2.0 | 9,664 |
package jk_5.nailed.event
/**
* No description given
*
* @author jk-5
*/
class NailedEvent {
private var canceled = false
@inline def isCancelable = false
@inline final def isCanceled = this.canceled
@inline final def setCanceled(cancel: Boolean) = this.canceled = cancel
}
| nailed/nailed-legacy | src/main/scala/jk_5/nailed/event/NailedEvent.scala | Scala | unlicense | 287 |
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright 2016-2020 Daniel Urban and contributors listed in NOTICE.txt
*
* 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.ap... | durban/exp-reagents | bench/src/main/scala/dev/tauri/choam/bench/util/StmStack.scala | Scala | apache-2.0 | 1,412 |
package edu.rice.habanero.benchmarks.banking
import edu.rice.habanero.actors.{GparsActor, GparsActorState, GparsPool}
import edu.rice.habanero.benchmarks.banking.BankingConfig._
import edu.rice.habanero.benchmarks.{Benchmark, BenchmarkRunner}
import scala.collection.mutable.ListBuffer
import scala.util.Random
/**
*... | smarr/savina | src/main/scala/edu/rice/habanero/benchmarks/banking/BankingGparsManualStashActorBenchmark.scala | Scala | gpl-2.0 | 4,544 |
/*
* 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 ... | WangTaoTheTonic/flink | flink-runtime/src/test/scala/org/apache/flink/runtime/jobmanager/JobManagerConnectionTest.scala | Scala | apache-2.0 | 5,210 |
package akka.persistence
import akka.actor._
import scalaz._
import Scalaz._
import streamz.akka.persistence.Event
class EventReader(pid: String, from: Long) extends Actor {
import EventReader._
import BufferedView._
val view = context.actorOf(Props(new BufferedView(pid, BufferedViewSettings(fromSequenceNr =... | Astrac/streamz | streamz-akka-persistence/src/main/scala/akka/persistence/EventReader.scala | Scala | apache-2.0 | 711 |
package co.technius
import scala.language.experimental.macros
package object scalua {
implicit object IntConverter extends LuaConverter[Int] {
override def toJava(value: LuaValue): Option[Int] = value match {
case LuaInt(i) => Some(i)
case _ => None
}
override def toLua(value: Int): Lua... | Technius/scalua | src/main/scala/co/technius/scalua/package.scala | Scala | mit | 1,652 |
/*
* Copyright (c) 2014-2020 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... | alexandru/monifu | monix-reactive/shared/src/test/scala/monix/reactive/consumers/ForeachParallelAsyncConsumerSuite.scala | Scala | apache-2.0 | 2,700 |
package breeze.util
import javax.management.MBeanServer;
import java.lang.management.ManagementFactory;
import java.io.File
;
/**
*
* Outputs information about the heap
*
* http://blogs.sun.com/sundararajan/entry/programmatically_dumping_heap_from_java
* @author dlwh
*/
object HeapDump {
// This is the name o... | tjhunter/scalanlp-core | process/src/main/scala/breeze/util/HeapDump.scala | Scala | apache-2.0 | 802 |
/*
* Copyright 2014–2017 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | drostron/quasar | connector/src/main/scala/quasar/qscript/MapFuncCore.scala | Scala | apache-2.0 | 46,550 |
package com.criteo.vizatra.vizsql.js
import com.criteo.vizatra.vizsql.js.common._
import com.criteo.vizatra.vizsql.{DB, Query, VizSQL}
import scala.scalajs.js.JSConverters._
import scala.scalajs.js.annotation.JSExport
@JSExport("QueryParser")
object QueryParser {
@JSExport
def parse(query: String, db: DB): Parse... | criteo/vizsql | js/src/main/scala/com/criteo/vizatra/vizsql/js/QueryParser.scala | Scala | apache-2.0 | 1,075 |
package org.jetbrains.plugins.scala
package lang
package resolve
import com.intellij.openapi.progress.ProgressManager
import com.intellij.psi._
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.caches.CachesUtil
import org.jetbrains.plugins.scala.extensions.{PsiElementExt, PsiMethodExt, PsiNa... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/resolve/ReferenceExpressionResolver.scala | Scala | apache-2.0 | 26,998 |
package is.hail.types.physical
import is.hail.annotations.{CodeOrdering, Region, UnsafeOrdering}
import is.hail.asm4s._
import is.hail.expr.ir.{EmitCodeBuilder, EmitMethodBuilder}
import is.hail.types.physical.stypes.SCode
import is.hail.types.physical.stypes.concrete.{SCanonicalCall, SCanonicalCallCode}
import is.hai... | danking/hail | hail/src/main/scala/is/hail/types/physical/PCanonicalCall.scala | Scala | mit | 2,618 |
package com.azavea.opentransit.indicators.parameters
import com.azavea.opentransit.database.{ BoundariesTable, RoadsTable }
import scala.slick.jdbc.JdbcBackend.{Database, DatabaseDef, Session}
import com.azavea.gtfs.io.database._
import com.azavea.gtfs._
import com.azavea.opentransit._
import com.azavea.opentransit.i... | WorldBank-Transport/open-transit-indicators | scala/opentransit/src/main/scala/com/azavea/opentransit/indicators/parameters/ObservedStopTimes.scala | Scala | gpl-3.0 | 4,962 |
package com.obecto.gattakka.genetics.operators
import com.obecto.gattakka.{IndividualDescriptor, PipelineOperator, IndividualState}
trait EliteOperator extends PipelineOperator {
def elitePercentage: Double
def apply(snapshot: List[IndividualDescriptor]): List[IndividualDescriptor] = {
val withoutDoomed = s... | obecto/gattakka | src/main/scala/com/obecto/gattakka/genetics/operators/EliteOperator.scala | Scala | mit | 667 |
/*
* 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 ... | lxsmnv/spark | sql/core/src/main/scala/org/apache/spark/sql/test/ExamplePointUDT.scala | Scala | apache-2.0 | 2,246 |
package org.smitt.conf
object Conf {
import scalaz.Reader
private val conf = Reader[Conf, Conf](identity)
val messengerConf = conf map (_.messengerConf)
val outputConf = conf map (_.outputConf)
}
trait Conf
extends MessengerConfComponent
with OutputConfComponent
| sergius/smitt | src/main/scala/org/smitt/conf/Conf.scala | Scala | mit | 282 |
package net.leonini.passwordgrids
import java.io.File
import java.lang.System
import com.typesafe.config.ConfigFactory
object CLI {
val version = 1.0
def main(args: Array[String]) {
println(f"# PasswordGrids v$version%2.1f")
val alphabet = {
val f: File = new File(System.getProperty("u... | lleonini/passwordgrids-cli | src/main/scala/CLI.scala | Scala | mit | 959 |
package com.actian.spark_vector.provider
import org.scalatest._
import org.scalatest.funsuite.FixtureAnyFunSuite
import org.apache.spark.sql.SparkSession
import resource._
import org.apache.spark.SparkConf
import matchers.should._
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
class CaseInsensivitiyTest... | ActianCorp/spark-vector | provider/src/test/scala/com/actian/spark_vector/provider/CaseInsensitivityTest.scala | Scala | apache-2.0 | 2,494 |
package com.danielasfregola.twitter4s.http.clients.rest.trends
import akka.http.scaladsl.model.HttpMethods
import com.danielasfregola.twitter4s.entities.{Location, LocationTrends, RatedData}
import com.danielasfregola.twitter4s.helpers.ClientSpec
class TwitterTrendClientSpec extends ClientSpec {
class TwitterTrend... | DanielaSfregola/twitter4s | src/test/scala/com/danielasfregola/twitter4s/http/clients/rest/trends/TwitterTrendClientSpec.scala | Scala | apache-2.0 | 3,348 |
/*
https://www.reddit.com/r/dailyprogrammer/comments/cdieag/20190715_challenge_379_easy_progressive_taxation/
*/
case class Bracket(max: Option[Int], rate: Double)
case class LimitedBracket(min: Int, max: Int, rate: Double)
object Tax {
val Taxes: List[Bracket] = List[Bracket](
Bracket(Some(10_000), 0.0),
... | frankivo/dailyprogrammer | 379/src/main/scala/Tax.scala | Scala | gpl-3.0 | 1,134 |
package hasheq
import org.scalacheck.{Arbitrary, Properties}
import scala.language.higherKinds
package object immutable {
/** Witness that `S[A]` represents an immutable set of elements of type `A`. */
type SetRepr[S[_], A] = Setoid.Aux[S, A, Equality.type]
object SetRepr {
def properties[S[_], A](name: S... | TomasMikula/hasheq | src/main/scala/hasheq/immutable/package.scala | Scala | bsd-3-clause | 963 |
package com.outr.arango.api.model
import io.circe.Json
case class PutAPISimpleWithinRectangle(collection: String,
geo: Option[String] = None,
latitude1: Option[String] = None,
latitude2: Option[String... | outr/arangodb-scala | api/src/main/scala/com/outr/arango/api/model/PutAPISimpleWithinRectangle.scala | Scala | mit | 614 |
package org.bitcoins.rpc.marshallers.networking
import org.bitcoins.rpc.bitcoincore.networking.{NetworkConnections, NetworkConnectionsImpl}
import spray.json._
/**
* Created by Tom on 1/6/2016.
*/
object NetworkConnectionsMarshaller extends DefaultJsonProtocol {
val nameKey = "name"
val limitedKey = "limited"
... | bitcoin-s/bitcoin-s-rpc-client | src/main/scala/org/bitcoins/rpc/marshallers/networking/NetworkConnectionsMarshaller.scala | Scala | mit | 1,485 |
package openstackApi.domain
//=============================
//RESULT MESSAGES
sealed trait ResultMessage
case class Success2(message: String) extends ResultMessage
case class Error(message: String)
//=============================
// REQUEST MESSAGES
sealed trait RequestMessage
case class Get(id: String) extends... | Spirals-Team/ermis | src/main/scala/openstackApi/domain/Messages.scala | Scala | agpl-3.0 | 420 |
/*
* 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/codegen/ValuesCodeGenerator.scala | Scala | apache-2.0 | 2,230 |
package com.geeksville.akka
import akka.actor.Actor
import akka.actor.PoisonPill
import scala.concurrent.duration._
/**
* This is an Actor mixin that runs doNextStep periodically
*/
trait TimesteppedActor extends Actor {
import context._
private case object SimNext
def numPoints: Int
def interval: Double
... | geeksville/arduleader | common/src/main/scala/com/geeksville/akka/TimesteppedActor.scala | Scala | gpl-3.0 | 884 |
package io.hydrosphere.mist.master
import java.io.File
import cats.Eval
import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory, ConfigValueType}
import io.hydrosphere.mist.utils.ConfigUtils._
import io.hydrosphere.mist.master.data.ConfigRepr
import io.hydrosphere.mist.master.models.ContextConfig
import... | Hydrospheredata/mist | mist/master/src/main/scala/io/hydrosphere/mist/master/configs.scala | Scala | apache-2.0 | 11,017 |
package org.functionalkoans.forscala
import org.functionalkoans.forscala.support.KoanFunSuite
import org.scalatest.Matchers
class AboutForExpressions extends KoanFunSuite with Matchers {
koan("For loops can be simple") {
val someNumbers = Range(0, 10)
var sum = 0
for (i <- someNumbers)
sum += i
... | pharmpress/codingdojo | scala-koans/src/test/scala/org/functionalkoans/forscala/AboutForExpressions.scala | Scala | apache-2.0 | 858 |
/**
* 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... | unix1986/universe | tool/kafka-0.8.1.1-src/core/src/main/scala/kafka/consumer/ConsoleConsumer.scala | Scala | bsd-2-clause | 13,508 |
package org.backuity.matchete
import org.backuity.matchete.TestUtil.Person
import org.junit.Test
class DerivedDiffableTest extends JunitMatchers {
@Test
def eitherShouldBeDiffable(): Unit = {
val either: Either[String, Person] = Right(Person("john", 12))
{
either must_== Right(Person("john", 13))
... | backuity/matchete | core/src/test/scala/org/backuity/matchete/DerivedDiffableTest.scala | Scala | apache-2.0 | 1,159 |
package lila.analyse
import org.joda.time.DateTime
import play.api.libs.json.Json
import play.modules.reactivemongo.json.ImplicitBSONHandlers.JsObjectWriter
import lila.db.api._
import lila.db.Implicits._
import lila.game.Game
import tube.analysisTube
object AnalysisRepo {
type ID = String
def done(id: ID, a: ... | JimmyMow/lila | modules/analyse/src/main/AnalysisRepo.scala | Scala | mit | 1,992 |
package yandex.metrika
/**
* --- YANDEX Global Information ---
*/
object Helpers {
/* urls for YANDEX METRIKA api */
val HOST = "https://api-metrika.yandex.ru/"
val _COUNTERS = "counters"
val _COUNTER = "counter/%d"
val _GOALS = _COUNTER + "/goals"
val _GOAL = _COUNTER + "/goal/%d"
val _FILTERS = _CO... | krispo/yandex-metrika | src/main/scala/yandex/metrika/Helpers.scala | Scala | mit | 4,268 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.annotation._
import leon.lang._
object PatternMatching9 {
case class Wrapper(var x: Int)
def _main(): Int = {
var c = 1
def get0(): Int = {
c -= 1
0
}
val array = Array(Wrapper(42))
array(get0()) match {
case w if w.x =... | epfl-lara/leon | src/test/resources/regression/genc/valid/PatternMatching9.scala | Scala | gpl-3.0 | 474 |
package org.positronicnet.sample.contacts
import org.positronicnet.ui._
import android.content.{Context, Intent}
import android.util.{AttributeSet, Log}
import android.view.{View, LayoutInflater}
import android.widget.{LinearLayout, ImageView}
import android.net.Uri
object ViewContactUiBinder extends UiBinder {
... | rst/positronic_net | sample/contacts_app/src/main/scala/ViewWidgets.scala | Scala | bsd-3-clause | 4,339 |
/**
* 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... | eribeiro/kafka | core/src/main/scala/kafka/api/FetchRequest.scala | Scala | apache-2.0 | 10,037 |
/*
* Copyright 2016 LinkedIn Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | nntnag17/dr-elephant-1 | test/com/linkedin/drelephant/analysis/SeverityThresholdsTest.scala | Scala | apache-2.0 | 3,421 |
/*
* 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/main/scala/com/intel/analytics/bigdl/utils/tf/loaders/LessEqual.scala | Scala | apache-2.0 | 1,204 |
/*
* Copyright (C) 2017 Michael Dippery <michael@monkey-robot.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 requi... | mdippery/jupiter | src/test/scala/com/mipadi/jupiter/io/files/LocatableSpec.scala | Scala | apache-2.0 | 3,563 |
/*
* 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 | util/JsonProtocol.scala | Scala | apache-2.0 | 46,514 |
/*
* 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 ... | pronix/spark | mllib/src/test/scala/org/apache/spark/ml/feature/ChiSqSelectorSuite.scala | Scala | apache-2.0 | 2,269 |
package grammarcomp
package benchmarks
import grammar.EBNFGrammar.BNFGrammar
import grammar.GrammarReaders
object JavascriptGrammar2 extends Benchmark {
import GrammarReaders._
def benchmarkName = "JSGrammar-Simple"
def benchmarkSource = "http://hepunx.rl.ac.uk/~adye/jsspec11/llr.htm"
def ebnfGr... | epfl-lara/GrammarComparison | src/main/scala/grammarcomp/benchmarks/JavascriptGrammar2.scala | Scala | mit | 3,372 |
/*
* 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... | jenniew/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/Exp.scala | Scala | apache-2.0 | 1,426 |
/*
* Copyright (c) 2014 Contributor. All rights reserved.
*/
package org.scalaide.debug.internal.expression
import org.eclipse.jdt.debug.core.IJavaBreakpoint
import org.eclipse.jface.viewers.StructuredSelection
import org.junit.Assert._
import org.junit.Test
import org.scalaide.debug.internal.ScalaDebugger
import or... | stephenh/scala-ide | org.scala-ide.sdt.debug.expression.tests/src/org/scalaide/debug/internal/expression/DifferentStackFramesTest.scala | Scala | bsd-3-clause | 2,476 |
/**
* Copyright (C) 2015 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* 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... | DANS-KNAW/easy-stage-dataset | lib/src/main/scala/nl.knaw.dans.easy.stage/dataset/EMD.scala | Scala | apache-2.0 | 3,888 |
package moe.pizza.auth.plugins.pilotgraders
import moe.pizza.auth.models.Pilot
import moe.pizza.auth.plugins.pilotgraders.AlliedPilotGrader.SavedContactList
import moe.pizza.eveapi.endpoints.Corp
import moe.pizza.eveapi.generated.corp.ContactList.{Row, Rowset}
import moe.pizza.eveapi.{ApiKey, EVEAPI, XMLApiResponse}
i... | xxpizzaxx/pizza-auth-3 | src/test/scala/moe/pizza/auth/plugins/pilotgraders/AlliedPilotGraderSpec.scala | Scala | mit | 24,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 not u... | knockdata/spark-highcharts | src/test/scala/com/knockdata/spark/highcharts/plotoptions/TestPlotOptions.scala | Scala | apache-2.0 | 1,538 |
/*
* 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 ... | spark-test/spark | core/src/main/scala/org/apache/spark/rpc/netty/NettyRpcEnv.scala | Scala | apache-2.0 | 27,725 |
package co.spendabit.webapp.forms.v3.controls
import co.spendabit.webapp.forms.util.withAttr
object Checkbox extends TextBasedInput[Boolean] {
override def html(value: Option[Boolean] = None): xml.NodeSeq = {
// val cb = <input type="checkbox" name={ name } />
val cb = <input type="checkbox" />
if (valu... | spendabit/webapp-tools | src/co/spendabit/webapp/forms/v3/controls/Checkbox.scala | Scala | unlicense | 676 |
/*
* 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... | psyyz10/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/example/udfpredictor/Utils.scala | Scala | apache-2.0 | 8,085 |
import scala.reflect.runtime.{universe => ru, currentMirror}
import ru._
object SCL5592 {
def testFun(symbol :ClassSymbol) {
/*start*/currentMirror.runtimeClass(symbol)/*end*/
}
}
//runtime.universe.RuntimeClass | triggerNZ/intellij-scala | testdata/typeInference/scalaReflect/SCL5592.scala | Scala | apache-2.0 | 220 |
/*
* 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 ... | GJL/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/codegen/calls/FunctionGenerator.scala | Scala | apache-2.0 | 21,942 |
/**
* File: OrdiniTest.scala
* Package: tests
* Autore: Francesco Burato
* Creazione: 01/lug/2013
*/
package tests
import org.scalatest.{FunSuite, BeforeAndAfter}
import constraintobjs._
import scala.collection.mutable.HashMap
/**
* Test di unità su Ordini e Comparator
* @author Francesco Burato
*
*/
class Or... | fburato/CPNetSolver | CPNetSolver/src/tests/OrdiniTest.scala | Scala | gpl-3.0 | 3,769 |
package com.sksamuel.elastic4s.testkit
import java.io.PrintWriter
import java.nio.file.{Path, Paths}
import java.util.UUID
import com.sksamuel.elastic4s.{ElasticDsl, ElasticClient}
import com.sksamuel.elastic4s.ElasticDsl._
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus
import org.elasticsea... | nicoo/elastic4s | elastic4s-testkit/src/main/scala/com/sksamuel/elastic4s/testkit/ElasticSugar.scala | Scala | apache-2.0 | 6,196 |
package maker.utils
import org.scalatest.{Matchers, FreeSpec}
import maker.utils.FileUtils._
import java.util.jar.JarFile
import scala.collection.JavaConversions._
class BuildJarTests extends FreeSpec with Matchers{
"builds empty jar when given no directories " in {
FileUtils.withTempDir{
dir =>
... | cage433/maker | maker/tests/maker/utils/BuildJarTests.scala | Scala | bsd-2-clause | 1,330 |
object Solution {
def isSquare(n: Long): (Boolean, Long) = {
// fail fast
if (n < 0 || (n & 2) != 0 || (n & 7) == 5 || (n & 11) == 8) return (false, -1)
if (n == 0) return (true, 0)
val x = math.sqrt(n).toLong
(x * x == n, x)
}
def main(args: Array[String]) {
val Array(n, a, b) = readLin... | advancedxy/hackerrank | project-euler/problem-45/TrianPenAndHex.scala | Scala | mit | 804 |
import org.joda.time.DateTime
import play.api.libs.json.{Json, Writes, Reads, Format}
/**
* Created by alvarovilaplana on 21/12/2015.
*/
package object controllers {
val pattern = "dd/MM/yyyy hh:mm:ss"
implicit val dateFormat = Format[DateTime](
Reads.jodaDateReads(pattern),
Writes.jodaDateWrites(patter... | tvlive/tv-auth | app/controllers/package.scala | Scala | apache-2.0 | 442 |
/*
* Copyright 2014–2017 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | drostron/quasar | mongodb/src/main/scala/quasar/physical/mongodb/CollectionStatistics.scala | Scala | apache-2.0 | 1,140 |
// Solution-2.scala
// Solution to Exercise 2 in "Values"
val v1 = 17
println(v1)
// This won't work:
v1 = 20
println("You can't change a val")
/* OUTPUT_SHOULD_CONTAIN
error: reassignment to val
v1 = 20
^
one error found
*/ | P7h/ScalaPlayground | Atomic Scala/atomic-scala-solutions/01_Values/Solution-2.scala | Scala | apache-2.0 | 229 |
package model
import model.impl.{Tile, TileNameEnum}
import org.scalatest._
import util.position.Position
class TileSpec extends FlatSpec with Matchers {
"A Tile" should "have a name and a position" in {
val tileName = TileNameEnum.CAT
val tilePos = new Position(1, 2)
val tile: Tile = new Tile(tileNam... | MartinLei/Arimaa | src/test/scala/model/TileSpec.scala | Scala | mit | 1,132 |
package org.bitcoins.marshallers.rpc.bitcoincore.blockchain
import org.bitcoins.marshallers.MarshallerUtil
import org.bitcoins.marshallers.rpc.bitcoincore.blockchain.softforks.SoftForkMarshaller
import org.bitcoins.protocol.rpc.bitcoincore.blockchain.softforks.SoftForks
import org.bitcoins.protocol.rpc.bitcoincore.blo... | Christewart/scalacoin | src/main/scala/org/bitcoins/marshallers/rpc/bitcoincore/blockchain/BlockchainInfoMarshaller.scala | Scala | mit | 2,485 |
package lila.study
import chess.opening._
import chess.variant.Variant
import lila.tree
object TreeBuilder {
private val initialStandardDests = chess.Game(chess.variant.Standard).situation.destinations
def apply(root: Node.Root, variant: Variant): tree.Root = {
val dests =
if (variant.standard && root... | luanlv/lila | modules/study/src/main/TreeBuilder.scala | Scala | mit | 1,823 |
package org.hyperreal.yate
import java.awt.Font
import java.awt.Font._
import java.awt.Color
import collection.mutable.UnrolledBuffer
trait DocumentElement
{
val parent: DocumentElement
}
trait DocumentContentElement extends DocumentElement
case class DocumentRootElement( elems: DoubleLinkedList[DocumentContent... | edadma/yate | src/main/scala/DocumentElement.scala | Scala | gpl-3.0 | 960 |
/*
* Copyright 2016 Dennis Vriend
*
* 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 t... | gavares/akka-persistence-jdbc | src/test/scala/akka/persistence/jdbc/util/DropCreate.scala | Scala | apache-2.0 | 3,621 |
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
package com.krux.hyperion.resource
trait ActionOnTaskFailure {
def serialize: String
o... | realstraw/hyperion | core/src/main/scala/com/krux/hyperion/resource/ActionOnTaskFailure.scala | Scala | bsd-3-clause | 565 |
/*
* 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 ... | gioenn/xSpark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/OrderingSuite.scala | Scala | apache-2.0 | 6,365 |
import scala.compiletime._
object Test {
def main(args: Array[String]): Unit = {
assert(code"abc ${println(34)} ..." == "abc println(34) ...")
assert(code"abc ${println(34)}" == "abc println(34)")
assert(code"${println(34)} ..." == "println(34) ...")
assert(code"${println(34)}" == "println(34)")
... | som-snytt/dotty | tests/run/i6622.scala | Scala | apache-2.0 | 454 |
package com.yetu.notification.client
import com.github.sstone.amqp.Amqp.{QueueParameters, ExchangeParameters}
import com.rabbitmq.client.ConnectionFactory
import com.typesafe.config.ConfigFactory
object Config {
val configObject = ConfigFactory.load()
val RABBITMQ_HOST = configObject.getString("rabbitmq.host")
... | yetu/yetu-notification-client-scala | app/com/yetu/notification/client/Config.scala | Scala | mit | 2,691 |
package com.criteo.cuttle.timeseries.contrib
import doobie.implicits._
import com.criteo.cuttle._
import java.time._
class PersistInstant(xa: XA) {
def set(id: String, t: Instant): Instant = {
sql"REPLACE INTO instant_data VALUES (${id}, ${t})".update.run.transact(xa).unsafeRunSync
t
}
def get(id: Stri... | criteo/cuttle | timeseries/src/main/scala/com/criteo/cuttle/timeseries/contrib/PersistStartDate.scala | Scala | apache-2.0 | 890 |
package scalax.collection.io.json
package descriptor
import language.existentials
import reflect.ClassTag
import scalax.collection.GraphEdge._
import scalax.collection.edge._,
scalax.collection.edge.WBase._,
scalax.collection.edge.LBase._,
scalax.collection.edge.WLBase._
import error... | Calavoow/scala-graph | json/src/main/scala/scalax/collection/io/json/descriptor/Descriptor.scala | Scala | bsd-3-clause | 5,701 |
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.