text:
#ifndef WFAPI_LOCATION_UPDATE_INFORMATION_H
#define WFAPI_LOCATION_UPDATE_INFORMATION_H

#include "WFAPIConfig.h"
#include "WGS84Coordinate.h"
#include "GpsQualityEnum.h"

namespace WFAPI {

/**
 * An update of current whereabouts that is precise enough to
 * be a point.
 *
 * Received in LocationListener call back function.
 */
class LocationUpdateInformation
{

public:

   /**
    * Default constructor. The Positions will be invalid and the quality
    * missing. Other parameters will be 0.
    */
   LocationUpdateInformation();

   /**
    * Constructor.
    *
    * @param position The position.
    * @param altitude The altitude in meters.
    * @param heading The heading in degrees.
    * @param gpsQuality The quality of the position.
    * @param speed The speed in km/h.
    * @param routePosition The current position snapped to the route.
    * @param routeHeading The current heading snapped to the route.
    */
   LocationUpdateInformation(const WGS84Coordinate& position,
                             wf_int32 altitude,
                             wf_uint16 heading,
                             GpsQualityEnum gpsQuality,
                             wf_uint16 speed,
                             const WGS84Coordinate& routePosition,
                             wf_uint16 routeHeading);

   /**
    * Copy constructor
    */
   LocationUpdateInformation(const LocationUpdateInformation& locationUpdateInformation);

   /**
    * Destructor.
    */
   virtual ~LocationUpdateInformation();

   /**
    *   Assignment operator.
    */
   LocationUpdateInformation& operator=(const LocationUpdateInformation& rhs);

   /**
    * Get the altitude.
    *
    * @return The altitude in meters.
    */
   wf_int32 getAltitude() const;

   /**
    * Get the heading.
    *
    * @return The heading in degrees.
    */
   wf_uint16 getHeading() const;

   /**
    * Get the PDOP value.
    *
    * @return The PDOP.
    */
   GpsQualityEnum getGpsQuality() const;

   /**
    * Get the position.
    *
    * @return The coordinate of the current position.
    */
   WGS84Coordinate getPosition() const;

   /**
    * Get the speed.
    *
    * @return The speed in km/h.
    */
   wf_uint16 getSpeed() const;

   /**
    * Gets the snapped position. This position could be used
    * when setting current position in the map during a route.
    * The postion has been snapped to the route and follows the red
    * line in a more precise way.
    *
    * @return The snapped position.
    */
   WGS84Coordinate getRoutePosition() const;

   /**
    * Gets the snapped heading. This heading should be used if using
    * the route position when setting current position in the map during
    * a route.
    *
    * @return The snapped heading.
    */
   wf_uint16 getRouteHeading() const;

private:

   /// The altitude.
   wf_int32 m_altitude;

   /**
    * Heading in degrees.
    */
   wf_uint16 m_heading;

   /**
    * The gps quality, can be found in GpsQualityEnum.h
    */
   GpsQualityEnum m_gpsQuality;

   /**
    * The position.
    */
   WGS84Coordinate m_position;

   /**
    * The speed.
    */
   wf_uint16 m_speed;

   /// The snapped postion, the postion is snapped to the route.
   WGS84Coordinate m_routePosition;

   /// The snapped heading, snapped to the route.
   wf_uint16 m_routeHeading;
};

} // End namespace WFAPI

#endif // End WFAPI_LOCATION_UPDATE_INFORMATION_H


text:
package main

import (
	"fmt"
	"os"

	"github.com/cloudflare/cfssl/csr"
	"github.com/spf13/cobra"
)

type options struct {
	configFile string
	keyFile    string
	force      bool
}

type CertificateRequest struct {
	CN         string          `json:"CN" yaml:"CN"`
	Names      []csr.Name      `json:"names" yaml:"names"`
	Hosts      []string        `json:"hosts" yaml:"hosts"`
	KeyRequest *csr.KeyRequest `json:"key,omitempty" yaml:"key,omitempty"`
}

func main() {
	opts := &options{}
	rootCmd := &cobra.Command{
		Use:          "ssltool",
		Short:        "ssltool",
		Long:         "ssltool",
		SilenceUsage: true,
	}

	fs := rootCmd.PersistentFlags()
	fs.StringVarP(&opts.configFile, "conf", "c", "./ssltool.yml", "config")
	fs.StringVarP(&opts.keyFile, "keyFile", "k", "", "key file")
	fs.BoolVarP(&opts.force, "force", "f", false, "force")

	rootCmd.AddCommand(
		newCaCmd(opts),
		newEtcdCmd(opts),
		newHttpCmd(opts),
	)

	if err := rootCmd.Execute(); err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
}

redpajama_set_name: RedPajamaGithub


text:
"""
pg_hba_resolver - read pg_hba.conf and resolve DNS names to addresses

Copyright (C) 2016, https://aiven.io/
This file is under the Apache License, Version 2.0.
See http://www.apache.org/licenses/LICENSE-2.0 for details.

Read pg_hba.conf and look for comment lines ending with a '# RESOLVE' tag:

Hostnames on such lines are looked up and pg_hba.conf is updated with
uncommented versions of such lines with the hostname replaced by the
resolved address.

Existing entries for the same names are removed if the name no longer
resolves to them.  Postgres is reloaded by sending SIGHUP to the postmaster
if there are any changes.
"""

import os
import re
import signal
import socket
import sys

def update_hba(hba_filename, pid_filename=None):
    with open(hba_filename, "r") as fp:
        orig_hba = fp.read().splitlines()

    template_re = re.compile(r"^\s*#\s*(host[nosl]*\s+\S+\s+\S+\s+(\S+)\s+.*?)\s*#\s*RESOLVE\s*$")
    last_host_comment = None
    addrmap = {}
    new_hba = []

    for line in orig_hba:
        if last_host_comment and line.endswith(last_host_comment):
            continue  # Drop all previous entries for this host

        # All other lines are included as-is in the config
        new_hba.append(line)

        # If the line matches our template for resolving, look up the host and add all addresses
        match = template_re.match(line)
        if not match:
            continue

        entry = match.group(1)
        hostname = match.group(2)
        if hostname not in addrmap:
            try:
                addrs = socket.getaddrinfo(hostname, 5432, socket.AF_INET, 0, socket.IPPROTO_TCP)
                addrmap[hostname] = sorted(res[4][0] for res in addrs)
            except socket.gaierror:
                print("Unable to resolve {!r}".format(hostname))
                addrmap[hostname] = []

        last_host_comment = " # RESOLVED: {}".format(hostname)
        for addr in addrmap[hostname]:
            new_hba.append(entry.replace(hostname, addr + "/32") + last_host_comment)

    if not addrmap:
        name_list = "no names"
    else:
        name_list = ", ".join("{!r}".format(name) for name in sorted(addrmap))

    if new_hba == orig_hba:
        print("Looked up {}: no changes to {!r} required".format(name_list, hba_filename))
        return

    print("Looked up {}: updating {}".format(name_list, hba_filename))
    for line in sorted(set(orig_hba) - set(new_hba)):
        print("-{}".format(line))
    for line in sorted(set(new_hba) - set(orig_hba)):
        print("+{}".format(line))

    with open(hba_filename, "w") as fp:
        fp.write("\n".join(new_hba))
        fp.write("\n")

    if not pid_filename:
        pid_filename = os.path.join(os.path.dirname(hba_filename), "postmaster.pid")

    if not os.path.exists(pid_filename):
        print("No {!r} found, not reloading postmaster".format(pid_filename))
        return

    with open(pid_filename, "r") as fp:
        pid = int(fp.read().splitlines()[0])
    print("Sending SIGHUP to postmaster process {!r}".format(pid))
    os.kill(pid, signal.SIGHUP)

def main(args):
    update_hba(hba_filename=args[0], pid_filename=args[1] if len(args) > 1 else None)

if __name__ == "__main__":
    sys.exit(main(sys.argv[1:]))


text:
using Amazon.Lambda.Core;
using System;
using System.Collections.Generic;
using ThirdParty.Json.LitJson;

namespace Amazon.Lambda.RuntimeSupport
{
    internal class CognitoClientContext : IClientContext
    {
        public IDictionary<string, string> Environment { get; internal set; }

        public IClientApplication Client { get; internal set; }

        public IDictionary<string, string> Custom { get; internal set; }

        internal static CognitoClientContext FromJson(string json)
        {
            var result = new CognitoClientContext();

            if (!string.IsNullOrWhiteSpace(json))
            {
                var jsonData = JsonMapper.ToObject(json);

                if (jsonData["client"] != null)
                    result.Client = CognitoClientApplication.FromJsonData(jsonData["client"]);
                if (jsonData["custom"] != null)
                    result.Custom = GetDictionaryFromJsonData(jsonData["custom"]);
                if (jsonData["env"] != null)
                    result.Environment = GetDictionaryFromJsonData(jsonData["env"]);
            }
            return result;
        }

        private static IDictionary<string, string> GetDictionaryFromJsonData(JsonData jsonData)
        {
            var result = new Dictionary<string, string>();

            foreach (var key in jsonData.PropertyNames)
            {
                result.Add(key, jsonData[key].ToString());
            }

            return result;
        }
    }
}


text:
package libvirt

/*
#cgo pkg-config: libvirt
#include <stdlib.h>
#include "network_wrapper.h"
#include "network_port_wrapper.h"
*/
import "C"

import (
	"unsafe"
)

type NetworkPortCreateFlags int

const (
	NETWORK_PORT_CREATE_RECLAIM = NetworkPortCreateFlags(C.VIR_NETWORK_PORT_CREATE_RECLAIM)
)

type NetworkPort struct {
	ptr C.virNetworkPortPtr
}

// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortFree
func (n *NetworkPort) Free() error {
	if C.LIBVIR_VERSION_NUMBER < 5005000 {
		return makeNotImplementedError("virNetworkPortFree")
	}

	var err C.virError
	ret := C.virNetworkPortFreeWrapper(n.ptr, &err)
	if ret == -1 {
		return makeError(&err)
	}
	return nil
}

// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortRef
func (c *NetworkPort) Ref() error {
	if C.LIBVIR_VERSION_NUMBER < 5005000 {
		return makeNotImplementedError("virNetworkPortRef")
	}

	var err C.virError
	ret := C.virNetworkPortRefWrapper(c.ptr, &err)
	if ret == -1 {
		return makeError(&err)
	}
	return nil
}

// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetNetwork
//
// Contrary to the native C API behaviour, the Go API will
// acquire a reference on the returned Network, which must
// be released by calling Free()
func (n *NetworkPort) GetNetwork() (*Network, error) {
	var err C.virError
	ptr := C.virNetworkPortGetNetworkWrapper(n.ptr, &err)
	if ptr == nil {
		return nil, makeError(&err)
	}

	ret := C.virNetworkRefWrapper(ptr, &err)
	if ret == -1 {
		return nil, makeError(&err)
	}

	return &Network{ptr: ptr}, nil
}

// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetUUID
func (n *NetworkPort) GetUUID() ([]byte, error) {
	if C.LIBVIR_VERSION_NUMBER < 5005000 {
		return []byte{}, makeNotImplementedError("virNetworkPortGetUUID")
	}

	var cUuid [C.VIR_UUID_BUFLEN](byte)
	cuidPtr := unsafe.Pointer(&cUuid)
	var err C.virError
	result := C.virNetworkPortGetUUIDWrapper(n.ptr, (*C.uchar)(cuidPtr), &err)
	if result != 0 {
		return []byte{}, makeError(&err)
	}
	return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil
}

// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetUUIDString
func (n *NetworkPort) GetUUIDString() (string, error) {
	if C.LIBVIR_VERSION_NUMBER < 5005000 {
		return "", makeNotImplementedError("virNetworkPortGetUUIDString")
	}

	var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char)
	cuidPtr := unsafe.Pointer(&cUuid)
	var err C.virError
	result := C.virNetworkPortGetUUIDStringWrapper(n.ptr, (*C.char)(cuidPtr), &err)
	if result != 0 {
		return "", makeError(&err)
	}
	return C.GoString((*C.char)(cuidPtr)), nil
}

// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortDelete
func (n *NetworkPort) Delete(flags uint) error {
	if C.LIBVIR_VERSION_NUMBER < 5005000 {
		return makeNotImplementedError("virNetworkPortDelete")
	}

	var err C.virError
	result := C.virNetworkPortDeleteWrapper(n.ptr, C.uint(flags), &err)
	if result == -1 {
		return makeError(&err)
	}
	return nil
}

// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetXMLDesc
func (d *NetworkPort) GetXMLDesc(flags uint) (string, error) {
	if C.LIBVIR_VERSION_NUMBER < 5005000 {
		return "", makeNotImplementedError("virNetworkPortDelete")
	}

	var err C.virError
	result := C.virNetworkPortGetXMLDescWrapper(d.ptr, C.uint(flags), &err)
	if result == nil {
		return "", makeError(&err)
	}
	xml := C.GoString(result)
	C.free(unsafe.Pointer(result))
	return xml, nil
}

type NetworkPortParameters struct {
	BandwidthInAverageSet  bool
	BandwidthInAverage     uint
	BandwidthInPeakSet     bool
	BandwidthInPeak        uint
	BandwidthInBurstSet    bool
	BandwidthInBurst       uint
	BandwidthInFloorSet    bool
	BandwidthInFloor       uint
	BandwidthOutAverageSet bool
	BandwidthOutAverage    uint
	BandwidthOutPeakSet    bool
	BandwidthOutPeak       uint
	BandwidthOutBurstSet   bool
	BandwidthOutBurst      uint
}

func getNetworkPortParametersFieldInfo(params *NetworkPortParameters) map[string]typedParamsFieldInfo {
	return map[string]typedParamsFieldInfo{
		C.VIR_NETWORK_PORT_BANDWIDTH_IN_AVERAGE: typedParamsFieldInfo{
			set: &params.BandwidthInAverageSet,
			ui:  &params.BandwidthInAverage,
		},
		C.VIR_NETWORK_PORT_BANDWIDTH_IN_PEAK: typedParamsFieldInfo{
			set: &params.BandwidthInPeakSet,
			ui:  &params.BandwidthInPeak,
		},
		C.VIR_NETWORK_PORT_BANDWIDTH_IN_BURST: typedParamsFieldInfo{
			set: &params.BandwidthInBurstSet,
			ui:  &params.BandwidthInBurst,
		},
		C.VIR_NETWORK_PORT_BANDWIDTH_IN_FLOOR: typedParamsFieldInfo{
			set: &params.BandwidthInFloorSet,
			ui:  &params.BandwidthInFloor,
		},
		C.VIR_NETWORK_PORT_BANDWIDTH_OUT_AVERAGE: typedParamsFieldInfo{
			set: &params.BandwidthOutAverageSet,
			ui:  &params.BandwidthOutAverage,
		},
		C.VIR_NETWORK_PORT_BANDWIDTH_OUT_PEAK: typedParamsFieldInfo{
			set: &params.BandwidthOutPeakSet,
			ui:  &params.BandwidthOutPeak,
		},
		C.VIR_NETWORK_PORT_BANDWIDTH_OUT_BURST: typedParamsFieldInfo{
			set: &params.BandwidthOutBurstSet,
			ui:  &params.BandwidthOutBurst,
		},
	}
}

// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetParameters
func (d *NetworkPort) GetParameters(flags uint) (*NetworkPortParameters, error) {
	if C.LIBVIR_VERSION_NUMBER < 5005000 {
		return nil, makeNotImplementedError("virNetworkPortGetParameters")
	}

	params := &NetworkPortParameters{}
	info := getNetworkPortParametersFieldInfo(params)

	var cparams C.virTypedParameterPtr
	var cnparams C.int
	var err C.virError
	ret := C.virNetworkPortGetParametersWrapper(d.ptr, &cparams, &cnparams, C.uint(flags), &err)
	if ret == -1 {
		return nil, makeError(&err)
	}

	defer C.virTypedParamsFree(cparams, cnparams)

	_, gerr := typedParamsUnpack(cparams, cnparams, info)
	if gerr != nil {
		return nil, gerr
	}

	return params, nil
}

// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortSetParameters
func (d *NetworkPort) SetParameters(params *NetworkPortParameters, flags uint) error {
	if C.LIBVIR_VERSION_NUMBER < 5005000 {
		return makeNotImplementedError("virNetworkPortSetParameters")
	}

	info := getNetworkPortParametersFieldInfo(params)

	cparams, cnparams, gerr := typedParamsPackNew(info)
	if gerr != nil {
		return gerr
	}
	defer C.virTypedParamsFree(cparams, cnparams)

	var err C.virError
	ret := C.virNetworkPortSetParametersWrapper(d.ptr, cparams, cnparams, C.uint(flags), &err)
	if ret == -1 {
		return makeError(&err)
	}

	return nil
}


text:
"use strict";

/**
 * Main entry point
 */

function Classing (name, descriptors) {
  return Classing.create(name, descriptors);
}

module.exports = exports = Classing;

/**
 * Make a class with the given property descriptors.
 *
 * @param  {Object}   descriptors An object containing the property descriptors for the class.
 * @return {Function}             The created class.
 */
Classing.create = function (name, descriptors) {
  if (name && typeof name === 'string') {
    descriptors = descriptors || {};
  }
  else {
    descriptors = name || {};
    name = 'Class';
  }

  var Class = this.makeConstructor(name);

  this.makeStatic(Class, descriptors);
  this.makePrototype(Class, descriptors);

  return Class;
};

/**
 * Make a constructor for a class.
 *
 * @param  {String} name The name of the class.
 * @return {Function}    The constructor function.
 */
Classing.makeConstructor = function (name) {
  var body = 'return function ' + name + ' (config) {' +
             '  if (!(this instanceof ' + name + ')) {' +
             '    return new ' + name + '(config);' +
             '  }' +
             '  this.applyDefaults();' +
             '  if (config) { this.configure(config); }' +
             '  this.initialize();' +
             '};';
  return new Function(body)(); // jshint ignore:line
};

/**
 * Make the static methods for a class.
 *
 * @param  {Function} Class        The class itself.
 * @param  {Object}   descriptors  The property descriptors for the class.
 */
Classing.makeStatic = function (Class, descriptors) {
  var Classing = this; // to allow subclassing
  Object.defineProperties(Class, {
    /**
     * Create a new instance of the class.
     */
    create: {
      configurable: true,
      value: function (properties) {
        return new Class(properties);
      }
    },
    /**
     * Get the descriptors of the class.
     */
    descriptors: {
      value: descriptors
    },
    /**
     * Define a new property on the class.
     */
    defineProperty: {
      configurable: true,
      value: function (name, descriptor, skipReload) {
        descriptor = descriptor || {value: null};
        if (typeof descriptor === 'function') {
          // this is a method
          descriptor = {
            enumerable: false,
            configurable: true,
            writable: true,
            value: descriptor
          };
        }

        if (descriptor.value === undefined && !(descriptor.get || descriptor.set)) {
          descriptor.value = null;
        }

        if (descriptor.writable == null && descriptor.value !== undefined) {
          descriptor.writable = true;
        }
        if (descriptor.enumerable == null) {
          descriptor.enumerable = true;
        }
        if (descriptor.configurable == null) {
          descriptor.configurable = true;
        }
        descriptors[name] = descriptor;
        Object.defineProperty(this.prototype, name, descriptor);
        if (!skipReload) {
          this.updateAutoGeneratedFunctions();
        }
        return this;
      }
    },
    /**
     * Define a list of properties on the class.
     */
    defineProperties: {
      configurable: true,
      value: function (items) {
        if (!items) {
          return this;
        }
        var keys = Object.keys(items),
            total = keys.length,
            key, i;

        for (i = 0; i < total; i++) {
          key = keys[i];
          this.defineProperty(key, items[key], true);
        }
        this.updateAutoGeneratedFunctions();
        return this;
      }
    },
    /**
     * Inherit descriptors from another class.
     */
    inherits: {
      configurable: true,
      value: function (Super) {
        var keys = Object.keys(Super),
            total = keys.length,
            key, i;

        for (i = 0; i < total; i++) {
          key = keys[i];
          if (!this.hasOwnProperty(key)) {
            this[key] = Super[key];
          }
        }
        var superDescriptors = Super.descriptors || {};
        keys = Object.keys(superDescriptors);
        total = keys.length;
        for (i = 0; i < total; i++) {
          key = keys[i];
          if (!descriptors.hasOwnProperty(key)) {
            descriptors[key] = superDescriptors[key];
          }
        }
        descriptors.__super__ = {
          enumerable: false,
          value: Super.prototype
        };
        this.__super__ = Super;
        this.prototype = Object.create(Super.prototype, descriptors);
        this.prototype.constructor = this;
        // don't overwrite custom toString functions if supplied.
        if (!descriptors.hasOwnProperty('toString')) {
          Object.defineProperty(Class.prototype, 'toString', {
            configurable: true,
            writable: true,
            value: Class.makeToString(descriptors)
          });
        }
        this.updateAutoGeneratedFunctions();

        return this;
      }
    },
    /**
     * Create a new class which extends from this one.
     */
    extend: {
      configurable: true,
      value: function (name, config) {
        var Child = Classing.create(name, config);
        Child.inherits(this);
        return Child;
      }
    },
    /**
     * Mix the properties from a source object into this one.
     * @type {Object}
     */
    mixin: {
      configurable: true,
      value: function (source) {
        var keys = Object.keys(source),
            total = keys.length,
            combined = {},
            key, i;

        for (i = 0; i < total; i++) {
          key = keys[i];
          combined[key] = {
            value: source[key]
          };
        }
        this.defineProperties(combined);
        return this;
      }
    },
    /**
     * Update any autogenerated functions.
     */
    updateAutoGeneratedFunctions: {
      configurable: true,
      value: function () {
        if (!this.prototype.applyDefaults || this.prototype.applyDefaults.isAutoGenerated) {
          this.prototype.applyDefaults = this.makeApplyDefaults(descriptors);
        }
        if (!this.prototype.configure || this.prototype.configure.isAutoGenerated) {
          this.prototype.configure = this.makeConfigure(descriptors);
        }
        if (!this.prototype.toJSON || this.prototype.toJSON.isAutoGenerated) {
          this.prototype.toJSON = this.makeToJSON(descriptors);
        }
      }
    },
    /**
     * Make an efficient `applyDefaults()` function to set
     * the default property values for a class instance.
     *
     * @param  {Object} descriptors The descriptors for the object.
     * @return {Function}           The `applyDefaults()` function.
     */
    makeApplyDefaults: {
      configurable: true,
      value: function (descriptors) {
        var keys = Object.keys(descriptors),
            total = keys.length,
            body = '',
            key, descriptor, i, suffix, value;

        for (i = 0; i < total; i++) {
          key = keys[i];
          descriptor = descriptors[key];
          if (descriptor.hasOwnProperty('default')) {
            suffix = '';
            if (typeof descriptor.default === 'function') {
              suffix = '(this)';
            }
            if (/^([\w|_|$]+)$/.test(key)) {
              body += 'this.' + key + ' = this.constructor.descriptors.' + key + '.default' + suffix + ';';
            }
            else {
              body += 'this["' + key + '"] = this.constructor.descriptors["' + key + '"].default' + suffix + ';';
            }
          }
          else if (descriptor.bind) {
            if (/^([\w|_|$]+)$/.test(key)) {
              if (descriptor.bind === true) {
                value = 'this';
              }
              else {
                value = 'this.constructor.descriptors.' + key + '.bind';
              }
              body += 'this.' + key + ' = this.' + key + '.bind(' + value + ');';
            }
            else {
              if (descriptor.bind === true) {
                value = 'this';
              }
              else {
                value = 'this.constructor.descriptors["' + key + '"].bind';
              }
              body += 'this["' + key + '"] = this["' + key + '"].bind(' + value + ');';
            }
          }
        }
        var applyDefaults = new Function(body); // jshint ignore:line
        applyDefaults.isAutoGenerated = true;
        return applyDefaults;
      }
    },
    /**
     * Make an efficient `configure()` function to set property values
     * for an object based on the given descriptors.
     *
     * @param  {Object} descriptors The descriptors for the object.
     * @return {Function}           The `configure()` function.
     */
    makeConfigure: {
      configurable: true,
      value: function (descriptors) {
        var keys = Object.keys(descriptors),
            total = keys.length,
            body = '',
            key, descriptor, i;

        for (i = 0; i < total; i++) {
          key = keys[i];
          descriptor = descriptors[key];
          if (descriptor.writable || descriptor.hasOwnProperty('set')) {
            if (/^([\w|_|$]+)$/.test(key)) {
              body += 'this.' + key + ' = config.' + key + ' !== undefined ? config.' + key + ' : this.' + key + ';'; // jshint ignore:line
            }
            else {
              body += 'this["' + key + '"] = config["' + key + '"] !== undefined ? config["' + key + '"] : this["' + key + '"];'; // jshint ignore:line
            }
          }
        }
        var configure = new Function('config', body); // jshint ignore:line
        configure.isAutoGenerated = true;
        return configure;
      }
    },
    /**
     * Make an efficient `toJSON()` function for an object
     * based on the given descriptors.
     *
     * @param  {Object} descriptors The descriptors for the object.
     * @return {Function}           The `toJSON()` function.
     */
    makeToJSON: {
      configurable: true,

      value: function (descriptors) {
        var keys = Object.keys(descriptors).sort(),
            total = keys.length,
            parts = [],
            key, descriptor, i;

        for (i = 0; i < total; i++) {
          key = keys[i];
          descriptor = descriptors[key];
          if (descriptor.enumerable || descriptor.enumerable == null) {
            if (/^([\w|_|$]+)$/.test(key)) {
              parts.push(key + ': this.' + key);
            }
            else {
              parts.push('"' + key + '": this["' + key + '"]');
            }
          }
        }
        var toJSON = new Function('return {' + parts.join(',') + '};'); // jshint ignore:line
        toJSON.isAutoGenerated = true;
        return toJSON;
      }
    },
    /**
     * Make an efficient `toString()` function for the class.
     *
     * @return {Function} The `toString()` function.
     */
    makeToString: {
      configurable: true,
      value: function () {
        var fn = new Function('return "[object ' + this.name + ']";'); // jshint ignore:line
        fn.isAutoGenerated = true;
        return fn;
      }
    }
  });
};

