This document appears to be a presentation about bridging JavaScript and Ruby using a tool called Johnson. Some key points:
- Johnson allows using JavaScript from Ruby and vice versa by creating proxies between the two languages so that objects can be accessed across the runtimes.
- This allows things like accessing Ruby classes and methods from JavaScript, running JavaScript functions from Ruby, and integrating the two languages more tightly together like accessing Ruby gems and frameworks from JavaScript.
- Examples are given of database access, Rails views, and debugging tools like breakpoints that work across the languages using Johnson. The tool aims to free JavaScript from the browser and make it easier to experiment and test.
The document discusses Automatic Reference Counting (ARC) in Objective-C, including how it manages memory by retaining and releasing objects. It covers key ARC concepts like strong and weak references, nil assignment, autorelease pools, and how ARC eliminated the need for manual memory management with retain, release, and autorelease. The document also provides examples of how memory management differs between non-ARC and ARC code.
Everything is Permitted: Extending Built-insAndrew Dupont
Adding methods to built-in objects: it’s one of JavaScript’s most powerful features. It’s also a great way to offend the sensibilities of your colleagues. We all hear that it’s irresponsible, that it’s sloppy, that it’s flat-out bad practice and should be avoided.
I’m tired of this one-sided battle. In this talk, I’m going to push back against whatever blog post you read that told you that extending built-ins was unconditionally and universally bad. I’m gonna go all Howard Beale on your asses.
My Favourite 10 Things about Xcode/ObjectiveCJohnKennedy
The document provides a summary of the author's favorite Xcode and Objective-C techniques. It discusses 10 techniques including: 1) Xcode keyboard shortcuts; 2) dragging from the NIB editor into header files; 3) useful NSString initialization; 4) useful NSString comparisons; 5) testing if a file exists; 6) time delay before method call; 7) delegate callback to parent AppDelegate; 8) using delegates to perform actions when a modal dialog closes; 9) two-part animation blocks; and 10) using UICollections, tags and iOS 5. For each technique, it provides an example code snippet and a brief explanation of when and how to use the technique.
The document is a presentation about Node.js, CoffeeScript, and real-time web technologies. It introduces Node.js as an event-driven JavaScript runtime, not a framework or programming language. It discusses getting started with Node.js and libraries like NPM. It also covers CoffeeScript as a language that compiles to clean JavaScript and introduces syntactic sugar. Finally, it discusses challenges with real-time web technologies and solutions like WebSocket, Socket.io, and Pusher.
This document discusses Tkinter, a GUI toolkit for Python. It provides examples of basic Tkinter code for common widgets like buttons, labels, entries and more. It also covers Tkinter concepts like packing, grids, styling with themes, and events. The document seeks to demonstrate that Tkinter is simple to use yet robust, with a rich set of widgets and capabilities.
This document discusses ways to optimize and speed up test suites. It recommends aggregating tests to run them together more efficiently, using databases strategically to avoid rebuilding them for each test, and leveraging tools like Test::Aggregate and Test::Most. Running tests in parallel using 'prove -j' can significantly reduce test suite runtime. Test coverage tools like Devel::CoverX::Covered can help identify which tests cover different parts of code. Overall, the document presents several techniques for analyzing and improving test suite performance.
The document summarizes Tim Wright's presentation on the future of HTML5. It discusses emerging technologies like Web Workers for improved JavaScript threading, WebGL for 3D graphics in the browser, and Device APIs for accessing device capabilities. While some of these are still works in progress, they have the potential to enhance the user experience and push the capabilities of the web platform. Wright encourages the audience to get involved in developing these new standards.
The document discusses Automatic Reference Counting (ARC) in Objective-C, including how it manages memory by retaining and releasing objects. It covers key ARC concepts like strong and weak references, nil assignment, autorelease pools, and how ARC eliminated the need for manual memory management with retain, release, and autorelease. The document also provides examples of how memory management differs between non-ARC and ARC code.
Everything is Permitted: Extending Built-insAndrew Dupont
Adding methods to built-in objects: it’s one of JavaScript’s most powerful features. It’s also a great way to offend the sensibilities of your colleagues. We all hear that it’s irresponsible, that it’s sloppy, that it’s flat-out bad practice and should be avoided.
I’m tired of this one-sided battle. In this talk, I’m going to push back against whatever blog post you read that told you that extending built-ins was unconditionally and universally bad. I’m gonna go all Howard Beale on your asses.
My Favourite 10 Things about Xcode/ObjectiveCJohnKennedy
The document provides a summary of the author's favorite Xcode and Objective-C techniques. It discusses 10 techniques including: 1) Xcode keyboard shortcuts; 2) dragging from the NIB editor into header files; 3) useful NSString initialization; 4) useful NSString comparisons; 5) testing if a file exists; 6) time delay before method call; 7) delegate callback to parent AppDelegate; 8) using delegates to perform actions when a modal dialog closes; 9) two-part animation blocks; and 10) using UICollections, tags and iOS 5. For each technique, it provides an example code snippet and a brief explanation of when and how to use the technique.
The document is a presentation about Node.js, CoffeeScript, and real-time web technologies. It introduces Node.js as an event-driven JavaScript runtime, not a framework or programming language. It discusses getting started with Node.js and libraries like NPM. It also covers CoffeeScript as a language that compiles to clean JavaScript and introduces syntactic sugar. Finally, it discusses challenges with real-time web technologies and solutions like WebSocket, Socket.io, and Pusher.
This document discusses Tkinter, a GUI toolkit for Python. It provides examples of basic Tkinter code for common widgets like buttons, labels, entries and more. It also covers Tkinter concepts like packing, grids, styling with themes, and events. The document seeks to demonstrate that Tkinter is simple to use yet robust, with a rich set of widgets and capabilities.
This document discusses ways to optimize and speed up test suites. It recommends aggregating tests to run them together more efficiently, using databases strategically to avoid rebuilding them for each test, and leveraging tools like Test::Aggregate and Test::Most. Running tests in parallel using 'prove -j' can significantly reduce test suite runtime. Test coverage tools like Devel::CoverX::Covered can help identify which tests cover different parts of code. Overall, the document presents several techniques for analyzing and improving test suite performance.
The document summarizes Tim Wright's presentation on the future of HTML5. It discusses emerging technologies like Web Workers for improved JavaScript threading, WebGL for 3D graphics in the browser, and Device APIs for accessing device capabilities. While some of these are still works in progress, they have the potential to enhance the user experience and push the capabilities of the web platform. Wright encourages the audience to get involved in developing these new standards.
Esteban Lorenzano presents Reef, a Javascript/Ajax component framework for Seaside. Reef allows developers to build Ajax interactions into Seaside applications using a transparent component model. It uses a dispatcher architecture with jQuery and supports callbacks, context, decorations, and plugins to extend components. Developers are encouraged to try Reef and provide feedback.
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)OpenBlend society
This document summarizes new features being added to Java SE 7, including Project Coin which aims to make small improvements to the Java language. Some changes discussed are binary and underscored number literals, string switches, simplified generics using the diamond operator, and try-with-resources for automatic resource management to simplify file copying and closing streams. The goals are to evolve Java cautiously while growing adoption and maintaining a unified language.
This document summarizes new features being added to Java SE 7, including Project Coin which aims to make small improvements to the Java language. Some changes discussed are binary and underscored number literals, string switches, simplified generics using the diamond operator, and try-with-resources for automatic resource management to simplify file copying and closing streams. The goals are to evolve Java cautiously while growing adoption and maintaining a unified language.
2009, o ano do Ruby on Rails no Brasil - CaelumDay 2009Caue Guerra
This document discusses the growth of Ruby on Rails in Brazil in 2009. It highlights some key events and trends that contributed to Rails gaining popularity in Brazil that year, such as more training courses being offered on Rails and more job postings requiring Rails skills. It also showcases success stories of Brazilian companies using Rails to build their web applications.
The document provides an overview of HTML5 including:
- A brief history of HTML standards from 1991 to the development of HTML5 in 2009.
- An explanation that HTML5 is intended as a replacement for older HTML and XHTML standards.
- A preview of some new features covered in HTML5 like video, audio, canvas, forms, local storage and web workers.
This document summarizes a presentation about JavaFX. It includes an introduction that discusses JavaFX's history and background, as well as past troubles. The presentation also covers the theory behind JavaFX, including its syntax and language features, which are similar to Java but also include declarative notation and binding. The agenda concludes with a showcase of JavaFX.
Mais uma introdução à filosofia das comunidades Ruby e Rails, com ênfase no Ecossistema mais do que na Tecnologia.
Vídeo da 37signals: http://www.vimeo.com/6028818
Vídeo do Uncle Bob: http://www.vimeo.com/5196176
This document provides an overview and agenda for a presentation on class construction using the Prototype JavaScript framework. The topics to be covered include a basic JavaScript refresher, an overview of the Ruby object model to help understand Prototype's implementation, different types of JavaScript code organization, Prototype class construction techniques, and a review of the HomeMarks v2.0 application which utilizes Prototype for object-oriented programming in JavaScript.
The document discusses best practices for submitting bug reports, including providing context about the issue, reproducing the problem, and submitting a patch with a proposed fix. It recommends searching existing databases first, building the project from source code, reducing the problem to a minimal test case, precisely recreating the issue on different browsers and platforms, and including all relevant technical details in the report. Clear communication and examples are emphasized.
The document discusses the core technologies that power the modern web, including HTML, CSS, JavaScript, and the browser. It explains how browsers retrieve and display webpages, with JavaScript code being executed as the page is parsed in order to dynamically update the DOM tree and potentially trigger layout changes. The document presents JavaScript as a dynamic and untyped language in the tradition of Lisp and Self, with support for objects, closures, and first-class functions.
This document provides an overview of Java and Ruby on Rails and how they can be combined using JRuby and TorqueBox. It discusses how TorqueBox allows Ruby on Rails applications to take advantage of features of the JBoss application server like clustering, caching using Infinispan, and load balancing with mod_cluster. The document demonstrates how to install and configure TorqueBox and deploy a Rails application that leverages aspects of the Java platform.
How I stopped worrying about and loved DumpRenderTreeHajime Morrita
The document discusses how the author stopped worrying and loved DumpRenderTree (DRT), a tool used for testing WebKit. It identifies three main test smells in WebKit tests: 1) obscure tests that are difficult to understand, 2) fragile tests that break easily due to minor changes, and 3) high test maintenance costs due to issues like managing golden files for each platform. It provides examples of how DRT addresses these smells through features like outputting test results as text and evaluating DOM properties with JavaScript.
The document discusses JavaScript and why it is misunderstood. It covers how JavaScript is object-oriented despite appearing procedural, uses functions as first-class objects, and has closures. Early versions had bugs and did not respect standards, but modern JavaScript is a full object-oriented language. The document also discusses JavaScript's loose typing, objects and prototypes, performance issues related to interpretation and scope chains, and memory leaks from circular references.
This document contains the slides from a presentation about MacRuby. It discusses key aspects of MacRuby including its use of LLVM, ahead-of-time and just-in-time compilation, integration with Cocoa and Objective-C, lack of a global interpreter lock, Grand Central Dispatch API, debugger, ability to create compiled libraries and applications, and potential uses like building App Store apps. Examples are provided of using MacRuby with features like speech synthesis, location services, and the address book.
The document discusses MongoDB and its features. It covers getting started with MongoDB using the Ruby driver, using rich documents with complex objects and dynamic queries, map reduce for aggregation, indexing, GridFS for file storage, replication with replica sets, auto-sharding, pros and cons, common use cases, and provides links for additional resources.
This document discusses Ruby on Rails and some of its interesting features. It begins with an introduction to Rails, covering its model-view-controller architecture and agile development approach. Next, it highlights several small but useful Rails features, including the console, debugger, HAML template engine, and SASS stylesheet language. It also mentions database migrations and schema files. The document aims to provide an overview of Rails and showcase some of the reasons developers enjoy working with the framework.
This document is a presentation about the TorqueBox framework. It introduces TorqueBox as providing the power of JBoss with the expressiveness of Ruby. It then summarizes TorqueBox's capabilities such as deployment, scheduling jobs, messaging, dependency injection, caching, clustering, and distributed caching. The presentation encourages attendees to engage with the TorqueBox community on IRC and social media.
This document provides an introduction and overview of Play 2.1. It discusses how Play 2 was rebuilt with Scala and is now part of the Typesafe Framework. It also summarizes some of Play 2's key features like asynchronous programming, streaming, websockets, and Comet capabilities. The document compares Play 2's defaults to Rails and shows examples of Play controllers, asynchronous results, Comet sockets, scheduling tasks, and its use of JBoss Netty.
This document discusses JavaScript code architecture and module patterns using RequireJS. It begins with an introduction to RequireJS and how it can be used to dynamically load modules and their dependencies. Next, it covers defining modules with and without dependencies, and how to return maker functions from modules to create "classes". The document concludes with notes on best practices for modules and an overview of RequireJS configuration options to integrate third-party libraries.
Do you write JavaScript? Congratulations, you're probably awesome at Node.js! While thinking about things from a server-side perspective might feel off-putting and unnatural, things like callbacks, storing data in JSON, and implementing actual websites probably do not. We'll go beyond getting Node installed and talk about how to quickly build a working web application, and demonstrate that Node can offer frontend developers more than just a new prototyping tool or way of creating endless chat servers.
Esteban Lorenzano presents Reef, a Javascript/Ajax component framework for Seaside. Reef allows developers to build Ajax interactions into Seaside applications using a transparent component model. It uses a dispatcher architecture with jQuery and supports callbacks, context, decorations, and plugins to extend components. Developers are encouraged to try Reef and provide feedback.
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)OpenBlend society
This document summarizes new features being added to Java SE 7, including Project Coin which aims to make small improvements to the Java language. Some changes discussed are binary and underscored number literals, string switches, simplified generics using the diamond operator, and try-with-resources for automatic resource management to simplify file copying and closing streams. The goals are to evolve Java cautiously while growing adoption and maintaining a unified language.
This document summarizes new features being added to Java SE 7, including Project Coin which aims to make small improvements to the Java language. Some changes discussed are binary and underscored number literals, string switches, simplified generics using the diamond operator, and try-with-resources for automatic resource management to simplify file copying and closing streams. The goals are to evolve Java cautiously while growing adoption and maintaining a unified language.
2009, o ano do Ruby on Rails no Brasil - CaelumDay 2009Caue Guerra
This document discusses the growth of Ruby on Rails in Brazil in 2009. It highlights some key events and trends that contributed to Rails gaining popularity in Brazil that year, such as more training courses being offered on Rails and more job postings requiring Rails skills. It also showcases success stories of Brazilian companies using Rails to build their web applications.
The document provides an overview of HTML5 including:
- A brief history of HTML standards from 1991 to the development of HTML5 in 2009.
- An explanation that HTML5 is intended as a replacement for older HTML and XHTML standards.
- A preview of some new features covered in HTML5 like video, audio, canvas, forms, local storage and web workers.
This document summarizes a presentation about JavaFX. It includes an introduction that discusses JavaFX's history and background, as well as past troubles. The presentation also covers the theory behind JavaFX, including its syntax and language features, which are similar to Java but also include declarative notation and binding. The agenda concludes with a showcase of JavaFX.
Mais uma introdução à filosofia das comunidades Ruby e Rails, com ênfase no Ecossistema mais do que na Tecnologia.
Vídeo da 37signals: http://www.vimeo.com/6028818
Vídeo do Uncle Bob: http://www.vimeo.com/5196176
This document provides an overview and agenda for a presentation on class construction using the Prototype JavaScript framework. The topics to be covered include a basic JavaScript refresher, an overview of the Ruby object model to help understand Prototype's implementation, different types of JavaScript code organization, Prototype class construction techniques, and a review of the HomeMarks v2.0 application which utilizes Prototype for object-oriented programming in JavaScript.
The document discusses best practices for submitting bug reports, including providing context about the issue, reproducing the problem, and submitting a patch with a proposed fix. It recommends searching existing databases first, building the project from source code, reducing the problem to a minimal test case, precisely recreating the issue on different browsers and platforms, and including all relevant technical details in the report. Clear communication and examples are emphasized.
The document discusses the core technologies that power the modern web, including HTML, CSS, JavaScript, and the browser. It explains how browsers retrieve and display webpages, with JavaScript code being executed as the page is parsed in order to dynamically update the DOM tree and potentially trigger layout changes. The document presents JavaScript as a dynamic and untyped language in the tradition of Lisp and Self, with support for objects, closures, and first-class functions.
This document provides an overview of Java and Ruby on Rails and how they can be combined using JRuby and TorqueBox. It discusses how TorqueBox allows Ruby on Rails applications to take advantage of features of the JBoss application server like clustering, caching using Infinispan, and load balancing with mod_cluster. The document demonstrates how to install and configure TorqueBox and deploy a Rails application that leverages aspects of the Java platform.
How I stopped worrying about and loved DumpRenderTreeHajime Morrita
The document discusses how the author stopped worrying and loved DumpRenderTree (DRT), a tool used for testing WebKit. It identifies three main test smells in WebKit tests: 1) obscure tests that are difficult to understand, 2) fragile tests that break easily due to minor changes, and 3) high test maintenance costs due to issues like managing golden files for each platform. It provides examples of how DRT addresses these smells through features like outputting test results as text and evaluating DOM properties with JavaScript.
The document discusses JavaScript and why it is misunderstood. It covers how JavaScript is object-oriented despite appearing procedural, uses functions as first-class objects, and has closures. Early versions had bugs and did not respect standards, but modern JavaScript is a full object-oriented language. The document also discusses JavaScript's loose typing, objects and prototypes, performance issues related to interpretation and scope chains, and memory leaks from circular references.
This document contains the slides from a presentation about MacRuby. It discusses key aspects of MacRuby including its use of LLVM, ahead-of-time and just-in-time compilation, integration with Cocoa and Objective-C, lack of a global interpreter lock, Grand Central Dispatch API, debugger, ability to create compiled libraries and applications, and potential uses like building App Store apps. Examples are provided of using MacRuby with features like speech synthesis, location services, and the address book.
The document discusses MongoDB and its features. It covers getting started with MongoDB using the Ruby driver, using rich documents with complex objects and dynamic queries, map reduce for aggregation, indexing, GridFS for file storage, replication with replica sets, auto-sharding, pros and cons, common use cases, and provides links for additional resources.
This document discusses Ruby on Rails and some of its interesting features. It begins with an introduction to Rails, covering its model-view-controller architecture and agile development approach. Next, it highlights several small but useful Rails features, including the console, debugger, HAML template engine, and SASS stylesheet language. It also mentions database migrations and schema files. The document aims to provide an overview of Rails and showcase some of the reasons developers enjoy working with the framework.
This document is a presentation about the TorqueBox framework. It introduces TorqueBox as providing the power of JBoss with the expressiveness of Ruby. It then summarizes TorqueBox's capabilities such as deployment, scheduling jobs, messaging, dependency injection, caching, clustering, and distributed caching. The presentation encourages attendees to engage with the TorqueBox community on IRC and social media.
This document provides an introduction and overview of Play 2.1. It discusses how Play 2 was rebuilt with Scala and is now part of the Typesafe Framework. It also summarizes some of Play 2's key features like asynchronous programming, streaming, websockets, and Comet capabilities. The document compares Play 2's defaults to Rails and shows examples of Play controllers, asynchronous results, Comet sockets, scheduling tasks, and its use of JBoss Netty.
This document discusses JavaScript code architecture and module patterns using RequireJS. It begins with an introduction to RequireJS and how it can be used to dynamically load modules and their dependencies. Next, it covers defining modules with and without dependencies, and how to return maker functions from modules to create "classes". The document concludes with notes on best practices for modules and an overview of RequireJS configuration options to integrate third-party libraries.
Do you write JavaScript? Congratulations, you're probably awesome at Node.js! While thinking about things from a server-side perspective might feel off-putting and unnatural, things like callbacks, storing data in JSON, and implementing actual websites probably do not. We'll go beyond getting Node installed and talk about how to quickly build a working web application, and demonstrate that Node can offer frontend developers more than just a new prototyping tool or way of creating endless chat servers.
This presentation was provided by Racquel Jemison, Ph.D., Christina MacLaughlin, Ph.D., and Paulomi Majumder. Ph.D., all of the American Chemical Society, for the second session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session Two: 'Expanding Pathways to Publishing Careers,' was held June 13, 2024.
How to Make a Field Mandatory in Odoo 17Celine George
In Odoo, making a field required can be done through both Python code and XML views. When you set the required attribute to True in Python code, it makes the field required across all views where it's used. Conversely, when you set the required attribute in XML views, it makes the field required only in the context of that particular view.
Walmart Business+ and Spark Good for Nonprofits.pdfTechSoup
"Learn about all the ways Walmart supports nonprofit organizations.
You will hear from Liz Willett, the Head of Nonprofits, and hear about what Walmart is doing to help nonprofits, including Walmart Business and Spark Good. Walmart Business+ is a new offer for nonprofits that offers discounts and also streamlines nonprofits order and expense tracking, saving time and money.
The webinar may also give some examples on how nonprofits can best leverage Walmart Business+.
The event will cover the following::
Walmart Business + (https://business.walmart.com/plus) is a new shopping experience for nonprofits, schools, and local business customers that connects an exclusive online shopping experience to stores. Benefits include free delivery and shipping, a 'Spend Analytics” feature, special discounts, deals and tax-exempt shopping.
Special TechSoup offer for a free 180 days membership, and up to $150 in discounts on eligible orders.
Spark Good (walmart.com/sparkgood) is a charitable platform that enables nonprofits to receive donations directly from customers and associates.
Answers about how you can do more with Walmart!"
This presentation was provided by Rebecca Benner, Ph.D., of the American Society of Anesthesiologists, for the second session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session Two: 'Expanding Pathways to Publishing Careers,' was held June 13, 2024.
Temple of Asclepius in Thrace. Excavation resultsKrassimira Luka
The temple and the sanctuary around were dedicated to Asklepios Zmidrenus. This name has been known since 1875 when an inscription dedicated to him was discovered in Rome. The inscription is dated in 227 AD and was left by soldiers originating from the city of Philippopolis (modern Plovdiv).
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPRAHUL
This Dissertation explores the particular circumstances of Mirzapur, a region located in the
core of India. Mirzapur, with its varied terrains and abundant biodiversity, offers an optimal
environment for investigating the changes in vegetation cover dynamics. Our study utilizes
advanced technologies such as GIS (Geographic Information Systems) and Remote sensing to
analyze the transformations that have taken place over the course of a decade.
The complex relationship between human activities and the environment has been the focus
of extensive research and worry. As the global community grapples with swift urbanization,
population expansion, and economic progress, the effects on natural ecosystems are becoming
more evident. A crucial element of this impact is the alteration of vegetation cover, which plays a
significant role in maintaining the ecological equilibrium of our planet.Land serves as the foundation for all human activities and provides the necessary materials for
these activities. As the most crucial natural resource, its utilization by humans results in different
'Land uses,' which are determined by both human activities and the physical characteristics of the
land.
The utilization of land is impacted by human needs and environmental factors. In countries
like India, rapid population growth and the emphasis on extensive resource exploitation can lead
to significant land degradation, adversely affecting the region's land cover.
Therefore, human intervention has significantly influenced land use patterns over many
centuries, evolving its structure over time and space. In the present era, these changes have
accelerated due to factors such as agriculture and urbanization. Information regarding land use and
cover is essential for various planning and management tasks related to the Earth's surface,
providing crucial environmental data for scientific, resource management, policy purposes, and
diverse human activities.
Accurate understanding of land use and cover is imperative for the development planning
of any area. Consequently, a wide range of professionals, including earth system scientists, land
and water managers, and urban planners, are interested in obtaining data on land use and cover
changes, conversion trends, and other related patterns. The spatial dimensions of land use and
cover support policymakers and scientists in making well-informed decisions, as alterations in
these patterns indicate shifts in economic and social conditions. Monitoring such changes with the
help of Advanced technologies like Remote Sensing and Geographic Information Systems is
crucial for coordinated efforts across different administrative levels. Advanced technologies like
Remote Sensing and Geographic Information Systems
9
Changes in vegetation cover refer to variations in the distribution, composition, and overall
structure of plant communities across different temporal and spatial scales. These changes can
occur natural.
A Visual Guide to 1 Samuel | A Tale of Two HeartsSteve Thomason
These slides walk through the story of 1 Samuel. Samuel is the last judge of Israel. The people reject God and want a king. Saul is anointed as the first king, but he is not a good king. David, the shepherd boy is anointed and Saul is envious of him. David shows honor while Saul continues to self destruct.
1. “O Muses, O high genius, aid me now!
O memory that engraved the things I saw,
Here shall your worth be manifest to all!”
Dante Alighieri
Saturday, November 8, 2008
12. A Tale of Two Languages
Saturday, November 8, 2008
13. JavaScript
• Mocha! No, LiveScript! No! JAVASCRIPT!
• Brendan Eich’s fault
• Schemey, with Self’s prototypes and C’s
syntax
• But not really
Saturday, November 8, 2008
14. JavaScript objects are bags of slots.
obj = {}
obj["hello"] = "world"
obj.hello == obj["hello"]
// => true
Saturday, November 8, 2008
15. JavaScript functions are first-class.
hello = function(name) {
return "Hello, " + name + "!"
}
hello("internets")
// => "Hello, internets!"
Saturday, November 8, 2008
16. ...but they can ‘belong’ to an object
aaron = { name: "Aaron" }
aaron.hello = function() {
return "Hello, " + this.name + "!"
}
aaron.hello()
// => "Hello, Aaron!"
Saturday, November 8, 2008
17. JavaScript doesn’t have classes.
function Greeter(name) {
this.name = name
}
Greeter.prototype.hello = function() {
return "Hello, " + this.name + "!"
}
aaron = new Greeter("Aaron")
aaron.hello()
// => "Hello, Aaron!"
Saturday, November 8, 2008
21. Ruby
• Invented in 1650 by Baruch Spinoza
• Mostly used to program industrial looms
• Half the sodium of the leading brand
• (this may be a lie)
Saturday, November 8, 2008
35. Free the runtime!
• Browserless testing
• Access to the filesystem
• Easy extension
• Easy experimentation (where’s my IRB?)
Saturday, November 8, 2008
40. Use JavaScript in your Ruby!
doubler = Johnson.evaluate <<-END
function(x) { return x * 2 }
END
[1, 2, 3].collect(&doubler)
# => [2, 4, 6]
Saturday, November 8, 2008
41. Use Ruby in your JavaScript!
Ruby.require("open-uri")
function hasObamaWonYet() {
var page = Ruby.open(
"http://hasobamawonyet.com").read()
return page.match(/YES/)
}
Ruby.puts(hasObamaWonYet())
// => YES
Saturday, November 8, 2008
51. It’s Wrong!
agent = WWW::Mechanize.new
page = agent.get('http://localhost/~aaron/some_html.html')
puts page.search('p').first.text # => Hello world
Saturday, November 8, 2008
52. But with Johnson....
agent = WWW::Mechanize.new
page = agent.get('http://localhost/~aaron/some_html.html')
puts page.search('p').first.text # => Welcome to IHON
Saturday, November 8, 2008
75. class TellA
def initialize
@rt = Johnson::Runtime.new
@rt.evaluate(<<-eojs)
var fib = function(n) {
if(n == 0) return n;
if(n == 1) return n;
return fib(n - 1) + fib(n - 2);
}
eojs
end
def fib n
return n if [0, 1].include?(n)
fib(n - 1) + fib(n - 2)
end
def second_fib n
@rt['fib'].call(n)
end
end
Saturday, November 8, 2008
76. class TestFib < Test::Unit::TestCase
def test_awesomeness
@tell_a = TellA.new
assert_equal @tell_a.fib(30), @tell_a.second_fib(30)
end
end
Saturday, November 8, 2008
80. Gettin’ at Ruby Stuff
// everything's available!
hash = new Ruby.Hash()
// ...including kernel methods
Ruby.puts("I made a hash!")
// ...and nested stuff
mine = new Ruby.Thing.In.Namespace()
Saturday, November 8, 2008
81. Symbology
// we keep a cache of symbols
sym = Johnson.symbolize("monkey")
// ...and mix in to String.prototype
sym = "monkey".toSymbol()
Saturday, November 8, 2008
82. Where am I?
where = __FILE__
=> "cheese.js"
Saturday, November 8, 2008
88. RailsViews in JS
class UsersController < ApplicationController
def index
@users = User.find(:all)
end
end
Traditional Ruby Controller
Saturday, November 8, 2008
89. RailsView in JS
EJS File (app/views/index.html.ejs)
<html>
<body>
<h1>こんにちは!</h1>
<ul>
<% for(var user in at.users) { %>
<li><%= user.name() %></li>
<% } %>
</ul>
</body>
</html>
Saturday, November 8, 2008
90. RailsView in JS
EJS File (app/views/index.html.ejs)
<html>
<body>
<h1>こんにちは!</h1>
<ul>
<% for(var user in at.users) { %>
<li><%= user.name() %></li>
<% } %>
</ul>
</body>
</html>
Saturday, November 8, 2008
93. require 'johnson'
runtime = Johnson::Runtime.new
# Compile our script
script = runtime.compile('var x = 0;
for(var i = 0; i < 10; i++) {
x += 2; // Line 3
}', "my_script")
# Set the breakpoint
runtime.break('my_script', 3) do
puts "i = #{runtime['i']}, x = #{runtime['x']}"
end
# Evaluate the compiled script
runtime.evaluate_compiled_script(script)
Saturday, November 8, 2008
94. [aaron@Jordan demos]$ ruby breakpoints.rb
i = 0, x = 0
i = 1, x = 2
i = 2, x = 4
i = 3, x = 6
i = 4, x = 8
i = 5, x = 10
i = 6, x = 12
i = 7, x = 14
i = 8, x = 16
i = 9, x = 18
[aaron@Jordan demos]$
Saturday, November 8, 2008
106. AST Provides
• Directed Graph Representation (DOT)
• SEXP For easy reading
• #each for easy manipulation
• #to_js for easy generation
Saturday, November 8, 2008
107. tree.each do |node|
case node
when Johnson::Nodes::Name
node.value = 'hello' if node.value == 'foo'
end
end
puts tree.to_js
Given the Earlier Tree
Saturday, November 8, 2008
108. Parse This!
rt = Johnson::Runtime.new
rt.evaluate(<<-eoecma)
// Parse the javascript
var tree = Ruby.Johnson.Parser.parse("alert('hello world')");
// Change alert to Ruby.puts
tree.each(function(node) {
if(node.value == 'alert') {
node.value = 'Ruby.puts';
}
});
// Eval the result
eval(tree.to_js());
eoecma
Saturday, November 8, 2008
109. So.
• 1.0 is good to go
• Ruby 1.8.6, unixish and Windows
• Stability? Okay.
Saturday, November 8, 2008