text:
//
//  iBSkiTableViewController.m
//  iB-Ball
//
//  Created by apple on 13-3-17.
//  Copyright (c) 2013年 Snowmanzzz. All rights reserved.
//

#import "iBSkiTableViewController.h"
#import "iBSkillDataModel.h"
#import "iBSkill.h"
#import "iBSkiCountViewController.h"

@interface iBSkiTableViewController ()

@end

@implementation iBSkiTableViewController

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.clearsSelectionOnViewWillAppear = YES;

    if ([[NSUserDefaults standardUserDefaults] objectForKey:@"skillModel"]) {
        self.skillModel = [NSKeyedUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] objectForKey:@"skillModel"]];
    } else {
        self.skillModel = [[iBSkillDataModel alloc] init];
    }
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    self.navigationItem.rightBarButtonItem = self.editButtonItem;

//    UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addItem:)];
//    self.navigationItem.leftBarButtonItem = addButton;

}

- (void)bbiClicked {
    [self.tableView moveSection:0 toSection:1];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 3;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (section == 0) {
        return [self.skillModel.attackSkills count];
    }
    if (section == 1) {
        return [self.skillModel.defendingSkills count];
    }
    if (section == 2) {
        return [self.skillModel.otherSkills count];
    }
    return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (indexPath.section == 0) {
    // Configure the cell...
        cell.textLabel.text = ((iBSkill *)self.skillModel.attackSkills[indexPath.row]).skillName;
//    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress)];
//    [cell.contentView addGestureRecognizer:longPress];
//    if (indexPath.section == 1) {
//        UITableViewCell *cell2 = [UITableViewCell new];
//        UIPickerView *upv = [UIPickerView new];
//        [cell2 addSubview:upv];
//        return cell2;
//    }
    }
    else if (indexPath.section == 1) {
        cell.textLabel.text = ((iBSkill *)self.skillModel.defendingSkills[indexPath.row]).skillName;
    }
    else if (indexPath.section == 2) {
        cell.textLabel.text = ((iBSkill *)self.skillModel.otherSkills[indexPath.row]).skillName;
    }

    return cell;
}

- (void)longPress {
    iBSkill *skill = [self getSelectedSkill];

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Wow" message:[NSString stringWithFormat:@"This killer's score is %d/%d", skill.successNumber, skill.useNumber ] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
}

// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the specified item to be editable.
    return YES;
}

// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        iBSkill *skill;
        int section = indexPath.section;

        switch (section) {
            case 0:
                skill = self.skillModel.attackSkills[indexPath.row];
                break;
            case 1:
                skill = self.skillModel.defendingSkills[indexPath.row];
                break;
            case 2:
                skill = self.skillModel.otherSkills[indexPath.row];
                break;

        }
        [self.skillModel removeSkill:skill];
//        [self.skillModel.skillArray removeObjectAtIndex:indexPath.row];

        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    }
    else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }
    [self saveSkillData];
}

// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
    iBSkill *temp = [self.skillModel.skillArray objectAtIndex:fromIndexPath.row];
    [self.skillModel.skillArray removeObjectAtIndex:fromIndexPath.row];
    [self.skillModel.skillArray insertObject:temp atIndex:toIndexPath.row];
    [self.tableView reloadData];
}

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    [self.tableView deselectRowAtIndexPath:indexPath animated:YES];

    if ([self isEditing]) {
        NSLog(@"ss");
    }
    self.selected = indexPath;
    UIActionSheet *as = [[UIActionSheet alloc] initWithTitle:@"Please choose" delegate:self cancelButtonTitle:@"OK" destructiveButtonTitle:nil otherButtonTitles:@"Statics", @"Description", @"Count", @"Edit", @"Share", nil];
    [as showFromTabBar:self.tabBarController.tabBar];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"addSkill"]) {
        iBSkiInputViewController *a = (iBSkiInputViewController *)segue.destinationViewController;
        a.delegate = self;
    }
    if ([segue.identifier isEqualToString:@"count"]) {
        iBSkiCountViewController *a = (iBSkiCountViewController *)segue.destinationViewController;
        iBSkill *b = [self.skillModel.skillArray objectAtIndex:self.selected];
        a.whichSkill = b;
    }
}

- (void)viewWillAppear:(BOOL)animated {
    [self.tableView reloadData];
//    NSLog(@"%@", self.skillModel.skillArray);
}

- (void)skillInput:(id)sender withName:(NSString *)name withDesctiption:(NSString *)description andTag:(iBSkillCategory)skillCategory {
    iBSkill *newSkill = [[iBSkill alloc] initWithName:name andDescrip:description andTag:skillCategory];
    [self.skillModel addSkill:newSkill];

    [self saveSkillData];
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)saveSkillData {
    NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self.skillModel];
    [[NSUserDefaults standardUserDefaults] setObject:data forKey:@"skillModel"];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

#pragma mark Action sheet

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 0) {
        [self longPress];
    }
    if (buttonIndex == 2) {
        // segue to count
        iBSkiCountViewController *a = [[iBSkiCountViewController alloc] initWithNibName:@"iBSkiCountView" bundle:nil];
        a.whichSkill = [self getSelectedSkill];
        [self.navigationController pushViewController:a animated:YES];
    }
    if (buttonIndex == 1) {
        iBSkill *currentSkill = [self getSelectedSkill];
        NSLog(@"%@", currentSkill.skillName);
        if (currentSkill.skillDescription == nil) {
            // let the user say
            UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Cool" message:@"please input your description" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
            av.alertViewStyle = UIAlertViewStylePlainTextInput;
            [av show];
            return;
        }
        UIAlertView *av = [[UIAlertView alloc] initWithTitle:currentSkill.skillName message:currentSkill.skillDescription delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [av show];
    }

    if (buttonIndex == 4) {
        // share the crap
        // 1 get skill
        iBSkill *skill;
        switch (self.selected.section) {
            case 0:
                skill = self.skillModel.attackSkills[self.selected.row];
                break;
            case 1:
                skill = self.skillModel.defendingSkills[self.selected.row];
                break;
            case 2:
                skill = self.skillModel.otherSkills[self.selected.row];
                break;
            default:
                break;
        }
        // 2 share the Crap
        NSMutableString *shareString = [NSMutableString new];
        [shareString appendString:@"习得新技能["];
        [shareString appendString:skill.skillName];
        [shareString appendString:@"] 技能说明:"];
        [shareString appendString:skill.skillDescription == nil ? @"" : skill.skillDescription];
        [shareString appendString:@"--From iB-Ball"];

//        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Alert"
//                                                            message:[NSString stringWithFormat:@"Will post status with text \"%@\"", postStatusText]
//                                                           delegate:self cancelButtonTitle:@"Cancel"
//                                                  otherButtonTitles:@"OK", nil];
        Renren *renren = [Renren sharedRenren];
        NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:10];
        [params setObject:@"status.set" forKey:@"method"];
        [params setObject:[shareString copy] forKey:@"status"];
        [renren requestWithParams:params andDelegate:self];
    }
}

- (iBSkill *)getSelectedSkill {
    iBSkill *skill;

    switch (self.selected.section) {
        case 0:
            skill = [self.skillModel.attackSkills objectAtIndex:self.selected.row];
            break;
        case 1:
            skill = [self.skillModel.defendingSkills objectAtIndex:self.selected.row];
            break;
        case 2:
            skill = [self.skillModel.otherSkills objectAtIndex:self.selected.row];
            break;
    }
    return skill;
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 1) {
        // ok
        iBSkill *currentSkill = [self getSelectedSkill];
        currentSkill.skillDescription = [alertView textFieldAtIndex:0].text;
    }
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    if (section == 0) {
        return @"进攻技";
    }
    else if (section == 1) {
        return @"防守技";
    }
    else if (section == 2) {
        return @"其他";
    }
    return nil;
}

