text:
+ Fix SSH wait before provisioning issue

# 0.6.0-rc4 (2016-02-03)

General

+ `env`
    + Fix shell auto detection

Drivers

+ `exoscale`
    + Fix configuration of exoscale endpoint

# 0.6.0-rc3 (2016-02-01)

- Exit with code 3 if error is during pre-create check

# 0.6.0-rc2 (2016-01-28)

- Fix issue creating Swarms
- Fix `ls` header issue
- Add code to wait for Docker daemon before returning from `start` / `restart`
- Start porting integration tests to Go from BATS
- Add Appveyor for Windows tests
- Update CoreOS provisioner to use `docker daemon`
- Various documentation and error message fixes
- Add ability to create GCE machine using existing VM

# 0.6.0-rc1 (2016-01-18)

General

- Update to Go 1.5.3
- Short form of command invocations is now supported
    - `docker-machine start`, `docker-machine stop` and others will now use
      `default` as the machine name argument if one is not specified
- Fix issue with panics in drivers
- Machine now returns exit code 3 if the pre-create check fails.
    - This is potentially useful for scripting `docker-machine`.
- `docker-machine provision` command added to allow re-running of provisioning
  on instances.
    - This allows users to re-run provisioning if it fails during `create`
      instead of needing to completely start over.

Provisioning

- Most provisioners now use `docker daemon` instead of `docker -d`
- Swarm masters now run with replication enabled
- If `/var/lib` is a BTRFS partition, `btrfs` will now be used as the storage
  driver for the instance

Drivers

- Amazon EC2
    - Default VPC will be used automatically if none is specified
    - Credentials are now be read from the conventional `~/.aws/credentials`
      file automatically
    - Fix a few issues such as nil pointer dereferences
- VMware Fusion
    - Try to get IP from multiple DHCP lease files
- OpenStack
    - Only derive tenant ID if tenant name is supplied

# 0.5.6 (2016-01-11)

General

- `create`
  - Set swarm master to advertise on port 3376
  - Fix swarm restart policy
  - Stop asking for ssh key passwords interactively
- `env`
  - Improve documentation
  - Fix bash on windows
  - Automatic shell detection on Windows
- `help`
  - Don't show the full path to `docker-machine.exe` on windows
- `ls`
  - Allow custom format
  - Improve documentation
- `restart`
  - Improve documentation
- `rm`
  - Improve documentation
  - Better user experience when removing multiple hosts
- `version`
  - Don't show the full path to `docker-machine.exe` on windows
- `start`, `stop`, `restart`, `kill`
  - Better logs and homogeneous behaviour across all drivers

Build

- Introduce CI tests for external binary compatibility
- Add amazon EC2 integration test

Misc

- Improve BugSnags reports: better shell detection, better windows version detection
- Update DockerClient dependency
- Improve bash-completion script
- Improve documentation for bash-completion

Drivers

- Amazon EC2
  - Improve documentation
  - Support optional tags
  - Option to create EbsOptimized instances
- Google
  - Fix remove when instance is stopped
- Openstack
  - Flags to import and reuse existing nova keypairs
- VirtualBox
  - Fix multiple bugs related to host-only adapters
  - Retry commands when `VBoxManage` is not ready
  - Reject VirtualBox versions older that 4.3
  - Fail with a clear message when Hyper-v installation prevents VirtualBox from working
  - Print a warning for Boot2Docker v1.9.1, which is known to have an issue with AUFS
- Vmware Fusion
  - Support soft links in VM paths

Libmachine

- Fix code sample that uses libmachine
- libmachine can be used in external applications

# 0.5.5 (2015-12-28)

General

- `env`
  - Better error message if swarm is down
  - Add quotes to command if there are spaces in the path
  - Fix Powershell env hints
  - Default to cmd shell on windows
  - Detect fish shell
- `scp`
  - Ignore empty ssh key
- `stop`, `start`, `kill`
  - Add feedback to the user
- `rm`
  - Now works when `config.json` is not found
- `ssh`
  - Disable ControlPath
  - Log which SSH client is used
- `ls`
  - Listing is now faster by reducing calls to the driver
  - Shows if the active machine is a swarm cluster

Build

- Automate 90% of the release process
- Upgrade to Go 1.5.2
- Don't build 32bits binaries for Linux and OSX
- Prevent makefile from defaulting to using containers

Misc

- Update docker-machine version
- Updated the bash completion with new options added
- Bugsnag: Retrieve windows version on non-english OS

Drivers

- Amazon EC2
  - Convert API calls to official SDK
  - Make DeviceName configurable
- Digital Ocean
  - Custom SSH port support
- Generic
  - Don't support `kill` since `stop` is not supported
- Google
  - Coreos provisionning
- Hyper-V
  - Lot's of code simplifications
  - Pre-Check that the user is an Administrator
  - Pre-Check that the virtual switch exists
  - Add Environment variables for each flag
  - Fix how Powershell is detected
  - VSwitch name should be saved to config.json
  - Add a flag to set the CPU count
  - Close handle after copying boot2docker.iso into vm folder - will otherwise keep hyper-v from starting vm
  - Update Boot2Docker cache in PreCreateCheck phase
- OpenStack
 - Filter floating IPs by tenant ID
- Virtualbox
  - Reject duplicate hostonlyifs Name/IP with clear message
  - Detect when hostonlyif can't be created. Point to known working version of VirtualBox
  - Don't create the VM if no hardware virtualization is available and add a flag to force create
  - Add `VBox.log` to bugsnag crashreport
  - Update Boot2Docker cache in PreCreateCheck phase
  - Detect Incompatibility with Hyper-v
- VSphere
 - Rewrite driver to work with govmomi instead of wrapping govc
- All
  - Change host restart to use the driver implementation
  - Fix truncated logs
  - Increase heartbeat interval and timeout

Provisioners

- Download latest Boot2Docker if it is out-of-date
- Add swarm config to coreos
- All provisioners now honor `engine-install-url`

# 0.5.4 (2015-12-28)

