(Ebook) Practical Rust Projects: Build Serverless, AI, Machine Learning, Embedded, Game, and Web Applications by Shing Lyu & Andrew Rzeznik ISBN 9781484293317, 1484293312 pdf download
(Ebook) Practical Rust Projects: Build Serverless, AI, Machine Learning, Embedded, Game, and Web Applications by Shing Lyu & Andrew Rzeznik ISBN 9781484293317, 1484293312 pdf download
https://ebooknice.com/product/practical-rust-web-projects-build-
serverless-ai-machine-learning-embedded-game-and-web-
applications-51003808
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018
(Ebook) Practical Rust Projects by Shing Lyu and Andrew Rzeznik
https://ebooknice.com/product/practical-rust-projects-53050582
(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT
Subject Test: Math Levels 1 & 2) by Arco ISBN 9780768923049,
0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-
arco-master-the-sat-subject-test-math-levels-1-2-2326094
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044
https://ebooknice.com/product/practical-rust-web-projects-building-
cloud-and-web-based-applications-23174690
https://ebooknice.com/product/serverless-web-applications-with-aws-
amplify-build-full-stack-serverless-applications-using-amazon-web-
services-51197104
Shing Lyu and Andrew Rzeznik
Andrew Rzeznik
Arlington, MA, USA
This work is subject to copyright. All rights are solely and exclusively
licensed by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any
other physical way, and transmission or information storage and retrieval,
electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.
The publisher, the authors, and the editors are safe to assume that the advice
and information in this book are believed to be true and accurate at the date
of publication. Neither the publisher nor the authors or the editors give a
warranty, expressed or implied, with respect to the material contained
herein or for any errors or omissions that may have been made. The
publisher remains neutral with regard to jurisdictional claims in published
maps and institutional affiliations.
Source Code
All code used in this book can be found at
github.com/apress/practical-rust-projects-2e.
Any source code or other supplementary material referenced by the author
in this book is available to readers on GitHub (github.com/apress). For
more detailed information, please visit http://www.apress.com/source-code.
Table of Contents
Chapter 1: Welcome to the World of Rust
1.1 Who Is This Book For?
1.2 Who Is This Book Not For?
1.3 Criteria for Selecting Libraries
Pure Rust
Maturity
Popularity
1.4 How to Use This Book
Chapters Overview
1.5 Source Code
1.6 Topics Not Covered
Chapter 2: Building a Command-line Program
2.1 What Are You Building?
2.2 Creating a Binary Project
2.3 Reading Command-line Arguments with std::env::args
2.4 Handling Complex Arguments with Clap
2.5 Adding Binary Flags
2.6 Printing to STDERR
2.7 Printing with Color
2.8 Reading the Cat Picture from a File
2.9 Handling Errors
2.10 Piping to Other Commands
Piping to STDOUT Without Color
Accepting STDIN
2.11 Integration Testing
2.12 Publishing and Distributing the Program
Install from Source
Publish to crates.io
Building Binaries for Distribution
2.13 Conclusion
Chapter 3: Creating Graphical User Interfaces (GUIs)
3.1 What Are You Building?
3.2 Building a Text-based User Interface
3.3 Showing a Dialog Box
3.4 Handling Simple Keyboard Inputs
3.5 Adding a Dialog
3.6 Multi-step Dialogs
3.7 Reading User Input
3.8 Moving to Graphical User Interfaces (GUIs)
3.9 Creating a Window
3.10 Displaying an Image
3.11 Using Glade to Design the UI
3.12 Accepting Inputs and Button Clicks
3.13 Reading a gtk::Switch
3.14 Alternatives
3.15 Conclusion
Chapter 4: High-Performance Web Frontend Using WebAssembly
4.1 What Is WebAssembly?
4.2 What Are You Building?
4.3 Hello WebAssembly!
Setting Up the Development Environment
Creating the Project
Creating the Frontend
4.4 Resizing an Image with WebAssembly
Loading an Image File onto the <canvas>
Passing the Image to Wasm
4.5 Writing the Whole Frontend in Rust
4.6 A Hello World Example
4.7 A Cat Management Application
CSS Styling
Deleting Files
4.8 Wasm Alternatives
4.9 Conclusion
Chapter 5: REST APIs
5.1 What Are You Building?
5.2 Hello Backend World!
5.3 Serving Static Files
5.4 Converting the Cats List to a REST API
5.5 Using a Database
5.6 Adding Cats with a POST Command
5.7 API Testing
5.8 Building the Cat Detail API
5.9 Input Validation
5.10 Error Handling
Using the actix_web::error Helpers
Using a Generic Error That Has Implemented the
ResponseError Trait
Using a Custom-Built Error Type
5.11 Customizing the web::Path Extractor Error
5.12 Logging
5.13 Enabling HTTPS
5.14 Framework Alternatives
5.15 Conclusion
Chapter 6: Going Serverless with the Amazon AWS Rust SDK
6.1 What Are You Building?
6.2 What Is AWS Lambda?
6.3 Registering an AWS Account
6.4 Hello World in Lambda
6.5 The Full Architecture
6.6 Using the AWS Serverless Application Model (AWS SAM)
6.7 Setting Up AWS SAM CLI Credentials
6.8 Creating the Catdex Serverless Project
6.9 Building the Upload API
6.10 Building the /cats API
6.11 Uploading the Image Using S3 Pre-signed URL
6.12 Adding the Frontend
6.13 A Note on Security
6.14 Next Steps
6.15 Conclusion
Chapter 7: Building a Game
7.1 What Are We Building?
7.2 Bevy and the Entity Component System Pattern
7.3 Creating a Bevy Project
7.4 See the World Through a Camera
7.5 Adding the Cats
7.6 Loading a Spritesheet
7.7 Moving the Cats
7.8 Creating the Ball
7.9 Can’t Defy Gravity
7.10 Making the Ball Bounce
7.11 Keeping Score
7.12 Let There Be Music
7.13 Alternatives
7.14 Conclusion
Chapter 8: Physical Computing in Rust
8.1 What Are You Building?
8.2 Physical Computing on Raspberry Pi
Getting to Know Your Raspberry Pi
Installing Raspberry Pi OS Using Raspberry Pi Imager
Installing the Rust Toolchain
Understanding the GPIO Pins
Building an LED Circuit
Controlling the GPIO Output with Rust
Reading Button Clicks
8.3 Cross-Compiling to Raspberry Pi
8.4 How Does the GPIO Code Work?
8.5 Where to Go from Here?
Chapter 9: Artificial Intelligence and Machine Learning
9.1 Types of Machine Learning Models
9.2 What Are You Building?
9.3 Introducing linfa and rusty-machine
9.4 Clustering Cat Breeds with K-means
Introduction to the K-means Algorithm
The Training Data
Exporting as a CSV
Moving the Configuration into a File
Setting the Configuration File at Runtime
Visualizing the Data
Details on Adding More Entries
Setting Up K-means
9.5 Detecting Cats Versus Dogs with a Neural Network
Introduction to Neural Networks
Preparing the Training Data and Testing Data
Setting Up the Neural Network Model
Reading the Training and Testing Data
Normalizing the Training Data
Training and Predicting
Making the Prediction
9.6 Alternatives
9.7 Conclusion
Chapter 10: What Else Can You Do with Rust?
10.1 The End Is Just the Beginning
10.2 Server-side Rendered Website
10.3 Web Browser and Crawler
10.4 Mobile
10.5 Operating Systems and Embedded Devices
10.6 The Cloud
10.7 Blockchains and Cryptocurrencies
10.8 Unlimited Possibilities of Rust
Index
About the Authors
Shing Lyu
is a software engineer who is passionate
about open source software. He’s worked
on Rust professionally at Mozilla on the
Firefox (Gecko) and Servo browser engine
project. Currently, he works at Amazon
Web Services (AWS) as a solutions
architect. Previously, Shing worked at
DAZN, a sports streaming platform, as a
backend developer, with a focus on AWS
and serverless technology. Shing has
worked for other world-famous brands
such as Intel. He is also active in the open
source community. Being one of the
founders of the Taiwan Rust community, he loves to share his enthusiasm
for Rust with people.
Andrew Rzeznik
is a software development engineer at AWS
Cryptography with interests in distributed
systems, languages, tooling, Internet of
Things (IoT), and low-level programming.
His primary working language is Rust, but
he considers himself a polyglot, having
worked in C, C++, Python, Java, C#, and
many others. Before AWS Andrew worked
in various software positions, with a
primary focus in factory automation. He
developed robust yet accessible distributed
machine control frameworks to bring
advanced software patterns and techniques
to manufacturing. He also served as a
consultant, where he debugged manufacturing issues at various firms.
Andrew received his PhD in mathematics from the Massachusetts Institute
of Technology (MIT), where he wrote simulations for ocean mining plumes
and tested them aboard a research vessel at sea.
About the Technical Reviewer
Satej Kumar Sahu
works in the role of senior software data
architect at Boeing. He is passionate about
technology, people, and nature. He believes
that through technology focused on
sustainability and conscientious decision
making each of us has the power to make
this world a better place. In his free time,
he can be seen reading books, playing
basketball, and having fun with friends and
family.
© The Author(s), under exclusive license to APress Media, LLC, part of Springer
Nature 2023
S. Lyu, A. Rzeznik, Practical Rust Projects
https://doi.org/10.1007/978-1-4842-9331-7_1
Language: English
OF
ANCIENT TIMES.
BY
S. G. GOODRICH.
BOSTON:
THOMPSON, BROWN & COMPANY.
23 Hawley Street.
PREFACE
The reader of these pages will perhaps remark, that the length of
the following sketches is hardly proportioned to the relative
importance of the several subjects, regarded in a merely historical
point of view. In explanation of this fact, the author begs leave to
say, that, while he intended to present a series of the great beacon
lights that shine along the shores of the past, and thus throw a
continuous gleam over the dusky sea of ancient history,—he had still
other views. His chief aim is moral culture; and the several articles
have been abridged or extended, as this controlling purpose might
be subserved.
It may be proper to make one observation more. If the author has
been somewhat more chary of his eulogies upon the great men that
figure in the pages of Grecian and Roman story, than is the
established custom, he has only to plead in his vindication, that he
has viewed them in the same light—weighed them in the same
balance—measured them by the same standard, as he should have
done the more familiar characters of our own day, making due
allowance for the times and circumstances in which they acted. He
has stated the results of such a mode of appreciation; yet if the
master spirits of antiquity are thus shorn of some portion of their
glory, the writer still believes that the interest they excite is not
lessened, and that the instruction they afford is not diminished. On
the contrary, it seems to him that the study of ancient biography, if it
be impartial and discriminating, is one of the most entertaining and
useful to which the mind can be applied.
CONTENTS.
PAGE
Mohammed 7
Belisarius 25
Attila 60
Nero 68
Seneca 74
Virgil 83
Cicero 95
Julius Cæsar 130
Hannibal 145
Alexander 157
Aristotle 183
Demosthenes 197
Apelles 209
Diogenes 231
Plato 218
Socrates 229
Alcibiades 244
Democritus 252
Pericles 256
Aristides 261
Æsop 264
Solon 271
Lycurgus 277
Homer 282
Confucius 291
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com