text:
// Runs on page load to determine the type of button (Apply or Cancel or Disabled)
$(document).ready(function() {
    var button = document.getElementById('consent');
    setButtonProperties(button, button.name);
});

//Takes the button and formats it according to its state
function setButtonProperties(button, targetName) {
    if(targetName == 'apply') {
        button.className = "waves-effect waves-light grey darken-2 grey-text text-lighten-5 btn-large";
        button.name = "apply";
        document.getElementById("consent").childNodes[2].nodeValue = "Apply Consent";
        document.getElementById("button_icon").innerHTML = "send";
    }
    else if(targetName == 'cancel'){
        button.className = "waves-effect waves-light red darken-2 red-text text-lighten-5 btn-large";
        button.name = "cancel";
        document.getElementById("consent").childNodes[2].nodeValue = "Cancel Consent";
        document.getElementById("button_icon").innerHTML = "clear";
    }
    else if(targetName == 'disabled_applied') {
        button.className = "btn-large green darken-2 disabled";
        button.name = "disabled_applied";
        document.getElementById("consent").childNodes[2].nodeValue = "Consent Applied";
        document.getElementById("button_icon").innerHTML = "timer_off";
    }
    else {
        button.className = "btn-large red darken-2 disabled";
        button.name = "disabled_not_applied";
        document.getElementById("consent").childNodes[2].nodeValue = "Consent Not Applied";
        document.getElementById("button_icon").innerHTML = "timer_off";
    }
}

// Used for truncating extra text and putting an ellipsis(...) in the end.
$(function(){
        $('.truncate-main').succinct({
            size: 240,
        });
    });

// This function creates the hover effect by clicking on the elements that activates the card-reveal div.
$(function(e) {
    $('.card').hover(
        function() {
            $(this).children().first().click();
        }, function() {
            $(this).find('.my-card-reveal .card-title').click();
        }
    );
});

/* This function listens to the the clicks on the card title and reveals/hides the
 card-reveal element accordingly. */
$(document).ready(function() {

    $(document).on('click.card', '.card', function (e) {

   	   	if ($(this).find('> .my-card-reveal').length) {
        if ($(e.target).is($('.my-card-reveal .card-title')) ||
         		$(e.target).is($('.my-card-reveal .card-title i'))) {
          	// Make Reveal animate down and display none
          	$(this).find('.my-card-reveal').velocity(
          		{translateY: 0}, {
             		duration: 300,
             		queue: false,
             		easing: 'easeInOutQuad',
              		complete: function() { $(this).css({ display: 'none'}); }
            	}
          	);
          	$(e.target).closest('.card').css('height', '140px');
        }
        else if ($(e.target).is($('.card .activator')) ||
                 $(e.target).is($('.card .activator i')) ) {
          	$(e.target).closest('.card').css('height', '300px').velocity({duration: 50});
          	$(e.target).closest('.card').css('overflow', 'hidden');
          	$(this).find('.my-card-reveal').css({'display': 'block'}).velocity("stop", false).velocity(
          		{translateY: '-100%'}, {
          				duration: 300,
          				queue: false,
          				easing: 'easeInOutQuad'
          			}
          		);
        	}
      	}
    });
 });

$("#consent").click(function(e) {
    e.preventDefault();
    var curr_url = window.location.pathname;
    var url_arr = curr_url.split('/');
    var job = url_arr[url_arr.length-2];

    var divName = e.target.name;
    var url, toastMsg, targetName;
    if(divName=='apply') {
      url = '/consent/apply?job=' + job;
      toastMsg = 'Consent successfully applied!';
      targetName = 'cancel';
    }
    else {
      url = '/consent/cancel?job=' + job;
      toastMsg = 'Consent successfully cancelled!';
      targetName = 'apply';
    }

    $.ajax({
        type: "GET",
        url: url,
        contentType: 'application/json; charset=utf-8',
        success: function(result) {
            Materialize.toast(toastMsg, 2000, 'rounded');
            setButtonProperties(e.target, targetName);
        },
        error: function(result) {
            Materialize.toast('Some error has occured. Please try again!', 2000, 'rounded');
        }
    });
});


