2018Dec Buffalo Python Meetup

Total Page:16

File Type:pdf, Size:1020Kb

2018Dec Buffalo Python Meetup Tim Poulsen Software Engineer R&D Team ACV Labs RASPBERRY PI Overview & Examples Board components Basic setup Python dev Libraries Resources https://github.com/skypanther/PiLit https://www.timpoulsen.com/2018/pi-birdcam.html Camera controller board PyImageSearch blog www.pyimagesearch.com/2015/05/25/basic-motion-detection-and- tracking-with-python-and-opencv/ PI 3B+ Micro SD slot (back side) Power in (micro-USB) HDMI GPIO, I2C, serial CSI camera Stereo audio out Broadcom BCM2837B0, Cortex-A53 (ARMv8) 64-bit SoC @ 1.4GHz 1GB LPDDR2 SDRAM 2.4GHz and 5GHz IEEE Gigabit 802.11.b/g/n/ac 4 x USB 2.0 Ethernet Bluetooth 4.2, BLE OS OPTIONS • Raspbian (customized Debian distro) • NOOBs - an installer, not an OS • Third-party provided Ubuntu, Windows 10 IoT Core, RISC OS, etc. OS SETUP • Download OS “image” .img file • Copy to SD card • Insert in Pi and boot Etcher app - https://www.balena.io/etcher/ DEV ENVIRONMENT • Python 2.x / 3.x • Ruby • C • Wolfram language • C++ • SonicPi • Java • Git • Scratch IDEs Pre-installed: Installable: • Thonny (Python) • VS Code - https:// • Geany (multiple) code.headmelted.com/ • BlueJ (Java) • Spyder • Greenfoot (Java) • Ninja-IDE • Mathematica • • Node-RED Lazarus • Scratch • lots more… PYTHON LIBRARIES Pre-installed: Installable: • Any Python-only library • RPi.GPIO • Or, any that will compile for • GPIO Zero ARM • www.piwheels.org - • PiCamera precompiled packages • e.g. OpenCV, Tensorflow, WiringPi, etc. GPIO BASICS from gpiozero import LED from time import sleep red = LED(17) while True: red.on() sleep(1) red.off() sleep(1) GPIO / I2C / SERIAL https://pinout.xyz/ SERIAL OVER USB import serial # open serial port ser = serial.Serial('/dev/ttyUSB0') # write a string ser.write(b'hello') # close port ser.close() PICAMERA from picamera import PiCamera from time import sleep camera = PiCamera() camera.resolution = (1024, 768) camera.start_preview() # Camera warm-up time sleep(2) camera.capture('foo.jpg') THANKS! • timpoulsen.com • github.com/skypanther • @skypanther • www.linkedin.com/in/timpoulsen.
Recommended publications
  • SCIS Boardman Labs User Manual Version5
    SCIS Common Use Labs in Boardman Hall USER MANUAL Note: The instructions in this manual assume students walking into the labs are first-time users of the labs and are complete novices in using the machines. Table of Contents Page I. Access to Boardman Hall SCIS Labs for Computer Science and New Media Students A. Services Provided 2 B. Gaining Access to Lab Rooms and Computers 3 II. SCIS Common Use Lab (Room 138 Boardman) A. Services Provided 3 B. Use of iMacs on Tables 4 C. Use of Large Table Monitor for Sharing Among Table Group 4 D. Use of Overhead Projector 5 E. Use of Laser Printer (8 ½ by 11” Prints) 6 F. Use of Large Format Plotter 7 G. Software Available on Computers in Room 138 7 H. Equipment Available for Checkout from Room 138 Lab Monitors 8 III. Combined Focus Ring and Stillwater Labs (Rooms 127 and 129 Boardman) A. Services Provided 8 B. Use of iMacs on Tables 9 C. Use of Cybertron PC for AI and VR D. Use of … E. Software Available on Computers in Rooms 127 and 129 F. Equipment Checkout Procedure G. Equipment Available for Checkout from Rooms 127 and 129 Lab Monitors IV. SCIS Student Lounge and Project Work Room (Room 137 Boardman) A. Services Provided B. Use of Large Screen by Students APPENDICES Appendix A. Laptop Computer Recommendations for Computer Science Students Appendix B. Laptop Computer Recommendations for New Media Students Appendix C. Convenient Web Resources for Development of Computer Code Note: On SCIS web site all of the above topics will link to anchors at the same topics below.
    [Show full text]
  • Download User Guide
    SpyderX User’s Guide 1 Table of Contents INTRODUCTION 4 WHAT’S IN THE BOX 5 SYSTEM REQUIREMENTS 5 SPYDERX COMPARISON CHART 6 SERIALIZATION AND ACTIVATION 7 SOFTWARE LAYOUT 11 SPYDERX PRO 12 WELCOME SCREEN 12 SELECT DISPLAY 13 DISPLAY TYPE 14 MAKE AND MODEL 15 IDENTIFY CONTROLS 16 DISPLAY TECHNOLOGY 17 CALIBRATION SETTINGS 18 MEASURING ROOM LIGHT 19 CALIBRATION 20 SAVE PROFILE 23 RECAL 24 1-CLICK CALIBRATION 24 CHECKCAL 25 SPYDERPROOF 26 PROFILE OVERVIEW 27 SHORTCUTS 28 DISPLAY ANALYSIS 29 PROFILE MANAGEMENT TOOL 30 SPYDERX ELITE 31 WORKFLOW 31 WELCOME SCREEN 32 SELECT DISPLAY 33 DISPLAY TYPE 34 MAKE AND MODEL 35 IDENTIFY CONTROLS 36 DISPLAY TECHNOLOGY 37 SELECT WORKFLOW 38 STEP-BY-STEP ASSISTANT 39 STUDIOMATCH 41 EXPERT CONSOLE 45 MEASURING ROOM LIGHT 46 CALIBRATION 47 SAVE PROFILE 50 2 RECAL 51 1-CLICK CALIBRATION 51 CHECKCAL 52 SPYDERPROOF 53 SPYDERTUNE 54 PROFILE OVERVIEW 56 SHORTCUTS 57 DISPLAY ANALYSIS 58 SOFTPROOFING/DEVICE SIMULATION 59 PROFILE MANAGEMENT TOOL 60 GLOSSARY OF TERMS 61 FAQ’S 63 INSTRUMENT SPECIFICATIONS 66 Main Company Office: Manufacturing Facility: Datacolor, Inc. Datacolor Suzhou 5 Princess Road 288 Shengpu Road Lawrenceville, NJ 08648 Suzhou, Jiangsu P.R. China 215021 3 Introduction Thank you for purchasing your new SpyderX monitor calibrator. This document will offer a step-by-step guide for using your SpyderX calibrator to get the most accurate color from your laptop and/or desktop display(s). 4 What’s in the Box • SpyderX Sensor • Serial Number • Welcome Card with Welcome page details • Link to download the
    [Show full text]
  • Fira Code: Monospaced Font with Programming Ligatures
    Personal Open source Business Explore Pricing Blog Support This repository Sign in Sign up tonsky / FiraCode Watch 282 Star 9,014 Fork 255 Code Issues 74 Pull requests 1 Projects 0 Wiki Pulse Graphs Monospaced font with programming ligatures 145 commits 1 branch 15 releases 32 contributors OFL-1.1 master New pull request Find file Clone or download lf- committed with tonsky Add mintty to the ligatures-unsupported list (#284) Latest commit d7dbc2d 16 days ago distr Version 1.203 (added `__`, closes #120) a month ago showcases Version 1.203 (added `__`, closes #120) a month ago .gitignore - Removed `!!!` `???` `;;;` `&&&` `|||` `=~` (closes #167) `~~~` `%%%` 3 months ago FiraCode.glyphs Version 1.203 (added `__`, closes #120) a month ago LICENSE version 0.6 a year ago README.md Add mintty to the ligatures-unsupported list (#284) 16 days ago gen_calt.clj Removed `/**` `**/` and disabled ligatures for `/*/` `*/*` sequences … 2 months ago release.sh removed Retina weight from webfonts 3 months ago README.md Fira Code: monospaced font with programming ligatures Problem Programmers use a lot of symbols, often encoded with several characters. For the human brain, sequences like -> , <= or := are single logical tokens, even if they take two or three characters on the screen. Your eye spends a non-zero amount of energy to scan, parse and join multiple characters into a single logical one. Ideally, all programming languages should be designed with full-fledged Unicode symbols for operators, but that’s not the case yet. Solution Download v1.203 · How to install · News & updates Fira Code is an extension of the Fira Mono font containing a set of ligatures for common programming multi-character combinations.
    [Show full text]
  • How to Access Python for Doing Scientific Computing
    How to access Python for doing scientific computing1 Hans Petter Langtangen1,2 1Center for Biomedical Computing, Simula Research Laboratory 2Department of Informatics, University of Oslo Mar 23, 2015 A comprehensive eco system for scientific computing with Python used to be quite a challenge to install on a computer, especially for newcomers. This problem is more or less solved today. There are several options for getting easy access to Python and the most important packages for scientific computations, so the biggest issue for a newcomer is to make a proper choice. An overview of the possibilities together with my own recommendations appears next. Contents 1 Required software2 2 Installing software on your laptop: Mac OS X and Windows3 3 Anaconda and Spyder4 3.1 Spyder on Mac............................4 3.2 Installation of additional packages.................5 3.3 Installing SciTools on Mac......................5 3.4 Installing SciTools on Windows...................5 4 VMWare Fusion virtual machine5 4.1 Installing Ubuntu...........................6 4.2 Installing software on Ubuntu....................7 4.3 File sharing..............................7 5 Dual boot on Windows8 6 Vagrant virtual machine9 1The material in this document is taken from a chapter in the book A Primer on Scientific Programming with Python, 4th edition, by the same author, published by Springer, 2014. 7 How to write and run a Python program9 7.1 The need for a text editor......................9 7.2 Spyder................................. 10 7.3 Text editors.............................. 10 7.4 Terminal windows.......................... 11 7.5 Using a plain text editor and a terminal window......... 12 8 The SageMathCloud and Wakari web services 12 8.1 Basic intro to SageMathCloud...................
    [Show full text]
  • Anaconda Spyder
    Episode 1 Using the Interpreter Anaconda We recommend, but do not require, the Anaconda distribution from Continuum Analytics (www.continuum.io). An overview is available at https://docs.continuum.io/anaconda. At the time the videos were produced, Anaconda distributed a frontend called Navigator. Through Navigator you can launch applications, manage your installation, and install new applications. Continuum provides documentation for Navigator at https://docs.continuum.io/anaconda/navigator. For an easy-to-use tool you can use from the command line, try conda. From Windows, run conda in the command prompt. From Mac OSX or Linux, open a terminal (Apps/Utilities on OSX). The conda cheat sheet (https://conda.io/docs/_downloads/conda-cheatsheet.pdf) is particularly helpful. Using conda you can update everything from a single package to the entire Anaconda distribution. You can also set up your environment to run both Python 2.7 and a version of Python 3. It is important to install Anaconda "Install for Me Only." You can find detailed installation instructions for your platform at https://docs.continuum.io/anaconda/install. It would be a good idea to open a command line and type conda install anaconda-clean so that you can completely uninstall the distribution should the need arise. Spyder We do strongly recommend the free, open-source Spyder Integrated Development Environment (IDE) for scientific and engineering programming, due to its integrated editor, interpreter console, and debugging tools. Spyder is included in Anaconda and other distributions, or it can be obtained from Github (https://github.com/spyder-ide/spyder). The official Spyder documentation is at https://pythonhosted.org/spyder; however, we recommend that beginners start with the tutorial included with Spyder.
    [Show full text]
  • Christie Spyder Studio User Guide Jun 28, 2021
    User Guide 020-102579-04 Spyder Studio NOTICES and SOFTWARE LICENSING AGREEMENT Copyright and Trademarks Copyright © 2019 Christie Digital Systems USA Inc. All rights reserved. All brand names and product names are trademarks, registered trademarks or trade names of their respective holders. General Every effort has been made to ensure accuracy, however in some cases changes in the products or availability could occur which may not be reflected in this document. Christie reserves the right to make changes to specifications at any time without notice. Performance specifications are typical, but may vary depending on conditions beyond Christie's control such as maintenance of the product in proper working conditions. Performance specifications are based on information available at the time of printing. Christie makes no warranty of any kind with regard to this material, including, but not limited to, implied warranties of fitness for a particular purpose. Christie will not be liable for errors contained herein or for incidental or consequential damages in connection with the performance or use of this material. Canadian manufacturing facility is ISO 9001 and 14001 certified. SOFTWARE LICENSING AGREEMENT Agreement a. This Software License Agreement (the “Agreement”) is a legal agreement between the end user, either an individual or business entity, (“Licensee”) and Christie Digital Systems USA, Inc. (“Christie”) for the software known commercially as Christie® Spyder that accompanies this Agreement and/or is installed in the server that Licensee has purchased along with related software components, which may include associated media, printed materials and online or electronic documentation (all such software and materials are referred to herein, collectively, as “Software”).
    [Show full text]
  • Lean, Mean, & Green
    Contents | Zoom in | Zoom outFor navigation instructions please click here Search Issue | Next Page THE MAGAZINE OF TECHNOLOGY INSIDERS LEAN, MEAN, & GREEN CAN AN ULTRA- PERFORMANCE CAR BE SUPERCLEAN? CHECK OUT THE SPECS ON THESE FOUR SUPERCARS Porsche Spyder 918 WHY GOVERNMENT REGULATORS MAKE A MESS OF ALLOCATING RADIO SPECTRUM CAUGHT! SOFTWARE THAT DETECTS STOLEN SOFTWARE U.S.A. $3.99 CANADA $4.99 DISPLAY UNTIL 3 NOVEMBER 2010 __________SPECTRUM.IEEE.ORG Contents | Zoom in | Zoom outFor navigation instructions please click here Search Issue | Next Page I A S Previous Page | Contents | Zoom in | Zoom out | Front Cover | Search Issue | Next Page BEF MaGS The force is with you Use the power of CST STUDIO SUITE, the No 1 technology for electromagnetic simulation. Y Get equipped with leading edge The extensive range of tools integrated in EM technology. CST’s tools enable you CST STUDIO SUITE enables numerous to characterize, design and optimize applications to be analyzed without leaving electromagnetic devices all before going into the familiar CST design environment. This the lab or measurement chamber. This can complete technology approach enables help save substantial costs especially for new unprecedented simulation reliability and or cutting edge products, and also reduce additional security through cross verification. design risk and improve overall performance and profitability. Y Grab the latest in simulation technology. Choose the accuracy and speed offered by Involved in mobile phone development? You CST STUDIO SUITE. can read about how CST technology was used to simulate this handset’s antenna performance at www.cst.com/handset. If you’re more interested in filters, couplers, planar and multi-layer structures, we’ve a wide variety of worked application examples live on our website at www.cst.com/apps.
    [Show full text]
  • R Lesson 1: R and Rstudio Vanderbi.Lt/R
    R Lesson 1: R and RStudio vanderbi.lt/r Steve Baskauf vanderbi.lt/r Digital Scholarship and Communications Office (DiSC) • Unit of the Vanderbilt Libraries • Support for data best practices (DMP tool, repositories), GIS, copyright, Linked Data (including Wikidata), tools (GitHub, ORCID, Open Science Framework, etc.), and Open Access publishing. • Offers on-demand educational programming, consultations, web resources • Currently offering lessons on Python, R, and GIS • More online at: vanderbi.lt/disc • Email: [email protected] vanderbi.lt/r Is R for you? <root> <tag>text</tag> output XQuery Text <more>something</more> (analysis, </root> structured XML display) beginner Python advanced input branching data structure processing logic looping building and manipulating data structures analysis visualization output transformation advanced R beginner vanderbi.lt/r Uses for R • Statistical analysis • Data wrangling and visualization • Literate programming (R Markdown) • Modeling • Web development (Shiny) This series will serve as a basic introduction to enable you to explore any of these topics vanderbi.lt/r R basics • Free, open source, multiplatform • Package development • makes R extensible, huge, and powerful. • more centrally managed than Python (CRAN=Comprehensive R Archive Network) • R the language vs. RStudio the IDE • R can be run by itself interactively in the console • R code can also be run as a script from the command line • RStudio is an Integrated Development Environment that makes it easier to run R interactively or as an entire script • RStudio is the ONLY common IDE for R (vs. many for Python) vanderbi.lt/r The Anaconda option • Includes Python, R, IDEs (Spyder and RStudio), Jupyter notebooks, and the VS Code editor as options.
    [Show full text]
  • Programming Environments
    Programming Environments Presenter: Steve Baskauf [email protected] CodeGraf landing page • vanderbi.lt/codegraf What is an environment? vanderbi.lt/codegraf Coding environment • The definition of "environment" is a bit murky • We can consider an environment to include: • the value of defined variables • functions available to be used in our code • knowledge about position in file directory structure and other computer-wide parameters Accessing via the shell • Python example • R example Integrated development environment (IDE) What is an integrated development environment (IDE)? • An IDE is a graphical user interface (GUI) for developing code • An IDE includes: • a code editor • a shell • An IDE might include: • tools for examining the environment • formatting help and syntax checking • mechanisms for debugging code • a package manager Thonny example • Thonny is a simple Python IDE Spyder IDE for Python RStudio IDE for R Literate programming with Jupyter notebooks Literate programming • Programming paradigm for making code understandable to humans • Mix text, images, links with code. • Implementable in a primitive fashion with comments (#) • Implementable in a robust way with Jupyter notebooks and R Markdown Example: Jupyter notebooks • Formerly known as "iPython notebooks" (.ipynb file extension) • Now usable with Python, R, and other programming languages • Runnable in a browser when connected to a server • Viewable in GitHub (but not runnable) Functions Functions argument parameter • A function defines a block of code. • We pass arguments into functions: • functionName(argument1, argument2, ...) • It’s good to name functions by what they do. returned Example: value my_latte = make_latte(beans, milk, water) • Functions can be: • built-in • defined by you in your code • defined by somebody else in a module Image: Nykamp DQ, “Function machine f.” From Math Insight.
    [Show full text]
  • Python Guide Documentation 0.0.1
    Python Guide Documentation 0.0.1 Kenneth Reitz 2015 09 13 Contents 1 Getting Started 3 1.1 Picking an Interpreter..........................................3 1.2 Installing Python on Mac OS X.....................................5 1.3 Installing Python on Windows......................................6 1.4 Installing Python on Linux........................................7 2 Writing Great Code 9 2.1 Structuring Your Project.........................................9 2.2 Code Style................................................ 15 2.3 Reading Great Code........................................... 24 2.4 Documentation.............................................. 24 2.5 Testing Your Code............................................ 26 2.6 Common Gotchas............................................ 30 2.7 Choosing a License............................................ 33 3 Scenario Guide 35 3.1 Network Applications.......................................... 35 3.2 Web Applications............................................ 36 3.3 HTML Scraping............................................. 41 3.4 Command Line Applications....................................... 42 3.5 GUI Applications............................................. 43 3.6 Databases................................................. 45 3.7 Networking................................................ 45 3.8 Systems Administration......................................... 46 3.9 Continuous Integration.......................................... 49 3.10 Speed..................................................
    [Show full text]
  • Conversion Therapy
    :<44,9 | 2013 :<44,9c SEXUAL ORIENTATION CONVERSION THERAPY: Can the Government BRIEFS Ban a “Cure?” *(5@6<9-094:<9=0=,(+0:(:;,9& How Many Days Can You Afford To Be Closed? PALINDROME CONSULTING’S EXCELLENT REPUTATION PROVIDES ESSENTIAL “INFORMATION PROTECTION” SERVICES *VZ[LMMLJ[P]LTVUP[VYPUN :LJ\YP[`PKLU[P[`[OLM[ MYH\K\SLU[ZV\YJLZ 7YVHJ[P]L WYL]LU[P]LTHPU[LUHUJL ,MMLJ[P]LKPZHZ[LYYLJV]LY`ZVS\[PVUZ *\[[PUNLKNL[LJOUVSVN`[YLUKZ"PUJS\KPUN *SV\K:VS\[PVUZ -SH[MLL0; Delivering Peace of Mind “DISASTER PROOFING” YOUR BUSINESS For a free book email INFORMATION SO YOU CAN WORK WHILE [email protected] OTHERS TRY TO RECOVER FROM A DISASTER 5,4PHTP.HYKLUZ+Y:\P[L5VY[O4PHTP)LHJO-3 ;LS! L_[,THPS!0:YLKUP'WJPPJWJVT www.pciicp.com 2 www.cabaonline.com :<44,9 2013 CONTENTS 06 President’s Message 08 Editor’s Message 10 Legal Round Up 20 Bishop Leo Frade Evangelist and Convicted Felon? 24 Excerpt from Cubans: An Epic Journey, the Struggle of Exiles for Truth and Freedom 35 Hypnosis: Unlearn the Fear Response of the Subconscious Mind 36 Antitrust and The NCAA Ed O’Bannon v. NCAA 40 Celebrating “El Día Del Abogado”: Spotlight on Jose “Pepe” Villalobos 50 News from the Nation’s Highest Court 64 Dichos de Cuba 66 La Cocina de Christina 67 Moving Forward “LAWYERS ON THE RUN” THE EVENT, WHICH WAS HELD ON APRIL 20, 2013, 56 AT TROPICAL PARK, HAD OVER 500 PARTICIPANTS, ON THE AND RAISED APPROXIMATELY $25,000! COVER :<44,9:<44,9cc SEXUAL ORIENTATION CHANGE EFFORTS 32 The Ninth Circuit Court of Appeals soon will address the constitutionality of California’s first-of-its-kind ban on gay conversion therapy for minors.
    [Show full text]
  • Anaconda, Spider and Rstudio Installation for Windows
    Anaconda & Spider Installation for windows: 1. Please click on the link below https://www.anaconda.com/download/#windows 2. Click on Download, and then you have to check for compatibility of your Pc, after that it will start downloading. 3. Double click the installer to launch. 4. Click Next. 5. Read the licensing terms and click “I Agree”. 6. Select an install for “Just Me” unless you’re installing for all users (which require Windows Administrator privileges) and click Next. 7. Select a destination folder to install Anaconda and click the Next button. 8. Choose whether to add Anaconda to your PATH environment variable. We recommend not adding Anaconda to the PATH environment variable, since this can interfere with other software. Instead, use Anaconda software by opening Anaconda Navigator or the Anaconda Prompt from the Start Menu NOTE: Choose whether to register Anaconda as your default Python. Unless you plan on installing and running multiple versions of Anaconda or multiple versions of Python, accept the default and leave this box checked. 9. Click the Install button. If you want to watch the packages Anaconda is installing, click Show Details 10. Click the Next button. 11. And then click the Finish button. 12. After a successful installation you will see the “Thanks for installing Anaconda” dialog box: Spyder: Spyder, the Scientific Python Development Environment, which is a free integrated development environment (IDE) that is included with Anaconda. It includes: • Editing, • Interactive testing, • Debugging, • Introspection features. Steps for Spyder setup and run a test code: 1. In Window search box, type Spyder and press Enter.
    [Show full text]