text:
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;

using ZXing.Common;

namespace ZXing.ImageSharp.Rendering
{
    /// <summary>
    /// IBarcodeRenderer implementation which creates an ImageSharp Image object from the barcode BitMatrix
    /// </summary>
    public class ImageSharpRenderer<TPixel> : ZXing.Rendering.IBarcodeRenderer<Image<TPixel>> where TPixel : unmanaged, IPixel<TPixel>
    {
        /// <summary>
        /// Gets or sets the foreground color.
        /// </summary>
        /// <value>The foreground color.</value>
        public Color Foreground { get; set; }

        /// <summary>
        /// Gets or sets the background color.
        /// </summary>
        /// <value>The background color.</value>
        public Color Background { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="ImageSharpRenderer{TPixel}"/> class.
        /// </summary>
        public ImageSharpRenderer()
        {
            Foreground = Color.Black;
            Background = Color.White;
        }

        /// <summary>
        /// renders the image
        /// </summary>
        /// <param name="matrix"></param>
        /// <param name="format"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        public Image<TPixel> Render(BitMatrix matrix, BarcodeFormat format, string content)
        {
            return Render(matrix, format, content, new EncodingOptions());
        }

        /// <summary>
        /// renders the image
        /// </summary>
        /// <param name="matrix"></param>
        /// <param name="format"></param>
        /// <param name="content"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public Image<TPixel> Render(BitMatrix matrix, BarcodeFormat format, string content, EncodingOptions options)
        {
            var width = matrix.Width;
            var height = matrix.Height;
            var foreColor = Foreground;
            var backColor = Background;

            var pixelsize = 1;

            if (options != null)
            {
                if (options.Width > width)
                {
                    width = options.Width;
                }
                if (options.Height > height)
                {
                    height = options.Height;
                }
                // calculating the scaling factor
                pixelsize = width / matrix.Width;
                if (pixelsize > height / matrix.Height)
                {
                    pixelsize = height / matrix.Height;
                }
            }

            var result = new Image<TPixel>(width, height);
            for (int y = 0; y < matrix.Height; y++)
            {
                for (var pixelsizeHeight = 0; pixelsizeHeight < pixelsize; pixelsizeHeight++)
                {
                    var rowOffset = pixelsize * y + pixelsizeHeight;

                    for (var x = 0; x < matrix.Width; x++)
                    {
                        var color = matrix[x, y] ? foreColor : backColor;
                        for (var pixelsizeWidth = 0; pixelsizeWidth < pixelsize; pixelsizeWidth++)
                        {
                            var pixel = new TPixel();
                            pixel.FromRgba32(color);
                            result[pixelsize * x + pixelsizeWidth, rowOffset] = pixel;
                        }
                    }
                    for (var x = pixelsize * matrix.Width; x < width; x++)
                    {
                        var pixel = new TPixel();
                        pixel.FromRgba32(backColor);
                        result[x, rowOffset] = pixel;
                    }
                }
            }

            return result;
        }
    }
}


text:
/*
 * test.cpp
 *   (ここにファイルの簡易説明を記入)
 *
 *  Created on: 2015/05/24
 *      Author: wlamigo
 *
 *   (ここにファイルの説明を記入)
 */

#include <opencv2/opencv.hpp>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include "picojson.h"

#include "modelHandler.hpp"

using namespace cv;

int main(int argc, char** argv) {

	std::string fileName(argv[1]);
	std::vector<std::unique_ptr<w2xc::Model> > models;

	w2xc::modelUtility::generateModelFromJSON(fileName, models);

	std::cout << "reading model data seems to be succeed." << std::endl;

	cv::Mat image = cv::imread("/home/wlamigo-data/Picture/HNI_0049(noise).png",
			cv::IMREAD_COLOR);
	cv::Mat image2x = cv::Mat(image.size().height * 2,image.size().width * 2,CV_32FC3);
	cv::resize(image,image2x,image2x.size(),0,0,INTER_NEAREST);
	cv::imwrite("/home/wlamigo-data/Picture/test-cv-nnresize.png",image2x);
	cv::Mat imageYUV;
	image2x.convertTo(imageYUV, CV_32F, 1.0 / 255.0);
	cv::cvtColor(imageYUV, imageYUV, COLOR_RGB2YUV);
	std::vector<cv::Mat> imageSprit;
	cv::Mat imageY;
	cv::split(imageYUV, imageSprit);
	imageSprit[0].copyTo(imageY);

	/*
	imageSprit.clear();
	cv::Mat image2xBicubic;
	cv::resize(image,image2xBicubic,image2x.size(),0,0,INTER_CUBIC);
	cv::imwrite("/home/wlamigo-data/Picture/test-cv-bcresize.png",image2xBicubic);
	image2xBicubic.convertTo(imageYUV,CV_32F, 1.0 / 255.0);
	cv::cvtColor(imageYUV, imageYUV, COLOR_RGB2YUV);
	cv::split(imageYUV, imageSprit);
	*/

	std::unique_ptr<std::vector<cv::Mat> > inputPlanes = std::unique_ptr<
			std::vector<cv::Mat> >(new std::vector<cv::Mat>(1));
	std::unique_ptr<std::vector<cv::Mat> > outputPlanes = std::unique_ptr<
			std::vector<cv::Mat> >(new std::vector<cv::Mat>(32));

	inputPlanes->clear();
	inputPlanes->push_back(imageY);

	/*
	cv::Mat test;
	imageY.copyTo(imageSprit[1]);
	imageY.copyTo(imageSprit[2]);
	cv::merge(imageSprit,test);
	test.convertTo(test,CV_8U,255.0);
	cv::imwrite("/home/wlamigo-data/Picture/test-cv.png",test);
	std::exit(0);
	*/

	for (int index = 0; index < models.size(); index++) {
		std::cout << "Iteration #" << (index + 1) << "..." << std::endl;
//		std::cout << models[index]->getNInputPlanes() << ","
//				<< models[index]->getNOutputPlanes() << std::endl;
		if(!models[index]->filter(*inputPlanes, *outputPlanes)){
			std::exit(-1);
		}
		std::cout << outputPlanes->size() << std::endl;
		if (index != models.size() - 1) {
			inputPlanes = std::move(outputPlanes);
			outputPlanes = std::unique_ptr<std::vector<cv::Mat> >(
					new std::vector<cv::Mat>(models[index + 1]->getNOutputPlanes()));
		}
	}

	outputPlanes->at(0).copyTo(imageSprit[0]);
	cv::Mat result;
	cv::merge(imageSprit,result);
	cv::cvtColor(result,result,COLOR_YUV2RGB);
	result.convertTo(result,CV_8U,255.0);
	cv::imwrite("/home/wlamigo-data/Picture/test-cv.png",result);

	return 0;
}

redpajama_set_name: RedPajamaGithub


text:
execute "set safari to show status bar" do
  command "defaults write com.apple.safari ShowStatusBar -bool YES"
  user WS_USER
end


text:
from __future__ import absolute_import, division, print_function
__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'network'}

DOCUMENTATION = """
---
module: nxos_l2_interface
extends_documentation_fragment: nxos
version_added: "2.5"
short_description: Manage Layer-2 interface on Cisco NXOS devices.
description:
  - This module provides declarative management of Layer-2 interface on
    Cisco NXOS devices.
author:
  - Trishna Guha (@trishnaguha)
notes:
  - Tested against NXOSv 7.0(3)I5(1).
options:
  name:
    description:
      - Full name of the interface excluding any logical
        unit number, i.e. Ethernet1/1.
    required: true
    aliases: ['interface']
  mode:
    description:
      - Mode in which interface needs to be configured.
    choices: ['access','trunk']
  access_vlan:
    description:
      - Configure given VLAN in access port.
        If C(mode=access), used as the access VLAN ID.
  native_vlan:
    description:
      - Native VLAN to be configured in trunk port.
        If C(mode=trunk), used as the trunk native VLAN ID.
  trunk_vlans:
    description:
      - List of VLANs to be configured in trunk port.
        If C(mode=trunk), used as the VLAN range to ADD or REMOVE
        from the trunk.
    aliases: ['trunk_add_vlans']
  trunk_allowed_vlans:
    description:
      - List of allowed VLANs in a given trunk port.
        If C(mode=trunk), these are the only VLANs that will be
        configured on the trunk, i.e. "2-10,15".
  aggregate:
    description:
      - List of Layer-2 interface definitions.
  state:
    description:
      - Manage the state of the Layer-2 Interface configuration.
    default:  present
    choices: ['present','absent', 'unconfigured']
"""

EXAMPLES = """
- name: Ensure Eth1/5 is in its default l2 interface state
  nxos_l2_interface:
    name: Ethernet1/5
    state: unconfigured

- name: Ensure Eth1/5 is configured for access vlan 20
  nxos_l2_interface:
    name: Ethernet1/5
    mode: access
    access_vlan: 20

- name: Ensure Eth1/5 only has vlans 5-10 as trunk vlans
  nxos_l2_interface:
    name: Ethernet1/5
    mode: trunk
    native_vlan: 10
    trunk_vlans: 5-10

- name: Ensure eth1/5 is a trunk port and ensure 2-50 are being tagged (doesn't mean others aren't also being tagged)
  nxos_l2_interface:
    name: Ethernet1/5
    mode: trunk
    native_vlan: 10
    trunk_vlans: 2-50

- name: Ensure these VLANs are not being tagged on the trunk
  nxos_l2_interface:
    name: Ethernet1/5
    mode: trunk
    trunk_vlans: 51-4094
    state: absent

-  name: Aggregate Configure interfaces for access_vlan with aggregate
   nxos_l2_interface:
     aggregate:
       - { name: "Ethernet1/2", access_vlan: 6 }
       - { name: "Ethernet1/7", access_vlan: 15 }
     mode: access
"""

RETURN = """
commands:
  description: The list of configuration mode commands to send to the device
  returned: always, except for the platforms that use Netconf transport to manage the device.
  type: list
  sample:
    - interface eth1/5
    - switchport access vlan 20
"""

import re
from copy import deepcopy

from ansible.module_utils.network.nxos.nxos import get_config, load_config, run_commands
from ansible.module_utils.network.nxos.nxos import nxos_argument_spec, get_interface_type
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.network.common.utils import remove_default_spec