/**
 * Make a prototype for a class, based on the given descriptors.
 *
 * @param  {Function} Class       The class itself.
 * @param  {Object} descriptors   The descriptors for the class.
 */
Classing.makePrototype = function (Class, descriptors) {
  if (!descriptors.initialize) {
    descriptors.initialize = function () {};
  }
  Class.defineProperties(descriptors);
  Class.updateAutoGeneratedFunctions();

  // don't overwrite custom toString functions if supplied.
  if (!descriptors.hasOwnProperty('toString')) {
    Object.defineProperty(Class.prototype, 'toString', {
      configurable: true,
      writable: true,
      value: Class.makeToString(descriptors)
    });
  }
};

/**
 * Extend the class factory.
 *
 * @param  {Object} descriptors The descriptors for the new class factory.
 * @return {Classing}            The class factory
 */
Classing.extend = function (descriptors) {
  descriptors = descriptors || {};

  function Child (name, descriptors) {
    return Child.create(name, descriptors);
  }

  var keys = Object.keys(this),
      total = keys.length,
      i, key;

  for (i = 0; i < total; i++) {
    key = keys[i];
    Child[key] = this[key];
  }

  keys = Object.keys(descriptors);
  total = keys.length;

  for (i = 0; i < total; i++) {
    key = keys[i];
    if (typeof descriptors[key] === "function") {
      descriptors[key] = {
        configurable: true,
        value: descriptors[key]
      };
    }
  }

  Object.defineProperties(Child, descriptors);
  Child.super = this;
  return Child;
};


text:
class afMultipleDirectoriesBrowseDialog : public acDialog
{
    Q_OBJECT

public:
    afMultipleDirectoriesBrowseDialog(QWidget* pParent = 0);
    ~afMultipleDirectoriesBrowseDialog();

    /// Directories list as string accessors:
    void SetDirectoriesList(const QString& dirList);
    QString GetDirectoriesList();

private slots:

    void OnAddDirectory();
    void OnRemoveDirectory();
    void OnUp();
    void OnDown();
    void OnDoubleClick(int row);
    void OnCurrentChanged();

private:

    void SetCurrentRow(int row);
    void SetDialogLayout();

private:

    QPushButton* m_pUpButton;
    QPushButton* m_pDownButton;
    QPushButton* m_pNewDirectoryButton;
    QPushButton* m_pRemoveDirectoryButton;

    acListCtrl* m_pDirTable;
    QTableWidgetItem* m_pLastClickedItem;
};

#endif // __AFMULTIPLEDIRECTORIESBROWSEDIALOG


text:
.class Landroid/support/v4/media/d;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/media/RemoteControlClient$OnGetPlaybackPositionListener;
.implements Landroid/media/RemoteControlClient$OnPlaybackPositionUpdateListener;

# instance fields
.field final a:Landroid/content/Context;

.field final b:Landroid/media/AudioManager;

.field final c:Landroid/view/View;

.field final d:Landroid/support/v4/media/c;

.field final e:Ljava/lang/String;

.field final f:Landroid/content/IntentFilter;

.field final g:Landroid/content/Intent;

.field final h:Landroid/view/ViewTreeObserver$OnWindowAttachListener;

.field final i:Landroid/view/ViewTreeObserver$OnWindowFocusChangeListener;

.field final j:Landroid/content/BroadcastReceiver;

.field k:Landroid/media/AudioManager$OnAudioFocusChangeListener;

.field l:Landroid/app/PendingIntent;

.field m:Landroid/media/RemoteControlClient;

.field n:Z

.field o:I

.field p:Z

# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/media/AudioManager;Landroid/view/View;Landroid/support/v4/media/c;)V
    .locals 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Landroid/support/v4/media/e;

    invoke-direct {v0, p0}, Landroid/support/v4/media/e;-><init>(Landroid/support/v4/media/d;)V

    iput-object v0, p0, Landroid/support/v4/media/d;->h:Landroid/view/ViewTreeObserver$OnWindowAttachListener;

    new-instance v0, Landroid/support/v4/media/f;

    invoke-direct {v0, p0}, Landroid/support/v4/media/f;-><init>(Landroid/support/v4/media/d;)V

    iput-object v0, p0, Landroid/support/v4/media/d;->i:Landroid/view/ViewTreeObserver$OnWindowFocusChangeListener;

    new-instance v0, Landroid/support/v4/media/g;

    invoke-direct {v0, p0}, Landroid/support/v4/media/g;-><init>(Landroid/support/v4/media/d;)V

    iput-object v0, p0, Landroid/support/v4/media/d;->j:Landroid/content/BroadcastReceiver;

    new-instance v0, Landroid/support/v4/media/h;

    invoke-direct {v0, p0}, Landroid/support/v4/media/h;-><init>(Landroid/support/v4/media/d;)V

    iput-object v0, p0, Landroid/support/v4/media/d;->k:Landroid/media/AudioManager$OnAudioFocusChangeListener;

    const/4 v0, 0x0

    iput v0, p0, Landroid/support/v4/media/d;->o:I

    iput-object p1, p0, Landroid/support/v4/media/d;->a:Landroid/content/Context;

    iput-object p2, p0, Landroid/support/v4/media/d;->b:Landroid/media/AudioManager;

    iput-object p3, p0, Landroid/support/v4/media/d;->c:Landroid/view/View;

    iput-object p4, p0, Landroid/support/v4/media/d;->d:Landroid/support/v4/media/c;

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ":transport:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-static {p0}, Ljava/lang/System;->identityHashCode(Ljava/lang/Object;)I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Landroid/support/v4/media/d;->e:Ljava/lang/String;

    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Landroid/support/v4/media/d;->e:Ljava/lang/String;

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    iput-object v0, p0, Landroid/support/v4/media/d;->g:Landroid/content/Intent;

    iget-object v0, p0, Landroid/support/v4/media/d;->g:Landroid/content/Intent;

    invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    new-instance v0, Landroid/content/IntentFilter;

    invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V

    iput-object v0, p0, Landroid/support/v4/media/d;->f:Landroid/content/IntentFilter;

    iget-object v0, p0, Landroid/support/v4/media/d;->f:Landroid/content/IntentFilter;

    iget-object v1, p0, Landroid/support/v4/media/d;->e:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    iget-object v0, p0, Landroid/support/v4/media/d;->c:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;

    move-result-object v0

    iget-object v1, p0, Landroid/support/v4/media/d;->h:Landroid/view/ViewTreeObserver$OnWindowAttachListener;

    invoke-virtual {v0, v1}, Landroid/view/ViewTreeObserver;->addOnWindowAttachListener(Landroid/view/ViewTreeObserver$OnWindowAttachListener;)V

    iget-object v0, p0, Landroid/support/v4/media/d;->c:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;

    move-result-object v0

    iget-object v1, p0, Landroid/support/v4/media/d;->i:Landroid/view/ViewTreeObserver$OnWindowFocusChangeListener;

    invoke-virtual {v0, v1}, Landroid/view/ViewTreeObserver;->addOnWindowFocusChangeListener(Landroid/view/ViewTreeObserver$OnWindowFocusChangeListener;)V

    return-void
.end method

# virtual methods
.method public a()Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    return-object v0
.end method

.method public a(ZJI)V
    .locals 3

    iget-object v0, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    if-eqz v0, :cond_0

    iget-object v2, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    if-eqz p1, :cond_1

    const/4 v0, 0x3

    move v1, v0

    :goto_0
    if-eqz p1, :cond_2

    const/high16 v0, 0x3f80

    :goto_1
    invoke-virtual {v2, v1, p2, p3, v0}, Landroid/media/RemoteControlClient;->setPlaybackState(IJF)V

    iget-object v0, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    invoke-virtual {v0, p4}, Landroid/media/RemoteControlClient;->setTransportControlFlags(I)V

    :cond_0
    return-void

    :cond_1
    const/4 v0, 0x1

    move v1, v0

    goto :goto_0

    :cond_2
    const/4 v0, 0x0

    goto :goto_1