text:
package com.amazonaws.services.kendra.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class BatchDeleteDocumentRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The identifier of the index that contains the documents to delete.
     *

     */
    private String indexId;
    /**
     *

     * One or more identifiers for documents to delete from the index.
     *

     */
    private java.util.List<String> documentIdList;

    private DataSourceSyncJobMetricTarget dataSourceSyncJobMetricTarget;

    /**
     *

     * The identifier of the index that contains the documents to delete.
     *

     *
     * @param indexId
     *        The identifier of the index that contains the documents to delete.
     */

    public void setIndexId(String indexId) {
        this.indexId = indexId;
    }

    /**
     *

     * The identifier of the index that contains the documents to delete.
     *

     *
     * @return The identifier of the index that contains the documents to delete.
     */

    public String getIndexId() {
        return this.indexId;
    }

    /**
     *

     * The identifier of the index that contains the documents to delete.
     *

     *
     * @param indexId
     *        The identifier of the index that contains the documents to delete.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public BatchDeleteDocumentRequest withIndexId(String indexId) {
        setIndexId(indexId);
        return this;
    }

    /**
     *

     * One or more identifiers for documents to delete from the index.
     *

     *
     * @return One or more identifiers for documents to delete from the index.
     */

    public java.util.List<String> getDocumentIdList() {
        return documentIdList;
    }

    /**
     *

     * One or more identifiers for documents to delete from the index.
     *

     *
     * @param documentIdList
     *        One or more identifiers for documents to delete from the index.
     */

    public void setDocumentIdList(java.util.Collection<String> documentIdList) {
        if (documentIdList == null) {
            this.documentIdList = null;
            return;
        }

        this.documentIdList = new java.util.ArrayList<String>(documentIdList);
    }

    /**
     *

     * One or more identifiers for documents to delete from the index.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setDocumentIdList(java.util.Collection)} or {@link #withDocumentIdList(java.util.Collection)} if you want
     * to override the existing values.
     *

     *
     * @param documentIdList
     *        One or more identifiers for documents to delete from the index.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public BatchDeleteDocumentRequest withDocumentIdList(String... documentIdList) {
        if (this.documentIdList == null) {
            setDocumentIdList(new java.util.ArrayList<String>(documentIdList.length));
        }
        for (String ele : documentIdList) {
            this.documentIdList.add(ele);
        }
        return this;
    }

    /**
     *

     * One or more identifiers for documents to delete from the index.
     *

     *
     * @param documentIdList
     *        One or more identifiers for documents to delete from the index.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public BatchDeleteDocumentRequest withDocumentIdList(java.util.Collection<String> documentIdList) {
        setDocumentIdList(documentIdList);
        return this;
    }

    /**
     * @param dataSourceSyncJobMetricTarget
     */

    public void setDataSourceSyncJobMetricTarget(DataSourceSyncJobMetricTarget dataSourceSyncJobMetricTarget) {
        this.dataSourceSyncJobMetricTarget = dataSourceSyncJobMetricTarget;
    }

    /**
     * @return
     */

    public DataSourceSyncJobMetricTarget getDataSourceSyncJobMetricTarget() {
        return this.dataSourceSyncJobMetricTarget;
    }

    /**
     * @param dataSourceSyncJobMetricTarget
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public BatchDeleteDocumentRequest withDataSourceSyncJobMetricTarget(DataSourceSyncJobMetricTarget dataSourceSyncJobMetricTarget) {
        setDataSourceSyncJobMetricTarget(dataSourceSyncJobMetricTarget);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getIndexId() != null)
            sb.append("IndexId: ").append(getIndexId()).append(",");
        if (getDocumentIdList() != null)
            sb.append("DocumentIdList: ").append(getDocumentIdList()).append(",");
        if (getDataSourceSyncJobMetricTarget() != null)
            sb.append("DataSourceSyncJobMetricTarget: ").append(getDataSourceSyncJobMetricTarget());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof BatchDeleteDocumentRequest == false)
            return false;
        BatchDeleteDocumentRequest other = (BatchDeleteDocumentRequest) obj;
        if (other.getIndexId() == null ^ this.getIndexId() == null)
            return false;
        if (other.getIndexId() != null && other.getIndexId().equals(this.getIndexId()) == false)
            return false;
        if (other.getDocumentIdList() == null ^ this.getDocumentIdList() == null)
            return false;
        if (other.getDocumentIdList() != null && other.getDocumentIdList().equals(this.getDocumentIdList()) == false)
            return false;
        if (other.getDataSourceSyncJobMetricTarget() == null ^ this.getDataSourceSyncJobMetricTarget() == null)
            return false;
        if (other.getDataSourceSyncJobMetricTarget() != null
                && other.getDataSourceSyncJobMetricTarget().equals(this.getDataSourceSyncJobMetricTarget()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getIndexId() == null) ? 0 : getIndexId().hashCode());
        hashCode = prime * hashCode + ((getDocumentIdList() == null) ? 0 : getDocumentIdList().hashCode());
        hashCode = prime * hashCode + ((getDataSourceSyncJobMetricTarget() == null) ? 0 : getDataSourceSyncJobMetricTarget().hashCode());
        return hashCode;
    }

    @Override
    public BatchDeleteDocumentRequest clone() {
        return (BatchDeleteDocumentRequest) super.clone();
    }

}

redpajama_set_name: RedPajamaGithub


text:
#import "GeoLocation.h"

@implementation CLLocation (Synthesize)

- (CLLocationCoordinate2D)coordinate {
  GeoLocation *locStorage = [GeoLocation sharedManager];
  return [locStorage getCoordinate];
}

- (CLLocationDistance)altitude {
  GeoLocation *locStorage = [GeoLocation sharedManager];
  return [locStorage getAltitude];
}

@end

@implementation GeoLocation

- (CLLocationCoordinate2D)getCoordinate {
  return coordinate_;
}

- (CLLocationDistance)getAltitude {
  return altitude_;
}

- (void)setCoordinate:(CLLocationDegrees)longitude
             latitude:(CLLocationDegrees)latitude {
  coordinate_.longitude = longitude;
  coordinate_.latitude = latitude;
}

- (void)setAltitude:(CLLocationDistance)altitude {
  altitude_ = altitude;
}

static GeoLocation *sharedLocationStorage = nil;

+ (GeoLocation *)sharedManager {
  @synchronized(self) {
    if (!sharedLocationStorage) {
      [[self alloc] init];
    }
  }
  return sharedLocationStorage;
}

+ (id)allocWithZone:(NSZone *)zone {
  @synchronized(self) {
    if (!sharedLocationStorage) {
      return [super allocWithZone:zone];
    }
  }
  return sharedLocationStorage;
}

- (id)init {
  Class myClass = [self class];
  @synchronized(myClass) {
    if (!sharedLocationStorage) {
      if (self = [super init]) {
        sharedLocationStorage = self;
        coordinate_.latitude = 0.0f;
        coordinate_.longitude = 0.0f;
        altitude_ = 0.0f;
      }
    }
  }
  return sharedLocationStorage;
}

- (id)copyWithZone:(NSZone *)zone {
  return self;
}

- (id)retain {
  return self;
}

- (unsigned)retainCount {
  return UINT_MAX;
}

- (void)release {
}

- (id)autorelease {
  return self;
}

@end


text:
// Provides definitions needed for use of the TensorFlow XLA
// device.

#ifndef TENSORFLOW_COMPILER_JIT_DEFS_H_
#define TENSORFLOW_COMPILER_JIT_DEFS_H_

namespace tensorflow {

// Name of attribute used to tag operators for compilation with XLA
extern const char* const kXlaCompileAttr;  // "_XlaCompile"
extern const char* const kXlaScopeAttr;    // "_XlaScope"
extern const char* const kXlaInternalScopeAttr;  // "_XlaInternalScope"

}  // namespace tensorflow

#endif  // TENSORFLOW_COMPILER_JIT_DEFS_H_


text:
source /opt/ros/indigo/setup.bash
source /home/oddbot/catkin_ws/devel/setup.bash
export ROS_MASTER_URI=http://oddbot:11311
export ROS_HOSTNAME=oddbot

roscore
roslaunch brain_i3 module.launch


text:
layout: doc
title: "TreeView.getKeySelector"
position: 1
---

Возвращает [функцию](../../../Core/Script/) выборки из элемента коллекции идентификатора.

# Syntax

```js
TreeView.getKeySelector()
```

## Parameters

Нет

## Returns

[Функция](../../../Core/Script/) выборки из элемента коллекции идентификатора.

# Examples

```js
var selector = treeview.getKeySelector();
```

# See Also

* [`setKeySelector`](../TreeView.setKeySelector/)


text:
package jfmi.repo;

/** An AbstractRepository defines the base services a data repository should
  offer to the application. Furthermore, it provides an application access
  to a singleton AbstractRepository subclass implementation for persisting
  Objects.
  */
public abstract class AbstractRepository {

	//************************************************************
	// PUBLIC CLASS Methods
	//************************************************************

	//************************************************************
	// PUBLIC INSTANCE Methods
	//************************************************************

