# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from botocore.exceptions import ClientError
from airflow.exceptions import AirflowException
from airflow.contrib.hooks.aws_hook import AwsHook
from six import BytesIO
from urllib.parse import urlparse
import re
import fnmatch
[docs]class S3Hook(AwsHook):
"""
Interact with AWS S3, using the boto3 library.
"""
[docs] def get_conn(self):
return self.get_client_type('s3')
@staticmethod
[docs] def parse_s3_url(s3url):
parsed_url = urlparse(s3url)
if not parsed_url.netloc:
raise AirflowException('Please provide a bucket_name instead of "%s"' % s3url)
else:
bucket_name = parsed_url.netloc
key = parsed_url.path.strip('/')
return bucket_name, key
[docs] def check_for_bucket(self, bucket_name):
"""
Check if bucket_name exists.
:param bucket_name: the name of the bucket
:type bucket_name: str
"""
try:
self.get_conn().head_bucket(Bucket=bucket_name)
return True
except ClientError as e:
self.log.info(e.response["Error"]["Message"])
return False
[docs] def get_bucket(self, bucket_name):
"""
Returns a boto3.S3.Bucket object
:param bucket_name: the name of the bucket
:type bucket_name: str
"""
s3 = self.get_resource_type('s3')
return s3.Bucket(bucket_name)
[docs] def create_bucket(self, bucket_name, region_name=None):
"""
Creates an Amazon S3 bucket.
:param bucket_name: The name of the bucket
:type bucket_name: str
:param region_name: The name of the aws region in which to create the bucket.
:type region_name: str
"""
s3_conn = self.get_conn()
if not region_name:
region_name = s3_conn.meta.region_name
if region_name == 'us-east-1':
self.get_conn().create_bucket(Bucket=bucket_name)
else:
self.get_conn().create_bucket(Bucket=bucket_name,
CreateBucketConfiguration={
'LocationConstraint': region_name
})
[docs] def check_for_prefix(self, bucket_name, prefix, delimiter):
"""
Checks that a prefix exists in a bucket
:param bucket_name: the name of the bucket
:type bucket_name: str
:param prefix: a key prefix
:type prefix: str
:param delimiter: the delimiter marks key hierarchy.
:type delimiter: str
"""
prefix = prefix + delimiter if prefix[-1] != delimiter else prefix
prefix_split = re.split(r'(\w+[{d}])$'.format(d=delimiter), prefix, 1)
previous_level = prefix_split[0]
plist = self.list_prefixes(bucket_name, previous_level, delimiter)
return False if plist is None else prefix in plist
[docs] def list_prefixes(self, bucket_name, prefix='', delimiter='',
page_size=None, max_items=None):
"""
Lists prefixes in a bucket under prefix
:param bucket_name: the name of the bucket
:type bucket_name: str
:param prefix: a key prefix
:type prefix: str
:param delimiter: the delimiter marks key hierarchy.
:type delimiter: str
:param page_size: pagination size
:type page_size: int
:param max_items: maximum items to return
:type max_items: int
"""
config = {
'PageSize': page_size,
'MaxItems': max_items,
}
paginator = self.get_conn().get_paginator('list_objects_v2')
response = paginator.paginate(Bucket=bucket_name,
Prefix=prefix,
Delimiter=delimiter,
PaginationConfig=config)
has_results = False
prefixes = []
for page in response:
if 'CommonPrefixes' in page:
has_results = True
for p in page['CommonPrefixes']:
prefixes.append(p['Prefix'])
if has_results:
return prefixes
[docs] def list_keys(self, bucket_name, prefix='', delimiter='',
page_size=None, max_items=None):
"""
Lists keys in a bucket under prefix and not containing delimiter
:param bucket_name: the name of the bucket
:type bucket_name: str
:param prefix: a key prefix
:type prefix: str
:param delimiter: the delimiter marks key hierarchy.
:type delimiter: str
:param page_size: pagination size
:type page_size: int
:param max_items: maximum items to return
:type max_items: int
"""
config = {
'PageSize': page_size,
'MaxItems': max_items,
}
paginator = self.get_conn().get_paginator('list_objects_v2')
response = paginator.paginate(Bucket=bucket_name,
Prefix=prefix,
Delimiter=delimiter,
PaginationConfig=config)
has_results = False
keys = []
for page in response:
if 'Contents' in page:
has_results = True
for k in page['Contents']:
keys.append(k['Key'])
if has_results:
return keys
[docs] def check_for_key(self, key, bucket_name=None):
"""
Checks if a key exists in a bucket
:param key: S3 key that will point to the file
:type key: str
:param bucket_name: Name of the bucket in which the file is stored
:type bucket_name: str
"""
if not bucket_name:
(bucket_name, key) = self.parse_s3_url(key)
try:
self.get_conn().head_object(Bucket=bucket_name, Key=key)
return True
except ClientError as e:
self.log.info(e.response["Error"]["Message"])
return False
[docs] def get_key(self, key, bucket_name=None):
"""
Returns a boto3.s3.Object
:param key: the path to the key
:type key: str
:param bucket_name: the name of the bucket
:type bucket_name: str
"""
if not bucket_name:
(bucket_name, key) = self.parse_s3_url(key)
obj = self.get_resource_type('s3').Object(bucket_name, key)
obj.load()
return obj
[docs] def read_key(self, key, bucket_name=None):
"""
Reads a key from S3
:param key: S3 key that will point to the file
:type key: str
:param bucket_name: Name of the bucket in which the file is stored
:type bucket_name: str
"""
obj = self.get_key(key, bucket_name)
return obj.get()['Body'].read().decode('utf-8')
[docs] def select_key(self, key, bucket_name=None,
expression='SELECT * FROM S3Object',
expression_type='SQL',
input_serialization=None,
output_serialization=None):
"""
Reads a key with S3 Select.
:param key: S3 key that will point to the file
:type key: str
:param bucket_name: Name of the bucket in which the file is stored
:type bucket_name: str
:param expression: S3 Select expression
:type expression: str
:param expression_type: S3 Select expression type
:type expression_type: str
:param input_serialization: S3 Select input data serialization format
:type input_serialization: dict
:param output_serialization: S3 Select output data serialization format
:type output_serialization: dict
:return: retrieved subset of original data by S3 Select
:rtype: str
.. seealso::
For more details about S3 Select parameters:
http://boto3.readthedocs.io/en/latest/reference/services/s3.html#S3.Client.select_object_content
"""
if input_serialization is None:
input_serialization = {'CSV': {}}
if output_serialization is None:
output_serialization = {'CSV': {}}
if not bucket_name:
(bucket_name, key) = self.parse_s3_url(key)
response = self.get_conn().select_object_content(
Bucket=bucket_name,
Key=key,
Expression=expression,
ExpressionType=expression_type,
InputSerialization=input_serialization,
OutputSerialization=output_serialization)
return ''.join(event['Records']['Payload'].decode('utf-8')
for event in response['Payload']
if 'Records' in event)
[docs] def check_for_wildcard_key(self,
wildcard_key, bucket_name=None, delimiter=''):
"""
Checks that a key matching a wildcard expression exists in a bucket
:param wildcard_key: the path to the key
:type wildcard_key: str
:param bucket_name: the name of the bucket
:type bucket_name: str
:param delimiter: the delimiter marks key hierarchy
:type delimiter: str
"""
return self.get_wildcard_key(wildcard_key=wildcard_key,
bucket_name=bucket_name,
delimiter=delimiter) is not None
[docs] def get_wildcard_key(self, wildcard_key, bucket_name=None, delimiter=''):
"""
Returns a boto3.s3.Object object matching the wildcard expression
:param wildcard_key: the path to the key
:type wildcard_key: str
:param bucket_name: the name of the bucket
:type bucket_name: str
:param delimiter: the delimiter marks key hierarchy
:type delimiter: str
"""
if not bucket_name:
(bucket_name, wildcard_key) = self.parse_s3_url(wildcard_key)
prefix = re.split(r'[*]', wildcard_key, 1)[0]
klist = self.list_keys(bucket_name, prefix=prefix, delimiter=delimiter)
if klist:
key_matches = [k for k in klist if fnmatch.fnmatch(k, wildcard_key)]
if key_matches:
return self.get_key(key_matches[0], bucket_name)
[docs] def load_file(self,
filename,
key,
bucket_name=None,
replace=False,
encrypt=False):
"""
Loads a local file to S3
:param filename: name of the file to load.
:type filename: str
:param key: S3 key that will point to the file
:type key: str
:param bucket_name: Name of the bucket in which to store the file
:type bucket_name: str
:param replace: A flag to decide whether or not to overwrite the key
if it already exists. If replace is False and the key exists, an
error will be raised.
:type replace: bool
:param encrypt: If True, the file will be encrypted on the server-side
by S3 and will be stored in an encrypted form while at rest in S3.
:type encrypt: bool
"""
if not bucket_name:
(bucket_name, key) = self.parse_s3_url(key)
if not replace and self.check_for_key(key, bucket_name):
raise ValueError("The key {key} already exists.".format(key=key))
extra_args = {}
if encrypt:
extra_args['ServerSideEncryption'] = "AES256"
client = self.get_conn()
client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args)
[docs] def load_string(self,
string_data,
key,
bucket_name=None,
replace=False,
encrypt=False,
encoding='utf-8'):
"""
Loads a string to S3
This is provided as a convenience to drop a string in S3. It uses the
boto infrastructure to ship a file to s3.
:param string_data: str to set as content for the key.
:type string_data: str
:param key: S3 key that will point to the file
:type key: str
:param bucket_name: Name of the bucket in which to store the file
:type bucket_name: str
:param replace: A flag to decide whether or not to overwrite the key
if it already exists
:type replace: bool
:param encrypt: If True, the file will be encrypted on the server-side
by S3 and will be stored in an encrypted form while at rest in S3.
:type encrypt: bool
"""
self.load_bytes(string_data.encode(encoding),
key=key,
bucket_name=bucket_name,
replace=replace,
encrypt=encrypt)
[docs] def load_bytes(self,
bytes_data,
key,
bucket_name=None,
replace=False,
encrypt=False):
"""
Loads bytes to S3
This is provided as a convenience to drop a string in S3. It uses the
boto infrastructure to ship a file to s3.
:param bytes_data: bytes to set as content for the key.
:type bytes_data: bytes
:param key: S3 key that will point to the file
:type key: str
:param bucket_name: Name of the bucket in which to store the file
:type bucket_name: str
:param replace: A flag to decide whether or not to overwrite the key
if it already exists
:type replace: bool
:param encrypt: If True, the file will be encrypted on the server-side
by S3 and will be stored in an encrypted form while at rest in S3.
:type encrypt: bool
"""
if not bucket_name:
(bucket_name, key) = self.parse_s3_url(key)
if not replace and self.check_for_key(key, bucket_name):
raise ValueError("The key {key} already exists.".format(key=key))
extra_args = {}
if encrypt:
extra_args['ServerSideEncryption'] = "AES256"
filelike_buffer = BytesIO(bytes_data)
client = self.get_conn()
client.upload_fileobj(filelike_buffer, bucket_name, key, ExtraArgs=extra_args)
[docs] def load_file_obj(self,
file_obj,
key,
bucket_name=None,
replace=False,
encrypt=False):
"""
Loads a file object to S3
:param file_obj: The file-like object to set as the content for the S3 key.
:type file_obj: file-like object
:param key: S3 key that will point to the file
:type key: str
:param bucket_name: Name of the bucket in which to store the file
:type bucket_name: str
:param replace: A flag that indicates whether to overwrite the key
if it already exists.
:type replace: bool
:param encrypt: If True, S3 encrypts the file on the server,
and the file is stored in encrypted form at rest in S3.
:type encrypt: bool
"""
if not bucket_name:
(bucket_name, key) = self.parse_s3_url(key)
if not replace and self.check_for_key(key, bucket_name):
raise ValueError("The key {key} already exists.".format(key=key))
extra_args = {}
if encrypt:
extra_args['ServerSideEncryption'] = "AES256"
client = self.get_conn()
client.upload_fileobj(file_obj, bucket_name, key, ExtraArgs=extra_args)
[docs] def copy_object(self,
source_bucket_key,
dest_bucket_key,
source_bucket_name=None,
dest_bucket_name=None,
source_version_id=None):
"""
Creates a copy of an object that is already stored in S3.
Note: the S3 connection used here needs to have access to both
source and destination bucket/key.
:param source_bucket_key: The key of the source object.
It can be either full s3:// style url or relative path from root level.
When it's specified as a full s3:// url, please omit source_bucket_name.
:type source_bucket_key: str
:param dest_bucket_key: The key of the object to copy to.
The convention to specify `dest_bucket_key` is the same
as `source_bucket_key`.
:type dest_bucket_key: str
:param source_bucket_name: Name of the S3 bucket where the source object is in.
It should be omitted when `source_bucket_key` is provided as a full s3:// url.
:type source_bucket_name: str
:param dest_bucket_name: Name of the S3 bucket to where the object is copied.
It should be omitted when `dest_bucket_key` is provided as a full s3:// url.
:type dest_bucket_name: str
:param source_version_id: Version ID of the source object (OPTIONAL)
:type source_version_id: str
"""
if dest_bucket_name is None:
dest_bucket_name, dest_bucket_key = self.parse_s3_url(dest_bucket_key)
else:
parsed_url = urlparse(dest_bucket_key)
if parsed_url.scheme != '' or parsed_url.netloc != '':
raise AirflowException('If dest_bucket_name is provided, ' +
'dest_bucket_key should be relative path ' +
'from root level, rather than a full s3:// url')
if source_bucket_name is None:
source_bucket_name, source_bucket_key = self.parse_s3_url(source_bucket_key)
else:
parsed_url = urlparse(source_bucket_key)
if parsed_url.scheme != '' or parsed_url.netloc != '':
raise AirflowException('If source_bucket_name is provided, ' +
'source_bucket_key should be relative path ' +
'from root level, rather than a full s3:// url')
CopySource = {'Bucket': source_bucket_name,
'Key': source_bucket_key,
'VersionId': source_version_id}
response = self.get_conn().copy_object(Bucket=dest_bucket_name,
Key=dest_bucket_key,
CopySource=CopySource)
return response
[docs] def delete_objects(self,
bucket,
keys):
"""
:param bucket: Name of the bucket in which you are going to delete object(s)
:type bucket: str
:param keys: The key(s) to delete from S3 bucket.
When ``keys`` is a string, it's supposed to be the key name of
the single object to delete.
When ``keys`` is a list, it's supposed to be the list of the
keys to delete.
:type keys: str or list
"""
if isinstance(keys, list):
keys = keys
else:
keys = [keys]
delete_dict = {"Objects": [{"Key": k} for k in keys]}
response = self.get_conn().delete_objects(Bucket=bucket,
Delete=delete_dict)
return response


