text:
from snovault.schema_utils import VALIDATOR_REGISTRY
from snovault import (
    COLLECTIONS,
    CONNECTION,
    Collection,
    ROOT,
    Root,
    calculated_property,
    collection,
    load_schema,
)
from snovault.resource_views import item_view_page
from .base import (
    ALLOW_EVERYONE_VIEW,
    SharedItem,
    ONLY_ADMIN_VIEW,
)
from pyramid.location import lineage
from pyramid.threadlocal import get_current_request
from pyramid.traversal import (
    find_resource,
)
from pyramid.view import view_config
import dateutil.parser

@collection(
    name='pages',
    unique_key='page:location',
    properties={
        'title': 'Pages',
        'description': 'Portal pages',
    })
class Page(SharedItem):
    item_type = 'page'
    schema = load_schema('encoded:schemas/page.json')
    name_key = 'name'

    embedded = [
        'layout.blocks.image',
        'award',
    ]

    def unique_keys(self, properties):
        keys = super(Page, self).unique_keys(properties)
        parent = properties.get('parent')
        name = properties['name']
        value = name if parent is None else u'{}:{}'.format(parent, name)
        keys.setdefault('page:location', []).append(value)
        return keys

    @calculated_property(
        condition=lambda context, request: request.resource_path(context.__parent__) == '/pages/',
        schema={
            "title": "Canonical URI",
            "type": "string",
        })
    def canonical_uri(self, name):
        if name == 'homepage':
            return '/'
        return '/%s/' % name

    @calculated_property(condition='date_created', schema={
        "title": "Date",
        "type": "string",
    })
    def month_released(self, date_created):
        return dateutil.parser.parse(date_created).strftime('%Y-%m')

    @calculated_property(condition='date_created', schema={
        "title": "Year",
        "type": "string",
    })
    def year_released(self, date_created):
        return dateutil.parser.parse(date_created).strftime('%Y')

    @property
    def __parent__(self):
        parent_uuid = self.properties.get('parent')
        name = self.__name__
        collections = self.registry[COLLECTIONS]
        connection = self.registry[CONNECTION]
        if parent_uuid:  # explicit parent
            return connection.get_by_uuid(parent_uuid)
        elif name in collections or name == 'homepage':
            # collection default page; use pages collection as canonical parent
            return self.collection
        else:  # top level
            return self.registry[ROOT]

    def is_default_page(self):
        name = self.__name__
        collections = self.registry[COLLECTIONS]
        if self.properties.get('parent'):
            return False
        return name in collections or name == 'homepage'

    # Handle traversal to nested pages

    def __getitem__(self, name):
        resource = self.get(name)
        if resource is None:
            raise KeyError(name)
        return resource

    def __contains__(self, name):
        return self.get(name, None) is not None

    def get(self, name, default=None):
        location = str(self.uuid) + ':' + name
        connection = self.registry[CONNECTION]
        resource = connection.get_by_unique_key('page:location', location)
        if resource is not None:
            return resource
        return default

    def __resource_url__(self, request, info):
        # Record ancestor uuids in linked_uuids so renames of ancestors
        # invalidate linking objects.
        for obj in lineage(self):
            uuid = getattr(obj, 'uuid', None)
            if uuid is not None:
                request._linked_uuids.add(str(uuid))
        return None

def isNotCollectionDefaultPage(value, schema):
    if value:
        request = get_current_request()
        page = find_resource(request.root, value)
        if page.is_default_page():
            return 'You may not place pages inside an object collection.'

VALIDATOR_REGISTRY['isNotCollectionDefaultPage'] = isNotCollectionDefaultPage

@view_config(context=Page, permission='view', request_method='GET', name='page')
def page_view_page(context, request):
    # Embedding of items has to happen here as we don't know which of their subobjects
    # need embedding as we don't know the type and may need their full page view.
    properties = item_view_page(context, request)
    blocks = properties.get('layout', {}).get('blocks', [])
    for block in blocks:
        if 'item' in block and block['item']:
            block['item'] = request.embed(block['item'], '@@page', as_user=True)
    return properties

