text:
package com.google.j2objc;

import junit.framework.TestCase;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * Command-line tests for java.lang.Class support (IOSClass)
 *
 * @author Tom Ball
 */
public class ClassTest extends TestCase {

  public ClassTest() {}

  public ClassTest(Double d) {
    super();
  }

  public int answerToLife() {
    return 42;
  }

  public void testForName() throws Exception {
    Class<?> thisClass = Class.forName("com.google.j2objc.ClassTest");
    assertNotNull(thisClass);
    assertEquals("com.google.j2objc.ClassTest", thisClass.getName());
    Method answerToLife = thisClass.getMethod("answerToLife");
    Integer answer = (Integer) answerToLife.invoke(this);
    assertEquals(42, answer.intValue());
  }

  public void testArrayForName() throws Exception {
    Class<?> arrayClass = Class.forName("[Ljava.lang.String;");
    assertNotNull(arrayClass);
    assertEquals("[Ljava.lang.String;", arrayClass.getName());
    String[] array = new String[0];
    assertEquals(array.getClass(), arrayClass);

    // Test that array types not referenced in source can be loaded.
    arrayClass = Class.forName("[[[Ljava.lang.Integer;");
    assertNotNull(arrayClass);
  }

  public void testGetDefaultConstructor() throws Exception {
    Class<?> foo = Class.forName("com.google.j2objc.ClassTest");
    Constructor<?> c = foo.getConstructor();
    Class<?>[] paramTypes = c.getParameterTypes();
    assertEquals(0, paramTypes.length);
  }

  public void testGetConstructor() throws Exception {
    Class<?> foo = Class.forName("com.google.j2objc.ClassTest");
    Constructor<?> c = foo.getConstructor(Double.class);
    Class<?>[] paramTypes = c.getParameterTypes();
    assertEquals(1, paramTypes.length);
  }

  public void testGetDeclaredConstructor() throws Exception {
    Class<?> foo = Class.forName("com.google.j2objc.ClassTest");
    Constructor<?> c = foo.getConstructor();
    Class<?>[] paramTypes = c.getParameterTypes();
    assertEquals(0, paramTypes.length);
  }

  public void testGetInterfaceMethods() throws Exception {
    Class<?> runnableClass = Class.forName("java.lang.Runnable");
    Method[] methods = runnableClass.getMethods();
    assertEquals(1, methods.length);
    Method runMethod = methods[0];
    assertEquals("run", runMethod.getName());
    assertEquals(0, runMethod.getParameterTypes().length);
  }

  public void testGetDeclaredInterfaceMethods() throws Exception {
    Class<?> runnableClass = Class.forName("java.lang.Runnable");
    Method[] methods = runnableClass.getDeclaredMethods();
    assertEquals(1, methods.length);
    Method runMethod = methods[0];
    assertEquals("run", runMethod.getName());
    assertEquals(0, runMethod.getParameterTypes().length);
  }

  public void testGetInterfaceMethod() throws Exception {
    Class<?> runnableClass = Class.forName("java.lang.Runnable");
    Method runMethod = runnableClass.getMethod("run", new Class<?>[0]);
    assertEquals("run", runMethod.getName());
    assertEquals(0, runMethod.getParameterTypes().length);
  }

  public void testGetArrayMethods() throws Exception {
    Method[] methods = int[].class.getDeclaredMethods();
    assertEquals(0, methods.length);
    methods = int[].class.getMethods();
    Set<String> methodNames = new HashSet<>();
    for (Method m : methods) {
      methodNames.add(m.getName());
    }
    assertTrue(methodNames.contains("equals"));
    assertTrue(methodNames.contains("toString"));
  }

  public void testInterfaceMethodInvocation() throws Exception {
    Class<?> runnableClass = Class.forName("java.lang.Runnable");
    Method runMethod = runnableClass.getMethod("run", new Class<?>[0]);
    Runnable r = new Runnable() {
      public void run() { System.out.println("run, run"); }
    };
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintStream ps = new PrintStream(baos);
    PrintStream oldOut = System.out;
    System.setOut(ps);
    try {
      runMethod.invoke(r, new Object[0]);
      System.out.flush();
      assertEquals("run, run\n", baos.toString());
    } finally {
      System.setOut(oldOut);
    }
  }

  public void testArrayClassObjects() throws Exception {
    Class<?> c1 = int[].class;
    Class<?> c2 = int[][].class;
    assertFalse(c1 == c2);
    assertTrue(c1 == c2.getComponentType());
    c1 = String[].class;
    c2 = String[][].class;
    assertFalse(c1 == c2);
    assertTrue(c1 == c2.getComponentType());
  }

  public void testGetPackage() throws Exception {
    // Test package name for a class.
    Class<?> listClass = Class.forName("java.util.ArrayList");
    Package pkg = listClass.getPackage();
    assertNotNull(pkg);
    assertEquals("java.util", pkg.getName());

    // Test package name for an interface.
    Class<?> readerClass = Class.forName("java.io.Reader");
    pkg = readerClass.getPackage();
    assertNotNull(pkg);
    assertEquals("java.io", pkg.getName());

    // Test no package for arrays and primitive types.
    assertNull(boolean.class.getPackage());
    assertNull(int[].class.getPackage());
  }

  public void testInnerClass() throws Exception {
    Class<?> innerClass = Class.forName("com.google.j2objc.ClassTest$InnerClass");
    assertEquals(InnerClass.class, innerClass);
    assertEquals("com.google.j2objc.ClassTest$InnerClass", innerClass.getName());
    assertEquals("InnerClass", innerClass.getSimpleName());
    assertTrue(innerClass.isMemberClass());
    assertEquals(ClassTest.class, innerClass.getEnclosingClass());
  }

  public void testInnerInterface() throws Exception {
    Class<?> innerInterface = Class.forName("com.google.j2objc.ClassTest$InnerInterface");
    assertEquals(InnerInterface.class, innerInterface);
    assertEquals("com.google.j2objc.ClassTest$InnerInterface", innerInterface.getName());
    assertEquals("InnerInterface", innerInterface.getSimpleName());
    assertTrue(innerInterface.isMemberClass());
    assertEquals(ClassTest.class, innerInterface.getEnclosingClass());
  }

  public void testAnonymousClass() throws Exception {
    Object o = new Object() {};
    Class<?> cls = o.getClass();
    assertTrue(cls.isAnonymousClass());
    assertFalse(cls.isMemberClass());
    assertEquals(ClassTest.class, cls.getEnclosingClass());
  }

  public void testGetGenericSuperclass() throws Exception {
    Class<?> cls = SubParameterizedClass.class;
    Type genericSuperclass = cls.getGenericSuperclass();
    assertTrue(genericSuperclass instanceof ParameterizedType);
    ParameterizedType pType = (ParameterizedType) genericSuperclass;
    assertEquals(ParameterizedClass.class, pType.getRawType());
    Type[] typeArgs = pType.getActualTypeArguments();
    assertEquals(2, typeArgs.length);
    assertEquals(String.class, typeArgs[0]);
    assertTrue(typeArgs[1] instanceof TypeVariable);
    assertEquals("C", ((TypeVariable) typeArgs[1]).getName());
  }

  public void testArrayIsAssignableToObject() throws Exception {
    assertTrue(Object.class.isAssignableFrom(Object[].class));
    assertTrue(Object.class.isAssignableFrom(Object[][].class));
    assertTrue(Object.class.isAssignableFrom(String[].class));
    assertTrue(Object.class.isAssignableFrom(int[].class));
    assertFalse(String.class.isAssignableFrom(String[].class));
  }

  public void testGetMappedMethods() throws Exception {
    Class<?> objectClass = Class.forName("java.lang.Object");
    Method[] methods = objectClass.getDeclaredMethods();
    assertTrue("not all Object methods returned, only: " +
        methods.length + " " + Arrays.toString(methods), methods.length >= 7);
    Class<?> classClass = Class.forName("java.lang.Class");
    methods = classClass.getDeclaredMethods();
    assertTrue("not all Class methods returned, only: " +
        methods.length + " " + Arrays.toString(methods), methods.length >= 5);
    Class<?> stringClass = Class.forName("java.lang.String");
    methods = stringClass.getDeclaredMethods();
    assertTrue("not all String methods returned, only: " +
        methods.length + " " + Arrays.toString(methods), methods.length >= 35);
    Class<?> numberClass = Class.forName("java.lang.Number");
    methods = numberClass.getDeclaredMethods();
    assertTrue("not all Number methods returned, only: " +
        methods.length + " " + Arrays.toString(methods), methods.length >= 6);
  }

  public void testGetEnum() throws Exception {
    Class<?> innerEnum = Class.forName("com.google.j2objc.ClassTest$InnerEnum");
    assertNotNull(innerEnum);
  }

  public void testLookupClassWith$() throws Exception {
    Class<?> dollarClass = Class.forName("com.google.j2objc.Test$$With$$Dollar$$Signs");
    assertNotNull(dollarClass);
  }

  // Verify that lookup of a method in an interface throws NoSuchMethod.
  public void testNoSuchInterfaceMethod() {
    try {
      Method m = java.io.Serializable.class.getMethod("foo");
      fail("method shouldn't have been returned");
    } catch (NoSuchMethodException e) {
      // Successful.
    } catch (Throwable t) {
      fail("wrong exception thrown");
    }
  }

  // Verify that we can access the class literals for classes that are
  // hand-coded.
  public void testCertainClassLiterals() {
    assertEquals("java.lang.Object", Object.class.getName());
    assertEquals("java.lang.String", String.class.getName());
    assertEquals("java.lang.Cloneable", Cloneable.class.getName());
    assertEquals("java.lang.Number", Number.class.getName());
    assertEquals("java.lang.Iterable", Iterable.class.getName());
    assertEquals("java.lang.Throwable", Throwable.class.getName());
    assertEquals("java.lang.reflect.AccessibleObject", AccessibleObject.class.getName());
    assertEquals("java.lang.reflect.Constructor", Constructor.class.getName());
    assertEquals("java.lang.reflect.Field", Field.class.getName());
    assertEquals("java.lang.reflect.Method", Method.class.getName());
  }

  // Verify that mapped classes return the correct superclass from a Java view.
  public void testCertainSuperclasses() {
    assertNull("Non-null Object superclass", Object.class.getSuperclass());
    assertNull("Non-null Cloneable superclass", Cloneable.class.getSuperclass());
    assertNull("Non-null Iterable superclass", Iterable.class.getSuperclass());

    assertEquals("Bad String superclass", Object.class, String.class.getSuperclass());
    assertEquals("Bad Number superclass", Object.class, Number.class.getSuperclass());
    assertEquals("Bad Throwable superclass", Object.class, Throwable.class.getSuperclass());
    assertEquals("Bad AccessibleObject superclass", Object.class,
        AccessibleObject.class.getSuperclass());

    // Check a String subclass.
    assertEquals("Bad String superclass", Object.class, "foo".getClass().getSuperclass());
  }

  /**
   * Verify that a class with a package that has been renamed using an
   * ObjectiveCName annotation can be reflexively loaded.
   */
  public void testPackagePrefixAnnotation() throws Exception {
    // Lookup class by its Java name.
    Class<?> cls = Class.forName("java.lang.test.Example");
    Object instance = cls.newInstance();
    Method m = cls.getMethod("nativeClassName");
    String nativeName = (String) m.invoke(instance);

    // Native name should have an OK prefix, instead of a camel-cased package name.
    assertEquals("OKExample", nativeName);
  }

  public void testDeclaringClass() throws Exception {
    Class<?> thisClass = Class.forName("com.google.j2objc.ClassTest");
    assertNotNull(thisClass);
    Class<?> innerClass = Class.forName("com.google.j2objc.ClassTest$InnerClass");
    assertNotNull(innerClass);
    assertEquals(thisClass, innerClass.getDeclaringClass());
    Class<?> innerInterface = Class.forName("com.google.j2objc.ClassTest$InnerInterface");
    assertNotNull(innerInterface);
    assertEquals(thisClass, innerInterface.getDeclaringClass());
    Class<?> innerEnum = Class.forName("com.google.j2objc.ClassTest$InnerEnum");
    assertNotNull(innerEnum);
    assertEquals(thisClass, innerEnum.getDeclaringClass());
  }

  public void testClassIsAssignableToItself() throws Exception {
    Class<?> cls = Class.forName("java.util.HashMap");
    assertNotNull(cls);
    assertTrue(cls.isAssignableFrom(cls));
    Class<?> protocol = Class.forName("java.util.Map");
    assertNotNull(protocol);
    assertTrue(protocol.isAssignableFrom(protocol));
  }

