code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package com.phosphene.kafkastorm.kafka
import java.util.Properties
import kafka.server.{KafkaServerStartable, KafkaConfig}
import kafka.utils.Logging
/**
* Runs an in-memory, "embedded" instance of a Kafka broker, which listens at `127.0.0.1:9092`.
*
* Requires a running ZooKeeper instance to connect to. By defau... | phosphene/kafka-storm-test-demo | src/main/scala/com/phosphene/kafkastorm/kafka/KafkaEmbedded.scala | Scala | apache-2.0 | 2,087 |
/*
* 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 ... | mike0sv/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/GroupStateImpl.scala | Scala | apache-2.0 | 8,126 |
package com.fijimf
import org.joda.time.{Months, LocalDate}
case class AdjustableRateMortgage
(
originalBalance: Double,
originalTerm: Int,
origDate: LocalDate,
firstPayDate: LocalDate,
currentBalance: Double,
currentTerm: Int,
currentRate: Double,
index: String,
margin: Double,
nex... | fijimf/msfcf | msfcf-core/src/main/scala/com/fijimf/AdjustableRateMortgage.scala | Scala | mit | 2,206 |
abstract class GenericParamInput[T] {
val x: T
def foo {
val y = x
/*start*/
println(y)
/*end*/
}
}
/*
abstract class GenericParamInput[T] {
val x: T
def foo {
val y = x
testMethodName(y)
}
def testMethodName(y: T): Unit = {
println(y)
}
}
*/ | whorbowicz/intellij-scala | testdata/extractMethod/input/GenericParamInput.scala | Scala | apache-2.0 | 285 |
package edu.cornell.cdm89.scalaspec.pde
import akka.actor.{Actor, ActorLogging, ActorRef}
import breeze.linalg.DenseVector
import edu.cornell.cdm89.scalaspec.domain.GllElement.{Coords, InitialData}
import edu.cornell.cdm89.scalaspec.domain.Subdomain
import edu.cornell.cdm89.scalaspec.ode.ElementState
import edu.corne... | cdmuhlb/DGenerate | src/main/scala/edu/cornell/cdm89/scalaspec/pde/TrianglePulseInitialData.scala | Scala | mit | 1,428 |
/*
* Copyright 2014 Frugal Mechanic (http://frugalmechanic.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... | frugalmechanic/fm-xml | src/main/scala/fm/xml/CommentingXMLStreamWriter.scala | Scala | apache-2.0 | 10,204 |
package security
import models.User
import reactivemongo.api.indexes.Index
import repository.{MongoProfileRepository, MongoTokenRepository}
import securesocial.core.services.UserService
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
object MongoUserService extends UserServic... | timothygordon32/reactive-todolist | app/security/MongoUserService.scala | Scala | mit | 635 |
//: ----------------------------------------------------------------------------
//: Copyright (C) 2015 Verizon. All Rights Reserved.
//:
//: 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 Licen... | neigor/funnel | core/src/main/scala/JVM.scala | Scala | apache-2.0 | 6,061 |
/*
* 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/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetTest.scala | Scala | apache-2.0 | 3,715 |
package test
object Foo {
def foo = 1
}
object Bar {
def foo = 2
}
object Test123 {
import Foo.foo
object Inner {
import Bar._
//!! println(foo)
}
}
| yusuke2255/dotty | test/x/names.scala | Scala | bsd-3-clause | 173 |
package com.kakao.shaded.jackson.module.scala.deser
import com.kakao.shaded.jackson.core.{JsonParser, JsonToken}
import com.kakao.shaded.jackson.databind._
import com.kakao.shaded.jackson.databind.deser._
import com.kakao.shaded.jackson.databind.deser.std.StdDeserializer
import com.kakao.shaded.jackson.databind.jsonty... | kakao/mango | mango-shaded/src/main/scala/com/kakao/shaded/jackson/module/scala/deser/EitherDeserializer.scala | Scala | apache-2.0 | 4,019 |
package com.github.gdefacci.briscola.game
import scalaz.{-\\/, \\/, \\/-}
import com.github.gdefacci.briscola.player._
object GamePlayersValidator {
def withValidPlayersAndTeams[T](gamePlayers:GamePlayers, playerById:PlayerId => Option[Player])(f:(Set[Player], Option[Teams]) => T):BriscolaError \\/ T = {
va... | gdefacci/briscola | ddd-briscola/src/main/scala/com/github/gdefacci/briscola/game/GamePlayersValidator.scala | Scala | bsd-3-clause | 3,116 |
package com.benkolera.Rt
import org.joda.time.format.DateTimeFormat
import org.joda.time.{DateTimeZone,DateTime}
import scalaz._
package object Formatter {
def fieldListToString( l: List[String] ) = {
l.mkString(",\\n ")
}
private val dtf = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss")
def fie... | benkolera/scala-rt | src/main/scala/Rt/Formatter/package.scala | Scala | mit | 834 |
/*
* Copyright 2011-2022 GatlingCorp (https://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | gatling/gatling | gatling-core/src/main/scala/io/gatling/core/check/css/CssExtractors.scala | Scala | apache-2.0 | 2,006 |
/*
* Copyright (c) 2014-2015 by its authors. Some rights reserved.
* See the project homepage at: http://www.monifu.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://... | sergius/monifu | monifu/shared/src/test/scala/monifu/reactive/internals/operators/FilterSuite.scala | Scala | apache-2.0 | 2,435 |
package org.lanyard.dist.disc
import org.lanyard.dist.Distribution
import org.lanyard.random.RNG
case class Geometric( prob: Double ) extends Distribution[Int] {
override def apply( value: Int ): Double = 0.0
def mean: Double = 1 / prob
def variance: Double = ( 1 - prob ) / (prob * prob)
def random( sourc... | perian/Lanyard | src/main/scala/org/lanyard/dist/disc/Geometric.scala | Scala | gpl-2.0 | 350 |
package net.kolotyluk.akka.example
import akka.typed.{ActorRef, Behavior}
import akka.typed.scaladsl.Actor
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import grizzled.slf4j.Logger
import net.kolotyluk.akka.example.Guardian.Spawn
object Brat extends Runnable {
trait... | kolotyluk/akka-laboratory | src/main/scala/net/kolotyluk/akka/example/Brat.scala | Scala | apache-2.0 | 1,412 |
/**
RLTools is a library for reinforcement learning methods.
Copyright (C) 2013 Petteri Mehtala (petteri.mehtala@gmail.com)
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, e... | mehtala/RLTools | src/main/scala/core/Policy.scala | Scala | gpl-3.0 | 1,049 |
/**
* 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... | jo-pol/easy-stage-dataset | command/src/test/scala/nl.knaw.dans.easy.stage.command/CustomMatchers.scala | Scala | apache-2.0 | 1,567 |
package com.sksamuel.scapegoat.io
import scala.xml.Unparsed
import com.sksamuel.scapegoat.{Feedback, Levels}
/**
* @author Stephen Samuel
*/
object HtmlReportWriter extends ReportWriter {
override protected def fileName: String = "scapegoat.html"
private val css =
"""
| body {
| f... | sksamuel/scalac-scapegoat-plugin | src/main/scala/com/sksamuel/scapegoat/io/HtmlReportWriter.scala | Scala | apache-2.0 | 3,731 |
package chess
import org.specs2.mutable.Specification
class StatsTest extends Specification {
def realMean(elts: Seq[Float]): Float = elts.sum / elts.size
def realVar(elts: Seq[Float]): Float = {
val mean = realMean(elts).toDouble
(elts map { x =>
Math.pow(x - mean, 2)
} sum).toFloat / (elts.s... | ornicar/scalachess | src/test/scala/StatsTest.scala | Scala | mit | 1,603 |
/**
* Copyright (C) 2014 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | ajw625/orbeon-forms | src/main/scala/org/orbeon/oxf/fr/embedding/APISupport.scala | Scala | lgpl-2.1 | 11,616 |
package model
import org.specs2.mock.Mockito
import play.api.test.{PlaySpecification}
class ResponseParsingSpec extends PlaySpecification with Mockito {
"ComposerResponse" should {
val composerContentId = "a1b2c3d4"
"extract composer content ID from CREATED response messages" in {
val response = C... | guardian/flex-content-migrator | test/model/ResponseParsingSpec.scala | Scala | mit | 1,940 |
package com.krux.hyperion.activity
import com.krux.hyperion.action.SnsAlarm
import com.krux.hyperion.adt.{ HInt, HDuration }
import com.krux.hyperion.precondition.Precondition
import com.krux.hyperion.resource.{ ResourceObject, Resource }
case class ActivityFields[A <: ResourceObject](
runsOn: Resource[A],
depend... | sethyates/hyperion | core/src/main/scala/com/krux/hyperion/activity/ActivityFields.scala | Scala | apache-2.0 | 821 |
package com.sksamuel.elastic4s.bulk
import com.sksamuel.elastic4s.indexes.IndexApi
import scala.language.implicitConversions
trait BulkApi {
this: IndexApi =>
def bulk(requests: Iterable[BulkCompatibleRequest]): BulkRequest = BulkRequest(requests.toSeq)
def bulk(requests: BulkCompatibleRequest*): BulkRequest ... | Tecsisa/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/bulk/BulkApi.scala | Scala | apache-2.0 | 348 |
/***********************************************************************
* 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-utils/src/test/scala/org/locationtech/geomesa/utils/stats/CountStatTest.scala | Scala | apache-2.0 | 3,059 |
/*
* Copyright 2001-2009 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... | hubertp/scalatest | src/test/scala/org/scalatest/BigSuite.scala | Scala | apache-2.0 | 8,527 |
package io.finch
import java.util.UUID
class ParamSpec extends FinchSpec {
behavior of "param*"
def withParam(k: String)(v: String): Input = Input.get("/", k -> v)
checkAll("Param[String]", EndpointLaws[String](paramOption("x"))(withParam("x")).evaluating)
checkAll("Param[Int]", EndpointLaws[Int](paramOpti... | ilya-murzinov/finch | core/src/test/scala/io/finch/ParamSpec.scala | Scala | apache-2.0 | 826 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package scalaguide.ws.scalaws
import akka.Done
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import play.api.{Environment, Mode}
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.libs.ws.ahc._
import pl... | wsargent/playframework | documentation/manual/working/scalaGuide/main/ws/code/ScalaWSSpec.scala | Scala | apache-2.0 | 17,577 |
/*
* Copyright (c) 2009, Ken Faulkner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* Redistributions of source code must retain the above copyright
notice, this list of condition... | kpfaulkner/azurestorage | src/azurestorage/DAO/AzureStorageContainerDAO.scala | Scala | bsd-3-clause | 14,757 |
/*
* 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/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala | Scala | apache-2.0 | 15,683 |
package ohnosequences
// Here we define our DSL
case object expr {
sealed trait AnyExpr { type Repr }
sealed trait BoolExpr extends AnyExpr { type Repr = Boolean }
case class BoolVar(sym: Symbol) extends BoolExpr
case class Not[E <: BoolExpr](val inside: E) extends BoolExpr
case class And[L <: BoolExpr, R... | laughedelic/rephrase | src/main/scala/gadt.scala | Scala | agpl-3.0 | 1,060 |
package com.outr.arango.api
import com.outr.arango.api.model._
import io.youi.client.HttpClient
import io.youi.http.HttpMethod
import io.youi.net._
import io.circe.Json
import scala.concurrent.{ExecutionContext, Future}
object AdminExecute {
def post(client: HttpClient, body: Json)(implicit ec: ExecutionCont... | outr/arangodb-scala | api/src/main/scala/com/outr/arango/api/AdminExecute.scala | Scala | mit | 458 |
package proofpeer.metis.util
import scalaz._
trait PartialOrder[A] {
def tryCompare(x: A, y: A): Option[Ordering]
}
| proofpeer/proofpeer-metis | shared/src/main/scala/proofpeer/metis/util/PartialOrder.scala | Scala | mit | 120 |
package akka.contrib.mailbox
/**
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
import java.util.concurrent.atomic.AtomicInteger
import akka.actor.{ActorRef, ActorSystem}
import akka.dispatch.{Envelope, MailboxType, MessageQueue, UnboundedMailbox}
import akka.event.Logging
import com.typesafe.... | simao/riepete | src/main/scala/akka/contrib/mailbox/LoggingMailbox.scala | Scala | mit | 2,474 |
// Copyright (C) 2015 IBM Corp. All Rights Reserved.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may ob... | kane77/watson-scala-wrapper | src/main/scala/com/ibm/watson/developer_cloud/visual_recognition/v1/VisualRecognition.scala | Scala | apache-2.0 | 3,173 |
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
import org.scalajs.jsdependencies.sbtplugin.JSDependenciesPlugin.autoImport._
import org.scalajs.jsdependencies.sbtplugin.JSModuleID
import sbt.Keys.scalaVersion
import sbt._
object Dependencies {
val versionOfScala = "2.13.8" //update .github/... | UdashFramework/udash-core | project/Dependencies.scala | Scala | apache-2.0 | 6,503 |
/*******************************************************************************
* Copyright (c) 2019. Carl Minden
*
* 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 ... | carlminden/anathema-roguelike | src/com/anathema_roguelike/stats/effects/EffectCollection.scala | Scala | gpl-3.0 | 3,127 |
/*
* Copyright (c) 2014 Erik van Oosten
*
* 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 ag... | thecoda/scala-imperial | src/test/scala/imperial/mixins/ImperialInstrumentedSpec.scala | Scala | apache-2.0 | 1,494 |
/*
* Copyright 2012 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | rocwzp/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/storage/SpanStore.scala | Scala | apache-2.0 | 6,239 |
package scorex.crypto.authds
import scorex.crypto.authds.legacy.treap.Level
import scorex.crypto.hash._
trait ProofIterator {
private var i = -1
protected def initializeIterator(): Unit = i = -1
val proofSeq: Seq[TwoPartyProofElement]
protected def dequeueValue(): ADValue = {
i = i + 1
ADValue @@ p... | ScorexProject/scrypto | src/main/scala/scorex/crypto/authds/ProofIterator.scala | Scala | cc0-1.0 | 1,292 |
package com.codility.challenge._5_PrefixSums
/**
* Created by obarros on 01/11/2016.
*/
object PassingCars {
def solution(a: Array[Int]): Int = {
var countOne = 0
var result = 0
for(i <- a.length -1 to 0 by -1)
{
if(a(i) == 1)
countOne += 1
else
result += co... | Obarros/Codility | src/main/scala-2.11/com/codility/challenge/_5_PrefixSums/PassingCars.scala | Scala | mit | 404 |
package com.github.wakfudecrypt.types.data
import com.github.wakfudecrypt._
@BinaryDecoder
case class StatueIeParam(
_0_int32: Int
)
object StatueIeParam extends BinaryDataCompanion[StatueIeParam] {
override val dataId = 93
}
| jac3km4/wakfudecrypt | types/src/main/scala/com/github/wakfudecrypt/types/data/StatueIeParam.scala | Scala | mit | 233 |
package com.socrata.datacoordinator.secondary
import scala.collection.JavaConverters._
import java.lang.Runnable
import java.util.UUID
import java.util.concurrent.{CountDownLatch, Executors, ScheduledExecutorService, TimeUnit, ConcurrentHashMap}
import com.socrata.datacoordinator.id.DatasetId
import com.socrata.data... | socrata-platform/data-coordinator | secondarylib/src/main/scala/com/socrata/datacoordinator/secondary/SecondaryWatcher.scala | Scala | apache-2.0 | 29,533 |
/*
* 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/FSMDiagnosticActorLogging.scala | Scala | apache-2.0 | 1,301 |
import scala.reflect.macros.whitebox._
import scala.language.experimental.macros
class Macros(val c: Context) {
def impl = ???
}
object Macros {
def impl(c: Context) = ???
}
object Test extends App {
def foo: Unit = macro Macros.impl
} | felixmulder/scala | test/files/neg/macro-bundle-ambiguous.scala | Scala | bsd-3-clause | 244 |
/*
* 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/optimize/program/FlinkRelTimeIndicatorProgram.scala | Scala | apache-2.0 | 1,459 |
package controllers.admin
import java.io.File
import global.Global
import ingest.harvest.GazetteerImporter
import models.geo.{ Gazetteers, Gazetteer }
import play.api.db.slick._
import play.api.mvc.Controller
import play.api.Logger
import play.api.libs.Files
import play.api.libs.json.Json
import play.api.libs.concurre... | pelagios/peripleo | app/controllers/admin/GazetteerAdminController.scala | Scala | gpl-3.0 | 2,420 |
package io.getquill.context.async.mysql
import java.util.concurrent.ConcurrentLinkedQueue
import scala.jdk.CollectionConverters._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.math.BigDecimal.int2bigDecimal
import io.getquill.context.sql.QueryResultTypeSpec
class QueryResultTypeMysqlAsyncSp... | getquill/quill | quill-async-mysql/src/test/scala/io/getquill/context/async/mysql/QueryResultTypeMysqlAsyncSpec.scala | Scala | apache-2.0 | 3,215 |
def isSorted[A](as: Array[A],ls:(A,A) => Boolean): Boolean={
def check(index: Int,nextIndex: Int): Boolean={
if(nextIndex==as.length)true
else if(!ls(as(index),as(nextIndex))) false
else check(nextIndex,nextIndex+1)
}
check(0,1)
} | iUwej/functional-programming-in-scala-solutions | exer2.scala | Scala | unlicense | 248 |
/* Copyright (C) 2008-2016 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... | strubell/factorie | src/test/scala/cc/factorie/TestExamples.scala | Scala | apache-2.0 | 4,275 |
package list
import list.P09.pack
/**
* P10 (*) Run-length encoding of a list.
*/
object P10 {
def encode[A](list: List[A]): List[(Int, A)] = pack(list) map { e => (e.length, e.head) }
}
| zjt1114/scala99 | src/main/scala/list/P10.scala | Scala | apache-2.0 | 197 |
package skinny.micro.cookie
import javax.servlet.http.{ HttpServletRequest, HttpServletResponse }
import skinny.micro.implicits.ServletApiImplicits
import scala.collection.mutable
/**
* Extended cookie object.
*/
class SweetCookies(
private[this] val request: HttpServletRequest,
private[this] val response: Ht... | xerial/skinny-micro | micro/src/main/scala/skinny/micro/cookie/SweetCookies.scala | Scala | bsd-2-clause | 1,937 |
/*
* Copyright 2016 rdbc contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | rdbc-io/rdbc | rdbc-api-scala/src/main/scala/io/rdbc/sapi/exceptions/MissingColumnException.scala | Scala | apache-2.0 | 827 |
package nz.ubermouse.rsbot.actions
import com.epicbot.api.rs3.methods.interactive.Players
import com.epicbot.api.rs3.methods.{Walking, Calculations}
import com.epicbot.api.rs3.wrappers.Locatable
import nz.ubermouse.rsbot.helpers.Wait
class MoveTo(location: Locatable) extends Action {
override def run: Boolean = {
... | UberMouse/RSArchitectureTest | src/nz/ubermouse/rsbot/actions/MoveTo.scala | Scala | mit | 626 |
/**
* This file is part of mycollab-web.
*
* mycollab-web is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* mycollab-web is d... | uniteddiversity/mycollab | mycollab-web/src/main/scala/com.esofthead.mycollab.module.project.view.parameters/FileScreenData.scala | Scala | agpl-3.0 | 934 |
/*
*************************************************************************************
* Copyright 2013 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | armeniaca/rudder | rudder-web/src/main/scala/com/normation/rudder/web/components/popup/CreateOrUpdateGlobalParameterPopup.scala | Scala | gpl-3.0 | 14,182 |
package fr.inria.spirals.sigma.ttc14.fixml
import fr.inria.spirals.sigma.ttc14.fixml.objlang.support.ObjLang
import fr.inria.spirals.sigma.ttc14.fixml.objlang.support.ObjLang._objlang._
trait ObjLang2CPP extends BaseObjLangMTT {
var cppHeaderSuffix = "h"
implicit class ClassCPPUtil(that: Classifier) {
def c... | fikovnik/ttc14-fixml-sigma | ttc14-fixml-base/src/fr/inria/spirals/sigma/ttc14/fixml/ObjLang2CPP.scala | Scala | epl-1.0 | 938 |
package lila.importer
import akka.actor.ActorRef
import chess.Color
import chess.format.UciMove
import lila.game.{ Game, Player, Source, GameRepo, Pov }
import lila.hub.actorApi.map.Tell
import lila.round.actorApi.round._
import scala.concurrent.duration._
final class Live(
roundMap: ActorRef) {
def create = {... | terokinnunen/lila | modules/importer/src/main/Live.scala | Scala | mit | 1,790 |
///*
// * Copyright 2017 Datamountaineer.
// *
// * Licensed under the Apache License, Version 2.0 (the "License");
// * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// *
// * http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applica... | datamountaineer/stream-reactor | kafka-connect-hbase/src/test/scala/com/datamountaineer/streamreactor/connect/hbase/writers/HbaseWriterTest.scala | Scala | apache-2.0 | 11,511 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This... | beangle/data | transfer/src/main/scala/org/beangle/data/transfer/importer/ImportPrepare.scala | Scala | lgpl-3.0 | 916 |
package com.wavesplatform.utils
import java.net.{InetAddress, SocketTimeoutException}
import monix.eval.Task
import monix.execution.ExecutionModel
import monix.execution.schedulers.SchedulerService
import org.apache.commons.net.ntp.NTPUDPClient
import scala.concurrent.duration.DurationInt
trait Time {
def correct... | wavesplatform/Waves | node/src/main/scala/com/wavesplatform/utils/Time.scala | Scala | mit | 2,928 |
package sclack.tech
import java.awt.image.BufferedImage
import scala.collection.mutable.HashMap
import java.awt.image.BufferedImage
/**
* The tile manager is a Cache-like pattern that only loads the required
* tilesets once, and then they are loaded from a single point in memory when
* required, when painting the ... | psyomn/sclack | src/main/scala/tech/TileManager.scala | Scala | gpl-3.0 | 2,371 |
// how to thread a monad correctly
// (global name refreshment)
package creg.example
import creg._
object Fresh {
import Monad.State
import Monad.State.stateMonad
import Banana.cata
import Compos.getNameStream
private[this] // necessary to make inner type λ covariant
type State[S] = {
type λ[+A] = S... | yfcai/CREG | example/Fresh.scala | Scala | mit | 2,056 |
/*
* 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 | frontend/src/test/scala/quasar/sql/SqlParserSpec.scala | Scala | apache-2.0 | 23,286 |
package com.yammer.dropwizard.scala.params
object BooleanParam {
def apply(value: Boolean): BooleanParam = BooleanParam(value.toString)
}
/**
* Parses "true" and "false" to Boolean values.
*/
case class BooleanParam(s: String) extends AbstractParam[Boolean](s) {
protected def parse(input: String) = input.toBool... | hailcode/dropwizard-scala | src/main/scala/com/yammer/dropwizard/scala/params/BooleanParam.scala | Scala | apache-2.0 | 470 |
/**
* Copyright (C) 2010-2012 LShift Ltd.
*
* 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... | 0x6e6562/diffa | agent/src/test/scala/net/lshift/diffa/agent/itest/ChangeEventRateLimitingTest.scala | Scala | apache-2.0 | 3,234 |
package org.dsa.iot.rx.core
import org.dsa.iot.rx.RxMerger3
/**
* Combines three Observables into a single Observable of Tuple3, emitting a new tuple
* after all sources emitted the next item.
*/
class Zip3[T1, T2, T3] extends RxMerger3[T1, T2, T3, (T1, T2, T3)] {
protected def compute = source1.in zip source2.i... | IOT-DSA/dslink-scala-ignition | src/main/scala/org/dsa/iot/rx/core/Zip3.scala | Scala | apache-2.0 | 560 |
package proofpeer.proofscript.logic
private class KernelImpl(
val mk_theorem_helper : (Context, Term) => Theorem,
val mk_cterm : (Context, Term, Type) => CTerm) extends Kernel {
import Term._
import Type._
import Utils._
import KernelUtils._
private def mk_theorem(context : Context, term : Term) : ... | proofpeer/proofpeer-proofscript | shared/src/main/scala/proofpeer/proofscript/logic/KernelImpl.scala | Scala | mit | 31,244 |
/*
* tuProlog - Copyright (C) 2001-2002 aliCE team at deis.unibo.it
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any l... | zakski/project-soisceal | scala-core/src/main/scala/com/szadowsz/gospel/core/event/interpreter/PrologEvent.scala | Scala | lgpl-3.0 | 1,229 |
///////////////////////////////////////////////////////////////////////////////
// Memoizer.scala
//
// Copyright (C) 2012 Ben Wing, The University of Texas at Austin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may... | utcompling/fieldspring | src/main/scala/opennlp/fieldspring/perceptron/Memoizer.scala | Scala | apache-2.0 | 4,225 |
package org.kimbasoft.akka.actor.regular
import akka.actor.{Actor, Props}
import org.kimbasoft.akka.actor.regular.ActorSimple.Exceptions.SimpleRequestException
import org.kimbasoft.akka.actor.regular.ActorSimple.Messages.{SimpleResponse, SimpleRequest}
import scala.util.{Failure, Success, Try}
/**
* Missing documen... | kimba74/sandbox-scala | src/main/scala/org/kimbasoft/akka/actor/regular/ActorSimple.scala | Scala | gpl-3.0 | 2,092 |
package alexsmirnov.pbconsole
import java.util.HashMap
import org.apache.commons.lang3.text.StrSubstitutor
import scala.io.Source
import scalafx.beans.property.StringProperty
import javafx.util.Callback
import javafx.beans.Observable
class Macro {
val nameProperty = StringProperty("")
def name = nameProperty.get
... | alexsmirnov/printrbot-g2-console | src/main/scala/alexsmirnov/pbconsole/Macro.scala | Scala | bsd-3-clause | 1,490 |
package scutil.lang
import scutil.lang.extension._
object extensions extends extensions
trait extensions
extends AnyImplicits
with AnyRefImplicits
with AtomicReferenceImplicits
with BooleanImplicits
with ByteArrayImplicits
with CharsetImplicits
with ClassImplicits
with ExceptionCatchImplicits
with EitherImp... | ritschwumm/scutil | modules/core/src/main/scala/scutil/lang/extensions.scala | Scala | bsd-2-clause | 614 |
/*
* 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 ... | setjet/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala | Scala | apache-2.0 | 16,566 |
/***********************************************************************
* 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-process/geomesa-process-vector/src/main/scala/org/locationtech/geomesa/process/query/QueryProcess.scala | Scala | apache-2.0 | 4,724 |
package com.socrata.datacoordinator.truth.loader
import scala.{collection => sc}
import gnu.trove.map.hash.TIntObjectHashMap
import com.socrata.datacoordinator.util.TIntObjectHashMapWrapper
/** Accumulate a report from a `Loader`. These
* reports can be large; this is provided to allow
* them to be spooled to di... | socrata-platform/data-coordinator | coordinatorlib/src/main/scala/com/socrata/datacoordinator/truth/loader/ReportWriter.scala | Scala | apache-2.0 | 2,255 |
package dbservice
import play.api.Logger
import pwguard.global.Globals.ExecutionContexts.DB._
import models.User
import scala.concurrent.Future
import scala.util.Try
/** DAO for interacting with User objects.
*/
class UserDAO(_dal: DAL, _logger: Logger) extends BaseDAO[User](_dal, _logger) {
import dal.profil... | bmc/pwguard | app/dbservice/UserDAO.scala | Scala | bsd-3-clause | 3,742 |
/*
* 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 ... | hortonworks-spark/cloud-integration | cloud-examples/src/main/scala/com/cloudera/spark/cloud/operations/CloudFileGenerator.scala | Scala | apache-2.0 | 6,012 |
/**
* Copyright (c) 2015, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. licenses this file to you 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/LIC... | linearregression/spark-timeseries | src/main/scala/com/cloudera/sparkts/EasyPlot.scala | Scala | apache-2.0 | 3,910 |
package gitbucket.core.service
import java.util.Date
import gitbucket.core.model.Account
import gitbucket.core.util._
import gitbucket.core.util.ControlUtil._
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.treewalk.CanonicalTreeParser
import org.eclipse.jgit.lib._
import org.eclipse.jgit.dircache.DirCache
imp... | noc06140728/gitbucket | src/main/scala/gitbucket/core/service/WikiService.scala | Scala | apache-2.0 | 10,942 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala | Scala | apache-2.0 | 9,523 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2012-2014 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... | digimead/digi-TABuddy-desktop | part-model-definition/src/main/scala/org/digimead/tabuddy/desktop/model/definition/ui/dialog/eltemed/ColumnId.scala | Scala | agpl-3.0 | 6,342 |
package com.tritondigital.consul.http.client
class NoNodeException(service: String) extends RuntimeException {
override def getMessage = s"""No node found for service $service"""
}
| tritondigital/ConsulHttpClient | src/main/scala/com/tritondigital/consul/http/client/NoNodeException.scala | Scala | mit | 186 |
/*
* 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 ... | dbtsai/spark | sql/core/src/test/scala/org/apache/spark/sql/DataFrameJoinSuite.scala | Scala | apache-2.0 | 17,047 |
package mesosphere.marathon
import com.google.protobuf.ByteString
import scala.collection.JavaConverters._
class ContainerInfo protected (val image: String, val options: Seq[String]) {
def toProto: Protos.ContainerInfo =
Protos.ContainerInfo.newBuilder()
.setImage(ByteString.copyFromUtf8(image))
.a... | MiLk/marathon | src/main/scala/mesosphere/marathon/ContainerInfo.scala | Scala | apache-2.0 | 841 |
package org.openurp.edu.eams.teach.schedule.json
import org.openurp.edu.eams.base.model.RoomBean
import org.openurp.edu.eams.base.model.json.RoomBeanGsonAdapter
import org.openurp.edu.eams.teach.lesson.model.ArrangeSuggestBean
import org.openurp.edu.eams.teach.lesson.model.SuggestActivityBean
import com.google.gson.Gs... | openurp/edu-eams-webapp | schedule/src/main/scala/org/openurp/edu/eams/teach/schedule/json/ArrangeSuggestGsonBuilder.scala | Scala | gpl-3.0 | 711 |
package scala.slick.jdbc
import java.sql.PreparedStatement
import scala.slick.session.{PositionedParameters, PositionedResult}
/**
* Invoker for raw SQL queries.
* The companion object contains utility methods for building static queries.
*/
abstract class StaticQuery[-P,+R](query: String, rconv: GetResult[R], pco... | szeiger/scala-query | src/main/scala/scala/slick/jdbc/StaticQuery.scala | Scala | bsd-2-clause | 2,356 |
package com.tribbloids.spookystuff.parsing
import com.tribbloids.spookystuff.parsing.Pattern.Token
import com.tribbloids.spookystuff.utils.RangeArg
case class Pattern(
token: Token,
range: RangeArg = Pattern.RangeArgs.next
) {
override def toString = s"'$token' $range"
// ID is to make sure that rules c... | tribbloid/spookystuff | mldsl/src/main/scala/com/tribbloids/spookystuff/parsing/Pattern.scala | Scala | apache-2.0 | 1,699 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* See the LICENCE.txt file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | Webtrends/wookiee-cluster | src/main/scala/com/webtrends/harness/component/cluster/ClusterManager.scala | Scala | apache-2.0 | 2,261 |
package inlineconsume
import inlinedefs.FakePredef.assert
class Foo:
def test = assert(3 > 2)
| lampepfl/dotty | tests/semanticdb/expect/inlineconsume.scala | Scala | apache-2.0 | 98 |
import sbt._
object Dependencies {
object versions {
val c3p0 = "0.9.5-pre9"
val commonsCli = "1.2"
val commonsCodec = "1.5"
val commonsIo = "1.4"
val commonsLang = "2.6"
val jodaConvert = "1.2"
val jodaTime = "2.1"
val liquibaseCore = "2.0.0"
val liquibasePlugin = "1.9.5.0"
v... | socrata-platform/soql-postgres-adapter | project/Dependencies.scala | Scala | apache-2.0 | 3,200 |
package com.sksamuel.elastic4s.cats.effect
package object instances extends CatsEffectInstances
| stringbean/elastic4s | elastic4s-effect-cats/src/main/scala/com/sksamuel/elastic4s/cats/effect/instances/package.scala | Scala | apache-2.0 | 97 |
package com.truecar.mleap.serialization.ml.v1
import com.truecar.mleap.core.tree.Node
import com.truecar.mleap.runtime.transformer._
import ml.bundle.support.v1.runtime.PipelineModelSerializer
import ml.bundle.{BundleSerializer, Serializer, StreamSerializer}
import Converters._
import ml.bundle.support.ConversionSeria... | TrueCar/mleap | mleap-serialization/src/main/scala/com/truecar/mleap/serialization/ml/v1/MlJsonSerializer.scala | Scala | apache-2.0 | 5,487 |
package $package$.routes
import $package$.utils.BaseRoute
import $package$.controllers.HelloController
import unfiltered.netty._
import unfiltered.netty.request._
import unfiltered.request._
import unfiltered.response._
import unfiltered.scalate._
import unfiltered.netty.websockets.{_ => Pass}
object HelloRoute exte... | ixiongdi/wpt.g8 | src/main/g8/src/main/scala/routes/HelloRoute.scala | Scala | apache-2.0 | 1,303 |
package todomvc
import japgolly.scalajs.react._
import japgolly.scalajs.react.extra._
import japgolly.scalajs.react.extra.router.RouterCtl
import japgolly.scalajs.react.vdom.prefix_<^._
import org.scalajs.dom.ext.KeyCode
import org.scalajs.dom.html
object TodoList {
case class Props (
ctl: RouterCtl[... | gabrielmancini/interactor | src/demo/scalajs-react/src/main/scala/todomvc/TodoList.scala | Scala | bsd-2-clause | 6,674 |
package main.scala
import java.net.InetAddress
import java.net.Socket
class Requestor {
def execRemoteObject(request: Request): Any = {
var marshaller: IMarshaller = new Marshaller();
var clientRequestHandler: ClientRequestHandler = new ClientRequestHandler();
var inetAddress:InetAddress = InetAddress.ge... | labs2/FLiMSy | ServerFLiMSy/src/main/scala/Requestor.scala | Scala | apache-2.0 | 807 |
package is.hail.io.hadoop
import java.io.DataOutputStream
import org.apache.hadoop.fs._
import org.apache.hadoop.io._
import org.apache.hadoop.mapred._
import org.apache.hadoop.util.Progressable
class ByteArrayOutputFormat extends FileOutputFormat[NullWritable, BytesOnlyWritable] {
class ByteArrayRecordWriter(out... | danking/hail | hail/src/main/scala/is/hail/io/hadoop/ByteArrayOutputFormat.scala | Scala | mit | 965 |
import org.coursera.naptime.NaptimeModule
import org.coursera.naptime.ari.EngineApi
import org.coursera.naptime.ari.FetcherApi
import org.coursera.naptime.ari.LocalSchemaProvider
import org.coursera.naptime.ari.SchemaProvider
import org.coursera.naptime.ari.engine.EngineImpl
import org.coursera.naptime.ari.engine.Engin... | vkuo-coursera/naptime | examples/src/main/scala/ResourceModule.scala | Scala | apache-2.0 | 1,939 |
/*
* MkDoubleVector.scala
* (FScape)
*
* Copyright (c) 2001-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.fscape
packa... | Sciss/FScape-next | lucre/shared/src/main/scala/de/sciss/fscape/lucre/stream/MkDoubleVector.scala | Scala | agpl-3.0 | 2,431 |
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.