text:
var WeaponState	= Class.extend({
	cInfo : null,

	// Time *since* the weapon last fired, in milliseconds
	iLastFireTime : 0,

	iAmmoLeft : 0,

	init : function(cWeaponInfo) {
		this.setInfo(cWeaponInfo);

		this.iLastFireTime	= Number.POSITIVE_INFINITY;
	},

	setInfo : function(cWeaponInfo) {
		this.cInfo	= cWeaponInfo;
	},

	getInfo : function() {
		return this.cInfo;
	},

	setAmmoLeft : function(iRounds) {
		this.iAmmoLeft	= iRounds;
	},

	getAmmoLeft : function() {
		return this.iAmmoLeft;
	},

	/**
	 * Call this function whenever you want the weapon to fire
	 * If the weapon is ready and capable of firing it will update the necessary vars return true
	 * Otherwise will return false
	 */
	tryFire : function() {
		var bSuccess	= false;

		if (this._canFire())
		{
			bSuccess	= true;

			--this.iAmmoLeft;
			this.iLastFireTime	= 0;
		}

		return bSuccess;
	},

	update : function(iTime) {
		this.iLastFireTime	+= iTime;
	},

	_canFire : function() {
		return (this.iLastFireTime >= this.cInfo.getFireDelay() && this.iAmmoLeft > 0);
	}
});

redpajama_set_name: RedPajamaGithub


text:
import config

import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request

class GoogleCredentials:

    # Check https://developers.google.com/gmail/api/auth/scopes for all available scopes
    OAUTH_SCOPES = ['https://www.googleapis.com/auth/userinfo.email',
                   'https://www.googleapis.com/auth/gmail.insert',
                   'https://www.googleapis.com/auth/gmail.labels',
                   'https://www.googleapis.com/auth/contacts.readonly',
                   'openid']

    def authenticate(self):
        creds = None
        # The file token.pickle stores the user's access and refresh tokens, and is
        # created automatically when the authorization flow completes for the first
        # time.
        if os.path.exists(config.TOKEN_FILE):
            with open(config.TOKEN_FILE, 'rb') as token:
                creds = pickle.load(token)
        # If there are no (valid) credentials available, let the user log in.
        if not creds or not creds.valid:
            if creds and creds.expired and creds.refresh_token:
                creds.refresh(Request())
            else:
                flow = InstalledAppFlow.from_client_secrets_file(config.CLIENT_SECRET_FILE, GoogleCredentials.OAUTH_SCOPES)
                creds = flow.run_local_server(port=0)
            # Save the credentials for the next run
            with open(config.TOKEN_FILE, 'wb') as token:
                pickle.dump(creds, token)

        self.credentials = creds


text:
import requests
import logging

from django.shortcuts import redirect
from social_core.utils import handle_http_errors
from social_core.exceptions import AuthFailed
from social_core.backends.oauth import BaseOAuth2

class Auth0(BaseOAuth2):
    """Auth0 OAuth authentication backend"""
    name = 'auth0'
    SCOPE_SEPARATOR = ' '
    ACCESS_TOKEN_METHOD = 'POST'
    EXTRA_DATA = [
            ('picture', 'picture')
    ]

    @handle_http_errors
    def auth_complete(self, *args, **kwargs):
        """Completes login process, must return user instance"""
        try:
            self.process_error(self.data)
            state = self.validate_state()

            response = self.request_access_token(
                self.access_token_url(),
                data=self.auth_complete_params(state),
                headers=self.auth_headers(),
                auth=self.auth_complete_credentials(),
                method=self.ACCESS_TOKEN_METHOD
            )
            self.process_error(response)
        except AuthFailed:
            return redirect('http://producer-toolkit.eu/#/login')
        return self.do_auth(response['access_token'], response=response,
                            *args, **kwargs)

    # Silent authentication
    # Check if user if already logged in via SSO
    def auth_params(self, state=None):
        client_id, client_secret = self.get_key_and_secret()
        params = {
            'client_id': client_id,
            'redirect_uri': self.get_redirect_uri(state),
            'prompt': 'none'
        }
        if self.STATE_PARAMETER and state:
            params['state'] = state
        if self.RESPONSE_TYPE:
            params['response_type'] = self.RESPONSE_TYPE
        return params

    def authorization_url(self):
        """Return the authorization endpoint."""
        return "https://" + self.setting('DOMAIN') + "/authorize"

    def access_token_url(self):
        """Return the token endpoint"""
        return "https://" + self.setting('DOMAIN') + "/oauth/token"

    def get_user_id(self, details, response):
        """Return current user id."""
        return details['user_id']

    def get_user_details(self, response):
        url = 'https://' + self.setting('DOMAIN') + '/userinfo'
        headers = {'authorization': 'Bearer ' + response['access_token']}
        resp = requests.get(url, headers=headers)
        userinfo = resp.json()

        return {'username': userinfo['nickname'],
                'first_name': userinfo['name'],
                'picture': userinfo['picture'],
                'user_id': userinfo['sub']}


text:
package datamodeldiagram

import (
	"fmt"
	"regexp"
	"strings"

	"github.com/anz-bank/sysl/pkg/cmdutils"
	"github.com/anz-bank/sysl/pkg/sequencediagram"
	"github.com/anz-bank/sysl/pkg/sysl"
	"github.com/sirupsen/logrus"
)

func GenerateDataModelsWithProjectMannerModule(datagenParams *cmdutils.CmdContextParamDatagen,
	model *sysl.Module, logger *logrus.Logger) (map[string]string, error) {
	outmap := make(map[string]string)

	logger.Debugf("project: %v\n", datagenParams.Project)
	logger.Debugf("title: %s\n", datagenParams.Title)
	logger.Debugf("filter: %s\n", datagenParams.Filter)
	logger.Debugf("output: %s\n", datagenParams.Output)

	spclass := sequencediagram.ConstructFormatParser("", datagenParams.ClassFormat)

	// The "project" app that specifies the data models to be built
	var app *sysl.Application
	var exists bool
	if app, exists = model.GetApps()[datagenParams.Project]; !exists {
		return nil, fmt.Errorf("project not found in sysl")
	}

	// Iterate over each endpoint within the selected project
	for epname, endpt := range app.GetEndpoints() {
		outputDir := datagenParams.Output
		if strings.Contains(outputDir, "%(epname)") {
			of := cmdutils.MakeFormatParser(datagenParams.Output)
			outputDir = of.FmtOutput(datagenParams.Project, epname, endpt.GetLongName(), endpt.GetAttrs())
		}
		if datagenParams.Filter != "" {
			re := regexp.MustCompile(datagenParams.Filter)
			if !re.MatchString(outputDir) {
				continue
			}
		}
		// TODO: Fix the need to pass `epNameMode` into function
		epNameMode := strings.Contains(datagenParams.Output, "%(epname)")
		GenerateDataModel(spclass, outmap, model, endpt.GetStmt(), datagenParams.Title,
			datagenParams.Project, outputDir, epNameMode)
	}
	return outmap, nil
}

/**
 * It is added to help reviewing generated data model with sysl
 * file produced by command import. Generate data model diagrams using the following command:
 * sysl data      -d --root=/Users/guest/data -t Test -o Test.png Test
 * sysl datamodel -d --root=/Users/guest/data -t Test -o Test.png Test.sysl
 */
func GenerateDataModelsWithPureModule(datagenParams *cmdutils.CmdContextParamDatagen,
	model *sysl.Module, logger *logrus.Logger) (map[string]string, error) {
	outmap := make(map[string]string)

	logger.Debugf("title: %s\n", datagenParams.Title)
	logger.Debugf("output: %s\n", datagenParams.Output)

	spclass := sequencediagram.ConstructFormatParser("", datagenParams.ClassFormat)

	apps := model.GetApps()
	for appName := range apps {
		app := apps[appName]
		outputDir := datagenParams.Output
		if strings.Contains(outputDir, "%(epname)") {
			of := cmdutils.MakeFormatParser(datagenParams.Output)
			outputDir = of.FmtOutput(appName, appName, app.GetLongName(), app.GetAttrs())
		}
		var stringBuilder strings.Builder
		if app != nil {
			dataParam := &DataModelParam{
				Mod:    model,
				App:    app,
				Title:  datagenParams.Title,
				Epname: strings.Contains(datagenParams.Output, "%(epname)"),
			}
			v := MakeDataModelView(spclass, dataParam.Mod, &stringBuilder, dataParam.Title, "")
			outmap[outputDir] = v.GenerateDataView(dataParam)
		}
	}

	return outmap, nil
}

func GenerateDataModel(pclass cmdutils.ClassLabeler, outmap map[string]string, mod *sysl.Module,
	stmts []*sysl.Statement, title, project, outDir string, epName bool) {
	apps := mod.GetApps()

	// Parse all the applications in the project
	for _, stmt := range stmts {
		if a, ok := stmt.Stmt.(*sysl.Statement_Action); ok {
			var stringBuilder strings.Builder
			app := apps[a.Action.Action]
			if app != nil {
				dataParam := &DataModelParam{
					Mod:     mod,
					App:     app,
					Title:   title,
					Project: project,
					Epname:  epName,
				}
				v := MakeDataModelView(pclass, dataParam.Mod, &stringBuilder, dataParam.Title, dataParam.Project)
				outmap[outDir] = v.GenerateDataView(dataParam)
			}
		}
	}
}

func GenerateDataModels(datagenParams *cmdutils.CmdContextParamDatagen,
	model *sysl.Module, logger *logrus.Logger) (map[string]string, error) {
	if datagenParams.Direct {
		// The sysl file is not project manner
		return GenerateDataModelsWithPureModule(datagenParams, model, logger)
	}
	// Sysl file is project manner
	return GenerateDataModelsWithProjectMannerModule(datagenParams, model, logger)
}


text:
"""Implementation of Mobilenet V2.

Architecture: https://arxiv.org/abs/1801.04381

The base model gives 72.2% accuracy on ImageNet, with 300MMadds,
3.4 M parameters.
"""

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

import copy
import functools

import tensorflow as tf
from tensorflow.contrib import layers as contrib_layers
from tensorflow.contrib import slim as contrib_slim

from nets.mobilenet import conv_blocks as ops
from nets.mobilenet import mobilenet as lib

slim = contrib_slim
op = lib.op

expand_input = ops.expand_input_by_factor

# pyformat: disable
# Architecture: https://arxiv.org/abs/1801.04381
V2_DEF = dict(
    defaults={
        # Note: these parameters of batch norm affect the architecture
        # that's why they are here and not in training_scope.
        (slim.batch_norm,): {'center': True, 'scale': True},
        (slim.conv2d, slim.fully_connected, slim.separable_conv2d): {
            'normalizer_fn': slim.batch_norm, 'activation_fn': tf.nn.relu6
        },
        (ops.expanded_conv,): {
            'expansion_size': expand_input(6),
            'split_expansion': 1,
            'normalizer_fn': slim.batch_norm,
            'residual': True
        },
        (slim.conv2d, slim.separable_conv2d): {'padding': 'SAME'}
    },
    spec=[
        op(slim.conv2d, stride=2, num_outputs=32, kernel_size=[3, 3]),
        op(ops.expanded_conv,
           expansion_size=expand_input(1, divisible_by=1),
           num_outputs=16),
        op(ops.expanded_conv, stride=2, num_outputs=24),
        op(ops.expanded_conv, stride=1, num_outputs=24),
        op(ops.expanded_conv, stride=2, num_outputs=32),
        op(ops.expanded_conv, stride=1, num_outputs=32),
        op(ops.expanded_conv, stride=1, num_outputs=32),
        op(ops.expanded_conv, stride=2, num_outputs=64),
        op(ops.expanded_conv, stride=1, num_outputs=64),
        op(ops.expanded_conv, stride=1, num_outputs=64),
        op(ops.expanded_conv, stride=1, num_outputs=64),
        op(ops.expanded_conv, stride=1, num_outputs=96),
        op(ops.expanded_conv, stride=1, num_outputs=96),
        op(ops.expanded_conv, stride=1, num_outputs=96),
        op(ops.expanded_conv, stride=2, num_outputs=160),
        op(ops.expanded_conv, stride=1, num_outputs=160),
        op(ops.expanded_conv, stride=1, num_outputs=160),
        op(ops.expanded_conv, stride=1, num_outputs=320),
        op(slim.conv2d, stride=1, kernel_size=[1, 1], num_outputs=1280)
    ],
)
# pyformat: enable