	public abstract void initialize() throws Exception;
}


text:
package co.edu.uniandes.csw.turism.ejbs;

import co.edu.uniandes.csw.turism.api.IItemLogic;
import co.edu.uniandes.csw.turism.entities.ItemEntity;
import co.edu.uniandes.csw.turism.persistence.ItemPersistence;
import co.edu.uniandes.csw.turism.api.IClientLogic;
import co.edu.uniandes.csw.turism.entities.ClientEntity;
import java.util.List;
import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.persistence.NoResultException;

/**
 * @generated
 */
@Stateless
public class ItemLogic implements IItemLogic {

    @Inject private ItemPersistence persistence;

    @Inject
    private IClientLogic clientLogic;

    /**
     * Obtiene el número de registros de Item.
     *
     * @return Número de registros de Item.
     * @generated
     */
    @Override
    public int countItems() {
        return persistence.count();
    }

    /**
     * Obtiene la lista de los registros de Item que pertenecen a un Client.
     *
     * @param clientid id del Client el cual es padre de los Items.
     * @return Colección de objetos de ItemEntity.
     * @generated
     */
    @Override
    public List<ItemEntity> getItems(Long clientid) {
        ClientEntity client = clientLogic.getClient(clientid);
        return client.getWishList();
    }

    /**
     * Obtiene la lista de los registros de Item que pertenecen a un Client indicando los datos para la paginación.
     *
     * @param page Número de página.
     * @param maxRecords Número de registros que se mostraran en cada página.
     * @param clientid id del Client el cual es padre de los Items.
     * @return Colección de objetos de ItemEntity.
     * @generated
     */
    @Override
    public List<ItemEntity> getItems(Integer page, Integer maxRecords, Long clientid) {
        return persistence.findAll(page, maxRecords, clientid);
    }

    /**
     * Obtiene los datos de una instancia de Item a partir de su ID.
     *
     * @pre La existencia del elemento padre Client se debe garantizar.
     * @param itemid) Identificador del Item a consultar
     * @return Instancia de ItemEntity con los datos del Item consultado.
     * @generated
     */
    @Override
    public ItemEntity getItem(Long itemid) {
        try {
            return persistence.find(itemid);
        }catch(NoResultException e){
            throw new IllegalArgumentException("El Item no existe", e);
        }
    }

    /**
     * Se encarga de crear un Item en la base de datos.
     *
     * @param entity Objeto de ItemEntity con los datos nuevos
     * @param clientid id del Client el cual sera padre del nuevo Item.
     * @return Objeto de ItemEntity con los datos nuevos y su ID.
     * @generated
     */
    @Override
    public ItemEntity createItem(Long clientid, ItemEntity entity) {
        ClientEntity client = clientLogic.getClient(clientid);
        entity.setClient(client);
        return persistence.create(entity);
    }

    /**
     * Actualiza la información de una instancia de Item.
     *
     * @param entity Instancia de ItemEntity con los nuevos datos.
     * @param clientid id del Client el cual sera padre del Item actualizado.
     * @return Instancia de ItemEntity con los datos actualizados.
     * @generated
     */
    @Override
    public ItemEntity updateItem(Long clientid, ItemEntity entity) {
        ClientEntity client = clientLogic.getClient(clientid);
        entity.setClient(client);
        return persistence.update(entity);
    }

