Skip to Content
Client-Server Web Apps with JavaScript and Java
book

Client-Server Web Apps with JavaScript and Java

by Casimir Saternos
March 2014
Intermediate to advanced content levelIntermediate to advanced
260 pages
6h 31m
English
O'Reilly Media, Inc.
Content preview from Client-Server Web Apps with JavaScript and Java

Chapter 10. JRuby and Angular

We live in a beautiful and orderly world, not in a chaos without norms, even though that is how it sometimes appears.

M. C. Escher

Sorting and filtering are activities that have been used since ancient times to organize the world. Ancient acrostics used each letter in an alphabet to start a line of a poem. This involves both filtering (selection of first letter) and sorting (alphabetical). The Sieve of Eratosthenes, shown in Figure 10-1, can be visualized by writing out, in order, the integers from two to the upper bound in question, and then filtering out composites (nonprime numbers) as the multiples of primes.

Sieve of Eratosthenes
Figure 10-1. Sieve of Eratosthenes

A quick search on filtering and sorting returns many results geared toward the manipulation of data in spreadsheet programs. The project in this chapter will show how, with a relatively small amount of code, JRuby and Angular can be used to filter and sort an HTML table containing data from Google Finance stock market data.

Server Side: JRuby and Sinatra

Simple, dynamic web APIs can be created using Ruby and a microframework called Sinatra. Sinatra is essentially a Ruby-based wrapper of HTTP.

Ruby was developed by Yukihiro “Matz” Matsumoto, who incorporated parts of his favorite languages (Perl, Smalltalk, Eiffel, Ada, and Lisp) to create a new language that balanced functional and imperative approaches. Although ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

RESTful Java Web Services - Third Edition

RESTful Java Web Services - Third Edition

Balachandar Bogunuva Mohanram

Publisher Resources

ISBN: 9781449369323Errata PageSupplemental Content