# Mobilenet v2 Definition with group normalization.
V2_DEF_GROUP_NORM = copy.deepcopy(V2_DEF)
V2_DEF_GROUP_NORM['defaults'] = {
    (contrib_slim.conv2d, contrib_slim.fully_connected,
     contrib_slim.separable_conv2d): {
        'normalizer_fn': contrib_layers.group_norm,  # pylint: disable=C0330
        'activation_fn': tf.nn.relu6,  # pylint: disable=C0330
    },  # pylint: disable=C0330
    (ops.expanded_conv,): {
        'expansion_size': ops.expand_input_by_factor(6),
        'split_expansion': 1,
        'normalizer_fn': contrib_layers.group_norm,
        'residual': True
    },
    (contrib_slim.conv2d, contrib_slim.separable_conv2d): {
        'padding': 'SAME'
    }
}

@slim.add_arg_scope
def mobilenet(input_tensor,
              num_classes=1001,
              depth_multiplier=1.0,
              scope='MobilenetV2',
              conv_defs=None,
              finegrain_classification_mode=False,
              min_depth=None,
              divisible_by=None,
              activation_fn=None,
              **kwargs):
  """Creates mobilenet V2 network.

  Inference mode is created by default. To create training use training_scope
  below.

  with tf.contrib.slim.arg_scope(mobilenet_v2.training_scope()):
     logits, endpoints = mobilenet_v2.mobilenet(input_tensor)

  Args:
    input_tensor: The input tensor
    num_classes: number of classes
    depth_multiplier: The multiplier applied to scale number of
    channels in each layer.
    scope: Scope of the operator
    conv_defs: Allows to override default conv def.
    finegrain_classification_mode: When set to True, the model
    will keep the last layer large even for small multipliers. Following
    https://arxiv.org/abs/1801.04381
    suggests that it improves performance for ImageNet-type of problems.
      *Note* ignored if final_endpoint makes the builder exit earlier.
    min_depth: If provided, will ensure that all layers will have that
    many channels after application of depth multiplier.
    divisible_by: If provided will ensure that all layers # channels
    will be divisible by this number.
    activation_fn: Activation function to use, defaults to tf.nn.relu6 if not
      specified.
    **kwargs: passed directly to mobilenet.mobilenet:
      prediction_fn- what prediction function to use.
      reuse-: whether to reuse variables (if reuse set to true, scope
      must be given).
  Returns:
    logits/endpoints pair

  Raises:
    ValueError: On invalid arguments
  """
  if conv_defs is None:
    conv_defs = V2_DEF
  if 'multiplier' in kwargs:
    raise ValueError('mobilenetv2 doesn\'t support generic '
                     'multiplier parameter use "depth_multiplier" instead.')
  if finegrain_classification_mode:
    conv_defs = copy.deepcopy(conv_defs)
    if depth_multiplier < 1:
      conv_defs['spec'][-1].params['num_outputs'] /= depth_multiplier
  if activation_fn:
    conv_defs = copy.deepcopy(conv_defs)
    defaults = conv_defs['defaults']
    conv_defaults = (
        defaults[(slim.conv2d, slim.fully_connected, slim.separable_conv2d)])
    conv_defaults['activation_fn'] = activation_fn

  depth_args = {}
  # NB: do not set depth_args unless they are provided to avoid overriding
  # whatever default depth_multiplier might have thanks to arg_scope.
  if min_depth is not None:
    depth_args['min_depth'] = min_depth
  if divisible_by is not None:
    depth_args['divisible_by'] = divisible_by

  with slim.arg_scope((lib.depth_multiplier,), **depth_args):
    return lib.mobilenet(
        input_tensor,
        num_classes=num_classes,
        conv_defs=conv_defs,
        scope=scope,
        multiplier=depth_multiplier,
        **kwargs)

mobilenet.default_image_size = 224

def wrapped_partial(func, *args, **kwargs):
  partial_func = functools.partial(func, *args, **kwargs)
  functools.update_wrapper(partial_func, func)
  return partial_func

# Wrappers for mobilenet v2 with depth-multipliers. Be noticed that
# 'finegrain_classification_mode' is set to True, which means the embedding
# layer will not be shrinked when given a depth-multiplier < 1.0.
mobilenet_v2_140 = wrapped_partial(mobilenet, depth_multiplier=1.4)
mobilenet_v2_050 = wrapped_partial(mobilenet, depth_multiplier=0.50,
                                   finegrain_classification_mode=True)
mobilenet_v2_035 = wrapped_partial(mobilenet, depth_multiplier=0.35,
                                   finegrain_classification_mode=True)

@slim.add_arg_scope
def mobilenet_base(input_tensor, depth_multiplier=1.0, **kwargs):
  """Creates base of the mobilenet (no pooling and no logits) ."""
  return mobilenet(input_tensor,
                   depth_multiplier=depth_multiplier,
                   base_only=True, **kwargs)

@slim.add_arg_scope
def mobilenet_base_group_norm(input_tensor, depth_multiplier=1.0, **kwargs):
  """Creates base of the mobilenet (no pooling and no logits) ."""
  kwargs['conv_defs'] = V2_DEF_GROUP_NORM
  kwargs['conv_defs']['defaults'].update({
      (contrib_layers.group_norm,): {
          'groups': kwargs.pop('groups', 8)
      }
  })
  return mobilenet(
      input_tensor, depth_multiplier=depth_multiplier, base_only=True, **kwargs)

def training_scope(**kwargs):
  """Defines MobilenetV2 training scope.

  Usage:
     with tf.contrib.slim.arg_scope(mobilenet_v2.training_scope()):
       logits, endpoints = mobilenet_v2.mobilenet(input_tensor)

  with slim.

  Args:
    **kwargs: Passed to mobilenet.training_scope. The following parameters
    are supported:
      weight_decay- The weight decay to use for regularizing the model.
      stddev-  Standard deviation for initialization, if negative uses xavier.
      dropout_keep_prob- dropout keep probability
      bn_decay- decay for the batch norm moving averages.

  Returns:
    An `arg_scope` to use for the mobilenet v2 model.
  """
  return lib.training_scope(**kwargs)

__all__ = ['training_scope', 'mobilenet_base', 'mobilenet', 'V2_DEF']


text:
Página no encontrada

  Error: Página no encontrada


text:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
	<persistence-unit name="sample" transaction-type="JTA">
		<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
		<jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=datasource/ClassicModels)</jta-data-source>
		<class>net.martenscs.osgi.example.domain.CustomerEntity</class>
		<class>net.martenscs.osgi.example.domain.EmployeeEntity</class>
		<class>net.martenscs.osgi.example.domain.OfficeEntity</class>
		<class>net.martenscs.osgi.example.domain.OrderdetailEntity</class>
		<class>net.martenscs.osgi.example.domain.OrderdetailPK</class>
		<class>net.martenscs.osgi.example.domain.OrderEntity</class>
		<class>net.martenscs.osgi.example.domain.PaymentEntity</class>
		<class>net.martenscs.osgi.example.domain.PaymentPK</class>
		<class>net.martenscs.osgi.example.domain.ProductEntity</class>
		<exclude-unlisted-classes>true</exclude-unlisted-classes>
		<properties>
			<!--<property name="openjpa.RuntimeUnenhancedClasses" value="supported"/> -->
			<property name="openjpa.Log" value="DefaultLevel=INFO, Tool=INFO" />
			<!--<property name="openjpa.jdbc.DBDictionary" value="postgres"/> -->
			<property name="openjpa.jdbc.DBDictionary" value="derby" />

		</properties>
	</persistence-unit>
</persistence>


text:
<?php

namespace ExtendsFramework\Sourcing\Message;

use ExtendsFramework\Common\Container\Container;
use ExtendsFramework\Message\Payload\Payload;

class GenericDomainEventMessageTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @covers \ExtendsFramework\Sourcing\Message\GenericDomainEventMessage::__construct()
     * @covers \ExtendsFramework\Sourcing\Message\GenericDomainEventMessage::aggregateId()
     * @covers \ExtendsFramework\Sourcing\Message\GenericDomainEventMessage::sequence()
     * @covers \ExtendsFramework\Sourcing\Message\GenericDomainEventMessage::forPayload()
     */
    public function testCanCreateForPayload()
    {
        $payload = $this->createMock(Payload::class);

        /**
         * @var Payload $payload
         */
        $message = GenericDomainEventMessage::forPayload('1', 1, $payload);

        $this->assertInstanceOf(GenericDomainEventMessage::class, $message);
        $this->assertSame('1', $message->aggregateId());
        $this->assertSame(1, $message->sequence());
        $this->assertSame($payload, $message->payload());
        $this->assertInstanceOf(Container::class, $message->metaData());
    }

    /**
     * @covers \ExtendsFramework\Sourcing\Message\GenericDomainEventMessage::__construct()
     * @covers \ExtendsFramework\Sourcing\Message\GenericDomainEventMessage::aggregateId()
     * @covers \ExtendsFramework\Sourcing\Message\GenericDomainEventMessage::sequence()
     * @covers \ExtendsFramework\Sourcing\Message\GenericDomainEventMessage::forPayloadAndMetaData()
     */
    public function testCanCreateForPayloadAndMetaData()
    {
        $payload = $this->createMock(Payload::class);
        $metaData = $this->createMock(Container::class);

        /**
         * @var Payload   $payload
         * @var Container $metaData
         */
        $message = GenericDomainEventMessage::forPayloadAndMetaData('1', 1, $payload, $metaData);

        $this->assertInstanceOf(GenericDomainEventMessage::class, $message);
        $this->assertSame('1', $message->aggregateId());
        $this->assertSame(1, $message->sequence());
        $this->assertSame($payload, $message->payload());
        $this->assertSame($metaData, $message->metaData());
    }
}


text:
source ../assert.sh
assert_errors "$1" check . --all --no-flowlib --show-all-errors --include-warnings --color=always


text:
package me.dablakbandit.customentitiesapi.entities;

public class CustomEntityGhastHelper extends CustomEntityFlyingHelper {

	public static void setUnableToMove(Object ghast) {
		removeGoalSelectorPathfinderGoalAll(ghast);
	}

	public static void setAbleToMove(Object ghast) {
		// TODO
	}

	public static void setAbleToMove(Object ghast, double d) {
		// TODO
	}

	public static void setGoalSelectorDefaultPathfinderGoals(Object ghast) {
		// TODO
	}
}


text:
package com.hn.view;

import javax.swing.BorderFactory;
import javax.swing.JLabel;

/**
 * 下载器的下部
 * @author Administrator
 *
 */
public class DownloaderFoot extends JLabel {

	private static final long serialVersionUID = 1L;

	/**
	 * 构造器
	 */
	public DownloaderFoot(){
		super("Thank you for your use!");
		init();
	}

	/**
	 * 初始化
	 */
	private void init(){

		this.setBorder(BorderFactory.createEtchedBorder(1));// 创建一个具有"浮雕化"外观效果的边框,将组件的当前背景色用于突出显示和阴影显示

	}
}


text:
@implementation ALPHAActionItem

#pragma mark - Static Methods

+ (instancetype)itemWithIdentifier:(NSString *)identifier
{
    return [[[self class] alloc] initWithIdentifier:identifier title:nil detail:nil style:UITableViewCellStyleDefault];
}

#pragma mark - Initializers

- (instancetype)initWithRequest:(ALPHARequest *)request
{
    self = [super init];

    if (self)
    {
        self.request = request;
        self.enabled = YES;
        self.imageContentMode = UIViewContentModeCenter;
    }

    return self;
}

- (instancetype)initWithIdentifier:(NSString *)identifier
{
    return [self initWithIdentifier:identifier title:nil detail:nil];
}

- (instancetype)initWithIdentifier:(NSString *)identifier style:(UITableViewCellStyle)style;
{
    return [self initWithIdentifier:identifier title:nil detail:nil style:style];
}

- (instancetype)initWithIdentifier:(NSString *)identifier title:(NSString *)title detail:(NSString *)detail
{
    return [self initWithIdentifier:identifier title:title detail:detail style:UITableViewCellStyleValue1];
}

- (instancetype)initWithIdentifier:(NSString *)identifier title:(NSString *)title detail:(NSString *)detail style:(UITableViewCellStyle)style
{
    ALPHARequest* request = [ALPHARequest requestWithIdentifier:identifier];

    ALPHAActionItem *object = [self initWithRequest:request];

    if (object)
    {
        object.title = title;
        object.detail = detail;
        object.style = style;
    }

    return object;
}

@end


text:
struct shipShield {
	struct shipItem super;
	int currentStrength;
};

#endif


text:
/*
	A ZAP standalone script for testing Automation Framework (AF) context support.
	The script loops through a set of context files and for each:
		* Loads the context file
		* Create an automation plan based on it
		* Deletes the context
		* Runs the plan (which creates the context again)
		* Exports the context as a file
		* Deletes the context

	An external script can then diff the files to make sure the AF has (re)generated then correctly.
*/
// Default directories - can be changed for local testing
var base = '/zap/wrk/configs/plans/contexts'
var results = '/zap/wrk/output/'

