SlideShare a Scribd company logo
1 of 57
Download to read offline
Groovy


2009.12.12 DevLOVE 2009 Fusion
   takuma.watabiki@jggug.org
JGGUG            Grails/Groovy


twitter id : bikisuke
Groovy
10
Groovy
Groovy
Groovy
• JVM
Groovy
• JVM
•
Groovy
• JVM
•
•
Groovy
• JVM
•
•
• Java
Groovy
• JVM
•
•
• Java
• Ruby   Python, Smalltalk
Java
Java




       C)
Java        Groovy




       C)
Groovy     Java
         Java
Groovy     Java
         Java
ERROR


 Java
Groovy
import java.io.*;
import java.util.regex.*;
public class ErrorExtractor {
	

  public static void main(String[] args) {
	

  	

  BufferedReader br = null;
	

  	

  BufferedWriter bw = null;
	

  	

  try {
	

  	

  	

   br = new BufferedReader(new InputStreamReader(
	

  	

  	

   	

   	

  new FileInputStream(new File("/work/server.log"))));
	

  	

  	

   bw = new BufferedWriter(new OutputStreamWriter(
	

  	

  	

   	

   	

  new FileOutputStream("/work/errorlist.log")));
	

  	

  	

   String line = null;
	

  	

  	

   Pattern p = Pattern.compile(".*ERROR.*");
	

  	

  	

   while((line = br.readLine()) != null) {
	

  	

  	

   	

   Matcher m = p.matcher(line);
	

  	

  	

   	

   if(m.matches())
	

  	

  	

   	

   	

  bw.write(line + "¥n");
	

  	

  	

   }
	

  	

  } catch (Exception e) {
	

  	

  } finally {
	

  	

  	

   try {
	

  	

  	

   	

   br.close();
	

  	

  	

   	

   bw.close();
	

  	

  	

   } catch(Exception e) {}                                       Java
	

  	

  }
	

  }
}
import java.io.*;
import java.util.regex.*;
public class ErrorExtractor {
	

  public static void main(String[] args) {
	

  	

  BufferedReader br = null;
	

  	

  BufferedWriter bw = null;
	

  	

  try {
	

  	

  	

   br = new BufferedReader(new InputStreamReader(
	

  	

  	

   	

   	

  new FileInputStream(new File("/work/server.log"))));
	

  	

  	

   bw = new BufferedWriter(new OutputStreamWriter(
	

  	

  	

   	

   	

  new FileOutputStream("/work/errorlist.log")));
	

  	

  	

   String line = null;
	

  	

  	

   Pattern p = Pattern.compile(".*ERROR.*");
	

  	

  	

   while((line = br.readLine()) != null) {
	

  	

  	

   	

   Matcher m = p.matcher(line);
	

  	

  	

   	

   if(m.matches())
	

  	

  	

   	

   	

  bw.write(line + "¥n");
	

  	

  	

   }
	

  	

  } catch (Exception e) {
	

  	

  } finally {
	

  	

  	

   try {
	

  	

  	

   	

   br.close();
	

  	

  	

   	

   bw.close();                                                 .groovy
	

  	

  	

   } catch(Exception e) {}
	

  	

  }
	

  }
}
import java.util.regex.*;

BufferedReader br = null;
BufferedWriter bw = null;
try {
	

   br = new BufferedReader(new InputStreamReader(
	

   	

   	

  new FileInputStream(new File("/work/server.log"))));
	

   bw = new BufferedWriter(new OutputStreamWriter(
	

   	

   	

  new FileOutputStream("/work/errorlist.log")));
	

   String line = null;
	

   Pattern p = Pattern.compile(".*ERROR.*");
	

   while((line = br.readLine()) != null) {
	

   	

   Matcher m = p.matcher(line);
	

   	

   if(m.matches())
	

   	

   	

  bw.write(line + "¥n");
	

   }
} catch (Exception e) {
} finally {
	

   try {
	

   	

   br.close();
	

   	

   bw.close();
                                                                        main
	

   } catch(Exception e) {}
}
import java.util.regex.*;