  public void testCharSequenceClass() throws Exception {
    Class<?> cls = CharSequence.class;
    assertEquals("interface java.lang.CharSequence", cls.toString());
    assertEquals(CharSequence.class, Class.forName("java.lang.CharSequence"));
  }

  public void testFindPrefixMappedClass() throws Exception {
    Class<?> cls = Class.forName("com.google.j2objc.mappedpkg.TestClass");
    assertNotNull(cls);
    cls = Class.forName("com.google.j2objc.mappedpkg.TestClass$Inner");
    assertNotNull(cls);
  }

  public void testDefaultEnumMethods() throws Exception {
    Method[] methods = InnerEnum.class.getDeclaredMethods();
    assertEquals(2, methods.length);
    Method valuesMethod = InnerEnum.class.getDeclaredMethod("values");
    assertNotNull(valuesMethod);
    assertEquals("[Lcom.google.j2objc.ClassTest$InnerEnum;",
        valuesMethod.getReturnType().getName());
    Method valueOfMethod = InnerEnum.class.getDeclaredMethod("valueOf", String.class);
    assertNotNull(valueOfMethod);
    assertEquals(InnerEnum.class, valueOfMethod.getReturnType());
  }

  boolean canCallAsSubclass(Class<?> x, Class<?> y) {
    boolean callSuccessful;
    try {
      Class<?> z = x.asSubclass(y);
      callSuccessful = true;
    } catch (ClassCastException e) {
      callSuccessful = false;
    }

    boolean assignable = y.isAssignableFrom(x);
    assertEquals(assignable, callSuccessful);
    return callSuccessful;
  }

  public void testAsSubclassCalls() throws Exception {
    assertTrue(canCallAsSubclass(Integer.class, Object.class));
    assertFalse(canCallAsSubclass(Long.class, Integer.class));
    assertTrue(canCallAsSubclass(Integer[].class, Object[].class));
    assertTrue(canCallAsSubclass(Integer[].class, Object.class));
    assertFalse(canCallAsSubclass(int.class, Object.class));
    assertFalse(canCallAsSubclass(int.class, long.class));
    assertTrue(canCallAsSubclass(int[].class, Object.class));
    assertFalse(canCallAsSubclass(int[].class, Object[].class));

    assertTrue(canCallAsSubclass(InterfaceP.class, Object.class));
    assertFalse(canCallAsSubclass(InterfaceP.class, InterfaceQ.class));
    assertTrue(canCallAsSubclass(InterfaceP[].class, Object.class));
    assertTrue(canCallAsSubclass(InterfaceP[].class, Object[].class));
    assertTrue(canCallAsSubclass(InterfaceR.class, InterfaceP.class));
    assertFalse(canCallAsSubclass(InterfaceR.class, InterfaceQ.class));
    assertTrue(canCallAsSubclass(InterfaceR.class, InterfaceR.class));

    assertTrue(canCallAsSubclass(AbstractClassX.class, Object.class));
    assertFalse(canCallAsSubclass(AbstractClassX.class, AbstractClassY.class));
    assertTrue(canCallAsSubclass(AbstractClassX[].class, Object.class));
    assertTrue(canCallAsSubclass(AbstractClassX[].class, Object[].class));

    assertTrue(canCallAsSubclass(AbstractClassY.class, Object.class));
    assertTrue(canCallAsSubclass(AbstractClassY.class, InterfaceP.class));
    assertTrue(canCallAsSubclass(AbstractClassY[].class, Object.class));
    assertTrue(canCallAsSubclass(AbstractClassY[].class, Object[].class));
    assertFalse(canCallAsSubclass(AbstractClassY[].class, InterfaceP.class));
    assertTrue(canCallAsSubclass(AbstractClassY[].class, InterfaceP[].class));

    assertTrue(canCallAsSubclass(ConcreteClassA.class, AbstractClassX.class));
    assertFalse(canCallAsSubclass(ConcreteClassA.class, AbstractClassY.class));
    assertTrue(canCallAsSubclass(ConcreteClassA[].class, AbstractClassX[].class));

    assertTrue(canCallAsSubclass(ConcreteClassB.class, AbstractClassY.class));
    assertTrue(canCallAsSubclass(ConcreteClassB.class, InterfaceP.class));
    assertFalse(canCallAsSubclass(ConcreteClassB.class, InterfaceQ.class));
    assertTrue(canCallAsSubclass(ConcreteClassB[].class, AbstractClassY[].class));
    assertTrue(canCallAsSubclass(ConcreteClassB[].class, InterfaceP[].class));

    assertFalse(canCallAsSubclass(ConcreteClassC.class, ConcreteClassA.class));
    assertTrue(canCallAsSubclass(ConcreteClassC.class, ConcreteClassB.class));
    assertTrue(canCallAsSubclass(ConcreteClassC.class, InterfaceQ.class));
    assertTrue(canCallAsSubclass(ConcreteClassC[].class, ConcreteClassB[].class));
    assertTrue(canCallAsSubclass(ConcreteClassC[].class, InterfaceQ[].class));

    assertTrue(canCallAsSubclass(ConcreteClassD.class, InterfaceP.class));
    assertTrue(canCallAsSubclass(ConcreteClassD.class, InterfaceQ.class));

    assertTrue(canCallAsSubclass(ConcreteClassE.class, AbstractClassX.class));
    assertFalse(canCallAsSubclass(ConcreteClassE.class, AbstractClassY.class));
    assertTrue(canCallAsSubclass(ConcreteClassE.class, InterfaceP.class));
    assertTrue(canCallAsSubclass(ConcreteClassE.class, InterfaceQ.class));
  }

  public void testNewInstance() throws Exception {
    Class<?> cls = Class.forName("com.google.j2objc.ClassTest$PrivateConstructorClass");
    try {
      cls.newInstance();
      fail("Expected IllegalAccessException");
    } catch (IllegalAccessException expected) {
      // expected
    }

    cls = Class.forName("com.google.j2objc.ClassTest$NoNullaryConstructorClass");
    try {
      cls.newInstance();
      fail("Expected InstantiationException");
    } catch (InstantiationException expected) {
      // expected
    }

    cls = Class.forName("com.google.j2objc.ClassTest$InnerClass");
    try {
      cls.newInstance();
    } catch (Exception e) {
      fail("Failed to create an instance of " + cls);
    }
  }

  public void testCast() throws Exception {
    ConcreteClassC c = new ConcreteClassC();
    try {
      ConcreteClassA.class.cast(c);
      fail("Expected ClassCastException");
    } catch (ClassCastException e) {
      // expected
    }

    try {
      ConcreteClassB.class.cast(c);
    } catch (ClassCastException e) {
      fail("Failed to cast " + c + " to ConcreteClassB");
    }

    try {
      InterfaceR.class.cast(c);
      fail("Expected ClassCastException");
    } catch (ClassCastException e) {
      // expected
    }

    try {
      InterfaceQ.class.cast(c);
    } catch (ClassCastException e) {
      fail("Failed to cast " + c + " to InterfaceQ");
    }

    try {
      InterfaceQ.class.cast(null);
    } catch (ClassCastException e) {
      fail("Unexpected ClassCastException");
    }
  }

  static class InnerClass {
  }

  interface InnerInterface {
  }

  static class ParameterizedClass<A, B> {
  }

  static class SubParameterizedClass<C> extends ParameterizedClass<String, C> {
  }

  static enum InnerEnum {
    A, B, C;
  }

  interface InterfaceP {
  }

  interface InterfaceQ {

  }
  interface InterfaceR extends InterfaceP {
  }

  static abstract class AbstractClassX {
  }

  static abstract class AbstractClassY implements InterfaceP {
  }

  class ConcreteClassA extends AbstractClassX {
  }

  class ConcreteClassB extends AbstractClassY {
  }

  class ConcreteClassC extends ConcreteClassB implements InterfaceQ {
  }

  class ConcreteClassD implements InterfaceP, InterfaceQ {
  }

  class ConcreteClassE extends AbstractClassX implements InterfaceP, InterfaceQ {
  }

  static class PrivateConstructorClass {
    private PrivateConstructorClass() {}
  }

  static class NoNullaryConstructorClass {
    NoNullaryConstructorClass(int i) {}
  }
}

class Test$$With$$Dollar$$Signs {
}


text:
"""Support for binary sensor using Orange Pi GPIO."""

from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice

from . import edge_detect, read_input, setup_input, setup_mode
from .const import CONF_INVERT_LOGIC, CONF_PIN_MODE, CONF_PORTS, PORT_SCHEMA

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(PORT_SCHEMA)

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    """Set up the Orange Pi GPIO platform."""
    binary_sensors = []
    invert_logic = config[CONF_INVERT_LOGIC]
    pin_mode = config[CONF_PIN_MODE]
    ports = config[CONF_PORTS]

    setup_mode(pin_mode)

    for port_num, port_name in ports.items():
        binary_sensors.append(
            OPiGPIOBinarySensor(hass, port_name, port_num, invert_logic)
        )
    async_add_entities(binary_sensors)

class OPiGPIOBinarySensor(BinarySensorDevice):
    """Represent a binary sensor that uses Orange Pi GPIO."""

    def __init__(self, hass, name, port, invert_logic):
        """Initialize the Orange Pi binary sensor."""
        self._name = name
        self._port = port
        self._invert_logic = invert_logic
        self._state = None

    async def async_added_to_hass(self):
        """Run when entity about to be added to hass."""

        def gpio_edge_listener(port):
            """Update GPIO when edge change is detected."""
            self.schedule_update_ha_state(True)

        def setup_entity():
            setup_input(self._port)
            edge_detect(self._port, gpio_edge_listener)
            self.schedule_update_ha_state(True)

        await self.hass.async_add_executor_job(setup_entity)

    @property
    def should_poll(self):
        """No polling needed."""
        return False

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

    @property
    def is_on(self):
        """Return the state of the entity."""
        return self._state != self._invert_logic

    def update(self):
        """Update state with new GPIO data."""
        self._state = read_input(self._port)

redpajama_set_name: RedPajamaGithub


text:
/* Commentary:
 *
 */

/* Change log:
 *
 */

#include <dtkLog/dtkLog.h>
#include <dtkLog/dtkLogModel.h>

#include "dtkWidgetsLogView.h"
#include "dtkWidgetsLogView_p.h"

// /////////////////////////////////////////////////////////////////
// dtkWidgetsLogViewBar
// /////////////////////////////////////////////////////////////////

dtkWidgetsLogViewBar::dtkWidgetsLogViewBar(QWidget *parent) : QFrame(parent)
{
    QPushButton *b_trace = new QPushButton("Trace", this);
    QPushButton *b_debug = new QPushButton("Debug", this);
    QPushButton *b_info  = new QPushButton("Info", this);
    QPushButton *b_warn  = new QPushButton("Warn", this);
    QPushButton *b_error = new QPushButton("Error", this);
    QPushButton *b_fatal = new QPushButton("Fatal", this);

    b_trace->setCheckable(true);
    b_debug->setCheckable(true);
     b_info->setCheckable(true);
     b_warn->setCheckable(true);
    b_error->setCheckable(true);
    b_fatal->setCheckable(true);

    b_trace->setChecked(true);
    b_debug->setChecked(true);
     b_info->setChecked(true);
     b_warn->setChecked(true);
    b_error->setChecked(true);
    b_fatal->setChecked(true);

    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->addWidget(b_trace);
    layout->addWidget(b_debug);
    layout->addWidget(b_info);
    layout->addWidget(b_warn);
    layout->addWidget(b_error);
    layout->addWidget(b_fatal);

    connect(b_trace, SIGNAL(clicked(bool)), this, SIGNAL(displayTrace(bool)));
    connect(b_debug, SIGNAL(clicked(bool)), this, SIGNAL(displayDebug(bool)));
    connect(b_info,  SIGNAL(clicked(bool)), this, SIGNAL(displayInfo(bool)));
    connect(b_warn,  SIGNAL(clicked(bool)), this, SIGNAL(displayWarn(bool)));
    connect(b_error, SIGNAL(clicked(bool)), this, SIGNAL(displayError(bool)));
    connect(b_fatal, SIGNAL(clicked(bool)), this, SIGNAL(displayFatal(bool)));
}

dtkWidgetsLogViewBar::~dtkWidgetsLogViewBar(void)
{

}

// /////////////////////////////////////////////////////////////////
// dtkWidgetsLogViewTree
// /////////////////////////////////////////////////////////////////

