instruction
stringclasses
1 value
output
stringlengths
5
1M
Explain and rewrite the following Scala code:
package net.mtgto.garoon /** * ่ช่จผๆ‰‹ๆฎต */ sealed trait Authentication /** * ่ช่จผใชใ—. * * ใƒฆใƒผใ‚ถใƒผๅใจใƒ‘ใ‚นใƒฏใƒผใƒ‰ใ‚’ๅผ•ๆ•ฐใซๅฎŸ่กŒใ™ใ‚‹ใ‚ปใƒƒใ‚ทใƒงใƒณ็™บ่กŒๆ™‚ใชใฉใซๅˆฉ็”จใ™ใ‚‹. */ object NoAuth extends Authentication /** * ใƒฆใƒผใ‚ถใƒผๅใจใƒ‘ใ‚นใƒฏใƒผใƒ‰ใซใ‚ˆใ‚‹่ช่จผ * @param username * @param password */ case class Password(username: String, password: String) extends Authentication /** *...
Explain and rewrite the following Scala code:
/** * Copyright (C) 2015 Stratio (http://stratio.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 ap...
Explain and rewrite the following Scala code:
import scalafx.application.JFXApp3 import view.* object Main extends JFXApp3: override def start(): Unit = stage = MainStage()
Explain and rewrite the following Scala code:
class A { def m() { var b: Boolean = null <= 1 } } object Main { def main(args: Array[String]) { } }
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:
package scwebapp.data object InclusiveRange { def full(total:Long):InclusiveRange = InclusiveRange(0, total - 1) def startLength(start:Long, length:Long):InclusiveRange = InclusiveRange(start, start + length - 1) } /** start and end are both inclusive */ final case class InclusiveRange(start:Long, end:Long) { ...
Explain and rewrite the following Scala code:
/* * Copyright 2012 Sanjin Sehic * * 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:
/** * Copyright 2012 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 agreed to i...
Explain and rewrite the following Scala code:
package de.marleu88.examples import com.beust.jcommander.{JCommander, Parameter} import com.typesafe.scalalogging.LazyLogging import org.apache.avro.generic.GenericData.StringType import org.apache.spark.sql.{DataFrame, SaveMode, SparkSession} import org.apache.spark.sql.functions.lit object MySparkBatchExample1 exte...
Explain and rewrite the following Scala code:
package sender import akka.actor.{PoisonPill, Actor} import akka.actor.Actor.Receive import models.{Sandbox, MailParams, Mail, BulkMail} import sender.Messages.{WorkDone, Tick, Job} import services._ import scala.concurrent.ExecutionContext.Implicits.global /** * Created by unoedx on 06/05/16. */ class Worker ext...
Explain and rewrite the following Scala code:
package com.sksamuel.elastic4s.searches.aggs import com.sksamuel.elastic4s.ScriptBuilder import com.sksamuel.elastic4s.searches.aggs.pipeline.PipelineAggregationBuilderFn import org.elasticsearch.search.aggregations.AggregationBuilders import org.elasticsearch.search.aggregations.metrics.scripted.ScriptedMetricAggrega...
Explain and rewrite the following Scala code:
/* * Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com> */ package com.lightbend.lagom.javadsl.pubsub import java.io.NotSerializableException import java.util.concurrent.CompletionStage import scala.concurrent.duration._ import scala.concurrent.duration.FiniteDuration import akka.actor.ActorRef impo...
Explain and rewrite the following Scala code:
package com.collective.modelmatrix.transform import com.collective.modelmatrix.{ModelFeature, ModelMatrix, TestSparkContext} import org.apache.spark.sql.Row import org.apache.spark.sql.types.{IntegerType, StringType, StructField, StructType} import org.scalatest.FlatSpec import scalaz.syntax.either._ import scalaz.{-...
Explain and rewrite the following Scala code:
package com.lot.blockAmount.dao import akka.actor.Actor import com.typesafe.scalalogging.LazyLogging import slick.driver.JdbcProfile import com.lot.utils.{ DbModule } import scala.concurrent.Future import com.lot.blockAmount.model.BlockAmountTable import slick.driver.MySQLDriver.api._ import com.lot.blockAmount.model....
Explain and rewrite the following Scala code:
package dnd5_dm_db package model case class Spell ( name : Local, level : Int, school : MagicSchool, ritual : Boolean, castingTime : DnDTime, range : DnDLength, sAreaOfEffect: Option[AreaOfEffect], components : List[Components], durations : Seq[DnDTime], description : Local, highLevelDescription :...
Explain and rewrite the following Scala code:
package com.lambdalab.gradle.tasks.thrift import collection.JavaConversions._ import com.twitter.scrooge.{Main, Compiler} import java.io.File object ScroogeCompiler { def compile(files: java.lang.Iterable[File], dest: File, opts: java.lang.Iterable[String]) { val destination = dest.getAbsolutePath val thrif...
Explain and rewrite the following Scala code:
package io.github.psychicwaddle.kappadi.graph /** * @author Jaca777 * Created 2017-08-27 at 14 */ case class CycleFoundException[A](cycle: List[A]) extends RuntimeException(s"Cycle found: ${cycle.mkString(" -> ")}")
Explain and rewrite the following Scala code:
package io.abacus.counter import java.util.concurrent.{TimeUnit, Executors} // window is size of the window in milliseconds and // granularity is the size of each interval in milliseconds // window/granularity should be even, if not, we round up class TimeWindowedCounter[T](window:Long,granularity:Long) { private va...
Explain and rewrite the following Scala code:
//: ---------------------------------------------------------------------------- //: Copyright (C) 2015 Verizon. 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 Licen...
Explain and rewrite the following Scala code:
/******************************************************************************* * (C) Copyright 2015 ADP, 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....
Explain and rewrite the following Scala code:
package dotty.tools.dotc package util import core.Types.WildcardType /** Common values hoisted out for performance */ object common { val alwaysTrue: Any => Boolean = Function.const(true) _ val alwaysFalse: Any => Boolean = Function.const(false) _ val alwaysZero: Any => Int = Function.const(0) _ val alwaysWi...
Explain and rewrite the following Scala code:
package com.imaginea.activegrid.core.models import org.neo4j.graphdb.Node /** * Created by shareefn on 20/12/16. */ case class ScriptArgument(override val id: Option[Long], propName: Option[String], propValue: Option[String], argOrder: ...
Explain and rewrite the following Scala code:
/** * Copyright 2016 ZuInnoTe (Jรถrn Franke) <zuinnote@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless re...
Explain and rewrite the following Scala code:
package darkpool.engine import java.util.UUID import darkpool.book.OrderBook import darkpool.models.orders.{LimitOrder, SellOrder, BuyOrder} import org.scalatest.{BeforeAndAfter, FunSpec, Matchers} class MatchingEngineSelfMatchPreventionSpec extends FunSpec with Matchers with BeforeAndAfter { var orderBookBuy = n...
Explain and rewrite the following Scala code:
/* * Copyright (c) 2002-2018 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j 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 Foundatio...
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.flowpaint.raster.change import org.flowpaint.raster.picture.Picture /** * Stores a change done to a picture, to allow undoing and redoing it. */ trait Change { def undo(picture: Picture) def redo(picture: Picture) }
Explain and rewrite the following Scala code:
package org.kokho.scheduling.rts.multicritical import org.kokho.scheduling._ /** * Created with IntelliJ IDEA on 5/28/15. * @author: Mikhail Kokho */ trait HiCriticalTask extends MulticriticalTask with SynchronousTask { override type JobType = HiCriticalJob def hiExecution: Int def loExecution: Int de...
Explain and rewrite the following Scala code:
package guice import com.google.inject.Singleton import play.twirl.api.Html import views.html.info.newcastle.{Footer, PrivacyContent, TermsContent} @Singleton class NewcastleCustomContent extends CustomContent { override def footer(): Html = Footer() override def privacy(): Html = PrivacyContent() override def ...
Explain and rewrite the following Scala code:
package mesosphere.marathon package api.v2 import akka.Done import java.util.Collections import akka.stream.scaladsl.Source import mesosphere.AkkaUnitTest import mesosphere.marathon.api.v2.json.Formats._ import mesosphere.marathon.api.{GroupApiService, TestAuthFixture, TestGroupManagerFixture} import mesosphere.marat...
Explain and rewrite the following Scala code:
/* * 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...
Explain and rewrite the following Scala code:
package com.blazedb.sparkperf.util import java.io.FileInputStream import org.yaml.snakeyaml.Yaml import scala.collection.parallel.mutable /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional info...
Explain and rewrite the following Scala code:
/* Copyright 2009-2016 EPFL, Lausanne */ import leon.lang._ import leon.annotation._ import leon._ object Asserts1 { def foo(a: BigInt): BigInt = { require(a > 0) val b = a assert(b > 0, "Hey now") b + bar(1) } ensuring { res => res > a && res < 2 } def bar(a: BigInt): BigInt = { req...
Explain and rewrite the following Scala code:
package pl.touk.nussknacker.ui.process.migrate import pl.touk.nussknacker.engine.api.MetaData import pl.touk.nussknacker.engine.graph.node.{CustomNode, NodeData} import pl.touk.nussknacker.engine.migration.NodeMigration //If you want to apply this migration for different node type create new case class instance with ...
Explain and rewrite the following Scala code:
/* * Copyright (C) 2007-2008 Artima, Inc. 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 requir...
Explain and rewrite the following Scala code:
package de.unihamburg.vsis.sddf.shell; // This file needs to be loaded by the spark-shell to avoid annoying imports // ./spark-shell // --jars /home/niklas/projects/sddf/code/projects/simpleapp/target/scala-2.10/sddf-assembly-1.0.jar // -i /home/niklas/projects/sddf/code/projects/simpleapp/src/main/scala/de/unihamburg...
Explain and rewrite the following Scala code:
object Solution38 { def main(args: Array[String]): Unit = { val numbers = 2 to 9 flatMap(pandigital(_)) println(numbers) val pandigitals = numbers.map{ case (n, ms) => calcNumber(n, ms) } println(pandigitals) } def pandigital(n: Int): List[(Int, List[Int])] = { val multipliers ...
Explain and rewrite the following Scala code:
/* * Copyright 2016 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...
Explain and rewrite the following Scala code:
package com.github.vooolll.config import com.typesafe.config.{Config, ConfigException} import org.scalatest.mockito.MockitoSugar import org.scalatest.{Matchers, WordSpec} import cats.implicits._ class ConfigurationDetectorSpec extends WordSpec with Matchers with MockitoSugar { val testEnvVarValue = "configuration-...
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 endpoints.play.server import akka.stream.scaladsl.{Source, StreamConverters} import akka.util.ByteString import endpoints.algebra import play.api.http.{ContentTypes, HttpEntity} import play.api.mvc.Results import play.mvc.Http.HeaderNames /** * Interpreter for [[algebra.Assets]] that performs routing using ...
Explain and rewrite the following Scala code:
package org.deepdive.settings /* Schema Settings */ case class SchemaSettings(variables: Map[String, _ <: VariableDataType], setupFile: Option[String]) // sealed trait VariableDataType { // def cardinality: Option[Long] // } // case object BooleanType extends VariableDataType { // def cardinality = None // over...
Explain and rewrite the following Scala code:
package controllers import play.api._ import play.api.mvc._ import com.googlecode.flickrjandroid._ import com.googlecode.flickrjandroid.photos._ object Application extends Controller { def index = Action { // You apps https://www.flickr.com/services/apps/by/oct val key = Play.current.configuration.getStri...
Explain and rewrite the following Scala code:
package com.github.zenpie.macrowave.internal.scanner import java.util.LinkedList import com.github.zenpie.macrowave.internal._ import com.github.zenpie.macrowave.internal.ids.{ScannerRuleId, TerminalId} import scala.collection.mutable import scala.reflect.macros.whitebox import scala.util.{Failure, Success} trait R...
Explain and rewrite the following Scala code:
package ru.st.training.domain import scala.collection.mutable.ListBuffer class Grid(val width: Int, val height: Int) { private var a = 0 private var b = 0 private var tmpcells = new ListBuffer[Cell]() for (a <- 1 to width; b <- 1 to height) { val coordinates = new Coordinates(a, b) val cell = new Cel...
Explain and rewrite the following Scala code:
package omnibus.domain.topic import akka.actor._ import akka.persistence._ import scala.concurrent.duration._ import omnibus.core.actors.CommonActor import omnibus.domain.topic.TopicContentProtocol._ import omnibus.domain.topic.TopicPurgerHelperProtocol._ class TopicPurgerHelper(val topicId: String, val timeLimit: ...
Explain and rewrite the following Scala code:
// Copyright (c) 2011-2015 ScalaMock Contributors (https://github.com/paulbutcher/ScalaMock/graphs/contributors) // // 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, inc...
Explain and rewrite the following Scala code:
package lampetia.example.module import lampetia.conf.{Configuration => LampetiaConfiguration} import lampetia.example.conf.ExampleConfiguration import lampetia.example.format.{ExampleJsonFormat, ExampleSqlFormat} import lampetia.example.model.ExampleModel import lampetia.sql.{ConnectionSourceFactories, JdbcConnectionS...
Explain and rewrite the following Scala code:
package utilities import com.badlogic.gdx.{Gdx, Graphics} import org.scalamock.scalatest.MockFactory import org.scalatest.FlatSpec /** * Created by julien on 11/08/15. */ object GdxMock extends FlatSpec with MockFactory { def graphics = { Gdx.graphics = mock[Graphics] (Gdx.graphics.getWidth _) expects() ...
Explain and rewrite the following Scala code:
package breeze.numerics.financial /* Copyright 2012 David Hall Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law o...
Explain and rewrite the following Scala code:
package wandou.indicator import java.awt.Color import wandou.math.signal.Corner import wandou.math.signal.Kind import wandou.math.signal.Mark import wandou.math.signal.Side import wandou.math.signal.Sign import wandou.math.signal.Signal import wandou.math.signal.SignalEvent import wandou.math.timeseries.TBaseSer impor...
Explain and rewrite the following Scala code:
package com.github.akovari.rdfp import scala.concurrent.ExecutionContext.Implicits.global import com.github.akovari.typesafeSalesforce.util.{SalesForceConnectionImpl, SalesForceConnection} import com.typesafe.config.ConfigFactory /** * Created by akovari on 13.6.2015. */ object Configuration { val cfg = Config...
Explain and rewrite the following Scala code:
package io.circe import cats.data.Const import cats.instances.all._ import cats.kernel.Eq import cats.syntax.eq._ import io.circe.tests.CirceSuite import org.scalatest.exceptions.TestFailedException class JsonObjectSuite extends CirceSuite { "JsonObject.fromIterable" should "drop all but the last instance when fiel...
Explain and rewrite the following Scala code:
package com.twitter.finagle.service import org.specs.SpecificationWithJUnit import org.specs.mock.Mockito import com.twitter.util.Promise import com.twitter.finagle.stats.InMemoryStatsReceiver import com.twitter.finagle.{RequestException, WriteException, Service} import org.junit.runner.RunWith import org.scalatest.Fu...
Explain and rewrite the following Scala code:
package org.scalaide.core.internal.quickassist import org.eclipse.core.commands.AbstractHandler import org.eclipse.core.commands.ExecutionEvent import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.ProblemAnnotation import org.eclipse.jdt.internal.ui.javaeditor.IJavaAnnotation import org.eclips...
Explain and rewrite the following Scala code:
package yugioh.card.monster sealed trait Position // there is technically a way to be face down and in attack mode, but we don't support it case object Set extends Position // in defense mode case object Attack extends Position case object Defense extends Position object Position { val FaceUp: Set[Position] = scal...
Explain and rewrite the following Scala code:
/* * Copyright (c) 2014-2018 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...
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 pgep.GeneticOperators.Reproducers class ReproductionGroup(selection: GenotypeSelector, probabilities: List[Double], ops: List[Reproducer]) extends Reproducer(ops.head.nparams, ops.head.nchildren, selection) { require(ops forall (op => op.nchildren == nchildren ...
Explain and rewrite the following Scala code:
package darkpool.models import java.util.UUID import darkpool.models.common._ package object orders { // // Order Traits // trait OrderType { def orderType: OrderType } trait Buy extends OrderType trait Sell extends OrderType trait Order extends Quantity with CreatedAt with ID with AccountID { ...
Explain and rewrite the following Scala code:
/* * Scala.js (https://www.scala-js.org/) * * Copyright EPFL. * * Licensed under Apache License 2.0 * (https://www.apache.org/licenses/LICENSE-2.0). * * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ /** * All doc-comments marked as "MDN" are by...
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-2.0 * ...
Explain and rewrite the following Scala code:
package docs.home.scaladsl.persistence //#full-example import akka.Done import com.lightbend.lagom.scaladsl.persistence.PersistentEntity final class Post extends PersistentEntity { override type Command = BlogCommand override type Event = BlogEvent override type State = BlogState override def initialState: ...
Explain and rewrite the following Scala code:
package com.arcusys.valamis.lesson.model import com.arcusys.valamis.lesson.model.LessonType.LessonType import org.joda.time.DateTime case class Lesson(id: Long, lessonType: LessonType, title: String, description: String, logo: Option[String], ...
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 controllers import javax.inject.Inject import com.mohiva.play.silhouette.api.Silhouette import daos.ResourceDao import forms.{ResourceAddForm, ResourceSearchForm} import models.User import play.api.data.Form import play.api.data.Forms.{mapping, _} import play.api.i18n.{I18nSupport, MessagesApi} import play.ap...
Explain and rewrite the following Scala code:
package org.apache.spark.sql.cassandra import com.datastax.spark.connector import com.datastax.spark.connector.cql.{ColumnDef, TableDef} import com.datastax.spark.connector.types.UDTFieldDef import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference} import org.apache.spark.sql.catalyst.plans.log...
Explain and rewrite the following Scala code:
package edu.gemini.model.p1.targetio.impl import edu.gemini.model.p1.immutable.NonSiderealTarget import edu.gemini.model.p1.targetio.api.{DataSourceError, FileType, TargetWriter} import java.io.{OutputStream, File} import edu.gemini.model.p1.targetio.table.{Column, TableWriter} object NonSiderealWriter extends Target...
Explain and rewrite the following Scala code:
package dbpedia.dataparsers.util import com.fasterxml.jackson.annotation.JsonFormat.Value import org.wikidata.wdtk.datamodel.interfaces._ import org.wikidata.wdtk.datamodel.json.jackson.datavalues.JacksonValueMonolingualText /** * Created by ali on 2/1/15. */ object WikidataUtil { def replacePunctuation(value:Str...
Explain and rewrite the following Scala code:
import sbt._ import Keys._ import java.net.{URL, URLClassLoader} import java.io.PrintWriter import scala.io.Source import com.typesafe.sbt.osgi.OsgiKeys import com.typesafe.sbt.osgi.SbtOsgi import com.typesafe.sbt.osgi.SbtOsgi.autoImport._ import com.jsuereth.sbtpgp.SbtPgp.autoImport._ //import sbtcrossproject.CrossPl...
Explain and rewrite the following Scala code:
/* NSC -- new Scala compiler * Copyright 2002-2013 LAMP/EPFL * @author Martin Odersky */ package reflectdoc.tools.nsc package reporters import scala.reflect.internal.util._ /** * This interface provides methods to issue information, warning and * error messages. */ abstract class Reporter { protected def inf...
Explain and rewrite the following Scala code:
/* * -โ•ฅโŒโŒโŒโŒ -โŒโŒโŒโŒ- * โ‰กโ•ขโ–‘โ–‘โ–‘โ–‘โŒ\โ–‘โ–‘โ–‘ฯ† โ•“โ•โ–‘โ–‘โ–‘โ–‘โŒโ–‘โ–‘โ–‘โ–‘โ•ชโ•• * โ•ฃโ•ฌโ–‘โ–‘` `โ–‘โ–‘โ–‘โ•ขโ”˜ ฯ†โ–’โ•ฃโ•ฌโ•โ•œ โ–‘โ–‘โ•ขโ•ฃQ * โ•‘โ•ฃโ•ฌโ–‘โŒ ` โ•คโ–’โ–’โ–’ร…` โ•‘โ•ขโ•ฌโ•ฃ * โ•šโ•ฃโ•ฌโ–‘โŒ โ•”โ–’โ–’โ–’โ–’`ยซโ•• โ•ขโ•ขโ•ฃโ–’ * โ•ซโ•ฌโ–‘โ–‘โ•– .โ–‘ โ•™โ•จโ•จ โ•ฃโ•ฃโ•ฌโ–‘ฯ† โ•“ฯ†โ–‘โ•ขโ•ขร… * โ•™โ•ขโ–‘โ–‘โ–‘โ–‘โŒ"โ–‘โ–‘โ–‘โ•œ โ•™ร…โ–‘โ–‘โ–‘โ–‘โŒโ–‘โ–‘โ–‘โ–‘โ•` * ``หšยฌ โŒ หšหšโŒยด * * ...
Explain and rewrite the following Scala code:
package com.wordnik.client.model import java.util.Date case class Source ( id: Int, client_id: String, name: String, created_at: Date, updated_at: Date )
Explain and rewrite the following Scala code:
package im.mange.shoreditch.api import im.mange.shoreditch.{In, Out} case class CheckMetaData(url: String) case class ActionMetaData(url: String, in: Seq[In], out: Option[Out]) case class MetaDataResponse(name: String, alias: String, version: String, checks: Seq[CheckMetaData], actions: Seq[ActionMetaData])
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:
/** * Generated by apidoc - http://www.apidoc.me * Service version: 0.3.46 * apidoc:0.11.19 http://localhost:9000/bryzek/apidoc-example-union-types-discriminator/0.3.46/play_2_4_client */ package com.bryzek.apidoc.example.union.types.discriminator.v0.models { sealed trait User case class GuestUser( id: St...
Explain and rewrite the following Scala code:
package io.neons.collector.infrastructure.log.sink import java.util.UUID import io.neons.collector.model.log.{Log, LogHeaderBag} import io.neons.collector.testcase.CollectorConfigTestCase import org.apache.kafka.clients.producer.KafkaProducer import org.scalatest.mockito.MockitoSugar import org.scalatest.{FlatSpec, M...
Explain and rewrite the following Scala code:
/* * Ported from https://github.com/hamcrest/JavaHamcrest/ */ package org.hamcrest.core import org.hamcrest.BaseMatcher import org.hamcrest.Description import org.hamcrest.Matcher import org.hamcrest.core.IsEqual.equalTo import org.hamcrest.core.IsInstanceOf.instanceOf class Is[T](matcher: Matcher[T]) extends Base...
Explain and rewrite the following Scala code:
/* NSC -- new Scala compiler * Copyright 2007-2013 LAMP/EPFL * @author Gilles Dubochet */ package scala.tools.nsc package doc package model /** An type that represents visibility of members. */ sealed trait Visibility { def isProtected: Boolean = false def isPublic: Boolean = false } /** The visibility of `p...
Explain and rewrite the following Scala code:
package com.richardchankiyin.mail object MailSenderApp { def main(args:Array[String]) { /* Gmail setting */ /* val list:List[(String,String)] = List( ("mail.smtp.auth", "true") ,("mail.smtp.starttls.enable", "true") ,("mail.smtp.ssl.trust", "smtp.gmail.com") ) */ ...
Explain and rewrite the following Scala code:
/* * Copyright 2015 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 com.codiply.barrio.neighbors.forests import akka.actor.Actor import akka.actor.Props import com.codiply.barrio.helpers.LongQuantityStats import com.codiply.barrio.neighbors.TreeStats import com.codiply.barrio.neighbors.TreeStatsContainer object NeihborhoodForestStatsActor { def props(): Props = Props(new Ne...
Explain and rewrite the following Scala code:
package string_formats_validation package object yaml { import org.joda.time.DateTime import org.joda.time.LocalDate import de.zalando.play.controllers.BinaryString import BinaryString._ import de.zalando.play.controllers.Base64String import Base64String._ import de.zalando.play.controlle...
Explain and rewrite the following Scala code:
package io.eels.component.jdbc import java.sql.DriverManager import io.eels.schema._ import org.scalatest.{Matchers, WordSpec} class JdbcSourceTest extends WordSpec with Matchers { Class.forName("org.h2.Driver") "JdbcSource" should { "read schema" in { val conn = DriverManager.getConnection("jdbc:h2:...
Explain and rewrite the following Scala code:
/* * Copyright 2016 Nicolas Rinaudo * * 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...
Explain and rewrite the following Scala code:
package im.tox.toktok.app.new_message import android.support.v7.widget.RecyclerView import android.util.SparseBooleanArray import android.view.animation.AlphaAnimation import android.view.{ LayoutInflater, View, ViewGroup } import android.widget.Filter.FilterResults import android.widget.{ Filter, Filterable, Relative...
Explain and rewrite the following Scala code:
package models import play.api.libs.json._ import play.api.libs.json.Reads._ import play.api.libs.functional.syntax._ case class Vessel(name: String, width: Float, length: Float, draft: Float, latitude: Float, longitude: Float) object Vessel { implicit val vesselFormat: Format[Vessel] = ( (__ \ "name").format...
Explain and rewrite the following Scala code:
package com.twitter.diffy.workflow import javax.inject.{Named, Inject} import com.twitter.diffy.analysis.{RawDifferenceCounter, DifferenceCounter, EndpointMetadata} import com.twitter.diffy.util.EmailSender import com.twitter.finagle.util.DefaultTimer import com.twitter.finagle.stats.StatsReceiver import com.twitter....
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 edu.iitd.nlp.ListExtraction import java.io.{ File, PrintWriter } import org.allenai.common.LoggingWithUncaughtExceptions import org.scalatest._ import scala.collection.mutable import scala.io.Source import scala.util.Random class TestBagOfWordsBasedExtractor extends FlatSpec with LoggingWithUncaughtExceptio...
Explain and rewrite the following Scala code:
/** * Copyright (C) 2009-2011 the original author or authors. * See the notice.md file distributed with this work for additional * information regarding copyright ownership. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
Explain and rewrite the following Scala code:
/* * Copyright 2015 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...
Explain and rewrite the following Scala code:
package com.github.oopman.collectioneer.model import java.sql.{Clob, Timestamp} import slick.lifted.{Tag => SlickTag} case class Category(id: Int, left: Option[Int], right: Option[Int], name: String) case class Collection(id: Int, name: String, category: Option[Int], description: Option[Clob], ...
Explain and rewrite the following Scala code:
package io.apibuilder.validation import io.apibuilder.spec.v0.models._ trait ResponseHelpers { def response(apibuilderOperation: ApiBuilderOperation, responseCode: Int): Option[Response] = { response(apibuilderOperation.operation, responseCode) } /** * Looks up the response for the given status code f...
Explain and rewrite the following Scala code:
/* * Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com> */ package play.filters.csp import java.util.Base64 import java.util.regex.{ Matcher, Pattern } import javax.inject.{ Inject, Singleton } import play.api.mvc.RequestHeader import play.api.mvc.request.RequestAttrKey /** * This trait processes...
Explain and rewrite the following Scala code:
package sri.test import org.scalajs.dom import sri.test.router.WebRouterExample._ import sri.test.router.{HomeScreen, WebRouterExample} import sri.web.ReactDOM import sri.web.router.Location import scala.scalajs.js.Dynamic.{literal => json} class WebRouterTest extends BaseTest { var rootNode: dom.Element = null ...
Explain and rewrite the following Scala code:
package code.blog package snippet import scala.xml.{NodeSeq, Text} import net.liftweb.util._ import net.liftweb.common._ import java.util.Date import code.blog.lib._ import Helpers._ class HelloWorld { lazy val date: Box[Date] = DependencyFactory.inject[Date] // inject the date // replace the contents of the e...
Explain and rewrite the following Scala code:
package rros.core /** * Created by namnguyen on 3/2/15. */ import java.nio.ByteBuffer import java.util.{Base64, UUID} import scala.util.Random //////////////////////////////////////////////////////////////////////////////// /** * GUID is used to generate unique identifier in String. It compresses the UUID * so t...
Explain and rewrite the following Scala code:
package scala.runtime.stdLibPatches object Predef: import compiletime.summonFrom transparent inline def assert(inline assertion: Boolean, inline message: => Any): Unit = if !assertion then scala.runtime.Scala3RunTime.assertFailed(message) transparent inline def assert(inline assertion: Boolean): Unit = ...