text:
"""
Openstack Provider Class
"""

from kvirt import common
from kvirt.common import pprint, error, warning, get_ssh_pub_key
from kvirt.defaults import METADATA_FIELDS
from keystoneauth1 import loading
from keystoneauth1 import session
from glanceclient import Client as glanceclient
from cinderclient import client as cinderclient
from novaclient import client as novaclient
from neutronclient.v2_0.client import Client as neutronclient
import swiftclient.client as swiftclient
import os
from shutil import which
from time import sleep
import webbrowser
from ipaddress import ip_address, ip_network

class Kopenstack(object):
    """

    """
    def __init__(self, host='127.0.0.1', version='3', port=None, user='root', password=None, debug=False, project=None,
                 domain='Default', auth_url=None, ca_file=None, external_network=None, region_name=None,
                 glance_disk=False):
        self.debug = debug
        self.host = host
        loader = loading.get_plugin_loader('password')
        auth = loader.load_from_options(auth_url=auth_url, username=user, password=password, project_name=project,
                                        user_domain_name=domain, project_domain_name=domain)
        if ca_file is not None:
            sess = session.Session(auth=auth, verify=os.path.expanduser(ca_file))
        else:
            sess = session.Session(auth=auth)
        self.nova = novaclient.Client(version, session=sess, region_name=region_name)
        self.glance = glanceclient(version, session=sess, region_name=region_name)
        self.cinder = cinderclient.Client('3', session=sess, region_name=region_name)
        self.neutron = neutronclient(session=sess, region_name=region_name)
        os_options = {'user_domain_name': domain, 'project_domain_name': domain, 'project_name': project}
        self.swift = swiftclient.Connection(authurl=auth_url, user=user, key=password, os_options=os_options,
                                            auth_version='3')
        self.conn = self.nova
        self.project = project
        self.external_network = external_network
        self.region_name = region_name
        self.glance_disk = glance_disk
        return

# should cleanly close your connection, if needed
    def close(self):
        print("not implemented")
        return

    def exists(self, name):
        return

    def net_exists(self, name):
        neutron = self.neutron
        networks = {net['name']: net['id'] for net in neutron.list_networks()['networks']}
        return name in networks

    def disk_exists(self, pool, name):
        print("not implemented")

    def create(self, name, virttype=None, profile='', plan='kvirt', flavor=None,
               cpumodel='Westmere', cpuflags=[], cpupinning=[], numcpus=2, memory=512,
               guestid='guestrhel764', pool='default', image=None,
               disks=[{'size': 10}], disksize=10, diskthin=True,
               diskinterface='virtio', nets=['default'], iso=None, vnc=True,
               cloudinit=True, reserveip=False, reservedns=False,
               reservehost=False, start=True, keys=[], cmds=[], ips=None,
               netmasks=None, gateway=None, nested=True, dns=None, domain=None,
               tunnel=False, files=[], enableroot=True, alias=[], overrides={},
               tags=[], storemetadata=False, sharedfolders=[], kernel=None, initrd=None,
               cmdline=None, placement=[], autostart=False, cpuhotplug=False, memoryhotplug=False, numamode=None,
               numa=[], pcidevices=[], tpm=False, rng=False, metadata={}, securitygroups=[], vmuser=None):
        default_diskinterface = diskinterface
        glance = self.glance
        nova = self.nova
        neutron = self.neutron
        try:
            nova.servers.find(name=name)
            return {'result': 'failure', 'reason': f"VM {name} already exists"}
        except:
            pass
        allflavors = [f for f in nova.flavors.list()]
        allflavornames = [flavor.name for flavor in allflavors]
        if flavor is None:
            flavors = [flavor for flavor in allflavors if flavor.ram >= memory and flavor.vcpus >= numcpus]
            if flavors:
                flavor = flavors[0]
                pprint(f"Using flavor {flavor.name}")
            else:
                return {'result': 'failure', 'reason': "Couldn't find a valid flavor matching your specs"}
        elif flavor not in allflavornames:
            return {'result': 'failure', 'reason': f"Flavor {flavor} not found"}
        else:
            flavor = nova.flavors.find(name=flavor)
        nics = []
        need_floating = True
        for net in nets:
            if isinstance(net, str):
                netname = net
            elif isinstance(net, dict) and 'name' in net:
                netname = net['name']
            try:
                net = nova.neutron.find_network(name=netname)
                if net.to_dict()['router:external']:
                    need_floating = False
            except Exception as e:
                error(e)
                return {'result': 'failure', 'reason': f"Network {netname} not found"}
            nics.append({'net-id': net.id})
        target = iso or image
        if iso is not None and not self.glance_disk and len(disks) in [0, 1]:
            if len(disks) == 0:
                return {'result': 'failure', 'reason': "Booting from iso requires to specify at least one extra disk"}
            else:
                warning("Adding additional disk for booting from iso")
                disks.append(10)
        if target is not None:
            glanceimages = [img for img in glance.images.list() if img.name == target]
            if glanceimages:
                glanceimage = glanceimages[0]
            else:
                msg = f"you don't have image {target}"
                return {'result': 'failure', 'reason': msg}
        else:
            msg = "a bootable disk is needed"
            return {'result': 'failure', 'reason': msg}
        os_index = len(disks) - 1 if disks and iso is not None else 0
        block_device_mapping_v2 = []
        for index, disk in enumerate(disks):
            if index == os_index and self.glance_disk:
                continue
            diskname = f"{name}-disk{index}"
            letter = chr(index + ord('a'))
            diskinterface = default_diskinterface
            if isinstance(disk, int):
                disksize = disk
            elif isinstance(disk, str) and disk.isdigit():
                disksize = int(disk)
            elif isinstance(disk, dict):
                disksize = disk.get('size', '10')
                diskinterface = disk.get('interface', default_diskinterface)
            imageref = None
            if index == os_index:
                imageref = glanceimage.id
                glanceimage = None
            newvol = self.cinder.volumes.create(name=diskname, size=disksize, imageRef=imageref)
            if index in [0, os_index]:
                self.cinder.volumes.set_bootable(newvol.id, True)
            while True:
                newvolstatus = self.cinder.volumes.get(newvol.id).status
                if newvolstatus == 'available':
                    break
                elif newvolstatus == 'error':
                    msg = f"Hit error when waiting for Disk {diskname} to be available"
                    return {'result': 'failure', 'reason': msg}
                else:
                    pprint(f"Waiting 10s for Disk {diskname} to be available")
                    sleep(10)
            block_device_mapping = {'device_name': f'vd{letter}', 'device_type': 'disk', 'disk_bus': diskinterface,
                                    'source_type': 'blank', "destination_type": "volume",
                                    'volume_size': disksize, "delete_on_termination": True, 'volume_id': newvol.id}
            if index == 0:
                block_device_mapping['boot_index'] = 0
            if iso is not None and index == os_index:
                block_device_mapping['device_type'] = 'cdrom'
                del block_device_mapping['disk_bus']
                block_device_mapping['boot_index'] = 1
            block_device_mapping_v2.append(block_device_mapping)
        key_name = 'kvirt'
        keypairs = [k.name for k in nova.keypairs.list()]
        if key_name not in keypairs:
            publickeyfile = get_ssh_pub_key()
            if publickeyfile is None:
                warning("neither id_rsa, id_dsa nor id_ed25519 public keys found in your .ssh directory, you "
                        "might have trouble accessing the vm")
            else:
                publickeyfile = open(publickeyfile).read()
                nova.keypairs.create(key_name, publickeyfile)
        elif keypairs:
            key_name = keypairs[0]
            if key_name != 'kvirt':
                pprint(f'Using keypair {key_name}')
        else:
            error("Couldn't locate or create keypair for use. Leaving...")
            return {'result': 'failure', 'reason': "No usable keypair found"}
        userdata = None
        if cloudinit:
            if image is not None and common.needs_ignition(image):
                version = common.ignition_version(image)
                userdata = common.ignition(name=name, keys=keys, cmds=cmds, nets=nets, gateway=gateway, dns=dns,
                                           domain=domain, files=files, enableroot=enableroot, overrides=overrides,
                                           version=version, plan=plan, image=image, vmuser=vmuser)
            else:
                userdata = common.cloudinit(name=name, keys=keys, cmds=cmds, nets=nets, gateway=gateway, dns=dns,
                                            domain=domain, files=files, enableroot=enableroot, overrides=overrides,
                                            storemetadata=storemetadata, vmuser=vmuser)[0]
        meta = {x: metadata[x] for x in metadata if x in METADATA_FIELDS}
        instance = nova.servers.create(name=name, image=glanceimage, flavor=flavor, key_name=key_name, nics=nics,
                                       meta=meta, userdata=userdata, block_device_mapping_v2=block_device_mapping_v2,
                                       security_groups=securitygroups)
        tenant_id = instance.tenant_id
        if need_floating:
            floating_ips = [f['id'] for f in neutron.list_floatingips()['floatingips']
                            if f['port_id'] is None]
            if not floating_ips:
                network_id = None
                if self.external_network is not None:
                    networks = [n for n in neutron.list_networks()['networks'] if n['router:external']
                                if n['name'] == self.external_network]
                else:
                    networks = [n for n in neutron.list_networks()['networks'] if n['router:external']]
                if networks:
                    network_id = networks[0]['id']
                if network_id is not None and tenant_id is not None:
                    args = dict(floating_network_id=network_id, tenant_id=tenant_id)
                    floating_ip = neutron.create_floatingip(body={'floatingip': args})
                    floatingip_id = floating_ip['floatingip']['id']
                    floatingip_ip = floating_ip['floatingip']['floating_ip_address']
                    pprint(f'Assigning new floating ip {floatingip_ip} for this vm')
            else:
                floatingip_id = floating_ips[0]
            fixed_ip = None
            timeout = 0
            while fixed_ip is None:
                pprint("Waiting 5 seconds for vm to get an ip")
                sleep(5)
                timeout += 5
                if timeout >= 240:
                    error("Time out waiting for vm to get an ip")
                    break
                vm = nova.servers.get(instance.id)
                if vm.status.lower() == 'error':
                    msg = "Vm reports error status"
                    return {'result': 'failure', 'reason': msg}
                for key in list(vm.addresses):
                    entry1 = vm.addresses[key]
                    for entry2 in entry1:
                        if entry2['OS-EXT-IPS:type'] == 'fixed':
                            fixed_ip = entry2['addr']
                            break
            if fixed_ip is not None:
                fixedports = [i['id'] for i in neutron.list_ports()['ports']
                              if i['fixed_ips'] and i['fixed_ips'][0]['ip_address'] == fixed_ip]
                port_id = fixedports[0]
                neutron.update_floatingip(floatingip_id, {'floatingip': {'port_id': port_id}})
                if 'api_ip' in overrides:
                    api_ip = overrides['api_ip']
                    neutron.update_port(port_id, {'port': {'allowed_address_pairs': [{'ip_address': api_ip}]}})
            if not securitygroups:
                default_securitygroups = [s for s in neutron.list_security_groups()['security_groups']
                                          if s['name'] == 'default' and s['tenant_id'] == tenant_id]
                if default_securitygroups:
                    securitygroup = default_securitygroups[0]
                    securitygroupid = securitygroup['id']
                    sshrule = {'security_group_rule': {'direction': 'ingress', 'security_group_id': securitygroupid,
                                                       'port_range_min': '22', 'port_range_max': '22',
                                                       'protocol': 'tcp', 'remote_group_id': None,
                                                       'remote_ip_prefix': '0.0.0.0/0'}}
                    icmprule = {'security_group_rule': {'direction': 'ingress', 'security_group_id': securitygroupid,
                                                        'protocol': 'icmp', 'remote_group_id': None,
                                                        'remote_ip_prefix': '0.0.0.0/0'}}
                    try:
                        neutron.create_security_group_rule(sshrule)
                        neutron.create_security_group_rule(icmprule)
                    except:
                        pass
        return {'result': 'success'}

    def start(self, name):
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        vm.start()
        return {'result': 'success'}

    def stop(self, name, soft=False):
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        vm.stop()
        return {'result': 'success'}

    def create_snapshot(self, name, base):
        print("not implemented")
        return {'result': 'success'}

    def delete_snapshot(self, name, base):
        print("not implemented")
        return {'result': 'success'}

    def list_snapshots(self, base):
        print("not implemented")
        return []

    def revert_snapshot(self, name, base):
        print("not implemented")
        return {'result': 'success'}

    def restart(self, name):
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        vm.reboot()
        return {'result': 'success'}

    def report(self):
        print("not implemented")
        return

    def status(self, name):
        print("not implemented")
        return