/**
 * 接口请求成功,第三方开发者实现这个方法
 */
- (void)renren:(Renren *)renren requestDidReturnResponse:(ROResponse*)response {
    //TODO
}

/**
 * 接口请求失败,第三方开发者实现这个方法
 */
- (void)renren:(Renren *)renren requestFailWithError:(ROError*)error {
    //TODO
}

@end


text:
'use strict';

var portfinder = require('portfinder'),
    utils      = require('radiodan-client').utils;

//http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Dynamic.2C_private_or_ephemeral_ports
portfinder.basePort = 49152;

portfinder.nextPortPromise = function() {
  return utils.promise.nfcall(portfinder.getPort);
};

module.exports.create = function(portGenerator){
  var instance = {};

  portGenerator = portGenerator || portfinder;

  instance.next = function(numPorts) {
    var portPromises = [],
        portCount = parseInt(numPorts, 10),
        i;

    for(i=0; i<portCount; i++) {
      var p = portGenerator.nextPortPromise();
      portPromises.push(p);
    }

    return utils.promise.all(portPromises);
  };

  return instance;
};

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">
  <link rel="canonical" href=" {{ site.production_url }}{{ page.url }}" />
  <meta name="google-site-verification" content="AJzDtzAZb9Di5FdCwHgkTn8EReo5swk1CJAigOrmAxc" />
<title>{{ page.title }}</title>
  <link rel="shortcut icon" type="image/x-icon" href="/img/favicon.ico?">

	<meta name="author" content="{{ site.author.name }}">
	<link href='{{ ASSET_PATH }}/css/style.css' rel="stylesheet" media="all">
	<link href='{{ ASSET_PATH }}/font/foundation-icons/foundation-icons.css' rel="stylesheet">
  <link href="{{ site.author.gplus}}" rel="author">
  <link href="{{ site.author.gplus}}" rel="publisher">
	<link href="//feeds.feedburner.com/{{ site.author.feedname }}" rel="alternate" title="{{ page.title }}" type="application/atom+xml">

  <meta name="twitter:card" content="summary">
  <meta name="twitter:creator" content="{{ site.author.name }}">
  {% if page.title %}
    <meta name="twitter:title" content="{{ page.title }}">
  {% else %}
    <meta name="twitter:title" content="{{ site.title }}">
  {% endif %}
  {% if page.url %}
    <meta name="twitter:url" content="{{ site.production_url }}{{ page.url }}">
  {% endif %}
  {% if page.description %}
    <meta name="twitter:description" content="{{ page.description }}">
  {% else %}
    <meta name="twitter:description" content="{{ site.tagline }}">
  {% endif %}
  {% if page.image %}
    <meta name="twitter:image:src" content="{{ site.production_url }}{{ page.image }}">
  {% else %}
    <meta name="twitter:image:src" content="{{ site.production_url }}/img/bolster.png">
  {% endif %}

          Fork me on GitHub

{{ site.title }}

{{ site.tagline}}

            {% assign pages_list = site.pages %}
            {% assign group = 'navigation' %}
            {% include JB/pages_list %}

					{{ content }}

        Published by {{site.author.name}}, <time class="updated" datetime={{ site.time }}> {{ site.time | date: '%Y' }}.</time>

					Powered by Jekyll.

  {% include JB/analytics %}


text:
package nl.ordina.bag.etl.model.mutatie;

import javax.xml.datatype.XMLGregorianCalendar;

import nl.kadaster.schemas.bag_verstrekkingen.extract_producten_lvc.v20090901.MutatieProduct;
import nl.ordina.bag.etl.Constants.BAGObjectType;

public class BAGMutatie
{
	private long id;
	private XMLGregorianCalendar tijdstipVerwerking;
	private int volgnrVerwerking;
	private BAGObjectType objectType;
	private MutatieProduct mutatieProduct;

	public BAGMutatie()
	{
	}

	public BAGMutatie(XMLGregorianCalendar tijdstipVerwerking, int volgnrVerwerking, BAGObjectType objectType, MutatieProduct mutatieProduct)
	{
		this.tijdstipVerwerking = tijdstipVerwerking;
		this.volgnrVerwerking = volgnrVerwerking;
		this.objectType = objectType;
		this.mutatieProduct = mutatieProduct;
	}

	public long getId()
	{
		return id;
	}

	public void setId(long id)
	{
		this.id = id;
	}

	public XMLGregorianCalendar getTijdstipVerwerking()
	{
		return tijdstipVerwerking;
	}

	public void setTijdstipVerwerking(XMLGregorianCalendar tijdstipVerwerking)
	{
		this.tijdstipVerwerking = tijdstipVerwerking;
	}

	public int getVolgnrVerwerking()
	{
		return volgnrVerwerking;
	}

	public void setVolgnrVerwerking(int volgnrVerwerking)
	{
		this.volgnrVerwerking = volgnrVerwerking;
	}

	public BAGObjectType getObjectType()
	{
		return objectType;
	}

	public void setObjectType(BAGObjectType objectType)
	{
		this.objectType = objectType;
	}

	public MutatieProduct getMutatieProduct()
	{
		return mutatieProduct;
	}

	public void setMutatieProduct(MutatieProduct mutatieProduct)
	{
		this.mutatieProduct = mutatieProduct;
	}

}


text:
package jetbrains.exodus.entitystore.tables;

import jetbrains.exodus.ByteIterable;
import jetbrains.exodus.entitystore.PersistentEntityStoreImpl;
import jetbrains.exodus.entitystore.PersistentStoreTransaction;
import jetbrains.exodus.env.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@SuppressWarnings({"HardCodedStringLiteral"})
public class TwoColumnTable extends Table {

    private final Store first;  // 1st column -> 2nd column
    private final Store second; // 2nd column -> 1st column

    public TwoColumnTable(@NotNull final PersistentStoreTransaction txn,
                          @NotNull final String name,
                          @NotNull final StoreConfig config) {
        final PersistentEntityStoreImpl store = txn.getStore();
        final Transaction envTxn = txn.getEnvironmentTransaction();
        final Environment env = store.getEnvironment();
        first = env.openStore(name, config, envTxn);
        second = env.openStore(secondColumnDatabaseName(name), config, envTxn);
        store.trackTableCreation(first, txn);
        store.trackTableCreation(second, txn);
    }

    public static String secondColumnDatabaseName(@NotNull final String name) {
        return name + "#reverse";
    }

    /**
     * Search for the first entry in the first database. Use this method for databases configured with no duplicates.
     *
     * @param txn   enclosing transaction
     * @param first first key.
     * @return null if no entry found, otherwise the value.
     */
    @Nullable
    public ByteIterable get(@NotNull final Transaction txn, @NotNull final ByteIterable first) {
        return this.first.get(txn, first);
    }

    /**
     * Search for the second entry in the second database. Use this method for databases configured with no duplicates.
     *
     * @param second second key (value for first).
     * @return null if no entry found, otherwise the value.
     */
    @Nullable
    public ByteIterable get2(@NotNull final Transaction txn, @NotNull final ByteIterable second) {
        return this.second.get(txn, second);
    }

    public boolean contains(@NotNull final Transaction txn,
                            @NotNull final ByteIterable first,
                            @NotNull final ByteIterable second) {
        try (Cursor cursor = getFirstIndexCursor(txn)) {
            return cursor.getSearchBoth(first, second);
        }
    }

    public boolean contains2(@NotNull final Transaction txn,
                             @NotNull final ByteIterable first,
                             @NotNull final ByteIterable second) {
        try (Cursor cursor = getSecondIndexCursor(txn)) {
            return cursor.getSearchBoth(second, first);
        }
    }