dtkWidgetsLogViewTree::dtkWidgetsLogViewTree(QWidget *parent) : QTreeWidget(parent)
{
    this->setAttribute(Qt::WA_MacShowFocusRect, false);
    this->setFrameShape(QFrame::HLine);
    this->setHeaderHidden(true);

    this->runtime = new QTreeWidgetItem(QStringList() << "Runtime log");

    this->file = new QTreeWidgetItem(QStringList() << "File log");
    this->file->addChild(new QTreeWidgetItem(QStringList() << dtkLogPath(qApp)));

    this->addTopLevelItem(this->runtime);
    this->addTopLevelItem(this->file);

    connect(this, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(onItemClicked(QTreeWidgetItem *, int)));
}

dtkWidgetsLogViewTree::~dtkWidgetsLogViewTree(void)
{

}

void dtkWidgetsLogViewTree::onItemClicked(QTreeWidgetItem *item, int)
{
    if (item == this->runtime)
        emit runtimeClicked();
    else if (item == this->file)
        ;
    else
        emit fileClicked(item->text(0));
}

// /////////////////////////////////////////////////////////////////
// dtkWidgetsLogViewList
// /////////////////////////////////////////////////////////////////

dtkWidgetsLogViewList::dtkWidgetsLogViewList(QWidget *parent) : QListView(parent)
{
    this->model = new dtkLogModel(this);

    this->proxy = new QSortFilterProxyModel(this);
    this->proxy->setFilterKeyColumn(0);

    this->setModel(this->proxy);

    this->setAlternatingRowColors(true);
    this->setAttribute(Qt::WA_MacShowFocusRect, false);
    this->setFrameShape(QFrame::NoFrame);
    this->setRuntime();
}

dtkWidgetsLogViewList::~dtkWidgetsLogViewList(void)
{
    qDeleteAll(this->models);
}

void dtkWidgetsLogViewList::setAutoScroll(bool autoScroll)
{
    if(autoScroll)
        connect(this->model, SIGNAL(rowsInserted(const QModelIndex&, int, int)), this, SLOT(scrollToBottom()));
    else
        disconnect(this->model, SIGNAL(rowsInserted(const QModelIndex&, int, int)), this, SLOT(scrollToBottom()));
}

void dtkWidgetsLogViewList::setRuntime(void)
{
    dtkLogger::instance().attachModel(this->model);

    this->proxy->setSourceModel(this->model);
}

void dtkWidgetsLogViewList::setFile(const QString& path)
{
    if (this->models.contains(path))
        this->models.remove(path);

    QFile file(path);

    if(!file.open(QFile::ReadOnly))
        qDebug() << "Unable to read file" << path;

    QString contents = file.readAll();

    file.close();

    QStringListModel *model = new QStringListModel(contents.split("\n"));

    this->proxy->setSourceModel(model);

    this->models.insert(path, model);

    // QFileSystemWatcher *watcher = new QFileSystemWatcher(QStringList() << path, this);

    // connect(watcher, SIGNAL(fileChanged(const QString&)), this, SLOT(setFile(const QString&)));
}

void dtkWidgetsLogViewList::setFilter(const QRegExp& expression)
{
    this->proxy->setFilterRegExp(expression);
}

// /////////////////////////////////////////////////////////////////
// dtkWidgetsLogViewPrivate
// /////////////////////////////////////////////////////////////////

QRegExp dtkWidgetsLogViewPrivate::expression(void)
{
    if(this->exclude.isEmpty())
        return QRegExp();

    QString patterns;
    foreach(QString pattern, this->exclude)
        patterns.append(QString("%1|").arg(pattern));
    patterns.chop(1);

    return QRegExp(QString("^(?!%1).*").arg(patterns), Qt::CaseSensitive, QRegExp::RegExp2);
}

// /////////////////////////////////////////////////////////////////
// dtkWidgetsLogView
// /////////////////////////////////////////////////////////////////

dtkWidgetsLogView::dtkWidgetsLogView(QWidget *parent) : QWidget(parent), d(new dtkWidgetsLogViewPrivate)
{
    d->bar = new dtkWidgetsLogViewBar(this);

    d->tree = new dtkWidgetsLogViewTree(this);
    d->tree->setMaximumWidth(200);

    d->list = new dtkWidgetsLogViewList(this);

    d->checkbox_auto_scroll = new QCheckBox("Auto scroll", this);
    d->checkbox_auto_scroll->setTristate(false);

    QVBoxLayout *list_view_layout = new QVBoxLayout;
    list_view_layout->addWidget(d->checkbox_auto_scroll);
    list_view_layout->addWidget(d->list);

    QHBoxLayout *h_layout = new QHBoxLayout;
    h_layout->setContentsMargins(0, 0, 0, 0);
    h_layout->setSpacing(0);
    h_layout->addWidget(d->tree);
    h_layout->addLayout(list_view_layout);

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);
    layout->addWidget(d->bar);
    layout->addLayout(h_layout);

    connect(d->tree, SIGNAL(runtimeClicked()), d->list, SLOT(setRuntime()));
    connect(d->tree, SIGNAL(fileClicked(const QString&)), d->list, SLOT(setFile(const QString&)));

    connect(d->checkbox_auto_scroll, SIGNAL(stateChanged(int)), this, SLOT(autoScrollChecked(int)));
    connect(d->list, SIGNAL(clicked(const QModelIndex&)), this, SLOT(disableAutoScroll()));
    connect(d->bar, SIGNAL(displayTrace(bool)), this, SLOT(displayTrace(bool)));
    connect(d->bar, SIGNAL(displayDebug(bool)), this, SLOT(displayDebug(bool)));
    connect(d->bar, SIGNAL(displayInfo(bool)),  this, SLOT(displayInfo(bool)));
    connect(d->bar, SIGNAL(displayWarn(bool)),  this, SLOT(displayWarn(bool)));
    connect(d->bar, SIGNAL(displayError(bool)), this, SLOT(displayError(bool)));
    connect(d->bar, SIGNAL(displayFatal(bool)), this, SLOT(displayFatal(bool)));

    d->checkbox_auto_scroll->setChecked(true);
}

dtkWidgetsLogView::~dtkWidgetsLogView(void)
{
    delete d;

    d = NULL;
}

void dtkWidgetsLogView::autoScrollChecked(int state)
{
    if(state == Qt::Unchecked)
        this->disableAutoScroll();
    else
        this->enableAutoScroll();
}

void dtkWidgetsLogView::disableAutoScroll(void)
{
    d->list->setAutoScroll(false);
    d->checkbox_auto_scroll->setChecked(false);
}

void dtkWidgetsLogView::enableAutoScroll(void)
{
    d->list->setAutoScroll(true);
    d->checkbox_auto_scroll->setChecked(true);
}

void dtkWidgetsLogView::displayTrace(bool display)
{
    if(!display)
        d->exclude << "TRACE";
    else
        d->exclude.removeAll("TRACE");

    d->list->setFilter(d->expression());
}

void dtkWidgetsLogView::displayDebug(bool display)
{
    if(!display)
        d->exclude << "DEBUG";
    else
        d->exclude.removeAll("DEBUG");

    d->list->setFilter(d->expression());
}

void dtkWidgetsLogView::displayInfo(bool display)
{
    if(!display)
        d->exclude << "INFO";
    else
        d->exclude.removeAll("INFO");

    d->list->setFilter(d->expression());
}

void dtkWidgetsLogView::displayWarn(bool display)
{
    if(!display)
        d->exclude << "WARN";
    else
        d->exclude.removeAll("WARN");

    d->list->setFilter(d->expression());
}

void dtkWidgetsLogView::displayError(bool display)
{
    if(!display)
        d->exclude << "ERROR";
    else
        d->exclude.removeAll("ERROR");

    d->list->setFilter(d->expression());
}

void dtkWidgetsLogView::displayFatal(bool display)
{
    if(!display)
        d->exclude << "FATAL";
    else
        d->exclude.removeAll("FATAL");

    d->list->setFilter(d->expression());
}


text:
import angular from 'angular';
import _FingerprintJS from 'fingerprintjs2';

const MODULE_NAME = 'app.service.fingerprint.factory';
export default MODULE_NAME;

angular
  .module(MODULE_NAME, [])
  .value('FingerprintJS', _FingerprintJS)
  .factory('Fingerprint', FingerprintService);

/** @ngInject **/
function FingerprintService($q, FingerprintJS) {
  const service = { stream, fingerprint: {} };
  return service;

  ////////////////

  function stream() {
    return getFingerprint()
      .then(id => {
        angular.copy({ id }, service.fingerprint);
        return id;
      })
      .catch(error => {
        angular.copy({}, service.fingerprint);
        return $q.reject(error);
      });
  }

  ////////////////
  function getFingerprint() {
    const fingerprint = service.fingerprint.id;
    if (fingerprint) return $q.resolve(fingerprint);

    const defer = $q.defer();
    new FingerprintJS().get(defer.resolve);

    return defer.promise;
  }
}


text:
using System;
using UIKit;
using CoreGraphics;
using System.Linq;
using SpotifySDK;
using MediaPlayer;
using AVFoundation;
using CoreAnimation;

namespace Spookify
{
	public class MiniPlayerView : UIView, ISleepTimerController
	{
		public bool KeepTabBarInvisible { get; private set; } = false;
		public bool IsSessionValid { get { return CurrentPlayer.Current.IsSessionValid; } }
		public bool CanRenewSession { get { return CurrentPlayer.Current.CanRenewSession; } }
		public bool IsPlayerCreated { get {	return CurrentPlayer.Current.IsPlayerCreated; } }
		public SPTAudioStreamingController Player { get { return CurrentPlayer.Current.Player; } }
		bool SavePosition(bool store = true) { return CurrentPlayer.Current.SavePosition(store); }
		public void PlayCurrentAudioBook() { CurrentPlayer.Current.PlayCurrentAudioBook (); }

		UIView touchView,touchPlayView;
		UIImageView playImage;
		UIImageView showImage;
		UITabBarController _tabbarController;
		UILabel albumNameLabel, authorNameLabel, centerLabel;
		UIActivityIndicatorView activityIndicatorView;

		PlayerViewSleepTimer _playerViewSleepTimer;
		public DateTime SleepTimerStartTime { get; set; } = DateTime.MinValue;
		public int SleepTimerOpion { get; set; } = 0;

		#region ISleepTimerController implementation

		int ISleepTimerController.SleepTimerOpion {
			get {
				return this.SleepTimerOpion;
			}
			set {
				this.SleepTimerOpion = value;
			}
		}

		void ISleepTimerController.DisplayAlbum ()
		{
			UpdateCurrentAudiobook ();
		}

		DateTime ISleepTimerController.SleepTimerStartTime {
			get {
				return this.SleepTimerStartTime;
			}
			set {
				this.SleepTimerStartTime = value;
			}
		}

		UIView ISleepTimerController.View {
			get {
				return this;
			}
		}

		UIViewController ISleepTimerController.CurrentViewController {
			get {
				return _tabbarController.SelectedViewController;
			}
		}

		public override UIView HitTest (CGPoint point, UIEvent uievent)
		{
			var timeoutView = this.Subviews.FirstOrDefault (sv => sv.Tag == 100 && sv is UILabel);
			if (timeoutView != null) {
				CGPoint pointForTargetView = timeoutView.ConvertPointFromView (point, this);
				if (timeoutView.Bounds.Contains(pointForTargetView))

					// The target view may have its view hierarchy,
					// so call its hitTest method to return the right hit-test view
					return timeoutView.HitTest(pointForTargetView, uievent);
			}
			return base.HitTest (point, uievent);
		}
		#endregion

		public MiniPlayerView (UIView superView, UIViewController viewController)
		{
			_tabbarController = viewController.TabBarController;
			SetupView (superView, viewController);
			SetupRemoteControl ();
			SetupSleepTimer ();
		}

		void SetupSleepTimer ()
		{
			if (_playerViewSleepTimer == null)
				_playerViewSleepTimer = new PlayerViewSleepTimer (this);
			_playerViewSleepTimer.StartTimer ();
		}

