text:
'use strict';

var autoAuth = require('google-auto-auth');

var fs = require('fs');
var gax = require('./gax');
var globby = require('globby');
var googleProtoFilesDir = require('google-proto-files')('..');
var path = require('path');
var protobuf = require('protobufjs');
var util = require('util');

googleProtoFilesDir = path.normalize(googleProtoFilesDir);

var COMMON_PROTO_DIRS = [
  // This list of directories is defined here:
  // https://github.com/googleapis/googleapis/blob/master/gapic/packaging/common_protos.yaml
  'api',
  path.join('iam', 'v1'),
  path.join('logging', 'type'),
  'longrunning',
  'protobuf', // This is an additional path that the common protos depend on.
  'rpc',
  'type'
];

var COMMON_PROTO_GLOB_PATTERNS = COMMON_PROTO_DIRS.map(function(dir) {
  return path.join(googleProtoFilesDir, 'google', dir, '**', '*.proto');
});

var COMMON_PROTO_FILES = globby.sync(COMMON_PROTO_GLOB_PATTERNS)
  .map(function(filename) {
    return path.normalize(filename);
  })
  .map(function(filename) {
    return filename.substring(googleProtoFilesDir.length + 1);
  });

/**
 * A class which keeps the context of gRPC and auth for the gRPC.
 *
 * @param {Object=} options - The optional parameters. It will be directly
 *   passed to google-auto-auth library, so parameters like keyFile or
 *   credentials will be valid.
 * @param {Object=} options.auth - An instance of google-auto-auth.
 *   When specified, this auth instance will be used instead of creating
 *   a new one.
 * @param {Object=} options.grpc - When specified, this will be used
 *   for the 'grpc' module in this context. By default, it will load the grpc
 *   module in the standard way.
 * @param {Function=} options.promise - A constructor for a promise that
 * implements the ES6 specification of promise. If not provided, native promises
 * will be used.
 * @constructor
 */
function GrpcClient(options) {
  if (!(this instanceof GrpcClient)) {
    return new GrpcClient(options);
  }
  options = options || {};
  this.auth = options.auth || autoAuth(options);
  this.promise = options.promise || Promise;
  if ('grpc' in options) {
    this.grpc = options.grpc;
    this.grpcVersion = '';
  } else {
    this.grpc = require('grpc');
    this.grpcVersion = require('grpc/package.json').version;
  }
}
module.exports = GrpcClient;

/**
 * Creates a gRPC credentials. It asks the auth data if necessary.
 * @private
 * @param {Object} opts - options values for configuring credentials.
 * @param {Object=} opts.sslCreds - when specified, this is used instead
 *   of default channel credentials.
 * @return {Promise} The promise which will be resolved to the gRPC credential.
 */
GrpcClient.prototype._getCredentials = function _getCredentials(opts) {
  var PromiseCtor = this.promise;
  if (opts.sslCreds) {
    return PromiseCtor.resolve(opts.sslCreds);
  }
  var grpc = this.grpc;
  var getAuthClient = this.auth.getAuthClient.bind(this.auth);
  var sslCreds = grpc.credentials.createSsl();
  return new PromiseCtor(function(resolve, reject) {
    getAuthClient(function(err, auth) {
      if (err) {
        reject(err);
      } else {
        var credentials = grpc.credentials.combineChannelCredentials(
            sslCreds,
            grpc.credentials.createFromGoogleCredential(auth)
        );
        resolve(credentials);
      }
    });
  });
};

/**
 * Load grpc proto services with the specific arguments.
 * @param {Array=} args - The argument list to be passed to grpc.load().
 * @return {Object} The gRPC loaded result (the toplevel namespace object).
 */
GrpcClient.prototype.load = function(args) {
  if (!args) {
    args = [];
  } else if (!Array.isArray(args)) {
    args = [args];
  }
  if (args.length === 1) {
    args.push('proto', {convertFieldsToCamelCase: true});
  }
  return this.grpc.load.apply(this.grpc, args);
};

/**
 * Load grpc proto service from a filename hooking in googleapis common protos
 * when necessary.
 * @param {String} protoPath - The directory to search for the protofile.
 * @param {String} filename - The filename of the proto to be loaded.
 * @return {Object<string, *>} The gRPC loaded result (the toplevel namespace
 *   object).
 */
GrpcClient.prototype.loadProto = function(protoPath, filename) {
  var resolvedPath = GrpcClient._resolveFile(protoPath, filename);
  return this.grpc.loadObject(
    protobuf.loadSync(resolvedPath, new GoogleProtoFilesRoot()));
};

GrpcClient._resolveFile = function(protoPath, filename) {
  if (fs.existsSync(path.join(protoPath, filename))) {
    return path.join(protoPath, filename);
  } else if (COMMON_PROTO_FILES.indexOf(filename) > -1) {
    return path.join(googleProtoFilesDir, filename);
  }
  throw new Error(filename + " could not be found in " + protoPath);
};

GrpcClient.prototype.metadataBuilder = function(headers) {
  var Metadata = this.grpc.Metadata;
  var baseMetadata = new Metadata();
  for (var key in headers) {
    baseMetadata.set(key, headers[key]);
  }
  return function buildMetadata(abTests, moreHeaders) {
    // TODO: bring the A/B testing info into the metadata.
    var copied = false;
    var metadata = baseMetadata;
    for (var key in moreHeaders) {
      if (key.toLowerCase() !== 'x-goog-api-client' &&
          moreHeaders.hasOwnProperty(key)) {
        if (!copied) {
          copied = true;
          metadata = metadata.clone();
        }
        metadata.set(key, moreHeaders[key]);
      }
    }
    return metadata;
  };
};

/**
 * A wrapper of {@link constructSettings} function with under the gRPC context.
 *
 * Most of parameters are common among constructSettings, please take a look.
 * @param {string} serviceName - The fullly-qualified name of the service.
 * @param {Object} clientConfig - A dictionary of the client config.
 * @param {Object} configOverrides - A dictionary of overriding configs.
 * @param {Object} headers - A dictionary of additional HTTP header name to
 *   its value.
 * @return {Object} A mapping of method names to CallSettings.
 */
GrpcClient.prototype.constructSettings = function constructSettings(
    serviceName,
    clientConfig,
    configOverrides,
    headers) {
  return gax.constructSettings(
      serviceName,
      clientConfig,
      configOverrides,
      this.grpc.status,
      {metadataBuilder: this.metadataBuilder(headers)},
      this.promise);
};

/**
 * Creates a gRPC stub with current gRPC and auth.
 * @param {function} CreateStub - The constructor function of the stub.
 * @param {Object} options - The optional arguments to customize
 *   gRPC connection. This options will be passed to the constructor of
 *   gRPC client too.
 * @param {string} options.servicePath - The name of the server of the service.
 * @param {number} options.port - The port of the service.
 * @param {grpc.ClientCredentials=} options.sslCreds - The credentials to be used
 *   to set up gRPC connection.
 * @return {Promise} A promse which resolves to a gRPC stub instance.
 */
GrpcClient.prototype.createStub = function(CreateStub, options) {
  var serviceAddress = options.servicePath + ':' + options.port;
  return this._getCredentials(options).then(function(credentials) {
    var grpcOptions = {};
    Object.keys(options).forEach(function(key) {
      if (key.indexOf('grpc.') === 0) {
        grpcOptions[key] = options[key];
      }
    });
    return new CreateStub(serviceAddress, credentials, grpcOptions);
  });
};

/**
 * Creates a 'bytelength' function for a given proto message class.
 *
 * See {@link BundleDescriptor} about the meaning of the return value.
 *
 * @param {function} message - a constructor function that is generated by
 *   protobuf.js. Assumes 'encoder' field in the message.
 * @return {function(Object):number} - a function to compute the byte length
 *   for an object.
 */
GrpcClient.createByteLengthFunction =
    function createByteLengthFunction(message) {
      return function getByteLength(obj) {
        return message.encode(obj).buffer.length;
      };
    };

function GoogleProtoFilesRoot() {
  protobuf.Root.call(this, [].slice.apply(arguments));
}
util.inherits(GoogleProtoFilesRoot, protobuf.Root);

module.exports.GoogleProtoFilesRoot = GoogleProtoFilesRoot;

// Causes the loading of an included proto to check if it is a common
// proto. If it is a common proto, use the google-proto-files proto.
GoogleProtoFilesRoot.prototype.resolvePath = function(originPath, includePath) {
  originPath = path.normalize(originPath);
  includePath = path.normalize(includePath);

  // Fully qualified paths don't need to be resolved.
  if (path.isAbsolute(includePath)) {
    if (!fs.existsSync(includePath)) {
      throw new Error('The include `' + includePath + '` was not found.');
    }
    return includePath;
  }

  if (COMMON_PROTO_FILES.indexOf(includePath) > -1) {
    return path.join(googleProtoFilesDir, includePath);
  }

  return GoogleProtoFilesRoot._findIncludePath(originPath, includePath);
};

GoogleProtoFilesRoot._findIncludePath = function(originPath, includePath) {
  originPath = path.normalize(originPath);
  includePath = path.normalize(includePath);

  var current = originPath;
  var found = fs.existsSync(path.join(current, includePath));
  while (!found && current.length > 0) {
    current = current.substring(0, current.lastIndexOf(path.sep));
    found = fs.existsSync(path.join(current, includePath));
  }
  if (!found) {
    throw new Error('The include `' + includePath + '` was not found.');
  }
  return path.join(current, includePath);
};


