text:
//
//  MYTabBar.m
//  仿写腾讯新闻tabBar拖动效果
//
//  Created by 塔利班 on 15/6/12.
//  Copyright (c) 2015年 联创智融. All rights reserved.
//

#import "MYTabBar.h"
#import "MYTabBarButton.h"

// 系统item的默认title前缀
NSString *const systemItemTitlePrefix = @"Item";

// 按钮不同状态的key
NSString *const stateNormal = @"UIControlStateNormal";
NSString *const stateHighlighted = @"UIControlStateHighlighted";
NSString *const stateDisabled = @"UIControlStateDisabled";
NSString *const stateSelected = @"UIControlStateSelected";
NSString *const stateApplication = @"UIControlStateApplication";
NSString *const stateReserved = @"UIControlStateReserved";

// 归位的动画时间
static const CGFloat kAnimationDuration = 0.2;

// 用来保存自身的item数组
static NSArray *instance;

@interface MYTabBar ()
// 自定义tabBarButton数组
@property (nonatomic, strong) NSMutableArray *btns;
// 选中状态的tabBarButton
@property (nonatomic, weak) MYTabBarButton *selectedBtn;
// 上一次的接触点
@property (nonatomic, assign) CGPoint lastTouchPoint;
// 拖拽按钮
@property (nonatomic, weak) UIButton *moveBtn;
// 是否为换位
@property (nonatomic, assign, getter=isChanging) BOOL changing;
// 选中按钮要移动到的frame
@property (nonatomic, assign) CGRect destFrame;
// 按钮属性的字典
@property (nonatomic, strong) NSMutableDictionary *attributes;
@end

@implementation MYTabBar

#pragma mark - LazyLoad

- (NSMutableArray *)btns
{
    if (_btns == nil) {
        _btns = [NSMutableArray array];
    }
    return _btns;
}

- (NSMutableDictionary *)attributes
{
    if (_attributes == nil) {
        _attributes = [NSMutableDictionary dictionary];
    }
    return _attributes;
}

#pragma mark - LifeCircle Method

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 模糊效果
        self.translucent = NO;
        // 背景色
        self.barTintColor = [UIColor whiteColor];
    }
    return self;
}

#pragma mark - System Method

/**
 *  系统传递来所有的item模型
 *
 *  重写方法,添加自己的tabBarButton
 *  @param animated
 */
- (void)setItems:(NSArray *)items animated:(BOOL)animated
{
    // 添加自定义tabBarButton
    for (int i = 0; i < items.count; i++) {
        // item模型
        UITabBarItem *item = items[i];
        item.tag = i;
        if ([item.title hasPrefix:systemItemTitlePrefix]) {
            item.title = nil;
        }
        // 创建tabBarButton
        MYTabBarButton *btn = [MYTabBarButton tabBarButtonWithImageViewTopMargin:self.tabBarButtonImageViewTopMargin titleLabelTopMargin:self.tabBarButtonTitleLableTopMargin];
        // 设置图片
        btn.tag = i;
        [btn setImage:item.image forState:UIControlStateNormal];
        [btn setImage:item.selectedImage forState:UIControlStateSelected];
        [btn setTitle:item.title forState:UIControlStateNormal];
        // 设置titleText
        if (self.attributes[stateNormal]) {
            [btn setTitleColor:self.attributes[stateNormal][NSForegroundColorAttributeName] forState:UIControlStateNormal];
            btn.titleLabel.font = self.attributes[stateNormal][NSFontAttributeName];
        }
        if (self.attributes[stateSelected]) {
            [btn setTitleColor:self.attributes[stateSelected][NSForegroundColorAttributeName] forState:UIControlStateSelected];
        }
        // 添加
        [self addSubview:btn];
        [self.btns addObject:btn];
        // 监听
        [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchDown];
        // 添加长按手势
        UILongPressGestureRecognizer *lp = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
        lp.minimumPressDuration = 1;  // 设置长按时间
        [btn addGestureRecognizer:lp];
    }
    // 因为这个方法调用super会产生系统的tabBarButton,不调用super系统的items数组为nil,所以这样处理
    instance = items;
}

/**
 *  重写item模型数组get \ 保证可以返回获取到的items
 *
 *  @return
 */
- (NSArray *)items
{
    return instance;
}

/**
 *  选中某个自定义tabBarButton
 *
 *  @param selectedItem 自定义tabBarButton对应的item
 */
- (void)setSelectedItem:(UITabBarItem *)selectedItem
{
    // 获取角标
    NSUInteger index = [self.items indexOfObject:selectedItem];

    // 更换按钮
    self.selectedBtn.selected = NO;
    self.selectedBtn.backgroundColor = [UIColor whiteColor];
    UIButton *selectedBtn = self.btns[index];
    selectedBtn.selected = YES;
    selectedBtn.backgroundColor = [UIColor colorWithRed:231/255.0 green:231/255.0 blue:231/255.0 alpha:1];
    self.selectedBtn = (MYTabBarButton *)selectedBtn;
}

#pragma mark - Public Method

+ (instancetype)tabBarWithTabBarButtonImageViewTopMargin:(CGFloat)tabBarButtonImageViewTopMargin tabBarButtonTitleLableTopMargin:(CGFloat)tabBarButtonTitleLableTopMargin
{
    MYTabBar *tabBar = [[self alloc] init];
    tabBar.tabBarButtonImageViewTopMargin = tabBarButtonImageViewTopMargin;
    tabBar.tabBarButtonTitleLableTopMargin = tabBarButtonTitleLableTopMargin;
    return tabBar;
}

/** 设置titleText的属性 */
- (void)setTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state
{
    switch (state) {
        case UIControlStateNormal:
            [self.attributes setObject:attributes forKey:stateNormal];
            break;
        case UIControlStateHighlighted:
            [self.attributes setObject:attributes forKey:stateHighlighted];
            break;
        case UIControlStateDisabled:
            [self.attributes setObject:attributes forKey:stateDisabled];
            break;
        case UIControlStateSelected:
            [self.attributes setObject:attributes forKey:stateSelected];
            break;
        case UIControlStateApplication:
            [self.attributes setObject:attributes forKey:stateApplication];
            break;
        case UIControlStateReserved:
            [self.attributes setObject:attributes forKey:stateReserved];
            break;
        default:
            break;
    }
}

#pragma mark - Private Method

/**
 *  长按手势触发
 *
 *  @param lp 手势
 */
- (void)longPress:(UILongPressGestureRecognizer *)lp
{
    switch (lp.state) {
        case UIGestureRecognizerStateBegan:  // 手势开始
        {
            /* 创建出一个用于拖拽的tabBarButton */
            [self creatMoveBtn:lp];
        }
            break;
            case UIGestureRecognizerStateChanged:  // 开始拖拽
        {
            /** 实现拖拽 */
            CGPoint moveBtnCenter = [self adjustMoveBtnTransform:lp];
            /** 调整自定义tabBarButton的位置 */
            [self adjustTabBarButtonTransform:moveBtnCenter];
        }
            break;

            case UIGestureRecognizerStateEnded:  // 结束拖拽
        {
            // tabBarButton归位
            [UIView animateWithDuration:kAnimationDuration animations:^{
                if (self.isChanging) {
                    self.moveBtn.frame = self.destFrame;
                    self.selectedBtn.frame = [self convertRect:self.destFrame fromView:[UIApplication sharedApplication].keyWindow];
                } else {
                    self.moveBtn.transform = CGAffineTransformIdentity;
                }
            } completion:^(BOOL finished) {
                // 移除拖拽按钮
                [self.moveBtn removeFromSuperview];
                self.moveBtn = nil;
                // 显示tabBarButton
                self.selectedBtn.hidden = NO;
                // 换位完全结束,改变换位状态
                self.changing = NO;
            }];
        }
            default:
            break;
    }
}

/**
 *  创建移动的tabBarButton
 *
 *  @param lp 手势
 */
- (void)creatMoveBtn:(UILongPressGestureRecognizer *)lp
{
    // 真正的tabBarButton
    MYTabBarButton *btn = (MYTabBarButton *)lp.view;
    // 主窗口
    UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
    // 坐标系从tabBarButton上转移到window上
    CGRect rect = [self convertRect:btn.frame toView:keyWindow];
    CGPoint center = [btn convertPoint:btn.touchPoint toView:keyWindow];
    // 创建拖拽按钮
    MYTabBarButton *moveBtn = [MYTabBarButton tabBarButtonWithImageViewTopMargin:btn.imageViewTopMargin titleLabelTopMargin:btn.titleLabelTopMargin];
    moveBtn.selected = YES;
    // 背景色
    moveBtn.backgroundColor = [UIColor whiteColor];
    // 设置titleText属性
    if (self.attributes[stateNormal]) {
        [moveBtn setTitleColor:self.attributes[stateNormal][NSForegroundColorAttributeName] forState:UIControlStateNormal];
        moveBtn.titleLabel.font = self.attributes[stateNormal][NSFontAttributeName];
    }
    if (self.attributes[stateSelected]) {
        [moveBtn setTitleColor:self.attributes[stateSelected][NSForegroundColorAttributeName] forState:UIControlStateSelected];
    }
    // 设置图片 标题 frame  阴影...
    [moveBtn setImage:btn.currentImage forState:UIControlStateSelected];
    [moveBtn setTitle:btn.titleLabel.text forState:UIControlStateSelected];
    moveBtn.frame = rect;
    moveBtn.layer.shadowColor = [UIColor grayColor].CGColor;
    moveBtn.layer.shadowRadius = 7;
    moveBtn.layer.shadowOpacity = 1;
    moveBtn.layer.shadowOffset = CGSizeMake(0, 0.5);
    // 添加
    [keyWindow addSubview:moveBtn];
    self.moveBtn = moveBtn;
    self.lastTouchPoint = btn.touchPoint;
    // 移动按钮动画移动到手指的触碰点
    [UIView animateWithDuration:kAnimationDuration animations:^{
        self.moveBtn.transform = CGAffineTransformMakeTranslation(center.x - self.moveBtn.center.x, center.y - self.moveBtn.center.y);
    } completion:^(BOOL finished) {

    }];
    // 隐藏tabBarButton
    btn.hidden = YES;
}

/**
 *  调整拖拽tabBarButton的transForm  实现拖拽效果
 *
 *  @param lp 手势
 *
 *  @return MoveBtn的中心点
 */
- (CGPoint)adjustMoveBtnTransform:(UILongPressGestureRecognizer *)lp
{
    CGPoint point = [lp locationInView:lp.view];
    self.moveBtn.transform = CGAffineTransformTranslate(self.moveBtn.transform, point.x - self.lastTouchPoint.x, point.y - self.lastTouchPoint.y);
    self.lastTouchPoint = point;

    // 获取蒙板中心点
    CGPoint center = CGPointMake(self.moveBtn.frame.origin.x + self.moveBtn.frame.size.width * 0.5, self.moveBtn.frame.origin.y + self.moveBtn.frame.size.height * 0.5);
    return center;
}

/**
 *  调整自定义tabBarButton的transForm  实现换位效果
 *
 *  @param moveBtnCenter 拖拽tabBarButton的center
 */
- (void)adjustTabBarButtonTransform:(CGPoint)moveBtnCenter
{
    // 正在交换位置中就不需要再次交换了
    if (self.isChanging) return;
    // 当moveBtnCenter在其他的TabBarButton的区域时进行操作
    for (int i = 0; i < self.btns.count; i++) {
        // 取出tabBarButton
        MYTabBarButton *btn = self.btns[i];
        if (btn == self.selectedBtn) continue; // 选中的按钮排除在外
        // 获取tabBarButton在window中的frame
        CGRect btnFrame = [self convertRect:btn.frame toView:[UIApplication sharedApplication].keyWindow];
        // 当中间进入某个tabBarButton的区域时调整tabBarButton的位置,并且停止遍历
        if (CGRectContainsPoint(btnFrame, moveBtnCenter)) {
            self.destFrame = [self convertRect:btn.frame toView:[UIApplication sharedApplication].keyWindow];
            [self changeTabBarButtonPosition:btn];
            break;
        }
    }
}