var AutomationPlan = Java.type("org.zaproxy.addon.automation.AutomationPlan");
var ExtFile = Java.type("java.io.File");
var File = Java.type("java.io.File");

var dir = new File(base);
var files = dir.listFiles();

for (var i in files) {
	try {
		// Output the full file name for info
		print("Loading: " + files[i].getAbsolutePath());

		// Import the context file
		var context = model.getSession().importContext(files[i])
		var contextName = context.getName();

		// Create the plan
		var plan = new AutomationPlan();
		plan.getEnv().addContext(context);

		// Register then plan
		var extAuto = control.getExtensionLoader().getExtension("ExtensionAutomation");
		extAuto.registerPlan(plan);

		// Delete the existing context
		model.getSession().deleteContext(context)

		// Run the plan, which should recreate the context
		var progress = extAuto.runPlan(plan, true);
		if (progress.hasErrors()) {
			print(progress.getErrors());
		}
		if (progress.hasWarnings()) {
			print(progress.getWarnings());
		}

		// Export the context - must have the same name as the file
		context = model.getSession().getContext(contextName);
		var outFile = new File(results + contextName);
		print("Generating: " + outFile.getAbsolutePath());
		model.getSession().exportContext(context, outFile);

		// Tidy up
		model.getSession().deleteContext(context);
	}
	catch (err) {
		print("FAILED processing: " + files[i].getAbsolutePath());
		err.printStackTrace();
	}
}


text:
std::vector<std::string> Module::initialize_options (const std::vector<std::string>& opts)
{
    boost::program_options::parsed_options
        result = boost::program_options::basic_command_line_parser<char>(opts)
                    .options(options)
                    .allow_unregistered()
                    .run();
    boost::program_options::store  (result, parameters);
    boost::program_options::notify (parameters);
    return  boost::program_options::collect_unrecognized(
                result.options,
                boost::program_options::include_positional);
}


text:
package main

import (
	"go/ast"
	"path"
	"strconv"
	"strings"
)

const (
	ctxPackage = "golang.org/x/net/context"

	newPackageBase = "google.golang.org/"
	stutterPackage = false
)

func init() {
	register(fix{
		"ae",
		"2016-04-15",
		aeFn,
		`Update old App Engine APIs to new App Engine APIs`,
	})
}

// logMethod is the set of methods on appengine.Context used for logging.
var logMethod = map[string]bool{
	"Debugf":    true,
	"Infof":     true,
	"Warningf":  true,
	"Errorf":    true,
	"Criticalf": true,
}

// mapPackage turns "appengine" into "google.golang.org/appengine", etc.
func mapPackage(s string) string {
	if stutterPackage {
		s += "/" + path.Base(s)
	}
	return newPackageBase + s
}

func aeFn(f *ast.File) bool {
	// During the walk, we track the last thing seen that looks like
	// an appengine.Context, and reset it once the walk leaves a func.
	var lastContext *ast.Ident

	fixed := false

	// Update imports.
	mainImp := "appengine"
	for _, imp := range f.Imports {
		pth, _ := strconv.Unquote(imp.Path.Value)
		if pth == "appengine" || strings.HasPrefix(pth, "appengine/") {
			newPth := mapPackage(pth)
			imp.Path.Value = strconv.Quote(newPth)
			fixed = true

			if pth == "appengine" {
				mainImp = newPth
			}
		}
	}

	// Update any API changes.
	walk(f, func(n interface{}) {
		if ft, ok := n.(*ast.FuncType); ok && ft.Params != nil {
			// See if this func has an `appengine.Context arg`.
			// If so, remember its identifier.
			for _, param := range ft.Params.List {
				if !isPkgDot(param.Type, "appengine", "Context") {
					continue
				}
				if len(param.Names) == 1 {
					lastContext = param.Names[0]
					break
				}
			}
			return
		}

		if as, ok := n.(*ast.AssignStmt); ok {
			if len(as.Lhs) == 1 && len(as.Rhs) == 1 {
				// If this node is an assignment from an appengine.NewContext invocation,
				// remember the identifier on the LHS.
				if isCall(as.Rhs[0], "appengine", "NewContext") {
					if ident, ok := as.Lhs[0].(*ast.Ident); ok {
						lastContext = ident
						return
					}
				}
				// x (=|:=) appengine.Timeout(y, z)
				//   should become
				// x, _ (=|:=) context.WithTimeout(y, z)
				if isCall(as.Rhs[0], "appengine", "Timeout") {
					addImport(f, ctxPackage)
					as.Lhs = append(as.Lhs, ast.NewIdent("_"))
					// isCall already did the type checking.
					sel := as.Rhs[0].(*ast.CallExpr).Fun.(*ast.SelectorExpr)
					sel.X = ast.NewIdent("context")
					sel.Sel = ast.NewIdent("WithTimeout")
					fixed = true
					return
				}
			}
			return
		}

		// If this node is a FuncDecl, we've finished the function, so reset lastContext.
		if _, ok := n.(*ast.FuncDecl); ok {
			lastContext = nil
			return
		}

		if call, ok := n.(*ast.CallExpr); ok {
			if isPkgDot(call.Fun, "appengine", "Datacenter") && len(call.Args) == 0 {
				insertContext(f, call, lastContext)
				fixed = true
				return
			}
			if isPkgDot(call.Fun, "taskqueue", "QueueStats") && len(call.Args) == 3 {
				call.Args = call.Args[:2] // drop last arg
				fixed = true
				return
			}

			sel, ok := call.Fun.(*ast.SelectorExpr)
			if !ok {
				return
			}
			if lastContext != nil && refersTo(sel.X, lastContext) && logMethod[sel.Sel.Name] {
				// c.Errorf(...)
				//   should become
				// log.Errorf(c, ...)
				addImport(f, mapPackage("appengine/log"))
				sel.X = &ast.Ident{ // ast.NewIdent doesn't preserve the position.
					NamePos: sel.X.Pos(),
					Name:    "log",
				}
				insertContext(f, call, lastContext)
				fixed = true
				return
			}
		}
	})

	// Change any `appengine.Context` to `context.Context`.
	// Do this in a separate walk because the previous walk
	// wants to identify "appengine.Context".
	walk(f, func(n interface{}) {
		expr, ok := n.(ast.Expr)
		if ok && isPkgDot(expr, "appengine", "Context") {
			addImport(f, ctxPackage)
			// isPkgDot did the type checking.
			n.(*ast.SelectorExpr).X.(*ast.Ident).Name = "context"
			fixed = true
			return
		}
	})

	// The changes above might remove the need to import "appengine".
	// Check if it's used, and drop it if it isn't.
	if fixed && !usesImport(f, mainImp) {
		deleteImport(f, mainImp)
	}

	return fixed
}

// ctx may be nil.
func insertContext(f *ast.File, call *ast.CallExpr, ctx *ast.Ident) {
	if ctx == nil {
		// context is unknown, so use a plain "ctx".
		ctx = ast.NewIdent("ctx")
	} else {
		// Create a fresh *ast.Ident so we drop the position information.
		ctx = ast.NewIdent(ctx.Name)
	}

	call.Args = append([]ast.Expr{ctx}, call.Args...)
}


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

<title>Uses of Class org.apache.river.norm.LeaseExpirationMgr.MgrTask (River-Internet vtrunk API Documentation (internals))</title>
<meta name="date" content="2016-03-28">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.river.norm.LeaseExpirationMgr.MgrTask

Packages that use LeaseExpirationMgr.MgrTask

Package
Description

org.apache.river.norm

Provides implementations of LeaseRenewalService.

Uses of LeaseExpirationMgr.MgrTask in org.apache.river.norm

Subclasses of LeaseExpirationMgr.MgrTask in org.apache.river.norm

Modifier and Type
Class and Description

private class
LeaseExpirationMgr.QueueExpiration

Task that queues a task to expire a lease set.

private class
LeaseExpirationMgr.SendWarning

Objects that do the schedule the warning events, also schedules
 an expiration task.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.


text:
<?php

require __DIR__ . '/vendor/autoload.php';

$generator = new \Password\Generator;
$generator->setMinLength(8);
$generator->setNumberOfUpperCaseLetters(2);
$generator->setNumberOfNumbers(2);
$generator->setNumberOfSymbols(1);

$password = $generator->generate();
echo 'password: ' . $password . PHP_EOL;

$validator = new \Password\Validator(new \Password\StringHelper);
$validator->setMinLength(5);
$validator->setMinLowerCaseLetters(2);
$validator->setMinUpperCaseLetters(1);
$validator->setMinNumbers(1);
$validator->setMinSymbols(3);

if ($validator->isValid($password)) {
    printf('password %s is valid' . PHP_EOL, $password);
} else {
    printf('password %s is invalid' . PHP_EOL, $password);
    var_dump($validator->getErrors());
}


text:
import json
import os

from aliyunsdkcore import client
from aliyunsdksts.request.v20150401 import AssumeRoleRequest

import oss2

# 以下代码展示了STS的用法,包括角色扮演获取临时用户的密钥、使用临时用户的密钥访问OSS。

# STS入门教程请参看  https://yq.aliyun.com/articles/57895
# STS的官方文档请参看  https://help.aliyun.com/document_detail/28627.html

# 首先初始化AccessKeyId、AccessKeySecret、Endpoint等信息。
# 通过环境变量获取,或者把诸如"<你的AccessKeyId>"替换成真实的AccessKeyId等。
# 注意:AccessKeyId、AccessKeySecret为子用户的密钥。
# RoleArn可以在控制台的"访问控制  > 角色管理  > 管理  > 基本信息  > Arn"上查看。
#
# 以杭州区域为例,Endpoint可以是:
#   http://oss-cn-hangzhou.aliyuncs.com
#   https://oss-cn-hangzhou.aliyuncs.com
# 分别以HTTP、HTTPS协议访问。
access_key_id = os.getenv('OSS_TEST_STS_ID', '<你的AccessKeyId>')
access_key_secret = os.getenv('OSS_TEST_STS_KEY', '<你的AccessKeySecret>')
bucket_name = os.getenv('OSS_TEST_BUCKET', '<你的Bucket>')
endpoint = os.getenv('OSS_TEST_ENDPOINT', '<你的访问域名>')
sts_role_arn = os.getenv('OSS_TEST_STS_ARN', '<你的Role Arn>')

# 确认上面的参数都填写正确了
for param in (access_key_id, access_key_secret, bucket_name, endpoint, sts_role_arn):
    assert '<' not in param, '请设置参数:' + param

class StsToken(object):
    """AssumeRole返回的临时用户密钥
    :param str access_key_id: 临时用户的access key id
    :param str access_key_secret: 临时用户的access key secret
    :param int expiration: 过期时间,UNIX时间,自1970年1月1日UTC零点的秒数
    :param str security_token: 临时用户Token
    :param str request_id: 请求ID
    """
    def __init__(self):
        self.access_key_id = ''
        self.access_key_secret = ''
        self.expiration = 0
        self.security_token = ''
        self.request_id = ''

def fetch_sts_token(access_key_id, access_key_secret, role_arn):
    """子用户角色扮演获取临时用户的密钥
    :param access_key_id: 子用户的 access key id
    :param access_key_secret: 子用户的 access key secret
    :param role_arn: STS角色的Arn
    :return StsToken: 临时用户密钥
    """
    clt = client.AcsClient(access_key_id, access_key_secret, 'cn-hangzhou')
    req = AssumeRoleRequest.AssumeRoleRequest()

    req.set_accept_format('json')
    req.set_RoleArn(role_arn)
    req.set_RoleSessionName('oss-python-sdk-example')

    body = clt.do_action_with_exception(req)

    j = json.loads(oss2.to_unicode(body))

    token = StsToken()

    token.access_key_id = j['Credentials']['AccessKeyId']
    token.access_key_secret = j['Credentials']['AccessKeySecret']
    token.security_token = j['Credentials']['SecurityToken']
    token.request_id = j['RequestId']
    token.expiration = oss2.utils.to_unixtime(j['Credentials']['Expiration'], '%Y-%m-%dT%H:%M:%SZ')

    return token

# 创建Bucket对象,所有Object相关的接口都可以通过Bucket对象来进行
token = fetch_sts_token(access_key_id, access_key_secret, sts_role_arn)
auth = oss2.StsAuth(token.access_key_id, token.access_key_secret, token.security_token)
bucket = oss2.Bucket(auth, endpoint, bucket_name)