text:
angular.module('openspecimen')
  .directive('osPageHeader', function($compile) {
    return {
      restrict: 'A',
      link: function(scope, element, attrs) {
        var btn = angular.element('<button/>')
          .addClass('os-nav-button')
          .append('');

        element.addClass('os-page-hdr').prepend(btn).removeAttr('os-page-header');
        element.find(":header").addClass("os-title");

        if (element.find('.os-breadcrumbs').length == 0) {
          element.addClass('no-breadcrumbs');
        }

        $compile(btn)(scope);
      }
    };
  });

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:osgi="http://www.springframework.org/schema/osgi"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">

	<bean id="listenerA"
		class="org.eclipse.gemini.blueprint.iandt.cycles.ListenerA">
		<property name="target" ref="importer" />
	</bean>

	<bean id="listenerB"
		class="org.eclipse.gemini.blueprint.iandt.cycles.ListenerB">
		<property name="target" ref="importer" />
	</bean>

	<osgi:set id="importer" interface="java.awt.Shape" cardinality="0..N">
		<osgi:reference-listener bind-method="bind" ref="listenerA" />
		<osgi:reference-listener bind-method="bind" ref="listenerB" />
	</osgi:set>
</beans>


text:
layout: page
title: Hardin Family Reunion
date: 2016-05-24
author: Janet Potts
tags: weekly links, java
status: published
summary: Phasellus lorem lacus, tincidunt at.
banner: images/banner/people.jpg
booking:
  startDate: 10/04/2017
  endDate: 10/05/2017
  ctyhocn: SBDMAHX
  groupCode: HFR
published: true
---
Vestibulum sed sapien ut ex pharetra eleifend quis non eros. Ut euismod, justo et vehicula viverra, nisl lorem vehicula augue, nec hendrerit diam lorem ac metus. Ut vehicula ultrices ipsum, quis consectetur mauris. Aliquam gravida dignissim molestie. Integer suscipit est odio. Integer eu consequat erat, eget sodales nunc. Suspendisse posuere fringilla nulla vitae vulputate.
Nullam gravida nibh vitae tellus vehicula, ac consectetur dolor feugiat. Ut ultricies laoreet diam, ac pellentesque orci lobortis eget. Praesent eu quam at nulla cursus feugiat a nec nunc. Aliquam vitae sapien ligula. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nulla rhoncus dictum nisi, quis ornare tellus mattis vel. Donec ante massa, dapibus ac fringilla ut, viverra vel libero. Morbi congue dolor nec risus sollicitudin elementum. Sed mi est, semper sit amet quam ac, efficitur blandit metus. Phasellus nec arcu quis turpis viverra placerat.

* Curabitur id risus molestie massa pellentesque molestie at nec nisi
* Aenean mollis nibh eu erat maximus consequat
* Donec ultrices velit congue dui sagittis auctor
* Aliquam in augue sit amet tortor fermentum vestibulum in id tellus
* Etiam interdum magna ac tincidunt tristique.

Quisque fringilla, massa id auctor imperdiet, risus nisi pulvinar ipsum, sed tempor enim arcu non erat. Ut commodo, massa ut semper sollicitudin, quam mauris faucibus mauris, id fermentum enim magna et purus. Phasellus sodales odio eu convallis laoreet. Donec ac faucibus enim, ac malesuada metus. Etiam bibendum lacinia arcu quis auctor. Integer ac augue turpis. Praesent nec dui eu elit aliquet convallis at ac odio. Nunc eget rutrum dolor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque euismod in nulla non fringilla. Ut posuere ligula nec orci blandit, at scelerisque leo sollicitudin. Nulla interdum sapien leo, ut dignissim nunc scelerisque sit amet. Sed ut ultricies risus. Aenean auctor scelerisque vehicula. Pellentesque facilisis eleifend magna a ornare.


text:
package cn.lambdalib.cgui.gui.component;

import java.util.*;

import cn.lambdalib.cgui.gui.Widget;
import cn.lambdalib.cgui.gui.event.GuiEvent;
import cn.lambdalib.util.generic.MathUtils;
import com.google.common.collect.ImmutableList;

/**
 * Component that can hold widgets itself and display them as a list. Only Widgets fully in the area will be shown.
 * You can add Widgets both before adding the component and in runtime.
 * @author WeAthFolD
 */
public class ElementList extends Component {

    private List<Widget> subWidgets = new LinkedList<>();

    /**
     * The fixed vertical spacing between widgets.
     */
    public double spacing = 0.0;

    private int progress;

    private boolean loaded = false;

    public ElementList() {
        super("ElementList");
    }

    @Override
    public void onAdded() {
        super.onAdded();

        loaded = true;
        for(Widget ww : subWidgets) {
            widget.addWidget(ww);
        }
        updateList();
    }

    public static ElementList get(Widget w) {
        return w.getComponent("ElementList");
    }

    public int getProgress() {
        return progress;
    }

    public int getMaxProgress() {
        double sum = 0.0;

        int i = subWidgets.size() - 1;
        while (i >= 0) {
            sum += subWidgets.get(i).transform.height + spacing;

            if (sum >= widget.transform.height) {
                return i == subWidgets.size() - 1 ? i : i + 1;
            }

            --i;
        }

        return 0;
    }

    public void progressNext() {
        setProgress(progress + 1);
    }

    public void progressLast() {
        setProgress(progress - 1);
    }

    public void setProgress(int newProgress) {
        newProgress = MathUtils.clampi(0, getMaxProgress(), newProgress);
        boolean shouldUpdate = loaded && progress != newProgress;
        progress = newProgress;
        if(shouldUpdate) {
            updateList();
        }
    }

    /**
     * @return A immutable list of widgets managed by this ElementList.
     */
    public List<Widget> getSubWidgets() {
        return ImmutableList.copyOf(subWidgets);
    }

    public int size() {
        return subWidgets.size();
    }

    private void updateList() {
        double sum = 0.0;
        for(Widget w : subWidgets) {
            w.transform.doesDraw = false;
        }

        for(int i = progress;
            i < subWidgets.size() &&
                    (sum + subWidgets.get(i).transform.height) <= this.widget.transform.height;
            ++i) {
            Widget w = subWidgets.get(i);

            w.transform.doesDraw = true;
            w.transform.x = 0;
            w.transform.y = sum;
            w.dirty = true;

            sum += w.transform.height + spacing;
        }
    }

    @Override
    public void onRemoved() {
        for(Widget w : subWidgets) {
            w.dispose();
        }
    }

    public static class ProgressChangedEvent implements GuiEvent  {}

    public void addWidget(Widget w) {
        preAdd(w);
        subWidgets.add(w);
        postAdd(w);
    }

    /**
     * Add this widget before the given widget. If the given widget is not in the list, append to the end.
     */
    public void addWidgetAfter(Widget pivot, Widget... ws) {
        for(Widget w : ws) preAdd(w);

        ListIterator<Widget> itr = subWidgets.listIterator();
        boolean added = false;
        while(itr.hasNext()) {
            Widget iw = itr.next();
            if(iw == pivot) {
                for(Widget w : ws) itr.add(w);
                added = true;
                break;
            }
        }
        if(!added) {
            Collections.addAll(subWidgets, ws);
        }

        for(Widget w : ws) postAdd(w);
    }

    private void preAdd(Widget w) {
        w.needCopy = false; // As it's handled by the component, copying leads to chaos
    }

    private void postAdd(Widget w) {
        if (loaded) {
            widget.addWidget(w);
            updateList();
        }
    }

    public double getFullHeight() {
        return sumHeight(0, subWidgets.size());
    }

    public boolean shouldScroll() {
        return widget.transform.height < getFullHeight();
    }

    /**
     * from inclusive, to exclusive
     */
    private double sumHeight(int from, int to) {
        double ret = 0.0;
        for(int i = from; i < to; ++i) {
            ret += subWidgets.get(i).transform.height;
            ret += spacing;
        }
        if(to == subWidgets.size())
            ret -= spacing;
        return ret;
    }

    public ElementList copy() {
        ElementList el = (ElementList) super.copy();
        for(Widget w : subWidgets) {
            el.addWidget(w);
        }
        return el;
    }

}


text:
// ========================================================================
// Copyright (c) 2009 Intalio, Inc.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
// You may elect to redistribute this code under either of these licenses.
// Contributors:
//    Hugues Malphettes - initial API and implementation
// ========================================================================
package org.eclipse.jetty.osgi.boot.warurl.internal;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.net.URL;
import java.net.URLConnection;
import java.security.Permission;
import java.util.List;
import java.util.Map;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;

import org.eclipse.jetty.util.IO;

/**
 * Facade for a URLConnection that will read a jar and substitute its
 * manifest by the manifest provided here.
 * <p>
 * Use Piped streams to avoid having to create temporary files.
 * </p>
 */
public class WarURLConnection extends URLConnection
{

    /**
     * Use PipedOuputStream and PipedInputStream to do the transformation without making
     * a new temporary file ust to replace the manifest.
     * @param newmanifest The new manifest
     * @param rawIn The file input stream or equivalent. not the jar input stream.
     */
    public static InputStream substitueManifest(final Manifest newmanifest,
            final InputStream rawIn) throws IOException
    {
        final PipedOutputStream pOut = new PipedOutputStream();
        PipedInputStream pIn = new PipedInputStream(pOut);
        Runnable run = new Runnable()
        {
            public void run()
            {
                JarInputStream jin = null;
                JarOutputStream dest = null;
                try
                {
                    jin = new JarInputStream(rawIn, false);
                    dest = new JarOutputStream(pOut, newmanifest);
                    ZipEntry next = jin.getNextEntry();
                    while (next != null)
                    {
                        if (next.getName().equalsIgnoreCase(JarFile.MANIFEST_NAME))
                        {
                            continue;
                        }
                        dest.putNextEntry(next);
                        if (next.getSize() > 0)
                        {
                            IO.copy(jin,dest,next.getSize());
                        }
                        next = jin.getNextJarEntry();
                    }
                }
                catch (IOException ioe) {
                    ioe.printStackTrace();
                }
                finally
                {
                    if (dest != null) IO.close(dest);
                    if (jin != null) IO.close(jin);
                    IO.close(pOut);
                }
            }
        };
        Thread th = new Thread(run);
        th.start();
        return pIn;
    }

