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.emstlk.nacl4s.crypto
import com.emstlk.nacl4s.crypto.Utils._
import com.emstlk.nacl4s.crypto.box.Curve25519XSalsa20Poly1305._
object Box {
def randomNonce() = {
val nonce = new Array[Byte](nonceBytes)
random.nextBytes(nonce)
nonce
}
}
case class Box(publicKey: Array[Byte], privateKey: A... | emstlk/nacl4s | src/main/scala/com/emstlk/nacl4s/crypto/Box.scala | Scala | mit | 941 |
/*
* Copyright (c) 2013 Aviat Networks.
* This file is part of DocReg+Web. Please refer to the NOTICE.txt file for license details.
*/
package vvv.docreg.snippet
import _root_.net.liftweb._
import http._
import S._
import SHtml._
import common._
import util._
import Helpers._
import js._
import JsCmds._
import _ro... | scott-abernethy/docreg-web | src/main/scala/vvv/docreg/snippet/Search.scala | Scala | gpl-3.0 | 2,797 |
package semantics
/**
* Created by inzamamrahaman on 14/11/2015.
*/
import interpreter.Interpreter.State
import scala.annotation.tailrec
sealed abstract class JayExpression {
private def binOperationMatch(op: JayBinOp, val1: JayValue, val2: JayValue): Either[JayValue, String] =
(op, val1.getCorrectType, v... | InzamamRahaman/JayInterpreter | src/main/scala/semantics/JayExpression.scala | Scala | mit | 2,563 |
package common
import upickle._
import org.scalajs.dom.XMLHttpRequest
import org.scalajs.dom.ext.Ajax
import shared._
class ExtAjax(ajax: Ajax.type) {
def postAsForm(url: String,
data: String = "",
timeout: Int = 0,
headers: Map[String, String] = Map.empty,
... | gurghet/rota-scalajs | example-client/src/main/scala/common/ExtAjax.scala | Scala | mit | 1,636 |
/*
* Accio is a platform to launch computer science experiments.
* Copyright (C) 2016-2018 Vincent Primault <v.primault@ucl.ac.uk>
*
* Accio 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... | privamov/accio | accio/java/fr/cnrs/liris/lumos/storage/memory/MemoryJobStore.scala | Scala | gpl-3.0 | 2,778 |
/**
* Copyright (C) 2012 Kaj Magnus Lindberg (born 1979)
*
* 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) any later version.
... | debiki/debiki-server-old | app/debiki/ReactJson.scala | Scala | agpl-3.0 | 9,747 |
package lila.db
import com.typesafe.config.Config
import play.modules.reactivemongo.ReactiveMongoPlugin
import reactivemongo.api.DB
import Types._
final class Env(config: Config) {
lazy val db = {
import play.api.Play.current
ReactiveMongoPlugin.db
}
def apply(name: String): Coll = db(name)
}
object ... | Happy0/lila | modules/db/src/main/Env.scala | Scala | mit | 427 |
/** Sangria GraphQL server library.
*
* Sangria is a library that provides parsing, validation, execution and other services for GraphQL
* queries.
*
* It typically requires other libraries to build a complete GraphQL service—including, perhaps,
* ones that provide a HTTP service interface and a database in... | sangria-graphql/sangria | modules/core/src/main/scala/sangria/package.scala | Scala | apache-2.0 | 688 |
package ch3
import List._
object Exercise2 {
def tail[T](l: List[T]) = l match {
case Nil => Nil
case Cons(x, Nil) => Nil
case Cons(x, xs) => xs
}
}
import Exercise2._
/*
from repl you can test typing:
:load src/main/scala/fpinscala/ch3/List.scala
:load src/main/scala/fpinscala/ch3/Exercise2.sca... | rucka/fpinscala | src/main/scala/fpinscala/ch3/Exercise2.scala | Scala | gpl-2.0 | 393 |
package uk.gov.bis.levyApiMock.mongo
import play.api.libs.json.Json.JsValueWrapper
import play.api.libs.json._
import play.modules.reactivemongo.ReactiveMongoApi
import reactivemongo.api.Cursor
import reactivemongo.play.json.compat._
import json2bson._
import scala.concurrent.{ExecutionContext, Future}
import reacti... | SkillsFundingAgency/das-alpha-hmrc-api-mock | src/main/scala/uk/gov/bis/levyApiMock/mongo/MongoCollection.scala | Scala | mit | 1,803 |
package xitrum.handler.outbound
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class RangeParserTest extends AnyFlatSpec with Matchers {
behavior of "RangeParser"
def test(spec: String, expected: RangeParserResult): Unit = {
"parse" should s"handle $spec" in {
R... | xitrum-framework/xitrum | src/test/scala/xitrum/handler/outbound/RangeParserTest.scala | Scala | mit | 1,252 |
package com.aristocrat.mandrill.requests.Senders
import com.aristocrat.mandrill.requests.MandrillRequest
case class TimeSeries(key: String, address: String) extends MandrillRequest
| aristocratic/mandrill | src/main/scala/com/aristocrat/mandrill/requests/Senders/TimeSeries.scala | Scala | mit | 183 |
/* Title: Pure/ML/ml_lex.scala
Author: Makarius
Lexical syntax for Isabelle/ML and Standard ML.
*/
package isabelle
import scala.collection.mutable
import scala.util.parsing.input.{Reader, CharSequenceReader}
object ML_Lex
{
/** keywords **/
val keywords: Set[String] =
Set("#", "(", ")", ",... | wneuper/libisabelle | pide/2015/src/main/scala/ML/ml_lex.scala | Scala | mit | 9,926 |
/*
* 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 ... | aljoscha/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdColumnUniqueness.scala | Scala | apache-2.0 | 26,190 |
/*
* 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 not u... | rafaelbarreto87/spark-cassandra-connector | project/CassandraSparkBuild.scala | Scala | apache-2.0 | 11,813 |
/*
* Copyright 2017 Zhang Di
*
* 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 ... | statgenetics/seqspark | src/main/scala/org/dizhang/seqspark/annot/RefGene.scala | Scala | apache-2.0 | 4,208 |
/*
* Copyright 2007-2010 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... | jeppenejsum/liftweb | framework/lift-persistence/lift-record/src/main/scala/net/liftweb/record/field/EnumField.scala | Scala | apache-2.0 | 3,637 |
/*
* 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 ... | gioenn/xSpark | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggUtils.scala | Scala | apache-2.0 | 16,348 |
package pl.edu.agh.mplt.parser.AMPL
import org.scalatest.{Matchers, FlatSpec}
import pl.edu.agh.mplt.parser.{AMPLParser, IntercodeImplicits}
import pl.edu.agh.mplt.parser.phrase.set.{Indexing, IndexedSet}
import pl.edu.agh.mplt.parser.reference.SimpleReference
import pl.edu.agh.mplt.parser.declaration.data.SetDe... | marek1840/MPLT | src/test/scala/pl/edu/agh/mplt/parser/AMPL/CommentsTest.scala | Scala | mit | 1,029 |
package com.socrata.balboa.admin
import com.socrata.balboa.admin.tools.Lister
import com.socrata.balboa.metrics.data.{DataStore, DataStoreFactory}
import org.scalatest.{FlatSpec, Matchers}
import org.scalatest.mock.MockitoSugar
import org.mockito.Mockito._
import org.mockito.ArgumentMatchers.{eq => eqTo}
import scala... | socrata-platform/balboa | balboa-admin/src/test/scala/com/socrata/balboa/admin/ListerTest.scala | Scala | apache-2.0 | 1,463 |
package org.bone.ircballoon.model
case class IRCInfo(
hostname: String, port: Int, nickname: String,
channel: String, password: Option[String] = None,
showJoin: Boolean, showLeave: Boolean
)
case class IRCUser(nickname: String, isOP: Boolean, isBroadcaster: Boolean)
| brianhsu/IRCBalloon | src/main/scala/model/IRCModel.scala | Scala | gpl-3.0 | 278 |
package utils.remote.amazon.operation
import play.api.test._
import utils.remote.amazon.stackable.CartRG
import scala.concurrent.duration.FiniteDuration
import utils.remote.amazon.AmazonSpecification
/**
* @author alari (name.alari@gmail.com)
* @since 24.10.13 13:59
*/
class CartCreateSpec extends AmazonSpecifica... | alari/amazon-scala-ecommerce | src/test/scala/amazon/operation/CartCreateSpec.scala | Scala | apache-2.0 | 734 |
/*
* 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 ... | zhangjunfang/eclipse-dir | spark/external/kafka/src/main/scala/org/apache/spark/streaming/kafka/KafkaUtils.scala | Scala | bsd-2-clause | 6,565 |
package net.lshift.diffa.kernel.diag
import collection.mutable.{ListBuffer, HashMap}
import net.lshift.diffa.kernel.differencing.{PairScanState, PairScanListener}
import net.lshift.diffa.kernel.lifecycle.{NotificationCentre, AgentLifecycleAware}
import org.slf4j.LoggerFactory
import java.io._
import java.util.zip.{Zip... | aprescott/diffa | kernel/src/main/scala/net/lshift/diffa/kernel/diag/LocalDiagnosticsManager.scala | Scala | apache-2.0 | 7,962 |
package cn.hjmao.learning.akka.http.demo.model.db
import cn.hjmao.learning.akka.http.demo.model.TokenEntity
/**
* Created by hjmao on 17-5-10.
*/
trait TokenEntityTable extends UserEntityTable {
protected val datasource: DataSource
import datasource.driver.api._
class Token(tag: Tag) extends Table[TokenEntit... | huajianmao/learning | framework/akka-http/demo/src/main/scala/cn/hjmao/learning/akka/http/demo/model/db/TokenEntityTable.scala | Scala | mit | 774 |
package tastytest
import Logarithms._
object TestLogarithms extends Suite("TestLogarithms") {
val Some(l1) = Logarithm.of(2)
val Some(l2) = Logarithm.of(3)
test(assert((l1 + l2).toDouble == 4.999999999999999))
test(assert((l1 * l2).toDouble == 6.0))
}
| scala/scala | test/tasty/run/src-2/tastytest/TestLogarithms.scala | Scala | apache-2.0 | 265 |
/*
* FlatBP.scala
* A structured factored inference algorithm using belief propagation.
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: March 1, 2015
*
* Copyright 2015 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
... | scottcb/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/structured/algorithm/flat/FlatBP.scala | Scala | bsd-3-clause | 2,699 |
package model
import org.scalatest.{BeforeAndAfterEach, FlatSpec, Matchers}
import scala.collection.immutable.HashSet
/**
* Created by salim on 9/9/2016.
*/
class GraphSpec extends FlatSpec with Matchers with BeforeAndAfterEach {
var w: World = null
override def beforeEach(): Unit = {
super.beforeEach... | salimfadhley/scalamoo | src/test/scala/model/GraphSpec.scala | Scala | mit | 1,507 |
package ionroller.aws
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient
import com.amazonaws.services.dynamodbv2.document._
import com.amazonaws.services.dynamodbv2.document.spec.{QuerySpec, ScanSpec}
import com.amazonaws.services.dynamodbv2.model._
import ionroller.tracking._
import ionroller.{JsonUtil, T... | yonglehou/ionroller | core/src/main/scala/ionroller/aws/Dynamo.scala | Scala | mit | 17,157 |
/**
* Copyright 2013 Netflix, 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 ... | zjrstar/RxScala | src/main/scala/rx/lang/scala/subjects/package.scala | Scala | apache-2.0 | 716 |
import scala.tools.partest.ReplTest
object MyApp extends dotty.runtime.LegacyApp {
Console println "Hello, delayed world."
}
object Test extends ReplTest {
def code = ":javap -app MyApp$"
override def welcoming = true
// The constant pool indices are not the same for GenASM / GenBCode, so
// replacing th... | yusuke2255/dotty | tests/pending/run/repl-javap-app.scala | Scala | bsd-3-clause | 555 |
/**
* 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... | Zhiqiang-He/kafka-0914-edit | core/src/main/scala/kafka/server/ReplicaManager.scala | Scala | apache-2.0 | 47,229 |
/**
* 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 not... | mihbor/kafka | core/src/test/scala/unit/kafka/admin/ReassignPartitionsClusterTest.scala | Scala | apache-2.0 | 31,257 |
package scalapb
object Scalapb {
def getDescriptor(): com.google.protobuf.Descriptors.FileDescriptor = {
throw new NotImplementedError("Descriptors are not implemented yet for ScalaJS.")
}
}
| dotty-staging/ScalaPB | scalapb-runtime/non-jvm/src/main/scala/scalapb/Scalapb.scala | Scala | apache-2.0 | 200 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package top.template
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.base.Import
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org... | advancedxy/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/top/template/TemplateStat.scala | Scala | apache-2.0 | 1,191 |
package kvstore
import akka.actor.{Actor, ActorRef, Props, ReceiveTimeout}
import scala.concurrent.duration._
import scala.language.postfixOps
object Replicator {
case class Replicate(key: String, valueOption: Option[String], id: Long)
case class Replicated(key: String, id: Long)
case class Snapshot(key: St... | alexlloreda/reactive | kvstore/src/main/scala/kvstore/Replicator.scala | Scala | mit | 2,438 |
package org.jetbrains.plugins.scala.lang.psi.stubs.elements.signatures
import com.intellij.psi.PsiElement
import com.intellij.psi.stubs.{StubElement, StubInputStream, StubOutputStream}
import com.intellij.util.io.StringRef
import org.jetbrains.plugins.scala.lang.psi.api.statements.params.{ScClassParameter, ScParameter... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/psi/stubs/elements/signatures/ScParamElementType.scala | Scala | apache-2.0 | 2,914 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monifu/monifu | monix-eval/shared/src/test/scala/monix/eval/CoevalRightSuite.scala | Scala | apache-2.0 | 976 |
package models
import java.util.UUID
case class MajorSubject(majorID: UUID, subject: Subject, required: Boolean)
| yoo-haemin/hufs-planner | project/app/models/MajorSubject.scala | Scala | agpl-3.0 | 115 |
package gsd.linux.stats
import gsd.linux._
import java.io.PrintStream
import com.sun.xml.internal.ws.developer.MemberSubmissionAddressing.Validation
class ASEStatistics(val ck: ConcreteKConfig)
extends FeatureStatistics(ck) with VisibilityStatistics {
// Feature Kinds
// menus, menuconfigs, configs, choice
/... | AlexanderKnueppel/is-there-a-mismatch | Source/KConfigTranslator/src/main/scala/gsd/linux/stats/ASEStatistics.scala | Scala | lgpl-3.0 | 2,750 |
/*
* Copyright 2017 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/kantan.mongodb | core/src/main/scala/kantan/mongodb/io/LongCodec.scala | Scala | apache-2.0 | 1,103 |
/*
* This file is part of the Linux Variability Modeling Tools (LVAT).
*
* Copyright (C) 2011 Steven She <shshe@gsd.uwaterloo.ca>
*
* LVAT 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 v... | scas-mdd/linux-variability-analysis-tools.fm-translation | src/main/scala/gsd/linux/stats/DeadFeaturesMain.scala | Scala | gpl-3.0 | 3,440 |
package org.jetbrains.plugins.scala
package lang
package transformation
package types
/**
* @author Pavel Fatin
*/
class ExpandTupleTypeTest extends TransformerTest(new ExpandTupleType()) {
def testTuple2(): Unit = check(
before = "val v: (A, B)",
after = "val v: Tuple2[A, B]"
)()
def testTuple3():... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/lang/transformation/types/ExpandTupleTypeTest.scala | Scala | apache-2.0 | 745 |
package com.nthportal.concurrent
import java.util.concurrent.Callable
package object _cancellable_task {
@inline
private[concurrent] def callable[A](body: => A): Callable[A] = () => body
}
| NthPortal/cancellable-task | src/main/scala-2.12/com/nthportal/concurrent/_cancellable_task/package.scala | Scala | apache-2.0 | 195 |
/*
* Copyright 2010 LinkedIn
*
* 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 w... | quipo/kafka | core/src/main/scala/kafka/javaapi/MultiFetchResponse.scala | Scala | apache-2.0 | 1,464 |
package modelservice.core
import scala.util.{Success, Failure}
import scala.concurrent.Future
import akka.actor._
import akka.cluster.{Cluster, MemberStatus}
import akka.cluster.ClusterEvent._
import akka.routing.{ActorRefRoutee, RemoveRoutee, RoundRobinPool}
import com.typesafe.config.ConfigFactory
import modelserv... | kiip/model-service | src/main/scala/modelservice/core/Core.scala | Scala | bsd-3-clause | 9,903 |
package cromwell.engine.backend.jes
import com.google.api.client.util.ArrayMap
import com.google.api.services.genomics.{Genomics, model}
import com.google.api.services.genomics.model.{CancelOperationRequest, LoggingOptions, Pipeline, RunPipelineArgs, RunPipelineRequest, ServiceAccount, _}
import com.typesafe.config.Co... | cowmoo/cromwell | engine/src/main/scala/cromwell/engine/backend/jes/Run.scala | Scala | bsd-3-clause | 9,230 |
package com.github.j5ik2o.reactive.redis.feature
import java.util.UUID
import cats.data.NonEmptyList
import com.github.j5ik2o.reactive.redis._
import com.github.j5ik2o.reactive.redis.command.sets.{ SAddFailed, SAddRequest, SAddSucceeded, SAddSuspended }
trait SetsAPI[M[_]] {
def sAdd(key: String, member: String, m... | j5ik2o/reactive-redis | core/src/main/scala/com/github/j5ik2o/reactive/redis/feature/SetsFeature.scala | Scala | mit | 1,238 |
package com.twitter.finagle.util
import com.twitter.finagle.Stack
import com.twitter.finagle.param.Label
import com.twitter.util.registry.GlobalRegistry
import java.util.concurrent.atomic.AtomicInteger
import scala.language.existentials
object StackRegistry {
/**
* Represents an entry in the registry.
*/
ca... | cogitate/twitter-finagle-uuid | finagle-core/src/main/scala/com/twitter/finagle/util/StackRegistry.scala | Scala | apache-2.0 | 3,632 |
/*
* 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 ... | HuaweiBigData/carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/AlterTableUnsetCommand.scala | Scala | apache-2.0 | 2,068 |
/**
* Copyright 2009 Jorge Ortiz
*
* 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... | mamdouhweb/nscala-time | src/main/scala/com/github/nscala_time/time/RichDateTimeZone.scala | Scala | apache-2.0 | 839 |
package controllers
import java.sql.{Array =>_, _}
object Test {
def testInt() = {
val numsList = List( (1 to 100), (1 to 10000), (1 to 10000) )
val rownumsList = List( (1 to 1000 ) , (1 to 5000), (1 to 10000) )
numsList.foreach { nums =>
(1 to 10).foreach { t =>
Application.time("Relate: Select ... | lucidsoftware/relate-benchmarks | app/controllers/Test.scala | Scala | mit | 4,967 |
package main.scala.Trivia
import java.util.{ArrayList, LinkedList}
class Game {
var players: ArrayList[String] = new ArrayList[String]
var places: Array[Int] = new Array[Int](6)
var purses: Array[Int] = new Array[Int](6)
var inPenaltyBox: Array[Boolean] = new Array[Boolean](6)
var popQuestions: LinkedList[S... | ollielo/ScalaKata | src/main/scala/Trivia/Game.scala | Scala | mit | 4,622 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package docs.home.scaladsl.persistence
import scala.collection.immutable
import com.lightbend.lagom.scaladsl.playjson.JsonSerializerRegistry
import com.lightbend.lagom.scaladsl.playjson.JsonSerializer
object BlogPostSerializerRegistry exte... | ignasi35/lagom | docs/manual/scala/guide/cluster/code/docs/home/scaladsl/persistence/BlogPostSerializerRegistry.scala | Scala | apache-2.0 | 496 |
package org.jetbrains.plugins.scala.performance
import java.io.File
import java.util
import com.intellij.lang.javascript.boilerplate.GithubDownloadUtil
import com.intellij.openapi.externalSystem.model.ProjectSystemId
import com.intellij.openapi.externalSystem.settings.ExternalProjectSettings
import com.intellij.opena... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/performance/DownloadingAndImportingTestCase.scala | Scala | apache-2.0 | 5,319 |
package gapt.formats.tip.transformation
import gapt.formats.tip.analysis.SymbolTable
import gapt.formats.tip.parser.TipSmtAnd
import gapt.formats.tip.parser.TipSmtAssertion
import gapt.formats.tip.parser.TipSmtCase
import gapt.formats.tip.parser.TipSmtConstructorPattern
import gapt.formats.tip.parser.TipSmtEq
import g... | gapt/gapt | core/src/main/scala/gapt/formats/tip/transformation/variableMatchExpansion.scala | Scala | gpl-3.0 | 8,982 |
package com.twitter.finagle.httpx.codec
import org.jboss.netty.channel.{ChannelHandlerContext, MessageEvent, SimpleChannelHandler}
import org.jboss.netty.handler.codec.http.HttpRequest
import org.jboss.netty.handler.ssl.SslHandler
/**
* Extract the cipher from the SslHandler and set it as a header on the HTTP
* re... | jamescway/finagle | finagle-httpx/src/main/scala/com/twitter/finagle/httpx/codec/AnnotateCipher.scala | Scala | apache-2.0 | 783 |
package de.commercetools.graphite
import java.util.concurrent.TimeUnit
import language.postfixOps
import org.influxdb.InfluxDB.ConsistencyLevel
import org.influxdb.InfluxDBFactory
import org.influxdb.dto.{Point, BatchPoints}
import rx.lang.scala.Observable
import scala.concurrent.duration._
import scala.util.{Rand... | geoand/mongo-metrics-reporter | src/main/scala/de/commercetools/graphite/InfluxDBTest.scala | Scala | apache-2.0 | 1,430 |
package com.eevolution.context.dictionary.domain.api.service
import com.eevolution.context.dictionary._
import com.eevolution.context.dictionary.domain.model.Tenant
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribute it and... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/service/TenantService.scala | Scala | gpl-3.0 | 1,183 |
//package test
// scalastyle:off println
package org.apache.spark.examples.mllib
import java.text.BreakIterator
import scala.collection.mutable
import scopt.OptionParser
import org.apache.log4j.{ Level, Logger }
import org.apache.spark.{ SparkContext, SparkConf }
import org.apache.spark.mllib.clustering.{ EMLDAOptim... | HGladiator/MyCodes | Scala/lda.scala | Scala | mit | 10,660 |
/*
*************************************************************************************
* Copyright 2013 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | jooooooon/rudder | rudder-web/src/main/scala/com/normation/rudder/web/services/DiffDisplayer.scala | Scala | agpl-3.0 | 5,805 |
/*
* NodeView.scala
* (Cord)
*
* Copyright (c) 2015-2020 Hanns Holger Rutz.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.cord
package view
import de.sciss.cord.v... | Sciss/Cord | src/main/scala/de/sciss/cord/view/NodeView.scala | Scala | lgpl-2.1 | 696 |
package fly.play.aws.auth
object UrlEncoder {
def encodePath(value: String) =
encode(value).replace("%2F", "/")
def encode(value: String): String =
java.net.URLEncoder.encode(value, "UTF-8")
.replace("+", "%20")
.replace("*", "%2A")
.replace("%7E", "~")
} | fooblahblah/play-aws-utils | src/main/scala/fly/play/aws/auth/UrlEncoder.scala | Scala | mit | 287 |
package org.jobimtext.coref.berkeley
object MathHelper {
private val logOf2 = Math.log(2.0)
def log2(d: Double) = Math.log(d) / logOf2
}
| timfeu/berkeleycoref-thesaurus | src/main/java/org/jobimtext/coref/berkeley/MathHelper.scala | Scala | gpl-3.0 | 143 |
/*
* Copyright 2022 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/nisp-frontend | app/uk/gov/hmrc/nisp/controllers/FeedbackController.scala | Scala | apache-2.0 | 5,123 |
/*
* 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 ... | DieBauer/flink | flink-streaming-scala/src/test/scala/org/apache/flink/streaming/api/scala/WindowFunctionITCase.scala | Scala | apache-2.0 | 8,996 |
package com.swissguard.services
import javax.inject.{Inject, Singleton}
import com.twitter.util.Future
import com.swissguard.repositories.UserRepository
import com.swissguard.authentication.thriftscala.Claims
import com.swissguard.tokenizer.Tokenizer
@Singleton
class AuthenticationService @Inject()(
userRepository:... | divanvisagie/swiss-guard | authentication/src/main/scala/com/swissguard/services/AuthenticationService.scala | Scala | apache-2.0 | 837 |
package com.teamisotope.techexpansion.proxy
import net.minecraftforge.fml.common.event._
class ServerProxy extends CommonProxy {
override def preInit(event: FMLPreInitializationEvent): Unit = {
super.preInit(event)
}
override def init(event: FMLInitializationEvent): Unit = {
super.init(event)
}
o... | collaborationmods/TechExpansion | src/main/scala/com/teamisotope/techexpansion/proxy/ServerProxy.scala | Scala | gpl-3.0 | 419 |
import scala.annotation.compileTimeOnly
class C(val s: String) extends AnyVal {
@compileTimeOnly("error")
def error = ???
}
| loskutov/intellij-scala | testdata/scalacTests/pos/t8498.scala | Scala | apache-2.0 | 129 |
/*
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package play.routes.compiler
import play.twirl.api.{ Format, BufferedContent }
import scala.collection.immutable
/**
* Twirl scala content type
*/
class ScalaContent(elements: immutable.Seq[ScalaContent], text: String) extends BufferedConten... | jyotikamboj/container | pf-framework/src/routes-compiler/src/main/scala/play/routes/compiler/ScalaFormat.scala | Scala | mit | 812 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/nn/keras/nn/PermuteSpec.scala | Scala | apache-2.0 | 2,100 |
import org.apache.solr.client.solrj.SolrClient
import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer
import org.apache.solr.client.solrj.request.FieldAnalysisRequest
import org.apache.solr.common.util.NamedList
import org.apache.solr.core.CoreContainer
import java.util.Collections
import scala.Console._
obj... | MysterionRise/information-retrieval-adventure | lucene6/src/main/scala/SynonymGraph.scala | Scala | gpl-2.0 | 989 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | typelevel/squants | shared/src/main/scala/squants/motion/Force.scala | Scala | apache-2.0 | 3,970 |
/*
* 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-common/src/main/scala/org/eligosource/eventsourced/journal/common/util/package.scala | Scala | apache-2.0 | 1,431 |
object test {
abstract class Bar {
type T
def bar: Unit
}
new Bar {
type T = Int
def bar = ()
}.bar
}
| yusuke2255/dotty | tests/untried/pos/t615.scala | Scala | bsd-3-clause | 127 |
package au.com.agiledigital.rest.tests
import java.util.concurrent.TimeUnit
import org.specs2.control.NoLanguageFeatures
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import scala.concurrent.duration.FiniteDuration
/**
* A base trait for Specs2 specifications.
*/
trait BaseSpec extends ... | agiledigital/play-rest-support | testkit/src/main/scala/au/com/agiledigital/rest/tests/BaseSpec.scala | Scala | apache-2.0 | 1,052 |
package sample.blog.processes
import akka.actor.ActorLogging
import akka.persistence.{ AtLeastOnceDelivery, PersistentActor }
object Table2 {
sealed trait Command
final case class Mark(id: Long) extends Command
sealed trait Event
case class WatermarkMark(id: Long) extends Event
sealed trait Reply
case ... | haghard/akka-pq | src/main/scala/sample/blog/processes/Table2.scala | Scala | apache-2.0 | 974 |
package HackerRank.Training.BasicProgramming
import java.io.{ByteArrayInputStream, IOException, InputStream, PrintWriter}
import java.util.InputMismatchException
import scala.collection.generic.CanBuildFrom
import scala.language.higherKinds
/**
* Copyright (c) 2017 A. Roberto Fischer
*
* @author A. Roberto Fis... | robertoFischer/hackerrank | src/main/scala/HackerRank/Training/BasicProgramming/ServiceLane.scala | Scala | mit | 8,681 |
package skuber
import java.util.Date
/**
* @author David O'Riordan
*/
case class Node(
val kind: String ="Node",
override val apiVersion: String = v1,
val metadata: ObjectMeta,
spec: Option[Node.Spec] = None,
status: Option[Node.Status] = None)
extends ObjectResource {
def withResourc... | doriordan/skuber | client/src/main/scala/skuber/Node.scala | Scala | apache-2.0 | 2,674 |
/*
* Copyright (c) 2015,
* Ilya Sergey, Christopher Earl, Matthew Might and David Van Horn
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain t... | ilyasergey/reachability | src/org/ucombinator/lambdajs/syntax/LJSyntax.scala | Scala | bsd-3-clause | 14,564 |
package utils
import java.sql.Date
import entity.{User, Article}
import entity.form._
import security.Encryptor.ImplicitEc
import scala.language.implicitConversions
/**
* Samsara Aquarius Utils
* Implicit Form Converter
*/
object FormConverter {
implicit def infoConvert(data: InfoFormData): Article = {
... | sczyh30/samsara-aquarius | app/utils/FormConverter.scala | Scala | mit | 661 |
package zangelo.spray.json
import org.specs2.mutable.Specification
import spray.json._
import zangelo.spray.json.annotation._
trait TestObject extends Product
object TestProtocol
extends DefaultJsonProtocol
with AutoProductFormats[TestObject]
//TODO needs to be a top-level class so companion symbol is accessibl... | zackangelo/spray-json-macros | src/test/scala/zangelo/spray/json/AutoProductFormatsSpec.scala | Scala | apache-2.0 | 13,072 |
package com.circusoc.simplesite.users
import com.circusoc.simplesite.GraphTestingConf
import com.circusoc.simplesite.users.permissions.Permission
import com.circusoc.testgraph.{UserTestGraph, TestNodeFactory}
import org.scalatest.FlatSpec
import org.scalatest.Matchers._
/**
* Created by riri on 25/01/15.
*/
class U... | ririw/circusoc-backend | src/test/scala/com/circusoc/simplesite/users/UserGraphSpec.scala | Scala | agpl-3.0 | 1,337 |
object foo {
sealed trait Exp[T]
case class Var[T](name: String) extends Exp[T]
def env[T](x: Var[T]): T = ???
def eval[S](e: Exp[S]) = e match {
case v: Var[foo] =>
env(v)
}
}
| som-snytt/dotty | tests/pos/gadt-foo.scala | Scala | apache-2.0 | 199 |
package com.outr.nextui.examples
import com.outr.nextui.UI
object Examples {
val examples = Vector(
HelloWorld,
ContainerExample,
EasingExample,
ImageExample,
LabelExample,
ScreensExample,
VirtualSizeExample,
AddRemoveExample,
AnimationExample
)
def apply(): Vector[UI] = exa... | outr/nextui | examples/src/main/scala/com/outr/nextui/examples/Examples.scala | Scala | mit | 327 |
package org.sisioh.aws4s.s3.model
import com.amazonaws.services.s3.model.{ BucketTaggingConfiguration, TagSet }
import org.sisioh.aws4s.PimpedType
import scala.collection.JavaConverters._
object BucketTaggingConfigurationFactory {
def create(): BucketTaggingConfiguration = new BucketTaggingConfiguration()
def ... | everpeace/aws4s | aws4s-s3/src/main/scala/org/sisioh/aws4s/s3/model/RichBucketTaggingConfiguration.scala | Scala | mit | 772 |
package com.tuvistavie.xserver.frontend.auth
import play.api.Play
import play.api.mvc.{ RequestHeader, AnyContent }
import scala.sys.process.Process
import com.tuvistavie.xserver.frontend.util.Config
trait PasswordAuthentication {
def authenticate(username: String, password: String): Option[User]
}
trait TokenAut... | tuvistavie/scala-x-server | frontend/app/auth/Authentication.scala | Scala | mit | 1,539 |
package com.github.kfang.mongo4s.commands
import reactivemongo.bson.{BSONValue, Producer, BSONDocument}
import reactivemongo.core.commands.GetLastError
case class RemoveQuery(
sel: BSONDocument,
writeConcern: GetLastError = GetLastError(),
firstMatchOnly: Boolean = true
){
def writeConcern(gle: GetLastError):... | kfang/mongo4s | src/main/scala/com/github/kfang/mongo4s/commands/RemoveDsl.scala | Scala | mit | 1,769 |
package incognito.anonymization.dichotomize
import org.apache.spark.rdd.RDD
import org.apache.spark._
import incognito.rdd.ECKey
import incognito.rdd.BucketSizes
import org.apache.spark.rdd.RDD.rddToPairRDDFunctions
import org.apache.spark.rdd.EmptyRDD
import breeze.linalg.Vector
import incognito.rdd.BucketSizes
imp... | achak1987/SparkAnonymizationToolkit | src/main/scala/incognito/anonymization/dichotomize/IDichotomize.scala | Scala | apache-2.0 | 6,733 |
package examples.circe
import io.circe._
import io.circe.syntax._
import io.circe.Decoder._
import scalaz._, Scalaz._
object Example01 extends App {
// a: Any
case class User(id: Long, handle: String, display: Any) {
def displayAsJson: Json = ???
}
val a1 = User(1, "test", 1)
val a2 = User(1, "tes... | adilakhter/scalaznoob | src/main/scala/examples/circe/Example01.scala | Scala | apache-2.0 | 1,609 |
/***
MIT License
Copyright (c) 2018 Zifeng Deng
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 use, copy, modify, merge, publish, ... | binape/code-snippets | 00-QuickExamples/NFA01.scala | Scala | mit | 2,443 |
/*
* 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 ... | pgandhi999/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/types/MapType.scala | Scala | apache-2.0 | 3,576 |
package eu.shiftforward.Elements
import eu.shiftforward.{Ground, Bus, Wire, CircuitSimulation}
trait Logic extends CircuitSimulation {
private def unaryLogicGate(input: Wire)(op: Boolean => Boolean) = {
val output = new Wire
input addAction { () =>
val inputSig = input.getSignal
schedule(Inverte... | hugoferreira/from-zero-to-computer | src/main/scala/eu/shiftforward/Elements/Logic.scala | Scala | mit | 2,440 |
package com.crobox.clickhouse.dsl
/**
* QueryFactory exposes all methods of OperationalQuery from a empty starting point (factoring new queries)
*/
trait QueryFactory extends OperationalQuery {
override val internalQuery: InternalQuery = InternalQuery()
}
| crobox/clickhouse-scala-client | dsl/src/main/scala/com.crobox.clickhouse/dsl/QueryFactory.scala | Scala | lgpl-3.0 | 263 |
package spray.oauth.adapters.inmemory.models
import com.github.nscala_time.time.Imports._
import org.joda.time.PeriodType
import spray.oauth.adapters.inmemory.utils.{ Entity, DAO, Sequence }
import spray.oauth.models.GrantType
import spray.oauth.utils.OAuth2Parameters._
import spray.oauth.utils.TokenGenerator
import s... | hasanozgan/spray-oauth | core/src/main/scala/spray/oauth/adapters/inmemory/models/Code.scala | Scala | apache-2.0 | 2,306 |
/*
Learning from this @author:wspringer
https://github.com/wspringer/scala-lzw/blob/master/src/main/scala/nl/flotsam/lzw/Node.scala
*/
trait Node {
def decode[T](i: Int, fn: (Byte) => T): Node
def encode[T](b: Byte, fn: (Int, Int) => T): Node
def apply[T](fn: (Byte) => T)
def root: Node
def bitsRequired... | jaimeguzman/learning | LzW-wspringer.scala | Scala | apache-2.0 | 4,093 |
/*
* 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 ... | kevinyu98/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/ConnectionProviderSuiteBase.scala | Scala | apache-2.0 | 2,682 |
package com.softwaremill.spray
import spray.routing.{RequestContext, Route, SimpleRoutingApp}
import akka.actor.{Props, Actor, ActorSystem}
object SprayComplete extends App with SimpleRoutingApp {
implicit val actorSystem = ActorSystem()
def secure(route: Route): Route = {
parameters("username", "password") ... | adamw/keep-it-simple-scala | src/main/scala/com/softwaremill/spray/SprayComplete.scala | Scala | apache-2.0 | 1,466 |
/*
* Copyright (C) 2017 HAT Data Exchange Ltd
* SPDX-License-Identifier: AGPL-3.0
*
* This file is part of the Hub of All Things project (HAT).
*
* HAT 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 Founda... | Hub-of-all-Things/HAT2.0 | hat/app/org/hatdex/hat/resourceManagement/models/HatSignup.scala | Scala | agpl-3.0 | 2,030 |
/*
* 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 ... | andrewor14/iolap | external/mqtt/src/main/scala/org/apache/spark/streaming/mqtt/MQTTUtils.scala | Scala | apache-2.0 | 2,968 |
Subsets and Splits
Filtered Scala Code Snippets
The query filters and retrieves a sample of code snippets that meet specific criteria, providing a basic overview of the dataset's content without revealing deeper insights.