text:
package org.apache.hadoop.hdfs.server.namenode;

import static org.apache.hadoop.util.Time.now;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.UnresolvedLinkException;
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants;
import org.apache.hadoop.util.Daemon;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;

/**
 * LeaseManager does the lease housekeeping for writing on files.
 * This class also provides useful static methods for lease recovery.
 *
 * Lease Recovery Algorithm
 * 1) Namenode retrieves lease information
 * 2) For each file f in the lease, consider the last block b of f
 * 2.1) Get the datanodes which contains b
 * 2.2) Assign one of the datanodes as the primary datanode p

 * 2.3) p obtains a new generation stamp from the namenode
 * 2.4) p gets the block info from each datanode
 * 2.5) p computes the minimum block length
 * 2.6) p updates the datanodes, which have a valid generation stamp,
 *      with the new generation stamp and the minimum block length
 * 2.7) p acknowledges the namenode the update results

 * 2.8) Namenode updates the BlockInfo
 * 2.9) Namenode removes f from the lease
 *      and removes the lease once all files have been removed
 * 2.10) Namenode commit changes to edit log
 */
@InterfaceAudience.Private
public class LeaseManager {
  public static final Log LOG = LogFactory.getLog(LeaseManager.class);

  private final FSNamesystem fsnamesystem;

  private long softLimit = HdfsConstants.LEASE_SOFTLIMIT_PERIOD;
  private long hardLimit = HdfsConstants.LEASE_HARDLIMIT_PERIOD;

  //
  // Used for handling lock-leases
  // Mapping: leaseHolder -> Lease
  //
  private final SortedMap<String, Lease> leases = new TreeMap<String, Lease>();
  // Set of: Lease
  private final SortedSet<Lease> sortedLeases = new TreeSet<Lease>();

  //
  // Map path names to leases. It is protected by the sortedLeases lock.
  // The map stores pathnames in lexicographical order.
  //
  private final SortedMap<String, Lease> sortedLeasesByPath = new TreeMap<String, Lease>();

  private Daemon lmthread;
  private volatile boolean shouldRunMonitor;

  LeaseManager(FSNamesystem fsnamesystem) {this.fsnamesystem = fsnamesystem;}

  Lease getLease(String holder) {
    return leases.get(holder);
  }

  SortedSet<Lease> getSortedLeases() {return sortedLeases;}

  /** @return the lease containing src */
  public Lease getLeaseByPath(String src) {return sortedLeasesByPath.get(src);}

  /** @return the number of leases currently in the system */
  public synchronized int countLease() {return sortedLeases.size();}

  /** @return the number of paths contained in all leases */
  synchronized int countPath() {
    int count = 0;
    for(Lease lease : sortedLeases) {
      count += lease.getPaths().size();
    }
    return count;
  }

  /**
   * Adds (or re-adds) the lease for the specified file.
   */
  synchronized Lease addLease(String holder, String src) {
    Lease lease = getLease(holder);
    if (lease == null) {
      lease = new Lease(holder);
      leases.put(holder, lease);
      sortedLeases.add(lease);
    } else {
      renewLease(lease);
    }
    sortedLeasesByPath.put(src, lease);
    lease.paths.add(src);
    return lease;
  }

  /**
   * Remove the specified lease and src.
   */
  synchronized void removeLease(Lease lease, String src) {
    sortedLeasesByPath.remove(src);
    if (!lease.removePath(src)) {
      if (LOG.isDebugEnabled()) {
        LOG.debug(src + " not found in lease.paths (=" + lease.paths + ")");
      }
    }

    if (!lease.hasPath()) {
      leases.remove(lease.holder);
      if (!sortedLeases.remove(lease)) {
        LOG.error(lease + " not found in sortedLeases");
      }
    }
  }

  /**
   * Remove the lease for the specified holder and src
   */
  synchronized void removeLease(String holder, String src) {
    Lease lease = getLease(holder);
    if (lease != null) {
      removeLease(lease, src);
    } else {
      LOG.warn("Removing non-existent lease! holder=" + holder +
          " src=" + src);
    }
  }

  synchronized void removeAllLeases() {
    sortedLeases.clear();
    sortedLeasesByPath.clear();
    leases.clear();
  }

  /**
   * Reassign lease for file src to the new holder.
   */
  synchronized Lease reassignLease(Lease lease, String src, String newHolder) {
    assert newHolder != null : "new lease holder is null";
    if (lease != null) {
      removeLease(lease, src);
    }
    return addLease(newHolder, src);
  }

  /**
   * Renew the lease(s) held by the given client
   */
  synchronized void renewLease(String holder) {
    renewLease(getLease(holder));
  }
  synchronized void renewLease(Lease lease) {
    if (lease != null) {
      sortedLeases.remove(lease);
      lease.renew();
      sortedLeases.add(lease);
    }
  }

  /**
   * Renew all of the currently open leases.
   */
  synchronized void renewAllLeases() {
    for (Lease l : leases.values()) {
      renewLease(l);
    }
  }

  /************************************************************
   * A Lease governs all the locks held by a single client.
   * For each client there's a corresponding lease, whose
   * timestamp is updated when the client periodically
   * checks in.  If the client dies and allows its lease to
   * expire, all the corresponding locks can be released.
   *************************************************************/
  class Lease implements Comparable<Lease> {
    private final String holder;
    private long lastUpdate;
    private final Collection<String> paths = new TreeSet<String>();

    /** Only LeaseManager object can create a lease */
    private Lease(String holder) {
      this.holder = holder;
      renew();
    }
    /** Only LeaseManager object can renew a lease */
    private void renew() {
      this.lastUpdate = now();
    }

    /** @return true if the Hard Limit Timer has expired */
    public boolean expiredHardLimit() {
      return now() - lastUpdate > hardLimit;
    }

    /** @return true if the Soft Limit Timer has expired */
    public boolean expiredSoftLimit() {
      return now() - lastUpdate > softLimit;
    }

    /** Does this lease contain any path? */
    boolean hasPath() {return !paths.isEmpty();}

    boolean removePath(String src) {
      return paths.remove(src);
    }

    @Override
    public String toString() {
      return "[Lease.  Holder: " + holder
          + ", pendingcreates: " + paths.size() + "]";
    }

    @Override
    public int compareTo(Lease o) {
      Lease l1 = this;
      Lease l2 = o;
      long lu1 = l1.lastUpdate;
      long lu2 = l2.lastUpdate;
      if (lu1 < lu2) {
        return -1;
      } else if (lu1 > lu2) {
        return 1;
      } else {
        return l1.holder.compareTo(l2.holder);
      }
    }

    @Override
    public boolean equals(Object o) {
      if (!(o instanceof Lease)) {
        return false;
      }
      Lease obj = (Lease) o;
      if (lastUpdate == obj.lastUpdate &&
          holder.equals(obj.holder)) {
        return true;
      }
      return false;
    }

    @Override
    public int hashCode() {
      return holder.hashCode();
    }

    Collection<String> getPaths() {
      return paths;
    }

    String getHolder() {
      return holder;
    }

    void replacePath(String oldpath, String newpath) {
      paths.remove(oldpath);
      paths.add(newpath);
    }

    @VisibleForTesting
    long getLastUpdate() {
      return lastUpdate;
    }
  }

  synchronized void changeLease(String src, String dst) {
    if (LOG.isDebugEnabled()) {
      LOG.debug(getClass().getSimpleName() + ".changelease: " +
               " src=" + src + ", dest=" + dst);
    }

    final int len = src.length();
    for(Map.Entry<String, Lease> entry
        : findLeaseWithPrefixPath(src, sortedLeasesByPath).entrySet()) {
      final String oldpath = entry.getKey();
      final Lease lease = entry.getValue();
      // replace stem of src with new destination
      final String newpath = dst + oldpath.substring(len);
      if (LOG.isDebugEnabled()) {
        LOG.debug("changeLease: replacing " + oldpath + " with " + newpath);
      }
      lease.replacePath(oldpath, newpath);
      sortedLeasesByPath.remove(oldpath);
      sortedLeasesByPath.put(newpath, lease);
    }
  }

  synchronized void removeLeaseWithPrefixPath(String prefix) {
    for(Map.Entry<String, Lease> entry
        : findLeaseWithPrefixPath(prefix, sortedLeasesByPath).entrySet()) {
      if (LOG.isDebugEnabled()) {
        LOG.debug(LeaseManager.class.getSimpleName()
            + ".removeLeaseWithPrefixPath: entry=" + entry);
      }
      removeLease(entry.getValue(), entry.getKey());
    }
  }

  static private Map<String, Lease> findLeaseWithPrefixPath(
      String prefix, SortedMap<String, Lease> path2lease) {
    if (LOG.isDebugEnabled()) {
      LOG.debug(LeaseManager.class.getSimpleName() + ".findLease: prefix=" + prefix);
    }

    final Map<String, Lease> entries = new HashMap<String, Lease>();
    int srclen = prefix.length();

    // prefix may ended with '/'
    if (prefix.charAt(srclen - 1) == Path.SEPARATOR_CHAR) {
      srclen -= 1;
    }

    for(Map.Entry<String, Lease> entry : path2lease.tailMap(prefix).entrySet()) {
      final String p = entry.getKey();
      if (!p.startsWith(prefix)) {
        return entries;
      }
      if (p.length() == srclen || p.charAt(srclen) == Path.SEPARATOR_CHAR) {
        entries.put(entry.getKey(), entry.getValue());
      }
    }
    return entries;
  }

