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.stackmob.newman.test.client
import org.specs2.matcher.{Expectable, MustMatchers, MustExpectations, Matcher, MatchResult}
import org.specs2.Specification
import com.stackmob.newman.{Headers, HeaderList}
import com.stackmob.newman.Headers.HeadersShow
import scalaz.Scalaz._
/**
* Created by IntelliJ IDEA.
... | megamsys/newman | src/test/scala/com/stackmob/newman/test/client/HeadersMatcher.scala | Scala | apache-2.0 | 1,795 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | mohammadshahidkhan/incubator-carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/TableCreator.scala | Scala | apache-2.0 | 20,659 |
package introduction
/**
* Created by devendradesale on 3/4/16.
*/
// https://www.hackerrank.com/challenges/fp-array-of-n-elements
object CreateRange {
def f(num:Int) : List[Int] = (1 to num).toList
def main(args: Array[String]) {
print(f(4))
}
}
| DevendraDesale/functional_programming | src/main/scala/introduction/CreateRange.scala | Scala | mit | 264 |
/*
* Copyright 2014 Joshua Goldie
*
* 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... | jdgoldie/akka-persistence-shared-inmemory | src/multi-jvm/scala/akka.persistence.inmem.sample/ExampleMuiltiJvmTestSpec.scala | Scala | apache-2.0 | 8,685 |
// Scalaใฎใใชใขใผใใฃใบใ
package playground.basic
object Polymorphism extends App {
// Index
MethodOverloading()
Inheritance()
PimpMyLibraryPattern()
TypeClassAndDependentMethodTypes()
MagnetPattern()
// Method Overloading
object MethodOverloading {
case class CreateCommand()
case class UpdateComman... | suin/scala-playground | src/main/scala/playground/basic/Polymorphism.scala | Scala | mit | 4,700 |
package org.scalatra
import java.io.ByteArrayOutputStream
import org.scalatra.test.specs2.MutableScalatraSpec
import skinny.micro.base.MainThreadLocalEverywhere
import skinny.micro.routing.RoutingDsl
import skinny.micro._
class ActionResultServlet extends SkinnyMicroServlet with ActionResultTestBase
trait ActionRes... | xerial/skinny-micro | micro/src/test/scala/org/scalatra/ActionResultsSpec.scala | Scala | bsd-2-clause | 4,720 |
/*
* 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 ... | Dax1n/spark-core | core/src/main/scala/org/apache/spark/executor/MesosExecutorBackend.scala | Scala | apache-2.0 | 4,468 |
package edu.udlap.analysis
import java.util.{List => JavaList}
import edu.udlap.graph.Graph
/** Module that computes the bewtweenness centrality */
object Betweenness {
/** Calculates betweenness of node with id 'u'
*
* @param graph to be used for the calculation.
* @param u id of node to be used.
* @r... | Innova4DReaumobile/census_prototype | src/main/scala/edu/udlap/analysis/Betweenness.scala | Scala | mit | 1,746 |
/**
* Copyright 2016 Confluent 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 agree... | randyzingle/tools | gradle-streams/src/test/scala/io/confluent/examples/streams/SpecificAvroScalaIntegrationTest.scala | Scala | apache-2.0 | 6,180 |
package is.hail.linalg
import is.hail.annotations.{Region, StagedRegionValueBuilder}
import is.hail.asm4s.{Code, MethodBuilder}
import is.hail.asm4s._
import is.hail.utils._
import is.hail.expr.ir.{EmitCodeBuilder, EmitMethodBuilder}
import is.hail.types.physical.{PBaseStructValue, PCode, PNDArrayCode, PNDArrayValue, ... | danking/hail | hail/src/main/scala/is/hail/linalg/LinalgCodeUtils.scala | Scala | mit | 2,381 |
package org.tap.domain
import java.io.{ByteArrayInputStream, InputStream}
import org.scalatest.{FlatSpec, Matchers}
class DocumentSpec extends FlatSpec with Matchers{
"Given a document with a single paragraph that" should "be found if it contains a text" in {
// Given
val p = Paragraph("dummy", "Text and... | GeorgiosAndreadakis/TextAnalyzerPlatform | domain/src/test/scala/org/tap/domain/DocumentSpec.scala | Scala | apache-2.0 | 2,116 |
package suzaku.platform.web
import org.scalajs.dom
import suzaku.platform.{Cancellable, Scheduler}
import scala.concurrent.duration.FiniteDuration
import scala.scalajs.js.timers._
class DOMScheduler extends Scheduler {
private class TimeoutCancellable(handle: SetTimeoutHandle) extends Cancellable {
var isCanc... | suzaku-io/suzaku | platform/web/core-ui/src/main/scala/suzaku/platform/web/DOMScheduler.scala | Scala | apache-2.0 | 1,729 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | asubbaswamy/factorie | src/test/scala/cc/factorie/util/TestAssignmentSolver.scala | Scala | apache-2.0 | 2,617 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ronq/geomesa | geomesa-filter/src/test/scala/org/locationtech/geomesa/filter/function/FastPropertyTest.scala | Scala | apache-2.0 | 2,410 |
package org.bizzle.tester
import
util.parsing.combinator.RegexParsers
import
org.bizzle.tester.criteria._
/**
* Created by IntelliJ IDEA.
* User: Jason
* Date: 3/17/12
* Time: 11:13 PM
*/
// This was a fun experiment, but it is actually no longer used in the code
// It has been replaced by TestCriteriaDial... | TheBizzle/Tester | src/main/org/bizzle/tester/TestCriteriaParser.scala | Scala | bsd-3-clause | 1,923 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.tools.nsc.transf... | scala/scala | src/compiler/scala/tools/nsc/transform/async/StateAssigner.scala | Scala | apache-2.0 | 1,134 |
package io.jfc
import cats.Foldable
import cats.data.{ NonEmptyList, Validated, Xor }
import cats.functor.Contravariant
import cats.std.list._
/**
* A type class that provides a conversion from a value of type `A` to a [[Json]].
*
* @author Travis Brown
*/
trait Encode[A] {
/**
* Converts a value to JSON.
... | non/circe | core/src/main/scala/io/jfc/Encode.scala | Scala | apache-2.0 | 5,377 |
// 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,... | travisbrown/zipkin | zipkin-cassandra/src/main/scala/com/twitter/cassie/ClusterRemapper.scala | Scala | apache-2.0 | 3,995 |
/*
* -โฅโโโโ -โโโโ-
* โกโขโโโโโ\\โโโฯ โโโโโโโโโโโโชโ
* โฃโฌโโ` `โโโโขโ ฯโโฃโฌโโ โโโขโฃQ
* โโฃโฌโโ ` โคโโโร
` โโขโฌโฃ
* โโฃโฌโโ โโโโโ`ยซโ โขโขโฃโ
* โซโฌโโโ .โ โโจโจ โฃโฃโฌโฯ โฯโโขโขร
* โโขโโโโโ"โโโโ โร
โโโโโโโโโโ`
* ``หยฌ โ หหโยด
*
* ... | Flipkart/connekt | busybees/src/test/scala/com/flipkart/connekt/busybees/tests/streams/topologies/OpenWebTopologyTest.scala | Scala | mit | 4,764 |
package com.twitter.finagle.http.filter
import com.twitter.finagle.{Service, SimpleFilter}
import com.twitter.finagle.http.{Request, Response, Status}
import com.twitter.util.Future
/**
* Validate request filter:
* 400 Bad Request is the request is /bad-http-request - Finagle sets this if the
* request is ... | adriancole/finagle | finagle-http/src/main/scala/com/twitter/finagle/http/filter/ValidateRequestFilter.scala | Scala | apache-2.0 | 898 |
package chapter21
/**
* 21.2 ์์ ๊ท์น
*
* 1. ํ์๊ท์น: implicit๋ก ํ์ํ ์ ์๋ง ๊ฒํ ๋์์ด๋ค
*
* implicit ํค์๋๋ ์์ ์ฒ๋ฆฌ์ ์ฌ์ฉํ ์ ์ธ์ ํ์ํ๋ค.
* ๋ณ์, ํจ์, ๊ฐ์ฒด ์ ์์ implicit ํ์๋ฅผ ๋ฌ ์ ์๋ค.
*
* 2. ์ค์ฝํ ๊ท์น: ์ฝ์
ํ implicit ๋ณํ์ ์ค์ฝํ ๋ด์ ๋จ์ผ ์๋ณ์๋ก๋ง ์กด์ฌํ๊ฑฐ๋, ๋ณํ์ ๊ฒฐ๊ณผ๋
* ์๋ ํ์
๊ณผ ์ฐ๊ด์ด ์์ด์ผ ํ๋ค.
*
* some.convert(x) + y ํํ๋ก ํ์ฅํ์ง ์๋๋ค. convert๋ก ํด์ผ ํ๋ค.
*
* ๋จ์ผ ์๋ณ์ ... | seraekim/srkim-lang-scala | src/main/java/chapter21/c21_i02.scala | Scala | bsd-3-clause | 2,542 |
package org.backuity.nespresso
import org.junit.Test
class DemoTest {
@Test
def testSomeStuff(): Unit = {
println("Ok, tested just fine")
}
}
| backuitist/scala-nespresso | build-tool/maven/src/test/scala/org/backuity/nespresso/DemoTest.scala | Scala | apache-2.0 | 155 |
object G {
object Z {
class I
object I
}
object U {
type I = Z.I
}
import Z.I
object K {
import U._
def foo(x: I) = 1
def foo(x: Any) = "text"
/*start*/foo(new I)/*end*/
}
}
//Int | triggerNZ/intellij-scala | testdata/typeInference/bugs5/SCL4904.scala | Scala | apache-2.0 | 225 |
package controllers
import com.typesafe.config.ConfigFactory
import com.typesafe.scalalogging.Logger
import org.slf4j.LoggerFactory
import scala.util.Either
object SessionChecker extends SessionConfig{
val logger = Logger(LoggerFactory.getLogger(this.getClass))
val config = ConfigFactory.load("app")
val timeout... | richardchankiyin/sysdashboard | Portal/app/controllers/SessionChecker.scala | Scala | gpl-3.0 | 2,512 |
/**
* Copyright (c) 2016, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. licenses this file to you 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/LIC... | cloudera/spark-timeseries | src/test/scala/com/cloudera/sparkts/models/AutoregressionXSuite.scala | Scala | apache-2.0 | 5,457 |
object Test extends App {
println(ReturnTypeRefinement.foo.x)
case class Foo(i: Int, s: String, b: Boolean)
def foo[C, L](c: C)(implicit iso: FundepMaterialization[C, L]): L = iso.to(c)
locally {
val equiv = foo(Foo(23, "foo", true))
def typed[T](t: => T): Unit = {}
typed[(Int, String, Boolean)](eq... | yusuke2255/dotty | tests/untried/neg-with-implicits/macro-bundle-whitebox-use-refined/Test_2.scala | Scala | bsd-3-clause | 510 |
package org.sgine.ui.font
import org.powerscala.Resource
import org.sgine.ui._
import xml.{Elem, XML}
/**
* BitmapFont represents a font that utilizes vertices and textures to display.
*
* @author Matt Hicks <mhicks@sgine.org>
*/
case class BitmapFont(face: String,
size: Int,
... | Axiometry/sgine | ui/src/main/scala/org/sgine/ui/font/BitmapFont.scala | Scala | bsd-3-clause | 2,963 |
package com.geishatokyo.sqlgen.process
/**
* Created by takezoux2 on 2017/07/05.
*/
trait ConvertedData[+T]{
def name: String
def value: T
def asString: String
def asBytes: Array[Byte]
}
case class StringData(name: String, value: String) extends ConvertedData[String] {
override def asString: String = ... | geishatokyo/sql-generator | src/main/scala/com/geishatokyo/sqlgen/process/ConversionResult.scala | Scala | mit | 443 |
package me.archdev.restapi.core.profiles
import me.archdev.restapi.core.UserProfile
import me.archdev.restapi.utils.db.DatabaseConnector
private[profiles] trait UserProfileTable {
protected val databaseConnector: DatabaseConnector
import databaseConnector.profile.api._
class Profiles(tag: Tag) extends Table[U... | ArchDev/akka-http-rest | src/main/scala/me/archdev/restapi/core/profiles/UserProfileTable.scala | Scala | mit | 653 |
package com.sksamuel.elastic4s.requests.searches.queries.geo
import com.sksamuel.elastic4s.requests.common.DistanceUnit
import com.sksamuel.elastic4s.requests.searches.queries.Query
import com.sksamuel.elastic4s.ext.OptionImplicits._
case class GeoDistanceQuery(field: String,
geoDistance: ... | sksamuel/elastic4s | elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/searches/queries/geo/GeoDistanceQuery.scala | Scala | apache-2.0 | 1,862 |
package specs.box
import com.plasmaconduit.conveyance.{ConveyedError, ConveyedInput, Conveyor, Box}
import org.specs2.mutable._
class BoxOnErrorResumeNext extends Specification {
"Performing onErrorResumeNext on a box that contains a value" should {
"produce a box containing that value" in {
var boxed = ... | plasmaconduit/conveyance | src/test/scala/specs/box/BoxOnErrorResumeNext.scala | Scala | mit | 1,438 |
import play.api._
import models._
import com.mongodb.casbah.Imports._
import org.joda.time._
object Global extends GlobalSettings {
override def onStart(app: Application) {
Logger.info("Application has started")
val ocOption = OrderControl.findOne(MongoDBObject("status" -> "closed"))
ocOption match {
... | kandole/simple_reservation | app/Global.scala | Scala | gpl-2.0 | 836 |
/*
* 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 ... | jkbradley/spark | core/src/main/scala/org/apache/spark/util/Utils.scala | Scala | apache-2.0 | 112,414 |
/*
* 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/businesscustomer/ReviewDetails.scala | Scala | apache-2.0 | 2,900 |
package de.htwg.zeta.server.model.modelValidator.validator.rules.metaModelDependent
import scala.collection.immutable.Seq
import de.htwg.zeta.common.models.project.concept.elements.MAttribute
import de.htwg.zeta.common.models.project.concept.elements.MClass
import de.htwg.zeta.common.models.project.concept.Concept
im... | Zeta-Project/zeta | api/server/test/de/htwg/zeta/server/model/modelValidator/validator/rules/metaModelDependent/NodesTest.scala | Scala | bsd-2-clause | 2,208 |
import scala.reflect.runtime.universe._
object Test {
val x1 = "abc" drop 1 // "bc": String
val x2 = ("abc": Name) drop 1 // error
}
| yusuke2255/dotty | tests/untried/neg/reflection-names-neg.scala | Scala | bsd-3-clause | 162 |
/*
* Copyright 2011 PEAK6 Investments, L.P.
*
* 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 o... | peak6/scala-ssh-shell | src/main/scala/peak6/util/ScalaSshShell.scala | Scala | apache-2.0 | 7,570 |
/**
* Copyright (C) 2010 Travis Brown, The University of Texas at Austin
*
* 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
*
* ... | tectronics/textgrounder | src/main/scala/opennlp/textgrounder/util/cluster/KMeans.scala | Scala | apache-2.0 | 2,460 |
/*
* 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 ... | dotunolafunmiloye/spark | core/src/main/scala/org/apache/spark/ui/env/EnvironmentUI.scala | Scala | apache-2.0 | 3,691 |
package controllers
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import play.api.mvc.Action
import play.api.mvc.Controller
/**
* Index page, hello page and other simple returns
*/
object SimpleController extends Controller { // Defines utility methods to generate Action ... | p44/HodgePodge | app/controllers/SimpleController.scala | Scala | apache-2.0 | 708 |
/*
* Copyright ยฉ 2015 Reactific Software LLC. All Rights Reserved.
*
* 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 us... | reactific/RxMongo | messages/src/main/scala/rxmongo/messages/cmds/QueryPlanCacheCommands.scala | Scala | mit | 7,159 |
package net.i2p.router.update
import org.scalatest.FunSpec
import org.scalatest.mock.MockitoSugar
import java.net.URI
import java.util.Collections
import net.i2p.router.RouterContext
/**
* @author str4d
*/
class UnsignedUpdateCheckerSpec extends FunSpec with UpdateRunnerBehaviors with MockitoSugar {
def unsig... | NoYouShutup/CryptMeme | CryptMeme/apps/routerconsole/java/test/scalatest/net/i2p/router/update/UnsignedUpdateCheckerSpec.scala | Scala | mit | 725 |
package org.brijest.storm.engine
package model
sealed trait Trigger extends Immutable
object Trigger {
def assertValid(turns: Long) {
assert(turns > 0)
assert(turns < (Long.MaxValue - 1))
}
}
object NullTrigger extends Trigger
final case class Sleep(turns: Long) extends Trigger {
Trigger asser... | axel22/scala-2d-game-editor | src/main/scala/org/brijest/storm/engine/model/Triggers.scala | Scala | bsd-3-clause | 883 |
package net.tomasherman.specus.common.api.net.session
/**
* This file is part of Specus.
*
* Specus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option)... | tomasherman/specus | common_api/src/main/scala/net/session/IntSessionID.scala | Scala | gpl-3.0 | 1,006 |
package akka.persistence.journal
import scala.collection.immutable.Seq
import akka.actor._
import akka.persistence._
import akka.persistence.JournalProtocol._
import akka.testkit._
import com.typesafe.config._
object JournalSpec {
val config = ConfigFactory.parseString(
"""
|akka.persistence.publish-con... | krasserm/akka-persistence-testkit | src/main/scala/akka/persistence/journal/JournalSpec.scala | Scala | apache-2.0 | 9,598 |
package com.rasterfoundry.datamodel
import io.circe.generic.JsonCodec
import java.sql.Timestamp
import java.util.UUID
@JsonCodec
final case class Thumbnail(id: UUID,
createdAt: Timestamp,
modifiedAt: Timestamp,
widthPx: Int,
... | raster-foundry/raster-foundry | app-backend/datamodel/src/main/scala/Thumbnail.scala | Scala | apache-2.0 | 2,001 |
/*
* 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-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/logical/groupWindows.scala | Scala | apache-2.0 | 9,747 |
/*
* Copyright (C) 2012 Romain Reuillon
*
* 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.
*
* This progra... | ISCPIF/PSEExperiments | openmole-src/openmole/core/org.openmole.core.workflow/src/main/scala/org/openmole/core/workflow/puzzle/package.scala | Scala | agpl-3.0 | 1,619 |
/*
* 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 ... | guggla/guggla | src/main/scala/guggla/AbstractScriptInfo.scala | Scala | apache-2.0 | 1,837 |
package reactivemongo.api.commands
// TODO#1.1: Move to `api` ?
@deprecated("Will be replaced by `reactivemongo.api.MultiWriteResult`", "0.19.8")
case class MultiBulkWriteResult(
ok: Boolean,
n: Int,
nModified: Int,
upserted: Seq[Upserted],
writeErrors: Seq[WriteError],
writeConcernError: Option[WriteConce... | cchantep/ReactiveMongo | driver/src/main/scala/api/commands/MultiBulkWriteResult.scala | Scala | apache-2.0 | 1,779 |
package info.amrhassan.graphs
import scala.collection.mutable
/**
* An immutable persistent Graph.
*/
trait Graph[Vertex] {
def isDirected: Boolean
/**
* Returns a new instance where v1 and v2 are connected.
*/
def connect(v1: Vertex, v2: Vertex): Graph[Vertex]
/**
* The vertices contained in th... | amrhassan/scala-toygraphs | src/main/scala/info/amrhassan/graphs/Graph.scala | Scala | mit | 5,149 |
package org.dsa.mediator.parasail
import org.dsa.rdd.AlignmentRecord
import parasail.{Matrix, RunParasail}
/**
* Created by xubo on 2016/12/4.
*/
object ParasailScala {
def align(query: String, ref: String): AlignmentRecord = {
val maxScore = RunParasail.run(query, ref)
val alignmentRecord = new Alignm... | xubo245/CloudSW | src/main/scala/org/dsa/mediator/parasail/ParasailScala.scala | Scala | gpl-2.0 | 1,456 |
package com.github.mrpowers.spark.daria.sql
import org.apache.spark.sql.Column
import org.apache.spark.sql.functions._
/**
* Additional methods for the Spark Column class
*
* @groupname expr_ops Expression operators
* @groupname df_ops DataFrame functions
* @groupname Ungrouped Support functions for DataFrames
... | MrPowers/spark-daria | src/main/scala/com/github/mrpowers/spark/daria/sql/ColumnExt.scala | Scala | mit | 10,198 |
package scala.slick.jdbc
import java.sql.ResultSet
import scala.slick.util.CloseableIterator
/** An invoker which calls a function to retrieve a ResultSet. This can be used
* for reading information from a java.sql.DatabaseMetaData object which has
* many methods that return ResultSets.
*
* For convenience, i... | dvinokurov/slick | src/main/scala/scala/slick/jdbc/ResultSetInvoker.scala | Scala | bsd-2-clause | 1,292 |
package com.twitter.finagle.mux.lease.exp
import com.twitter.util.{Duration, Stopwatch, StorageUnit, Time}
import com.twitter.conversions.DurationOps._
/**
* `Alarm` describes whether a thread is ready to wake up, and if it's not
* ready, how much longer it should sleep before checking again whether it's
* ready t... | twitter/finagle | finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/Alarm.scala | Scala | apache-2.0 | 3,283 |
/*
* 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... | jenniew/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/visualization/Summary.scala | Scala | apache-2.0 | 4,694 |
/*
* 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... | xerial/silk | silk-sbt/src/main/scala/xerial/sbt/SilkPlugin.scala | Scala | apache-2.0 | 3,410 |
package org.wquery.printer
import java.io.{OutputStream, OutputStreamWriter}
import org.wquery.model._
import scala.xml.{Utility, XML}
class LmfPrinter extends WordNetPrinter {
override def print(wordNet: WordNet, output: OutputStream) = {
val synsets = wordNet.fetch(WordNet.SynsetSet, List((Relation.Src, Nil... | marekkubis/wquery | src/main/scala/org/wquery/printer/LmfPrinter.scala | Scala | bsd-3-clause | 2,298 |
package com.xhachi.gae4s.datastore
import scala.language.experimental.macros
object Query {
def apply[E <: Entity[E]](implicit meta: EntityMeta[E]): Query[E] = Query(meta, None)
}
case class Query[E <: Entity[E]](meta: EntityMeta[E],
ancestorOption: Option[Key[_]] = None,
... | thachi/gae4s | core/src/main/scala/com/xhachi/gae4s/datastore/Query.scala | Scala | apache-2.0 | 4,591 |
/*
Copyright (c) 2017-2021, Robby, Kansas State University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of... | sireum/v3-logika-runtime | library/shared/src/test/scala/org/sireum/STest.scala | Scala | bsd-2-clause | 5,115 |
package com.twitter.finagle
/**
* Codecs provide protocol encoding and decoding via netty pipelines
* as well as a standard filter stack that are applied to services
* from this codec.
*/
import com.twitter.finagle.dispatch.{SerialClientDispatcher, SerialServerDispatcher}
import com.twitter.finagle.stats.StatsRec... | kristofa/finagle | finagle-core/src/main/scala/com/twitter/finagle/Codec.scala | Scala | apache-2.0 | 3,660 |
package com.landoop.streamreactor.connect.hive.source.config
import com.datamountaineer.streamreactor.common.config.base.traits.{BaseConfig, ConnectionSettings, ErrorPolicySettings, KcqlSettings, NumberRetriesSettings, UserSettings}
import java.util
import org.apache.kafka.common.config.ConfigDef
import org.apache.k... | datamountaineer/stream-reactor | kafka-connect-hive/src/main/scala/com/landoop/streamreactor/connect/hive/source/config/HiveSourceConfigDef.scala | Scala | apache-2.0 | 4,005 |
package views.html.relay
import play.api.mvc.Call
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import lila.common.paginator.Paginator
import controllers.routes
import lila.relay.{ RelayRound, RelayTour }
object tour {
import trans.broadcast._
def inde... | luanlv/lila | app/views/relay/tour.scala | Scala | mit | 2,306 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package toplevel
package typedef
import com.intellij.lang.ASTNode
import com.intellij.lang.java.lexer.JavaLexer
import com.intellij.openapi.project.DumbService
import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiModifier._
impo... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/impl/toplevel/typedef/ScObjectImpl.scala | Scala | apache-2.0 | 7,438 |
import collection.JavaConverters._
import com.github.cleverage.elasticsearch.IndexClient
import com.github.cleverage.elasticsearch.ScalaHelpers._
import org.elasticsearch.client.Requests
import org.elasticsearch.index.query.{QueryBuilder, QueryBuilders}
import org.specs2.mutable.Specification
import play.api.libs.json.... | 7thsense/play2-elasticsearch | module/test/IndexingSpec.scala | Scala | mit | 5,075 |
package com.eevolution.context.dictionary.domain.api.service
import com.eevolution.context.dictionary._
import com.eevolution.context.dictionary.domain.model.ProcessTrl
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribute it... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/service/ProcessTrlService.scala | Scala | gpl-3.0 | 1,201 |
package test
/**
* Created by ducnhabui on 10/23/15.
*/
import bdn.gol.loc
import org.scalatest._
class IocSpec extends FlatSpec with Matchers {
"Gol" should "Any live cell with fewer than two live neighbours dies, as if caused by under-population" in {
val loc = new loc()
loc.solve()
}
}
| nhabuiduc/CTKata | Gol/Nha/src/main/java/test/locSpec.scala | Scala | mit | 312 |
/*
* 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 | core/src/main/scala/org/apache/spark/HeartbeatReceiver.scala | Scala | apache-2.0 | 9,477 |
/**
* Copyright 2012-2014 Jorge Aliss (jaliss at gmail dot com) - twitter: @jaliss
*
* 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
*... | matthewchartier/securesocial | module-code/app/securesocial/core/providers/UsernamePasswordProvider.scala | Scala | apache-2.0 | 5,261 |
package com.peterpotts.sample
import scala.util.{Failure, Success, Try}
class SampleTry[A](sampleA: Sample[A], sampleB: Sample[String])
extends FlatMapSample[Boolean, Try[A]](SampleBoolean, { boolean =>
for {
a <- sampleA
b <- sampleB
} yield if (boolean) Success(a) else Failure(new RuntimeExcep... | peterpotts/sample | src/main/scala/com/peterpotts/sample/SampleTry.scala | Scala | mit | 450 |
package org.scalatra
package servlet
import test.scalatest.ScalatraFunSuite
class ServletContextAttributesTest extends ScalatraFunSuite with AttributesTest {
addServlet(new AttributesServlet {
def attributesMap = applicationContext
}, "/*")
}
| louk/scalatra | core/src/test/scala/org/scalatra/servlet/ServletContextAttributesTest.scala | Scala | bsd-2-clause | 254 |
package org.psesd.srx.services.prs
import org.psesd.srx.shared.core.extensions.TypeExtensions._
import org.psesd.srx.shared.core.sif.{SifHttpStatusCode, SifRequestParameter}
import org.scalatest.{BeforeAndAfterAll, FunSuite}
class PersonnelTests extends FunSuite with BeforeAndAfterAll {
var createdId: Int = 0
v... | PSESD/srx-services-prs | src/test/scala/org/psesd/srx/services/prs/PersonnelTests.scala | Scala | mit | 4,547 |
package net.chwthewke.passman
import cats.Eq
import cats.Id
import cats.instances.int._
import cats.instances.option._
import cats.instances.string._
import cats.instances.unit._
import java.time.LocalDateTime
import cat._
import engine._
package object model {
type PasswordDocument = PasswordM[Id, Id]
object ... | chwthewke/passman | passman-core/src/main/scala/net/chwthewke/passman/model/package.scala | Scala | bsd-3-clause | 2,233 |
package ee.cone.c4actor
import java.time.Duration
import java.util.concurrent.CompletableFuture
import com.typesafe.scalalogging.LazyLogging
import ee.cone.c4actor.Types.{NextOffset, SrcId}
import ee.cone.c4assemble.Single
import ee.cone.c4proto.ToByteString
import java.nio.charset.StandardCharsets.UTF_8
import java... | wregs/c4proto | c4actor-kafka/src/main/scala/ee/cone/c4actor/KafkaImpl.scala | Scala | apache-2.0 | 5,971 |
/**
* Copyright 2015 Zaradai
*
* 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 writ... | zaradai/fastlog | logging/src/test/scala/com/zaradai/fastlog/logging/util/LogTester.scala | Scala | apache-2.0 | 3,093 |
/*
* Longs.scala
* (LucreEvent)
*
* Copyright (c) 2011-2014 Hanns Holger Rutz. All rights reserved.
*
* 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
package lucre
p... | Sciss/LucreEvent | expr/src/test/scala/de/sciss/lucre/expr/Longs.scala | Scala | lgpl-2.1 | 4,432 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/geotools/converters/FastConverter.scala | Scala | apache-2.0 | 4,150 |
package hephaestus
package lunarg
package tutorial
import hephaestus.platform._
import java.nio._
/** Draws a coloured cube using a secondary command buffer */
object Step16 extends Utils {
def main(args: Array[String]): Unit = {
glfw.init()
val instance = initInstanceExtensionsDump()
glfw.windowHint... | to-ithaca/hephaestus | samples/src/main/scala/hephaestus/lunarg/tutorial/Step16.scala | Scala | apache-2.0 | 9,511 |
package provingground.interface
import provingground._
import edu.mit.jwi._, item._
import scala.jdk.CollectionConverters._
import java.io.File
import scala.util._
object WordNet{
val url = getClass().getClassLoader().getResource("dict")
val urlDirect = new File("nlp/data/dict").toURI().toURL()
os.makeDir... | siddhartha-gadgil/ProvingGround | nlp/src/main/scala/provingground/interface/WordNet.scala | Scala | mit | 1,249 |
package sri.mobile.components.android
import chandu0101.macros.tojs.JSMacro
import sri.core.{ReactNode, React}
import sri.mobile.{ViewPagerAndroidEvent, ReactNative}
import sri.universal.ReactEvent
import scala.scalajs.js
import scala.scalajs.js.{UndefOr => U, undefined}
case class ViewPagerAndroid(key: U[String] =... | hamazy/sri | mobile/src/main/scala/sri/mobile/components/android/ViewPagerAndroid.scala | Scala | apache-2.0 | 1,509 |
/*
* Copyright 2016 Dennis Vriend
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | dnvriend/reactive-activemq | src/test/scala/akka/stream/integration/activemq/ActiveMqReqRespFlowTest.scala | Scala | apache-2.0 | 2,654 |
package controllers
import java.util.UUID
import javax.inject.Inject
import io.apibuilder.api.v0.models.TokenForm
import lib.{ApiClientProvider, PaginatedCollection, Pagination}
import play.api.data._
import play.api.data.Forms._
import scala.concurrent.Future
class TokensController @Inject() (
val apibuilderCont... | apicollective/apibuilder | app/app/controllers/TokensController.scala | Scala | mit | 3,485 |
package com.bob.scala.webapi
import java.util
import java.util.{Objects}
import org.springframework.beans.BeansException
import org.springframework.beans.factory.DisposableBean
import org.springframework.context.{ApplicationContext, ApplicationContextAware}
/**
* Created by wangxiang on 17/9/12.
*/
object Applic... | sevenz/springboot-scala-withswagger | webapi/src/main/scala/com/bob/scala/webapi/ApplicationContextHolder.scala | Scala | apache-2.0 | 1,661 |
package TutorialSolutions
import Chisel._
import Node._
import scala.collection.mutable.HashMap
import util.Random
class Accumulator extends Component {
val io = new Bundle {
val in = UFix(width = 1, dir = INPUT)
val out = UFix(width = 8, dir = OUTPUT)
}
// COUNT INCOMING TRUES
// FILL IN HERE ...
... | seyedmaysamlavasani/GorillaPP | chisel/chisel-tutorial/src/solutions/Accumulator.scala | Scala | bsd-3-clause | 891 |
package tests
import org.scalatestplus.play._
import play.api.inject.guice._
import play.api.{Application, Play}
import razie.diesel.engine.DomEngineSettings
import razie.diesel.samples.DomEngineUtils
/**
* Created by raz on 2017-07-06.
*/
class TestSimplePlayEngine extends PlaySpec /*with GuiceOneAppPerSuite */ ... | razie/wikireactor | diesel/src/test/scala/tests/TestSimplePlayEngine.scala | Scala | apache-2.0 | 811 |
package de.sciss.fscape
package tests
import de.sciss.audiofile.AudioFile
import de.sciss.file._
import de.sciss.fscape.Ops._
import de.sciss.numbers.Implicits._
import scala.concurrent.Await
import scala.concurrent.duration.Duration
object TestACIntensity extends App {
val fIn = file("/data/projects/Maeanderu... | Sciss/FScape-next | core/jvm/src/test/scala/de/sciss/fscape/tests/TestACIntensity.scala | Scala | agpl-3.0 | 3,593 |
package io.aigar.controller
import io.aigar.game._
import io.aigar.model.PlayerRepository
import io.aigar.controller.response._
import org.json4s.MappingException
import org.scalatra.json._
import scala.util.{Success, Try }
class GameController(game: GameThread, playerRepository: PlayerRepository)
extends AigarStac... | DrPandemic/aigar.io | game/src/main/scala/io/aigar/controller/GameController.scala | Scala | mit | 2,196 |
/*
* Updates.scala
*
* Copyright 2017 wayfarerx <x@wayfarerx.net> (@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/dreamsleeve | shared/data/src/main/scala/net/wayfarerx/dreamsleeve/data/patch_data/Updates.scala | Scala | apache-2.0 | 1,478 |
/*
* 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 ... | wangyixiaohuihui/spark2-annotation | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveComparisonTest.scala | Scala | apache-2.0 | 18,752 |
/*
* 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 ... | darionyaphet/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/types/numerics.scala | Scala | apache-2.0 | 5,977 |
package de.hyronx.matter.compiler.types
import org.scalatest._
import de.hyronx.matter.library.MutableTree
class GenericTypeTraitTest extends FlatSpec with Matchers {
val base = MutableTree(
BuiltInType("Base"),
BuiltInType("Matter"))
val genericBounds = GenericParams(
SingleGenericParameter("T", ba... | hyronx/matter | src/test/scala/de/hyronx/matter/compiler/types/GenericTypeTraitTest.scala | Scala | apache-2.0 | 874 |
package fpinscala.state
trait RNG {
def nextInt: (Int, RNG) // Should generate a random `Int`. We'll later define other functions in terms of `nextInt`.
}
object RNG {
// NB - this was called SimpleRNG in the book text
case class Simple(seed: Long) extends RNG {
def nextInt: (Int, RNG) = {
val newSe... | RheinMainScala/fpinscala | exercises/src/main/scala/fpinscala/state/State.scala | Scala | mit | 3,205 |
/**
* 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... | cran/rkafkajars | java/kafka/consumer/SimpleConsumer.scala | Scala | apache-2.0 | 6,449 |
/*
* Copyright 2017 Datamountaineer.
*
* 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... | datamountaineer/stream-reactor | kafka-connect-bloomberg/src/test/scala/com/datamountaineer/streamreactor/connect/bloomberg/BloombergSubscriptionManagerTest.scala | Scala | apache-2.0 | 3,492 |
package concrete
package heuristic
import java.util.{EventListener, EventObject}
import scala.util.{Failure, Random, Success, Try}
object Heuristic {
def default(pm: ParameterManager, decision: Seq[Variable], rand: Random): Try[Heuristic] = {
pm.getRaw("heuristic").getOrElse(classOf[CrossHeuristic]) match {
... | concrete-cp/concrete | src/main/scala/concrete/heuristic/Heuristic.scala | Scala | lgpl-2.1 | 1,846 |
/*
* Copyright (c) 2014-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | snowplow/schema-ddl | modules/core/src/test/scala/com/snowplowanalytics/iglu/schemaddl/experimental/BumpsSpec.scala | Scala | apache-2.0 | 3,975 |
package scala.in.programming.default_type
/**
* @author loustler
* @since 01/20/2017 01:03
*/
object DefaultType {
val byteMaxHex: Byte = 0x7F
val shortMaxHex: Short = 0x7FFF
val intMaxHex: Int = 0x7FFFFFFF
val longMaxHex: Long = 0x7FFFFFFF
val charMaxHex: Char = 0xFFFF
val strs: String = ""
val fl... | loustler/scala | src/main/scala/scala/in/programming/default_type/DefaultType.scala | Scala | mit | 758 |
package jp.mydns._2gmon.machinelearning.classifier {
abstract class Classifier {
def learn(trainData : List[List[Double]], trainClass : List[Int]) : Classifier
def classify(data : List[List[Double]]) : List[Int]
}
}
| 2GMon/MachineLearningImplementation | scala/src/main/scala/machinelearning/Classifier.scala | Scala | mit | 228 |
/*
* Copyright (c) 2014-2020 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... | alexandru/monifu | monix-execution/shared/src/main/scala/monix/execution/misc/Local.scala | Scala | apache-2.0 | 11,223 |
package debop4s.data.slick.customtypes
/**
* ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ๋ณด๋ฅผ ์์ถ ์ ์ฅํ ๋ ์ฌ์ฉํ๋ ์ํ ๋ณํ์ ์ํํฉ๋๋ค.
* @author sunghyouk.bae@gmail.com
*/
case class CompressedArray(value: Array[Byte]) extends AnyVal
| debop/debop4s | debop4s-data-slick/src/main/scala/debop4s/data/slick/customtypes/CompressedArray.scala | Scala | apache-2.0 | 248 |
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.