# should return a sorted list of name, state, ip, source, plan, profile, report
    def list(self):
        vms = []
        nova = self.nova
        vmslist = nova.servers.list()
        for vm in vmslist:
            vms.append(self.info(vm.name, vm=vm))
        return sorted(vms, key=lambda x: x['name'])

    def console(self, name, tunnel=False, web=False):
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        url = vm.get_vnc_console('novnc')['console']['url']
        if web:
            return url
        if self.debug or os.path.exists("/i_am_a_container"):
            msg = f"Open the following url:\n{url}" if os.path.exists("/i_am_a_container") else url
            pprint(msg)
        else:
            pprint(f"Opening url: {url}")
            webbrowser.open(url, new=2, autoraise=True)
        return

    def serialconsole(self, name, web=False):
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        cmd = vm.get_console_output()
        if web:
            return cmd
        print(cmd)
        return

    def dnsinfo(self, name):
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            return None, None
        dnsclient, domain = None, None
        metadata = vm.metadata
        if metadata is not None:
            if 'dnsclient' in metadata:
                dnsclient = metadata['dnsclient']
            if 'domain' in metadata:
                domain = metadata['domain']
        return dnsclient, domain

    def info(self, name, vm=None, debug=False):
        nova = self.nova
        cinder = self.cinder
        if vm is None:
            try:
                vm = nova.servers.find(name=name)
            except:
                error(f"VM {name} not found")
                return {}
        yamlinfo = {'name': vm.name, 'status': vm.status, 'project': self.project, 'id': vm.id}
        if vm.status.lower() == 'error':
            try:
                yamlinfo['error'] = vm.fault['message']
            except:
                pass

        source = ''
        if 'id' in vm.image:
            source = vm.image['id']
            try:
                source = self.glance.images.get(vm.image['id']).name
            except:
                pass
        yamlinfo['iso' if source.endswith('.iso') else 'image'] = source
        yamlinfo['creationdate'] = vm.created
        yamlinfo['user'] = common.get_user(source)
        flavor = nova.flavors.get(vm.flavor['id'])
        yamlinfo['flavor'] = flavor.name
        yamlinfo['memory'] = flavor.ram
        yamlinfo['cpus'] = flavor.vcpus
        yamlinfo['nets'] = []
        index = 0
        for key in list(vm.addresses):
            entry1 = vm.addresses[key]
            for entry2 in entry1:
                mac = entry2['OS-EXT-IPS-MAC:mac_addr']
                if entry2['OS-EXT-IPS:type'] == 'floating':
                    yamlinfo['ip'] = entry2['addr']
                else:
                    net = {'device': f'eth{index}', 'mac': mac, 'net': key, 'type': entry2['addr']}
                    if index == 0:
                        yamlinfo['privateip'] = entry2['addr']
                    yamlinfo['nets'].append(net)
                    index += 1
        if 'ip' not in yamlinfo and 'privateip' in yamlinfo:
            yamlinfo['ip'] = yamlinfo['privateip']
        disks = []
        for disk in vm._info['os-extended-volumes:volumes_attached']:
            diskid = disk['id']
            try:
                volume = cinder.volumes.get(diskid)
            except cinderclient.exceptions.NotFound:
                disks.append({'device': 'N/A', 'size': 'N/A', 'format': 'N/A', 'type': 'N/A', 'path': diskid})
                continue
            disksize = volume.size
            devname = volume.name
            _type = volume.volume_type
            _format = volume.availability_zone
            volinfo = volume.to_dict()
            if 'volume_image_metadata' in volinfo and 'image_name' in volinfo['volume_image_metadata']:
                source = volinfo['volume_image_metadata']['image_name']
                yamlinfo['iso' if source.endswith('.iso') else 'image'] = source
            disks.append({'device': devname, 'size': disksize, 'format': _format, 'type': _type, 'path': diskid})
        if disks:
            yamlinfo['disks'] = disks
        metadata = vm.metadata
        if metadata is not None:
            for entry in metadata:
                yamlinfo[entry] = metadata[entry]
        if debug:
            yamlinfo['debug'] = str(vars(vm))
        return yamlinfo

    def ip(self, name):
        print("not implemented")
        return None

    def volumes(self, iso=False):
        images = []
        isos = []
        glance = self.glance
        for img in glance.images.list():
            imagename = img.name
            if imagename.endswith('.iso'):
                isos.append(imagename)
            else:
                images.append(imagename)
        if iso:
            return sorted(isos)
        else:
            return sorted(images)

    def delete(self, name, snapshots=False):
        cinder = self.cinder
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        floating_ips = {}
        try:
            fips = self.neutron.list_floatingips()
            floating_ips.update({f['floating_ip_address']: f['id'] for f in fips['floatingips']})
        except:
            # OVH does not provide floating ip networks, so the next error will occur
            # if some tries to get floating ip list:
            # neutronclient.common.exceptions.NotFound: The resource could not be found
            pass
        vm_floating_ips = []
        for key in list(vm.addresses):
            entry1 = vm.addresses[key]
            for entry2 in entry1:
                if entry2['OS-EXT-IPS:type'] == 'floating':
                    vm_floating_ips.append(entry2['addr'])
        vm.delete()
        for floating in vm_floating_ips:
            floatingid = floating_ips[floating]
            try:
                self.neutron.delete_floatingip(floatingid)
            except Exception as e:
                error(f"Hit {str(e)} when trying to delete floating {floating}")
        index = 0
        for disk in vm._info['os-extended-volumes:volumes_attached']:
            try:
                volume = cinder.volumes.get(disk['id'])
            except cinderclient.exceptions.NotFound:
                continue
            for attachment in volume.attachments:
                if attachment['server_id'] == vm.id:
                    cinder.volumes.detach(volume, attachment['attachment_id'])
            cinder.volumes.delete(disk['id'])
            index += 1
        return {'result': 'success'}

    def clone(self, old, new, full=False, start=False):
        print("not implemented")
        return

    def update_metadata(self, name, metatype, metavalue, append=False):
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return
        metadata = vm.metadata
        if append and metatype in metadata:
            metadata[metatype] += f",{metavalue}"
        else:
            metadata[metatype] = metavalue
        nova.servers.set_meta(vm.id, metadata)
        return {'result': 'success'}

    def update_memory(self, name, memory):
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        currentflavor = nova.flavors.get(vm.flavor['id'])
        if currentflavor.ram >= int(memory):
            warning("No need to resize")
            return {'result': 'success'}
        allflavors = [f for f in nova.flavors.list() if f != currentflavor]
        flavors = [flavor for flavor in allflavors if flavor.ram >= int(memory) and flavor.vcpus >= currentflavor.vcpus]
        if flavors:
            flavor = flavors[0]
            pprint(f"Using flavor {flavor.name}")
            vm.resize(flavor.id)
            resizetimeout = 40
            resizeruntime = 0
            vmstatus = ''
            while vmstatus != 'VERIFY_RESIZE':
                if resizeruntime >= resizetimeout:
                    error("Time out waiting for resize to finish")
                    return {'result': 'failure', 'reason': "Time out waiting for resize to finish"}
                vm = nova.servers.find(name=name)
                vmstatus = vm.status
                sleep(2)
                pprint(f"Waiting for vm {name} to be in verify_resize")
                resizeruntime += 2
            vm.confirm_resize()
            return {'result': 'success'}
        else:
            error("Couldn't find matching flavor for this amount of memory")
            return {'result': 'failure', 'reason': "Couldn't find matching flavor for this amount of memory"}

    def update_flavor(self, name, flavor):
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        currentflavor = nova.flavors.get(vm.flavor['id'])
        if currentflavor == flavor:
            return {'result': 'success'}
        flavors = [f for f in nova.flavors.list() if f.name == flavor]
        if not flavors:
            error(f"Flavor {flavor} doesn't exist")
            return {'result': 'failure', 'reason': f"Flavor {flavor} doesn't exist"}
        else:
            flavorid = flavors[0].id
            vm.resize(flavorid)
            resizetimeout = 40
            resizeruntime = 0
            vmstatus = ''
            while vmstatus != 'VERIFY_RESIZE':
                if resizeruntime >= resizetimeout:
                    error("Time out waiting for resize to finish")
                    return {'result': 'failure', 'reason': "Time out waiting for resize to finish"}
                vm = nova.servers.find(name=name)
                vmstatus = vm.status
                sleep(2)
                pprint(f"Waiting for vm {name} to be in verify_resize")
                resizeruntime += 2
            vm.confirm_resize()
            return {'result': 'success'}

    def update_cpus(self, name, numcpus):
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        currentflavor = nova.flavors.get(vm.flavor['id'])
        if currentflavor.vcpus >= numcpus:
            warning("No need to resize")
            return {'result': 'success'}
        allflavors = [f for f in nova.flavors.list() if f != currentflavor]
        flavors = [flavor for flavor in allflavors if flavor.ram >= currentflavor.ram and flavor.vcpus >= numcpus]
        if flavors:
            flavor = flavors[0]
            pprint(f"Using flavor {flavor.name}")
            vm.resize(flavor.id)
            resizetimeout = 40
            resizeruntime = 0
            vmstatus = ''
            while vmstatus != 'VERIFY_RESIZE':
                if resizeruntime >= resizetimeout:
                    error("Time out waiting for resize to finish")
                    return {'result': 'failure', 'reason': "Time out waiting for resize to finish"}
                vm = nova.servers.find(name=name)
                vmstatus = vm.status
                sleep(2)
                pprint(f"Waiting for vm {name} to be in verify_resize")
                resizeruntime += 2
            vm.confirm_resize()
            return {'result': 'success'}
        else:
            error("Couldn't find matching flavor for this number of cpus")
            return {'result': 'failure', 'reason': "Couldn't find matching flavor for this number of cpus"}

    def update_start(self, name, start=True):
        print("not implemented")
        return

    def update_information(self, name, information):
        self.update_metadata(name, 'information', information)
        return

    def update_iso(self, name, iso):
        print("not implemented")
        return

    def create_disk(self, name, size, pool=None, thin=True, image=None):
        glance = self.glance
        cinder = self.cinder
        glanceimage = None
        if image is not None:
            glanceimages = [img for img in glance.images.list() if img.name == image]
            if glanceimages:
                glanceimage = glanceimages[0]
            else:
                msg = f"you don't have image {image}"
                return {'result': 'failure', 'reason': msg}
        cinder.volumes.create(name=name, size=size, imageRef=glanceimage)
        return {'result': 'success'}

    def add_disk(self, name, size, pool=None, thin=True, image=None,
                 shareable=False, existing=None, interface='virtio', novm=False, overrides={}):
        glance = self.glance
        cinder = self.cinder
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        glanceimage = None
        if image is not None:
            glanceimages = [img for img in glance.images.list() if img.name == image]
            if glanceimages:
                glanceimage = glanceimages[0]
            else:
                msg = f"you don't have image {image}"
                return {'result': 'failure', 'reason': msg}
        index = len(vm._info.get('os-extended-volumes:volumes_attached', []))
        diskname = f"{name}-disk{index}"
        letter = chr(index + ord('a'))
        volume = cinder.volumes.create(name=diskname, size=size, imageRef=glanceimage)
        cinder.volumes.attach(volume, vm.id, f'/dev/vd{letter}', mode='rw')
        return {'result': 'success'}

    def delete_disk(self, name=None, diskname=None, pool=None, novm=False):
        cinder = self.cinder
        nova = self.nova
        if name is None:
            volumes = [volume for volume in cinder.volumes.list() if volume.name == diskname]
            if volumes:
                volume = volumes[0]
            else:
                msg = f"Disk {diskname} not found"
                return {'result': 'failure', 'reason': msg}
            if volume.attachments:
                volume.detach()
            cinder.volumes.delete(volume.id)
            return {'result': 'success'}
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        for disk in vm._info['os-extended-volumes:volumes_attached']:
            volume = cinder.volumes.get(disk['id'])
            if diskname == volume.name:
                for attachment in volume.attachments:
                    if attachment['server_id'] == vm.id:
                        cinder.volumes.detach(volume, attachment['attachment_id'])
                cinder.volumes.delete(disk['id'])
                return {'result': 'success'}
        msg = f"Disk {diskname} not found in {name}"
        error(msg)
        return {'result': 'failure', 'reason': msg}

    def list_disks(self):
        volumes = {}
        cinder = self.cinder
        for volume in cinder.volumes.list():
            volumes[volume.name] = {'pool': volume.volume_type, 'path': volume.id}
        return volumes

    def add_nic(self, name, network):
        print("not implemented")
        return

    def delete_nic(self, name, interface):
        print("not implemented")
        return

    def create_pool(self, name, poolpath, pooltype='dir', user='qemu', thinpool=None):
        print("not implemented")
        return

    def delete_image(self, image, pool=None):
        pprint(f"Deleting image {image}")
        glance = self.glance
        for img in glance.images.list():
            if img.name == image:
                glance.images.delete(img.id)
                return {'result': 'success'}
        return {'result': 'failure', 'reason': f"Image {image} not found"}

    def add_image(self, url, pool, short=None, cmd=None, name=None, size=None):
        downloaded = False
        shortimage = os.path.basename(url).split('?')[0]
        if name is not None and name.endswith('iso'):
            shortimage = name
        if [i for i in self.glance.images.list() if i['name'] == shortimage]:
            pprint(f"Image {shortimage} already there")
            return {'result': 'success'}
        if os.path.exists(url):
            pprint(f"Using {url} as path")
        elif not os.path.exists(f'/tmp/{shortimage}'):
            downloaded = True
            downloadcmd = f"curl -Lo /tmp/{shortimage} -f '{url}'"
            code = os.system(downloadcmd)
            if code != 0:
                return {'result': 'failure', 'reason': "Unable to download indicated image"}
        image_path = os.path.abspath(url) if os.path.exists(url) else f'/tmp/{shortimage}'
        if shortimage.endswith('gz'):
            if which('gunzip') is not None:
                uncompresscmd = f"gunzip {image_path}"
                os.system(uncompresscmd)
            else:
                error("gunzip not found. Can't uncompress image")
                return {'result': 'failure', 'reason': "gunzip not found. Can't uncompress image"}
            shortimage = shortimage.replace('.gz', '')
            image_path = image_path.replace('.gz', '')
        disk_format = 'iso' if shortimage.endswith('iso') else 'qcow2'
        glanceimage = self.glance.images.create(name=shortimage, disk_format=disk_format, container_format='bare')
        self.glance.images.upload(glanceimage.id, open(image_path, 'rb'))
        if downloaded:
            os.remove(f'/tmp/{shortimage}')
        return {'result': 'success'}

    def create_network(self, name, cidr=None, dhcp=True, nat=True, domain=None, plan='kvirt', overrides={}):
        if nat:
            externalnets = [n for n in self.neutron.list_networks()['networks'] if n['router:external']]
            externalnet_id = externalnets[0]['id'] if externalnets else None
            routers = [router for router in self.neutron.list_routers()['routers'] if router['name'] == 'kvirt']
            router_id = routers[0]['id'] if routers else None
        try:
            ip_network(cidr)
        except:
            return {'result': 'failure', 'reason': f"Invalid Cidr {cidr}"}
        neutron = self.neutron
        network_id = None
        networks = {net['name']: net['id'] for net in neutron.list_networks()['networks']}
        if name not in networks:
            network = {'name': name, 'admin_state_up': True}
            if 'port_security_enabled' in overrides:
                network['port_security_enabled'] = bool(overrides['port_security_enabled'])
            network = neutron.create_network({'network': network})
            network_id = network['network']['id']
            tenant_id = network['network']['tenant_id']
        else:
            warning("Network already there. Creating subnet")
        if cidr is not None:
            if network_id is None:
                network_id = networks[name]
            cidrs = [s['cidr'] for s in neutron.list_subnets()['subnets'] if s['network_id'] == network_id]
            if cidr not in cidrs:
                subnet = {'name': cidr, 'network_id': network_id, 'ip_version': 4, "cidr": cidr, 'enable_dhcp': dhcp}
                if domain is not None:
                    subnet['dns_nameservers'] = [domain]
                subnet = neutron.create_subnet({'subnet': subnet})
                subnet_id = subnet['subnet']['id']
                tenant_id = subnet['subnet']['tenant_id']
            else:
                warning("Subnet already there. Leaving")
                return {'result': 'success'}
        if nat:
            if externalnet_id is not None:
                if router_id is None:
                    router = {'name': 'kvirt', 'tenant_id': tenant_id}
                    # router['external_gateway_info'] = {"network_id": externalnet_id, "enable_snat": True}
                    router = neutron.create_router({'router': router})
                    router_id = router['router']['id']
                    router_dict = {"network_id": externalnet_id}
                    neutron.add_gateway_router(router_id, router_dict)
                neutron.add_interface_router(router_id, {'subnet_id': subnet_id})
        return {'result': 'success'}

    def delete_network(self, name=None, cidr=None):
        neutron = self.neutron
        routers = [router for router in self.neutron.list_routers()['routers'] if router['name'] == 'kvirt']
        router_id = routers[0]['id'] if routers else None
        if router_id is not None:
            router = routers[0]
        networks = neutron.list_networks(name=name)
        if not networks:
            return {'result': 'failure', 'reason': f'Network {name} not found'}
        network_id = networks['networks'][0]['id']
        if cidr is None:
            ports = [p for p in neutron.list_ports()['ports']
                     if p['device_owner'] != 'network:router_interface' and network_id == network_id]
            if ports:
                return {'result': 'failure', 'reason': 'Non router ports still present in this network'}
            if router_id is not None:
                floating_ips = [f['id'] for f in neutron.list_floatingips()['floatingips']
                                if f['router_id'] == router_id]
                if floating_ips:
                    return {'result': 'failure', 'reason': 'Floating ips still in use through router on this network'}
                ports = [p for p in neutron.list_ports()['ports']
                         if p['device_id'] == router_id and network_id == network_id]
                routerports = len(ports)
                for port in ports:
                    neutron.remove_interface_router(router_id, {'port_id': port['id']})
                    routerports -= 1
            neutron.delete_network(network_id)
        else:
            subnets = [s['id'] for s in neutron.list_subnets()['subnets']
                       if s['network_id'] == network_id and s['cidr'] == cidr]
            if subnets:
                subnet_id = subnets[0]
                if router_id is not None:
                    floating_ips = [f['id'] for f in neutron.list_floatingips()['floatingips']
                                    if f['router_id'] == router_id]
                    if floating_ips:
                        return {'result': 'failure',
                                'reason': 'Floating ips still in use through router on this network'}
                    ports = [p for p in neutron.list_ports()['ports'] if p['device_id'] == router_id]
                    routerports = len(ports)
                    for port in ports:
                        if 'fixed_ips' in port and subnet_id in port['fixed_ips'][0].values():
                            neutron.remove_interface_router(router_id, {'port_id': port['id']})
                            routerports -= 1
                neutron.delete_subnet(subnet_id)
        if routerports == 0:
            if router['external_gateway_info']:
                neutron.remove_gateway_router(router_id)
            pprint("Removing unused router kvirt")
            neutron.delete_router(router_id)
        return {'result': 'success'}

    def list_pools(self):
        print("not implemented")
        return

    def list_networks(self):
        networks = {}
        neutron = self.neutron
        for subnet in neutron.list_subnets()['subnets']:
            subnetname = subnet['name']
            subnet_id = subnet['id']
            cidr = subnet['cidr']
            dhcp = subnet['enable_dhcp']
            network_id = subnet['network_id']
            network = neutron.show_network(network_id)
            mode = 'external' if network['network']['router:external'] else 'isolated'
            # networks = [n for n in neutron.list_networks()['networks'] if n['router:external']]
            networkname = neutron.show_network(network_id)['network']['name']
            ports = [p for p in neutron.list_ports()['ports']
                     if p['device_owner'] == 'network:router_interface' and network_id == network_id]
            for port in ports:
                if 'fixed_ips' in port and subnet_id in port['fixed_ips'][0].values():
                    mode = 'nat'
                    break
            if networkname in networks:
                networks[networkname]['domain'] = f"{networks[networkname]['domain']}, {subnetname}"
            else:
                networks[networkname] = {'cidr': cidr, 'dhcp': dhcp, 'domain': subnetname, 'type': 'routed',
                                         'mode': mode}
        return networks

    def info_network(self, name):
        networkinfo = common.info_network(self, name)
        if self.debug and networkinfo:
            network = [net for net in self.neutron.list_networks()['networks'] if net['name'] == name][0]
            print(network)
            subnets = [sub for sub in self.neutron.list_subnets()['subnets'] if sub['id'] in network['subnets']]
            for subnet in subnets:
                print(subnet)
        return networkinfo

    def list_subnets(self):
        print("not implemented")
        return {}

    def delete_pool(self, name, full=False):
        print("not implemented")
        return

    def network_ports(self, name):
        print("not implemented")
        return

    def vm_ports(self, name):
        return ['default']

    def get_pool_path(self, pool):
        print("not implemented")
        return

    def flavors(self):
        nova = self.nova
        nova.flavors.list
        flavors = [[flavor.name, flavor.vcpus, flavor.ram] for flavor in nova.flavors.list()]
        return flavors

    def export(self, name, image=None):
        cinder = self.cinder
        nova = self.nova
        try:
            vm = nova.servers.find(name=name)
        except:
            error(f"VM {name} not found")
            return {'result': 'failure', 'reason': f"VM {name} not found"}
        for disk in vm._info['os-extended-volumes:volumes_attached']:
            volume = cinder.volumes.get(disk['id'])
            for attachment in volume.attachments:
                newname = image if image is not None else volume.name.replace('-disk0', '')
                volume.upload_to_image(True, newname, 'bare', 'qcow2')
                status = ''
                timeout = 0
                while status != 'available':
                    status = cinder.volumes.get(disk['id']).status
                    pprint("Waiting 5 seconds for export to complete")
                    sleep(5)
                    timeout += 5
                    if timeout >= 90:
                        error("Time out waiting for export to complete")
                        break
                break
        return {'result': 'success'}

    def list_dns(self, domain):
        return []

    def create_network_port(self, name, network, ip=None, floating=False, security=True):
        neutron = self.neutron
        matchingports = [i for i in neutron.list_ports()['ports'] if i['name'] == name]
        if matchingports:
            msg = f"Port {name} already exists"
            pprint(msg)
            return {'result': 'success'}
        networks = [net for net in neutron.list_networks()['networks'] if net['name'] == network]
        if not networks:
            msg = f"Network {network} not found"
            error(msg)
            return {'result': 'failure', 'reason': msg}
        else:
            network = networks[0]
        network_id = network['id']
        port = {'name': name, "admin_state_up": True, "network_id": network_id, 'port_security_enabled': security}
        if ip is not None:
            for subnet in neutron.list_subnets()['subnets']:
                subnet_name = subnet['name']
                subnet_id = subnet['id']
                cidr = subnet['cidr']
                if network_id == subnet['network_id'] and ip_address(ip) in ip_network(cidr):
                    msg = f"Using matching subnet {subnet_name} with cidr {cidr}"
                    pprint(msg)
                    port['fixed_ips'] = [{'ip_address': ip, 'subnet_id': subnet_id}]
        result = neutron.create_port({'port': port})
        port_id = result['port']['id']
        result = {'result': 'success'}
        if floating:
            tenant_id = network['tenant_id']
            if self.external_network is not None:
                network_id = self.external_network
                external_networks = [n for n in neutron.list_networks()['networks'] if n['router:external']
                                     if n['name'] == self.external_network]
            else:
                external_networks = [n for n in neutron.list_networks()['networks'] if n['router:external']]
            if external_networks:
                network_id = external_networks[0]['id']
            else:
                msg = "No valid external network found for floating ips"
                error(msg)
                return {'result': 'failure', 'reason': msg}
            args = dict(floating_network_id=network_id, tenant_id=tenant_id, port_id=port_id)
            floating_ip = neutron.create_floatingip(body={'floatingip': args})
            floatingip_ip = floating_ip['floatingip']['floating_ip_address']
            pprint(f'Assigning new floating ip {floatingip_ip} for this port')
            result['floating'] = floatingip_ip
        return result

    def delete_network_port(self, name):
        neutron = self.neutron
        matchingports = [i for i in neutron.list_ports()['ports'] if i['name'] == name]
        if not matchingports:
            msg = f"Port {name} not found"
            error(msg)
            return {'result': 'failure', 'reason': msg}
        self.neutron.delete_port(matchingports[0]['id'])

    def create_bucket(self, bucket, public=False):
        swift = self.swift
        if bucket in self.list_buckets():
            error(f"Bucket {bucket} already exists")
            return
        headers = {"X-Container-Read": ".r:*"} if public else {}
        swift.put_container(bucket, headers=headers)

    def delete_bucket(self, bucket):
        swift = self.swift
        try:
            containerinfo = swift.get_container(bucket)
        except:
            error(f"Inexistent bucket {bucket}")
            return
        for obj in containerinfo[1]:
            obj_name = obj['name']
            pprint(f"Deleting object {obj_name} in bucket {bucket}")
            swift.delete_object(bucket, obj_name)
        swift.delete_container(bucket)

    def delete_from_bucket(self, bucket, path):
        swift = self.swift
        try:
            containerinfo = swift.get_container(bucket)
        except:
            error(f"Inexistent bucket {bucket}")
            return
        for obj in containerinfo[1]:
            obj_name = obj['name']
            if path == obj_name:
                swift.delete_object(bucket, obj_name)
                break
        return

    def download_from_bucket(self, bucket, path):
        swift = self.swift
        try:
            resp_headers, obj_contents = swift.get_object(bucket, path)
        except Exception as e:
            error(f"Got {e}")
            return
        with open(path, 'wb') as f:
            f.write(obj_contents)

    def upload_to_bucket(self, bucket, path, overrides={}, temp_url=False, public=False):
        swift = self.swift
        if not os.path.exists(path):
            error(f"Invalid path {path}")
            return
        dest = os.path.basename(path)
        with open(path, 'rb') as f:
            swift.put_object(bucket, dest, contents=f, content_type='text/plain')
        if public:
            headers = {"X-Container-Read": ".r:*"}
            swift.post_container(bucket, headers=headers)

    def list_buckets(self):
        swift = self.swift
        return [container['name'] for container in swift.get_account()[1]]

    def list_bucketfiles(self, bucket):
        swift = self.swift
        try:
            containerinfo = swift.get_container(bucket)
        except:
            error(f"Inexistent bucket {bucket}")
            return []
        return [obj['name'] for obj in containerinfo[1]]

    def public_bucketfile_url(self, bucket, path):
        swift_url = self.swift.http_connection()[0].geturl()
        return f"{swift_url}/{bucket}/{path}"

    def reserve_dns(self, name, nets=[], domain=None, ip=None, alias=[], force=False, primary=False):
        print("not implemented")
        return

    def update_nic(self, name, index, network):
        print("not implemented")

    def update_network(self, name, dhcp=None, nat=None, domain=None, plan=None, overrides={}):
        neutron = self.neutron
        networks = [net for net in neutron.list_networks()['networks'] if net['name'] == name]
        if not networks:
            msg = f"Network {name} not found"
            error(msg)
            return {'result': 'failure', 'reason': msg}
        else:
            network = networks[0]
            network_id = network['id']
        network_data = {}
        if 'port_security_enabled' in overrides and isinstance(overrides['port_security_enabled'], bool):
            network_data['port_security_enabled'] = overrides['port_security_enabled']
        if 'mtu' in overrides and isinstance(overrides['port_security_enabled'], int):
            network_data['mtu'] = overrides['mtu']
        if 'description' in overrides:
            network_data['description'] = str(overrides['description'])
        if 'tags' in overrides and isinstance(overrides['tags'], list):
            network_data['tags'] = overrides['tags']
        if 'availability_zones' in overrides and isinstance(overrides['availability_zones'], list):
            network_data['availability_zones'] = overrides['availability_zones']
        if 'availability_zone_hints' in overrides and isinstance(overrides['availability_zone_hints'], list):
            network_data['availability_zone_hints'] = overrides['availability_zone_hints']
        if network_data:
            neutron.update_network(network_id, {'network': network_data})
        subnets = [sub for sub in self.neutron.list_subnets()['subnets'] if sub['id'] in network['subnets']]
        if subnets:
            subnet_data = {}
            subnet = subnets[0]
            subnet_id = subnet['id']
            currentdhcp = subnet['enable_dhcp']
            if dhcp is not None:
                if not dhcp and currentdhcp:
                    subnet_data['enable_dhcp'] = False
                if dhcp and not currentdhcp:
                    subnet_data['enable_dhcp'] = True
            if 'dns_nameservers' in overrides and isinstance(overrides['dns_nameservers'], list):
                subnet_data['dns_nameservers'] = overrides['dns_nameservers']
            if 'dns' in overrides and isinstance(overrides['dns'], list):
                subnet_data['dns_nameservers'] = overrides['dns']
            if subnet_data:
                neutron.update_subnet(subnet_id, {'subnet': subnet_data})
        return {'result': 'success'}