- (void)changeTabBarButtonPosition:(MYTabBarButton *)btn
{
    // 已知选中按钮
    // 已知被选中区域的按钮
    // 两个按钮比较index
    // 如果选中按钮index小于区域按钮index  区域按钮左侧按钮全部左移
    // 如果选中按钮index大于区域按钮index  区域按钮右侧按钮全部右移
    self.changing = YES;
    NSUInteger currentIndex = self.selectedBtn.tag;
    NSUInteger index = btn.tag;
    NSInteger destTag = btn.tag;
    __block NSArray *moveBtns;
    if (currentIndex < index) {  // 集体左移
        [UIView animateWithDuration:kAnimationDuration animations:^{
            moveBtns = [self leftTabBarButtons:btn];
            [moveBtns enumerateObjectsUsingBlock:^(MYTabBarButton *btn, NSUInteger idx, BOOL *stop) {
                CGRect tempFrame = btn.frame;
                tempFrame.origin.x -= tempFrame.size.width;
                btn.frame = tempFrame;
            }];
        } completion:^(BOOL finished) {
            self.selectedBtn.tag = destTag;
            [moveBtns enumerateObjectsUsingBlock:^(MYTabBarButton *btn, NSUInteger idx, BOOL *stop) {
                btn.tag -= 1;
            }];
        }];
    } else {  // 集体右移
        [UIView animateWithDuration:kAnimationDuration animations:^{
            moveBtns = [self rightTabBarButtons:btn];
            [moveBtns enumerateObjectsUsingBlock:^(MYTabBarButton *btn, NSUInteger idx, BOOL *stop) {
                CGRect tempFrame = btn.frame;
                tempFrame.origin.x += tempFrame.size.width;
                btn.frame = tempFrame;
            }];
        } completion:^(BOOL finished) {
            self.selectedBtn.tag = destTag;
            [moveBtns enumerateObjectsUsingBlock:^(MYTabBarButton *btn, NSUInteger idx, BOOL *stop) {
                btn.tag += 1;
            }];
        }];
    }
}

/**
 *  左移时,获取所有要移动的按钮
 *
 *  @param btn 需要移动到的目标按钮
 *
 *  @return
 */
- (NSArray *)leftTabBarButtons:(MYTabBarButton *)btn
{
    NSMutableArray *moveBtns = [NSMutableArray array];
    [self.btns enumerateObjectsUsingBlock:^(MYTabBarButton *tabBarButton, NSUInteger idx, BOOL *stop) {
        if (tabBarButton.tag > self.selectedBtn.tag && tabBarButton.tag <= btn.tag) {
            [moveBtns addObject:tabBarButton];
        }
    }];
    return moveBtns;
}

/**
 *  右移时,获取所有要移动的按钮
 *
 *  @param btn 需要移动到的目标按钮
 *
 *  @return
 */
- (NSArray *)rightTabBarButtons:(MYTabBarButton *)btn
{
    NSMutableArray *moveBtns = [NSMutableArray array];
    [self.btns enumerateObjectsUsingBlock:^(MYTabBarButton *tabBarButton, NSUInteger idx, BOOL *stop) {
        if (tabBarButton.tag < self.selectedBtn.tag && tabBarButton.tag >= btn.tag) {
            [moveBtns addObject:tabBarButton];
        }
    }];
    return moveBtns;
}

/**
 *  自定义tabBarButton点击
 *
 *  @param btn 自定义tabBarButton
 */
- (void)btnClick:(UIButton *)btn
{
    // 获取角标
    NSUInteger index = [self.btns indexOfObject:btn];

    // 获取对应item
    UITabBarItem *item = self.items[index];

    // 切换控制器
    if ([self.delegate respondsToSelector:@selector(tabBar:didSelectItem:)]) {
        [self.delegate tabBar:self didSelectItem:item];
    }
}

#pragma mark - Layout

- (void)layoutSubviews
{
    [super layoutSubviews];

    if (!self.btns.count) return;
    CGFloat width = self.bounds.size.width / self.btns.count;
    CGFloat height = self.bounds.size.height;
    CGFloat y = 0;
    CGFloat x;
    for (int i = 0; i < self.btns.count; i++) {
        MYTabBarButton *btn = self.btns[i];
        x = i * width;
        CGRect frame = CGRectMake(x, y, width, height);
        [btn setFrame:frame];
    }
}

@end


text:
require 'spec_helper'

describe RuboCop::Cop::Performance::RangeInclude do
  subject(:cop) { described_class.new }

  it 'autocorrects (a..b).include? without parens' do
    new_source = autocorrect_source(cop, '(a..b).include? 1')
    expect(new_source).to eq '(a..b).cover? 1'
  end

  it 'autocorrects (a...b).include? without parens' do
    new_source = autocorrect_source(cop, '(a...b).include? 1')
    expect(new_source).to eq '(a...b).cover? 1'
  end

  it 'autocorrects (a..b).include? with parens' do
    new_source = autocorrect_source(cop, '(a..b).include?(1)')
    expect(new_source).to eq '(a..b).cover?(1)'
  end

  it 'autocorrects (a...b).include? with parens' do
    new_source = autocorrect_source(cop, '(a...b).include?(1)')
    expect(new_source).to eq '(a...b).cover?(1)'
  end

  it 'formats the error message correctly for (a..b).include? 1' do
    inspect_source(cop, '(a..b).include? 1')
    expect(cop.messages).to eq(
      ['Use `Range#cover?` instead of `Range#include?`.']
    )
  end
end

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Created by PhpStorm.
 * User: Alexandre Jaunasse
 * Date: 17/04/2016
 * Time: 22:30
 */

namespace Ecommerce\EcommerceBundle\Twig\Extention;

class TvaAmount extends \Twig_Extension
{
    /**
     * @return array
     */
    public function getFilters(){
        return array(new \Twig_SimpleFilter('amountTva', array($this,'amountTva'))) ;
    }

    /**
     * @param $priceHT
     * @param $multiTva
     * @return mixed
     */
    public function amountTva($priceHT, $multiTva){
        return round(($priceHT * $multiTva) - $priceHT,2) ;
    }
    /**
     *
     */
    public function getName()
    {
        return 'amoutTva_extension' ;
    }

}


text:
using System;
using Moq;
using Newtonsoft.Json;
using UnixTimeConverter.Test.Helpers;
using Xunit;

namespace JsonNetConverters.Test
{
    public class ReadJsonTest
    {
        [Fact]
        public void WriteJson_InvalidTokenType_ExceptionThrown()
        {
            //Arrange
            var unixTimeConverter = new UnixTime.UnixTimeConverter();
            var jsonReaderMock = new Mock<JsonReader>();
            jsonReaderMock.SetupGet(x => x.TokenType).Returns(JsonToken.Boolean);

            //Act
            var ex = Assert.Throws<ArgumentException>(
                () => unixTimeConverter.ReadJson(jsonReaderMock.Object, null, false, null));

            //Assert
            Assert.Equal("Unexpected token. Integer or String was expected, got Boolean", ex.Message);
        }

        [Fact]
        public void WriteJson_InvalidString_ExceptionThrown()
        {
            //Arrange
            var unixTimeConverter = new UnixTime.UnixTimeConverter();
            var jsonReaderMock = new Mock<JsonReader>();
            jsonReaderMock.SetupGet(x => x.TokenType).Returns(JsonToken.String);
            jsonReaderMock.SetupGet(x => x.Value).Returns("wrongInput");

            //Act
            var ex = Assert.Throws<ArgumentException>(
                () => unixTimeConverter.ReadJson(jsonReaderMock.Object, null, false, null));

            //Assert
            Assert.Equal("wrongInput isn't a number", ex.Message);
        }

        [Theory]
        [ClassData(typeof(DataHelper))]
        public void WriteJson_ValidPositiveInput_Success(JsonToken jsonTokenType, object input, DateTime expectedResult)
        {
            //Arrange
            var unixTimeConverter = new UnixTime.UnixTimeConverter();
            var jsonReaderMock = new Mock<JsonReader>();
            jsonReaderMock.SetupGet(x => x.TokenType).Returns(jsonTokenType);
            jsonReaderMock.SetupGet(x => x.Value).Returns(input);

            //Act
            var result = unixTimeConverter.ReadJson(jsonReaderMock.Object, null, false, null);

            //Assert
            Assert.Equal(expectedResult, result);
        }
    }
}


text:
wordpress_id: 300
title: "Charity Ball"
wordpress_url: http://spaetzel.com/PermaLink,guid,387.aspx
layout: post
---
Charity Ball

        Well I had a blast last night at the charity ball. There was lots and lots of standing
        in line, but when you shove that many people all into a room these things are going
        to happen. Just need to have some patience.

        I casn see that the USC really put a lot of work into the event, and I'm glad that
        my money has gone off to a couple good causes (The London Humane Society, and the
        Alhzeimer's society)

        Anyhow, if you want to see the pics from the night, click here


text:
package org.apache.apex.malhar.lib.db.jdbc;

import org.apache.apex.malhar.lib.util.FieldInfo;

/**
 * A {@link FieldInfo} object for Jdbc.

 * Includes an SQL type for each field.

 * An {@link FieldInfo} object used for JDBC output sources must have the SQL data types.
 * This is needed to create correct getters and setters for the POJO,
 * as well as setting the right parameter types in the JDBC prepared statement.
 *
 * @since 3.5.0
 */
public class JdbcFieldInfo extends FieldInfo
{
  private int sqlType;

  public JdbcFieldInfo()
  {
  }

  public JdbcFieldInfo(String columnName, String pojoFieldExpression, SupportType type, int sqlType)
  {
    super(columnName, pojoFieldExpression, type);

    this.sqlType = sqlType;
  }

  public int getSqlType()
  {
    return sqlType;
  }

  /**
   * Set the sql data type for this {@link JdbcFieldInfo}
   * @param sqlType
   */
  public void setSqlType(int sqlType)
  {
    this.sqlType = sqlType;
  }
}


text:
package ecommerce.Model.Dao;

import ecommerce.Model.Bean.Pagamento;
import java.sql.SQLException;

/**
 *
 * @author sibele.nsantos
 */
public interface PagamentoDAO {
    public Pagamento BuscarFormaPagamento(int cod_pagamento) throws SQLException ;
}


text:
package com.github.dakusui.crest.examples;

import com.github.dakusui.crest.utils.TestBase;
import org.junit.Test;
import org.junit.runner.JUnitCore;
import org.junit.runner.Request;
import org.junit.runner.Result;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.TestClass;

import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;

import static org.junit.Assert.assertEquals;

public class ExamplesTest extends TestBase {
  @Test
  public void bankAccount() {
    Class<?> exampleClass = BankAccount.class;
    verifyExample(exampleClass);
  }

  @Test
  public void simpleExample() {
    Class<?> exampleClass = SimpleExamples.class;
    verifyExample(exampleClass);
  }

  @Test
  public void inThincrest() {
    Class<?> exampleClass = InThincrest.class;
    verifyExample(exampleClass);
  }

  @Test
  public void comparableExample$Byte() {
    verifyExample(ComparablesExample.ByteExample.class);
  }

  @Test
  public void comparableExample$Char() {
    verifyExample(ComparablesExample.CharExample.class);
  }

  @Test
  public void comparableExample$Short() {
    verifyExample(ComparablesExample.ShortExample.class);
  }

  @Test
  public void comparableExample$Integer() {
    verifyExample(ComparablesExample.IntegerExample.class);
  }

  @Test
  public void comparableExample$Long() {
    verifyExample(ComparablesExample.LongExample.class);
  }

  @Test
  public void comparableExample$Float() {
    verifyExample(ComparablesExample.FloatExample.class);
  }

  @Test
  public void comparableExample$Double() {
    verifyExample(ComparablesExample.DoubleExample.class);
  }

  private void verifyExample(Class<?> javaTestClass) {
    List<String> expectation = new LinkedList<>();
    List<String> actualResult = new LinkedList<>();

    JUnitCore jUnitCore = new JUnitCore();
    TestClass testClass = new TestClass(javaTestClass);
    for (FrameworkMethod m : testClass.getAnnotatedMethods(Test.class).stream().sorted(Comparator.comparing(FrameworkMethod::getName)).collect(Collectors.toList())) {
      Request request = Request.method(testClass.getJavaClass(), m.getName());
      Result result = jUnitCore.run(request);
      expectation.add(String.format("%s: %d: %s", formatResult(shouldPass(m.getName())), 1, m.getName()));
      actualResult.add(String.format("%s: %d: %s", formatResult(result.wasSuccessful()), result.getRunCount(), m.getName()));
    }

    assertEquals(
        String.join("\n", expectation),
        String.join("\n", actualResult)
    );
  }

  private static String formatResult(boolean wasSuccessful) {
    return wasSuccessful ? "PASS" : "FAIL";
  }

  private static boolean shouldPass(String methodName) {
    if (methodName.endsWith("thenPass"))
      return true;
    if (methodName.endsWith("thenFail"))
      return false;
    throw new IllegalArgumentException(methodName);
  }
}


text: Cool Weather Test


text:
import {generateActions} from 'action-u';
import _bootstrap        from './featureName';

export default generateActions.root({
                   // prefix all actions with our feature name, guaranteeing they unique app-wide!
  [_bootstrap]: { // actions(): Action ... the root IS an action (e.g. bootstrap() action)
                   // > start boostrap initialization process
                   actionMeta: {},

    setStatus: { // actions.setStatus(statusMsg): Action
                 // > set bootstrap status (e.g. 'Waiting for bla bla bla' -or- 'COMPLETE'
                 actionMeta: {
                   traits: ['statusMsg'],
                 },
    },

    // the fundamental action that indicates the bootstrap process is complete
    // ... monitored by down-stream features (to start the app running),
    complete: { // actions.complete(): Action
                // > bootstrap is complete and app is ready to start
                actionMeta: {},
    },
  },
});


text:
'use strict';

 angular.module("config", [])

.constant("ENV", {
  "apiEndpoint": "/employee/v1/"
})

angular.module('employee.services', []);
angular.module('employee.controllers', ['employee.services']);
angular.module('employee', ['ionic', 'config', 'employee.controllers',
  'employee.services', 'ngMessages', 'LocalStorageModule', 'ngResource'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if(window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
    }
  });
})

