text:
"""Support for interfacing with the XBMC/Kodi JSON-RPC API."""
from collections import OrderedDict
from functools import wraps
import logging
import re
import socket
import urllib

import aiohttp
import jsonrpc_async
import jsonrpc_base
import jsonrpc_websocket
import voluptuous as vol

from homeassistant.components.kodi import SERVICE_CALL_METHOD
from homeassistant.components.kodi.const import DOMAIN
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from homeassistant.components.media_player.const import (
    MEDIA_TYPE_CHANNEL,
    MEDIA_TYPE_MOVIE,
    MEDIA_TYPE_MUSIC,
    MEDIA_TYPE_PLAYLIST,
    MEDIA_TYPE_TVSHOW,
    MEDIA_TYPE_VIDEO,
    SUPPORT_NEXT_TRACK,
    SUPPORT_PAUSE,
    SUPPORT_PLAY,
    SUPPORT_PLAY_MEDIA,
    SUPPORT_PREVIOUS_TRACK,
    SUPPORT_SEEK,
    SUPPORT_SHUFFLE_SET,
    SUPPORT_STOP,
    SUPPORT_TURN_OFF,
    SUPPORT_TURN_ON,
    SUPPORT_VOLUME_MUTE,
    SUPPORT_VOLUME_SET,
    SUPPORT_VOLUME_STEP,
)
from homeassistant.const import (
    CONF_HOST,
    CONF_NAME,
    CONF_PASSWORD,
    CONF_PORT,
    CONF_PROXY_SSL,
    CONF_TIMEOUT,
    CONF_USERNAME,
    EVENT_HOMEASSISTANT_STOP,
    STATE_IDLE,
    STATE_OFF,
    STATE_PAUSED,
    STATE_PLAYING,
)
from homeassistant.core import callback
from homeassistant.helpers import config_validation as cv, script
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.template import Template
import homeassistant.util.dt as dt_util
from homeassistant.util.yaml import dump

_LOGGER = logging.getLogger(__name__)

EVENT_KODI_CALL_METHOD_RESULT = "kodi_call_method_result"

CONF_TCP_PORT = "tcp_port"
CONF_TURN_ON_ACTION = "turn_on_action"
CONF_TURN_OFF_ACTION = "turn_off_action"
CONF_ENABLE_WEBSOCKET = "enable_websocket"

DEFAULT_NAME = "Kodi"
DEFAULT_PORT = 8080
DEFAULT_TCP_PORT = 9090
DEFAULT_TIMEOUT = 5
DEFAULT_PROXY_SSL = False
DEFAULT_ENABLE_WEBSOCKET = True

DEPRECATED_TURN_OFF_ACTIONS = {
    None: None,
    "quit": "Application.Quit",
    "hibernate": "System.Hibernate",
    "suspend": "System.Suspend",
    "reboot": "System.Reboot",
    "shutdown": "System.Shutdown",
}

# https://github.com/xbmc/xbmc/blob/master/xbmc/media/MediaType.h
MEDIA_TYPES = {
    "music": MEDIA_TYPE_MUSIC,
    "artist": MEDIA_TYPE_MUSIC,
    "album": MEDIA_TYPE_MUSIC,
    "song": MEDIA_TYPE_MUSIC,
    "video": MEDIA_TYPE_VIDEO,
    "set": MEDIA_TYPE_PLAYLIST,
    "musicvideo": MEDIA_TYPE_VIDEO,
    "movie": MEDIA_TYPE_MOVIE,
    "tvshow": MEDIA_TYPE_TVSHOW,
    "season": MEDIA_TYPE_TVSHOW,
    "episode": MEDIA_TYPE_TVSHOW,
    # Type 'channel' is used for radio or tv streams from pvr
    "channel": MEDIA_TYPE_CHANNEL,
    # Type 'audio' is used for audio media, that Kodi couldn't scroblle
    "audio": MEDIA_TYPE_MUSIC,
}

SUPPORT_KODI = (
    SUPPORT_PAUSE
    | SUPPORT_VOLUME_SET
    | SUPPORT_VOLUME_MUTE
    | SUPPORT_PREVIOUS_TRACK
    | SUPPORT_NEXT_TRACK
    | SUPPORT_SEEK
    | SUPPORT_PLAY_MEDIA
    | SUPPORT_STOP
    | SUPPORT_SHUFFLE_SET
    | SUPPORT_PLAY
    | SUPPORT_VOLUME_STEP
)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
    {
        vol.Required(CONF_HOST): cv.string,
        vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
        vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
        vol.Optional(CONF_TCP_PORT, default=DEFAULT_TCP_PORT): cv.port,
        vol.Optional(CONF_PROXY_SSL, default=DEFAULT_PROXY_SSL): cv.boolean,
        vol.Optional(CONF_TURN_ON_ACTION): cv.SCRIPT_SCHEMA,
        vol.Optional(CONF_TURN_OFF_ACTION): vol.Any(
            cv.SCRIPT_SCHEMA, vol.In(DEPRECATED_TURN_OFF_ACTIONS)
        ),
        vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int,
        vol.Inclusive(CONF_USERNAME, "auth"): cv.string,
        vol.Inclusive(CONF_PASSWORD, "auth"): cv.string,
        vol.Optional(
            CONF_ENABLE_WEBSOCKET, default=DEFAULT_ENABLE_WEBSOCKET
        ): cv.boolean,
    }
)

def _check_deprecated_turn_off(hass, turn_off_action):
    """Create an equivalent script for old turn off actions."""
    if isinstance(turn_off_action, str):
        method = DEPRECATED_TURN_OFF_ACTIONS[turn_off_action]
        new_config = OrderedDict(
            [
                ("service", f"{DOMAIN}.{SERVICE_CALL_METHOD}"),
                (
                    "data_template",
                    OrderedDict([("entity_id", "{{ entity_id }}"), ("method", method)]),
                ),
            ]
        )
        example_conf = dump(OrderedDict([(CONF_TURN_OFF_ACTION, new_config)]))
        _LOGGER.warning(
            "The '%s' action for turn off Kodi is deprecated and "
            "will cease to function in a future release. You need to "
            "change it for a generic Home Assistant script sequence, "
            "which is, for this turn_off action, like this:\n%s",
            turn_off_action,
            example_conf,
        )
        new_config["data_template"] = OrderedDict(
            [
                (key, Template(value, hass))
                for key, value in new_config["data_template"].items()
            ]
        )
        turn_off_action = [new_config]
    return turn_off_action

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    """Set up the Kodi platform."""
    if DOMAIN not in hass.data:
        hass.data[DOMAIN] = {}

    unique_id = None
    # Is this a manual configuration?
    if discovery_info is None:
        name = config.get(CONF_NAME)
        host = config.get(CONF_HOST)
        port = config.get(CONF_PORT)
        tcp_port = config.get(CONF_TCP_PORT)
        encryption = config.get(CONF_PROXY_SSL)
        websocket = config.get(CONF_ENABLE_WEBSOCKET)
    else:
        name = f"{DEFAULT_NAME} ({discovery_info.get('hostname')})"
        host = discovery_info.get("host")
        port = discovery_info.get("port")
        tcp_port = DEFAULT_TCP_PORT
        encryption = DEFAULT_PROXY_SSL
        websocket = DEFAULT_ENABLE_WEBSOCKET
        properties = discovery_info.get("properties")
        if properties is not None:
            unique_id = properties.get("uuid", None)

    # Only add a device once, so discovered devices do not override manual
    # config.
    ip_addr = socket.gethostbyname(host)
    if ip_addr in hass.data[DOMAIN]:
        return

    # If we got an unique id, check that it does not exist already.
    # This is necessary as netdisco does not deterministally return the same
    # advertisement when the service is offered over multiple IP addresses.
    if unique_id is not None:
        for device in hass.data[DOMAIN].values():
            if device.unique_id == unique_id:
                return

    entity = KodiDevice(
        hass,
        name=name,
        host=host,
        port=port,
        tcp_port=tcp_port,
        encryption=encryption,
        username=config.get(CONF_USERNAME),
        password=config.get(CONF_PASSWORD),
        turn_on_action=config.get(CONF_TURN_ON_ACTION),
        turn_off_action=config.get(CONF_TURN_OFF_ACTION),
        timeout=config.get(CONF_TIMEOUT),
        websocket=websocket,
        unique_id=unique_id,
    )

    hass.data[DOMAIN][ip_addr] = entity
    async_add_entities([entity], update_before_add=True)

def cmd(func):
    """Catch command exceptions."""

    @wraps(func)
    async def wrapper(obj, *args, **kwargs):
        """Wrap all command methods."""
        try:
            await func(obj, *args, **kwargs)
        except jsonrpc_base.jsonrpc.TransportError as exc:
            # If Kodi is off, we expect calls to fail.
            if obj.state == STATE_OFF:
                log_function = _LOGGER.info
            else:
                log_function = _LOGGER.error
            log_function(
                "Error calling %s on entity %s: %r", func.__name__, obj.entity_id, exc
            )

    return wrapper

