text:
<?php

namespace Demo\AppBundle\Controller;

use BernardoSecades\Json\Json;
use BernardoSecades\Json\DecodeException;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\AbstractType;
use JMS\Serializer\Serializer;

/**
 * Class AbstractBaseController
 * @package Demo\AppBundle\Controller
 */
abstract class AbstractBaseController extends Controller
{
    /**
     * @param mixed $data
     * @param int   $statusCode
     * @param array $headers
     *
     * @return Response
     */
    protected function getResponse($data, $statusCode, array $headers = [])
    {
        /** @var Serializer $serializer */
        $serializer = $this->get('jms_serializer');
        $dataSerialized = $serializer->serialize($data, 'json');

        $response = new Response($dataSerialized, $statusCode, $headers);
        $response->headers->add($headers);
        $response->headers->set('Content-Type', 'application/json');

        return $response;
    }

    /**
     * Check if data is valid and save in object entity.
     *
     * @param AbstractType $type
     * @param mixed        $entity
     * @param Request      $request
     *
     * @return array
     */
    protected function processForm(AbstractType $type, $entity, Request $request)
    {
        $errors = [];
        try {
            $data = Json::decode($request->getContent(), true);
        } catch (DecodeException $exception) {
            $errors[] = sprintf('%s, ErrorCode: %d', $exception->getMessage(), $exception->getCode());

            return $errors;
        }

        $form = $this->createForm($type, $entity);
        $form->submit($data);

        if (!$form->isValid()) {
            $errors = $this->getAllFormErrors($form->all());
        }

        return $errors;
    }

    /**
     * @param FormInterface[] $children
     *
     * @return array
     */
    private function getAllFormErrors($children)
    {
        $allErrors = [];
        foreach ($children as $child) {
            if (!empty($child->all())) {
                $allErrors[$child->getName()] = $this->getAllFormErrors($child->all());
            } elseif (!empty($child->getErrors())) {
                $errors = $child->getErrors();
                foreach ($errors as $error) {
                    $allErrors[$child->getName()] = $error->getMessage();
                }
            }
        }

        return $allErrors;
    }
}


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE675_Duplicate_Operations_on_Resource__fopen_83_bad.cpp
Label Definition File: CWE675_Duplicate_Operations_on_Resource.label.xml
Template File: sources-sinks-83_bad.tmpl.cpp
*/
/*
 * @description
 * CWE: 675 Duplicate Operations on Resource
 * BadSource: fopen Open and close a file using fopen() and flose()
 * GoodSource: Open a file using fopen()
 * Sinks:
 *    GoodSink: Do nothing
 *    BadSink : Close the file
 * Flow Variant: 83 Data flow: data passed to class constructor and destructor by declaring the class object on the stack
 *
 * */
#ifndef OMITBAD

#include "std_testcase.h"
#include "CWE675_Duplicate_Operations_on_Resource__fopen_83.h"

namespace CWE675_Duplicate_Operations_on_Resource__fopen_83
{
CWE675_Duplicate_Operations_on_Resource__fopen_83_bad::CWE675_Duplicate_Operations_on_Resource__fopen_83_bad(FILE * dataCopy)
{
    data = dataCopy;
    data = fopen("BadSource_fopen.txt", "w+");
    /* POTENTIAL FLAW: Close the file in the source */
    fclose(data);
}

CWE675_Duplicate_Operations_on_Resource__fopen_83_bad::~CWE675_Duplicate_Operations_on_Resource__fopen_83_bad()
{
    /* POTENTIAL FLAW: Close the file in the sink (it may have been closed in the Source) */
    fclose(data);
}
}
#endif /* OMITBAD */

redpajama_set_name: RedPajamaGithub


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>
#include <assert.h>
#include <exception>

// System.Reflection.AssemblyCompanyAttribute
struct AssemblyCompanyAttribute_t3289935671;
// System.String
struct String_t;

#include "codegen/il2cpp-codegen.h"
#include "mscorlib_System_String7231557.h"

// System.Void System.Reflection.AssemblyCompanyAttribute::.ctor(System.String)
extern "C"  void AssemblyCompanyAttribute__ctor_m2502605305 (AssemblyCompanyAttribute_t3289935671 * __this, String_t* ___company0, const MethodInfo* method) IL2CPP_METHOD_ATTR;


text:
<!doctype html>

	<meta name="viewport" content="initial-scale=1, maximum-scale=1"/>
	<meta charset="UTF-8">

  <link rel="stylesheet" href="../libraries/angular-material/angular-material.min.css">

  <link rel="stylesheet" href="../libraries/bootstrap/dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="../libraries/bootstrap-daterangepicker/daterangepicker-bs3.css">

  <link rel="stylesheet" href="../libraries/angular-bootstrap-datetimepicker/src/css/datetimepicker.css">
  <link rel="stylesheet" href="../global/css/index.client.style.css">
  <link rel="stylesheet" href="dist/css/tender.css">

	<title>柱柱招标</title>


text:
class WindowsRebootHandler < Chef::Handler
  include Chef::Mixin::ShellOut

  def initialize(allow_pending_reboots = true, timeout = 60, reason = "Chef client run")
    @allow_pending_reboots = allow_pending_reboots
    @timeout = timeout
    @reason = reason
  end

  def report
    log_message, reboot = begin
      if reboot_requested?
        ["chef_handler[#{self.class}] requested reboot will occur in #{timeout} seconds", true]
      elsif reboot_pending?
        if @allow_pending_reboots
          ["chef_handler[#{self.class}] reboot pending - automatic reboot will occur in #{timeout} seconds", true]
        else
          ["chef_handler[#{self.class}] reboot pending but handler not configured to act on pending reboots - please reboot node manually", false]
        end
      else
        ["chef_handler[#{self.class}] no reboot requested or pending", false]
      end
    end

    Chef::Log.warn(log_message)
    shell_out!("shutdown /r /t #{timeout} /c \"#{reason}\"") if reboot
  end

  private
  # reboot cause CHEF says so:
  # reboot explicitly requested in our cookbook code
  def reboot_requested?
    node.run_state[:reboot_requested] == true
  end

  # reboot cause WIN says so:
  # reboot pending because of some configuration action we performed
  def reboot_pending?
    # Any files listed here means reboot needed
    (Registry.key_exists?('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations') &&
      Registry.get_value('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager','PendingFileRenameOperations').any?) ||
    # 1 for any value means reboot pending
    # "9306cdfc-c4a1-4a22-9996-848cb67eddc3"=1
    (Registry.key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired') &&
      Registry.get_values('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired').select{|v| v[2] == 1 }.any?) ||
    # 1 or 2 for 'Flags' value means reboot pending
    (Registry.key_exists?('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile') &&
      [1,2].include?(Registry::get_value('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile','Flags')))
  end

  def timeout
    node.run_state[:reboot_timeout] || node['windows']['reboot_timeout'] || @timeout
  end

  def reason
    node.run_state[:reboot_reason] || @reason
  end
end


text:
package main

import (
	"fmt"
	"net"

	"github.com/vishvananda/netlink"
)

func NewIptun(name string, remote, local net.IP) *netlink.Iptun {
	tun := &netlink.Iptun{}
	tun.Attrs().Name = name
	tun.Remote = remote
	tun.Local = local

	return tun
}

func AddLink(link netlink.Link) (netlink.Link, error) {
	if err := netlink.LinkAdd(link); err != nil {
		return nil, err
	}

	if err := netlink.LinkSetUp(link); err != nil {
		netlink.LinkDel(link)
		return nil, err
	}

	newLink, err := netlink.LinkByName(link.Attrs().Name)
	if err != nil {
		netlink.LinkDel(link)
		return nil, err
	}

	return newLink, nil
}

func DelLinkByName(name string) error {
	link := netlink.Dummy{}
	link.Attrs().Name = name
	netlink.LinkSetDown(&link)
	return netlink.LinkDel(&link)
}

func AddRoute(dst *net.IPNet, ifindex int) error {
	route := netlink.Route{
		LinkIndex: ifindex,
		Dst:       dst,
	}

	return netlink.RouteAdd(&route)
}

func DelRoute(dst *net.IPNet, ifindex int) error {
	route := netlink.Route{
		LinkIndex: ifindex,
		Dst:       dst,
	}

	return netlink.RouteDel(&route)
}

func SelectAddr(network *net.IPNet, addrs []netlink.Addr) (*netlink.Addr, error) {
	for _, addr := range addrs {
		if ok := network.Contains(addr.IP); ok {
			return &addr, nil
		}
	}

	return nil, fmt.Errorf("Addr in %s not found.", network)
}

func LinkAddrs(ifname string, family int) ([]netlink.Addr, error) {
	link, err := netlink.LinkByName(ifname)
	if err != nil {
		return nil, err
	}

	return netlink.AddrList(link, family)
}

func LinkAddr(ifname string, network *net.IPNet) (*netlink.Addr, error) {
	family := func() int {
		if network.IP.To4() != nil {
			return netlink.FAMILY_V4
		}
		return netlink.FAMILY_V6
	}()

	addrs, err := LinkAddrs(ifname, family)
	if err != nil {
		return nil, err
	}

	return SelectAddr(network, addrs)
}


text:
using CoCo.Analyser.Classifications.CSharp;
using CoCo.Test.Common;
using NUnit.Framework;

namespace CoCo.Test.CSharpIdentifiers
{
    internal class SimpleTest : CSharpIdentifierTests
    {
        [Test]
        public void CommonTest()
        {
            GetContext(@"SimpleExample.cs")
                .AddInfo(CSharpNames.ClassName.EnableInEditor())
                .GetClassifications().AssertIsEquivalent(
                    CSharpNames.NamespaceName.ClassifyAt(10, 17),
                    CSharpNames.ClassName.ClassifyAt(51, 13),
                    CSharpNames.MethodName.ClassifyAt(94, 6),
                    CSharpNames.ParameterName.ClassifyAt(108, 6),
                    CSharpNames.LocalVariableName.ClassifyAt(144, 5));
        }
    }
}


