Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Easy Going Groovy 2nd season on DevLOVE

4,559 views

Published on

DevLOVE "grow-grow Groovy" seminar handout in Japan, TOKYO at 24 Jan 2011.

Published in: Technology
  • Dating for everyone is here: ❶❶❶ http://bit.ly/2u6xbL5 ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Follow the link, new dating source: ♥♥♥ http://bit.ly/2u6xbL5 ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • (Unlimited)....ACCESS WEBSITE Over for All Ebooks ................ accessibility Books Library allowing access to top content, including thousands of title from favorite author, plus the ability to read or download a huge selection of books for your pc or smartphone within minutes ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M }
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Easy Going Groovy 2nd season on DevLOVE

  1. 1. 2011.1.24
  2. 2. Slide # 2 DevLOVE Groovy 2011.1.24
  3. 3. http://d.hatena.ne.jp/uehaj/Slide # 3 DevLOVE Groovy 2011.1.24
  4. 4. new! JJUG CCC updateSlide # 4 DevLOVE Groovy 2011.1.24
  5. 5. Slide # 5 DevLOVE Groovy 2011.1.24
  6. 6. Slide # 6 DevLOVE Groovy 2011.1.24
  7. 7. import java.io.*; BufferedReader bis = new BufferedReaderimport java.net.*; (new InputStreamReader(ins)); String line;public class SocketAccess { while ((line = bis.readLine()) != null) { System.out.println(line); public static void main(String[] args) { } Socket soc = null; } InputStream ins = null; catch (IOException e) { OutputStream outs = null; e.printStackTrace(); try { try { soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); } outs = soc.getOutputStream(); catch(IOException ex) {} outs.write("GET / HTTP/1.0nn".getBytes }()); } } Slide # 7 DevLOVE Groovy 2011.1.24
  8. 8. import java.io.*; BufferedReader bis = new BufferedReaderimport java.net.*; (new InputStreamReader(ins)); String line;public class SocketAccess { while ((line = bis.readLine()) != null) { System.out.println(line); public static void main(String[] args) { } Socket soc = null; } InputStream ins = null; catch (IOException e) { OutputStream outs = null; e.printStackTrace(); try { try { soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); } outs = soc.getOutputStream(); catch(IOException ex) {} outs.write("GET / HTTP/1.0nn".getBytes }()); } } Slide # 8 DevLOVE Groovy 2011.1.24
  9. 9. import java.io.*; BufferedReader bis = new BufferedReaderimport java.net.*; (new InputStreamReader(ins)); String line;public class SocketAccess { while ((line = bis.readLine()) != null) { System.out.println(line); public static void main(String[] args) { } Socket soc = null; } InputStream ins = null; catch (IOException e) { OutputStream outs = null; e.printStackTrace(); try { try { soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); } outs = soc.getOutputStream(); catch(IOException ex) {} outs.write("GET / HTTP/1.0nn".getBytes }()); } } Slide # 8 DevLOVE Groovy 2011.1.24
  10. 10. import java.io.*; BufferedReader bis = new BufferedReaderimport java.net.*; (new InputStreamReader(ins)); String line;public class SocketAccess { while ((line = bis.readLine()) != null) { System.out.println(line); public static void main(String[] args) { } Socket soc = null; } InputStream ins = null; catch (IOException e) { OutputStream outs = null; e.printStackTrace(); try { try { soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); } outs = soc.getOutputStream(); catch(IOException ex) {} outs.write("GET / HTTP/1.0nn".getBytes }()); } } Slide # 9 DevLOVE Groovy 2011.1.24
  11. 11. import java.io.*; BufferedReader bis = new BufferedReaderimport java.net.*; (new InputStreamReader(ins)); String line;public class SocketAccess { while ((line = bis.readLine()) != null) { System.out.println(line); public static void main(String[] args) { } Socket soc = null; } InputStream ins = null; catch (IOException e) { OutputStream outs = null; e.printStackTrace(); try { try { soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); } outs = soc.getOutputStream(); catch(IOException ex) {} outs.write("GET / HTTP/1.0nn".getBytes }()); } } Slide # 9 DevLOVE Groovy 2011.1.24
  12. 12. BufferedReader bis = new BufferedReader (new InputStreamReader(ins)); String line;public class SocketAccess { while ((line = bis.readLine()) != null) { System.out.println(line); public static void main(String[] args) { } Socket soc = null; } InputStream ins = null; catch (IOException e) { OutputStream outs = null; e.printStackTrace(); try { try { soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); } outs = soc.getOutputStream(); catch(IOException ex) {} outs.write("GET / HTTP/1.0nn".getBytes }()); } } Slide #10 DevLOVE Groovy 2011.1.24
  13. 13. BufferedReader bis = new BufferedReader (new InputStreamReader(ins)); String line;public class SocketAccess { while ((line = bis.readLine()) != null) { System.out.println(line); public static void main(String[] args) { } Socket soc = null; } InputStream ins = null; catch (IOException e) { OutputStream outs = null; e.printStackTrace(); try { try { soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); } outs = soc.getOutputStream(); catch(IOException ex) {} outs.write("GET / HTTP/1.0nn".getBytes }()); } } Slide #10 DevLOVE Groovy 2011.1.24
  14. 14. BufferedReader bis = new BufferedReader (new InputStreamReader(ins)); String line; while ((line = bis.readLine()) != null) { System.out.println(line); } Socket soc = null; } InputStream ins = null; catch (IOException e) { OutputStream outs = null; e.printStackTrace(); try { try { soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); } outs = soc.getOutputStream(); catch(IOException ex) {} outs.write("GET / HTTP/1.0nn".getBytes }()); Slide #11 DevLOVE Groovy 2011.1.24
  15. 15. BufferedReader bis = new BufferedReader (new InputStreamReader(ins)); String line; while ((line = bis.readLine()) != null) { System.out.println(line); } Socket soc = null; } InputStream ins = null; catch (IOException e) { OutputStream outs = null; e.printStackTrace(); try { try { soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); } outs = soc.getOutputStream(); catch(IOException ex) {} outs.write("GET / HTTP/1.0nn".getBytes }()); Slide #11 DevLOVE Groovy 2011.1.24
  16. 16. BufferedReader bis = new BufferedReader (new InputStreamReader(ins)); String line; while ((line = bis.readLine()) != null) { System.out.println(line); } Socket soc = null; InputStream ins = null; OutputStream outs = null; soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); outs = soc.getOutputStream(); outs.write("GET / HTTP/1.0nn".getBytes()); Slide #12 DevLOVE Groovy 2011.1.24
  17. 17. BufferedReader bis = new BufferedReader (new InputStreamReader(ins)); String line; while ((line = bis.readLine()) != null) { System.out.println(line); } Socket soc = null; InputStream ins = null; OutputStream outs = null; soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); outs = soc.getOutputStream(); outs.write("GET / HTTP/1.0nn".getBytes()); Slide #12 DevLOVE Groovy 2011.1.24
  18. 18. bis = new BufferedReader(new InputStreamReader(ins)); def line = null; while ((line = bis.readLine()) != null) { System.out.println(line); } def soc = null; def ins = null; def outs = null; soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); outs = soc.getOutputStream(); outs.write("GET / HTTP/1.0nn".getBytes()); Slide #13 DevLOVE Groovy 2011.1.24
  19. 19. bis = new BufferedReader(new InputStreamReader(ins)); def line = null; while ((line = bis.readLine()) != null) { System.out.println(line); } def soc = null; def ins = null; def outs = null; soc = new Socket("www.java-users.jp", 80); if (soc != null) soc.close(); ins = soc.getInputStream(); outs = soc.getOutputStream(); outs.write("GET / HTTP/1.0nn".getBytes()); Slide #13 DevLOVE Groovy 2011.1.24
  20. 20. bis = new BufferedReader(new InputStreamReader(ins)); def line = null; while ((line = bis.readLine()) != null) { System.out.println(line); } } new Socket("www.java-users.jp",80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".getBytes()); Slide #14 DevLOVE Groovy 2011.1.24
  21. 21. bis = new BufferedReader(new InputStreamReader(ins)); def line = null; while ((line = bis.readLine()) != null) { System.out.println(line); } } new Socket("www.java-users.jp",80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".getBytes()); Slide #14 DevLOVE Groovy 2011.1.24
  22. 22. ins.eachLine{ line -> System.out.println(line); } } new Socket("www.java-users.jp",80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".getBytes()); Slide #15 DevLOVE Groovy 2011.1.24
  23. 23. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".getBytes()); ins.eachLine { line -> System.out.println(line); } }Slide #16 DevLOVE Groovy 2011.1.24
  24. 24. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".getBytes()); ins.eachLine { line -> System.out.println(line); } }Slide #17 DevLOVE Groovy 2011.1.24
  25. 25. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".getBytes()); ins.eachLine { line -> System.out.println(line); } }Slide #17 DevLOVE Groovy 2011.1.24
  26. 26. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".bytes); ins.eachLine { line -> System.out.println(line); } }Slide #18 DevLOVE Groovy 2011.1.24
  27. 27. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".bytes); ins.eachLine { line -> System.out.println(line); } }Slide #18 DevLOVE Groovy 2011.1.24
  28. 28. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".bytes); ins.eachLine { line -> println(line); } }Slide #19 DevLOVE Groovy 2011.1.24
  29. 29. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".bytes); ins.eachLine { line -> println(line); } }Slide #19 DevLOVE Groovy 2011.1.24
  30. 30. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".bytes); ins.eachLine { println(it); } }Slide #20 DevLOVE Groovy 2011.1.24
  31. 31. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".bytes); ins.eachLine { println(it); } }Slide #20 DevLOVE Groovy 2011.1.24
  32. 32. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".bytes) ins.eachLine { println(it) } }Slide #21 DevLOVE Groovy 2011.1.24
  33. 33. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write("GET / HTTP/1.0nn".bytes) ins.eachLine { println(it) } }Slide #21 DevLOVE Groovy 2011.1.24
  34. 34. new Socket("www.java-users.jp", 80).withStreams { ins, outs -> outs.write "GET / HTTP/1.0nn".bytes ins.eachLine { println it } }Slide #22 DevLOVE Groovy 2011.1.24
  35. 35. println new URL("http://www.java-users.jp").textSlide #23 DevLOVE Groovy 2011.1.24
  36. 36. println new URL("http://www.java-users.jp").text Java Groovy Java 7Slide #23 DevLOVE Groovy 2011.1.24
  37. 37. Gaelyk Grails(Web) GSQL GSP,GORM SwingBuilder Griffon(GUI) MarkupBuilder GMaven,Maven3 /DSL Hudson JBoss Gant FreeMind Gradle Spock,EasyB Gpars Groovy++Slide #24 DevLOVE Groovy 2011.1.24
  38. 38. Slide # 25 DevLOVE Groovy 2011.1.24
  39. 39. Slide #26 DevLOVE Groovy 2011.1.24
  40. 40. Slide #27 DevLOVE Groovy 2011.1.24
  41. 41. @Grab(net.sourceforge.htmlunit:htmlunit:2.8) import com.gargoylesoftware.htmlunit.WebClient; // Ant Bzip2 new AntBuilder().bzip2(src:args[0], zipfile:args[0]+".bz2") // HtmlUnit url = "http://pukiwiki.example.com/index.php? plugin=attach&pcmd=upload&page=test" page = new WebClient().getPage(url) file = page.getElementById(_p_attach_file) file.valueAttribute = args[0]+".bz2" page.getByXPath("//input[@value= ]")[0].click()Slide #28 DevLOVE Groovy 2011.1.24
  42. 42. @Grab(net.sourceforge.htmlunit:htmlunit:2.8) import com.gargoylesoftware.htmlunit.WebClient; // Ant Bzip2 new AntBuilder().bzip2(src:args[0], zipfile:args[0]+".bz2") // HtmlUnit url = "http://pukiwiki.example.com/index.php? plugin=attach&pcmd=upload&page=test" page = new WebClient().getPage(url) file = page.getElementById(_p_attach_file) file.valueAttribute = args[0]+".bz2" page.getByXPath("//input[@value= ]")[0].click()Slide #28 DevLOVE Groovy 2011.1.24
  43. 43. @Grab(net.sourceforge.htmlunit:htmlunit:2.8) import com.gargoylesoftware.htmlunit.WebClient; // Ant Bzip2 new AntBuilder().bzip2(src:args[0], zipfile:args[0]+".bz2") // HtmlUnit url = "http://pukiwiki.example.com/index.php? plugin=attach&pcmd=upload&page=test" page = new WebClient().getPage(url) file = page.getElementById(_p_attach_file) file.valueAttribute = args[0]+".bz2" page.getByXPath("//input[@value= ]")[0].click()Slide #28 DevLOVE Groovy 2011.1.24
  44. 44. @Grab(net.sourceforge.htmlunit:htmlunit:2.8) import com.gargoylesoftware.htmlunit.WebClient; // Ant Bzip2 new AntBuilder().bzip2(src:args[0], zipfile:args[0]+".bz2") // HtmlUnit url = "http://pukiwiki.example.com/index.php? plugin=attach&pcmd=upload&page=test" page = new WebClient().getPage(url) file = page.getElementById(_p_attach_file) file.valueAttribute = args[0]+".bz2" page.getByXPath("//input[@value= ]")[0].click()Slide #28 DevLOVE Groovy 2011.1.24
  45. 45. @Grab(net.sourceforge.htmlunit:htmlunit:2.8) import com.gargoylesoftware.htmlunit.WebClient;Slide #29 DevLOVE Groovy 2011.1.24
  46. 46. // Ant Bzip2 new AntBuilder().bzip2(src:args[0], zipfile:args[0]+".bz2")Slide #30 DevLOVE Groovy 2011.1.24
  47. 47. Slide #31 DevLOVE Groovy 2011.1.24
  48. 48. cities.csv ,35676000, ,19040000, = ,1018000, ,5492000,Slide #31 DevLOVE Groovy 2011.1.24
  49. 49. cities.csv ,35676000, ,19040000, , , = ,1018000, ,5492000,Slide #31 DevLOVE Groovy 2011.1.24
  50. 50. @Grab(com.h2database:h2:1.2.143)@GrabConfig(systemClassLoader=true)import groovy.sql.Sqlsql = Sql.newInstance("jdbc:h2:cities")sql.execute """ CREATE TABLE Cities (                  id INT IDENTITY PRIMARY KEY, name VARCHAR,                  population DECIMAL(10), country VARCHAR)"""cities = sql.dataSet("Cities")new File("cities.csv").splitEachLine(",") { f1, f2, f3 -> //  cities.add(name:f1, population:f2, country:f3)}assert cities.findAll{ it.country==" " && it.population>1000000 }.rows()*.name == [ , = ( ), , , ]Slide #32 DevLOVE Groovy 2011.1.24
  51. 51. @Grab(com.h2database:h2:1.2.143)@GrabConfig(systemClassLoader=true)import groovy.sql.Sqlsql = Sql.newInstance("jdbc:h2:cities")sql.execute """ CREATE TABLE Cities (                  id INT IDENTITY PRIMARY KEY, name VARCHAR,                  population DECIMAL(10), country VARCHAR)"""cities = sql.dataSet("Cities")new File("cities.csv").splitEachLine(",") { f1, f2, f3 -> //  cities.add(name:f1, population:f2, country:f3)}assert cities.findAll{ it.country==" " && it.population>1000000 }.rows()*.name == [ , = ( ), , , ]Slide #32 DevLOVE Groovy 2011.1.24
  52. 52. @Grab(com.h2database:h2:1.2.143)@GrabConfig(systemClassLoader=true)import groovy.sql.Sqlsql = Sql.newInstance("jdbc:h2:cities")sql.execute """ CREATE TABLE Cities (                  id INT IDENTITY PRIMARY KEY, name VARCHAR,                  population DECIMAL(10), country VARCHAR)"""cities = sql.dataSet("Cities")new File("cities.csv").splitEachLine(",") { f1, f2, f3 -> //  cities.add(name:f1, population:f2, country:f3)}assert cities.findAll{ it.country==" " && it.population>1000000 }.rows()*.name == [ , = ( ), , , ]Slide #32 DevLOVE Groovy 2011.1.24
  53. 53. @Grab(com.h2database:h2:1.2.143)@GrabConfig(systemClassLoader=true)import groovy.sql.Sqlsql = Sql.newInstance("jdbc:h2:cities")sql.execute """ CREATE TABLE Cities (                  id INT IDENTITY PRIMARY KEY, name VARCHAR,                  population DECIMAL(10), country VARCHAR)"""cities = sql.dataSet("Cities")new File("cities.csv").splitEachLine(",") { f1, f2, f3 -> //  cities.add(name:f1, population:f2, country:f3)}assert cities.findAll{ it.country==" " && it.population>1000000 }.rows()*.name == [ , = ( ), , , ]Slide #32 DevLOVE Groovy 2011.1.24
  54. 54. @Grab(com.h2database:h2:1.2.143)@GrabConfig(systemClassLoader=true)import groovy.sql.Sqlsql = Sql.newInstance("jdbc:h2:cities")sql.execute """ CREATE TABLE Cities (                  id INT IDENTITY PRIMARY KEY, name VARCHAR,                  population DECIMAL(10), country VARCHAR)"""cities = sql.dataSet("Cities")new File("cities.csv").splitEachLine(",") { f1, f2, f3 -> //  cities.add(name:f1, population:f2, country:f3)}assert cities.findAll{ it.country==" " && it.population>1000000 }.rows()*.name == [ , = ( ), , , ]Slide #32 DevLOVE Groovy 2011.1.24
  55. 55. @Grab(com.h2database:h2:1.2.143)@GrabConfig(systemClassLoader=true)import groovy.sql.SqlSlide #33 DevLOVE Groovy 2011.1.24
  56. 56. cities = sql.dataSet("Cities")new File("cities.csv").splitEachLine(",") { f1, f2, f3 -> //  cities.add(name:f1, population:f2, country:f3)}Slide #34 DevLOVE Groovy 2011.1.24
  57. 57. cities = sql.dataSet("Cities")assert cities.findAll{ it.country==" " && it.population>1000000 }.rows()*.name == [ , = ( ), , , ]cities = sql.dataSet("Cities")assert cities.findAll{ it.country==" " } .findAll{ it.population>1000000 }.rows()*.name == [ , = ( ), , , ]Slide #35 DevLOVE Groovy 2011.1.24
  58. 58. Slide # 36 DevLOVE Groovy 2011.1.24
  59. 59. update http://d.hatena.ne.jp/ksky/20090618/p1Slide #37 DevLOVE Groovy 2011.1.24
  60. 60. update ! http://d.hatena.ne.jp/ksky/20090618/p1Slide #37 DevLOVE Groovy 2011.1.24
  61. 61. http://kokucheese.com/event/index/5267/Slide #38 DevLOVE Groovy 2011.1.24
  62. 62. http://bit.ly/g5iE0mSlide #39 DevLOVE Groovy 2011.1.24
  63. 63. Slide # 40 DevLOVE Groovy 2011.1.24
  64. 64. Slide #41 DevLOVE Groovy 2011.1.24
  65. 65. updateSlide #42 DevLOVE Groovy 2011.1.24
  66. 66. http://kobo.github.com/groovyserv/Slide # 43 DevLOVE Groovy 2011.1.24
  67. 67. Slide #44 DevLOVE Groovy 2011.1.24
  68. 68. Shell Environment User Groovy Srcipt C LA SS . lin PA cm System.in TH d System.out en e v SYstem.err ar gs Ctrl-C groovyclient TCP/IP groovyserver n di st de t st dou rr JavaVM st exit status File System Authentication Cookie FileSlide # DevLOVE Groovy 2011.1.24 45
  69. 69. User Groovy Shell Environment Srcipt C LA System.in SS . lin PA cm System.out TH d SYstem.err en e v ar gs Ctrl-C groovy n di st de t st dou JavaVM rr st exit status File SystemSlide #46 DevLOVE Groovy 2011.1.24
  70. 70. 19.6 normal groovy 3.041 1.0 Installer groovy 1.262 2.4 groovyclient(C ) 0.155 19.6 groovyclient(Ruby ) 0.193 15.8 •Groovy 1.7.3, GroovyServ 0.4-SNAPSHOT, WinXP SP3,Core2Duo 2GHz,JDK1Slide # •time DevLOVE real 10 Groovy 2011.1.24
  71. 71. 35.8 normal groovy 1.112 1.0 Mac Ports groovy(1.7.2) 0.321 3.5 groovyclient(C ) 0.031 35.8 groovyclient(Ruby ) 0.041 27.1 •Groovy 1.7.3, GroovyServ 0.4-SNAPSHOT, MacOSX 10.6.3, MacBook Core2duo 2.53GHz, JDK1.6.0u20 •time real 10Slide #48 DevLOVE Groovy 2011.1.24
  72. 72. for (i=0; i<1000000; i++) {}; groovy(Client VM) 593.7 groovy(Server VM) 243.8 groovyclient(Client VM) 454.6 groovyclient(Server VM) 197.0 •Groovy 1.7.3, GroovyServ 0.4, Windows XP SP3(cygwin 1.7.5),Core2duo 2.00GHz, JDK1.6.0u13Slide #49 DevLOVE •time Groovy 2011.1.24 real
  73. 73. Groovy for (i=0; i<1000000; i++) {}; scalac 6.6 1.0 fsc 1.2 5.5 scalac/GroovyServ 1.1 6.6 fsc/GroovyServ 0.4 16.5Slide #50 DevLOVE Groovy 2011.1.24
  74. 74. Slide #51 DevLOVE Groovy 2011.1.24
  75. 75. Slide #52 DevLOVE Groovy 2011.1.24
  76. 76. new!thanks for the great work on groovyserv!I use it everyday and enjoy its performance.I also give it lots of credit in my workshops and talks.(you may have recognized the additionalhackergarten screencast.) I was thinking about maybe making GroovyServ the default way of how groovy executes a script. That sounds like a great release to me! Congratulations to the team! Great work, this thing really helps.Slide #53 DevLOVE Groovy 2011.1.24
  77. 77. new!thanks for the great work on groovyserv!I use it everyday and enjoy its performance.I also give it lots of credit in my workshops and talks.(you may have recognized the additionalhackergarten screencast.) I was thinking about maybe making GroovyServ the default way of how groovy executes a script. That sounds like a great release to me! Congratulations to the team! Great work, this thing really helps.Slide #53 DevLOVE Groovy 2011.1.24
  78. 78. Slide #54 DevLOVE Groovy 2011.1.24
  79. 79. Slide #55 DevLOVE Groovy 2011.1.24
  80. 80. Slide # 56 DevLOVE Groovy 2011.1.24
  81. 81. GEP ‥ Groovy Enhancement ProposalSlide #57 DevLOVE Groovy 2011.1.24
  82. 82. 100 1 2 3 { ->    } 1 100 . ( ) 1 100 . ( ) { ->    + " 6 " } " " http://d.hatena.ne.jp/uehaj/20100919/1284906117 10.0 18 6 2 24 6 6 [6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, : 78, 84, 90, 96] 6 6 96 6 12 6Slide #58 DevLOVE Groovy 2011.1.24
  83. 83. (100). ( ). ( ) (1). (2). (3). ( ). ( ({ ->    ( ). ( ) })) (1). (100). (( . ( ))). ( ) (1). (100). ( . ( )). ( ({ ->    ( + " 6 "). ( ) })) (" "). ( )Slide #59 DevLOVE Groovy 2011.1.24
  84. 84. new int fib (int n) { groovyc     if (n<=1) return 1     return fib(n-1) + fib(n-2) jad }Slide #60 DevLOVE Groovy 2011.1.24
  85. 85. new int fib (int n) { groovyc     if (n<=1) return 1     return fib(n-1) + fib(n-2) jad }public int fib(int n){    CallSite acallsite[] = $getCallSiteArray();    if(ScriptBytecodeAdapter.compareLessThanEqual(DefaultTypeTransformation.box(n), $const$0))        return DefaultTypeTransformation.intUnbox((Integer)ScriptBytecodeAdapter.castToType($const$0, $get$$class$java$lang$Integer()));    else        return DefaultTypeTransformation.intUnbox((Integer)ScriptBytecodeAdapter.castToType(acallsite[0].call(acallsite[1].callCurrent(this, acallsite[2].call(DefaultTypeTransformation.box(n), $const$0)),acallsite[3].callCurrent(this, acallsite[4].call(DefaultTypeTransformation.box(n), $const$1))), $get$$class$java$lang$Integer()));} Slide #60 DevLOVE Groovy 2011.1.24
  86. 86. new int fib (int n) { groovyc     if (n<=1) return 1     return fib(n-1) + fib(n-2) jad } public int fib(int n)public int fib(int n) {{     CallSite acallsite[] = $getCallSiteArray();    CallSite acallsite[] = $getCallSiteArray();     if(!ScriptBytecodeAdapter.isOrigInt())         if(ScriptBytecodeAdapter.compareLessThanEqual((Integer)    if(ScriptBytecodeAdapter.compareLessThanEqual DefaultTypeTransformation.box(n), (Integer)(DefaultTypeTransformation.box(n), $const$0)) DefaultTypeTransformation.box(1)))        return DefaultTypeTransformation.intUnbox((Integer)             return 1;ScriptBytecodeAdapter.castToType($const$0, $get$$class$java$lang$Integer()));         else    else             return DefaultTypeTransformation.intUnbox(acallsite        return DefaultTypeTransformation.intUnbox((Integer) [0].call(acallsite[1].callCurrent(this, acallsite[2].callScriptBytecodeAdapter.castToType(acallsite[0].call(acallsite[1].callCurrent ((Integer)DefaultTypeTransformation.box(n), (Integer) DefaultTypeTransformation.box(1))), acallsite[3].callCurrent(this, acallsite[2].call(DefaultTypeTransformation.box(n), $const$0)), (this, acallsite[4].call((Integer)DefaultTypeTransformation.boxacallsite[3].callCurrent(this, acallsite[4].call (n), (Integer)DefaultTypeTransformation.box(2)))));(DefaultTypeTransformation.box(n), $const$1))), $get$$class$java$lang$Integer     if(n <= 1)()));         return 1;}     else         return fib(n - 1) + fib(n - 2); } Slide #60 DevLOVE Groovy 2011.1.24
  87. 87. new int fib (int n) { groovyc     if (n<=1) return 1     return fib(n-1) + fib(n-2) jad } public int fib(int n)public int fib(int n) {{     CallSite acallsite[] = $getCallSiteArray();    CallSite acallsite[] = $getCallSiteArray();     if(!ScriptBytecodeAdapter.isOrigInt())         if(ScriptBytecodeAdapter.compareLessThanEqual((Integer)    if(ScriptBytecodeAdapter.compareLessThanEqual DefaultTypeTransformation.box(n), (Integer)(DefaultTypeTransformation.box(n), $const$0)) DefaultTypeTransformation.box(1)))        return DefaultTypeTransformation.intUnbox((Integer)             return 1;ScriptBytecodeAdapter.castToType($const$0, $get$$class$java$lang$Integer()));         else    else             return DefaultTypeTransformation.intUnbox(acallsite        return DefaultTypeTransformation.intUnbox((Integer) [0].call(acallsite[1].callCurrent(this, acallsite[2].callScriptBytecodeAdapter.castToType(acallsite[0].call(acallsite[1].callCurrent ((Integer)DefaultTypeTransformation.box(n), (Integer) DefaultTypeTransformation.box(1))), acallsite[3].callCurrent(this, acallsite[2].call(DefaultTypeTransformation.box(n), $const$0)), (this, acallsite[4].call((Integer)DefaultTypeTransformation.boxacallsite[3].callCurrent(this, acallsite[4].call (n), (Integer)DefaultTypeTransformation.box(2)))));(DefaultTypeTransformation.box(n), $const$1))), $get$$class$java$lang$Integer     if(n <= 1)()));         return 1;}     else         return fib(n - 1) + fib(n - 2); } Slide #60 DevLOVE Groovy 2011.1.24
  88. 88. new int fib (int n) { groovyc     if (n<=1) return 1     return fib(n-1) + fib(n-2) jad } public int fib(int n)public int fib(int n) {{     CallSite acallsite[] = $getCallSiteArray(); if(n <= 1)    CallSite acallsite[] = $getCallSiteArray();     if(!ScriptBytecodeAdapter.isOrigInt())          if(ScriptBytecodeAdapter.compareLessThanEqual((Integer)    return 1;    if(ScriptBytecodeAdapter.compareLessThanEqual DefaultTypeTransformation.box(n), (Integer)(DefaultTypeTransformation.box(n), $const$0)) else DefaultTypeTransformation.box(1)))        return DefaultTypeTransformation.intUnbox((Integer)             return 1;          else fib(n - 1) + fib(n - 2);    returnScriptBytecodeAdapter.castToType($const$0, $get$$class$java$lang$Integer()));    else             return DefaultTypeTransformation.intUnbox(acallsite        return DefaultTypeTransformation.intUnbox((Integer) [0].call(acallsite[1].callCurrent(this, acallsite[2].callScriptBytecodeAdapter.castToType(acallsite[0].call(acallsite[1].callCurrent ((Integer)DefaultTypeTransformation.box(n), (Integer) DefaultTypeTransformation.box(1))), acallsite[3].callCurrent(this, acallsite[2].call(DefaultTypeTransformation.box(n), $const$0)), (this, acallsite[4].call((Integer)DefaultTypeTransformation.boxacallsite[3].callCurrent(this, acallsite[4].call (n), (Integer)DefaultTypeTransformation.box(2)))));(DefaultTypeTransformation.box(n), $const$1))), $get$$class$java$lang$Integer     if(n <= 1)()));         return 1;}     else         return fib(n - 1) + fib(n - 2); } Slide #60 DevLOVE Groovy 2011.1.24
  89. 89. new long begin = System.nanoTime(); FibJava foo = new FibJava(); int result = foo.fib(32); // long end = System.nanoTime(); System.out.println("Elapsed time: " + (end - begin) + "ns"); (ns) Java 1 Groovy 1.7.5 1,639,852,000 66.46 Groovy 1.8.0 beta 3 65,497,000 2.65 Java(OpenJDK 1.7) 24,672,000 1.0 • MacOSX 10.6.3, MacBook Core2duo 2.53GHz,openjdk version "1.7.0-internal"Slide #61 DevLOVE Groovy 2011.1.24
  90. 90. @Invariant({ elements != null })    class Stack {      def boolean is_empty()  {            elements.isEmpty()      private List elements      }          @Ensures({ is_empty() })      @Requires({ !is_empty() })      public Stack()  {      def last_item()  {          elements = []          elements.last()      }      }          @Requires({ preElements?.size() >      def count() { 0 })          elements.size()      @Ensures({ !is_empty() })      }      public Stack(List preElements)  {          elements = preElements      } http://github.com/andresteingress/gcontracts/wikiSlide #62 DevLOVE Groovy 2011.1.24
  91. 91. update http://canoo.com/blog/2010/09/20/log-groovys-new-and-extensible-logging-conveniences/Slide #63 DevLOVE Groovy 2011.1.24
  92. 92. import groovy.util.logging.Log  @Log  class MyClass {      def invoke() {          log.info(... an info message)          log.fine(... a fine message)      }  } http://canoo.com/blog/2010/09/20/log-groovys-new-and-extensible-logging-conveniences/Slide #64 DevLOVE Groovy 2011.1.24
  93. 93. New!Slide #65 DevLOVE Groovy 2011.1.24
  94. 94. http://kokucheese.com/event/index/5267/ Groovy&Grails exchange 2010@London by tyama, tamada ( ) Gradle G* by (LITERAL-ICE)Slide #66 DevLOVE Groovy 2011.1.24
  95. 95. http://kokucheese.com/event/index/5267/ Groovy&Grails exchange 2010@London by tyama, tamada ( ) Gradle G* by (LITERAL-ICE)Slide #66 DevLOVE Groovy 2011.1.24
  96. 96. Slide # 67 DevLOVE Groovy 2011.1.24

×