class KodiDevice(MediaPlayerEntity):
    """Representation of a XBMC/Kodi device."""

    def __init__(
        self,
        hass,
        name,
        host,
        port,
        tcp_port,
        encryption=False,
        username=None,
        password=None,
        turn_on_action=None,
        turn_off_action=None,
        timeout=DEFAULT_TIMEOUT,
        websocket=True,
        unique_id=None,
    ):
        """Initialize the Kodi device."""
        self.hass = hass
        self._name = name
        self._unique_id = unique_id
        self._media_position_updated_at = None
        self._media_position = None

        kwargs = {"timeout": timeout, "session": async_get_clientsession(hass)}

        if username is not None:
            kwargs["auth"] = aiohttp.BasicAuth(username, password)
            image_auth_string = f"{username}:{password}@"
        else:
            image_auth_string = ""

        http_protocol = "https" if encryption else "http"
        ws_protocol = "wss" if encryption else "ws"

        self._http_url = f"{http_protocol}://{host}:{port}/jsonrpc"
        self._image_url = f"{http_protocol}://{image_auth_string}{host}:{port}/image"
        self._ws_url = f"{ws_protocol}://{host}:{tcp_port}/jsonrpc"

        self._http_server = jsonrpc_async.Server(self._http_url, **kwargs)
        if websocket:
            # Setup websocket connection
            self._ws_server = jsonrpc_websocket.Server(self._ws_url, **kwargs)

            # Register notification listeners
            self._ws_server.Player.OnPause = self.async_on_speed_event
            self._ws_server.Player.OnPlay = self.async_on_speed_event
            self._ws_server.Player.OnAVStart = self.async_on_speed_event
            self._ws_server.Player.OnAVChange = self.async_on_speed_event
            self._ws_server.Player.OnResume = self.async_on_speed_event
            self._ws_server.Player.OnSpeedChanged = self.async_on_speed_event
            self._ws_server.Player.OnSeek = self.async_on_speed_event
            self._ws_server.Player.OnStop = self.async_on_stop
            self._ws_server.Application.OnVolumeChanged = self.async_on_volume_changed
            self._ws_server.System.OnQuit = self.async_on_quit
            self._ws_server.System.OnRestart = self.async_on_quit
            self._ws_server.System.OnSleep = self.async_on_quit

            def on_hass_stop(event):
                """Close websocket connection when hass stops."""
                self.hass.async_create_task(self._ws_server.close())

            self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop)
        else:
            self._ws_server = None

        # Script creation for the turn on/off config options
        if turn_on_action is not None:
            turn_on_action = script.Script(
                self.hass,
                turn_on_action,
                f"{self.name} turn ON script",
                self.async_update_ha_state(True),
            )
        if turn_off_action is not None:
            turn_off_action = script.Script(
                self.hass,
                _check_deprecated_turn_off(hass, turn_off_action),
                f"{self.name} turn OFF script",
            )
        self._turn_on_action = turn_on_action
        self._turn_off_action = turn_off_action
        self._enable_websocket = websocket
        self._players = []
        self._properties = {}
        self._item = {}
        self._app_properties = {}

    @callback
    def async_on_speed_event(self, sender, data):
        """Handle player changes between playing and paused."""
        self._properties["speed"] = data["player"]["speed"]

        if not hasattr(data["item"], "id"):
            # If no item id is given, perform a full update
            force_refresh = True
        else:
            # If a new item is playing, force a complete refresh
            force_refresh = data["item"]["id"] != self._item.get("id")

        self.async_schedule_update_ha_state(force_refresh)

    @callback
    def async_on_stop(self, sender, data):
        """Handle the stop of the player playback."""
        # Prevent stop notifications which are sent after quit notification
        if self._players is None:
            return

        self._players = []
        self._properties = {}
        self._item = {}
        self._media_position_updated_at = None
        self._media_position = None
        self.async_write_ha_state()

    @callback
    def async_on_volume_changed(self, sender, data):
        """Handle the volume changes."""
        self._app_properties["volume"] = data["volume"]
        self._app_properties["muted"] = data["muted"]
        self.async_write_ha_state()

    @callback
    def async_on_quit(self, sender, data):
        """Reset the player state on quit action."""
        self._players = None
        self._properties = {}
        self._item = {}
        self._app_properties = {}
        self.hass.async_create_task(self._ws_server.close())

    async def _get_players(self):
        """Return the active player objects or None."""
        try:
            return await self.server.Player.GetActivePlayers()
        except jsonrpc_base.jsonrpc.TransportError:
            if self._players is not None:
                _LOGGER.info("Unable to fetch kodi data")
                _LOGGER.debug("Unable to fetch kodi data", exc_info=True)
            return None

    @property
    def unique_id(self):
        """Return the unique id of the device."""
        return self._unique_id

    @property
    def state(self):
        """Return the state of the device."""
        if self._players is None:
            return STATE_OFF

        if not self._players:
            return STATE_IDLE

        if self._properties["speed"] == 0:
            return STATE_PAUSED

        return STATE_PLAYING

    async def async_ws_connect(self):
        """Connect to Kodi via websocket protocol."""
        try:
            ws_loop_future = await self._ws_server.ws_connect()
        except jsonrpc_base.jsonrpc.TransportError:
            _LOGGER.info("Unable to connect to Kodi via websocket")
            _LOGGER.debug("Unable to connect to Kodi via websocket", exc_info=True)
            return

        async def ws_loop_wrapper():
            """Catch exceptions from the websocket loop task."""
            try:
                await ws_loop_future
            except jsonrpc_base.TransportError:
                # Kodi abruptly ends ws connection when exiting. We will try
                # to reconnect on the next poll.
                pass
            # Update HA state after Kodi disconnects
            self.async_write_ha_state()

        # Create a task instead of adding a tracking job, since this task will
        # run until the websocket connection is closed.
        self.hass.loop.create_task(ws_loop_wrapper())

    async def async_update(self):
        """Retrieve latest state."""
        self._players = await self._get_players()

        if self._players is None:
            self._properties = {}
            self._item = {}
            self._app_properties = {}
            return

        if self._enable_websocket and not self._ws_server.connected:
            self.hass.async_create_task(self.async_ws_connect())

        self._app_properties = await self.server.Application.GetProperties(
            ["volume", "muted"]
        )

        if self._players:
            player_id = self._players[0]["playerid"]

            assert isinstance(player_id, int)

            self._properties = await self.server.Player.GetProperties(
                player_id, ["time", "totaltime", "speed", "live"]
            )

            position = self._properties["time"]
            if self._media_position != position:
                self._media_position_updated_at = dt_util.utcnow()
                self._media_position = position

            self._item = (
                await self.server.Player.GetItem(
                    player_id,
                    [
                        "title",
                        "file",
                        "uniqueid",
                        "thumbnail",
                        "artist",
                        "albumartist",
                        "showtitle",
                        "album",
                        "season",
                        "episode",
                    ],
                )
            )["item"]
        else:
            self._properties = {}
            self._item = {}
            self._app_properties = {}
            self._media_position = None
            self._media_position_updated_at = None

    @property
    def server(self):
        """Active server for json-rpc requests."""
        if self._enable_websocket and self._ws_server.connected:
            return self._ws_server

        return self._http_server

    @property
    def name(self):
        """Return the name of the device."""
        return self._name

    @property
    def should_poll(self):
        """Return True if entity has to be polled for state."""
        return not (self._enable_websocket and self._ws_server.connected)

    @property
    def volume_level(self):
        """Volume level of the media player (0..1)."""
        if "volume" in self._app_properties:
            return self._app_properties["volume"] / 100.0

    @property
    def is_volume_muted(self):
        """Boolean if volume is currently muted."""
        return self._app_properties.get("muted")

    @property
    def media_content_id(self):
        """Content ID of current playing media."""
        return self._item.get("uniqueid", None)

    @property
    def media_content_type(self):
        """Content type of current playing media.

        If the media type cannot be detected, the player type is used.
        """
        item_type = MEDIA_TYPES.get(self._item.get("type"))
        if (item_type is None or item_type == "channel") and self._players:
            return MEDIA_TYPES.get(self._players[0]["type"])
        return item_type

    @property
    def media_duration(self):
        """Duration of current playing media in seconds."""
        if self._properties.get("live"):
            return None

        total_time = self._properties.get("totaltime")

        if total_time is None:
            return None

        return (
            total_time["hours"] * 3600
            + total_time["minutes"] * 60
            + total_time["seconds"]
        )

    @property
    def media_position(self):
        """Position of current playing media in seconds."""
        time = self._properties.get("time")

        if time is None:
            return None

        return time["hours"] * 3600 + time["minutes"] * 60 + time["seconds"]

    @property
    def media_position_updated_at(self):
        """Last valid time of media position."""
        return self._media_position_updated_at

    @property
    def media_image_url(self):
        """Image url of current playing media."""
        thumbnail = self._item.get("thumbnail")
        if thumbnail is None:
            return None

        url_components = urllib.parse.urlparse(thumbnail)
        if url_components.scheme == "image":
            return f"{self._image_url}/{urllib.parse.quote_plus(thumbnail)}"

    @property
    def media_title(self):
        """Title of current playing media."""
        # find a string we can use as a title
        item = self._item
        return item.get("title") or item.get("label") or item.get("file")

    @property
    def media_series_title(self):
        """Title of series of current playing media, TV show only."""
        return self._item.get("showtitle")

    @property
    def media_season(self):
        """Season of current playing media, TV show only."""
        return self._item.get("season")

    @property
    def media_episode(self):
        """Episode of current playing media, TV show only."""
        return self._item.get("episode")

    @property
    def media_album_name(self):
        """Album name of current playing media, music track only."""
        return self._item.get("album")

    @property
    def media_artist(self):
        """Artist of current playing media, music track only."""
        artists = self._item.get("artist", [])
        if artists:
            return artists[0]

        return None

    @property
    def media_album_artist(self):
        """Album artist of current playing media, music track only."""
        artists = self._item.get("albumartist", [])
        if artists:
            return artists[0]

        return None

    @property
    def supported_features(self):
        """Flag media player features that are supported."""
        supported_features = SUPPORT_KODI

        if self._turn_on_action is not None:
            supported_features |= SUPPORT_TURN_ON

        if self._turn_off_action is not None:
            supported_features |= SUPPORT_TURN_OFF

        return supported_features

    @cmd
    async def async_turn_on(self):
        """Execute turn_on_action to turn on media player."""
        if self._turn_on_action is not None:
            await self._turn_on_action.async_run(
                variables={"entity_id": self.entity_id}
            )
        else:
            _LOGGER.warning("turn_on requested but turn_on_action is none")

    @cmd
    async def async_turn_off(self):
        """Execute turn_off_action to turn off media player."""
        if self._turn_off_action is not None:
            await self._turn_off_action.async_run(
                variables={"entity_id": self.entity_id}
            )
        else:
            _LOGGER.warning("turn_off requested but turn_off_action is none")

    @cmd
    async def async_volume_up(self):
        """Volume up the media player."""
        assert (await self.server.Input.ExecuteAction("volumeup")) == "OK"

    @cmd
    async def async_volume_down(self):
        """Volume down the media player."""
        assert (await self.server.Input.ExecuteAction("volumedown")) == "OK"

    @cmd
    async def async_set_volume_level(self, volume):
        """Set volume level, range 0..1."""
        await self.server.Application.SetVolume(int(volume * 100))

    @cmd
    async def async_mute_volume(self, mute):
        """Mute (true) or unmute (false) media player."""
        await self.server.Application.SetMute(mute)

    async def async_set_play_state(self, state):
        """Handle play/pause/toggle."""
        players = await self._get_players()

        if players is not None and players:
            await self.server.Player.PlayPause(players[0]["playerid"], state)

    @cmd
    async def async_media_play_pause(self):
        """Pause media on media player."""
        await self.async_set_play_state("toggle")

    @cmd
    async def async_media_play(self):
        """Play media."""
        await self.async_set_play_state(True)

    @cmd
    async def async_media_pause(self):
        """Pause the media player."""
        await self.async_set_play_state(False)

    @cmd
    async def async_media_stop(self):
        """Stop the media player."""
        players = await self._get_players()

        if players:
            await self.server.Player.Stop(players[0]["playerid"])

    async def _goto(self, direction):
        """Handle for previous/next track."""
        players = await self._get_players()

        if players:
            if direction == "previous":
                # First seek to position 0. Kodi goes to the beginning of the
                # current track if the current track is not at the beginning.
                await self.server.Player.Seek(players[0]["playerid"], 0)

            await self.server.Player.GoTo(players[0]["playerid"], direction)

    @cmd
    async def async_media_next_track(self):
        """Send next track command."""
        await self._goto("next")

    @cmd
    async def async_media_previous_track(self):
        """Send next track command."""
        await self._goto("previous")

    @cmd
    async def async_media_seek(self, position):
        """Send seek command."""
        players = await self._get_players()

        time = {}

        time["milliseconds"] = int((position % 1) * 1000)
        position = int(position)

        time["seconds"] = int(position % 60)
        position /= 60

        time["minutes"] = int(position % 60)
        position /= 60

        time["hours"] = int(position)

        if players:
            await self.server.Player.Seek(players[0]["playerid"], time)

    @cmd
    async def async_play_media(self, media_type, media_id, **kwargs):
        """Send the play_media command to the media player."""
        if media_type == "CHANNEL":
            await self.server.Player.Open({"item": {"channelid": int(media_id)}})
        elif media_type == "PLAYLIST":
            await self.server.Player.Open({"item": {"playlistid": int(media_id)}})
        elif media_type == "DIRECTORY":
            await self.server.Player.Open({"item": {"directory": str(media_id)}})
        elif media_type == "PLUGIN":
            await self.server.Player.Open({"item": {"file": str(media_id)}})
        else:
            await self.server.Player.Open({"item": {"file": str(media_id)}})

    async def async_set_shuffle(self, shuffle):
        """Set shuffle mode, for the first player."""
        if not self._players:
            raise RuntimeError("Error: No active player.")
        await self.server.Player.SetShuffle(
            {"playerid": self._players[0]["playerid"], "shuffle": shuffle}
        )

    async def async_call_method(self, method, **kwargs):
        """Run Kodi JSONRPC API method with params."""
        _LOGGER.debug("Run API method %s, kwargs=%s", method, kwargs)
        result_ok = False
        try:
            result = await getattr(self.server, method)(**kwargs)
            result_ok = True
        except jsonrpc_base.jsonrpc.ProtocolError as exc:
            result = exc.args[2]["error"]
            _LOGGER.error(
                "Run API method %s.%s(%s) error: %s",
                self.entity_id,
                method,
                kwargs,
                result,
            )
        except jsonrpc_base.jsonrpc.TransportError:
            result = None
            _LOGGER.warning(
                "TransportError trying to run API method %s.%s(%s)",
                self.entity_id,
                method,
                kwargs,
            )

        if isinstance(result, dict):
            event_data = {
                "entity_id": self.entity_id,
                "result": result,
                "result_ok": result_ok,
                "input": {"method": method, "params": kwargs},
            }
            _LOGGER.debug("EVENT kodi_call_method_result: %s", event_data)
            self.hass.bus.async_fire(
                EVENT_KODI_CALL_METHOD_RESULT, event_data=event_data
            )
        return result

    async def async_add_media_to_playlist(
        self, media_type, media_id=None, media_name="ALL", artist_name=""
    ):
        """Add a media to default playlist (i.e. playlistid=0).

        First the media type must be selected, then
        the media can be specified in terms of id or
        name and optionally artist name.
        All the albums of an artist can be added with
        media_name="ALL"
        """
        params = {"playlistid": 0}
        if media_type == "SONG":
            if media_id is None:
                media_id = await self.async_find_song(media_name, artist_name)
            if media_id:
                params["item"] = {"songid": int(media_id)}

        elif media_type == "ALBUM":
            if media_id is None:
                if media_name == "ALL":
                    await self.async_add_all_albums(artist_name)
                    return

                media_id = await self.async_find_album(media_name, artist_name)
            if media_id:
                params["item"] = {"albumid": int(media_id)}

        else:
            raise RuntimeError("Unrecognized media type.")

        if media_id is not None:
            try:
                await self.server.Playlist.Add(params)
            except jsonrpc_base.jsonrpc.ProtocolError as exc:
                result = exc.args[2]["error"]
                _LOGGER.error(
                    "Run API method %s.Playlist.Add(%s) error: %s",
                    self.entity_id,
                    media_type,
                    result,
                )
            except jsonrpc_base.jsonrpc.TransportError:
                _LOGGER.warning(
                    "TransportError trying to add playlist to %s", self.entity_id
                )
        else:
            _LOGGER.warning("No media detected for Playlist.Add")

    async def async_add_all_albums(self, artist_name):
        """Add all albums of an artist to default playlist (i.e. playlistid=0).

        The artist is specified in terms of name.
        """
        artist_id = await self.async_find_artist(artist_name)

        albums = await self.async_get_albums(artist_id)

        for alb in albums["albums"]:
            await self.server.Playlist.Add(
                {"playlistid": 0, "item": {"albumid": int(alb["albumid"])}}
            )

    async def async_clear_playlist(self):
        """Clear default playlist (i.e. playlistid=0)."""
        return self.server.Playlist.Clear({"playlistid": 0})

    async def async_get_artists(self):
        """Get artists list."""
        return await self.server.AudioLibrary.GetArtists()

    async def async_get_albums(self, artist_id=None):
        """Get albums list."""
        if artist_id is None:
            return await self.server.AudioLibrary.GetAlbums()

        return await self.server.AudioLibrary.GetAlbums(
            {"filter": {"artistid": int(artist_id)}}
        )

    async def async_find_artist(self, artist_name):
        """Find artist by name."""
        artists = await self.async_get_artists()
        try:
            out = self._find(artist_name, [a["artist"] for a in artists["artists"]])
            return artists["artists"][out[0][0]]["artistid"]
        except KeyError:
            _LOGGER.warning("No artists were found: %s", artist_name)
            return None

    async def async_get_songs(self, artist_id=None):
        """Get songs list."""
        if artist_id is None:
            return await self.server.AudioLibrary.GetSongs()

        return await self.server.AudioLibrary.GetSongs(
            {"filter": {"artistid": int(artist_id)}}
        )

    async def async_find_song(self, song_name, artist_name=""):
        """Find song by name and optionally artist name."""
        artist_id = None
        if artist_name != "":
            artist_id = await self.async_find_artist(artist_name)

        songs = await self.async_get_songs(artist_id)
        if songs["limits"]["total"] == 0:
            return None

        out = self._find(song_name, [a["label"] for a in songs["songs"]])
        return songs["songs"][out[0][0]]["songid"]

    async def async_find_album(self, album_name, artist_name=""):
        """Find album by name and optionally artist name."""
        artist_id = None
        if artist_name != "":
            artist_id = await self.async_find_artist(artist_name)

        albums = await self.async_get_albums(artist_id)
        try:
            out = self._find(album_name, [a["label"] for a in albums["albums"]])
            return albums["albums"][out[0][0]]["albumid"]
        except KeyError:
            _LOGGER.warning(
                "No albums were found with artist: %s, album: %s",
                artist_name,
                album_name,
            )
            return None

    @staticmethod
    def _find(key_word, words):
        key_word = key_word.split(" ")
        patt = [re.compile(f"(^| ){k}( |$)", re.IGNORECASE) for k in key_word]

        out = [[i, 0] for i in range(len(words))]
        for i in range(len(words)):
            mtc = [p.search(words[i]) for p in patt]
            rate = [m is not None for m in mtc].count(True)
            out[i][1] = rate

        return sorted(out, key=lambda out: out[1], reverse=True)


