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 |
|---|---|---|---|---|---|
/*
* Copyright (c) 2008 - 2013 10gen, Inc. <http://10gen.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | rozza/mongo-java-driver | driver-scala/src/it/scala/org/mongodb/scala/TestMongoClientHelper.scala | Scala | apache-2.0 | 2,068 |
/*
* Copyright (c) 2012. Sveinung Kvilhaugsvik
*
* 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 2
* of the License, or (at your option) any later version.
*
* This progra... | kvilhaugsvik/jfcpi | GeneratePackets/src/org/freeciv/packetgen/parsing/ParseType.scala | Scala | gpl-2.0 | 1,172 |
package models
import configuration.Environment
import reactivemongo.api.collections.default.BSONCollection
class APIMongoConnection(uri: String = Environment.mongodbURI,
databaseName: String = Environment.mongodbDatabaseName) {
import reactivemongo.api._
import scala.concurrent.ExecutionC... | tvlive/tv-api | app/models/Connection.scala | Scala | apache-2.0 | 562 |
package org.broadinstitute.dsde.snoop.dataaccess
import org.broadinstitute.dsde.snoop.util.Reflection
import scala.slick.driver.JdbcProfile
/**
* Created by plin on 3/25/15.
*/
class DataAccess(val driver: JdbcProfile) extends SubmissionComponent with DriverComponent {
import driver.simple._
def this(driverNa... | broadinstitute/snoop | src/main/scala/org/broadinstitute/dsde/snoop/dataaccess/DataAccess.scala | Scala | bsd-3-clause | 397 |
package org.example.declaration
import org.example.declaration.data.{Random, B => B_Renamed, _}
import scala.util._
object UsageSameSourcePackage4 {
def main(args: Array[String]): Unit = {
println(this.getClass)
println(classOf[Random])
println(Properties.versionString)
println()
val x: X = ??... | JetBrains/intellij-scala | scala/scala-impl/testdata/moveScala213/moveClass_NameClashesWithOtherNamesImportedFromOtherPackageWithWithWildcard/after/org/example/declaration/UsageSameSourcePackage4.scala | Scala | apache-2.0 | 373 |
/*
* 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 | manual/cypher/cypher-docs/src/test/scala/org/neo4j/cypher/docgen/WithTest.scala | Scala | apache-2.0 | 3,451 |
package cspom.variable
import cspom.CSPOM._
import cspom.util.{IntInterval, Intervals, RangeSet}
import cspom.{CSPOM, CSPOMConstraint}
import org.scalatest.{FlatSpec, Matchers}
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
class VariableTest extends FlatSpec with Matchers with ScalaCheckPropertyChecks ... | concrete-cp/cspom | src/test/scala/cspom/variable/VariableTest.scala | Scala | lgpl-2.1 | 1,841 |
/**
* OEML - REST API
* This section will provide necessary information about the `CoinAPI OEML REST API` protocol. <br/> This API is also available in the Postman application: <a href=\\"https://postman.coinapi.io/\\" target=\\"_blank\\">https://postman.coinapi.io/</a> <br/><br/> Implemented Standards: * [HT... | coinapi/coinapi-sdk | oeml-sdk/scala-akka/src/main/scala/org/openapitools/client/api/OrdersApi.scala | Scala | mit | 5,453 |
trait Web {
type LocalName
}
trait Companion1[A]
trait WebDSL[W <: Web] {
trait LocalNameCompanion extends Companion1[W#LocalName] {
type A = String
}
implicit val LocalName: LocalNameCompanion
}
object Test {
def t[W <: Web](implicit webDSL: WebDSL[W]): Unit = {
import webDSL.*
implicitly[LocalNa... | lampepfl/dotty | tests/pos-scala2/t5070.scala | Scala | apache-2.0 | 401 |
package ohnosequences.cosas.tests
import ohnosequences.cosas._
final class NatTests extends org.scalatest.FunSuite {
test("aliases for numbers") {
assert { Successor(_0) === _1 }
assert { _1.pred === _0 }
assert { _0.next === _1 }
assert { _1.next === _2 }
}
test("can sum nat vals and types")... | ohnosequences/cosas | src/test/scala/cosas/NatTests.scala | Scala | agpl-3.0 | 451 |
package io.iohk.ethereum.network.discovery
import cats.effect.Resource
import io.iohk.ethereum.crypto
import io.iohk.ethereum.db.storage.KnownNodesStorage
import io.iohk.ethereum.network.discovery.codecs.RLPCodecs
import io.iohk.ethereum.utils.{NodeStatus, ServerStatus}
import io.iohk.scalanet.discovery.crypto.{Privat... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/network/discovery/DiscoveryServiceBuilder.scala | Scala | mit | 7,235 |
package test
import scala.concurrent._
import scala.concurrent.duration._
import minitest._
import transport._
import transport.ConnectionHandle
import lagcomp._
import scala.concurrent.ExecutionContext.Implicits.global
object ClockSyncTest extends SimpleTestSuite {
test("should sync") {
var timePassed = 0
... | OlivierBlanvillain/scala-lag-comp | lag-comp/src/test/scala/ClockSyncTest.scala | Scala | mit | 2,139 |
package edu.gemini.util.security.auth.ui
import swing.{TextArea, Label, BorderPanel}
import javax.swing.{Icon, BorderFactory, ImageIcon}
import java.awt.Color
abstract class Instructions extends BorderPanel { outer =>
def instructions:String
def icon:Icon
add(new Label() {
icon = outer.icon
}, BorderPan... | arturog8m/ocs | bundle/edu.gemini.util.security/src/main/scala/edu/gemini/util/security/auth/ui/Instructions.scala | Scala | bsd-3-clause | 606 |
class F extends (Int => 1)(
// error | dotty-staging/dotty | tests/neg/parser-stability-27.scala | Scala | apache-2.0 | 36 |
/*
* Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option)... | Tensei-Data/tensei-agent | src/main/scala/com/wegtam/tensei/agent/Parser.scala | Scala | agpl-3.0 | 25,268 |
package me.yingrui.segment.tools
import me.yingrui.segment.concept.{Concept, ConceptRepository}
import me.yingrui.segment.dict.{IWord, POS, POSArray, WordImpl}
class StringWordConverter {
private var conceptRepository: ConceptRepository = null
private val domainTypeKey = "domainType"
private val posTableKey = ... | yingrui/mahjong | lib-segment/src/main/scala/me/yingrui/segment/tools/StringWordConverter.scala | Scala | gpl-3.0 | 3,380 |
/* 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... | patverga/factorie | src/main/scala/cc/factorie/optimize/GroupLassoRDA.scala | Scala | apache-2.0 | 7,540 |
/*
* This file is part of CoAnSys project.
* Copyright (c) 2012-2015 ICM-UW
*
* CoAnSys is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any ... | pdendek/CoAnSys | citation-matching/citation-matching-core-code/src/test/scala/pl/edu/icm/coansys/citations/hashers/CitationNameYearPagesOptimisticHashGeneratorTest.scala | Scala | agpl-3.0 | 1,365 |
import _root_.io.gatling.core.scenario.Simulation
import ch.qos.logback.classic.{Level, LoggerContext}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
/**
* Performance test for the Campagne entity.
*/
class CampagneGatlingTest extend... | pascalgrimaud/qualitoast | src/test/gatling/user-files/simulations/CampagneGatlingTest.scala | Scala | apache-2.0 | 3,755 |
/*
* Copyright 2010 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 l... | jeppenejsum/liftweb | framework/lift-modules/lift-oauth-mapper/src/main/scala/net/liftweb/oauth/mapper/OAuthNonce.scala | Scala | apache-2.0 | 2,334 |
/*
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | danielcsant/sparta | serving-core/src/main/scala/com/stratio/sparta/serving/core/models/RawDataModel.scala | Scala | apache-2.0 | 867 |
package dotty.tools.dotc.util
/** A hash set that allows some privileged protected access to its internals
*/
class HashSet[T >: Null <: AnyRef](powerOfTwoInitialCapacity: Int, loadFactor: Float = 0.25f) extends Set[T] {
private var used: Int = _
private var limit: Int = _
private var table: Array[AnyRef] = _
... | som-snytt/dotty | compiler/src/dotty/tools/dotc/util/HashSet.scala | Scala | apache-2.0 | 4,552 |
/*
* Copyright (c) 2017. Yuriy Stul
*/
package com.stulsoft.ysps.psort
import scala.util.Random
/**
* Fast sort
*
* @author Yuriy Stul
*/
object FastSort01 extends App {
val data = (1 to 100000)
// val data = (1 to 10)
.map(i => r.nextInt())
.toArray
println("==>main")
val sortedData =... | ysden123/ysps | src/main/scala/com/stulsoft/ysps/psort/FastSort01.scala | Scala | mit | 680 |
/*
* Copyright 2019 http4s.org
*
* 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... | rossabaker/http4s | ember-server/shared/src/main/scala/org/http4s/ember/server/internal/ServerHelpers.scala | Scala | apache-2.0 | 19,192 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/amls-frontend | app/models/declaration/RoleWithinBusiness.scala | Scala | apache-2.0 | 4,192 |
package reactive.week02
import frp.Var
/**
* @author mpakhomov
* @since 12/22/15
*/
class BankAccount {
val balance = Var(0)
def deposit(amount: Int): Unit = {
if (amount > 0) {
val b = balance()
balance() = b + amount
}
}
def withdraw(amount: Int): Unit =
if (0 < amount && am... | mpakhomov/scala-progfun-2015 | src/main/scala/reactive/week02/BankAccount.scala | Scala | mit | 446 |
/*
* 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 ... | rekhajoshm/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala | Scala | apache-2.0 | 61,825 |
/*
* Licensed to Intel Corporation under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Intel Corporation licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use t... | SeaOfOcean/BigDL | dl/src/test/scala/com/intel/analytics/bigdl/optim/MetricsSpec.scala | Scala | apache-2.0 | 5,005 |
/*
* 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 | foundation/src/test/scala/quasar/contrib/matryoshka/PatternArbitrary.scala | Scala | apache-2.0 | 1,792 |
/*
* Copyright 2019 ACINQ SAS
*
* 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... | ACINQ/eclair | eclair-core/src/main/scala/fr/acinq/eclair/payment/Bolt11Invoice.scala | Scala | apache-2.0 | 25,542 |
package com.twitter.finagle.http2.transport
import io.netty.handler.codec.http2._
import io.netty.handler.codec.http2.Http2HeadersEncoder.SensitivityDetector
// we need to supply no-op overrides for all of the methods to ensure the return
// types are correct.
private[http2] class RichHttpToHttp2ConnectionHandlerBuil... | luciferous/finagle | finagle-http2/src/main/scala/com/twitter/finagle/http2/transport/RichHttpToHttp2ConnectionHandlerBuilder.scala | Scala | apache-2.0 | 3,537 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/vat-registration-frontend | app/controllers/registration/business/ScottishPartnershipNameController.scala | Scala | apache-2.0 | 2,711 |
package io.iohk.ethereum.network.p2p
import akka.util.ByteString
import io.iohk.ethereum.network.p2p.Message.Version
import scala.util.Try
object Message {
type Version = Int
}
trait Message {
def code: Int
}
trait MessageSerializable extends Message {
//DummyImplicit parameter only used to differentiate fr... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/network/p2p/Message.scala | Scala | mit | 931 |
import wt.part.WTPart
import wt.method.RemoteMethodServer
import wt.fc.PersistenceHelper
import wt.query.QuerySpec
import wt.query.SearchCondition
object WindchillExamples {
def main(args: Array[String]) {
println("Hello, Windchill!")
// Get MethodServer
val remotemethodserver=RemoteMethodServer.getDefaul... | qubecad/windchillscala | WindchillScala/src/com/qubecad/windchill/WindchillExamples.scala | Scala | apache-2.0 | 941 |
// Copyright (C) 2017 Calin Cruceru <calin.cruceru@stud.acs.upb.ro>.
//
// See the LICENCE file distributed with this work for additional
// information regarding copyright ownership.
package org.symnet
package models.iptables.virtdev
package devices
// 3rd-party
// -> Symnet
import org.change.v2.analysis.expression.... | calincru/iptables-sefl | src/main/scala/org/symnet/models/iptables/virtdev/devices/InputPortSetter.scala | Scala | mit | 1,100 |
/*
* Copyright 2011-2018 GatlingCorp (http://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 applic... | wiacekm/gatling | gatling-core/src/main/scala/io/gatling/core/check/OldCheckBuilder.scala | Scala | apache-2.0 | 7,535 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package base
package types
import com.intellij.lang.ASTNode
import com.intellij.psi.PsiElementVisitor
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElementVisitor
import org.jetbrains.plugins.scala.lang.psi.api.base.types._
import org.jet... | JetBrains/intellij-scala-historical | src/org/jetbrains/plugins/scala/lang/psi/impl/base/types/ScTupleTypeElementImpl.scala | Scala | apache-2.0 | 1,754 |
/*
* 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 ... | ConeyLiu/spark | sql/core/src/main/scala/org/apache/spark/sql/jdbc/DerbyDialect.scala | Scala | apache-2.0 | 1,929 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | tzulitai/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/table/stringexpr/CorrelateStringExpressionTest.scala | Scala | apache-2.0 | 6,654 |
package models
import org.joda.time._
import playground.models._
case class Admin(
id: Id,
firstName: String,
lastName: String,
email: String,
active: Boolean,
creation: DateTime
) extends Identifiable with Nameable
| ybr/PlayBootstrap | app/models/Admin.scala | Scala | mit | 231 |
/*
* 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
* distribute... | wvlet/airframe | airframe-msgpack/.jvm/src/main/scala/wvlet/airframe/msgpack/impl/UnpackerImpl.scala | Scala | apache-2.0 | 6,560 |
package com.sksamuel.elastic4s.alias
import com.sksamuel.elastic4s.Indexes
import scala.language.implicitConversions
trait AliasesApi {
def aliases(first: AliasAction, rest: AliasAction*): IndicesAliasesRequest =
aliases(first +: rest)
def aliases(actions: Iterable[AliasAction]) = IndicesAliasesRequest(acti... | Tecsisa/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/alias/AliasesApi.scala | Scala | apache-2.0 | 1,881 |
/*
* 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 ... | foryou2030/incubator-carbondata | integration/spark/src/main/scala/org/apache/carbondata/spark/csv/CarbonTextFile.scala | Scala | apache-2.0 | 2,594 |
import stainless.annotation._
object ContainerHOFs {
case class Container[@mutable T](t: T)
case class Counter(var v: BigInt)
def apply1[@mutable T](x: T)(f: T => Unit): Unit = f(x)
def apply2[@mutable T](x: Container[T])(f: T => Unit): Unit = f(x.t)
def apply3[@mutable T](x: Container[T])(f: Container[T] =... | epfl-lara/stainless | frontends/benchmarks/verification/valid/ContainerHOFs.scala | Scala | apache-2.0 | 684 |
package mesosphere.marathon
package core.condition
import mesosphere.UnitTest
class ConditionTest extends UnitTest {
"A Condition" when {
"staging" should {
val condition = Condition.Staging
"be active" in { condition.isActive should be(true) }
"not be terminal" in { condition.isTerminal shou... | guenter/marathon | src/test/scala/mesosphere/marathon/core/condition/ConditionTest.scala | Scala | apache-2.0 | 2,902 |
package io.getquill.context.sql.idiom
import io.getquill.Spec
import io.getquill.SqlMirrorContext
import io.getquill.Escape
import io.getquill.SnakeCase
import io.getquill.UpperCase
import io.getquill.MirrorSqlDialect
import io.getquill.SqlMirrorContext
import io.getquill.NamingStrategy
trait CustomTableStrategy exte... | mentegy/quill | quill-sql/src/test/scala/io/getquill/context/sql/idiom/SqlIdiomNamingSpec.scala | Scala | apache-2.0 | 3,194 |
/*
* Copyright (c) 2013-2015 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0 which
* accompanies this distribution and is available at
* http://www.opensource.org/licenses/apache2.0.php.
... | drackaer/geomesa | geomesa-utils/src/test/scala/org/locationtech/geomesa/utils/uuid/TimeSortedUuidGeneratorTest.scala | Scala | apache-2.0 | 1,178 |
object Test {
def main(args: Array[String]): Unit = {
erased val x = {
println("x")
42
}
foo(x)
}
def foo(erased a: Int) = {
println("foo")
}
}
| som-snytt/dotty | tests/run-custom-args/erased/erased-13.scala | Scala | apache-2.0 | 183 |
/**
* @author Artem Arakcheev
* @since 24.06.15
*/
package elastic.requester
import akka.actor.{Props, ActorRef, ActorSystem, Actor}
import com.google.inject.{Injector, Singleton, Inject}
import elastic.requester.RequesterActor._
import elastic.requester.requests.{ElasticResponse, ExpectResponse}
import play.api.... | reactools/play-elastic-scala | app/elastic/requester/RequesterActor.scala | Scala | apache-2.0 | 2,935 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package evaluators
import purescala.Common._
import purescala.Definitions._
import purescala.Expressions._
import purescala.Types._
import scala.collection.mutable.{Map => MMap}
/** An [[Evaluator]] that tracks information about the runtime call tree.
* Transi... | regb/leon | src/main/scala/leon/evaluators/TrackingEvaluator.scala | Scala | gpl-3.0 | 4,847 |
/*
* Copyright 2014 Treode, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | Treode/store | store/src/com/treode/store/tier/TierMedic.scala | Scala | apache-2.0 | 1,327 |
package code
package model
import lib.RogueMetaRecord
import org.bson.types.ObjectId
import org.joda.time.DateTime
import net.liftweb._
import common._
import http.{StringField => _, BooleanField => _, _}
import mongodb.record.field._
import record.field._
import util.FieldContainer
import net.liftmodules.mongoauth... | hacklabcbba/gazzabazza.net | src/main/scala/code/model/User.scala | Scala | apache-2.0 | 6,071 |
import sbt._, Keys._
import org.scalatra.sbt._, PluginKeys._
import com.mojolly.scalate.ScalatePlugin._, ScalateKeys._
import com.earldouglas.xsbtwebplugin.WebPlugin._
import com.earldouglas.xsbtwebplugin.PluginKeys._
import org.sbtidea.SbtIdeaPlugin._
import scala.language.postfixOps
object SkinnyAppBuild extends Bui... | tsukaby/anime-lineup | project/Build.scala | Scala | mit | 6,532 |
package floatin3bytes
import scala.collection.mutable.ListBuffer
import java.nio.ByteBuffer
object Main
{
def color (c:Int, s:String): String = "\\u001b[1;" :: c.toString :: "m" :: s :: "\\u001b[0m" :: Nil mkString("")
def padLeft(n:Int, s:String): String = "0"*(n - s.length) + s
def flo2int(f:Float): Int = Byt... | sheerluck/andrew | Float.scala | Scala | gpl-3.0 | 1,863 |
/*
* Copyright (c) 2013 original 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 a... | eigengo/monitor | agent-play/src/main/scala/org/eigengo/monitor/agent/play/Aspects.scala | Scala | apache-2.0 | 707 |
/*
* 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 ... | tophua/spark1.52 | mllib/src/test/scala/org/apache/spark/mllib/regression/IsotonicRegressionSuite.scala | Scala | apache-2.0 | 10,875 |
package hu.bme.mit.ire.nodes.unary
import hu.bme.mit.ire.SingleForwarder
import hu.bme.mit.ire.datatypes.Tuple
import hu.bme.mit.ire.messages.{ChangeSet, ReteMessage}
import hu.bme.mit.ire.util.{GenericMath, SizeCounter}
class AverageNode(override val next: (ReteMessage) => Unit,
val aggregationKeys... | FTSRG/ire | src/main/scala/hu/bme/mit/ire/nodes/unary/AverageNode.scala | Scala | epl-1.0 | 1,183 |
package models.join
import models.db.{MasterShipBase, MasterStype}
import scalikejdbc._
/**
*
* @author ponkotuy
* Date: 14/04/20.
*/
case class MasterShipWithStype(ms: MasterShipBase, stype: MasterStype) {
def shipId = ms.id
def name = ms.name
def stypeId = ms.stype
def stypeName = stype.name
}
object M... | ttdoda/MyFleetGirls | server/app/models/join/MasterShipWithStype.scala | Scala | mit | 707 |
package ca.pgx.common.db.helpers
import com.mongodb.{BasicDBList, DBObject}
import net.liftweb.common._
import net.liftweb.mongodb.record.BsonRecord
import net.liftweb.mongodb.record.field.MongoListField
import scala.reflect.Manifest
/**
* A field that contains a list of enums of the same type. It can properly seri... | pgxcentre/eventhub | common/src/main/scala/ca/pgx/common/db/helpers/MongoEnumListField.scala | Scala | apache-2.0 | 1,062 |
/**
* Copyright 2013 Netflix, 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 ... | devisnik/RxJava | language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/subjects/PublishSubject.scala | Scala | apache-2.0 | 934 |
/* Leaving out package declaration for convenience */
sealed trait List[+A]
case object Nil extends List[Nothing]
case class Cons[+A](head: A, tail: List[A]) extends List[A]
object List {
def sum(ints: List[Int]): Int = ints match {
case Nil => 0
case Cons(x, xs) => x + sum(xs)
}
def product(ds:List[Double]):... | wkimeria/fp_scala_for_mortals | chapter_3/exercises/exercise_2.scala | Scala | mit | 990 |
package se.marcuslonnberg.scaladocker
import org.scalatest.Tag
object RemoteApiTest extends Tag("se.marcuslonnberg.scaladocker.RemoteApiTest")
| marcuslonnberg/scala-docker | src/test/scala/se/marcuslonnberg/scaladocker/tags.scala | Scala | mit | 145 |
package io.iohk.ethereum.ets.blockchain
import io.circe.generic.auto._
import io.circe.parser._
import io.iohk.ethereum.ets.common.ScenarioLoader
object BlockchainScenarioLoader extends ScenarioLoader[BlockchainScenario] {
protected def parse(json: String): Map[String, BlockchainScenario] =
decode[Map[String, B... | input-output-hk/etc-client | src/ets/scala/io/iohk/ethereum/ets/blockchain/BlockchainScenarioLoader.scala | Scala | mit | 372 |
/*
* 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 ... | h2oai/sparkling-water | core/src/test/scala/ai/h2o/sparkling/backend/converters/SupportedRDDConverterTestSuite.scala | Scala | apache-2.0 | 21,030 |
package org.me.PrivateSpark.impl
import org.apache.spark.rdd.RDD
import org.me.PrivateSpark._
import org.me.PrivateSpark.api.{Lap_RDD, Lap_PairRDD, Range}
import scala.reflect.ClassTag
class Lap_PairRDD_NonReduceable [K, V](
delegate : RDD[(K, V)]
... | alec-heif/MIT-Thesis | spark-wrapper/src/main/scala/org/me/PrivateSpark/impl/Lap_PairRDD_NonReduceable.scala | Scala | mit | 3,700 |
package edu.cmu.dynet
/** Represents a "dimension", which you should think of as the dimension of a tensor. Can only be
* constructed using factory methods in the companion object.
*
* @param dim
*/
class Dim private[dynet] (private[dynet] val dim: internal.Dim) {
def size(): Long = dim.size
def batchSiz... | cherryc/dynet | contrib/swig/src/main/scala/edu/cmu/dynet/Dim.scala | Scala | apache-2.0 | 1,824 |
package chapter19.language
import chapter19.language.ast._
class ParserException(reason: String) extends Exception(reason)
class Parser {
private var variables = collection.mutable.Map.empty[String, AnyVal]
private var functions = collection.mutable.Map.empty[String, (List[Name], AST)]
def parse(ast: AST): A... | vsuharnikov/books-exercises | scala/scala-for-the-impatient/src/main/scala/chapter19/language/Parser.scala | Scala | mit | 3,229 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v2/B38.scala | Scala | apache-2.0 | 824 |
package io.apibuilder.swagger.translators
import io.apibuilder.spec.v0.{ models => apidoc }
import io.swagger.models.{ArrayModel, ModelImpl, RefModel}
import io.swagger.models.{ parameters => swaggerParams }
import io.apibuilder.swagger.Util
object Body {
def apply(
resolver: Resolver,
param: swaggerParams... | apicollective/apibuilder | swagger/src/main/scala/io/apibuilder/swagger/translators/Body.scala | Scala | mit | 884 |
class C1
trait T1
trait T2
class Foo {
def foo[T <: (C1 & T1) & T2] = ()
}
object Test {
def main(args: Array[String]): Unit = {
val tParams = classOf[Foo].getDeclaredMethod("foo").getTypeParameters
tParams.foreach { tp =>
println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(", "))... | som-snytt/dotty | tests/generic-java-signatures/andTypes.scala | Scala | apache-2.0 | 333 |
/*
* 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/test/scala/org/apache/flink/table/planner/expressions/validation/CompositeAccessValidationTest.scala | Scala | apache-2.0 | 1,978 |
// ImportClass.scala
import util.Random
val r = new Random
println(r.nextInt(10))
println(r.nextInt(10))
println(r.nextInt(10))
// ImportMultiple.scala
import util.Random
import util.Properties
val r = new Random
val p = Properties
// ImportSameLine.scala
import util.Random, util.Properties
val r = new Random
val ... | 5x5x5x5/Back2Basics | atomicScala/Imports.scala | Scala | unlicense | 693 |
package skinny.test
import org.scalatra.test.scalatest.ScalatraFlatSpec
import skinny._
class SkinnyTestSupportSpec extends ScalatraFlatSpec with SkinnyTestSupport {
object SessionInjectorTest extends SkinnyController with Routes {
def show = session("inject")
get("/session-injector-result")(show)
}
ad... | BlackPrincess/skinny-framework | test/src/test/scala/skinny/test/SkinnyTestSupportSpec.scala | Scala | mit | 545 |
package gitbucket.core.servlet
import java.io.File
import java.sql.{DriverManager, Connection}
import gitbucket.core.plugin.PluginRegistry
import gitbucket.core.service.SystemSettingsService
import gitbucket.core.util._
import org.apache.commons.io.FileUtils
import javax.servlet.{ServletContextListener, ServletContext... | intermezzo-fr/gitbucket | src/main/scala/gitbucket/core/servlet/AutoUpdate.scala | Scala | apache-2.0 | 6,394 |
package pl.touk.nussknacker.engine.flink.util.transformer.aggregate
import org.apache.flink.api.common.functions.AggregateFunction
import pl.touk.nussknacker.engine.api.ValueWithContext
import pl.touk.nussknacker.engine.api.typed.typing.TypingResult
import pl.touk.nussknacker.engine.flink.util.keyed.StringKeyedValue
... | TouK/nussknacker | engine/flink/components/base/src/main/scala/pl/touk/nussknacker/engine/flink/util/transformer/aggregate/UnwrappingAggregateFunction.scala | Scala | apache-2.0 | 1,643 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | minixalpha/spark | mllib/src/test/scala/org/apache/spark/ml/util/MLTestingUtils.scala | Scala | apache-2.0 | 11,623 |
def g(x: => Any): Any = x
val a: PartialFunction[Any => Any, Any] = (f => g(f(0)) match { case v => v }) // was an error, now OK
| dotty-staging/dotty | tests/pos/i9391.scala | Scala | apache-2.0 | 133 |
/*
* 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 ... | ashokblend/incubator-carbondata | integration/spark/src/main/scala/org/apache/spark/sql/CarbonDatasourceRelation.scala | Scala | apache-2.0 | 12,929 |
/*
* 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 ... | guoxiaolongzte/spark | mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala | Scala | apache-2.0 | 12,294 |
/*
* Copyright 2014 Treode, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | Treode/store | cluster/stub/com/treode/cluster/stubs/StubPeer.scala | Scala | apache-2.0 | 838 |
package com.votors.common
import java.util.Date
/**
* Created by chenzhiwei on 2/28/2015.
*/
object Utils extends java.io.Serializable{
def string2Int(s: String, default: Int=0): Int = {
try{
s.toFloat.toInt
}catch{
case e: Exception => default
}
}
/**
* if a input item is invalid,... | zwChan/AQI-seeker | src/main/scala/com/votors/common/Utils.scala | Scala | apache-2.0 | 2,059 |
package play.docs
import play.api.mvc._
import play.api._
import play.api.http.Status
import play.api.http.HeaderNames
import play.api.libs.concurrent.Execution
import play.api.libs.iteratee.Enumerator
import play.api.libs.iteratee.Enumeratee
import play.core.{ PlayVersion, SBTDocHandler }
import play.doc.{ FileReposi... | michaelahlers/team-awesome-wedding | vendor/play-2.2.1/framework/src/play-docs/src/main/scala/play/docs/DocumentationHandler.scala | Scala | mit | 3,452 |
package com.thangiee.lolhangouts.data.usecases
import com.thangiee.lolhangouts.data.datasources.api.RiotApiCaller
import com.thangiee.lolhangouts.data._
trait Interactor extends AnyRef with TagUtil with RiotApiCaller {
object CacheIn {
val Memory = com.thangiee.lolhangouts.data.datasources.cache.MemCache
}
... | Thangiee/LoL-Hangouts | src/com/thangiee/lolhangouts/data/usecases/Interactor.scala | Scala | apache-2.0 | 593 |
package chandu0101.scalajs.react.components
package semanticui
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.{VdomElement, VdomNode}
import scala.scalajs.js
import scala.scalajs.js.`|`
/**
* This file is generated - submit issues instead of PR against it
... | rleibman/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/semanticui/SuiLabel.scala | Scala | apache-2.0 | 1,873 |
/*
* 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... | monixio/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/rstreams/PublisherIsObservableSuite.scala | Scala | apache-2.0 | 4,912 |
/*
* Copyright © 2015-2019 the contributors (see Contributors.md).
*
* This file is part of Knora.
*
* Knora is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
*... | musicEnfanthen/Knora | webapi/src/main/scala/org/knora/webapi/util/ErrorHandlingMap.scala | Scala | agpl-3.0 | 3,607 |
package scorex.crypto.hash
/**
* The chain of two hash functions, Blake and Keccak
*/
object ScorexHashChain extends CryptographicHash {
override val DigestSize: Int = 32
override def hash(in: Message): Digest = scorex.utils.HashHelpers.applyHashes(in, Blake256, Keccak256)
}
| B83YPoj/Waves | src/main/scala/scorex/crypto/hash/ScorexHashChain.scala | Scala | apache-2.0 | 290 |
/*
* 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... | cheeseng/scalatest | scalatest-test/src/test/scala/org/scalatest/tools/StringReporterSuite.scala | Scala | apache-2.0 | 13,274 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package models.navigation
import play.api.mvc.Call
/**
* @author hiral
*/
object QuickRoutes {
import models.navigation.BreadCrumbs._
val baseRoutes : Map[String, Call] = Map(
"Clusters" -... | cvcal/kafka-manager | app/models/navigation/QuickRoutes.scala | Scala | apache-2.0 | 2,817 |
package dal
import javax.inject.{Named, Inject, Singleton}
import actors.rendering.RenderingQueue.RenderNouns
import akka.actor.ActorRef
import core.db.PgDriver
import core.util.Instrumented
import models.json.NounUpload
import org.joda.time.DateTime
import play.api.db.slick.DatabaseConfigProvider
import slick.driver.... | moatra/stagert | app/dal/NounTranslationRepository.scala | Scala | mit | 3,488 |
package io.getquill.context.orientdb.encoding
import java.util.Date
import io.getquill.context.orientdb.OrientDBSessionContext
import io.getquill.util.Messages.fail
trait Decoders extends CollectionDecoders {
this: OrientDBSessionContext[_] =>
type Decoder[T] = OrientDBDecoder[T]
case class OrientDBDecoder[T... | mentegy/quill | quill-orientdb/src/main/scala/io/getquill/context/orientdb/encoding/Decoders.scala | Scala | apache-2.0 | 2,776 |
package uk.co.mattthomson.coursera.ggp.gresley.moveselector.heuristic
import uk.co.mattthomson.coursera.ggp.gresley.gdl.GameState
class MobilityHeuristicSearchMoveSelector(depthLimit: Int) extends HeuristicSearchMoveSelector(depthLimit) {
override protected def intermediateStateValue(state: GameState, role: String)... | matt-thomson/gresley | src/main/scala/uk/co/mattthomson/coursera/ggp/gresley/moveselector/heuristic/MobilityHeuristicSearchMoveSelector.scala | Scala | mit | 360 |
package org.scalatra.swagger
import org.scalatra.swagger.AllowableValues.{ AllowableRangeValues, AllowableValuesList }
import org.scalatra.swagger.annotations._
import org.scalatra.swagger.reflect.Reflector
import org.specs2.mutable.Specification
object ModelSpec {
case class WithDescription(@ApiModelProperty(desc... | lightvector/scalatra | swagger/src/test/scala/org/scalatra/swagger/ModelSpec.scala | Scala | bsd-2-clause | 2,883 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.i18n
import java.net.URL
import javax.inject.Inject
import javax.inject.Provider
import javax.inject.Singleton
import play.api._
import play.api.http.HttpConfiguration
import play.api.libs.typedmap.TypedKey
import play.api.mvc.Cookie... | wegtam/playframework | core/play/src/main/scala/play/api/i18n/Messages.scala | Scala | apache-2.0 | 18,353 |
package com.websudos.phantom.udt
import com.datastax.driver.core.querybuilder.BuiltStatement
import com.datastax.driver.core.{ResultSet, Row, Session, UDTValue, UserType}
import com.twitter.util.{Future, Try}
import com.websudos.phantom.Implicits.Column
import com.websudos.phantom.query.ExecutableStatement
import com.... | nosheenzaza/phantom-data-centric | phantom-udt/src/main/scala/com/websudos/phantom/udt/UDTColumn.scala | Scala | gpl-2.0 | 6,776 |
package no.uio.musit.security.oauth2
trait OAuth2Constants {
val ClientID = "client_id"
val ClientSecret = "client_secret"
val RedirectURI = "redirect_uri"
val Scope = "scope"
val ResponseType = "response_type"
val State = "state"
val GrantType = ... | MUSIT-Norway/musit | musit-service/src/main/scala/no/uio/musit/security/oauth2/OAuth2Constants.scala | Scala | gpl-2.0 | 689 |
package org.jetbrains.plugins.scala
package lang.resolve.processor
import java.util
import org.jetbrains.plugins.scala.lang.psi.types.api.TypeSystem
import org.jetbrains.plugins.scala.lang.resolve.ResolveTargets._
import org.jetbrains.plugins.scala.lang.resolve.ScalaResolveResult
import scala.collection.Set
/**
* ... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/resolve/processor/ImplicitProcessor.scala | Scala | apache-2.0 | 3,016 |
package de.zalando.model
import de.zalando.apifirst.Application._
import de.zalando.apifirst.Domain._
import de.zalando.apifirst.ParameterPlace
import de.zalando.apifirst.naming._
import de.zalando.apifirst.Hypermedia._
import de.zalando.apifirst.Http._
import de.zalando.apifirst.Security
import java.net.URL
import Sec... | zalando/play-swagger | play-scala-generator/src/test/scala/model/resources.basic_auth_api_yaml.scala | Scala | mit | 1,784 |
package wandou.astore.schema
import java.util.concurrent.locks.ReentrantReadWriteLock
import akka.actor.{ Actor, ActorLogging, ActorRef, ActorSystem, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider, Props }
import akka.cluster.Cluster
import akka.contrib.datareplication.{ DataReplication, LWWMap }
im... | liyinhgqw/astore | src/main/scala/wandou/astore/schema/DistributedSchemaBoard.scala | Scala | apache-2.0 | 10,148 |
package net.sansa_stack.rdf.spark.mappings
import java.util.Objects
import com.holdenkarau.spark.testing.DataFrameSuiteBase
import net.sansa_stack.rdf.spark.mapper.{Cluster, ClusterEntry, LevenshteinMatcherConfig, Person}
import org.aksw.jenax.reprogen.core.JenaPluginUtils
import org.apache.jena.rdf.model.{ModelFacto... | SANSA-Stack/SANSA-RDF | sansa-rdf/sansa-rdf-spark/src/test/scala/net/sansa_stack/rdf/spark/mappings/AnnotationMapperTests.scala | Scala | apache-2.0 | 6,750 |
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.