  public void setLeasePeriod(long softLimit, long hardLimit) {
    this.softLimit = softLimit;
    this.hardLimit = hardLimit;
  }

  /******************************************************
   * Monitor checks for leases that have expired,
   * and disposes of them.
   ******************************************************/
  class Monitor implements Runnable {
    final String name = getClass().getSimpleName();

    /** Check leases periodically. */
    @Override
    public void run() {
      for(; shouldRunMonitor && fsnamesystem.isRunning(); ) {
        boolean needSync = false;
        try {
          fsnamesystem.writeLockInterruptibly();
          try {
            if (!fsnamesystem.isInSafeMode()) {
              needSync = checkLeases();
            }
          } finally {
            fsnamesystem.writeUnlock();
            // lease reassignments should to be sync'ed.
            if (needSync) {
              fsnamesystem.getEditLog().logSync();
            }
          }

          Thread.sleep(HdfsServerConstants.NAMENODE_LEASE_RECHECK_INTERVAL);
        } catch(InterruptedException ie) {
          if (LOG.isDebugEnabled()) {
            LOG.debug(name + " is interrupted", ie);
          }
        }
      }
    }
  }

  /**
   * Get the list of inodes corresponding to valid leases.
   * @return list of inodes
   * @throws UnresolvedLinkException
   */
  Map<String, INodeFile> getINodesUnderConstruction() {
    Map<String, INodeFile> inodes = new TreeMap<String, INodeFile>();
    for (String p : sortedLeasesByPath.keySet()) {
      // verify that path exists in namespace
      try {
        INodeFile node = INodeFile.valueOf(fsnamesystem.dir.getINode(p), p);
        Preconditions.checkState(node.isUnderConstruction());
        inodes.put(p, node);
      } catch (IOException ioe) {
        LOG.error(ioe);
      }
    }
    return inodes;
  }

  /** Check the leases beginning from the oldest.
   *  @return true is sync is needed.
   */
  private synchronized boolean checkLeases() {
    boolean needSync = false;
    assert fsnamesystem.hasWriteLock();
    for(; sortedLeases.size() > 0; ) {
      final Lease oldest = sortedLeases.first();
      if (!oldest.expiredHardLimit()) {
        return needSync;
      }

      LOG.info(oldest + " has expired hard limit");

      final List<String> removing = new ArrayList<String>();
      // need to create a copy of the oldest lease paths, becuase
      // internalReleaseLease() removes paths corresponding to empty files,
      // i.e. it needs to modify the collection being iterated over
      // causing ConcurrentModificationException
      String[] leasePaths = new String[oldest.getPaths().size()];
      oldest.getPaths().toArray(leasePaths);
      for(String p : leasePaths) {
        try {
          boolean completed = fsnamesystem.internalReleaseLease(oldest, p,
              HdfsServerConstants.NAMENODE_LEASE_HOLDER);
          if (LOG.isDebugEnabled()) {
            if (completed) {
              LOG.debug("Lease recovery for " + p + " is complete. File closed.");
            } else {
              LOG.debug("Started block recovery " + p + " lease " + oldest);
            }
          }
          // If a lease recovery happened, we need to sync later.
          if (!needSync && !completed) {
            needSync = true;
          }
        } catch (IOException e) {
          LOG.error("Cannot release the path " + p + " in the lease "
              + oldest, e);
          removing.add(p);
        }
      }

      for(String p : removing) {
        removeLease(oldest, p);
      }
    }
    return needSync;
  }

  @Override
  public synchronized String toString() {
    return getClass().getSimpleName() + "= {"
        + "\n leases=" + leases
        + "\n sortedLeases=" + sortedLeases
        + "\n sortedLeasesByPath=" + sortedLeasesByPath
        + "\n}";
  }

  void startMonitor() {
    Preconditions.checkState(lmthread == null,
        "Lease Monitor already running");
    shouldRunMonitor = true;
    lmthread = new Daemon(new Monitor());
    lmthread.start();
  }

  void stopMonitor() {
    if (lmthread != null) {
      shouldRunMonitor = false;
      try {
        lmthread.interrupt();
        lmthread.join(3000);
      } catch (InterruptedException ie) {
        LOG.warn("Encountered exception ", ie);
      }
      lmthread = null;
    }
  }

  /**
   * Trigger the currently-running Lease monitor to re-check
   * its leases immediately. This is for use by unit tests.
   */
  @VisibleForTesting
  void triggerMonitorCheckNow() {
    Preconditions.checkState(lmthread != null,
        "Lease monitor is not running");
    lmthread.interrupt();
  }
}


text:
namespace Supermortal.OpenSource.Common.Models
{
    public class VideoUploadedEventArgs
    {
        public AudioUoW Audio { get; set; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
require "test_helper"

class AnonymousUserCanOnlyViewServicesTest < Capybara::Rails::TestCase
  include Warden::Test::Helpers
  after { Warden.test_reset! }

  test "anonymous user can view services" do
    service_version = service_versions(:servicio1_v3)
    visit organization_service_service_version_path(service_version.organization, service_version.service, service_version)
    assert page.has_content?("servicio_1 R3")
    assert page.has_no_content?("Nueva Versión")
    assert page.has_no_content?("Nuevo Esquema")
  end

  test "anonymous user can't upload new service version" do
    service_version = service_versions(:servicio1_v3)
    visit new_organization_service_service_version_path(service_version.organization, service_version.service)
    assert page.has_content?("Para subir un esquema por favor identifíquese con su proveedor de login")
    assert page.has_no_content?("Nueva Versión")
    assert page.has_no_content?("Nuevo Esquema")
  end

  test "anonymous user can't create new services" do
    service_version = service_versions(:servicio1_v3)
    visit new_organization_service_path(service_version.organization)
    assert page.has_content?("Para subir un esquema por favor identifíquese con su proveedor de login")
    assert page.has_no_content?("Nueva Versión")
    assert page.has_no_content?("Nuevo Esquema")
  end
end


text:
package org.apache.camel.impl.event;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import org.apache.camel.CamelContext;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.spi.CamelEvent;
import org.apache.camel.support.EventNotifierSupport;
import org.junit.Before;
import org.junit.Test;

import static org.awaitility.Awaitility.await;

public class EventNotifierExchangeSentTest extends ContextTestSupport {

    protected static List<CamelEvent> events = new ArrayList<>();

    @Override
    @Before
    public void setUp() throws Exception {
        events.clear();
        super.setUp();
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        DefaultCamelContext context = new DefaultCamelContext(createRegistry());
        context.getManagementStrategy().addEventNotifier(new EventNotifierSupport() {
            public void notify(CamelEvent event) throws Exception {
                events.add(event);
            }

            @Override
            protected void doStart() throws Exception {
                // filter out unwanted events
                setIgnoreCamelContextEvents(true);
                setIgnoreServiceEvents(true);
                setIgnoreRouteEvents(true);
                setIgnoreExchangeCreatedEvent(true);
                setIgnoreExchangeCompletedEvent(true);
                setIgnoreExchangeFailedEvents(true);
                setIgnoreExchangeRedeliveryEvents(true);
            }
        });
        return context;
    }

    @Test
    public void testExchangeSent() throws Exception {
        getMockEndpoint("mock:result").expectedMessageCount(1);

        template.sendBody("direct:start", "Hello World");

        assertMockEndpointsSatisfied();

        assertEquals(8, events.size());
        ExchangeSendingEvent e0 = assertIsInstanceOf(ExchangeSendingEvent.class, events.get(0));
        ExchangeSendingEvent e1 = assertIsInstanceOf(ExchangeSendingEvent.class, events.get(1));
        ExchangeSentEvent e2 = assertIsInstanceOf(ExchangeSentEvent.class, events.get(2));
        ExchangeSendingEvent e3 = assertIsInstanceOf(ExchangeSendingEvent.class, events.get(3));
        ExchangeSentEvent e4 = assertIsInstanceOf(ExchangeSentEvent.class, events.get(4));
        ExchangeSendingEvent e5 = assertIsInstanceOf(ExchangeSendingEvent.class, events.get(5));
        ExchangeSentEvent e6 = assertIsInstanceOf(ExchangeSentEvent.class, events.get(6));
        ExchangeSentEvent e7 = assertIsInstanceOf(ExchangeSentEvent.class, events.get(7));

        assertEquals("direct://start", e0.getEndpoint().getEndpointUri());

        assertEquals("log://foo", e1.getEndpoint().getEndpointUri());
        assertEquals("log://foo", e2.getEndpoint().getEndpointUri());

        assertEquals("direct://bar", e3.getEndpoint().getEndpointUri());
        assertEquals("direct://bar", e4.getEndpoint().getEndpointUri());
        long time = e4.getTimeTaken();
        assertTrue("Should take about 0.5 sec, was: " + time, time > 400);

        assertEquals("mock://result", e5.getEndpoint().getEndpointUri());
        assertEquals("mock://result", e6.getEndpoint().getEndpointUri());

        assertEquals("direct://start", e7.getEndpoint().getEndpointUri());
        time = e7.getTimeTaken();
        assertTrue("Should take about 0.5 sec, was: " + time, time > 400);
    }

    @Test
    public void testExchangeSentRecipient() throws Exception {
        getMockEndpoint("mock:result").expectedMessageCount(1);

        template.sendBodyAndHeader("direct:foo", "Hello World", "foo", "direct:cool,direct:start");

        assertMockEndpointsSatisfied();

        assertTrue(oneExchangeDone.matchesMockWaitTime());

        assertEquals(12, events.size());
        ExchangeSendingEvent e0 = assertIsInstanceOf(ExchangeSendingEvent.class, events.get(0));
        ExchangeSendingEvent e1 = assertIsInstanceOf(ExchangeSendingEvent.class, events.get(1));
        ExchangeSentEvent e2 = assertIsInstanceOf(ExchangeSentEvent.class, events.get(2));
        ExchangeSendingEvent e3 = assertIsInstanceOf(ExchangeSendingEvent.class, events.get(3));
        ExchangeSendingEvent e4 = assertIsInstanceOf(ExchangeSendingEvent.class, events.get(4));
        ExchangeSentEvent e5 = assertIsInstanceOf(ExchangeSentEvent.class, events.get(5));
        ExchangeSendingEvent e6 = assertIsInstanceOf(ExchangeSendingEvent.class, events.get(6));
        ExchangeSentEvent e7 = assertIsInstanceOf(ExchangeSentEvent.class, events.get(7));
        ExchangeSendingEvent e8 = assertIsInstanceOf(ExchangeSendingEvent.class, events.get(8));
        ExchangeSentEvent e9 = assertIsInstanceOf(ExchangeSentEvent.class, events.get(9));
        ExchangeSentEvent e10 = assertIsInstanceOf(ExchangeSentEvent.class, events.get(10));
        ExchangeSentEvent e11 = assertIsInstanceOf(ExchangeSentEvent.class, events.get(11));

        assertEquals("direct://foo", e0.getEndpoint().getEndpointUri());
        assertEquals("direct://cool", e1.getEndpoint().getEndpointUri());
        assertEquals("direct://cool", e2.getEndpoint().getEndpointUri());
        assertEquals("direct://start", e3.getEndpoint().getEndpointUri());
        assertEquals("log://foo", e4.getEndpoint().getEndpointUri());
        assertEquals("log://foo", e5.getEndpoint().getEndpointUri());
        assertEquals("direct://bar", e6.getEndpoint().getEndpointUri());
        assertEquals("direct://bar", e7.getEndpoint().getEndpointUri());
        assertEquals("mock://result", e8.getEndpoint().getEndpointUri());
        assertEquals("mock://result", e9.getEndpoint().getEndpointUri());
        assertEquals("direct://start", e10.getEndpoint().getEndpointUri());
        assertEquals("direct://foo", e11.getEndpoint().getEndpointUri());
    }

    @Test
    public void testExchangeWireTap() throws Exception {
        getMockEndpoint("mock:result").expectedMessageCount(1);

        template.sendBody("direct:tap", "Hello World");

        assertMockEndpointsSatisfied();

        // give it time to complete
        await().atMost(1, TimeUnit.SECONDS).untilAsserted(() -> assertEquals(6, events.size()));

        // we should find log:foo which we tapped
        // which runs async so they can be in random order
        boolean found = false;
        boolean found2 = false;
        for (CamelEvent event : events) {
            if (event instanceof ExchangeSendingEvent) {
                ExchangeSendingEvent sending = (ExchangeSendingEvent) event;
                String uri = sending.getEndpoint().getEndpointUri();
                if ("log://foo".equals(uri))  {
                    found = true;
                }
            } else if (event instanceof ExchangeSentEvent) {
                ExchangeSentEvent sent = (ExchangeSentEvent) event;
                String uri = sent.getEndpoint().getEndpointUri();
                if ("log://foo".equals(uri))  {
                    found2 = true;
                }
            }
        }

        assertTrue("We should find log:foo being wire tapped", found);
        assertTrue("We should find log:foo being wire tapped", found2);
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("log:foo").to("direct:bar").to("mock:result");

                from("direct:bar").delay(500);

                from("direct:foo").recipientList().header("foo");

                from("direct:cool").delay(1000);

                from("direct:tap").wireTap("log:foo").to("mock:result");
            }
        };
    }

}


text:
import deepAssign from 'deep-assign';
import request from 'lib/request';
import session from 'services/session';

export default function requestAuth(url, params, queryParams) {
  const defaultParams = {
    headers: {
      'X-User-Token': session.token,
      'X-User-Email': session.email
    }
  };

  return request(url, deepAssign({}, defaultParams, params), queryParams);
}


text:
<?php
 include_once('../conexion/db.php');
 $mensajeok=false;
 $mensajeError='Error al Conectar a la Base de Datos';
if(isset($_POST['Usuario'],$_POST['Contrasena'])):
 		if($_POST['Usuario'] !=" "):
 				if($_POST['Contrasena']!=" "):
 					$Usuario=$_POST['Usuario'];
 					$Contrasena=$_POST['Contrasena'];