    public boolean put(@NotNull final Transaction txn,
                       @NotNull final ByteIterable first,
                       @NotNull final ByteIterable second) {
        final boolean result = this.first.put(txn, first, second);
        this.second.put(txn, second, first);
        return result;
    }

    public boolean delete(@NotNull final Transaction txn,
                          @NotNull final ByteIterable first,
                          @NotNull final ByteIterable second) {
        boolean success;
        try (Cursor cursor = getFirstIndexCursor(txn)) {
            success = cursor.getSearchBoth(first, second);
            if (!success) {
                return false;
            }
            success = cursor.deleteCurrent();
            checkStatus(success, "Failed to delete");
        }
        try (Cursor cursor = getSecondIndexCursor(txn)) {
            success = cursor.getSearchBoth(second, first);
            checkStatus(success, "Failed to delete: data mismatch in TwoColumnTable's stores");
            if (success) {
                success = cursor.deleteCurrent();
                checkStatus(success, "Failed to delete");
            }
        }
        return true;
    }

    @NotNull
    public Cursor getFirstIndexCursor(@NotNull final Transaction txn) {
        return first.openCursor(txn);
    }

    @NotNull
    public Cursor getSecondIndexCursor(@NotNull final Transaction txn) {
        return second.openCursor(txn);
    }

    public void truncateFirst(@NotNull final Transaction txn) {
        txn.getEnvironment().truncateStore(first.getName(), txn);
    }

    public long getPrimaryCount(@NotNull final Transaction txn) {
        return first.count(txn);
    }

    public long getSecondaryCount(@NotNull final Transaction txn) {
        return second.count(txn);
    }

    @Override
    public boolean canBeCached() {
        return !first.getConfig().temporaryEmpty && !second.getConfig().temporaryEmpty;
    }
}


text:
package com.cloudogu.versionname;

import java.io.IOException;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) throws IOException {
        System.out.println(com.cloudogu.versionname.VersionNames.getVersionNameFromProperties());
    }
}


text:
module Masq
  class Site < ActiveRecord::Base
    belongs_to :account
    belongs_to :persona
    has_many :release_policies, :dependent => :destroy

    validates_presence_of :url, :persona, :account
    validates_uniqueness_of :url, :scope => :account_id
    attr_accessible :url, :persona_id, :properties, :ax_fetch, :sreg

    # Sets the release policies by first deleting the old ones and
    # then appending a new one for every given sreg and ax property.
    # This setter is used to set the attributes recieved from the
    # update site form, so it gets passed AX and SReg properties.
    # To be backwards compatible (SReg seems to be obsolete now that
    # there is AX), SReg properties get a type_identifier matching
    # their property name so that they can be distinguished from AX
    # properties (see the sreg_properties and ax_properties getters).
    def properties=(props)
      release_policies.destroy_all
      props.each_pair do |property, details|
        release_policies.build(:property => property, :type_identifier => details['type']) if details['value']
      end
    end

    # Generates a release policy for each property that has a value.
    # This setter is used in the server controllers complete action
    # to set the attributes recieved from the decision form.
    def ax_fetch=(props)
      props.each_pair do |property, details|
        release_policies.build(:property => property, :type_identifier => details['type']) if details['value']
      end
    end

    # Generates a release policy for each SReg property.
    # This setter is used in the server controllers complete action
    # to set the attributes recieved from the decision form.
    def sreg=(props)
      props.each_key do |property|
        release_policies.build(:property => property, :type_identifier => property)
      end
    end

    # Returns a hash with all released SReg properties. SReg properties
    # have a type_identifier matching their property name
    def sreg_properties
      props = {}
      release_policies.each do |rp|
        is_sreg = (rp.property == rp.type_identifier)
        props[rp.property] = persona.property(rp.property) if is_sreg
      end
      props
    end

    # Returns a hash with all released AX properties.
    # AX properties have an URL as type_identifier.
    def ax_properties
      props = {}
      release_policies.each do |rp|
        if rp.type_identifier.match("://")
          props["type.#{rp.property}"] = rp.type_identifier
          props["value.#{rp.property}"] = persona.property(rp.type_identifier )
        end
      end
      props
    end
  end
end


text:
package main

import (
	"bytes"
	"fmt"
	"os"
	"path/filepath"

	"github.com/murlokswarm/log"
)

type configuration struct {
	ID          string `json:"id"           help:"Identity name"`
	Name        string `json:"name"         help:"Application name"`
	DisplayName string `json:"display-name" help:"Application name displayed"`
	Publisher   string `json:"publisher"    help:"Publisher name."`
	PublisherID string `json:"publisher-id" help:"Publisher id."`
	Version     string `json:"version"      help:"Version of the app."`
	Icon        string `json:"icon"         help:"The app icon as .png file. Provide a big one!"`
}

func defaultConfig() configuration {
	wd, err := os.Getwd()
	if err != nil {
		log.Panic(err)
	}
	name := filepath.Base(wd)
	user := os.Getenv("USERNAME")
	id := fmt.Sprintf("%s.%s", user, name)
	publisherID := fmt.Sprintf("CN=%s", user)

	return configuration{
		ID:          id,
		Name:        name,
		DisplayName: name,
		Publisher:   name,
		PublisherID: publisherID,
		Version:     "1.0.0.0",
		Icon:        "icon.png",
	}
}

func (c configuration) ExecName() string {
	return c.Name + ".exe"
}

func (c configuration) AppXName() string {
	return c.Name + ".appx"
}

func winPackagePath() string {
	return filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "murlokswarm", "windows")
}

func commandString() string {
	b := bytes.Buffer{}
	fmt.Fprintf(&b, "build\t Builds the AppX.")
	return b.String()
}


text:
package com.hjh.files.sync.client;

import java.io.File;
import java.io.IOException;

import com.hjh.files.sync.common.RemoteFile;
import com.hjh.files.sync.common.StopAble;

public interface FileCopy {

	public void copy(StopAble stop, RemoteFile from, File target, String md5) throws IOException;
}


text:
if string.sub(_VERSION,1,7)=='Lua 5.0' then
	-- lua5.0 doesnt have a nice way to do this
	lib=loadlib('example.dll','luaopen_example') or loadlib('example.so','luaopen_example')
	assert(lib)()
else
	-- lua 5.1 does
	require('example')
end

-- Try to set the values of some global variables

example.ivar   =  42
example.svar   = -31000
example.lvar   =  65537
example.uivar  =  123456
example.usvar  =  61000
example.ulvar  =  654321
example.scvar  =  -13
example.ucvar  =  251
example.cvar   =  "S"
example.fvar   =  3.14159
example.dvar   =  2.1828
example.strvar =  "Hello World"
example.iptrvar= example.new_int(37)
example.ptptr  = example.new_Point(37,42)
example.name   = "Bill"

-- Now print out the values of the variables

print("Variables (values printed from Lua)")

print("ivar      =", example.ivar)
print("svar      =", example.svar)
print("lvar      =", example.lvar)
print("uivar     =", example.uivar)
print("usvar     =", example.usvar)
print("ulvar     =", example.ulvar)
print("scvar     =", example.scvar)
print("ucvar     =", example.ucvar)
print("fvar      =", example.fvar)
print("dvar      =", example.dvar)
print("cvar      =", example.cvar)
print("strvar    =", example.strvar)
print("cstrvar   =", example.cstrvar)
print("iptrvar   =", example.iptrvar)
print("name      =", example.name)
print("ptptr     =", example.ptptr, example.Point_print(example.ptptr))
print("pt        =", example.pt, example.Point_print(example.pt))

print("\nVariables (values printed from C)")

example.print_vars()

print "\nNow I'm going to try and modify some read only variables";

print "     Tring to set 'path' to 'Whoa!'";
if pcall(function() example.path = "Whoa!" end)==true then
	print "     Thats funny, it didn't give an error!"