text:
<!doctype html>

    <meta charset="utf-8">
    <title>AMP Ad Lightbox Prototype Example</title>
    <link rel="canonical" href="amps.html" >
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">

    <amp-img src="https://lh3.googleusercontent.com/5rcQ32ml8E5ONp9f9-Rf78IofLb9QjS5_0mqsY1zEFc=w400-h300-no-n"
             width="400"
             height="300"
             layout="responsive">
    </amp-img>

  <amp-lightbox id="main-lightbox"
                class="main-lightbox"
                layout="nodisplay"
                animate-in="fly-in-bottom"
                close-button>
    <amp-carousel type="slides"
                  height="300"
                  layout="fixed-height">
      <amp-img src="https://lh3.googleusercontent.com/Z4gtm5Bkxyv21Z2PtbTf95Clb9AE4VTR6olbBKYrenM=w400-h300-no-n"
               width="400"
               height="300"
               layout="responsive">
      </amp-img>
      <amp-img src="https://ampbyexample.com/img/amp.jpg"
               layout="responsive"
               width="1080"
               height="610">
      </amp-img>
    </amp-carousel>
  </amp-lightbox>


text:
package convenientadditions.init;

import convenientadditions.api.recipe.ShapedNBTOreRecipe;
import convenientadditions.api.recipe.ShapelessNBTOreRecipe;
import convenientadditions.config.*;
import convenientadditions.item.soulGem.RecipeSoulGem;
import convenientadditions.item.tools.adventurersPickaxe.RecipeAdventurersPickaxeRepair;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.init.PotionTypes;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionType;
import net.minecraft.potion.PotionUtils;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.RecipeSorter;
import net.minecraftforge.oredict.RecipeSorter.Category;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;

public class ModRecipes {