def get_interface_mode(name, module):
    """Gets current mode of interface: layer2 or layer3
    Args:
        device (Device): This is the device object of an NX-API enabled device
            using the Device class within device.py
        interface (string): full name of interface, i.e. Ethernet1/1,
            loopback10, port-channel20, vlan20
    Returns:
        str: 'layer2' or 'layer3'
    """
    command = 'show interface {0} | json'.format(name)
    intf_type = get_interface_type(name)
    mode = 'unknown'
    interface_table = {}

    try:
        body = run_commands(module, [command])[0]
        interface_table = body['TABLE_interface']['ROW_interface']
    except (KeyError, AttributeError, IndexError):
        return mode

    if interface_table:
        # HACK FOR NOW
        if intf_type in ['ethernet', 'portchannel']:
            mode = str(interface_table.get('eth_mode', 'layer3'))
            if mode in ['access', 'trunk']:
                mode = 'layer2'
            if mode == 'routed':
                mode = 'layer3'
        elif intf_type == 'loopback' or intf_type == 'svi':
            mode = 'layer3'
    return mode

def interface_is_portchannel(name, module):
    """Checks to see if an interface is part of portchannel bundle
    Args:
        interface (str): full name of interface, i.e. Ethernet1/1
    Returns:
        True/False based on if interface is a member of a portchannel bundle
    """
    intf_type = get_interface_type(name)

    if intf_type == 'ethernet':
        command = 'show interface {0} | json'.format(name)
        try:
            body = run_commands(module, [command])[0]
            interface_table = body['TABLE_interface']['ROW_interface']
        except (KeyError, AttributeError, IndexError):
            interface_table = None

        if interface_table:
            state = interface_table.get('eth_bundle')
            if state:
                return True
            else:
                return False

    return False

def get_switchport(port, module):
    """Gets current config of L2 switchport
    Args:
        device (Device): This is the device object of an NX-API enabled device
            using the Device class within device.py
        port (str): full name of interface, i.e. Ethernet1/1
    Returns:
        dictionary with k/v pairs for L2 vlan config
    """

    command = 'show interface {0} switchport | json'.format(port)

    try:
        body = run_commands(module, [command])[0]
        sp_table = body['TABLE_interface']['ROW_interface']
    except (KeyError, AttributeError, IndexError):
        sp_table = None

    if sp_table:
        key_map = {
            "interface": "name",
            "oper_mode": "mode",
            "switchport": "switchport",
            "access_vlan": "access_vlan",
            "access_vlan_name": "access_vlan_name",
            "native_vlan": "native_vlan",
            "native_vlan_name": "native_vlan_name",
            "trunk_vlans": "trunk_vlans"
        }
        sp = apply_key_map(key_map, sp_table)
        return sp

    else:
        return {}

def remove_switchport_config_commands(name, existing, proposed, module):
    mode = proposed.get('mode')
    commands = []
    command = None

    if mode == 'access':
        av_check = existing.get('access_vlan') == proposed.get('access_vlan')
        if av_check:
            command = 'no switchport access vlan {0}'.format(existing.get('access_vlan'))
            commands.append(command)

    elif mode == 'trunk':
        existing_vlans = existing.get('trunk_vlans_list')
        proposed_vlans = proposed.get('trunk_vlans_list')
        vlans_to_remove = set(proposed_vlans).intersection(existing_vlans)

        if vlans_to_remove:
            proposed_allowed_vlans = proposed.get('trunk_allowed_vlans')
            remove_trunk_allowed_vlans = proposed.get('trunk_vlans', proposed_allowed_vlans)
            command = 'switchport trunk allowed vlan remove {0}'.format(remove_trunk_allowed_vlans)
            commands.append(command)

        native_check = existing.get('native_vlan') == proposed.get('native_vlan')
        if native_check and proposed.get('native_vlan'):
            command = 'no switchport trunk native vlan {0}'.format(existing.get('native_vlan'))
            commands.append(command)

    if commands:
        commands.insert(0, 'interface ' + name)
    return commands

def get_switchport_config_commands(name, existing, proposed, module):
    """Gets commands required to config a given switchport interface
    """

    proposed_mode = proposed.get('mode')
    existing_mode = existing.get('mode')
    commands = []
    command = None

    if proposed_mode != existing_mode:
        if proposed_mode == 'trunk':
            command = 'switchport mode trunk'
        elif proposed_mode == 'access':
            command = 'switchport mode access'

    if command:
        commands.append(command)

    if proposed_mode == 'access':
        av_check = str(existing.get('access_vlan')) == str(proposed.get('access_vlan'))
        if not av_check:
            command = 'switchport access vlan {0}'.format(proposed.get('access_vlan'))
            commands.append(command)

    elif proposed_mode == 'trunk':
        tv_check = existing.get('trunk_vlans_list') == proposed.get('trunk_vlans_list')

        if not tv_check:
            if proposed.get('allowed'):
                command = 'switchport trunk allowed vlan {0}'.format(proposed.get('trunk_allowed_vlans'))
                commands.append(command)

            else:
                existing_vlans = existing.get('trunk_vlans_list')
                proposed_vlans = proposed.get('trunk_vlans_list')
                vlans_to_add = set(proposed_vlans).difference(existing_vlans)
                if vlans_to_add:
                    command = 'switchport trunk allowed vlan add {0}'.format(proposed.get('trunk_vlans'))
                    commands.append(command)

        native_check = str(existing.get('native_vlan')) == str(proposed.get('native_vlan'))
        if not native_check and proposed.get('native_vlan'):
            command = 'switchport trunk native vlan {0}'.format(proposed.get('native_vlan'))
            commands.append(command)

    if commands:
        commands.insert(0, 'interface ' + name)
    return commands

def is_switchport_default(existing):
    """Determines if switchport has a default config based on mode
    Args:
        existing (dict): existing switchport configuration from Ansible mod
    Returns:
        boolean: True if switchport has OOB Layer 2 config, i.e.
           vlan 1 and trunk all and mode is access
    """

    c1 = str(existing['access_vlan']) == '1'
    c2 = str(existing['native_vlan']) == '1'
    c3 = existing['trunk_vlans'] == '1-4094'
    c4 = existing['mode'] == 'access'

    default = c1 and c2 and c3 and c4

    return default

def default_switchport_config(name):
    commands = []
    commands.append('interface ' + name)
    commands.append('switchport mode access')
    commands.append('switch access vlan 1')
    commands.append('switchport trunk native vlan 1')
    commands.append('switchport trunk allowed vlan all')
    return commands

def vlan_range_to_list(vlans):
    result = []
    if vlans:
        for part in vlans.split(','):
            if part == 'none':
                break
            if '-' in part:
                a, b = part.split('-')
                a, b = int(a), int(b)
                result.extend(range(a, b + 1))
            else:
                a = int(part)
                result.append(a)
        return numerical_sort(result)
    return result

def get_list_of_vlans(module):

    command = 'show vlan | json'
    vlan_list = []

    try:
        body = run_commands(module, [command])[0]
        vlan_table = body['TABLE_vlanbrief']['ROW_vlanbrief']
    except (KeyError, AttributeError, IndexError):
        return []

    if isinstance(vlan_table, list):
        for vlan in vlan_table:
            vlan_list.append(str(vlan['vlanshowbr-vlanid-utf']))
    else:
        vlan_list.append('1')

    return vlan_list

def numerical_sort(string_int_list):
    """Sorts list of strings/integers that are digits in numerical order.
    """

    as_int_list = []
    as_str_list = []
    for vlan in string_int_list:
        as_int_list.append(int(vlan))
    as_int_list.sort()
    for vlan in as_int_list:
        as_str_list.append(str(vlan))
    return as_str_list

def apply_key_map(key_map, table):
    new_dict = {}
    for key, value in table.items():
        new_key = key_map.get(key)
        if new_key:
            new_dict[new_key] = str(value)
    return new_dict

def apply_value_map(value_map, resource):
    for key, value in value_map.items():
        resource[key] = value[resource.get(key)]
    return resource

def flatten_list(command_lists):
    flat_command_list = []
    for command in command_lists:
        if isinstance(command, list):
            flat_command_list.extend(command)
        else:
            flat_command_list.append(command)
    return flat_command_list

def map_params_to_obj(module):
    obj = []
    aggregate = module.params.get('aggregate')
    if aggregate:
        for item in aggregate:
            for key in item:
                if item.get(key) is None:
                    item[key] = module.params[key]

            d = item.copy()
            obj.append(d)
    else:
        obj.append({
            'name': module.params['name'],
            'mode': module.params['mode'],
            'access_vlan': module.params['access_vlan'],
            'native_vlan': module.params['native_vlan'],
            'trunk_vlans': module.params['trunk_vlans'],
            'trunk_allowed_vlans': module.params['trunk_allowed_vlans'],
            'state': module.params['state']
        })

    return obj

