text:
from oslo_log import log as logging
import six

import sahara.plugins.mapr.domain.configuration_file as bcf
import sahara.plugins.mapr.domain.node_process as np
import sahara.plugins.mapr.domain.service as s
import sahara.plugins.mapr.util.validation_utils as vu
import sahara.utils.files as files

LOG = logging.getLogger(__name__)

HIVE_METASTORE = np.NodeProcess(
    name='hivemeta',
    ui_name='HiveMetastore',
    package='mapr-hivemetastore',
    open_ports=[9083]
)
HIVE_SERVER_2 = np.NodeProcess(
    name='hs2',
    ui_name='HiveServer2',
    package='mapr-hiveserver2',
    open_ports=[10000]
)

class Hive(s.Service):
    SCHEMA_PATH_TEMPLATE = ("%(hive_home)s/scripts/metastore/upgrade/mysql/"
                            "hive-schema-%(hive_version)s.0.mysql.sql")

    def __init__(self):
        super(Hive, self).__init__()
        self._name = 'hive'
        self._ui_name = 'Hive'
        self._node_processes = [HIVE_METASTORE, HIVE_SERVER_2]
        self._validation_rules = [
            vu.exactly(1, HIVE_METASTORE),
            vu.exactly(1, HIVE_SERVER_2),
        ]

    # hive-site.xml
    def get_config_files(self, cluster_context, configs, instance=None):
        hive_default = 'plugins/mapr/services/hive/resources/hive-default.xml'
        hive_site = bcf.HadoopXML("hive-site.xml")
        hive_site.remote_path = self.conf_dir(cluster_context)
        if instance:
            hive_site.fetch(instance)
        hive_site.parse(files.get_file_text(hive_default))
        hive_site.add_properties(self._get_hive_site_props(cluster_context))
        return [hive_site]

    def _get_hive_site_props(self, context):
        # Import here to resolve circular dependency
        from sahara.plugins.mapr.services.mysql import mysql

        zookeepers = context.get_zookeeper_nodes_ip()
        metastore_specs = mysql.MySQL.METASTORE_SPECS

        return {
            'javax.jdo.option.ConnectionDriverName': mysql.MySQL.DRIVER_CLASS,
            'javax.jdo.option.ConnectionURL': self._get_jdbc_uri(context),
            'javax.jdo.option.ConnectionUserName': metastore_specs.user,
            'javax.jdo.option.ConnectionPassword': metastore_specs.password,
            'hive.metastore.uris': self._get_metastore_uri(context),
            'hive.zookeeper.quorum': zookeepers,
            'hbase.zookeeper.quorum': zookeepers,
        }

    def _get_jdbc_uri(self, context):
        # Import here to resolve circular dependency
        from sahara.plugins.mapr.services.mysql import mysql

        jdbc_uri = ('jdbc:mysql://%(db_host)s:%(db_port)s/%(db_name)s?'
                    'createDatabaseIfNotExist=true')
        jdbc_args = {
            'db_host': mysql.MySQL.get_db_instance(context).internal_ip,
            'db_port': mysql.MySQL.MYSQL_SERVER_PORT,
            'db_name': mysql.MySQL.METASTORE_SPECS.db_name,
        }
        return jdbc_uri % jdbc_args

    def _get_metastore_uri(self, context):
        return 'thrift://%s:9083' % context.get_instance_ip(HIVE_METASTORE)

    def post_start(self, cluster_context, instances):
        # Import here to resolve circular dependency
        import sahara.plugins.mapr.services.maprfs.maprfs as mfs

        create_path = lambda p: 'sudo -u mapr hadoop fs -mkdir %s' % p
        check_path = 'sudo -u mapr hadoop fs -ls %s'
        cmd = "%(check)s || ( %(parent)s && %(target)s )"
        args = {
            'check': check_path % '/user/hive/warehouse/',
            'parent': create_path('/user/hive/'),
            'target': create_path('/user/hive/warehouse/')
        }
        cldb_node = cluster_context.get_instance(mfs.CLDB)
        with cldb_node.remote() as r:
            LOG.debug("Creating Hive warehouse dir")
            r.execute_command(cmd % args, raise_when_error=False)

    def get_schema_path(self, cluster_context):
        args = {
            "hive_home": self.home_dir(cluster_context),
            "hive_version": self.version,
        }
        return self.SCHEMA_PATH_TEMPLATE % args

@six.add_metaclass(s.Single)
class HiveV013(Hive):
    def __init__(self):
        super(HiveV013, self).__init__()
        self._version = '0.13'
        self._dependencies = [('mapr-hive', self.version)]

@six.add_metaclass(s.Single)
class HiveV10(Hive):
    def __init__(self):
        super(HiveV10, self).__init__()
        self._version = "1.0"
        self._dependencies = [("mapr-hive", self.version)]

    def get_schema_path(self, cluster_context):
        args = {
            "hive_home": self.home_dir(cluster_context),
            # Hive 1.0 uses schema for Hive 0.14
            "hive_version": "0.14",
        }
        return self.SCHEMA_PATH_TEMPLATE % args


text:
package edu.stanford.dlss.contact;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.*;
import javax.servlet.http.*;

public class EmailServlet extends HttpServlet {

    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        String to = request.getParameter("email");
        String name = request.getParameter("fullname");
        String subject = request.getParameter("subject");
        String body = request.getParameter("message");

        response.setContentType("text/html;charset=UTF-8");

        EmailProcessor mailer = new EmailProcessor();
        boolean email_status = mailer.sendEmail(to, subject, body);

        PrintWriter out = response.getWriter();

        try {
        	 if(email_status){
	        	out.println("
Feedback Submitted
");
	            out.println("
Thanks "+name+" for your feedback.
");
        	 } else {
             	out.println("
Feedback not Submitted
");
                out.println("
There was a technical problem in sending your feedback. Please contact us on sul-was-support@lists.stanford.edu
");
        	 }
        } finally {
            out.close();
        }

    }

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP
     * GET method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Handles the HTTP
     * POST method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "This servlet is responsible of sending feedback email to support team.";
    }
}

redpajama_set_name: RedPajamaGithub


text:
package de.larsgrefer.cli.model;

import de.larsgrefer.cli.parser.ArgumentParser;

/**
 *
 * @author Lars Grefer
 * @param <T>
 */
public class SimpleArgumentedOption<T> extends ArgumentedOption<T, T>{

	public SimpleArgumentedOption() {
	}

	public SimpleArgumentedOption( char name, String longName, boolean required, String description, ArgumentParser<T> parser) {
		super(name, longName, required, description, parser);
	}

	@Override
	public void addValue(String valueString) {
		value = getParser().parse(valueString);
	}
}


text:
var app = angular.module('companyApp', []);

//Company controller
app.controller('CompanyController', function($scope, $http) {

    $scope.currentEdits = {};

    $scope.formData = {
        cvr_number: "",
        name: "",
        address: "",
        city: "",
        country: "",
        phone: ""
    }

    $scope.oriFormData = $scope.formData

    //a scope function to load the data.
    $scope.loadCompanies = function () {
        $http.get('/api/v1/companies').success(function(data) {
            $scope.companies = data;
            for (var i = 0, length = $scope.companies.length; i < length; i++) {
                $scope.currentEdits[$scope.companies[i].id] = false;
            }
        });
    };

    $scope.modify = function(company){
        $scope.currentEdits[company.id] = true;
    };

    $scope.update = function(company, index){
        var toSend = {
            "company": [{
                "name" : company.name,
                "address" : company.address,
                "city" : company.city,
                "country" : company.country,
                "phone" : company.phone
            }]
        }
        url = "/api/v1/company/".concat(company.cvr_number);
        $http.put(url, toSend).then(function(){
            $scope.loadCompanies();
            $scope.companies.splice(index, 1);
        });
        $scope.currentEdits[company.id] = false;
    };

    $scope.deleteCompany = function (cvr_number, index) {
        url = "/api/v1/company/".concat(cvr_number);
        $http.delete(url).then(function(){
            $scope.companies.splice(index, 1);
        });
    };

    $scope.createCompany = function (index) {
        var toSend = {
            "company": [{
                "cvr_number" : $scope.cvr_number,
                "name" : $scope.name,
                "address" : $scope.address,
                "city" : $scope.city,
                "country" : $scope.country,
                "phone" : $scope.phone
            }]
        }
        url = "/api/v1/company";
        $http.post(url, toSend).then(function(){
            $scope.loadCompanies();
            $scope.formData = {};
        });

    };

});


text:
//
//  A3TopicCell.m
//  BSBDJ
//
//  Created by mac on 15/10/30.
//  Copyright © 2015年 mac. All rights reserved.
//

#import "A3TopicCell.h"
#import "A3Topic.h"
#import "A3User.h"
#import "A3Comment.h"
#import "A3TopicPictureView.h"
#import "A3TopicVideoView.h"
#import "A3TopicVoiceView.h"

@interface A3TopicCell()
@property (weak, nonatomic) IBOutlet UIImageView *profileImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *createdAtLabel; //时间
@property (weak, nonatomic) IBOutlet UILabel *text_label;
@property (weak, nonatomic) IBOutlet UIButton *dingButton;
@property (weak, nonatomic) IBOutlet UIButton *caiButton;
@property (weak, nonatomic) IBOutlet UIButton *repostButton;    //分享
@property (weak, nonatomic) IBOutlet UIButton *commentButton; //评论
/** 最热评论-整体 */
@property (weak, nonatomic) IBOutlet UIView *topCmtView;
@property (weak, nonatomic) IBOutlet UILabel *topCmtContentLabel;

/** 中间控件 - 图片控件 */
@property (nonatomic, weak) A3TopicPictureView *pictureView;
/** 声音控件 */
@property (nonatomic, weak) A3TopicVoiceView *voiceView;
/** 视频控件 */
@property (nonatomic, weak) A3TopicVideoView *videoView;
@end

@implementation A3TopicCell
#pragma mark - lazy
- (A3TopicPictureView *)pictureView
{
    if (!_pictureView) {
        A3TopicPictureView *pictureView = [A3TopicPictureView centerView];
        [self.contentView addSubview:pictureView];
        _pictureView = pictureView;
    }
    return _pictureView;
}

- (A3TopicVoiceView *)voiceView
{
    if (!_voiceView) {
        A3TopicVoiceView  *voiceView = [A3TopicVoiceView centerView];
        [self.contentView addSubview:voiceView];
        _voiceView = voiceView;
    }
    return _voiceView;
}

#pragma mark - lazy
- (A3TopicVideoView *)videoView
{
    if (!_videoView) {
        A3TopicVideoView  *videoView = [A3TopicVideoView centerView];
        [self.contentView addSubview:videoView];
        _videoView = videoView;
    }
    return _videoView;
}
//设置xib的背景图片
- (void)awakeFromNib
{
    self.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mainCellBackground"]];
}
//调整框架
- (void)setFrame:(CGRect)frame
{
    frame.origin.y += A3Margin;
    frame.size.height -= A3Margin;
    [super setFrame:frame];
}
/*设置按钮的数字
*  @param button 按钮
*  @param number 数字
*  @param title  数字为0时显示的文字
 */
- (void)setupButton:(UIButton *)button number:(NSInteger)number title:(NSString *)title
{
    if (number >= 10000) {
        [button setTitle:[NSString stringWithFormat:@"%.1f万" ,number /10000.0] forState:UIControlStateNormal];
    } else if (number == 0){
        [button setTitle:title forState:UIControlStateNormal];
    }else {
        [button setTitle: [NSString stringWithFormat:@"%zd",number] forState:UIControlStateNormal];
    }
}
/**
 *  这个方法调用非常频繁
 */
- (void)setTopic:(A3Topic *)topic
{
    _topic = topic;
    [self.profileImageView setHeaderWithURL:topic.profile_image];
    self.nameLabel.text = topic.name;
    self.text_label.text =topic.text;
    self.createdAtLabel.text = topic.created_at;

    //设置底部工具条的数字
    [self setupButton:self.dingButton number:topic.ding title:@"顶"];
    [self setupButton:self.caiButton number:topic.cai title:@"踩"];
    [self setupButton:self.repostButton number:topic.repost title:@"分享"];
    [self setupButton:self.commentButton number:topic.comment title:@"评论"];

    //最热评论
    if(topic.top_cmt)  //如果有最热评论
    {
        self.topCmtView.hidden = NO;//不隐藏
        //内容
        NSString *content = topic.top_cmt.content;
        //用户名
        NSString *username = topic.top_cmt.user.username;

        self.topCmtContentLabel.text = [NSString stringWithFormat:@"%@ : %@",username,content];
    }else {
        self.topCmtView.hidden = YES;
    }
    //中间的具体内容
    if(topic.type == A3TopicTypePicture){ //图片
        self.videoView.hidden = YES;
        self.voiceView.hidden = YES;

        //往中间添加图片控件
        self.pictureView.hidden = NO;
        self.pictureView.frame = topic.centerViewFrame;
        self.pictureView.topic = topic; //数据
    } else if (topic.type == A3TopicTypeVoice){ //声音
        self.pictureView.hidden = YES;
        self.videoView.hidden = YES;

        self.voiceView.hidden = NO;
        self.voiceView.frame = topic.centerViewFrame;
        self.voiceView.topic = topic;
    }else if (topic.type == A3TopicTypeVideo){ //视频
        self.pictureView.hidden = YES;
        self.voiceView.hidden = YES;

        self.videoView.hidden = NO;
        self.videoView.frame = topic.centerViewFrame;
        self.videoView.topic = topic;
    }else { //文字
        self.pictureView.hidden = YES;
        self.videoView.hidden = YES;
        self.voiceView.hidden = YES;
    }
}
- (IBAction)moreClick
{
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];

    //添加按钮
    [alert addAction:[UIAlertAction actionWithTitle:@"收藏" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        A3Log(@"点击了[收藏]");
    }]];
    [alert addAction:[UIAlertAction actionWithTitle:@"举报" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        A3Log(@"点击了[举报]");
    }]];
    [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
        A3Log(@"点击了[取消]");
    }]];

    [self.window.rootViewController presentViewController:alert animated:YES completion:nil];
}
@end