Commissioner Hayne has proposed the joint administration and extension of the BEAR after his 11-month inquiry into misconduct in the finance sector.
In the final report for the Royal Commission into Misconduct in the Banking, Superannuation and Financial Services Industry, which was handed to the Governor-General on Friday (1 February) and publicly released on Monday (4 February), Commissioner Kenneth Hayne addressed weaknesses in the Banking Executive Accountability Regime (BEAR).
The regime, which came into effect for the big four banks on 1 July 2018 and will come into effect for other ADIs on 1 July 2019, serves as an accountability framework, imposing higher standards of behaviour on banks and their senior executives and directors.
Commissioner Hayne in his final report said the BEAR has "both a conduct and prudential outlook", and therefore recommended that the Australian Prudential Regulation Authority (APRA) and the Australian Securities and Investments Commission (ASIC) jointly administer the regime.
He added that the regime requires authorised deposit-taking institutions (ADI) and "accountable persons" to act with "honesty and integrity, and with due skill, care and diligence" while also requiring them to take "reasonable steps to prevent matters from arising that would adversely affect the ADI's prudential standing or prudential reputation and their actions".
The Commissioner suggested that ASIC be responsible for overseeing Divisions 1, 2 and 3 of the Banking Act that pertain to "consumer protection and market conduct matters", regulating and commencing civil penalty proceedings against contraventions of these divisions when it comes to conduct matters.
"So much is clear from the second reading speech, which emphasised that when community expectations are not met, appropriate consequences should follow for those accountable," he wrote in the final report.
"As a practical matter, ASIC must be able to deal with both breaches together," the commissioner noted.
Meanwhile, according to the financial services royal commission, APRA should be responsible for the prudential aspects of Part IIAA of the Banking Act, bringing civil penalty proceedings for violations of 37G to the extent it is related to prudential matters.
"It would be prudent to enable both ASIC and APRA to seek disqualification of accountable persons if they are satisfied that an accountable person has breached his or her accountability obligations, although I would expect that the power would ordinarily be exercised by APRA," the final report states.
The Commissioner suggested amendments to sections 37K and 37G(1) to enable joint administration.
While the Financial Sector Union called for the development of a financial services code with a three-tiered standards framework for all financial sector workers, which could extend the reach of the BEAR beyond ADIs and their senior executives and directors, Commissioner Hayne said the obligations under the regime do not need to be expanded as yet.
He did, however, suggest that amendments should be made to sections 37C and 37CA to "make clear that both ADIs and accountable persons must deal with ASIC in an open, constructive and cooperative way, as well as with APRA".
Further, according to Commissioner Hayne, provisions modelled on the BEAR should be extended to all APRA‑regulated financial services institutions, including licensed registrable superannuation entities and insurers.
But he noted that these changes should be made "sequentially" over time.
"There would be evident advantage in giving notice to all concerned of the general timetable that is proposed, but implementation will depend upon how the changes play out and satisfaction that the changes made are proving effective," the commissioner wrote.
The Commissioner also stressed the importance of information-sharing between the corporate and prudential regulators, warning that not doing so could result in further enforcement failings.
"The need for ASIC and APRA to co-regulate the BEAR means that the two regulators will have to work more closely than ever across a range of entities and subject matters," he wrote in the final report.
APRA chairman Wayne Byres mid-last year commented that the BEAR regime will not in isolation "remedy perceived weakness in financial sector accountability".
"We have encouraged all regulated entities — not just ADIs — to use the new regime as a trigger to genuinely improve systems of governance, responsibility and accountability," the chairman said.
Tickets are selling out - so make sure you secure your ticket today to stay ahead of the curve and prepare your business.


