text:
"""ReachHost manages low level communication with a Reach Host."""

import queue
import threading
import time
from typing import List, Dict, Optional, Tuple, Set, TypeVar, Callable

from pyreach import host
from pyreach.common.python import types_gen
from pyreach.core import PyReachError
from pyreach.impl import client as cli
from pyreach.impl import device_base
from pyreach.impl import machine_interfaces
from pyreach.impl import thread_util
from pyreach.impl import utils

T = TypeVar("T")

class Ping(device_base.DeviceBase):
  """Device that manages Ping request."""

  _send_ts: Optional[int]
  _send_tag: Optional[str]
  _ping_time: Optional[float]
  _server_offset_time: Optional[float]
  _server_offset_time_store: List[float]
  _lock: threading.Lock

  def __init__(self) -> None:
    """Construct a ping device."""
    super().__init__()
    self._send_ts = None
    self._send_tag = None
    self._ping_time = None
    self._server_offset_time = None
    self._server_offset_time_store = []
    self._lock = threading.Lock()

  def on_start(self) -> None:
    """Invoke when ping device is started."""
    self.poll(1.0, self._on_poll)

  def _on_poll(self) -> bool:
    with self._lock:
      if self._send_ts is not None:
        if self._send_tag is None:
          if utils.timestamp_now() - self._send_ts < 1000:
            return False
        else:
          if utils.timestamp_now() - self._send_ts < 15000:
            return False
      self._send_ts = utils.timestamp_now()
      self._send_tag = utils.generate_tag()
      self.send_cmd(
          types_gen.CommandData(
              ts=self._send_ts,
              device_type="ping",
              data_type="ping",
              tag=self._send_tag))
    return False

  def on_message(self, data: types_gen.DeviceData) -> None:
    """Invoke when a device data message is received."""
    with self._lock:
      if self._send_tag and self._send_ts and self._send_tag == data.tag:
        # Read the receive timestamp as either the current clock value, or the
        # local_ts if the device data has a local_ts value which stores the
        # receive time upstream of PyReach, improving calculation accuracy.
        recv_ts = utils.timestamp_now()
        if data.local_ts <= 0:
          recv_ts = data.local_ts
        estimated_server_ts = int((recv_ts + self._send_ts) / 2)
        server_offset_time = (data.ts - estimated_server_ts) / 1000.0
        self._server_offset_time_store.append(server_offset_time)
        while len(self._server_offset_time_store) > 120:
          self._server_offset_time_store = self._server_offset_time_store[1:]
        self._server_offset_time = (
            sum(self._server_offset_time_store) /
            len(self._server_offset_time_store))
        self._ping_time = (self._send_ts - recv_ts) / 1000.0
        self._send_tag = None

  def get_ping_time(self) -> Optional[float]:
    """Return the latest ping time."""
    with self._lock:
      return self._ping_time

  def get_server_offset_time(self) -> Optional[float]:
    """Return the offset to the server time.

    Returns:
      The offset to the server-side time, or None if it could not be computed.
    """
    with self._lock:
      return self._server_offset_time

class SessionManager(device_base.DeviceBase):
  """A class manages a session with the client."""

  _lock: threading.Lock
  _state: host.SessionState
  _last_request: Optional[float]
  _last_request_start: Optional[float]
  _last_request_end: Optional[float]
  _should_take_control: bool
  _should_release_control: bool
  _callback_manager: "thread_util.CallbackManager[host.SessionState]"

  def __init__(self, should_take_control: bool,
               should_release_control: bool) -> None:
    """Init the SessionManager.

    Args:
      should_take_control: If true, will try to start a control session.
      should_release_control: If true, will force release of control session.
    """
    super().__init__()
    self._lock = threading.Lock()
    self._state = host.SessionState.UNKNOWN
    self._last_request = None
    self._last_request_start = None
    self._last_request_end = None
    self._should_take_control = should_take_control
    self._should_release_control = should_release_control
    self._callback_manager = thread_util.CallbackManager()

  def on_start(self) -> None:
    """Invoke on startup."""
    self.poll(1.0, self._on_poll)

  def _on_poll(self) -> bool:
    """Manage session state updates and requests for session states."""
    with self._lock:
      if self._state == host.SessionState.SHUTDOWN:
        return False
      if self._state == host.SessionState.UNKNOWN:
        if not self._last_request or (time.time() - self._last_request) > 15:
          self._last_request = time.time()
          self.send_cmd(
              types_gen.CommandData(
                  ts=utils.timestamp_at_time(self._last_request),
                  device_type="session-manager",
                  data_type="connected-clients-request"))
      elif (self._should_take_control and
            (self._state == host.SessionState.EVICTABLE or
             self._state == host.SessionState.INACTIVE)):
        if (not self._last_request_start or
            (time.time() - self._last_request_start) > 15):
          self._last_request_start = time.time()
          self.send_cmd(
              types_gen.CommandData(
                  ts=utils.timestamp_at_time(self._last_request_start),
                  device_type="operator",
                  data_type="session-info",
                  session_info=types_gen.SessionInfo()))
      elif ((not self._should_take_control) and self._should_release_control and
            self._state == host.SessionState.ACTIVE):
        if (not self._last_request_end or
            (time.time() - self._last_request_end) > 15):
          self._last_request_end = time.time()
          self.send_cmd(
              types_gen.CommandData(
                  ts=utils.timestamp_at_time(self._last_request_end),
                  device_type="session-info",
                  data_type="session-info",
                  session_info=types_gen.SessionInfo()))
    return False

  def set_should_take_control(self, should_take_control: bool,
                              should_release_control: bool) -> None:
    """Set the take control flag of the SessionManager.

    Args:
      should_take_control: If true, will try to start a control session.
      should_release_control: If true, will force release of control session.
    """
    with self._lock:
      if (self._should_take_control != should_take_control or
          self._should_release_control != should_release_control):
        self._last_request_start = None
        self._last_request_end = None
      self._should_take_control = should_take_control
      self._should_release_control = should_release_control
    self._on_poll()

  def get_session_state(self) -> host.SessionState:
    """Get the session state of the host.

    Returns:
      The session state.
    """
    with self._lock:
      return self._state

  def wait_state(self,
                 state: host.SessionState,
                 timeout: Optional[float] = None) -> bool:
    """Wait for a specific state."""
    q: "queue.Queue[bool]" = queue.Queue()

    def cb(current_state: host.SessionState) -> bool:
      if state == current_state:
        q.put(True)
        return True
      return False

    def fcb() -> None:
      q.put(False)

    stop = self.add_update_callback(cb, fcb)

    if self.get_session_state() == state:
      stop()
      return True

    try:
      s = q.get(block=True, timeout=timeout)
    except queue.Empty:
      s = False

    stop()
    return s

  def on_message(self, msg: types_gen.DeviceData) -> None:
    """Process DeviceData when it is received.

    Args:
      msg: The Device Data to process.
    """
    if (msg.device_type != "session-manager" or msg.device_name or
        msg.data_type != "connected-clients"):
      return
    if msg.connected_clients is None:
      return
    update_state: Optional[host.SessionState] = None
    with self._lock:
      if self._state == host.SessionState.SHUTDOWN:
        return
      start_state = self._state
      current_index: Optional[int] = None
      session_index: Optional[int] = None
      i = 0
      for client in msg.connected_clients.clients:
        if current_index is None and client.is_current:
          current_index = i
        if session_index is None and client.control_session_active:
          session_index = i
        i += 1
      if current_index is None:
        self._state = host.SessionState.UNKNOWN
      else:
        if session_index is None:
          self._state = host.SessionState.INACTIVE
        elif session_index < current_index:
          self._state = host.SessionState.BLOCKED
        elif session_index > current_index:
          self._state = host.SessionState.EVICTABLE
        else:
          self._state = host.SessionState.ACTIVE
      if self._state != start_state:
        update_state = self._state
    self._on_poll()
    if update_state:
      self._callback_manager.call(update_state)

  def add_update_callback(
      self,
      callback: Callable[[host.SessionState], bool],
      finished_callback: Optional[Callable[[],
                                           None]] = None) -> Callable[[], None]:
    """Add a callback when new data is received.

    Args:
      callback: triggers when new data is received.
      finished_callback: triggers when update is finished.

    Returns:
      Returns a function when called stops the callback.
    """
    return self._callback_manager.add_callback(callback, finished_callback)

  def on_close(self) -> None:
    """Invoke when the system is closed."""
    with self._lock:
      self._state = host.SessionState.SHUTDOWN
    self._callback_manager.call(host.SessionState.SHUTDOWN)
    self._callback_manager.close()

class KeyValueReader(device_base.DeviceBase):
  """Reads a key value of the robot."""
  _key: device_base.KeyValueKey
  _callback_manager: thread_util.CallbackManager[str]
  _value: Optional[str]

  def __init__(self, key: device_base.KeyValueKey) -> None:
    """Initialize the key-value reader.

    Args:
      key: The key to read from.
    """
    super().__init__()
    self._key = key
    self._value = None
    self._callback_manager = thread_util.CallbackManager()

  def get_key_values(self) -> Set[device_base.KeyValueKey]:
    """Return the key used to load a calibration from the settings engine."""
    return {self._key}

  def on_set_key_value(self, key: device_base.KeyValueKey, value: str) -> None:
    """Process the value to set the local value.

    Args:
      key: The key for the key/value pair as a KeyValueKey.
      value: The value of the key/value pair.
    """
    if key.device_type != self._key.device_type:
      return
    if key.device_name != self._key.device_name:
      return
    if key.key != self._key.key:
      return None
    self._value = value
    self._callback_manager.call(self._value)

  def add_update_callback(
      self,
      callback: Callable[[str], bool],
      finished_callback: Optional[Callable[[],
                                           None]] = None) -> Callable[[], None]:
    """Add a callback when new data is received.

    Args:
      callback: triggers when new data is received.
      finished_callback: triggers when update is finished.

    Returns:
      Returns a function when called stops the callback.
    """
    return self._callback_manager.add_callback(callback, finished_callback)

  @property
  def value(self) -> Optional[str]:
    """Name gets the current value.

    Returns:
      The current value, or none if it is not loaded.
    """
    return self._value

  def wait_for_value(self) -> Optional[str]:
    """Wait for value waits for the value to load.

    Returns:
      The current value, or none if it is not loaded.
    """
    q: "queue.Queue[None]" = queue.Queue()

    def drop_callback(unused_value: str) -> bool:
      return True

    def finished_callback() -> None:
      q.put(None)

    stop = self._callback_manager.add_callback(drop_callback, finished_callback)
    value = self.value
    if value is None:
      q.get()
      value = self.value
    stop()
    return value

  def on_close(self) -> None:
    """Invoke when the system is closed."""
    self._callback_manager.close()