# 上传一段字符串。Object名是motto.txt,内容是一段名言。
bucket.put_object('motto.txt', 'Never give up. - Jack Ma')

# 下载到本地文件
bucket.get_object_to_file('motto.txt', '本地座右铭.txt')

# 删除名为motto.txt的Object
bucket.delete_object('motto.txt')

# 清除本地文件
os.remove(u'本地座右铭.txt')


text:
namespace weblayer {

WebLayerBluetoothDelegateImplClient::WebLayerBluetoothDelegateImplClient() =
    default;

WebLayerBluetoothDelegateImplClient::~WebLayerBluetoothDelegateImplClient() =
    default;

permissions::BluetoothChooserContext*
WebLayerBluetoothDelegateImplClient::GetBluetoothChooserContext(
    content::RenderFrameHost* frame) {
  return WebLayerBluetoothChooserContextFactory::GetForBrowserContext(
      frame->GetBrowserContext());
}

std::unique_ptr<content::BluetoothChooser>
WebLayerBluetoothDelegateImplClient::RunBluetoothChooser(
    content::RenderFrameHost* frame,
    const content::BluetoothChooser::EventHandler& event_handler) {
#if BUILDFLAG(IS_ANDROID)
  // TODO(https://crbug.com/1231932): Return nullptr if suppressed in vr.
  return std::make_unique<permissions::BluetoothChooserAndroid>(
      frame, event_handler,
      std::make_unique<WebLayerBluetoothChooserAndroidDelegate>());
#else
  // Web Bluetooth is not supported for desktop in WebLayer.
  return nullptr;
#endif
}

std::unique_ptr<content::BluetoothScanningPrompt>
WebLayerBluetoothDelegateImplClient::ShowBluetoothScanningPrompt(
    content::RenderFrameHost* frame,
    const content::BluetoothScanningPrompt::EventHandler& event_handler) {
#if BUILDFLAG(IS_ANDROID)
  return std::make_unique<permissions::BluetoothScanningPromptAndroid>(
      frame, event_handler,
      std::make_unique<WebLayerBluetoothScanningPromptAndroidDelegate>());
#else
  // Web Bluetooth is not supported for desktop in WebLayer.
  return nullptr;
#endif
}

void WebLayerBluetoothDelegateImplClient::ShowBluetoothDevicePairDialog(
    content::RenderFrameHost* frame,
    const std::u16string& device_identifier,
    content::BluetoothDelegate::PairPromptCallback callback,
    content::BluetoothDelegate::PairingKind,
    const absl::optional<std::u16string>& pin) {
  // Web Bluetooth is not supported for desktop in WebLayer and Android already
  // bonds on demand, so this should not be called on any platform.
  std::move(callback).Run(content::BluetoothDelegate::PairPromptResult(
      content::BluetoothDelegate::PairPromptStatus::kCancelled));
  NOTREACHED();
}
}  // namespace weblayer


text:
<!DOCTYPE html>

    <link rel ="stylesheet" href ="stylesheets/dbc_blog.css" type ="text/css">
    <title>My Favorite Websites</title>

Blog

My Favorite Websites

Google

          Google is a website that sparks simplicity. It is very precise when it comes to results and also impressive when it comes to suggestions as one types the topic or word in the search box. Aesthetically, I find it very elegant. I always look forward to the google doodles and the interactive animation clips depicting specific important dates or personalities. I also love how it keeps finding ways to tweak very obvious challenges, for example when you are specifically searching for images and you click on a specific image, the image will enlarge, give you an option to take you to the website of the specific image and also show you a set of other similar images. It is easy to use and very straightforward.

Amazon

          Amazon is an e-commerce website that carries out complex tasks while maintaining a very humble and elegant look. The navigation of the website is easy and the general display of all the various elements on the homepage is wonderfully structured. It also tailors the content of the website using the users' preferences or past purchases. Every time you search an item or a product you will also find a related product suggestion. Amazon has a two-fold purpose which it fulfills quite well. They are:

              The user is able to quickly find and purchase products.

              The seller is able to quickly process online purchases and make a profit.

Codecademy

          Codecademy is a website that gives online tutorials to programming beginners. It is aesthetically very modern and upbeat. It is extremely simple to use. It carries out a step by step process of teaching basics with the help of online code compiling. The website aims at helping the user as much as possible. It goes hand in hand with the interface and gives the feel of academic focus. The navigation of the website is quite practical. I personally feel very inspired after using Codecademy.


text:
package org.sparkcommerce.common.security;

import org.sparkcommerce.common.security.util.CookieUtils;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices;

import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Locale;

/**
 * This class adds additional features to the token based remember me services provided by
 * Spring security. Specifically, we would like to be able to include the httpOnly parameter
 * to cookie values that are generated by Spark Commerce. Since the default implementation
 * provided by Spring Security does not provide this additional functionality, we override
 * here to use the CookieUtils in Spark that will include the httpOnly value.
 *
 * Note - this class does not add httpOnly protection for session cookies. Adding httpOnly
 * for session cookies is handled at the application container configuration level, if supported.
 *
 * @author jdasari
 *
 */
public class EnhancedTokenBasedRememberMeServices extends TokenBasedRememberMeServices {

    @Resource(name="blCookieUtils")
    protected CookieUtils cookieUtils;

    @Deprecated
    public EnhancedTokenBasedRememberMeServices() {}

    public EnhancedTokenBasedRememberMeServices(String key, UserDetailsService userDetailsService) {
        super(key, userDetailsService);
    }

    @Override
    protected void setCookie(String[] tokens, int maxAge, HttpServletRequest request, HttpServletResponse response) {
        MockResponse mockResponse = new MockResponse();
        super.setCookie(tokens, maxAge, request, mockResponse);
        Cookie myCookie = mockResponse.getTempCookie();
        cookieUtils.setCookieValue(response, myCookie.getName(), myCookie.getValue(), myCookie.getPath(), myCookie.getMaxAge(), myCookie.getSecure());
    }

    private class MockResponse implements HttpServletResponse {

        private Cookie tempCookie;

        public void addCookie(Cookie arg0) {
            this.tempCookie = arg0;
        }

        public Cookie getTempCookie() {
            return tempCookie;
        }

        public void addDateHeader(String arg0, long arg1) {
            //do nothing
        }

        public void addHeader(String arg0, String arg1) {
            //do nothing
        }

        public void addIntHeader(String arg0, int arg1) {
            //do nothing
        }

        public boolean containsHeader(String arg0) {
            return false;
        }

        public String encodeRedirectUrl(String arg0) {
            return null;
        }

        public String encodeRedirectURL(String arg0) {
            return null;
        }

        public String encodeUrl(String arg0) {
            return null;
        }

        public String encodeURL(String arg0) {
            return null;
        }

        public void sendError(int arg0, String arg1) throws IOException {
            //do nothing
        }

        public void sendError(int arg0) throws IOException {
            //do nothing
        }

        public void sendRedirect(String arg0) throws IOException {
            //do nothing
        }

        public void setDateHeader(String arg0, long arg1) {
            //do nothing
        }

        public void setHeader(String arg0, String arg1) {
            //do nothing
        }

        public void setIntHeader(String arg0, int arg1) {
            //do nothing
        }

        public void setStatus(int arg0, String arg1) {
            //do nothing
        }

        public void setStatus(int arg0) {
            //do nothing
        }

        public void flushBuffer() throws IOException {
            //do nothing
        }

        public int getBufferSize() {
            return 0;
        }

        public String getCharacterEncoding() {
            return null;
        }

        public String getContentType() {
            return null;
        }

        public Locale getLocale() {
            return null;
        }

        public ServletOutputStream getOutputStream() throws IOException {
            return null;
        }

        public PrintWriter getWriter() throws IOException {
            return null;
        }

        public boolean isCommitted() {
            return false;
        }

        public void reset() {
            //do nothing
        }

        public void resetBuffer() {
            //do nothing
        }

        public void setBufferSize(int arg0) {
            //do nothing
        }

        public void setCharacterEncoding(String arg0) {
            //do nothing
        }

        public void setContentLength(int arg0) {
            //do nothing
        }

        public void setContentType(String arg0) {
            //do nothing
        }

        public void setLocale(Locale arg0) {
            //do nothing
        }

    }
}


text:
extern crate cgmath;

use {Mat4, Vec3, Vec4};
use cgmath::*;
use geometry;
use dimensions::Dimensions;

use cgmath::SquareMatrix;

#[derive(PartialEq, Debug, Copy, Clone)]
pub struct Camera {
    pub at: Vec3,
    pub pitch: Rad<f64>,
    pub viewport: Dimensions,
    pub points_per_unit: f64,
}

impl Camera {
    // UI
    pub fn ui_projection(&self) -> Mat4 {
        let (points_wide, points_high) = self.viewport.points;
        ui_projection(points_wide as f64, points_high as f64)
    }

    pub fn ui_inverse_projection(&self) -> Option<Mat4> {
        self.ui_projection().invert()
    }

    // THE WORLD
    pub fn view(&self) -> Mat4 {
        view(self.pitch, self.at)
    }

    pub fn projection(&self) -> Mat4 {
        let (points_wide, points_high) = self.viewport.points;
        projection(points_wide as f64, points_high as f64, self.points_per_unit)
    }

    pub fn units_per_point(&self) -> f64 {
        1.0 / self.points_per_unit
    }

    pub fn view_projection(&self) -> Mat4 {
        self.projection() * self.view()
    }

    pub fn inverse_view_projection(&self) -> Option<Mat4> {
        self.view_projection().invert()
    }

    pub fn world_line_segment_for_mouse_position(&self, x:i32, y:i32) -> Option<geometry::LineSegment> {
        let (width, height) = self.viewport.pixels;
        self.inverse_view_projection().and_then(|ivp| {
            ray_for_mouse_position(ivp, width, height, x, y)
        })
    }

    pub fn ui_line_segment_for_mouse_position(&self, x:i32, y:i32) -> Option<(f64, f64)> {
        let (pixels_wide, pixels_high) = self.viewport.pixels;
        if x > 0 && y > 0 && x < pixels_wide as i32 && y < pixels_high as i32 {
            let point_x = x as f64 / self.viewport.scale();
            let point_y = (pixels_high as i32 - y) as f64 / self.viewport.scale();
            Some((point_x, point_y))
        } else {
            None
        }
    }
}

pub fn view(pitch: Rad<f64>, at: Vec3) -> Mat4 {
    Mat4::from_angle_x(pitch) * Mat4::from_translation(at * -1.0)
}

pub fn ui_projection(width: f64, height: f64) -> Mat4 {
    // left, right, bottom, top, near, far
    cgmath::ortho(0.0, width, 0.0, height, -100.0, 100.0) // having trouble with this z stuff
}

pub fn projection(width:f64, height:f64, pixels_per_unit: f64) -> Mat4 {
    let effective_width = width  / pixels_per_unit;
    let effective_height = height / pixels_per_unit / (2.0_f64).sqrt(); // adjust for 45 degree downward viewing angle
    let half_width = effective_width / 2.0;
    let half_height = effective_height / 2.0;

    cgmath::ortho(-half_width, half_width, -half_height, half_height, -100.0, 100.0)
}

pub fn ray_for_mouse_position(inverse_view_projection:Mat4, width:u32, height:u32, x:i32, y:i32) -> Option<geometry::LineSegment> {
    if 0 <= x && x < (width as i32) && 0 <= y && y < (height as i32) {
        let n_x = (x as f64) / (width as f64) * 2.0 - 1.0;
        let n_y = ((y as f64) / (height as f64) * 2.0 - 1.0) * -1.0;

        let front = Vec4::new(n_x, n_y, -1.0, 1.0);
        let back = Vec4::new(n_x, n_y, 1.0, 1.0);

        let front_world = inverse_view_projection * front;
        let back_world = inverse_view_projection * back;

        Some(geometry::LineSegment {
            from: front_world.truncate() / front_world.w,
            to: back_world.truncate() / back_world.w,
        })
    } else {
        None
    }
}


text:
from django.conf.urls import url

from leaderboard import views

urlpatterns = [
    url(r'^$', views.leaderboard_overview, name='leaderboard_overview'),
    url(r'^(?P<category>(a|A)lltime|None|[0-9]{4})/$', views.category_overview, name='category_overview'),
    url(r'^(?P<category>(a|A)lltime|None|[0-9]{4})/(?P<lb_id>.*)/$', views.leaderboard, name='leaderboard_spec'),
]


text:
<link rel="stylesheet" type="text/css" href="<?php echo base_url() . 'content/bnw/styles/imgareaselect-animated.css'; ?>" />

    <?php
    if ($query) {
        $i = 0;
        foreach ($query as $data) {
            $set_data[$i] = $data->description;
            $i++;
        }
    }
    ?>

