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

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 

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