class ReachHost:
  """A class that represents the Reach Host."""

  _devices: List[device_base.DeviceBase]
  _ping_device: Optional[Ping]
  _session_manager: Optional[SessionManager]
  _host_id_reader: KeyValueReader
  _display_name_reader: KeyValueReader
  _thread: threading.Thread
  _take_control_at_start: bool
  _is_closed: bool
  _is_playback: bool

  def __init__(
      self,
      client: cli.Client,
      devices: List[device_base.DeviceBase],
      take_control_at_start: bool = True,
      initial_messages: Optional[List[Optional[types_gen.DeviceData]]] = None
  ) -> None:
    """Construct a ReachHost instance.

    Args:
      client: The Client to use.
      devices: The list of Devices supported.
      take_control_at_start: If True, immediately take control.
      initial_messages: A list of initial request messages.
    """
    self._is_closed = False
    self._is_playback = isinstance(client, cli.PlaybackClient)
    self._client = client
    self._devices = devices.copy()
    self._take_control_at_start = take_control_at_start
    self._ping_device = None
    self._session_manager = None
    if not self._is_playback:
      self._ping_device = Ping()
      self._devices.append(self._ping_device)
      self._session_manager = SessionManager(take_control_at_start, False)
      self._devices.append(self._session_manager)
    self._host_id_reader = KeyValueReader(
        device_base.KeyValueKey(
            device_type="settings-engine", device_name="", key="robot-name"))
    self._devices.append(self._host_id_reader)
    self._display_name_reader = KeyValueReader(
        device_base.KeyValueKey(
            device_type="settings-engine", device_name="", key="display-name"))
    self._devices.append(self._display_name_reader)
    for device in self._devices:
      device.set_send_cmd(self._send_to_client)
    self._thread = threading.Thread(
        name="host_thread", target=self._run_thread, args=(initial_messages,))

  def start(self) -> None:
    """Start the host."""
    success = False
    self._thread.start()
    try:
      if self._take_control_at_start:
        self.wait_for_control()
      self._host_id_reader.wait_for_value()
      self._display_name_reader.wait_for_value()
      success = True
    finally:
      if not success:
        self.close()

  def set_machine_interfaces(
      self, interfaces: Optional[machine_interfaces.MachineInterfaces]) -> None:
    """Set the machine interface settings.

    Args:
      interfaces: the machine interfaces discovered.
    """
    for device in self._devices:
      device.set_machine_interfaces(interfaces)

  def get_ping_time(self) -> Optional[float]:
    """Return the latest ping time.

    Returns:
      Returns the latest ping time or None if no ping time is available.

    """
    if not self._ping_device:
      return None
    return self._ping_device.get_ping_time()

  def get_server_offset_time(self) -> Optional[float]:
    """Return the offset to the server time.

    Returns:
      The offset to the server-side time, or None if it could not be computed.
    """
    if not self._ping_device:
      return None
    return self._ping_device.get_server_offset_time()

  def set_should_take_control(self,
                              should_take_control: bool,
                              should_release_control: bool = False) -> None:
    """Set the should take control flag.

    Args:
      should_take_control: If true, will try to start a control session.
      should_release_control: If true, will force release of control session.
    """
    if self._session_manager:
      self._session_manager.set_should_take_control(should_take_control,
                                                    should_release_control)

  def wait_for_control(self, timeout: Optional[float] = None) -> bool:
    """Wait until the session becomes active.

    Args:
      timeout: timeout for time to wait for state.

    Returns:
      True if have taken control, false otherwise.
    """
    if self._session_manager:
      return self._session_manager.wait_state(
          host.SessionState.ACTIVE, timeout=timeout)
    return True

  def wait_for_session_state(self,
                             state: host.SessionState,
                             timeout: Optional[float] = None) -> bool:
    """Wait for a specific session state.

    Args:
      state: the state to wait for.
      timeout: timeout for time to wait for state.

    Returns:
      True if have entered the state, false otherwise.
    """
    if self._session_manager:
      return self._session_manager.wait_state(state, timeout=timeout)
    return True

  def get_session_state(self) -> host.SessionState:
    """Get the session state of the host.

    Returns:
      The session state.
    """
    if self._session_manager:
      return self._session_manager.get_session_state()
    return host.SessionState.PLAYBACK

  def add_session_state_callback(
      self,
      callback: Callable[[host.SessionState], bool],
      finished_callback: Optional[Callable[[],
                                           None]] = None) -> Callable[[], None]:
    """Add a callback when new a session state is received.

    Args:
      callback: triggers when new a session state is received.
      finished_callback: triggers when update is finished.

    Returns:
      Returns a function when called stops the callback.
    """
    if self._session_manager:
      return self._session_manager.add_update_callback(callback,
                                                       finished_callback)

    def empty_function() -> None:
      pass

    return empty_function

  def _send_to_client(self, msg: types_gen.CommandData) -> None:
    """Send CommandData message to client."""
    self._client.send_cmd(msg)

  def _read_from_client(
      self, timeout: float) -> Tuple[List[types_gen.DeviceData], bool, int]:
    """Read a Device Data from the client.

    Args:
      timeout: The number of seconds until timing out.

    Returns:
      Returns a Tuple containing a list of DeviceData messages a flag, and
      the number of tasks from the queue. The flag is True if client is still
      open and False if closed.
    """
    msgs: List[types_gen.DeviceData] = []
    tasks_to_complete = 0
    # Clear the queue of all messages
    while True:
      try:
        msg = self._client.get_queue().get(block=False)
        tasks_to_complete += 1
        if msg is None:
          return msgs, False, tasks_to_complete
        msgs.append(msg)
      except queue.Empty:
        break
    if timeout > 0 and not msgs:
      try:
        msg = self._client.get_queue().get(block=True, timeout=timeout)
        tasks_to_complete += 1
        if msg is None:
          return msgs, False, tasks_to_complete
        msgs.append(msg)
      except queue.Empty:
        pass
    return msgs, True, tasks_to_complete

  def _complete_tasks(self, tasks_to_complete: int) -> None:
    if self._is_playback:
      q = self._client.get_queue()
      for _ in range(tasks_to_complete):
        q.task_done()

  def _flush(self) -> None:
    self._client.get_queue().join()
    for dev in self._devices:
      dev.flush()

  def flush(self) -> None:
    """Flush all data from the queues."""
    if not self._is_playback:
      raise PyReachError("flush is only supported for playback clients.")
    client = self._client
    assert isinstance(client, cli.PlaybackClient)
    client.with_queue_lock(self._flush)

  def _run_thread(
      self,
      initial_messages: Optional[List[Optional[types_gen.DeviceData]]]) -> None:
    """Thread to run the host device processing loop."""
    active: bool = True
    for dev in self._devices:
      dev.start()
    last_key_value_requests: Dict[device_base.KeyValueKey, float] = {}
    is_first = True
    tasks_to_complete = 0
    while active:
      self._complete_tasks(tasks_to_complete)
      # Get messages
      messages, active, tasks_to_complete = self._read_from_client(
          0.0 if is_first else 1.0)
      if is_first:
        if initial_messages:
          tasks_to_complete += len(initial_messages)
          messages = [m for m in initial_messages if m is not None] + messages
          if None in initial_messages:
            active = False
        is_first = False
      # Send to devices
      for dev in self._devices:
        for message in messages:
          dev.enqueue_device_data(message)
      # Send any key-value requests
      request_keys: Set[device_base.KeyValueKey] = set()
      for dev in self._devices:
        for kv in dev.get_key_values():
          if dev.get_key_value(kv) is None:
            request_keys.add(kv)
      remove_keys = set()
      for kv, request_time in last_key_value_requests.items():
        if time.time() > request_time + 15:
          remove_keys.add(kv)
      for kv in remove_keys:
        del last_key_value_requests[kv]
      for kv in request_keys:
        if kv in last_key_value_requests:
          continue
        last_key_value_requests[kv] = time.time()
        if not self._is_playback:
          self._send_to_client(
              types_gen.CommandData(
                  ts=utils.timestamp_now(),
                  tag=utils.generate_tag(),
                  device_type=kv.device_type,
                  device_name=kv.device_name,
                  data_type="key-value-request",
                  key=kv.key))
    self._complete_tasks(tasks_to_complete)
    for dev in self._devices:
      dev.close()
    self._client.close()
    self._is_closed = True

  def add_host_id_callback(
      self,
      callback: Callable[[str], bool],
      finished_callback: Optional[Callable[[],
                                           None]] = None) -> Callable[[], None]:
    """Add a callback when new a host id is received.

    Args:
      callback: triggers when new host id is received.
      finished_callback: triggers when update is finished.

    Returns:
      Returns a function when called stops the callback.
    """
    return self._host_id_reader.add_update_callback(callback, finished_callback)

  @property
  def host_id(self) -> Optional[str]:
    """Name gets the current host id of the robot.

    Returns:
      The current id of the host, or none if it is not loaded.
    """
    return self._host_id_reader.value

  def add_display_name_callback(
      self,
      callback: Callable[[str], bool],
      finished_callback: Optional[Callable[[],
                                           None]] = None) -> Callable[[], None]:
    """Add a callback when new a display name is received.

    Args:
      callback: triggers when new display name is received.
      finished_callback: triggers when update is finished.

    Returns:
      Returns a function when called stops the callback.
    """
    return self._display_name_reader.add_update_callback(
        callback, finished_callback)

  @property
  def display_name(self) -> Optional[str]:
    """Name gets the current display name of the robot.

    Returns:
      The current display name of the robot, or none if it is not loaded.
    """
    return self._display_name_reader.value

  def close(self) -> None:
    """Close the connect to the Reach Host."""
    self._client.close()
    self._thread.join()
    self._is_closed = True

  def wait(self) -> None:
    """Wait for the host to close."""
    self._thread.join()
    self._is_closed = True

  def is_closed(self) -> bool:
    """Determine if the host is closed."""
    return self._is_closed


text:
layout: post
permalink: /adobe-dreamweaver-theme-dtr
title: "Dark Dreamweaver Theme - dTR"
category: Dreamweaver
tags: color-scheme-dark-for-dreamweaver cs cs4 cs5 cs5-5 dark-dreamweaver-color-scheme dark-dreamweaver-color-theme dark-dreamweaver-syntax-coloring dark-dreamweaver-theme dreamweaver-color-scheme dreamweaver-cs5-dark-theme dreamweaver-cs5-5-dark-color dreamweaver-cs5-5-dark-color-theme dreamweaver-dark dreamweaver-dark-syntax dreamweaver-dark-theme dreamweaver-syntax-coloring dreaweaver theme-dark
---
# The Theme
Here is a second theme, named dTR after some recalled memories of a Return to Castle Wolfenstein clan, 'Doing Things Right.' The clan tags were bright and vibrant, just like this theme. Bright color for variables and reserved keywords, and dull colors for strings and constants. This one really helps you focus. Below, I have included a few screenshots of PHP, but it supports CSS, HTML, Javascript and XML. **Note:** Colors are a bit more brilliant than what the screenshots show.