    private Manifest _mf;
    private URLConnection _conn;

    /**
     * @param url The file url (for example)
     * @param mf The manifest to use as a replacement to the jar file inside
     * the file url.
     */
    public WarURLConnection(URL url, Manifest mf) throws IOException
    {
        super(url);
        _conn = url.openConnection();
        _mf = mf;
    }
    @Override
    public void connect() throws IOException
    {
        _conn.connect();
    }

    public InputStream getInputStream() throws IOException
    {
        return substitueManifest(_mf, _conn.getInputStream());
    }

    public void addRequestProperty(String key, String value)
    {
        _conn.addRequestProperty(key,value);
    }

    public boolean equals(Object obj)
    {
        return _conn.equals(obj);
    }

    public boolean getAllowUserInteraction()
    {
        return _conn.getAllowUserInteraction();
    }

    public int getConnectTimeout()
    {
        return _conn.getConnectTimeout();
    }

    public Object getContent() throws IOException
    {
        return _conn.getContent();
    }

    public Object getContent(Class[] classes) throws IOException
    {
        return _conn.getContent(classes);
    }

    public String getContentEncoding()
    {
        return _conn.getContentEncoding();
    }

    public int getContentLength()
    {
        return _conn.getContentLength();
    }

    public String getContentType()
    {
        return _conn.getContentType();
    }

    public long getDate()
    {
        return _conn.getDate();
    }

    public boolean getDefaultUseCaches()
    {
        return _conn.getDefaultUseCaches();
    }

    public boolean getDoInput()
    {
        return _conn.getDoInput();
    }

    public boolean getDoOutput()
    {
        return _conn.getDoOutput();
    }

    public long getExpiration()
    {
        return _conn.getExpiration();
    }

    public String getHeaderField(int n)
    {
        return _conn.getHeaderField(n);
    }

    public String getHeaderField(String name)
    {
        return _conn.getHeaderField(name);
    }

    public long getHeaderFieldDate(String name, long Default)
    {
        return _conn.getHeaderFieldDate(name,Default);
    }

    public int getHeaderFieldInt(String name, int Default)
    {
        return _conn.getHeaderFieldInt(name,Default);
    }

    public String getHeaderFieldKey(int n)
    {
        return _conn.getHeaderFieldKey(n);
    }

    public Map<String, List<String>> getHeaderFields()
    {
        return _conn.getHeaderFields();
    }

    public long getIfModifiedSince()
    {
        return _conn.getIfModifiedSince();
    }

    public long getLastModified()
    {
        return _conn.getLastModified();
    }

    public OutputStream getOutputStream() throws IOException
    {
        return _conn.getOutputStream();
    }

    public Permission getPermission() throws IOException
    {
        return _conn.getPermission();
    }

    public int getReadTimeout()
    {
        return _conn.getReadTimeout();
    }

    public Map<String, List<String>> getRequestProperties()
    {
        return _conn.getRequestProperties();
    }

    public String getRequestProperty(String key)
    {
        return _conn.getRequestProperty(key);
    }

    public URL getURL()
    {
        return _conn.getURL();
    }

    public boolean getUseCaches()
    {
        return _conn.getUseCaches();
    }

    public void setAllowUserInteraction(boolean allowuserinteraction)
    {
        _conn.setAllowUserInteraction(allowuserinteraction);
    }

    public void setConnectTimeout(int timeout)
    {
        _conn.setConnectTimeout(timeout);
    }

    public void setDefaultUseCaches(boolean defaultusecaches)
    {
        _conn.setDefaultUseCaches(defaultusecaches);
    }

    public void setDoInput(boolean doinput)
    {
        _conn.setDoInput(doinput);
    }

    public void setDoOutput(boolean dooutput)
    {
        _conn.setDoOutput(dooutput);
    }

    public void setIfModifiedSince(long ifmodifiedsince)
    {
        _conn.setIfModifiedSince(ifmodifiedsince);
    }

    public void setReadTimeout(int timeout)
    {
        _conn.setReadTimeout(timeout);
    }

    public void setRequestProperty(String key, String value)
    {
        _conn.setRequestProperty(key,value);
    }

    public void setUseCaches(boolean usecaches)
    {
        _conn.setUseCaches(usecaches);
    }

}


text:
<?php

namespace alsvanzelf\jsonapi;

class base {

/**
 * @deprecated
 * @see response::STATUS_*
 */
const STATUS_OK                    = response::STATUS_OK;
const STATUS_CREATED               = response::STATUS_CREATED;
const STATUS_NO_CONTENT            = response::STATUS_NO_CONTENT;
const STATUS_NOT_MODIFIED          = response::STATUS_NOT_MODIFIED;
const STATUS_TEMPORARY_REDIRECT    = response::STATUS_TEMPORARY_REDIRECT;
const STATUS_PERMANENT_REDIRECT    = response::STATUS_PERMANENT_REDIRECT;
const STATUS_BAD_REQUEST           = response::STATUS_BAD_REQUEST;
const STATUS_UNAUTHORIZED          = response::STATUS_UNAUTHORIZED;
const STATUS_FORBIDDEN             = response::STATUS_FORBIDDEN;
const STATUS_NOT_FOUND             = response::STATUS_NOT_FOUND;
const STATUS_METHOD_NOT_ALLOWED    = response::STATUS_METHOD_NOT_ALLOWED;
const STATUS_UNPROCESSABLE_ENTITY  = response::STATUS_UNPROCESSABLE_ENTITY;
const STATUS_INTERNAL_SERVER_ERROR = response::STATUS_INTERNAL_SERVER_ERROR;
const STATUS_SERVICE_UNAVAILABLE   = response::STATUS_SERVICE_UNAVAILABLE;

/**
 * @deprecated
 * @see response::CONTENT_TYPE_*
 */
const CONTENT_TYPE_OFFICIAL = response::CONTENT_TYPE_OFFICIAL;
const CONTENT_TYPE_DEBUG    = response::CONTENT_TYPE_DEBUG;

/**
 * @deprecated
 * @see response::ENCODE_*
 */
const ENCODE_DEFAULT = response::ENCODE_DEFAULT;
const ENCODE_DEBUG   = response::ENCODE_DEBUG;

/**
 * debug modus for non-production environments
 *
 * this is automatically set based on the display_errors directive
 * it can be overridden by setting it to a boolean value
 *
 * - encodes json with in pretty print (@see response::ENCODE_DEBUG) (*)
 * - makes browser display json instead of offering a file (@see response::CONTENT_TYPE_DEBUG) (*)
 * - outputs the error message for errors (@see error->get_array())
 * - outputs exception details for errors (@see errors->add_exception())
 *
 * @note the effects marked with an asterisk (*) are automatically turned on ..
 *       .. when requested by a human developer (request with an accept header w/o json)
 */
public static $debug = null;

/**
 * the root of the application using jsonapi
 * this is currently used to shorten filename of exception traces ..
 * .. and thus only used when ::$debug is set to true
 */
public static $appRoot = __DIR__.'/../../../../';

/**
 * base constructor for all objects
 *
 * few things are arranged here:
 * - determines ::$debug based on the display_errors directive
 */
public function __construct() {
	// set debug mode based on display_errors
	if (is_null(self::$debug)) {
		self::$debug = (bool)ini_get('display_errors');
	}

	self::$appRoot = realpath(self::$appRoot).'/';
}

/**
 * converting an object to an array
 *
 * @param  object $object by default, its public properties are used
 *                        if it is a \alsvanzelf\jsonapi\resource, its ->get_array() is used
 * @return array
 */
protected static function convert_object_to_array($object) {
	if (is_object($object) == false) {
		throw new \Exception('can only convert objects');
	}

	if ($object instanceof \alsvanzelf\jsonapi\resource) {
		return $object->get_array();
	}

	return get_object_vars($object);
}

}


text:
package com.baidu.oped.apm.bootstrap.interceptor.group;

/**
 * @author Jongho Moon
 *
 */
public enum ExecutionPolicy {
    ALWAYS,
    BOUNDARY,
    INTERNAL
}


text:
#ifndef __JUCE_HEADER_1CE33EEBC92B6F88__
#define __JUCE_HEADER_1CE33EEBC92B6F88__

//[Headers]     -- You can add your own extra header files here --
#include "JuceHeader.h"
#include "PluginProcessor.h"
//[/Headers]

//==============================================================================
/**
                                                                    //[Comments]
    An auto-generated component, created by the Introjucer.

    Describe your class and how it works here!
                                                                    //[/Comments]
*/
class HighFrequencyToneControlComponent  : public Component,
                                           public SliderListener
{
public:
    //==============================================================================
    HighFrequencyToneControlComponent ();
    ~HighFrequencyToneControlComponent();

    //==============================================================================
    //[UserMethods]     -- You can add your own custom methods in this section.
    void setProcessor(HighFrequencyToneControlAudioProcessor *p);
    //[/UserMethods]

    void paint (Graphics& g);
    void resized();
    void sliderValueChanged (Slider* sliderThatWasMoved);

private:
    //[UserVariables]   -- You can add your own custom variables in this section.
    HighFrequencyToneControlAudioProcessor *processor;
    //[/UserVariables]

    //==============================================================================
    ScopedPointer<Slider> sliderAlpha;
    ScopedPointer<Slider> sliderVolume;
    ScopedPointer<Label> label;
    ScopedPointer<Label> label2;

    //==============================================================================
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HighFrequencyToneControlComponent)
};

//[EndFile] You can add extra defines here...
//[/EndFile]

#endif   // __JUCE_HEADER_1CE33EEBC92B6F88__


text:
type Action = {
  action: () => void;
  label: string;
};

export type ActionsType = {
  cancel: Action;
  confirm: Action & {
    loading?: boolean;
  };
};