BufferedReader br = new BufferedReader(new InputStreamReader(
	

  	

   new FileInputStream(new File("/work/server.log"))));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
	

  	

   new FileOutputStream("/work/errorlist.log")));
String line = null;
Pattern p = Pattern.compile(".*ERROR.*");
while((line = br.readLine()) != null) {
	

  Matcher m = p.matcher(line);
	

  if(m.matches())
	

  	

   bw.write(line + "¥n");
}
br.close();
bw.close();



                                                                  try-catch
File f = new File("/work/errorlist.log")
new File("/work/server.log").eachLine { line ->
   if(line =~ ".*ERROR.*") {
       f.append(line + "¥n")
   }
}




                                                  Groovy
import java.io.*;
import java.util.regex.*;
public class ErrorExtractor {
	

  public static void main(String[] args) {
	

  	

  BufferedReader br = null;
	

  	

  BufferedWriter bw = null;
	

  	

  try {
	

  	

  	

   br = new BufferedReader(new InputStreamReader(
	

  	

  	

   	

   	

  new FileInputStream(new File("/work/server.log"))));
	

  	

  	

   bw = new BufferedWriter(new OutputStreamWriter(
	

  	

  	

   	

   	

  new FileOutputStream("/work/errorlist.log")));
	

  	

  	

   String line = null;
	

  	

  	

   Pattern p = Pattern.compile(".*ERROR.*");
	

  	

  	

   while((line = br.readLine()) != null) {
	

  	

  	

   	

   Matcher m = p.matcher(line);
	

  	

  	

   	

   if(m.matches())
	

  	

  	

   	

   	

  bw.write(line + "¥n");
	

  	

  	

   }
	

  	

  } catch (Exception e) {
	

  	

  } finally {
	

  	

  	

   try {
	

  	

  	

   	

   br.close();
	

  	

  	

   	

   bw.close();
	

  	

  	

   } catch(Exception e) {}
	

  	

  }
	

  }
}
File f = new File("/work/errorlist.log")
new File("/work/server.log").eachLine { line ->
   if(line =~ ".*ERROR.*") {
       f.append(line + "¥n")
   }
}
•
• Expando Meta Class
• Grape
• Mixin
• AST
•                ...
Groovy
Groovy
Groovy
Groovy
Hudson
  kkawa



Groovy    ※
Hudson
  kkawa



Groovy                   ※




          ※2008   SDC SQUARE
Groovy Q&A
Q.
A. Hudson




CLI        groovy
groovysh
Q.   Scala
A.
     Groovy
Q.
A.
 Groovy
          !




     Groovy   @torazuka
Q. Groovy
A.


                     Groovy




              JOJO
     Groovy
A.


                     Groovy




              JOJO
     Groovy
Q. Groovy
A.
Groovy
Groovy




         JGGUG
Groovy




         JGGUG
Groovy   JVM
Java
Groovyノススメ
Groovyノススメ

More Related Content

What's hot

Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Sumant Tambe
 
Facilite a vida com guava
Facilite a vida com guavaFacilite a vida com guava
Facilite a vida com guavaRomualdo Andre
 
JavaScript for Web Analysts
JavaScript for Web AnalystsJavaScript for Web Analysts
JavaScript for Web AnalystsLukáš Čech
 
Let's talks about string operations in C++17
Let's talks about string operations in C++17Let's talks about string operations in C++17
Let's talks about string operations in C++17Bartlomiej Filipek
 
Javascript3
Javascript3Javascript3
Javascript3mozks
 
C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012 C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012 Sumant Tambe
 
Functional programming in javascript
Functional programming in javascriptFunctional programming in javascript
Functional programming in javascriptBoris Burdiliak
 
Quicli - From zero to a full CLI application in a few lines of Rust
Quicli - From zero to a full CLI application in a few lines of RustQuicli - From zero to a full CLI application in a few lines of Rust
Quicli - From zero to a full CLI application in a few lines of RustDamien Castelltort
 