.end method

.method public b()V
    .locals 2

    invoke-virtual {p0}, Landroid/support/v4/media/d;->k()V

    iget-object v0, p0, Landroid/support/v4/media/d;->c:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;

    move-result-object v0

    iget-object v1, p0, Landroid/support/v4/media/d;->h:Landroid/view/ViewTreeObserver$OnWindowAttachListener;

    invoke-virtual {v0, v1}, Landroid/view/ViewTreeObserver;->removeOnWindowAttachListener(Landroid/view/ViewTreeObserver$OnWindowAttachListener;)V

    iget-object v0, p0, Landroid/support/v4/media/d;->c:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;

    move-result-object v0

    iget-object v1, p0, Landroid/support/v4/media/d;->i:Landroid/view/ViewTreeObserver$OnWindowFocusChangeListener;

    invoke-virtual {v0, v1}, Landroid/view/ViewTreeObserver;->removeOnWindowFocusChangeListener(Landroid/view/ViewTreeObserver$OnWindowFocusChangeListener;)V

    return-void
.end method

.method c()V
    .locals 4

    iget-object v0, p0, Landroid/support/v4/media/d;->a:Landroid/content/Context;

    iget-object v1, p0, Landroid/support/v4/media/d;->j:Landroid/content/BroadcastReceiver;

    iget-object v2, p0, Landroid/support/v4/media/d;->f:Landroid/content/IntentFilter;

    invoke-virtual {v0, v1, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    iget-object v0, p0, Landroid/support/v4/media/d;->a:Landroid/content/Context;

    const/4 v1, 0x0

    iget-object v2, p0, Landroid/support/v4/media/d;->g:Landroid/content/Intent;

    const/high16 v3, 0x1000

    invoke-static {v0, v1, v2, v3}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v0

    iput-object v0, p0, Landroid/support/v4/media/d;->l:Landroid/app/PendingIntent;

    new-instance v0, Landroid/media/RemoteControlClient;

    iget-object v1, p0, Landroid/support/v4/media/d;->l:Landroid/app/PendingIntent;

    invoke-direct {v0, v1}, Landroid/media/RemoteControlClient;-><init>(Landroid/app/PendingIntent;)V

    iput-object v0, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    iget-object v0, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    invoke-virtual {v0, p0}, Landroid/media/RemoteControlClient;->setOnGetPlaybackPositionListener(Landroid/media/RemoteControlClient$OnGetPlaybackPositionListener;)V

    iget-object v0, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    invoke-virtual {v0, p0}, Landroid/media/RemoteControlClient;->setPlaybackPositionUpdateListener(Landroid/media/RemoteControlClient$OnPlaybackPositionUpdateListener;)V

    return-void
.end method

.method d()V
    .locals 2

    iget-boolean v0, p0, Landroid/support/v4/media/d;->n:Z

    if-nez v0, :cond_0

    const/4 v0, 0x1

    iput-boolean v0, p0, Landroid/support/v4/media/d;->n:Z

    iget-object v0, p0, Landroid/support/v4/media/d;->b:Landroid/media/AudioManager;

    iget-object v1, p0, Landroid/support/v4/media/d;->l:Landroid/app/PendingIntent;

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->registerMediaButtonEventReceiver(Landroid/app/PendingIntent;)V

    iget-object v0, p0, Landroid/support/v4/media/d;->b:Landroid/media/AudioManager;

    iget-object v1, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->registerRemoteControlClient(Landroid/media/RemoteControlClient;)V

    iget v0, p0, Landroid/support/v4/media/d;->o:I

    const/4 v1, 0x3

    if-ne v0, v1, :cond_0

    invoke-virtual {p0}, Landroid/support/v4/media/d;->e()V

    :cond_0
    return-void
.end method

.method e()V
    .locals 4

    const/4 v3, 0x1

    iget-boolean v0, p0, Landroid/support/v4/media/d;->p:Z

    if-nez v0, :cond_0

    iput-boolean v3, p0, Landroid/support/v4/media/d;->p:Z

    iget-object v0, p0, Landroid/support/v4/media/d;->b:Landroid/media/AudioManager;

    iget-object v1, p0, Landroid/support/v4/media/d;->k:Landroid/media/AudioManager$OnAudioFocusChangeListener;

    const/4 v2, 0x3

    invoke-virtual {v0, v1, v2, v3}, Landroid/media/AudioManager;->requestAudioFocus(Landroid/media/AudioManager$OnAudioFocusChangeListener;II)I

    :cond_0
    return-void
.end method

.method public f()V
    .locals 2

    const/4 v1, 0x3

    iget v0, p0, Landroid/support/v4/media/d;->o:I

    if-eq v0, v1, :cond_0

    iput v1, p0, Landroid/support/v4/media/d;->o:I

    iget-object v0, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    invoke-virtual {v0, v1}, Landroid/media/RemoteControlClient;->setPlaybackState(I)V

    :cond_0
    iget-boolean v0, p0, Landroid/support/v4/media/d;->n:Z

    if-eqz v0, :cond_1

    invoke-virtual {p0}, Landroid/support/v4/media/d;->e()V

    :cond_1
    return-void
.end method

.method public g()V
    .locals 3

    const/4 v2, 0x2

    iget v0, p0, Landroid/support/v4/media/d;->o:I

    const/4 v1, 0x3

    if-ne v0, v1, :cond_0

    iput v2, p0, Landroid/support/v4/media/d;->o:I

    iget-object v0, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    invoke-virtual {v0, v2}, Landroid/media/RemoteControlClient;->setPlaybackState(I)V

    :cond_0
    invoke-virtual {p0}, Landroid/support/v4/media/d;->i()V

    return-void
.end method

.method public h()V
    .locals 2

    const/4 v1, 0x1

    iget v0, p0, Landroid/support/v4/media/d;->o:I

    if-eq v0, v1, :cond_0

    iput v1, p0, Landroid/support/v4/media/d;->o:I

    iget-object v0, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    invoke-virtual {v0, v1}, Landroid/media/RemoteControlClient;->setPlaybackState(I)V

    :cond_0
    invoke-virtual {p0}, Landroid/support/v4/media/d;->i()V

    return-void
.end method

.method i()V
    .locals 2

    iget-boolean v0, p0, Landroid/support/v4/media/d;->p:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    iput-boolean v0, p0, Landroid/support/v4/media/d;->p:Z

    iget-object v0, p0, Landroid/support/v4/media/d;->b:Landroid/media/AudioManager;

    iget-object v1, p0, Landroid/support/v4/media/d;->k:Landroid/media/AudioManager$OnAudioFocusChangeListener;

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->abandonAudioFocus(Landroid/media/AudioManager$OnAudioFocusChangeListener;)I

    :cond_0
    return-void
.end method

.method j()V
    .locals 2

    invoke-virtual {p0}, Landroid/support/v4/media/d;->i()V

    iget-boolean v0, p0, Landroid/support/v4/media/d;->n:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    iput-boolean v0, p0, Landroid/support/v4/media/d;->n:Z

    iget-object v0, p0, Landroid/support/v4/media/d;->b:Landroid/media/AudioManager;

    iget-object v1, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->unregisterRemoteControlClient(Landroid/media/RemoteControlClient;)V

    iget-object v0, p0, Landroid/support/v4/media/d;->b:Landroid/media/AudioManager;

    iget-object v1, p0, Landroid/support/v4/media/d;->l:Landroid/app/PendingIntent;

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->unregisterMediaButtonEventReceiver(Landroid/app/PendingIntent;)V

    :cond_0
    return-void
.end method

.method k()V
    .locals 3

    const/4 v2, 0x0

    invoke-virtual {p0}, Landroid/support/v4/media/d;->j()V

    iget-object v0, p0, Landroid/support/v4/media/d;->l:Landroid/app/PendingIntent;

    if-eqz v0, :cond_0

    iget-object v0, p0, Landroid/support/v4/media/d;->a:Landroid/content/Context;

    iget-object v1, p0, Landroid/support/v4/media/d;->j:Landroid/content/BroadcastReceiver;

    invoke-virtual {v0, v1}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    iget-object v0, p0, Landroid/support/v4/media/d;->l:Landroid/app/PendingIntent;

    invoke-virtual {v0}, Landroid/app/PendingIntent;->cancel()V

    iput-object v2, p0, Landroid/support/v4/media/d;->l:Landroid/app/PendingIntent;

    iput-object v2, p0, Landroid/support/v4/media/d;->m:Landroid/media/RemoteControlClient;

    :cond_0
    return-void
.end method

.method public onGetPlaybackPosition()J
    .locals 2

    iget-object v0, p0, Landroid/support/v4/media/d;->d:Landroid/support/v4/media/c;

    invoke-interface {v0}, Landroid/support/v4/media/c;->a()J

    move-result-wide v0

    return-wide v0
.end method

.method public onPlaybackPositionUpdate(J)V
    .locals 1

    iget-object v0, p0, Landroid/support/v4/media/d;->d:Landroid/support/v4/media/c;

    invoke-interface {v0, p1, p2}, Landroid/support/v4/media/c;->a(J)V

    return-void
.end method


text:
/**
 *
 * Lecture 20 methods/while
 * Calculate compound intersest
 * Code snippet, no validation
 *
 * @pmcampbell
 * @version 2016-10-25
 *
 **/
public class CompoundInt {
    public static void main(String[] args) {

            double bal = 1000; // initial balance
            double rate = 0.08; // interest rate
            //table heading
            System.out.println("Year\t\tBalance");
            int year = 0;
            while (year <= 10) {
                System.out.println(year + "\t\t " + bal);
                    bal = bal + rate * bal; bal = Math.round(100 * bal) / 100.; year++;
                }
    }  // main()
} //CompoundInt


text: I am a class that helps simulate the StackInterpreter's stack organization.


text:
import java.util.Iterator;

/**
 * Created by TS on 03.12.15.
 */
public class Dj {
    private SongOfFemale songOfFemale;
    private SongOfMale songOfMale;
    private SongOfMale20 songOfMale20;

    private SongIterator iterFemaleSong;
    private SongIterator iterMaleSong;
    private SongIterator iterMale20Song;

    public Dj(SongIterator newFemaleSong, SongIterator newMaleSong, SongIterator newMale20Song) {

        iterFemaleSong = newFemaleSong;
        iterMaleSong = newMaleSong;
        iterMale20Song = newMale20Song;

    }

    public void showTheSongs(){
        Iterator femaleSong = iterFemaleSong.createIterator();
        Iterator maleSong = iterMaleSong.createIterator();
        Iterator male20Song = iterMale20Song.createIterator();
        System.out.println("Song of female...   ");
        printSongOfFemale(femaleSong);
        System.out.println("Song of Male...   ");
        printSongOfFemale(maleSong);
        System.out.println("Song of Male20...   ");
        printSongOfFemale(male20Song);
    }

    public void printSongOfFemale(Iterator iterator) {
        while (iterator.hasNext()){
            String song = (String) iterator.next();
            System.out.println(song);
        }
    }
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MessageRejectedWhileStoppingException.cs" company="The original author or authors.">
//   Copyright 2002-2012 the original author or authors.
//
//   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.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Spring.Messaging.Amqp.Rabbit.Listener
{
    /// <summary>
    /// Exception that indicates a rejected message on shutdown. Used to trigger a rollback for an
    /// external transaction manager in that case.
    /// </summary>
    /// <author>Dave Syer</author>
    /// <author>Joe Fitzgerald (.NET)</author>
    public class MessageRejectedWhileStoppingException : AmqpException
    {
        /// <summary>Initializes a new instance of the <see cref="MessageRejectedWhileStoppingException"/> class.</summary>
        public MessageRejectedWhileStoppingException() : base("Message listener container was stopping when a message was received") { }
    }
}


text:
// Type definitions for Auth0.js 8.10
// Project: https://github.com/auth0/auth0.js
// Definitions by: Adrian Chia <https://github.com/adrianchia>
//                 Matt Durrant <https://github.com/mdurrant>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export as namespace auth0;

export class Authentication {
    constructor(options: AuthOptions);

    passwordless: PasswordlessAuthentication;
    dbConnection: DBConnection;

    /**
     * Builds and returns the `/authorize` url in order to initialize a new authN/authZ transaction
     *
     * @param options: https://auth0.com/docs/api/authentication#!#get--authorize_db
     */
    buildAuthorizeUrl(options: any): string;

    /**
     * Builds and returns the Logout url in order to initialize a new authN/authZ transaction
     *
     * @param options: https://auth0.com/docs/api/authentication#!#get--v2-logout
     */
    buildLogoutUrl(options?: LogoutOptions): string;

    /**
     * Makes a call to the `oauth/token` endpoint with `password` grant type
     *
     * @param options: https://auth0.com/docs/api-auth/grant/password
     */
    loginWithDefaultDirectory(options: DefaultDirectoryLoginOptions, callback: Auth0Callback<any>): void;

    /**
     * Makes a call to the `/ro` endpoint
     * @deprecated `loginWithResourceOwner` will be soon deprecated, user `login` instead.
     */
    loginWithResourceOwner(options: ResourceOwnerLoginOptions, callback: Auth0Callback<any>): void;

    /**
     * Makes a call to the `oauth/token` endpoint with `password-realm` grant type
     */
    login(options: DefaultLoginOptions, callback: Auth0Callback<any>): void;

    /**
     * Makes a call to the `oauth/token` endpoint
     */
    oauthToken(options: any, callback: Auth0Callback<any>): void;

    /**
     * Makes a call to the `/ssodata` endpoint
     *
     */
    getSSOData(callback?: Auth0Callback<any>): void;

    /**
     * Makes a call to the `/ssodata` endpoint
     *
     */
    getSSOData(withActiveDirectories: boolean, callback?: Auth0Callback<any>): void;

    /**
     * Makes a call to the `/userinfo` endpoint and returns the user profile
     *
     */
    userInfo(accessToken: string, callback: Auth0Callback<Auth0UserProfile>): void;

    /**
     * Makes a call to the `/delegation` endpoint
     *
     * @param options: https://auth0.com/docs/api/authentication#!#post--delegation
     */
    delegation(options: DelegationOptions, callback: Auth0Callback<Auth0DelegationToken>): any;

    /**
     * Fetches the user country based on the ip.
     *
     */
    getUserCountry(callback: Auth0Callback<{ countryCode: string }>): void;
}

export class PasswordlessAuthentication {
    constructor(request: any, option: any);

    /**
     * Builds and returns the passwordless TOTP verify url in order to initialize a new authN/authZ transaction
     *
     */
    buildVerifyUrl(options: PasswordlessVerifyOptions): string;

    /**
     * Initializes a new passwordless authN/authZ transaction
     *
     * @param options: https://auth0.com/docs/api/authentication#passwordless
     */
    start(options: PasswordlessStartOptions, callback: Auth0Callback<any>): void;

    /**
     * Verifies the passwordless TOTP and returns an error if any.
     *
     */
    verify(options: PasswordlessVerifyOptions, callback: Auth0Callback<any>): void;
}

export class DBConnection {
    constructor(request: any, option: any);

    /**
     * Signup a new user
     *
     * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
     */
    signup(options: DbSignUpOptions, callback: Auth0Callback<any>): void;

    /**
     * Initializes the change password flow
     *
     * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password
     */
    changePassword(options: ChangePasswordOptions, callback: Auth0Callback<any>): void;
}

export class Management {
    /**
     * Initialize your client class, by using a Non Interactive Client to fetch an access_token via the Client Credentials Grant.
     */
    constructor(options: ManagementOptions);

    /**
     * Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id
     *
     */
    getUser(userId: string, callback: Auth0Callback<Auth0UserProfile>): void;

    /**
     * Updates the user metdata. It will patch the user metdata with the attributes sent.
     * https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id
     *
     */
    patchUserMetadata(userId: string, userMetadata: any, callback: Auth0Callback<Auth0UserProfile>): void;

    /**
     * Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities
     *
     */
    linkUser(userId: string, secondaryUserToken: string, callback: Auth0Callback<any>): void;
}

export class WebAuth {
    constructor(options: AuthOptions);
    client: Authentication;
    popup: Popup;
    redirect: Redirect;
    crossOriginAuthentication: CrossOriginAuthentication;

    /**
     * Redirects to the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction
     *
     * @param options: https://auth0.com/docs/api/authentication#!#get--authorize_db
     */
    authorize(options?: AuthorizeOptions): void;

    /**
     * Parse the url hash and extract the returned tokens depending on the transaction.
     *
     * Only validates id_tokens signed by Auth0 using the RS256 algorithm using the public key exposed
     * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be
     * accepted.
     *
     * @param callback: any(err, token_payload)
     */
    parseHash(callback: Auth0Callback<Auth0DecodedHash>): void;

    /**
     * Parse the url hash and extract the returned tokens depending on the transaction.
     *
     * Only validates id_tokens signed by Auth0 using the RS256 algorithm using the public key exposed
     * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be
     * accepted.
     *
     * @param callback: any(err, token_payload)
     */
    parseHash(options: ParseHashOptions, callback: Auth0Callback<Auth0DecodedHash>): void;

    /**
     * Decodes the id_token and verifies  the nonce.
     *
     * @param callback: function(err, {payload, transaction})
     */
    validateToken(token: string, nonce: string, callback: Auth0Callback<any>): void;

    /**
     * Executes a silent authentication transaction under the hood in order to fetch a new tokens for the current session.
     * This method requires that all Auth is performed with {@link authorize}
     * Watch out! If you're not using the hosted login page to do social logins, you have to use your own [social connection keys](https://manage.auth0.com/#/connections/social).
     * If you use Auth0's dev keys, you'll always get `login_required` as an error when calling this method.
     *
     * @param options: any valid oauth2 parameter to be sent to the `/authorize` endpoint
     */
    renewAuth(options: RenewAuthOptions, callback: Auth0Callback<any>): void;

    /**
     * Initialices a change password transaction
     *
     * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password
     */
    changePassword(options: ChangePasswordOptions, callback: Auth0Callback<any>): void;

    /**
     * Signs up a new user
     *
     * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
     */
    signup(options: DbSignUpOptions, callback: Auth0Callback<any>): void;

    /**
     * Signs up a new user, automatically logs the user in after the signup and returns the user token.
     * The login will be done using /oauth/token with password-realm grant type.
     *
     * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
     */
    signupAndAuthorize(options: DbSignUpOptions, callback: Auth0Callback<any>): void;

    /**
     * Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow.
     * You can use either `username` or `email` to identify the user, but `username` will take precedence over `email`.
     *
     * This only works when 3rd party cookies are enabled in the browser.
     * After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor.
     *
     * @param options options used in the {@link authorize} call after the login_ticket is acquired
     * @param cb Callback function called only when an authentication error, like invalid username or password, occurs.
     * For other types of errors, there will be a redirect to the `redirectUri`.
     */
    login(options: CrossOriginLoginOptions, callback: Auth0Callback<any>): void;

    /**
     * Runs the callback code for the cross origin authentication call. This method is meant to be called by the cross origin authentication callback url.
     *
     */
    crossOriginAuthenticationCallback(): void;

    /**
     * Redirects to the auth0 logout endpoint
     *
     * If you want to navigate the user to a specific URL after the logout, set that URL at the returnTo parameter. The URL should be included in any the appropriate Allowed Logout URLs list:
     *
     * - If the client_id parameter is included, the returnTo URL must be listed in the Allowed Logout URLs set at the client level (see Setting Allowed Logout URLs at the App Level).
     * - If the client_id parameter is NOT included, the returnTo URL must be listed in the Allowed Logout URLs set at the account level (see Setting Allowed Logout URLs at the Account Level).
     *
     * @see   {@link https://auth0.com/docs/api/authentication#logout}
     */
    logout(options: LogoutOptions): void;

    /**
     * Initialices a passwordless authentication transaction
     *
     * @param options: https://auth0.com/docs/api/authentication#passwordless
     */
    passwordlessStart(options: PasswordlessStartOptions, callback: Auth0Callback<any>): void;

    /**
     * Verifies the passwordless TOTP and redirects to finish the passwordless transaction
     *
     * @param options:
     */
    passwordlessVerify(options: PasswordlessVerifyOptions, callback: Auth0Callback<any>): void;
}

export class Redirect {
    constructor(client: any, options: any);

    /**
     * Performs authentication with username/email and password with a database connection
     *
     * This method is not compatible with API Auth so if you need to fetch API tokens with audience
     * you should use {@link authorize} or {@link login}.
     */
    loginWithCredentials(
        options: {
            /** url that the Auth0 will redirect after Auth with the Authorization Response */
            redirectUri?: string,
            /** type of the response used. It can be any of the values `code` and `token` */
            responseType?: string,
            /** how the AuthN response is encoded and redirected back to the client. */
            responseMode?: "query" | "fragment",
            /** scopes to be requested during AuthN. e.g. `openid email` */
            scope: string,
        },
        callback: Auth0Callback<any>,
    ): void;

    /**
     * Signs up a new user and automatically logs the user in after the signup.
     */
    signupAndLogin(
        options: {
            /** user email address */
            email: string,
            /** user password */
            password: string,
            /** name of the connection where the user will be created */
            connection: string,
        },
        callback: Auth0Callback<any>,
    ): void;
}

export class Popup {
    constructor(client: any, options: any);

    /**
     * Returns a new instance of the popup handler
     *
     */
    buildPopupHandler(): any;

    /**
     * Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser.
     *
     * @param options: receives the window height and width and any other window feature to be sent to window.open
     */
    preload(options: any): any;

    /**
     * Handles the popup logic for the callback page.
     * @see {@link parseHash}
     */
    callback(options: {
        /**
         * the url hash.
         * @default window.location.hash
         */
        hash: string,
        /** value originally sent in `state` parameter to {@link authorize} to mitigate XSRF */
        state?: string,
        /** value originally sent in `nonce` parameter to {@link authorize} to prevent replay attacks */
        nonce?: string,
        /**
         * makes parseHash perform or skip `id_token` verification.
         * We **strongly** recommend validating the `id_token` yourself if you disable the verification.
         */
        _idTokenVerification?: string,
    }): void;

    /**
     * Shows inside a new window the hosted login page (`/authorize`) in order to start a new authN/authZ transaction and post its result using `postMessage`.
     * @see {@link https://auth0.com/docs/api/authentication#authorize-client}
     */
    authorize(
        options: {
            /** your Auth0 domain */
            domain: string,
            /** your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard */
            clientId?: string,
            /** url that the Auth0 will redirect after Auth with the Authorization Response */
            redirectUri: string,
            /**
             * type of the response used by OAuth 2.0 flow.
             * It can be any space separated list of the values `code`, `token`, `id_token`.
             * {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0}
             */
            responseType: string,
            /**
             * how the Auth response is encoded and redirected back to the client.
             * {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes}
             */
            responseMode?: "query" | "fragment" | "form_post",
            /**
             * value used to mitigate XSRF attacks.
             * {@link https://auth0.com/docs/protocols/oauth2/oauth-state}
             */
            state?: string,
            /**
             * value used to mitigate replay attacks when using Implicit Grant.
             * {@link https://auth0.com/docs/api-auth/tutorials/nonce}
             */
            nonce?: string,
            /** scopes to be requested during Auth. e.g. `openid email` */
            scope?: string,
            /** identifier of the resource server who will consume the access token issued after Auth */
            audience?: string,
            /** determines if Auth0 should render the relay page or not and the caller is responsible of handling the response. */
            owp?: boolean,
        },
        callback: Auth0Callback<any>,
    ): void;

    /**
     * Performs authentication with username/email and password with a database connection inside a new window
     *
     * This method is not compatible with API Auth so if you need to fetch API tokens with audience
     * you should use {@link authorize} or {@link login}.
     */
    loginWithCredentials(
        options: {
            /** url that the Auth0 will redirect after Auth with the Authorization Response */
            redirectUri?: string,
            /** type of the response used. */
            responseType?: "code" | "token",
            /** how the AuthN response is encoded and redirected back to the client. */
            responseMode?: "query" | "fragment",
            /** scopes to be requested during AuthN. e.g. `openid email` */
            scope?: string,
        },
        callback: Auth0Callback<any>,
    ): void;

    /**
     * Verifies the passwordless TOTP and returns the requested token
     */
    passwordlessVerify(
        options: {
            type: "sms" | "email",
            /**  only if type = sms */
            phoneNumber?: string,
            /** only if type = email */
            email?: string,
            /** the connection name */
            connection: string,
            /** the TOTP code */
            verificationCode: string,
        },
        callback: Auth0Callback<any>,
    ): void;

    /**
     * Signs up a new user and automatically logs the user in after the signup.
     *
     * This method is not compatible with API Auth so if you need to fetch API tokens with audience
     * you should use {@link authorize} or {@link signupAndAuthorize}.
     */
    signupAndLogin(
        options: {
            /** user email address */
            email: string,
            /** user password */
            password: string,
            /** name of the connection where the user will be created */
            connection: string,
        },
        callback: Auth0Callback<any>,
    ): void;
}

export class CrossOriginAuthentication {
    constructor(webAuth: any, options: any);

    /**
     * Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow.
     * You can use either `username` or `email` to identify the user, but `username` will take precedence over `email`.
     * This only works when 3rd party cookies are enabled in the browser.
     * After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor.
     *
     * @param options options used in the {@link authorize} call after the login_ticket is acquired
     * @param cb Callback function called only when an authentication error, like invalid username or password, occurs.
     * For other types of errors, there will be a redirect to the `redirectUri`.
     */
    login(options: CrossOriginLoginOptions, callback: Auth0Callback<any>): void;

    /**
     * Runs the callback code for the cross origin authentication call. This method is meant to be called by the cross origin authentication callback url.
     *
     */
    callback(): void;
}

export type Auth0Callback<T> = (error: null | Auth0Error, result: T) => void;

export interface TokenProvider {
    enableCache?: boolean;
    cacheTTLInSeconds?: number;
}

export interface ManagementOptions {
    domain: string;
    token?: string;
    clientId?: string;
    clientSecret?: string;
    audience?: string;
    scope?: string;
    tokenProvider?: TokenProvider;
    telemetry?: boolean;
}

export interface AuthOptions {
    domain: string;
    clientID: string;
    responseType?: string;
    responseMode?: string;
    redirectUri?: string;
    scope?: string;
    audience?: string;
    leeway?: number;
    plugins?: any[];
    _disableDeprecationWarnings?: boolean;
    _sendTelemetry?: boolean;
    _telemetryInfo?: any;
}

export interface PasswordlessAuthOptions {
    connection: string;
    verificationCode: string;
    phoneNumber: string;
    email: string;
}

export interface Auth0Error {
    error?: any;
    errorDescription?: string;
    code?: string;
    description?: string;
    name?: string;
    policy?: string;
    original?: any;
    statusCode?: number;
    statusText?: string;
}

export interface Auth0DecodedHash {
    accessToken?: string;
    idToken?: string;
    idTokenPayload?: any;
    refreshToken?: string;
    state?: string;
    expiresIn?: number;
    tokenType?: string;
}

/** Represents the response from an API Token Delegation request. */
export interface Auth0DelegationToken {
    /** The length of time in seconds the token is valid for. */
    expiresIn: number;
    /** The JWT for delegated access.  */
    idToken: string;
    /** The type of token being returned. Possible values: "Bearer"  */
    tokenType: string;
}

export interface ChangePasswordOptions {
    connection: string;
    email: string;
    password?: string;
}

export interface PasswordlessStartOptions {
    connection: string;
    send: string;
    phoneNumber?: string;
    email?: string;
    authParams?: any;
}

export interface PasswordlessVerifyOptions {
    connection: string;
    verificationCode: string;
    phoneNumber?: string;
    email?: string;
    send?: string;
}

export interface Auth0UserProfile {
    name: string;
    nickname: string;
    picture: string;
    user_id: string;
    username?: string;
    given_name?: string;
    family_name?: string;
    email?: string;
    email_verified?: string;
    clientID: string;
    gender?: string;
    locale?: string;
    identities: Auth0Identity[];
    created_at: string;
    updated_at: string;
    sub: string;
    user_metadata?: any;
    app_metadata?: any;
}

export interface MicrosoftUserProfile extends Auth0UserProfile {
    emails?: string[]; // optional depending on whether email addresses permission is granted
}

export interface Office365UserProfile extends Auth0UserProfile {
    tenantid: string;
    upn: string;
}

export interface AdfsUserProfile extends Auth0UserProfile {
    issuer?: string;
}

export interface Auth0Identity {
    connection: string;
    isSocial: boolean;
    provider: string;
    user_id: string;
}

export interface LoginOptions {
    username: string;
    password: string;
    scope?: string;
}

export interface DefaultLoginOptions extends LoginOptions {
    audience?: string;
    realm: string;
}

export interface DefaultDirectoryLoginOptions extends LoginOptions {
    audience?: string;
}

export interface ResourceOwnerLoginOptions extends LoginOptions {
    connection: string;
    device?: string;
}

export interface CrossOriginLoginOptions {
    username?: string;
    email?: string;
    password: string;
    realm?: string;
}

export interface LogoutOptions {
    clientID?: string;
    returnTo?: string;
    federated?: boolean;
}

export interface DelegationOptions {
    client_id?: string;
    grant_type: string;
    id_token?: string;
    refresh_token?: string;
    target?: string;
    scope?: string;
    api_type?: string;
}

export interface DbSignUpOptions {
    email: string;
    password: string;
    connection: string;
    scope?: string;
    user_metadata?: any;
}

export interface ParseHashOptions {
    hash?: string;
    state?: string;
    nonce?: string;
    _idTokenVerification?: boolean;
}

export interface RenewAuthOptions {
    domain?: string;
    clientID?: string;
    redirectUri?: string;
    responseType?: string;
    responseMode?: string;
    state?: string;
    nonce?: string;
    scope?: string;
    audience?: string;
    usePostMessage?: boolean;
    postMessageDataType?: string;
}

export interface AuthorizeOptions {
    domain?: string;
    clientID?: string;
    connection?: string;
    redirectUri?: string;
    responseType?: string;
    responseMode?: string;
    state?: string;
    nonce?: string;
    scope?: string;
    audience?: string;
}


text:
from __future__ import unicode_literals

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0005_auto_20170613_1149'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='account',
            options={'ordering': ['order', '-uses'], 'verbose_name': 'account', 'verbose_name_plural': 'accounts'},
        ),
    ]


