code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package com.azavea.gtfs
import com.github.nscala_time.time.Imports._
/**
* Represents a stop time in a sequence of stops in a trip
* @param arrival_time arrival time as offset from midnight on a given day
* @param departure_time departure time as offset from midnight on a given day
* @param shape_dist_traveled ho... | flibbertigibbet/open-transit-indicators | scala/gtfs/src/main/scala/com/azavea/gtfs/StopTimeRecord.scala | Scala | gpl-3.0 | 544 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | travisbrown/scalatest | src/main/scala/org/scalatest/tools/NarrowJOptionPane.scala | Scala | apache-2.0 | 974 |
/*
* 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 ... | spark0001/spark2.1.1 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala | Scala | apache-2.0 | 26,994 |
package concrete.constraint.extension
import concrete.{IntDomain, Variable}
import org.scalacheck.Gen
import org.scalatest.{FlatSpec, Matchers, OptionValues}
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
class MDDRelationTest extends FlatSpec with Matchers with ScalaCheckPropertyChecks with OptionValu... | concrete-cp/concrete | src/test/scala/concrete/constraint/extension/MDDRelationTest.scala | Scala | lgpl-2.1 | 2,879 |
package intro
object Hello {
def main(args: Array[String]): Unit = {
println("Hello, world!")
}
}
| acanda/scala-intro-dojo | Scala Intro/src/main/scala/intro/Hello.scala | Scala | apache-2.0 | 109 |
/*
* Copyright 2013 Michał Rus <https://michalrus.com/>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | michalrus/agh-google-scholar-trends | src/main/scala/edu/agh/gst/consumer/CsvExporter.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 may ... | witgo/spark | core/src/main/scala/org/apache/spark/Dependency.scala | Scala | apache-2.0 | 5,505 |
/*
* 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/main/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/BasicConnectionProvider.scala | Scala | apache-2.0 | 2,110 |
/**
* 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... | TiVo/kafka | core/src/test/scala/unit/kafka/zookeeper/ZooKeeperClientTest.scala | Scala | apache-2.0 | 34,556 |
/*
* Copyright © 2015 Reactific Software LLC. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to us... | reactific/RxMongo | messages/src/main/scala/rxmongo/messages/Projection.scala | Scala | mit | 8,776 |
package com.geeksville.andropilot.gui
import android.os.Bundle
import android.preference.PreferenceFragment
import android.app.Activity
import com.geeksville.andropilot.FlurryActivity
import com.geeksville.andropilot.R
import android.preference.PreferenceActivity.Header
import android.preference.PreferenceActivity
imp... | geeksville/arduleader | andropilot/src/main/scala/com/geeksville/andropilot/gui/SettingsActivity.scala | Scala | gpl-3.0 | 2,711 |
/*
* 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 ... | minixalpha/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLListenerSuite.scala | Scala | apache-2.0 | 19,915 |
package weightedroundrobin
import cats.data.State
import scala.concurrent.{ExecutionContext, Future}
import scala.language.higherKinds
import scala.util.control.NonFatal
import scala.reflect.runtime.universe._
/**
* Created by Tharindu Galappaththi on 9/29/17.
*/
trait RoundRobin[R <: Resource, F[B] <: Seq[B]] {... | TharinduDG/weightedroundrobin | src/main/scala/weightedroundrobin/RoundRobin.scala | Scala | apache-2.0 | 9,572 |
/*
* This software is licensed under the GNU Affero General Public License, quoted below.
*
* This file is a part of BitWatts.
*
* Copyright (C) 2011-2015 Inria, University of Lille 1,
* University of Neuchâtel.
*
* BitWatts is free software: you can redistribute it and/or modify
* it under the terms of the GN... | Spirals-Team/bitwatts | bitwatts-core/src/main/scala/org/powerapi/bitwatts/module/virtio/VirtioSensorConfiguration.scala | Scala | agpl-3.0 | 1,412 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | laserson/adam | adam-core/src/test/scala/org/bdgenomics/adam/rdd/TreeRegionJoinSuite.scala | Scala | apache-2.0 | 2,919 |
package io.transwarp.midas.constant.midas.params
/**
* Created by tianming on 4/20/16.
*/
object SharedParams {
// shared params
val RegParam = "regParam" // "regularization parameter (>= 0)"
val MaxIter = "maxIter" // "maximum number of iterations (>= 0)"
val FeaturesCol = "featuresCol" // "features colum... | transwarpio/rapidminer | api-driver/src/main/scala/io/transwarp/midas/constant/midas/params/SharedParams.scala | Scala | gpl-3.0 | 1,754 |
package com.sretsnom.mangareader.server
import akka.actor.{ActorSystem, Props}
import akka.io.IO
import com.sretsnom.mangareader.server.ServiceConfig.HttpConfig._
import com.typesafe.scalalogging.LazyLogging
import spray.can.Http
object ServerApp extends App with LazyLogging {
implicit val system = ActorSystem("m... | sretsnom/mangareader | serverMR/src/main/scala/com/sretsnom/mangareader/server/ServerApp.scala | Scala | gpl-3.0 | 1,471 |
package com.cloudray.scalapress.plugin.ecommerce
/** @author Stephen Samuel */
class EmailReportService(dao: OrderDao) {
def emails: Seq[String] = dao.emails
def csv: String = emails.mkString("\n")
}
| vidyacraghav/scalapress | src/main/scala/com/cloudray/scalapress/plugin/ecommerce/EmailReportService.scala | Scala | apache-2.0 | 205 |
import org.scalatest.{FlatSpec, Matchers}
/**
* Created by Chongguang on 2016/12/18.
*/
import december2016.Day18._
class Day18Spec extends FlatSpec with Matchers {
"isOpen: " should "reture ture for b, c, d, e, or f and false for others" in {
newRow("..^^.") shouldBe ".^^^^"
newRow(".^^^..^.^^") shou... | chongguang/adventofcode | src/test/scala/Day18Spec.scala | Scala | mit | 1,218 |
package com.monkeynuthead.keys
import org.monkeynuthead.scalajs.tone.Tone
import org.scalajs.dom
import scalacss.ScalatagsCss._
import scalatags.JsDom.all._
import scalatags.JsDom.svgTags.{polygon, svg}
import scalatags.JsDom.svgAttrs.points
object KeysApp {
private case class NoteConfig(name: String,... | georgenicoll/keys | src/main/scala/com/monkeynuthead/keys/KeysApp.scala | Scala | gpl-3.0 | 4,013 |
/*
* 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/feats/FeatType.scala | Scala | apache-2.0 | 4,357 |
package org.hotsextra.matchmaking
package entries
import java.time.Instant
import rating.Rating
case class HeroLeagueEntry(playerid: Int, rating: Rating, jointime: Instant)
case class QuickMatchEntry(playerid: Int, rating: Rating, jointime: Instant, hero: Option[Hero]) | martijnhoekstra/hotsextra-matchmaker | src/main/scala/org/hotsextra/matchmaking/entries/Entry.scala | Scala | agpl-3.0 | 271 |
package is.hail.types.physical
import is.hail.annotations.{Region, UnsafeOrdering, _}
import is.hail.asm4s.{Code, coerce, const, _}
import is.hail.expr.ir.EmitMethodBuilder
import is.hail.types.virtual.TInt32
case object PInt32Optional extends PInt32(false)
case object PInt32Required extends PInt32(true)
class PInt3... | cseed/hail | hail/src/main/scala/is/hail/types/physical/PInt32.scala | Scala | mit | 2,148 |
package com.sksamuel.elastic4s
import io.circe._
import io.circe.jawn._
import scala.annotation.implicitNotFound
/**
* Automatic HitAs and Indexable derivation
*
* == Usage ==
*
* {{{
* import io.circe.generic.auto._
* import com.sksamuel.elastic4s.circe._
*
* case class City(id: Int, name: Stri... | Tecsisa/elastic4s | elastic4s-circe/src/main/scala/com/sksamuel/elastic4s/circe/package.scala | Scala | apache-2.0 | 1,663 |
/*
<<<<<<< HEAD
* Copyright 2019 TWO SIGMA OPEN SOURCE, 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 ... | twosigma/beaker-notebook | kernel/scala/src/test/scala/com/twosigma/beakerx/scala/table/TableDisplayTest.scala | Scala | apache-2.0 | 2,199 |
package sampler.cluster.abc.actor
import akka.actor.ActorLogging
import akka.actor.Actor
import akka.actor.actorRef2Scala
class ReportingActor[P](action: Option[Report[P] => Unit]) extends Actor with ActorLogging {
def receive = {
case report: Report[P] =>
action.foreach(a => a(report))
sender ! ReportComple... | tsaratoon/Sampler | sampler-cluster/src/main/scala/sampler/cluster/abc/actor/ReportingActor.scala | Scala | apache-2.0 | 405 |
/*
* 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 ... | yanboliang/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FileStreamSource.scala | Scala | apache-2.0 | 12,691 |
package com.eevolution.context.dictionary.domain.api.service
import com.eevolution.context.dictionary.api
import com.eevolution.context.dictionary.domain.model.HouseKeeping
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribut... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/service/HouseKeepingService.scala | Scala | gpl-3.0 | 1,229 |
package io.github.interestinglab.waterdrop.output.batch
import io.github.interestinglab.waterdrop.config.{Config, ConfigFactory}
import io.github.interestinglab.waterdrop.apis.BaseOutput
import org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions
import org.apache.spark.sql.{Dataset, Row, SaveMode, SparkSession... | InterestingLab/waterdrop | waterdrop-core/src/main/scala/io/github/interestinglab/waterdrop/output/batch/Tidb.scala | Scala | apache-2.0 | 3,067 |
package controllers
import play.api.mvc.{Action, Controller}
import views.html.accessOk
import security.{MyAlternativeDynamicResourceHandler, MyDeadboltHandler}
import be.objectify.deadbolt.scala.DeadboltActions
/**
*
* @author Steve Chaloner ([email protected])
*/
object DynamicRestrictionsController extends Con... | play2-maven-plugin/play2-maven-test-projects | play23/external-modules/deadbolt/scala/app/controllers/DynamicRestrictionsController.scala | Scala | apache-2.0 | 742 |
/*
* 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 ... | tmalaska/SparkOnHBase | src/main/scala/org/apache/hadoop/hbase/spark/BulkLoadPartitioner.scala | Scala | apache-2.0 | 1,918 |
package amailp.intellij.robot.psi
import com.intellij.extapi.psi.ASTWrapperPsiElement
import com.intellij.lang.ASTNode
import com.intellij.psi.tree.TokenSet
import amailp.intellij.robot.lexer.RobotIElementType
import com.intellij.psi.PsiElement
import scala.collection.JavaConversions._
import amailp.intellij.robot.psi... | puhnastik/robot-plugin | src/main/scala/amailp/intellij/robot/psi/RobotPsiElement.scala | Scala | gpl-3.0 | 604 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ddseapy/geomesa | geomesa-features/geomesa-feature-avro/src/test/scala/org/locationtech/geomesa/features/avro/AvroSimpleFeatureFactoryTest.scala | Scala | apache-2.0 | 1,872 |
package scutil.lang.extension
import scutil.lang._
object PFunctionImplicits extends PFunctionImplicits
trait PFunctionImplicits {
implicit final class PFunctionExt[S,T](peer:S=>Option[T]) {
def applyOrElse(it:S, default:T):T =
peer(it) getOrElse default
def orDefault(default: =>T):Function1[S,T] =
orAlw... | ritschwumm/scutil | modules/core/src/main/scala/scutil/lang/extension/PFunctionImplicits.scala | Scala | bsd-2-clause | 981 |
import leon.annotation._
import leon.lang._
import leon.lang.synthesis._
// Sorting lists is a fundamental problem in CS.
object Sorting {
// Data types
sealed abstract class List
case class Cons(head : Int, tail : List) extends List
case class Nil() extends List
sealed abstract class LList
case class LCo... | epfl-lara/leon | testcases/synthesis/cav2013/Sorting.scala | Scala | gpl-3.0 | 9,218 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | cheeseng/scalatest | examples/src/main/scala/org/scalatest/examples/wordspec/getfixture/ExampleSpec.scala | Scala | apache-2.0 | 1,281 |
/*
* This file is part of the "silex" library of helpers for Apache Spark.
*
* Copyright (c) 2015 Red Hat, 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.... | erikerlandson/silex | src/main/scala/com/redhat/et/silex/feature/extractor/breeze/package.scala | Scala | apache-2.0 | 1,218 |
/*
* 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 | rdbc-api-scala/src/main/scala/io/rdbc/sapi/Timeout.scala | Scala | apache-2.0 | 1,324 |
package org.joda.time.chrono
import java.io.ObjectInputStream
import org.joda.time.Chronology
import org.joda.time.DateTimeField
import org.joda.time.DateTimeZone
import org.joda.time.DurationField
import org.joda.time.chrono.AssembledChronology.Fields
object AssembledChronology {
object Fields {
private def... | mdedetrich/soda-time | shared/src/main/scala/org/joda/time/chrono/AssembledChronology.scala | Scala | bsd-2-clause | 17,058 |
package org.pico.statsd
import org.pico.statsd.datapoint.{AlertType, EventData, Priority}
import org.scalacheck.Arbitrary.arbitrary
import org.scalacheck.{Arbitrary, Gen}
package object arb {
case class Identifier(value: String) extends AnyVal
implicit val arbitraryPriority: Arbitrary[Priority.Value] = Arbitra... | pico-works/pico-statsd | pico-statsd/src/test/scala/org/pico/statsd/arb/package.scala | Scala | mit | 758 |
package scala.meta
package internal.hosts.scalac
package converters
import org.scalameta.invariants._
import org.scalameta.unreachable
import scala.{Seq => _}
import scala.collection.immutable.Seq
import scala.tools.nsc.{Global => ScalaGlobal}
import scala.reflect.internal.Flags._
import scala.meta.internal.{ast => m}... | beni55/scalameta | scalahost/src/main/scala/scala/meta/internal/hosts/scalac/converters/ToGtype.scala | Scala | bsd-3-clause | 13,965 |
/*
* 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/io/Range.scala | Scala | apache-2.0 | 1,111 |
/*
* Copyright 2014 Michael Krolikowski
*
* 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... | mesosphere/dns4s | core/src/test/scala/com/github/mkroli/dns4s/section/resource/PTRResourceSpec.scala | Scala | apache-2.0 | 1,655 |
package scalart
import org.scalatest.{Matchers, FunSuite}
class ImplicitTest extends FunSuite with Matchers {
test("Test how implicit default arguments work") {
def foo()(implicit s: Int = 0): Int = s
foo() should be(0)
{
implicit val n = 10
foo()
} should be(10)
}
}
| vidyacraghav/scalart | core/src/test/scala/scalart/ImplicitTest.scala | Scala | apache-2.0 | 304 |
/*
* Copyright (C) 2012 The Regents of The University California.
* 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/LICENS... | sameeragarwal/blinkdb_dev | src/main/scala/shark/memstore2/ColumnarStructObjectInspector.scala | Scala | apache-2.0 | 3,767 |
/*
* Author: Pablo Lalloni <[email protected]>
* Created: 24/05/2011 13:48:43
*/
package org.retistruen.instrument
import org.joda.time.Instant
import org.retistruen.Datum
import org.scalatest.FunSpec
import org.scalatest.matchers.ShouldMatchers
class IdentitySpec extends FunSpec with ShouldMatchers {
val i = ... | plalloni/retistruen | src/test/scala/org/retistruen/instrument/IdentitySpec.scala | Scala | mit | 1,041 |
package uk.gov.gds.ier.langs
import play.api.mvc._
import com.google.inject.Singleton
@Singleton
class MessagesController extends Controller {
def all = Action {
Ok(Messages.jsMessages.all(Some("GOVUK.registerToVote.messages")))
}
def forLang(langCode:String) = Action {
implicit val lang = Language.La... | michaeldfallen/ier-frontend | app/uk/gov/gds/ier/langs/MessagesController.scala | Scala | mit | 406 |
/*
* JBoss, Home of Professional Open Source
* Copyright 2010 Red Hat Inc. and/or its affiliates and other
* contributors as indicated by the @author tags. All rights reserved.
* See the copyright.txt in the distribution for a full listing of
* individual contributors.
*
* This is free software; you can redistri... | nmldiegues/stibt | infinispan/server/core/src/main/scala/org/infinispan/server/core/LifecycleCallbacks.scala | Scala | apache-2.0 | 2,376 |
package com.github.chaabaj.openid.apis.slack
import akka.http.scaladsl.model.StatusCodes
import com.github.chaabaj.openid.exceptions.WebServiceException
import spray.json.JsValue
object SlackResponseHandler {
def handle(res: JsValue): JsValue = {
if (res.asJsObject.getFields("error").nonEmpty) {
throw Web... | chaabaj/openid-scala | src/main/scala/com/github/chaabaj/openid/apis/slack/SlackResponseHandler.scala | Scala | mit | 428 |
/*
* Copyright (c) 2015-2017 EpiData, Inc.
*/
package util
import play.api.mvc.QueryStringBindable
import java.util.Date
/** Helper classes for parsing custom data types passed as url query parameters. */
object QueryStringBinders {
implicit def bindableDate(implicit longBinder: QueryStringBindable[Long]) =
n... | epidataio/epidata-community | play/app/util/QueryStringBinders.scala | Scala | apache-2.0 | 1,594 |
trait Logged {
def log(msg: String) { }
}
trait ConsoleLogger extends Logged {
override def log(msg: String) { println(msg) }
}
trait LoggedException extends Exception with Logged {
def log() { log(getMessage()) }
}
class UnhappyException extends IllegalStateException
with LoggedException { // This class ex... | P7h/ScalaPlayground | Scala for the Impatient/examples/ch10/sec12/Logger.scala | Scala | apache-2.0 | 774 |
package com.nerdintheherd.config
/**
* @author Karen Davis
*/
class Config {
private var projectURIs = List[String]();
private var includedGroupIds = List[String]();
private var theseDependencies = List[String]();
private var allDependencies = false;
}
| karlroberts/release-o-matic | src/main/scala/com/nerdintheherd/config/Config.scala | Scala | bsd-3-clause | 277 |
package io.getquill.context.jdbc.oracle
import java.util.concurrent.ConcurrentLinkedQueue
import io.getquill.context.sql._
import scala.collection.JavaConverters._
class QueryResultTypeJdbcSpec extends QueryResultTypeSpec {
override val context = testContext
import context._
def await[T](r: T) = r
val in... | mentegy/quill | quill-jdbc/src/test/scala/io/getquill/context/jdbc/oracle/QueryResultTypeJdbcSpec.scala | Scala | apache-2.0 | 2,654 |
/*
* Copyright 2014–2018 SlamData 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... | slamdata/slamengine | impl/src/main/scala/quasar/impl/external/ClassPath.scala | Scala | apache-2.0 | 1,060 |
/***********************************************************************
* 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 ... | mdzimmerman/geomesa | geomesa-tools/src/main/scala/org/locationtech/geomesa/tools/accumulo/ingest/AbstractIngest.scala | Scala | apache-2.0 | 8,974 |
package deburnat.transade
import deburnat.transade.core.loaders.{XmlFileLoader, ScalaFileLoader}
import deburnat.transade.core.admins.CoreAdmin
/**
* An algorithm for data transfer.
* Project name: deburnat
* Date: 10/2/13
* Time: 1:00 AM
* @author Patrick Meppe ([email protected])
*
*/
final class FileLoader... | deburnatshazem/deburnat | core/src/main/scala/deburnat/transade/FileLoader.scala | Scala | apache-2.0 | 618 |
package x7c1.wheat.macros.database
import android.content.ContentValues
import scala.language.dynamics
import scala.language.experimental.macros
import scala.reflect.macros.blackbox
private object TypedContentValues {
def extract[A: c.WeakTypeTag](c: blackbox.Context): c.Tree = {
import c.universe._
val f... | x7c1/Linen | wheat-macros/src/main/scala/x7c1/wheat/macros/database/TypedContentValues.scala | Scala | mit | 3,234 |
package edu.depauw.scales.graphics
import Base._
import org.scalajs.dom
case class Bitmap(canvas: dom.HTMLCanvasElement, bounds: Bounds) extends Graphic {
def render(ctx: GraphicsContext): Unit = ctx.drawImage(canvas, bounds.left, bounds.top, bounds.width, bounds.height)
def toFunction: (Double, Double) => Color... | DePauwREU2013/sjs-scales | src/main/scala/edu/depauw/scales/graphics/Bitmap.scala | Scala | mit | 3,177 |
package org.jetbrains.plugins.scala
package lang.psi.impl.statements
import com.intellij.psi._
import impl.light.LightElement
import com.intellij.openapi.util.TextRange
import lang.psi.api.expr.{ScBlockExpr, ScExpression}
final class FakePsiCodeBlock(body: ScExpression) extends LightElement(body.getManager, body.getL... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/statements/FakePsiCodeBlock.scala | Scala | apache-2.0 | 1,381 |
package fpinscala.streamingio
import fpinscala.iomonad.{Task,IO,Monad}
object ImperativeAndLazyIO {
/*
We are going to consider various approaches to the simple task of
checking whether a file contains more than 40,000 lines.
Our first implementation is... | willcodejavaforfood/fpinscala | answers/src/main/scala/fpinscala/streamingio/StreamingIO.scala | Scala | mit | 45,067 |
package org.jetbrains.sbt
package project.structure
import com.intellij.execution.process.{ProcessOutputTypes, ProcessEvent, ProcessAdapter}
import com.intellij.openapi.util.Key
/**
* @author Pavel Fatin
*/
class ListenerAdapter(listener: (OutputType, String) => Unit) extends ProcessAdapter {
override def onTextA... | consulo/consulo-scala | SBT/src/main/scala/org/jetbrains/sbt/project/structure/ListenerAdapter.scala | Scala | apache-2.0 | 576 |
/**
* 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... | shuliangtao/apache-camel-2.13.0-src | components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SMulticastDefinition.scala | Scala | apache-2.0 | 2,112 |
package example
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
/**
* This class implements a ScalaTest test suite for the methods in object
* `Lists` that need to be implemented as part of this assignment. A test
* suite is simply a collection of individual te... | relyah/CourseraFunctionalProgramming | resource/progfun-master/example/src/test/scala/example/ListsSuite.scala | Scala | gpl-2.0 | 4,025 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaDataWriter.scala | Scala | apache-2.0 | 2,860 |
package models.services
import com.mohiva.play.silhouette.api.LoginInfo
import com.mohiva.play.silhouette.api.services.IdentityService
import models.CvsUser
/**
* Handles actions to users.
*/
trait CvsUserService extends IdentityService[CvsUser] {
/**
* Saves a user.
*
* @param user the user t... | mb720/cvs | app/models/services/CvsUserService.scala | Scala | bsd-2-clause | 554 |
/*
* 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 ... | jiangxb1987/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/joins/OuterJoinSuite.scala | Scala | apache-2.0 | 9,765 |
/*
* 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 ... | dbtsai/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcDataSourceV2.scala | Scala | apache-2.0 | 1,875 |
package com.twitter.finagle.redis.integration
import collection.mutable
import com.twitter.finagle.redis.Client
import com.twitter.finagle.redis.util.{CBToString, StringToChannelBuffer}
import java.util.UUID
import org.jboss.netty.buffer.ChannelBuffer
import org.specs.SpecificationWithJUnit
class BtreeClientSpec ext... | joshbedo/finagle | finagle-redis/src/test/scala/com/twitter/finagle/redis/integration/BtreeClientSpec.scala | Scala | apache-2.0 | 10,464 |
/**
* Copyright (c) 2016 Intel Corporation
*
* 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 applicabl... | aayushidwivedi01/spark-tk | sparktk-core/src/main/scala/org/trustedanalytics/sparktk/frame/internal/constructors/HbaseHelper.scala | Scala | apache-2.0 | 3,661 |
package stainless
package proof
import stainless.lang._
import stainless.annotation._
import stainless.lang.StaticChecks._
import scala.language.postfixOps
@library
object BoundedQuantifiers {
def intForall(n: BigInt, p: BigInt => Boolean): Boolean = {
require(n >= 0)
decreases(n)
if (n <= 0) true
... | epfl-lara/stainless | frontends/library/stainless/proof/BoundedQuantifiers.scala | Scala | apache-2.0 | 2,729 |
package dotty.tools.languageserver
import org.junit.Test
import org.eclipse.lsp4j.SymbolKind
import dotty.tools.languageserver.util.Code._
class DocumentSymbolTest {
@Test def withErroneousTree: Unit =
code"${m1}class Foo { def }$m2"
.withSource.documentSymbol(m1, (m1 to m2).symInfo("Foo", SymbolKind.C... | som-snytt/dotty | language-server/test/dotty/tools/languageserver/DocumentSymbolTest.scala | Scala | apache-2.0 | 4,139 |
package blended.streams.dispatcher.internal.builder
import akka.NotUsed
import akka.actor.{ActorRef, ActorSystem}
import akka.stream.scaladsl.{Flow, Source}
import akka.stream.{ActorMaterializer, Materializer}
import blended.jms.utils.IdAwareConnectionFactory
import blended.streams.dispatcher.internal.ResourceTypeRout... | lefou/blended | blended.streams.dispatcher/src/main/scala/blended/streams/dispatcher/internal/builder/TransactionOutbound.scala | Scala | apache-2.0 | 2,660 |
/* Code Pulse: a real-time code coverage tool, for more information, see <http://code-pulse.com/>
*
* Copyright (C) 2014-2017 Code Dx, Inc. <https://codedx.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 ... | secdec/codepulse | hq/src/main/scala/com/secdec/bytefrog/hq/protocol/ControlMessageSenderV1.scala | Scala | apache-2.0 | 1,572 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Algolia
* http://www.algolia.com/
*
* 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... | algolia/algoliasearch-client-scala | src/main/scala/algolia/definitions/KeyDefinition.scala | Scala | mit | 5,800 |
/*
* Copyright 2014 Kevin Herron
*
* 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 ... | digitalpetri/scala-modbus-tcp | modbus-master/src/main/scala/com/digitalpetri/modbus/master/ModbusTcpMaster.scala | Scala | apache-2.0 | 5,785 |
package gapt.formats.tip.transformation
import gapt.formats.tip.parser.TipSmtAnd
import gapt.formats.tip.parser.TipSmtExpression
import gapt.formats.tip.parser.TipSmtForall
import gapt.formats.tip.parser.TipSmtFunctionDefinition
import gapt.formats.tip.parser.TipSmtIte
import gapt.formats.tip.parser.TipSmtMutualRecurs... | gapt/gapt | core/src/main/scala/gapt/formats/tip/transformation/moveUniversalQuantifiersInwards.scala | Scala | gpl-3.0 | 2,824 |
/**
* See <a href="https://www.codeeval.com/open_challenges/51/">Closes Pair</a>
*/
object ClosestPair extends Challenge {
val lines = scala.io.Source.fromFile(args(0)).getLines().filter(_.length > 0)
import scala.collection.mutable.ListBuffer
val input = lines.foldRight(List.empty[ListBuffer[(Int, Int)]])... | zelca/codeeval | src/ClosestPair.scala | Scala | mit | 1,080 |
package models.db
import models.other.MissionWithDeckId
import scalikejdbc._
import com.ponkotuy.data
import util.scalikejdbc.BulkInsert._
/**
*
* @author ponkotuy
* Date: 2014/03/04.
*/
case class DeckPort(id: Int, memberId: Long, name: String, created: Long)
object DeckPort extends SQLSyntaxSupport[DeckPort] {... | b-wind/MyFleetGirls | server/app/models/db/DeckPort.scala | Scala | mit | 2,862 |
/*
* Copyright (c) 2012 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 agree... | mpilquist/shapeless | core/src/main/scala/shapeless/iso.scala | Scala | apache-2.0 | 2,517 |
package com.twitter.zipkin.collector.builder
import com.twitter.finagle.Filter
import com.twitter.finagle.builder.Server
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.tracing.Tracer
import com.twitter.zipkin.builder.Builder
import com.twitter.zipkin.collector.WriteQueue
import com.twitter.z... | srijs/zipkin | zipkin-collector/src/main/scala/com/twitter/zipkin/collector/builder/CollectorInterface.scala | Scala | apache-2.0 | 757 |
/*
* Copyright 2014 Xored Software, Inc.
* Copyright 2015 Gleb Kanterov
*
* 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... | kanterov/scala-js-react | scalajs-react/src/main/scala/com/kanterov/scalajs/react/scalax.scala | Scala | apache-2.0 | 1,060 |
// -----------------------------------------------
//
// File: hw.scala (hw: hello world)
//
// Running -
//
// $ scala hw.scala // hw stands for hello world
//
// -----------------------------------------------
object hw { // hw stands for hello world
def main(args: Array[String]) {
println("Hello World!")
... | nvijayap/scala | hw.scala | Scala | apache-2.0 | 327 |
/*
* 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-core/src/main/scala/com/netflix/atlas/core/model/ItemId.scala | Scala | apache-2.0 | 3,710 |
package model
import skinny.orm._, feature._
import scalikejdbc._
import org.joda.time._
case class RemindMailSchedule(
id: Long,
lessonId: Long,
lessonDetailId: Long,
mailId: Option[Long] = None,
status: Option[Int] = None,
startDatetime: Option[DateTime] = None,
endDatetime: Option[DateTime] = None,
... | yoshitakes/skinny-task-example | src/main/scala/model/RemindMailSchedule.scala | Scala | mit | 850 |
package coursier.cache
import java.net.URLConnection
import coursier.core.Authentication
trait AuthenticatedURLConnection extends URLConnection {
def authenticate(authentication: Authentication): Unit
}
| alexarchambault/coursier | modules/cache/jvm/src/main/scala/coursier/cache/AuthenticatedURLConnection.scala | Scala | apache-2.0 | 208 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/amls-frontend | app/services/businessmatching/ServiceFlow.scala | Scala | apache-2.0 | 1,319 |
package mesosphere.chaos.http
import com.google.inject.Injector
import com.sun.jersey.guice.spi.container.servlet.GuiceContainer
import net.liftweb.markdown.ActuariusTransformer
import scala.collection.JavaConverters._
import scala.collection.{ SortedSet, mutable }
import scala.io.Source
import scala.language.existent... | spacejam/marathon | src/main/scala/chaos/http/HelpServlet.scala | Scala | apache-2.0 | 5,435 |
/***********************************************************************
* 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-utils/src/test/scala/org/locationtech/geomesa/utils/time/RichIntervalTest.scala | Scala | apache-2.0 | 2,233 |
package com.enkidu.lignum.parsers
import _root_.java.io.File
import _root_.java.nio.charset.CodingErrorAction
import com.enkidu.lignum.parsers.commons.AbstractParser
import org.parboiled2.ParseError
import org.scalatest.prop.{Checkers, PropertyChecks}
import org.scalatest.{FreeSpec, Matchers}
import scala.io.{Codec,... | marek1840/java-parser | src/test/scala/com/enkidu/lignum/parsers/ParserTest.scala | Scala | mit | 1,574 |
package scaffvis
/**
* The task runner - runs task specified as arguments one by one.
*/
object Application {
def main(args: Array[String]): Unit = {
if(args.isEmpty)
println("Specify tasks to run.")
for (task <- args) {
try {
val c = Class.forName(s"scaffvis.tasks.$task") //find t... | velkoborsky/scaffvis | generator/src/main/scala/scaffvis/Application.scala | Scala | gpl-3.0 | 593 |
import scala.quoted._
import scala.quoted.staging._
class Foo[T: Type] {
def q(using QuoteContext) = '{(null: Any).asInstanceOf[T]}
}
object Test {
given Toolbox = Toolbox.make(getClass.getClassLoader)
def main(args: Array[String]): Unit = withQuoteContext {
println((new Foo[Object]).q.show)
println((n... | som-snytt/dotty | tests/run-staging/i4350.scala | Scala | apache-2.0 | 350 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package expressions
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
/**
* @author Alexander Podkhalyuzin
* Date: 06.03.2008
*/
/*
* ArgumentExp... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/parser/parsing/expressions/ArgumentExprs.scala | Scala | apache-2.0 | 1,583 |
package com.seanshubin.hello.domain
import java.nio.file.{Files, Path}
object FilesFromOperatingSystem extends FilesContract {
override def readAllBytes(path: Path): Array[Byte] = Files.readAllBytes(path)
}
| SeanShubin/hello | domain/src/main/scala/com/seanshubin/hello/domain/FilesFromOperatingSystem.scala | Scala | unlicense | 211 |
package com.evojam.documents
import collection.JavaConversions._
import org.bson.Document
import reactivemongo.bson.{BSONString, BSONDocument, BSONDocumentReader, BSONDocumentWriter}
import com.evojam.driver.DocumentFormat
object StringMapFormatter {
implicit object Handler extends BSONDocumentReader[Map[String, S... | evojam/mongo-drivers-benchmarks | src/com/evojam/documents/StringMapFormatter.scala | Scala | apache-2.0 | 1,052 |
/*
* 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 ... | pronix/spark | mllib/src/main/scala/org/apache/spark/mllib/optimization/GradientDescent.scala | Scala | apache-2.0 | 10,865 |
package com.seanshubin.server
trait HttpServer {
def start()
def join()
def stop()
}
| SeanShubin/schulze | server/src/main/scala/com/seanshubin/server/HttpServer.scala | Scala | unlicense | 94 |
package org.jmotor.sbt.plugin
/**
*
* @author AI
* 2019-04-26
*/
object ComponentSorter extends Enumeration {
type ComponentSorter = Value
val ByLength: Value = Value(0)
val ByAlphabetically: Value = Value(1)
}
| aiyanbo/sbt-dependency-updates | src/main/scala/org/jmotor/sbt/plugin/ComponentSorter.scala | Scala | apache-2.0 | 234 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/iht-frontend | test/iht/viewmodels/application/overview/AssetsAndGiftsSectionViewModelTest.scala | Scala | apache-2.0 | 12,101 |
/*
* ******************************************************************************
* * Copyright (C) 2013 Christopher Harris (Itszuvalex)
* * [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 p... | Itszuvalex/Femtocraft-alpha-1 | src/main/java/com/itszuvalex/femtocraft/industry/containers/ContainerNanoInnervator.scala | Scala | gpl-2.0 | 1,458 |
package com.twitter.finagle.memcached.integration
import com.twitter.common.application.ShutdownRegistry.ShutdownRegistryImpl
import com.twitter.common.zookeeper.ServerSet.EndpointStatus
import com.twitter.common.zookeeper.testing.ZooKeeperTestServer
import com.twitter.common.zookeeper.{CompoundServerSet, ZooKeeperUti... | liamstewart/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/CacheNodeGroupTest.scala | Scala | apache-2.0 | 9,477 |
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.