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 |
|---|---|---|---|---|---|
/*
* 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... | sjzhao/shadowsocks-android | src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala | Scala | gpl-3.0 | 21,895 |
package org.bitcoins.node.networking.peer
import org.bitcoins.chain.api.ChainApi
import org.bitcoins.chain.config.ChainAppConfig
import org.bitcoins.core.crypto.DoubleSha256DigestBE
import org.bitcoins.core.p2p._
import org.bitcoins.core.protocol.blockchain.{Block, MerkleBlock}
import org.bitcoins.core.protocol.transa... | bitcoin-s/bitcoin-s-core | node/src/main/scala/org/bitcoins/node/networking/peer/DataMessageHandler.scala | Scala | mit | 12,070 |
/*
* 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 ... | HuaweiBigData/carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/partition/TestShowPartitions.scala | Scala | apache-2.0 | 8,847 |
package test
import play.api.test._
import org.specs2.execute.{Result, AsResult}
abstract class App(app:FakeApplication = App.app) extends WithApplication(app) {
override def around[T: AsResult](t: => T): Result = super.around {
wipeData()
val result = t
result
}
def wipeData() {
}
}
object Ap... | stylight/postgresql-rest-api | test/test/App.scala | Scala | mit | 719 |
package com.lvxingpai.model.mixin
import com.lvxingpai.model.geo.GeoPoint
import scala.beans.BeanProperty
/**
* 经纬度数据
*
* Created by zephyre on 10/20/15.
*/
trait GeoPointEnabled {
@BeanProperty
var location: GeoPoint = null
}
| Lvxingpai/core-model | src/main/scala/com/lvxingpai/model/mixin/GeoPointEnabled.scala | Scala | apache-2.0 | 249 |
/**
* 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... | Chasego/kafka | core/src/test/scala/unit/kafka/network/SocketServerTest.scala | Scala | apache-2.0 | 102,648 |
package com.uebercomputing.io
import java.io.FileFilter
import java.io.File
/**
* Only show files that match one of the extensions or directories.
*/
class FileExtensionFilter(extensions: String*) extends FileFilter {
def accept(path: File): Boolean = {
val result = if (path.isDirectory()) true
else {
... | medale/extension-sorter | src/main/scala/com/uebercomputing/io/FileExtensionFilter.scala | Scala | apache-2.0 | 475 |
package org.brandonhaynes.bfs
import java.io.{DataInput, DataOutput}
import scala.language.implicitConversions
import org.apache.hadoop.io._
/** Implicit helpers useful for converting primitives into graph-compatible entities (ids and metadata) */
object Vertex {
/** Implicitly convert a long value into a vertex id... | BrandonHaynes/timr | src/org/brandonhaynes/bfs/Vertex.scala | Scala | mit | 6,866 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package common.build
//#assets-builder
package controllers.admin
import _root_.controllers.AssetsMetadata
import play.api.http.HttpErrorHandler
import javax.inject._
class Assets @Inject() (errorHandler: HttpErrorHandler, assetsMetadata: A... | wsargent/playframework | documentation/manual/working/commonGuide/build/code/SubProjectsAssetsBuilder.scala | Scala | apache-2.0 | 574 |
package lms
import com.oracle.truffle.api._
import com.oracle.truffle.api.frame._
import com.oracle.truffle.api.nodes._
import com.oracle.truffle.api.nodes.Node._
import scala.annotation.target.field
import org.scalatest._
trait BooleanType extends Base with Types {
case class BooleanAnd(@(Child @field) x: Exp[Boo... | RomanTsegelskyi/lms-truffle | src/main/scala/lms/BooleanType.scala | Scala | gpl-2.0 | 1,144 |
package com.spotsinc.publisher.avro
import java.io.{ByteArrayOutputStream, File, FileOutputStream}
import java.util.UUID
import com.sksamuel.avro4s._
import com.spotify.google.cloud.pubsub.client.Message.encode
import com.spotify.google.cloud.pubsub.client.{Message, Publisher, Pubsub}
import org.apache.avro.Schema
i... | LocalInc/local-library-publisher | publisher/src/main/scala/AvroPublisher.scala | Scala | apache-2.0 | 1,971 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/main/scala/com/waz/model/otr/package.scala | Scala | gpl-3.0 | 1,333 |
/*
* 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... | qiuxin2012/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/SpatialBatchNormalization.scala | Scala | apache-2.0 | 63,943 |
package org.jetbrains.plugins.scala.lang.resolve2
/**
* Pavel.Fatin, 02.02.2010
*/
class ImportPathTest extends ResolveTestBase {
override def folderPath: String = {
super.folderPath + "import/path/"
}
protected override def rootPath(): String = folderPath
def testDir = doTest
//TODO ok
// def testD... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/lang/resolve2/ImportPathTest.scala | Scala | apache-2.0 | 415 |
package algorithms.recursion
import algorithms.recursion.PasswordCracker.solution
import org.scalatest.{FunSuite, WordSpec}
class PasswordCrackerTest extends WordSpec {
"because can do must we what" in {
val result = solution(
"because can do must we what".split(" ").toList,
"wedowhatwemustbecause... | 1178615156/hackerrank | src/test/scala/algorithms/recursion/PasswordCrackerTest.scala | Scala | apache-2.0 | 417 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | monix-reactive/shared/src/main/scala/monix/reactive/internal/builders/CharsReaderObservable.scala | Scala | apache-2.0 | 5,361 |
/*
* Happy Melly Teller
* Copyright (C) 2013 - 2014, Happy Melly http://www.happymelly.com
*
* This file is part of the Happy Melly Teller.
*
* Happy Melly Teller 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 Fo... | HappyMelly/teller | app/models/ExchangeRate.scala | Scala | gpl-3.0 | 3,236 |
package tifmo.document
import tifmo.dcstree.{ Executor, Relation }
import tifmo.inference.{ RuleDo, TermIndex, IEngineCore }
trait RelRightUpEntailing extends Relation {
override def execute[T](ex: Executor, a: T, b: T) {
super.execute(ex, a, b)
(ex, a, b) match {
case (ie: IEngineCore, xa: TermIndex,... | tomtung/tifmo | src/main/scala/tifmo/document/RelRightUpEntailing.scala | Scala | bsd-2-clause | 568 |
/*
* Copyright (c) 2012, 2013, 2014, 2015, 2016 SURFnet BV
* 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, thi... | BandwidthOnDemand/play-nsi-support | src/main/scala/nl/surfnet/nsiv2/messages/Stp.scala | Scala | bsd-3-clause | 7,855 |
/*
* Copyright 2009-2015 LinkedIn, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | thesiddharth/norbert | network/src/test/scala/com/linkedin/norbert/network/server/GcAwareMessageExecutorSpec.scala | Scala | apache-2.0 | 2,804 |
package org.gg.play.authentication.misc
import play.api.Logger
/**
* User: luigi
* Date: 20/04/13
* Time: 16:51
*/
trait Loggable {
lazy val log = Logger("application." + this.getClass.getName)
}
| gigiigig/play2-authentication | app/misc/Loggable.scala | Scala | gpl-3.0 | 204 |
package dbtarzan.gui.config.connections
import scalafx.scene.control.{ComboBox, ListCell}
import scalafx.scene.Parent
import scalafx.collections.ObservableBuffer
import scalafx.Includes._
import dbtarzan.db.{Schema, Schemas}
import dbtarzan.gui.TControlBuilder
import scalafx.event.ActionEvent
import scalafx.util.Strin... | aferrandi/dbtarzan | src/main/scala/dbtarzan/gui/config/connections/ComboSchemas.scala | Scala | apache-2.0 | 1,986 |
/*
* 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 ... | spark-test/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/RegexpExpressionsSuite.scala | Scala | apache-2.0 | 15,529 |
package models
import models.dao._
@SuppressWarnings(Array("org.wartremover.warts.FinalCaseClass"))
case class ItemBids(higherBid: Option[Bid], bidsList: List[Bid] = Nil)(implicit val item: Item) {
@SuppressWarnings(Array("org.wartremover.warts.TraversableOps"))
def this(bidsList: List[Bid], item: Item) =
th... | jcranky/lojinha | app/models/ItemBids.scala | Scala | gpl-3.0 | 850 |
package battle
import battle.Ability.{Strength, Constitution, Dexterity, AbilityType}
import battle.Equippable.Attack
import battle.classes.{NoClass, GladiatorClass}
import battle.races.{Race, Human}
class Gladiator(val name: String,
abilities: Map[AbilityType, Ability],
val gladiatorC... | bbalser/gladiator-actors | src/main/scala/battle/Gladiator.scala | Scala | cc0-1.0 | 1,128 |
package com.tribbloids.spookystuff.uav.planning
import com.tribbloids.spookystuff.row.SpookySchema
import org.apache.spark.ml.uav.{DVec, Vec}
object Constraints {
object AltitudeOnly extends Constraint {
override def rewrite(v: Vec, schema: SpookySchema): Vec = {
val alt = v(2)
new DVec(Array(0, 0, ... | tribbloid/spookystuff | uav/src/main/scala/com/tribbloids/spookystuff/uav/planning/Constraints.scala | Scala | apache-2.0 | 338 |
/*
* Copyright 2014 http4s.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 law or agreed to i... | http4s/blaze | http/src/main/scala/org/http4s/blaze/http/package.scala | Scala | apache-2.0 | 738 |
import leon.lang.StaticChecks._
object StaticChecks2 {
def add(n: BigInt, m: BigInt): BigInt = {
require(n >= 0 && m >= 0)
var res = if(m == 0) n else add(n, m-1) + 1
assert(res >= 0)
res
} ensuring((res: BigInt) => res >= 0)
}
| epfl-lara/leon | src/test/resources/regression/verification/purescala/valid/StaticChecks2.scala | Scala | gpl-3.0 | 252 |
package controllers
import javax.inject._
import actions.GeekAction
import daos.StripDAO
import org.bson.types.ObjectId
import play.api.mvc._
import scala.concurrent.{ExecutionContext, Future}
/**
* This controller creates an `Action` that demonstrates how to write
* simple asynchronous code in a controller. It u... | comicgator/comicgator | maestro/app/controllers/StripController.scala | Scala | mit | 906 |
package breeze.text.transform
import breeze.data._
import breeze.linalg.Counter
/**
* Filter that removes rare word that occur in fewer than threshold documents
* Syntax: new RemoveRareWords(10) apply (data)
*
* @author dlwh
*/
class RemoveRareWords(threshold: Int = 10) {
def apply[T, Obs <: Observation[Seq[T]... | tjhunter/scalanlp-core | process/src/main/scala/breeze/text/transform/RemoveRareWords.scala | Scala | apache-2.0 | 566 |
/*
* TimelineViewState.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.mellite.... | Sciss/Mellite | app/src/main/scala/de/sciss/mellite/impl/state/TimelineViewState.scala | Scala | agpl-3.0 | 4,993 |
/*
* Copyright (c) 2018. Fengguo Wei and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0
* which accompanies this distribution, and is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* Detailed contributors ar... | arguslab/Argus-SAF | jawa/src/main/scala/org/argus/jawa/core/elements/FieldFQN.scala | Scala | apache-2.0 | 1,247 |
class Usuario(nom : String) {
// Atributos
val nombre:String = nom
// Metodos
def saludar:String = s"Saludo de $nombre"
override def toString = s"Usuario($nombre)"
}
// Parametro del constructor convertido a atributo
class UsuarioMaligno(val nombre: String) {
def saludar:String = s"Saludo tenebroso de $nombre"
... | romanarranz/NTP | S3/clase_usuario_parametros.scala | Scala | mit | 1,035 |
package cn.gridx.scala.lang.classes.constructors.fields.visibility
/**
* Created by tao on 8/20/15.
*/
object Test extends App {
val cat = new Cat(100, "200", true, "300")
// println(cat.x + " | " + cat.y)
}
| TaoXiao/Scala | lang/src/main/scala/cn/gridx/scala/lang/classes/constructors/fields/visibility/Test.scala | Scala | apache-2.0 | 219 |
package gwi.mawex.worker
import akka.actor.{ActorRef, ActorSystem, Address, AddressFromURIString, Props, RootActorPath}
import akka.cluster.client.{ClusterClient, ClusterClientSettings}
import com.typesafe.config.Config
import com.typesafe.scalalogging.LazyLogging
import gwi.mawex.RemoteService.HostAddress
import gwi.... | GlobalWebIndex/mawex | src/core/src/main/scala/gwi/mawex/worker/WorkerCmd.scala | Scala | mit | 7,143 |
package akka.persistence.jdbc.integration
import akka.persistence.jdbc.query.{ EventAdapterTest, MysqlCleaner, OracleCleaner, PostgresCleaner, SqlServerCleaner }
class PostgresScalaEventAdapterTest extends EventAdapterTest("postgres-application.conf") with PostgresCleaner
class MySQLScalaEventAdapterTest extends Eve... | dnvriend/akka-persistence-jdbc | core/src/it/scala/akka/persistence/jdbc/integration/EventAdapterTest.scala | Scala | apache-2.0 | 599 |
package co.rc.smserviceclient.infrastructure.acl.dtos.responses
import argonaut._, Argonaut._
/**
* Class that represents an error response
* @param response Error response message
* @param statusCode Error response status code
*/
case class ErrorResponseDTO( response: String,
statusCode: Option[ Int ] = None )... | rodricifuentes1/session-manager-service-client | src/main/scala/co/rc/smserviceclient/infrastructure/acl/dtos/responses/ErrorResponseDTO.scala | Scala | mit | 686 |
package com.jayway.textmining
import com.weiglewilczek.slf4s.Logging
import java.io.File
import scalaz.{Failure, Success}
/**
* Copyright 2012 Amir Moulavi ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License... | amir343/grape | src/main/scala/com/jayway/textmining/Buckshot.scala | Scala | apache-2.0 | 2,233 |
package com.seanshubin.detangler.report
import org.scalatest.FunSuite
class DependencyTemplateRulesTest extends FunSuite {
test("standalone detail") {
//given
val standaloneTemplateText =
"""<div class="standalone-dependency">
| <p class="caption">replace-me</p>
| <ul class="standalo... | SeanShubin/detangler | report/src/test/scala/com/seanshubin/detangler/report/DependencyTemplateRulesTest.scala | Scala | unlicense | 1,773 |
/**
* Copyright 2015, deepsense.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 applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/main/scala/io/deepsense/deeplang/doperables/spark/wrappers/estimators/IDFEstimator.scala | Scala | apache-2.0 | 1,576 |
package data
import java.util.concurrent.TimeUnit
import java.util.function.Supplier
import akka.actor.ActorSystem
import play.libs.F.Promise
import play.libs.HttpExecution
import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.duration.FiniteDuration
import akka.pattern.after
class FutureUtil(a... | brikis98/ping-play | sample-app-common/src/main/scala/data/FutureUtil.scala | Scala | mit | 1,526 |
package com.github.holothuroid.covella.examples
import com.github.holothuroid.covella._
/**
* The calendar of the Maya people, as best as I understand it.
* Includes Tzolkin, Haab, Long Count and Lords of Night.
* Timestamps are set in regard to 1970-01-01 CE for synchronisation with other calendars.
... | Holothuroid/Covella | covella/examples/MayaCalendar.scala | Scala | mit | 5,811 |
/*
* 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 ... | aosagie/spark | sql/core/src/test/scala/org/apache/spark/sql/DateFunctionsSuite.scala | Scala | apache-2.0 | 29,015 |
/*
* 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 ... | TiVo/samza | samza-kafka/src/test/scala/org/apache/samza/checkpoint/kafka/TestKafkaCheckpointManager.scala | Scala | apache-2.0 | 9,225 |
package dispatch.cloudapp
object DispatchContrib {
import com.ning.http.client.{
AsyncCompletionHandler, RequestBuilder, Response, Realm
}
import dispatch._
trait FileVerbs extends RequestVerbs {
import java.io.File
def <<< (file: File) =
subject.PUT.setBody(file)
def << (file: File) =
... | softprops/dispatch-cloudapp | src/main/scala/contrib.scala | Scala | mit | 2,033 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.libs.concurrent
import akka.actor.ActorSystem
import scala.concurrent.{ Future, TimeoutException }
import scala.concurrent.duration.FiniteDuration
/**
* This trait is used to provide a non-blocking timeout on an operation ... | aradchykov/playframework | framework/src/play/src/main/scala/play/api/libs/concurrent/Timeout.scala | Scala | apache-2.0 | 4,946 |
package com.falmarri.finagle
import scala.util.Random
import scala.collection.immutable.StringOps
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.twitter.finagle.Service
import com.twitter.finagle.exp.Mysql
import com.twitter.finagle.exp.mysql.... | denkab/FrameworkBenchmarks | frameworks/Scala/finagle/src/main/scala/com/falmarri/finagle/Finagle.scala | Scala | bsd-3-clause | 3,363 |
import scalaxb.compiler.wsdl11.Driver
import java.io.File
import scalaxb.compiler.Config
import scalaxb.stockquote.server._
object Wsdl11DocumentBareTest extends TestBase with JaxwsTestBase {
override val module = new Driver // with Verbose
def serviceImpl:DocumentLiteralBareService = new DocumentLiteralBareServi... | justjoheinz/scalaxb | integration/src/test/scala/Wsdl11DocumentBareTest.scala | Scala | mit | 1,453 |
package gitbucket.core.util
import org.scalatest.FunSpec
class DirectorySpec extends FunSpec {
describe("GitBucketHome") {
it("should set under target in test scope") {
assert(Directory.GitBucketHome == new java.io.File("target/gitbucket_home_for_test").getAbsolutePath)
}
}
// test("GitBucketHome ... | McFoggy/gitbucket | src/test/scala/gitbucket/core/util/DirectorySpec.scala | Scala | apache-2.0 | 401 |
package org.openurp.edu.eams.web.action.common
import org.beangle.commons.collection.Collections
import org.beangle.data.jpa.dao.OqlBuilder
import org.beangle.commons.lang.Strings
import org.openurp.edu.base.Project
import org.openurp.edu.base.Student
abstract class AbstractStudentProjectSupportAction extends Mult... | openurp/edu-eams-webapp | web/src/main/scala/org/openurp/edu/eams/web/action/common/AbstractStudentProjectSupportAction.scala | Scala | gpl-3.0 | 1,009 |
package commands.makemkv
/**
* A trait that, given a list of command line arguments will produce a stream of strings. This is used to
* abstract away running makemkvcon as a native process.
* Created by alex on 05/05/15.
*/
trait MakeMkvConCommand {
def execute(arguments: Seq[String]): Stream[String]
}
| unclealex72/ripper | src/main/scala/commands/makemkv/MakeMkvConCommand.scala | Scala | mit | 312 |
// Copyright (C) 2020 The Android Open Source Project
//
// 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 ... | qtproject/qtqa-gerrit | e2e-tests/src/test/scala/com/google/gerrit/scenarios/DeleteProject.scala | Scala | apache-2.0 | 1,164 |
package kneelnrise.warp10scala.services
import akka.NotUsed
import akka.actor.ActorSystem
import akka.http.scaladsl.model.HttpHeader.ParsingResult
import akka.http.scaladsl.model.{HttpHeader, HttpRequest, HttpResponse}
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Flow, Source}
import akka.util.Byt... | kneelnrise/warp10-scala | src/main/scala/kneelnrise/warp10scala/services/Warp10CommonClient.scala | Scala | mit | 3,004 |
/*
* 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 ... | sureshthalamati/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousDataSourceRDDIter.scala | Scala | apache-2.0 | 8,460 |
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. 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
* no... | benhutchison/scala-swing | examples/src/main/scala/scala/swing/examples/tutorials/components/CustomComboBoxDemo.scala | Scala | bsd-3-clause | 5,049 |
/*
* 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 ... | chuckchen/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingAggregationSuite.scala | Scala | apache-2.0 | 36,500 |
package net.mtgto.garoon.user
import org.specs2.mutable.Specification
class UserSpec extends Specification {
"User" should {
"be able to create an event from valid xml" in {
val xml =
<user
key="48"
version="1245376338"
order="0"
login_name="naka"
... | mtgto/garoon | src/test/scala/net/mtgto/garoon/user/UserSpec.scala | Scala | gpl-3.0 | 765 |
package org.jetbrains.plugins.scala.testingSupport.utest.scala2_10
import org.jetbrains.plugins.scala.testingSupport.utest.UTestSimpleTest
/**
* @author Roman.Shein
* @since 04.09.2015.
*/
class UTestSimpleTest_2_10 extends UTestTestBase_2_10 with UTestSimpleTest {
}
| whorbowicz/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/utest/scala2_10/UTestSimpleTest_2_10.scala | Scala | apache-2.0 | 277 |
package me.apidoc.swagger
case class SchemaType(
swagger: String,
apidoc: String
)
object SchemaType {
val all = Seq(
SchemaType("int32", "integer"),
SchemaType("int64", "long"),
SchemaType("float", "double"),
SchemaType("decimal", "decimal"),
SchemaType("double", "double"),
SchemaType(... | Seanstoppable/apidoc | swagger/src/main/scala/me/apidoc/swagger/SchemaType.scala | Scala | mit | 1,096 |
/*
* 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 ... | zohar-mizrahi/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/aggfunctions/AvgAggFunction.scala | Scala | apache-2.0 | 10,006 |
/*
* Copyright 2015-2016 Snowflake 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 ... | snowflakedb/spark-snowflakedb | src/it/scala/net/snowflake/spark/snowflake/FilterPushdownIntegrationSuite.scala | Scala | apache-2.0 | 3,458 |
package es.weso.wiFetcher.dao
import cucumber.api.scala.ScalaDsl
import cucumber.api.scala.EN
import org.scalatest.Matchers
import es.weso.wiFetcher.entities.traits.SubIndex
import es.weso.wiFetcher.entities.traits.Component
import es.weso.wiFetcher.fetchers.SpreadsheetsFetcher
import es.weso.wiFetcher.utils.FileUtils... | weso/wiFetcher | test/es/weso/wiFetcher/dao/SubIndexDAOImplSteps.scala | Scala | apache-2.0 | 3,923 |
/*
* Copyright 2019 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/scio | scio-google-cloud-platform/src/main/scala/com/spotify/scio/bigquery/client/TableOps.scala | Scala | apache-2.0 | 11,655 |
package org.scalatra
import test.scalatest.ScalatraFunSuite
class ErrorHandlerTest extends ScalatraFunSuite {
trait TestException extends RuntimeException
case class Exception1() extends TestException
case class Exception2() extends TestException
class BaseServlet extends ScalatraServlet {
get("/1") {
... | kuochaoyi/scalatra | core/src/test/scala/org/scalatra/ErrorHandlerTest.scala | Scala | bsd-2-clause | 1,212 |
// Copyright 2016 The Bazel Authors. 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 appl... | sdtwigg/rules_scala | test/src/main/scala/scala/test/ScalaLibResources.scala | Scala | apache-2.0 | 932 |
package edu.rice.habanero.benchmarks.logmap
import edu.rice.habanero.actors.HabaneroActor
import edu.rice.habanero.benchmarks.logmap.LogisticMapConfig._
import edu.rice.habanero.benchmarks.{Benchmark, BenchmarkRunner}
import edu.rice.hj.Module0._
import edu.rice.hj.api.{HjDataDrivenFuture, HjRunnable, HjSuspendable}
... | shamsmahmood/savina | src/main/scala/edu/rice/habanero/benchmarks/logmap/LogisticMapHabaneroPauseResumeActorBenchmark.scala | Scala | gpl-2.0 | 5,106 |
/*
* 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 ... | jfeltesse-mdsol/zipkin | zipkin-query/src/main/scala/com/twitter/zipkin/query/adjusters/TimeSkewAdjuster.scala | Scala | apache-2.0 | 10,396 |
package edu.rice.habanero.benchmarks.bitonicsort
import java.util.Random
import edu.rice.habanero.actors.{FuncJavaActor, FuncJavaActorState, FuncJavaPool}
import edu.rice.habanero.benchmarks.philosopher.PhilosopherAkkaActorBenchmark.ExitMessage
import edu.rice.habanero.benchmarks.{Benchmark, BenchmarkRunner}
import ... | smarr/savina | src/main/scala/edu/rice/habanero/benchmarks/bitonicsort/BitonicSortFuncJavaActorBenchmark.scala | Scala | gpl-2.0 | 16,684 |
package io.opencensus.scala.akka.http.utils
import akka.NotUsed
import akka.http.scaladsl.model.{HttpEntity, HttpResponse}
import akka.stream.scaladsl.Flow
import akka.stream.stage.{GraphStage, GraphStageLogic, InHandler, OutHandler}
import akka.stream.{Attributes, FlowShape, Inlet, Outlet}
object ExecuteAfterRespons... | census-ecosystem/opencensus-scala | akka-http/src/main/scala/io/opencensus/scala/akka/http/utils/ExecuteAfterResponse.scala | Scala | apache-2.0 | 1,805 |
package crakken.actor
import akka.actor._
import crakken.data.repository._
import scala.concurrent.ExecutionContext
import ExecutionContext.Implicits.global
import akka.event.LoggingReceive
import akka.util.ByteString
import reactivemongo.bson.BSONDocument
object CrakkenRepositoryServiceActor {
def props(repository... | CrakkenCrawler/crakken | app/crakken/actor/CrakkenRepositoryServiceActor.scala | Scala | apache-2.0 | 2,622 |
package mb1102a
import skidbladnir.{Assembly,Base,Compo,Handle,Interface,Mono,Multi},
rs485master.{RS485,IRS485,ISocket},
owen_io.{Address,Command,IOConst,Port,OwenIOException}
object Test {def main(args: Array[String]): Unit = {val a = new TestAssembly}}
class TestAssembly extends Assembly {... | AlexCAB/ChartRecorder | mb1102a/Test.scala | Scala | mit | 1,529 |
/** soar
*
* Copyright (c) 2017 Hugo Firth
* Email: <[email protected]/>
*
* 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
*
... | NewcastleComputingScience/student-outcome-accelerator | glance-eval/js/src/main/scala/uk/ac/ncl/la/soar/glance/web/client/component/SurveyResponseForm.scala | Scala | apache-2.0 | 3,356 |
package com.datastax.spark.connector.sql
import com.datastax.spark.connector.SparkCassandraITFlatSpecBase
import com.datastax.spark.connector.cql.CassandraConnector
import com.datastax.spark.connector.embedded.SparkTemplate._
import org.apache.spark.sql.cassandra.CassandraSQLContext
class CassandraSQLSpec extends Sp... | viirya/spark-cassandra-connector | spark-cassandra-connector/src/it/scala/com/datastax/spark/connector/sql/CassandraSQLSpec.scala | Scala | apache-2.0 | 21,463 |
/*******************************************************************************
* Copyright 2010 Maxime Lévesque
*
* 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.apach... | takezoux2/squeryl-experimental | src/main/scala/org/squeryl/dsl/fsm/CaseOfNumericalExpressionMatchStart.scala | Scala | apache-2.0 | 3,637 |
package kidstravel.client.logger
import scala.scalajs.js
import scala.scalajs.js.annotation.JSName
/**
* Facade for functions in log4javascript that we need
*/
@js.native
private[logger] trait Log4JavaScript extends js.Object {
def getLogger(name:js.UndefOr[String]):JSLogger = js.native
def setEnabled(enabled:B... | devkat/kidstravel | client/src/main/scala/kidstravel/client/logger/Log4JavaScript.scala | Scala | apache-2.0 | 4,235 |
package com.toolkit.util.spark.hbase
/**
* Created by rahul on 08/02/15.
*/
object packageinfo {
//TODO : will implement later
}
| rahulkumar-aws/logManagementToolkit | src/main/scala/com/toolkit/util/spark/hbase/packageinfo.scala | Scala | apache-2.0 | 132 |
package com.lljv.analytics.hadoopengine
import org.apache.spark.SparkConf
import org.apache.spark.streaming.{StreamingContext, Seconds}
import scala.util.control.NonFatal
class SparkStreamEngine(val settings: SparkStreamSettings) extends Serializable {
val sparkConfig: Option[SparkConf] = try {
Some(new Spark... | dotdeb/Science-Finder | Analytics/HadoopEngine/src/main/scala/com/lljv/analytics/hadoopengine/SparkStreamEngine.scala | Scala | apache-2.0 | 933 |
package com.datastax.spark.connector.writer
import java.io.{OutputStream, ObjectOutputStream}
import java.nio.ByteBuffer
import scala.collection.JavaConversions._
import com.datastax.spark.connector.util.ByteBufferUtil
/** Estimates amount of memory required to serialize Java/Scala objects */
object ObjectSizeEsti... | Stratio/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/writer/ObjectSizeEstimator.scala | Scala | apache-2.0 | 1,707 |
package lila.app
package templating
import play.twirl.api.Html
import lila.api.Context
import lila.forum.Post
trait ForumHelper { self: UserHelper with StringHelper =>
private object Granter extends lila.forum.Granter {
protected def userBelongsToTeam(teamId: String, userId: String): Boolean =
Env.team... | clarkerubber/lila | app/templating/ForumHelper.scala | Scala | agpl-3.0 | 1,210 |
package views.html
import play.templates._
import play.templates.TemplateMagic._
import play.api.templates._
import play.api.templates.PlayMagic._
import models._
import controllers._
import java.lang._
import java.util._
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import play.... | MattCCieslak/surferpedia | target/scala-2.10/src_managed/main/views/html/laird.template.scala | Scala | mit | 3,894 |
/**
* 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"); yo... | themarkypantz/kafka | core/src/test/scala/unit/kafka/server/epoch/OffsetsForLeaderEpochTest.scala | Scala | apache-2.0 | 4,840 |
package notebook.client
import java.io.File
import akka.actor.{Actor, ActorRef, Props}
import notebook.OutputTypes._
import notebook.PresentationCompiler
import notebook.kernel._
import notebook.JobTracking
import notebook.kernel.repl.common.ReplT
import notebook.util.{CustomResolvers, Deps}
import org.joda.time.Loca... | radek1st/spark-notebook | modules/kernel/src/main/scala-2.10/notebook/ReplCalculator.scala | Scala | apache-2.0 | 20,737 |
//
// Codex - a multi-language code indexer and grokker
// http://github.com/samskivert/codex
package codex.data
/** Defines a fully qualified project id. This is rooted in the Maven style and contains:
* `groupId`, `artifactId` and `version`.
*/
case class FqId (groupId :String, artifactId :String, version :Stri... | samskivert/codex | src/main/scala/codex/data/FqId.scala | Scala | bsd-3-clause | 666 |
// Copyright (c) 2011 Paul Butcher
//
// 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, copy, modify, merge, publish,... | paulbutcher/borachio | core_tests/src/test/scala/MockFunctionTest.scala | Scala | mit | 9,192 |
package es.weso.computex.profile
import java.net.URI
import scala.io.Source
import com.hp.hpl.jena.query.QueryFactory
import com.hp.hpl.jena.rdf.model.Model
import com.hp.hpl.jena.rdf.model.ModelFactory
import com.hp.hpl.jena.rdf.model.RDFList
import com.hp.hpl.jena.rdf.model.RDFNode
import com.hp.hpl.jena.rdf.model.R... | weso/computex | app/es/weso/computex/profile/ProfileParser.scala | Scala | apache-2.0 | 8,161 |
/*
* Copyright 2014-2021 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... | brharrington/atlas | atlas-chart/src/main/scala/com/netflix/atlas/chart/GraphEngine.scala | Scala | apache-2.0 | 945 |
package org.brijest.storm
package engine
package impl.local
import scala.util.parsing.combinator._
import scala.concurrent.SyncVar
import collection._
import com.weiglewilczek.slf4s._
import model._
class LocalEngine(config: Config, val player: Player, w: World) extends Engine with Engine.State with Logging {
eng... | axel22/scala-2d-game-editor | src/main/scala/org/brijest/storm/engine/impl/local/LocalEngine.scala | Scala | bsd-3-clause | 3,157 |
/**
* Copyright 2016 Confluent 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 a... | randyzingle/tools | gradle-streams/src/main/scala/io/confluent/examples/streams/MapFunctionScalaExample.scala | Scala | apache-2.0 | 6,637 |
package com.github.xiaodongw.swagger.finatra
import com.twitter.finagle.http.Request
import com.twitter.finatra.http.Controller
import com.twitter.finatra.response.Mustache
import io.swagger.models.Swagger
import io.swagger.util.Json
@Mustache("index")
case class SwaggerView(title: String, path: String)
class Swagge... | forthy/swagger-finatra | src/main/scala/com/github/xiaodongw/swagger/finatra/SwaggerController.scala | Scala | apache-2.0 | 727 |
package dragon
import java.awt.{BasicStroke, Color}
object Config {
val edgeLength = 2
val generations = 20
val startPosition = Pos(Image.width * 3 / 4, Image.height * 3 / 4)
val fileName: String = "D:\\\\tmp\\\\dragon-turtle.png"
object Image {
val width: Int = 10000
val height:... | Nelosh/dragon-curve | src/main/scala/dragon/Dragon.scala | Scala | unlicense | 2,629 |
package controllers
import play.api.libs.json._
import java.io._
import java.util.regex._
import scala.collection.mutable.HashMap
case class Annotation(motifNum: Int, reverse: Boolean, position: Int, gene: String, pvalue: Double)
case class GeneAnnotations(gene: String, annotations: Seq[Annotation])
case class MotifI... | jashworth-isb/cmonkey-python | cluster_viewer/app/controllers/SnapshotFormat.scala | Scala | lgpl-3.0 | 5,514 |
package demo
import chandu0101.scalajs.react.components._
import demo.components._
import demo.components.materialui._
import demo.components.{InfoTemplate, LeftNav, LeftNavPage, ScalaCSSTutorial}
import scalacss.Defaults._
import scalacss.ScalaCssReact._
import scalacss.mutable.GlobalRegistry
object AppCSS {
def ... | elacin/scalajs-react-components | demo/src/main/scala/demo/AppCSS.scala | Scala | apache-2.0 | 833 |
package com.brkyvz.spark.linalg
import org.apache.spark.mllib.linalg.{Matrix, DenseMatrix, SparseMatrix}
trait MatrixLike extends Serializable {
/** Number of rows. */
def numRows: Int
/** Number of columns. */
def numCols: Int
def size: Int = numRows * numCols
def apply(i: Int): Double
import func... | brkyvz/lazy-linalg | src/main/scala/com/brkyvz/spark/linalg/MatrixLike.scala | Scala | apache-2.0 | 16,299 |
package com.twitter.finagle.thrift
import com.twitter.finagle._
import com.twitter.finagle.tracing._
import com.twitter.finagle.util.ByteArrays
import com.twitter.util.Future
import java.net.InetSocketAddress
import org.apache.thrift.protocol.{TMessage, TMessageType, TProtocolFactory, TBinaryProtocol}
import org.apach... | firebase/finagle | finagle-thrift/src/main/scala/com/twitter/finagle/thrift/ThriftServerFramedCodec.scala | Scala | apache-2.0 | 7,517 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/sql/SortTest.scala | Scala | apache-2.0 | 2,179 |
//package io.skysail.core.app.resources
//
//import io.skysail.core.restlet.SkysailServerResource
//import io.skysail.core.restlet.resources.RedirectResourceOld
//import io.skysail.core.um.domain.Credentials
//
//class LoginResource extends RedirectResourceOld[Credentials] {
// def getEntity(): Credentials = null
//
/... | evandor/skysail-core | skysail.core/src/io/skysail/core/app/resources/LoginResource.scala | Scala | apache-2.0 | 665 |
package jp.seraphr.collection.wrapper
import java.util.List
import java.lang.Iterable
import jp.seraphr.collection.builder.ListWrapperBuilder
import jp.seraphr.common.Converter
import jp.seraphr.common.Tuple2
class ListWrapper[_Elem](aBase: List[_Elem]) extends Wrapper[_Elem, ListWrapper[_Elem]] {
type _Container[X... | seraphr/collection-wrapper | src/main/scala/jp/seraphr/collection/wrapper/ListWrapper.scala | Scala | bsd-2-clause | 925 |
package astrac.springy
case class Book(isbn: String, title: String, author: String)
object Fixtures {
val sirensOfTitan = Book("0000000000000", "The Sirens Of Titan", "Kurt Vonnegut")
val protocolsOfTralfamadore = Book("1111111111111", "The Protocols of the Elders of Tralfamadore", "Kilgore Trout")
val gospelFr... | Astrac/springy | src/test/scala/astrac/springy/fixtures.scala | Scala | mit | 495 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | sql/core/src/test/scala/org/apache/spark/sql/execution/ExchangeSuite.scala | Scala | apache-2.0 | 1,345 |
package com.twitter.scrooge
import com.twitter.scrooge.thrift_validation.ThriftConstraintValidator
object LongAnnotationValueConstraintValidator extends ThriftConstraintValidator[Long, Long] {
/**
* The IDL annotation for this constraint validator is validation.longEquals = "7L"
* where the annotation value ... | twitter/scrooge | scrooge-core/src/test/scala/com/twitter/scrooge/LongAnnotationValueConstraintValidator.scala | Scala | apache-2.0 | 749 |
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.