#scala

[ follow ]
JavaScript
Alvinalexander
9 hours ago
JavaScript

How to format source code blocks in Scaladoc comments

To embed Scala source code examples in Scaladoc comments, use {{{ and }}} characters, enabling proper code block formatting. [ more ]
Medium
3 days ago
JavaScript

Using zipWithIndex or zip to Create Loop Counters in Scala.

Using zipWithIndex or zip methods in Scala can automatically create a counter when iterating over sequential collections. [ more ]
Medium
1 month ago
JavaScript

Scala Higher-Order Functions

Functions in Scala are treated as first-class values, allowing functions to be used in a variety of contexts.
Higher-order functions in Scala can take functions as parameters, enabling functional programming concepts like function composition. [ more ]
Medium
1 month ago
JavaScript

Higher Order Functions in Scala.

Functions in Scala are first-class citizens, allowing assignment, passing as arguments, and return from functions.
First-class functions enable the creation of higher-order functions, enhancing code expressiveness. [ more ]
moreJavaScript
programming-languages
Medium
1 day ago
Scala

Exploring Programming Languages-Scala

Scala is a programming language built on the Java Virtual Machine with notable users like LinkedIn, Netflix, Sony, and Amazon. [ more ]
Medium
1 week ago
Scala

Solving `type mismatch; found : X required: Y` Error in Scala

Understanding `type mismatch; found : X required: Y` error in Scala helps in fixing it by changing the type, casting, or altering function signatures. [ more ]
Artima
1 month ago
Scala

A (Brief) History of Object-Functional Programming

Scala evolved from a risky, new language to a mature and widely-used option.
Programming languages evolve through a process of artificial selection and hybrid vigor. [ more ]
Medium
1 month ago
Scala

A quick overview of access modifiers in Scala

Scala access modifiers resemble Java's but have additional levels.
Scala defaults to public access, unlike Java's package private default. [ more ]
Medium
3 months ago
Data science

Beyond Python and R: Exploring Diverse Programming Languages in Data Science

Python and R have been the dominant programming languages in data science, but there is a growing trend of using alternative languages.
Alternative languages like Julia, Scala, Java, and SQL are gaining popularity for their unique strengths in data science tasks. [ more ]
medium.com
3 months ago
Scala

Comparing Scala, Java, Kotlin, and Go: A Comprehensive Overview

1. JVM languages like Scala, Java, and Kotlin share some underlying mechanics and support OOP principles.
2. Scala integrates both object-oriented and functional programming paradigms, while Java and Kotlin have a similar syntax but with additional features like null safety and extension functions. [ more ]
moreprogramming-languages
Scala
Medium
6 days ago
Scala

Exploring Play Framework: Java, Scala, and Web Development

Scala complements Java in Play Framework for robust and scalable web applications. [ more ]
SoftwareMill
1 week ago
Scala

Safe direct-style Scala: Ox 0.1.0 released | SoftwareMill

Ox project 0.1.0 release offers safe direct-style concurrency and resiliency for Scala on the JVM. [ more ]
Alvinalexander
1 week ago
Scala

A ZIO JSON solution to parse/decode JSON with blank spaces in the keys (and a type hierarchy)

ZIO JSON provides a solution to decode JSON into Scala classes/objects. [ more ]
Alvinalexander
1 week ago
Scala

How to convert HTML to plain text with Jsoup (Scala and Java)

Jsoup in Scala/Java can convert HTML to plain text, offering various methods for extraction. [ more ]
Medium
2 weeks ago
Scala

Demystifying the 'type mismatch; found : X required: Y' Error in Scala

Demystifying the 'type mismatch; found : X required: Y' error in Scala. [ more ]
Alvinalexander
1 week ago
Scala

ZIO 2: How to read a file and write its output to the console

Reading files and processing output using ZIO 2 in Scala. [ more ]
moreScala
Alvinalexander
1 week ago
Scala

ScalaTest: How to print debug output in tests (to STDOUT)

ScalaTest's info function can be used to print output for visibility within unit tests, unlike println or System.err.println. [ more ]
Alvinalexander
1 week ago
Scala