Between September 2020 and January 2021, our open data practices survey targeting researchers in eight African countries was live via the JISC Online Survey Tool.
Video used with courtesy of OCSDNet
Surveying Open Data Practices in Research 2020 - Africa
The Internet and progress in digital technologies are increasingly shifting the logic underlying science and research from closed to open systems. This change is affecting even the way data are managed, used and shared. This project will aim to capture the current landscape of open data practices in research. The survey covers eight African countries including Uganda and Ethiopia from East Africa; Burkina Faso and Senegal from West Africa and Botswana, Malawi, Mozambique and Zimbabwe from Southern Africa.
Open Science is more than open access to publications or data.
Nowadays, it is recognized that, considered together, the three following dimensions of openness constitute Open Science: openness to publications and data, openness to society, and openness to excluded knowledges and epistemologies (Chan, Leslie et al. 2020). This project focuses on Open Data, a subset of Open Science that promotes the idea of research data being shared for scrutiny and re-analysis without unnecessary barriers. In recent years, an increasing number of funders, publishers and institutions have made commitments to fostering data sharing practices within the research community.
How we work
Over the past few years several communities have been working on various aspects of open data. Our survey is built on the work that is out there, to which we have added aspects of local context. All information related to this project will be open.
Build on Existing Work
We're building on existing global and African open science and open data surveys that were conducted in the past.
Share Information
The survey instrument, data, analysis scripts, and website template will be made available under open licenses to facilitate re-use.
Prioritise Interoperability
The project will attempt to release a modular and interoperable bank of questions that can be re-used by everyone to develop new surveys.
Tell us about your research data practices
We aim to get wide participation from researchers and postgraduate students across the target countries (i.e. Uganda, Ethiopia, Burkina Faso, Senegal, Botswana, Malawi, Mozambique and Zimbabwe). If you are not from a country listed above, you can still participate. We will analyse all data and make the dataset available for others to analyze countries not covered in this project.
Take the SurveyTimeline of Activities
Early 2020 - Preparation
Prepare project proposal, administrative tasks, project preparation
June/July 2020 - Landscape exploration
Analysis of existing surveys, developing of survey instrument, landscaping study of current data sharing regulations and legislations in Africa
June/July 2020 - Stakeholders
Prepare project proposal, administrative tasks, project preparation
July/August 2020 - Ethics
Preparation/submission of ethics review and engagement with national ethics committees (or similar) in the survey countries and submission of applications (where appropriate)
July/August 2020 - Survey Preparation
Translation of survey materials and preparation of online survey platform
August 2020 - Pilot Rollout
Piloting of survey in-country and amendments to survey where necessary
September-November 2020 - Survey Rollout
Dissemination of survey, collection of data, data preparation, analysis & visualisation
November 2020 - Presentation @ Research Data Alliance Plenary
Presentation of preliminary data at RDA Plenary online
November-December 2020 - Analysis & Dissemination
Continued analysis of data and preparation of feedback documents and articles
January 2021 - Project Close-out
Wrapping up reporting, finalising website, feedback to stakeholders
Core Team
The project builds on work from the RDA Interest Group for Surveying Open Data Practices and many others. The core team members for the 2020 African survey are listed below.
Anne Treasure
Analysis, visualisationAnne has a background in ecology, open data, and data management and recently joined Talarify as research analyst and trainer.
Recent News
Cognizant to the fact that to build capacity within research systems in sub-Saharan Africa, a better understanding of current data sharing practices amongst African researchers is needed, the International Development Research Center (IDRC), has commissioned our team to conduct a survey on data sharing practices in Africa.


BOWFINGER A film review by Steve Rhodes Copyright 1999 Steve Rhodes RATING (0 TO ****): *** 1/2
"We're trying to make a movie here, not a film," explains Bobby Bowfinger (Steve Martin), head of Bowfinger International Pictures.  In possession now of a great script by his accountant and part-time receptionist, Bobby has only one problem. In order to turn the script -- CHUBBY RAIN, about aliens falling to earth in fat raindrops -- into a "go picture," he just needs famous action hero Kit Ramsey (Eddie Murphy) to star in it.
Superstar Kit doesn't give small-potatoes producer Bobby the time of day, forcing Bobby to improvise. He will resort to guerilla filmmaking techniques and shoot Kit's scenes from hidden cameras. Kit will never know he's in the movie, and most of CHUBBY RAIN's cast and crew don't know that Kit doesn't know. ("Did you know that Tom Cruise had no idea he was in that vampire movie until two years later?" Bobby tells his cameraman.)
The inventive and resourceful Bobby has an answer for every problem. Need some lighting for a shot? Just have a guy on the street hold a reflective "Work for Food" sign and use the sun to illuminate Kit's face.
Frank Oz, who gave us the riotously funny IN AND OUT (one of the best movies of 1997), directs BOWFINGER with near perfection. As they did in DIRTY ROTTEN SCOUNDRELS, Oz and Martin form a great team. Together with Murphy and a scene-stealing Heather Graham (AUSTIN POWERS: THE SPY WHO SHAGGED ME), the cast and crew of BOWFINGER are as wonderful as those in CHUBBY RAIN are humorously appalling.
Steve Martin's script is a classic bit of comedic writing with a long list of memorable lines. The most amazing part of the script is that it gets laughs the old-fashioned way without benefit of flatulence jokes, bathroom humor or bodily fluids.
The movie deliciously skewers Tinseltown. Bobby reveals such secrets as the fact that every movie costs exactly $2,184 -- which is what he has saved away. Everything above that sum is overhead in the forms of gross points, mark-ups, etc. With this sum he hires "the best damn crew we can afford," which means they go to the border and collect some free illegal aliens.
In the story's best subplot, Daisy (Graham) plays a would-be starlet from the Midwest who's given herself one week to hit it big in movieland. She's a fast learner. "I may be from Ohio," she explains. "But, I'm not from Ohio." She realizes quickly the tried and true method for a young actress to advance her career overnight -- figuring out the right people to sleep with. Daisy's so bright and fast, that she flits from partner to partner, rapidly moving up the food chain. Graham, with her pixyish grin and her girl-next-door sexuality is the perfect choice for the role. She takes what could be a slightly sleazy part and turns it into a sweet and charming one instead. "Who cares if when I reach my sexual peak, you'll be 70," Daisy tells Bobby with sincere conviction as they frolic in bed.
Murphy shows an acting dexterity and a risk-taking openness that's impressive. As Kit, he dares to be unsure of himself and completely paranoid. As Jiff, a shy guy who would be happy to work his way up to gofer, Murphy, with bad teeth and braces, plays a second part. When they can't find Kit for a while, Jiff is hired to film some of Kit's scenes. Jiff blushes or cries, not as an act, but because he's embarrassed or scared.
In Jiff's interview, Bobby probes whether Jiff would be willing to alter his appearance in order to look like Kit. "Would you be willing to cut your hair?" Bobby probes. "Yes, but it's usually better if someone else does it," Jiff replies sincerely, missing the point of the question entirely. He does have movie experience; he says that he's a frequent renter at Blockbuster.
Another subplot pokes fun at stars' fascination with Scientology, called Mind Head in the movie and led by an ethereal Terry Stricter (Terence Stamp, Chancellor Valorum from STAR WARS: EPISODE I). As CHUBBY RAIN's actors keep coming up to him talking about aliens, Kit becomes neurotic and unbalanced. Kit flees to his guru, Terry, who peppers him with aphorisms. Kit should mean "Keep It Together," Kit repeats to himself with little confidence. After volumes of useless pop advice, Terry eventually realizes what's happening to Kit. "It seems the paranoid sometimes are actually being followed," Terry concludes.
As the movie advances towards a climax worthy of CHARIOTS OF FIRE, the energetic pacing reaches fever pitch. In a sort of epilogue, we get to glimpse Bobby's next movie, which is so outrageously bad that an uncontrollable fit of laughter is the most likely response. BOWFINGER and both of the movies within it are thoroughly satisfying. Even if they charged you for all three, it would be worth the triple admission price.
BOWFINGER runs 1:37. It is rated PG-13 for sex-related material and language and would be fine for kids 10 and up.
My son Jeffrey, age 10, thought the movie was hilarious and gave it a full ****. His favorite part was the high-spirited ending.
Email<EMAIL_ADDRESS>Web: http://www.InternetReviews.com
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