Simply beautiful. There's something magical about watching the sunrise. I only wish I could get up in time to watch it, haha.
This just made my day! So magical!!
It does seem like a magical experience!!
I have found sunrises in general to be a magical experience as there is something about watching dawn break over the horizon that seems to make it a miracle of nature. It was extra special watching the sunrise over an ancient city.
Thank you, Lauren. I also love seeing places as they come to life in the early hours of morning.
Gorgeous! I too got to see this wonderful sunset 🙂 Loved the reflection most of all, the only thing that wasn't as magical as I had expected was how crazy busy it was! But it was for the reason that it's amazing!
The sunset at Angkor Wat must have been a beautiful one as well, though as you say crowded. Unfortunately, we used to be exhausted by the end of the day and would retreat to our hotel to rest before going out to explore the Angkor night market.
Oops, I just realised my typo! I meant sunrise 😀 That's what I saw too!!
Wow. Was it so crowded early in the morning as well? I only saw a few people around till about 7am when more people started arriving. Later in the day though, it was too crowded for me to enjoy the place.
Probably I was fortunate on the morning that I went 🙂 I can imagine everyone would want to watch the sunrise over Angkor Wat, having traveled all the way there 🙂 It was a magical sight though, wasn't it?
Thank you so much for your lovely comment, Amanda.
ahh! how stunning! I went to ankgor and saw it all, but i didn't watch the sun rise or set. I've heard it's packed!
Thanks, Carrie. I guess I was lucky that it was not packed the two mornings that I was there.
So beautiful. I just need to make it there..thanks for sharing.
Early morning walks and reflections are amazing experiences, aren't they? Thanks, Lorelei. By the way, the link when I click 'California Globetrotter' from your comment does not take me to your blog caliglobetrotter – hope you are aware of it.
Hamm thank you for letting me know…I'll have to tell my fiancé – we're currently working on a new site for me so maybe that's why…?
I am glad you shared all these photos. I have never been to Angkor Wat, so, it is great to be able to have nice view of the site. I love the last photos.
Many thanks, Ruth. Glad you enjoyed the sunrise photos at Angkor Wat.
Ah, Angkor Wat! You beat me to it. I wanted to go there for so long, but still didn't make it. I'm envious.
Hope you make it there soon, Anda. Angkor Wat and other temple complexes at Siem Reap are very special indeed.