SBT/build.sbt: One percent symbol or multiple percent symbol for Java and Scala dependencies?

Use %% for Scala-specific libraries and % for other JVM dependencies in SBT build.sbt files for Scala projects. [ more ]
Medium
1 month ago
Scala

Leveraging sbt remote caching on a big modular monolith

Business logic was dispersed across clients, database schema evolution was difficult, dependencies were implicit. [ more ]
Medium
3 months ago
Scala

VSCode ile Lokal'de Scala Projesi Gelistirme

Install VSCode, Java, and sbt on your computer
Configure VSCode settings and install the necessary extensions
Create a new Scala project in VSCode and run your Scala code [ more ]
Alvinalexander
1 week ago
Data science

ZIO 2: STDOUT and STDERR console output with foldZIO, success, failure

Using ZIO in Scala to handle success and failure cases with foldZIO function for printing information to the console. [ more ]
Medium
2 weeks ago
Data science

Best Practices for Writing Maintainable and Testable Spark Code in Scala

Scala is considered the optimal choice for Spark development due to its availability of code samples and simple syntax. [ more ]
Medium
4 weeks ago
Data science

Time Series Feature Engineering in Apache Spark for Python with Scala

Feature engineering is crucial for unlocking insights from complex data sets.
Time series feature engineering requires specialized methods due to temporal dependencies. [ more ]
Medium
2 weeks ago
Scala

how to fill null values and drop null values in pyspark,sql and scala

Handling null values involves filling specified values and dropping rows/columns with null values in PySpark, SQL, and Scala. [ more ]
Alvinalexander
2 weeks ago
Scala

Scala/Java/Kotlin: How to replace left and right brackets in a String (replaceFirst, replaceAll)

Use \ before left bracket for string replacement in Scala/Java/Kotlin. [ more ]
Medium
3 weeks ago
Scala

Solving `type mismatch; found : X required: Y` Error in Scala

Understanding 'type mismatch' error in Scala - mismatch between expected and actual data types.
Resolving 'type mismatch' by correcting data type or using type casting. [ more ]
Medium
3 weeks ago
Scala

Solving the 'Palindrome Number' on LeetCode: Scala Solutions Walkthrough

Converting integer to string for palindrome check.
Optimization to reverse half of the number for palindrome check. [ more ]
Scalac - Software Development Company - Akka, Kafka, Spark, ZIO
4 weeks ago
Scala

Scala 3 Data Transformation Library: ducktape 0.2.0.

Ducktape is an automatic and customizable compile-time transformation tool for case classes and sealed traits/enums in Scala.
The name 'ducktape' signifies its potential to generate glue code, despite being originally intended as 'ducttape'. [ more ]
Alvinalexander
4 weeks ago
Scala

Creating a Thread (and Runnable) in Scala

Scala threads are created similarly to Java threads with slight syntax differences.
Java Runnable can be used in Scala to create threads by implementing the run method. [ more ]
Medium
4 weeks ago
Scala

Scala Jobs on AWS Glue: A Practical Guide to Development, Local Testing and Deployment

AWS Glue is highly scalable, cost-effective, and integrates well with other AWS services for orchestrating complex pipelines.
Performance issues exist in AWS Glue when dealing with large Python-based Pyspark jobs due to expensive data shuffling between JVM and Python processes. [ more ]
software-development
Medium
1 month ago
Scala

Brief Introduction to Scala

Scala is a programming language created in 2003 to address challenges in developing complex software systems efficiently.
Scala is statically-typed, supports functional and object-oriented programming, and has a rich set of libraries for building scalable applications. [ more ]
Medium
2 months ago
Scala

Programming in Scala [Chapter 27]-Modular Programming Using Objects

Packages in Scala are treated as modules with interfaces and hidden implementations, but have limitations in abstraction and reconfiguration.
Scala's object-oriented features like singleton objects, traits, and classes facilitate modularity, enabling reconfiguration and inheritance between modules. [ more ]
Medium
2 months ago
Scala

Programming in Scala [Chapter 25]-Annotations

