SlideShare a Scribd company logo
とある断片の超動的言語
とある断片の超動的言語
とある断片の超動的言語
http://twitter.com/#!/cactusman/status/9123744081510400
gist.github
https://gist.github.com/
https://gist.github.com/gists
Groovy
とある断片の超動的言語
gist 310321


File.glob('**/[a-z]*.groovy')
gist 233429
import javax.sound.midi.*

def synth = MidiSystem.getSynthesizer()
synth.open()
def channel = synth.getChannels()[9]
channel.noteOn(56, 96)
Thread.sleep(100)
channel.noteOff(56)
synth.close()
gist 250489
score = [
  [A2, d4],       [A2,   d4],   [B2,   d2],
  [A2, d4],       [A2,   d4],   [B2,   d2],
  [A2, d4],       [B2,   d4],   [C2,   d4], [B2, d4],
  [A2, d4],       [B2,   d8],   [A2,   d8], [F1, d2],

    [E1,   d4],   [C1,   d4],   [E1,   d4],   [F1,   d4],
    [E1,   d4],   [E1,   d8],   [C1,   d8],   [B1,   d2],
    [A2,   d4],   [B2,   d4],   [C2,   d4],   [B2,   d4],
    [A2,   d4],   [B2,   d8],   [A2,   d8],   [F1,   d2],
    [E1,   d4],   [C1,   d4],   [E1,   d4],   [F1,   d4],
    [E1,   d4],   [E1,   d8],   [C1,   d8],   [B1,   d2],

    [A2,   d4],   [A2, d4], [B2, d2],
    [A2,   d4],   [A2, d4], [B2, d2],
    [E1,   d4],   [F1, d4], [B2, d8], [A2, d8], [F1, d4],
    [E1,   d2],   [null, d2],
]
gist 506855
import hudson.model.*
import hudson.slaves.*
node = new DumbSlave("testing", "Testing node",
   "/home/hudson", "2", Node.Mode.NORMAL,
   "test label", new JNLPLauncher(),
   new RetentionStrategy.Always(),
   new ArrayList())
hudson.model.Hudson.instance.addNode(node)
gist 702337
gist 524018
Newbie programmer


int factorial_newbie(int n) {
    if (n == 0) {
        return 1
    } else {
        return n * factorial_newbie(n - 1)
    }
}
println factorial_newbie(6)
First year programmer,
    studied Pascal

  int factorial_pascal(int n) {
      int result = 1;
      for (int i = 1; i <= n; i++) {
          result = result * i;
      }
      return result;
  }
  println factorial_pascal(6)
First year programmer,
       studied C

  int fact_c(int n) {
      int result = 1;
      for (int i = 1; i <= n; i++) {
          result *= i;
      }
      return result;
  }
  println fact_c(6)
First year programmer,
        Python

   int Factorial_python(int n) {
       int res = 1
       (2..n).each { i ->
           res *= i
       }
       return res
   }
   println Factorial_python(6)
Lazy Groovy programmer



int fact_lazy(int n) {
    return (n <= 1) ? 1 : n * fact_lazy(n - 1)
}
println fact_lazy(6)
Lazier Groovy programmer



def factLazier = { (it <= 1) ? 1 : it * call(it - 1) }
println factLazier(6)
Groovy expert programmer


def factExpert = { n ->
 n ? (1..n).inject(1, { a, b -> a * b }): 1 }
println factExpert(6)
Enterprise programmer
class InternalBase {
    private int base

    public InternalBase(Integer base) {
        this.base = base.intValue()
    }

    int getBase() {
        return new Integer(base)
    }
}

class StandardMathematicsSystem {
    private static StandardMathematicsSystem INSTANCE = null
    private Integer base

    private StandardMathematicsSystem(InternalBase base) throws RuntimeException {
        if (base.getBase().compareTo(new Integer(2)) != 0) {
            throw RuntimeException("Non base 2 bases are not supported.")
        }
        this.base = base.getBase()
    }

    int calculateFactorial(Integer target) {
        Integer result = new Integer(1)
        for (Integer i = new Integer(2); i.compareTo(target) <= 0; i = new Integer(i.intValue() + 1)) {
            result = result * i
        }
        return result
    }

    static private StandardMathematicsSystem createInstance(InternalBase base) {
        return new StandardMathematicsSystem(base)
    }

    static StandardMathematicsSystem getInstance(InternalBase base) {
        if (INSTANCE == null) {
            INSTANCE = createInstance(base)
        }
        return INSTANCE
    }
}
println StandardMathematicsSystem.getInstance(new InternalBase(new Integer(2))).calculateFactorial(new Integer(6))
とある断片の超動的言語
Gist
とある断片の超動的言語
とある断片の超動的言語
とある断片の超動的言語
とある断片の超動的言語
Gist G
Groovy G
とある断片の超動的言語
gist 326626

