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 |
|---|---|---|---|---|---|
/*
* 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 ... | wowmsi/safe | safe-lang/src/main/scala/safe/safesets/client/Master.scala | Scala | apache-2.0 | 1,670 |
object Solution {
import scala.collection.mutable.{HashSet, HashMap, PriorityQueue}
// Dijkstra's Algorithm
def minPathSum4(matrix: Array[Array[Int]]): Long = {
val n = matrix.size
val target = (n - 1, n - 1)
val nodes = for {
i <- 0 until n
j <- 0 until n
... | advancedxy/hackerrank | project-euler/problem-83/PathSum4Ways.scala | Scala | mit | 1,730 |
package sds.classfile.attribute
import sds.classfile.{ClassfileStream => Stream}
import sds.classfile.constant_pool.{ConstantInfo => CInfo}
import sds.util.DescriptorParser.parse
class LocalVariable(data: Stream, pool: Array[CInfo], private val name: String) extends AttributeInfo {
private var table: Array[Array[... | g1144146/sds_for_scala | src/main/scala/sds/classfile/attribute/LocalVariable.scala | Scala | apache-2.0 | 1,163 |
package com.lot.user.model
import com.lot.order.model.Order
import com.lot.order.model.Order
import com.lot.order.model.Order
import com.lot.trade.model.Trade
import com.lot.position.model.Position
import com.lot.marketEvent.model.MarketEvent
import com.lot.marketEvent.model.TriggeredEvent
import com.lot.security.mode... | thimmaiah/life_of_a_trade_scala | src/main/scala/com/lot/user/model/Authorize.scala | Scala | apache-2.0 | 4,899 |
package hephaestus
package skybox
import hephaestus.platform._
import hephaestus.io.Buffer
import java.nio.{ByteBuffer, ByteOrder}
import java.io.File
import java.io.InputStream
import java.nio.file.Files
import javax.imageio._
import java.awt.image._
import scodec.codecs._
import scodec.stream._
import cats.implic... | to-ithaca/hephaestus | samples/src/main/scala/hephaestus/skybox/Step03.scala | Scala | apache-2.0 | 53,706 |
package com.daxin
import scala.io.Source
import java.io.File
/**
* 3.1. 概念
* 隐式转换和隐式参数是Scala中两个非常强大的功能,利用隐式转换和隐式参数
* 你可以提供优雅的类库,对类库的使用者隐匿掉那些枯燥乏味的细节。
* 3.2. 作用
* 隐式的对类的方法进行增强,丰富现有类库的功能
* 3.3. 隐式转换函数
* 是指那种以implicit关键字声明的带有单个参数的函数
*/
object MainApp {
def main(args: Array[String]): Unit = {
//导入隐式转换
... | Dax1n/Scala | implicitDemo/src/com/daxin/Main.scala | Scala | apache-2.0 | 1,046 |
package com.avidmouse.spark.streaming
/**
* @author avidmouse
* @version 0.1, 14-6-25
*/
package object mongodb {
val dstream = MongoSparkDStream.Implicits
}
| avidmouse/mongo-spark | streaming/src/main/scala/com/avidmouse/spark/streaming/mongodb/package.scala | Scala | apache-2.0 | 164 |
package db.tables
import shared.models.Product
import slick.lifted.Tag
import db.currentJdbcProfile.api._
private[db] class ProductsTable(tag: Tag) extends Table[Product](tag, "products") {
def id = column[Long]("id", O.PrimaryKey, O.AutoInc)
def name = column[String]("name")
def quantity = column[Int]("quant... | kkrzys/eShop | eShop-database/src/main/scala/db/tables/ProductsTable.scala | Scala | apache-2.0 | 397 |
/*
*
* * Copyright 2020 Lenses.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 app... | datamountaineer/stream-reactor | kafka-connect-jms/src/main/scala/com/datamountaineer/streamreactor/connect/jms/sink/converters/JsonMessageConverter.scala | Scala | apache-2.0 | 1,396 |
import java.sql.Date
case class Transaction(
id:Option[Int], // unique identifier
candidate:String, // candidate receiving the donation
contributor:String, // name of the contributor
contributorState:String, // contributor state
contributorOccupation:Option[String], // contributor job
amount:Lo... | pbugnion/s4ds | chap06/Transaction.scala | Scala | apache-2.0 | 383 |
package org.improving.scalify
import org.eclipse.jdt.core.dom
import scala.collection.mutable.{ HashMap, ListBuffer }
import scala.collection.immutable
import ScalifySafe._
// A JDTForest is each CU mapped to its JDTMap
// A JDTMap is each ASTNode mapped to its Node
object Forest
{
private var forest: JDTForest = n... | mbana/scalify | src/main/core/Forest.scala | Scala | isc | 2,149 |
package leo.modules.procedures
import leo.datastructures.Term._
import leo.datastructures._
import leo.modules.HOLSignature._
import leo.modules.input.Input.{readFormula => read}
import leo.{Checked, LeoTestSuite}
class SimplificationTest extends LeoTestSuite {
implicit private val s: Signature = getFreshSignature
... | lex-lex/Leo-III | src/test/scala/leo/modules/procedures/SimplificationTest.scala | Scala | bsd-3-clause | 1,906 |
package controllers.admin
object Assets extends controllers.AssetsBuilder
| SollmoStudio/beyond | modules/admin/app/controllers/admin/Assets.scala | Scala | apache-2.0 | 74 |
package gapt.proofs.nd
import gapt.expr._
import gapt.expr.formula.All
import gapt.expr.formula.And
import gapt.expr.formula.Bottom
import gapt.expr.formula.Eq
import gapt.expr.formula.Ex
import gapt.expr.formula.Formula
import gapt.expr.formula.Imp
import gapt.expr.formula.Neg
import gapt.expr.formula.Or
import gapt.... | gapt/gapt | core/src/main/scala/gapt/proofs/nd/nd.scala | Scala | gpl-3.0 | 44,342 |
/*
* 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/formats/package.scala | Scala | apache-2.0 | 3,504 |
/*
* Copyright (c) 2012 Orderly 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.apache.org/licenses/L... | keplar/google-analytics-export-to-csv | src/main/scala/co/orderly/ga2csv/MainApplication.scala | Scala | apache-2.0 | 3,001 |
/*
* 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... | yeghishe/spark-kernel | client/src/main/scala/com/ibm/spark/kernel/protocol/v5/client/execution/DeferredExecution.scala | Scala | apache-2.0 | 5,804 |
/**
* @author Claire Jaja
* @version 10/30/14
*
* Project Euler
* Problem 2
* Even Fibonacci numbers
*
* Each new term in the Fibonacci sequence is generated by adding
* the previous two terms.
* By startign with 1 and 2, the first 10 terms will be:
* 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
* By considering the terms in... | clairejaja/project-euler | src/main/scala/problem2/EvenFibonacciNumbers.scala | Scala | mit | 922 |
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ **
** /____/\___/_/ |_/... | andreaTP/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/jsinterop/RuntimeLongTest.scala | Scala | bsd-3-clause | 156,187 |
/***********************************************************************
* 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-kafka/geomesa-kafka-datastore/src/test/scala/org/locationtech/geomesa/kafka/ExpirationMocking.scala | Scala | apache-2.0 | 1,615 |
package app.claim
import utils.WithJsBrowser
import utils.pageobjects.preview.PreviewTestableData
import utils.pageobjects.s_eligibility.GBenefitsPage
import utils.pageobjects._
import app.FunctionalTestCommon
/**
* End-to-End functional tests using input files created by Steve Moody.
* @author Jorge Migueis
* ... | Department-for-Work-and-Pensions/ClaimCapture | c3/test/app/claim/FunctionalTestCase8Spec.scala | Scala | mit | 2,591 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | jackylk/incubator-carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/detailquery/RangeFilterAllDataTypesTestCases.scala | Scala | apache-2.0 | 31,289 |
//package regolic.smt.qfeuf
//
//import regolic.asts.fol.Trees._
//import regolic.asts.core.Trees._
//import regolic.asts.core.Manip._
//
//import org.scalatest.FunSuite
//
//class FastCongruenceClosureSuite extends FunSuite {
//
// import FastCongruenceClosure._
//
// private val sort = Sort("A", List())
// private... | regb/scabolic | src/test/scala/regolic/smt/qfeuf/FastCongruenceClosureSuite.scala | Scala | mit | 39,110 |
// These are meant to be typed into the REPL. You can also run
// scala -Xnojline < repl-session.scala to run them all at once.
val a = Array(1, 1, 2, 3, 5, 8, 13, 21, 34, 55)
for (i <- 0 until a.length)
println(i + ": " + a(i))
0 until a.length
0 until (a.length, 2)
(0 until a.length).reverse
for (elem <- a)
... | P7h/ScalaPlayground | Scala for the Impatient/examples/ch03/sec03/repl-session.scala | Scala | apache-2.0 | 336 |
/*
* 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/vat-registration-frontend | app/controllers/TradingNameResolverController.scala | Scala | apache-2.0 | 3,469 |
package net.mtgto.garoon
import com.github.nscala_time.time.Imports._
import java.net.URI
import org.apache.axis2.Constants
import org.apache.axis2.addressing.EndpointReference
import org.apache.axis2.client.{Options, ServiceClient}
import org.apache.axiom.om.{OMAbstractFactory, OMElement}
import org.apache.axiom.soap... | mtgto/garoon | src/main/scala/net/mtgto/garoon/GaroonClient.scala | Scala | gpl-3.0 | 5,008 |
/**
*
* TeeAPI
* Ledger wallet
*
* Created by Pierre Pollastri on 31/03/15.
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Ledger
*
* 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 Softw... | Morveus/ledger-wallet-android | app/src/main/scala/com/ledger/ledgerwallet/remote/api/TeeAPI.scala | Scala | mit | 2,574 |
package info.hargrave.composer.ui.cue
import info.hargrave.composer._
import info.hargrave.composer.backend.manager.projects.CUEProject
import info.hargrave.composer.ui.cue.FileDataView
import info.hargrave.composer.util.CUEUtilities._
import jwbroek.cuelib.{CueSheet, FileData, TrackData}
import scalafx.Includes._
im... | RomanHargrave/CUEComposer | src/main/scala/info/hargrave/composer/ui/cue/CUEProjectUI.scala | Scala | gpl-3.0 | 2,900 |
/*
* 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... | psyyz10/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/Module.scala | Scala | apache-2.0 | 3,015 |
package at.logic.gapt.examples
import org.specs2.mutable.Specification
class GapticExamplesTest extends Specification {
"examples" in { gapticExamples; ok }
"drinker" in { drinker; ok }
}
| gebner/gapt | tests/src/test/scala/at/logic/gapt/examples/GapticExamplesTest.scala | Scala | gpl-3.0 | 197 |
/*
* @author Philip Stutz
*
* Copyright 2012 University of Zurich
*
* 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
*
* U... | jacqueslk/triplerush-filter | src/main/scala/com/signalcollect/triplerush/util/TripleRushVertexMap.scala | Scala | apache-2.0 | 9,755 |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\\
* @ @ *
* # # # # (c) 2017 CAB *
* # # # # # # ... | AlexCAB/MathAct | mathact_core/src/main/scala/mathact/core/plumbing/fitting/pipes/InPipe.scala | Scala | mit | 1,920 |
/**
* Copyright 2015 Frank Austin Nothaft
*
* 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 ... | fnothaft/ananas | src/main/scala/net/fnothaft/ananas/debruijn/TransientKmerVertex.scala | Scala | apache-2.0 | 3,863 |
/*
* 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 ... | bravo-zhang/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/UnivocityParserSuite.scala | Scala | apache-2.0 | 8,703 |
/*
* Copyright (C) 2011 Mathias Doenitz
*
* 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... | backchatio/http-parsers | src/main/scala/io/backchat/http/parser/AcceptRangesHeader.scala | Scala | apache-2.0 | 1,051 |
package it.dtk.twitter.entities
/**
* Created by gigitsu on 30/06/15.
*/
case class Polygon(bounds: LineString, holes: Seq[LineString]) extends Shape
| DataToKnowledge/wheretolive-backend | entities/src/main/scala/it/dtk/twitter/entities/Polygon.scala | Scala | gpl-2.0 | 153 |
package breeze.stats.distributions
/*
Copyright 2009 David Hall, Daniel Ramage
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 ... | eponvert/breeze | src/test/scala/breeze/stats/distributions/WaldTest.scala | Scala | apache-2.0 | 1,277 |
package mesosphere.mesos
import mesosphere.marathon.state.AppDefinition
import scala.collection.immutable.Seq
import scala.collection.mutable
import scala.util.Random
object EnvironmentHelper {
val maxEnvironmentVarLength = 512
val labelEnvironmentKeyPrefix = "MARATHON_APP_LABEL_"
val maxVariableLength = maxEn... | Caerostris/marathon | src/main/scala/mesosphere/mesos/EnvironmentHelper.scala | Scala | apache-2.0 | 5,319 |
package com.eltimn.scamongo.field
/*
* Copyright 2010 Tim Nelson
*
* 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 require... | eltimn/scamongo | src/main/scala/com/eltimn/scamongo/field/ObjectIdField.scala | Scala | apache-2.0 | 2,223 |
package tools.extractors
import org.specs2.mutable._
import org.mockito.Matchers._
import org.specs2.mock._
import tools.Context
import play.api.Configuration
import java.io.File
import tools.storage.FileSystem
class PdfToPngSpec extends SpecificationWithJUnit with Specification with Mockito {
val base = new File("... | vba/grom | rest/test/tools/extractors/PdfToPngSpec.scala | Scala | apache-2.0 | 1,746 |
/***
* Copyright 2014 Rackspace US, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | tylerroyal/api-checker | core/src/main/scala/com/rackspace/com/papi/components/checker/util/HeaderMap.scala | Scala | apache-2.0 | 2,580 |
// Copyright 2015 Foursquare Labs Inc. All Rights Reserved.
package io.fsq.rogue.test
import com.mongodb.{BasicDBObjectBuilder, DB, DBCollection, DBObject, MongoClient, ServerAddress, WriteConcern}
import io.fsq.field.OptionalField
import io.fsq.rogue.{
DBCollectionFactory,
InitialState,
LegacyMongo,
MongoJav... | foursquare/fsqio | test/jvm/io/fsq/rogue/test/TrivialORMQueryTest.scala | Scala | apache-2.0 | 6,201 |
package com.twitter.finagle.toggle
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.toggle.Toggle.Metadata
import com.twitter.logging.Logger
import java.nio.charset.StandardCharsets.UTF_8
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicReference
import ja... | spockz/finagle | finagle-toggle/src/main/scala/com/twitter/finagle/toggle/ToggleMap.scala | Scala | apache-2.0 | 17,190 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | rjhall/etsy.scalding | src/main/scala/com/twitter/scalding/Sortable.scala | Scala | apache-2.0 | 751 |
package io.coding.me.m2p2.core.actor.artifact
import io.coding.me.m2p2.core.analyzer.P2Unit
class P2MetadataAnalyzerTest extends ArtifactAnalyzerTest[P2Unit] {
override lazy val analyzerActor = system.actorOf(ArtifactAnalyzer.p2metadataProps(repositoryId))
override lazy val analyzerFile = getResourceFile("exampl... | tssp/maven-p2-view | core/src/test/scala/io/coding/me/m2p2/core/actor/artifact/P2MetadataAnalyzerTest.scala | Scala | mit | 376 |
package org.littlewings.javaee7.beanvalidation
import scala.beans.BeanProperty
@PostSalaryConstraint
class Employee {
var name: String = _
var post: String = _
var salary: Int = _
}
| kazuhira-r/javaee7-scala-examples | bean-validation-interrelation/src/test/scala/org/littlewings/javaee7/beanvalidation/Employee.scala | Scala | mit | 190 |
package demo.util
//<Factorial>
object Factorial {
def apply(n: Int): BigInt = {
if (n <= 1)
1
else
Factorial(n-1) * n
}
}
//</Factorial>
object test {
//<main>
def main(args: Array[String]) {
println(Factorial(5))
}
//</main>
}
| bhoward/Escalator | doc/demo/util/test.scala | Scala | apache-2.0 | 267 |
/* NSC -- new Scala compiler
* Copyright 2005-2012 LAMP/EPFL
* @author Martin Odersky
*/
package scala
package tools.nsc
package backend
package jvm
import scala.collection.immutable
import scala.tools.asm
/*
*
* @author Miguel Garcia, http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/
* @version ... | felixmulder/scala | src/compiler/scala/tools/nsc/backend/jvm/BCodeSyncAndTry.scala | Scala | bsd-3-clause | 19,508 |
package de.htwg.zeta.server.model.modelValidator.validator.rules.metaModelDependent
import scala.collection.immutable.Seq
import de.htwg.zeta.common.models.project.concept.elements.AttributeType.StringType
import de.htwg.zeta.common.models.project.concept.elements.AttributeValue
import de.htwg.zeta.common.models.proj... | Zeta-Project/zeta | api/server/test/de/htwg/zeta/server/model/modelValidator/validator/rules/metaModelDependent/NodeAttributesGlobalUniqueTest.scala | Scala | bsd-2-clause | 4,190 |
package repository.anormimpl
import anorm.SqlParser._
import anorm._
import models.Event
import models.shared.{Page, QueryUtils}
import play.api.Play.current
import play.api.db.DB
import repository.EventRepositoryComponent
/**
* @author adelfiri, " .. "
* @since 07 February 2016
*/
trait EventRepositoryAnormCompon... | Nectarius/taffeit | app/repository/anormimpl/EventRepositoryAnormComponent.scala | Scala | mit | 2,880 |
/*
* Copyright 2015-2019 Snowflake Computing
*
* 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 ... | snowflakedb/spark-snowflakedb | src/it/scala/net/snowflake/spark/snowflake/PushdownEnhancement02.scala | Scala | apache-2.0 | 20,373 |
package com.twitter.zk.coordination
import scala.jdk.CollectionConverters._
import org.apache.zookeeper.ZooDefs.Ids.OPEN_ACL_UNSAFE
import org.scalatestplus.mockito.MockitoSugar
import com.twitter.conversions.DurationOps._
import com.twitter.util.{Await, Future, JavaTimer}
import com.twitter.zk.{NativeConnector, Ret... | twitter/util | util-zk/src/test/scala/com/twitter/zk/coordination/ShardCoordinatorTest.scala | Scala | apache-2.0 | 2,022 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package expr
import _root_.org.jetbrains.plugins.scala.lang.resolve.ScalaResolveResult
import com.intellij.psi._
import com.intellij.psi.search.GlobalSearchScope
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.l... | LPTK/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/expr/ScAnnotations.scala | Scala | apache-2.0 | 2,903 |
/**
* Saves a sequence file of people and how many pandas they have seen.
*/
package com.oreilly.learningsparkexamples.scala
import com.oreilly.learningsparkexamples.proto.Places
import org.apache.spark._
import org.apache.spark.SparkContext._
import org.apache.hadoop.io.Text
import com.twitter.elephantbird.mapred... | gaoxuesong/learning-spark | src/main/scala/com/oreilly/learningsparkexamples/scala/BasicSaveProtoBuf.scala | Scala | mit | 1,404 |
/*
* 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/spark-common/src/main/scala/org/apache/spark/sql/test/util/QueryTest.scala | Scala | apache-2.0 | 6,183 |
package akka.contrib.persistence.mongodb
import akka.actor.Props
import akka.persistence.query.EventEnvelope
import com.mongodb.DBObject
import com.mongodb.casbah.Imports._
object AllPersistenceIds {
def props(driver: CasbahMongoDriver): Props = Props(new AllPersistenceIds(driver))
}
class AllPersistenceIds(val dr... | tomzhang/akka-persistence-mongo | casbah/src/main/scala/akka/contrib/persistence/mongodb/CasbahPersistenceReadJournaller.scala | Scala | apache-2.0 | 3,789 |
package courier
import java.util.Properties
import javax.mail.Provider
import org.jvnet.mock_javamail.{Mailbox, MockTransport}
import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
class MockedSMTPProvider extends Provider(Provider.Type.TRANSPORT,... | softprops/courier | src/test/scala/mailspec.scala | Scala | mit | 1,163 |
package test
// Specs2
import org.specs2.mutable.Specification
import java.io.File
import com.gensler.scalavro.types.AvroType
import com.gensler.scalavro.io.AvroTypeIO
import scala.util.{ Try, Success, Failure }
import Direction._
import test._
class EnumSpec extends Specification {
"A generated case class ... | ppearcy/avrohugger | avrohugger-core/src/sbt-test/projects/GenericSerializationTests/src/test/scala/scalavro/EnumSpec.scala | Scala | apache-2.0 | 872 |
/*
* 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 ... | ueshin/apache-spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/JoinedRow.scala | Scala | apache-2.0 | 5,578 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package java.lang
import scala.scalajs.js
imp... | nicolasstucki/scala-js | javalanglib/src/main/scala/java/lang/FloatingPointBits.scala | Scala | apache-2.0 | 8,623 |
/*
* 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 ... | lincoln-lil/flink | flink-table/flink-table-api-scala-bridge/src/main/scala/org/apache/flink/table/api/bridge/scala/internal/StreamTableEnvironmentImpl.scala | Scala | apache-2.0 | 12,967 |
package sp.system
import akka.actor.{ ExtendedActorSystem, Extension, ExtensionKey }
object SPSettings extends ExtensionKey[SPSettings]
/**
* The settings for Sequence planner read from the config file:
* core settings are read into predfined vals, but if you add
* your own settings, access them via
*/
class... | kristoferB/SP | sp1/src/main/scala/sp/system/SPSettings.scala | Scala | mit | 1,494 |
package controllers.s_your_partner
import controllers.s_about_you.GYourDetails._
import models.{NationalInsuranceNumber, DayMonthYear}
import play.api.Play._
import play.api.data.validation.{Valid, ValidationError, Invalid, Constraint}
import gov.dwp.carers.xml.validation.CommonValidation
import language.reflectiveCal... | Department-for-Work-and-Pensions/ClaimCapture | c3/app/controllers/s_your_partner/GYourPartnerPersonalDetails.scala | Scala | mit | 8,979 |
package org.bitcoins.dlc
import org.bitcoins.core.protocol.tlv.OracleParamsV0TLV
import org.bitcoins.testkitcore.dlc.DLCTest
import org.bitcoins.testkitcore.util.BitcoinSJvmTest
class DLCAdaptorPointComputerTest extends BitcoinSJvmTest with DLCTest {
behavior of "DLCAdaptorPointComputer"
it should "compute sigpo... | bitcoin-s/bitcoin-s | dlc-test/src/test/scala/org/bitcoins/dlc/DLCAdaptorPointComputerTest.scala | Scala | mit | 1,663 |
package models
import java.sql.Date.{valueOf => date}
import java.sql.Connection
case class CreateTax(taxType: Int, localeId: Long, name: String, rate: BigDecimal) {
def save()(
implicit conn: Connection,
taxRepo: TaxRepo,
taxNameRepo: TaxNameRepo,
localeInfoRepo: LocaleInfoRepo,
taxHistoryRepo:... | ruimo/store2 | app/models/CreateTax.scala | Scala | apache-2.0 | 537 |
package org.jetbrains.plugins.scala
package lang.refactoring.rename.inplace
import java.util
import com.intellij.lang.Language
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.{Pair, TextRange}
import com.intellij.psi.search.LocalSearchScope
import... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/refactoring/rename/inplace/ScalaLocalInplaceRenamer.scala | Scala | apache-2.0 | 2,730 |
package HackerRank.Training.Sorting
import java.io.{ByteArrayInputStream, IOException, InputStream, PrintWriter}
import java.util.InputMismatchException
import scala.collection.SeqLike
import scala.collection.generic.CanBuildFrom
import scala.language.higherKinds
/**
* Copyright (c) 2017 A. Roberto Fischer
*
*... | robertoFischer/hackerrank | src/main/scala/HackerRank/Training/Sorting/QuickSort2.scala | Scala | mit | 9,461 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package types
import com.intellij.lang.PsiBuilder
import com.intellij.psi.tree.IElementType
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/parser/parsing/types/InfixType.scala | Scala | apache-2.0 | 4,433 |
package com.twitter.finagle.memcached.protocol.text.server
import org.jboss.netty.channel._
import com.twitter.util.StateMachine
import org.jboss.netty.buffer.ChannelBuffer
import com.twitter.finagle.memcached.protocol.text._
import com.twitter.finagle.memcached.protocol.ClientError
import com.twitter.finagle.memcache... | enachb/finagle_2.9_durgh | finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/server/Decoder.scala | Scala | apache-2.0 | 2,044 |
package wandou.math.random
import java.security.SecureRandom
/**
* <p>{@link SeedGenerator} implementation that uses Java's bundled
* {@link SecureRandom} RNG to generate random seed data.</p>
*
* <p>The advantage of using SecureRandom for seeding but not as the
* primary RNG is that we can use it to seed RNGs t... | wandoulabs/wandou-math | wandou-math/src/main/scala/wandou/math/random/SecureRandomSeedGenerator.scala | Scala | apache-2.0 | 938 |
package co.blocke.scalajack
package yaml
package primitives.plain
import model.ClassNameHintModifier
import TestUtil._
import munit._
import munit.internal.console
class Misc() extends FunSuite:
val sj = ScalaJack(YamlFlavor())
test("Read/write null into object") {
describe(
"-------------------------... | gzoller/ScalaJack | core/src/test/scala/co.blocke.scalajack/yaml/primitives.plain/Misc.scala | Scala | mit | 2,577 |
package approximation
import approximation.TwoDGrid._
import org.specs2._
import piecewise._
class Coefficients extends Specification{def is = s2"""
Patched coefficient ${test}
Not patched coefficient ${test0}
"""
def test = {
val xD = new XDim[Radial](1.0, x => x + 1.0, 10.0)
val yD = new YDim[Orth... | daniil-timofeev/gridsplines | approximation/src/test/scala/approximation/Coefficients.scala | Scala | apache-2.0 | 1,422 |
/*
* 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 ... | godfreyhe/flink | flink-examples/flink-examples-streaming/src/test/scala/org/apache/flink/streaming/scala/examples/StreamingExamplesITCase.scala | Scala | apache-2.0 | 4,659 |
package org.jetbrains.plugins.scala.compiler.data
import org.jetbrains.jps.incremental.scala.{compilerVersionIn, containsScala3}
import org.jetbrains.plugins.scala.util.JarUtil
import org.jetbrains.plugins.scala.util.JarUtil.JarFileWithName
import java.io.File
object CompilerJarsFactory {
sealed trait CompilerJar... | JetBrains/intellij-scala | scala/compiler-shared/src/org/jetbrains/plugins/scala/compiler/data/CompilerJarsFactory.scala | Scala | apache-2.0 | 2,461 |
/*
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Fou... | TiarkRompf/lancet | src/main/scala/lancet/core/Core_TIR.scala | Scala | agpl-3.0 | 18,277 |
/*
* 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 ... | mdunker/usergrid | tests/performance/src/main/scala/org/apache/usergrid/simulations/deprecated/GetEntitySimulation.scala | Scala | apache-2.0 | 1,691 |
package com.cloudera.sa.apptrans.streaming.ingestion.kudu
import com.cloudera.sa.apptrans.model.{AccountMart, AppEvent, AppEventBuilder, AppEventConst}
import kafka.serializer.StringDecoder
import org.apache.solr.common.cloud.ZooKeeperException
import org.apache.spark.streaming.kafka.KafkaUtils
import org.apache.spark... | tmalaska/AppTrans | src/main/scala/com/cloudera/sa/apptrans/streaming/ingestion/kudu/SparkStreamingAppEventToKudu.scala | Scala | apache-2.0 | 6,053 |
/*
* Copyright 2010 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | luciferous/util | util-core/src/main/scala/com/twitter/conversions/storage.scala | Scala | apache-2.0 | 1,580 |
package net.hotelling.harold.audiowidget
import javax.sound.sampled.DataLine.Info
import javax.sound.sampled._
import scala.collection.mutable.ArrayBuffer
/**
* Convert raw data coming in into a sequence of amplitude values.
*/
class Audio(val format: AudioFormat, val timeWindowMillis: Double = 50.0) {
if (for... | haroldl/audiowidget | src/main/scala/net/hotelling/harold/audiowidget/Audio.scala | Scala | apache-2.0 | 5,749 |
package cortex.model
/**
*/
case class ActionContext(endpoint: String)(implicit symbols: Seq[Symbol]) {
val coercedEndpoint =
if (endpoint.startsWith("/")) {
endpoint
} else {
s"/$endpoint"
}
val regex = s"$coercedEndpoint".r
def map(cs: CharSequence): Map[String, String] = {
val l... | jsflax/cortex | src/main/scala/cortex/model/ActionContext.scala | Scala | mit | 412 |
package akka.persistence.hbase.common
import akka.persistence.SnapshotSelectionCriteria
/**
* Grouped events which will be sent to the `eventStream` if `publish-testing-events` is enabeled.
*/
object TestingEventProtocol {
private[hbase] case class FinishedWrites(written: Int)
private[hbase] case class Delete... | hossx/akka-persistence-hbase | src/main/scala/akka/persistence/hbase/common/TestingEventProtocol.scala | Scala | apache-2.0 | 395 |
package latis.time
import latis.time.TimeScaleType.TimeScaleType
import latis.units.UnitOfMeasure
import latis.util.LatisServiceException
import latis.util.RegEx
import java.util.Date
import java.util.GregorianCalendar
import java.util.TimeZone
/**
* Model a time scale as the number of TimeUnit-s from an epoch (sta... | dlindhol/LaTiS | src/main/scala/latis/time/TimeScale.scala | Scala | epl-1.0 | 4,277 |
/*
* 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 ... | bravo-zhang/spark | external/kafka-0-8/src/main/scala/org/apache/spark/streaming/kafka/KafkaUtils.scala | Scala | apache-2.0 | 36,775 |
import dotty.tools.dotc.ast.Trees.*
import dotty.tools.dotc.core.Types.*
object Patterns {
val d: Object = null
private def rebase(tp: NamedType): Type = {
def rebaseFrom(prefix: Type): Type = ???
tp.prefix match {
case SkolemType(rt) => rebaseFrom(rt)
case pre: ThisType => rebaseFrom(pre)
... | dotty-staging/dotty | tests/pos-with-compiler/Patterns.scala | Scala | apache-2.0 | 2,936 |
class I0 { Map() { i1: I2 { type I3 } } }
| som-snytt/dotty | tests/pending/fuzzy/AE-68729466e791245d18cb32f1e30b38e9953f15ab.scala | Scala | apache-2.0 | 42 |
package com.twitter.finagle.thrift
import com.twitter.finagle.stats.{Counter, LazyStatsReceiver, NullStatsReceiver, StatsReceiver}
object ThriftMethodStats {
def apply(stats: StatsReceiver): ThriftMethodStats = {
val wrapped = new LazyStatsReceiver(stats)
ThriftMethodStats(
wrapped.counter("requests"... | twitter/finagle | finagle-thrift/src/main/scala/com/twitter/finagle/thrift/ThriftMethodStats.scala | Scala | apache-2.0 | 895 |
/*
* 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... | wangyixiaohuihui/spark2-annotation | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/TableIdentifierParserSuite.scala | Scala | apache-2.0 | 6,998 |
package one.lockstep.monolock.protocol
import scodec._
import scodec.codecs._
import one.lockstep.util._
import one.lockstep.util.crypto._
import one.lockstep.lock._
import one.lockstep.util.protocol._
import one.lockstep.archive.v2
case class EnrollmentRequest(ticket: Encoded[LockTicket],
... | lockstep-one/vault | vault-common/src/main/scala/one/lockstep/monolock/protocol/EnrollmentRequest.scala | Scala | agpl-3.0 | 1,289 |
/*
* Copyright 2009-2010 the original author or 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 appl... | akisaarinen/ccf | app/src/main/scala/textapp/server/TextAppRequestHandler.scala | Scala | apache-2.0 | 2,341 |
import scala.reflect.macros.whitebox.Context
import scala.language.experimental.macros
import scala.annotation.StaticAnnotation
object helloMacro {
def impl(c: Context)(annottees: c.Expr[Any]*): c.Expr[Any] = {
import c.universe._
import Flag._
val result = {
annottees.map(_.tree).toList match {
... | mdemarne/scalahost | tests/src/main/scala/HelloMacros.scala | Scala | bsd-3-clause | 749 |
/*
* This file is part of Evo2DSim.
*
* Evo2DSim 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.
*
* Evo2DSim is distrib... | vchuravy/Evo2DSim | core/src/main/scala/org/vastness/evo2dsim/core/gui/Color.scala | Scala | mit | 1,263 |
package Ch04
import org.apache.spark.sql.{Row, SQLContext}
import org.apache.spark.sql.types.{FloatType, LongType, StructField, StructType}
import org.apache.spark.{SparkConf, SparkContext}
import org.stjohns.utils.StatisticsUtil.SummaryStat
import org.stjohns.utils.{DataFrameUtil, StatisticsUtil}
/**
* Crea... | gcrocetti/SeriesOnBigData | ChapterFour/Ouliers.scala | Scala | mit | 3,552 |
package com.dataintuitive.luciusapi.functions
import com.dataintuitive.luciuscore.genes._
import com.dataintuitive.luciuscore.Model.CompoundAnnotations
import com.dataintuitive.luciuscore.Model.DbRow
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.Dataset
import org.apache.spark.sql.SparkSession
import sca... | data-intuitive/LuciusAPI | src/main/scala/com/dataintuitive/luciusapi/functions/targetToCompoundsFunctions.scala | Scala | apache-2.0 | 3,172 |
package src.main.scala.types
import scala.collection.mutable.ListBuffer
import com.vividsolutions._
import org.geotools.geometry.jts.JTSFactoryFinder
import org.geoscript.geometry._
/* This case-class represents a speed in a geometry of New York
* City, as returned from its OpenData URL
*
* In a similar sense,... | je-nunez/DataMining_NewYork_Traffic_Speed | src/main/scala/types/SpeedInPolygonalSection.scala | Scala | gpl-2.0 | 1,884 |
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Author: Spiros Tzavellas
*/
package com.tzavellas.coeus.i18n.locale
import java.util.Locale
import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
/**
* Resolves the user's locale from the pri... | sptz45/coeus | src/main/scala/com/tzavellas/coeus/i18n/locale/AcceptHeaderLocaleResolver.scala | Scala | apache-2.0 | 1,063 |
/* Copyright 2009-2021 EPFL, Lausanne */
package stainless
package genc
import ir.Operators._
import ir.PrimitiveTypes._
import ir.Literals._
/*
* Here are defined classes used to represent AST of C programs.
*
* NOTE on char and string:
* because the C character and string literals encoding sets are
* ... | epfl-lara/stainless | core/src/main/scala/stainless/genc/CAST.scala | Scala | apache-2.0 | 9,696 |
package com.jaroop.anorm.relational
/** A Function-like class to describe how to copy a list of child objects into
* their respective parents.
* @tparam A The type of the parent object in a one-to-many relation.
* @tparam B The type of the child object in a one-to-many relation.
* @param f A function that takes a par... | mhzajac/anorm-relational | src/main/scala/com/jaroop/anorm/relational/RowFlattener.scala | Scala | apache-2.0 | 2,316 |
package cz.vse.easyminer.miner
trait DatasetBuilder {
def buildAndExecute[T](dbServer: String, dbName: String, dbUser: String, dbPass: String, dbTableName: String)(dbq: Dataset => T) : T
} | KIZI/EasyMiner-Apriori-R | src/main/scala/cz/vse/easyminer/miner/DatasetBuilder.scala | Scala | bsd-3-clause | 191 |
package services
import org.specs2.mutable.Specification
import scala.util.Try
class OptimiserWithFlexibleProcessorsSpec extends Specification {
val oneDesk: Seq[Int] = Seq.fill(30)(1)
val oneBank: Seq[Int] = Seq.fill(30)(1)
private val zeroWaitFor30Minutes: Seq[Int] = Seq.fill(30)(0)
"Crunch with desk wo... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/test/scala/services/OptimiserWithFlexibleProcessorsSpec.scala | Scala | apache-2.0 | 10,522 |
package com.rockymadden.stringmetric.phonetic
import com.rockymadden.stringmetric.{StringAlgorithm, StringFilter}
import com.rockymadden.stringmetric.Alphabet.{Alpha, LowercaseVowel}
import scala.annotation.{switch, tailrec}
/** An implementation of the refined NYSIIS algorithm. */
class RefinedNysiisAlgorithm extend... | cocoxu/multip | src/main/scala/com/rockymadden/stringmetric/phonetic/RefinedNysiisAlgorithm.scala | Scala | gpl-3.0 | 5,144 |
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.