text:
{% extends "layout.html" %}

{% block page_title %}
  Sprint {{sprint}} - Dashboard
{% endblock %}

{% block inside_header %}

{% endblock %}

{% block after_header %}
{% include "sprint/"+sprint+"/includes/header.html" %}
{% endblock %}

{% block content %}

  {% include "includes/link-back.html" %}

Provider screens

Has the provider already approved a commitment with this employer

        <form>
                    <legend class="visuallyhidden">Has the provider already approved a commitment with this employer</legend>

                        <input id="radio-1" type="radio" name="radio-group" value="1">
                        Yes

                        <input id="radio-2" type="radio" name="radio-group" value="0">
                       No

                  </form>

        Continue

{% endblock %}


text:
package middleware

import (
	"errors"
	"reflect"
	"strings"
	"testing"
	"time"

	"github.com/go-openapi/spec"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/stretchr/testify/assert"
)

var evaluatesAsTrue = []string{"true", "1", "yes", "ok", "y", "on", "selected", "checked", "t", "enabled"}

type unmarshallerSlice []string

func (u *unmarshallerSlice) UnmarshalText(data []byte) error {
	if len(data) == 0 {
		return errors.New("an error")
	}
	*u = strings.Split(string(data), ",")
	return nil
}

type SomeOperationParams struct {
	Name        string
	ID          int64
	Confirmed   bool
	Age         int
	Visits      int32
	Count       int16
	Seq         int8
	UID         uint64
	UAge        uint
	UVisits     uint32
	UCount      uint16
	USeq        uint8
	Score       float32
	Rate        float64
	Timestamp   strfmt.DateTime
	Birthdate   strfmt.Date
	LastFailure *strfmt.DateTime
	Unsupported struct{}
	Tags        []string
	Prefs       []int32
	Categories  unmarshallerSlice
}

func FloatParamTest(t *testing.T, fName, pName, format string, val reflect.Value, defVal, expectedDef interface{}, actual func() interface{}) {
	fld := val.FieldByName(pName)
	binder := &untypedParamBinder{
		parameter: spec.QueryParam(pName).Typed("number", "double").WithDefault(defVal),
		Name:      pName,
	}

	err := binder.setFieldValue(fld, defVal, "5", true)
	assert.NoError(t, err)
	assert.EqualValues(t, 5, actual())

	err = binder.setFieldValue(fld, defVal, "", true)
	assert.NoError(t, err)
	assert.EqualValues(t, expectedDef, actual())

	err = binder.setFieldValue(fld, defVal, "yada", true)
	assert.Error(t, err)
}

func IntParamTest(t *testing.T, pName string, val reflect.Value, defVal, expectedDef interface{}, actual func() interface{}) {
	fld := val.FieldByName(pName)

	binder := &untypedParamBinder{
		parameter: spec.QueryParam(pName).Typed("integer", "int64").WithDefault(defVal),
		Name:      pName,
	}
	err := binder.setFieldValue(fld, defVal, "5", true)
	assert.NoError(t, err)
	assert.EqualValues(t, 5, actual())

	err = binder.setFieldValue(fld, defVal, "", true)
	assert.NoError(t, err)
	assert.EqualValues(t, expectedDef, actual())

	err = binder.setFieldValue(fld, defVal, "yada", true)
	assert.Error(t, err)
}