# Download
You can download the files as follows:
- [Dreamweaver Giah Theme](http://www.highonphp.com/download/Dreamweaver CS5.5 dTR Theme.zip)

# Installation
I am going to be working on an installer but for the time being follow these steps:
- **On Windows:**
- Copy the file to: `%USERPROFILE%\Application Data\Adobe\Dreamweaver CS5.5\en_US\Configuration\CodeColoring\`

- **On Mac:**
- Copy the file to: `~/Library/Application Support/Adobe/Dreamweaver CS5.5/en_US/Configuration/CodeColoring/`
  The background color will need to be set to #0F1D20 or whatever you would prefer via the Preferences window.

Check out our other themes, [Aurza](http://www.highonphp.com/dark-dreamweaver-theme-aurza "Aurza")and [Giah](http://www.highonphp.com/adobe-dreamweaver-dark-color-scheme "Giah").

redpajama_set_name: RedPajamaGithub


text:
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class Sht1xSensor */

#ifndef _Included_Sht1xSensor
#define _Included_Sht1xSensor
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     Sht1xSensor
 * Method:    getTemperatureInFahrenheit
 * Signature: ()F
 */
JNIEXPORT jfloat JNICALL Java_Sht1xSensor_getTemperatureInFahrenheit
  (JNIEnv *, jobject);

/*
 * Class:     Sht1xSensor
 * Method:    getTemperatureInCelcius
 * Signature: ()F
 */
JNIEXPORT jfloat JNICALL Java_Sht1xSensor_getTemperatureInCelcius
  (JNIEnv *, jobject);

/*
 * Class:     Sht1xSensor
 * Method:    getHumidity
 * Signature: ()F
 */
JNIEXPORT jfloat JNICALL Java_Sht1xSensor_getHumidity
  (JNIEnv *, jobject);

#ifdef __cplusplus
}
#endif
#endif


text:
/*-------------------------------------------*/
/*------------- SWD6 Main CSS----------------*/
/*-------------------------------------------*/
.charsheet {
	background-image: url(https://cdn.pixabay.com/photo/2015/09/29/15/12/stars-964022_960_720.png); /*black space with tiny white stars*/
    background-color: black;
    background-repeat: repeat;
    color:white;
}

.charsheet .sheet-version::after {
    content: '2.15';
}

.charsheet label, h1, h2, h3{
    color:white;
}

.charsheet table{
    border-collapse:separate;
    border-spacing:4px;
}

.charsheet textarea{
    resize:none;
}

.charsheet .sheet-toppad{
    padding:2px;
}

.charsheet .sheet-section{
    border-top: 5px dotted white;
    padding:10px;
	width: 100%;
}

.charsheet .sheet-shipinfo span {
    display: inline-block;
    margin: 5px 10px 5px 10px;
}

.charsheet .sheet-flex-box{
	display: flex;
}
.charsheet .sheet-flex-col{
    flex: 1;
}

.charsheet input[type=number].sheet-pipnumber{
    width:33px;
}

.charsheet input[type=number].sheet-smallnumber{
    width:40px;
}

.charsheet input[type=number].sheet-smallshortnumber{
    width:40px;
    padding-top:2px;
    padding-bottom:2px;
    display: inline-block;
    float:right;
}
.charsheet input[type=number].sheet-shortnumber{
    padding-top:2px;
    padding-bottom:2px;
}

.charsheet input[type=number].sheet-mediumnumber{
    width:60px;
}

.charsheet input[type=number].sheet-credits,
.charsheet span.sheet-credits {
    width: 80px;
    padding-top: 2px;
    padding-bottom: 2px;
}

.charsheet input[type=text].sheet-smalltext{
    width:60px;
    margin:0px;
}

.charsheet input[type=text].sheet-mediumtext{
    width:80px;
    margin:0px;
}

.charsheet input[type=text].sheet-shorttext{
    padding-top:2px;
    padding-bottom:2px;
}

.charsheet input[type=text].sheet-skilltext{
    width:115px;
    padding:2px;
    margin-left:3px;
}

.charsheet .sheet-right{
    float:right;
}

.charsheet .sheet-left{
    float:left;
}

.charsheet .sheet-bold{
    font-size: 12pt;
    margin-bottom: 10px;
}

.charsheet span.sheet-num {
    background: white;
    color: black;
    border-radius: 2px;
    padding: 4px;
    margin: 5px;
    height: 28px;
    width: 50px;
}

.charsheet .sheet-tdborder{
    border: 2px solid white;
    vertical-align:top;
    width:330px;
    padding:5px;
    margin: 5px;
}

.charsheet .sheet-rightmargin{
    margin-right:0px;
}

.charsheet select.sheet-smallselect{
    width:60px;
    height:25px;
    padding-top:2px;
    padding-bottom:2px;
    margin:0px;
    display: inline-block;
    float:right;
}

.charsheet select.sheet-mediumselect{ /*Used for Wound levels dropdown select*/
    width:100px;
    height:25px;
    padding-top:2px;
    padding-bottom:2px;
    margin:0px;
    display: inline-block;
    float:right;
}

.charsheet label.sheet-areaLabel{
    margin:0px;
}
/*-----------------------------------------*/
/*----------Roll Buttons classes-----------*/

.charsheet button[type=roll].sheet-d6-dice::before {	/*new die changes die roller to d6*/
	font-family: 'dicefontd6',arial;
	content: 'F ';
	color: red;
}

.charsheet .sheet-forcebutton{
    width:90px;
    padding-right:5px;
}

.charsheet .sheet-redtxt{
	font-size: 8px;
    color: red;
    font-family: 'Arial';
}

/* writing the letter 't' with this font shows an impact icon signifying physical damage */
.charsheet button.sheet-physical{
    font-family: 'Pictos Custom';
}
/* writing the letter 'e' with this font shows e bolt icon signifying energy damage */
.charsheet button.sheet-energy{
    font-family: 'Pictos';
}

/*-------------------------------------------*/
/*-----Main Settings and hide classes--------*/
/*-----------(from GUMSHOE Official)---------*/

.charsheet .sheet-main-settings .sheet-input-row label {
	display: inline-block;
	width: auto;
}

.charsheet .sheet-main-settings .sheet-input-row input {
	margin-right: 30px;
}

.charsheet .sheet-main-settings .sheet-input-row select {
	width: 45%;
	margin-right: 15px;
}

input.sheet-main-options.sheet-options-flag + span,/*displays the cog icon*/
input[type=radio]:checked ~ .sheet-master-container input.sheet-options-flag + span {
	font-family: pictos;
	font-style: normal;
}

div.sheet-main-settings {
	display: none;
	position: relative;
	margin-left: 0;
}

input.sheet-options-flag:checked ~ div.sheet-main-settings {
	display: inline-block;
	width: 600px;
	height: 500px;
}

input.sheet-selector-switch ,
input.sheet-options-flag:checked ~ div.sheet-main-container {
	display: none;
}

/* all hide options using option menu checkboxes*/

.sheet-master-container .sheet-pc,
.sheet-master-container .sheet-npc,
.sheet-master-container .sheet-ship,
.sheet-master-container .sheet-shop-inventory {
    display: none;
}

input.sheet-toggle[value="0"] ~ .sheet-master-container .sheet-pc,
input.sheet-toggle[value="1"] ~ .sheet-master-container .sheet-npc,
input.sheet-toggle[value="2"] ~ .sheet-master-container .sheet-ship,
input.sheet-toggle[value="3"] ~ .sheet-master-container .sheet-shop-inventory {
    display: block;
}

input.sheet-background:checked  ~ .sheet-master-container .sheet-background-hide,
input.sheet-force:checked ~ .sheet-master-container .sheet-force-hide,
input.sheet-equipment:checked ~ .sheet-master-container .sheet-equipment-hide,
input.sheet-gmroll:checked ~ .sheet-master-container .sheet-gmroll-hide,
input.sheet-rollmod:checked ~ .sheet-master-container .sheet-rollmod,
input.sheet-rollmod:not(:checked) ~ .sheet-master-container .sheet-rollmod-no,
input.sheet-cptracker:checked ~ .sheet-master-container .sheet-cptracker-hide,
input.sheet-credittracker:checked ~ .sheet-master-container .sheet-credittracker-hide  {
	display: none;
}

/*-------------------------------------------*/
/*------------- General Styles---------------*/
/*------------(from GUMSHOE Official)--------*/

input[type=number]::-webkit-inner-spin-button {}

.sheet-master-container {
	position: relative;
	padding: 0;
	display: inline-block;
	background-image: url(https://cdn.pixabay.com/photo/2015/09/29/15/12/stars-964022_960_720.png); /*black space with tiny stars*/
    background-color: black;
    background-repeat: repeat;
}

.sheet-container {
	padding: 5px;
	margin-left: -25px;
	position: relative;
}

.sheet-main-container {
	display: inline-block;
	padding-top: 75px;
	margin-left: 0;
}

/*-------------------------------------------*/
/*------------- Options Toggles--------------*/
/*-----------(from GUMSHOE Official)---------*/

input.sheet-options-flag,
input.sheet-options-flag + span {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 15px;
	height: 15px;
}

input.sheet-options-flag {
	z-index: 99;
	opacity: 0;
}

input.sheet-options-flag + span {
	margin-top: 0px;
	display: none;
	white-space: nowrap;
	line-height: 15px;
	font-size: 17px;
	color: white;
	cursor: pointer;
}

input.sheet-options-flag.sheet-main-options {
	width: 30px;
	height: 30px;
	top: 20px;
	left: 20px;
	z-index: 3;
}

input.sheet-options-flag.sheet-main-options + span {
	width: 30px;
	height: 30px;
	top: 20px;
	left: 20px;
	font-size: 34px;
	z-index: 2;
	line-height: 30px;
	opacity: .5;
	display: block;
}

input.sheet-options-flag.sheet-main-options:hover + span {
	opacity: 1;
}

input.sheet-options-flag:checked + span {
	color: white;
	display: block;
}

input.sheet-selector-switch:checked ~ .sheet-master-container .sheet-content .sheet-options,
input.sheet-selector-switch:checked ~ .sheet-master-container .sheet-content .sheet-options-flag:checked ~ .sheet-display  {
	display: none;
}

input.sheet-selector-switch:checked ~ .sheet-master-container .sheet-content .sheet-options-flag:checked ~ .sheet-options {
	display: block;
}

/*-------------------------------------------*/
/*------------- Roll Templates---------------*/

/* ----------- BLUE -----------*/
.sheet-rolltemplate-blue table {
 width:100%;
 background-color:white;
 border:1px solid rgba(51, 51, 255,1);
}
.sheet-rolltemplate-blue caption {
 background-color:rgba(51, 51, 255,1);
 color:white;
 font-family:"Helvetica Neue",Helvetica,sans-serif;
 font-weight:600;
 text-align:center;
 font-size:1.1em;
 padding:5px;
}
.sheet-rolltemplate-blue td {
 padding:5px;
 line-height:1.4em;
 vertical-align:top;
}
.sheet-rolltemplate-blue td:first-child {
 font-weight:bold;
 text-align:right;
 min-width:50px;
 padding-right:10px;
}
.sheet-rolltemplate-blue tr:nth-child(even) {
 background-color:#eee;
}
/* ----------- GREEN -----------*/
.sheet-rolltemplate-green table {
 width:100%;
 background-color:white;
 border:1px solid rgba(0, 153, 51,1);
}
.sheet-rolltemplate-green caption {
 background-color:rgba(0, 153, 51,1);
 color:white;
 font-family:"Helvetica Neue",Helvetica,sans-serif;
 font-weight:600;
 text-align:center;
 font-size:1.1em;
 padding:5px;
}
.sheet-rolltemplate-green td {
 padding:5px;
 line-height:1.4em;
 vertical-align:top;
}
.sheet-rolltemplate-green td:first-child {
 font-weight:bold;
 text-align:right;
 min-width:50px;
 padding-right:10px;
}
.sheet-rolltemplate-green tr:nth-child(even) {
 background-color:#eee;
}
/* ----------- RED -----------*/
.sheet-rolltemplate-red table {
 width:100%;
 background-color:white;
 border:1px solid rgba(204, 0, 0,1);
}
.sheet-rolltemplate-red caption {
 background-color:rgba(204, 0, 0,1);
 color:white;
 font-family:"Helvetica Neue",Helvetica,sans-serif;
 font-weight:600;
 text-align:center;
 font-size:1.1em;
 padding:5px;
}
.sheet-rolltemplate-red td {
 padding:5px;
 line-height:1.4em;
 vertical-align:top;
}
.sheet-rolltemplate-red td:first-child {
 font-weight:bold;
 text-align:right;
 min-width:50px;
 padding-right:10px;
}
.sheet-rolltemplate-red tr:nth-child(even) {
 background-color:#eee;;
}
/* ----------- BLACK -----------*/
.sheet-rolltemplate-black table {
 width:100%;
 background-color:white;
 border:1px solid rgba(0, 0, 0,1);
}
.sheet-rolltemplate-black caption {
 background-color:rgba(0, 0, 0,1);
 color:white;
 font-family:"Helvetica Neue",Helvetica,sans-serif;
 font-weight:600;
 text-align:center;
 font-size:1.1em;
 padding:5px;
}
.sheet-rolltemplate-black td {
 padding:5px;
 line-height:1.4em;
 vertical-align:top;
}
.sheet-rolltemplate-black td:first-child {
 font-weight:bold;
 text-align:right;
 min-width:50px;
 padding-right:10px;
}
.sheet-rolltemplate-black tr:nth-child(even) {
 background-color:#eee;
}


text:
---
uid: SolidEdgeDraft.DraftDocument.ConductorTables
summary:
remarks:
example: [*content]
---
[!code-vb[Main](..\snippets\SolidEdgeDraft.DraftDocument.ConductorTables.vb]


text:
jQuery lightGallery
=============

Demo
----------------
[JQuery lightGallery demo](http://sachinchoolur.github.io/lightGallery/)

Description
----------------
JQuery lightGallery is a lightweight jQuery lightbox gallery for displaying image and video gallery

what's new
----------------
+   Animated thumbnails.
+   Local html5 video support
+   Custom Html inseted of caption and description.
+   Custom selector property insted of just child.
+   destroy() method.
+   isActive() to check gallery active state.
+   iframe support.
+   showAfterLoad settings to show content once it is fully loaded
+   Callback parameter(plugin).
+   HTML support. inline and external.
+   currentPagerPosition setting to set Position of selected thumbnail.
+   Show Thumbnail by default option.

Main Features
----------------

+    Responsive layout.
+    Touch support for mobile devices.
+    Animated thumbnails.
+    CSS transitions with jQuery fallback
+    Youtube Vimeo Video and html5 videos Support
+    Slide and Fade Effects
+    Chrome, Safari, Firefox, Opera, IE7+, IOS, Android, windows phone.
+    HTML iframe support.
+    Multiple instances on one page
+    Easily customizable via CSS and Settings
+    Lightweight (7kb) (minified)
+    Separate images for mobile devices
+    Can be extended with callbacks
+    Smart image preloading and code optimization
+    Keyboard Navigation for desktop
+    Font icon support

How to use lightGallery?
--------------------

### Bower

You can Install lightgallery using the [Bower](http://bower.io) package manager.

```sh
$ bower install lightgallery
```

### npm

You can also find lightgallery on [npm](http://npmjs.org).

```sh
$ npm install lightgallery
```

### The code ###
add the Following code to the <head> of your document.
```html
<link type="text/css" rel="stylesheet" href="css/lightGallery.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/lightGallery.js"></script>
// Do not include both lightGallery.js and lightGallery.min.js
```
### HTML Structure ###
Create ul and li elements and add the path of the image or video inside the data-src attributes which you wish to open within the lightGallery.
```html
<ul id="lightGallery">
  <li data-src="img/img1.jpg">
    <img src="img/thumb1.jpg" />
  </li>
  <li data-src="img/img2.jpg">
    <img src="img/thumb2.jpg" />
  </li>
  ...
</ul>
```
### Data attributes ###
```html
    <!-- the image/video source for mobile devices -->
    <li data-responsive-src="mobile1.jpg" > </li>
    <!-- the large version of your image/video -->
    <li data-src="img1.jpg" > </li>

    <!-- Custom html5 video html (will be inserted same like youtube vimeo videos) -->
    <li data-html="video html" /> </li>
    <!-- id or class name of an object(div) which contain your html. -->
    <li data-html="#inlineHtml" > </li>

    <!-- Custom html (Caption description comments ...) -->
    <li data-sub-html="<h3>My caption</h3><p>My description..</p>" /> </li>
    <!-- id or class name of an object(div) which contain your html. -->
    <li data-sub-html="#inlineSubHtml" > </li>

    <!-- If true your src will be displayed in an iframe.. -->
    <li data-iframe="true" data-src="http://www.w3schools.com/" > </li>
```
### Call lightGallery! ###
```html
<script type="text/javascript">
  $(document).ready(function() {
    $("#lightGallery").lightGallery();
  });
</script>
```
### Play with settings ###
```html
    <script type="text/javascript">
      $(document).ready(function() {
        $("#lightGallery").lightGallery({

          mode: 'slide',
          useCSS: true,
          cssEasing: 'ease', //'cubic-bezier(0.25, 0, 0.25, 1)',//
          easing: 'linear', //'for jquery animation',//
          speed: 600,
          addClass: '',

          closable: true,
          loop: false,
          auto: false,
          pause: 4000,
          escKey: true,
          controls: true,
          hideControlOnEnd: false,

          preload: 1, //number of preload slides. will exicute only after the current slide is fully loaded. ex:// you clicked on 4th image and if preload = 1 then 3rd slide and 5th slide will be loaded in the background after the 4th slide is fully loaded.. if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ...
          showAfterLoad: true,
          selector: null,
          index: false,

          lang: {
              allPhotos: 'All photos'
          },
          counter: false,

          exThumbImage: false,
          thumbnail: true,
          showThumbByDefault:false,
          animateThumb: true,
          currentPagerPosition: 'middle',
          thumbWidth: 100,
          thumbMargin: 5,

          mobileSrc: false,
          mobileSrcMaxWidth: 640,
          swipeThreshold: 50,
          enableTouch: true,
          enableDrag: true,

          vimeoColor: 'CCCCCC',
          videoAutoplay: true,
          videoMaxWidth: '855px',

          dynamic: false,
          dynamicEl: [],

          // Callbacks el = current plugin
          onOpen        : function(el) {}, // Executes immediately after the gallery is loaded.
          onSlideBefore : function(el) {}, // Executes immediately before each transition.
          onSlideAfter  : function(el) {}, // Executes immediately after each transition.
          onSlideNext   : function(el) {}, // Executes immediately before each "Next" transition.
          onSlidePrev   : function(el) {}, // Executes immediately before each "Prev" transition.
          onBeforeClose : function(el) {}, // Executes immediately before the start of the close process.
          onCloseAfter  : function(el) {}, // Executes immediately once lightGallery is closed.

        });
    });
    </script>
```

In-depth explanation of settings can be found on a [separate page](http://sachinchoolur.github.io/lightGallery/settings.html).

### Public methods ###
```html
    <script type="text/javascript">
    $(document).ready(function() {
        var gallery = $("#lightGallery").lightGallery();
        gallery.isActive(); //check active state of lightGallery;
        gallery.destroy(); //to destroy the plugin on the given element.
    });
    </script>
```


text:
cask "visual-paradigm-ce" do
  version "16.3,20211012"
  sha256 "31cba47822abb274afb979b36b084c7c72f79b4a6387e5ea47d5721d001784a6"

  url "https://www.visual-paradigm.com/downloads/vpce/Visual_Paradigm_CE_#{version.before_comma.dots_to_underscores}_#{version.after_comma}_OSX_WithJRE.dmg"
  name "Visual Paradigm Community Edition"
  desc "All-in-one UML, SysML, BPMN Modeling Platform for Agile"
  homepage "https://www.visual-paradigm.com/"

  livecheck do
    url "https://www.visual-paradigm.com/downloads/vpce/checksum.html"
    strategy :header_match do |headers|
      match = headers["location"].match(%r{/vpce(\d+(?:\.\d+)+)/(\d+)/checksum\.html}i)
      next if match.blank?

      "#{match[1]},#{match[2]}"
    end
  end

  # Renamed to avoid conflict with visual-paradigm.
  app "Visual Paradigm.app", target: "Visual Paradigm CE.app"
end


text:
/*
 * 	Core Owl Carousel CSS File
 *	v1.3.2
 */

/* clearfix */
.owl-carousel .owl-wrapper:after {
	content: ".";
	display: block;
	clear: both;
	visibility: hidden;
	line-height: 0;
	height: 0;
}
/* display none until init */
.owl-carousel {
	display: none;
	position: relative;
	width: 100%;
	padding:48px 0 0;
	-ms-touch-action: pan-y;
}
.owl-carousel .testim_slider {padding-top:30px;}
.owl-carousel .owl-wrapper{
	display: none;
	position: relative;
	-webkit-transform: translate3d(0px, 0px, 0px);
}
.owl-carousel .owl-wrapper-outer{
	overflow: hidden;
	position: relative;
	width: 100%;
}
.owl-carousel .owl-wrapper-outer.autoHeight{
	-webkit-transition: height 500ms ease-in-out;
	-moz-transition: height 500ms ease-in-out;
	-ms-transition: height 500ms ease-in-out;
	-o-transition: height 500ms ease-in-out;
	transition: height 500ms ease-in-out;
}

.owl-carousel .owl-item{
	float: left;
}
.owl-controls .owl-page,
.owl-controls .owl-buttons div{
	cursor: pointer;
}
.owl-controls {
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* mouse grab icon */
.grabbing {
    cursor:url(grabbing.png) 8 8, move;
}

/* fix */
.owl-carousel  .owl-wrapper,
.owl-carousel  .owl-item{
	-webkit-backface-visibility: hidden;
	-moz-backface-visibility:    hidden;
	-ms-backface-visibility:     hidden;
  -webkit-transform: translate3d(0,0,0);
  -moz-transform: translate3d(0,0,0);
  -ms-transform: translate3d(0,0,0);
}

/* Navigation */

.owl-theme .owl-controls{
	position:absolute;
	left:50%;
	top:-80px;
	width:100%;
	text-align: right;
	transform:translateX(-50%);
	-o-transform:translateX(-50%);
	-ms-transform:translateX(-50%);
	-webkit-transform:translateX(-50%);
}
.testimonials .owl-theme .owl-controls{top:-50px;}

.owl-theme .owl-controls .owl-buttons div {
	position:relative;
	z-index:1;
	display: inline-block;
	width:70px;
	height:70px;
	margin:0 0 0 -2px;
	border:2px solid #ccc;
	transition: all 0.3s ease-in-out;
	-webkit-transition: all 0.3s ease-in-out;
}
.owl-theme .owl-controls .owl-buttons div:hover {z-index:2; border-color:#052174;}
.owl-theme .owl-controls .owl-buttons div:before {
	position:absolute;
	left:0;
	top:0;
	width:68px;
	height:68px;
	font-family: FontAwesome;
	text-align:center;
	line-height:66px;
	font-size:32px;
	color:#ccc;
	transition: all 0.3s ease-in-out;
	-webkit-transition: all 0.3s ease-in-out;
}
.owl-theme .owl-controls .owl-buttons .owl-prev:before {content: "\f104";}
.owl-theme .owl-controls .owl-buttons .owl-next:before {content: "\f105";}
.owl-theme .owl-controls .owl-buttons div:hover:before {color:#333;}

/* Styling Pagination*/
.owl-theme .owl-controls .owl-pagination {height:14px;}
.owl-theme .owl-controls .owl-page{
	display: inline-block;
	vertical-align:top;
	margin-left:16px;
	zoom: 1;
	*display: inline;/*IE7 life-saver */
}
.owl-theme .owl-controls .owl-page span{
	display: block;
	width: 14px;
	height: 14px;
	margin: 0;
	border-radius: 50%;
	border:2px solid #052174;
}

.owl-theme .owl-controls .owl-page.active span {
	position:relative;
	top:-3px;
	bottom:-3px;
	width:20px;
	height:20px;
	background-color:#052174;
}

/* If PaginationNumbers is true */

.owl-theme .owl-controls .owl-page span.owl-numbers{
	height: auto;
	width: auto;
	color: #FFF;
	padding: 2px 10px;
	font-size: 12px;
	-webkit-border-radius: 30px;
	-moz-border-radius: 30px;
	border-radius: 30px;
}

/* preloading images */
.owl-item.loading{
	min-height: 150px;
	background: url(AjaxLoader.gif) no-repeat center center
}


text:
from django.conf.urls import patterns, include, url
from django.contrib import admin
import settings
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^', include('myPage.apps.main.urls')),
    url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root':settings.MEDIA_ROOT}),
)


text:
<?php

/**
 * Handles common AJAX operations.
 *
 * @since  4.6
 */
class Tribe__Ajax__Dropdown {

	/**
	 * Hooks the AJAX for Select2 Dropdowns
	 *
	 * @since  4.6
	 *
	 * @return void
	 */
	public function hook() {
		add_action( 'wp_ajax_tribe_dropdown', array( $this, 'route' ) );
		add_action( 'wp_ajax_nopriv_tribe_dropdown', array( $this, 'route' ) );
	}

	/**
	 * Search for Terms using Select2
	 *
	 * @since  4.6
	 *
	 * @param  string $search Search string from Select2
	 * @param  int    $page   When we deal with pagination
	 * @param  array  $args   Which arguments we got from the Template
	 * @param  string $source What source it is
	 *
	 * @return array
	 */
	public function search_terms( $search, $page, $args, $source ) {
		$data = array();

		if ( empty( $args['taxonomy'] ) ) {
			$this->error( esc_attr__( 'Cannot look for Terms without a taxonomy', 'tribe-common' ) );
		}

		// We always want all the fields so we overwrite it
		$args['fields'] = isset( $args['fields'] ) ? $args['fields'] : 'all';
		$args['hide_empty'] = isset( $args['hide_empty'] ) ? $args['hide_empty'] : false;

		if ( ! empty( $search ) ) {
			$args['search'] = $search;
		}

		// On versions older than 4.5 taxonomy goes as an Param
		if ( version_compare( $GLOBALS['wp_version'], '4.5', '<' ) ) {
			$terms = get_terms( $args['taxonomy'], $args );
		} else {
			$terms = get_terms( $args );
		}

		$results = array();

		// Respect the parent/child_of argument if set
		$parent = ! empty( $args['child_of'] ) ? (int) $args['child_of'] : 0;
		$parent = ! empty( $args['parent'] ) ? (int) $args['parent'] : $parent;

		if ( empty( $args['search'] ) ) {
			$this->sort_terms_hierarchically( $terms, $results, $parent );
			$results = $this->convert_children_to_array( $results );
		} else {
			foreach ( $terms as $term ) {
				// Prep for Select2
				$term->id          = $term->term_id;
				$term->text        = $term->name;
				$term->breadcrumbs = array();

				if ( 0 !== (int) $term->parent ) {
					$ancestors = get_ancestors( $term->id, $term->taxonomy );
					$ancestors = array_reverse( $ancestors );
					foreach ( $ancestors as $ancestor ) {
						$ancestor            = get_term( $ancestor );
						$term->breadcrumbs[] = $ancestor->name;
					}
				}

				$results[] = $term;
			}
		}

		$data['results'] = $results;
		$data['taxonomies'] = get_taxonomies();

		return $data;
	}

	/**
	 * Sorts Hierarchically all the Terms for Select2
	 *
	 * @since  4.6
	 *
	 * @param  array   &$terms Array of Terms from `get_terms`
	 * @param  array   &$into  Variable where we will store the
	 * @param  integer $parent Used for the recursion
	 *
	 * @return array
	 */
	public function sort_terms_hierarchically( &$terms, &$into, $parent = 0 ) {
		foreach ( $terms as $i => $term ) {
			if ( $term->parent === $parent ) {
				// Prep for Select2
				$term->id   = $term->term_id;
				$term->text = $term->name;

				$into[ $term->term_id ] = $term;
				unset( $terms[ $i ] );
			}
		}

		foreach ( $into as $term ) {
			$term->children = array();
			$this->sort_terms_hierarchically( $terms, $term->children, $term->term_id );
		}
	}

	/**
	 * Makes sure we have arrays for the JS data for Select2
	 *
	 * @since  4.6
	 *
	 * @param  array  $results  The Select2
	 *
	 * @return array
	 */
	public function convert_children_to_array( $results ) {
		if ( isset( $results->children ) ) {
			$results->children = $this->convert_children_to_array( $results->children );
		} else {
			foreach ( $results as $key => $item ) {
				$item = $this->convert_children_to_array( $item );
			}
		}

		if ( empty( $results ) ) {
			return array();
		}

		return array_values( (array) $results );
	}

	/**
	 * Parses the Params coming from Select2 Search box
	 *
	 * @since  4.6
	 *
	 * @param  array  $params Params to overwrite the defaults
	 * @return object
	 */
	public function parse_params( $params ) {
		$defaults = array(
			'search' => null,
			'page'   => 0,
			'args'   => array(),
			'source' => null,
		);

		$arguments = wp_parse_args( $params, $defaults );

		// Return Object just for the sake of making it simpler to read
		return (object) $arguments;
	}

	/**
	 * The default Method that will route all the AJAX calls from our Dropdown AJAX requests
	 * It is like a Catch All on `wp_ajax_tribe_dropdown` and `wp_ajax_nopriv_tribe_dropdown`
	 *
	 * @since  4.6
	 *
	 * @return void
	 */
	public function route() {
		// Push all POST params into a Default set of data
		$args = $this->parse_params( empty( $_POST ) ? array() : $_POST );

		if ( empty( $args->source ) ) {
			$this->error( esc_attr__( 'Missing data source for this dropdown', 'tribe-common' ) );
		}

		// Define a Filter to allow external calls to our Select2 Dropboxes
		$filter = sanitize_key( 'tribe_dropdown_' . $args->source );
		if ( has_filter( $filter ) ) {
			$data = apply_filters( $filter, array(), $args->search, $args->page, $args->args, $args->source );
		} else {
			$data = call_user_func_array( array( $this, $args->source ), (array) $args );
		}

		// if we got a empty dataset we return an error
		if ( empty( $data ) ) {
			$this->error( esc_attr__( 'Empty data set for this dropdown', 'tribe-common' ) );
		} else {
			$this->success( $data );
		}
	}

	/**
	 * Prints a success message and ensures that we don't hit bugs on Select2
	 *
	 * @since  4.6
	 *
	 * @param  array $data
	 * @return void
	 */
	private function success( $data ) {
		// We need a Results item for Select2 Work
		if ( ! isset( $data['results'] ) ) {
			$data['results'] = array();
		}

		wp_send_json_success( $data );
	}

	/**
	 * Prints a error message and ensures that we don't hit bugs on Select2
	 *
	 * @since  4.6
	 *
	 * @param  array $data
	 * @return void
	 */
	private function error( $message ) {
		$data = array(
			'message' => $message,
			'results' => array(),
		);
		wp_send_json_error( $data );
	}

	/**
	 * Avoid throwing fatals or notices on sources that are invalid
	 *
	 * @since  4.6
	 *
	 * @param  string $name
	 * @param  mixed  $arguments
	 *
	 * @return void
	 */
	public function __call( $name, $arguments ) {
		$message = __( 'The "%s" source is invalid and cannot be reached on "%s" instance.', 'tribe-common' );
		return $this->error( sprintf( $message, $name, __CLASS__ ) );
	}
}


text:
Welkom bij de SocketQuiz!

Gemaakt als onderdeel van Scripting 4 Designers

        <button ng-click="securityCheck('lobby')" class="btn-welkom">Start Quiz!</button>

Jacco Schumacher | Nico Ender | Sander Schekman


text:
from setuptools import setup, find_packages
from os import path
import codecs
import re

def read(*parts):
    file_path = path.join(path.dirname(__file__), *parts)
    return codecs.open(file_path, encoding='utf-8').read()

def find_version(*parts):
    version_file = read(*parts)
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
    if version_match:
        return str(version_match.group(1))
    raise RuntimeError("Unable to find version string.")

setup(
    name='django-threadedcomments',
    version=find_version('threadedcomments', '__init__.py'),
    license='BSD',

    description='A simple yet flexible threaded commenting system.',
    long_description=read('README.rst'),
    keywords='django,comments,threading',

    author='Eric Florenzano',
    author_email='floguy@gmail.com',

    maintainer='Diederik van der Boor',
    maintainer_email='vdboor@edoburu.nl',

    url='https://github.com/HonzaKral/django-threadedcomments',
    download_url='https://github.com/HonzaKral/django-threadedcomments/zipball/master',

    packages=find_packages(exclude=('example*',)),
    include_package_data=True,

    zip_safe=False,
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ]
)


text:
// ********************************************************************************************************
// Product Name: DotSpatial.Controls.dll
// Description:  The Windows Forms user interface controls like the map, legend, toolbox, ribbon and others.
// ********************************************************************************************************
//
//
// The Initial Developer of this Original Code is Ted Dunsford. Created 8/29/2010 12:39:30 PM
//
// Contributor(s): (Open source contributors should list themselves and their modifications here).
//
//       Name     |    Date    |                          Comments
// ---------------|------------|--------------------------------------------------------------------------
// ********************************************************************************************************

using System.Drawing;
using System.Windows.Forms;

namespace DotSpatial.Controls
{
    /// <summary>
    /// This is a glyph on the map that if you click on it, it will launch the PluginDialog.
    /// </summary>
    public class MapFunctionGlyph : MapFunction
    {
        /// <summary>
        /// This is the cursor that was the cursor before we did anything.
        /// </summary>
        private Cursor _previousCursor;

        /// <summary>
        /// Creates a new instance of the GlyphFunction
        /// </summary>
        public MapFunctionGlyph()
        {
            YieldStyle = YieldStyles.AlwaysOn;
            Cursor = Cursors.Hand;
        }

        /// <summary>
        /// Creates a new instance of a GLyphFunction with the specified Map
        /// </summary>
        /// <param name="map"></param>
        public MapFunctionGlyph(Map map)
            : base(map)
        {
            YieldStyle = YieldStyles.AlwaysOn;
            Cursor = Cursors.Hand;
        }

        /// <summary>
        /// The cursor to use when the mouse is over this glyph.
        /// </summary>
        public Cursor Cursor { get; set; }

        /// <summary>
        /// This should be overridden by the specific glyph so they don't overlap and appear where they should.
        /// </summary>
        public virtual Rectangle GlpyhBounds
        {
            get { return new Rectangle(Map.Bounds.Right - 25, Map.Bounds.Bottom - 25, 25, 25); }
        }

        /// <summary>
        /// Gets or sets a Boolean indicating whether or not this glyph currently holds the mouse
        /// </summary>
        public bool HasMouse { get; set; }

        /// <summary>
        /// Unless the OnDrawGlyphLit method is overridden, this is drawn when the mouse is over the image.
        /// </summary>
        public Image LitImage { get; set; }

        /// <summary>
        /// Unless the OnDrawGlyph method is overridden, this is drawn.  If no LitImage is specified,
        /// then this image will be drawn also for the LitImage case.
        /// </summary>
        public Image NormalImage { get; set; }

        /// <summary>
        /// Draws the glyph on the map.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnDraw(MapDrawArgs e)
        {
            Rectangle glyph = GlpyhBounds;
            Bitmap bmp = new Bitmap(glyph.Width, glyph.Height);
            Graphics g = Graphics.FromImage(bmp);
            if (e.ClipRectangle.IntersectsWith(glyph))
            {
                Rectangle r = Rectangle.Intersect(e.ClipRectangle, glyph);
                r.X -= glyph.X;
                r.Y -= glyph.Y;
                if (HasMouse)
                {
                    OnDrawGlyphLit(new PaintEventArgs(g, r));
                }
                else
                {
                    OnDrawGlyph(new PaintEventArgs(g, r));
                }
            }
            e.Graphics.DrawImageUnscaled(bmp, glyph.X, glyph.Y);
            base.OnDraw(e);
        }

        /// <summary>
        /// The drawing space is only the size of the GlyphBounds.
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnDrawGlyph(PaintEventArgs e)
        {
            if (NormalImage == null)
            {
                return;
            }
            e.Graphics.DrawImageUnscaled(NormalImage, 0, 0);
        }

        /// <summary>
        /// When the mouse moves over a glyph, it should light up or change to show it is clickable.
        /// </summary>
        protected virtual void OnDrawGlyphLit(PaintEventArgs e)
        {
            if (LitImage == null)
            {
                if (NormalImage == null)
                {
                    return;
                }
                e.Graphics.DrawImageUnscaled(NormalImage, 0, 0);
                return;
            }
            e.Graphics.DrawImageUnscaled(LitImage, 0, 0);
        }

        /// <summary>
        /// Occurs when the mouse clicks on the glyph
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnGlpyhClick(GeoMouseArgs e)
        {
        }

        /// <summary>
        /// Occurs when the mouse leaves the glyph
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnGlyphMouseEnter(GeoMouseArgs e)
        {
            HasMouse = true;
            _previousCursor = Map.Cursor;
            Map.Invalidate(GlpyhBounds);
            Map.Cursor = Cursor;
        }

        /// <summary>
        /// Occurs when the mouse enters the glyph
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnGlyphMouseLeave(GeoMouseArgs e)
        {
            HasMouse = false;
            Map.Invalidate(GlpyhBounds);
            if (_previousCursor != null)
            {
                Map.Cursor = _previousCursor;
            }
        }

        /// <summary>
        /// Even though we don't take action here, we need to indicate that we handled the event so that the other
        /// functions that my be active don't do anything for this part.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMouseDown(GeoMouseArgs e)
        {
            Rectangle glyph = GlpyhBounds;
            if (glyph.Contains(e.Location))
            {
                // whether they do anything or not, the glyph is the only thing that should happen in this window.
                e.Handled = true;
            }
        }

        /// <inheritdoc/>
        protected override void OnMouseMove(GeoMouseArgs e)
        {
            Rectangle glyph = GlpyhBounds;
            if (glyph.Contains(e.Location))
            {
                if (!HasMouse)
                {
                    HasMouse = true;
                    OnGlyphMouseEnter(e);
                }
                e.Handled = true;
            }
            else
            {
                if (HasMouse)
                {
                    HasMouse = false;
                    OnGlyphMouseLeave(e);
                }
            }
        }

        /// <inheritdoc/>
        protected override void OnMouseUp(GeoMouseArgs e)
        {
            Rectangle glyph = GlpyhBounds;
            if (glyph.Contains(e.Location))
            {
                OnGlpyhClick(e);
                // whether they do anything or not, the glyph is the only thing that should happen in this window.
                e.Handled = true;
            }
        }
    }
}


text:
require 'aruba/cucumber'

Before do
  @dirs = ['.']
  Dir.mkdir("outputs") unless Dir.exists?("outputs")
  Dir.entries("outputs").each do |entry|
    if not ['.', '..'].include? entry then
      File.unlink "outputs/%s" % [
          entry
      ]
    end
  end
end

After do
  File.delete "sample.csv"
end


text:
describe('Todo component tests', () => {
    let $componentController;

    beforeEach(angular.mock.module('todoListApp'));

    beforeEach(inject(_$componentController_ => {
        $componentController = _$componentController_;
    }));

    it('should expose a `todo` object', () => {
        const bindings = {item: {id: 1, title: ''}};
        const controller = $componentController('todo', null, bindings);

        expect(controller.item).toEqual(bindings.item);
    });

    it('should call the `#onToggle` binding, when #handleToggle calling', () => {
        const onToggle = jasmine.createSpy('onToggle');
        const bindings = {item: {}, onToggle};
        const controller = $componentController('todo', null, bindings);

        controller.handleToggle();

        expect(onToggle).toHaveBeenCalledWith({
            todo: controller.item
        });
    });

    it('should call the `#onRemove` binding, when #handleRemove calling', () => {
        const onRemove = jasmine.createSpy('onRemove');
        const bindings = {item: {}, onRemove};
        const controller = $componentController('todo', null, bindings);

        controller.handleRemove();

        expect(onRemove).toHaveBeenCalledWith({
            todo: controller.item
        });
    });
});


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#include "pch.h"
#include "Component.Contracts.KeyValuePairTesting.h"
#include <utility>
#include <vector>