@calculated_property(
    category='page',
    name='default_page',
    context=Collection,
    schema={
        "title": "Default page",
        "type": "string",
        "linkTo": "Page",
    })
def collection_default_page(context, request):
    try:
        return request.embed('/pages/%s/@@page' % context.__name__, as_user=True)
    except KeyError:
        pass

@calculated_property(
    category='page',
    name='default_page',
    context=Root,
    schema={
        "title": "Default page",
        "type": "string",
        "linkTo": "Page",
    })
def root_default_page(context, request):
    try:
        return request.embed('/pages/homepage/@@page', as_user=True)
    except KeyError:
        pass


text:
'.$baseTitle.' Home / Tour de France 2020 - Route and stages
Tour de France 2020 Route stage 11: Châtelaillon-Plage - Poitiers
Wednesday 9 September - Another flat race is served in the 11th stage of the Tour de France. After leaving the coast, La Grande Boucle enters the heart of France through the marshlands of Poitou. At 167 kilometres, the stage runs from Châtelaillon-Plage to Poitiers.
Wide sandy beaches, promenades, ancient villas – Châtelaillon-Plage has it all if you are looking for a day at the beach. The riders – and especially the sprinters – are looking for something else though, namely eternal glory. Winning a race in the Tour de France is something to cherish for the rest of your life.
As said, fast finishers are likely to come to the fore in the race from Châtelaillon-Plage to Poitiers. The course is predominantly flat, so the scenario is obvious: breakaway opens up a gap of several minutes before being brought back in the last kilometres. The sprint trains take central stage and… who will win Poitiers?
The victor will succeed Sean Kelly, who came out on top when the Tour visited the city on Clain River for the last time in 1978. Six years ago Arnaud Démare sprinted to the French National Championships title on the 1.5 kilometres long home straight.
The first three riders on the line gain time bonuses of 10, 6 and 4 seconds.
Another interesting read: results 11th stage 2020 Tour de France.
Tour de France 2020 stage 11: routes, profiles, more
Click on the images to zoom
finish route
finish profile
Tour de France Stage 10
Sprint triumph Ewan, Roglic stays in yellow
Cosnefroy still polka dotted
Bennett cements lead points competition
Favourites stage 11: Royal sprint in Poitiers - Tour de France 2020 The Route - Tour de France 2020 Riders - Tour de France 2020 Withdrawals - Tour de France 2020 Route and stages - Tour de France 2020 GC Favourites - Tour de France 2020

redpajama_set_name: RedPajamaCommonCrawl


Links and subcategories within the Techno section are provided below.
303net.com - welcome to 303net Electronic Music Network.
A network of sites and artists producing electronic music - techno/ambient/dance, featuring the DoubleMirrors soundtrack.
Technotica.com is a web site dedicated to the emerging synthesis of technology and the creative arts, including music, visual arts, literature and popular culture.
Sound clips and links related to techno and other electronic music styles.


text:
Lockheed Martin opens Denver cyber-security center
Lockheed Martin Corp. has opened a "security intelligence center" in Denver, the second of two such facilities nationwide that aim to protect against cyber attacks on computer networks.
The Denver facility joins a center that Lockheed opened in Gaithersburg, Md., in May 2008. Lockheed said the two centers are intended to strengthen its ability "to identify and respond to cyber attacks on its networks" by hostile nations, criminals and others.
They serve as "focal points for computer network defense including detection, identification and response to all information security incidents," a company statement said.
The centers are operated by Lockheed's Computer Incident Response Team under the company's Information Systems & Global Services unit. The centers are staffed by cyber-intelligence analysts who "identify patterns of persistent campaigns spanning multiple attacks, and implementing new mitigations to get ahead of the threats," Anne Mullins, Lockheed Martin's chief information security officer, said in a statement.
Lockheed Martin Joins National Cyber Security Alliance Board
Lockheed Martin to Support the U.S. Cyber Challenge