Black Judge:
Sinning is easy. Atoning for those sins, however, is much more difficult. Are you really prepared for this? We will test your resolve to its utmost on your journey of penitence...
Are you ready to follow the path away from riches and fame?
"I seek redemption."


Goliath WON'T be putting up windmills in the sea off Ayr
The giant machine is just waiting for new work elsewhere
by Stephen HoustonShe is one of the bulkiest things ever seen in Ayr Bay.
But thankfully MPI Adventure is just awaiting the next job.
The 454 foot long ship weighs nearly 15,000 tons and puts up wind turbines.
Heaven forbid they could ever spoil the view of Arran from the Ayrshire coast..
Our photographer Euan McCall took this shot from Ayr pier, where she is lying 2.5 miles out.
The six big legs are 240 feet long and can fix turbines to the sea bed at depths of up to 130 feet.
And the big crane can lift 1000 tons at a time.
The Chinese built vessel is so big it can accommodate a crew of 200 and has Rolls Royce engines totalling 21,750 horse power.
An Ayr Port spokesman confirmed the MPI Adventure was “just resting.”


Immutability is easy
Immutability is abstraction. It does not "exist" in nature,World is mutable, world is permanently changing,So it's quite natural for data structures to be mutable that they describe the state of the real or simulated object at a given moment in time. but problems will arise in computer world when:
1.data structures are modified from concurrent threads
2.users provide conficting changes for the same objects
3.a user provide an invalid data and it should be rolled back
how to solve these problems? solutions is :immutable or volatile and synchronized lock.we know lock is enemy of performance, lock is blocking, and volatile has some shortcomings, The only choice is immutable.
so immutable is a performance design pattern, Once it is being constructed, it will forever change,in java all fields in it is "final", no setXXX method that you can change any field. when you publish a immutable object is thread safe.
so if we use immutable pattern to avoid transaction lock such as database lock or java synchronized.
next problem is for programmers how to know which datas is immutable?
that is Value Object of DDD(Domain-driven desgin)：
"An object that represents a descriptive aspect of the domain with no conceptual identity is called a VALUE OBJECT. VALUE OBJECTS are instantiated to represent elements of the design that we care about only for what they are, not who or which they are." [Evans 2003]
the primary difference to me between Entities and Value Objects is identity，If I have two instances to Value Objects with same internal values, they should be considered equal，If you can't make a Value Object
- Immutable
- value equality rather than reference equality
Then it probably isn't a Value Object，
so if a domain expert designs a object is value object, then we know the object is immutable. then software system would be pleased with it.
in scala, they are happy because they can use Immutability + Actor model for concurrency programming, how to implement a immutable value object in Java?
in Java I think we can have a happy concurrency programming by Immutability + ES Model of JdonFramework, here is a immutable class from open source jivejdon:
public class ForumState {
private final AtomicLong threadCount;
private final AtomicLong messageCount;
private final ForumMessage lastPost;
private final Forum forum;
private final SubscribedState subscribedState;
public ForumState(Forum forum, ForumMessage lastPost, long messageCount, long threadCount) {
super();
this.forum = forum;
this.lastPost = lastPost;
this.messageCount = new AtomicLong(messageCount);
this.threadCount = new AtomicLong(threadCount);
this.subscribedState = new SubscribedState(new ForumSubscribed(forum));
}
...
}
|
I use "final" for this value object:ForumState, so these fields in VO never be modified seperately,
if you want to change one of them, you must replcae the whole VO, replacing a object is a atomc operating,
so no need any locks.
according DDD, we need a Factory to manage immutable objects's lifecycle, so I create a Factory for creating the value object ForumState:
| public interface ForumStateFactory { |
|
| void init(Forum forum, ForumMessage lastPost); |
|
| void addNewMessage(Forum forum, ForumMessage newLastPost); |
|
| void addNewThread(Forum forum, ForumMessage newLastPost); |
|
| void updateMessage(Forum forum, ForumMessage forumMessage); |
|
| } |
what is difference this ForumStateFactory with other factory ? no synchronized method,there is a contrast as below:
Immutability always be there. we can find it by Value Object at first. and it can improve our system performance.
|


This code was updated from the Java source to work with Processing.js asynchronous image loading.
Calculates the histogram of an image. A histogram is the frequency distribution of the gray levels with the number of pure black values displayed on the left and number of pure white values on the right.
Original Processing.org Example: Histogram
// All Examples Written by Casey Reas and Ben Fry // unless otherwise stated. size(200, 200); colorMode(RGB, width); int[] hist = new int[width]; // Load an image from the data directory // Load a different image by modifying the comments PImage a; a = loadImage("data/cdi01_g.jpg", null, function(){ image(a, 0, 0); // Calculate the histogram for (int i=0; imaxval) { maxval = hist[i]; } } // Normalize the histogram to values between 0 and "height" for (int i=0; i


 You must go and build houses for yourselves. But take care that the wolf does not catch you."
The three little pigs set off. "We will take care that the wolf does not catch us," they said.
Soon they met a man. Hover over me


The Moist Meter is an experimental measurement system that you can use to safely gauge just how moist a video game or movie is going to be before playing it or viewing it. Avoid the dry products and only use the wettest.
created by @moistcr1tikal, @zealotonpc


open class FooterImpl : BaseLayoutImpl<Footer, FooterHolder>
Created by gaoyunfei on 2018/3/9.
FooterImpl(: Footer) |
open fun getHolderClass(): Class<FooterHolder> |
|
open fun getLayout(): Int |
open fun equals(other: Any?): Boolean |
|
open fun getSource(): Data |
|
open fun <T : Any> getSourceUnSafe(): T |
|
fun id(): String |
|
open fun isSelectable(): Boolean |
|
open fun isSelected(): Boolean |
|
open fun setId(id: String): Unit |
|
open fun setSelectable(selectable: Boolean): Unit |
|
open fun setSelected(selected: Boolean): Unit |


My name is Davis an upcoming software developer, I studied at Mount Kenya University and now enrolled to Moringa school for in depth developer things. I perfectly skilled in javascript and hope to level up to python in order to meet up the full- stack passion too.
I enrolled at moringa beacuse it the best place where world class developers are natured and in that same environment net working is the valuable 'asset' taht brought me here. My current hobbies is web surfing and reading fantasy novel. You could catch me at one of the public libraries one day.
The idea of becoming a software developer is to able to build my own dreams and other (friends) with my own hands. This is just to add on the already acquired skills in other languages. Moringa is the best.


You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Issues
| # | Summary | Product | Status | Kind | When |
|---|---|---|---|---|---|
| 1642 |
Ruby 1.9 compatibility |
Walrus | open | feature request | Created , updated |
| 1641 |
Build preference panel as universal (32/64-bit) |
Synergy | open | feature request | |
| 1640 |
Fuzzy finding for open buffers only |
Command-T | closed | feature request | |
| 1639 |
Crash when invoked in new tab |
Command-T | closed | bug | |
| 1637 |
gvimrc "set anti" comment is wrong |
wincent.git | closed | bug | |
| 1636 |
Score already-open files more highly (show at top of list) |
Command-T | closed | feature request | Created , updated |
| 1635 |
Mark already-open files in bold |
Command-T | closed | feature request | Created , updated |
| 1634 |
Alternate file "forgotten" after dismissing Command-T |
Command-T | open | bug | Created , updated |
| 1633 |
Add `rvm use system` note to installation instructions |
Command-T | closed | feature request | Created , updated |
| 1632 |
if can add a highlight matched characters(just like textmate), its would be betterhighlight matched characters(just like textmate) |
Command-T | closed | feature request | Created , updated |


Home
Spotlights
To properly view this page, make sure you have the latest version of Flash installed and Javascript turned on.
Mission Statement
Capital Programs, Architects & Engineeers (A&E) provides the Riverside campus with a physical environment which supports the teaching, research and public service goals of the university.
A&E is committed to working in partnership with the faculty, campus administration, students, and the community-at-large to anticipate and meet the evolving needs of the campus, consistent with the high academic standards of the University of California.


