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 io.circe.jackson
import cats.instances.AllInstances
import cats.syntax.{ AllSyntax, EitherOps }
import io.circe.Json
import io.circe.testing.{ ArbitraryInstances, EqInstances }
import munit.ScalaCheckSuite
import scala.language.implicitConversions
/**
* An opinionated stack of traits to improve consistency a... | circe/circe-jackson | shared/src/test/scala/io/circe/jackson/CirceSuite.scala | Scala | apache-2.0 | 1,511 |
import sbt._
object GenHooks {
def apply(srcRootDir: File): Unit = {
val dir = srcRootDir / "japgolly/scalajs/react/hooks"
println()
println("Generating hooks boilerplate in: " + dir.getAbsolutePath)
val hookCtxCtorsI = List.newBuilder[String]
val hookCtxCtorsP = List.newBuilder[String]
... | japgolly/scalajs-react | project/GenHooks.scala | Scala | apache-2.0 | 14,159 |
/* 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/main/scala/cc/factorie/app/nlp/ner/NerLexiconFeatures.scala | Scala | apache-2.0 | 1,006 |
package me.yingrui.segment.neural
import org.junit.{Assert, Test}
import me.yingrui.segment.Assertion._
import me.yingrui.segment.math.Matrix
class NeuralNetworkTest {
@Test
def should_add_layer {
val network = NeuralNetwork()
Assert.assertEquals(0, network.layers.length)
network.add(SigmoidLayer(Ma... | yingrui/mahjong | lib-segment/src/test/scala/me/yingrui/segment/neural/NeuralNetworkTest.scala | Scala | gpl-3.0 | 2,526 |
package com.sksamuel.elastic4s.analyzers
import com.sksamuel.elastic4s.anaylzers.TokenizerDsl
import org.scalatest.{Matchers, WordSpec}
class EdgeNGramTokenizerTest extends WordSpec with TokenizerDsl with Matchers {
"EdgeNGramTokenizer builder" should {
"set min and max ngrams" in {
edgeNGramTokenizer("t... | tototoshi/elastic4s | elastic4s-core-tests/src/test/scala/com/sksamuel/elastic4s/analyzers/EdgeNGramTokenizerTest.scala | Scala | apache-2.0 | 806 |
object L extends Enumeration {
val One, Two, Three = Value
}
class Foo {
def foo(xs: List[L.Value]) {
import scala.util.control.Breaks.{break, breakable}
println("START for " + xs)
breakable {
for (x <- xs) {
x match {
case L.One => println("ONE"); return
case L.Two =>... | felixmulder/scala | test/files/run/t5612.scala | Scala | bsd-3-clause | 575 |
/*
* Copyright (c) 2014-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | snowplow/schema-ddl | modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/properties/StringProperty.scala | Scala | apache-2.0 | 3,486 |
/*
* 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 ... | BryanCutler/spark | sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamReader.scala | Scala | apache-2.0 | 29,448 |
/*
* Copyright (C) 2007-2008 Artima, Inc. 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 License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | peachyy/scalastu | equality/Points4.scala | Scala | apache-2.0 | 1,210 |
package spire
package std
import spire.algebra.{MetricSpace, Monoid, Order}
@SerialVersionUID(0L)
class StringMonoid extends Monoid[String] with Serializable {
def empty: String = ""
def combine(x: String, y: String): String = x + y
override def combineAll(xs: TraversableOnce[String]): String = {
val sb = ... | non/spire | core/src/main/scala/spire/std/string.scala | Scala | mit | 1,702 |
package io.ddf.flink.content
import io.ddf.DDF
import io.ddf.content.{Representation, ConvertFunction}
import io.ddf.exception.DDFException
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.api.scala.DataSet
import org.apache.flink.ml.common.LabeledVector
import org.apache.flink.ml.ma... | ddf-project/ddf-flink | flink/src/main/scala/io/ddf/flink/content/ArrayDouble2LabeledVector.scala | Scala | apache-2.0 | 1,102 |
package nexus
import _root_.nexus.instances._
/**
* @author Tongfei Chen
*/
object GradTest extends App {
case class R2(a: Float, b: Float)
val R2grad = Grad[R2]
val bp = 0
}
| ctongfei/nexus | tensor/src/test/scala/nexus/GradTest.scala | Scala | mit | 189 |
package models
import play.api.db._
import play.api.Play.current
import anorm._
import anorm.SqlParser._
import java.math.BigDecimal
case class MMedicalPractice(
mMedicalPracticecolId: Pk[Long] = NotAssigned,
masterCategory: String,
practiceCode: Int,
practiceType :String,
practiceNum : I... | shigeshige/tools | projects/dental/app/models/MMedicalPractice.scala | Scala | agpl-3.0 | 2,089 |
package com.wbillingsley.handy.playoauth.controllers
import play.api.mvc.{Controller, Action}
import play.api.libs.ws.WS
import play.api.Play
import play.api.Play.current
import com.wbillingsley.handy.{Ref, RefFuture, Refused}
import com.wbillingsley.handy.playoauth._
import com.wbillingsley.handy.Ref._
import play.Log... | wbillingsley/handy-play-oauth | app/com/wbillingsley/handy/playoauth/controllers/GitHubController.scala | Scala | mit | 4,484 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | common/src/main/scala/com/precog/common/security/APIKey.scala | Scala | agpl-3.0 | 2,729 |
package tholowka.diz.marshalling.terms
private [terms] object ListParser {}
private [terms] case class ListParser {
def consume(input : List[Any]) : String = {
var result = ""
input.foreach(entry => {
if (result != "")
result = result + "," + delegate(entry)
... | tholowka/diz | src/main/scala/tholowka/diz/marshalling/terms/ListParser.scala | Scala | mit | 420 |
/*
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | danielcsant/sparta | sdk/src/test/scala/com/stratio/sparta/sdk/DimensionValueTest.scala | Scala | apache-2.0 | 1,304 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScan.scala | Scala | apache-2.0 | 6,180 |
package com.nthportal.euler.h0
import com.nthportal.euler.h0.t1._
import org.junit.Test
import org.scalatest.junit.JUnitSuite
class P01xTests extends JUnitSuite {
@Test
def problem10Test(): Unit = assert(Problem10() == 142913828922L)
@Test
def problem11Test(): Unit = assert(Problem11() == 70600674)
@Test
... | NthPortal/euler-n-scala | src/test/scala/com/nthportal/euler/h0/P01xTests.scala | Scala | mit | 871 |
/* This file is part of scalambda.
*
* See the NOTICE file distributed with this work for copyright information.
*
* 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/lice... | satabin/scalambda | src/gnieh/lambda/strategy/CallByNameStrategy.scala | Scala | apache-2.0 | 1,512 |
package eggman89
import org.apache.log4j.{Level, Logger}
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.sql.SQLContext
import org.apache.spark.{SparkConf, SparkContext}
/**
* Created by sneha on 12/17/2015.
*/
object CrossValidationTest {
def main(Args: Array[String]) {
/*spark stuff*... | eggman89/PredictIncomeBasedOnCensusData | src/main/scala-2.10/eggman89/CrossValidationTest.scala | Scala | gpl-2.0 | 4,125 |
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.event
import java.util.concurrent.atomic.AtomicReference
import scala.annotation.tailrec
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.AddressTerminated
import akka.actor.ExtendedActorSystem
import ak... | rorygraves/perf_tester | corpus/akka/akka-actor/src/main/scala/akka/event/AddressTerminatedTopic.scala | Scala | apache-2.0 | 1,734 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package scalapb.perf.protos
@SerialVersionUID(0L)
final case class Enum(
color: scalapb.perf.protos.Color = scalapb.perf.protos.Color.UNKNOWN,
unknownFields: _root_.scalapb.UnknownFieldSet = _root... | scalapb/ScalaPB | docs/src/main/scala/generated/scalapb/perf/protos/Enum.scala | Scala | apache-2.0 | 5,825 |
package godiva.slick
import slick.jdbc.JdbcProfile
import scala.concurrent.ExecutionContext
import scala.language.higherKinds
/**
* Provides the JDBC driver implementation
*/
trait DriverComponent[+T <: JdbcProfile] {
val driver: T
}
trait DatabaseComponent[+T <: JdbcProfile] {
val database: T#API#Database
}
... | ragb/godiva-scala | slick/src/main/scala/godiva/slick/slick.scala | Scala | apache-2.0 | 1,635 |
/*
* 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 to in writ... | kthguru/zipkin | zipkin-hadoop/src/main/scala/com/twitter/zipkin/hadoop/ExpensiveEndpoints.scala | Scala | apache-2.0 | 3,118 |
import java.util.UUID
import akka.actor.ActorSystem
import akka.testkit.{ImplicitSender, TestActors, TestKit}
import com.roundeights.hasher.Hash
import moshpit.{VClock, actors}
import moshpit.actors.{AppDb, AppDbProxy, InstanceMetaInfo}
import org.joda.time.{DateTime, DateTimeZone}
import org.scalatest.concurrent.{Eve... | dehun/moshpit | src/test/scala/AppDbSpec.scala | Scala | mit | 15,303 |
/*
* Copyright (C) 2016 Nikos Katzouris
*
* 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
* (at your option) any later version.
*
* This program is d... | nkatzz/OLED | src/main/scala/oled/mwua/Worker.scala | Scala | gpl-3.0 | 1,454 |
package org.jetbrains.plugins.scala.codeInsight.template.impl
import com.intellij.codeInsight.template.impl.TemplatePreprocessor
import com.intellij.openapi.editor.Editor
import com.intellij.psi.impl.source.tree.LeafPsiElement
import com.intellij.psi.PsiFile
import org.jetbrains.plugins.scala.extensions.PsiElementExt
... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/codeInsight/template/impl/ScalaTemplatePreprocessor.scala | Scala | apache-2.0 | 1,523 |
/***********************************************************************
* 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 ... | mdzimmerman/geomesa | geomesa-security/src/main/scala/org/locationtech/geomesa/security/package.scala | Scala | apache-2.0 | 4,711 |
package beam.agentsim.agents.choice.mode
import beam.agentsim.agents.modalbehaviors.ModeChoiceCalculator
import beam.router.Modes
import beam.router.Modes.BeamMode.CAR
import beam.router.model.EmbodiedBeamTrip
import beam.sim.BeamServices
import beam.sim.config.BeamConfig
import beam.sim.population.AttributesOfIndivid... | colinsheppard/beam | src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceDriveIfAvailable.scala | Scala | gpl-3.0 | 1,650 |
package io.prediction.controller
import io.prediction.workflow.PersistentModelManifest
import io.prediction.workflow.SharedSparkContext
import io.prediction.workflow.StopAfterPrepareInterruption
import io.prediction.workflow.StopAfterReadInterruption
import grizzled.slf4j.Logger
import io.prediction.workflow.Workflow... | wangmiao1981/PredictionIO | core/src/test/scala/io/prediction/controller/EngineTest.scala | Scala | apache-2.0 | 17,439 |
/*
* 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 ... | ueshin/apache-spark | examples/src/main/scala/org/apache/spark/examples/DFSReadWriteTest.scala | Scala | apache-2.0 | 4,111 |
package lila.pref
import play.api.libs.json._
object JsonView {
implicit val prefJsonWriter = OWrites[Pref] { p =>
Json.obj(
"dark" -> p.dark,
"transp" -> p.transp,
"bgImg" -> p.bgImg,
"is3d" -> p.is3d,
"theme" -> p.theme,
"pieceSet" -> p.pieceSet,
"theme3d" -> p.theme... | JimmyMow/lila | modules/pref/src/main/JsonView.scala | Scala | mit | 1,164 |
package org.randi3.utility
import org.randi3.model._
import org.randi3.randomization.RandomizationMethod
import scalaz._
import Scalaz._
import collection.mutable.ListBuffer
import org.randi3.dao.{TrialDaoComponent, UserDaoComponent}
import scala.Left
import scalaz.Failure
import scala.Some
import scala.Right
import s... | dschrimpf/randi3-core | src/main/scala/org/randi3/utility/SecurityComponent.scala | Scala | gpl-3.0 | 15,273 |
/*******************************************************************************/
/* */
/* Copyright (C) 2017 by Max Lv <max.c.lv@gmail.com> */
/* Copyright (C) 2017 by Mygod Studio <contact-shadowsocks-android@mygod.... | KublaikhanGeek/shadowsocks-android | mobile/src/main/scala/com/github/shadowsocks/bg/TransproxyService.scala | Scala | gpl-3.0 | 3,825 |
package scala.macros.intellij
import com.intellij.openapi.components.{AbstractProjectComponent, ProjectComponent}
import com.intellij.openapi.project.Project
class ScalaMacrosSupportHelper(project: Project) extends AbstractProjectComponent(project) {
}
object ScalaMacrosSupportHelper {
def getInstance(project: Pr... | loskutov/intellij-scala | src/scala/macros/intellij/ScalaMacrosSupportHelper.scala | Scala | apache-2.0 | 413 |
package org.velvia
import com.typesafe.config.Config
import com.typesafe.scalalogging.StrictLogging
import com.rojoma.json.v3.ast.JValue
import com.rojoma.json.v3.codec.JsonEncode
import com.rojoma.json.v3.interpolation._
import com.rojoma.json.v3.io.CompactJsonWriter
import scala.collection.mutable
import scalaj.http... | velvia/carbon-influxdb | scala/src/main/scala/org/velvia/InfluxReporter.scala | Scala | apache-2.0 | 4,125 |
/*
* 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/nn/ConvLSTMPeephole3D.scala | Scala | apache-2.0 | 7,928 |
package mesosphere.marathon
package state
import com.wix.accord._
import mesosphere.UnitTest
import mesosphere.marathon.api.serialization.VolumeSerializer
import mesosphere.marathon.api.v2.ValidationHelper
import org.apache.mesos.Protos.Resource.DiskInfo.Source
class VolumeTest extends UnitTest {
import mesosphere.... | gsantovena/marathon | src/test/scala/mesosphere/marathon/state/VolumeTest.scala | Scala | apache-2.0 | 8,669 |
package org.scalajs.core.compiler.test
import org.scalajs.core.compiler.test.util._
import org.junit.Test
// scalastyle:off line.size.limit
class DiverseErrorsTest extends DirectTest with TestHelpers {
override def preamble: String =
"""import scala.scalajs.js, js.annotation._
"""
@Test
def noIsInst... | CapeSepias/scala-js | compiler/src/test/scala/org/scalajs/core/compiler/test/DiverseErrorsTest.scala | Scala | bsd-3-clause | 8,755 |
class TreeNode(var _value: Int) {
var value: Int = _value
var left: TreeNode = null
var right: TreeNode = null
}
object LeetCode0113 {
def pathSum(root: TreeNode, sum: Int): List[List[Int]] = {
if (root == null) return List();
if (root != null && root.left == null && root.right == null && sum == root.... | dunso/algorithm | Scala/Tree/LeetCode0113.scala | Scala | mit | 642 |
import java.util.Random
class EnergyMonitorDataGen(numOfUsers:Int) {
val r = new Random()
def next(): EnergyMonitorRecord = {
new EnergyMonitorRecord(r.nextInt(numOfUsers), r.nextLong(), System.currentTimeMillis())
}
}
| tmalaska/EnergyMonitorHBaseExample | src/main/scala/EnergyMonitorDataGen.scala | Scala | apache-2.0 | 233 |
package org.bitcoins.dlc.testgen
import java.io.File
import org.bitcoins.crypto.{ECPrivateKey, Sha256Digest}
import play.api.libs.json.{JsResult, JsValue}
import scala.concurrent.Future
object SchnorrSigPointTestVectorGen
extends TestVectorGen[
SchnorrSigPointTestVector,
SchnorrSigPointTestVectorInp... | bitcoin-s/bitcoin-s | dlc-test/src/test/scala/org/bitcoins/dlc/testgen/SchnorrSigPointTestVectorGen.scala | Scala | mit | 1,305 |
package de.hpi.asg.breezetestgen.fixtures
import de.hpi.asg.breezetestgen.domain._
import de.hpi.asg.breezetestgen.testing._
import scalax.collection.immutable.Graph
import scalax.collection.GraphEdge.DiEdge
import scalax.collection.GraphPredef._
object GCDTest {
val netlist = gcdNetlist()
def apply(ain: Int, b... | 0x203/BreezeTestGen | src/test/scala/de/hpi/asg/breezetestgen/fixtures/GCDTest.scala | Scala | mit | 1,430 |
/*
* Copyright 2019 PayPal
*
* 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 ... | anilgursel/squbs | squbs-unicomplex/src/test/scala/org/squbs/stream/PerpetualStreamMatValueSpec.scala | Scala | apache-2.0 | 10,177 |
/*
* Copyright (c) 2018. Fengguo Wei and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0
* which accompanies this distribution, and is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* Detailed contributors ar... | arguslab/Argus-SAF | amandroid/src/main/scala/org/argus/amandroid/core/util/AndroidUrlCollector.scala | Scala | apache-2.0 | 1,420 |
case object Empty extends Stream[Nothing]
case class Cons[+A](h: () => A, t: () => Stream[A]) extends Stream[A]
object Stream {
def cons[A](hd: => A, tl: => Stream[A]): Stream[A] = {
lazy val head = hd
lazy val tail = tl
Cons(() => head, () => tail)
}
def empty[A]: Stream[A] = Empty
def apply[A](... | shigemk2/functional_shibuya | chapter05/14.answer.scala | Scala | mit | 2,247 |
package com.softwaremill.codebrag.dao.finders.views
import com.softwaremill.codebrag.domain.{User, CommitLike}
import com.softwaremill.codebrag.dao.finders.views.CommitState.CommitReviewState
import org.joda.time.DateTime
case class CommitListView(commits: List[CommitView], older: Int, newer: Int)
case class CommitV... | softwaremill/codebrag | codebrag-dao/src/main/scala/com/softwaremill/codebrag/dao/finders/views/CommitListView.scala | Scala | agpl-3.0 | 1,191 |
/**
* 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"); yo... | guozhangwang/kafka | core/src/test/scala/unit/kafka/server/MetadataCacheTest.scala | Scala | apache-2.0 | 27,115 |
package shakey.internal
import com.ib.controller.{Bar, NewContract, ApiController, Types}
import shakey.services.{StockDatabase, LoggerSupport, Stock}
import com.ib.controller.Types.SecType
import com.ib.controller.ApiController.IHistoricalDataHandler
import java.util.{Comparator, PriorityQueue}
import org.joda.time.D... | zzwwws/shakey | shakey-client/src/main/scala/shakey/internal/HistoricalDataFetcher.scala | Scala | apache-2.0 | 4,167 |
package com.softwaremill.bootzooka.email.application
import com.typesafe.config.Config
trait EmailConfig {
def rootConfig: Config
private lazy val emailConfig = rootConfig.getConfig("email")
lazy val emailEnabled = emailConfig.getBoolean("enabled")
lazy val emailSmtpHost = emailConf... | aywengo/bootzooka | backend/src/main/scala/com/softwaremill/bootzooka/email/application/EmailConfig.scala | Scala | apache-2.0 | 888 |
package com.btcontract.wallet.sqlite
import immortan.crypto.Tools.{Bytes, runAnd}
import immortan.sqlite.RichCursor
import android.database.Cursor
import scala.util.Try
case class RichCursorSQLiteAndroid(c: Cursor) extends RichCursor { me =>
def iterable[T](transform: RichCursor => T): Iterable[T] = try map(transf... | btcontract/wallet | app/src/main/java/com/btcontract/wallet/sqlite/RichCursorSQLiteAndroid.scala | Scala | apache-2.0 | 1,126 |
package com.github.mdr.ascii.diagram.parser
import scala.annotation.tailrec
import com.github.mdr.ascii.common.Point
import com.github.mdr.ascii.common.Direction
import com.github.mdr.ascii.common.Direction._
trait LabelParser { self: DiagramParser ⇒
protected def getLabel(edge: EdgeImpl): Option[Label] = {
va... | jlmauduy/ascii-graphs | src/main/scala/com/github/mdr/ascii/diagram/parser/LabelParser.scala | Scala | mit | 1,450 |
/**
* FILE: ProductedResourceDAO.scala
* PERCORSO /Codice/sgad/servertier/src/main/scala/sgad/servertier/dataaccess/databaseaccess/shareddatadao
* DATA CREAZIONE: 20 Febbraio 2014
* AUTORE: ProTech
* EMAIL: protech.unipd@gmail.com
*
* Questo file è proprietà del gruppo ProTech, viene rilasciato sotto licenza Apa... | protechunipd/SGAD | Codice/sgad/servertier/src/main/scala/sgad/servertier/dataaccess/databaseaccess/shareddatadao/ProductedResourceDAO.scala | Scala | apache-2.0 | 2,164 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala
package reflect
... | scala/scala | src/reflect/scala/reflect/api/Internals.scala | Scala | apache-2.0 | 43,533 |
package me.gregd.cineworld.util
import cats.effect.Async
import com.github.davidmoten.rtree.geometry.{Geometries, Point}
import com.github.davidmoten.rtree.internal.EntryDefault
import com.github.davidmoten.rtree.{RTree => UnderlyingRTree}
import me.gregd.cineworld.domain.model.Coordinates
import rx.Observable
import... | Grogs/cinema-service | domain/src/main/scala/me/gregd/cineworld/util/RTree.scala | Scala | gpl-3.0 | 1,368 |
/*
* Copyright 2014 JHC Systems Limited
*
* 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... | DavidGregory084/sqlest | sqlest/src/main/scala/sqlest/sql/base/SelectStatementBuilder.scala | Scala | apache-2.0 | 7,731 |
package com.nulabinc.backlog.migration.common.persistence.store.sqlite.ops
import doobie.Update0
trait BaseTableOps {
def createTable(): Update0
}
| nulab/backlog-migration-common | core/src/main/scala/com/nulabinc/backlog/migration/common/persistence/store/sqlite/ops/BaseTableOps.scala | Scala | mit | 151 |
package com.github.sdwebster.app
import org.scalatra._
import scalate.ScalateSupport
class MyScalatraServlet extends SimpleServerStack {
get("/") {
<html>
<body>
<h1>Hello, world!</h1>
<h2>This is your server speaking. We are using Sinatra!<h2>
Say <a href="hello-scalate">hello to... | sdwebster/mini-projects | Scala/simpleServer/simple-server/src/main/scala/com/github/sdwebster/app/MyScalatraServlet.scala | Scala | mit | 367 |
package windows
import gui._
/**
* Small window which purpose is to show error message to user when relevant.
*/
object ErrorWindow extends Window("Error") {
actualWindow.setSize(300, 150)
private val errorMessage: FontString = actualWindow.createFontString()
errorMessage.setPoint(TopLeft, a... | sherpal/holomorphic-maps | src/main/scala/windows/ErrorWindow.scala | Scala | mit | 624 |
package org.apache.spark.ml.parity.feature
import org.apache.spark.ml.feature.{IDF, VectorAssembler}
import org.apache.spark.ml.{Pipeline, Transformer}
import org.apache.spark.ml.parity.SparkParityBase
import org.apache.spark.sql._
/**
* Created by hollinwilkins on 12/28/16.
*/
class IDFParitySpec extends SparkPa... | combust/mleap | mleap-spark/src/test/scala/org/apache/spark/ml/parity/feature/IDFParitySpec.scala | Scala | apache-2.0 | 684 |
/*
* Copyright 2014 Xored Software, Inc.
* Copyright 2015 Gleb Kanterov
*
* 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 r... | naderghanbari/scala-js-react | scalajs-react/src/main/scala/com/kanterov/scalajs/react/internal/ReactDOMBuffer.scala | Scala | apache-2.0 | 1,407 |
package lore.compiler.poem
import lore.compiler.types.{BasicType, DeclaredSchema, Kind}
sealed trait PoemType
case class PoemTypeVariable(index: Int) extends PoemType
case class PoemBasicType(underlying: BasicType) extends PoemType
case class PoemXaryType(kind: Kind, types: Vector[PoemType]) extends PoemType
case cl... | marcopennekamp/lore | compiler/src/lore/compiler/poem/PoemType.scala | Scala | mit | 583 |
package com.sksamuel.elastic4s.requests.delete
import com.fasterxml.jackson.annotation.JsonProperty
import com.sksamuel.elastic4s.requests.common.{DocumentRef, Shards}
case class DeleteResponse(@JsonProperty("_shards") shards: Shards,
@JsonProperty("_index") index: String,
... | sksamuel/elastic4s | elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/delete/DeleteResponse.scala | Scala | apache-2.0 | 522 |
package com.cloudray.scalapress.plugin.ecommerce
import org.scalatest.{OneInstancePerTest, FunSuite}
import org.scalatest.mock.MockitoSugar
import com.cloudray.scalapress.plugin.ecommerce.domain.{Address, Order}
import com.cloudray.scalapress.account.Account
/** @author Stephen Samuel */
class OrderPurchaseTest exten... | vidyacraghav/scalapress | src/test/scala/com/cloudray/scalapress/plugin/ecommerce/OrderPurchaseTest.scala | Scala | apache-2.0 | 2,038 |
/* ___ _ ___ _ _ *\\
** / __| |/ (_) | | The SKilL Generator **
** \\__ \\ ' <| | | |__ (c) 2013 University of Stuttgart **
** |___/_|\\_\\_|_|____| see LICENSE ... | XyzNobody/skill | src/main/scala/de/ust/skill/generator/scala/internal/ExceptionsMaker.scala | Scala | bsd-3-clause | 2,999 |
package org.killbill.billing.client.actor
import java.io.InputStream
import java.util.UUID
import java.util.concurrent.TimeUnit
import akka.actor.{ActorSystem, Props}
import akka.pattern.ask
import akka.testkit.TestKit
import akka.util.Timeout
import org.killbill.billing.client.model.{ObjectType, Tag, TagResult, Over... | jgomez-vp/killbill-client-scala | src/test/scala/org/killbill/billing/client/actor/TagActorSpec.scala | Scala | apache-2.0 | 52,960 |
package ohnosequences.tabula.action
import com.amazonaws.services.dynamodbv2.model.{AttributeValueUpdate, AttributeValue}
import ohnosequences.cosas._, types._, typeSets._
import ohnosequences.tabula._, states._, actions._, conditions._, predicates._, items._, tables._
import ohnosequences.tabula.impl.ImplicitConver... | ohnosequences/tabula | src/main/scala/tabula/actions/Query.scala | Scala | agpl-3.0 | 1,824 |
/**
* Copyright 2009 Latterfrosken Software Development Limited
*
* This file is part of Lafros GUI-Alerts.
*
* Lafros GUI-Alerts 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 th... | robcd/lafros-gui | lafros-gui-alerts/src/test/scala/com/lafros/gui/alerts/togPanelInBoxPanel.scala | Scala | gpl-3.0 | 1,479 |
/*
* Copyright 2007-2011 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 applica... | lift/framework | core/util/src/main/scala/net/liftweb/util/CombParserHelpers.scala | Scala | apache-2.0 | 8,244 |
package bad.robot.radiate.teamcity
trait TeamCityObject
| tobyweston/radiate | src/main/scala/bad/robot/radiate/teamcity/TeamCityObject.scala | Scala | apache-2.0 | 57 |
/*
MET-API
Copyright (C) 2014 met.no
Contact information:
Norwegian Meteorological Institute
Box 43 Blindern
0313 OSLO
NORWAY
E-mail: met-api@met.no
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... | metno/metapi-sources | app/services/sources/ProdSourceAccess.scala | Scala | gpl-2.0 | 20,734 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | typelevel/squants | shared/src/test/scala/squants/electro/ElectricPotentialSpec.scala | Scala | apache-2.0 | 4,056 |
package dotty.tools.dotc.util
object Store {
class Location[T](private[Store] val idx: Int) extends AnyVal
val empty: Store = new Store(Array())
}
class Store(private val elems: Array[AnyRef | Null]) extends AnyVal {
import Store._
def newLocation[T](): (Location[T], Store) = {
val elems1 = new Array[A... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/util/Store.scala | Scala | apache-2.0 | 892 |
/*
Copyright 2013 Cristian Vrabie, Evelina Vrabie
This file is part of UKGist.
UKGist 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.... | CodeAndMagic/ukgist-server | src/main/scala/com/codeandmagic/ukgist/model/Interval.scala | Scala | gpl-3.0 | 5,455 |
package unfiltered.netty.request
import unfiltered.netty
import unfiltered.netty.{ ExceptionHandler }
import unfiltered.netty.cycle.ThreadPool
import unfiltered.request.{ Path => UFPath, POST, & }
import unfiltered.response.{ Pass, ResponseString }
import unfiltered.specs2.netty.Served
import java.io.{ File => JFile... | jarin/unfiltered | netty-uploads/src/test/scala/NoChunkAggregatorSpec.scala | Scala | mit | 4,780 |
/*
* 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... | jackylk/incubator-carbondata | integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/ComplexDataTypeTestCase.scala | Scala | apache-2.0 | 19,820 |
/*
* Copyright 2018 Spotify AB.
*
* 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 ... | spotify/featran | core/src/main/scala/com/spotify/featran/transformers/PositionEncoder.scala | Scala | apache-2.0 | 2,630 |
package week4
/**
* Created by phanik on 15/11/16.
*/
abstract class Nat {
def isZero: Boolean
def predecessor: Nat
def successor: Nat = new Succ(this)
def + (that: Nat): Nat
def - (that: Nat): Nat
}
object Zero extends Nat {
override def isZero: Boolean = true
override def predecessor: Nat = throw ... | ntrphanikumar/coursera-scala | progfun/src/week4/Nat.scala | Scala | mit | 732 |
/*
* Copyright 2001-2011 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... | JimCallahan/Graphics | external/scalatest/src/test/scala/org/scalatest/FailureOfSpec.scala | Scala | apache-2.0 | 1,261 |
/*
Copyright (c) 2017, Qvantel
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 conditions and the following di... | Doikor/jsonapi-scala | core/src/main/scala/com/qvantel/jsonapi/JsonOption.scala | Scala | bsd-3-clause | 13,272 |
package com.sksamuel.elastic4s.indexes
trait IndexTemplateApi {
@deprecated("use deleteIndexTemplate(name)", "6.0.0")
def deleteTemplate(name: String): DeleteIndexTemplateRequest = DeleteIndexTemplateRequest(name)
def deleteIndexTemplate(name: String): DeleteIndexTemplateRequest = DeleteIndexTemplateRequest(na... | Tecsisa/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/indexes/IndexTemplateApi.scala | Scala | apache-2.0 | 1,273 |
package at.logic.gapt.proofs.lk
import at.logic.gapt.expr._
import at.logic.gapt.proofs.{ Ant, SequentConnector }
object makeInductionExplicit extends LKVisitor[Unit] {
def inductionPrinciple( indty: Ty, constrs: Seq[Const] ) = {
val pred = Var( "X", indty -> To )
val hyps = constrs.map { constr =>
va... | gebner/gapt | core/src/main/scala/at/logic/gapt/proofs/lk/makeInductionExplicit.scala | Scala | gpl-3.0 | 2,245 |
/***********************************************************************
* Copyright (c) 2013-2020 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ccri/geomesa | geomesa-filter/src/main/scala/org/locationtech/geomesa/filter/index/BucketIndexSupport.scala | Scala | apache-2.0 | 980 |
package hr.element.etb
import java.security._
import javax.net.ssl._
import org.apache.http.conn.ssl.SSLSocketFactory
import org.apache.http.conn.scheme.Scheme
import dispatch._
class TrustedHttps(truststore: String, truststorePassword: String) extends Http {
client.getConnectionManager.getSchemeRegistry.register... | mlegac/etb | util/src/main/scala/hr/element/etb/TrustedHttps.scala | Scala | unlicense | 960 |
import org.scalatest._
class BobSpecs extends FlatSpec with Matchers {
def teenager = new Bob
it should "respond to a statement" in {
val response = teenager.hey("Tom-ay-to, tom-aaaah-to.")
response should be ("Whatever.")
}
it should "respond to shouting" in {
val response = teenager.hey("WATCH... | daewon/til | exercism/scala/bob/src/test/scala/bob_test.scala | Scala | mpl-2.0 | 2,548 |
package ch10
import java.awt.Point
import scala.util.Random
object ex02 extends App {
class OrderedPoint(x: Int, y: Int) extends Point(x, y) with Ordered[OrderedPoint] {
def compare(o: OrderedPoint) = { if (x == o.x) y - o.y else x - o.x }
override def toString = s"OrderedPoint[x=$x,y=$y]"
}
val r = new... | tuxdna/scala-for-the-impatient-exercises | src/main/scala/ch10/ex02.scala | Scala | apache-2.0 | 532 |
/**
* 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... | lshift/diffa | kernel/src/test/scala/net/lshift/diffa/kernel/util/cache/NonProductionKeyPredicate.scala | Scala | apache-2.0 | 1,045 |
/**
* Copyright (C) 2012 Typesafe, Inc. <http://www.typesafe.com>
*/
package org.pantsbuild.zinc.compiler
import com.google.common.base.Joiner
import java.io.File
import java.nio.file.{Files, Path}
import java.lang.{Boolean => JBoolean}
import java.util.function.{Function => JFunction}
import java.util.{List => JL... | tdyas/pants | src/scala/org/pantsbuild/zinc/compiler/Settings.scala | Scala | apache-2.0 | 17,571 |
package com.paytmlabs.akka.cluster.sbr
import scala.annotation.migration
import scala.collection.immutable
import scala.concurrent.duration.Deadline
import scala.concurrent.duration.DurationInt
import scala.concurrent.duration.FiniteDuration
import akka.actor.Actor
import akka.actor.ActorLogging
import akka.actor.Add... | PaytmLabs/akka-batteries | split-brain-resolver/src/main/scala/com/paytmlabs/akka/cluster/sbr/RoleBasedSplitBrainResolver.scala | Scala | apache-2.0 | 6,679 |
/*
* Ported by Alistair Johnson from
* https://android.googlesource.com/platform/libcore/+/master/luni/src/main/java/java/math/BigDecimal.java
* Original license copied below:
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distr... | jmnarloch/scala-js | javalib/src/main/scala/java/math/BigDecimal.scala | Scala | bsd-3-clause | 60,369 |
package gapt.examples.sequence
import gapt.expr._
import gapt.expr.formula.fol.Numeral
import gapt.formats.babel.Notation
import gapt.formats.babel.Precedence
import gapt.proofs.Sequent
import gapt.proofs.context.update.Sort
import gapt.proofs.gaptic.Proof
import gapt.proofs.gaptic.TacticsProof
import gapt.proofs.gapt... | gapt/gapt | examples/sequence/SumOfOnesF2ExampleProof.scala | Scala | gpl-3.0 | 1,231 |
package eventstore
package tcp
import util.{ BytesWriter, BytesReader, BytesFormat }
import akka.util.{ ByteStringBuilder, ByteIterator }
object EventStoreFormats extends EventStoreFormats
trait EventStoreFormats extends EventStoreProtoFormats {
abstract class EmptyFormat[T](obj: T) extends BytesFormat[T] {
de... | pawelkaczor/EventStore.JVM | src/main/scala/eventstore/tcp/EventStoreFormats.scala | Scala | bsd-3-clause | 2,833 |
package com.lyrx.text
import java.io.File
import java.nio.file.Files
/**
* Created by extawe on 3/31/17.
*/
trait TextSerializer extends GenBase[String]{
def serialize(aFile:String)(implicit context:Context): Either[File,String] ={
context.outDir.mkdirs()
val outputFile =new File(context.outDir,aFile)... | lyrx/lyrxgenerator | src/main/scala/com/lyrx/text/TextSerializer.scala | Scala | gpl-3.0 | 429 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/play-ui | src/main/twirl/uk/gov/hmrc/play/views/formatting/Dates.scala | Scala | apache-2.0 | 3,146 |
package com.sksamuel.avro4s.schemas
import com.sksamuel.avro4s.SchemaFor
import org.apache.avro.SchemaBuilder
trait ByteIterableSchemas:
given ByteArraySchemaFor: SchemaFor[Array[Byte]] = SchemaFor[Array[Byte]](SchemaBuilder.builder.bytesType)
given ByteListSchemaFor: SchemaFor[List[Byte]] = ByteArraySchemaFor.fo... | sksamuel/avro4s | avro4s-core/src/main/scala/com/sksamuel/avro4s/schemas/bytes.scala | Scala | apache-2.0 | 483 |
package pages.disposal_of_vehicle.priv
import org.openqa.selenium.WebDriver
import org.scalatest.selenium.WebBrowser
import WebBrowser.click
import WebBrowser.go
import uk.gov.dvla.vehicles.presentation.common.helpers
import helpers.webbrowser.{Page, WebDriverFactory}
import webserviceclients.fakes.FakeVehicleAndKeepe... | dvla/vehicles-online | test/pages/disposal_of_vehicle/priv/VehicleLookupPage.scala | Scala | mit | 916 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/ml/regression/DecisionTreeRegressor.scala | Scala | apache-2.0 | 11,838 |
package ore.models.statistic
import scala.language.higherKinds
import ore.db.access.ModelView
import ore.db.{DbRef, Model, ModelService}
import ore.models.user.User
import cats.Monad
import cats.data.OptionT
import com.github.tminglei.slickpg.InetString
/**
* Represents a statistic entry in a StatTable.
*/
abst... | SpongePowered/Ore | models/src/main/scala/ore/models/statistic/StatEntry.scala | Scala | mit | 936 |
/*
* Twitter Korean Text - Scala library to process Korean text
*
* Copyright 2014 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/... | NamHosung/SE | src/main/scala/com/twitter/penguin/korean/v1/TwitterKoreanProcessor.scala | Scala | apache-2.0 | 3,566 |
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.