code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package com.sksamuel.elastic4s.analyzers
import org.elasticsearch.common.xcontent.{XContentFactory, XContentBuilder}
import scala.collection.JavaConverters._
trait AnalyzerFilter {
def name: String
}
case class PredefinedTokenFilter(name: String) extends TokenFilter
case class PredefinedCharFilter(name: String) ex... | ulric260/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/analyzers/analyzerFilters.scala | Scala | apache-2.0 | 1,434 |
/* Title: Pure/GUI/color_value.scala
Author: Makarius
Cached color values.
*/
package isabelle
import java.awt.Color
import java.util.Locale
object Color_Value
{
private var cache = Map.empty[String, Color]
def parse(s: String): Color =
{
val i = java.lang.Long.parseLong(s, 16)
val r ... | larsrh/libisabelle | modules/pide/2019-RC4/src/main/scala/GUI/color_value.scala | Scala | apache-2.0 | 989 |
/* * Copyright 2011 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 to in ... | haroldl/kumiho | src/main/scala/code/snippet/LogFilePost.scala | Scala | apache-2.0 | 938 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complian... | fanf/scala-ldap | src/main/scala/com/normation/ldap/sdk/TypedAttribute.scala | Scala | apache-2.0 | 4,621 |
package co.blocke.scalajack
package json.collections
import TestUtil._
import munit._
import munit.internal.console
import co.blocke.scalajack.json.JSON
import scala.collection.immutable._
class Tuples() extends FunSuite:
val sj = co.blocke.scalajack.ScalaJack()
test("null tuples work") {
describe("--------... | gzoller/ScalaJack | core/src/test/scala/co.blocke.scalajack/json/collections/Tuples.scala | Scala | mit | 1,338 |
import java.io._
import scala.io.Source
object FileDemo {
def main(args: Array[String]){
val writer = new PrintWriter(new File("text.txt"))
writer.write("Hello Scala")
writer.close()
//println("Following is the content read:")
//Source.fromFile("test.txt").foreach{
// print
//}
}
}
| fbartnitzek/notes | 7_languages/Scala/FileDemo.scala | Scala | apache-2.0 | 302 |
/**
* COPYRIGHT (C) 2015 Alpine Data Labs Inc. All Rights Reserved.
*/
package com.alpine.plugin.core.io.defaults
import com.alpine.plugin.core.io.{LocalTable, OperatorInfo, Row}
/**
* AbstractLocalTable, for boilerplate implementation of LocalTable.
*/
abstract class AbstractLocalTable(val tableName: String, va... | holdenk/PluginSDK | plugin-io-impl/src/main/scala/com/alpine/plugin/core/io/defaults/LocalTableDefault.scala | Scala | apache-2.0 | 1,373 |
package drt.client.components.styles
import scalacss.internal.mutable.StyleSheet
import ScalaCssImplicits.CssSettings._
case class ScenarioSimulationStyle(common: CommonStyle = DefaultCommonStyle) extends StyleSheet.Inline {
import dsl._
val container = style(
unsafeChild("label")(
fontSize(1.5.rem)
... | UKHomeOffice/drt-scalajs-spa-exploration | client/src/main/scala/drt/client/components/styles/ScenarioSimulationStyle.scala | Scala | apache-2.0 | 403 |
/*
* Copyright (c) 2014 Dufresne Management Consulting LLC.
*/
package com.nickelsoftware.bettercare4me.cassandra
import scala.collection.JavaConversions.asScalaBuffer
import scala.collection.JavaConversions.asScalaSet
import scala.collection.JavaConversions.seqAsJavaList
import scala.concurrent.ExecutionContext.Imp... | reactivecore01/bettercare4.me | play/app/com/nickelsoftware/bettercare4me/cassandra/Bettercare4me.scala | Scala | apache-2.0 | 30,853 |
package junctions
import Chisel._
import cde.{Parameters, Field}
class PociIO(implicit p: Parameters) extends HastiBundle()(p)
{
val paddr = UInt(OUTPUT, hastiAddrBits)
val pwrite = Bool(OUTPUT)
val psel = Bool(OUTPUT)
val penable = Bool(OUTPUT)
val pwdata = UInt(OUTPUT, hastiDataBits)
val prdata = UInt(I... | masc-ucsc/cmpe220fall16 | riscv_cores/zscale_modified/junctions/src/main/scala/poci.scala | Scala | apache-2.0 | 2,281 |
/*
* Copyright (c) 2012-14 Miles Sabin
*
* 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... | mandubian/shapeless | core/src/test/scala/shapeless/lenses.scala | Scala | apache-2.0 | 17,462 |
/*
* 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 ... | maropu/spark | mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeans.scala | Scala | apache-2.0 | 20,142 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | massie/adam | adam-core/src/main/scala/org/bdgenomics/adam/rdd/read/SingleReadBucket.scala | Scala | apache-2.0 | 6,149 |
/**
* Copyright (c) 2012 Alexey Aksenov ezh@ezh.msk.ru
*
* 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... | ezh/android-DigiLib | src/main/scala/org/digimead/digi/ctrl/lib/message/Dispatcher.scala | Scala | apache-2.0 | 855 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009, 2010 Mark Harrah
*/
package sbt
import Path._
import IO.{pathSplit, wrapNull}
import java.io.File
import java.net.URL
import scala.collection.{generic, immutable, mutable}
final class RichFile(val asFile: File)
{
def / (component: String): File = if(component ==... | harrah/xsbt | util/io/src/main/scala/sbt/Path.scala | Scala | bsd-3-clause | 11,217 |
/*
* Copyright (c) 2014-2018 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... | Wogan/monix | monix-tail/shared/src/main/scala/monix/tail/batches/IntegersBatch.scala | Scala | apache-2.0 | 1,801 |
package com.sksamuel.elastic4s.http.search.aggs
import com.sksamuel.elastic4s.searches.aggs.TopHitsAggregationDefinition
import com.sksamuel.elastic4s.searches.sort.FieldSortDefinition
import org.scalatest.{FunSuite, Matchers}
class TopHitsAggregationBuilderTest extends FunSuite with Matchers {
test("top hits aggre... | FabienPennequin/elastic4s | elastic4s-http/src/test/scala/com/sksamuel/elastic4s/http/search/aggs/TopHitsAggregationBuilderTest.scala | Scala | apache-2.0 | 682 |
/*
* Copyright 2012-2020 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... | planet42/Laika | core/shared/src/main/scala/laika/rst/TableParsers.scala | Scala | apache-2.0 | 16,128 |
/*
* Copyright 2020 Precog Data
*
* 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 ... | djspiewak/quasar | foundation/src/main/scala/quasar/contrib/iota/SubInjectMacros.scala | Scala | apache-2.0 | 6,041 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 MineFormers
*
* 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, ... | MineFormers/MFCore | src/main/scala/de/mineformers/core/inventory/slot/OutputSlot.scala | Scala | mit | 1,493 |
/**
* 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... | evlist/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/XFormsStaticStateImpl.scala | Scala | lgpl-2.1 | 14,489 |
package com.highcharts
import scala.scalajs.js
@js.native
sealed trait CleanJsObject[+T] extends scalajs.js.Object
object CleanJsObject {
def apply(v: js.Object): js.Object = v match {
case null ⇒
null
case und if js.isUndefined(und) ⇒
js.undefined.asInstanceOf[js.Object]
case array if js... | Karasiq/scalajs-highcharts | src/main/scala/com/highcharts/CleanJsObject.scala | Scala | mit | 1,225 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | bravo-zhang/spark | core/src/test/scala/org/apache/spark/ui/storage/StoragePageSuite.scala | Scala | apache-2.0 | 7,254 |
package api
import com.github.jknack.handlebars.Handlebars
import com.github.jknack.handlebars.cache.ConcurrentMapTemplateCache
import com.github.jknack.handlebars.io.FileTemplateLoader
import com.github.jknack.handlebars.Template
import models.WebsiteDb
import org.codehaus.jackson.JsonNode
import play.api.libs.json.J... | jlcanela/fastcms | app/api/RenderingApi.scala | Scala | apache-2.0 | 1,788 |
package fpinscala.state
import fpinscala.state.RNG.{Rand, Simple}
import org.scalacheck.{Gen, Prop}
import org.specs2.ScalaCheck
import org.specs2.mutable.Specification
/**
*
*/
class StateTest extends Specification with ScalaCheck {
"RNG" should {
"nonNegativeInt" ! prop { (s:Int) =>
val (i1, rng2) = R... | karolchmist/fpinscala | exercises/src/test/scala/fpinscala/state/StateTest.scala | Scala | mit | 2,287 |
package net.fwbrasil.activate.entity
import net.fwbrasil.activate.entity.id.CustomID
import net.fwbrasil.activate.entity.id.UUID
import net.fwbrasil.activate.entity.id.GeneratedID
trait Entity extends BaseEntity with UUID
trait EntityWithCustomID[ID] extends BaseEntity with CustomID[ID]
trait EntityWithGeneratedID[ID... | xdevelsistemas/activate | activate-core/src/main/scala/net/fwbrasil/activate/entity/Entity.scala | Scala | lgpl-2.1 | 361 |
package org.shelmet.heap.server
import org.shelmet.heap.model.Snapshot
import java.text.SimpleDateFormat
import java.util.{TimeZone,Date}
class HomepagePage(snapshot: Snapshot) extends AbstractPage(snapshot) {
def formatDateAsUTC(date : Date) =
{
val sdf = new SimpleDateFormat("dd MMM yyyy HH:mm:ss z")
s... | rorygraves/shelmet | src/main/scala/org/shelmet/heap/server/HomepagePage.scala | Scala | gpl-2.0 | 1,754 |
/*
* 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 ... | someorz/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala | Scala | apache-2.0 | 28,774 |
/**
* Copyright (C) 2009-2011 the original author or authors.
* See the notice.md 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 compliance with the License.
* Yo... | maslovalex/scalate | scalate-core/src/main/scala/org/fusesource/scalate/servlet/TemplateEngineServlet.scala | Scala | apache-2.0 | 3,698 |
package fpinscala.datastructures
sealed trait List[+A] {
def head: A
def tail: List[A]
def setHead[T >: A](elm: T): List[T]
//これだと出来ない
// def setHead[A](elm: A): List[A]
def drop(n: Int): List[A] =
if(n == 0)this
else tail.drop(n-1)
def dropWhile(f: A => Boolean): List[A] =
this match {... | tarata/FunctionalProgramminginScala | src/main/scala/fpinscala/datastructures/List.scala | Scala | mit | 4,177 |
package com.estus.distribution
import routine._
import org.apache.commons.math3.distribution.ZipfDistribution
object zipf {
/** *
*
* Zipf Distribution
*
* d_ - probability density function
* p_ - cumulative density function
* q_ - inverse cumulative density function
* r_ - random numb... | EstusDev/Estus | estus-distribution/src/main/scala/zipf.scala | Scala | apache-2.0 | 3,128 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-nn | src/main/scala/toolkit/neuralnetwork/policy/EmptyBinding.scala | Scala | apache-2.0 | 855 |
package epic.parser
/*
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 ... | langkilde/epic | src/main/scala/epic/parser/ProductionFeaturizer.scala | Scala | apache-2.0 | 3,504 |
/*
* Copyright 2016 Carlo Micieli
*
* 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... | CarloMicieli/hascalator | core/src/main/scala/io/hascalator/dst/BinarySearchTree.scala | Scala | apache-2.0 | 6,006 |
package spark.storage
import java.io.{Externalizable, ObjectInput, ObjectOutput}
class StorageLevel(
var useDisk: Boolean,
var useMemory: Boolean,
var deserialized: Boolean,
var replication: Int = 1)
extends Externalizable {
// TODO: Also add fields for caching priority, dataset ID, and flushing... | ankurdave/arthur | core/src/main/scala/spark/storage/StorageLevel.scala | Scala | bsd-3-clause | 2,239 |
package demo.components
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.html_<^._
import scalacss.ProdDefaults._
object ReactInfiniteInfo {
object Style extends StyleSheet.Inline {
import dsl._
val content = style(
textAlign.center,
fontSize(30.px),
paddingTop(40.px)... | chandu0101/scalajs-react-components | demo/src/main/scala/demo/components/ReactInfiniteInfo.scala | Scala | apache-2.0 | 1,079 |
/**
* 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... | thkluge/gatling | gatling-commons/src/main/scala/io/gatling/commons/util/Io.scala | Scala | apache-2.0 | 6,116 |
/**
* Illustrates filtering and union to extract lines with "error" or "warning"
*/
package com.oreilly.learningsparkexamples.scala
import org.apache.spark._
import org.apache.spark.SparkContext._
object BasicFilterUnionCombo {
def main(args: Array[String]) {
val conf = new SparkConf
conf.setMaster(... | wuzhong290/learning-spark | src/main/scala/com/oreilly/learningsparkexamples/scala/BasicFilterUnionCombo.scala | Scala | mit | 641 |
package com.skittr.comet
/* *\\
(c) 2007 WorldWide Conferencing, LLC
Distributed under an Apache License
http://www.apache.org/licenses/LICENSE-2.0
\\* */
import _root_.scala.actors._
import _root_.scala.actors.Actor._
... | andreum/liftweb | sites/skittr/src/main/scala/com/skittr/comet/WatchUser.scala | Scala | apache-2.0 | 2,084 |
/*
* Copyright (C) 2009 Lalit Pant <pant.lalit@gmail.com>
*
* The contents of this file are subject to the GNU General Public License
* Version 3 (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.gnu.org/copyleft/gpl.html
*
*... | richardfontana/fontana2007-t | KojoEnv/src/net/kogics/kojo/core/Figure.scala | Scala | gpl-3.0 | 2,373 |
package scalaoauth2.provider
import java.util.Base64
import scala.util.Try
case class ClientCredential(clientId: String, clientSecret: Option[String])
class AuthorizationRequest(
headers: Map[String, Seq[String]],
params: Map[String, Seq[String]]
) extends RequestBase(headers, params) {
def scope: Option... | nulab/scala-oauth2-provider | src/main/scala/scalaoauth2/provider/AuthorizationRequest.scala | Scala | mit | 3,331 |
package com.bigm.bot.engine
import akka.actor.{ActorLogging, ActorRef, FSM}
import akka.contrib.pattern.ReceivePipeline
import com.bigm.bot.api.facebookmessenger.{FacebookMessageDeliveredEvent, FacebookMessageReadEvent}
import com.bigm.bot.engine.ConciergeActor.{Data, State}
import com.bigm.bot.engine.interceptors.{Lo... | bigmlab/bigm-bot | src/main/scala/com/bigm/bot/engine/ConciergeActor.scala | Scala | apache-2.0 | 13,495 |
/**
* **************************************************************
* Licensed to the AOS Community (AOS) under one or more *
* contributor license agreements. See the NOTICE file *
* distributed with this work for additional information *
* regarding copyright ownership. The AOS licenses ... | XClouded/t4f-core | scala/src/test/scala/io/aos/scala/JunitTest.scala | Scala | apache-2.0 | 1,402 |
//scalac: -Werror -Wunused:privates -Xsource:3
//
object Domain {
def id(id: String): Domain = Domain(Some(id), None)
def name(name: String): Domain = Domain(None, Some(name))
// induces private copy and private copy defaults
def apply(id: String, name: String): Domain = Domain(Some(id), Some(name))
}
case cl... | scala/scala | test/files/pos/t11980.scala | Scala | apache-2.0 | 465 |
/*
* 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/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala | Scala | apache-2.0 | 35,725 |
object prob {
opaque type Probability = Double
implicit object Probability {
def apply(n: Double): Option[Probability] =
if (0.0 <= n && n <= 1.0) Some(n) else None
def unsafe(p: Double): Probability = {
require(0.0 <= p && p <= 1.0, s"probabilities lie in [0, 1] (got $p)")
p
}
... | lampepfl/dotty | tests/pos/opaque-propability-xm.scala | Scala | apache-2.0 | 1,357 |
package scala.pickling.`null`.json
import org.scalatest.FunSuite
import scala.pickling._, scala.pickling.Defaults._, json._
class D
final class E
case class C(val x: String, val y: Int, val d: D, val e: E)
class NullJsonTest extends FunSuite {
test("main") {
val c = C(null, 0, null, null)
val pickle = c.pi... | eed3si9n/pickling-historical | core/src/test/scala/pickling/run/null-json.scala | Scala | bsd-3-clause | 584 |
/*
* Copyright 2012 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | cogitate/twitter-zipkin-uuid | zipkin-common/src/main/scala/com/twitter/zipkin/query/Order.scala | Scala | apache-2.0 | 872 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | core/src/main/scala/org/apache/spark/shuffle/ShuffleReader.scala | Scala | apache-2.0 | 1,693 |
package nozzle.webresult
import spray.http.{ StatusCode, StatusCodes }
trait DefaultMarshallingSupport extends MarshallingSupport {
implicit def webErrorToStatusCode(webError: WebError) = webError match {
case WebError.InvalidParam(_, _) => StatusCodes.UnprocessableEntity
case WebError.Invalid... | buildo/nozzle | src/main/scala/webresult/DefaultMarshallingSupport.scala | Scala | mit | 1,613 |
package com.arcusys.valamis.certificate.service
import com.arcusys.learn.liferay.LiferayClasses.LSocialActivity
import com.arcusys.valamis.certificate.model.goal._
import com.arcusys.valamis.certificate.storage._
import com.arcusys.valamis.model.PeriodTypes
import org.joda.time.DateTime
import org.mockito.Mockito._
im... | igor-borisov/valamis | valamis-certificate/src/test/scala/com/arcusys/valamis/certificate/service/ActivityGoalStatusCheckerComponentTest.scala | Scala | gpl-3.0 | 8,677 |
package dk.gp.gpc.util
import breeze.linalg.DenseVector
import breeze.optimize.DiffFunction
import breeze.optimize.ApproximateGradientFunction
import util._
import breeze.linalg._
import dk.gp.gpc.GpcModel
case class GpcApproxLowerboundDiffFunction(initialGpcModel: GpcModel) extends DiffFunction[DenseVector[Double]] ... | danielkorzekwa/bayes-scala-gp | src/main/scala/dk/gp/gpc/util/GpcApproxLowerboundDiffFunction.scala | Scala | bsd-2-clause | 1,458 |
// This is a playground for AI, it offers a game space for AI to work with.
// Copyright (C) 2016 Jappe Klooster
// 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 Licen... | jappeace/gdx_ai_gamespace | core/src/main/scala/nl/jappieklooster/gdx/mapstare/states/BuildState.scala | Scala | gpl-3.0 | 3,155 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/vat-registration-frontend | app/controllers/registration/returns/ReceiveGoodsNipController.scala | Scala | apache-2.0 | 3,591 |
package com.wavesplatform.transaction.lease
import com.wavesplatform.account.{AddressScheme, KeyPair, PrivateKey, PublicKey}
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.crypto
import com.wavesplatform.lang.ValidationError
import com.wavesplatform.transaction._
import com.wavesplatform.transa... | wavesplatform/Waves | node/src/main/scala/com/wavesplatform/transaction/lease/LeaseCancelTransaction.scala | Scala | mit | 2,995 |
package isabelle.eclipse.launch
import java.net.{MalformedURLException, URL}
import org.eclipse.jface.resource.ImageDescriptor
/**
* Isabelle launch image definitions.
*
* When images are used in label providers (e.g. where Image) is required, they must be disposed manually.
* For convenience, [[org.eclipse.jfa... | andriusvelykis/isabelle-eclipse | isabelle.eclipse.launch/src/isabelle/eclipse/launch/IsabelleLaunchImages.scala | Scala | epl-1.0 | 1,107 |
package com.github.uchibori3.mfcloud.invoice.service
import akka.Done
import akka.actor.ActorSystem
import akka.http.scaladsl.model.ContentTypes.`application/json`
import akka.http.scaladsl.model.headers.OAuth2BearerToken
import akka.http.scaladsl.model.{ HttpEntity, HttpRequest, HttpResponse, StatusCodes }
import akk... | Uchibori3/mfcloud-invoice-scala | src/test/scala/com/github/uchibori3/mfcloud/invoice/service/BillsSpec.scala | Scala | apache-2.0 | 6,629 |
package com.gilt.gfc.concurrent
import java.util.concurrent.{ExecutorService => JExecutorService, ScheduledExecutorService => JScheduledExecutorService}
import com.gilt.gfc.concurrent.{ScheduledExecutorService => GScheduledExecutorService}
import org.scalatest.mockito.{MockitoSugar => ScalaTestMockitoSugar}
import o... | gilt/gfc-concurrent | src/test/scala/com/gilt/gfc/concurrent/JavaConversionsSpec.scala | Scala | apache-2.0 | 1,047 |
/*
* 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 ... | akopich/spark | sql/core/src/test/scala/org/apache/spark/sql/ConfigBehaviorSuite.scala | Scala | apache-2.0 | 2,557 |
import sbt._
import Keys._
object HW3Build extends Build {
lazy val root = Project(id = "hw3",
base = file("."))
}
| mpgarate/ProgLang-Assignments | HW3/project/Build.scala | Scala | mit | 145 |
/*
* 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 ... | eyalfa/spark | core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala | Scala | apache-2.0 | 110,366 |
package org.qirx.littlespec.macros
import scala.reflect.macros.Context
import scala.io.Source
import scala.language.experimental.macros
case class Location(filename: String, line: Int, column: Int, lines: Seq[String])
object Location {
implicit def currentLocation: Location = macro currentLocationImpl
def curr... | EECOLOR/little-spec | macros/src/main/scala/org/qirx/littlespec/macros/Location.scala | Scala | mit | 710 |
/*
* 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 not u... | tophua/spark1.52 | sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala | Scala | apache-2.0 | 12,684 |
package moe.pizza.auth
import java.io.File
import java.net.InetSocketAddress
import java.util.UUID
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import moe.pizza.auth.adapters.{LdapUserDatabase, ... | xxpizzaxx/pizza-auth-3 | src/main/scala/moe/pizza/auth/Main.scala | Scala | mit | 5,073 |
object Test {
abstract class Number
case class MyInt(n: Int) extends Number
case class MyDouble(d: Double) extends Number
trait Term[a]
case class Cell[a](var x: a) extends Term[a]
final case class NumTerm(val n: Number) extends Term[Number]
def f[a](t: Term[a], c: Cell[a]): Unit = {
t match {
... | yusuke2255/dotty | tests/pending/pos/gadts2.scala | Scala | bsd-3-clause | 596 |
package spire
package math.extras.interval
import spire.algebra.{Bool, Eq, Order}
import spire.math._
import spire.math.interval._
import scala.annotation.tailrec
import scala.language.implicitConversions
sealed abstract class IntervalTrie[T] extends IntervalSet[T, IntervalTrie[T]]
object IntervalTrie {
implicit... | rklaehn/spire | extras/src/main/scala/spire/math/extras/interval/IntervalTrie.scala | Scala | mit | 15,158 |
/*
* 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 ... | SHASHANKB/spark | project/MimaExcludes.scala | Scala | apache-2.0 | 95,078 |
package latis.reader.tsml.agg
import latis.dm.Dataset
import latis.ops.agg.TileAggregation
import latis.reader.tsml.ml.Tsml
/**
* Delegate to the TileAggregation Operation to join Datasets based on their
* bounding domain sets.
*/
class TileUnionAdapter(tsml: Tsml) extends AggregationAdapter(tsml) {
def aggrega... | dlindhol/LaTiS | src/main/scala/latis/reader/tsml/agg/TileUnionAdapter.scala | Scala | epl-1.0 | 398 |
package com.twitter.finagle.http.codec
import com.twitter.finagle.http.{Fields, Message, Request, Response, Status}
import com.twitter.util.{Future, Promise}
/**
* The HTTP connection manager implements connection management in
* accordance with RFC 2616 § 8. This is just the state machine; the
* codec implementat... | koshelev/finagle | finagle-http/src/main/scala/com/twitter/finagle/http/codec/ConnectionManager.scala | Scala | apache-2.0 | 3,759 |
/*
* Copyright 2016 Miel Donkers
*
* 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... | mdonkers/akka-cqrs-es-demo | src/main/scala/nl/codecentric/coffee/util/DatabaseService.scala | Scala | apache-2.0 | 1,235 |
package im.mange.little.classy
import scala.reflect.ClassTag
object Classy {
def name[T : ClassTag]: String = name(runtimeClass[T])
def runtimeClass[T : ClassTag]: Class[_] = implicitly[ClassTag[T]].runtimeClass
private def name(clazz: Class[_]): String = clazz.getSimpleName.stripSuffix("$")
}
| alltonp/little | src/main/scala/im/mange/little/classy/Classy.scala | Scala | apache-2.0 | 305 |
package com.taxis99.aws
import org.mockito.Matchers._
import org.mockito.Mockito._
import org.scalatest.{ Finders, MustMatchers, WordSpec }
import com.amazonaws.services.sqs.AmazonSQSClient
import com.amazonaws.services.sqs.model.CreateQueueRequest
import com.amazonaws.services.sqs.model.CreateQueueResult
import com.... | mtrovo/awsscala | src/test/scala/com/taxis99/aws/SQSHelperSpec.scala | Scala | apache-2.0 | 1,208 |
/* https://www.hackerrank.com/challenges/solve-me-first */
package com.negrisoli.algorithms.warmup
import io.Source.stdin
object SolveMeFirst {
def main(args: Array[String]) {
println(stdin.getLines().take(2).map(_.toInt).sum)
}
} | rbatista/algorithms | challenges/hacker-rank/scala/src/main/scala/com/negrisoli/algorithms/warmup/SolveMeFirst.scala | Scala | mit | 240 |
package com.github.lstephen.ootp.ai.report;
import com.google.common.base.Function
import com.google.common.collect.Ordering
import com.github.lstephen.ootp.ai.io.Printable
import com.github.lstephen.ootp.ai.player.Player
import com.github.lstephen.ootp.ai.regression.Predictor
import com.github.lstephen.ootp.ai.roster... | lstephen/ootp-ai | src/main/scala/com/github/lstephen/ootp/ai/report/SalaryReport.scala | Scala | apache-2.0 | 3,534 |
package dotty.tools
package dotc
package typer
import core._
import ast.{Trees, untpd, tpd, TreeInfo}
import util.Positions._
import util.Stats.{track, record, monitored}
import printing.Showable
import Contexts._
import Types._
import Flags._
import Mode.ImplicitsEnabled
import Denotations._
import NameOps._
import S... | densh/dotty | src/dotty/tools/dotc/typer/Implicits.scala | Scala | bsd-3-clause | 30,063 |
package shapeless {
sealed trait HList extends Product with Serializable {
def :: (x: Any): HList = new ::(x, this)
}
final case class ::[+H, +T <: HList](head : H, tail : T) extends HList {
override def toString = head match {
case _: ::[_, _] => s"($head) :: $tail"
case _ => s"$head :: $tail"
}
}
sea... | som-snytt/dotty | tests/neg/shapeless-hcons.scala | Scala | apache-2.0 | 637 |
package code.model
import _root_.net.liftweb.mapper._
import _root_.net.liftweb.util._
import _root_.net.liftweb.common._
import _root_.net.liftweb.sitemap.Loc._
import _root_.net.liftweb.http._
import _root_.java.math.MathContext
import _root_.scala.xml.transform._
import _root_.net.liftweb.util.Helpers._
import jav... | Cerovec/LiftSocial | src/main/scala/code/model/User.scala | Scala | apache-2.0 | 10,264 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.javadsl.api.broker
import javax.inject.Inject
import javax.inject.Singleton
import com.lightbend.lagom.javadsl.api.Descriptor.TopicCall
import com.lightbend.lagom.javadsl.api.broker.Topic
import play.api... | rcavalcanti/lagom | service/javadsl/api/src/main/scala/com/lightbend/lagom/internal/javadsl/api/broker/TopicFactory.scala | Scala | apache-2.0 | 1,242 |
/**
* Copyright (c) 2013-2016 Extended Mind Technologies Oy
*
* This file is part of Extended Mind.
*
* Extended Mind is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* Li... | ttiurani/extendedmind | backend/src/test/scala/org/extendedmind/api/test/ServiceSpecBase.scala | Scala | agpl-3.0 | 12,238 |
package scorex.account
import scorex.crypto.EllipticCurveImpl
case class PrivateKeyAccount(seed: Array[Byte], privateKey: Array[Byte], override val publicKey: Array[Byte])
extends PublicKeyAccount(publicKey) {
override val address = Account.fromPublicKey(publicKey)
def this(seed: Array[Byte], keyPair: (Array[... | ScorexProject/Scorex-Lagonaki | scorex-basics/src/main/scala/scorex/account/PrivateKeyAccount.scala | Scala | cc0-1.0 | 463 |
/*
* 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... | keithhall/ct-calculations | src/main/scala/uk/gov/hmrc/ct/box/formats/BigDecimalFormat.scala | Scala | apache-2.0 | 996 |
/*
* Copyright 2014 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | bpburns/spark-kernel | protocol/src/test/scala/com/ibm/spark/kernel/protocol/v5/content/CommMsgSpec.scala | Scala | apache-2.0 | 2,132 |
/**
Copyright (C) 2011-2014 beamly Ltd. http://beamly.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 a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | beamly/beamly.core.lang | src/test/scala/beamly/core/lang/future/FutureOptionWTest.scala | Scala | apache-2.0 | 1,935 |
package com.bfm.topnotch.tnengine
import java.io.{PrintWriter, StringWriter}
import org.json4s._
import org.json4s.native.Serialization
import org.json4s.native.Serialization.writePretty
/**
* A command for TnEngine to run
*/
abstract class TnCmd {
/** The key to use to store the resulting dataframe ... | blackrock/TopNotch | src/main/scala/com/bfm/topnotch/tnengine/TnCmd.scala | Scala | apache-2.0 | 3,742 |
package scalaz.stream
import java.nio.BufferOverflowException
import org.scalacheck._
import Prop._
import scalaz.concurrent.Task
import scalaz.stream.Process._
import scalaz.stream.text.{LengthExceeded, lines}
class LinesSpec extends Properties("text") {
val samples = 0 until 5 flatMap { i => List("\\r\\n", "\\... | refried/scalaz-stream | src/test/scala/scalaz/stream/LinesSpec.scala | Scala | mit | 2,132 |
package tap.ast
import scala.util.parsing.input.Positional
/**
* An extension of the Positional trait to include a filename along side source position information.
*/
trait FilePositional extends Positional {
/**
* The file this object came from.
*/
var file: String = null
/**
* Sets th... | garyb/tap | src/main/scala/tap/ast/FilePositional.scala | Scala | mit | 722 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | ddseapy/geomesa | geomesa-kafka/geomesa-kafka-datastore/src/main/scala/org/locationtech/geomesa/kafka/utils/GeoMessage.scala | Scala | apache-2.0 | 1,614 |
package spinoco.protocol.mail.header
import org.scalacheck.Prop.protect
import org.scalacheck.Properties
import spinoco.protocol.mail.EmailAddress
/**
* Created by pach on 23/10/17.
*/
object ResentFromSpec extends Properties("ResentFrom") {
import spinoco.protocol.mail.SpecUtil._
implicit val HeaderCodec = ... | Spinoco/protocol | mail/src/test/scala/spinoco/protocol/mail/header/ResentFromSpec.scala | Scala | mit | 922 |
/*
val input = List(1,2,3,0,4)
val output = List(0,3,2,1,4)
*/
def garage(input:List[Int], output:List[Int]): List[List[Int]] = {
var result = List[List[Int]]()
var step = for (i <- input) yield i
while (step != output){
val ideal = step.map(output.indexOf)
val zeroPos = step.indexOf(0)
... | marcosfede/algorithms | array/garage/garage.scala | Scala | gpl-3.0 | 727 |
package doobie.enum
import doobie.util.invariant._
import doobie.enum.{ nullability => N }
import java.sql.ParameterMetaData._
import scalaz.Equal
import scalaz.std.anyVal.intInstance
object parameternullable {
/** @group Implementation */
sealed abstract class ParameterNullable(val toInt: Int) {
def toNul... | rperry/doobie | core/src/main/scala/doobie/enum/parameternullable.scala | Scala | mit | 1,438 |
package com.twitter.finagle.redis
import com.twitter.finagle.partitioning.ConsistentHashPartitioningService
import com.twitter.finagle.partitioning.ConsistentHashPartitioningService.NoPartitioningKeys
import com.twitter.finagle.partitioning.PartitioningService.PartitionedResults
import com.twitter.finagle.partitioning... | twitter/finagle | finagle-redis/src/main/scala/com/twitter/finagle/redis/RedisPartitioningService.scala | Scala | apache-2.0 | 7,622 |
/*
* Copyright 2014 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 applica... | HenryHarper/Acquire-Reboot | gradle/samples/jvmComponents/scala/src/main/scala/org/gradle/samples/Greeter.scala | Scala | mit | 730 |
package edu.gemini.qv.plugin.util
import java.awt.Desktop
import java.awt.print.{PageFormat, PrinterException, PrinterJob}
import java.io.{File, PrintWriter}
import javax.swing.JTable
import javax.swing.JTable.PrintMode
import javax.swing.table.TableColumn
import edu.gemini.qv.plugin.table.ObservationTableModel.{DecV... | arturog8m/ocs | bundle/edu.gemini.qv.plugin/src/main/scala/edu/gemini/qv/plugin/util/Exporter.scala | Scala | bsd-3-clause | 6,648 |
/*
* Copyright 2011-2014 Chris de Vreeze
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | EBPI/yaidom | src/test/scala/nl/ebpi/yaidom/queryapitests/simple/XbrlInstanceQueryTest.scala | Scala | apache-2.0 | 1,494 |
/*
* 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
* distrib... | fusepoolP3/p3-silk | silk-core/src/test/scala/de/fuberlin/wiwiss/silk/plugins/transformer/LowerCaseTransformerTest.scala | Scala | apache-2.0 | 1,333 |
package org.jetbrains.plugins.scala
package lang
package formatting
import com.intellij.lang.ASTNode
import psi.api.expr.ScIfStmt
import psi.api.ScalaFile
/**
* User: Alexander Podkhalyuzin
* Date: 05.10.2008
*/
object FormatterUtil {
def calcIndent(node: ASTNode): Int = {
node.getTreeParent.getPsi match {
... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/formatting/FormatterUtil.scala | Scala | apache-2.0 | 1,110 |
/** Copyright 2015 TappingStone, 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 ... | alex9311/PredictionIO | core/src/main/scala/org/apache/predictionio/workflow/EngineServerPlugin.scala | Scala | apache-2.0 | 1,202 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | erikerlandson/algebird | algebird-test/src/test/scala/com/twitter/algebird/MetricProperties.scala | Scala | apache-2.0 | 3,355 |
package org.jetbrains.plugins.scala
package lang
package transformation
import com.intellij.openapi.util.TextRange
import com.intellij.psi.impl.DebugUtil
import com.intellij.psi.{PsiElement, PsiFile, PsiFileFactory}
import org.intellij.lang.annotations.Language
import org.jetbrains.plugins.scala.extensions._
import or... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/transformation/TransformationTest.scala | Scala | apache-2.0 | 4,233 |
/*
* Copyright 2012-2014 Kieron Wilkinson.
*
* 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... | vyadh/viper | ui/src/main/scala/viper/ui/fonts/Fonts.scala | Scala | apache-2.0 | 704 |
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.