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 org.http4s import java.io.{File, InputStream, Reader} import java.nio.{ByteBuffer, CharBuffer} import java.nio.file.Path import scala.concurrent.{ExecutionContext, Future} import scala.language.implicitConversions import org.http4s.EntityEncoder._ import org.http4s.headers.{`Transfer-Encoding`, `Content-Type...
hvesalai/http4s
core/src/main/scala/org/http4s/EntityEncoder.scala
Scala
apache-2.0
8,522
package mesosphere.marathon.core.launcher import org.rogach.scallop.ScallopConf trait OfferProcessorConfig extends ScallopConf { lazy val offerMatchingTimeout = opt[Int]( "offer_matching_timeout", descr = "Offer matching timeout (ms). Stop trying to match additional tasks for this offer after this time.", ...
timcharper/marathon
src/main/scala/mesosphere/marathon/core/launcher/OfferProcessorConfig.scala
Scala
apache-2.0
978
/* * Copyright 2011-2018 Chris de Vreeze * * 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...
dvreeze/nta
src/main/scala/eu/cdevreeze/nta/ntarule/rules_2_02/Validator_2_02_00_10.scala
Scala
apache-2.0
3,528
package spark.streaming.examples import spark.streaming.{Seconds, StreamingContext} import spark.storage.StorageLevel import com.twitter.algebird._ import spark.streaming.StreamingContext._ import spark.SparkContext._ /** * Illustrates the use of the Count-Min Sketch, from Twitter's Algebird library, to compute * w...
pxgao/spark-0.7.3
examples/src/main/scala/spark/streaming/examples/TwitterAlgebirdCMS.scala
Scala
bsd-3-clause
3,867
package amailp.intellij.robot.psi import com.intellij.psi._ import com.intellij.lang.ASTNode import com.intellij.extapi.psi.ASTWrapperPsiElement import amailp.intellij.robot.findUsage.UsageFindable import amailp.intellij.robot.psi.reference.KeywordToDefinitionReference import amailp.intellij.robot.psi.utils.RobotPsiUt...
AmailP/robot-plugin
src/main/scala/amailp/intellij/robot/psi/Keyword.scala
Scala
gpl-3.0
1,569
package com.twitter.finagle.mux import com.twitter.concurrent.AsyncQueue import com.twitter.finagle.context.Contexts import com.twitter.finagle.mux.lease.exp.Lessor import com.twitter.finagle.netty3.{ChannelBufferBuf, BufChannelBuffer} import com.twitter.finagle.stats.NullStatsReceiver import com.twitter.finagle.traci...
cogitate/twitter-finagle-uuid
finagle-mux/src/test/scala/com/twitter/finagle/mux/ClientServerTest.scala
Scala
apache-2.0
10,009
package io.udash.demos.jquery.views.functions import io.udash.demos.jquery.views.FunctionView import io.udash.wrappers.jquery._ /** Based on examples from: <a href="http://api.jquery.com/animate/">jQuery Docs</a>. */ object AppendPrependView extends FunctionView { import scalatags.JsDom.all._ override protected...
UdashFramework/scala-js-jquery
example/src/main/scala/io/udash/demos/jquery/views/functions/AppendPrependView.scala
Scala
apache-2.0
626
/* * 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 ...
jnhagelberg/incubator-atlas
typesystem/src/test/scala/org/apache/atlas/typesystem/builders/MultiplicityTest.scala
Scala
apache-2.0
3,562
/** * Copyright 2015 Devon Miller * * 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...
aappddeevv/scala-vdom
shared/src/main/scala/im/vdom/backend/Utils.scala
Scala
apache-2.0
6,316
package controller import skinny.filter.TxPerRequestFilter class MustacheController extends ApplicationController with TxPerRequestFilter { def index = { set("echo" -> params.get("echo")) render("/mustache/index") } }
BlackPrincess/skinny-framework
example/src/main/scala/controller/MustacheController.scala
Scala
mit
234
/* * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * 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 Fou...
lidijaf/Relite
test-src/Nbody.scala
Scala
agpl-3.0
5,203
import akka.dispatch._ import akka.actor._ import java.util.concurrent.Executors import java.util.concurrent.CountDownLatch object Main extends App { def waitABit(latch: CountDownLatch) = new Runnable() { override def run() = { Future.blocking() Thread.sleep(100) // use...
havocp/beaucatcher
channel/src/test/scala/Sleeps.scala
Scala
apache-2.0
1,475
/* * 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 ...
Dax1n/spark-core
core/src/test/scala/org/apache/spark/scheduler/FakeTask.scala
Scala
apache-2.0
1,691
package org.jetbrains.plugins.hocon.highlight import com.intellij.lexer.{LayeredLexer, StringLiteralLexer} import com.intellij.openapi.editor.colors.TextAttributesKey import com.intellij.openapi.fileTypes.{SyntaxHighlighter, SyntaxHighlighterFactory} import com.intellij.openapi.project.Project import com.intellij.open...
ghik/intellij-hocon
src/org/jetbrains/plugins/hocon/highlight/HoconSyntaxHighlighter.scala
Scala
apache-2.0
2,421
package org.jetbrains.plugins.scala package lang package parser package parsing package patterns import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder import org.jetbrains.plugins.scala.lang.parser.parsing.expressions.Literal import...
ilinum/intellij-scala
src/org/jetbrains/plugins/scala/lang/parser/parsing/patterns/SimplePattern.scala
Scala
apache-2.0
8,010
/* * 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...
diegohurtado/sparta
examples/parser/src/main/scala/com/stratio/sparta/CustomDateParser.scala
Scala
apache-2.0
4,294
/* * Licensed to STRATIO (C) under one or more contributor license agreements. * See the NOTICE file distributed with this work for additional information * regarding copyright ownership. The STRATIO (C) licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file...
Stratio/stratio-connector-sparkSQL
connector-sparksql/src/main/scala/com/stratio/connector/sparksql/core/engine/query/QueryExecutor.scala
Scala
apache-2.0
7,613
package io.toolsplus.atlassian.connect.play.auth.jwt import io.toolsplus.atlassian.jwt.api.CanonicalHttpRequest import play.api.mvc.Request case class CanonicalPlayHttpRequest[A](request: Request[A]) extends CanonicalHttpRequest { override def method: String = request.method override def relativePath: String...
toolsplus/atlassian-connect-play
modules/core/app/io/toolsplus/atlassian/connect/play/auth/jwt/CanonicalPlayHttpRequest.scala
Scala
apache-2.0
415
package bot.application import akka.http.scaladsl.server.Directives._ import akka.http.scaladsl.server.{Directive0, Route, ValidationRejection} import bot.line.client.SignatureVerifier import bot.line.json.EventsJsonSupport import bot.line.model.event.{Event, Events} trait BaseLineBot[T] extends EventsJsonSupport { ...
xoyo24/akka-http-line-bot
src/main/scala/bot/application/BaseLineBot.scala
Scala
mit
906
case class SpaceAge(seconds: Long) { def onEarth(): Double = ((seconds + 0.005) / 31557600.0 * 100 round) / 100.0 def onMercury(): Double = ((seconds + 0.005) / 31557600.0 / 0.2408467 * 100 round) / 100.0 def onVenus(): Double = ((seconds + 0.005) / 31557600.0 / 0.61519726 * 100 round) / 100.0 def onMar...
stanciua/exercism
scala/space-age/src/main/scala/SpaceAge.scala
Scala
mit
783
package chess import chess.Pos._ import chess.variant.FromPosition class CastleTest extends ChessTest { "king side" should { val goodHist = """ PPPPPPPP R QK R""" val badHist = goodHist updateHistory (_ withoutCastles White) "impossible" in { "standard chess" in { "near bishop in the w...
ornicar/scalachess
src/test/scala/CastleTest.scala
Scala
mit
8,670
/* * 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 ...
yew1eb/flink
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/batch/table/TableSinkITCase.scala
Scala
apache-2.0
2,474
package net.gadgil.finance.portfolio import org.specs2.mutable._ class PortfolioToolsSpecification extends Specification { "portfolio parser" should { val theDefinition = """ portfolio pf1 long THRM USD 10000 on 2010-12-14 at 11.14 long LKQ USD 10000 on 2010-12-14 at 23.20 stop loss 50% ...
navaidya/optionpricing
finance.portfolio/src/test/scala/PortfolioTools.scala
Scala
mit
747
/* * Copyright 2016 University of Basel, Graphics and Vision Research Group * * 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 * * Unl...
unibas-gravis/scalismo
src/main/scala/scalismo/sampling/evaluators/ProductEvaluator.scala
Scala
apache-2.0
1,881
/* * Copyright (C) 2016 Language Technology Group and Interactive Graphics Systems Group, Technische Universität Darmstadt, Germany * * 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, ...
tudarmstadt-lt/newsleak-frontend
app/models/Document.scala
Scala
agpl-3.0
1,656
package com.verisign.hio import com.typesafe.config.ConfigFactory import com.verisign.hio.commands.{Acat, Ahead} import org.apache.hadoop.fs.Path import org.apache.hadoop.hdfs.HdfsConfiguration import scala.language.reflectiveCalls object Main { private val appConf = ConfigFactory.load() private val hadoopConf...
verisign/hio
src/main/scala/com/verisign/hio/Main.scala
Scala
apache-2.0
1,844
package parsing.ir import parsing.multi.Lexer._ import parsing.multi.LookaheadLexer._ /** * Created by hongdi.ren. */ abstract class Lexer(input: String) { var p: Int = 0 var c: Char = input.charAt(p) def consume(): Unit = { p = p + 1 if (p >= input.length) c = EOF else c = input.charAt(p) ...
Ryan-Git/LangImplPatterns
src/main/scala/parsing/ir/IRLexer.scala
Scala
apache-2.0
1,859
package net.revenj.serialization import scala.collection.mutable import scala.util.Try object Queries { trait CommandQuery[T <: net.revenj.patterns.Command] { def from(input: Array[Byte], len: Int, contentType: String, arguments: Map[String, String]): Try[T] def from(input: java.io.InputStream, contentTyp...
ngs-doo/revenj
scala/revenj-core/src/main/scala/net/revenj/serialization/Queries.scala
Scala
bsd-3-clause
668
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved. package io.fsq.hfile.writer.concrete import io.fsq.hfile.writer.service.CompressionAlgorithm import java.io.{BufferedOutputStream, FilterOutputStream, OutputStream} import org.apache.hadoop.conf.{Configurable, Configuration} import org.apache.hadoop.io.compr...
foursquare/fsqio
src/jvm/io/fsq/hfile/writer/concrete/ConcreteCompressionAlgorithm.scala
Scala
apache-2.0
3,148
/* * Copyright 2017 TWO SIGMA OPEN SOURCE, 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...
jpallas/beakerx
kernel/scala/src/test/scala/com/twosigma/beakerx/scala/chart/xychart/plotitem/BarsTest.scala
Scala
apache-2.0
1,856
/* * 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.reflect.reify pa...
martijnhoekstra/scala
src/compiler/scala/reflect/reify/phases/Reshape.scala
Scala
apache-2.0
17,675
object Test { val m = scala.collection.mutable.MultiMap(1, 2, 3) }
folone/dotty
tests/untried/neg/noMember2.scala
Scala
bsd-3-clause
69
package collins.controllers.actions.state import scala.concurrent.Future import play.api.data.Form import play.api.data.Forms.ignored import play.api.data.Forms.tuple import play.api.libs.concurrent.Execution.Implicits.defaultContext import collins.controllers.Api import collins.controllers.SecureController import c...
funzoneq/collins
app/collins/controllers/actions/state/CreateAction.scala
Scala
apache-2.0
4,585
package l1distopt.utils import breeze.linalg.{DenseVector, NumericOps, SparseVector, Vector} import org.apache.spark.rdd.RDD import org.apache.spark.SparkContext import scala.math._ object OptUtils { /** * Loads data stored in LIBSVM format columnwise (i.e., by feature) * Used for storing training dataset ...
gingsmith/proxcocoa
src/main/scala/utils/OptUtils.scala
Scala
apache-2.0
5,055
import generic.* import Tree.* import List.* import java.io.* import Shapes.* import SearchResult.* object Test { import Serialization.* private var lCount, tCount, sCount = 0 // ------- Code that will eventually be produced by macros ------------- implicit def ListSerializable[Elem](implicit es: Serializable...
dotty-staging/dotty
tests/run/generic/Test.scala
Scala
apache-2.0
2,182
/* * Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file * * 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)...
Tensei-Data/tensei-agent
src/test/scala/com/wegtam/tensei/agent/writers/DatabaseWriterFunctionsTest.scala
Scala
agpl-3.0
15,110
package models import org.joda.time.DateTime import scalikejdbc._ case class CronLine( id: Long, cronId: Long, line: Option[Int] = None, body: Option[String] = None, command: Option[String] = None, month: Option[String] = None, day: Option[String] = None, week: Option[String] = None, hour: Option[St...
akyao/ketsuco
app/models/CronLine.scala
Scala
mit
5,904
/** * 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/test/com/mohiva/play/silhouette/impl/providers/oauth1/LinkedInProviderSpec.scala
Scala
apache-2.0
4,890
/** * Copyright 2014 Gianluca Amato <gamato@unich.it> * * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains * JANDOM 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 o...
rubino22/JDBeta
core/src/test/scala/it/unich/jandom/parsers/NumericExpressionParserSuite.scala
Scala
lgpl-3.0
2,130
/* Copyright 2016 ScalABM 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 distribu...
EconomicSL/agora
src/main/scala/org/economicsl/agora/markets/auctions/orderbooks/package.scala
Scala
apache-2.0
610
package eu.daxiongmao.training.scala.chp2 import scala.io.Source object ReadFile { def main (args: Array[String] ) { // Read content of the file provided by args(0) if (args.length > 0) { readFileContent(args(0)) } else { Console.err.println("You must provide a filename (absolute path) to re...
guihome-diaz/training
progInScala/src/main/scala/eu/daxiongmao/training/scala/chp2/ReadFile.scala
Scala
gpl-2.0
485
/* * 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 ...
shaneknapp/spark
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/json/JacksonParserSuite.scala
Scala
apache-2.0
2,431
/** * Licensed to Big Data Genomics (BDG) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The BDG licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use ...
laserson/adam
adam-core/src/test/scala/org/bdgenomics/adam/projections/RecordGroupMetadataFieldSuite.scala
Scala
apache-2.0
2,845
package org.jetbrains.plugins.scala.project import java.util.concurrent.ConcurrentHashMap import com.intellij.openapi.components.AbstractProjectComponent import com.intellij.openapi.project.Project /** * @author Pavel Fatin */ class ScalaProjectCache(project: Project, events: ScalaProjectEvents) extends AbstractPr...
triggerNZ/intellij-scala
src/org/jetbrains/plugins/scala/project/ScalaProjectCache.scala
Scala
apache-2.0
879
package fr.njin.playoauth.common.domain import fr.njin.playoauth.common.request.AuthzRequest import scala.concurrent.Future /** * Represents the permission granted by the resource owner to a client. * * When issuing a code or a token, the authorization server will ask * to the resource owner the permission. The a...
giabao/play-oauth
common/src/main/scala/fr/njin/playoauth/common/domain/OauthPermission.scala
Scala
apache-2.0
1,654
package fpinscala.parsing import org.scalatest.{FlatSpec, Matchers} class ParserSpec extends FlatSpec with Matchers { }
ailveen/fpinscala
exercises/src/test/scala/fpinscala/parsing/ParserSpec.scala
Scala
mit
123
import sbt._ import Keys._ import Project.Initialize trait Marker { final lazy val Mark = TaskKey[Unit]("mark") final def mark: Initialize[Task[Unit]] = mark(baseDirectory) final def mark(project: Reference): Initialize[Task[Unit]] = mark(baseDirectory in project) final def mark(baseKey: SettingKey[File]): Initial...
mdedetrich/sbt
sbt/src/sbt-test/actions/aggregate/project/Marker.scala
Scala
bsd-3-clause
486
package eventstore package akka import io.circe._ import ProjectionsClient.{ProjectionMode, ProjectionStatus} import scala.util.Try object ProjectionDetails { implicit val decoderForProjectionStatus: Decoder[ProjectionStatus] = Decoder[String].map(s => ProjectionStatus(s)) implicit val decoderForProjection...
EventStore/EventStore.JVM
client/src/main/scala/eventstore/akka/ProjectionDetails.scala
Scala
bsd-3-clause
1,103
package eu.brosbit.opos.snippet.view import _root_.net.liftweb.util._ import Helpers._ import net.liftweb.json.JsonDSL._ import eu.brosbit.opos.lib.{Formater, ZeroObjectId} import java.util.Date import eu.brosbit.opos.model.edu.{Exam, ExamAnswer, Work, WorkAnswer} class ExamsSn extends BaseSnippet { def showEx...
mikolajs/osp
src/main/scala/eu/brosbit/opos/snippet/view/ExamsSn.scala
Scala
agpl-3.0
2,449
package supertaggedtests.tagged import org.scalatest.matchers.should.Matchers import org.scalatest.flatspec.AnyFlatSpec import shapeless.test.illTyped class Implicits extends AnyFlatSpec with Matchers { "Implicit Ops" should "work without imports" in { val step1 = Step1(5) step1.next() shouldBe 6 } ...
Rudogma/scala-supertagged
tests/src/test/scala/supertaggedtests/tagged/Implicits.scala
Scala
mit
524
/* * 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...
Myllyenko/incubator-toree
protocol/src/test/scala/org/apache/toree/kernel/protocol/v5/content/InspectRequestSpec.scala
Scala
apache-2.0
2,640
package debop4s.timeperiod.timerange import debop4s.timeperiod._ import debop4s.timeperiod.tests.AbstractTimeFunSuite import debop4s.timeperiod.utils.Times class DayRangeFunSuite extends AbstractTimeFunSuite { test("initValues") { val currentTime = Times.now val firstDay = Times.startTimeOfDay(currentTime)...
debop/debop4s
debop4s-timeperiod/src/test/scala/debop4s/timeperiod/timerange/DayRangeFunSuite.scala
Scala
apache-2.0
2,155
package lila.opening import org.goochjs.glicko2._ import org.joda.time.DateTime import reactivemongo.bson.{ BSONDocument, BSONInteger, BSONDouble } import lila.db.Types.Coll import lila.rating.{ Glicko, Perf } import lila.user.{ User, UserRepo } private[opening] final class Finisher( api: OpeningApi, opening...
danilovsergey/i-bur
modules/opening/src/main/Finisher.scala
Scala
mit
2,793
package org.scaladebugger.api.profiles.traits.info.events import com.sun.jdi.event.MethodExitEvent import org.scaladebugger.api.profiles.traits.info.{MethodInfo, ValueInfo} /** * Represents the interface that needs to be implemented to provide * an abstraction over the JDI method exit event interface. */ trait Met...
ensime/scala-debugger
scala-debugger-api/src/main/scala/org/scaladebugger/api/profiles/traits/info/events/MethodExitEventInfo.scala
Scala
apache-2.0
816
/** * Copyright 2014 Gianluca Amato <gamato@unich.it> * * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains * JANDOM 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 o...
rubino22/JDBeta
core/src/main/scala/it/unich/jandom/parsers/NumericExpressionParser.scala
Scala
lgpl-3.0
2,620
package com.oradian.autofuture import scala.meta._ import scala.meta.parsers.Parsed.{Error, Success} import scala.meta.tokens.Token object AdaptTupleArgumentsExplicitly extends AutoFuture { private[this] case class Injection(open: Int, close: Int) { require(open < close, "Open offest must be lower than close of...
oradian/sbt-auto-future
core/src/main/scala/com/oradian/autofuture/AdaptTupleArgumentsExplicitly.scala
Scala
mit
2,189
/* * 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 ...
hequn8128/flink
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/rules/logical/DecomposeGroupingSetRule.scala
Scala
apache-2.0
5,219
package io.getquill.context.sql.dsl import io.getquill.Query import io.getquill.context.sql.SqlContext trait SqlDsl { this: SqlContext[_, _] => implicit class Like(s1: String) { def like(s2: String) = quote(infix"$s1 like $s2".as[Boolean]) } implicit class ForUpdate[T](q: Query[T]) { def forUpdate()...
getquill/quill
quill-sql/src/main/scala/io/getquill/context/sql/dsl/SqlDsl.scala
Scala
apache-2.0
370
package com.monsanto.stats.tables.models /** * Sparse vector of counts per user. */ case class ClusteredUserVector(userId: Long, counts: Map[Long,Long], belongProbability: Double)
MonsantoCo/chinese-restaurant-process
src/main/scala/com/monsanto/stats/tables/models/ClusteredUserVector.scala
Scala
bsd-3-clause
183
import fpinscala.state._ import org.scalatest._ import org.scalatest.prop._ import org.scalacheck._ class StateSpec extends FlatSpec with Matchers with PropertyChecks { "RNG's nonNegativeInt" should "have produce a nonNegativeInt and a new RNG" in { def generateNrandomNumber(n: Int, rng: RNG): (Int, RNG) = { ...
enpassant/fpinscala
exercises/src/test/scala/fpinscala/state/StateSpec.scala
Scala
mit
1,290
package com.twitter.finagle.util import com.twitter.util.TimeConversions._ import com.twitter.util.{Timer, TimerTask} import java.util.Collections import java.util.concurrent.atomic.AtomicInteger import org.jboss.netty.{util => nu} import org.junit.runner.RunWith import org.mockito.ArgumentCaptor import org.mockito.Ma...
koshelev/finagle
finagle-netty3/src/test/scala/com/twitter/finagle/util/HashedWheelTimerTest.scala
Scala
apache-2.0
2,091
/* ** Copyright [2013-2016] [Megam Systems] ** ** 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...
meglytics/bidi
app/models/json/analytics/ConnectorsSerialization.scala
Scala
mit
2,996
/* * 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/execution/datasources/SchemaPruning.scala
Scala
apache-2.0
8,284
/* * Scala.js (https://www.scala-js.org/) * * Copyright EPFL. * * Licensed under Apache License 2.0 * (https://www.apache.org/licenses/LICENSE-2.0). * * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ // scalastyle:off line.size.limit /* * Ported...
scala-js/scala-js
test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/math/BigIntegerDivideTest.scala
Scala
apache-2.0
19,076
/* * Copyright 2012-2013 Eligotech BV. * * 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 ...
eligosource/eventsourced
es-journal/es-journal-leveldb/src/test/scala/org/eligosource/eventsourced/journal/leveldb/LeveldbJournalSpec.scala
Scala
apache-2.0
2,786
///* // * (C) 2014 Jacob Lorensen, jacoblorensen@gmail.com // */ // //package org.zapto.jablo.myml // //import org.junit._ //import Assert._ //import TestHelper.calc //import TestHelper.e //import TestHelper.check //import TestHelper.reparse // //class RatExpressionTest { // @Before // def setUp: Unit = { // } // //...
jablo/myml
src/test/scala/org/zapto/jablo/myml_later/RatExpressionTest.scala
Scala
artistic-2.0
1,019
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
dbtsai/spark
core/src/main/scala/org/apache/spark/util/JsonProtocol.scala
Scala
apache-2.0
58,986
/* * Artificial Intelligence for Humans * Volume 2: Nature Inspired Algorithms * Java Version * http://www.aifh.org * http://www.jeffheaton.com * * Code repository: * https://github.com/jeffheaton/aifh * * Copyright 2014 by Jeff Heaton * * Licensed under the Apache License, Version 2.0 (the "License"); * y...
PeterLauris/aifh
vol2/vol2-scala-examples/src/main/scala/com/heatonresearch/aifh/genetic/trees/MutateTree.scala
Scala
apache-2.0
2,255
package colossus.metrics import akka.actor.SupervisorStrategy._ import akka.actor.{OneForOneStrategy, _} import colossus.metrics.IntervalAggregator.{RegisterReporter, ReportMetrics} import colossus.metrics.logging.ColossusLogging import scala.concurrent.duration._ trait TagGenerator { def tags: TagMap } /** * C...
tumblr/colossus
colossus-metrics/src/main/scala/colossus/metrics/StatReporter.scala
Scala
apache-2.0
3,913
/* * 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 ...
hequn8128/flink
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/batch/BatchExecExchange.scala
Scala
apache-2.0
8,025
/* * Copyright (c) 2014-2020 by The Monix Project Developers. * See the project homepage at: https://monix.io * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache...
alexandru/monifu
monix-tail/shared/src/main/scala/monix/tail/batches/BytesBatch.scala
Scala
apache-2.0
1,770
/** * Copyright 2009 Google 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...
whackpad/whackpad
infrastructure/net.appjet.ajstdlib/timer.scala
Scala
apache-2.0
2,239
package com.twitter.scalding.typed import org.scalatest.FunSuite import com.twitter.scalding.typed.functions.EqTypes class ResolverTest extends FunSuite { class Key[A] class Value[A] val k1 = new Key[Int] val k2 = new Key[Int] val k3 = new Key[Int] val v1 = new Value[Int] val v2 = new Value[Int] va...
twitter/scalding
scalding-core/src/test/scala/com/twitter/scalding/typed/ResolverTest.scala
Scala
apache-2.0
2,182
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
hongyuhong/flink
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/datastream/DataStreamValues.scala
Scala
apache-2.0
2,946
package com.stripe.bonsai trait FullBinaryTreeOps[T, BL, LL] extends TreeOps[T, Either[BL, LL]] { override def reduce[A](node: Node)(f: (Either[BL, LL], Iterable[A]) => A): A = foldNode(node)({ (lbl, lc, rc) => f(Left(lbl), reduce(lc)(f) :: reduce(rc)(f) :: Nil) }, lbl => f(Right(lbl), Nil)) def fo...
stripe/bonsai
bonsai-core/src/main/scala/com/stripe/bonsai/FullBinaryTreeOps.scala
Scala
mit
1,113
/** * Licensed to Big Data Genomics (BDG) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The BDG licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use ...
massie/adam
adam-cli/src/test/scala/org/bdgenomics/adam/cli/TransformFeaturesSuite.scala
Scala
apache-2.0
2,219
package org.sbtidea.test.util import sbt._ import org.apache.commons.io.FileUtils.listFiles import org.apache.commons.io.FilenameUtils.removeExtension import scala.xml.Utility.trim import xml._ import collection.JavaConverters._ import xml.transform.{RewriteRule, RuleTransformer} import xml.Node import org.sbtidea.Sys...
mpeltonen/sbt-idea
src/main/scala/org/sbtidea/test/util/AbstractScriptedTestBuild.scala
Scala
bsd-3-clause
5,531
package org.openmole.core.workflow.domain import scala.annotation.implicitNotFound /** * Property of having a size for a domain * @tparam D */ @implicitNotFound("${D} is not a sized variation domain") trait DomainSize[-D] { def apply(domain: D): Int }
openmole/openmole
openmole/core/org.openmole.core.workflow/src/main/scala/org/openmole/core/workflow/domain/DomainSize.scala
Scala
agpl-3.0
259
/* * 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 ...
Dax1n/spark-core
core/src/main/scala/org/apache/spark/api/python/PythonUtils.scala
Scala
apache-2.0
2,077
// import fpinscala.datastructures._ //instead... copying all the boiler plate code. sealed trait List[+A] // `List` data type, parameterized on a type, `A` case object Nil extends List[Nothing] // A `List` data constructor representing the empty list case class Cons[+A](head: A, tail: List[A]) extends List[A] // An...
scottleedavis/scala-musings
match_expression.scala
Scala
mit
2,966
package com.twitter.finatra.http.tests.integration.messagebody.main.domain import com.twitter.finatra.http.annotations.QueryParam case class GreetingRequest(@QueryParam name: String)
twitter/finatra
http-server/src/test/scala/com/twitter/finatra/http/tests/integration/messagebody/main/domain/GreetingRequest.scala
Scala
apache-2.0
185
package com.wavesplatform.network import com.wavesplatform.block.Block import com.wavesplatform.history.History import com.wavesplatform.network.HistoryReplier._ import com.wavesplatform.settings.SynchronizationSettings import com.wavesplatform.utils.ScorexLogging import io.netty.channel.ChannelHandler.Sharable import...
wavesplatform/Waves
node/src/main/scala/com/wavesplatform/network/HistoryReplier.scala
Scala
mit
2,313
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
mike0sv/spark
core/src/test/scala/org/apache/spark/rdd/PartitionPruningRDDSuite.scala
Scala
apache-2.0
2,481
/** * Swaggy Jenkins * Jenkins API clients generated from Swagger / Open API specification * * The version of the OpenAPI document: 1.1.2-pre.0 * Contact: blah@cliffano.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not ed...
cliffano/swaggy-jenkins
clients/scala-sttp/generated/src/main/scala/org/openapitools/client/model/PipelineRunartifacts.scala
Scala
mit
545
// // $Id$ // // Wiggle - a 2D game development library - http://code.google.com/p/wiggle/ // Copyright 2008-2010 Michael Bayne // Distributed under the "Simplified BSD License" in LICENSE.txt package wiggle.input import wiggle.app.Entity import wiggle.util.Task /** * Maintains groups of key bindings where only one...
zdevzee/wiggle
src/main/scala/wiggle/input/DPad.scala
Scala
bsd-3-clause
3,558
/* * La Trobe University - Distributed Deep Learning System * Copyright 2015 Matthias Langer (t3l@threelights.de) * * 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.apa...
bashimao/ltudl
blaze/src/main/scala/edu/latrobe/blaze/modules/Benchmark.scala
Scala
apache-2.0
7,407
package scife.enumeration.testcases import org.scalatest._ import org.scalatest.prop._ import org.scalatest.matchers._ import scife.enumeration._ import dependent._ import scife.{ enumeration => e } import memoization._ import scife.util._ import structures.BSTrees._ import org.scalatest._ import org.scalameter.api...
kaptoxic/SciFe
src/test/scala/scife/enumeration/testcases/ClassInterfaceDAGTest.scala
Scala
gpl-2.0
12,673
package com.kakashi.simpleservices import spray.httpx.Json4sJacksonSupport import org.json4s._ import java.util.UUID object Json4sSupport extends Json4sJacksonSupport { implicit def json4sJacksonFormats: Formats = jackson.Serialization.formats(NoTypeHints) + new UUIDFormat //so you don't need to import //jack...
freeservices/simpleservices
src/main/scala/com/kakashi/simpleservices/Json4sSupport.scala
Scala
mit
848
/* * Copyright 2001-2013 Artima, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
travisbrown/scalatest
src/test/scala/org/scalatest/WordSpecMixedInMatchersSpec.scala
Scala
apache-2.0
1,275
package scorex.wallet import java.io.File import com.google.common.primitives.{Bytes, Ints} import org.h2.mvstore.{MVMap, MVStore} import scorex.account.PrivateKeyAccount import scorex.crypto.encode.Base58 import scorex.crypto.hash.SecureCryptographicHash import scorex.utils.{LogMVMapBuilder, ScorexLogging, randomByte...
B83YPoj/Waves
src/main/scala/scorex/wallet/Wallet.scala
Scala
apache-2.0
4,093
// Wei Chen - Regression // 2018-09-12 package com.scalaml.algorithm trait Regression extends Algorithm { val algotype: String = "Regression" def train(data: Array[(Double, Array[Double])]): Boolean def predict(data: Array[Array[Double]]): Array[Double] }
Wei-1/Scala-Machine-Learning
src/main/scala/algorithm/regression/Regression.scala
Scala
mit
269
package tech.sda.arcana.spark.classification.cnn import com.intel.analytics.bigdl.nn._ import com.intel.analytics.bigdl._ import org.apache.spark.SparkContext import org.apache.spark.sql.SQLContext import com.intel.analytics.bigdl.utils.Engine /** A class to build or initialize SparkContext depending on BigDl configur...
SmartDataAnalytics/ARCANA
src/main/scala/tech/sda/arcana/spark/classification/cnn/SparkBigDlInitializer.scala
Scala
gpl-3.0
1,283
/** * 打印XHTML文件中所有图像的名称,即打印所有位于img元素内的src属性值 */ import scala.xml.XML var html = "<html><head><title>第一个网页</title></head><body><p><img alt='a'><img src='1'></img></p></body></html>" val images = (html \\\\ "img").flatMap(_.attributes("src")) val images1 = html match{ case n @ <img/> => Some(n.attributes("src")) } ...
vernonzheng/scala-for-the-Impatient
src/Chapter16/exercise05.scala
Scala
mit
447
/* * 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/paxos/AcceptorSpec.scala
Scala
apache-2.0
2,094
package objsets object TweetReader { object ParseTweets { import scala.util.parsing.json._ def getList[T](s: String): List[T] = JSON.parseFull(s).get.asInstanceOf[List[T]] def getMap(s: String): Map[String, Any] = JSON.parseFull(s).get.asInstanceOf[Map[String, Any]] def getTweets(user: String,...
rranelli/RRFPPScala
@Assignments/week3/objsets/src/main/scala/objsets/TweetReader.scala
Scala
unlicense
3,175
package reforest.data.tree /** * It represents how a node can be recognized in all the forests * @param forestId the forest identifier of the node * @param treeId the tree identifier in the forest of the node * @param nodeId the node identifier in the tree of the node */ case class NodeId(val forestId : Int,...
alessandrolulli/reforest
src/main/scala/reforest/data/tree/NodeId.scala
Scala
apache-2.0
361
package net.sansa_stack.rdf.spark.model.df import net.sansa_stack.rdf.spark.io.fromRow import org.apache.jena.graph.Triple import org.apache.spark.rdd.RDD import org.apache.spark.sql._ /** * Spark/DataFrame based implementation of DataFrame of triples. * * @author Gezim Sejdiu * @author Lorenz Buehmann */ objec...
SANSA-Stack/SANSA-RDF
sansa-rdf/sansa-rdf-spark/src/main/scala/net/sansa_stack/rdf/spark/model/df/TripleOps.scala
Scala
apache-2.0
8,816
/* Slf4jSupportSpec.scala * * Copyright (c) 2013-2014 linkedin.com * Copyright (c) 2013-2014 zman.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/li...
zmanio/atmos
src/test/scala/atmos/dsl/Slf4jSupportSpec.scala
Scala
apache-2.0
1,857
package com.krux.hyperion.activity import com.krux.hyperion.HyperionContext import com.krux.hyperion.adt.{HBoolean, HS3Uri, HString} import com.krux.hyperion.common.{BaseFields, PipelineObjectId} import com.krux.hyperion.expression.RunnableObject import com.krux.hyperion.resource.{Ec2Resource, Resource} /** * The s...
sethyates/hyperion
contrib/activity/definition/src/main/scala/com/krux/hyperion/activity/PgpDecryptActivity.scala
Scala
apache-2.0
2,018
package flowlib class RingBuffer[T](backlog: Int) { private def maxBacklog = backlog * 2 private case class State( buffer: Vector[T], seen: Long) private val state = Transactor(State(Vector.empty, 0l)) def offer(t: T): Unit = state.transact { case State(buffer, seen) => val r = if(...
arnolddevos/FlowLib
src/main/scala/flowlib/RingBuffer.scala
Scala
lgpl-2.1
750