text:
module.exports = function (context, req, registerTable) {
    context.log('JavaScript HTTP trigger function processed a request.');
    context.log(req.params);
    context.log(registerTable);
    if(registerTable !== null) {
        context.bindings.outputQueueItem =
        {
            notifyurl: registerTable.RegistrationId,
            messageid: req.params.messageid,
            plate: registerTable.RowKey
        }
    }
    context.log(context.bindings.outputQueueItem);
    res = {
        status: 200
    };
    context.done(null, res);
};


text:
import type { RangeConfig } from '../types';
import { getRangeStrategy } from '.';

describe('getRangeStrategy', () => {
  it('returns same if not auto', () => {
    const config: RangeConfig = { rangeStrategy: 'widen' };
    expect(getRangeStrategy(config)).toEqual('widen');
  });
  it('pins require-dev', () => {
    const config: RangeConfig = {
      rangeStrategy: 'auto',
      depType: 'require-dev',
    };
    expect(getRangeStrategy(config)).toEqual('pin');
  });
  it('pins project require', () => {
    const config: RangeConfig = {
      rangeStrategy: 'auto',
      managerData: { composerJsonType: 'project' },
      depType: 'require',
    };
    expect(getRangeStrategy(config)).toEqual('pin');
  });
  it('widens complex ranges', () => {
    const config: RangeConfig = {
      rangeStrategy: 'auto',
      depType: 'require',
      currentValue: '^1.6.0 || ^2.0.0',
    };
    expect(getRangeStrategy(config)).toEqual('widen');
  });
  it('widens complex bump', () => {
    const config: RangeConfig = {
      rangeStrategy: 'bump',
      depType: 'require',
      currentValue: '^1.6.0 || ^2.0.0',
    };
    expect(getRangeStrategy(config)).toEqual('widen');
  });
  it('defaults to replace', () => {
    const config: RangeConfig = { rangeStrategy: 'auto', depType: 'require' };
    expect(getRangeStrategy(config)).toEqual('replace');
  });
});


