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 org.opencompare.api.scala.io
import java.io.File
import org.opencompare.api.scala.PCM
trait PCMLoader {
/**
* Return a list of PCMs from a string representation
*
* @param pcms : string representation of a PCM
* @return the PCM represented by pcm
*/
def load(pcms : String) : List[PCM]... | OpenCompare/OpenCompare | org.opencompare/api-scala/src/main/scala/org/opencompare/api/scala/io/PCMLoader.scala | Scala | apache-2.0 | 476 |
package latis.dm
import latis.dm.implicits._
import org.junit._
import Assert._
import com.typesafe.scalalogging.LazyLogging
import latis.dm._
import latis.metadata.Metadata
import latis.time.Time
import latis.writer.AsciiWriter
class TestScalar {
@Test
def construct_scalar_from_boolean_true = {
Scalar(1==1... | dlindhol/LaTiS | src/test/scala/latis/dm/TestScalar.scala | Scala | epl-1.0 | 529 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScValue
/**
* User: Alexander Podkhalyuzin
* Date: 17.10.2008
*/
trait ScValueStub extends ScValueOrVariableStub[ScValue] {
def isImplicit: Boolean
} | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/ScValueStub.scala | Scala | apache-2.0 | 293 |
/*
* 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 ... | PangZhi/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/sources/definedTimeAttributes.scala | Scala | apache-2.0 | 3,021 |
package liang.don.dzimageconverter.log.net
import liang.don.dzimageconverter.log.{LoggerInterface, LogLevel}
/**
* .Net (C#) console logger.
*
* @author Don Liang
* @Version 0.1, 22/09/2011
*/
trait ConsoleLogger extends LoggerInterface {
override def log(message: String) {
sys.error("[" + getClass.getNam... | dl2k84/DeepZoomImageConverter | src/liang/don/dzimageconverter/log/net/ConsoleLogger.scala | Scala | mit | 647 |
package com.twitter.cache
import com.twitter.conversions.time._
import com.twitter.util.{Await, Future}
import org.scalatest.FunSuite
abstract class AbstractLoadingFutureCacheTest extends FunSuite {
// NB we can't reuse AbstractFutureCacheTest since
// loading cache semantics are sufficiently unique
// to merit... | folone/util | util-cache/src/test/scala/com/twitter/cache/AbstractLoadingFutureCacheTest.scala | Scala | apache-2.0 | 2,944 |
package com.eevolution.context.dictionary.infrastructure.repository
import com.eevolution.context.dictionary.domain.model.PrintGraph
import com.eevolution.context.dictionary.infrastructure.db.DbContext._
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is fre... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/repository/PrintGraphMapping.scala | Scala | gpl-3.0 | 2,092 |
package org.katis.capnproto.runtime
class StructSize(val data: Short, val pointers: Short) {
def total(): Int = this.data.toInt + this.pointers.toInt
}
| katis/capnp-scala | runtime/shared/src/main/scala-2.11/org/katis/capnproto/runtime/StructSize.scala | Scala | mit | 156 |
package io.github.lyubent.util
import java.util.Properties
import scala.tools.nsc.io.{File, Path}
object FileUtil {
/**
* Uses classloader to access resource folder and Java config
* to retrieve the path to the static game dataset.
*
* @return Path to static json dataset
*/
def getConfigProperty(... | lyubent/LeagueToxicity | src/main/scala/io/github/lyubent/util/FileUtil.scala | Scala | unlicense | 865 |
package scorex.unit
import org.scalatest.FunSuite
import scorex.crypto.Base58
import scorex.state.wallet.Wallet
import scala.util.Random
class WalletSpecification extends FunSuite {
private val walletSize = 10
test("wallet - acc deletion") {
val w = new Wallet(None, "cookies", Base58.decode("FQgbSAm6swGbt... | pozharko/Scorex-Lagonaki | src/test/scala/scorex/unit/WalletSpecification.scala | Scala | cc0-1.0 | 1,325 |
/*
* 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 ... | ron8hu/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala | Scala | apache-2.0 | 47,782 |
/**
* Original work: Swagger Codegen (https://github.com/swagger-api/swagger-codegen)
* Copyright 2016 Swagger (http://swagger.io)
*
* Derivative work: Swagger Codegen - Play Scala (https://github.com/mohiva/swagger-codegen-play-scala)
* Modifications Copyright 2016 Mohiva Organisation (license at mohiva dot com)
... | akkie/swagger-codegen-play-scala | clientstub/src/main/scala/com/mohiva/swagger/codegen/core/ApiResponse.scala | Scala | apache-2.0 | 4,420 |
// scalastyle:off line.size.limit
/*
* Ported by Alistair Johnson from
* https://github.com/gwtproject/gwt/blob/master/user/test/com/google/gwt/emultest/java/math/MathContextTest.java
*/
// scalastyle:on line.size.limit
package org.scalajs.testsuite.javalib.math
import java.math.MathContext
import java.math.Roundi... | renyaoxiang/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/javalib/math/MathContextTest.scala | Scala | bsd-3-clause | 3,945 |
package org.influxdb.scala
/**
* Combines the AsyncHttpClientComponent and Json4sJsonConverterComponent traits
* for a complete configuration of a standalone influxdb client using the asyncHttp client
* and json4s converters.
* See http://jonasboner.com/2008/10/06/real-world-scala-dependency-injection-di/
*/
trai... | fsauer65/influxdb-scala | standalone/src/main/scala/org/influxdb/scala/StandaloneConfig.scala | Scala | mit | 405 |
package simx.components.ai.atn.core
import simx.components.ai.atn.elements.{Atn, Arc, State}
import simx.core.entity.description.SValSet
import simx.core.ontology.Symbols.debug
import simx.core.ontology.{Symbols, types}
import simx.core.worldinterface.eventhandling.Event
import scala.collection.mutable
import scala.u... | simulator-x/atn | src/simx/components/ai/atn/core/Functions.scala | Scala | apache-2.0 | 5,249 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complian... | fanf/rudder-commons | eventlog-api/src/main/scala/com/normation/eventlog/EventLog.scala | Scala | apache-2.0 | 5,243 |
package chapter.eighteen
object ExerciseFive extends App {
}
| deekim/impatient-scala | src/main/scala/chapter/eighteen/ExerciseFive.scala | Scala | apache-2.0 | 64 |
package saveyourstack
import scalaz._
import Scalaz._
import org.joda.time._
import scala.annotation.tailrec
object Dates {
def generateDates(sd: DateTime, ed: DateTime): List[DateTime] = {
if (sd isBefore ed)
sd :: generateDates(sd.plusDays(1), ed)
else
List(sd)
}
def generateDatesSafe(... | bwmcadams/lambdaconf-2015 | speakers/vmarquez/src/main/scala/saveyourstack/Stack.scala | Scala | artistic-2.0 | 5,151 |
package com.td.dedupe
import java.io.File
import java.awt.image.BufferedImage
import java.awt.Color
import javax.imageio.ImageIO
object ImageDeDupe {
def main(args: Array[String]) {
println("Begin Scanning given directories")
val files = args flatMap {
dirName => new File(dirName) match {
cas... | tonyd3/image-de-dupe | src/main/scala/com/td/dedupe/ImageDeDupe.scala | Scala | mit | 1,967 |
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Sun Dec 28 21:52:38 EST 2014
* @see LICENSE (MIT style license file).
*/
// FIX: needs improved optimization
package scalation.analytics.classifier
import scala.math.{exp, l... | NBKlepp/fda | scalation_1.2/src/main/scala/scalation/analytics/classifier/LogisticRegression.scala | Scala | mit | 17,881 |
package com.github.al.roulette.load.impl
import java.time.Duration
import java.util.UUID
import java.util.concurrent._
import java.util.concurrent.atomic.AtomicInteger
import akka.actor.Scheduler
import akka.http.javadsl.model.headers
import akka.stream.scaladsl.{Flow, Source}
import akka.{Done, NotUsed}
import com.g... | andrei-l/reactive-roulette | load-test-impl/src/main/scala/com/github/al/roulette/load/impl/LoadTestServiceImpl.scala | Scala | mit | 7,525 |
/*
* Shadowsocks - A shadowsocks client for Android
* Copyright (C) 2014 <[email protected]>
*
* 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 y... | magic282/shadowsocks-android | src/main/scala/com/github/shadowsocks/database/Profile.scala | Scala | gpl-3.0 | 2,789 |
package cas.analysis.estimation
import cas.analysis.subject.Subject
import cas.analysis.subject.components.Description
import cas.math.Mathf.sigmoid
import cas.utils.StdImplicits.RightBiasedEither
import cas.utils.UtilAliases.ErrorMsg
class SubjectsClassificator(weights: Array[Double],
loy... | bk0606/CAS | src/main/scala/cas/analysis/estimation/SubjectsClassificator.scala | Scala | mit | 2,263 |
package com.sksamuel.elastic4s.requests.cat
import com.sksamuel.elastic4s.Indexes
import com.sksamuel.elastic4s.requests.common.HealthStatus
import com.sksamuel.exts.OptionImplicits._
trait CatsApi {
def catAliases(): CatAliases = CatAliases()
def catAllocation(): CatAllocation = CatAllocation()
def cat... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/cat/CatsApi.scala | Scala | apache-2.0 | 1,472 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/expressions/utils/ScalarOperatorsTestBase.scala | Scala | apache-2.0 | 2,603 |
package pictureshow
object Files {
import java.io.{File => JFile}
/** build path from parts */
def path(parts: Seq[String]): String = parts map { _.trim } mkString(System.getProperty("file.separator"))
/** creator from path */
def apply(path: String): Option[JFile] = new JFile(path) match {
case f:JFile... | softprops/picture-show | core/src/main/scala/Files.scala | Scala | mit | 799 |
package rww.ontology
import org.w3.banana.PointedGraph
import org.w3.banana.plantain.Plantain.ops._
import rww.Rdf._
import rww.ui.rdf.NPGPath
/**
* Created by hjs on 07/05/2015.
*/
case class ContactLocation(npg: NPGPath) {
val ct = ContactPrefix[Rdf]
def address = (npg /-> ct.address) map { Address(_) }
... | read-write-web/rww-scala-js | src/main/scala/rww/ontology/ContactLocation.scala | Scala | apache-2.0 | 631 |
/*
* Copyright 2010 WorldWide Conferencing, LLC
*
* 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 l... | wsaccaco/lift | examples/hellofbc/src/main/scala/bootstrap/liftweb/Boot.scala | Scala | apache-2.0 | 3,114 |
import java.io.File
import java.io.FileInputStream
import java.io.PrintWriter
import org.apache.poi.xssf.usermodel.{XSSFCell, XSSFRow, XSSFSheet, XSSFWorkbook}
import org.apache.poi.ss.usermodel.{Sheet, Row, Cell}
import scala.collection.JavaConverters._
import scala.collection.mutable
import scala.language.postfixOp... | zhongzichang/excel2xml | src/main/scala/execl2xml.scala | Scala | gpl-3.0 | 3,929 |
package com.nulabinc.backlog.migration.common.codec
trait Decoder[A, B] {
def decode(a: A): B
}
| nulab/backlog-migration-common | core/src/main/scala/com/nulabinc/backlog/migration/common/codec/Decoder.scala | Scala | mit | 99 |
package com.github.fellowship_of_the_bus
package tdtd
package game
import scala.math._
import IDMap._
import GameMap._
object Projectile {
val width = 1.0f
val height = 1.0f
def apply(x: Float, y: Float, tar: Enemy, tower: Tower) = {
tower.id match {
case NetTowerID => new Net(x, y, tar, tower)
... | Fellowship-of-the-Bus/tdtd | src/main/scala/game/Projectile.scala | Scala | apache-2.0 | 3,360 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009, 2010 Mark Harrah
*/
package sbt
// The following code is based on scala.tools.nsc.reporters.{AbstractReporter, ConsoleReporter, Reporter}
// Copyright 2002-2009 LAMP/EPFL
// see licenses/LICENSE_Scala
// Original author: Martin Odersky
import xsbti.{Maybe,Positi... | jroper/sbt | compile/LoggerReporter.scala | Scala | bsd-3-clause | 3,740 |
package com.enkidu.lignum.parsers.ast.expression.discardable.literals
case class FloatLiteral(value: String) extends Literal
| marek1840/java-parser | src/main/scala/com/enkidu/lignum/parsers/ast/expression/discardable/literals/FloatLiteral.scala | Scala | mit | 126 |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not ed... | cliffano/swaggy-jenkins | clients/scala-lagom-server/generated/src/main/scala/io/swagger/client/model/HudsonassignedLabels.scala | Scala | mit | 585 |
/*
* 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/test/scala/org/apache/spark/sql/jdbc/JDBCWriteSuite.scala | Scala | apache-2.0 | 23,202 |
/*
* Copyright 2013 TeamNexus
*
* TeamNexus Licenses this file to you under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://opensource.org/licenses/mit-license.php
*
* Unless required by applicable law ... | crvidya/nexus-scala | src/main/scala/com/nexus/webserver/WebServerRequest.scala | Scala | mit | 2,189 |
class SCL2055 {
def m2(p: String) = p
def m2(p: => Unit) = 1
/*start*/m2()/*end*/
}
//Int | ilinum/intellij-scala | testdata/typeInference/bugs5/SCL2055.scala | Scala | apache-2.0 | 95 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/effect/RandomLoot.scala | Scala | apache-2.0 | 794 |
package com.arcusys.valamis.lesson.service
import com.arcusys.learn.liferay.LiferayClasses.LNoSuchEntryException
import com.arcusys.learn.liferay.constants.ContentTypesHelper
import com.arcusys.learn.liferay.services.{ AssetEntryLocalServiceHelper, ClassNameLocalServiceHelper, CounterLocalServiceHelper }
import com.ar... | ViLPy/Valamis | valamis-lesson/src/main/scala/com/arcusys/valamis/lesson/service/AssetHelper.scala | Scala | lgpl-3.0 | 3,291 |
/**
* 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/ImplicitsTrySuite.scala | Scala | apache-2.0 | 1,824 |
package loaders
import java.io.FileInputStream
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import nodes.images._
import pipelines.CKMConf
import utils.{Image, ImageMetadata, LabeledImage, RowMajorArrayVectorizedImage, ColumnMajorArrayVectorizedImage}
/**
* Loads images from the CIFAR-10 Da... | Vaishaal/ckm | keystone_pipeline/src/main/scala/loaders/CifarWhitenedLoader.scala | Scala | apache-2.0 | 1,299 |
/*
*
* Copyright 2014 Commonwealth Computer Research, Inc.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | kevinwheeler/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/stats/MethodProfiling.scala | Scala | apache-2.0 | 4,849 |
package gapt.proofs.context.facet
import gapt.expr.Const
/** Inductive types, for each type we store its list of constructors. */
case class StructurallyInductiveTypes( constructors: Map[String, Vector[Const]] ) {
def +( ty: String, ctrs: Vector[Const] ) =
copy( constructors + ( ty -> ctrs ) )
override def t... | gapt/gapt | core/src/main/scala/gapt/proofs/context/facet/StructurallyInductiveTypes.scala | Scala | gpl-3.0 | 605 |
package org.bitcoins.core.script.bitwise
import org.bitcoins.core.script.constant._
import org.bitcoins.core.script.control.{ ControlOperationsInterpreter, OP_VERIFY }
import org.bitcoins.core.script.result._
import org.bitcoins.core.script.{ ExecutedScriptProgram, ExecutionInProgressScriptProgram, PreExecutionScriptP... | Christewart/bitcoin-s-core | src/main/scala/org/bitcoins/core/script/bitwise/BitwiseInterpreter.scala | Scala | mit | 2,699 |
package net.stsmedia.akka.http.support
import akka.http.marshalling.{Marshaller, ToEntityMarshaller}
import akka.http.model.HttpCharsets
import akka.http.model.MediaTypes.`application/json`
import akka.http.unmarshalling.{FromEntityUnmarshaller, Unmarshaller}
import akka.stream.FlowMaterializer
import spray.json._
im... | stsmedia/akka-http-server | src/main/scala/net/stsmedia/akka/http/support/SprayJsonSupport.scala | Scala | mit | 2,112 |
package aerospiker
package task
package monix
import _root_.monix.eval.Task
import _root_.monix.execution.Cancelable
import io.circe.{ Decoder, Encoder }
import scala.collection.generic.CanBuildFrom
trait Aerospike {
def get[A: Decoder](settings: Settings, binNames: String*): Action[Task, A]
def put[A: Encoder](... | tkrs/aerospiker | task/src/main/scala/aerospiker/task/monix/Aerospike.scala | Scala | mit | 3,254 |
package io.taig.android.resource
/**
* Helper class to create Android quantity Strings
*/
case class Quantity(message: Int, count: Int)
| Taig/Toolbelt | resource/src/main/scala/io/taig/android/resource/Quantity.scala | Scala | mit | 141 |
/*
* 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 t... | zhoffice/zipkin | zipkin-receiver-scribe/src/main/scala/com/twitter/zipkin/receiver/scribe/ScribeSpanReceiver.scala | Scala | apache-2.0 | 5,812 |
package org.schedoscope.scheduler.driver
import java.io.File
import org.scalatest.{FlatSpec, Matchers}
import org.schedoscope.dsl.transformations.ShellTransformation
import org.schedoscope.test.resources.LocalTestResources
import org.schedoscope.test.resources.TestDriverRunCompletionHandlerCallCounter._
import scala... | utzwestermann/schedoscope | schedoscope-core/src/test/scala/org/schedoscope/scheduler/driver/ShellDriverTest.scala | Scala | apache-2.0 | 2,315 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package kafka.manager
import java.util.Properties
import java.util.concurrent.atomic.AtomicBoolean
import com.typesafe.config.{Config, ConfigFactory}
import kafka.manager.features.KMDeleteTopicFeature... | herokumx/heroku-kafka-manager | test/kafka/manager/TestKafkaManager.scala | Scala | apache-2.0 | 22,307 |
package com.monkeygroover.frontend
import akka.actor.ActorSystem
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.server.{Directives, Route}
import akka.stream.Materializer
import com.monkeygroover.commands._
/**
* Created by monkeygroover on 09/10/15.
*/
abstract class R... | monkeygroover/cluster-sharding | rest/src/main/scala/com/monkeygroover/frontend/RestRoutes.scala | Scala | gpl-2.0 | 1,676 |
package models
case class Page[A](items: Seq[A], page: Int, size: Int, offset: Long, total: Long) {
lazy val prev = Option(page - 1).filter(_ >= 0)
lazy val next = Option(page + 1).filter(_ => (offset + items.size) < total)
def isEmpty: Boolean = items.isEmpty
def map[B](f: (A) => B): Page[B] = this.copy(item... | studiocredo/ticket-reservation | app/models/Page.scala | Scala | apache-2.0 | 333 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | jooooooon/rudder | rudder-core/src/main/scala/com/normation/rudder/repository/ldap/LDAPSwapGroupLibrary.scala | Scala | agpl-3.0 | 16,134 |
/*
* Copyright (c) 2013 Habla Computing
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | hablapps/updatable | src/main/scala/org/hablapps/updatable/filter.scala | Scala | apache-2.0 | 1,143 |
/*
* 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-native-sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/StreamMetadataSuite.scala | Scala | apache-2.0 | 3,057 |
package nak
import org.scalatest.FunSpec
import nak.data.FeatureObservation
/**
* Make sure NakContext functions work as expected.
*/
class NakContextSpec extends FunSpec {
import NakContext._
describe("feature observation condensing") {
it ("should merge counts and sort") {
val orig =
S... | scalanlp/nak | src/test/scala/nak/NakContextTest.scala | Scala | apache-2.0 | 579 |
/*
* Copyright (c) 2011-13 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 ag... | lambdista/shapeless | examples/src/main/scala/shapeless/examples/sized.scala | Scala | apache-2.0 | 3,498 |
package scoobie.doobie
import _root_.doobie.imports._
import org.specs2._
import scoobie.doobie.mysql._
import scoobie.dsl.schemaless.ansi.sql
import scoobie.dsl.schemaless.ansi.sql._
import scalaz.NonEmptyList
import scalaz.concurrent.Task
/**
* Created by jbarber on 5/14/16.
*/
class MySqlTest extends Specific... | Jacoby6000/Scala-SQL-AST | doobie/mysql/src/it/scala/scoobie/doobie/MySqlTest.scala | Scala | mit | 3,437 |
/***********************************************************************
* Copyright (c) 2013-2015 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... | vpipkt/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/iterators/LiveDensityIteratorTest.scala | Scala | apache-2.0 | 5,137 |
package water.sparkling
import water.sparkling.demo.RDDFrameExtractor
import org.apache.spark.rdd.RDD
import water.fvec.Vec.VectorGroup
import water.fvec.{NewChunk, AppendableVec,Frame}
import water.{H2O, DRemoteTask}
import org.apache.spark.Partition
import scala.reflect.runtime.universe.TypeTag
/** A frame extracto... | h2oai/h2o-sparkling | src/main/scala/water/sparkling/DistributedFrameExtractor.scala | Scala | apache-2.0 | 1,668 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | richhaase/kafka | core/src/test/scala/unit/kafka/server/KafkaApisTest.scala | Scala | apache-2.0 | 27,241 |
package feh.util
import scala.concurrent.duration.Duration
trait Debugging {
outer =>
def debug: Boolean
protected implicit class DebugLogWrapper[R](r: => R){
def debugLog(f: R => String): R = {
val a = r
outer.debugLog(f(a))
a
}
def debugLog(msg: String): R = debugLog(_ => msg ... | fehu/util | src/main/scala/feh/util/Debugging.scala | Scala | mit | 1,055 |
package com.sjsu.bikeshare.web
import javax.inject.Inject
import org.springframework.social.facebook.api.Facebook
import org.springframework.social.facebook.api.PagedList
import org.springframework.social.facebook.api.Post
import org.springframework.stereotype.Controller
import org.springframework.ui.Model
import org.... | komaldedhia/cmpe-273-project | src/main/scala/com/sjsu/bikeshare/web/FaceBookController.scala | Scala | mit | 1,559 |
package org.pico.statsd.impl
import java.io.ByteArrayOutputStream
class AccessibleByteArrayOutputStream(capacity: Int) extends ByteArrayOutputStream(capacity) {
def byteArray: Array[Byte] = buf
def takeWindow(): ByteArrayWindow = {
val window = ByteArrayWindow(buf, 0, count)
buf = new Array[Byte](capacit... | pico-works/pico-statsd | pico-statsd/src/main/scala/org/pico/statsd/impl/AccessibleByteArrayOutputStream.scala | Scala | mit | 466 |
/**
* 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... | Ishiihara/kafka | core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala | Scala | apache-2.0 | 15,896 |
/***********************************************************************
* 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-hbase/geomesa-hbase-tools/src/main/scala/org/locationtech/geomesa/hbase/tools/HBaseRunner.scala | Scala | apache-2.0 | 2,605 |
/*
* This file is part of Evo2DSim.
*
* Evo2DSim 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
* (at your option) any later version.
*
* Evo2DSim is distrib... | vchuravy/Evo2DSim | core/src/main/scala/org/vastness/evo2dsim/core/environment/Environment.scala | Scala | mit | 3,505 |
package pipelines
import org.apache.spark.rdd.RDD
/**
* An Unsupervised estimator. An estimator can emit a transformer via a call to its fit method on unlabeled data.
*
* @tparam I Input type.
* @tparam O Output type.
*/
abstract class UnsupervisedEstimator[I, O] extends Serializable with PipelineStage[I, O] {
... | concretevitamin/keystone | src/main/scala/pipelines/Estimator.scala | Scala | apache-2.0 | 1,391 |
/**
* Created by rewrite on 04/02/16.
*/
import scala.util.Random
class Player(name : String) {
var coinOption : String = ""
def setCoinOption(opponentFlip : String) : Unit = {
coinOption = if (opponentFlip.equals("Tails")) "Heads" else "Tails"
}
def getRandCoinOption : String = {
... | cirquit/Personal-Repository | Scala/coinflip-0.1/src/main/scala/Player.scala | Scala | mit | 633 |
/**
* Copyright (c) 2016, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"). You may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LIC... | cloudera/spark-timeseries | src/main/scala/com/cloudera/sparkts/models/AutoregressionX.scala | Scala | apache-2.0 | 5,607 |
package org.nexbook.app
import com.softwaremill.macwire._
import org.nexbook.core.Handler
import org.nexbook.neworderhandler.{NewOrderHandler, OrderHandler}
import org.nexbook.orderbookresponsehandler.handler.{FixMessageResponseSender, JsonFileLogger, TradeDatabaseSaver}
import org.nexbook.orderbookresponsehandler.res... | milczarekIT/nexbook | src/main/scala/org/nexbook/app/DelegatorsProvider.scala | Scala | apache-2.0 | 1,091 |
package dispatch.github.specs
import org.specs2.mutable._
import dispatch._
import dispatch.github._
class GhUserSpec extends Specification {
"When retrieving anonymous github user profile" should {
"return something when the user is valid" in {
val userRes = GhUser.get_user("juandebravo")
... | andreazevedo/dispatch-github | src/test/scala/GhUserSpec.scala | Scala | mit | 703 |
/*
* Copyright 2016 rdbc contributors
*
* 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... | rdbc-io/rdbc-pgsql | rdbc-pgsql-core/src/main/scala/io/rdbc/pgsql/core/internal/fsm/streaming/StrmWaitingAfterClose.scala | Scala | apache-2.0 | 1,713 |
package ml.combust.mleap.runtime.function
import ml.combust.mleap.runtime.frame.Row
import scala.language.implicitConversions
/** Trait for a LeapFrame selector.
*
* A selector generates values based on other values found
* in a [[Row]]. The name parameters
* to a selector specifies which column of the row t... | combust-ml/mleap | mleap-runtime/src/main/scala/ml/combust/mleap/runtime/function/Selector.scala | Scala | apache-2.0 | 1,569 |
import sbt._
import Keys._
import org.scalatra.sbt._
import org.scalatra.sbt.PluginKeys._
import sbt.ScalaVersion
import twirl.sbt.TwirlPlugin._
import com.typesafe.sbteclipse.plugin.EclipsePlugin.EclipseKeys
object MyBuild extends Build {
val Organization = "jp.sf.amateras"
val Name = "gitbucket"
val Version = ... | chu888chu888/gitbucket | project/build.scala | Scala | apache-2.0 | 2,336 |
package com.twitter.diffy.proxy
import java.net.SocketAddress
import com.twitter.diffy.analysis.{DifferenceAnalyzer, JoinedDifferences, InMemoryDifferenceCollector}
import com.twitter.diffy.lifter.{HttpLifter, Message}
import com.twitter.finagle.{Http, Filter}
import com.twitter.finagle.http.{Method, Request}
import ... | fengshao0907/diffy | src/main/scala/com/twitter/diffy/proxy/HttpDifferenceProxy.scala | Scala | apache-2.0 | 2,292 |
/*
* (c) Copyright 2014 LinkedIn Corp. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | linkedin/RookBoom | services/src/main/scala/com/linkedin/rookboom/util/JsonUtils.scala | Scala | apache-2.0 | 2,200 |
package dao
import com.google.inject.ImplementedBy
import dao.impl.RoleDAOImpl
import model.Role
import scala.concurrent.Future
/**
* Performs role database actions
*
* @author Camilo Sampedro <[email protected]>
*/
@ImplementedBy(classOf[RoleDAOImpl])
trait RoleDAO {
/**
* Adds a new Role
... | ProjectAton/AtonLab | app/dao/RoleDAO.scala | Scala | gpl-3.0 | 892 |
package impulsestorm.stargame.lib
import akka.actor._
import akka.util.duration._
import akka.util.Timeout
import net.liftweb.common.{SimpleActor, Logger}
import java.util.Date
import akka.pattern.ask
class StateSupervisor(
newStateMaster: (String, ActorContext) => Option[ActorRef],
SMTimeout: Int = 300)
ext... | tommycli/stargame | src/main/scala/impulsestorm/stargame/lib/StateCoordination.scala | Scala | agpl-3.0 | 3,105 |
/*
* TimelineRenderingImpl.scala
* (Mellite)
*
* Copyright (c) 2012-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* [email protected]
*/
package de.sciss.mell... | Sciss/Mellite | app/src/main/scala/de/sciss/mellite/impl/timeline/TimelineToolImpl.scala | Scala | agpl-3.0 | 1,955 |
package rta.parser.triggers
import fastparse.noApi._
import java.nio.charset.Charset
import rta.common.Uses
import rta.model.triggers.Implicits._
import rta.model.triggers.Trigger
import rta.parser.TriggerParser
object BluetoothParser extends TriggerParser[Bluetooth] {
import white._
def Prefix: String = Uses.ca... | kjanosz/RuleThemAll | app/src/main/scala/rta/parser/triggers/BluetoothParser.scala | Scala | apache-2.0 | 1,533 |
/*
* 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 ... | brad-kaiser/spark | mllib/src/test/scala/org/apache/spark/ml/util/MLTest.scala | Scala | apache-2.0 | 5,404 |
package ch.ninecode.cim
import org.apache.spark.rdd.RDD
import ch.ninecode.model.Element
case class CIMDifferenceRaw (options: CIMDifferenceOptions) extends CIMDifferenceProcessor
{
def delete (prefix: String, doomed: Element, suffix: String): Option[String] =
{
val strings = doomed.export.split("\\n... | derrickoswald/CIMScala | CIMDifference/src/main/scala/ch/ninecode/cim/CIMDifferenceRaw.scala | Scala | mit | 2,098 |
object Main {
class C[T] {}
class D[T] {}
class E {}
def foo[T, V <: T](c: C[T], d: D[V]) {print(1)}
def foo[T](c : C[T], t: T) {print(2)}
def bar {
/* line: 6 */foo(new C[E], new D[E])
}
} | ilinum/intellij-scala | testdata/resolve2/bug3/SCL3898.scala | Scala | apache-2.0 | 209 |
/*
* 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 ... | kiszk/spark | sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala | Scala | apache-2.0 | 37,162 |
package fpinscala.answers.localeffects
import fpinscala.answers.monads._
object Mutable {
def quicksort(xs: List[Int]): List[Int] = if (xs.isEmpty) xs else {
val arr = xs.toArray
def swap(x: Int, y: Int) = {
val tmp = arr(x)
arr(x) = arr(y)
arr(y) = tmp
}
def partition(l: Int, r: I... | peterbecich/fpinscala | answers/src/main/scala/fpinscala/localeffects/LocalEffects.scala | Scala | mit | 4,558 |
/*
* Copyright (c) 2013-2019 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | RetentionGrid/snowplow | 2-collectors/scala-stream-collector/kafka/src/main/scala/com.snowplowanalytics.snowplow.collectors.scalastream/sinks/KafkaSink.scala | Scala | apache-2.0 | 2,736 |
/*
* Copyright 2017-2022 John Snow Labs
*
* 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... | JohnSnowLabs/spark-nlp | src/main/scala/com/johnsnowlabs/nlp/annotators/TextMatcherModel.scala | Scala | apache-2.0 | 7,033 |
package com.twitter.finagle
import java.net.{InetAddress, InetSocketAddress}
import java.util.{Map => JMap}
import scala.collection.JavaConverters._
import scala.util.control.NoStackTrace
/**
* An [[Address]] represents the physical location of a single host or
* endpoint. It also includes [[Addr.Metadata]] (typica... | adriancole/finagle | finagle-core/src/main/scala/com/twitter/finagle/Address.scala | Scala | apache-2.0 | 2,661 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ConeyLiu/spark | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTableTypesOperation.scala | Scala | apache-2.0 | 3,476 |
package com.socrata.geospace.lib.shapefile
import java.io.File
import com.socrata.geospace.lib.Utils._
import com.socrata.geospace.lib.errors.InvalidShapefileSet
import com.typesafe.scalalogging.slf4j.Logging
import org.opengis.referencing.NoSuchAuthorityCodeException
import org.geoscript.feature._
import org.geoscri... | socrata-platform/geospace | src/main/scala/com/socrata/geospace/lib/shapefile/ShapeFileReader.scala | Scala | apache-2.0 | 2,506 |
package pregnaware.database
import java.time.LocalDate
import akka.util.Timeout
import pregnaware.{DbTest, UnitSpec}
import pregnaware.user.entities.WrappedFriend
import scala.concurrent.duration._
import scala.concurrent.{Future, Await, ExecutionContext}
import scala.util.{Failure, Success}
class FriendTest extend... | jds106/pregnaware | service/src/test/scala/pregnaware/database/FriendTest.scala | Scala | mit | 6,540 |
/*
* Contributions:
* Jean-Francois GUENA: implement "suffixed collection name" feature (issue #39 partially fulfilled)
* ...
*/
package akka.contrib.persistence.mongodb
class CasbahJournalLoadSpec extends JournalLoadSpec(classOf[CasbahPersistenceExtension],"casbah")
//class CasbahSuffixJournalLoadSpec extends ... | alari/akka-persistence-mongo | casbah/src/test/scala/akka/contrib/persistence/mongodb/CasbahJournalLoadSpec.scala | Scala | apache-2.0 | 424 |
package com.twitter.finagle.protobuf.rpc
import java.util.concurrent._
import java.util.concurrent.atomic._
object RpcProtobufSpec extends SpecificationWithJUnit {
def CLIENT_TIMEOUT_SECONDS = 1
def THREAD_COUNT = 40
def REQ_PER_THREAD = 100
def port = 8080
def executorService = Executors.ne... | jamescway/finagle | finagle-protobuf/src/test/scala/com/twitter/finagle/protobuf/rpc/LoadSpec.scala | Scala | apache-2.0 | 3,754 |
/*
* Copyright 2001-2008 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... | hubertp/scalatest | src/main/scala/org/scalatest/SequentialNestedSuiteExecution.scala | Scala | apache-2.0 | 1,973 |
/**
* Copyright (C) 2020 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 ... | orbeon/orbeon-forms | xforms-web/src/main/scala/org/orbeon/xforms/AjaxEventQueue.scala | Scala | lgpl-2.1 | 5,343 |
package org.yotchang4s.ch2.thread
import org.yotchang4s.ch2._
import org.yotchang4s.ch2.board.BoardId
case class ThreadId(value: (BoardId, String)) extends Identity[(BoardId, String)]
trait Thread extends Entity[ThreadId] {
val subject: String
val resCount: Int
} | yotchang4s/gikolet | src/org/yotchang4s/ch2/thread/Thread.scala | Scala | bsd-3-clause | 270 |
package com.twitter.finagle.http
import com.twitter.finagle.{ChannelException, FailureFlags}
import java.net.SocketAddress
/** The Message was too long to be handled correctly */
final class TooLongMessageException private(
ex: Option[Exception],
remote: Option[SocketAddress],
private[finagle] val flags: ... | koshelev/finagle | finagle-base-http/src/main/scala/com/twitter/finagle/http/TooLongMessageException.scala | Scala | apache-2.0 | 804 |
package tadp_grupo5
case class Sucursal (volumenDeposito : Int, pais : String){
var paquetesPorSalir : List[Paquete] = List()
var paquetesPorEntrar : List[Paquete] = List()
var transportes : List[Transporte] = List()
var enviosRealizados: List [Envio] = List()
var pedidosPendientes: List [Paquete] = List()
... | JonaC22/TADP_2C2014_GRUPO_5 | TP2_Scala/Objeto-Funcional/src/tadp_grupo5/Sucursal.scala | Scala | mit | 3,427 |
/**
* Licensed to the Minutemen Group under one or more contributor license
* agreements. See the COPYRIGHT file distributed with this work for
* additional information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in complian... | mohiva/silhouette | modules/provider-oauth2/src/test/scala/silhouette/provider/oauth2/InstagramProviderSpec.scala | Scala | apache-2.0 | 5,290 |
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.