func TestParamBinding(t *testing.T) {

	actual := new(SomeOperationParams)
	val := reflect.ValueOf(actual).Elem()
	pName := "Name"
	fld := val.FieldByName(pName)

	binder := &untypedParamBinder{
		parameter: spec.QueryParam(pName).Typed("string", "").WithDefault("some-name"),
		Name:      pName,
	}

	err := binder.setFieldValue(fld, "some-name", "the name value", true)
	assert.NoError(t, err)
	assert.Equal(t, "the name value", actual.Name)

	err = binder.setFieldValue(fld, "some-name", "", true)
	assert.NoError(t, err)
	assert.Equal(t, "some-name", actual.Name)

	IntParamTest(t, "ID", val, 1, 1, func() interface{} { return actual.ID })
	IntParamTest(t, "ID", val, nil, 0, func() interface{} { return actual.ID })
	IntParamTest(t, "Age", val, 1, 1, func() interface{} { return actual.Age })
	IntParamTest(t, "Age", val, nil, 0, func() interface{} { return actual.Age })
	IntParamTest(t, "Visits", val, 1, 1, func() interface{} { return actual.Visits })
	IntParamTest(t, "Visits", val, nil, 0, func() interface{} { return actual.Visits })
	IntParamTest(t, "Count", val, 1, 1, func() interface{} { return actual.Count })
	IntParamTest(t, "Count", val, nil, 0, func() interface{} { return actual.Count })
	IntParamTest(t, "Seq", val, 1, 1, func() interface{} { return actual.Seq })
	IntParamTest(t, "Seq", val, nil, 0, func() interface{} { return actual.Seq })
	IntParamTest(t, "UID", val, uint64(1), 1, func() interface{} { return actual.UID })
	IntParamTest(t, "UID", val, uint64(0), 0, func() interface{} { return actual.UID })
	IntParamTest(t, "UAge", val, uint(1), 1, func() interface{} { return actual.UAge })
	IntParamTest(t, "UAge", val, nil, 0, func() interface{} { return actual.UAge })
	IntParamTest(t, "UVisits", val, uint32(1), 1, func() interface{} { return actual.UVisits })
	IntParamTest(t, "UVisits", val, nil, 0, func() interface{} { return actual.UVisits })
	IntParamTest(t, "UCount", val, uint16(1), 1, func() interface{} { return actual.UCount })
	IntParamTest(t, "UCount", val, nil, 0, func() interface{} { return actual.UCount })
	IntParamTest(t, "USeq", val, uint8(1), 1, func() interface{} { return actual.USeq })
	IntParamTest(t, "USeq", val, nil, 0, func() interface{} { return actual.USeq })

	FloatParamTest(t, "score", "Score", "float", val, 1.0, 1, func() interface{} { return actual.Score })
	FloatParamTest(t, "score", "Score", "float", val, nil, 0, func() interface{} { return actual.Score })
	FloatParamTest(t, "rate", "Rate", "double", val, 1.0, 1, func() interface{} { return actual.Rate })
	FloatParamTest(t, "rate", "Rate", "double", val, nil, 0, func() interface{} { return actual.Rate })

	pName = "Confirmed"
	confirmedField := val.FieldByName(pName)
	binder = &untypedParamBinder{
		parameter: spec.QueryParam(pName).Typed("boolean", "").WithDefault(true),
		Name:      pName,
	}

	for _, tv := range evaluatesAsTrue {
		err = binder.setFieldValue(confirmedField, true, tv, true)
		assert.NoError(t, err)
		assert.True(t, actual.Confirmed)
	}

	err = binder.setFieldValue(confirmedField, true, "", true)
	assert.NoError(t, err)
	assert.True(t, actual.Confirmed)

	err = binder.setFieldValue(confirmedField, true, "0", true)
	assert.NoError(t, err)
	assert.False(t, actual.Confirmed)

	pName = "Timestamp"
	timeField := val.FieldByName(pName)
	dt := strfmt.DateTime(time.Date(2014, 3, 19, 2, 9, 0, 0, time.UTC))
	binder = &untypedParamBinder{
		parameter: spec.QueryParam(pName).Typed("string", "date-time").WithDefault(dt),
		Name:      pName,
	}
	exp := strfmt.DateTime(time.Date(2014, 5, 14, 2, 9, 0, 0, time.UTC))

	err = binder.setFieldValue(timeField, dt, exp.String(), true)
	assert.NoError(t, err)
	assert.Equal(t, exp, actual.Timestamp)

	err = binder.setFieldValue(timeField, dt, "", true)
	assert.NoError(t, err)
	assert.Equal(t, dt, actual.Timestamp)

	err = binder.setFieldValue(timeField, dt, "yada", true)
	assert.Error(t, err)

	ddt := strfmt.Date(time.Date(2014, 3, 19, 0, 0, 0, 0, time.UTC))
	pName = "Birthdate"
	dateField := val.FieldByName(pName)
	binder = &untypedParamBinder{
		parameter: spec.QueryParam(pName).Typed("string", "date").WithDefault(ddt),
		Name:      pName,
	}
	expd := strfmt.Date(time.Date(2014, 5, 14, 0, 0, 0, 0, time.UTC))

	err = binder.setFieldValue(dateField, ddt, expd.String(), true)
	assert.NoError(t, err)
	assert.Equal(t, expd, actual.Birthdate)

	err = binder.setFieldValue(dateField, ddt, "", true)
	assert.NoError(t, err)
	assert.Equal(t, ddt, actual.Birthdate)

	err = binder.setFieldValue(dateField, ddt, "yada", true)
	assert.Error(t, err)

	dt = strfmt.DateTime(time.Date(2014, 3, 19, 2, 9, 0, 0, time.UTC))
	fdt := &dt
	pName = "LastFailure"
	ftimeField := val.FieldByName(pName)
	binder = &untypedParamBinder{
		parameter: spec.QueryParam(pName).Typed("string", "date").WithDefault(fdt),
		Name:      pName,
	}
	exp = strfmt.DateTime(time.Date(2014, 5, 14, 2, 9, 0, 0, time.UTC))
	fexp := &exp

	err = binder.setFieldValue(ftimeField, fdt, fexp.String(), true)
	assert.NoError(t, err)
	assert.Equal(t, fexp, actual.LastFailure)

	err = binder.setFieldValue(ftimeField, fdt, "", true)
	assert.NoError(t, err)
	assert.Equal(t, fdt, actual.LastFailure)

	err = binder.setFieldValue(ftimeField, fdt, "", true)
	assert.NoError(t, err)
	assert.Equal(t, fdt, actual.LastFailure)

	actual.LastFailure = nil
	err = binder.setFieldValue(ftimeField, fdt, "yada", true)
	assert.Error(t, err)
	assert.Nil(t, actual.LastFailure)

	pName = "Unsupported"
	unsupportedField := val.FieldByName(pName)
	binder = &untypedParamBinder{
		parameter: spec.QueryParam(pName).Typed("string", ""),
		Name:      pName,
	}
	err = binder.setFieldValue(unsupportedField, nil, "", true)
	assert.Error(t, err)
}