    public static void init() {
        RecipeSorter.register("ShapedNBTOreRecipe", ShapedNBTOreRecipe.class, Category.SHAPED, "");
        RecipeSorter.register("ShapelessNBTOreRecipe", ShapelessNBTOreRecipe.class, Category.SHAPELESS, "");

        if (ModConfigTools.ironWrench)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.itemIronWrench, 1),
                    "n n",
                    " i ",
                    "n n",
                    'i', "ingotIron",
                    'n', "nuggetIron"));

        initCompost();
        initBlocks();
        initMachines();
        initArrows();
        initRelics();
        initTrinkets();
        initInventoryProxies();
        initModules();
        initTreeTap();
        initAdvPickaxe();
        initMCDs();
        initMisc();
        initCraftingItems();
        initCheese();
        initPotions();
        initPlatforms();

        if(Loader.isModLoaded("gbook") && ModConfigCompat.gbook_recipe)
            GameRegistry.addRecipe(new ShapelessOreRecipe(GameRegistry.makeItemStack("gbook:guidebook",0,1,"{Book:\"convenientadditions:xml/book.xml\"}"),
                    Items.BOOK,"feather",Items.WHEAT_SEEDS));
    }

    private static void initCraftingItems() {
        GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemObsidianPlate, 6), "obsidian", "obsidian", "stone"));

        if(ModConfigCraftingItems.dislocationCore)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.itemDislocationCore,3),
                    " e ",
                    "lrl",
                    " e ",
                    'e', "enderpearl",
                    'r', "dustRedstone",
                    'l', new ItemStack(Items.DYE,1,4)));

        if(ModConfigCraftingItems.soulGem){
            RecipeSorter.register("RecipeSoulGem", RecipeSoulGem.class, Category.SHAPELESS, "");
            GameRegistry.addRecipe(new RecipeSoulGem());
        }

        if(ModConfigCraftingItems.spikes)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.itemSpikes,4),
                    "sss",
                    "hhh",
                    's', "stickWood",
                    'h', "slabWood"));
    }

    private static void initMisc() {
        if(ModConfigMisc.backpack_recipe)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.itemBackpack),
                    "sls",
                    "l l",
                    "lll",
                    'l', "leather",
                    's', "string"));

        GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.SLIME_BALL,3),ModItems.itemSlimeBucket));
    }

    private static void initCompost() {
        if (ModConfigMisc.composter_recipe)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.composterBlock),
                    "s s",
                    "s s",
                    "ppp",
                    's', "slabWood",
                    'p', "plankWood"));

        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.compostSoilBlock),
                "cc",
                "cc",
                'c', "chunkCompost"));
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.DIRT),
                "dd",
                "dd",
                'd', "chunkDirt"));
        GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.compostSoilBlock), Blocks.DIRT, "chunkCompost"));
        GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.DIRT), ModBlocks.compostSoilBlock));
    }

    private static void initBlocks() {
        if (ModConfigMisc.powderKeg)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.powderKegBlock),
                    "psp",
                    "pgp",
                    "psp",
                    'p', "plankWood",
                    's', "slabWood",
                    'g', "gunpowder"));

        if (ModConfigMisc.seedBox_recipe)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.seedBoxBlock,2),
                    "tpt",
                    "php",
                    "tpt",
                    'h', Blocks.HOPPER,
                    'p', "plankWood",
                    't', "ingotIron"));

        if (ModConfigMisc.displayCase)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.displayCase,2),
                    "ppp",
                    "p p",
                    "sss",
                    's', "slabWood",
                    'p', "paneGlassColorless"));

        if(ModConfigBuildingBlocks.ironGolemBlock)
            GameRegistry.addRecipe(new ShapedNBTOreRecipe(new ItemStack(ModBlocks.ironGolemBlock,32),
                    "iii",
                    "isi",
                    "iii",
                    'i', "blockIron",
                    's', ModItems.itemSoulGem.setEntityId(new ItemStack(ModItems.itemSoulGem),"minecraft:villager_golem")));

        if (ModConfigMisc.enderProofBlock)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.enderProofBlock,6),
                    "oio",
                    "iwi",
                    "oio",
                    'o', "obsidian",
                    'i', Blocks.IRON_BARS,
                    'w', Items.WATER_BUCKET));

        if (ModConfigMisc.enderProofGlass)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.enderProofGlass,6),
                    "gig",
                    "iwi",
                    "gig",
                    'g', "blockGlass",
                    'i', Blocks.IRON_BARS,
                    'w', Items.WATER_BUCKET));

        if (ModConfigMisc.workStation)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.workStation),
                    "sss",
                    "pwp",
                    "pcp",
                    's', "cobblestone",
                    'p', "plankWood",
                    'c', "chestWood",
                    'w', "workbench"));

        if (ModConfigMisc.punjiSticks)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.punjiSticks),
                    "ss",
                    "cc",
                    's', ModItems.itemSpikes,
                    'c', new ItemStack(Blocks.STONE_SLAB)));

        if (ModConfigMisc.storageCrate)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.storageCrate),
                    "lll",
                    "lcl",
                    "lll",
                    'l', "logWood",
                    'c', "chestWood"));

        if (ModConfigBuildingBlocks.woodenTile)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.woodenTile,8),
                    "sps",
                    "ppp",
                    "sps",
                    's', "stickWood",
                    'p', "plankWood"));

        if (ModConfigBuildingBlocks.clearGlass)
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.clearGlass,4),Blocks.GLASS,Blocks.GLASS,Blocks.GLASS,Blocks.GLASS));
    }

    private static void initPlatforms() {
        if (ModConfigMisc.platform){
            for(EnumDyeColor c:EnumDyeColor.values()){
                String dye="dye"+c.getUnlocalizedName().substring(0,1).toUpperCase()+c.getUnlocalizedName().substring(1);
                String pane="paneGlass"+c.getUnlocalizedName().substring(0,1).toUpperCase()+c.getUnlocalizedName().substring(1);
                String block="blockGlass"+c.getUnlocalizedName().substring(0,1).toUpperCase()+c.getUnlocalizedName().substring(1);
                GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.platform, 4, c.getMetadata()),
                        "p p",
                        " d ",
                        "p p",
                        'd', dye,
                        'p', pane));
                ItemStack w=new ItemStack(ModBlocks.platform,1, OreDictionary.WILDCARD_VALUE);
                GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.platform, 4, c.getMetadata()),w,w,w,w,dye));
                GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.semiSolidBlock, 4, c.getMetadata()),
                        "b b",
                        " d ",
                        "b b",
                        'd', dye,
                        'b', block));
                w=new ItemStack(ModBlocks.semiSolidBlock,1, OreDictionary.WILDCARD_VALUE);
                GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.semiSolidBlock, 4, c.getMetadata()),w,w,w,w,dye));
            }
        }
    }

    private static void initMachines(){
        if (ModConfigCraftingItems.machineBlock)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machineBlock, 4),
                    "sbs",
                    "bpb",
                    "sbs",
                    's', "stone",
                    'b', Blocks.IRON_BARS,
                    'p', Blocks.PISTON));

        if (ModConfigMachines.hoverPad)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.hoverPad, 1),
                    "iei",
                    "pmp",
                    "scs",
                    'i', "ingotIron",
                    'e', Items.ENDER_EYE,
                    'p', Blocks.PISTON,
                    'm', ModBlocks.machineBlock,
                    's', "stone",
                    'c', Items.COMPARATOR));

        if (ModConfigMachines.blastPad)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.blastPad, 1),
                    "iki",
                    "dmd",
                    "scs",
                    'i', "ingotIron",
                    'd', Blocks.DISPENSER,
                    'k', ModItems.itemSlimeKit,
                    's', "stone",
                    'm', ModBlocks.machineBlock,
                    'c', Items.COMPARATOR));

        if (ModConfigMachines.playerInterface)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.playerInterfaceBlock),
                    "php",
                    "gmg",
                    "sds",
                    'd', ModItems.itemDislocationCore,
                    'p', Blocks.STONE_PRESSURE_PLATE,
                    'h', Blocks.HOPPER,
                    'm', ModBlocks.machineBlock,
                    'g', "ingotGold",
                    's', "stone"));

        if (ModConfigMachines.setProvider)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.setProviderBlock),
                    "ihi",
                    "cmc",
                    "shs",
                    'i', "ingotIron",
                    'h', Blocks.HOPPER,
                    'c', Items.COMPARATOR,
                    'm', ModBlocks.machineBlock,
                    's', "stone"));

        if (ModConfigMachines.storageMatrix)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.storageMatrix),
                    "ece",
                    "cmc",
                    "ici",
                    'i', "ingotIron",
                    'e', Items.ENDER_EYE,
                    'm', ModBlocks.machineBlock,
                    'c', "chestWood"));

        if (ModConfigMachines.jumpPad_recipe)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.jumpPad),
                    "pep",
                    "dmd",
                    "sgs",
                    'g', "ingotGold",
                    'e', "enderpearl",
                    'm', ModBlocks.machineBlock,
                    'p', Blocks.STONE_PRESSURE_PLATE,
                    's', "stone",
                    'd', ModItems.itemDislocationCore));

        if (ModConfigMachines.itemTransmitter)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.itemTransmitterBlock),
                    "gcg",
                    "dmd",
                    "ses",
                    'g', "ingotGold",
                    'e', Items.ENDER_EYE,
                    'm', ModBlocks.machineBlock,
                    'c', "chestWood",
                    's', "stone",
                    'd', ModItems.itemDislocationCore));

        if (ModConfigMachines.itemReceiver)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.itemReceiverBlock),
                    "ghg",
                    "dmd",
                    "sis",
                    'g', "ingotGold",
                    'i', ModBlocks.inventoryProxyBlock,
                    'm', ModBlocks.machineBlock,
                    'h', Blocks.HOPPER,
                    's', "stone",
                    'd', ModItems.itemDislocationCore));

        if (ModConfigMachines.proximitySensor)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.proximitySensorBlock),
                    "sgs",
                    "tmt",
                    "ege",
                    't', "ingotIron",
                    'e', Items.ENDER_EYE,
                    'g', "ingotGold",
                    's', "dustGlowstone",
                    'm', ModBlocks.machineBlock));

        if (ModConfigMachines.inventoryProxies_remote)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.remoteInventoryProxy),
                    "ipi",
                    "dmd",
                    "ipi",
                    'i', "ingotIron",
                    'd', ModItems.itemDislocationCore,
                    'p', ModBlocks.inventoryProxySidedBlock,
                    'm', ModBlocks.machineBlock));

        if (ModConfigMachines.ironFarm)
            GameRegistry.addRecipe(new ShapedNBTOreRecipe(new ItemStack(ModBlocks.ironFarm),
                    "gng",
                    "vmv",
                    "idi",
                    'd', "doorWood",
                    'i', "blockIron",
                    'n', Items.DRAGON_BREATH,
                    'm', ModBlocks.machineBlock,
                    'g', ModItems.itemSoulGem.setEntityId(new ItemStack(ModItems.itemSoulGem),"minecraft:villager_golem"),
                    'v', ModItems.itemSoulGem.setEntityId(new ItemStack(ModItems.itemSoulGem),"minecraft:villager")));

        if (ModConfigMachines.autoWorkStation)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.autoWorkStation),
                    "sws",
                    "bmb",
                    "scs",
                    'w', ModBlocks.workStation,
                    'c', "chestWood",
                    's', "stone",
                    'b', Blocks.IRON_BARS,
                    'm', ModBlocks.machineBlock));
    }

    private static void initRelics() {
        if (ModConfigRelics.sunstone)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemSunstone,
                    "grg",
                    "tdt",
                    "grg",
                    't', "ingotIron",
                    'd', "gemDiamond",
                    'r', "dustRedstone",
                    'g', "glowstone"));

        if (ModConfigRelics.blazingOrb)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemBlazingRock,
                    "tlt",
                    "bdb",
                    "tgt",
                    't', "nuggetGold",
                    'b', Items.BLAZE_POWDER,
                    'd', "gemDiamond",
                    'l', Items.LAVA_BUCKET,
                    'g', "dustGlowstone"));

        if (ModConfigRelics.enderPlate)
            GameRegistry.addRecipe(new ShapedNBTOreRecipe(ModItems.itemEnderPlate,
                    "epe",
                    "bsb",
                    "epe",
                    'e', "enderpearl",
                    'b', Items.DRAGON_BREATH,
                    'p', ModItems.itemObsidianPlate,
                    's', ModItems.itemSoulGem.setEntityId(new ItemStack(ModItems.itemSoulGem),"minecraft:shulker")));

        if (ModConfigRelics.portableEnderRift)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemPortableEnderRift,
                    " o ",
                    "ded",
                    " o ",
                    'e', "chestEnder",
                    'd', ModItems.itemDislocationCore,
                    'o', "obsidian"));

        if (ModConfigRelics.transmutationTome_recipe)
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemTransmutationTome, 1), Items.BOOK, Items.BLAZE_ROD, Items.ENDER_EYE, Items.WHEAT_SEEDS));
    }

    private static void initTrinkets() {
        if (ModConfigTrinkets.ring_of_sunlight)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemSunlightRing,
                    "ysy",
                    "t t",
                    "yty",
                    't', "ingotIron",
                    's', ModItems.itemSunstone,
                    'y', "string"));

        if (ModConfigTrinkets.ring_of_saturation)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemSaturationRing,
                    "ygy",
                    "t t",
                    "yty",
                    't', "ingotIron",
                    'g', Items.GOLDEN_CARROT,
                    'y', "string"));

        if (ModConfigTrinkets.cloud_jar)
            GameRegistry.addRecipe(new ShapelessOreRecipe(ModItems.itemCloudJar,
                    Items.EXPERIENCE_BOTTLE, Items.RABBIT_FOOT, "slimeball", "gunpowder"));

        if (ModConfigTrinkets.slime_balloon)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemSlimeBalloon,
                    "s",
                    "y",
                    "y",
                    's', "blockSlime",
                    'y', "string"));

        if (ModConfigTrinkets.cloud_balloon)
            GameRegistry.addRecipe(new ShapelessOreRecipe(ModItems.itemCloudBalloon,
                    Items.GHAST_TEAR,ModItems.itemCloudJar,ModItems.itemSlimeBalloon));

        if (ModConfigTrinkets.ender_cloud_balloon)
            GameRegistry.addRecipe(new ShapelessOreRecipe(ModItems.itemEnderCloudBalloon,
                    Items.DRAGON_BREATH,ModItems.itemCloudBalloon,Items.ENDER_EYE));

        if (ModConfigTrinkets.wind_gem)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemWindGem,
                    " f ",
                    "ses",
                    " f ",
                    'e', "gemEmerald",
                    's', PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionType.getPotionTypeForName("strong_swiftness")),
                    'f', "feather"));

        if (ModConfigTrinkets.spiked_sole)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemSpikedSole,
                    "l l",
                    "s s",
                    'l', "leather",
                    's', ModItems.itemSpikes));

        if (ModConfigTrinkets.glider)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemGlider,
                    "ysy",
                    "sls",
                    "l l",
                    'y', "string",
                    'l', "leather",
                    's', "stickWood"));

        if (ModConfigTrinkets.valkyrie_wings)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemValkyrieWings,
                    "fwf",
                    "bgb",
                    "f f",
                    'f', "feather",
                    'w', ModItems.itemWindGem,
                    'b', Items.DRAGON_BREATH,
                    'g', ModItems.itemGlider));

        if (ModConfigTrinkets.amulet_of_breath)
            GameRegistry.addRecipe(new ShapedNBTOreRecipe(ModItems.itemBreathAmulet,
                    "yty",
                    "t t",
                    "ypy",
                    't', "ingotIron",
                    'p', PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionType.getPotionTypeForName("water_breathing")),
                    'y', "string"));

        if (ModConfigTrinkets.flippers)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemFlippers,
                    "l l",
                    "c c",
                    "c c",
                    'l', "leather",
                    'c', new ItemStack(Items.DYE,1,2)));

        if (ModConfigTrinkets.flowing_water_rune)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemFlowingWaterRune,
                    "rpr",
                    "wsw",
                    "rpr",
                    'p', "gemPrismarine",
                    's', "stone",
                    'r', "dustRedstone",
                    'w', Items.WATER_BUCKET));

        if (ModConfigTrinkets.tide_amulet)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemTideAmulet,
                    "sbs",
                    "crc",
                    "sfs",
                    's', "gemPrismarine",
                    'c', "dustPrismarine",
                    'b', ModItems.itemBreathAmulet,
                    'r', ModItems.itemFlowingWaterRune,
                    'f', ModItems.itemFlippers));

        if (ModConfigTrinkets.fireproof_cloak)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemFireproofCloak,
                    "iwy",
                    "swl",
                    "swl",
                    'i',"dyeBlack",
                    'w',new ItemStack(Blocks.WOOL,OreDictionary.WILDCARD_VALUE),
                    'y',"string",
                    's',"slimeball",
                    'l',"leather"));

        if (ModConfigTrinkets.nether_talisman)
            GameRegistry.addRecipe(new ShapelessOreRecipe(ModItems.itemNetherTalisman,
                    "paper","dyeRed","dyeBlack","feather","string"));

        if (ModConfigTrinkets.nether_cloak)
            GameRegistry.addRecipe(new ShapelessOreRecipe(ModItems.itemNetherCloak,
                    ModItems.itemNetherTalisman, ModItems.itemFireproofCloak, Items.MAGMA_CREAM, Items.GHAST_TEAR));

        if (ModConfigTrinkets.rocket_pack)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemRocketPack,
                    "r r",
                    "ele",
                    "r r",
                    'r',Items.FIREWORKS,
                    'e',Items.ENDER_EYE,
                    'l',"leather"));

        if (ModConfigTrinkets.climbing_claws)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemClimbingClaws,
                    "s s",
                    "l l",
                    'l', "leather",
                    's', ModItems.itemSpikes));

        if (ModConfigTrinkets.climbing_gear)
            GameRegistry.addRecipe(new ShapelessOreRecipe(ModItems.itemClimbingGear,ModItems.itemSpikedSole,ModItems.itemClimbingClaws));

        if (ModConfigTrinkets.miners_bracelet)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.itemMinersBracelet,
                    " p ",
                    "d d",
                    " d ",
                    'd', "gemDiamond",
                    'p', Items.DIAMOND_PICKAXE));

        if (ModConfigTrinkets.parachute)
            GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.parachute,
                    "lll",
                    "l l",
                    "s s",
                    'l', "leather",
                    's', "string"));

    }

    private static void initInventoryProxies() {
        if (ModConfigMisc.inventoryProxies_regular)
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.inventoryProxyBlock, 4),
                    "shs",
                    "pcp",
                    "shs",
                    's', "stickWood",
                    'p', "plankWood",
                    'h', Blocks.HOPPER,
                    'c', Blocks.CHEST));

        if (ModConfigMisc.inventoryProxies_sided)
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.inventoryProxySidedBlock), ModBlocks.inventoryProxyBlock));
        if (ModConfigMisc.inventoryProxies_regular)
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.inventoryProxyBlock), ModBlocks.inventoryProxySidedBlock));
        if (ModConfigMisc.inventoryProxies_filtered)
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.inventoryProxyFilteredBlock), ModBlocks.inventoryProxyBlock, Items.COMPARATOR));
    }

    private static void initModules() {
        if (ModConfigModules.modulePlayer)
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemModulePlayer), ModItems.itemObsidianPlate, Items.ENDER_EYE, new ItemStack(Items.SKULL, 1, 1)));
        if (ModConfigModules.moduleColor)
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemModuleColor), ModItems.itemObsidianPlate, Items.ENDER_EYE, "dye", "dye", "dye"));
        if (ModConfigModules.moduleLocation)
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemModuleLocation), ModItems.itemObsidianPlate, Items.ENDER_EYE, "dustRedstone", "dustGlowstone"));
        if (ModConfigModules.moduleText)
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemModuleText), ModItems.itemObsidianPlate, Items.ENDER_EYE, Items.NAME_TAG));
    }

    private static void initTreeTap() {
        if (ModConfigMisc.treetap){
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemSapBottle), Items.GLASS_BOTTLE, new ItemStack(Items.DYE, 1, 2)));
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.treetap), "ingotIron", "slimeball", "stickWood"));
        }
        if (ModConfigConsumables.bandage)
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemBandage), "string", "string", "string", "string", "string", "string", "sap"));
    }

    private static void initAdvPickaxe() {
        RecipeSorter.register("RecipeAdventurersPickaxeRepair", RecipeAdventurersPickaxeRepair.class, Category.SHAPELESS, "");
        GameRegistry.addRecipe(new RecipeAdventurersPickaxeRepair());
        GameRegistry.addRecipe(new ShapelessOreRecipe(ModItems.itemAdventurersPickaxe.subitems.get(0), Items.WOODEN_PICKAXE, Items.WHEAT_SEEDS));
        GameRegistry.addRecipe(new ShapelessOreRecipe(ModItems.itemAdventurersPickaxe.subitems.get(1), Items.STONE_PICKAXE, Items.WHEAT_SEEDS));
        GameRegistry.addRecipe(new ShapelessOreRecipe(ModItems.itemAdventurersPickaxe.subitems.get(2), Items.IRON_PICKAXE, Items.WHEAT_SEEDS));
        GameRegistry.addRecipe(new ShapelessOreRecipe(ModItems.itemAdventurersPickaxe.subitems.get(3), Items.DIAMOND_PICKAXE, Items.WHEAT_SEEDS));
    }

    private static void initArrows() {
        if (ModConfigMisc.launchingArrows_creeper) {
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.itemCreeperKit, 1),
                    "tgt",
                    "gcg",
                    "tgt",
                    'c', new ItemStack(Items.SKULL, 1, 4),
                    'g', "gunpowder",
                    't', Blocks.TNT));
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemLaunchingArrow, 8, 0), ModItems.itemCreeperKit, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW));
        }

        if (ModConfigMisc.launchingArrows_blast) {
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.itemBlastKit, 1),
                    "tft",
                    "fgf",
                    "tft",
                    'f', Items.FLINT,
                    'g', "gunpowder",
                    't', Blocks.TNT));
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemLaunchingArrow, 8, 1), ModItems.itemBlastKit, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW));
        }

        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.itemSlimeKit, 1),
                "gsg",
                "sts",
                "gsg",
                's', "slimeball",
                'g', "gunpowder",
                't', Blocks.TNT));
        if (ModConfigMisc.launchingArrows_slime) {
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemLaunchingArrow, 8, 2), ModItems.itemSlimeKit, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW, Items.ARROW));
        }
    }

    private static void initMCDs() {
        if(ModConfigTools.mobCatcher_recipe){
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.itemMobCatcherRegular,1),
                    "ysy",
                    "sds",
                    "ysy",
                    'd', ModItems.itemDislocationCore,
                    'y', "string",
                    's', "slimeball"));

            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.itemMobCatcherSuper,1),
                    "pip",
                    "idi",
                    "pip",
                    'd', ModItems.itemDislocationCore,
                    'i', "ingotIron",
                    'p', "gemPrismarine"));

            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.itemMobCatcherHyper,1),
                    "isi",
                    "bdb",
                    "isi",
                    'd', ModItems.itemDislocationCore,
                    'i', "ingotIron",
                    'b', Blocks.IRON_BARS,
                    's', Items.SHULKER_SHELL));
        }
    }

    private static void initCheese() {
        if(ModConfigConsumables.cheese){
            GameRegistry.addSmelting(Items.MILK_BUCKET,new ItemStack(ModItems.itemCheeseBucket),0.5f);
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemCheese,2),ModItems.itemCheeseBucket));
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemCheeseSandwich,2),"cheese",Items.BREAD));
        }
        if(ModConfigBuildingBlocks.cheeseBlock){
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.cheeseBlock,1),ModItems.itemCheese,ModItems.itemCheese,ModItems.itemCheese,ModItems.itemCheese,ModItems.itemCheese,ModItems.itemCheese,ModItems.itemCheese,ModItems.itemCheese,ModItems.itemCheese));
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.itemCheese,9),ModBlocks.cheeseBlock));
        }
    }

    private static void initPotions(){
        if(ModConfigConsumables.potion_lumbering)
            GameRegistry.addRecipe(new ShapelessNBTOreRecipe(new ItemStack(ModItems.itemPotionLumbering),PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER),"cheese","sap","cropPotato"));
        if(ModConfigConsumables.potion_thorns)
            GameRegistry.addRecipe(new ShapelessNBTOreRecipe(new ItemStack(ModItems.itemPotionThorns),PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER),Items.SPIDER_EYE,Items.POISONOUS_POTATO,new ItemStack(Items.DYE,1,3)));
        if (ModConfigConsumables.antidote)
            GameRegistry.addRecipe(new ShapelessNBTOreRecipe(new ItemStack(ModItems.itemAntidote), PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), "sap", Blocks.RED_MUSHROOM, Items.BEETROOT));
    }
}