งานPop pornapa
งานPop pornapaงานPop pornapa
งานPop pornapaPw Mlp
 
GoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual MachinesGoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual MachinesEleanor McHugh
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftFlorent Pillet
 
Easily mockingdependenciesinc++ 2
Easily mockingdependenciesinc++ 2Easily mockingdependenciesinc++ 2
Easily mockingdependenciesinc++ 2drewz lin
 
第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディング第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディングnobu_k
 
Thinking in Sequences - Streams in Node.js & IO.js
Thinking in Sequences - Streams in Node.js & IO.jsThinking in Sequences - Streams in Node.js & IO.js
Thinking in Sequences - Streams in Node.js & IO.jsArtur Skowroński
 
Ruby on Rails Intro
Ruby on Rails IntroRuby on Rails Intro
Ruby on Rails Introzhang tao
 
2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - englishJen Yee Hong
 

What's hot (19)

Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)
 
Facilite a vida com guava
Facilite a vida com guavaFacilite a vida com guava
Facilite a vida com guava
 
JavaScript for Web Analysts
JavaScript for Web AnalystsJavaScript for Web Analysts
JavaScript for Web Analysts
 
Java 7
Java 7Java 7
Java 7
 
Let's talks about string operations in C++17
Let's talks about string operations in C++17Let's talks about string operations in C++17
Let's talks about string operations in C++17
 
Javascript3
Javascript3Javascript3
Javascript3
 
C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012 C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012
 
Functional programming in javascript
Functional programming in javascriptFunctional programming in javascript
Functional programming in javascript
 
Quicli - From zero to a full CLI application in a few lines of Rust
Quicli - From zero to a full CLI application in a few lines of RustQuicli - From zero to a full CLI application in a few lines of Rust
Quicli - From zero to a full CLI application in a few lines of Rust
 
งานPop pornapa
งานPop pornapaงานPop pornapa
งานPop pornapa
 
GoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual MachinesGoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual Machines
 
Vocabulary Types in C++17
Vocabulary Types in C++17Vocabulary Types in C++17
Vocabulary Types in C++17
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwift
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
Easily mockingdependenciesinc++ 2
Easily mockingdependenciesinc++ 2Easily mockingdependenciesinc++ 2
Easily mockingdependenciesinc++ 2
 
第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディング第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディング
 
Thinking in Sequences - Streams in Node.js & IO.js
Thinking in Sequences - Streams in Node.js & IO.jsThinking in Sequences - Streams in Node.js & IO.js
Thinking in Sequences - Streams in Node.js & IO.js
 
Ruby on Rails Intro
Ruby on Rails IntroRuby on Rails Intro
Ruby on Rails Intro
 
2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english
 

Similar to Groovyノススメ

Groovy for java developers
Groovy for java developersGroovy for java developers
Groovy for java developersPuneet Behl
 
Understanding java streams
Understanding java streamsUnderstanding java streams
Understanding java streamsShahjahan Samoon
 
5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системе5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системеDEVTYPE
 
How to write rust instead of c and get away with it
How to write rust instead of c and get away with itHow to write rust instead of c and get away with it
How to write rust instead of c and get away with itFlavien Raynaud
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Wsloffenauer
 
Groovy 1.8の新機能について
Groovy 1.8の新機能についてGroovy 1.8の新機能について
Groovy 1.8の新機能についてUehara Junji
 
JavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovyJavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovyYasuharu Nakano
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5arajivmordani
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Tsuyoshi Yamamoto
 
Productive Programming in Groovy
Productive Programming in GroovyProductive Programming in Groovy
Productive Programming in GroovyGanesh Samarthyam
 
ekb.py - Python VS ...
ekb.py - Python VS ...ekb.py - Python VS ...
ekb.py - Python VS ...it-people
 
모던자바의 역습
모던자바의 역습모던자바의 역습
모던자바의 역습DoHyun Jung
 
Tips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET ApplicationTips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET ApplicationJoni
 