func TestSliceConversion(t *testing.T) {

	actual := new(SomeOperationParams)
	val := reflect.ValueOf(actual).Elem()

	// prefsField := val.FieldByName("Prefs")
	// cData := "yada,2,3"
	// _, _, err := readFormattedSliceFieldValue("Prefs", prefsField, cData, "csv", nil)
	// assert.Error(t, err)

	sliced := []string{"some", "string", "values"}
	seps := map[string]string{"ssv": " ", "tsv": "\t", "pipes": "|", "csv": ",", "": ","}

	tagsField := val.FieldByName("Tags")
	for k, sep := range seps {
		binder := &untypedParamBinder{
			Name:      "Tags",
			parameter: spec.QueryParam("tags").CollectionOf(stringItems, k),
		}

		actual.Tags = nil
		cData := strings.Join(sliced, sep)
		tags, _, err := binder.readFormattedSliceFieldValue(cData, tagsField)
		assert.NoError(t, err)
		assert.Equal(t, sliced, tags)
		cData = strings.Join(sliced, " "+sep+" ")
		tags, _, err = binder.readFormattedSliceFieldValue(cData, tagsField)
		assert.NoError(t, err)
		assert.Equal(t, sliced, tags)
		tags, _, err = binder.readFormattedSliceFieldValue("", tagsField)
		assert.NoError(t, err)
		assert.Empty(t, tags)
	}

	assert.Nil(t, swag.SplitByFormat("yada", "multi"))
	assert.Nil(t, swag.SplitByFormat("", ""))

	categoriesField := val.FieldByName("Categories")
	binder := &untypedParamBinder{
		Name:      "Categories",
		parameter: spec.QueryParam("categories").CollectionOf(stringItems, "csv"),
	}
	cData := strings.Join(sliced, ",")
	categories, custom, err := binder.readFormattedSliceFieldValue(cData, categoriesField)
	assert.NoError(t, err)
	assert.EqualValues(t, sliced, actual.Categories)
	assert.True(t, custom)
	assert.Empty(t, categories)
	categories, custom, err = binder.readFormattedSliceFieldValue("", categoriesField)
	assert.Error(t, err)
	assert.True(t, custom)
	assert.Empty(t, categories)
}

redpajama_set_name: RedPajamaGithub


text:
Component\Queue
===============

## Goals

I want to be able to use job queues for a small project and scale it out once my
application needs it without too much hassle. I would like to use MySQL as a
queue for messages and have a AWS SQS queue as well that can both use the same
consumers.

## Definitions

* Publisher - Sends messages to a queue
* Consumer  - Processes messages from a queue
* Message   - Is sent to a queue, is pulled from a queue
* Queue     - Where messages are stored
* Broker    - Contains 0 to n queues, factory for queues

## Key Concepts

## Interfaces

Possible Exceptions

- NoMessageException is thrown when there are no messages in a queue
- InvalidMessageException is thrown when the message passed in to publish or
  delete is invalid and could not be processed correctly.

```php
<?php

namespace Dspacelabs\Component\Queue;

/**
 * Any exceptions that are thrown must throw this exception
 */
class QueueException extends \Exception
{
}
```

```php
<?php

namespace Dspacelabs\Component\Queue;

/**
 * Broker keeps a collection of various queues, brokers do not care the type
 * of queue (database, rabbit, SQS, etc). It just keeps track of the known
 * queues.
 */
interface BrokerInterface
{
    /**
     * @param string $name
     *   The name of the queue.
     * @return QueueInterface
     */
    public function get($name);

    /**
     * @param QueueInterface $queue
     */
    public function addQueue(QueueInterface $queue);
}
```

```php
<?php

namespace Dspacelabs\Component\Queue;

/**
 * Queue can be any type of queue, for example a SQS queue, we don't
 * really care, we just want the name of the queue and we want to be
 * able publish messages to the queue and to receive a message from
 * the queue
 */
interface QueueInterface
{
    /**
     * @return string
     *   Returns the name of the queue
     */
    public function getName();

    /**
     * Publishes a message to the queue
     *
     * Modifies the message, adds attributes and returns the message object
     * that was passed into it.
     *
     * @param MessageInterface $message
     * @thorws CacheException
     * @return MessageInterface
     */
    public function publish(MessageInterface $message);

    /**
     * @return MessageInterface|null
     *   Returns a MessageInterface if there is a message in the the queue or
     *   if no messages in the queue, it returns null
     */
    public function receive();

    /**
     * @param MessageInterface $message
     *   Message that needs to be deleted
     */
    public function delete(MessageInterface $message);
}
```

```php
<?php

namespace Dspacelabs\Component\Queue;

/**
 * Messages are used to send to a queue and are returned from a queue object.
 * Messages can have attributes, as an example, SQS calls these attributes, but
 * in some other systems, they are called headers. When using AMQP you can set
 * headers such as Content-Type, which within this library are attributes.
 */
interface MessageInterface
{
    /**
     * What is stored in the database
     *
     * @param string $body
     * @return self
     */
    public function setBody($body);

    /**
     * @return string
     */
    public function getBody();

    /**
     * @return array
     */
    public function getAttributes();

    /**
     * @param string $header
     * @param string $value
     * @return self
     */
    public function addAttribute($attribute, $value);

    /**
     * @param array $headers
     * @return self
     */
    public function setAttributes(array $attribute);
}
```