export type TransitionState = 'entering' | 'entered' | 'exiting' | 'exited' | 'unmounted';


text:
from django.conf import settings
from django.utils.translation import ugettext_lazy as _

# PATH AND URL SETTINGS

# Main Media Settings
# WARNING: FILEBROWSER_MEDIA_ROOT and FILEBROWSER_MEDIA_URL will be removed with Filebrowser 3.6.
# Read the documentation on FileBrowser's storages (http://readthedocs.org/docs/django-filebrowser/en/latest/file_storages.html)
MEDIA_ROOT = getattr(settings, "FILEBROWSER_MEDIA_ROOT", settings.MEDIA_ROOT)
MEDIA_URL = getattr(settings, "FILEBROWSER_MEDIA_URL", settings.MEDIA_URL)
# Main FileBrowser Directory. This has to be a directory within MEDIA_ROOT.
# Leave empty in order to browse all files under MEDIA_ROOT.
# DO NOT USE A SLASH AT THE BEGINNING, DO NOT FORGET THE TRAILING SLASH AT THE END.
DIRECTORY = getattr(settings, "FILEBROWSER_DIRECTORY", 'uploads/')

# EXTENSIONS AND FORMATS
# Allowed Extensions for File Upload. Lower case is important.
EXTENSIONS = getattr(settings, "FILEBROWSER_EXTENSIONS", {
    'Folder': [''],
    'Image': ['.jpg', '.jpeg', '.gif', '.png', '.tif', '.tiff'],
    'Document': ['.pdf', '.doc', '.rtf', '.txt', '.xls', '.csv', '.docx'],
    'Video': ['.mov', '.wmv', '.mpeg', '.mpg', '.avi', '.rm'],
    'Audio': ['.mp3', '.mp4', '.wav', '.aiff', '.midi', '.m4p']
})
# Define different formats for allowed selections.
# This has to be a subset of EXTENSIONS.
# e.g., add ?type=image to the browse-URL ...
SELECT_FORMATS = getattr(settings, "FILEBROWSER_SELECT_FORMATS", {
    'file': ['Folder', 'Image', 'Document', 'Video', 'Audio'],
    'image': ['Image'],
    'document': ['Document'],
    'media': ['Video', 'Audio'],
})

# VERSIONS

# Directory to Save Image Versions (and Thumbnails). Relative to site.storage.location.
# If no directory is given, versions are stored within the Image directory.
# VERSION URL: VERSIONS_BASEDIR/original_path/originalfilename_versionsuffix.extension
VERSIONS_BASEDIR = getattr(settings, 'FILEBROWSER_VERSIONS_BASEDIR', '')
# Versions Format. Available Attributes: verbose_name, width, height, opts
VERSIONS = getattr(settings, "FILEBROWSER_VERSIONS", {
    'admin_thumbnail': {'verbose_name': 'Admin Thumbnail', 'width': 60, 'height': 60, 'opts': 'crop'},
    'thumbnail': {'verbose_name': 'Thumbnail (1 col)', 'width': 176, 'height': 120, 'opts': 'crop'},
    'small': {'verbose_name': 'Small (2 col)', 'width': 284, 'height': 160, 'opts': ''},
    'medium': {'verbose_name': 'Medium (4col )', 'width': 300, 'height': '', 'opts': ''},
    'big': {'verbose_name': 'Big (6 col)', 'width': 460, 'height': '', 'opts': ''},
    'large': {'verbose_name': 'Large (8 col)', 'width': 680, 'height': '', 'opts': ''},
})
# Quality of saved versions
VERSION_QUALITY = getattr(settings, 'FILEBROWSER_VERSION_QUALITY', 90)
# Versions available within the Admin-Interface.
ADMIN_VERSIONS = getattr(settings, 'FILEBROWSER_ADMIN_VERSIONS', ['thumbnail', 'small', 'medium', 'big', 'large'])
# Which Version should be used as Admin-thumbnail.
ADMIN_THUMBNAIL = getattr(settings, 'FILEBROWSER_ADMIN_THUMBNAIL', 'admin_thumbnail')

# PLACEHOLDER

# Path to placeholder image (relative to storage location)
PLACEHOLDER = getattr(settings, "FILEBROWSER_PLACEHOLDER", "")
# Show Placeholder if the original image does not exist
SHOW_PLACEHOLDER = getattr(settings, "FILEBROWSER_SHOW_PLACEHOLDER", False)
# Always show placeholder (even if the original image exists)
FORCE_PLACEHOLDER = getattr(settings, "FILEBROWSER_FORCE_PLACEHOLDER", False)

# EXTRA SETTINGS

# If set to True, the FileBrowser will not try to import a mis-installed PIL.
STRICT_PIL = getattr(settings, 'FILEBROWSER_STRICT_PIL', False)
# PIL's Error "Suspension not allowed here" work around:
# s. http://mail.python.org/pipermail/image-sig/1999-August/000816.html
IMAGE_MAXBLOCK = getattr(settings, 'FILEBROWSER_IMAGE_MAXBLOCK', 1024*1024)
# Exclude files matching any of the following regular expressions
# Default is to exclude 'thumbnail' style naming of image-thumbnails.
EXTENSION_LIST = []
for exts in EXTENSIONS.values():
    EXTENSION_LIST += exts
EXCLUDE = getattr(settings, 'FILEBROWSER_EXCLUDE', (r'_(%(exts)s)_.*_q\d{1,3}\.(%(exts)s)' % {'exts': ('|'.join(EXTENSION_LIST))},))
# Max. Upload Size in Bytes.
MAX_UPLOAD_SIZE = getattr(settings, "FILEBROWSER_MAX_UPLOAD_SIZE", 10485760)
# Normalize filename and remove all non-alphanumeric characters
# except for underscores, spaces & dashes.
NORMALIZE_FILENAME = getattr(settings, "FILEBROWSER_NORMALIZE_FILENAME", False)
# Convert Filename (replace spaces and convert to lowercase)
CONVERT_FILENAME = getattr(settings, "FILEBROWSER_CONVERT_FILENAME", True)
# Max. Entries per Page
# Loading a Sever-Directory with lots of files might take a while
# Use this setting to limit the items shown
LIST_PER_PAGE = getattr(settings, "FILEBROWSER_LIST_PER_PAGE", 50)
# Default Sorting
# Options: date, filesize, filename_lower, filetype_checked
DEFAULT_SORTING_BY = getattr(settings, "FILEBROWSER_DEFAULT_SORTING_BY", "date")
# Sorting Order: asc, desc
DEFAULT_SORTING_ORDER = getattr(settings, "FILEBROWSER_DEFAULT_SORTING_ORDER", "desc")
# regex to clean dir names before creation
FOLDER_REGEX = getattr(settings, "FILEBROWSER_FOLDER_REGEX", r'^[\w._\ /-]+$')
# Traverse directories when searching
SEARCH_TRAVERSE = getattr(settings, "FILEBROWSER_SEARCH_TRAVERSE", False)
# Default Upload and Version Permissions
DEFAULT_PERMISSIONS = getattr(settings, "FILEBROWSER_DEFAULT_PERMISSIONS", 0o755)
# Overwrite existing files on upload
OVERWRITE_EXISTING = getattr(settings, "FILEBROWSER_OVERWRITE_EXISTING", True)

# EXTRA TRANSLATION STRINGS

# The following strings are not availabe within views or templates
_('Folder')
_('Image')
_('Video')
_('Document')
_('Audio')


text:
package io.swagger.client.model

import org.joda.time.DateTime
import java.util.UUID

case class CallControlUser (
  PhoneNumber: String,
  PhoneNumbeRegion: String,
  WhiteList: List[String],
  BlackList: List[String],
  QuietHourList: List[QuietHour],
  UseCommunityBlacklist: Boolean,
  BreakThroughQhWithMultipleCalls: Boolean,
  WhiteListBreaksQh: Boolean,
  BlockBehavior: String,
  Email: String,
  Age: Integer,
  Gender: String,
  Salutation: String,
  FirstName: String,
  MiddleName: String,
  LastName: String,
  Suffix: String

)


text:
octomap_mapping
===============

ROS stack for mapping with OctoMap, contains the octomap_server package.

The `master` branch tracks the latest (stable) releases. Please send pull requests against the latest development branch, e.g. `indigo-devel`.

Imported from SVN, see https://code.google.com/p/alufr-ros-pkg/ for the previous versions.