else
	print "     It gave an error, as it should"
end
print("     Just checking the value: path      =", example.path)

print "     Trying to set 'status' to '0'";
if pcall(function() example.status = 0 end)==true then
	print "     Thats funny, it didn't give an error!"
else
	print "     It gave an error, as it should"
end
print("     Just checking the value: status    =", example.status)

print "\nI'm going to try and update a structure variable.\n"

example.pt = example.ptptr

print "The new value is"
example.pt_print()
print("You should see the value", example.Point_print(example.ptptr))


text:
import unittest
import sys
import imp
import random
from authorizenet import apicontractsv1
import pyxb
import time

class TestRunner(unittest.TestCase):
    #pyxb.GlobalValidationConfig._setForBinding(False)

    def getEmail(self):
        return str(random.randint(0, 10000)) + "@test.com"

    def getAmount(self):
        return random.randint(0, 10000)

    def getDay(self):
        return random.randint(7, 365)

    def create_an_apple_pay_transaction(self):
        print("create_an_apple_pay_transaction")
        modl = imp.load_source('modulename', 'MobileInappTransactions/create-an-apple-pay-transaction.py')
        return modl.create_an_apple_pay_transaction()

    def create_an_accept_transaction(self):
        print("create_an_accept_transaction")
        modl = imp.load_source('modulename', 'MobileInappTransactions/create-an-accept-transaction.py')
        return modl.create_an_accept_transaction()

    def create_an_android_pay_transaction(self):
        print("create_an_android_pay_transaction")
        modl = imp.load_source('modulename', 'MobileInappTransactions/create-an-android-pay-transaction.py')
        return modl.create_an_android_pay_transaction()

    def create_customer_payment_profile(self):
        print("create_customer_payment_profile")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()

        #create customer payment profile for that above profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py')
        response = modl.create_customer_payment_profile(str(response.customerProfileId))

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(str(response.customerProfileId))

        return response

    def create_customer_profile_from_transaction(self):
        print("create_customer_profile_from_transaction")

        #Create transaction
        modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py')
        response = modl.authorize_credit_card(self.getAmount())

        #create customer payment profile for above transaction
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile-from-transaction.py')
        response = modl.create_customer_profile_from_transaction(str(response.transactionResponse.transId))

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(str(response.customerProfileId))

        return response

    def create_customer_profile(self):
        print("create_customer_profile")
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(str(response.customerProfileId))

        return response

    def create_customer_shipping_address(self):
        print("create_customer_shipping_address")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()

        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-shipping-address.py')
        response = modl.create_customer_shipping_address(str(response.customerProfileId))

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(str(response.customerProfileId))

        return response

    def delete_customer_payment_profile(self):
        print("delete_customer_payment_profile")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()
        customerProfileId = str(response.customerProfileId)

        #create customer payment profile for that above profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py')
        response = modl.create_customer_payment_profile(str(response.customerProfileId))

        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-payment-profile.py')
        response = modl.delete_customer_payment_profile(customerProfileId, str(response.customerPaymentProfileId))

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(customerProfileId)

        return response

    def delete_customer_profile(self):
        print("delete_customer_profile")

        #Create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()

        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        return modl.delete_customer_profile(str(response.customerProfileId))

    def delete_customer_shipping_address(self):
        print("delete_customer_shipping_address")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()
        customerProfileId = str(response.customerProfileId)

        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-shipping-address.py')
        response = modl.create_customer_shipping_address(customerProfileId)

        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-shipping-address.py')
        response = modl.delete_customer_shipping_address(customerProfileId, str(response.customerAddressId))

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(customerProfileId)

        return response

    def get_customer_payment_profile(self):
        print("get_customer_payment_profile")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()
        customerProfileId = str(response.customerProfileId)

        #create customer payment profile for that above profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py')
        response = modl.create_customer_payment_profile(customerProfileId)

        modl = imp.load_source('modulename', 'CustomerProfiles/get-customer-payment-profile.py')
        response = modl.get_customer_payment_profile(customerProfileId, str(response.customerPaymentProfileId))

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(customerProfileId)

        return response

    def get_customer_payment_profile_list(self):
        print("get_customer_payment_profile_list")
        modl = imp.load_source('modulename', 'CustomerProfiles/get-customer-payment-profile-list.py')
        return modl.get_customer_payment_profile_list()

    def get_customer_profile_ids(self):
        print("get_customer_profile_ids")
        modl = imp.load_source('modulename', 'CustomerProfiles/get-customer-profile-ids.py')
        return modl.get_customer_profile_ids()

    def get_customer_profile(self):
        print("get_customer_profile")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()
        customerProfileId = str(response.customerProfileId)

        modl = imp.load_source('modulename', 'CustomerProfiles/get-customer-profile.py')
        response = modl.get_customer_profile(customerProfileId)

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(customerProfileId)

        return response

    def get_customer_shipping_address(self):
        print("get_customer_shipping_address")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()
        customerProfileId = str(response.customerProfileId)

        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-shipping-address.py')
        response = modl.create_customer_shipping_address(customerProfileId)

        modl = imp.load_source('modulename', 'CustomerProfiles/get-customer-shipping-address.py')
        response = modl.get_customer_shipping_address(customerProfileId, str(response.customerAddressId))

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(customerProfileId)

        return response

    def get_hosted_profile_page(self):
        print("get_hosted_profile_page")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()
        customerProfileId = str(response.customerProfileId)

        modl = imp.load_source('modulename', 'CustomerProfiles/get-hosted-profile-page.py')
        response = modl.get_hosted_profile_page(customerProfileId)

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(customerProfileId)

        return response

    def update_customer_payment_profile(self):
        print("update_customer_payment_profile")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()
        customerProfileId = str(response.customerProfileId)

        #create customer payment profile for that above profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py')
        response = modl.create_customer_payment_profile(customerProfileId)

        if hasattr(response, 'customerProfileId') == True:
            modl = imp.load_source('modulename', 'CustomerProfiles/update-customer-payment-profile.py')
            response = modl.update_customer_payment_profile(customerProfileId, str(response.customerPaymentProfileId))

            #delete newly create customer profile
            modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
            modl.delete_customer_profile(customerProfileId)

        return response

    def update_customer_profile(self):
        print("update_customer_profile")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()
        customerProfileId = str(response.customerProfileId)

        modl = imp.load_source('modulename', 'CustomerProfiles/update-customer-profile.py')
        response = modl.update_customer_profile(customerProfileId)

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(customerProfileId)

        return response

    def update_customer_shipping_address(self):
        print("update_customer_shipping_address")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()
        customerProfileId = str(response.customerProfileId)

        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-shipping-address.py')
        response = modl.create_customer_shipping_address(customerProfileId)

        modl = imp.load_source('modulename', 'CustomerProfiles/update-customer-shipping-address.py')
        response = modl.update_customer_shipping_address(customerProfileId, str(response.customerAddressId))

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(customerProfileId)

        return response

    def validate_customer_payment_profile(self):
        print("validate_customer_payment_profile")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()
        customerProfileId = str(response.customerProfileId)

        #create customer payment profile for that above profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py')
        response = modl.create_customer_payment_profile(customerProfileId)

        modl = imp.load_source('modulename', 'CustomerProfiles/validate-customer-payment-profile.py')
        response = modl.validate_customer_payment_profile(customerProfileId, str(response.customerPaymentProfileId))

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(customerProfileId)

        return response

    def authorize_credit_card(self):
        print("authorize_credit_card")
        modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py')
        return modl.authorize_credit_card(self.getAmount())

    def capture_funds_authorized_through_another_channel(self):
        print("capture_funds_authorized_through_another_channel")
        modl = imp.load_source('modulename', 'PaymentTransactions/capture-funds-authorized-through-another-channel.py')
        return modl.capture_funds_authorized_through_another_channel()

    def capture_previously_authorized_amount(self):
        print("capture_previously_authorized_amount")

        modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py')
        response = modl.authorize_credit_card(self.getAmount())

        modl = imp.load_source('modulename', 'PaymentTransactions/capture-previously-authorized-amount.py')
        return modl.capture_previously_authorized_amount(response.transactionResponse.transId)

    def charge_credit_card(self):
        print("charge_credit_card")
        modl = imp.load_source('modulename', 'PaymentTransactions/charge-credit-card.py')
        return modl.charge_credit_card(self.getAmount())

    def charge_customer_profile(self):
        print("charge_customer_profile")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        response = modl.create_customer_profile()
        customerProfileId = str(response.customerProfileId)

        #create customer payment profile for that above profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py')
        response = modl.create_customer_payment_profile(customerProfileId)

        modl = imp.load_source('modulename', 'PaymentTransactions/charge-customer-profile.py')
        response = modl.charge_customer_profile(customerProfileId, str(response.customerPaymentProfileId), self.getAmount())

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(customerProfileId)

        return response

    def charge_tokenized_credit_card(self):
        print("charge_tokenized_credit_card")
        modl = imp.load_source('modulename', 'PaymentTransactions/charge-tokenized-credit-card.py')
        return modl.charge_tokenized_credit_card()

    def credit_bank_account(self):
        print("credit_bank_account")
        modl = imp.load_source('modulename', 'PaymentTransactions/credit-bank-account.py')
        return modl.credit_bank_account()

    def debit_bank_account(self):
        print("debit_bank_account")
        modl = imp.load_source('modulename', 'PaymentTransactions/debit-bank-account.py')
        return modl.debit_bank_account(str(round(random.random()*100, 2)))

    def refund_transaction(self):
        print("refund_transaction")

        modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py')
        response = modl.authorize_credit_card(self.getAmount())

        modl = imp.load_source('modulename', 'PaymentTransactions/refund-transaction.py')
        return modl.refund_transaction(response.transactionResponse.transId)

    def update_split_tender_group(self):
        print("update_split_tender_group")
        modl = imp.load_source('modulename', 'PaymentTransactions/update-split-tender-group.py')
        return modl.update_split_tender_group()

    def void_transaction(self):
        print("void_transaction")

        modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py')
        response = modl.authorize_credit_card(self.getAmount())

        modl = imp.load_source('modulename', 'PaymentTransactions/void-transaction.py')
        return modl.void_transaction(response.transactionResponse.transId)

    def authorization_and_capture_continued(self):
        print("authorization_and_capture_continued")

        modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture.py')
        response = modl.authorization_and_capture(self.getAmount())

        modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture-continued.py')
        return modl.authorization_and_capture_continued(str(response.transactionResponse.transId), "6ZSCSYG33VP8Q")

    def authorization_and_capture(self):
        print("authorization_and_capture")
        modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture.py')
        return modl.authorization_and_capture(self.getAmount())

    def authorization_only_continued(self):
        print("authorization_only_continued")
        modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-only-continued.py')
        return modl.authorization_only_continued()

    def authorization_only(self):
        print("authorization_only")
        modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-only.py')
        return modl.authorization_only()

    def credit(self):
        print("credit")
        modl = imp.load_source('modulename', 'PayPalExpressCheckout/credit.py')
        return modl.credit()

    def get_details(self):
        print("get_details")

        modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture.py')
        response = modl.authorization_and_capture(self.getAmount())

        modl = imp.load_source('modulename', 'PayPalExpressCheckout/get-details.py')
        return modl.get_details(str(response.transactionResponse.transId))

    def prior_authorization_capture(self):
        print("prior_authorization_capture")

        modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture.py')
        response = modl.authorization_and_capture(self.getAmount())

        modl = imp.load_source('modulename', 'PayPalExpressCheckout/prior-authorization-capture.py')
        return modl.prior_authorization_capture(str(response.transactionResponse.transId))

    def void(self):
        print("void")

        modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture.py')
        response = modl.authorization_and_capture(self.getAmount())

        modl = imp.load_source('modulename', 'PayPalExpressCheckout/void.py')
        return modl.void(str(response.transactionResponse.transId))

    def cancel_subscription(self):
        print("cancel_subscription")

        modl = imp.load_source('modulename', 'RecurringBilling/create-subscription.py')
        response = modl.create_subscription(self.getAmount(), self.getDay())

        modl = imp.load_source('modulename', 'RecurringBilling/cancel-subscription.py')
        return modl.cancel_subscription(response.subscriptionId)

    def create_subscription(self):
        print("create_subscription")

        modl = imp.load_source('modulename', 'RecurringBilling/create-subscription.py')
        return modl.create_subscription(self.getAmount(), self.getDay())

    def create_subscription_from_customer_profile(self):
        print("create_subscription_from_customer_profile")

        #create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py')
        profileResponse = modl.create_customer_profile()

        #create customer payment profile for that above profile
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py')
        paymentProfileResponse = modl.create_customer_payment_profile(str(profileResponse.customerProfileId))

        #Create customer shipping address
        modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-shipping-address.py')
        shippingResponse = modl.create_customer_shipping_address(str(profileResponse.customerProfileId))

        time.sleep(10)

        #Create subscripiton from customer profile
        modl = imp.load_source('modulename', 'RecurringBilling/create-subscription-from-customer-profile.py')
        response = modl.create_subscription_from_customer_profile(self.getAmount(), self.getDay(), str(profileResponse.customerProfileId), str(paymentProfileResponse.customerPaymentProfileId), str(shippingResponse.customerAddressId))

        #Cancel subscription
        modl = imp.load_source('modulename', 'RecurringBilling/cancel-subscription.py')
        modl.cancel_subscription(str(response.subscriptionId))

        #delete newly create customer profile
        modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py')
        modl.delete_customer_profile(str(profileResponse.customerProfileId))

        return response

    def get_list_of_subscriptions(self):
        print("get_list_of_subscriptions")

        modl = imp.load_source('modulename', 'RecurringBilling/get-list-of-subscriptions.py')
        return modl.get_list_of_subscriptions()

    def get_subscription_status(self):
        print("get_subscription_status")

        modl = imp.load_source('modulename', 'RecurringBilling/create-subscription.py')
        response = modl.create_subscription(self.getAmount(), self.getDay())
        subscriptionId = response.subscriptionId

        modl = imp.load_source('modulename', 'RecurringBilling/get-subscription-status.py')
        response = modl.get_subscription_status(subscriptionId)

        modl = imp.load_source('modulename', 'RecurringBilling/cancel-subscription.py')
        modl.cancel_subscription(subscriptionId)

        return response

    def get_subscription(self):
        print("get_subscription")

        modl = imp.load_source('modulename', 'RecurringBilling/create-subscription.py')
        response = modl.create_subscription(self.getAmount(), self.getDay())
        subscriptionId = str(response.subscriptionId)

        modl = imp.load_source('modulename', 'RecurringBilling/get-subscription.py')
        response = modl.get_subscription(subscriptionId)

        modl = imp.load_source('modulename', 'RecurringBilling/cancel-subscription.py')
        modl.cancel_subscription(subscriptionId)

        return response

    def update_subscription(self):
        print("update_subscription")

        modl = imp.load_source('modulename', 'RecurringBilling/create-subscription.py')
        response = modl.create_subscription(self.getAmount(), self.getDay())
        subscriptionId = str(response.subscriptionId)

        modl = imp.load_source('modulename', 'RecurringBilling/update-subscription.py')
        response = modl.update_subscription(subscriptionId)

        modl = imp.load_source('modulename', 'RecurringBilling/cancel-subscription.py')
        modl.cancel_subscription(subscriptionId)

        return response

    def get_batch_statistics(self):
        print("get_batch_statistics")
        modl = imp.load_source('modulename', 'TransactionReporting/get-batch-statistics.py')
        return modl.get_batch_statistics()

    def get_settled_batch_list(self):
        print("get_settled_batch_list")
        modl = imp.load_source('modulename', 'TransactionReporting/get-settled-batch-list.py')
        return modl.get_settled_batch_list()

    def get_transaction_details(self):
        print("get_transaction_details")

        modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py')
        response = modl.authorize_credit_card(self.getAmount())

        modl = imp.load_source('modulename', 'TransactionReporting/get-transaction-details.py')
        return modl.get_transaction_details(response.transactionResponse.transId)

    def get_transaction_list(self):
        print("get_transaction_list")
        modl = imp.load_source('modulename', 'TransactionReporting/get-transaction-list.py')
        return modl.get_transaction_list()

    def get_unsettled_transaction_list(self):
        print("get_unsettled_transaction_list")
        modl = imp.load_source('modulename', 'TransactionReporting/get-unsettled-transaction-list.py')
        return modl.get_unsettled_transaction_list()

    def create_visa_src_transaction(self):
        print("create_visa_src_transaction")
        modl = imp.load_source('modulename', 'VisaCheckout/create-visa-checkout-transaction.py')
        return modl.create_visa_src_transaction()

    def decrypt_visa_src_data(self):
        print("decrypt_visa_src_data")
        modl = imp.load_source('modulename', 'VisaCheckout/decrypt-visa-checkout-data.py')
        return modl.decrypt_visa_src_data()

    def get_merchant_details(self):
        print("get_merchant_details")
        modl = imp.load_source('modulename', 'TransactionReporting/get-merchant-details.py')
        return modl.get_merchant_details()

    def get_an_accept_payment_page(self):
        print("get_an_accept_payment_page")
        modl = imp.load_source('modulename', 'AcceptSuite/get-an-accept-payment-page.py')
        return modl.get_an_accept_payment_page(self.getAmount())

    def update_held_transaction(self):
        print("update_held_transaction")
        modl = imp.load_source('modulename', 'PaymentTransactions/update-held-transaction.py')
        return modl.update_held_transaction("12345")
    # added new method
    def get_account_updater_job_details(self):
        print("get_account_updater_job_details")

        modl = imp.load_source('modulename', 'TransactionReporting/get-account-updater-job-details.py')
        return modl.get_account_updater_job_details()

    def validate_response(self, response):
        if(response is None):
            return False

        if (response.messages.resultCode != apicontractsv1.messageTypeEnum.Ok):
            return False

        return True

    def test_all_sample_codes(self):
        failed = []
        succeeded = []
        with open('list_of_sample_codes.txt', 'r') as f:
            numRetries = 3
            for line in f:
                #print(line)
                items = line.split('\t')
                apiName = items[0]
                isDependent = items[1]
                shouldApiRun = items[2].rstrip()[0]

                if(shouldApiRun == '0'):
                    continue

                if(shouldApiRun == '1'):
                    for i in range(0, numRetries):
                        try:
                            print("-------------------------------")
                            print("Running : " + apiName)
                            print("-------------------------------")
                            response = getattr(self, apiName)()
                            #if(self.validate_response(response)):
                            #    succeeded.append(apiName)
                            #else:
                            #    failed.append(apiName)

                            if self.validate_response(response) == True:
                                break
                        except BaseException as e:
                            print(str(e))

                    self.assertTrue(self.validate_response(response))

        #print("-------- Success ----------")
        #for line in succeeded:
        #    print(line)

        #print("-------- Failed ----------")
        #for line in failed:
        #    print(line)

    #def test_sample(self):
    #    self.assertTrue(self.get_customer_shipping_address())