Chordata are a Phylum of Kingdom Animalia and include the most advanced biological organisms. These organisms are marked notably by the presence of a notochord.
Chodates include the fastest and largest organisms on earth.
These are the Peregrine Falcon and the Blue Whale respectively.


About Avalon English is a highly respected and reputable after-school English academy in South Korea. With campuses located nationwide, Avalon English is one of the biggest English Academy Corporations in S. Korea. At Avalon, students develop their English language skills by studying with both Korean English teachers and native English speakers. Students spend half of their time with a Korean teacher, and the other half with a native English speaker. Each teacher focuses on slightly different areas. The Korean teachers primarily focus on grammar and vocabulary, giving the students the chance to ask questions and get clarification in their own language. In the native English speakers class, the focus is on listening, speaking, reading, writing, and pronunciation. This gives the students the chance to implement the things theyve learned and be immersed in an English-only environment, allowing them to sharpen their English communication skills.


text:
Top > Religious > List of Major Religious Sects by Number of Members in Japan, 2015
List of Major Religious Sects by Number of Members in Japan, 2015
Ministry of Education, Culture, Sports, Science and Technology gathers the number of each religious group members. The registered religious groups report the number of their believers to the ministry by self-reporting. The reported numbers are often exaggerated. The total number of the believers of all sects exceeds the population in Japan.
The following shows the number of members of major religious sects in Japan, 2015.
Table 1: Shinto believers
Shinto Members
Association of Shinto Shrines 79,770,411
Izumo-oyashiro-kyo 1,261,938
Table 2: Buddhism believers
Buddhism Members
Jodo Shinshu Hongwanji-ha 7,926,894
Jodo Shu 6,021,900
Koyasan Shingon Buddhism 3,833,220
Sotoshu 3,540,957
Nichiren Shu 3,486,251
the Shinshū Ōtani-ha branch of Jōdo Shinshū 3,204,160
Rissho Kosei-kai 2,826,297
Tendaishu 1,534,669
The Buzan Sect of Shingon Buddhism 1,422,452
Reiyukai 1,340,703
Tenrikyo 1,169,744
Bussho-Gonenkai 1,167,960
Besides the list above, there are two big religious groups in Japan; Soka Gakkai and Happy Science. The ministry did not report the number of their believers, because they are classified as the sect which the ministry does not have to release the data.
Soka Gakkai says they have 8.27 million households believers in their web site.
I could not find a reliable data of Happy Science. The number varies depending upon the source, from 0.1 million to 10 million.
Source is Shukyo Nenkan published by Agency for Cultural Affairs.
www.bunka.go.jp/tokei_hakusho_shuppan/hakusho_nenjihokokusho/shukyo_nenkan/
Number of Colleges and Universities in Japan, 1955…
There are 795 colleges and universities in Japan as of 2020…
Changes in the Number of Murder Victims in Japan, …
Ministry of Health, Labour and Welfare counts people's deat…
Ministry of Health, Labour and Welfare reported the number …
Changes in Number of Murder Victims in Japan, 1995…
« Number of Kids Has Been Decreasing for … Girls Average Height and Weight by Age … »