text:
\hypertarget{dir_23084b2f8693fb5fafc5c8da130baacd}{}\section{L\+I\+B\+I\+R\+W\+L\+S/python-\/package Directory Reference}
\label{dir_23084b2f8693fb5fafc5c8da130baacd}\index{L\+I\+B\+I\+R\+W\+L\+S/python-\/package Directory Reference@{L\+I\+B\+I\+R\+W\+L\+S/python-\/package Directory Reference}}
\subsection*{Files}
\begin{DoxyCompactItemize}
\item
file \hyperlink{pythonmodule_8c}{pythonmodule.\+c}
\begin{DoxyCompactList}\small\item\em Implementation of the functions of the python extension. \end{DoxyCompactList}\item
file \hyperlink{pythonmodule_8h}{pythonmodule.\+h}
\begin{DoxyCompactList}\small\item\em Functions of the python extension that makes use of this library. \end{DoxyCompactList}\end{DoxyCompactItemize}


text:
                           INSTALLING MACHO
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
STEP 1 - OBTAIN SBCL
--------------------------------------------------------------------------------
Macho now comes complete with all libraries required for operation(*).  Its only
external dependency is SBCL itself.  Macho is tested with versions of SBCL
greater than 0.8 only.

SBCL is available from http://sbcl.sf.net.  Easy to install rpms are available
for Redhat Linux.  Debian Linux provides SBCL as a standard package.  Binary
packages may be available for other platforms.

--------------------------------------------------------------------------------
STEP 2 - INSTALLING THE MACHO DISTRIBUTION
--------------------------------------------------------------------------------
Unpack the Macho distribution anywhere you find convenient.  It will run from
any location.