Java 7 at SoftShake 2011
Java 7 at SoftShake 2011Java 7 at SoftShake 2011
Java 7 at SoftShake 2011julien.ponge
 

Similar to Groovyノススメ (20)

Groovy for java developers
Groovy for java developersGroovy for java developers
Groovy for java developers
 
Understanding java streams
Understanding java streamsUnderstanding java streams
Understanding java streams
 
5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системе5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системе
 
How to write rust instead of c and get away with it
How to write rust instead of c and get away with itHow to write rust instead of c and get away with it
How to write rust instead of c and get away with it
 
サイ本 文
サイ本 文サイ本 文
サイ本 文
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
 
Java 7 & 8 New Features
Java 7 & 8 New FeaturesJava 7 & 8 New Features
Java 7 & 8 New Features
 
Java 7 LavaJUG
Java 7 LavaJUGJava 7 LavaJUG
Java 7 LavaJUG
 
Groovy 1.8の新機能について
Groovy 1.8の新機能についてGroovy 1.8の新機能について
Groovy 1.8の新機能について
 
Groovy Basics
Groovy BasicsGroovy Basics
Groovy Basics
 
JavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovyJavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovy
 
The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
 
Productive Programming in Groovy
Productive Programming in GroovyProductive Programming in Groovy
Productive Programming in Groovy
 
ekb.py - Python VS ...
ekb.py - Python VS ...ekb.py - Python VS ...
ekb.py - Python VS ...
 
Sbaw091006
Sbaw091006Sbaw091006
Sbaw091006
 
모던자바의 역습
모던자바의 역습모던자바의 역습
모던자바의 역습
 
Tips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET ApplicationTips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET Application
 
Java 7 at SoftShake 2011
Java 7 at SoftShake 2011Java 7 at SoftShake 2011
Java 7 at SoftShake 2011
 

More from Takuma Watabiki

「普通の設計」をするということ
「普通の設計」をするということ「普通の設計」をするということ
「普通の設計」をするということTakuma Watabiki
 
バックエンドのエンジニアがiOSアプリ開発をやってみて思うこと - フロントエンドのアーキテクチャの考察 -
バックエンドのエンジニアがiOSアプリ開発をやってみて思うこと - フロントエンドのアーキテクチャの考察 -バックエンドのエンジニアがiOSアプリ開発をやってみて思うこと - フロントエンドのアーキテクチャの考察 -
バックエンドのエンジニアがiOSアプリ開発をやってみて思うこと - フロントエンドのアーキテクチャの考察 -Takuma Watabiki
 
『現場で役立つシステム設計の原則』は一般的なSI現場で役立つのか?
『現場で役立つシステム設計の原則』は一般的なSI現場で役立つのか?『現場で役立つシステム設計の原則』は一般的なSI現場で役立つのか?
『現場で役立つシステム設計の原則』は一般的なSI現場で役立つのか?Takuma Watabiki
 
Grailsでドメイン駆動設計を実践する時の勘所
Grailsでドメイン駆動設計を実践する時の勘所Grailsでドメイン駆動設計を実践する時の勘所
Grailsでドメイン駆動設計を実践する時の勘所Takuma Watabiki
 
Spring in-summer-gradle-hands on-withanswers
Spring in-summer-gradle-hands on-withanswersSpring in-summer-gradle-hands on-withanswers
Spring in-summer-gradle-hands on-withanswersTakuma Watabiki
 
システム開発を前進させるためのGradle導入法
システム開発を前進させるためのGradle導入法システム開発を前進させるためのGradle導入法
システム開発を前進させるためのGradle導入法Takuma Watabiki
 
Gradleどうでしょう
GradleどうでしょうGradleどうでしょう
GradleどうでしょうTakuma Watabiki
 
Jjug 20140430 gradle_basic
Jjug 20140430 gradle_basicJjug 20140430 gradle_basic
Jjug 20140430 gradle_basicTakuma Watabiki
 