Annotations are structured in Scala for machine processing, tools use them extensively
Practical use over developing new annotation processing tools [ more ]
Medium
2 months ago
Scala

Tips and Trends in Scala

Scala combines object-oriented and functional programming paradigms.
Scala's integration with Java ecosystem is a key advantage. [ more ]
Medium
2 months ago
Scala

Unit Testing Infinite While Loops in Scala: A Practical Approach

Testing scenarios with infinite loops in Scala can be challenging due to asynchronous and concurrent programming.
Encapsulating infinite loops within Scala Futures can facilitate testing by managing the asynchronous nature of computations. [ more ]
moresoftware-development
big-data-processing
Medium
1 month ago
Scala

Scala Scripting: Powering Functional Programming and Big Data Solutions

Scala is a high-level language combining object-oriented and functional programming on JVM.
Scala scripting enables automation, data processing, and web applications with concise and scalable code. [ more ]
Medium
1 month ago
Scala

Download Now Developer-for-Apache-Spark-Scala Exam Questions Answers and Tips

Validation of skills in Apache Spark & Scala is crucial for professionals.
Exam covers Apache Spark & Scala concepts, hands-on coding, and real-world problem-solving. [ more ]
Medium
1 month ago
Scala

Analisis de la Felicidad Mundial

Spark can execute processes directly in RAM for faster data processing compared to traditional disk systems.
Lazy evaluation in Spark optimizes memory usage by executing transformations only when required. [ more ]
Medium
1 month ago
Scala

Mastering Apache Spark with Scala: From Basics to Advanced Analytics

Apache Spark excels in big data challenges with in-memory computing.
Scala's features make it ideal for Spark's data processing tasks. [ more ]
Medium
2 months ago
Scala

Databricks- Camel to Snake Case by using Scala

Column names can be changed from CamelCase to Snake Case in a Scala dataframe in Databricks.
Scala is efficient for big data processing due to type safety, immutability, and functional paradigms. [ more ]
morebig-data-processing
Medium
1 month ago
Scala

Understanding Type Parameters with Upper Bounds and Context Bounds in Scala

Scala combines object-oriented and functional programming.
Type parameters in Scala can have upper bounds and context bounds for type restrictions. [ more ]
Medium
1 month ago
Scala

Use of Underscore(_) in Scala Language.

Underscore (_) in Scala has multiple uses like wildcard pattern, ignored variable, and anonymous function.
It is used for wildcard pattern to match any value, as an ignored variable when value is not needed, and in lambda expressions as a placeholder. [ more ]
Medium
1 month ago
Scala

Understanding the Pattern Matching in Scala.

Pattern matching in Scala allows for matching data structures like case classes and lists.
Sealed types in Scala are used for exhaustive pattern matching and restricting subclasses. [ more ]
Alvinalexander
1 month ago
Scala

Scala: How do I perform pattern matching on strings and regular expressions in a match expression?

Pattern matching in Scala can be performed on regular expression strings in a match expression.
Regular expressions can be defined as a Regex type and used for pattern matching in Scala. [ more ]
Medium
1 month ago
Scala

Pattern Matching Magic

Pattern matching is a powerful feature in Scala for value comparisons and deconstructing values.
Scala uses match expressions for pattern matching, allowing for checking values against various patterns like constants, constructors, and more. [ more ]
Medium
2 months ago
Scala

Programming in Scala [Chapter 26]-Working with XML

XML is semi-structured data essential for serialization, deserialization, and pattern matching in Scala.
Scala supports XML literals, easy manipulation, loading, and saving using tag and attribute structures. [ more ]
Medium
2 months ago
Scala

Programming in Scala [Chapter 24]-Extractors

Extractors generalize pattern matching beyond case classes
Scala's extractors enable defining new patterns for existing types [ more ]
Alvinalexander
1 month ago
Scala

How to convert a Scala Array/List/Seq (sequence) to string with mkString

Using mkString method of Array class can convert Scala sequence (like Array, List, Seq) to a String.
mkString function can be customized with any separator string to format the output as desired. [ more ]
Alvinalexander
1 month ago
Scala

Scala if then else syntax (and returning a value from an if statement)