		void SetupView (UIView superView, UIViewController viewController)
		{
			var tabBar = viewController.TabBarController.TabBar;
			var tabview = viewController.TabBarController.View;
			var tabFrame = tabBar.Frame;
			var frame = superView.Frame;
			Frame = new CGRect (frame.Left, frame.Top + frame.Height, frame.Width, 50);
			BackgroundColor = ConfigSpookify.BackgroundColorLight;
			this.AddSubview (albumNameLabel = new UILabel () {
				TextColor = UIColor.White,
				Font = UIFont.FromName ("HelveticaNeue", 12f),
				TranslatesAutoresizingMaskIntoConstraints = false,
				Lines = 0,
			});
			albumNameLabel.SetContentCompressionResistancePriority (750,UILayoutConstraintAxis.Vertical);
			this.AddSubview (authorNameLabel = new UILabel () {
				TextColor = UIColor.LightGray,
				Font = UIFont.FromName ("HelveticaNeue-Light", 12f),
				TranslatesAutoresizingMaskIntoConstraints = false,
			});
			this.AddSubview (centerLabel = new UILabel (new CGRect (55, 25, frame.Width - 110, 20)) {
				TextColor = UIColor.LightGray,
				Font = UIFont.FromName ("HelveticaNeue-Light", 12f),
				TranslatesAutoresizingMaskIntoConstraints = false,
				Lines = 0,
				LineBreakMode = UILineBreakMode.WordWrap
			});
			authorNameLabel.SetContentCompressionResistancePriority (751,UILayoutConstraintAxis.Vertical);
			this.AddSubview (showImage = new UIImageView (new CGRect (15, 15, 25, 25)) {
				Image = UIImage.FromBundle ("Up").ImageWithRenderingMode (UIImageRenderingMode.AlwaysTemplate),
				TintColor = UIColor.White,
				UserInteractionEnabled = true,
				TranslatesAutoresizingMaskIntoConstraints = false,
			});
			this.AddSubview (playImage = new UIImageView (new CGRect (frame.Width - 15 - 20, 15, 20, 20)) {
				TintColor = UIColor.White,
				UserInteractionEnabled = true,
				TranslatesAutoresizingMaskIntoConstraints = false,
			});
			this.AddSubview (activityIndicatorView = new UIActivityIndicatorView (new CGRect (frame.Width - 15 - 20, 15, 20, 20)) {
				TintColor = UIColor.White,
				UserInteractionEnabled = true,
				HidesWhenStopped = true,
				Hidden = true
			});
			this.AddSubview (touchView = new UIView (new CGRect (0, 0, Frame.Width - 100, Frame.Height)) {
				UserInteractionEnabled = true,
			});
			this.AddSubview (touchPlayView = new UIView (new CGRect (Frame.Width - 50, 0, 50, Frame.Height)) {
				UserInteractionEnabled = true,
			});
			UpdateCurrentAudiobook ();
			showImage.AddGestureRecognizer (new UITapGestureRecognizer (ShowBigPlayer));
			playImage.AddGestureRecognizer (new UITapGestureRecognizer (TogglePlaying));
			touchPlayView.AddGestureRecognizer (new UITapGestureRecognizer (TogglePlaying));
			touchView.AddGestureRecognizer (new UITapGestureRecognizer (ShowBigPlayer));
			this.TranslatesAutoresizingMaskIntoConstraints = false;
			tabview.AddSubview (this);

			var c = new NSLayoutConstraint[] {
				NSLayoutConstraint.Create(this, NSLayoutAttribute.Leading, NSLayoutRelation.Equal, tabBar, NSLayoutAttribute.Leading, 1, 0),
				NSLayoutConstraint.Create(this, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, tabBar, NSLayoutAttribute.Top, 1, 0),
				NSLayoutConstraint.Create(this, NSLayoutAttribute.Trailing, NSLayoutRelation.Equal, tabBar, NSLayoutAttribute.Trailing, 1, 0),
				NSLayoutConstraint.Create(this, NSLayoutAttribute.Height, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, 50),

				NSLayoutConstraint.Create(centerLabel, NSLayoutAttribute.Leading, NSLayoutRelation.Equal, this, NSLayoutAttribute.Leading, 1, 55),
				NSLayoutConstraint.Create(centerLabel, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, this, NSLayoutAttribute.CenterY, 1, 0),
				NSLayoutConstraint.Create(centerLabel, NSLayoutAttribute.Trailing, NSLayoutRelation.Equal, this, NSLayoutAttribute.Trailing, 1, -55),

				NSLayoutConstraint.Create(albumNameLabel, NSLayoutAttribute.Leading, NSLayoutRelation.Equal, this, NSLayoutAttribute.Leading, 1, 55),
				NSLayoutConstraint.Create(albumNameLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1, 8),
				NSLayoutConstraint.Create(albumNameLabel, NSLayoutAttribute.Trailing, NSLayoutRelation.Equal, this, NSLayoutAttribute.Trailing, 1, -55),

				NSLayoutConstraint.Create(authorNameLabel, NSLayoutAttribute.Leading, NSLayoutRelation.Equal, albumNameLabel, NSLayoutAttribute.Leading, 1, 0),
				NSLayoutConstraint.Create(authorNameLabel, NSLayoutAttribute.Top, NSLayoutRelation.GreaterThanOrEqual, albumNameLabel, NSLayoutAttribute.Bottom, 1, 2),
				NSLayoutConstraint.Create(authorNameLabel, NSLayoutAttribute.Trailing, NSLayoutRelation.Equal, albumNameLabel, NSLayoutAttribute.Trailing, 1, 0),
				NSLayoutConstraint.Create(authorNameLabel, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, this, NSLayoutAttribute.Bottom, 1, -8),

				NSLayoutConstraint.Create(showImage, NSLayoutAttribute.Leading, NSLayoutRelation.Equal, this, NSLayoutAttribute.Leading, 1, 15),
				NSLayoutConstraint.Create(showImage, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, this, NSLayoutAttribute.CenterY, 1, 0),
				NSLayoutConstraint.Create(showImage, NSLayoutAttribute.Width, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, 25),
				NSLayoutConstraint.Create(showImage, NSLayoutAttribute.Height, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, 25),

				NSLayoutConstraint.Create(playImage, NSLayoutAttribute.Trailing, NSLayoutRelation.Equal, this, NSLayoutAttribute.Trailing, 1, -15),
				NSLayoutConstraint.Create(playImage, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, this, NSLayoutAttribute.CenterY, 1, 0),
				NSLayoutConstraint.Create(playImage, NSLayoutAttribute.Width, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, 25),
				NSLayoutConstraint.Create(playImage, NSLayoutAttribute.Height, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, 25),
			};

			tabview.AddConstraints (c);
		}

		void ShowNoConnection() {
			centerLabel.Text = "Keine Internetverbindung\nStreaming nicht möglich";
			playImage.Image = UIImage.FromBundle ("NoConnection").ImageWithRenderingMode (UIImageRenderingMode.AlwaysTemplate);
			playImage.Hidden = true;
			activityIndicatorView.StopAnimating ();
		}
		void ShowPendingRenewSession() {
			centerLabel.Text = "Sitzung wird aufgebaut";
			playImage.Image = UIImage.FromBundle ("NotLoggedIn").ImageWithRenderingMode (UIImageRenderingMode.AlwaysTemplate);
			playImage.Hidden = true;
			activityIndicatorView.StartAnimating();
		}
		void ShowPendingLogin() {
			centerLabel.Text = "Anmeldung wird durchgeführt";
			playImage.Image = UIImage.FromBundle ("NotLoggedIn").ImageWithRenderingMode (UIImageRenderingMode.AlwaysTemplate);
			playImage.Hidden = true;
			activityIndicatorView.StartAnimating();
		}
		void ShowLoginToSpotify() {
			centerLabel.Text = "Bitte melde dich mit deinem\nPremium Spotify Account an";
			playImage.Image = UIImage.FromBundle ("NotLoggedIn").ImageWithRenderingMode (UIImageRenderingMode.AlwaysTemplate);
			playImage.Hidden = false;
			activityIndicatorView.StopAnimating ();
		}
		void ShowSelectAudiobook() {
			centerLabel.Text = "Wähle ein Hörbuch aus einer\nder Playlisten oder Suche\nnach einem Titel oder Autor";
			playImage.Image = UIImage.FromBundle ("Suche").ImageWithRenderingMode (UIImageRenderingMode.AlwaysTemplate);
			activityIndicatorView.StopAnimating ();
		}
		void UpdateCurrentAudiobook()
		{
			var ab = CurrentState.Current.CurrentAudioBook;

			bool hasConnection = Reachability.RemoteHostStatus () != NetworkStatus.NotReachable;
			bool pendingLogin = CurrentPlayer.Current.TriggerWaitingForLogin;
			bool pendingRenewSession = CurrentPlayer.Current.TriggerWaitingForSessionRenew;

			if (!hasConnection || !this.IsPlayerCreated || ab == null || pendingLogin || pendingRenewSession) {
				albumNameLabel.Text = "";
				authorNameLabel.Text = "";
				centerLabel.Text = "";
				centerLabel.Hidden = false;
				playImage.Image = null;
				if (!hasConnection) {
					ShowNoConnection();
				}
				else if (pendingRenewSession) {
					ShowPendingRenewSession ();
				}
				else if (pendingLogin) {
					ShowPendingLogin ();
				}
				else if (!this.IsPlayerCreated) {
					if (this.IsSessionValid) {
						ShowPendingLogin ();
						CurrentPlayer.Current.ResetPlayer ();
						var dummy = this.Player;
					} else if (this.CanRenewSession) {
						ShowPendingRenewSession ();
						CurrentPlayer.Current.RenewSession ();
					} else {
						ShowLoginToSpotify();
						if (this.BigPlayer != null && !this.BigPlayer.IsViewLoaded && !this.KeepTabBarInvisible) {
							this.ShowBigPlayer (false);
							this._tabbarController.SwitchToTab (4);
							this.KeepTabBarInvisible = true;
						}
					}
				} else {
					ShowSelectAudiobook();
				}
				storeIntervalCounter = 0;
			} else {
				SavePosition (storeIntervalCounter++ % 10 == 0);
				centerLabel.Hidden = true;
				centerLabel.Text = "";
				activityIndicatorView.StopAnimating ();
				playImage.Hidden = false;
				playImage.Image = Player.CurrentPlayButtonImageSmall ();
				albumNameLabel.Text = ab?.ToAlbumName ();
				if (ab != null) {
					if (!ab.Started && !ab.Finished) {
						authorNameLabel.Text = ab?.ToAuthorName () + " - " + ab?.TimeToEnd ();
					} else if (ab.Finished) {
						authorNameLabel.Text = ab?.ToAuthorName () + " - Beendet";
					} else if (ab.CurrentPosition != null) {
						authorNameLabel.Text = ab?.ToAuthorName () + " - " + ab?.TimeToEnd () + " verbleiben";
					} else {
						authorNameLabel.Text = ab?.ToAuthorName () + " - " + ab?.TimeToEnd ();
					}
				}

				SetupNowPlaying ();
			}
			if (BigPlayer != null) {
				BigPlayer?.DisplayAlbum ();
				// BackgroundColor = ConfigSpookify.BackgroundColorLight;
				if (BigPlayer.AlbumImage?.Image != null)
				{
					BackgroundColor = BigPlayer.AlbumImage.Image.AverageColorDarkerAsRef(ConfigSpookify.BackgroundColorLight);
					/*
					var l = BigPlayer.AlbumImage.Image.Luminance();
					if (l < 0.5)
						BackgroundColor = BigPlayer.AlbumImage.Image.AverageColor();
					else
						BackgroundColor = ConfigSpookify.BackgroundColorLight;
						*/
				}
			}
		}
		int storeIntervalCounter = 0;

		void SetupNowPlaying()
		{
			var ab = CurrentState.Current.CurrentAudioBook;
			if (ab != null) {
				MPNowPlayingInfoCenter info = MPNowPlayingInfoCenter.DefaultCenter;

				var nowPlaying = new MPNowPlayingInfo ();
				if (nowPlaying != null) {
					// nowPlaying.DiscCount = 1;
					// nowPlaying.DiscNumber = 0;
					nowPlaying.PlaybackRate = 1.0;
					nowPlaying.AlbumTitle = ab.ToAlbumName ();
					nowPlaying.Artist = ab.ToAuthorName ();

					nowPlaying.AlbumTrackNumber = 0;
					nowPlaying.ElapsedPlaybackTime = 0;
					nowPlaying.PlaybackDuration = 0;

					if (ab.Tracks != null) {

						nowPlaying.AlbumTrackCount = 1; // ab.Tracks.Count;
						if (ab.CurrentPosition != null &&
							ab.Tracks != null &&
							ab.CurrentPosition.TrackIndex < ab.Tracks.Count)
						{
							var track = ab.Tracks.ElementAt (ab.CurrentPosition.TrackIndex);
							nowPlaying.Title = track.Name;
							nowPlaying.AlbumTrackNumber = 1; // ab.CurrentPosition.TrackIndex+1;
							nowPlaying.ElapsedPlaybackTime = ab.GesamtSeitAnfang; //ab.CurrentPosition.PlaybackPosition;
							nowPlaying.PlaybackDuration = ab.GesamtBisEnde; // track.Duration;
						}
					}

					if (BigPlayer?.AlbumImage?.Image != null)
						nowPlaying.Artwork = new MPMediaItemArtwork (BigPlayer.AlbumImage.Image);
					info.NowPlaying = nowPlaying;
				}
			}
		}

