The document provides an overview of key differences between Python and Scala. Some key points summarized:
1. Python is a dynamically typed, interpreted language while Scala is statically typed and compiles to bytecode. Scala supports both object-oriented and functional programming paradigms.
2. Scala has features like case classes, traits, and pattern matching that Python lacks. Scala also has features like type parameters, implicit conversions, and tail call optimization that Python does not support natively.
3. Common data structures like lists and maps are implemented differently between the languages - Scala uses immutable Lists while Python uses mutable lists. Scala also has features like lazy vals.
4. Control
This describes writing command-line processing for Perl scripts. Don't re-invent the wheel - this problem has been solved. Use Getopt::Long or a similar module from CPAN.
This was presented as one of several "lightning talk" mini-presenations at the Silicon Valley Perl (SVPerl) meeting on Thursday, November 12, 2015 where the primary meeting topic was CPAN, the Comprehensive Perl Archive Network with the tag line "Your project is already half done".
Command line arguments that make you smileMartin Melin
Slides from my talk at the Stockholm Python User Group's meetup on Best Practices on October 31st, 2013: http://www.meetup.com/pysthlm/events/145658462/
Hands-on Java 8 with examples and open discussion about the more relevant new feature of Java 8: lambdas, streams, CompletableFeature, new Date & Time API.
This describes writing command-line processing for Perl scripts. Don't re-invent the wheel - this problem has been solved. Use Getopt::Long or a similar module from CPAN.
This was presented as one of several "lightning talk" mini-presenations at the Silicon Valley Perl (SVPerl) meeting on Thursday, November 12, 2015 where the primary meeting topic was CPAN, the Comprehensive Perl Archive Network with the tag line "Your project is already half done".
Command line arguments that make you smileMartin Melin
Slides from my talk at the Stockholm Python User Group's meetup on Best Practices on October 31st, 2013: http://www.meetup.com/pysthlm/events/145658462/
Hands-on Java 8 with examples and open discussion about the more relevant new feature of Java 8: lambdas, streams, CompletableFeature, new Date & Time API.
How to Think in RxJava Before ReactingIndicThreads
Presented at the IndicThreads.com Software Development Conference 2016 held in Pune, India. More at http://www.IndicThreads.com and http://Pune16.IndicThreads.com
--
Introduction to Kotlin Language and its application to Android platformEastBanc Tachnologies
Author: Oleg Godovykh, eastbanctech.com
Kotlin is a new programming language built by Jetbrains and is a new member of JVM family. As opposed to typical reason to introduce some new language, Kotlin main goal isn't to create new paradigm or fill a new niche, but to make routine tasks much easier and safer. Kotlin gains popularity across Android developer community, and in this presentation it is shown how Kotlin usage can dramatically simplify typical mobile app development.
Reactive Programming in the Browser feat. Scala.js and PureScriptLuka Jacobowitz
Creating User Interfaces has traditionally been a mostly imperative matter and building UIs in a functional way has never really been easy. In this talk we’ll learn how to build UIs using only pure functions with the help of Reactive Programming and Scala.js or PureScript. We will take a look at the strengths and weaknesses of each languages, explore OutWatch, a new UI Library based on Rx, look at what works well, identify more challenging tasks and unlock the full potential of functional design and type safety with functional programming in the browser.
Halogen is a popular choice for building front-end user-interfaces with PureScript. Often described as a purely functional version of React, Halogen allows building user-interfaces by composing declarative, self-contained components, including effectful components those built from third-party Javascript libraries.
In this presentation, John presents a high-level summary of where Halogen has come from, how it works right now, and what are the main drawbacks to both FRP and React. John then suggests that incremental computation should be the foundation for the next major version of Halogen, and sketches out a possible way of achieving that in a declarative fashion.
What's the best way to model modular, composable effects in your purely functional program? In this presentation, I take a look at monad transformers and free monads, discuss their history, and compare how effectively they solve the problem.
How to Think in RxJava Before ReactingIndicThreads
Presented at the IndicThreads.com Software Development Conference 2016 held in Pune, India. More at http://www.IndicThreads.com and http://Pune16.IndicThreads.com
--
Introduction to Kotlin Language and its application to Android platformEastBanc Tachnologies
Author: Oleg Godovykh, eastbanctech.com
Kotlin is a new programming language built by Jetbrains and is a new member of JVM family. As opposed to typical reason to introduce some new language, Kotlin main goal isn't to create new paradigm or fill a new niche, but to make routine tasks much easier and safer. Kotlin gains popularity across Android developer community, and in this presentation it is shown how Kotlin usage can dramatically simplify typical mobile app development.
Reactive Programming in the Browser feat. Scala.js and PureScriptLuka Jacobowitz
Creating User Interfaces has traditionally been a mostly imperative matter and building UIs in a functional way has never really been easy. In this talk we’ll learn how to build UIs using only pure functions with the help of Reactive Programming and Scala.js or PureScript. We will take a look at the strengths and weaknesses of each languages, explore OutWatch, a new UI Library based on Rx, look at what works well, identify more challenging tasks and unlock the full potential of functional design and type safety with functional programming in the browser.
Halogen is a popular choice for building front-end user-interfaces with PureScript. Often described as a purely functional version of React, Halogen allows building user-interfaces by composing declarative, self-contained components, including effectful components those built from third-party Javascript libraries.
In this presentation, John presents a high-level summary of where Halogen has come from, how it works right now, and what are the main drawbacks to both FRP and React. John then suggests that incremental computation should be the foundation for the next major version of Halogen, and sketches out a possible way of achieving that in a declarative fashion.
What's the best way to model modular, composable effects in your purely functional program? In this presentation, I take a look at monad transformers and free monads, discuss their history, and compare how effectively they solve the problem.
El pasado 17 de mayo se celebró en las oficinas de Paradigma Digital el meetup mensual del grupo Python Madrid. Pablo González Fuente, de GMV, nos habló de Python y Flink.
Vídeo del evento: https://www.youtube.com/watch?v=HPfNDL-jIGM
Jump Start into Apache Spark (Seattle Spark Meetup)Denny Lee
Denny Lee, Technology Evangelist with Databricks, will demonstrate how easily many Data Sciences and Big Data (and many not-so-Big Data) scenarios easily using Apache Spark. This introductory level jump start will focus on user scenarios; it will be demo heavy and slide light!
Performance Optimization Case Study: Shattering Hadoop's Sort Record with Spa...Databricks
Performance Optimization Case Study: Shattering Hadoop's Sort Record with Spark and Scala
Talk given by Reynold Xin at Scala Days SF 2015
In this talk, Reynold talks about the underlying techniques used to achieve high performance sorting using Spark and Scala, among which are sun.misc.Unsafe, exploiting cache locality, high-level resource pipelining.
Scala: Pattern matching, Concepts and ImplementationsMICHRAFY MUSTAFA
In the following slides, we attempt to present the pattern matching and its implementation in Scala.
The concepts introduced are: Basic pattern matching, Pattern alternative, Pattern guards, Pattern matching and recursive function, Typed patterns, Tuple patterns, Matching on option, Matching on immutable collection, Matching on List, Matching on case class, Nested pattern matching in case classes, and
Matching on regular expression.
Scala eXchange: Building robust data pipelines in ScalaAlexander Dean
Over the past couple of years, Scala has become a go-to language for building data processing applications, as evidenced by the emerging ecosystem of frameworks and tools including LinkedIn's Kafka, Twitter's Scalding and our own Snowplow project (https://github.com/snowplow/snowplow).
In this talk, Alex will draw on his experiences at Snowplow to explore how to build rock-sold data pipelines in Scala, highlighting a range of techniques including:
* Translating the Unix stdin/out/err pattern to stream processing
* "Railway oriented" programming using the Scalaz Validation
* Validating data structures with JSON Schema
* Visualizing event stream processing errors in ElasticSearch
Alex's talk draws on his experiences working with event streams in Scala over the last two and a half years at Snowplow, and by Alex's recent work penning Unified Log Processing, a Manning book.
Principles of functional progrmming in scalaehsoon
a short outline on necessity of functional programming and principles of functional programming in Scala.
In the article some keyword are used but not explained (to keep the article short and simple), the interested reader can look them up in internet.
Python is a high level language focused on readability. The Python community developed the concept of "Pythonic Code", requiring not only semantic correctness, but also conformity to universally acknowledged stylistic criteria.
A pre-requisite to write pythonic code is to write idiomatic code. Using the right idioms is a matter of acquired taste and experience, however, some idioms are quite easy to learn.
This presentation focuses on some of these idioms and other stylistic criteria:
* for vs. while
* iterators, itertools
* code conventions (space invaders)
* avoid default values bugs
* first order functions
* internal/external iterators
* substituting the switch statement
* properties, attributes, read only objects
* named tuples
* duck typings
* bits of metaprogramming
* exception management: LBYL vs. EAFP
Scala er et Java-relateret, statisk typet programmeringssprog i hastig fremmarch. Sproget kombinerer aspekter fra objekt- og funktionsorienterede sprog og fokuserer på skalerbarhed og effektivitet, både på det kodemæssige og afviklingsmæssige niveau. Syntaksen er elegant og koncis. Samtidig indeholder sproget stærke konstruktioner til understøttelse af parallelle applikationer, der udnytter fremtidens hardwarearkitekturer.
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
Traditional software testing methods are being challenged in retail, where customer expectations and technological advancements continually shape the landscape. Enter generative AI—a transformative subset of artificial intelligence technologies poised to revolutionize software testing.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Advanced Flow Concepts Every Developer Should KnowPeter Caitens
Tim Combridge from Sensible Giraffe and Salesforce Ben presents some important tips that all developers should know when dealing with Flows in Salesforce.
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
Strategies for Successful Data Migration Tools.pptxvarshanayak241
Data migration is a complex but essential task for organizations aiming to modernize their IT infrastructure and leverage new technologies. By understanding common challenges and implementing these strategies, businesses can achieve a successful migration with minimal disruption. Data Migration Tool like Ask On Data play a pivotal role in this journey, offering features that streamline the process, ensure data integrity, and maintain security. With the right approach and tools, organizations can turn the challenge of data migration into an opportunity for growth and innovation.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
5. Scala
● Functional programming
● Static type
● Object-oriented
● Type inference
● Lazy (non-strict) evaluation
● Compiled languages
● Support shell
6. python vs scala
● statement,
expression.
● a + b => a.__add__
(b)
● f(a,b) => f.__call__
(a,b)
● everything
"evaluates" to a
value.
● a + b => a.+(2)
● f(a,b) => f.apply(a,
b)
7. variable - python vs scala
a = 1 ● The return value of
expression is `()`.
var a = 1
var a: Int = 1
8. const - python vs scala
● python doesn’t
support const.
● The return value of
expression is `()`.
val a = 1
val a: Int = 1
9. lazy
● Not support in native python. (Maybe some
library support it.
● Initialization is deferred until it is accessed
for the first time
● Check whether the value has already been
initialized before a lazy value is accessed.
10. lazy
● lazy var words = scala.io.Source.fromFile
("/usr/share/dict/words").mkString
● lazy val fibs: Stream[BigInt] = BigInt(0) #::
BigInt(1) #:: fibs.zip(fibs.tail).map { n => n.
_1 + n._2 }
11. if-else
● statement
if a > 5:
print(a)
else:
print()
● expression
val x = if(a>5) {1} else 2
val y = if(1!=1) 1 //y == ()
12. while
while a > 5:
print(a)
a -= 1
● The return value of
expression is `()`.
while ( a > 5) {
print(a)
a -= 1
}
13. def loop(x: Int, xs: List[Int]): Int = {
var max_value = x
var rest = xs
while (rest != Nil) {
if (max_value < rest.head) max_value = rest.
head
rest = rest.tail
}
max_value
14. tail recursion
def loop(lst: List[Int], maxValue: Int): Int =
lst match {
case Nil => maxValue
case x :: xs => if (x > maxValue) loop(xs,
x) else loop(xs, maxValue)
}
16. tail recursion
● a tail call might lead to the same
subroutine being called again later in the
call chain.
● a tail recursive function is transformed into
a loop by the compiler.
● use `@tailrec`
17. do while
● Not support do {
println(a)
a -= 1
while( a > 5)
21. function
● You can define
many function with
the same name. But
only the function
which is executed in
last time will be
called.
● Support overloading
27. def mywhile(condition: => Boolean, body: => Unit): Int = {
def loop(count: Int): Int = {
if (condition) {
body; loop(count + 1)
} else count
}
loop(0)
}
28. var a = 1
print(mywhile({ a < 5 }, { a += 1 }))
29. function return
● use `return` if you
want to return
something.
● if there are no
return in function
body, it will return
`None`.
● avoid to use
`return` keyword.
● if there are no
return in function
body, it will return
the value of the
last expression
31. match-case
x.asInstanceOf[Any] match {
case x :: xs => println(x)
case (a, b, c) => println(a)
case p @ Some(v) if v == 2 => println(p)
case x: Int if x != 2 => println(x)
case _ => println(“None”)
}
32. class
1. multi inheritance
2. public
3. Not support
overloading
1. single inheritance
2. public, protect,
private
3. Support overloading
33. class constructor
class My(object):
def __init__(self, x):
self.x = x
self.odd = x%2 ==0
def print_x(self):
print(self.x)
class My(var x: Int) {
var odd = x % 2 ==0
def print_x() {
println(x)
}
}
34. scala auxiliary constructor
class Length(val length: Int) {
def this(str: String) { this(str.length) }
def this(list: List[Any]) { this(list.length) }
}
new Length(5)
new Length(“Hi”)
new Length(List(1,2))
35. duck typing
class Length1(val length: Int) {
def this(o: {def length:Int}) {
this(o.length)
}
}
● All thing is
duck typing
in python.
● scala support duck typing.
38. companion object
class Main {
def sayHelloWorld() {
println("Hello
World");
}
}
object Main {
def sayHi() {
println("Hi!");
}
method,used for
instance
static method,
used for class
39. How to create instance?
class A(object):pass
a = A()
class A {}
val a = new A
class B{}
object B{def apply() = new B}
val bB = B()
Python
Scala
40. Type checking and cast
1. isinstance(a, str)
2. issubclass(A,
object)
3. a.__class__
1. "S".isInstanceOf[String]
2.
3.
4. "S".asInstanceOf
[String]
41. Type checking and cast
if isinstance(a, int):
print(“int”)
elif isinstance(a, str):
print(“str”)
a mtach {
case _: Int =>
println(“int”)
case _: String =>
println(“Str”)
}
42. class inheritance
● Method Resolution
Order
● class X(A, B):pass
● X.__mro__
● single inheritance
● need `override` when
overriding
● class X extends Any
43. scala trait
● trait is like java interface but allows
concrete implementations.
● class A extends B with C with D
○ extends + class|trait
○ with + trait
44. case class
● python doesn’t support case class.
● case class generate the following method:
○ equals
○ apply for companion object .
○ unapply for companion object.
45. Why we need case class?
def Person(object):
def __init__(self, name, age):
self.name = name
self.age = age
person = Person(“bill”, 5)
46. Why we need case class?
case class Person(var name:String, var age:Int)
val person = Person(“Bill”, 5)
47. More case calss
person match {
case Person(name, age) if name == "X" =>
s"$name,$age"
case _ => "Nothing"
}
60. List in python vs ArrayBuffer in scala
1. List(1, 2, 3, 4)
2. [1, 2, 3, 4]
3. a[3]
4. a[-1]
5. a[1:-1]
6. a[1:-1:-1]
7. a[1] = 1
1. ArrayBuffer(1,2,3,4)
2. new ArrayBuffer[Int]()
3. a(3)
4.
5. a.slice(1, a.length-1)
6.
7. a(1) = 1
61. List in python vs ArrayBuffer in scala
1. map(a, lambda x:
x+1)
2. b = [i + 1 for i in a if
i % 2 ==0]
1. a.map(_ + 1)
2. val b = for(i <- a if i
% 2 ==0) yield i + 1
69. def combined: Future[Int] = async {
val future1 = slowCalcFuture
val future2 = slowCalcFuture
await(future1) + await(future2)
}
70. val future1 = slowCalcFuture
val future2 = slowCalcFuture
def combined: Future[Int] = for {
r1 <- future1
r2 <- future2
} yield r1 + r2
71. django vs play framework2
● python web
framework
● MVT
● support ORM
● scala/java web
framework
● MVC
● support type
checking in views.
72. django class-based views vs play
controller
def index = Logging {
Action {
Ok("Hello World")
}
}
class MyView(TemplateView):
template_name = "about.html"
Play
Django