text:
using AutoMapper;
using HFEA.Connector.Contracts.Centre;
using HFEA.Connector.Contracts.Clients.OnlineApps;
using HFEA.Connector.Contracts.OnlineApps;
using HFEA.Connector.Global;
using HFEA.Connector.Service.BaseClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace HFEA.Connector.Service.Client.OnlineApps
{
    public class OnlineAppsReaderClient : BaseSdkClient, IOnlineAppsReaderClient
    {
        public OnlineAppsReaderClient(ITokenResolver tokenResolver, IHfeaLogger logger) : base(tokenResolver, logger)
        {
        }

        public virtual async Task<ApplicationDocumentControl> GetFirstPage(Guid documentId)
        {
            var res = await this.ApiClient.GetFirstPage(documentId.ToString());

            return Mapper.Map<ApplicationDocumentControl>(res);
        }

        public virtual async Task<ApplicationDocumentControl> GetNextPage(int currentPageId, Guid documentId)
        {
            var res = await this.ApiClient.GetNextPage(currentPageId.ToString(), documentId.ToString());

            return Mapper.Map<ApplicationDocumentControl>(res);
        }

        public virtual async Task<ApplicationDocumentControl> GetPreviousPage(int currentPageId, Guid documentId)
        {
            var res = await this.ApiClient.GetPreviousPage(currentPageId.ToString(), documentId.ToString());

            return Mapper.Map<ApplicationDocumentControl>(res);
        }

        public virtual async Task<ApplicationDocumentControl> JumpToPage(int currentPageId, Guid documentId, int distanceFromCurrent)
        {
            var res = await this.ApiClient.JumpToPage(currentPageId.ToString(), documentId.ToString(), distanceFromCurrent.ToString());

            return Mapper.Map<ApplicationDocumentControl>(res);
        }

        public virtual async Task<List<ApplicationDocumentControlValidation>> GetPageValidation(int pageId)
        {
            var validation = await this.ApiClient.GetPageValidation(pageId.ToString());

            return Mapper.Map<List<ApplicationDocumentControlValidation>>(validation);
        }

        public virtual async Task<UserApplication> GetUserApplicationByAppId(int id)
        {
            var apps = await this.GetAllCentreApplications();

            if (apps != null)
            {
                return apps.FirstOrDefault(x => x.ApplicationID == id);
            }

            return null;
        }

        public virtual async Task<UserApplication> GetUserApplicationByUserAppId(Guid id)
        {
            var app = await this.ApiClient.GetUserApplication(id.ToString());
            return Mapper.Map<UserApplication>(app);
        }

        public async Task<ApplicationDocumentControl> GetPageById(int pageId, Guid documentId)
        {
            return await JumpToPage(pageId, documentId, 0);
        }

        public async Task<UserControl> GetPageData(int pageId, Guid documentId)
        {
            var res = await this.ApiClient.GetPageData(pageId.ToString(), documentId.ToString());

            return Mapper.Map<UserControl>(res);
        }

        public async Task<List<UserApplication>> GetAllCentreApplications()
        {
            var apps = await this.ApiClient.GetAllCentreApplications();

            return (Mapper.Map<IEnumerable<UserApplication>>(apps)).ToList();
        }

        public async Task<List<UserApplication>> GetCentreSubmittedApplications()
        {
            var apps = await this.ApiClient.GetCentreSubmittedApplications();

            return (Mapper.Map<IEnumerable<UserApplication>>(apps)).ToList();
        }

        public async Task<List<UserApplication>> GetCentreCompletedApplications()
        {
            var apps = await this.ApiClient.GetCentreCompletedApplications();

            return (Mapper.Map<IEnumerable<UserApplication>>(apps)).ToList();
        }

        public async Task<List<UserApplication>> GetCentreEditingApplications()
        {
            var apps = await this.ApiClient.GetCentreEditingApplications();

            return (Mapper.Map<IEnumerable<UserApplication>>(apps)).ToList();
        }

        public async Task<List<ApplicationDocumentControl>> GetDocumentValidation(Guid documentId)
        {
            var apps = await this.ApiClient.GetValidation(documentId.ToString());

            return Mapper.Map<List<ApplicationDocumentControl>>(apps);
        }

        public async Task<List<Application>> GetAllApplicationInfo()
        {
            var apps = await this.ApiClient.GetApplicationMenu();

            return Mapper.Map<List<Application>>(apps);
        }

        public async Task<byte[]> GetFileBytes(string blobName)
        {
            byte[] result = await this.ApiClient.DownloadFile(blobName);

            return result;
        }
    }
}


text:
.class final Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;
.super Ljava/lang/Object;
.source "PhoneWindow.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/policy/impl/PhoneWindow;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1a
    name = "PanelFeatureState"
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;
    }
.end annotation

# instance fields
.field background:I

.field createdPanelView:Landroid/view/View;

.field decorView:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

.field featureId:I

.field frozenActionViewState:Landroid/os/Bundle;

.field frozenMenuState:Landroid/os/Bundle;

.field fullBackground:I

.field gravity:I

.field iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

.field isCompact:Z

.field isHandled:Z

.field isInExpandedMode:Z

.field isOpen:Z

.field isPrepared:Z

.field listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

.field listPresenterTheme:I

.field menu:Lcom/android/internal/view/menu/MenuBuilder;

.field public qwertyMode:Z

.field refreshDecorView:Z

.field refreshMenuContent:Z

.field shownPanelView:Landroid/view/View;

.field wasLastExpanded:Z

.field wasLastOpen:Z

.field windowAnimations:I

.field x:I

.field y:I

# direct methods
.method constructor <init>(I)V
    .locals 1
    .parameter "featureId"

    .prologue
    .line 3335
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    .line 3336
    iput p1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->featureId:I

    .line 3338
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->refreshDecorView:Z

    .line 3339
    return-void
.end method

# virtual methods
.method applyFrozenState()V
    .locals 2

    .prologue
    .line 3471
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->frozenMenuState:Landroid/os/Bundle;

    if-eqz v0, :cond_0

    .line 3472
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->frozenMenuState:Landroid/os/Bundle;

    invoke-virtual {v0, v1}, Lcom/android/internal/view/menu/MenuBuilder;->restorePresenterStates(Landroid/os/Bundle;)V

    .line 3473
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->frozenMenuState:Landroid/os/Bundle;

    .line 3475
    :cond_0
    return-void
.end method

.method public clearMenuPresenters()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 3360
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    if-eqz v0, :cond_0

    .line 3361
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    invoke-virtual {v0, v1}, Lcom/android/internal/view/menu/MenuBuilder;->removeMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V

    .line 3362
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    invoke-virtual {v0, v1}, Lcom/android/internal/view/menu/MenuBuilder;->removeMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V

    .line 3364
    :cond_0
    iput-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    .line 3365
    iput-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    .line 3366
    return-void
.end method

.method getIconMenuView(Landroid/content/Context;Lcom/android/internal/view/menu/MenuPresenter$Callback;)Lcom/android/internal/view/menu/MenuView;
    .locals 3
    .parameter "context"
    .parameter "cb"

    .prologue
    .line 3423
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    if-nez v1, :cond_0

    const/4 v0, 0x0

    .line 3434
    :goto_0
    return-object v0

    .line 3425
    :cond_0
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    if-nez v1, :cond_1

    .line 3426
    new-instance v1, Lcom/android/internal/view/menu/IconMenuPresenter;

    invoke-direct {v1, p1}, Lcom/android/internal/view/menu/IconMenuPresenter;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    .line 3427
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    invoke-virtual {v1, p2}, Lcom/android/internal/view/menu/IconMenuPresenter;->setCallback(Lcom/android/internal/view/menu/MenuPresenter$Callback;)V

    .line 3428
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    const v2, #id@icon_menu_presenter#t

    invoke-virtual {v1, v2}, Lcom/android/internal/view/menu/IconMenuPresenter;->setId(I)V

    .line 3429
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    invoke-virtual {v1, v2}, Lcom/android/internal/view/menu/MenuBuilder;->addMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V

    .line 3432
    :cond_1
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->decorView:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    invoke-virtual {v1, v2}, Lcom/android/internal/view/menu/IconMenuPresenter;->getMenuView(Landroid/view/ViewGroup;)Lcom/android/internal/view/menu/MenuView;

    move-result-object v0

    .line 3434
    .local v0, result:Lcom/android/internal/view/menu/MenuView;
    goto :goto_0
.end method

.method getListMenuView(Landroid/content/Context;Lcom/android/internal/view/menu/MenuPresenter$Callback;)Lcom/android/internal/view/menu/MenuView;
    .locals 4
    .parameter "context"
    .parameter "cb"

    .prologue
    .line 3399
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    if-nez v1, :cond_0

    const/4 v0, 0x0

    .line 3419
    :goto_0
    return-object v0

    .line 3401
    :cond_0
    iget-boolean v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->isCompact:Z

    if-nez v1, :cond_1

    .line 3402
    invoke-virtual {p0, p1, p2}, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->getIconMenuView(Landroid/content/Context;Lcom/android/internal/view/menu/MenuPresenter$Callback;)Lcom/android/internal/view/menu/MenuView;

    .line 3405
    :cond_1
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    if-nez v1, :cond_2

    .line 3406
    new-instance v1, Lcom/android/internal/view/menu/ListMenuPresenter;

    const v2, #layout@list_menu_item_layout#t

    iget v3, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listPresenterTheme:I

    invoke-direct {v1, v2, v3}, Lcom/android/internal/view/menu/ListMenuPresenter;-><init>(II)V

    iput-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    .line 3408
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    invoke-virtual {v1, p2}, Lcom/android/internal/view/menu/ListMenuPresenter;->setCallback(Lcom/android/internal/view/menu/MenuPresenter$Callback;)V

    .line 3409
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    const v2, #id@list_menu_presenter#t

    invoke-virtual {v1, v2}, Lcom/android/internal/view/menu/ListMenuPresenter;->setId(I)V

    .line 3410
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    invoke-virtual {v1, v2}, Lcom/android/internal/view/menu/MenuBuilder;->addMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V

    .line 3413
    :cond_2
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    if-eqz v1, :cond_3

    .line 3414
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    invoke-virtual {v2}, Lcom/android/internal/view/menu/IconMenuPresenter;->getNumActualItemsShown()I

    move-result v2

    invoke-virtual {v1, v2}, Lcom/android/internal/view/menu/ListMenuPresenter;->setItemIndexOffset(I)V

    .line 3417
    :cond_3
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->decorView:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    invoke-virtual {v1, v2}, Lcom/android/internal/view/menu/ListMenuPresenter;->getMenuView(Landroid/view/ViewGroup;)Lcom/android/internal/view/menu/MenuView;

    move-result-object v0

    .line 3419
    .local v0, result:Lcom/android/internal/view/menu/MenuView;
    goto :goto_0
.end method