.config(function($stateProvider, $urlRouterProvider) {
  $stateProvider
    .state('home', {
      url: '/home',
      templateUrl: '/templates/employee/home.html',
      controller: 'HomeCtrl'
    })
    .state('rank', {
      url: '/rank',
      templateUrl: '/templates/employee/rank.html',
      controller: 'RankCtrl'
    })
    .state('spread', {
      url: '/spread',
      templateUrl: '/templates/employee/spread.html',
      controller: 'RankCtrl'
    })
    .state('login', {
      url: '/login',
      templateUrl: '/templates/employee/login.html',
      controller: 'LoginCtrl'
    });
     $urlRouterProvider.otherwise('/login');
})
.run(function ($rootScope, $state, $window, localStorageService) {
  var isLogin = localStorageService.get('isLogin');
  if(isLogin){
    $rootScope.isLogin = true;
    $rootScope.currentUser = localStorageService.get('currentUser');
  }else{
    $rootScope.isLogin = false;
    $rootScope.currentUser = {};
  }

  $rootScope.login = function(user){
    localStorageService.set('isLogin', true);
    localStorageService.set('currentUser', user);
    $rootScope.isLogin = true;
    $rootScope.currentUser = user;
    $state.go('home');
  }

  $rootScope.logout = function(user){
    localStorageService.set('isLogin', false);
    localStorageService.set('currentUser', null);
    $rootScope.isLogin = false;
    $rootScope.currentUser = null;
    $state.go('login');
  }

  $rootScope.checkLogin = function(){
    if(!$rootScope.isLogin){
      $state.go('login');
    }
  }
})

// services
angular.module('employee.services')

.factory('Account', function($resource, ENV) {
  return $resource(ENV.apiEndpoint + 'accounts', {}, {
    login: {
      url: ENV.apiEndpoint + 'accounts/login',
      method:'POST',
    }
  });
})
.factory('Employee', function($rootScope, $resource, ENV) {
  return $resource(ENV.apiEndpoint + 'employee', {}, {
    query: {params: {'access-token': $rootScope.currentUser.token}, isArray: true}
  });
});

// controllers
angular.module('employee.controllers')

.controller('LoginCtrl', function($rootScope, $scope, $state, $ionicPopup, Account) {
  $scope.user = {};
  // if($rootScope.isLogin){
  //   $rootScope.login($rootScope.currentUser);
  // }
  $scope.login = function(form){
    if(form.$valid){
        Account.login($scope.user, function(data){
          if(data.code===0){
            $rootScope.login(data.data);
          }else{
            $ionicPopup.alert({
              title: '登录失败',
              template: data.msg
            })
          }
        });
    }
  }
})
.controller('HomeCtrl', function() {
})
.controller('RankCtrl', function($scope, $state, Employee) {
  $scope.employees = [];
  $scope.page = 0;
  $scope.haveMore = true;
  $scope.pageSize = 10;

  $scope.listByPage = function(clear){
    return Employee.query({page: $scope.page, pageSize: $scope.pageSize}, function(result){
      var data = result;
      if(data.length==$scope.pageSize){
        $scope.haveMore = true;
        $scope.page = $scope.page + 1;
      }else{
        $scope.haveMore = false;
      }
      if(clear){
        $scope.employees = data;
      }else{
        $scope.employees = $scope.employees.concat(data);
      }

      $scope.$broadcast('scroll.infiniteScrollComplete');
    })
  };

  $scope.loadMore = function(){
      if($scope.haveMore){
        $scope.listByPage(false);
    }
  }

  $scope.refreshData = function(){
    $scope.page = 0;
    $scope.listByPage(true);
  }
})
.controller('SpreadCtrl', function() {
});


text:
layout: post
microblog: true
date: 2017-10-10 21:38 +0300
guid: http://desparoz.micro.blog/2017/10/10/pixelmator-for-ios.html
---
Pixelmator 2.4 for iOS is released.

With support for drag and drop, Pixelmator maintains its position as one of the best choice for photo editing on iPad.


text:
'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');
var path = require('path');
var mkdirp = require('mkdirp');
var _ = require('lodash');

module.exports = yeoman.Base.extend({
  prompting: function () {
    this.log(yosay(
      'Welcome to the ' + chalk.red('generator-nlife') + ' generator!'
    ));

    var prompts = [{
      type: 'inut',
      name: 'projName',
      message: '请输入新页面所属项目I(如:purchase):'
    }, {
      type: 'inut',
      name: 'pageName',
      message: '请输入新页面名称II(如:nlife_onlinepurchase):'
    }, {
      type: 'confirm',
      name: 'isCreateNewPage',
      message: '确定要创建新页面III(y/n)?',
      default: true
    }];

    return this.prompt(prompts).then(function (props) {
      this.props = props;
    }.bind(this));
  },

  defaults: function () {
    this.basePath = path.join(this.destinationRoot(), './app/front_ent/app/');
    this.projName = path.basename(this.destinationRoot());

    if (this.projName.indexOf('nlife') < 0 && this.projName.indexOf('feb') < 0) {
      this.log(chalk.yellow('WARN:') + ' 请确认是在nlife-feb工程根目录下执行当前命令!');
    }
  },

  writing: function () {
    this.log('INFO: 正在执行创建...');
    this.log('INFO: 创建完成!');
    var app = _.template(this.fs.read(this.templatePath('./htmls/pcweb/pageapp.js')));
    var entry = _.template(this.fs.read(this.templatePath('./htmls/pcweb/page.js')));
    var scss = _.template(this.fs.read(this.templatePath('./htmls/pcweb/page.scss')));
    // var html = _.template(this.fs.read(this.templatePath('./htmls/pcweb/page.html')));
    var name = this.props.pageName.substring(0, 1).toUpperCase() + this.props.pageName.substring(1);

    this.fs.write(this.destinationPath('./app/front_end/app/components/' + this.props.pageName + '/app.js'), app({
      projName: this.props.projName,
      appname: this.props.pageName,
      pageName: this.props.pageName,
      classedName: name
    }));
    this.fs.write(this.destinationPath('./app/front_end/app/pages/' + this.props.pageName + '.js'), entry({
      projName: this.props.projName,
      appname: this.props.pageName,
      pageName: this.props.pageName,
      classedName: name
    }));
    this.fs.write(this.destinationPath('./app/front_end/app/scss/' + this.props.pageName + '.scss'), scss({
      pageName: this.props.pageName,
      classedName: this.props.pageName
    }));
    // this.fs.write(this.destinationPath('./htmls/' + this.props.pageName + '.html'), html({
    //   pageName: this.props.pageName
    // }));
  },

  install: function () {
    //this.installDependencies();
  }
});


