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) 2013-2022 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | locationtech/geomesa | geomesa-spark/geomesa-spark-core/src/main/scala/org/locationtech/geomesa/spark/SpatialRDD.scala | Scala | apache-2.0 | 3,130 |
package mavigator
package cockpit
import org.scalajs.dom.html
import scalatags.JsDom.all._
import util._
/** Provides main cockpit layout. */
trait Layout { self: Page with Instruments =>
/** Elements to display in the mode control pannel (top panel). */
def mcp = div(id := "mcp")(
img(src := asset("images/... | project-condor/mavigator | mavigator-cockpit/src/main/scala/mavigator/cockpit/Layout.scala | Scala | gpl-3.0 | 1,232 |
/*
* 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 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala | Scala | apache-2.0 | 10,544 |
package com.nabijaczleweli.fancymagicks.render.model
import java.io.{ByteArrayInputStream, IOException, InputStream}
import java.util.zip.{ZipEntry, ZipException, ZipInputStream}
import javax.xml.parsers.{DocumentBuilderFactory, ParserConfigurationException}
import cpw.mods.fml.common.FMLLog
import cpw.mods.fml.relau... | nabijaczleweli/Magicks | src/main/scala/com/nabijaczleweli/fancymagicks/render/model/TechneModel.scala | Scala | mit | 8,474 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package utils
import java.io.File
abstract class Position extends Ordered[Position] {
val line: Int
val col: Int
val file: File
def compare(that: Position) = {
if (this.file == that.file) {
val ld = this.line - that.line
if (ld == 0) {
... | epfl-lara/leon | src/main/scala/leon/utils/Positions.scala | Scala | gpl-3.0 | 3,793 |
package org.psliwa.idea.composerJson.intellij.codeAssist
import com.intellij.json.JsonLanguage
import com.intellij.json.psi.{JsonFile, JsonObject, JsonProperty, JsonStringLiteral}
import com.intellij.patterns.PlatformPatterns._
import com.intellij.patterns.PsiElementPattern
import com.intellij.patterns.StandardPattern... | psliwa/idea-composer-plugin | src/main/scala/org/psliwa/idea/composerJson/intellij/codeAssist/composer/package.scala | Scala | mit | 963 |
package fpinscala.parallelism
import java.util.concurrent.Executors
import org.scalatest.{FlatSpec, Matchers}
class NonblockingSpec extends FlatSpec with Matchers {
import Nonblocking.Par._
private val executor = Executors.newFixedThreadPool(2)
private def testParResult[A, B](p: Nonblocking.Par[A])(test: A =>... | goboss/fpinscala | exercises/src/test/scala/fpinscala/parallelism/NonblockingSpec.scala | Scala | mit | 2,002 |
/*
* DocumentHandlerImpl.scala
* (Mellite)
*
* Copyright (c) 2012-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.mellit... | Sciss/Mellite | app/src/main/scala/de/sciss/mellite/impl/document/DocumentHandlerImpl.scala | Scala | agpl-3.0 | 2,310 |
package jp.co.cyberagent.aeromock.template.freemarker
import java.nio.file.Path
import jp.co.cyberagent.aeromock.AeromockTestModule
import jp.co.cyberagent.aeromock.config.definition.ProjectDef
import jp.co.cyberagent.aeromock.core.http.VariableManager
import jp.co.cyberagent.aeromock.helper._
import jp.co.cyberagent... | CyberAgent/aeromock | aeromock-freemarker/src/test/scala/jp/co/cyberagent/aeromock/template/freemarker/FreemarkerTemplateServiceSpec.scala | Scala | mit | 1,331 |
/*
* MilmSearch is a mailing list searching system.
*
* Copyright (C) 2013 MilmSearch Project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or any... | mzkrelx/milm-search-core | src/main/scala/org/milmsearch/core/service/DateTimeService.scala | Scala | gpl-3.0 | 1,205 |
/**
* Copyright 2010-2012 Alex Jones
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with work for additional information
* regarding copyright ownership. The ASF licenses file
* to you under the Apache License, Version ... | unclealex72/west-ham-calendar | test/dates/DateParserFactoryImplSpec.scala | Scala | apache-2.0 | 7,202 |
package com.peterpotts.snake.coercion
case object StringCoercer extends Coercer[String] {
def apply(any: Any): String = any.toString
}
| peterpotts/snake | src/main/scala/com/peterpotts/snake/coercion/StringCoercer.scala | Scala | mit | 138 |
import sbt._
import Keys._
object ChafeBuild extends Build {
lazy val chafed = Project(id = "chafed",
base = file("."))
lazy val samples = Project(id = "chafed-samples",
base = file("samples")) dependsOn(chafed)
}
| ofrasergreen/chafed | project/ChafeBuild.scala | Scala | apache-2.0 | 279 |
package com.rocketfuel.sdbc.h2.jdbc
import java.nio.ByteBuffer
import java.sql.{Timestamp, Time, Date}
import java.time._
import java.util.UUID
import scalaz.Scalaz._
class GettersSpec
extends H2Suite {
def testSelect[T](query: String, expectedValue: Option[T])(implicit converter: Row => Option[T]): Unit = {
... | wdacom/sdbc | h2/src/test/scala/com/rocketfuel/sdbc/h2/jdbc/GettersSpec.scala | Scala | bsd-3-clause | 3,128 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala | Scala | apache-2.0 | 14,180 |
package controllers
import java.util.UUID
import javax.inject.Inject
import com.mohiva.play.silhouette.api._
import com.mohiva.play.silhouette.api.repositories.AuthInfoRepository
import com.mohiva.play.silhouette.api.util.PasswordHasher
import com.mohiva.play.silhouette.impl.providers._
import forms.SignUpForm
import... | wjglerum/bamboesmanager | app/controllers/SignUp.scala | Scala | mit | 2,322 |
package io.backchat.hookup
package examples
import org.json4s._
import org.json4s.jackson.JsonMethods._
object ChatServer {
import DefaultConversions._
def makeServer() = {
val server = HookupServer(ServerInfo("ChatServer", port = 8127)){
new HookupServerClient {
def receive = {
case... | backchatio/hookup | src/main/scala/io/backchat/hookup/examples/ChatServer.scala | Scala | mit | 889 |
package com.nikolastojiljkovic.quilltrait.model
import com.nikolastojiljkovic.annotation.{ Field, Table }
@Table("page")
case class Page(
@Field("id") id: Option[Int],
@Field("is_root") isRoot: Boolean,
@Field("parent_id") parentId: Option[Int],
@Field("sorting") sorting: Option[Int],
@Field("title") ti... | nstojiljkovic/quill-trait | quill-trait-core/jvm/src/test/scala/com/nikolastojiljkovic/quilltrait/model/Page.scala | Scala | apache-2.0 | 387 |
/***********************************************************************
* Copyright (c) 2013-2019 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | elahrvivaz/geomesa | geomesa-convert/geomesa-convert-osm/src/test/scala/org/locationtech/geomesa/convert/osm/OsmNodesConverterTest.scala | Scala | apache-2.0 | 5,745 |
package spark.debugger
import java.io._
import scala.collection.JavaConversions._
import scala.collection.immutable
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
import spark.Logging
import spark.RDD
import spark.Dependency
import spark.ShuffleDependency
import spark.SparkContext
import... | ankurdave/arthur | core/src/main/scala/spark/debugger/EventLogReader.scala | Scala | bsd-3-clause | 15,389 |
package gh2011b.models
import net.liftweb.json.JsonAST.JValue
case class ForkEventPayload(forkee: Forkee)
object ForkEventPayload
{
def apply(json: JValue): Option[ForkEventPayload] =
{
val forkee = Forkee(json \ "forkee")
if(forkee.isDefined) Some(ForkEventPayload(forkee.get))
else None
... | mgoeminne/github_etl | src/main/scala/gh2011b/models/ForkEventPayload.scala | Scala | mit | 325 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package expr
import com.intellij.psi.PsiElement
/**
* @author Alexander Podkhalyuzin
* Date: 06.03.2008
*/
trait ScMethodCall extends ScExpression with MethodInvocation {
def deepestInvokedExpr: ScExpression = {
getEffectiveInvokedExpr m... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/api/expr/ScMethodCall.scala | Scala | apache-2.0 | 1,298 |
/*
* Copyright 2014 IBM 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 in... | bpburns/spark-kernel | protocol/src/test/scala/com/ibm/spark/kernel/protocol/v5/content/KernelInfoReplySpec.scala | Scala | apache-2.0 | 2,473 |
package geek.lawsof.physics.lib.block
import geek.lawsof.physics.lib.block.te.TileEntityBase
import geek.lawsof.physics.lib.block.traits.{IconArray, singleSided}
import geek.lawsof.physics.lib.item.ItemDescriptor
import net.minecraft.client.renderer.texture.IIconRegister
import net.minecraft.world.World
/**
* Create... | GeckoTheGeek42/TheLawsOfPhysics | src/main/scala/geek/lawsof/physics/lib/block/BlockDescriptor.scala | Scala | mit | 1,192 |
package org.jetbrains.plugins.scala.codeInsight.moveLeftRight
/**
* @author Nikolay.Tropin
*/
class ScalaMoveLeftRightTest extends ScalaMoveLeftRightTestBase {
def testMethodArgs(): Unit = {
doTestFromLeftToRight(
"Seq(<caret>1, 22, 333)",
"Seq(22, <caret>1, 333)",
"Seq(22, 333, <caret>1)"
... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/codeInsight/moveLeftRight/ScalaMoveLeftRightTest.scala | Scala | apache-2.0 | 3,299 |
/*
* Copyright 2013 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... | http4s/http4s | tests/shared/src/test/scala/org/http4s/headers/TransferEncodingSuite.scala | Scala | apache-2.0 | 1,996 |
package com.datawizards.dqm.alert.dto
case class SlackMessageAttachment(
color: String,
title: String,
text: String,
fallback: String,
footer: S... | piotr-kalanski/data-quality-monitoring | src/main/scala/com/datawizards/dqm/alert/dto/SlackMessageAttachment.scala | Scala | apache-2.0 | 406 |
/**
* Copyright (c) 2013 Saddle Development 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 ... | amaizing/amaizing-saddle | saddle-test-framework/src/test/scala/org/saddle/IndexArbitraries.scala | Scala | apache-2.0 | 1,611 |
/*
* Copyright (c) 2011 ScalaStuff.org (joint venture of Alexander Dvorkovyy and Ruud Diterwich)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.a... | scalastuff/scalabeans | src/test/scala/org/scalastuff/proto/TestFormat.scala | Scala | apache-2.0 | 2,684 |
package com.github.mauricio.async.db.exceptions
import com.github.mauricio.async.db.Connection
class ConnectionNotConnectedException(val connection: Connection)
extends DatabaseException(
"The connection %s is not connected to the database".format(connection)
)
| dripower/postgresql-async | db-async-common/src/main/scala/com/github/mauricio/async/db/exceptions/ConnectionNotConnectedException.scala | Scala | apache-2.0 | 278 |
package com.twitter.finagle.mux
import com.twitter.finagle.stats.NullStatsReceiver
import com.twitter.util.Future
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class FailureDetectorTest extends FunSuite
{
def ping = () => Future.D... | almendar/finagle | finagle-mux/src/test/scala/com/twitter/finagle/mux/FailureDetectorTest.scala | Scala | apache-2.0 | 1,689 |
/*
* Copyright 2017 Georgi Krastev
*
* 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 ... | joroKr21/flink-shapeless | src/bench/scala/org/apache/flink/ADTsBench.scala | Scala | apache-2.0 | 2,246 |
/*
* 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/main/scala/monix/reactive/instances/CatsProfunctorForSubject.scala | Scala | apache-2.0 | 2,599 |
package com.sksamuel.elastic4s
import java.time.LocalDate
import org.scalatest.Matchers
class ElasticDateTest extends org.scalatest.FlatSpec with Matchers {
"ElasticDate" should "support 'now' for the date" in {
ElasticDate.now.show should fullyMatch regex "now"
}
it should "support LocalDate date" in {
... | Tecsisa/elastic4s | elastic4s-core/src/test/scala/com/sksamuel/elastic4s/ElasticDateTest.scala | Scala | apache-2.0 | 1,352 |
package com.wavesplatform.lang.v1.compiler
import cats.instances.vector._
import cats.syntax.traverse._
import com.wavesplatform.lang.contract.DApp
import com.wavesplatform.lang.contract.DApp.{CallableFunction, VerifierFunction}
import com.wavesplatform.lang.v1.FunctionHeader
import com.wavesplatform.lang.v1.FunctionH... | wavesplatform/Waves | lang/shared/src/main/scala/com/wavesplatform/lang/v1/compiler/Decompiler.scala | Scala | mit | 11,701 |
package com.github.mauricio.async.db.postgresql.encoders
import com.github.mauricio.async.db.postgresql.column.PostgreSQLColumnEncoderRegistry
import com.github.mauricio.async.db.postgresql.messages.frontend.PreparedStatementExecuteMessage
import io.netty.util.CharsetUtil
import org.specs2.mutable.Specification
class... | outbrain/postgresql-async | postgresql-async/src/test/scala/com/github/mauricio/async/db/postgresql/encoders/ExecutePreparedStatementEncoderSpec.scala | Scala | apache-2.0 | 1,033 |
package com.xah.chat.comms
import android.os.Binder
class XBinder(service: XService) extends Binder {
def getService() = {
service
}
} | lemonxah/xaHChat | src/main/scala/com/xah/chat/comms/XBinder.scala | Scala | mit | 144 |
/*
* 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 ... | hongyuhong/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/functions/aggfunctions/MaxAggFunctionTest.scala | Scala | apache-2.0 | 5,737 |
package com.twitter.server
import com.twitter.app.GlobalFlag
import com.twitter.finagle.{Addr, Resolver, Name}
import com.twitter.util.Var
@deprecated(
"Users should prefer using Dtabs which are overridable by setting the `dtab.add` flag",
"2019-04-03")
object resolverMap
extends GlobalFlag[Map[String, String... | twitter/twitter-server | server/src/main/scala/com/twitter/server/FlagResolver.scala | Scala | apache-2.0 | 1,369 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/plan/util/InputTypeBuilder.scala | Scala | apache-2.0 | 1,722 |
package metaconfig.cli
import org.typelevel.paiges.Doc
object VersionCommand extends Command[Unit]("version") {
override def extraNames: List[String] = List("-v", "--version", "-version")
override def description: Doc = Doc.paragraph("Show version information")
def run(value: Unit, app: CliApp): Int = {
app... | olafurpg/metaconfig | metaconfig-core/shared/src/main/scala/metaconfig/cli/VersionCommand.scala | Scala | apache-2.0 | 358 |
/*
* 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 ... | michalsenkyr/spark | resource-managers/yarn/src/test/scala/org/apache/spark/network/yarn/YarnShuffleServiceMetricsSuite.scala | Scala | apache-2.0 | 2,977 |
package scredis.protocol.requests
import scala.language.higherKinds
import scredis.protocol._
import scredis.serialization.{ Reader, Writer }
import scala.collection.generic.CanBuildFrom
object SetRequests {
object SAdd extends Command("SADD") with WriteCommand
object SCard extends Command("SCARD")
object S... | scredis/scredis | src/main/scala/scredis/protocol/requests/SetRequests.scala | Scala | apache-2.0 | 5,557 |
import leon.lang._
object MutableGenerics5 {
case class C(var x: Int)
def hof[A](f: (Int, A) => Int, a: A): Int = f(1, a)
//shouldn't be able to instantiate with mutable type
def test(): Int = {
val state = C(42)
hof((x: Int, s: C) => { s.x = s.x + 1; x }, state)
assert(state.x == 43)
0
}
... | epfl-lara/leon | src/test/resources/regression/xlang/error/MutableGenerics5.scala | Scala | gpl-3.0 | 323 |
package org.alcaudon.runtime
import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import org.alcaudon.clustering.DataflowTopologyListener
import org.alcaudon.clustering.DataflowTopologyListener.{DataflowNodeAddress, DownstreamDependencies}
import org.alcaudon.core._
import org.alcaudon.core.sources.{SourceCtx, Sou... | fcofdez/alcaudon | src/main/scala/org/alcaudon/runtime/SourceReifier.scala | Scala | apache-2.0 | 1,748 |
/*
* 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 | sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala | Scala | apache-2.0 | 107,524 |
package com.avsystem.commons
package redis
import java.io.File
import org.apache.commons.io.FileUtils
import org.scalatest.{BeforeAndAfterAll, Suite}
import scala.concurrent.Await
import scala.concurrent.duration._
/**
* Author: ghik
* Created: 27/06/16.
*/
trait UsesClusterServers extends BeforeAndAfterAll w... | AVSystem/scala-commons | commons-redis/src/test/scala/com/avsystem/commons/redis/UsesClusterServers.scala | Scala | mit | 1,474 |
/*
* 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 agree... | netconstructor/zipkin | zipkin-server/src/test/scala/com/twitter/zipkin/config/sampler/AdjustableRateConfigSpec.scala | Scala | apache-2.0 | 1,238 |
/*
* Copyright 2015 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | xnejp03/http-caching-client | app/uk/gov/hmrc/http/cache/client/ShortLivedCache.scala | Scala | apache-2.0 | 3,045 |
package nfn.service.Temperature
import akka.actor.ActorRef
import ccn.packet.CCNName
import nfn.service.{NFNIntValue, NFNService, NFNStringValue, NFNValue}
import scala.concurrent.duration._
/**
* Created by blacksheeep on 13/11/15.
*/
class ReadSensorDataSimu() extends NFNService {
val consttemp = 20
val co... | cn-uofbasel/nfn-scala | src/main/scala/nfn/service/Temperature/ReadSensorDataSimu.scala | Scala | isc | 1,000 |
package com.timgroup.eventstore.memory
import com.timgroup.clocks.joda.testing.ManualJodaClock
import com.timgroup.eventstore.api.EventStoreTest
import com.timgroup.eventstore.memory.Wrapper._
import org.joda.time.DateTimeZone
import org.scalatest.{FunSpec, MustMatchers, OneInstancePerTest}
class InMemoryEventStoreTe... | tim-group/tg-eventstore | memory-legacy/src/test/scala/com/timgroup/eventstore/memory/InMemoryEventStoreTest.scala | Scala | bsd-2-clause | 1,049 |
package reactivemongo.api.commands
import reactivemongo.api.SerializationPack
private[reactivemongo] final class DropIndexes(
val index: String) extends CollectionCommand with CommandWithResult[DropIndexesResult] {
val commandKind = CommandKind.DropIndexes
override def equals(that: Any): Boolean = that match ... | ReactiveMongo/ReactiveMongo | driver/src/main/scala/api/commands/DropIndexes.scala | Scala | apache-2.0 | 1,472 |
package infra.piece.file
import infra.piece.core.Piece
/**
* @author alari (name.alari@gmail.com)
* @since 08.05.14 14:22
*/
case class FilePiece(fileId: String,
filename: String,
title: Option[String],
fileIds: Seq[String],
id: Op... | alari/play-content | module-code/app/infra/piece/file/FilePiece.scala | Scala | mit | 411 |
/**
* Created by wuyiran on 11/18/16.
*/
package com.iwantfind
import java.sql.DriverManager
import org.apache.hadoop.conf._
import org.apache.spark.{SparkConf, SparkContext}
import java.sql.Connection
/** Computes an approximation to pi */
// TODO not implement
object DBUtils {
val url = "jdbc:mysql://local... | Yiran-wu/iwantfind-tool | src/main/scala/com/iwantfind/DBUtils.scala | Scala | apache-2.0 | 739 |
/*
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016 SWEeneyThreads
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the right... | SweeneyThreads/Actorbase | src/main/scala/server/messages/query/user/DatabaseMessages.scala | Scala | mit | 4,356 |
/*
* 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/nodes/physical/batch/BatchPhysicalSortMergeJoin.scala | Scala | apache-2.0 | 7,847 |
/**
* 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... | dchenbecker/kafka-sbt | core/src/main/scala/kafka/admin/ShutdownBroker.scala | Scala | apache-2.0 | 4,728 |
/*
* 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 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateProjection.scala | Scala | apache-2.0 | 7,858 |
package sharry.common
import io.circe.Decoder
import io.circe.Encoder
final case class ByteSize(bytes: Long) {
def toHuman: String =
ByteSize.bytesToHuman(bytes)
def <=(other: ByteSize) =
bytes <= other.bytes
def >=(other: ByteSize) =
bytes >= other.bytes
def >(other: ByteSize) =
bytes > ot... | eikek/sharry | modules/common/src/main/scala/sharry/common/ByteSize.scala | Scala | gpl-3.0 | 1,764 |
package com.arcusys.valamis.web.portlet
import javax.portlet.{RenderRequest, RenderResponse}
import com.arcusys.learn.liferay.services.CompanyHelper
import com.arcusys.learn.liferay.util.PortalUtilHelper
import com.arcusys.valamis.lrssupport.oauth.OAuthPortlet
import com.arcusys.valamis.util.serialization.JsonHelper
... | arcusys/JSCORM | valamis-portlets/src/main/scala/com/arcusys/valamis/web/portlet/TinCanStatementViewerView.scala | Scala | gpl-3.0 | 1,082 |
/*
* 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... | svn2github/scalatest | src/test/scala/org/scalatest/ShouldMatcherSpec.scala | Scala | apache-2.0 | 19,421 |
package spark.streaming.dstream
import spark.streaming.{Duration, DStream, Time}
import spark.RDD
private[streaming]
class MappedDStream[T: ClassManifest, U: ClassManifest] (
parent: DStream[T],
mapFunc: T => U
) extends DStream[U](parent.ssc) {
override def dependencies = List(parent)
override def sl... | koeninger/spark | streaming/src/main/scala/spark/streaming/dstream/MappedDStream.scala | Scala | bsd-3-clause | 491 |
package net.tobysullivan.shorturl
class HashNotFoundException(msg: String) extends Exception {
} | tobyjsullivan/shorturl | src/main/scala/net/tobysullivan/shorturl/HashNotFoundException.scala | Scala | mit | 99 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/UnsupportedOperationChecker.scala | Scala | apache-2.0 | 8,204 |
implicit val treeFunctor = new Functor[Tree] {
def fmap[A, B](f: A => B)(fa: Tree[A]): Tree[B] = fa match {
case Leaf(a) => Leaf(f(a))
case Node(t, t1) => Node(fmap(f)(t), fmap(f)(t1))
}
} | hmemcpy/milewski-ctfp-pdf | src/content/1.8/code/scala/snippet15.scala | Scala | gpl-3.0 | 200 |
package breeze.collection.mutable
/*
Copyright 2012 David Hall
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 ... | tjhunter/scalanlp-core | math/src/test/scala/breeze/collection/mutable/SparseArrayTest.scala | Scala | apache-2.0 | 1,753 |
package scaliper
import scaliper._
import java.io.File
import java.io.IOException
import scala.collection.JavaConversions._
import scala.collection.mutable
object MeasurementType {
val TIME = 0
val INSTANCE = 1
val MEMORY = 2
val DEBUG = 3
}
object SetupRunner {
def split(args:String) = args.split("\\\\s+... | azavea/scaliper | src/main/scala/scaliper/SetupRunner.scala | Scala | apache-2.0 | 2,674 |
package neuroflow.core
import breeze.generic.UFunc
import breeze.linalg.DenseMatrix
import breeze.storage.Zero
import neuroflow.dsl.Convolution
import scala.reflect.ClassTag
/**
* Collection of common operators expressed as [[UFunc]].
* The CPU implementations are found here, the GPU implicits
* are found in t... | zenecture/neuroflow | core/src/main/scala/neuroflow/core/Operators.scala | Scala | apache-2.0 | 8,222 |
/*
* 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... | kapil-malik/incubator-toree | kernel-api/src/main/scala/org/apache/toree/magic/LineMagic.scala | Scala | apache-2.0 | 1,080 |
package org.bitcoins.core.script.constant
import org.bitcoins.core.number.Int64
import org.scalatest.{FlatSpec, MustMatchers}
/**
* Created by chris on 1/25/16.
*/
class ScriptNumberTest extends FlatSpec with MustMatchers {
val zero = ScriptNumber.zero
val one = ScriptNumber.one
val ten = ScriptNumber(10)
... | bitcoin-s/bitcoin-s-core | core-test/src/test/scala/org/bitcoins/core/script/constant/ScriptNumberTest.scala | Scala | mit | 1,485 |
package com.twitter.zipkin.storage
import com.google.common.base.Charsets._
import com.twitter.util.Future
import com.twitter.zipkin.Constants._
import com.twitter.zipkin.common.Span
import java.nio.ByteBuffer
/**
* Convenience trait to until existing [[SpanStore]] implementations implement
* [[QueryRequest]] nativ... | prat0318/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/storage/CollectAnnotationQueries.scala | Scala | apache-2.0 | 5,334 |
package pub.ayada.scala.utils.oracle
object OraUtils {
def getJDBC_URL_SID(Server:String, Port:String, SID:String):String = {
"jdbc:oracle:thin:@"+Server+ ":"+ Port + ":"+SID;
}
def getJDBC_URL_SRVC(Server:String, Port:String, Service:String):String = {
"jdbc:oracle:thin:@//"+Server+ ":"+ P... | k-ayada/ScalaUtils | pub/ayada/scala/utils/oracle/OraUtils.scala | Scala | apache-2.0 | 6,568 |
import scala.language.postfixOps
import scala.tools.nsc.*
object Test {
val tokens = List("", "-deprecation", "foo.scala")
val subsets = tokens.toSet.subsets.toList
val permutations0 = subsets.flatMap(_.toList.permutations).distinct
def runWithCp(cp: String) = {
val permutations = permutatio... | dotty-staging/dotty | tests/pending/run/settings-parse.scala | Scala | apache-2.0 | 940 |
/*
* Copyright 2020 David Edwards
*
* 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... | davidledwards/zookeeper | zookeeper-cli/src/main/scala/com/loopfor/zookeeper/cli/command/Mk.scala | Scala | apache-2.0 | 8,138 |
/**
* Exercise 6:
*
* In the Person class of Section 5.1, “Simple Classes and Parameterless Methods,”
* on page 55, provide a primary constructor that turns negative ages to 0.
*
**/
class Person(var name: String, var age: Int = 0) {
if (age < 0) age = 0
}
| ragmha/scala-impatient | solutions/classes/ex6.scala | Scala | mit | 264 |
/*-------------------------------------------------------------------------*\
** ScalaCheck **
** Copyright (c) 2007-2018 Rickard Nilsson. All rights reserved. **
** http://www.scalacheck.org **
** ... | martijnhoekstra/scala | src/scalacheck/org/scalacheck/util/ConsoleReporter.scala | Scala | apache-2.0 | 1,840 |
package org.jetbrains.plugins.scala
package codeInspection.collections
import org.jetbrains.plugins.scala.codeInspection.InspectionBundle
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression
/**
* Nikolay.Tropin
* 2014-05-05
*/
class FoldTrueAndInspection extends OperationOnCollectionInspection {
ov... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/collections/FoldTrueAndInspection.scala | Scala | apache-2.0 | 918 |
package com.nielsen.ecom.wordseg
import scala.concurrent.duration._
import scala.concurrent.forkjoin.ThreadLocalRandom
import com.typesafe.config.ConfigFactory
import akka.actor.Actor
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.Address
import akka.actor.PoisonPill
import akka.actor.Props... | adrianwkj/web_akka | src/main/scala/com/nielsen/ecom/wordseg/CodingClient.scala | Scala | cc0-1.0 | 3,283 |
package drt.server.feeds.lcy
import akka.http.scaladsl.marshallers.xml.ScalaXmlSupport._
import akka.http.scaladsl.model._
import akka.http.scaladsl.unmarshalling.{Unmarshal, Unmarshaller}
import drt.shared.Terminals.T1
import drt.shared.api.Arrival
import drt.shared.{ArrivalStatus, LiveFeedSource, Operator, PortCode}... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/test/scala/drt/server/feeds/lcy/LCYFlightTransformSpec.scala | Scala | apache-2.0 | 15,796 |
package clientmacros.tojs
import japgolly.scalajs.react.vdom.{TagOf, VdomElement, VdomNode}
import japgolly.scalajs.react.{CallbackTo, raw}
import scala.collection.{GenMap, GenTraversableOnce}
import scala.language.existentials
import scala.language.experimental.macros
import scala.reflect.macros.blackbox
import scal... | UKHomeOffice/drt-scalajs-spa-exploration | client-macros/src/main/scala/clientmacros/tojs/JSMacro.scala | Scala | apache-2.0 | 6,704 |
package org.camunda.feel.impl.script
import java.io.{Closeable, IOException, Reader}
import javax.script._
import org.camunda.feel.FeelEngine
import org.camunda.feel.FeelEngine.EvalExpressionResult
import org.camunda.feel.impl.SpiServiceLoader
import org.camunda.feel.syntaxtree.{Exp, ParsedExpression}
import org.camu... | saig0/feel | feel-engine/src/main/scala/org/camunda/feel/impl/script/FeelScriptEngine.scala | Scala | apache-2.0 | 3,072 |
/**
* The MIT License (MIT)
*
* Copyright (c) 2018 Israel Freitas(israel.araujo.freitas@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including with... | ifreitas/AimlToXml | src/main/scala/ifreitas/scalaaiml/elements/Id.scala | Scala | mit | 1,287 |
/*
* Copyright (C) 2017 LREN CHUV for Human Brain Project
*
* 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) any later version... | HBPSP8Repo/workflow | src/test/scala/ch/chuv/lren/woken/dao/ExtendedFeaturesTableRepositoryDAOTest.scala | Scala | apache-2.0 | 11,807 |
package org.judal.storage.scala
import javax.jdo.JDOException
import org.judal.storage.EngineFactory
import org.judal.storage.StorageObjectFactory
import org.judal.storage.query.AbstractQuery
import org.judal.storage.query.relational.AbstractRelationalQuery
import org.judal.storage.table.Record
import org.judal.stora... | sergiomt/judal | scala-adaptor/src/main/scala/org/judal/storage/scala/RelationalQuery.scala | Scala | apache-2.0 | 2,683 |
/***********************************************************************
* Copyright (c) 2013-2016 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 ... | nagavallia/geomesa | geomesa-accumulo/geomesa-accumulo-jobs/src/main/scala/org/locationtech/geomesa/jobs/accumulo/index/AttributeIndexJob.scala | Scala | apache-2.0 | 8,365 |
/*
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.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 require... | frees-io/freestyle | modules/cache/shared/src/test/scala/free/TestContext.scala | Scala | apache-2.0 | 1,435 |
package com.github.cuzfrog.scmd.macros.argutils
import com.github.cuzfrog.scmd.macros.argutils.RawArg.{RawCommand, RawPrior}
import scala.collection.immutable
import scala.meta._
private object AddExplicitTypeImpl {
def addExplicitType(rawArgs: immutable.Seq[RawArg]): immutable.Seq[Stat] = {
rawArgs map {
... | cuzfrog/simple-cmd | src/main/scala/com/github/cuzfrog/scmd/macros/argutils/AddExplicitTypeImpl.scala | Scala | apache-2.0 | 834 |
/*
* Copyright 2015 Dmitriy Yefremov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | dmitriy-yefremov/sleipnir | generator/src/main/scala/net/yefremov/sleipnir/data/custom/LongMap.scala | Scala | apache-2.0 | 1,660 |
/*
* 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 ... | bwsw/sj-platform | core/sj-engine-simulators/src/main/scala/com/bwsw/sj/engine/core/simulation/state/StateLoaderMock.scala | Scala | apache-2.0 | 1,454 |
/**
* 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... | ijuma/kafka | core/src/test/scala/unit/kafka/server/ServerStartupTest.scala | Scala | apache-2.0 | 4,711 |
object Test {
def main(args: Array[String]) {
new foo.Bar
println("You buttered your bread. Now sleep in it!")
}
}
package foo {
trait Foo { def foo() {} }
class Bar extends Baz with Foo
abstract class Baz
object Baz extends Foo
}
| felixmulder/scala | test/files/run/t5105.scala | Scala | bsd-3-clause | 253 |
/*
* 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/tensor/QuantizedTensorUnsupported.scala | Scala | apache-2.0 | 47,033 |
package com.github.lstephen.ootp.ai.value
import com.github.lstephen.ootp.ai.player.Player
import com.github.lstephen.ootp.ai.player.ratings.Position
import com.github.lstephen.ootp.ai.regression.Predictor
import com.github.lstephen.ootp.ai.score._
import com.github.lstephen.ootp.ai.selection.lineup.PlayerDefenseScore... | lstephen/ootp-ai | src/main/scala/com/github/lstephen/ootp/ai/value/FutureValue.scala | Scala | apache-2.0 | 3,456 |
/*
* Copyright (c) 2013 Daniel Krzywicki <daniel.krzywicki@agh.edu.pl>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
... | eleaar/scala-mas | core/src/main/scala/pl/edu/agh/scalamas/app/ConcurrentStack.scala | Scala | mit | 2,057 |
package xyz.hyperreal.cramsite
import akka.actor.Actor
import spray.routing._
import spray.http._
import spray.json._
import spray.json.DefaultJsonProtocol._
import spray.httpx.SprayJsonSupport._
import MediaTypes._
import shapeless._
import in.azeemarshad.common.sessionutils.SessionDirectives
import concurrent.du... | edadma/cram-site | src/main/scala/CramSiteServiceActor.scala | Scala | mit | 6,779 |
package org.modelfun.paths
/**
* Arbitrary network of connected nodes.
*/
trait Path {
def roots: List[PathNode]
}
| zzorn/modelfun | src/main/scala/org/modelfun/paths/Path.scala | Scala | lgpl-3.0 | 120 |
package spire
package math
import scala.math.{ScalaNumber, ScalaNumericConversions}
import scala.collection.compat.immutable.LazyList
import scala.collection.compat.immutable.LazyList.#::
import spire.algebra.{Field, Trig, TruncatedDivisionCRing}
import spire.syntax.nroot._
import spire.util.Opt
sealed trait Real ex... | non/spire | core/src/main/scala/spire/math/Real.scala | Scala | mit | 18,719 |
/**
* 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... | WillCh/cs286A | dataMover/kafka/core/src/test/scala/unit/kafka/log/LogTest.scala | Scala | bsd-2-clause | 34,238 |
package de.htwg.zeta.generator.file
import java.util.UUID
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.concurrent.Promise
import com.google.inject.Guice
import de.htwg.zeta.common.models.entity.File
import de.htwg.zeta.common.models.entity.Filter
import de.htw... | Zeta-Project/zeta | api/images/generator/file/src/main/scala/de/htwg/zeta/generator/file/Main.scala | Scala | bsd-2-clause | 3,696 |
/***********************************************************************
* Copyright (c) 2013-2019 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | elahrvivaz/geomesa | geomesa-accumulo/geomesa-accumulo-security/src/main/scala/org/locationtech/geomesa/accumulo/security/VisibilityFilterFunction.scala | Scala | apache-2.0 | 2,351 |
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.