code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package org.smartpony.consumer.kinesis
import java.util.UUID
import java.util.concurrent.{ConcurrentHashMap, Executors}
import com.amazonaws.ClientConfiguration
import com.amazonaws.services.kinesis.clientlibrary.interfaces.{IRecordProcessor, IRecordProcessorFactory}
import com.amazonaws.services.kinesis.clientlibrary... | Dextaa/smartpony | consumer/kinesis/src/main/scala/org/smartpony/consumer/kinesis/SmartPonyKinesisConsumer.scala | Scala | mit | 2,956 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2015, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | CapeSepias/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/javalib/util/TreeSetTest.scala | Scala | bsd-3-clause | 11,367 |
/*
* 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-core/src/main/scala/org/apache/samza/metrics/ContainerProcessManagerMetrics.scala | Scala | apache-2.0 | 3,589 |
package gg.powerspike
import akka.http.scaladsl.settings.ServerSettings
import com.typesafe.config.ConfigFactory
object Main {
def main(args: Array[String]): Unit = {
WebServer.startServer("localhost", 8080, ServerSettings(ConfigFactory.load))
}
}
| PowerSpikeGG/PowerSpikeGG | powerspikegg/gateway/src/main/scala/gg/powerspike/Main.scala | Scala | gpl-3.0 | 260 |
package lille1.car3.tpRest.util
import lille1.car3.tpRest.helper._
import lille1.car3.tpRest.rejection.RejectionHandlerRouting
import java.io.{ ByteArrayInputStream, InputStream, OutputStream, File, FileOutputStream, FileInputStream }
import java.io.FileNotFoundException
import scala.util.matching.Regex
import org.... | JimiPepper/m1car_tp2 | src/main/scala/lille1/car3/tpRest/util/RoutingService.scala | Scala | gpl-2.0 | 10,804 |
import scala.io.Source
import scala.collection.mutable.Stack
import java.io.FileNotFoundException
import java.lang.NumberFormatException
class Node{
var rank=0;
var terminal=0;
var link=scala.collection.mutable.Map[Char,Node]()
}
class Trie{
val root=new Node()
var flag=false
def this(args: Array[String]){
this... | KshitijKarthick/Predictive-Trie | src/Dictionary.scala | Scala | mit | 2,996 |
package com.stulsoft.exercises.logic.and.codes
/** Gray code
* {{{
* An n-bit Gray code is a sequence of n-bit strings constructed according to certain rules. For example,
* n = 1: C(1) = ("0", "1").
* n = 2: C(2) = ("00", "01", "11", "10").
* n = 3: C(3) = ("000", "001", "011", "010", "110", "111", "101", "... | ysden123/scala-exercises | src/main/scala/com/stulsoft/exercises/logic/and/codes/P49GrayCode.scala | Scala | mit | 972 |
package is.hail.io
import java.io.{ByteArrayInputStream, ByteArrayOutputStream, InputStream, OutputStream}
import is.hail.annotations.{Region, RegionValue}
import is.hail.asm4s.{Code, TypeInfo, Value}
import is.hail.expr.ir.{EmitClassBuilder, EmitCodeBuilder, EmitFunctionBuilder, ExecuteContext}
import is.hail.types.... | danking/hail | hail/src/main/scala/is/hail/io/CodecSpec.scala | Scala | mit | 3,992 |
/*
* 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/main/scala/org/apache/flink/table/calcite/FlinkTypeFactory.scala | Scala | apache-2.0 | 16,397 |
//
// Codex - a multi-language code indexer and grokker
// http://github.com/samskivert/codex
package codex.extract
import java.io.{File, InputStream, InputStreamReader, Reader, StreamTokenizer}
import scala.collection.mutable.ArrayBuffer
import codex._
/** Extracts CLR type information from DLLs. */
class MonodisE... | samskivert/codex | src/main/scala/codex/extract/MonodisExtractor.scala | Scala | bsd-3-clause | 3,015 |
package zamblauskas
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import zamblauskas.csv.parser.Parser._
import zamblauskas.csv.parser._
class ReadsMacroSpec extends AnyFunSpec with Matchers {
it("generate reads for single param case class") {
case class SingleParam(para... | zamblauskas/scala-csv-parser | src/test/scala/zamblauskas/ReadsMacroSpec.scala | Scala | mit | 918 |
class x0[x1] {
def x2: x1
}
trait x3 extends x0 { // error
class x2
var x2 = 0 // error
var x4 = x5 x2 // error
}
| som-snytt/dotty | tests/neg/parser-stability-7.scala | Scala | apache-2.0 | 118 |
package org.tuubes.core.network
import com.electronwill.niol.NiolOutput
import com.electronwill.niol.network.tcp.ClientAttach
/** A network packet that can be written */
trait Packet {
/** The packet's id in its protocol */
def id: Int
/** Writes this packet to the given output */
def write(out: NiolOutput):... | mcphoton/Photon-Server | core/src/main/scala/org/tuubes/core/network/Packet.scala | Scala | lgpl-3.0 | 328 |
package models.db
import io.rampant.vulgar.db.Pools
import models.User
import play.api.db.slick.Config.driver.simple._
import scala.concurrent.Future
class Users(tag: Tag) extends Table[User](tag, "USERS") {
def id = column[Long]("id", O.PrimaryKey, O.AutoInc)
def displayName = column[String]("display_name", O.No... | duaiwe/vulgar | app/models/db/Users.scala | Scala | mit | 803 |
package be.objectify.deadbolt.scala.views.di.dynamicTest
import be.objectify.deadbolt.scala.{AuthenticatedRequest, DeadboltHandler, DynamicResourceHandler}
import be.objectify.deadbolt.scala.views.di.{AbstractViewTest, drh}
import be.objectify.deadbolt.scala.views.html.di.dynamic
import be.objectify.deadbolt.scala.vie... | schaloner/deadbolt-2-scala | code/test/be/objectify/deadbolt/scala/views/di/dynamicTest/DynamicTest.scala | Scala | apache-2.0 | 2,032 |
/*
* Copyright 2017 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... | liquidarmour/ct-calculations | src/test/scala/uk/gov/hmrc/ct/computations/calculations/AdjustedTradingProfitForPeriodCalculatorSpec.scala | Scala | apache-2.0 | 1,805 |
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright 2016-2020 Daniel Urban and contributors listed in NOTICE.txt
*
* 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.ap... | durban/exp-reagents | core/src/test/scala/dev/tauri/choam/TreiberStackSpec.scala | Scala | apache-2.0 | 1,212 |
package com.geishatokyo.smartmerger
import com.geishatokyo.smartmerger.injection.{Injection, InjectionRule, Injector}
import com.geishatokyo.smartmerger.parse.{MarkerParser, BlockParser}
import java.io.{FileNotFoundException, File}
import com.geishatokyo.codegen.util.{Logger, FileUtil}
/**
* Created by takeshita on ... | geishatokyo/smart-merger | src/main/scala/com/geishatokyo/smartmerger/Merger.scala | Scala | mit | 5,641 |
// https://leetcode.com/problems/range-sum-query-immutable
class NumArray(numbers: Array[Int]) {
val tree = Tree build numbers
def sumRange(start: Int, end: Int): Int = tree query Range(start, end + 1)
}
sealed trait Tree {
/** @param range [x, y) */
def query(range: Range): Int
}
case class Branch(indi... | airt/codegames | leetcode/303-range-sum-query-immutable.scala | Scala | mit | 1,758 |
package Client
import java.security.PublicKey
import javax.crypto.BadPaddingException
import Client.ClientType.ClientType
import Client.Messages._
import Objects.ObjectTypes.ObjectType
import Objects.ObjectTypes.ObjectType
import Objects.ObjectTypes.ObjectType.ObjectType
import Utils.Resources._
import Objects.ObjectJ... | Nirespire/SecureFacebookAPI | src/main/scala/Client/ClientActor.scala | Scala | mit | 24,317 |
package model
import scalikejdbc._
import org.joda.time.DateTime
import skinny.orm.SkinnyCRUDMapperWithId
import skinny.orm.feature._
case class Company(
id: CompanyId,
name: String,
url: Option[String] = None,
createdAt: DateTime,
updatedAt: Option[DateTime] = None,
deletedAt: Option[DateTime] = None)
o... | holycattle/skinny-framework | example/src/main/scala/model/Company.scala | Scala | mit | 771 |
// Copyright: 2010 - 2017 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime
package config
object Environment {
def info: Seq[String] = Seq(
"Environment:",
s" OS : $osVersion",
s" Java : $javaVersion",
s" Scala version: $scal... | VlachJosef/ensime-server | core/src/main/scala/org/ensime/config/Environment.scala | Scala | gpl-3.0 | 1,125 |
/*
* 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 ... | caneGuy/spark | mllib/src/main/scala/org/apache/spark/ml/classification/RandomForestClassifier.scala | Scala | apache-2.0 | 14,150 |
package gh.test.gh2011b.payload
import gh2011b.models.{GollumEventPayload}
import net.liftweb.json._
import org.scalatest.{Matchers, FlatSpec}
class GollumEventPayloadTest extends FlatSpec with Matchers
{
"A valid GollumEvent payload" must "be correctly parsed" in {
val json = parse(
"""
... | mgoeminne/github_etl | src/test/scala/gh/test/gh2011b/payload/GollumEventPayloadTest.scala | Scala | mit | 681 |
/*
* 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 ... | hengyicai/OnlineAggregationUCAS | sql/core/src/test/scala/org/apache/spark/sql/parquet/ParquetPartitionDiscoverySuite.scala | Scala | apache-2.0 | 10,881 |
/*
* Copyright 2017 Exon IT
*
* 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... | exon-it/redmine-scala-client | client-play25-ws/src/main/scala/by/exonit/redmine/client/play25ws/Implicits.scala | Scala | apache-2.0 | 2,184 |
package com.twitter.finagle.thrift
import com.twitter.finagle.{ServiceProxy, Service, WriteException, ServiceException}
import java.util.logging.{Logger, Level}
import org.apache.thrift.TApplicationException
import org.apache.thrift.protocol.{TProtocolFactory, TMessageType}
import org.apache.thrift.transport.TMemoryIn... | yancl/finagle-6.22.0 | finagle-thrift/src/main/scala/com/twitter/finagle/thrift/ValidateThriftService.scala | Scala | apache-2.0 | 2,370 |
package be.mygod.speech.tts
import java.io.{File, FileOutputStream}
import android.content.Context
import android.graphics.drawable.Drawable
import scala.collection.immutable
/**
* @author Mygod
*/
abstract class TtsEngine(protected var context: Context,
private val selfDestructionListene... | Mygod/MygodSpeechSynthesizer-android | src/main/scala/be/mygod/speech/tts/TtsEngine.scala | Scala | gpl-3.0 | 1,282 |
/*
* 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-reactive/shared/src/main/scala/monix/reactive/internal/operators/DoOnSubscribeObservable.scala | Scala | apache-2.0 | 3,998 |
/**
* 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... | rvs/crunch | crunch-scrunch/src/it/scala/org/apache/crunch/scrunch/LengthTest.scala | Scala | apache-2.0 | 1,480 |
package x7c1.linen.database.struct
import android.content.ContentValues
import android.database.Cursor
import x7c1.linen.repository.date.Date
import x7c1.wheat.macros.database.TypedFields.toArgs
import x7c1.wheat.macros.database.{Query, TypedCursor, TypedFields}
import x7c1.wheat.modern.database.{Insertable, Updatable... | x7c1/Linen | linen-repository/src/main/scala/x7c1/linen/database/struct/LoaderScheduleRecord.scala | Scala | mit | 2,518 |
import java.util.concurrent.TimeUnit
import com.trueaccord.pb.{Service1JavaImpl, Service1ScalaImpl}
import com.trueaccord.proto.e2e.service.{Service1Grpc => Service1GrpcScala}
import com.trueaccord.proto.e2e.{Service1Grpc => Service1GrpcJava}
import io.grpc.netty.{NegotiationType, NettyChannelBuilder, NettyServerBuild... | eiennohito/ScalaPB | e2e/src/test/scala/GrpcServiceSpecBase.scala | Scala | apache-2.0 | 2,648 |
package extracells.util.recipe
import appeng.api.features.INetworkEncodable
import appeng.api.implementations.items.IAEItemPowerStorage
import extracells.item.{ItemWirelessTerminalUniversal, TerminalType}
import extracells.registries.ItemEnum
import extracells.util.UniversalTerminal
import net.minecraft.inventory.Inve... | ieatbedrock/Bedrocks-AE2-addons | src/main/scala/extracells/util/recipe/RecipeUniversalTerminal.scala | Scala | mit | 3,912 |
package com.fsist.stream
import com.fsist.FutureTester
import org.scalatest.FunSuiteLike
import scala.concurrent.ExecutionContext
import scala.concurrent.duration._
/** Common definitions for stream test code */
trait StreamTester extends FunSuiteLike with FutureTester {
override implicit def patienceConfig = Pati... | fsist/future-streams | src/test/scala/com/fsist/stream/StreamTester.scala | Scala | apache-2.0 | 453 |
package com.outr.arango
import fabric._
import scala.language.implicitConversions
package object query {
implicit class AQLInterpolator(val sc: StringContext) extends AnyVal {
def aql(args: Any*): Query = {
val strings = sc.parts.iterator
val expressions = args.iterator
var parts = List.empty... | outr/scarango | core/src/main/scala/com/outr/arango/query/package.scala | Scala | mit | 1,623 |
/**
* Copyright (C) 2013-2014 Duncan DeVore. <https://github.com/ironfish/>
*/
import sbt._
import Keys._
object Common {
def Organization = "com.github.ironfish"
def NameMongoCqrsCsApp = "mongo-cqrs-cs-app"
def NameMongoCqrsEsApp = "mongo-cqrs-es-app"
def AkkaVersion = "2.3.6"
def CrossScalaVersions = Se... | ironfish/akka-persistence-mongo-samples | project/Common.scala | Scala | apache-2.0 | 746 |
package io.ubiqesh.central.mqtt.encoder
import org.vertx.java.core.buffer.Buffer
import scala.annotation.tailrec
import io.ubiqesh.central.mqtt.commands._
/**
* Created by balu on 31.12.13.
*/
class Encoder {
def encodeConnack(connackCode:ConnackCode.Value):Buffer = {
//
// --------+-----+-----+-----+---... | ubiqesh/ubiqesh | central/src/main/scala/io/ubiqesh/central/mqtt/encoder/Encoder.scala | Scala | apache-2.0 | 8,011 |
package nodes.learning
import breeze.linalg._
import breeze.stats.distributions.{ThreadLocalRandomGenerator, RandBasis, Multinomial}
import breeze.stats.mean
import org.apache.commons.math3.random.MersenneTwister
import org.apache.spark.rdd.RDD
import pipelines.Logging
import workflow.{Estimator, Transformer}
import u... | tomerk/keystone | src/main/scala/nodes/learning/KMeansPlusPlus.scala | Scala | apache-2.0 | 6,432 |
package org.jetbrains.plugins.scala.annotator
import com.intellij.codeInsight.daemon.HighlightDisplayKey
import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.codeInspection.{LocalQuickFix, ProblemDescriptor, ProblemHighlightType}
import com.intellij.lang.ASTNode
import com.intellij.lang.annota... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/annotator/ScalaAnnotationBuilderAdapter.scala | Scala | apache-2.0 | 3,888 |
/*
* Copyright 2017 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... | pncampbell/ct-calculations | src/test/scala/uk/gov/hmrc/ct/accounts/frs105/boxes/AC461Spec.scala | Scala | apache-2.0 | 1,009 |
package com.lyrx.latex
import java.io.File
import com.lyrx.text.StringGenerator._
import com.lyrx.text._
/**
* Created by alex on 17.10.16.
*/
trait PDFGenerator extends LaTeX {
def pdf(aFileName: String )(implicit coll:Collector[String],context: Context): Either[File, String] = {
new StringSerializer(... | lyrx/lyrxgenerator | src/main/scala/com/lyrx/latex/PDFGenerator.scala | Scala | gpl-3.0 | 717 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/test/scala/org/neo4j/cypher/internal/compiler/v2_3/spi/UpdateCountingQueryContextTest.scala | Scala | apache-2.0 | 6,211 |
package org.openurp.edu.eams.system.firstlogin.impl
import org.beangle.security.codec.EncryptUtil
class VerifyEmailKeyGenerator {
private var secretKey: String = "Eams verify key"
def generate(email: String): String = EncryptUtil.encode(email + secretKey)
def verify(email: String, digest: String): Boolean ... | openurp/edu-eams-webapp | web/src/main/scala/org/openurp/edu/eams/system/firstlogin/impl/VerifyEmailKeyGenerator.scala | Scala | gpl-3.0 | 350 |
/*
* (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-nn | src/main/scala/toolkit/neuralnetwork/util/Norm.scala | Scala | apache-2.0 | 892 |
package scala.lms
package epfl
package test9
import common._
import test1._
import test7.{Print,PrintExp,ScalaGenPrint}
import internal.ScalaCompile
import scala.util.continuations._
import util.OverloadHack
import java.io.{PrintWriter,StringWriter,FileOutputStream}
trait CpsProg1 extends LiftPrimitives with Pri... | astojanov/virtualization-lms-core | test-src/epfl/test9-experimental/TestCPS.scala | Scala | bsd-3-clause | 6,323 |
package se.uu.farmbio.cp
import org.apache.spark.mllib.linalg.Vector
import org.apache.spark.mllib.regression.LabeledPoint
abstract class UnderlyingAlgorithm(
val predictor: (Vector => Double)) extends Serializable {
def nonConformityMeasure(newSample: LabeledPoint): Double
}
trait Deserializer[A <: UnderlyingAl... | mcapuccini/spark-cp | cp/src/main/scala/se/uu/farmbio/cp/UnderlyingAlgorithm.scala | Scala | apache-2.0 | 368 |
val x = play {
// RandSeed.ir(trig = 1, seed = 56789.0)
val gbmanL_0 = GbmanL.ar(freq = 419.73846, xi = 1.2, yi = 0.00788784)
val gbmanL_1 = GbmanL.ar(freq = 9.444879E-4, xi = 92.88581, yi = -953.0853)
val freq_0 = gbmanL_1.cos
val gbmanL_2 = GbmanL.ar(freq = freq_0, xi = 395.79254, yi =... | Sciss/Grenzwerte | individual_sounds/1630_85.scala | Scala | gpl-3.0 | 2,185 |
package mesosphere.marathon
package core.launchqueue.impl
import mesosphere.UnitTest
import mesosphere.marathon.core.instance.update.InstancesSnapshot
import mesosphere.marathon.core.instance.{Instance, TestInstanceBuilder}
import mesosphere.marathon.core.launchqueue.impl.ReviveOffersStreamLogic.VersionedRoleState
imp... | mesosphere/marathon | src/test/java/mesosphere/marathon/core/launchqueue/impl/ReviveOffersStateTest.scala | Scala | apache-2.0 | 2,254 |
package lib
import com.bryzek.apidoc.api.v0.models.{Original, OriginalForm, OriginalType}
import com.bryzek.apidoc.spec.v0.models.Service
import com.bryzek.apidoc.spec.v0.models.json._
import play.api.libs.json.{Json, JsString, JsObject, JsSuccess}
import scala.util.{Failure, Success, Try}
object OriginalUtil {
de... | Seanstoppable/apidoc | api/app/lib/OriginalUtil.scala | Scala | mit | 1,468 |
/*
* 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/ct600e/v2/E1011.scala | Scala | apache-2.0 | 823 |
package no.penger.crud
trait results extends errors {
sealed trait CrudSuccess
sealed trait CrudFailure
case class Created(mountedAt: String, table: TableName, id: Option[String]) extends CrudSuccess
case class Updated(mountedAt: String, table: TableName, column: ColumnName, row: String, oldValue: Option[Stri... | pengerno/slick-crud | core/src/main/scala/no/penger/crud/results.scala | Scala | apache-2.0 | 801 |
package pl.writeonly.son2.funs.liners
import com.typesafe.scalalogging.LazyLogging
import pl.writeonly.son2.apis.converters.Converter
import scala.util.control.Exception._
import scala.util.{Failure, Success, Try}
class LinerWithTry(converter: Converter)
extends Liner(converter)
with LazyLogging {
def app... | writeonly/son2 | scallions-core/scallions-funs/src/main/scala/pl/writeonly/son2/funs/liners/LinerWithTry.scala | Scala | apache-2.0 | 639 |
/**
* 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-http/src/main/scala/com/excilys/ebi/gatling/http/ahc/HttpEvent.scala | Scala | gpl-2.0 | 1,420 |
/**
* 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... | YMartsynkevych/camel | components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/Functions.scala | Scala | apache-2.0 | 1,274 |
/**
* Copyright (C) 2011 - 101loops.com <[email protected]>
*
* 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... | crashnote/crashnote-java | modules/logger/src/test/scala/com/crashnote/test/logger/unit/logback/LogbackEvtSpec.scala | Scala | apache-2.0 | 2,929 |
package slick.ast
import slick.ast.TypeUtil.:@
import scala.language.implicitConversions
import scala.collection.mutable.ArrayBuffer
/**
* Utility methods for AST manipulation.
*/
object Util {
def mapOrNone[A <: AnyRef](c: Traversable[A])(f: A => A): Option[IndexedSeq[A]] = {
val b = new ArrayBuffer[A]
... | jkutner/slick | slick/src/main/scala/slick/ast/Util.scala | Scala | bsd-2-clause | 3,909 |
package com.arcusys.valamis.web.servlet.base
import java.util
import javax.servlet.http.{HttpServletRequest, HttpServletRequestWrapper, HttpServletResponse}
import org.scalatra.servlet.ServletApiImplicits
import org.scalatra.{Delete, Handler, Patch, Put}
import scala.collection.JavaConversions._
// tomcat (with def... | arcusys/Valamis | valamis-portlets/src/main/scala/com/arcusys/valamis/web/servlet/base/HTTPMethodsSupport.scala | Scala | gpl-3.0 | 1,730 |
package features
import org.scalatest.{BeforeAndAfter, FunSpec}
import org.github.nicholasren.moco.helper.RemoteTestHelper
import com.github.nicholasren.moco.dsl.{Conversions, SMoco}
import com.github.nicholasren.moco.dsl.SMoco._
import com.github.dreamhead.moco.MocoEventAction
import Conversions._
import org.mockito.... | nicholasren/moco-scala | src/test/scala/features/EventActionTest.scala | Scala | mit | 900 |
package scorex.transaction.assets.exchange
import com.google.common.primitives.{Ints, Longs}
import io.swagger.annotations.ApiModelProperty
import play.api.libs.json.{JsObject, Json}
import scorex.account.{PrivateKeyAccount, PublicKeyAccount}
import scorex.crypto.EllipticCurveImpl
import scorex.crypto.encode.Base58
im... | B83YPoj/Waves | src/main/scala/scorex/transaction/assets/exchange/ExchangeTransaction.scala | Scala | apache-2.0 | 7,578 |
package tests.rescala.property
import org.scalacheck.{Arbitrary, Gen}
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import rescala.extra.invariant.{Invariant, InvariantApi}
import tests.rescala.testtools.RETests
class InvariantsTest extends RETests wi... | guidosalva/REScala | Code/Main/shared/src/test/scala-2/tests/rescala/property/InvariantsTest.scala | Scala | apache-2.0 | 4,179 |
package org.scalatest.tools.maven
import java.io.File
import org.scalatest.Matchers
import org.scalatest.junit.JUnit3Suite
import java.util.ArrayList
import org.scalatest.BeforeAndAfterAll
/**
* @author Jon -Anders Teigen
*/
final class PluginTest
extends JUnit3Suite
with BeforeAndAfterAll
with Matchers... | scalatest/scalatest-maven-plugin | src/test/scala/org/scalatest/tools/maven/PluginTest.scala | Scala | apache-2.0 | 7,342 |
package org.lamastex.exercises
import org.apache.spark._
/** Computes lines in sou */
object souWordCount {
def main(args: Array[String]) {
val conf = new SparkConf().setAppName("souWordCount")
val spark = new SparkContext(conf)
val souRdd = spark.textFile("hdfs:///datasets/sou/*")
val count = souR... | lamastex/scalable-data-science | _sds/basics/infrastructure/onpremise/dockerCompose/programs/exercises/sparkSubmit/src/main/scala/examples/souWordCount.scala | Scala | unlicense | 662 |
/*******************************************************************************
* _____ _ _____ _____ ___
* / ___| | | / ___/ __ \\ / _ \\
* \\ `--. ___ __ _| | __ _\\ `--.| / \\// /_\\ \\
* `--. \\/ __/ _` | |/ _` |`--. \\ | | _ |
* /\\__/ / (_| (_| | | (_| /\\__/ / \\__... | jean-andre-gauthier/scalasca | src/main/scala/lara/epfl/scalasca/core/ScalaSCA.scala | Scala | bsd-3-clause | 6,441 |
package kofre.rga
import kofre.IdUtil
import kofre.rga.Vertex.Timestamp
case class Vertex(timestamp: Timestamp, id: IdUtil.Id)
object Vertex {
type Timestamp = Long
val start: Vertex = Vertex(-1, IdUtil.predefined("start"))
val end: Vertex = Vertex(0, IdUtil.predefined("end"))
def fresh[A](): Vertex = Ve... | guidosalva/REScala | Code/Extensions/Kofre/src/main/scala/kofre/rga/Vertex.scala | Scala | apache-2.0 | 366 |
/*
* 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 ... | practice-vishnoi/dev-spark-1 | examples/src/main/scala/org/apache/spark/examples/HdfsTest.scala | Scala | apache-2.0 | 1,535 |
package akka.persistence
import akka.actor._
import akka.persistence.SnapshotProtocol._
import scalaz._
import Scalaz._
class SnapshotReader extends Actor {
import SnapshotReader._
val store = Persistence(context.system).snapshotStoreFor(null)
var callback: Option[Throwable \\/ Option[SelectedSnapshot] => Uni... | Astrac/streamz | streamz-akka-persistence/src/main/scala/akka/persistence/SnapshotReader.scala | Scala | apache-2.0 | 704 |
/*
# 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/reduxForm/MapDispatchToPropsObject.scala | Scala | apache-2.0 | 831 |
/*
* 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
* distribute... | wvlet/airframe | airframe-config/src/test/scala/wvlet/airframe/config/AirframeBootstrapTest.scala | Scala | apache-2.0 | 2,727 |
package org.jetbrains.plugins.scala.worksheet.ammonite.runconfiguration
import com.intellij.execution.RunManagerEx
import com.intellij.execution.configurations.ConfigurationTypeUtil
import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent, CommonDataKeys}
import com.intellij.openapi.vfs.LocalFileSystem
import... | JetBrains/intellij-scala | scala/worksheet/src/org/jetbrains/plugins/scala/worksheet/ammonite/runconfiguration/AmmoniteRunScriptAction.scala | Scala | apache-2.0 | 2,305 |
package examples.validation
import java.time.LocalDate
import com.twitter.finagle.http.Request
import io.fintrospect.parameters.Query
import io.fintrospect.util.Validator
object CollectErrors extends App {
val millennium = LocalDate.of(2000, 1, 1)
/**
* Because we are interested in collecting ALL of the e... | daviddenton/fintrospect | src/main/scala/examples/validation/CollectErrors.scala | Scala | apache-2.0 | 1,008 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/amls-frontend | app/models/EnumFormat.scala | Scala | apache-2.0 | 1,571 |
package class_extractor
import org.scalaquery.session.Database
import org.scalaquery.session.Database.threadLocalSession
import org.scalaquery.ql.basic.BasicTable
import org.scalaquery.ql.basic.BasicDriver.Implicit._
import scala.collection.mutable.ListBuffer
import scala.collection.mutable.Set
import scala.collection... | t-morita/JWO_Refinement_Tools | src/main/scala/class_extractor/RefinedClassExtractor.scala | Scala | apache-2.0 | 3,504 |
/*
* Copyright 2016 Guy Van den Broeck and Wannes Meert (UCLA and KU Leuven)
*
* 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
*
* Un... | UCLA-StarAI/Forclift | src/main/scala/edu/ucla/cs/starai/forclift/rcr/MarginalCircuitsSet.scala | Scala | apache-2.0 | 2,977 |
package ml.combust.mleap.core.ann
/*
* 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, Versi... | combust/mleap | mleap-core/src/main/scala/ml/combust/mleap/core/ann/BreezeUtil.scala | Scala | apache-2.0 | 2,582 |
package com.whisk.docker
import com.github.dockerjava.api.command.{ CreateContainerCmd, StartContainerCmd }
import com.github.dockerjava.api.model.{ Link, ExposedPort, Ports }
case class DockerContainer(
image: String,
command: Option[Seq[String]] = None,
bindPorts: Map[Int, Option[Int]] = Map.empty,
... | AdAgility/docker-it-scala | core/src/main/scala/com/whisk/docker/DockerContainer.scala | Scala | mit | 1,675 |
package example
object Hello extends App {
// ライブラリを通すとエスケープシーケンスが消費されるので
val NUL = "\\u0000"
val HT = "\\u0009"
val NEL = "\\u0085"
println(s"[$NUL]")
println(s"[$HT]")
println(s"[$NEL]")
println(s"[$NUL]".replace(NUL,""))
println(s"[$HT]".replace(HT,""))
println(s"[$NEL]".replace(NEL,""))
val ... | rysh/my-scala-playground | treat-control-characters/src/main/scala/example/Hello.scala | Scala | mit | 461 |
package com.twitter.finagle.service
import com.twitter.finagle._
import com.twitter.finagle.context.Contexts
import com.twitter.finagle.stats.InMemoryStatsReceiver
import com.twitter.finagle.tracing._
import com.twitter.util._
import com.twitter.util.TimeConversions._
import org.junit.runner.RunWith
import org.mockito... | sveinnfannar/finagle | finagle-core/src/test/scala/com/twitter/finagle/service/DeadlineStatsFilterTest.scala | Scala | apache-2.0 | 2,796 |
object Solution {
def f(delim: Int, arr: List[Int]): List[Int] =
arr.flatMap(a => if (a < delim) List(a) else Nil)
def main(args: Array[String]) { }
}
| gcollura/playground | hackerrank/fp/introduction/fp-filter-array.scala | Scala | mit | 160 |
/*
* 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 ... | Aegeaner/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryTableScanExec.scala | Scala | apache-2.0 | 14,492 |
package im.actor.server.mtproto.transport
// FIXME: rename to FRAME
@SerialVersionUID(1L)
final case class TransportPackage(index: Int, body: MTProto)
| actorapp/actor-platform | actor-server/actor-models/src/main/scala/im/actor/server/mtproto/transport/TransportPackage.scala | Scala | agpl-3.0 | 152 |
package com.amarjanica.discourse.models
import java.time.OffsetDateTime
import com.amarjanica.discourse.util.SerializableAsJson
case class UserDetail(
badges: List[Badge],
user: User
) extends SerializableAsJson
case class User(
id: Int,
username: String,
@JsonProperty("uploaded_avatar_id")
uploadedAvat... | amarjanica/discourse-scala-client | src/main/scala/com/amarjanica/discourse/models/User.scala | Scala | mit | 4,056 |
package geostat
import scala.math._
/**
* Link abstract class
*
* @param nodeA first node
* @param nodeB second node
*/
@SerialVersionUID(123L)
abstract class Link(val nodeA: MapPoint, val nodeB: MapPoint) extends Serializable {
require(nodeA != null)
require(nodeB != null)
val lenght = nodeA.greatCircle... | alessandroadamo/geostat | src/main/scala/geostat/Link.scala | Scala | lgpl-3.0 | 1,363 |
package controllers
import com.google.inject.ImplementedBy
import javax.inject.Inject
import play.api.i18n.MessagesApi
import scala.annotation.tailrec
import com.overviewdocs.database.HasBlockingDatabase
import com.overviewdocs.models.{Node,Tree}
import com.overviewdocs.models.tables.{Nodes,Trees}
import controllers.... | overview/overview-server | web/app/controllers/NodeController.scala | Scala | agpl-3.0 | 3,309 |
import org.scalatest.FunSuite
/**
* Created by matthiasheck on 01.11.15.
*/
class MasterDataProvider$Test extends FunSuite {
test("test json loading") {
println("Starting json load test of master countries")
assert(MasterDataProvider.getCountryName("DZ").toUpperCase == "Algeria".toUpperCase)
assert... | matze42/DataVizualizr | src/test/scala/MasterDataProvider$Test.scala | Scala | mit | 408 |
/*
* Copyright (c) 2014-2019 Israel Herraiz <[email protected]>
*
* 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, c... | iht/fpinscala | src/test/scala/chap03/ex12Spec.scala | Scala | mit | 1,537 |
/*
* Action.scala
*
* Copyright 2017 wayfarerx <[email protected]> (@thewayfarerx)
*
* 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
*... | wayfarerx/circumvolve | server/src/main/scala/net/wayfarerx/circumvolve/service/Action.scala | Scala | apache-2.0 | 2,998 |
package pl.newicom.dddd.serialization
import com.typesafe.config.Config
import org.json4s._
import org.json4s.ext.{EnumNameSerializer, JodaTimeSerializers, UUIDSerializer}
import pl.newicom.dddd.messaging.PublisherTypeValue
import pl.newicom.dddd.serialization.JsonSerHints.DefaultSerializationHints
import pl.newicom.d... | AndreyLadniy/akka-ddd | akka-ddd-protocol/src/main/scala/pl/newicom/dddd/serialization/JsonSerHints.scala | Scala | mit | 2,693 |
package example
package data
import slick.jdbc.H2Profile.api._
import models.User
class Users(tag: Tag) extends Table[User](tag, "users") {
def id = column[Int]("id", O.PrimaryKey)
def name = column[String]("name")
def * = (id, name) <> (User.tupled, User.unapply)
}
object Users extends TableQuery[Users](new ... | gabro/eff-api | src/main/scala/data/tables/Users.scala | Scala | mit | 330 |
package skutek.operations
import skutek.abstraction._
import org.specs2._
trait CanLaunchTheMissiles { this: Specification =>
case class Missile() {
private var count = 0
def launch() = { count += 1 }
def launch_! = Eval { launch() }
def launchedOnce = count == 1
def mustHaveLaunchedOnce = co... | marcinzh/skutek | modules/core/src/test/scala/skutek/operations/CanLaunchTheMissiles.scala | Scala | mit | 386 |
package eventstore
package akka
import scala.concurrent.duration._
import _root_.akka.actor.ActorRef
import _root_.akka.testkit.{TestActorRef, TestKitBase, TestProbe}
class SubscribeToStreamCatchingUpITest extends TestConnection {
sequential
"subscribe catching up" should {
"be able to subscribe to non exis... | EventStore/EventStore.JVM | client/src/test/scala/eventstore/akka/SubscribeToStreamCatchingUpITest.scala | Scala | bsd-3-clause | 5,522 |
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/... | cran/rkafkajars | java/scala/collection/mutable/IndexedSeqOptimized.scala | Scala | apache-2.0 | 827 |
package com.bio4j.dynamograph.parser.go
import scala.xml.pull._
import scala.io.Source
import com.bio4j.dynamograph.model.Properties._
import com.bio4j.dynamograph.model.go.GoSchema._
import com.bio4j.dynamograph.parser.ParsingContants
import com.bio4j.dynamograph.parser.SingleElement
class PullGoParser(val src: Sou... | bio4j/dynamograph | src/main/scala/com/bio4j/dynamograph/parser/go/PullGoParser.scala | Scala | agpl-3.0 | 5,736 |
// scalac fails for test2/3
// dotc fails for all three
object test1 {
class Tree[-T >: Null]
def f(x: Any): Tree[Null] = x match {
case y: Tree[_] => y
}
}
object test2 {
class Tree[T >: Null]
def f(x: Any): Tree[Null] = x match {
case y: Tree[_] => y // error
}
}
o... | dotty-staging/dotty | tests/neg/boundspropagation.scala | Scala | apache-2.0 | 550 |
object Test {
def compare(first: Any, second: Any): Any = {
(first, second) match {
case (k: Int, o: Int) => k compare o
//why the next case matches (Float, Int) but does not match (Int, Float) ???
case (k: Number, o: Number) => k.doubleValue() compare o.doubleValue()
case _ =>... | folone/dotty | tests/pending/run/t2337.scala | Scala | bsd-3-clause | 694 |
package org.andrewconner.spot.playapp
import java.util.concurrent.{ Callable, TimeUnit }
import akka.actor.ActorSystem
import akka.stream.Materializer
import org.andrewconner.spot.core.{ TaskActionBuilder, TaskAction }
import org.joda.time.DateTime
import play.api.mvc._
import org.feijoas.mango.common.cache._
import ... | andrewconner/spotsy | app/org/andrewconner/spot/playapp/TarpitFilter.scala | Scala | mit | 4,546 |
package com.github.agourlay.cornichon.resolver
import java.util.concurrent.atomic.AtomicLong
import java.util.regex.Matcher
import cats.syntax.either._
import com.github.agourlay.cornichon.core._
import com.github.agourlay.cornichon.json.{ CornichonJson, JsonPath }
import com.github.agourlay.cornichon.resolver.Placeh... | agourlay/cornichon | cornichon-core/src/main/scala/com/github/agourlay/cornichon/resolver/PlaceholderResolver.scala | Scala | apache-2.0 | 6,354 |
package dhg.util
/**
* Timing utilities
*
* @author Dan Garrette ([email protected])
*/
object Time {
def time[T](name: String, block: => T): T = {
time(name, block, println)
}
def time[T, R](name: String, block: => T, log: String => R): T = {
log(s"starting: $name")
val (r, t) = timer(block... | dhgarrette/low-resource-pos-tagging-2014 | src/main/scala/dhg/util/Time.scala | Scala | apache-2.0 | 779 |
/** Copyright 2015 TappingStone, 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 ... | ch33hau/PredictionIO | core/src/main/scala/io/prediction/controller/PDataSource.scala | Scala | apache-2.0 | 2,113 |
/*
* Copyright 2014 IBM Corp.
*
* 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... | bpburns/spark-kernel | protocol/src/test/scala/com/ibm/spark/kernel/protocol/v5/content/ConnectRequestSpec.scala | Scala | apache-2.0 | 2,165 |
/*
* Copyright 2001-2011 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... | svn2github/scalatest | src/main/scala/org/scalatest/events/Location.scala | Scala | apache-2.0 | 1,717 |
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.