text:
{-# LANGUAGE OverloadedStrings, NoMonomorphismRestriction         #-}

------------------------------------------------------------------------------
-- | This module is where all the routes and handlers are defined for your
-- site. The 'app' function is the initializer that combines everything
-- together and is exported by this module.
module Site
  ( app
  ) where

------------------------------------------------------------------------------
import           Control.Applicative
import           Data.ByteString (ByteString)
import           Data.Maybe
import qualified Data.Text as T
import           Snap.Core
import           Snap.Snaplet
import           Snap.Snaplet.Auth
import           Snap.Snaplet.Auth.Backends.JsonFile
import           Snap.Snaplet.Heist
import           Snap.Snaplet.Session.Backends.CookieSession
import           Snap.Util.FileServe
import           Text.Templating.Heist
------------------------------------------------------------------------------
import           Application
import           StaticDoc

myHandler = do
          writeText "Hello"

------------------------------------------------------------------------------
-- | The application's routes.
routes :: [(ByteString, Handler App App ())]

routes = [  ("/images", with staticDoc retrieve)
         ,  ("", with staticDoc retrieve)
         ]

------------------------------------------------------------------------------
-- | The application initializer.
app :: SnapletInit App App
app = makeSnaplet "app" "An snaplet example application." Nothing $ do
    h <- nestSnaplet "" heist $ heistInit ""
    s <- nestSnaplet "" staticDoc $ staticInit "/Users/drakej/Code/SOCRweb/wiki"
                                               "/Users/drakej/Code/SOCRweb/images"
                                               "/Users/drakej/Code/SOCRweb/templates"
                                               "clockworks"
    addRoutes routes
    return $ App h s


text:
using System;
using System.Net.Mail;

namespace NMoneys.Web.Controllers.Infrastructure
{
	public interface IEmailSender
	{
		void SendConfirmation(MailAddress confirmer, ApiKey toBeConfirmed, Uri confirmationUrl);
	}
}


text:
package com.vaadin.v7.data.util.filter;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import com.vaadin.v7.data.Container.Filter;
import com.vaadin.v7.data.Item;
import com.vaadin.v7.data.util.BeanItem;

public class AndOrFilterTest
        extends AbstractFilterTestBase<AbstractJunctionFilter> {

    protected Item item1 = new BeanItem<Integer>(1);
    protected Item item2 = new BeanItem<Integer>(2);

    @Test
    public void testNoFilterAnd() {
        Filter filter = new And();

        assertTrue(filter.passesFilter(null, item1));
    }

    @Test
    public void testSingleFilterAnd() {
        Filter filter = new And(new SameItemFilter(item1));

        assertTrue(filter.passesFilter(null, item1));
        assertFalse(filter.passesFilter(null, item2));
    }

    @Test
    public void testTwoFilterAnd() {
        Filter filter1 = new And(new SameItemFilter(item1),
                new SameItemFilter(item1));
        Filter filter2 = new And(new SameItemFilter(item1),
                new SameItemFilter(item2));

        assertTrue(filter1.passesFilter(null, item1));
        assertFalse(filter1.passesFilter(null, item2));

        assertFalse(filter2.passesFilter(null, item1));
        assertFalse(filter2.passesFilter(null, item2));
    }

    @Test
    public void testThreeFilterAnd() {
        Filter filter1 = new And(new SameItemFilter(item1),
                new SameItemFilter(item1), new SameItemFilter(item1));
        Filter filter2 = new And(new SameItemFilter(item1),
                new SameItemFilter(item1), new SameItemFilter(item2));

        assertTrue(filter1.passesFilter(null, item1));
        assertFalse(filter1.passesFilter(null, item2));

        assertFalse(filter2.passesFilter(null, item1));
        assertFalse(filter2.passesFilter(null, item2));
    }

    @Test
    public void testNoFilterOr() {
        Filter filter = new Or();

        assertFalse(filter.passesFilter(null, item1));
    }

    @Test
    public void testSingleFilterOr() {
        Filter filter = new Or(new SameItemFilter(item1));

        assertTrue(filter.passesFilter(null, item1));
        assertFalse(filter.passesFilter(null, item2));
    }

    @Test
    public void testTwoFilterOr() {
        Filter filter1 = new Or(new SameItemFilter(item1),
                new SameItemFilter(item1));
        Filter filter2 = new Or(new SameItemFilter(item1),
                new SameItemFilter(item2));

        assertTrue(filter1.passesFilter(null, item1));
        assertFalse(filter1.passesFilter(null, item2));

        assertTrue(filter2.passesFilter(null, item1));
        assertTrue(filter2.passesFilter(null, item2));
    }

    @Test
    public void testThreeFilterOr() {
        Filter filter1 = new Or(new SameItemFilter(item1),
                new SameItemFilter(item1), new SameItemFilter(item1));
        Filter filter2 = new Or(new SameItemFilter(item1),
                new SameItemFilter(item1), new SameItemFilter(item2));

        assertTrue(filter1.passesFilter(null, item1));
        assertFalse(filter1.passesFilter(null, item2));

        assertTrue(filter2.passesFilter(null, item1));
        assertTrue(filter2.passesFilter(null, item2));
    }

    @Test
    public void testAndEqualsHashCode() {
        Filter filter0 = new And();
        Filter filter0b = new And();
        Filter filter1a = new And(new SameItemFilter(item1));
        Filter filter1a2 = new And(new SameItemFilter(item1));
        Filter filter1b = new And(new SameItemFilter(item2));
        Filter filter2a = new And(new SameItemFilter(item1),
                new SameItemFilter(item1));
        Filter filter2b = new And(new SameItemFilter(item1),
                new SameItemFilter(item2));
        Filter filter2b2 = new And(new SameItemFilter(item1),
                new SameItemFilter(item2));
        Filter other0 = new Or();
        Filter other1 = new Or(new SameItemFilter(item1));

        assertEquals(filter0, filter0);
        assertEquals(filter0, filter0b);
        assertFalse(filter0.equals(filter1a));
        assertFalse(filter0.equals(other0));
        assertFalse(filter0.equals(other1));

        assertFalse(filter1a.equals(filter1b));
        assertFalse(filter1a.equals(other1));

        assertFalse(filter1a.equals(filter2a));
        assertFalse(filter2a.equals(filter1a));

        assertFalse(filter2a.equals(filter2b));
        assertEquals(filter2b, filter2b2);

        // hashCode()
        assertEquals(filter0.hashCode(), filter0.hashCode());
        assertEquals(filter0.hashCode(), filter0b.hashCode());
        assertEquals(filter1a.hashCode(), filter1a.hashCode());
        assertEquals(filter1a.hashCode(), filter1a2.hashCode());
        assertEquals(filter2a.hashCode(), filter2a.hashCode());
        assertEquals(filter2b.hashCode(), filter2b2.hashCode());
    }

    @Test
    public void testOrEqualsHashCode() {
        Filter filter0 = new Or();
        Filter filter0b = new Or();
        Filter filter1a = new Or(new SameItemFilter(item1));
        Filter filter1a2 = new Or(new SameItemFilter(item1));
        Filter filter1b = new Or(new SameItemFilter(item2));
        Filter filter2a = new Or(new SameItemFilter(item1),
                new SameItemFilter(item1));
        Filter filter2b = new Or(new SameItemFilter(item1),
                new SameItemFilter(item2));
        Filter filter2b2 = new Or(new SameItemFilter(item1),
                new SameItemFilter(item2));
        Filter other0 = new And();
        Filter other1 = new And(new SameItemFilter(item1));

        assertEquals(filter0, filter0);
        assertEquals(filter0, filter0b);
        assertFalse(filter0.equals(filter1a));
        assertFalse(filter0.equals(other0));
        assertFalse(filter0.equals(other1));

        assertFalse(filter1a.equals(filter1b));
        assertFalse(filter1a.equals(other1));

        assertFalse(filter1a.equals(filter2a));
        assertFalse(filter2a.equals(filter1a));

        assertFalse(filter2a.equals(filter2b));
        assertEquals(filter2b, filter2b2);

        // hashCode()
        assertEquals(filter0.hashCode(), filter0.hashCode());
        assertEquals(filter0.hashCode(), filter0b.hashCode());
        assertEquals(filter1a.hashCode(), filter1a.hashCode());
        assertEquals(filter1a.hashCode(), filter1a2.hashCode());
        assertEquals(filter2a.hashCode(), filter2a.hashCode());
        assertEquals(filter2b.hashCode(), filter2b2.hashCode());
    }

    @Test
    public void testAndAppliesToProperty() {
        Filter filter0 = new And();
        Filter filter1a = new And(new SameItemFilter(item1, "a"));
        Filter filter1b = new And(new SameItemFilter(item1, "b"));
        Filter filter2aa = new And(new SameItemFilter(item1, "a"),
                new SameItemFilter(item1, "a"));
        Filter filter2ab = new And(new SameItemFilter(item1, "a"),
                new SameItemFilter(item1, "b"));
        Filter filter3abc = new And(new SameItemFilter(item1, "a"),
                new SameItemFilter(item1, "b"), new SameItemFilter(item1, "c"));

        // empty And does not filter out anything
        assertFalse(filter0.appliesToProperty("a"));
        assertFalse(filter0.appliesToProperty("d"));

        assertTrue(filter1a.appliesToProperty("a"));
        assertFalse(filter1a.appliesToProperty("b"));
        assertFalse(filter1b.appliesToProperty("a"));
        assertTrue(filter1b.appliesToProperty("b"));

        assertTrue(filter2aa.appliesToProperty("a"));
        assertFalse(filter2aa.appliesToProperty("b"));
        assertTrue(filter2ab.appliesToProperty("a"));
        assertTrue(filter2ab.appliesToProperty("b"));

        assertTrue(filter3abc.appliesToProperty("a"));
        assertTrue(filter3abc.appliesToProperty("b"));
        assertTrue(filter3abc.appliesToProperty("c"));
        assertFalse(filter3abc.appliesToProperty("d"));
    }

    @Test
    public void testOrAppliesToProperty() {
        Filter filter0 = new Or();
        Filter filter1a = new Or(new SameItemFilter(item1, "a"));
        Filter filter1b = new Or(new SameItemFilter(item1, "b"));
        Filter filter2aa = new Or(new SameItemFilter(item1, "a"),
                new SameItemFilter(item1, "a"));
        Filter filter2ab = new Or(new SameItemFilter(item1, "a"),
                new SameItemFilter(item1, "b"));
        Filter filter3abc = new Or(new SameItemFilter(item1, "a"),
                new SameItemFilter(item1, "b"), new SameItemFilter(item1, "c"));

        // empty Or filters out everything
        assertTrue(filter0.appliesToProperty("a"));
        assertTrue(filter0.appliesToProperty("d"));

        assertTrue(filter1a.appliesToProperty("a"));
        assertFalse(filter1a.appliesToProperty("b"));
        assertFalse(filter1b.appliesToProperty("a"));
        assertTrue(filter1b.appliesToProperty("b"));

        assertTrue(filter2aa.appliesToProperty("a"));
        assertFalse(filter2aa.appliesToProperty("b"));
        assertTrue(filter2ab.appliesToProperty("a"));
        assertTrue(filter2ab.appliesToProperty("b"));

        assertTrue(filter3abc.appliesToProperty("a"));
        assertTrue(filter3abc.appliesToProperty("b"));
        assertTrue(filter3abc.appliesToProperty("c"));
        assertFalse(filter3abc.appliesToProperty("d"));
    }

}


text:
require 'string_tools/version'
require 'ru_propisju'
require 'sanitize'
require 'active_support/core_ext/string'
require 'string_tools/core_ext/string'

module StringTools
  module CharDet
    # Возвращает true если строка содержит допустимую
    # последовательность байтов для кодировки utf8 и false в обратном случае
    # см. http://en.wikipedia.org/wiki/UTF-8
    def valid_utf8? string
      case string
      when String then string.is_utf8?
      else false
      end
    end

    # shorthand
    def detect_encoding(str)
      str.detect_encoding
    end

    # привести строку к utf8
    def to_utf8(str)
      str.to_utf8
    end

    def to_cp1251(str)
      str.to_cp1251
    end

    def cp1251_compatible_encodings
      [
        'windows-1253',
        'windows-1254',
        'windows-1255',
        'windows-1256',
        'windows-1258',
        'EUC-TW',
        'ISO-8859-8'
      ]
    end
  end
  extend CharDet

  module WordProcessing
    def truncate_words(text, length = 75)
      return if text.nil?

      if text.mb_chars.size > length
        new_length = text.mb_chars[0...length].rindex(/[^[:word:]]/)
        text.mb_chars[0...new_length.to_i]
      else
        text
      end
    rescue
      text[0...length]
    end
  end
  extend WordProcessing

  module ActionControllerExtension
    def accepts_non_utf8_params(*args)
      args.each do |arg|
        next unless arg.is_a?(Symbol) || arg.is_a?(String)
        arg = arg.to_sym

        class_eval do
          before_filter { |controller|
            decode = lambda { |s|
              if s.is_a?(Hash)
                s.to_a.map { |k, v| [k, StringTools.to_utf8(v)]}.to_hash
              elsif s.is_a?(Array)
                s.map { |v| StringTools.to_utf8(v) }
              else
                StringTools.to_utf8(s)
              end
            }

            controller.params[arg] = decode.call(controller.params[arg]) unless controller.params[arg].nil?
          }
        end
      end
    end

    alias_method :accepts_non_utf8_param, :accepts_non_utf8_params
  end

  module Sanitizing
    def sanitize(text, options = {})
      sanitizer = options.delete(:sanitizer)
      sanitizer = StringTools::Sanitizer::Base.new unless sanitizer.respond_to?(:sanitize)
      sanitizer.sanitize(text, options)
    end

    # Public: вычищает ASCII Control Characters из строки
    #
    # string - String строка, из которой удаляем символы
    #
    # Returns String
    def clear_control_characters(string)
      string.tr("\u0000-\u001f", '')
    end
  end
  extend Sanitizing

  module Sanitizer
    class Base

      TAGS_WITH_ATTRIBUTES = {
        'p'     => %w(align style),
        'div'   => %w(align style),
        'span'   => %w(align style),
        'td'    => %w(align width valign colspan rowspan style),
        'th'    => %w(align width valign colspan rowspan style),
        'a'     => %w(href target name style),
        'table' => %w(cellpadding cellspacing width border align style),
        'img'   => %w(src width height style)
      }

      TAGS_WITHOUT_ATTRIBUTES = %w(b strong i em sup sub ul ol li blockquote br tr u caption thead)

      def sanitize(str, attr = {})
        # для корректного обрезания utf строчек режем через mb_chars
        # для защиты от перегрузки парсера пропускаем максимум 1 мегабайт текста
        # длина русского символа в utf-8 - 2 байта, 1Мб/2б = 524288 = 2**19 символов
        # длина по символам с перестраховкой, т.к. латинские символы(теги, например) занимают 1 байт
        str = str.mb_chars.slice(0..(2**19)).to_s

        attributes = TAGS_WITH_ATTRIBUTES

        # Мерджим добавочные теги и атрибуты
        attributes.merge!(attr)
        elements = attributes.keys | TAGS_WITHOUT_ATTRIBUTES

        Sanitize.fragment(str,
          :attributes => attributes,
          :elements => elements,
          :css => {:properties => Sanitize::Config::RELAXED[:css][:properties]},
          :remove_contents => %w(style javascript),
          :allow_comments => false
        )
      end
    end
  end

  module SumInWords
    # Сумма в рублях прописью. Кол-во копеек выводится всегда. Первая буква заглавная
    def rublej_propisju(amount)
      kop = (amount.divmod(1)[1]*100).round
      result = RuPropisju.rublej(amount.to_i).capitalize
      result << " %.2d " % kop
      result << RuPropisju.choose_plural(kop, 'копейка', 'копейки', 'копеек')
    end
  end
  extend SumInWords
end


text:
package com.jivesoftware.sdk.api.data;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import java.util.List;

/**
 * Created by rrutan on 11/7/14.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class JiveContents extends JiveResults<JiveContent> {

} // end class


text:
'use strict';

var db = require('./mongoDB');
var mongoose = require('mongoose');

db.once('open', function() {

    console.log("Inicializando las collecciones");
    var n=db.getName();
    console.log(n);
    db.getCollectionNames(function(err, names){
        if ( err ){
            console.log("error");
            return;
        }

        console.log(names);
    });

    console.log("Colecciones  creadas");
});

function initArticle(){
    console.log("Articilo");

}


text:
/* From trusted/ppb_url_loader_trusted.idl modified Mon Mar 19 13:26:48 2018. */

#ifndef PPAPI_C_TRUSTED_PPB_URL_LOADER_TRUSTED_H_
#define PPAPI_C_TRUSTED_PPB_URL_LOADER_TRUSTED_H_

#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"

#define PPB_URLLOADERTRUSTED_INTERFACE_0_3 "PPB_URLLoaderTrusted;0.3"
#define PPB_URLLOADERTRUSTED_INTERFACE PPB_URLLOADERTRUSTED_INTERFACE_0_3

/**
 * @file
 * URL loader trusted interfaces. */

/**
 * @addtogroup Typedefs
 * @{
 */
/**
 * NOTE: Permission checks for functions added to this file must be done in
 * pepper_url_loader.cc.
 *
 */
/**
 * Callback that indicates the status of the download and upload for the
 * given URLLoader resource.
 */
typedef void (*PP_URLLoaderTrusted_StatusCallback)(
    PP_Instance pp_instance,
    PP_Resource pp_resource,
    int64_t bytes_sent,
    int64_t total_bytes_to_be_sent,
    int64_t bytes_received,
    int64_t total_bytes_to_be_received);
/**
 * @}
 */

/**
 * @addtogroup Interfaces
 * @{
 */
/* Available only to trusted implementations. */
struct PPB_URLLoaderTrusted_0_3 {
  /**
   * Grant this URLLoader the capability to make unrestricted cross-origin
   * requests.
   */
  void (*GrantUniversalAccess)(PP_Resource loader);
  /**
   * Registers that the given function will be called when the upload or
   * downloaded byte count has changed. This is not exposed on the untrusted
   * interface because it can be quite chatty and encourages people to write
   * feedback UIs that update as frequently as the progress updates.
   *
   * The other serious gotcha with this callback is that the callback must not
   * mutate the URL loader or cause it to be destroyed.
   *
   * However, the proxy layer needs this information to push to the other
   * process, so we expose it here. Only one callback can be set per URL
   * Loader. Setting to a NULL callback will disable it.
   */
  void (*RegisterStatusCallback)(PP_Resource loader,
                                 PP_URLLoaderTrusted_StatusCallback cb);
};

typedef struct PPB_URLLoaderTrusted_0_3 PPB_URLLoaderTrusted;
/**
 * @}
 */

#endif  /* PPAPI_C_TRUSTED_PPB_URL_LOADER_TRUSTED_H_ */


text:
/* @flow */

import React from 'react';
import { connect } from 'react-redux';

import { translate } from '../../base/i18n';

import UIUtil from '../../../../modules/UI/util/UIUtil';

import AbstractToolbarButton from './AbstractToolbarButton';
import { getButtonAttributesByProps } from '../functions';

declare var APP: Object;
declare var interfaceConfig: Object;

/**
 * Represents a button in Toolbar on React.
 *
 * @class ToolbarButton
 * @extends AbstractToolbarButton
 */
class ToolbarButton extends AbstractToolbarButton {
    _createRefToButton: Function;

    _onClick: Function;

    /**
     * Toolbar button component's property types.
     *
     * @static
     */
    static propTypes = {
        ...AbstractToolbarButton.propTypes,

        /**
         * Object describing button.
         */
        button: React.PropTypes.object.isRequired,

        /**
         * Used to dispatch an action when the button is clicked.
         */
        dispatch: React.PropTypes.func,

        /**
         * Handler for component mount.
         */
        onMount: React.PropTypes.func,

        /**
         * Handler for component unmount.
         */
        onUnmount: React.PropTypes.func,

        /**
         * Translation helper function.
         */
        t: React.PropTypes.func,

        /**
         * Indicates the position of the tooltip.
         */
        tooltipPosition:
            React.PropTypes.oneOf([ 'bottom', 'left', 'right', 'top' ])
    };

    /**
     * Initializes new ToolbarButton instance.
     *
     * @param {Object} props - The read-only properties with which the new
     * instance is to be initialized.
     */
    constructor(props: Object) {
        super(props);

        // Bind methods to save the context
        this._createRefToButton = this._createRefToButton.bind(this);
        this._onClick = this._onClick.bind(this);
    }

    /**
     * Sets shortcut/tooltip
     * after mounting of the component.
     *
     * @inheritdoc
     * @returns {void}
     */
    componentDidMount(): void {
        this._setShortcutAndTooltip();

        if (this.props.onMount) {
            this.props.onMount();
        }
    }

    /**
     * Invokes on unmount handler if it was passed to the props.
     *
     * @inheritdoc
     * @returns {void}
     */
    componentWillUnmount(): void {
        if (this.props.onUnmount) {
            this.props.onUnmount();
        }
    }

    /**
     * Implements React's {@link Component#render()}.
     *
     * @inheritdoc
     * @returns {ReactElement}
     */
    render(): ReactElement<*> {
        const { button } = this.props;
        const attributes = getButtonAttributesByProps(button);
        const popups = button.popups || [];

        return (
            <a
                { ...attributes }
                onClick = { this._onClick }
                ref = { this._createRefToButton }>
                { this._renderInnerElementsIfRequired() }
                { this._renderPopups(popups) }
            </a>
        );
    }

    /**
     * Creates reference to current toolbar button.
     *
     * @param {HTMLElement} element - HTMLElement representing the toolbar
     * button.
     * @returns {void}
     * @private
     */
    _createRefToButton(element: HTMLElement): void {
        this.button = element;
    }

    /**
     * Wrapper on on click handler props for current button.
     *
     * @param {Event} event - Click event object.
     * @returns {void}
     * @private
     */
    _onClick(event: Event): void {
        const {
            button,
            onClick
        } = this.props;
        const {
            enabled,
            unclickable
        } = button;

        if (enabled && !unclickable && onClick) {
            const action = onClick(event);

            if (action) {
                this.props.dispatch(action);
            }
        }
    }

    /**
     * If toolbar button should contain children elements
     * renders them.
     *
     * @returns {ReactElement|null}
     * @private
     */
    _renderInnerElementsIfRequired(): ReactElement<*> | null {
        if (this.props.button.html) {
            return this.props.button.html;
        }

        return null;
    }

    /**
     * Renders popup element for toolbar button.
     *
     * @param {Array} popups - Array of popup objects.
     * @returns {Array}
     * @private
     */
    _renderPopups(popups: Array<*> = []): Array<*> {
        return popups.map(popup => {
            let gravity = 'n';

            if (popup.dataAttrPosition) {
                gravity = popup.dataAttrPosition;
            }

            const title = this.props.t(popup.dataAttr, popup.dataInterpolate);

            return (
                <div
                    className = { popup.className }
                    data-popup = { gravity }
                    id = { popup.id }
                    key = { popup.id }
                    title = { title } />
            );
        });
    }

    /**
     * Sets shortcut and tooltip for current toolbar button.
     *
     * @private
     * @returns {void}
     */
    _setShortcutAndTooltip(): void {
        const { button, tooltipPosition } = this.props;
        const name = button.buttonName;

        if (UIUtil.isButtonEnabled(name)) {

            if (!button.unclickable) {
                if (button.tooltipText) {
                    UIUtil.setTooltipText(this.button,
                        button.tooltipText,
                        tooltipPosition);
                } else {
                    UIUtil.setTooltip(this.button,
                        button.tooltipKey,
                        tooltipPosition);
                }
            }

            if (button.shortcut) {
                APP.keyboardshortcut.registerShortcut(
                    button.shortcut,
                    button.shortcutAttr,
                    button.shortcutFunc,
                    button.shortcutDescription
                );
            }
        }
    }
}

export default translate(connect()(ToolbarButton));


text:
package com.xeiam.xchange.coinbase.dto.merchant;

import java.io.IOException;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.xeiam.xchange.coinbase.dto.CoinbaseBaseResponse;
import com.xeiam.xchange.coinbase.dto.marketdata.CoinbaseMoney;
import com.xeiam.xchange.coinbase.dto.merchant.CoinbaseButton.CoinbaseButtonInfo;
import com.xeiam.xchange.coinbase.dto.merchant.CoinbaseOrder.CoinbaseOrderStatus.CoinbaseOrderStatusDeserializer;
import com.xeiam.xchange.coinbase.dto.serialization.CoinbaseCentsDeserializer;
import com.xeiam.xchange.coinbase.dto.serialization.EnumFromStringHelper;
import com.xeiam.xchange.coinbase.dto.serialization.EnumLowercaseJsonSerializer;
import com.xeiam.xchange.utils.jackson.ISO8601DateDeserializer;

/**
 * @author jamespedwards42
 */
public class CoinbaseOrder extends CoinbaseBaseResponse {

  @JsonProperty("order")
  private CoinbaseOrderInfo order;

  private CoinbaseOrder(@JsonProperty("order") final CoinbaseOrderInfo order, @JsonProperty("success") final boolean success, @JsonProperty("errors") final List<String> errors) {

    super(success, errors);
    this.order = order;
  }

  public String getId() {

    return order.getId();
  }

  public Date getCreatedAt() {

    return order.getCreatedAt();
  }

  public CoinbaseOrderStatus getStatus() {

    return order.getStatus();
  }

  public CoinbaseMoney getTotalBTC() {

    return order.getTotalBTC();
  }

  public CoinbaseMoney getTotalNative() {

    return order.getTotalNative();
  }

  public String getCustom() {

    return order.getCustom();
  }

  public String getReceiveAddress() {

    return order.getReceiveAddress();
  }

  public CoinbaseButton getButton() {

    return order.getButton();
  }

  public CoinbaseOrderTransaction getTransaction() {

    return order.getTransaction();
  }

  @Override
  public String toString() {

    return "CoinbaseOrder [order=" + order + "]";
  }

  @JsonDeserialize(using = CoinbaseOrderStatusDeserializer.class)
  @JsonSerialize(using = EnumLowercaseJsonSerializer.class)
  public enum CoinbaseOrderStatus {

    NEW, COMPLETED, CANCELED;

    static class CoinbaseOrderStatusDeserializer extends JsonDeserializer<CoinbaseOrderStatus> {

      private static final EnumFromStringHelper<CoinbaseOrderStatus> FROM_STRING_HELPER = new EnumFromStringHelper<CoinbaseOrderStatus>(CoinbaseOrderStatus.class);

      @Override
      public CoinbaseOrderStatus deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {

        ObjectCodec oc = jsonParser.getCodec();
        JsonNode node = oc.readTree(jsonParser);
        String jsonString = node.textValue();
        return FROM_STRING_HELPER.fromJsonString(jsonString);
      }
    }
  }

  private static class CoinbaseOrderInfo {

    private final String id;
    private final Date createdAt;
    private final CoinbaseOrderStatus status;
    private final CoinbaseMoney totalBTC;
    private final CoinbaseMoney totalNative;
    private final String custom;
    private final String receiveAddress;
    private final CoinbaseButton button;
    private final CoinbaseOrderTransaction transaction;

    private CoinbaseOrderInfo(@JsonProperty("id") final String id, @JsonProperty("created_at") @JsonDeserialize(using = ISO8601DateDeserializer.class) final Date createdAt,
        @JsonProperty("status") final CoinbaseOrderStatus status, @JsonProperty("total_btc") @JsonDeserialize(using = CoinbaseCentsDeserializer.class) final CoinbaseMoney totalBTC,
        @JsonProperty("total_native") @JsonDeserialize(using = CoinbaseCentsDeserializer.class) final CoinbaseMoney totalNative, @JsonProperty("custom") final String custom,
        @JsonProperty("receive_address") final String receiveAddress, @JsonProperty("button") final CoinbaseButtonInfo button, @JsonProperty("transaction") final CoinbaseOrderTransaction transaction) {

      this.id = id;
      this.createdAt = createdAt;
      this.status = status;
      this.totalBTC = totalBTC;
      this.totalNative = totalNative;
      this.custom = custom;
      this.receiveAddress = receiveAddress;
      this.button = new CoinbaseButton(button);
      this.transaction = transaction;
    }

    public String getId() {

      return id;
    }

    public Date getCreatedAt() {

      return createdAt;
    }

    public CoinbaseOrderStatus getStatus() {

      return status;
    }

    public CoinbaseMoney getTotalBTC() {

      return totalBTC;
    }

    public CoinbaseMoney getTotalNative() {

      return totalNative;
    }

    public String getCustom() {

      return custom;
    }

    public String getReceiveAddress() {

      return receiveAddress;
    }

    public CoinbaseButton getButton() {

      return button;
    }

    public CoinbaseOrderTransaction getTransaction() {

      return transaction;
    }

    @Override
    public String toString() {

      return "CoinbaseOrderInfo [id=" + id + ", createdAt=" + createdAt + ", status=" + status + ", totalBTC=" + totalBTC + ", totalNative=" + totalNative + ", custom=" + custom + ", receiveAddress="
          + receiveAddress + ", button=" + button + ", transaction=" + transaction + "]";
    }

  }

  public static class CoinbaseOrderTransaction {

    private final String id;
    private final String hash;
    private final int confirmations;

    private CoinbaseOrderTransaction(@JsonProperty("id") final String id, @JsonProperty("hash") final String hash, @JsonProperty("confirmations") final int confirmations) {

      this.id = id;
      this.hash = hash;
      this.confirmations = confirmations;
    }

    public String getId() {

      return id;
    }

    public String getHash() {

      return hash;
    }

    public int getConfirmations() {

      return confirmations;
    }

    @Override
    public String toString() {

      return "CoinbaseOrderTransaction [id=" + id + ", hash=" + hash + ", confirmations=" + confirmations + "]";
    }
  }
}


text:
package reconciliation

import (
	"context"
	rbacv1 "k8s.io/api/rbac/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	corev1client "k8s.io/client-go/kubernetes/typed/core/v1"
	rbacv1client "k8s.io/client-go/kubernetes/typed/rbac/v1"
)

// +k8s:deepcopy-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/kubernetes/pkg/registry/rbac/reconciliation.RuleOwner
// +k8s:deepcopy-gen:nonpointer-interfaces=true
type RoleRuleOwner struct {
	Role *rbacv1.Role
}

func (o RoleRuleOwner) GetObject() runtime.Object {
	return o.Role
}

func (o RoleRuleOwner) GetNamespace() string {
	return o.Role.Namespace
}

func (o RoleRuleOwner) GetName() string {
	return o.Role.Name
}

func (o RoleRuleOwner) GetLabels() map[string]string {
	return o.Role.Labels
}

func (o RoleRuleOwner) SetLabels(in map[string]string) {
	o.Role.Labels = in
}

func (o RoleRuleOwner) GetAnnotations() map[string]string {
	return o.Role.Annotations
}

func (o RoleRuleOwner) SetAnnotations(in map[string]string) {
	o.Role.Annotations = in
}

func (o RoleRuleOwner) GetRules() []rbacv1.PolicyRule {
	return o.Role.Rules
}

func (o RoleRuleOwner) SetRules(in []rbacv1.PolicyRule) {
	o.Role.Rules = in
}

func (o RoleRuleOwner) GetAggregationRule() *rbacv1.AggregationRule {
	return nil
}

func (o RoleRuleOwner) SetAggregationRule(in *rbacv1.AggregationRule) {
}

type RoleModifier struct {
	Client          rbacv1client.RolesGetter
	NamespaceClient corev1client.NamespaceInterface
}

func (c RoleModifier) Get(namespace, name string) (RuleOwner, error) {
	ret, err := c.Client.Roles(namespace).Get(context.TODO(), name, metav1.GetOptions{})
	if err != nil {
		return nil, err
	}
	return RoleRuleOwner{Role: ret}, err
}

func (c RoleModifier) Create(in RuleOwner) (RuleOwner, error) {
	if err := tryEnsureNamespace(c.NamespaceClient, in.GetNamespace()); err != nil {
		return nil, err
	}

	ret, err := c.Client.Roles(in.GetNamespace()).Create(context.TODO(), in.(RoleRuleOwner).Role, metav1.CreateOptions{})
	if err != nil {
		return nil, err
	}
	return RoleRuleOwner{Role: ret}, err
}

func (c RoleModifier) Update(in RuleOwner) (RuleOwner, error) {
	ret, err := c.Client.Roles(in.GetNamespace()).Update(context.TODO(), in.(RoleRuleOwner).Role, metav1.UpdateOptions{})
	if err != nil {
		return nil, err
	}
	return RoleRuleOwner{Role: ret}, err

}


text:
#pragma once
#include <aws/accessanalyzer/AccessAnalyzer_EXPORTS.h>
#include <aws/accessanalyzer/AccessAnalyzerRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace AccessAnalyzer
{
namespace Model
{

  /**
   *
Starts a scan of the policies applied to the specified
   * resource.

See Also:
   AWS
   * API Reference

   */
  class AWS_ACCESSANALYZER_API StartResourceScanRequest : public AccessAnalyzerRequest
  {
  public:
    StartResourceScanRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "StartResourceScan"; }

    Aws::String SerializePayload() const override;

    /**
     *
The ARN
     * of the analyzer to use to scan the policies applied to the specified
     * resource.

     */
    inline const Aws::String& GetAnalyzerArn() const{ return m_analyzerArn; }

    /**
     *
The ARN
     * of the analyzer to use to scan the policies applied to the specified
     * resource.

     */
    inline bool AnalyzerArnHasBeenSet() const { return m_analyzerArnHasBeenSet; }

    /**
     *
The ARN
     * of the analyzer to use to scan the policies applied to the specified
     * resource.

     */
    inline void SetAnalyzerArn(const Aws::String& value) { m_analyzerArnHasBeenSet = true; m_analyzerArn = value; }

    /**
     *
The ARN
     * of the analyzer to use to scan the policies applied to the specified
     * resource.

     */
    inline void SetAnalyzerArn(Aws::String&& value) { m_analyzerArnHasBeenSet = true; m_analyzerArn = std::move(value); }

    /**
     *
The ARN
     * of the analyzer to use to scan the policies applied to the specified
     * resource.

     */
    inline void SetAnalyzerArn(const char* value) { m_analyzerArnHasBeenSet = true; m_analyzerArn.assign(value); }

    /**
     *
The ARN
     * of the analyzer to use to scan the policies applied to the specified
     * resource.

     */
    inline StartResourceScanRequest& WithAnalyzerArn(const Aws::String& value) { SetAnalyzerArn(value); return *this;}

    /**
     *
The ARN
     * of the analyzer to use to scan the policies applied to the specified
     * resource.

     */
    inline StartResourceScanRequest& WithAnalyzerArn(Aws::String&& value) { SetAnalyzerArn(std::move(value)); return *this;}

    /**
     *
The ARN
     * of the analyzer to use to scan the policies applied to the specified
     * resource.

     */
    inline StartResourceScanRequest& WithAnalyzerArn(const char* value) { SetAnalyzerArn(value); return *this;}

    /**
     *
The ARN of the resource to scan.

     */
    inline const Aws::String& GetResourceArn() const{ return m_resourceArn; }

    /**
     *
The ARN of the resource to scan.

     */
    inline bool ResourceArnHasBeenSet() const { return m_resourceArnHasBeenSet; }

    /**
     *
The ARN of the resource to scan.

     */
    inline void SetResourceArn(const Aws::String& value) { m_resourceArnHasBeenSet = true; m_resourceArn = value; }

    /**
     *
The ARN of the resource to scan.

     */
    inline void SetResourceArn(Aws::String&& value) { m_resourceArnHasBeenSet = true; m_resourceArn = std::move(value); }

    /**
     *
The ARN of the resource to scan.

     */
    inline void SetResourceArn(const char* value) { m_resourceArnHasBeenSet = true; m_resourceArn.assign(value); }

    /**
     *
The ARN of the resource to scan.

     */
    inline StartResourceScanRequest& WithResourceArn(const Aws::String& value) { SetResourceArn(value); return *this;}

    /**
     *
The ARN of the resource to scan.

     */
    inline StartResourceScanRequest& WithResourceArn(Aws::String&& value) { SetResourceArn(std::move(value)); return *this;}

    /**
     *
The ARN of the resource to scan.

     */
    inline StartResourceScanRequest& WithResourceArn(const char* value) { SetResourceArn(value); return *this;}

    /**
     *
The Amazon Web Services account ID that owns the resource. For most Amazon
     * Web Services resources, the owning account is the account in which the resource
     * was created.

     */
    inline const Aws::String& GetResourceOwnerAccount() const{ return m_resourceOwnerAccount; }

    /**
     *
The Amazon Web Services account ID that owns the resource. For most Amazon
     * Web Services resources, the owning account is the account in which the resource
     * was created.

     */
    inline bool ResourceOwnerAccountHasBeenSet() const { return m_resourceOwnerAccountHasBeenSet; }

    /**
     *
The Amazon Web Services account ID that owns the resource. For most Amazon
     * Web Services resources, the owning account is the account in which the resource
     * was created.

     */
    inline void SetResourceOwnerAccount(const Aws::String& value) { m_resourceOwnerAccountHasBeenSet = true; m_resourceOwnerAccount = value; }

    /**
     *
The Amazon Web Services account ID that owns the resource. For most Amazon
     * Web Services resources, the owning account is the account in which the resource
     * was created.

     */
    inline void SetResourceOwnerAccount(Aws::String&& value) { m_resourceOwnerAccountHasBeenSet = true; m_resourceOwnerAccount = std::move(value); }

    /**
     *
The Amazon Web Services account ID that owns the resource. For most Amazon
     * Web Services resources, the owning account is the account in which the resource
     * was created.

     */
    inline void SetResourceOwnerAccount(const char* value) { m_resourceOwnerAccountHasBeenSet = true; m_resourceOwnerAccount.assign(value); }

    /**
     *
The Amazon Web Services account ID that owns the resource. For most Amazon
     * Web Services resources, the owning account is the account in which the resource
     * was created.

     */
    inline StartResourceScanRequest& WithResourceOwnerAccount(const Aws::String& value) { SetResourceOwnerAccount(value); return *this;}

    /**
     *
The Amazon Web Services account ID that owns the resource. For most Amazon
     * Web Services resources, the owning account is the account in which the resource
     * was created.

     */
    inline StartResourceScanRequest& WithResourceOwnerAccount(Aws::String&& value) { SetResourceOwnerAccount(std::move(value)); return *this;}

    /**
     *
The Amazon Web Services account ID that owns the resource. For most Amazon
     * Web Services resources, the owning account is the account in which the resource
     * was created.

     */
    inline StartResourceScanRequest& WithResourceOwnerAccount(const char* value) { SetResourceOwnerAccount(value); return *this;}

  private:

    Aws::String m_analyzerArn;
    bool m_analyzerArnHasBeenSet = false;

    Aws::String m_resourceArn;
    bool m_resourceArnHasBeenSet = false;

    Aws::String m_resourceOwnerAccount;
    bool m_resourceOwnerAccountHasBeenSet = false;
  };

} // namespace Model
} // namespace AccessAnalyzer
} // namespace Aws


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
JobPropertyParser (Apache Hadoop Rumen 2.3.0 API)
</TITLE>