Scala 2 and Scala 3 if/then/else syntax differences.
Scala allows if/then statements to return a value, eliminating the need for a ternary operator. [ more ]
Artima
1 month ago
Scala

The Autoproxy Plugin - Part II

Scala REPL under MS Windows faced issues with JLine library.
Proposal for a swing-based REPL in Scala for improved functionality. [ more ]
Medium
1 month ago
Scala

Understanding the Currying function in Scala.

Currying in Scala transforms functions to take single arguments, enabling partial application.
Key benefits of currying include partial application, function composition, and improved type inference. [ more ]
Medium
1 month ago
Scala

Why we bet on Scala at SwissBorg

Scala helped SwissBorg beat the average by leveraging its expressiveness and ecosystem.
Scala's scalability, coupled with partnerships with Scala-specialized companies, supported SwissBorg's growth. [ more ]
towardsdev.com
1 month ago
Scala

Exploring Type Constraints and Encoders in Scala

Context bound in Scala defines type requirements for subtype and implicit instance
Encoders in Apache Spark handle serialization and deserialization for Spark SQL [ more ]
Scala-lang
1 month ago
Scala

Announcing the Scala Ambassadors initiative

The Scala Ambassadors initiative aims to strengthen the community, promote Scala positively, and support active members.
Ambassadors in the initiative are key Scala figures who aim to assist newcomers, improve communication, and support each other's efforts. [ more ]
Alvinalexander
1 month ago
Scala

Scala money and currency: The BigDecimal class and libraries

Scala developers commonly handle currency using the BigDecimal class.
Joda Money is a promising currency library for Scala development. [ more ]
Alvinalexander
1 month ago
Scala

Scala/Mill: Step 5, Specifying a Main Class in the REPL

Start the Mill REPL in the root directory of a Scala project by using the mill command. Choose a specific main method to run interactively within the REPL by specifying the class and package names. [ more ]
Alvinalexander
1 month ago
Scala

A Scala shell script example (and discussion)

To run a Scala script as a Unix/Linux shell script, use a special syntax in the script file.
The 'exec' command in the shell script uses $0 to refer to the script file and $@ to refer to positional parameters. [ more ]
Alvinalexander
1 month ago
Scala

Scala: How to use startsWith tests in match/case expression

You can use the startsWith method on a String to match multiple patterns in a Scala match expression.
The example provided demonstrates how to use startsWith in a Scala match expression to generate different outputs based on the starting patterns of the input. [ more ]
Alvinalexander
1 month ago
Scala

Scala varargs syntax (and examples)

Scala varargs syntax allows defining functions with a variable number of arguments using * symbol after parameter type declaration.
Scala varargs array is created within the function when using the varargs syntax. [ more ]
Alvinalexander
1 month ago
Scala

Scala: What is the Nothing data type?

Nothing is a bottom type in Scala, a subtype of every other type to represent absence of instances.
Common uses of Nothing include signaling abnormal termination, type inference fallback, and representing empty collections. [ more ]
alvinalexander.com
1 month ago
Scala

How to add elements to a List in Scala (List, ListBuffer)

Scala Lists are immutable data structures, elements can't be added directly.
Prepending elements to a Scala List is a common way to add elements. [ more ]
Medium
1 month ago
Scala

Top 10 reasons why adding Scala to your skillset is a smart move now

Multi-Paradigm Approach
Big Data and Beyond
Java Compatibility [ more ]
alvinalexander.com
1 month ago
Scala

Scala: A sum of the squares algorithm using map/sum and foldLeft

Using foldLeft in Scala can offer a more efficient alternative to map/sum approach for certain algorithms.
There are multiple ways to implement a sum of the squares algorithm in Scala, showcasing the flexibility and readability of the language. [ more ]
Alvinalexander
1 month ago
Scala

Scala: How to square a number (Int, Double, Float, Long)

1. Squaring numbers in Scala can be done by multiplying the number by itself or using Math.pow function.
2. When squaring an integer in Scala with Math.pow function, the result will be a Double. [ more ]
alvinalexander.com
1 month ago
Scala