template<typename K, typename V>
struct pair_wrapper : winrt::implements<pair_wrapper<K, V>, winrt::Windows::Foundation::Collections::IKeyValuePair<K, V>>
{
    pair_wrapper(const K& key, const V& value)
        :key{ key },
        value{ value }
    {}

    K Key()
    {
        return key;
    }

    V Value()
    {
        return value;
    }

private:
    K key;
    V value;
};

namespace winrt::Component::Contracts::implementation
{
    Windows::Foundation::Collections::IKeyValuePair<int32_t, int32_t> KeyValuePairTesting::MakeSimplePair(int32_t key, int32_t value)
    {
        return make<pair_wrapper<int32_t, int32_t>>(key, value);
    }

    Windows::Foundation::Collections::IKeyValuePair<hstring, hstring> KeyValuePairTesting::MakeMarshaledPair(hstring const& key, hstring const& value)
    {
        return make<pair_wrapper<hstring, hstring>>(key, value);
    }

    Windows::Foundation::Collections::IKeyValuePair<int32_t, Windows::Foundation::Collections::IIterable<int32_t>> KeyValuePairTesting::MakeProjectedPair(int32_t key, array_view<int32_t const> values)
    {
        return pair_wrapper<int32_t, Windows::Foundation::Collections::IIterable<int32_t>>{key, winrt::single_threaded_vector(std::vector<int32_t>(values.begin(), values.end()))};
    }
}