Exploration and Exploitation Dilemma
In this lecture, we study the dilemma of exploitation and exploration. Exploration aims at collecting information and exploitation aims at using the information to gain as much reward as possible.
The problem of exploration and exploitation can be analyzed in the multi-armed bandit setting,
which is the most fundamental and simplest problem in reinforcement learning. The insights achieved by the theoretical analysis can be also helpful for more complex problems, like contextual bandits and full MDPs.
Multi-Armed Bandit
The multi-armed bandit problem is defined by the tuple $<A,R>$, where $A$ is a finite set of actions (or arms) and $R$ is the reward function. At each time step, an arm needs to be chosen and a reward is drawn from an unknown density $p(r|a)$. The agent must select the arm which maximizes the conditional expected reward.
We define the action-value function $q(a)=E\{R|A=a\}$ (note that the environment is equivalent to a 1-step MDP) and the optimal action is given by $a^*=\arg\max_a q(a)$.
Unfortunately, the densities associated to each arm are unknown and the agent must be able to balance exploring new arms and exploiting the knowledge of already visited arms. In general, the agent incurs in a loss when taking decisions. We define the regret at time as $t$ $I_t=E\{q(a^*)-q(a_t)\}$ and the total regret as $L_t=E\{\sum_{\tau=1}^t q(a^*)-q(a_\tau)\}$.
Note that
Minimizing the total regret consists of picking more frequently actions with low gap. The total regret is an indicator which tells which algorithm is able to explore/exploit optimally.
Algorithm Analysis: Greedy Algorithms
A greedy algorithm has two steps:
- Action-value estimation, through Monte-Carlo estimation $Q_t(a)=\frac{1}{N_t(a)}\sum_{\tau=1}^t1[a_\tau=a]r_\tau$.
- Choose arm greedily $a_t=\arg\max_a Q_t(a)$
Note that greedy algorithms incur in linear total regret. Once a wrong action is taken, the algorithm can continue to pick that action, thus adding the same gap at each timestep. To understand this phenomenon consider the following example
Suppose that there are three arms $a_1,a_2,a_3$ and that
- $a_1$ is the optimal arm visited only few times
- $a_2$ and $a_3$ are visited many times
Now, the greedy algorithm performs a Monte-Carlo estimate of the average reward for each arm. This estimate has lower variance for frequently visited arms than rarely visited ones (see the curves for each arm in the picture). Note that the algorithm chooses the arm greedily and it always selects arm $a_3$. This choice is suboptimal.
Algorithm Analysis: $\epsilon$-Greedy Algorithms
A common strategy is to introduce random exploration in the arm selection stage. In fact, we can pick a random arm with probability $\epsilon$ and pick arm $a_t=\arg\max_a Q_t(a)$ with probability $1-\epsilon$.
This strategy avoids to get stuck to selecting wrong arms. Nevertheless, it is suboptimal because noise is introduced at each time step. To understand this, consider previous example. Action $a_2$ can be selected even though we are almost sure that it is not optimal and therefore we are wasting decisions.
Note that
Therefore (by recalling the relation between total regret and the total number of visits for arm $a$)
$$L_t\geq \frac{\epsilon t}{|A|}\sum_{a\in A}\Delta_a$$Therefore, greedy algorithms incur in linear total regret.
Question. Can we do better?
Yes, one strategy is to perform optimistic initialization (all actions are initially good) and then we can act greedily. This is a trick that works particularly well in practice, but it has no theoretical guarantee on the performance.
Yes, we can also decay $\epsilon$, but in general it is difficult to devise a theoretically grounded strategy for decaying it.
Question. Can we do better by guaranteeing a sublinear total regret?
Algorithm Analysis: Optimal Algorithm
In 1985 Lai and Robbins showed that the total regret of any algorithm for the multi-armed bandit can be lower bounded, namely:
$$E\{N_t(a)\}\geq\frac{\log t}{KL\big\{p(r|A=a)||p(r|A=a^*)\big\}} \quad\text{for}\quad t\rightarrow\infty$$and therefore (by recalling the relation between total regret and the total number of visits for arm $a$)
$$L_t\geq \log t\sum_{a\neq a^*}\frac{\Delta_a}{KL\big\{p(r|A=a)||p(r|A=a^*)\big\}} \quad\text{for}\quad t\rightarrow\infty$$The optimal algorithm achieves an asymptotical logarithmic total regret.
Question. How can we achieve that?
The answer can be obtained by considering the example described above. Note that, the most uncertain action $a_1$ has the biggest potential to be the optimal one (the tail on the right is the highest one), whereas we can confidently say that action $a_2$ is likely to be worse than action $a_3$ as the estimates differ and have low variance. Therefore, we can balance exploration and exploitation by taking into account the estimates together with their uncertainty.
Algorithm Analysis: Upper Confidence Bound (UCB)
Instead of considering only the estimate of the action-value function, we can consider an upper bound on the estimate and ensure that the true value is smaller than the bound with very high probability.
At this purpose, we can recall the Hoeffding's inequality.
Hoeffding's inequality. Given a random variable $X$ defined on the $[0,1]$ sample space. If we get an i.i.d set of samples $x_1,...,x_t$ and define the sample mean $\bar{x}_t=\frac{1}{t}\sum_{\tau=1}^tx_\tau$, then
$$P\big(E\{X\}>\bar{x}_t+u\big)\leq e^{-2tu^2}$$
Now, we can use it for our estimates. In fact, assume that the reward is defined on $[0,1]$, we have that $Q_t(a)=\frac{1}{N_t(a)}\sum_{\tau=1}^t1[a_\tau=a]r_\tau$. Therefore,
$$P\big(q(a)>Q_t(a)+U_t(a)\big)\leq e^{-2N_t(a)U_t(a)^2}$$We define probability $p=e^{-2N_t(a)U_t(a)^2}$, then we get that $U_t(a)=\sqrt{\frac{-\log p}{2N_t(a)}}$.
And by decreasing $p$ over time (in order to ensure that the true value is finally included with certainty), e.g. $p=t^{-4}$, we obtain that
The UCB algorithm selects actions according to the followig rule:
$$a_t=\arg\max_a Q_t(a)+\sqrt{\frac{2\log t}{N_t(a)}}$$The paper of Auer et al. 2002 proves that the UCB algorithm satisfies the following bound, namely:
$$E\{N_t(a)\}\leq\frac{8\log t}{\Delta_a^2}+c_1 \quad\text{for any }t$$where $c$ is a small constant. Therefore (by recalling the relation between total regret and the total number of visits for arm $a$)
$$L_t\leq 8\log t\sum_{a\neq a^*}\frac{1}{\Delta_a}+c_2 \quad\text{for any }t$$where $c_2$ is a small constant. UCB achieves logarithmic total regret.
The algorithm is not optimal though as the proved bound is worse than the one proved by Lai and Robbins. In fact, you can prove that $KL\{p(r|A=a)||p(r|A=a^*)\}\geq 2\Delta_a^2$, in other words that $\frac{1}{KL\{p(r|A=a)||p(r|A=a^*)\}}\leq \frac{0.5}{\Delta_a^2}$.
Therefore, $\frac{1}{KL\{p(r|A=a)||p(r|A=a^*)\}}\leq \frac{0.5}{\Delta_a^2}<\frac{8}{\Delta_a^2}$. The paper of Auer et al. 2002 provides more sophisticated strategies than the UCB algorithm, improving the constant $8$ in the bound by getting closer to $0.5$ (see the paper for further details).
Algorithm Analysis: Bayesian Upper Confidence Bound
(FOR SCALAR REWARDS)
Note that our aim is to compute an estimate of the true value $q(a)$ given a set of observations of rewards.
Let's define $\bar{r}_a=q(a)$ and $\hat{r}_a$ as the sample mean estimate of the true value $\bar{r}_a$. $\hat{r}_a$ is a random quantity and we can assume that it has Gaussian density (by considering that $\bar{r}_a$ is a sample mean estimate and by using the central limit theorem for sufficiently large number of such samples).
Therefore, we define $p(\hat{r}_a|\mu_a,\sigma_a^2)=\mathcal{N}(\hat{r}_a;\mu_a,\sigma_a^2)$ and a prior $p(\mu_a,\sigma_a^2)$ (which is typical uniform).
Given the set of all rewards observed up to time $t$ for action $a$,viz. $D_t^a$, the algorithm performs the following steps:
- Compute the posterior for time $t$
\[\begin{align}p(\mu_a,\sigma_a^2|D_t^a) &= \frac{p(D_t^a|\mu_a,\sigma_a^2)p(\mu_a,\sigma_a^2)}{Z} \\ &\propto p(D_t^a|\mu_a,\sigma_a^2)p(\mu_a,\sigma_a^2) \\ &= \prod_{r\in D_t^a}p(\hat{r}_a=r|\mu_a,\sigma_a^2) \\ &= \prod_{r\in D_t^a}\mathcal{N}(\hat{r}_a=r;\mu_a,\sigma_a^2)p(\mu_a,\sigma_a^2) \end{align}\] - Get $\mu_a$ and $\sigma_a$
- Select arm according to $$a_{t+1}=\arg\max_a \mu_a+c\sigma_a$$ where $c$ is an arbitrary positive integer.
This algorithm is optimal for sufficiently large number of visits for action $a$ and for specific choices of $c$. Nevertheless, there are solutions which do not require setting any hyperparameter.
Algorithm Analysis: Thompson Sampling
Assume that we have:
- a set of observations $D=\{(a_1,r_1),\dots,(a_t,r_t)\}$
- a parametric reward probability $p(r|a,\theta)$
- a prior over parameters, $p(\theta)$
Note that greedy algorithms attempt to maximize
$$\begin{align} q(a) &= E\{R|A=a,D\} \\ &= \int r p(r|A=a,D) dr \\ &= \int r \int p(r|A=a,D,\Theta=\theta)p(\theta|A=a,D) d\theta dr \\ &= \int \int r p(r|A=a,D,\Theta=\theta) dr p(\theta|A=a,D) d\theta \\ &= \int E\{R|A=a,D,\Theta=\theta\}p(\theta|A=a,D)d\theta \end{align}$$Thompson sampling approaches the problem differently, in the sense that it attempts to estimate $p(a\text{ is optimal}|D)$ and maximize it. In fact,
$$\begin{align} p(a\text{ is optimal}|D) &= \int p(a\text{ is optimal},\Theta=\theta|D) d\theta \\ &= \int p(a\text{ is optimal}|\Theta=\theta,D) p(\theta|D) d\theta \\ &= \int 1\big[E\{R|A=a,\Theta=\theta,D\}=\max_{a'}E\{R|A=a',\Theta=\theta,D\}\big]p(\theta|D) d\theta \end{align}$$Basically, this integral performs a partition of the parameter space $\Theta$ (where each region has its own optimal actions) and uses the posterior $p(\theta|D)$ to compute $p(a\text{ is optimal}|D)$ for all $a$. See the following picture for an example of 2 dimensional parameter space
Computing the integral is usually intractable. Therefore, one can
- Compute the posterior $p(\theta|D)$.