Mr. Brocious joined Navarro Lowrey, Inc. in January 2001 as a facilities and grounds manager. He has eleven years of training and experience in building, electrical, plumbing, HVAC and mechanical systems, as well as 16 years' experience with landscaping and irrigation maintenance. Mr. Brocious is primarily focused on the maintenance and operation of EcoPlex®, supervising tenant construction and building repairs, executing thermal comfort strategies on behalf of existing tenants, and performing general administration of vendor contracts in the field.


text:
Weedmaps Sponsored ∙ June 24, 2019 5:00 pm PDT |
The long and endlessly intriguing history of cannabis will come to life in the Weedmaps Museum of Weed, opening Aug. 3, 2019, in the heart of Hollywood, California.
The museum will immerse visitors in a series of interactive and informational exhibits that tell the story of the growers, stoners, and activists who expanded knowledge of the plant and kept the cannabis movement alive despite decades of government prohibition and propaganda.
Weedmaps, a leading technology company in the cannabis industry, is on a mission to subvert audience expectations of what a modern museum looks like by crafting an experience that emulates the dynamic characteristics of the plant itself and the company's vision of making cannabis legal, safe, and accessible for all. Here's everything you need to know about the Weedmaps Museum of Weed before you take in the journey.
Why a Weedmaps Museum of Weed?
In a nutshell, the Weedmaps Museum of Weed is here to tell the whole story of cannabis. As any person knowledgeable about weed can attest, the world's most notorious plant has gotten a pretty bad rap. A hundred years of propaganda, marked by fearmongering and devastating misinformation, have twisted our perceptions and relationship to cannabis. The Weedmaps Museum of Weed aims to undo the cultural damage of stigmatization and celebrate a future where the responsible consumption of legal, adult use cannabis becomes a reality.
🔥TICKETS ARE NOW AVAILABLE FOR THE WEEDMAPS #MUSEUMOFWEED!!🔥 Open to the public on August 3rd for a limited time. The experience builds on our long-standing commitment to combat stigma and to shed light on social justice issues surrounding #cannabis. pic.twitter.com/uRfqjTmdvS
— Weedmaps (@weedmaps) June 24, 2019
Weedmaps is uniquely positioned to present a groundbreaking, comprehensive cannabis exhibit to the public — having built one of the largest online communities of consumers, retailers, doctors, and brands since its founding in 2008. With a rich history of pioneering cannabis technology and supporting the weed community, Weedmaps is inviting the public to take part in its hard-earned understanding of cannabis through the museum experience.
"Despite increasing efforts to decriminalize cannabis, and overwhelming evidence about its benefits, stigma around weed continues to run deep," said Weedmaps CEO Chris Beals. "Through the Weedmaps Museum of Weed, we hope to provide visitors with a robust understanding of the highs and lows of cannabis history, and to create a stronger understanding of the importance of this plant and its potential."
The Weedmaps Museum of Weed will have its Grand Opening on Saturday, Aug. 3, 2019, and will be located on Melrose Avenue and Cahuenga Boulevard:
720 N Cahuenga Blvd
Weekly hours for the museum will be:
Wednesday-Thursday: 2-8:30pm
Friday: Noon-Midnight
Saturday: 11 a.m.-7 p.m.; VIP-only hours are Saturday 8 p.m.-Midnight
Sunday: Noon-7 p.m.
All guests must be at least 18 years old and have valid ID to enter. General admission is $35. VIP tickets available for guests 21 and older are $200. VIP nights offer an intimate, less crowded museum experience with amenities that include cafe access, drinks, hors d'oeuvres, and a curated gift bag to take home at the end of the night. Tickets are only available online.
The museum will be open for a limited time, closing Sept. 29, 2019.
What's in the Museum?
The 30,000-square-foot Hollywood location will house a museum experience inhabiting seven exhibits and a Plant Lab section. In the spirit of providing a fun, educational, and comprehensive journey through the history of cannabis, the museum will take visitors through exhibits that represent seven eras of cannabis:
The first stop of the tour will depict the early history and many uses of cannabis and hemp across centuries and continents. A chronological presentation of artifacts — including full-sized samurai armor, which utilized hemp, from the 1600s and a re-creation of the Betsy Ross flag handmade from hemp — will show the magnitude of the plant's deep-rooted cultural influence.
Age of Madness
Guests will wander through a funhouse of propaganda from the "Reefer Madness" era of the 1920s to the '50s to feel the full effect of how marijuana was used as a tool for oppression, control, and systemic racism. In addition to bold, colorful collages of era-specific propaganda, guests will get a chance to watch key scenes from films and read sensationalized anti-marijuana journalism of the time.
Counterculture Revolution
A world of color, culture, and art will envelop guests as they learn about the oppressed groups who organized and took to the streets in support of marijuana. A psychedelic rendering of the art, artists, and activists of the '60s will show how the counterculture revolution re-introduced the world to cannabis and placed it on the world stage.
After experiencing the bright, open Counterculture Revolution space, guests will come face-to-face with a return to hysteria in a small, somber setting. The birth of the war on drugs will be represented by the key figures on both sides of the fight for cannabis — President Richard Nixon and the DEA on one side, and the newly formed National Organization for the Reform of Marijuana Laws (NORML) on the other.
From "Behind Closed Doors," guests will be taken to another era fraught with authoritarian policies and systemic oppression, and learn how Reagan-era propaganda further twisted public perception of cannabis.
The Weedmaps Museum of Weed exhibit "Entrapment" shows how the counterculture revolution of the 1960s would fade to the war on drugs.
Dose of Compassion
Beginning in the 1990s, multiple movements re-energized and joined the cause for cannabis as medicine in the shadow of the HIV/AIDS epidemic. A "slice of life" exhibit will feature a fresh look back at '90s pop culture, when stoner culture found its way back into movies The exhibit will also immerse guests in the cultural and political upheaval that led to a robust fight for relief, including the LGBTQ activists who pioneered legal medical cannabis with California's Proposition 215, the first medical marijuana legalization measure passed in the U.S.
Emphasizing the call to celebrate our current cannabis era, this exhibit will provide an interactive review of recent legalization history through an interactive timeline and map detailing up-to-date legalization activity state by state.
Having experienced the whole story of cannabis firsthand, guests will now have the opportunity to experience the cutting edge and future of the cannabis plant, as told by science. After a foundational lesson in myth-busting facts and base cannabis knowledge, guests will learn about what sets strains apart, how cannabis interacts with the body, and much more.
Guests at the Weedmaps Museum of Weed will learn about the past, present, and future of the cannabis plant. The grand opening of the Weedmaps Museum of Weed in Hollywood, California, is scheduled for Saturday, Aug. 3, 2019, and continue through Sept. 29, 2019.
The Weedmaps Museum of Weed will feature a gift shop with an eclectic collection of custom apparel, cannabis trinkets, and celebratory pop culture goodies. And though there won't be any consumption or cannabis or CBD products sold onsite, the museum will be home to a full cafe catered by the award-winning Crateful Catering. Guests will also have the opportunity to join the cause by writing a letter to their congressperson in advocacy for ethical marijuana legislation.
Why Go?
The Weedmaps Museum of Weed has the right balance of being informational and Instagrammable. It'll be an engaging, eye-popping experience, but it'll also teach you plenty about cannabis and its history. Rather than open up a surface-level branded "museum," Weedmaps is creating an interactive tool through which to share a wealth of in-depth cannabis knowledge — covering weed culture, science, and medicine, while also offering plenty of great photo ops.
If you're a seasoned stoner looking for something new to do in L.A., the Weedmaps Museum of Weed is the place for you. It'll also be an ideal setting through which to educate friends and family, and a worthy stop for Southern California visitors and vacationers.
"The Weedmaps Museum of Weed will combine all the immersive elements you'd expect to find in the world's finest museums across multiple categories, including cultural, fine art and natural history," Beals said. "There will also be plenty of artistic installations for those who want to share meaningful moments socially."
This content is sponsored by Weedmaps. General Admission and VIP Tickets for the Weedmaps Museum of Weed are available at themuseumofweed.com.
Weedmaps Sponsored
What Travelers Need to Know About Flying with Weed
Culture & Industry 7 daysWeedmaps News
With the laws surrounding cannabis — both marijuana and hemp — constantly changing, confusion for cannabis consumers arises when it comes to traveling to and from states where weed is...
How To Make a Crutch: a Step-by-Step Guide
Culture & Industry 1 monthWeedmaps News
The art of rolling a joint is sacred within stoner culture, the gospel of group smoke sessions and true cannabis connoisseurs. To make the most of that freshly twisted joint,...

redpajama_set_name: RedPajamaCommonCrawl


Ewan McGregor and Eve Mavrakis are splitting-up after over two decades together confirms People. A source close to the family tells the publication the couple have been living apart since May, as photos emerge of McGregor kissing his costar, Mary Elizabeth Winstead.
McGregor, 46, and his Fargo costar, Winstead went public with their romance, dining at a busy London eatery together and sharing a passionate kiss before leaving reports, The Sun.
Ewan And Eve together on the red carpet in April 2017.
The Moulin Rouge actor and Mavrakis, 51, have both been spotted without their wedding rings in recent months, they have been married since 1995 and have four children together.