A Scala current date and time example

Getting the current date and time in Scala can be done using java.util.Calendar class or Java's SimpleDateFormat class.
The current minute and hour can be obtained by using Calendar.getInstance() and get() method in Scala. [ more ]
Medium
1 month ago
Scala

Become a Scala Wizzard!

Scala covers key programming concepts like classes, objects, control abstractions, traits, and packages.
Scala emphasizes code reuse through traits and explores data structures like lists and collections. [ more ]
Medium
1 month ago
Scala

# A story of one memory leak

Debugging memory leaks in distributed systems can be challenging due to the complexity of the architecture.
Understanding the components and architecture details is crucial for effectively debugging and fixing issues in a distributed system. [ more ]
Medium
1 month ago
Scala

Destructuring Assignment, Nested deconstruction-Part 2/2

Kotlin uses componentN function to unpack values from an object.
Scala's case classes have helpful methods like apply, unapply for deconstruction. [ more ]
Medium
2 months ago
Scala

Programming in Scala [Chapter 29]-Combining Scala and Java

Mapping Scala features to Java constructs for seamless integration.
Scala and Java compatibility extends to annotations system. [ more ]
Medium
1 month ago
Scala

Master Scala Rest APIs in 3 Simple Concepts: Illustrated Guide with Tapir, http4s, and Circe! (2/2)

Auto Derivation Magic simplifies JSON to Scala conversion by leveraging case class attributes.
Importing required objects like io.circe.generic.AutoDerivation and sttp.tapir.generic.auto.SchemaDerivation enables auto-derivation for JSON encoding and decoding. [ more ]
Medium
2 months ago
Scala

Programming in Scala [Chapter 28]-Object Equality

Scala simplifies object equality by using the == operator for 'natural' equality, akin to the equals method in Java.
Defining the equals method in Scala requires attention to potential pitfalls like wrong signature, inconsistent behavior, and handling mutable fields. [ more ]
Medium
2 months ago
Scala

Simple Hash Map with Scala in 15 minutes

Use chaining to resolve collisions in hash map implementation
Support operations add, remove, and get with immutability for new map creation. [ more ]
Medium
2 months ago
Scala

Registering classpath for Scala ScriptEngine at runtime

ScriptEngine interface executes scripts in a scripting language
Custom classpath can be set in Scala 2.12 using a new Scala ScriptEngine with ScriptEngineFactory. [ more ]
Medium
2 months ago
Scala

Programming in Scala [Chapter 23]-For Expressions Revisited

Higher-order functions like map, flatMap, and filter are powerful in Scala but can complicate code readability.
For expressions in Scala simplify problem-solving by internally utilizing map, flatMap, and filter operations for optimization. [ more ]
Medium
2 months ago
Scala

Circe tips and tricks

Circe is powerful but sometimes misunderstood
Circe provides building blocks for encoding and decoding JSON [ more ]
Medium
2 months ago
Scala

Programming in Scala [Chapter 20]-Abstract Members

Abstract members in Scala allow incomplete definitions for implementation in subclasses.
Types of abstract members in Scala include vals, vars, methods, and types, with features like lazy vals and path-dependent types. [ more ]
Medium
2 months ago
Scala

Programming in Scala [Chapter 21]-Implicit Conversions and Parameters

Implicit conversions and parameters in Scala enhance libraries by allowing types to act as subtypes, simplifying code.
Implicits automate repetitive tasks, focusing on core logic, improving code readability and conciseness. [ more ]
Medium
2 months ago
Scala

The Secrets of Scala Development

Scala blends object-oriented and functional programming, ideal for web apps and big data.
Interoperability with Java, functional programming, and static typing make Scala efficient and reliable. [ more ]
Medium
2 months ago
Scala

What Is Scala? Unveiling The Power Of A Versatile Programming Language

Powerful combination of object-oriented and functional programming in Scala
Scala's rapid popularity due to expressive syntax, compatibility with Java, and strong type system. [ more ]
Medium
2 months ago
Scala

Hadoop and Spark on Ubuntu 22.04 LTS with Canada 2021 Census data

