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 eventstreams /* * Copyright 2014-15 Intelix Pty 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...
intelix/eventstreams
es-sources/es-source-file/src/test/scala/eventstreams/FileTailerEventsourceTest.scala
Scala
apache-2.0
75,348
package org.jetbrains.plugins.scala.lang.parameterInfo.functionParameterInfo package generated class FunctionParameterInfoApplyTest extends FunctionParameterInfoTestBase { //This class was generated by build script, please don't change this override def folderPath: String = super.folderPath + "apply/" def testC...
LPTK/intellij-scala
test/org/jetbrains/plugins/scala/lang/parameterInfo/functionParameterInfo/generated/FunctionParameterInfoApplyTest.scala
Scala
apache-2.0
586
package io.youi.theme import io.youi.component.feature._ import io.youi.{CSSManager, Unique} import org.scalajs.dom.raw.CSSStyleDeclaration import scala.annotation.tailrec trait Theme extends FeatureParent { def selector: String = s".${getClass.getSimpleName.replace("$", "")}" def className: Option[String] = Th...
outr/youi
gui/src/main/scala/io/youi/theme/Theme.scala
Scala
mit
3,336
package dao import java.util.Date import javax.inject.{ Inject, Singleton } import play.api.db.slick.DatabaseConfigProvider import slick.jdbc.JdbcProfile import models.{GithubUserSlick, GithubUser} import scala.concurrent.{ Future, ExecutionContext } @Singleton class GithubUserDAO @Inject() (dbConfigProvider: Dat...
malaman/scala-weather-app
api/app/dao/GithubUserDAO.scala
Scala
mit
2,442
/* * 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 ...
tmckayus/oshinko-s2i
test/images/scala/test-app/src/main/scala/org/apache/spark/examples/SparkPi.scala
Scala
apache-2.0
1,540
package forimpatient.chapter08 import scala.collection.mutable.ArrayBuffer /** * Created by Iryna Kharaborkina on 8/6/16. * * Solution to the Chapter 08 Exercise 04 'Scala for the Impatient' by Horstmann C.S. * * Define an abstract class Item with methods price and description. A SimpleItem is an item * ...
Kiryna/Scala-for-the-Impatient
src/forimpatient/chapter08/Exercise04.scala
Scala
apache-2.0
1,388
package com.productfoundry.akka.cqrs /** * Revision check failure. * * @param expected revision. * @param actual revision. */ case class RevisionConflict(expected: AggregateRevision, actual: AggregateRevision) extends AggregateUpdateFailure
Product-Foundry/akka-cqrs
core/src/main/scala/com/productfoundry/akka/cqrs/RevisionConflict.scala
Scala
apache-2.0
279
package com.twitter.finagle.postgres.values import com.twitter.finagle.postgres.Spec import org.jboss.netty.buffer.{ChannelBuffer, ChannelBuffers} import org.scalatest.prop.GeneratorDrivenPropertyChecks import com.twitter.finagle.postgres.Generators._ class UtilsSpec extends Spec with GeneratorDrivenPropertyChecks { ...
jeremyrsmith/finagle-postgres
src/test/scala/com/twitter/finagle/postgres/values/UtilsSpec.scala
Scala
apache-2.0
3,282
/* * 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 ...
goldmedal/spark
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/RowBasedHashMapGenerator.scala
Scala
apache-2.0
7,935
package models import java.text.SimpleDateFormat import java.util.Date import scala.collection.mutable.Map import scala.io.Codec.string2codec import scala.io.Source import play.api.libs.json.JsValue import play.api.libs.json.Json object RuruReader { /* * ここをいじると取得する村の種類がかわる */ implicit def jso...
drwhopper/danronlogger
app/models/RuruReader.scala
Scala
mit
1,042
/* * Copyright 2011-2019 Asakusa Framework 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 ...
ueshin/asakusafw-spark
tools/asm/src/test/scala/com/asakusafw/spark/tools/asm/ClassBuilderSpec.scala
Scala
apache-2.0
7,392
/* 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...
epishkin/scalding
scalding-commons/src/main/scala/com/twitter/scalding/commons/source/TsvWithHeader.scala
Scala
apache-2.0
3,546
/* * 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 ...
Intel-bigdata/OAP
oap-data-source/arrow/standard/src/main/scala/com/intel/oap/spark/sql/execution/datasources/v2/arrow/ArrowTable.scala
Scala
apache-2.0
2,138
package nofs.restfs.query.ast class FSAction(act: String, file: String) { private val _action = act private val _fileName = file def getAction() = _action def getFileName() = _fileName }
megacoder/restfs
src/main/scala/nofs/restfs/query/ast/FSAction.scala
Scala
lgpl-2.1
206
package org.jetbrains.plugins.scala.failed.annotator import org.jetbrains.plugins.scala.PerfCycleTests import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter import org.junit.experimental.categories.Category /** * @author Roman.Shein * @since 28.03.2016. */ @Category(Array(classOf[PerfC...
jeantil/intellij-scala
test/org/jetbrains/plugins/scala/failed/annotator/OverridingAnnotatorTest2.scala
Scala
apache-2.0
775
/* 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...
zirpins/scalding
scalding-args/src/main/scala/com/twitter/scalding/Args.scala
Scala
apache-2.0
5,183
package collins.util import org.specs2.mutable._ object CodecSpec extends Specification { val username = "host-xyz123456-1937-1955-1394.dfw01.tumblr.net" val password = "hello:world:foofa:blahh:" val cryptoCodec = CryptoCodec(CryptoCodec.randomString(23)) "The Crypto Codec" should { "generate random str...
byxorna/collins
test/collins/util/CodecSpec.scala
Scala
apache-2.0
3,134
package com.elsevier.soda.messages case class LookupRequest (lexicon: String, id: String)
elsevierlabs-os/soda
src/main/scala/com/elsevier/soda/messages/LookupRequest.scala
Scala
apache-2.0
91
package controllers import models.{Asset,HierarchyInfo} import util.config.Feature import util.ApiTattler import play.api.libs.json._ import play.api.data._ import play.api.data.Forms._ import play.api.http.{Status => StatusValues} import play.api.libs.json.{JsBoolean, JsObject} import play.api.mvc.Results import jav...
Shopify/collins
app/controllers/HierarchyApi.scala
Scala
apache-2.0
4,019
/* * Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com> */ package controllers import play.api.mvc._ import javax.inject.Inject import scala.collection.JavaConverters._ import models._ class Application @Inject() (c: ControllerComponents) extends AbstractController(c) { def index = Action { Ok...
Shruti9520/playframework
framework/src/sbt-plugin/src/sbt-test/routes-compiler-plugin/routes-compilation/app/controllers/Application.scala
Scala
apache-2.0
1,337
/* * Copyright 2014-2022 Netflix, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
Netflix/atlas
atlas-core/src/main/scala/com/netflix/atlas/core/index/IndexStats.scala
Scala
apache-2.0
4,181
package com.datastax.spark.connector.writer import java.util.concurrent.Semaphore import org.apache.spark.Logging import com.google.common.util.concurrent.{FutureCallback, Futures, ListenableFuture, SettableFuture} import scala.collection.concurrent.TrieMap import scala.util.Try import AsyncExecutor.Handler /** As...
viirya/spark-cassandra-connector
spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/writer/AsyncExecutor.scala
Scala
apache-2.0
2,269
package org.scalatest import org.scalatest.prop.Tables trait FunctionSuiteExamples extends Tables { type FixtureServices def funSuite: FunSuite with FixtureServices def fixtureFunSuite: fixture.FunSuite with FixtureServices def funSpec: FunSpec with FixtureServices def fixtureFunSpec: fixture.FunSpec wi...
yyuu/scalatest
src/test/scala/org/scalatest/FunctionSuiteExamples.scala
Scala
apache-2.0
1,218
package org.scalaml.metrics import breeze.linalg.DenseVector import breeze.numerics.{ pow, sqrt } import org.scalatest.{ FlatSpec, Matchers } /** * Created by domesc on 20/11/16. */ class DistanceTests extends FlatSpec with Matchers { "euclidean distance" should "compute the right distance" in { val distance...
domesc/ScalaML
src/test/scala/org/scalaml/metrics/DistanceTests.scala
Scala
apache-2.0
1,846
/* * 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 ...
jkbradley/spark
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
Scala
apache-2.0
34,537
package com.tsukaby.bean_validation_scala import org.hibernate.validator.constraints.URL import scala.annotation.meta.field class URLValidatorForOptionSpec extends BaseSpec { private[this] case class TestBean( @(URL@field) value: Option[Str...
bean-validation-scala/bean-validation-scala
src/test/scala/com/tsukaby/bean_validation_scala/URLValidatorForOptionSpec.scala
Scala
mit
612
package sampler.r import java.nio.file.Path import scala.language.implicitConversions import sampler.io.CSV object QuickPlot { private implicit def pathToString(p:Path) = p.toString() private def buildScript(fileName: String, width:String, height:String, lines: String*) = { val builder = new StringBuilde...
tsaratoon/Sampler
sampler-core/src/main/scala/sampler/r/QuickPlot.scala
Scala
apache-2.0
2,905
package mesosphere.marathon package core.storage.store.impl import java.time.OffsetDateTime import akka.http.scaladsl.marshalling.{ Marshal, Marshaller } import akka.http.scaladsl.unmarshalling.{ Unmarshal, Unmarshaller } import akka.stream.Materializer import akka.stream.scaladsl.Source import akka.{ Done, NotUsed }...
natemurthy/marathon
src/main/scala/mesosphere/marathon/core/storage/store/impl/BasePersistenceStore.scala
Scala
apache-2.0
6,484
/* * Copyright 2022 Typelevel * * 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...
typelevel/sbt-typelevel
mergify/src/main/scala/org/typelevel/sbt/mergify/MergifyAction.scala
Scala
apache-2.0
1,819
/*********************************************************************** * Copyright (c) 2013-2017 Commonwealth Computer Research, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Apache License, Version 2.0 * which accompanies this distribution and...
ronq/geomesa
geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/iterators/IteratorTrigger.scala
Scala
apache-2.0
11,584
package org.scaladebugger.docs.layouts.partials.common.vendor import scalatags.Text.all._ /** * Represents a <link ... > containing highlight default.css. */ object HighlightCSS { /** * Creates highlight css link tag. * * @param theme The highlight.js theme to use * @return The link tag */ def ap...
ensime/scala-debugger
scala-debugger-docs/src/main/scala/org/scaladebugger/docs/layouts/partials/common/vendor/HighlightCSS.scala
Scala
apache-2.0
437
/*********************************************************************** * Copyright (c) 2013-2016 Commonwealth Computer Research, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Apache License, Version 2.0 * which accompanies this distribution and is ...
MutahirKazmi/geomesa
geomesa-filter/src/main/scala/org/locationtech/geomesa/filter/Bounds.scala
Scala
apache-2.0
5,818
/* * Copyright (C) 2017-present, Chenai Nakam(chenai.nakam@gmail.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 r...
chenakam/AutoTX
src/main/scala/hobby/chenai/nakam/autotx/core/Fee.scala
Scala
apache-2.0
1,749
/*********************************************************************** * Copyright (c) 2017-2019 IBM * Copyright (c) 2013-2019 Commonwealth Computer Research, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Apache License, Version 2.0 * which ac...
elahrvivaz/geomesa
geomesa-cassandra/geomesa-cassandra-datastore/src/main/scala/org/locationtech/geomesa/cassandra/data/CassandraBackedMetadata.scala
Scala
apache-2.0
3,716
package reader.data import rescala._ import scala.collection.mutable.Map /** * The FeedStore stores RSSChannels and RSSItems. * More specifically, it stores the relation between an RSS Item and its channel * to enable clients to ask e.g. for all items stored related to a specific channel. */ class FeedStore { ...
volkc/REScala
Examples/RSSReader/ReactiveScalaReader.Events/src/main/scala/reader/data/FeedStore.scala
Scala
apache-2.0
1,546
package org.openurp.edu.eams.teach.election.service.rule.election.filter import org.beangle.commons.collection.Collections import org.beangle.data.jpa.dao.OqlBuilder import org.openurp.edu.teach.code.CourseTakeType import org.openurp.edu.eams.teach.election.model.Enum.ElectRuleType import org.openurp.edu.eams.teach.e...
openurp/edu-eams-webapp
election/src/main/scala/org/openurp/edu/eams/teach/election/service/rule/election/filter/UniquePassRetakeFilter.scala
Scala
gpl-3.0
2,339
// Databricks notebook source // MAGIC %md // MAGIC // MAGIC # [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/) // COMMAND ---------- // MAGIC %md // MAGIC Archived YouTube video of this live unedited lab-lecture: // MAGIC // MAGIC [![Archived YouTube video of this live un...
lamastex/scalable-data-science
db/2/2/008_DiamondsPipeline_01ETLEDA.scala
Scala
unlicense
16,982
package skinny.validator import org.scalatest._ import org.scalatest.matchers._ class longValueSpec extends FlatSpec with ShouldMatchers { behavior of "longValue" it should "be available" in { val validate = longValue validate.name should equal("longValue") validate(param("id", "abc")).isSuccess sh...
BlackPrincess/skinny-framework
validator/src/test/scala/skinny/validator/longValueSpec.scala
Scala
mit
1,348
package controllers.crypto import play.api.mvc._ import play.api.libs.json.Json import rules.crypto.Crypto object CryptoController extends Controller { def updatekey = Action { request => val json = request.body.asJson.get val cipheredKey = (json \\ "key").asOpt[String] val signedKey = (json...
rtfpessoa/sirs2013_grades_submission
archive/app/controllers/crypto/CryptoController.scala
Scala
mit
1,284
package models import org.joda.time.DateTime case class Archetype( id: Option[Long], groupId: String, artifactId: String, version: String, description: Option[String], repository: Option[String], javaVersion: Option[String], packaging: Option[String], lastUpdated: DateTime, localDir: Option[String...
sne11ius/archetypes
app/models/Archetype.scala
Scala
gpl-3.0
388
/* * 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 ...
ravipesala/incubator-carbondata
datamap/mv/plan/src/main/scala/org/apache/carbondata/mv/testutil/Tpcds_1_4_Tables.scala
Scala
apache-2.0
29,033
/* * 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 ...
sryza/spark
core/src/main/scala/org/apache/spark/deploy/worker/WorkerArguments.scala
Scala
apache-2.0
5,209
package com.lucidchart.open.cashy.controllers import play.api.mvc.Action import com.lucidchart.open.cashy.views import com.lucidchart.open.cashy.models.UserModel import com.lucidchart.open.cashy.utils.{Auth, HashHelper} import com.lucidchart.open.cashy.request.{AppFlash, AuthAction} import com.lucidchart.open.cashy.o...
lucidsoftware/cashy
app/com/lucidchart/open/cashy/controllers/AuthController.scala
Scala
apache-2.0
4,387
package com.gs.collections.impl.collection.mutable /* * Copyright 2011 Goldman Sachs. * * 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....
gabby2212/gs-collections
scala-unit-tests/src/test/scala/com/gs/collections/impl/collection/mutable/SynchronizedSortedSetScalaTest.scala
Scala
apache-2.0
2,270
package io.confluent.examples.clients.scala.model class RecordJSON() { private[model] var count = 0L def this(count: Long) { this() this.count = count } def getCount: Long = count }
confluentinc/examples
clients/cloud/scala/src/main/scala/io/confluent/examples/clients/scala/model/RecordJSON.scala
Scala
apache-2.0
201
/* * 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 ...
jkbradley/spark
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
Scala
apache-2.0
37,648
package zzb.xmpp /** * Created by Simon on 2014/8/8 */ trait XPresence{ override def toString = this.getClass.getSimpleName.replace("$","") } object Online extends XPresence object Offline extends XPresence object Connecting extends XPresence
stepover/zzb-xmpp
src/main/scala/zzb/xmpp/XPresence.scala
Scala
mit
252
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this fi...
xjrk58/elasticsearch-hadoop
spark/sql-20/src/main/scala/org/elasticsearch/spark/sql/RowValueReader.scala
Scala
apache-2.0
2,676
package org.akkajs import scala.util.Try import scala.language.experimental.macros import fastparse.core.Parsed package object shocon extends Extractors { var verboseLog = false def setVerboseLog(): Unit = macro ConfigMacroLoader.setVerboseLogImpl object Config { type Key = String sealed trait Valu...
unicredit/shocon
shared/src/main/scala/org/akkajs/shocon/SHocon.scala
Scala
apache-2.0
4,412
package net.sansa_stack.inference.data import scala.collection.JavaConverters._ import org.apache.jena.datatypes.{BaseDatatype, RDFDatatype, TypeMapper} import org.apache.jena.graph.{Graph => JenaGraph, Node => JenaNode, Triple => JenaTriple, _} import org.apache.jena.rdf.model.{Seq => _} class JenaOps extends RDFOp...
SANSA-Stack/SANSA-RDF
sansa-inference/sansa-inference-common/src/main/scala/net/sansa_stack/inference/data/JenaOps.scala
Scala
apache-2.0
3,545
package org.vindinium package object server { implicit final class debugKCombinatorAny[A](a: A) { def pp: A = { println(s"*DEBUG* $a"); a } } import scala.concurrent.Future import scala.concurrent.ExecutionContext.Implicits.global implicit final class debugKCombinatorFutureAny[A](fua: Future[A]) { ...
ornicar/vindinium
app/package.scala
Scala
mit
652
package com.twitter.scalding.parquet.tuple import org.apache.parquet.filter2.predicate.FilterPredicate import cascading.scheme.Scheme import com.twitter.scalding._ import com.twitter.scalding.parquet.HasFilterPredicate import com.twitter.scalding.parquet.tuple.scheme.{ ParquetReadSupport, ParquetWriteSupport, Ty...
twitter/scalding
scalding-parquet/src/main/scala/com/twitter/scalding/parquet/tuple/TypedParquet.scala
Scala
apache-2.0
2,985
// // Taranos Cloud Sonification Framework: Service Core // Copyright (C) 2018 David Hinson, Netrogen Blue LLC (dhinson@netrogenblue.com) // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software F...
taranos/taranoscsf-core
src/main/scala/org/taranos/mc/trunk/intraprocess/SignalPort.scala
Scala
agpl-3.0
8,318
package com.twitter.algebird.benchmark import java.util.concurrent.TimeUnit import org.openjdk.jmh.annotations._ /** * Benchmarks the hashing algorithms used by Count-Min sketch for CMS[BigInt]. * * The input values are generated ahead of time to ensure that each trial uses the same input (and that the RNG is not ...
erikerlandson/algebird
algebird-benchmark/src/main/scala/com/twitter/algebird/benchmark/CMSHashingBenchmark.scala
Scala
apache-2.0
3,285
package com.codahale.jersey.params object BooleanParam { def apply(value: Boolean): BooleanParam = BooleanParam(value.toString) } /** * Parses "true" and "false" to Boolean values. */ case class BooleanParam(s: String) extends AbstractParam[Boolean](s) { protected def parse(input: String) = input.toBoolean o...
codahale/jersey-scala
src/main/scala/com/codahale/jersey/params/BooleanParam.scala
Scala
mit
462
package rs.fon.kvizic.networkAnalysis.algorithm.shortestPath import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import org.scalatest.FunSuite import org.scalatest.mock.MockitoSugar._ import org.mockito.Mockito.{ when, verify, times, reset } import rs.fon.kvizic.networkAnalysis.Relation import rs.fo...
dpavkov/network-analysis-metrics
src/test/scala/rs/fon/kvizic/networkAnalysis/algorithm/shortestPath/PathSuite.scala
Scala
mit
4,596
package filodb import akka.actor.ActorRef import com.typesafe.config.Config import com.typesafe.scalalogging.slf4j.StrictLogging import org.apache.spark.sql.{SQLContext, DataFrame, Row, Column => SparkColumn} import org.apache.spark.sql.types.DataType import org.apache.spark.sql.catalyst.expressions.Literal import sca...
Shiti/FiloDB
spark/src/main/scala/filodb.spark/package.scala
Scala
apache-2.0
9,670
package com.scala.exercises.impatient.chapter11 /** * Created by Who on 14-7-13. */ object Number { def unapply(input: String): Option[Int] = { try { Some(Integer.parseInt(input)) } catch { case ex: NumberFormatException => None } } }
laonawuli/scalalearning
src/com/scala/exercises/impatient/chapter11/Number.scala
Scala
mit
266
package controllers import play.api._ import play.api.mvc._ import play.api.data.Form import play.api.data.Forms._ import play.api.libs.json.Json import models._ import javax.inject._ class Application @Inject() (db: DB) extends Controller { def index = Action { Ok(views.html.index()) } val personForm: Fo...
jyotikamboj/container
pf-templates/play-scala-intro/app/controllers/Application.scala
Scala
mit
673
package org.rebeam.tree.view.list import japgolly.scalajs.react._ import scala.scalajs.js object SortableHandle { /** * Wrap another component * @param wrappedComponent The wrapped component itself * @tparam P The type of Props of the wrapped component * @return A comp...
trepidacious/tree-material-ui
js/src/main/scala/org/rebeam/tree/view/list/SortableHandle.scala
Scala
gpl-3.0
780
/** * URI generator */ package common import helper.Platform import java.io.File /** * @author ShiZhan * URI generator * 1. Generate computer node URI from hostname * 2. Generate file URI from File instance with hostname * 3. Generate URI from path String with hostname * another set: use dedicated scheme */ ...
ShiZhan/fs-crawler
src/main/scala/common/URI.scala
Scala
apache-2.0
1,042
package ch.ninecode.cim import org.apache.spark.rdd.RDD import org.apache.spark.rdd.RDD.rddToPairRDDFunctions import org.apache.spark.sql.SparkSession import org.apache.spark.storage.StorageLevel import org.slf4j.Logger import org.slf4j.LoggerFactory import ch.ninecode.model._ /** * Handle normalization. * * For ...
derrickoswald/CIMScala
CIMReader/src/main/scala/ch/ninecode/cim/CIMNormalize.scala
Scala
mit
8,329
package scutil.number.extension import scutil.number.BigRational object LongImplicits extends LongImplicits trait LongImplicits { implicit final class LongExt(peer:Long) { def toBigRational:BigRational = BigRational fromLong peer } }
ritschwumm/scutil
modules/core/src/main/scala/scutil/number/extension/LongImplicits.scala
Scala
bsd-2-clause
241
/* * Copyright 2018 Analytics Zoo 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...
intel-analytics/analytics-zoo
zoo/src/main/scala/com/intel/analytics/zoo/models/recommendation/NeuralCF.scala
Scala
apache-2.0
5,561
package com.houseofmoran.spark import java.io.{File, FilenameFilter} import org.apache.spark.sql.{SQLContext, SchemaRDD} class ParquetLoadHelper(sqlContext: SQLContext) { def parquetFiles(dirName: String) : SchemaRDD = { return parquetFiles(dirName, """.+\\.parquet""") } def parquetFiles(dirName: String, ...
mikemoraned/zeitgeist
src/main/scala/com/houseofmoran/spark/LoadHelpers.scala
Scala
mit
851
/* * Copyright 2011-2018 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 applic...
wiacekm/gatling
gatling-http/src/main/scala/io/gatling/http/fetch/CssParser.scala
Scala
apache-2.0
5,517
package epic.parser package models /* 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 o...
briantopping/epic
src/main/scala/epic/parser/models/SpanModel.scala
Scala
apache-2.0
31,588
package hu.gansperger.neptunapi.constants object Message { val gridId = "c_messages_gridMessages" val requestType = "GetData" val fixedHeader = false val searchCol = "" val searchText = "" val searchExp = false val allowSubRows = false val eventTarget = "upFunction$c_messages$upMain$upGrid$gridMessage...
qwe2/neptun-api
src/main/scala/hu/gansperger/neptunapi/constants/Message.scala
Scala
mit
408
package com.twitter.finagle.memcached.protocol.text import com.twitter.finagle.memcached.protocol.ClientError import org.jboss.netty.handler.codec.frame.FrameDecoder import org.jboss.netty.buffer.{ChannelBuffers, ChannelBufferIndexFinder, ChannelBuffer} import org.jboss.netty.channel._ import com.twitter.finagle.memca...
kristofa/finagle
finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/AbstractDecoder.scala
Scala
apache-2.0
2,766
package edu.berkeley.nlp.entity.joint import scala.collection.mutable.ArrayBuffer import scala.collection.mutable.HashMap import edu.berkeley.nlp.entity.Chunk import edu.berkeley.nlp.entity.ConllDoc import edu.berkeley.nlp.entity.ConllDocReader import edu.berkeley.nlp.entity.ConllDocWriter import edu.berkeley.nlp.enti...
matthewfl/berkeley-entity
src/main/java/edu/berkeley/nlp/entity/joint/JointPredictor.scala
Scala
gpl-3.0
4,266
/* * Ported by Alistair Johnson from * https://android.googlesource.com/platform/libcore/+/master/luni/src/main/java/java/math/RoundingMode.java * Original license copied below: */ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file dis...
lrytz/scala-js
javalib/src/main/scala/java/math/RoundingMode.scala
Scala
bsd-3-clause
2,724
/* * Copyright (c) 2017. Yuriy Stul */ package com.stulsoft.mailgun4s import org.scalatest.{FlatSpec, Matchers} /** * Unit tests for Config class * * @author Yuriy Stul */ class ConfigTest extends FlatSpec with Matchers { behavior of "Config" "constructor" should "create new instance of the Config" in...
ysden123/poc
mailgun4s/src/test/scala/com/stulsoft/mailgun4s/ConfigTest.scala
Scala
mit
1,053
package vm.interpreter.impl import ea._ import org.apache.bcel.generic.{BasicType, _} import sai.bytecode.{Method, Program} import sai.vm.{DontCare, Reference} import vm.Frame import vm.interpreter.{InstructionInterpreter, InterpreterBuilder} private[interpreter] object InvokeInterpreter extends InterpreterBuilder[In...
oliverhaase/sai
src/sai/vm/interpreter/impl/InvokeInterpreter.scala
Scala
mit
8,126
/** * 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...
zzwlstarby/mykafka
core/src/main/scala/kafka/tools/ExportZkOffsets.scala
Scala
apache-2.0
4,943
/* * 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 ...
shivangi1015/incubator-carbondata
integration/spark-common/src/main/scala/org/apache/carbondata/spark/rdd/CarbonCleanFilesRDD.scala
Scala
apache-2.0
2,643
package net.yoshinorin.gitbucket.monitoring.models case class Cpu( us: String, sy: String, ni: String, id: String, wa: String, hi: String, si: String, st: String, usage: String ) case class Memory( total: String, used: String, free: String, shared: String, buffCache: String, available: S...
YoshinoriN/gitbucket-monitoring-plugin
src/main/scala/net/yoshinorin/gitbucket/monitoring/models/MachineResources.scala
Scala
apache-2.0
484
/* * Copyright 2010 Michael Fortin <mike@brzy.org> * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
m410/calista
src/main/scala/org/brzy/calista/schema/Key.scala
Scala
apache-2.0
1,672
package io.udash.generator.utils import java.io._ import io.udash.generator.plugins.Placeholder import scala.io.Source import scala.util.matching.Regex /** Basic file operations */ trait FileOps { /** Writes `content` into `file`. */ protected def writeFile(file: File)(content: String) = { new PrintWriter(f...
UdashFramework/udash-generator
core/src/main/scala/io/udash/generator/utils/FileOps.scala
Scala
apache-2.0
1,640
package edu.umass.ciir.kbbridge.tac //import cc.factorie.app.nlp.{Section, Document} import scala.io.Source import scala.xml.pull.{EvText, EvElemEnd, EvElemStart, XMLEventReader} import scala.xml.{NodeSeq, Node} import scala.xml.parsing.ConstructingParser /** * Created with IntelliJ IDEA. * User: jdalton * Date: 9...
daltonj/KbBridge
src/main/scala/edu/umass/ciir/kbbridge/tac/Text2Factorie.scala
Scala
apache-2.0
441
package com.twitter.inject.requestscope import com.twitter.inject.TwitterModule trait RequestScopeBinding extends TwitterModule { override final val modules = Seq(FinagleRequestScopeModule) protected def bindRequestScope[T: Manifest] { bind[T] .toProvider[UnseededFinagleScopeProvider[T]] .in[Fin...
tom-chan/finatra
inject/inject-request-scope/src/main/scala/com/twitter/inject/requestscope/RequestScopeBinding.scala
Scala
apache-2.0
345
package s_mach.concurrent import org.scalatest.{FlatSpec, Matchers} import s_mach.concurrent.util.AtomicState class AtomicStateTest extends FlatSpec with Matchers { "AtomicState.current" should "should get the current state" in { val state = AtomicState[String]("initial") state.current shouldBe "initial" ...
S-Mach/s_mach.concurrent
src/test/scala/s_mach/concurrent/AtomicStateTest.scala
Scala
mit
1,743
import scalaz.\\/ package object msgpack4z { type UnpackResult[A] = UnpackError \\/ A type Packer[A] = (MsgPacker, A) => Unit type Unpacker[A] = MsgUnpacker => UnpackResult[A] }
msgpack4z/msgpack4z-core
src/main/scala/msgpack4z/package.scala
Scala
mit
183
package org.jetbrains.plugins.scala package lang package psi package api package toplevel package templates import org.jetbrains.plugins.scala.lang.psi.api.base.types.ScSelfTypeElement import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression import org.jetbrains.plugins.scala.lang.psi.api.statements.{ScDeclar...
ilinum/intellij-scala
src/org/jetbrains/plugins/scala/lang/psi/api/toplevel/templates/ScTemplateBody.scala
Scala
apache-2.0
849
package geotrellis.transit object Logger { def log(msg:String) = { println(s"[GEOTRELLIS-TRANSIT] $msg") } def warn(msg:String) = { println(s"[GEOTRELLIS-TRANSIT WARNING] $msg") } def error(msg:String) = { println(s"[GEOTRELLIS-TRANSIT] $msg") } def timed(startMsg:String,endMsg:Stri...
flibbertigibbet/open-transit-indicators
scala/geotrellis-transit/src/main/scala/geotrellis/transit/Logger.scala
Scala
gpl-3.0
959
package scavlink.link.parameter import akka.actor.ActorSystem import akka.testkit.TestProbe import scavlink.link.SubscribeTo import scavlink.link.parameter.ParameterAskAPI._ import scavlink.message.Packet import scavlink.message.common.ParamValue import scavlink.message.enums.MavParamType import scala.concurrent.Awai...
nickolasrossi/scavlink
src/test/scala/scavlink/link/parameter/ParameterCacheSpec.scala
Scala
mit
4,078
package com.politach object Main extends App { val kernel = new ApiKernel kernel.startup() }
Politach/web-app
src/main/scala/com/politach/Main.scala
Scala
mit
98
/* * 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 ...
mzl9039/spark
core/src/test/scala/org/apache/spark/SparkContextSuite.scala
Scala
apache-2.0
23,489
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
wangmiao1981/spark
sql/core/src/test/scala/org/apache/spark/sql/execution/joins/OuterJoinSuite.scala
Scala
apache-2.0
9,704
package org.jetbrains.sbt package language import com.intellij.openapi.components.AbstractProjectComponent import com.intellij.openapi.project.Project import com.intellij.psi.{PsiTreeChangeEvent, PsiTreeChangeAdapter, PsiManager} import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer /** * @author Pavel Fatin */...
consulo/consulo-scala
SBT/src/main/scala/org/jetbrains/sbt/language/SbtProjectComponent.scala
Scala
apache-2.0
954
package org.jetbrains.plugins.scala package lang package psi package api package toplevel /** * @author ven */ trait ScPolymorphicElement extends ScTypeParametersOwner with ScTypeBoundsOwner with ScNamedElement { }
ilinum/intellij-scala
src/org/jetbrains/plugins/scala/lang/psi/api/toplevel/ScPolymorphicElement.scala
Scala
apache-2.0
217
/* * Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U. * * 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 * * Unles...
telefonicaid/fiware-cosmos-platform
tests/platform-tests/src/it/scala/es/tid/cosmos/tests/e2e/E2ETestBase.scala
Scala
apache-2.0
2,655
package nl.soqua.lcpi.interpreter.transformation import nl.soqua.lcpi.ast.lambda.Expression import nl.soqua.lcpi.interpreter.transformation.Stringify._ import nl.soqua.lcpi.parser.lambda.LambdaCalcParser import org.scalatest.{Assertion, Matchers, WordSpec} class IsomorphismSpec extends WordSpec with Matchers { imp...
kevinvandervlist/lcpi
interpreter/src/test/scala/nl/soqua/lcpi/interpreter/transformation/IsomorphismSpec.scala
Scala
mit
2,518
package org.jetbrains.plugins.scala package console import java.io.{IOException, OutputStream} import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent, CommonDataKeys} import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.editor.ex.EditorEx import com.intellij.openapi.util.TextRange /**...
loskutov/intellij-scala
src/org/jetbrains/plugins/scala/console/ScalaConsoleExecuteAction.scala
Scala
apache-2.0
2,556
/* Part of Cosmos by OpenGenus Foundation */ object QuickSort extends App { def quickSort[A <% Ordered[A]](input: List[A]): List[A] = { input match { case Nil => Nil case head :: tail => val (l, g) = tail partition (_ < head) quickSort(l) ::: head :: quickSort(g) } } val inpu...
OpenGenus/cosmos
code/sorting/src/quick_sort/quick_sort.scala
Scala
gpl-3.0
445
package com.houseofmoran.selfies.faces object VerticalFacePresence { def fromFaces(faces: Seq[DetectedFaceInContext]) : VerticalFacePresence = { val segmented = faces.groupBy(face => face.toVerticalSegment) VerticalFacePresence( segmented.get(LeftVertical), segmented.get(MiddleVertical), se...
mikemoraned/selfies
src/main/scala/com/houseofmoran/selfies/faces/VerticalFacePresence.scala
Scala
mit
580
package vggames.scala.specs import vggames.scala.code.RestrictedFunction2 class SomaSpec extends GameSpecification[RestrictedFunction2[Int, Int, Int]] { def runSignature = "(a:Int, b:Int):Int" def extendsType = "RestrictedFunction2[Int, Int, Int]" def challenge = "Some duas vari&aacute;veis <code>a</code> e ...
vidageek/games
games/scala/src/main/scala/vggames/scala/specs/SomaSpec.scala
Scala
gpl-3.0
649
/* package test //import org.specs2.mutable._ import play.api.test._ import play.api.test.Helpers._ * add your integration spec here. * An integration test will fire up a whole play application in a real (or headless) browser class IntegrationSpec extends Specification { "Application" should { "work from...
indykish/vertice_gateway
test/run/IntegrationSpec.scala
Scala
mit
596
/* * Copyright (C) 2016 University of Basel, Graphics and Vision Research Group * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) an...
unibas-gravis/scalismo-ui
src/main/scala/scalismo/ui/model/VectorFieldNode.scala
Scala
gpl-3.0
2,578
package com.example.android_servicetest import android.view.View import android.app.Activity object CommonUtil { implicit def view2RichView(v: View) = { new { def onClick(handler: => Any) = { v.setOnClickListener(new View.OnClickListener() { override def onClick(view: View) = { ...
firefoxmmx2/Android_ServiceTest
src/com/example/android_servicetest/CommonUtil.scala
Scala
apache-2.0
502
package me.yingrui.segment.graph import org.junit.Assert import org.junit.Test import me.yingrui.segment.tools.WordBigramBuilder import java.io.File class WordBigramTest { @Test def should_save_and_load_model() { val builder = new WordBigramBuilder() builder.train("src/test/resources/test-pfr-corpus.txt"...
yingrui/mahjong
lib-segment/src/test/scala/me/yingrui/segment/graph/WordBigramTest.scala
Scala
gpl-3.0
801