text:
package mods.flammpfeil.extrascepterstaff;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.flammpfeil.extrascepterstaff.common.InitProxy;
import mods.flammpfeil.extrascepterstaff.common.item.ClarissaWnadRodOnUpdate;
import mods.flammpfeil.extrascepterstaff.common.item.ItemResource;
import mods.flammpfeil.extrascepterstaff.common.item.WandRodOnUpdate;
import mods.flammpfeil.extrascepterstaff.common.lib.crafting.InfusionExtraScepterStaffRecipe;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagShort;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraftforge.common.ChestGenHooks;
import net.minecraftforge.common.config.Configuration;
import thaumcraft.api.IRepairable;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.crafting.CrucibleRecipe;
import thaumcraft.api.crafting.IArcaneRecipe;
import thaumcraft.api.crafting.InfusionRecipe;
import thaumcraft.api.research.ResearchCategories;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.api.wands.IWandRodOnUpdate;
import thaumcraft.api.wands.StaffRod;
import thaumcraft.api.wands.WandCap;
import thaumcraft.api.wands.WandRod;
import thaumcraft.common.config.ConfigItems;
import thaumcraft.common.items.wands.ItemWandCasting;
import thaumcraft.common.items.wands.WandRodPrimalOnUpdate;

import java.util.Iterator;
import java.util.Map;

@Mod(name= ExtraScepterStaff.modname, modid= ExtraScepterStaff.modid, version=ExtraScepterStaff.version, dependencies = "required-after:Thaumcraft")
public class ExtraScepterStaff {

	public static final String modname = "ExtraScepterStaff";
    public static final String modid = "flammpfeil.extrascepterstaff";
    public static final String version = "@VERSION@";

    public static Item itemResource;

	public static Configuration mainConfiguration;

    public static final CreativeTabs tab = new CreativeTabs(modid)
    {
        @SideOnly(Side.CLIENT)
        @Override
        public Item getTabIconItem()
        {
            return itemResource;
        }
    };

    Map<Integer,WandCap> WandCaps = Maps.newHashMap();
    Map<Integer,WandRod> WandCores = Maps.newHashMap();
    Map<Integer,StaffRod> StaffCores = Maps.newHashMap();

    public enum ExtraMaterials{
        Alicorn(1,"alicorn"),
        Clarissa(2,"clarissa"),
        Clarissa2(3,"clarissa2"),

        ;
        public final String name;
        public final int index;

        ExtraMaterials(int index, String name){
            this.name = name;
            this.index = index;
        }
    }

    public static String getCustomItemStackName(ExtraMaterials mat){
        return String.format("materials.%s",mat.name);
    }

	@EventHandler
	public void preInit(FMLPreInitializationEvent evt){

		/*
            mainConfiguration = new Configuration(evt.getSuggestedConfigurationFile());

            try{
                mainConfiguration.load();
            }
            finally
            {
                mainConfiguration.save();
            }
        */

        itemResource = new ItemResource()
                .setUnlocalizedName("flammpfeil.extrascepterstaff.resource")
                .setTextureName("flammpfeil.extrascepterstaff:logo");
        GameRegistry.registerItem(itemResource, "resource");

        {
            ExtraMaterials mat = ExtraMaterials.Alicorn;

            int index = mat.index;
            String name = mat.name;
            IWandRodOnUpdate update = new WandRodOnUpdate(Aspect.AIR,Aspect.ORDER,Aspect.ENTROPY);

            ItemResource.registerMaterialName(index, name);

            ResourceLocation loc = new ResourceLocation(modid,"models/wand_rod_" + name + ".png");

            ItemStack material = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.Material));
            GameRegistry.registerCustomItemStack("material." + name,material);

