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
/* * 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
core/src/main/scala/org/apache/spark/SparkException.scala
Scala
apache-2.0
9,936
package calc /** * In the diagram given above, the numbers from 1 to 25 are to arranged in a square grid so that each number * except 1 and 2, is the sum of two of its neighbours. Some of the numbers have already been filled in. * Which number must replace the " " when the grid is complete. * * ?? ?? ?? 20...
ebowman/calc
src/main/scala/calc/Calc20.scala
Scala
unlicense
2,254
package org.hablapps.meetup package fun package play import logic._ import common.logic.Domain._ import common.mysql.MySqlDomain._ import _root_.play.api.db.slick.DB import _root_.play.api.Play.current import scala.slick.driver.MySQLDriver.simple.{Sequence => _, _} object IdStore extends Store[Id] { // Operado...
hablapps/meetapp
app/fun/play/IdStore.scala
Scala
apache-2.0
1,469
/* Scala.js compiler * Copyright 2013 LAMP/EPFL * @author Tobias Schlatter */ package org.scalajs.core.compiler import scala.tools.nsc import nsc._ import scala.collection.immutable.ListMap import scala.collection.mutable /** Prepares classes extending js.Any for JavaScript interop * * This phase does: * - Sa...
japgolly/scala-js
compiler/src/main/scala/org/scalajs/core/compiler/PrepJSInterop.scala
Scala
bsd-3-clause
41,335
/* * InsertSpan.scala * (LeereNull) * * Copyright (c) 2011-2014 Hanns Holger Rutz. All rights reserved. * * This software is published under the GNU General Public License v3+ * * * For further information, please contact Hanns Holger Rutz at * contact@sciss.de */ package de.sciss.leerenull object Ins...
Sciss/LeereNull
src/main/scala/de/sciss/leerenull/InsertSpan.scala
Scala
gpl-3.0
462
package com.mlh.sprayswaggersample import org.scalatest._ import org.scalatest.matchers._ class MainSpec extends FreeSpec with Matchers { "The sprayswaggersample class" - { "should be able to run" in { pending } } }
michaelgruczel/spray-swagger-angularjs-example
src/test/scala/SprayswaggersampleSpec.scala
Scala
mit
237
package edu.gemini.gsa.client.impl import java.net.URL import edu.gemini.gsa.client.api._ import edu.gemini.gsa.query.GsaFileListQuery import edu.gemini.spModel.core.Site import scalaz._ import Scalaz._ /** * Implements the GsaClient trait to send queries to the GSA for each request. */ object GsaClientImpl exten...
arturog8m/ocs
bundle/edu.gemini.gsa.client/src/main/scala/edu/gemini/gsa/client/impl/GsaClientImpl.scala
Scala
bsd-3-clause
1,097
/* * 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...
travisbrown/scalatest
src/test/scala/org/scalautils/TolerantEqualitySpec.scala
Scala
apache-2.0
27,956
/** * Copyright (C) 2010-2011 LShift Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
lshift/diffa
agent/src/main/scala/net/lshift/diffa/agent/rest/DiffaConfigReaderWriter.scala
Scala
apache-2.0
13,364
package reactivemongo.api.commands.bson import reactivemongo.core.protocol.MongoWireVersion import reactivemongo.bson._ import reactivemongo.api.BSONSerializationPack import reactivemongo.api.commands.{ DistinctCommand, ResolvedCollectionCommand } @deprecated("Use `.distinct` on collection", "0.16.0") object BSONDist...
ornicar/ReactiveMongo
driver/src/main/scala-2.13-/api/commands/bson/BSONDistinctCommand.scala
Scala
apache-2.0
1,366
/* * 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 ...
hvanhovell/spark
core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala
Scala
apache-2.0
9,820
package com.twitter.finagle.memcached.integration import com.twitter.conversions.DurationOps._ import com.twitter.finagle.{param => ctfparam, _} import com.twitter.finagle.client.StackClient import com.twitter.finagle.liveness.FailureAccrualFactory import com.twitter.finagle.loadbalancer.LoadBalancerFactory import com...
luciferous/finagle
finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/MemcachedPartitioningClientTest.scala
Scala
apache-2.0
5,165
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
pgandhi999/spark
sql/core/src/main/scala/org/apache/spark/sql/execution/ShuffledRowRDD.scala
Scala
apache-2.0
7,721
/* * The MIT License (MIT) * * Copyright (c) 2014 rainysoft * * 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, co...
MikaelUmaN/Market
src/main/scala/com/rainysoft/marketsimulator/agent/AgentSupervisor.scala
Scala
mit
2,009
package text.kanji /** * @author ynupc * Created on 2016/07/26 */ object JISLevel1to2KanjiCharacter extends KanjiCharacter { override val kanji: Seq[String] = JISLevel1KanjiCharacter.kanji ++ JISLevel2KanjiCharacter.kanji }
ynupc/scalastringcourseday7
src/main/scala/text/kanji/JISLevel1to2KanjiCharacter.scala
Scala
apache-2.0
249
/////////////////////////////////////////////////////////////////////////////// // TwitterDoc.scala // // Copyright (C) 2011-2014 Ben Wing, The University of Texas at Austin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // ...
utcompling/textgrounder
src/main/scala/opennlp/textgrounder/geolocate/TwitterDoc.scala
Scala
apache-2.0
3,069
object ServiceLane extends App { val lines = io.Source.stdin.getLines().toList val lanes = lines(1).split(" ").map(_.toInt) val segments = lines.drop(2) val vehicles = segments.map(width(lanes, _)) println(vehicles.mkString("\\n")) def width(lanes: Array[Int], inputLane: String): Int = { val arr = inpu...
PaulNoth/hackerrank
practice/algorithms/implementation/service_lane/ServiceLane.scala
Scala
mit
395
package be.angelcorp.glsl.util import scala.reflect.macros.whitebox.Context trait GlslType { def simpleName: String def location: String def qualifiedName = { if (location.isEmpty) simpleName else location + "." + simpleName } def toTypeName[C <: Context](c: C): c.universe.TypeName def toTypeTree[C...
AODtorusan/scala-glsl
macros/src/main/scala/be/angelcorp/glsl/util/GlslType.scala
Scala
mit
3,713
package me.yingrui.segment.tools import org.junit.Assert._ import org.junit.Test import me.yingrui.segment.concept.Concept import me.yingrui.segment.dict.{UnknownWord, IWord, POSUtil} class WordToStringTest { var posAndFreq = new Array[Array[Int]](2) posAndFreq(0) = new Array[Int](2) posAndFreq(0)(0) = POSUtil...
yingrui/mahjong
lib-segment/src/test/scala/me/yingrui/segment/tools/WordToStringTest.scala
Scala
gpl-3.0
2,366
/* * Copyright 2013 - 2020 Outworkers Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
outworkers/phantom
phantom-monix/src/test/scala/com/outworkers/phantom/monix/SelectFunctionsTesting.scala
Scala
apache-2.0
12,316
/** * PolybufConfig.scala * * Created on 18.05.2013 */ package at.pria.koza.polybuf import java.util.HashMap import java.util.Map import com.google.protobuf.ExtensionRegistry /** * <p> * A `PolybufConfig` encapsulates `PolybufIO`s for different object types, each identified by an `Int` that * corresponds to t...
SillyFreak/Polybuf
src/main/scala/at/pria/koza/polybuf/PolybufConfig.scala
Scala
bsd-3-clause
1,236
package scalariform.lexer import scala.util.parsing.input._ import scalariform.lexer.Tokens._ class ScalaLexerReader(val tokens: List[Token]) extends Reader[Token] { def first: Token = tokens.head def rest: Reader[Token] = new ScalaLexerReader(tokens.tail) def pos: Position = new ScalaLexerPosition(first) ...
mdr/scalariform
scalariform/src/main/scala/scalariform/lexer/ScalaLexerReader.scala
Scala
mit
625
package com.socrata.bq.query import com.google.api.services.bigquery.model.{TableRow, GetQueryResultsResponse} import com.socrata.datacoordinator.{Row, MutableRow} import com.socrata.datacoordinator.util.CloseableIterator import com.socrata.datacoordinator.id.{ColumnId, UserColumnId} import com.socrata.bq.soql._ impor...
socrata-platform/soql-bigquery-adapter
soql-server-bq/src/main/scala/com/socrata/bq/query/BBQRowReader.scala
Scala
apache-2.0
4,907
type Rand[+A] = RNG => (A, RNG) // important here!!! val int: Rand[Int] = _.nextInt //maybe for Double: val double: Rand[Double] = _.nextDouble //ζˆ‘δΉ‹ε‰ζœ‰ε†™θΏ‡nextDoubleε—οΌŸ def unit[A](a: A): Rand[A] = rng => (a, rng) def map[A, B](s: Rand[A])(f: A => B): Rand[B] = rng => { val (a, rng2) = s(rng) ...
Tomcruseal/FunctionalLearn
fpinscala/src/main/scala/fpinScala/fpState/stateAction.scala
Scala
mit
2,070
package org.greencheek.web.filter.memcached import java.io.File import org.apache.catalina.Context import org.apache.catalina.LifecycleException import org.apache.catalina.LifecycleState import org.apache.catalina.Wrapper import org.apache.catalina.core.StandardContext import org.apache.catalina.deploy.FilterDef imp...
tootedom/tomcat-memcached-response-filter
src/integration-test/scala/org/greencheek/web/filter/memcached/TomcatServerIT.scala
Scala
apache-2.0
5,689
import scala.quoted.* import scala.quoted.staging.* import liftable.Units.* import liftable.Lets.* import liftable.Loops.* import liftable.Lists.* import liftable.Exprs.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val liftedUnit: E...
dotty-staging/dotty
tests/run-staging/quote-lib.scala
Scala
apache-2.0
5,811
/*********************************************************************** * 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...
boundlessgeo/geomesa
geomesa-spark/geomesa-spark-sql/src/test/scala/org/locationtech/geomesa/spark/SparkSQLGeometryProcessingFunctionsTest.scala
Scala
apache-2.0
2,988
package com.danielasfregola.twitter4s.entities.v2.enums.expansions object UserExpansions extends Enumeration { type UserExpansions = Value val PinnedTweetId = Value("pinned_tweet_id") }
DanielaSfregola/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/enums/expansions/UserExpansions.scala
Scala
apache-2.0
192
/* * Copyright 2016 Dennis Vriend * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
prettynatty/akka-persistence-jdbc
src/test/scala/akka/persistence/jdbc/journal/JdbcJournalSpec.scala
Scala
apache-2.0
2,843
package com.prezi.haskell.gradle.model import java.io.File import com.prezi.haskell.gradle.ApiHelper._ import com.prezi.haskell.gradle.tasks.StackPathTask import org.gradle.api.{GradleException, Project} import scala.io.Source abstract class Sandbox(val root: File) { val extractionRoot: File = root def packag...
prezi/gradle-haskell-plugin
src/main/scala/com/prezi/haskell/gradle/model/Sandbox.scala
Scala
apache-2.0
1,357
package com.sfxcode.sapphire.extension.showcase.controller.table import com.sfxcode.sapphire.`extension`.report.{ FXBeanDataSource, PdfExporter } import com.sfxcode.sapphire.core.value.{ BeanConversions, FXBean } import com.sfxcode.sapphire.extension.controller.DataTableController import com.sfxcode.sapphire.extension...
sfxcode/sapphire-extension
demos/showcase/src/main/scala/com/sfxcode/sapphire/extension/showcase/controller/table/PersonTableController.scala
Scala
apache-2.0
2,324
/* * The MIT License * * Copyright (c) 2016 Fulcrum Genomics LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to us...
fulcrumgenomics/dagr
tasks/src/main/scala/dagr/tasks/picard/IntervalListToBed.scala
Scala
mit
1,604
package akka.contrib.construct import akka.actor.{Cancellable, Scheduler} import scala.concurrent.ExecutionContext import scala.concurrent.duration._ import scala.util.Try /** * Performs scheduling only when asked for, rather than based on the given [[Duration]]. */ class ManualScheduler extends Scheduler { pri...
jeffmay/akka-construct
akkaConstructTest/src/main/scala/akka/contrib/construct/ManualScheduler.scala
Scala
apache-2.0
4,127
package scala.collection.immutable import org.junit.Assert._ import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 @RunWith(classOf[JUnit4]) class TreeSetTest { @Test def hasCorrectDropAndTakeMethods() { val set = TreeSet(1, 2, 3) assertEquals(TreeSet.empty[Int], set take...
felixmulder/scala
test/junit/scala/collection/immutable/TreeSetTest.scala
Scala
bsd-3-clause
501
/* * Copyright 2016 Coral realtime streaming analytics (http://coral-streaming.github.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...
coral-streaming/coral
src/test/scala/io/coral/utils/NameSuggesterSpec.scala
Scala
apache-2.0
2,178
package helpers import nl.surfnet.nsiv2.messages.CorrelationId import nl.surfnet.safnari.Uuid @org.junit.runner.RunWith(classOf[org.specs2.runner.JUnitRunner]) abstract class Specification extends org.specs2.mutable.Specification with org.specs2.matcher.XmlMatchers with org.specs2.execute.PendingUntilFixe...
BandwidthOnDemand/nsi-safnari
test/helpers/Specification.scala
Scala
bsd-3-clause
759
package org.openurp.edu.eams.teach.lesson.task.experiment import ch.qos.logback.core.status.Status class LessonGenProgressBar extends AbstractAjaxProgressBar { var planCount: Int = _ def start() { notify(Status.GOOD, "ηŽ°εœ¨εΌ€ε§‹η”Ÿζˆδ»»εŠ‘", false, new Pair[String, String]("total", planCount + "")) } overri...
openurp/edu-eams-webapp
schedule/src/main/scala/org/openurp/edu/eams/teach/lesson/task/experiment/LessonGenProgressBar.scala
Scala
gpl-3.0
432
/* Copyright 2012 Denis Bardadym 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 ...
Khalith-Basha/demo
src/main/scala/code/model/UserDoc.scala
Scala
apache-2.0
6,479
package scala.meta package internal.hosts.scalac package converters import scala.tools.nsc.{Global => ScalaGlobal} import scala.meta.semantic.{Context => ScalametaSemanticContext} abstract class Api(global: ScalaGlobal) extends ToM with ToMannot with ToMmember with ToMtree with ToMtype with ToG with...
mdemarne/scalahost
interface/src/main/scala/scala/meta/internal/hosts/scalac/converters/Api.scala
Scala
bsd-3-clause
464
package controllers.helper import auth.UserToken import base.TestBaseDefinition import org.scalatest.WordSpec import play.api.test.FakeRequest class RequestOpsSpec extends WordSpec with TestBaseDefinition with RequestOps { "A RequestOpsSpec" should { "build query strings by using paths" in { val fake = F...
THK-ADV/lwm-reloaded
test/controllers/helper/RequestOpsSpec.scala
Scala
mit
2,206
package provingground.learning import provingground._, HoTT._ import provingground.{FiniteDistribution => FD} import monix.eval._ import math._ import scala.concurrent._, duration._ import scala.math.Ordering.Double.TotalOrdering /** * A collection of functions to build provers; * some are abstract methods fo...
siddhartha-gadgil/ProvingGround
core/src/main/scala/provingground/learning/FineProverTasks.scala
Scala
mit
16,438
package org.concurrency.ch7 import scala.concurrent._ import ExecutionContext.Implicits.global import scala.concurrent.stm._ class MVar[T] { private val v = Ref[T](null.asInstanceOf[T]) def put(x:T)(implicit txn: InTxn): Unit = { if(v() == null) v() = x else retry } def take()(implicit txn: InTxn): ...
marcos-sb/concurrent-programming-scala
src/main/scala-2.11/org/concurrency/ch7/MVar.scala
Scala
apache-2.0
1,135
/* * Copyright 2013 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 applica...
anthonyccri/geomesa
geomesa-core/src/test/resources/geomesa-scala-setup.scala
Scala
apache-2.0
1,235
/* * 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
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnClusterSuite.scala
Scala
apache-2.0
31,418
/** * Copyright 2015 Peter Nerg * * 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...
pnerg/java-scala-util-converter
src/test/scala/javascalautils/converters/s2j/ConvertersFutureSuite.scala
Scala
apache-2.0
2,530
import com.google.inject.{Guice, AbstractModule} import play.api.GlobalSettings /** * Set up the Guice injector and provide the mechanism for return objects from the dependency graph. */ object Global extends GlobalSettings { /** * Bind types such that whenever UUIDGenerator is required, an instance of SimpleU...
HiP-App/HiPBackend
app/Global.scala
Scala
apache-2.0
866
/* * Copyright 2013 Stephan Rehfeld * * 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 ...
stephan-rehfeld/scaladelray
src/main/scala/scaladelray/ui/model/WorldProvider.scala
Scala
apache-2.0
4,119
/* * Copyright 2011-2022 GatlingCorp (https://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...
gatling/gatling
gatling-http/src/main/scala/io/gatling/http/util/HttpHelper.scala
Scala
apache-2.0
7,139
/** * Copyright (c) 2013-2015 Patrick Nicolas - Scala for Machine Learning - All rights reserved * * The source code in this file is provided by the author for the sole purpose of illustrating the * concepts and algorithms presented in "Scala for Machine Learning". It should not be used to build commercial applic...
batermj/algorithm-challenger
books/cs/machine-learning/scala-for-machine-learning/1rst-edition/original-src-from-the-book/src/test/scala/org/scalaml/app/chap9/BinaryMLPEval.scala
Scala
apache-2.0
3,262
package com.velorin.conceptmining import edu.cmu.lti.ws4j.util.PorterStemmer import opennlp.tools.cmdline.parser.ParserTool import opennlp.tools.parser.Parse import opennlp.tools.parser.Parser import opennlp.tools.parser.ParserFactory import opennlp.tools.parser.ParserModel import opennlp.tools.sentdetect.SentenceDete...
AmirHooshangi/ACMG-S
src/main/scala/com/velorin/conceptmining/NLPConceptMiner.scala
Scala
gpl-3.0
2,925
import play.api.data.format.Formatter import play.api.libs.json.Json.stringify import play.modules.reactivemongo.Formatters._ import reactivemongo.api.bson._ import reactivemongo.play.json.compat.ValueConverters final class FormatterSpec extends org.specs2.mutable.Specification { "Play Formatters".title "String...
ReactiveMongo/Play-ReactiveMongo
src/test/scala/FormatterSpec.scala
Scala
apache-2.0
5,873
package sms import com.google.inject.{Inject, Singleton} import com.twilio.Twilio import com.twilio.`type`.PhoneNumber import com.twilio.rest.api.v2010.account.Message import play.api.{Configuration, Logger} @Singleton class TwilioSMSImpl @Inject()(config: Configuration) extends SMSService { val accountSid = confi...
digitalinteraction/intake24
ApiPlayServer/app/sms/TwilioSMSImpl.scala
Scala
apache-2.0
1,386
package sprawler.crawler.actor import sprawler.crawler.url.CrawlerUrl import scala.reflect._ import akka.actor.ActorRef import spray.http.HttpResponse import scala.util.Try import scala.concurrent.Future /** * Crawls, finds links, sends them to [[sprawler.crawler.actor.LinkScraperWorker.master]] * to queue, an...
daniel-trinh/sprawler
src/main/scala/sprawler/crawler/actor/LinkScraperWorker.scala
Scala
mit
1,832
/* * 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 ...
bwsw/cs-vault-server
src/main/scala/com/bwsw/cloudstack/vault/server/cloudstack/entities/UserResponse.scala
Scala
apache-2.0
1,177
package com.github.jlprat.ninetynine.p10 /** * Created by @jlprat on 02/03/2016. * P10: Run-length encoding of a list (Consecutive duplicates of elements are encoded as tuples (N, E) where * N is the number of duplicates of the element E). Use pack method specified in P09 * Difficulty: * */ object P10 { /...
jlprat/99-scala-problems
src/main/scala/com/github/jlprat/ninetynine/p10/P10.scala
Scala
apache-2.0
1,052
import collection.immutable.SortedMap object Test { implicit val ord: Ordering[Array[Byte]] = Ordering.by((_: Array[Byte]).toIterable) def main(args: Array[String]): Unit = { val m = SortedMap(Array[Byte](1) -> 0) println(m.to(Array[Byte](1)) flatMap (_._1.mkString)) println(m.from(Array[Byte](1)) fla...
folone/dotty
tests/run/t4930.scala
Scala
bsd-3-clause
348
/* * Sentilab SARE: a Sentiment Analysis Research Environment * Copyright (C) 2013 Sabanci University Sentilab * http://sentilab.sabanciuniv.edu * * This file is part of SARE. * * SARE is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published b...
musabhusaini/sare
sare-lib/modules/utils/src/test/scala/edu/sabanciuniv/sentilab/utils/tests/UtilsTest.scala
Scala
gpl-3.0
1,339
package lang.lightweightjava.ast.statement import lang.lightweightjava.ast._ import name.namegraph.NameGraphExtended import name.{Identifier, Renaming} case class FieldRead(target: VariableName, sourceObject: TermVariable, sourceField: Identifier) extends Statement { require(AST.isLegalName(sourceField.name), "Fiel...
matthisk/hygienic-transformations
scala/src/main/scala/lang/lightweightjava/ast/statement/FieldRead.scala
Scala
lgpl-3.0
3,191
package net.fwbrasil.activate.entity.id import org.joda.time.DateTime import java.util.Date import java.lang.reflect.ParameterizedType import net.fwbrasil.activate.entity.BaseEntity import net.fwbrasil.activate.entity.EntityHelper import scala.Array.canBuildFrom import net.fwbrasil.activate.util.uuid.UUIDUtil import n...
avramirez/activate
activate-core/src/main/scala/net/fwbrasil/activate/entity/id/EntityId.scala
Scala
lgpl-2.1
7,918
package interpreter import javax.naming.Context object LispMachine { // The expressions building up the universal Lisp Function, and some easy // to handle chunks for unit testing :) val equal = "equal[x;y]=[" + "atom[x]→[atom[y]→eq[x;y]; T→F];" + "atom[y]→F;" + // BUG in the original paper. "equa...
cdegroot/Parens
src/main/scala/interpreter/LispMachine.scala
Scala
unlicense
2,751
package finatra.controllers import com.github.pedrovgs.haveaniceday.smiles.model.Smile import com.github.pedrovgs.haveaniceday.smiles.{GetRandomSmile, GetSmileById, GetSmiles} import com.github.pedrovgs.haveaniceday.utils.model.{InvalidQuery, ItemNotFound, Query, QueryResult} import com.twitter.finagle.http.Status imp...
pedrovgs/HaveANiceDay
src/test/scala/finatra/controllers/SmilesControllerSpec.scala
Scala
gpl-3.0
5,453
package org.littlewings.infinispan.query.affinityindex import org.apache.lucene.analysis.ja.JapaneseAnalyzer import org.hibernate.search.annotations.{Analyze, Analyzer, Field, Indexed} import scala.beans.BeanProperty object Book { def apply(isbn: String, title: String, price: Int): Book = { val book = new Book...
kazuhira-r/infinispan-getting-started
embedded-query-affinity-index/src/main/scala/org/littlewings/infinispan/query/affinityindex/Book.scala
Scala
mit
682
import _root_.io.gatling.core.scenario.Simulation import ch.qos.logback.classic.{Level, LoggerContext} import io.gatling.core.Predef._ import io.gatling.http.Predef._ import org.slf4j.LoggerFactory import scala.concurrent.duration._ /** * Performance test for the RefStatutCompagne entity. */ class RefStatutCompagne...
bzinoun/cream
src/test/gatling/simulations/RefStatutCompagneGatlingTest.scala
Scala
apache-2.0
3,431
package learningeff.elementary import cats.data._ import cats.implicits._ import ReaderT._ import WriterT._ object Prob01Pass07 { def main(args: Array[String]): Unit = { val program = printHelloWorld // at the end of the world program.run(AppConfig.default).run match { case Left(e) ...
zach-albia/learning-eff
problems/elementary/prob1/src/main/scala/learningeff/elementary/Prob01Pass07.scala
Scala
mit
1,418
/* * Copyright 2013 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...
AndreasPetter/storehaus
storehaus-algebra/src/main/scala/com/twitter/storehaus/algebra/query/QueryStrategy.scala
Scala
apache-2.0
4,331
/* * Copyright 2016 The BigDL Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
jenniew/BigDL
spark/dl/src/test/scala/com/intel/analytics/bigdl/dataset/TransformersSpec.scala
Scala
apache-2.0
42,971
/* NSC -- new Scala compiler * Copyright 2005-2014 LAMP/EPFL * @author Martin Odersky */ package scala.tools.nsc package backend.jvm package opt import scala.annotation.{tailrec, switch} import scala.collection.mutable import scala.reflect.internal.util.Collections._ import scala.tools.asm.commons.CodeSizeEvalua...
felixmulder/scala
src/compiler/scala/tools/nsc/backend/jvm/opt/BytecodeUtils.scala
Scala
bsd-3-clause
16,126
package info.glennengstrand.io import java.util.{Properties, Calendar} import org.apache.kafka.clients.producer.{ProducerRecord, Producer, KafkaProducer} import java.util.logging.{Level, Logger} /** responsible for logging performance data to kafka */ class Kafka extends PerformanceLogger { val log = Logger.getLogg...
Krasnyanskiy/clojure-news-feed
server/feed2/src/main/scala/info/glennengstrand/io/Kafka.scala
Scala
epl-1.0
1,355
/* __ *\ ** ________ ___ / / ___ Scala API ** ** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/...
jmnarloch/scala-js
scalalib/overrides/scala/collection/mutable/ArrayBuilder.scala
Scala
bsd-3-clause
20,596
import scalaz._ import scalaz.Free.FreeC import scalaz.Id.Id package object authz { type InterpreterF[F[_]] = Command ~> F type Interpreter = InterpreterF[Id] private[authz] def freeCMonad[F[_]] = Free.freeMonad[({type l[a] = Coyoneda[F, a]})#l] // https://github.com/scalaz/scalaz/blob/5904d7f6/core/src...
gakuzzzz/authz
src/main/scala/authz/package.scala
Scala
mit
883
package net.sansa_stack.rdf.spark.rdd.op import org.apache.jena.query.{Dataset, DatasetFactory, Query, QueryExecutionFactory} import org.apache.jena.rdf.model.Model import org.apache.spark.HashPartitioner import org.apache.spark.rdd.RDD /** * Operations on the RDD[(String, Model)] type. * * The naming "RddOfNamedM...
SANSA-Stack/SANSA-RDF
sansa-rdf/sansa-rdf-spark/src/main/scala/net/sansa_stack/rdf/spark/rdd/op/RddOfNamedModelsOps.scala
Scala
apache-2.0
3,557
package org.jetbrains.plugins.scala package caches import lang.psi.types.result.TypeResult import com.intellij.psi._ import lang.psi.api.toplevel.typedef.{ScObject, ScTypeDefinition} import lang.psi.api.expr.ScExpression.ExpressionTypeResult import lang.psi.api.base.types.ScTypeElement import com.intellij.openapi.uti...
consulo/consulo-scala
src/org/jetbrains/plugins/scala/caches/CachesUtil.scala
Scala
apache-2.0
14,636
package scala.collection.mutable import scala.collection._ import scala.language.higherKinds trait BagLike[A, +This <: mutable.Bag[A] with mutable.BagLike[A, This]] extends scala.collection.BagLike[A, This] with generic.Subtractable[A, This] with generic.GrowableBag[A] { self => final protected override ty...
sageserpent-open/multisets
src/main/scala/scala/collection/mutable/BagLike.scala
Scala
bsd-3-clause
480
/** * @author Yuuto */ package yuuto.inventorytools.items import java.util.List import cpw.mods.fml.common.eventhandler.SubscribeEvent import cpw.mods.fml.relauncher.SideOnly import net.minecraft.block.Block import net.minecraft.creativetab.CreativeTabs import net.minecraft.entity.item.EntityItem import net.minecraf...
AnimeniacYuuto/InventoryTools
src/main/scala/yuuto/inventorytools/items/ItemDolly.scala
Scala
gpl-3.0
8,130
/* * This file is part of Kiama. * * Copyright (C) 2011-2015 Anthony M Sloane, Macquarie University. * * Kiama 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 3 of the License, or ...
solomono/kiama
library/src/org/kiama/example/oberon0/L0/NameAnalyser.scala
Scala
gpl-3.0
9,573
package org.jetbrains.plugins.scala package lang package parser package parsing package statements import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes import org.jetbrains.plugins.scala.lang.parser.parsing.base.Modifier import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder import org...
jastice/intellij-scala
scala/scala-impl/src/org/jetbrains/plugins/scala/lang/parser/parsing/statements/PatVarDef.scala
Scala
apache-2.0
1,633
package featherbed import java.net.URL import com.twitter.finagle.{Filter, Http} import com.twitter.finagle.http.{Request, Response} import org.scalamock.matchers.Matcher import org.scalamock.scalatest.MockFactory package object fixture { private[fixture] class MockClient ( baseUrl: URL, filter: Filter[Req...
jeremyrsmith/featherbed
featherbed-core/src/test/scala/featherbed/fixture/package.scala
Scala
apache-2.0
1,073
/* * Copyright 2017-2020 47 Degrees Open Source <https://www.47deg.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 ...
scala-exercises/exercises-monocle
src/main/scala/monocle/PrismExercises.scala
Scala
apache-2.0
7,031
import scala.util.FromDigits object Test extends App { val x: BigInt = 13232202002020202020202 // error val z: BigDecimal = 132322020020.223 case class Even(n: Int) given FromDigits[Even] with { def fromDigits(digits: String): Even = { val intValue = digits.toInt if (intValue % 2 == 0) Even(...
lampepfl/dotty
tests/neg/genericNumbers.scala
Scala
apache-2.0
888
package scala.scalanative package nir package parser import fastparse.all._ object Comp extends Base[nir.Comp] { val Ieq = P("ieq".! map (_ => nir.Comp.Ieq)) val Ine = P("ine".! map (_ => nir.Comp.Ine)) val Ugt = P("ugt".! map (_ => nir.Comp.Ugt)) val Uge = P("uge".! map (_ => nir.Comp.Uge)) val Ult = P("u...
cedricviaccoz/scala-native
tools/src/main/scala/scala/scalanative/nir/parser/Comp.scala
Scala
bsd-3-clause
1,005
package controllers import java.util.UUID import scala.concurrent.Await import scala.concurrent.duration.FiniteDuration import java.util.concurrent.TimeUnit import play.api.libs.ws.WS import play.api.libs.json.Json import play.api.test.Helpers._ import org.specs2.Specification object ITHelper { val host = "http://...
radek1st/trip-planner
test/controllers/ITHelper.scala
Scala
apache-2.0
1,851
/* * Copyright 2017 Spotify AB. * * 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 ...
spotify/featran
core/src/test/scala/com/spotify/featran/CrossingSpec.scala
Scala
apache-2.0
5,890
/* * Copyright 2012 The Clustermeister Team. * * 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...
nethad/clustermeister
integration-tests/src/main/scala/com/github/nethad/clustermeister/integration/sc08/SProxyBootstrap.scala
Scala
apache-2.0
1,619
/* * Copyright 2021 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or a...
hmrc/amls-frontend
test/utils/AmlsSpec.scala
Scala
apache-2.0
4,232
import scala.io.Source object EntryPoint { def main(args: Array[String]) { val lexicon = new Lexicon println("Vocab size: " + lexicon.vocab.size) val grammar = new Grammar("example/CFG.txt") var tokens = Source.fromFile("example/sentence.txt").getLines().next().split(" ") val table = new WFST(gr...
seanbethard/scala-wfst
src/EntryPoint.scala
Scala
mit
362
package utils.auth import com.mohiva.play.silhouette.api.actions.UnsecuredErrorHandler import play.api.mvc.{ RequestHeader, Result } import play.api.mvc.Results._ import scala.concurrent.Future /** * Custom unsecured error handler. */ class CustomUnsecuredErrorHandler extends UnsecuredErrorHandler { /** * Ca...
vetafi/vetafi-web
app/utils/auth/CustomUnsecuredErrorHandler.scala
Scala
apache-2.0
690
/* * * * Copyright 2020 Lenses.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 app...
datamountaineer/stream-reactor
kafka-connect-common/src/main/scala/com/datamountaineer/streamreactor/common/serialization/AvroSerializer.scala
Scala
apache-2.0
2,279
package com.soundcloud.spdt import org.rogach.scallop._ import org.slf4j.LoggerFactory object Application extends App { override def main(args: Array[String]) { val log = LoggerFactory.getLogger(this.getClass) def report( name: String, tp: Double, tn: Do...
soundcloud/spdt
compute/src/main/scala/com.soundcloud.spdt/Application.scala
Scala
mit
7,513
package fb import spray.json._ object Models { val n: Int = 1000000 import spray.json.DefaultJsonProtocol object MyJsonProtocol extends DefaultJsonProtocol { implicit val userFormat = jsonFormat2(User) implicit val pageFormat = jsonFormat2(Page) implicit val postFormat = jsonFormat6(Post) } s...
BabakAp/ProjectFB
src/main/scala/fb/Models.scala
Scala
apache-2.0
1,308
package chapter16 /** * 16.5 리슀트 νŒ¨ν„΄ * * νŒ¨ν„΄ 맀치λ₯Ό μ‚¬μš©ν•΄ 각 λΆ€λΆ„μœΌλ‘œ λ‚˜λˆŒ 수 μžˆλ‹€. * * νŒ¨ν„΄μ—μ„œ p op q 같은 μ€‘μœ„ μ—°μ‚°μžλŠ” op(p, q) 와 κ°™λ‹€. * 즉 μŠ€μΉΌλΌλŠ” μ€‘μœ„ μ—°μ‚°μžλ₯Ό μƒμ„±μž νŒ¨ν„΄μœΌλ‘œ 닀룬닀. * 특히 x :: xs 같은 콘즈 νŒ¨ν„΄μ€ ::(x, xs)둜 바뀐닀. μ΄λŠ” 이 νŒ¨ν„΄μ˜ μƒμ„±μžμ— ν•΄λ‹Ήν•˜λŠ” * ::λΌλŠ” ν΄λž˜μŠ€κ°€ μžˆμ–΄μ•Όλ§Œ 함을 λ„Œμ§€μ‹œ μ•Œλ €μ€€λ‹€. scala.::κ°€ μ‘΄μž¬ν•˜λ©°, λΉ„μ–΄μžˆμ§€ μ•Šμ€ 리슀트λ₯Ό * λ§Œλ“œλŠ” ν΄λž˜μŠ€λ‹€. scala νŒ¨ν‚€μ§€ μ•Šμ—μžˆλŠ” ::, List 클래슀의 λ©”μ†Œλ“œ :: 두 κ°€μ§€λ‘œ...
seraekim/srkim-lang-scala
src/main/java/chapter16/c16_i05.scala
Scala
bsd-3-clause
1,412
/* * Copyright 2013-2015 Websudos, Limited. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of c...
analytically/phantom
phantom-dsl/src/main/scala/com/websudos/phantom/builder/query/prepared/PreparedBuilder.scala
Scala
bsd-2-clause
2,336
package io.monadless.impl import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context import org.scalamacros.resetallattrs._ import language.higherKinds import scala.reflect.macros.TypecheckException private[monadless] trait TestSupport[M[_]] { def get[T](m: M[T]): T def showTree[T](t: ...
monadless/monadless
monadless-core/src/main/scala/io/monadless/impl/TestSupport.scala
Scala
apache-2.0
2,010
package spark import java.io._ import org.apache.mesos._ import org.apache.mesos.Protos._ import scala.collection.mutable.Map import scala.collection.mutable.ArrayBuffer trait UpdatedProgressModifier[G,T] extends Serializable { def zero(initialValue: T): T def updateLocalDecideSend(oldVar: UpdatedProgress[G,T], ...
jperla/spark-advancers
core/src/main/scala/spark/weakshared/weakshared.scala
Scala
bsd-3-clause
4,183
/* * Copyright 2013 - 2020 Outworkers Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
outworkers/phantom
phantom-dsl/src/test/scala/com/outworkers/phantom/builder/serializers/BasicQueryBuilderTest.scala
Scala
apache-2.0
2,532
package net.node3.scalabot.plugins.weather case class Clouds(val all: Int)
nadams/scalabot
src/main/scala/plugins/weather/Clouds.scala
Scala
mit
76
/* 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...
twitter/bijection
bijection-core/src/main/scala/com/twitter/bijection/ImplicitBijection.scala
Scala
apache-2.0
1,641
package com.sksamuel.avro4s import java.util import org.apache.avro.{JsonProperties, LogicalTypes, Schema, SchemaBuilder} import shapeless.ops.coproduct.Reify import shapeless.ops.hlist.ToList import shapeless.{:+:, CNil, Coproduct, Generic, HList, Lazy} import scala.annotation.implicitNotFound import scala.collecti...
YuvalItzchakov/avro4s
avro4s-macros/src/main/scala/com/sksamuel/avro4s/SchemaFor.scala
Scala
mit
17,854
package V2 /** * We can't apply the same trick (fresh env) we did for the F1WAE before, to enforce static scoping. * This is because in first-class languages, functions can appear e.g within a Let construct. Consider * the following example: * * With('x, 3, App(Fun('y, Add('x, 'y)), 4)) * * Using a fresh env...
Tooa/interpreters
src/V2/FWAEStaticInterp.scala
Scala
apache-2.0
3,240
package com.twitter.inject.utils abstract class Handler { /** Executes the function of this handler. **/ def handle(): Unit }
twitter/finatra
inject/inject-utils/src/main/scala/com/twitter/inject/utils/Handler.scala
Scala
apache-2.0
132
package nodes.learning import breeze.linalg._ import org.apache.spark.SparkContext import org.scalatest.FunSuite import workflow.PipelineContext import utils.{MatrixUtils, Stats} class KernelModelSuite extends FunSuite with PipelineContext { test("KernelModel XOR test") { sc = new SparkContext("local", "test...
tomerk/keystone
src/test/scala/nodes/learning/KernelModelSuite.scala
Scala
apache-2.0
2,408