text:
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}

{% block form_id %}edit_rack_status_form{% endblock %}
{% block form_action %}{% url 'horizon:infrastructure:resource_management:racks:edit_status' rack_id %}?action={{ action }}{% endblock %}

{% block modal_id %}edit_rack_status_modal{% endblock %}
{% block modal-header %}{% trans "Rack Action Confirmation" %}{% endblock %}

{% block modal-body %}

  {% trans "Are you sure?" %}
  <fieldset>
  {% include "horizon/common/_form_fields.html" %}
  </fieldset>

{% endblock %}

{% block modal-footer %}
  <input class="btn btn-primary" type="submit" value="{% trans "Yes" %}" />
  {% trans "Cancel" %}
{% endblock %}


text:
package org.terracotta.management.sequence;

/**
 * @author Mathieu Carbou
 */
public interface TimeSource {

  TimeSource SYSTEM = Defaults.SYSTEM_TIME_SOURCE;
  TimeSource BEST = Defaults.BEST_TIME_SOURCE;

  long getTimestamp();

  class Fixed implements TimeSource {

    private final long timestamp;

    public Fixed(long timestamp) {
      this.timestamp = timestamp;
    }

    @Override
    public long getTimestamp() {
      return timestamp;
    }
  }
}


text:
module Paymill
  class SubscriptionCount

    attr_accessor :active, :inactive

    def initialize( json )
      deserialize( json )
    end

    private
    def deserialize( json )
      json.each_pair do |key, value|
        instance_variable_set( "@#{key}", ( Integer( value ) rescue value ) )
      end
    end

  end
end


text:
package org.jasig.portal.tools.dbloader;

/**
 * Handles portal schema drop/create/update
 *
 * @author Eric Dalquist
 */
public interface ISchemaExport {

    /**
     * @return The name of the JPA persistence unit this bean functions against
     */
    public String getPersistenceUnitName();

    /**
     * Drop all objects, does not fail if drop statements fail to execute
     *
     * @param export If the database should have the SQL executed against it
     * @param outputFile Optional file to write out the SQL to.
     * @param append If the output file should be appended to or overwritten
     */
    public void drop(boolean export, String outputFile, boolean append);

