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.geishatokyo.sqlgen.process.save.xls
import java.io.FileOutputStream
import com.geishatokyo.sqlgen.process.{Context, OutputSupport, Proc}
/**
* Created by takezoux2 on 2017/07/05.
*/
class XLSSaveProc(dir: String) extends Proc with XLSConverter with OutputSupport{
def isXlsx = true
def extension... | geishatokyo/sql-generator | src/main/scala/com/geishatokyo/sqlgen/process/save/xls/XLSSaveProc.scala | Scala | mit | 643 |
package testfeature
import feature._
import feature.{MessengerRNA, Minus, Plus}
import org.scalatest.FunSuite
/**
* Created by prussell on 11/12/16.
*/
class MessengerRNAMiscSuite extends FunSuite {
test("Illegal orientation") {
intercept[IllegalArgumentException](MessengerRNA(chr1_1000_2000_both, 1000, 10... | pamelarussell/sgxlib | src/test/scala/testfeature/MessengerRNAMiscSuite.scala | Scala | mit | 48,149 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.scala2_10.scalatest1_9_2
import org.jetbrains.plugins.scala.testingSupport.scalatest.ScalaTestPackageTest
/**
* @author Roman.Shein
* @since 05.09.2015.
*/
class Scalatest2_10_1_9_2_PackageTest extends Scalatest2_10_1_9_2_Base with ScalaTestPackageTes... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/scalatest/scala2_10/scalatest1_9_2/Scalatest2_10_1_9_2_PackageTest.scala | Scala | apache-2.0 | 327 |
import scala.annotation.tailrec
/*
Reference: http://aperiodic.net/phil/scala/s-99
P10 (*) Run-length encoding of a list.
Use the result of problem P09 to implement the so-called run-length encoding data compression method. Consecutive duplicates of elements are encoded as tuples (N, E) where N is the number of duplic... | mcamou/s-99 | src/P10.scala | Scala | apache-2.0 | 955 |
/*
* Copyright 2008 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 la... | wsaccaco/lift | archetypes/lift-archetype-jpa-basic/src/main/resources/archetype-resources/web/src/main/scala/snippet/Books.scala | Scala | apache-2.0 | 4,527 |
/*
* 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 ... | andrewor14/iolap | core/src/main/scala/org/apache/spark/util/random/XORShiftRandom.scala | Scala | apache-2.0 | 3,709 |
package org.rbudzko.streams
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Flow, Sink, Source}
object E3_InnerFlow extends App {
/**
* Prepare materializer - this guy can create streams.
* Materializer uses actor system.
*/
implicit lazy val system = ... | rbudzko/workshops-akka | quick-streams/src/main/scala/org/rbudzko/streams/E3_InnerFlow.scala | Scala | apache-2.0 | 771 |
package scredis.protocol
import akka.util.ByteString
import scredis.exceptions._
import scredis.serialization.Reader
import scala.util.{ Try, Success, Failure }
import scala.collection.generic.CanBuildFrom
import scala.collection.mutable.ListBuffer
import java.nio.ByteBuffer
trait Response
case class ErrorRespons... | Livestream/scredis | src/main/scala/scredis/protocol/Response.scala | Scala | apache-2.0 | 5,642 |
package repository
import java.time.ZonedDateTime
import adapter.BitFlyer.MyExecution
import models.TradingRecord
import repository.model.scalatrader.TradingRecord2
import scalikejdbc.{AutoSession, _}
object RecordRepository {
val tr = TradingRecord.syntax("tr")
def insert(email: String, strategyStateId: Long, ... | rysh/scalatrader | scalatrader/app/repository/RecordRepository.scala | Scala | mit | 2,324 |
package msort
import leon._
import lang._
import annotation._
import instrumentation._
import invariant._
import mem._
import higherorder._
import stats._
/**
* Computing the kth min using a lazy merge sort algorithm that operates bottom-up.
* This allows accessing the minimum element in O(n) time, where n is the n... | regb/leon | testcases/benchmarks/alloc/BottomUpMergeSort.scala | Scala | gpl-3.0 | 8,659 |
/**
* Coleccion vacia de mensajes
*/
class TendenciaVacia extends Tendencia {
/**
* Agrega nuevo mensaje
*
* @param mensaje
* @return
*/
def +(mensaje: Tweet) = new TendenciaNoVacia(mensaje, new TendenciaVacia)
/**
* Devolver primer mensaje, al no haber, se lanza excepcion
*
*... | fblupi/grado_informatica-NTP | Practicas/P4/src/TendenciaVacia.scala | Scala | gpl-2.0 | 872 |
package com.twitter.finagle.service
import com.twitter.finagle.Filter.TypeAgnostic
import com.twitter.finagle._
import com.twitter.finagle.context.{Deadline, Contexts}
import com.twitter.finagle.client.LatencyCompensation
import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver}
import com.twitter.finagle.tr... | adriancole/finagle | finagle-core/src/main/scala/com/twitter/finagle/service/TimeoutFilter.scala | Scala | apache-2.0 | 5,462 |
package com.wlangiewicz.xbot
import java.net.SocketException
import com.codahale.metrics.MetricRegistry
import com.wlangiewicz.xbot.domain.{MyOrder, Order}
import com.wlangiewicz.xbot.exceptions._
import com.wlangiewicz.xbot.providers.ExchangeProvider
import com.wlangiewicz.xbot.util.{BotUtil, SimpleSpreadOfferRateEs... | wlk/xbot | src/main/scala/com/wlangiewicz/xbot/Bot.scala | Scala | apache-2.0 | 6,536 |
package modules
import models.{CategoryProblem, FoodProblem, RecursiveCategoryProblems}
import uk.ac.ncl.openlab.intake24.errors.LocalLookupError
trait ProblemCheckerService {
def enablePrecacheWarnings(): Unit
def disablePrecacheWarnings(): Unit
def getFoodProblems(code: String, locale: String): Either[Local... | digitalinteraction/intake24 | ApiPlayServer/app/modules/ProblemCheckerService.scala | Scala | apache-2.0 | 601 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot 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 req... | rfranco/play-silhouette | silhouette/app/com/mohiva/play/silhouette/impl/providers/oauth1/secrets/CookieSecret.scala | Scala | apache-2.0 | 6,548 |
/*
* 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-http-finagle/src/test/scala/wvlet/airframe/http/finagle/CustomCodecTest.scala | Scala | apache-2.0 | 2,087 |
/**
* Copyright 2015, deepsense.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/main/scala/io/deepsense/deeplang/params/exceptions/OutOfRangeException.scala | Scala | apache-2.0 | 885 |
package play.api.libs.ws
import java.io.File
import scala.concurrent.{Future, Promise}
import play.api.libs.iteratee._
import play.api.libs.iteratee.Input._
import play.api.http.{ Writeable, ContentTypeOf }
import com.ning.http.client.{
AsyncHttpClient,
AsyncHttpClientConfig,
RequestBuilderBase,
FluentCaseInse... | noel-yap/setter-for-catan | play-2.1.1/framework/src/play/src/main/scala/play/api/libs/ws/WS.scala | Scala | apache-2.0 | 17,063 |
package uk.gov.dvla.vehicles.presentation.common.model
import play.api.libs.json.Json
import uk.gov.dvla.vehicles.presentation.common.views.models.{AddressLinesViewModel, AddressAndPostcodeViewModel}
object VmAddressModel {
implicit val JsonFormat = Json.format[AddressModel]
def from(address: AddressAndPostcode... | dvla/vehicles-presentation-common | app/uk/gov/dvla/vehicles/presentation/common/model/VmAddressModel.scala | Scala | mit | 961 |
package be.wegenenverkeer.atomium.server
import be.wegenenverkeer.atomium.format.{Url, Link}
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FunSuite, Matchers}
import scala.collection.JavaConverters._
class AbstractFeedPageStoreTest extends FunSuite with FeedStoreTestSupport with Matchers with BeforeAnd... | kwark/atomium | modules/server/src/test/scala/be/wegenenverkeer/atomium/server/AbstractFeedPageStoreTest.scala | Scala | mit | 7,397 |
package scalan.it.lms
import scalan.common.{MetaTestsDslExp, SegmentsDslExp}
import scalan.compilation.lms.cxx.LmsCompilerCxx
import scalan.compilation.lms.scalac.LmsCompilerScala
import scalan.compilation.lms.uni.LmsCompilerUni
import scalan.primitives.{StructExamples, StructItTests}
import scalan.{JNIExtractorOpsExp... | scalan/scalan | lms-backend/core/src/it/scala/scalan/it/lms/LmsStructItTests.scala | Scala | apache-2.0 | 1,124 |
/**
* Copyright (c) 2016 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... | trustedanalytics/spark-tk | sparktk-core/src/main/scala/org/trustedanalytics/sparktk/frame/internal/ops/statistics/covariance/CovarianceMatrix.scala | Scala | apache-2.0 | 2,501 |
package spark.network
import java.nio.ByteBuffer
import scala.collection.mutable.ArrayBuffer
private[network]
class MessageChunk(val header: MessageChunkHeader, val buffer: ByteBuffer) {
val size = if (buffer == null) 0 else buffer.remaining
lazy val buffers = {
val ab = new ArrayBuffer[ByteBuffer]()
... | baeeq/incubator-spark | core/src/main/scala/spark/network/MessageChunk.scala | Scala | bsd-3-clause | 525 |
/*
* 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... | davidbernick/zipkin | zipkin-finatra/src/main/scala/com/twitter/zipkin/web/QueryRequest.scala | Scala | apache-2.0 | 3,551 |
package org.locationtech.geomesa.core.filter
import com.typesafe.scalalogging.slf4j.Logging
import org.geotools.filter.text.ecql.ECQL
import org.junit.runner.RunWith
import org.locationtech.geomesa.core.filter.TestFilters._
import org.locationtech.geomesa.core.iterators.TestData._
import org.opengis.filter._
import or... | jwkessi/geomesa | geomesa-core/src/test/scala/org/locationtech/geomesa/core/filter/FilterPackageObjectTest.scala | Scala | apache-2.0 | 4,130 |
package constraints
import java.util.regex.Pattern
import scala.util.matching.Regex
import play.api.data.validation.Constraint
import play.api.data.validation.Constraints._
import play.api.data.validation.{Invalid, Valid, ValidationError}
import helpers.Cache
class FormConstraintsBase(cache: Cache) {
def passwordM... | ruimo/store2 | app/constraints/FormConstraintsBase.scala | Scala | apache-2.0 | 1,956 |
/*
* 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/test/com/treode/store/ResidentsSpec.scala | Scala | apache-2.0 | 2,530 |
/*
* 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 ... | darionyaphet/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StreamExecution.scala | Scala | apache-2.0 | 28,359 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | big-pegasus/spark | core/src/main/scala/org/apache/spark/scheduler/TaskResultGetter.scala | Scala | apache-2.0 | 6,880 |
object Test {
def foo () {
val x = if ("abc" != "def") 1 else 0
}
}
| JetBrains/intellij-scala | scala/scala-impl/testdata/uast/IfStatement.scala | Scala | apache-2.0 | 76 |
package com.twitter.scalding
import scala.annotation.tailrec
import cascading.pipe._
import org.specs._
/*
* Zip uses side effect construct to create zipped list.
*/
class Zip(args : Args) extends Job(args) {
//import RichPipe._
def createState = new {
var lastLine: String = null
def release() {}
}
... | stripe/scalding | scalding-core/src/test/scala/com/twitter/scalding/SideEffectTest.scala | Scala | apache-2.0 | 3,195 |
package uk.co.sprily
package dh
package harvester
import java.util.concurrent.ScheduledExecutorService
import scala.concurrent.duration._
import com.github.nscala_time.time.Imports.DateTime
import com.typesafe.scalalogging.LazyLogging
import scalaz.concurrent._
import scalaz.stream._
import uk.co.sprily.dh.schedu... | sprily/datahopper | harvester/src/main/scala/handler.scala | Scala | gpl-3.0 | 2,839 |
/**
*
* HttpClientTest
* Ledger wallet
*
* Created by Pierre Pollastri on 30/06/15.
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Ledger
*
* 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 t... | LedgerHQ/ledger-wallet-android | app/src/androidTest/scala/co/ledger/wallet/core/net/HttpClientTest.scala | Scala | mit | 2,821 |
// /////////////////////////////////////////// //
// Fureteur - https://github.com/gip/fureteur //
// /////////////////////////////////////////// //
import java.io.File
import org.apache.commons.io.FileUtils
import org.json4s.ShortTypeHints
import org.json4s.jackson.Serialization
case class HTMLContent(url:String, ... | njosephef/fetcher | src/main/scala/fileio.scala | Scala | mit | 2,227 |
package testkit
import java.net.URI
import io.netty.channel.socket.SocketChannel
import io.netty.bootstrap.Bootstrap
import io.netty.channel.nio.NioEventLoopGroup
import io.netty.channel._
import io.netty.channel.socket.nio.NioSocketChannel
import io.netty.handler.codec.http.{DefaultHttpHeaders, HttpClientCodec, Http... | wsbench/wsbench | testkit/src/main/scala/run.scala | Scala | mit | 1,535 |
package com.ing.bakery.interaction.spring
import com.ing.baker.recipe.javadsl.Interaction
class OutputEvent(outputIngredient: String)
class TestInteraction(append: String) extends Interaction {
def apply(input: String): OutputEvent = {
val output = append + ":" + input
println(output)
new OutputEvent(o... | ing-bank/baker | bakery/interaction-spring/src/test/scala/com/ing/bakery/interaction/spring/TestInteraction.scala | Scala | mit | 728 |
package org.skycastle.server
/**
*
*/
trait Avatar {
/*
/**
* Do some action available to the avatar, like as moving around, controlling wielded equipment or vehicles,
* or changing settings for controlled guild.
*/
def doAction(name: Symbol, parameters: Data)
/**
* All things that are perceive... | zzorn/skycastle | src/main/scala/org/skycastle/server/Avatar.scala | Scala | gpl-2.0 | 544 |
package ch.thmx.arpibot.tests
import org.scalatest._
import javax.jws.{WebMethod, WebService}
import javax.xml.ws.Endpoint
import javax.xml.ws.Service
@WebService
trait SoapTrait {
@WebMethod
def test(value: String): String
}
@WebService(endpointInterface = "ch.thmx.arpibot.tests.SoapTrait")
private class Minim... | ThmX/ARPi-Bot | RasPi/src/test/scala/ch/thmx/arpibot/tests/WebServiceTest.scala | Scala | mit | 1,004 |
package org.jetbrains.plugins.scala
package codeInspection
package collections
import com.intellij.codeInspection.ProblemsHolder
import com.intellij.psi.PsiElement
import scala.collection.immutable.ArraySeq
/**
* @author Nikolay.Tropin
*/
class SideEffectsInMonadicTransformationInspection extends OperationOnCollec... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/codeInspection/collections/SideEffectsInMonadicTransformationInspection.scala | Scala | apache-2.0 | 758 |
package oil
import _root_.views.html.b3.B3FieldConstructor
import play.api.i18n.Lang
import play.twirl.api.Html
trait Field[T] {
def constraints: Seq[Constraint[T]]
def data: Option[String]
def formatter: Formatter[T]
def inputProvider: InputProvider[T]
def hasErrors: Boolean
/**
* Returns the list of... | Lasering/Oil | project-code/app/oil/Fields.scala | Scala | apache-2.0 | 5,757 |
package com.atomist.rug.kind.properties
import com.atomist.graph.GraphNode
import com.atomist.rug.kind.core.{DirectoryMutableView, FileMutableView, ProjectMutableView}
import com.atomist.rug.spi.{MutableView, ReflectivelyTypedType, Type}
class PropertiesType
extends Type
with ReflectivelyTypedType {
override... | atomist/rug | src/main/scala/com/atomist/rug/kind/properties/PropertiesType.scala | Scala | gpl-3.0 | 1,162 |
/**
* 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
* dist... | DigitalAssetCom/hlp-candidate | server/network/src/main/scala/org/hyperledger/network/flows/AsyncStatefulStage.scala | Scala | apache-2.0 | 2,741 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | psyyz10/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/MV.scala | Scala | apache-2.0 | 4,898 |
package org.aprsdroid.app
import _root_.android.content.Context
import _root_.android.location.{Location, LocationManager}
import _root_.android.media.AudioManager
import _root_.android.preference.PreferenceManager
class PrefsWrapper(val context : Context) {
val prefs = PreferenceManager.getDefaultSharedPreferences(... | ge0rg/aprsdroid | src/PrefsWrapper.scala | Scala | gpl-2.0 | 4,240 |
import sbt._, Keys._
object CleanShadedPlugin extends AutoPlugin {
override def requires = plugins.IvyPlugin
override def trigger = allRequirements
object autoImport {
val cleanCacheIvyDirectory: SettingKey[File] = settingKey[File]("")
val cleanCache: InputKey[Unit] = inputKey[Unit]("")
... | envisia/sbt-closure | project/CleanShadedPlugin.scala | Scala | mit | 2,267 |
package nagoyaka
import scalaz.syntax.std.string._
import org.scalacheck.Properties
import org.scalacheck.Gen
import org.scalacheck.Prop.forAll
object FizzBuzzSpec extends Properties("FizzBuzz") {
val inverseInput = Gen.oneOf(
Array("fizz"),
Array("buzz" ),
Array("fizz", "buzz"),
Ar... | pocketberserker/nagoyaka-java-test | src/test/scala/nagoyaka/FizzBuzzSpec.scala | Scala | mit | 714 |
/*
* 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-http/src/main/scala/io/gatling/http/action/ws/fsm/WsClosedState.scala | Scala | apache-2.0 | 775 |
package fr.univ_lille.cristal.emeraude.chasqui.tests
import akka.testkit.TestActorRef
import fr.univ_lille.cristal.emeraude.chasqui.core.NodeImpl
import fr.univ_lille.cristal.emeraude.chasqui.core.synchronization.GlobalSynchronizerWithLocalQueueSingletonActor
import fr.univ_lille.cristal.emeraude.chasqui.core.synchron... | guillep/chasqui | src/test/scala/fr/univ_lille/cristal/emeraude/chasqui/tests/GlobalSynchronizerWithLocalQueueSpec.scala | Scala | mit | 740 |
package rds
import com.amazonaws.auth.{InstanceProfileCredentialsProvider, EnvironmentVariableCredentialsProvider}
import com.amazonaws.services.rds.AmazonRDSClient
import com.amazonaws.services.rds.model._
import play.api.{Play, Logger}
import scala.collection.JavaConverters._
import play.api.Play.current
import sca... | Enalmada/play-rds | module/app/rds/StagingHelper.scala | Scala | apache-2.0 | 6,360 |
package com.tpl.lib.gui
trait ObjectDumping {
protected def dump[T](t: T)(implicit mt: Manifest[T] = null) = "%s: %s".format(t,if (mt == null) "<?>" else mt.toString)
}
| piotrb/hamcraft | src/main/scala/com/tpl/lib/gui/ObjectDumping.scala | Scala | bsd-2-clause | 172 |
// Copyright (c) 2013-2020 Rob Norris and Contributors
// This software is licensed under the MIT License (MIT).
// For more information see LICENSE or https://opensource.org/licenses/MIT
package example
import java.io.File
import cats.effect.{ IO, IOApp }
import cats.effect.syntax.monadCancel._
import cats.syntax.a... | tpolecat/doobie | modules/example/src/main/scala/example/FreeUsage.scala | Scala | mit | 2,085 |
package com.eevolution.context.dictionary.infrastructure.service.impl
import java.util.UUID
import com.eevolution.context.dictionary.infrastructure.repository.SequenceAuditRepository
import com.eevolution.context.dictionary.infrastructure.service.SequenceAuditService
import com.lightbend.lagom.scaladsl.api.ServiceCal... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/service/impl/SequenceAuditServiceImpl.scala | Scala | gpl-3.0 | 2,082 |
/*
* Copyright 2014-2020 Rik van der Kleij
*
* 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... | rikvdkleij/intellij-haskell | src/main/scala/intellij/haskell/psi/HaskellQualifiedNameElement.scala | Scala | apache-2.0 | 815 |
package com.airbnb.scheduler.jobs
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import org.joda.time.{Period, Minutes}
import com.airbnb.utils.JobDeserializer
/**
* BaseJob encapsulates job specific information. BaseJob is defined for all tasks ... | doronin/chronos | src/main/scala/com/airbnb/scheduler/jobs/Jobs.scala | Scala | apache-2.0 | 5,307 |
package io.continuum.bokeh
case class Selected0d(indices: List[Int] = Nil, glyph: Option[Glyph[_, _]] = None)
case class Selected1d(indices: List[Int] = Nil)
case class Selected2d(indices: List[List[Int]] = Nil)
case class Selected(`0d`: Selected0d = Selected0d(),
`1d`: Selected1d = Selected1d(),
... | bokeh/bokeh-scala | bokeh/src/main/scala/models/Sources.scala | Scala | mit | 2,591 |
package com.monsanto.stats.tables.clustering
/*
* The alpha value determines a tradeoff between having more clusters and having clusters that are more
* homogenous. Alphas is used in the formula that computes the probability of placing an extracted
* TopicVector into a brand new cluster.
*
* The beta is used to a... | MonsantoCo/chinese-restaurant-process | src/main/scala/com/monsanto/stats/tables/clustering/ModelParams.scala | Scala | bsd-3-clause | 775 |
package edu.illinois.wala.classLoader
import edu.illinois.wala.Facade._
trait Wrapper {
implicit def wrapC(c: C) = new RichC(c)
implicit def wrapM(m: M) = new RichM(m)
implicit def wrapF(f: F) = new RichF(f)
implicit def unwrapPC(pc: ProgramCounter) = pc.getProgramCounter()
} | cos/WALAFacade | src/main/scala/edu/illinois/wala/classLoader/Wrapper.scala | Scala | epl-1.0 | 287 |
package com.harborx.api
import com.harborx.api.modules.CoreModule
import play.api.{Configuration, Environment}
trait SimpleEnvConfigProvider {
this: CoreModule =>
// dependence
override def configuration: Configuration = Configuration.load(environment)
override def environment: Environment = Environment.sim... | harborx/play-di-example | play-macwire/test/com/harborx/api/SimpleEnvConfigProvider.scala | Scala | mit | 328 |
package com.blinkbox.books.agora.catalogue.book
import com.blinkbox.books.agora.catalogue.app.LinkHelper
import scala.concurrent.Future
import com.blinkbox.books.spray.v1.{Link => V1Link, Image => V1Image, ListPage, pageLink2Link}
import com.blinkbox.books.logging.DiagnosticExecutionContext
import scala.concurrent.Exe... | blinkboxbooks/catalogue-v2.scala | catalogue2-service-public/src/main/scala/com/blinkbox/books/agora/catalogue/book/BookService.scala | Scala | mit | 6,643 |
/**
* Copyright (c) 2012 Petr Kozelek <petr.kozelek@gmail.com>
*
* The full copyright and license information is presented
* in the file LICENSE that was distributed with this source code.
*/
package mql
object Todo {
def apply(): Nothing = apply("")
def apply(message: String): Nothing = throw new Unsupporte... | footcha/MQL | src/main/scala/mql/Todo.scala | Scala | bsd-3-clause | 378 |
package pl.combosolutions.backup.psm.repositories
import pl.combosolutions.backup.{ Cleaner, Async }
import pl.combosolutions.backup.psm.ImplementationPriority._
import pl.combosolutions.backup.psm.ImplementationResolver
import pl.combosolutions.backup.psm.PsmExceptionMessages.NoRepositoriesAvailable
import pl.comboso... | MateuszKubuszok/BackupDSL | modules/psm/src/main/scala/pl/combosolutions/backup/psm/repositories/RepositoriesService.scala | Scala | mit | 2,366 |
/*
* Copyright 2017 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 | it/connectors/AddressLookupConnectorISpec.scala | Scala | apache-2.0 | 3,556 |
package V2
/**
* First-class interpreter with algebraic data types support.
*/
object DRCFAEInterp extends App {
sealed abstract class DRCFAE
case class Num(n: Int) extends DRCFAE
case class Add(lhs: DRCFAE, rhs: DRCFAE) extends DRCFAE
case class Sub(lhs: DRCFAE, rhs: DRCFAE) extends DRCFAE
case class Mul... | Tooa/interpreters | src/V2/DRCFAEInterp.scala | Scala | apache-2.0 | 4,437 |
package eva4s
package util
import language.higherKinds
import scala.collection.Seq
trait Sorter[M[_]] {
def sortWith[A](xs: M[A])(lt: (A,A) => Boolean): M[A] = sort(xs)(Ordering fromLessThan lt)
def sortBy[A,B:Ordering](xs: M[A])(f: A => B): M[A] = sort(xs)(implicitly[Ordering[B]] on f)
def sort[A:Ordering](xs... | wookietreiber/eva4s-old | core/main/scala/util/Sorter.scala | Scala | gpl-3.0 | 582 |
package gui
import scalafx.collections.ObservableBuffer
/**
* Created by alex on 13/05/15.
*/
trait TitlesModel[TITLE <: Title] {
val titlesModel = ObservableBuffer[TITLE]()
}
| unclealex72/ripper | src/main/scala/gui/TitlesModel.scala | Scala | mit | 184 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/optim/Evaluator.scala | Scala | apache-2.0 | 3,891 |
package com.wavesplatform.matcher.integration
import com.wavesplatform.matcher.api.CancelOrderRequest
import com.wavesplatform.settings.Constants
import org.scalatest.concurrent.Eventually
import org.scalatest.time.SpanSugar._
import org.scalatest.{FunSuite, Matchers}
import play.api.libs.json.{JsArray, JsValue, Json}... | B83YPoj/Waves | src/test/scala/com/wavesplatform/matcher/integration/MatcherAPISpecification.scala | Scala | apache-2.0 | 10,200 |
package org.firedancer3d.math
import Math._
case class Ray(origin: Vec3 = Vec3.zero, direction: Vec3 = Vec3.unitZ) {
def distanceSquared(point: Vec3) = {
val p1 = point - origin
val t0 = direction dot p1
val p2 = direction * t0 + origin
val p3 = point - p2
p3.lengthSquared
}
de... | cyberthinkers/FireDancer3D | firedancer3d_shared/src/main/scala/org/firedancer3d/scenegraph/geometry/Ray.scala | Scala | mit | 382 |
package com.gateway.server
import org.vertx.java.core.json.{JsonArray, JsonObject}
import java.lang.StringBuilder
object QMongo {
def createUserQuery(passwordHash: String, email: String): JsonObject = {
new JsonObject().putString("collection", "users")
.putString("action", "find")
.putObject("match... | xgrommx/splanet | src/main/java/com/gateway/server/QMongo.scala | Scala | apache-2.0 | 1,820 |
package utils
import base.TestBaseDefinition
import org.scalatest.WordSpec
import utils.PreferenceSort._
import scala.util.Random
class PreferenceSortSpec extends WordSpec with TestBaseDefinition {
val l = Vector(
prefs(1, 4),
prefs(2, 4, 5),
prefs(3),
prefs(4, 1, 2),
prefs(5),
prefs(6, 7)... | THK-ADV/lwm-reloaded | test/utils/PreferenceSortSpec.scala | Scala | mit | 2,250 |
// code-examples/AppDesign/options-nulls/option-for-comp-v1-script.scala
case class User(userName: String, name: String, email: String, bio: String)
val newUserProfiles = List(
Map("userName" -> "twitspam", "name" -> "Twit Spam"),
Map("userName" -> "bucktrends", "name" -> "Buck Trends",
"email" -> "thebuck@... | XClouded/t4f-core | scala/src/tmp/AppDesign/options-nulls/option-for-comp-v1-script.scala | Scala | apache-2.0 | 1,136 |
import scala.annotation.tailrec
sealed trait Bowling {
def roll(pins: Int): Bowling
def score(): Either[Error, Int]
}
object Bowling {
def apply(): Bowling = new BowlingImpl(List.empty)
private class BowlingImpl(rolls: List[Int]) extends Bowling {
override def roll(pins: Int): Bowling = new BowlingImpl(... | exercism/xscala | exercises/practice/bowling/Example.scala | Scala | mit | 3,306 |
package com.eharmony.aloha.util
import org.junit.Assert._
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.BlockJUnit4ClassRunner
@RunWith(classOf[BlockJUnit4ClassRunner])
class SubSeqIteratorTest {
@Test def test1(): Unit = {
val v = SubSeqIterator(1 to 4, 2).toVector
... | eHarmony/aloha | aloha-core/src/test/scala/com/eharmony/aloha/util/SubSeqIteratorTest.scala | Scala | mit | 473 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.lang._
import leon.lang.xlang._
object Epsilon1 {
def rand2(x: Int): Int = epsilon((y: Int) => true)
//this should not hold
def property2(x: Int): Boolean = {
rand2(x) == rand2(x+1)
}.holds
}
| regb/leon | src/test/resources/regression/verification/xlang/invalid/Epsilon1.scala | Scala | gpl-3.0 | 263 |
/*
* 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/expressions/udaf.scala | Scala | apache-2.0 | 5,321 |
/**
* Copyright 2014 Idio
*
* 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... | idio/spotlight-model-editor | src/main/scala/org/idio/dbpedia/spotlight/stores/CustomSurfaceFormStore.scala | Scala | apache-2.0 | 7,469 |
/*
* Copyright (c) 2014-2018 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... | ddworak/monix | monix-execution/js/src/main/scala/monix/execution/atomic/AtomicChar.scala | Scala | apache-2.0 | 5,086 |
/*
* 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 ... | sureshthalamati/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala | Scala | apache-2.0 | 77,194 |
// timber -- Copyright 2012-2021 -- Justin Patterson
//
// 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... | scalawag/timber | timber-backend/src/main/scala/org/scalawag/timber/backend/dispatcher/configuration/dsl/tagged.scala | Scala | apache-2.0 | 1,074 |
/**
*
*/
package ru.kfu.itis.issst.corpus
import java.io.File
import org.apache.commons.lang3.builder.ToStringBuilder
import org.apache.commons.lang3.builder.ToStringStyle
/**
* @author Rinat Gareev (Kazan Federal University)
*
*/
class AnnoDoc(val id: String, val annotatedBy: String,
val txtFile: File, val an... | rgareev/corpus-utils | corpus-utils-scala/src/main/scala/ru/kfu/itis/issst/corpus/AnnoDoc.scala | Scala | mit | 573 |
package at.logic.gapt.expr
import at.logic.gapt.proofs.Sequent
import at.logic.gapt.utils.Not
trait Replaceable[-I, +O] {
def replace( obj: I, p: PartialFunction[Expr, Expr] ): O
def names( obj: I ): Set[VarOrConst]
}
trait ClosedUnderReplacement[T] extends Replaceable[T, T]
object Replaceable {
private obj... | gebner/gapt | core/src/main/scala/at/logic/gapt/expr/TermReplacement.scala | Scala | gpl-3.0 | 6,831 |
package models
import java.util.Date
import anorm.SqlParser._
import anorm._
/**
* Created by anand on 18/8/15.
*/
trait DAOParsers {
// -- Parsers
/**
* Parse an User from a ResultSet
*/
val user = {
get[Long]("users.id") ~
get[String]("users.name") ~
get[String]("users.designation")... | anand-singh/csr-hotel-system | app/models/DAOParsers.scala | Scala | apache-2.0 | 1,940 |
package com.olegych.scastie.client
import com.olegych.scastie.api._
import play.api.libs.json._
object SnippetState {
implicit val formatSnippetState: OFormat[SnippetState] =
Json.format[SnippetState]
}
case class SnippetState(
snippetId: Option[SnippetId],
loadSnippet: Boolean,
scalaJsContent: Opt... | scalacenter/scastie | client/src/main/scala/com.olegych.scastie.client/ScastieState.scala | Scala | apache-2.0 | 14,447 |
/**
* Created by Andrea Collamati <andrea@getjenny.com> on 07/12/2019.
*/
package com.getjenny.starchat.analyzer.atoms
import com.getjenny.analyzer.atoms.{AbstractAtomic, ExceptionAtomic}
import com.getjenny.analyzer.entities.{AnalyzersDataInternal, Result}
import com.getjenny.analyzer.util.ComparisonOperators
imp... | GetJenny/starchat | src/main/scala/com/getjenny/starchat/analyzer/atoms/CheckDateAtomic.scala | Scala | gpl-2.0 | 3,062 |
package cilib
trait NumericTo[@specialized A] {
def fromDouble(a: Double): A
}
object NumericTo {
@inline def apply[A](implicit N: NumericTo[A]) = N
implicit val NumericToDouble: NumericTo[Double] =
new NumericTo[Double] {
def fromDouble(a: Double): Double = a
}
}
| cirg-up/cilib | core/src/main/scala/cilib/NumericTo.scala | Scala | apache-2.0 | 288 |
/*
* 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 ... | bravo-zhang/spark | repl/scala-2.12/src/main/scala/org/apache/spark/repl/SparkILoop.scala | Scala | apache-2.0 | 4,790 |
package io.buoyant.router.http
import com.twitter.finagle.Service
import com.twitter.finagle.http.Fields.Via
import com.twitter.finagle.http.{HeaderMap, Request, Response, Status}
import com.twitter.util.Future
import io.buoyant.test.{Awaits, FunSuite}
class MaxCallDepthFilterTest extends FunSuite with Awaits {
i... | linkerd/linkerd | router/base-http/src/test/scala/io/buoyant/router/http/MaxCallDepthFilterTest.scala | Scala | apache-2.0 | 1,958 |
/*
* Copyright (C) 2014 Romain Reuillon
*
* 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.
*
* This progra... | ISCPIF/PSEExperiments | simpuzzle-src/models/indus/model/src/main/scala/fr/geocites/indus/Indus.scala | Scala | agpl-3.0 | 2,665 |
package io.github.datamoth.dm.api
package oozie
import java.io.File
case class Project(
meta: io.github.datamoth.dm.api.Project
, coordinators : List[Coordinator]
, databundles : List[Databundle]
, workflows : List[Workflow]
, datasets : List[Dataset]
, plugins : List[Plugin]
, errors : List[Error]
, war... | datamoth/datamoth | datamot/src/main/scala/io/github/datamoth/dm/api/oozie/Project.scala | Scala | apache-2.0 | 718 |
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
//
// In jurisdictions ... | pasviegas/shoushiling | core/src/test/scala/com/pasviegas/shoushiling/core/engine/GameOutcomeTest.scala | Scala | unlicense | 1,801 |
/*
* 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... | darroyocazorla/crossdata | streaming/src/main/scala/com/stratio/crossdata/streaming/kafka/KafkaInput.scala | Scala | apache-2.0 | 2,358 |
package scan
import java.io.FileNotFoundException
import java.io.IOException
import java.nio.file._
import cats._
import cats.data._
import cats.implicits._
import org.atnos.eff._
import org.atnos.eff.all._
import org.atnos.eff.syntax.all._
import org.atnos.eff.addon.monix._
import org.atnos.eff.addon.monix.task._
im... | benhutchison/GettingWorkDoneWithExtensibleEffects | solutions/exerciseState/src/test/scala/scan/ScannerSpec.scala | Scala | apache-2.0 | 2,224 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/test/scala/cogx/runtime/checkpoint/SimpleUnpipelinedTestColorSensor.scala | Scala | apache-2.0 | 2,722 |
/*
* 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 ... | mdespriee/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala | Scala | apache-2.0 | 30,683 |
package com.catinthedark.yoba
import com.catinthedark.yoba.entity.Creatures
import com.catinthedark.yoba.entity.Creatures.Creature
import scala.collection.mutable
/**
* Created by over on 18.04.15.
*/
class Shared(var lvlTime: Float,
var lvlDistance: Float,
var lvl: Int,
var ... | cat-in-the-dark/old48_33_game | src/main/scala/com/catinthedark/yoba/Shared.scala | Scala | mit | 2,097 |
package almond.protocol
import com.github.plokhotnyuk.jsoniter_scala.core.JsonValueCodec
import com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker
// See http://jupyter-client.readthedocs.io/en/5.2.3/kernels.html#kernel-specs
final case class KernelSpec(
argv: List[String],
display_name: String,
langu... | alexarchambault/jupyter-scala | modules/shared/protocol/src/main/scala/almond/protocol/KernelSpec.scala | Scala | apache-2.0 | 549 |
package de.unihamburg.vsis.sddf.indexing.blocking
import org.apache.spark.mllib.rdd.RDDFunctions.fromRDD
import org.apache.spark.rdd.RDD
import org.apache.spark.rdd.RDD.rddToOrderedRDDFunctions
import de.unihamburg.vsis.sddf.Parameterized
import de.unihamburg.vsis.sddf.indexing.blocking.keygeneration.BlockingKeyBuild... | numbnut/sddf | src/main/scala/de/unihamburg/vsis/sddf/indexing/blocking/PipeBlockerSortedNeighborhood.scala | Scala | gpl-3.0 | 1,399 |
package mesosphere.marathon.core.appinfo
import mesosphere.marathon.core.appinfo.impl.TaskForStatistics
import mesosphere.marathon.core.task.Task
import mesosphere.marathon.core.health.Health
import mesosphere.marathon.state.AppDefinition.VersionInfo
import mesosphere.marathon.state.AppDefinition.VersionInfo.FullVersi... | timcharper/marathon | src/main/scala/mesosphere/marathon/core/appinfo/TaskStatsByVersion.scala | Scala | apache-2.0 | 2,383 |
package com.twitter.finagle.mux
import com.twitter.finagle.tracing.{SpanId, TraceId, Flags}
import com.twitter.finagle.{Dtab, Dentry, NameTree, Path}
import com.twitter.io.Charsets
import com.twitter.util.{Duration, Time}
import org.jboss.netty.buffer.{ChannelBuffer, ChannelBuffers}
/**
* Indicates that encoding or ... | yancl/finagle-6.22.0 | finagle-mux/src/main/scala/com/twitter/finagle/mux/Proto.scala | Scala | apache-2.0 | 14,937 |
package models.services
import com.mohiva.play.silhouette.api.LoginInfo
import com.mohiva.play.silhouette.api.services.IdentityService
import models.User
import scala.concurrent.Future
/**
* Handles actions to users.
*/
trait UserService extends IdentityService[User] {
/**
* Saves a user.
*
* @param us... | BBK-SDP-2015-jtomli03/Morphidose2 | app/models/services/UserService.scala | Scala | apache-2.0 | 671 |
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.