SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
Using VI Java from Scala



Dave “Bric” Briccetti, Contractor at VMware

          Dave Briccetti Software LLC
                davebsoft.com
                 @dcbriccetti
VI Java for Performance Graphs
HelloVM.scala
Quick Intro to Scala
                  (Enough to read the code)

●   val and var
●   List
●   Array
●   map
●   Singleton object
●   match
val and var
●   val creates a final variable
    val x = 1
    x=2
    error: reassignment to val
    var x = 1
    x=2
List
●   val nums = List(2,5,8)
    nums: List[Int] = List(2, 5, 8)
    nums.size
    res9: Int = 3
Array
●   val nums = Array(1,5,7)
    nums: Array[Int] = Array(1, 5, 7)
    nums.toList
    res8: List[Int] = List(1, 5, 7)
map
●   val nums = List(2,5,8)
    nums: List[Int] = List(2, 5, 8)
    nums.map(_ + 1)
    res10: List[Int] = List(3, 6, 9)
Singleton Object
●   Java types:
    ●   class
    ●   interface
●   Scala types:
    ●   class
    ●   trait
    ●   object
●   object is like a preinstantiated object of a class,
    with all members static
match
●   List(2) match {
        case first :: rest => "First: " + first + ", rest: " + rest
        case _ => "no match"
    }
    res17: java.lang.String = First: 2, rest: List()
●   List(2,3) match {
        case first :: rest => "First: " + first + ", rest: " + rest
        case _ => "no match"
    }
    res18: java.lang.String = First: 2, rest: List(3)
Unit Test
HelloVM Part 1
HelloVM Part 2
HelloVM Part 3
Summary
●   The Java Virtual Machine runs many
    languages, including Scala
●   VI Java can be used by any of these languages
●   Scala is a powerful language, which
    interoperates very well with Java libraries like VI
    Java


                Dave Briccetti Software LLC
                      davebsoft.com
                       @dcbriccetti

Mais conteúdo relacionado

Mais procurados

A brief introduction to scalaz-stream
A brief introduction to scalaz-streamA brief introduction to scalaz-stream
A brief introduction to scalaz-stream
Frank Thomas
 
jimmy hacking (at) Microsoft
jimmy hacking (at) Microsoftjimmy hacking (at) Microsoft
jimmy hacking (at) Microsoft
Jimmy Schementi
 

Mais procurados (10)

Java JVM Memory Cheat Sheet
Java JVM Memory Cheat SheetJava JVM Memory Cheat Sheet
Java JVM Memory Cheat Sheet
 
Scala e JRuby
Scala e JRubyScala e JRuby
Scala e JRuby
 
Meetup C++ A brief overview of c++17
Meetup C++  A brief overview of c++17Meetup C++  A brief overview of c++17
Meetup C++ A brief overview of c++17
 
Python Memory Management 101(Europython)
Python Memory Management 101(Europython)Python Memory Management 101(Europython)
Python Memory Management 101(Europython)
 
Robust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksRobust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time Checks
 
Python memory managment. Deeping in Garbage collector
Python memory managment. Deeping in Garbage collectorPython memory managment. Deeping in Garbage collector
Python memory managment. Deeping in Garbage collector
 
A brief introduction to scalaz-stream
A brief introduction to scalaz-streamA brief introduction to scalaz-stream
A brief introduction to scalaz-stream
 
Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJS
 
jimmy hacking (at) Microsoft
jimmy hacking (at) Microsoftjimmy hacking (at) Microsoft
jimmy hacking (at) Microsoft
 
Exp 6.1 d-422-1
Exp 6.1  d-422-1Exp 6.1  d-422-1
Exp 6.1 d-422-1
 

Destaque

გამოსახულებათა გარდაქმნები
გამოსახულებათა გარდაქმნებიგამოსახულებათა გარდაქმნები
გამოსახულებათა გარდაქმნები
Inga Katcharava
 

Destaque (19)

Asemblashi
AsemblashiAsemblashi
Asemblashi
 
Italy
ItalyItaly
Italy
 
Asemblashi
AsemblashiAsemblashi
Asemblashi
 
გამოსახულებათა გარდაქმნები
გამოსახულებათა გარდაქმნებიგამოსახულებათა გარდაქმნები
გამოსახულებათა გარდაქმნები
 
Kolxeti11
Kolxeti11 Kolxeti11
Kolxeti11
 
Kolxeti
Kolxeti Kolxeti
Kolxeti
 
კოლხეთი
კოლხეთიკოლხეთი
კოლხეთი
 
Presentation1
Presentation1Presentation1
Presentation1
 
Presentation1
Presentation1Presentation1
Presentation1
 
Asemblashi
AsemblashiAsemblashi
Asemblashi
 
Prezentacia raionuli
Prezentacia raionuliPrezentacia raionuli
Prezentacia raionuli
 
Olqis semadgenloba
Olqis semadgenlobaOlqis semadgenloba
Olqis semadgenloba
 
BirdShow: A Lift App for Showing Flickr Photos
BirdShow: A Lift App for Showing Flickr PhotosBirdShow: A Lift App for Showing Flickr Photos
BirdShow: A Lift App for Showing Flickr Photos
 