- Compute $E\{R|A=a,\Theta=\theta,D\}$ for all $a$.
- Choose with probability 1 the action corresponding to the highest $E\{R|A=a,\Theta=\theta,D\}$.
Note that these steps are different from greedy algorithms. In fact, we choose action $a$ proportionally to its probability of being optimal (in other words we perform probability matching).
To better understand the difference with respect to greedy algorithms, let's consider the case of binary rewards (Bernouilli bandits). In this case, we have that $p(\theta|D)=\prod_{a\in A}p(\theta_a|D)$.
In greedy algorithms, we have that
and we choose the arm with highest mean value of parameter posterior (we compute an expectation over the whole parameter space).
In Thompson sampling, we maximize
$$p(a\text{ is optimal}|D)=\int 1\big[\theta_a=\max_{a'}\theta_a'\big]p(\theta_a|D) d\theta_a$$
In this case, we integrate only on the region of the parameter space for which the arm is optimal. Note that Thompson sampling achieves logarithmic total regret in Bernouilli bandits.
Algorithm Analysis: Algorithms based on Information State
Assume that we have:
- a parametric reward probability $p(r|a,\theta)$
- a conjugate prior over parameters, $p(\theta)$
An information state is defined to capture all information available so far. In the case of Bernouilli bandits, the reward probability is a Bernouilli distribution $Be(\theta_a)$ and the parameter prior is the Beta distribution $B(\alpha_a,\beta_a)$. The information state is defined as the vector containing the hyperparameters of the Beta prior, namely $\tilde(s)=[\alpha_1,\beta_1,\dots,\alpha_K,\beta_K]$.
By using the definition of information state, we can define a MDP, namely $<\tilde{S},A,\tilde{P},R,\gamma>$. Note that in the case of conjugate priors, the hyperparameters can be computed in closed form (for example in Bernouilli bandits $\alpha_a\leftarrow\alpha_a+1$ if $r=1$ and $\beta_a\leftarrow\beta_a+1$ if $r=0$). This is important because we know the transition probability $\tilde{P}$ and we can use dynamic programming to find the optimal strategy. For this reasons, algorithms based on information state are optimal to balance exploration and exploitation.
If dynamic programming cannot be used, we can use other RL algorithms (that we have already introduced in previous lectures).
Contextual Bandit
A contextual bandit is a tuple $<A,S,R>$, where
- we have an unknown density over states $p(s)$
- we have a density for rewards $p(R=r|S=s,A=a)$
Note that a contextual bandit introduces states compared to multi-armed bandits. Furthermore, it differs from the full RL setting, as the states are not influenced by any action or previous state (therefore we don't have a transition probability between states).
Contextual bandits have been used for personalized web advertising. Each state is used to describe the specific preferences of each user, actions are used to select which advertising to display to the user and rewards consists of advertising clicks made by each user.
Example from Paper
Consider the following setting:
- a linear reward model $r_s^a=\phi(s,a)^T\mu, \phi(s,a)^T\Sigma\phi(s,a)\theta$
- Gaussian prior over the parameters $\theta\sim\mathcal{N}(\mu,\Sigma)$ with diagonal $\Sigma$
- a dataset of observations $D=\{(s_1,a_1,r_1),\dots,(s_T,a_T,r_T)\}$
Then, we know that $r$ is a linear transformation of random vector $\theta$, thus $r_s^a\sim\mathcal{N}\big(\phi(s,a)^T\mu, \phi(s,a)^T\Sigma\phi(s,a)\big)$.
The proposed algorithm maximizes the following objective with respect to $\mu,\Sigma$
Afterwards, it selects actions for given state $s'$ by using the following upper confidence bound
$$\begin{align} a^* &= \arg\max_a \phi(s',a)^T\mu^* + c\sqrt{\phi(s',a)^T\Sigma^*\phi(s',a)} \end{align}$$Full MDPs
The same principles used in multi-armed bandits can be applied to the full MDP problem. Please, see the slides of David Silver for further details on this.
Final Remarks
It is important to mention that there are other factors that have to be considered when dealing with exploration and exploitation. For example, in extremely large state spaces it is not possible to explore all possible states. Therefore, we need to decide which subset of states to explore. Another example consists of safety-concerned applications, where state exploration must provide some safety guarantees.


--- title: Writing a recursive function in R - or, tweets on tweets author: '' date: '2020-02-07' slug: writing-a-recursive-function-in-r categories: [r, tutorial] tags: [] ---
Recursion has been a topic I’ve heard about, and even read about it, but have never used. Recently, I was analyzing data for the Next Generation Science Standards hashtag on Twitter, and was puzzled to find that some of the Tweets I had accessed were replies to Tweets which were themselves not in the data set.
Fortunately, the rtweet R package returns data on which Tweet a reply is to; using these, it is possible (using rtweet) to access the original Tweet.
But, this raises an issue: What if the Tweet a reply is to is itself a reply (to another Tweet)? This problem starts to become a little complex. The solution I had tried was to use a while loop; this worked basically fine, but I sensed there might be a better way. I talked this through with a student, and determined to see whether I could get it to work this way.
This post represents my attempt to write a recursive function - one that involves calling itself.
First, let’s access the data. I use rtweet to access 1,000 recent Tweets with the #rstats hashtag.
library(rtweet)
d <- search_tweets("#rstats", n = 1000)
Here is my attempt at writing a recursive function; it takes one argument, statuses
, which is the status ids for the Tweets a reply is to; the reply_to_status_id
column in the data collected from rtweet.
get_replies_recursive <- function(statuses, existing_data = NULL) {
statuses <- statuses[!is.na(statuses)] # this line removes the NAs, which are very common because most Tweets are not replies
new_data <- lookup_statuses(statuses)
print(paste0("Accessed ", nrow(new_data), " new Tweets"))
new_statuses <- new_data$reply_to_status_id[!is.na(new_data$reply_to_status_id)]
if (is.null(existing_data)) {
out_data <- new_data
} else {
out_data <- rbind(new_data, existing_data)
}
if (length(new_statuses) > 0) {
# this is the key line where the function calls itself, but passing new statuses
get_replies_recursive(new_statuses, existing_data = out_data)
} else {
print(paste0("Accessed ", nrow(out_data), " new Tweets in total"))
return(out_data)
}
}
Using it is simple; you just pass the variable for the status ids for the Tweets a reply is to.
new_replies <- get_replies_recursive(d$reply_to_status_id)
## [1] "Accessed 17 new Tweets"
## [1] "Accessed 4 new Tweets"
## [1] "Accessed 4 new Tweets"
## [1] "Accessed 3 new Tweets"
## [1] "Accessed 1 new Tweets"
## [1] "Accessed 1 new Tweets"
## [1] "Accessed 1 new Tweets"
## [1] "Accessed 31 new Tweets in total"
I’m unsure exactly how much more better (clear, efficient) using recursion is here, compared to the former approach I tried; I think this code is a bit simpler. I am also unsure how generally useful recursion is in real-life programming. Lastly, I’m not sure I did this quite right; I went down a bit of a recursive rabbit holem and the part that is most unusual to me is that the result is something like iteration, arrived at a different way. But, this seemed to work, and I welcome any feedback about it.


Host labels are names given to sets of hostnames and subnets to streamline configuration. Host labels provide flexibility because you can create a logical set of hostnames and then apply a rule, such as a QoS rule, to the entire set instead of creating individual rules for each hostname. For example, you can define a set of file servers in a host label, use that host label in a single QoS rule, and apply a policy limiting all IP traffic to and from the servers (independent of what protocol or application is in use).List multiple dedicated application servers by hostname in a single rule and apply a policy List multiple business websites and servers to protect List recreational websites to restrict Host labels are optional.
Host label names are case-sensitive and can be any string consisting of letters, numbers, the underscore ( _ ), or the hyphen ( - ). There cannot be spaces in host labels. Riverbed suggests starting the name with a letter or underscore. To avoid confusion, do not use a number for a host label. You cannot delete host labels that a QoS rule is using. Specify a comma-separated list of hostnames and subnets. Hostnames are not case-sensitive. You can also separate hostname and subnet names with spaces or new lines. Select the check box next to the name and click Remove Selected. You cannot delete host labels that a QoS rule is using. Adds the host label. The page updates the host label table with the new host label. Because the system resolves new hostnames through the DNS, wait a few seconds and then refresh your browser.RiOS resolves hostnames through a DNS server immediately after you add a new host label or after you edit an existing host label. RiOS also automatically re-resolves hostnames once daily. If any problems arise during the automatic or manual hostname resolution, the summary section of the host labels page alerts you quickly that there is a problem.RiOS relays any changes in IP addresses to QoS after resolving them; you do not need to update the host label in QoS.When you know that the IP addresses associated with a hostname have been updated in the DNS server, and you do not want to wait until the next scheduled resolution, you can resolve the hostnames manually. After you resolve the hostname cache manually, RiOS schedules the next resolve time to be 24 hours in the future.Click the Resolve Hostnames button. Select or clear the Show resolved IPs for the hostnames in the table below check box. Unique Hostnames - The total number of unique hostnames, because a hostname can appear in multiple host labels. You can configure a maximum of 100 unique hostnames. Checking DNS - The number of unique hostnames that are actively being resolved. Unresolvable - The number of unique hostnames that cannot be resolved through the DNS because the DNS server is not configured, the DNS server is not reachable due to network connectivity issues, there is a typo in the hostname, and so on. On rare occasions, if the DNS server goes down after resolving a hostname once, the system keeps the information, even though it might be stale. When this occurs, the following message appears:
4. Click Apply to save your settings to the running configuration. RiOS immediately applies host label changes to QoS, changing the traffic processing for all rules using the label.Modifying General Host Settings Creating QoS Classes


23
1 When you sit down to eat a meal with ruler of a country,
think carefully about what is in front of you.
2 It is said, "put a knife to your throat" if you think of eating a lot of food,
because it would be foolish to eat too much at such an important event.
3 Do not crave the special and expensive food the ruler enjoys;
the food will deceive you.
4 Do not work so much that you are always tired, so you can become rich;
be wise and know when you should stop and rest.
5 As soon as you look at the money, it will be gone;
it will be as if it suddenly took up wings
and flew up like an eagle, up into the sky.
6 Do not eat with an evil man—he will gaze at your food for a long time—
do not desire his fine food,
7 because he will be thinking about how much your food cost him,
and he will say to you, "Eat and drink,"
but that is not what he will really be thinking.
8 When you realize what he is really thinking, you will want to vomit what you have eaten;
and you will have wasted all the compliments you gave about the fine meal he prepared.
9 Do not waste time talking to a fool;
he will only despise the wise things that you say.
10 Again, do not remove the ancient boundary stone. It is a marker for the property lines;
and do not claim land that is set apart for orphans to work,
11 because the One who redeems them is strong,
and he will plead their case against you.
12 Pay attention to what you are learning,
and listen to the words of knowledge.
13 Do not refuse to discipline your children;
if you punish them, they will not die,
14 and if you beat them with the rod of discipline,
you may save their lives from death.
15 My son, if you have taken wisdom deep within yourself,
I will be very happy,
16 and I will be sincerely glad
when you say what is right.
17 Do not envy sinful people;
but give Yahweh the respect he deserves, all day long.
18 If you respect him, you will have a life in the future,
and Yahweh will not cut off his promises for the future.
19 My son, listen to me so you may become wise,
and think about the way you live your life.
20 Do not associate with those who get drunk with wine,
or with those who are eat far too much food,
21 because drunkards and gluttons will become poor;
and they will sleep so much that they will have nothing but rags to wear.
22 Pay attention to your father who brought you into the world,
and do not hate your mother when she is old.
23 When you study wisdom, think of it as buying truth, but never selling it;
and the same for wisdom, and with discipline, and also with understanding;
let it be as though you were buying them so you can keep them for the rest of your life.
24 The father of a child who does what is right will be very happy;
any man who has a wise son will be very happy because of him.
25 Make your father and mother proud,
and let your mother be glad.
26 My son, take what I say and put it deep within you,
and pay attention to the way that I live.
27 A prostitute is like a very deep pit, that is easy to fall into, but difficult to get out;
another man's wife is a narrow pit; just as dangerous as a deep pit, but of a different kind.
28 The immoral woman is waiting for you, waiting like a robber waits for his victim;
and they cause many men to become liars and traitors to those who love them.
29 Who is it who had trouble? Who has sorrows? Who has conflicts and fights?
Who has quarreling? Who is wounded for no reason?
Whose eyes are always bloodshot because they drank too much or ate too much?
30 It is those who drink too much wine
and those who drink the mixed wine.
31 Do not look with pleasure at red wine when it sparkles in the cup,
and it goes down the throat smoothly.
32 But, in the last, it bites you like a poisonous snake .
33 It makes you see strange things,
and within you, you say perverse things when you are drunk.
34 You will think you are on a ship that is tossing on the sea;
you will be like someone who is trying to sleep up on the rigging of the boat.
35 You will say, "I think that someone struck me, but he did not hurt me;
They beat me, but I did not feel it.
When will I wake up
in order that I can drink some more wine?"


Cycling Gloves
So a fairly boring blog post perhaps on gloves.
It’s very rare that you’ll catch me out on a bike without wearing gloves. Not 100% why but I also think it’s better to wear gloves as if I come off the bike, the first part of my body that I’ll move to try and stop myself probably is my hands. And considering I use them everyday, I kind of want them to not be to damaged.
Anyhow, summer gloves are never really an issue for me - I have a fairly old (and by now, pretty tatty) pair of Fox gloves but these are to thin for winter riding. I bought a pair of gloves (can’t recall the brand name now) at the London cycle show last year and they weren’t to bad. However, during windy days, or just fast downhill descents, wind would just tear through these and make it feel like you were wearing nothing at all. They did come with a rain cover type cover that was attached near the wrist of the glove and would unroll and cover your hand like a mitten. Nice idea (as these were also reflective, ideal for commuting). The major downside was that they were a bit small and really restricted your handling of the bike so I ended up never using those “flaps”. When they ended up getting a hole in last month, I didn’t think it was worth fixing and decided to buy a new pair.
Winter Gloves
Anyhow, so along I went to the local bike shop and bought a no name pair of gloves. Waterproof, windproof, the lot.
They’re pretty warm and do the trick of keeping the wind out. Waterproof seems to be fairly good as well by can’t comment to much as I’ve not worn them in the rain much (I barely rode at the end of last year). However, I’ve got a big issue with them and that’s the sheer bulk of the glove. With the gloves on, I can’t attach my lights, I can’t even open the garage door to get the bike out! And then when I’m on the commuter bike, I’m just about able to operate the gears - I’d hate to ride the road bike with these, there’s almost no chance I’d be able to operate the gears nicely with these! It looked like I was doomed to having fat finger syndrome or hypothermia in my hands!
Rab Powerstretch
That is, until I was in Go Outdoors over Christmas.  I was browsing the gloves and stumbled upon the Rab Powerstretch gloves.
These seemed almost ideal for cycling, even though they aren’t cycling specific gloves. Maybe thats where I was going wrong, only looking at the specific ones, when I should have been looking at all gloves.
Whilst these aren’t waterproof, having worn them in a torrential downpour, I can say that it takes a while for the water to soak through. In addition, they aren’t pretty windproof - not so much as the thick gloves above, but they do a pretty good job at keeping the biting cold air out. Which, after all, is the main reason I got them.  I can happily operate all the parts of my bike with them on and I can even fiddle with my Garmin cycle computer. So that’s a plus.
They are missing the ever helpful terrycloth on the thumb for nose wiping (espcially helpful in the colder weather!) but I can miss out on that for having warm hands that I can actually use for operating the bike comfortably!


ch.epfl.lis.gnwgui
Class IODialog
java.lang.Object
ch.epfl.lis.gnwgui.IODialog
public class IODialog
- extends java.lang.Object
This class is used to handle open/save dialogs.
Primarily, this class has been designed to be able to switch easily
between Swing and AWT dialogs. If the GUI of GNW makes use of Swing
in order to have the same GUI on all platforms, the possibility to
release GNW as a Mac application is studying because Mac offer nice
features to its applications such as drag&drop files on the application
icon to open them. What was intended with the implementation of this
class was to benefit from the nice, native open/save Mac dialogs.
- Author:
- Thomas Schaffter<EMAIL_ADDRESS>|
Field Summary |
static java.lang.Byte |
AWT
|
static java.lang.Byte |
LOAD
|
static java.lang.Byte |
SAVE
|
static java.lang.Byte |
SWING
|
|
Constructor Summary |
IODialog(java.awt.Frame parent,
java.lang.String title,
java.lang.String path,
java.lang.Byte mode,
java.lang.Byte type)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOAD
public static final java.lang.Byte LOAD
SAVE
public static final java.lang.Byte SAVE
AWT
public static final java.lang.Byte AWT
SWING
public static final java.lang.Byte SWING
IODialog
public IODialog(java.awt.Frame parent,
java.lang.String title,
java.lang.String path,
java.lang.Byte mode,
java.lang.Byte type)
display
public void display()
- Display the dialog.
addFilter
public void addFilter(javax.swing.filechooser.FileFilter filter)
- Add one file filter. To use with Swing dialog.
Native look & feel: no filter selected initially (Why?!)
setFilter
public void setFilter(java.io.FilenameFilter filter)
- Set file filter. To use with AWT dialog.
getSelectedFilter
public javax.swing.filechooser.FileFilter getSelectedFilter()
getDirectory
public java.lang.String getDirectory()
setMode
public void setMode(java.lang.Byte mode)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
selectOnlyFolder
public void selectOnlyFolder(boolean b)
setAcceptAllFileFilterUsed
public void setAcceptAllFileFilterUsed(boolean b)
setSelection
public void setSelection(java.lang.String filename)
getSelection
public java.lang.String getSelection()


Written by: Adam Chase
Transcribed by: Eric Aasen
[Scene: The hallway, Ross is running up the stairs. Note: This show continues where the last one left off.]
Ross: Chandler!!! Chandler!!! (He opens the door to the apartment but is stopped by the chain; Chandler and Monica quickly stop making out and try to get dressed.) Chandler, I saw what you were doing through the window! Chandler, I saw what you were doing to my sister! Now get out here!
Chandler: (To Monica) Wow! Listen, we had a good run. What was it? Four? Five months? I mean, that's more than most people have in a lifetime! So, good-bye, take care, bye-bye then! (He kisses her and starts to climb out the balcony window.)
Monica: What are you doing?!
Chandler: Oh, I'm going on the lamb.
Monica: Come on Chandler, come on, I can handle Ross. (They go to the door. Ross is trying to stick his hand through and undo the chain; Monica pushes his hand back.) (To Ross) Hold on! (She opens the door.) Hey Ross. What's up bro?
(Ross spots Chandler and starts chasing him around the kitchen table. Chandler runs and hides behind Monica.)

Rachel: (running from the guy's apartment with Joey in tow) Hey, what's-what's going on?!
Chandler: Well, I think, I think Ross knows about me and Monica.
Joey: (panicking) Dude! He's right there!
Ross: (To Chandler) I thought you were my best friend, this is my sister! My best friend and my sister! I-I cannot believe this!
Chandler: Look, we're not just messing around! I love her. Okay, I'm in love with her.
Monica: I'm so sorry that you had to find out this way. I'm sorry, but it's true, I love him too.
(There's a brief pause.)
Ross: (happily) My best friend and my sister! I cannot believe this.  Big news!
Rachel: Awww, no, it's okay, we've actually known for a while.
(There's another pause as Ross gets angry again.)
Ross: What? What? What?! You guys knew? (Joey and Rachel backup against the door.) You all knew and you didn't tell me?!!
Rachel: Well, Ross, we were worried about you. We didn't know how you were going to react.
(Pause.)
Ross: (happily again) You were worried about me? You didn't know how I was going to react? (He hugs them both.)
Joey: Okay, all right, whew! What do you say we all clear out of here and let these two lovebirds get back down to business? (Ross turns and glares at him.) Hey-hey-hey, I-I-I'm just talking here, he-he's the one doing your sister.
Opening Credits
[Scene: Central Perk, everyone is there.]
Ross: Hey, you know what I just realized? If you guys ever have kids
Chandler: (interrupting) Whoa-whoa-whoa! We're having kids?!
Joey: (quickly) I call Godfather!
Ross: You can't just call Godfather. Don't you think her brother should be Godfather?
Joey: Sure, if you cared enough to call it first.
Monica: Guys, you're a few steps ahead of us.
Chandler: Yeah, big zero gravity moon steps.
Rachel: Oh! Oh, I just thought of the greatest wedding gift to get you.
Phoebe: Ooh, I'll go in on that with you! I couldn't think of anything.
Rachel: Okay.
(A girl enters.)
Joey: (to her) Oh, hey Katie! Everyone, this is Katie.
Katie: Hi!
All: Hi!
Joey: So, are you ready to go?
Katie: Yeah, I just gotta run to the bathroom.
Joey: Oh sure, right back there. (Points.)
Katie: Hey, where are we going to lunch?
Joey: I was thinking Chinese food.
Katie: Ohh, I love Chinese! How did you know I love Chinese?! (She hits him repeatedly as she says that.)
(She heads to the bathroom and Joey sits back down.)
Rachel: She is so cute! You could fit her right in your little pocket!
Joey: I don't know. I mean I like her a lot, and she's really nice, but
Monica: But what?
Joey: (shyly) She keeps punching me.
(They all laugh.)
Monica: In that cute, little, sweet way she just did?
Joey: Hey, it's a lot harder than it looks! Okay? (Quietly) She-she-she's hurting me.
Monica: I know what you need, you need a bodyguard. Hey Ross, what is Ben doing after preschool?
Chandler: Hey listen, come on, Joey is having a problem!
Rachel: Aww, Joey, come here. (She takes his hand.) Look honey, I know this must be really, really difficult for you and I--Oh, I'm sorry. Am I hurting you?
[Scene: Ross's apartment, he's unpacking after moving in. There's a knock on the door and he answers it.]
Ross: (opens it to reveal Phoebe) Hey!
Phoebe: Hey!
Ross: Aww.
Phoebe: Yeah. Salt, so your life always has flavor.
Ross: Huh.
Phoebe: Bread, so you never go hungry.
Ross: Ohh.
Phoebe: And a scented candle for the bathroom, because well, y'know.
Ross: Thanks. Thanks. And thanks again.
Phoebe: Yeah!
(The door across the hall opens and a guy walks into Ross's apartment.)
Guy: Hi!
Ross: Hi!
Guy: Welcome to the building. I'm uh, Steve Sarah; I'm president of the tenants committee.
Ross: Oh hi! Ross Geller. And this is my friend Phoebe.
Steve: Oh hi Phoebe.
Phoebe: Mr. President.
Steve: I came to talk to you about Howard.
Ross: Howard?
Steve: Yeah, he's the handy man. He's gonna be retiring next week and everyone who lives here is kicking in a 100 bucks as a thank you for all the hard work type of thing.
Ross: Oh that's nice.
Steve: Yeah.  Or
Ross: Oh. Uhh
Steve: Oh look, you don't have to give it too me right now! You can slip it under my door. (Points to his apartment across the hall.)
Ross: No-no, it's not that, it's just I-I just moved in.
Steve: Well, the guy's worked here for 25 years.
Ross: Yes, but I've lived here for 25 minutes.
Steve: Oh, okay, I get it. (Starts to leave.)
Ross: No wait, look. Look! I'm sorry, it's just I've never even met Howard. I-I mean I don't know Howard.
Steve: Howard's the handy man!
Ross: Yes but too me he's just, man.
Steve: Okay, fine, whatever. Welcome to the building. (Exits.)
Ross: (To Phoebe) Ugh, can you believe that guy!
Phoebe: Yeah. I really like his glasses.
[Scene: Chandler and Joey's, Ross is lamenting to Chandler and Rachel about his troubles in his new building.]
Ross: so then President Steve told everyone that I was a cheapskate, and now the whole building hates me!  Y'know what I'm gonna do?  That's right. For everyone in the building, and I'm gonna sit them down and explain to them, I am not a bad guy. I am not a cheap guy! I'm just a guy who-who stands up for what he believes in. A man with principles.
Chandler: (To Rachel) Sounds like a fun party.
Rachel: Hmm.  The party's gonna cost you way more than that.
Ross: It doesn't matter! It's my principles! We're talking about my principles!
Rachel: Okay, I thought it was about your neighbors liking you.
Ross: Oh, they'll like me. Once they come to my awesome PAR-TAY! Okay, I gotta run. I gotta go get some nametags. (Exits.)
Rachel: And that crazy party animal will be your brother-in-law.

Rachel: Umm, Chandler, you do realize that those ideas are probably already in Monica's head.
Chandler: Wh-wh-why?!
Rachel: Well, because she loves you and because you love her.
Chandler: Yeah, so, what's that supposed to mean?!
Rachel: Hey, Chandler, don't freak out! I'm telling you something you already know! Come on, she broke up with Richard because he didn't want to have babies. And she's a woman, and she's almost 30, and y'know it's Monica.
Chandler: I don't see it that way. Okay? Because, I see two Monicas, the one that was my friend, who lived across the hall, and wanted to have a lot of babies and then the new Monica, who I just started to date. Now, who's to say what she wants?! Im right. I'm right. Am I right?
Rachel: No, you're right, you are absolutely right. I mean that makes, that makes everything different.
Chandler: Okay. It's not different at all, is it?
Rachel: Not unless different means the same.
[Scene: Central Perk, Joey is sitting on the couch with Katie.]
Katie: You were so funny with that waiter!  (She slaps her thighs, Joey jerks, and spills some of his coffee.)
Joey: (sets the coffee down) Y'know, breadstick fangs are always funny.
Katie: No, you make them funny. You're the funny one! (She punches him again and he retreats to the arm of the couch.)
Joey: Uhh, look Katie, uh listen, we-we need to talk. Okay?  I-I really do, I like you a lot. Okay? But sometimes when you, when you playfully punch me like that it-it feels like someone's hitting me with a very tiny but very real bat.
Katie: Aww, like I could hurt you. Are you making fun of my size? Don't make fun of me because of my size!
Monica: Isn't this great?
Chandler: Hmm.
 (His eyes snap open.) Chandler!
Chandler: Yeah, here, somewhere else, y'know where-where ever. (Gets up.)
Monica: Are you okay?
Chandler: Yeah, I'm cool. Casual.
Monica: What-what are you doing?
Chandler: I'm just hanging out. Y'know, having fun. Y'know with the girl that I'm seeing casually.
Monica: Man, I knew it! I knew you were going to do this!!
Chandler: What?!
Monica: Get all freaked out because everybody was talking and just joking around about marriage and stuff.
Chandler: Well, you do want all that stuff, right?
Monica: Oh and you know what I want!
Chandler: Yes! You want babies! You have baby fever!
Monica: I do not have baby fever!
 I've got an idea, why don't we turn down the heat on this pressure cooker?!
Monica: Have you lost your mind? Chandler, this isn't about me! This is about you and all your weird relationship commitment crap!
Chandler: Nah-uh! I know you! Okay? I know the thoughts that you have in the head--in your head!
Monica: You don't know everything. Did you know that I'm going out with Rachel tonight instead of you? Hmm? And did you know that the only baby around here is you?! And did you know that I can't even look at you right now?! (She storms out.)
Chandler: Well, I did not know that.
Commercial Break
[Scene: Central Perk, Chandler is getting advice from Ross and Joey.]
Chandler: It's gonna be okay, right? I mean she's not gonna leave me? This is, this is fixable.
Ross and Joey: Oh yeah, yeah, sure. Absolutely.
Chandler: By me?
Ross: Oh, no!
Joey: No-no.
Ross: Well, unless you make some kind of big gesture.
Joey: Yeah, big!
(Monica enters.)
Joey: Uh-oh, shht! The Misses.
Monica: Gunther, can I get a coffee (Looks at Chandler) to go?
Chandler: Monica. (Goes to talk to her.)
Monica: I'm still not done not wanting to talk to you.
Chandler: Just tell me what I need to do to make things right.
Monica: What?!
Chandler: Well, that's what we do. Y'know, I-I mess up and then you tell me how to fix it and then I do and then y'know you think I'm all cute again.
Monica: Really? I'm really tired of being your relationship tutor. You're gonna have to figure this one for yourself. All right? Y'know what? If you're too afraid to be in a real relationship, then don't be in one. (She walks out.)
(Chandler turns to watch her go and then sees Ross and Joey both with huge grimaces on their faces.)
[Scene: Ross's apartment, he's having his party, only he's the only guest. He gets up and puts on a nametag that says Ross, but doesn't quite like it. So he takes it off and puts on one that says Dr. Geller and he puts the Ross one underneath the Dr. Geller one. Then as he turns off the music, we hear the party for Howard raging in the apartment across the hall.]
Party Guests: (chanting) Howard! Howard! Howard! Howard! (Ross goes to investigate the noise) Howard! Howard! Howard! (They're holding Howard above their heads.) Howard! Howard! Howard! Howard! Howard! (He sees Phoebe chanting along with them.) Howard! Howard! Howard! Howard! Howard! Howard! Howard! Howard! Howard! Yay!!
Ross: Phoebe! (He grabs her arm to get her attention.)
Phoebe: Oh, hi Ross!
Ross: What are you doing?
Phoebe: Oh, I thought this was your party and it turns out its a party for Howard. He's just the sweetest little man! (A guest walks up to her.)
Guest #1: See ya Phoebe! Oh and hey, thanks for chipping in!
Ross: You chipped in?!
Phoebe: Yeah, uh-huh, a 100 dollars.
Ross: Phoebe! I can't believe you gave them money! I thought you agreed it was totally unreasonable that they asked me for that money!
Phoebe: Yeah, but they didn't ask me! Y'know? This way I'm just y'know, the exotic, generous stranger. That's always fun to be.

Phoebe: No I'm not. No! If anything I'm making you look better! They'll see you talking to me and that's--I'm a hit!
Steve: (walking up) Oh hey, Pheebs!
Phoebe: Hey!
Steve: Oh hey, Ross. Umm, see, I was thinking maybe you two could switch apartments because Phoebe's more our kind of people. Something to think about. (Walks away.)
(Ross turns and glares at Phoebe.)
Phoebe: Yeah, okay, my bad.
[Scene: Central Perk, Rachel is getting some coffee as Joey enters. He's looking a little puffy, but that's probably from the large number of different color sweaters he's wearing.]
Joey: Hey!
Rachel: Hi! Wow! You look, you look big.
Joey: Thanks! I've been working out. Hey listen, is it obvious that I'm wearing six sweaters?
Rachel: Uhhh, yeah. But it's not obvious why.
Joey: Well look, Im breaking up with Katie so I had to put on some extra padding. Y'know?
Katie: (entering) Hi!
Joey: Hey! Hiya!
Rachel: Hey! Hey, cute jacket!
Katie: Oh, thanks! That's so sweet! (She punches Rachel like she punched Joey.)
Rachel: Oh! Ow! (Joey motions, "You see what I mean?!")
Katie: Oh, ow! Did Joey tell you to say that?  (Punches Rachel.)
Rachel: Whoa! (Laughs) Y'know what Katie? I gotta tell ya I-I-I-I think you are the one who is too much. (She punches Katie back.)
Katie: Ohh, Joey has the nicest friends! (She punches Rachel.)
Rachel: Ohh, and the nicest girlfriend! (She retaliates.)
Katie: You're so sweet! (Punches Rachel yet again.)
Rachel: Ohh, you're so sweet! (She kicks Katie in the shin.)
Katie: Oww!!!! Joey, she just kicked me.
Joey: Huh.
Katie: Well? Aren't you gonna do something?
Joey: Uhh .
Katie: You'd better do something, or I'm gonna walk out that door right now! Well? Are you gonna?
Joey: Nah.
(She looks at Rachel and storms out. After she's left Joey hugs Rachel in thanks.)
[Scene: Howard's party, Phoebe is talking Ross up to two more partygoers. Ross isn't happy about it.]
Ross: (trying to get her attention) Phoebe?
Phoebe: (ignoring him and continuing her conversation) That's what I'm saying. (Laughs.)
Ross: (tapping her on the shoulder) Phoebe? Phoebe?
Phoebe: Ooh. (Turns to him.)
Ross: Look, this is a disaster! Can't I please just go?
Phoebe: No! No! I'm talking you up to people. Just give it a little time, all right? Relax, get something to eat! Okay?
(They go to the food table.)
Ross: So uh, what did you tell them about me?
Phoebe: Oh, I was telling them about you and Emily. Y'know, try to get some sympathy.
Ross: Ohh. (He cuts himself a piece of cake.)
Phoebe: But somehow you came off as the bad guy.
Ross: What?!
Phoebe: Yeah, I think I told it wrong. Y'know, we should talk about that because I don't totally understand what happened there.
Ross: (trying a piece of cake) Ohh, this cake is really good!
Phoebe: Oh, okay, see? Things are looking up already!
Guest #2: (sees the cake) Oh my God! Someone cut Howard's cake! (Ross tries dumping it into a nearby plant.) Who would do a think like that?
(Steve goes over to look at Ross who's trying to look cool, but has some frosting on his lip.)
Steve: 3-B!
All: Oh yeah, aww!
Steve: Okay, you got your free food!  Don't you think it's time you went home?!
Guest #3: Yeah, leave!
All: Yeah, get out! Now!
Steve: Go back to 3-B, 3-B!
Phoebe: All right, everyone calm down! Everyone calm down! I have something that I would like to say! Who here likes Ross? (Ross is the only one who raises his hand and Phoebe glares at him to put his hand back down.) Of course you don't like him! He-he didn't give you any money, he raised his own hand when I asked, "Who hear likes Ross," and he's wearing two nametags! (He takes one off.) I-I'll be honest with you guys, when I first met Ross I didn't like him at all! But then once I got to know him I saw that he's really sweet and caring and very generous. I mean, all I'm saying is don't judge Ross before you get to know him all right?  And okay, you guys (She turns to an elderly gentleman and a 20 something woman, who're a couple.) (To the girl) Gold-digger, (To the old guy) cradle robbing perv! So, I think you all know what I mean.
[Scene: Ross's apartment, Ross and Phoebe have been banished to Ross's place.]
Phoebe: Obviously I didn't think they were gonna start throwing things. I just thought if I kept insulting everyone, you would jump in and defend everyone and then you could look like the hero.
Ross: Oh wow, yeah! See, I did not get that.
[Scene: Monica and Rachel's, Chandler comes running in. Everyone else is already there.]
Chandler: Where's Monica?! Where is she? I need to talk to her! It's urgent! Is she here?
Monica: (raising her hand) I'm Monica.
Chandler: I need to talk to you, it's urgent!
Monica: Okay.
Chandler: Okay, I've been doing a lot of thinking about us, y'know a lot of uhh, us thinking. And uh, well I guess there's only one-one way to do this. (He slowly and awkwardly gets down on one knee.)
Monica: Wait what-wh-wh-what are you doing?!
Chandler: (getting out a ring box) Monica
Monica: No-no, don't-don't-don't do it!
Chandler: Will you marry me?
 Rachel is starring at them wide-eyed and open-mouthed. Joey and Ross are stunned to temporary silence.)
Ross: Oh-no. No. No.
Joey: What a bad idea!
Rachel: Ohhhh, I cannot look at it! (She doesn't move.)
Monica: Chandler, why are you doing this?
Chandler: I don't know. But I know I'm not afraid to do this.
Monica: Chandler.
Chandler: I'm doing this because I'm sorry?
Monica: Do you umm, you really think the best reason to get married is because you're sorry?
Chandler: No, the best reason to get married is pregnancy. Sorry is pretty much fourth y'know, behind being ready and actually wanting to get married. (Laughs.) Will you be my wife?

Chandler: Yeah, I'm kinda wishing everyone wasn't here right now.
Monica: Honey! Do you know that none of that stuff came from me?! I mean I never said I wanted to have babies and get married right now!
Chandler: Yeah I know, but I was really confused and then I talked to these guys. (Turns to look at Ross and Joey.)
Monica: Who? Two divorces and Joey?!
Ross: Hey!
Joey: She's right y'know.
Ross: Yeah, but still, cheap shot!
Monica: Y'know what? Y'know when I said that I want you to deal with this relationship stuff all on your own? Well, you're not ready for that.
Chandler: I didn't think I was!
(They hug.)
Monica: Oh my God, what would have done if I said yes?
Chandler: Well I would've been happy because I would've be able to spend the rest of my life with the woman that I love.  (Points at the door.)
Ending Credits
[Scene: Central Perk, Everyone is there.]
Joey: Hey Ross, will you pass me that knife?
Ross: No, I will not!
Joey: Oh, it's okay. You don't have to be so mean about it.
Ross: You're right, I'm sorry. Will you marry me?
(They all laugh.)
Phoebe: Aw, and I was gonna ask you to marry me because I forgot to say hello to you last week.
Rachel: Oh no wait Pheebs, I think for something like that you just ask them to move in with you. But I'm not sure, Chandler?
Chandler: Okay, how long is this going to go on.
Monica: Well I think the length of teasing is directly related to how insane you were so, a long time.
Ross: This is fun. Hey Rach, remember that whole "We were on a break thing?" Well, I'm sorry, will you marry me? (Laughs--whines as he sees that no one is laughing. They're just staring at him in shock.)
Chandler: That's not funny.
Joey: That's not funny at all!
(They all get up and leave.)
End


menu
Admin | Users
Delete user
Number
UserName
Profile Image
FirstName
LastName
E-mail
Phone Number
Delete
Modify
Edit


Are you absolutely sure 100% positive that you want to delete this {% if comment.name %} comment by {{ comment.name }}? {% else %} comment? {% endif %}
{{ comment.body }}{% if comment.name or comment.email %}
by {{ comment.name|default:'' }} {{ comment.email|default:'' }}
{% endif %}NB: There is no coming back, it will really be deleted.


You're running an important errand at midnight when a man in a trenchcoat and dark glasses approaches you in a shady back alley.
"I'm about to make you an offer you can't refuse," he says. "I'm going to ask you a series of questions to find out if you're my guy."
You approach him cautiously, unsure of his motives. He quickly ushers you toward a side door you hadn't noticed.
"Please step into my office."


Usernames and ticket expiry times are cached. So long as the current user's ticket has at least the 'Minimum session life (ms)' remaining then no 'p4 login -s' check is performed


Student: Bob Smith
Email<EMAIL_ADDRESS>Performance
| Points | Points Possible | Percent | Grade |
|---|---|---|---|
| {{TotalScoredPoints}} | {{TotalPointsPossible}} | {{TotalPercentGrade | percent}} | {{Grade}} |
Add Assignment
Assingment Name:
Scored Points:
Points Possible:
Assignments
| Assignment Name | Points Scored | Points Possible | Percent | Grade | |
|---|---|---|---|---|---|
| {{ assignment.assignment}} | {{ assignment.scored }} | {{ assignment.possible }} | {{ assignment.percent | percent }} | {{ assignment.grade }} |


| Name | Kind | Date Modified | Author |
|---|---|---|---|
| bars.scss | Document | Oct 13, 2015 | connors |
| base.scss | Document | Oct 13, 2015 | connors |
| button-groups.scss | Document | Oct 13, 2015 | connors |
| buttons.scss | Document | Oct 13, 2015 | connors |
| docs.scss | Document | Oct 13, 2015 | connors |
| forms.scss | Document | Oct 13, 2015 | connors |
| grid.scss | Document | Oct 13, 2015 | connors |
| icons.scss | Document | Oct 13, 2015 | connors |
| images.scss | Document | Oct 13, 2015 | connors |
| lists.scss | Document | Oct 13, 2015 | connors |
| mixins.scss | Document | Oct 13, 2015 | connors |
| navs.scss | Document | Oct 13, 2015 | connors |
| normalize.scss | Document | Oct 13, 2015 | connors |
| photon.scss | Document | Oct 13, 2015 | connors |
| tables.scss | Document | Oct 13, 2015 | connors |
| tabs.scss | Document | Oct 13, 2015 | connors |
| utilities.scss | Document | Oct 13, 2015 | connors |
| variables.scss | Document | Oct 13, 2015 | connors |


The loading overlay is available both as a component and as a service.
The loading overlay component will add the overlay on top of the content that is slotted into the component.
The service will show a full page loading overlay. It provides two methods:
showLoadingOverlay
&
hideLoadingOverlay
.
showLoadingOverlay
takes two arguments:
showBackdrop: boolean
- Shows the transparent loading overlay.
hideContent: boolean
- Shows the loading overlay with 100% opacity.
hideLoadingOverlay
is required to dismiss the overlay. It takes no arguments.


| Home | Libraries | People | FAQ | More |
The whole purpose of integrating Spirit.Lex as part of the Spirit library was to add a library allowing to merge lexical analysis with the parsing process as defined by a Spirit grammar. Spirit parsers read their input from an input sequence accessed by iterators. So naturally, we chose iterators to be used as the interface beween the lexer and the parser. A second goal of the lexer/parser integration was to enable the usage of possibly different lexical analyzer libraries. The utilization of iterators seemed to be the right choice from this standpoint as well, mainly because these can be used as an abstraction layer hiding implementation specifics of the used lexer library. The picture below shows the common flow control implemented while parsing combined with lexical analysis.
Another problem related to the integration of the lexical analyzer with the parser was to find a way how the defined tokens syntactically could be blended with the grammar definition syntax of Spirit. For tokens defined as instances of the token_def<> class the most natural way of integration was to allow to directly use these as parser components. Semantically these parser components succeed matching their input whenever the corresponding token type has been matched by the lexer. This quick start example will demonstrate this (and more) by counting words again, simply by adding up the numbers inside of semantic actions of a parser (for the full example code see here: word_count.cpp).
This example uses two of the Spirit library components: Spirit.Lex and Spirit.Qi, consequently we have to #include the corresponding header files. Again, we need to include a couple of header files from the Phoenix2 library. This example shows how to attach functors to parser components, which could be done using any type of C++ technique resulting in a callable object. Using Phoenix2 for this task simplifies things and avoids adding dependencies to other libraries (Phoenix2 is already in use for Spirit anyway).
#include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/lex_lexer_lexertl.hpp> #include <boost/spirit/include/phoenix_operator.hpp> #include <boost/spirit/include/phoenix_statement.hpp> #include <boost/spirit/include/phoenix_container.hpp>
To make all the code below more readable we introduce the following namespaces.
using namespace boost::spirit; using namespace boost::spirit::qi; using namespace boost::spirit::lex;
If compared to the two previous quick start examples (Lex Quickstart 1 - A word counter using Spirit.Lex and Lex Quickstart 2 - A better word counter using Spirit.Lex) the token definition class for this example does not reveal any surprises. However, it uses lexer token definition macros to simplify the composition of the regular expressions, which will be described in more detail in the section FIXME. Generally, any token definition is usable without modification either for a standalone lexical analyzer or in conjunction with a parser.
template <typename Lexer> struct word_count_tokens : lexer_def<Lexer> { template <typename Self> void def (Self& self) { // define patterns (lexer macros) to be used during token definition // below self.add_pattern ("WORD", "[^ \t\n]+") ; // define tokens and associate them with the lexer word = "{WORD}"; // reference the pattern 'WORD' as defined above // this lexer will recognize 3 token types: words, newlines, and // everything else self.add (word) // no token id is needed here ('\n') // characters are usable as tokens as well (".", IDANY) ; } token_def<std::string> word; };
While the integration of lexer and parser in the control flow is achieved by using special iterators wrapping the lexical analyzer, we still nead a means of expressing in the grammar what tokens to match and where. The token definition class above uses three different ways of defining a token:
All three token definition methods require a different method of grammar integration. But as you can see from the following code snippet, each of this methods is straightforward and blends the corresponding token instance naturally with the surrounding Spirit.Qi grammar syntax.
|
Token definition |
Parser integration |
|---|---|
|
token_def<> |
The token_def<> instance is directly usable as a parser component. Parsing of this component will succeed if the regular expression used to define this has been matched successfully. |
|
single character |
The single character is directly usable in the grammar, under certain circumstances it needs to be wrapped by a char_() parser component, though. Parsing of this component will succeed if the single character has been matched. |
|
explicit token id |
To use an explicit token id in a Spirit.Qi grammar you are required to wrap it with the special token() parser component. Parsing of this component will succeed if the current token has the same token id as specified in the expression token(<id>). |
The grammar definition below uses each of the three types demonstrating their usage.
template <typename Iterator> struct word_count_grammar : grammar<Iterator> { template <typename TokenDef> word_count_grammar(TokenDef const& tok) : grammar<Iterator>(start), c(0), w(0), l(0) { using boost::phoenix::ref; using boost::phoenix::size; // As documented in the Spirit.Qi documentation, any placeholders // (_1 et.al.) used in semantic actions inside a grammar need to be // imported from the namespace boost::spirit::arg_names, and not from // the corresponding namespace in Phoenix. using boost::spirit::arg_names::_1; start = *( tok.word [++ref(w), ref(c) += size(_1)] | char_('\n') [++ref(c), ++ref(l)] | token(IDANY) [++ref(c)] ) ; } std::size_t c, w, l; rule<Iterator> start; };
As already described (see: Attributes), the Spirit.Qi parser library builds upon a set of of fully attributed parser components. Consequently, all the token definitions do support the this attribute model as well. The most natural way of implementing this was to use the token values as the attributes exposed by the parser component corresponding to the token definition (you can read more about this topic here: About Tokens and Token Values). The example above takes advantage of the full integration of the token values as the token_def<>'s parser attributes: the word token definition is declared as a token_def<std::string>, making every instance of a word token carry the string representation of the matched input sequence as its value. The semantic action attached to tok.word receives this string (represented by the _1 placeholder) and uses it to calculate the number of matched characters: ref(c) += size(_1).
| Important | |
|---|---|
All placeholders (_1, _2, etc.) used in parser semantic actions in conjunction with functors created based on Phoenix2 need to be imported from the namespace boost::spirit::arg_names (and not namespace boost::phoenix::arg_names, which is different from using placeholders in Spirit.Lex). Using the wrong placeholders leads to subtle compilation errors which are difficult to backtrack to their cause. |
The main function needs to implement a bit more logic now as we have to initialize and start not only the lexical analysis but the parsing process as well. The three type definitions (typedef statements) simplify the creation of the lexical analyzer and the grammar. After reading the contents of the given file into memory it calls the function tokenize_and_parse() to initialize the lexical analysis and parsing processes.
int main(int argc, char* argv[]) { typedef lexertl_token< char const*, boost::mpl::vector<std::string> > token_type; typedef lexertl_lexer<token_type> lexer_type; typedef lexer_iterator<word_count_tokens<lexer_type> >::type iterator_type; // now we use the types defined above to create the lexer and grammar // object instances needed to invoke the parsing process word_count_tokens<lexer_type> word_count; // Our token definition word_count_grammar<iterator_type> g (word_count); // Our grammar definition // read in the file int memory std::string str (read_from_file(1 == argc ? "word_count.input" : argv[1])); char const* first = str.c_str(); char const* last = &first[str.size()]; // Parsing is done based on the the token stream, not the character // stream read from the input. The function `tokenize_and_parse()` wraps // the passed iterator range `[first, last)` by the lexical analyzer and // uses its exposed iterators to parse the toke stream. bool r = tokenize_and_parse(first, last, make_lexer(word_count), g); if (r) { std::cout << "lines: " << g.l << ", words: " << g.w << ", characters: " << g.c << "\n"; } else { std::string rest(first, last); std::cerr << "Parsing failed\n" << "stopped at: \"" << rest << "\"\n"; } return 0; }


Preparation time
less than 30 mins
Cooking time
less than 10 mins
Serves
Serves 4
Ready in ten minutes, this is wonderfully fast comfort food, with cream and crab to add a little luxury.
Heat a large frying pan until medium hot. Add the butter, shallot and curry powder and fry for 2-3 minutes, or until just softened.
Add the sweetcorn and all the liquid from the tin and then pour in the wine and enough water to just cover.
Bring to a simmer, add half of the cream and then season with salt and black pepper.
Bring the mixture back to the boil, remove from the heat to cool slightly and then transfer to a blender. Bend until smooth and return the soup to the pan to heat though.
Make some soured cream by whisking the remaining cream with the lemon juice until thickened.
Ladle the soup into a serving bowl and then top with a little of the crab, a spoonful of the soured cream and a drizzle of rapeseed oil.


This search tool contains industry reports available through the BU Libraries.
Search by industry keyword to locate relevant reports.
Use the filters to narrow by subjects or vendor/publishers.
Contact the Pardee Management Library
For more information see the Business Databases: A-Z list or the Industry Information Sources guide.
Industry Reports from the following sources:
The Industry Survey Locator does not include reports from the following: Frost & Sullivan, Gartner Research, Investext and trade association websites.


--- layout: default title: About ---
I am a new bird of cyber security Ccmr is my blog.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License.
Except where otherwise noted, code examples on this side are licensed under The MIT License (MIT).