def main():
    """ main entry point for module execution
    """
    element_spec = dict(
        name=dict(type='str', aliases=['interface']),
        mode=dict(choices=['access', 'trunk']),
        access_vlan=dict(type='str'),
        native_vlan=dict(type='str'),
        trunk_vlans=dict(type='str', aliases=['trunk_add_vlans']),
        trunk_allowed_vlans=dict(type='str'),
        state=dict(choices=['absent', 'present', 'unconfigured'], default='present')
    )

    aggregate_spec = deepcopy(element_spec)

    # remove default in aggregate spec, to handle common arguments
    remove_default_spec(aggregate_spec)

    argument_spec = dict(
        aggregate=dict(type='list', elements='dict', options=aggregate_spec),
    )

    argument_spec.update(element_spec)
    argument_spec.update(nxos_argument_spec)

    module = AnsibleModule(argument_spec=argument_spec,
                           mutually_exclusive=[['access_vlan', 'trunk_vlans'],
                                               ['access_vlan', 'native_vlan'],
                                               ['access_vlan', 'trunk_allowed_vlans']],
                           supports_check_mode=True)

    warnings = list()
    commands = []
    result = {'changed': False}
    if warnings:
        result['warnings'] = warnings

    want = map_params_to_obj(module)
    for w in want:
        name = w['name']
        mode = w['mode']
        access_vlan = w['access_vlan']
        state = w['state']
        trunk_vlans = w['trunk_vlans']
        native_vlan = w['native_vlan']
        trunk_allowed_vlans = w['trunk_allowed_vlans']

        args = dict(name=name, mode=mode, access_vlan=access_vlan,
                    native_vlan=native_vlan, trunk_vlans=trunk_vlans,
                    trunk_allowed_vlans=trunk_allowed_vlans)

        proposed = dict((k, v) for k, v in args.items() if v is not None)

        name = name.lower()

        if mode == 'access' and state == 'present' and not access_vlan:
            module.fail_json(msg='access_vlan param is required when mode=access && state=present')

        if mode == 'trunk' and access_vlan:
            module.fail_json(msg='access_vlan param not supported when using mode=trunk')

        current_mode = get_interface_mode(name, module)

        # Current mode will return layer3, layer2, or unknown
        if current_mode == 'unknown' or current_mode == 'layer3':
            module.fail_json(msg='Ensure interface is configured to be a L2'
                             '\nport first before using this module. You can use'
                             '\nthe nxos_interface module for this.')

        if interface_is_portchannel(name, module):
            module.fail_json(msg='Cannot change L2 config on physical '
                             '\nport because it is in a portchannel. '
                             '\nYou should update the portchannel config.')

        # existing will never be null for Eth intfs as there is always a default
        existing = get_switchport(name, module)

        # Safeguard check
        # If there isn't an existing, something is wrong per previous comment
        if not existing:
            module.fail_json(msg='Make sure you are using the FULL interface name')

        if trunk_vlans or trunk_allowed_vlans:
            if trunk_vlans:
                trunk_vlans_list = vlan_range_to_list(trunk_vlans)
            elif trunk_allowed_vlans:
                trunk_vlans_list = vlan_range_to_list(trunk_allowed_vlans)
                proposed['allowed'] = True

            existing_trunks_list = vlan_range_to_list((existing['trunk_vlans']))

            existing['trunk_vlans_list'] = existing_trunks_list
            proposed['trunk_vlans_list'] = trunk_vlans_list

        current_vlans = get_list_of_vlans(module)

        if state == 'present':
            if access_vlan and access_vlan not in current_vlans:
                module.fail_json(msg='You are trying to configure a VLAN'
                                 ' on an interface that\ndoes not exist on the '
                                 ' switch yet!', vlan=access_vlan)
            elif native_vlan and native_vlan not in current_vlans:
                module.fail_json(msg='You are trying to configure a VLAN'
                                 ' on an interface that\ndoes not exist on the '
                                 ' switch yet!', vlan=native_vlan)
            else:
                command = get_switchport_config_commands(name, existing, proposed, module)
                commands.append(command)
        elif state == 'unconfigured':
            is_default = is_switchport_default(existing)
            if not is_default:
                command = default_switchport_config(name)
                commands.append(command)
        elif state == 'absent':
            command = remove_switchport_config_commands(name, existing, proposed, module)
            commands.append(command)

        if trunk_vlans or trunk_allowed_vlans:
            existing.pop('trunk_vlans_list')
            proposed.pop('trunk_vlans_list')

    cmds = flatten_list(commands)
    if cmds:
        if module.check_mode:
            module.exit_json(changed=True, commands=cmds)
        else:
            result['changed'] = True
            load_config(module, cmds)
            if 'configure' in cmds:
                cmds.pop(0)

    result['commands'] = cmds
    result['warnings'] = warnings

    module.exit_json(**result)

if __name__ == '__main__':
    main()


text:
shared_examples "provider/synced_folder" do |provider, options|
  if !options[:box]
    raise ArgumentError,
      "box option must be specified for provider: #{provider}"
  end

  include_context "acceptance"

  before do
    environment.skeleton("synced_folders")

    vagrantfile = environment.workdir.join('Vagrantfile')
    # TODO: Can we just shell out to something?
    new_vagrantfile = "Vagrant.require_plugin('docker-provider')\n#{vagrantfile.read}"
    vagrantfile.open('w') { |f| f.puts(new_vagrantfile) }

    assert_execute("vagrant", "box", "add", "basic", options[:box])
    assert_execute("vagrant", "up", "--provider=#{provider}")
  end

  after do
    assert_execute("vagrant", "destroy", "--force")
  end

  # We put all of this in a single RSpec test so that we can test all
  # the cases within a single VM rather than having to `vagrant up` many
  # times.
  it "properly configures synced folder types" do
    status("Test: mounts the default /vagrant synced folder")
    result = execute("vagrant", "ssh", "-c", "cat /vagrant/foo")
    expect(result.exit_code).to eql(0)
    expect(result.stdout).to match(/hello$/)

    status("Test: doesn't mount a disabled folder")
    result = execute("vagrant", "ssh", "-c", "test -d /foo")
    expect(result.exit_code).to eql(1)
  end
end


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>Sybil</title>

    <link href="assets/layout.css" rel="stylesheet" type="text/css">
    <link href="assets/style.css" rel="stylesheet" type="text/css" media="screen">
    <link href="assets/fonts.css" rel="stylesheet" type="text/css">

Sybil

    Sybil's documentation is available at http://doc.sybil.synyx.coffee.

    Background by subtlepatterns.com, Typeface by Barry Schwartz.


text:
package de.mhus.inka.constgenerator;