text:
Emporia Elegance and Solid handsets designed for seniors
Austrian mobile phone-manufacturer Emporia has released two new models - the Elegant and the Solid - at the World Mobile Congress in Barcelona, Spain. The new handsets add to the company's range aimed at seniors, mobility impaired users and other groups who primarily just wan to make and receive calls. Both feature a high contrast OLED 1.8-inch screen, a magnifying function that lets you enlarge the characters on screen, large buttons, and an extra loud speaker that is compatible with hearing aids. Read More
Energy recycling artificial foot is a step in the right direction for amputees
Most of us take it for granted, but walking isn't as simple as it looks. With the natural human gait the ankle exerts force to push off the ground. A typical prosthesis doesn't reproduce the force exerted by a living ankle, resulting in amputees spending much more energy in comparison to walking naturally. A new prototype artificial foot recycles energy that is otherwise wasted in between steps to significantly cut the energy spent per step, making it easier for amputees to walk. Read More
FlexibleLove - the extraordinary expanding chair
The FlexibleLove chair is a fabulously functional chair that is made almost entirely of recycled cardboard and recycled wood waste. What's even more unique, is the fact that it can be expanded to fit from one to up to 16 people because of its accordion and honeycomb structure. This structure allows it to be stretched and folded into a multitude of shapes and lengths - creating surprisingly strong seating, suitable for various spaces and requirements. Read More
Winter Olympics gets a touch of greenery
When Vancouver won the competition to host the 2010 Olympic & Paralympic Winter Games thoughts immediately turned to construction, and one of the most awe-inspiring initiatives has to be the redesign of the Vancouver Convention and Exhibition Center (VCAEC). Currently hosting the international broadcasting and media hub for the Winter Olympics, this waterfront building is not only beautiful and functional but is environmentally sustainable, boasting a green electricity program, a seawater heating and cooling system and the largest "living roof" in Canada populated with 40,000 plants and grasses. Read More
Kegless beer-in-a-bag keeps its bubbles
The upside of a party at your place is that you don't have to worry about getting a ride home after a few beers. The downside is having to clean up the next morning and finding a way to dispose of all those empty beer bottles. But had you supplied the party with (or encouraged others to bring) a Kegless, this wouldn't be a problem. Kegless is a 4L (roughly 8.5 pints) bag-in-a-box packaging concept that provides a more sustainable alternative to conventional single-serve bottle or can. It allows beer (and other carbonated beverages) to be stored and dispensed from a single container while maintaining the carbonation and freshness of the product. Read More
ASUS swivel multi-touch Eee PC T101MT confirmed
The new Eee PC T101MT 10.1 inch LED backlit resistive touchscreen notebook computer was first shown at this year's CES in Las Vegas and now ASUS has made things official with a product website. The notebook-tablet combo will ship with an Intel Atom N450 processor, up to 2Gb RAM and a choice of 160Gb or 320Gb hard drive. It will also come with a year's worth of online storage thrown in. Read More
The Kolelinia - a rush-hour bike-path in the sky
Riding a bicycle through city traffic is often dangerous enough to be considered an extreme sport, but a concept by architect, Martin Angelov, takes the thrill of city cycling to a whole new level – literally. His design proposes a new type of bike lane, based on steel wires and suspended up to 4.5 meters (14.5 feet) above the hustle and bustle found at street level. Read More
Samsung shows first LTE (4G) Netbook
Samsung began demonstrating the world's first Long Term Evolution (LTE) netbook PC at Mobile World Congress 2010 here today. Samsung's own in-house designed LTE modem chipset, Kalmia, enabled the development of a small form factor netbook with LTE capability. Samsung demonstrated live video streaming via the company's own LTE network equipment on the Samsung netbook N150.The Samsung netbook N150 is currently available in market with HSPA 3G communications and WiFi access and will become commercially available with LTE in appropriate markets. Read More
First Littoral Combat Ship deployed
The first Littoral Combat Ship departed from Florida today for its maiden deployment, approximately two years ahead of schedule. The agile 378-foot USS Freedom (LCS 1), designed and built by a team of companies led by Lockheed Martin, is the first of 55 the U.S. Navy plans for a new class of ships designed to operate in coastal waters. Read More
Spokeless bicycle adds some 'cool' to pedal power
Usually, when you put nine university seniors together from a mechanical engineering class in a room for a whole semester with no strict agenda, the last thing you expect to get is a useful product. But this team broke the mold and created a "human-powered spokeless bicycle". Admittedly, only the back wheel is spokeless, but the Yale students had two very good reasons for that – time and money. Read More
MARINE FEATURE
The world's first tribrid – human-sail-electric watercraft range
136 Pictures
Two landmark water transportation announcements from Hobie this week could seriously supercharge the adventure and recreational marketplaces. Its announcements effectively means the company will be selling the first tribrid – a watercraft powered by a combination of three energy sources – when its new electric option becomes available in March at the same time as the much-awaited Mirage Tandem Island hits showrooms. Read More
Compostable plastics breakthrough sounds sweet
Traditional environmental enemies food packaging and other disposable plastic items could soon be composted at home along with organic waste and not collected for landfill thanks to a new sugar-based polymer being developed at Imperial College London. The degradable polymer is made from sugars known as lignocellulosic biomass, which come from non-food crops like fast-growing trees and grasses, or renewable biomass from agricultural or food waste. Read More
Study Nook gives special needs students added focus
For certain school children with learning disabilities, focusing on the task at hand is a major challenge, especially with so many distractions to be found in the classroom. To address the problem university student Aaron Kowald has designed the Study Nook – a miniature desktop office that functions as a learning aid for children with Profound and Multiple Learning Difficulties (PMLD), like autism and Down's Syndrome. Read More
Ford unveils long awaited 2011 Transit Connect Electric van
By Mick Webb
The Ford Motor Company chose the recent Chicago Auto Show to unveil its long awaited Transit Connect Electric van. The all-electric light duty commercial vehicle is the first in Ford's accelerated electrified vehicle plan that also includes the Focus Electric in 2011, as well as a plug-in hybrid vehicle and next generation hybrid technology due in 2012. Read More
Huawei shows E398 triple-mode LTE modem
Chinese telecommunications manufacturer Huawei has been showing its E398 modem at the Mobile World Congress in Barcelona and garnering a lot of interest. The E398 is the world's first triple-mode LTE modem compatible with all three major network standards: LTE, UMTS, and GSM.
The triple-mode modem will enable high speed LTE access while seamlessly switching to other standards (UMTS or GSM) when LTE is not available. Read More
Researchers harness heat to power electronics
Efforts to capture energy from the human body usually focus on harnessing the kinetic energy of the body's movement. However the human body is also generating energy in the form of heat that could also be used to run low power electronic devices. New energy-scavenging systems under development at MIT could generate electricity just from differences in temperature between the body (or other warm object) and the surrounding air. Read More
PREVIEW: Audi A1 - compact size full of features
Audi has finally "cut to the chase" and delivered us enough information to bring you an insight into how its new A1 will look and perform when it's released at the Geneva Motor Show next month. This new Audi three-door hatchback follows on from the 2007 Quattro design study in a smaller shape that the company says will still provide space for four adults and their luggage. It comes a choice of two petrol and one diesel engine option and plenty of built-in features shoe-horned into a compact space. Read More
MOTORCYCLES FEATURE
Video trauma test - d3o advanced motorcycle armour vs. conventional thick foam
d3o's body armour claims to be soft and flexible throughout the day, but to harden up instantly under impact. As such it's been a big hit in the snowboarding market, where it can make clothing protective and impact-resistant without it looking like you're wearing armour. But now d3o are branching out into the motorcycle armour market - so how does this thin, bright orange wonder armour compare against the traditional thick foam CE armour pads you find in bike leathers? Editor Noel McKeegan attacks Loz Blain with a heavy frying pan to find out. Read More
Less is more for highly absorbing, flexible, cheaper solar cells
Using arrays of long, thin silicon wires embedded in a polymer substrate, a team of researchers at the California Institute of Technology (Caltech) have created a new type of flexible solar cell. Promising enhanced sunlight absorption and efficient conversion of photons into electrons, the new solar cell uses only a fraction of the expensive semiconductor materials required by conventional solar cells, and because they are flexible, they will be cheaper to manufacture. Read More
Speedo Aquabeat waterproof MP3 player
Speedo's offering in the waterproof MP3 player arena - the Aquabeat - is submersible to three meters, weighs in at only 35g and is easily attached to your sports gear so you can have beats as you zig-zag at high-speed down the mountain or cut laps at the pool. Read More
Putting live vaccines in 'suspended animation' could save millions of lives
Vaccination has pretty much rid the entire western world of some of its worst child-killing diseases - but a lot of these nasties are still causing death and debilitation in developing countries. There's one simple reason: because the vaccines contain living strains of the viruses they attack, they need to be kept continuously refrigerated all the way from production to the point of use - and that's an expensive and sometimes insurmountable logistical nightmare. Which is why this invention could save literally millions of lives... Read More
The incredible Superplexus Vortex puzzle
Remember that old wooden labyrinth puzzle you used as a kid? You had to manipulate a small steel ball through a series of mazes by altering the orientation of the plane using two knobs. Prepare to meet its big brother – the Superplexus Vortex. It's a humongous, three-dimensional, spherical labyrinth that promises to both challenge and frustrate you. Read More
Eyeball-tracking earbuds let you control your MP3 player with a glance
How the heck does it do that? Japanese telecom giant NTT DoCoMo has used the Mobile World Congress in Barcelona to demo a very cool new handsfree interface you can use to control an MP3 player using gestures you make with your eyeballs. Sensors in the earbuds themselves measure changes in electrical potential to convert your eye movements to iPod commands. Fascinating stuff... and while using it on an MP3 player might seem a bit naff, there's probably a range of other situations where handsfree, voice-free control options like this could be really useful. Read More
Small liquid sensor could lead to home cancer detection kits
Just as home tests revolutionized the detection of pregnancy, a tiny sensor being developed at the University of Missouri (MU) could bring the benefits of home testing to the diagnosis a variety of diseases, including breast and prostate cancers. The sensor, known as an acoustic resonant sensor, is smaller than a human hair and could one day be used in home testing kits for the easy, rapid and accurate diagnosis of a range of diseases. Read More
DARPA advances LS3 quadruped robot program
Walking quadrupeds are being cast to play a major role in the rapidly unfolding age of robotics. The platform promises versatility far beyond that of wheeled-vehicles and will undoubtedly find applications in a wide variety of fields. Not surprisingly, the development of quadrupeds is being driven by the military and DARPA has recently boosted its efforts by awarding Boston Dynamics $32 million for the prototype phase of its Legged Squad Support System (LS3) program. Read More
GPS enabled X-Plore.XGX gloves keep track on the slopes
For powder hounds looking for a convenient way to keep track of the best runs down the mountain winter sports accessories manufacturer Zanier has announced the X-Plore.XGX – the first glove with full GPS functionality. Aside from making sure skiers won't lose that gnarly stash of powder or get lost, the GPS enabled gloves also record altitude, speed, distance, duration and other route data for upload to the web once back at the ski lodge. Read More
Cleaner, cheaper fuel from orange peels and newspaper
While it may not quite be the Mr. Fusion energy reactor Doc Brown uses to convert household scraps into power for his time-traveling DeLorean, scientists have found a way to turn discarded fruit peels, newspapers and other waste products into cheap fuel to power the world's vehicles. Its developer says the new approach is greener and less expensive than the current methods available to run vehicles on cleaner fuel and is part of his goal to relegate gasoline to a secondary fuel. Read More
Gorillapod goes magnetic
Gorillapod's camera tripods have become a common sight since they were released a few years back and there's a good reason for that - it's a great idea. Now Gorillapod designer Joby has announced a new addition to the range - the Gorillapod Magnetic - which incorporates magnets into the feet of the flexible tripod allowing it to be anchored to any magnetic surface. Read More
Firescuba mask prevents smoke inhalation
It might look like a McDonald's fries packet, but the Firescuba concept is nothing to be laughed at if it keeps you alive until help arrives. Smoke inhalation is the major cause of most fire-related injuries and deaths so if this device with its carbon filter lets you breathe through smoke, it's probably worth carrying one around with you or keeping one within reach at home. Read More
Hiperwall software video wall uses normal PCs and monitors
Video walls – a wall of monitors displaying large quantities of information at a single glance - have traditionally been the domain of air-traffic control, NASA, television stations, and big budget marketers, but no longer. Hiperwall's high-performance, low-cost video wall system uses a software solution that is hardware agnostic (meaning it can work with any size, resolution or type of display, whether it's LCD, plasma, CRT even rear-projection) and allows non-technical users to manage the display of video and data feeds using just a mouse. This is a killer app in that it enables complex information display at a fraction of the cost of previously!! Read More
Click and Grow - growing plants via computer
As someone who has been responsible for the death of every single pot plant that has been placed in my charge, I was interested to discover a new computerized system that is designed to take the guesswork out of growing houseplants. It's manufacturers say the Click & Grow system takes care of all a plant's needs such as watering and fertilizing by way of sensors, a processor and special software contained in the pot. Read More
Flyfire: mini-helicopters create futuristic 3D display
The basis of most 3D systems is to "trick" our eyes into believing that an image shown on a flat screen has three dimensions, but what if you could throw away the screen entirely! It sounds simply too far-fetched and impossible to choreograph, but that's exactly what researchers MIT's SENSEable City Lab and Aerospace Robotics and Embedded Systems Laboratory (ARES Lab) have created with Flyfire - a cloud of LED-carrying micro-helicopters controlled in synchrony to show unique animated light displays in three-dimensional space. Read More
BikeCAD lets you design your dream bicycle online, for free
Anyone who likes bicycles has at some point probably fantasized about it - getting their own one-of-a-kind custom-made bike. There are oodles of independent frame-builders out there who will gladly accommodate such fantasies, but their services generally don't come cheap. Building a high-end bicycle from scratch definitely requires a lot of skill, and even designing one isn't something that just anyone can do… or is it? BikeCAD, a free online applet, guides users through designing their own road, mountain, tandem or recumbent bike. They can then take their finished design to a builder, or even attempt to build the thing themselves. Read More
Nintendo's DS2 to counter Apple with accelerometer, rumble pack?
Nintendo was doing touchscreen gaming long before Apple ever decided to get in the game. But as the iPod touch, the iPhone, and now the iPad have challenged the gaming giant, Nintendo is expected to respond aggressively with a new console in 2010. Reports are already starting to roll in that some developers in Japan have received early versions of the new Nintendo hardware. Read More
Computer takes guesswork out of anesthetizing
Anesthetists cannot take their responsibilities lightly. Too little anesthetic and a patient may feel the whole procedure, too much and a patient might shuffle off this mortal coil. Researchers in the Canary Islands have taken the guesswork out of this thorny dilemma and developed a computer-controlled system that measures a patient's hypnotic state and applies the appropriate dose of anesthetic. Read More
Vauxhall to show shape-shifting 175mpg 125 mph Flextreme GT/E hybrid
Vauxhall will unveil a dramatic concept car at this year's Geneva Show. The Flextreme GT/E uses what Vauxhall calls extended-range electric vehicle (E-REV) technology – the wheels at all times are driven by electricity, but a small petrol engine/generator provides enough electricity to extend the driving range to more than 300 miles. The Flextreme GT/E also employs active shape shifting. Above 30mph, a vertical panel extends along the body from the air extraction slot behind each rear wheel-arch, guiding high-speed airflow around the rear of the car, reducing the drag co-efficient to just 0.22. Read More
The Zingy tribrid motorboat, rowboat, sailboat
So, you're thinking about buying your first boat... What kind do you want - a boat for ripping around the lake, one for a tranquil morning of fishing on the pond, or something for catching the wind and bouncing across the waves? Whaddaya mean, all of those? Actually, inventor Clayton Turney would tell you he's got just the watercraft for you. His Zingy boats were designed with first-timers/generalists in mind, as they can apparently be used as motorboats, rowboats or sailboats, they're small enough to carry on the back of a motorhome, and are supposedly quite easy to handle. Oh yeah, and they're also claimed to be unsinkable. Read More
Citroen to unleash 200 bhp DS3 Racing at the Geneva Motor Show
Citroen will take the wraps of the hot version of its new premium model, the DS3 when it reveals the 147 kW Citroen DS3 Racing at the Geneva International Motor Show on March 2. Developed by Citroën Racing - the dominant team behind five World Rally Championship manufacturer's titles and six driver's titles for over the past six years - leaves little doubt that the French car maker has the ability to take its already critically lauded DS3 and turn it into a real performance machine. Planned for the second half of 2010, the exclusive DS3 Racing will be limited to just 1000 production units. Read More
Proposed Beijing district to reduce carbon emissions and energy use
Skidmore, Owings and Merrill LLP (SOM) has just unveiled details of the first phase for the expansion and redevelopment of three business districts in China's capital city, Beijing. Key to the success of the project is the installation of a Central Park area which will help to heat and cool energy efficient buildings in the Dawangjing District by geothermal exchange instead of relying on energy-intensive cooling towers. Read More
Eclipse Touch Mouse
Like the Apple Magic Mouse that came before it, the Eclipse touchmouse drops the scroll wheel in favor of an integrated track pad. While the default for the touchscroll offers four-way screen scrolling by a user moving their index finger, a host of instantly accessible commands like flicking backward and forwards through webpages can be accessed through the mouse button and finger gesture combination. Read More
The fastest, most potent drop-top Bentley so far
Bentley is fast moving from its luxury car tag to that of a supercar brand with the latest release of its Continental Supersports Convertible – the fastest four-seater convertible on the road. The new Supersports has the same 630PS (621bhp/463kW) twin-turbocharged W12 engine as the Continental Supersports Coupé introduced in 2009. Bentley says this is the fastest, most potent drop-top the company has ever built - 0-60mph in 3.9 seconds (0-100kmh in 4.2 seconds) and a top speed of 202mph (325kmh). Read More
PeeWee Kit makes computers kid friendly
Ensuring the home computer is 100 percent safe for the youngest members of the family is a priority for most parents. But security software can be expensive and unfortunately is not always completely effective. A clever new product – the PeeWee Kit – not only makes any computer kid-safe, it won't break your piggy bank either... Read More
Ducati patents frameless roadbike
Last year when we did an extensive feature on Ducati's motogp carbon fibre semi-monocoque frame, we lauded its groundbreaking technology. Now it seems the Italian powerhouse is so pleased with its handiwork that the semi-monocoque design looks set to replace Ducati's trademark trellis frame on its road bikes in the future too. Read More
Brighter, whiter clouds could fight global warming
Scientists in the US have been cloud-spotting over shipping lanes and have noticed something more interesting than teddy-bear shapes and faces. They have detected that rising steam from passing ships has caused brightening in the clouds which they theorize alters the reflectivity of the cloud and prevents the energy from reaching the Earth. They propose that if this could be achieved artificially via geoengineering it could be an effective defense against global warming. Read More
TamTam GPS flashlight concept to light the way
The TamTam Flash concept GPS torch is both a familiar looking and new technology in a number of ways. It resembles an ordinary flashlight and its name sounds an awful lot like TomTom, which neatly links to the fact that the concept torch is actually a GPS mapping device that gives its user the option of either a street map view or a turn by turn guided navigation projected onto a surface. Read More
Sony introduces prosumer-level AVCHD camcorder
New release prosumer level cameras of today boast features even more impressive than those found on professional cameras of just a few years ago – and at a fraction of the cost. Sony's new HDRAX2000 prosumer video camera is a case in point, and it's one of the first professional video cameras that records using the AVCHD format. Read More
Outer Ear allows hearing-impaired people to 'feel the noise'
The Outer Ear is a non-surgical concept system for the hearing impaired that detects sound-waves and converts them into physical vibration. A watch-like wrist-strap acts as the receiver and transmits a signal via Bluetooth to a device mounted on the arm which in turn converts the sound into low, medium or high vibrations depending on the frequency. Read More
Feel the burn with the Riiflex Dumbbells for Wii
Wii Fit-ness fanatics looking for a way to add a bit of weight training to their Wii cardio workout that doesn't involve dipping a Wii-mote in gold need look no further than these Riiflex Dumbbells. The dumbbells slide over the Wii-mote and Nunchuk controller to put an extra 2-pounds (1kg) in each hand and provide some extra calorie-burning resistance while playing. Read More
Home Core all-in-one toilet aims to save H2O
Integrating the toilet bowl, basin, mirror and a vanity table into one, the Home Core concept has a storage tank that can be used to flush the toilet with water saved from the hand-washing basin. The water pressure on the unit can also be controlled to four different levels to help conserve potable water. Some might see it as taking the idea of all-in-one a step too far, but we think this unit would be great aboard high-end campervans, yachts, even aircraft, where space is at a premium and fresh water can be scarce. Read More
5 by Peugeot Concept Car
Peugeot says it's responding to "radical changes in the market for large, luxury saloons" with the diesel-electric hybrid "5 by Peugeot" concept which will hit the show floor in Geneva next month. Sitting at the opposite end of the scale to the diminutive BB1 which caught our eye in Frankfurt, the 16-foot long HYbrid4technology concept combines a front mounted, 120 kW, 2.0-liter HDi diesel engine with a 27 kW electric motor at the rear and uses an electric-only mode at low speeds. Read More


