8MM (Columbia - 1999) Cast: Nicolas Cage, Joaquin Phoenix, James Gandolfini, Peter Stormare Screenplay by Andrew Kevin Walker Produced by Gavin Polone, Judy Hofflund and Joel Schumacher Directed by Joel Schumacher Running time: 119 minutes
Note: Some may consider portions of the following text to be spoilers. Be forewarned.
-------------------------------------------------------------
A film revolving around subject matter as morally repugnant as the mythic snuff movie is not one which will exactly inspire a lot of affection; not only will many find the material so thoroughly distasteful that a typical knee-jerk reaction is to reject the entire project outright, but even the more tolerant will find themselves immersed in a harrowing world of debauchery. Equally contentious is that the vague undercurrent of hypocrisy involved in condemning sadistic voyeurs while neglecting to indict the audience's own complicity in partaking this inherently voyeuristic tale. In short, this is the sort of edgy, unpalatable material which one would expect to find tackled in a more daring independent film, not addressed in a big-budget studio production starring Nicolas Cage. However, despite giddy overtures to the contrary, it eventually becomes clear that 8MM, a picture which finds detective Tom Welles (Cage) and newfound sidekick Max California (Joaquin Phoenix) in search of a teenage girl seemingly murdered in an old 8mm reel, is unwilling to explore the iniquitous subject head-on and instead uses it as a basis for rote thriller sequences.
8MM is the newest entry in an oeuvre of mostly unfortunate vigilante pictures by the Internet's most-maligned director, Joel Schumacher, whose effectively provocative FALLING DOWN was more than offset by A TIME TO KILL and his notorious BATMAN films. (There's some irony in that 8MM, with Cage's grim, obsessive leather-clad hero and Phoenix's brash, wisecracking sidekick, captures the ethos of the Dark Knight legend far better than either of his two pictures in the Warner Bros. franchise.) While it's difficult to defend his recent track record, it should be accounted for that Schumacher was working from screenplays by longtime collaborator Akiva Goldsman -- not the most promising of starting points. (I'm not sure that even the greatest director alive could've made anything worthwhile out of the insipid BATMAN AND ROBIN screenplay.)
In this picture, Schumacher instead works from a script from SE7EN scribe Andrew Kevin Walker, and while many comparisons can be drawn between the David Fincher picture and this one (in particular, Walker's morbid fascination with the grotesque), from a narrative standpoint 8MM is largely indebted to Paul Schrader's HARDCORE, which followed George C. Scott in a father's dogged search of his daughter into the depths of the underground sex world; similarly, in the Schumacher film Welles finds himself delving into the seedy underground pornography scene in order to track down the elusive girl in the dated film footage. There's less of a personal tie here -- Welles is essentially a mercenary figure -- but the story is given a paternal angle through an affecting performance by Amy Morton as the missing girl's mother, and imbued with emotional shadings through Welles' transformation into an avenging angel.
The film's early sequences depicting Welles as an adoring family man with wife Amy (Catherine Keener) and a baby daughter carry immediate significance -- 8MM is less interested in establishing a background of normalcy than it is setting up his downfall, hence the cuddling, kissing and I-love-yous give way to uncomfortable silences and increasingly infrequent phone calls from the road as the film progresses. With Amy as his metaphoric lifeline, Welles' deepening disaffection and hardening is revealed by his cold and distant manner as he spirals into the nightmarish abyss.
Curiously, Welles' screening of the snuff film, clearly one of 8MM's most crucial sequences, is far less effective than it ought to be, largely due to the failure to build an ominous mood of dread leading into the scene. It's also not helped by Mychael Danna's percussive predilection -- if ever there was a picture which cried out for a moody Howard Shore score, it would be this.
While the procedural vignettes which follow are competent if unconvincing -- Welles doesn't come off as nearly resourceful enough to trace the girl's path so handily, though clues and breaks in the case clearly pop up in order to expedite the storyline -- the picture hits its stride when it shifts locales to Hollywood and links Welles up with Max, a punky adult store clerk who guides him through the Los Angeles underground sex scene. The film's strength is in its seedy, revulsive depiction of this shadowy world, in no small part due to the sets and lighting; in stark contrast to the almost wholesome, cheerful version of the mainstream pornographic world drawn out in bright colors in BOOGIE NIGHTS, 8MM uncovers the flip aspect of its hidden, seamier side, taking the film into damp, dark basements bathed in cold, clinical neon light. There's a palatable sense of danger in these gritty scenes, and the frequent glimpses of miscellaneous S&M footage (surprisingly graphic for a studio picture, though no moreso than in, say, David Cronenberg's VIDEODROME) in conjunction with the bombardment of disturbing perversions help to create a thoroughly unsettling ambiance fraught with tension. While Schumacher does not capture the same atmosphere of helplessness and despair as Fincher in SE7EN, this film is even more consistently gloomy -- it may not be perpetually overcast, but it's not nearly as jokey and only sporadically dabbles in humour. During its exploration of this depraved underworld, the relentlessly bleak imagery of 8MM is effectively disquieting.
Unfortunately, the picture slips gears shortly thereafter as it seems to lose its nerve and transforms into a fairly routine thriller, employing standard chase and fight scenes in a disappointing move which feels like a commercial concession. Aside from an overbroad performance by Peter Stormare as "the Jim Jarmusch of porn" and the Scooby Doo-like revelation of a surprise villain, it's mostly solidly staged -- there's a sequence which momentarily rivals Clarice Starling's breach into Buffalo Bill's lair in THE SILENCE OF THE LAMBS for tension, and another which momentously hinges upon a decision, similar to the climax of SE7EN -- but it squanders the sordid tone in favour of familiar cathartic slam-bam heroics and vengeance. The inclusion of self-psychoanalysis by the villains was also an unwelcome choice; while occasionally gripping (the villain's rant in the Fincher picture worked on sheer acting prowess), it's usually just goofy, and in 8MM's case, unintentionally laughable -- when one unmasked villain meaningfully readjusted his appearance and launched into a speech about the banality of evil, I almost groaned aloud. When Welles screamed "Why?" at his tormentors, I wasn't counting on such an elaborate and detailed explanation.
Though 8MM's conventional latter half is substantially less enthralling than the scenes leading into it, the strong visual work of the picture is still reasonably successful in evoking a creepy and foreboding atmosphere. Ultimately, the most disturbing thing about the film is how close it comes to becoming something truly memorable before veering back into safer territory.
[ *** (out of four stars) | Alternate Rating: B ]
- Alex Fung, February 27, 1999 email<EMAIL_ADDRESS>web : http://www.ncf.carleton.ca/~aw220/
-- Alex Fung<EMAIL_ADDRESS>| http://www.ncf.carleton.ca/~aw220/ "X-FILES fans come up to me in malls expecting me to be able to fill them in on the whole conspiracy. Half the time I have no idea what they're talking about." - Martin Landau
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Toilets at KSRTC bus station to be renovated
by Staff ReporterToilets that are hardly fit for use at the KSRTC bus station will soon get a new lease of life.
Lions Club of Cochin East will fund and take up the renovation work as part of CSR activities for the club’s golden jubilee year. “The structure itself is strong and will be retained. Only the portions inside will be renovated. The entire cost, which could come up to ₹25 lakh, will be borne by the club. The construction will also be arranged for by the club, and the Kochi Corporation will only provide the necessary plans and permits,” Mayor Soumini Jain said. Earlier, the corporation had sought permission from the KSRTC to take up the renovation work.
Separate men’s and women’s toilets for differently abled persons will also be included in the new plan, she said, along with a ramp for wheelchair access to the toilets. The work is likely to be completed by the end of the year.


Features
A growing set of features
Topology
Health
computation
Metrics
Configuration
validation
Distributed
tracing
{{ .Title }}
{{ .Params.subTitle }}A Microservice Architecture breaks up the monolith into many smaller pieces that are composed together. Patterns to secure the communication between services like fault tolerance (via timeout, retry, circuit breaking, etc.) have come up as well as distributed tracing to be able to see where calls are going. A service mesh can now provide these services on a platform level and frees the application writers from those tasks. Routing decisions are done at the mesh level. Kiali works with Istio to visualise the service mesh topology, features like circuit breakers or request rates. Kiali also includes Jaeger Tracing to provide distributed tracing out of the box.
Get started


Preparation time
30 mins to 1 hour
Cooking time
less than 10 mins
Serves
Serves 3
Anchovies mixed with broccoli makes a super quick, tasty pasta dish. If you have time, try your hand at homemade pasta too!
For the pasta (if making by hand), put the flour in a large bowl, then make a well in the centre. Add the eggs, olive oil and salt and whisk together in the centre. Gradually pull a little bit of flour in each time you stir the mixture. You want to gradually add the flour to the eggs to make a smooth firm dough. Flatten the dough into a disc about 1cm/½in thick, then wrap in cling film and chill for 20 minutes in the fridge.
When the pasta is chilled, remove and place on a lightly floured work surface. Cut in half then use a rolling pin to flatten the dough to a rectangle, turning the pasta as you go to make sure you have an even thickness. Roll each piece of pasta to about 2mm thick – the thinner the better. When the pasta is as thin as you can go, cut into strips about 3mm wide for tagliatelle or thinner for linguine.
Hang over a rolling pin or similar so that the pasta can dry slightly while you make the sauce.
To make the pasta by machine: tip the flour into a food processor, then add the eggs, olive oil and salt and pulse until the mixture forms small crumbs. Tip out on to a work surface and squash into a ball, then knead, pulling the dough together for a couple of minutes, until smooth.
Flour the rollers of the pasta machine. Cut the pasta in half and using a rolling pin, roll to about 5mm thick rectangle. Starting at the thickest setting, feed the dough through the machine, turning the handle with one hand and holding the dough as it comes through the machine with the other. Change the setting on the pasta machine to the next-thickest setting, flour it again if needed and feed the pasta sheet through the machine the same way. Keep going, making the opening smaller each time – you might need to cut the pasta in half lengthways as it gets towards the end. Fold the pasta in half lengthways then cut into strips as above.
For the sauce, add the broccoli to boiling water for 4-5 minutes until just tender.
Meanwhile, bring a large saucepan of salted water to the boil. Add the pasta and cook for 3-4 minutes until it rises to the surface. Drain into a colander, reserving some of the cooking water.
Add the broccoli to the pasta and add the anchovies and mix well to combine. Add 2 tablespoons of the cooking water and cook for 1 minute stirring as you go. The pasta should be coated in the broccoli and anchovy.
Pile the pasta into serving bowls, then top with the Parmesan.


Qoutes of Note
Information technology and business are becoming inextricably interwoven. I don't think anybody can talk meaningfully about one without the talking about the other.
- Bill Gates
Steve Jobs
|
The Bible
|
Bill Gates
|
More


3 writes to _currentIndex
System.Management.Automation (3)
engine\MshMemberInfo.cs (3)
2802
_currentIndex
= -1;
2807
_currentIndex
++;
2840
_currentIndex
= -1;
1 reference to _currentIndex
System.Management.Automation (1)
engine\MshMemberInfo.cs (1)
2808
return MoveNext(_t,
_currentIndex
);


{% extends "get_together/base.html" %} {% load static i18n %} {% block content %}
{% trans "Select which of your organizations you would like to invite this team to." %}


Success!
You've hit it outta here!!
[Thanks to Gawker Media for Jose Bautista infamous bat flip
photo
]


evd: Functions for Extreme Value Distributions
Extends simulation, distribution, quantile and density
functions to univariate and multivariate parametric extreme
value distributions, and provides fitting functions which
calculate maximum likelihood estimates for univariate and
bivariate maxima models, and for univariate and bivariate
threshold models.
Downloads:
Reverse dependencies:
| Reverse depends: |
condmixt, ddst, ensembleMOS, evt0, IDF, mgpd, Renext, RobExtremes, ROptEstOld, truncdist |
| Reverse imports: |
antitrust, cape, climwin, evtclass, extremeStat, flood, intamap, metafuse, mev, mvPot, RecordLinkage, ROlogit, rtdists, SimCorMultRes, tsxtreme, vqtl, Wrapped |
| Reverse suggests: |
distrMod, extraDistr, fitteR, modeest, SCI, sensitivity, TLMoments |
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=evd
to link to this page.


Discover the Ionian islands from a luxury yacht
Find Out MoreA luxury yacht charter offers all you could imagine and more, from absolute relaxation to breathtaking adventure and treasured family moments, it is the ultimate escape. Chartering a yacht allows you to explore a variety of destinations while offering you all the comforts and amenities of a luxury villa. On the map on the right side you can see the cruises that are possible to do in a daily basis.
Get Started!You can visit Ithaka, Kefalonia, Kastos, Kalamos, Scorpios and other landmarks. And port of Nidri is as center as it gets.
Travel safe, fast, with the luxury provided from Sunseeker. 1800HP engines with arneson surface drives
With 3 cabins yacht Arise has 2 double and 2 single beds. Also 2 bathrooms, a kitchen and indoor living.
You can enjoy iconic ionian beaches like egkremnoi, assos and many more
If you like fishing, we are after dentexes, groupers and porgys
We organize party tours. Celebrate on the yacht.
We offer concierge services providing assistance with recomendations and reservations.
Ideal for couples and families
Radar, sonar, wi-fi.
Visit Onasis' Scorpios island, Ulysses' Ithaka and Valaoritis' Madouri in one daily trip.
You can take one of our sugested cruises or plan your own. We can acomodate up to 10 guests on daily and 4 guests sleeping aboard on weekly charter.
| Approximate distance | |
|---|---|
| Tour of Lefkada | 90 km |
| Tour of Ithaka | 155 km |
| Tour of Paxoi | 150 km |
| Tour of Meganisi-Skorpios | 70 km |
| North Kefalonia-Ithaki | 120 km |
| North Kefalonia-Ithaki Long | 155 km |
Ready to start your next holiday on board? Give us a call or send us an email and we will get back to you as soon as possible!


Outline
- -1. Who am I and what am I doing here?
Outline
- 1. Python
- Installation
- (Very) short syntax overview
- Package management
- Virtual environments
- Packages and modules
Outline
- 2. Flask
- Setup
- Routing
- Extensions
- Templates
- Persistence
-1. Who am I and what am I doing here?
I'm Simon
- Began using Python by writing small scripts on my Linux systems
- Used it even more while working in the field of computer vision at the university
- One day I needed a REST backend and naturally began writing it in Python
- And now I'm here to tell you about it!
Python Web Development
- Python mostly used for server side programming
- Not necessarily, but usually done using web frameworks
- Allow you to focus on application logic and not worry about low-level details
- And since you can convert *anything* to JavaScript: Transpilers available to generate JS from Python for client side programming
Web Frameworks
- Full Stack: Has everything you (may not even) need
- Application server, persistence API, template engine, authentication module, AJAX support, etc.
- Examples: Django, TurboGears, web2py
- Micro: Provides a basic setup to get started
- Application server, (template engine)
- Additional requirements are (eventually) brought in via plug-ins
- Examples: Flask, Bottle, Pyramid
Python
- Object oriented
- Strong dynamic typing
- Memory management
- Module and package system
- Feature rich standard library
- Provides a REPL
Python
- No brackets, semicolons, etc.
- Code is structured using indentation
- Standard container classes: Lists, Tuples, Dictionaries (Maps), Sets
- Iterators
- List comprehensions
Python - Styleguide
- Indent with 4 spaces
- Class names should be CapWordFormatted
- Function names should be lowercase, words separated by underscores
- Same holds for variable names
- Complete styleguide: PEP 8
Python - Installation
- Linux and macOS should come with a pre-installed Python distribution. Since these distributions are rather old, we can install a newer one
- Linux: Ask you local package manager (e.g. sudo apt-get install python3 or sudo pacman -S python)
- macOS: Get it from the brewery (brew install python3)
- Python provides a setup for Windows systems
- Make sure to check the option to add Python to your path at the bottom of the first setup screen and it should be availabe from the command line right away
Python Examples - Hello world
# hello_1.py
print("Hello world!")
$ python hello_1.py
Python Examples - Comments
# I'm a single line comment
# We arrrr
# pirates! (And a multi line comment!)
'''
So arrrr we!
'''
Python Examples - Iterating
list_example = [1, 2, 3, 4, 5, 6]
for element in list_example:
print(element)
for element in reversed(list_example):
print(element)
Python Examples - Classes
class A:
def __init__(self): # Constructor
self.variable = 42
self._protected_variable = 23
self.__private_variable = 5
def say_hi(self):
print("Hi Consolis!")
Python Examples - Exception handling
try:
some_method()
except some_exception as e:
print(e)
# raise
Python - Package management
- pip - Pip Installs Python
- Common package management tool
- Packages are listed in the Python Package Index
- As of today, 111187 third-party packages are available
Python - Package management
pip install ${package}
pip uninstall ${package}
pip list
pip freeze > requirements.txt
pip install -r requirements.txt
Python - Virtual environments
- Packages are installed in a per-user or system wide repository
- Many different versions clutter the system
- Virtual environments avoid this by creating local copies of a Python environment
pip install virtualenv
Python - Activating virtual environment
virtualenv venv
source venv/bin/activate
(venv)${PS1}
Python - Modules
What's a module in Python?
- Every single source file in Python represents a module
- It's possible to keep all your code in a single module
- It's better to separate it into multiple modules
- Modules can be imported
- Once a module gets imported, all of its statements are executed until EOF
- What's left on global scope after this initial execution is the modules content
Python - Module example
# consol.py
def say_hi():
print("Hi ConSolis!")
# main.py
import consol
consol.say_hi()
Python - Packages
And what's a package?
- A package is a collection of modules within a folder
- This folder needs an '__init__.py' file
- (Kind of like a package constructor)
- Imports can be relative (recommended for flexibility)
Flask
Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions
Flask
- Werkzeug:
- Werkzeug is a WSGI utility library for Python under BSD license
- Jinja 2:
- Jinja 2 is a full featured template engine for Python with built-in unicode support
- Good intentions:
- Armin Ronacher is a great open source contributor and wrote all of the above and more
Flask - Project structure
- flask/ <- Project folder
|- shoutbox/ <- Application subfolder
|- __init__.py <- shoutbox package
|- venv/ <- Virtual environment
|- run.py <- Script to run application
Flask - Setup
git clone https://github.com/s1hofmann/shoutbox.git
git checkout tags/flask_init
Flask - Setup
- Inside the subfolder 'flask', create a new virtual environment called venv
virtualenv venv
source venv/bin/activate or venv\Scripts\activate
pip install flask
Flask - Setup
- The basic project structure is now set up
- The run.py script is used to run the server (later used for FastCGI)
- Everything related to the actual web application goes inside shoutbox/
- Packages and interpreter are located in venv/
Flask - Hello world
- Edit the file shoutbox_app.py inside the shoutbox folder
# shoutbox/shoutbox_app.py
from flask import Flask
__all__ = ['app'] # Added for imports
app = Flask(__name__)
@app.route('/')
def index():
return "Hello world!"
Flask - Hello world
- Next, import all symbols from shoutbox.py to the package
# shoutbox/__init__.py
from .shoutbox_app import *
Flask - Hello world
- Finally, make the shoutbox application available in run.py
# run.py
#!venv/bin/python
import shoutbox
if __name__ == "__main__":
shoutbox.app.run()
Flask - Hello world
- Now if we start our application
venv/bin/python run.py
- We should see our server listen on port 5000:
* Running on http://<IP_ADDRESS>:5000/ (Press CTRL+C to quit)
Flask - Request routing
- Routing in Flask is configured using decorators
- Two things are required: A route decorator and its corresponding view function
@app.route('/') # Route decorator
def index(): # View function
return "Hello world!"
Flask - Request routing
- Routing supports path variables
- Path variables are specified in angle brackets with an optional type
- The view function receives an argument named after the path variable
@app.route('/hello/‹string:username›') # Route decorator
def say_hi(username): # View function
pass
Flask - Routing exercise
- Complete the '/hello/' route to return a customized string
Flask - Request hooks
- Request hooks can carry out actions before or after requests are routed
- (Similar to servlet filters)
- Flask provides four different hooks
| Hook |
Description |
| @before_first_request
| Runs before the very first request
|
| @before_request
| Runs before every request
|
| @after_request
| Runs after every successful request
|
| @teardown_request
| Runs after every request
|
Flask - Responses
- Flasks automatically wraps return values into valid HTTP responses
- Return value, status code and headers can be represented as tuple
- If no status code is provided, 200 Ok is returned
@app.index('/')
def index():
return ("Hello world!", 204)
Flask - Templates
- We don't actually want to put presentation logic into our controller
- Flasks comes with a template engine called jinja2 to handle this problem
- Templates are rendered by calling the render_template("$template.html") method
- HTML with additional template functions
Flask - Template variables
- render_template takes variable mappings for variables which will be substituted in the template
- render_template("$template.html", template_var=var) substitutes template_var with var
{{ template_var }}
Flask - Template blocks
- Template blocks are defined parts of a template which can be overidden
{% block $name %}
{% endblock %}
Flask - Template inheritance
- Templates can inherit from a super template and override blocks
{% extends 'super_template.html' %}
Flask - Template inheritance
- Similar to inheritance in Python, super templates have to be initialized
- Each blocks requires a super call, otherwise the super templates content will be lost
{% block derived %}
{{ super() }}
{% endblock %}
Flask - Template includes
- Template can include other templates to assemble complex elements
{% include 'other_template.html' %}
Flask - Template control structures
{% if $condition %}
statement
{% else %}
other_statement
{% endif %}
Flask - Template loops
{% for element in elements %}
statement
{% endfor %}
Flask - Templates exercise
- Create template templates/hello.html which renders a personal greeting to the user
- Update the /hello/ route to render your template
@app.route('/hello/‹string:username›')
def say_hi(username):
return render_template(...)
Shortcut!
- Now that we've covered the basics on routes and templates, let's move a bit ahead
git checkout tags/webforms_init
pip install -r requirements.txt
What's next?
- Let's implement a little shout box where users can enter their name and let the world know what grinds their gears!
- What's missing?
- A form to enter data
- A way to persist data
- A way to render entered data
- Filtering shouts per user
Flask - WebForms
- Flask-WTF provides enhanced features to handle web forms
- It supports you in generating HTML code for web forms
- Provides CSRF protection out of the box
pip install flask-wtf
Flask - WebForms
- Forms hold objects derived from Form class
- Standard HTML fields supported: StringField, DateField, IntegerField, SelectField, etc.
- Validators supported: Required, Optional, Length, EqualTo, etc.
- Form content will be available via variables
Flask - WebForms
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired
class MyForm(FlaskForm):
name = StringField('name', validators=[DataRequired()])
submit = SubmitField('submit')
Flask - WebForms exercise
- Create a new file shoutbox/forms.py
- Using the previous sample, build up a ShoutForm
- Provide a StringField for the name, a TextAreaField for the shout and a SubmitField to submit
Intermission - Flask config
- When trying to render the ShoutForm for the first time, a KeyError should be raised
- What's missing is a secret key flask-wtf tries to use to prevent CSRF
- Flask provides a global secret key, which can be set in the app config map
# shoutbox/shoutbox_app.py
app.config['SECRET_KEY'] = "Don't tell anyone!"
Flask - WebForms
- After setting the secret key we still encounter an error
- Per default, Flask only allows "GET" requests
- Additional methods are specified on the route decorator
@app.route('/shout/', methods=["GET", "POST"])
Flask - Persistence
- Now that we got our form set up, we need a way to persist inputs
- Flask provides a plugin to work with SQLAlchemy, a powerful ORM
git checkout tags/database_init
pip install flask-sqlalchemy
Flask - Persistence
- The repository contains an SQLite3 database with the following layout
| name |
type |
| id
| INTEGER
|
| username
| TEXT
|
| text
| TEXT
|
Flask - Persistence
- The Flask config requires the path to the database
- This path is stored in the config under the key "SQLALCHEMY_DATABASE_URI"
- Checkout the tag and configure the database path
Flask - Persistence
- The SQLAlchemy engine is initialized by passing the application object to SQLAlchemy
# shoutbox/shoutbox_app.py
db = SQLAlchemy(app)
- The newly created SQLAlchemy object contains several high level ORM objects like Model, Column or types
Flask - Defining persistence models
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.Text)
email = db.Column(db.Text)
def __init__(self, username, email):
self.username = username
self.email = email
Flask - Defining persistence models
- Create a new file "shoutbox/models.py"
- In this file, import the db object from shoutbox_app
- Using the db object, create your Shout database model
Flask - Cyclic imports
- We need to make the newly defined model available in our controller
- We'll have to import the models module in shoutbox_app
- For this to work, the module has to be imported after the db object has been initialized
Summary
- Flask is a very flexible and extensible framework
- MVC pattern with SQLAlchemy, Jinja2 and Flask
- Lots of additional extensions
- Login
- OAuth
- Websockets
- and more...
- Check the Flask Extension Registry
Thank's for your attention!
Appendix A - External configuration
- Keeping configuration elements inside the code is not that great
- Flask provides a way to configure the application object using a config class
class Config:
SECRET_KEY = 'hard to guess'
DEBUG = False
SQLALCHEMY_DATABASE_URI = 'sqlite:///shoutbox.db'
app.config.from_object($config_object)
Appendix B - Logging
- Logging is essential in web apps
- The application object provides a default logger
app.logger.debug('A value for debugging')
app.logger.error('An error occurred')
- app.logger is a standard logging Logger
- Allows easy modification by adding custom handlers
Appendix C - Custom error pages
- Flask per default renders standard black-and-white error pages
- Decorators allow to register custoom error pages
@app.errorhandler(404)
def page_not_found(error):
return render_template('page_not_found.html'), 404
- Remember to set the correct return status in render_template
Appendix D - Crash reporting
- Uncaught exceptions are very bad
- Logging helps to trace them
- Sentry.io provides crash reporting which integrates seamlessly with Flask
from raven.contrib.flask import Sentry
sentry = Sentry()
sentry.init_app(app, dsn=$sentry_key)
- That's all it takes for detailed crash reporting! (And it's free for hobbyists!
That's it!
This time for real!


| I l@ve RuBoard |
We've been using the Python assignment statement already, to assign objects to names. In its basic form, you write a target of an assignment on the left of an equals sign and an object to be assigned on the right. The target on the left may be a name or object component, and the object on the right can be an arbitrary expression that computes an object. For the most part, assignment is straightforward to use, but here are a few properties to keep in mind:
As we've already seen, Python assignment stores references to objects in names or data structure slots. It always creates references to objects, instead of copying objects. Because of that, Python variables are much more like pointers than data storage areas as in C.
As we've also seen, Python creates variable names the first time you assign them a value (an object reference). There's no need to predeclare names ahead of time. Some (but not all) data structure slots are created when assigned too (e.g., dictionary entries, some object attributes). Once assigned, a name is replaced by the value it references when it appears in an expression.
Conversely, it's an error to use a name you haven't assigned a value to yet. Python raises an exception if you try, rather than returning some sort of ambiguous (and hard to notice) default value.
In this section, we're concerned with the = statement, but assignment occurs in many contexts in Python. For instance, we'll see later that module imports, function and class definitions, for loop variables, and function arguments are all implicit assignments. Since assignment works the same everywhere it pops up, all these contexts simply bind names to object references at runtime.
Table 3.2 illustrates the different flavors of the assignment statement in Python.
|
Operation |
Interpretation |
|---|---|
spam = 'Spam' |
Basic form |
spam, ham = 'yum', 'YUM' |
Tuple assignment (positional) |
[spam, ham] = ['yum', 'YUM'] |
List assignment (positional) |
spam = ham = 'lunch' |
Multiple-target |
The first line is by far the most common: binding a single object to a name (or data-structure slot). The other table entries represent special forms:
The second and third lines are related. When you use tuples or lists on the left side of the =, Python pairs objects on the right side with targets on the left and assigns them from left to right. For example, in the second line of the table, name spam is assigned the string 'yum', and name ham is bound to string 'YUM'. Internally, Python makes a tuple of the items on the right first, so this is often called tuple (and list) unpacking assignment.
The last line shows the multiple-target form of assignment. In this form, Python assigns a reference to the same object (the object farthest to the right) to all the targets on the left. In the table, names spam and ham would both be assigned a reference to the string 'lunch', and so share the same object. The effect is the same as if you had coded ham='lunch', followed by spam=ham, since ham evaluates to the original string object.
Here's a simple example of unpacking assignment in action. We introduced the effect of the last line in a solution to the exercise from Chapter 2: since Python creates a temporary tuple that saves the items on the right, unpacking assignments are also a way to swap two variables' values without creating a temporary of our own.
>>> nudge = 1 >>> wink = 2 >>> A, B = nudge, wink # tuples >>> A, B (1, 2) >>> [C, D] = [nudge, wink] # lists >>> C, D (1, 2) >>> nudge, wink = wink, nudge # tuples: swaps values >>> nudge, wink # same as T=nudge; nudge=wink; wink=T (2, 1)
Now that we've told you the whole story of assignment statements, we should also get a bit more formal in our use of variable names. In Python, names come into existence when you assign values to them, but there are a few rules to follow when picking names for things in our program. Python's variable name rules are similar to C's:
Variable names must start with an underscore or letter, and be followed by any number of letters, digits, or underscores. _spam, spam, and Spam_1 are legal names, but 1_Spam, spam$, and @#! are not.
Python always pays attention to case in programs, both in names you create and in reserved words. For instance, names X and x refer to two different variables.
Names we define cannot be the same as words that mean special things in the Python language. For instance, if we try to use a variable name like class, Python will raise a syntax error, but klass and Class work fine. The list below displays the reserved words (and hence off limits to us) in Python.
|
and |
assert |
break |
class |
continue |
|
def |
del |
elif |
else |
except |
|
exec |
finally |
for |
from |
global |
|
if |
import |
in |
is |
lambda |
|
not |
or |
pass |
|
raise |
|
return |
try |
while |
Before moving on, we'd like to remind you that it's crucial to keep Python's distinction between names and objects clear. As we saw in Chapter 2, objects have a type (e.g., integer, list), and may be mutable or not. Names, on the other hand, are just references to objects. They have no notion of mutability and have no associated type information apart from the type of the object they happen to be bound to at a given point in time. In fact, it's perfectly okay to assign the same name to different kinds of objects at different times:
>>> x = 0 # x bound to an integer object >>> x = "Hello" # now it's a string >>> x = [1, 2, 3] # and now it's a list
In later examples, we'll see that this generic nature of names can be a decided advantage in Python programming.[1]
[1] If you've used C++ in the past, you may be interested to know that there is no notion of C++'s const declaration in Python; certain objects may be immutable, but names can always be assigned. Or usually; as we'll see in later chapters, Python also has ways to hide names in classes and modules, but they're not the same as C++'s declarations.
| I l@ve RuBoard |


Generate a secure password
Six
Seven
Eight
Nine
Ten
Eleven
Twelve
Thirteen
Fourteen
Fifteen
Length
Uppercase
Numbers
Special Characters


DfE enquiries
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
News story
Information about new rules to prevent excluded children returning to school against the headteacher's wishes.
New rules published today will put an end to excluded pupils winning the right to come back to school against the headteacher’s wishes.
Coming into force from this September, the new regulations will apply to maintained schools, academies and pupil referral units. The changes were legislated through the 2011 Education Act.
Currently when a headteacher excludes a child from school, the school can be forced by an appeals panel to re-admit that child. This can lead to a disruptive child continuing to damage their own education as well as that of others - as well as undermining the headteacher’s authority.
Under the new system, headteachers will have the power to exclude a child as long as the decision is legal, reasonable and fair. If the new review panels believe this has not been the case, they will be able to require schools to revisit their decision. They will not be able to force the school to take back the child.
Supporting schools to promote good behaviour is vital to enabling all pupils to achieve their full potential, regardless of their circumstances.
Schools Minister Nick Gibb said:
Raising standards of behaviour in schools is a key priority of the government. It is a vital building block in the government’s objective of raising academic achievement and closing the attainment gap between those from poorer and wealthier backgrounds.
Restoring the authority of teachers and headteachers is an important part of the objective of raising standards of behaviour in schools. When head teachers decide that they have no choice but to expel a persistently disruptive or uncooperative pupil that decision must not be undermined by an appeal process which can result in the pupil returning to the school against the wishes of the school and its leadership.
These new rules preserve the right to have a decision to expel a child reviewed by an independent panel but take away the power to force the return of the pupil to the school.
The new independent review panels will provide a fair and accessible process for considering exclusion decisions in a way that takes account of the impact that poor behaviour can have on the education and welfare of other pupils.
The new exclusions system will also provide additional safeguards for pupils with special educational needs (SEN), in particular through the introduction of the role of SEN experts to advise independent review panels.
In addition, in all cases where schools stand by the decision to exclude following a direction by the review panel to reconsider its decision, schools would have to provide a payment of £4,000 towards the cost of alternative provision for the excluded child.
Ultimately, the government’s intention is to reduce the need for exclusion by supporting schools to manage behaviour and intervene earlier to address any underlying causes. The government is currently trialling a new approach in a number of local authorities with around 300 secondary schools, where schools retain responsibility for permanently excluded pupils and work in partnership to secure better outcomes for pupils at risk of exclusion.
In the academic year 2009 to 2010 there were 5,740 permanent exclusions and 331,380 fixed period exclusions in England. In the same period, 510 appeals against permanent exclusions were heard in the academic year 2009 to 2010. Of these, 110 appeals were determined in favour of the parent, and reinstatement of the pupil was directed in 30 cases.
ENDS
This press notice relates to England only
Latest figures on school exclusions can be found in ‘ Permanent and fixed period exclusions from schools in England 2009/10 ’.
The Department for Education will shortly be publishing revised guidance supporting the new system for exclusions. It will be available online at the DfE website .
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
Published: 13 April 2012


Recategorise 23 More Offences Under Companies Law, Says Panel Report
by PTIBookmark
A government-appointed high level panel has proposed recategorisation of 23 more offences under the companies law.
The committee has suggested amendments to 46 penal provisions, "so as to either remove criminality, or to restrict the punishment to only fine, or to allow rectification of defaults through alternative methods", an official release said on Monday.
The proposals are aimed at further de-clogging of the criminal justice system in the country, it added. As per the committee's report submitted to Corporate Affairs Minister Nirmala Sitharaman, 23 out of the 66 remaining compoundable offences under the Companies Act could be recategorised.
Such offences could then be dealt with in-house adjudication framework wherein these defaults would be subject to a penalty levied by an adjudicating officer.
"Omitting, altogether, 7 compoundable offences; limiting punishment for 11 compoundable offences to only fine by removing provision for imprisonment and recommending that 5 offences be dealt under alternative frameworks," the release said citing the report.
According to the report, there could be reduction in the quantum of penalties in respect of six provisions, which were shifted to the in-house adjudication framework through the recent amendments to the Act. Earlier this year, the corporate affairs ministry de-criminalised 16 minor procedural/technical lapses under the Act into civil wrongs', the release said.
The Company Law Committee is headed by Corporate Affairs Secretary Injeti Srinivas.


The differences between HTML and CSS
Do you like cats? I do. Let's take my Kotya cat as an example to describe the difference between HTML and CSS.
Think of HTML as my cat's skeleton. Yes, HTML is like the skeleton of the page. With HTML you specify the structure of your page by defining what elements it will have and semantics of the elements (header, footer, navigation).
On the other hand, CSS is like my cat's exterior - well-built body, fluffy hair, ginger eyes. How about a cute small hat on the head? So, CSS provides the color, sizing, scaling, and other subtle touches that will make your web page more appealing to look at.
Control flow and loops in our life
Control flow is the order that the instructions or statements or functions are executed. Code is run in order from the first line in the file to the last line, unless we have conditionals and loops that change the control flow.
If I think about control flow and loops in my life, I can find many examples. One of them is making russian pancakes (blini). I make pancakes every weekend for my family. The "Pancake Code" looks like:
- In a large mixing bowl, whisk eggs with oil then add milk.
- Add sugar, salt, baking soda. Mix all ingredients.
- Add flour in equal parts to the milk and egg mixture; mixing well until no lumps are visible.
- Heat a medium non-stick pan over medium heat.
- Pour the batter into the center of the pan and swirl to spread evenly.
- Flip the pancake over, if the surface looks porous and sides are golden.
- Remove the pancake to a serving platter.
- Repeat 5, 6 and 7 until all batter is gone.
As you can see we can find in this "code" if/else statement (check if pancake is golden colour before you flip it/remove to a plate) and loop (continue until all batter is gone).
What is the Document Object Model?
The Document Object Model (DOM) is a programming API for HTML. The Document Object Model represents each of these web pages in a tree-like structure to make it easier to access and manage the elements. With the Document Object Model, programmers can build documents, navigate their structure, and add, modify, or delete elements and content.
The DOM represents the document as nodes and objects. That way, programming languages can connect to the page. Nodes can also have event handlers attached to them. Once an event is triggered, the event handlers get executed.
Let's look at an example - Facebook messenger. You open it, type a message and push the "Send" button or press the "Enter" key. That message is added into your messenger and it will stay in your messenger history.
the difference between accessing data from arrays and objects
An array is a special value, which is used to store multiple values at a time.
Example:
var animals = ["cat", "dog", "hamster"];
We can access an array element by adding an index in square brackets to the variable name. The following code displays "cat":
console.log(animals[0]);
An object is a value too. It's like a collection of key - value pairs. You can use “dot notation” to access the value by the key. It looks like this:
var cup = {count: 3, color: "green", material: "ceramic"};
console.log(cup.color); // "green"
Properties of JavaScript objects can also be accessed using a bracket notation. If property name has a space or property is a dynamic variable, it can only be accessed using the square bracket notation.
var cup = {count: 3, color: "green", material: "ceramic"};
console.log(cup["material"]); // "ceramic"
Functions in JavaScript
Functions are the main “building blocks” of the program. They allow the code to be executed without repetition as many times as you want. Also, functions make a code simple and Functions allow a programmer to divide a big program into a number of small and manageable functions.


CSS - Inline Display or Inline-Block Display
In CSS, the 'display' property influences how an element is shown on the page. The values 'inline' and 'inline-block' both place the element on the same horizontal line as the element before itself (assuming there is space for it), so what is the difference?
Default Display Values
Starting with the basics of display:
Elements with an inline display only take up as much space as needed for their content and their size cannot be altered. Inline elements can sit next to each other on the horizontal line or slot into other elements comfortably. Inline elements are useful for putting small additions into block level elements e.g. using an anchor tag to put a link into a block level paragraph. Default inline elements include a (anchor), span and img. The adjacent code shows an anchor element used inside a block paragraph element.
Elements with a block display value possess an inherent line break, meaning they always start on a new line and always take up the whole line. They can also have their height and width adjusted to better suit the layout of the page or the content of the element. Default block elements include div, p, h1-h6, header, footer and section. The adjacent code shows two block level elements one after the other with no line breaks added.
Inline-Block Elements
Web developers can change the display of elements in CSS to change how to are shown. Giving an element an inline-block display value essentially turns it into a block element without the aforementioned inherent line break. This means its height and width can be altered and it can sit on the same row as other inline or inline-block elements. This allows web developers to horizontally line up as many elements as they can fit on the page. Let's change the paragraph's display value to 'inline-block' and see what happens


Taylor’s Series¶
In order to compute the normal form of an equation \(\dot{x}=f(x)\), the normal_forms.normal_form.normal_form
class first computes the Taylor series of \(f(x)\) up to a specified degree \(k\). The class that implements the Taylor series of \(f(x)\) at a specified center \(x_0\) up to a specified degree \(k\) is normal_forms.jet.jet
.
The reason why the class is called jet
is that the \(k\)-jet centered at \(x_0\) of a function \(f(x)\) is the Taylor’s series truncated at degree \(k\):
Like when creating a normal_form
object, \(f(x)\), \(x_0\), and \(k\) should be supplied to create the jet
object, and non-algebraic functions in \(f(x)\) should be defined with the sympy
variants of those functions. Once the jet
is created, it can be evaluated at points in the domain:
In [1]: from normal_forms import jet
In [2]: import sympy
In [3]: f = lambda x: sympy.exp(x)
In [4]: h = jet(f, x=0, k=10)
In [5]: h(1)
Out[5]: 2.718281801146385
The formula above makes sense for \(f:\mathbb{R}^n\rightarrow\mathbb{R}^p\) with any natural number dimensions \(n\) and \(p\) when \(m\) is a multiindex \(m=(m_1,\ldots,m_n)\) with derivative, exponent, factorial, and absolute value defined as
To follow are a few examples for different choices of domain \(\mathbb{R}^n\) and range \(\mathbb{R}^p\) of \(f\).
A \(\mathbb{R}\rightarrow\mathbb{R}\) example¶
The domain and range may have the same dimension, for example, \(f(x)=\sin(x)\):
(Source code, png, hires.png, pdf)
A \(\mathbb{R}\rightarrow\mathbb{R}^2\) example¶
The dimension of the range may be greater than the dimension of the domain, for example, \(f(t)=(\sin(t),\cos(t))\) viewed here as a parametric plot in the \(xy\)-plane:
(Source code, png, hires.png, pdf)
A \(\mathbb{R}^2\rightarrow\mathbb{R}\) example¶
The dimension of the range may be less than the dimension of the domain, for example, \(f(x,y)=\sin(x)\cos(y)\):
(Source code, png, hires.png, pdf)


Into islands of foreign bodies
SHELL LESS
Liver, brain, kidneys, stomach, pancreas, lungs, uterus, spleen, bladder, heart
RISING JUST ABOVE THE RIM
unlimited ed.
Into islands of foreign bodies
SHELL LESS
Liver, brain, kidneys, stomach, pancreas, lungs, uterus, spleen, bladder, heart
RISING JUST ABOVE THE RIM
unlimited ed.


For a Grails user, it is easy to install Jawr and start using it. The steps to follow are to install the plugin, configure it with the same properties format used in the standard version, and add a couple of URL mapping statements.
Warning: If you are upgrading from a version prior to 2.51, be aware that Jawr now uses a servlet instead of a controller to serve its files. This has several advantages: it is faster, there is no need to fiddle with the grails.mime.file.extensions property, and no controller mappings need to be added. So if you are upgrading, you need to remove the controller mappings, reset the grails.mime.file.extensions property and then follow URL mapping instructions below.
The Jawr plugin is deployed on the grails central repository.
To use it just add it as a dependency to your BuildConfig.groovy as followed :
... plugins { ... compile ":jawr:3.8" ... }
To configure Jawr you must add properties to the Config.groovy file located at the /conf folder of your application. The syntax you must use is exactly the same described for the .properties file used in standard java web applications. Check the config file syntax page for details. Of course, the property values must be quoted in order to avoid syntax errors. Keep in mind that there are a few property keys that don’t apply when using Jawr with Grails. Those are:
Using this syntax, you will be able to define bundles as specified in the relevant documentation pages. Note that you are not forced to use Jawr for both js and css files. If you add none of the jawr.css.* parameters, for instance, Jawr will do no effort to serve CSS files.
Jawr uses sl4j to log messages, so you can configure its tracing level along with the rest of your application. All jawr packages start with net.jawr.*, so you can use that as a key for an appender.
The configuration will indicate to the plugin which Jawr servlet to start.
So if you configure only JS bundle, the plugin will start only the Jawr JS servlet. So to enable the JS or the CSS servlet, you must at least define a bundle of the specified type. To enable the Jawr Binary servlet, which handle images and fonts, you need to define one of the following property : * jawr.img.mapping * jawr.css.classpath.handle.image * jawr.binary.* (Any property which starts with jawr.binary)
There are two ways to map Jawr to requests:
You can define a URL fragment as a prefix (such as ‘/jawr/’) to prefix every URL. Jawr will only serve requests containing this prefix. To use this you must add two special parameters to your Config.groovy file, to specify the prefixes for js and css:
jawr.js.mapping = '/script/' // The value can be anything you want for the prefix jawr.css.mapping = '/style/'
Note that the value for these properties must be a url-mapping string without the wildcard (i.e. with no asterisk).
With either method, once you have filled out the properties, you will be ready to start adding Jawr tags to your pages.
By default, Jawr will handle the following image types : .png, .gif, .jpg, .jpeg, .ico, .ttf, .eot, .woff
You can configure the image mapping by settings the jawr.binary.mappings. If you want to define a set of extension file to handle, you need to list the extension with a semi colon separator, like this :
jawr.binary.mapping='*.png; *.jpg; *.gif'
Jawr Grails Plugin support the use of grails plugins web resources.
The reference of the web resource must start with ‘/plugins/’ followed by the name of the plugin (with or without its version number) and finally the location of the resources in the webapp folder of the plugin.
We will take the example of the jquery plugin
Here is an example of configuration where we reference the jquery script :
jawr.js.bundle.common.id='/js/common.js' jawr.js.bundle.common.mappings='/plugins/jquery/js/jquery/jquery-1.11.1.js'
You can also reference it with the version number but this is not recommended as you will need to change your configuration for each version modification.
jawr.js.bundle.common.id='/js/common.js' jawr.js.bundle.common.mappings='/plugins/jquery-1.11.1/js/jquery/jquery-1.11.1.js'
Grails support in standard the internationalisation of message in the application using the grails-app/i18n/messages resource bundle.
Please check the message generator documentation for more information on the usage of grails i18n messages in Jawr.
The tag library for grails works exactly the same as the JSP version, so you will find all the details in the JSP taglib documentation page.
The only difference is that in GSP pages there is no need to import the tags at all. Also, keep in mind that the namespace for the Jawr taglib is jawr:.
This is how you would use the tags in a typical page:
<html> <head> <jawr:script src="/bundles/yui.js" /> <jawr:style src="/bundles/all.css" /> </head> <body> ... <jawr:img src="/images/logo.png" /> </body> </html>


HTML5 Canvas Benchmark
Sorry, your browser doesn't support the <canvas> element.
Ball count:
FPS:
Click to start
Iteration
No. of Balls