groovywebconsole.user.js
Gist                   Groovy
               Greasemonkey

for Firefox (not for Chrome)
Groovy   Gist
とある断片の超動的言語

More Related Content

PPT
Admission for b.tech
Edhole.com
 
PPTX
C- Programs - Harsh
Harsh Sharma
 
DOCX
2 a networkflow
Aravindharamanan S
 
PPTX
Java practice programs for beginners
ishan0019
 
DOCX
Practica54
Mûzâmîl ßâlõch
 
PDF
Use C++ to Manipulate mozSettings in Gecko
Chih-Hsuan Kuo
 
PDF
Python summer course play with python (lab1)
iloveallahsomuch
 
PDF
Clojure functions midje
Jackson dos Santos Olveira
 
Admission for b.tech
Edhole.com
 
C- Programs - Harsh
Harsh Sharma
 
2 a networkflow
Aravindharamanan S
 
Java practice programs for beginners
ishan0019
 
Use C++ to Manipulate mozSettings in Gecko
Chih-Hsuan Kuo
 
Python summer course play with python (lab1)
iloveallahsomuch
 
Clojure functions midje
Jackson dos Santos Olveira
 

What's hot (19)

PPTX
Nested micro
Satyamevjayte Haxor
 
PDF
VTU Data Structures Lab Manual
Nithin Kumar,VVCE, Mysuru
 
PDF
Real world scala
lunfu zhong
 
PDF
C++ TUTORIAL 7
Farhan Ab Rahman
 
DOCX
C++ assignment
Zohaib Ahmed
 
PPTX
Java JIT Optimization Research
Adam Feldscher
 
PPTX
Queue oop
Gouda Mando
 
PDF
Data structures lab manual
Syed Mustafa
 
PDF
Grover's Algorithm
Vijayananda Mohire
 
DOCX
C programs
Tahir Pasha
 
PDF
DSU C&C++ Practical File Diploma
mustkeem khan
 
DOCX
C++ file
Mukund Trivedi
 
DOCX
Heap sort &amp; bubble sort
Shanmuga Raju
 
DOCX
Basic Programs of C++
Bharat Kalia
 
PPTX
COSCUP: Introduction to Julia
岳華 杜
 
PPT
computer notes - Data Structures - 3
ecomputernotes
 
PPTX
Presentation1 computer shaan
walia Shaan
 
PDF
81818088 isc-class-xii-computer-science-project-java-programs
Abhishek Jena
 
PDF
How to practice functional programming in react
Netta Bondy
 
Nested micro
Satyamevjayte Haxor
 
VTU Data Structures Lab Manual
Nithin Kumar,VVCE, Mysuru
 
Real world scala
lunfu zhong
 
C++ TUTORIAL 7
Farhan Ab Rahman
 
C++ assignment
Zohaib Ahmed
 
Java JIT Optimization Research
Adam Feldscher
 
Queue oop
Gouda Mando
 
Data structures lab manual
Syed Mustafa
 
Grover's Algorithm
Vijayananda Mohire
 
C programs
Tahir Pasha
 
DSU C&C++ Practical File Diploma
mustkeem khan
 
C++ file
Mukund Trivedi
 
Heap sort &amp; bubble sort
Shanmuga Raju
 
Basic Programs of C++
Bharat Kalia
 
COSCUP: Introduction to Julia
岳華 杜
 
computer notes - Data Structures - 3
ecomputernotes
 
Presentation1 computer shaan
walia Shaan
 
81818088 isc-class-xii-computer-science-project-java-programs
Abhishek Jena
 
How to practice functional programming in react
Netta Bondy
 
Ad

Viewers also liked (10)

PDF
日本Grails/Groovyユーザーグループ
Kiyotaka Oku
 
PDF
Jenkins plugin memo
Kiyotaka Oku
 
PDF
Gaelyk
Kiyotaka Oku
 
PDF
Devsumi Openjam
Kiyotaka Oku
 
PDF
Griffon不定期便〜G*ワークショップ編〜
Kiyotaka Oku
 
PDF
GroovyConsole2
Kiyotaka Oku
 
PDF
Mote Hudson
Kiyotaka Oku
 
PDF
JJUG CCC 2011 Spring
Kiyotaka Oku
 
PDF
JUC2012
Kiyotaka Oku
 
PPTX
Jenkins user conference 東京
Kohsuke Kawaguchi
 
日本Grails/Groovyユーザーグループ
Kiyotaka Oku
 
Jenkins plugin memo
Kiyotaka Oku
 
Gaelyk
Kiyotaka Oku
 
Devsumi Openjam
Kiyotaka Oku
 
