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 |
|---|---|---|---|---|---|
/*******************************************************************************
Copyright (c) 2012-2013, S-Core, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
*********************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/analysis/cfg/CFGBuilder.scala | Scala | bsd-3-clause | 33,416 |
package gitbucket.core.controller
import gitbucket.core.helper.xml
import gitbucket.core.model.Account
import gitbucket.core.service._
import gitbucket.core.util.Implicits._
import gitbucket.core.util.SyntaxSugars._
import gitbucket.core.util.{Keys, LDAPUtil, ReferrerAuthenticator, UsersAuthenticator}
import io.github... | shiena/gitbucket | src/main/scala/gitbucket/core/controller/IndexController.scala | Scala | apache-2.0 | 6,038 |
/*
* Copyright 2015 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... | benaveryee/play-ui | src/test/scala/uk/gov/hmrc/play/views/helpers/DateFieldsSpec.scala | Scala | apache-2.0 | 2,198 |
package org.vitrivr.adampro.data.index.structures.va.marks
import breeze.linalg.{max, min}
import org.vitrivr.adampro.data.datatypes.vector.Vector
import org.vitrivr.adampro.data.datatypes.vector.Vector._
import org.vitrivr.adampro.data.index.IndexingTaskTuple
import org.vitrivr.adampro.data.index.structures.va.VAInde... | dbisUnibas/ADAMpro | src/main/scala/org/vitrivr/adampro/data/index/structures/va/marks/EquifrequentMarksGenerator.scala | Scala | mit | 3,862 |
/*
* Copyright 2015 Heiko Seeberger
*
* 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... | el-dom/akka-http-json | akka-http-jackson/src/test/scala/de/heikoseeberger/akkahttpjackson/JacksonSupportSpec.scala | Scala | apache-2.0 | 3,434 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | caneGuy/spark | core/src/test/scala/org/apache/spark/storage/ShuffleBlockFetcherIteratorSuite.scala | Scala | apache-2.0 | 29,769 |
package com.sksamuel.elastic4s.searches.queries
import com.sksamuel.elastic4s.searches.QueryDefinition
import org.elasticsearch.common.geo.{GeoDistance, GeoPoint}
import org.elasticsearch.index.query.{GeoDistanceRangeQueryBuilder, GeoValidationMethod, QueryBuilders}
case class GeoDistanceRangeQueryDefinition(field: S... | ulric260/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/queries/GeoDistanceRangeQueryDefinition.scala | Scala | apache-2.0 | 3,010 |
/*
* Copyright 2020 ACINQ SAS
*
* 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... | ACINQ/eclair | eclair-core/src/main/scala/fr/acinq/eclair/wire/Monitoring.scala | Scala | apache-2.0 | 859 |
/**
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.routing
import scala.annotation.tailrec
import scala.collection.immutable
import scala.concurrent.forkjoin.ThreadLocalRandom
import com.typesafe.config.Config
import akka.actor.ActorCell
import akka.actor.ActorRefWithCell
import ak... | jmnarloch/akka.js | akka-js-actor/jvm/src/main/scala/akka/routing/SmallestMailbox.scala | Scala | bsd-3-clause | 9,302 |
package parsers
import org.specs2.mutable._
class Exercise5Spec extends Specification {
val ex5 = new exercises.Exercise5 {}
import ex5._
val parser = new LessParser
"Less parser" should {
"parse a selector" >> {
parser.parse(parser.selector, "div > span.foo").get must equalTo (Selector("div > sp... | julienrf/scala-lessons | highlights/parsers/code/src/test/scala/parsers/Exercise5Spec.scala | Scala | mit | 1,318 |
package iwct.graphx.networkflow
/**
* Created by yuhc on 3/25/15.
*/
object MaxFlow {
}
| sjtu-iiot/graphx-algorithm | src/main/scala/org/apache/spark/graphx/iiot/networkflow/MaxFlow.scala | Scala | gpl-2.0 | 92 |
package org.nisshiee.crowd4s
import scalaz._, Scalaz._
import org.json4s._
import org.json4s.jackson.JsonMethods._
import scala.util.control.Exception.allCatch
trait GetGroupList {
import GetGroupList._
def getDirectGroupList(username: String)(implicit conn: CrowdConnection, http: CrowdHttp) =
http.get(dire... | nisshiee/crowd4s | src/main/scala/functions/GetGroupList.scala | Scala | mit | 1,440 |
package org.phenoscape.kb.ingest.xenbase
import scala.collection.JavaConversions._
import scala.collection.Map
import scala.collection.mutable
import scala.io.Source
import org.apache.commons.lang3.StringUtils
import org.phenoscape.kb.ingest.util.Vocab
import org.phenoscape.kb.ingest.util.Vocab._
import org.phenoscap... | calliem/phenoscape-kb-ingest | src/main/scala/org/phenoscape/kb/ingest/xenbase/XenbaseExpressionToOWL.scala | Scala | mit | 3,338 |
package moe.brianhsu.easytaipei
import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.clustering.ClusterItem
case class MarkerItem(title: String, lat: Double, lng: Double, snippet: Option[String] = None) extends ClusterItem {
val position = new LatLng(lat, lng)
override def getPosition = ... | brianhsu/EasyTaipei | src/main/scala/dataset/MarkerItem.scala | Scala | gpl-2.0 | 332 |
import com.twitter.finagle.{Http, Service}
import com.twitter.finagle.http.{Request, Response}
import com.twitter.util.Await
//#app
object Proxy extends App {
val client: Service[Request, Response] =
Http.newService("www.google.com:80")
val server = Http.serve(":8080", client)
Await.ready(server)
}
//#app
| lukiano/finagle | doc/src/sphinx/code/quickstart/Proxy.scala | Scala | apache-2.0 | 319 |
/**
*
* Copyright (C) 2017 University of Bamberg, Software Technologies Research Group
* <https://www.uni-bamberg.de/>, <http://www.swt-bamberg.de/>
*
* This file is part of the Data Structure Investigator (DSI) project, which received financial support by the
* German Research Foundation (DFG) under grant no. L... | uniba-swt/DSIsrc | src/dsnaming/DsOliOffsGroups.scala | Scala | gpl-3.0 | 2,585 |
/*
* Copyright 2013-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | amuramatsu/Laika | core/src/main/scala/laika/factory/ParserFactory.scala | Scala | apache-2.0 | 1,951 |
import scala.annotation.tailrec
object P7 {
implicit def listToList[A](list: List[List[A]]) = new BetterList(list)
class BetterList[A](list: List[List[A]]) {
def flat: List[A] = if (list.isEmpty) Nil else {
@tailrec
def flatten0(l: List[List[A]], acc: List[A]): List[A] = l match {
case ... | matiwinnetou/scala99 | src/main/scala/P7.scala | Scala | apache-2.0 | 641 |
package edu.gemini.spModel.core
import scalaz._
import Scalaz._
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
import org.scalacheck.Prop._
import org.scalacheck.Gen
import org.specs2.ScalaCheck
import org.specs2.mutable.Specification
import AlmostEqual.AlmostEqualOps
object InterpolateSpec extend... | spakzad/ocs | bundle/edu.gemini.spModel.core/src/test/scala/edu/gemini/spModel/core/InterpolateSpec.scala | Scala | bsd-3-clause | 3,235 |
/*
* This file is part of the "silex" library of helpers for Apache Spark.
*
* Copyright (c) 2015 Red Hat, 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.... | jyt109/silex | src/test/scala/com/redhat/et/silex/rdd/drop/drop.scala | Scala | apache-2.0 | 3,507 |
package reactivemongo.api
import scala.util.{ Try, Failure, Success }
import scala.concurrent.{ Await, ExecutionContext }
import scala.concurrent.duration.{ Duration, FiniteDuration, SECONDS }
import com.typesafe.config.Config
import akka.actor.ActorRef
import reactivemongo.core.nodeset.Authenticate
import reactivemo... | cchantep/ReactiveMongo | driver/src/main/scala/api/MongoDriver.scala | Scala | apache-2.0 | 7,487 |
package mesosphere.marathon.core.launcher
import org.rogach.scallop.ScallopConf
trait OfferProcessorConfig extends ScallopConf {
//scalastyle:off magic.number
lazy val offerMatchingTimeout = opt[Int]("offer_matching_timeout",
descr = "Offer matching timeout (ms). Stop trying to match additional tasks for thi... | sepiroth887/marathon | src/main/scala/mesosphere/marathon/core/launcher/OfferProcessorConfig.scala | Scala | apache-2.0 | 375 |
import org.scalatest.{FlatSpec, Matchers}
class MemoSpec extends FlatSpec with Matchers {
import Lib._
lazy val fib: (Int) => Int = Memo(n => if (n <= 1) n else fib(n - 1) + fib(n - 2), identity[Int], Cache.simple)
lazy val fac: (Int) => Int = Memo(n => if (n <= 2) n else n * fac(n - 1), identity[Int], Cache.LR... | sstergou/Memo | src/test/scala/MemoSpec.scala | Scala | gpl-3.0 | 714 |
class A { def m() { if (true) { var x = 1 } else x = 2 } }
object Main { def main(args: Array[String]) { } }
| tobast/compil-petitscala | tests/typing/bad/testfile-context_ifelse-1.scala | Scala | gpl-3.0 | 109 |
/***********************************************************************
* Copyright (c) 2013-2022 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | locationtech/geomesa | geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/geotools/MetadataBackedDataStore.scala | Scala | apache-2.0 | 17,854 |
package ch3
import org.learningconcurrency._
import ch3._
/**
* 预测多个线程对集合状态产生影响,使用两个线程向ArrayBuffer集合中添加数字
*/
object CollectionsBad extends App {
import scala.collection._
/**
* 标准集合的实现代码中没有使用任何同步机制,可变集合的基础数据结构可能会非常复杂.
*/
val buffer = mutable.ArrayBuffer[Int]()
def add(numbers: Seq[Int]) = execute {
buff... | tophua/spark1.52 | examples/src/main/scala/scalaDemo/threadConcurrency/ch3/Collections.scala | Scala | apache-2.0 | 7,925 |
package breeze.classify;
/*
Copyright 2009 David Hall, Daniel Ramage
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applic... | tjhunter/scalanlp-core | learn/src/main/scala/breeze/classify/Classifier.scala | Scala | apache-2.0 | 1,736 |
package java.io
class IOException(s: String, e: Throwable) extends Exception(s, e) {
def this(e: Throwable) = this(null, e)
def this(s: String) = this(s, null)
def this() = this(null, null)
}
class EOFException(s: String) extends IOException(s) {
def this() = this(null)
}
class UTFDataFormatException(s: Stri... | jmnarloch/scala-js | javalib/src/main/scala/java/io/Throwables.scala | Scala | bsd-3-clause | 477 |
package org.jetbrains.plugins.scala
package caches
import java.util.concurrent.atomic.AtomicReference
import java.util.concurrent.{ConcurrentHashMap, ConcurrentMap}
import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.ProjectRootManager
import com.intellij.openapi.util._
import com.intellij.... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/caches/CachesUtil.scala | Scala | apache-2.0 | 8,793 |
package com.github.j5ik2o.spetstore.domain.basic
/**
* 連絡先を表す値オブジェクト。
*
* @param email メールアドレス
* @param phone 電話番号
*/
case class Contact(email: String, phone: String)
| j5ik2o/spetstore-cqrs-es-akka | domain/src/main/scala/com/github/j5ik2o/spetstore/domain/basic/Contact.scala | Scala | mit | 223 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monifu/monifu | monix-tail/shared/src/main/scala/monix/tail/internal/IterantInterleave.scala | Scala | apache-2.0 | 6,177 |
package com.alexitc.coinalerts.controllers
import com.alexitc.coinalerts.commons.{CustomPlayAPISpec, DataHelper, RandomDataGenerator}
import com.alexitc.coinalerts.models._
import play.api.Application
import play.api.i18n.Lang
import play.api.libs.json.JsValue
import play.api.test.Helpers._
class UsersControllerSpec ... | AlexITC/crypto-coin-alerts | alerts-server/test/com/alexitc/coinalerts/controllers/UsersControllerSpec.scala | Scala | gpl-3.0 | 7,148 |
package org.lexicon.utils
import org.scalatest.FunSuite
import org.junit.Assert._
import FileHelper._
class TextAnalyzerTest extends FunSuite {
import TextAnalyzerObj._
test("Common test") {
val hello = "Hello"
val world = "World"
val res = splitText(s"$hello, $world! How do you do?")
assertEqua... | rumoku/lexicon | word-count/src/test/scala/org/lexicon/utils/TextAnalyzerTest.scala | Scala | apache-2.0 | 1,140 |
package org.jetbrains.plugins.scala.lang.macros.expansion
import java.io._
import java.util.regex.Pattern
import com.intellij.internal.statistic.UsageTrigger
import com.intellij.notification.{NotificationGroup, NotificationType}
import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent}
import com.intellij.op... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/macros/expansion/MacroExpandAction.scala | Scala | apache-2.0 | 14,194 |
package com.getjenny.starchat.resources
/**
* Created by Angelo Leto <angelo@getjenny.com> on 14/11/16.
*/
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.server.Route
import akka.pattern.CircuitBreaker
import com.getjenny.starchat.entities.io.{IndexManagementResponse, Permissions, ReturnMessa... | GetJenny/starchat | src/main/scala/com/getjenny/starchat/resources/SystemIndexManagementResource.scala | Scala | gpl-2.0 | 6,734 |
package org.odfi.indesign.module.git
import org.odfi.indesign.core.module.IndesignModule
import org.odfi.indesign.core.harvest.Harvest
import org.odfi.indesign.core.harvest.fs.FileSystemHarvester
object GitModule extends IndesignModule {
this.onInit {
//Harvest.registerAutoHarvesterClass(classOf[FileSystemHarv... | opendesignflow/indesign | indesign-git/src/main/scala/org/odfi/indesign/module/git/GitModule.scala | Scala | gpl-3.0 | 505 |
package io.github.andrebeat.pool
class SimplePoolSpec extends PoolSpec[SimplePool] {
def pool[A <: AnyRef](
capacity: Int,
factory: () => A,
referenceType: ReferenceType = ReferenceType.Strong,
reset: A => Unit = { _: A => () },
dispose: A => Unit = { _: A => () },
healthCheck: A => Boolean =... | andrebeat/scala-pool | src/test/scala/io/github/andrebeat/pool/SimplePoolSpec.scala | Scala | mit | 421 |
package com.github.mdr.mash.assist
import com.github.mdr.mash.compiler.{ CompilationSettings, CompilationUnit, Compiler }
import com.github.mdr.mash.inference.Type
import com.github.mdr.mash.lexer.{ MashLexer, Token }
import com.github.mdr.mash.parser.AbstractSyntax._
import com.github.mdr.mash.parser.ConcreteSyntax
i... | mdr/mash | src/main/scala/com/github/mdr/mash/assist/InvocationAssistance.scala | Scala | mit | 4,926 |
package com.guidewire.tools.marathon.client
import org.scalatest.junit.JUnitRunner
import org.scalatest.{BeforeAndAfterAll, SeveredStackTraces, FunSuite}
import org.junit.runner.RunWith
import org.scalatest.matchers.ShouldMatchers
import dispatch._, Defaults._
import play.api.libs.json._
import play.api.libs.functio... | Guidewire/marathon-client | src/test/scala/com/guidewire/tools/marathon/client/BasicFunctionalitySuite.scala | Scala | apache-2.0 | 8,798 |
/*
* Copyright 2017-2020 Aleksey Fomkin
*
* 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... | fomkin/korolev | modules/korolev/src/main/scala/korolev/util/JsCode.scala | Scala | apache-2.0 | 2,281 |
package domain.astimport
/**
* GraPHPizer source code analytics engine
* Copyright (C) 2015 Martin Helmich <kontakt@martin-helmich.de>
*
* 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, e... | martin-helmich/graphpizer-server | app/domain/astimport/DocCommentParser.scala | Scala | gpl-3.0 | 2,809 |
package com.twitter.scalding.quotation
class QuotedMacroTest extends Test {
val test = new TestClass
val nullary = test.nullary
val parametrizedNullary = test.parametrizedNullary[Int]
val withParam = test.withParam[Person, String](_.name)._1
val quotedFunction =
Quoted.function[Person, Contact](_.cont... | twitter/scalding | scalding-quotation/src/test/scala/com/twitter/scalding/quotation/QuotedMacroTest.scala | Scala | apache-2.0 | 2,099 |
/* vim: set ts=2 et sw=2 sts=2 fileencoding=utf-8: */
package exceler.excel
import scala.collection.JavaConverters._
import scala.language.implicitConversions
import scala.util.control.Exception._
import org.apache.poi.ss.usermodel._
import org.apache.poi.xssf.usermodel._
import org.apache.poi.hssf.usermodel._
import... | wak109/exceler | jvm/src/main/scala/ExcelShape.scala | Scala | mit | 4,245 |
/*
Copyright 2014 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | piyushnarang/scalding | scalding-core/src/test/scala/com/twitter/scalding/ExecutionTest.scala | Scala | apache-2.0 | 20,881 |
package com.twitter.finagle.httpx
import com.twitter.collection.RecordSchema
import com.twitter.finagle.httpx.netty.{HttpRequestProxy, Bijections}
import com.twitter.io.{Charsets, Reader}
import java.net.{InetAddress, InetSocketAddress}
import java.util.{AbstractMap, List => JList, Map => JMap, Set => JSet}
import org... | travisbrown/finagle | finagle-httpx/src/main/scala/com/twitter/finagle/httpx/Request.scala | Scala | apache-2.0 | 9,929 |
package org.jetbrains .plugins.scala
package refactoring.rename3
/**
* Nikolay.Tropin
* 9/13/13
*/
class ScalaRenameTest extends ScalaRenameTestBase {
def testObjectAndTraitToOpChars() = doTest("+++")
def testObjectAndTrait() = doTest()
def testObjectAndClass() = doTest()
def testObjectAndClassToOpChars... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/refactoring/rename3/ScalaRenameTest.scala | Scala | apache-2.0 | 1,267 |
package com.arcusys.valamis.web.servlet.public.policy
import com.arcusys.learn.liferay.util.PortletName
import com.arcusys.valamis.web.portlet.base.{ModifyPermission, ViewPermission}
import com.arcusys.valamis.web.servlet.base.{PermissionSupport, PermissionUtil}
import com.arcusys.valamis.web.servlet.public.LessonServ... | arcusys/Valamis | valamis-portlets/src/main/scala/com/arcusys/valamis/web/servlet/public/policy/LessonPolicy.scala | Scala | gpl-3.0 | 740 |
/*-------------------------------------------------------------------------*\
** ScalaCheck **
** Copyright (c) 2007-2011 Rickard Nilsson. All rights reserved. **
** http://www.scalacheck.org **
** ... | tonymorris/scalacheck | src/main/scala/org/scalacheck/Arbitrary.scala | Scala | bsd-3-clause | 13,762 |
/*
* 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 | core/src/main/scala/org/apache/spark/storage/RDDInfo.scala | Scala | apache-2.0 | 2,291 |
package io.getquill.quotation
import io.getquill._
import io.getquill.dsl.DynamicQueryDsl
class CompatibleDynamicQuerySpec extends Spec {
object testContext extends MirrorContext(MirrorIdiom, Literal) with TestEntities with DynamicQueryDsl
import testContext._
"implicit classes" - {
"query" in {
val... | getquill/quill | quill-core/src/test/scala/io/getquill/quotation/CompatibleDynamicQuerySpec.scala | Scala | apache-2.0 | 16,540 |
package controllers
import org.asyncmongo.bson._
import play.api.libs.json._
import play.api.libs.json.Constraints._
import play.api.mvc._
import play.modules.mongodb._
import play.api.Play.current
import org.asyncmongo.protocol.messages._
import play.modules.mongodb.PlayBsonImplicits._
import org.asyncmongo.handlers.... | mandubian/play2-mongodb-async | samples/play2-mongodb-async-app/app/controllers/User.scala | Scala | apache-2.0 | 2,255 |
package slick.jdbc
import scala.language.{existentials, implicitConversions, higherKinds}
import scala.collection.mutable.HashMap
import slick.SlickException
import slick.ast._
import slick.ast.Util.nodeToNodeOps
import slick.ast.TypeUtil._
import slick.compiler.{RewriteBooleans, CodeGen, Phase, CompilerState, QueryCo... | AtkinsChang/slick | slick/src/main/scala/slick/jdbc/JdbcStatementBuilderComponent.scala | Scala | bsd-2-clause | 33,891 |
/*
* 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... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/ShouldBeAnTypeSpec.scala | Scala | apache-2.0 | 36,191 |
package dotty.tools
package dotc
package typer
import core._
import ast._
import Contexts._, Types._, Flags._, Denotations._, Names._, StdNames._, NameOps._, Symbols._
import Trees._
import Constants._
import Scopes._
import ProtoTypes._
import annotation.unchecked
import util.Positions._
import util.{Stats, SimpleMap... | AlexSikia/dotty | src/dotty/tools/dotc/typer/Inferencing.scala | Scala | bsd-3-clause | 9,351 |
package se.lu.nateko.cp.meta.onto
import org.semanticweb.owlapi.model.OWLDataFactory
import org.semanticweb.owlapi.apibinding.OWLManager
import org.semanticweb.owlapi.util.DefaultPrefixManager
import org.semanticweb.owlapi.model.PrefixManager
import org.semanticweb.owlapi.model.OWLAnnotationProperty
import org.semanti... | ICOS-Carbon-Portal/meta | src/main/scala/se/lu/nateko/cp/meta/onto/Vocab.scala | Scala | gpl-3.0 | 1,174 |
/**
* Licensed to the Minutemen Group under one or more contributor license
* agreements. See the COPYRIGHT file distributed with this work for
* additional information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in complian... | mohiva/silhouette | modules/http/src/test/scala/silhouette/http/transport/CookieTransportSpec.scala | Scala | apache-2.0 | 4,207 |
/*
* Copyright (C) 2014 GRNET S.A.
*
* 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 distrib... | grnet/snf-vmcatcher | src/main/scala/gr/grnet/egi/vmcatcher/Main.scala | Scala | gpl-3.0 | 19,869 |
/*
* Copyright (C) 2007-2008 Artima, Inc. All rights reserved.
*
* 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 requir... | peachyy/scalastu | scells/src/scells/FormulaParsers.scala | Scala | apache-2.0 | 1,884 |
package pl.touk.nussknacker.ui.validation
import cats.data.NonEmptyList
import cats.data.Validated.{Invalid, Valid}
import pl.touk.nussknacker.engine.ModelData
import pl.touk.nussknacker.engine.api.component.AdditionalPropertyConfig
import pl.touk.nussknacker.engine.api.context.ProcessCompilationError
import pl.touk.n... | TouK/nussknacker | ui/server/src/main/scala/pl/touk/nussknacker/ui/validation/ProcessValidation.scala | Scala | apache-2.0 | 9,010 |
/*
* 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/attachments/PostalCoverSheetViewSpec.scala | Scala | apache-2.0 | 7,610 |
package discreteevent
class Inverter {
def inverter(input: Wire, output: Wire) {
def invertAction() {
val inputSig = input.getSignal
afterDelay(InverterDelay) {
output setSignal !inputSig
}
}
input addAction invertAction
}
} | relyah/CourseraFunctionalProgramming | workspace/MutableState/src/discreteevent/Inverter.scala | Scala | gpl-2.0 | 271 |
/**
* Copyright 2011-2016 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | GabrielPlassard/gatling | gatling-http/src/main/scala/io/gatling/http/util/package.scala | Scala | apache-2.0 | 7,297 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Framework **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | doron123/scala-js | jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineEvent.scala | Scala | bsd-3-clause | 908 |
package com.typedynamic.eventrisk
import Config._
import collection.immutable._
import org.jsoup.Jsoup
import io.Source._
import collection.JavaConversions._
object YieldCurve {
def yieldPage(): Map[Int, Double] = {
val bondyieldsUrl = conf.getString("bondyieldsUrl")
return Map(Jsoup.connect(bondyieldsUrl)... | commonlisp/eventrisk | src/main/scala/yieldcurve.scala | Scala | apache-2.0 | 511 |
/**
* Copyright: Copyright (C) 2016, Jaguar Land Rover
* License: MPL-2.0
*/
package org.genivi.sota.resolver.test
import akka.http.scaladsl.model.StatusCodes
import eu.timepit.refined.api.Refined
import io.circe.generic.auto._
import org.genivi.sota.data.{Namespaces, PackageId}
import org.genivi.sota.marshalling.C... | PDXostc/rvi_sota_server | external-resolver/src/test/scala/org/genivi/sota/resolver/test/PackageFilterResourceSpec.scala | Scala | mpl-2.0 | 5,325 |
package org.imdex.tractor.util
import scala.concurrent.duration.FiniteDuration
import scala.language.implicitConversions
/**
* Created by a.tsukanov on 21.07.2016.
*/
final case class Timeout(duration: FiniteDuration) extends AnyVal
object Timeout {
implicit def toDuration(timeout: Timeout): FiniteDuration =... | Im-dex/trActor | tractor-actor/src/main/scala/org/imdex/tractor/util/Timeout.scala | Scala | mit | 340 |
package mesosphere.marathon
package integration
import java.util.UUID
import akka.util.ByteString
import mesosphere.marathon.integration.facades.MarathonFacade._
import mesosphere.marathon.integration.facades.{ITDeployment, ITEnrichedTask, ITQueueItem}
import mesosphere.marathon.integration.setup._
import mesosphere.... | gsantovena/marathon | tests/integration/src/test/scala/mesosphere/marathon/integration/AppDeployIntegrationTest.scala | Scala | apache-2.0 | 37,431 |
def if2[A](cond: Boolean,onTrue: =>A,onFalse: =>A): A={
if (cond) onTrue else onFalse
}
def maybeTwice(b: Boolean, i: => Int)= if (b) i+i else 0
def maybeTwice3(b: Boolean, i: Int)= if (b) i+i else 0
def maybeTwice2(b: Boolean, i: => Int)={
lazy val j=i;
if (b) j+j else 0
} | Tomcruseal/FunctionalLearn | fpinscala/src/main/scala/fpinScala/lazyBoy/lazzyIf.scala | Scala | mit | 289 |
package feh.tec.cvis
import java.text.DecimalFormat
import java.util.UUID
import javax.swing.SwingConstants
import javax.swing.table.{DefaultTableCellRenderer, DefaultTableModel}
import breeze.stats
import breeze.stats.DescriptiveStats
import feh.dsl.swing2.{Monitor, Var}
import feh.tec.cvis.common.AreaDescriptor.{Ha... | fehu/comp-vis | harris-app/src/main/scala/feh/tec/cvis/DescriptorsSupport.scala | Scala | mit | 7,504 |
package com.googlecode.kanbanik.commands
import com.googlecode.kanbanik.builders.TaskBuilder
import com.googlecode.kanbanik.model.{User, Task, Board}
import com.googlecode.kanbanik.dtos.{ErrorDto, GetTasksDto, TasksDto}
class GetTasksCommand extends Command[GetTasksDto, TasksDto] {
lazy val taskBuilder = new TaskB... | gudtago/kanbanik | kanbanik-server/src/main/scala/com/googlecode/kanbanik/commands/GetTasksCommand.scala | Scala | apache-2.0 | 638 |
/*
* Copyright 2013 David Savage
*
* 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... | davemssavage/modula | api/src/main/scala/org/chronologicalthought/modula/Part.scala | Scala | apache-2.0 | 3,686 |
package com.lucidchart.aspell
import org.apache.commons.io.IOUtils
import java.io._
import resource._
private[aspell] object NativeLibraryLoader {
def load(name: String) = {
val tempDirectory = new File(System.getProperty("java.io.tmpdir"))
val fileName = new File(getClass.getResource(name).getPath).getNam... | pauldraper/lucid-aspell | src/main/scala/com/lucidchart/aspell/NativeLibraryLoader.scala | Scala | apache-2.0 | 627 |
package breeze.linalg
/*
Copyright 2012 David Hall
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... | wavelets/breeze | src/test/scala/breeze/linalg/DenseMatrixTest.scala | Scala | apache-2.0 | 18,378 |
class C() { var x : AnyVal = {} }
object Main { def main(args: Array[String]) { } }
| tobast/compil-petitscala | tests/typing/good/testfile-block-3.scala | Scala | gpl-3.0 | 85 |
package ca.uqam.euler.nicolas
/**
* If p is the perimeter of a right angle triangle with integral length
* sides, {a,b,c}, there are exactly three solutions for p = 120.
*
* {20,48,52}, {24,45,51}, {30,40,50}
*
* For which value of p ≤ 1000, is the number of solutions maximised?
*
*/
object Problem039 {
impo... | nicolaspayette/project-euler | src/main/scala/ca/uqam/euler/nicolas/Problem039.scala | Scala | mit | 590 |
import collection.mutable.Buffer
import collection.mutable.{ArrayBuffer => Buffer}
println(/* resolved: false */ ArrayBuffer.getClass)
println(classOf[/* resolved: false */ ArrayBuffer])
println(/* path: scala.collection.mutable.Buffer, type: org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScObject */ Buffe... | ilinum/intellij-scala | testdata/resolve2/import/alias/clash/RenameValue2.scala | Scala | apache-2.0 | 400 |
/*
* 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 ... | steveloughran/spark-timeline-integration | yarn-timeline-history/src/test/scala/org/apache/spark/deploy/history/yarn/integration/JerseyBindingSuite.scala | Scala | apache-2.0 | 4,604 |
package mm4s.api
import akka.NotUsed
import akka.actor.ActorSystem
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import akka.http.scaladsl.marshalling._
import akka.http.scaladsl.model.headers.`Set-Cookie`
import akka.http.scaladsl.model.{HttpMethods, HttpRequest, HttpResponse, MessageEntity}
import... | jw3/mm4s | api/src/main/scala/mm4s/api/Users.scala | Scala | apache-2.0 | 2,825 |
package com.nekopiano.scala.sandbox
import akka.actor.{Actor, ActorRef, ActorSystem, Props}
/**
* Created on 3/30/16.
*/
object AkkaTest extends App {
val system = ActorSystem("system")
val actor = system.actorOf(Props[HelloActor])
actor ! "Hello"
actor ! "Hi"
import akka.pattern.ask
import akka... | lamusique/ExcelPasswordFinder | src/test/scala/com/nekopiano/scala/sandbox/AkkaTest.scala | Scala | apache-2.0 | 1,890 |
package com.markglh.blog
import java.io.File
import com.typesafe.config.ConfigFactory
import org.http4s.server.ServerApp
import org.http4s.server.blaze.BlazeBuilder
import scala.concurrent.ExecutionContext
object Bootstrap extends ServerApp {
implicit val executionContext = ExecutionContext.global
// This look... | markglh/composing-microservices-with-sbt-docker | aggregator-service/src/main/scala/com/markglh/blog/Bootstrap.scala | Scala | apache-2.0 | 935 |
package org.psesd.srx.shared.core.sif
import java.net.URI
import org.psesd.srx.shared.core.exceptions.{ArgumentInvalidException, ArgumentNullOrEmptyOrWhitespaceException}
import org.psesd.srx.shared.core.extensions.TypeExtensions._
/** Represents a SIF-specific URI.
*
* @version 1.0
* @since 1.0
* @author Da... | PSESD/srx-shared-core | src/main/scala/org/psesd/srx/shared/core/sif/SifUri.scala | Scala | mit | 3,663 |
/* sbt -- Simple Build Tool
* Copyright 2010 Mark Harrah
*/
package sbt
package inc
import java.io.File
import java.util.zip.ZipFile
import Function.const
object Locate
{
type DefinesClass = File => String => Boolean
/** Right(src) provides the value for the found class
* Left(true) means that the class was fo... | ornicar/xsbt | compile/inc/Locate.scala | Scala | bsd-3-clause | 2,755 |
package com.wellfactored.restless.play.json
import com.wellfactored.restless.query.QueryAST.Path
import org.scalatest.{FlatSpec, Matchers, WordSpecLike}
import play.api.libs.json.{JsObject, JsString, Json}
class Selection$Spec extends WordSpecLike with Matchers {
import Selection._
case class Foo(id: Long, s: O... | WellFactored/restless | play-json/src/test/scala/com/wellfactored/restless/play/json/Selection$Spec.scala | Scala | mit | 2,068 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package synthesis
package rules
import leon.utils.SeqUtils._
import solvers._
import purescala.Path
import purescala.Expressions._
import purescala.Common._
import purescala.Definitions._
import purescala.Types._
import purescala.TypeOps._
import purescala.ExprOp... | epfl-lara/leon | src/main/scala/leon/synthesis/rules/HOFDecomp.scala | Scala | gpl-3.0 | 11,433 |
package com.socrata.soql.exceptions
import scala.collection.compat.immutable.LazyList
import scala.util.parsing.input.Position
import scala.reflect.ClassTag
import com.rojoma.json.v3.ast._
import com.rojoma.json.v3.util.{SimpleHierarchyCodecBuilder, InternalTag, AutomaticJsonCodecBuilder}
import com.rojoma.json.v3.co... | socrata-platform/soql-reference | soql-analyzer/src/main/scala/com/socrata/soql/exceptions/Exceptions.scala | Scala | apache-2.0 | 12,965 |
package controllers
import anorm.{Row, SQL}
import play.api.Play.current
import play.api.db.DB
import play.api.libs.json.{JsString, JsUndefined, JsValue, Json}
import play.api.mvc.{Action, Controller}
import utils.Resource
trait ValidationResult
class ValidationSuccess(val name: String, val value: String) extends Va... | ishakir/PokeStat | app/controllers/REST.scala | Scala | mit | 9,689 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009, 2010, 2011 Mark Harrah
*/
package xsbt.boot
import Pre._
import BootConfiguration.{ CompilerModuleName, JAnsiVersion, LibraryModuleName }
import java.io.File
import java.net.{ URL, URLClassLoader, URI }
import java.util.concurrent.Callable
import scala.collection.... | jaceklaskowski/sbt | launch/src/main/scala/xsbt/boot/Launch.scala | Scala | bsd-3-clause | 20,267 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | caneGuy/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/IntervalBenchmark.scala | Scala | apache-2.0 | 3,775 |
/*
* 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 | mllib/src/test/scala/org/apache/spark/mllib/recommendation/ALSSuite.scala | Scala | apache-2.0 | 6,554 |
package lila.hub
import akka.actor._
import com.softwaremill.macwire._
import com.typesafe.config.Config
import play.api.Configuration
object actors {
trait Actor {
val actor: ActorSelection
val ! = actor ! _
}
case class GameSearch(actor: ActorSelection) extends Actor
case class ForumSearch(actor:... | luanlv/lila | modules/hub/src/main/Env.scala | Scala | mit | 1,962 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package scalaguide.detailed.filters.csp
// #scala-csp-dynamic-action
package controllers {
import akka.stream.Materializer
import javax.inject._
import play.api.mvc._
import play.filters.csp._
import scala.concurrent.ExecutionCont... | Shenker93/playframework | documentation/manual/working/commonGuide/filters/code/scalaguide/detailed/filters/csp/DynamicCSPAction.scala | Scala | apache-2.0 | 2,037 |
// Wei Chen - Random Cut Tree
// 2022-03-04
package com.scalaml.algorithm
class RandomCutTree() extends Abnormal {
val algoname: String = "RandomCutTree"
val version: String = "0.1"
var maxLayer = 5
var tree: DecisionNode = null
override def clear(): Boolean = {
maxLayer = 5
true... | Wei-1/Scala-Machine-Learning | src/main/scala/algorithm/abnormal/RandomCutTree.scala | Scala | mit | 2,174 |
package io.livingston.ditto
import com.twitter.util.{Await, Future}
import com.typesafe.scalalogging.LazyLogging
object Ditto extends App with DittoSettings with LazyLogging {
yamlConfigs.foreach { case (protocol, yaml) =>
LoadResponder.load(protocol, yaml)
}
Await.ready(Future.never)
}
| scottlivingston/ditto | src/main/scala/io/livingston/ditto/Ditto.scala | Scala | mit | 302 |
import scala.quoted._
object Test
def run(using qctx: QuoteContext)(tree: qctx.tasty.Tree): Unit =
'{ ${ makeExpr(tree) } + 1 }
def makeExpr(using qctx: QuoteContext)(tree: qctx.tasty.Tree): Expr[Int] = ???
| som-snytt/dotty | tests/pos/i8045.scala | Scala | apache-2.0 | 217 |
package org.http4s
import scala.collection.concurrent.TrieMap
import scalaz._
import org.http4s.parser.Rfc2616BasicRules
import org.http4s.util.{Writer, Renderable}
import Method.Semantics
/**
* An HTTP method.
*
* @see [http://tools.ietf.org/html/rfc7231#section-4 RFC7321, Section 4]
* @see [http://www.iana.or... | hvesalai/http4s | core/src/main/scala/org/http4s/Method.scala | Scala | apache-2.0 | 5,484 |
package com.cave.metrics.data.evaluator
import java.security.MessageDigest
import org.joda.time.LocalTime
import scala.concurrent.duration._
import scala.util.parsing.combinator.JavaTokenParsers
trait AlertParser extends JavaTokenParsers {
def anyAggregator = (
for {
value <- Aggregator.values
... | gilt/cave | core/src/main/scala/com/cave/metrics/data/evaluator/AlertParser.scala | Scala | mit | 5,970 |
package keycloakapi
import play.api.libs.functional.syntax._
import play.api.libs.json.Reads._
import play.api.libs.json._
case class KeycloakUser(
firstname: String,
lastname: String,
email: String,
systemId: String,
campusId: String,
degreeAbbrev: Option[String],
registrationId: Option[S... | THK-ADV/lwm-reloaded | app/keycloakapi/KeycloakUser.scala | Scala | mit | 1,038 |
import sbt.Keys._
import sbt._
object Dependencies {
val AwsSdkVersion = "1.11.774"
val AwsCloudformationDeps = Seq(
libraryDependencies ++= Seq(
"com.amazonaws" % "aws-java-sdk-cloudformation" % AwsSdkVersion,
"com.amazonaws" % "aws-java-sdk-sts" % AwsSdkVersion,
"com.amazonaws" % "aws-ja... | PigumerGroup/sbt-aws-cloudformation | project/Dependencies.scala | Scala | mit | 817 |
package jigg.util
/*
Copyright 2013-2015 Hiroshi Noji
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... | sakabar/jigg | src/main/scala/jigg/util/LogUtil.scala | Scala | apache-2.0 | 1,992 |
package leo.modules.calculus
import leo.Out
import leo.datastructures.Literal.Side
import leo.datastructures._
import leo.modules.HOLSignature.{LitTrue, o}
import leo.modules.output.{SZS_CounterTheorem, SZS_EquiSatisfiable, SZS_Theorem}
import scala.annotation.tailrec
////////////////////////////////////////////////... | lex-lex/Leo-III | src/main/scala/leo/modules/calculus/Rules.scala | Scala | bsd-3-clause | 26,483 |
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.