Add new Post        <a href="<?php echo base_url() . 'index.php/offers/posts'; ?>">View All

  <?php if($this->session->flashdata('message'))
            {
            echo "
".$this->session->flashdata('message')."
";

            }?>
    <?php $validation_errors= validation_errors();
    if(isset($validation_errors)){
     echo "
".$validation_errors."
";

    }
  if(isset($error))
  {
         echo "
".$error."
";
       }
  ?>

        <?php echo form_open_multipart('offers/addpost'); ?>

        Post Title
            <input type="text" class="form-control" name="post_title" value="<?php echo set_value('post_title'); ?>" />

        Body
            <textarea name="post_content" id="textara" cols="50" rows="15" ><?php echo set_value('post_content'); ?></textarea>

        Image
            <input id="uploadImage" class="btn btn-default" type="file" name="file" accept="image/*"/>

            <input type="hidden" id="x" name="x" />
            <input type="hidden" id="y" name="y" />
            <input type="hidden" id="w" name="w" />
            <input type="hidden" id="h" name="h" />

                <input type="radio" value="1.7777777777777777" name="aspestRatio" id="aspestRatio1" class="sr-only">16:9

                <input type="radio" value="1.3333333333333333" name="aspestRatio" id="aspestRatio2" class="sr-only" checked="checked">4:3

                <input type="radio" value="1" name="aspestRatio" id="aspestRatio3" class="sr-only">1:1

                <input type="radio" value="0.6666666666666666" name="aspestRatio" id="aspestRatio4" class="sr-only">2:3

                <input type="radio" value="NaN" name="aspestRatio" id="aspestRatio5" class="sr-only">Free

  Select Category
 <select class="form-control" style="padding:1px" name="selectCategory">
                <option value="None">Select None</option>
                <?php
                foreach ($listOfCategory as $data) {
                    ?>

                    <option value="<?php echo $data->category_name; ?>">
    <?php echo $data->category_name; ?>
                    </option>
                        <?php
                    }
                    ?>

            </select>

<input type="submit" class="btn btn-default btn-lg btn-block" value="Submit" />
<?php echo form_close(); ?>

 */ ?>


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('bloggo', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='article',
            name='update_summary',
            field=models.TextField(blank=True, verbose_name='update summary'),
        ),
        migrations.AddField(
            model_name='user',
            name='bragging_rights',
            field=models.TextField(blank=True, verbose_name='bragging rights'),
        ),
    ]


text:
/** @babel */
/** @jsx etch.dom */

const etch = require('etch')
const { CompositeDisposable } = require('atom')
const View = require('./view')

export default class PIDButtonView extends View {

  constructor(configController, processController) {
    super(false)
    this.configController = configController
    this.processController = processController
    this.tooltipDisposables = null

    this.processController.addProcessCallback(this)

    this.initialize()
  }

  render() {
    return <div className="process-palette-pid-btn">
      <button ref="killButton" className="process-palette-pid-btn-x btn btn-sm btn-fw icon-primitive-square" on={{ click: () => this.killButtonPressed(), mousedown: e => e.preventDefault() }} />
      <button ref="showOutputButton" className="process-palette-pid-btn-pid btn btn-sm" on={{ click: () => this.showOutputButtonPressed(), mousedown: e => e.preventDefault() }}>
        {this.processController.getProcessID()}
      </button>
    </div>
  }

  initialize() {
    super.initialize()

    if (this.processController.process === null) {
      this.showTrashIcon()
    }

    this.addTooltips()
  }

  refreshTooltips() {
    this.removeTooltips()
    this.addTooltips()
  }

  addTooltips() {
    if (this.tooltipDisposables) {
      return
    }

    this.tooltipDisposables = new CompositeDisposable()
    this.tooltipDisposables.add(atom.tooltips.add(this.refs.killButton, { title: "Kill/Discard" }))
    this.tooltipDisposables.add(atom.tooltips.add(this.refs.showOutputButton, { title: "Show Output" }))
  }

  removeTooltips() {
    if (this.tooltipDisposables) {
      this.tooltipDisposables.dispose()
      this.tooltipDisposables = null
    }
  }

  destroy() {
    this.tooltipDisposables.dispose()
    this.processController.removeProcessCallback(this)
    super.destroy()
  }

  getElement() {
    return this.element
  }

  processStarted() { }

  processStopped() {
    this.showTrashIcon()
  }

  showTrashIcon() {
    this.refs.killButton.classList.remove('icon-primitive-square')
    this.refs.killButton.classList.add('icon-x')
  }

  killButtonPressed() {
    if (this.processController.process !== null) {
      this.processController.killProcess(false)
    } else {
      this.processController.discard()
    }

    this.refreshTooltips()
  }

  showOutputButtonPressed() {
    if (this.isHighlighted()) {
      return
    }

    this.processController.showProcessOutput()
    this.refreshTooltips()
  }

  highlight() {
    this.refs.showOutputButton.classList.add("btn-primary", "selected")
  }

  isHighlighted() {
    return this.refs.showOutputButton.classList.contains("selected")
  }
}


text:
Input::
//// [/a/lib/lib.d.ts]
/// <reference no-default-lib="true"/>
interface Boolean {}
interface Function {}
interface CallableFunction {}
interface NewableFunction {}
interface IArguments {}
interface Number { toExponential: any; }
interface Object {}
interface RegExp {}
interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }
interface ReadonlyArray<T> {}
declare const console: { log(msg: any): void; };

//// [/users/username/projects/project/node_modules/tslib/index.d.ts]
export function __assign(...args: any[]): any;

//// [/users/username/projects/project/node_modules/tslib/package.json]
{"name":"tslib","version":"0.0.1"}

//// [/users/username/projects/project/index.tsx]
export const x = {...{}};

//// [/users/username/projects/project/tsconfig.json]
{"compilerOptions":{"importHelpers":true}}

/a/lib/tsc.js -w
Output::
>> Screen clear
[12:00:29 AM] Starting compilation in watch mode...

[12:00:32 AM] Found 0 errors. Watching for file changes.

