text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
	<item android:drawable="@color/grey_200" android:state_pressed="true"/>
	<item android:drawable="@color/grey_200" android:state_focused="true"/>
	<item android:drawable="@color/white_transparent"/>
</selector>


text:
package com.intellij.util.ui;

import com.intellij.ide.DataManager;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.editor.Editor;

import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.util.EventObject;

/**
 * @author Konstantin Bulenkov
 */
public class JTableCellEditorHelper {
  private JTableCellEditorHelper() {}

  public static void typeAhead(final JTable table, final EventObject e, final int row, final int column) {
    if (e instanceof KeyEvent) {
      final Runnable r = new Runnable() {
        @Override
        public void run() {
          if (table.getEditingColumn() != column && table.getEditingRow() != row) return;

          Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
          if (focusOwner == null || !SwingUtilities.isDescendingFrom(focusOwner, table)) return;

          KeyEvent keyEvent = (KeyEvent)e;
          if (Character.isDefined(keyEvent.getKeyChar())) {
            try {
              selectAll(focusOwner);

              Robot r = new Robot();
              r.keyPress(keyEvent.getKeyCode());
              r.keyRelease(keyEvent.getKeyCode());
            }
            catch (AWTException e1) {
              return;
            }
          } else {
            selectAll(focusOwner);
          }
        }
      };

      SwingUtilities.invokeLater(r);
    }
  }