Next, run "make" to compile macho.  This might take a minute or two.

Note: you will probably have to rebuild macho by running "make clean; make" if
you upgrade SBCL to a newer version at some point after building macho.

--------------------------------------------------------------------------------
STEP 3 - SETTING UP ARCHIVES
--------------------------------------------------------------------------------
a. For each mail archive for which you'd like Macho to maintain web archives,
   create a subdirectory under the "root/archives" directory.  Macho will interpret
   the name of this directory as the name of the list for display purposes in the
   generated archives.  For example, to build an archive for the "clump" mailing
   list, create a the directory roots/archives/clump.

b. Currently, Macho will only archive messages from an mbox format file. Copy or
   symlink the mbox file for the archive under the directory you created in step
   a.  For instance, the the clump lists mbox file would be copied to
   root/archives/clump/mbox.  If the archive is active, it's up to you to arrange
   for new messages to be delivered to this file.  Macho will automatically
   recognize and archive any new messages delivered to the mbox file, but it
   doesn't perform any mail delivery functions itself.

--------------------------------------------------------------------------------
GENERATE ARCHIVES
--------------------------------------------------------------------------------
Run the top-level "macho update" command in the Macho directory with the name of
your list or lists as its arguments.  For instance, to generate archives of the
clump list, run the following command:

./macho update clump

The macho command accepts a few options.  Run it with no arguments to see what
options it offers.

Macho will generate archives in its "root" directory, under
root/archives/archivename.  The clump archive, for instance, will be archived in
root/archives/clump.

--------------------------------------------------------------------------------
CUSTOMIZE ARCHIVES
--------------------------------------------------------------------------------
Macho permits per-archive style customizations.  To customize the look of your
archive just add a css stylesheet named "custom.css" in your
root/archives/archivename.  Have a look at the main stylesheet in
root/macho.css to get a list of styleable macho objects.

--------------------------------------------------------------------------------
PUBLISH ARCHIVES
--------------------------------------------------------------------------------
Publishing Macho archives is simply a matter of placing them somewhere in the
document root of your webserver.  The easiest way to do this is to symlink
Macho's root directory somewhere in your servers document directory.

Installation is complete at this point.  If your list is active and still
receives mail, you have can keep your archives up to date in one of two ways:

1. run "macho update" out of cron
This is probably the simplest method.  It has the disadvantage that macho will
run at regular intervals whether there is new mail or not and that there is a
delay between the time a message arrives and the time it appears in the
archives.

2. set up an email alias to deliver to the "macho deliver" comand
This is somewhat more difficult to set up but has the advantage that
macho runs only when necessary and that new messages will appear in
the web archives right away.  Setting this up properly involves some
understanding of unix mail delivery agents, but typically it involves
adding an alias to the /etc/alias file that looks something like this:

my-alias: "|/path/to/macho deliver my-alias"

where "my-alias" is the name of your archive, and then running the
"newaliases" command.

*Note*: this will only work if your archive directories are writable
by the user as which the mail client runs on your system.

*** IMPORTANT NOTE ***
Although Macho bundles all of its dependent
libraries, there is no guarantee the libraries distributed with Macho
are the most up-to-date.  Although it's recommended that you use the
versions distributed with macho, you should obtain the most recent
versions of these libraries if you plan to use them yourself in
another project.