<META NAME="date" CONTENT="2015-03-06">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.hadoop.tools.rumen.datatypes.util

Interface JobPropertyParser

All Known Implementing Classes:
DefaultJobPropertiesParser, MapReduceJobPropertiesParser

public interface JobPropertyParser

A JobProperties parsing utility.

Method Summary

 DataType<?>
parseJobProperty(String key,
                 String value)

          Parse the specified job configuration key-value pair.

Method Detail

parseJobProperty

DataType<?> parseJobProperty(String key,
                             String value)

Parse the specified job configuration key-value pair.

Returns:
Returns a DataType if this parser can parse this value.
         Returns 'null' otherwise.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2015 Apache Software Foundation. All Rights Reserved.


text:
**This chart has been deprecated as of version 0.3.1 and will not be updated. Please use the cluster-autoscaler chart instead.**

[The cluster autoscaler on AWS](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/aws) scales worker nodes within an AWS autoscaling group.

## TL;DR:

```console
$ helm install stable/aws-cluster-autoscaler -f values.yaml
```
Where `values.yaml` contains:

```
autoscalingGroups:
  - name: your-asg-name
    maxSize: 10
    minSize: 1
```

## Introduction

This chart bootstraps an aws-cluster-autoscaler deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Prerequisites
  - Kubernetes 1.3+ with Beta APIs enabled

