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 models
import SQ._
case class Want(
what: String,
description: String = "",
user_id:Long = 0L
) extends ItemBase {
def this() = this("", "", 0L)
lazy val images = Schema.wantImages.left(this)
def meta = Want
lazy val detailURL = controllers.routes.Wants.detail(id)
def withZipc... | maackle/bartera | app/models/Want.scala | Scala | mit | 772 |
package io.dylemma.spac
package impl
class ParserFollowedByTransformer[In, A, Out](base: Parser[In, A], followUp: A => Transformer[In, Out])(implicit stacking: StackLike[In, Any]) extends Transformer[In, Out] {
def newHandler = new ParserFollowedByTransformer.Handler(base, followUp, stacking)
}
object ParserFollowed... | dylemma/xml-stream | core/src/main/scala/io/dylemma/spac/impl/ParserFollowedByTransformer.scala | Scala | mit | 2,450 |
package aegis.strategy
import aegis.{Game, Answer}
/**
*
* @author ponkotuy
* Date: 14/01/17
*/
trait Strategy {
def choice(game: Game): Answer
}
| ponkotuy/AegisStrategy | src/main/scala/aegis/strategy/Strategy.scala | Scala | mit | 154 |
package com.twitter.finatra.http.benchmarks
import com.twitter.inject.Test
class RouteBenchmarkTest extends Test {
"test" in {
val benchmark = new RouteBenchmark()
benchmark.testRoute()
benchmark.testRouteWithPathParams()
}
}
| syamantm/finatra | benchmarks/src/test/scala/com/twitter/finatra/http/benchmarks/RouteBenchmarkTest.scala | Scala | apache-2.0 | 245 |
/*
* Copyright 2001-2014 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... | SRGOM/scalatest | scalatest-test/src/test/scala/org/scalatest/fixture/AsyncFlatSpecSpec.scala | Scala | apache-2.0 | 4,368 |
package com.monsanto.stats.tables.models
/**
* Represents the embedded sentiment scores inside of various Alchemy API responses.
*/
case class DocSentiment(sentimentType: String, score: Option[String]) {
val doubleVal = score.map(_.toDouble)
require(sentimentType == "negative" || sentimentType == "positive" || s... | MonsantoCo/chinese-restaurant-process | src/main/scala/com/monsanto/stats/tables/models/DocSentiment.scala | Scala | bsd-3-clause | 349 |
package geotrellis.raster.op.local
import scala.math.min
import geotrellis._
import geotrellis.process._
object Min {
def apply(x:Op[Int], y:Op[Int]) = logic.Do2(x, y)((z1, z2) => min(z1, z2))
def apply(r:Op[Raster], c:Op[Int]) = MinConstant(r, c)
def apply(c:Op[Int], r:Op[Raster]) = MinConstant2(c, r)
def a... | Tjoene/thesis | Case_Programs/geotrellis-0.7.0/src/main/scala/geotrellis/raster/op/local/Min.scala | Scala | gpl-2.0 | 758 |
package arx.core.graphics.data
/**
* Created by IntelliJ IDEA.
* User: nvt
* Date: 7/8/12
* Time: 9:15 AM
* Created by nonvirtualthunk
*/
trait TRenderTarget {
def vbo : AVBO
def incrementVertexOffset ( n : Int ) : Int
def incrementIndexOffset ( n : Int ) : Int
def vertexOffset : Int
def indexOffset : Int... | nonvirtualthunk/arx-core | src/main/scala/arx/core/graphics/data/TRenderTarget.scala | Scala | bsd-2-clause | 322 |
package org.quantintel.ql.time.daycounters
import org.scalatest.{FlatSpec, Matchers}
/**
* @author Paul Bernard
*/
class OneOne_ extends FlatSpec with Matchers {
}
| quantintel/spectrum | financial/src/test/scala/org/quantintel/ql/time/daycounters/OneOne_.scala | Scala | apache-2.0 | 169 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/ ... | S-Mach/s_mach.string | src/main/scala/s_mach/string/impl/CharGroupOps.scala | Scala | mit | 2,650 |
package com.daxin.akkaDemo1
/**
* @author ${user.name}
*/
object App {
}
| Dax1n/Scala | akkaDemo2/src/main/scala/com/daxin/akkaDemo1/App.scala | Scala | apache-2.0 | 82 |
package org.ucombinator.jaam.interpreter
/*
Warning:
1. Don't cross the streams. It would be bad.
2. Don't order addresses. Dogs and cats, living together. Mass hysteria.
*/
// TODO: put info about configuration in jaam file
// TODO: put enough information in jaam file to continue interrupted processes
// ... | Ucombinator/jaam | src/main/scala/org/ucombinator/jaam/interpreter/Main.scala | Scala | bsd-2-clause | 66,757 |
/*
Copyright 2011 Ben Biddington
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
d... | ben-biddington/Coriander.OAuth | test/org/coriander/unit/tests/TestBase.scala | Scala | apache-2.0 | 5,816 |
//############################################################################
// Programmation IV - 2002 - Week 08
//############################################################################
import List._;
object M0 {
var x: String = "abc";
var count = 111;
def test() = {
Console.println("x = " + ... | scala/scala | test/files/run/Course-2002-08.scala | Scala | apache-2.0 | 14,766 |
/*
* Copyright 2016 Dennis Vriend
*
* 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... | gavares/akka-persistence-jdbc | src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala | Scala | apache-2.0 | 13,754 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2015, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/language.scala | Scala | bsd-3-clause | 8,982 |
package model
case class DeleteCommentInput(id: Int, postId: Int)
| sysgears/apollo-universal-starter-kit | modules/post/server-scala/src/main/scala/model/DeleteCommentInput.scala | Scala | mit | 67 |
/*
* 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 ... | deroneriksson/incubator-systemml | src/main/scala/org/apache/sysml/api/ml/NaiveBayes.scala | Scala | apache-2.0 | 4,920 |
/*
* 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 ... | ksattler/piglet | src/main/scala/dbis/pig/tools/FileTools.scala | Scala | apache-2.0 | 2,407 |
package lila
import lila.socket.WithSocket
package object simulation
extends PackageObject
with WithPlay
with WithSocket
| Happy0/lila | modules/simulation/src/main/package.scala | Scala | mit | 136 |
package sbtscalaxb
import sbt._
import Keys._
import scala.collection.immutable
import scalaxb.{compiler => sc}
import scalaxb.compiler.{Config => ScConfig}
import sc.ConfigEntry._
object ScalaxbPlugin extends sbt.AutoPlugin {
override def requires = plugins.JvmPlugin
object autoImport extends ScalaxbKeys
impo... | eed3si9n/scalaxb | sbt-scalaxb/src/main/scala/sbtscalaxb/ScalaxbPlugin.scala | Scala | mit | 6,783 |
package org.intracer.finance.slick
import org.intracer.finance.{Account, Grant}
import slick.driver.H2Driver.api._
class Accounts(tag: Tag) extends Table[Account](tag, "account") {
def id = column[Int]("id", O.PrimaryKey, O.AutoInc)
def name = column[String]("name")
def nameIndex = index("acc_name", name, uni... | intracer/wmua-finance | app/org/intracer/finance/slick/Accounts.scala | Scala | apache-2.0 | 396 |
package spinoco.protocol.mail.header
/**
* Created with IntelliJ IDEA.
* User: raulim
* Date: 5.3.18
*/
/**
* Value of known header is not RFC compliant
* Only for decoding of incoming emails.
*/
case class NonRFC(name: String, value: String) extends EmailHeaderField with ContentHeaderField
| Spinoco/protocol | mail/src/main/scala/spinoco/protocol/mail/header/NonRFC.scala | Scala | mit | 308 |
package com.arcusys.valamis.lesson.scorm.model.manifest
/**
* A map from local objective to global objectives
* @param readSatisfiedStatusFrom ID of global objective to retrieve satisfaction status from when its progress is defined
* @param readNormalizedMeasureFrom ID of global objective to retrieve normalized m... | igor-borisov/valamis | valamis-scorm-lesson/src/main/scala/com/arcusys/valamis/lesson/scorm/model/manifest/ObjectiveMap.scala | Scala | gpl-3.0 | 2,878 |
package event_sourcing
import org.specs2.mutable._
import org.specs2.runner.JUnitRunner
import org.junit.runner.RunWith
@RunWith(classOf[JUnitRunner])
class EventStoreSpec extends Specification {
"The EventStore" should {
"Be tested" in {
1 mustEqual 1
}
}
}
| fpape/event-sourcing-in-practice | code-samples/src/test/scala/event_sourcing/EventStoreSpec.scala | Scala | mit | 281 |
package kbilling.model
import BillingPlan.Vars
import com.github.nscala_time.time.Imports._
object BillingPlan {
type Vars = Map[String, BigDecimal]
}
trait BillingPlan {
val accounts: Map[String, Account]
val notifications: Set[Notification]
final lazy val aggregates = (accounts.values collect {case a: Serv... | KillingBilling/kbilling-types | src/main/scala/kbilling/model/BillingPlan.scala | Scala | mit | 764 |
/*
* Copyright 2012 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | dsias/zipkin | zipkin-server/src/main/scala/com/twitter/zipkin/collector/sampler/AdaptiveSampler.scala | Scala | apache-2.0 | 951 |
/**
* 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... | yonglehou/kafka-1 | src/test/ly/stealth/mesos/kafka/ConstraintTest.scala | Scala | apache-2.0 | 5,053 |
package controllers.billing
import scalaz._
import Scalaz._
import scalaz.Validation
import scalaz.Validation.FlatMap._
import scalaz.NonEmptyList._
import net.liftweb.json._
import net.liftweb.json.JsonParser._
import io.megam.auth.funnel.{ FunnelResponse, FunnelResponses }
import io.megam.auth.funnel.FunnelErrors._... | indykish/verticegateway | app/controllers/billing/Externalobjects.scala | Scala | mit | 2,942 |
package com.programmaticallyspeaking.ncd.nashorn
import com.programmaticallyspeaking.ncd.testing.UnitTest
import com.sun.jdi.ThreadReference
import org.scalatest.mockito.MockitoSugar
import org.scalatest.prop.TableDrivenPropertyChecks
import org.mockito.Mockito._
class NashornDebuggerHostTest extends UnitTest with Ta... | provegard/ncdbg | src/test/scala/com/programmaticallyspeaking/ncd/nashorn/NashornDebuggerHostTest.scala | Scala | bsd-3-clause | 1,057 |
package org.scalamu.core.testapi
package specs2
import org.specs2.specification.core.SpecificationStructure
import org.specs2.specification.process.Stats
class Specs2Framework(override val arguments: String) extends TestingFramework {
type R = Stats
override def name: String = "Specs2"
override def ru... | sugakandrey/scalamu | core/src/main/scala/org/scalamu/core/testapi/specs2/Specs2Framework.scala | Scala | gpl-3.0 | 642 |
/*
* 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 ... | greghogan/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/common/CommonLookupJoin.scala | Scala | apache-2.0 | 33,986 |
package com.typesafe.slick.testkit.tests
import com.typesafe.slick.testkit.util.{JdbcTestDB, AsyncTest}
import slick.jdbc.{ResultSetHoldability, ResultSetConcurrency, ResultSetType, JdbcBackend}
class JdbcMiscTest extends AsyncTest[JdbcTestDB] {
import tdb.profile.api._
def testNullability = {
class T1(tag:... | slick/slick | slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JdbcMiscTest.scala | Scala | bsd-2-clause | 3,704 |
/*
* 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 | traits/Philosophical.scala | Scala | apache-2.0 | 910 |
/*
Copyright 2012 - 2015 pac4j organization
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... | DevFactory/play-pac4j | src/main/scala/org/pac4j/play/scala/Security.scala | Scala | apache-2.0 | 4,433 |
/*
* 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 ... | reminisce/mxnet | scala-package/core/src/main/scala/org/apache/mxnet/Random.scala | Scala | apache-2.0 | 3,593 |
trait C { this: { type T = Int } =>
type T
val x: T
}
class D extends C {
type T = Int
val x = 10
}
object Test {
val c: C = new D
val y: c.T = c.x
val x: Int = c.x // error
val z: Int = y // error
} | som-snytt/dotty | tests/neg/no-self-leaks.scala | Scala | apache-2.0 | 225 |
package com.sksamuel.elastic4s.requests.searches.queries.geo
sealed trait GeoExecType
object GeoExecType {
def valueOf(str: String): GeoExecType = str.toUpperCase match {
case "MEMORY" => Memory
case "INDEXED" => Indexed
}
case object Memory extends GeoExecType
case object Indexed extends GeoExecTy... | sksamuel/elastic4s | elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/searches/queries/geo/GeoExecType.scala | Scala | apache-2.0 | 325 |
/*
* 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 ... | qinzhaokun/incubator-eagle | eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/storm/IterableStreamSpout.scala | Scala | apache-2.0 | 2,617 |
/*
* Copyright 2010 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | twitter/util | util-logging/src/test/scala/com/twitter/logging/FormatterTest.scala | Scala | apache-2.0 | 8,223 |
package com.socrata.bq.soql.bqreps
import com.rojoma.json.v3.ast.{JNull, JValue}
import com.socrata.bq.soql.{BigqueryType, BBQRep}
import com.socrata.soql.types.{SoQLNull, SoQLValue, SoQLType}
class NullRep extends BBQRep[SoQLType, SoQLValue] {
override def repType: SoQLType = SoQLNull
override val bigqueryType... | socrata-platform/soql-bigquery-adapter | common-bq/src/main/scala/com/socrata/bq/soql/bqreps/NullRep.scala | Scala | apache-2.0 | 500 |
package codegen.messagetypes
import codegen.Constants
import codegen.functions._
import datamodel._
object ArrayFieldFreeFunction {
private val nameSuffix = "_array_free"
private val arrayParamName = "array"
private val countParamName = "array_cnt"
private val indexVariableName = "i"
/**
* Gets the d... | gatkin/cDTO | src/main/scala/codegen/messagetypes/ArrayFieldFreeFunction.scala | Scala | mit | 5,673 |
package org.apache.spark.ml.feature
import scala.collection.Map
import org.apache.hadoop.fs.Path
import org.apache.spark.SparkException
import org.apache.spark.ml._
import org.apache.spark.ml.attribute.NominalAttribute
import org.apache.spark.ml.param._
import org.apache.spark.ml.param.shared._
import org.apache.spar... | bbiletskyy/intron-prediction | src/main/scala/org/apache/spark/ml/feature/SequenceIndexer.scala | Scala | apache-2.0 | 7,228 |
package indix.rocksdb
object TimerUtil {
def timed[T](report: (Long) => Unit)(block: => T): (Long, T) = {
val start = System.nanoTime()
val result = block
val timeTookInMillis = (System.nanoTime() - start) / (1000 * 1000)
report(timeTookInMillis)
(timeTookInMillis, result)
}
}
| ind9/rocksdb-io | src/main/scala/indix/rocksdb/TimerUtil.scala | Scala | apache-2.0 | 305 |
package fr.thomasdufour.autodiff
import cats.syntax.flatMap._
import org.scalacheck.Arbitrary.arbitrary
import org.scalacheck.Gen
import org.scalacheck.cats.implicits._
import org.scalactic.TypeCheckedTripleEquals
import org.scalatest.Matchers
import org.scalatest.WordSpec
import org.scalatestplus.scalacheck.ScalaChec... | chwthewke/auto-diff | auto-diff-tests/src/test/scala/fr/thomasdufour/autodiff/MapDiffSpec.scala | Scala | apache-2.0 | 4,816 |
package com.twitter.finagle.util
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class ByteArraysTest extends FunSuite {
test("ByteArrays.concat: add two arrays") {
val a = Array[Byte](0, 1, 2)
val b = Array[Byte](3, 4)
... | lysu/finagle | finagle-core/src/test/scala/com/twitter/finagle/util/ByteArraysTest.scala | Scala | apache-2.0 | 1,405 |
package com.dafttech.logic
import com.dafttech.logic.Field.Ref
import scala.language.implicitConversions
/**
* Created by LolHens on 22.07.2015.
*/
abstract class Field {
def value: Int
def ref = Ref(this)
object signal {
private[this] var cache: Option[Array[Signal]] = None
def apply(i: Int): Sig... | LolHens/LogicToProm | logictoprom/src/main/scala/com/dafttech/logic/Field.scala | Scala | gpl-2.0 | 2,581 |
package fringe
import chisel3._
import chisel3.util._
import axi4._
import templates.Utils.log2Up
/**
* FringeZynq: Top module for FPGA shell
* @param w: Word width
* @param numArgIns: Number of input scalar arguments
* @param numArgOuts: Number of output scalar arguments
*/
class FringeZynq(
val w: Int,
val... | stanford-ppl/spatial-lang | spatial/core/resources/chiselgen/template-level/fringeHW/FringeZynq.scala | Scala | mit | 4,788 |
package edu.gemini.phase2.skeleton
package object factory {
}
| arturog8m/ocs | bundle/edu.gemini.phase2.skeleton.servlet/src/main/scala/edu/gemini/phase2/skeleton/factory/package.scala | Scala | bsd-3-clause | 63 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/amls-frontend | app/models/bankdetails/BankAccountSubsteps.scala | Scala | apache-2.0 | 6,972 |
package model.serialize
import play.api.libs.json.Json
import model.{Recipe, Ingredient}
import play.api.data.format.Formatter
import play.api.data.FormError
/**
* @author knm
*/
object SerializeProvider {
implicit val ingredientFormatter = Json.format[Ingredient]
implicit val recipeFormatter = Json.format[Reci... | linuxswords/play-recipes | app/model/serialize/SerializeProvider.scala | Scala | apache-2.0 | 326 |
/*
* 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 | core/test/com/treode/async/BackoffSpec.scala | Scala | apache-2.0 | 1,805 |
package cobase.play.group
import java.util.UUID
import javax.inject.Inject
import cobase.group.{Group, GroupService}
import cobase.post.PostService
import cobase.twitter.{Tweet, TwitterService}
import cobase.user._
import com.mohiva.play.silhouette.api.{Environment, Silhouette}
import com.mohiva.play.silhouette.impl.... | Cobase/cobase-pro | app/cobase/play/group/GroupController.scala | Scala | mit | 5,103 |
package backup
import authentication.{PathToken, SubClaim}
import cats.Monad
import cats.effect.{ConcurrentEffect, ContextShift}
import cats.implicits._
import org.http4s.{HttpRoutes, _}
import org.http4s.dsl.io._
import org.http4s.circe._
import io.circe.syntax._
import user.{UserId, UserIds}
class BackupEndpoints[F... | Leonti/receipts-rest-service | app/src/main/scala/backup/BackupEndpoints.scala | Scala | mit | 1,735 |
package cl.asa.yaml.noun
class Case {
var noun:String = ""
var part:String = ""
var category:String = ""
var semrole:String = ""
var arg:String = ""
def setNoun(str:String){
this.noun = str
}
def setPart(str:String){
this.part = str
}
def setCategory(str:String){
this.category
}
def setSemro... | Takeuchi-Lab-LM/scala_asa3 | ASA/src/main/scala/cl/asa/yaml/noun/Case.scala | Scala | mit | 408 |
package io.waylay.kairosdb.driver.models
import io.waylay.kairosdb.driver.models.Aggregator.Trim.TrimWhat
import io.waylay.kairosdb.driver.models.RangeAggregator.Align
import io.waylay.kairosdb.driver.models.TimeSpan.AbsoluteStartTime
import scala.collection.immutable.Seq
import scala.concurrent.duration.TimeUnit
se... | waylayio/kairosdb-scala | src/main/scala/io/waylay/kairosdb/driver/models/Aggregator.scala | Scala | mit | 7,350 |
/*
* Copyright 2015 Commonwealth Computer Research, 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 applicabl... | jnh5y/geomesa | geomesa-jobs/src/main/scala/org/locationtech/geomesa/jobs/scalding/taps/AccumuloLocalTap.scala | Scala | apache-2.0 | 6,601 |
package com.fortysevendeg.scala.android.ui.circularreveal
import android.os.Bundle
import android.support.v4.app.{FragmentManager, Fragment}
import android.support.v7.widget.CardView
import android.widget.{ImageView, TextView, FrameLayout, LinearLayout}
import com.fortysevendeg.macroid.extras.ResourcesExtras._
import ... | wvandrunen/scala-android | src/main/scala/com/fortysevendeg/scala/android/ui/circularreveal/Layout.scala | Scala | apache-2.0 | 2,595 |
package me.hawkweisman
package io
import util.EscapableString
import scala.language.postfixOps
/**
* Created by hawk on 2/10/16.
*/
object DSV {
implicit class ToDSV(val p: Product)
extends AnyVal {
def toDSVLine(delim: String = ","): String
= p.productIterator map {
case Some(thing) ... | hawkw/scala-common | src/main/scala/me/hawkweisman/io/DSV.scala | Scala | mit | 537 |
package nz.wicker.autoencoder.math.optimization
/**
* A fairly generic termination criterion that takes a look at the
* intermediate result achieved and resources used so far, and decides if an
* optimization procedure or some kind of search should be terminated.
*/
trait TerminationCriterion[-IntermediateResult, ... | joergwicker/autoencoder | src/main/scala/nz/wicker/autoencoder/math/optimization/TerminationCriterion.scala | Scala | gpl-3.0 | 1,110 |
/*
* 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 ... | clarkyzl/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/AggregateITCase.scala | Scala | apache-2.0 | 44,812 |
package li.cil.cc
import java.util
import java.util.concurrent.ConcurrentLinkedQueue
import codechicken.nei.guihook.{GuiContainerManager, IContainerTooltipHandler}
import codechicken.nei.recipe.{GuiCraftingRecipe, TemplateRecipeHandler}
import codechicken.nei.{NEIClientUtils, NEIServerUtils, PositionedStack}
import c... | fnuecke/CraftingCosts | src/main/scala/li/cil/cc/ClientProxy.scala | Scala | mit | 15,951 |
/*
* Copyright (c) 2014 Paul Bernard
*
* 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... | quantintel/spectrum | financial/src/main/scala/org/quantintel/ql/instruments/options/ForwardVanillaOption.scala | Scala | apache-2.0 | 820 |
/** *****************************************************************************
* Copyright 2017 Capital One Services, LLC and Bitwise, 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 Licen... | capitalone/Hydrograph | hydrograph.engine/hydrograph.engine.spark/src/test/scala/hydrograph/engine/spark/performance/components/InputOutputDelimeted.scala | Scala | apache-2.0 | 1,815 |
/* Copyright 2009-2018 EPFL, Lausanne */
package inox.utils
import scala.collection.mutable.Builder
import scala.collection.mutable.ArrayBuffer
import scala.collection.Iterable
class IncrementalSeq[A] extends IncrementalState
with Iterable[A]
with Builder[A, Incrementa... | epfl-lara/inox | src/main/scala/inox/utils/IncrementalSeq.scala | Scala | apache-2.0 | 894 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monixio/monix | monix-tail/shared/src/test/scala/monix/tail/IterantBasicSuite.scala | Scala | apache-2.0 | 3,300 |
package com.twitter.finatra.http.filters
import com.twitter.finagle.Service
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finagle.stats.InMemoryStatsReceiver
import com.twitter.inject.Test
import com.twitter.util.{Await, Future}
class StatsFilterTest extends Test {
val statsReceiver = new ... | joecwu/finatra | http/src/test/scala/com/twitter/finatra/http/filters/StatsFilterTest.scala | Scala | apache-2.0 | 849 |
package models
class Mark {
}
| guozhaolong/reading | app/models/Mark.scala | Scala | gpl-2.0 | 32 |
final class MyNeClass(o: MyNeClass) {
val other: MyNeClass = {
if (o ne null) o // o is cold, but ne is always valid
else new MyNeClass(this)
}
}
final class MyEqClass(o: MyEqClass) {
val other: MyEqClass = {
if (o eq null) new MyEqClass(this) // o is cold, but eq is always valid
else o
}
}
| dotty-staging/dotty | tests/init/pos/eq-ne-always-valid.scala | Scala | apache-2.0 | 317 |
package com.ajjpj.adiagram_.geometry.transform
import com.ajjpj.adiagram_.geometry.{Angle, ARect, APoint}
/**
* the semantics of the constructor data structures are as follows:
*
* y = M * x + t
*
* i.e. a point is first multiplied by the transformation matrix and then translated by the translation vector
*
*... | arnohaase/a-diagram | src/main/scala-old/com/ajjpj/adiagram_/geometry/transform/AffineTransformation.scala | Scala | apache-2.0 | 1,513 |
/**
* 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... | dougneedham/spark-timeseries | src/main/scala/com/cloudera/sparkts/TimeSeriesRDD.scala | Scala | apache-2.0 | 11,110 |
package im.tox.antox.callbacks
import android.content.Context
import im.tox.antox.data.AntoxDB
import im.tox.antox.tox.ToxSingleton
import im.tox.antox.wrapper.AntoxFriend
import im.tox.tox4j.core.callbacks.FriendNameCallback
import scala.None
//remove if not needed
object AntoxOnNameChangeCallback {
private val... | afkgeek/Antox | app/src/main/scala/im/tox/antox/callbacks/AntoxOnNameChangeCallback.scala | Scala | gpl-3.0 | 914 |
object Test extends App {
42 match {
case Extractor(a) => println(a)
}
}
| lampepfl/dotty | tests/disabled/macro/run/macro-rangepos-subpatterns/Test_2.scala | Scala | apache-2.0 | 81 |
import org.scalatest._
class ImportDataSpec extends FunSpec with Matchers {
describe("#rateChar") {
it("should match") {
ImportData.rateChar('ビ') should be(ImportData.NoobKyu)
}
}
describe("#rate") {
it("should work for several chars") {
ImportData.rateWord("ビリビリ") should be(Some(ImportD... | mauhiz/kanji-jikan | src/test/scala/ImportDataSpec.scala | Scala | epl-1.0 | 356 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | aliyun/aliyun-emapreduce-sdk | examples/src/main/scala/com/aliyun/emr/examples/streaming/TestDirectLoghub.scala | Scala | artistic-2.0 | 2,963 |
/* Copyright 2009-2011 Jay Conrod
*
* This file is part of Tungsten.
*
* Tungsten 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 of
* the License, or (at your option) any late... | jayconrod/tungsten | core/src/test/scala/tungsten/DataFlowTest.scala | Scala | gpl-2.0 | 2,089 |
/*
* Copyright 2012 Comcast Cable Communications Management, 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 require... | Comcast/money | money-akka/src/main/scala/com/comcast/money/akka/http/MoneyTrace.scala | Scala | apache-2.0 | 8,423 |
package webscalajs
import com.typesafe.sbt.web.PathMapping
import org.scalajs.linker.interface.Report
import org.scalajs.sbtplugin.ScalaJSPlugin
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import sbt.Def.{setting, settingKey, Initialize}
import sbt.Keys._
import sbt._
import webscalajs.ScalaJSStageTasks.on... | vmunier/sbt-web-scalajs | src/main/scala/webscalajs/ScalaJSWeb.scala | Scala | apache-2.0 | 3,891 |
/*
* 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-tail/shared/src/main/scala/monix/tail/internal/IterantIntersperse.scala | Scala | apache-2.0 | 3,943 |
/*
* Copyright (c) 2011-15 Miles Sabin
*
* 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... | TomasMikula/shapeless | core/src/main/scala/shapeless/ops/records.scala | Scala | apache-2.0 | 14,679 |
package assets.mustache.forces
import uk.gov.gds.ier.transaction.forces.openRegister.OpenRegisterMustache
import uk.gov.gds.ier.test._
class OpenRegisterTemplateTest
extends TemplateTestSuite
with OpenRegisterMustache {
it should "properly render all properties from the model" in {
running(FakeApplication... | michaeldfallen/ier-frontend | test/assets/mustache/forces/OpenRegisterTemplateTest.scala | Scala | mit | 1,055 |
/*
* 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-common | jvm/src/main/scala/fm/common/ColorPatternLayoutEncoder.scala | Scala | apache-2.0 | 1,635 |
package com.sksamuel.elastic4s.requests.searches
import com.sksamuel.elastic4s.ext.OptionImplicits._
import scala.concurrent.duration.FiniteDuration
case class SearchScrollRequest(id: String, keepAlive: Option[String] = None) {
def keepAlive(keepAlive: String): SearchScrollRequest = copy(keepAlive = keepAlive.som... | sksamuel/elastic4s | elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/searches/SearchScrollRequest.scala | Scala | apache-2.0 | 439 |
package TAPLcomp.fullequirec
import scala.text.Document
import scala.text.Document._
// outer means that the term is the top-level term
object FullEquiRecPrinter {
import TAPLcomp.Print._
def ptyType(outer: Boolean, ty: Ty): Document = ty match {
case TyRec(x, tyT) =>
g2("Rec " :: x :: "." :/: ptyType... | hy-zhang/parser | Scala/Parser/src/TAPLcomp/fullequirec/syntax.scala | Scala | bsd-3-clause | 4,559 |
private object Foo:
inline def d(arg : Int): Unit = {}
transparent inline def haha() : Unit = {}
export Foo.*
@main def main : Unit = haha()
| dotty-staging/dotty | tests/pos/i13476.scala | Scala | apache-2.0 | 147 |
/*
* Copyright (c) 2012-2014 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.a... | snowplow/aws-lambda-scala-example-project | project/AwsLambdaScalaExampleProjectBuild.scala | Scala | apache-2.0 | 1,493 |
import scala.io.StdIn
object DNA extends App {
val sequence = StdIn.readLine().filter(_ != ' ')
println(sequence map pair mkString " ")
println(sequence grouped 3 map codon mkString " ")
def pair(base: Char): Char = base match {
case 'A' => 'T'
case 'T' => 'A'
case 'G' => 'C'
case 'C' => 'G'
... | ccampo133/daily-programmer | 207-easy/src/DNA.scala | Scala | mit | 1,262 |
package io.iohk.ethereum.utils
import io.iohk.ethereum.domain.UInt256
object BigIntExtensionMethods {
implicit class BigIntAsUnsigned(val srcBigInteger: BigInt) extends AnyVal {
def toUnsignedByteArray: Array[Byte] = {
val asByteArray = srcBigInteger.toByteArray
if (asByteArray.head == 0) asByteArra... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/utils/BigIntExtensionMethods.scala | Scala | mit | 410 |
package code
package snippet
import config.Site
import model.{User, LoginCredentials}
import scala.xml._
import net.liftweb._
import common._
import http.{DispatchSnippet, S, SHtml, StatefulSnippet}
import http.js.JsCmd
import http.js.JsCmds._
import util._
import Helpers._
import net.liftmodules.extras.{Gravatar, ... | eltimn/lift-poly-example | src/main/scala/code/snippet/UserSnips.scala | Scala | apache-2.0 | 6,278 |
import com.bdir.back.app.routes.RouteServlets
import org.scalatra._
import javax.servlet.ServletContext
class ScalatraBootstrap extends LifeCycle with RouteServlets {
override def init(context: ServletContext) {
routes.foreach { route =>
context.mount(route._2, route._1)
}
}
}
| ervitis/bdir-back | src/main/scala/ScalatraBootstrap.scala | Scala | mit | 299 |
package org.scalajs.testsuite.javalib.time
import java.time._
import java.time.temporal._
import org.junit.Test
import org.junit.Assert._
import org.scalajs.testsuite.utils.AssertThrows._
import scala.annotation.tailrec
/** Created by alonsodomin on 24/12/2015. */
class YearTest extends TemporalTest[Year] {
impor... | sjrd/scala-js-java-time | testSuite/shared/src/test/scala/org/scalajs/testsuite/javalib/time/YearTest.scala | Scala | bsd-3-clause | 17,428 |
/**
* All files in this project are distributed using
* an Apache 2.0 licence which you may find at
*
* http://opensource.org/licenses/Apache-2.0
*
* Created by: alanrodas
* Last modification: 06/05/14 at 14:47
*/
package com.alanrodas.fronttier
abstract class VCS(rootDir : String, remoteUrl : String) {
/*
H... | alanrodas/scalaVCS | src/main/scala/com/alanrodas/scalavcs/vcs.scala | Scala | apache-2.0 | 7,995 |
import scala.quoted.*
object Test {
def test(x: quoted.Expr[Int])(using Quotes): Unit = x match {
case '{ type t; 4 } => Type.of[t]
case '{ type t; poly[t]($x); 4 } => // error: duplicate pattern variable: t
case '{ type `t`; poly[`t`]($x); 4 } =>
Type.of[t] // error
case _ =>
}
def poly[T]... | dotty-staging/dotty | tests/neg-macros/quotedPatterns-5.scala | Scala | apache-2.0 | 341 |
package de.htwg.zeta.parser.diagram
import de.htwg.zeta.parser.CommonParserMethods
import de.htwg.zeta.parser.common.CommentParser
import de.htwg.zeta.parser.common.ParseError
object DiagramParser extends CommonParserMethods {
def parseDiagrams(input: String): Either[ParseError, List[DiagramParseTree]] = {
val... | Zeta-Project/zeta | api/parser/src/main/scala/de/htwg/zeta/parser/diagram/DiagramParser.scala | Scala | bsd-2-clause | 1,628 |
package lower_tir
import tir._
import byteR._
object LowerConst {
def apply(const: TConst): List[JVMInstruction] = const match {
case TConstInt(value) => {
// First get the code for loading the value:
List(JVMIPush(value), LowerExp.box(JVMIntPrimitiveType()))
}
case TConstFloat(val... | j-c-w/mlc | src/main/scala/lower_tir/LowerConst.scala | Scala | gpl-3.0 | 807 |
package com.pedrorijo91.yo.model
import com.pedrorijo91.yo.YoGeneralSpec
import play.api.libs.json.Json
class AccountSpec extends YoGeneralSpec {
"Account" should "be correctly parsed from JSON" in {
val apiToken: String = "a2672dbc-d4ea-41d6-8c9e-6870d8474853"
val displayName: String = "WTFPEDRO"
val... | pedrorijo91/yo-scala-client | src/test/scala/com/pedrorijo91/yo/model/AccountSpec.scala | Scala | mit | 1,542 |
package org.bitcoins.core.protocol
import org.bitcoins.core.gen.NumberGenerator
import org.scalacheck.{ Prop, Properties }
/**
* Created by chris on 6/29/16.
*/
class CompactSizeUIntSpec extends Properties("CompactSizeUIntSpec") {
property("Serialization symmetry") =
Prop.forAll(NumberGenerator.compactSizeUI... | Christewart/bitcoin-s-core | src/test/scala/org/bitcoins/core/protocol/CompactSizeUIntSpec.scala | Scala | mit | 430 |
/*
* 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
* distrib... | fusepoolP3/p3-silk | silk-learning/src/main/scala/de/fuberlin/wiwiss/silk/learning/active/linkselector/LinkSelector.scala | Scala | apache-2.0 | 1,611 |
package edu.gemini.rollover.servlet
import edu.gemini.spModel.gemini.obscomp.{SPProgram, SPSiteQuality}
import edu.gemini.spModel.gemini.obscomp.SPSiteQuality._
import edu.gemini.spModel.obs.SPObservation
import edu.gemini.spModel.obs.plannedtime.PlannedTimeCalculator
import edu.gemini.spModel.target.obsComp.TargetObs... | spakzad/ocs | bundle/edu.gemini.spdb.rollover.servlet/src/main/scala/edu/gemini/rollover/servlet/RolloverObservation.scala | Scala | bsd-3-clause | 3,459 |
package org.joda.time.chrono
import java.util.Locale
import org.joda.time.Chronology
import org.joda.time.DateTimeConstants
import org.joda.time.DateTimeField
import org.joda.time.DateTimeFieldType
import org.joda.time.DateTimeZone
import org.joda.time.DurationFieldType
import org.joda.time.chrono.AssembledChronology.... | mdedetrich/soda-time | shared/src/main/scala/org/joda/time/chrono/BasicChronology.scala | Scala | bsd-2-clause | 16,834 |
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.