text:
'use strict';

angular.module('mean').factory('CajaService', ['Restangular',
    function (Restangular) {

        var _cajaService = Restangular.all('cajas');
        var baseUrl = 'cajas';

        return {
            getDetalle: function (idCaja) {
                return Restangular.all(baseUrl + '/' + idCaja + '/detalle').getList();
            },
            getBovedas: function (idCaja) {
                return Restangular.all(baseUrl + '/' + idCaja + '/bovedas').getList();
            },
            getMonedas: function (idCaja) {
                return Restangular.all(baseUrl + '/' + idCaja + '/monedas').getList();
            },
            getPendientes: function (idCaja, idHistorial) {
                if (arguments.length === 1)
                    return Restangular.all(baseUrl + '/' + idCaja + '/pendientes').getList();
                else if (arguments.length === 2)
                    return Restangular.all(baseUrl + '/' + idCaja + '/pendientes').getList({idHistorial: idHistorial});
            },
            getPendientesPorPagar: function (idCaja) {
                return Restangular.all(baseUrl + '/' + idCaja + '/pendientesPorPagar').getList();
            },
            getVoucherCuentaAporte: function (idTransaccion) {
                return Restangular.one(baseUrl + '/voucherCuentaAporte/' + idTransaccion).get();
            },
            getVoucherTransaccionBancaria: function (idTransaccion) {
                return Restangular.one(baseUrl + '/voucherTransaccionBancaria/' + idTransaccion).get();
            },
            getVoucherTransferenciaBancaria: function (idTransferencia) {
                return Restangular.one(baseUrl + '/voucherTransferenciaBancaria/' + idTransferencia).get();
            },
            getVoucherCompraVenta: function (idCompraVenta) {
                return Restangular.one(baseUrl + '/voucherCompraVenta/' + idCompraVenta).get();
            },
            getVoucherTransaccionCheque: function (idTransaccionCheque) {
                return Restangular.one(baseUrl + '/voucherCheque/' + idTransaccionCheque).get();
            },
            getHistorialTransaccion: function (idCaja, idHistorial, filterText) {
                return Restangular.all(baseUrl + '/' + idCaja + '/historialTransaccion').getList({
                    idHistorial: idHistorial,
                    filterText: filterText
                });
            },
            getVoucherCierreCaja: function (idCaja, idHistorial) {
                return Restangular.all(baseUrl + '/' + idCaja + '/historiales/voucherCierreCaja').getList({idHistorial: idHistorial});
            },
            getResumenCierreCaja: function (idCaja, idHistorial) {
                return Restangular.one(baseUrl + '/' + idCaja + '/historiales/resumenCierreCaja').get({idHistorial: idHistorial});
            },
            getHistoriales: function (idCaja, desde, hasta) {
                return Restangular.all(baseUrl + '/' + idCaja + '/historiales').getList({'desde': desde, 'hasta': hasta}, {});
            },
            getTransaccionBovedaCajaEnviadas: function (idCaja, idHistorial) {
                return Restangular.all(baseUrl + '/' + idCaja + '/transaccionBovedaCaja/enviados').getList({idHistorial: idHistorial});
            },
            getTransaccionBovedaCajaRecibidas: function (idCaja, idHistorial) {
                return Restangular.all(baseUrl + '/' + idCaja + '/transaccionBovedaCaja/recibidos').getList({idHistorial: idHistorial});
            },
            getTransaccionCajaCajaEnviadas: function (idCaja, idHistorial) {
                return Restangular.all(baseUrl + '/' + idCaja + '/transaccionCajaCaja/enviados').getList({idHistorial: idHistorial});
            },
            getTransaccionCajaCajaRecibidas: function (idCaja, idHistorial) {
                return Restangular.all(baseUrl + '/' + idCaja + '/transaccionCajaCaja/recibidos').getList({idHistorial: idHistorial});
            },
            getVoucherTransaccionBovedaCaja: function (idTransaccionBovedaCaja) {
                return Restangular.one(baseUrl + '/voucherTransaccionBovedaCaja/' + idTransaccionBovedaCaja).get();
            },
            getVoucherTransaccionCajaCaja: function (idTransaccionCajaCaja) {
                return Restangular.one(baseUrl + '/voucherTransaccionCajaCaja/' + idTransaccionCajaCaja).get();
            }
        };

    }]);


text:
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.db import IntegrityError
from django.conf import settings
from django.urls import reverse
from django.utils.timezone import now
from django_bleach.models import BleachField

from .base import LifeTimeTrackingModel

import uuid