This is a patch release to fix a regression with STDOUT/STDERR behavior (#2587).

# 0.5.3 (2015-12-14)

**Please note**: With this release Machine will be reverting back to distribution in a single binary, which is more efficient on bandwidth and hard disk space. All the core driver plugins are now included in the main binary. You will want to delete the old driver binaries that you might have in your path.

e.g.:

```console
$ rm /usr/local/bin/docker-machine-driver-{amazonec2,azure,digitalocean,exoscale,generic,google,hyperv,none,openstack,rackspace,softlayer,virtualbox,vmwarefusion,vmwarevcloudair,vmwarevsphere}
```

Non-core driver plugins should still work as intended (in externally distributed binaries of the form `docker-machine-driver-name`.  Please report any issues you encounter them with externally loaded plugins.

General

- Optionally report crashes to Bugsnag to help us improve docker-machine
- Fix multiple nil dereferences in `docker-machine ls` command
- Improve the build and CI
- `docker-machine env` now supports emacs
- Run Swarm containers in provisioning step using Docker API instead of SSH/shell
- Show docker daemon version in `docker-machine ls`
- `docker-machine ls` can filter by engine label
- `docker-machine ls` filters are case insensitive
- `--timeout` flag for `docker-machine ls`
- Logs use `logrus` library
- Swarm container network is now `host`
- Added advertise flag to Swarm manager template
- Fix `help` flag for `docker-machine ssh`
- Add confirmation `-y` flag to `docker-machine rm`
- Fix `docker-machine config` for fish
- Embed all core drivers in `docker-machine` binary to reduce the bundle from 120M to 15M

Drivers

- Generic
	- Support password protected ssh keys though ssh-agent
	- Support DNS names
- Virtualbox
	- Show a warning if virtualbox is too old
	- Recognize yet another Hardware Virtualization issue pattern
	- Fix Hardware Virtualization on Linux/AMD
	- Add the `--virtualbox-host-dns-resolver` flag
	- Allow virtualbox DNSProxy override
- Google
	- Open firewall port for Swarm when needed
- VMware Fusion
	- Explicitly set umask before invoking vmrun in vmwarefusion
	- Activate the plugin only on OSX
	- Add id/gid option to mount when using vmhgfs
	- Fix for vSphere driver boot2docker ISO issues
- Digital Ocean
	- Support for creating Droplets with Cloud-init User Data
- Openstack
	- Sanitize keynames by replacing dots with underscores
- All
	- Most base images are now set to `Ubuntu 15.10`
	- Fix compatibility with drivers developed with docker-machine 0.5.0
	- Better error report for broken/incompatible drivers
	- Don't break `config.json` configuration when the disk is full

Provisioners

- Increase timeout for installing boot2docker
- Support `Ubuntu 15.10`

Misc

- Improve the documentation
- Update known drivers list

# 0.5.2 (2015-11-30)

General

-   Bash autocompletion and helpers fixed
-   Remove `RawDriver` from `config.json` - Driver parameters can now be edited
    directly again in this file.
-   Change fish `env` variable setting to be global
-   Add `docker-machine version` command
-   Move back to normal `codegangsta/cli` upstream
-   `--tls-san` flag for extra SANs

Drivers

-   Fix `GetURL` IPv6 compatibility
-   Add documentation page for available 3rd party drivers
-   VirtualBox
    -   Support for shared folders and virtualization detection on Linux hosts
    -   Improved detection of invalid host-only interface settings
-   Google
    -   Update default images
-   VMware Fusion
    -   Add option to disable shared folder
-   Generic
    -   New environment variables for flags

Provisioners

-   Support for Ubuntu >=15.04.  This means Ubuntu machines can be created which
    work with `overlay` driver of lib network.
-   Fix issue with current netstat / daemon availability checking

# 0.5.1 (2015-11-16)

-   Fixed boot2docker VM import regression
-   Fix regression breaking `docker-machine env -u` to unset environment variables
-   Enhanced virtualization capability detection and `VBoxManage` path detection
-   Properly lock VirtualBox access when running several commands concurrently
-   Allow plugins to write to STDOUT without `--debug` enabled
-   Fix Rackspace driver regression
-   Support colons in `docker-machine scp` filepaths
-   Pass environment variables for provisioned Engines to Swarm as well
-   Various enhancements around boot2docker ISO upgrade (progress bar, increased timeout)

# 0.5.0 (2015-11-1)

-   General
    -   Add pluggable driver model
    -   Clean up code to be more modular and reusable in `libmachine`
    -   Add `--github-api-token` for situations where users are getting rate limited
        by GitHub attempting to get the current `boot2docker.iso` version
    -   Various enhancements around the Makefile and build toolchain (still an active WIP)
    -   Disable SSH multiplex explicitly in commands run with the "External" client
    -   Show "-" for "inactive" machines instead of nothing
    -   Make daemon status detection more robust
-   Provisioners
    -   New CoreOS, SUSE, and Arch Linux provisioners
    -   Fixes around package installation / upgrade code on Debian and Ubuntu
-   CLI
    -   Support for regular expression pattern matching and matching by names in `ls --filter`
    -   `--no-proxy` flag for `env` (sets `NO_PROXY` in addition to other environment variables)
-   Drivers
    -   `openstack`
        -   `--openstack-ip-version` parameter
        -   `--openstack-active-timeout` parameter
    -   `google`
        -   fix destructive behavior of `start` / `stop`
    -   `hyperv`
        -   fix issues with PowerShell
    -   `vmwarefusion`
        -   some issues with shared folders fixed
        -   `--vmwarefusion-configdrive-url` option for configuration via `cloud-init`
    -   `amazonec2`
        -   `--amazonec2-use-private-address` option to use private networking
    -   `virtualbox`
        -   Enhancements around robustness of the created host-only network
        -   Fix IPv6 network mask prefix parsing
        -   `--virtualbox-no-share` option to disable the automatic home directory mount
        -   `--virtualbox-hostonly-nictype` and `--virtualbox-hostonly-nicpromisc` for controlling settings around the created hostonly NIC

# 0.4.1 (2015-08)

-   Fixes `upgrade` functionality on Debian based systems
-   Fixes `upgrade` functionality on Ubuntu based systems

# 0.4.0 (2015-08-11)

## Updates

-   HTTP Proxy support for Docker Engine
-   RedHat distros now use Docker Yum repositories
-   Ability to set environment variables in the Docker Engine
-   Internal libmachine updates for stability

## Drivers

-   Google:
    -   Preemptible instances
    -   Static IP support

## Fixes

-   Swarm Discovery Flag is verified
-   Timeout added to `ls` command to prevent hangups
-   SSH command failure now reports information about error
-   Configuration migration updates

# 0.3.0 (2015-06-18)

## Features

-   Engine option configuration (ability to configure all engine options)
-   Swarm option configuration (ability to configure all swarm options)
-   New Provisioning system to allow for greater flexibility and stability for installing and configuring Docker
-   New Provisioners
    -   Rancher OS
    -   RedHat Enterprise Linux 7.0+ (experimental)
    -   Fedora 21+ (experimental)
    -   Debian 8+ (experimental)
-   PowerShell support (configure Windows Docker CLI)
-   Command Prompt (cmd.exe) support (configure Windows Docker CLI)
-   Filter command help by driver
-   Ability to import Boot2Docker instances
-   Boot2Docker CLI migration guide (experimental)
-   Format option for `inspect` command
-   New logging output format to improve readability and display across platforms
-   Updated "active" machine concept - now is implicit according to `DOCKER_HOST` environment variable.  Note: this removes the implicit "active" machine and can no longer be specified with the `active` command.  You change the "active" host by using the `env` command instead.
-   Specify Swarm version (`--swarm-image` flag)

## Drivers

-   New: Exoscale Driver
-   New: Generic Driver (provision any host with supported base OS and SSH)
-   Amazon EC2
    -   SSH user is configurable
    -   Support for Spot instances
    -   Add option to use private address only
    -   Base AMI updated to 20150417
-   Google
    -   Support custom disk types
    -   Updated base image to v20150316
-   Openstack
    -   Support for Keystone v3 domains
-   Rackspace
    -   Misc fixes including environment variable for Flavor Id and stability
-   Softlayer
    -   Enable local disk as provisioning option
    -   Fixes for SSH access errors
    -   Fixed bug where public IP would always be returned when requesting private
    -   Add support for specifying public and private VLAN IDs
-   VirtualBox
    -   Use Intel network interface driver (adds great stability)
    -   Stability fixes for NAT access
    -   Use DNS pass through
    -   Default CPU to single core for improved performance
    -   Enable shared folder support for Windows hosts
-   VMware Fusion
    -   Boot2Docker ISO updated
    -   Shared folder support

## Fixes

-   Provisioning improvements to ensure Docker is available
-   SSH improvements for provisioning stability
-   Fixed SSH key generation bug on Windows
-   Help formatting for improved readability

## Breaking Changes

-   "Short-Form" name reference no longer supported Instead of "docker-machine " implying the active host you must now use docker-machine
-   VMware shared folders require Boot2Docker 1.7

## Special Thanks

We would like to thank all contributors.  Machine would not be where it is
without you.  We would also like to give special thanks to the following
contributors for outstanding contributions to the project:

-   @frapposelli for VMware updates and fixes
-   @hairyhenderson for several improvements to Softlayer driver, inspect formatting and lots of fixes
-   @ibuildthecloud for rancher os provisioning
-   @sthulb for portable SSH library
-   @vincentbernat for exoscale
-   @zchee for Amazon updates and great doc updates

# 0.2.0 (2015-04-16)

Core Stability and Driver Updates

## Core

-   Support for system proxy environment
-   New command to regenerate TLS certificates
    -   Note: this will restart the Docker engine to apply
-   Updates to driver operations (create, start, stop, etc) for better reliability
-   New internal `libmachine` package for internal api (not ready for public usage)
-   Updated Driver Interface
    -   [Driver Spec](https://github.com/docker/machine/blob/master/docs/DRIVER_SPEC.md)
    -   Removed host provisioning from Drivers to enable a more consistent install
    -   Removed SSH commands from each Driver for more consistent operations
-   Swarm: machine now uses Swarm default binpacking strategy

## Driver Updates

-   All drivers updated to new Driver interface
-   Amazon EC2
    -   Better checking for subnets on creation
    -   Support for using Private IPs in VPC
    -   Fixed bug with duplicate security group authorization with Swarm
    -   Support for IAM instance profile
    -   Fixed bug where IP was not properly detected upon stop
-   DigitalOcean
    -   IPv6 support
    -   Backup option
    -   Private Networking
-   Openstack / Rackspace
    -   Gophercloud updated to latest version
    -   New insecure flag to disable TLS (use with caution)
-   Google
    -   Google source image updated
    -   Ability to specify auth token via file
-   VMware Fusion
    -   Paravirtualized driver for disk (pvscsi)
    -   Enhanced paravirtualized NIC (vmxnet3)
    -   Power option updates
    -   SSH keys persistent across reboots
    -   Stop now gracefully stops VM
    -   vCPUs now match host CPUs
-   SoftLayer
    -   Fixed provision bug where `curl` was not present
-   VirtualBox
    -   Correct power operations with Saved VM state
    -   Fixed bug where image option was ignored

## CLI

-   Auto-regeneration of TLS certificates when TLS error is detected
    -   Note: this will restart the Docker engine to apply
-   Minor UI updates including improved sorting and updated command docs
-   Bug with `config` and `env` with spaces fixed
    -   Note: you now must use `eval $(docker-machine env machine)` to load environment settings
-   Updates to better support `fish` shell
-   Use `--tlsverify` for both `config` and `env` commands
-   Commands now use eval for better interoperability with shell

## Testing

-   New integration test framework (bats)

# 0.1.0 (2015-02-26)

Initial beta release.

-   Provision Docker Engines using multiple drivers
-   Provide light management for the machines
    -   Create, Start, Stop, Restart, Kill, Remove, SSH
-   Configure the Docker Engine for secure communication (TLS)
-   Easily switch target machine for fast configuration of Docker Engine client
-   Provision Swarm clusters (experimental)

## Included drivers

-   Amazon EC2
-   Digital Ocean
-   Google
-   Microsoft Azure
-   Microsoft Hyper-V
-   Openstack
-   Rackspace
-   VirtualBox
-   VMware Fusion
-   VMware vCloud Air
-   VMware vSphere

redpajama_set_name: RedPajamaGithub


text:
using System;

namespace Abp.Web.Models
{
    /// <summary>
    /// Used to determine how ABP should wrap response on the web layer.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Method)]
    public class WrapResultAttribute : Attribute
    {
        /// <summary>
        /// Gets default <see cref="WrapResultAttribute"/>.
        /// </summary>
        public static WrapResultAttribute Default { get { return _default; } }
        private static readonly WrapResultAttribute _default = new WrapResultAttribute();

        /// <summary>
        /// Wrap result on success.
        /// </summary>
        public bool WrapOnSuccess { get; set; }

        /// <summary>
        /// Wrap result on error.
        /// </summary>
        public bool WrapOnError { get; set; }

        /// <summary>
        /// Log errors.
        /// Default: true.
        /// </summary>
        public bool LogError { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="WrapResultAttribute"/> class.
        /// </summary>
        /// <param name="wrapOnSuccess">Wrap result on success.</param>
        /// <param name="wrapOnError">Wrap result on error.</param>
        public WrapResultAttribute(bool wrapOnSuccess = true, bool wrapOnError = true)
        {
            WrapOnSuccess = wrapOnSuccess;
            WrapOnError = wrapOnError;

            LogError = true;
        }
    }
}


text:
extern crate proc_macro;
use proc_macro::{TokenStream, TokenTree, Ident, Punct, Spacing, Span};

#[proc_macro]
pub fn make_struct(input: TokenStream) -> TokenStream {
    match input.into_iter().next().unwrap() {
        TokenTree::Ident(ident) => {
            vec![
                TokenTree::Ident(Ident::new("struct", Span::call_site())),
                TokenTree::Ident(Ident::new_raw(&ident.to_string(), Span::call_site())),
                TokenTree::Punct(Punct::new(';', Spacing::Alone))
            ].into_iter().collect()
        }
        _ => panic!()
    }
}

#[proc_macro]
pub fn make_bad_struct(input: TokenStream) -> TokenStream {
    match input.into_iter().next().unwrap() {
        TokenTree::Ident(ident) => {
            vec![
                TokenTree::Ident(Ident::new_raw("struct", Span::call_site())),
                TokenTree::Ident(Ident::new(&ident.to_string(), Span::call_site())),
                TokenTree::Punct(Punct::new(';', Spacing::Alone))
            ].into_iter().collect()
        }
        _ => panic!()
    }
}


text:
#import <ResearchKit/ResearchKit.h>

#import <ResearchKit/ORKDefines_Private.h>

// Active step support
#import <ResearchKit/ORKTaskViewController_Private.h>
#import <ResearchKit/ORKDataLogger.h>
#import <ResearchKit/ORKErrors.h>

// Step view controllers (useful for appearance, customization by subclassing)
#import <ResearchKit/ORKQuestionStepViewController.h>
#import <ResearchKit/ORKInstructionStepViewController.h>
#import <ResearchKit/ORKVisualConsentStepViewController.h>
#import <ResearchKit/ORKConsentReviewStepViewController.h>
#import <ResearchKit/ORKFormStepViewController.h>
#import <ResearchKit/ORKImageCaptureStepViewController.h>
#import <ResearchKit/ORKWaitStepViewController.h>

// Custom steps
#import <ResearchKit/ORKCustomStepView.h>

// Specific active task modules
#import <ResearchKit/ORKOrderedTask_Private.h>

#import <ResearchKit/ORKAudioStep.h>
#import <ResearchKit/ORKToneAudiometryStep.h>
#import <ResearchKit/ORKToneAudiometryPracticeStep.h>
#import <ResearchKit/ORKSpatialSpanMemoryStep.h>
#import <ResearchKit/ORKWalkingTaskStep.h>
#import <ResearchKit/ORKCountdownStep.h>
#import <ResearchKit/ORKFitnessStep.h>
#import <ResearchKit/ORKTappingIntervalStep.h>
#import <ResearchKit/ORKTimedWalkStep.h>
#import <ResearchKit/ORKPSATStep.h>
#import <ResearchKit/ORKHolePegTestPlaceStep.h>
#import <ResearchKit/ORKHolePegTestRemoveStep.h>
#import <ResearchKit/ORKCompletionStep.h>
#import <ResearchKit/ORKReactionTimeStep.h>
#import <ResearchKit/ORKTowerOfHanoiStep.h>

#import <ResearchKit/ORKAudioStepViewController.h>
#import <ResearchKit/ORKToneAudiometryStepViewController.h>
#import <ResearchKit/ORKToneAudiometryPracticeStepViewController.h>
#import <ResearchKit/ORKSpatialSpanMemoryStepViewController.h>
#import <ResearchKit/ORKWalkingTaskStepViewController.h>
#import <ResearchKit/ORKCountdownStepViewController.h>
#import <ResearchKit/ORKFitnessStepViewController.h>
#import <ResearchKit/ORKTappingIntervalStepViewController.h>
#import <ResearchKit/ORKTimedWalkStepViewController.h>
#import <ResearchKit/ORKPSATStepViewController.h>
#import <ResearchKit/ORKHolePegTestPlaceStepViewController.h>
#import <ResearchKit/ORKHolePegTestRemoveStepViewController.h>
#import <ResearchKit/ORKCompletionStepViewController.h>

// More internal stuff
#import <ResearchKit/ORKResult_Private.h>
#import <ResearchKit/ORKQuestionStepViewController_Private.h>
#import <ResearchKit/ORKRecorder_Private.h>
#import <ResearchKit/ORKStepNavigationRule_Private.h>


text:
Placeholder plugin for jQuery. The placeholder doesn't use `.value` or `z-index` hacks. It also gives you a chance to style
the placeholder differently when the user has the input focused but hasn't yet typed anything, even CSS-transition animations are possible.

Markup/Data-API supported.

Usage
-----

The placeholder can only be called on textarea and input elements

    $('#my_input').placeholder(optionsObject)

Options
-------

* hideOnFocus - Boolean. The placeholder is always hidden when the input is in focus. By default empty inputs show the placeholder even while focused.
* text - String. The placeholder text to show. Defaults to `"Write something here..."`

Global Options
-------

Global options affect all placeholder instances, it is not possible to configure these on per-instance basis.

* styleClass - String. The CSS class given to the placeholder text containers. Defaults to `"jquery-placeholder-text"`
* focusedClass - String. An additional CSS class given to a placeholder container when focused. `"jquery-placeholder-text-focused"`

The class names are completely arbitrary and there should be no need to change them. If you need different styling on your page
for different inputs, then you should add CSS combinator rules. E.g.

    .red-form .jquery-placeholder-text {
        color: red;
    }

    .blue-form .jquery-placeholder-text {
        color: blue;
    }

To change a global option, the syntax is `$.fn.placeholder.options.optionName = newValue;`

Methods
-------

__.placeholder("destroy")__
Destroy the placeholder enhancement from an input. Needs to be called
when you are about to remove the target element, otherwise memory will be leaked.

    $("#some-input").placeholder("destroy");

You can also just trigger the event `"destroy"` on the target element

    $("#some-input").trigger("destroy")

Markup/Data-API
--------

You can use the placeholder plugin without extra javascript by specifying data attributes on the element:

    <input type="text" placeholder="Write something here...">

The text for the placeholder is picked up from the attribute's value. You may specify the `hideOnFocus` option by:

    data-placeholder-hide-on-focus="true"

The plugin will automatically disable native placeholder.

**Note:** dynamically created elements need to be called manually with javascript. You may also call `$.fn.placeholder.refresh()` at any point to instantiate any
uninitialized `data-placeholder` inputs. It is automatically called once on DOM ready event which makes the data API work.

See [the demo page](http://petkaantonov.github.io/jQuery-placeholder/demo.html) for a better overview

Building
----------

Building requires [Closure Compiler](http://dl.google.com/closure-compiler/compiler-latest.zip) to be placed
one directory up from the project in `closure_compiler` directory.

The setting is in `Gruntfile.js`, expressed as `closurePath: '../closure_compiler'`

Clone or download the repository, and while in the project root, run:

    npm install
    grunt

Builds will appear in the `/js` folder. The source code cannot be ran directly without building.


text:
package org.pcap4j.packet.namednumber;

import java.util.HashMap;
import java.util.Map;

/**
 * ARP Hardware Type
 *
 * @see IANA Registry
 * @author Kaito Yamada
 * @since pcap4j 0.9.1
 */
public final class ArpHardwareType extends NamedNumber<Short, ArpHardwareType> {

  /**
   *
   */
  private static final long serialVersionUID = -4679864421785826910L;

  /**
   * Ethernet (10Mb): 1
   */
  public static final ArpHardwareType ETHERNET
    = new ArpHardwareType((short)1, "Ethernet (10Mb)");

  /**
   * Experimental Ethernet (3Mb): 2
   */
  public static final ArpHardwareType EXPERIMENTAL_ETHERNET
    = new ArpHardwareType((short)2, "Experimental Ethernet (3Mb)");

  /**
   * Amateur Radio AX.25: 3
   */
  public static final ArpHardwareType AMATEUR_RADIO_AX_25
    = new ArpHardwareType((short)3, "Amateur Radio AX.25");

  /**
   * Proteon ProNET Token Ring: 4
   */
  public static final ArpHardwareType PROTEON_PRONET_TOKEN_RING
    = new ArpHardwareType((short)4, "Proteon ProNET Token Ring");

  /**
   * Chaos: 5
   */
  public static final ArpHardwareType CHAOS
    = new ArpHardwareType((short)5, "Chaos");

  /**
   * IEEE 802 Networks: 6
   */
  public static final ArpHardwareType IEEE_802_NETWORKS
    = new ArpHardwareType((short)6, "IEEE 802 Networks");

  /**
   * ARCNET: 7
   */
  public static final ArpHardwareType ARCNET
    = new ArpHardwareType((short)7, "ARCNET");

  /**
   * Hyperchannel: 8
   */
  public static final ArpHardwareType HYPERCHANNEL
    = new ArpHardwareType((short)8, "Hyperchannel");

  /**
   * Lanstar: 9
   */
  public static final ArpHardwareType LANSTAR
    = new ArpHardwareType((short)9, "Lanstar");

  /**
   * Autonet Short Address: 10
   */
  public static final ArpHardwareType AUTONET_SHORT_ADDRESS
    = new ArpHardwareType((short)10, "Autonet Short Address");

  /**
   * LocalTalk: 11
   */
  public static final ArpHardwareType LOCALTALK
    = new ArpHardwareType((short)11, "LocalTalk");

  /**
   * LocalNet (IBM PCNet or SYTEK LocalNET): 12
   */
  public static final ArpHardwareType LOCALNET
    = new ArpHardwareType((short)12, "LocalNet (IBM PCNet or SYTEK LocalNET)");

  /**
   * Ultra link: 13
   */
  public static final ArpHardwareType ULTRA_LINK
    = new ArpHardwareType((short)13, "Ultra link");

  /**
   * SMDS: 14
   */
  public static final ArpHardwareType SMDS
    = new ArpHardwareType((short)14, "SMDS");

  /**
   * Frame Relay: 15
   */
  public static final ArpHardwareType FRAME_RELAY
    = new ArpHardwareType((short)15, "Frame Relay");

  /**
   * Asynchronous Transmission Mode (ATM): 16
   */
  public static final ArpHardwareType ATM_16
    = new ArpHardwareType((short)16, "Asynchronous Transmission Mode (ATM)");

  /**
   * HDLC: 17
   */
  public static final ArpHardwareType HDLC
    = new ArpHardwareType((short)17, "HDLC");

  /**
   * Fibre Channel: 18
   */
  public static final ArpHardwareType FIBRE_CHANNEL
    = new ArpHardwareType((short)18, "Fibre Channel");

  /**
   * Asynchronous Transmission Mode (ATM): 19
   */
  public static final ArpHardwareType ATM_19
    = new ArpHardwareType((short)19, "Asynchronous Transmission Mode (ATM)");

  /**
   * Serial Line: 20
   */
  public static final ArpHardwareType SERIAL_LINE
    = new ArpHardwareType((short)20, "Serial Line");

  /**
   * Asynchronous Transmission Mode (ATM): 21
   */
  public static final ArpHardwareType ATM_21
    = new ArpHardwareType((short)21, "Asynchronous Transmission Mode (ATM)");

  /**
   * MIL-STD-188-220: 22
   */
  public static final ArpHardwareType MIL_STD_188_220
    = new ArpHardwareType((short)22, "MIL-STD-188-220");

  /**
   * Metricom: 23
   */
  public static final ArpHardwareType METRICOM
    = new ArpHardwareType((short)23, "Metricom");

  /**
   * IEEE 1394.1995: 24
   */
  public static final ArpHardwareType IEEE_1394_1995
    = new ArpHardwareType((short)24, "IEEE 1394.1995");

  /**
   * MAPOS: 25
   */
  public static final ArpHardwareType MAPOS
    = new ArpHardwareType((short)25, "MAPOS");

  /**
   * Twinaxial: 26
   */
  public static final ArpHardwareType TWINAXIAL
    = new ArpHardwareType((short)26, "Twinaxial");

  /**
   * EUI-64: 27
   */
  public static final ArpHardwareType EUI_64
    = new ArpHardwareType((short)27, "EUI-64");

  /**
   * HIPARP: 28
   */
  public static final ArpHardwareType HIPARP
    = new ArpHardwareType((short)28, "HIPARP");

  /**
   * IP and ARP over ISO 7816-3: 29
   */
  public static final ArpHardwareType IP_AND_ARP_OVER_ISO_7816_3
    = new ArpHardwareType((short)29, "IP and ARP over ISO 7816-3");

  /**
   * ARPSec: 30
   */
  public static final ArpHardwareType ARPSEC
    = new ArpHardwareType((short)30, "ARPSec");

  /**
   * IPsec tunnel: 31
   */
  public static final ArpHardwareType IPSEC_TUNNEL
    = new ArpHardwareType((short)31, "IPsec tunnel");

  /**
   * InfiniBand: 32
   */
  public static final ArpHardwareType INFINIBAND
    = new ArpHardwareType((short)32, "InfiniBand");

  /**
   * TIA-102 Project 25 Common Air Interface (CAI): 33
   */
  public static final ArpHardwareType CAI
    = new ArpHardwareType((short)33, "TIA-102 Project 25 Common Air Interface (CAI)");

  /**
   * Wiegand Interface: 34
   */
  public static final ArpHardwareType WIEGAND_INTERFACE
    = new ArpHardwareType((short)34, "Wiegand Interface");

  /**
   * Pure IP: 35
   */
  public static final ArpHardwareType PURE_IP
    = new ArpHardwareType((short)35, "Pure IP");

  /**
   * HW_EXP1: 36
   */
  public static final ArpHardwareType HW_EXP1
    = new ArpHardwareType((short)36, "HW_EXP1");

  /**
   * HFI: 37
   */
  public static final ArpHardwareType HFI
    = new ArpHardwareType((short)37, "HFI");

  /**
   * HW_EXP2: 256
   */
  public static final ArpHardwareType HW_EXP2
    = new ArpHardwareType((short)256, "HW_EXP2");

  private static final Map<Short, ArpHardwareType> registry
    = new HashMap<Short, ArpHardwareType>(40);

  static {
    registry.put(ETHERNET.value(), ETHERNET);
    registry.put(EXPERIMENTAL_ETHERNET.value(), EXPERIMENTAL_ETHERNET);
    registry.put(AMATEUR_RADIO_AX_25.value(), AMATEUR_RADIO_AX_25);
    registry.put(PROTEON_PRONET_TOKEN_RING.value(), PROTEON_PRONET_TOKEN_RING);
    registry.put(CHAOS.value(), CHAOS);
    registry.put(IEEE_802_NETWORKS.value(), IEEE_802_NETWORKS);
    registry.put(ARCNET.value(), ARCNET);
    registry.put(HYPERCHANNEL.value(), HYPERCHANNEL);
    registry.put(LANSTAR.value(), LANSTAR);
    registry.put(AUTONET_SHORT_ADDRESS.value(), AUTONET_SHORT_ADDRESS);
    registry.put(LOCALTALK.value(), LOCALTALK);
    registry.put(LOCALNET.value(), LOCALNET);
    registry.put(ULTRA_LINK.value(), ULTRA_LINK);
    registry.put(SMDS.value(), SMDS);
    registry.put(FRAME_RELAY.value(), FRAME_RELAY);
    registry.put(ATM_16.value(), ATM_16);
    registry.put(HDLC.value(), HDLC);
    registry.put(FIBRE_CHANNEL.value(), FIBRE_CHANNEL);
    registry.put(ATM_19.value(), ATM_19);
    registry.put(SERIAL_LINE.value(), SERIAL_LINE);
    registry.put(ATM_21.value(), ATM_21);
    registry.put(MIL_STD_188_220.value(), MIL_STD_188_220);
    registry.put(METRICOM.value(), METRICOM);
    registry.put(IEEE_1394_1995.value(), IEEE_1394_1995);
    registry.put(MAPOS.value(), MAPOS);
    registry.put(TWINAXIAL.value(), TWINAXIAL);
    registry.put(EUI_64.value(), EUI_64);
    registry.put(HIPARP.value(), HIPARP);
    registry.put(IP_AND_ARP_OVER_ISO_7816_3.value(), IP_AND_ARP_OVER_ISO_7816_3);
    registry.put(ARPSEC.value(), ARPSEC);
    registry.put(IPSEC_TUNNEL.value(), IPSEC_TUNNEL);
    registry.put(INFINIBAND.value(), INFINIBAND);
    registry.put(CAI.value(), CAI);
    registry.put(WIEGAND_INTERFACE.value(), WIEGAND_INTERFACE);
    registry.put(PURE_IP.value(), PURE_IP);
    registry.put(HW_EXP1.value(), HW_EXP1);
    registry.put(HFI.value(), HFI);
    registry.put(HW_EXP2.value(), HW_EXP2);
  }

  /**
   *
   * @param value value
   * @param name name
   */
  public ArpHardwareType(Short value, String name) {
    super(value, name);
  }

  /**
   *
   * @param value value
   * @return a ArpHardwareType object.
   */
  public static ArpHardwareType getInstance(Short value) {
    if (registry.containsKey(value)) {
      return registry.get(value);
    }
    else {
      return new ArpHardwareType(value, "unknown");
    }
  }

  /**
   *
   * @param type type
   * @return a ArpHardwareType object.
   */
  public static ArpHardwareType register(ArpHardwareType type) {
    return registry.put(type.value(), type);
  }

  @Override
  public String valueAsString() {
    return String.valueOf(value() & 0xFFFF);
  }

  @Override
  public int compareTo(ArpHardwareType o) {
    return value().compareTo(o.value());
  }

}


text:
typedef enum {
    UNIFYING_FRAME_HIDPP_SHORT = 0x10,
    UNIFYING_FRAME_HIDPP_LONG  = 0x11,

    UNIFYING_FRAME_UNENCRYPTED_HID = 0xC1,
    UNIFYING_FRAME_MOUSE = 0xC2,
    UNIFYING_FRAME_MEDIA = 0xC3,

    UNIFYING_FRAME_EXTRA_BUTTON = 0xD1,
    UNIFYING_FRAME_ENCRYPTED_HID = 0xD3,

    UNIFYING_FRAME_KEEP_ALIVE_1 = 0x40,
    UNIFYING_FRAME_KEEP_ALIVE_2 = 0x4F,

    UNIFYING_FRAME_HIDPP_SHORT_RESP = 0x50,
    UNIFYING_FRAME_HIDPP_LONG_RESP = 0x51,

    UNIFYING_FRAME_PAIRING = 0x5f,

    // Seem to be have the same as 0x10 and 0x11 respectively
    // UNIFYING_FRAME_HIDPP_2 = 0x30,
    // UNIFYING_FRAME_HIDPP_3 = 0x31,
    // UNIFYING_FRAME_HIDPP_4 = 0x90,
    // UNIFYING_FRAME_HIDPP_5 = 0x91,
    // UNIFYING_FRAME_HIDPP_6 = 0xB0,
    // UNIFYING_FRAME_HIDPP_7 = 0xB1,
} unifying_frame_type_t;

typedef enum {
    UNIFYING_EXTRA_MIDDLE    = 0xAF,
    UNIFYING_EXTRA_SIDE_UP   = 0xB0,
    UNIFYING_EXTRA_SIDE_DOWN = 0xAE,
} unifying_extra_button;

typedef enum {
    UNIFYING_MSB_LEFT = 0x01,
    UNIFYING_MSB_RIGHT = 0x02,
    UNIFYING_MSB_MIDDLE = 0x04,
    UNIFYING_MSB_FORWARD = 0x08,
    UNIFYING_MSB_BACK = 0x10,

    // Not offically used in Logitech software, but used to store extra mouse
    // buttons in keyplus.
    UNIFYING_MSB_EXTRA_1 = 0x20,
    UNIFYING_MSB_EXTRA_2 = 0x40,
    UNIFYING_MSB_EXTRA_3 = 0x80,
} unifying_mouse_button_mask_t;

typedef struct {
    uint8_t id;
    uint8_t type;
    uint8_t step;
} ATTR_PACKED unifying_packet_header_t;

// Unifying Pairing packet step 1
typedef struct {
    uint8_t id; //< sending device id
    /// frame_type == 0x0f -> device to receiver
    /// frame_type == 0x1f -> receiver to device
    uint8_t frame_type;
    uint8_t step; //< step == 1
    uint8_t addr[5];
    uint8_t unknown_1;
    uint16_t pid;
    uint8_t unknown_2[2];
    uint16_t type;
    uint8_t unknown_3[5];
    uint8_t unknown_4;
    uint8_t checksum;
} ATTR_PACKED unifying_req_1_t;

typedef struct {
    uint8_t id; //< sending device id
    uint8_t frame_type;
    uint8_t step; //< step == 2
    uint8_t crypto[4];
    uint8_t serial[4];
    uint16_t ability;
    uint8_t unknown_1[8];
    uint8_t checksum;
} ATTR_PACKED unifying_req_2_t;

typedef struct {
    uint8_t id; //< sending device id
    uint8_t frame_type;
    uint8_t step; //< step == 3
    uint8_t unknown_1[2];
    uint8_t len;
    uint8_t dev_str[16];
    uint8_t checksum;
} ATTR_PACKED unifying_req_3_t;

typedef struct {
    uint8_t id; //< sending device id
    uint8_t frame_type;
    uint8_t step; //< step == 3
    uint8_t crypto[6];
    uint8_t checksum;
} ATTR_PACKED unifying_resp_3_t;

typedef struct {
    uint8_t id; //< sending device id
    uint8_t frame_type;
    uint8_t step;
    uint8_t cryto[6];
    uint8_t checksum;
} ATTR_PACKED unifying_req_4_t;

typedef union unifying_packet_t {
    unifying_packet_header_t header;
    unifying_req_1_t req_1;
    unifying_req_2_t req_2;
    unifying_req_3_t req_3;
    unifying_resp_3_t resp_3;
    unifying_req_4_t req_4;
} unifying_packet_t;

typedef struct unifying_mouse_state_t {
    uint8_t buttons_1;
    uint8_t buttons_2; // probably don't need this
    int16_t x;
    int16_t y;
    int8_t wheel_x;
    int8_t wheel_y;
} unifying_mouse_state_t;

/// Unifying basic mouse packet
///
/// frame_type: 0x2C
/// size: 10
typedef struct unifying_mouse_packet_t {
    uint8_t id; //< sending device id
    uint8_t frame_type;
    uint8_t buttons;
    uint8_t unknown;
    /// 8 least significant bits of 12bit x data
    uint8_t x0;
    /// The lower nibble contains the 4 most significant bits of x data.
    /// The upper nibble contains the 4 least significant bits of y data.
    ///
    /// b7 | b6 | b5 | b4 | b3  | b2  | b1  | b0  |
    /// Y3 | Y2 | Y1 | Y0 | x11 | x10 | x9  | x8  |
    uint8_t x1y0;
    /// 8 most significant bits of 12bit y data
    uint8_t y1;
    int8_t wheel_y;
    int8_t wheel_x;
    uint8_t checksum;
} ATTR_PACKED unifying_mouse_packet_t;

/// Unifying keep alive packet
/// Keep the RF channel on the unifying receiver open for the given amount of
/// time. If the device does not connect the receiver before this time is up,
/// the unifying receiver will switch channels.
///
/// NOTE: When observing a devices, it seems they cycle through their channel
/// table in 180ms??? when they can't make contact with the receiver.
///
/// NOTE: from dissasembly, when sending packet unifying receiver uses
/// 15 retransmits with 1ms delay
///
/// NOTE: Unifying receiver listen to one of 24 rf channels. These channels
/// are pulled from this lookup table: [
///     5  , 8  , 11 , 14 , 17 , 20 , 23 , 26 ,
///     29 , 32 , 35 , 38 , 41 , 44 , 47 , 50 ,
///     53 , 56 , 59 , 62 , 65 , 68 , 71 , 74
/// ]
///
/// frame_type: 0x40
/// size: 5
typedef struct unifying_keep_alive_t {
    uint8_t id; //< sending device id
    uint8_t frame_type;
    /// The keep alive time in millseconds.
    /// NOTE: network byte order is big endian
    uint16_t keep_alive_time;
    uint8_t checksum;
} ATTR_PACKED unifying_keep_alive_t;

/// Unifying long keep alive packet
/// Seems to be sent when transitioning between different keep alive states,
/// but otherwise seems to behave the same as the 0x40 packet type.
///
/// frame_type: 0x4f
/// size: 10
typedef struct unifying_keep_alive_long_t {
    uint8_t id; //< sending device id
    uint8_t frame_type;
    uint8_t buttons;
    uint8_t unknown_0;
    /// The keep alive time in millseconds.
    /// NOTE: network byte order is big endian
    uint16_t keep_alive_time;
    uint8_t unknown_1[4];
    uint8_t checksum;
} ATTR_PACKED unifying_keep_alive_long_t;

// Unifying HID++ long packet
//
// frame_type: 0x11
// size: 22
typedef struct unifying_hidpp10_long_t {
    uint8_t id; //< sending device id
    uint8_t frame_type; //< frame_type == 0x11
    uint8_t device_index;
    uint8_t sub_id;
    uint8_t parameters[17];
    uint8_t checksum;
} ATTR_PACKED unifying_hidpp10_long_t;

// Unifying HID++ short packet
//
// frame_type: 0x10
// size: 10
typedef struct unifying_hidpp10_t {
    uint8_t id; //< sending device id
    uint8_t frame_type; //< frame_type == 0x10
    uint8_t device_index;
    uint8_t sub_id;
    uint8_t parameters[4];
    uint8_t unused;
    uint8_t checksum;
} ATTR_PACKED unifying_hidpp10_t;

// Unifying HID++ long packet
//
// frame_type: 0x11
// size: 22
typedef struct unifying_hidpp20_long_t {
    uint8_t id; //< sending device id
    uint8_t frame_type; //< frame_type == 0x11
    uint8_t device_index;
    uint8_t feature_index;
    uint8_t software_id : 4;
    uint8_t function_id : 4;
    uint8_t parameters[16];
    uint8_t checksum;
} ATTR_PACKED unifying_hidpp20_long_t;

// Unifying HID++ short packet
//
// frame_type: 0x10
// size: 10
typedef struct unifying_hidpp20_t {
    uint8_t id; //< sending device id
    uint8_t frame_type; //< frame_type == 0x10
    uint8_t device_index;
    uint8_t feature_index;
    uint8_t software_id : 4;
    uint8_t function_id : 4;
    uint8_t parameters[3];
    uint8_t unused;
    uint8_t checksum;
} ATTR_PACKED unifying_hidpp20_t;

// Unifying HID++ special keys packet
//
// frame_type: 0x51
// size: 22
typedef struct unifying_hidpp20_diverted_buttons_t {
    uint8_t id; //< sending device id
    uint8_t frame_type; //< frame_type == 0x51
    uint8_t device_index;
    uint8_t feature_index;
    uint8_t software_id : 4; // 0
    uint8_t function_id : 4; // 0
    uint16_t control_id_list[4]; //
    uint8_t padding[7];
    uint8_t checksum;
} ATTR_PACKED unifying_hidpp20_diverted_buttons_t;

uint8_t unifying_calc_checksum(const XRAM uint8_t *data, const uint8_t len);
void unifying_send_packet(const XRAM uint8_t *data, uint8_t size);
void unifying_read_packet(const uint8_t XRAM *nrf_packet, uint8_t width);
void unifying_begin_pairing(void);
void unifying_pairing_poll(void);

bit_t unifying_is_pairing_active(void);


text:
#import <IDEFoundation/IDECommandLineBuildTask.h>

@interface IDECompilationBuildTask : IDECommandLineBuildTask
{
}

- (id)description;
- (void)main;
- (id)initWithIdentifier:(id)arg1 restorePersistedBuildResults:(BOOL)arg2 properties:(id)arg3;

@end


text:
INSERT INTO waffle_switch (name, active, note, created, modified)
VALUES ('mixed-listed-unlisted', 0, 'Allow mixed listed/unlisted versions on a single add-on.', NOW(), NOW());


text:
module opencoarrays_object_interface
  !! Object pattern abstract type to provide a universal interface to a userd-defined derived type ouptput
  !! capability specified in a generic binding
  implicit none

  type, abstract :: object
  contains
    procedure(write_formatted_interface), deferred :: write_formatted
    generic :: write(formatted) => write_formatted
  end type

  abstract interface
    subroutine write_formatted_interface(this,unit,iotype,vlist,iostat,iomsg)
      import object
      class(object), intent(in) :: this
      integer, intent(in) :: unit
      character (len=*), intent(in) :: iotype
      integer, intent(in) :: vlist(:)
      integer, intent(out) :: iostat
      character (len=*), intent(inout) :: iomsg
    end subroutine
  end interface

end module


text:
require 'spec_helper'

describe Camara::Deputados::Client do
  it "#obter_deputados" do
    xml_element = double 'XML'
    allow(Nokogiri).to receive(:XML).and_return(double(css: [xml_element]))
    expect(Camara::Deputados::Deputado).to receive(:new).with(xml_element)
    deputados = VCR.use_cassette('camara/deputados/obter_deputados') do
      Camara::Deputados.obter_deputados
    end
  end

  describe "#obter_detalhes_deputado" do
    it "#obter_detalhes_deputado" do
      xml_element = double 'XML'
      allow(Nokogiri).to receive(:XML).and_return(double(at_css: xml_element))
      expect(Camara::Deputados::Deputado).to receive(:new).with(xml_element)
      deputado = VCR.use_cassette('camara/deputados/obter_deputado_178387') do
        Camara::Deputados.obter_detalhes_deputado('178387')
      end
    end

    it 'returns nil if the id is invalid' do
      deputado = VCR.use_cassette('camara/deputados/obter_deputado_9999') do
        Camara::Deputados.obter_detalhes_deputado('9999')
      end

      expect(deputado).to be_nil
    end
  end

  describe '#obter_partidos_cd' do
    it "retorna um array de Partidos" do
      xml_element = double 'XML'
      allow(Nokogiri).to receive(:XML).and_return(double(css: [xml_element]))
      expect(Camara::Deputados::Partido).to receive(:new).with(xml_element)
      deputado = VCR.use_cassette('camara/deputados/obter_partidos_cd') do
        Camara::Deputados.obter_partidos_cd
      end
    end

    it "does something" do
      partidos = VCR.use_cassette('camara/deputados/obter_partidos_cd') do
        Camara::Deputados.obter_partidos_cd
      end
      partido = partidos.first

      expect(partidos).not_to           be_empty
      expect(partido).to                be_an_instance_of(Camara::Deputados::Partido)
      expect(partido.sigla_partido).to  eq('PEN')
      expect(partido.id_partido).to     eq('PEN')
      expect(partido.nome_partido).to   eq('Partido Ecológico Nacional')
      expect(partido.data_criacao).to   be_nil
      expect(partido.data_extincao).to  be_nil
    end
  end

  describe '#obter_lideres_bancadas' do
    it 'retorna as bancadas e seus líderes' do
      bancadas = VCR.use_cassette('camara/deputados/obter_lideres_bancadas') do
        Camara::Deputados.obter_lideres_bancadas
      end
      bancada = bancadas.first

      expect(bancadas).not_to  be_empty
      expect(bancada).to       be_an_instance_of(Camara::Deputados::Bancada)
      expect(bancada.sigla).to eq('PT')
      expect(bancada.nome).to  eq('Partido dos Trabalhadores')
      expect(bancada.lider).to be_an_instance_of(Camara::Deputados::Deputado)
      expect(bancada.lider.nome).to eq('VICENTINHO')
      expect(bancada.vice_lideres).not_to be_empty
      expect(bancada.vice_lideres.first).to be_an_instance_of(Camara::Deputados::Deputado)
      expect(bancada.vice_lideres.first.nome).to eq('ALESSANDRO MOLON')
    end
  end

  describe '#obter_partidos_bloco_cd' do
    it 'retorna os blocos de partidos' do
      blocos = VCR.use_cassette('camara/deputados/obter_partidos_bloco_cd') do
        Camara::Deputados.obter_partidos_bloco_cd
      end
      bloco = blocos.first
      partido = bloco.partidos.first

      expect(blocos).not_to be_empty
      expect(bloco).to be_an_instance_of(Camara::Deputados::Bloco)
      expect(bloco.id_bloco).to eq('10')
      expect(bloco.nome_bloco).to eq('PV, PPS')
      expect(bloco.sigla_bloco).to eq('PV, PPS')
      expect(bloco.data_criacao_bloco).to eq('01/02/2011')
      expect(bloco.data_extincao_bloco).to eq('01/02/2013')
      expect(bloco.partidos).not_to be_empty
      expect(partido).to be_an_instance_of(Camara::Deputados::Partido)
      expect(partido.id_partido).to eq('PPS')
      expect(partido.nome_partido).to eq('Partido Popular Socialista')
      expect(partido.sigla_partido).to eq('PPS')
      expect(partido.data_adesao_partido).to be_nil
      expect(partido.data_desligamento_partido).to be_nil
    end
  end
end


text:
doxample
========

Example of integrating Doxygen and Automake

This package shows how doxygen can be invoked from within Autoconf and
Automake. There is probably some official way to integrate additional
functionality into the autotools distribution, but the documentation is silent
on this and a quick glance throgh it wasn't encouraging. Hence this uses the
aclocal.m4/acinclude.m4 mechanism instead. It would be great if someone who is
more versed with the internals of autotools would perform better integration
with it.

What this does is add a few flags to the ./configure script (just run
./configure --help to see the list). Most doxygen output format are supported,
additional ones should be easy to support. Documentation is generated in a
'doc' directory.

You can install this package to see how the man pages installation works. The
program installed - doxample - is just a simple "Hello, world!" program. Note
that the doxygen-generated man pages are pretty bad. I usually patch them
heavily using a post-processing script before I install them. This can be added
manually to the Makefile. You might also simply ignore the man pages and just
stick with HTML/PDF/RTF.


text:
import * as path from 'path';
import * as webpack from 'webpack';
const angularExternals = require('webpack-angular-externals');
const rxjsExternals = require('webpack-rxjs-externals');
const pkg = require('./package.json');

export default {
  entry: {
    'angular-msms-utils.umd': path.join(__dirname, 'src', 'index.ts'),
    'angular-msms-utils.umd.min': path.join(__dirname, 'src', 'index.ts'),
  },
  output: {
    path: path.join(__dirname, 'dist', 'bundles'),
    filename: '[name].js',
    libraryTarget: 'umd',
    library: 'angularMsmsUtils'
  },
  externals: [
    angularExternals(),
    rxjsExternals()
  ],
  devtool: 'source-map',
  module: {
    rules: [{
      test: /\.ts$/,
      loader: 'tslint-loader?emitErrors=true&failOnHint=true',
      exclude: /node_modules/,
      enforce: 'pre'
    }, {
      test: /\.ts$/,
      loader: ['awesome-typescript-loader', 'angular2-template-loader'],
      exclude: /node_modules/
    },
      /* Embed files. */
      {
        test: /\.(html)$/,
        loader: 'raw-loader',
        // exclude: /\.async\.(html|css)$/
      },
      {
        test: /\.(css|scss)$/,
        loaders: ['to-string-loader', 'css-loader', 'sass-loader']
      }]
  },
  resolve: {
    extensions: ['.ts', '.js']
  },
  plugins: [
    new webpack.optimize.UglifyJsPlugin({
      include: /\.min\.js$/,
      sourceMap: true
    }),
    new webpack.ContextReplacementPlugin(
      /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
      path.join(__dirname, 'src')
    ),
    new webpack.BannerPlugin({
      banner: `
/**
 * ${pkg.name} - ${pkg.description}
 * @version v${pkg.version}
 * @author ${pkg.author}
 * @link ${pkg.homepage}
 * @license ${pkg.license}
 */
      `.trim(),
      raw: true,
      entryOnly: true
    })
  ]
};


text:
package boofcv.alg.filter.binary.impl;

import boofcv.struct.image.ImageUInt8;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * @author Peter Abeles
 */
public class TestBinaryInnerOps {
	@Test
	public void test() {
		CompreToBinaryNaiveInner tests = new CompreToBinaryNaiveInner(ImplBinaryInnerOps.class);
		tests.performTests(7);
	}

	private static class CompreToBinaryNaiveInner extends CompareToBinaryNaive {

		public CompreToBinaryNaiveInner(Class<?> testClass) {
			super(testClass);
		}

		@Override
		protected void compareResults(Object targetResult, Object[] targetParam, Object validationResult, Object[] validationParam) {
			ImageUInt8 t = (ImageUInt8) targetParam[1];
			ImageUInt8 v = (ImageUInt8) validationParam[1];

			for (int y = 1; y < t.height - 1; y++) {
				for (int x = 1; x < t.width - 1; x++) {
					assertEquals(t.get(x, y), v.get(x, y));
				}
			}
		}
	}
}


text:
<?php

final class PhabricatorApplicationDetailViewController
  extends PhabricatorApplicationsController {

  public function shouldAllowPublic() {
    return true;
  }

  public function handleRequest(AphrontRequest $request) {
    $viewer = $this->getViewer();
    $application = $request->getURIData('application');

    $selected = id(new PhabricatorApplicationQuery())
      ->setViewer($viewer)
      ->withClasses(array($application))
      ->executeOne();
    if (!$selected) {
      return new Aphront404Response();
    }

    $title = $selected->getName();

    $crumbs = $this->buildApplicationCrumbs();
    $crumbs->addTextCrumb($selected->getName());

    $header = id(new PHUIHeaderView())
      ->setHeader($title)
      ->setUser($viewer)
      ->setPolicyObject($selected);

    if ($selected->isInstalled()) {
      $header->setStatus('fa-check', 'bluegrey', pht('Installed'));
    } else {
      $header->setStatus('fa-ban', 'dark', pht('Uninstalled'));
    }

    $actions = $this->buildActionView($viewer, $selected);
    $properties = $this->buildPropertyView($selected, $actions);

    $object_box = id(new PHUIObjectBoxView())
      ->setHeader($header)
      ->addPropertyList($properties);

    $configs =
      PhabricatorApplicationConfigurationPanel::loadAllPanelsForApplication(
        $selected);

    $panels = array();
    foreach ($configs as $config) {
      $config->setViewer($viewer);
      $config->setApplication($selected);

      $panels[] = $config->buildConfigurationPagePanel();
    }

    return $this->buildApplicationPage(
      array(
        $crumbs,
        $object_box,
        $panels,
      ),
      array(
        'title' => $title,
      ));
  }

  private function buildPropertyView(
    PhabricatorApplication $application,
    PhabricatorActionListView $actions) {

    $viewer = $this->getRequest()->getUser();

    $properties = id(new PHUIPropertyListView());
    $properties->setActionList($actions);

    $properties->addProperty(
      pht('Description'),
      $application->getShortDescription());

    if ($application->getFlavorText()) {
      $properties->addProperty(
        null,
        phutil_tag('em', array(), $application->getFlavorText()));
    }

    if ($application->isPrototype()) {
      $proto_href = PhabricatorEnv::getDoclink(
        'User Guide: Prototype Applications');
      $learn_more = phutil_tag(
        'a',
        array(
          'href' => $proto_href,
          'target' => '_blank',
        ),
        pht('Learn More'));

      $properties->addProperty(
        pht('Prototype'),
        pht(
          'This application is a prototype. %s',
          $learn_more));
    }

    $overview = $application->getOverview();
    if ($overview) {
      $properties->addSectionHeader(
        pht('Overview'), PHUIPropertyListView::ICON_SUMMARY);
      $properties->addTextContent(
        PhabricatorMarkupEngine::renderOneObject(
          id(new PhabricatorMarkupOneOff())->setContent($overview),
          'default',
          $viewer));
    }

    $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
      $viewer,
      $application);

    $properties->addSectionHeader(
      pht('Policies'), 'fa-lock');

    foreach ($application->getCapabilities() as $capability) {
      $properties->addProperty(
        $application->getCapabilityLabel($capability),
        idx($descriptions, $capability));
    }

    return $properties;
  }

  private function buildActionView(
    PhabricatorUser $user,
    PhabricatorApplication $selected) {

    $view = id(new PhabricatorActionListView())
      ->setUser($user);

    $can_edit = PhabricatorPolicyFilter::hasCapability(
      $user,
      $selected,
      PhabricatorPolicyCapability::CAN_EDIT);

    $edit_uri = $this->getApplicationURI('edit/'.get_class($selected).'/');

    $view->addAction(
      id(new PhabricatorActionView())
        ->setName(pht('Edit Policies'))
        ->setIcon('fa-pencil')
        ->setDisabled(!$can_edit)
        ->setWorkflow(!$can_edit)
        ->setHref($edit_uri));

    if ($selected->canUninstall()) {
      if ($selected->isInstalled()) {
        $view->addAction(
          id(new PhabricatorActionView())
            ->setName(pht('Uninstall'))
            ->setIcon('fa-times')
            ->setDisabled(!$can_edit)
            ->setWorkflow(true)
            ->setHref(
              $this->getApplicationURI(get_class($selected).'/uninstall/')));
      } else {
        $action = id(new PhabricatorActionView())
          ->setName(pht('Install'))
          ->setIcon('fa-plus')
          ->setDisabled(!$can_edit)
          ->setWorkflow(true)
          ->setHref(
             $this->getApplicationURI(get_class($selected).'/install/'));

        $prototypes_enabled = PhabricatorEnv::getEnvConfig(
          'phabricator.show-prototypes');
        if ($selected->isPrototype() && !$prototypes_enabled) {
          $action->setDisabled(true);
        }

        $view->addAction($action);
      }
    } else {
      $view->addAction(
        id(new PhabricatorActionView())
          ->setName(pht('Uninstall'))
          ->setIcon('fa-times')
          ->setWorkflow(true)
          ->setDisabled(true)
          ->setHref(
            $this->getApplicationURI(get_class($selected).'/uninstall/')));
    }

    return $view;
  }

}


text:
  Définit un paramètre simple comme une chaîne de caractères, qui peut être
  sélectionnée dans une liste. Vous pouvez l'utiliser dans un build, comme
  variable d'environnement ou dans d'autres endroits de la configuration à
  l'aide de la substituion de variables.


text:
layout: post
title: Head Equalization Error
categories: video analog
tags: [Video, Analog, Chrominance, Hue, Banding, 2-inch Quad, Open Reel Tape, Device Error]
---

A banding artifact results when one or more video heads has been incorrectly adjusted for 2" tape playback. All four heads in a Quad player must be properly equalized to the recording in order to prevent this kind of error.  If Ampex Auto Chroma is engaged, it will automatically adjust EQ for proper playback. There are manual controls for adjustment, as well.

Establishing perfect head equalization has always been tricky. In the early days of Quad use, it was not uncommon to ship from one station to another the heads used in the recording with the tape itself so that the original heads could be employed in playback, eliminating the need to recreate the set up on a different machine.

## Can it be fixed?

If this banding error is detected on a Quad player, it may be able to be fixed by making proper head adjustments, usually through the use of an electronic delay control. If the banding is seen in a second generation recording captured from the original Quad recording, then the artifact cannot be eliminated through playback adjustment.

## Example(s)

The equalization on one head was turned all the way down to create this image. Notice it is primarily an error in chrominance since the luminance (white) bar on the left shows no banding.


text:
namespace AdiIRCAPIv2.Delegates
{
    using Arguments.ScriptHttpDownload;

    /// <summary>
    ///     Delegate gets called when AdiIRC starts an HTTP download
    /// </summary>
    /// <remarks>
    ///     Scripted Event Equivalent: overriding <c>/download</c>
    /// </remarks>
    /// <param name="argument">ScriptHttpDownloadStartedArgs</param>
    public delegate void ScriptHttpDownloadStarted(ScriptHttpDownloadStartedArgs argument);

    /// <summary>
    ///     Delegate gets called when adiirc finishes an HTTP download
    /// </summary>
    /// <remarks>
    ///     Scripted Event Equivalent: <c>on DOWNLOAD</c>
    /// </remarks>
    /// <param name="argument">ScriptHttpDownloadEndArgs</param>
    public delegate void ScriptHttpDownloadEnd(ScriptHttpDownloadEndArgs argument);
}


text:
/*
 * HomeReducer
 *
 * The reducer takes care of our data. Using actions, we can change our
 * application state.
 * To add a new action, add it to the switch statement in the reducer function
 *
 * Example:
 * case YOUR_ACTION_CONSTANT:
 *   return state.set('yourStateVariable', true);
 */
import {fromJS} from 'immutable';

import {
  CHANGE_EMAIL,
  CHANGE_PASSWORD,
  SIGN_IN,
  SIGN_IN_SUCCESS,
  SIGN_IN_ERROR,
  CREATE_TNX,
  CREATE_TNX_SUCCESS,
  CREATE_TNX_ERROR,
  SELECT_FILE_ERROR,
  CLEAR_SELECT_FILE_ERROR,
  CLEAR_LOADING
} from './constants';

import {
  SIGN_OUT
} from 'containers/App/constants';

// The initial state of the App
const initialState = fromJS({
  loading: false,
  email: '',
  password: ''
});

function homeReducer(state = initialState, action) {
  switch (action.type) {
    case CHANGE_EMAIL:
      return state
        .set('email', action.email);
    case CHANGE_PASSWORD:
      return state
        .set('password', action.password)
        .set('currentUser', false);
    case SIGN_IN:
      return state
        .set('loading', true)
        .set('error', false)
        .set('currentUser', false);
    case SIGN_IN_SUCCESS:
      return state
        .set('loading', false)
        .set('error', false)
        .set('currentUser', action.response.data);
    case SIGN_IN_ERROR:
      return state
        .set('loading', false)
        .set('error', action.err)
    case CREATE_TNX:
      return state
        .set('loading', true)
        .set('error', false)
    // .set('createTnxParams', action.params)
    case CREATE_TNX_SUCCESS:
      return state
        .set('loading', false)
        .set('error', false)
        .set('success', "200")
    case CREATE_TNX_ERROR:
      return state
        .set('loading', false)
        .set('error', action.err)
    case SELECT_FILE_ERROR:
      return state
        .set('loading', false)
        .set('error', action.err)
    case CLEAR_SELECT_FILE_ERROR:
      return state
        .set('error', false)
        .set('success', false)
    case CLEAR_LOADING:
      return state
        .set('loading', false)
    case "persist/REHYDRATE":
      return state
        .set('error', false)
        .set('loading', false);
    case SIGN_OUT:
      state = initialState
      return state
      // return state
      //   .set('error', false)
      //   .set('loading', false);
    default:
      return state;
  }
}

export default homeReducer;


text:
<?php

namespace Indigo\Supervisor\Exception\Fault;

use Indigo\Supervisor\Exception\Fault;

/**
 * Implements STILL_RUNNING Fault exception
 *
 * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
 */
class StillRunning extends Fault
{

}


text:
nix_print() {
  if [ ${NIX_DEBUG:-0} -ge $1 ]; then
    echo "$2"
  fi
}

nix_debug() {
  nix_print 3 "$1"
}

addToLuaSearchPathWithCustomDelimiter() {
  local varName="$1"
  local absPattern="$2"
  # delete longest match starting from the lua placeholder '?'
  local topDir="${absPattern%%\?*}"

  # export only if the folder exists else LUA_PATH/LUA_CPATH grow too large
  if [[ ! -d "$topDir" ]]; then return; fi

  # export only if we haven't already got this dir in the search path
  if [[ ${!varName-} == *"$absPattern"* ]]; then return; fi

  export "${varName}=${!varName:+${!varName};}${absPattern}"
}

addToLuaPath() {
  local dir="$1"

  if [[ ! -d "$dir" ]]; then
    nix_debug "$dir not a directory abort"
    return 0
  fi
  cd "$dir"
  for pattern in @luapathsearchpaths@; do
    addToLuaSearchPathWithCustomDelimiter LUA_PATH "$PWD/$pattern"
  done

  # LUA_CPATH
  for pattern in @luacpathsearchpaths@; do
    addToLuaSearchPathWithCustomDelimiter LUA_CPATH "$PWD/$pattern"
  done
  cd - >/dev/null
}

addEnvHooks "$hostOffset" addToLuaPath


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:plugin="http://schemas.synyx.org/hera"
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:module="http://schemas.synyx.org/minos/module"
    xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
		http://schemas.synyx.org/hera http://schemas.synyx.org/hera/hera.xsd
        http://schemas.synyx.org/minos/module http://schemas.synyx.org/minos/module/minos-module.xsd">

	<aop:aspectj-autoproxy />

	<import resource="dao-context.xml" />
	<import resource="security-context.xml" />
	<import resource="transaction-context.xml" />

	<!-- PostProcessor to remove decorators whose module dependencies are not satisfied
	<bean class="org.synyx.minos.core.module.support.ModulePostProcessor" />
    -->

	<bean class="org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor" />
    <bean class="org.synyx.minos.core.module.support.ModuleManagerAwareBeanPostProcessor" />

	<!--

		Notification base configuration

		* register NotificationService
		* register EmailNotificationProvider as default provider
		* enable automatic lookup of NotificationProvider implementations

	-->

	<bean id="notificationService" class="org.synyx.minos.core.notification.ProviderBasedNotificationService">
		<constructor-arg ref="emailNotificationProvider" />
		<property name="notificationProviders" ref="notificationProviders" />
	</bean>

	<bean id="emailNotificationProvider" class="org.synyx.minos.core.notification.EmailNotificationProvider">
		<constructor-arg ref="mailSender" />
	</bean>

	<plugin:registry id="notificationProviders" class="org.synyx.minos.core.notification.NotificationProvider" />

    <!--

        Module infrastructure

     -->
    <module:module id="core" />

    <bean class="org.synyx.minos.core.module.internal.MinosModuleManager">
        <constructor-arg ref="moduleDescriptorDao" />
        <property name="modules">
            <plugin:list class="org.synyx.minos.core.module.Module" />
        </property>
    </bean>

    <bean id="messageSource" class="org.synyx.minos.core.message.DispatchingMessageSource">
		<property name="sources">
			<plugin:list class="org.synyx.minos.core.message.ModuleMessageSource" />
		</property>
        <property name="useCodeAsDefaultMessage" value="true" />
	</bean>

    <bean class="org.synyx.minos.core.message.ModuleMessageSourceImpl">
        <constructor-arg ref="core" />
    </bean>

    <bean id="moduleBeanFactoryPostProcessor" class="org.synyx.minos.core.module.config.ModuleBeanFactoryPostProcessor"/>

    <!--
        Fileupload - needs to be in here rather than web-context.xml as it is being looked up
        by the MultipartResolverFilter
    -->

    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <!-- Max size in bytes. -->
        <property name="maxUploadSize" value="100000"/>
    </bean>

    <bean id="defaultMenuRenderer" class="org.synyx.tagsupport.tags.menu.DefaultMenuRenderer">
        <property name="alwaysRenderSubmenus" value="false"/>
        <property name="levels" value="0"/>
        <property name="rootId" value="menu"/>
    </bean>
</beans>


text:
<?php

namespace RunMyBusiness\Initialcon;

use Intervention\Image\ImageManagerStatic as Image;

class Initialcon
{
    /**
     * @var string
     */
    private $hash;

    /**
     * @var string
     */
    private $initials;

    /**
     * @var int
     */
    private $color;

    /**
     * @var int
     */
    private $size;

    /**
     * @var int
     */
    private $fontPath;

    /**
     * @var int
     */
    private $pixelRatio;

    /**
     * Set the image size.
     *
     * @param int $size
     *
     * @return Initialcon
     */
    public function setSize($size)
    {
        $this->size = $size;
        $this->pixelRatio = round($size / 5);

        return $this;
    }

    /**
     * Get the image size.
     *
     * @return int
     */
    public function getSize()
    {
        return $this->size;
    }

    /**
     * Get the text size.
     *
     * @return int
     */
    public function getTextSize()
    {
        return (strlen($this->initials) === 2) ? round($this->size / 1.5) : $this->size;
    }

    /**
     * Generate a hash fron the identifier.
     *
     * @param string $string
     *
     * @return Initialcon
     */
    public function setInitials($initials)
    {
        if (null === $initials) {
            throw new \Exception('The initials cannot be null.');
        }

        $this->initials = substr($initials, 0, 2);

        return $this;
    }

    /**
     * Generate a hash fron the identifier.
     *
     * @param string $string
     *
     * @return Initialcon
     */
    public function setIdentifier($identifier)
    {
        if (null === $identifier) {
            throw new \Exception('The identifier cannot be null.');
        }

        $this->hash = md5($identifier);

        $this->convertHashToArrayOfBoolean();

        return $this;
    }

    /**
     * Get the Initialcon string hash.
     *
     * @return string
     */
    public function getHash()
    {
        return $this->hash;
    }

    /**
     * Convert the hash into an multidimensionnal array of boolean.
     *
     * @return Initialcon
     */
    private function convertHashToArrayOfBoolean()
    {
        preg_match_all('/(\w)(\w)/', $this->hash, $chars);

        $this->color[0] = hexdec(array_pop($chars[1])) * 16;
        $this->color[1] = hexdec(array_pop($chars[1])) * 16;
        $this->color[2] = hexdec(array_pop($chars[1])) * 16;

        return $this;
    }

    /**
     * Convert an heaxecimal number into a boolean.
     *
     * @param string $hexa
     *
     * @return bool
     */
    private function convertHexaToBoolean($hexa)
    {
        return (bool) intval(round(hexdec($hexa) / 10));
    }

    /**
     * Generate the Initialcon image.
     *
     * @param string $string
     * @param int    $size
     * @param string $hexaColor
     */
    private function generateImage($initials, $identifier, $size, $color)
    {
        $this->setInitials($initials);
        $this->setIdentifier($identifier);
        $this->setSize($size);
        $textSize = $this->getTextSize();

        if ($this->fontPath === null) {
            $this->setFontPath(__DIR__.'/OpenSans-Regular.ttf');
        }

        $fontFilePath = $this->getFontPath();

        // prepage the color
        if (null !== $color) {
            $this->setColor($color);
        }

        $image = Image::canvas($size, $size, $this->getColor());

        $image->text($this->initials, ($size / 2), ($size / 2), function ($font) use ($textSize, $fontFilePath) {
            $font->size($textSize);
            $font->color('#ffffff');
            $font->align('center');
            $font->valign('middle');
            $font->file($fontFilePath);
        });

        return $image;
    }

    /**
     * Set the image color.
     *
     * @param string $color The color in hexa (6 chars)
     *
     * @return Initialcon
     */
    public function setColor($color)
    {
        if (false !== strpos($color, '#')) {
            $color = substr($color, 1);
        }
        $this->color = hexdec(substr($color, 0, 2));
        $this->color .= hexdec(substr($color, 2, 2));
        $this->color .= hexdec(substr($color, 4, 2));

        return $this;
    }

    /**
     * Get the color.
     *
     * @return string
     */
    public function getColor()
    {
        return $this->color;
    }

    /**
     * Get the font path.
     *
     * @return string
     */
    public function getFontPath()
    {
        return realpath($this->fontPath);
    }

    /**
     * Set the font path.
     *
     * @param string $path
     */
    public function setFontPath($path)
    {
        $this->fontPath = $path;
    }

    /**
     * Display an Initialcon image.
     *
     * @param string $initials
     * @param string $identifier
     * @param int    $size
     * @param string $hexaColor
     */
    public function displayImage($initials, $identifier, $size = 64, $hexaColor = null)
    {
        header('Content-Type: image/png');
        $img = $this->generateImage($initials, $identifier, $size, $hexaColor);
        echo $img->encode('png');
    }

    /**
     * Display an Initialcon image.
     *
     * @param string $initials
     * @param string $identifier
     * @param int    $size
     * @param string $hexaColor
     *
     * @return Image
     */
    public function getImageObject($initials, $identifier, $size = 64, $hexaColor = null)
    {
        return $this->generateImage($initials, $identifier, $size, $hexaColor);
    }

    /**
     * Get an Initialcon PNG image data.
     *
     * @param string $initials
     * @param string $identifier
     * @param int    $size
     * @param string $hexaColor
     *
     * @return string
     */
    public function getImageData($initials, $identifier, $size = 64, $hexaColor = null)
    {
        $img = $this->generateImage($initials, $identifier, $size, $hexaColor);

        return $img->encode('png');
    }

    /**
     * Get an Initialcon PNG image data.
     *
     * @param string $initials
     * @param string $identifier
     * @param int    $size
     * @param string $hexaColor
     *
     * @return string
     */
    public function getImageDataUri($initials, $identifier, $size = 64, $hexaColor = null)
    {
        return sprintf('data:image/png;base64,%s', base64_encode($this->getImageData($initials, $identifier, $size, $hexaColor)));
    }
}


text:
#include "ECPReader.h"

class CECRReader :
	virtual public CECPReader
{
public:
	CECRReader(CReader *Owner,CBaseCommunication *Communicator);
	virtual ~CECRReader(void);

	virtual void SetHWString(char *String);
	virtual void GetProductString(uint8_t *Product);

protected:
	virtual RSCT_IFD_RESULT IfdPower(uint32_t Mode, uint8_t *ATR, uint32_t *ATR_Length, uint32_t Timeout);
	virtual RSCT_IFD_RESULT IfdSetProtocol(uint32_t *Protocol);
	virtual RSCT_IFD_RESULT _IfdTransmit(const uint8_t *cmd, uint16_t cmd_len,uint8_t *response,uint16_t *response_len);
   virtual RSCT_IFD_RESULT IfdVendor(uint32_t IoCtrlCode,uint8_t *Input,uint32_t InputLength,uint8_t *Output,uint32_t *OutputLength);
	virtual CJ_RESULT BuildReaderInfo();
	virtual uint32_t GetReadersInputBufferSize();

private:
	uint8_t m_SerialNumber[10];
	int m_SerialNumberLength;

};

#endif


text:
import typing
from chip.clusters.Types import Nullable, NullValue
from chip.tlv import uint, float32
import enum
from chip.yaml.errors import ValidationError
import binascii

def convert_yaml_octet_string_to_bytes(s: str) -> bytes:
    """Convert YAML octet string body to bytes, handling any c-style hex escapes (e.g. \x5a) and hex: prefix"""
    # Step 1: handle explicit "hex:" prefix
    if s.startswith('hex:'):
        return binascii.unhexlify(s[4:])

    # Step 2: convert non-hex-prefixed to bytes
    # TODO(#23669): This does not properly support utf8 octet strings. We mimic
    # javascript codegen behavior. Behavior of javascript is:
    #   * Octet string character >= u+0200 errors out.
    #   * Any character greater than 0xFF has the upper bytes chopped off.
    as_bytes = [ord(c) for c in s]

    if any([value > 0x200 for value in as_bytes]):
        raise ValueError('Unsupported char in octet string %r' % as_bytes)
    accumulated_hex = ''.join([f"{(v & 0xFF):02x}" for v in as_bytes])
    return binascii.unhexlify(accumulated_hex)

def convert_name_value_pair_to_dict(arg_values):
    ''' Fix yaml command arguments.

    For some reason, instead of treating the entire data payload of a
    command as a singular struct, the top-level args are specified as 'name'
    and 'value' pairs, while the payload of each argument is itself
    correctly encapsulated. This fixes up this oddity to create a new
    key/value pair with the key being the value of the 'name' field, and
    the value being 'value' field.
    '''
    ret_value = {}

    for item in arg_values:
        ret_value[item['name']] = item['value']

    return ret_value

def convert_yaml_type(field_value, field_type, use_from_dict=False):
    ''' Converts yaml value to expected type.

    The YAML representation when converted to a Python dictionary does not
    quite line up in terms of type (see each of the specific if branches
    below for the rationale for the necessary fix-ups). This function does
    a fix-up given a field value (as present in the YAML) and its matching
    cluster object type and returns it.
    '''
    origin = typing.get_origin(field_type)

    if field_value is None:
        field_value = NullValue

    if (origin == typing.Union or origin == typing.Optional or origin == Nullable):
        underlying_field_type = None

        if field_value is NullValue:
            for t in typing.get_args(field_type):
                if t == Nullable:
                    return field_value

        for t in typing.get_args(field_type):
            # Comparison below explicitly not using 'isinstance' as that doesn't do what we want.
            if t != Nullable and t != type(None):
                underlying_field_type = t
                break

        if (underlying_field_type is None):
            raise ValueError(f"Can't find the underling type for {field_type}")

        field_type = underlying_field_type

    # Dictionary represents a data model struct.
    if (type(field_value) is dict):
        return_field_value = {}
        field_descriptors = field_type.descriptor
        for item in field_value:
            try:
                # We search for a matching item in the list of field descriptors
                # for this struct and ensure we can find a field with a matching
                # label.
                field_descriptor = next(
                    x for x in field_descriptors.Fields if x.Label.lower() ==
                    item.lower())
            except StopIteration as exc:
                raise ValidationError(
                    f'Did not find field "{item}" in {str(field_type)}') from None

            return_field_value[field_descriptor.Label] = convert_yaml_type(
                field_value[item], field_descriptor.Type, use_from_dict)
        if use_from_dict:
            return field_type.FromDict(return_field_value)
        return return_field_value
    elif(type(field_value) is float):
        return float32(field_value)
    # list represents a data model list
    elif(type(field_value) is list):
        list_element_type = typing.get_args(field_type)[0]

        # The field type passed in is the type of the list element and not list[T].
        for idx, item in enumerate(field_value):
            field_value[idx] = convert_yaml_type(item, list_element_type, use_from_dict)
        return field_value
    # YAML conversion treats all numbers as ints. Convert to a uint type if the schema
    # type indicates so.
    elif (field_type == uint):
        # Longer number are stored as strings. Need to make this conversion first.
        value = int(field_value)
        return field_type(value)
    # YAML treats enums as ints. Convert to the typed enum class.
    elif (issubclass(field_type, enum.Enum)):
        return field_type(field_value)
    # YAML treats bytes as strings. Convert to a byte string.
    elif (field_type == bytes and type(field_value) != bytes):
        return convert_yaml_octet_string_to_bytes(field_value)
    # By default, just return the field_value casted to field_type.
    else:
        return field_type(field_value)


text:
namespace RDKit {
namespace MolEnumerator {
namespace {

//! recursively builds the variations
void getVariations(size_t level, std::vector<size_t> base,
                   std::vector<std::vector<size_t>> &variations,
                   const std::vector<size_t> &variationCounts,
                   size_t maxToEnumerate, bool doRandom) {
  PRECONDITION(level < variationCounts.size(), "bad recursion");
  for (size_t i = 0; i < variationCounts[level]; ++i) {
    base[level] = i;
    if (level + 1 >= variationCounts.size()) {
      // at the bottom of the recursion
      variations.push_back(base);
    } else {
      getVariations(level + 1, base, variations, variationCounts,
                    maxToEnumerate, doRandom);
    }
    if (variations.size() >= maxToEnumerate) {
      return;
    }
  }
}
void enumerateVariations(std::vector<std::vector<size_t>> &variations,
                         const std::vector<size_t> &variationCounts,
                         const MolEnumeratorParams &params) {
  if (params.doRandom) {
    UNDER_CONSTRUCTION("random enumeration not yet supported");
  }
  variations.clear();
  std::vector<size_t> base(variationCounts.size(), 0);
  getVariations(0, base, variations, variationCounts, params.maxToEnumerate,
                params.doRandom);
}

}  // namespace

namespace detail {
const std::string idxPropName = "_enumeratorOrigIdx";
void preserveOrigIndices(ROMol &mol) {
  mol.setProp(idxPropName, 1);
  for (auto atom : mol.atoms()) {
    atom->setProp(idxPropName, atom->getIdx());
  }
}
void removeOrigIndices(ROMol &mol) {
  for (auto atom : mol.atoms()) {
    atom->clearProp(idxPropName);
  }
  mol.clearProp(idxPropName);
}
}  // namespace detail

MolBundle enumerate(const ROMol &mol,
                    const std::vector<MolEnumeratorParams> &paramLists) {
  if (paramLists.empty()) {
    return MolBundle();
  }
  std::unique_ptr<MolBundle> accum{new MolBundle()};
  boost::shared_ptr<ROMol> molCpy{new ROMol(mol)};
  detail::preserveOrigIndices(*molCpy);
  accum->addMol(molCpy);
  bool variationsFound = false;
  for (const auto &params : paramLists) {
    if (!params.dp_operation) {
      throw ValueErrorException("MolEnumeratorParams has no operation set");
    }
    std::unique_ptr<MolBundle> thisRound{new MolBundle()};
    for (const auto &tmol : accum->getMols()) {
      // copy the op since we will modify it:
      auto op = params.dp_operation->copy();
      op->initFromMol(*tmol);
      auto variationCounts = op->getVariationCounts();
      if (variationCounts.empty()) {
        thisRound->addMol(tmol);
        continue;
      }
      std::vector<std::vector<size_t>> variations;
      enumerateVariations(variations, variationCounts, params);
      for (const auto &variation : variations) {
        variationsFound = true;
        auto newMol = (*op)(variation);
        newMol->updatePropertyCache(false);
        thisRound->addMol(ROMOL_SPTR(newMol.release()));
      }
    }
    accum.swap(thisRound);
  }
  if (!variationsFound) {
    return MolBundle();
  }
  for (auto rmol : accum->getMols()) {
    detail::removeOrigIndices(*rmol);
  }
  return *accum;
}

MolBundle enumerate(const ROMol &mol, size_t maxPerOperation) {
  std::vector<MolEnumeratorParams> paramsList;

  // position variation first
  MolEnumerator::MolEnumeratorParams posVariationParams;
  auto pvOp = new MolEnumerator::PositionVariationOp();
  posVariationParams.dp_operation =
      std::shared_ptr<MolEnumerator::MolEnumeratorOp>(pvOp);
  if (maxPerOperation > 0) {
    posVariationParams.maxToEnumerate = maxPerOperation;
  }
  paramsList.push_back(posVariationParams);

  // now repeat units
  MolEnumerator::MolEnumeratorParams repeatUnitParams;
  auto sruOp = new MolEnumerator::RepeatUnitOp();
  repeatUnitParams.dp_operation =
      std::shared_ptr<MolEnumerator::MolEnumeratorOp>(sruOp);
  if (maxPerOperation > 0) {
    sruOp->d_defaultRepeatCount = maxPerOperation;
    repeatUnitParams.maxToEnumerate = maxPerOperation;
  }
  paramsList.push_back(repeatUnitParams);

  // linknodes last because we can only enumerate mols with a single
  // fragment
  MolEnumerator::MolEnumeratorParams linkParams;
  auto lpOp = new MolEnumerator::LinkNodeOp();
  linkParams.dp_operation =
      std::shared_ptr<MolEnumerator::MolEnumeratorOp>(lpOp);
  if (maxPerOperation > 0) {
    linkParams.maxToEnumerate = maxPerOperation;
  }
  paramsList.push_back(linkParams);

  return enumerate(mol, paramsList);
}

}  // namespace MolEnumerator

}  // namespace RDKit