		void SetupRemoteControl()
		{
			AVAudioSession sharedInstance = AVAudioSession.SharedInstance();
			sharedInstance.SetCategory (AVAudioSessionCategory.Playback);
			sharedInstance.SetActive (true);
			this.BecomeFirstResponder ();
			UIApplication.SharedApplication.BeginReceivingRemoteControlEvents ();
			MPRemoteCommandCenter commandCenter = MPRemoteCommandCenter.Shared;

			var skipBackwardIntervalCommand = commandCenter.SkipBackwardCommand;
			skipBackwardIntervalCommand.Enabled = true;
			skipBackwardIntervalCommand.PreferredIntervals = new [] { 30.0, 60.0 };
			skipBackwardIntervalCommand.AddTarget( (remoteCommand) =>  {
				var cc = remoteCommand as MPSkipIntervalCommandEvent;
				return this.SkipTime(-(cc?.Interval ?? 30.0)) ? MPRemoteCommandHandlerStatus.Success : MPRemoteCommandHandlerStatus.CommandFailed;
			});
			MPSkipIntervalCommand skipForwardIntervalCommand = commandCenter.SkipForwardCommand;
			skipForwardIntervalCommand.Enabled = true;
			skipForwardIntervalCommand.PreferredIntervals = new [] { 30.0, 60.0 };
			skipForwardIntervalCommand.AddTarget( (remoteCommand) => {
				var cc = remoteCommand as MPSkipIntervalCommandEvent;
				return this.SkipTime(cc?.Interval ?? 30.0) ? MPRemoteCommandHandlerStatus.Success : MPRemoteCommandHandlerStatus.CommandFailed;
			});
			commandCenter.TogglePlayPauseCommand.Enabled = true;
			commandCenter.TogglePlayPauseCommand.AddTarget( (remoteCommand) => {
				return this.TogglePlaying(null) ? MPRemoteCommandHandlerStatus.Success : MPRemoteCommandHandlerStatus.CommandFailed;
			});
			commandCenter.PlayCommand.Enabled = true;
			commandCenter.PlayCommand.AddTarget( (remoteCommand) => {
				return this.TogglePlaying(true) ? MPRemoteCommandHandlerStatus.Success : MPRemoteCommandHandlerStatus.CommandFailed;
			});
			commandCenter.StopCommand.Enabled = true;
			commandCenter.StopCommand.AddTarget( (remoteCommand) => {
				return this.TogglePlaying(false) ? MPRemoteCommandHandlerStatus.Success : MPRemoteCommandHandlerStatus.CommandFailed;
			});
			commandCenter.PauseCommand.Enabled = true;
			commandCenter.PauseCommand.AddTarget( (remoteCommand) =>  {
				return this.TogglePlaying(false) ? MPRemoteCommandHandlerStatus.Success : MPRemoteCommandHandlerStatus.CommandFailed;
			});
			commandCenter.NextTrackCommand.Enabled = true;
			commandCenter.NextTrackCommand.AddTarget( (remoteCommand) => {
				return this.SkipTrack(1) ? MPRemoteCommandHandlerStatus.Success : MPRemoteCommandHandlerStatus.CommandFailed;
			});
			commandCenter.PreviousTrackCommand.Enabled = true;
			commandCenter.PreviousTrackCommand.AddTarget( (remoteCommand) =>  {
				return this.SkipTrack(-1) ? MPRemoteCommandHandlerStatus.Success : MPRemoteCommandHandlerStatus.CommandFailed;
			});
			/* Bookmark Command: should be enabled only when configured in settings.
			var bc = commandCenter.BookmarkCommand;
			bc.Enabled = true;
			bc.AddTarget ((remoteCommand) => {
				var ab = CurrentState.Current.CurrentAudioBook;
				if (ab == null || ab.CurrentPosition == null)
					return MPRemoteCommandHandlerStatus.CommandFailed;
				ab.AddBookmark(new AudioBookBookmark(ab.CurrentPosition));
				return MPRemoteCommandHandlerStatus.Success;
			});
			*/
		}

		PlayerViewController _playerViewController = null;
		PlayerViewController BigPlayer {
			get {
				if (_playerViewController == null)
					_playerViewController = _tabbarController.SelectedViewController.Storyboard.InstantiateViewController("PopupPlayer") as PlayerViewController;
				return _playerViewController;
			}
		}
		void ShowBigPlayer() {
			ShowBigPlayer (true);
		}
		void ShowBigPlayer(bool animated)
		{
			{
				var vc = BigPlayer;
				if (vc != null) {
					vc.MiniPlayer = this;
					if (animated) {
						_playerViewController.UpdateGUI ();
					}
					_tabbarController.SelectedViewController.PresentViewController (_playerViewController, animated, () => {

					});
				}
			}
		}
		public void DisposeBigPlayer()
		{
			if (KeepTabBarInvisible) {
				if (_playerViewController != null)
					_playerViewController.Dispose ();
				_playerViewController = null;
			}
		}

		bool EnsurePlayer()
		{
			bool hasConnection = Reachability.RemoteHostStatus () != NetworkStatus.NotReachable;
			if (hasConnection) {
				if (!this.IsPlayerCreated) {
					if (this.IsSessionValid) {
						var dummy = this.Player;
					} else if (this.CanRenewSession) {
						CurrentPlayer.Current.RenewSession ();
					} else {
						CurrentPlayer.Current.OpenLoginPage (_tabbarController.SelectedViewController);
					}
				}
				return this.IsPlayerCreated;
			}
			return false;
		}

		public void TogglePlaying() {
			TogglePlaying(null);
		}
		public bool TogglePlaying(bool? play)
		{
			if (EnsurePlayer ()) {
				bool shouldPlay = play.HasValue ? play.Value : !Player.IsPlaying;
				bool wrongTrack = Player?.CurrentTrackURI?.AbsoluteString != CurrentState.Current.CurrentTrackURI;
				if ((this.Player.TrackListSize == 0 || wrongTrack) && shouldPlay) {
					CurrentPlayer.Current.PlayCurrentAudioBook ();
				} else {
					Player.SetIsPlaying (shouldPlay, (err) => {
						InvokeOnMainThread (UpdateCurrentAudiobook);
					});
				}
				return true;
			}
			return false;
		}

		public bool SkipTrack(int step)
		{
			if (EnsurePlayer()) {
				if (SavePosition (false)) {
					if (CurrentState.Current.CurrentAudioBook.SkipTrack (step)) {
						CurrentState.Current.StoreCurrent ();
						PlayCurrentAudioBook ();
					}
				}
				return true;
			}
			return false;
		}
		public bool SkipTime(double seconds)
		{
			if (EnsurePlayer()) {
				if (SavePosition (false)) {
					if (CurrentState.Current.CurrentAudioBook.AdjustTime (seconds)) {
						CurrentState.Current.StoreCurrent ();
						PlayCurrentAudioBook ();
					}
				}
				return true;
			}
			return false;
		}
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface com.communote.server.api.core.note.processor.NoteRenderingPreProcessorManager (Communote 3.5 API)</title>
<meta name="date" content="2019-02-02">
<link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
com.communote.server.api.core.note.processor.NoteRenderingPreProcessorManager

Packages that use NoteRenderingPreProcessorManager

Package
Description

com.communote.server.core.note.processor

Uses of NoteRenderingPreProcessorManager in com.communote.server.core.note.processor

Classes in com.communote.server.core.note.processor that implement NoteRenderingPreProcessorManager

Modifier and Type
Class and Description

class
NoteRenderingExtensionPoint

Implementation of the note rendering preprocessor extension point.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2019 Communote team. All rights reserved.


text:
<!DOCTYPE html>

    <title>Basic usage</title>
    <meta charset="utf-8">
    <link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet">

        Back

TreeMap rendering types

                        <input id="typeSquarified" name="type"
                                    type="radio" value="squarified" checked="checked" autocomplete="off" />
                        Squarified

                        <input id="typeVertical" name="type"
                                    type="radio" value="vertical" autocomplete="off" />
                        Vertical(Slice and Dice)

                        <input id="typeHorizontal" name="type"
                                    type="radio" value="horizontal" autocomplete="off" />
                        Horizontal(Slice and Dice)


text:
package org.elasticsearch.gradle.test;

import com.carrotsearch.randomizedtesting.JUnit4MethodProvider;
import com.carrotsearch.randomizedtesting.RandomizedRunner;
import com.carrotsearch.randomizedtesting.annotations.TestMethodProviders;
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakLingering;
import org.junit.Assert;
import org.junit.runner.RunWith;

@RunWith(RandomizedRunner.class)
@TestMethodProviders({
    JUnit4MethodProvider.class,
    JUnit3MethodProvider.class
})
@ThreadLeakLingering(linger = 5000) // wait for "Connection worker" to die
public abstract class BaseTestCase extends Assert {
}


text:
package com.antigenomics.mageri.preprocessing;

import com.antigenomics.mageri.misc.ParameterSet;
import org.jdom.Element;

public class DemultiplexParameters implements ParameterSet {
    private final boolean orientedReads;
    private final int maxTruncations;
    private final double maxGoodQualMMRatio, maxLowQualityMMRatio;
    private final byte lowQualityThreshold;

    public static DemultiplexParameters DEFAULT = new DemultiplexParameters(false,
            2, 0.05, 0.1,
            (byte) 20),
            ORIENTED = new DemultiplexParameters(true,
                    2, 0.05, 0.1,
                    (byte) 20);

    public DemultiplexParameters(boolean orientedReads,
                                 int maxTruncations, double maxGoodQualMMRatio, double maxLowQualityMMRatio,
                                 byte lowQualityThreshold) {
        this.orientedReads = orientedReads;
        this.maxTruncations = maxTruncations;
        this.maxGoodQualMMRatio = maxGoodQualMMRatio;
        this.maxLowQualityMMRatio = maxLowQualityMMRatio;
        this.lowQualityThreshold = lowQualityThreshold;
    }

    public boolean orientedReads() {
        return orientedReads;
    }

    public int getMaxTruncations() {
        return maxTruncations;
    }

    public double getMaxGoodQualMMRatio() {
        return maxGoodQualMMRatio;
    }

    public double getMaxLowQualityMMRatio() {
        return maxLowQualityMMRatio;
    }

    public byte getLowQualityThreshold() {
        return lowQualityThreshold;
    }

    public DemultiplexParameters withOrientedReads(boolean orientedReads) {
        return new DemultiplexParameters(orientedReads,
                maxTruncations, maxGoodQualMMRatio, maxLowQualityMMRatio,
                lowQualityThreshold);
    }

    public DemultiplexParameters withMaxTruncations(int maxTruncations) {
        return new DemultiplexParameters(orientedReads,
                maxTruncations, maxGoodQualMMRatio, maxLowQualityMMRatio,
                lowQualityThreshold);
    }

    public DemultiplexParameters withMaxGoodQualMMRatio(double maxGoodQualMMRatio) {
        return new DemultiplexParameters(orientedReads,
                maxTruncations, maxGoodQualMMRatio, maxLowQualityMMRatio,
                lowQualityThreshold);
    }

    public DemultiplexParameters withMaxLowQualityMMRatio(double maxLowQualityMMRatio) {
        return new DemultiplexParameters(orientedReads,
                maxTruncations, maxGoodQualMMRatio, maxLowQualityMMRatio,
                lowQualityThreshold);
    }

    public DemultiplexParameters withLowQualityThreshold(byte lowQualityThreshold) {
        return new DemultiplexParameters(orientedReads,
                maxTruncations, maxGoodQualMMRatio, maxLowQualityMMRatio,
                lowQualityThreshold);
    }

    @Override
    public Element toXml() {
        Element e = new Element("DemultiplexParameters");
        e.addContent(new Element("orientedReads").setText(Boolean.toString(orientedReads)));
        e.addContent(new Element("maxTruncations").setText(Integer.toString(maxTruncations)));
        e.addContent(new Element("maxGoodQualMMRatio").setText(Double.toString(maxGoodQualMMRatio)));
        e.addContent(new Element("maxLowQualityMMRatio").setText(Double.toString(maxLowQualityMMRatio)));
        e.addContent(new Element("lowQualityThreshold").setText(Byte.toString(lowQualityThreshold)));
        return e;
    }