class Team(models.Model):
    name = models.CharField(max_length=128)
    subtitle = models.CharField(max_length=256, default=_('Join your neighbors to learn something together. Learning circles meet weekly for 6-8 weeks, and are free to join.'))
    page_slug = models.SlugField(max_length=256, blank=True)
    page_image = models.ImageField(blank=True)
    logo = models.ImageField(blank=True)
    latitude = models.DecimalField(max_digits=8, decimal_places=6, null=True, blank=True)
    longitude = models.DecimalField(max_digits=9, decimal_places=6, null=True, blank=True)
    zoom = models.IntegerField(default=7)
    created_at = models.DateTimeField(default=now)
    email_domain = models.CharField(max_length=128, blank=True)
    invitation_token = models.UUIDField(null=True, blank=True, unique=True)
    email_address = models.CharField(max_length=128, blank=True)
    website = models.URLField(max_length=128, blank=True)
    location = models.CharField(max_length=128, blank=True)
    intro_text = BleachField(max_length=1000, blank=True, allowed_tags=settings.TINYMCE_DEFAULT_CONFIG.get('valid_elements', '').split(','), allowed_attributes={'a': ['href', 'title', 'rel', 'target']})
    membership = models.BooleanField(default=False) # why not call this membership_active?

    def __str__(self):
        return self.name

    def generate_invitation_token(self):
        try:
            self.invitation_token = uuid.uuid4()
            self.save()
        except IntegrityError:
            generate_invitation_token(self)

    def team_invitation_link(self):
        if self.invitation_token is None:
            return None

        base_url = f'{settings.PROTOCOL}://{settings.DOMAIN}'
        path = reverse('studygroups_facilitator_invitation_confirm_token', kwargs={'token': self.invitation_token})

        return base_url + path

class TeamMembership(LifeTimeTrackingModel):
    ORGANIZER = 'ORGANIZER'
    MEMBER = 'MEMBER'
    ROLES = (
        (ORGANIZER, _('Organizer')),
        (MEMBER, _('Member')),
    )
    team = models.ForeignKey('studygroups.Team', on_delete=models.CASCADE)
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    role = models.CharField(max_length=256, choices=ROLES)
    weekly_update_opt_in = models.BooleanField(default=True)

    def __str__(self):
        return 'Team membership: {}'.format(self.user.__str__())

    def to_dict(self):
        return {
            'id': self.user.pk,
            'email': self.user.email,
            'firstName': self.user.first_name,
            'lastName': self.user.last_name
        }

class TeamInvitation(models.Model):
    """ invittion for users to join a team """
    team = models.ForeignKey('studygroups.Team', on_delete=models.CASCADE)
    organizer = models.ForeignKey(User, on_delete=models.CASCADE) # organizer who invited the user
    email = models.EmailField()
    role = models.CharField(max_length=256, choices=TeamMembership.ROLES)
    created_at = models.DateTimeField(auto_now_add=True)
    responded_at = models.DateTimeField(null=True, blank=True)
    joined = models.BooleanField(null=True)

    def __str__(self):
        return 'Invitation <{} to join {}>'.format(self.email, self.team.name)

def get_study_group_organizers(study_group):
    """ Return the organizers for the study group """
    team = study_group.team
    if team:
        organizers = team.teammembership_set.active().filter(role=TeamMembership.ORGANIZER).values('user')
        return User.objects.filter(pk__in=organizers)
    return []

def get_team_users(user):
    """ Return the team members for a user """
    # TODO this function doesn't make sense - only applies for logged in users
    # change functionality or rename to get_team_mates
    team_membership = TeamMembership.objects.active().filter(user=user)
    if team_membership.count() == 1:
        members = team_membership.first().team.teammembership_set.active().values('user')
        return User.objects.filter(pk__in=members)
    return []

""" Return the team a user belongs to """
def get_user_team(user):
    team_membership = TeamMembership.objects.active().filter(user=user).get()
    return team_membership.team

def eligible_team_by_email_domain(user):
    # user is already on a team
    if TeamMembership.objects.active().filter(user=user).exists():
        return None

    email_domain = user.email.rsplit('@', 1)[1]
    matching_team = Team.objects.filter(email_domain=email_domain).first()

    # user already has an explicit invitation to this team or has already responsed to an invitation to this team
    if TeamInvitation.objects.filter(email=user.email, team=matching_team).exists():
        return None

    # team must have an organizer to create invitation
    if not TeamMembership.objects.active().filter(team=matching_team, role=TeamMembership.ORGANIZER).exists():
        return None

    return matching_team


text:
Supplies process information via the `ps aux` command.

Tested on Linux and OSX.

```js
var Psaux = require('psaux')
  , psaux = Psaux();

psaux.parsed(function (err, res) {
  if (err) return console.error(err);
  console.log(res);
})
```

```js
[
  { user: 'thlorenz',
    pid: 1050,
    '%cpu': 2.6,
    '%mem': 1.3,
    vsz: 4490356,
    rss: 217636,
    tty: '??',
    state: 'S',
    started: '5Aug14',
    time: '123:03.05',
    command: '/Applications/iTerm.app/Contents/MacOS/iTerm' },
  { user: '_coreaudiod',
    pid: 257,
    '%cpu': 0.6,
    '%mem': 0.2,
    vsz: 2553344,
    rss: 38572,
    tty: '??',
    state: 'Ss',
    started: '5Aug14',
    time: '32:23.58',
    command: '/usr/sbin/coreaudiod' },
    [...]
]
```

**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*