Cemi garemo
Cemi garemoCemi garemo
Cemi garemo
 
DBSchools Music Gradebook: Converting to Scala, Lift & Squeryl
DBSchools Music Gradebook: Converting to Scala, Lift & SquerylDBSchools Music Gradebook: Converting to Scala, Lift & Squeryl
DBSchools Music Gradebook: Converting to Scala, Lift & Squeryl
 
TalkingPuffin Talk
TalkingPuffin TalkTalkingPuffin Talk
TalkingPuffin Talk
 
Filtering Twitter Noise
Filtering Twitter NoiseFiltering Twitter Noise
Filtering Twitter Noise
 
Asemblashi
AsemblashiAsemblashi
Asemblashi
 
Asemblashi2
Asemblashi2Asemblashi2
Asemblashi2
 

Semelhante a Using VI Java from Scala

BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java Developers
Miles Sabin
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
Tomasz Wrobel
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011
Agora Group
 
Miles Sabin Introduction To Scala For Java Developers
Miles Sabin Introduction To Scala For Java DevelopersMiles Sabin Introduction To Scala For Java Developers
Miles Sabin Introduction To Scala For Java Developers
Skills Matter
 
4java Basic Syntax
4java Basic Syntax4java Basic Syntax
4java Basic Syntax
Adil Jafri
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
Miles Sabin
 

Semelhante a Using VI Java from Scala (20)

BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java Developers
 
An Introduction to Scala for Java Developers
An Introduction to Scala for Java DevelopersAn Introduction to Scala for Java Developers
An Introduction to Scala for Java Developers
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
 
Arrays
ArraysArrays
Arrays
 
Scala Intro
Scala IntroScala Intro
Scala Intro
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011
 
A Brief Introduction to Scala for Java Developers
A Brief Introduction to Scala for Java DevelopersA Brief Introduction to Scala for Java Developers
A Brief Introduction to Scala for Java Developers
 
Miles Sabin Introduction To Scala For Java Developers
Miles Sabin Introduction To Scala For Java DevelopersMiles Sabin Introduction To Scala For Java Developers
Miles Sabin Introduction To Scala For Java Developers
 
Scala
ScalaScala
Scala
 
RESTful API using scalaz (3)
RESTful API using scalaz (3)RESTful API using scalaz (3)
RESTful API using scalaz (3)
 
An Intoduction to R
An Intoduction to RAn Intoduction to R
An Intoduction to R
 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course Outline
 
JavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft TrainingJavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft Training
 
4java Basic Syntax
4java Basic Syntax4java Basic Syntax
4java Basic Syntax
 
Scala collections api expressivity and brevity upgrade from java
Scala collections api  expressivity and brevity upgrade from javaScala collections api  expressivity and brevity upgrade from java
Scala collections api expressivity and brevity upgrade from java
 
Scala ntnu
Scala ntnuScala ntnu
Scala ntnu
 
CH1 ARRAY (1).pptx
CH1 ARRAY (1).pptxCH1 ARRAY (1).pptx
CH1 ARRAY (1).pptx
 
Softshake 2013: 10 reasons why java developers are jealous of Scala developers
Softshake 2013: 10 reasons why java developers are jealous of Scala developersSoftshake 2013: 10 reasons why java developers are jealous of Scala developers
Softshake 2013: 10 reasons why java developers are jealous of Scala developers
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup Edinburgh
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Using VI Java from Scala

  • 1. Using VI Java from Scala Dave “Bric” Briccetti, Contractor at VMware Dave Briccetti Software LLC davebsoft.com @dcbriccetti
  • 2. VI Java for Performance Graphs
  • 4. Quick Intro to Scala (Enough to read the code) ● val and var ● List ● Array ● map ● Singleton object ● match
  • 5. val and var ● val creates a final variable val x = 1 x=2 error: reassignment to val var x = 1 x=2
  • 6. List ● val nums = List(2,5,8) nums: List[Int] = List(2, 5, 8) nums.size res9: Int = 3
  • 7. Array ● val nums = Array(1,5,7) nums: Array[Int] = Array(1, 5, 7) nums.toList res8: List[Int] = List(1, 5, 7)
  • 8. map ● val nums = List(2,5,8) nums: List[Int] = List(2, 5, 8) nums.map(_ + 1) res10: List[Int] = List(3, 6, 9)
  • 9. Singleton Object ● Java types: ● class ● interface ● Scala types: ● class ● trait ● object ● object is like a preinstantiated object of a class, with all members static
  • 10. match ● List(2) match { case first :: rest => "First: " + first + ", rest: " + rest case _ => "no match" } res17: java.lang.String = First: 2, rest: List() ● List(2,3) match { case first :: rest => "First: " + first + ", rest: " + rest case _ => "no match" } res18: java.lang.String = First: 2, rest: List(3)
  • 15. Summary ● The Java Virtual Machine runs many languages, including Scala ● VI Java can be used by any of these languages ● Scala is a powerful language, which interoperates very well with Java libraries like VI Java Dave Briccetti Software LLC davebsoft.com @dcbriccetti