    /**
     * Create all objects, fails if any create statement fails to execute
     *
     * @param export If the database should have the SQL executed against it
     * @param outputFile Optional file to write out the SQL to.
     * @param append If the output file should be appended to or overwritten
     */
    public void create(boolean export, String outputFile, boolean append);

    /**
     * Update all objects to match the current required schema, fails if any statement
     * fails to execute.
     *
     * @param export If the database should have the SQL executed against it
     * @param outputFile Optional file to write out the SQL to.
     * @param append If the output file should be appended to or overwritten
     */
    public void update(boolean export, String outputFile, boolean append);

}


text:
package transgenic.lauterbrunnen.lateral.example.cassandra.proto;

/**
 * Created by stumeikle on 16/07/20.
 */
public class MenuSelection {

    MenuItem selection;
    PricePerServingOption pricePerServingOptionSelection;
    //boolean itemDelivered;
}


text:
package org.ohdsi.webapi.pathway.dto;

import java.util.List;

public class PathwayPopulationResultsDTO {

    private List<PathwayCodeDTO> eventCodes;
    private List<TargetCohortPathwaysDTO> pathwayGroups;

    public PathwayPopulationResultsDTO(List<PathwayCodeDTO> eventCodes, List<TargetCohortPathwaysDTO> pathwayGroups) {

        this.eventCodes = eventCodes;
        this.pathwayGroups = pathwayGroups;
    }

    public List<PathwayCodeDTO> getEventCodes() {

        return eventCodes;
    }

    public void setEventCodes(List<PathwayCodeDTO> eventCodes) {

        this.eventCodes = eventCodes;
    }

    public List<TargetCohortPathwaysDTO> getPathwayGroups() {

        return pathwayGroups;
    }

    public void setPathwayGroups(List<TargetCohortPathwaysDTO> pathwayGroups) {

        this.pathwayGroups = pathwayGroups;
    }
}


text:
namespace rx
{

// Use the GL_COPY_READ_BUFFER binding when two buffers need to be bound simultaneously.
// GL_ELEMENT_ARRAY_BUFFER is supported on more versions but can modify the state of the currently
// bound VAO.  Two simultaneous buffer bindings are only needed for glCopyBufferSubData which also
// adds the GL_COPY_READ_BUFFER binding.
static const GLenum SourceBufferOperationTarget = GL_COPY_READ_BUFFER;

// Use the GL_ELEMENT_ARRAY_BUFFER binding for most operations since it's available on all
// supported GL versions and doesn't affect any current state when it changes.
static const GLenum DestBufferOperationTarget = GL_ARRAY_BUFFER;

BufferGL::BufferGL(const FunctionsGL *functions, StateManagerGL *stateManager)
    : BufferImpl(),
      mIsMapped(false),
      mMapOffset(0),
      mMapSize(0),
      mShadowBufferData(!CanMapBufferForRead(functions)),
      mShadowCopy(),
      mBufferSize(0),
      mFunctions(functions),
      mStateManager(stateManager),
      mBufferID(0)
{
    ASSERT(mFunctions);
    ASSERT(mStateManager);

    mFunctions->genBuffers(1, &mBufferID);
}

BufferGL::~BufferGL()
{
    mStateManager->deleteBuffer(mBufferID);
    mBufferID = 0;
}

gl::Error BufferGL::setData(const void* data, size_t size, GLenum usage)
{
    mStateManager->bindBuffer(DestBufferOperationTarget, mBufferID);
    mFunctions->bufferData(DestBufferOperationTarget, size, data, usage);

    if (mShadowBufferData)
    {
        if (!mShadowCopy.resize(size))
        {
            return gl::Error(GL_OUT_OF_MEMORY, "Failed to resize buffer data shadow copy.");
        }

        if (size > 0 && data != nullptr)
        {
            memcpy(mShadowCopy.data(), data, size);
        }
    }

    mBufferSize = size;

    return gl::Error(GL_NO_ERROR);
}

gl::Error BufferGL::setSubData(const void* data, size_t size, size_t offset)
{
    mStateManager->bindBuffer(DestBufferOperationTarget, mBufferID);
    mFunctions->bufferSubData(DestBufferOperationTarget, offset, size, data);

    if (mShadowBufferData && size > 0)
    {
        memcpy(mShadowCopy.data() + offset, data, size);
    }

    return gl::Error(GL_NO_ERROR);
}

gl::Error BufferGL::copySubData(BufferImpl* source, GLintptr sourceOffset, GLintptr destOffset, GLsizeiptr size)
{
    BufferGL *sourceGL = GetAs<BufferGL>(source);

    mStateManager->bindBuffer(DestBufferOperationTarget, mBufferID);
    mStateManager->bindBuffer(SourceBufferOperationTarget, sourceGL->getBufferID());

    mFunctions->copyBufferSubData(SourceBufferOperationTarget, DestBufferOperationTarget, sourceOffset, destOffset, size);

    if (mShadowBufferData && size > 0)
    {
        ASSERT(sourceGL->mShadowBufferData);
        memcpy(mShadowCopy.data() + destOffset, sourceGL->mShadowCopy.data() + sourceOffset, size);
    }

    return gl::Error(GL_NO_ERROR);
}

gl::Error BufferGL::map(GLenum access, GLvoid **mapPtr)
{
    if (mShadowBufferData)
    {
        *mapPtr = mShadowCopy.data();
    }
    else
    {
        mStateManager->bindBuffer(DestBufferOperationTarget, mBufferID);
        *mapPtr = mFunctions->mapBuffer(DestBufferOperationTarget, access);
    }

    mIsMapped = true;
    mMapOffset = 0;
    mMapSize   = mBufferSize;

    return gl::Error(GL_NO_ERROR);
}

gl::Error BufferGL::mapRange(size_t offset, size_t length, GLbitfield access, GLvoid **mapPtr)
{
    if (mShadowBufferData)
    {
        *mapPtr = mShadowCopy.data() + offset;
    }
    else
    {
        mStateManager->bindBuffer(DestBufferOperationTarget, mBufferID);
        *mapPtr = mFunctions->mapBufferRange(DestBufferOperationTarget, offset, length, access);
    }

    mIsMapped = true;
    mMapOffset = offset;
    mMapSize   = length;

    return gl::Error(GL_NO_ERROR);
}

gl::Error BufferGL::unmap(GLboolean *result)
{
    ASSERT(result);
    ASSERT(mIsMapped);

    if (mShadowBufferData)
    {
        mStateManager->bindBuffer(DestBufferOperationTarget, mBufferID);
        mFunctions->bufferSubData(DestBufferOperationTarget, mMapOffset, mMapSize,
                                  mShadowCopy.data() + mMapOffset);
        *result = GL_TRUE;
    }
    else
    {
        mStateManager->bindBuffer(DestBufferOperationTarget, mBufferID);
        *result = mFunctions->unmapBuffer(DestBufferOperationTarget);
    }

    mIsMapped = false;
    return gl::Error(GL_NO_ERROR);
}

gl::Error BufferGL::getIndexRange(GLenum type,
                                  size_t offset,
                                  size_t count,
                                  bool primitiveRestartEnabled,
                                  gl::IndexRange *outRange)
{
    ASSERT(!mIsMapped);

    if (mShadowBufferData)
    {
        *outRange = gl::ComputeIndexRange(type, mShadowCopy.data() + offset, count,
                                          primitiveRestartEnabled);
    }
    else
    {
        mStateManager->bindBuffer(DestBufferOperationTarget, mBufferID);

        const gl::Type &typeInfo  = gl::GetTypeInfo(type);
        const uint8_t *bufferData = MapBufferRangeWithFallback(
            mFunctions, DestBufferOperationTarget, offset, count * typeInfo.bytes, GL_MAP_READ_BIT);
        *outRange = gl::ComputeIndexRange(type, bufferData, count, primitiveRestartEnabled);
        mFunctions->unmapBuffer(DestBufferOperationTarget);
    }

    return gl::Error(GL_NO_ERROR);
}

GLuint BufferGL::getBufferID() const
{
    return mBufferID;
}

}


text:
<?php

require_once(__DIR__ . '/../../bootstrap/unit.php');
require_once(__DIR__ . '/../../unit/sfContextMock.class.php');

$t = new lime_test(10);

class myDatabase extends sfDatabase
{
  function connect (): void {}
  function shutdown (): void {}
}

$database = new myDatabase();

// parameter holder proxy
require_once(__DIR__ . '/../../unit/sfParameterHolderTest.class.php');
$pht = new sfParameterHolderProxyTest($t);
$pht->launchTests($database, 'parameter');