text:
enum Season {
    /** @deprecated */
    WINTER, SPRING, SUMMER, FALL;
}
enum Season1 {
    WINTER, SPRING, SUMMER, FALL;
}
class T6245591 {
    void m() {
        Season s1 = Season.WINTER;    // ref to WINTER should be deprecated
        Season1 s2 = Season1.WINTER;  // nothing here should be deprecated;
                                      // @deprecated should not leak out of Season
    }
}


text:
package org.javasimon.examples.perf;

import org.javasimon.SimonManager;
import org.javasimon.SimonState;
import org.javasimon.Stopwatch;
import org.javasimon.StopwatchSample;
import org.javasimon.utils.BenchmarkUtils;
import org.javasimon.utils.GoogleChartImageGenerator;

/**
 * Compares start-stop cycle of an enabled and disabled Stopwatch and get-start-stop cycle on an enabled and disabled Manager.
 *
 * @author Richard "Virgo" Richter
 */
@SuppressWarnings("UnusedDeclaration")
public final class DisabledEnabledComparison {

	private static final int LOOP = 10000000;

	private DisabledEnabledComparison() {
	}

	/**
	 * Entry point of the demo application.
	 *
	 * @param args command line arguments
	 */
	public static void main(String[] args) {
		StopwatchSample[] results = BenchmarkUtils.run(2, 5,
			new BenchmarkUtils.Task("enabled") {
				@Override
				public void perform() throws Exception {
					SimonManager.clear();
					SimonManager.enable();
					Stopwatch tested = SimonManager.getStopwatch("org.javasimon.stopwatch");
					for (int i = 0; i < LOOP; i++) {
						tested.start().stop();
					}
				}
			},
			new BenchmarkUtils.Task("disabled") {
				@Override
				public void perform() throws Exception {
					SimonManager.clear();
					SimonManager.enable();
					Stopwatch tested = SimonManager.getStopwatch("org.javasimon.stopwatch");
					tested.setState(SimonState.DISABLED, false);
					for (int i = 0; i < LOOP; i++) {
						tested.start().stop();
					}
				}
			},
			new BenchmarkUtils.Task("mgr-enabled") {
				@Override
				public void perform() throws Exception {
					SimonManager.clear();
					SimonManager.enable();
					for (int i = 0; i < LOOP; i++) {
						SimonManager.getStopwatch("org.javasimon.stopwatch").start().stop();
					}
				}
			},
			new BenchmarkUtils.Task("mgr-disabled") {
				@Override
				public void perform() throws Exception {
					SimonManager.clear();
					SimonManager.disable();
					for (int i = 0; i < LOOP; i++) {
						SimonManager.getStopwatch("org.javasimon.stopwatch").start().stop();
					}
				}
			},
			new BenchmarkUtils.Task("assign-ns") {
				@Override
				public void perform() throws Exception {
					for (int i = 0; i < LOOP; i++) {
						long ns = System.nanoTime();
					}
				}
			}
		);

		System.out.println("\nGoogle Chart avg:\n" +
			GoogleChartImageGenerator.barChart("10M-loop duration", results));
	}
}


text:
#include <xpcc/architecture/platform.hpp>
#include <xpcc/processing.hpp>
#include <xpcc/debug/logger.hpp>

/**
 * Example of CAN Hardware on STM32 F0 Discovery Board.
 *
 * Connect PB8 / PB9 to a CAN transceiver which is connected to a CAN bus.
 *
 */

// Create an IODeviceWrapper around the Uart Peripheral we want to use
xpcc::IODeviceWrapper< Usart1, xpcc::IOBuffer::BlockIfFull > loggerDevice;

// Set all four logger streams to use the UART
xpcc::log::Logger xpcc::log::debug(loggerDevice);
xpcc::log::Logger xpcc::log::info(loggerDevice);
xpcc::log::Logger xpcc::log::warning(loggerDevice);
xpcc::log::Logger xpcc::log::error(loggerDevice);

// Set the log level
#undef	XPCC_LOG_LEVEL
#define	XPCC_LOG_LEVEL xpcc::log::DEBUG

static void
displayMessage(const xpcc::can::Message& message)
{
	static uint32_t receiveCounter = 0;
	receiveCounter++;

	XPCC_LOG_INFO<< "id  =" << message.getIdentifier();
	if (message.isExtended()) {
		XPCC_LOG_INFO<< " extended";
	}
	else {
		XPCC_LOG_INFO<< " standard";
	}
	if (message.isRemoteTransmitRequest()) {
		XPCC_LOG_INFO<< ", rtr";
	}
	XPCC_LOG_INFO<< xpcc::endl;

	XPCC_LOG_INFO<< "dlc =" << message.getLength() << xpcc::endl;
	if (!message.isRemoteTransmitRequest())
	{
		XPCC_LOG_INFO << "data=";
		for (uint32_t i = 0; i < message.getLength(); ++i) {
			XPCC_LOG_INFO<< xpcc::hex << message.data[i] << xpcc::ascii << ' ';
		}
		XPCC_LOG_INFO<< xpcc::endl;
	}
	XPCC_LOG_INFO<< "# received=" << receiveCounter << xpcc::endl;
}

// ----------------------------------------------------------------------------
int
main()
{
	Board::initialize();

	Board::LedUp::set();

	// Initialize Usart
	GpioOutputA9::connect(Usart1::Tx);
	GpioInputA10::connect(Usart1::Rx, Gpio::InputType::PullUp);
	Usart1::initialize<Board::systemClock, 115200>(12);

	XPCC_LOG_INFO << "CAN Test Program" << xpcc::endl;

	XPCC_LOG_INFO << "Initializing Can ..." << xpcc::endl;
	// Initialize Can
	GpioInputB8::connect(Can1::Rx, Gpio::InputType::PullUp);
	GpioOutputB9::connect(Can1::Tx, Gpio::OutputType::PushPull);
	Can1::initialize<Board::systemClock, Can1::Bitrate::kBps125>(9);

	XPCC_LOG_INFO << "Setting up Filter for Can ..." << xpcc::endl;
	// Receive every message
	CanFilter::setFilter(0, CanFilter::FIFO0,
			CanFilter::ExtendedIdentifier(0),
			CanFilter::ExtendedFilterMask(0));

	// Send a message
	XPCC_LOG_INFO << "Sending message on Can ..." << xpcc::endl;
	xpcc::can::Message msg1(1, 1);
	msg1.setExtended(true);
	msg1.data[0] = 0x11;
	Can1::sendMessage(msg1);

	xpcc::ShortPeriodicTimer pTimer(1000);

	const auto silent    = static_cast<bool>(CAN->BTR & CAN_BTR_SILM);
	const auto loop_back = static_cast<bool>(CAN->BTR & CAN_BTR_LBKM);
	XPCC_LOG_INFO << "Can silent mode: " << silent << xpcc::endl;
	XPCC_LOG_INFO << "Can loop back mode: " << loop_back << xpcc::endl;

	while (1)
	{
		if (Can1::isMessageAvailable())
		{
			XPCC_LOG_INFO << "Can: Message is available..." << xpcc::endl;
			xpcc::can::Message message;
			Can1::getMessage(message);
			displayMessage(message);
		}

		if (pTimer.execute()) {
			Board::LedUp::toggle();

			static uint8_t idx = 0;
			xpcc::can::Message msg1(1, 1);
			msg1.setExtended(true);
			msg1.data[0] = idx;
			Can1::sendMessage(msg1);

			++idx;
		}
	}

	return 0;
}


text:
package com.github.aint.jfeeder.model.dao.hibernate;

import org.springframework.stereotype.Repository;

import com.github.aint.jfeeder.model.dao.UserDao;
import com.github.aint.jfeeder.model.entity.User;

/**
 * The implementation of the {@code UserDao} interface.
 *
 * @author Olexandr Tyshkovets
 * @see User
 */
@Repository
public class UserHibernateDao extends AbstractHibernateDao<User> implements UserDao {
    /**
     * {@inheritDoc}
     */
    @Override
    public User getByUsername(String username) {
        return (User) getCurrentSession()
                .getNamedQuery("User.getByUsername")
                .setString(0, username)
                .uniqueResult();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public User getByEmail(String email) {
        return (User) getCurrentSession()
                .getNamedQuery("User.getByEmail")
                .setString(0, email)
                .uniqueResult();
    }

}


text:
import unittest

from cwr.parser.encoder.dictionary import PublisherRecordDictionaryEncoder
from cwr.interested_party import PublisherRecord, Publisher

"""
Publisher to dictionary encoding tests.

The following cases are tested:
"""

__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'

class TestPublisherDictionaryEncoding(unittest.TestCase):
    def setUp(self):
        self._encoder = PublisherRecordDictionaryEncoder()

