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 pl.project13.scala.akka.raft.config import com.typesafe.config.Config import java.util.concurrent.TimeUnit import concurrent.duration._ import akka.actor.Extension class RaftConfig (config: Config) extends Extension { val raftConfig = config.getConfig("akka.raft") val defaultAppendEntriesBatchSize = raf...
ktoso/akka-raft
src/main/scala/pl/project13/scala/akka/raft/config/RaftConfig.scala
Scala
apache-2.0
999
package controllers import javax.inject.Inject import com.mohiva.play.silhouette.api.{ Environment, LogoutEvent, Silhouette } import com.mohiva.play.silhouette.impl.authenticators.CookieAuthenticator import com.mohiva.play.silhouette.impl.providers.SocialProviderRegistry import forms._ import models.User import model...
hectorgool/fara
app/controllers/ApplicationController.scala
Scala
apache-2.0
3,730
/* * 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 ...
zhouyejoe/spark
resource-managers/kubernetes/core/src/test/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterSchedulerBackendSuite.scala
Scala
apache-2.0
5,472
/* * 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/src/test/scala/org/apache/carbondata/spark/testsuite/datacompaction/MajorCompactionWithMeasureSortColumns.scala
Scala
apache-2.0
3,333
/* * Copyright 2010 Michael Fortin <mike@brzy.org> * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
m410/brzy
src/main/scala/org/brzy/webapp/controller/Authenticator.scala
Scala
apache-2.0
835
/* * Scala implementation of Cuckoo hashing. * * Copyright (C) 2010, Alexander Iliev <alex.iliev@gmail.com> * * All rights reserved. * * This code is released under a BSD license. * Please see LICENSE.txt for the full license and disclaimers. * */ package cuckoo import org.scalacheck.Commands import org.sca...
ailiev/cuckooScala
src/test/scala/cuckoo/MapSpecification.scala
Scala
bsd-2-clause
5,641
/* __ *\\ ** ________ ___ / / ___ __ ____ Scala.js Test Suite ** ** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL ** ** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ ** ** /____/\\___/...
japgolly/scala-js
test-suite/js/src/test/scala/org/scalajs/testsuite/compiler/RegressionTest.scala
Scala
bsd-3-clause
14,688
package slamdata.engine import org.threeten.bp.{Instant, Duration} sealed trait Data { def dataType: Type } object Data { case object Null extends Data { def dataType = Type.Null } case class Str(value: String) extends Data { def dataType = Type.Str } sealed trait Bool extends Data { def ...
sellout/slamengine-old
src/main/scala/slamdata/engine/data.scala
Scala
agpl-3.0
1,954
package fr.atelechev.chess.fen2cb.style import org.scalatest.FlatSpec import org.scalatest.Matchers.be import org.scalatest.Matchers.convertToAnyShouldWrapper import java.nio.file.Paths import fr.atelechev.util.ExpectedExceptionCatcher class DiagramPropertiesTestSuite extends FlatSpec with ExpectedExceptionC...
atelechev/fen2chessboard
components/core/src/test/scala/fr/atelechev/chess/fen2cb/style/DiagramPropertiesTestSuite.scala
Scala
mit
1,727
/* * Copyright 2016 Nikolay Smelik * * 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 ...
kerzok/ScalaBot
BotApi/src/main/scala/scalabot/common/message/incoming/IncomingMessage.scala
Scala
apache-2.0
795
/* * 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 ...
mrchristine/spark-examples-dbc
src/main/scala/org/apache/spark/examples/ml/TfIdfExample.scala
Scala
apache-2.0
2,103
package sml.instructions import sml.Machine /** * Multiply the values of 2 registers and store * result in specified register */ case class MulInstruction(label: String, opcode: String, result: Int, op1: Int, op2: Int) extends MathInstruction { /** * @see Instruction#execute(m: Machine) */ override...
BBK-PiJ-2015-67/sdp-portfolio
coursework/cw-one/src/main/scala/sml/instructions/MulInstruction.scala
Scala
unlicense
696
/** * Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.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 * *...
Tjoene/thesis
Case_Programs/gatling-1.4.0/gatling-recorder/src/main/scala/com/excilys/ebi/gatling/recorder/ui/component/SaveConfigurationListener.scala
Scala
gpl-2.0
3,382
/* Copyright (C) 2008-2014 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...
patverga/factorie
src/main/scala/cc/factorie/la/SingletonTensor.scala
Scala
apache-2.0
2,811
/* * Copyright 2015 Heiko Seeberger * * 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...
sbt/sbt-header
src/main/scala/de/heikoseeberger/sbtheader/AutomateHeaderPlugin.scala
Scala
apache-2.0
1,480
import scala.reflect.runtime.universe._ object Test { def foo[T](x: T)(implicit m: TypeTag[T]) { foo(List(x)) } foo(1) foo("abc") foo(List(1, 2, 3)) val x: List[Int] with Ordered[List[Int]] = null foo(x) foo[x.type](x) abstract class C { type T = String; val x: T } val c = new C { val x = "abc"...
loskutov/intellij-scala
testdata/scalacTests/pos/manifest1-new.scala
Scala
apache-2.0
540
/* * Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com> */ package play.it.http import com.typesafe.config.ConfigFactory import play.api.http.{ FlashConfiguration, SecretConfiguration } import play.api.libs.crypto.CookieSignerProvider import play.api.{ BuiltInComponentsFromContext, Configuration, NoH...
Shruti9520/playframework
framework/src/play-integration-test/src/test/scala/play/it/http/FlashCookieSpec.scala
Scala
apache-2.0
5,424
/** * (C) Copyright IBM Corp. 2015 - 2017 * * 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...
SparkTC/spark-bench
cli/src/test/scala/com/ibm/sparktc/sparkbench/workload/ml/LogisticRegressionWorkloadTest.scala
Scala
apache-2.0
3,393
/* * 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-core/src/main/scala/de/fuberlin/wiwiss/silk/util/Table.scala
Scala
apache-2.0
1,972
package lectures package reductions import org.scalameter._ import common._ object ArrayNorm { @volatile var dummy: Int = 0 @volatile var dummy2: Int = 0 val logE = math.log(math.E) def power(x: Int, p: Double): Int = { math.exp(p * math.log(x) / logE).toInt // TODO <-- make everything doubles } de...
twistedgut/scala_coursera
parprog-snippets/src/main/scala/lectures/reductions/ArrayNorm.scala
Scala
gpl-3.0
1,850
package pme.connect4.gui.d2 import pme.connect4.gui.ConnectFourConfig object ConnectFourConfig2D { protected[d2] val paneSize = (800, 880) protected[d2] val gameSize= (784.0, 842.0) protected[d2] val chipRadius = 40 protected[d2] val fieldWidth = ConnectFourConfig2D().fieldWidth def apply() = new ConnectFo...
pme123/scala-connect4
src/main/scala/pme/connect4/gui/d2/ConnectFourConfig2D.scala
Scala
mit
452
/* * 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 ...
witgo/spark
core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
Scala
apache-2.0
40,929
package cc.ferreira.gcal2slack.cli import java.time.LocalDate import cc.ferreira.gcal2slack.BaseSpec import cc.ferreira.gcal2slack.buildinfo.BuildInfo class ActionsSpec extends BaseSpec { "show help" in { val result = ShowHelp.value result should include("gcal-slack-update [options] filename") result...
hugocf/gcal-slack-update
src/test/scala/cc/ferreira/gcal2slack/cli/ActionsSpec.scala
Scala
mit
959
// Project: angulate2 (https://github.com/jokade/angulate2) // Description: // Copyright (c) 2016 Johannes.Kastner <jokade@karchedon.de> // Distributed under the MIT License (see included LICENSE file) package angulate2.http import org.scalajs.dom.Blob import scala.scalajs.js import scala.scalajs.j...
jokade/angulate2
bindings/src/main/scala/angulate2/http/Response.scala
Scala
mit
935
import scala.quoted.* def coroutineImpl(using Quotes): Expr[Any] = '{ new { def state: Int = 0 ${identity('state)} } }
dotty-staging/dotty
tests/pos-macros/i8651a.scala
Scala
apache-2.0
143
/** * Copyright (C) 2015 DANS - Data Archiving and Networked Services (info@dans.knaw.nl) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0...
DANS-KNAW/easy-stage-dataset
lib/src/main/scala/nl.knaw.dans.easy.stage/lib/Constants.scala
Scala
apache-2.0
799
package com.pwootage.metroidprime.dump import java.io.DataInputStream import java.nio.file.{Files, Path, Paths} import com.pwootage.metroidprime.formats.common.{Face, PrimeFileType} import com.pwootage.metroidprime.formats.io.PrimeDataFile import com.pwootage.metroidprime.formats.mlvl.{Area, MLVL} import com.pwootage...
Pwootage/prime-patcher
src/main/scala/com/pwootage/metroidprime/dump/AreaDumper.scala
Scala
gpl-3.0
1,352
package com.khivi.merge object MergeSorted { def apply[T <% Ordered[T]](streams: IndexedSeq[Stream[T]]): Stream[T] = new MergeSorted(streams).toStream } class MergeSorted[T <% Ordered[T]](streams: IndexedSeq[Stream[T]]) { private[this] type SI = (Stream[T], Int) private[this] def getStream(streams: In...
khivi/programming-languages
scala/src/main/scala/merge.scala
Scala
mit
818
package eventstreams.support import akka.actor.{ActorRef, Props} import akka.stream.FlowMaterializer import akka.stream.actor.ActorPublisherMessage.Request import akka.stream.actor._ import akka.stream.scaladsl.{PublisherSource, SubscriberSink} import akka.testkit.{TestKit, TestProbe} import core.sysevents.SyseventOps...
intelix/eventstreams
es-core/es-api/src/test/scala/eventstreams/support/FlowComponentTestContext.scala
Scala
apache-2.0
4,164
/** * Copyright (c) 2016 Intel Corporation  * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *       http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
trustedanalytics/spark-tk
sparktk-core/src/main/scala/org/trustedanalytics/sparktk/graph/internal/ops/ClosenessCentrality.scala
Scala
apache-2.0
2,760
package views.html.forgotpassword import play.templates._ import play.templates.TemplateMagic._ import play.api.templates._ import play.api.templates.PlayMagic._ import models._ import controllers._ import java.lang._ import java.util._ import scala.collection.JavaConversions._ import scala.collection.JavaConverters...
paperlotus/Time-Trotter
target/scala-2.10/src_managed/main/views/html/forgotpassword/displaypassword.template.scala
Scala
apache-2.0
2,621
/* * 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 ...
highfei2011/spark
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesUtils.scala
Scala
apache-2.0
10,762
package sandbox import org.parboiled2._ case class tbl(name: String, columns: Seq[String]) /** * Shows how easy it is to express a grammar in pseudo-BNF using Parboiled2. * @param input * @param columnStart */ case class DdlParser(input: ParserInput, columnStart: String) extends Parser { import DdlParser._ ...
ChrisCoffey/sandbox
src/Parsers.scala
Scala
unlicense
1,467
/* * Copyright 2015 Nicolas Rinaudo * * 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...
nrinaudo/tabulate
libra/src/test/scala/kantan/csv/libra/arbitrary.scala
Scala
mit
761
/* * 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 n...
TiVo/kafka
core/src/main/scala/kafka/raft/KafkaNetworkChannel.scala
Scala
apache-2.0
6,478
/* * Copyright 2015-2020 Noel Welsh * * 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...
underscoreio/doodle
examples/js/src/main/scala/doodle/examples/Ripples.scala
Scala
apache-2.0
2,297
package models.billing import scalaz._ import Scalaz._ import scalaz.effect.IO import scalaz.Validation import scalaz.Validation.FlatMap._ import scalaz.NonEmptyList._ import cache._ import db._ import models.Constants._ import models.base._ import models.tosca.{ KeyValueField, KeyValueList} import io.megam.auth.stac...
indykish/vertice_gateway
app/models/billing/Billingtransactions.scala
Scala
mit
8,743
/* Copyright 2009-2021 EPFL, Lausanne */ import stainless.lang._ object Monads2 { sealed abstract class Option[T] case class Some[T](t: T) extends Option[T] case class None[T]() extends Option[T] def flatMap[T,U](opt: Option[T], f: T => Option[U]): Option[U] = opt match { case Some(x) => f(x) case No...
epfl-lara/stainless
frontends/benchmarks/verification/valid/Monads2.scala
Scala
apache-2.0
1,314
/* * 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 ...
lxsmnv/spark
sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
Scala
apache-2.0
54,621
package lensimpl import org.scalatest.{FunSuite, Matchers} import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks class LensSpec extends FunSuite with Matchers with ScalaCheckDrivenPropertyChecks { import Person._ test("set - get (ADT)") { forAll { (a: Int, p: Person) => ageCC.get(ageCC.set(a, p...
julien-truffaut/LensImpl
core/src/test/scala/lensimpl/LensSpec.scala
Scala
mit
1,315
package fi.proweb.train.model.app import fi.proweb.train.model.AppData import scala.collection.mutable.Map class TrainList extends AppData[TrainList] { var trains = Map[String, Train]() def makeCopy: TrainList = { val trainlist = new TrainList trainlist.trains = Map[String, Train]() trains.fo...
roikonen/MissaJuna
app/fi/proweb/train/model/app/TrainList.scala
Scala
apache-2.0
417
/*** * Copyright 2014 Rackspace US, 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 applica...
wdschei/api-checker
core/src/main/scala/com/rackspace/com/papi/components/checker/handler/ResultHandler.scala
Scala
apache-2.0
1,401
package se.uu.farmbio.parsers import org.apache.hadoop.io.LongWritable import org.apache.hadoop.io.Text import org.apache.hadoop.mapreduce.InputSplit import org.apache.hadoop.mapreduce.RecordReader import org.apache.hadoop.mapreduce.TaskAttemptContext import org.apache.hadoop.mapreduce.lib.input.FileInputFormat import...
mcapuccini/spark-cheminformatics
parsers/src/main/scala/se/uu/farmbio/parsers/RXNInputFormat.scala
Scala
apache-2.0
658
package wow.realm.protocol.payloads import wow.common.codecs._ import wow.realm.protocol._ import scodec.Codec import scodec.codecs._ /** * Server authentication challenge */ case class ServerAuthChallenge(authSeed: Long, firstSeed: BigInt, secondSeed: BigInt) extends Payload with ServerSide object ServerAuthCha...
SKNZ/SpinaciCore
wow/core/src/main/scala/wow/realm/protocol/payloads/ServerAuthChallenge.scala
Scala
mit
685
package devnull.storage import java.util.UUID import doobie.postgres.pgtypes._ import doobie.hi import doobie.imports._ class FeedbackRepository { val uuidType = UuidType object Queries { def insert(fb: Feedback): Update0 = { sql""" INSERT INTO feedback ( created, client_...
javaBin/devnull
src/main/scala/devnull/storage/FeedbackRepository.scala
Scala
apache-2.0
5,056
package com.houseofmoran.selfies.faces import java.awt.image.BufferedImage import java.io.IOException import java.net.URL import javax.imageio.ImageIO import org.openimaj.image.ImageUtilities import org.openimaj.image.processing.face.detection.HaarCascadeDetector import scala.collection.JavaConversions._ object Fac...
mikemoraned/selfies
src/main/scala/com/houseofmoran/selfies/faces/Faces.scala
Scala
mit
970
/** * Copyright (C) 2009-2011 the original author or authors. * See the notice.md file distributed with this work for additional * information regarding copyright ownership. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
dnatic09/scalate
scalate-util/src/test/scala/org/fusesource/scalate/util/FunSuiteSupport.scala
Scala
apache-2.0
1,751
package bozzy import java.io.FileNotFoundException import java.util.PropertyResourceBundle /** * Created by ted on 2016-04-06. */ object I18n { val i18n = new PropertyResourceBundle(getClass.getResource("/bundle/Resources.properties").openStream) if (i18n == null) { throw new FileNotFoundException("Cannot...
Germanika/Bozzy
src/main/scala/bozzy/I18n.scala
Scala
gpl-3.0
373
/* * Copyright 2020 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
shared/src/main/scala/fm/common/rich/RichOptional.scala
Scala
apache-2.0
911
package nodes.nlp import scala.reflect.ClassTag trait NGramIndexer[WordType, NGramType] extends Serializable { val minNgramOrder: Int val maxNgramOrder: Int /** * Packs a sequence of words of type WordType into a single NGramType. The * current word is `ngram.last`, and the words before are the context....
dongjoon-hyun/keystone
src/main/scala/nodes/nlp/indexers.scala
Scala
apache-2.0
4,472
/* * 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. */ // DO NOT EDIT, CHANGES WILL B...
scala/scala
src/library/scala/Int.scala
Scala
apache-2.0
17,069
/** * 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 ...
tdanford/adam
adam-cli/src/main/scala/org/bdgenomics/adam/cli/CountReadKmers.scala
Scala
apache-2.0
3,388
/*********************************************************************** * Copyright (c) 2013-2017 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...
ronq/geomesa
geomesa-fs/geomesa-fs-storage-parquet/src/test/scala/org/locationtech/geomesa/parquet/ParquetFSTest.scala
Scala
apache-2.0
5,116
package com.programmaticallyspeaking.ncd.nashorn import com.programmaticallyspeaking.ncd.host.{Script, ScriptIdentity, ScriptVersion} import com.programmaticallyspeaking.ncd.infra.ScriptURL import com.programmaticallyspeaking.ncd.testing.IsolatedUnitTest class ScriptsTest extends IsolatedUnitTest { "The Scripts re...
provegard/ncdbg
src/test/scala/com/programmaticallyspeaking/ncd/nashorn/ScriptsTest.scala
Scala
bsd-3-clause
4,634
/* * Copyright [2014] [Jason Nerothin] * * 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 ...
Gigaspaces/gs-executor-remoting
src/test/scala/com/gigaspaces/GsI10nSuite.scala
Scala
apache-2.0
5,656
/* * 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 ...
trueyao/spark-lever
mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala
Scala
apache-2.0
32,489
package cinema.example import cinema.crew._ import cinema.graph.Graph import cinema.graph.immutable.UndirectedGraph object LossyHittingTimeApp { def lossyHittingTime(myGraph: Graph, u: Int, v: Int): Double = { var result = 0 var i = 0 while (i != 2000) { var walker = u while (walker != v) { ...
adelbertc/cinema
src/main/scala/cinema/example/LossyHittingTimeApp.scala
Scala
mit
778
package math import renderer.Hit import play.api.libs.json.{Format, JsValue, Json} final case class Triangle(a: Vector3, b: Vector3, c: Vector3, material: String = "DEFAULT_MATERIAL", normals: Option[Seq[Vector3]] ...
wookenny/scalarty
src/main/scala/math/Triangle.scala
Scala
mit
3,768
/* * 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 ...
bwsw/sj-platform
core/sj-common/src/main/scala/com/bwsw/sj/common/engine/core/entities/KafkaEnvelopes.scala
Scala
apache-2.0
1,040
/* * 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/main/scala/org/scalactic/SeqEqualityConstraints.scala
Scala
apache-2.0
5,337
package feh.tec.visual.swing import scala.swing.Component import scala.swing.Swing._ import javax.swing.{JPanel, UIManager, JComponent} import javax.swing.plaf.ComponentUI import java.awt.Graphics class Canvas extends Component{ override lazy val peer: JCanvas = new JCanvas with SuperMixin def canvas = peer.canva...
fehu/agent-tareas
swing/src/main/scala/feh/tec/visual/swing/Canvas.scala
Scala
mit
493
package dispatch import io.netty.util.{TimerTask, Timeout, Timer} import scala.concurrent.duration.Duration object SleepFuture { def apply[T](d: Duration)(todo: => T) (implicit timer: Timer) = { val promise = scala.concurrent.Promise[T]() timer.newTimeout(new TimerTask { def run(timeout...
dispatch/reboot
core/src/main/scala/sleep.scala
Scala
lgpl-3.0
446
package coursier.cli.install import caseapp.{ExtraName => Short, HelpMessage => Help, ValueDescription => Value, _} import coursier.cli.options.OptionGroup // format: off final case class SharedInstallOptions( @Group(OptionGroup.install) @Hidden graalvmHome: Option[String] = None, @Group(OptionGroup.insta...
coursier/coursier
modules/cli/src/main/scala/coursier/cli/install/SharedInstallOptions.scala
Scala
apache-2.0
1,251
package one.lockstep.monolock import one.lockstep.monolock.LockState.SealIdentifiers import one.lockstep.monolock.protocol.UnlockResponse._ import one.lockstep.monolock.protocol._ import one.lockstep.util._ import one.lockstep.util.crypto._ import one.lockstep.util.codec._ import one.lockstep.util.protocol._ import sc...
lockstep-one/vault
monolock-server/src/main/scala/one/lockstep/monolock/LockGuard.scala
Scala
agpl-3.0
9,304
package org.bitcoins.core.util import scala.math.BigInt /** * Created by chris on 2/8/16. */ trait NumberUtil extends BitcoinSLogger { private def parseLong(hex : String) : Long = java.lang.Long.parseLong(hex,16) private def parseLong(bytes : List[Byte]) : Long = parseLong(BitcoinSUtil.encodeHex(bytes)) pr...
SuredBits/bitcoin-s-sidechains
src/main/scala/org/bitcoins/core/util/NumberUtil.scala
Scala
mit
3,183
package acceptance import cucumber.api.junit.Cucumber import cucumber.api.junit.Cucumber.Options import org.junit.runner.RunWith @RunWith(classOf[Cucumber]) @Options( features = Array("features"), glue = Array("acceptance"), format = Array("pretty", "html:target/cucumber-report"), tags = Array() ) class Featu...
tvlive/tv-details
test/acceptance/FeaturesRunner.scala
Scala
apache-2.0
333
package info.mukel.telegrambot4s.methods import info.mukel.telegrambot4s.models.Message /** Use this method to forward messages of any kind. On success, the sent Message is returned. * * @param chatId Integer or String Unique identifier for the target chat or username of the target channel (in the format @channel...
hugemane/telegrambot4s
src/main/scala/info/mukel/telegrambot4s/methods/ForwardMessage.scala
Scala
apache-2.0
1,069
package gitbucket.core.controller import gitbucket.core.model.{CommitComment, CommitComments, IssueComment, WebHook} import gitbucket.core.plugin.PluginRegistry import gitbucket.core.pulls.html import gitbucket.core.service.CommitStatusService import gitbucket.core.service.MergeService import gitbucket.core.service.Is...
kounoike/gitbucket
src/main/scala/gitbucket/core/controller/PullRequestsController.scala
Scala
apache-2.0
26,409
class Bar { def bar(b: Int = 2): Unit = {}; def baz[X](b: Int = 2): Unit = {} } class Foo { def foo(): Unit = { new Bar/*#*/().bar/*#*/() new Bar/*#*/().baz/*#*/[Any]() new Bar/*#*/().baz/*#*/() } }
scala/scala
test/files/presentation/t7915/src/Foo.scala
Scala
apache-2.0
218
package com.mtraina.bookservice import akka.http.scaladsl.testkit.ScalatestRouteTest import org.scalatest.{WordSpec, Matchers} class RouteSpec extends WordSpec with Matchers with ScalatestRouteTest with Service { "The book service" should { "return an hello message when call the root path" in { Ge...
mtraina/book-service-akka-http
src/test/scala/com/mtraina/bookservice/RouteSpec.scala
Scala
mit
812
package models.domain import app.{PaymentTypes, StatutoryPaymentFrequency} import controllers.mappings.Mappings import models.DayMonthYear import play.api.data.validation.{ValidationError, Invalid, Valid, Constraint} import gov.dwp.carers.xml.validation.CommonValidation import utils.helpers.TextLengthHelper object Yo...
Department-for-Work-and-Pensions/ClaimCapture
c3/app/models/domain/YourIncome.scala
Scala
mit
9,229
package suiryc.scala.sys.linux import grizzled.slf4j.Logging import java.io.File import java.nio.file.{Files, Path, Paths} import suiryc.scala.io.SourceEx import suiryc.scala.misc import suiryc.scala.sys.{Command, CommandResult} class DevicePartition(val device: Device, val partNumber: Int) extends Logging { va...
swhgoon/suiryc-scala
core/src/main/scala/suiryc/scala/sys/linux/DevicePartition.scala
Scala
gpl-3.0
2,971
/* * Skylark * http://skylark.io * * Copyright 2012-2017 Quantarray, 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 * * Unl...
quantarray/skylark
skylark-measure/src/main/scala/com/quantarray/skylark/measure/SameMeasureConverter.scala
Scala
apache-2.0
1,095
/* * 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/main/scala/org/scalatest/words/HaveWord.scala
Scala
apache-2.0
8,685
package is.hail.expr.ir import is.hail.backend.spark.SparkBackend import is.hail.utils._ import is.hail.types.virtual.{TBoolean, TInt32, TInt64, TString, TStruct, Type} import is.hail.io.compress.BGzipInputStream import is.hail.io.fs.{FS, FileStatus, Positioned, PositionedInputStream, BGZipCompressionCodec} import org...
hail-is/hail
hail/src/main/scala/is/hail/expr/ir/GenericLines.scala
Scala
mit
10,920
package fpinscala.gettingstarted // A comment! /* Another comment */ /** A documentation comment */ object MyModule { def abs(n: Int): Int = if (n < 0) -n else n private def formatAbs(x: Int) = { val msg = "The absolute value of %d is %d" msg.format(x, abs(x)) } def main(args: Array[String]):...
mkunikow/fpinscala
exercises/src/main/scala/fpinscala/gettingstarted/GettingStarted.scala
Scala
mit
5,489
/** * Copyright (C) 2014 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 ap...
Stratio/Ingestion
tools/src/main/scala/com/stratio/ingestion/provider/Main.scala
Scala
apache-2.0
1,140
object Sample extends App { case class Wrapper[T](value: T) implicit final class TestExtensions[C[X] <: Seq[X]](val v: Wrapper[C[String]]) extends AnyVal { def test = v.value.map(_ + "!") } Wrapper(Seq("a", "b", "c")).<ref>test }
ilinum/intellij-scala
testdata/resolve/implicitConversion/SCL10549.scala
Scala
apache-2.0
243
package org.jetbrains.plugins.scala.editor.importOptimizer import com.intellij.psi._ import org.jetbrains.plugins.scala.editor.importOptimizer.ScalaImportOptimizer._root_prefix import org.jetbrains.plugins.scala.extensions.{PsiClassExt, PsiMemberExt, PsiModifierListOwnerExt, PsiNamedElementExt} import org.jetbrains.pl...
igrocki/intellij-scala
src/org/jetbrains/plugins/scala/editor/importOptimizer/ImportInfo.scala
Scala
apache-2.0
11,943
package com.phaller.rasync.lattice package lattices class PowerSetLattice[T] extends Lattice[Set[T]] { def join(left: Set[T], right: Set[T]): Set[T] = left ++ right val bottom: Set[T] = Set[T]() }
phaller/reactive-async
core/src/main/scala/com/phaller/rasync/lattice/lattices/PowerSetLattice.scala
Scala
bsd-2-clause
213
/* * 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/util/KoreanSubstantive.scala
Scala
apache-2.0
3,085
/** * 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 * distributed ...
Chasego/kafka
core/src/test/scala/integration/kafka/api/CustomQuotaCallbackTest.scala
Scala
apache-2.0
21,711
/* This file is part of Intake24. Copyright 2015, 2016 Newcastle University. 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 appl...
digitalinteraction/intake24
FoodDataServices/src/test/scala/uk/ac/ncl/openlab/intake24/services/foodindex/english/EnglishSplitterTest.scala
Scala
apache-2.0
2,474
package com.sksamuel.scapegoat.inspections.controlflow import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels} class RepeatedIfElseBody extends Inspection( text = "Repeated body of if main and else branch", defaultLevel = Levels.Warning, description = "Checks for the mai...
sksamuel/scapegoat
src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBody.scala
Scala
apache-2.0
2,014
/* * 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/ct-calculations
src/main/scala/uk/gov/hmrc/ct/ct600/v3/B295.scala
Scala
apache-2.0
1,099
/* Copyright 2009-2021 EPFL, Lausanne */ package stainless package ast class Symbol private[stainless](val path: Seq[String], private[stainless] val id: Int) { def this(name: String, id: Int) = this(name.split("\\\\.").toSeq, id) val name: String = path.mkString(".") override def equals(that: Any): Boolean = ...
epfl-lara/stainless
core/src/main/scala/stainless/ast/SymbolIdentifier.scala
Scala
apache-2.0
1,336
package almhirt.i18n import almhirt.common._ import scalaz.syntax.validation._ import com.ibm.icu.text.MeasureFormat.FormatWidth sealed trait MeasureRenderWidth object MeasureRenderWidth { /** * Spell out everything. */ case object Wide extends MeasureRenderWidth /** * Abbreviate when possible. */...
chridou/almhirt
almhirt-i18n/src/main/scala/almhirt/i18n/MeasureRenderWidth.scala
Scala
apache-2.0
1,607
package com.electronwill.collections import scala.collection.mutable import scala.reflect.ClassTag /** * @author TheElectronWill */ final class ArrayMap[@specialized(Int) A: ClassTag](initialCapacity: Int, private[this] val nullValue: A) extends mutable.Map[In...
mcphoton/Photon-Server
core/src/main/scala/com/electronwill/collections/ArrayMap.scala
Scala
lgpl-3.0
2,916
package net.hearthstats.util case class Coordinate(x: Int, y: Int) object Coordinate { def apply(x: Float, y: Float): Coordinate = Coordinate(x.toInt, y.toInt) }
HearthStats/HearthStats.net-Uploader
companion/src/main/scala/net/hearthstats/util/Coordinate.scala
Scala
bsd-3-clause
169
/* * 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 ...
fhueske/flink
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/sql/TemporalTableJoinTest.scala
Scala
apache-2.0
8,144
import com.hypertino.binders.core.BindOptions import com.hypertino.binders.json.{DefaultJsonBindersFactory, JsonBinders} import com.hypertino.inflector.naming.PlainConverter import org.scalatest.{FlatSpec, Matchers} case class TestInt(intVal: Int) case class TestIntN(intValN1: Option[Int], intValN2: Option[Int]) case...
hypertino/json-binders
jsonBinders/shared/src/test/scala/TestIntJsonSerializer.scala
Scala
bsd-3-clause
2,500
package com.twitter.finagle.tracing import com.twitter.app.GlobalFlag import com.twitter.finagle.Init import com.twitter.finagle.context.Contexts import com.twitter.finagle.util.ByteArrays import com.twitter.io.Buf import com.twitter.util.{Duration, Future, Return, Stopwatch, Throw, Time, Try} import java.net.InetSock...
spockz/finagle
finagle-core/src/main/scala/com/twitter/finagle/tracing/Trace.scala
Scala
apache-2.0
11,104
/* * Copyright 2015 Otto (GmbH & Co KG) * * 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...
ottogroup/flink-spector
flinkspector-dataset/src/test/scala/io/flinkspector/dataset/DataSetEnvironmentSpec.scala
Scala
apache-2.0
7,041
package com.lookout.borderpatrol.test import java.net.URL import com.lookout.borderpatrol.{LoginManager, Manager, ServiceIdentifier, ServiceMatcher} import com.twitter.finagle.httpx.{RequestBuilder, Request} import com.twitter.finagle.httpx.path.Path class ServiceMatcherSpec extends BorderPatrolSuite { val urls =...
jamescway/borderpatrol
core/src/test/scala/com/lookout/borderpatrol/test/ServiceMatcherSpec.scala
Scala
mit
3,634
package com.github.opengrabeso package formulafx import core._ import org.scalajs.dom._ import scala.collection.mutable import scala.scalajs.js import scala.scalajs.js.JSApp import scala.scalajs.js.annotation.JSExport import com.github.opengrabeso.js.JsUtils._ import org.scalajs.dom @JSExport(name="FormulaJS") obje...
OndrejSpanel/FormulaFX
js/src/main/scala/com/github/opengrabeso/formulafx/FormulaJS.scala
Scala
gpl-2.0
3,788
/*********************************************************************** * Copyright (c) 2013-2022 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...
locationtech/geomesa
geomesa-kudu/geomesa-kudu-tools/src/main/scala/org/locationtech/geomesa/kudu/tools/KuduDataStoreCommand.scala
Scala
apache-2.0
2,942
/* * Copyright 2017 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 writin...
akara/squbs
squbs-unicomplex/src/test/scala/org/squbs/unicomplex/dummyfailedflowsvc1/DummyFailedFlowSvc1.scala
Scala
apache-2.0
1,301
/* * Copyright 2014 okumin.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 applicable law or agreed to i...
okumin/akka-persistence-sql-async
core/src/test/scala/akka/persistence/journal/sqlasync/MySQLAsyncJournalSpec.scala
Scala
apache-2.0
2,972
/* * 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.apach...
acgray/snowplow
3-enrich/scala-common-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.common/enrichments/web/ParseCrossDomainSpec.scala
Scala
apache-2.0
2,321
package scalapb object Scalapb { def getDescriptor(): com.google.protobuf.Descriptors.FileDescriptor = { throw new NotImplementedError("Descriptors are not implemented yet for Scala.js.") } }
scalapb/ScalaPB
scalapb-runtime/src/main/scalajs/scalapb/Scalapb.scala
Scala
apache-2.0
201