instruction stringclasses 1
value | output stringlengths 5 1M |
|---|---|
Explain and rewrite the following Scala code: | package lila.app
package templating
import lila.user.{ User, UserContext }
import play.twirl.api.Html
trait StringHelper { self: NumberHelper =>
def netDomain: String
val escapeHtml: String => String = org.apache.commons.lang3.StringEscapeUtils.escapeHtml4 _
val slugify = lila.common.String.slugify _
def ... |
Explain and rewrite the following Scala code: | package io.magentys.cinnamon.webdriver.capabilities
import com.typesafe.config.Config
import io.github.bonigarcia.wdm.Architecture
import io.magentys.cinnamon.webdriver.Keys
import io.magentys.cinnamon.webdriver.remote.{CinnamonRemote, RemoterDetector}
import net.ceedubs.ficus.Ficus._
import net.ceedubs.ficus.readers.... |
Explain and rewrite the following Scala code: | package example.util
import play.api.libs.json._
import scala.language.implicitConversions
import scala.reflect.ClassTag
// TODO: Document
trait JsonAsOrThrow {
// TODO: Add this to play-json-ops
implicit def asOrThrowJsError[T](json: JsValue): JsValueOrThrow = new JsValueOrThrow(json)
}
// TODO: Document
clas... |
Explain and rewrite the following Scala code: | /*
* Copyright 2016 Dennis Vriend
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... |
Explain and rewrite the following Scala code: | package cromwell.engine.workflow
import com.typesafe.config.ConfigFactory
import cromwell.util.{EncryptedBytes, SecretKey, Aes256Cbc}
import scala.collection.JavaConverters._
import spray.json._
import scala.util.{Try, Success, Failure}
/**
* WorkflowOptions is constructed with a String -> String map (usually as a J... |
Explain and rewrite the following Scala code: | /*
* ******************************************************************************
* * Copyright (C) 2013 Christopher Harris (Itszuvalex)
* * Itszuvalex@gmail.com
* *
* * This program is free software; you can redistribute it and/or
* * modify it under the terms of the GNU General Public License
* * as p... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package com.socrata.internal.http
import java.lang.reflect.UndeclaredThrowableException
import java.io._
import java.net._
import java.nio.charset.StandardCharsets
import java.util.concurrent.Executor
import javax.net.ssl.SSLException
import org.apache.http.impl.client.DefaultHttpClient
import org.apache.http.entity.... |
Explain and rewrite the following Scala code: | package so.blacklight.swarm.storage
/**
*
*/
class StorageEvent()
case class StoreRequest(target: Any)
case class RetrieveRequest(id: StorageId)
case class ListEntities(filter: Option[String])
case class EntityList(entities: List[(StorageId, Class[_])])
case class StorageOK(id: StorageId) extends StorageEvent
case c... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /***********************************************************************
* Copyright (c) 2013-2019 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package cats.examples.typeclasses.functors
import cats._
import cats.data.Nested
import cats.implicits._
/**
* A functor is a type class involving types that have one 'hole', such as
* Option or List, in contrast to say Int which as no 'holes'.
*
* Learn you a Haskell describes Functor as a type class 'for th... |
Explain and rewrite the following Scala code: |
import LineNumber._
object Test {
def main(args: Array[String]): Unit = {
foo(line)
foo
foo
foo
}
def foo(implicit line: LineNumber): Unit = {
println("foo " + line)
}
}
|
Explain and rewrite the following Scala code: | package com.ebay.neutrino.handler.ops
import io.netty.channel.{ChannelHandlerContext, ChannelInboundHandlerAdapter}
// Not currently needed - pipeline functionality only used in /test
// Please restore if moved back to /main
class InboundMarker extends ChannelInboundHandlerAdapter with Marker {
override def excep... |
Explain and rewrite the following Scala code: | package org.scalacoin.protocol.transaction
import org.scalacoin.currency.CurrencyUnit
import org.scalacoin.protocol.script.ScriptPubKey
/**
* Created by Tom on 1/12/2016.
*/
trait TransactionOutputMeta {
def bestBlock : String
def confirmations : Int
def version : Int
def coinbase : Boolean
def value : Cu... |
Explain and rewrite the following Scala code: | import com.ecfront.lfp.LFP
object Test extends App {
val s = System.currentTimeMillis()
LFP("C:\\\\DATA\\\\Enjoy_Projects\\\\LargeFileProcessor\\\\src\\\\test\\\\resources\\\\test.txt", {
lines =>
lines.foreach(println(_))
})
println(System.currentTimeMillis() - s)
}
|
Explain and rewrite the following Scala code: | package de.htwg.zeta.common.models.entity
import java.util.UUID
import play.api.libs.json.Format
import play.api.libs.json.Json
/** The user object.
*
* @param id The unique ID of the user.
* @param firstName The first name of the authenticated user.
* @param lastName The last name of the authenticated u... |
Explain and rewrite the following Scala code: | package io.eels
import io.eels.coercion.{DoubleCoercer, FloatCoercer, IntCoercer, LongCoercer}
import io.eels.schema.DataType
sealed trait Predicate {
// returns a list of fields that this predicate operates on
def fields(): Seq[String]
// apply the predicate to this row and return true if it matches
@depreca... |
Explain and rewrite the following Scala code: | package com.szadowsz.cadisainmduit.people.census
import com.szadowsz.spark.ml.{Lineage, LocalDataframeIO}
import com.szadowsz.spark.ml.feature._
import org.apache.spark.ml.feature.{IndexToString, QuantileDiscretizer}
import org.apache.spark.sql.DataFrame
/**
* Created on 25/01/2017.
*/
trait CensusHandler extends... |
Explain and rewrite the following Scala code: | package phenan.prj.body
import phenan.prj._
import phenan.prj.ir._
trait LiteralOperandParsersModule {
this: LiteralParsersModule with CommonParsersModule with ContextSensitiveParsersModule
with ExpectedTypeInferencer with DSLEnvironments with EnvModifyStrategy
with IRExpressions with JModules with JMembers... |
Explain and rewrite the following Scala code: | package com.github.novamage.svalidator.binding.binders.special
import com.github.novamage.svalidator.binding.binders.{JsonTypedBinder, TypedBinder}
import com.github.novamage.svalidator.binding.{BindingConfig, BindingFailure, BindingPass, BindingResult}
import io.circe.ACursor
import scala.collection.mutable
import s... |
Explain and rewrite the following Scala code: | sealed trait Foo
object Foo:
case object Baz extends Foo
case class Bar(x: Int) extends Foo
|
Explain and rewrite the following Scala code: | package com.sksamuel.elastic4s.searches.queries
import com.sksamuel.elastic4s.searches.QueryDefinition
import org.elasticsearch.index.query.MultiTermQueryBuilder
trait MultiTermQueryDefinition extends QueryDefinition {
override def builder: MultiTermQueryBuilder
}
|
Explain and rewrite the following Scala code: | /***********************************************************************
* Copyright (c) 2015-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... |
Explain and rewrite the following Scala code: | def validationApplicative[E]: Applicative[({type f[x] = Validation[E,x]})#f] =
new Applicative[({type f[x] = Validation[E,x]})#f] {
def unit[A](a: => A) = Success(a)
override def map2[A,B,C](fa: Validation[E,A], fb: Validation[E,B])(f: (A, B) => C) =
(fa, fb) match {
case (Success(a), Success(b)... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package io.findify.sqsmock.actions
import akka.http.scaladsl.model.HttpResponse
/**
* Created by shutty on 3/29/16.
*/
trait Worker {
def process(fields:Map[String,String]):HttpResponse
}
|
Explain and rewrite the following Scala code: | package play.api.libs.openid
trait RichUrl[A] {
def hostAndPath: String
} |
Explain and rewrite the following Scala code: | package mesosphere.marathon.health
import akka.actor.{ Actor, ActorLogging, ActorRef, Cancellable, Props }
import akka.event.EventStream
import mesosphere.marathon.{ MarathonScheduler, MarathonSchedulerDriverHolder }
import mesosphere.marathon.Protos.HealthCheckDefinition.Protocol
import mesosphere.marathon.Protos.Mar... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /*
* 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... |
Explain and rewrite the following Scala code: | package me.venuatu.background_tracker
import java.io.{File, FileWriter}
import android.app.{AlarmManager, PendingIntent}
import android.content.{BroadcastReceiver, Context, Intent}
import android.location.Location
import android.os.Bundle
import com.google.android.gms.common.ConnectionResult
import com.google.android... |
Explain and rewrite the following Scala code: | package utils.auth
import com.mohiva.play.silhouette.api.actions.UnsecuredErrorHandler
import play.api.mvc.RequestHeader
import play.api.mvc.Results._
import scala.concurrent.Future
/**
* Custom unsecured error handler.
*/
class CustomUnsecuredErrorHandler extends UnsecuredErrorHandler {
/**
* Called when a ... |
Explain and rewrite the following Scala code: | /*
* Copyright 2015 Delft University of Technology
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... |
Explain and rewrite the following Scala code: | package org.openapitools.models
import io.circe._
import io.finch.circe._
import io.circe.generic.semiauto._
import io.circe.java8.time._
import org.openapitools._
import org.openapitools.models.Link
/**
*
* @param self
* @param Underscoreclass
*/
case class ExtensionClassContainerImpl1links(self: Option[Link]... |
Explain and rewrite the following Scala code: | package com.softwaremill.bootzooka.test
import cats.effect.IO
import com.softwaremill.bootzooka.http.HttpApi
import com.softwaremill.bootzooka.infrastructure.Json._
import com.softwaremill.bootzooka.user.UserApi._
import org.http4s._
import org.http4s.syntax.all._
import scala.util.Random
class Requests(httpApi: => ... |
Explain and rewrite the following Scala code: | package org.velvia.filo.vectors
import java.nio.ByteBuffer
import org.velvia.filo._
import scala.collection.mutable.ArrayBuffer
import scalaxy.loops._
/**
* Constructor methods for UTF8 vector types, as well as UTF8/binary blob utilities
*/
object UTF8Vector {
/**
* Creates a UTF8Vector that holds references t... |
Explain and rewrite the following Scala code: | package idbase
import play.api.libs.json._
import play.modules.reactivemongo._
import play.modules.reactivemongo.json.collection.JSONCollection
import play.modules.reactivemongo.json.ImplicitBSONHandlers._
import reactivemongo.api._
import reactivemongo.bson._
import reactivemongo.core.commands._
import models.Doc
o... |
Explain and rewrite the following Scala code: | package io.finch
import java.util.UUID
class DecodeSpec extends FinchSpec {
checkAll("Decode[String]", DecodeLaws[String].all)
checkAll("Decode[Int]", DecodeLaws[Int].all)
checkAll("Decode[Long]", DecodeLaws[Long].all)
checkAll("Decode[Boolean]", DecodeLaws[Boolean].all)
checkAll("Decode[Float]", DecodeLaws... |
Explain and rewrite the following Scala code: | /*
* Copyright 2011-2022 GatlingCorp (https://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... |
Explain and rewrite the following Scala code: | package recipes
/*
import fs2._
import java.time.Instant
import scala.concurrent.duration._
/**
*
*
* That example is kind of interesting in that it takes a Stream[Task, Task[A]] and evaluates each task at least once, but if there are no tasks
* available and the last task failed with an exception, it is retried ... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | import language.experimental.macros
import scala.reflect.macros.blackbox.Context
object Demo {
def id[T](a: T): T = macro idImpl[T]
def idImpl[T: c.WeakTypeTag](c: Context)(a: c.Expr[T]): c.Expr[T] = a
}
|
Explain and rewrite the following Scala code: | import filters.HttpsFilter
import init.Init
import org.apache.commons.logging.LogFactory
import play.api._
import play.api.mvc.Results._
import play.api.mvc._
import scala.concurrent.Future
object Global extends WithFilters(HttpsFilter) with GlobalSettings {
private[this] final val Log = LogFactory.getLog(this.get... |
Explain and rewrite the following Scala code: | package advanced
import scala.language/*->scala::language.*/.higherKinds/*->scala::language.higherKinds.*/
import scala.language/*->scala::language.*/.reflectiveCalls/*->scala::language.reflectiveCalls.*/
import scala.reflect.Selectable/*->scala::reflect::Selectable.*/.reflectiveSelectable/*->scala::reflect::Selectab... |
Explain and rewrite the following Scala code: | /*
* Copyright 2015 - 2016 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - 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... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package org.transkop
import scala.collection.mutable
import org.parboiled.errors.ParsingException
import org.objectweb.asm.Opcodes._
case class SymbolTable(upperLevel: Option[SymbolTable], currentMethod: String) {
val FirstSymbolTableAddress = 0
private val variableTable = new mutable.HashMap[String, Integer]()
... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package com.arcusys.learn.liferay.update.version270
import java.sql.Connection
import com.arcusys.learn.liferay.update.version270.migrations.ActivityToStatementMigration
import com.arcusys.valamis.persistence.common.SlickProfile
import com.arcusys.valamis.persistence.impl.settings.ActivityToStatementTableComponent
i... |
Explain and rewrite the following Scala code: | /*
* 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... |
Explain and rewrite the following Scala code: | package lila.forumSearch
import akka.actor._
import com.softwaremill.macwire._
import io.methvin.play.autoconfig._
import play.api.Configuration
import lila.common.config._
import lila.search._
import Query.jsonWriter
@Module
private class ForumSearchConfig(
@ConfigName("index") val indexName: String,
@Confi... |
Explain and rewrite the following Scala code: | package com.blinkbox.books.marvin.magrathea.message
import java.nio.charset.Charset
import akka.actor.ActorSystem
import akka.testkit.{TestKit, TestProbe}
import com.blinkbox.books.marvin.magrathea.message.Checker._
import com.blinkbox.books.marvin.magrathea.message.DocumentDistributor._
import com.blinkbox.books.mar... |
Explain and rewrite the following Scala code: | package storage
/**
* Exception indicating a problem with the storage layer.
* @param message exception message text
* @param cause cause of the exception
*/
class StorageException(message: String, cause: Throwable = null) extends Exception(message, cause)
|
Explain and rewrite the following Scala code: | package org.jetbrains.plugins.scala.finder
import com.intellij.ide.highlighter.JavaFileType
import com.intellij.openapi.application.DumbAwareSearchParameters
import com.intellij.openapi.fileTypes.{FileTypeManager, StdFileTypes}
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
impor... |
Explain and rewrite the following Scala code: | /* Copyright (C) 2008-2016 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... |
Explain and rewrite the following Scala code: | package zeroadv.main
import zeroadv.zeromq.ZeroadvSubscriber
object LogChangesInAdv extends App {
private var last: List[Byte] = Nil
new ZeroadvSubscriber({ adv =>
if (last != adv.adv.toList) {
last = adv.adv.toList
println(adv.whenStr + ": " + adv.advStr)
}
}).subscribeAndListen(allPis)
}
|
Explain and rewrite the following Scala code: | /*
Copyright 2013 Stephen K Samuel
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... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package com.ereisman.esurient.hadoop.io
import org.apache.hadoop.mapreduce.{JobContext,OutputFormat,RecordWriter,TaskAttemptContext,OutputCommitter}
import org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
import org.apache.hadoop.io.NullWritable
import org.apache.hadoop.fs.Path
/**
* A dummy class used t... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /*
* Copyright (C) 2016 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.persistence.cassandra.query
import scala.annotation.tailrec
import scala.concurrent.Future
import scala.concurrent.duration.FiniteDuration
import scala.reflect.ClassTag
import akka.actor._
import akka.pattern.pipe
import akka.stream.acto... |
Explain and rewrite the following Scala code: | package com.mogproject.mogami.core
import com.mogproject.mogami.core.io._
/**
* Piece type
*/
sealed abstract class Ptype(val id: Int) extends CsaLike with KifLike {
lazy val sortId: Int = Ptype.sortIdTable(id)
override def toCsaString: String = Ptype.csaTable(id)
override def toKifString: String = Ptype.... |
Explain and rewrite the following Scala code: | package org.jetbrains.plugins.scala
package project.template
import java.io.{BufferedInputStream, File, IOException, InputStream}
import java.net.URL
import java.util.Properties
import java.util.regex.Pattern
import org.jetbrains.plugins.scala.project.Version
/**
* @author Pavel Fatin
*/
sealed class Artifact(val ... |
Explain and rewrite the following Scala code: | package org.jetbrains.plugins.scala
package lang
package psi
package impl
package expr
import com.intellij.lang.ASTNode
import com.intellij.psi.PsiElementVisitor
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElementVisitor
import org.jetbrains.plugins.scala.lang.psi.api.expr._
import org.jetbrains.plugins.scala... |
Explain and rewrite the following Scala code: | package mesosphere.marathon
package core.appinfo
import mesosphere.marathon.core.appinfo.impl.TaskForStatistics
import mesosphere.marathon.core.health.Health
import mesosphere.marathon.core.instance.Instance
import mesosphere.marathon.state.VersionInfo._
import mesosphere.marathon.state.{Timestamp, VersionInfo}
case ... |
Explain and rewrite the following Scala code: | /*
Copyright 2014 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... |
Explain and rewrite the following Scala code: | package sbt.compiler
import sbt.CompileSetup
import sbt.inc.Analysis
import xsbti.{Logger, Maybe}
import xsbti.compile._
import java.io.File
object IC extends IncrementalCompiler[Analysis, AnalyzingCompiler]
{
def compile(in: Inputs[Analysis, AnalyzingCompiler], log: Logger): Analysis =
{
val setup = in.set... |
Explain and rewrite the following Scala code: | package sri.sangria.mobile.components
import sri.mobile.all._
import sri.sangria.mobile.styles.Theme
import sri.universal.components.{Text, TouchableHighlight}
import scala.scalajs.js
object Button {
val Component = (props: Props) => {
TouchableHighlight(style = props.style, onPress = props.onPress)(
Tex... |
Explain and rewrite the following Scala code: | object Test {
def main(args: Array[String]): Unit = {
val x =
try { ("": Any) match { case List(_*) => true } }
catch { case _: Throwable => false }
assert(!x)
}
}
|
Explain and rewrite the following Scala code: | package com.ybrikman.ping.scalaapi.bigpipe
import org.specs2.mutable.Specification
import play.twirl.api.Html
class TestEmbed extends Specification {
"The Embed.escapeForEmbedding method should" >> {
"leave content without dashes unchanged" >> {
Embed.escapeForEmbedding("foo bar baz") mustEqual Html("foo... |
Explain and rewrite the following Scala code: | package monocle.macros.internal
import monocle.{Lens, PLens}
import scala.reflect.macros.blackbox
object Macro {
def mkLens[S, T, A, B](fieldName: String): PLens[S, T, A, B] = macro MacroImpl.mkLens_impl[S, T, A, B]
}
private[macros] class MacroImpl(val c: blackbox.Context) {
def genLens_impl[S: c.WeakTypeTag, ... |
Explain and rewrite the following Scala code: | package com.bwsw.cloudstack.pulse.ut.models
import com.bwsw.cloudstack.pulse.models.RAMInfluxModel
import org.scalatest.{FlatSpec, Matchers}
/**
* Created by Ivan Kudryavtsev on 27.07.17.
*/
class RAMInfluxModelTests extends FlatSpec with Matchers {
it should "Build correct expression" in {
val model = new ... |
Explain and rewrite the following Scala code: | /*
* 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... |
Explain and rewrite the following Scala code: | /** Copyright 2014 TappingStone, 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 ... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /*
* Metro.scala
* (FScape)
*
* Copyright (c) 2001-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
* contact@sciss.de
*/
package de.sciss.fscape
package graph
... |
Explain and rewrite the following Scala code: | package ru.org.codingteam.horta.plugins.loglist
import java.io.FileNotFoundException
import ru.org.codingteam.horta.protocol.Protocol
import ru.org.codingteam.horta.plugins.{BasePlugin, CommandDefinition, CommandProcessor}
import ru.org.codingteam.horta.security.{CommonAccess, Credential}
import ru.org.codingteam.hor... |
Explain and rewrite the following Scala code: | package com.freshsoft.matterbridge.util
import akka.event.{Logging, LoggingAdapter}
import akka.http.scaladsl.coding.{Deflate, Gzip, NoCoding}
import akka.http.scaladsl.model._
import akka.http.scaladsl.model.headers.HttpEncodings
import akka.util.ByteString
import com.freshsoft.matterbridge.server.MatterBridgeContext... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package com.twitter.finagle.toggle
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.twitter.util.Try
import java.net.URL
import scala.collection.{breakOut, immutable}
/**
* [[ToggleMap Toggl... |
Explain and rewrite the following Scala code: | package io.vamp.common.akka
import akka.actor.Actor
import akka.pattern.pipe
import io.vamp.common.notification._
import scala.concurrent.Future
import scala.language.implicitConversions
import scala.reflect._
import scala.util.{ Failure, Success, Try }
trait RequestError extends ErrorNotification {
def request: A... |
Explain and rewrite the following Scala code: | // Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.komanov.serialization.domain.protos.events
@SerialVersionUID(0L)
final case class DomainAddedPb(
name: String = ""
) extends com.trueaccord.scalapb.GeneratedMessage with com.trueacco... |
Explain and rewrite the following Scala code: | package com.bfm.topnotch.tnview
import com.bfm.topnotch.tnengine.{Input, TnCmd}
/**
* The class for a view command
* @param params The object containing the parameters for the command
* @param inputs The inputs to the View command
*/
case class TnViewCmd (
params: TnViewParams,
... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package sclack.domain.commands
import sclack.domain.GameSession
import sclack.domain.Character
/**
* Create new game command. This should create a new game, and return the
* GameSession object
* @author Simon Symeonidis
*/
class CreateNewGame(character : Character) extends Commandable {
def execute {
gameS... |
Explain and rewrite the following Scala code: | /* Copyright 2015 White Label Personal Clouds Pty Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
Explain and rewrite the following Scala code: | package lila.insight
import play.twirl.api.Html
import reactivemongo.bson._
import chess.{ Color, Role }
import lila.db.Types._
import lila.rating.PerfType
sealed abstract class Dimension[A: BSONValueHandler](
val key: String,
val name: String,
val dbKey: String,
val position: Position,
val value... |
Explain and rewrite the following Scala code: | class I0[I0]{def flatMap[I0[I0]<:I0[I0],I0[i1<:I0[i1}
|
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package com.avidmouse.spark.streaming.mongodb
import com.avidmouse.spark.mongodb.Mongo
import com.avidmouse.spark.mongodb.rdd._
import org.apache.spark.streaming.dstream.DStream
import play.api.libs.json.JsValue
/**
* @author avidmouse
* @version 0.1, 14-6-25
*/
object MongoSparkDStream {
class InsertDStream[... |
Explain and rewrite the following Scala code: | package wav.devtools.karaf
import org.apache.karaf
package object mbeans {
val DefaultServiceUrl = ServiceUrl("localhost", 1099, "karaf-root")
val DefaultContainerArgs = ContainerArgs(DefaultServiceUrl.toString, "karaf", "karaf")
val ConfigService = new MBeanService("org.apache.karaf:type=config,name=*", cl... |
Explain and rewrite the following Scala code: | package com.greencatsoft.angularjs.extensions.material
import com.greencatsoft.angularjs.injectable
import scala.scalajs.js
/** \\$mdSidenav makes it easy to interact with multiple sidenavs in an app.
*
* @see https://material.angularjs.org/#/api/material.components.sidenav/service/\\$mdSidenav
*/
@js.native
@... |
Explain and rewrite the following Scala code: | (f >=> g)(a) == flatten(fmap(g)(f(a))) |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package sri.reactive2015.components
import sri.core._
import sri.mobile.all._
import sri.reactive2015.utils.Colors
import sri.universal.components._
import sri.universal.styles.UniversalStyleSheet
import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
import scala.scalajs.js.{UndefOr => U}
object... |
Explain and rewrite the following Scala code: | package scife.enumeration
package lazytraversal
import combinators.{ Product => CProduct }
import scalaz.LazyTuple2
protected[enumeration] class ProductFiniteLazyTuple[T, V]
(val left: TouchableEnum[T], val right: TouchableEnum[V])
extends Finite[LazyTuple2[T, V]] with Skippable[LazyTuple2[T, V]] with Resetable[... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.