    def test_encoded(self):
        publisher = Publisher(ip_n='ABC15',
                              publisher_name='NAME',
                              ipi_name_n=14107338,
                              ipi_base_n='I-000000229-7',
                              tax_id=923703412)

        data = PublisherRecord(record_type='SPU',
                               transaction_sequence_n=3,
                               record_sequence_n=15,
                               publisher=publisher,
                               publisher_sequence_n=12,
                               submitter_agreement_n='ABC13',
                               publisher_type='PA',
                               publisher_unknown='U',
                               agreement_type='PG',
                               international_standard_code='14AEI',
                               society_assigned_agreement_n='GH34',
                               pr_society=13,
                               pr_ownership_share=50.5,
                               mr_society=14,
                               mr_ownership_share=60.5,
                               sr_society=15,
                               sr_ownership_share=70.5,
                               first_recording_refusal='N',
                               usa_license='B')

        encoded = self._encoder.encode(data)
        publisher = encoded['publisher']

        self.assertEqual('ABC15', publisher['ip_n'])
        self.assertEqual('NAME', publisher['publisher_name'])
        self.assertEqual(14107338, publisher['ipi_name_n'])
        self.assertEqual(923703412, publisher['tax_id'])

        self.assertEqual('I-000000229-7', publisher['ipi_base_n'])

        self.assertEqual('SPU', encoded['record_type'])
        self.assertEqual(3, encoded['transaction_sequence_n'])
        self.assertEqual(15, encoded['record_sequence_n'])
        self.assertEqual(12, encoded['publisher_sequence_n'])
        self.assertEqual('ABC13', encoded['submitter_agreement_n'])
        self.assertEqual('PA', encoded['publisher_type'])
        self.assertEqual('U', encoded['publisher_unknown'])
        self.assertEqual('PG', encoded['agreement_type'])
        self.assertEqual('14AEI', encoded['international_standard_code'])
        self.assertEqual('GH34', encoded['society_assigned_agreement_n'])
        self.assertEqual(13, encoded['pr_society'])
        self.assertEqual(50.5, encoded['pr_ownership_share'])
        self.assertEqual(14, encoded['mr_society'])
        self.assertEqual(60.5, encoded['mr_ownership_share'])
        self.assertEqual(15, encoded['sr_society'])
        self.assertEqual(70.5, encoded['sr_ownership_share'])
        self.assertEqual('N', encoded['first_recording_refusal'])
        self.assertEqual('B', encoded['usa_license'])


text:
"""Added is_editable to Responses table

Revision ID: 32dec7b290bb
Revises: a2547b706641
Create Date: 2016-12-28 14:09:07.411987

"""

# revision identifiers, used by Alembic.
revision = "32dec7b290bb"
down_revision = "a2547b706641"

from alembic import op
import sqlalchemy as sa

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column("responses", sa.Column("is_editable", sa.Boolean(), nullable=False))
    ### end Alembic commands ###

def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("responses", "is_editable")
    ### end Alembic commands ###


text:
// @ts-check
const typedoc = require("gulp-typedoc");
const { Application } = require("typedoc");
const { Component } = require("typedoc/dist/lib/utils/component");
const { DiscoverEvent, OptionsComponent } = require("typedoc/dist/lib/utils/options/options");
const { OptionsReadMode } = require("typedoc/dist/lib/utils/options");
const { ParameterType } = require("typedoc/dist/lib/utils/options/declaration");
const { Renderer } = require("typedoc/dist/lib/output/renderer");

const applicationCustomOptions = Symbol();
const savedBootstrap = Application.prototype["bootstrap"];
Application.prototype["bootstrap"] = function (options) {
    this[applicationCustomOptions] = options;
    const result = savedBootstrap.apply(this, arguments);
    this[applicationCustomOptions] = undefined;
    return result;
};

// gulp-typedoc does not correctly handle custom options
let GulpOptionsReader = class GulpOptionsReader extends OptionsComponent {
    initialize() {
        this.listenTo(this.owner, DiscoverEvent.DISCOVER, this.onDiscover, -200);
    }

    /** @param {DiscoverEvent} event */
    onDiscover(event) {
        if (event.mode !== OptionsReadMode.Fetch) return;
        const customOptions = this.application[applicationCustomOptions];
        if (customOptions) {
            const owner = this.owner;
            const handledOptions = this.application.options.getRawValues();
            for (const key of Object.keys(customOptions)) {
                if (handledOptions.hasOwnProperty(key)) continue;
                const value = customOptions[key];
                const declaration = owner.getDeclaration(key);
                if (!declaration) {
                    event.addError('Unknown option: %s', key);
                }
                else {
                    if (declaration.type !== ParameterType.Boolean && !value) {
                        event.addError('Option "%s" expects an argument.', declaration.name);
                        continue;
                    }
                    event.data[declaration.name] = value;
                }
            }
        }
    }
}

GulpOptionsReader = Component({
    name: "options:gulp"
})(GulpOptionsReader) || GulpOptionsReader;

/**
 * @param {import("gulp-typedoc").Options & ExtendedOptions & PluginOptions} options
 */
module.exports = function (options) {
    return typedoc(options);
}

/**
 * @typedef ExtendedOptions
 * @property {string} [tsconfig]
 * @property {string[]} [plugin]
 * @property {boolean} [excludeNotExported]
 *
 * @typedef {{ [key: string]: any }} PluginOptions
 */
void 0;


text:
require 'spec_helper'

describe 'apache::mod::perl', type: :class do
  it_behaves_like 'a mod class, without including apache'
  context 'on a Debian OS' do
    include_examples 'Debian 11'

    it { is_expected.to contain_class('apache::params') }
    it { is_expected.to contain_apache__mod('perl') }
    it { is_expected.to contain_package('libapache2-mod-perl2') }
  end
  context 'on a RedHat OS' do
    include_examples 'RedHat 8'

    it { is_expected.to contain_class('apache::params') }
    it { is_expected.to contain_apache__mod('perl') }
    it { is_expected.to contain_package('mod_perl') }
  end
  context 'on a FreeBSD OS' do
    include_examples 'FreeBSD 9'

    it { is_expected.to contain_class('apache::params') }
    it { is_expected.to contain_apache__mod('perl') }
    it { is_expected.to contain_package('www/mod_perl2') }
  end
  context 'on a Gentoo OS' do
    include_examples 'Gentoo'