    public static DemultiplexParameters fromXml(Element parent) {
        Element e = parent.getChild("DemultiplexParameters");
        return new DemultiplexParameters(
                Boolean.parseBoolean(e.getChildTextTrim("orientedReads")),
                Integer.parseInt(e.getChildTextTrim("maxTruncations")),
                Double.parseDouble(e.getChildTextTrim("maxGoodQualMMRatio")),
                Double.parseDouble(e.getChildTextTrim("maxLowQualityMMRatio")),
                Byte.parseByte(e.getChildTextTrim("lowQualityThreshold"))
        );
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DemultiplexParameters that = (DemultiplexParameters) o;

        if (lowQualityThreshold != that.lowQualityThreshold) return false;
        if (Double.compare(that.maxGoodQualMMRatio, maxGoodQualMMRatio) != 0) return false;
        if (Double.compare(that.maxLowQualityMMRatio, maxLowQualityMMRatio) != 0) return false;
        if (maxTruncations != that.maxTruncations) return false;
        if (orientedReads != that.orientedReads) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result;
        long temp;
        result = (orientedReads ? 1 : 0);
        result = 31 * result + maxTruncations;
        temp = Double.doubleToLongBits(maxGoodQualMMRatio);
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        temp = Double.doubleToLongBits(maxLowQualityMMRatio);
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        result = 31 * result + (int) lowQualityThreshold;
        return result;
    }
}


text:
if [ !$NODE_LAUNCH_SCRIPT ]; then
  export NODE_LAUNCH_SCRIPT="webServerStart.js"
fi

forever stop $NODE_LAUNCH_SCRIPT


text:
Polymer({
  is: 'moi-client-view',
  behaviors: [TranslateBehavior, AssetBehavior, StudentBehavior, UtilsBehavior, NotificationBehavior],
  properties: {
    tutorId: String
  },
  ready: function () {
    var _this = this;
    var path = location.pathname;
    AnalyticsBehavior.track('set', 'page', path);
    AnalyticsBehavior.track('send', 'pageview');

    var studentsApi = '/tutor/dashboard/students';
    _this.statisticsApi = '/tutor/client/get_client_statistics';
    var params = _this.getCurrentUrlParams();
    _this.activityPath = '/tutor/analysis';
    _this.activityHref = '';
    _this.userIdSelected = null;
    _this.clientTreeSrc = '';
    _this.loading = true;
    _this.data = {};
    var studentsAjax = $.ajax({
      url: studentsApi,
      type: 'GET'
    });
    if (params && params.client_id) {
      _this.userIdSelected = params.client_id;
      var statisticsAjax = _this.buildStatisticsAjax(_this.userIdSelected);
      _this.getClientStatistics(studentsAjax, statisticsAjax).done(function () {
        _this.loading = false;
      });
    } else {
      _this.getStudents(studentsAjax).done(function () {
        _this.loading = false;
      });
    }
    NotificationBehavior.getNotifications(function(counter) {
      this.notificationCounter = counter;
    }.bind(this));

    NotificationBehavior.startPusherForTutorAccount(this.tutorId, this.onNotificationReceived.bind(this));
  },
  onStudentSelected: function (e, val) {
    var _this = this;
    _this.userIdSelected = val;
    _this.loading = true;
    var statisticsAjax = _this.buildStatisticsAjax(_this.userIdSelected);
    $.when(statisticsAjax).then(function (res) {
      AnalyticsBehavior.track('send', 'event', 'Obtener detalles de un alumno', 'Select');
      _this.prepareAndFormatAnalysisData(res);
      _this.addParamToUrl('client', 'client_id', _this.userIdSelected);
    }).done(function (x) {
      _this.loading = false;
    });
  },
  onSelectItemsLoaded: function (e, elem) {
    var _this = this;
    var params = _this.getCurrentUrlParams();
    if (params && params.client_id) {
      $(elem).find('select').val(params.client_id);
    }
  },
  getStudents: function (studentsAjax) {
    var _this = this;
    return $.when(studentsAjax).then(function (res) {
      if (res.data) {
        _this.students = _this.formatStudentData(res.data);
      }
    });
  },
  getClientStatistics: function (studentsAjax, statisticsAjax) {
    var _this = this;
    return $.when(studentsAjax, statisticsAjax).then(function (res1, res2) {
      if (res1[0].data) {
        _this.students = _this.formatStudentData(res1[0].data);
      }
      if (res2[0].data) {
        _this.prepareAndFormatAnalysisData(res2[0]);
      }
    });
  },
  buildStatisticsAjax: function (userIdSelected) {
    var _this = this;
    return $.ajax({
      url: _this.statisticsApi,
      type: 'GET',
      data: {
        client_id: userIdSelected
      }
    });
  },
  prepareAndFormatAnalysisData: function (res) {
    var _this = this;
    _this.data = res.data;
    _this.data.client = res.meta.client;
    _this.activityHref = _this.activityPath + '?client_id=' + _this.userIdSelected;
  },
  onNotificationReceived: function(notification) {
    this.notificationCounter++;
    NotificationBehavior.applyBadgetEffect(this.$.moiBadge);
  }

});


text:
.. README.rst
.. Copyright (c) 2013-2019 Pablo Acosta-Serafini
.. See LICENSE for details

.. image:: https://badge.fury.io/py/pexdoc.svg
    :target: https://pypi.org/project/pexdoc
    :alt: PyPI version

.. image:: https://img.shields.io/pypi/l/pexdoc.svg
    :target: https://pypi.org/project/pexdoc
    :alt: License

.. image:: https://img.shields.io/pypi/pyversions/pexdoc.svg
    :target: https://pypi.org/project/pexdoc
    :alt: Python versions supported

.. image:: https://img.shields.io/pypi/format/pexdoc.svg
    :target: https://pypi.org/project/pexdoc
    :alt: Format

|

.. image::
    https://dev.azure.com/pmasdev/pexdoc/_apis/build/status/pmacosta.pexdoc?branchName=master
    :target: https://dev.azure.com/pmasdev/pexdoc/_build?definitionId=5&_a=summary
    :alt: Continuous integration test status

.. image::
    https://img.shields.io/azure-devops/coverage/pmasdev/pexdoc/5.svg
    :target: https://dev.azure.com/pmasdev/pexdoc/_build?definitionId=5&_a=summary
    :alt: Continuous integration test coverage

.. image::
    https://readthedocs.org/projects/pip/badge/?version=stable
    :target: https://pip.readthedocs.io/en/stable/?badge=stable
    :alt: Documentation status

|

Description
===========

.. role:: bash(code)
	:language: bash

.. _Cog: https://nedbatchelder.com/code/cog
.. _Coverage: https://coverage.readthedocs.io
.. _Decorator: https://raw.githubusercontent.com/micheles/decorator/mast
   er/docs/documentation.md
.. _Docutils: http://docutils.sourceforge.net/docs
.. _Funcsigs: https://pypi.org/project/funcsigs
.. _Mock: https://docs.python.org/3/library/unittest.mock.html
.. _Pmisc: http://pmisc.readthedocs.org
.. _Ptrie: http://ptrie.readthedocs.org
.. _PyContracts: https://andreacensi.github.io/contracts
.. _Pydocstyle: http://www.pydocstyle.org
.. _Pylint: https://www.pylint.org
.. _Py.test: http://pytest.org
.. _Pytest-coverage: https://pypi.org/project/pytest-cov
.. _Pytest-pmisc: http://pytest-pmisc.readthedocs.org
.. _Pytest-xdist: https://pypi.org/project/pytest-xdist
.. _Sphinx: http://sphinx-doc.org
.. _ReadTheDocs Sphinx theme: https://github.com/rtfd/sphinx_rtd_theme
.. _Inline Syntax Highlight Sphinx Extension:
   https://bitbucket.org/klorenz/sphinxcontrib-inlinesyntaxhighlight
.. _Shellcheck Linter Sphinx Extension:
   https://pypi.org/project/sphinxcontrib-shellcheck
.. _Tox: https://testrun.org/tox
.. _Virtualenv: https://docs.python-guide.org/dev/virtualenvs

This package provides a light framework that can be used to automatically
generate exceptions documentation marked up in `reStructuredText
<http://docutils.sourceforge.net/rst.html>`_.

The exdoc module details how to register exceptions, how to traced them and
how to generate their documentation

Interpreter
===========

The package has been developed and tested with Python 2.7, 3.5, 3.6 and 3.7
under Linux (Debian, Ubuntu), Apple macOS and Microsoft Windows

Installing
==========

.. code-block:: console

	$ pip install pexdoc

Documentation
=============

Available at `Read the Docs <https://pexdoc.readthedocs.io>`_

Contributing
============

1. Abide by the adopted `code of conduct
   <https://www.contributor-covenant.org/version/1/4/code-of-conduct>`_

2. Fork the `repository <https://github.com/pmacosta/pexdoc>`_ from GitHub and
   then clone personal copy [#f1]_:

    .. code-block:: console

        $ github_user=myname
        $ git clone --recurse-submodules \
              https://github.com/"${github_user}"/pexdoc.git
        Cloning into 'pexdoc'...
        ...
        $ cd pexdoc || exit 1
        $ export PEXDOC_DIR=${PWD}
        $

3. The package uses two sub-modules: a set of custom Pylint plugins to help with
   some areas of code quality and consistency (under the ``pylint_plugins``
   directory), and a lightweight package management framework (under the
   ``pypkg`` directory). Additionally, the `pre-commit framework
   <https://pre-commit.com/>`_ is used to perform various pre-commit code
   quality and consistency checks. To enable the pre-commit hooks:

    .. code-block:: console

        $ cd "${PEXDOC_DIR}" || exit 1
        $ pre-commit install
        pre-commit installed at .../pexdoc/.git/hooks/pre-commit
        $

4. Ensure that the Python interpreter can find the package modules
   (update the :bash:`$PYTHONPATH` environment variable, or use
   `sys.paths() <https://docs.python.org/3/library/sys.html#sys.path>`_,
   etc.)

   .. code-block:: console

       $ export PYTHONPATH=${PYTHONPATH}:${PEXDOC_DIR}
       $

5. Install the dependencies (if needed, done automatically by pip):

    * `Cog`_ (2.5.1 or newer)

    * `Coverage`_ (4.5.3 or newer)

    * `Decorator`_ (4.4.0 or newer)

    * `Docutils`_ (0.14 or newer)

    * `Funcsigs`_ (1.0.2 or newer)

    * `Inline Syntax Highlight Sphinx Extension`_ (0.2 or newer)

    * `Mock`_ (2.0.0 or newer)

    * `Pmisc`_ (1.5.8 or newer)

    * `Ptrie`_ (1.1.6 or newer)

    * `Py.test`_ (4.3.1 or newer)

    * `PyContracts`_ (1.8.2 or newer)

    * `Pydocstyle`_ (3.0.0 or newer)

    * `Pylint`_ (Python 2.x: 1.9.4 or newer, Python 3.x: 2.3.1 or newer)

    * `Pytest-coverage`_ (2.6.1 or newer)

    * `Pytest-pmisc`_ (1.0.7 or newer)

    * `Pytest-xdist`_ (optional, 1.26.1 or newer)

    * `ReadTheDocs Sphinx theme`_ (0.4.3 or newer)

    * `Shellcheck Linter Sphinx Extension`_ (1.0.8 or newer)

    * `Sphinx`_ (1.8.5 or newer)

    * `Tox`_ (3.7.0 or newer)

    * `Virtualenv`_ (16.4.3 or newer)

6. Implement a new feature or fix a bug

7. Write a unit test which shows that the contributed code works as expected.
   Run the package tests to ensure that the bug fix or new feature does not
   have adverse side effects. If possible achieve 100\% code and branch
   coverage of the contribution. Thorough package validation
   can be done via Tox and Pytest:

   .. code-block:: console

       $ PKG_NAME=pexdoc tox
       GLOB sdist-make: .../pexdoc/setup.py
       py27-pkg create: .../pexdoc/.tox/py27
       py27-pkg installdeps: -r.../pexdoc/requirements/tests_py27.pip, -r.../pexdoc/requirements/docs_py27.pip
       ...
         py27-pkg: commands succeeded
         py35-pkg: commands succeeded
         py36-pkg: commands succeeded
         py37-pkg: commands succeeded
         congratulations :)
       $

   `Setuptools <https://bitbucket.org/pypa/setuptools>`_ can also be used
   (Tox is configured as its virtual environment manager):

   .. code-block:: console

       $ PKG_NAME=pexdoc python setup.py tests
       running tests
       running egg_info
       writing pexdoc.egg-info/PKG-INFO
       writing dependency_links to pexdoc.egg-info/dependency_links.txt
       writing requirements to pexdoc.egg-info/requires.txt
       ...
         py27-pkg: commands succeeded
         py35-pkg: commands succeeded
         py36-pkg: commands succeeded
         py37-pkg: commands succeeded
         congratulations :)
       $