スーパー戦隊進化論
スーパー戦隊進化論スーパー戦隊進化論
スーパー戦隊進化論Takuma Watabiki
 
G*におけるソフトウェアテスト・シーズンIII
G*におけるソフトウェアテスト・シーズンIIIG*におけるソフトウェアテスト・シーズンIII
G*におけるソフトウェアテスト・シーズンIIITakuma Watabiki
 

More from Takuma Watabiki (16)

「普通の設計」をするということ
「普通の設計」をするということ「普通の設計」をするということ
「普通の設計」をするということ
 
バックエンドのエンジニアがiOSアプリ開発をやってみて思うこと - フロントエンドのアーキテクチャの考察 -
バックエンドのエンジニアがiOSアプリ開発をやってみて思うこと - フロントエンドのアーキテクチャの考察 -バックエンドのエンジニアがiOSアプリ開発をやってみて思うこと - フロントエンドのアーキテクチャの考察 -
バックエンドのエンジニアがiOSアプリ開発をやってみて思うこと - フロントエンドのアーキテクチャの考察 -
 
『現場で役立つシステム設計の原則』は一般的なSI現場で役立つのか?
『現場で役立つシステム設計の原則』は一般的なSI現場で役立つのか?『現場で役立つシステム設計の原則』は一般的なSI現場で役立つのか?
『現場で役立つシステム設計の原則』は一般的なSI現場で役立つのか?
 
Grailsでドメイン駆動設計を実践する時の勘所
Grailsでドメイン駆動設計を実践する時の勘所Grailsでドメイン駆動設計を実践する時の勘所
Grailsでドメイン駆動設計を実践する時の勘所
 
JGGUG Community LT 2016
JGGUG Community LT 2016JGGUG Community LT 2016
JGGUG Community LT 2016
 
Spring in-summer-gradle-hands on-withanswers
Spring in-summer-gradle-hands on-withanswersSpring in-summer-gradle-hands on-withanswers
Spring in-summer-gradle-hands on-withanswers
 
システム開発を前進させるためのGradle導入法
システム開発を前進させるためのGradle導入法システム開発を前進させるためのGradle導入法
システム開発を前進させるためのGradle導入法
 
Gradleどうでしょう
GradleどうでしょうGradleどうでしょう
Gradleどうでしょう
 
Jjug 20140430 gradle_basic
Jjug 20140430 gradle_basicJjug 20140430 gradle_basic
Jjug 20140430 gradle_basic
 
Spock's world
Spock's worldSpock's world
Spock's world
 
スーパー戦隊進化論
スーパー戦隊進化論スーパー戦隊進化論
スーパー戦隊進化論
 
Gws in fukuoka
Gws in fukuokaGws in fukuoka
Gws in fukuoka
 
Devsumi2012 JGGUG LT
Devsumi2012 JGGUG LTDevsumi2012 JGGUG LT
Devsumi2012 JGGUG LT
 
Spockを使おう!
Spockを使おう!Spockを使おう!
Spockを使おう!
 
G*Magazineを読もう
G*Magazineを読もうG*Magazineを読もう
G*Magazineを読もう
 
G*におけるソフトウェアテスト・シーズンIII
G*におけるソフトウェアテスト・シーズンIIIG*におけるソフトウェアテスト・シーズンIII
G*におけるソフトウェアテスト・シーズンIII
 