    it { is_expected.to contain_class('apache::params') }
    it { is_expected.to contain_apache__mod('perl') }
    it { is_expected.to contain_package('www-apache/mod_perl') }
  end
end


text:
[![CI Status](http://img.shields.io/travis/hyj223/UCarWeex.svg?style=flat)](https://travis-ci.org/hyj223/UCarWeex)
[![Version](https://img.shields.io/cocoapods/v/UCarWeex.svg?style=flat)](http://cocoapods.org/pods/UCarWeex)
[![License](https://img.shields.io/cocoapods/l/UCarWeex.svg?style=flat)](http://cocoapods.org/pods/UCarWeex)
[![Platform](https://img.shields.io/cocoapods/p/UCarWeex.svg?style=flat)](http://cocoapods.org/pods/UCarWeex)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

UCarWeex is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "UCarWeex"
```

## Author

hyj223, yj.hu02@zuche.com

## License

UCarWeex is available under the MIT license. See the LICENSE file for more info.


text:
//===--- LangOptions.h - Language & configuration options -------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
//  This file defines the LangOptions class, which provides various
//  language and configuration flags.
//
//===----------------------------------------------------------------------===//

#ifndef SWIFT_BASIC_LANGOPTIONS_H
#define SWIFT_BASIC_LANGOPTIONS_H

#include "swift/Basic/Feature.h"
#include "swift/Basic/FunctionBodySkipping.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/Version.h"
#include "swift/Config.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Support/Regex.h"
#include "llvm/Support/VersionTuple.h"
#include "llvm/Support/raw_ostream.h"
#include <atomic>
#include <string>
#include <vector>

namespace swift {

  enum class DiagnosticBehavior : uint8_t;

  /// Kind of implicit platform conditions.
  enum class PlatformConditionKind {
#define PLATFORM_CONDITION(LABEL, IDENTIFIER) LABEL,
#include "swift/AST/PlatformConditionKinds.def"
  };

  /// Describes which Swift 3 Objective-C inference warnings should be
  /// emitted.
  enum class Swift3ObjCInferenceWarnings {
    /// No warnings; this is the default.
    None,
    /// "Minimal" warnings driven by uses of declarations that make use of
    /// the Objective-C entry point directly.
    Minimal,
    /// "Complete" warnings that add "@objc" for every entry point that
    /// Swift 3 would have inferred as "@objc" but Swift 4 will not.
    Complete,
  };

  /// Describes how strict concurrency checking should be.
  enum class StrictConcurrency {
    /// Enforce Sendable constraints where it has been explicitly adopted and
    /// perform actor-isolation checking wherever code has adopted concurrency.
    Minimal,
    /// Enforce Sendable constraints and perform actor-isolation checking
    /// wherever code has adopted concurrency, including code that has
    /// explicitly adopted Sendable.
    Targeted,
    /// Enforce Sendable constraints and actor-isolation checking throughout
    /// the entire module.
    Complete,
  };

  /// Access or distribution level of a library.
  enum class LibraryLevel : uint8_t {
    /// Application Programming Interface that is publicly distributed so
    /// public decls are really public and only @_spi decls are SPI.
    API,

    /// System Programming Interface that has restricted distribution
    /// all decls in the module are considered to be SPI including public ones.
    SPI,

    /// Internal Programming Interface that is not distributed and only usable
    /// from within a project.
    IPI,

    /// The library has some other undefined distribution.
    Other
  };

  enum class AccessNoteDiagnosticBehavior : uint8_t {
    Ignore,
    RemarkOnFailure,
    RemarkOnFailureOrSuccess,
    ErrorOnFailureRemarkOnSuccess
  };

  enum class ConcurrencyModel : uint8_t {
    Standard,
    TaskToThread,
  };

  /// A collection of options that affect the language dialect and
  /// provide compiler debugging facilities.
  class LangOptions final {
  public:

    /// The target we are building for.
    ///
    /// This represents the minimum deployment target.
    llvm::Triple Target;

    /// \brief The second target for a zippered build
    ///
    /// This represents the target and minimum deployment version for the
    /// second ('variant') target when performing a zippered build.
    /// For example, if the target is x86_64-apple-macosx10.14 then
    /// a target-variant of x86_64-apple-ios12.0-macabi will produce
    /// a zippered binary that can be loaded into both macCatalyst and
    /// macOS processes. A value of 'None' means no zippering will be
    /// performed.
    llvm::Optional<llvm::Triple> TargetVariant;

    /// The target triple to instantiate the internal clang instance.
    /// When not specified, the compiler will use the value of -target to
    /// instantiate the clang instance.
    /// This is mainly used to avoid lowering the target triple to use for clang when
    /// importing a .swiftinterface whose -target value may be different from
    /// the loading module.
    /// The lowering triple may result in multiple versions of the same Clang
    /// modules being built.
    llvm::Optional<llvm::Triple> ClangTarget;

    /// The SDK version, if known.
    Optional<llvm::VersionTuple> SDKVersion;

    /// The target variant SDK version, if known.
    Optional<llvm::VersionTuple> VariantSDKVersion;

    /// The SDK canonical name, if known.
    std::string SDKName;

    /// The lowest target OS version that code in this module may be inlined
    /// into. In resilient modules, this should match the minimum
    /// deployment target of the *first* resilient version of the module, since
    /// clients may need to interoperate with versions as far back as that
    /// deployment target.
    llvm::VersionTuple MinimumInliningTargetVersion;

    /// The alternate name to use for the entry point instead of main.
    std::string entryPointFunctionName = "main";

    ///
    /// Language features
    ///

    /// User-overridable language version to compile for.
    version::Version EffectiveLanguageVersion = version::Version::getCurrentLanguageVersion();

    /// PackageDescription version to compile for.
    version::Version PackageDescriptionVersion;

    /// Enable experimental string processing
    bool EnableExperimentalStringProcessing = false;

    /// Disable API availability checking.
    bool DisableAvailabilityChecking = false;

    /// Only check the availability of the API, ignore function bodies.
    bool CheckAPIAvailabilityOnly = false;

    /// Causes the compiler to use weak linkage for symbols belonging to
    /// declarations introduced at the deployment target.
    bool WeakLinkAtTarget = false;

    /// Should conformance availability violations be diagnosed as errors?
    bool EnableConformanceAvailabilityErrors = false;

    /// Should potential unavailability on enum cases be downgraded to a warning?
    bool WarnOnPotentiallyUnavailableEnumCase = false;

    /// Should the editor placeholder error be downgraded to a warning?
    bool WarnOnEditorPlaceholder = false;

    /// Maximum number of typo corrections we are allowed to perform.
    /// This is disabled by default until we can get typo-correction working within acceptable performance bounds.
    unsigned TypoCorrectionLimit = 0;

    /// Should access control be respected?
    bool EnableAccessControl = true;

    /// Enable 'availability' restrictions for App Extensions.
    bool EnableAppExtensionRestrictions = false;

    /// Diagnostic level to report when a public declarations doesn't declare
    /// an introduction OS version.
    Optional<DiagnosticBehavior> RequireExplicitAvailability = None;

    /// Introduction platform and version to suggest as fix-it
    /// when using RequireExplicitAvailability.
    std::string RequireExplicitAvailabilityTarget;

    // Availability macros definitions to be expanded at parsing.
    SmallVector<std::string, 4> AvailabilityMacros;

    /// Require public declarations to declare that they are Sendable (or not).
    bool RequireExplicitSendable = false;

    /// Detect and automatically import modules' cross-import overlays.
    bool EnableCrossImportOverlays = false;

    /// Emit a remark when import resolution implicitly adds a cross-import
    /// overlay.
    bool EnableCrossImportRemarks = false;

    /// Emit a remark after loading a module.
    bool EnableModuleLoadingRemarks = false;

    /// Emit a remark when indexing a system module.
    bool EnableIndexingSystemModuleRemarks = false;

    /// Emit a remark on early exit in explicit interface build
    bool EnableSkipExplicitInterfaceModuleBuildRemarks = false;

    ///
    /// Support for alternate usage modes
    ///

    /// Enable features useful for running in the debugger.
    bool DebuggerSupport = false;

    /// Enable the MemoryBufferSerializedModuleImporter.
    /// Only used by lldb-moduleimport-test.
    bool EnableMemoryBufferImporter = false;

    /// Allows using identifiers with a leading dollar.
    bool EnableDollarIdentifiers = false;

    /// Allow throwing call expressions without annotation with 'try'.
    bool EnableThrowWithoutTry = false;

    /// If set, inserts instrumentation useful for testing the debugger.
    bool DebuggerTestingTransform = false;

    /// Indicates whether the AST should be instrumented to simulate a
    /// debugger's program counter. Similar to the PlaygroundTransform, this
    /// will instrument the AST with function calls that get called when you
    /// would see a program counter move in a debugger. To adopt this implement
    /// the __builtin_pc_before and __builtin_pc_after functions.
    bool PCMacro = false;

    /// Enable features useful for running playgrounds.
    // FIXME: This should probably be limited to the particular SourceFile.
    bool Playground = false;

    /// Indicates whether the playground transformation should be applied.
    bool PlaygroundTransform = false;

    /// Indicates whether the playground transformation should omit
    /// instrumentation that has a high runtime performance impact.
    bool PlaygroundHighPerformance = false;

    /// Keep comments during lexing and attach them to declarations.
    bool AttachCommentsToDecls = false;

    ///
    /// Flags for use by tests
    ///

    /// Enable Objective-C Runtime interop code generation and build
    /// configuration options.
    bool EnableObjCInterop = true;

    /// Enable C++ interop code generation and build configuration
    /// options. Disabled by default because there is no way to control the
    /// language mode of clang on a per-header or even per-module basis. Also
    /// disabled because it is not complete.
    bool EnableCXXInterop = false;

    bool CForeignReferenceTypes = false;

    /// Imports getters and setters as computed properties.
    bool CxxInteropGettersSettersAsProperties = false;

    /// On Darwin platforms, use the pre-stable ABI's mark bit for Swift
    /// classes instead of the stable ABI's bit. This is needed when
    /// targeting OSes prior to macOS 10.14.4 and iOS 12.2, where
    /// libobjc does not support the stable ABI's marker bit.
    bool UseDarwinPreStableABIBit = false;

    /// Enables checking that uses of @objc require importing
    /// the Foundation module.
    /// This is enabled by default because SILGen can crash in such a case, but
    /// it gets disabled when compiling the Swift core stdlib.
    bool EnableObjCAttrRequiresFoundation = true;

    /// If true, <code>@testable import Foo</code> produces an error if \c Foo
    /// was not compiled with -enable-testing.
    bool EnableTestableAttrRequiresTestableModule = true;

    ///
    /// Flags for developers
    ///

    /// Enable named lazy member loading.
    bool NamedLazyMemberLoading = true;

    /// Whether to record request references for incremental builds.
    bool RecordRequestReferences = true;

    /// Whether to dump debug info for request evaluator cycles.
    bool DebugDumpCycles = false;

    /// Disable SIL substituted function types.
    bool DisableSubstSILFunctionTypes = false;

    /// Whether to diagnose an ephemeral to non-ephemeral conversion as an
    /// error.
    bool DiagnoseInvalidEphemeralnessAsError = false;

    /// The maximum depth to which to test decl circularity.
    unsigned MaxCircularityDepth = 500;

    /// Perform all dynamic allocations using malloc/free instead of
    /// optimized custom allocator, so that memory debugging tools can be used.
    bool UseMalloc = false;

    /// Specifies how strict concurrency checking will be.
    StrictConcurrency StrictConcurrencyLevel = StrictConcurrency::Targeted;

    /// Enable experimental concurrency model.
    bool EnableExperimentalConcurrency = false;

    /// Disable experimental ClangImporter diagnostics.
    bool DisableExperimentalClangImporterDiagnostics = false;

    /// Enable experimental eager Clang module diagnostics.
    bool EnableExperimentalEagerClangModuleDiagnostics = false;

    /// Enable inference of Sendable conformances for public types.
    bool EnableInferPublicSendable = false;

    /// Disable the implicit import of the _Concurrency module.
    bool DisableImplicitConcurrencyModuleImport =
        !SWIFT_IMPLICIT_CONCURRENCY_IMPORT;

    /// Disable the implicit import of the _StringProcessing module.
    bool DisableImplicitStringProcessingModuleImport = false;

    /// Should we check the target OSs of serialized modules to see that they're
    /// new enough?
    bool EnableTargetOSChecking = true;

    /// Whether to attempt to recover from missing cross-references and other
    /// errors when deserializing from a Swift module.
    ///
    /// This is a staging flag; eventually it will be removed.
    bool EnableDeserializationRecovery = true;

    /// Whether to enable the new operator decl and precedencegroup lookup
    /// behavior. This is a staging flag, and will be removed in the future.
    bool EnableNewOperatorLookup = false;

    /// The set of features that have been enabled.
    llvm::SmallSet<Feature, 2> Features;

    /// Temporary flag to support LLDB's transition to using \c Features.
    bool EnableBareSlashRegexLiterals = false;

    /// Use Clang function types for computing canonical types.
    /// If this option is false, the clang function types will still be computed
    /// but will not be used for checking type equality.
    /// [TODO: Clang-type-plumbing] Turn on for feature rollout.
    bool UseClangFunctionTypes = false;

    /// If set to true, the diagnosis engine can assume the emitted diagnostics
    /// will be used in editor. This usually leads to more aggressive fixit.
    bool DiagnosticsEditorMode = false;

    /// Whether to enable Swift 3 @objc inference, e.g., for members of
    /// Objective-C-derived classes and 'dynamic' members.
    bool EnableSwift3ObjCInference = false;

    /// Access or distribution level of the whole module being parsed.
    LibraryLevel LibraryLevel = LibraryLevel::Other;

    /// Warn about cases where Swift 3 would infer @objc but later versions
    /// of Swift do not.
    Swift3ObjCInferenceWarnings WarnSwift3ObjCInference =
      Swift3ObjCInferenceWarnings::None;

    /// Diagnose implicit 'override'.
    bool WarnImplicitOverrides = false;

    /// Diagnose uses of NSCoding with classes that have unstable mangled names.
    bool EnableNSKeyedArchiverDiagnostics = true;

    /// Diagnose switches over non-frozen enums that do not have catch-all
    /// cases.
    bool EnableNonFrozenEnumExhaustivityDiagnostics = false;

    /// Regex for the passes that should report passed and missed optimizations.
    ///
    /// These are shared_ptrs so that this class remains copyable.
    std::shared_ptr<llvm::Regex> OptimizationRemarkPassedPattern;
    std::shared_ptr<llvm::Regex> OptimizationRemarkMissedPattern;

    /// How should we emit diagnostics about access notes?
    AccessNoteDiagnosticBehavior AccessNoteBehavior =
        AccessNoteDiagnosticBehavior::RemarkOnFailureOrSuccess;

    DiagnosticBehavior getAccessNoteFailureLimit() const;

    bool shouldRemarkOnAccessNoteSuccess() const {
      return AccessNoteBehavior >=
          AccessNoteDiagnosticBehavior::RemarkOnFailureOrSuccess;
    }

    /// Whether collect tokens during parsing for syntax coloring.
    bool CollectParsedToken = false;

    /// Whether to disable the evaluation of '#if' decls, such that the bodies
    /// of active clauses aren't hoisted into the enclosing scope.
    bool DisablePoundIfEvaluation = false;

    /// When using fine-grained dependencies, emit dot files for every swiftdeps
    /// file.
    bool EmitFineGrainedDependencySourcefileDotFiles = false;

    /// Enable verification when every SubstitutionMap is constructed.
    bool VerifyAllSubstitutionMaps = false;

    /// Load swiftmodule files in memory as volatile and avoid mmap.
    bool EnableVolatileModules = false;

    /// Enable experimental 'hermetic seal at link' feature. Turns on
    /// dead-stripping optimizations assuming that all users of library code
    /// are present at LTO time.
    bool HermeticSealAtLink = false;

    /// Allow deserializing implementation only dependencies. This should only
    /// be set true by lldb and other tooling, so that deserialization
    /// recovery issues won't bring down the debugger.
    /// TODO: remove this when @_implementationOnly modules are robust enough.
    bool AllowDeserializingImplementationOnly = false;

    // Allow errors during module generation. See corresponding option in
    // FrontendOptions.
    bool AllowModuleWithCompilerErrors = false;

    /// Enable using @_spiOnly on import decls.
    bool EnableSPIOnlyImports = false;

    /// A helper enum to represent whether or not we customized the default
    /// ASTVerifier behavior via a frontend flag. By default, we do not
    /// customize.
    ///
    /// NOTE: The default behavior is to run the ASTVerifier only when asserts
    /// are enabled. This just allows for one to customize that behavior.
    enum class ASTVerifierOverrideKind {
      NoOverride = 0,
      EnableVerifier = 1,
      DisableVerifier = 2,
    };
    ASTVerifierOverrideKind ASTVerifierOverride =
        ASTVerifierOverrideKind::NoOverride;

    /// Enables dumping rewrite systems from the requirement machine.
    bool DumpRequirementMachine = false;

    /// Enables statistics output from the requirement machine.
    bool AnalyzeRequirementMachine = false;

    /// Enables fine-grained debug output from the requirement machine.
    std::string DebugRequirementMachine;

    /// Maximum rule count for requirement machine Knuth-Bendix completion
    /// algorithm.
    unsigned RequirementMachineMaxRuleCount = 4000;

    /// Maximum term length for requirement machine Knuth-Bendix completion
    /// algorithm.
    unsigned RequirementMachineMaxRuleLength = 12;

    /// Maximum concrete type nesting depth for requirement machine property map
    /// algorithm.
    unsigned RequirementMachineMaxConcreteNesting = 30;

    /// Maximum number of attempts to make when splitting concrete equivalence
    /// classes.
    unsigned RequirementMachineMaxSplitConcreteEquivClassAttempts = 2;

    /// Enable preprocessing pass to eliminate conformance requirements
    /// on generic parameters which are made concrete. Usually you want this
    /// enabled. It can be disabled for debugging and testing.
    bool EnableRequirementMachineConcreteContraction = true;

    /// Enable the stronger minimization algorithm. Usually you want this
    /// enabled. It can be disabled for debugging and testing.
    bool EnableRequirementMachineLoopNormalization = true;

    /// Enable reuse of requirement machines for minimization. Usually you want
    /// this enabled. It can be disabled for debugging and testing.
    bool EnableRequirementMachineReuse = true;

    /// Enable experimental, more correct support for opaque result types as
    /// concrete types. This will sometimes fail to produce a convergent
    /// rewrite system.
    bool EnableRequirementMachineOpaqueArchetypes = false;

    /// Enable warnings for redundant requirements in generic signatures.
    bool WarnRedundantRequirements = false;

    /// Enables dumping type witness systems from associated type inference.
    bool DumpTypeWitnessSystems = false;

    /// Enables dumping macro expansions.
    bool DumpMacroExpansions = false;

    /// The model of concurrency to be used.
    ConcurrencyModel ActiveConcurrencyModel = ConcurrencyModel::Standard;

    bool isConcurrencyModelTaskToThread() const {
      return ActiveConcurrencyModel == ConcurrencyModel::TaskToThread;
    }

    LangOptions();

    /// Sets the target we are building for and updates platform conditions
    /// to match.
    ///
    /// \returns A pair - the first element is true if the OS was invalid.
    /// The second element is true if the Arch was invalid.
    std::pair<bool, bool> setTarget(llvm::Triple triple);

    /// Returns the minimum platform version to which code will be deployed.
    ///
    /// This is only implemented on certain OSs. If no target has been
    /// configured, returns v0.0.0.
    llvm::VersionTuple getMinPlatformVersion() const {
      if (Target.isMacOSX()) {
        llvm::VersionTuple OSVersion;
        Target.getMacOSXVersion(OSVersion);
        return OSVersion;
      } else if (Target.isiOS()) {
        return Target.getiOSVersion();
      } else if (Target.isWatchOS()) {
        return Target.getOSVersion();
      }
      return llvm::VersionTuple(/*Major=*/0, /*Minor=*/0, /*Subminor=*/0);
    }

    /// Sets an implicit platform condition.
    void addPlatformConditionValue(PlatformConditionKind Kind, StringRef Value) {
      assert(!Value.empty());
      PlatformConditionValues.emplace_back(Kind, Value.str());
    }

    /// Removes all values added with addPlatformConditionValue.
    void clearAllPlatformConditionValues() {
      PlatformConditionValues.clear();
    }

    /// Returns the value for the given platform condition or an empty string.
    StringRef getPlatformConditionValue(PlatformConditionKind Kind) const;

    /// Check whether the given platform condition matches the given value.
    bool checkPlatformCondition(PlatformConditionKind Kind, StringRef Value) const;

    /// Explicit conditional compilation flags, initialized via the '-D'
    /// compiler flag.
    void addCustomConditionalCompilationFlag(StringRef Name) {
      assert(!Name.empty());
      CustomConditionalCompilationFlags.push_back(Name.str());
    }

    /// Determines if a given conditional compilation flag has been set.
    bool isCustomConditionalCompilationFlagSet(StringRef Name) const;

    ArrayRef<std::pair<PlatformConditionKind, std::string>>
    getPlatformConditionValues() const {
      return PlatformConditionValues;
    }

    ArrayRef<std::string> getCustomConditionalCompilationFlags() const {
      return CustomConditionalCompilationFlags;
    }

    /// Whether our effective Swift version is at least 'major'.
    ///
    /// This is usually the check you want; for example, when introducing
    /// a new language feature which is only visible in Swift 5, you would
    /// check for isSwiftVersionAtLeast(5).
    bool isSwiftVersionAtLeast(unsigned major, unsigned minor = 0) const {
      return EffectiveLanguageVersion.isVersionAtLeast(major, minor);
    }

    /// Determine whether the given feature is enabled.
    bool hasFeature(Feature feature) const;

    /// Determine whether the given feature is enabled, looking up the feature
    /// by name.
    bool hasFeature(llvm::StringRef featureName) const;

    /// Returns true if the given platform condition argument represents
    /// a supported target operating system.
    ///
    /// \param suggestedKind Populated with suggested replacement platform condition
    /// \param suggestedValues Populated with suggested replacement values
    /// if a match is not found, or if the value has been deprecated
    /// in favor of a newer one.
    static bool checkPlatformConditionSupported(
      PlatformConditionKind Kind, StringRef Value,
      PlatformConditionKind &suggestedKind,
      std::vector<StringRef> &suggestedValues);

    /// Return a hash code of any components from these options that should
    /// contribute to a Swift Bridging PCH hash.
    llvm::hash_code getPCHHashComponents() const {
      SmallString<16> Scratch;
      llvm::raw_svector_ostream OS(Scratch);
      OS << EffectiveLanguageVersion;
      return llvm::hash_combine(Target.str(), OS.str());
    }

  private:
    llvm::SmallVector<std::pair<PlatformConditionKind, std::string>, 6>
        PlatformConditionValues;
    llvm::SmallVector<std::string, 2> CustomConditionalCompilationFlags;
  };

  class TypeCheckerOptions final {
  public:
    /// If non-zero, warn when a function body takes longer than this many
    /// milliseconds to type-check.
    ///
    /// Intended for debugging purposes only.
    unsigned WarnLongFunctionBodies = 0;

    /// If non-zero, warn when type-checking an expression takes longer
    /// than this many milliseconds.
    ///
    /// Intended for debugging purposes only.
    unsigned WarnLongExpressionTypeChecking = 0;

    /// If non-zero, abort the expression type checker if it takes more
    /// than this many seconds.
    unsigned ExpressionTimeoutThreshold = 600;

    /// If non-zero, abort the switch statement exhaustiveness checker if
    /// the Space::minus function is called more than this many times.
    ///
    /// Why this number? Times out in about a second on a 2017 iMac, Retina 5K,
    /// 4.2 GHz Intel Core i7.
    /// (It's arbitrary, but will keep the compiler from taking too much time.)
    unsigned SwitchCheckingInvocationThreshold = 200000;

    /// If true, the time it takes to type-check each function will be dumped
    /// to llvm::errs().
    bool DebugTimeFunctionBodies = false;

    /// If true, the time it takes to type-check each expression will be
    /// dumped to llvm::errs().
    bool DebugTimeExpressions = false;

    /// Controls the function bodies to skip during type-checking.
    FunctionBodySkipping SkipFunctionBodies = FunctionBodySkipping::None;

    ///
    /// Flags for developers
    ///

    /// Debug the generic signatures computed by the generic signature builder.
    bool DebugGenericSignatures = false;

    /// Whether we are debugging the constraint solver.
    ///
    /// This option enables verbose debugging output from the constraint
    /// solver.
    bool DebugConstraintSolver = false;

    /// Specific solution attempt for which the constraint
    /// solver should be debugged.
    unsigned DebugConstraintSolverAttempt = 0;

    /// Line numbers to activate the constraint solver debugger.
    /// Should be stored sorted.
    llvm::SmallVector<unsigned, 4> DebugConstraintSolverOnLines;

    /// Triggers llvm fatal_error if typechecker tries to typecheck a decl or an
    /// identifier reference with the provided prefix name.
    /// This is for testing purposes.
    std::string DebugForbidTypecheckPrefix;

    /// The upper bound, in bytes, of temporary data that can be
    /// allocated by the constraint solver.
    unsigned SolverMemoryThreshold = 512 * 1024 * 1024;

    unsigned SolverBindingThreshold = 1024 * 1024;

    /// The upper bound to number of sub-expressions unsolved
    /// before termination of the shrink phrase of the constraint solver.
    unsigned SolverShrinkUnsolvedThreshold = 10;

    /// Disable the shrink phase of the expression type checker.
    bool SolverDisableShrink = false;

    /// Enable experimental operator designated types feature.
    bool EnableOperatorDesignatedTypes = false;

    /// Disable constraint system performance hacks.
    bool DisableConstraintSolverPerformanceHacks = false;

    /// See \ref FrontendOptions.PrintFullConvention
    bool PrintFullConvention = false;
  };

  /// Options for controlling the behavior of the Clang importer.
  class ClangImporterOptions final {
  public:
    /// The path to the Clang compiler executable.
    /// Used to detect the default include paths.
    std::string clangPath = "clang";

    /// The module cache path which the Clang importer should use.
    std::string ModuleCachePath;

    /// Extra arguments which should be passed to the Clang importer.
    std::vector<std::string> ExtraArgs;

    /// A directory for overriding Clang's resource directory.
    std::string OverrideResourceDir;

    /// The target CPU to compile for.
    ///
    /// Equivalent to Clang's -mcpu=.
    std::string TargetCPU;

    /// The path to which we should store indexing data, if any.
    std::string IndexStorePath;

    /// The bridging header or PCH that will be imported.
    std::string BridgingHeader;

    /// When automatically generating a precompiled header from the bridging
    /// header, place it in this directory.
    std::string PrecompiledHeaderOutputDir;

    /// The optimization setting.  This doesn't typically matter for
    /// import, but it can affect Clang's IR generation of static functions.
    std::string Optimization;

    /// Disable validating the persistent PCH.
    bool PCHDisableValidation = false;

    /// \see Mode
    enum class Modes : uint8_t {
      /// Set up Clang for importing modules into Swift and generating IR from
      /// Swift code.
      Normal,
      /// Set up Clang for backend compilation only.
      EmbedBitcode,
      /// Set up Clang to emit a precompiled module from a C/Objective-C module
      /// map or dump debugging info about a precompiled module.
      PrecompiledModule
    };

    /// Controls how Clang is initially set up.
    Modes Mode = Modes::Normal;

    /// When set, preserves more information during import.
    ///
    /// Also \em disables some information that is only needed for object file
    /// generation.
    bool DetailedPreprocessingRecord = false;

    /// If true, Clang diagnostics will be dumped to stderr using Clang's
    /// diagnostic printer as well as being passed to Swift's diagnostic engine.
    bool DumpClangDiagnostics = false;

    /// If true, forward declarations will be imported using unavailable types
    /// instead of dropped altogether when possible.
    bool ImportForwardDeclarations = false;

    /// If true ignore the swift bridged attribute.
    bool DisableSwiftBridgeAttr = false;

    /// When set, don't look for or load overlays.
    bool DisableOverlayModules = false;

    /// When set, import SPI_AVAILABLE symbols with Swift SPI attributes.
    bool EnableClangSPI = true;

    /// When set, don't enforce warnings with -Werror.
    bool DebuggerSupport = false;

    /// When set, ClangImporter is disabled, and all requests go to the
    /// DWARFImporter delegate.
    bool DisableSourceImport = false;

    /// When set, use ExtraArgs alone to configure clang instance because ExtraArgs
    /// contains the full option set.
    bool ExtraArgsOnly = false;

    /// When building a PCM, rely on the Swift frontend's command-line -Xcc flags
    /// to build the Clang module via Clang frontend directly,
    /// and completly bypass the Clang driver.
    bool DirectClangCC1ModuleBuild = false;

    /// Return a hash code of any components from these options that should
    /// contribute to a Swift Bridging PCH hash.
    llvm::hash_code getPCHHashComponents() const {
      using llvm::hash_combine;
      using llvm::hash_combine_range;

      return hash_combine(ModuleCachePath,
                          hash_combine_range(ExtraArgs.begin(), ExtraArgs.end()),
                          OverrideResourceDir,
                          TargetCPU,
                          BridgingHeader,
                          PrecompiledHeaderOutputDir,
                          static_cast<uint8_t>(Mode),
                          DetailedPreprocessingRecord,
                          ImportForwardDeclarations,
                          DisableSwiftBridgeAttr,
                          DisableOverlayModules,
                          EnableClangSPI);
    }

    std::vector<std::string> getRemappedExtraArgs(
        std::function<std::string(StringRef)> pathRemapCallback) const;
  };

} // end namespace swift

#endif // SWIFT_BASIC_LANGOPTIONS_H


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.greensopinion</groupId>
        <artifactId>wikitext.examples</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <artifactId>wikitext.maven-with-ant-example</artifactId>
    <name>Mylyn WikiText Maven With Ant Example</name>
    <packaging>pom</packaging>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.0.2</version>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/</directory>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <configuration>
                        <target>
                            <taskdef resource="org/eclipse/mylyn/wikitext/ant/tasks.properties"/>

                            <wikitext-to-html markupLanguage="Markdown" formatOutput="true">
                                <fileset dir="${project.build.directory}" includes="**/*.md"/>
                                <stylesheet url="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
                            </wikitext-to-html>
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.eclipse.mylyn.docs</groupId>
                    <artifactId>org.eclipse.mylyn.wikitext</artifactId>
                    <version>${wikitext.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.mylyn.docs</groupId>
                    <artifactId>org.eclipse.mylyn.wikitext.ant</artifactId>
                    <version>${wikitext.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.mylyn.docs</groupId>
                    <artifactId>org.eclipse.mylyn.wikitext.markdown</artifactId>
                    <version>${wikitext.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                    <version>${guava.version}</version>
                </dependency>
            </dependencies>
        </plugin>
        </plugins>
    </build>
</project>


text:
DECL_NAMESPACE_MZ_NET_BEGIN

class TransmitSocket;

class ComConnecter {
    MZ_DISALLOW_COPY_AND_ASSIGN(ComConnecter)

    enum Stage {
        STAGE_NONE = 0,
        STAGE_WAITING,
        STAGE_CONNECTING,
        STAGE_CONNECTED,
        STAGE_CLOSED,
    };

    using ConnectFailedCallback_t = std::function<void()>;

private:
    TransmitSocket& m_socket;

    int m_stage{ STAGE_NONE };
    int64_t m_connectTime{ 0 };
    int m_reconnectInterval{ 0 };
    SockId_t m_tempSockId{ INVALID_SOCKID };

    ConnectFailedCallback_t m_connectFaildCallback;

public:
    ComConnecter(TransmitSocket& socket);

    ~ComConnecter();

    void Reset();

    void Tick(int64_t now, int interval);

    bool Connect();

    int GetReconnectInterval() const;

    void SetReconnectInterval(int milliseconds);

    void SetConnectFailedCallback(ConnectFailedCallback_t callback);

private:
    void ConnectStage();

    void ConnectStageWaiting();

    void ConnectStageConnecting();

    void ConnectStageConnected();

    void ConnectStageClosed();

    void Reconnect(int milliseconds);

    int TryToConnect();

    int CheckConnected();

    void ResetConnectTime(int milliseconds);

    bool IsStage(int stage) const;

    void SetStage(int stage);

    void AttachTempSockId(const SockId_t& sockId);

    void DetachTempSockId();
};

inline int ComConnecter::GetReconnectInterval() const {
    return m_reconnectInterval;
}

inline void ComConnecter::SetReconnectInterval(int milliseconds) {
    m_reconnectInterval = milliseconds;
}

inline void ComConnecter::SetConnectFailedCallback(ConnectFailedCallback_t callback) {
    m_connectFaildCallback = callback;
}

inline bool ComConnecter::IsStage(int stage) const {
    return m_stage == stage;
}

inline void ComConnecter::SetStage(int stage) {
    m_stage = stage;
}

inline void ComConnecter::AttachTempSockId(const SockId_t& sockId) {
    m_tempSockId = sockId;
}

inline void ComConnecter::DetachTempSockId() {
    if (m_tempSockId != INVALID_SOCKID) {
        DestroySockId(m_tempSockId);
        m_tempSockId = INVALID_SOCKID;
    }
}

DECL_NAMESPACE_MZ_NET_END

#endif // _MZ_NET_COMCONNECTER_HPP_


text:
module Rack
  class MogileFS
    class Endpoint

      # Provides a default client if one is not passed in a a param. It is
      # recommended to use the default client if you can
      module Client
        def initialize(*)
          super
          @options[:client] ||= lambda { default_client }
        end

        def default_client
          ::MogileFS::MogileFS.new(config)
        end

        # If `Rack::MogileFS` detects it is inside a Rails app, it will look
        # for a yaml config in `config/mogilefs.yml` that looks like this:
        #
        #     development:
        #       connection:
        #         domain: "development.myapp.com"
        #         hosts:
        #           - 127.0.0.1:7001
        #           - 127.0.0.1:7001
        #       class: "file"
        #     staging:
        #       ...
        def config
          if defined?(Rails)
            yml = YAML.load_file( Rails.root.join("config/mogilefs.yml") )
            yml[Rails.env]["connection"].symbolize_keys
          else
            { :domain => "default", :hosts => ["127.0.0.1:7001"] }
          end
        end
      end

    end
  end
end


text:
#include "box2DItem.h"

#include "src/engine/model/physics/box2DPhysicsEngine.h"
#include "src/engine/items/solidItem.h"

using namespace twoDModel::model::physics;
using namespace twoDModel::items;
using namespace parts;

Box2DItem::Box2DItem(twoDModel::model::physics::Box2DPhysicsEngine *engine
		, const SolidItem &item, const b2Vec2 &pos, float angle)
	: mIsCircle(false)
	, mEngine(*engine)
{
	b2BodyDef bodyDef;
	bodyDef.position = pos;
	bodyDef.angle = angle;
	if (item.bodyType() == SolidItem::DYNAMIC) {
		bodyDef.type = b2_dynamicBody;
	} else if (item.bodyType() == SolidItem::KINEMATIC) {
		bodyDef.type = b2_kinematicBody;
	} else if (item.bodyType() == SolidItem::STATIC) {
		bodyDef.type = b2_staticBody;
	}

	mBody = this->mEngine.box2DWorld().CreateBody(&bodyDef);
	mBody->SetAngularDamping(item.angularDamping());
	mBody->SetLinearDamping(item.linearDamping());

	b2FixtureDef fixture;
	fixture.restitution = 0.8;
	QPolygonF collidingPolygon = item.collidingPolygon();
	QPointF localCenter = collidingPolygon.boundingRect().center();
	b2CircleShape circleShape;
	b2PolygonShape polygonShape;
	if (item.isCircle()) {
		mIsCircle = true;
		qreal radius = collidingPolygon.boundingRect().height() / 2;
		circleShape.m_radius = this->mEngine.pxToM(radius);
		fixture.shape = &circleShape;
		fixture.density = engine->computeDensity(radius, item.mass());
	} else {
		if (collidingPolygon.isClosed()) {
			collidingPolygon.removeLast();
		}

		mPolygon = new b2Vec2[collidingPolygon.size()];
		for (int i = 0; i < collidingPolygon.size(); ++i) {
			mPolygon[i] = engine->positionToBox2D(collidingPolygon.at(i) - localCenter);
		}

		polygonShape.Set(mPolygon, collidingPolygon.size());
		fixture.shape = &polygonShape;
		fixture.density = engine->computeDensity(collidingPolygon, item.mass());
	}

	fixture.friction = item.friction();
	mBody->CreateFixture(&fixture);
	mBody->SetUserData(this);
}

Box2DItem::~Box2DItem()
{
	mBody->GetWorld()->DestroyBody(mBody);
	if (!mIsCircle) {
		delete[] mPolygon;
	}
}

void Box2DItem::moveToPosition(const b2Vec2 &pos)
{
	mBody->SetTransform(pos, mBody->GetAngle());
	mPreviousPosition = mBody->GetPosition();
}

void Box2DItem::setRotation(float angle)
{
	mBody->SetTransform(mBody->GetPosition(), angle);
	mPreviousRotation = mBody->GetAngle();
}

const b2Vec2 &Box2DItem::getPosition()
{
	mPreviousPosition = mBody->GetPosition();
	return mPreviousPosition;
}

float Box2DItem::getRotation()
{
	mPreviousRotation = mBody->GetAngle();
	return mPreviousRotation;
}

b2Body *Box2DItem::getBody() const
{
	return mBody;
}

bool Box2DItem::angleOrPositionChanged() const
{
	return b2Distance(mPreviousPosition, mBody->GetPosition()) > b2_epsilon
			|| qAbs(mPreviousRotation - mBody->GetAngle()) > b2_epsilon;
}


text:
package dak.ant.taskdefs;

import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.Normalizer;
import java.text.SimpleDateFormat;
import java.util.*;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.taskdefs.MatchingTask;
import org.jets3t.service.Constants;
import org.jets3t.service.acl.AccessControlList;
import org.jets3t.service.impl.rest.httpclient.RestS3Service;
import org.jets3t.service.model.S3Bucket;
import org.jets3t.service.model.S3Object;
import org.jets3t.service.utils.ServiceUtils;

/** This class provides basic S3 actions as an Ant task.
  *
  * @author D. Kavanagh
  */
public abstract class AWSTask extends MatchingTask {
       // CONSTANTS

       protected static final String DUMMY_RUN = "<DUMMY RUN>";

       private static final long MAX_AGE = 3 * 60 * 60 * 24 * 30L;

       @SuppressWarnings("serial")
       private static final DateFormat DF = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z")
                                                {{ setTimeZone(TimeZone.getTimeZone("GMT"));
                                                }};

       // INSTANCE VARIABLES

       protected boolean verbose     = false;
       protected boolean failOnError = false;
       protected String  accessId;
       protected String  secretKey;

       // CLASS METHODS

       /** Returns true if an S3Object is most probably a directory i.e. either isDirectoryPlaceHolder
         * is set and the content length is zero or the contentType is "application/x-directory".
         */
       public static boolean isDirectory(S3Object object) {
              // ... directory ?

              if (object.isMetadataComplete() && (object.getContentLength() == 0) && object.isDirectoryPlaceholder()) {
                 return true;
              }

              if ("application/x-directory".equals(object.getContentType())) {
                 return true;
              }

              // ... probably a directory ?
              //
              // if (!object.isMetadataComplete() && (object.getContentLength() == 0) && !object.isDirectoryPlaceholder()) {
              //   return true;
              // }

              return false;
       }

       /** Normalises a Unicode string.
         *
         * Ref. http://stackoverflow.com/questions/3610013
         *
         */
       protected static String normalize(String string) {
                 Normalizer.Form form = Normalizer.Form.NFD;

                 return Normalizer.isNormalized(string, form) ? string : Normalizer.normalize(string, form);
       }

       /** Gracefully closes an I/O stream.
         *
         */
       protected static void close(Closeable stream) {
                 try { if (stream != null)
                          stream.close();
                 } catch (Throwable x) {
                 }
       }

       // PROPERTIES

       /** Sets required task AWS access ID attribute.
         *
         */
       public void setAccessId(String accessId) {
              this.accessId = accessId;
       }

       /** Sets required task AWS secret key attribute.
         *
         */
       public void setSecretKey(String secretKey) {
              this.secretKey = secretKey;
       }

       /** Task attribute to enable/disable verbose logging.
         *
         */
       public void setVerbose(boolean verbose) {
              this.verbose = verbose;
       }

       /** Task attribute to enable/disable failing on error. If false a task
         * will log a warning and attempt to continue uploading/downloading the remaining
         * files.
         *
         */
       public void setFailOnError(boolean failOnError) {
              this.failOnError = failOnError;
       }

       // IMPLEMENTATION

       /** Check that the AWS credentials have been set.
         *
         * @since Ant 1.5
         * @exception BuildException if an error occurs
         */
       protected void checkParameters() throws BuildException {
                 if (accessId == null)
                    throw new BuildException("accessId must be set");

                 if (secretKey == null)
                    throw new BuildException("secretKey must be set");
       }

       private Set<String> splitFilePathIntoDirPaths(String path, boolean isDirectoryPlaceholder) {
                 Set<String> dirPathsSet = new HashSet<String>();
                 String[] pathComponents = path.split(Constants.FILE_PATH_DELIM);
                 String myPath = "";
                 for (int i = 0; i < pathComponents.length; i++) {
                    String pathComponent = pathComponents[i];
                    myPath = myPath + pathComponent;
                    if (i < pathComponents.length - 1 || isDirectoryPlaceholder) {
                        myPath += Constants.FILE_PATH_DELIM;
                    }
                    dirPathsSet.add(myPath);
                 }
                 return dirPathsSet;
        }

       /** Replaces jets3t FileComparer buildFileMap to accommodate Ant filesets.
         *
         * @param root Root directory to synchronise.
         * @param files List of files to synchronize.
         * @throws IOException Thrown if the file system fails on File.getCanonicalPath.
         */
       protected Map<String,File> buildFileMap(File root,File[] files,String prefix) throws IOException {
                 Map<String,File> fileMap = new HashMap<String, File>();
                 String          _root    = normalize(root.getCanonicalPath());

                 for (File file: files) {
                     if (file.exists()) {
                        String filepath = normalize(file.getCanonicalPath()).replaceAll("\\\\", "/");

                        if (file.isDirectory()) {
                           filepath += File.separator;
                        }

                        if (filepath.startsWith(_root)) {
                           if (prefix == null)
                              fileMap.put(filepath.substring(_root.length() + 1),file);
                           else
                               fileMap.put(prefix + filepath.substring(_root.length() + 1),file);
                        }
                        else {
                            if (prefix == null)
                                fileMap.put(filepath, file);
                            else
                                fileMap.put(prefix + filepath, file);
                        }
                     }
                 }

                 if (prefix != null) {
                     for (String localPath: splitFilePathIntoDirPaths(prefix, true)) {
                        File placeholderFile = new File("./");
                        fileMap.put(localPath, placeholderFile);
                     }
                 }

                 return fileMap;
       }

       /** Alternative implementation of buildFileMap that accepts a list of strings instead of filenames.
         *
         * @param root  Root directory to synchronise.
         * @param files List of files to synchronize.
         *
         * @throws IOException Thrown if the file system fails on File.getCanonicalPath.
         */
       protected Map<String,File> buildFileMap(File root,String[] files,String prefix) throws IOException  {
                 File[] list = new File[files.length];
                 int    ix   = 0;

                 for (String string: files) {
                     list[ix++] = new File(root, string);
                 }

                 return buildFileMap(root,list,prefix);
       }

       /** Uploads a file to an S3 bucket, setting the ACL to the same as the bucket ACL.
         *
         * @param s3          Initialised S3Service.
         * @param bucket      Initialised S3Bucket.
         * @param key         S3 object key for uploaded file.
         * @param file        Local file to upload.
         * @param contentType MIME type for content.
         *
         * @throws Exception Thrown if the file upload fails for any reason.
         */
       protected void upload(RestS3Service s3,S3Bucket bucket,AccessControlList acl,boolean cacheNeverExpires,String key,File file,String contentType) throws Exception {
                 S3Object object = new S3Object(bucket,key);

                 if (acl != null) {
                    object.setAcl(acl);
                 }

                 if (cacheNeverExpires) {
                    object.addMetadata("Cache-Control", "public, max-age=" + MAX_AGE);
                 }

                 String fileName = file.getName();
                 if (fileName.lastIndexOf(".gz.") != -1) {
                     // This is a gizped file, so set the content encoding
                     object.addMetadata("Content-Encoding", "gzip");
                 }

                 object.addMetadata     (Constants.METADATA_JETS3T_LOCAL_FILE_DATE,ServiceUtils.formatIso8601Date(new Date(file.lastModified())));
                 object.setContentLength(file.length());
                 object.setContentType  (contentType);

                 if (file.isFile() && file.exists()) {
                    object.setDataInputFile(file);
                    s3.putObject(bucket, object);
                 }
       }

}


text:
import * as actions from "./actions";
import * as actionTypes from "./actionTypes";
import * as middlewares from "./middlewares";
import * as reducers from "./reducers";
import * as components from "./components";
import * as providers from "./providers";
import * as themes from "./themes";
import * as epics from "./epics";
import * as selectors from "./selectors";

// keeping with backwards compatiblity for now
const constants = actionTypes;

export {
  actions,
  actionTypes,
  constants,
  middlewares,
  reducers,
  components,
  providers,
  themes,
  selectors,
  epics
};


text:
#ifndef SIDECAR_MESSAGES_BUGPLOT_H // -*- C++ -*-
#define SIDECAR_MESSAGES_BUGPLOT_H

#include "boost/shared_ptr.hpp"

#include "IO/Printable.h"
#include "Messages/Attributes.h"
#include "Messages/Header.h"

namespace Logger {
class Log;
}

namespace SideCar {
namespace Messages {

class BugPlot : public Header, public IO::CDRStreamable<BugPlot>, public IO::Printable<BugPlot> {
public:
    using Ref = boost::shared_ptr<BugPlot>;

    static Logger::Log& Log();

    /** Obtain the message type information for RawVideo objects.

        \return MetaTypeInfo reference
    */
    static const MetaTypeInfo& GetMetaTypeInfo();

    static Ref Make(const std::string& producer, double when, double range, double azimuth, double elevation,
                    const std::string& tag);

    static Ref Make(const QDomElement& header, const QDomElement& msg);

    /** Class factory that creates new reference-counted BugPlot message objects using data from an input CDR
        stream.

        \param cdr input CDR stream to read from

        \return reference to new RawVideo object
    */
    static Ref Make(ACE_InputCDR& cdr);

    /** Destructor.
     */
    ~BugPlot() {}

    /** Read in a BugPlot message from an CDR input stream. Override of Header::load().

        \param cdr stream to read from

        \return stream read from
    */
    ACE_InputCDR& load(ACE_InputCDR& cdr);

    /** Write out a BugPlot message to a CDR output stream. Override of Header::write().

        \param cdr stream to write to

        \return stream written to
    */
    ACE_OutputCDR& write(ACE_OutputCDR& cdr) const;

    /** Print out a textual representation of the BugPlot message. Override of Header::print().

        \param os C++ text stream to write to

        \return stream written to
    */
    std::ostream& printData(std::ostream& os) const;

    /** Print out a XML representation of the BugPlot message. Override of Header::printDataXML().

        \param os C++ text stream to write to

        \return stream written to
    */
    std::ostream& printDataXML(std::ostream& os) const;

    double getWhen() const { return when_; }

    double getRange() const { return range_; }

    double getAzimuth() const { return azimuth_; }

    double getElevation() const { return elevation_; }

    const std::string& getTag() const { return tag_; }

    size_t getSize() const { return sizeof(BugPlot); }

private:
    /** Constructor for new BugPlot message.

        \param producer name of the entity that created the message

        \param raw data block containing raw VME data.
    */
    BugPlot(const std::string& producer, ACE_Message_Block* raw);

    BugPlot(const std::string& producer);

    BugPlot(const std::string& producer, double when, double range, double azimuth, double elevation,
            const std::string& tag);

    /** Constructor for BugPlot messages that will be filled in with data from a CDR stream.
     */
    BugPlot();

    void loadXML(XmlStreamReader& xsr);

    double when_;
    double range_;
    double azimuth_;
    double elevation_;
    std::string tag_;
    Attributes attributes_;

    static Header::Ref CDRLoader(ACE_InputCDR& cdr);

    static Header::Ref XMLLoader(const std::string& producer, XmlStreamReader& xsr);

    static MetaTypeInfo metaTypeInfo_;
};

} // end namespace Messages
} // end namespace SideCar

#endif


text:
package org.keycloak.testsuite.console.realm;

import java.util.HashSet;
import java.util.Set;
import org.jboss.arquillian.graphene.page.Page;
import org.junit.Assert;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import static org.keycloak.representations.idm.CredentialRepresentation.PASSWORD;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.representations.idm.UserRepresentation;
import static org.keycloak.testsuite.admin.ApiUtil.createUserAndResetPasswordWithAdminClient;
import static org.keycloak.testsuite.admin.Users.setPasswordFor;
import static org.keycloak.testsuite.auth.page.AuthRealm.TEST;
import org.keycloak.testsuite.auth.page.account.Account;
import org.keycloak.testsuite.console.page.realm.LoginSettings;
import org.keycloak.testsuite.auth.page.login.Registration;
import org.keycloak.testsuite.auth.page.login.ResetCredentials;
import org.keycloak.testsuite.auth.page.login.VerifyEmail;
import org.keycloak.testsuite.console.page.realm.LoginSettings.RequireSSLOption;
import org.keycloak.testsuite.util.MailServer;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith;

import org.openqa.selenium.Cookie;

/**
 *
 * @author tkyjovsk
 */
public class LoginSettingsTest extends AbstractRealmTest {

    private static final String NEW_USERNAME = "newUsername";

    @Page
    private LoginSettings loginSettingsPage;
    @Page
    private Registration testRealmRegistrationPage;
    @Page
    private ResetCredentials testRealmForgottenPasswordPage;
    @Page
    private VerifyEmail testRealmVerifyEmailPage;
    @Page
    private Account testAccountPage;

    @Override
    public void setDefaultPageUriParameters() {
        super.setDefaultPageUriParameters();
        testRealmRegistrationPage.setAuthRealm(TEST);
        testRealmForgottenPasswordPage.setAuthRealm(TEST);
        testRealmVerifyEmailPage.setAuthRealm(TEST);
        testAccountPage.setAuthRealm(TEST);
    }

    @Before
    public void beforeLoginSettingsTest() {
//        tabs().login();
        loginSettingsPage.navigateTo();
    }

    @Test
    public void userRegistration() {

        log.info("enabling registration");
        loginSettingsPage.form().setRegistrationAllowed(true);
        assertTrue(loginSettingsPage.form().isRegistrationAllowed());
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("enabled");

        testRealmAdminConsolePage.navigateTo();
        testRealmLoginPage.form().register();
        assertCurrentUrlStartsWith(testRealmRegistrationPage);
        testRealmRegistrationPage.waitForConfirmPasswordInputPresent();
        testRealmRegistrationPage.waitForUsernameInputPresent();
        log.info("verified registration is enabled");

        // test email as username
        log.info("enabling email as username");
        loginSettingsPage.navigateTo();
        loginSettingsPage.form().setEmailAsUsername(true);
        assertTrue(loginSettingsPage.form().isEmailAsUsername());
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("enabled");

        testRealmAdminConsolePage.navigateTo();
        testRealmLoginPage.form().register();
        assertCurrentUrlStartsWith(testRealmRegistrationPage);
        testRealmRegistrationPage.waitForConfirmPasswordInputPresent();
        testRealmRegistrationPage.waitForUsernameInputNotPresent();
        log.info("verified email as username");

        // test user reg. disabled
        log.info("disabling registration");
        loginSettingsPage.navigateTo();
        loginSettingsPage.form().setRegistrationAllowed(false);
        assertFalse(loginSettingsPage.form().isRegistrationAllowed());
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("disabled");

        testRealmAdminConsolePage.navigateTo();
        testRealmLoginPage.form().waitForRegisterLinkNotPresent();
        log.info("verified regisration is disabled");
    }

    @Test
    public void editUsername() {
        log.info("enabling edit username");
        loginSettingsPage.form().setEditUsernameAllowed(true);
        assertTrue(loginSettingsPage.form().isEditUsernameAllowed());
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("enabled");

        log.info("edit username");
        testAccountPage.navigateTo();
        testRealmLoginPage.form().login(testUser);
        testAccountPage.waitForAccountLinkPresent();
        testAccountPage.setUsername(NEW_USERNAME);
        testAccountPage.save();
        testAccountPage.signOut();
        log.debug("edited");

        log.info("log in with edited username");
        testRealmLoginPage.form().login(NEW_USERNAME, PASSWORD);
        testAccountPage.waitForAccountLinkPresent();
        log.debug("user is logged in with edited username");

        log.info("disabling edit username");
        loginSettingsPage.navigateTo();
        loginSettingsPage.form().setEditUsernameAllowed(false);
        assertFalse(loginSettingsPage.form().isEditUsernameAllowed());
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("disabled");

    }

    @Test
    public void resetPassword() {

        log.info("enabling reset password");
        loginSettingsPage.form().setResetPasswordAllowed(true);
        assertTrue(loginSettingsPage.form().isResetPasswordAllowed());
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("enabled");

        testRealmAdminConsolePage.navigateTo();
        testRealmLoginPage.form().forgotPassword();

        Assert.assertEquals("Enter your username or email address and we will send you instructions on how to create a new password.",
                testRealmForgottenPasswordPage.getInfoMessage());
        log.info("verified reset password is enabled");

        log.info("disabling reset password");
        loginSettingsPage.navigateTo();
        loginSettingsPage.form().setResetPasswordAllowed(false);
        assertFalse(loginSettingsPage.form().isResetPasswordAllowed());
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("disabled");

        testRealmAdminConsolePage.navigateTo();
        testRealmLoginPage.form().waitForResetPasswordLinkNotPresent();
        log.info("verified reset password is disabled");
    }

    @Test
    public void rememberMe() {

        log.info("enabling remember me");
        loginSettingsPage.form().setRememberMeAllowed(true);
        assertTrue(loginSettingsPage.form().isRememberMeAllowed());
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("enabled");

        log.info("login with remember me checked");
        testAccountPage.navigateTo();
        testRealmLoginPage.form().rememberMe(true);
        testRealmLoginPage.form().login(testUser);

        assertTrue("Cookie KEYCLOAK_REMEMBER_ME should be present.", getCookieNames().contains("KEYCLOAK_REMEMBER_ME"));

        log.info("verified remember me is enabled");

        log.info("disabling remember me");
        loginSettingsPage.navigateTo();
        loginSettingsPage.form().setRememberMeAllowed(false);
        assertFalse(loginSettingsPage.form().isRememberMeAllowed());
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("disabled");

        testAccountPage.navigateTo();
        testAccountPage.signOut();
        testRealmLoginPage.form().waitForLoginButtonPresent();
        testRealmLoginPage.form().waitForRememberMeNotPresent();
        log.info("verified remember me is disabled");

    }

    @Test
    public void verifyEmail() {

        MailServer.start();
        MailServer.createEmailAccount(testUser.getEmail(), "password");

        log.info("enabling verify email in login settings");
        loginSettingsPage.form().setVerifyEmailAllowed(true);
        assertTrue(loginSettingsPage.form().isVerifyEmailAllowed());
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("enabled");

        log.info("configure smtp server in test realm");
        RealmRepresentation testRealmRep = testRealmResource().toRepresentation();
        testRealmRep.setSmtpServer(suiteContext.getSmtpServer());
        testRealmResource().update(testRealmRep);

        testAccountPage.navigateTo();
        testRealmLoginPage.form().login(testUser);
        Assert.assertEquals("An email with instructions to verify your email address has been sent to you.",
                testRealmVerifyEmailPage.getInstructionMessage());

        log.info("verified verify email is enabled");

        log.info("disabling verify email");
        loginSettingsPage.navigateTo();
        loginSettingsPage.form().setVerifyEmailAllowed(false);
        assertFalse(loginSettingsPage.form().isVerifyEmailAllowed());
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("disabled");

        log.debug("create new test user");
        UserRepresentation newUser = createUserRepresentation("new_user", "new_user@email.test", "new", "user", true);
        setPasswordFor(newUser, PASSWORD);
        String id = createUserAndResetPasswordWithAdminClient(testRealmResource(), newUser, PASSWORD);
        newUser.setId(id);

        log.info("log in as new user");
        testAccountPage.navigateTo();
        testRealmLoginPage.form().login(newUser);
        testAccountPage.waitForAccountLinkPresent();

        log.info("verified verify email is disabled");

        MailServer.stop();
    }

    @Test
    public void requireSSLAllRequests() throws InterruptedException {
        log.info("set require ssl for all requests");
        loginSettingsPage.form().selectRequireSSL(RequireSSLOption.all);
        loginSettingsPage.form().save();
        assertAlertSuccess();
        log.debug("set");

        log.info("check HTTPS required");
        testAccountPage.navigateTo();
        Assert.assertEquals("HTTPS required", testAccountPage.getErrorMessage());
    }

    private Set<String> getCookieNames() {
        Set<Cookie> cookies = driver.manage().getCookies();
        Set<String> cookieNames = new HashSet<>();
        for (Cookie cookie : cookies) {
            cookieNames.add(cookie.getName());
        }
        return cookieNames;
    }
}


text:
export CATKIN_TEST_RESULTS_DIR="/home/chonhyon/hydro_workspace/itomp/kuka_description/test_results"
export ROS_TEST_RESULTS_DIR="$CATKIN_TEST_RESULTS_DIR"


text:
$myStr='K:\选择删除'
Set-ExecutionPolicy Unrestricted
get-childitem $myStr -include "最新地址获取.txt" -recurse |remove-item

get-childitem $myStr -include "*uu*.mp4" -recurse |remove-item

get-childitem $myStr -include "____*" -recurse |remove-item
get-childitem $myStr -include "*.mht" -recurse |remove-item
get-childitem $myStr -include "*.url" -recurse |remove-item
get-childitem $myStr -include "*.URL" -recurse |remove-item
get-childitem $myStr -include "*.gif" -recurse |remove-item
get-childitem $myStr -include "*.htm" -recurse |remove-item

get-childitem $myStr -include "更多福利都在這邊先搶先贏" -recurse |remove-item -recurse
get-childitem $myStr -include ".dnd_az!" -recurse |remove-item -recurse
get-childitem $myStr -include "論壇文宣" -recurse |remove-item -recurse
get-childitem $myStr -include "本日新片" -recurse |remove-item -recurse
get-childitem $myStr -include "更刺激的裸聊*" -recurse |remove-item -recurse
get-childitem $myStr -include "Sex8.cc宣传" -recurse |remove-item -recurse
get-childitem $myStr -include "合作宣传" -recurse |remove-item -recurse
get-childitem $myStr -include "色人党宣传文本" -recurse |remove-item -recurse
get-childitem $myStr -include "板扎福利网·更多极品,你懂得" -recurse |remove-item -recurse
get-childitem $myStr -include "Sample" -recurse |remove-item -recurse
get-childitem $myStr -include "宣傳文檔" -recurse |remove-item -recurse

get-childitem $myStr -include "神级女优-高清无码流出 免费下载_files" -recurse |remove-item -recurse
get-childitem $myStr -include "*无码流出合集.rar" -recurse |remove-item
get-childitem $myStr -include "第一会所宣传图.jpg" -recurse |remove-item

get-childitem $myStr -include "*.torrent" -recurse |remove-item
get-childitem $myStr -include "谜歼种子包.rar" -recurse |remove-item
get-childitem $myStr -include "萝莉种子包.rar" -recurse |remove-item
get-childitem $myStr -include "另类剧情种子合集.rar" -recurse |remove-item
get-childitem $myStr -include "萝莉种子包.rar" -recurse |remove-item
get-childitem $myStr -include "更多种子图.JPG" -recurse |remove-item
get-childitem $myStr -include "*快來安裝*.mp4" -recurse |remove-item
get-childitem $myStr -include "*赚到手软*.mp4" -recurse |remove-item

get-childitem $myStr -include "*免费试看*.mp4" -recurse |remove-item
get-childitem $myStr -include "*快来下载*.mp4" -recurse |remove-item
get-childitem $myStr -include "*裸聊直播,*.mp4" -recurse |remove-item
get-childitem $myStr -include "*美女荷官做爱*" -recurse |remove-item
get-childitem $myStr -include "*vip1196*.mp4" -recurse |remove-item

#get-childitem 'W:\b' -include "*.baiduyun.downloading" -recurse |remove-item -whatif