Introduction to Mongodb

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to Mongodb Building RESTful Web Services with Go Learn how to build powerful RESTful APIs with Golang that scale gracefully Naren Yellavula BIRMINGHAM - MUMBAI Building RESTful Web Services with Go Copyright © 2017 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: December 2017 Production reference: 1261217 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78829-428-7 www.packtpub.com Credits Copy Editors Author Dhanya Baburaj Naren Yellavula Safis Editing Reviewer Project Coordinator Anshul Joshi Sheejal Shah Commissioning Editor Proofreader Aaron Lazar Safis Editing Acquisition Editor Indexer Denim Pinto Rekha Nair Content Development Editor Graphics Sreeja Nair Jason Monteiro Technical Editor Production Coordinator Rutuja Vaze Nilesh Mohite About the Author Naren Yellavula—fondly called by the developer community as Naren Arya—started his programming career in the funniest way. He ditched mechanical engineering for computer science after watching The Matrix for the first time. With dreams of coding a mini world, he continuously sharpened his practical skills. Initially, he built few a mobile applications. Then, he completely moved into the space of full stack development. He always believed that computers and software can help make this world a better place. He wrote 120+ development articles on various open source technologies, including Go and Python. He is also one of the few young speakers at the PyCon India conference (he spoke at Bangalore in 2015 and Delhi in 2017). With detailed knowledge of web scraping and REST APIs, he dived into multiple domains such as cloud telephony and cloud-based web services. On this journey, he bathed in a lot of design decisions. He currently works as a software engineer for Citrix R&D, India. Naren is a great fan of Go personally because of the speed and intuitiveness of the language. In his spare time, he tries to educate the youth in programming and software development. He loves reading nonfiction most of the time, and Victorian and Russian fiction sometimes. Acknowledgments I would like to thank my grandmother, Tayamma, for raising me to be helpful to others by sharing my knowledge in every possible way. She was the one who always taught me how to put in serious effort with 100% dedication, and not worry much about results. Therefore, I dedicate this book to her, to my inspiration. I also cannot understate the support given by my father, Venkataiah Yellavula; mother, ShobaRani Dasyam; and lovely younger brother Saikiran, who understood the value of the time I spent on this book and always encouraged me with their positive wishes. I am grateful to my mentor, Chandrashekar MuniBudha, Solutions Architect, Amazon Web Services, whom I am deeply indebted to. I also thank Ashwin Baskaran, Senior Director, Citrix, who encouraged and pushed me forward in all possible ways. Thank you! I cannot name everyone here; the list is so big. However, I sincerely thank all my friends who always wished success for this book. About the Reviewer Anshul Joshi is a data scientist with experience in recommendation systems, predictive modeling, neural networks, and high-performance computing. His research interests encompass deep learning, artificial intelligence, and computational physics. Most of the time, he can be found exploring GitHub or trying anything new he can get his hands on. His blog can be found at https:/​/​anshuljoshi.​com/.​ www.PacktPub.com For support files and downloads related to your book, please visit www.PacktPub.com. 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 [email protected] for more details. 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. https:/​/​www.​packtpub.​com/​mapt Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career. Why subscribe? Fully searchable across every book published by Packt Copy and paste, print, and bookmark content On demand and accessible via a web browser Customer Feedback Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial process. To help us improve, please leave us an honest review on this book's Amazon page at https:/​/​www.​amazon.​com/​dp/​1788294289. If you'd like to join our team of regular reviewers, you can email us at [email protected]. We award our regular reviewers with free eBooks and videos in exchange for their valuable feedback. Help us be relentless in improving our products! Table of Contents Preface 1 Chapter 1: Getting Started with REST API Development 7 Types of web services 8 REST API 9 Characteristics of REST services 10 REST verbs and status codes 11 GET 13 POST, PUT, and PATCH 14 DELETE and OPTIONS 15 Cross-Origin Resource Sharing (CORS) 16 Types of status codes 17 2xx family (successful) 18 3xx family (redirection) 18 4xx family (client error) 18 5xx family (server error) 19 Rise of REST API with Single Page Applications 19 Old and new ways of data flow in SPA 20 Why Go for REST API development? 22 Setting up the project and running the development server 22 Demystifying GOPATH 23 Building our first service – finding the Roman numeral 25 Breaking down the code 29 Live reloading the application with supervisord and Gulp 30 Monitoring your Go web server with supervisord 30 Installing supervisord 30 Using Gulp for creating auto code compiling and server reloading 32 Understanding the gulpfile 34 Summary 35 Chapter 2: Handling Routing for Our REST Services 36 Getting the code 37 Understanding Go's net/http package 37 Running the code 38 ServeMux, a basic router in Go 38 Running the code 40 Adding multiple handlers using ServeMux 40 Table of Contents Running the code 41 Introducing httprouter, a lightweight HTTP router 42 Installation 42 Program explanation 44 Building the simple static file server in minutes 46 Introducing Gorilla Mux, a powerful HTTP router 47 Installation 48 Fundamentals of Gorilla Mux 48 Reverse mapping URL 50 Custom paths 50 Path Prefix 51 Strict Slash 51 Encoded paths 52 Query-based matching 52 Host-based matching 53 SQL injections in URLs and ways to avoid them 55 Creating a basic API layout for URL shortening services 56 Summary 57 Chapter 3: Working with Middleware and RPC 58 Getting the code 58 What is middleware? 59 Creating a basic middleware 60 Multiple middleware and chaining 63 Painless middleware chaining with Alice 69 Using Gorilla's Handlers middleware for Logging 70 What is RPC? 72 Creating an RPC server 73 Creating an RPC client 74 JSON RPC using Gorilla RPC 76 Summary 79 Chapter 4: Simplifying RESTful Services with Popular Go Frameworks 80 Getting the code 80 go-restful, a framework for REST API creation 81 CRUD operations and SQLite3 basics 83 Building a Metro Rail API with go-restful 85 Design specification 86 Creating database models 86 Building RESTful APIs with the Gin framework 96 Building a RESTful API with Revel.go 102 [ ii ] Table of Contents Summary 107 Chapter 5: Working with MongoDB and Go to Create REST APIs 109 Getting the code 109 Introduction to MongoDB 110 Installing MongoDB and using the shell 110 Working with the Mongo shell 112 Introducing mgo, a MongoDB driver for Go 117 RESTful API with Gorilla Mux and MongoDB 120 Boosting the querying performance with indexing 125 Designing an e-commerce data document model 128 Summary 131 Chapter 6: Working with Protocol Buffers and GRPC 132 Getting the code 132 Introduction to protocol buffers 133 Protocol buffer language 134 Scalar values 135 Enumerations and repeated fields 136 Compiling a protocol buffer with protoc 138 Introduction to GRPC 144 Bidirectional streaming with GRPC 151 Summary 156 Chapter 7: Working with PostgreSQL, JSON, and Go 158 Getting the code 158 Installing the PostgreSQL database 159 Adding users and databases in PostgreSQL 160 pq, a pure PostgreSQL database driver for Go 162 Implementing a URL shortening service using Postgres and pq 165 Defining the Base62 algorithm 165 Exploring the JSON store in PostgreSQL 172 GORM, a powerful ORM for Go 172 Implementing the e-commerce REST API 174 Summary 180 Chapter 8: Building a REST API Client in Go and Unit Testing 181 Getting the code 182 Plan for building a REST API client 182 Basics for
Recommended publications
  • ACS – the Archival Cytometry Standard
    http://flowcyt.sf.net/acs/latest.pdf ACS – the Archival Cytometry Standard Archival Cytometry Standard ACS International Society for Advancement of Cytometry Candidate Recommendation DRAFT Document Status The Archival Cytometry Standard (ACS) has undergone several revisions since its initial development in June 2007. The current proposal is an ISAC Candidate Recommendation Draft. It is assumed, however not guaranteed, that significant features and design aspects will remain unchanged for the final version of the Recommendation. This specification has been formally tested to comply with the W3C XML schema version 1.0 specification but no position is taken with respect to whether a particular software implementing this specification performs according to medical or other valid regulations. The work may be used under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported license. You are free to share (copy, distribute and transmit), and adapt the work under the conditions specified at http://creativecommons.org/licenses/by-sa/3.0/legalcode. Disclaimer of Liability The International Society for Advancement of Cytometry (ISAC) disclaims liability for any injury, harm, or other damage of any nature whatsoever, to persons or property, whether direct, indirect, consequential or compensatory, directly or indirectly resulting from publication, use of, or reliance on this Specification, and users of this Specification, as a condition of use, forever release ISAC from such liability and waive all claims against ISAC that may in any manner arise out of such liability. ISAC further disclaims all warranties, whether express, implied or statutory, and makes no assurances as to the accuracy or completeness of any information published in the Specification.
    [Show full text]
  • Archive Utility Download
    archive utility download mac Question: Q: finding archive utility app and uninstalling winzip? i have zip files that now default to WINZIP which i downloaded for a demo and never uninstalled. can someone remind me how to uninstall it again? ALSO, i am trying to set ZIPPED files to open with ARCHIVE UTILITY but i don't see anywhere to set this with the OPEN WITH dialogs. i checked in the UTILITY FOLDER in applications but it is not there. i forget if this is something obvious or what. Mac Pro, macOS 10.13. Posted on Jul 15, 2020 11:46 AM. Anyone who has purchased the product from the WinZip store* within 30 days can get a refund of the purchase price. If you want to arrange a refund, please contact WinZip Service or mail a request to: Mansfield, CT 06268-0540. Please include your name, order number, and postal address in your request. To qualify for a refund, please remove the software from any computers on which you've installed it. Also, please destroy the CD, if you received one. The best way to remove WinZip Mac from your computer is as follows: Click the WinZip icon on the dock Click the WinZip drop down menu and then the Uninstall menu item. Then contact WinZip Service, state that you have removed the software from any computers on which you've installed it (and have destroyed the CD if applicable), and also state that you will no longer be using the software. * Note: If you have purchased WinZip through the Apple Store and believe you are in need of a refund, you must contact the Apple Store.
    [Show full text]
  • Genetic Databases
    Stefano Lonardi March, 2000 Compression of Biological Sequences by Greedy Off-line Textual Substitution Alberto Apostolico Stefano Lonardi Purdue University Università di Padova Genetic Databases § Massive § Growing exponentially Example: GenBank contains approximately 4,654,000,000 bases in 5,355,000 sequence records as of December 1999 Data Compression Conference 2000 1 Stefano Lonardi March, 2000 DNA Sequence Records Composed by annotations (in English) and DNA bases (on the alphabet {A,C,G,T,U,M,R,W,S,Y,K,V,H,D,B,X,N}) >RTS2 RTS2 upstream sequence, from -200 to -1 TCTGTTATAGTACATATTATAGTACACCAATGTAAATCTGGTCCGGGTTACACAACACTT TGTCCTGTACTTTGAAAACTGGAAAAACTCCGCTAGTTGAAATTAATATCAAATGGAAAA GTCAGTATCATCATTCTTTTCTTGACAAGTCCTAAAAAGAGCGAAAACACAGGGTTGTTT GATTGTAGAAAATCACAGCG >MEK1 MEK1 upstream sequence, from -200 to -1 TTCCAATCATAAAGCATACCGTGGTYATTTAGCCGGGGAAAAGAAGAATGATGGCGGCTA AATTTCGGCGGCTATTTCATTCATTCAAGTATAAAAGGGAGAGGTTTGACTAATTTTTTA CTTGAGCTCCTTCTGGAGTGCTCTTGTACGTTTCAAATTTTATTAAGGACCAAATATACA ACAGAAAGAAGAAGAGCGGA >NDJ1 NDJ1 upstream sequence, from -200 to -1 ATAAAATCACTAAGACTAGCAACCACGTTTTGTTTTGTAGTTGAGAGTAATAGTTACAAA TGGAAGATATATATCCGTTTCGTACTCAGTGACGTACCGGGCGTAGAAGTTGGGCGGCTA TTTGACAGATATATCAAAAATATTGTCATGAACTATACCATATACAACTTAGGATAAAA ATACAGGTAGAAAAACTATA Problem Textual compression of DNA data is difficult, i.e., “standard” methods do not seem to exploit the redundancies (if any) inherent to DNA sequences cfr. C.Nevill-Manning, I.H.Witten, “Protein is incompressible”, DCC99 Data Compression Conference 2000 2 Stefano Lonardi March, 2000
    [Show full text]
  • ARC-LEAP User Instructions for The
    ARC-LEAP User Instructions Appalachian Regional Commission Local Economic Assessment Package prepared for the Appalachian Regional Commission prepared by Economic Development Research Group, Inc. Glen Weisbrod Teresa Lynch Margaret Collins January, 2004 ARC-LEAP User Instructions Appalachian Regional Commission Local Economic Assessment Package prepared for the Appalachian Regional Commission prepared by Economic Development Research Group, Inc. 2 Oliver Street, 9th Floor, Boston, MA 02109 Telephone 617.338.6775 Fax 617.338.1174 e-mail [email protected] Website www.edrgroup.com January, 2004 ARC-LEAP User Instructions PREFACE LEAP is a software tool that was designed and developed by Economic Development Research Group, Inc. (www.edrgroup.com) to assist practitioners in evaluating local economic development needs and opportunities. ARC-LEAP is a version of this tool developed specifically for the Appalachian Regional Commission (ARC) and it’s Local Development Districts (LDDs). Development of this user guide was funded by ARC as a companion to the ARC-LEAP analysis system. This document presents user instructions and technical documentation for ARC-LEAP. It is organized into three parts: I. overview of the ARC-LEAP tool II. instructions for users to obtain input information and run the analysis model III. interpretation of output tables . A separate Handbook document provides more detailed discussion of the economic development assessment process, including analysis of local economic performance, diagnosis of local strengths and weaknesses, and application of business opportunity information for developing an economic development strategy. Economic Development Research Group i ARC-LEAP User Instructions I. OVERVIEW The ARC-LEAP model serves to three related purposes, each aimed at helping practitioners identify target industries for economic development.
    [Show full text]
  • SQL Server on Linux
    SQL Server on Linux Configuring and administering Microsoft's database solution Jasmin Azemović BIRMINGHAM - MUMBAI SQL Server on Linux Copyright © 2017 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: August 2017 Production reference: 1100817 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78829-180-4 www.packtpub.com Credits Author Copy Editor Jasmin Azemović Safis Editing Reviewer Project Coordinator Marek Chmel Nidhi Joshi Commissioning Editor Proofreader Amey Varangaonkar Safis Editing Acquisition Editor Indexer Tushar Gupta Pratik Shirodkar Content Development Editor Graphics Cheryl Dsa Tania Dutta Technical Editor Production Coordinator Prasad Ramesh Melwyn Dsa About the Author Jasmin Azemović is a university professor active in the database systems, information security, data privacy, forensic analysis, and fraud detection fields.
    [Show full text]
  • Sequence Alignment/Map Format Specification
    Sequence Alignment/Map Format Specification The SAM/BAM Format Specification Working Group 3 Jun 2021 The master version of this document can be found at https://github.com/samtools/hts-specs. This printing is version 53752fa from that repository, last modified on the date shown above. 1 The SAM Format Specification SAM stands for Sequence Alignment/Map format. It is a TAB-delimited text format consisting of a header section, which is optional, and an alignment section. If present, the header must be prior to the alignments. Header lines start with `@', while alignment lines do not. Each alignment line has 11 mandatory fields for essential alignment information such as mapping position, and variable number of optional fields for flexible or aligner specific information. This specification is for version 1.6 of the SAM and BAM formats. Each SAM and BAMfilemay optionally specify the version being used via the @HD VN tag. For full version history see Appendix B. Unless explicitly specified elsewhere, all fields are encoded using 7-bit US-ASCII 1 in using the POSIX / C locale. Regular expressions listed use the POSIX / IEEE Std 1003.1 extended syntax. 1.1 An example Suppose we have the following alignment with bases in lowercase clipped from the alignment. Read r001/1 and r001/2 constitute a read pair; r003 is a chimeric read; r004 represents a split alignment. Coor 12345678901234 5678901234567890123456789012345 ref AGCATGTTAGATAA**GATAGCTGTGCTAGTAGGCAGTCAGCGCCAT +r001/1 TTAGATAAAGGATA*CTG +r002 aaaAGATAA*GGATA +r003 gcctaAGCTAA +r004 ATAGCT..............TCAGC -r003 ttagctTAGGC -r001/2 CAGCGGCAT The corresponding SAM format is:2 1Charset ANSI X3.4-1968 as defined in RFC1345.
    [Show full text]
  • Official Service Contractor for The2018 International Bluegrass Music Association
    International Bluegrass Musical Association OFFICIAL SERVICE September 26 - 29, 2018 CONTRACTOR Raleigh Convention Center Hall C Raleigh, NC Information and Order Forms Table of Contents General Information General Information................................................................2, 3 Payment Policy & Credit Card Authorization.........................4 Third Party Billing & Credit Card Charge Authorization..5,6 Color Chart for Drape, Table Skirts and Carpet...................7 Decorating Services Custom Booth Packages...........................................................8 Furnishing Rentals.......................................................................9 Mailing Address: Custom Signs and Graphics...................................................10 P. O. Box 49837 Greensboro, NC 27419 Labor Cleaning Service.........................................................................11 Street Address: Installation and Dismantle Labor............................................12 121 North Chimney Rock Road Exhibitor Appointed Contractor.........................................13,14 Greensboro, NC 27409 Material Handling Phone: (336) 315-5225 Material Handling General Information............................15,16 Fax: (336) 315-5220 Material Handling Rate Schedule and Order Form.......17,18 Shipping Labels........................................................................19 2 General 2 Information HOLLINS Exposition Services is pleased to have been selected as the Official Service Contractor for the2018 International
    [Show full text]
  • Galileo Formats
    Galileo Formats October 1998 edition Chapters INDEX Introduction Booking File Air Transportation Fares Cars Hotels LeisureShopper Document Production Queues Client File/TravelScreen Travel Information Miscellaneous SECURITY Sign On H/SON SON/Z217 or Sign on at own office SON/ followed by Z and a 1 to 3 character I.D.; the I.D. can be SON/ZHA initials, a number or a combination of both SON/ZGL4HA Sign on at branch agency SON/ followed by Z, own pseudo city code and a 1 to 3 character I.D. SON/Z7XX1/UMP Sign on at 4 character PCC branch agency SON/ followed by Z, own pseudo city code, second delimiter and 1 to 3 character I.D. SB Change to work area B SA/TA Change to work area A; different duty code TA (Training) SAI/ZHA Sign back into all work areas at own office SAI/ZGL4HA Sign back into all work areas at branch agency; SAI/ followed by Z, own pseudo city code and a 1 to 3 character I.D. Sign Off SAO Temporary sign out; incomplete Booking Files must be ignored or completed SOF Sign off; incomplete Booking Files must be ignored or completed SOF/ZHA Sign off override (at own office); incomplete transactions are not protected SOF/ZGL4HA Sign off override (at branch agency); incomplete transactions are not protected; SOF/ followed by Z, own pseudo city code and a 1 to 3 character I.D. SECURITY Security Profile STD/ZHA Display security profile, for sign on HA; once displayed, password may be changed SDA List security profiles created by user (second level authoriser and above) SDA/ZXXØ List security profiles associated with agency XXØ (second level authoriser and above) STD/ZXX1UMP or Display profile STD/ followed by Z, own pseudo city code, second delimiter if pseudo STD/Z7XX1/UMP city code is 4 characters and 1 to 3 character I.D.
    [Show full text]
  • Expert Python Programming Third Edition
    Expert Python Programming Third Edition Become a master in Python by learning coding best practices and advanced programming concepts in Python 3.7 Michał Jaworski Tarek Ziadé BIRMINGHAM - MUMBAI Expert Python Programming Third Edition Copyright © 2019 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 authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been 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. Commissioning Editor: Kunal Chaudhari Acquisition Editor: Chaitanya Nair Content Development Editor: Zeeyan Pinheiro Technical Editor: Ketan Kamble Copy Editor: Safis Editing Project Coordinator: Vaidehi Sawant Proofreader: Safis Editing Indexer: Priyanka Dhadke Graphics: Alishon Mendonsa Production Coordinator: Shraddha Falebhai First published: September 2008 Second edition: May 2016 Third edition: April 2019 Production reference: 1270419 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78980-889-6 www.packtpub.com To my beloved wife, Oliwia, for her love, inspiration, and her endless patience.
    [Show full text]
  • Arc Welding Solutions from ESAB
    Arc Welding solutions from ESAB ESAB Welding & Cutting Products / esabna.com / 1.800.ESAB.123 A full line of arc welding equipment for every application, industry and environment. Arc Welding Equipment Table of Contents Description Page Description Page Process Description .....................................................2 Genuine Heliarc® Tig Torches Arc Welding Equipment Selection Guide ...................4 Heliarc Tig Torch Selection Guide ................................56 Compacts (power source with built-in wire feeder) Gas-Cooled Torches Caddy Mig C200i ............................................................6 HW-24 ...................................................................57 Migmaster™ 215 Pro/280 Pro .........................................8 HW-90 ...................................................................59 MIG, DC Power Sources, CV/CVCC HW-9 .....................................................................61 Aristo™ Mig U5000i .......................................................10 HW-17 ...................................................................63 Origo™ Mig 320/410 ......................................................12 HW-26 ...................................................................65 Origo Mig 4002c/6502c ................................................21 Water-Cooled Torches Wire Feeders - Semi-Automatic HW-20 ...................................................................67 MobileFeed™ 300AVS .....................................................15 HW-18 ...................................................................69
    [Show full text]
  • DICOM Compression 2002
    The Medicine Behind the Image DDIICCOOMM CCoommpprreessssiioonn 22000022 David Clunie Director of Technical Operations Princeton Radiology Pharmaceutical Research The Medicine SScchheemmeess SSuuppppoorrtteedd Behind the Image • RLE • JPEG - lossless and lossy • JPEG-LS - more efficient, fast lossless • JPEG 2000 - progressive, ROI encoding • Deflate (zip/gzip) - for non-image objects The Medicine IInn pprraaccttiiccee mmoossttllyy …… Behind the Image • Lossless JPEG for cardiac angio – multi-frame 512x512x8, 1024x1024x10 – CD-R and on network • Lossless JPEG for CT/MR – mostly on MOD media rather than over network – 256x256 to 1024x1024, 12-16 bits • RLE/lossless/lossy JPEG for Ultrasound – 640x480 single and multiframe 8 bits gray/RGB, text The Medicine BBuutt …… Behind the Image • JPEG lossless not the most effective • JPEG lossy limited to 12 bits unsigned • Undesirable JPEG blockiness • Perception that wavelets are better • Need for better progressive encoding • Need for region-of-interest encoding The Medicine JJPPEEGG LLoosssslleessss Behind the Image • Reasonable predictive scheme – Most often only previous pixel predictor used (SV1), which is not always the best choice • No run-length mode – No way to take advantage of large background areas • Huffman entropy coder – Slow (multi-pass) The Medicine LLoosssslleessss CCoommpprreessssiioonn Behind the Image CALIC Arithmetic 3.91 JPEG2000 VM4 5x3 3.81 JPEG-LS MINE 3.81 JPEG2000 VM4 3.66 2x10 S+P Arithmetic 3.4 JPEG-LS MINE - NO 3.31 Byte All RUN NASA szip 3.09 JPEG best 3.04 JPEG SV
    [Show full text]
  • On the Spectral Theorem of Langlands
    On the Spectral Theorem of Langlands Patrick Delorme April 22, 2021 A` Chantal Abstract We show that the Hilbert subspace of L2pGpF qzGpAqq generated by wave packets of Eisenstein series built from discrete series is the whole space. To- gether with the work of Lapid [18], it achieves a proof of the spectral theorem of R.P. Langlands based on the work of J. Bernstein and E. Lapid [7] on the meromorphic continuation of Eisenstein series from I use truncation on compact sets as J. Arthur did for the local trace formula in [2]. 1 Introduction We denote by E the isometry introduced by E. Lapid in [18], Theorem 2, whose proof involves the meromorphic continuation of of Eisenstein series built from discrete data. A dense subspace of its image is generated by wave packets of these Eisenstein series. We show that this image is equal to L2pGpF qzGpAqq. This is what Lapid calls the second half of the proof of the spectral theorem of Langlands. It achieves a new proof of the spectral theorem of R.P. Langlands ([17], [20]). Notice that the proof of Langlands describes the spectrum as residues of Eisenstein series built from cuspidal data. arXiv:2006.12893v3 [math.RT] 21 Apr 2021 One uses the notion of temperedness of automorphic forms introduced by J. Franke [15](cf. also [21] section 4.4). We show this notion of temperedness is weaker than the notion of temperedness introduced by Joseph Bernstein in [6]. We prove that for bounded sets of unitary parameters, the Eisenstein series are uniformly tempered when the parameter is unitary and bounded.
    [Show full text]