Flask Documentation Release 0.7Dev July 14, 2014

Total Page:16

File Type:pdf, Size:1020Kb

Flask Documentation Release 0.7Dev July 14, 2014 Flask Documentation Release 0.7dev July 14, 2014 Contents I User’s Guide1 1 Foreword3 1.1 What does “micro” mean?...........................3 1.2 A Framework and an Example........................4 1.3 Web Development is Dangerous.......................4 1.4 The Status of Python 3.............................4 2 Installation7 2.1 virtualenv....................................7 2.2 System Wide Installation...........................8 2.3 Living on the Edge...............................9 2.4 easy_install on Windows............................9 3 Quickstart 11 3.1 A Minimal Application............................ 11 3.2 Debug Mode.................................. 12 3.3 Routing..................................... 13 3.4 Static Files.................................... 17 3.5 Rendering Templates.............................. 17 3.6 Accessing Request Data............................ 19 3.7 Redirects and Errors.............................. 22 3.8 Sessions..................................... 22 3.9 Message Flashing................................ 23 3.10 Logging..................................... 24 3.11 Hooking in WSGI Middlewares....................... 24 4 Tutorial 25 4.1 Introducing Flaskr............................... 25 4.2 Step 0: Creating The Folders......................... 26 4.3 Step 1: Database Schema........................... 27 4.4 Step 2: Application Setup Code........................ 27 i 4.5 Step 3: Creating The Database........................ 29 4.6 Step 4: Request Database Connections.................... 30 4.7 Step 5: The View Functions.......................... 30 4.8 Step 6: The Templates............................. 32 4.9 Step 7: Adding Style.............................. 34 4.10 Bonus: Testing the Application........................ 35 5 Templates 37 5.1 Jinja Setup.................................... 37 5.2 Standard Context................................ 37 5.3 Standard Filters................................. 38 5.4 Controlling Autoescaping........................... 39 5.5 Registering Filters............................... 39 5.6 Context Processors............................... 40 6 Testing Flask Applications 41 6.1 The Application................................ 41 6.2 The Testing Skeleton.............................. 41 6.3 The First Test.................................. 42 6.4 Logging In and Out.............................. 43 6.5 Test Adding Messages............................. 44 6.6 Other Testing Tricks.............................. 44 6.7 Keeping the Context Around......................... 45 7 Handling Application Errors 47 7.1 Error Mails................................... 47 7.2 Logging to a File................................ 48 7.3 Controlling the Log Format.......................... 49 7.4 Other Libraries................................. 50 8 Configuration Handling 53 8.1 Configuration Basics.............................. 53 8.2 Builtin Configuration Values......................... 54 8.3 Configuring from Files............................. 55 8.4 Configuration Best Practices......................... 55 8.5 Development / Production.......................... 56 9 Signals 59 9.1 Subscribing to Signals............................. 59 9.2 Creating Signals................................ 61 9.3 Sending Signals................................. 61 9.4 Decorator Based Signal Subscriptions.................... 62 9.5 Core Signals................................... 62 10 Pluggable Views 65 10.1 Basic Principle................................. 65 10.2 Method Hints.................................. 66 10.3 Method Based Dispatching.......................... 67 ii 11 The Request Context 69 11.1 Diving into Context Locals.......................... 69 11.2 How the Context Works............................ 70 11.3 Callbacks and Errors.............................. 71 11.4 Teardown Callbacks.............................. 71 11.5 Notes On Proxies................................ 72 11.6 Context Preservation on Error........................ 73 12 Modular Applications with Blueprints 75 12.1 Why Blueprints?................................ 75 12.2 The Concept of Blueprints........................... 76 12.3 My First Blueprint............................... 76 12.4 Registering Blueprints............................. 76 12.5 Blueprint Resources.............................. 77 12.6 Building URLs................................. 78 13 Working with the Shell 81 13.1 Creating a Request Context.......................... 81 13.2 Firing Before/After Request......................... 82 13.3 Further Improving the Shell Experience................... 82 14 Patterns for Flask 83 14.1 Larger Applications.............................. 83 14.2 Application Factories............................. 85 14.3 Application Dispatching............................ 87 14.4 Using URL Processors............................. 90 14.5 Deploying with Distribute.......................... 92 14.6 Deploying with Fabric............................. 95 14.7 Using SQLite 3 with Flask........................... 99 14.8 SQLAlchemy in Flask............................. 101 14.9 Uploading Files................................. 104 14.10 Caching..................................... 108 14.11 View Decorators................................ 109 14.12 Form Validation with WTForms....................... 112 14.13 Template Inheritance.............................. 114 14.14 Message Flashing................................ 115 14.15 AJAX with jQuery............................... 117 14.16 Custom Error Pages.............................. 120 14.17 Lazily Loading Views............................. 121 14.18 MongoKit in Flask............................... 123 14.19 Adding a favicon................................ 126 15 Deployment Options 129 15.1 mod_wsgi (Apache).............................. 129 15.2 CGI........................................ 132 15.3 FastCGI..................................... 133 15.4 uWSGI...................................... 135 15.5 Other Servers.................................. 136 iii 16 Becoming Big 139 16.1 Why consider Forking?............................ 139 16.2 Scaling like a Pro................................ 140 16.3 Dialogue with the Community........................ 140 II API Reference 141 17 API 143 17.1 Application Object............................... 143 17.2 Blueprint Objects................................ 158 17.3 Incoming Request Data............................ 161 17.4 Response Objects................................ 163 17.5 Sessions..................................... 164 17.6 Application Globals.............................. 164 17.7 Useful Functions and Classes......................... 165 17.8 Message Flashing................................ 170 17.9 Returning JSON................................ 171 17.10 Template Rendering.............................. 172 17.11 Configuration.................................. 172 17.12 Useful Internals................................. 174 17.13 Signals...................................... 176 17.14 Class Based Views............................... 177 III Additional Notes 179 18 Design Decisions in Flask 181 18.1 The Explicit Application Object........................ 181 18.2 One Template Engine............................. 182 18.3 Micro with Dependencies........................... 183 18.4 Thread Locals.................................. 183 18.5 What Flask is, What Flask is Not....................... 184 19 HTML/XHTML FAQ 185 19.1 History of XHTML............................... 185 19.2 History of HTML5............................... 186 19.3 HTML versus XHTML............................. 186 19.4 What does “strict” mean?........................... 187 19.5 New technologies in HTML5......................... 188 19.6 What should be used?............................. 189 20 Security Considerations 191 20.1 Cross-Site Scripting (XSS)........................... 191 20.2 Cross-Site Request Forgery (CSRF)...................... 192 20.3 JSON Security.................................. 192 21 Unicode in Flask 195 21.1 Automatic Conversion............................. 195 iv 21.2 The Golden Rule................................ 196 21.3 Encoding and Decoding Yourself....................... 196 21.4 Configuring Editors.............................. 196 22 Flask Extension Development 199 22.1 Anatomy of an Extension........................... 199 22.2 “Hello Flaskext!”................................ 200 22.3 Initializing Extensions............................. 201 22.4 The Extension Code.............................. 202 22.5 Adding an init_app Function......................... 203 22.6 End-Of-Request Behavior........................... 204 22.7 Learn from Others............................... 205 22.8 Approved Extensions............................. 205 23 Pocoo Styleguide 207 23.1 General Layout................................. 207 23.2 Expressions and Statements.......................... 208 23.3 Naming Conventions............................. 209 23.4 Docstrings.................................... 210 23.5 Comments.................................... 210 24 Upgrading to Newer Releases 211 24.1 Version 0.7.................................... 211 24.2 Version 0.6.................................... 215 24.3 Version 0.5.................................... 215 24.4 Version 0.4.................................... 215 24.5 Version 0.3.................................... 216 25 Flask Changelog 217 25.1 Version 0.7.................................... 217 25.2 Version 0.6.1..................................
Recommended publications
  • Lightweight Django USING REST, WEBSOCKETS & BACKBONE
    Lightweight Django USING REST, WEBSOCKETS & BACKBONE Julia Elman & Mark Lavin Lightweight Django LightweightDjango How can you take advantage of the Django framework to integrate complex “A great resource for client-side interactions and real-time features into your web applications? going beyond traditional Through a series of rapid application development projects, this hands-on book shows experienced Django developers how to include REST APIs, apps and learning how WebSockets, and client-side MVC frameworks such as Backbone.js into Django can power the new or existing projects. backend of single-page Learn how to make the most of Django’s decoupled design by choosing web applications.” the components you need to build the lightweight applications you want. —Aymeric Augustin Once you finish this book, you’ll know how to build single-page applications Django core developer, CTO, oscaro.com that respond to interactions in real time. If you’re familiar with Python and JavaScript, you’re good to go. “Such a good idea—I think this will lower the barrier ■ Learn a lightweight approach for starting a new Django project of entry for developers ■ Break reusable applications into smaller services that even more… the more communicate with one another I read, the more excited ■ Create a static, rapid prototyping site as a scaffold for websites and applications I am!” —Barbara Shaurette ■ Build a REST API with django-rest-framework Python Developer, Cox Media Group ■ Learn how to use Django with the Backbone.js MVC framework ■ Create a single-page web application on top of your REST API Lightweight ■ Integrate real-time features with WebSockets and the Tornado networking library ■ Use the book’s code-driven examples in your own projects Julia Elman, a frontend developer and tech education advocate, started learning Django in 2008 while working at World Online.
    [Show full text]
  • Magnetic Silica Particles Functionalized with Guanidine Derivatives For
    www.nature.com/scientificreports OPEN Magnetic silica particles functionalized with guanidine derivatives for microwave‑assisted transesterifcation of waste oil Petre Chipurici1,6, Alexandru Vlaicu1,2,6, Ioan Călinescu1, Mircea Vînătoru1, Cristina Busuioc1, Adrian Dinescu3, Adi Ghebaur1,4, Edina Rusen1, Georgeta Voicu1, Maria Ignat5 & Aurel Diacon1* This study aimed to develop a facile synthesis procedure for heterogeneous catalysts based on organic guanidine derivatives superbases chemically grafted on silica‑coated Fe3O4 magnetic nanoparticles. Thus, the three organosilanes that were obtained by reacting the selected carbodiimides (N,N′‑ dicyclohexylcarbodiimide (DCC), N,N′‑diisopropylcarbodiimide (DIC), respectively 1‑ethyl‑3‑(3‑ dimethylaminopropyl) carbodiimide (EDC) with 3‑aminopropyltriethoxysilane (APTES) were used in a one‑pot synthesis stage for the generation of a catalytic active protective shell through the simultaneous hydrolysis/condensation reaction with tetraethyl orthosilicate (TEOS). The catalysts were characterized by FTIR, TGA, SEM, BET and XRD analysis confrming the successful covalent attachment of the organic derivatives in the silica shell. The second aim was to highlight the capacity of microwaves (MW) to intensify the transesterifcation process and to evaluate the activity, stability, and reusability characteristics of the catalysts. Thus, in MW‑assisted transesterifcation reactions, all catalysts displayed FAME yields of over 80% even after 5 reactions/activation cycles. Additionally, the infuence of FFA content on the catalytic activity was investigated. As a result, in the case of Fe3O4@ SiO2‑EDG, a higher tolerance towards the FFA content can be noticed with a FAME yield of over 90% (for a 5% (weight) vs oil catalyst content) and 5% weight FFA content. Biodiesel can represent a suitable renewable alternative for the direct replacement of standard diesel fuels derived from petroleum sources1,2.
    [Show full text]
  • Next Generation Web Scanning Presentation
    Next generation web scanning New Zealand: A case study First presented at KIWICON III 2009 By Andrew Horton aka urbanadventurer NZ Web Recon Goal: To scan all of New Zealand's web-space to see what's there. Requirements: – Targets – Scanning – Analysis Sounds easy, right? urbanadventurer (Andrew Horton) www.morningstarsecurity.com Targets urbanadventurer (Andrew Horton) www.morningstarsecurity.com Targets What does 'NZ web-space' mean? It could mean: •Geographically within NZ regardless of the TLD •The .nz TLD hosted anywhere •All of the above For this scan it means, IPs geographically within NZ urbanadventurer (Andrew Horton) www.morningstarsecurity.com Finding Targets We need creative methods to find targets urbanadventurer (Andrew Horton) www.morningstarsecurity.com DNS Zone Transfer urbanadventurer (Andrew Horton) www.morningstarsecurity.com Find IP addresses on IRC and by resolving lots of NZ websites 58.*.*.* 60.*.*.* 65.*.*.* 91.*.*.* 110.*.*.* 111.*.*.* 113.*.*.* 114.*.*.* 115.*.*.* 116.*.*.* 117.*.*.* 118.*.*.* 119.*.*.* 120.*.*.* 121.*.*.* 122.*.*.* 123.*.*.* 124.*.*.* 125.*.*.* 130.*.*.* 131.*.*.* 132.*.*.* 138.*.*.* 139.*.*.* 143.*.*.* 144.*.*.* 146.*.*.* 150.*.*.* 153.*.*.* 156.*.*.* 161.*.*.* 162.*.*.* 163.*.*.* 165.*.*.* 166.*.*.* 167.*.*.* 192.*.*.* 198.*.*.* 202.*.*.* 203.*.*.* 210.*.*.* 218.*.*.* 219.*.*.* 222.*.*.* 729,580,500 IPs. More than we want to try. urbanadventurer (Andrew Horton) www.morningstarsecurity.com IP address blocks in the IANA IPv4 Address Space Registry Prefix Designation Date Whois Status [1] -----
    [Show full text]
  • Azure Increase Request Timeout
    Azure Increase Request Timeout Is Val snobby or uninaugurated after regimented Ulric inactivate so yet? Wakefield yo-ho indefeasibly as un-American Shadow bomb her Cherokee interwreathed unsystematically. Jeffrey metricize her peafowl unharmfully, avaricious and dozing. This can increase azure request timeout error and start work only Use this field to test small chunks of CSS code. If all else fails, there are many other settings that can be changed. The other consideration is this is per server so in multiple servers, it provides another means of segmenting load and configuring the resources differently for direct API requests and browser requests for HTML and CSS content. With the fast growing adoption of Kubernetes, and tutorials every week. Any configurable properties can have visited kinsta has django and request timeout for getting the signing region for sending various breaches where it can scale. Are you sure you want to allow comments on this post? Azure slot that webjobs are executed on the real website as well as the staging slot. Activity function to do the actual processing. If your browser shows an error message instead of the website you wanted to open, or arrange a chat, the operation was completely transparent and it has no idea such a transformation happened. This article is too good. Turn your data into revenue, missing, but nothing else. Http trigger azure website with his wife, application times out that clients can increase azure key. The first one was to serialize with a max depth. In the end, the reality slightly altered. As there exist a variety of operating systems, or the API platform.
    [Show full text]
  • Wepgw003 High-Level Applications for the Sirius Accelerator Control System
    10th Int. Particle Accelerator Conf. IPAC2019, Melbourne, Australia JACoW Publishing ISBN: 978-3-95450-208-0 doi:10.18429/JACoW-IPAC2019-WEPGW003 HIGH-LEVEL APPLICATIONS FOR THE SIRIUS ACCELERATOR CONTROL SYSTEM X. R. Resende ∗, F. H. de Sá, G. do Prado, L. Liu, A. C. Oliveira, Brazilian Synchrotron Light Laboratory (LNLS), Campinas, Brazil Abstract the sequence we detail the architecture of the HLA and its Sirius is the new 3 GeV low-emittance Brazilian Syn- current development status. Finally we describe how the chrotron Light source under installation and commissioning integration of the CS has been evolving during machine at LNLS. The machine control system is based on EPICS commissioning and end the paper with conclusion remarks and when the installation is complete it should have a few on what the next steps are in HLA development and testing. hundred thousand process variables in use. For flexible inte- gration and intuitive control of such sizable system a con- CONTROL SYSTEM OVERVIEW siderable number of high-level applications, input/output The Sirius accelerator control system (SCS) is based on controllers and graphical user interfaces have been devel- EPICS [3], version R3.15. All SCS software components oped, mostly in Python, using a variety of libraries, such are open-source solutions developed collaboratively using as PyEpics, PCASPy and PyDM. Common support service git version control and are publicly available in the Sirius applications (Archiver Appliance, Olog, Apache server, a organization page [4] at Github. mongoDB-based configuration server, etc) are used. Matlab The naming system used in Sirius for devices and CS prop- Middle Layer is also an available option to control EPICS erties is based on ESS naming system [5].
    [Show full text]
  • Scalability in Web Apis
    Worcester Polytechnic Institute Scalability in Web APIs Ryan Baker Mike Perrone Advised by: George T. Heineman 1 Worcester Polytechnic Institute 1 Introduction 2 Background 2.1 Problem Statement 2.2 Game Services and Tools 2.2.1 Graphics Engine 2.2.2 Map Editor 2.2.3 Friend Network 2.2.4 Achievements 2.2.5 Leaderboards 2.3 Our Service Definition 2.3.1 Leaderboards 2.4 Service Requirements 2.4.1 Administrative Ease 2.4.2 Security 2.4.3 Scalability 2.5 Internal Service Decisions 2.5.1 Application Framework 2.5.2 Cloud Computing 3 Methodology 3.1 Decisions of Design and Architecture 3.1.1 Leaderboards 3.1.2 API Documentation 3.1.3 Developer Console 3.1.4 Admin Console 3.1.5 Java Client Package 3.1.6 Logging 3.2 Decisions of Implementation 3.2.1 Enterprise vs Public 3.2.2 Front End Implementation 3.2.3 Cloud Computing Provider (AWS) 3.2.4 Web Application Framework Implementation (Flask) 3.2.5 Continuous Integration Service 3.2.6 API 3.2.7 Logging 3.2.8 Database Schema 4 Success Metrics 4.1 Resiliency 4.1.1 Simulated Traffic 4.1.2 Load Testing and Scalability 4.2 Design 4.2.1 Client Perspective 2 4.2.3 Admin Perspective 5 Conclusions & Future Work 5.1 Client Conclusions 5.2 Administrator Conclusions 5.3 The Future 6 References 7 Appendix A ­ Why we chose Leaderboards B ­ Facebook’s Game Development API C ­ Playtomic’s API D ­ Front End Tooling Decision E ­ API Documentation Tool F ­ Elastic Beanstalk 3 1 Introduction Game developers, especially those that make social games, undertake a large amount of work to create them.
    [Show full text]
  • Evaluation and Optimization of ICOS Atmosphere Station Data As Part of the Labeling Process
    Atmos. Meas. Tech., 14, 89–116, 2021 https://doi.org/10.5194/amt-14-89-2021 © Author(s) 2021. This work is distributed under the Creative Commons Attribution 4.0 License. Evaluation and optimization of ICOS atmosphere station data as part of the labeling process Camille Yver-Kwok1, Carole Philippon1, Peter Bergamaschi2, Tobias Biermann3, Francescopiero Calzolari4, Huilin Chen5, Sebastien Conil6, Paolo Cristofanelli4, Marc Delmotte1, Juha Hatakka7, Michal Heliasz3, Ove Hermansen8, Katerinaˇ Komínková9, Dagmar Kubistin10, Nicolas Kumps11, Olivier Laurent1, Tuomas Laurila7, Irene Lehner3, Janne Levula12, Matthias Lindauer10, Morgan Lopez1, Ivan Mammarella12, Giovanni Manca2, Per Marklund13, Jean-Marc Metzger14, Meelis Mölder15, Stephen M. Platt9, Michel Ramonet1, Leonard Rivier1, Bert Scheeren5, Mahesh Kumar Sha11, Paul Smith13, Martin Steinbacher16, Gabriela Vítková9, and Simon Wyss16 1Laboratoire des Sciences du Climat et de l’Environnement (LSCE-IPSL), CEA-CNRS-UVSQ, Université Paris-Saclay, 91191 Gif-sur-Yvette, France 2European Commission Joint Research Centre (JRC), Via E. Fermi 2749, 21027 Ispra, Italy 3Centre for Environmental and Climate Research, Lund University, Sölvegatan 37, 223 62, Lund, Sweden 4National Research Council of Italy, Institute of Atmospheric Sciences and Climate, Via Gobett 101, 40129 Bologna, Italy 5Centre for Isotope Research (CIO), Energy and Sustainability Research Institute Groningen (ESRIG), University of Groningen, Groningen, the Netherlands 6DRD/OPE, Andra, 55290 Bure, France 7Finnish Meteorological Institute,
    [Show full text]
  • Monitoring Wilderness Stream Ecosystems
    United States Department of Monitoring Agriculture Forest Service Wilderness Stream Rocky Mountain Ecosystems Research Station General Technical Jeffrey C. Davis Report RMRS-GTR-70 G. Wayne Minshall Christopher T. Robinson January 2001 Peter Landres Abstract Davis, Jeffrey C.; Minshall, G. Wayne; Robinson, Christopher T.; Landres, Peter. 2001. Monitoring wilderness stream ecosystems. Gen. Tech. Rep. RMRS-GTR-70. Ogden, UT: U.S. Department of Agriculture, Forest Service, Rocky Mountain Research Station. 137 p. A protocol and methods for monitoring the major physical, chemical, and biological components of stream ecosystems are presented. The monitor- ing protocol is organized into four stages. At stage 1 information is obtained on a basic set of parameters that describe stream ecosystems. Each following stage builds upon stage 1 by increasing the number of parameters and the detail and frequency of the measurements. Stage 4 supplements analyses of stream biotic structure with measurements of stream function: carbon and nutrient processes. Standard methods are presented that were selected or modified through extensive field applica- tion for use in remote settings. Keywords: bioassessment, methods, sampling, macroinvertebrates, production The Authors emphasize aquatic benthic inverte- brates, community dynamics, and Jeffrey C. Davis is an aquatic ecolo- stream ecosystem structure and func- gist currently working in Coastal Man- tion. For the past 19 years he has agement for the State of Alaska. He been conducting research on the received his B.S. from the University long-term effects of wildfires on of Alaska, Anchorage, and his M.S. stream ecosystems. He has authored from Idaho State University. His re- over 100 peer-reviewed journal ar- search has focused on nutrient dy- ticles and 85 technical reports.
    [Show full text]
  • Estudio De Web Servers
    UNIVERSIDADE DE VIGO ESCOLA SUPERIOR DE ENXEÑERÍA INFORMÁTICA Proyecto ACSO CURSO 2009/2010 Alumnos: Miguel Portela González Aarón Veiga Olivera Miguel Bermúdez Pena Noelia Pérez Álvarez 1.- INTRODUCCIÓN 2.- ESTADO DEL ARTE 3.- DESCRIPCIÓN TÉCNICA Y CONFIGURACIÓN • CHEROKEE • LIGHTTPD • APACHE • THTTPD 4.- RESULTADOS Y MEDICIONES EXPERIMENTALES 5.- INTERPRETACIÓN DE RESULTADOS 6.- CONCLUSIONES ESTUDIO DE LOS SERVIDORES CHEROKEE APACHE LIGHTTPD THTTPD PROPÓSITO DEL ESTUDIO MEDIR PARÁMETROS DE LOS SERVIDORES COMPROBAR CUÁL DE LOS SERVIDORES ES MEJOR REALIZAR GRÁFICAS DE LOS RESULTADOS OBTENER RESULTADOS Y CONCLUSIONES RESULTADOS ESPERADOS Será un articulo que ayude a una persona que necesite montar un servidor en su empresa para seleccionar la mejor opción. Los motivos y razones estarán fundamentadas en las pruebas y mediciones realizadas No hay estudios similares en la Web Ventajas y desventajas del software y herramientas utilizados DESVENTAJAS VENTAJAS Versiones de los servidores Servidor Versión Cherokee 0.99.19 Lighttpd 1.04.22 Apache 2.02.12 Thttpd 2.25b-6 Plataforma de pruebas CPU Intel Core Duo T2400 1.83GHz HDD Western Digital 250 GB 2.5 5400 rpm ATA Video Ati Radeon X1600 PRO 256MB Memoria RAM 3GB Tarjeta Wireless Intel 3950 ABG S.O. Ubuntu 9.10 Karmic Kernel 2.6.32 Servidor web de alto rendimiento. Es muy rápido, flexible y fácil de configurar. Interfaz gráfica Software libre. Totalmente modular. Multiplataforma (rendimiento nativo para Unix, Linux y Windows). Es un servidor web diseñado para ser rápido, seguro, flexible, y fiel a los estándares. Está optimizado para entornos donde la velocidad es muy importante Es software libre La configuración se realiza mediante la edición de un archivo de texto Características: Virtual hosting CGI, SCGI y FastCGI Soporte para PHP, Ruby, Python y otros Cifrado SSL Compresión (gzip, bzip2, ...) Autenticación (LDAP, htpasswd, otros) … Servidor web flexible, rápido y eficiente, continuamente actualizado y adaptado a los nuevos protocolos.
    [Show full text]
  • 2009 Shareholders Report
    Volume 9, Issue 1 March 2010 Shareholders’ Report 2009 National Weather Service • Weather Forecast Office • Peachtree City, Georgia Status Quo is Not an Option! Lans P. Rothfusz bulk of the rain fell at a less- Meteorologist in Charge than-ideal time (in the middle of the night, at the end of a Big News Items of 2009 ike any Weather Fore- weekend). Forecasting such a cast Office (WFO) in the small-scale, rare and epic event • Historic Flooding (pages 6 and National Weather Ser- with reasonable lead time is un- 10) L vice (NWS) after a ma- fortunately beyond the state of • WFO Wins DOC Silver Medal jor weather event, the Peach- today’s science. Even if it were (page 3) tree City WFO looks carefully for possible, the public must still ways in which warning services respond appropriately. 24-hour rainfall ending September 21st • Decision Support Program and public response might be showing >16” bulls-eye (yellow) over Evolves (page 10) Douglas County. Warnings were in effect, improved. This was the case As you will see in this yet eight people perished in this area. after the deadly September newsletter, ours is not an office floods in North Georgia— that sits still. We pride reduce the loss of life and In Fiscal Year 2009, especially the fateful morning of ourselves in learning from every September 21 when flooding property over time, but they do Congress appropriated event we work. We will con- take time to develop. claimed the lives of ten people. tinue improving our science and $958,900,000 to the NWS To say this was an epic event is skills.
    [Show full text]
  • Python - a Crash Course
    Python - A Crash Course Antonio Lima Networks and Distributed Systems 2012-2013 School of Computer Science - University of Birmingham 15 March 2013 Last week's Homework Write a Python program that counts the occurrences of words in a wordlist. counter = {} with open(filename, "r") as f: for line in f: if line in counter: counter[line] += 1 else: counter[line] = 1 We are asking permission. It's easier to ask forgiveness. Last week's Homework You ask forgiveness by executing a task and recovering if there is an error. counter = {} with open(filename, "r") as f: for line in f: try: counter[line] += 1 except KeyError: counter[line] = 1 That's much better (one operation less). But there's even a more pythonic solution. Last week's Homework You ask forgiveness by executing a task and recovering if there is an error. import collections counter = collections.defaultdict(int) with open(filename, "r") as f: for line in f: counter[line] += 1 5 lines, very readable, correct. Pythonic. Why using Python for Networking? • Well, why not? • Many successful companies/startups are using it. • Google, Yahoo, Dropbox, Quora, Disqus, ... • A lot of libraries are available. • You can build prototypes quickly. The socket module: not only sockets The module provides access to the BSD socket interface. Very low-level. >>> import socket >>> hostname = 'google.com' >>> addr = socket.gothostbyname(hostname) '173.194.41.102' >>> socket.getservbyname('ssh') 22 >>> socket.getservbyname('http') 80 The socket module: a client-server application # Client import socket import
    [Show full text]
  • Comparison of Web Server Software from Wikipedia, the Free Encyclopedia
    Create account Log in Article Talk Read Edit ViewM ohrisetory Search Comparison of web server software From Wikipedia, the free encyclopedia Main page This article is a comparison of web server software. Contents Featured content Contents [hide] Current events 1 Overview Random article 2 Features Donate to Wikipedia 3 Operating system support Wikimedia Shop 4 See also Interaction 5 References Help 6 External links About Wikipedia Community portal Recent changes Overview [edit] Contact page Tools Server Developed by Software license Last stable version Latest release date What links here AOLserver NaviSoft Mozilla 4.5.2 2012-09-19 Related changes Apache HTTP Server Apache Software Foundation Apache 2.4.10 2014-07-21 Upload file Special pages Apache Tomcat Apache Software Foundation Apache 7.0.53 2014-03-30 Permanent link Boa Paul Phillips GPL 0.94.13 2002-07-30 Page information Caudium The Caudium Group GPL 1.4.18 2012-02-24 Wikidata item Cite this page Cherokee HTTP Server Álvaro López Ortega GPL 1.2.103 2013-04-21 Hiawatha HTTP Server Hugo Leisink GPLv2 9.6 2014-06-01 Print/export Create a book HFS Rejetto GPL 2.2f 2009-02-17 Download as PDF IBM HTTP Server IBM Non-free proprietary 8.5.5 2013-06-14 Printable version Internet Information Services Microsoft Non-free proprietary 8.5 2013-09-09 Languages Jetty Eclipse Foundation Apache 9.1.4 2014-04-01 Čeština Jexus Bing Liu Non-free proprietary 5.5.2 2014-04-27 Galego Nederlands lighttpd Jan Kneschke (Incremental) BSD variant 1.4.35 2014-03-12 Português LiteSpeed Web Server LiteSpeed Technologies Non-free proprietary 4.2.3 2013-05-22 Русский Mongoose Cesanta Software GPLv2 / commercial 5.5 2014-10-28 中文 Edit links Monkey HTTP Server Monkey Software LGPLv2 1.5.1 2014-06-10 NaviServer Various Mozilla 1.1 4.99.6 2014-06-29 NCSA HTTPd Robert McCool Non-free proprietary 1.5.2a 1996 Nginx NGINX, Inc.
    [Show full text]