            ItemStack wandcap = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.WandCap));
            WandCap cap = new WandCap("ESS_"+name,0.95F, Lists.newArrayList(Aspect.AIR,Aspect.ORDER,Aspect.ENTROPY),0.8F,wandcap,7);
            ResourceLocation caploc = new ResourceLocation(modid,"models/wand_cap_" + name + ".png");
            cap.setTexture(caploc);
            WandCaps.put(index,cap);

            ItemStack wandcore = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.WandRod));
            WandCores.put(index,new WandRod("ESS_"+name, 130, wandcore, 12, update, loc));

            ItemStack staffcore = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.StaffRod));
            StaffCores.put(index,new StaffRod("ESS_"+name, 250, staffcore, 37, update, loc));

            ResourceLocation locEx = new ResourceLocation(modid,"models/ex_wand_rod_" + name + ".png");
            ItemStack exstaffcore = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.ExtraStaffRod));
            StaffCores.put(index,new StaffRod("ESS_Ex_"+name, 300, exstaffcore, 50, update, locEx));
        }

        {
            ExtraMaterials mat = ExtraMaterials.Clarissa;

            int index = mat.index;
            String name = mat.name;

            ItemResource.registerMaterialName(index, name);

            ResourceLocation loc = new ResourceLocation(modid,"models/wand_rod_" + name + ".png");

            ItemStack wandcap = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.WandCap));
            WandCap cap = new WandCap("ESS_"+name,2.0F,wandcap,7);
            ResourceLocation caploc = new ResourceLocation(modid,"models/wand_cap_" + name + ".png");
            cap.setTexture(caploc);
            WandCaps.put(index,cap);

            //ItemStack staffcore = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.StaffRod));

            IWandRodOnUpdate updateex = new ClarissaWnadRodOnUpdate(true,true);
            ResourceLocation locEx = new ResourceLocation(modid,"models/ex_wand_rod_" + name + ".png");
            ItemStack exstaffcore = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.ExtraStaffRod));
            StaffRod rod = new StaffRod("ESS_Ex_"+name, 500, exstaffcore, 9999, updateex, locEx);
            rod.setRunes(true);
            rod.setGlowing(true);
            StaffCores.put(index,rod);
        }

        {
            ExtraMaterials mat = ExtraMaterials.Clarissa2;

            int index = mat.index;
            String name = mat.name;
            IWandRodOnUpdate update = new ClarissaWnadRodOnUpdate(false,false);

            ItemResource.registerMaterialName(index, name);

            ResourceLocation loc = new ResourceLocation(modid,"models/wand_rod_" + name + ".png");

            ItemStack wandcap = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.WandCap));
            WandCap cap = new WandCap("ESS_"+name,2.0F,wandcap,7);
            ResourceLocation caploc = new ResourceLocation(modid,"models/wand_cap_" + name + ".png");
            cap.setTexture(caploc);
            WandCaps.put(index,cap);

            ItemStack wandcore = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.WandRod));
            WandCores.put(index,new WandRod("ESS_"+name, 150, wandcore, 26, update, loc));

            ItemStack staffcore = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.StaffRod));
            StaffRod staffRod = new StaffRod("ESS_"+name, 350, staffcore, 37, update, loc);
            staffRod.setRunes(true);
            StaffCores.put(index,staffRod);

            IWandRodOnUpdate updateex = new ClarissaWnadRodOnUpdate(false,true);
            ResourceLocation locEx = new ResourceLocation(modid,"models/ex_wand_rod_" + name + ".png");
            ItemStack exstaffcore = new ItemStack(itemResource,1,ItemResource.getItemDamage(index, ItemResource.ResourceType.ExtraStaffRod));
            StaffRod rod = new StaffRod("ESS_Ex_"+name, 400, exstaffcore, 9999, updateex, locEx);
            rod.setRunes(true);
            rod.setGlowing(true);
            StaffCores.put(index,rod);
        }
    }
    @EventHandler
    public void init(FMLInitializationEvent evt){

        InitProxy.proxy.initializeItemRenderer();
    }

    @EventHandler
    public void modsLoaded(FMLPostInitializationEvent evt)
    {
/*
        ItemStack soul = GameRegistry.findItemStack(SlashBlade.modid,SlashBlade.ProudSoulStr,1);
        ThaumcraftApi.registerObjectTag(soul, new AspectList()
                .add(Aspect.METAL, 1)
                .add(Aspect.SOUL, 2)
                .add(Aspect.FIRE, 2)
        );

        ItemStack tinySoul = GameRegistry.findItemStack(SlashBlade.modid,SlashBlade.TinyBladeSoulStr,1);
        ThaumcraftApi.registerObjectTag(tinySoul, new AspectList()
                .add(Aspect.METAL, 1)
                .add(Aspect.SOUL, 1)
                .add(Aspect.FIRE, 1)
        );

        ItemStack ingot = GameRegistry.findItemStack(SlashBlade.modid,SlashBlade.IngotBladeSoulStr,1);
        ThaumcraftApi.registerObjectTag(ingot, new AspectList()
                .add(Aspect.METAL, 3)
                .add(Aspect.SOUL, 8)
        );

        ItemStack sphere = GameRegistry.findItemStack(SlashBlade.modid,SlashBlade.SphereBladeSoulStr,1);
        ThaumcraftApi.registerObjectTag(sphere, new AspectList()
                .add(Aspect.METAL, 2)
                .add(Aspect.SOUL, 8)
                .add(Aspect.CRYSTAL, 1)
        );

        {
            //================================================================================================================
            ItemStack blade = SlashBlade.getCustomBlade(modid,"flammpfeil.slashblade.windeater");

            Item crystal = GameRegistry.findItem("Thaumcraft","blockCrystal");
                    //"ElementalSword",

            InfusionRecipe recipe = ThaumcraftApi.addInfusionCraftingRecipe("BLADEOFTHEZEPHYR",
                blade,
                1,
                new AspectList().add(Aspect.AIR, 8).add(Aspect.WEAPON, 8).add(Aspect.ENERGY, 8),
                new ItemStack(swordOfZephyr),
                new ItemStack[]{
                          new ItemStack(crystal, 1, 0)
                        , soul
                        , new ItemStack(Blocks.diamond_ore)
                        , soul
                        , sphere
                        , soul
                        , new ItemStack(Items.bone, 1, 0)
                        , soul });

            //================================================================================================================
            ItemStack reqiredBlade = blade.copy();
            {
                reqiredBlade.setItemDamage(OreDictionary.WILDCARD_VALUE);
                NBTTagCompound tag = ItemSlashBlade.getItemTagCompound(reqiredBlade);
                ItemSlashBlade.KillCount.set(tag,100);
                String name="flammpfeil.slashblade.zephyr.reqired";
                GameRegistry.registerCustomItemStack(name,reqiredBlade);
                ItemSlashBladeNamed.NamedBlades.add(String.format("%s:%s",modid,name));
            }

            ItemStack trueBlade = SlashBlade.getCustomBlade(modid,"flammpfeil.slashblade.zephyr");
            IRecipe wakeup = new RecipeAwakeBlade(trueBlade,
                    reqiredBlade,
                    " X ",
                    "XBX",
                    " X ",
                    'X',soul,
                    'B',reqiredBlade);
            GameRegistry.addRecipe(wakeup);//================================================================================================================
            ItemStack reqiredBladeBroken = reqiredBlade.copy();
            {
                NBTTagCompound tag = ItemSlashBlade.getItemTagCompound(reqiredBladeBroken);
                ItemSlashBlade.IsBroken.set(tag,true);
            }

            IRecipe wakeup2 = new RecipeAwakeBlade(trueBlade,
                    reqiredBladeBroken,
                    " X ",
                    "XBX",
                    " X ",
                    'X',soul,
                    'B',reqiredBladeBroken);
            GameRegistry.addRecipe(wakeup2);
            //================================================================================================================

            new ResearchItem("BLADEOFTHEZEPHYR", "ARTIFICE",
                    new AspectList().add(Aspect.WEAPON, 5).add(Aspect.AIR, 5).add(Aspect.ENERGY, 3),
                    -10, 5, 1, blade)
                .setPages(new ResearchPage("tc.research_page.BLADEOFTHEZEPHYR.1"),
                        new ResearchPage(recipe),
                        new ResearchPage(wakeup),
                        new ResearchPage(wakeup2))
                .setParents(new String[]{"ELEMENTALSWORD"})
                .setHidden()
                .setItemTriggers(soul, tinySoul, ingot, sphere)
                .registerResearchItem();

        }
*/

        String categoryKey = "EXTRASCEPTERSTAFF";
        ResearchCategories.registerCategory(categoryKey, new ResourceLocation("flammpfeil.extrascepterstaff", "textures/items/logo.png"), new ResourceLocation("thaumcraft", "textures/gui/gui_researchback.png"));

        {
            int offsetCol = 0;
            int offsetRow = 0;

            ExtraMaterials materialEx = ExtraMaterials.Clarissa;
            String nameEx = materialEx.name;
            int indexEx = materialEx.index;

            ItemStack wandcapEx = new ItemStack(itemResource,1, ItemResource.getItemDamage(indexEx, ItemResource.ResourceType.WandCap));
            ItemStack staffcoreEx = new ItemStack(itemResource,1, ItemResource.getItemDamage(indexEx, ItemResource.ResourceType.StaffRod));

            ExtraMaterials material = ExtraMaterials.Clarissa2;
            String name = material.name;
            int index = material.index;

            ItemStack wandcap = new ItemStack(itemResource,1, ItemResource.getItemDamage(index, ItemResource.ResourceType.WandCap));
            ItemStack wandrod = new ItemStack(itemResource,1, ItemResource.getItemDamage(index, ItemResource.ResourceType.WandRod));
            ItemStack staffcore = new ItemStack(itemResource,1, ItemResource.getItemDamage(index, ItemResource.ResourceType.StaffRod));

            {
                ThaumcraftApi.registerObjectTag(staffcoreEx, new AspectList()
                        .add(Aspect.ORDER, 2).add(Aspect.ENTROPY, 2)
                );

                ChestGenHooks.addItem(ChestGenHooks.PYRAMID_DESERT_CHEST,new WeightedRandomChestContent(staffcoreEx,1,1,1));
                ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_CHEST,new WeightedRandomChestContent(staffcoreEx,1,1,1));
                ChestGenHooks.addItem(ChestGenHooks.DUNGEON_CHEST,new WeightedRandomChestContent(staffcoreEx,1,1,1));
            }

            {
                String researchKey = String.format("ROD_ESS_%s",name);

                Item crystal = GameRegistry.findItem("Thaumcraft","blockCrystal");

                InfusionRecipe recipe = ThaumcraftApi.addInfusionCraftingRecipe(researchKey, wandrod.copy(), 10,
                        new AspectList()
                                .add(Aspect.ORDER, 32)
                                .add(Aspect.ENTROPY, 32)
                                .add(Aspect.LIGHT, 64)
                                .add(Aspect.MAGIC, 64),
                        new ItemStack(ConfigItems.itemWandRod, 1, 100),
                        new ItemStack[]{
                                new ItemStack(Blocks.quartz_block,1,1),
                                new ItemStack(crystal, 1, 4),
                                new ItemStack(ConfigItems.itemShard, 1, 6),
                                new ItemStack(crystal, 1, 5),
                                new ItemStack(Blocks.quartz_block,1,1),
                                new ItemStack(crystal, 1, 5),
                                new ItemStack(ConfigItems.itemShard, 1, 6),
                                new ItemStack(crystal, 1, 4)
                        });

                int localOffsetX = 2;
                int localOffsetY = 2;

                new ResearchItem(researchKey, categoryKey,
                        new AspectList().add(Aspect.LIGHT, 5).add(Aspect.ENTROPY, 5).add(Aspect.ORDER, 8).add(Aspect.MAGIC, 5)
                        ,offsetCol + localOffsetX, offsetRow + localOffsetY, 2, wandrod)
                        .setPages(new ResearchPage("tc.research_page." + researchKey + ".1"), new ResearchPage(recipe))
                        .setHidden()
                                //.setSecondary()
                        .setItemTriggers(staffcoreEx)
                        .registerResearchItem();

                ThaumcraftApi.addWarpToResearch(researchKey, 1);
            }

            {
                String researchKey = String.format("ROD_ESS_%s_staff",name);

                Item crystal = GameRegistry.findItem("Thaumcraft","blockCrystal");

                InfusionRecipe recipe = ThaumcraftApi.addInfusionCraftingRecipe(researchKey, staffcore.copy(), 10,
                        new AspectList()
                                .add(Aspect.ORDER, 32)
                                .add(Aspect.ENTROPY, 64)
                                .add(Aspect.LIGHT, 64)
                                .add(Aspect.MAGIC, 32),
                        wandrod.copy(),
                        new ItemStack[]{
                                new ItemStack(ConfigItems.itemResource, 1, 15),
                                new ItemStack(crystal, 1, 4),
                                new ItemStack(ConfigItems.itemShard, 1, 6),
                                new ItemStack(crystal, 1, 5),
                                new ItemStack(Blocks.quartz_block,1,1),
                                new ItemStack(crystal, 1, 5),
                                new ItemStack(ConfigItems.itemShard, 1, 6),
                                new ItemStack(crystal, 1, 4)
                        });

                int localOffsetX = 2;
                int localOffsetY = 4;

                new ResearchItem(researchKey, categoryKey,
                        new AspectList().add(Aspect.LIGHT, 5).add(Aspect.ENTROPY, 5).add(Aspect.ORDER, 8).add(Aspect.MAGIC, 5).add(Aspect.AURA, 5)
                        ,offsetCol + localOffsetX, offsetRow + localOffsetY, 2, staffcore)
                        .setPages(new ResearchPage("tc.research_page." + researchKey + ".1"),new ResearchPage(recipe))
                                //.setHidden()
                                //.setVirtual()
                                //.setConcealed()
                                //.setItemTriggers(staffcore)
                                //.setSecondary()
                        .setConcealed()
                        .setParents(String.format("ROD_ESS_%s",name))
                        .registerResearchItem();

                ThaumcraftApi.addWarpToResearch(researchKey, 3);
            }

            {
                String researchKey = String.format("ROD_ESS_Ex_%s_staff",name);

                ItemStack wandCasting = new ItemStack(ConfigItems.itemWandCasting, 1, 128);

                {
                    WandCap cap = WandCap.caps.get(String.format("ESS_%s",name));
                    ((ItemWandCasting) wandCasting.getItem()).setCap(wandCasting, cap);

                    WandRod rod = WandRod.rods.get(String.format("ESS_Ex_%s_staff",name));
                    ((ItemWandCasting) wandCasting.getItem()).setRod(wandCasting, rod);

                    Aspect aspect;
                    for (Iterator i$ = Aspect.getPrimalAspects().iterator();i$.hasNext();) {
                        aspect = (Aspect) i$.next();

                        ((ItemWandCasting) wandCasting.getItem()).addVis(wandCasting, aspect, ((ItemWandCasting) wandCasting.getItem()).getMaxVis(wandCasting), true);
                    }
                }

                Item crystal = GameRegistry.findItem("Thaumcraft","blockCrystal");

                InfusionRecipe recipe = ThaumcraftApi.addInfusionCraftingRecipe(researchKey, wandCasting.copy(), 10,
                        new AspectList()
                                .add(Aspect.ORDER, 64)
                                .add(Aspect.ENTROPY, 64)
                                .add(Aspect.LIGHT, 128)
                                .add(Aspect.MAGIC, 64),
                        staffcore.copy(),
                        new ItemStack[]{
                                new ItemStack(Items.nether_star),
                                new ItemStack(Blocks.quartz_block, 1, 1),
                                new ItemStack(crystal, 1, 6),
                                new ItemStack(ConfigItems.itemShard, 1, 6),
                                new ItemStack(crystal, 1, 5),
                                new ItemStack(ConfigItems.itemShard, 1, 5),
                                new ItemStack(Blocks.quartz_block, 1, 1),
                                new ItemStack(ConfigItems.itemShard, 1, 5),
                                new ItemStack(crystal, 1, 5),
                                new ItemStack(ConfigItems.itemShard, 1, 6),
                                new ItemStack(crystal, 1, 6),
                                new ItemStack(Blocks.quartz_block, 1, 1),
                        });

                int localOffsetX = 2;
                int localOffsetY = 6;

                new ResearchItem(researchKey, categoryKey,
                        new AspectList().add(Aspect.LIGHT, 5).add(Aspect.ENTROPY, 5).add(Aspect.ORDER, 8).add(Aspect.MAGIC, 5).add(Aspect.AURA, 5).add(Aspect.FIRE, 5)
                        ,offsetCol + localOffsetX, offsetRow + localOffsetY, 2, wandCasting)
                        .setPages(new ResearchPage("tc.research_page." + researchKey + ".1"),new ResearchPage(recipe))
                                //.setHidden()
                                //.setVirtual()
                                //.setConcealed()
                                //.setItemTriggers(staffcore)
                                //.setSecondary()
                        .setSpecial()
                        .setConcealed()
                        .setParents(String.format("ROD_ESS_%s_staff",name))
                        .registerResearchItem();

                ThaumcraftApi.addWarpToResearch(researchKey, 5);
            }

            {
                String researchKey = String.format("ROD_ESS_Ex_%s_staff",nameEx);

                ItemStack wandCasting = new ItemStack(ConfigItems.itemWandCasting, 1, 128);

                {
                    WandCap cap = WandCap.caps.get(String.format("ESS_%s",nameEx));
                    ((ItemWandCasting) wandCasting.getItem()).setCap(wandCasting, cap);

                    WandRod rod = WandRod.rods.get(String.format("ESS_Ex_%s_staff",nameEx));
                    ((ItemWandCasting) wandCasting.getItem()).setRod(wandCasting, rod);

                    Aspect aspect;
                    for (Iterator i$ = Aspect.getPrimalAspects().iterator();i$.hasNext();) {
                        aspect = (Aspect) i$.next();

                        ((ItemWandCasting) wandCasting.getItem()).addVis(wandCasting, aspect, ((ItemWandCasting) wandCasting.getItem()).getMaxVis(wandCasting), true);
                    }
                }

                Item crystal = GameRegistry.findItem("Thaumcraft","blockCrystal");

                InfusionRecipe recipe = ThaumcraftApi.addInfusionCraftingRecipe(researchKey, wandCasting.copy(), 10,
                        new AspectList()
                                .add(Aspect.ORDER, 64)
                                .add(Aspect.ENTROPY, 64)
                                .add(Aspect.FIRE, 64)
                                .add(Aspect.EARTH, 64)
                                .add(Aspect.WATER, 64)
                                .add(Aspect.AIR, 64)
                                .add(Aspect.LIGHT, 128)
                                .add(Aspect.MAGIC, 64),
                        staffcoreEx.copy(),
                        new ItemStack[]{
                                new ItemStack(ConfigItems.itemEldritchObject, 1, 3),
                                new ItemStack(Items.nether_star),
                                new ItemStack(crystal, 1,4),
                                new ItemStack(ConfigItems.itemShard, 1, 6),
                                new ItemStack(Items.nether_star),
                                new ItemStack(ConfigItems.itemShard, 1, 6),
                                new ItemStack(crystal, 1, 4),
                                new ItemStack(Items.nether_star),
                        });

                int localOffsetX = 2;
                int localOffsetY = 8;

                new ResearchItem(researchKey, categoryKey,
                        new AspectList().add(Aspect.LIGHT, 5).add(Aspect.ENTROPY, 5).add(Aspect.ORDER, 8).add(Aspect.MAGIC, 5).add(Aspect.AURA, 5).add(Aspect.SENSES, 5)
                        ,offsetCol + localOffsetX, offsetRow + localOffsetY, 2, wandCasting)
                        .setPages(new ResearchPage("tc.research_page." + researchKey + ".1"),new ResearchPage(recipe))
                                //.setHidden()
                                //.setVirtual()
                                //.setConcealed()
                                //.setItemTriggers(staffcore)
                        //.setSecondary()
                        .setSpecial()
                        .setRound()
                        .setConcealed()
                        .setParents(String.format("ROD_ESS_Ex_%s_staff",name))
                        .registerResearchItem();
            }
        }

        {
            int offsetCol = 10;
            int offsetRow = 0;

            ExtraMaterials mat = ExtraMaterials.Alicorn;
            String name = mat.name;
            int index = mat.index;

            ItemStack material = new ItemStack(itemResource,1, ItemResource.getItemDamage(index, ItemResource.ResourceType.Material));
            ItemStack fragment = new ItemStack(itemResource,1, ItemResource.getItemDamage(index, ItemResource.ResourceType.Fragment));
            ItemStack wandcap = new ItemStack(itemResource,1, ItemResource.getItemDamage(index, ItemResource.ResourceType.WandCap));
            ItemStack wandrod = new ItemStack(itemResource,1, ItemResource.getItemDamage(index, ItemResource.ResourceType.WandRod));
            ItemStack staffcore = new ItemStack(itemResource,1, ItemResource.getItemDamage(index, ItemResource.ResourceType.StaffRod));

            {
                ThaumcraftApi.registerObjectTag(material, new AspectList()
                        .add(Aspect.BEAST, 2)
                        .add(Aspect.FLIGHT, 2)
                        .add(Aspect.ORDER, 2)
                        .add(Aspect.MAGIC, 3)
                        .add(Aspect.HEAL, 3)
                );

                ChestGenHooks.addItem(ChestGenHooks.PYRAMID_DESERT_CHEST,new WeightedRandomChestContent(material,1,1,3));
                ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_CHEST,new WeightedRandomChestContent(fragment,1,2,3));
                ChestGenHooks.addItem(ChestGenHooks.DUNGEON_CHEST,new WeightedRandomChestContent(fragment,1,1,1));
            }

            {
                String researchKey = String.format("ESS_%s_fragment",name);
                ItemStack resultFragment = fragment.copy();
                resultFragment.stackSize = 3;
                CrucibleRecipe fragmentRecipe = ThaumcraftApi.addCrucibleRecipe(researchKey , resultFragment,
                        material,
                        new AspectList()
                                .add(Aspect.ENTROPY,2));

                CrucibleRecipe crucibleRecipe = ThaumcraftApi.addCrucibleRecipe(researchKey , material,
                        fragment,
                        new AspectList()
                                .add(Aspect.BEAST, 16)
                                .add(Aspect.FLIGHT, 16)
                                .add(Aspect.ORDER, 24)
                                .add(Aspect.MAGIC, 8)
                                .add(Aspect.SENSES, 4)
                                .add(Aspect.HEAL, 24));

                new ResearchItem(researchKey, categoryKey,
                        new AspectList().add(Aspect.BEAST, 1).add(Aspect.FLIGHT, 1).add(Aspect.ORDER, 1).add(Aspect.MAGIC, 1)
                        , offsetCol, offsetRow, 1, material)
                        .setPages(new ResearchPage("tc.research_page." + researchKey + ".1"),
                                new ResearchPage(fragmentRecipe),
                                new ResearchPage(crucibleRecipe))
                        .setHidden()
                        .setItemTriggers(material,fragment)
                        .registerResearchItem();
            }

            {
                String researchKey = String.format("ROD_ESS_%s",name);

                Item crystal = GameRegistry.findItem("Thaumcraft","blockCrystal");

                InfusionRecipe recipe = ThaumcraftApi.addInfusionCraftingRecipe(researchKey, wandrod.copy(), 3,
                        new AspectList()
                                .add(Aspect.BEAST, 8)
                                .add(Aspect.FLIGHT, 8)
                                .add(Aspect.ORDER, 16)
                                .add(Aspect.MAGIC, 8)
                                .add(Aspect.HEAL, 8),
                        material.copy(),
                        new ItemStack[]{
                                new ItemStack(ConfigItems.itemResource, 1, 14), new ItemStack(crystal, 1, 4)
                            });

                new ResearchItem(researchKey, categoryKey,
                        new AspectList().add(Aspect.TOOL, 2).add(Aspect.BEAST, 2).add(Aspect.FLIGHT, 2).add(Aspect.ORDER, 4).add(Aspect.MAGIC, 2).add(Aspect.HEAL, 2)
                        , offsetCol + 1, offsetRow + 1, 2, wandrod)
                        .setPages(new ResearchPage("tc.research_page." + researchKey + ".1"),
                                new ResearchPage(recipe))
                        .setSecondary()
                        .setParents(String.format("ESS_%s_fragment", name))
                        .setParentsHidden("ROD_greatwood", "INFUSION")
                        .setConcealed()
                        .registerResearchItem();
            }

            {
                String researchKey = String.format("ROD_ESS_%s_staff",name);

                IArcaneRecipe recipe = ThaumcraftApi.addArcaneCraftingRecipe(researchKey, staffcore,
                        (new AspectList()).add(Aspect.ORDER, 16)
                        , new Object[]{
                        "  S",
                        " G ",
                        "F  ",
                        'S', new ItemStack(ConfigItems.itemResource, 1, 15),
                        'G', wandrod.copy(),
                        'F', fragment.copy()
                });

                new ResearchItem(researchKey, categoryKey,
                        new AspectList().add(Aspect.TOOL, 5).add(Aspect.BEAST, 5).add(Aspect.FLIGHT, 5).add(Aspect.ORDER, 8).add(Aspect.MAGIC, 5).add(Aspect.HEAL, 5)
                        ,offsetCol + 2, offsetRow + 2, 2, staffcore)
                        .setPages(new ResearchPage("tc.research_page." + researchKey + ".1"),
                                new ResearchPage(recipe))
                        .setSecondary()
                        .setParents(String.format("ROD_ESS_%s",name))
                        .setConcealed()
                        .registerResearchItem();
            }

            {
                String researchKey = String.format("CAP_ESS_%s",name);

                Item crystal = GameRegistry.findItem("Thaumcraft","blockCrystal");

                InfusionRecipe recipe = ThaumcraftApi.addInfusionCraftingRecipe(researchKey, wandcap.copy(), 3,
                        new AspectList()
                                .add(Aspect.BEAST, 8)
                                .add(Aspect.FLIGHT, 8)
                                .add(Aspect.ORDER, 16)
                                .add(Aspect.HEAL, 8),
                        new ItemStack(ConfigItems.itemWandCap, 1, 1),
                        new ItemStack[]{
                                new ItemStack(ConfigItems.itemResource, 1, 14), fragment.copy()
                        });

                new ResearchItem(researchKey, categoryKey,
                        new AspectList().add(Aspect.TOOL, 5).add(Aspect.BEAST, 5).add(Aspect.FLIGHT, 5).add(Aspect.ORDER, 8).add(Aspect.MAGIC, 5).add(Aspect.HEAL, 5)
                        ,offsetCol - 2, offsetRow + 2, 2, wandcap)
                        .setPages(new ResearchPage("tc.research_page." + researchKey + ".1"),
                                new ResearchPage(recipe))
                        .setSecondary()
                        .setParents(String.format("ESS_%s_fragment", name))
                        .setParentsHidden("CAP_gold")
                        .setConcealed()
                        .registerResearchItem();
            }

            {
                String researchKey = String.format("ROD_ESS_Ex_%s_staff",name);
                ItemStack wandCasting = new ItemStack(ConfigItems.itemWandCasting, 1, 128);
                ((ItemWandCasting) wandCasting.getItem()).setCap(wandCasting, WandCap.caps.get(String.format("ESS_%s",name)));
                ((ItemWandCasting) wandCasting.getItem()).setRod(wandCasting, WandRod.rods.get(String.format("ESS_%s_staff",name)));

                Item crystal = GameRegistry.findItem("Thaumcraft","blockCrystal");

                InfusionExtraScepterStaffRecipe ra = new InfusionExtraScepterStaffRecipe(researchKey,
                        new Object[]{"rod",new NBTTagString("ESS_Ex_"+name+"_staff")},
                        8,
                        new AspectList().add(Aspect.FLIGHT, 16).add(Aspect.ORDER, 32).add(Aspect.BEAST, 16).add(Aspect.MAGIC, 32).add(Aspect.HEAL, 16),
                        wandCasting,
                        new ItemStack[]{
                                new ItemStack(crystal, 1, 0),
                                new ItemStack(Items.bone,1,0),
                                new ItemStack(crystal, 1, 4),
                                new ItemStack(ConfigItems.itemResource, 1, 15),
                                new ItemStack(crystal, 1, 5),
                                new ItemStack(Items.gold_ingot,1,0)
                            });
                ThaumcraftApi.getCraftingRecipes().add(ra);

                ItemStack wandExCasting = new ItemStack(ConfigItems.itemWandCasting, 1, 128);
                ((ItemWandCasting) wandCasting.getItem()).setCap(wandExCasting, WandCap.caps.get(String.format("ESS_%s",name)));
                ((ItemWandCasting) wandCasting.getItem()).setRod(wandExCasting, WandRod.rods.get(String.format("ESS_Ex_%s_staff",name)));

                new ResearchItem(researchKey, categoryKey,
                        new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.ORDER, 8).add(Aspect.MAGIC, 5).add(Aspect.HEAL, 16)
                        ,offsetCol, offsetRow + 4, 2, wandExCasting)
                        .setPages(new ResearchPage("tc.research_page." + researchKey + ".1"),
                                new ResearchPage(ra))
                        .setParents(String.format("ROD_ESS_%s_staff", name), String.format("CAP_ESS_%s", name))