import japa.parser.ParseException;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class Crawler {

	private File source;
	private File destination;
	private boolean debug;

	public Crawler(File dir) {
		setSource(dir);
		setDestination(dir);
	}

	public File getSource() {
		return source;
	}

	public void setSource(File source) {
		this.source = source;
	}

	public File getDestination() {
		return destination;
	}

	public void setDestination(File destination) {
		this.destination = destination;
	}

	public void doCrawl() {
		crawl(source,destination);
	}

	protected void crawl(File src, File dest) {
		for (File f : src.listFiles()) {
			if (f.isDirectory() && !f.isHidden() && !f.getName().startsWith(".")) {
				crawl(f, new File(dest, f.getName()));
			} else {
				try {
					parse(f, dest);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (ParseException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
	}

	public void parse(File src) throws IOException, ParseException {
		parse(src, src.getParentFile());
	}

	public void parse(File src, File dst) throws IOException, ParseException {

		if (!src.isFile() || !src.getName().endsWith(".java") || src.getName().endsWith("Cons.java") || !dst.isDirectory()) return;

		FileInputStream fis = new FileInputStream(src);
		CGFile file = new CGFile(fis);
		fis.close();

		FileGenerator generator = new FileGenerator(file);
		file.setDebug(isDebug());
		file.doParse();
		if (!file.shouldProceed()) return;
		System.out.println(src.getPath());
		generator.doParse();

		if (!dst.exists()) dst.mkdirs();
		FileWriter fw = new FileWriter(new File(dst, file.getMainClass().getName() + "Const.java") );
		generator.doGenerate(new PrintWriter(fw));
		fw.close();

	}

	public boolean isDebug() {
		return debug;
	}

	public void setDebug(boolean debug) {
		this.debug = debug;
	}
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Craft Beer | Trophy</title>
  <meta name="author" content="">
  <meta name="description" content="">
  <meta property="og:title" content="Craft Beer | Trophy">
  <meta property="og:url" content="/2016/09/07/craft-beer/">
  <meta property="og:site_name" content="Trophy">
  <meta property="og:description" content="">
  <meta property="og:image" content="https://unsplash.it/2000/1200?image=1003">
  <meta property="og:type" content="blog">

  <meta name="twitter:card" content="summary">
  <meta name="twitter:description" content="">
  <meta name="twitter:title" content="Craft Beer | Trophy">
  <meta name="twitter:url" content="/2016/09/07/craft-beer/">
  <meta name="twitter:site" content="Trophy">
  <meta name="twitter:creator" content="@">
  <meta name="twitter:domain" content="">
  <meta property="twitter:image" content="https://unsplash.it/2000/1200?image=1003">

  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inconsolata|Lora|Space+Mono:700">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css">
  <link rel="stylesheet" href="/assets/css/main.css">

  <link rel="alternate" type="application/rss+xml" title="Trophy" href="/feed.xml">
  <link rel="canonical" href="/2016/09/07/craft-beer/">

      Back to Posts

      <time datetime="2016-09-07T00:00:00+08:00" itemprop="datePublished">Sep 7, 2016</time>

Craft Beer

        Posted in

            Juice

Tbh vaporware mumblecore iceland echo park DIY. Plaid woke next level enamel pin, vegan cred salvia pug. XOXO sartorial synth gluten-free, cold-pressed mumblecore craft beer helvetica. Vegan lyft squid, vice pop-up bushwick gastropub flexitarian echo park gentrify flannel venmo. Banh mi ugh direct trade, tote bag irony tbh biodiesel. Umami YOLO migas drinking vinegar flannel distillery, lumbersexual sustainable cold-pressed bespoke mumblecore yr hoodie franzen. Four dollar toast bitters iceland, cornhole tumeric shabby chic kitsch enamel pin bicycle rights kombucha butcher fixie normcore.

Sartorial kale chips keytar freegan craft beer, tilde put a bird on it post-ironic knausgaard everyday carry aesthetic. Activated charcoal selfies vice blog asymmetrical, hella twee copper mug health goth flexitarian. Tattooed pickled cold-pressed, PBR&B hell of schlitz seitan. Retro williamsburg schlitz health goth messenger bag roof party. Migas fanny pack chillwave chambray. Post-ironic roof party wolf ethical. Tacos PBR&B beard, lumbersexual retro DIY tumeric selvage brunch.

Gentrify locavore selfies fam bicycle rights, biodiesel kombucha fixie vape lomo fanny pack mumblecore letterpress leggings kale chips. Biodiesel typewriter mlkshk man braid. Ugh fap snackwave microdosing synth live-edge. Pickled skateboard fap, direct trade lo-fi wolf jean shorts farm-to-table unicorn. Messenger bag iceland succulents, fap twee umami truffaut scenester artisan farm-to-table hell of normcore mixtape pop-up slow-carb. Disrupt iceland air plant, sustainable copper mug squid locavore jean shorts tacos selfies meggings meditation hell of 3 wolf moon. Schlitz thundercats lyft raclette green juice intelligentsia.

Four loko pinterest lo-fi beard kinfolk marfa. Man bun flannel activated charcoal blue bottle. Chillwave coloring book waistcoat hammock knausgaard selfies. Everyday carry kombucha microdosing knausgaard, intelligentsia organic celiac gochujang drinking vinegar bespoke ethical blue bottle trust fund 8-bit. Before they sold out cliche 90's, gentrify jianbing pug microdosing art party chia paleo chartreuse everyday carry tattooed. Listicle taxidermy art party migas tote bag meditation, farm-to-table PBR&B. Poutine vaporware letterpress hell of.


text:
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { itemsFetchData } from '../actions/items'

class ItemList extends Component {

    componentDidMount(){
        this.fetchData('http://5826ed963900d612000138bd.mockapi.io/items');
    }

    render() {
        if (this.state.hasErrored) {
            return
Sorry! There was an error loading the items
;
        }
        if (this.state.isLoading) {
            return
Loading…
;
        }
        return (

                {this.state.items.map((item) => (

                        {item.label}

                ))}

        );
    }
}

const mapStateToProps = (state) => {
  return {
    items: state.items,
    hasErrored: state.itemsHasErrored,
    isLoading: state.itemsIsLoading
  };
};

const mapDispatchToProps = (dispatch) => {
  return {
    fetchData: (url) => dispatch(itemsFetchData(url))
  };
};

export default connect(mapStateToProps, mapDispatchToProps)(ItemList);


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.MOS.fastfood"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="22" />

    <!-- added permission manually to reveice MAP -->
    <permission android:name="com.MOS.fastfood.permission.MAPS_RECEIVE"
        android:protectionLevel="signature">
    </permission>

    <!-- permissions to access internet -->
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

    <!-- important permissions to fetch map from google -->
    <uses-permission android:name="com.MOS.fastfood.permission.MAPS_RECEIVE"/>
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>

    <!-- only devices that support version 2.0 of openGL can download, for graphics -->
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>

    <!--  two permissions used to determine the current location using network towers and gps -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <!--  ADDING THE DEBUGGING KEY -->
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="key here"/>

        <!--  THIS META DATA ALLOWS "ISGOOGLEPLAYSERVICES ENABLED" TO FUNCTION WITHOUT CRASH -->
        <meta-data
   			 android:name="com.google.android.gms.version"
   			 android:value="@integer/google_play_services_version" />

    </application>

</manifest>


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18408
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Hydra.Resources {
    using System;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    public class ProviderConfiguration {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal ProviderConfiguration() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Hydra.Resources.ProviderConfiguration", typeof(ProviderConfiguration).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to ConnectionString.
        /// </summary>
        public static string DATABASE_CONNECTION_STRING {
            get {
                return ResourceManager.GetString("DATABASE_CONNECTION_STRING", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to AsyncPort.
        /// </summary>
        public static string MSE52_HOST_ASYNC_PORT_NUMBER {
            get {
                return ResourceManager.GetString("MSE52_HOST_ASYNC_PORT_NUMBER", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to EmergencyPort.
        /// </summary>
        public static string MSE52_HOST_EMERGENCY_PORT_NUMBER {
            get {
                return ResourceManager.GetString("MSE52_HOST_EMERGENCY_PORT_NUMBER", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to IPAddress.
        /// </summary>
        public static string MSE52_HOST_IP_ADDRESS {
            get {
                return ResourceManager.GetString("MSE52_HOST_IP_ADDRESS", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to IsEnabled.
        /// </summary>
        public static string MSE52_HOST_IS_ENABLED {
            get {
                return ResourceManager.GetString("MSE52_HOST_IS_ENABLED", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to HostName.
        /// </summary>
        public static string MSE52_HOST_NAME {
            get {
                return ResourceManager.GetString("MSE52_HOST_NAME", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to HostPortNumber.
        /// </summary>
        public static string MSE52_HOST_PORT_NUMBER {
            get {
                return ResourceManager.GetString("MSE52_HOST_PORT_NUMBER", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to ProtocolType.
        /// </summary>
        public static string MSE52_HOST_PROTOCOL_TYPE {
            get {
                return ResourceManager.GetString("MSE52_HOST_PROTOCOL_TYPE", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Url.
        /// </summary>
        public static string MSE52_HOST_URL {
            get {
                return ResourceManager.GetString("MSE52_HOST_URL", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to UseAsyncProtocol.
        /// </summary>
        public static string MSE52_HOST_USE_ASYNC {
            get {
                return ResourceManager.GetString("MSE52_HOST_USE_ASYNC", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to UsePollingProtocol.
        /// </summary>
        public static string MSE52_HOST_USE_POLLING {
            get {
                return ResourceManager.GetString("MSE52_HOST_USE_POLLING", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to UserName.
        /// </summary>
        public static string MSE52_HOST_USER_NAME {
            get {
                return ResourceManager.GetString("MSE52_HOST_USER_NAME", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to UserPassword.
        /// </summary>
        public static string MSE52_HOST_USER_PASSWORD {
            get {
                return ResourceManager.GetString("MSE52_HOST_USER_PASSWORD", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to ImageLocation.
        /// </summary>
        public static string MSE52_IMAGE_DIRECTORY {
            get {
                return ResourceManager.GetString("MSE52_IMAGE_DIRECTORY", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to HostedOrganisationID.
        /// </summary>
        public static string MSE52_ORGANISATION_ID {
            get {
                return ResourceManager.GetString("MSE52_ORGANISATION_ID", resourceCulture);
            }
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Approve.RuleCenter;
using EgovaDAO;
using Tools;
using System.Data;

public partial class JSDW_ApplySGXKZGL_SGZZSJList : System.Web.UI.Page
{
    EgovaDB dbContext = new EgovaDB();
    RCenter rc = new RCenter();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (!string.IsNullOrEmpty(EConvert.ToString(Session["FAppId"])))
            {
                ViewState["FAppId"] = EConvert.ToString(Session["FAppId"]);
            }
            ShowTitle();
            pageTool tool1 = new pageTool(this.Page);
            if (EConvert.ToInt(Session["FIsApprove"]) != 0)
            {
                tool1.ExecuteScript("btnEnable();");
            }
        }
    }

    private void ShowTitle()
    {
        EgovaDB dbContext = new EgovaDB();
        TC_SGXKZ_PrjInfo qa = dbContext.TC_SGXKZ_PrjInfo.Where(t => t.FAppId == EConvert.ToString(ViewState["FAppId"])).FirstOrDefault();
        ViewState["FPrjItemId"] = qa.FPrjItemId;
        t_JSDW.Text = qa.JSDW;
        t_ProjectName.Text = qa.ProjectName;
        t_PrjItemName.Text = qa.PrjItemName;
        TC_SGXKZ_SGZZSJ sp = dbContext.TC_SGXKZ_SGZZSJ.Where(t => t.FAppId == EConvert.ToString(ViewState["FAppId"])).FirstOrDefault();
        if (sp != null)
        {
            txtFId.Value = sp.FId;
            ShowFile(sp.FId);
        }

        pageTool tool = new pageTool(this.Page, "t_");
        tool.fillPageControl(sp);
    }

    private void ShowFile(string FId)
    {
        EgovaDB dbContext = new EgovaDB();
        var App = dbContext.TC_SGXKZ_File.Where(t => t.FLinkId == FId).Select(t => new
        {
            t.FileName,
            t.FId,
            t.ReportTime
        }).ToList();
        Pager1.RecordCount = App.Count();
        dg_List.DataSource = App.Skip((Pager1.CurrentPageIndex - 1) * Pager1.PageSize).Take(Pager1.PageSize);
        dg_List.DataBind();
        Pager1.Visible = (Pager1.RecordCount > Pager1.PageSize);
    }

    protected void btnSave_Click(object sender, EventArgs e)
    {
        string fId = txtFId.Value;
        TC_SGXKZ_SGZZSJ qa = new TC_SGXKZ_SGZZSJ();
        pageTool tool = new pageTool(this.Page);
        if (!string.IsNullOrEmpty(fId))
        {
            qa = dbContext.TC_SGXKZ_SGZZSJ.Where(t => t.FId == fId).FirstOrDefault();
        }
        else
        {
            fId = Guid.NewGuid().ToString();
            qa.FId = fId;
            qa.FprjItemId = EConvert.ToString(ViewState["FPrjItemId"]);
            qa.FAppId = EConvert.ToString(ViewState["FAppId"]);
            dbContext.TC_SGXKZ_SGZZSJ.InsertOnSubmit(qa);
        }
        qa = tool.getPageValue(qa);
        dbContext.SubmitChanges();
        txtFId.Value = fId;
        //  showPrjData();
        tool.showMessageAndRunFunction("保存成功", "window.returnValue='1';");
    }
    protected void btnReload_Click(object sender, EventArgs e)
    {
        ShowFile(txtFId.Value);
    }
    protected void App_List_ItemDataBound(object sender, DataGridItemEventArgs e)
    {
        if (e.Item.ItemIndex > -1)
        {
            e.Item.Cells[1].Text = (e.Item.ItemIndex + 1 + this.Pager1.PageSize * (this.Pager1.CurrentPageIndex - 1)).ToString();
            string fid = EConvert.ToString(DataBinder.Eval(e.Item.DataItem, "FId"));
            e.Item.Cells[2].Text = "" + e.Item.Cells[2].Text + "";
        }
    }
    protected void btnDel_Click(object sender, EventArgs e)
    {
        pageTool tool = new pageTool(this.Page);
        tool.DelInfoFromGrid(dg_List, dbContext.TC_SGXKZ_File, tool_Deleting);
        ShowFile(txtFId.Value);
    }
    private void tool_Deleting(System.Collections.Generic.IList<string> FIdList, System.Data.Linq.DataContext context)
    {
        dbContext = new EgovaDB();
        if (dbContext != null)
        {
            var para = dbContext.TC_SGXKZ_File.Where(t => FIdList.ToArray().Contains(t.FId));
            dbContext.TC_SGXKZ_File.DeleteAllOnSubmit(para);
        }
    }
    protected void Pager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        Pager1.CurrentPageIndex = e.NewPageIndex;
        ShowFile(txtFId.Value);
    }
}


text:
package com.grosner.painter.actionbar;

import android.graphics.PorterDuff;
import android.graphics.drawable.ColorDrawable;

import com.grosner.painter.Utils;
import com.grosner.painter.slider.SliderUtils;

/**
 * Created by: andrewgrosner
 * Date: 7/18/14.
 * Contributors: {}
 * Description: This slider will change the color of the actionbar from one color to another as
 * you slide a transforming view such as a drawer.
 */
public class ActionBarColorSlider extends ActionBarSlider{

    /**
     * The ending color when the ratio of the slide is 1
     */
    private int mEndColor;

    /**
     * Constructs a new instance.
     * @param actionBar - support or native ActionBar class
     * @param startColor - the color that the background drawable will start at when slide is 0
     * @param endColor - the color that the background drawable will be when the slide is 1
     */
    public ActionBarColorSlider(Object actionBar, int startColor, int endColor){
        super(startColor);
        mEndColor = endColor;
        setBackgroundDrawable(actionBar);
    }

    @Override
    public void onSlide(float slideOffset) {
        int color = SliderUtils.calculateColor(slideOffset, mStartColor, mEndColor);
        if(Utils.isHoneyComb()){
            ((ColorDrawable) mDrawable).setColor(color);
        } else {
            mDrawable = new ColorDrawable(color);
            setBackgroundDrawable(mActionBar);
        }
    }

    public void setStartColor(Object actionBar, int color){
        mStartColor = color;
        mDrawable = new ColorDrawable(color);
        setBackgroundDrawable(actionBar);
    }

    public void setEndColor(int color){
        mEndColor = color;
    }

    public int getEndColor() {
        return mEndColor;
    }
}


text:
{- | Two phase algorithm to solve a Rubik's cube -}

{-# LANGUAGE RecordWildCards, ViewPatterns #-}
module Rubik.Solver.TwoPhase where

import Rubik.Cube
import Rubik.Misc
import Rubik.Solver
import Rubik.Tables.Moves
import Rubik.Tables.Distances

import Data.Function ( on )
import Data.Monoid

{-# INLINE phase1Proj #-}
phase1Proj
  =   rawProjection
  |*| rawProjection
  |.| rawProjection

phase1Convert = convertP phase1Proj

phase1Dist = maxDistance
  [ (\((,,) co _ uds) -> (co, uds)) >$< distanceWith2 d_CornerOrien_UDSlice
  , (\((,,) _ eo uds) -> (eo, uds)) >$< distanceWith2 d_EdgeOrien_UDSlice
  ]

phase1 :: Cube -> Move
phase1 = solveWith move18Names moves phase1Proj phase1Dist
  where
    moves = (,,) move18CornerOrien move18EdgeOrien move18UDSlice

-- | > phase1Solved (phase1 c)
phase1Solved :: Cube -> Bool
phase1Solved = ((==) `on` phase1Convert) iden

--

phase2Proj
  =   rawProjection
  |*| rawProjection
  |.| rawProjection

phase2Convert = convertP phase2Proj

phase2Dist = maxDistance
  [ (\((,,) cp _ udsp) -> (cp, udsp)) >$< distanceWith2 d_CornerPermu_UDSlicePermu2
  , (\((,,) _ udep udsp) -> (udep, udsp)) >$< distanceWith2 d_UDEdgePermu2_UDSlicePermu2
  ]

phase2 :: Cube -> Move
phase2 = solveWith move10Names moves phase2Proj phase2Dist
  where
    moves = (,,) move10CornerPermu move10UDEdgePermu2 move10UDSlicePermu2

-- | > phase1Solved c ==> phase2Solved (phase2 c)
phase2Solved :: Cube -> Bool
phase2Solved = (== iden)

-- | Solve a scrambled Rubik's cube.
--
-- Make sure the cube is actually solvable with 'Cubie.solvable',
-- before calling this function.
solve :: Cube -> Move
solve c =
  let s1 = phase1 c
      c1 = c <> moveToCube s1
      s2 = phase2 c1
  in reduceMove $ s1 ++ s2


text:
package com.amazonaws.services.cloudfront.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.cloudfront.model.*;
import com.amazonaws.transform.Marshaller;

/**
 * GetInvalidationRequest Marshaller
 */

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetInvalidationRequestMarshaller implements Marshaller<Request<GetInvalidationRequest>, GetInvalidationRequest> {

    public Request<GetInvalidationRequest> marshall(GetInvalidationRequest getInvalidationRequest) {

        if (getInvalidationRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        Request<GetInvalidationRequest> request = new DefaultRequest<GetInvalidationRequest>(getInvalidationRequest, "AmazonCloudFront");

        request.setHttpMethod(HttpMethodName.GET);

        String uriResourcePath = "/2017-03-25/distribution/{DistributionId}/invalidation/{Id}";

        uriResourcePath = com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(uriResourcePath, "DistributionId",
                getInvalidationRequest.getDistributionId());
        uriResourcePath = com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(uriResourcePath, "Id", getInvalidationRequest.getId());
        request.setResourcePath(uriResourcePath);

        return request;
    }

}


text:
FactoryGirl.define do
  factory :card do
    owner_id 1
    assignment_id 1
    list nil
    title "MyString"
    body "MyText"
    due_date "2013-10-19"
    done false
    comment_count 1
    document_count 1
    checklist_total_count 1
    checklist_done_count 1
    private false
    sort 1
  end
end


text:
<?php

/* AngeAngeBundle:Home:indexProf.html.twig */
class __TwigTemplate_f69274f4edd72b5020cd42be676ca43c extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->blocks = array(
            'title' => array($this, 'block_title'),
            'body' => array($this, 'block_body'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "AngeAngeBundle::layoutProf.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->getParent($context)->display($context, array_merge($this->blocks, $blocks));
    }

    // line 2
    public function block_title($context, array $blocks = array())
    {
        $this->displayParentBlock("title", $context, $blocks);
        echo " - Home";
    }

    // line 4
    public function block_body($context, array $blocks = array())
    {
        // line 5
        echo "\t

\t\t
Info (right)

\t\t
\t

\t
\tCours de la semaine (planning)
\t
\t
";
    }

    public function getTemplateName()
    {
        return "AngeAngeBundle:Home:indexProf.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }
}


text:
//
//  AppDelegate.m
//  GeneralHospital
//
//  Created by 夏科杰 on 14-4-9.
//  Copyright (c) 2014年 夏科杰. All rights reserved.
//

#import "AppDelegate.h"
#import "UIButton+NMCategory.h"
#import "A_VoiceViewController.h"
#import "B_HomeViewController.h"
#import "B_FirstViewController.h"
#import "C_NearByViewController.h"
#import "D_PersonViewController.h"
#import "D_LoginViewController.h"
#import "AESCrypt.h"
#import <AlipaySDK/AlipaySDK.h>
#define INDEX 1//zhtest
@implementation AppDelegate
BMKMapManager* _mapManager;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    // 顶部字体白色
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
     //修改导航字体格式
    [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName]];

    extern NSMutableDictionary      *G_UseDict;
    extern NSMutableDictionary      *G_ShopCar;
    extern CLLocationCoordinate2D   Location;
    extern NSMutableDictionary      *G_PersonDetail;
    application.applicationIconBadgeNumber=0;
    G_UseDict=[[NSMutableDictionary alloc] init];
    G_ShopCar=[[NSMutableDictionary alloc] init];
    G_PersonDetail=[[NSMutableDictionary alloc] init];
    BtnArray=[[NSMutableArray alloc] init];
    _mapManager = [[BMKMapManager alloc]init];
	BOOL ret = [_mapManager start:@"42db3396ae7832b8c7b8895a6aabedd3" generalDelegate:self];
	if (!ret) {
		NSLog(@"manager start failed!");
	}
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    /**********************友盟***********************/
    [MobClick startWithAppkey:@"540c7514fd98c5db0503a631" reportPolicy:SEND_INTERVAL   channelId:nil];
    NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
    [MobClick setAppVersion:version];

    NSData* AESData = [[AESCrypt decrypt:[[NSUserDefaults standardUserDefaults] objectForKey:[AESCrypt encrypt:@"user_model" password:@"zhipin123"]] password:@"zhipin123"] dataUsingEncoding:NSUTF8StringEncoding];
    NSDictionary* AESDictionary = [NSPropertyListSerialization propertyListFromData:AESData mutabilityOption:NSPropertyListImmutable format:nil errorDescription:nil];

    if (AESDictionary!=nil&&[AESDictionary isKindOfClass:[NSDictionary class]])
    {
        [G_UseDict setDictionary:AESDictionary];
//        NSLog(@"%@",G_UseDict);
    }
    bool isPass=NO;
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat: @"yyyyMMddHHmmss"];
    if([[NSUserDefaults standardUserDefaults] objectForKey:@"time"]!=nil)
    {
        isPass=[self compCurrentTime:[[NSUserDefaults standardUserDefaults] objectForKey:@"time"]]>30;
    }
    NSLog(@"time===%@,%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"time"],[dateFormatter stringFromDate:[NSDate date]]);

//    if ((G_UseDict==nil||[[G_UseDict allKeys] count]==0)&&!isPass) {
//        [self LoginView];
//    }else{
//        [self MainView];
//    }

    [self MainView];
    //self.window.rootViewController=[NSClassFromString(@"D_LoginViewController") new];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

//    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge categories:nil];
//    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
#ifdef DEBUG
    //[self OpenLog];
//    Class cls = NSClassFromString(@"UMANUtil");
//    SEL deviceIDSelector = @selector(openUDIDString);
//    NSString *deviceID = nil;
//    if(cls && [cls respondsToSelector:deviceIDSelector]){
//        deviceID = [cls performSelector:deviceIDSelector];
//    }
//    NSLog(@"{\"oid\": \"%@\"}", deviceID);
//    [MobClick setLogEnabled:NO];
//    [MobClick setCrashReportEnabled:NO];
#else
    [MobClick setCrashReportEnabled:YES];
#endif
    [[NSNotificationCenter defaultCenter] addObserver: self
                                             selector: @selector(notificationSelector:)
                                                 name: @"process_begin"
                                               object: nil];

    return YES;
}

-(void)notificationSelector:(NSNotification *)notification
{
    if ([[notification object] intValue]<200) {
        if (ProcessView==nil) {
            ProcessView=[[KJProcessView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HIGHE) setStyle:(KJViewStyle)[[notification object] intValue] setColor:STYLECLOLR];
            ProcessView.center=[UIApplication sharedApplication].keyWindow.center;
//            ProcessView.backgroundColor=[UIColor colorWithWhite:0 alpha:0.2];
            ProcessView.backgroundColor = [UIColor clearColor];
            [[UIApplication sharedApplication].keyWindow addSubview:ProcessView];
            [ProcessView setTranslatesAutoresizingMaskIntoConstraints:NO];
        }else{
            [ProcessView setStyle:(KJViewStyle)[[notification object] intValue] setColor:STYLECLOLR];
            [ProcessView startAnimating];
        }
    }else if ([[notification object] intValue]==201){
        [ProcessView stopAnimating];
    }else if ([[notification object] intValue]==202){
        [ProcessView stopAnimating];
    }

    NSLog(@"-----------------------------%@",[notification object]);
}
/**
 *  时间差
 *
 *  @param compareDate NSdate
 *
 *  @return NSString
 */
-(NSTimeInterval)compCurrentTime:(NSString* ) compareDate
{
    NSTimeInterval  timeInterval = [[self dateFromString:compareDate] timeIntervalSinceDate:[self getNowDate:[NSDate date]]];
    timeInterval = -timeInterval;
    NSLog(@"compCurrentTime==%lf",timeInterval);
    return  timeInterval/(3600*24*60);
}

/**
 *  获取当前时区的时间
 *
 *  @param anyDate NSDate
 *
 *  @return NSDate
 */
- (NSDate *)getNowDate:(NSDate *)anyDate
{
    NSTimeInterval timeZoneOffset=[[NSTimeZone systemTimeZone] secondsFromGMT];
    NSDate * newDate=[anyDate dateByAddingTimeInterval:timeZoneOffset];
    return newDate;
}

/**
 *  NSString转NSDate
 *
 *  @param dateString NSString
 *
 *  @return NSDate
 */
- (NSDate *)dateFromString:(NSString *)dateString{
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat: @"yyyyMMddHHmmss"];
    NSDate *destDate= [dateFormatter dateFromString:dateString];
    return destDate;
}

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
    if (NavigationController.viewControllers.count == 1)//关闭主界面的右滑返回
    {
        return NO;
    }else{
        return YES;
    }
}
-(void)LoginView
{
    [[UINavigationBar appearance] setBackgroundImage:[GeneralClass CreateImageWithColor:[UIColor whiteColor]] forBarMetrics:UIBarMetricsDefault];

    LoadViewController=[[UIViewController alloc] init];
//    UIImageView *imageView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HIGHE)];
//    imageView.image=[UIImage imageNamed:@"login"];
    //[LoadViewController.view addSubview:imageView];
        [self addImagePlay];

    NavigationController=[[UINavigationController alloc] initWithRootViewController:LoadViewController];
    NavigationController.navigationBarHidden=YES;
    if ([NavigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        NavigationController.interactivePopGestureRecognizer.enabled = YES;
        NavigationController.interactivePopGestureRecognizer.delegate = self;
    }
    self.window.rootViewController=NavigationController;

    UIButton *loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    loginBtn.frame = CGRectMake(20, SCREEN_HIGHE-80, 130, 40.5);
    loginBtn.layer.masksToBounds = YES;
    loginBtn.layer.cornerRadius = 3;
    loginBtn.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
    [loginBtn setBackgroundImage:[UIImage imageNamed:@"login_normal"] forState:UIControlStateNormal];
    [loginBtn setBackgroundImage:[UIImage imageNamed:@"login_slected"] forState:UIControlStateHighlighted];
    [loginBtn addTarget:self action:@selector(loginAct) forControlEvents:UIControlEventTouchUpInside];
    [LoadViewController.view addSubview:loginBtn];

    UIButton *registBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    registBtn.frame = CGRectMake(170, SCREEN_HIGHE-80, 130, 40.5);
    registBtn.layer.masksToBounds = YES;
    registBtn.layer.cornerRadius = 5;
    [registBtn setBackgroundImage:[UIImage imageNamed:@"regist_normal"] forState:UIControlStateNormal];
    [registBtn setBackgroundImage:[UIImage imageNamed:@"regist_selected"] forState:UIControlStateHighlighted];
    [registBtn addTarget:self action:@selector(registAct) forControlEvents:UIControlEventTouchUpInside];
    [LoadViewController.view addSubview:registBtn];

}

- (void)addImagePlay
{
    UIScrollView *sView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, -20, SCREEN_WIDTH, SCREEN_HIGHE + 20)];

    sView.contentSize = CGSizeMake(2*SCREEN_WIDTH, SCREEN_HIGHE);
    sView.pagingEnabled = YES;
    sView.showsHorizontalScrollIndicator = NO;
    sView.showsVerticalScrollIndicator = NO;
    //sView.scrollEnabled = NO;
    sView.tag = 200;
    //循环创建添加4张图片
    for (int i = 1; i <= 2; i ++) {
        UIImageView *imgView = [[UIImageView alloc]init];
        imgView.frame = CGRectMake((i - 1)*SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HIGHE);
        imgView.image = [UIImage imageNamed:[NSString  stringWithFormat:@"login%d.jpg",i]];
        [sView addSubview:imgView];
    }

    [LoadViewController.view addSubview:sView];

    //创建书页控件
    UIPageControl *pageControl = [[UIPageControl alloc]init];
    pageControl.frame = CGRectMake( 100, 440, 120, 20);
    pageControl.numberOfPages = 2;
    pageControl.currentPage = 0;
    pageControl.tag = 100;
    [LoadViewController.view addSubview:pageControl];

    //设置scrollView的代理为当前类对象
    sView.delegate = self;

    //添加定时器,使用scheuled方法创建的定时器,不需要用fird方法打开(自动开启的)
    //[self addtimer];
}

-(void)nextPage{
    int page = 0;
    UIPageControl *pControl = (UIPageControl *)[LoadViewController.view viewWithTag:100];
    if (pControl.currentPage == 3) {
        page = 0;
    }else{
        page = pControl.currentPage + 1;
    }

    //计算滚动的位置
    UIScrollView *sView = (UIScrollView *)[LoadViewController.view viewWithTag:200];
    CGFloat offsetX = page * sView.frame.size.width;
    CGPoint offset = CGPointMake(offsetX, 0);
    [sView setContentOffset:offset animated:YES];
}

#pragma  - mark UIScrollViewDelegate
//监听滚动的位置,改变pageCotrol的currentPage的值.
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{

    UIPageControl *pControl = (UIPageControl *)[LoadViewController.view viewWithTag:100];
    CGFloat scrollW = scrollView.frame.size.width;

    int page = (scrollView.contentOffset.x + scrollW * 0.5 )/ scrollW;
    pControl.currentPage = page;
}

-(void)MainView
{

    [[UINavigationBar appearance] setBackgroundImage:[GeneralClass CreateImageWithColor:STYLECLOLR] forBarMetrics:UIBarMetricsDefault];

    A_VoiceViewController  *A_VoiceView=[[A_VoiceViewController alloc] init];
    B_FirstViewController   *B_HomeView=[[B_FirstViewController alloc] init];
    C_NearByViewController *C_NearByView=[[C_NearByViewController alloc] init];
    D_PersonViewController *D_PersonView=[[D_PersonViewController alloc] init];
    TabBarController=[[UITabBarController alloc] init];
    TabBarController.viewControllers=[[NSArray alloc] initWithObjects:
                                      [[UINavigationController alloc] initWithRootViewController:A_VoiceView],
                                      [[UINavigationController alloc] initWithRootViewController:B_HomeView],
                                      [[UINavigationController alloc] initWithRootViewController:C_NearByView],
                                      [[UINavigationController alloc] initWithRootViewController:D_PersonView],nil];
    TabBarController.selectedIndex=INDEX;
    TabBarController.delegate=self;
    for (id view in TabBarController.tabBar.subviews) {
        [view removeFromSuperview];
    }
    CGFloat w = SCREEN_WIDTH / 4;
    for (int i=0; i < 4; i++) {
        UIButton *barBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        barBtn.frame = CGRectMake(w * i , 0, 80, 50);
        barBtn.alpha=0.9;barBtn.tag=i;
        barBtn.selected=i==INDEX;
        if (i==INDEX) {SelectBtn=barBtn;}
        barBtn.showsTouchWhenHighlighted = YES;

        [barBtn setImage:[UIImage imageNamed:[NSString stringWithFormat:@"a_root_image_%d.png",i]] forState:UIControlStateNormal];
        [barBtn setImage:[UIImage imageNamed:[NSString stringWithFormat:@"a_root_image_clicked_%d.png",i]] forState:UIControlStateSelected];
        [barBtn setContentMode:UIViewContentModeScaleAspectFit];
        //[barBtn setBackgroundColor:UIColorFromRGB(0x1a1a1a)];
        [barBtn addTarget:self action:@selector(SelectAction:) forControlEvents:UIControlEventTouchUpInside];
        [TabBarController.tabBar addSubview:barBtn];
        [BtnArray addObject:barBtn];
    }
    self.window.rootViewController=TabBarController;
}

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
    SelectBtn.selected=NO;
    SelectBtn=[BtnArray objectAtIndex:TabBarController.selectedIndex];
    SelectBtn.selected=YES;
}

-(void)SelectAction:(UIButton* )sender
{

    TabBarController.selectedIndex=sender.tag;
    SelectBtn.selected=NO;
    SelectBtn=sender;
    SelectBtn.selected=YES;
}

-(void)loginAct
{
    D_LoginViewController *D_LoginView=[[D_LoginViewController alloc] init];
    [D_LoginView setLoginBlock:^{
        [self MainView];
    }];
    [NavigationController pushViewController:D_LoginView animated:YES];
}

-(void)registAct
{
    [NavigationController pushViewController:[NSClassFromString(@"D_RegistViewController") new] animated:YES];
}

-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
    if(!url){
        return NO;
    }

    NSString *urlString=[url absoluteString];
//    NSLog(@"%@=============================",urlString);
    return YES;
}

-(void)OpenLog
{
    if (LogBtn==nil) {
        LogBtn= [UIButton buttonWithType:UIButtonTypeCustom];
        LogBtn.frame = CGRectMake(SCREEN_WIDTH-60, 100, 50, 50);
        [LogBtn setDragEnable:YES];
        [LogBtn setAdsorbEnable:YES];
        [LogBtn.titleLabel setFont:[UIFont fontWithName:@"icomoon" size:30]];
        [LogBtn setTitle:@"\ue604" forState:UIControlStateNormal];
        [LogBtn setTitle:@"\ue604" forState:UIControlStateSelected];
        [LogBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [LogBtn setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
        [LogBtn addTarget:self action:@selector(logSystem) forControlEvents:UIControlEventTouchUpInside];
        [[UIApplication sharedApplication].keyWindow addSubview:LogBtn];
    }

}

-(void)logSystem
{
    NSLog(@"set log!!!");

//    [self.window.rootViewController presentViewController:[[UINavigationController alloc] initWithRootViewController:[NSClassFromString(@"PushViewController") new]] animated:YES completion:^{
//
//    } ];
}

/** 接收注册推送通知功能时出现的错误,并做相关处理*/
- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err {
    NSLog(@"apns -> 注册推送功能时发生错误, 错误信息:\n %@", err);
}

#pragma mark - 实现远程推送需要实现的监听接口
/** 接收从苹果服务器返回的唯一的设备token,该token需要发送回推送服务器*/
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    NSString* token = [NSString stringWithFormat:@"%@",deviceToken];
	NSLog(@"apns -> 生成的devToken:%@", token);
    token=[[[token substringWithRange:NSMakeRange(0, 72)] substringWithRange:NSMakeRange(1, 71)] stringByReplacingOccurrencesOfString:@" " withString:@""];
    NSLog(@"apns -> 生成的devToken:%@", token);
    [[NSUserDefaults standardUserDefaults]setObject:token forKey:@"client_mobile"];

}

//程序处于启动状态,或者在后台运行时,会接收到推送消息,解析处理
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
    NSDictionary* retDict=[[NSDictionary alloc] initWithDictionary:userInfo];
    NSLog(@"远程通知-->     %@,%@",userInfo,retDict);
    [self showNotification:retDict];
}
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification*)notification{
    [self showNotification:notification.userInfo];
    NSLog(@"本地通知-->     %@",notification.userInfo);

    //在此时设置解析notification,并展示提示视图
}

//现实推送结果
-(void)showNotification:(NSDictionary *)userInfo
{
//    if ([[userInfo objectForKey:@"password"] isEqualToString:@"ucmed"]) {
//        [self OpenLog];
//    }
    if ([[[userInfo objectForKey:@"aps"] objectForKey:@"password"] isEqualToString:@"ucmed"]) {
       [self OpenLog];
    }

    NSLog(@"++++++%@",userInfo);
}

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {

    //跳转支付宝钱包进行支付,需要将支付宝钱包的支付结果回传给SDK
    if ([url.host isEqualToString:@"safepay"]) {
        [[AlipaySDK defaultService]
         processOrderWithPaymentResult:url
         standbyCallback:^(NSDictionary *resultDic){
             if ([[resultDic objectForKey:@"resultStatus"] intValue]==9000)
             {
                 UIAlertView* alert=[[UIAlertView alloc] initWithTitle:@"温馨提示" message:@"支付成功!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
                 [alert show];
             }
         }];
    }

    return YES;
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    [[NSNotificationCenter defaultCenter] postNotificationName:@"pay_select" object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"pay_select" object:nil];
}

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end


text:
class AddManaMultipleAndGoldMultipleToStructures < ActiveRecord::Migration
  def change
    add_column :structures, :mana_multiple, :decimal, precision: 3, scale:2
    add_column :structures, :gold_multiple, :decimal, precision: 3, scale:2
  end
end


text:
Rails.application.routes.draw do
  devise_for :users, controllers: {
    passwords: 'passwords',
    registrations: 'users',
    sessions: 'sessions',
  }
  devise_scope :user do
    get '/users/mailing_address', to: 'users#mailing_address', as: 'mailing_address'
    get '/users/survey', to: 'users#survey', as: 'survey'
    put '/users/restricted', to: 'users#restricted_update', as: 'restricted_user_update'
  end

  get '/address', to: 'addresses#show', as: 'address'
  get '/info_window', to: 'info_window#index', as: 'info_window'
  get '/sitemap', to: 'sitemaps#index', as: 'sitemap'

  scope '/sidebar', controller: :sidebar do
    get :search, as: 'search'
    get :combo_form, as: 'combo_form'
    get :edit_profile , as: 'edit_profile'
  end

  resource :reminders
  resource :things
  resource :promo_codes, only: [:update]
  get '/promo_codes/use', to: 'promo_codes#use', as: 'promo_codes_use'
  mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
  root to: 'main#index'
end


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var React = _interopRequireWildcard(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _clsx = _interopRequireDefault(require("clsx"));

var _utils = require("@material-ui/utils");

var _unstyled = require("@material-ui/unstyled");

var _system = require("@material-ui/system");

var _capitalize = _interopRequireDefault(require("../utils/capitalize"));

var _SwitchBase = _interopRequireDefault(require("../internal/SwitchBase"));

var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));

var _styled = _interopRequireDefault(require("../styles/styled"));

var _switchClasses = _interopRequireWildcard(require("./switchClasses"));

var _jsxRuntime = require("react/jsx-runtime");

const _excluded = ["className", "color", "edge", "size", "sx"];

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

const useUtilityClasses = styleProps => {
  const {
    classes,
    edge,
    size,
    color,
    checked,
    disabled
  } = styleProps;
  const slots = {
    root: ['root', edge && `edge${(0, _capitalize.default)(edge)}`, `size${(0, _capitalize.default)(size)}`],
    switchBase: ['switchBase', `color${(0, _capitalize.default)(color)}`, checked && 'checked', disabled && 'disabled'],
    thumb: ['thumb'],
    track: ['track'],
    input: ['input']
  };
  const composedClasses = (0, _unstyled.unstable_composeClasses)(slots, _switchClasses.getSwitchUtilityClass, classes);
  return (0, _extends2.default)({}, classes, composedClasses);
};

const SwitchRoot = (0, _styled.default)('span', {
  name: 'MuiSwitch',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      styleProps
    } = props;
    return (0, _extends2.default)({}, styles.root, styleProps.edge && styles[`edge${(0, _capitalize.default)(styleProps.edge)}`], styles[`size${(0, _capitalize.default)(styleProps.size)}`]);
  }
})(({
  styleProps
}) => (0, _extends2.default)({
  /* Styles applied to the root element. */
  display: 'inline-flex',
  width: 34 + 12 * 2,
  height: 14 + 12 * 2,
  overflow: 'hidden',
  padding: 12,
  boxSizing: 'border-box',
  position: 'relative',
  flexShrink: 0,
  zIndex: 0,
  // Reset the stacking context.
  verticalAlign: 'middle',
  // For correct alignment with the text.
  '@media print': {
    colorAdjust: 'exact'
  }
}, styleProps.edge === 'start' && {
  marginLeft: -8
}, styleProps.edge === 'end' && {
  marginRight: -8
}, styleProps.size === 'small' && {
  width: 40,
  height: 24,
  padding: 7,
  [`& .${_switchClasses.default.thumb}`]: {
    width: 16,
    height: 16
  },
  [`& .${_switchClasses.default.switchBase}`]: {
    padding: 4,
    [`&.${_switchClasses.default.checked}`]: {
      transform: 'translateX(16px)'
    }
  }
}));
const SwitchSwitchBase = (0, _styled.default)(_SwitchBase.default, {
  name: 'MuiSwitch',
  slot: 'SwitchBase',
  overridesResolver: (props, styles) => {
    const {
      styleProps
    } = props;
    return (0, _extends2.default)({}, styles.switchBase, styles.input, styleProps.color !== 'default' && styles[`color${(0, _capitalize.default)(styleProps.color)}`]);
  }
})(({
  theme
}) => ({
  /* Styles applied to the internal `SwitchBase` component's `root` class. */
  position: 'absolute',
  top: 0,
  left: 0,
  zIndex: 1,
  // Render above the focus ripple.
  color: theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[300],
  transition: theme.transitions.create(['left', 'transform'], {
    duration: theme.transitions.duration.shortest
  }),
  [`&.${_switchClasses.default.checked}`]: {
    transform: 'translateX(20px)'
  },
  [`&.${_switchClasses.default.disabled}`]: {
    color: theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[600]
  },
  [`&.${_switchClasses.default.checked} + .${_switchClasses.default.track}`]: {
    opacity: 0.5
  },
  [`&.${_switchClasses.default.disabled} + .${_switchClasses.default.track}`]: {
    opacity: theme.palette.mode === 'light' ? 0.12 : 0.2
  },
  [`& .${_switchClasses.default.input}`]: {
    /* Styles applied to the internal SwitchBase component's input element. */
    left: '-100%',
    width: '300%'
  }
}), ({
  theme,
  styleProps
}) => (0, _extends2.default)({
  '&:hover': {
    backgroundColor: (0, _system.alpha)(theme.palette.action.active, theme.palette.action.hoverOpacity),
    // Reset on touch devices, it doesn't add specificity
    '@media (hover: none)': {
      backgroundColor: 'transparent'
    }
  }
}, styleProps.color !== 'default' && {
  [`&.${_switchClasses.default.checked}`]: {
    color: theme.palette[styleProps.color].main,
    '&:hover': {
      backgroundColor: (0, _system.alpha)(theme.palette[styleProps.color].main, theme.palette.action.hoverOpacity),
      '@media (hover: none)': {
        backgroundColor: 'transparent'
      }
    },
    [`&.${_switchClasses.default.disabled}`]: {
      color: theme.palette.mode === 'light' ? (0, _system.lighten)(theme.palette[styleProps.color].main, 0.62) : (0, _system.darken)(theme.palette[styleProps.color].main, 0.55)
    }
  },
  [`&.${_switchClasses.default.checked} + .${_switchClasses.default.track}`]: {
    backgroundColor: theme.palette[styleProps.color].main
  }
}));
const SwitchTrack = (0, _styled.default)('span', {
  name: 'MuiSwitch',
  slot: 'Track',
  overridesResolver: (props, styles) => styles.track
})(({
  theme
}) => ({
  /* Styles applied to the track element. */
  height: '100%',
  width: '100%',
  borderRadius: 14 / 2,
  zIndex: -1,
  transition: theme.transitions.create(['opacity', 'background-color'], {
    duration: theme.transitions.duration.shortest
  }),
  backgroundColor: theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white,
  opacity: theme.palette.mode === 'light' ? 0.38 : 0.3
}));
const SwitchThumb = (0, _styled.default)('span', {
  name: 'MuiSwitch',
  slot: 'Thumb',
  overridesResolver: (props, styles) => styles.thumb
})(({
  theme
}) => ({
  /* Styles used to create the thumb passed to the internal `SwitchBase` component `icon` prop. */
  boxShadow: theme.shadows[1],
  backgroundColor: 'currentColor',
  width: 20,
  height: 20,
  borderRadius: '50%'
}));
const Switch = /*#__PURE__*/React.forwardRef(function Switch(inProps, ref) {
  const props = (0, _useThemeProps.default)({
    props: inProps,
    name: 'MuiSwitch'
  });
  const {
    className,
    color = 'primary',
    edge = false,
    size = 'medium',
    sx
  } = props,
        other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
  const styleProps = (0, _extends2.default)({}, props, {
    color,
    edge,
    size
  });
  const classes = useUtilityClasses(styleProps);
  const icon = /*#__PURE__*/(0, _jsxRuntime.jsx)(SwitchThumb, {
    className: classes.thumb,
    styleProps: styleProps
  });
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(SwitchRoot, {
    className: (0, _clsx.default)(classes.root, className),
    sx: sx,
    styleProps: styleProps,
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SwitchSwitchBase, (0, _extends2.default)({
      type: "checkbox",
      icon: icon,
      checkedIcon: icon,
      ref: ref,
      styleProps: styleProps
    }, other, {
      classes: (0, _extends2.default)({}, classes, {
        root: classes.switchBase
      })
    })), /*#__PURE__*/(0, _jsxRuntime.jsx)(SwitchTrack, {
      className: classes.track,
      styleProps: styleProps
    })]
  });
});
process.env.NODE_ENV !== "production" ? Switch.propTypes
/* remove-proptypes */
= {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // |     To update them edit the d.ts file and run "yarn proptypes"     |
  // ----------------------------------------------------------------------

  /**
   * If `true`, the component is checked.
   */
  checked: _propTypes.default.bool,

  /**
   * The icon to display when the component is checked.
   */
  checkedIcon: _propTypes.default.node,

  /**
   * Override or extend the styles applied to the component.
   */
  classes: _propTypes.default.object,

  /**
   * @ignore
   */
  className: _propTypes.default.string,

  /**
   * The color of the component. It supports those theme colors that make sense for this component.
   * @default 'primary'
   */
  color: _propTypes.default
  /* @typescript-to-proptypes-ignore */
  .oneOfType([_propTypes.default.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), _propTypes.default.string]),

  /**
   * The default checked state. Use when the component is not controlled.
   */
  defaultChecked: _propTypes.default.bool,

  /**
   * If `true`, the component is disabled.
   */
  disabled: _propTypes.default.bool,

  /**
   * If `true`, the ripple effect is disabled.
   */
  disableRipple: _propTypes.default.bool,

  /**
   * If given, uses a negative margin to counteract the padding on one
   * side (this is often helpful for aligning the left or right
   * side of the icon with content above or below, without ruining the border
   * size and shape).
   * @default false
   */
  edge: _propTypes.default.oneOf(['end', 'start', false]),

  /**
   * The icon to display when the component is unchecked.
   */
  icon: _propTypes.default.node,

  /**
   * The id of the `input` element.
   */
  id: _propTypes.default.string,

  /**
   * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
   */
  inputProps: _propTypes.default.object,

  /**
   * Pass a ref to the `input` element.
   */
  inputRef: _utils.refType,

  /**
   * Callback fired when the state is changed.
   *
   * @param {object} event The event source of the callback.
   * You can pull out the new value by accessing `event.target.value` (string).
   * You can pull out the new checked state by accessing `event.target.checked` (boolean).
   */
  onChange: _propTypes.default.func,

  /**
   * If `true`, the `input` element is required.
   */
  required: _propTypes.default.bool,

  /**
   * The size of the component.
   * `small` is equivalent to the dense switch styling.
   * @default 'medium'
   */
  size: _propTypes.default
  /* @typescript-to-proptypes-ignore */
  .oneOfType([_propTypes.default.oneOf(['medium', 'small']), _propTypes.default.string]),

  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: _propTypes.default.object,

  /**
   * The value of the component. The DOM API casts this to a string.
   * The browser uses "on" as the default value.
   */
  value: _propTypes.default.any
} : void 0;
var _default = Switch;
exports.default = _default;


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Les Champignons Parasites des Plantes Cultivees 1: 489 (1949)

#### Original name
Helminthosporium pyrorum Lib.

### Remarks
null


text:
/
void _CGPatternIssueCallBack(CGContextRef context, CGPatternRef pattern);

CGAffineTransform _CGPatternGetTransformation(CGPatternRef pattern);

/*
* Get the final size of the pattern tile (after xStep and xStep has been applied).
*/
CGRect _CGPatternGetFinalPatternSize(CGPatternRef pattern);

/*
* Get the pattern colored value.
* If it is colored, then we have a colored pattern has inherent color,
* if it's false then we have a stencil pattern does not have inherent color.
*/
bool _CGPatternIsColored(CGPatternRef pattern);

// Starboard-only:
COREGRAPHICS_EXPORT CGPatternRef _CGPatternCreateFromImage(CGImageRef img); // TODO: need to move out this maybe to UIKit ???


text:
package at.arz.latte.rodeo.infrastructure;

import java.util.Locale;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

import at.arz.latte.rodeo.api.ApiException;

@Provider
public class ApiExceptionMapper
		implements ExceptionMapper<ApiException> {

	@Override
	public Response toResponse(ApiException exception) {
		return exception.createResponse(Locale.getDefault());
	}
}


text:
package cz.kamenitxan.labelprinter

import java.io.File

import cz.kamenitxan.labelprinter.generators.Generators
import cz.kamenitxan.labelprinter.models.Product

import scala.jdk.CollectionConverters._
import scala.collection.mutable

/**
  * Created by tomaspavel on 6.3.17.
  */
object Director {

	def generate(file: File, generator: Generators, borders: Boolean, onlyBorders: Boolean): Unit = {
		val products: mutable.Seq[Product] = if (generator.staticPdf) {
			mutable.Seq({
				val p = new Product
				p.invNum = generator.folder
				p.manufacturer = null
				p
			})
		} else {
			val f = ExcelReader.importFile(file, generator, Main.debug).asScala
			print("File imported")
			f
		}

		val generatorF = generator
		if (Main.debug) {
			products.filter(p => p != null && p.isValid && (p.manufacturer == "A" || p.manufacturer == null))
			  .slice(0, 20)
			  .foreach(p => generatorF.genNG.newInstance()
			  .generate(p, borders, onlyBorders))
		} else {
			//TODO: parallel
			products.filter(p => p != null && p.isValid).foreach(p => generatorF.genNG.newInstance().generate(p, borders, onlyBorders))
		}
		System.gc()
	}
}


text:
namespace _03._Request_Parser
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;

    public class StartUp
    {
        public static void Main()
        {
            List<string> paths = new List<string>();
            string input;

            while ((input = Console.ReadLine()) != "END")
            {
                paths.Add(input);
            }

            string[] request = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            string method = request[0];
            string url = request[1];
            string requestPath = $"{url}/{method.ToLower()}";
            bool isValid = paths.Any(p => p == requestPath);

            int statusCode = isValid ? (int)HttpStatusCode.OK : (int)HttpStatusCode.NotFound;
            string content = isValid ? HttpStatusCode.OK.ToString() : HttpStatusCode.NotFound.ToString();
            int contentLength = content.Length;

            Console.WriteLine($"HTTP/1.1 {statusCode} {content}");
            Console.WriteLine($"Content-Length: {contentLength}");
            Console.WriteLine("Content-Type: text/plain");
            Console.WriteLine();
            Console.WriteLine(content);
        }
    }
}


text:
petulant-octo-dubstep
=====================

##Cocos2d-X

Best practice on learning Cocos2d-x with CocoStudio.

How to start a new project
-----------------------

1. Download the code from [cocos2d download site][4]
2. Run `setup.py`
3. Run the `cocos` script

Example:

    $ cd cocos2d-x
    $ ./setup.py
    $ source FILE_TO_SAVE_SYSTEM_VARIABLE
    $ cocos new MyCocos2dxGame -p com.godpaper.game.cocos2dx -l cpp -d C:/Users/yangboz/git/petulant-octo-dubstep
    $ cd C:/Users/yangboz/git/petulant-octo-dubstep/MyCocos2dxGame

### Build and run new project for android ###

    $ cocos run -p android -j 4

### Build and run new project for iOS ###

    $ cocos run -p ios

### Build and run new project for OSX ###

    $ cocos run -p mac

### Build and run new project for linux ###

if you never run cocos2d-x on linux, you need to install all dependences by the
script in **cocos2d/build/install-deps-linux.sh**

    $ cd cocos2d-x/build
    $ ./install-deps-linux.sh

Then

    $ cd NEW_PROJECTS_DIR/MyGame
    $ cocos run -p linux

Run

    $ bin/MyGame

### Build and run new project for win32 ###

    $ cocos run -p win32

### VS2013 configurations ###

http://blog.csdn.net/fansongy/article/details/18366275

http://blog.csdn.net/marpools/article/details/18895129

### Backlog

1.Cocos2d-X UIComponents lack of mouse_over effect,less of customize skin support;

2.Cocos2d-X/OpenCV using wstring,UTF8 character based file path will crash;

3.Cocos2d-X loss of native desktop file drag and drop funnction support;

...

## MXML

1.SDK:4.13.0 with TileList border width issue fix;

2.AIR with desktop support extending to ImageMagick(convert.exe);

## ImageMagick

http://www.imagemagick.org/

### CMD example ###

convert C:\image.jpg -resize 333x500 -rotate 0 +repage 333x333+0+30 -crop 333x333+0+0 -background white -flatten C:\image_output.jpg


text:
title: Virtual Console Injects for 3DS
url: https://mega.nz/#!qnAE1YjC!q3FRHgIAVEo4nRI2IfANHJr-r7Sil3YpPYE4w8ZbUPY
author.name: Asdolo
author.url: https://gbatemp.net/members/asdolo.389539/
thumbnail-url: https://i.imgur.com/rHa76XM.png
help-desc: Link to Virtual Console Injects for 3DS/Wiiu.
---

The recommended way to play old classics on your 3DS.
Usage guide [here](http://3ds.eiphax.tech/nsui.html).