 					$consulta=pg_query($conexion,("Select * from usuarios where username='$Usuario' and clave='$Contrasena' and tipo='admin'"));
 					if(pg_num_rows($consulta)>0):
 						$mensajeok=true;
 						$Usua=pg_fetch_array($consulta);
 						session_start();
 						$_SESSION['id']=$Usua[0];
 						$_SESSION['Usuario']=$Usua[2];
 						$mensajeError="logueo Correcto";
 					else:
 						$mensajeError='Usuario o Contrasena Incrorrecto';

 					endif;

 				else:
 					$mensajeError='Contraseña Incrorrecta.';
 				endif;
 		else:
 				$mensajeError='Usuario no existe.';
 		endif;
 	else:
 		$mensajeError='Todos los datos son requeridos';
 endif;

 $salidaJson=array('respuesta'=> $mensajeok, 'mensaje' => $mensajeError);
 echo json_encode($salidaJson);

?>


text:
namespace H5 {
class DataSet;
}
#endif

namespace trento {

// Alias for a smart pointer to a Nucleus.
using NucleusPtr = std::unique_ptr<Nucleus>;

/// \rst
/// Interface class to all nucleus types.  Stores an ensemble of nucleons and
/// randomly samples their positions.  Implements a standard iterator interface
/// through ``begin()`` and ``end()`` functions.  Iterating over a ``Nucleus``
/// means iterating over its ``Nucleon`` members.
/// \endrst
class Nucleus {
 public:
  /// \rst
  /// The canonical way to create a ``Nucleus``.  Constructs the appropriate
  /// subclass for the given species.  Sets the Woods-Saxon parameters for Au,
  /// Pb, U, etc; parameters copied from the PHOBOS Glauber model:
  ///
  /// - http://inspirehep.net/record/786828
  /// - http://inspirehep.net/record/1310629
  ///
  /// Example::
  ///
  ///   std::unique_ptr<Nucleus> lead_nucleus = Nucleus::create("Pb");
  ///   double radius = lead_nucleus->radius();
  ///   lead_nucleus->sample_nucleons(0);
  ///   for (const auto& nucleon : *lead_nucleus)
  ///     do_something(nucleon)
  ///
  /// \endrst
  ///
  /// \param species standard symbol, e.g. "p" for proton or "Pb" for lead-208
  /// \param nucleon_dmin minimum nucleon-nucleon distance for Woods-Saxon
  /// nuclei (optional, default zero)
  ///
  /// \return a smart pointer \c std::unique_ptr<Nucleus>
  ///
  /// \throw std::invalid_argument for unknown species
  static NucleusPtr create(const std::string& species, double nucleon_dmin = 0);

  /// Default virtual destructor for abstract base class.
  virtual ~Nucleus() = default;

  /// The "radius", i.e. the maximum distance at which a nucleon could be
  /// placed.
  virtual double radius() const = 0;

  /// Sample a new ensemble of nucleon positions with the given offset in the
  /// x-direction.
  void sample_nucleons(double offset);

  using size_type = std::vector<NucleonData>::size_type;
  using iterator = std::vector<NucleonData>::iterator;
  using const_iterator = std::vector<NucleonData>::const_iterator;

  // size = number of nucleons
  size_type size() const noexcept
  { return nucleons_.size(); }

  // non-const overload
  iterator begin() noexcept
  { return nucleons_.begin(); }
  iterator end() noexcept
  { return nucleons_.end(); }

  // const overload
  const_iterator begin() const noexcept
  { return nucleons_.begin(); }
  const_iterator end() const noexcept
  { return nucleons_.end(); }

  // forced const
  const_iterator cbegin() const noexcept
  { return nucleons_.cbegin(); }
  const_iterator cend() const noexcept
  { return nucleons_.cend(); }

 protected:
  /// Constructor only accessible by derived classes.
  /// \param A number of nucleons
  explicit Nucleus(std::size_t A);

  /// \rst
  /// Set a ``Nucleon`` position.  This function provides a consistent interface
  /// to derived classes and ensures the position is correctly offset.
  /// ``Nucleus`` is a friend of ``Nucleon`` and therefore able to set nucleon
  /// positions; the derived classes must use this function to set positions.
  /// \endrst
  void set_nucleon_position(NucleonData& nucleon, double x, double y, double z);

 private:
  /// Internal interface to the actual implementation of the nucleon sampling
  /// algorithm, used in public function sample_nucleons().  This function must
  /// sample nucleon positions relative to the origin and set them using the
  /// protected function set_nucleon_position(), which enforces the offset.
  virtual void sample_nucleons_impl() = 0;

  /// Internal storage of NucleonData objects.
  std::vector<NucleonData> nucleons_;

  /// Offset of nucleon x-positions.
  /// This variable is reset upon each call of sample_nucleons() and is read by
  /// set_nucleon_position().
  double offset_;
};

// Now declare Nucleus subclasses.
// Each subclass must do the following:
//   - Define a public constructor which (at minimum) initializes a Nucleus
//     with the required number of nucleons.
//   - Override and implement the pure virtual functions
//     radius() and sample_nucleons_impl().

/// Trivial nucleus with a single nucleon.
class Proton : public Nucleus {
 public:
  /// Default constructor.
  Proton();