text:
*> \brief  ZHECON_ROOK estimates the reciprocal of the condition number fort HE matrices using factorization obtained with one of the bounded diagonal pivoting methods (max 2 interchanges)
*
*  =========== DOCUMENTATION ===========
*
* Online html documentation available at
*            http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download ZHECON_ROOK + dependencies
*>
*> [TGZ]
*>
*> [ZIP]
*>
*> [TXT]
*> \endhtmlonly
*
*  Definition:
*  ===========
*
*       SUBROUTINE ZHECON_ROOK( UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK,
*                               INFO )
*
*       .. Scalar Arguments ..
*       CHARACTER          UPLO
*       INTEGER            INFO, LDA, N
*       DOUBLE PRECISION   ANORM, RCOND
*       ..
*       .. Array Arguments ..
*       INTEGER            IPIV( * )
*       COMPLEX*16         A( LDA, * ), WORK( * )
*       ..
*
*
*> \par Purpose:
*  =============
*>
*> \verbatim
*>
*> ZHECON_ROOK estimates the reciprocal of the condition number of a complex
*> Hermitian matrix A using the factorization A = U*D*U**H or
*> A = L*D*L**H computed by CHETRF_ROOK.
*>
*> An estimate is obtained for norm(inv(A)), and the reciprocal of the
*> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
*> \endverbatim
*
*  Arguments:
*  ==========
*
*> \param[in] UPLO
*> \verbatim
*>          UPLO is CHARACTER*1
*>          Specifies whether the details of the factorization are stored
*>          as an upper or lower triangular matrix.
*>          = 'U':  Upper triangular, form is A = U*D*U**H;
*>          = 'L':  Lower triangular, form is A = L*D*L**H.
*> \endverbatim
*>
*> \param[in] N
*> \verbatim
*>          N is INTEGER
*>          The order of the matrix A.  N >= 0.
*> \endverbatim
*>
*> \param[in] A
*> \verbatim
*>          A is COMPLEX*16 array, dimension (LDA,N)
*>          The block diagonal matrix D and the multipliers used to
*>          obtain the factor U or L as computed by CHETRF_ROOK.
*> \endverbatim
*>
*> \param[in] LDA
*> \verbatim
*>          LDA is INTEGER
*>          The leading dimension of the array A.  LDA >= max(1,N).
*> \endverbatim
*>
*> \param[in] IPIV
*> \verbatim
*>          IPIV is INTEGER array, dimension (N)
*>          Details of the interchanges and the block structure of D
*>          as determined by CHETRF_ROOK.
*> \endverbatim
*>
*> \param[in] ANORM
*> \verbatim
*>          ANORM is DOUBLE PRECISION
*>          The 1-norm of the original matrix A.
*> \endverbatim
*>
*> \param[out] RCOND
*> \verbatim
*>          RCOND is DOUBLE PRECISION
*>          The reciprocal of the condition number of the matrix A,
*>          computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
*>          estimate of the 1-norm of inv(A) computed in this routine.
*> \endverbatim
*>
*> \param[out] WORK
*> \verbatim
*>          WORK is COMPLEX*16 array, dimension (2*N)
*> \endverbatim
*>
*> \param[out] INFO
*> \verbatim
*>          INFO is INTEGER
*>          = 0:  successful exit
*>          < 0:  if INFO = -i, the i-th argument had an illegal value
*> \endverbatim
*
*  Authors:
*  ========
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \date June 2017
*
*> \ingroup complex16HEcomputational
*
*> \par Contributors:
*  ==================
*> \verbatim
*>
*>  June 2017,  Igor Kozachenko,
*>                  Computer Science Division,
*>                  University of California, Berkeley
*>
*>  September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
*>                  School of Mathematics,
*>                  University of Manchester
*>
*> \endverbatim
*
*  =====================================================================
      SUBROUTINE ZHECON_ROOK( UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK,
     $                        INFO )
*
*  -- LAPACK computational routine (version 3.7.1) --
*  -- LAPACK is a software package provided by Univ. of Tennessee,    --
*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*     June 2017
*
*     .. Scalar Arguments ..
      CHARACTER          UPLO
      INTEGER            INFO, LDA, N
      DOUBLE PRECISION   ANORM, RCOND
*     ..
*     .. Array Arguments ..
      INTEGER            IPIV( * )
      COMPLEX*16         A( LDA, * ), WORK( * )
*     ..
*
*  =====================================================================
*
*     .. Parameters ..
      DOUBLE PRECISION   ONE, ZERO
      PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0 )
*     ..
*     .. Local Scalars ..
      LOGICAL            UPPER
      INTEGER            I, KASE
      DOUBLE PRECISION   AINVNM
*     ..
*     .. Local Arrays ..
      INTEGER            ISAVE( 3 )
*     ..
*     .. External Functions ..
      LOGICAL            LSAME
      EXTERNAL           LSAME
*     ..
*     .. External Subroutines ..
      EXTERNAL           ZHETRS_ROOK, ZLACN2, XERBLA
*     ..
*     .. Intrinsic Functions ..
      INTRINSIC          MAX
*     ..
*     .. Executable Statements ..
*
*     Test the input parameters.
*
      INFO = 0
      UPPER = LSAME( UPLO, 'U' )
      IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
         INFO = -1
      ELSE IF( N.LT.0 ) THEN
         INFO = -2
      ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
         INFO = -4
      ELSE IF( ANORM.LT.ZERO ) THEN
         INFO = -6
      END IF
      IF( INFO.NE.0 ) THEN
         CALL XERBLA( 'ZHECON_ROOK', -INFO )
         RETURN
      END IF
*
*     Quick return if possible
*
      RCOND = ZERO
      IF( N.EQ.0 ) THEN
         RCOND = ONE
         RETURN
      ELSE IF( ANORM.LE.ZERO ) THEN
         RETURN
      END IF
*
*     Check that the diagonal matrix D is nonsingular.
*
      IF( UPPER ) THEN
*
*        Upper triangular storage: examine D from bottom to top
*
         DO 10 I = N, 1, -1
            IF( IPIV( I ).GT.0 .AND. A( I, I ).EQ.ZERO )
     $         RETURN
   10    CONTINUE
      ELSE
*
*        Lower triangular storage: examine D from top to bottom.
*
         DO 20 I = 1, N
            IF( IPIV( I ).GT.0 .AND. A( I, I ).EQ.ZERO )
     $         RETURN
   20    CONTINUE
      END IF
*
*     Estimate the 1-norm of the inverse.
*
      KASE = 0
   30 CONTINUE
      CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
      IF( KASE.NE.0 ) THEN
*
*        Multiply by inv(L*D*L**H) or inv(U*D*U**H).
*
         CALL ZHETRS_ROOK( UPLO, N, 1, A, LDA, IPIV, WORK, N, INFO )
         GO TO 30
      END IF
*
*     Compute the estimate of the reciprocal condition number.
*
      IF( AINVNM.NE.ZERO )
     $   RCOND = ( ONE / AINVNM ) / ANORM
*
      RETURN
*
*     End of ZHECON_ROOK
*
      END


text:
package %w[
  default-jre-headless
  elasticsearch
]

template "/etc/elasticsearch/elasticsearch.yml" do
  source "elasticsearch.yml.erb"
  user "root"
  group "root"
  mode 0o644
  notifies :restart, "service[elasticsearch]"
end

service "elasticsearch" do
  action [:enable, :start]
  supports :status => true, :restart => true
end


text:
package dynaml

import (
	"strings"

	"github.com/mandelsoft/spiff/legacy/candiedyaml"
	"github.com/mandelsoft/spiff/yaml"
)

func func_as_json(arguments []interface{}, binding Binding) (interface{}, EvaluationInfo, bool) {
	info := DefaultInfo()

	if len(arguments) != 1 {
		return info.Error("asjson takes exactly one argument")
	}

	result, err := yaml.ValueToJSON(arguments[0])
	if err != nil {
		return info.Error("cannot jsonencode: %s", err)
	}
	return string(result), info, true
}

func func_as_yaml(arguments []interface{}, binding Binding) (interface{}, EvaluationInfo, bool) {
	info := DefaultInfo()

	if len(arguments) != 1 {
		return info.Error("asyaml takes exactly one argument")
	}

	result, err := candiedyaml.Marshal(arguments[0])
	if err != nil {
		return info.Error("cannot yamlencode: %s", err)
	}
	return string(result), info, true
}

func func_parse_yaml(arguments []interface{}, binding Binding) (interface{}, EvaluationInfo, bool) {
	info := DefaultInfo()

	if len(arguments) < 1 || len(arguments) > 2 {
		return info.Error("parse takes one or two arguments")
	}

	str, ok := arguments[0].(string)
	if !ok {
		return info.Error("first argument for parse must be a string")
	}

	mode := "import"
	if len(arguments) > 1 {
		mode, ok = arguments[1].(string)
		if !ok {
			return info.Error("second argument for parse must be a string")
		}
	}

	name := strings.Join(binding.Path(), ".")
	return ParseData(name, []byte(str), mode, binding)
}