//                        .setParentsHidden("")
                        .setConcealed()
                        .registerResearchItem();
            }
        }
    }
}


text:
First off, thank you for considering contributing to HAL. It's people like you that make HAL such a great tool. HAL is an open source project and we love to receive contributions from our community — you! There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code which can be incorporated into HAL itself.

We expect all contributors and users to follow our [Code of Conduct](CODE_OF_CONDUCT.md) when communicating through project channels. These include, but are not limited to: chat, issues, code.

# One time setup

## Create a GitHub account

If you don't have one already, head to https://github.com/

## Git Flow

We use [Git Flow](https://github.com/nvie/gitflow) to manage branches. Although it's no requirement, it helps if you've read and understood the [basic ideas](https://nvie.com/posts/a-successful-git-branching-model/) behind Git Flow. The most important fact is that development happens in the `develop` branch and that the latest stable version is always available in branch `master`.

## Fork HAL

Fork https://github.com/hal/console into your GitHub account.

## Clone your newly forked repository onto your local machine

```bash
git clone git@github.com:[your username]/console.git
cd console
```

## Add a remote reference to upstream

This makes it easy to pull down changes in the project over time

```bash
git remote add upstream git://github.com/hal/console.git
```

# Development Process

This is the typical process you would follow to submit any changes to Elemento.

## Pulling updates from upstream

```bash
git pull --rebase upstream develop
```

> Note that --rebase will automatically move your local commits, if you have
> any, on top of the latest branch you pull from.
> If you don't have any commits it is safe to leave off, but for safety it
> doesn't hurt to use it each time just in case you have a commit you've
> forgotten about!

## Discuss your planned changes (if you want feedback)

 * HAL Issue Tracker - https://issues.jboss.org/browse/HAL
 * Gitter - https://gitter.im/hal/console

## Create a simple topic branch to isolate your work (recommended)

```bash
git checkout -b my_cool_feature
```

## Make the changes

Make whatever code changes, including new tests to verify your change, are necessary and ensure that the build and tests pass. Make sure your code changes apply to the checkstyle rules defined at [build/checkstyle.xml](build/checkstyle.xml):

```bash
mvn clean install
```

> If you're making non code changes, the above step is not required.

## Commit changes

Add whichever files were changed into 'staging' before performing a commit:

```bash
git commit
```

## Rebase changes against develop

Once all your commits for the issue have been made against your local topic branch, we need to rebase it against develop in upstream to ensure that your commits are added on top of the current state of develop. This will make it easier to incorporate your changes into the develop branch, especially if there has been any significant time passed since you rebased at the beginning.

```bash
git pull --rebase upstream develop
```

## Push to your repo

Now that you've sync'd your topic branch with upstream, it's time to push it to your GitHub repo.

```bash
git push origin my_cool_feature
```

## Getting your changes merged into upstream, a pull request

Now your updates are in your GitHub repo, you will need to notify the project that you have code/docs for inclusion.

 * Send a pull request, by clicking the pull request link while in your repository fork
 * After review a maintainer will merge your pull request, update/resolve associated issues, and reply when complete
 * Lastly, switch back to develop from your topic branch and pull the updates

```bash
git checkout develop
git pull upstream develop
```

 * You may also choose to update your origin on GitHub as well

```bash
git push origin
```

## Some tips

Here are some tips on increasing the chance that your pull request is accepted:

 * Write a [good commit message](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
 * Include tests that fail without your code, and pass with it

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * PHP version 5
 *
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
 */
namespace Edeco\Paginator;

use Zend_Paginator;
use Traversable;
use ArrayIterator;

class Property extends Zend_Paginator
{
    const PROPERTIES_TAG = 'properties';

    /**
     * Returns the items for a given page.
     *
     * @return Traversable
     */
    public function getItemsByPage($pageNumber)
    {
        $pageNumber = $this->normalizePageNumber($pageNumber);

        if ($this->_cacheEnabled()) {
            $data = self::$_cache->load($this->_getCacheId($pageNumber));
            if ($data !== false) {
                return $data;
            }
        }

        $offset = ($pageNumber - 1) * $this->getItemCountPerPage();

        $items = $this->_adapter->getItems($offset, $this->getItemCountPerPage());

        $filter = $this->getFilter();

        if ($filter !== null) {
            $items = $filter->filter($items);
        }

        if (!$items instanceof Traversable) {
            $items = new ArrayIterator($items);
        }

        if ($this->_cacheEnabled()) {
            // Add custom tag to synchronize cache in paginators of admin and
            // default modules
            self::$_cache->save(
                $items,
                $this->_getCacheId($pageNumber),
                array(
                    $this->_getCacheInternalId(),
                    self::PROPERTIES_TAG, //Add EDECO custom tag
                )
            );
        }

        return $items;
    }
}


text:
<form method="post" enctype="multipart/form-data" action="[%URL page:'checkout'%][%END URL%]" id="upsellcartform">
<input type="hidden" name="fn" id="fn" value="payment" />
<input type="hidden" name="voucher" value="y" />

Personalise Your Gift Vouchers

Gift vouchers will be sent to your specified recipients by email.

#[@item_count@]   [@vprogram_title@] -

[@reward_points@]pts

[@reward_amount@]

Sender Name*

The name of the person sending the voucher

<input type="text" class="form-control" name="voucher_sender[@reward_id@]" value="[%NOHTML%][@sender_name@][%END NOHTML%]">
* Required

Recipient Name*

The name of the person receiving the voucher

<input type="text" class="form-control" name="voucher_name[@reward_id@]" value="[%NOHTML%][@recipient_name@][%END NOHTML%]">
* Required

Recipient Email*

The e-voucher will be sent to this email address

<input type="text" class="form-control" name="voucher_email[@reward_id@]" value="[%NOHTML%][@recipient_email@][%END NOHTML%]">
* Required
* Invalid

Send Voucher On This Date & Time:
Leave blank to send ASAP or select a date and time

<input type="text" class="datepicker form-control" name="voucher_rdate[@reward_id@]" value="[%NOHTML%][@required_date_day@][%END NOHTML%]" placeholder="Select Date">

<select class="form-control" name="voucher_rdate[@reward_id@]_hr">
<option value=""></option>
<option value="1" [%DATA id:'required_date_12hr' if:'=' value:'1'%]selected[%END DATA%]>1</option>
<option value="2" [%DATA id:'required_date_12hr' if:'=' value:'2'%]selected[%END DATA%]>2</option>
<option value="3" [%DATA id:'required_date_12hr' if:'=' value:'3'%]selected[%END DATA%]>3</option>
<option value="4" [%DATA id:'required_date_12hr' if:'=' value:'4'%]selected[%END DATA%]>4</option>
<option value="5" [%DATA id:'required_date_12hr' if:'=' value:'5'%]selected[%END DATA%]>5</option>
<option value="6" [%DATA id:'required_date_12hr' if:'=' value:'6'%]selected[%END DATA%]>6</option>
<option value="7" [%DATA id:'required_date_12hr' if:'=' value:'7'%]selected[%END DATA%]>7</option>
<option value="8" [%DATA id:'required_date_12hr' if:'=' value:'8'%]selected[%END DATA%]>8</option>
<option value="9" [%DATA id:'required_date_12hr' if:'=' value:'9'%]selected[%END DATA%]>9</option>
<option value="10" [%DATA id:'required_date_12hr' if:'=' value:'10'%]selected[%END DATA%]>10</option>
<option value="11" [%DATA id:'required_date_12hr' if:'=' value:'11'%]selected[%END DATA%]>11</option>
<option value="12" [%DATA id:'required_date_12hr' if:'=' value:'12'%]selected[%END DATA%]>12</option>
</select>

<select class="form-control" name="voucher_rdate[@reward_id@]_am">
<option value=""></option>
<option value="am" [%DATA id:'required_date_am' if:'eq' value:'am'%]selected[%END DATA%]>am</option>
<option value="pm" [%DATA id:'required_date_am' if:'eq' value:'pm'%]selected[%END DATA%]>pm</option>
</select>

Gift Voucher Message*
The message that appears on the gift voucher email

<textarea name="voucher_msg[@reward_id@]" class="inputtext form-control" id="voucher_msg[@reward_id@]" wrap="soft"></textarea>

[@config:VOUCHER_MSG_LENGTH@] Character(s) Left

*Required

<input class="submit_btn btn btn-success btn-large pull-right" type="button" value="Continue To Checkout"/>

</form>


text:
////////////////////////////////////////////////////////////////////////////////////
///
///  \file tutorial_04.cpp
///  \brief This file is part of a set of tutorials for learning how to use
///         JAUS++.  This program demonstrates how to use the Access
///         Control Service.  Access Control is used to take control
///         of another component for exclusive operations.  Finally, this
///         example also shows how to change the state of a
///         controlled component.
///
///
Author(s): Daniel Barber
///
Created: 3 July 2010
///
Copyright (c) 2010
///
Applied Cognition and Training in Immersive Virtual Environments
///
(ACTIVE) Laboratory
///
Institute for Simulation and Training (IST)
///
University of Central Florida (UCF)
///
All rights reserved.
///
Email: dbarber@ist.ucf.edu
///
Web:  http://active.ist.ucf.edu
///
///  Redistribution and use in source and binary forms, with or without
///  modification, are permitted provided that the following conditions are met:
///      * Redistributions of source code must retain the above copyright
///        notice, this list of conditions and the following disclaimer.
///      * Redistributions in binary form must reproduce the above copyright
///        notice, this list of conditions and the following disclaimer in the
///        documentation and/or other materials provided with the distribution.
///      * Neither the name of the ACTIVE LAB, IST, UCF, nor the
///        names of its contributors may be used to endorse or promote products
///        derived from this software without specific prior written permission.
///
///  THIS SOFTWARE IS PROVIDED BY THE ACTIVE LAB''AS IS'' AND ANY
///  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
///  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
///  DISCLAIMED. IN NO EVENT SHALL UCF BE LIABLE FOR ANY
///  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
///  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
///  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
///  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
///  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
///  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///
////////////////////////////////////////////////////////////////////////////////////
#include <jaus/core/component.h>
#include <cxutils/keyboard.h>
#include <iostream>

// NOTE - Run another JAUS program like tutorial_01
// so that this program can talk to it.

int main(int argc, char* argv[])
{
    JAUS::Component component;

    // Setup identification info.  For questions about this,
    // see the previous tutorial(s).
    JAUS::Discovery* discoveryService = NULL;
    discoveryService = component.DiscoveryService();
    discoveryService->SetSubsystemIdentification(JAUS::Subsystem::Vehicle,
                                                 "Robot");
    discoveryService->SetNodeIdentification("Primary Computer");
    discoveryService->SetComponentIdentification("Baseline");

    // The Access Control service manages what other components
    // are allowed to control this component, and what
    // components our component is in control of. Taking control
    // of a component allows for exclusive access to its services,
    // blocking any other commands from other services (except for
    // event commands).  If we take control of a component, we
    // will have it until we release control, or another component
    // with higher authority takes it from us.

    // Let's change options for the Access Control service of our
    // component.  In this tutorial I am saving a pointer
    // to the Access Control service, just like in the previous
    // tutorials for Discovery and Management.  This is not
    // necessary, and is only done to show users that you can
    // do this if you want, but you can just as easily keep
    // calling component.AccessControlService() method to get the
    // pointer and call the related methods if you want.
    JAUS::AccessControl* accessControlService = NULL;
    accessControlService = component.AccessControlService();

    // Use the SetAuthorityCode method to set the authority level
    // of our component.  We must have equal too or greater
    // than authority than the component we are trying to
    // control.  This is also a way to prevent low authority
    // level components from taking control of us!  Authority
    // values range from 0-255, with 255 being the highest.
    accessControlService->SetAuthorityCode(100);
    // The SetTimeoutPeriod method sets how often any controlling
    // component must attempt to reacquire control of our
    // component before we timeout control.  For example
    // if in this example, if a controller doesn't try to
    // reacquire control within 1 second, they will lose
    // control.
    accessControlService->SetTimeoutPeriod(1);

    JAUS::Address componentID(1000, 1, 4);
    // Initialize!
    std::cout << "Initializing component...";
    if(component.Initialize(componentID) == false)
    {
        std::cout << "Failed to initialize component [" << componentID.ToString() << "]\n";
        return 0;
    }
    std::cout << "Success!\n";

    // Now go into your main computer loop until the
    // component has been told to shutdown.
    JAUS::Time::Stamp displayStatusTimeMs = JAUS::Time::GetUtcTimeMs();
    JAUS::Time::Stamp acquiredControlTimeMs = 0;
    JAUS::Time::Stamp releaseControlTimeMs = 0;
    while(true)
    {
        JAUS::Management* managementService = NULL;
        managementService = component.ManagementService();
        if(managementService->GetStatus() == JAUS::Management::Status::Shutdown)
        {
            // Exit program.
            break;
        }

        // In this tutorial, the following code shows how to take
        // and release control of a component.  In this example
        // we take control for 3 seconds, and then release control
        // for 3 seconds, then repeat.

        // Let's see if we are in control of any components.
        JAUS::Address::List controlledComponents;
        controlledComponents = accessControlService->GetControlledComponents();
        if(controlledComponents.size() == 0 &&
           JAUS::Time::GetUtcTimeMs() - releaseControlTimeMs > 3000)
        {
            // Find a component to take control of on our subsystem.
            JAUS::Address::List availableComponents;
            JAUS::Discovery* discoveryService = NULL;
            discoveryService = component.DiscoveryService();
            availableComponents =
                discoveryService->GetSubsystem(component.GetComponentID())->GetComponentsWithService(JAUS::AccessControl::Name);

            JAUS::Address::List::iterator c;
            for(c = availableComponents.begin();
                c != availableComponents.end();
                c++)
            {
                // Don't take control of ourself!
                if( *c == component.GetComponentID() )
                {
                    continue;
                }
                std::cout << "Requesting control of " << c->ToString() << std::endl;
                if(accessControlService->RequestComponentControl( (*c) ) == true)
                {
                    std::cout << "Success!\n";
                    acquiredControlTimeMs = JAUS::Time::GetUtcTimeMs();

                    // Now that we have control, lets send a command to
                    // change the controlled component to the "Ready"
                    // state.
                    component.ManagementService()->Resume((*c));

                    break;
                }
                else
                {
                    std::cout << "Failure!\n";
                }
            }
        }
        // In this tutorial, this part is only here to show how to
        // release control of a component.  In this case, we will release
        // control after 3 seconds.
        else if(JAUS::Time::GetUtcTimeMs() - acquiredControlTimeMs > 3000)
        {
            JAUS::Address::List::iterator c;
            for(c = controlledComponents.begin();
                c != controlledComponents.end();
                c++)
            {
                // Before releasing control, we should always put the
                // component back in a standby state.
                if(component.ManagementService()->GetComponentStatus( (*c) ) !=
                    JAUS::Management::Status::Standby)
                {
                    // Sends a standby command.
                    component.ManagementService()->Standby( (*c) );
                }
                std::cout << "Releasing control of " << c->ToString() << std::endl;
                if(accessControlService->ReleaseComponentControl( (*c) ) == true)
                {
                    std::cout << "Success!\n";
                    releaseControlTimeMs = JAUS::Time::GetUtcTimeMs();
                    break;
                }
                else
                {
                    std::cout << "Failure!\n";
                }
            }
        }

        if(JAUS::Time::GetUtcTimeMs() - displayStatusTimeMs > 500)
        {
            // Print out status of control service.  This will show
            // who we are controlling.
            accessControlService->PrintStatus(); std::cout << std::endl;
            displayStatusTimeMs = JAUS::Time::GetUtcTimeMs();
        }

        if(CxUtils::GetChar() == 27)
        {
            break;
        }

        CxUtils::SleepMs(1);
    }

    // Shutdown your component completely.  Any
    // services added or belonging to the component
    // will be deleted.
    component.Shutdown();

    return 0;
}

/* End of File */


text:
import React from 'react';
import Link from './link';
import styled, {css} from 'styled-components';
import { darken } from 'polished';

const hoverMixin = css`
    &:hover {
        background-color: ${ ({theme, bg}) => bg ? darken(0.2, bg) : theme.colors.primaryAccent  };
        text-decoration: none;
    }
`;

const BadgeLink = ({color, bg, hover, ...rest}) =>(<Link {...rest}/>)

const StyledBadgeLink = styled(BadgeLink).attrs({
    color : props => props.color || props.theme.colors.white,
    bg: props => props.bg || props.theme.colors.secondaryAccent,
    hover: props => props.hover || hoverMixin
})`
    display: inline-block;
    color: ${ ({color}) => color };
    text-decoration:none;
    background-color: ${ ({bg}) => bg };
    ${ ({hover}) => hover };
    padding: 0.2em 0.4em;
    border-radius: 4px;
    margin-right: 5px;
    font-weight: normal;
`;

export default StyledBadgeLink;


text:
// tensorflow/tensorflow/core/lib/io/iterator.cc

#include "utils/iterator.h"

namespace bubblefs {
namespace table {

Iterator::Iterator() {
  cleanup_.function = nullptr;
  cleanup_.next = nullptr;
}

Iterator::~Iterator() {
  if (cleanup_.function != nullptr) {
    (*cleanup_.function)(cleanup_.arg1, cleanup_.arg2);
    for (Cleanup* c = cleanup_.next; c != nullptr;) {
      (*c->function)(c->arg1, c->arg2);
      Cleanup* next = c->next;
      delete c;
      c = next;
    }
  }
}

void Iterator::RegisterCleanup(CleanupFunction func, void* arg1, void* arg2) {
  assert(func != nullptr);
  Cleanup* c;
  if (cleanup_.function == nullptr) {
    c = &cleanup_;
  } else {
    c = new Cleanup;
    c->next = cleanup_.next;
    cleanup_.next = c;
  }
  c->function = func;
  c->arg1 = arg1;
  c->arg2 = arg2;
}

namespace {
class EmptyIterator : public Iterator {
 public:
  explicit EmptyIterator(const Status& s) : status_(s) {}
  bool Valid() const override { return false; }
  void Seek(const StringPiece& target) override {}
  void SeekToFirst() override {}
  void Next() override { assert(false); }
  StringPiece key() const override {
    assert(false);
    return StringPiece();
  }
  StringPiece value() const override {
    assert(false);
    return StringPiece();
  }
  Status status() const override { return status_; }

 private:
  Status status_;
};
}  // namespace

Iterator* NewEmptyIterator() { return new EmptyIterator(Status::OK()); }

Iterator* NewErrorIterator(const Status& status) {
  return new EmptyIterator(status);
}

}  // namespace table
}  // namespace bubblefs


text:
package perfield

import (
	"fmt"
	. "github.com/balzaczyy/golucene/core/codec/spi"
	. "github.com/balzaczyy/golucene/core/index/model"
	"github.com/balzaczyy/golucene/core/util"
	"io"
	"strconv"
)

// perfield/PerFieldPostingsFormat.java

/*
Enables per field postings support.

Note, when extending this class, the name Name() is written into the
index. In order for the field to be read, the name must resolve to
your implementation via LoadXYZ(). This method use hard-coded map to
resolve codec names.

Files written by each posting format have an additional suffix containing
the format name. For example, in a per-field configuration instead of
_1.prx fielnames would look like _1_Lucene40_0.prx.
*/
type PerFieldPostingsFormat struct {
	postingsFormatForField func(string) PostingsFormat
}

func NewPerFieldPostingsFormat(f func(field string) PostingsFormat) *PerFieldPostingsFormat {
	return &PerFieldPostingsFormat{f}
}

func (pf *PerFieldPostingsFormat) Name() string {
	return "PerField40"
}

func (pf *PerFieldPostingsFormat) FieldsConsumer(state *SegmentWriteState) (FieldsConsumer, error) {
	return newPerFieldPostingsWriter(pf, state), nil
}

func (pf *PerFieldPostingsFormat) FieldsProducer(state SegmentReadState) (FieldsProducer, error) {
	return newPerFieldPostingsReader(state)
}

const (
	PER_FIELD_FORMAT_KEY = "PerFieldPostingsFormat.format"
	PER_FIELD_SUFFIX_KEY = "PerFieldPostingsFormat.suffix"
)

type FieldsConsumerAndSuffix struct {
	consumer FieldsConsumer
	suffix   int
}

func (fcas *FieldsConsumerAndSuffix) Close() error {
	return fcas.consumer.Close()
}

type PerFieldPostingsWriter struct {
	owner             *PerFieldPostingsFormat
	formats           map[PostingsFormat]*FieldsConsumerAndSuffix
	suffixes          map[string]int
	segmentWriteState *SegmentWriteState
}

func newPerFieldPostingsWriter(owner *PerFieldPostingsFormat,
	state *SegmentWriteState) FieldsConsumer {
	return &PerFieldPostingsWriter{
		owner,
		make(map[PostingsFormat]*FieldsConsumerAndSuffix),
		make(map[string]int),
		state,
	}
}

func (w *PerFieldPostingsWriter) AddField(field *FieldInfo) (TermsConsumer, error) {
	format := w.owner.postingsFormatForField(field.Name)
	assert2(format != nil, "invalid nil PostingsFormat for field='%v'", field.Name)
	formatName := format.Name()

	previousValue := field.PutAttribute(PER_FIELD_FORMAT_KEY, formatName)
	assert(previousValue == "")

	var suffix int

	consumer, ok := w.formats[format]
	if !ok {
		// First time we are seeing this format; create a new instance

		// bump the suffix
		if suffix, ok = w.suffixes[formatName]; !ok {
			suffix = 0
		} else {
			suffix = suffix + 1
		}
		w.suffixes[formatName] = suffix

		segmentSuffix := fullSegmentSuffix(field.Name,
			w.segmentWriteState.SegmentSuffix,
			_suffix(formatName, strconv.Itoa(suffix)))

		consumer = new(FieldsConsumerAndSuffix)
		var err error
		consumer.consumer, err = format.FieldsConsumer(
			NewSegmentWriteStateFrom(w.segmentWriteState, segmentSuffix))
		if err != nil {
			return nil, err
		}
		consumer.suffix = suffix
		w.formats[format] = consumer
	} else {
		// we've already seen this format, so just grab its suffix
		_, ok := w.suffixes[formatName]
		assert(ok)
		suffix = consumer.suffix
	}

	previousValue = field.PutAttribute(PER_FIELD_SUFFIX_KEY, fmt.Sprintf("%v", suffix))
	assert(previousValue == "")

	// TODO: we should only provide the "slice" of FIS that this PF
	// actually sees ... then stuff like .hasProx could work correctly?
	// NOTE: .hasProx is already broken in the same way for the
	// non-perfield case, if there is a fieldInfo with prox that has no
	// postings, you get a 0 byte file.
	return consumer.consumer.AddField(field)
}

func assert(ok bool) {
	if !ok {
		panic("assert fail")
	}
}

func assert2(ok bool, msg string, args ...interface{}) {
	if !ok {
		panic(fmt.Sprintf(msg, args...))
	}
}

func (w *PerFieldPostingsWriter) Close() error {
	var subs []io.Closer
	for _, v := range w.formats {
		subs = append(subs, v)
	}
	return util.Close(subs...)
}

func _suffix(formatName, suffix string) string {
	return formatName + "_" + suffix
}

func fullSegmentSuffix(fieldName, outerSegmentSuffix, segmentSuffix string) string {
	if len(outerSegmentSuffix) == 0 {
		return segmentSuffix
	}
	// TODO: support embedding; I think it should work but
	// we need a test confirm to confirm
	// return outerSegmentSuffix + "_" + segmentSuffix;
	panic(fmt.Sprintf(
		"cannot embed PerFieldPostingsFormat inside itself (field '%v' returned PerFieldPostingsFormat)",
		fieldName))
}

type PerFieldPostingsReader struct {
	fields  map[string]FieldsProducer
	formats map[string]FieldsProducer
}

func newPerFieldPostingsReader(state SegmentReadState) (fp FieldsProducer, err error) {
	ans := PerFieldPostingsReader{
		make(map[string]FieldsProducer),
		make(map[string]FieldsProducer),
	}
	// Read _X.per and init each format:
	success := false
	defer func() {
		if !success {
			// log.Printf("Failed to initialize PerFieldPostingsReader.")
			// if err != nil {
			// 	log.Print("DEBUG ", err)
			// }
			fps := make([]FieldsProducer, 0)
			for _, v := range ans.formats {
				fps = append(fps, v)
			}
			items := make([]io.Closer, len(fps))
			for i, v := range fps {
				items[i] = v
			}
			util.CloseWhileSuppressingError(items...)
		}
	}()
	// Read field name -> format name
	for _, fi := range state.FieldInfos.Values {
		// log.Printf("Processing %v...", fi)
		if fi.IsIndexed() {
			fieldName := fi.Name
			// log.Printf("Name: %v", fieldName)
			if formatName := fi.Attribute(PER_FIELD_FORMAT_KEY); formatName != "" {
				// log.Printf("Format: %v", formatName)
				// null formatName means the field is in fieldInfos, but has no postings!
				suffix := fi.Attribute(PER_FIELD_SUFFIX_KEY)
				// log.Printf("Suffix: %v", suffix)
				assert(suffix != "")
				format := LoadPostingsFormat(formatName)
				segmentSuffix := formatName + "_" + suffix
				// log.Printf("Segment suffix: %v", segmentSuffix)
				if _, ok := ans.formats[segmentSuffix]; !ok {
					// log.Printf("Loading fields producer: %v", segmentSuffix)
					newReadState := state // clone
					newReadState.SegmentSuffix = formatName + "_" + suffix
					fp, err = format.FieldsProducer(newReadState)
					if err != nil {
						return fp, err
					}
					ans.formats[segmentSuffix] = fp
				}
				ans.fields[fieldName] = ans.formats[segmentSuffix]
			}
		}
	}
	success = true
	return &ans, nil
}

func (r *PerFieldPostingsReader) Terms(field string) Terms {
	if p, ok := r.fields[field]; ok {
		return p.Terms(field)
	}
	return nil
}

func (r *PerFieldPostingsReader) Close() error {
	fps := make([]FieldsProducer, 0)
	for _, v := range r.formats {
		fps = append(fps, v)
	}
	items := make([]io.Closer, len(fps))
	for i, v := range fps {
		items[i] = v
	}
	return util.Close(items...)
}


text:
package gocsi

const (
	// Namespace is the namesapce used by the protobuf.
	Namespace = "csi"

	// CSIEndpoint is the name of the environment variable that
	// contains the CSI endpoint.
	CSIEndpoint = "CSI_ENDPOINT"
)


text:
/* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 20, 2013 09:36:25 PM America/New_York */

@font-face {
    font-family: 'HominisNormal';
    src: url('HOMINIS-webfont.eot');
    src: url('HOMINIS-webfont.eot?#iefix') format('embedded-opentype'),
         url('HOMINIS-webfont.woff') format('woff'),
         url('HOMINIS-webfont.ttf') format('truetype'),
         url('HOMINIS-webfont.svg#HominisNormal') format('svg');
    font-weight: normal;
    font-style: normal;

}


text:
//
//  RocksDBWriteBatchIterator.h
//  ObjectiveRocks
//
//  Created by Iska on 20/08/15.
//  Copyright (c) 2015 BrainCookie. All rights reserved.
//

#import "RocksDBIterator.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, RocksDBWriteBatchEntryType)
{
	RocksDBWriteBatchEntryTypePutRecord,
	RocksDBWriteBatchEntryTypeMergeRecord,
	RocksDBWriteBatchEntryTypeDeleteRecord,
	RocksDBWriteBatchEntryTypeLogDataRecord
};

@interface RocksDBWriteBatchEntry : NSObject

@property (nonatomic, readonly) RocksDBWriteBatchEntryType type;
@property (nonatomic, readonly) NSData *key;
@property (nonatomic, readonly) NSData *value;

@end

@interface RocksDBWriteBatchIterator : NSObject

/** @brief Closes this Iterator */
- (void)close;

/**
 An iterator is either positioned at a key/value pair, or not valid.

 @return `YES` if the iterator is valid, `NO` otherwise.
 */
- (BOOL)isValid;

/**
 Positions the iterator at the first key in the source.
 The iterator `isValid` after this call if the source is not empty.
 */
- (void)seekToFirst;

/**
 Positions the iterator at the last key in the source.
 The iterator `isValid` after this call if the source is not empty.
 */
- (void)seekToLast;

/**
 Positions the iterator at the first key in the source that at or past the given key.
 The iterator `isValid` after this call if the source contains an entry that comes at
 or past the given key.

 @param aKey The key to position the tartaritartor at.
 */
- (void)seekToKey:(NSData *)aKey;

/**
 Moves to the next entry in the source. After this call, `isValid` is
 true if the iterator was not positioned at the last entry in the source.
 */
- (void)next;

/**
 Moves to the previous entry in the source.  After this call, `isValid` is
 true iff the iterator was not positioned at the first entry in source.
 */
- (void)previous;

/**
 Returns the `RocksDBWriteBatchEntry` at the current position.

 @return The entry at the current position.

 @see RocksDBWriteBatchEntry`
 */
- (RocksDBWriteBatchEntry *)entry;

/**
 Executes a given block for each entry in the iterator.

 @param block The block to apply to entries.
 */
- (void)enumerateEntriesUsingBlock:(void (^)(RocksDBWriteBatchEntry *entry, BOOL *stop))block;

/**
 Executes a given block for each entry in the iterator in reverse order.

 @param block The block to apply to entries.
 */
- (void)reverseEnumerateEntriesUsingBlock:(void (^)(RocksDBWriteBatchEntry *entry, BOOL *stop))block;

@end

NS_ASSUME_NONNULL_END


text:
class Settings {

public:

  // input and output
  std::string target;
  std::string model;
  std::string output;
  std::string landmarks;

  fitModel::MinimizerSettings minimizerSettings;
  fitModel::EnergySettings energySettings;

  double landmarkTermWeight = 1;

  int meshSmoothIterations = 0;

  bool fixedNeighbors = false;
  bool useNoProjection = false;
  bool landmarksPresent = false;
  bool useLandmarksOnlyForInitialization = false;

  Settings(int argc, char* argv[]) {

    // input and output
    FlagSingle<std::string> targetFlag("target", this->target);
    FlagSingle<std::string> modelFlag("model", this->model);
    FlagSingle<std::string> outputFlag("output", this->output);
    FlagSingle<std::string> landmarksFlag("landmarks", this->landmarks, true);

    /////////////////////////////////////////////////////////////////////////

    FlagSingle<int> meshSmoothIterationsFlag("meshSmoothIterations", this->meshSmoothIterations, true);

    /////////////////////////////////////////////////////////////////////////

    // energy settings
    FlagSingle<double> landmarkTermWeightFlag("landmarkTermWeight", this->landmarkTermWeight, true);

    /////////////////////////////////////////////////////////////////////////

    // minimizer settings
    FlagSingle<int> iterationAmountFlag(
      "iter", this->minimizerSettings.iterationAmount, true);
    FlagSingle<double> priorSizeFlag(
      "priorSize", this->minimizerSettings.priorSize, true);

    FlagSingle<int> convergenceFactorFlag(
      "convergenceFactor",
      this->minimizerSettings.convergenceFactor, true);

    FlagSingle<double> projectedGradientToleranceFlag(
      "projectedGradientTolerance",
      this->minimizerSettings.projectedGradientTolerance, true);

    FlagSingle<int> maxFunctionEvalsFlag(
      "maxFunctionEvals",
      this->minimizerSettings.maxFunctionEvals, true);

    /////////////////////////////////////////////////////////////////////////

    // nearest neighbor settings
    FlagSingle<double> maxDistanceFlag(
      "maxDistance", this->energySettings.maxDistance, true);

    FlagSingle<double> maxAngleFlag(
      "maxAngle", this->energySettings.maxAngle, true);

    // set default value
    this->energySettings.searchRadius = 0;
    FlagSingle<double> searchRadiusFlag(
      "searchRadius", this->energySettings.searchRadius, true);

    FlagNone fixedNeighborsFlag("fixedNeighbors", this->fixedNeighbors);
    FlagNone useNoProjectionFlag("useNoProjection", this->useNoProjection);
    FlagNone useLandmarksOnlyForInitializationFlag(
      "useLandmarksOnlyForInitialization",
      this->useLandmarksOnlyForInitialization);

    /////////////////////////////////////////////////////////////////////////

    FlagsParser parser(argv[0]);

    // input and output
    parser.define_flag(&targetFlag);
    parser.define_flag(&modelFlag);
    parser.define_flag(&outputFlag);
    parser.define_flag(&landmarksFlag);

    parser.define_flag(&meshSmoothIterationsFlag);

    // energy settings
    parser.define_flag(&landmarkTermWeightFlag);

    // minimizer settings
    parser.define_flag(&useLandmarksOnlyForInitializationFlag);
    parser.define_flag(&iterationAmountFlag);
    parser.define_flag(&priorSizeFlag);
    parser.define_flag(&convergenceFactorFlag);
    parser.define_flag(&projectedGradientToleranceFlag);
    parser.define_flag(&maxFunctionEvalsFlag);

    // nearest neighbor settings
    parser.define_flag(&maxDistanceFlag);
    parser.define_flag(&maxAngleFlag);
    parser.define_flag(&searchRadiusFlag);
    parser.define_flag(&fixedNeighborsFlag);
    parser.define_flag(&useNoProjectionFlag);

    parser.parse_from_command_line(argc, argv);

    this->energySettings.useProjection = !this->useNoProjection;

    if( this->fixedNeighbors == true) {
      this->energySettings.searchStrategy =
        fitModel::EnergySettings::SearchStrategy::FIXED;
    }
    else if( searchRadiusFlag.is_present() == true ) {
      this->energySettings.searchStrategy =
        fitModel::EnergySettings::SearchStrategy::ADAPTIVE;
    }

    this->landmarksPresent = landmarksFlag.is_present();

  }

};

#endif


text:
/**
 * Station (with Store)
 * @author Victor Lourng
 * @author Dan Burger
 * @version	2016
 */

public class Station {
  private double GasPrice;
  private Item[] items = new Item[5];

  public Station(){
  }
  public Station(double GasPrice){
    this.GasPrice = GasPrice;
  }
  public Station(Item[] items){
    this.items = items;
  }
  public Station(double GasPrice, Item[] items){
    this.GasPrice = GasPrice;
    this.items = items;
  }

  // by default gas station has one fixed price, can be overloaded for special rules and this would not be applicable.
  public void setGasPrice(double price) {
    this.GasPrice = price;
  }
  // Each gas station has its own rules, so it returns a string explaining pricing rules.
  public String getGasPrice() {
    return new String("The gas price is: " + this.GasPrice +" per gallon.");
  }
  public double calculateGasPrice(double gallons) {
    return GasPrice*gallons;
  }

  // public String testA() {
  //   return items[1].getName();
  // }

  public String getItemPrices() {
    String s = "";
		for (Item x : this.items) {
			s += x.getName() + " costs " + x.getPrice() + "; ";
		}
		return s;
  }

  public double calculateItemPrice(String item, int quantity) {
		for (Item x : this.items) {
			if (x.getName().toLowerCase().equals(item.toLowerCase())) {
				return quantity*x.getPrice();
			}
		}
		return 0.00;
  }

  public String toString() {
    return new String("String goes here");
  }
  public boolean equals(Station that) {
    return this.GasPrice==that.GasPrice;
  }

}


text:
/** @jsx React.DOM */

var React = require('react');
var bootstrap = require('bootstrap');
var Table = require('reactlet-table');

var app = app || {};

app.getIdText = function(id) {
    return 'ID-' + id;
}

// table0Data
// { id:'P01', name:'egg', price:7, description:'fresh egg', extra:'n/a' },
app.table0Data = {
    boxClass: 'table-container-bordered',
    colModel: {
        name: { name:'name', text:'Name', width:'40%' },
        value: { name:'value', text:'Value', width:'60%' }
    },
    dataItems:[
        { name:'id', value:'P01' },
        { name:'name', value:'egg' },
        { name:'price', value:'7' },
        { name:'description', value:'fresh egg' },
        { name:'extra', value:'n/a' }
    ]
};

// table1Data has no key column defined
app.table1Data = {
    boxClass: 'table-container-bordered',
    colModel: {
        id: { name:'id', text:'ID', width:'15%', format:app.getIdText },
        name: { name:'name', text:'Name', width:'20%', sort:'up' },
        price: { name:'price', text:'Price', width:'15%', type:'money' },
        description: { name:'description', text:'Description', width:'30%' },
        extra: { name:'extra', text:'Extra', show:false, width:'10%' }
    },
    dataItems:[
        { id:'P01', name:'egg', price:7, description:'fresh egg', extra:'n/a' },
        { id:'P21', name:'bread', price:2.99, description:'whole grain bread', extra:'n/a' },
        { id:'P23', name:'chip', price:2.1, description:'potato chip', extra:'n/a' },
        { id:'P54', name:'sauce', price:1.89, description:'dipping sauce', extra:'n/a' },
        { id:'P81', name:'corn', price:4.59, description:'fresh corn', extra:'n/a' }
    ]
};

// table1Data has no key column defined
app.table2Data = {
    boxClass: 'table-container-bordered',
    colModel: {
        id: { name:'id', text:'ID', flex:1, format:app.getIdText },
        name: { name:'name', text:'Name', flex:2, sort:'up' },
        price: { name:'price', text:'Price', flex:2, type:'money' },
        description: { name:'description', text:'Description', flex:4 },
        extra: { name:'extra', text:'Extra', show:false, flex:2 }
    },
    dataItems:[
        { id:'P01', name:'egg', price:7, description:'fresh egg', extra:'n/a' },
        { id:'P21', name:'bread', price:2.99, description:'whole grain bread', extra:'n/a' },
        { id:'P23', name:'chip', price:2.1, description:'potato chip', extra:'n/a' },
        { id:'P54', name:'sauce', price:1.89, description:'dipping sauce', extra:'n/a' },
        { id:'P81', name:'corn', price:4.59, description:'fresh corn', extra:'n/a' }
    ]
};

// table3Data has 'id' column as key column
app.table3Data = {
    boxClass: 'table-container-bordered',
    colModel: {
        id: { name:'id', text:'ID', key:true, format:app.getIdText },
        name: { name:'name', text:'Name', sort:'up' },
        price: { name:'price', text:'Price', type:'money' },
        description: { name:'description', text:'Description' },
        extra: { name:'extra', text:'Extra', show:false }
    },
    dataItems:[
        { id:'P01', name:'egg', price:5.98, description:'fresh egg', extra:'n/a' },
        { id:'P02', name:'bread', price:1.29, description:'white bread', extra:'n/a' },
        { id:'P03', name:'chip', price:2.13, description:'potato chip', extra:'n/a' },
        { id:'P04', name:'sauce', price:1.89, description:'dipping sauce', extra:'n/a' },
        { id:'P05', name:'corn', price:4.59, description:'fresh pear', extra:'n/a' },
        { id:'P06', name:'vegi', price:2.12, description:'potato', extra:'n/a' },
        { id:'P07', name:'vegi', price:1.81, description:'eggplant', extra:'n/a' },
        { id:'P08', name:'corn', price:4.99, description:'fresh aple', extra:'n/a' },
        { id:'P09', name:'chip', price:2.15, description:'potato chip', extra:'n/a' },
        { id:'P10', name:'sauce', price:1.82, description:'dipping sauce', extra:'n/a' },
        { id:'P11', name:'corn', price:4.49, description:'fresh cucumber', extra:'n/a' },
        { id:'P12', name:'chip', price:2.19, description:'potato chip', extra:'n/a' },
        { id:'P13', name:'sauce', price:1.29, description:'mild sauce', extra:'n/a' },
        { id:'P14', name:'corn', price:4.39, description:'popcorn', extra:'n/a' },
        { id:'P15', name:'chip', price:2.32, description:'potato soup', extra:'n/a' },
        { id:'P16', name:'sauce', price:1.89, description:'dipping sauce', extra:'n/a' },
        { id:'P17', name:'corn', price:4.29, description:'fresh corn', extra:'n/a' },
        { id:'P18', name:'chip', price:2.41, description:'potato mash', extra:'n/a' },
        { id:'P19', name:'sauce', price:1.80, description:'hot sauce', extra:'n/a' },
        { id:'P20', name:'corn', price:4.19, description:'fresh corn', extra:'n/a' },
        { id:'P21', name:'bread', price:2.99, description:'eight grain bread', extra:'n/a' },
        { id:'P22', name:'chip', price:2.51, description:'corn chip', extra:'n/a' },
        { id:'P23', name:'sauce', price:1.87, description:'medium sauce', extra:'n/a' }
    ],
    paging: {
        size: 5,
        page: 1
    }
};

$().ready(function() {
    // table0
    app.table0 = React.render(

,
        document.getElementById('table0')
    );
    // table1
    app.table1 = React.render(

,
        document.getElementById('table1')
    );
    // table2
    app.table2 = React.render(

,
        document.getElementById('table2')
    );
    // table3 with paging
    app.table3 = React.render(

,
        document.getElementById('table3')
    );
    app.table3.on('table-row-click', function(event) {
        var id = event.id;
        console.log('row click - id:', id, 'table active item id:', app.table2.state.activeItemId);
    });
});


text:
PUT SOiSK project

Easily extendable network text communicator.


text:
/*
 * 文 件 名:  BeanAssemblyTest.java
 * 版    权:   .
 * 描    述:  <描述>
 * 修 改 人:  chen.simon
 * 修改时间:  2016-4-11
 */
package org.simonme.srcstudy.spring3.demo.service;

import java.io.IOException;

import org.simonme.srcstudy.spring3.demo.service.impl.ServiceAImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * <一句话功能简述> 组装bean测试
 * <功能详细描述>
 *
 * @author  Chenxiaguang
 * @version  [版本号, 2016-4-11]
 * @see  [相关类/方法]
 * @since  [产品/模块版本]
 */
public class BeanAssemblyTest
{

    /** <一句话功能简述>
     * <功能详细描述>
     * @param args
     * @see [类、类#方法、类#成员]
     */
    public static void main(String[] args)
    {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        ServiceA serviceA = (ServiceA)applicationContext.getBean("serviceA", ServiceAImpl.class);
        System.out.println(serviceA);
        System.out.println(serviceA.queryA());
        try
        {
            System.in.read();
        }
        catch (IOException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}


text:
package com.bosboy.entity;

import java.io.Serializable;

public class User extends BaseEntity implements Serializable {
	/**
	 *
	 */
	private static final long serialVersionUID = 8003044275955701536L;
	private String name;
}


text:
Provides access to the system's UI for selecting documents from the available providers on the user's device.

# API documentation

- [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/document-picker.md)
- [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/document-picker/)

# Installation in managed Expo projects

For [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/document-picker/).

# Installation in bare React Native projects

For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.

### Add the package to your npm dependencies

```
expo install expo-document-picker
```

### Configure for iOS

Run `npx pod-install` after installing the npm package.

### Configure for Android

No additional set up necessary.

### Plugin

In order to enable Apple iCloud storage in managed EAS builds, you'll need to define the `appleTeamId` property in the config plugin:

`app.json`

```json
{
  "ios": {
    "usesIcloudStorage": true,
    "bundleIdentifier": "com.yourname.yourapp"
  },
  "plugins": [
    [
      "expo-document-picker",
      {
        "appleTeamId": "YOUR_TEAM_ID"
      }
    ]
  ]
}
```

> Running `expo eject` will generate a the native project locally with the applied changes in your iOS Entitlements file.

# Contributing

Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).