  /// The radius of a proton is trivially zero.
  virtual double radius() const override;

 private:
  /// The proton trivially places its nucleon at the origin.
  virtual void sample_nucleons_impl() override;
};

/// \rst
/// Samples pairs of nucleons from the Hulthén wavefunction
///
/// .. math::
///
///   f(r) \propto \biggl( \frac{\exp(-ar) - \exp(-br)}{r} \biggr)^2.
///
/// http://inspirehep.net/record/1261055
///
/// \endrst
class Deuteron : public Nucleus {
 public:
  /// Insantiate with values for the (a, b) parameters.
  /// The defaults are from the PHOBOS Glauber model.
  Deuteron(double a = 0.457, double b = 2.35);

  /// The radius is computed from the parameters (a, b).
  virtual double radius() const override;

 private:
  /// Sample positions from the Hulthén wavefunction.
  virtual void sample_nucleons_impl() override;

  /// Internal storage of wavefunction parameters.
  const double a_, b_;
};

/// A nucleus that can check if its nucleons are within a specified minimum
/// distance.
class MinDistNucleus : public Nucleus {
 protected:
  /// \param A number of nucleons
  /// \param dmin minimum nucleon-nucleon distance (optional, default zero)
  MinDistNucleus(std::size_t A, double dmin = 0);

  /// \rst
  /// Check if a ``Nucleon`` is too close (within the minimum distance) of any
  /// previously placed nucleons.  Specifically, check nucleons from ``begin()``
  /// up to the given iterator.
  /// \endrst
  bool is_too_close(const_iterator nucleon) const;

 private:
  /// Internal storage of squared minimum distance.
  const double dminsq_;
};

/// \rst
/// Samples nucleons from a spherically symmetric Woods-Saxon distribution
///
/// .. math::
///
///   f(r) \propto \frac{1}{1 + \exp(\frac{r-R}{a})}.
///
/// For non-deformed heavy nuclei such as lead.
///
/// \endrst
class WoodsSaxonNucleus : public MinDistNucleus {
 public:
  /// ``Nucleus::create()`` sets these parameters for a given species.
  /// \param A number of nucleons
  /// \param R Woods-Saxon radius
  /// \param a Woods-Saxon surface thickness
  /// \param dmin minimum nucleon-nucleon distance (optional, default zero)
  WoodsSaxonNucleus(std::size_t A, double R, double a, double dmin = 0);

  /// The radius of a Woods-Saxon Nucleus is computed from the parameters (R, a).
  virtual double radius() const override;

 private:
  /// Sample Woods-Saxon nucleon positions.
  virtual void sample_nucleons_impl() override;

  /// Woods-Saxon parameters.
  const double R_, a_;

  /// Woods-Saxon distribution object.  Since the dist does not have an analytic
  /// inverse CDF, approximate it as a piecewise linear dist.  For a large
  /// number of steps this is very accurate.
  mutable std::piecewise_linear_distribution<double> woods_saxon_dist_;
};

/// \rst
/// Samples nucleons from a deformed spheroidal Woods-Saxon distribution
///
/// .. math::
///
///   f(r, \theta) \propto
///   \frac{1}{1 + \exp(\frac{r-R(1+\beta_2Y_{20}+\beta_4Y_{40})}{a})}.
///
/// For deformed heavy nuclei such as uranium.
///
/// \endrst
class DeformedWoodsSaxonNucleus : public MinDistNucleus {
 public:
  /// ``Nucleus::create()`` sets these parameters for a given species.
  /// \param A number of nucleons
  /// \param R Woods-Saxon radius
  /// \param a Woods-Saxon surface thickness
  /// \param beta2 Woods-Saxon deformation parameter
  /// \param beta4 Woods-Saxon deformation parameter
  /// \param dmin minimum nucleon-nucleon distance (optional, default zero)
  DeformedWoodsSaxonNucleus(std::size_t A, double R, double a,
                            double beta2, double beta4, double dmin = 0);

  /// The radius of a deformed Woods-Saxon Nucleus is computed from the
  /// parameters (R, a, beta2, beta4).
  virtual double radius() const override;

 private:
  /// Sample deformed Woods-Saxon nucleon positions.
  virtual void sample_nucleons_impl() override;

  /// Evaluate the deformed Woods-Saxon distribution.
  double deformed_woods_saxon_dist(double r, double cos_theta) const;

  /// Woods-Saxon parameters.
  const double R_, a_, beta2_, beta4_;

  /// Maximum radius.
  const double rmax_;
};

#ifdef TRENTO_HDF5

/// Reads manual nuclear configurations from an HDF5 file.
class ManualNucleus : public Nucleus {
 public:
  /// Create a ManualNucleus that reads from the given file.
  /// Throw std::invalid_argument if there are any problems.
  ///
  /// Since this is a derived class, the base Nucleus class is initialized
  /// before any the data members.  This creates a bit of a catch-22, since the
  /// number of nucleons must be known to initialize the base class, but that
  /// must be deduced from the file.  As a workaround, this factory function
  /// opens the file, determines the number of nucleons, and then calls the
  /// constructor.
  static std::unique_ptr<ManualNucleus> create(const std::string& path);

  /// Must define destructor because of member pointer to incomplete type.
  /// See explanation for Collider destructor.
  virtual ~ManualNucleus() override;

  /// The radius is determined by reading many positions from the file and
  /// saving the maximum.
  virtual double radius() const override;

 private:
  /// Private constructor -- use create().
  /// \param dataset smart pointer to HDF5 dataset
  /// \param nconfigs number of nucleus configs in the dataset
  /// \param A number of nucleons
  /// \param rmax max radius
  ManualNucleus(std::unique_ptr<H5::DataSet> dataset,
                std::size_t nconfigs, std::size_t A, double rmax);

  /// Read a configuration from the file, rotate it, and set nucleon positions.
  virtual void sample_nucleons_impl() override;

  /// Internal pointer to HDF5 dataset object (PIMPL-like).
  const std::unique_ptr<H5::DataSet> dataset_;

  /// Internal storage of the maximum radius.
  const double rmax_;