Recently uploaded

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Groovyノススメ

  • 1. Groovy 2009.12.12 DevLOVE 2009 Fusion takuma.watabiki@jggug.org
  • 2. JGGUG Grails/Groovy twitter id : bikisuke
  • 10. Groovy • JVM • • • Java • Ruby Python, Smalltalk
  • 11. Java
  • 12.
  • 13. Java C)
  • 14. Java Groovy C)
  • 15. Groovy Java Java
  • 16. Groovy Java Java
  • 17.
  • 19. import java.io.*; import java.util.regex.*; public class ErrorExtractor { public static void main(String[] args) { BufferedReader br = null; BufferedWriter bw = null; try { br = new BufferedReader(new InputStreamReader( new FileInputStream(new File("/work/server.log")))); bw = new BufferedWriter(new OutputStreamWriter( new FileOutputStream("/work/errorlist.log"))); String line = null; Pattern p = Pattern.compile(".*ERROR.*"); while((line = br.readLine()) != null) { Matcher m = p.matcher(line); if(m.matches()) bw.write(line + "¥n"); } } catch (Exception e) { } finally { try { br.close(); bw.close(); } catch(Exception e) {} Java } } }
  • 20. import java.io.*; import java.util.regex.*; public class ErrorExtractor { public static void main(String[] args) { BufferedReader br = null; BufferedWriter bw = null; try { br = new BufferedReader(new InputStreamReader( new FileInputStream(new File("/work/server.log")))); bw = new BufferedWriter(new OutputStreamWriter( new FileOutputStream("/work/errorlist.log"))); String line = null; Pattern p = Pattern.compile(".*ERROR.*"); while((line = br.readLine()) != null) { Matcher m = p.matcher(line); if(m.matches()) bw.write(line + "¥n"); } } catch (Exception e) { } finally { try { br.close(); bw.close(); .groovy } catch(Exception e) {} } } }
  • 21. import java.util.regex.*; BufferedReader br = null; BufferedWriter bw = null; try { br = new BufferedReader(new InputStreamReader( new FileInputStream(new File("/work/server.log")))); bw = new BufferedWriter(new OutputStreamWriter( new FileOutputStream("/work/errorlist.log"))); String line = null; Pattern p = Pattern.compile(".*ERROR.*"); while((line = br.readLine()) != null) { Matcher m = p.matcher(line); if(m.matches()) bw.write(line + "¥n"); } } catch (Exception e) { } finally { try { br.close(); bw.close(); main } catch(Exception e) {} }
  • 22. import java.util.regex.*; BufferedReader br = new BufferedReader(new InputStreamReader( new FileInputStream(new File("/work/server.log")))); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter( new FileOutputStream("/work/errorlist.log"))); String line = null; Pattern p = Pattern.compile(".*ERROR.*"); while((line = br.readLine()) != null) { Matcher m = p.matcher(line); if(m.matches()) bw.write(line + "¥n"); } br.close(); bw.close(); try-catch
  • 23. File f = new File("/work/errorlist.log") new File("/work/server.log").eachLine { line -> if(line =~ ".*ERROR.*") { f.append(line + "¥n") } } Groovy
  • 24.
  • 25. import java.io.*; import java.util.regex.*; public class ErrorExtractor { public static void main(String[] args) { BufferedReader br = null; BufferedWriter bw = null; try { br = new BufferedReader(new InputStreamReader( new FileInputStream(new File("/work/server.log")))); bw = new BufferedWriter(new OutputStreamWriter( new FileOutputStream("/work/errorlist.log"))); String line = null; Pattern p = Pattern.compile(".*ERROR.*"); while((line = br.readLine()) != null) { Matcher m = p.matcher(line); if(m.matches()) bw.write(line + "¥n"); } } catch (Exception e) { } finally { try { br.close(); bw.close(); } catch(Exception e) {} } } }
  • 26. File f = new File("/work/errorlist.log") new File("/work/server.log").eachLine { line -> if(line =~ ".*ERROR.*") { f.append(line + "¥n") } }
  • 27.
  • 28. • • Expando Meta Class • Grape • Mixin • AST • ...
  • 30.
  • 34.
  • 36. Hudson kkawa Groovy ※ ※2008 SDC SQUARE
  • 38. Q.
  • 39. A. Hudson CLI groovy groovysh
  • 40. Q. Scala
  • 41. A. Groovy
  • 42. Q.
  • 43. A. Groovy ! Groovy @torazuka
  • 45. A. Groovy JOJO Groovy
  • 46. A. Groovy JOJO Groovy
  • 48. A.
  • 50. Groovy JGGUG
  • 51. Groovy JGGUG
  • 52.
  • 53.
  • 54.
  • 55. Groovy JVM Java