unittest.main()


text:
using System.Collections.Generic;

using Amazon.CloudFront.Model;
using Amazon.Runtime.Internal.Transform;

namespace Amazon.CloudFront.Model.Internal.MarshallTransformations
{
     /// <summary>
     ///   CustomErrorResponse Unmarshaller
     /// </summary>
    internal class CustomErrorResponseUnmarshaller : IUnmarshaller<CustomErrorResponse, XmlUnmarshallerContext>, IUnmarshaller<CustomErrorResponse, JsonUnmarshallerContext>
    {
        public CustomErrorResponse Unmarshall(XmlUnmarshallerContext context)
        {
            CustomErrorResponse customErrorResponse = new CustomErrorResponse();
            int originalDepth = context.CurrentDepth;
            int targetDepth = originalDepth + 1;

            if (context.IsStartOfDocument)
               targetDepth += 2;

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("ErrorCode", targetDepth))
                    {
                        customErrorResponse.ErrorCode = IntUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ResponsePagePath", targetDepth))
                    {
                        customErrorResponse.ResponsePagePath = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ResponseCode", targetDepth))
                    {
                        customErrorResponse.ResponseCode = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ErrorCachingMinTTL", targetDepth))
                    {
                        customErrorResponse.ErrorCachingMinTTL = LongUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return customErrorResponse;
                }
            }

            return customErrorResponse;
        }

        public CustomErrorResponse Unmarshall(JsonUnmarshallerContext context)
        {
            return null;
        }

        private static CustomErrorResponseUnmarshaller instance;

        public static CustomErrorResponseUnmarshaller GetInstance()
        {
            if (instance == null)
               instance = new CustomErrorResponseUnmarshaller();

            return instance;
        }
    }
}


text:
#import <Foundation/Foundation.h>

@protocol MUKContentAction, MUKContent;

NS_ASSUME_NONNULL_BEGIN

/// Something which can be dispatched
@protocol MUKContentDispatchable <NSObject>
@end

/**
 A block which dispatches things.
 Generally it returns the dispatched action, but middlewares may vary returned
 object.
 */
typedef id _Nullable (^MUKContentDispatcher)(id<MUKContentDispatchable> dispatchableObject);

/// A block which returns the content
typedef id<MUKContent> _Nullable (^MUKContentGetter)(void);

/*
 Helper typedef for MUKContentMiddleware definition.

 Snippet:
 ^(MUKContentDispatcher next) {
     return ^(id<MUKContentDispatchable> dispatchableObject) {
         <#code#>
     };
 };
 */
typedef MUKContentDispatcher _Nonnull (^MUKContentMiddlewareBlock)(MUKContentDispatcher _Nonnull next);
/**
 Middleware provides a third-party extension point between dispatching an action,
 and the moment it reaches the reducer. People use middleware for logging,
 crash reporting, talking to an asynchronous API, routing, and more.
 Middleware is an object which returns a block which returns a dispatcher. This
 dispatcher has access to current state (via `getter` parameter), may dispatch
 other actions (via `dispatcher` parameter) and it is encouraged to chain with
 other dispatchers (via `next` parameter).
 */
@protocol MUKContentMiddleware <NSObject>
@required
- (MUKContentMiddlewareBlock)blockForDispatcher:(nullable MUKContentDispatcher)dispatcher getter:(MUKContentGetter)getter;
@end

NS_ASSUME_NONNULL_END


text:
// Copyright (c) 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview Login UI based on a stripped down OOBE controller.
 */

// <include src="login_shared.js">

/**
 * Asynchronously loads the pin keyboard.
 */
function showPinKeyboardAsync() {
  'use strict';

  // This function could get called multiple times. Do nothing if we have
  // already loaded. This check needs to happen before the registerAssets call,
  // because that will clobber the loaded state.
  if (cr.ui.login.ResourceLoader.hasDeferredAssets('custom-elements'))
    return;

  // Register loader for custom elements.
  cr.ui.login.ResourceLoader.registerAssets({
    id: 'custom-elements',
    html: [{ url: 'chrome://oobe/custom_elements.html' }]
  });

  // Called after polymer has been loaded. Fades the pin element in.
  var onPinLoaded = function(pinKeyboard) {
    var podRow = $('pod-row');
    podRow.toggleTransitions(true);
    podRow.setFocusedPodPinVisibility(true);
  };

  // The element we want to see if loaded.
  var getPinKeyboard = function() {
    return $('pod-row').querySelectorAll('pin-keyboard')[0];
  };

  // We only load the PIN element when it is actually shown so that lock screen
  // load times remain low when the user is not using a PIN.
  //
  // Loading the PIN element blocks the DOM, which will interrupt any running
  // animations. We load the PIN after an idle notification to allow the pod
  // fly-in animation to complete without interruption.
  cr.ui.login.ResourceLoader.loadAssetsOnIdle('custom-elements', function() {
    cr.ui.login.ResourceLoader.waitUntilLayoutComplete(getPinKeyboard,
                                                       onPinLoaded);
  });
}

cr.define('cr.ui.Oobe', function() {
  return {
    /**
     * Initializes the OOBE flow.  This will cause all C++ handlers to
     * be invoked to do final setup.
     */
    initialize: function() {
      cr.ui.login.DisplayManager.initialize();
      login.AccountPickerScreen.register();

      cr.ui.Bubble.decorate($('bubble'));
      login.HeaderBar.decorate($('login-header-bar'));

      chrome.send('screenStateInitialize');
    },

    /**
     * Notification from the host that the PIN keyboard will be used in the
     * lock session so it should also get preloaded.
     */
    preloadPinKeyboard: function() {
      showPinKeyboardAsync();
    },

    // Dummy Oobe functions not present with stripped login UI.
    initializeA11yMenu: function(e) {},
    handleAccessibilityLinkClick: function(e) {},
    handleSpokenFeedbackClick: function(e) {},
    handleHighContrastClick: function(e) {},
    handleScreenMagnifierClick: function(e) {},
    setUsageStats: function(checked) {},
    setOemEulaUrl: function(oemEulaUrl) {},
    setTpmPassword: function(password) {},
    refreshA11yInfo: function(data) {},

    /**
     * Reloads content of the page.
     * @param {!Object} data New dictionary with i18n values.
     */
    reloadContent: function(data) {
      loadTimeData.overrideValues(data);
      i18nTemplate.process(document, loadTimeData);
      Oobe.getInstance().updateLocalizedContent_();
    },
  };
});


text:
package net.ceedubs.scrutinator

import shapeless._
import scalaz._

object RequestBinding {