Program root files: ["/users/username/projects/project/index.tsx"]
Program options: {"importHelpers":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"}
Program structureReused: Not
Program files::
/a/lib/lib.d.ts
/users/username/projects/project/node_modules/tslib/index.d.ts
/users/username/projects/project/index.tsx

Semantic diagnostics in builder refreshed for::
/a/lib/lib.d.ts
/users/username/projects/project/node_modules/tslib/index.d.ts
/users/username/projects/project/index.tsx

Shape signatures in builder refreshed for::
/a/lib/lib.d.ts (used version)
/users/username/projects/project/node_modules/tslib/index.d.ts (used version)
/users/username/projects/project/index.tsx (used version)

WatchedFiles::
/users/username/projects/project/tsconfig.json:
  {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250}
/users/username/projects/project/index.tsx:
  {"fileName":"/users/username/projects/project/index.tsx","pollingInterval":250}
/users/username/projects/project/node_modules/tslib/index.d.ts:
  {"fileName":"/users/username/projects/project/node_modules/tslib/index.d.ts","pollingInterval":250}
/a/lib/lib.d.ts:
  {"fileName":"/a/lib/lib.d.ts","pollingInterval":250}
/users/username/projects/project/node_modules/tslib/package.json:
  {"fileName":"/users/username/projects/project/node_modules/tslib/package.json","pollingInterval":250}

FsWatches::

FsWatchesRecursive::
/users/username/projects/project/node_modules:
  {"directoryName":"/users/username/projects/project/node_modules","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}
/users/username/projects/project/node_modules/@types:
  {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}
/users/username/projects/project:
  {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}

exitCode:: ExitStatus.undefined

//// [/users/username/projects/project/index.js]
"use strict";
exports.__esModule = true;
exports.x = void 0;
var tslib_1 = require("tslib");
exports.x = (0, tslib_1.__assign)({});

Change::

Input::
//// [/users/username/projects/project/node_modules/tslib/index.d.ts] deleted
//// [/users/username/projects/project/node_modules/tslib/package.json] deleted

Output::
>> Screen clear
[12:00:35 AM] Starting compilation in watch mode...

index.tsx:1:19 - error TS2354: This syntax requires an imported helper but module 'tslib' cannot be found.

1 export const x = {...{}};
                    ~~~~~

[12:00:39 AM] Found 1 error. Watching for file changes.

Program root files: ["/users/username/projects/project/index.tsx"]
Program options: {"importHelpers":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"}
Program structureReused: Not
Program files::
/a/lib/lib.d.ts
/users/username/projects/project/index.tsx

Semantic diagnostics in builder refreshed for::
/a/lib/lib.d.ts
/users/username/projects/project/index.tsx

Shape signatures in builder refreshed for::
/a/lib/lib.d.ts (used version)
/users/username/projects/project/index.tsx (used version)

WatchedFiles::
/users/username/projects/project/tsconfig.json:
  {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250}
/users/username/projects/project/index.tsx:
  {"fileName":"/users/username/projects/project/index.tsx","pollingInterval":250}
/a/lib/lib.d.ts:
  {"fileName":"/a/lib/lib.d.ts","pollingInterval":250}
/users/username/projects/project/node_modules/tslib/package.json:
  {"fileName":"/users/username/projects/project/node_modules/tslib/package.json","pollingInterval":250}

FsWatches::

FsWatchesRecursive::
/users/username/projects/project/node_modules:
  {"directoryName":"/users/username/projects/project/node_modules","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}
/users/username/projects/project/node_modules/@types:
  {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}
/users/username/projects/project:
  {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}

exitCode:: ExitStatus.undefined

//// [/users/username/projects/project/index.js] file written with same contents


text:
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story

from page_sets import repaint_helpers
from page_sets import top_pages

class TopRepaintPage(page_module.Page):

  def __init__(self, url, page_set, mode, width, height, name='',
               credentials=None):
    super(TopRepaintPage, self).__init__(
        url=url, page_set=page_set, name=name,
        credentials_path='data/credentials.json',
        shared_page_state_class=shared_page_state.SharedDesktopPageState)
    self.archive_data_file = 'data/top_25_repaint.json'
    self.credentials = credentials
    self._mode = mode
    self._width = width
    self._height = height

  def RunPageInteractions(self, action_runner):
    repaint_helpers.Repaint(
        action_runner, mode=self._mode, width=self._width, height=self._height)

def _CreatePageClassWithRepaintInteractions(page_cls, mode, width, height):
  class DerivedRepaintPage(page_cls):  # pylint: disable=W0232

    def RunPageInteractions(self, action_runner):
      repaint_helpers.Repaint(
          action_runner, mode=mode, width=width, height=height)

  return DerivedRepaintPage

class Top25RepaintPageSet(story.StorySet):

  """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """

  def __init__(self, mode='viewport', width=None, height=None):
    super(Top25RepaintPageSet, self).__init__(
        archive_data_file='data/top_25_repaint.json',
        cloud_storage_bucket=story.PARTNER_BUCKET)

    top_page_classes = [
        top_pages.GoogleWebSearchPage,
        top_pages.GoogleImageSearchPage,
        top_pages.GmailPage,
        top_pages.GoogleCalendarPage,
        top_pages.GoogleDocPage,
        top_pages.GooglePlusPage,
        top_pages.YoutubePage,
        top_pages.BlogspotPage,
        top_pages.WordpressPage,
        top_pages.FacebookPage,
        top_pages.LinkedinPage,
        top_pages.WikipediaPage,
        top_pages.TwitterPage,
        top_pages.PinterestPage,
        top_pages.ESPNPage,
        top_pages.WeatherPage,
        top_pages.YahooGamesPage,
    ]

    for cl in top_page_classes:
      self.AddUserStory(_CreatePageClassWithRepaintInteractions(
          cl, mode=mode, width=width, height=height)
                        (self, shared_page_state.SharedDesktopPageState))

    other_urls = [
        # Why: #1 news worldwide (Alexa global)
        'http://news.yahoo.com',
        # Why: #2 news worldwide
        'http://www.cnn.com',
        # Why: #1 world commerce website by visits; #3 commerce in the US by
        # time spent
        'http://www.amazon.com',
        # Why: #1 commerce website by time spent by users in US
        'http://www.ebay.com',
        # Why: #1 Alexa recreation
        'http://booking.com',
        # Why: #1 Alexa reference
        'http://answers.yahoo.com',
        # Why: #1 Alexa sports
        'http://sports.yahoo.com/',
        # Why: top tech blog
        'http://techcrunch.com'
    ]

    for url in other_urls:
      self.AddUserStory(
          TopRepaintPage(url, self, mode=mode, height=height, width=width))


text:
#pragma once

#include "core/memory/allocator.h"

namespace crown
{
/// Allocates memory linearly in a stack-like fashion from a
/// predefined chunk. All deallocations must occur in LIFO
/// order.
///
/// @ingroup Memory
struct StackAllocator : public Allocator
{
	struct Header
	{
		u32 offset;
		u32 alloc_id;
	};

	char* _begin;
	char* _top;
	u32 _total_size;
	u32 _allocation_count;

	StackAllocator(char* begin, u32 size);
	~StackAllocator();

	/// @copydoc Allocator::allocate()
	void* allocate(u32 size, u32 align = Allocator::DEFAULT_ALIGN);

	/// @copydoc Allocator::deallocate()
	/// @note
	/// Deallocations must occur in LIFO order i.e. the
	/// last allocation must be freed for first.
	void deallocate(void* data);

	/// @copydoc Allocator::allocated_size()
	u32 allocated_size(const void* /*ptr*/) { return SIZE_NOT_TRACKED; }

	/// @copydoc Allocator::total_allocated()
	u32 total_allocated();
};

} // namespace crown


text:
import React, {Component} from 'react';
import GetRates from './GetRates';
import Contact from './Contact';
import CitiesList from './CitiesList';

class Nav extends Component {
    constructor(){
        super();
        this.state = {
            showCities: false,
            showSearch: true,
            showContact: false
        };
    }
    toggleCities(){
        this.setState({
            showCities: true,
            showSearch: false,
            showContact: false
        });
    }
    toggleSearch(){
        this.setState({
            showCities: false,
            showSearch: true,
            showContact: false
        });
        this.props.taskCallbacks.clearHotelsSearch();
        this.props.taskCallbacks.clearHotel();
    }
    toggleContact(){
        this.setState({
            showCities: false,
            showSearch: false,
            showContact: true
        });
    }

    render(){
        var homepage = '';

        if (this.state.showCities) {
            homepage = <CitiesList />;
        }
        else if (this.state.showContact){
            homepage = <Contact />;
        }
        else { homepage = <GetRates taskCallbacks={this.props.taskCallbacks} hotelData={this.props.hotelData} /> }

        return (

                    <button type='button' className='navbar-toggle' data-toggle='collapse' data-target='.navbar-collapse'>

                    </button>

Home

Cities We Represent

Search Hotels

Contact Us

        {homepage}

        );
    }
}

export default Nav;


text:
@charset "UTF-8";
a { outline: none; }

/*************  clearfix  **********************/

.clearfix:after {
  content: ".";
  display: block;
  font-size:0;
  height: 0;
  clear: both;
  visibility: hidden;
}

.clearfix { display: block; }

.rounded-2 { -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; }
.rounded-3 { -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
.rounded-4 { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
.rounded-5 { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }
.rounded-6 { -moz-border-radius: 6px; -webkit-border-radius: 5px; border-radius: 6px; }
.rounded-7 { -moz-border-radius: 7px; -webkit-border-radius: 7px; border-radius: 7px; }
.rounded-left-3 { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; }
.rounded-bottom-7 { -moz-border-radius-bottomleft:7px; -moz-border-radius-bottomright:7px; -webkit-border-bottom-left-radius: 7px;-webkit-border-bottom-right-radius: 7px; border-bottom-left-radius: 7px; border-bottom-right-radius: 7px;}

.ui-widget { font-size:.9em;}
.ui-dialog .ui-dialog-buttonpane button { padding: .1em .6em .2em .6em; }

/* colorpicker "button" */
.el-colorpicker {
	width  : 16px;
	height : 16px;
	border:1px solid #ccc;
	position:relative;
	cursor:default;
}

/* colors palette */
.el-palette {
	width: 182px;
	border:1px solid #ccc;
	background:#fff;
	padding:3px 2px 3px 3px;
	z-index:99000; /* fight with ui.dialog 0_o */
	position:absolute;
	top:16px;
	left:0;
}

/* color cell in palette */
.el-palette .color {
	float:left;
	width:14px;
	height:14px;
	line-height:1px;
	border-top: 1px solid #eee;
	border-left:1px solid #eee;
}

/* side below color cells */
.el-palette .panel {
	border-top:1px solid #ccc;
	margin-top:7px;
	padding:5px 3px 5px 3px;
}

/* "window" with selected color */
.el-palette .panel .preview {
	float:right;
	width:18px;
	height:18px;
	border:1px solid #ccc;
}

/* color value text field */
.el-palette .panel input {
	border:1px solid #ccc;
}
/* dialog container */
.ui-widget .el-dialogform {
	padding:5px 3px;

}

.ui-widget .el-dialogform-rtl {
	direction: rtl;
}

.ui-widget .el-dialogform-rtl .ui-tabs-nav li {
	float:right;
}

.el-dialogform div.tab:hover { background:transparent; }
.ui-dialog .ui-dialog-title, .ui-dialog .ui-dialog-content {
	font-size:.9em;
}

/* tabs nav */
.ui-tabs .ui-tabs-nav li a {
	padding:.2em .7em;
}

/* tab container */
.el-dialogform .tab {
	padding:5px 0 12px 0;
	border:none;
}
/* line separator */
.el-dialogform .separator {
	border-top:1px solid #ccc;
	margin: 5px 2px;
}

/* table in dialog or in tab */
.el-dialogform table {
	width:100%;
	border: none;
}

.el-dialogform  table td {
	padding: 2px;
}

.el-dialogform input, .el-dialogform textarea {
	border:1px solid #ccc;
}

.el-dialogform select {
	padding:0;
/*	font-size:11px;*/
}

.el-dialogform .spinner {
	background:url(../images/loading.gif) 50% 50% no-repeat;
	text-align:center;
	width:150px;
	height:50px;
	margin:10px auto;
	padding-top:33px;
	font-weight:bold;
}
.el-dialogform-error {
	background: #fee; color:#ff0000; border: 2px #844 solid; padding: 10px; margin-bottom: 1em 0;

}
.el-dialogform-message {
	background: #efe; color: #040; border: 2px #484 solid; padding: 10px; margin-bottom: 1em 0;
}

.el-dialogform  table td .el-borderselect table {
	width:auto;
}

.el-dialogform  table td .el-borderselect table td {
	padding-left :0;
	padding-right:2px;
}
.el-paddinginput {
	display: block;
	white-space: nowrap;
}
.el-paddinginput input {
	margin :0 1px 0 0;
	border:1px solid #ccc;
}
.el-paddinginput select {
	padding:0;
}/* container for elselect */
.el-select {
	height:17px;
	width : 110px;
	border:1px solid #ccc;
	cursor: default;
	position:relative;
}
.el-select.hover {
	background-color:#eee;
}

/* selected element */
.el-select label {
	height:17px;
	line-height:17px;
/*	font-size:.92em;*/
	padding: 0 5px;
	margin: 0 12px 0 0;
	display:block;
	white-space:nowrap;
	overflow:hidden;
	background: #fff;
	border-right:1px solid #ccc;
}
/* drop-down list */
.el-select .list {
	border:1px solid #ccc;
	display:block;
	position:absolute;
	overflow:auto;
	background:#fff;
	z-index:1000;
/*	height:1610px*/
}
/* drop-down list item */
.el-select .list div {
	position:relative;
	padding:3px 25px 3px 7px;
	border-bottom:1px solid #eee;
}
/* drop-down list item hovered */
.el-select .list .hover {
	background:#efefef;
}
/* drop-down list item selected */
.el-select .list .active {
	background-color:#c3dbef;
}
/* any elements in drop-down list item */
.el-select .list div * {
	padding:0;
	margin:0;
	border:none;
	white-space:nowrap;
	display:block;
}
/*  контейнер */
.el-rte {
	font-family: Trebuchet MS, Verdana, Geneva,sans-serif;
	overflow:hidden;
/*	border:1px solid #aaa;*/
}
.el-rte.el-fullscreen {
	position:absolute;
	width:99%;
/*	height:100%;*/
	top:0;
	left:0;
	margin:0;
	z-index:10;
}

.elrte-swf-placeholder {
	width:1px;
	background: url('../images/swf.png') 0 0 no-repeat;
}

/* style to detect images url */
/*.el-rte */
.elrtetesturl { color:red; background-image:url(../../images/pixel.gif);}

/* панель инструментов */
.el-rte .toolbar {  background-color:#eee; padding:3px 7px 2px 7px; border:1px solid #ccc; white-space:normal; }

.el-rte-rtl .toolbar { direction: rtl; }

/* панель кнопок */
.el-rte .toolbar ul {
	position:relative;
	display:inline-block;
	display: -moz-inline-stack;
    display: inline-block;
    vertical-align: top;
    zoom: 1;
    *display: inline;
	margin:0;
	list-style:none;
	padding:0 2px 0 5px;
	background: url('../../images/elrte-toolbar.png') -934px -2px no-repeat;
}
/* первая панель кнопок */
.el-rte .toolbar ul.first {
	background:transparent;
	padding-left:0;
}
/* кнопка */
.el-rte .toolbar ul li {
	display:inline-block;
	display: -moz-inline-stack;
    display: inline-block;
	height:22px;
	width:22px;
    vertical-align: top;
    zoom: 1;
    *display: inline;
	margin:1px 1px;
	padding:0; /* Joomla 1.6 compat */
	background:url('../../images/elrte-toolbar.png') no-repeat;
	border:1px solid #ccc;
	z-index:100;

}
/* активная и подсвеченная и неактивная кнопка */
.el-rte .toolbar ul li.hover    { border:1px solid #54b9bf; }
.el-rte .toolbar ul li.active   { background-color:#c3dbef; border:1px solid #fff; }
.el-rte .toolbar ul li.disabled { opacity:alpha(0.3); opacity: 0.3; filter:Alpha(Opacity=30);}
/*  кнопки  */
.el-rte .toolbar ul li.about               {background-position:-829px -5px;}
.el-rte .toolbar ul li.save                {background-position:-30px -2px;}
.el-rte .toolbar ul li.new                 {background-position:-55px -2px}
.el-rte .toolbar ul li.copy                {background-position:-78px -2px}
.el-rte .toolbar ul li.css                 {background-position:-801px -5px}
.el-rte .toolbar ul li.cut                 {background-position:-104px -2px}
.el-rte .toolbar ul li.paste               {background-position:-128px -2px}
.el-rte .toolbar ul li.pastetext           {background-position:-534px -2px}
.el-rte .toolbar ul li.pasteformattext     {background-position:-154px -2px}
.el-rte .toolbar ul li.removeformat        {background-position:-180px -2px}
.el-rte .toolbar ul li.docstructure        {background-position:-712px -4px}
.el-rte .toolbar ul li.undo                {background-position:-205px -2px}
.el-rte .toolbar ul li.redo                {background-position:-230px -2px}
.el-rte .toolbar ul li.bold                {background-position:-252px -2px; }
.el-rte .toolbar ul li.italic              {background-position:-270px -2px;}
.el-rte .toolbar ul li.underline           {background-position:-290px -2px; }
.el-rte .toolbar ul li.strikethrough       {background-position:-149px -29px}
.el-rte .toolbar ul li.subscript           {background-position:-54px -29px}
.el-rte .toolbar ul li.superscript         {background-position:-76px -29px}
.el-rte .toolbar ul li.justifyleft         {background-position:-311px -2px}
.el-rte .toolbar ul li.justifycenter       {background-position:-335px -2px}
.el-rte .toolbar ul li.justifyright        {background-position:-360px -2px}
.el-rte .toolbar ul li.justifyfull         {background-position:-174px -29px}
.el-rte .toolbar ul li.insertunorderedlist {background-position:-100px -29px}
.el-rte .toolbar ul li.insertorderedlist   {background-position:-124px -29px}
.el-rte .toolbar ul li.outdent             {background-position:-6px   -29px}
.el-rte .toolbar ul li.indent              {background-position:-32px  -29px}
.el-rte .toolbar ul li.blockquote          {background-position:-220px -30px}
.el-rte .toolbar ul li.div                 {background-position:-655px -29px}
.el-rte .toolbar ul li.stopfloat           {background-position:-771px -5px}
.el-rte .toolbar ul li.nbsp                {background-position:-580px -2px}
.el-rte .toolbar ul li.forecolor           {background-position:-372px -30px}
.el-rte .toolbar ul li.hilitecolor         {background-position:-395px -30px}
.el-rte .toolbar ul li.link                {background-position:-244px -29px}
.el-rte .toolbar ul li.unlink              {background-position:-270px -29px}
.el-rte .toolbar ul li.anchor              {background-position:-296px -30px}
.el-rte .toolbar ul li.image               {background-position:-384px -2px}
.el-rte .toolbar ul li.flash               {background-position:-410px -2px}
.el-rte .toolbar ul li.file                {background-position:-436px -3px}
.el-rte .toolbar ul li.table               {background-position:-421px -30px}
.el-rte .toolbar ul li.tableprops          {background-position:-602px -29px}
.el-rte .toolbar ul li.tbcellprops         {background-position:-806px -27px}
.el-rte .toolbar ul li.tablerm             {background-position:-461px -2px}
.el-rte .toolbar ul li.tbrowbefore         {background-position:-683px -4px}
.el-rte .toolbar ul li.tbrowafter          {background-position:-654px -4px}
.el-rte .toolbar ul li.tbrowrm             {background-position:-500px -30px}
.el-rte .toolbar ul li.tbcolbefore         {background-position:-741px -27px}
.el-rte .toolbar ul li.tbcolafter          {background-position:-772px -27px}
.el-rte .toolbar ul li.tbcolrm             {background-position:-526px -30px}
.el-rte .toolbar ul li.tbcellsmerge        {background-position:-552px -30px}
.el-rte .toolbar ul li.tbcellsplit         {background-position:-629px -29px}
.el-rte .toolbar ul li.smiley              {background-position:-322px -29px}
.el-rte .toolbar ul li.spec-text           {background-position:-487px -2px}
.el-rte .toolbar ul li.print               {background-position:-509px -2px}
.el-rte .toolbar ul li.horizontalrule      {background-position:-199px -29px}
.el-rte .toolbar ul li.fullscreen          {background-position:-348px -30px}
.el-rte .toolbar ul li.elfinder            {background-position:-436px -2px}
.el-rte .toolbar ul li.ltr                 {background-position:-855px -27px}
.el-rte .toolbar ul li.rtl                 {background-position:-855px -3px}
.el-rte .toolbar ul li.pagebreak           {background-position:-711px -28px}

/* рабочая зона (обертка над iframe) */
.el-rte .workzone { border:1px solid #eee; border-top:none; height:400px; overflow:hidden; }
.el-rte.small .workzone { min-height:250px; }

/* source code */
.el-rte textarea  { width:100%; height:100%; border:none; zoom:1; padding:0; outline:none; }
.el-rte.small textarea  { min-height:250px;}
/* редактор */
.el-rte iframe    {
	width: 100%;
	height:400px;
	display:block;
	outline:none;
	border:0 solid;
	padding:0;
	margin:0;
	background:#fff;

}
.el-rte.small iframe  { min-height:250px;}

/* панель статуса (путь) */
.el-rte .statusbar {
	height: 21px;
	padding: 0 9px;
	font: 11px/21px 'monaco', 'andale mono', 'lucida console', monospace;
	background-color:#eee;
	border-top:1px solid #ccc;
	border-top:none;
}

.el-rte-rtl .statusbar {
	direction:rtl;
/*	text-align:right;*/
}

/* табы */
.el-rte .tabsbar { display: block;  }
.el-rte .tabsbar .tab {
	float:left;
	margin-right:2px;
	padding: 6px 17px;
	font-size: .82em;
	font-weight:bold;
	color:#777;
	text-align:center;
	border:1px solid #eee;
	border-top:none;
	background: #fff;
	cursor: default;
}
.el-rte .tabsbar div.active { background: #eee; color:#444; }
.el-rte-rtl .tabsbar .tab  { float:right; }

/* выпадающие меню */
/* container for elselect */
.el-rte .toolbar ul li.el-select {
	height:22px;
	width : 120px;
	border:1px solid #ccc;
	font-size:.82em;
	cursor: default;
	background-position:-475px -30px;
}

.el-rte .toolbar ul li.el-select.hover {
	background-color:#fefefe;
}

.el-rte .toolbar ul li.el-select label {
	height:19px;
	padding: 3px 5px 0 5px;
	float:none; /* Joomla 1.6 compat */
	width:96px; /* Joomla 1.6 compat */
}

/* textarea & iframe в диплогах вставки текста */
.el-rte-paste-input {
	width : 99%;
	height: 250px;
	border: 1px solid #ccc;
	padding:0;
	margin:0;
	outline:none;
}
/* индикатор выбраного цвета на кнопке */
.el-rte .toolbar ul li div.color-indicator {
	width:18px;
	height:4px;
	margin:16px 0 2px 2px;
	background-color: #000;
}
.el-rte-rtl .toolbar ul li div.color-indicator {
	margin:16px 2px 2px 0;
}
.el-rte .toolbar .panel-format { z-index: 10; }

/* colors palette */
.el-palette { top:20px; }

.el-dialogform, .el-dialogform td       { font-size:.9em; }
.el-dialogform select                   { font-size:.9em;}
.ui-dialog .ui-dialog-buttonpane        { padding: .4em, 1em;}
.ui-dialog .ui-dialog-buttonpane button { margin: .3em .4em .1em 0; font-size:.9em;}
.ui-dialog .ui-dialog-titlebar          { padding: .3em 1em .3em;   }
/*.ui-dialog-buttonset { padding:0; background-color:#333;}*/
/* диалоговые окна */
.el-dialogform label       { display:block; }
.el-dialogform label input { margin-right:2px; }
.el-dialogform iframe.el-rte-preview {
	width : 100%;
	height : 235px;
	margin:0;
	padding:0;
	outline:none;
	border:none;
}
.el-dialogform fieldset {
	border:1px solid #ccc;
	padding : 0;
}
.el-dialogform fieldset legend {
	font-size:.9em;
	padding: .1em .5em;
	margin: 0 0 5px 1em;
	border:1px solid #ccc;
	background-color: #eee;
}
.el-dialogform p  { padding:.2em .3em;}
.el-dialogform h3 { color:#555; padding:1.2em 0 0 0; margin:0; font-size:1.2em; }
.el-dialogform h4 { color:#555;font-size:1em; padding:0; margin: 3px 9px; }

.elrte-logo {
	width:48px;
	height:46px;
	float:left;
	margin:.5em 1em;
	background:url('../../images/elrte-toolbar.png') -880px -7px no-repeat;
}
.elrte-ver  { font-size:.9em; padding-left:.7em; }
.elrte-copy { font-size:.9em; padding-left:.3em; }
table.elrte-authors    { margin-bottom:1em; }
table.elrte-authors td { border-bottom:1px solid #eee; }

/* widgets */
.el-borderselect {}
.el-borderselect table      {  margin:0; }
.el-borderselect table td   { padding : 0 2px 0 0; vertical-align:middle; }
.el-borderselect input      { margin:0;  border:1px solid #ccc; }

.el-paddinginput        { display: block; white-space: nowrap; }
.el-paddinginput input  { margin :0 1px 0 0; border:1px solid #ccc; }
.el-paddinginput select { padding:0; }

.el-rte-smiley { margin:5px; }

.elrte-image-src-fm .ui-state-default {
	float:right;
}
.el-dialogform-rtl .elrte-image-src-fm .ui-state-default { float:left;}

.elrte-image-preview {
	font-size:.7em;
	overflow:auto;
	height:240px;
	width:480px;
}


text:
const express = require('express');
const app = express();
require('./mongo').connect();

// import express middleware
const morgan = require('morgan');
const bodyParser = require('body-parser');
const helmet = require('helmet');
const cors = require('cors');

// setup app to use middleware
app.use(helmet());
app.use(morgan('tiny'));
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(cors());

// use routing
app.use("/", require('./routes'));

// https://goenning.net/2016/05/13/how-i-manage-application-configuration-with-nodejs/
// https://github.com/motdotla/dotenv/issues/110
require('dotenv').config(/*{ silent: true }*/);
const X = process.env.X || undefined;
console.log("X", X);

// start the app
const port = process.env.PORT || '3000';
app.listen(port, () => {
    // app.set('superSecret', config.secret);
    // app.get('superSecret')

    if (process.getegid) {
        console.log(`Current gid: ${process.getegid()}`);
    }

    if (process.geteuid) {
        console.log(`Current uid: ${process.geteuid()}`);
    }

    if (process.getgid) {
        console.log(`Current gid: ${process.getgid()}`);
    }

    console.log(`This process is pid ${process.pid}`);

    const uuidv4 = require('uuid/v4');
    const bcrypt = require('bcrypt');

    let ultimateSecret = uuidv4();
    console.log("ultimateSecret", ultimateSecret);
    ultimateSecret = bcrypt.hashSync(ultimateSecret, 10);
    console.log("ultimateSecret", ultimateSecret);

    process.env.secret_key = ultimateSecret;

    console.log()
    console.log(`Magic is listening on port ${port}`);
});


text:
package sshutils

import (
	"github.com/gravitational/trace"
	"golang.org/x/crypto/ssh"
)

// Fingerprint returns SSH RFC4716 fingerprint of the key
func Fingerprint(key ssh.PublicKey) string {
	return ssh.FingerprintSHA256(key)
}

// AuthorizedKeyFingerprint returns fingerprint from public key
// in authorized key format
func AuthorizedKeyFingerprint(publicKey []byte) (string, error) {
	key, _, _, _, err := ssh.ParseAuthorizedKey(publicKey)
	if err != nil {
		return "", trace.Wrap(err)
	}
	return Fingerprint(key), nil
}

// PrivateKeyFingerprint returns fingerprint of the public key
// extracted from the PEM encoded private key
func PrivateKeyFingerprint(keyBytes []byte) (string, error) {
	signer, err := ssh.ParsePrivateKey(keyBytes)
	if err != nil {
		return "", trace.Wrap(err)
	}
	return Fingerprint(signer.PublicKey()), nil
}


text:
@interface MyOverlayView : BMKOverlayView

@end


text:
#include <tee/entry_fast.h>
#include <optee_msg.h>
#include <sm/optee_smc.h>
#include <kernel/tee_l2cc_mutex.h>
#include <kernel/panic.h>
#include <kernel/misc.h>
#include <mm/core_mmu.h>

#include <assert.h>

static void tee_entry_get_shm_config(struct thread_smc_args *args)
{
	args->a0 = OPTEE_SMC_RETURN_OK;
	args->a1 = default_nsec_shm_paddr;
	args->a2 = default_nsec_shm_size;
	/* Should this be TEESMC cache attributes instead? */
	args->a3 = core_mmu_is_shm_cached();
}

static void tee_entry_fastcall_l2cc_mutex(struct thread_smc_args *args)
{
	TEE_Result ret;
#ifdef ARM32
	paddr_t pa = 0;

	switch (args->a1) {
	case OPTEE_SMC_L2CC_MUTEX_GET_ADDR:
		ret = tee_get_l2cc_mutex(&pa);
		reg_pair_from_64(pa, &args->a2, &args->a3);
		break;
	case OPTEE_SMC_L2CC_MUTEX_SET_ADDR:
		pa = reg_pair_to_64(args->a2, args->a3);
		ret = tee_set_l2cc_mutex(&pa);
		break;
	case OPTEE_SMC_L2CC_MUTEX_ENABLE:
		ret = tee_enable_l2cc_mutex();
		break;
	case OPTEE_SMC_L2CC_MUTEX_DISABLE:
		ret = tee_disable_l2cc_mutex();
		break;
	default:
		args->a0 = OPTEE_SMC_RETURN_EBADCMD;
		return;
	}
#else
	ret = TEE_ERROR_NOT_SUPPORTED;
#endif
	if (ret == TEE_ERROR_NOT_SUPPORTED)
		args->a0 = OPTEE_SMC_RETURN_UNKNOWN_FUNCTION;
	else if (ret)
		args->a0 = OPTEE_SMC_RETURN_EBADADDR;
	else
		args->a0 = OPTEE_SMC_RETURN_OK;
}

static void tee_entry_exchange_capabilities(struct thread_smc_args *args)
{
	if (args->a1) {
		/*
		 * Either unknown capability or
		 * OPTEE_SMC_NSEC_CAP_UNIPROCESSOR, in either case we can't
		 * deal with it.
		 *
		 * The memory mapping of shared memory is defined as normal
		 * shared memory for SMP systems and normal memory for UP
		 * systems. Currently we map all memory as shared in secure
		 * world.
		 */
		args->a0 = OPTEE_SMC_RETURN_ENOTAVAIL;
		return;
	}

	args->a0 = OPTEE_SMC_RETURN_OK;
	args->a1 = OPTEE_SMC_SEC_CAP_HAVE_RESERVED_SHM;
}

static void tee_entry_disable_shm_cache(struct thread_smc_args *args)
{
	uint64_t cookie;

	if (!thread_disable_prealloc_rpc_cache(&cookie)) {
		args->a0 = OPTEE_SMC_RETURN_EBUSY;
		return;
	}

	if (!cookie) {
		args->a0 = OPTEE_SMC_RETURN_ENOTAVAIL;
		return;
	}

	args->a0 = OPTEE_SMC_RETURN_OK;
	args->a1 = cookie >> 32;
	args->a2 = cookie;
}

static void tee_entry_enable_shm_cache(struct thread_smc_args *args)
{
	if (thread_enable_prealloc_rpc_cache())
		args->a0 = OPTEE_SMC_RETURN_OK;
	else
		args->a0 = OPTEE_SMC_RETURN_EBUSY;
}

void tee_entry_fast(struct thread_smc_args *args)
{
	switch (args->a0) {

	/* Generic functions */
	case OPTEE_SMC_CALLS_COUNT:
		tee_entry_get_api_call_count(args);
		break;
	case OPTEE_SMC_CALLS_UID:
		tee_entry_get_api_uuid(args);
		break;
	case OPTEE_SMC_CALLS_REVISION:
		tee_entry_get_api_revision(args);
		break;
	case OPTEE_SMC_CALL_GET_OS_UUID:
		tee_entry_get_os_uuid(args);
		break;
	case OPTEE_SMC_CALL_GET_OS_REVISION:
		tee_entry_get_os_revision(args);
		break;

	/* OP-TEE specific SMC functions */
	case OPTEE_SMC_GET_SHM_CONFIG:
		tee_entry_get_shm_config(args);
		break;
	case OPTEE_SMC_L2CC_MUTEX:
		tee_entry_fastcall_l2cc_mutex(args);
		break;
	case OPTEE_SMC_EXCHANGE_CAPABILITIES:
		tee_entry_exchange_capabilities(args);
		break;
	case OPTEE_SMC_DISABLE_SHM_CACHE:
		tee_entry_disable_shm_cache(args);
		break;
	case OPTEE_SMC_ENABLE_SHM_CACHE:
		tee_entry_enable_shm_cache(args);
		break;

	default:
		args->a0 = OPTEE_SMC_RETURN_UNKNOWN_FUNCTION;
		break;
	}
}

size_t tee_entry_generic_get_api_call_count(void)
{
	/*
	 * All the different calls handled in this file. If the specific
	 * target has additional calls it will call this function and
	 * add the number of calls the target has added.
	 */
	return 9;
}

void __weak tee_entry_get_api_call_count(struct thread_smc_args *args)
{
	args->a0 = tee_entry_generic_get_api_call_count();
}

void __weak tee_entry_get_api_uuid(struct thread_smc_args *args)
{
	args->a0 = OPTEE_MSG_UID_0;
	args->a1 = OPTEE_MSG_UID_1;
	args->a2 = OPTEE_MSG_UID_2;
	args->a3 = OPTEE_MSG_UID_3;
}

void __weak tee_entry_get_api_revision(struct thread_smc_args *args)
{
	args->a0 = OPTEE_MSG_REVISION_MAJOR;
	args->a1 = OPTEE_MSG_REVISION_MINOR;
}

void __weak tee_entry_get_os_uuid(struct thread_smc_args *args)
{
	args->a0 = OPTEE_MSG_OS_OPTEE_UUID_0;
	args->a1 = OPTEE_MSG_OS_OPTEE_UUID_1;
	args->a2 = OPTEE_MSG_OS_OPTEE_UUID_2;
	args->a3 = OPTEE_MSG_OS_OPTEE_UUID_3;
}

void __weak tee_entry_get_os_revision(struct thread_smc_args *args)
{
	args->a0 = CFG_OPTEE_REVISION_MAJOR;
	args->a1 = CFG_OPTEE_REVISION_MINOR;
}


text:
package stringset

import (
	"bytes"
	"errors"
	"reflect"
	"sort"
)

// ErrInvalidType is returned by initialization functions expecting specific types.
var ErrInvalidType = errors.New("invalid type")

// StringSet is an unordered set of unique strings.
type StringSet map[string]struct{}

// New returns a new StringSet initialized with vals.
func New(vals ...string) StringSet {
	s := make(StringSet)
	for _, val := range vals {
		s[val] = struct{}{}
	}
	return s
}

// FromSlice returns a new StringSet initialized with s's values.
// It returns InvalidType if sl is not a slice of type string.
func FromSlice(sl interface{}) (StringSet, error) {
	v := reflect.ValueOf(sl)
	if v.Kind() != reflect.Slice {
		return nil, ErrInvalidType
	}
	if v.Type().Elem().Kind() != reflect.String {
		return nil, ErrInvalidType
	}

	s := make(StringSet, v.Len())
	for i := 0; i < v.Len(); i++ {
		s[v.Index(i).Interface().(string)] = struct{}{}
	}
	return s, nil
}

// FromMapKeys returns a new StringSet initialized with m's keys.
// It returns InvalidType if m is not a map or its keys are not type string.
func FromMapKeys(m interface{}) (StringSet, error) {
	v := reflect.ValueOf(m)
	if v.Kind() != reflect.Map {
		return nil, ErrInvalidType
	}
	if v.Type().Key().Kind() != reflect.String {
		return nil, ErrInvalidType
	}

	s := make(StringSet, v.Len())
	for _, val := range v.MapKeys() {
		s[val.Interface().(string)] = struct{}{}
	}
	return s, nil
}

// FromMapVals returns a new StringSet initialized with m's values.
// It returns InvalidType if m is not a map or its values are not type string.
func FromMapVals(m interface{}) (StringSet, error) {
	v := reflect.ValueOf(m)
	if v.Kind() != reflect.Map {
		return nil, ErrInvalidType
	}
	if v.Type().Elem().Kind() != reflect.String {
		return nil, ErrInvalidType
	}

	s := make(StringSet, v.Len())
	for _, val := range v.MapKeys() {
		s[v.MapIndex(val).Interface().(string)] = struct{}{}
	}
	return s, nil
}

// Add adds val to the set if it does not already exist.
func (s StringSet) Add(val string) {
	s[val] = struct{}{}
}

// Remove deletes val from the set if it exists.
func (s StringSet) Remove(val string) {
	delete(s, val)
}

// Has returns true if val is in the set.
func (s StringSet) Has(val string) bool {
	_, ok := s[val]
	return ok
}

// Equals returns true if all the values of s are in t and vice-versa.
// Order is not considered.
func (s StringSet) Equals(t StringSet) bool {
	if len(s) != len(t) {
		return false
	}

	for val := range s {
		if _, ok := t[val]; !ok {
			return false
		}
	}

	return true
}

func (s StringSet) String() string {
	b := bytes.Buffer{}
	b.WriteRune('(')

	for val := range s {
		b.WriteString(val)
		b.WriteRune(' ')
	}

	if size := b.Len(); size > 1 {
		b.Truncate(size - 1)
	}

	b.WriteRune(')')

	return b.String()
}

// Slice returns a slice with the values of the set in an arbitrary order.
func (s StringSet) Slice() []string {
	sl := make([]string, 0, len(s))
	for val := range s {
		sl = append(sl, val)
	}

	return sl
}

// Sorted returns a slice with the values of the set sorted.
func (s StringSet) Sorted() []string {
	sl := s.Slice()

	sort.StringSlice(sl).Sort()
	return sl
}

// Len returns the length of the set.
func (s StringSet) Len() int {
	return len(s)
}


text:
//
//  ViewController.m
//  VoIPTestApp
//
//  Created by Abraham, Titus on 3/20/14.
//  Copyright (c) 2014 Qualcomm. All rights reserved.
//

#import "ViewController.h"
#import "audiohandler.h"
#import <AudioToolbox/AudioToolbox.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    InitializeiOSAudioHandler();
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)recordStart:(UIButton *)sender {
    NSLog(@"recordStart");
    /*Invoke the audio unit to give the PCM files to be queued for later playing*/
    StartRecording();
}

- (IBAction)recordStop:(UIButton *)sender {
    NSLog(@"recordStop");
    /*Stop audio unit*/
    StopRecording();
}

- (IBAction)voIPPlay:(UIButton *)sender {
    NSLog(@"voIPPlay");
    if(ArePCMThereToBePlayed())
    {
        StartPlayingVOIP();
    }
    else
    {
        NSLog(@"no PCM Frames available");
    }
}

- (IBAction)randomTone:(UIButton *)sender {
    NSLog(@"play Random Tone");
    StartPlayingRandomTone();
}

- (IBAction)stopPlaying:(UIButton *)sender {
}
@end


text:
.DEFAULT_GOAL := help
pkg_src = tdp_core

flake8 = flake8 $(pkg_src) setup.py
isort = isort $(pkg_src) setup.py
black = black --line-length 140 $(pkg_src) setup.py

.PHONY: all  ## Perform the most common development-time rules
all: format lint test

.PHONY: ci  ## Run all CI validation steps without making any changes to code
ci: check-format lint test

.PHONY: format  ## Auto-format the source code
format:
	$(isort)
	$(black)

.PHONY: check-format  ## Check the source code format without changes
check-format:
	$(isort) --check-only
	$(black) --check

.PHONY: lint  ## Run flake8
lint:
	$(flake8)

.PHONY: test  ## Run tests
test:
	pytest $(pkg_src)

.PHONEY: documentation ## Generate docs
documentation:
	mkdocs build

.PHONY: install  ## Install the requirements
install:
	pip install -e .

.PHONY: develop  ## Set up the development environment
develop:
	pip install -e .[develop]

.PHONY: build  ## Build a wheel
build:
	python setup.py sdist bdist_wheel --dist-dir dist_python

.PHONY: publish  ## Publish the ./dist/* using twine
publish:
	pip install twine==3.8.0
	twine upload --repository-url https://upload.pypi.org/legacy/ dist_python/*

.PHONY: help  ## Display this message
help:
	@grep -E \
		'^.PHONY: .*?## .*$$' $(MAKEFILE_LIST) | \
		sort | \
		awk 'BEGIN {FS = ".PHONY: |## "}; {printf "\033[36m%-20s\033[0m %s\n", $$2, $$3}'


text:
title: "Coralogix"
order: 165
updated: 2022-07-13
page_id: "coralogix"
warning: false
contextual_links:
  - type: section
    name: "Prerequisites"
  - type: link
    name: "Grouping requests in collections"
    url: "/docs/sending-requests/intro-to-collections/"
  - type: section
    name: "Additional Resources"
  - type: subtitle
    name: "Videos"
  - type: link
    name: "Integrate with Coralogix in Postman"
    url: "https://youtu.be/2cz02i0g6QU"

---

Coralogix is a machine learning powered log analytics platform which drastically improves the delivery and maintenance process for software providers. This integration allows you to configure your Postman Monitors to send metrics to Coralogix where you can visualize and compare metrics.

Setting up a Coralogix integration requires you to get an API key from Coralogix and configure your Postman Monitors. After you set up the integration, you can view real-time alerts based on the results of your monitors.

## Retrieving your Coralogix private key

1. Sign in to [Coralogix](https://dashboard.coralogix.com/#/login).

1. Select **Settings**, and then select the **Send your logs** tab.

    ![Coralogix settings](https://assets.postman.com/postman-docs/Coralogix_Pvtkey1.png)

1. Save the private key to use later.

## Configuring Coralogix integration

1. From the **[Home](https://go.postman.co/home)** page select **[Integrations](https://go.postman.co/integrations)**.

    ![home page and integrations](https://assets.postman.com/postman-docs/home-integrations.jpg)

1. Select **Browse All Integrations**.

1. Search and select **Coralogix**.

1. Select **Add Integration** to start configuring the integration for your workspace.

    ![Coralogix integrations page](https://assets.postman.com/postman-docs/coralogix-add-integration.jpg)

1. Enter the following in the **Add integration** window:

    * **Nickname** - A nickname for your integration.
    * **Workspace** - The workspace that contains your monitor.
    * **Monitor** - The collection-based monitor whose logs you would like to send to Coralogix.
    * **Private key** - Your Coralogix private key.
    * **Coralogix Site** - Your Coralogix site.
    * **Region** - The region that hosts your cluster.
    * **Advanced Options** - Show the Advanced Options to indicate if you want to send collection or environment details for each run.

1. Select **Add Integration** to save the configuration.

## Analyzing metrics in Coralogix

Once the data starts flowing into Coralogix, you can view and analyze these metrics in the Coralogix dashboard.

![Coralogix dashboard](https://assets.postman.com/postman-docs/coralogix_dashboard1.png)

Select the **Logs** tab to a view a list of all logs. You can filter the services by name. As many services may be running in your system, you can filter by selecting Postman to view all Coralogix logs for Postman. The schema appears, as illustrated below:

![Coralogix logs view](https://assets.postman.com/postman-docs/coralogix_schema1.png)

For more information, see the [Coralogix documentation](https://coralogix.com/docs/logs-screen/).