SlideShare a Scribd company logo
1 of 15
Download to read 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

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked

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

Viewers also liked (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
 

Similar to 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
 

Similar to 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
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

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