.method public hasPanelItems()Z
    .locals 3

    .prologue
    const/4 v1, 0x1

    const/4 v2, 0x0

    .line 3346
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->shownPanelView:Landroid/view/View;

    if-nez v0, :cond_1

    move v1, v2

    .line 3352
    :cond_0
    :goto_0
    return v1

    .line 3347
    :cond_1
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->createdPanelView:Landroid/view/View;

    if-nez v0, :cond_0

    .line 3349
    iget-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->isCompact:Z

    if-nez v0, :cond_2

    iget-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->isInExpandedMode:Z

    if-eqz v0, :cond_4

    .line 3350
    :cond_2
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    invoke-virtual {v0}, Lcom/android/internal/view/menu/ListMenuPresenter;->getAdapter()Landroid/widget/ListAdapter;

    move-result-object v0

    invoke-interface {v0}, Landroid/widget/ListAdapter;->getCount()I

    move-result v0

    if-lez v0, :cond_3

    move v0, v1

    :goto_1
    move v1, v0

    goto :goto_0

    :cond_3
    move v0, v2

    goto :goto_1

    .line 3352
    :cond_4
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->shownPanelView:Landroid/view/View;

    check-cast v0, Landroid/view/ViewGroup;

    invoke-virtual {v0}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v0

    if-gtz v0, :cond_0

    move v1, v2

    goto :goto_0
.end method

.method public isInListMode()Z
    .locals 1

    .prologue
    .line 3342
    iget-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->isInExpandedMode:Z

    if-nez v0, :cond_0

    iget-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->isCompact:Z

    if-eqz v0, :cond_1

    :cond_0
    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method onRestoreInstanceState(Landroid/os/Parcelable;)V
    .locals 3
    .parameter "state"

    .prologue
    const/4 v2, 0x0

    .line 3452
    move-object v0, p1

    check-cast v0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;

    .line 3453
    .local v0, savedState:Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;
    iget v1, v0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;->featureId:I

    iput v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->featureId:I

    .line 3454
    iget-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;->isOpen:Z

    iput-boolean v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->wasLastOpen:Z

    .line 3455
    iget-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;->isInExpandedMode:Z

    iput-boolean v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->wasLastExpanded:Z

    .line 3456
    iget-object v1, v0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;->menuState:Landroid/os/Bundle;

    iput-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->frozenMenuState:Landroid/os/Bundle;

    .line 3465
    iput-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->createdPanelView:Landroid/view/View;

    .line 3466
    iput-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->shownPanelView:Landroid/view/View;

    .line 3467
    iput-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->decorView:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    .line 3468
    return-void
.end method

.method onSaveInstanceState()Landroid/os/Parcelable;
    .locals 3

    .prologue
    .line 3438
    new-instance v0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;-><init>(Lcom/android/internal/policy/impl/PhoneWindow$1;)V

    .line 3439
    .local v0, savedState:Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;
    iget v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->featureId:I

    iput v1, v0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;->featureId:I

    .line 3440
    iget-boolean v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->isOpen:Z

    iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;->isOpen:Z

    .line 3441
    iget-boolean v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->isInExpandedMode:Z

    iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;->isInExpandedMode:Z

    .line 3443
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    if-eqz v1, :cond_0

    .line 3444
    new-instance v1, Landroid/os/Bundle;

    invoke-direct {v1}, Landroid/os/Bundle;-><init>()V

    iput-object v1, v0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;->menuState:Landroid/os/Bundle;

    .line 3445
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    iget-object v2, v0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState$SavedState;->menuState:Landroid/os/Bundle;

    invoke-virtual {v1, v2}, Lcom/android/internal/view/menu/MenuBuilder;->savePresenterStates(Landroid/os/Bundle;)V

    .line 3448
    :cond_0
    return-object v0
.end method

.method setMenu(Lcom/android/internal/view/menu/MenuBuilder;)V
    .locals 2
    .parameter "menu"

    .prologue
    .line 3385
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    if-ne p1, v0, :cond_1

    .line 3396
    :cond_0
    :goto_0
    return-void

    .line 3387
    :cond_1
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    if-eqz v0, :cond_2

    .line 3388
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    invoke-virtual {v0, v1}, Lcom/android/internal/view/menu/MenuBuilder;->removeMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V

    .line 3389
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    invoke-virtual {v0, v1}, Lcom/android/internal/view/menu/MenuBuilder;->removeMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V

    .line 3391
    :cond_2
    iput-object p1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->menu:Lcom/android/internal/view/menu/MenuBuilder;

    .line 3392
    if-eqz p1, :cond_0

    .line 3393
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    if-eqz v0, :cond_3

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->iconMenuPresenter:Lcom/android/internal/view/menu/IconMenuPresenter;

    invoke-virtual {p1, v0}, Lcom/android/internal/view/menu/MenuBuilder;->addMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V

    .line 3394
    :cond_3
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listMenuPresenter:Lcom/android/internal/view/menu/ListMenuPresenter;

    invoke-virtual {p1, v0}, Lcom/android/internal/view/menu/MenuBuilder;->addMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V

    goto :goto_0
.end method

