Opa Application Development
By Li Wenbo
()
About this ebook
Related to Opa Application Development
Related ebooks
Practical OneOps Rating: 0 out of 5 stars0 ratingsInstant Play Framework Starter Rating: 0 out of 5 stars0 ratingsJasmine JavaScript Testing - Second Edition Rating: 0 out of 5 stars0 ratingsSymfony2 Essentials Rating: 0 out of 5 stars0 ratingsRedmine Plugin Extension and Development Rating: 0 out of 5 stars0 ratingsInstant Jsoup How-to Rating: 0 out of 5 stars0 ratingsClojure for Java Developers Rating: 0 out of 5 stars0 ratingsOpenCart Theme and Module Development Rating: 0 out of 5 stars0 ratingsGetting Started with WebRTC Rating: 0 out of 5 stars0 ratingsASP.NET Core 3 and React: Hands-On full stack web development using ASP.NET Core, React, and TypeScript 3 Rating: 0 out of 5 stars0 ratingsResponsive Design High Performance Rating: 0 out of 5 stars0 ratingsMastering Apache Camel Rating: 0 out of 5 stars0 ratingsInstant Apache ActiveMQ Messaging Application Development How-to Rating: 0 out of 5 stars0 ratingsApache Solr PHP Integration Rating: 0 out of 5 stars0 ratingsJava 8 to 21: Explore and work with the cutting-edge features of Java 21 (English Edition) Rating: 0 out of 5 stars0 ratingsMonitoring Docker Rating: 0 out of 5 stars0 ratingsEnterprise OSGi In Action Rating: 0 out of 5 stars0 ratingsSQL and NoSQL Interview Questions: Your essential guide to acing SQL and NoSQL job interviews (English Edition) Rating: 0 out of 5 stars0 ratingsHands-on Ansible Automation: Streamline your workflow and simplify your tasks with Ansible (English Edition) Rating: 0 out of 5 stars0 ratingsRestlet in Action: Developing RESTful web APIs in Java Rating: 0 out of 5 stars0 ratingsLearning Underscore.js Rating: 0 out of 5 stars0 ratingsSoftware architecture A Complete Guide - 2019 Edition Rating: 0 out of 5 stars0 ratingsMastering Ninject for Dependency Injection Rating: 0 out of 5 stars0 ratingsLearning Apache Thrift Rating: 0 out of 5 stars0 ratingsProgramming the Network with Perl Rating: 0 out of 5 stars0 ratingsLocation-Aware Applications Rating: 0 out of 5 stars0 ratingsMastering Postman: A Comprehensive Guide to Building End-to-End APIs with Testing, Integration and Automation Rating: 0 out of 5 stars0 ratingsJump Start Web Performance Rating: 0 out of 5 stars0 ratings
Programming For You
HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratingsLearn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5The Unofficial Guide to Open Broadcaster Software: OBS: The World's Most Popular Free Live-Streaming Application Rating: 0 out of 5 stars0 ratingsCoding All-in-One For Dummies Rating: 4 out of 5 stars4/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5Hacking: Ultimate Beginner's Guide for Computer Hacking in 2018 and Beyond: Hacking in 2018, #1 Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Python Projects for Beginners: A Ten-Week Bootcamp Approach to Python Programming Rating: 0 out of 5 stars0 ratingsSQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5The Little SAS Book: A Primer, Sixth Edition Rating: 5 out of 5 stars5/5Teach Yourself C++ Rating: 4 out of 5 stars4/5Pokemon Go: Guide + 20 Tips and Tricks You Must Read Hints, Tricks, Tips, Secrets, Android, iOS Rating: 5 out of 5 stars5/5Web Designer's Idea Book, Volume 4: Inspiration from the Best Web Design Trends, Themes and Styles Rating: 4 out of 5 stars4/5
Reviews for Opa Application Development
0 ratings0 reviews
Book preview
Opa Application Development - Li Wenbo
Table of Contents
Opa Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Opa
Installing Opa
Installing Node.js
Installing the required modules
Installing the Opa compiler
Testing the installation
Setting up editors
Sublime Text
Vim
Emacs
Your first Opa application
Summary
2. Basic Syntax
Basic datatypes
Integers
Floats
Strings
Sum
Functions
Last expression return
Modules
Data structures
Records
Tuples
Lists
Iterating through a list
Finding elements
Transforming lists
Sorting a list
Maps
Pattern matching
Text parsers
Summary
3. Developing Web Applications
Starting a web server
A simple example
The server module
Dispatching requests
The resource handler
The dispatch handler
The register handler
The customize handler
The handlers group
Preparing pages
XHTML
Creating a page
Adding styles
Handling events
Manipulating DOMs
DOM selection
Reading values
Updating content
Binding an event handler
Animations
Summary
4. Using Bootstrap
Importing Bootstrap
Using classes
Using icons
Bootstrap icons
Font Awesome icons
Using widgets
Summary
5. Communicating between Client and Server
Client and server slicing
A simple example
Slicing annotations
Module slicing
Expression slicing
Client and server communication
Session
Cell
Network
Summary
6. Binding with Other Languages
Binding JavaScript
The first example
Using external types
Binding Node.js
Binding external functions using the classic syntax
Summary
7. Working with Databases
A quick start to MongoDB
Database manipulation
Records
Lists
Sets and maps
Querying data
Summary
8. Internationalization
Internal approach
External approach
Summary
9. Building a Chat Application
Creating a project
Launching the web server
Designing user interface
Building application logic
Broadcasting and receiving messages
Summary
10. Building a Game – Pacman
The project structure
The HTML5 Canvas
Drawing a shape
Using the fill and stroke properties
Drawing a curve
Drawing an image
Drawing the text
Binding the external JavaScript library
Preloading the resources
Playing sounds
Summary
11. Developing a Social Mobile Application – LiveRoom
Project structure
Authorizing a user
Signing in and signing out
Signing in with Facebook
The application
Listing topics
Creating a topic
Posting messages and comments
Designing for mobile devices
Summary
Index
Opa Application Development
Opa Application Development
Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: June 2013
Production Reference: 1040613
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78216-374-9
www.packtpub.com
Cover Image by Parag Kadam (<paragvkadam@gmail.com>)
Credits
Author
Li Wenbo
Reviewers
Joseph Goldman
Alok Menghrajani
Acquisition Editor
Mary Jasmine Nadar
Commissioning Editor
Neha Nagwekar
Technical Editors
Sharvari H. Baet
Priyanka Kalekar
Project Coordinator
Sherin Padayatty
Proofreader
Paul Hindle
Indexer
Hemangini Bari
Graphics
Abhinash Sahu
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
About the Author
Li Wenbo studied Computer Science and Technology at Wuhan University, graduating with a master's degree. He has two years experience working as a Software Engineer in a leading telecom company in China. He has been doing web development for about 8 years, ever since he was a student at Wuhan University. He is familiar with a lot of programming languages such as C/C++, Java, JavaScript, PHP, and so on, and he has a passion for new things and technologies. Li tried the Opa framework last year and found it very interesting. He then participated in an Opa challenge and won the first prize.
Li Wenbo is now a freelance developer and owns a small studio in Wuhan, China.
About the Reviewers
Joseph Goldman is an experienced freelance programmer who cut his teeth on 8086 Assembler before joining the Homo Sapiens race by learning to walk upright and adopting more conversational and universal programming languages such as C, Objective C, Smalltalk, Pascal, and more. Over his illustrious 30 year career, he has programmed for VAX under VMS, Sun Microsystems work stations, MS DOS 8088 - Pentium CPUs, MS Windows, Mac OSX, and Linux. A tireless early adopter of new programming paradigms and languages, he is very fond of the new generation of functional and object-oriented programming languages, such as Google's Dart, Opa, Scala, and more, as well as other innovative language designs, most notably REBOL. Today, he specializes in writing web apps and mobile apps for iOS and Android platforms, both smart phones as well as tablets. He is self-employed and can be reached at <TheAppsDude@gmail.com>. In the late 1990s, Mr. Goldman co-authored REBOL - The Official Guide that was published in the year 2000 by Osborne McGraw-Hill.
Alok Menghrajani Computer Science at EPFL and CMU. He graduated in 2005. He then started working in the field of web security and is currently an engineer at Facebook.
Alok got the opportunity to learn Opa when it was open sourced. He realized the potential this framework offered to improve web development; Opa helps build web applications faster and in a safer way.
He has made various contributions to Opa: reporting bugs, providing feedback to the core team, and helping out with community events such as hackathons.
He is also the author of http://pixlpaste.com/, a web application to share screenshots and images written in Opa.
He has also worked on Opa: Up and Running and JavaScript for PHP Developers.
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
Fully searchable across every book published by Packt
Copy and paste, print and bookmark content
On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you