text:
./autogen.sh
./configure \
--prefix=$PWD/build \
--enable-shared=no


text:
<?php
/**
 * INTERNATIONALIZATION / LOCALIZATION
 */
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly
}

add_action( 'init', 'bodhi_svgs_localization' );

function bodhi_svgs_localization() {
	load_plugin_textdomain( 'svg-support', false, basename( dirname( __FILE__ ) ) . '/languages' );

}

?>


text:
package livelance.app.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import livelance.app.model.Category;
import livelance.app.model.list.CategoryList;
import livelance.app.repository.CategoryRepository;
import livelance.app.service.CategoryService;

@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class JpaCategoryService implements CategoryService {

	private Logger logger = LoggerFactory.getLogger(this.getClass());

	@Autowired
	CategoryRepository categoryRepository;

	@Override
	public CategoryList findAll() {
		logger.info("> findAll");
		CategoryList categories = new CategoryList(categoryRepository.findAll());
		logger.info("< findAll");
		return categories;
	}

	@Override
	@Cacheable(value = "categories", key = "#id")
	public Category findOne(Long id) {
		logger.info("> findOne id:{}", id);
		Category category = categoryRepository.findOne(id);
		if (category == null) {
			logger.error("Category not found.");
		}
		logger.info("< findOne id:{}", id);
		return category;
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	@CachePut(value = "categories", key = "#result.id")
	public Category save(Category category) {
		logger.info("> save");
		if(category == null) {
			return null;
		}
		Category savedCategory = categoryRepository.save(category);
		logger.info("< save");
		return savedCategory;
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	@CacheEvict(value = "categories", key = "#id")
	public Category delete(Long id) {
		logger.info("> delete id:{}", id);

		Category found = findOne(id);
		if (found == null) {
			logger.error("Attempted to delete a Category, but the entity does not exist.");
		} else {
			categoryRepository.delete(found);
		}
		logger.info("< delete id:{}", id);
		return found;
	}

	@Override
	@Cacheable(value = "categories", key = "#name")
	public CategoryList findByName(String name) {
		logger.info("> findByName name:{}", name);
		CategoryList categories = new CategoryList(categoryRepository.findByName(name));
		logger.info("< findByName deal:{}", name);
		return categories;
	}

	@Override
	@Cacheable(value = "categories", key = "#name")
	public CategoryList findByNameLike(String name) {
		logger.info("> findByNameLike name:{}", name);

		CategoryList categories = new CategoryList(categoryRepository.findByNameLike("%" + name + "%"));

		logger.info("< findByNameLike deal:{}", name);
		return categories;
	}

	@Override
    @CacheEvict(
            value = "categories",
            allEntries = true)
    public void evictCache() {
        logger.info("> evictCache");
        logger.info("< evictCache");
    }
}


text:
( function() {
	'use strict';

	describe( 'vui-accordion', function() {

		var node, accordion, $accordion,
			header1, heading1, content1,
			header2, heading2, content2,
			header3, heading3, content3, toggle3, toggleIcon3;

		var expectExpanded = function( header, content ) {

			expect( header ).toHaveClassName( 'vui-accordion-panel-expanded' );
			expect( header.getAttribute( 'aria-expanded' ) ).toBe( 'true' );
			expect( content ).not.toHaveDisplay( 'none' );
			expect( content.getAttribute( 'aria-hidden' ) ).toBe( 'false' );

		};

		var expectCollapsed = function( header, content ) {
			expect( header ).not.toHaveClassName( 'vui-accordion-panel-expanded' );
			expect( header.getAttribute( 'aria-expanded' ) ).toBe( 'false' );
			expect( content ).toHaveDisplay( 'none' );
			expect( content.getAttribute( 'aria-hidden' ) ).toBe( 'true' );
		};

		var createKeyEvent = function( eventType, keyCode ) {
			var e = $.Event( eventType );
			e.keyCode = keyCode;
			return e;
		};

		beforeEach( function () {

			// turn off jquery fx since they will can introduce timing issues when making our expectations
			$.fx.off = true;

			jasmine.addMatchers( vui.jasmine.dom.matchers );

			node = document.body.appendChild( document.createElement( 'div' ) );
			node.className = 'vui-accordion';

			accordion = node.appendChild( document.createElement( 'div' ) );
			accordion.className = 'vui-accordion';
			accordion.setAttribute( 'data-display-mode', 'accordion' );

			header1 = accordion.appendChild( document.createElement( 'div' ) );
			header1.className = 'vui-accordion-header';
			header1.setAttribute( 'data-content-labelledby', 'heading1' );

			heading1 = header1.appendChild( document.createElement( 'h2' ) );
			heading1.id = 'heading1';
			heading1.innerHTML = 'This is heading 1.';

			content1 = accordion.appendChild( document.createElement( 'div' ) );
			content1.className = 'vui-accordion-content';

			content1.appendChild( document.createElement( 'p' ) ).innerHTML = 'This is content 1.';

			header2 = accordion.appendChild( document.createElement( 'div' ) );
			header2.className = 'vui-accordion-header';
			header2.setAttribute( 'data-content-id', 'content2' );
			header2.setAttribute( 'data-expanded', 'true' );
			header2.setAttribute( 'data-content-labelledby', 'heading2' );

			heading2 = header2.appendChild( document.createElement( 'h2' ) );
			heading2.id = 'heading2';
			heading2.innerHTML = 'This is heading 2.';

			content2 = accordion.appendChild( document.createElement( 'div' ) );
			content2.id = 'content2';
			content2.className = 'vui-accordion-content';

			content2.appendChild( document.createElement( 'p' ) ).innerHTML = 'This is content 2.';

			header3 = accordion.appendChild( document.createElement( 'div' ) );
			header3.className = 'vui-accordion-header';
			header3.setAttribute( 'data-content-labelledby', 'heading3' );

			toggle3 = header3.appendChild( document.createElement( 'div' ) );
			toggle3.className = 'vui-accordion-toggle';

			toggleIcon3 = toggle3.appendChild( document.createElement( 'div' ) );
			toggleIcon3.className = 'vui-accordion-toggle-icon';

			heading3 = header3.appendChild( document.createElement( 'h2' ) );
			heading3.id = 'heading3';
			heading3.innerHTML = 'This is heading 3.';

			content3 = accordion.appendChild( document.createElement( 'div' ) );
			content3.className = 'vui-accordion-content';

			content3.appendChild( document.createElement( 'p' ) ).innerHTML = 'This is content 3.';

		} );

		afterEach( function() {
			document.body.removeChild( node );
		} );

		describe( 'styling', function() {

			it( 'defines a "vui-accordion" selector', function() {
				expect( document ).toHaveCssSelector( '.vui-accordion' );
			} );

		} );

		describe( 'create', function() {

			beforeEach( function() {
				$accordion = $( accordion ).vui_accordion();
			} );

			it( 'binds the accordion elements using widget method', function() {
				expect( $accordion.data( 'vui-vui_accordion' ) ).toBeDefined();
			} );

			it( 'sets accordion to have tablist aria role', function() {
				expect( accordion.getAttribute( 'role' ) ).toBe( 'tablist' );
			} );

			it( 'sets accordion header element to have tab aria role', function() {
				expect( header1.getAttribute( 'role' ) ).toBe( 'tab' );
			} );

			it( 'sets accordion content element to have tabpanel aria role', function() {
				expect( content1.getAttribute( 'role' ) ).toBe( 'tabpanel' );
			} );

			it( 'sets header to not be expanded by default', function() {
				expect( header1.getAttribute( 'aria-expanded' ) ).toBe( 'false' );
			} );

			it( 'sets header to be initially expanded', function() {
				expect( header2.getAttribute( 'aria-expanded' ) ).toBe( 'true' );
			} );

			it( 'sets header to control its respective content', function() {
				expect( header1.getAttribute( 'aria-controls' ) ).toBe( content1.id );
			} );

			it( 'sets content to be labelled by its respective heading', function() {
				expect( content1.getAttribute( 'aria-labelledby' ) )
					.toBe( header1.getAttribute( 'data-content-labelledby' ) );
			} );

			it( 'sets tab-index to 0 for the first header', function() {
				expect( header1.getAttribute( 'tabindex' ) ).toBe( '0' );
			} );

			it( 'sets tab-index to -1 for headers other than the first header', function() {
				expect( header2.getAttribute( 'tabindex' ) ).toBe( '-1' );
			} );

		} );

		describe( 'destroy', function() {

			beforeEach( function () {
				$accordion = $( accordion ).vui_accordion();
				$accordion.vui_accordion( 'destroy' );
			} );

			it( 'unbinds the accordion elements using widget destroy method', function() {
				expect( $accordion.data( 'vui-vui_accordion' ) ).toBeUndefined();
			} );

			it( 'removes aria attributes', function() {
				expect( accordion.getAttribute( 'role' ) ).toBeNull();
				expect( header1.getAttribute( 'aria-expanded' ) ).toBeNull();
				expect( header1.getAttribute( 'aria-controls' ) ).toBeNull();
				expect( content1.getAttribute( 'aria-labelledby' ) ).toBeNull();
			} );

			it( 'removes tab-index from headers', function() {
				expect( header1.getAttribute( 'tabindex' ) ).toBeNull();
				expect( header2.getAttribute( 'tabindex' ) ).toBeNull();
			} );

		} );

		describe( 'any mode', function() {

			beforeEach( function () {
				$accordion = $( accordion ).vui_accordion();
			} );

			describe( 'expandPanel event', function() {

				it( 'is triggered with isFirstExpand (true) for heading1 when header is expanded for the first time', function( done ) {

					$accordion.on( 'expandPanel', function( e, args ) {
						if ( args.header.getAttribute( 'data-content-labelledby' ) !== 'heading1' ) {
							return;
						}
						expect( args.isFirstExpand ).toBeTruthy();
						done();
					} );

					$( header1 ).click();

				} );

				it( 'is triggered with isFirstExpand (false) for heading1 when header is expanded a second time', function( done ) {

					var expandCount = 0;

					$accordion.on( 'expandPanel', function( e, args ) {
						if ( args.header.getAttribute( 'data-content-labelledby' ) !== 'heading1' ) {
							return;
						}
						expandCount += 1;
						if ( expandCount === 2 ) {
							expect( args.isFirstExpand ).toBeFalsy();
							done();
						}
					} );

					$( header1 ).click(); // expand 1
					$( header1 ).click(); // collapse
					$( header1 ).click(); // expand 2

				} );

			} );

			describe( 'collapsePanel event', function() {

				it( 'is triggered for header2 when header1 is expanded', function( done ) {

					$accordion.on( 'collapsePanel', function( e, args ) {
						if ( args.header.getAttribute( 'data-content-labelledby' ) !== 'heading2' ) {
							return;
						}
						done();
					} );

					$( header1 ).click();

				} );

			} );

			describe( 'active header/panel', function() {

				it( 'right arrow key sets next header to be active', function() {

					header1.focus();

					$( header1 ).trigger( createKeyEvent( 'keyup', 39 ) );

					expect( header2 ).toHaveClassName( 'vui-accordion-header-active' );
					expect( header1 ).not.toHaveClassName( 'vui-accordion-header-active' );

				} );

				it( 'right arrow key sets first header to be active when last header is active', function() {

					header3.focus();

					$( header3 ).trigger( createKeyEvent( 'keyup', 39 ) );

					expect( header1 ).toHaveClassName( 'vui-accordion-header-active' );
					expect( header3 ).not.toHaveClassName( 'vui-accordion-header-active' );

				} );

				it( 'down arrow key sets next header to be active', function() {

					header1.focus();

					$( header1 ).trigger( createKeyEvent( 'keyup', 40 ) );

					expect( header2 ).toHaveClassName( 'vui-accordion-header-active' );
					expect( header1 ).not.toHaveClassName( 'vui-accordion-header-active' );

				} );

				it( 'left arrow key sets previous header to be active', function() {

					header2.focus();

					$( header2 ).trigger( createKeyEvent( 'keyup', 37 ) );

					expect( header1 ).toHaveClassName( 'vui-accordion-header-active' );
					expect( header2 ).not.toHaveClassName( 'vui-accordion-header-active' );

				} );

				it( 'left arrow key sets last header to be active when first header is active', function() {

					header1.focus();

					$( header1 ).trigger( createKeyEvent( 'keyup', 37 ) );

					expect( header3 ).toHaveClassName( 'vui-accordion-header-active' );
					expect( header1 ).not.toHaveClassName( 'vui-accordion-header-active' );

				} );

				it( 'up arrow key sets previous header to be active', function() {

					header2.focus();

					$( header2 ).trigger( createKeyEvent( 'keyup', 38 ) );

					expect( header1 ).toHaveClassName( 'vui-accordion-header-active' );
					expect( header2 ).not.toHaveClassName( 'vui-accordion-header-active' );

				} );

				it( 'end arrow key sets last header to be active', function() {

					header1.focus();

					$( header1 ).trigger( createKeyEvent( 'keyup', 35 ) );

					expect( header1 ).not.toHaveClassName( 'vui-accordion-header-active' );
					expect( header3 ).toHaveClassName( 'vui-accordion-header-active' );

				} );

				it( 'home arrow key sets last header to be active', function() {

					header3.focus();

					$( header3 ).trigger( createKeyEvent( 'keyup', 36 ) );

					expect( header1 ).toHaveClassName( 'vui-accordion-header-active' );
					expect( header3 ).not.toHaveClassName( 'vui-accordion-header-active' );

				} );

			} );

			describe( 'custom header', function() {

				it( 'has correct icon class when expanded/collapsed', function() {
					$( header3 ).click();
					expect( toggleIcon3 ).toHaveClassName( 'vui-icon-accordion-expanded' );
					expect( toggleIcon3 ).not.toHaveClassName( 'vui-icon-accordion-collapsed' );
					$( header3 ).click();
					expect( toggleIcon3 ).not.toHaveClassName( 'vui-icon-accordion-expanded' );
					expect( toggleIcon3 ).toHaveClassName( 'vui-icon-accordion-collapsed' );
				} );

			} );

		} );

		describe( 'accordion mode', function() {

			beforeEach( function () {
				$accordion = $( accordion ).vui_accordion();
			} );

			describe( 'create', function() {

				it( 'sets accordion to have aria-multiselectable to be false', function() {
					expect( accordion.getAttribute( 'aria-multiselectable' ) ).toBe( 'false' );
				} );

			} );

			describe( 'expand/collapse via click', function() {

				it( 'expands content1 when header1 is clicked', function() {
					$( header1 ).click();
					expectExpanded( header1, content1 );
				} );

				it( 'collapses content2 when header1 is clicked', function() {
					$( header1 ).click();
					expectCollapsed( header2, content2 );
				} );

				it( 'collapses content1 when header1 is clicked if already expanded', function() {
					$( header1 ).click();
					$( header1 ).click();
					expectCollapsed( header1, content1 );
				} );

			} );

			describe( 'expand/collapse via enter', function() {

				it( 'expands content1 when [enter] key is pressed while focus is on header1', function() {

					var e = createKeyEvent( 'keyup', 13 );

					header1.focus();

					$( header1 ).trigger( e );
					expectExpanded( header1, content1 );

					$( header1 ).trigger( e );
					expectCollapsed( header1, content1 );

				} );

			} );

			describe( 'expand/collapse via space', function() {

				it( 'expands content1 when [space] key is pressed while focus is on header1', function() {

					var e = createKeyEvent( 'keyup', 32 );

					header1.focus();

					$( header1 ).trigger( e );
					expectExpanded( header1, content1 );

					$( header1 ).trigger( e );
					expectCollapsed( header1, content1 );

				} );

			} );

		} );

		describe( 'stacked mode', function() {

			beforeEach( function () {
				accordion.setAttribute( 'data-display-mode', 'stacked' );
				$accordion = $( accordion ).vui_accordion();
			} );

			describe( 'create', function() {

				it( 'sets accordion to have aria-multiselectable to be false', function() {
					expect( accordion.getAttribute( 'aria-multiselectable' ) ).toBe( 'true' );
				} );

			} );

			describe( 'collapseAll', function() {

				it( 'collapses all expanded panels', function() {

					$( header1 ).click();

					expectExpanded( header1, content1 );
					expectExpanded( header2, content2 );

					$( accordion ).vui_accordion( 'collapseAll' );

					expectCollapsed( header1, content1 );
					expectCollapsed( header2, content2 );

				} );

			} );

			describe( 'expand/collapse via click', function() {

				it( 'leaves content2 expanded when header1 is clicked to expand content1', function() {

					$( header1 ).click();

					expectExpanded( header1, content1 );
					expectExpanded( header2, content2 );

				} );

			} );

		} );

		describe( 'disabled/empty content', function() {

			beforeEach( function () {
				content1.innerHTML = '';
				$accordion = $( accordion ).vui_accordion();
			} );

			it( 'is styled to be disabled', function() {
				expect( header1 ).toHaveClassName( 'vui-accordion-header-disabled' );
			} );

			it( 'does not expand when disabled (content element is empty)', function() {

				header1.focus();

				expectCollapsed( header1, content1 );

				$( header1 ).trigger( createKeyEvent( 'keyup', 13 ) );

				expectCollapsed( header1, content1 );

			} );

		} );

	} );

} )();


text:
@interface IMVInjectionContext ()

@property (strong, nonatomic) NSMutableDictionary *injectInstanceInfo;
@property (strong, nonatomic) NSDictionary *injectClassInfo;

@property (strong, nonatomic) NSMutableDictionary *invokerInfo;

@end
@implementation IMVInjectionContext

+ (instancetype)sharedInstence
{
    static id sharedInstence = nil;
    static dispatch_once_t predicate;
    dispatch_once(&predicate, ^{
        sharedInstence = [[self alloc] init];
    });
    return sharedInstence;
}

- (id)init
{
    self = [super init];
    if (self) {
        _injectClassInfo = [IMVInjectionUtils classInfoWithInjection:@protocol(IMVInjection)];
        _injectInstanceInfo = [NSMutableDictionary dictionary];
    }
    return self;
}

- (NSArray *)instancesWithInjection:(Protocol *)injection
{
    NSMutableArray *instances = [NSMutableArray array];
    [_injectClassInfo enumerateKeysAndObjectsUsingBlock:^(id key, id cls, BOOL *stop) {

        if ([cls conformsToProtocol:injection]) {
            id instance = [self instanceWithClassName:key];
            [instances addObject:instance];
        }
    }];
    return instances;
}

- (id<IMVInjection>)instanceWithClassName:(NSString *)className
{
    id instance = [_injectInstanceInfo objectForKey:className];
    if (!instance) { // lazy inject
        Class cls = [_injectClassInfo objectForKey:className];
        if (cls) {
            instance = [[cls alloc] init];
            [_injectInstanceInfo setValue:instance forKey:className];
            if ([instance respondsToSelector:@selector(inject)]) {
                [instance inject];
            }

            NSDictionary *propertyInfo = [IMVInjectionUtils propertyInfoForClass:cls withInjection:@protocol(IMVInjection)];
            for (NSString *propertyName in propertyInfo.allKeys) {
                NSString *propertyClassName = propertyInfo[propertyName];
                id propertyInstance = [self instanceWithClassName:propertyClassName];
                [instance setValue:propertyInstance forKey:propertyName];
            }
        }
        else
        {
            NSLogWarn(@"injected instance classnamed:%@ not found, check if %@ conforms to IMVInjection", className, className);
        }
    }
    return instance;
}

- (void)injectService:(NSString *)serviceName withTarget:(id)target selector:(SEL)selector
{
    if (!serviceName || !target || ![target respondsToSelector:selector]) {
        NSLogError(@"can't inject service with name:nil, or target:nil");
        return;
    }
    if (![target respondsToSelector:selector]) {
        NSLogWarn(@"injecting service with name:%@, and target not responds to selector", serviceName);
    }

    IMVInvoker *invoker = [_invokerInfo objectForKey:serviceName];
    if (!invoker) {
        invoker = [[IMVInvoker alloc] initWithTarget:target selector:selector];
        [_invokerInfo setObject:invoker forKey:serviceName];
    }
    else
    {
        NSLogWarn(@"service named:%@ has been injected with target:%@ selector:%@", serviceName, [invoker.target class], invoker.selector);
    }
}

- (void)invokeService:(NSString *)serviceName withParam:(NSDictionary *)param
{
    if (!serviceName) {
        NSLogError(@"can't invoke service with name:nil");
        return;
    }

    IMVInvoker *invoker = [_invokerInfo objectForKey:serviceName];
    if (invoker && invoker.target && [invoker.target respondsToSelector:invoker.selector])
    {
        ((void (*)(id, SEL))[invoker.target methodForSelector:invoker.selector])(invoker.target, invoker.selector);
    }
    else
    {
        NSLogError(@"service named:%@ has not been injected or injected target has been released or the injected target not responds to the selector", serviceName);
    }
}

@end


text:
package it.unitn.ing.rista.diffr.measurement;

import java.lang.*;

import it.unitn.ing.rista.diffr.*;
import it.unitn.ing.rista.awt.*;
import it.unitn.ing.rista.util.*;

import java.awt.*;
import java.awt.*;
import java.awt.event.*;

/**
 *  The TOFMeasurement is a class
 *
 *
 * @version $Revision: 1.7 $, $Date: 2006/11/10 09:33:01 $
 * @author Luca Lutterotti
 * @since JDK1.1
 */

public class TOFMeasurement extends Measurement {

  public static String modelID = "TOF";

  public static String[] diclistc = {};
  public static String[] diclistcrm = {};

  public static String[] classlistc = {};
  public static String[] classlistcs = {};

  public TOFMeasurement(XRDcat aobj, String alabel) {
    super(aobj, alabel);
    initXRD();
    identifier = modelID;
    IDlabel = modelID;
    description = "TOF measurement";
  }

  public TOFMeasurement(XRDcat aobj) {
    this(aobj, modelID);
  }

  public TOFMeasurement() {
    identifier = modelID;
    IDlabel = modelID;
    description = "TOF measurement";
  }

  public void initConstant() {
    Nstring = 0;
    Nstringloop = 0;
    Nparameter = 0;
    Nparameterloop = 0;
    Nsubordinate = 0;
    Nsubordinateloop = 0;
  }

  public void initDictionary() {
    for (int i = 0; i < totsubordinateloop; i++)
      diclist[i] = diclistc[i];
    System.arraycopy(diclistcrm, 0, diclistRealMeaning, 0, totsubordinateloop);
    for (int i = 0; i < totsubordinateloop - totsubordinate; i++)
      classlist[i] = classlistc[i];
    for (int i = 0; i < totsubordinate - totparameterloop; i++)
      classlists[i] = classlistcs[i];
  }

  public void initParameters() {
    super.initParameters();
  }

  public boolean isTOF() {
    return true;
  }

}


text:
package org.jbpm.workbench.df.client.filter;

import org.dashbuilder.displayer.ColumnSettings;
import org.dashbuilder.displayer.DisplayerSettings;
import org.dashbuilder.displayer.DisplayerType;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * Custom settings class holding the configuration of any jBPM table displayer
 */
public class FilterSettings extends DisplayerSettings {

    protected String key;

    protected String tableName;
    protected String tableDescription;
    protected boolean editable;

    protected String serverTemplateId;

    public FilterSettings() {
        super( DisplayerType.TABLE );
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName( String tableName ) {
        this.tableName = tableName;
    }

    public String getTableDescription() {
        return tableDescription;
    }

    public void setTableDescription( String tableDescription ) {
        this.tableDescription = tableDescription;
    }

    public boolean isEditable() {
        return editable;
    }

    public void setEditable( boolean editable ) {
        this.editable = editable;
    }

    public String getKey() {
        return key;
    }

    public void setKey( String key ) {
        this.key = key;
    }

    public String getServerTemplateId() {
        return serverTemplateId;
    }

    public void setServerTemplateId(String serverTemplateId) {
        this.serverTemplateId = serverTemplateId;
    }

    @Override
    public boolean equals( Object obj ) {
        try {
            FilterSettings other = ( FilterSettings ) obj;
            if ( tableName == null || other.tableName == null ) return false;
            if ( !tableName.equals( other.tableName ) ) return false;
            return true;
        } catch ( ClassCastException e ) {
            return false;
        }
    }

    @Override
    public int hashCode() {
        return tableName != null ? tableName.hashCode() : 0;
    }

    public static FilterSettings cloneFrom(DisplayerSettings settings ) {
        FilterSettings tableSettings = new FilterSettings();
        tableSettings.setType( DisplayerType.TABLE );
        tableSettings.setUUID( settings.getUUID() );
        tableSettings.setDataSet( settings.getDataSet() );
        tableSettings.setDataSetLookup( settings.getDataSetLookup() );
        tableSettings.setColumnSettingsList( settings.getColumnSettingsList() );
        tableSettings.getSettingsFlatMap().putAll( settings.getSettingsFlatMap() );
        return tableSettings;
    }

    public FilterSettings cloneInstance() {
        FilterSettings clone = new FilterSettings();
        clone.UUID = UUID;
        clone.tableName = tableName;
        clone.tableDescription = tableDescription;
        clone.settings = new HashMap<String, String>( settings );
        clone.columnSettingsList = new ArrayList<ColumnSettings>();

        for ( ColumnSettings columnSettings : columnSettingsList ) {
            clone.columnSettingsList.add( columnSettings.cloneInstance() );
        }
        if ( dataSet != null ) clone.dataSet = dataSet.cloneInstance();
        if ( dataSetLookup != null ) clone.dataSetLookup = dataSetLookup.cloneInstance();

        return clone;
    }

}