This document provides an overview of JRuby, a Ruby implementation that runs on the Java Virtual Machine. It begins with an agenda, introduces the JRuby developers, provides a brief Ruby tutorial, demonstrates JRuby usage for graphics/games and web applications like Rails, and concludes with a thank you.
It is the slides for COSCUP[1] 2013 Hands-on[2], "Learning Python from Data".
It aims for using examples to show the world of Python. Hope it will help you with learning Python.
[1] COSCUP: http://coscup.org/
[2] COSCUP Hands-on: http://registrano.com/events/coscup-2013-hands-on-mosky
This is the fourteenth (and last for now) set of slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
An introduction into Googles programming language Go, which had its first release in March 2012. The talk has been held at the regulars' table of the GTUG Bremen.
It is the slides for COSCUP[1] 2013 Hands-on[2], "Learning Python from Data".
It aims for using examples to show the world of Python. Hope it will help you with learning Python.
[1] COSCUP: http://coscup.org/
[2] COSCUP Hands-on: http://registrano.com/events/coscup-2013-hands-on-mosky
This is the fourteenth (and last for now) set of slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
An introduction into Googles programming language Go, which had its first release in March 2012. The talk has been held at the regulars' table of the GTUG Bremen.
7 Common mistakes in Go and when to avoid themSteven Francia
I've spent the past two years developing some of the most popular libraries and applications written in Go. I've also made a lot of mistakes along the way. Recognizing that "The only real mistake is the one from which we learn nothing. -John Powell", I would like to share with you the mistakes that I have made over my journey with Go and how you can avoid them.
Given at GopherFest 2015. This is an updated version of the talk I gave in NYC Nov 14 at GothamGo.
“We need to think about failure differently. Most people think mistakes are a necessary evil. Mistakes aren't a necessary evil, they aren't evil at all. They are an inevitable consequence of doing something new and as such should be seen as valuable. “ - Ed Catmull
As Go is a "new" programming language we are all experimenting and learning how to write better Go. While most presentations focus on the destination, this presentation focuses on the journey of learning Go and the mistakes I personally made while developing Hugo, Cobra, Viper, Afero & Docker.
This presentation will give developers an introduction and practical experience
of using MongoDB with the Go language. MongoDB Chief Developer Advocate &
Gopher Steve Francia presents plainly what you need to know about using MongoDB
with Go.
As an emerging language Go is able to start fresh without years of relational database dependencies. Application and library developers are able to build applications using the excellent Mgo MongoDB driver and the reliable go sql package for relational database. Find out why some people claim Go and MongoDB are a “pair made in heaven” and “the best database driver they’ve ever used” in this talk by Gustavo Niemeyer, the author of the mgo driver, and Steve Francia, the drivers team lead at MongoDB Inc.
We will cover:
Connecting to MongoDB in various configurations
Performing basic operations in Mgo
Marshaling data to and from MongoDB
Asynchronous & Concurrent operations
Pre-fetching batches for seamless performance
Using GridFS
How MongoDB uses Mgo internally
This presentation was given as a Workshop at OSCON 2014.
New to Go? This tutorial will give developers an introduction and practical
experience in building applications with the Go language. Gopher Steve Francia,
Author of [Hugo](http://hugo.spf13.com),
[Cobra](http://github.com/spf13/cobra), and many other popular Go packages
breaks it down step by step as you build your own full featured Go application.
Starting with an introduction to the Go language. He then reviews the fantastic
go tools available. With our environment ready we will learn by doing. The
remainder of the time will be dedicated to building a working go web and cli
application. Through our application development experience we will introduce
key features, libraries and best practices of using Go.
This tutorial is designed with developers in mind. Prior experience with any of the
following languages: ruby, perl, java, c#, javascript, php, node.js, or python
is preferred. We will be using the MongoDB database as a backend for our
application.
We will be using/learning a variety of libraries including:
* bytes and strings
* templates
* net/http
* io, fmt, errors
* cobra
* mgo
* Gin
* Go.Rice
* Cobra
* Viper
This is the thirteenth set of slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
OSCON2014 : Quick Introduction to System Tools Programming with GoChris McEniry
OSCON2014 Tutorial : Quick Introduction to System Tools Programming with Go
Every day, sysadmins are required to work with tools which, while powerful, tend to need to be merged with other languages. Many times, tools are chained together out of necessity by attempting to parse and munge outputs to inputs by making many inefficient calls to string processing command line tools. While effective, this approach is not usable in many situations due to the frequency of the run of the operation, or due to the footprint of the solution. Sometimes, it’s necessary to build your own tool, and the busy sysadmin needs one that is readily available.
Go’s powerful yet simple language makes it an excellent tool for harried sysadmins with limited time. Go’s toolset makes it easy to build and deploy simple small tools to targeted situations.
This tutorial provides an introduction to Go with a focus on using it for everyday sysadmins tooling. A example of working from iostat is used to show a practical approach to learning the language.
Every day, sysadmins find the need to build tools that get the job done in a fast and efficient way. Go is a new and powerful—yet simple—language that is an excellent fit for the needs of the harried sysadmin. This tutorial provides an introduction to Go with a focus on using it for everday tooling.
Topics include:
Understanding of the applicability of Go to everyday work
The Go environment and toolset
Go language fundamentals:
Control Structures
Functions
Data Types
Methods and Interfaces
Goroutines
Channels
Examples in Go:
Email
Web Server
Directory Tools
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Steven Francia
Object Oriented (OO) programming has dominated software engineering for the last two decades. The paradigm built on powerful concepts such as Encapsulation, Inheritance, and Polymoprhism has been internalized by the majority of software engineers. Although Go is not OO in the strict sense, we can continue to leverage the skills we’ve honed as OO engineers to come up with simple and solid designs.
Gopher Steve Francia, Author of
[Hugo](http://hugo.spf13.com), [Cobra](http://github.com/spf13/cobra), and many
other popular Go packages makes these difficult concepts accessible for everyone.
If you’re a OO programmer, especially one with a background with dynamic languages and are curious about go then this talk is for you. We will cover everything you need to know to leverage your existing skills and quickly start coding in go including:
How to use our Object Oriented programming fundamentals in go
Static and pseudo dynamic typing in go
Building fluent interfaces in go
Using go interfaces and duck typing to simplify architecture
Common mistakes made by those coming to go from other OO languages (Ruby, Python, Javascript, etc.),
Principles of good design in go.
7 Common mistakes in Go and when to avoid themSteven Francia
I've spent the past two years developing some of the most popular libraries and applications written in Go. I've also made a lot of mistakes along the way. Recognizing that "The only real mistake is the one from which we learn nothing. -John Powell", I would like to share with you the mistakes that I have made over my journey with Go and how you can avoid them.
Given at GopherFest 2015. This is an updated version of the talk I gave in NYC Nov 14 at GothamGo.
“We need to think about failure differently. Most people think mistakes are a necessary evil. Mistakes aren't a necessary evil, they aren't evil at all. They are an inevitable consequence of doing something new and as such should be seen as valuable. “ - Ed Catmull
As Go is a "new" programming language we are all experimenting and learning how to write better Go. While most presentations focus on the destination, this presentation focuses on the journey of learning Go and the mistakes I personally made while developing Hugo, Cobra, Viper, Afero & Docker.
This presentation will give developers an introduction and practical experience
of using MongoDB with the Go language. MongoDB Chief Developer Advocate &
Gopher Steve Francia presents plainly what you need to know about using MongoDB
with Go.
As an emerging language Go is able to start fresh without years of relational database dependencies. Application and library developers are able to build applications using the excellent Mgo MongoDB driver and the reliable go sql package for relational database. Find out why some people claim Go and MongoDB are a “pair made in heaven” and “the best database driver they’ve ever used” in this talk by Gustavo Niemeyer, the author of the mgo driver, and Steve Francia, the drivers team lead at MongoDB Inc.
We will cover:
Connecting to MongoDB in various configurations
Performing basic operations in Mgo
Marshaling data to and from MongoDB
Asynchronous & Concurrent operations
Pre-fetching batches for seamless performance
Using GridFS
How MongoDB uses Mgo internally
This presentation was given as a Workshop at OSCON 2014.
New to Go? This tutorial will give developers an introduction and practical
experience in building applications with the Go language. Gopher Steve Francia,
Author of [Hugo](http://hugo.spf13.com),
[Cobra](http://github.com/spf13/cobra), and many other popular Go packages
breaks it down step by step as you build your own full featured Go application.
Starting with an introduction to the Go language. He then reviews the fantastic
go tools available. With our environment ready we will learn by doing. The
remainder of the time will be dedicated to building a working go web and cli
application. Through our application development experience we will introduce
key features, libraries and best practices of using Go.
This tutorial is designed with developers in mind. Prior experience with any of the
following languages: ruby, perl, java, c#, javascript, php, node.js, or python
is preferred. We will be using the MongoDB database as a backend for our
application.
We will be using/learning a variety of libraries including:
* bytes and strings
* templates
* net/http
* io, fmt, errors
* cobra
* mgo
* Gin
* Go.Rice
* Cobra
* Viper
This is the thirteenth set of slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
OSCON2014 : Quick Introduction to System Tools Programming with GoChris McEniry
OSCON2014 Tutorial : Quick Introduction to System Tools Programming with Go
Every day, sysadmins are required to work with tools which, while powerful, tend to need to be merged with other languages. Many times, tools are chained together out of necessity by attempting to parse and munge outputs to inputs by making many inefficient calls to string processing command line tools. While effective, this approach is not usable in many situations due to the frequency of the run of the operation, or due to the footprint of the solution. Sometimes, it’s necessary to build your own tool, and the busy sysadmin needs one that is readily available.
Go’s powerful yet simple language makes it an excellent tool for harried sysadmins with limited time. Go’s toolset makes it easy to build and deploy simple small tools to targeted situations.
This tutorial provides an introduction to Go with a focus on using it for everyday sysadmins tooling. A example of working from iostat is used to show a practical approach to learning the language.
Every day, sysadmins find the need to build tools that get the job done in a fast and efficient way. Go is a new and powerful—yet simple—language that is an excellent fit for the needs of the harried sysadmin. This tutorial provides an introduction to Go with a focus on using it for everday tooling.
Topics include:
Understanding of the applicability of Go to everyday work
The Go environment and toolset
Go language fundamentals:
Control Structures
Functions
Data Types
Methods and Interfaces
Goroutines
Channels
Examples in Go:
Email
Web Server
Directory Tools
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Steven Francia
Object Oriented (OO) programming has dominated software engineering for the last two decades. The paradigm built on powerful concepts such as Encapsulation, Inheritance, and Polymoprhism has been internalized by the majority of software engineers. Although Go is not OO in the strict sense, we can continue to leverage the skills we’ve honed as OO engineers to come up with simple and solid designs.
Gopher Steve Francia, Author of
[Hugo](http://hugo.spf13.com), [Cobra](http://github.com/spf13/cobra), and many
other popular Go packages makes these difficult concepts accessible for everyone.
If you’re a OO programmer, especially one with a background with dynamic languages and are curious about go then this talk is for you. We will cover everything you need to know to leverage your existing skills and quickly start coding in go including:
How to use our Object Oriented programming fundamentals in go
Static and pseudo dynamic typing in go
Building fluent interfaces in go
Using go interfaces and duck typing to simplify architecture
Common mistakes made by those coming to go from other OO languages (Ruby, Python, Javascript, etc.),
Principles of good design in go.
An overview of Ruby, jRuby, Rails, Torquebox, and PostgreSQL that was presented as a 3 hour class to other programmers at The Ironyard (http://theironyard.com) in Greenville, SC in July of 2013. The Rails specific sections are mostly code samples that were explained during the session so the real focus of the slides is Ruby, "the rails way" / workflow / differentiators and PostgreSQL.
Elixir and Crystal are both descendants of the Ruby programming language, applying Ruby syntax and ideas to extremely different functional and OOP foundations. This talk compares all three languages and suggests appropriate cases for applying them.
A quick introduction to the object-oriented programming language Ruby, part of a full lecture on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme.
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
1. JRuby
Charles Oliver Nutter
JRuby Guy
Sun Microsystems
Except where otherwise noted, the content of this presentation is licensed under
the Creative Commons AttributionShare Alike 3.0 United States License (http://creativecommons.org/licenses/bysa/3.0/us/).
1
2. Agenda
• Ruby and JRuby overview
> Facts and figures
> Short Ruby tutorial
• Real-world JRuby
> Graphics and games
> Web applications
> GUI programming
• Interactive: what do you want to know?
2
3. The JRuby Guys
• Charles Oliver Nutter and Thomas Enebo
• Longtime Java developers (10+ yrs each)
• Engineers at Sun Microsystems for 2 years
• Full-time JRuby developers
• Also working on JVM dynlang support
• Wide range of past experience
> C, C++, C#, Perl, Python, Delphi, Lisp, Scheme
> Java EE and ME, JINI, WS
3
4. What Is Ruby
• Dynamic-typed, pure OO language
> Interpreted
> Open source, written in C
> Good: easy to write, easy to read, powerful,
“fun”
> Bad: green threads, unicode support, libraries,
“slow”
• Created 1993 by Yukihiro “Matz” Matsumoto
> “More powerful than Perl and more OO than
Python”
• Very active community, wide range of apps
• Ruby 1.8.x is current, 1.9 is in development
4
6. Ruby Conferences in 2008
RubyConf, RailsConf, RailsConf EU,
acts_as_conference, Euruko, Ruby Kaigi, Mountain
West RubyConf, eRubyCon, Ruby Hoedown,
Amsterdam Ruby en Rails, Scotland on Rails,
RubyFools Copenhagen, RubyFools Oslo, Voices that
Matter, South Carolina Ruby Conference, Lone Star
RubyConf, RuPy, Gotham Ruby Conference, Silicon
Valley Ruby Conference, RubyCamp, Conferencia
Rails, Rails Summit Latin America, Ruby Manor,
Atlanta Merb Day, ...
6
7. Ruby Books in 2008
NetBeans™ Ruby and Rails IDE with JRuby, Learning
Rails, Rails for .NET Developers, Wicked Cool Ruby
Scripts, JRuby Cookbook, Enterprise Recipes with Ruby
and Rails, Developing Facebook Platform Applications
with Rails, Foundation Rails 2, Enterprise Rails, Ruby On
Rails Bible, Rails: Up and Running, Rails Pocket
Reference, Ruby Phrasebook, Scripted GUI Testing with
Ruby, Aptana RadRails, Advanced Rails Recipes,
Deploying Rails Applications, The Art of Rails, Simply Rails
2, Practical REST on Rails 2 Projects, Ruby on Rails Web
Mashup Projects, FXRuby: Create Lean and Mean GUIs
with Ruby, RailsSpace, Ferret, Professional Ruby on Rails,
Ruby: The Programming Language, Rails for PHP
Developers, Pulling Strings with Puppet, Practical
Reporting with Ruby and Rails, The Ruby Programming
Language, Design Patterns in Ruby, Advanced Rails
7
8. JRuby
• Java implementation of Ruby language
> “It's just Ruby!”
• Started in 2002, open source, many contributors
> Ola Bini, Marcin Mielzynsky, Nick Sieger,
Vladimir Sizikov, MenTaLguY, Wayne Meissner
• Aiming for compatibility with current Ruby version
> Ruby 1.8.6
• Improvements on Ruby
> Native threading, better performance, many
libraries
8
9. Ruby Quick Tour: Pure OO
• Everything is an Object
> Circle.new(4) => instance of Circle
> “abc”.length => 3
> 1.to_s => “1”
• All Objects are instances of Classes
> 1.class => Fixnum
• Single-Inheritance
• Object is base class of all classes
9
11. Ruby Quick Tour: Basics
• String interpolation
> a = “foo”
> b = “bar#{a}baz” => “barfoobaz”
• Operator overloading
> def +(arg); ...
• Attributes
> class Foo
attr_accessor :a
end
x = Foo.new
x.a = “hello”
puts x.a => “hello”
11
12. Ruby Quick Tour: Duck Typing
• Dynamic typing
• “If it waddles like a duck and it quacks like a
duck...”
def make_it_waddle(waddler)
waddler.waddle
end
make_it_waddle(Duck.new)
make_it_waddle(Penguin.new)
make_it_waddle(Octopus.new)
• Runtime errors rarely happen
> Unit testing helps prevent them
12
13. Ruby Quick Tour: A Simple Class
cl ass H l o
el
# i ni t i al i ze i s Ruby' s const r uct or
def i ni t i al i ze( message)
@ essage = m
m essage
end
def pr i nt
# i nser t t he @ essage i nt o a st r i ng
m
put s " Hel l o # m
{@ essage}"
end
end
# const r uct a Hel l o obj ect
hel l o = H l o. new " Devoxx! " )
el (
hel l o. pr i nt
13
14. Ruby Quick Tour: Blocks/Closures
# t w f or m s: br aces {} and do . . end
o at
[ 1, 2, 3] . each {| num | put s “I see #
ber {num }“ }
ber
[ 1, 2, 3] . each do | num |
ber
put s “I see # {num }“
ber
end
# m hods t hat accept bl ocks
et
def f oo
yi el d “hel l o“
end
def f oo2( &bl ock)
bl ock. cal l ( “hel l o“)
end
14
15. Ruby Quick Tour: Modules
# A col l ect i on of obj ect s
cl ass M oduct s
yPr
# Enum abl e pr ovi des i t er at i on m hods
er et
i ncl ude Enum abl e
er
# def i ne an ' each' m hod t hat i t er at es
et
def each
# yi el d each el ement i n t ur n
end
end
l i st = M oduct s. new
yPr
l i st . sel ect {| i t em i t em pr i ce > 5. 00}
| .
l i st . sor t {| a, b| a. nam < > b. nam
e = e}
l i st . max
15
16. Ruby Quick Tour: RubyGems
• Ruby's packaging system
> Think CPAN, Maven, apt, rpm
• Shipped with JRuby
> Step 1: unpack JRuby
> Step 2 (optional): add 'bin' to PATH
> Step 3: bin/gem install <whatever_you_desire>
> You're ready to go!
• All major Ruby projects are in gems
> Look for 'gem install ....' in upcoming slides
16
17. Where is JRuby being used?
• Graphics and Games
> Ruby + graphics = cool
• JRuby on Rails
> Better deployment options, better performance
• GUI development
> Makes Swing much nicer to use, easier to
handle
17
18. Ruby-Processing
• “Processing is an open source programming
language and environment for people who want
to program images, animation, and interactions.”
> Basically a cool Java library for 2D graphics
• Ruby-Processing wraps Processing with JRuby
> Cool, rubified 2D graphics environment for you
> Eye-candy demos for us
> Thanks to Jeremy Ashkenas for putting these
together
18
21. Web Applications: Ruby on Rails
• A Full-stack MVC web development framework
• Open Source (MIT), Many Contributors
• Written entirely in Ruby
• First released in 2004
• Growing popularity
> RailsConf attendance: 500, 1000, 2500 since
2006
> Four Rails books downstairs (and more Ruby
books)
> Hundreds of job postings and growing fast
21
22. Rails Precepts
• Convention over Configuration
> Why punish the common cases?
> Encourages standard practices
> Everything simpler and smaller
• Don't Repeat Yourself (DRY)
> Framework written around minimizing
repetition
> Repetitive code harmful to adaptability
• Agile Development Environment
> No recompile, deploy, restart cycles
> Simple tools to generate code quickly
> Testing built into framework
22
23. The Rails Way: Controllers
# app/ cont r ol l er s/ per son_ cont r ol l er . r b
cl ass Per sonCont r ol l er < Appl i cat i onCont r ol l er
ver i f y : m hod = : post ,
et >
: onl y = [ : cr eat e, : updat e, : del et e]
>
Rails
def l i st Example
@ l _ peopl e = Per son. f i nd : al l
al
end
al i as : i ndex : l i st
def updat e
@ r y = Per son. f i nd( par am : i d] )
ent s[
@ r y. updat e_ at t r i but es( par am : per son] )
ent s[
r edi r ect _ t o : act i on = ' l i st '
>
end
...
23
24. The Rails Way: Views
< - - app/ vi ew per son/ l i st . r ht m - - >
! s/ l
< abl e>
t
< r>
t
< f or col um i n Per son. cont ent _ col um %
% n ns >
< h> % col um hum nam % < t h>
t <= n. an_ e >/
< end %
% >
< tr>
/ Rails
< f or per son i n @
% peopl e % > Example
< r>
t
< f or col um i n Per son. cont ent _ col um %
% n ns >
< d> % h per son. send( col um nam % < t d>
t <= n. e) > /
< end %
% >
< d> % l i nk_ t o ' Show , : act i on = ' show , : i d = per son % < t d>
t <= ' > ' > >/
< d> % l i nk_ t o ' Edi t ' , : act i on = ' edi t ' , : i d = per son % < t d>
t <= > > >/
< d> % l i nk_ t o ' D
t <= est r oy' , { : act i on = ' dest r oy' , : i d = per son },
> >
: conf i r m = ' Ar e you sur e?' , : m hod = : post % < t d>
> et > >/
< tr>
/
< end %
% >
< t abl e>
/
< = l i nk_ t o ' Pr evi ous page' , { : page = @ son_ pages. cur r ent . pr evi ous } i f
% > per
@ son_pages. cur r ent . pr evi ous %
per >
< = l i nk_ t o ' N
% ext page' , { : page = @ son_ pages. cur r ent . next } i f
> per
@ son_pages. cur r ent . next %
per >
24
25. The Rails Way: Persistence
# connect t o t he dat abase
Act i veRecor d: : Base. est abl i sh_connect i on(
: adapt er = "m
> ysql ", : dat abase = "m
> ydb",
: host = "l ocal host ", : user nam = "m
> e > ydb_user ",
: passw d = "f oo" )
or >
# cr eat e a model obj ect
cl ass Cont act < Act i veRecor d: : Base
end
# per si st !
Cont act . cr eat e "nam = "Char l es N t er ",
e" > ut
"t i t l e" = "J Ruby D
> evel oper "
Cont act . cr eat e "nam = "Thom Enebo", "t i t l e" = "J Ruby D
e" > as > evel oper "
# quer y
Cont act . f i nd( : al l ) . each {| c| put s c. name}
nut t er = Cont act . f i nd_by_ nam "Char l es N t er ")
e( ut
Rails
# updat e
nut t er . t i t l e = "D k O
ar ver l ord of t he U ver se"
ni
Example
nut t er . save
25
27. Production JRuby on Rails
• Sun's Kenai.com – project hosting site
> www.kenai.com
• Oracle's Mix – digg-like social customer site
> mix.oracle.com
• ThoughtWorks' Mingle – collaborative project
mgmt
> mingle.thoughtworks.com
• Trisano – infectious disease tracking for US gov'ts
> www.trisano.org
• Many others in government, large biz, telecom
27
28. GUI Programming
• Swing API is very large, complex
> Ruby magic simplifies most of the tricky bits
• Java is a very verbose language
> Ruby makes Swing actually fun
• No consistent cross-platform GUI library for Ruby
> Swing works everywhere Java does
(everywhere)
• No fire-and-forget execution
> No dependencies: any script works on any
JRuby install
28