redpajama_set_name: RedPajamaCommonCrawl


text:
One Year Down, Three to Go
Reid Frazier March 2, 2018
PodcastsPoliticsYour Environment Update
The Trump administration has been in office for a little over a year, and it's done a lot to change the federal government's stance on environmental issues from announcing the US's withdrawal from the Paris climate agreement, to opening up thousands of miles of U.S. coastline to offshore drilling. So what's the impact of all these changes? For our podcast Trump on Earth, we spoke with Dan Farber, an environmental law professor at the University of California at Berkeley and co-director of the Center for Law Energy and the Environment. He also blogs about these issues at legal-planet.org.
Farber acknowledges that President Trump has done a 180 on environmental policy in his first year of office, but he hasn't gained much ground beyond that.
"Trump has turned the car around, but he hasn't gone very far down the road in the opposite direction," says Farber. "He's got a lot of plans. There are a lot of proposals in the works, but concrete accomplishments are a lot more limited. But of course it's only the first year."
Take EPA chief Scott Pruitt as a test case. Farber says he's issued a lot of proposals to undo some major accomplishments from the Obama administration, and he's delayed putting a lot of other things into effect. But it's not that simple. Most of the action this next year will be in court where a lot of this stuff starts to get worked out through the legal process.
"Getting rid of a rule is actually a complicated process, just like creating the rule in the first place," says Farber. "You can't just wave a magic wand and the rule goes away. So what they've done is started the process by putting some proposals out there to eliminate existing rules. But now they have to go through the gathering of comments, they have to write up pretty detailed lengthy explanations of exactly why they're doing what they're doing."
The administration is planning to issue the final rules for the Waters of the United States Rule and the Clean Power Plan this year. And it's at that point that Farber says we'll see the action turn to the courts.
"Probably within the first hour after these rules come out, [state governments and environmental groups] will file in federal courts to challenge the rules," explains Farber. "And we'll have to see over what could be a period of another year, what the courts actually have to say about these actions."
Listen to the podcast to hear more from Dan Farber, including why he thinks the Interior Department has had many more wins over the EPA. Also, Trump has appointed 12 federal appellate judges, a record for a president in his first year. Who are these appellate judges? And what impact will they have in steering environmental policies and laws in the next decades to come?
Mentioned in this episode:
legal-planet.org
The Clean Power Plan
Waters of the U.S. Rule
Center for Law, Energy & the Environment
This episode was hosted by Reid Frazier. Trump on Earth is produced by The Allegheny Front, a Pittsburgh-based environmental reporting project, and Point Park University's Environmental Journalism program.
Our podcast is free to download, follow and listen, so if you find these episodes informative in a chaotic political environment, please consider donating or leaving a review on iTunes. We are actively listening to our reviewers, and each review helps our podcast reach more ears.
Questions? Tweet at us on Twitter or send us a message via tr**********@gm***.com or Facebook.
2 March 2018Trump on Earth
Ex-Pennsylvania DEP secretary: Agency's underfunding will test its new leader