## Installing the Chart

In order for the chart to configure the aws-cluster-autoscaler properly during the installation process, you must provide some minimal configuration which can't rely on defaults. This includes at least one element in the `autoscalingGroups` array and its three values: `name`, `minSize` and `maxSize`. These parameters cannot be passed to helm using the `--set` parameter at this time, so you must supply these using a `values.yaml` file such as:

```
autoscalingGroups:
  - name: your-asg-name
    maxSize: 10
    minSize: 1
```

To install the chart with the release name `my-release`:

```console
$ helm install stable/aws-cluster-autoscaler --name my-release -f values.yaml
```

The command deploys aws-cluster-autoscaler on the Kubernetes cluster using the supplied configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.

> **Tip**: List all releases using `helm list`

## Verifying Installation

The chart will succeed even if the three required parameters are not supplied. To verify the aws-cluster-autoscaler is configured properly find a pod that the deployment created and describe it. It must have a `--nodes` argument supplied to the `./cluster-autoscaler` app under `Command`. For example (all other values are omitted for brevity):

```
Containers:
  aws-cluster-autoscaler:
    Command:
      ./cluster-autoscaler
      --cloud-provider=aws
      --nodes=1:10:your-asg-name
      --scale-down-delay=10m
      --skip-nodes-with-local-storage=false
      --skip-nodes-with-system-pods=true
      --v=4
```

