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 es.weso.shex
import scala.util.parsing.input.Positional
import es.weso.rdf.nodes._
import es.weso.rdf._
import es.weso.utils.PrefixMapUtils._
/**
* Labels
*/
sealed trait Label {
def getNode(): RDFNode
def show(implicit pm: PrefixMap): String
}
object Label {
def labelStr(str: String): IRILabel = {
... | labra/ShExcala | src/main/scala/es/weso/shex/Label.scala | Scala | mit | 980 |
package com.ubeeko.htalk.criteria
import com.ubeeko.htalk.bytesconv._
import org.specs2.mutable.Specification
class QualifierSpec extends Specification {
"A qualifier" can {
"be created from Array[Byte]" in {
val b = Array[Byte](1, 2, 55, 3, 4)
val q = Qualifier(b)
q.value must beEqualTo(b)
... | eric-leblouch/htalk | src/test/scala/com/ubeeko/htalk/criteria/QualifierSpec.scala | Scala | apache-2.0 | 471 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/keras/layers/ThresholdSpec.scala | Scala | apache-2.0 | 2,140 |
package com.typesafe.slick.testkit.tests
import com.typesafe.slick.testkit.util.{RelationalTestDB, AsyncTest}
class RelationalScalarFunctionTest extends AsyncTest[RelationalTestDB] {
import tdb.profile.api._
def test = {
def check[T : BaseColumnType](q: Rep[T], exp: T) = q.result.map(_ shouldBe exp)
def ... | slick/slick | slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/RelationalScalarFunctionTest.scala | Scala | bsd-2-clause | 2,834 |
/*
* Copyright (C) 2012 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is di... | ISCPIF/PSEExperiments | openmole-src/openmole/plugins/org.openmole.plugin.environment.ssh/src/main/scala/org/openmole/plugin/environment/ssh/SSHAuthentication.scala | Scala | agpl-3.0 | 2,103 |
println("Hola dende un script")
| jmlb23/scala | libro_odersky/scripts_CH2/hello.scala | Scala | gpl-3.0 | 32 |
/*
* Copyright (C) 2011-2013 exsplay
*
* 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... | wertlex/exsplay | exsplay/src/main/scala/exsplay/api/routing/Route.scala | Scala | apache-2.0 | 766 |
package com.seanshubin.uptodate.logic
case class ReportNames(pom: String,
repository: String,
inconsistency: String,
upgradesToApply: String,
upgradesToIgnore: String,
statusQuo: String,
... | SeanShubin/up-to-date | logic/src/main/scala/com/seanshubin/uptodate/logic/ReportNames.scala | Scala | unlicense | 524 |
package predict4s
package sgp
import org.scalactic.Or
import spire.algebra._
//import spire.math._
import spire.implicits._
//import spire.syntax.primitives._
import predict4s.coord._
import predict4s.coord.CoordinatesConversions._
/**
* The SGP-4 theory is applied for all orbits with periods of T <= 225 min.
* It ... | pleira/SGP4Extensions | core/src/main/scala/predict4s/sgp/sgp4.scala | Scala | apache-2.0 | 2,915 |
package articles.repositories
import articles.controllers.{Page, PageRequest}
import articles.models.{Article, ArticleId, ArticleMetaModel}
import commons.models.{IdMetaModel, Property}
import commons.repositories._
import commons.repositories.mappings.JavaTimeDbMappings
import slick.dbio.DBIO
import slick.jdbc.MySQLP... | Dasiu/play-framework-test-project | app/articles/repositories/ArticleRepo.scala | Scala | mit | 2,399 |
package net.javachallenge.runner
import org.specs._
import org.specs.matcher._
import org.specs.runner.{ JUnitSuiteRunner, JUnit }
import org.junit.runner.RunWith
import net.javachallenge.scene.MainScene
import net.javachallenge.scene.VeinScene
import net.javachallenge.scene.console.ConsoleScene
import net.javachallen... | AI-comp/JavaChallenge2012 | src/test/scala/net/javachallenge/runner/ReplaySpecTest.scala | Scala | apache-2.0 | 2,749 |
package com.typesafe.sbt.packager.archetypes.systemloader
import sbt._
import sbt.Keys.{sourceDirectory, target}
import com.typesafe.sbt.packager.Keys.{
defaultLinuxStartScriptLocation,
killTimeout,
linuxMakeStartScript,
linuxPackageMappings,
linuxScriptReplacements,
linuxStartScriptName,
linuxStartScrip... | kardapoltsev/sbt-native-packager | src/main/scala/com/typesafe/sbt/packager/archetypes/systemloader/SystemdPlugin.scala | Scala | bsd-2-clause | 2,704 |
package be.mygod.app
import android.annotation.TargetApi
import android.content.Intent
import android.os.Bundle
import android.view.{View, ViewGroup}
import be.mygod.os.Build
import be.mygod.transition.CircularReveal
object CircularRevealActivity {
final val EXTRA_SPAWN_LOCATION_X = "be.mygod.app.CircularRevealActi... | Mygod/mygod-lib-android | src/main/scala/be/mygod/app/CircularRevealActivity.scala | Scala | gpl-3.0 | 2,096 |
/*
* Copyright 2016 Uncharted Software 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 o... | unchartedsoftware/salt | src/main/scala/software/uncharted/salt/core/analytic/numeric/MinMaxAggregator.scala | Scala | apache-2.0 | 1,696 |
import scala.tools.partest.DirectTest
object Test extends DirectTest {
override def extraSettings: String =
s"-usejavacp -Vprint-pos -Vprint:parser -Yrangepos -Ystop-after:parser -d ${testOutput.path} -cp ${testOutput.path}"
// test/files/pos/t6124.scala
override def code = """
trait T {
def i: I... | martijnhoekstra/scala | test/files/run/literals-parsing.scala | Scala | apache-2.0 | 586 |
override def map[A,B](functor: F[A])(g: A => B): F[B] =
ap(functor)(pure(g))
| grzegorzbalcerek/scala-exercises | Applic/stepApplicMap.scala | Scala | bsd-2-clause | 79 |
package dao
import com.google.inject.ImplementedBy
import dao.impl.ExtAuthDAOImpl
import models.User
import scala.concurrent.Future
/**
* Created by khanguyen on 3/30/16.
*/
@ImplementedBy(classOf[ExtAuthDAOImpl])
trait ExtAuthDAO {
def userExists(email: String): Future[Boolean]
def getUser(email: String):... | MedTalk/services | app/dao/ExtAuthDAO.scala | Scala | mit | 344 |
/*
* Copyright (c) 2013, Scodec
* 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 conditions a... | scodec/scodec | shared/src/main/scala/scodec/codecs/ChecksumMismatch.scala | Scala | bsd-3-clause | 2,024 |
/*
* Copyright 2021 ABSA Group Limited
*
* 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... | AbsaOSS/spline | persistence/src/test/scala/za/co/absa/spline/persistence/model/DataSourceSpec.scala | Scala | apache-2.0 | 1,397 |
package models
import play.api.libs.json.{Reads, JsPath, Writes}
import play.api.libs.functional.syntax._
case class PasswordEntryKeyword(id: Option[Int],
passwordEntryID: Option[Int],
keyword: String)
extends BaseModel {
overri... | bmc/pwguard | app/models/PasswordEntryKeyword.scala | Scala | bsd-3-clause | 1,211 |
/***********************************************************************
* 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/test/scala/org/locationtech/geomesa/utils/stats/MethodProfilingTest.scala | Scala | apache-2.0 | 3,009 |
package com.twitter.finagle.loadbalancer.aperture
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.Address.Inet
import com.twitter.finagle._
import com.twitter.finagle.loadbalancer.EndpointFactory
import com.twitter.finagle.loadbalancer.LoadBalancerFactory.PanicMode
import com.twitter.finagle.lo... | twitter/finagle | finagle-core/src/test/scala/com/twitter/finagle/loadbalancer/aperture/ApertureTest.scala | Scala | apache-2.0 | 21,515 |
package com.sksamuel.elastic4s.http.search.queries.span
import com.sksamuel.elastic4s.http.search.queries.QueryBuilderFn
import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory}
import com.sksamuel.elastic4s.searches.queries.span.SpanOrQuery
object SpanOrQueryBodyFn {
def apply(q: SpanOrQuery): XConten... | Tecsisa/elastic4s | elastic4s-http/src/main/scala/com/sksamuel/elastic4s/http/search/queries/span/SpanOrQueryBodyFn.scala | Scala | apache-2.0 | 714 |
package monocle
//import scalaz.Id.Id
//import scalaz.std.anyVal._
import cats.instances.list._
//import scalaz.std.option._
//import scalaz.syntax.std.boolean._
//import scalaz.syntax.std.option._
//import scalaz.syntax.tag._
import cats.{Applicative, Functor, Monoid, Traverse, Id}
import catssupport.Implicits._
imp... | fkz/Monocle | core/shared/src/main/scala/monocle/Traversal.scala | Scala | mit | 11,149 |
package org.atnos.eff.syntax
import cats.data.{Ior, IorNel, NonEmptyList, ValidatedNel}
import org.atnos.eff._
import cats.{Applicative, Semigroup}
object validate extends validate
trait validate {
implicit class ValidateEffectOps[R, A](e: Eff[R, A]) {
def runNel[E](implicit m: Member[Validate[E, *], R]): Ef... | etorreborre/eff-cats | shared/src/main/scala/org/atnos/eff/syntax/validate.scala | Scala | mit | 1,980 |
/*
* 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 ... | jatin9896/incubator-carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/partition/CarbonAlterTableAddHivePartitionCommand.scala | Scala | apache-2.0 | 7,286 |
package com.clemble.query
import reactivemongo.api.MongoDriver
import reactivemongo.api.collections.bson.BSONCollection
import reactivemongo.bson.{BSONDocumentWriter, BSONDocumentReader, BSONDocument}
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.... | clemble/scala-query-dsl | src/test/scala/com/clemble/query/MongoBSONSearchableRepositorySpec.scala | Scala | apache-2.0 | 1,801 |
/*
* 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 ... | vjagadish/samza-clone | samza-core/src/test/scala/org/apache/samza/checkpoint/file/TestFileSystemCheckpointManager.scala | Scala | apache-2.0 | 3,020 |
/**
* Copyright (C) 2014-2015 Really Inc. <http://really.io>
*/
/** Inspired by Snowflake Twitter */
package io.really.quickSand
import org.joda.time.DateTime
import org.slf4j.LoggerFactory
class QuickSand(workerId: Long, datacenterId: Long, reallyEpoch: Long) {
def logger = LoggerFactory.getLogger("Quicksand"... | reallylabs/really | modules/really-utils/src/main/scala/io/really/quickSand/QuickSand.scala | Scala | apache-2.0 | 2,574 |
/*
* 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 ... | shaneknapp/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/types/numerics.scala | Scala | apache-2.0 | 6,127 |
package com.psyanite.scorm.node
import scala.xml.NodeSeq
case class Metadata (
var schema: Option[String],
var schemaVersion: Option[String],
var scheme: Option[String]
)
object Metadata extends BaseNode {
def apply(name: NodeSeq, version: NodeSeq, scheme: NodeSeq): Metadata = {
... | psyanite/scorm-parser | src/main/scala/com/psyanite/scorm/node/Metadata.scala | Scala | apache-2.0 | 393 |
/**
* Copyright 2015 Vaishaal Shankar
*
* 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... | akmorrow13/endive | src/main/scala/net/akmorrow13/endive/pipelines/BlasTest.scala | Scala | apache-2.0 | 2,581 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | cran/rkafkajars | java/scala/xml/Group.scala | Scala | apache-2.0 | 1,582 |
/*
Copyright (c) 2009-2012, The Regents of the University of California
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this lis... | cdlib/weari | src/main/scala/org/cdlib/was/weari/ParsedArchiveRecordSolrizer.scala | Scala | bsd-3-clause | 3,748 |
import scala.concurrent.Await
import scala.concurrent.duration.DurationInt
import akka.actor.Actor
import akka.actor.Props
import akka.actor.actorRef2Scala
import org.apache.spark.SparkConf
import org.apache.spark.SparkEnv
import org.apache.spark.annotation.DeveloperApi
import org.apache.spark.streaming.Seconds
import ... | charlesxucheng/spark-streaming-scala | src/main/scala/StreamingApp2.scala | Scala | apache-2.0 | 4,338 |
package se.citerus.dddsample.application.impl
import org.apache.commons.logging.Log
import org.apache.commons.logging.LogFactory;
import se.citerus.dddsample.domain.model.cargo._;
import org.springframework.transaction.annotation.Transactional;
import se.citerus.dddsample.application.BookingService;
import ... | oluies/ddd-sample-scala | src/main/scala/se/citerus/dddsample/application/impl/BookingServiceImpl.scala | Scala | mit | 3,034 |
/***
* Copyright 2017 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... | wdschei/api-checker | core/src/test/scala/com/rackspace/com/papi/components/checker/ValidatorWADLAssertSuite.scala | Scala | apache-2.0 | 63,728 |
/*
* Copyright 2013 websudos ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | nosheenzaza/phantom-data-centric | phantom-dsl/src/test/scala/com/websudos/phantom/dsl/query/TypeRestrictionsTest.scala | Scala | gpl-2.0 | 1,118 |
/*
* 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 ... | jxw1102/Projet-merou | ModelChecker/src/cfg/Model.scala | Scala | apache-2.0 | 5,889 |
abstract class AbstractFile {
def name: String
val extension: String = name.substring(4)
}
class RemoteFile(url: String) extends AbstractFile {
val localFile: String = url.hashCode + ".tmp" // error
def name: String = localFile
}
| som-snytt/dotty | tests/init/neg/AbstractFile.scala | Scala | apache-2.0 | 236 |
package com.wangc.fast.p2
/**
* Created by wangchao on 2017/6/1.
* Chapter 2.5 Loops
*/
object Study2_5_Loops {
def main(args: Array[String]): Unit = {
var n = 1
var r = 0
while (n > 0){
println(n+"=="+r)
r = r + n
if (r>5){
n = -1
}
}
//[0,5] 前闭后闭
... | wang153723482/HelloWorld_my | HelloWorld_scala/src/com/wangc/fast/p2/Study2_5_Loops.scala | Scala | apache-2.0 | 913 |
package com.theseventhsense.datetime
import com.theseventhsense.utils.types.SSDateTime.TimeZone
/**
* Created by erik on 6/15/16.
*/
class RichTimeZone(timeZone: TimeZone) extends MomentRichTimeZone(timeZone)
object RichTimeZone extends MomentRichTimezoneOps
| 7thsense/utils-datetime | js/src/main/scala/com/theseventhsense/datetime/RichTimezone.scala | Scala | mit | 266 |
package scalaxy.extensions
package test
import org.junit._
import Assert._
class MacroExtensionsTest extends TestBase
{
override def transform(s: String, name: String = "test") = {
// First, compile with untyped reify:
transformCode(s, name, macroExtensions = true, runtimeExtensions = false, useUntypedReify... | nativelibs4java/Scalaxy | Obsolete/MacroExtensions/src/test/scala/scalaxy/extensions/MacroExtensionsTest.scala | Scala | bsd-3-clause | 11,049 |
/*
* (c) Copyright 2019 EntIT Software LLC, a Micro Focus company, L.P.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available at
* http://www.apache.org/licenses/LICE... | CloudSlang/cs-actions | cs-google/src/main/scala/io/cloudslang/content/google/actions/compute/compute_engine/disks/DetachDisk.scala | Scala | apache-2.0 | 9,623 |
package io.github.suitougreentea.VariousMinos
import scala.collection.mutable.ListBuffer
class FallingPiece {
private var _array: ListBuffer[Array[Block]] = ListBuffer.empty
var y = -1
var containsPersistentBlock = false
var containsIndependentBlock = false
def apply(x: Int, y:Int): Block = {
var ny = y... | suitougreentea/VariousMinos2 | src/main/scala/io/github/suitougreentea/VariousMinos/FallingPiece.scala | Scala | mit | 707 |
package skinny.controller.feature
import org.scalatra.test.scalatest.ScalatraFlatSpec
import skinny._
import skinny.controller.SkinnyController
class AfterActionSpec extends ScalatraFlatSpec {
behavior of "afterAction"
object After1 extends SkinnyController with Routes {
get("/1") { response.writer.write("0"... | skinny-framework/skinny-framework | framework/src/test/scala/skinny/controller/feature/AfterActionSpec.scala | Scala | mit | 852 |
package blended.jms.utils.internal
import java.text.SimpleDateFormat
class ConnectionMonitor(vendor: String, provider: String, clientId: String) extends ConnectionMonitorMBean {
private[this] val df = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss:SSS")
private[this] var state : ConnectionState = ConnectionState(provi... | lefou/blended | blended.jms.utils/src/main/scala/blended/jms/utils/internal/ConnectionMonitor.scala | Scala | apache-2.0 | 1,617 |
/**
* Licensed to Gravity.com under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Gravity.com licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use th... | lloydmeta/gander | src/main/scala/gander/extractors/AdditionalDataExtractor.scala | Scala | apache-2.0 | 1,152 |
package x7c1.linen.repository.loader.queueing
import java.net.URL
import x7c1.wheat.modern.queue.map.TrackableQueue.CanDump
trait UrlEnclosure {
def raw: URL
}
object UrlEnclosure {
implicit def canDump[A <: UrlEnclosure]: CanDump[A] = new CanDump[A] {
override def dump(x: A): String = x.raw.toString
}
... | x7c1/Linen | linen-repository/src/main/scala/x7c1/linen/repository/loader/queueing/UrlEnclosure.scala | Scala | mit | 322 |
package tifmo
import dcstree.WordBase
import mylib.res.en.EnStopWords
package main.en {
case class EnWord(lemma: String, mypos: String, ner: String, isSingleton: Boolean) extends WordBase {
override def toString = lemma.replaceAll("[^a-zA-Z0-9]", "_") + "_" + mypos
def isStopWord = (ner == "O" || ner == "NUMB... | tomtung/tifmo | src/main/scala/tifmo/main/en/EnWord.scala | Scala | bsd-2-clause | 437 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pgandhi999/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ReplaceTableExec.scala | Scala | apache-2.0 | 3,355 |
package com.softwaremill.example
import akka.actor.{Props, Actor, ActorSystem}
import spray.routing._
import akka.pattern.ask
import akka.util.Timeout
import scala.concurrent.duration._
object DockedServer extends App with SimpleRoutingApp {
// setup
implicit val actorSystem = ActorSystem()
implicit val timeout... | F-Xu/docker-spray-example | src/main/scala/com/softwaremill/example/DockedServer.scala | Scala | apache-2.0 | 2,083 |
package com.twitter.scalding
import org.specs._
import com.twitter.scalding._
/**
* Simple Example: First group data by gender and then sort by height reverse order.
* Then add another column for each group which is the rank order of the height.
*/
class AddRankingWithScanLeft(args: Args) extends Job(args) {
Ts... | lucamilanesio/scalding | scalding-core/src/test/scala/com/twitter/scalding/ScanLeftTest.scala | Scala | apache-2.0 | 4,723 |
/*
* Copyright 2009-2010 LinkedIn, 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 ... | linkedin/norbert | network/src/test/scala/com/linkedin/norbert/network/common/CachedNetworkStatisticsSpec.scala | Scala | apache-2.0 | 1,471 |
def f(arr:List[Int]):List[Int] = arr.view.zipWithIndex.filter(_._2 % 2 != 0).map(_._1).toList
| clemus90/competitive-programming | hackerRank/FunctionalProgramming/FilterPositionInAList.scala | Scala | mit | 95 |
object Test extends App {
val y = (0: Int) match {
case 1 => 1
case 0 | 0 => 0
case 2 | 2 | 2 | 3 | 2 | 3 => 0
case 4 | (_ @ 4) => 0
case _ => -1
}
assert(y == 0, y)
}
| AlexSikia/dotty | tests/untried/neg/t7290.scala | Scala | bsd-3-clause | 194 |
package almond
import java.util.UUID
import almond.channels.Channel
import almond.interpreter.{ExecuteResult, Message}
import almond.protocol.{Execute => ProtocolExecute, _}
import almond.kernel.{ClientStreams, Kernel, KernelThreads}
import almond.TestLogging.logCtx
import ammonite.util.Colors
import cats.effect.IO
i... | alexarchambault/jupyter-scala | modules/scala/scala-interpreter/src/test/scala/almond/TestUtil.scala | Scala | apache-2.0 | 3,929 |
//https://www.hackerrank.com/challenges/filter-elements
object FilterElements extends App {
import scala.collection.mutable.{Map => Map}
import scala.annotation.tailrec
@tailrec
def f(a: List[Int], k: Int, m: Map[Int, Int]): List[Int] = a match {
case Nil => m.filter(_._2 >= k).keys.toList
... | flopezlasanta/hackerrank | src/functional_programming/recursion/FilterElements.scala | Scala | mit | 793 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | mdzimmerman/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/util/EmptyScanner.scala | Scala | apache-2.0 | 2,053 |
package com.akkademy
case class ParseArticle(uri: String)
case class ParseHtmlArticle(url: String, htmlString: String)
case class HttpResponse(body: String)
case class ArticleBody(url: String, body: String)
| josiah14/AkkademyDb | akkademaid/src/main/scala/com/akkademy/Messages.scala | Scala | mit | 208 |
package depsearch.indexer.s3
import java.util.concurrent.Callable
import java.util.concurrent.Executors
import scala.collection.JavaConverters._
import com.amazonaws.services.s3.AmazonS3
import com.amazonaws.services.s3.AmazonS3Client
import com.amazonaws.services.s3.model.GetObjectRequest
import com.amazonaws.service... | ogrodnek/dependency-repository-indexer | src/main/scala/depsearch/indexer/s3/S3Indexer.scala | Scala | apache-2.0 | 2,397 |
package org.openurp.edu.eams.teach.planaudit.service.listeners
import org.beangle.commons.collection.Collections
import org.openurp.edu.base.Course
import org.openurp.edu.base.code.CourseType
import org.openurp.edu.teach.grade.CourseGrade
import org.openurp.edu.teach.planaudit.CourseAuditResult
import org.openurp.edu.... | openurp/edu-eams-webapp | core/src/main/scala/org/openurp/edu/eams/teach/planaudit/service/listeners/PlanAuditCommonElectiveListener.scala | Scala | gpl-3.0 | 3,509 |
package miniconf.server
import akka.actor.{ActorRef, ActorSystem}
/**
* Created by wenzhi.bwz on 14-7-18.
*/
object MainApp {
def main(args : Array[String]) : Unit = {
start()
}
def start() {
try {
val system = ActorSystem("miniconf-system")
val miniconfConf = system.settings.config.getC... | netcomm/miniconf | src/main/scala/miniconf/server/MainApp.scala | Scala | apache-2.0 | 631 |
package org.genericConfig.admin.shared.configTree
/**
* Copyright (C) 2016 Gennadi Heimann genaheimann@gmail.com
*
* Created by Gennadi Heimann 02.06.2020
*/
case class ConfigTreeItemDTO(
configProperties : Option[ConfigTreeItemConfigPropDTO],
userPropert... | gennadij/admin | shared/src/main/scala/org/genericConfig/admin/shared/configTree/ConfigTreeItemDTO.scala | Scala | apache-2.0 | 391 |
/*
* Copyright 2008-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | rozza/mongo-scala-driver | driver/src/main/scala/org/mongodb/scala/WriteConcern.scala | Scala | apache-2.0 | 3,901 |
/*
* Copyright 2001-2014 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... | dotty-staging/scalatest | scalactic-test/src/test/scala/org/scalactic/OptionSugarSpec.scala | Scala | apache-2.0 | 1,465 |
/*
* Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | digitized-io/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/adapters/AdapterRegistry.scala | Scala | apache-2.0 | 3,372 |
package com.twitter.zipkin.storage.cassandra
/*
* 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
*
... | dsias/zipkin | zipkin-server/src/test/scala/com/twitter/zipkin/storage/cassandra/CassandraIndexSpec.scala | Scala | apache-2.0 | 7,942 |
package pregnaware.frontend.services
import spray.client.pipelining._
import spray.http.Uri.{Authority, Host, Path}
import spray.http.{HttpMethod, HttpRequest, HttpResponse, Uri}
import spray.httpx.RequestBuilding.RequestBuilder
import pregnaware.utils.ConsulWrapper._
import pregnaware.utils.ExecutionActorWrapper
imp... | jds106/pregnaware | service/src/main/scala/pregnaware/frontend/services/BackEndFuncs.scala | Scala | mit | 1,469 |
/*
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
package org.maproulette.framework.service
import java.util.UUID
import java.util.concurrent.atomic.AtomicInteger
import org.maproulette.framework.model._
import org.maproulett... | mgcuthbert/maproulette2 | test/org/maproulette/framework/service/LeaderboardServiceSpec.scala | Scala | apache-2.0 | 8,398 |
/*
* 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 ... | CodingCat/spark-eventhubs | core/src/main/scala/org/apache/spark/eventhubscommon/progress/ProgressWriter.scala | Scala | apache-2.0 | 2,708 |
/*
* Copyright 2010 LinkedIn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | quipo/kafka | core/src/test/scala/unit/kafka/consumer/ZookeeperConsumerConnectorTest.scala | Scala | apache-2.0 | 6,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 ... | chenc10/Spark-PAF | examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala | Scala | apache-2.0 | 14,050 |
/**
* 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... | samaitra/kafka | core/src/test/scala/unit/kafka/producer/AsyncProducerTest.scala | Scala | apache-2.0 | 21,324 |
package editor.model
import util.MapTree
import scala.collection.mutable.ListBuffer
class Model {
val world = new MapTree[String, EditableGameObject]
val actions = new ListBuffer[String]
val properties = new ListBuffer[String]
var rootAdded = false
def addToWorld(obj: EditableGameObject) {
... | gregwk/clay-pot | Game_Editor/src/editor/model/Model.scala | Scala | mit | 632 |
package hello.world
object ExampleApp extends App {
val memory = Runtime.getRuntime.maxMemory() / (1024L * 1024L)
println(s"Memory $memory m")
println(s"Args: ${args mkString " | "}")
while (true) {
println(s"[${System.currentTimeMillis()}] Hello, world!")
Thread sleep 5000
}
} | fsat/sbt-native-packager | test-project-simple/src/main/scala/ExampleApp.scala | Scala | bsd-2-clause | 300 |
package com.twitter.finagle.thrift
import org.jboss.netty.channel.ChannelPipelineFactory
import com.twitter.finagle.{CodecFactory, ClientCodecConfig}
import org.apache.thrift.protocol.TProtocolFactory
/**
* ThriftClientBufferedCodec implements a buffered thrift transport
* that supports upgrading in order to provid... | JustinTulloss/finagle | finagle-thrift/src/main/scala/com/twitter/finagle/thrift/ThriftClientBufferedCodec.scala | Scala | apache-2.0 | 1,598 |
package com.lucidchart.open.xtract
import scala.util.control.NonFatal
import scala.xml.NodeSeq
object XmlReader extends DefaultXmlReaders with XmlReaderExtensions {
import cats.Applicative
/**
* Create a new [[XmlReader]] from a function that converts a NodeSeq to a [[ParseResult]].
* @param f A transforma... | lucidsoftware/xtract | xtract-core/src/main/scala/com/lucidchart/open/xtract/XmlReader.scala | Scala | apache-2.0 | 6,560 |
package goggles.macros.errors
case class ErrorAt[+Type](error: GogglesError[Type], offset: Int) | kenbot/goggles | macros/src/main/scala/goggles/macros/errors/ErrorAt.scala | Scala | mit | 97 |
/*
* Copyright 2017 Max Meldrum
*
* 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... | Max-Meldrum/SpaceTurtle | zookeeper/src/main/scala/ZkClient.scala | Scala | apache-2.0 | 6,493 |
package com.github.tminglei.slickpg
package utils
import slick.ast.FieldSymbol
import scala.reflect.ClassTag
import java.sql.{PreparedStatement, ResultSet}
import slick.jdbc.{JdbcTypesComponent, PostgresProfile}
trait PgCommonJdbcTypes extends JdbcTypesComponent { driver: PostgresProfile =>
class GenericJdbcType[T... | TimothyKlim/slick-pg | core/src/main/scala/com/github/tminglei/slickpg/utils/PgCommonJdbcTypes.scala | Scala | bsd-2-clause | 1,376 |
package fpinscala.testing
import fpinscala.laziness.Stream
import fpinscala.parallelism.Par.Par
import fpinscala.state._
import fpinscala.testing.Prop._
/*
The library developed in this chapter goes through several iterations. This file is just the
shell, which you can fill in and modify while working through the cha... | RawToast/fpinscala | exercises/src/main/scala/fpinscala/testing/Gen.scala | Scala | mit | 4,743 |
package ls
abstract class Props(resource: String) {
import scala.util.control.Exception.allCatch
trait Provider {
def get(k: String): String
}
object Env extends Provider {
def get(k: String) = System.getenv(k)
}
abstract class FallbackProvider(val fallback: Provider) extends Provider
case ... | Rhinofly/ls | library/src/main/scala/props.scala | Scala | mit | 1,369 |
package se.lu.nateko.cp.meta.services.labeling
import org.eclipse.rdf4j.model.IRI
import org.eclipse.rdf4j.model.ValueFactory
import se.lu.nateko.cp.meta.api.CustomVocab
import se.lu.nateko.cp.meta.core.crypto.Sha256Sum
class StationsVocab(val factory: ValueFactory) extends CustomVocab{
implicit val bup = makeUriP... | ICOS-Carbon-Portal/meta | src/main/scala/se/lu/nateko/cp/meta/services/labeling/Vocabs.scala | Scala | gpl-3.0 | 1,845 |
/*
# 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/react/Touch.scala | Scala | apache-2.0 | 1,283 |
/*
* Copyright (c) 2013 original 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 a... | eigengo/monitor | agent-akka/src/test/scala/org/eigengo/monitor/agent/akka/ActorTypeFilterSpec.scala | Scala | apache-2.0 | 1,620 |
import sbt._
import net.usersource.jettyembed.JettyEmbedWebProject
class vBaDProject(info: ProjectInfo) extends JettyEmbedWebProject(info) with IdeaProject {
val liftVersion = "2.2"
val commonsHttpVersion = "3.1"
val junitVersion = "4.5"
val specsVersion = "1.6.5"
val h2databaseVersion = "1.2.138"
overrid... | glenford/vBaD | project/build/vBaD.scala | Scala | apache-2.0 | 788 |
/*
* Even Fibonacci numbers
* Problem 2
* Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting 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 the Fibonacci sequence whose values do not exceed four millio... | NotBobTheBuilder/ProjectEuler | scala/p2.scala | Scala | mit | 555 |
/***********************************************************************
* 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-lambda/geomesa-lambda-datastore/src/test/scala/org/locationtech/geomesa/lambda/EmbeddedKafka.scala | Scala | apache-2.0 | 1,482 |
package org.cloudio.morpheus.tutor.chat.frag.step5
import java.util.Locale
import org.morpheus._
import Morpheus._
import org.cloudio.morpheus.tutor.chat.frag.step1.Contact
import org.cloudio.morpheus.tutor.chat.frag.step4.{MemoryOutputChannel, StandardOutputChannel, ContactPrettyPrinter, ContactRawPrinter}
/**
* I... | zslajchrt/morpheus-tutor | src/main/scala/org/cloudio/morpheus/tutor/chat/frag/step5/Session.scala | Scala | apache-2.0 | 2,584 |
package com.sksamuel.elastic4s.samples
import com.sksamuel.elastic4s.RefreshPolicy
import com.sksamuel.elastic4s.http.{ElasticClient, ElasticProperties}
import com.sksamuel.elastic4s.http.Response
import com.sksamuel.elastic4s.http.search.SearchResponse
object HttpClientExampleApp extends App {
// you must import ... | stringbean/elastic4s | samples/elastic4s-http-client-sbt/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala | Scala | apache-2.0 | 991 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Cayde Dixon
*
* 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, ... | cazzar/JukeboxReloaded | src/main/scala/net/cazzar/mods/jukeboxreloaded/blocks/BlockJukebox.scala | Scala | mit | 3,655 |
package org.atnos.eff.addon.monix
import cats._
import cats.implicits._
import monix.eval._
import monix.cats._
import monix.execution._
import org.atnos.eff._
import org.atnos.eff.syntax.all._
import scala.concurrent.duration.FiniteDuration
import scala.util._
trait TaskTypes {
type _task[R] = |=[Task, R]
type ... | etorreborre/eff | monix/shared/src/main/scala/org/atnos/eff/addon/monix/TaskEffect.scala | Scala | mit | 5,215 |
// Solution-2.scala
// Solution to Exercise 2 in "For Loops"
import com.atomicscala.AtomicTest._
val r2 = Range(0, 10).inclusive
r2 is (0 to 10)
r2 is (0 until 11)
/* OUTPUT_SHOULD_BE
Range(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
Range(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
*/
| P7h/ScalaPlayground | Atomic Scala/atomic-scala-solutions/17_ForLoops/Solution-2.scala | Scala | apache-2.0 | 269 |
/*
* Copyright 2017 PayPal
*
* 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 writin... | az-qbradley/squbs | squbs-httpclient/src/test/scala/org/squbs/httpclient/ClientFlowCircuitBreakerSpec.scala | Scala | apache-2.0 | 16,976 |
package org.jetbrains.plugins.scala.lang.transformation
package functions
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.extensions.{&&, ReferenceTarget}
import org.jetbrains.plugins.scala.lang.psi.api.expr._
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScFunction
import org.jetbra... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/transformation/functions/MakeEtaExpansionExplicit.scala | Scala | apache-2.0 | 1,227 |
package spatial.codegen.scalagen
import argon.core._
import spatial.aliases._
trait ScalaGenMemories extends ScalaGenBits {
var globalMems: Boolean = false
def emitMem(lhs: Exp[_], x: String) = if (globalMems) emit(s"if ($lhs == null) $x") else emit("val " + x)
def flattenAddress(dims: Seq[Exp[Index]], indice... | stanford-ppl/spatial-lang | spatial/core/src/spatial/codegen/scalagen/ScalaGenMemories.scala | Scala | mit | 1,971 |
/*
* 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/core/src/test/scala/org/apache/spark/sql/connector/V1WriteFallbackSuite.scala | Scala | apache-2.0 | 16,515 |
/* Code Pulse: a real-time code coverage tool, for more information, see <http://code-pulse.com/>
*
* Copyright (C) 2014-2017 Code Dx, Inc. <https://codedx.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 ... | secdec/codepulse | hq/src/main/scala/com/secdec/bytefrog/hq/trace/HasTraceSegmentBuilder.scala | Scala | apache-2.0 | 2,028 |
package code
package model
import lib.RogueMetaRecord
import org.bson.types.ObjectId
import org.joda.time.DateTime
import net.liftweb._
import common._
import http.{StringField => _, BooleanField => _, _}
import mongodb.record.field._
import record.field._
import util.FieldContainer
import net.liftmodules.mongoauth... | eltimn/lift-poly-example | src/main/scala/code/model/User.scala | Scala | apache-2.0 | 5,740 |
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.