text:
"""
Example for aiohttp.web basic async service
Uses a background timer to print to a logger
exposes an obvious REST endpoint
It's a template!

Made available under the MIT license as follows:

Copyright 2017 Brian Bulkowski brian@bulkowski.org

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""
import sys
py_ver = sys.version_info[0] + ( sys.version_info[1] / 10.0 )
if py_ver < 3.5:
    raise "Must be using Python 3.5 or better"

import threading
import time
import datetime
import os
from threading import Thread

import logging

import json
import argparse
import pprint

import asyncio
import textwrap

# things that led controllers want
# Control the LEDs of the Magnus Flora portal art display
import opc
from ledlib.helpers import usage, debugprint, verboseprint
from ledlib.ledmath import *
from ledlib.flower import LedPortal, LedAction
from ledlib import globalconfig
from ledlib import globaldata

from ledlib.colordefs import *
from ledlib import portalconfig                 # base/demo state of portal
from ledlib import patterns

from ledlib.opcwrap import start_opc, ledwrite
from ledlib import opcwrap

from aiohttp import web

# import local shared code
from ledlib.portal import Resonator, Portal

# A simple example of a timer function
async def timer(app):

    period = 5.0

    log = app['log']
    log.info(" started timer routine, running every %f seconds",period)

    while True:
        log.info(" hello says the timer! ")

        # read the portal file, for example?

        await asyncio.sleep(period)

#
# A number of debug / demo endpoints
# Note to self: you create a "Response" object, thn
# you manipulate it.
#

# this needs UTF8 because names might have utf8
async def portal_notification(request):

    log = request.app['log']
    ledPortal = request.app['ledportal']
    try:

        # log.debug(" received notification: %s of type %s",request.method, request.content_type)

        req_obj = await request.json()

        action, action_parm = req_obj.get("action", None)
        what_changed = req_obj.get("what_changed", None)
        status_str = req_obj.get("status", None)

#        log.warning(" action: %s on: %s",action, action_parm )
#        log.warning(" what changed: {0}".format(what_changed))

        # update the portal to the newest values
        status_obj = json.loads ( status_str )
        ledPortal.setStatusJsonSimple( status_obj, log )

        # take the action in question
        ledPortal.action(action,action_parm)

        r = web.Response(text="OK" , charset='utf-8')

    except Exception as e:
        log.warning(" exception while handing portal notification: %s ",str(ex))
        r = web.Response(text="FAIL")

    return r

async def hello(request):
    return web.Response(text="Welcome to Magnus Flora Led!")

async def health(request):
    return web.Response(text="OK")

# background tasks are covered near the bottom of this:
# http://aiohttp.readthedocs.io/en/stable/web.html
# Whatever tasks you create here will be executed and cancelled properly

async def start_background_tasks(app):
    app['timer_task'] = app.loop.create_task( timer(app) )

async def cleanup_background_tasks(app):
    app['log'].info(" cleaning up background tasks ")
    app['timer_task'].cancel()
    await app['timer_task']

def create_logger(args):
    # create a logging object and add it to the app object
    logger = logging.getLogger('MF_Led')
    logger.setLevel(args.debug)
    # create a file output
    fh = logging.FileHandler(args.log)
    fh.setLevel(args.debug)
    # create a console handler
    ch = logging.StreamHandler()
    ch.setLevel(args.debug)

    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    fh.setFormatter(formatter)
    ch.setFormatter(formatter)

    logger.addHandler(fh)
    logger.addHandler(ch)

    return logger

async def init(app, args, loop):

    app.router.add_get('/', hello)
    app.router.add_get('/health', health)

    app.router.add_post('/portal', portal_notification)

    # create a portal object and stash it, many will need it
    # app['portal'] = Portal(1, app['log'])

    # background tasks are covered near the bottom of this:
    # http://aiohttp.readthedocs.io/en/stable/web.html
    app.on_startup.append(start_background_tasks)
    app.on_cleanup.append(cleanup_background_tasks)

    return

def led_init(args, g_config, log):

    # command line flags
    globalconfig.debugflag = False
    globalconfig.verboseflag = False
    globalconfig.fastwake = False
    globalconfig.log = log

    globaldata.ledcontrol = start_opc()

    # Start a thread to asynchronously push the pixel array to the LEDs
    let_there_be_light = Thread(target=opcwrap.ledwriteloop)
    let_there_be_light.start()
    log.debug ("Let there be light!")

    # Wake up the whole portal - can take a long time unless fastwake
    # todo: this should be turned into something else but I want to see SOMETHING
    patterns.wake_up (0, globaldata.total_pixels, globaldata.basecolor)
    log.debug ("... and there was light.")

   # load the JSON file if it's around
    portal_json = ""

    try:
        with open(g_config["portalfile"]) as data_file:
            portal_json = json.load(data_file)
    except Exception as ex:
        log.warning(" initial json file %s does not exist or can't be parsed: %s", g_config["portalfile"], str(ex))
        pass

    # this is the key class that has worker threads and everything,
    # it'll get put onto the app soon
    ledportal = LedPortal(portal_json, log)

    log.info(" initial state, level is %d", ledportal.getLevel() )
    log.info(" initial state, resos are %s", str(ledportal.resonators) )
    for key, value in ledportal.ledResonators.items():
        log.debug(" initial state: LedReso %s is %s", key, value )

    # send the init action to all the petals
    # this is now ASYNC so you should see all work together
    a = LedAction('init')
    for r in Resonator.valid_positions:
        ledportal.ledResonators[r].do_action(a)

    globaldata.ledportal = ledportal

    # print ("writing ", finalcolor, " to the LEDs.")
    # pixels = [ finalcolor ] * numLEDs

    # ledwrite (ledcontrol, pixels)

    return

# Parse the command line options

parser = argparse.ArgumentParser(description="MagnusFlora Led", fromfile_prefix_chars='@')
parser.add_argument('--config', '-c', help="JSON file with configuration", default="config.json", type=str)
parser.add_argument('--log', help="location of the log file", default="led.log", type=str)
parser.add_argument('--debug', '-d', help=" debug level: CRITICAL ERROR WARNING INFO DEBUG", default="INFO", type=str)

parser.add_argument('--color', type=check_COLOR, help="Named color, can be overridden piecewise.")
parser.add_argument('--red', type=check_RGB)
parser.add_argument('--green', type=check_RGB)
parser.add_argument('--blue', type=check_RGB)
parser.add_argument('--north', dest='north', type=check_RESO, help="From 0 to 7, which reso is north?")

args = parser.parse_args()

# Load config.json
try:
    with open(args.config) as config_file:
        g_config = json.load(config_file)
        print(" g_config is: ",g_config)
except Exception as e:
    print(" UNABLE TO OPEN CONFIGURATION FILE ",args.config)
    print(e)
    sys.exit(0)

log = create_logger(args)
log.info('starting MagnusFlora Led: there will be %d cakes', 9 )

# init including the OPC server connectors & remapping
led_init(args, g_config, log)

print("starting MagnusFlora Led monitoring ",g_config["portalfile"]," on port ",g_config["led_port"])

# register all the async stuff
loop = asyncio.get_event_loop()

app = web.Application()
app['config'] = g_config
app['log'] = log
app['ledportal'] = globaldata.ledportal

loop.run_until_complete(init(app, args, loop))

# run the web server
web.run_app(app, port=g_config["led_port"])


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

<title>UrlPatternType</title>
<meta name="date" content="2015-06-30">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

xml.web.type

Class UrlPatternType

java.lang.Object

xml.web.type.StringValueType

xml.web.type.UrlPatternType

public class UrlPatternType
extends StringValueType

Used in xml.web.valueobject.FilterMapping to support a union with xml.web.type.ServletNameType

Constructor Summary

Constructors

Constructor and Description

UrlPatternType()

UrlPatternType(java.lang.String value)

Method Summary

Methods inherited from class xml.web.type.StringValueType

getValue, setValue, toString

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UrlPatternType

public UrlPatternType()

UrlPatternType

public UrlPatternType(java.lang.String value)

Parameters:

value -

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
namespace FirstRxExample
{
    public class StockTick
    {
        public string QuoteSymbol { get; set; }
        public decimal Price { get; set; }

        //other properties
    }
}


text:
<?php

namespace Cloudtek\DynamoDM\Mapping\Annotation;

use Doctrine\Common\Annotations\Annotation;

/**
 * Specifies an attribute to use for optimistic locking.
 *
 * @Annotation
 */
final class Version extends Annotation
{
    /**
     * @var bool
     */
    public $version = true;
}


text:
package services

import (
	"fmt"
	"strings"
	"time"

	"github.com/gravitational/teleport"

	"github.com/gravitational/trace"
	"github.com/jonboulle/clockwork"
	log "github.com/sirupsen/logrus"
	"github.com/vulcand/predicate"
)

// RuleContext specifies context passed to the
// rule processing matcher, and contains information
// about current session, e.g. current user
type RuleContext interface {
	// GetIdentifier returns identifier defined in a context
	GetIdentifier(fields []string) (interface{}, error)
	// String returns human friendly representation of a context
	String() string
}

// NewWhereParser returns standard parser for `where` section in access rules
func NewWhereParser(ctx RuleContext) (predicate.Parser, error) {
	return predicate.NewParser(predicate.Def{
		Operators: predicate.Operators{
			AND: predicate.And,
			OR:  predicate.Or,
		},
		Functions: map[string]interface{}{
			"equals":   predicate.Equals,
			"contains": predicate.Contains,
		},
		GetIdentifier: ctx.GetIdentifier,
		GetProperty:   predicate.GetStringMapValue,
	})
}

// NewActionsParser returns standard parser for 'actions' section in access rules
func NewActionsParser(ctx RuleContext) (predicate.Parser, error) {
	return predicate.NewParser(predicate.Def{
		Operators: predicate.Operators{},
		Functions: map[string]interface{}{
			"log": NewLogActionFn(ctx),
		},
		GetIdentifier: ctx.GetIdentifier,
		GetProperty:   predicate.GetStringMapValue,
	})
}

// NewLogActionFn creates logger functions
func NewLogActionFn(ctx RuleContext) interface{} {
	return (&LogAction{ctx: ctx}).Log
}

// LogAction represents action that will emit log entry
// when specified in the actions of a matched rule
type LogAction struct {
	ctx RuleContext
}

// Log logs with specified level and formatting string with arguments
func (l *LogAction) Log(level, format string, args ...interface{}) predicate.BoolPredicate {
	return func() bool {
		ilevel, err := log.ParseLevel(level)
		if err != nil {
			ilevel = log.DebugLevel
		}
		writer := log.StandardLogger().WriterLevel(ilevel)
		writer.Write([]byte(fmt.Sprintf(format, args...)))
		return true
	}
}

// Context is a default rule context used in teleport
type Context struct {
	// User is currently authenticated user
	User User
	// Resource is an optional resource, in case if the rule
	// checks access to the resource
	Resource Resource
}

// String returns user friendly representation of this context
func (ctx *Context) String() string {
	return fmt.Sprintf("user %v, resource: %v", ctx.User, ctx.Resource)
}

const (
	// UserIdentifier represents user registered identifier in the rules
	UserIdentifier = "user"
	// ResourceIdentifier represents resource registered identifer in the rules
	ResourceIdentifier = "resource"
)

// GetIdentifier returns identifier defined in a context
func (ctx *Context) GetIdentifier(fields []string) (interface{}, error) {
	switch fields[0] {
	case UserIdentifier:
		var user User
		if ctx.User == nil {
			user = emptyUser
		} else {
			user = ctx.User
		}
		return predicate.GetFieldByTag(user, teleport.JSON, fields[1:])
	case ResourceIdentifier:
		var resource Resource
		if ctx.Resource == nil {
			resource = emptyResource
		} else {
			resource = ctx.Resource
		}
		return predicate.GetFieldByTag(resource, "json", fields[1:])
	default:
		return nil, trace.NotFound("%v is not defined", strings.Join(fields, "."))
	}
}

// NewParserFn returns function that creates parser of 'where' section
// in access rules
type NewParserFn func(ctx RuleContext) (predicate.Parser, error)

var whereParser = NewWhereParser
var actionsParser = NewActionsParser

// GetWhereParserFn returns global function that creates where parsers
// this function is used in external tools to override and extend 'where' in rules
func GetWhereParserFn() NewParserFn {
	marshalerMutex.RLock()
	defer marshalerMutex.RUnlock()
	return whereParser
}

// SetWhereParserFn sets global function that creates where parsers
// this function is used in external tools to override and extend 'where' in rules
func SetWhereParserFn(fn NewParserFn) {
	marshalerMutex.Lock()
	defer marshalerMutex.Unlock()
	whereParser = fn
}

// GetActionsParserFn returns global function that creates where parsers
// this function is used in external tools to override and extend actions in rules
func GetActionsParserFn() NewParserFn {
	marshalerMutex.RLock()
	defer marshalerMutex.RUnlock()
	return actionsParser
}

// SetActionsParserFn sets global function that creates actions  parsers
// this function is used in external tools to override and extend actions in rules
func SetActionsParserFn(fn NewParserFn) {
	marshalerMutex.Lock()
	defer marshalerMutex.Unlock()
	actionsParser = fn
}

// emptyResource is used when no resource is specified
var emptyResource = &EmptyResource{}

// emptyUser is used when no user is specified
var emptyUser = &UserV2{}

// EmptyResource is used to represent a use case when no resource
// is specified in the rules matcher
type EmptyResource struct {
	// Kind is a resource kind
	Kind string `json:"kind"`
	// Version is a resource version
	Version string `json:"version"`
	// Metadata is Role metadata
	Metadata Metadata `json:"metadata"`
}

// SetExpiry sets expiry time for the object.
func (r *EmptyResource) SetExpiry(expires time.Time) {
	r.Metadata.SetExpiry(expires)
}

// Expiry returns the expiry time for the object.
func (r *EmptyResource) Expiry() time.Time {
	return r.Metadata.Expiry()
}

// SetTTL sets TTL header using realtime clock.
func (r *EmptyResource) SetTTL(clock clockwork.Clock, ttl time.Duration) {
	r.Metadata.SetTTL(clock, ttl)
}

// SetName sets the role name and is a shortcut for SetMetadata().Name.
func (r *EmptyResource) SetName(s string) {
	r.Metadata.Name = s
}

// GetName gets the role name and is a shortcut for GetMetadata().Name.
func (r *EmptyResource) GetName() string {
	return r.Metadata.Name
}

// GetMetadata returns role metadata.
func (r *EmptyResource) GetMetadata() Metadata {
	return r.Metadata
}


text:
var express         = require('express'),
    debug           = require('debug')('gu-backup'),
    router          = express.Router(),
    Promise         = require('bluebird'),

    filesfolders    = require('./filesfolders');

var createScriptRunning, createScriptLog,
    restoreScriptRunning, restoreScriptLog,
    deleteScriptRunning, deleteScriptLog;

/**
 * Router endpoint for 'deployment', initiating the deployment of all backup scripts
 * to Kudu's webjob api.
 * @param  {Express request} req
 * @param  {Express response} res
 * @return {Express response JSON} - JSON describing success or failure of deployment
 */
router.get('/deploy', function (req, res) {
    debug('Deploying Backup Scripts');

    var create = filesfolders.uploadWebjob('./public/powershell/createBackup.ps1', 'createBackup.ps1'),
        remove = filesfolders.uploadWebjob('./public/powershell/removeBackup.ps1', 'removeBackup.ps1'),
        restore = filesfolders.uploadWebjob('./public/powershell/restoreBackup.ps1', 'restoreBackup.ps1');

    return Promise.all([create, remove, restore])
    .then(function (results) {
        debug('Upload done, result: ' + results);
        return res.json({ status: 'Scripts deployed' });
    }).catch(function (error) {
        debug('Scripts deployment error: ', error);
        return res.json({ error: error });
    });
});

/**
 * Router endpoint triggering the 'create backup' webjob, which will
 * instruct Kudu to make a backup of the page (essentially just copying files)
 * @param  {Express request} req
 * @param  {Express response} res
 * @return {Express response JSON} - JSON describing success or failure
 */
router.post('/create', function (req, res) {
    debug('Triggering Create Backup Webjob');

    return filesfolders.triggerWebjob('createBackup.ps1')
    .then(function (result) {
        debug('Trigger successful, result: ' + result);
        return res.json(result);
    });
});

/**
 * Router endpoint triggering the 'restore backup' webjob, which will
 * instruct Kudu to restore a made backup (essentially just copying back files)
 * @param  {Express request} req
 * @param  {Express response} res
 * @return {Express response JSON} - JSON describing success or failure
 */
router.post('/restore', function (req, res) {
    debug('Triggering Restore Backup Webjob');

    return filesfolders.triggerWebjob('restoreBackup.ps1')
    .then(function (result) {
        debug('Trigger successful, result: ' + result);
        return res.json(result);
    });
});

/**
 * Router endpoint triggering the 'delete backup' webjob, which will instruct Kudu
 * to delete a previously made backup
 * @param  {Express request} req
 * @param  {Express response} res
 * @return {Express response JSON} - JSON describing success or failure
 */
router.post('/delete', function (req, res) {
    debug('Triggering Delete Backup Webjob');

    return filesfolders.triggerWebjob('removeBackup.ps1')
    .then(function (result) {
        debug('Trigger successful, result: ' + result);
        return res.json(result);
    });
});

/**
 * Router endpoint returning the current status and log of the 'create backup'
 * script
 * @param  {Express request} req
 * @param  {Express response} res
 * @return {Express response text/plain} - Plain text of the log
 */
router.get('/create', function (req, res) {
    debug('Getting create script info');

    var responseBody;

    if (!createScriptRunning && !createScriptLog) {
        return filesfolders.getWebjobInfo('createBackup.ps1')
        .then(function (result) {
            debug(result);

            if (result && result.statusCode === 200) {
                responseBody = JSON.parse(result.body);
                createScriptLog = (responseBody.latest_run && responseBody.latest_run.output_url) ? responseBody.latest_run.output_url : '';
                createScriptRunning = (createScriptLog) ? true : false;
            }

            debug(createScriptLog);
            return createScriptLog;
        }).then(function () {
            return filesfolders.getWebjobLog(createScriptLog)
            .then(function (logcontent) {
                debug('We have content! Size: ' + logcontent.length);
                res.set('Content-Type', 'text/plain');
                return res.send(logcontent);
            });
        });
    } else {
        return filesfolders.getWebjobLog(createScriptLog)
        .then(function (logcontent) {
            res.set('Content-Type', 'text/plain');
            return res.send(logcontent);
        });
    }
});

/**
 * Router endpoint returning the current status and log of the 'restore backup'
 * script
 * @param  {Express request} req
 * @param  {Express response} res
 * @return {Express response text/plain} - Plain text of the log
 */
router.get('/restore', function (req, res) {
    debug('Getting restore script info');

    var responseBody;

    if (!restoreScriptRunning && !restoreScriptLog) {
        return filesfolders.getWebjobInfo('restoreBackup.ps1')
        .then(function (result) {
            debug(result);

            if (result && result.statusCode === 200) {
                responseBody = JSON.parse(result.body);
                restoreScriptLog = (responseBody.latest_run && responseBody.latest_run.output_url) ? responseBody.latest_run.output_url : '';
                restoreScriptRunning = (restoreScriptLog) ? true : false;
            }

            debug(restoreScriptLog);
            return restoreScriptLog;
        }).then(function () {
            return filesfolders.getWebjobLog(restoreScriptLog)
            .then(function (logcontent) {
                debug('We have content! Size: ' + logcontent.length);
                res.set('Content-Type', 'text/plain');
                return res.send(logcontent);
            });
        });
    } else {
        return filesfolders.getWebjobLog(restoreScriptLog)
        .then(function (logcontent) {
            res.set('Content-Type', 'text/plain');
            return res.send(logcontent);
        });
    }
});

/**
 * Router endpoint returning the current status and log of the 'delete backup'
 * script
 * @param  {Express request} req
 * @param  {Express response} res
 * @return {Express response text/plain} - Plain text of the log
 */
router.get('/delete', function (req, res) {
    debug('Getting create script info');

    var responseBody;

    if (!deleteScriptRunning && !deleteScriptLog) {
        return filesfolders.getWebjobInfo('removeBackup.ps1')
        .then(function (result) {
            debug(result);

            if (result && result.statusCode === 200) {
                responseBody = JSON.parse(result.body);
                deleteScriptLog = (responseBody.latest_run && responseBody.latest_run.output_url) ? responseBody.latest_run.output_url : '';
                deleteScriptRunning = (deleteScriptLog) ? true : false;
            }

            debug(deleteScriptLog);
            return deleteScriptLog;
        }).then(function () {
            return filesfolders.getWebjobLog(deleteScriptLog)
            .then(function (logcontent) {
                debug('We have content! Size: ' + logcontent.length);
                res.set('Content-Type', 'text/plain');
                return res.send(logcontent);
            });
        });
    } else {
        return filesfolders.getWebjobLog(deleteScriptLog)
        .then(function (logcontent) {
            res.set('Content-Type', 'text/plain');
            return res.send(logcontent);
        });
    }
});

module.exports = router;