code
stringlengths
5
1M
repo_name
stringlengths
5
109
path
stringlengths
6
208
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
5
1M
package com.github.andyglow.relaxed import scala.language.experimental.macros import scala.language.postfixOps import scala.reflect.macros.blackbox private[relaxed] object Util { def fieldMap[T]: Map[String, Class[_]] = macro fieldMapImpl[T] def fieldMapImpl[T: c.WeakTypeTag](c: blackbox.Context): c.Expr[Map[Str...
andyglow/relaxed-json-update
api/src/main/scala-2.11/com/github/andyglow/relaxed/Util.scala
Scala
lgpl-3.0
1,624
package app.server import akka.actor.ActorRef import akka.testkit.{TestActorRef, TestKit} import app.adapters.database.{DbSpec, TaskDAO} import app.models.Task import app.services.TaskService import org.joda.time.DateTime import org.scalatest.{Matchers, WordSpec} import play.api.libs.json.{JsNumber, JsArray, JsValue, ...
mericano1/spray-akka-slick-postgres
src/test/scala/app/server/TaskWebServiceSpec.scala
Scala
mit
2,083
/* * 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 ...
rohit2b/incubator-zeppelin
zeppelin-server/src/test/scala/org/apache/zeppelin/AbstractFunctionalSuite.scala
Scala
apache-2.0
2,660
package org.yaqoob.scala.hackerearth import scala.io.StdIn //Given the size and the elements of array A, print all the elements in reverse order. // //Input: //First line of input contains, N - size of the array. //Following N lines, each contains one integer, i{th} element of the array i.e. A[i]. // //Output: //Prin...
adnanyaqoobvirk/scala-experiments
src/main/scala/org/yaqoob/scala/hackerearth/PrintArrayInReverse.scala
Scala
mit
545
import sbt._ import Keys._ import PlayProject._ object ApplicationBuild extends Build { val appName = "module-repo" val appVersion = "1.0-SNAPSHOT" val appDependencies = Seq( "be.objectify" %% "deadbolt-2" % "1.1.2", "rome" % "rome" % "1.0", "org.markdownj" % "markdownj" % ...
playframework/modules.playframework.org
project/Build.scala
Scala
apache-2.0
692
/* * 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/test/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC125AbridgedSpec.scala
Scala
apache-2.0
4,495
/* * # Trove * * This file is part of Trove - A FREE desktop budgeting application that * helps you track your finances, FREES you from complex budgeting, and * enables you to build your TROVE of savings! * * Copyright © 2016-2021 Eric John Fredericks. * * Trove is free software: you can redistribute it ...
emanchgo/trove
src/main/scala/trove/core/infrastructure/persist/ProjectImpl.scala
Scala
gpl-3.0
1,610
package com.sksamuel.elastic4s.requests.searches.queries import com.sksamuel.elastic4s.requests.script.ScriptBuilderFn import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory} object ScriptQueryBodyFn { def apply(q: ScriptQuery): XContentBuilder = { val builder = XContentFactory.jsonBuilder() ...
stringbean/elastic4s
elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/queries/ScriptQueryBodyFn.scala
Scala
apache-2.0
572
package controllers.save_for_later import models.domain.Claim import models.view.{CachedClaim, Navigable} import play.api.Play._ import play.api.i18n._ import play.api.mvc.Controller import services.EmailServices import utils.helpers.CarersCrypto import app.ConfigProperties._ import scala.language.reflectiveCalls impo...
Department-for-Work-and-Pensions/ClaimCapture
c3/app/controllers/save_for_later/GSaveForLater.scala
Scala
mit
2,470
/* * 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 ...
ueshin/apache-flink
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/validation/InlineTableValidationTest.scala
Scala
apache-2.0
1,437
package com.harrys.hyppo.worker.proto import com.harrys.hyppo.executor.proto.com.ValidateIntegrationCommand import com.harrys.hyppo.executor.proto.res.ValidateIntegrationResult import com.harrys.hyppo.worker.{ProcessedDataStub, RawDataStub, TestObjects} import org.apache.avro.Schema import scala.concurrent.duration._...
harrystech/hyppo-worker
worker/src/test/scala/com/harrys/hyppo/worker/proto/ValidateIntegrationTest.scala
Scala
mit
1,129
/* * 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 ma...
harperjiang/enc-selector
src/main/scala/edu/uchicago/cs/encsel/ptnmining/rule/FreqSimilarWordRule.scala
Scala
apache-2.0
997
/* * Copyright 2016 Alexey Kardapoltsev * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
kardapoltsev/astparser
src/test/scala/com/github/kardapoltsev/astparser/parser/http/HttpParserSpec.scala
Scala
apache-2.0
3,512
package slick.test.lifted import org.junit.Test import org.junit.Assert._ /** Test case for the SQL schema support in table definitions */ @deprecated("Using deprecated .simple API", "3.0") class SchemaSupportTest { @Test def testSchemaSupport { import slick.driver.H2Driver.simple._ class T(tag: Tag) exte...
easel/slick
slick-testkit/src/test/scala/slick/test/lifted/SchemaSupportTest.scala
Scala
bsd-2-clause
1,331
/* * 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 ...
lhfei/spark-in-action
spark-3.x/src/main/scala/org/apache/spark/examples/ml/TfIdfExample.scala
Scala
apache-2.0
2,102
package models.hkg case class Topics(topicList: List[Topic] = List()) object Topics { }
mingchuno/golden-cache
app/models/hkg/Topics.scala
Scala
gpl-3.0
90
/* * 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...
1974kpkpkp/snowplow
3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/enrichments/ClientEnrichments.scala
Scala
apache-2.0
4,345
/* * Copyright 2008-present MongoDB, 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 ag...
rozza/mongo-scala-driver
driver/src/test/scala/org/mongodb/scala/MongoDatabaseSpec.scala
Scala
apache-2.0
11,239
/* * 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
mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala
Scala
apache-2.0
16,868
/* * (c) Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
hpe-cct/cct-core
src/main/scala/cogx/compiler/codegenerator/opencl/fragments/CLType.scala
Scala
apache-2.0
2,864
package com.cerner.beadledom.avro import com.cerner.beadledom.metadata.BuildInfo import com.fasterxml.jackson.databind.{Module, ObjectMapper} import com.google.inject._ import com.google.inject.multibindings.ProvidesIntoSet import java.util.Properties import org.scalatest.mockito.MockitoSugar import org.scalatest.{Fun...
bbaugher/beadledom
avro/jackson/src/test/scala/com/cerner/beadledom/avro/AvroJacksonGuiceModuleSpec.scala
Scala
apache-2.0
3,812
/* * 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...
mdavid/lessig-bigdata
lib/snowplow/3-enrich/scala-hadoop-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.hadoop/good/CljTomcatMailchimpEventSpec.scala
Scala
mit
5,094
package fpinscala.laziness import Stream._ trait Stream[+A] { def uncons: Option[(A, Stream[A])] def isEmpty: Boolean = uncons.isEmpty def foldRight[B](z: => B)(f: (A, => B) => B): B = uncons match { case Some((h, t)) => f(h, t.foldRight(z)(f)) case None => z } def exists(p: A => Boolean)...
ShokuninSan/fpinscala
chaptercode/src/main/scala/fpinscala/laziness/Stream.scala
Scala
mit
737
package net.pointsgame.engine abstract sealed class MoveResult case object Error extends MoveResult case object Normal extends MoveResult case class WithSurroundings(newSurroundings: Int*) extends MoveResult
vn971/points-wip
modules/game-engine-experiments/src/main/scala/net/pointsgame/engine/AiEngineApi.scala
Scala
agpl-3.0
210
package spire.macros import spire.algebra.{Field, Ring} import spire.macros.compat.Context import spire.math.{Rational, UByte, UShort, UInt, ULong} object Macros { case class LiteralUtil(c: Context) { import c.universe._ def getString: String = { val Apply(_, List(Apply(_, List(Literal(Constant(s: S...
guersam/spire
core/shared/src/main/scala/spire/macros/Macros.scala
Scala
mit
6,947
package com.sample.app.model class Post(val user: User, val header: String, val text: String)
nmilinkovic/Skadi
src/test/scala/com/sample/app/model/Post.scala
Scala
bsd-3-clause
94
package org.orbeon.dom.io import java.{lang ⇒ jl, util ⇒ ju} import org.orbeon.dom._ import org.orbeon.dom.tree.{ConcreteElement, NamespaceStack} import org.xml.sax._ import org.xml.sax.ext.LexicalHandler import org.xml.sax.helpers.DefaultHandler /** * `SAXContentHandler` builds a tree via SAX events. */ class SAX...
brunobuzzi/orbeon-forms
dom/src/main/scala/org/orbeon/dom/io/SAXContentHandler.scala
Scala
lgpl-2.1
6,235
package mypipe.snapshotter.splitter /** Created by hisham on 6/25/16. */ case class InputSplit(lowClausePrefix: String, upperClausePrefix: String)
mardambey/mypipe
mypipe-snapshotter/src/main/scala/mypipe/snapshotter/splitter/InputSplit.scala
Scala
apache-2.0
149
package avrohugger package matchers import avrohugger.matchers.custom.CustomDefaultParamMatcher import avrohugger.stores.ClassStore import avrohugger.types._ import org.apache.avro.Schema import org.apache.avro.Schema.Type import treehugger.forest._ import definitions._ import treehugger.forest import treehuggerDSL._ ...
julianpeeters/avrohugger
avrohugger-core/src/main/scala/matchers/DefaultParamMatcher.scala
Scala
apache-2.0
2,412
package com.filez.astyanax.multientity.play2.impl import scala.collection.mutable.ListMap import scala.collection.mutable.SynchronizedMap import com.filez.astyanax.multientity.MultiEntityManagerFactory import com.filez.astyanax.multientity.MultiEntityManager /** cached instances of MultiEntityManager */ object Mult...
hsn10/multiplugin
src/main/scala/impl/MultiEntityManagerCache.scala
Scala
agpl-3.0
443
/* Facsimile: A Discrete-Event Simulation Library Copyright © 2004-2020, Michael J Allen. This file is part of Facsimile. Facsimile 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 3 of the ...
MichaelJAllen/facsimile
core/src/main/scala/org/facsim/anim/Point3D.scala
Scala
lgpl-3.0
3,154
package susuru.core sealed class Result[R] case class Void[R]() extends Result[R] case class NotExists[R]() extends Result[R] case class WaitNotify[R](r: R) extends Result[R] case class Wait[R](until: Long) extends Result[R] case class Lease[R](resource: Resource[R]) extends Result[R]
tomingtoming/susuru
src/main/scala/susuru/core/Result.scala
Scala
mit
292
package models.actor import models.binding._ import org.specs2.mutable.Specification import org.specs2.mock.Mockito import play.api.test.Helpers._ import play.api.test._ import play.api.libs.concurrent._ import play.api.libs.json._ import akka.pattern.ask import akka.testkit._ import scala.concurrent.duration._ import...
FlorianTopf/impex-portal
test/models/actor/ConfigServiceSpecs.scala
Scala
gpl-2.0
4,288
/* * Copyright 2015 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...
keithhall/ct-calculations
src/main/scala/uk/gov/hmrc/ct/computations/calculations/SummaryCalculator.scala
Scala
apache-2.0
1,499
package flaky import java.io.File import org.apache.commons.vfs2.FileObject import scala.collection.immutable.{Iterable, Seq} import scala.language.postfixOps import scala.util.Try import scala.xml.{Elem, NodeSeq, XML} case class Test(clazz: String, test: String) { def classNameOnly(): String = clazz.split('.').l...
otrebski/sbt-flaky
src/main/scala/flaky/Flaky.scala
Scala
apache-2.0
6,779
/* * Copyright 2011-2022 GatlingCorp (https://gatling.io) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
gatling/gatling
gatling-commons-shared-unstable/src/main/scala/io/gatling/commons/shared/unstable/model/stats/assertion/AssertionValidator.scala
Scala
apache-2.0
6,336
/* * Shadowsocks - A shadowsocks client for Android * Copyright (C) 2015 <max.c.lv@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at y...
otoil/shadowsocks-android
src/main/scala/com/github/shadowsocks/utils/TrafficMonitorThread.scala
Scala
gpl-3.0
4,104
/* * Copyright 2018 CJWW Development * * 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...
cjww-development/authorisation
src/test/scala/com/cjwwdev/auth/backend/BaseAuthSpec.scala
Scala
apache-2.0
1,841
/* * * 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 * distri...
flaminem/flamy
src/test/scala/com/flaminem/flamy/commands/ShowTest.scala
Scala
apache-2.0
1,310
package org.mitre.mandolin.mx import org.mitre.mandolin.config.ConfigGeneratedCommandOptions import org.mitre.mandolin.mlp.MandolinMLPSettings import com.typesafe.config.Config import net.ceedubs.ficus.Ficus._ class MxModelSettings(_confOptions: Option[ConfigGeneratedCommandOptions], _conf: Option[Config]) extends M...
project-mandolin/mandolin
mandolin-mx/src/main/scala/org/mitre/mandolin/mx/MxModelSettings.scala
Scala
apache-2.0
4,271
package core.services import core.collection.OrganizationCollection import core.{ OrganizationCollectionLookupService, CultureHubPlugin } import models.OrganizationConfiguration /** * * @author Manuel Bernhardt <bernhardt.manuel@gmail.com> */ class AggregatingOrganizationCollectionLookupService extends Organizati...
delving/culture-hub
web-core/app/core/services/AggregatingOrganizationCollectionLookupService.scala
Scala
apache-2.0
957
import com.zaxxer.hikari.HikariDataSource import gplume.scala.jdbc._ import gplume.scala.jdbc.SQLAux._ import gplume.scala.jdbc.SQLOperation._ import org.junit.{Test, Before} import scala.Seq import scala.util.Try /** * Created by Bowen Cai on 12/27/2014. */ class SQLInterpTest { val ds = new HikariDataSource() ...
xkommando/Gplume-Scala
jdbc/src/test/scala/SQLInterpTest.scala
Scala
apache-2.0
3,195
class C { def get(): Int = 0 } def g = { val s: String | Null = ??? val l = s.length // ok val c: C | Null = ??? c.get() }
lampepfl/dotty
tests/pos/i11968.scala
Scala
apache-2.0
145
package org.apache.spark.ml.mleap.converter.runtime import com.truecar.mleap.runtime.transformer import org.apache.spark.ml.PipelineModel import org.apache.spark.ml.classification.RandomForestClassificationModel import org.apache.spark.ml.feature.{IndexToString, StandardScalerModel, StringIndexerModel, VectorAssembler...
TrueCar/mleap
mleap-spark/src/main/scala/org/apache/spark/ml/mleap/converter/runtime/BaseTransformerConverter.scala
Scala
apache-2.0
2,720
/* * Copyright 2013 - 2020 Outworkers Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
outworkers/phantom
phantom-dsl/src/test/scala/com/outworkers/phantom/builder/serializers/AlterQueryBuilderTest.scala
Scala
apache-2.0
9,795
package com.eevolution.context.dictionary.infrastructure.repository import com.eevolution.context.dictionary.domain.model.WorkflowNodeNext import com.eevolution.context.dictionary.infrastructure.db.DbContext._ /** * Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com * This program ...
adempiere/ADReactiveSystem
dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/repository/WorkflowNodeNextMapping.scala
Scala
gpl-3.0
1,891
package ru.wordmetrix.nlp /** * Text tokenizer * (acquired from an old HMM NLP project of my own) */ object NLP { type Phrase = String type Word = String implicit def string2NLP(s: String) = new NLP(s) implicit def list2NLP(l: List[String]) = new NLP(l) implicit def list2String(l: List[String]) ...
electricmind/enwiz
src/main/scala/ru/wordmetrix/nlp/NLP.scala
Scala
apache-2.0
2,304
/* * scala-swing (https://www.scala-lang.org) * * Copyright EPFL, Lightbend, Inc., contributors * * 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...
scala/scala-swing
src/main/scala/scala/swing/Swing.scala
Scala
apache-2.0
6,311
package scala.generator import java.util.UUID import org.joda.time.format.ISODateTimeFormat.dateTimeParser import lib.Datatype import lib.generator.GeneratorUtil import lib.Text.initLowerCase import play.api.libs.json._ import play.api.Logger sealed trait ScalaDatatype { def asString(originalVarName: String): Stri...
movio/movio-apidoc-generator
scala-generator/src/main/scala/models/generator/ScalaDatatype.scala
Scala
mit
11,866
/* * The MIT License (MIT) * * Copyright (c) 2015 Iat Chong Chan * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to ...
ET-Chan/th4j
src/main/scala/th4j/Main.scala
Scala
mit
2,708
package info.longshore.site import akka.actor.ActorSystem import akka.http.scaladsl.Http import akka.http.scaladsl.server.Directives._ import akka.stream.ActorMaterializer import info.longshore.site.libs.scalatagsMarshaller import java.io.File import scala.util.Try object Main { def main(args: Array[String]): Unit ...
longshorej/longshore-info-site
src/main/scala/info/longshore/site/Main.scala
Scala
gpl-3.0
1,481
import _root_.io.gatling.core.scenario.Simulation import ch.qos.logback.classic.{Level, LoggerContext} import io.gatling.core.Predef._ import io.gatling.http.Predef._ import org.slf4j.LoggerFactory import scala.concurrent.duration._ /** * Performance test for the Appareil entity. */ class AppareilGatlingTest extend...
CherifAbdoul/TpSirM1MIAGE_Ierlomenko-Kinfack-Haidara
tpJpa/src/test/gatling/simulations/AppareilGatlingTest.scala
Scala
gpl-2.0
3,339
import sbt._ import sbt.Keys._ import com.typesafe.sbt.SbtScalariform import com.typesafe.sbt.SbtScalariform.ScalariformKeys /** * Please use plain text editor to edit this file instead of NetBeans (To be supported) */ object Build extends sbt.Build { lazy val root = Project("SampleProject", file(".")) .setti...
BabakAp/ProjectFB
project/Build.scala
Scala
apache-2.0
2,208
package core import akka.actor.{Actor, ActorRef} import akka.io.IO import domain.{Place, Tweet, User} import spray.can.Http import spray.client.pipelining._ import spray.http.{HttpRequest, _} import spray.httpx.unmarshalling.{Deserialized, MalformedContent, Unmarshaller} import spray.json._ import scala.util.Try tra...
jeffmay/twitter-voice
src/main/scala/core/tweetstream.scala
Scala
apache-2.0
2,981
package lila.i18n import play.api.i18n.Lang object LangList { val all = Map( Lang("en", "GB") -> "English", Lang("af", "ZA") -> "Afrikaans", Lang("an", "ES") -> "aragonés", Lang("ar", "SA") -> "العربية", Lang("as", "IN") -> "অসমীয়া", Lang("az", "AZ") -> "Azərbaycanca", Lang("be",...
luanlv/lila
modules/i18n/src/main/LangList.scala
Scala
mit
5,885
/* * Copyright 2011-2021 Asakusa Framework Team. * * 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 ...
asakusafw/asakusafw-spark
runtime/src/main/scala/com/asakusafw/spark/runtime/directio/BasicDataDefinition.scala
Scala
apache-2.0
1,947
package akka.persistence.pg.journal import akka.NotUsed import akka.persistence.PersistentRepr import akka.persistence.pg.{EventTag, PgConfig} import akka.stream.scaladsl.Source import slick.jdbc.{ResultSetConcurrency, ResultSetType} trait ReadJournalStore extends JournalStore { self: PgConfig => import driver.api...
WegenenVerkeer/akka-persistence-postgresql
modules/akka-persistence-pg/src/main/scala/akka/persistence/pg/journal/ReadJournalStore.scala
Scala
mit
2,169
package com.electronwill.macros import scala.annotation.{StaticAnnotation, compileTimeOnly} import scala.language.experimental.macros import scala.reflect.macros.whitebox /** * Ensures that the method is executed in the right ExecutionGroup. This is useful for * non-thread-safe Entity methods (among others) since i...
mcphoton/Photon-Server
metaprog/src/main/scala/com/electronwill/macros/EnsureInGroup.scala
Scala
lgpl-3.0
3,506
/* * Copyright (C) 2005, The Beangle Software. * * This program 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 3 of the License, or * (at your option) any later version. * * This...
beangle/cache
redis/src/main/scala/org/beangle/cache/redis/RedisCacheManager.scala
Scala
lgpl-3.0
1,757
package microtools.metrics import com.codahale.metrics.{MetricRegistry, Timer} import microtools.decorators.{FutureDecorator, TryDecorator} import microtools.logging.{ContextAwareLogger, LoggingContext} import microtools.{BusinessFailure, BusinessSuccess, BusinessTry} import scala.concurrent.{ExecutionContext, Future...
21re/play-error-handling
src/main/scala/microtools/metrics/TimedCalls.scala
Scala
mit
2,421
package com.themillhousegroup.gatsby.test import com.typesafe.scalalogging.slf4j.{ StrictLogging, Logging, Logger } trait MockedLogging extends Logging { override protected lazy val logger = Logger(org.mockito.Mockito.mock(classOf[org.slf4j.Logger])) } trait MockedStrictLogging extends StrictLogging { override p...
themillhousegroup/gatsby
src/test/scala/com/themillhousegroup/gatsby/test/MockedLogging.scala
Scala
mit
404
/* * Copyright 2009-2011 WorldWide Conferencing, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
lift/framework
core/json/src/test/scala/net/liftweb/json/XmlExamples.scala
Scala
apache-2.0
6,394
import sbt._ object Dependencies { lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.0.1" lazy val specs2 = "org.specs2" %% "specs2-core" % "3.8.9" lazy val scalaParserCombinators = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.5" lazy val scalaz = "org.scalaz" %% "scalaz-core" % "7.2.10...
MelvinWM/Various
Calculator/project/Dependencies.scala
Scala
mit
324
/* * 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 ...
Swrrt/Samza
samza-kafka/src/main/scala/org/apache/samza/checkpoint/kafka/KafkaCheckpointManager.scala
Scala
apache-2.0
13,097
package tests.rescala class HigherOrderTestSuite extends RETests { allEngines("basic Higher Order Signal can Be Accessed"){ engine => import engine._ val v = Var(42) val s1: Signal[Int] = v.map(identity) val s2: Signal[Signal[Int]] = dynamic() { t => s1 } assert(s2.now.now == 42) v.set(0) ...
volkc/REScala
Tests/shared/src/test/scala/tests/rescala/HigherOrderTestSuite.scala
Scala
apache-2.0
9,507
/*********************************************************************** * 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-filter/src/main/scala/org/locationtech/geomesa/filter/AndSplittingFilter.scala
Scala
apache-2.0
1,173
// https://leetcode.com/problems/powx-n object Solution { def myPow(x: Double, n: Int): Double = if (n < 0) 1 / h(x, -n) else h(x, n) def h(x: Double, n: Int, z: Double = 1): Double = if (n == 0) z else h(x * x, n / 2, if (n % 2 == 0) z else z * x) }
airtial/Codegames
leetcode/050-powx-n.scala
Scala
gpl-2.0
267
package heartbeat_multijvm_tests /** * Copyright (c) Nikita Kovaliov, maizy.ru, 2015 * See LICENSE.txt for details. */ import akka.actor.ActorRef import scala.concurrent.duration._ import org.scalatest.FlatSpecLike import com.typesafe.config.ConfigFactory import akka.remote.testkit.MultiNodeConfig import ru.maizy...
maizy/akka-cluster-heartbeat
src/multi-jvm/scala/heartbeat_multijvm_tests/StatActorManagedBySupervisorSpec.scala
Scala
mit
3,317
package spark.streaming.examples import spark.RDD import scala.collection.mutable.ArrayBuffer /** * Created with IntelliJ IDEA. * User: peter * Date: 10/16/13 * Time: 9:15 PM * To change this template use File | Settings | File Templates. */ class OperatorGraph(_parentCtx : SqlSparkStreamingContext) { val par...
pxgao/spark-0.7.3
examples/src/main/scala/spark/streaming/examples/OperatorGraph.scala
Scala
bsd-3-clause
5,836
package com.asto.dmp.ycd.service.impl import com.asto.dmp.ycd.base.Constants import com.asto.dmp.ycd.dao.impl.BizDao import com.asto.dmp.ycd.mq.{MQAgent, MsgWrapper, Msg} import com.asto.dmp.ycd.service.Service import com.asto.dmp.ycd.util._ /** * 授信规则 * 授信金额=min(30万,近12月月均提货额*评分对应系数) * 评分对应系数 * (600 650] 1.5 *...
zj-lingxin/Dmp_ycd
src/main/scala/com/asto/dmp/ycd/service/impl/CreditService.scala
Scala
mit
1,950
/** * 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-lagom-server/generated/src/main/scala/io/swagger/client/model/GithubScmlinks.scala
Scala
mit
605
package org.bitcoins.node import akka.actor.Cancellable import org.bitcoins.core.currency._ import org.bitcoins.core.protocol.BitcoinAddress import org.bitcoins.core.protocol.blockchain.MerkleBlock import org.bitcoins.core.protocol.transaction.Transaction import org.bitcoins.core.wallet.fee.SatoshisPerByte import org....
bitcoin-s/bitcoin-s-core
node-test/src/test/scala/org/bitcoins/node/UpdateBloomFilterTest.scala
Scala
mit
5,546
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); yo...
Chasego/kafka
core/src/main/scala/kafka/server/DynamicBrokerConfig.scala
Scala
apache-2.0
44,582
Extracting, transforming and selecting features - spark.ml This section covers algorithms for working with features, roughly divided into these groups: Extraction: Extracting features from “raw” data Transformation: Scaling, converting, or modifying features Selection: Selecting a subset from a larger set of features ...
xieguobin/Spark_2.0.0_cn1
ml_analysis/ETS.scala
Scala
apache-2.0
43,199
// Copyright (C) 2014 Fehmi Can Saglam (@fehmicans) and contributors. // See the LICENCE.txt 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 Licen...
fehmicansaglam/reactivemongo-extensions
json/src/main/scala/dao/JsonDao.scala
Scala
apache-2.0
10,464
package me.iamzsx.scala.svm import scala.math._ import org.scalatest._ import org.scalatest.matchers._ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import org.junit.Assert._ import scala.io.Source import java.io.IOException import AssertUtil._ @RunWith(classOf[JUnitRunner]) class SVMProblemS...
zsxwing/scala-svm
src/test/scala/me/iamzsx/scala/svm/SVMProblemSuite.scala
Scala
mit
2,319
package hackerRankFunctionalProgramming.arrayOfNElements object ArrayOfNElements { def f(num:Int) : List[Int] = { val list = List.range(0,num); //print(list + "\\n") return list } }
sagasu/scalaPlayground
playground/src/main/scala/hackerRankFunctionalProgramming/arrayOfNElements/ArrayOfNElements.scala
Scala
apache-2.0
199
package org.http4s package server package middleware import cats.data.{Kleisli, OptionT} import cats.effect.Sync import org.http4s.headers._ package object authentication { def challenged[F[_], A]( challenge: Kleisli[F, Request[F], Either[Challenge, AuthedRequest[F, A]]])( routes: AuthedRoutes[A, F])(im...
ChristopherDavenport/http4s
server/src/main/scala/org/http4s/server/middleware/authentication/package.scala
Scala
apache-2.0
763
package com.github.agourlay.cornichon import cats.data.StateT import cats.effect.IO package object core { type StepState = StateT[IO, RunState, FailedStep Either Done] type StepResult = IO[(RunState, FailedStep Either Done)] }
agourlay/cornichon
cornichon-core/src/main/scala/com/github/agourlay/cornichon/core/package.scala
Scala
apache-2.0
233
package org.kleemann.autoscore import org.scaloid.common._ import android.graphics.{Bitmap, BitmapFactory, Canvas, Color, Matrix, Paint, PointF} object Transform { implicit val tag = LoggerTag("MyAppTag") val DivideThreshold = 0.1f def all(src: Bitmap, a: PointF, b: PointF, c: PointF): Bitmap = { // ma...
sizezero/auto-score
src/main/scala/org/kleemann/autoscore/Transform.scala
Scala
mit
2,667
package x7c1.linen.modern.init.settings.preset import android.app.Activity import android.support.v4.app.{Fragment, FragmentActivity, FragmentManager, FragmentPagerAdapter} import x7c1.linen.glue.activity.ActivityControl import x7c1.linen.glue.activity.ActivityLabel.SettingPresetChannelSources import x7c1.linen.glue.r...
x7c1/Linen
linen-modern/src/main/scala/x7c1/linen/modern/init/settings/preset/PresetChannelsDelegatee.scala
Scala
mit
3,494
package com.example.http4s.blaze.demo.server package object endpoints { val ApiVersion = "v1" }
aeons/http4s
examples/blaze/src/main/scala/com/example/http4s/blaze/demo/server/endpoints/package.scala
Scala
apache-2.0
99
package scala_school /** * Created by tilmannbruckhaus on 12/26/14. * */ class Calculator(my_brand: String, my_model: String) { /** * A constructor. */ val brand = my_brand val model = my_model val color: String = if (brand == "TI") { "blue" } else if (brand == "HP") { "black" } else { ...
bruckhaus/challenges
scala_challenges/src/main/scala/scala_school/Calculator.scala
Scala
mit
562
package one.lockstep.util.crypto import java.security.Security import javax.crypto.spec.SecretKeySpec import one.lockstep.util._ /** * =Implementation Note [nw]= * * HMAC is considered secure in single-user setting if `keylenth = maclength/2`. * In multi-user setting, bitstrength is `keylength - log`,,2,,`(u...
lockstep-one/vault
vault-common/src/main/scala/one/lockstep/util/crypto/Hmac.scala
Scala
agpl-3.0
2,200
/** * Copyright 2015 Thomson Reuters * * Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
nruppin/CM-Well
server/cmwell-bg/src/test/scala/cmwell/bg/test/BGResilienceSpec.scala
Scala
apache-2.0
6,120
package net.zzorn.utils import com.jme3.math.Vector3f /** * Calculates normal vectors for a shape. * * Borrowed from my open source project skycastle: * https://github.com/zzorn/skycastle/blob/master/src/main/scala/org/skycastle/util/mesh/NormalCalculator.scala */ object NormalCalculator { def calculateNormal...
zzorn/ludumdare20
src/main/scala/net/zzorn/utils/NormalCalculator.scala
Scala
gpl-2.0
1,670
package musicsvc.json import play.api.libs.json.{Reads, JsPath, Writes} import play.api.libs.functional.syntax._ import musicsvc.models._ object Implicits { // ===== Json reads/Writes for Performer ======================================== implicit val performerWrites: Writes[Performer] = ( (JsPath \\ "i...
hermannhueck/MusicService
Services/MusicService-Play-Scala-Slick-NoAuth/app/musicsvc/json/Implicits.scala
Scala
apache-2.0
3,448
import java.io.File import java.util.concurrent.atomic.AtomicInteger import org.junit.Test import scala.annotation.tailrec object ParallelTest { val nbConcurrentTests = new AtomicInteger(0) val maxConcurrentTests = new AtomicInteger(0) private def updateMaxConcurrentTests(currentMax: Int, newMax: Int) : Boolean =...
mdedetrich/sbt
sbt/src/sbt-test/tests/fork-parallel/src/test/scala/tests.scala
Scala
bsd-3-clause
1,146
package io.vamp.model import java.time.format.DateTimeFormatter._ import java.time.{ ZoneOffset, ZonedDateTime } import java.util.UUID import scala.sys.process._ import scala.util.Try object Model { val uuid = UUID.randomUUID.toString val version: String = Option(getClass.getPackage.getImplementationVersion).o...
magneticio/vamp
model/src/main/scala/io/vamp/model/Model.scala
Scala
apache-2.0
502
// Databricks notebook source // MAGIC %md // MAGIC ScaDaMaLe Course [site](https://lamastex.github.io/scalable-data-science/sds/3/x/) and [book](https://lamastex.github.io/ScaDaMaLe/index.html) // COMMAND ---------- // MAGIC %md // MAGIC # Graph Spectral Analysis // MAGIC ##### Project by Ciwan Ceylan and Hanna Hu...
lamastex/scalable-data-science
dbcArchives/2021/000_0-sds-3-x-projects/student-project-21_group-GraphSpectralAnalysis/00_introduction.scala
Scala
unlicense
6,566
/* * Copyright 2015 TouchType Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
methodmill/spark-redshift
src/test/scala/com/databricks/spark/redshift/ConversionsSuite.scala
Scala
apache-2.0
1,867
package scala.slick.jdbc.meta import scala.slick.session.PositionedResult /** * A qualified name with an optional catalog and schema. */ case class MQName(catalog: Option[String], schema: Option[String], name: String) { override def toString = "MQName(" + catalog.map(_ + ".").getOrElse("") + schema.map(_ + ".").g...
szeiger/scala-query
src/main/scala/scala/slick/jdbc/meta/MQName.scala
Scala
bsd-2-clause
748
package com.github.ldaniels528.trifecta.sjs.controllers import io.scalajs.npm.angularjs.Scope import io.scalajs.util.ScalaJsHelper._ import scala.scalajs.js /** * Created by ldaniels on 12/14/15. */ @js.native trait GlobalErrorHandling extends js.Object { self: Scope => // properties var globalMessages: j...
ldaniels528/trifecta
app-js/src/main/scala/com/github/ldaniels528/trifecta/sjs/controllers/GlobalErrorHandling.scala
Scala
apache-2.0
1,016
package im.actor.server.push import java.nio.ByteBuffer import java.util.concurrent.TimeUnit import scala.annotation.meta.field import scala.annotation.tailrec import scala.concurrent._ import scala.concurrent.duration._ import scala.util.{ Failure, Success } import akka.actor._ import akka.contrib.pattern.{ Cluster...
alessandrostone/actor-platform
actor-server/actor-push/src/main/scala/im/actor/server/push/SeqUpdatesManager.scala
Scala
mit
28,497
package com.twitter.finagle.stats import java.util import java.util.Collections import scala.collection.JavaConverters._ import org.scalatest.funsuite.AnyFunSuite class MetricsViewTest extends AnyFunSuite { private val EmptySnapshot: Snapshot = new Snapshot { def count: Long = 0L def sum: Long = 0L def...
twitter/finagle
finagle-stats-core/src/test/scala/com/twitter/finagle/stats/MetricsViewTest.scala
Scala
apache-2.0
3,240
/* # Copyright 2016 Georges Lipka # # 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 wri...
glipka/Easy-React-With-ScalaJS
src/main/scala/com/glipka/easyReactJS/reactBootstrap/NavBar.scala
Scala
apache-2.0
1,728
package com.komanov.uuid import java.lang.Long.parseLong import java.util.UUID object UuidScala1Utils { /** * A fast version of java.util.UUID#fromString. Less memory allocations (in JDK implementation there are 6 redundant * allocation: array allocation for split and 5 string concatenations "0x" + compone...
dkomanov/stuff
src/com/komanov/uuid/UuidScala1Utils.scala
Scala
mit
1,522
package com.lookout.borderpatrol.session import argonaut._ import Argonaut._ import scala.util.Try package object id { implicit def SessionIdCodecJson: CodecJson[SessionId] = casecodec4(SessionId.apply, SessionId.unapply)("expires", "entropy", "secretId", "signature") implicit class SessionIdSerialize(val ...
rtyler/borderpatrol
borderpatrol-core/src/main/scala/com/lookout/borderpatrol/session/id/package.scala
Scala
mit
1,045
package com.emstlk.nacl4s.crypto.verify object Verify { private def verify(x: Array[Byte], xOffset: Int, y: Array[Byte], count: Int): Boolean = { var differentBits = 0 var i = 0 while (i < count) { differentBits |= x(xOffset + i) ^ y(i) i += 1 } 0 == (1 & (((differentBits & 0xff) - ...
emstlk/nacl4s
src/main/scala/com/emstlk/nacl4s/crypto/verify/Verify.scala
Scala
mit
534
package controllers import javax.inject.Singleton import play.api.mvc._ @Singleton class Application extends Controller { def index = Action { Ok(views.html.index()) } }
JustinMullin/mtg-search
app/controllers/Application.scala
Scala
apache-2.0
183