Griffon不定期便〜G*ワークショップ編〜
Kiyotaka Oku
 
GroovyConsole2
Kiyotaka Oku
 
Mote Hudson
Kiyotaka Oku
 
JJUG CCC 2011 Spring
Kiyotaka Oku
 
JUC2012
Kiyotaka Oku
 
Jenkins user conference 東京
Kohsuke Kawaguchi
 
Ad

Similar to とある断片の超動的言語 (20)

PPT
An introduction to scala
Mohsen Zainalpour
 
PDF
Scala Functional Patterns
league
 
PDF
java-introduction.pdf
DngTin307322
 
PDF
Java
Sravya221181
 
PDF
Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)
Igalia
 
PDF
Applied Design Patterns - A Compiler Case Study
CodeOps Technologies LLP
 
PDF
JavaSE7 Launch Event: Java7xGroovy
Yasuharu Nakano
 
PDF
Project Fortress
Alex Miller
 
PDF
Frege - consequently functional programming for the JVM
Dierk König
 
PPTX
Programmation fonctionnelle Scala
Slim Ouertani
 
PPTX
Scala
suraj_atreya
 
PDF
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Maarten Mulders
 
PDF
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
CodeFest
 
ODP
Groovy intro for OUDL
J David Beutel
 
PDF
Microsoft word java
Ravi Purohit
 
PDF
Java Reference
khoj4u
 
PDF
Workshop Scala
Bert Van Vreckem
 
KEY
Haskellで学ぶ関数型言語
ikdysfm
 
PDF
A Sceptical Guide to Functional Programming
Garth Gilmour
 
PDF
Functional Programming in Groovy
Evgeny Goldin
 
An introduction to scala
Mohsen Zainalpour
 
Scala Functional Patterns
league
 
java-introduction.pdf
DngTin307322
 
Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)
Igalia
 
Applied Design Patterns - A Compiler Case Study
CodeOps Technologies LLP
 
JavaSE7 Launch Event: Java7xGroovy
Yasuharu Nakano
 
Project Fortress
Alex Miller
 
Frege - consequently functional programming for the JVM
Dierk König
 
Programmation fonctionnelle Scala
Slim Ouertani
 
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Maarten Mulders
 
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
CodeFest
 
Groovy intro for OUDL
J David Beutel
 
Microsoft word java
Ravi Purohit
 
Java Reference
khoj4u
 
Workshop Scala
Bert Van Vreckem
 
Haskellで学ぶ関数型言語
ikdysfm
 
A Sceptical Guide to Functional Programming
Garth Gilmour
 
Functional Programming in Groovy
Evgeny Goldin
 

More from Kiyotaka Oku (15)

PDF
Osaka Venture Meetup #3
Kiyotaka Oku
 
PPTX
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
Kiyotaka Oku
 
PPTX
BaseScriptについて
Kiyotaka Oku
 
PDF
javafx-mini4wd
Kiyotaka Oku
 
PDF
ミニ四駆ジャパンカップで勝つ方法を考える
Kiyotaka Oku
 
PDF
Spockの基礎
Kiyotaka Oku
 
PDF
GDK48総選挙の裏側
Kiyotaka Oku
 
PDF
Jenkins入門
Kiyotaka Oku
 
PDF
Grails/Groovyによる開発事例紹介
Kiyotaka Oku
 
PDF
GroovyConsole
Kiyotaka Oku
 
PDF
Jenkinsプラグインの作り方
Kiyotaka Oku
 
PDF
Jenkins and Groovy
Kiyotaka Oku
 
PDF
Groovy and-hudson2
Kiyotaka Oku
 
PDF
JDO
Kiyotaka Oku
 
PDF
Grails on GAE/J
Kiyotaka Oku
 
Osaka Venture Meetup #3
Kiyotaka Oku
 
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
Kiyotaka Oku
 
BaseScriptについて
Kiyotaka Oku
 
javafx-mini4wd
Kiyotaka Oku
 
ミニ四駆ジャパンカップで勝つ方法を考える
Kiyotaka Oku
 
Spockの基礎
Kiyotaka Oku
 
GDK48総選挙の裏側
Kiyotaka Oku
 
Jenkins入門
Kiyotaka Oku
 
Grails/Groovyによる開発事例紹介
Kiyotaka Oku
 
GroovyConsole
Kiyotaka Oku
 
Jenkinsプラグインの作り方
Kiyotaka Oku
 
Jenkins and Groovy
Kiyotaka Oku
 
Groovy and-hudson2
Kiyotaka Oku
 
Grails on GAE/J
Kiyotaka Oku
 

Recently uploaded (20)

PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Doc9.....................................
SofiaCollazos
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 

とある断片の超動的言語

Editor's Notes