Step-by-step guide for configuring Hadoop and Spark on Ubuntu 22.04 LTS
Demonstrating CSV file loading into HDFS and data manipulation with Spark using Scala [ more ]
Medium
2 months ago
Scala

This week in #Scala (Feb 19, 2024)

Weekly Scala news roundup by Petr Zapletal. [ more ]
Medium
2 months ago
Scala

Modular Programming in Scala with the Cake Pattern

The Cake Pattern in Scala enables modular programming and simplifies dependency management.
The Cake Pattern breaks down applications into interchangeable traits, making code management and updates easier. [ more ]
Medium
2 months ago
Education

Group the strings with occurance count using scala

The code snippet is an example of counting the occurrences of unique elements in a list of objects.
The code uses foldLeft and mutable Map to efficiently count the elements. [ more ]
Medium
2 months ago
Scala

This week in #Scala (Feb 12, 2024)

Scala updates and developments from February 12, 2024. [ more ]
Medium
2 months ago
Scala

Destructuring Assignment- Kotlin vs Scala

Kotlin and Scala both offer destructuring assignment to extract values from data structures.
Java 21 also introduces deconstructing fields of a Java record. [ more ]
Medium
2 months ago
Scala

Building a Secure User Registration Service with Email Verification in Scala and http4s

Ensuring a secure and seamless user registration process is important for online platforms.
This article discusses the use of Scala, http4s, Slick, Redis, and PostgreSQL to create a robust web service for user registrations. [ more ]
Medium
2 months ago
Scala

Programming in Scala as a "Better" Java

Scala is a programming language for the JVM that is both object oriented and functional.
Scala can be used as a simple OOP replacement for Java with benefits of speed and readability. [ more ]
Medium
2 months ago
Scala

This week in #Scala (Feb 5, 2024)

Scala developments
Community contributions [ more ]
Alvinalexander
2 months ago
Scala

A Scala method to run any block of code slowly

A Scala function called 'slowly' can be used to run a block of code with a delay.
The 'slowly' function can be modified to include a sleep time parameter. [ more ]
Scala-lang
3 months ago
Scala

Scala 3: My migration journey

Switching from Scala 2 to Scala 3 can be straightforward with the right technology stack and tools.
There is no one way to do the migration, and it's important to consider the benefits and trade-offs for your specific scenario. [ more ]
Alvinalexander
3 months ago
Scala

Expanding on Adam Warski's flatMap example (Set, case statements, function literal)

flatMap and case statements used to extract entities and addresses from a Set[Entity]
map used to extract street fields from addresses [ more ]
Alvinalexander
3 months ago
Scala

Ammonite REPL: How to create a startup file (predef)

Creating a Scala Ammonite REPL startup file allows you to customize the REPL environment.
The predef.sc file can be edited to include custom commands and imports in the Ammonite REPL. [ more ]
Alvinalexander
3 months ago
Scala

Create nested DIV tags with Jsoup, Scala 3, and Scala-CLI

Use Jsoup to manipulate HTML content in Scala
Create nested DIVs in Scala using Jsoup [ more ]
Medium
3 months ago
Scala

This week in #Scala (Jan 22, 2024)

This Week in Scala is a weekly newsletter that provides updates on the latest news, tutorials, and events in the Scala community.
The newsletter covers a range of topics including new releases, updates on popular libraries, and upcoming conferences and meetups. [ more ]
Medium
3 months ago
Scala

How I used Scala CLI to delete annoying unread emails from my gmail inbox

Install Scala CLI and create a single file Scala script.
The script uses Google APIs to interact with Gmail and delete unread emails. [ more ]
Medium
3 months ago
Scala

This week in #Scala (Jan 15, 2024)

1. This edition of #ThisWeekInScala covers the latest news and updates in the Scala programming language.
2. The article is written by Petr Zapletal and provides a summary of the events that occurred in the Scala community during the week of January 15, 2024. [ more ]
Alvinalexander
3 months ago
Scala

My free Scala and FP training videos

The training videos are 100% free with no ads or paywalls.
More free Scala and functional programming video courses will be added in the future. [ more ]
[ Load more ]