Learn to Program with Kotlin : From the Basics to Projects with Text and Image Processing
معرفی کتاب «Learn to Program with Kotlin : From the Basics to Projects with Text and Image Processing» نوشتهٔ Tim Lavers (auth.)، منتشرشده توسط نشر Apress : Imprint: Apress در سال 2021. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.
Teach yourself programming starting with the basics and progressing to a series of exciting projects using Kotlin, one of today's hottest programming languages. This book starts with the absolute basics and then introduces just enough syntax to get into some fascinating projects. These include text processing: a statistical analysis of Jane Austen's novels, solving anagrams, and working with palindromes; image processing: cropping and resizing images, and pixel transformation; and computer vision: finding digits, parsing images, and reading speed signs. The projects are developed in tiny steps and complete solutions are provided. Some of these projects include core data science concepts, giving you skills in one of the most important areas of modern programming. Along the way you’ll cover functional programming, object-oriented programming (OOP), refactoring, and writing unit tests. After reading Learn to Program with Kotlin , you'll come away with practical insights and code to get you started right away with programming using Kotlin for your own projects. What You Will Learn Gain the basics of Kotlin using the IntelliJ Java IDE Implement OOP with Kotlin along with unit testing and code refactoring using a series of text-related projects Harness functional programming with Kotlin by building an image-processing library Write software to locate and read speed signs in photos Who Is This Book For Anyone who wants to learn how to program or code from scratch. Also great for experienced programmers who want to know more about Kotlin. Table of Contents 4 About the Author 11 About the Technical Reviewer 12 Preface 13 Part I: Basics 15 Chapter 1: Getting Started 16 1.1 What Is Programming? 16 1.2 Installing Java 17 1.3 Installing Git 17 1.4 Installing IntelliJ 18 1.5 Our First Program 18 1.6 Changing the Appearance of IntelliJ 20 1.7 Troubleshooting 21 1.8 Running Our First Program 21 1.9 Source Code for Our Program 22 Chapter 2: Simple Patterns 25 2.1 Shades of Gray 25 2.2 Changing the Pattern 27 2.3 Solutions to Challenges 30 Chapter 3: Arrays and Loops 33 3.1 Array Indexes 33 3.2 Loops 36 3.3 Nested Loops 39 3.4 Summary and Solutions to Challenges 40 Chapter 4: Binary Choices 44 4.1 If-Else Statements 44 4.2 The Or Operator 48 4.3 The And Operator 51 4.4 If-Else-If Statements 52 4.5 Summary and Solutions to Challenges 55 Chapter 5: Integers 60 5.1 Addition, Subtraction, and Multiplication 60 5.2 Division 65 5.3 Making Patterns Using Arithmetic 66 5.4 Summary and Solutions to Challenges 70 Chapter 6: Values and Variables 75 6.1 Using vars 75 6.2 Using vals 77 6.3 Scope 79 6.4 Summary and Solutions to Challenges 81 Chapter 7: Strings 84 7.1 Strings as Objects 84 7.2 String Iteration 87 7.3 Building New Strings 89 7.4 More on String Iteration 91 7.5 Summary and Solutions to Challenges 93 Chapter 8: Data Structures 99 8.1 Lists 99 8.2 Sets 101 8.3 Maps 102 8.4 null Objects 103 8.5 Summary and Solutions to Challenges 107 Chapter 9: The File System 109 9.1 Reading 110 9.2 Writing 112 9.3 Summary and Solutions to Challenges 114 Part II: Text 117 Chapter 10: Project Austen 118 10.1 Object-Oriented Programming 118 10.2 Unit Tests 119 10.3 Project Structure and Setup 119 10.4 LineTest and Line 121 10.5 Further Tests of Line 129 10.6 HistogramTest and Histogram 132 10.7 BookTest and Book 140 10.8 Back to LineTest and Line 145 10.9 Testing with Real Data 149 10.10 Almost Finished 150 10.11 Counting the Words 155 10.12 Putting Things in Order 157 10.13 Taking Things Further 162 10.14 Summary 163 Chapter 11: Anagrams 164 11.1 Main Classes 164 11.2 The Dictionary Class 166 11.3 The Term Class 171 11.4 Permutations 172 11.5 The permutations Function 172 11.6 Generating the Permutations of a Term 176 11.7 Putting It All Together 187 11.8 Summary 190 Chapter 12: Palindromes 191 12.1 Reversing a Term 191 12.2 Detecting Palindromes 195 12.3 Putting It All Together 196 12.4 Summary 199 Chapter 13: Word Switch 200 13.1 The Algorithm 200 13.1.1 Generation 1 200 13.1.2 Generation 2 201 13.1.3 Generation 3 201 13.1.4 Generation 4 201 13.1.5 Algorithm Termination with Success 201 13.1.6 Algorithm Termination with Failure 202 13.2 Main Classes and Project Setup 202 13.3 The WordChecker Class 203 13.4 The WordNode Class 206 13.5 Refactoring WordNodeTest 208 13.6 Further Tests of WordNode 210 13.7 Implementing WordNode 211 13.8 The WordSwitch Class 213 13.9 The Implementation of lookForTarget 217 13.10 Finding the Path 220 13.11 Putting It All Together 226 13.12 Summary and Step Details 227 13.12.1 Details of Project Step 13.1 227 13.12.2 Details of Project Step 13.2 227 13.12.3 Details of Project Step 13.3 228 13.12.4 Details of Project Step 13.4 228 13.12.5 Details of Project Step 13.5 229 13.12.6 Details of Project Step 13.6 229 13.12.7 Details of Project Step 13.9 230 13.12.8 Details of Project Step 13.10 230 13.12.9 Details of Project Step 13.12 231 13.12.10 Details of Project Step 13.13 231 13.12.11 Details of Project Step 13.16 232 13.12.12 Details of Project Step 13.21 232 Part III: Images 233 Chapter 14: Color Pictures 234 14.1 Modeling Color 234 14.2 Modeling Pictures 235 14.3 Photographs 247 14.4 Flipping an Image 251 14.5 Summary and Solutions to Challenges 256 Chapter 15: Pixel Transformations 262 15.1 Blood Sunset 262 15.2 A Unit Test 266 15.3 Conditional Transformations 267 15.4 Position-Based Transformations 273 15.5 Summary and Solutions to Challenges 277 Chapter 16: Cropping and Resizing Images 284 16.1 Cropping 284 16.2 Improving the Unit Tests 289 16.3 Shrinking an Image 290 16.4 Storing Images 297 16.5 Summary and Solutions to Challenges 299 Chapter 17: Project Dino 304 17.1 Producing the Screen 305 17.2 Photographing the Dinosaur 306 17.3 First Attempt at Superposition 309 17.4 Letting the Background Through 312 17.5 Hiding the Feet 316 17.6 Summary 319 Part IV: Vision 320 Chapter 18: Overview 321 18.1 A Bit More Kotlin 321 18.2 Project Structure 323 18.3 Image Slicing 323 18.4 Summary and Step Details 329 18.1.1 Details of Project Step 18.1 329 18.2.2 Details of Project Step 18.2 330 18.3.3 Details of Project Step 18.3 330 Chapter 19: Finding Digits 332 19.1 DigitFinder 332 19.2 Thresholding the Sign Images 335 19.3 Slicing the Thresholded Image 338 19.4 A More General Slicing Function 339 19.5 Filtering the Slices 342 19.6 Summary and Step Details 346 19.1.1 Details of Project Step 19.1 346 19.2.2 Details of Project Step 19.2 347 19.3.3 Details of Project Step 19.3 348 Chapter 20: Parsing the Images 349 20.1 Terminology 350 20.2 Project Structure 351 20.3 Identifying the Digit “1” 351 20.4 Identifying the Digit “2” 355 20.5 Identifying “5” and “7” 356 20.6 Identifying “0” 357 20.7 Summary and Step Details 359 20.1.1 Details of Project Step 20.1 359 20.2.2 Details of Project Step 20.2 360 20.3.3 Details of Project Step 20.3 360 20.4.4 Details of Project Step 20.4 361 20.5.5 Details of Project Step 20.5 362 20.6.6 Details of Project Step 20.6 362 Chapter 21: Reading Speed Signs 364 21.1 SpeedReader 364 21.2 Base 10 Numbers 366 21.3 Putting It All Together 368 21.4 Summary 368 21.5 Project Steps 369 21.5.1 Details of Project Step 21.1 369 21.5.2 Details of Project Step 21.3 370 21.5.3 Details of Project Step 21.4 370 Index 371 Teach yourself programming starting with the basics and progressing to a series of exciting projects using Kotlin, one of today's hottest programming languages. This book starts with the absolute basics and then introduces just enough syntax to get into some fascinating projects. These include text processing: a statistical analysis of Jane Austen's novels, solving anagrams, and working with palindromes; image processing: cropping and resizing images, and pixel transformation; and computer vision: finding digits, parsing images, and reading speed signs. After reading __Learn to Program with Kotlin__, you'll come away with practical insights and code to get you started right away with programming using Kotlin for your own projects. **What You Will Learn** * Gain the basics of Kotlin using the IntelliJ Java IDE * Implement OOP with Kotlin along with unit testing and code refactoring using a series of text-related projects * Harness functional programming with Kotlin by building an image-processing library * Write software to locate and read speed signs in photos Anyone who wants to learn how to program or code from scratch. Also great for experienced programmers who want to know more about Kotlin.
دانلود کتاب Learn to Program with Kotlin : From the Basics to Projects with Text and Image Processing