  /// Distribution for choosing random configs.
  std::uniform_int_distribution<std::size_t> index_dist_;
};

#endif  // TRENTO_HDF5

}  // namespace trento

#endif  // NUCLEUS_H


text:
"""Script to preprocess wiki.txt.

Extracts documents (sentences) with their titles, tokenizes, and links entities
from the KB.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import io
import json
import re

from absl import app
from absl import flags

import nltk
from tqdm import tqdm

MIN_ENTITY_LEN = 3
ARTICLES = frozenset([u"the", u"a", u"an"])
REMOVE_ARTICLES = False

document_id = 0

FLAGS = flags.FLAGS

flags.DEFINE_string("wiki_file", None, "Wikimovie corpus.")

flags.DEFINE_string("entity_file", None, "List of entities from the KB.")

flags.DEFINE_string("output_file", None, "Processed wiki corpus.")

def _link_entities(line, overall_regex, pattern_to_entities):
  """Return list of matching entities in text."""
  matches = []

  def _add_entities(match, text, entities):
    for entity in entities:
      m_st = match.start()
      m_en = match.start() + len(match.group(1))
      matches.append({
          "name": entity[0],
          "kb_id": entity[1],
          "text": text[m_st:m_en],
          "start": m_st,
      })

  for match in re.finditer(overall_regex, line):
    ent = match.group(1).lower()
    if ent not in pattern_to_entities:
      print("Did not find %s" % ent)
      continue
    _add_entities(match, line, pattern_to_entities[ent])
  return matches

def _preprocess_line(line, overall_regex, pattern_to_entities):
  """Tokenize, link and lower-case."""
  text = u" ".join(nltk.word_tokenize(line))
  entities = _link_entities(text, overall_regex, pattern_to_entities)
  return {"context": text.lower(), "mentions": entities}

def process_document(text, title, overall_regex, pattern_to_entities):
  """Process a single line from wiki.txt."""
  global document_id
  doc_obj = _preprocess_line(text, overall_regex, pattern_to_entities)
  title_obj = _preprocess_line(title, overall_regex, pattern_to_entities)
  doc_obj["id"] = document_id
  doc_obj["title"] = title_obj
  # Prepend title to the context.
  doc_obj["context"] = doc_obj["title"]["context"] + " . " + doc_obj["context"]
  extra = len(doc_obj["title"]["context"]) + 3
  for mention in doc_obj["mentions"]:
    mention["start"] += extra
  doc_obj["mentions"] = doc_obj["title"]["mentions"] + doc_obj["mentions"]
  document_id += 1
  return doc_obj

def main(_):
  # read entity vocab
  print("Reading entities and building regexes...")
  entity_vocab = {
      ee: ei
      for ei, ee in enumerate(io.open(FLAGS.entity_file).read().splitlines())
  }
  pattern_to_entities = {}
  all_patterns = []
  for entity, eid in tqdm(entity_vocab.items()):
    if len(entity) < MIN_ENTITY_LEN:
      continue
    if re.match(r"\w", entity[-1]) is None:
      entity_clean = entity[:-1]
    else:
      entity_clean = entity
    entity_toks = nltk.word_tokenize(entity_clean)
    if (REMOVE_ARTICLES and len(entity_toks) > 1 and
        entity_toks[0].lower() in ARTICLES):
      entity_clean = u" ".join(tok.lower() for tok in entity_toks[1:])
    else:
      entity_clean = u" ".join(tok.lower() for tok in entity_toks)
    pattern = r"(?:(?<=\s)|(?<=^)){}(?:(?=\s)|(?=$))".format(
        re.escape(entity_clean))
    all_patterns.append(pattern)
    if entity_clean not in pattern_to_entities:
      pattern_to_entities[entity_clean] = []
    pattern_to_entities[entity_clean].append((entity, eid))
  all_patterns = sorted(all_patterns, key=lambda x: -len(x))
  overall_pattern = u"(?=({}))".format(u"|".join(all_patterns))
  overall_regex = re.compile(overall_pattern, flags=re.UNICODE | re.IGNORECASE)

  # process wiki docs
  print("Processing wiki sentences...")
  with io.open(FLAGS.wiki_file) as f, open(FLAGS.output_file, "w") as fo:
    context = []
    title = None
    for _, line in tqdm(enumerate(f)):
      if title is None:
        title = line.strip().split(None, 1)[1]
      elif line == u"\n":
        fo.write(
            json.dumps(
                process_document(" ".join(context), title, overall_regex,
                                 pattern_to_entities)) + u"\n")
        title = None
        context = []
      else:
        context.append(line.strip().split(None, 1)[1])

if __name__ == "__main__":
  app.run(main)


text:
export { NameNumberArrayObject_Base as Base };

import * as Pool from "../Pool.js";
import * as Recyclable from "../Recyclable.js";

/**
 * This object has string named properties and integer numeric properties (just like an Array). No matter
 * string named or integer numeric properties, their values should be either a number or a number array.
 *
 * It is mainly used for composing the input parameters and weights of Block, Stage, Embedding,
 * NeuralNet. The composing order are:
 *  - All string named properties first according to nameOrderArray. And then,
 *  - All integer numeric properties according to the incremental order (i.e. 0, 1, 2, ...)
 *
 *
 */
class NameNumberArrayObject_Base extends Recyclable.Array {

  /**
   * Used as default NameNumberArrayObject.Base provider for conforming to Recyclable interface.
   */
  static Pool = new Pool.Root( "NameNumberArrayObject.Base.Pool",
    NameNumberArrayObject_Base, NameNumberArrayObject_Base.setAsConstructor );

  /**
   */
  constructor() {
    super();
    NameNumberArrayObject_Base.setAsConstructor_self.call( this );
  }

  /** @override */
  static setAsConstructor() {
    super.setAsConstructor();
    NameNumberArrayObject_Base.setAsConstructor_self.call( this );
    return this;
  }

  /** @override */
  static setAsConstructor_self() {
  }

  /** @override */
  disposeResources() {
    super.disposeResources();
  }

}


text:
![Build Status](https://travis-ci.org/Foxandxss/koa-unless.svg?branch=master)

Conditionally skip a middleware when a condition is met.

## Install

	npm i koa-unless --save

## Usage

With existing middlewares:

```javascript
var unless = require('koa-unless');
var serve  = require('koa-static');

var static = serve(__dirname + '/public');
static.unless = unless;

app.use(static.unless({ method: 'OPTIONS' }));
```

If you are authoring a middleware you can support unless as follow:

```javascript
module.exports = function () {
  var mymid = function *(next) {
	// Do something
  };

  mymid.unless = require('koa-unless');

  return mymid;
};
```

## Current options

-  `method` it could be an string or an array of strings. If the request method match the middleware will not run.
-  `path` it could be an string, a regexp or an array of any of those. If the request path match, the middleware will not run.
-  `ext` it could be an string or an array of strings. If the request path ends with one of these extensions the middleware will not run.
-  `custom` it must be a function that returns `true` / `false`. If the function returns true for the given request, ithe middleware will not run. The function will have access to Koa's context via `this`
-  `useOriginalUrl` it should be `true` or `false`, default is `true`. if false, `path` will match against `this.url` instead of `this.originalUrl`.

## Examples

Require authentication for every request unless the path is index.html.

```javascript
app.use(requiresAuth.unless({ path: ['/index.html', '/'] }))
```

Avoid a fstat for request to routes doesnt end with a given extension.

```javascript
app.use(static.unless(function () {
  var ext = url.parse(this.originalUrl).pathname.substr(-4);
  return !~['.jpg', '.html', '.css', '.js'].indexOf(ext);
}));
```

## Credits

All the credits for this library goes for [José F. Romaniello](https://github.com/jfromaniello) which created the original [express version](https://github.com/jfromaniello/express-unless).

## License

MIT 2015 - Jesús Rodríguez


text:
%% COMPLEXITY - computes the neural complexity of a spike raster
% Computes the neural complexity measure as developed by (Tononi, 1994):
% the difference between the linear scale of the total system integration
% and the average integration of j subsets of sizes k. To handle the
% problem of combinatorial explosion for increasing system size, the
% algorithm subsamples j from the total possibilities.
%
% Syntax: [cn, IntInfPart] = complexity(raster, nSubSets, varargin)
%
% Inputs:
%   raster (double) - matrix whose rows represent neurons and columns
%       represent time bins
%   nSubSets (integer) - value that determines the maximum number of the j
%       subsets of size k to process.
%
% Variable Inputs:
%   (..., 'subsampcorrect') - authorizes the function to perform the
%       subsampling correction. The original data are randomized and the
%       random data integration curve is subtracted from the real data
%       integration curve. Turn over in the corrected integration curve is
%       automatically detected and accounted for by removing subsets above
%       the turn over.
%
% Outputs:
%   cn (scalar double) - neural complexity
%   IntInfPart (scalar double vector) - integrated information for each
%       subset size. IntInfPart(k) is the integration for subsets of size
%       k. Note, the integrated information is the average across at most
%       nSubSets sample combinations.
%
% Example:
%   raster = randi([0,1], [100, 10^4]);
%   [cn intInfPart] = complexity(raster, 10^2)
%     % compute neural complexity and integrated information using an
%     % estimate of the entropy measures
%
% Other m-files required: none
% Subfunctions: none
% MAT-files required: none
%
% See also: ASDF2TORASTER

% Author: Najja Marshall and Nick Timme
% Email: njm2149@columbia.edu and nicholas.m.timme@gmail.com
% July 2013; Last revision: 6-May-2015

%==============================================================================
% Copyright (c) 2013, The Trustees of Indiana University
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are met:
%
%   1. Redistributions of source code must retain the above copyright notice,
%      this list of conditions and the following disclaimer.
%
%   2. Redistributions in binary form must reproduce the above copyright notice,
%      this list of conditions and the following disclaimer in the documentation
%      and/or other materials provided with the distribution.
%
%   3. Neither the name of Indiana University nor the names of its contributors
%      may be used to endorse or promote products derived from this software
%      without specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
% POSSIBILITY OF SUCH DAMAGE.

function [Cn,IntInfPart] = complexity(X,nSubSets,varargin)
%% Parse command line for variable arguments
SubSampFlag = false;

iVarArg = 1;
while iVarArg <= length(varargin)
    argOkay = true;
    if ischar(varargin{iVarArg}),
        switch varargin{iVarArg},
            case 'subsampcorrect',	SubSampFlag = true;
            otherwise,
                argOkay = false;
        end
    end
    if ~argOkay
        disp(['(COMPLEXITY) Ignoring invalid argument #' num2str(iVarArg+1)]);
    end
    iVarArg = iVarArg + 1;
end

%% Perform the Analysis

% Get basic information
nNeurons = size(X,1);
nT = size(X,2);

% Make the master list of states and variables
[B,I,J] = unique(X','rows');
MasterList = B;
MasterCounts = hist(J,1:size(B,1))';

% Calculate individual neuron entropies
nSpikes = sum(X,2);
NeurEnt = -((nSpikes/nT) .* log2(nSpikes/nT)) - (((nT - nSpikes)/nT) .* log2((nT - nSpikes)/nT));

% Go through the partitions
IntInfPart = zeros([1,nNeurons]);
warning('off','all')
for iNeurons = 2:nNeurons
    disp([num2str((iNeurons*100)/nNeurons),' Percent Done with Complexity Calculation'])
    if nchoosek(nNeurons,iNeurons) <= nSubSets
        NeuronSubSets = nchoosek(1:nNeurons,iNeurons);
    else
        NeuronSubSets = zeros([nSubSets,iNeurons]);
        for iSubSet = 1:nSubSets
            temp = randperm(nNeurons);
            NeuronSubSets(iSubSet,:) = temp(1:iNeurons);
        end
    end
    nTempSubSets = size(NeuronSubSets,1);
    TempIntInfo = zeros([1,nTempSubSets]);
    for iTempSubSet = 1:nTempSubSets
        [B,I,J] = unique(MasterList(:,NeuronSubSets(iTempSubSet,:)),'rows');
        p = accumarray(J,MasterCounts) / nT;
        TempIntInfo(iTempSubSet) = sum(NeurEnt(NeuronSubSets(iTempSubSet,:))) + sum(p .* log2(p));
    end
    IntInfPart(iNeurons) = mean(TempIntInfo);
end

Cn = sum(linspace(0,IntInfPart(end),nNeurons) - IntInfPart) / (nNeurons);

%% If necessary, perform the subsampling correction
if SubSampFlag

    % Mark the real data integration curve
    IntInfPartReal = IntInfPart;

    % Randomize the data
    for iNeuron = 1:nNeurons
        X(iNeuron,:) = X(iNeuron,randperm(nT));
    end

    % Make the master list of states and variables
    [B,I,J] = unique(X','rows');
    MasterList = B;
    MasterCounts = hist(J,1:size(B,1))';

    % Calculate individual neuron entropies
    nSpikes = sum(X,2);
    NeurEnt = -((nSpikes/nT) .* log2(nSpikes/nT)) - (((nT - nSpikes)/nT) .* log2((nT - nSpikes)/nT));

    % Go through the partitions
    IntInfPart = zeros([1,nNeurons]);
    warning('off','all')
    for iNeurons = 2:nNeurons
        disp([num2str((iNeurons*100)/nNeurons),' Percent Done with Complexity Calculation'])
        if nchoosek(nNeurons,iNeurons) <= nSubSets
            NeuronSubSets = nchoosek(1:nNeurons,iNeurons);
        else
            NeuronSubSets = zeros([nSubSets,iNeurons]);
            for iSubSet = 1:nSubSets
                temp = randperm(nNeurons);
                NeuronSubSets(iSubSet,:) = temp(1:iNeurons);
            end
        end
        nTempSubSets = size(NeuronSubSets,1);
        TempIntInfo = zeros([1,nTempSubSets]);
        for iTempSubSet = 1:nTempSubSets
            [B,I,J] = unique(MasterList(:,NeuronSubSets(iTempSubSet,:)),'rows');
            p = accumarray(J,MasterCounts) / nT;
            TempIntInfo(iTempSubSet) = sum(NeurEnt(NeuronSubSets(iTempSubSet,:))) + sum(p .* log2(p));
        end
        IntInfPart(iNeurons) = mean(TempIntInfo);
    end

    % Correct the integration curve
    IntInfPart = IntInfPartReal - IntInfPart;

    % Find the maximum slope and cut the extra points
    m = IntInfPart(2:end) ./ (1:(length(IntInfPart) - 1));
    mpd = round(0.1*length(IntInfPart));
    mpd(mpd < 3) = 3;
    if length(m) >= 3
        [peaks,locs] = findpeaks(m,'minpeakdistance',mpd);
        if ~isempty(locs)
            Cut = locs(1) + 2;
        else
            Cut = length(IntInfPart) + 1;
        end
    else
        Cut = length(IntInfPart) + 1;
    end
    IntInfPart(Cut:end) = [];

    % Calculate the complexity
    Cn = sum(linspace(0,IntInfPart(end),length(IntInfPart)) - IntInfPart) / (length(IntInfPart));

end

end


text:
<Record>
<Term>Endixaprine</Term>
<SemanticType>Pharmacologic Substance</SemanticType>
<ParentTerm>Anticonvulsant Agent</ParentTerm>
<ClassificationPath>Chemicals_and_Drugs_Kind/Drug, Food, Chemical or Biomedical Material/Pharmacologic Substance/Adjuvant/Anticonvulsant Agent/Endixaprine</ClassificationPath>
<BroaderTerm>Endixaprine</BroaderTerm>
<BroaderTerm>Anticonvulsant Agent</BroaderTerm>
<BroaderTerm>Chemicals_and_Drugs_Kind</BroaderTerm>
<BroaderTerm>Pharmacologic Substance</BroaderTerm>
<BroaderTerm>Adjuvant</BroaderTerm>
<BroaderTerm>Drug, Food, Chemical or Biomedical Material</BroaderTerm>
<Synonym>ENDIXAPRINE</Synonym>
<Synonym>Endixaprine</Synonym>
<Source>NCI Thesaurus</Source>
</Record>


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>pvsvoc</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="Manuel de référence canonique de Csound" />
    <link rel="up" href="OpcodesTop.html" title="Opcodes et opérateurs de l'orchestre" />
    <link rel="prev" href="pvstencil.html" title="pvstencil" />
    <link rel="next" href="pvsynth.html" title="pvsynth" />

          pvsvoc

          Précédent
          Opcodes et opérateurs de l'orchestre
           Suivant

          pvsvoc

pvsvoc —
      Combine l'enveloppe spectrale d'un fsig avec l'excitation (les fréquences)
      d'un autre fsig.

Description

      Cet opcode fournit un support pour la synthèse croisée des amplitudes et
      des fréquences. Il prend les amplitudes d'un fsig en entrée et les combine
      avec les fréquences d'un autre fsig. C'est une version spectrale du célèbre
      vocodeur.

Syntaxe

fsig pvsvoc famp, fexc, kdepth, kgain [,kcoefs]

Exécution

      fsig -- flot pv de sortie

      famp -- flot pv d'entrée duquel sont extraites les
      amplitudes

      fexc -- flot pv d'entrée duquel sont prises les
      fréquences

      kdepth -- importance de l'effet, affectant la
      quantité de fréquences prélevées sur le second fsig : 0, la sortie est le
      signal famp, 1 la sortie combine les amplitudes de
      famp avec les fréquences de fexc.

      kgain -- gain de renforcement/atténuation appliqué à
      la sortie.

      kcoefs -- nombre de coefficients du cepstre utilisés
      dans l'estimation de l'enveloppe spectrale (vaut 80 par défaut).

              Avertissement

        Il est dangereux d'utiliser la même variable-f à la fois comme entrée et
        comme sortie des opcodes pvs. Ceci peut produire un comportement indéfini
        de certains de ces opcodes. Utilisez une variable différente à gauche et
        à droite de l'opcode.

Exemples

      Voici un exemple de l'opcode pvsvoc. Il utilise le fichier
      pvsvoc.csd.

            Exemple 745. Exemple de l'opcode pvsvoc.

Voir les sections Audio en Temps Réel
        et Options de la Ligne de Commande pour plus
        d'information sur l'utilisation des options de la ligne de commande.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o pvsvoc.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

gisaw	ftgen	1, 0, 2048, 10, 1, 0.5, 0.3, 0.25, 0.2	;sawtooth-like

instr 1

asig in					;get the signal in
asyn poscil .6, 150, gisaw		;excitation signal of 150 Hz

famp pvsanal asig, 1024, 256, 1024, 1	;analyse in signal
fexc pvsanal asyn, 1024, 256, 1024, 1	;analyse excitation signal
ftps pvsvoc  famp, fexc, 1, 1		;cross it
atps pvsynth ftps			;synthesise it
     outs atps, atps

endin
</CsInstruments>
<CsScore>

i 1 0 10
e
</CsScore>
</CsoundSynthesizer>

      L'exemple ci-dessus montre une opération typique de synthèse croisée. Le
      signal d'entrée (disons un signal vocal) est utilisé pour son spectre
      d'amplitude. Un oscillateur avec une forme d'onde complexe arbitraire
      produit le signal d'excitation, donnant au son vocal sa hauteur.

Crédits

            Auteur : Victor Lazzarini

            Avril 2005

Nouveau greffon dans la version 5

Avril 2005.

          Précédent

            Niveau supérieur

           Suivant

          pvstencil

            Sommaire

           pvsynth


text:
namespace net {

// id-at-commonName: 2.5.4.3 (RFC 5280)
inline constexpr uint8_t kTypeCommonNameOid[] = {0x55, 0x04, 0x03};
// id-at-surname: 2.5.4.4 (RFC 5280)
inline constexpr uint8_t kTypeSurnameOid[] = {0x55, 0x04, 0x04};
// id-at-serialNumber: 2.5.4.5 (RFC 5280)
inline constexpr uint8_t kTypeSerialNumberOid[] = {0x55, 0x04, 0x05};
// id-at-countryName: 2.5.4.6 (RFC 5280)
inline constexpr uint8_t kTypeCountryNameOid[] = {0x55, 0x04, 0x06};
// id-at-localityName: 2.5.4.7 (RFC 5280)
inline constexpr uint8_t kTypeLocalityNameOid[] = {0x55, 0x04, 0x07};
// id-at-stateOrProvinceName: 2.5.4.8 (RFC 5280)
inline constexpr uint8_t kTypeStateOrProvinceNameOid[] = {0x55, 0x04, 0x08};
// street (streetAddress): 2.5.4.9 (RFC 4519)
inline constexpr uint8_t kTypeStreetAddressOid[] = {0x55, 0x04, 0x09};
// id-at-organizationName: 2.5.4.10 (RFC 5280)
inline constexpr uint8_t kTypeOrganizationNameOid[] = {0x55, 0x04, 0x0a};
// id-at-organizationalUnitName: 2.5.4.11 (RFC 5280)
inline constexpr uint8_t kTypeOrganizationUnitNameOid[] = {0x55, 0x04, 0x0b};
// id-at-title: 2.5.4.12 (RFC 5280)
inline constexpr uint8_t kTypeTitleOid[] = {0x55, 0x04, 0x0c};
// id-at-name: 2.5.4.41 (RFC 5280)
inline constexpr uint8_t kTypeNameOid[] = {0x55, 0x04, 0x29};
// id-at-givenName: 2.5.4.42 (RFC 5280)
inline constexpr uint8_t kTypeGivenNameOid[] = {0x55, 0x04, 0x2a};
// id-at-initials: 2.5.4.43 (RFC 5280)
inline constexpr uint8_t kTypeInitialsOid[] = {0x55, 0x04, 0x2b};
// id-at-generationQualifier: 2.5.4.44 (RFC 5280)
inline constexpr uint8_t kTypeGenerationQualifierOid[] = {0x55, 0x04, 0x2c};
// dc (domainComponent): 0.9.2342.19200300.100.1.25 (RFC 4519)
inline constexpr uint8_t kTypeDomainComponentOid[] = {
    0x09, 0x92, 0x26, 0x89, 0x93, 0xF2, 0x2C, 0x64, 0x01, 0x19};
// RFC 5280 section A.1:
//
// pkcs-9 OBJECT IDENTIFIER ::=
//   { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 }
//
// id-emailAddress      AttributeType ::= { pkcs-9 1 }
//
// In dotted form: 1.2.840.113549.1.9.1
inline constexpr uint8_t kTypeEmailAddressOid[] = {0x2A, 0x86, 0x48, 0x86, 0xF7,
                                                   0x0D, 0x01, 0x09, 0x01};

// X509NameAttribute contains a representation of a DER-encoded RFC 2253
// "AttributeTypeAndValue".
//
// AttributeTypeAndValue ::= SEQUENCE {
//     type  AttributeType,
//     value AttributeValue
// }
struct NET_EXPORT X509NameAttribute {
  X509NameAttribute(der::Input in_type,
                    der::Tag in_value_tag,
                    der::Input in_value)
      : type(in_type), value_tag(in_value_tag), value(in_value) {}

  // Configures handling of PrintableString in the attribute value. Do
  // not use non-default handling without consulting //net owners. With
  // kAsUTF8Hack, PrintableStrings are interpreted as UTF-8 strings.
  enum class PrintableStringHandling { kDefault, kAsUTF8Hack };

  // Attempts to convert the value represented by this struct into a
  // UTF-8 string and store it in |out|, returning whether the conversion
  // was successful.
  [[nodiscard]] bool ValueAsString(std::string* out) const;

  // Attempts to convert the value represented by this struct into a
  // UTF-8 string and store it in |out|, returning whether the conversion
  // was successful. Allows configuring some non-standard string handling
  // options.
  //
  // Do not use without consulting //net owners.
  [[nodiscard]] bool ValueAsStringWithUnsafeOptions(
      PrintableStringHandling printable_string_handling,
      std::string* out) const;

  // Attempts to convert the value represented by this struct into a
  // std::string and store it in |out|, returning whether the conversion was
  // successful. Due to some encodings being incompatible, the caller must
  // verify the attribute |value_tag|.
  //
  // Note: Don't use this function unless you know what you're doing. Use
  // ValueAsString instead.
  //
  // Note: The conversion doesn't verify that the value corresponds to the
  // ASN.1 definition of the value type.
  [[nodiscard]] bool ValueAsStringUnsafe(std::string* out) const;

  // Formats the NameAttribute per RFC2253 into an ASCII string and stores
  // the result in |out|, returning whether the conversion was successful.
  [[nodiscard]] bool AsRFC2253String(std::string* out) const;

  der::Input type;
  der::Tag value_tag;
  der::Input value;
};

typedef std::vector<X509NameAttribute> RelativeDistinguishedName;
typedef std::vector<RelativeDistinguishedName> RDNSequence;

// Parses all the ASN.1 AttributeTypeAndValue elements in |parser| and stores
// each as an AttributeTypeAndValue object in |out|.
//
// AttributeTypeAndValue is defined in RFC 5280 section 4.1.2.4:
//
// AttributeTypeAndValue ::= SEQUENCE {
//   type     AttributeType,
//   value    AttributeValue }
//
// AttributeType ::= OBJECT IDENTIFIER
//
// AttributeValue ::= ANY -- DEFINED BY AttributeType
//
// DirectoryString ::= CHOICE {
//       teletexString           TeletexString (SIZE (1..MAX)),
//       printableString         PrintableString (SIZE (1..MAX)),
//       universalString         UniversalString (SIZE (1..MAX)),
//       utf8String              UTF8String (SIZE (1..MAX)),
//       bmpString               BMPString (SIZE (1..MAX)) }
//
// The type of the component AttributeValue is determined by the AttributeType;
// in general it will be a DirectoryString.
[[nodiscard]] NET_EXPORT bool ReadRdn(der::Parser* parser,
                                      RelativeDistinguishedName* out);

// Parses a DER-encoded "Name" as specified by 5280. Returns true on success
// and sets the results in |out|.
[[nodiscard]] NET_EXPORT bool ParseName(const der::Input& name_tlv,
                                        RDNSequence* out);
// Parses a DER-encoded "Name" value (without the sequence tag & length) as
// specified by 5280. Returns true on success and sets the results in |out|.
[[nodiscard]] NET_EXPORT bool ParseNameValue(const der::Input& name_value,
                                             RDNSequence* out);

// Formats a RDNSequence |rdn_sequence| per RFC2253 as an ASCII string and
// stores the result into |out|, and returns whether the conversion was
// successful.
[[nodiscard]] NET_EXPORT bool ConvertToRFC2253(const RDNSequence& rdn_sequence,
                                               std::string* out);
}  // namespace net

#endif  // NET_CERT_INTERNAL_PARSE_NAME_H_


text:
/**
 * Creates a new Model or Collection object.
 * @param {Arrow.Model} Model The model class being updated.
 * @param {Array<Object>/Object} [values] Attributes to set on the new model(s).
 * @param {Function} callback Callback passed an Error object (or null if successful), and the new model or collection.
 * @throws {Error}
 */
exports.create = function (Model, values, callback) {
	return this.invoker('_create', false, Model, values, callback);
};


text:
package edu.umich.intnw.simplesender;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.Button;
import android.widget.Toast;

public class SimpleSender extends Activity
{
    private View rootView;
    private TextView fgResponses;
    private TextView bgResponses;
    private int fg_seqno = 0;
    private int bg_seqno = 0;
    private Thread replyThread;

    //private final String TEST_SERVER_IP = "141.212.113.120";
    private final String TEST_SERVER_IP = "141.212.110.115"; // emulation box/forwarder

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        rootView = (View) findViewById(R.id.root_view);
        fgResponses = (TextView) findViewById(R.id.fg_responses);
        bgResponses = (TextView) findViewById(R.id.bg_responses);

        Button connectButton = (Button) findViewById(R.id.connect);
        Button disconnectButton = (Button) findViewById(R.id.disconnect);
        Button sendFGButton = (Button) findViewById(R.id.send_fg);
        Button sendBGButton = (Button) findViewById(R.id.send_bg);
        connectButton.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                doConnect();
            }
        });
        disconnectButton.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                disconnect();
            }
        });
        sendFGButton.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                sendFG(fg_seqno);
                fg_seqno++;
            }
        });
        sendBGButton.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                sendBG(bg_seqno);
                bg_seqno++;
            }
        });
    }

    private void doConnect() {
        try {
            connect(TEST_SERVER_IP, (short)4242);

            replyThread = new Thread(new Runnable() {
                public void run() {
                    runReplyThread();
                }
            });
            replyThread.start();
        } catch (Exception e) {
            Toast.makeText(this, e.getMessage(),
                           Toast.LENGTH_SHORT).show();
        }
    }

    static {
        System.loadLibrary("cmm");
        System.loadLibrary("intnw_ops");
    }

    private native void connect(String hostname, short port);
    private native void disconnect();
    private native void sendFG(int seqno);
    private native void sendBG(int seqno);

    // must call from new thread
    public native void runReplyThread();

    public void displayResponse(final String response,
                                final boolean foreground) {
        rootView.post(new Runnable() {
            public void run() {
                if (foreground) {
                    fgResponses.append(response + "\n");
                } else {
                    bgResponses.append(response + "\n");
                }
            }
        });
    }
}


text:
var Mn = require('backbone.marionette');
var hbs = require('handlebars');
var tmpl = require('./numpad.hbs');
var Model = require('./model');
var _ = require('lodash');
var $ = require('jquery');
var accounting = global['accounting'];

// numpad header input btns
// - could be improved if _.result allowed custom bind?
var inputBtns = {
  amount: function(){
    return {
      left: { addOn: this.symbol }
    };
  },
  discount: function(){
    return {
      left: { btn: this.symbol },
      right: { btn: '%' },
      toggle: true
    };
  },
  cash: function(){
    return {
      left: { addOn: this.symbol }
    };
  },
  quantity: function(){
    return {
      left: { btn: '-' },
      right: { btn: '+' }
    };
  }
};

// numpad extra keys
// - could be improved if _.result allowed custom bind?
var extraKeys = {
  amount: function(){},
  discount: function(){
    return _.map([5, 10, 20, 50], function(n){ return n + '%'; });
  },
  cash: require('./cashkeys'),
  quantity: function(){}
};

module.exports = Mn.ItemView.extend({
  template: hbs.compile(tmpl),

  viewOptions: [
    'numpad', 'label', 'value', 'decimal', 'symbol'
  ],

  initialize: function(options){
    options = options || {};

    options = _.defaults(options, {
      label     : 'Numpad',
      numpad    : 'amount',
      value     : 0,
      decimal   : accounting.settings.currency.decimal,
      symbol    : accounting.settings.currency.symbol,
      precision : accounting.settings.number.precision
    });

    this.mergeOptions(options, this.viewOptions);

    this.model = new Model({}, options);
  },

  render: function(){
    var args = Array.prototype.slice.apply(arguments);
    var result = Mn.ItemView.prototype.render.apply(this, args);

    this.stickit();

    return result;
  },

  bindings: {
    'input[name="value"]': {
      observe: ['value', 'percentage', 'active'],
      onGet: function(arr){
        if(arr[2] === 'percentage'){
          return accounting.formatNumber(arr[1]);
        } else {
          return accounting.formatNumber(arr[0]);
        }
      }
    },
    '.numpad-discount [data-btn="left"]': {
      observe: ['value', 'percentage', 'active'],
      onGet: function(arr){
        if(arr[2] === 'percentage'){
          return accounting.formatMoney(arr[0]);
        } else {
          return this.symbol;
        }
      }
    },
    '.numpad-discount [data-btn="right"]': {
      observe: ['percentage', 'value', 'active'],
      onGet: function(arr){
        if(arr[2] === 'percentage'){
          return '%';
        } else {
          return accounting.toFixed(arr[0], 0) + '%';
        }
      }
    }
  },

  templateHelpers: function(){
    var data = {
      numpad  : this.numpad,
      label   : this.label,
      input   : inputBtns[this.numpad].call(this),
      keys    : extraKeys[this.numpad].call(this, this.value),
      decimal : this.decimal,
      'return': 'return'
    };

    return data;
  },

  ui: {
    input   : '.numpad-header input',
    toggle  : '.numpad-header .input-group',
    common  : '.numpad-keys .common .btn',
    discount: '.numpad-keys .discount .btn',
    cash    : '.numpad-keys .cash .btn'
  },

  events: {
    'click @ui.toggle a': 'toggle',
    'click @ui.common'  : 'commonKeys',
    'click @ui.discount': 'discountKeys',
    'click @ui.cash'    : 'cashKeys'
  },

  toggle: function(e){
    e.preventDefault();
    var modifier = $(e.currentTarget).data('btn');

    if(this.numpad === 'quantity'){
      this.model.quantity( modifier === 'right' ? 'increase' : 'decrease' );
    }

    if(this.numpad === 'discount'){
      this.ui.toggle.toggleClass('toggle');
      this.model.toggle('percentage');
    }
  },

  /* jshint -W074 */
  commonKeys: function(e){
    e.preventDefault();
    var key = $(e.currentTarget).data('key');

    switch(key) {
      case 'ret':
        this.trigger('input', this.model.getFloatValue(), this.model);
        return;
      case 'del':
        if(this.selected) {
          this.model.clearInput();
        }
        this.model.backSpace();
        break;
      case '+/-':
        this.model.plusMinus();
        break;
      case '.':
        this.model.decimal();
        break;
      default:
        if(this.selected) {
          this.model.clearInput();
        }
        this.model.key(key);
    }

  },
  /* jshint +W074 */

  discountKeys: function(e){
    e.preventDefault();
    var key = $(e.currentTarget).data('key');
    this.model.set({
      active: 'percentage',
      percentage: key.replace('%', '')
    });
    this.ui.toggle.addClass('toggle');
  },

  cashKeys: function(e){
    e.preventDefault();
    var key = $(e.currentTarget).data('key');
    this.model.clearInput().key(key);
  }

});


text:
<!--
  ~ Copyright (c) 2016, WSO2 Inc. (http:www.wso2.org) All Rights Reserved.
  ~
  ~ WSO2 Inc. licenses this file to you under the Apache License,
  ~ Version 2.0 (the "License"); you may not use this file except
  ~ in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
<SSOIdentityProviderConfig>
    <TenantRegistrationPage>https://stratos-local.wso2.com/carbon/tenant-register/select_domain.jsp</TenantRegistrationPage>
    <ServiceProviders>
        <ServiceProvider>
            <Issuer>devicemgt</Issuer>
            <AssertionConsumerServiceURLs>
                <AssertionConsumerServiceURL>https://localhost:9443/devicemgt/uuf/sso/acs</AssertionConsumerServiceURL>
            </AssertionConsumerServiceURLs>
            <DefaultAssertionConsumerServiceURL>https://localhost:9443/devicemgt/uuf/sso/acs</DefaultAssertionConsumerServiceURL>
            <SignAssertion>true</SignAssertion>
            <SignResponse>true</SignResponse>
            <EnableAttributeProfile>false</EnableAttributeProfile>
            <IncludeAttributeByDefault>false</IncludeAttributeByDefault>
            <Claims>
                <Claim>http://wso2.org/claims/role</Claim>
                <Claim>http://wso2.org/claims/emailaddress</Claim>
            </Claims>
            <EnableAudienceRestriction>true</EnableAudienceRestriction>
            <EnableRecipients>true</EnableRecipients>
            <AudiencesList>
                <Audience>https://localhost:9443/oauth2/token</Audience>
            </AudiencesList>
            <RecipientList>
                <Recipient>https://localhost:9443/oauth2/token</Recipient>
            </RecipientList>
        </ServiceProvider>
        <ServiceProvider>
            <Issuer>store</Issuer>
            <AssertionConsumerServiceURLs>
                <AssertionConsumerServiceURL>https://localhost:9443/store/acs</AssertionConsumerServiceURL>
            </AssertionConsumerServiceURLs>
            <DefaultAssertionConsumerServiceURL>https://localhost:9443/store/acs</DefaultAssertionConsumerServiceURL>
            <SignResponse>true</SignResponse>
            <CustomLoginPage>/store/login.jag</CustomLoginPage>
        </ServiceProvider>
        <ServiceProvider>
            <Issuer>social</Issuer>
            <AssertionConsumerServiceURLs>
                <AssertionConsumerServiceURL>https://localhost:9443/social/acs</AssertionConsumerServiceURL>
            </AssertionConsumerServiceURLs>
            <DefaultAssertionConsumerServiceURL>https://localhost:9443/social/acs</DefaultAssertionConsumerServiceURL>
            <SignResponse>true</SignResponse>
            <CustomLoginPage>/social/login</CustomLoginPage>
        </ServiceProvider>
        <ServiceProvider>
            <Issuer>publisher</Issuer>
            <AssertionConsumerServiceURLs>
                <AssertionConsumerServiceURL>https://localhost:9443/publisher/acs</AssertionConsumerServiceURL>
            </AssertionConsumerServiceURLs>
            <DefaultAssertionConsumerServiceURL>https://localhost:9443/publisher/acs</DefaultAssertionConsumerServiceURL>
            <SignResponse>true</SignResponse>
            <CustomLoginPage>/publisher/controllers/login.jag</CustomLoginPage>
            <EnableAudienceRestriction>true</EnableAudienceRestriction>
            <AudiencesList>
                <Audience>carbonServer</Audience>
            </AudiencesList>
        </ServiceProvider>
        <ServiceProvider>
            <Issuer>API_STORE</Issuer>
            <AssertionConsumerServiceURLs>
                <AssertionConsumerServiceURL>https://localhost:9443/api-store/jagg/jaggery_acs.jag</AssertionConsumerServiceURL>
            </AssertionConsumerServiceURLs>
            <DefaultAssertionConsumerServiceURL>https://localhost:9443/api-store/jagg/jaggery_acs.jag</DefaultAssertionConsumerServiceURL>
            <SignResponse>true</SignResponse>
            <EnableAudienceRestriction>true</EnableAudienceRestriction>
            <AudiencesList>
                <Audience>carbonServer</Audience>
            </AudiencesList>
        </ServiceProvider>
        <ServiceProvider>
            <Issuer>portal</Issuer>
            <AssertionConsumerServiceURLs>
                <AssertionConsumerServiceURL>https://localhost:9443/portal/acs</AssertionConsumerServiceURL>
            </AssertionConsumerServiceURLs>
            <DefaultAssertionConsumerServiceURL>https://localhost:9443/portal/acs</DefaultAssertionConsumerServiceURL>
            <SignResponse>true</SignResponse>
            <EnableAudienceRestriction>true</EnableAudienceRestriction>
            <EnableRecipients>true</EnableRecipients>
            <AudiencesList>
                <Audience>https://localhost:9443/oauth2/token</Audience>
            </AudiencesList>
            <RecipientList>
                <Recipient>https://localhost:9443/oauth2/token</Recipient>
            </RecipientList>
        </ServiceProvider>
        <ServiceProvider>
            <Issuer>analyticsportal</Issuer>
            <AssertionConsumerServiceURLs>
                <AssertionConsumerServiceURL>https://localhost:9445/portal/acs</AssertionConsumerServiceURL>
            </AssertionConsumerServiceURLs>
            <DefaultAssertionConsumerServiceURL>https://localhost:9445/portal/acs</DefaultAssertionConsumerServiceURL>
            <SignResponse>true</SignResponse>
            <EnableAudienceRestriction>true</EnableAudienceRestriction>
            <EnableRecipients>true</EnableRecipients>
            <AudiencesList>
                <Audience>https://localhost:9443/oauth2/token</Audience>
            </AudiencesList>
            <RecipientList>
                <Recipient>https://localhost:9443/oauth2/token</Recipient>
            </RecipientList>
        </ServiceProvider>
    </ServiceProviders>
</SSOIdentityProviderConfig>


text:
//
//  YAProfileDetail.h
//  YAQQNews
//
//  Created by 陈亚伦 on 2017/5/20.
//  Copyright © 2017年 陈亚伦. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface YAProfileDetail : NSObject
/** 标题 */
@property (nonatomic, copy) NSString *title;
/** 描述 */
@property (nonatomic, copy) NSString *desc;
/** 链接 */
@property (nonatomic, strong) NSString *urlString;
// 获取数据
+ (NSArray <YAProfileDetail *> *)loadProfileDetailList;
@end


text:
<?php

defined('COT_CODE') or die('Wrong URL.');

/**
 * Plugin Config
 */

$L['cfg_mode'] = 'Stealth mode';
$L['cfg_mode_hint'] = 'Hide users in userlist/whosonline if their maingroup or a subgroup is hidden.';

$L['info_desc'] = 'Hides selected groups and/or its members in various locations of the website';