## Uninstalling the Chart

To uninstall/delete the `my-release` deployment:

```console
$ helm delete my-release
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

The following table lists the configurable parameters of the aws-cluster-autoscaler chart and their default values.

Parameter | Description | Default
--- | --- | ---
`autoscalingGroups[].name` | autoscaling group name | None. You *must* supply at least one.
`autoscalingGroups[].maxSize` | maximum autoscaling group size | None. You *must* supply at least one.
`autoscalingGroups[].minSize` | minimum autoscaling group size | None. You *must* supply at least one.
`awsRegion` | AWS region | `us-east-1`
`image.repository` | Image | `k8s.gcr.io/cluster-autoscaler`
`image.tag` | Image tag | `v0.5.4`
`image.pullPolicy` | Image pull policy | `IfNotPresent`
`extraArgs` | additional container arguments | `{}`
`nodeSelector` | node labels for pod assignment | `{}`
`podAnnotations` | annotations to add to each pod | `{}`
`replicaCount` | desired number of pods | `1`
`resources` | pod resource requests & limits | `{}`
`scaleDownDelay` | time to wait between scaling operations | `10m` (10 minutes)
`service.annotations` | annotations to add to service | none
`service.clusterIP` | IP address to assign to service | `""`
`service.externalIPs` | service external IP addresses | `[]`
`service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""`
`service.loadBalancerSourceRanges` | list of IP CIDRs allowed access to load balancer (if supported) | `[]`
`service.servicePort` | service port to expose | `8085`
`service.type` | type of service to create | `ClusterIP`
`skipNodes.withLocalStorage` | don't terminate nodes running pods that use local storage | `false`
`skipNodes.withSystemPods` | don't terminate nodes running pods in the `kube-system` namespace | `true`

Specify each parameter you'd like to override using a YAML file as described above in the [installation](#Installing the Chart) section.

You can also specify any non-array parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```console
$ helm install stable/aws-cluster-autoscaler --name my-release \
    --set awsRegion=us-west-1
```

## IAM Permissions
The worker running the cluster autoscaler will need access to certain resources and actions:

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "autoscaling:DescribeAutoScalingGroups",
                "autoscaling:DescribeAutoScalingInstances",
                "autoscaling:SetDesiredCapacity",
                "autoscaling:TerminateInstanceInAutoScalingGroup"
            ],
            "Resource": "*"
        }
    ]
}
```
Unfortunately AWS does not support ARNs for autoscaling groups yet so you must use "*" as the resource. More information [here](http://docs.aws.amazon.com/autoscaling/latest/userguide/IAM.html#UsingWithAutoScaling_Actions).


text:
ID_PAGE: 22531
PG_TITLE: How to use Actions
---
Actions are a simple way to add interactions in your scenes. An action is launched when its trigger is fired.

For instance, you can specify that when the user clicks (or touches) a mesh, an action is executed.

# How to use it
To use actions, you have to attach an `BABYLON.ActionManager` to a mesh or to your scene:
`mesh.actionManager = new BABYLON.ActionManager(scene);`

Once the ActionManager is created, you can start registering actions:

```javascript
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, "diffuse", BABYLON.Color3.Black(), 1000));
```

For instance this action will animate the `light.diffuse` property to black in 1000ms when the user picks the mesh.

You can also chain actions:

```javascript
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, "diffuse", BABYLON.Color3.Black(), 1000))
        .then(new BABYLON.SetValueAction(BABYLON.ActionManager.NothingTrigger, mesh.material, "wireframe", false));
```

In this case, the first click will animate the `light.diffuse` property, the second click will set `mesh.material` to false. The third one will start again and will animate the `light.diffuse` property and so on...

Finally, you can add a condition to your actions. In this case, actions are launched when the trigger is fired if the condition is true:

```javascript
var condition1 = new BABYLON.PredicateCondition(sphere.actionManager, function () {
    return light1.diffuse.equals(BABYLON.Color3.Red());
});
sphere.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, camera, "alpha", 0, 500, condition1));
```

In this example, the `camera.alpha` property will be animated to 0 in 500ms when the user clicks the sphere only if the `light1.diffuse` property is equal to red.

# Triggers
Currently, 12 different triggers are supported:

The following list defines triggers associated with meshes:

* `BABYLON.ActionManager.NothingTrigger`: Never raised. Used for sub-actions with `action.then` function.
* `BABYLON.ActionManager.OnPickTrigger`: Raised when the user touches/clicks on a mesh.
* `BABYLON.ActionManager.OnPickUpTrigger`: Raised when the user touches/clicks up on a mesh.
* `BABYLON.ActionManager.OnPickOutTrigger`: Raised when the user touches/clicks down on a mesh and then move off-of the mesh.
* `BABYLON.ActionManager.OnLeftPickTrigger`: Raised when the user touches/clicks on a mesh with left button.
* `BABYLON.ActionManager.OnRightPickTrigger`: Raised when the user touches/clicks on a mesh with right button.
* `BABYLON.ActionManager.OnCenterPickTrigger`: Raised when the user touches/clicks on a mesh with center button.
* `BABYLON.ActionManager.OnLongPressTrigger`: Raised when the user touches/clicks up on a mesh for a long period of time (defined by BABYLONActionManager.LongPressDelay).
* `BABYLON.ActionManager.OnPointerOverTrigger`: Raised when the pointer is over a mesh. Raised just once.
* `BABYLON.ActionManager.OnPointerOutTrigger`: Raised when the pointer is no more over a mesh. Raised just once.
* `BABYLON.ActionManager.OnIntersectionEnterTrigger`: Raised when the mesh is in intersection with another mesh. Raised just once.
* `BABYLON.ActionManager.OnIntersectionExitTrigger`: Raised when the mesh is no more in intersection with another mesh. Raised just once.
* `BABYLON.ActionManager.OnKeyDownTrigger`: Raised when a key is press.
* `BABYLON.ActionManager.OnKeyUpTrigger`: Raised when a key is up

For intersection triggers, you have to specify the "other" mesh with the following code:

```javascript
mesh.actionManager.registerAction(

new BABYLON.SetValueAction({ trigger: BABYLON.ActionManager.OnIntersectionEnterTrigger, parameter: otherMesh },

mesh, "scaling", new BABYLON.Vector3(1.2, 1.2, 1.2)));
```

You can as well define if you want to use precise intersections:

```javascript
mesh.actionManager.registerAction(

new BABYLON.SetValueAction({ trigger: BABYLON.ActionManager.OnIntersectionEnterTrigger, parameter: { mesh:otherMesh, usePreciseIntersection: true} },

mesh, "scaling", new BABYLON.Vector3(1.2, 1.2, 1.2)));

```

The following list defines triggers associated with scene:

* `BABYLON.ActionManager.OnEveryFrameTrigger`: Raised once per frame.
* `BABYLON.ActionManager.OnKeyDownTrigger`: Raised when a key is pressed.
* `BABYLON.ActionManager.OnKeyUpTrigger`: Raised when a key is released.

For OnKeyUpTrigger and OnKeyDownTrigger triggers, you can filter events based on a key, either in your code or with a parameter:

```javascript
scene.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnKeyUpTrigger, function (evt) {
   if (evt.sourceEvent.key == "r") {
       ...
   }
}));

scene.actionManager.registerAction(new BABYLON.ExecuteCodeAction({ trigger: BABYLON.ActionManager.OnKeyUpTrigger, parameter: "r" },
  function () {
            ...
  }));
```

# Actions
Most of the action have a `propertyPath` property. This string defines the path to the property to affect with the action. You can use direct values like `position` or `diffuse`. But you can also provide complex paths like `position.x`

* `BABYLON.SwitchBooleanAction`: Used to switch the current value of a boolean property:

    `SwitchBooleanAction(trigger, target, propertyPath, condition)`

* `BABYLON.SetValueAction`: Used to specify a direct value for a property:

    `SetValueAction(trigger, target, propertyPath, value, condition)`

* `BABYLON.IncrementValueAction`: Add a specified value to a number property:

    `IncrementValueAction(trigger, target, propertyPath, value, condition)`

* `BABYLON.PlayAnimationAction`: Launch an animation on a specified target:

    `PlayAnimationAction(trigger, target, from, to, loop, condition)`

* `BABYLON.StopAnimationAction`: Stop an animation on a specified target:

    `StopAnimationAction(trigger, target, condition)`

* `BABYLON.DoNothingAction`: Do nothing :)

    `DoNothingAction(trigger, condition)`