The most recent versions of Edi Weitz's cl-ppcre and html-template
libraries can be found at [his site](http://www.weitz.de).

Dan Barlow's handy net-telent-date library can be found
at [cliki](http://www.cliki.net/net-telent-date)


text:
var net = require('net');
var url = require('url');
var util = require('util');
var _ = require('lodash');
var hexy = require('hexy');

var ICAPError = require('./icap_error');
var ICAPRequest = require('./icap_request');
var ICAPResponse = require('./icap_response');
var HTTPRequest = require('./http_request');
var HTTPResponse = require('./http_response');
var helpers = require('./helpers');
var codes = require('./codes');

var states = {
  'icapmethod': 'icapmethod',
  'icapheader': 'icapheader',
  'requestmethod': 'requestmethod',
  'requestheader': 'requestheader',
  'responseversion': 'responseversion',
  'responseheader': 'responseheader',
  'parsepreview': 'parsepreview',
  'parsebody': 'parsebody'
};

/*
 *  ICAPHandler
 *    Encapsulates handling of an ICAP client request.
 */
function ICAPHandler(socket, emitter, options) {
  this.emitter = emitter;
  this.socket = socket;
  this.logger = options.logger;
  this.buffer = new Buffer(0);
  this.bufferIndex = 0;
  this.icapBodyStartIndex = 0;
  this.waitOffset = 0;

  this.resetState(true);
  this.initialize();
}

ICAPHandler.prototype = {
  constructor: ICAPHandler,

  initialize: function() {
    var socket = this.socket;
    socket.setTimeout(0);

    socket.on('connect', function() {
      this.logger.debug('[%s] socket connect', this.id);
      this.emitEvent('connnect');
    }.bind(this));

    socket.on('data', function(data) {
      this.buffer = Buffer.concat([this.buffer, data], this.buffer.length + data.length);
      this.nextState();
    }.bind(this));

    socket.on('end', function() {
      this.logger.debug('[%s] socket end', this.id);
      this.emitEvent('closed');
      socket.end();
    }.bind(this));

    socket.on('timeout', function() {
      this.logger.debug('[%s] socket timeout', this.id);
    }.bind(this));

    socket.on('close', function() {
      this.logger.debug('[%s] socket close', this.id);
    }.bind(this));

    socket.on('error', function(err) {
      this.logger.error('[%s] socket error "%s"', this.id, err.message || 'Unknown Error');

      // notify the error handler not to process the response further
      if (this.icapResponse) {
        this.icapResponse.done = true;
      }
      this.emitError(err);
      socket.end();
    }.bind(this));
  },

  emitEvent: function(eventName) {
    this.emitter.emit(eventName, this.icapRequest, this.icapResponse, this.httpRequest, this.httpResponse);
  },

  emitError: function(err) {
    this.emitter.emit('error', err, this.icapRequest, this.icapResponse, this.httpRequest, this.httpResponse);
  },

  resetState :function(isFirstReset) {
    if (!isFirstReset) {
      this.emitEvent('end');
      this.logger.debug('[%s] handler resetState', this.id);
    }
    if (this.icapRequest) {
      this.icapRequest.removeAllListeners();
    }
    var id = process.pid + '::' + _.uniqueId();
    this.id = id;
    this.state = states.icapmethod;
    this.icapRequest = new ICAPRequest(this.id);
    this.icapResponse = new ICAPResponse(this.id, this.socket);
    this.httpRequest = new HTTPRequest();
    this.httpResponse = new HTTPResponse();

    if (!isFirstReset) {
      this.buffer = this.buffer.slice(this.bufferIndex, this.buffer.length);
      this.bufferIndex = 0;
      this.icapBodyStartIndex = 0;
      this.waitOffset = 0;
    }
    this.chunkSize = null;
    this.previewBuffer = null;
    this.parsePreview = false;
  },

  nextState : function(state, offset) {
    if (!this.nextIfNotDone()) {
      return;
    }
    if (typeof state !== 'undefined' && state !== null) {
      this.state = state;
    }
    if (typeof offset === 'number') {
      this.waitOffset = offset + this.icapBodyStartIndex;
    }
    if (this.waitOffset <= this.buffer.length) {
      try {
        this[this.state]();
      } catch (err) {
        this.emitError(err);
        this.socket.end();
      }
    }
  },

  nextIfNotDone: function() {
    if (this.icapResponse.done) {
      this.resetState();
      this.nextState();
      return false;
    }
    return true;
  },

  nextStateEncapsulated: function() {
    var encapsulatedEntity;
    if (!this.nextIfNotDone()) {
      return;
    }
    encapsulatedEntity = this.icapRequest.encapsulated.shift();
    switch (encapsulatedEntity[0]) {
      case 'req-hdr':
        if (!this.icapRequest.encapsulated.length) {
          throw new ICAPError('No body offset for req-hdr');
        }
        this.nextState(states.requestheader, this.icapRequest.encapsulated[0][1]);
        break;
      case 'res-hdr':
        if (!this.icapRequest.encapsulated.length) {
          throw new ICAPError('No body offset for res-hdr');
        }
        this.nextState(states.responseheader, this.icapRequest.encapsulated[0][1]);
        break;
      case 'req-body':
      case 'res-body':
        if (this.parsePreview) {
          this.icapRequest.encapsulated.unshift(encapsulatedEntity);
          this.nextState(states.parsepreview);
          break;
        }

        this.emitEvent(this.icapRequest.isReqMod() ? 'httpRequestBody' : 'httpResponseBody');
        this.nextState(states.parsebody, 0);
        break;
      case 'null-body':
        this.emitEvent(this.icapRequest.isReqMod() ? 'httpRequestNullBody' : 'httpResponseNullBody');
        this.logger.debug('[%s] null-body]', this.id);
        this.icapResponse.end();
        this.resetState();
        this.nextState();
        break;
      default:
        throw new ICAPError('Unsupported encapsulated entity: ' + encapsulatedEntity);
    }
  },

  read: function(helperMethod) {
    var result = helperMethod(this.buffer, this.bufferIndex);
    if (result && typeof result.index === 'number') {
      this.bufferIndex = result.index;
      delete result.index;
    }
    return result;
  },

  readChunk: function() {
    if (!this.chunkSize) {
      var line;
      line = this.read(helpers.line);
      if (!line || !line.str.length) {
        return null;
      }

      var arr = line.str.split(';');
      var chunkSize = parseInt(arr[0], 16);
      if (isNaN(chunkSize)) {
        throw new ICAPError('Cannot read chunk size' + line.str);
      }
      this.chunkSize = chunkSize;
      if (arr.length > 1 && arr[1] === 'ieof') {
        this.icapRequest.ieof = true;
      }
      if (chunkSize === 0) {
        this.bufferIndex += 2; // skip last CRLF
        return {data: null, eof: true};
      }
    }
    if (this.bufferIndex + this.chunkSize < this.buffer.length) {
      var data = this.buffer.slice(this.bufferIndex, this.bufferIndex + this.chunkSize);
      this.bufferIndex += this.chunkSize + 2; // skip CRLF
      this.chunkSize = null;
      return {
        data: data
      };
    }
    return null;
  },

  readAllHeaders: function() {
    var header = null;
    var headers = {};
    while ((header = this.read(helpers.header)) !== null) {
      _.extend(headers, header.header);

      if (this.read(helpers.newline).newline) {
        return headers;
      }
    }
    if (this.read(helpers.newline).newline) {
      return headers;
    }
    return null;
  },

  icapmethod: function() {
    var method = this.read(helpers.method);
    if (!method) {
      return;
    }
    this.icapRequest.setMethod(method);

    this.logger.verbose('[%s] icapmethod %s', this.id, JSON.stringify(method));
    this.emitEvent('icapMethod');
    this.nextState(states.icapheader);
  },

  icapheader: function() {
    var headers = this.readAllHeaders();
    if (!headers) {
      this.logger.warn('[%s] icapheader - no headers!', this.id);
      return;
    }
    this.icapRequest.setHeaders(headers);
    this.logger.verbose('[%s] icapheader %s', this.id, JSON.stringify(this.icapRequest.headers));
    this.emitEvent('icapHeaders');
    this.icapBodyStartIndex = this.bufferIndex;

    switch (this.icapRequest.method) {
      case 'OPTIONS':
        this.emitEvent('icapOptions');
        this.resetState();
        this.nextState();
        break;

      case 'RESPMOD':
      case 'REQMOD':
        this.icapRequest.encapsulated = helpers.encapsulated(this.icapRequest.headers['Encapsulated']);
        if (!this.icapRequest.encapsulated || !this.icapRequest.encapsulated.length) {
          throw new ICAPError('Missing Encapsulated header for: ' + this.icapRequest.method);
        }
        if (this.icapRequest.hasPreviewBody()) {
          this.parsePreview = true;
        }
        this.nextStateEncapsulated();
        break;

      default:
        throw new ICAPError(405);
    }
  },

  requestheader: function() {
    var method = this.read(helpers.method);
    if (!method) {
      throw new ICAPError('Request method not found');
    }
    _.extend(this.httpRequest, method);

    var headers = this.readAllHeaders();
    if (!headers) {
      throw new ICAPError('Request headers not found');
    }
    this.httpRequest.setHeaders(headers);
    this.logger.verbose('[%s] requestheader %s', this.id, JSON.stringify(this.httpRequest));
    if (this.icapRequest.isReqMod() && !this.parsePreview) {
      this.emitEvent('httpRequest');
    }
    this.nextStateEncapsulated();
  },

  responseheader: function() {
    var status = this.read(helpers.status);
    if (!status) {
      throw new ICAPError('Response method not found');
    }
    _.extend(this.httpResponse, status);

    var headers = this.readAllHeaders();
    if (!headers) {
      throw new ICAPError('Response headers not found');
    }
    this.httpResponse.setHeaders(headers);
    this.logger.verbose('[%s] responseheader %s', this.id, JSON.stringify(this.httpResponse));
    if (this.icapRequest.isRespMod() && !this.parsePreview) {
      this.emitEvent('httpResponse');
    }
    this.nextStateEncapsulated();
  },

  parsepreview: function() {
    var body;
    if (!this.previewBuffer) {
      this.previewBuffer = new Buffer(0);
    }
    while ((body = this.readChunk()) !== null) {
      if (body.data) {
        this.previewBuffer = Buffer.concat([this.previewBuffer, body.data], this.previewBuffer.length + body.data.length);
      }
      if (body.eof) {
        this.icapRequest.preview = this.previewBuffer;
        this.parsePreview = false;
        this.state = states.parsebody;
        this.logger.debug('[%s] parsepreview\n%s', this.id, hexy.hexy(this.previewBuffer));
        if (this.icapRequest.isReqMod()) {
          this.emitEvent('httpRequest');
        } else {
          this.emitEvent('httpResponse');
        }
      }
    }
  },

  parsebody: function() {
    var body;
    if (this.previewBuffer) {
      this.logger.debug('[%s] parsebody\n%s', this.id, hexy.hexy(this.previewBuffer));
      this.icapRequest.push(this.previewBuffer);
      this.previewBuffer = null;
    }
    if (this.icapRequest.ieof) {
      this.icapRequest.push(null);
      this.resetState();
      this.nextState();
      return;
    }
    while ((body = this.readChunk()) !== null) {
      if (body.data) {
        this.logger.debug('[%s] parsebody\n%s', this.id, hexy.hexy(body.data));
        this.icapRequest.push(body.data);
      }
      if (body.eof) {
        this.logger.debug('[%s] parsebody eof', this.id);
        this.icapRequest.push(null);
        this.icapResponse.end();
        this.resetState();
        this.nextState();
        break;
      }
    }
  }
};

module.exports = ICAPHandler;


text:
class BlogsController < ApplicationController

  before_action :confirm_logged_in, :except => [:login]

  def login
    redirect_to(:action => 'login', :controller => 'users')
  end

  def index
  end

  def show_month
    @month_year = params[:month_year]
    @year = params[:year]
  end

  def show_category
    @category = params[:category]
  end

  def show_page
    @date = params[:date]
  end

end


text:
#ifndef _ASM_SOCKET_H
#define _ASM_SOCKET_H

#include <asm/sockios.h>

/* For setsockopt(2) */
/*
 * Note: we only bother about making the SOL_SOCKET options
 * same as OSF/1, as that's all that "normal" programs are
 * likely to set.  We don't necessarily want to be binary
 * compatible with _everything_.
 */
#define SOL_SOCKET	0xffff

#define SO_DEBUG	0x0001
#define SO_REUSEADDR	0x0004
#define SO_KEEPALIVE	0x0008
#define SO_DONTROUTE	0x0010
#define SO_BROADCAST	0x0020
#define SO_LINGER	0x0080
#define SO_OOBINLINE	0x0100
/* To add :#define SO_REUSEPORT 0x0200 */

#define SO_TYPE		0x1008
#define SO_ERROR	0x1007
#define SO_SNDBUF	0x1001
#define SO_RCVBUF	0x1002
#define SO_SNDBUFFORCE	0x100a
#define SO_RCVBUFFORCE	0x100b
#define	SO_RCVLOWAT	0x1010
#define	SO_SNDLOWAT	0x1011
#define	SO_RCVTIMEO	0x1012
#define	SO_SNDTIMEO	0x1013
#define SO_ACCEPTCONN	0x1014

/* linux-specific, might as well be the same as on i386 */
#define SO_NO_CHECK	11
#define SO_PRIORITY	12
#define SO_BSDCOMPAT	14

#define SO_PASSCRED	17
#define SO_PEERCRED	18
#define SO_BINDTODEVICE 25

/* Socket filtering */
#define SO_ATTACH_FILTER        26
#define SO_DETACH_FILTER        27

#define SO_PEERNAME		28
#define SO_TIMESTAMP		29
#define SCM_TIMESTAMP		SO_TIMESTAMP

#define SO_PEERSEC		30
#define SO_PASSSEC		34

/* Security levels - as per NRL IPv6 - don't actually do anything */
#define SO_SECURITY_AUTHENTICATION		19
#define SO_SECURITY_ENCRYPTION_TRANSPORT	20
#define SO_SECURITY_ENCRYPTION_NETWORK		21

#endif /* _ASM_SOCKET_H */


text:
class FlipDotOutput : public Output
{
public:
};

#endif // FLIPDOTOUTPUT_H


text:
package se.cs.casualmap.generator;

import se.cs.casualmap.api.shared.Tile;
import se.cs.casualmap.shape.Shape;
import se.cs.casualmap.shape.ShapeFactory;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Random;

/**
 * This class generates lined up {@link Shape}s based on the provided {@link Args}.
 * The creation of shapes are handled by the enclosed shapeFactory, making the shape form
 * unknown for this algorithm. The only thing this class cares about is that the shapes are
 * well formed, i.e. they form a filled region.
 */
public class ShapesGenerator {
    private final Args args;
    private final Random random = new Random();
    private final ShapeFactory<?> shapeFactory;

    private int maxAttempts = 3000;

    ShapesGenerator(Args args, ShapeFactory<? extends Shape> shapeFactory) {
        this.args = args;
        this.shapeFactory = shapeFactory;
    }

    /**
     * @return a collection of lined up shapes
     */
    Collection<Shape> generate() {
        int attempts = 0;

        Grid grid = new Grid(args.getWidth(), args.getHeight());
        while (!hasFailedTooManyTimes(attempts)) {
            Shape first = newShape();

            if (grid.fits(first)) {
                attempts = 0;
                grid.place(first);
                break;
            } else {
                attempts++;
            }
        }

        while (!hasFailedTooManyTimes(attempts)
                && !desiredTileDensityReached(grid)) {

            Shape shape = shapeFactory.create(
                    Tile.at(0, 0),
                    randomAreaWidth(),
                    randomAreaHeight());

            List<Shape> suggestions =
                    LineUpSuggestor.newForShape(grid.anyShape()).suggest(shape);

            Collections.shuffle(suggestions);

            for (Shape suggestion : suggestions) {
                if (grid.fits(suggestion)) {
                    grid.place(suggestion);
                    attempts = 0;
                    break;
                } else {
                    attempts++;
                }
            }
        }

        return grid.getShapes();
    }

    private boolean desiredTileDensityReached(Grid grid) {
        double currentAreaDensity =
                (double) grid.getNumberOfOccupiedTiles() / (double) (args.getWidth() * args.getHeight());

        return currentAreaDensity >= args.desiredTileDensity();
    }

    private boolean hasFailedTooManyTimes(int attempts) {
        return attempts > maxAttempts;
    }

    private Shape newShape() {
        return shapeFactory.create(
                Tile.at(
                        random.nextInt(args.getWidth()),
                        random.nextInt(args.getHeight())),
                randomAreaWidth(),
                randomAreaHeight());
    }

    private int randomAreaWidth() {
        int widthModifier = 0;
        if (args.getMaxAreaWidth() - args.getMinAreaWidth() > 0) {
            widthModifier = random.nextInt(args.getMaxAreaWidth() - args.getMinAreaWidth()) + 1;
        }

        return args.getMinAreaWidth() + widthModifier;
    }

    private int randomAreaHeight() {
        int heightModifier = 0;
        if (args.getMaxAreaHeight() - args.getMinAreaHeight() > 0) {
            heightModifier = random.nextInt(args.getMaxAreaHeight() - args.getMinAreaHeight()) + 1;
        }

        return args.getMinAreaHeight() + heightModifier;
    }
}


text:
from icu import Normalizer2, UNormalizationMode2, UNormalizationCheckResult

from org.apache.lucene.analysis.tokenattributes import CharTermAttribute
from org.apache.pylucene.analysis import PythonTokenFilter

class ICUNormalizer2Filter(PythonTokenFilter):

    def __init__(self, input, normalizer=None):
        super(ICUNormalizer2Filter, self).__init__(input)

        self.input = input
        self.termAtt = self.addAttribute(CharTermAttribute.class_);

        if normalizer is None:
            normalizer = Normalizer2.getInstance(None, "nfkc_cf", UNormalizationMode2.COMPOSE)
        self.normalizer = normalizer

    def incrementToken(self):

        if self.input.incrementToken():
            text = self.termAtt.toString()

            if self.normalizer.quickCheck(text) != UNormalizationCheckResult.YES:
                self.termAtt.setEmpty()
                self.termAtt.append(self.normalizer.normalize(text))

            return True

        return False


text:
int main(int argc, char *argv[])
{
    wiringPiSetupGpio();
    pimobileInitializeGpio();

    printf("Turning to 0° N\n");
    pimobileTurnTo(0);
    printf("Moving for 5 seconds\n");
    pimobileSetMotorsSpeedAndDirection(100,100,1,1);
    sleep(5);

    printf("Turning to 90°\n");
    pimobileTurnTo(90);
    printf("Moving for 5 seconds\n");
    pimobileSetMotorsSpeedAndDirection(100,100,1,1);
    sleep(5);

    printf("Turning to 180°S\n");
    pimobileTurnTo(180);
    printf("Moving for 5 seconds\n");
    pimobileSetMotorsSpeedAndDirection(100,100,1,1);
    sleep(5);

    printf("Turning to 270°W\n");
    pimobileTurnTo(270);
    printf("Moving for 5 seconds\n");
    pimobileSetMotorsSpeedAndDirection(100,100,1,1);
    sleep(5);

    printf("Turning to 0° N\n");
    pimobileTurnTo(0);
    printf("Moving for 5 seconds\n");
    pimobileSetMotorsSpeedAndDirection(100,100,1,1);
    sleep(5);

    pimobileStop();

    return 0;
}