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 io.questions.model.questionnaire.integrity
import cats.data.NonEmptySet
import io.questions.model.questionnaire.QuestionnaireNode
import io.questions.model.questionnaire.nodekey.NodeKey
import scala.collection.immutable.SortedSet
object UniqueKeyIntegrityCheck {
def apply(questionnaireNode: QuestionnaireNo... | channingwalton/qanda | questionnaire/src/main/scala/io/questions/model/questionnaire/integrity/UniqueKeyIntegrityCheck.scala | Scala | mit | 846 |
/*
* Copyright 2014–2018 SlamData 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 agr... | jedesah/Quasar | foundation/src/main/scala/quasar/contrib/scalaz/stream/package.scala | Scala | apache-2.0 | 1,031 |
package cn.edu.neu.chiewen.cknn.algorithms
import java.lang.Math.{pow, sqrt}
import cn.edu.neu.chiewen.cknn.settings.{IllustrateSettings, Settings}
import cn.edu.neu.chiewen.cknn.site.NeighboredSiteMemory
import cn.edu.neu.chiewen.cknn.trajectory.Trajectory
import cn.edu.neu.chiewen.cknn.vtree.VTree
import cn.edu.neu... | chiewen/CkNN | CkNN/src/main/scala/cn/edu/neu/chiewen/cknn/algorithms/Util.scala | Scala | gpl-2.0 | 1,696 |
package myscala.scalaexercises.tuples
/**
* Created by lingx on 2015/9/8.
*/
object Demo {
def main(args: Array[String]) {
//二元组有一个swap方法
val tuple = ("apple",2).swap
println(tuple._1)
println(tuple._2)
}
}
| luciuschina/ScalaAndSparkStudy | src/main/scala/myscala/scalaexercises/tuples/Demo.scala | Scala | mit | 246 |
package tf
import java.io._
import scala.math._
import scala.util.Sorting._
import scala.collection.mutable.ArrayBuilder
import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkContext, HashPartitioner, storage}
import org.apache.spark.SparkContext._
import org.apache.spark.serializer.KryoRegistrator
import org.... | XianXing/bdl | src/main/scala/bdl/tf/PTF.scala | Scala | apache-2.0 | 31,208 |
package preprocessing
import com.sun.jna.Pointer
import org.apache.spark.rdd.RDD
import libs._
// dbType should be either "lmdb" or "leveldb"
class CreateDB(caffeLib: CaffeLibrary, dbType: String) {
val state = caffeLib.create_state()
def makeDBFromPartition(dataIt: Iterator[(ByteImage, Int)], dbName: String, ... | rahulbhalerao001/SparkNet | src/main/scala/preprocessing/CreateDB.scala | Scala | mit | 1,785 |
package idv.brianhsu.maidroid.plurk.view
import idv.brianhsu.maidroid.plurk._
import idv.brianhsu.maidroid.plurk.TypedResource._
import idv.brianhsu.maidroid.plurk.cache.ImageCache
import idv.brianhsu.maidroid.plurk.util.DebugLog
import idv.brianhsu.maidroid.ui.util.AsyncUI._
import org.bone.soplurk.model.Icon
impor... | brianhsu/MaidroidPlurk | src/main/scala/view/IconView.scala | Scala | gpl-3.0 | 2,223 |
package lara.epfl.scalasca.tests.unit.executables.intraproceduralcontrolflowgraph;
class WhileTest {
var i = 0
def m(): Unit = {
while (i < 42) {
if (i % 2 == 0)
println("even")
println("still not 42")
i += 1
}
}
} | jean-andre-gauthier/scalasca | src/test/scala/lara/epfl/scalasca/tests/unit/executables/intraproceduralcontrolflowgraph/WhileTest.scala | Scala | bsd-3-clause | 235 |
/*
* Copyright 2014 Commonwealth Computer Research, 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 applicabl... | jnh5y/geomesa | geomesa-convert/geomesa-convert-avro/src/main/scala/org/locationtech/geomesa/convert/avro/AvroPath.scala | Scala | apache-2.0 | 2,943 |
package vuescale
import scala.scalajs.js
import org.scalajs.dom
package object facade {
type WatchHandler[V, T] = js.ThisFunction2[V, T, T, Unit]
type DirectiveFunction = js.Function4[dom.html.Element, VNodeDirective, VNode, VNode, Unit]
type PluginFunction[T] = js.Function2[VueStatic, js.UndefOr[T], Unit]
... | lettenj61/vuescale | vuescale-core/src/main/scala/vuescale/facade/package.scala | Scala | mit | 453 |
package org.hqjpa
import org.hibernate.Session
import org.hibernate.SessionFactory
import org.hibernate.Transaction
import org.hibernate.resource.transaction.spi.TransactionStatus
import org.slf4j.LoggerFactory
import java.io.Serializable
import javax.persistence.EntityTransaction
/**
* Companion object for related ... | vejobrolis/hqjpa | hqjpa/src/org/hqjpa/DBBase.scala | Scala | lgpl-3.0 | 18,533 |
package edu.berkeley.cs.succinct.sql
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.sources._
import org.apache.spark.sql.types.StructType
import org.apache.spark.sql.{DataFrame, Row, SQLContext}
case class SuccinctInMemoryRelation(dataFrame: DataFrame)(@transient val sqlContext: SQLContext)
extends Ba... | amplab/succinct | spark/src/main/scala/edu/berkeley/cs/succinct/sql/SuccinctInMemoryRelation.scala | Scala | apache-2.0 | 714 |
/*
* Copyright 2013 http4s.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | http4s/http4s | examples/blaze/src/main/scala/com/example/http4s/blaze/demo/server/endpoints/FileHttpEndpoint.scala | Scala | apache-2.0 | 1,134 |
/*
* 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 ... | spark0001/spark2.1.1 | core/src/main/scala/org/apache/spark/TestUtils.scala | Scala | apache-2.0 | 10,353 |
package com.overviewdocs.util
import scala.concurrent.{Await,Future,blocking}
import scala.concurrent.duration.Duration
trait AwaitMethod {
protected def await[T](future: Future[T]): T = blocking(Await.result(future, Duration.Inf))
}
| overview/overview-server | common/src/main/scala/com/overviewdocs/util/AwaitMethod.scala | Scala | agpl-3.0 | 238 |
/*
* 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 ... | wangmiao1981/spark | core/src/main/scala/org/apache/spark/storage/PushBasedFetchHelper.scala | Scala | apache-2.0 | 15,050 |
package com.equalinformation.scala.programs.list
/**
* Created by bpupadhyaya on 6/20/16.
*/
object ListOperations {
def main(args: Array[String]): Unit = {
// Creating list
val aList = List(1,2,3)
val bList = List("today","is","sunny")
val cList = List(1,"today",2,"delta",3.0)
val emptyList ... | bpupadhyaya/scala-programs-collection | scala-programs-collection/src/main/scala/com/equalinformation/scala/programs/list/ListOperations.scala | Scala | apache-2.0 | 612 |
/*
* Copyright (C) 2016 Nikos Katzouris
*
* 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 d... | nkatzz/OLED | src/main/scala/oled/functions/DistributedOLEDFunctions.scala | Scala | gpl-3.0 | 6,433 |
// code-examples/TypeSystem/abstracttypes/abs-type-examples-script.scala
trait exampleTrait {
type t1 // Unconstrained
type t2 >: t3 <: t1 // t2 must be a supertype of t3 and a subtype of t1
type t3 <: t1 // t3 must be a subtype of t1
type t4 // Unconstrained
type t5 = L... | XClouded/t4f-core | scala/src/tmp/TypeSystem/abstracttypes/abs-type-examples-script.scala | Scala | apache-2.0 | 972 |
import Asserts.*
object Test {
def main(args: Array[String]): Unit = {
macroAssert(true === "cde")
macroAssert("acb" === "cde") // error
}
}
| dotty-staging/dotty | tests/neg-macros/tasty-macro-assert-1/quoted_2.scala | Scala | apache-2.0 | 156 |
package org.jetbrains.plugins.scala.lang.psi
package stubs
package index
import com.intellij.psi.stubs.StubIndexKey
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScTypeAlias
/**
* User: Alexander Podkhalyuzin
* Date: 18.10.2008
*/
class ScTypeAliasNameIndex extends ScStringStubIndexExtension[ScType... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/stubs/index/ScTypeAliasNameIndex.scala | Scala | apache-2.0 | 980 |
package com.github.caiiiycuk.pg2sqlite.values
class ValueParseException(message: String) extends Exception(message)
| caiiiycuk/postgresql-to-sqlite | src/main/scala/com/github/caiiiycuk/pg2sqlite/values/ValueParseException.scala | Scala | mit | 117 |
package supertaggedtests.tagged
import org.scalatest.matchers.should.Matchers
import org.scalatest.flatspec.AnyFlatSpec
class ScalacBug extends AnyFlatSpec with Matchers {
"Very specific bug `polymorphic expression`" should "absent" in {
/**
* Be very attentive
*/
{
//Scalac Bug is he... | Rudogma/scala-supertagged | tests/src/test/scala/supertaggedtests/tagged/ScalacBug.scala | Scala | mit | 2,482 |
/*
* Copyright 2013 Maurício Linhares
*
* Maurício Linhares 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/LICENSE-2.0
*
* Unless ... | outbrain/postgresql-async | mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/message/server/ErrorMessage.scala | Scala | apache-2.0 | 829 |
/**
* Copyright (C) 2011 Orbeon, Inc.
*
* This program 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
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | joansmith/orbeon-forms | src/main/scala/org/orbeon/scaxon/XML.scala | Scala | lgpl-2.1 | 28,490 |
/*
* 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 ... | tophua/spark1.52 | examples/src/main/scala/org/apache/spark/examples/SparkLR.scala | Scala | apache-2.0 | 3,283 |
package info.cmlubinski.newslearning.learn
import scala.collection.mutable
import nak.data.{Featurizer, FeatureObservation}
import info.cmlubinski.newslearning.models.Article
trait TrigramBase extends BigramBase {
def triplets(text:String):List[(String, String, String)] = {
val words = (for (sentence <- toSe... | cmc333333/news-learning | src/main/scala/learn/Trigram.scala | Scala | mit | 2,343 |
/**
* Copyright (C) 2011 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config.impl
import org.junit.Assert._
import org.junit.Test
import com.typesafe.config.ConfigException
import language.implicitConversions
class TokenizerTest extends TestUtils {
// FIXME most of this file should be using th... | chris-martin/hocon-python | test/scala/com/typesafe/config/impl/TokenizerTest.scala | Scala | apache-2.0 | 11,533 |
package opennlp.scalabha.util
/**
* This Numeric class represents values using logarithms. The underlying
* logarithmic representation is completely hidden from the calling code.
*
* This class exists to allow for the use of obvious operators (* for
* multiplication instead of + on logarithms) and to prevent co... | dhgarrette/type-supervised-tagging-2012emnlp | src/main/scala/opennlp/scalabha/util/LogNum.scala | Scala | apache-2.0 | 3,103 |
package example
class NamedArguments/*<-example::NamedArguments#*/ {
case class User/*<-example::NamedArguments#User#*/(name/*<-example::NamedArguments#User#name.*/: String/*->scala::Predef.String#*/)
User/*->example::NamedArguments#User.*/(name/*->example::NamedArguments#User.apply().(name)*/ = "John")
User/*->... | lampepfl/dotty | tests/semanticdb/expect/NamedArguments.expect.scala | Scala | apache-2.0 | 467 |
package co.blocke.scalajack
package json.primitives
import java.util.UUID
import java.lang.{
Boolean => JBoolean,
Byte => JByte,
Character => JChar,
Double => JDouble,
Float => JFloat,
Integer => JInt,
Long => JLong,
Number => JNumber,
Short => JShort
}
import java.math.{ BigDecimal => JBigDecimal, B... | gzoller/ScalaJack | core/src/test/scala/co.blocke.scalajack/json/primitives/Model.scala | Scala | mit | 5,284 |
// scala/bug#8197, see also scala/bug#4592 and scala/bug#4728
class A
class B
class Foo(val x: A = null) {
def this(bla: B*) {
this(new A)
}
}
object Test extends App {
// both constructors of `Foo` are applicable. Overloading resolution
// will eliminate the alternative that uses a default argument, ther... | martijnhoekstra/scala | test/files/run/t8197.scala | Scala | apache-2.0 | 397 |
package com.sksamuel.elastic4s.streams
import akka.actor._
import com.sksamuel.elastic4s.ElasticDsl._
import com.sksamuel.elastic4s.TcpClient
import com.sksamuel.elastic4s.bulk.{BulkCompatibleDefinition, BulkDefinition, RichBulkItemResponse, RichBulkResponse}
import org.elasticsearch.action.support.WriteRequest.Refres... | aroundus-inc/elastic4s | elastic4s-streams/src/main/scala/com/sksamuel/elastic4s/streams/BulkIndexingSubscriber.scala | Scala | apache-2.0 | 13,681 |
/*
* ScalaRay - Ray tracer based on pbrt (see http://pbrt.org) written in Scala
* Copyright (C) 2009, 2010, 2011 Jesper de Jong
*
* 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 ve... | jesperdj/scalaray | src/main/scala/org/jesperdj/scalaray/lightsource/SpotLightSource.scala | Scala | gpl-3.0 | 2,770 |
package typeproviders.rdfs.examples
import org.w3.banana._
import org.w3.banana.sesame.Sesame
import org.w3.banana.diesel._
import scala.language.experimental.macros
class VampiricTypeProviderExample[Rdf <: RDF](implicit ops: RDFOps[Rdf]) {
import ops._
import typeproviders.rdfs.anonymous._
val dct = VampiricP... | travisbrown/type-provider-examples | rdfs/src/main/scala/vampiric-examples.scala | Scala | apache-2.0 | 690 |
/*
* Copyright (c) 2015, streamdrill UG (haftungsbeschränkt)
* 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, th... | streamdrill/streamdrill-json | src/main/scala/streamdrill/json/JSONParser.scala | Scala | bsd-2-clause | 2,807 |
package part2
import akka.actor.{Actor, ActorLogging, ActorRef, ActorSystem, Props}
import akka.persistence.PersistentActor
object PersistAsync extends App {
case class Event(contents: String)
case class Command(contents: String)
object PersistAsyncActor {
def props(eventAggregator: ActorRef) = Props(new ... | guhemama/moocs | RockAkkaPersistence/src/main/scala/part2/PersistAsync.scala | Scala | bsd-3-clause | 1,362 |
package org.testobjects
import java.time.Instant
trait ATestInstant {
def nonNull: Instant = Instant.EPOCH
def unique: Instant = Instant.now()
}
| test-objects/test-objects-for-scala | src/main/scala/org/testobjects/ATestInstant.scala | Scala | apache-2.0 | 154 |
package ir.ast
import ir.{ArrayType, Capacity, Size}
abstract class ArrayConstructors(val at: ArrayType with Size with Capacity) extends Expr {
this.t = at // set type
}
| lift-project/lift | src/main/ir/ast/ArrayConstructors.scala | Scala | mit | 174 |
// TxBits - An open source Bitcoin and crypto currency exchange
// Copyright (C) 2014-2015 Viktor Stanchev & Kirk Zathey
//
// 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 vers... | CryptArc/txbits | txbits/app/controllers/IAPI/APIv1.scala | Scala | agpl-3.0 | 15,648 |
/*
* 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 ... | rednaxelafx/apache-spark | core/src/test/scala/org/apache/spark/ExecutorAllocationManagerSuite.scala | Scala | apache-2.0 | 92,933 |
/*
* 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 | test/views/returns/ZeroRatedSuppliesViewSpec.scala | Scala | apache-2.0 | 2,699 |
package com.sksamuel.elastic4s.requests.analyzers
@deprecated("use new analysis package", "7.0.1")
class Analyzer(val name: String)
@deprecated("use new analysis package", "7.0.1")
case object WhitespaceAnalyzer extends Analyzer("whitespace")
@deprecated("use new analysis package", "7.0.1")
case object StandardAnaly... | sksamuel/elastic4s | elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/analyzers/Analyzer.scala | Scala | apache-2.0 | 5,326 |
/**
* Copyright 2013-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
*... | mojo22jojo/securesocial-test | module-code/app/securesocial/core/authenticator/HttpHeaderAuthenticator.scala | Scala | apache-2.0 | 5,088 |
import sbt._
import Keys._
import com.typesafe.sbteclipse.plugin.EclipsePlugin.EclipseKeys
import com.typesafe.sbteclipse.plugin.EclipsePlugin.EclipseCreateSrc
object ScalaLeafsBuild extends Build {
def defaultSettings =
Project.defaultSettings ++
Seq(
sbtPlugin := false,
organization :=... | scalastuff/scalaleafs | project/Build.scala | Scala | apache-2.0 | 4,100 |
/*
* 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 ... | ptkool/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveComparisonTest.scala | Scala | apache-2.0 | 19,154 |
/*
* Copyright 2001-2013 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... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/OneOfContainMatcherDeciderSpec.scala | Scala | apache-2.0 | 22,114 |
/*
* Copyright (c) 2016. Fengguo (Hugo) Wei and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Detailed co... | arguslab/argus-cit-intellij | src/main/scala/org/argus/cit/intellij/jawa/lang/psi/types/api/JawaTypePresentation.scala | Scala | epl-1.0 | 722 |
/*
* 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 ... | nchammas/spark | sql/core/src/test/scala/org/apache/spark/sql/DataFrameSetOperationsSuite.scala | Scala | apache-2.0 | 52,377 |
/*
* 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 ... | michalsenkyr/spark | core/src/main/scala/org/apache/spark/storage/memory/MemoryStore.scala | Scala | apache-2.0 | 35,582 |
/*
* 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 ... | highfei2011/spark | core/src/test/scala/org/apache/spark/storage/PartiallySerializedBlockSuite.scala | Scala | apache-2.0 | 9,299 |
/**
* Created by asghaier on 20.01.17.
*/
package chat.utilities
case class ConnectionFailed(text: String) | tech4242/scala-backchannel-app | app/models/chat/utilities/ConnectionFailed.scala | Scala | bsd-3-clause | 111 |
package com.arcusys.valamis.web.service
import com.arcusys.learn.liferay.LiferayClasses.LUser
import com.arcusys.learn.liferay.services.{CompanyHelper, MessageBusHelper, ServiceContextHelper, UserLocalServiceHelper}
import com.arcusys.valamis.lesson.service.UserLessonResultService
import com.arcusys.valamis.log.LogSup... | arcusys/Valamis | valamis-portlets/src/main/scala/com/arcusys/valamis/web/service/StatementCheckerImpl.scala | Scala | gpl-3.0 | 2,895 |
package scaladget
import rx.Ctx
import scalatags.JsDom.all.s
package object tools extends utils.Utils with Stylesheet with JsRxTags{
override val ctx: Ctx.Owner = Ctx.Owner.safe()
}
| mathieuleclaire/scaladget | tools/src/main/scala/scaladget/tools/package.scala | Scala | agpl-3.0 | 187 |
package mesosphere.mesos
import mesosphere.marathon.Protos.Constraint
import mesosphere.marathon.Protos.Constraint.Operator
import mesosphere.marathon.core.instance.Instance
import mesosphere.marathon.state.RunSpec
import mesosphere.marathon.stream.Implicits._
import mesosphere.marathon.tasks.OfferUtil
import org.apac... | gsantovena/marathon | src/main/scala/mesosphere/mesos/Constraints.scala | Scala | apache-2.0 | 11,816 |
package highchair.tests
import org.specs._
class RelationSpec extends highchair.specs.DataStoreSpec {
"Users" should {
val friendless = User.put(User(None, "Grinch", None, Nil))
val new_friend = User.put(User(None, "Bryan", None, Nil))
val has_friends = User.put(User(None, "Chris", None, new_friend... | chrislewis/highchair | datastore/src/test/scala/RelationSpec.scala | Scala | mit | 1,085 |
/*
* Copyright (C) 2016 University of Basel, Graphics and Vision Research Group
*
* 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) an... | unibas-gravis/scalismo-ui | src/main/scala/scalismo/ui/rendering/internal/CoordinateAdapter.scala | Scala | gpl-3.0 | 4,630 |
package rere.sasl.scram.cache.impl
import java.util.concurrent.ConcurrentHashMap
import rere.sasl.scram.cache.SaltedPasswordCache
import rere.sasl.util.BinaryString
class ConcurrentSaltedPasswordCache extends SaltedPasswordCache {
case class Entry(password: String, salt: String, iterations: Int)
private val sta... | pbaun/rere | modules/sasl/src/main/scala/rere/sasl/scram/cache/impl/ConcurrentSaltedPasswordCache.scala | Scala | apache-2.0 | 695 |
package com.twitter.scrooge.backend
import com.twitter.finagle.SourcedException
import com.twitter.scrooge.testutil.{EvalHelper, JMockSpec}
import com.twitter.scrooge.{ThriftStruct, ThriftException}
import java.io.{ObjectInputStream, ByteArrayInputStream, ObjectOutputStream, ByteArrayOutputStream}
import java.nio.Byte... | elipoz/scrooge | scrooge-generator/src/test/scala/com/twitter/scrooge/backend/ScalaGeneratorSpec.scala | Scala | apache-2.0 | 36,175 |
package ly.stealth.shaihulud.reader
import java.io.{FileOutputStream, PrintStream}
import java.net.InetAddress
import java.security.MessageDigest
import scala.collection.JavaConversions._
import com.datastax.driver.core.{Row, SocketOptions, Cluster}
class Validator(config: ReaderConfiguration, hosts: Set[InetAddress... | stealthly/gauntlet | spark-validator/src/main/scala/ly/stealth/shaihulud/reader/Validator.scala | Scala | apache-2.0 | 3,323 |
/*
* 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 ... | ahnqirage/spark | examples/src/main/scala/org/apache/spark/examples/SparkRemoteFileTest.scala | Scala | apache-2.0 | 1,661 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/TestTableNameHasDbName.scala | Scala | apache-2.0 | 1,674 |
package com.twitter.rowz
import net.lag.configgy.Configgy
import com.twitter.querulous.query.SqlQueryFactory
import com.twitter.querulous.database.{ApachePoolingDatabaseFactory, MemoizingDatabaseFactory}
import com.twitter.querulous.evaluator.StandardQueryEvaluatorFactory
import com.twitter.xrayspecs.TimeConversions._... | nkallen/Rowz | src/test/scala/com/twitter/rowz/Database.scala | Scala | apache-2.0 | 1,448 |
package com.zinnia.ml.spark.ex1_linear_regression
import org.apache.spark.SparkContext
import com.zinnia.ml.spark.util.RegressionUtil
/**
* Created with IntelliJ IDEA.
* User: Shashank L
* Date: 22/1/14
* Time: 12:26 PM
* To change this template use File | Settings | File Templates.
*/
object Ex1 {
def main(a... | zinniasystems/spark-ml-class | src/main/java/com/zinnia/ml/spark/ex1_linear_regression/Examples.scala | Scala | apache-2.0 | 3,000 |
/*
* 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 ... | aray/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/python/FlatMapGroupsInPandasExec.scala | Scala | apache-2.0 | 4,318 |
/*
* Copyright 2012-2013 Eligotech BV.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | CoderPaulK/eventsourced | es-journal/es-journal-dynamodb/src/main/scala/org/eligosource/eventsourced/journal/dynamodb/DynamoDBJournalProps.scala | Scala | apache-2.0 | 4,081 |
object Obj {
private var cache: Any = ()
def returning(f: () => Unit) = ()
def foo {
returning(() => cache = ())
}
def apply(): Any = {
cache
}
}
object Test extends App {
Obj()
}
| felixmulder/scala | test/files/run/t7341.scala | Scala | bsd-3-clause | 204 |
/*
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
package org.maproulette.framework.psql
/**
* @author mcuthbert
*/
trait CommonField {
val FIELD_ID = "id"
val FIELD_NAME = "name"
val FIELD_DESCRIPTIO... | mgcuthbert/maproulette2 | app/org/maproulette/framework/psql/CommonField.scala | Scala | apache-2.0 | 412 |
/*
* bytefrog: a tracing framework for the JVM. For more information
* see http://code-pulse.com/bytefrog
*
* Copyright (C) 2014 Applied Visions - http://securedecisions.avi.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
... | secdec/bytefrog-clients | file-api/src/main/scala/com/secdec/bytefrog/fileapi/data/CallGraph.scala | Scala | apache-2.0 | 853 |
package edu.mit.cci.db
import java.sql._
import scala.collection.mutable
import java.util.concurrent.Semaphore
/**
* User: pdeboer
* Date: 8/2/13
* Time: 6:18 PM
*/
object Connector {
private val connections = new mutable.Queue[Connection]()
private val counter = new Semaphore(100)
def getConnection: Connect... | pdeboer/wikilanguage | src/main/scala/edu/mit/cci/wikilanguage/db/Connector.scala | Scala | mit | 2,345 |
package feh.tec.visual.api
import feh.tec.agent.{Environment, AgentPerformanceMeasure}
trait CriterionValueRenderer[Env <: Environment[Env], M <: AgentPerformanceMeasure[Env, M], E <: Easel]
extends Renderer[M#CriterionValue, E]
{
def render(t: M#CriterionValue)(implicit easel: E): Unit
} | fehu/agent-tareas | agent/src/main/scala/feh/tec/visual/api/CriterionValueRenderer.scala | Scala | mit | 295 |
/*
* Copyright (c) 2018 OVO Energy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish,... | ovotech/comms-kafka-messages | modules/core/src/main/scala/com/ovoenergy/comms/KafkaMessage.scala | Scala | mit | 1,235 |
package cortex.io
import java.io.{DataOutputStream, InputStreamReader, BufferedReader}
import java.net.Socket
import cortex.controller.ContentType
import cortex.controller.ContentType._
import cortex.controller._
import cortex.util.log
import scala.collection.mutable
import scala.concurrent.ExecutionContext
/**
*... | jsflax/cortex | src/main/scala/cortex/io/HttpProtocolManager.scala | Scala | mit | 6,343 |
package repository
import domain.Side.Buy
import domain.models.Ordering
import domain.strategy.StrategyState
import org.scalatest.FunSuite
import repository.model.scalatrader.User
import scalikejdbc.ConnectionPool
class StrategyRepositoryTest extends FunSuite {
ignore("testSelect") {
ConnectionPool.singleton("... | rysh/scalatrader | scalatrader/test/repository/StrategyRepositoryTest.scala | Scala | mit | 1,162 |
package org.jetbrains.plugins.scala.spellchecker
import com.intellij.spellchecker.SpellCheckerManager
import com.intellij.testFramework.LightPlatformTestCase
// We use LightPlatformTestCase, becasue it already knows how to create test project, create all services.
// Project is required to create spellchecker instanc... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/spellchecker/FilterValidWorksWithSpellChecker.scala | Scala | apache-2.0 | 806 |
/*
* 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 ... | highfei2011/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneFileSourcePartitionsSuite.scala | Scala | apache-2.0 | 4,809 |
/* sbt -- Simple Build Tool
* Copyright 2011 Mark Harrah
*/
package sbt
/** An abstraction on top of Settings for build configuration and task definition. */
import java.io.File
import java.net.URI
import ConcurrentRestrictions.Tag
import Def.{ Initialize, KeyedInitialize, ScopedKey, Setting, setting }
import Path... | xeno-by/old-scalameta-sbt | main/settings/src/main/scala/sbt/Structure.scala | Scala | bsd-3-clause | 39,095 |
package com.gilesc
import cats.Monad
import cats.data.Kleisli
package object arrow {
implicit def convertAndThen[M[_]: Monad, A, B](
service: Service[M, A, B]
): Kleisli[M, A, B] = service.apply()
implicit def convertFilterAndThen[M[_]: Monad, A, B, C, D](
filter: Filter[M, A, B, C, D]
): Kleisli[M, ... | CraigGiles/mynab | arrow/src/main/scala/com/gilesc/arrow/package.scala | Scala | mit | 365 |
package db.migration.postgres
import db.migration.{V1_032__StandaloneToRequestResponseDefinition => V1_031__FragmentSpecificDataDefinition}
import slick.jdbc.{JdbcProfile, PostgresProfile}
class V1_032__StandaloneToRequestResponse extends V1_031__FragmentSpecificDataDefinition {
override protected lazy val profile:... | TouK/nussknacker | ui/server/src/main/scala/db/migration/postgres/V1_032__StandaloneToRequestResponse.scala | Scala | apache-2.0 | 352 |
object Bug {
abstract class FChain {
type T
def chain(constant:String) =
new FConstant[this.type](constant, this) //removing [this.type], everything compiles
}
case class FConstant[E <: FChain](constant:String, tail:E) extends FChain {
type T = tail.T
}
object FNil extends FChain {
ty... | yusuke2255/dotty | tests/pos/t2435.scala | Scala | bsd-3-clause | 538 |
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt
package internal
package langserver
object MessageType {
/** An error message. */
val Error = 1L
/** A warning message. */
val Warning = 2L
/** An i... | sbt/sbt | protocol/src/main/scala/sbt/internal/langserver/MessageType.scala | Scala | apache-2.0 | 600 |
object Test extends App {
def f[A](x : => A) = x
Console.println(f(Array(42))(0))
}
| yusuke2255/dotty | tests/untried/pos/t759.scala | Scala | bsd-3-clause | 90 |
package examples.bouncing
import java.awt.{Dimension, Graphics2D, Point}
import rescala.default._
import scala.swing.{MainFrame, Panel, SimpleSwingApplication, Swing}
object EventVersion extends SimpleSwingApplication {
lazy val application = new EventVersion
def top = application.frame
override... | guidosalva/REScala | Code/Examples/examples/src/main/scala/examples/bouncing/EventVersion.scala | Scala | apache-2.0 | 1,479 |
package org.jetbrains.plugins.scala.testingSupport.utest
/**
* @author Roman.Shein
* @since 04.09.2015.
*/
trait UTestStaticStringTest extends UTestTestCase {
protected val staticStringTestName = "UTestStaticStringTest"
protected val staticStringTestFileName = staticStringTestName + ".scala"
addSourceFi... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/utest/UTestStaticStringTest.scala | Scala | apache-2.0 | 2,153 |
package com.github.radium226
import scala.reflect.runtime.universe._
package object util {
def typeTagToString(tt: TypeTag[_]): String = {
typeToString(tt.tpe)
}
def typeToString(t: Type): String = {
val l = t.typeArgs.map(typeToString(_))
t.typeSymbol.asClass.name.toString + (if (l.isEmpty) "" e... | radium226/mowitnow | src/main/scala/com/github/radium226/util/package.scala | Scala | mit | 363 |
/*
* 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 ... | manuzhang/incubator-gearpump | external/twitter/src/main/scala/org/apache/gearpump/streaming/twitter/TwitterSource.scala | Scala | apache-2.0 | 4,080 |
package im.actor.server.api.rpc.service
import im.actor.api.rpc._
import im.actor.api.rpc.integrtions.ResponseIntegrationToken
import im.actor.api.rpc.peers.{ ApiUserOutPeer, ApiOutPeer, ApiPeerType }
import im.actor.server.acl.ACLUtils
import im.actor.server.api.http.HttpApiConfig
import im.actor.server.api.rpc.servi... | yangchenghu/actor-platform | actor-server/actor-tests/src/test/scala/im/actor/server/api/rpc/service/IntegrationsServiceSpec.scala | Scala | mit | 6,634 |
package shared
/**
* This defines which methods the client can call at the server.
* <p>
* Created by Matthias Braun on 9/4/2016.
*/
trait ExampleApi {
def list(path: String): Seq[FileData]
}
| mb720/scalajsClientServer | app/shared/src/main/scala/shared/ExampleApi.scala | Scala | bsd-2-clause | 217 |
package services.graphstages
import drt.shared.api.Arrival
import drt.shared.{MilliTimes, PortCode, UniqueArrival}
import org.slf4j.{Logger, LoggerFactory}
import services.arrivals.LiveArrivalsUtil
object ApproximateScheduleMatch {
val log: Logger = LoggerFactory.getLogger(getClass)
def findInScheduledWindow(un... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/main/scala/services/graphstages/ApproximateScheduleMatch.scala | Scala | apache-2.0 | 3,022 |
//
// Taranos Cloud Sonification Framework: Service Core
// Copyright (C) 2018 David Hinson, Netrogen Blue LLC (dhinson@netrogenblue.com)
//
// 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 F... | taranos/taranoscsf-core | src/main/scala/org/taranos/mc/field/Oscillator.scala | Scala | agpl-3.0 | 6,776 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundatio... | HuangLS/neo4j | community/cypher/frontend-2.3/src/main/scala/org/neo4j/cypher/internal/frontend/v2_3/symbols/StringType.scala | Scala | apache-2.0 | 1,023 |
/**
* 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... | ramonmaruko/camel | components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala | Scala | apache-2.0 | 4,542 |
package net.surguy.runnertrack.scraper
import net.surguy.runnertrack.model._
import org.openqa.selenium.{By, WebDriver}
import scala.collection.JavaConversions._
import net.surguy.runnertrack.TimeUtils._
class LondonMarathonScraper(year: String) extends RaceScraper with WebDriverTools {
val distanceParser = new Gen... | inigo/runnertrack | app/net/surguy/runnertrack/scraper/LondonMarathonScraper.scala | Scala | agpl-3.0 | 2,816 |
package models.musitobject
import no.uio.musit.models.MuseumCollections.{Archeology, Collection}
import play.api.libs.json.{JsObject, Json, Writes}
sealed trait MusitObjectCoordinate {
val collection: Collection
}
object MusitObjectCoordinate {
implicit val writes: Writes[MusitObjectCoordinate] = Writes {
... | MUSIT-Norway/musit | service_backend/app/models/musitobject/MusitObjectCoordinate.scala | Scala | gpl-2.0 | 747 |
/**
* 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... | mpoindexter/kafka | core/src/main/scala/kafka/server/ThrottledResponse.scala | Scala | apache-2.0 | 1,663 |
/*
* 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 ... | ahnqirage/spark | sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala | Scala | apache-2.0 | 13,629 |
import sbt.Keys._
import sbt._
import org.scalastyle.sbt.ScalastylePlugin
object TestSettings {
private[this] lazy val checkScalastyle = taskKey[Unit]("checkScalastyle")
// Custom IntegrationTest config that shares code with Test
val IntegrationTest = config("it") extend Test
def testSettings: Seq[Def.Sett... | codeaudit/modelmatrix | project/TestSettings.scala | Scala | apache-2.0 | 1,790 |
package services.user
import com.mohiva.play.silhouette.api.LoginInfo
import com.mohiva.play.silhouette.impl.daos.DelegableAuthInfoDAO
import com.mohiva.play.silhouette.impl.providers.OpenIDInfo
import models.database.queries.auth.OpenIdInfoQueries
import play.api.libs.concurrent.Execution.Implicits.defaultContext
imp... | agilemobiledev/boilerplay | app/services/user/OpenIdInfoService.scala | Scala | apache-2.0 | 1,553 |
/*
* 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 n... | ollie314/kafka | core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala | Scala | apache-2.0 | 9,468 |
package pl.panasoft.mysqlroutines
import org.scalatest.FreeSpec
import java.io.File
class MysqlRoutinesSpec extends FreeSpec {
"A MySqlRoutines" - {
val mysqlhome = new File("./mysql_home_mock")
"will not work if inproper mysqlhome is provided" in intercept[MysqlRoutinesException] {
MysqldRoutines.... | PawelPanasewicz/mysqld-routines | src/test/scala/pl/panasoft/mysqlroutines/MySqlRoutinesSpec.scala | Scala | mit | 752 |
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.