.method setStyle(Landroid/content/Context;)V
    .locals 3
    .parameter "context"

    .prologue
    const/4 v2, 0x0

    .line 3369
    sget-object v1, Lcom/android/internal/R$styleable;->Theme:[I

    invoke-virtual {p1, v1}, Landroid/content/Context;->obtainStyledAttributes([I)Landroid/content/res/TypedArray;

    move-result-object v0

    .line 3370
    .local v0, a:Landroid/content/res/TypedArray;
    const/16 v1, 0x2e

    invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getResourceId(II)I

    move-result v1

    iput v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->background:I

    .line 3372
    const/16 v1, 0x2f

    invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getResourceId(II)I

    move-result v1

    iput v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->fullBackground:I

    .line 3374
    const/16 v1, 0x5d

    invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getResourceId(II)I

    move-result v1

    iput v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->windowAnimations:I

    .line 3376
    const/16 v1, 0xe5

    invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v1

    iput-boolean v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->isCompact:Z

    .line 3378
    const/16 v1, 0xe7

    const v2, #style@Theme.ExpandedMenu#t

    invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getResourceId(II)I

    move-result v1

    iput v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$PanelFeatureState;->listPresenterTheme:I

    .line 3381
    invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

    .line 3382
    return-void
.end method


text:
package generic

import (
	"github.com/Jeffail/benthos/v3/internal/bundle"
	"github.com/Jeffail/benthos/v3/internal/component/tracer"
	"github.com/Jeffail/benthos/v3/internal/docs"
)

func init() {
	_ = bundle.AllTracers.Add(func(c tracer.Config) (tracer.Type, error) {
		return noopTracer{}, nil
	}, docs.ComponentSpec{
		Name:    "none",
		Type:    docs.TypeTracer,
		Status:  docs.StatusStable,
		Summary: `Do not send tracing events anywhere.`,
		Config:  docs.FieldComponent().HasType(docs.FieldTypeObject),
	})
}

//------------------------------------------------------------------------------

type noopTracer struct{}

func (n noopTracer) Close() error {
	return nil
}


text:
describe('ilEnableHasFocus directive', function() {
  'use strict';

  var scope, compileAndDigest;

  var html = '
<input ' +
      'ng-repeat="item in list" ' +
      'il-list="list" ' +
      'il-enable-has-focus ' +
      'il-increase-on="$ilList.hasFocus()" ' +
      'il-decrease-on="!$ilList.hasFocus() && $ilList.emptyView()" ' +
      'ng-model="item.v" ' +
      'il-item-model ' +
      'title="i{{$index}}" ' +
      '>
';

  beforeEach(module('incrementalList'));

  beforeEach(inject(function($rootScope, $compile) {
    scope = $rootScope.$new();
    compileAndDigest = function(html) {
      var element = angular.element(html);
      $compile(element)(scope);
      scope.$digest();

      return element;
    };
  }));

  it('increases the list by focusing on the only input', function() {
    scope.list = [];
    var element = compileAndDigest(html);
    var inputs = element.find('input');
    expect(inputs).to.have.length(1);
    inputs.eq(0).triggerHandler('focus');
    inputs = element.find('input');
    expect(inputs).to.have.length(2);
  });

  it('increases the list by focusing on the last input', function() {
    scope.list = [{v: '0'}, {v: '1'}, {v: '2'}, {v: ''}];
    var initialLength = scope.list.length;
    var element = compileAndDigest(html);
    var inputs = element.find('input');
    expect(inputs).to.have.length(initialLength);
    inputs.eq(-1).triggerHandler('focus');
    inputs = element.find('input');
    expect(inputs).to.have.length(initialLength + 1);
  });

  it('decreases the list when focused outside the list (blurred)', inject(function($timeout) {
    scope.list = [{v: '0'}, {v: '1'}, {v: ''}, {v: ''}, {v: ''}, {v: ''}];
    var initialLength = scope.list.length;
    var element = compileAndDigest(html);
    var inputs = element.find('input');
    expect(inputs).to.have.length(initialLength);

    inputs.eq(-2).triggerHandler('focus');
    inputs = element.find('input');
    expect(inputs).to.have.length(initialLength);

    inputs.eq(-2).triggerHandler('blur');
    inputs.eq(3).triggerHandler('focus');
    $timeout.verifyNoPendingTasks();
    inputs = element.find('input');
    expect(inputs).to.have.length(initialLength - 1);
  }));

  it('decreases the list when focused outside the list (blurred)', inject(function($timeout) {
    scope.list = [{v: '0'}, {v: '1'}, {v: ''}, {v: ''}, {v: ''}, {v: ''}];
    var initialLength = scope.list.length;
    var element = compileAndDigest(html);
    var inputs = element.find('input');
    expect(inputs).to.have.length(initialLength);

    inputs.eq(-2).triggerHandler('focus');
    inputs = element.find('input');
    expect(inputs).to.have.length(initialLength);

    inputs.eq(-2).triggerHandler('blur');
    $timeout.flush();
    inputs = element.find('input');
    expect(inputs).to.have.length(initialLength - 3);
  }));
});


text:
.pragma library

var BG_COLOR = "black";
var LANDSCAPE_WIDTH = 800;
var LANDSCAPE_HEIGHT = 230;
var PORTRAIT_WIDTH = 480;
var PORTRAIT_HEIGHT = 320;

var landscapeWidth =  62;
var landscapeWidthNarrow = 62;
var landscapeHeight = 36;
var landscapeMargin = 4;
var landscapeMarginNarrow = 4;
var portraitWidth = 43;
var portraitWidthNarrow = 38;
var portraitHeight = 64;
var portraitMargin = 5;
var portraitMarginNarrow = 5;

var PORTRAIT_NARROW_OTT_WIDTH = 60;
var PORTRAIT_OTT_WIDTH = 88;
var PORTRAIT_NARRROW_SHIFT_WIDTH = 38;
var PORTRAIT_SHIFT_WIDTH = 56;
var FONT_SIZE_RUSSIAN = 18;

var FONT_SIZE = 28;
var TEXT_COLOR = "white";
var FONT_SIZE_POPPER = 56;
var TEXT_COLOR_POPPER = "black";

var FLICK_CLOSE_DISTANCE = 60;


text:
package com.amazonaws.blox.dataservice.api;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.when;

import com.amazonaws.blox.dataservice.mapper.ApiModelMapper;
import com.amazonaws.blox.dataservice.model.Environment;
import com.amazonaws.blox.dataservice.model.EnvironmentId;
import com.amazonaws.blox.dataservice.model.EnvironmentRevision;
import com.amazonaws.blox.dataservice.repository.EnvironmentRepository;
import com.amazonaws.blox.dataservicemodel.v1.exception.InternalServiceException;
import com.amazonaws.blox.dataservicemodel.v1.exception.ResourceNotFoundException;
import com.amazonaws.blox.dataservicemodel.v1.model.wrappers.DeleteEnvironmentRequest;
import com.amazonaws.blox.dataservicemodel.v1.model.wrappers.DeleteEnvironmentResponse;
import java.util.Collections;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.StrictStubs.class)
public class DeleteEnvironmentApiTest {

  @Mock private EnvironmentRepository environmentRepository;
  @Mock private ApiModelMapper apiModelMapper;
  @Mock private EnvironmentId environmentId;
  @Mock private com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentId wrapperEnvironmentId;
  @Mock private Environment environment;
  @Mock private com.amazonaws.blox.dataservicemodel.v1.model.Environment wrapperEnvironment;
  @Mock private EnvironmentRevision environmentRevision;
  @Mock private ResourceNotFoundException resourceNotFoundException;

  private DeleteEnvironmentRequest deleteEnvironmentRequest;
  private DeleteEnvironmentApi deleteEnvironmentApi;

  @Before
  public void setup() {
    deleteEnvironmentApi = new DeleteEnvironmentApi(apiModelMapper, environmentRepository);
    deleteEnvironmentRequest =
        DeleteEnvironmentRequest.builder()
            .environmentId(wrapperEnvironmentId)
            .forceDelete(true)
            .build();
    when(apiModelMapper.toModelEnvironmentId(wrapperEnvironmentId)).thenReturn(environmentId);
    when(apiModelMapper.toWrapperEnvironment(environment)).thenReturn(wrapperEnvironment);
  }

  @Test
  public void testDeleteEnvironmentSuccess() throws Exception {
    when(environmentRepository.listEnvironmentRevisions(environmentId))
        .thenReturn(Collections.singletonList(environmentRevision));
    doNothing().when(environmentRepository).deleteEnvironmentRevision(environmentRevision);
    when(environmentRepository.getEnvironment(environmentId)).thenReturn(environment);
    doNothing().when(environmentRepository).deleteEnvironment(environmentId);

    final DeleteEnvironmentResponse deleteEnvironmentResponse =
        deleteEnvironmentApi.deleteEnvironment(deleteEnvironmentRequest);
    assertEquals(wrapperEnvironment, deleteEnvironmentResponse.getEnvironment());
  }

  @Test(expected = ResourceNotFoundException.class)
  public void testDeleteEnvironmentResourceNotFoundException() throws Exception {
    when(environmentRepository.getEnvironment(environmentId)).thenThrow(resourceNotFoundException);

    deleteEnvironmentApi.deleteEnvironment(deleteEnvironmentRequest);
  }

  @Test(expected = InternalServiceException.class)
  public void testDeleteEnvironmentInternalServiceException() throws Exception {
    when(environmentRepository.listEnvironmentRevisions(environmentId))
        .thenReturn(Collections.singletonList(environmentRevision));
    doThrow(InternalServiceException.class)
        .when(environmentRepository)
        .deleteEnvironmentRevision(environmentRevision);

    deleteEnvironmentApi.deleteEnvironment(deleteEnvironmentRequest);
  }

  @Test(expected = InternalServiceException.class)
  public void testDeleteEnvironmentUnhandledException() throws Exception {
    when(environmentRepository.listEnvironmentRevisions(environmentId))
        .thenReturn(Collections.singletonList(environmentRevision));
    doThrow(NullPointerException.class)
        .when(environmentRepository)
        .deleteEnvironmentRevision(environmentRevision);

    deleteEnvironmentApi.deleteEnvironment(deleteEnvironmentRequest);
  }
}


text:
package states;

import game.Game;
import gfx.Assets;
import gfx.SpriteSheet;

import java.awt.*;
import java.awt.image.BufferedImage;

public class MenuState extends States{
    private BufferedImage img;
    private SpriteSheet button;
    private static final int buttonWidth = 254;
    private static final int buttonHeight = 80;
    private int startRow = 0;
    private int exitRow = 0;
    private int highscoresRow = 0;

    public MenuState(Game game) {
        super(game);
        img = Assets.background;
        button = Assets.button;
    }

    @Override
    public void tick() {
        if (game.getMouseHandler().getMouseX() >= 260
                && game.getMouseHandler().getMouseX() < 260 + buttonWidth
                && game.getMouseHandler().getMouseY() > 260
                && game.getMouseHandler().getMouseY() < 260 + buttonHeight) {
            startRow = 1;
            if (game.getMouseHandler().isLeftPressed())
            {
                StateManager.setState(game.gameState);
            }
        } else {
            startRow = 0;
        }

        if (game.getMouseHandler().getMouseX() >= 260
                && game.getMouseHandler().getMouseX() < 260 + buttonWidth
                && game.getMouseHandler().getMouseY() > 360
                && game.getMouseHandler().getMouseY() < 360 + buttonHeight) {
            exitRow = 1;
            if (game.getMouseHandler().isLeftPressed())
            {
                System.exit(0);
            }
        } else {
            exitRow = 0;
        }

        if (game.getMouseHandler().getMouseX() >= 260
                && game.getMouseHandler().getMouseX() < 260 + buttonWidth
                && game.getMouseHandler().getMouseY() > 460
                && game.getMouseHandler().getMouseY() < 460 + buttonHeight) {
            highscoresRow = 1;
            if (game.getMouseHandler().isLeftPressed())
            {
                StateManager.setState(game.highscoreState);
            }
        } else {
            highscoresRow = 0;
        }
    }

    @Override
    public void render(Graphics g) {
        g.drawImage(img, 0, 0, game.getWidth(), game.getHeight(), null);
        g.drawImage(this.button.crop(0, buttonHeight * startRow, buttonWidth, buttonHeight), 260, 260, null);
        g.setFont(new Font("TimesRoman", Font.ITALIC, 60));
        g.drawString("The Vegetarian Dog",145,150);
        g.setFont(new Font("TimesRoman", Font.BOLD, 20));
        g.drawString("Start new game", 315, 305);
        g.drawImage(this.button.crop(0, buttonHeight * exitRow, buttonWidth, buttonHeight), 260, 360, null);
        g.drawString("Exit", 375, 405);
        g.drawImage(this.button.crop(0, buttonHeight * highscoresRow, buttonWidth, buttonHeight), 260, 460, null);
        g.drawString("Highscores", 340, 505);
    }
}


text:
/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package agent.frida.model.impl;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.RejectedExecutionException;

import org.apache.commons.lang3.exception.ExceptionUtils;

import agent.frida.frida.FridaClient;
import agent.frida.manager.FridaManager;
import agent.frida.manager.impl.FridaManagerImpl;
import agent.frida.model.AbstractFridaModel;
import agent.frida.model.iface2.FridaModelTargetProcess;
import agent.frida.model.iface2.FridaModelTargetSession;
import ghidra.async.AsyncUtils;
import ghidra.dbg.DebuggerModelClosedReason;
import ghidra.dbg.DebuggerObjectModelWithMemory;
import ghidra.dbg.error.DebuggerModelTerminatingException;
import ghidra.dbg.target.TargetMemory;
import ghidra.dbg.target.TargetObject;
import ghidra.dbg.target.schema.AnnotatedSchemaContext;
import ghidra.dbg.target.schema.TargetObjectSchema;
import ghidra.program.model.address.*;

public class FridaModelImpl extends AbstractFridaModel implements DebuggerObjectModelWithMemory {
	// The model must convert to and from Ghidra's address space names
	protected static final String SPACE_NAME = "ram";

	protected static final AnnotatedSchemaContext SCHEMA_CTX = new AnnotatedSchemaContext();
	protected static final TargetObjectSchema ROOT_SCHEMA =
		SCHEMA_CTX.getSchemaForClass(FridaModelTargetRootImpl.class);

	// Don't make this static, so each model has a unique "Frida" space
	protected final AddressSpace space =
		new GenericAddressSpace(SPACE_NAME, 64, AddressSpace.TYPE_RAM, 0);
	protected final AddressFactory addressFactory =
		new DefaultAddressFactory(new AddressSpace[] { space });

	protected FridaManager manager;
	protected FridaModelTargetSession session;

	protected final FridaModelTargetRootImpl root;
	protected final CompletableFuture<FridaModelTargetRootImpl> completedRoot;

	protected Map<Object, TargetObject> objectMap = new HashMap<>();

	public FridaModelImpl() {
		this.manager = FridaManager.newInstance();
		this.root = new FridaModelTargetRootImpl(this, ROOT_SCHEMA);
		this.completedRoot = CompletableFuture.completedFuture(root);
		addModelRoot(root);
	}

	@Override
	public String getBrief() {
		return "FRIDA@" + Integer.toHexString(System.identityHashCode(this));
	}

	@Override
	public AddressSpace getAddressSpace(String name) {
		if (!SPACE_NAME.equals(name)) {
			return null;
		}
		return space;
	}

	@Override
	public AddressFactory getAddressFactory() {
		return addressFactory;
	}

	@Override
	public CompletableFuture<Void> startFrida(String[] args) {
		return manager.start(args).thenApplyAsync(__ -> null, clientExecutor);
	}

	@Override
	public boolean isRunning() {
		return manager.isRunning();
	}

	@Override
	public void terminate() throws IOException {
		listeners.fire.modelClosed(DebuggerModelClosedReason.NORMAL);
		root.invalidateSubtree(root, "Frida is terminating");
		manager.terminate();
	}

	@Override
	public TargetObjectSchema getRootSchema() {
		return root.getSchema();
	}

	@Override
	public CompletableFuture<? extends TargetObject> fetchModelRoot() {
		return completedRoot;
	}

	@Override
	public FridaManagerImpl getManager() {
		return (FridaManagerImpl) manager;
	}

	@Override
	public CompletableFuture<Void> close() {
		try {
			terminate();
			return super.close();
		}
		catch (RejectedExecutionException e) {
			reportError(this, "Model is already closing", e);
			return AsyncUtils.NIL;
		}
		catch (Throwable t) {
			return CompletableFuture.failedFuture(t);
		}
	}

	@Override
	public FridaModelTargetSession getSession() {
		return session;
	}

	@Override
	public TargetMemory getMemory(TargetObject target, Address address, int length) {
		if (target instanceof FridaModelTargetProcess) {
			FridaModelTargetProcess process = (FridaModelTargetProcess) target;
			return new FridaModelTargetMemoryContainerImpl(process);
		}
		return null;
	}

	@Override
	public void addModelObject(Object object, TargetObject targetObject) {
		if (object == null) {
			return;
		}
		objectMap.put(FridaClient.getModelKey(object), targetObject);
	}

	@Override
	public TargetObject getModelObject(Object object) {
		if (object == null) {
			return null;
		}
		return objectMap.get(FridaClient.getModelKey(object));
	}

	public void deleteModelObject(Object object) {
		if (object == null) {
			return;
		}
		objectMap.remove(FridaClient.getModelKey(object));
	}

	@Override
	public <T> CompletableFuture<T> gateFuture(CompletableFuture<T> future) {
		return super.gateFuture(future).exceptionally(ex -> {
			for (Throwable cause = ex; cause != null; cause = cause.getCause()) {
				if (cause instanceof RejectedExecutionException) {
					throw new DebuggerModelTerminatingException("Frida is terminating", ex);
				}
			}
			return ExceptionUtils.rethrow(ex);
		});
	}

}


text:
package io.github.movementspeed.nhglib.core.ecs.components.graphics;

import com.artemis.Component;
import com.badlogic.gdx.graphics.Camera;

/**
 * Created by Fausto Napoli on 03/03/2017.
 */
public class CameraComponent extends Component {
    public Camera camera;
    public Type type;

    public enum Type {
        PERSPECTIVE,
        ORTHOGRAPHIC;

        public static CameraComponent.Type fromString(String value) {
            CameraComponent.Type type = null;

            if (value.contentEquals("perspective")) {
                type = PERSPECTIVE;
            } else if (value.contentEquals("orthographic")) {
                type = ORTHOGRAPHIC;
            }

            return type;
        }
    }
}


text:
require('babel-polyfill');

global.$ = global.jQuery = require('jquery');
global._ = require('lodash');

global.React = require('react');
global.ReactDOM = require('react-dom');
global.PropTypes = require('prop-types');;

require('./styleguide');
require('./styleguide-react');
require('./pivotal-ui-components');

$(function() {
  $('[data-code-to-copy]').each(function() {
    var $el = $(this);
    var copyText = $el.find('pre').text();
    /* eslint-disable react/jsx-no-undef */
    ReactDOM.render(<CopyToClipboardButton {...{text: copyText}}/>, $el.parent().find('.btn-copy')[0]);
    /* eslint-enable react/jsx-no-undef */
  });
});


text:
aws ecr get-login --no-include-email | bash

#docker push 954636985443.dkr.ecr.us-west-2.amazonaws.com/pipelineai/predict-gpu:1.5.0
#docker push 954636985443.dkr.ecr.us-west-2.amazonaws.com/pipelineai/predict-cpu:1.5.0

docker push pipelineai/predict-gpu:1.5.0
docker push pipelineai/predict-cpu:1.5.0

#docker push gcr.io/flux-capacitor1/pipelineai/predict-gpu:1.5.0
#docker push gcr.io/flux-capacitor1/pipelineai/predict-cpu:1.5.0

#docker push pipelineai.azurecr.io/pipelineai/predict-gpu:1.5.0
#docker push pipelineai.azurecr.io/pipelineai/predict-cpu:1.5.0

#docker push 954636985443.dkr.ecr.us-west-2.amazonaws.com/pipelineai/predict-python-gpu:1.5.0
#docker push 954636985443.dkr.ecr.us-west-2.amazonaws.com/pipelineai/predict-python-cpu:1.5.0

#docker push pipelineai/predict-python-gpu:1.5.0
#docker push pipelineai/predict-python-cpu:1.5.0


text:
"""Dynamic visualization of Theano graphs.

Author: Christof Angermueller <cangermueller@gmail.com>
"""
from __future__ import absolute_import, print_function, division

import os
import json
import shutil
import six
from six import iteritems

from theano.d3viz.formatting import PyDotFormatter

__path__ = os.path.dirname(os.path.realpath(__file__))

def replace_patterns(x, replace):
    """Replace `replace` in string `x`.

    Parameters
    ----------
    s : str
        String on which function is applied
    replace : dict
        `key`, `value` pairs where key is a regular expression and `value` a
        string by which `key` is replaced
    """
    for from_, to in iteritems(replace):
        x = x.replace(str(from_), str(to))
    return x

def safe_json(obj):
    """Encode `obj` to JSON so that it can be embedded safely inside HTML.

    Parameters
    ----------
    obj : object
        object to serialize
    """
    return json.dumps(obj).replace('<', '\\u003c')

def d3viz(fct, outfile, copy_deps=True, *args, **kwargs):
    """Create HTML file with dynamic visualizing of a Theano function graph.

    In the HTML file, the whole graph or single nodes can be moved by drag and
    drop. Zooming is possible via the mouse wheel. Detailed information about
    nodes and edges are displayed via mouse-over events. Node labels can be
    edited by selecting Edit from the context menu.

    Input nodes are colored in green, output nodes in blue. Apply nodes are
    ellipses, and colored depending on the type of operation they perform. Red
    ellipses are transfers from/to the GPU (ops with names GpuFromHost,
    HostFromGpu).

    Edges are black by default. If a node returns a view of an
    input, the input edge will be blue. If it returns a destroyed input, the
    edge will be red.

    Parameters
    ----------
    fct : theano.compile.function_module.Function
        A compiled Theano function, variable, apply or a list of variables.
    outfile : str
        Path to output HTML file.
    copy_deps : bool, optional
        Copy javascript and CSS dependencies to output directory.

    Notes
    -----
    This function accepts extra parameters which will be forwarded to
    :class:`theano.d3viz.formatting.PyDotFormatter`.

    """

    # Create DOT graph
    formatter = PyDotFormatter(*args, **kwargs)
    graph = formatter(fct)
    dot_graph = graph.create_dot()
    if not six.PY2:
        dot_graph = dot_graph.decode('utf8')

    # Create output directory if not existing
    outdir = os.path.dirname(outfile)
    if not outdir == '' and not os.path.exists(outdir):
        os.makedirs(outdir)

    # Read template HTML file
    template_file = os.path.join(__path__, 'html', 'template.html')
    with open(template_file) as f:
        template = f.read()

    # Copy dependencies to output directory
    src_deps = __path__
    if copy_deps:
        dst_deps = 'd3viz'
        for d in ['js', 'css']:
            dep = os.path.join(outdir, dst_deps, d)
            if not os.path.exists(dep):
                shutil.copytree(os.path.join(src_deps, d), dep)
    else:
        dst_deps = src_deps

    # Replace patterns in template
    replace = {
        '%% JS_DIR %%': os.path.join(dst_deps, 'js'),
        '%% CSS_DIR %%': os.path.join(dst_deps, 'css'),
        '%% DOT_GRAPH %%': safe_json(dot_graph),
    }
    html = replace_patterns(template, replace)

    # Write HTML file
    with open(outfile, 'w') as f:
        f.write(html)

def d3write(fct, path, *args, **kwargs):
    """Convert Theano graph to pydot graph and write to dot file.

    Parameters
    ----------
    fct : theano.compile.function_module.Function
        A compiled Theano function, variable, apply or a list of variables.
    path: str
        Path to output file

    Notes
    -----
    This function accepts extra parameters which will be forwarded to
    :class:`theano.d3viz.formatting.PyDotFormatter`.

    """

    formatter = PyDotFormatter(*args, **kwargs)
    graph = formatter(fct)
    graph.write_dot(path)


text:
/*
	This is just a fast checksum to replace the old CRC32, nothing much here.
	It hashes 4x4 (16) bytes at a time then merges them at the end.
*/

#ifndef CHECKSUM_H
#define CHECKSUM_H

#include "format.hpp"

class Checksum
{
private:
	inline unsigned int Load32(unsigned char *p);

public:
	unsigned int IntegrityCheck(Buffer Input);
};
#endif // CHECKSUM_H