text:
Apply (closed)
Jacob Lagerros
Lovisa Tengberg: current view, StrongMinds
This is part of a series of posts where each research fellow describes their reasons for favouring a certain recipient of our final donation, as described further in the full post on Version 0.
Name: Lovisa Tengberg
My current best guess is that we should donate to intervention/organisation:
Mental Health (most likely StrongMinds, but also want to look further into the Alderman Foundation, AEGIS Foundation, and Network for Empowerment and Progressive Initiative, as these have been recommended by Harvard EA Student Group in a report, suggesting that they "show potential in leadership, scalability, cost-effectiveness of programs, and proven success")
My cost-effectiveness estimate for the intervention/organisation is:
MH is a large-scale issue which is highly neglected:
As mentioned in my previous reports on 2017-01-26 and 2017-02-06, up to 10% of people worldwide are affected by MH problems. It represents 7.4% of the world's total global burden of disease, accounting for 22% of all days lived with disability (as measured in DALYs). The DALYs due to mental illness grew by 38% in the twenty years between 1990 and 2010, and is expected to continue on this trajectory
New info: From the Harvard EA group's report, the burden of mental illness (excluding Parkinsonism, dementia, epilepsy etc.) is actually "underestimated by more than a third using current approaches". They believe this underestimation is from: "overlap between psychiatric and neurological disorders; the grouping of suicide and selfharm as a separate category; conflation of all chronic pain syndromes with musculoskeletal disorders; exclusion of personality disorders from disease burden calculations; and inadequate consideration of the contribution of severe mental illness to mortality from associated causes....Therefore, mental health is a pressing and growing issue in SubSaharan Africa as more research and insight into its true burden is revealed."
Further, like Konstantin and Michael Plant, I suspect QALYs/DALYs very likely underrate the badness of MH on happiness (Plant: "Once you revise the $/DALY cost-effectiveness figures to take into account how DALYs underrates happiness, it's possible treatments for depression at around $1000/DALY...are in roughly the same ball park as AMF, which is $100/DALY"), which influences my decision.
MH is largely neglected at a national level and by the international donor community, with only ~20% with severe mental disorders accessing treatment in low-income countries, and according to a review which measured diagnosis rather than severity, there is a treatment gap for mental disorders of ~55%.
For the reasons above, I believe a donation to a cost-effective MH intervention (assuming one is found) could have a large potential impact, possibly more than other interventions we have looked at.
StrongMinds
StrongMinds is a charity that treats women in Uganda with depression through a 'unique' depression intervention, based on Group Interpersonal Psychotherapy (IPT-G), a low-cost, scalable and cost-efficient community based methodology.
StrongMinds seems to be one of few charities where extensive external research has been conducted to test the effectiveness of the program, with successful results. According to a report by the Center for EA, "it outperforms typical interventions aimed at improving mental health through direct treatment".
CEA has done a very detailed cost-effectiveness analysis of StrongMinds here, and further I have received information on their funding gap from the organisation directly. Key metrics:
(Cost-effectiveness (from MHIN): $34 / DALY averted (seems v. wrong to me, must have misunderstood something, but wanted to include nevertheless))
Cost-effectiveness (from model): $676.9 / DALY averted, with expected drop to $404 / DALY averted (seems in line with the DCP-3 report's estimates of interventions)
Funding gap:
2017: $250,000 (USD)
2018: $1.6m (USD)
Women treated: nearly 10,000
Plans:
Within next 3 years: reaching 100,000 women
By 2025: reaching 2 million women
Expansion to Kenya in 2018
82% depression-free at conclusion of treatment
80% depression-free 6 months post treatment
67% decrease in unemployment
~75% of groups continue to meet after formal sessions conclude
What would change my mind:
Depends on the cost-effectiveness - should speak to StrongMinds to see what figures they have (assuming these are relatively accurate), and when and to what a 'drop' in $ / DALYs averted is expected
Long-term effects of IPT-G are relatively unknown. If it is shown that the results from the studies done by John Hopkins on StrongMinds don't hold up in the long run, I would change organization / cause
If shown (once examined) that one of the other MH organizations recommended by the Harvard EA community are more cost-effective than StrongMinds - need to look into them further, although I am skeptical
Similar to Konstantin and Plant, my decision is based much on the fact that we should aim to reduce misery rather than poverty, and (as mentioned by Konstantin), if it is proven that there are other cause areas with effective organizations where hedonic adaptation does not take place (like with chronic pain), I would reconsider.
I would consider existential risk and animal welfare (given (supposedly) no adaptation) as causes in case cost-effectiveness and tractability were proven convincing
Happy to hear other people's views and be convinced otherwise
My current best guess for a runner-up is:
Against Malaria Foundation (as a default, based on GiveWell's current recommendation.
Tagged: Current view, Version 0
Daniel May: current view, Machine Intelligence Research Institute
Konstantin Sietzy: current view, StrongMinds
Questions? Email director@oxpr.io


text:
Green Li-ion to launch first lithium-ion battery recycling...
Green Li-ion to launch first lithium-ion battery recycling technology in Singapore
New EPR framework for e-waste to take effect starting in 2021
Keith Barker
Greentech startup Green Li-ion has developed a patented multi-cathode processor GLMC-1 that recycles spent lithium-ion batteries directly into 99.9% pure cathodes, speeding up current recycling processes by more than 10 times and lowering costs by more than 4 times.
According to the company, lithium-ion batteries (LIBs) are now the world's preferred source of portable energy, but with a functional lifespan of only 1 to 3 years. However, up to 95% of these batteries end up as e-waste in landfills, and in Singapore, about 60,000 tonnes of e-waste is generated per year, while simultaneously, Green Li-ion's only landfill at Pulau Semakau is expected to run out of space by 2035.
In an attempt to curb this trend, the Singapore Ministry of Environment and Water Resources and National Environment Agency have introduced an extended producer responsibility (EPR) framework for e-waste, which takes effect starting from 2021.
However, the EPR deadlines mean local electronic producers are now scrambling to take on responsibility for the collection and proper treatment of e-waste, but current LIB recycling options are not economically viable, resulting in a 5% recycling rate.
Green Li-ion co-founders Leon Farrant and Dr Reza Katal.
Two environmentalists and co-founders of greentech startup Green Li-ion, Leon Farrant (CEO) and Dr Reza Katal (CTO), have spent over a decade perfecting a solution to this. With their combined expertise in chemical and environmental engineering, the pair has developed a patented multi-cathode processor GLMC-1 that recycles spent lithium-ion batteries directly into 99.9% pure cathodes, speeding up current recycling processes by more than 10 times and lowering costs by more than 4 times.
With extensive institutional and industry support, Green Li-ion's first GLMC-1 will be ready to begin operations in October 2020 and the second GLMC-1 will be operational in January 2021. Green Li-ion is currently in talks with all six of Singapore's main e-waste recycling companies and major global e-recycling players in Dubai and China to supply GLMC-1 to their facilities.
According to Green Li-ion, as the circular economy becomes increasingly crucial and the end of life legislation starts to impact battery manufacturers, purity and efficiency of LIB recycling will be key to sustainability.
ERI becomes a carbon neutral organization
View Latest Electronics News


Smart is one of the few brands enjoying showroom success at the moment with a 43.3 percent sales improvement on the 2007 figure.
Smart has a reputation for affordability and economy and the range is being considered by an increasing number of motorists who are seeking to reduce their motoring costs. The green credentials are hugely impressive, the #Smart CDI# returns a staggering 83.1 miles per gallon on the combined cycle and boasts the lowest CO2 emissions of any current production car at just 88g/km. Owners will pay exactly zero in road tax.
A pioneering market trial of 100 fully electric smart models is also underway in the UK. The smart ed emits no carbon dioxide, carbon monoxide, unburned hydrocarbons, particulate matter or any harmful substance. It has a top speed of 60mph (electronically limited), a range of 70 miles on a single charge, can achieve the equivalent of 300mpg, and is charged by simply plugging it directly into any UK mains 3 pin plug socket.
The new Smart CDI is due to go on sale in early March. The price has yet to be released, the range available at present start on the road at approximately £6912 this would give the impression that the new cdi will probably be a touch under the £8000 mark.


Our coverage of The Winnipeg Foundation's Charitable Sector Insights 2019: The Trust Edition. We'll bring you highlights of the panel discussion with Joan Blight of Strategic Philanthropy, Paul Samyn of the Winnipeg Free Press, Leilani Kagan from TDS Law, and Bruce MacDonald from Imagine Canada. We'll hear their perspectives on the charitable sector and how the public's trust may be in jeopardy.
Then, flowers and modern art meet at the Winnipeg Art Gallery as part of Art in Bloom. We'll speak with Hennie Corrin, Co-Chair of the Art in Bloom Committee to learn more about this beautiful, floral, biennial event.
We continue our coverage of projects supported through The Winnipeg Foundation's Reconciliation Grants program. This week, we'll speak with Rayne Graff from IRCOM to hear how their grant is helping to build relationships in our community.
And we'll speak with another group of Winnipeg Impact Makers - the Dawson Trail Knitters for Charity. We'll speak with coordinator Jean Paraschuk to learn how this group of amazing individuals is working to help those in need in our community.


text:
https://mmajunkie.usatoday.com/2012/06/ufc-147-bonuses-franklin-silva-damm-vinicius-pocket-65000-in-brazil
UFC 147 bonuses: Franklin, Silva, Damm, Vinicius pocket $65,000 in Brazil
June 24, 2012 4:20 am ET
http://mmajunkie.com
BELO HORIZONTE, Brazil – Rich Franklin, Wanderlei Silva, Rodrigo Damm and Marcos "Vina" Vinicius on Saturday won $65,000 bonuses for their performances at UFC 147.
Franklin and Silva shared the "Fight of the Night" award for their five-round main-event, Damm won "Submission of the Night" and Vinicius picked up "Knockout of the Night." UFC officials announced the winners and bonus amounts at the post-event press conference, which MMAjunkie.com (www.mmajunkie.com) attended.
UFC 147 took place at Estadio Jornalista Felipe Drumond in Belo Horizonte, Brazil. The main card aired on pay-per-view following prelims that on Facebook and FX.
For Franklin and Silva, it was the second time their main event has picked up "Fight of the Night" honors. Their first fight, at UFC 99 three years ago, also won the award. Franklin won that fight by unanimous decision. And on Saturday, he was able to do it again – but in a five-round war that had him needing to survive a major offensive surge from Silva in the second.
Damm, a featherweight cast member of "The Ultimate Fighter: Brazil" and a Strikeforce veteran, had little trouble submitting his biggest rival on the show, Anistavio "Gasparzinho" Medeiros. Damm sank in a rear-naked choke against "Gaspar," the "TUF: Brazil" house's resident troublemaker, and forced him to tap just 2:12 into the fight.
And Vinicius, also a featherweight cast member in the "TUF: Brazil" house, mounted a third-round comeback to knock out Wagner "Galeto" Campos in a fight that streamed live on Facebook. A big knee to the body hurt Campos, and from there Vinicius was able to land several big shots against the cage until Campos was dropped.
For more on UFC 147, stay tuned to the UFC Events section of the site.
(Pictured: Wanderlei Silva)


Valentine's Day has become a traditional celebration centered on showing love for the special people in our lives. It's based upon stories about a Christian man by the name Valentinus who is said by some to have been born in 269 AD in the town of Terni, Italy. There is very little reliable information about him or the things he did. There are various traditions which portray him as a minister of the early church who performed Christian marriages in defiance of Roman Emperor Claudius Gothicus. Some say that these marriages fueled Rome's hatred of Christianity, and reduced the number of men available for military service since they could cite their marriage as an exemption from serving. One tradition is that Valentinus was sent to prison for refusing to sacrifice to Rome's gods. While there it's claimed that he healed the jailer's daughter who had been blind. When executed he left her a note signed, "Your Valentine".
We don't really know if such a man existed or if it was all just legends that were circulated among certain groups in the early times of the church. The celebration commemorating him has become a popular time for exchanging chocolate hearts, giving of Valentine cards, and a time for romantic and family gatherings, special meals, and parties. The key word for Valentine's Day is "love". It's particularly directed toward our love for those who are specially close to us.
If Jesus said love is a summation of all the law and prophets, then we need to know what it means to love, what love looks like when it's present, and how to develop love in our lives.
We ought to love God in all these ways. As we encounter what our Lord brings into our lives each day, we should be patient, kind, not jealous of others, not bragging or arrogant, or acting in an unbecoming way. We don't put ourselves first, and are not provoked by our circumstances and by how we are treated as God's plan unfolds around us. Our focus is not on the wrongs performed toward us, and we find our joy in truth rather than things that are unrighteous. We believe and hope in all things God has made known to us in his word. We endure unfailingly through all that comes our way.
We need to love others God brings into our lives; our spouses, children, and our neighbors in this world. Husbands are commanded in Ephesians 5:25 to love their wives as Christ loves the church and gave his life for his people. The love of husbands toward their wives should therefore be sacrificial, not taking advantage of them or using them for their own benefits. Parents are to love their children as gifts of God and as entrustments God gave for them to raise them to know and to love the Lord.
In loving our God we should be inwardly motivated by the work of the Holy Spirit in all things so that redeemed believers in Jesus the Messiah will honor God's revealed moral principles. We will honor God above all else and worship him in the ways he specifies, use his name thoughtfully and respectfully, and respect the principle of Sabbath rest set in motion back in Eden. We will honor our parents, respect the value of human life, be faithful to our spouses, honor what God gives to others, speak truthfully, and respect what God gives to others without coveteousness.
This legitimate love is stirred in us who are regenerated by grace so that it would display the love of God for his people. When we tell others we love them, or send them a "Valentine", we should keep these biblical features of love in mind so that God's greater love can be seen in us. Of course we should do that every day, not just on February 14th. But maybe that traditional day can remind us of what should be seen in our lives all the time, particularly toward those God has specially brought into our lives.


A must have free plug-in for any environment that runs vCenter. VMware vCenter Support Assistant accelerates Support Request resolution by allowing you to easily create and track support request through vCenter. It also can provide proactive alerts and recommended fixes for technical issues even before the problem occurs. This guide will show you how to configure VMware Support Assistant starting first with listing the benefits of vCenter Support Assistant below.
Receive proactive alerts and recommended fixes: Automatic notifications within vCenter keep you up-to-date on any issues and provide you with recommended solutions.
Transmit selected log files automatically: Selected log files are collected and regularly transmitted to VMware Tech Support and matched to a dynamic list of known issues sourced from hundreds of thousands of customers.
Configure data collection times: vCenter Support Assistant allows you to set the collection frequency and time of day to minimize impact on your system's performance.
File technical Support Requests within vCenter: Use vCenter Support Assistant to file support requests for any product for which you already have VMware (not OEM) support entitlements – regardless of whether that entitlement is via subscription, or paid-for incident packs.
Collect and attach diagnostic information and other files: With just a few clicks, vCenter Support Assistant can directly generate log support bundles from vCenter Server and vSphere. You can also easily attach other files, such as screenshots, to your support request. Files are sent securely over SSL.
Installing the OVF file is very straight forward, after installing the appliance follow the steps below to configure vCenter Support Assistant.
Check the box next to your vCenter you want to monitor and enter in the username and password you want to use for collecting logs.
In the Home page you should now see a new vCenter Support Assistant icon. Click on it.
If you go back to the Support Assistance portal you will should now see that Proactive Support is now Enabled. Click on Test Connectivity to verify everything is working as well.
You now have the options to create a new VMware support request without calling it in. Also you can track and modify the open tickets as needed.


13 Mar - 6 min - Uploaded by wrangleroooo The Holiday by Hans Zimmer #Maestro. 01 - Hans Zimmer - The Holiday Score. 26 May - 4 min - Uploaded by julia Mix - Hans Zimmer - Maestro (The Holiday soundtrack)YouTube. Hans Zimmer. 13 Dec - 4 min - Uploaded by gemixu90 Hans Zimmer - Maestro - The Holiday OST . Guess Hans Zimmer would have made.
The Holiday (Complete Score). Label: Unofficial Release. Length: 70' existenceguild.com rating: Not yet rated. Fans rating: rate at 1 out of 5 rate at 2 out of 5 rate at. The Holiday. Label: Varese . Hans Zimmer, Heitor Pereira, Lorne Balfe, Imogen Heap; Christmas . The best movie and the best OST, music for my belly. The Holiday (Original Motion Picture Soundtrack). By Hans Zimmer. • 22 songs. Play on Spotify. 1. Maestro. 2. Iris And Jasper. 3.
Find a Hans Zimmer - The Holiday (Original Motion Picture Soundtrack) first pressing or reissue. Complete your Hans Zimmer collection. Shop Vinyl and CDs. The Holiday () SoundTracks on IMDb: Memorable quotes and exchanges from movies, TV series and more Written by Hans Zimmer. Tara Theme ( ). 22 Jan Listen to The Holiday (Original Motion Picture Soundtrack) by Hans Zimmer on Deezer. With music streaming on Deezer you can discover more. 22 Aug Stream If I Wanted To Call You (The Holiday OST) - Hans Zimmer by Meima from desktop or your mobile device. 3 May - 4 min Watch Hans Zimmer - Maestro (The Holiday) by Stan Bayer on We Are Free - Hans Zimmer.
7 Dec Listen to and download the music, ost, score, list of songs and trailers. 6. 6 favorited. 21songs favorited; kviews; Hans Zimmercomposer. Free Hans Zimmer Anything Can Happen 07 The Holiday Ost MP3 download! Download your favorite tracks fast & simple with ZippyAudio from desktop or your . Hans Florian Zimmer is a German film score composer and record producer. Since the s, he has composed music for over films. His works include The. Find album reviews, stream songs, credits and award information for The Holiday [Original Motion Picture Soundtrack] - Hans Zimmer on AllMusic - - In.


text:
Q: Rails memcached: Where to begin? I read a few tutorials on getting memcached set up with Rails (2.3.5), and I'm a bit lost.
Here's what I need to cache:
I have user-specific settings that are stored in the db. The settings are queried in the ApplicationController meaning that a query is running per-request.
I understand that Rails has built-in support for SQL cacheing, however the cacheing only lasts for the duration of an Action.
I want an easy way to persist the settings (which are also ActiveRecord models) for an arbitrary amount of time. Bonus points if I can also easily reset the cache anytime a setting changes.
thanks

A: Gregg Pollack of RailsEnvy did a series of "Scaling Rails" screencasts a while back, which are now free (thanks to sponsorship by NewRelic). You might want to start with episode 1, but episode 8 covers memcached specifically:
http://railslab.newrelic.com/2009/02/19/episode-8-memcached

A: Sounds like what you want is an object cache between the DB and ActiveRecord. The only decent one we've found so far is Identity Cache (https://github.com/Shopify/identity_cache). It's brand new so it's a bit rough around the edges, but gets the job done for basic caching.

redpajama_set_name: RedPajamaStackExchange


United States Magistrate Judge John C. Nivison wrote that with respect to the expert witness fee, Plaintiff sought to recover $9,455 paid to an expert witness. Defendant argued that the expert witness fee should be reduced to account for vague billing entries, excessive billing, and Plaintiff's limited success in the case.
Plaintiff retained an expert witness to opine that her health conditions were serious conditions entitled to protection under state and federal disability law, and that her conditions reasonably would have rendered Plaintiff unable to perform her work responsibilities during the relevant time. The medical expert opined, inter alia, that Plaintiff's symptoms on the morning in question were the product of a health condition and rendered Plaintiff unable to perform her job at that time.
The expert billed for a total of 42.58 hours on the case and voluntarily reduced his fee by $3,320. The amount requested, $9,455, reflected the reduction.
Given that Defendant successfully challenged a portion of the expert's expected testimony, a further reduction of the fee incurred prior to the filing of the motion in limine was appropriate, Judge Nivison held. Thus, the judge reduced the pre-motion amount by 30% ($1,440). As such, the amount allowed for the expert witness fee was $8,015.
Judge Nivison went on to opine that provided Plaintiff qualified as a "prevailing party," the Rehabilitation Act, 29 U.S.C. § 794a(b), and the Americans with Disabilities Act, 42 U.S.C. § 12205, authorize courts to award a reasonable attorney fee, litigation expenses, and costs.
"When used in a federal fee-shifting statute, 'the term "prevailing party" [is] a legal term of art,'" the judge held, citing precedent.
"The concepts that shape the term apply broadly to the entire universe of federal fee-shifting statutes." To qualify as a prevailing party, the judge explained that a litigant must show that a material alteration of the parties' legal relationship has taken place as a result of the litigation.
By receiving a judgment in her favor on the merits, Judge Nivison held that Plaintiff qualified as a prevailing party.
Because Plaintiff prevailed on her claims under the Family Medical Leave Act and the Maine Family Medical Requirements, she was entitled to recover a reasonable attorney fees and other costs, including expert witness fees.