text:
Comments on the session 'Contemporary Mormon Issues'
by Armand L. Mauss, School of Religion, Claremont Graduate University
A paper presented at The 2009 CESNUR Conference, Salt Lake City, Utah, June 11-13, 2009
This session provides us with a miscellany of papers in which no unifying theme is readily apparent, except for the pair by Bringhurst and Foster dealing with Mormons and presidential politics. In response to the authors of those papers, I take no particular exception to anything they said, though Foster's expectation of seeing a Mormon president by midcentury still seems rather optimistic to me. I would say that the fulfillment of such an expectation depends primarily upon changes in American public opinion at two different levels : (1) normalizing the image of the Church, so that it appears less weird, secretive, and theocratic; and (2) normalizing the image of the LDS candidate, so that his religious commitments don't seem quite so central to his way of life. In America, a politician must subscribe to the traditional "civil religion," but he must not be noticeably devout in any denominational religion, especially a "peculiar" one.
Normalizing in the first above-mentioned sense (church image) will depend on an extensive campaign by the LDS leadership, which I think has already started. Normalizing in the second sense (candidate image) will depend on the candidate's own skills and on those of his campaign. This proved very difficult for Mitt Romney, whose life was constantly presented as a great "Mormon story." By contrast, Harry Reid has an interesting Mormon story too, but somehow his religion does not come across as so central to his life. I suspect that most Americans don't even know that Reid is LDS. I think also that one reason John Kennedy was so readily able to dispense with the worry about a "Catholic" president was that no one thought his religion was truly central to his life or career. Even though Catholicism before Vatican II was at least as theocratic in image as today's Mormonism, that didn't seem to matter as long as Kennedy himself was not perceived as taking his Catholicism very seriously. A successful Mormon candidate will somehow have to come across as a "mellow" kind of Mormon, rather than as a seriously devout one. That will be an obvious problem for a Mormon candidate who (like Mitt) really is quite devout. His father George was probably equally devout, but his image didn't suggest that as a defining characteristic of his life. Furthermore, the LDS Church in George Romney's day was not well enough known to be as "scary" as it seems now (it simply lagged somewhat in race relations). So I am suggesting that both the image of the Church and the image of the candidate will need a lot of work before we are likely to see a Mormon elected as President.
Rick Phillips, as usual, writes a convincing paper that counters the image of Utah Mormons common among their coreligionists outside the mountain west – namely that Utah Mormons are complacent about their religion and don't work at it as hard as (say) the California Mormons do. Many decades ago, apparently in reaction to some of Durkheim's early work, sociologists were warned about the "ecological fallacy" – namely the fallacy of attributing to individuals in a given population the average traits of that population as a whole. Ever since then, regretably, sociologists have been wary about ANY causal attributions derived from collective community traits, even in trying to explain differencs in rates, rather than in individuals.
Phillips uses an "ecology" explanation very successfully here by invoking the concept of "social density." Rodney Stark & William S. Bainbridge have shown that the same concept is useful for explaining why criminal and deviant behavior is lower in communities with large proportions of church-goers, even among segments of the community that are NOT church-going.[1] It seems clear that when the proportion of a population sharing a given cultural heritage reaches a certain point (maybe not even a majority), its culture both influences and constrains various behavioral expressions in the population as a whole. (Is there a "tipping point" here? Can the "tip" go either way?). Sometimes these cultural influences are subtle (as in the visible contents of one's shopping cart), and sometimes the influences are quite overt and obvious (as in local liquor laws). Without necessarily using the term "social density," Mark Shibley, in effect, made a similar argument when he referred to the "southernization" of American religious culture, as devout and conservative southerners moved north and west, where they simultaneously influenced (but were reciprocally influenced by) less evangelical congregations.[2] To some extent we see a similar phenomenon politically in our designation of some states in the Union as "blue" and others as "red," with transitional cases as "purple."
In any case, there is little doubt that we can expect Mormon cultural influence to be diluted in the traditional Mormon Culture Region (MCR) during the coming years. How will the current generation of LDS leaders respond to this challenge? Will there be another retrenchment effort, as there was in the wake of the cultural and political challenges of the 1960s and 1970s? Or will the outreach and engagement mode now so apparent be continued? What will be the likely consequences for LDS growth, retention, and influence of the one policy direction or the other? Is there any way for the Church to prevent the erosion of LDS influence in the MCR, and the disaffiliation of its members, even as its baptisms continue in large numbers?
Finally, a few comments on Irving's "postmodernism" paper : This term seems to mean somewhat different things to different users. I will not claim any expertise in the literature of postmodernism. Such knowledge as I have is entirely second-hand, largely interpretations by others of some of the writings of Foucault or Lyotard. In recent years, the term has been discussed and applied to developments in Mormonism by some of the LDS apologists at BYU (especially at FARMS, now part of the Maxwell Institute), as well as by critical analysts of intellectual developments like John-Charles Duffy.[3] The term has been making the rounds also in the blogosphere, where agreement on its meaning and applications to Mormonism seems far from complete..
Iain Irving's understanding of the term in this paper is roughly similar to what I have seen elsewhere – namely, that postmodernism, as applied particularly to religion, regards the search for truth as fraught with subjectivity and ambiguity. It rejects any form of absolutism, defining truth as individual, not objective or absolute. Postmodernism is thus radically opposed epistemologically to empiricism and logical positivism as the vehicles for discovering truth.[4] In applying this understanding to the contemporary Mormon scene, Irving sees evidence both of the emergence of postmodernist elements in the Church program and of the persistence of the more absolutist modernism. This ambivalence gives his paper a kind of "on the one hand . . . .but on the other hand" approach to his subject, which is understandable and not inappropriate for such a topic.
My own assessment, for what it's worth, is that a postmodernist approach is ultimately the only one available for discovering "truth" in the humanities or in the truth-claims of religion. That is because "truth" in those disciplines is always unfalsifiable in the modernist sense. Modernist epistemology developed along with the modern physical sciences, where truth-claims can and must be tested empirically before they can be accepted and acted upon. A major feature of the scientific method is replicability – the assurance that if you follow Aristotelian logic, and subject a hypothesis (hypo-truth) to empirical tests, you will get the same results as I did; that is, the finding is replicable. Postmodernist epistemology rejects replicability as a criterion for truth, so it will never be useful to science, or at least not as science has been understood in Western civilization for the past 2500 years. Postmodernism is, however, ideally suited to religion, the humanities and the arts, where no one is concerned about logic or replicability. The disciplines of history and the social sciences are somewhat in the middle, and they have always had to deal with epistemological ambiguity and conflicting theoretical frameworks. As a social scientist, I recognize and appreciate this ambiguity, as well as the creativity that so many of my colleagues and mentors have shown in advancing unfalsifiable but exciting theories and hypotheses over the years. Yet, I remain fundamentally a modernist and a logical positivist, because of the value I place on replicability as the only reliable path to progress – which I define as the growing accumulation of enduring and pragmatic truths.
Mormonism began in an intellectual and cultural environment which was permeated with both folk magic and folk science. By the latter term I mean a general tendency, under the influence of the European Enlightenment, to seek empirical verification for as many of one's beliefs as possible. Early Mormons knew that religion was under attack from the emerging Enlightenment ethos, and they did not want to be made fools of. This outlook was well exemplified by the visit of Martin Harris to Professor Anthon for verification of the Book of Mormon "characters." Such ambivalence betweem naturalist and supernaturalist thinking continues in Mormonism today, where unfalsifiable beliefs in the supernatural coexist with scholarly research intended to vindicate the authenticity of the Book of Mormon. A few of the more strident apologists at BYU, however, have actually embraced postmodernism as a vindication of their apologetic scholarship, on the grounds that if all truth is relative, subjective, and entitled to its own master narrative, as postmodernists claim, then their Mormon truths are entitled to the same ontological status as anyone else's.[5]
Postmodernism is far more useful and successful in criticizing the truth-claims of modernists than it is in helping us to understand the ambiguous social and physical world in which we live. As a logical positivist, I can tell you not only what I think is true (or real), but I can tell you why I think so, and I can tell you how I arrived at that conclusion in such a way that you can replicate my method and get the same result. That might seem terribly confining and absolutist to a postmodernist, but at least it represents a shared epistemology. Such an epistemology will not work in the search for the supernatural or other unfalsifiable truth-claims of religion, but it does have some applicability to the history and sociology of religion. Not all propositions in the social sciences are empirical, testable, falsifiable, or replicable, but many are (as the present paper by Phillips indicates). In such cases – that is, in trying to understand the relationship between religion and behavior in this world – I shall continue to prefer the modernist epistemology.
[1] Rodney Stark & William S. Bainbridge, Religion, Deviance, and Social Control (Routledge, 1996).
[2] Mark A. Shibley, Resurgent Evangelicalism in the United States: Mapping Cultural Change since 1970 (University of South Carolina Press, 1997).
[3] John-Charles Duffy, "Defending the Kingdom, Rethinking the Faith: How Apologetics is Reshaping Mormon Orthodoxy," Sunstone, May 2004: 22-55; and "Can Deconstruction Save the Day? Faithful Scholarship and the Uses of Postmodernism," Dialogue 41(1): 1-33 (Spring 2008).
[4] See, e. g., Louis C. Midgley, "The Myth of Objectivity: Some Lessons for Latter-day Saints" (a review), Sunstone 14 (Aug. 1990): 54-56.
[5] See, e. g., David E. Bohn, "Our Own Agenda: A Critique of the Methodology of the New Mormon History," Sunstone 77(June 1990): 45-49.


text:
<?php

namespace Chamilo\Application\Weblcms\Tool\Implementation\CourseGroup\Infrastructure\Service\CourseGroupDecorator;

use Chamilo\Application\Weblcms\Tool\Implementation\CourseGroup\Storage\DataClass\CourseGroup;
use Chamilo\Core\User\Storage\DataClass\User;
use Chamilo\Libraries\Format\Structure\ActionBar\ButtonToolBar;

/**
 * Decorates the CourseGroup integrations toolbar with additional actions
 *
 * @package Chamilo\Application\Weblcms\Tool\Implementation\CourseGroup\Form
 *
 * @author Sven Vanpoucke - Hogeschool Gent
 */
interface CourseGroupActionsDecoratorInterface
{
    /**
     * Adds actions to the toolbar of integration actions
     *
     * @param \Chamilo\Libraries\Format\Structure\ActionBar\ButtonToolBar $courseGroupActionsToolbar
     * @param \Chamilo\Application\Weblcms\Tool\Implementation\CourseGroup\Storage\DataClass\CourseGroup $courseGroup
     * @param \Chamilo\Core\User\Storage\DataClass\User $user
     * @param bool $isCourseTeacher
     */
    public function addCourseGroupActions(
        ButtonToolBar $courseGroupActionsToolbar, CourseGroup $courseGroup, User $user, $isCourseTeacher = false
    );

    /**
     * @param ButtonToolBar $courseGroupActionsToolbar
     * @param CourseGroup $courseGroup
     * @param User $user
     * @param bool $isCourseTeacher
     */
    public function addCourseGroupSubscriptionActions(
        ButtonToolBar $courseGroupActionsToolbar, CourseGroup $courseGroup, User $user, $isCourseTeacher = false
    );
}

redpajama_set_name: RedPajamaGithub


text:
Home nieuws UNRWA: Palestinian refugees from Syria in Lebanon down by 25,377
UNRWA: Palestinian refugees from Syria in Lebanon down by 25,377
Lebanon, Bekaa valley (AFP)
Middle East Monitor / April 8, 2020
Palestinian refugees from Syria living in Lebanon decreased to almost 27,700 in February, the United Nations Relief and Works Agency (UNRWA) announced yesterday.
In 2013, Palestinian refugees from Syria in Lebanon amounted to 84,000 people, according to official data, but it decreased to 53,077 on 11 April 2014.
"The large and gradual decrease in the number of Palestinian refugees is attributed to the laws that the Lebanese government has adopted against the Syrian Palestinians, including lack of employment and residency opportunities, prompting hundreds of families to migrate despite the high risks involved," UNRWA said.
Lebanon hosts 475,075 Palestinian refugees across 12 camps, according to an URNWA report from 1 January 2019.
Palestinians in Lebanon, who are banned from working in several industries, are unable to find jobs and have been left with no money to buy food.


text:
Doctoral scholarship holder, Bioethics
University of Antwerp, Belgium
Updated: about 2 months ago
Department: Department of Philosophy
Regime Full-time
Let's shape the future - University of Antwerp
The University of Antwerp is a dynamic, forward-thinking, European university. We offer an innovative academic education to more than 20000 students, conduct pioneering scientific research and play an important service-providing role in society. We are one of the largest, most international and most innovative employers in the region. With more than 6000 employees from 100 different countries, we are helping to build tomorrow's world every day. Through top scientific research, we push back boundaries and set a course for the future – a future that you can help to shape.
The Department of Philosophy in the Faculty of Arts is looking for a full-time (100%) doctoral scholarship holder in the field of bioethics
You will work actively on the preparation and defence of a PhD thesis in the field of bioethics. We are looking to hire a full-time (100%) doctoral scholarship holder (PhD student) in the field of bioethics to work on ethical aspects of large cohort proteomics and systems medicine trials as part of the research project: Beyond the genome: ethical aspects of large cohort studies.
You will publish scientific articles related to the research project.
You will carry out a limited number of teaching and research support tasks for department of philosophy.
You hold a Master degree in law and a specific interest in bioethics. Candidates with a degree in philosophy/ethics and a specific interest in ethical aspects of (clinical) data management and empirical, qualitative research methods are equally welcome to apply.
You can demonstrate excellent study results.
Your teaching competences are in line with the University of Antwerp's educational vision .
Your research qualities are in line with the faculty and university research policies .
You act with attention to quality, integrity, creativity and cooperation.
You are able to work independently, but also enjoy working in team
You enjoy and endorse and sharing research experiences and results with peers
We offer a doctoral scholarship for a period of two years. Following a positive evaluation, the scholarship can be renewed for another two years.
The planned start date is 1st of January 2023 or as soon as possible after that date.
Your monthly scholarship amount is calculated according to the scholarship amounts for doctoral scholarship holders on the pay scales for Contract Research Staff (Dutch: Bijzonder Academisch Personeel, BAP).
You will receive ecocheques, Internet-connectivity allowance, and a bicycle allowance or a full reimbursement of public transport costs for commuting.
You will be working at the department of Philosophy of the University of Antwerp, Belgium within the NeuroEpigenEthics group and in close collaboration with the VITO research institute in Mol, Belgium. Belgian residency and/or willingness to attend regular meetings at VITO and at the University of Antwerp will be necessary.
Find out more about working at the University of Antwerp here .
Want to apply?
You can apply for this vacancy through the University of Antwerp's online job application platform up to and including 5th of December 2022. Click on the 'Apply' button, complete the online application form and be sure to include the following attachments: a motivation letter, your academic CV and a one-page writing sample. In this writing sample, you should reflect on the project and how you would tackle it.
The selection committee will review all of the applications as soon as possible after the application deadline. As soon as a decision has been made, we will inform you about the next steps in the selection procedure. Please make a note of the following dates: 15th of December: online interview.
If you have any questions about the online application form, please check the frequently asked questions or send an email to jobs@uantwerpen.be . If you have any questions about the job itself, please contact Kristien Hens (research professor, kristien.hens@uantwerpen.be )
The University of Antwerp received the European Commission's HR Excellence in Research Award for its HR policy. We are a sustainable, family-friendly organisation which invests in its employees' growth. We encourage diversity and attach great importance to an inclusive working environment and equal opportunities, regardless of gender identity, disability, race, ethnicity, religion or belief, sexual orientation or age. We encourage people from diverse backgrounds and with diverse characteristics to apply.
Ph D Position 'Maxwind', Vrije Universiteit Brussel, Belgium, about 9 hours ago
The Faculty of Engineering, Department Toegepaste mechanica, is looking for a PhD-student with a doctoral grant. More concretely your work package, for the preparation of a doctorate, contains: If...
Ph D "Gender Empowerment Through Politics In Classrooms", Vrije Universiteit Brussel, Belgium, 4 days ago
The Faculty Social Sciences & Solvay Business School, Department Politieke Wetenschappen, is looking for a PhD-student with a doctoral grant. More concretely your work package, for the preparation...
Ph D Position Wind Soil, Vrije Universiteit Brussel, Belgium, about 9 hours ago
Ph D Research Position For The Modelling, The Design And The Development Of A Solar Cell Enabled Electrothermal Energy And Potable Water Production System Using Hydrogen., Katholieke Universiteit Leuven, Belgium, 4 days ago
(ref. BAP-2023-22) Laatst aangepast : 17/01/2023 M-Group of KU Leuven is a research team performing ground-breaking work in mechatronic systems and energy. It consists of 5 professors from 3 depar...
Ph D Scholarship: Load Monitoring, Failure Prediction And Design Optimization For Mechatronic Systems, Vrije Universiteit Brussel, Belgium, 4 days ago
The Faculty of Engineering, Department Toegepaste natuurkunde en fotonica, is looking for a PhD-student with a doctoral grant. More concretely your work package, for the preparation of a doctorate...
Ph D Student Novel Radiation Technique Rectal Cancer, Maastro, Netherlands, about 18 hours ago
PhD-student novel radiation technique rectal cancer PhD-student novel radiation technique rectal cancer Published Deadline Location yesterday 17 Feb Maastricht Maastro initiates clinical research,...


Domain registration, Website design, email and web hosting are our profession since 2011.
Reliable 99% up time web hosting service from Web Stock with Emails and easy control panel for the website and provides with the necessary tools to get a fully-functional website up and running as quickly as possible.
Our pricing starts from yearly as low as $90 which includes all the website maintenance.
Web Stock provides reliable and affordable web hosting for your website. We hosting service in Melbourne includes website maintenance with no extra charge.
Web hosting is optional,you can have own hosting service from any hosting provider.
If you would like a quick quote for our web hosting services please contact us on (03) 9015 4091 or email info@webstockltd.com.au or just fill up the below quick form,we will get back to you within 12 hours.


Founded in 2001, ZAP Engineering and Construction Services, Inc. (ZAP) is a full-service engineering and construction management company.
From engineering and design to project controls and construction management, ZAP brings decades of expertise to the oil & gas, specialty chemical and material handling industries. Our engineering services represent a variety of disciplines to include: Chemical, Mechanical, Electrical, Instrumentation & Control, Civil and Structural. The diverse backgrounds of our project team allow ZAP to bring focused knowledge to unique challenges and projects.
We have successfully provided customers with project management and construction management services on a variety of projects. Our capabilities in the design and installation of effective and efficient processing facilities are unparalleled. ZAP provides services ranging from front-end technical and feasibility studies through turn-key projects.
The foundation of our business is our client-centered culture and teamwork-based approach. Combining years of experience and education, our team of engineers, designers, project managers, drafters, construction managers and support personnel collaborate effectively to improve concept and design of all projects.
After assessing project requirements and client needs, the ZAP team designs innovative processes with the most cost-effective solutions. Our engineering staff has designed, constructed, and commissioned projects in a variety of industries, and utilizes this expertise to develop feasible and practical designs tailored to meet your specific project objectives.
We understand each person has an influence and a direct impact on the success of the Company.
We strive to foster a professional environment where everyone is treated with respect and empathy.
We thrive when we work together, are honest, transparent, and follow through on our commitments.
The success of every task, project, department, and of the company as a whole depends on everyone acting as a team.
Quality is at the forefront of everything we do. Every person plays a role in ensuring quality.
We take pride in producing quality work as a team and in enhancing our reputation as a high-quality professional services and construction company.
We believe in prompt, efficient, and flexible execution.
We listen to our clients and look at projects from their perspective combining our expertise with their project goals.
We embrace change and challenging circumstances as opportunities to grow and meet the demands of our clients.
Your Project, Our Expertise, Your Success.
ZAP provided turnkey engineering and procurement services for the engineering phase of this project and subsequently served as the general contractor for the construction phase.


In Edwardian London, two very rich, eccentric brothers, Oliver and Roderick Montpelier, commission their bank to create a million pound note in order to settle a wager. Oliver believes that the mere possession of this symbol of wealth will enable anyone to have anything he wants, without actually cashing the note. Roderick, on the other hand, feels that the prohibition against exchanging the note for cash will render it totally useless. In order to settle their wager, the brothers hire Henry Adams, a New England sailor who has been stranded, penniless, in London and is unable to return home. The brothers present him with an envelope, telling him that it contains a sum of money and that it is to be opened later. Famished, Henry assumes that the envelope contains sufficient cash to cover a hearty meal at a pleasant restaurant. His scruffy appearance, however, banishes him to a back table, where the restaurant owner and his wife eye him suspiciously. When presented with the bill, Henry opens the envelope, discovers the million pound banknote and offers it to the stunned proprietor, who then shows it to a banker dining in the restaurant. The banker confirms that the note is genuine and remarks that the owner must be an eccentric millionaire. The restaurateur and his wife immediately apologize to Henry, saying they are honored by his presence, cancel his bill and bow to him as he leaves. When Henry returns to the Montpeliers' house to question them, he is informed that they have gone abroad for a month. Henry then reads the letter that accompanied the currency. The letter states that the banknote is lent to him for one month and that, if he returns it intact, the brothers will arrange for him to have any job it is within their power to give him. After almost losing the banknote during a chase down a windy street, Henry finds himself outside an elegant tailor's shop and tries to buy a ready-made suit. When the proprietor learns about the million pound note, he, too, imagines that Henry is exceedingly wealthy and provides him with an entire wardrobe on credit and also arranges for him to stay at an exclusive hotel. The hotel manager even ousts a longtime resident, the Duke of Frognal, whose bill is in arrears, from his suite in order to accommodate the odd, American millionaire. Just before Henry arrives at the hotel, the commissionaire mistakes Rock, a mute, circus strongman, for Henry. Upon arriving at the hotel, Henry insists that Rock not be ejected and hires him as a bodyguard and companion. Newspaper articles report the presence of the American with the million pound note and soon Henry and Rock are fashionable men-about-town. Henry is even invited to the American consulate, where he had previously been denied assistance, and the ambassador gives him one hundred pounds and arranges to have him introduced in local society circles. At a reception hosted by the Duchess of Cromarty, Henry meets her niece, Portia Lansdowne, who flirts with him and persuades him to attend an event related to her aunt's favorite charity, the Home for Motherless Babies. At the event, Henry unintentionally bids five thousand pounds in a silent auction and is later inundated with requests from many other charities. Later, when Henry tries to explain to Portia that he is not what he seems to be, she thinks that he is telling her that he is in love with her and they embrace. Meanwhile, the ambassador has introduced Henry to fellow American Lloyd Hastings, who knew Henry's father, and is in dire need of additional capital for an investment he has made in a gold mine. After Henry agrees to let Lloyd use his name in order to raise money, the price for the gold stocks rises very rapidly. Just after Henry has convinced Portia that he is broke, Lloyd interrupts them with the news that Henry has just gained sixteen thousand pounds from the stock he bought in his name. Confused by Henry's financial status and thinking that he is testing the depth of her love, Portia breaks up with him. In the meantime, the Duke of Frognal pays off his hotel bill, but is not permitted to return to his suite. Enraged at being inconvenienced by an American, the duke arranges to have the banknote stolen and hidden, then spreads a rumor that the note no longer exists. After a newspaper reports the story, numerous creditors descend upon Henry and the duchess and her friends regard him as an imposter. Henry swears that he will pay all his bills from his stock earnings, but discovers that the rumor has caused the shares to become worthless. In the hotel's packed lobby, Henry issues an impassioned plea to the stockholders to hold on to their stock for a few days more, but many remain unconvinced. Realizing that his joke has gone far enough, the duke returns the note to Henry just as Portia rushes to his side. Later, after the shares have stabilized and Henry has earned twenty thousand pounds on the stock exchange, he and Portia return the intact banknote to the Montpeliers. Portia tells them that, rich or poor, she is in love with Henry. While the brothers begin to squabble over the role the banknote played in the romance, Henry and Portia drive off in a horse-drawn carriage, with Rock as their coachman.
Sound: Mono (Western Electric Sound System) Production Co: Group Film Productions, Ltd., J. Arthur Rank Organisation, Ltd.


It's time! The beta program for Android 8.0 Oreo on the Galaxy S8 and Galaxy S8+ should now be live for users in the UK, and you can hop into the Samsung Members app on your phone to enroll. You should see a notice about the beta's availability in some point; just make sure you have a Samsung account logged in to on your phone, as there are limited slots only 5,000 slots and creating an account will take a couple of minutes.
There's a lot on Android 8.0 Oreo for the Galaxy S8 and S8+; the official changelog lists all the major ones, and we will be taking a closer look at the new features and changes. If you reside in the UK (and have an unlocked Galaxy S8 or S8+ purchased in the country), check out how you can register for the beta. We will have more detailed signup instructions shortly, but for now, keep an eye at the Samsung Members app to make sure you don't miss out on the chance to enroll.
The beta will also go live today in the US and South Korea. The second phase will see it extended to Germany, Spain, France, Poland, China and India, but there's no word yet on when the second phase will start. We're guessing it will coincide with the release of the first update to the beta firmware, but we will have to wait and see.
Got access to the beta? Let us know in the comments if you did!
don't do it pain in the arse cannot go back when u reset back to 7 even after u unreg beta it updates again nightmare of a beta system opt out is not working.
beta is not also foor xeu?
I don't even have the notification or the option to register. ??
My phone after update is much faster than before! Very smooth, no crashes, no errors, no bugs. Everything is working properly.
registered few minutes ago ?
Registered 3 hours ago still no update. Had to wipe my phone last night just to get back to the XEU CSC ????
A word of warning. (I didn't do it myself just noticed before I clicked it) After installing beta on the phone itself it tells you your software is up to date, but on Smart Switch on your PC it will tell you there is an update available. This is actually reverting you back to Nougat and the firmware you had before so don't think there is an update and actually install it.
Is it stable? Have you notices any issues so far?
I've lost WiFi Calling which I really needed at work other then that it is ok so far.
I had H3G firmware with the Wi-Fi calling option. You don't need the 3 in touch app anymore with certain phones.
That is strange, I GAINED the Wi-Fi calling option in my notification bar, and the system notification in the top right corner with the battery etc.
That is strange. Am I missing something.
Can you open phone app 3 dots settings and scroll down.
Is the Wi-Fi calling option there?
Yes, also, I am on O2 and Wifi Calling is in the Notification bar now as well as in the phone settings. at the very bottom.
We'll do that once we've played with it for a couple of days! We only just got it today, so fret not, we'll let you know!
If you managed to register then you should get it. From past experience it can take a little while sometimes.
Anyone knows if the G955FD version will get the beta program? I got the S8+ duos and the United Kingdom G955FXXU1AQH3 XEU firmware but still no news in the notices section of the Samsung members app.
I am on the same f/w on my 8+ however I assume they check the model number of course and have no idea if the Duos is on the list or not. However you are in the best position if it is as looking below XEU seems to have had the best results. The exact same f/w worked for me.
Still nothing. I think the S8+ duos won't get it.
If i flash the original firmware of my S8+ G955FD to the s8+ G955F, it will work fine? I've been reading about this and it seems it works fine. What do you think?
I registered like a 10mins ago and now my update is downloading.
Hopefully all the places have not gone yet. Keep trying! Fingers crossed for you!
Managed to register. I am on XEU and 02.


Many creatures will attempt to make their home in a house. Sharing a home with pests isn't in anyone's best interest. This article will be useful when you have to get rid of them.
Plug holes that pests, like mice, can enter using steel wool. While rats and mice can chew through them, the thin metal strands are too tough to chew. Any opening bigger than half an inch should be plugged. Remember that rodents can get through very tiny openings.
Are you getting fruit flies even after you've eliminated them? Your drain may be the issue. For some days, tape plastic wrap over your drain and find out whether fruit flies start appearing. If you find some, pour a little boiling water down the drain and then scrub it well. This should prevent fruit flies from making a nest in your drain.
Use some hairspray to get rid of wasps, bees or hornets. These types of sprays are filled with chemical additives that can eliminate bugs on the spot, while keeping additional ones from arriving.
If you have seen a lot of brown recluse spiders, get some sticky traps. These harmful spiders spend their time in hard to reach areas that are not easily accessible for chemicals. At night, they come out of their hiding spots so they can search for food. Good places to put these traps are behind furniture and along baseboards.
If pests and bugs are driving you to distraction, help may be at hand. See a home improvement store nearby to ask the pros in there how to get rid of pests. The staff can recommend a pesticide or other product that you can use to get rid of your pests.
Check every foot of your home for pests, as no area is immune. Any part of the dwelling that is underground could be affected by subterranean termites. Give your crawl space and basement a look over.
If all else fails, you can turn to an electronic device to get rid of pests. The quiet buzzing emitted by these devices plugged into outlets in each room repels rodents. You might be able to hear these repellents, but they are not dangerous for humans and pets. Rodents dislike the noise a lot, and won't stay near it.
Getting unwanted pests out of your home is rather hard, but if you know the right solution to this problem, it should not be that difficult to begin the process. This will take some effort from your end, of course. Clean up your home's pest problems using the techniques that have been described.


Cali. hot brunete willing to make your dreams come true. your place or mine!
It's with a deeply shared respect that the gathered family, friends, and artists on Forever Words have completed Johnny Cash's newly found poetry and lyrics into well-crafted collaborations. Shopbop Designer Fashion Brands. Find showtimes, watch trailers, browse photos, track your Watchlist and rate your favorite movies and TV shows on your phone or tablet! Informizely customer feedback surveys. Edit Did You Know? If you're a Spike Fan, than jump aboard, you'll feel much at home.