* `BABYLON.CombineAction`: This action is a container. You can use it to execute many actions simultaneously on the same trigger. The children property must be an array of actions:

    `CombineAction(trigger, children, condition)`

* `BABYLON.ExecuteCodeAction`: Execute your own code when the trigger is raised and the condition is true:

    `ExecuteCodeAction(trigger, func, condition)`

* `BABYLON.SetParentAction`: Used to define the parent of a node (camera, light, mesh):

    `SetParentAction(trigger, target, parent, condition)`

* `BABYLON.InterpolateValueAction`: This action creates an animation to interpolate the current value of a property to a given target. The following types are supported:
   * `number`
   * `BABYLON.Color3`
   * `BABYLON.Vector3`
   * `BABYLON.Quaternion`

    `InterpolateValueAction(trigger, target, propertyPath, value, duration, condition, stopOtherAnimations)`

* `BABYLON.PlaySoundAction` and `BABYLON.StopSoundAction`: The "sound" parameter is the reference of the sound you created using `var sound = new BABYLON.Sound(...)`

    `PlaySoundAction(trigger, sound, condition)`

    `StopSoundAction(trigger, sound, condition)`

# Conditions
There are three kinds of conditions:

* `BABYLON.ValueCondition`: This condition is true when a given property is equal / greater / lesser / different from a specific value. The following operands are thus supported:
   * `BABYLON.ValueCondition.IsEqual`
   * `BABYLON.ValueCondition.IsDifferent`
   * `BABYLON.ValueCondition.IsGreater`
   * `BABYLON.ValueCondition.IsLesser`

    `ValueCondition(actionManager, target, propertyPath, value, operator)`

* `BABYLON.PredicateCondition`: This condition uses a predicate to determine its state:

    `PredicateCondition(actionManager, predicate)`

* `BABYLON.StateCondition`: This condition checks the ```state``` property of an object and compares it to given value:

    `StateCondition(actionManager, target, value)`

# Experimenting actions
So basically, let's imagine you want to almost hide a mesh when the user touches it.
First of all you have to add a `BABYLON.ActionManager` on it:

`mesh.actionManager = new BABYLON.ActionManager(scene);`

Then you can create an action that will be associated with the `BABYLON.ActionManager.OnPickTrigger` trigger. This action will interpolate the ```mesh.visibility``` property to 0.2:

`var action = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh, "visibility", 0.2, 1000);`

Then add this action to the mesh:

`mesh.actionManager.registerAction(action);`

And you're done! Easy, right?

You can also chain another action to restore the `mesh.visibility` property to default value:

`var action = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh, "visibility", 0.2, 1000);`

`var action2 = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh, "visibility", 1.0, 1000);`

`mesh.actionManager.registerAction(action).then(action2);`

In this case, the first click will hide the button, the following click will restore it, and so on...

# Sprites
Starting with Babylon.js 2.3, sprites can have an action manager: http://www.babylonjs...nd.com/#9RUHH#5

Please note that the SpriteManager must turn picking support on by using `spriteManager.isPickable = true`
Sprites can also control picking with `sprite.isPickable = false / true` (False by default)

# Playground
If you want to play with actions, you can try them at our playground:
http://www.babylonjs.com/playground/?17


text:
using Newtonsoft.Json;

namespace PubNub.Async.Presence.Models
{
	public class PubNubSubscriptionsResponsePayload
	{
		[JsonProperty("channels")]
		public string[] Channels { get; set; }
	}
}


text:
import sys
import argparse
import shutil
import getpass
import os.path
import pydub as pd
import dars as d

def addToiTunes(itunesPath, fileName):
    """Attempts to add fileName to iTunes by moving it into the default Automatically Add to iTunes.localized folder"""
    try:
        shutil.move(fileName, "{}/Automatically Add to iTunes.localized".format(itunesPath))
    except IOError:
        print("Failed to add song to iTunes: The input file or destination folder doesn't exist!")

def getInput(inputString):
    if py3:
        res = input(inputString + "\n")
    else:
        res = raw_input(inputString + "\n")
    return res

def genPath(artist, album, track, trackNum, fmt, itunesPath):
    return "{}/{}/{}/{} {}.{}".format(itunesPath + "/Music", artist, album, trackNum, track, fmt)

def parseArgs():
    """Parses arguments passed in via the command line"""
    parser = argparse.ArgumentParser()
    parser.add_argument("-v", "--verbose", help="increase output verbosity", action="store_true")
    parser.add_argument("--artist", help="specifies artist for tagging of output files")
    parser.add_argument("--album", help="specifies album for tagging of output files")
    parser.add_argument("--track", help="specifies track title for tagging of output files")
    parser.add_argument("--num", help="specifies track number for tagging of output files")
    parser.add_argument("--itunes", help="tells the program where your iTunes folder is located (default: '/Users/{}/Music/iTunes/iTunes Media/')".format(getpass.getuser()))
    parser.add_argument("--fmt", help="specifies track format for tagging of output files")
    return parser.parse_args()

def main():
    """Actually runs the program"""
    artist = args.artist or getInput("Who wrote the song?")
    album = args.album or getInput("What album is the song on?")
    track = args.track or getInput("What is the track name?")
    trackNum = args.num or getInput("What number is the song on the album?")
    fmt = args.fmt or getInput("What format is the song in?")
    itunes = args.itunes or getInput("Where is your iTunes library located? (default: '/Users/{}/Music/iTunes/iTunes Media/')".format(getpass.getuser()))

    if itunes.strip() == "":
        itunes = "/Users/{}/Music/iTunes/iTunes Media".format(getpass.getuser())

    trackNum = trackNum.zfill(2)

    print(itunes)
    print(artist)
    print(album)
    print(track)
    print(trackNum)
    print(genPath(artist, album, track, trackNum, fmt, itunes))
    path = genPath(artist, album, track, trackNum, fmt, itunes)
    out = d.trackSeek(path, artist, album, track, trackNum, fmt)
    for song in out:
        addToiTunes(itunes, song)

py3 = sys.version_info[0] > 2
args = parseArgs()


text:
:man_page: mongoc_cleanup

mongoc_cleanup()
================

Synopsis
--------

.. code-block:: c

  void
  mongoc_cleanup (void);

Description
-----------

.. include:: includes/init_cleanup.txt


text:
package workflow

import org.apache.spark.rdd.RDD
import pipelines.Logging

import scala.reflect.ClassTag

/**
 * Transformers are functions that may be applied both to single input items and to RDDs of input items.
 * They may be chained together, along with [[Estimator]]s and [[LabelEstimator]]s, to produce complex
 * pipelines.
 *
 * @tparam A input item type the transformer takes
 * @tparam B output item type the transformer produces
 */
abstract class Transformer[A, B : ClassTag] extends TransformerNode[B] with Pipeline[A, B] {
  private[workflow] override val nodes: Seq[Node] = Seq(this)
  private[workflow] override val dataDeps: Seq[Seq[Int]] = Seq(Seq(Pipeline.SOURCE))
  private[workflow] override val fitDeps: Seq[Seq[Int]] = Seq(Seq())
  private[workflow] override val sink: Int = 0

  /**
   * Apply this Transformer to an RDD of input items
   * @param in The bulk RDD input to pass into this transformer
   * @return The bulk RDD output for the given input
   */
  def apply(in: RDD[A]): RDD[B] = in.map(apply)

  /**
   * Apply this Transformer to a single input item
   * @param in  The input item to pass into this transformer
   * @return  The output value
   */
  def apply(in: A): B

  private[workflow] final def transform(
    dataDependencies: Seq[_],
    fitDependencies: Seq[TransformerNode[_]]): B = {
    apply(dataDependencies.head.asInstanceOf[A])
  }

  private[workflow] final def transformRDD(
    dataDependencies: Seq[RDD[_]],
    fitDependencies: Seq[TransformerNode[_]]): RDD[B] = {
    apply(dataDependencies.head.asInstanceOf[RDD[A]])
  }
}

object Transformer {
  /**
   * This constructor takes a function and returns a Transformer that maps it over the input RDD
   * @param f The function to apply to every item in the RDD being transformed
   * @tparam I input type of the transformer
   * @tparam O output type of the transformer
   * @return Transformer that applies the given function to all items in the RDD
   */
  def apply[I, O : ClassTag](f: I => O): Transformer[I, O] = new Transformer[I, O] {
    override def apply(in: RDD[I]): RDD[O] = in.map(f)
    override def apply(in: I): O = f(in)
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Boln de la Real Soc. Españ. Hist. Nat. , Madrid 15: 127 (1915)

#### Original name
Septoriopsis citri Gonz. Frag.

### Remarks
null


text:
package guru.mmp.application.persistence;

//~--- JDK imports ------------------------------------------------------------

import java.io.Serializable;

import java.util.Date;
import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * The DatedId class is a JPA embeddable class that stores a composite key with
 * an ID and archived date component.
 *
 * @author Marcus Portmann
 */
@SuppressWarnings("unused")
@Embeddable
public class ArchivedId
  implements Serializable
{
  private static final long serialVersionUID = 1000000;

  /**
   * The archived date component of the archived ID.
   */
  @Column(name = "ARCHIVED", nullable = false)
  @Temporal(TemporalType.TIMESTAMP)
  private Date archived;

  /**
   * The Universally Unique Identifier (UUID) component of the archived ID.
   */
  @Column(name = "ID", nullable = false, length = 40)
  private String id;

  /**
   * Constructs a new ArchivedId.
   */
  public ArchivedId()
  {
    this.id = UUID.randomUUID().toString();
    this.archived = new Date();
  }

  /**
   * Constructs a new ArchivedId.
   *
   * @param id       the Universally Unique Identifier (UUID) component of the archived ID
   * @param archived the archived date component of the archived ID
   */
  public ArchivedId(String id, Date archived)
  {
    this.id = id;
    this.archived = archived;
  }

  /**
   * Indicates whether some other object is "equal to" this one.
   *
   * @param obj the reference object with which to compare
   *
   * @return true if this object is the same as the obj argument otherwise
   *         false
   */
  @Override
  public boolean equals(Object obj)
  {
    if (this == obj)
    {
      return true;
    }

    if (obj == null)
    {
      return false;
    }

    if (getClass() != obj.getClass())
    {
      return false;
    }

    ArchivedId other = (ArchivedId) obj;

    if (archived == null)
    {
      if (other.archived != null)
      {
        return false;
      }
    }
    else if (!archived.equals(other.archived))
    {
      return false;
    }

    if (id == null)
    {
      if (other.id != null)
      {
        return false;
      }
    }
    else if (!id.equals(other.id))
    {
      return false;
    }

    return true;
  }

  /**
   * Returns the archived date component of the archived ID.
   *
   * @return the archived date component of the archived ID
   */
  public Date getArchived()
  {
    return archived;
  }

  /**
   * Returns the Universally Unique Identifier (UUID) component of the archived ID.
   *
   * @return the Universally Unique Identifier (UUID) component of the archived ID
   */
  public String getId()
  {
    return id;
  }

  /**
   * Returns a hash code value for the object.
   *
   * @return a hash code value for the object
   */
  @Override
  public int hashCode()
  {
    return ((id == null)
        ? 0
        : id.hashCode()) + ((archived == null)
        ? 0
        : archived.hashCode());
  }

  /**
   * Set the archived date component of the archived ID.
   *
   * @param archived the archived date component of the archived ID
   */
  public void setArchived(Date archived)
  {
    this.archived = archived;
  }

  /**
   * Set the Universally Unique Identifier (UUID) component of the archived ID.
   *
   * @param id the Universally Unique Identifier (UUID) component of the archived ID
   */
  public void setId(String id)
  {
    this.id = id;
  }
}