  def fieldBinder[L <: HList](fields: L)(implicit binder: FieldBinder[L, Request]): Kleisli[ErrorsOr, Request, binder.R] =
    binder(fields).
    local((req: Request) => (Nil, req)).
    mapK[ErrorsOr, binder.R](_.disjunction)

}


text:
The latest support policy for ESP-IDF can be found at [https://github.com/espressif/esp-idf/blob/master/SUPPORT_POLICY.md](https://github.com/espressif/esp-idf/blob/master/SUPPORT_POLICY.md)

Support Period Policy
=====================

* [中文版](./SUPPORT_POLICY_CN.md)

Each ESP-IDF major and minor release (V4.1, V4.2, etc) is supported for 30 months after the initial stable release date.

Supported means that the ESP-IDF team will continue to apply bug fixes, security fixes, etc to the release branch on GitHub, and periodically make new bugfix releases as needed.

Support period is divided into "Service" and "Maintenance" period:

| Period      | Duration     | Recommended for new projects?         |
| -------     | ------------ | ------------------------------------- |
| Service     | 12 months    | Yes                                   |
| Maintenance | 18 months    | No                                    |

During the Service period, bugfixes releases are more frequent. In some cases, support for new features may be added during the Service period (this is reserved for features which are needed to meet particular regulatory requirements or standards for new products, and which carry a very low risk of introducing regressions.)

During the Maintenance period, the version is still supported but only bugfixes for high severity issues or security issues will be applied.

Using an "In Service" version is recommended when starting a new project.

Users are encouraged to upgrade all projects to a newer ESP-IDF release before the support period finishes and the release becomes End of Life (EOL). It is our policy to not continue fixing bugs in End of Life releases.

Pre-release versions (betas, previews, `-rc` and `-dev` versions, etc) are not covered by any support period. Sometimes a particular feature is marked as "Preview" in a release, which means it is also not covered by the support period.

ESP-IDF should be used in an up-to-date software environment. The operating system and other third-party tools should be supported by their maintainers. ESP-IDF cannot keep compatibility with unsupported third-party tools.

The ESP-IDF Programming Guide has information about the [different versions of ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/latest/versions.html) (major, minor, bugfix, etc).

Example
-------

ESP-IDF V3.3 was released in September 2019. It was supported for 30 months until February 2022.

- The first V3.3 release was `v3.3` in September 2019.
- The ESP-IDF team continues to backport bug fixes, security fixes, etc to the release branch `release/v3.3`.
- Periodically stable bugfix releases are created from the release branch. For example `v3.3.1`, `v3.3.2`, etc. Users are encouraged to always update to the latest bugfix release.
- V3.3 bugfix releases continue until February 2022, when all V3.3.x releases become End of Life.

Existing Releases
-----------------

ESP-IDF release V4.1 and all newer releases will follow this support period policy. The support period for each release will be announced when the release is made.

For releases made before the current support period policy was announced, the original support periods apply:

* ESP-IDF V4.0.x will be supported until October 2021
* ESP-IDF V3.3.x will be supported until February 2022
* ESP-IDF versions before V3.3 are already End of Life.

Policy History
--------------

* September 2019. This policy splits ESP-IDF releases into Standard and Long Term Support.
* July 2020. All releases from now will have the same support period, which is equal to the previous Long Term Support period. Added "In Service" period, during which versions will receive more updates.


text:
/*eslint-env mocha*/
/*global define,run*/

const assert = require('assert');
const path = require('path');
const glob = require('glob');
const jsdom = require('jsdom-no-contextify');
const TEST_GLOB = '**/test/**/*.test.js';
const coverage = require('../coverage');

const optimist = require('optimist')
	.usage('Run the Code tests. All mocha options apply.')
	.describe('build', 'Run from out-build').boolean('build')
	.describe('run', 'Run a single file').string('run')
	.describe('coverage', 'Generate a coverage report').boolean('coverage')
	.describe('browser', 'Run tests in a browser').boolean('browser')
	.alias('h', 'help').boolean('h')
	.describe('h', 'Show help');

const argv = optimist.argv;

if (argv.help) {
	optimist.showHelp();
	process.exit(1);
}

const REPO_ROOT = path.join(__dirname, '../../../');
const out = argv.build ? 'out-build' : 'out';
const loader = require(`../../../${out}/vs/loader`);
const src = path.join(REPO_ROOT, out);

function main() {
	process.on('uncaughtException', function (e) {
		console.error(e.stack || e);
	});

	const loaderConfig = {
		nodeRequire: require,
		nodeMain: __filename,
		baseUrl: path.join(REPO_ROOT, 'src'),
		paths: {
			'vs/css': '../test/unit/node/css.mock',
			'vs': `../${out}/vs`,
			'lib': `../${out}/lib`,
			'bootstrap-fork': `../${out}/bootstrap-fork`
		},
		catchError: true
	};

	if (argv.coverage) {
		coverage.initialize(loaderConfig);

		process.on('exit', function (code) {
			if (code !== 0) {
				return;
			}
			coverage.createReport(argv.run || argv.runGlob);
		});
	}

	loader.config(loaderConfig);

	global.define = loader;
	global.document = jsdom.jsdom('<!doctype html>');
	global.self = global.window = global.document.parentWindow;

	global.Element = global.window.Element;
	global.HTMLElement = global.window.HTMLElement;
	global.Node = global.window.Node;
	global.navigator = global.window.navigator;
	global.XMLHttpRequest = global.window.XMLHttpRequest;

	let didErr = false;
	const write = process.stderr.write;
	process.stderr.write = function (data) {
		didErr = didErr || !!data;
		write.apply(process.stderr, arguments);
	};

	let loadFunc = null;

	if (argv.runGlob) {
		loadFunc = (cb) => {
			const doRun = tests => {
				const modulesToLoad = tests.map(test => {
					if (path.isAbsolute(test)) {
						test = path.relative(src, path.resolve(test));
					}

					return test.replace(/(\.js)|(\.d\.ts)|(\.js\.map)$/, '');
				});
				define(modulesToLoad, () => cb(null), cb);
			};

			glob(argv.runGlob, { cwd: src }, function (err, files) { doRun(files); });
		};
	} else if (argv.run) {
		const tests = (typeof argv.run === 'string') ? [argv.run] : argv.run;
		const modulesToLoad = tests.map(function (test) {
			test = test.replace(/^src/, 'out');
			test = test.replace(/\.ts$/, '.js');
			return path.relative(src, path.resolve(test)).replace(/(\.js)|(\.js\.map)$/, '').replace(/\\/g, '/');
		});
		loadFunc = (cb) => {
			define(modulesToLoad, () => cb(null), cb);
		};
	} else {
		loadFunc = (cb) => {
			glob(TEST_GLOB, { cwd: src }, function (err, files) {
				const modulesToLoad = files.map(function (file) {
					return file.replace(/\.js$/, '');
				});
				define(modulesToLoad, function () { cb(null); }, cb);
			});
		};
	}

	loadFunc(function (err) {
		if (err) {
			console.error(err);
			return process.exit(1);
		}

		process.stderr.write = write;

		if (!argv.run && !argv.runGlob) {
			// set up last test
			suite('Loader', function () {
				test('should not explode while loading', function () {
					assert.ok(!didErr, 'should not explode while loading');
				});
			});
		}

		// report failing test for every unexpected error during any of the tests
		let unexpectedErrors = [];
		suite('Errors', function () {
			test('should not have unexpected errors in tests', function () {
				if (unexpectedErrors.length) {
					unexpectedErrors.forEach(function (stack) {
						console.error('');
						console.error(stack);
					});

					assert.ok(false);
				}
			});
		});

		// replace the default unexpected error handler to be useful during tests
		loader(['vs/base/common/errors'], function (errors) {
			errors.setUnexpectedErrorHandler(function (err) {
				const stack = (err && err.stack) || (new Error().stack);
				unexpectedErrors.push((err && err.message ? err.message : err) + '\n' + stack);
			});

			// fire up mocha
			run();
		});
	});
}

if (process.argv.some(function (a) { return /^--browser/.test(a); })) {
	require('./browser');
} else {
	main();
}


text:
require 'spec_helper'

describe Adapt::Service do
  let(:credentials) do
    {
      :username => 'seller_1278210365_biz_api1.devoh.com',
      :password => '5RBB95ZTBDSR4MR2',
      :signature => 'A43UhUJ8Gsn-ptbpWEBRSvVxMZykA87EqndzoFCipFmz6cN2zycGoDjk',
      :ip => '127.0.0.1',
      :application_id => 'APP-80W284485P519543T',
    }
  end

  let(:headers) do
    {
      'X-PAYPAL-SECURITY-USERID' => 'seller_1278210365_biz_api1.devoh.com',
      'X-PAYPAL-SECURITY-PASSWORD' => '5RBB95ZTBDSR4MR2',
      'X-PAYPAL-SECURITY-SIGNATURE' => 'A43UhUJ8Gsn-ptbpWEBRSvVxMZykA87EqndzoFCipFmz6cN2zycGoDjk',
      'X-PAYPAL-DEVICE-IPADDRESS' => '127.0.0.1',
      'X-PAYPAL-REQUEST-DATA-FORMAT' => 'JSON',
      'X-PAYPAL-RESPONSE-DATA-FORMAT' => 'JSON',
      'X-PAYPAL-APPLICATION-ID' => 'APP-80W284485P519543T'
    }
  end

  let(:service) { Adapt::Service.new(credentials) }

  it "can be initialized with credentials" do
    Adapt::Service.new(credentials)
  end

  context "#headers" do
    it "returns a hash with the default headers" do
      service.headers.should == headers
    end

    it "includes the subject if one is set in the credentials" do
      service = Adapt::Service.new(
        credentials.merge(:subject => 'api@example.com')
      )

      service.headers.should == headers.merge(
        'X-PAYPAL-SUBJECT' => 'api@example.com'
      )
    end

    it "includes the device ID if one is set in the credentials" do
      service = Adapt::Service.new(
        credentials.merge(:device => '35-209900-176148-1')
      )

      service.headers.should == headers.merge(
        'X-PAYPAL-DEVICE-ID' => '35-209900-176148-1'
      )
    end

    it "includes the service version if one is set in the credentials" do
      service = Adapt::Service.new(credentials.merge(:version => '56.0'))

      service.headers.should == headers.merge(
        'X-PAYPAL-SERVICE-VERSION' => '56.0'
      )
    end
  end

  context "#endpoint" do
    context "in the default environment" do
      it "returns a sandbox endpoint URI for the specified method" do
        service.environment = nil
        service.endpoint('Pay').should == URI.parse('https://svcs.sandbox.paypal.com/AdaptivePayments/Pay')
      end
    end

    context "in the sandbox environment" do
      it "returns a sandbox endpoint URI for the specified method" do
        service.environment = :sandbox
        service.endpoint('Pay').should == URI.parse('https://svcs.sandbox.paypal.com/AdaptivePayments/Pay')
      end
    end

    context "in the beta environment" do
      it "returns a beta endpoint URI for the specified method" do
        service.environment = :beta
        service.endpoint('Pay').should == URI.parse('https://svcs.beta-sandbox.paypal.com/AdaptivePayments/Pay')
      end
    end

    context "in the live environment" do
      it "returns a live endpoint URI for the specified method" do
        service.environment = :live
        service.endpoint('Pay').should == URI.parse('https://svcs.paypal.com/AdaptivePayments/Pay')
      end
    end

    it "raises an error if no method is specified" do
      expect { service.endpoint }.to raise_error(ArgumentError)
    end

    it "raises an error if an invalid method is specified" do
      expect { service.endpoint('Barter') }.to raise_error(ArgumentError, /invalid method/i)
    end
  end

  context "#request" do
    let(:session) { Patron::Session.new }
    let(:request) { Adapt::Methods::ConvertCurrency::Request.new }

    before(:each) do
      session.stub!(:post)
      Patron::Session.stub!(:new).and_return(session)
    end

    after(:each) do
      service.request('ConvertCurrency', request)
    end

    it "sets the request timeout to 10 seconds" do
      session.should_receive(:timeout=).with(10)
    end

    it "disables SSL certificate verification" do
      session.should_receive(:insecure=).with(true)
    end

    it "uses the specified method to build the endpoint URI for the request" do
      session.should_receive(:base_url=).with('https://svcs.sandbox.paypal.com:443')
    end

    it "issues a POST request" do
      session.should_receive(:post)
    end

    it "uses the path from the endpoint URI" do
      path = '/AdaptivePayments/ConvertCurrency'
      session.should_receive(:post).with(path, anything, anything)
    end

    it "uses the JSON form of the request object as the request body" do
      json = '{"format":"json"}'
      request.stub!(:to_json).and_return(json)
      session.should_receive(:post).with(anything, json, anything)
    end

    it "uses the headers" do
      session.should_receive(:post).with(anything, anything, headers)
    end
  end
end