    /**
     * Elimina una instancia de Item de la base de datos.
     *
     * @param id Identificador de la instancia a eliminar.
     * @param clientid id del Client el cual es padre del Item.
     * @generated
     */
    @Override
    public void deleteItem(Long id) {
        ItemEntity old = getItem(id);
        persistence.delete(old.getId());
    }

}


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>io.permazen.vaadin.app (Permazen 4.1.6 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

io.permazen.vaadin.app

Interfaces

GUIConfig

Classes

AbstractUI

GUIUIProvider

HorizontalLine

JObjectEditorWindow

Main

MainPanel

MainUI

ReferenceFieldField

SimpleFieldFieldBuilder


text:
<!DOCTYPE html>

  <link rel="stylesheet" type="text/css" href="stylesheets/my-berkshire-stylesheet.css">

      BERKSHIRE HATHAWAY INC.
      3555 Farnam Street
      Omaha, NE 68131
      Official Home Page

A Message From Warren E. Buffett

Annual &amp Interim Reports

Updated August 7, 2015

Special Letters From Warren &amp Charlie RE:Past,Present and Future

Link to SEC Filings

Link pades to Berkshire Subsidiary Companies

Corporate Governance

Owner's Manual

Letters from Warren E. Buffett Regarding Pledges to Make Gifts of Berkshire Stock

News Releases

Updated August 10, 2015

Warren Buffett's Letters to Berkshire Shareholders

Updated February 28, 2015

Charlie Munger's Letters to Wesco Shareholders

Annual Meeting Information

Celebrating 50 years of a Profitable Partnership

(A commemorative book first sold at the 2015 Annual Meeting and now for sale on eBay.)

Comparative Rights and Relative Prices of Class A and B Stock

Berkshire Activewear

 FOR A FREE CAR INSURANCE RATE QUOTE THAT COULD SAVE YOU SUBSTANTIAL MONEY WWW.GEICO.COM OR CALL 1-888-395-6349, 24 HOURS A DAY

If you have any comments about our WEB page, you can either write us at the address shown above or e-mail us at berkshire@berkshirehathaway.com. However, due to the limited number of personnel in our corporate office, we are unable to provide a direct response.

Legal Disclaimer

Copyright &copy 1978-2015 Berkshire Hathaway Inc.


text:
class AutoPropertyMeta(type):
    """
    Create properties from methods:
    class.__p_<name> -> class().Name
    """
    def __init__(cls, name, bases, dict_):
        super(AutoPropertyMeta, cls).__init__(name, bases, dict_)
        for i in dict_:
            tmp = "_%s__p_"%name
            if i.startswith(tmp):
                setattr(cls, i[len(tmp):].capitalize(), property(dict_[i]))

class Expr(object):
    """Base class for all FL-expressions"""
    __metaclass__ = AutoPropertyMeta

class Literal(Expr, int):
    pass

class Argument(Expr):
    def __init__(self, name, tainted=False):
        self.__name = name
        self.__tainted = tainted

    def __p_name(self): return self.__name
    def __p_tainted(self): return self.__tainted

class Operator(Expr):
    def __init__(self, l, op, r):
        self.__op = op
        self.__ops = l, r

    def __p_operator(self): return self.__op
    def __p_operands(self): return self.__ops
    def __p_l(self): return self.__ops[0]
    def __p_r(self): return self.__ops[1]

class IfThenElse(Expr):
    def __init__(self, *exprs):
        self.__cond, self.__then, self.__else = exprs

    def __p_condition(self): return self.__cond
    def __p_then(self): return self.__then
    def __p_else(self): return self.__else

class Apply(Expr):
    def __init__(self, func, *args):
        self.__func = func
        self.__args = args

    def __p_function(self): return self.__func
    def __p_arguments(self): return self.__args

class Function(Expr):
    def __init__(self, name, args, body, tainted=False):
        self.__name = name
        self.__args = args
        self.__body = body
        self.__tainted = tainted

    def __p_name(self): return self.__name
    def __p_body(self): return self.__body
    def __p_arguments(self): return self.__args
    def __p_tainted(self): return self.__tainted

class Program(Expr, dict):
    def __init__(self, funcs):
        #Functions are stored in a list to preserve order
        self.__funcs = funcs
        for func in funcs:
            self[func.Name] = func

    def __p_functions(self): return self.__funcs

def buildMixinMeta(namespace, prefix, key=""):
    """Automagically create (and apply) Mixins"""
    class MixinMeta(type):
        def __init__(cls, name, bases, dict_):
            super(MixinMeta, cls).__init__(name, bases, dict_)
            if name.startswith(prefix):
                for i in dict_.get(key, list()):
                    cls._mixin(i)
                else:
                    cls._mixin(getattr(namespace, name[len(prefix):]))

        def _mixin(cls, base):
            base.__bases__ = (cls,)+tuple(i for i in base.__bases__ if i not in cls.__bases__)
    return MixinMeta


text:
package japgolly.microlibs.utils

import japgolly.microlibs.nonempty.NonEmptyVector
import japgolly.microlibs.testutil.TestUtil._
import utest._

object ConsolidatedSeqTest extends TestSuite {

  override def tests = Tests {

    "noConsolidation" - {
      def test(size: Int) = {
        val logic      = ConsolidatedSeq.Logic[Int](_ => false)(identity)
        val as         = Vector.tabulate(size)(100 + _)
        val indices    = 0.until(size).toList
        val c          = logic(as)
        def el(i: Int) = Some(ConsolidatedSeq.Group(NonEmptyVector.one(i + 100), i, i))
        assertEq("length", size, c.length)
        assertEq("groups", indices, c.groupIterator().toList)
        assertEq("values", indices.map(el), c.elementIterator().toList)
        c.map(_.values.mkString("[", ",", "]"))
      }

      "0" - test(0)
      "1" - test(1)
      "2" - test(2)
      "3" - test(3)
      "9" - test(9)
    }

    "consolidateAll" - {
      def test(size: Int) = {
        val logic      = ConsolidatedSeq.Logic[Int](_ => true)(identity)
        val as         = Vector.tabulate(size)(100 + _)
        val indices    = 0.until(size).toList
        val c          = logic(as)
        def el(i: Int) = if (i > 0) None else Some(ConsolidatedSeq.Group(NonEmptyVector.force(as), 0, 0))
        assertEq("length", size, c.length)
        assertEq("groups", List.fill(size)(0), c.groupIterator().toList)
        assertEq("values", indices.map(el), c.elementIterator().toList)
        c.map(_.values.mkString("[", ",", "]"))
      }

      "0" - test(0)
      "1" - test(1)
      "2" - test(2)
      "3" - test(3)
      "9" - test(9)
    }

    "consolidateOdd" - {
      val logic  = ConsolidatedSeq.Logic[Int](i => (i.cur & 1) != 0)(identity)
      val as     = Vector(10, 11, 12, 13, 14)
      val c      = logic(as)
      val expect = List(
        Some(ConsolidatedSeq.Group(NonEmptyVector(10, 11), 0, 0)),
        None,
        Some(ConsolidatedSeq.Group(NonEmptyVector(12, 13), 2, 1)),
        None,
        Some(ConsolidatedSeq.Group(NonEmptyVector(14), 4, 2)))

      assertEq("length", 5, c.length)
      assertEq("groups", List(0, 0, 1, 1, 2), c.groupIterator().toList)
      assertEq("values", expect, c.elementIterator().toList)
      c.map(_.values.mkString("[", ",", "]"))
    }

  }
}


text:
layout: jumbotron
---

From metrics to insight

Power your metrics and alerting with the leading
open-source monitoring solution.

      Get Started
      Download

  The Prometheus Team strongly condemns Russia's illegal invasion of Ukraine.
  Please consider donating to a humanitarian aid organization such as
  Aktion Deutschland Hilft
  or
  Care in Action to provide relief.

 Dimensional data

Prometheus implements a highly dimensional data model. Time series are identified by a metric name and a set of key-value pairs.

 Powerful queries

PromQL allows slicing and dicing of collected time series data in order to generate ad-hoc graphs, tables, and alerts.

 Great visualization

Prometheus has multiple modes for visualizing data: a built-in expression browser, Grafana integration, and a console template language.

 Efficient storage

Prometheus stores time series in memory and on local disk in an efficient custom format. Scaling is achieved by functional sharding and federation.

 Simple operation

Each server is independent for reliability, relying only on local storage. Written in Go, all binaries are statically linked and easy to deploy.

 Precise alerting

Alerts are defined based on Prometheus's flexible PromQL and maintain dimensional information. An alertmanager handles notifications and silencing.

 Many client libraries

Client libraries allow easy instrumentation of services. Over ten languages are supported already and custom libraries are easy to implement.

 Many integrations

Existing exporters allow bridging of third-party data into Prometheus. Examples: system statistics, as well as Docker, HAProxy, StatsD, and JMX metrics.

        «Even though Borgmon remains internal to Google, the idea of treating time-series data as a data source for generating alerts is now accessible to everyone through those open source tools like Prometheus [...]»

      — Site Reliability Engineering: How Google Runs Production Systems (O'Reilly Media)

 Open Source

Prometheus is 100% open source and community-driven. All components are available under the Apache 2 License on GitHub.

Prometheus is a Cloud Native Computing Foundation graduated project.

Some of our users include:

  <%= render 'container_footer' %>


text:
<?php
namespace S1mple\Infusionsoft\Infusionsoft\Generated;
/**
 * @property String Id
 * @property String OpportunityTitle
 * @property String ContactID
 * @property String AffiliateId
 * @property String UserID
 * @property String StageID
 * @property String StatusID
 * @property String Leadsource
 * @property String Objection
 * @property String ProjectedRevenueLow
 * @property String ProjectedRevenueHigh
 * @property String OpportunityNotes
 * @property String DateCreated
 * @property String LastUpdated
 * @property String LastUpdatedBy
 * @property String CreatedBy
 */
class Infusionsoft_Generated_Lead extends Infusionsoft_Generated_Base{
    protected static $tableFields = array('Id', 'OpportunityTitle', 'ContactID', 'AffiliateId', 'UserID', 'StageID', 'StatusID', 'Leadsource', 'Objection', 'ProjectedRevenueLow', 'ProjectedRevenueHigh', 'OpportunityNotes', 'DateCreated', 'LastUpdated', 'LastUpdatedBy', 'CreatedBy', 'EstimatedCloseDate', 'NextActionDate', 'NextActionNotes');

    public function __construct($id = null, $app = null){
    	parent::__construct('Lead', $id, $app);
    }

    public function getFields(){
		return self::$tableFields;
	}

	public function addCustomField($name){
		self::$tableFields[] = $name;
	}

    public function addCustomFields($fields){
        foreach($fields as $name){
            self::addCustomField($name);
        }
	}

    public function removeField($fieldName){
        $fieldIndex = array_search($fieldName, self::$tableFields);
        if($fieldIndex !== false){
            unset(self::$tableFields[$fieldIndex]);
            self::$tableFields = array_values(self::$tableFields);
        }
    }

    public function fieldExists($field){
        return (array_search($field, self::$tableFields) !== false);
    }
}


text:
package com.alorma.github.sdk.bean.dto.response.events.payload;

import android.os.Parcel;
import android.os.Parcelable;
import com.alorma.github.sdk.bean.dto.response.UserType;

/**
 * Created by Bernat on 05/10/2014.
 */
public class DeleteEventPayload extends GithubEventPayload implements Parcelable {
  public static final Parcelable.Creator<DeleteEventPayload> CREATOR =
      new Parcelable.Creator<DeleteEventPayload>() {
        public DeleteEventPayload createFromParcel(Parcel source) {
          return new DeleteEventPayload(source);
        }

        public DeleteEventPayload[] newArray(int size) {
          return new DeleteEventPayload[size];
        }
      };
  public String ref;
  public String ref_type;
  public UserType pusher_type;

  public DeleteEventPayload() {
  }

  protected DeleteEventPayload(Parcel in) {
    this.ref = in.readString();
    this.ref_type = in.readString();
    int tmpPusher_type = in.readInt();
    this.pusher_type = tmpPusher_type == -1 ? null : UserType.values()[tmpPusher_type];
  }

  @Override
  public int describeContents() {
    return 0;
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.ref);
    dest.writeString(this.ref_type);
    dest.writeInt(this.pusher_type == null ? -1 : this.pusher_type.ordinal());
  }
}


text:
/**
 *
 */
package io.designpattern.demos.absfacmethodpattern;

/**
 * 小米工厂
 * @author Frank
 *
 */
public class MiFactory implements Factory {

	/* (non-Javadoc)
	 * @see io.designpattern.demos.absfacmethodpattern.Factory#createTelevision()
	 */
	public Television createTelevision() {
		return new MiTelevision();
	}

	/* (non-Javadoc)
	 * @see io.designpattern.demos.absfacmethodpattern.Factory#createPhone()
	 */
	public Screen createScreen() {
		return new MiScreen();
	}

}


text:
<?php

class BaseModelTest extends TestCase
{
    public function testNewCollectionReturnsCustomCollection()
    {
        $model = new ModelMock;

        $collection = $model->newCollection();

        assertThat($collection, is(anInstanceOf('PullAutomaticallyGalleries\Database\Eloquent\Collection')));

    }
}

class ModelMock extends BaseModel
{

}


text:
Termite Explorer
============================

Termite Explorer is a visual tool built in an MVC framework that allows users to view results of their topic models and identify the individual documents.

The tool is comprised of two components:

* Interactive scatterplot: This chart plots a point for each document, where the x-axis is a selected covariate based on the document's metadata, and the y-axis is the model's estimated proportion of a selected topic.  It also provides the option of coloring each point.
* Document Viewer: A selected document's corpus is shown in the document viewer on the right.

These two charts work in tandem in that any document can be clicked to be viewed in the document viewer.  Each portion of the visualization is an independent View that has a data Model and uses a charting function to render the visual components.

Scatterplot
--------------

The scatterplot is an instantiation of the view [ScatterView](https://github.com/mkfreeman/termite-dev/blob/master/js/ScatterView.js) and has a data model [ScatterModel](https://github.com/mkfreeman/termite-dev/blob/master/js/ScatterModel.js).  The chart layout and representation is powered by the [Scatter](https://github.com/mkfreeman/termite-dev/blob/master/js/scatter.js) function.

The ScatterView formats the data from the ScatterModel and passes it to the Scatter function.  The Scatter function expects is powered by an array of objects (each corresponding to a single data point), each with the following data attributes:

| Variable      | Type          | Functionality |
| ------------- |:-------------:| :-----|
| id    				| integer		| The value is used to identify the document which is clicked or hovered over|
| x			   			| numeric    	| This dictates the position along the x-axis |
| y 					| numeric (0 < y < 1)| This dictates the position along the y-axis, and is bound by 0 and 1.|
| color (optional)		| string (color)| This assigns the color value to the point, used when color scale is categorical |
| colorValue (optional) | numeric       | This is used to calculate the color if the color range is continuous.|

The ScatterModel (the data for ScatterView) prepares data for both the ScatterView and ControlsView.  The data is currently accessed from static files, and assigned to static variables (line 84):
```javascript
// Documents is defined in data as response from http://termite.jcchuang.org/poliblogs_stm/corpus/Documents?format=json&docLimit=5000
// proportions is defined in data as response from http://termite.jcchuang.org/poliblogs_stm/lda/DocTopicMatrix?format=json&docLimit=5000

ScatterModel.prototype.loadData = function(callback) {
	this.rawData = Documents.Documents
	this.rawProportions = proportions.DocTopicMatrix
	this.prep(callback)
}
```

Topic proportions are then filtered down for the specific topic (line 38, ScatterModel.js):

```javascript
// Prep proportions
		this.topicProportions = {}
		this.rawProportions.filter(function(d){return d.topic == that.get('topic')}).map(function(d) {that.topicProportions[d.docID] = d.value})

```

These values are then prepped into a data object for the view (line 54, ScatterModel.js):
```javascript
// Prep Data for View
this.data = this.rawData.map(function(d,i) {
	var prop = that.topicProportions[d.DocID] == undefined? 0 : that.topicProportions[d.DocID]
	var content = d.DocContent
	var xVar = that.get('xVariable')
	var colorVar = that.get('colorVariable')
	var colorValue = colorVar == 'none' ? 'none' : d[colorVar]
	var groupVar = that.get('group1')
	var xLabel = d[xVar]
	var xValue = that.get('xVariableType') !='integer' ? that.xLabels.indexOf(xLabel) : xLabel
	var groupValue =d[groupVar]
	return {id:i,
		proportion:prop,
		content:content,
		xVar:xVar,
		xValue:xValue,
		colorVar:colorVar,
		colorValue:colorValue,
		xLabel:xLabel,
	}
})
```

There is only minor object manipulation within the ScatterView before passing to the Scatter function (line 59, ScatterView.js):
```javascript
prepData:function() {
	var that = this
	this.chartData = []
	this.model.data.map(function(d,i) {
		var color =  'blue'
		that.chartData.push({
			id:d.id,
			x:isFinite(d.xValue) ? Number(d.xValue) : d.xValue,
			colorValue:d.colorValue,
			y:Number(d.proportion),
			color:color
		})
	})
},
```

TextBox
--------------
The document body is an instantiation of the [TextBoxView](https://github.com/mkfreeman/termite-dev/blob/master/js/TextBoxView.js) which uses the [TextBox](https://github.com/mkfreeman/termite-dev/blob/master/js/TextBox.js) function to render the corpus.

The TextBoxView formats the following variables to pass to the TextBox function

| Variable      | Type          | Functionality |
| ------------- |:-------------:| :-----|
| id    				| integer		| The value is used to identify the document which is currently selected.|
| text			   		| string    	| This is the document body that renders as the text on the screen. |
| width					| numeric 	    | This is the pixel width of the TextBox|
| height				| numeric 		| This is the pixel height of the TextBox |
| position				| numeric       | Object with attributes "left" and "top" for positioning of the TextBox|
| container				| string        | Wrapper div on the page that the textbox will be appended to.|

The formatting is done here (line 27, TextBoxView.js):
```javascript
TextBoxView.prototype.loadSettings = function() {
	return {
		text:this.viewText,
		container:this.el.id,
		id:this.textid,
		width:this.options.width,
		height:this.options.height,
		position:this.options.position

	}
}

```
The TextBoxView is also powered by the ScatterModel as the data, and isolates the corpus by referencing the current docNum attribute of the ScatterModel (line 11, TextBoxView.js)
```javascript
var textId = this.model.get('docNum')
this.viewText = this.model.data[textId].content
```

Controls
--------------
The Controls (Topic, X Variable, and Color) options are powered by the ControlsView and use the Controls file to render the menus.  This data for the Controls is also the ScatterModel object.

**Topic**

The data for the topic menu are prepared in the ScatterModel object (line 27, ScatterModel.js):

```javascript
// topTerms is defined as response from: http://termite.jcchuang.org/poliblogs_stm/lda/TopTerms?format=json
// Format terms
topTerms.TopTerms.map(function(d) {
	that.terms[d.topic] = that.terms[d.topic] == undefined ? [] : that.terms[d.topic]
	that.terms[d.topic].push({term:d.term, value:d.value})
})

// Sort terms
d3.keys(that.terms).map(function(d) {
	that.terms[d].sort(function(a,b) {return a.value - b.value})
})

```

**X Variable and Color options**

The X Variable and Color menu data (options) is currently set in the ScatterModel (line 21, ScatterModel.js):
```javascript
// Documents is defined in data as response from http://termite.jcchuang.org/poliblogs_stm/corpus/Documents?format=json&docLimit=5000
that.variables = Documents.Metadata.filter(function(d) {return d.name.indexOf("Doc")==-1})
```

All views are instantiated in the index.html once the data for the model has loaded (line 68, index.html)
```javascript
sm.loadData(function() {
	cv = new ControlsView()
	sv = new ScatterView({model:sm, el:'#main', chartid:'scatter-' + d, textid:'text-' + d})
	tv = new TextBoxView({model:sm, el:'#main', textid:'text-' + d})
})
```


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.analytics.synapse.artifacts.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.Map;

/** The compression method used on a dataset. */
@Fluent
public final class DatasetCompression {
    /*
     * Type of dataset compression. Type: string (or Expression with resultType string).
     */
    @JsonProperty(value = "type", required = true)
    private Object type;

    /*
     * The dataset compression level. Type: string (or Expression with resultType string).
     */
    @JsonProperty(value = "level")
    private Object level;

    /*
     * The compression method used on a dataset.
     */
    @JsonIgnore private Map<String, Object> additionalProperties;

    /**
     * Get the type property: Type of dataset compression. Type: string (or Expression with resultType string).
     *
     * @return the type value.
     */
    public Object getType() {
        return this.type;
    }

    /**
     * Set the type property: Type of dataset compression. Type: string (or Expression with resultType string).
     *
     * @param type the type value to set.
     * @return the DatasetCompression object itself.
     */
    public DatasetCompression setType(Object type) {
        this.type = type;
        return this;
    }

    /**
     * Get the level property: The dataset compression level. Type: string (or Expression with resultType string).
     *
     * @return the level value.
     */
    public Object getLevel() {
        return this.level;
    }

    /**
     * Set the level property: The dataset compression level. Type: string (or Expression with resultType string).
     *
     * @param level the level value to set.
     * @return the DatasetCompression object itself.
     */
    public DatasetCompression setLevel(Object level) {
        this.level = level;
        return this;
    }

    /**
     * Get the additionalProperties property: The compression method used on a dataset.
     *
     * @return the additionalProperties value.
     */
    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: The compression method used on a dataset.
     *
     * @param additionalProperties the additionalProperties value to set.
     * @return the DatasetCompression object itself.
     */
    public DatasetCompression setAdditionalProperties(Map<String, Object> additionalProperties) {
        this.additionalProperties = additionalProperties;
        return this;
    }

    @JsonAnySetter
    void setAdditionalProperties(String key, Object value) {
        if (additionalProperties == null) {
            additionalProperties = new HashMap<>();
        }
        additionalProperties.put(key, value);
    }
}


text:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /*HAVE_CONFIG_H*/

#include "minc_error.h"

#include  <internal_volume_io.h>
#include  <stdarg.h>

#define  MAX_PRINT_STACK  100

typedef  void (*print_function_type) ( VIO_STR );

static  print_function_type  print_function[MAX_PRINT_STACK] = { NULL };
static  int                  top_of_stack = 0;

static  print_function_type  print_error_function[MAX_PRINT_STACK] = { NULL };
static  int                  top_of_error_stack = 0;

/* ----------------------------- MNI Header -----------------------------------
@NAME       : set_print_function
@INPUT      : function
@OUTPUT     :
@RETURNS    :
@DESCRIPTION: Sets the output function.  If you use the function print()
              everywhere, in place of printf, then by default it uses
              printf to send output to stdout.  However, you can call
              the set_print_function() to tell it to use a different output
              function, e.g. output to a GL or X window.
@METHOD     :
@GLOBALS    :
@CALLS      :
@CREATED    : 1993            David MacDonald
@MODIFIED   :
---------------------------------------------------------------------------- */

VIOAPI  void  set_print_function( void  (*function) ( VIO_STR ) )
{
    print_function[top_of_stack] = function;
}

/* ----------------------------- MNI Header -----------------------------------
@NAME       : push_print_function
@INPUT      :
@OUTPUT     :
@RETURNS    :
@DESCRIPTION: Save the current print function, so, for instance, you can
              print to stdout temporarily.
@METHOD     :
@GLOBALS    :
@CALLS      :
@CREATED    : 1993            David MacDonald
@MODIFIED   :
---------------------------------------------------------------------------- */

VIOAPI  void  push_print_function( void )
{
    if( top_of_stack < MAX_PRINT_STACK - 1 )
    {
        ++top_of_stack;
        print_function[top_of_stack] = NULL;
    }
    else
        handle_internal_error( "Stack overflow in push_print_function" );
}

/* ----------------------------- MNI Header -----------------------------------
@NAME       : pop_print_function
@INPUT      :
@OUTPUT     :
@RETURNS    :
@DESCRIPTION: Restore the print function.
@METHOD     :
@GLOBALS    :
@CALLS      :
@CREATED    : 1993            David MacDonald
@MODIFIED   :
---------------------------------------------------------------------------- */

VIOAPI  void  pop_print_function( void )
{
    if( top_of_stack > 0 )
        --top_of_stack;
    else
        handle_internal_error( "Stack underflow in pop_print_function" );
}

/* ----------------------------- MNI Header -----------------------------------
@NAME       : print
@INPUT      : exactly same arguments as printf
@OUTPUT     :
@RETURNS    :
@DESCRIPTION: prints the arguments to a temporary string buffer, then either
              printf's the or calls the user installed function to output
              the string.
@METHOD     :
@GLOBALS    :
@CALLS      :
@CREATED    : 1993            David MacDonald
@MODIFIED   :
---------------------------------------------------------------------------- */

/* VARARGS */
VIOAPI  void  print( VIO_STR format, ... )
{
    va_list  ap;
    char     print_buffer[VIO_EXTREMELY_LARGE_STRING_SIZE];

    va_start( ap, format );
    (void) vsprintf( print_buffer, format, ap );
    va_end( ap );

    if( print_function[top_of_stack] == NULL )
        (void) printf( "%s", print_buffer );
    else
        (*(print_function[top_of_stack])) ( print_buffer );
}

/* ----------------------------- MNI Header -----------------------------------
@NAME       : set_print_error_function
@INPUT      : function
@OUTPUT     :
@RETURNS    :
@DESCRIPTION: Sets the output function.  If you use the function print_error()
              everywhere, in place of printf, then by default it uses
              printf to send output to stderr.  However, you can call
              the set_print_error_function() to tell it to use a different
              output function, e.g. output to a GL or X window.
@METHOD     :
@GLOBALS    :
@CALLS      :
@CREATED    : 1993            David MacDonald
@MODIFIED   :
---------------------------------------------------------------------------- */

VIOAPI  void  set_print_error_function( void  (*function) ( char [] ) )
{
    print_error_function[top_of_error_stack] = function;
}

/* ----------------------------- MNI Header -----------------------------------
@NAME       : push_print_error_function
@INPUT      :
@OUTPUT     :
@RETURNS    :
@DESCRIPTION: Save the current print error function, so, for instance, you can
              print to stdout temporarily.
@METHOD     :
@GLOBALS    :
@CALLS      :
@CREATED    : 1993            David MacDonald
@MODIFIED   :
---------------------------------------------------------------------------- */

VIOAPI  void  push_print_error_function( void )
{
    if( top_of_error_stack < MAX_PRINT_STACK - 1 )
    {
        ++top_of_error_stack;
        print_error_function[top_of_error_stack] = NULL;
    }
    else
        handle_internal_error( "Stack overflow in push_print_error_function" );
}

/* ----------------------------- MNI Header -----------------------------------
@NAME       : pop_print_error_function
@INPUT      :
@OUTPUT     :
@RETURNS    :
@DESCRIPTION: Restore the print_error function.
@METHOD     :
@GLOBALS    :
@CALLS      :
@CREATED    : 1993            David MacDonald
@MODIFIED   :
---------------------------------------------------------------------------- */

VIOAPI  void  pop_print_error_function( void )
{
    if( top_of_error_stack > 0 )
        --top_of_error_stack;
    else
        handle_internal_error( "Stack underflow in pop_print_error_function" );
}

/* ----------------------------- MNI Header -----------------------------------
@NAME       : print_error
@INPUT      : exactly same arguments as printf
@OUTPUT     :
@RETURNS    :
@DESCRIPTION: prints the arguments to a temporary string buffer, then either
              fprintf's to stderr or calls the user installed function to
              output the string.
@METHOD     :
@GLOBALS    :
@CALLS      :
@CREATED    : 1993            David MacDonald
@MODIFIED   :
---------------------------------------------------------------------------- */

/* VARARGS */
VIOAPI  void  print_error( char format[], ... )
{
    va_list  ap;
    char     print_buffer[VIO_EXTREMELY_LARGE_STRING_SIZE];

    va_start( ap, format );
    vsprintf( print_buffer, format, ap );
    va_end( ap );

    if( print_error_function[top_of_error_stack] == NULL )
        MI_LOG_ERROR(MI_MSG_VOLUME_IO, print_buffer);
    else
        (*(print_error_function[top_of_error_stack])) ( print_buffer );
}

/* ----------------------------- MNI Header -----------------------------------
@NAME       : handle_internal_error
@INPUT      : str
@OUTPUT     :
@RETURNS    :
@DESCRIPTION: Prints the error string and tries to get users permission to
              abort.
@METHOD     :
@GLOBALS    :
@CALLS      :
@CREATED    : 1993            David MacDonald
@MODIFIED   :
---------------------------------------------------------------------------- */

VIOAPI  void   handle_internal_error( char  str[] )
{
    /*print_error( "Internal error:  %s\n", str );
    abort_if_allowed();*/
    MI_LOG_ERROR(MI_MSG_VOLUME_IO, str);
}

/* ----------------------------- MNI Header -----------------------------------
@NAME       : abort_if_allowed
@INPUT      :
@OUTPUT     :
@RETURNS    :
@DESCRIPTION: Checks if the user wants to abort.
@METHOD     :
@GLOBALS    :
@CALLS      :
@CREATED    :                      David MacDonald
@MODIFIED   :
---------------------------------------------------------------------------- */

VIOAPI  void  abort_if_allowed( void )
{
    char  ch;

    if( VIO_ENV_EXISTS( "ABORT_FLAG" ) )
    {
        print_error( "Do you wish to abort (y/n): " );
        do
        {
            ch = (char) getchar();
        }
        while( ch != 'y' && ch != 'n' );

        while( getchar() != '\n' )
        {
        }

        if( ch == 'y' )
        {
            abort();
        }
    }
}


text:
name: midi chordify
description: MIDI processor VST/AU. Notes go in, chords come out.
author: osar.fr
--]]

require "include/protoplug"

-- what kind of chord ?
local chordStructure = {0, 3, 5, 7, 11}
local blockEvents = {}

function plugin.processBlock(samples, smax, midiBuf)
	blockEvents = {}
	-- analyse midi buffer and prepare a chord for each note
	for ev in midiBuf:eachEvent() do
		if ev:isNoteOn() then
			chordOn(ev)
		elseif ev:isNoteOff() then
			chordOff(ev)
		end
	end
	-- fill midi buffer with prepared notes
	midiBuf:clear()
	if #blockEvents>0 then
		for _,e in ipairs(blockEvents) do
			midiBuf:addEvent(e)
		end
	end
end

function chordOn(root)
	for _, offset in ipairs(chordStructure) do
		local newEv = midi.Event.noteOn(
			root:getChannel(),
			root:getNote()+offset,
			root:getVel())
		table.insert(blockEvents, newEv)
	end
end

function chordOff(root)
	for _, offset in ipairs(chordStructure) do
		local newEv = midi.Event.noteOff(
			root:getChannel(),
			root:getNote()+offset)
		table.insert(blockEvents, newEv)
	end
end


text:
<?php

/**
 * Manufacture update view.
 *
 * @var yii\base\View $this View
 * @var modules\directory\models\Manufacture $model Model
 * @var \vova07\themes\admin\widgets\Box $box Box widget instance
 * @var array $statusArray Statuses array
 */

use vova07\themes\admin\widgets\Box;
use modules\directory\Module;

$this->title = Module::t('manufacture', 'BACKEND_UPDATE_TITLE');
$this->params['subtitle'] = Module::t('manufacture', 'BACKEND_UPDATE_SUBTITLE');
$this->params['breadcrumbs'] = [
    [
        'label' => $this->title,
        'url' => ['index'],
    ],
    $this->params['subtitle']
];
$boxButtons = ['{cancel}'];

$boxButtons[] = '{create}';

$boxButtons[] = '{delete}';

$boxButtons = !empty($boxButtons) ? implode(' ', $boxButtons) : null; ?>

        <?php $box = Box::begin(
            [
                'title' => $this->params['subtitle'],
                'renderBody' => false,
                'options' => [
                    'class' => 'box-success'
                ],
                'bodyOptions' => [
                    'class' => 'table-responsive'
                ],
                'buttonsTemplate' => $boxButtons
            ]
        );
        echo $this->render(
            '_form',
            [
                'model' => $model,
                'formModel' => $formModel,
                'box' => $box
            ]
        );
        Box::end(); ?>


text:
from PartyProblemSimulator.Solvers.Organisms.Genome import Genome
from PartyProblemSimulator.Solvers.Organisms.Genes.BinaryGene import BinaryGene
from random import randint

class BinaryGenome(Genome):
    """ A binary encoding of a genome consisting of bits. """

    def __init__(self, genome_size):
        """ Initialises the number of genes required in this genome. """
        Genome.__init__(self, genome_size)

    def _instantiate(self):
        """ Initialises this genome with a random set of binary values. """
        self.clear_genes()
        count = 0
        while count < self.get_expected_genome_size():
            if randint(0, 100) < 50:        # Randomize the value to apply to the gene
                self.add_gene(BinaryGene(False))
            else:
                self.add_gene(BinaryGene(True))
            count = count + 1

    def get_genome_length(self):
        """ Retrieves the length of this genome. """
        return self.get_expected_genome_size()

    def evaluate(self, equation):
        """ Evaluates this genome against the given equation. """
        input_vector = {}
        count = 1   # Generate the input vector
        for gene in self.get_genes():
            gene_id = "{" + str(count) + "}" # Generate the identifier for this gene in the equation.
            input_vector[gene_id] = gene.get_information()
            count = count + 1
        clausal_result = equation.get_clause_evaluation(input_vector)
        try:
            score = sum(clausal_result) / len(clausal_result)   # Calculate the percentage of clauses met.
        except ZeroDivisionError:
            score = 0
        return score


text:
package org.trimou.trimness.config;

/**
 *
 * @author Martin Kouba
 */
public class SimpleKey implements Key {

    /**
     *
     * @param key
     * @param defaultValue
     * @return a configuration key
     */
    static SimpleKey fromKey(String key, Object defaultValue) {
        return new SimpleKey(key, Key.keyToEnv(key), defaultValue);
    }

    /**
     *
     * @param envKey
     * @param defaultValue
     * @return a configuration key
     */
    static SimpleKey fromEnvKey(String envKey, Object defaultValue) {
        return new SimpleKey(Key.envToKey(envKey), envKey, defaultValue);
    }

    private final String envKey;

    private final String key;

    private final Object defaultValue;

    public SimpleKey(String key, String envKey, Object defaultValue) {
        this.envKey = envKey;
        this.key = key;
        this.defaultValue = defaultValue;
    }

    @Override
    public String get() {
        return key;
    }

    @Override
    public String getEnvKey() {
        return envKey;
    }

    @Override
    public Object getDefaultValue() {
        return defaultValue;
    }

}


text:
The Interent of Things is rapidly becoming larger and larger. Security cameras are at the forefront of this new frontier...

Unfortunately, manufacturers and users of security cameras tend to leave them untouched, leaving them open to attackers who have a list of common, default passwords. This tool gives the attackers exaclty what they need to break into said cameras.

This tool is not meant to be used in a malicious manner, rather, it should be used to help users and manufacturers of security cameras become alert of these problems.

## Usage

In order to use this tool, input multiple IP addresses that you would like to look for into "ip_list.txt," when doing so list every IP address that you suspect of being an IP Camera/Security Camera.

If the program confirms that it is a security camera, it will then attack it, if the attack is successful, the ruby script will let you know, from there you will have to open up "checkthisfile.txt" and view the IP address, as well as the credentials of the victimized security camera.