- [Installation](#installation)
- [API](#api)
    - [Psaux](#psaux)
    - [psaux::clearInterval()](#psauxclearinterval)
    - [psaux::obtain(cb)](#psauxobtaincb)
    - [psaux::parsed(cb)](#psauxparsedcb)
    - [psaux::setInterval(opts)](#psauxsetintervalopts)
    - [psaux::singleton() → {object}](#psauxsingleton-→-object)
    - [Example](#example)
- [License](#license)

## Installation

    npm install ps-aux

## API

Psaux

Creates a psaux object.

Source:

index.js
,
lineno 34

psaux::clearInterval()

Clears any previously registered interval at which process information was obtained
and emitted.

Source:

index.js
,
lineno 167

See:

psaux::setInterval

psaux::obtain(cb)

Obtains raw process information

Parameters:

Name
Type
Description

cb

function

called back with an array of strings each containing information of a running process

Source:

index.js
,
lineno 49

psaux::parsed(cb)

Obtains process information and parses it.

VSZ is the Virtual Memory Size. It includes all memory that the process can
access, including memory that is swapped out and memory that is from shared
libraries.

RSS is the Resident Set Size and is used to show how much memory is
allocated to that process and is in RAM. It does not include memory that is
swapped out. It does include memory from shared libraries as long as the
pages from those libraries are actually in memory. It does include all stack
and heap memory.

Parameters:

Name
Type
Description

cb

function

called back with an array containing running process information

process info:

user    : id of the user that owns the process

pid     : process id

%cpu    : percent of the CPU usage

%mem    : percent memory usage

vsz     : virtual memory size

rss     : resident set size

tty     : controlling terminal

state   : current state of the process (i.e. sleeping)

started : start time of process

time    : how long the process is running

command : command line used to start the process (including args)

Source:

index.js
,
lineno 80

psaux::setInterval(opts)

Causes the psaux object to obtain process information at the given interval
and emit an event for each.
When invoked, previously set intervals are cancelled.

Parameters:

Name
Type
Description

opts

Object

options

Properties

Name
Type
Description

parsed

boolean

if true, the process information is parsed before it is emitted (default: true)

interval

number

interval in milliseconds at which to emit process information (default: 20,000)

Source:

index.js
,
lineno 145

psaux::singleton() → {object}

A singleton psaux instance.
Use it in order to ensure that you only use one instance throughout your app.

Example

// foo.js
var psaux = require('ps-aux').singleton
psaux.setInterval({ parsed: true, interval: 5000 });
// bar.js
var psaux = require('ps-aux').singleton
psaux.on('info', console.log);

Source:

index.js
,
lineno 181

Returns:

a constructed psaux object

Type

object

*generated with [docme](https://github.com/thlorenz/docme)*

## License

MIT


text:
namespace StudentsLearning.Server.Api.Models.AccountViewModels
{
    public class ExternalLoginViewModel
    {
        public string Name { get; set; }

        public string Url { get; set; }

        public string State { get; set; }
    }
}


text:
date
uname -a
openshift version

compute_nodes=$(oc get nodes -l 'node-role.kubernetes.io/compute=true' | awk '{print $1}' | grep -v NAME | xargs)

echo -e "\nComputes nodes are: $compute_nodes"

declare -a node_array
counter=1

oc get nodes -l 'node-role.kubernetes.io/compute=true'
oc describe nodes -l 'node-role.kubernetes.io/compute=true' | grep Taints

# Taint nodes
for n in ${compute_nodes}; do
  node_array[${counter}]=${n}
  echo -e "\nTainting node $n with 'security=s${counter}:NoSchedule'"
  echo "#  oc adm taint nodes $n security=s${counter}:NoSchedule"
  oc adm taint nodes $n security=s${counter}:NoSchedule
  counter=$((counter+1))
done

oc describe nodes -l 'node-role.kubernetes.io/compute=true' | grep Taints

for i in {1..2}; do
  echo "Array element node_array index $i has value : ${node_array[${i}]}"
done

function check_no_error_pods()
{
  error=`oc get pods --all-namespaces | grep Error | wc -l`
  if [ $error -ne 0 ]; then
    echo "$error pods found, exiting"
    exit 1
  fi
}

sleep 5

# start GoLang cluster-loader
export KUBECONFIG=${KUBECONFIG-$HOME/.kube/config}

cd /root/svt/openshift_scalability
ls -ltr config/golang

echo -e "\nStarting GoLang cluster-loader with config file: config/golang/node-taints-pod-tolerations"
/usr/libexec/atomic-openshift/extended.test --ginkgo.focus="Load cluster" --viper-config=config/golang/node-taints-pod-tolerations

sleep 30

check_no_error_pods

oc get pods --all-namespaces -o wide

## TO DO:  check running pod counts  and compare to expected counts (250) in cluster loader yaml file
oc get pods -n taints-toleration-s1-0 -o wide | grep "hellopods-taints-s1" | grep ${node_array[1]} | grep Running | wc -l
oc get pods -n taints-toleration-s2-0 -o wide | grep "hellopods-taints-s2" | grep ${node_array[2]} | grep Running | wc -l

# delete projects:  cleanup
oc delete project taints-toleration-s1-0
oc delete project taints-toleration-s2-0

######### TO DO:
######### wait till all pods with tolerations to the tainted nodes are gone

## remove taints previously configured on nodes
echo -e "\nRemoving the previously configured taints on compute nodes"

for i in {1..2}; do
  echo "Removing previously configured taints on node: ${node_array[${i}]}"
  echo "# oc adm taint nodes ${node_array[${i}]} security- "
  oc adm taint nodes ${node_array[${i}]} security-
done

# check taints are gone
oc describe nodes | grep Taints


text:
using System;
using Microsoft.AspNetCore.DataProtection.Infrastructure;
using Umbraco.Extensions;

namespace Umbraco.Extensions
{
    /// <summary>
    /// Contains extension methods for the <see cref="IApplicationDiscriminator" /> interface.
    /// </summary>
    public static class ApplicationDiscriminatorExtensions
    {
        private static string? s_applicationId;

        /// <summary>
        /// Gets an application id which respects downstream customizations.
        /// </summary>
        /// <remarks>
        /// Hashed to obscure any unintended infrastructure details e.g. the default value is ContentRootPath.
        /// </remarks>
        public static string? GetApplicationId(this IApplicationDiscriminator applicationDiscriminator)
        {
            if (s_applicationId != null)
            {
                return s_applicationId;
            }

            if (applicationDiscriminator == null)
            {
                throw new ArgumentNullException(nameof(applicationDiscriminator));
            }

            return s_applicationId = applicationDiscriminator.Discriminator?.GenerateHash();
        }
    }
}


text:
package fr.xebia.extras.selma.beans;

/**
 * Created with IntelliJ IDEA.
 * User: slemesle
 * Date: 21/11/2013
 * Time: 12:12
 * To change this template use File | Settings | File Templates.
 */
public class CityIn {

    private  String name;
    private  long population;
    private  boolean capital;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getPopulation() {
        return population;
    }

    public void setPopulation(long population) {
        this.population = population;
    }

    public boolean isCapital() {
        return capital;
    }

    public void setCapital(boolean capital) {
        this.capital = capital;
    }
}


text:
package net.sf.jasperreports.chartthemes.settings;

import java.awt.Stroke;
import java.io.Serializable;

import org.jfree.ui.RectangleInsets;

import net.sf.jasperreports.chartthemes.provider.ImageProvider;
import net.sf.jasperreports.chartthemes.provider.PaintProvider;
import net.sf.jasperreports.engine.JRConstants;
import net.sf.jasperreports.engine.JRFont;
import net.sf.jasperreports.engine.base.JRBaseFont;
import net.sf.jasperreports.engine.design.events.JRChangeEventsSupport;
import net.sf.jasperreports.engine.design.events.JRPropertyChangeSupport;

/**
 * @author Teodor Danciu (teodord@users.sourceforge.net)
 * @version $Id: ChartSettings.java 7197 2014-08-27 11:59:50Z teodord $
 */
public class ChartSettings implements JRChangeEventsSupport, Serializable
{
	/**
	 *
	 */
	private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;

	public static final String PROPERTY_backgroundPaint = "backgroundPaint";
	public static final String PROPERTY_backgroundImage = "backgroundImage";
	public static final String PROPERTY_backgroundImageAlignment = "backgroundImageAlignment";
	public static final String PROPERTY_backgroundImageAlpha = "backgroundImageAlpha";
	public static final String PROPERTY_font = "font";
	public static final String PROPERTY_borderVisible = "borderVisible";
	public static final String PROPERTY_borderPaint = "borderPaint";
	public static final String PROPERTY_borderStroke = "borderStroke";
	public static final String PROPERTY_antiAlias = "antiAlias";
	public static final String PROPERTY_textAntiAlias = "textAntiAlias";
	public static final String PROPERTY_padding = "padding";

	/**
	 *
	 */
	private PaintProvider backgroundPaint;
	private ImageProvider backgroundImage;
	private Integer backgroundImageAlignment;
	private Float backgroundImageAlpha;
	private JRFont font = new JRBaseFont();
	private Boolean borderVisible;
	private PaintProvider borderPaint;
	private Stroke borderStroke;
	private Boolean antiAlias;
	private Boolean textAntiAlias;
	private RectangleInsets padding;

	/**
	 *
	 */
	public ChartSettings()
	{
	}

	/**
	 *
	 */
	public PaintProvider getBackgroundPaint()
	{
		return backgroundPaint;
	}

	/**
	 *
	 */
	public void setBackgroundPaint(PaintProvider backgroundPaint)
	{
		PaintProvider old = getBackgroundPaint();
		this.backgroundPaint = backgroundPaint;
		getEventSupport().firePropertyChange(PROPERTY_backgroundPaint, old, getBackgroundPaint());
	}

	/**
	 * @return the antiAlias
	 */
	public Boolean getAntiAlias() {
		return antiAlias;
	}

	/**
	 * @param antiAlias the antiAlias to set
	 */
	public void setAntiAlias(Boolean antiAlias) {
		Boolean old = getAntiAlias();
		this.antiAlias = antiAlias;
		getEventSupport().firePropertyChange(PROPERTY_antiAlias, old, getAntiAlias());
	}

	/**
	 * @return the borderVisible
	 */
	public Boolean getBorderVisible() {
		return borderVisible;
	}

	/**
	 * @param borderVisible the borderVisible to set
	 */
	public void setBorderVisible(Boolean borderVisible) {
		Boolean old = getBorderVisible();
		this.borderVisible = borderVisible;
		getEventSupport().firePropertyChange(PROPERTY_borderVisible, old, getBorderVisible());
	}

	private transient JRPropertyChangeSupport eventSupport;

	public JRPropertyChangeSupport getEventSupport()
	{
		synchronized (this)
		{
			if (eventSupport == null)
			{
				eventSupport = new JRPropertyChangeSupport(this);
			}
		}

		return eventSupport;
	}

	/**
	 * @return the font
	 */
	public JRFont getFont() {
		return font;
	}

	/**
	 * @param font the font to set
	 */
	public void setFont(JRFont font) {
		JRFont old = getFont();
		this.font = font;
		getEventSupport().firePropertyChange(PROPERTY_font, old, getFont());

//		titleSettings.setTitleFont(titleSettings.getTitleFont());
//		subtitleSettings.setTitleFont(subtitleSettings.getTitleFont());
//		setLegendFont(legendFont);
	}

	/**
	 * @return the padding
	 */
	public RectangleInsets getPadding() {
		return padding;
	}

	/**
	 * @param padding the padding to set
	 */
	public void setPadding(RectangleInsets padding) {
		RectangleInsets old = getPadding();
		this.padding = padding;
		getEventSupport().firePropertyChange(PROPERTY_padding, old, getPadding());
	}

	/**
	 * @return the textAntiAlias
	 */
	public Boolean getTextAntiAlias()
	{
		return textAntiAlias;
	}

	/**
	 * @param textAntiAlias the textAntiAlias to set
	 */
	public void setTextAntiAlias(Boolean textAntiAlias)
	{
		Boolean old = getTextAntiAlias();
		this.textAntiAlias = textAntiAlias;
		getEventSupport().firePropertyChange(PROPERTY_textAntiAlias, old, getTextAntiAlias());
	}

	/**
	 * @return the backgroundImageAlignment
	 */
	public Integer getBackgroundImageAlignment()
	{
		return backgroundImageAlignment;
	}

	/**
	 * @param backgroundImageAlignment the backgroundImageAlignment to set
	 */
	public void setBackgroundImageAlignment(Integer backgroundImageAlignment)
	{
		Integer old = getBackgroundImageAlignment();
		this.backgroundImageAlignment = backgroundImageAlignment;
		getEventSupport().firePropertyChange(PROPERTY_backgroundImageAlignment, old, getBackgroundImageAlignment());
	}

	/**
	 * @return the backgroundImageAlpha
	 */
	public Float getBackgroundImageAlpha()
	{
		return backgroundImageAlpha;
	}

	/**
	 * @param backgroundImageAlpha the backgroundImageAlpha to set
	 */
	public void setBackgroundImageAlpha(Float backgroundImageAlpha)
	{
		Float old = getBackgroundImageAlpha();
		this.backgroundImageAlpha = backgroundImageAlpha;
		getEventSupport().firePropertyChange(PROPERTY_backgroundImageAlpha, old, getBackgroundImageAlpha());
	}

	/**
	 * @return the borderPaint
	 */
	public PaintProvider getBorderPaint()
	{
		return borderPaint;
	}

	/**
	 * @param borderPaint the borderPaint to set
	 */
	public void setBorderPaint(PaintProvider borderPaint)
	{
		PaintProvider old = getBorderPaint();
		this.borderPaint = borderPaint;
		getEventSupport().firePropertyChange(PROPERTY_borderPaint, old, getBorderPaint());
	}

	/**
	 * @return the backgroundImage
	 */
	public ImageProvider getBackgroundImage() {
		return backgroundImage;
	}

	/**
	 * @param backgroundImage the backgroundImage to set
	 */
	public void setBackgroundImage(ImageProvider backgroundImage) {
		ImageProvider old = getBackgroundImage();
		this.backgroundImage = backgroundImage;
		getEventSupport().firePropertyChange(PROPERTY_backgroundImage, old, getBackgroundImage());
	}

	/**
	 * @return the borderStroke
	 */
	public Stroke getBorderStroke() {
		return borderStroke;
	}

	/**
	 * @param borderStroke the borderStroke to set
	 */
	public void setBorderStroke(Stroke borderStroke) {
		Stroke old = getBorderStroke();
		this.borderStroke = borderStroke;
		getEventSupport().firePropertyChange(PROPERTY_borderStroke, old, getBorderStroke());
	}

//	/**
//	 * @return the seriesColors
//	 */
//	public List getSeriesColors()
//	{
//		return seriesColors;
//	}
//
//	/**
//	 * @param seriesColors the seriesColors to set
//	 */
//	public void setSeriesColors(List seriesColors)
//	{
//		List old = getSeriesColors();
//		this.seriesColors = seriesColors;
//		getEventSupport().firePropertyChange(PROPERTY_seriesColors, old, getSeriesColors());
//	}

}