SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Downloaden Sie, um offline zu lesen
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ノススメ

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
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
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
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
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Kürzlich hochgeladen (20)

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
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!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
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
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
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
 
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?
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

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