   Tox (or Setuptools via Tox) runs with the following default environments:
   ``py27-pkg``, ``py35-pkg``, ``py36-pkg`` and ``py37-pkg`` [#f3]_. These use
   the 2.7, 3.5, 3.6 and 3.7 interpreters, respectively, to test all code in
   the documentation (both in Sphinx ``*.rst`` source files and in
   docstrings), run all unit tests, measure test coverage and re-build the
   exceptions documentation. To pass arguments to Pytest (the test runner) use
   a double dash (``--``) after all the Tox arguments, for example:

   .. code-block:: console

       $ PKG_NAME=pexdoc tox -e py27-pkg -- -n 4
       GLOB sdist-make: .../pexdoc/setup.py
       py27-pkg inst-nodeps: .../pexdoc/.tox/.tmp/package/1/pexdoc-1.1.4.zip
       ...
         py27-pkg: commands succeeded
         congratulations :)
       $

   Or use the :code:`-a` Setuptools optional argument followed by a quoted
   string with the arguments for Pytest. For example:

   .. code-block:: console

       $ PKG_NAME=pexdoc python setup.py tests -a "-e py27-pkg -- -n 4"
       running tests
       ...
         py27-pkg: commands succeeded
         congratulations :)
       $

   There are other convenience environments defined for Tox [#f3]_:

    * ``py27-repl``, ``py35-repl``, ``py36-repl`` and ``py37-repl`` run the
      Python 2.7, 3.5, 3.6 and 3.7 REPL, respectively, in the appropriate
      virtual environment. The ``pexdoc`` package is pip-installed by Tox when
      the environments are created.  Arguments to the interpreter can be
      passed in the command line after a double dash (``--``).

    * ``py27-test``, ``py35-test``, ``py36-test`` and ``py37-test`` run Pytest
      using the Python 2.7, 3.5, 3.6 and 3.7 interpreter, respectively, in the
      appropriate virtual environment. Arguments to pytest can be passed in
      the command line after a double dash (``--``) , for example:

      .. code-block:: console

       $ PKG_NAME=pexdoc tox -e py27-test -- -x test_pexdoc.py
       GLOB sdist-make: .../pexdoc/setup.py
       py27-pkg inst-nodeps: .../pexdoc/.tox/.tmp/package/1/pexdoc-1.1.4.zip
       ...
         py27-pkg: commands succeeded
         congratulations :)
       $
    * ``py27-test``, ``py35-test``, ``py36-test`` and ``py37-test`` test code
      and branch coverage using the 2.7, 3.5, 3.6 and 3.7 interpreter,
      respectively, in the appropriate virtual environment. Arguments to
      pytest can be passed in the command line after a double dash (``--``).
      The report can be found in :bash:`${PEXDOC_DIR}/.tox/py[PV]/usr/share/pe
      xdoc/tests/htmlcov/index.html` where ``[PV]`` stands for ``2.7``,
      ``3.5``, ``3.6`` or ``3.7`` depending on the interpreter used.

8. Verify that continuous integration tests pass. The package has continuous
   integration configured for Linux, Apple macOS and Microsoft Windows (all via
   `Azure DevOps <https://dev.azure.com/pmasdev>`_).

9. Document the new feature or bug fix (if needed). The script
   :bash:`${PEXDOC_DIR}/pypkg/build_docs.py` re-builds the whole package
   documentation (re-generates images, cogs source files, etc.):

   .. code-block:: console

       $ "${PEXDOC_DIR}"/pypkg/build_docs.py -h
       usage: build_docs.py [-h] [-d DIRECTORY] [-r]
                            [-n NUM_CPUS] [-t]

       Build pexdoc package documentation

       optional arguments:
         -h, --help            show this help message and exit
         -d DIRECTORY, --directory DIRECTORY
                               specify source file directory
                               (default ../pexdoc)
         -r, --rebuild         rebuild exceptions documentation.
                               If no module name is given all
                               modules with auto-generated
                               exceptions documentation are
                               rebuilt
         -n NUM_CPUS, --num-cpus NUM_CPUS
                               number of CPUs to use (default: 1)
         -t, --test            diff original and rebuilt file(s)
                               (exit code 0 indicates file(s) are
                               identical, exit code 1 indicates
                               file(s) are different)

.. rubric:: Footnotes

.. [#f1] All examples are for the `bash <https://www.gnu.org/software/bash/>`_
   shell

.. [#f2] It is assumed that all the Python interpreters are in the executables
   path. Source code for the interpreters can be downloaded from Python's main
   `site <https://www.python.org/downloads/>`_

.. [#f3] Tox configuration largely inspired by
   `Ionel's codelog <https://blog.ionelmc.ro/2015/04/14/
   tox-tricks-and-patterns/>`_

License
=======

The MIT License (MIT)

Copyright (c) 2013-2019 Pablo Acosta-Serafini

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


text:
namespace Mitternacht.Common {
	public enum PunishmentAction {
		Mute,
		Kick,
		Ban,
		Softban,
	}
}


text:
START_ATF_NAMESPACE
    #pragma pack(push, 4)
    struct _qry_case_character_rename
    {
        unsigned int dwCharSerial;
        unsigned int dwAlreadySerial;
        _STORAGE_POS_INDIV ItemInfo;
        char wszCharName[17];
        char wszOldName[17];
    public:
        _qry_case_character_rename();
        void ctor__qry_case_character_rename();
        int size();
    };
    #pragma pack(pop)
    static_assert(ATF::checkSize<_qry_case_character_rename, 48>(), "_qry_case_character_rename");
END_ATF_NAMESPACE


text:
/**
* @module business/reducers/access
*/

/**
 * Action type ACTION_TYPE_FETCH_SUCCESS
 * @const {string} ACTION_TYPE_FETCH_SUCCESS
 * @default 'Access: fetching successfuly'
 */
export const ACTION_TYPE_FETCH_SUCCESS = 'Access: fetching successfuly';

/**
 * Action type ACTION_TYPE_ALL_ACCESS
 * @const {string} ACTION_TYPE_ALL_ACCESS
 * @default 'Access: all access'
 */
export const ACTION_TYPE_ALL_ACCESS = 'Access: all access';

/**
 * Action type ACTION_TYPE_CHANGE_QUANTITY_ACCESS
 * @const {string} ACTION_TYPE_CHANGE_QUANTITY_ACCESS
 * @default 'Access: change quantity'
 */
export const ACTION_TYPE_CHANGE_QUANTITY_ACCESS = 'Access: change quantity';

/**
 * @function access
 * @param {object} state initialState
 * @param {object} action payload
 * @return {object} new reducer's state
 */
export default function access(state = [], action = null) {
    switch(action.type){
    case ACTION_TYPE_FETCH_SUCCESS:
        return action.payload;
        break;
    case ACTION_TYPE_ALL_ACCESS:
        return action.payload;
        break;
    case ACTION_TYPE_CHANGE_QUANTITY_ACCESS:
        return action.payload;
        break;
    default:
        return state;
        break;
    }
}


text:
package glredbook10;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.nio.FloatBuffer;

import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.awt.GLJPanel;
import javax.swing.JFrame;

import com.jogamp.opengl.util.GLBuffers;

/**
 * This program demonstrates use of OpenGL feedback. First, a lighting
 * environment is set up and a few lines are drawn. Then feedback mode is
 * entered, and the same lines are drawn. The results in the feedback buffer are
 * printed.
 *
 * @author Kiet Le (Java port) Ported to JOGL 2.x by Claudio Eduardo Goes
 */
public class feedback//
        extends GLSkeleton<GLJPanel>
        implements GLEventListener, KeyListener {

    @Override
    protected GLJPanel createDrawable() {
        GLCapabilities caps = new GLCapabilities(null);
        //
        GLJPanel panel = new GLJPanel(caps);
        panel.addGLEventListener(this);
        panel.addKeyListener(this);
        return panel;
    }

    public static void main(String[] args) {
        feedback demo = new feedback();

        JFrame.setDefaultLookAndFeelDecorated(true);
        JFrame frame = new JFrame("feedback");
        frame.setSize(200, 200);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        frame.getContentPane().add(demo.drawable);
        frame.setVisible(true);
        demo.drawable.requestFocusInWindow();
    }

    public void init(GLAutoDrawable drawable) {
        GL2 gl = drawable.getGL().getGL2();
        //
        gl.glEnable(GL2.GL_LIGHTING);
        gl.glEnable(GL2.GL_LIGHT0);
    }

    public void display(GLAutoDrawable drawable) {
        GL2 gl = drawable.getGL().getGL2();
        //
        float feedBuffer[] = new float[1024];
        FloatBuffer feedBuf = GLBuffers.newDirectFloatBuffer(1024);
        int size;

        gl.glMatrixMode(GL2.GL_PROJECTION);
        gl.glLoadIdentity();
        gl.glOrtho(0.0, 100.0, 0.0, 100.0, 0.0, 1.0);

        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
        gl.glClear(GL.GL_COLOR_BUFFER_BIT);
        drawGeometry(gl, GL2.GL_RENDER);

        gl.glFeedbackBuffer(1024, GL2.GL_3D_COLOR, feedBuf);
        gl.glRenderMode(GL2.GL_FEEDBACK);
        drawGeometry(gl, GL2.GL_FEEDBACK);

        size = gl.glRenderMode(GL2.GL_RENDER);
        feedBuf.get(feedBuffer);
        printBuffer(gl, size, feedBuffer);
    }

    public void reshape(GLAutoDrawable drawable, int x, int y, int width,
            int height) {
    }

    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged,
            boolean deviceChanged) {
    }

    /*
     * Draw a few lines and two points, one of which will be clipped. If in
     * feedback mode, a passthrough token is issued between the each primitive.
     */
    void drawGeometry(GL2 gl, int mode) {
        gl.glBegin(GL.GL_LINE_STRIP);
        gl.glNormal3f(0.0f, 0.0f, 1.0f);
        gl.glVertex3f(30.0f, 30.0f, 0.0f);
        gl.glVertex3f(50.0f, 60.0f, 0.0f);
        gl.glVertex3f(70.0f, 40.0f, 0.0f);
        gl.glEnd();
        if (mode == GL2.GL_FEEDBACK)
            gl.glPassThrough(1.0f);
        gl.glBegin(GL.GL_POINTS);
        gl.glVertex3f(-100.0f, -100.0f, -100.0f); /* will be clipped */
        gl.glEnd();
        if (mode == GL2.GL_FEEDBACK)
            gl.glPassThrough(2.0f);
        gl.glBegin(GL.GL_POINTS);
        gl.glNormal3f(0.0f, 0.0f, 1.0f);
        gl.glVertex3f(50.0f, 50.0f, 0.0f);
        gl.glEnd();
    }

    /* Write contents of one vertex to stdout. */
    void print3DcolorVertex(int size, int count, float[] buffer) {
        int i;

        System.out.println("  ");
        for (i = 0; i < 7; i++) {
            System.out.println(" " + buffer[size - count]);
            count = count - 1;
        }
        System.out.println();
    }

    /* Write contents of entire buffer. (Parse tokens!) */
    private void printBuffer(GL2 gl, int size, float[] buffer) {
        int count;
        float token;

        count = size;
        while (count > 0) {
            token = buffer[size - count];
            count--;
            if (token == GL2.GL_PASS_THROUGH_TOKEN) {
                System.out.println("GL.GL_PASS_THROUGH_TOKEN");
                System.out.println("\t " + buffer[size - count]);
                count--;
            } else if (token == GL2.GL_POINT_TOKEN) {
                System.out.println("GL.GL_POINT_TOKEN");
                print3DcolorVertex(size, count, buffer);
            } else if (token == GL2.GL_LINE_TOKEN) {
                System.out.println("GL.GL_LINE_TOKEN ");
                print3DcolorVertex(size, count, buffer);
                print3DcolorVertex(size, count, buffer);
            } else if (token == GL2.GL_LINE_RESET_TOKEN) {
                System.out.println("GL.GL_LINE_RESET_TOKEN ");
                print3DcolorVertex(size, count, buffer);
                print3DcolorVertex(size, count, buffer);
            }
        }
    }

    public void keyTyped(KeyEvent key) {
    }

    public void keyPressed(KeyEvent key) {
        switch (key.getKeyChar()) {
        case KeyEvent.VK_ESCAPE:
            System.exit(0);
            break;
        default:
            break;
        }
    }

    public void keyReleased(KeyEvent key) {
    }

    public void dispose(GLAutoDrawable arg0) {

    }

}


text:
pub use board::{GameBoard,State};
pub use game::Game;
pub use pattern::Pattern;
pub use bot::Bot;
mod board;
mod game;
mod pattern;
mod bot;


text:
CREATE TABLE tasks (
  id        serial primary key,
  user_id   int NOT NULL,
  task      varchar(255) NOT NULL,
  complete  int DEFAULT(0)
)


text:
var restify = require('restify');
var CityHallController = require('./api/http/city-hall.controller');
var TransportController = require('./api/http/transport.controller');

/**
 *  START SERVER and SET CORS SETTINGS FOR RESTIFY
 */
var server = restify.createServer();
server.use(restify.CORS());
server.use(restify.bodyParser());

/**
 *  SETTING UP MONGOOSE
 */
var dbConnection = require('./lib/db-connection');
var mongoose = dbConnection.getInstance();

mongoose.connection.collections.cityhalls.drop(function(err, result) {
  console.error(err, result);
});

/**
 *  IMPORT CITY HALLS
 */
var CityHallService = require("./domain/cityhall/city-hall.service.js");
CityHallService.parse(process.argv[1].replace('app.js', '') + 'assets/datasets/cityHalls.csv');

/**
 *  ENABLE API
 */
server.get('/city-hall/:city', CityHallController.get);
server.get('/transport/:type/:lat/:long', TransportController.get);

/**
 *   MAKE DOCS AVAILABLE UNDER ROOT
 */
server.get(/\//, restify.serveStatic({
  directory: __dirname.replace('/src', '') + '/docs',
  default: 'index.html'
}));