  private static void selectAll(Component component) {
    if (component instanceof TextComponent) {
      ((TextComponent)component).selectAll();
    } else {
      Editor editor = PlatformDataKeys.EDITOR.getData(DataManager.getInstance().getDataContext(component));
      if (editor != null) {
        editor.getSelectionModel().setSelection(0, editor.getDocument().getTextLength());
      }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
package script.ai;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import script.UserLevelUpgrade;
import script.WeaponLevelUpgrade;

import com.xinqihd.sns.gameserver.ai.AIManager;
import com.xinqihd.sns.gameserver.battle.BuffToolType;
import com.xinqihd.sns.gameserver.config.equip.EquipType;
import com.xinqihd.sns.gameserver.config.equip.Gender;
import com.xinqihd.sns.gameserver.config.equip.WeaponColor;
import com.xinqihd.sns.gameserver.config.equip.WeaponPojo;
import com.xinqihd.sns.gameserver.db.mongo.EquipManager;
import com.xinqihd.sns.gameserver.db.mongo.ItemManager;
import com.xinqihd.sns.gameserver.db.mongo.LevelManager;
import com.xinqihd.sns.gameserver.entity.user.Bag;
import com.xinqihd.sns.gameserver.entity.user.PropData;
import com.xinqihd.sns.gameserver.entity.user.PropDataEnhanceField;
import com.xinqihd.sns.gameserver.entity.user.PropDataEnhanceType;
import com.xinqihd.sns.gameserver.entity.user.PropDataEquipIndex;
import com.xinqihd.sns.gameserver.entity.user.PropDataSlot;
import com.xinqihd.sns.gameserver.entity.user.User;
import com.xinqihd.sns.gameserver.entity.user.UserId;
import com.xinqihd.sns.gameserver.reward.Reward;
import com.xinqihd.sns.gameserver.script.ScriptManager;
import com.xinqihd.sns.gameserver.script.ScriptResult;
import com.xinqihd.sns.gameserver.script.function.EquipCalculator;
import com.xinqihd.sns.gameserver.util.MathUtil;

/**
 * Create an AI user according to a real user's properties.
 *
 *
 * @author wangqi
 *
 */
public class UserCreate {

	private static final Logger logger = LoggerFactory.getLogger(UserCreate.class);
	static double q = 3.0;

	public static ScriptResult func(Object[] parameters) {
		ScriptResult result = ScriptManager.checkParameters(parameters, 1);
		if ( result != null ) {
			return result;
		}

		User realUser = (User)parameters[0];

		User aiUser = new User();
		aiUser.setUsername(AIManager.getRandomAIName());
		aiUser.setRoleName(aiUser.getUsername());
		aiUser.set_id(new UserId(aiUser.getUsername(), MathUtil.nextFakeInt(Integer.MAX_VALUE)));
		aiUser.setWinOdds(50+(int)(MathUtil.nextDouble()*50));
		aiUser.setAI(true);
		int genderIndex = (int)Math.round(MathUtil.nextDouble());
		Gender gender = Gender.values()[Gender.FEMALE.ordinal()+genderIndex];
		aiUser.setGender(gender);

		//Copy user's level and exp;
		int realUserLevel = realUser.getLevel();
		if ( realUserLevel < 60 ) {
			if ( MathUtil.nextDouble()<=0.4 ) {
				aiUser.setIsvip(true);
				aiUser.setViplevel((int)(MathUtil.nextDouble()*7));
			}
		} else {
			int vipLevel = MathUtil.nextGaussionInt(4, 7, q);
			aiUser.setIsvip(true);
			aiUser.setViplevel(vipLevel);
		}
		int userLevel = realUser.getLevel();
		if ( userLevel > 3 ) {
			int levelChange = (int)(MathUtil.nextDouble()*4);
			if ( MathUtil.nextDouble()<0.8 ) {
				levelChange *= -1;
			}
			userLevel += levelChange;
		} else {
			//针对小于等于3级的用户,只创建1级AI
			userLevel = 1;
		}
		if ( userLevel <= 1 ) userLevel = 1;
		if ( userLevel > LevelManager.MAX_LEVEL ) userLevel = LevelManager.MAX_LEVEL;
		aiUser.setLevelSimple(userLevel);
		UserLevelUpgrade.func(new Object[]{aiUser});

		//Copy user's wealth
		double percent = 1.2 - MathUtil.nextGaussionDouble(0.0, 3.0);
		aiUser.setGoldenSimple( (int)(realUser.getGolden() * percent) );
		aiUser.setYuanbaoFreeSimple( (int)(realUser.getYuanbaoFree() * percent) );
		//aiUser.setMedal( (int)(realUser.getMedal() * percent) );
		//aiUser.setVoucher( (int)(realUser.getVoucher() * percent) );

		//Copy the statistic
		//aiUser.setWins( (int)(realUser.getWins() * percent) );
		//aiUser.setFailcount( (int)(realUser.getFailcount() * percent) );
		//aiUser.setBattleCount(aiUser.getWins() + aiUser.getFailcount() );
		//if ( aiUser.getBattleCount() > 0 ) {
		//}
		aiUser.setWinOdds( (int)(MathUtil.nextDouble() * 50) + 20 );

		//Copy user's bag
		Bag realBag = realUser.getBag();
		EquipManager manager = EquipManager.getInstance();
		List propDatas = realBag.getWearPropDatas();
		List otherPropDatas = realBag.getOtherPropDatas();

		/**
		 * 强化部分的设定
		 */
		int maxWeaponLevel = 0;
		int maxSuitLevel = 0;
		int maxClothLevel = 0;
		int maxOtherLevel = 0;
		int maxColor = 0;
		int maxQulity = 0;
		int maxStoneLevel = 0;
		int minWeaponLevel = 0;
		int minSuitLevel = 0;
		int minClothLevel = 0;
		int minOtherLevel = 0;
		int minColor = 0;
		int minQulity = 0;
		int minStoneLevel = 0;
		boolean wearHair, wearHat, wearCloth, wearSuit, wearNeck, wearGlass,
			wearGrace1, wearGrace2, wearRing1, wearRing2;
		wearHair = wearHat = wearCloth = wearSuit = wearNeck = wearGlass =
				wearGrace1 = wearGrace2 = wearRing1 = wearRing2 = false;
		if ( realUserLevel < 10 ) {
			maxWeaponLevel = 0;
			maxSuitLevel = 0;
			maxClothLevel = 0;
			maxOtherLevel = 0;
			maxColor = 0;
			wearHair = wearHat = true;
		} else if ( realUserLevel < 22 ) {
			maxWeaponLevel = 2;
			maxSuitLevel = 1;
			maxClothLevel = 3;
			maxOtherLevel = 0;
			maxColor = 1;
			maxStoneLevel = 1;
			wearHair = wearHat = wearCloth = wearGlass = true;
		} else if ( realUserLevel < 32 ) {
			maxWeaponLevel = 4;
			maxSuitLevel = 1;
			maxClothLevel = 3;
			maxOtherLevel = 0;
			maxColor = 2;
			maxStoneLevel = 3;
			wearHair = wearHat = wearCloth = wearNeck = wearGlass =
					wearRing1 = true;
		} else if ( realUserLevel < 42 ) {
			maxWeaponLevel = 5;
			maxSuitLevel = 2;
			maxClothLevel = 3;
			maxOtherLevel = 0;
			maxColor = 3;
			maxQulity = 1;
			maxStoneLevel = 3;
			minStoneLevel = 1;
			wearHair = wearHat = wearCloth = wearSuit = wearNeck = wearGlass =
					wearRing1 = true;
		} else if ( realUserLevel < 52 ) {
			maxWeaponLevel = 6;
			maxSuitLevel = 3;
			maxClothLevel = 5;
			maxOtherLevel = 3;
			maxColor = 4;
			maxQulity = 1;
			maxStoneLevel = 4;
			minStoneLevel = 2;
			minWeaponLevel = 3;
			minSuitLevel = 2;
			minClothLevel = 2;
			minOtherLevel = 1;
			minColor = 2;
			wearHair = wearHat = wearCloth = wearSuit = wearNeck = wearGlass =
					wearRing1 = true;
		} else if ( realUserLevel < 62 ) {
			maxWeaponLevel = 7;
			maxSuitLevel = 3;
			maxClothLevel = 5;
			maxOtherLevel = 5;
			maxColor = 4;
			maxQulity = 1;
			maxStoneLevel = 4;
			minStoneLevel = 2;
			minWeaponLevel = 5;
			minSuitLevel = 2;
			minClothLevel = 2;
			minOtherLevel = 1;
			minColor = 2;
			wearHair = wearHat = wearCloth = wearSuit = wearNeck = wearGlass =
					wearRing1 = true;
		} else if ( realUserLevel < 72 ) {
			maxWeaponLevel = 6;
			maxSuitLevel = 6;
			maxClothLevel = 6;
			maxOtherLevel = 6;
			maxColor = 4;
			maxQulity = 1;
			maxStoneLevel = 4;
			minStoneLevel = 3;
			minWeaponLevel = 4;
			minSuitLevel = 4;
			minClothLevel = 4;
			minOtherLevel = 4;
			minColor = 2;
			wearHair = wearHat = wearCloth = wearSuit = wearNeck = wearGlass =
					wearRing1 = true;
		} else if ( realUserLevel < 75 ) {
			maxWeaponLevel = 8;
			maxSuitLevel = 8;
			maxClothLevel = 8;
			maxOtherLevel = 8;
			maxColor = 5;
			maxQulity = 1;
			maxStoneLevel = 4;
			minStoneLevel = 3;
			minWeaponLevel = 4;
			minSuitLevel = 4;
			minClothLevel = 4;
			minOtherLevel = 4;
			minColor = 2;
			minQulity = 1;
			wearHair = wearHat = wearCloth = wearSuit = wearNeck = wearGlass =
					wearGrace1 = wearRing1 = true;
		} else if ( realUserLevel < 81 ) {
			maxWeaponLevel = 9;
			maxSuitLevel = 9;
			maxClothLevel = 9;
			maxOtherLevel = 9;
			maxColor = 5;
			maxStoneLevel = 5;
			minStoneLevel = 3;
			minWeaponLevel = 6;
			minSuitLevel = 6;
			minClothLevel = 6;
			minOtherLevel = 6;
			minColor = 2;
			minQulity = maxQulity = 1;
			wearHair = wearHat = wearCloth = wearSuit = wearNeck = wearGlass =
					wearGrace1 = wearRing1 = true;
		} else if ( realUserLevel < 90 ) {
			maxWeaponLevel = 10;
			maxSuitLevel = 10;
			maxClothLevel = 10;
			maxOtherLevel = 10;
			maxColor = 5;
			maxStoneLevel = 5;
			minStoneLevel = 3;
			minWeaponLevel = 7;
			minSuitLevel = 7;
			minClothLevel = 7;
			minOtherLevel = 7;
			minColor = 2;
			minQulity = maxQulity = 1;
			wearHair = wearHat = wearCloth = wearSuit = wearNeck = wearGlass =
					wearGrace1 = wearGrace2 = wearRing1 = wearRing2 = true;
		} else if ( realUserLevel <= LevelManager.MAX_LEVEL ) {
			maxWeaponLevel = 12;
			maxSuitLevel = 12;
			maxClothLevel = 12;
			maxOtherLevel = 12;
			maxColor = 5;
			minWeaponLevel = 8;
			minSuitLevel = 8;
			minClothLevel = 8;
			minOtherLevel = 8;
			minColor = 2;
			minQulity = maxQulity = 1;
			wearHair = wearHat = wearCloth = wearSuit = wearNeck = wearGlass =
					wearGrace1 = wearGrace2 = wearRing1 = wearRing2 = true;
		}
		Bag bag = aiUser.getBag();
		//WearWeapon
		int wlevel = MathUtil.nextGaussionInt(minWeaponLevel, maxWeaponLevel+1, q);
		PropData weaponPropData = generatePropData(gender, EquipType.WEAPON, realUserLevel,
				minColor, minQulity, maxColor, maxQulity, wlevel, minStoneLevel, maxStoneLevel);
		if ( weaponPropData != null )
			wearPropData(bag, weaponPropData, PropDataEquipIndex.WEAPON);

		if ( wearHair ) {
			int olevel = MathUtil.nextGaussionInt(minOtherLevel, maxOtherLevel+1, q);
			PropData propData = generatePropData(gender, EquipType.HAIR, realUserLevel,
					minColor, minQulity, maxColor, maxQulity, olevel, minStoneLevel, maxStoneLevel);
			if ( weaponPropData != null )
				wearPropData(bag, propData, PropDataEquipIndex.HAIR);
		}
		if ( wearHat ) {
			int olevel = MathUtil.nextGaussionInt(minOtherLevel, maxOtherLevel+1, q);
			PropData propData = generatePropData(gender, EquipType.HAT, realUserLevel,
					minColor, minQulity, maxColor, maxQulity, olevel, minStoneLevel, maxStoneLevel);
			if ( weaponPropData != null )
				wearPropData(bag, propData, PropDataEquipIndex.HAT);
		}
		if ( wearCloth ) {
			int clevel = MathUtil.nextGaussionInt(minClothLevel, maxClothLevel+1, q);
			PropData propData = generatePropData(gender, EquipType.CLOTHES, realUserLevel,
					minColor, minQulity, maxColor, maxQulity, clevel, minStoneLevel, maxStoneLevel);
			if ( weaponPropData != null )
				wearPropData(bag, propData, PropDataEquipIndex.CLOTH);
		}
		if ( wearSuit ) {
			int level = MathUtil.nextGaussionInt(minSuitLevel, maxSuitLevel+1, q);
			PropData propData = generatePropData(gender, EquipType.SUIT, realUserLevel,
					minColor, minQulity, maxColor, maxQulity, level, minStoneLevel, maxStoneLevel);
			if ( weaponPropData != null )
				wearPropData(bag, propData, PropDataEquipIndex.SUIT);
		}
		if ( wearNeck ) {
			int level = MathUtil.nextGaussionInt(maxSuitLevel, maxSuitLevel+1, q);
			PropData propData = generatePropData(gender, EquipType.NECKLACE, realUserLevel,
					minColor, minQulity, maxColor, maxQulity, level, minStoneLevel, maxStoneLevel);
			if ( weaponPropData != null )
				wearPropData(bag, propData, PropDataEquipIndex.NECKLACE);
		}
		if ( wearGrace1 ) {
			int level = MathUtil.nextGaussionInt(maxSuitLevel, maxSuitLevel+1, q);
			PropData propData = generatePropData(gender, EquipType.BRACELET, realUserLevel,
					minColor, minQulity, maxColor, maxQulity, level, minStoneLevel, maxStoneLevel);
			if ( weaponPropData != null )
				wearPropData(bag, propData, PropDataEquipIndex.BRACELET1);
		}
		if ( wearGrace2 ) {
			int level = MathUtil.nextGaussionInt(maxSuitLevel, maxSuitLevel+1, q);
			PropData propData = generatePropData(gender, EquipType.BRACELET, realUserLevel,
					minColor, minQulity, maxColor, maxQulity, level, minStoneLevel, maxStoneLevel);
			if ( weaponPropData != null )
				wearPropData(bag, propData, PropDataEquipIndex.BRACELET2);
		}
		if ( wearRing1 ) {
			int level = MathUtil.nextGaussionInt(maxSuitLevel, maxSuitLevel+1, q);
			PropData propData = generatePropData(gender, EquipType.RING, realUserLevel,
					minColor, minQulity, maxColor, maxQulity, level, minStoneLevel, maxStoneLevel);
			if ( weaponPropData != null )
				wearPropData(bag, propData, PropDataEquipIndex.RING1);
		}
		if ( wearRing2 ) {
			int level = MathUtil.nextGaussionInt(maxSuitLevel, maxSuitLevel+1, q);
			PropData propData = generatePropData(gender, EquipType.RING, realUserLevel,
					minColor, minQulity, maxColor, maxQulity, level, minStoneLevel, maxStoneLevel);
			if ( weaponPropData != null )
				wearPropData(bag, propData, PropDataEquipIndex.RING2);
		}
		if ( wearGlass ) {
			int level = MathUtil.nextGaussionInt(minOtherLevel, maxOtherLevel, q);
			PropData propData = generatePropData(gender, EquipType.GLASSES, realUserLevel,
					minColor, minQulity, maxColor, maxQulity, level, minStoneLevel, maxStoneLevel);
			if ( weaponPropData != null )
				wearPropData(bag, propData, PropDataEquipIndex.GLASS);
		}

		if ( realUser.getLevel()<=3 ) {
			aiUser.setAttack(1);
			aiUser.setDefend(0);
		}
		aiUser.addTool(BuffToolType.Recover);
		aiUser.addTool(BuffToolType.Recover);
		aiUser.addTool(BuffToolType.Energy);
		aiUser.setConfigHideSuite(true);

		ArrayList list = new ArrayList();
		list.add(aiUser);

		result = new ScriptResult();
		result.setType(ScriptResult.Type.SUCCESS_RETURN);
		result.setResult(list);
		return result;
	}

	/**
	 * @param bag
	 * @param propData
	 */
	private static void wearPropData(Bag bag, PropData propData, PropDataEquipIndex index) {
		if ( propData != null ) {
			bag.addOtherPropDatas(propData);
			bag.wearPropData(propData.getPew(), index.index());
		}
	}

	/**
	 * @param realUserLevel
	 * @param maxColor
	 * @param maxQulity
	 * @param wlevel
	 */
	private static PropData generatePropData(Gender gender, EquipType equipType, int realUserLevel, int minColor, int minQuality,
			int maxColor, int maxQulity, int strLevel, int minStoneLevel, int maxStoneLevel) {
		//quality: 1,2
		int quality = MathUtil.nextGaussionInt(minQuality, maxQulity+1, q);
		if ( quality < 0 ) {
			quality = 0;
		} else if ( quality > 1 ) {
			quality = 1;
		}
		int colorIndex = MathUtil.nextGaussionInt(minColor, maxColor+1, q);
		if ( colorIndex < 0 ) {
			colorIndex = 0;
		} else if ( colorIndex >= WeaponColor.values().length ) {
			colorIndex = WeaponColor.values().length-1;
		}
		WeaponColor color = WeaponColor.values()[colorIndex];
		WeaponPojo weapon = null;
		int tryTimes = 0;
		while ( weapon == null && tryTimes++ < 20 ) {
			weapon = EquipManager.getInstance().getRandomWeaponWithoutCheckReward(gender, realUserLevel, equipType, quality+1);
		}
		if ( weapon == null ) {
			quality = 1;
		}
		tryTimes = 0;
		while ( weapon == null && tryTimes++ < 20 ) {
			weapon = EquipManager.getInstance().getRandomWeaponWithoutCheckReward(gender, realUserLevel, equipType, quality+1);
		}
		if ( weapon == null ) {
			logger.info("equipType: {}, quality:{}, realUserLevel:{}", new Object[]{
					equipType, quality+1, realUserLevel
			});
		} else {
			PropData propData = weapon.toPropData(30, color);
			if ( strLevel > 0 ) {
				propData = EquipCalculator.weaponUpLevel(propData, strLevel);
			}
			if ( maxStoneLevel > 0 ) {
				int stoneLevel = MathUtil.nextGaussionInt(minStoneLevel+1, maxStoneLevel+1, q);
				if ( stoneLevel < 0 ) {
					stoneLevel = 0;
				} else if ( stoneLevel > maxStoneLevel ) {
					stoneLevel = maxStoneLevel;
				}
				if ( stoneLevel > 0 ) {
					PropDataSlot slot = null;
					if ( equipType == EquipType.WEAPON ) {
						slot = new PropDataSlot();
						slot.setSlotType(PropDataEnhanceField.ATTACK);
						EquipCalculator.calculateForgeData(propData, stoneLevel, ItemManager.attackStoneId, slot);
					}
					slot = new PropDataSlot();
					slot.setSlotType(PropDataEnhanceField.DEFEND);
					EquipCalculator.calculateForgeData(propData, stoneLevel, ItemManager.defendStoneId, slot);
					slot = new PropDataSlot();
					slot.setSlotType(PropDataEnhanceField.AGILITY);
					EquipCalculator.calculateForgeData(propData, stoneLevel, ItemManager.agilityStoneId, slot);
					slot = new PropDataSlot();
					slot.setSlotType(PropDataEnhanceField.LUCKY);
					EquipCalculator.calculateForgeData(propData, stoneLevel, ItemManager.luckStoneId, slot);
				}
			}
			return propData;
		}
		return null;
	}
}


text:
package org.pentaho.di.plugins.fileopensave.providers.vfs.model;

import org.pentaho.di.plugins.fileopensave.api.providers.Tree;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by bmorrise on 2/13/19.
 */
public class VFSTree implements Tree<VFSLocation> {

  public static final String PROVIDER = "vfs";
  private static final int ORDER = 3;

  public VFSTree( String name ) {
    this.name = name;
  }

  public String getProvider() {
    return PROVIDER;
  }

  private String name;

  @Override public String getName() {
    return name;
  }

  private List<VFSLocation> vfsLocations = new ArrayList<>();

  @Override public List<VFSLocation> getChildren() {
    return vfsLocations;
  }

  @Override public void addChild( VFSLocation child ) {
    vfsLocations.add( child );
  }

  @Override public boolean isCanAddChildren() {
    return false;
  }

  @Override public int getOrder() {
    return ORDER;
  }

  @Override public boolean isHasChildren() {
    return true;
  }
}


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends CI_Controller {

	public function __construct() {
   		parent::__construct();
   		$this->load->model('users','',TRUE);
 	}

	public function index() {
		$this->load->helper(array('form'));
		$this->load->view('login');

		if($this->session->userdata('logged_in')) {
			redirect('admin', 'refresh');
		}
	}

	function validacao() {
		$this->load->library('form_validation');
		$this->form_validation->set_rules('email', 'E-mail', 'trim|required|xss_clean');
		$this->form_validation->set_rules('senha', 'Password', 'trim|required|xss_clean|callback_check_database');
		if($this->form_validation->run() == FALSE) {
			$this->load->view('login');
		} else {
			redirect('admin', 'refresh');
		}
	}

	function check_database($senha) {
		$email = $this->input->post('email');
		$result = $this->users->login($email, $senha);

		if($result) {
			$sess_array = array();
			foreach($result as $row) {
				$sess_array = array(
					'id_lider' => $row->id_lider,
					'email' => $row->email
				);
				$this->session->set_userdata('logged_in', $sess_array);
			}
			return TRUE;
		} else {
			$this->form_validation->set_message('check_database', 'Login ou senha inválido');
			return false;
		}
	}

	function logout() {
		$this->session->unset_userdata('logged_in');
		$this->session->sess_destroy();
		redirect('login', 'refresh');
	}
}

 ?>


text:
namespace OpenCurve.Engine
{
    using System;
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Content;
    using Microsoft.Xna.Framework.Graphics;

    public class FpsCounter : IOpenCurveComponent
    {
        private readonly SpriteBatch _spriteBatch;
        private readonly SpriteFont _spriteFont;

        private int _frameRate;
        private int _frameCounter;
        private TimeSpan _elapsedTime = TimeSpan.Zero;

        public FpsCounter()
        {
            _spriteBatch = GameServices.GetService<SpriteBatch>();
            _spriteFont = GameServices.GetService<ContentManager>().Load<SpriteFont>("GameFont");
        }

        public void Update(GameTime gameTime)
        {
            _elapsedTime += gameTime.ElapsedGameTime;

            if (_elapsedTime > TimeSpan.FromSeconds(1))
            {
                _elapsedTime -= TimeSpan.FromSeconds(1);
                _frameRate = _frameCounter;
                _frameCounter = 0;
            }
        }

        public void Draw(GameTime gameTime)
        {
            _frameCounter++;

            var fps = String.Format("FPS: {0}", _frameRate);

            _spriteBatch.Begin();

            _spriteBatch.DrawString(_spriteFont, fps, new Vector2(4, 30), Color.White);

            _spriteBatch.End();
        }
    }
}


text:
package com.chatalytics.web.utils;

import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;

import org.apache.storm.shade.com.google.common.collect.Lists;
import org.junit.Test;

import java.util.List;

import static org.junit.Assert.assertEquals;

/**
 * Tests {@link ResourceUtils}
 *
 * @author giannis
 *
 */
public class ResourceUtilsTest {

    @Test
    public void testGetOptionalForParameter() {
        Optional<String> result = ResourceUtils.getOptionalForParameter(null);
        assertEquals(Optional.absent(), result);

        result = ResourceUtils.getOptionalForParameter("");
        assertEquals(Optional.absent(), result);

        String param = "some-param";
        result = ResourceUtils.getOptionalForParameter(param);
        assertEquals(param, result.get());
    }

    @Test
    public void testGetListFromNullable() {
        assertEquals(ImmutableList.of(), ResourceUtils.getListFromNullable(null));
        List<String> test = Lists.newArrayList("a", "b");
        assertEquals(test, ResourceUtils.getListFromNullable(test));
    }

    @Test
    public void testGetOptionalForParameterAsInt() {
        Optional<Integer> result = ResourceUtils.getOptionalForParameterAsInt(null);
        assertEquals(Optional.absent(), result);

        result = ResourceUtils.getOptionalForParameterAsInt("");
        assertEquals(Optional.absent(), result);

        int value = 2;
        result = ResourceUtils.getOptionalForParameterAsInt(Integer.toString(value));
        assertEquals(value, result.get().intValue());
    }

    @Test
    public void testGetOptionalForParameterAsBool() {
        Optional<Boolean> result = ResourceUtils.getOptionalForParameterAsBool(null);
        assertEquals(Optional.absent(), result);

        result = ResourceUtils.getOptionalForParameterAsBool("");
        assertEquals(Optional.absent(), result);

        boolean value = false;
        result = ResourceUtils.getOptionalForParameterAsBool(Boolean.toString(value));
        assertEquals(value, result.get().booleanValue());
    }
}


text:
\chapter{Proceso de gestión}
\section{Estimaciones del proyecto}
Los recursos financieros de los que se disponen son limitados. Serán los participantes los que tendrán que invertir su dinero en el proyecto. Actualmente, se ha establecido un límite de 200 euros.\\

Como no poseemos datos estadísticos sobre los participantes del proyecto, se considerara la productividad de todos los participantes por igual. Así, la productividad del grupo será de 10 pm (personas mes). Considerando por lo tanto que 1 pm = 20 pd (personas día).\\

La estimación del coste del proyecto, se ha realizado conforme a horas de esfuerzo por persona.  Dando una productividad al alumno de un 67\%. Si el curso universitario consta de 270 días, entonces un estudiante puede ser capaz de aprovechar 180 días. Con un rendimiento medio al día de 1 hora, una persona tendrá una productividad de 180 horas. De esta forma, al ser 10 estudiantes universitarios se estima que costará 1800 horas. Para la planificación no se puede contar con el total de horas, puesto que no existe proyecto sin contratiempos. Por esta razón se ha considerado la regla del 80\%. Ésta dice, ``para poder obtener un coste real aproximado al coste esperado debemos planificar el 80\% del tiempo, puesto que el tiempo restante se invierte en imprevistos''.\\

En este proyecto tendremos dos peculiaridades añadidas que nos obligan a volver a aplicar dicha regla. El modelo de proceso usado (SCRUM) y el tipo de estrategia de desarrollo (desarrollo por prototipos). Esto lo tendremos en cuenta en la estimación, pero para que la planificación no se vuelva tríptica se añadirán como tareas estimadas los porcentajes de incertidumbre. Estimándose los imprevistos debidos a estas peculiaridades, quedando el tiempo a planificar en el 80\% del coste total, es decir, en 1440 horas. Porque, aunque es cierto que tendremos imprevistos, los prototipos nos aportan la reutilización de los mismos, abaratando costes y aumentando la productividad por hora invertida.
  \includegraphics[width=0.96\textwidth]{2.GestionYPlanificacion/estimacion.jpg}

\section{Plan de proyecto}
\subsection{Módulos}
Los módulos tienen las funcionalidades agrupadas por prioridad. De esta forma los spint primero se centraran en las del módulo 1 y acabarán en el 3. Garantizando, que la aparición de algún riesgo afecte lo menos posible. También busca orientar la administración hacia el desarrollo software RUP, pretendiendo así el mejor seguimiento del proyecto por el profesor (cliente). Pudiendo asemejarse a funcionalidades por iteración.
\begin{itemize}

\item Módulo1
\begin{itemize}
\item	Control remoto de luces.
\item	Control de dispositivos por infrarrojos.
\item	Control remoto de la puerta del garaje.
\item	Control remoto de persianas.
\item	Aplicación IOS y Android.
\end{itemize}

\item Módulo2
\begin{itemize}
\item	Control remoto del telefonillo.
\item	Control de enchufe.
\item	Previsión meteorológica.
\item	Información de sensores meteorológicos.
\item	Información de sensores de movimiento.
\item	Aplicación web.
\end{itemize}

\item Módulo3
\begin{itemize}
\item	Perfiles de mandatos.
\item	Control remoto de Hardware.
\item	Modo offline.
\item	Control remoto de climatización.
\item	Recolección de datos sobre el uso de dispositivos.
\item	Monitorización consumo energético en tiempo real.
\end{itemize}

\end{itemize}
\subsection{Recursos del proyecto}
Los 10 componentes del grupo son: \\

Héctor Gutiérrez, Fernando Arturo Guzmán Almonte, Álvaro Morales Lozano, Luis Antonio Saavedra Palacios, Víctor Vicente, Miguel Alexander Maldonado Lenis, Alejandro Ladrón de Guevara, Víctor Ochoa Rodríguez, José Antonio Rey Álvarez, Colin Tirado Caamaño.\\

El calendario laboral asociado a cada uno de ellos es de 7 horas a la semana.\\
Los recursos materiales de los que se dispone son:
\begin{itemize}
\item	Arduinos	3
\item	Raspberry PI	1
\item	Protoboard	3
\item	Servidor	1
\item	Shield		2
\item	Conectores	2
\item	Maletines	1
\item	Entrenadores	*(libres en horario de clase facultad informática UCM)
\item	Soldadores	2
\end{itemize}
Todos ellos con disponibilidad total de horario salvo los entrenadores.

\subsection{Entregas}
Este proyecto tiene 2 entregas importantes:
\begin{itemize}
\item	22 enero. Se entregara toda la documentación y una demostración de un prototipo parcial de una funcionalidad básica.
\item	Mayo. Sera la entrega final del proyecto, que llevara un prototipo alpha estable del proyecto.
\end{itemize}

\subsection{EDT}
La estructura de descomposición del trabajo sigue el diagrama de la figura ~\ref{im:edt}

\begin{figure}[h]
\includegraphics[width=0.9\textwidth]{2.GestionYPlanificacion/EDT.png}
\caption{Estructura de descomposición del trabajo}
\label{im:edt}
\end{figure}

Conforme a este, se han sacado las tareas de las funcionalidades definidas en los requisitos del proyecto.
\section{Planificación del proyecto}
La planificación del proyecto se ha llevado a cabo utilizando una herramienta de gestión de proyectos llamada MS Project 2010. En él, se tienen todas las tareas asociadas a las funcionalidades que se quieren implementar. Puesto que no puede meterse en este documento, se adjunta un archivo llamado ``Microsoft Project - Plan de proyecto\_21enero.pdf'' con una captura de esta planificación.\\

Esa planificación, tiene desarrollada todas las tareas que se tendrán que hacer para ofrecer cierta funcionalidad. Pero éstas, se irán haciendo, conforme al sprint a los que pertenezcan. Dando nos la facilidad de elegir la tarea que más repercusión tenga (tarea critica) o la que más funcionalidad nos ofrezca (cuello de botella).
\section{Sprint }
Se ha decidido tener 3 sprint en el primer cuatrimestre, dirigidos a poder ofrecer un prototipo con funcionalidad infrarroja, en vistas a la primera entrega que será en enero.\\

Para el segundo cuatrimestre se espera poder hacer sprint más cortos, ya que no se desarrollara tanta documentación.
\section{Control y gestión del proyecto}
\subsection{Plan de gestión de requisitos}
Se prevé que los requisitos puedan cambiar, pero será fundamentalmente por mejoras en la fase de desarrollo, ligadas a la funcionalidad de los prototipos. Por lo que, más bien forma parte del desarrollo iterativo incremental.
\subsection{Plan de control de la planificación}
Al tener desarrolladas las tareas y estimas, el control del proyecto se lleva por cantidad de trabajo realizado, es decir esfuerzo realizado por unidad de tiempo. En nuestro caso esta relación será de 1 a 1 por simplicidad. Así podremos seguir la progresión del proyecto en un diagrama burn down que nos ofrece la herramienta CASE (MS Project 2010).
\subsection{Plan de control de calidad}
Para garantizar al cliente el correcto funcionamiento se tienen los test, que nos garantizaran su fiabilidad. Pero para garantizar la calidad del proyecto se tienen previstas como tareas ya consideradas (lanzadas en la planificación), revisiones técnicas formales sobre los diseños y las arquitecturas (no aparecen con ese nombre por especificar más la tarea). Que son la parte más críticas en hardware. Aunque estas se llevaran a cabo tras algún test, sea o no satisfactorio, puesto que no es tan fácil depurar hardware. \\

Al formar parte de la planificación, se puede decir que esas revisiones forman parte del proyecto, ya que se han contabilizado. Ofreciendo así una garantía de calidad mínima.
\section{Plan de gestión de riesgos}
Gracias a la detallada descomposición y a que estas sean tareas asequibles. Los riesgos asociados a índices catastróficos han desaparecido. Pero es cierto que podrían aparecer riesgos que también tengan repercusión notable sobre la funcionalidad, inicial tal y como se detalla en el documento de riesgos. La periódica actualización de la planificación nos avisara de la posible aparición, ofreciéndonos la posibilidad de tratar la mayor parte de ellos con anterioridad.


text:
/**
  * Defines the similarity measurements between nodes
  */
package uk.ac.cdrc.mintsearch.ranking

import uk.ac.cdrc.mintsearch.WeightedLabelSet
import uk.ac.cdrc.mintsearch.index.LabelMaker

trait NodeSimilarity {
  self: LabelMaker =>
  def similarity(wls: WeightedLabelSet[L], other: WeightedLabelSet[L]): Double
}

trait NESSSimilarity extends NodeSimilarity {
  self: LabelMaker =>
  import uk.ac.cdrc.mintsearch.asWightedLabelSetWrapper

  override def similarity(wls: WeightedLabelSet[L], other: WeightedLabelSet[L]): Double = {
    other.values.sum - (other ~~ wls).values.sum
  }

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Ann. bot. fenn. 26(3): 252 (1989)

#### Original name
Cladonia ahtii S. Stenroos

### Remarks
null


text:
package org.apache.wicket.markup.html;

import java.io.File;
import java.io.IOException;
import java.net.JarURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Locale;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.regex.Pattern;

import javax.servlet.http.HttpServletResponse;

import org.apache.wicket.AbortException;
import org.apache.wicket.Application;
import org.apache.wicket.RequestCycle;
import org.apache.wicket.SharedResources;
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.protocol.http.WebRequestCycle;
import org.apache.wicket.protocol.http.servlet.AbortWithWebErrorCodeException;
import org.apache.wicket.settings.IResourceSettings;
import org.apache.wicket.util.lang.Classes;
import org.apache.wicket.util.lang.PackageName;
import org.apache.wicket.util.lang.Packages;
import org.apache.wicket.util.resource.IFixedLocationResourceStream;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.string.Strings;
import org.apache.wicket.util.time.Time;
import org.apache.wicket.util.watch.IModifiable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Represents a localizable static resource.
 *

 * Use like eg:
 *
 *

 * PackageResource IMG_UNKNOWN = PackageResource.get(EditPage.class, "questionmark.gif");
 *

 *
 * where the static resource references image 'questionmark.gif' from the the package that EditPage
 * is in to get a package resource.
 *

 *
 * Access to resources can be granted or denied via a {@link IPackageResourceGuard}. Please see
 * {@link IResourceSettings#getPackageResourceGuard()} as well.
 *
 * @author Jonathan Locke
 * @author Eelco Hillenius
 * @author Juergen Donnerstag
 */
public class PackageResource extends WebResource implements IModifiable, IPackageResourceGuard
{
	/**
	 * Exception thrown when the creation of a package resource is not allowed.
	 */
	public static final class PackageResourceBlockedException extends WicketRuntimeException
	{
		private static final long serialVersionUID = 1L;

		/**
		 * Construct.
		 *
		 * @param message
		 */
		public PackageResourceBlockedException(String message)
		{
			super(message);
		}
	}

	/**
	 * common extension pattern for css files; matches all files with extension 'css'.
	 *
	 * @deprecated Will be removed in 2.0; contribute resources one by one instead
	 */
	@Deprecated
	public static final Pattern EXTENSION_CSS = Pattern.compile(".*\\.css");

	/**
	 * common extension pattern for javascript files; matches all files with extension 'js'.
	 *
	 * @deprecated Will be removed in 2.0; contribute resources one by one instead
	 */
	@Deprecated
	public static final Pattern EXTENSION_JS = Pattern.compile(".*\\.js");

	/** log. */
	private static final Logger log = LoggerFactory.getLogger(PackageResource.class);

	private static final long serialVersionUID = 1L;

	/**
	 * Binds the resources that match the provided pattern to the given application object. Will
	 * create any resources if not already in the shared resources of the application object.
	 *
	 * @param application
	 *            The application to bind to.
	 * @param scope
	 *            The scope of the resource.
	 * @param pattern
	 *            A regular expression to match against the contents of the package of the provided
	 *            scope class (eg ".*\\.js" will add all the files with extension
	 *            "js" from that package).
	 *
	 * @deprecated Since Wicket 1.2.1 this method is effectively a no-op. {@link PackageResource
	 *             package resources} are automatically tried and bound as shared resources so that
	 *             they don't have to be pre-registered anymore. Will be removed in 2.0
	 */
	@Deprecated
	public static void bind(Application application, Class<?> scope, Pattern pattern)
	{
	}

	/**
	 * Binds the resources that match the provided pattern to the given application object. Will
	 * create any resources if not already in the shared resources of the application object and
	 * does that recursively when the recurse parameter is true, or just for the scoped package if
	 * that parameter is false
	 *
	 * @param application
	 *            The application to bind to.
	 * @param scope
	 *            The scope of the resource.
	 * @param pattern
	 *            A regular expression to match against the contents of the package of the provided
	 *            scope class (eg ".*\\.js" will add all the files with extension
	 *            "js" from that package).
	 * @param recurse
	 *            Whether this method should recurse into sub packages
	 *
	 * @deprecated Since Wicket 1.2.1 this method is effectively a no-op. {@link PackageResource
	 *             package resources} are automatically tried and bound as shared resources so that
	 *             they don't have to be pre-registered anymore. Will be removed in 2.0
	 */
	@Deprecated
	public static void bind(Application application, Class<?> scope, Pattern pattern,
		boolean recurse)
	{
	}

	/**
	 * Binds a resource to the given application object. Will create the resource if not already in
	 * the shared resources of the application object.
	 *
	 * @param application
	 *            The application to bind to.
	 * @param scope
	 *            The scope of the resource.
	 * @param name
	 *            The name of the resource (like "myfile.js")
	 * @throw IllegalArgumentException when the requested package resource was not found
	 */
	public static void bind(Application application, Class<?> scope, String name)
	{
		bind(application, scope, name, null, null);
	}

	/**
	 * Binds a resource to the given application object. Will create the resource if not already in
	 * the shared resources of the application object.
	 *
	 * @param application
	 *            The application to bind to.
	 * @param scope
	 *            The scope of the resource.
	 * @param name
	 *            The name of the resource (like "myfile.js")
	 * @param locale
	 *            The locale of the resource.
	 * @throw IllegalArgumentException when the requested package resource was not found
	 */
	public static void bind(Application application, Class<?> scope, String name, Locale locale)
	{
		bind(application, scope, name, locale, null);
	}

	/**
	 * Binds a resource to the given application object. Will create the resource if not already in
	 * the shared resources of the application object.
	 *
	 * @param application
	 *            The application to bind to.
	 * @param scope
	 *            The scope of the resource.
	 * @param name
	 *            The name of the resource (like "myfile.js")
	 * @param locale
	 *            The locale of the resource.
	 * @param style
	 *            The style of the resource.
	 * @throw IllegalArgumentException when the requested package resource was not found
	 */
	public static void bind(Application application, Class<?> scope, String name, Locale locale,
		String style)
	{
		if (name == null)
		{
			throw new IllegalArgumentException("argument name may not be null");
		}

		// first check on a direct hit for efficiency
		if (exists(scope, name, locale, style))
		{
			// we have got a hit, so we may safely assume the name
			// argument is not a regular expression, and can thus
			// just add the resource and return
			PackageResource packageResource = get(scope, name, locale, style);
			SharedResources sharedResources = Application.get().getSharedResources();
			sharedResources.add(scope, name, locale, style, packageResource);
		}
		else
		{
			throw new IllegalArgumentException("no package resource was found for scope " + scope +
				", name " + name + ", locale " + locale + ", style " + style);
		}
	}

	/**
	 * Gets whether a resource for a given set of criteria exists.
	 *
	 * @param scope
	 *            This argument will be used to get the class loader for loading the package
	 *            resource, and to determine what package it is in. Typically this is the class in
	 *            which you call this method
	 * @param path
	 *            The path to the resource
	 * @param locale
	 *            The locale of the resource
	 * @param style
	 *            The style of the resource (see {@link org.apache.wicket.Session})
	 * @return true if a resource could be loaded, false otherwise
	 */
	public static boolean exists(final Class<?> scope, final String path, final Locale locale,
		final String style)
	{
		String absolutePath = Packages.absolutePath(scope, path);
		return Application.get()
			.getResourceSettings()
			.getResourceStreamLocator()
			.locate(scope, absolutePath, style, locale, null) != null;
	}

	/**
	 * Gets non-localized resources for a given set of criteria. Multiple resource can be loaded for
	 * the same criteria if they match the pattern. If no resources were found, this method returns
	 * null.
	 *
	 * @param scope
	 *            This argument will be used to get the class loader for loading the package
	 *            resource, and to determine what package it is in. Typically this is the calling
	 *            class/ the class in which you call this method
	 * @param pattern
	 *            Regexp pattern to match resources
	 * @return The resources, never null but may be empty
	 * @deprecated Will be removed in 2.0; contribute resources one by one instead
	 */
	@Deprecated
	public static PackageResource[] get(Class<?> scope, Pattern pattern)
	{
		return get(scope, pattern, false);
	}

	/**
	 * Gets non-localized resources for a given set of criteria. Multiple resource can be loaded for
	 * the same criteria if they match the pattern. If no resources were found, this method returns
	 * null.
	 *
	 * @param scope
	 *            This argument will be used to get the class loader for loading the package
	 *            resource, and to determine what package it is in. Typically this is the calling
	 *            class/ the class in which you call this method
	 * @param pattern
	 *            Regexp pattern to match resources
	 * @param recurse
	 *            Whether this method should recurse into sub packages
	 * @return The resources, never null but may be empty
	 * @deprecated Will be removed in 2.0; contribute resources one by one instead
	 */
	@SuppressWarnings("unchecked")
	@Deprecated
	public static PackageResource[] get(Class<?> scope, Pattern pattern, boolean recurse)
	{
		final List resources = new ArrayList();
		String packageRef = Strings.replaceAll(PackageName.forClass(scope).getName(), ".", "/")
			.toString();
		ClassLoader loader = scope.getClassLoader();
		try
		{
			// loop through the resources of the package
			Enumeration packageResources = loader.getResources(packageRef);
			while (packageResources.hasMoreElements())
			{
				URL resource = (URL)packageResources.nextElement();
				URLConnection connection = resource.openConnection();
				if (connection instanceof JarURLConnection)
				{
					JarFile jf = ((JarURLConnection)connection).getJarFile();
					scanJarFile(scope, pattern, recurse, resources, packageRef, jf);
				}
				else
				{
					String absolutePath = scope.getResource("").toExternalForm();
					File basedir;
					URI uri;
					try
					{
						uri = new URI(absolutePath);
					}
					catch (URISyntaxException e)
					{
						throw new RuntimeException(e);
					}
					try
					{
						basedir = new File(uri);
					}
					catch (IllegalArgumentException e)
					{
						log.debug("Can't construct the uri as a file: " + absolutePath);
						// if this is thrown then the path is not really a
						// file. but could be a zip.
						String jarZipPart = uri.getSchemeSpecificPart();
						// lowercased for testing if jar/zip, but leave the real
						// filespec unchanged
						String lowerJarZipPart = jarZipPart.toLowerCase();
						int index = lowerJarZipPart.indexOf(".zip");
						if (index == -1)
						{
							index = lowerJarZipPart.indexOf(".jar");
						}
						if (index == -1)
						{
							throw e;
						}

						String filename = jarZipPart.substring(0, index + 4); // 4 =
						// len of ".jar" or ".zip"
						log.debug("trying the filename: " + filename + " to load as a zip/jar.");
						JarFile jarFile = new JarFile(filename, false);
						scanJarFile(scope, pattern, recurse, resources, packageRef, jarFile);
						return (PackageResource[])resources.toArray(new PackageResource[resources.size()]);
					}
					if (!basedir.isDirectory())
					{
						throw new IllegalStateException("unable to read resources from directory " +
							basedir);
					}
				}
			}
		}
		catch (IOException e)
		{
			throw new WicketRuntimeException(e);
		}

		return (PackageResource[])resources.toArray(new PackageResource[resources.size()]);
	}

	/**
	 * Gets a non-localized resource for a given set of criteria. Only one resource will be loaded
	 * for the same criteria.
	 *
	 * @param scope
	 *            This argument will be used to get the class loader for loading the package
	 *            resource, and to determine what package it is in. Typically this is the calling
	 *            class/ the class in which you call this method
	 * @param path
	 *            The path to the resource
	 * @return The resource
	 */
	public static PackageResource get(final Class<?> scope, final String path)
	{
		return get(scope, path, null, null);
	}

	/**
	 * Gets the resource for a given set of criteria. Only one resource will be loaded for the same
	 * criteria.
	 *
	 * @param scope
	 *            This argument will be used to get the class loader for loading the package
	 *            resource, and to determine what package it is in. Typically this is the class in
	 *            which you call this method
	 * @param path
	 *            The path to the resource
	 * @param locale
	 *            The locale of the resource
	 * @param style
	 *            The style of the resource (see {@link org.apache.wicket.Session})
	 * @return The resource
	 */
	public static PackageResource get(final Class<?> scope, final String path, final Locale locale,
		final String style)
	{
		final SharedResources sharedResources = Application.get().getSharedResources();
		PackageResource resource = (PackageResource)sharedResources.get(scope, path, locale, style,
			true);
		if (resource == null)
		{
			resource = newPackageResource(scope, path, locale, style);
			Application.get().getSharedResources().add(scope, path, locale, style, resource);
		}
		return resource;
	}

	/**
	 * Create a new PackageResource
	 *
	 * @param scope
	 *            This argument will be used to get the class loader for loading the package
	 *            resource, and to determine what package it is in. Typically this is the class in
	 *            which you call this method
	 * @param path
	 *            The path to the resource
	 * @param locale
	 *            The locale of the resource
	 * @param style
	 *            The style of the resource (see {@link org.apache.wicket.Session})
	 * @return The resource
	 */
	protected static PackageResource newPackageResource(final Class<?> scope, final String path,
		final Locale locale, final String style)
	{
		return new PackageResource(scope, path, locale, style);
	}

	/* removed in 2.0 */
	private static void scanJarFile(Class<?> scope, Pattern pattern, boolean recurse,
		final List<PackageResource> resources, String packageRef, JarFile jf)
	{
		Enumeration<JarEntry> enumeration = jf.entries();
		while (enumeration.hasMoreElements())
		{
			JarEntry je = enumeration.nextElement();
			String name = je.getName();
			if (name.startsWith(packageRef))
			{
				name = name.substring(packageRef.length() + 1);
				if (pattern.matcher(name).matches() && (recurse || (name.indexOf('/') == -1)))
				{
					// we add the entry as a package resource
					resources.add(get(scope, name, null, null));
				}
			}
		}
	}

	/** The path to the resource */
	private final String absolutePath;

	/** The resource's locale */
	private Locale locale;

	/** The path this resource was created with. */
	private final String path;

	/** The scoping class, used for class loading and to determine the package. */
	private final String scopeName;

	/** The resource's style */
	private final String style;

	/**
	 * Hidden constructor.
	 *
	 * @param scope
	 *            This argument will be used to get the class loader for loading the package
	 *            resource, and to determine what package it is in
	 * @param path
	 *            The path to the resource
	 * @param locale
	 *            The locale of the resource
	 * @param style
	 *            The style of the resource
	 */
	protected PackageResource(final Class<?> scope, final String path, final Locale locale,
		final String style)
	{
		// Convert resource path to absolute path relative to base package
		absolutePath = Packages.absolutePath(scope, path);

		scopeName = scope.getName();
		this.path = path;
		this.locale = locale;
		this.style = style;

		if (locale != null)
		{
			/*
			 * Get the resource stream so that the real locale that could be resolved is set.
			 * Silently ignore not resolvable resources as we are not serving the resource for now
			 */
			getResourceStream(false);

			// Invalidate it again so that it won't hold up resources
			invalidate();
		}
	}

	/**
	 * Gets the absolute path of the resource.
	 *
	 * @return the absolute resource path
	 */
	public final String getAbsolutePath()
	{
		return absolutePath;
	}

	/**
	 * Gets the locale.
	 *
	 * @return The Locale of this package resource
	 */
	public final Locale getLocale()
	{
		return locale;
	}

	/**
	 * Gets the path this resource was created with.
	 *
	 * @return the path
	 */
	public final String getPath()
	{
		return path;
	}

	/**
	 * @return Gets the resource for the component.
	 */
	@Override
	public IResourceStream getResourceStream()
	{
		return getResourceStream(true);
	}

	/**
	 * @return Gets the resource for the component.
	 * @param failOnError
	 *            throw an AbortException when resource does not exist
	 */
	public IResourceStream getResourceStream(boolean failOnError)
	{
		// Locate resource
		IResourceStream resourceStream = Application.get()
			.getResourceSettings()
			.getResourceStreamLocator()
			.locate(getScope(), absolutePath, style, locale, null);

		// Check that resource was found
		if (resourceStream == null)
		{
			if (!failOnError)
			{
				// Do not abort the request, as we are not yet serving the resource
				return null;
			}

			String msg = "Unable to find package resource [path = " + absolutePath + ", style = " +
				style + ", locale = " + locale + "]";
			log.warn(msg);
			if (RequestCycle.get() instanceof WebRequestCycle)
			{
				throw new AbortWithWebErrorCodeException(HttpServletResponse.SC_NOT_FOUND, msg);
			}
			else
			{
				throw new AbortException();
			}
		}

		Class<?> realScope = getScope();
		String realPath = absolutePath;
		if (resourceStream instanceof IFixedLocationResourceStream)
		{
			realPath = ((IFixedLocationResourceStream)resourceStream).locationAsString();
			if (realPath != null)
			{
				int index = realPath.indexOf(absolutePath);
				if (index != -1)
				{
					realPath = realPath.substring(index);
				}
				else
				{
					// TODO just fall back on the full path without a scope..
					realScope = null;
				}
			}
			else
			{
				realPath = absolutePath;
			}
		}

		if (accept(realScope, realPath) == false)
		{
			throw new PackageResourceBlockedException(
					"Access denied to (static) package resource " + absolutePath +
							". See IPackageResourceGuard");
		}

		locale = resourceStream.getLocale();

		if (resourceStream != null)
		{
			lastModifiedTime = resourceStream.lastModifiedTime();
			lastModifiedTimeUpdate = System.currentTimeMillis();
		}

		return resourceStream;
	}

	/**
	 * Gets the scoping class, used for class loading and to determine the package.
	 *
	 * @return the scoping class
	 */
	public final Class<?> getScope()
	{
		return Classes.resolveClass(scopeName);
	}

	/**
	 * Gets the style.
	 *
	 * @return the style
	 */
	public final String getStyle()
	{
		return style;
	}

	private transient Time lastModifiedTime = null;
	private transient long lastModifiedTimeUpdate = 0;

	/**
	 * Returns the last modified time of resource
	 *
	 * @return last modified time or null if the time can not be determined
	 */
	public Time lastModifiedTime()
	{
		if (lastModifiedTimeUpdate == 0 ||
			lastModifiedTimeUpdate < System.currentTimeMillis() - 5 * (1000 * 60))
		{
			IResourceStream resourceStream = getResourceStream(false);
			if (resourceStream != null)
			{
				lastModifiedTime = resourceStream.lastModifiedTime();
			}
			lastModifiedTimeUpdate = System.currentTimeMillis();
		}
		return lastModifiedTime;

	}

	/**
	 * @see org.apache.wicket.markup.html.IPackageResourceGuard#accept(java.lang.Class,
	 *      java.lang.String)
	 */
	public boolean accept(Class<?> scope, String path)
	{
		IPackageResourceGuard guard = Application.get()
			.getResourceSettings()
			.getPackageResourceGuard();

		return guard.accept(scope, path);
	}

	@Override
	public String toString()
	{
		StringBuilder result = new StringBuilder();
		result.append('[')
			.append(getClass().getSimpleName())
			.append(' ')
			.append("name = ")
			.append(getPath())
			.append(", scope = ")
			.append(scopeName)
			.append(", locale = ")
			.append(locale)
			.append(", style = ")
			.append(style)
			.append(']');
		return result.toString();
	}
}


text:
require 'spec_helper' #here in this same config/ dir

describe CsvPirate do
  describe "VERSION" do
    it "should be a string" do
      CsvPirate::VERSION.class.should == String
    end
  end
  describe "MAJOR" do
    it "should be a string" do
      CsvPirate::MAJOR.class.should == Fixnum
      CsvPirate::MAJOR.should_not == ''
    end
  end
  describe "MINOR" do
    it "should be a string" do
      CsvPirate::MINOR.class.should == Fixnum
      CsvPirate::MINOR.should_not == ''
    end
  end
  describe "PATCH" do
    it "should be a string" do
      CsvPirate::PATCH.class.should == Fixnum
      CsvPirate::PATCH.should_not == ''
    end
  end
  describe "BUILD" do
    it "should be a string" do
      [String, NilClass].include?(CsvPirate::BUILD.class).should == true
    end
  end

  describe "support the old < v5 syntax" do
    # Mapping needs to be a separate test, because testing the method call mocks the object, and breaks the actual #new
    describe "#new mapping" do
      it "should map to CsvPirate::TheCapn.new" do
        CsvPirate::TheCapn.should_receive(:new)
        # Similar to old example from the v5 readme
        @csv_pirate = CsvPirate.new({
          :swag => [Struct.new(:first_name, :last_name, :birthday).new('Joe','Smith','12/24/1805')],
          :waggoner => 'active_users_logged_in',
          :booty => [:first_name, :last_name],
          :chart => ['log','csv'],
          :bury_treasure => true,
        })
      end
    end
    describe "#new" do
      before(:each) do
        # Similar to old example from the v5 readme
        @csv_pirate = CsvPirate.new({
          :swag => [Struct.new(:first_name, :last_name, :birthday).new('Joe','Smith','12/24/1805')],
          :waggoner => 'active_users_logged_in',
          :booty => [:first_name, :last_name],
          :chart => ['log','csv'],
          :bury_treasure => true,
        })
      end
      it "should create an instance of CsvPirate::TheCapn" do
        @csv_pirate.class.should == CsvPirate::TheCapn
      end
      it "should NOT mine the data" do
        @csv_pirate.buried_treasure.length.should == 0
      end
    end

    # Mapping needs to be a separate test, because testing the method call mocks the object, and breaks the actual #new
    describe "#create mapping" do
      it "should map to CsvPirate::TheCapn.create" do
        CsvPirate::TheCapn.should_receive(:create)
        # Similar to old example from the v5 readme
        @csv_pirate = CsvPirate.create({
                                      :swag => [Struct.new(:first_name, :last_name, :birthday).new('Joe','Smith','12/24/1805')],
                                      :waggoner => 'active_users_logged_in',
                                      :booty => [:first_name, :last_name],
                                      :chart => ['log','csv'],
                                      :bury_treasure => true,
                                    })
      end
    end
    describe "#create" do
      before(:each) do
        # Similar to old example from the v5 readme
        @csv_pirate = CsvPirate.create({
          :swag => [Struct.new(:first_name, :last_name, :birthday).new('Joe','Smith','12/24/1805')],
          :waggoner => 'active_users_logged_in',
          :booty => [:first_name, :last_name],
          :chart => ['log','csv'],
          :bury_treasure => true,
        })
      end
      it "should create an instance of CsvPirate::TheCapn" do
        @csv_pirate.class.should == CsvPirate::TheCapn
      end
      it "should mine the data" do
        @csv_pirate.buried_treasure.length.should == 1
      end
    end
  end

end


text:
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (An eco-friendly internet of disposable things is coming)
[#]: via: (https://www.networkworld.com/article/3406462/an-eco-friendly-internet-of-disposable-things-is-coming.html)
[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/)

An eco-friendly internet of disposable things is coming
======
Researchers are creating a non-hazardous, bacteria-powered miniature battery that can be implanted into shipping labels and packaging to monitor temperature and track packages in real time.
![Thinkstock][1]

Get ready for a future of disposable of internet of things (IoT) devices, one that will mean everything is connected to networks. It will be particularly useful in logistics, being used in single-use plastics in retail packaging and throw-away shippers' carboard boxes.

How it will happen? The answer is when non-hazardous, disposable bio-batteries make it possible. And that moment might be approaching. Researchers say they're closer to commercializing a bacteria-powered miniature battery that they say will propel the IoDT.

**[ Learn more: [Download a PDF bundle of five essential articles about IoT in the enterprise][2] ]**

The "internet of disposable things is a new paradigm for the rapid evolution of wireless sensor networks," says Seokheun Choi, an associate professor at Binghamton University, [in an article on the school's website][3].

"Current IoDTs are mostly powered by expensive and environmentally hazardous batteries," he says. Those costs can be significant in any kind of large-scale deployment, he says. And furthermore, with exponential growth, the environmental concerns would escalate rapidly.

The miniaturized battery that Choi's team has come up with is uniquely charged through power created by bacteria. It doesn't have metals and acids in it. And it's designed specifically to provide energy to sensors and radios in single-use IoT devices. Those could be the kinds of sensors ideal for supply-chain logistics where the container is ultimately going to end up in a landfill, creating a hazard.

Another use case is real-time analysis of packaged food, with sensors monitoring temperature and location, preventing spoilage and providing safer food handling. For example, a farm product could be tracked for on-time delivery, as well as have its temperature measured, all within the packaging, as it moves from packaging facility to consumer. In the event of a food-borne illness outbreak, say, one can quickly find out where the product originated—which apparently is hard to do now.

Other use cases could be battery-impregnated shipping labels that send real-time data to the internet. Importantly, in both use cases, packaging can be discarded without added environmental concerns.

### How the bacteria-powered batteries work

A slow release of nutrients provide the energy to the bacteria-powered batteries, which the researchers say can last up to eight days. "Slow and continuous reactions" convert the microbial nutrients into "long standing power," they say in [their paper's abstract][4].

"Our biobattery is low-cost, disposable, and environmentally-friendly," Choi says.

Origami, the Japanese paper-folding skill used to create objects, was an inspiration for a similar microbial-based battery project the group wrote about last year in a paper. This one is liquid-based and not as long lasting. A bacteria-containing liquid was absorbed along the porous creases in folded paper, creating the paper-delivered power source, perhaps to be used in a shipping label.

"Low-cost microbial fuel cells (MFCs) can be done efficiently by using a paper substrate and origami techniques," [the group wrote then][5].

Scientists, too, envisage electronics now printed on circuit boards (PCBs) and can be toxic on disposal being printed entirely on eco-friendly paper. Product cycles, such as those found now in mobile devices and likely in future IoT devices, are continually getting tighter—thus PCBs are increasingly being disposed. Solutions are needed, experts say.

Put the battery in the paper, too, is the argument here. And while you're at it, get the biodegradation of the used-up biobattery to help break-down the organic-matter paper.

Ultimately, Choi believes that the power-creating bacteria could even be introduced naturally by the environment—right now it's added on by the scientists.

**More on IoT:**

  * [What is the IoT? How the internet of things works][6]
  * [What is edge computing and how it's changing the network][7]
  * [Most powerful Internet of Things companies][8]
  * [10 Hot IoT startups to watch][9]
  * [The 6 ways to make money in IoT][10]
  * [What is digital twin technology? [and why it matters]][11]
  * [Blockchain, service-centric networking key to IoT success][12]
  * [Getting grounded in IoT networking and security][2]
  * [Building IoT-ready networks must become a priority][13]
  * [What is the Industrial IoT? [And why the stakes are so high]][14]

Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind.

--------------------------------------------------------------------------------

via: https://www.networkworld.com/article/3406462/an-eco-friendly-internet-of-disposable-things-is-coming.html

作者:[Patrick Nelson][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

[a]: https://www.networkworld.com/author/Patrick-Nelson/
[b]: https://github.com/lujun9972
[1]: https://images.techhive.com/images/article/2017/04/green-data-center-intro-100719502-large.jpg
[2]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html
[3]: https://www.binghamton.edu/news/story/1867/everything-will-connect-to-the-internet-someday-and-this-biobattery-could-h
[4]: https://www.sciencedirect.com/science/article/abs/pii/S0378775319305580
[5]: https://www.sciencedirect.com/science/article/pii/S0960148117311606
[6]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html
[7]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html
[8]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html
[9]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html
[10]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html
[11]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html
[12]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html
[13]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html
[14]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html
[15]: https://www.facebook.com/NetworkWorld/
[16]: https://www.linkedin.com/company/network-world


text:
    #define blink_h

    class blinkClass {
        private:
            int pin;
            int pwmIndex;
            char *powerLevel;
            //buffer for serial communication
            char *buffer;
            //what to display to lcd
            char (*lcdRows)[17];
        public:
            blinkClass();
            void doubleBlink();
            void setup(char *buff, char rows[][17]);
            // void setup(char *, char*[16]);
            // void setup(char *);
            // void setup(char*[2][16]);
            void loop();
            void actionChange();
            void pwmBrightness();
    };

    extern blinkClass blink;
#endif


text:
for i in range(100):
  print('Meow world')


text:
<resources>
    <string name="app_name">hops</string>
</resources>


text:
/**
 * @name: pat
 * @description: module, which gets all the seperated/capsuled components injected and administrates them
 * @dependency: ngAnimate, ngRoute, ngBonita, ngResource, ngCookies, ngStorage (see github-repository for references), ProcessDataOpModule
 *              CookieConfModule, ReviewRequestControllerModule, ReviewRequest2ControllerModule, SubmitRequestControllerModule,
 *              SubmitRequest2ControllerModule, SubmitRequest3ControllerModule, SubmitRequest4ControllerModule, SubmitRequest5ControllerModule
 *              SubmitRequest6ControllerModule
 *
 * @author: Steven Bartels
 */

(function (angular) {
    'use strict';

    angular
        .module('pat',
            [
                // Angular
                'ngAnimate',
                'ngRoute',
                'ngResource',
                'ngCookies',

                // 3rd-Party
                'ngBonita',
                'ngStorage',

                // Config/Directive/Service
                'ProcessDataOpModule',
                'CookieConfModule',

                // Controller
                'ReviewRequestControllerModule',
                'ReviewRequest2ControllerModule',
                'SubmitRequestControllerModule',
                'SubmitRequest2ControllerModule',
                'SubmitRequest3ControllerModule',
                'SubmitRequest4ControllerModule',
                'SubmitRequest5ControllerModule',
                'SubmitRequest6ControllerModule'
            ]);
})(angular);


text:
#pragma once
#include <aws/eks/EKS_EXPORTS.h>
#include <aws/eks/EKSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/eks/model/UpdateLabelsPayload.h>
#include <aws/eks/model/NodegroupScalingConfig.h>
#include <utility>
#include <aws/core/utils/UUID.h>

namespace Aws
{
namespace EKS
{
namespace Model
{

  /**
   */
  class AWS_EKS_API UpdateNodegroupConfigRequest : public EKSRequest
  {
  public:
    UpdateNodegroupConfigRequest();

    // 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 "UpdateNodegroupConfig"; }

    Aws::String SerializePayload() const override;

    /**
     *
The name of the Amazon EKS cluster that the managed node group resides
     * in.

     */
    inline const Aws::String& GetClusterName() const{ return m_clusterName; }

    /**
     *
The name of the Amazon EKS cluster that the managed node group resides
     * in.

     */
    inline bool ClusterNameHasBeenSet() const { return m_clusterNameHasBeenSet; }

    /**
     *
The name of the Amazon EKS cluster that the managed node group resides
     * in.

     */
    inline void SetClusterName(const Aws::String& value) { m_clusterNameHasBeenSet = true; m_clusterName = value; }

    /**
     *
The name of the Amazon EKS cluster that the managed node group resides
     * in.

     */
    inline void SetClusterName(Aws::String&& value) { m_clusterNameHasBeenSet = true; m_clusterName = std::move(value); }

    /**
     *
The name of the Amazon EKS cluster that the managed node group resides
     * in.

     */
    inline void SetClusterName(const char* value) { m_clusterNameHasBeenSet = true; m_clusterName.assign(value); }

    /**
     *
The name of the Amazon EKS cluster that the managed node group resides
     * in.

     */
    inline UpdateNodegroupConfigRequest& WithClusterName(const Aws::String& value) { SetClusterName(value); return *this;}

    /**
     *
The name of the Amazon EKS cluster that the managed node group resides
     * in.

     */
    inline UpdateNodegroupConfigRequest& WithClusterName(Aws::String&& value) { SetClusterName(std::move(value)); return *this;}

    /**
     *
The name of the Amazon EKS cluster that the managed node group resides
     * in.

     */
    inline UpdateNodegroupConfigRequest& WithClusterName(const char* value) { SetClusterName(value); return *this;}

    /**
     *
The name of the managed node group to update.

     */
    inline const Aws::String& GetNodegroupName() const{ return m_nodegroupName; }

    /**
     *
The name of the managed node group to update.

     */
    inline bool NodegroupNameHasBeenSet() const { return m_nodegroupNameHasBeenSet; }

    /**
     *
The name of the managed node group to update.

     */
    inline void SetNodegroupName(const Aws::String& value) { m_nodegroupNameHasBeenSet = true; m_nodegroupName = value; }

    /**
     *
The name of the managed node group to update.

     */
    inline void SetNodegroupName(Aws::String&& value) { m_nodegroupNameHasBeenSet = true; m_nodegroupName = std::move(value); }

    /**
     *
The name of the managed node group to update.

     */
    inline void SetNodegroupName(const char* value) { m_nodegroupNameHasBeenSet = true; m_nodegroupName.assign(value); }

    /**
     *
The name of the managed node group to update.

     */
    inline UpdateNodegroupConfigRequest& WithNodegroupName(const Aws::String& value) { SetNodegroupName(value); return *this;}

    /**
     *
The name of the managed node group to update.

     */
    inline UpdateNodegroupConfigRequest& WithNodegroupName(Aws::String&& value) { SetNodegroupName(std::move(value)); return *this;}

    /**
     *
The name of the managed node group to update.

     */
    inline UpdateNodegroupConfigRequest& WithNodegroupName(const char* value) { SetNodegroupName(value); return *this;}

    /**
     *
The Kubernetes labels to be applied to the nodes in the node group after the
     * update.

     */
    inline const UpdateLabelsPayload& GetLabels() const{ return m_labels; }

    /**
     *
The Kubernetes labels to be applied to the nodes in the node group after the
     * update.

     */
    inline bool LabelsHasBeenSet() const { return m_labelsHasBeenSet; }

    /**
     *
The Kubernetes labels to be applied to the nodes in the node group after the
     * update.

     */
    inline void SetLabels(const UpdateLabelsPayload& value) { m_labelsHasBeenSet = true; m_labels = value; }

    /**
     *
The Kubernetes labels to be applied to the nodes in the node group after the
     * update.

     */
    inline void SetLabels(UpdateLabelsPayload&& value) { m_labelsHasBeenSet = true; m_labels = std::move(value); }

    /**
     *
The Kubernetes labels to be applied to the nodes in the node group after the
     * update.

     */
    inline UpdateNodegroupConfigRequest& WithLabels(const UpdateLabelsPayload& value) { SetLabels(value); return *this;}

    /**
     *
The Kubernetes labels to be applied to the nodes in the node group after the
     * update.

     */
    inline UpdateNodegroupConfigRequest& WithLabels(UpdateLabelsPayload&& value) { SetLabels(std::move(value)); return *this;}

    /**
     *
The scaling configuration details for the Auto Scaling group after the
     * update.

     */
    inline const NodegroupScalingConfig& GetScalingConfig() const{ return m_scalingConfig; }

    /**
     *
The scaling configuration details for the Auto Scaling group after the
     * update.

     */
    inline bool ScalingConfigHasBeenSet() const { return m_scalingConfigHasBeenSet; }

    /**
     *
The scaling configuration details for the Auto Scaling group after the
     * update.

     */
    inline void SetScalingConfig(const NodegroupScalingConfig& value) { m_scalingConfigHasBeenSet = true; m_scalingConfig = value; }

    /**
     *
The scaling configuration details for the Auto Scaling group after the
     * update.

     */
    inline void SetScalingConfig(NodegroupScalingConfig&& value) { m_scalingConfigHasBeenSet = true; m_scalingConfig = std::move(value); }

    /**
     *
The scaling configuration details for the Auto Scaling group after the
     * update.

     */
    inline UpdateNodegroupConfigRequest& WithScalingConfig(const NodegroupScalingConfig& value) { SetScalingConfig(value); return *this;}

    /**
     *
The scaling configuration details for the Auto Scaling group after the
     * update.

     */
    inline UpdateNodegroupConfigRequest& WithScalingConfig(NodegroupScalingConfig&& value) { SetScalingConfig(std::move(value)); return *this;}

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline const Aws::String& GetClientRequestToken() const{ return m_clientRequestToken; }

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline bool ClientRequestTokenHasBeenSet() const { return m_clientRequestTokenHasBeenSet; }

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline void SetClientRequestToken(const Aws::String& value) { m_clientRequestTokenHasBeenSet = true; m_clientRequestToken = value; }

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline void SetClientRequestToken(Aws::String&& value) { m_clientRequestTokenHasBeenSet = true; m_clientRequestToken = std::move(value); }

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline void SetClientRequestToken(const char* value) { m_clientRequestTokenHasBeenSet = true; m_clientRequestToken.assign(value); }

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline UpdateNodegroupConfigRequest& WithClientRequestToken(const Aws::String& value) { SetClientRequestToken(value); return *this;}

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline UpdateNodegroupConfigRequest& WithClientRequestToken(Aws::String&& value) { SetClientRequestToken(std::move(value)); return *this;}

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline UpdateNodegroupConfigRequest& WithClientRequestToken(const char* value) { SetClientRequestToken(value); return *this;}

  private:

    Aws::String m_clusterName;
    bool m_clusterNameHasBeenSet;

    Aws::String m_nodegroupName;
    bool m_nodegroupNameHasBeenSet;

    UpdateLabelsPayload m_labels;
    bool m_labelsHasBeenSet;

    NodegroupScalingConfig m_scalingConfig;
    bool m_scalingConfigHasBeenSet;

    Aws::String m_clientRequestToken;
    bool m_clientRequestTokenHasBeenSet;
  };

} // namespace Model
} // namespace EKS
} // namespace Aws


text:
namespace StiGame
{

namespace FS
{

Directory::Directory(std::string m_name, std::string m_parent)
{
    name = m_name;
    parent = m_parent;
}

Directory::~Directory()
{

}

EntryType Directory::type(void)
{
    return ET_Directory;
}

}

}


text:
'use strict';

// [START bigquery_quickstart]
// Imports the Google Cloud client library
const BigQuery = require('@google-cloud/bigquery');

// Your Google Cloud Platform project ID
const projectId = 'YOUR_PROJECT_ID';

// Instantiates a client
const bigquery = BigQuery({
  projectId: projectId
});

// The name for the new dataset
const datasetName = 'my_new_dataset';

// Creates the new dataset
bigquery.createDataset(datasetName)
  .then((results) => {
    const dataset = results[0];

    console.log(`Dataset ${dataset.id} created.`);
  });
// [END bigquery_quickstart]