/**
 *  START SERVER
 */
server.listen(8080, function() {
  console.log('%s listening at %s', server.name, server.url);
});


text:
var browser={
    device:device,
    isMobile:isMobile,
};

/*
 hb.browser
 */
function device(){
    var u = window.navigator.userAgent,app = $window.navigator.appVersion;
    switch (true){
        case (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1):
            return "android";
            break;
        case (u.indexOf('iPhone') > -1):
            return "iPhone";
            break;
        case (u.indexOf('iPad') > -1):
            return "iPad";
            break;
        default:
            return "unknown-device";
    }
};

function isMobile(){
    var u = window.navigator.userAgent;
    //console.log(u);
    if(u.match(/Android|iPhone|iPad|iPod|IEMobile|BlackBerry/i)){
        return true;
    }
    else {
        return false;
    }
};

export default browser;


text:
<?php

if ( ! defined( 'IN_IPB' ) )
{
	print "
Incorrect access
You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
	exit();
}

/**
 * @class		warnings_core
 * @brief		Warnings Extension for core
 */
class warnings_core
{
	/**
	 * Get Content URL
	 *
	 * @param	array		$warning		Row from members_warn_logs
	 * @return	@e array	array( url => URL to the content the warning came from, title => Title )
	 */
	public function getContentUrl( $warning )
	{
		ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_profile' ), 'members' );

		if ( $warning['wl_content_id1'] == 'mreport' )
		{
			$report = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'rc_reports_index', 'where' => "id=" . intval( $warning['wl_content_id2'] ) ) );

			if ( ! empty($report['id']) )
			{
				return array( 'url' => ipsRegistry::getClass('output')->buildUrl( "app=core&module=reports&do=show_report&rid={$report['id']}" ), 'title' => $report['title'] );
			}
		}
		elseif ( $warning['wl_content_id1'] == 'core-reports' )
		{
			$exploded = explode( '-', $warning['wl_content_id2'] );

			require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );/*noLibHook*/
			$comments = classes_comments_bootstrap::controller( $warning['wl_content_id1'] );

			$parent = $comments->fetchParent( $exploded[0] );

			if ( ! is_null($parent) )
			{
				$parent = $comments->remapFromLocal( $parent, 'parent' );

				return array( 'url' => ipsRegistry::getClass('output')->buildUrl( "app=core&module=global&section=comments&fromApp={$warning['wl_content_id1']}&do=findComment&parentId={$exploded[0]}&comment_id={$exploded[1]}" ), 'title' => $parent['parent_title'] );
			}
		}

		return NULL;
	}
}


text:
<?php
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

use yii\helpers\Html;
use yii\helpers\Url;

//\yii\helpers\VarDumper::dump($widget, 1000, true);
?>
<?php if ($model->status != 2) { ?>

            <div class="widget-user-header" style="background-color:<?= $model->profile->color ?>">

                <?= Html::img($model->avatar, ['class' => 'img-circle', 'alt' => $model->fullname]) ?>

<?= $model->fullname ?>

 <?= $model->profile->label ?>

                <?php $messages = \hscstudio\mailbox\models\Mailbox::getRecent(Yii::$app->user->id, $model->id); ?>

Recent Messages

                    <?php
                    //var_dump($messages); die();
                    if (count($messages) == 0) {
                        ?>

No Messages

                    <?php } else { ?>
                        <?php foreach ($messages as $message) { ?>

<?= Html::a($message->subject, ['/mailbox/default/view/', 'id' => $message->id, 'external' => $message->id, 'type' => 'message']); ?>

                            <?php
                        }
                    }
                    ?>

Recent Events

                <?php
                $i = 0;
                if (count($model->events) == 0) {
                    ?>

No Events

                <?php } else { ?>
                    <?php
                    foreach (array_reverse($model->events) as $models) {
                        echo "
" . Html::a(" $models->title", ['event/']) . "
";
                        if (++$i > 2) {
                            break;
                        }
                    }
                }
                ?>

Latest Photos

                <?php if ($model->photos): ?>
                    <div id="carousel-example-generic<?= $model->id ?>" class="carousel slide" data-ride="carousel">

                            <?php
                            $count = 0;
                            if ($model->photos) {
                                $i = $j = 0;

                                foreach (array_reverse($model->photos) as $photo) {
                                    ?>
                                    <?php
                                    if (\app\models\Photos::isShared(Yii::$app->user->id, $photo->shared_with) == false && Yii::$app->user->id != $photo->user_id) {
                                        $count++;
                                        continue;
                                    }
                                    if ($j++ > 6)
                                        break;
                                    $i++;
                                    ?>
                                    <div class="item <?= $i == 1 ? 'active' : '' ?>">
                                        <img src="<?= Url::to($photo->src) ?>" alt='' />

                                    <?php
                                }
                                if ($count == count($model->photos)) {
                                    ?>

                                        <img src="<?= Url::to('@web/img/demos/singlemember.jpg') ?>" alt='demo-empty-shared-photos' />

                                    <?php
                                }
                            } else {
                                ?>

                                    <img src="<?= Url::to('@web/img/demos/singlemember.jpg') ?>" alt='demo-empty-shared-photos' />

                            <?php }
                            ?>

                        <a class="left carousel-control" href="#carousel-example-generic<?= $model->id ?>" data-slide="prev">

                        <a class="right carousel-control" href="#carousel-example-generic<?= $model->id ?>" data-slide="next">

    <?php else: ?>
                    <div id="carousel-example-generic<?= $model->id ?>" class="carousel slide" data-ride="carousel">

                                    <img src="<?= Url::to('@web/img/demos/singlemember.jpg') ?>" alt='demo-empty-shared-photos' />

    <?php endif; ?>

<?= Html::a(" View more", ['user/view/' . $model->id]) ?>

<?php } ?>


text:
(function(){
    'use strict';
    angular.module('cofw.core')
        .controller('newMemberCtrl', newMemberCtrl);
    newMemberCtrl.$inject = ['emailSrv', '$scope'];
    function newMemberCtrl(emailSrv, $scope){
        $scope.form = {
            toEmail: 'Rachel Conner<cofwwebdeveloper@gmail.com>',
            text: null,
            html: null,
            subject: 'New Member Request',
            key: 'clean',
            member: null
        };

        $scope.member = {
            firstName: null,
            lastName: null,
            displayFirst: null,
            displayLast: null,
            email: null,
            displayEmail: true,
            pinterest: null,
            instagram: null,
            facebook: null,
            website: null,
            googlePlus: null,
            twitter: null,
            blurb: null,
            novels: null,
            novellas: null,
            catchMe: null
        };

        $scope.memberForm = function(){
            if($scope.member.catchMe){
                return;
            }
            $scope.submitting = true;
            $scope.form.member = $scope.member;
            var template = emailSrv.memberTemplate();
            template = template.replace('<name>', $scope.form.member.firstName + ' ' + $scope.form.member.lastName);
            template = template.replace('<displayName>', $scope.form.member.displayFirst + ' ' + $scope.form.member.displayLast);
            template = template.replace('<email>', $scope.form.member.email);
            template = template.replace('<displayEmail>', $scope.form.member.displayEmail ? 'Yes' : 'No');
            template = template.replace('<website>', $scope.form.member.website ? $scope.form.member.website : 'N/A');
            template = template.replace('<pinterest>', $scope.form.member.pinterest ? $scope.form.member.pinterest : 'N/A');
            template = template.replace('<facebook>', $scope.form.member.facebook ? $scope.form.member.facebook : 'N/A');
            template = template.replace('<twitter>', $scope.form.member.twitter ? $scope.form.member.twitter : 'N/A');
            template = template.replace('<instagram>', $scope.form.member.instagram ? $scope.form.member.instagram : 'N/A');
            template = template.replace('<googlePlus>', $scope.form.member.googlePlus ? $scope.form.member.googlePlus : 'N/A');
            template = template.replace('<blurb>', $scope.form.member.blurb);
            template = template.replace('<novels>', $scope.form.member.novels ? $scope.form.member.novels : '');
            template = template.replace('<novellas>', $scope.form.member.novellas ? $scope.form.member.novellas : '');
            $scope.form.text = template;
            $scope.form.html = $scope.form.text.replace('\n', '<br>');
            $scope.form.member = $scope.member;
            emailSrv.sendEmail($scope.form).then(function(resp){
                if(resp && resp.status === 200){
                    $scope.sent = true;
                } else {
                    console.log('error', resp);
                }
            }, function(resp){
                console.log(resp, 'error');
            }).finally(function(){
                $scope.submitting = false;
            });
        };
    }
}());


text:
package org.apache.activemq.artemis.core.server.group;

import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.server.ActiveMQComponent;
import org.apache.activemq.artemis.core.server.group.impl.GroupBinding;
import org.apache.activemq.artemis.core.server.group.impl.Proposal;
import org.apache.activemq.artemis.core.server.group.impl.Response;
import org.apache.activemq.artemis.core.server.management.NotificationListener;

public interface GroupingHandler extends NotificationListener, ActiveMQComponent
{
   // this method should maintain a WeakHash list, no need to remove the elements
   void addListener(UnproposalListener listener);

   SimpleString getName();

   void resendPending() throws Exception;

   Response propose(Proposal proposal) throws Exception;

   void proposed(Response response) throws Exception;

   void sendProposalResponse(Response response, int distance) throws Exception;

   Response receive(Proposal proposal, int distance) throws Exception;

   void addGroupBinding(GroupBinding groupBinding);

   Response getProposal(SimpleString fullID, boolean touchTime);

   void awaitBindings() throws Exception;

   /**
    * this will force a removal of the group everywhere with an unproposal (dinstance=0).
    * This is for the case where a node goes missing
    */
   void forceRemove(SimpleString groupid, SimpleString clusterName) throws Exception;

   void remove(SimpleString groupid, SimpleString clusterName) throws Exception;

   void remove(SimpleString groupid, SimpleString clusterName, int distance) throws Exception;
}


text:
<meta http-equiv="Content-Language" content="en-us">
<link rel="stylesheet" type="text/css" href="../style.css" />
<title>XSLT Bug</title>

XSLT bug

There is a known limitation in the version of Xalan that shipped with Sun's
JDK 1.4.1.  The following entries from the Xalan website describe the problem
and what you can do about it.

Xalan FAQ on DTM IDs

Xalan FAQ on JDK 1.4

JDK 1.4 Endorsed Standards Override Mechanism

For now, I recommend that you either patch your JDK 1.4 or use Ant's
<java> task instead to launch XSLTProcess as a
separate process.  Simply replace:

    <xslt style="${dependencyfinder.home}/etc/DependencyGraphToHTML.xsl"
          in="mygraph.xml"
          out="mygraph.html"/>

with the following:

    <java classname="org.apache.xalan.xslt.Process">
        <arg value="-xsl"/>
        <arg value="${dependencyfinder.home}/etc/DependencyGraphToHTML.xsl"/>
        <arg value="-in"/>
        <arg value="mygraph.xml"/>
        <arg value="-out"/>
        <arg value="mygraph.html"/>
    </java>

If you are running Ant with JDK 1.4, either code snippet should work as is,
except when the bug manifests itself.  If, on the other hand, you are running
Ant with JDK 1.3, you will need to have xalan.jar on your
CLASSPATH.

Copyright © 2001-2008 Jean Tessier.  All rights reserved.