text:
set -o errexit
#set -o verbose
#set -o xtrace
set -o nounset

SN_NETWORK_ACCOUNT_PASSWORD=${SN_NETWORK_ACCOUNT_PASSWORD:=no_password_set}
export SN_NETWORK_ACCOUNT_PASSWORD

# Determines if system is running on Windows Subsystem for Linux and references as .exe
WSL_CHECK=$(uname -r | sed -n 's/.*\( *Microsoft *\).*/\1/p')
if [ "$WSL_CHECK" == "Microsoft" ]
then
    dockercompose=docker-compose.exe
    docker=docker.exe
else
    dockercompose=docker-compose
    docker=docker
fi

case "$1" in

# Deploys the Smart Contracts in agent/sn_agent/network/ethereum/core to the specified network via a
# dockerized version of the Truffle environment and copies the compiled code and deployed addresses to
# the docker/agent/data/dev directory where the Agent's web3.py network class can find it.
deploy-contracts)
    DOCKERNET=$(docker network ls | grep dockernet | awk '{print $2}')
    if [ "$DOCKERNET" != "dockernet" ]
    then
        echo "Starting docker network: dockernet"
        $docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 dockernet
    else
        echo "Docker network 'dockernet' already running."
    fi
    echo ""
    HOST_OS=$(uname)
    echo "HOST_OS = '$HOST_OS'"
    if [ "$HOST_OS" == "Darwin" ]
    then
        echo "Using Truffle network - docker_host_mac"
        TRUFFLE_NETWORK=docker_host_mac
    else
        echo "Using Truffle network - docker_host"
        TRUFFLE_NETWORK=docker_host
    fi
    export TRUFFLE_NETWORK
    echo "TRUFFLE_NETWORK = '$TRUFFLE_NETWORK'"
    $dockercompose -f docker/docker-compose.dev.yml create --build truffle
    $dockercompose -f docker/docker-compose.dev.yml run --service-ports truffle
    ;;

# The main developer command for testing and bringing up a developer agent
dev)
    $dockercompose -f docker/docker-compose.dev.yml create --build dev
    $dockercompose -f docker/docker-compose.dev.yml run --service-ports dev ./agent.sh run
    ;;

# Rebuilds the dev image in case of stale docker caches
dev-force-build)
    $dockercompose -f docker/docker-compose.dev.yml create --build --force-recreate dev
    ;;

# Builds the image only but does not run it
dev-build)
    $dockercompose -f docker/docker-compose.dev.yml create --build dev
    ;;

# Just run the built image.
dev-run)
    $dockercompose -f docker/docker-compose.dev.yml run --service-ports dev ./agent.sh run
    ;;

# Take down all the dev containers - defined in docker/docker-compose-dev.yml
dev-down)
    $dockercompose -f docker/docker-compose.dev.yml down --remove-orphans
    ;;

# ABC - Alice, Bob and Charlie (she's a girl)

# Brings up the Alice server to demonstrate many agents interacting.
alice)
    $dockercompose -f docker/docker-compose.abc.yml create --build alice
    $dockercompose -f docker/docker-compose.abc.yml run --service-ports alice ./agent.sh run
    ;;

# Brings up Bob
bob)
    $dockercompose -f docker/docker-compose.abc.yml create --build bob
    $dockercompose -f docker/docker-compose.abc.yml run --service-ports bob ./agent.sh run
    ;;

# Brings up Charlie - she likes to be last...
charlie)
    $dockercompose -f docker/docker-compose.abc.yml create --build charlie
    $dockercompose -f docker/docker-compose.abc.yml run --service-ports charlie ./agent.sh run
    ;;

 demo)
    $dockercompose -f docker/docker-compose.demo.yml create --build --force-recreate demo
    $dockercompose -f docker/docker-compose.demo.yml run --service-ports demo ./agent.sh run
    ;;

demo-down)
    $dockercompose -f docker/docker-compose.demo.yml down --remove-orphans
    ;;

# Experimental code - don't count on this staying around

opendht)
    $dockercompose -f docker/docker-compose.yml create --build --force-recreate opendht
    $dockercompose -f docker/docker-compose.yml run --service-ports opendht
    ;;

geth)
    $dockercompose -f docker/docker-compose.yml create --build --force-recreate geth
    $dockercompose -f docker/docker-compose.yml run --service-ports geth $2
    ;;

solc)
    $dockercompose -f docker/docker-compose.yml run --service-ports geth solc --help
    ;;

parity)
    $dockercompose -f docker-compose.dev.yml create --build --force-recreate parity
    $dockercompose -f docker-compose.dev.yml run --service-ports parity $2
    ;;

vault)
    $dockercompose -f docker/docker-compose.yml create --build --force-recreate vault
    $dockercompose -f docker/docker-compose.yml run --service-ports vault $2
    ;;

ipfs)
    $dockercompose -f docker/docker-compose.yml run --service-ports ipfs daemon
    ;;

init)
    #https://www.vaultproject.io/intro/getting-started/deploy.html#initializing-the-vault+
    ;;

# Support

# Builds the docs
agent-docs)
    $dockercompose -f docker/docker-compose.yml create --build test
    $dockercompose -f docker/docker-compose.yml run test ./agent.sh docs
    ;;

# Runs the test suite
agent-test)
    $dockercompose -f docker/docker-compose.yml start testrpc
    $dockercompose -f docker/docker-compose.yml create --build test
    $dockercompose -f docker/docker-compose.yml run test ./agent.sh test
    ;;

# Brings up the OpenCog relationship extracter node
relex)
    $dockercompose -f docker/docker-compose.dev.yml  run --service-ports relex
    ;;

# A test Ethereum client RPC server (ganache-cli) docker image
testrpc)
    $dockercompose -f docker/docker-compose.yml create --build testrpc
    $dockercompose -f docker/docker-compose.yml run --service-ports testrpc
    ;;

# Cleans recent docker images... useful when working on docker-compose and Dockerfiles
clean)
    $dockercompose -f docker/docker-compose.yml down --rmi all --remove-orphans
    ;;

# Clears the entire docker cache - generally only necessary when doing work with Dockerfiles themselves
hard-clean)
    $docker image prune
    $dockercompose -f docker/docker-compose.dev.yml down --rmi all --remove-orphans
    $dockercompose -f docker/docker-compose.yml down --rmi all --remove-orphans
    $docker kill `docker ps -q` || true
    $docker rm `docker ps -a -q`
    $docker rmi `docker images -q`
    $docker volume rm `docker volume ls -qf dangling=true`
    ;;

create-web-cookie)
    $dockercompose -f docker/docker-compose.yml run agent-web-cookie
    ;;

gen-ssl)
    cd agent
    openssl req -nodes -new -x509  -keyout server.key -out server.crt -subj '/CN=localhost'
    ;;

*) echo "Command '$1' not found - No operation specified"
    exit 0;
    ;;

esac


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

<title>TestStaticAPI</title>
<meta name="date" content="2017-05-18">
<link rel="stylesheet" type="text/css" href="../../javadoc-stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

brown.tracingplane

Class TestStaticAPI

java.lang.Object

brown.tracingplane.TestStaticAPI

public class TestStaticAPI
extends java.lang.Object

Constructor Summary

Constructors

Constructor and Description

TestStaticAPI()

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

void
testDefaultBaggageProviderIsNoOp()

void
testNoOpBaggageProviderIsNotWrapped()

void
testStaticAPICallsIgnoreInvalidContext()

void
testStaticAPICallsInvokeDefaultProvider()

void
testStaticAPICallsInvokeProvider()

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TestStaticAPI

public TestStaticAPI()

Method Detail

testDefaultBaggageProviderIsNoOp

public void testDefaultBaggageProviderIsNoOp()

testNoOpBaggageProviderIsNotWrapped

public void testNoOpBaggageProviderIsNotWrapped()

testStaticAPICallsInvokeDefaultProvider

public void testStaticAPICallsInvokeDefaultProvider()

testStaticAPICallsIgnoreInvalidContext

public void testStaticAPICallsIgnoreInvalidContext()

testStaticAPICallsInvokeProvider

public void testStaticAPICallsInvokeProvider()

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

redpajama_set_name: RedPajamaGithub


text:
package org.unix4j.unix;

import org.junit.Test;
import org.unix4j.Unix4j;
import org.unix4j.context.DefaultExecutionContext;
import org.unix4j.context.ExecutionContext;
import org.unix4j.context.ExecutionContextFactory;
import org.unix4j.unix.CommandFileTest.MatchMode;

/**
 * Unit test for {@code Sort} reading the input from test files.
 */
public class LsFileTest {

	private static final class Config implements ExecutionContextFactory {
		private final CommandFileTest tester;
		public Config(CommandFileTest tester) {
			this.tester = tester;
		}
		@Override
		public ExecutionContext createExecutionContext() {
			final DefaultExecutionContext context = new DefaultExecutionContext();
			context.setCurrentDirectory(tester.getInputFile());
			return context;
		}
	};

	@Test
	public void ls() {
		final CommandFileTest tester = new CommandFileTest(this.getClass());
		final Config config = new Config(tester);
		tester.runAndAssert(Unix4j.use(config).ls());
	}
	@Test
	public void ls_a() {
		final CommandFileTest tester = new CommandFileTest(this.getClass());
		final Config config = new Config(tester);
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.a));
	}
	@Test
	public void ls_ar() {
		final CommandFileTest tester = new CommandFileTest(this.getClass());
		final Config config = new Config(tester);
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.a.r));
	}
	@Test
	public void ls_la() {
		final CommandFileTest tester = new CommandFileTest(this.getClass(), MatchMode.Regex);
		final Config config = new Config(tester);
        Unix4j.use(config).ls(Ls.Options.l.a).toStdOut();
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.l.a));
	}
	@Test
	public void ls_la_TotalLine() {
		final CommandFileTest tester = new CommandFileTest(this.getClass());
		final Config config = new Config(tester);
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.l.a).head(1));
	}
	@Test
	public void ls_la_LineCount() {
		final CommandFileTest tester = new CommandFileTest(this.getClass());
		final Config config = new Config(tester);
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.l.a).wc(Wc.Options.l));
	}
	@Test
	public void ls_la_LastLine() {
		final CommandFileTest tester = new CommandFileTest(this.getClass());
		final Config config = new Config(tester);
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.l.a).tail(1).grep(Grep.Options.c, "\\smydir$"));//last line should end with "mydir" file
	}
	@Test
	public void ls_lar() {
		final CommandFileTest tester = new CommandFileTest(this.getClass(), MatchMode.Regex);
		final Config config = new Config(tester);
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.l.a.r));
	}
	@Test
	public void ls_lar_LastLine() {
		final CommandFileTest tester = new CommandFileTest(this.getClass());
		final Config config = new Config(tester);
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.l.a.r).tail(1).grep(Grep.Options.c, "\\s\\.$"));//last line should end with "." file
	}
	@Test
	public void ls_lah() {
		final CommandFileTest tester = new CommandFileTest(this.getClass(), MatchMode.Regex);
		final Config config = new Config(tester);
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.l.a.h));
	}
	@Test
	public void ls_lah_TotalLine() {
		final CommandFileTest tester = new CommandFileTest(this.getClass());
		final Config config = new Config(tester);
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.l.a.h).head(1));
	}

	@Test
	public void ls_R() {
		final CommandFileTest tester = new CommandFileTest(this.getClass());
		final Config config = new Config(tester);
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.R));
	}
	@Test
	public void ls_Ra() {
		final CommandFileTest tester = new CommandFileTest(this.getClass());
		final Config config = new Config(tester);
		Unix4j.use(config).ls(Ls.Options.R.a).toStdOut();
		tester.runAndAssert(Unix4j.use(config).ls(Ls.Options.R.a));
	}
}


text:
using System.Collections.Generic;

namespace RulesEngine.AspNetCore
{
    public interface ITypeRulesConfiguration<T>
        where T : class
    {
        List<RuleConfiguration<T>> Rules { get; }
    }
}


text:
package galaxyspace.systems.SolarSystem.planets.overworld.gui;

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

import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;

import galaxyspace.GalaxySpace;
import galaxyspace.core.GSItems;
import galaxyspace.core.network.packet.GSPacketSimple;
import galaxyspace.core.network.packet.GSPacketSimple.GSEnumSimplePacket;
import galaxyspace.core.prefab.inventory.SlotUpgrades;
import galaxyspace.core.util.GSUtils;
import galaxyspace.systems.SolarSystem.planets.overworld.inventory.ContainerGravitationModule;
import galaxyspace.systems.SolarSystem.planets.overworld.tile.TileEntityGravitationModule;
import micdoodle8.mods.galacticraft.api.vector.BlockVec3;
import micdoodle8.mods.galacticraft.core.GalacticraftCore;
import micdoodle8.mods.galacticraft.core.client.gui.container.GuiContainerGC;
import micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementCheckbox;
import micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementCheckbox.ICheckBoxCallback;
import micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion;
import micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementTextBox;
import micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementTextBox.ITextBoxCallback;
import micdoodle8.mods.galacticraft.core.energy.EnergyDisplayHelper;
import micdoodle8.mods.galacticraft.core.network.PacketSimple;
import micdoodle8.mods.galacticraft.core.network.PacketSimple.EnumSimplePacket;
import micdoodle8.mods.galacticraft.core.util.ColorUtil;
import micdoodle8.mods.galacticraft.core.util.EnumColor;
import micdoodle8.mods.galacticraft.core.util.GCCoreUtil;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class GuiGravitationModule extends GuiContainerGC implements ITextBoxCallback, ICheckBoxCallback
{
    private static final ResourceLocation electricFurnaceTexture = new ResourceLocation(GalaxySpace.ASSET_PREFIX, "textures/gui/base_gui.png");
    private GuiElementInfoRegion electricInfoRegion = new GuiElementInfoRegion(0, 0, 56, 9, null, 0, 0, this);

    private GuiElementCheckbox checkboxRenderEffects;

    private TileEntityGravitationModule tileEntity;

    protected List<GuiElementTextBox> inputFieldList = new ArrayList();
    private GuiButton disableButton;
    private GuiElementTextBox strengthField;
    public final int BTN_ENABLE = 6;
    public final int FIELD_STRENGTH= 10;

    private int radius;

    public GuiGravitationModule(InventoryPlayer par1InventoryPlayer, TileEntityGravitationModule tileEntity)
    {
        super(new ContainerGravitationModule(par1InventoryPlayer, tileEntity));
        this.tileEntity = tileEntity;
        this.xSize = 190;
        this.ySize = 204;

        radius = tileEntity.getGravityRadius();
    }

    @Override
    public void initGui()
    {
        super.initGui();
        this.electricInfoRegion.tooltipStrings = new ArrayList<String>();
        this.electricInfoRegion.xPosition = (this.width - this.xSize) / 2 + 17;
        this.electricInfoRegion.yPosition = (this.height - this.ySize) / 2 + 102;
        this.electricInfoRegion.parentWidth = this.width;
        this.electricInfoRegion.parentHeight = this.height;
        this.infoRegions.add(this.electricInfoRegion);
        List<String> desc = new ArrayList<String>();
        desc.add(GCCoreUtil.translate("gui.battery_slot.desc.0"));
        desc.add(GCCoreUtil.translate("gui.battery_slot.desc.1"));
        this.infoRegions.add(new GuiElementInfoRegion((this.width - this.xSize) / 2 + 76, (this.height - this.ySize) / 2 + 98, 18, 18, desc, this.width, this.height, this));
   /*
        desc = new ArrayList<String>();
        desc.add(GCCoreUtil.translate("gui.gravitation_module_stabilisation_1.desc"));
        desc.add(GCCoreUtil.translate("gui.gravitation_module_stabilisation_2.desc"));
        this.infoRegions.add(new GuiElementInfoRegion((this.width - this.xSize) / 2, (this.height - this.ySize) / 2 + 12, 10, 10, desc, this.width, this.height, this));
   */
        this.buttonList.clear();
        final int var5 = (this.width - this.xSize) / 2;
        final int var6 = (this.height - this.ySize) / 2;

        disableButton = new GuiButton(BTN_ENABLE, var5 + 110, var6 + 63, 50, 20, GCCoreUtil.translate("gui.button.disable.name"));

        this.checkboxRenderEffects = new GuiElementCheckbox(0, this, var5 + 10, var6 + 65, EnumColor.WHITE + GCCoreUtil.translate("gui.message.effect_visible.name"));
        this.buttonList.add(this.checkboxRenderEffects);
        this.buttonList.add(disableButton);

        this.strengthField = new GuiElementTextBox(FIELD_STRENGTH, this, var5 + 110, var6 + 41, 38, 18, "0", true, 2, true);
        this.addInputField(this.strengthField);

        desc = new ArrayList<String>();
        desc.add(EnumColor.BRIGHT_GREEN + GCCoreUtil.translate("gui.available_modules.desc"));
        desc.add("");
        desc.add("- " + new ItemStack(GSItems.UPGRADES, 1, 0).getDisplayName());
        desc.add("- " + new ItemStack(GSItems.UPGRADES, 1, 1).getDisplayName());
        desc.add("- " + new ItemStack(GSItems.UPGRADES, 1, 3).getDisplayName());
        this.infoRegions.add(new GuiElementInfoRegion((this.width + this.xSize) / 2 - 14, (this.height - this.ySize) / 2 + 16, 18, 21 * 4, desc, this.width, this.height, this));

    }

    /**
     * Draw the foreground layer for the GuiContainer (everything in front of
     * the items)
     */
    @Override
    protected void drawGuiContainerForegroundLayer(int par1, int par2)
    {
    	this.fontRenderer.drawString(EnumColor.WHITE + this.tileEntity.getName(), 86 - (this.fontRenderer.getStringWidth(this.tileEntity.getName()) / 2), 1, 4210752);
    	this.fontRenderer.drawString(EnumColor.WHITE + GCCoreUtil.translate("gui.gravity.radius.name"), 11, 46, 4210752);

        String displayText = "";

        if(tileEntity.getDisabled(0)) {

        	displayText = EnumColor.RED + GCCoreUtil.translate("gui.status.disabled.name");
            disableButton.displayString = GCCoreUtil.translate("gui.button.enable.name");
        } else {

        	if (this.tileEntity.hasEnoughEnergyToRun)
            {
                displayText = EnumColor.BRIGHT_GREEN + GCCoreUtil.translate("gui.status.running.name");
            }
        	else
        	{
        		displayText = EnumColor.ORANGE + GCCoreUtil.translate("gui.status.idle.name");
        	}
            disableButton.displayString = GCCoreUtil.translate("gui.button.disable.name");

        }

        this.fontRenderer.drawString(EnumColor.WHITE + GCCoreUtil.translate("gui.message.status.name") + ": " + displayText, 100, 104, 4210752);
        this.fontRenderer.drawString(EnumColor.WHITE + GCCoreUtil.translate("container.inventory"), 13, this.ySize - 88, 4210752);

        for(int i = 0; i < 4; i++)
        	if(this.tileEntity.getStackInSlot(i+1).isItemEqual(new ItemStack(GSItems.UPGRADES, 1, 1))) {
        		this.fontRenderer.drawString(EnumColor.BRIGHT_GREEN + GCCoreUtil.translate("gui.message.active_pressure_shield.name"), 3, 24, 4210752);
        		break;
        	}

        this.strengthField.text = tileEntity.getGravityRadius() + "";
       // this.fontRenderer.drawString(EnumColor.BRIGHT_GREEN + "" + tileEntity.getGravityRadius() , 30, 5, 0xFFFFFF);
    }

    /**
     * Draw the background layer for the GuiContainer (everything behind the
     * items)
     */
    @Override
    protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
    {
        this.mc.renderEngine.bindTexture(GuiGravitationModule.electricFurnaceTexture);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

        int containerWidth = (this.width - this.xSize) / 2;
        int containerHeight = (this.height - this.ySize) / 2;
        this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize);
        int scale;

        List<String> electricityDesc = new ArrayList<String>();
        electricityDesc.add(GCCoreUtil.translate("gui.energy_storage.desc.0"));
        EnergyDisplayHelper.getEnergyDisplayTooltip(this.tileEntity.getEnergyStoredGC(), this.tileEntity.getMaxEnergyStoredGC(), electricityDesc);
        this.electricInfoRegion.tooltipStrings = electricityDesc;
/*
        if (this.tileEntity.processTicks > 0)
        {
            scale = (int) ((double) this.tileEntity.processTicks / (double) this.tileEntity.processTimeRequired * 54);
            this.drawTexturedModalRect(containerWidth + 59, containerHeight + 21, 176, 38, 69 - scale, 31);
        }
*/
        //Info
        //this.drawTexturedModalRect(containerWidth, containerHeight + 12, 215, 7, 10, 10);
        //Energy
        this.drawTexturedModalRect(containerWidth + 16, containerHeight + 102, 192, 47, 56, 9);
        this.drawTexturedModalRect(containerWidth + 4, containerHeight + 102, 192, 56, 11, 10);
        if (this.tileEntity.getEnergyStoredGC() > 0)
        {
            scale = this.tileEntity.getScaledElecticalLevel(55);
            this.drawTexturedModalRect(containerWidth + 116 - 99, containerHeight + 103, 192, 0, scale, 7);
            this.drawTexturedModalRect(containerWidth + 3, containerHeight + 102, 192, 7, 11, 10);
        }

        this.checkboxRenderEffects.isSelected = this.tileEntity.shouldRenderEffects;

        // Slots
        for(int i = 0; i < this.inventorySlots.inventorySlots.size(); i++)
        {
	        int x = this.inventorySlots.getSlot(i).xPos;
	        int y = this.inventorySlots.getSlot(i).yPos;

	       /* if(!(this.inventorySlots.getSlot(i).inventory instanceof InventoryPlayer))
	        {*/

		        GL11.glPushMatrix();
		        switch(i)
		        {
		        	case 0:
		        	{
		        		this.drawTexturedModalRect(containerWidth + x - 2, containerHeight + y - 2, 213, 26, 20, 21);
		        		break;
		        	}
		        	default:
		        	{
		        		this.drawTexturedModalRect(containerWidth + x - 2, containerHeight + y - 2, 192, 26, 20, 21);
		        		break;
		        	}
		        }

		        if(this.inventorySlots.getSlot(i) instanceof SlotUpgrades)
		        {
	        		GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
	        		this.drawTexturedModalRect(containerWidth + x - 2, containerHeight + y - 2, 213, 175, 20, 20);
	        	}

		        GL11.glPopMatrix();
	        //}
        }

        if(GalaxySpace.debug) GSUtils.renderDebugGui(this, containerWidth, containerHeight);
     }

	@Override
	public void onSelectionChanged(GuiElementCheckbox checkbox, boolean newSelected) {
		this.tileEntity.shouldRenderEffects = newSelected;
        GalaxySpace.packetPipeline.sendToServer(new GSPacketSimple(GSEnumSimplePacket.S_ON_ADVANCED_GUI_CLICKED_INT, GCCoreUtil.getDimensionID(this.mc.world),new Object[] { 6, this.tileEntity.getPos().getX(), this.tileEntity.getPos().getY(), this.tileEntity.getPos().getZ(), newSelected ? 1 : 0 }));

	}

	protected void sendDataToServer()
    {
        BlockVec3 pos = new BlockVec3(tileEntity);
        int actualStrength = radius;

        if(actualStrength > 16) actualStrength = 16;

        GalaxySpace.packetPipeline.sendToServer(new GSPacketSimple(GSEnumSimplePacket.S_GRAVITY_RADIUS, GCCoreUtil.getDimensionID(this.mc.world), pos, actualStrength));
        tileEntity.setGravityRadius(actualStrength);
    }

	@Override
    protected void actionPerformed(GuiButton btn)
    {
        switch(btn.id) {
        case BTN_ENABLE:
            GalacticraftCore.packetPipeline.sendToServer(new PacketSimple(EnumSimplePacket.S_UPDATE_DISABLEABLE_BUTTON, GCCoreUtil.getDimensionID(this.mc.world), new Object[] { this.tileEntity.getPos(), 0 }));
            break;
        }
    }

	@Override
	protected void keyTyped(char keyChar, int keyID) throws IOException {
		if (keyID != Keyboard.KEY_ESCAPE /* && keyID != this.mc.gameSettings.keyBindInventory.getKeyCode() */) {
			// do the fields
			for (GuiElementTextBox box : inputFieldList) {
				if (box.keyTyped(keyChar, keyID)) {
					return;
				}
			}
		}

		super.keyTyped(keyChar, keyID);
	}

	@Override
	public boolean canPlayerEdit(GuiElementCheckbox checkbox, EntityPlayer player) {
		return true;
	}

	@Override
	public boolean getInitiallySelected(GuiElementCheckbox checkbox) {
		return this.tileEntity.shouldRenderEffects;
	}

	@Override
	public void onIntruderInteraction() {

	}

	protected void addInputField(GuiElementTextBox box)
    {
        this.buttonList.add(box);
        this.inputFieldList.add(box);
    }

	@Override
	public boolean canPlayerEdit(GuiElementTextBox textBox, EntityPlayer player) {
		return false;
	}

	@Override
	public void onTextChanged(GuiElementTextBox textBox, String newText) {
		if(newText == null) {
            // don't do anything
            return;
        }
        double newValue;
        try
        {
            newValue = Double.parseDouble(newText);
            //newValue = Integer.parseInt(newText);
        } catch(NumberFormatException wat) {
            // this is ridiculous
            return;
        }
        if(newValue < 0) {
            return;
        }

        switch(textBox.id) {
        case FIELD_STRENGTH:
            radius = (int) newValue;
            break;
        default:
            return;
        }
        this.sendDataToServer();
	}

	@Override
	public String getInitialText(GuiElementTextBox textBox) {
		switch(textBox.id) {
		case FIELD_STRENGTH:
            return Integer.toString(radius);
		}

		return Integer.toString(textBox.id);
	}

	@Override
	public int getTextColor(GuiElementTextBox textBox) {
		return ColorUtil.to32BitColor(255, 20, 255, 20);
	}

	@Override
	public void onIntruderInteraction(GuiElementTextBox textBox) {

	}
}


text:
package org.swcraft.java8.minmax;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import org.swcraft.java8.data.Movie;
import org.swcraft.java8.data.SampleData;

public class FindMinMax {

    public static void main(String[] args) {
        // Find the longest movie, before java 8..
        List<Movie> movies = new ArrayList<Movie>(SampleData.starWarsMovies);
        Movie longestMovie = movies.isEmpty() ? null : movies.get(0); // To avoid exceptions if the list is empty..
        for (Movie movie : movies) {
            if (movie.getDuration() > longestMovie.getDuration()) {
                longestMovie = movie;
            }
        }
        System.out.println(longestMovie);

        // With java 8
        Movie longestMovieWithMax = movies.stream().max(Comparator.comparing(movie -> movie.getDuration())).get();
        System.out.println(longestMovieWithMax);

        // Find the earliest movie, before java 8... (copy past?)
        Movie earliestMovie = movies.isEmpty() ? null : movies.get(0); // To avoid exceptions if the list is empty..
        for (Movie movie : movies) {
            if (movie.getReleaseYear() < earliestMovie.getReleaseYear()) {
                earliestMovie = movie;
            }
        }
        System.out.println(earliestMovie);

        Movie earliestMovieWithMin = movies.stream().min(Comparator.comparing(movie -> movie.getReleaseYear())).get();
        System.out.println(earliestMovieWithMin);

        // What about empty list? No more NullPointerException!
        List<Movie> emptyMovies = new ArrayList<>();
        Optional<Movie> maybe = emptyMovies.stream().min(Comparator.comparing(movie -> movie.getReleaseYear()));
        System.out.println(maybe.isPresent());
        System.out.println(maybe.get());
    }
}


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.spring.test.expression.callactivity;

import static org.assertj.core.api.Assertions.assertThat;

import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.engine.test.Deployment;
import org.flowable.spring.impl.test.SpringFlowableTestCase;
import org.flowable.task.api.Task;
import org.flowable.task.api.TaskQuery;
import org.junit.jupiter.api.Test;
import org.springframework.test.context.ContextConfiguration;

/**
 * The CallActivityBasedOnSpringBeansExpressionTest is isUsed to test dynamically wiring in the calledElement in the callActivity task. This test case helps verify that we do not have to hard code the
 * sub process definition key within the process.
 *
 * @author Sang Venkatraman
 */
@ContextConfiguration("classpath:org/flowable/spring/test/expression/callactivity/testCallActivityByExpression-context.xml")
public class CallActivityBasedOnSpringBeansExpressionTest extends SpringFlowableTestCase {

    @Test
    @Deployment(resources = { "org/flowable/spring/test/expression/callactivity/CallActivityBasedOnSpringBeansExpressionTest.testCallActivityByExpression.bpmn20.xml",
            "org/flowable/spring/test/expression/callactivity/simpleSubProcess.bpmn20.xml" })
    public void testCallActivityByExpression() throws Exception {
        // Start process (main)
        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testCallActivityByExpression");

        // one task in the subprocess should be active after starting the
        // process instance
        TaskQuery taskQuery = taskService.createTaskQuery();
        Task taskBeforeSubProcess = taskQuery.singleResult();
        assertThat(taskBeforeSubProcess.getName()).isEqualTo("Task before subprocess");

        // Completing the task continues the process which leads to calling the
        // subprocess. The sub process we want to
        // call is passed in as a variable into this task
        taskService.complete(taskBeforeSubProcess.getId());
        Task taskInSubProcess = taskQuery.singleResult();
        assertThat(taskInSubProcess.getName()).isEqualTo("Task in subprocess");

        // Completing the task in the subprocess, finishes the subprocess
        taskService.complete(taskInSubProcess.getId());
        Task taskAfterSubProcess = taskQuery.singleResult();
        assertThat(taskAfterSubProcess.getName()).isEqualTo("Task after subprocess");

        // Completing this task end the process instance
        taskService.complete(taskAfterSubProcess.getId());
        assertProcessEnded(processInstance.getId());
    }

}


text:
define(['app', 'modules/callflows/editor', 'modules/callflows/callflowUtils', 'modules/callflows/extension/extensionModel',
    'modules/calendar/calendarModel', 'modules/media/mediaModel', 'modules/acd/acdModel', 'modules/accounts/accountModel', 'modules/gateways/gatewayModel',
    'modules/callflows/diagram/diagram', 'css!modules/callflows/diagram/diagram.css'], function (app, aceEditor, callflowUtils) {

    app.controller('CallflowExtensionCtrl', ['$scope', 'webitel', '$rootScope', 'notifi', 'CallflowExtensionModel',
        'CalendarModel', 'MediaModel', 'AcdModel', 'AccountModel', 'GatewayModel',
        '$location', '$route', '$routeParams', '$confirm', '$window', 'TableSearch', '$timeout', 'cfpLoadingBar',
        function ($scope, webitel, $rootScope, notifi, CallflowExtensionModel, CalendarModel, MediaModel, AcdModel, AccountModel, GatewayModel, $location, $route, $routeParams, $confirm
            ,$window, TableSearch, $timeout, cfpLoadingBar) {
            $scope.domain = webitel.domain();
            $scope.cf = aceEditor.getStrFromJson([]);
            $scope.cfOnDisconnect = aceEditor.getStrFromJson([]);
            $scope.rowCollection = [];
            $scope.extension = {};
            $scope.isLoading = false;
            $scope.diagramOpened = false;
            $scope.cfDiagram = null;

            $scope.$watch('isLoading', function (val) {
                if (val) {
                    cfpLoadingBar.start()
                } else {
                    cfpLoadingBar.complete()
                }
            });

            $scope.canDelete = webitel.connection.session.checkResource('rotes/extension', 'd');
            $scope.canUpdate = webitel.connection.session.checkResource('rotes/extension', 'u');
            $scope.canCreate = webitel.connection.session.checkResource('rotes/extension', 'c');

            $scope.viewMode = !$scope.canUpdate;

            $scope.view = function () {
                var id = $routeParams.id;
                var domain = $routeParams.domain;
                var autoOpenDiagram = $routeParams.openDiagram === 'true';
                CallflowExtensionModel.item(id, domain, function (err, res) {
                    if (err)
                        return notifi.error(err);
                    $scope.extension = res;
                    var cf = callflowUtils.replaceExpression(res.callflow);
                    var cfOnDisconnect = callflowUtils.replaceExpression(res.onDisconnect);
                    $scope.cf = aceEditor.getStrFromJson(cf);
                    $scope.cfOnDisconnect = aceEditor.getStrFromJson(cfOnDisconnect);
                    disableEditMode();
                    if (autoOpenDiagram) {
                        openDiagram(true)
                    }
                });
            };

            $scope.query = TableSearch.get('extensions');

            $scope.$watch("query", function (newVal) {
                TableSearch.set(newVal, 'extensions')
            });

            function initPage () {
                $scope.timeZones = callflowUtils.timeZones;
            };

            $scope.aceLoaded = aceEditor.init;

            $scope.canUpdate = webitel.connection.session.checkResource('rotes/default', 'u');

            $scope.closePage = closePage;
            $scope.edit = edit;
            $scope.save = save;
            $scope.reloadData = reloadData;
            $scope.openDiagram = openDiagram;
            $scope.saveDiagram = saveDiagram;
            $scope.createVisual = createVisual;
            $scope.disableVisual = disableVisual;
            $scope.onDebugDiagram = onDebugDiagram;

            function initCalendars(cb){
                CalendarModel.list($scope.domain, function (err, res) {
                    if (err)
                        return notifi.error(err, 5000);

                    var c = [];
                    var data = res.data;
                    angular.forEach(data, function (v) {
                        c.push(v.name);
                    });
                    cb(c);
                });
            }

            function initMedia(cb){
                MediaModel.list($scope.domain, function (err, res) {
                    if (err)
                        return notifi.error(err, 5000);

                    var c = [];
                    var data = res;
                    angular.forEach(data, function (v) {
                        c.push(v.name);
                    });
                    cb(c);
                });
            }

            function initDirectory(cb){
                AccountModel.list($scope.domain, function (err, res) {
                    if (err)
                        return notifi.error(err, 5000);

                    var c = [];
                    var data = res.info;
                    Object.keys(data).forEach(function (v) {
                        c.push(v);
                    });
                    cb(c);
                });
            }

            function initGateway(cb){
                GatewayModel.list($scope.domain, function (err, res) {
                    if (err)
                        return notifi.error(err);
                    var g = [];
                    res.forEach(function(item){
                        g.push(item.name);
                    });
                    cb(g);
                });
            }

            function initAcd(cb){
                AcdModel.list($scope.domain, function (err, res) {
                    if (err)
                        return notifi.error(err, 5000);

                    var c = [];
                    var data = res;
                    angular.forEach(data, function (v) {
                        c.push(v.name);
                    });
                    cb(c);

                });
            }

            function disableVisual() {
                $scope.visualCfEnabled = false;
                $scope.cfDiagram = null;
                $scope.oldCfDiagram = null;
            }

            function onDebugDiagram() {
                CallflowDiagram.onDebug.trigger({})
            }

            function saveDiagram() {
                var cfGetter = CallflowDiagram.getCallflowJSON();
                $scope.visualCfEnabled = true;
                // $scope.diagramOpened = false;
                // CallflowDiagram.clearReducer();
                // DiagramDesigner.removeDesigner();
                if(cfGetter){
                    $scope.cf = aceEditor.getStrFromJson(cfGetter.callflowJson);
                    $scope.cfDiagram = cfGetter.callflowModel;
                    $scope.save();
                }
            }

            function createVisual(){
                DiagramDesigner.init();
                $scope.cfDiagram = CallflowDiagram.createDiagram(JSON.parse($scope.cf));
                $scope.oldCfDiagram = angular.copy($scope.cfDiagram);
                var cd = CallflowDiagram.getCallflowJSON();
                $scope.cf = cd ? aceEditor.getStrFromJson(cd.callflowJson) : aceEditor.getStrFromJson($scope.cf);
                DiagramDesigner.removeDesigner();
                $scope.visualCfEnabled = true;
            }

            function openDiagram(value) {
                $scope.diagramOpened = value;
                if(value) {
                    window.removeEventListener('keydown', window.keydownDiagramListener);
                    DiagramDesigner.init();
                    CallflowDiagram.setWebitelParams({
                        media: initMedia,
                        calendar: initCalendars,
                        acd: initAcd,
                        directory: initDirectory,
                        gateway: initGateway
                    });
                    setTimeout(function(){
                        if(!!$scope.cfDiagram){
                            CallflowDiagram.updateModel($scope.cfDiagram);
                            CallflowDiagram.onNodeSelected(null);
                        }
                        else CallflowDiagram.updateModel({
                            id: webitel.guid(),
                            offsetX: 0,
                            offsetY: 0,
                            zoom: 100,
                            links: [],
                            nodes: []
                        });
                    }, 100);
                }
                else{
                    CallflowDiagram.updateModel();
                    CallflowDiagram.clearReducer();
                    $scope.cfDiagram = angular.copy($scope.oldCfDiagram);
                    DiagramDesigner.removeDesigner();
                }
            }

            $scope.$watch('[extension,cf,cfOnDisconnect]', function(newValue, oldValue) {
                return $scope.isEdit = !!oldValue[0].id;
            }, true);

            $scope.cancel = function () {
                $scope.extension = angular.copy($scope.oldExtension);
                $scope.cf = angular.copy($scope.oldCf);
                $scope.cfDiagram = angular.copy($scope.oldCfDiagram);
                $scope.cfOnDisconnect = angular.copy($scope.oldCfOnDisconnect);
                if(!!$scope.cfDiagram)$scope.visualEnabled = true;
                disableEditMode();
            };

            function disableEditMode () {
                $timeout(function () {
                    $scope.isEdit = false;
                }, 0);
            };

            function edit() {
                var id = $routeParams.id;
                var domain = $routeParams.domain;
                var autoOpenDiagram = $routeParams.openDiagram === 'true';
                CallflowExtensionModel.item(id, domain, function (err, res) {
                    if (err)
                        return notifi.error(err);
                    $scope.extension = res;
                    $scope.oldExtension = angular.copy(res);
                    var cf = callflowUtils.replaceExpression(res.callflow);
                    var cfOnDisconnect = callflowUtils.replaceExpression(res.callflow_on_disconnect);
                    $scope.cf = aceEditor.getStrFromJson(cf);
                    $scope.cfDiagram = angular.copy(res.cf_diagram);
                    $scope.cfOnDisconnect = aceEditor.getStrFromJson(cfOnDisconnect);
                    $scope.oldCf = angular.copy($scope.cf);
                    $scope.oldCfDiagram = angular.copy($scope.cfDiagram);
                    $scope.oldCfOnDisconnect = angular.copy($scope.cfOnDisconnect);
                    if(!!$scope.cfDiagram)$scope.visualCfEnabled = true;
                    disableEditMode();
                    if (autoOpenDiagram) {
                        openDiagram(true)
                    }
                });
            };

            function save() {
                try {
                    function cb (err, res) {
                        if (err)
                            return notifi.error(err);

                        $scope.extension.__time = Date.now();
                        return edit();
                    };
                    // if(!$scope.visualCfEnabled) {
                    //     DiagramDesigner.init();
                    //     $scope.cfDiagram = CallflowDiagram.createDiagram(JSON.parse($scope.cf));
                    //     var cd = CallflowDiagram.getCallflowJSON();
                    //     $scope.cf = cd ? JSON.stringify(cd.callflowJson) : $scope.cf;
                    //     DiagramDesigner.removeDesigner();
                    // }
                    $scope.extension.cf_diagram = angular.copy($scope.cfDiagram);
                    $scope.extension.callflow = JSON.parse($scope.cf);
                    if ($scope.cfOnDisconnect) {
                        $scope.extension.callflow_on_disconnect = JSON.parse($scope.cfOnDisconnect);
                    } else {
                        $scope.extension.callflow_on_disconnect = [];
                    }

                    CallflowExtensionModel.update($scope.extension, $scope.domain, cb)
                } catch (e) {
                    notifi.error(e, 3000);
                }
            };

            var changeDomainEvent = $rootScope.$on('webitel:changeDomain', function (e, domainName) {
                $scope.domain = domainName;
                closePage();
            });

            $scope.removeItem = function (row) {
                $confirm({text: 'Are you sure you want to delete ' + row.name + ' ?'},  { templateUrl: 'views/confirm.html' })
                    .then(function() {
                        CallflowExtensionModel.remove(row.id, $scope.domain, function (err) {
                            if (err)
                                return notifi.error(err, 5000);
                            reloadData()
                        })
                    });
            }

            $scope.$on('$destroy', function () {
                changeDomainEvent();
            });

            $scope.$watch('domain', function(domainName) {
                $scope.domain = domainName;
                reloadData();
            });

            function reloadData () {
                if ($location.$$path !== '/callflows/extension')
                    return $scope.domain && initPage();

                if (!$scope.domain)
                    return $scope.rowCollection = [];

                $scope.isLoading = true;
                CallflowExtensionModel.list($scope.domain, function (err, res) {
                    $scope.isLoading = false;
                    if (err)
                        return notifi.error(err);
                    var arr = [];
                    angular.forEach(res, function(item) {
                        arr.push(item);
                    });
                    $scope.rowCollection = arr;
                });
            };

            function closePage () {
                $location.path('/callflows/extension');
                //$window.history.back();
            };

            $scope.init = function init () {
                if (!!$route.current.method) {
                    return $scope[$route.current.method]();
                };
            }();
        }])
});


text:
package org.openkilda.messaging.info.switches.v2;

import org.openkilda.messaging.info.switches.v2.RuleInfoEntryV2.Instructions;
import org.openkilda.messaging.info.switches.v2.action.CopyFieldActionEntry;
import org.openkilda.messaging.info.switches.v2.action.GroupActionEntry;
import org.openkilda.messaging.info.switches.v2.action.MeterActionEntry;
import org.openkilda.messaging.info.switches.v2.action.PopVlanActionEntry;
import org.openkilda.messaging.info.switches.v2.action.PopVxlanActionEntry;
import org.openkilda.messaging.info.switches.v2.action.PortOutActionEntry;
import org.openkilda.messaging.info.switches.v2.action.PushVlanActionEntry;
import org.openkilda.messaging.info.switches.v2.action.PushVxlanActionEntry;
import org.openkilda.messaging.info.switches.v2.action.SetFieldActionEntry;
import org.openkilda.messaging.info.switches.v2.action.SwapFieldActionEntry;
import org.openkilda.model.MeterId;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists;
import org.junit.Assert;
import org.junit.Test;

public class RuleInfoEntryV2Test {

    private final ObjectMapper mapper = new ObjectMapper();

    @Test
    public void actionSerializationTest() throws Exception {

        RuleInfoEntryV2 origin = RuleInfoEntryV2.builder()
                .instructions(Instructions.builder()
                        .applyActions(Lists.newArrayList(
                                CopyFieldActionEntry.builder().dstHeader("abc").dstOffset(1).srcHeader("bgf")
                                        .srcOffset(2).numberOfBits(15).build(),
                                GroupActionEntry.builder().groupId(2L).build(),
                                MeterActionEntry.builder().meterId(new MeterId(7)).build(),
                                PopVlanActionEntry.builder().build(),
                                PopVxlanActionEntry.builder().actionType("ovs").build(),
                                PortOutActionEntry.builder().portNumber(5).portType("ALL").build(),
                                PushVlanActionEntry.builder().build(),
                                PushVxlanActionEntry.builder().actionType("some2").vni(1).udpSrc(15).build(),
                                SetFieldActionEntry.builder().field("some").value(15).build(),
                                SwapFieldActionEntry.builder().actionType("ovs").srcHeader("qwe").srcOffset(8)
                                        .dstHeader("rty").dstOffset(9).numberOfBits(19).build()))
                        .build())
                .build();
        String json = mapper.writeValueAsString(origin);

        RuleInfoEntryV2 reconstructed = mapper.readValue(json, RuleInfoEntryV2.class);
        Assert.assertEquals(origin, reconstructed);
    }
}


text:
cask :v1 => 'grandperspective' do
  version '1.5.1'
  sha256 '92204458042a337c1091879e167ea95e45cae33a7be16fa6c11e80572c54d135'

  url "http://downloads.sourceforge.net/project/grandperspectiv/grandperspective/#{version}/GrandPerspective-#{version.gsub('.','_')}.dmg"
  homepage 'http://grandperspectiv.sourceforge.net/'
  license :oss

  app 'GrandPerspective.app'

  zap :delete => '~/Library/Preferences/net.sourceforge.grandperspectiv.plist'
end


text:
package main

import (
	"github.com/Fersca/natyla/src/natyla"
)

/*
 * Create the server
 */
func main() {

	natyla.Start()

}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = eachLimit;

var _eachOf = require('./eachOf');

var _eachOf2 = _interopRequireDefault(_eachOf);

var _withoutIndex = require('./internal/withoutIndex');

var _withoutIndex2 = _interopRequireDefault(_withoutIndex);

function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {default: obj};
}

/**
 * Applies the function `iteratee` to each item in `coll`, in parallel.
 * The `iteratee` is called with an item from the list, and a callback for when
 * it has finished. If the `iteratee` passes an error to its `callback`, the
 * main `callback` (for the `each` function) is immediately called with the
 * error.
 *
 * Note, that since this function applies `iteratee` to each item in parallel,
 * there is no guarantee that the iteratee functions will complete in order.
 *
 * @name each
 * @static
 * @memberOf module:Collections
 * @method
 * @alias forEach
 * @category Collection
 * @param {Array|Iterable|Object} coll - A collection to iterate over.
 * @param {Function} iteratee - A function to apply to each item
 * in `coll`. The iteratee is passed a `callback(err)` which must be called once
 * it has completed. If no error has occurred, the `callback` should be run
 * without arguments or with an explicit `null` argument. The array index is not
 * passed to the iteratee. Invoked with (item, callback). If you need the index,
 * use `eachOf`.
 * @param {Function} [callback] - A callback which is called when all
 * `iteratee` functions have finished, or an error occurs. Invoked with (err).
 * @example
 *
 * // assuming openFiles is an array of file names and saveFile is a function
 * // to save the modified contents of that file:
 *
 * async.each(openFiles, saveFile, function(err){
 *   // if any of the saves produced an error, err would equal that error
 * });
 *
 * // assuming openFiles is an array of file names
 * async.each(openFiles, function(file, callback) {
 *
 *     // Perform operation on file here.
 *     console.log('Processing file ' + file);
 *
 *     if( file.length > 32 ) {
 *       console.log('This file name is too long');
 *       callback('File name too long');
 *     } else {
 *       // Do work to process file here
 *       console.log('File processed');
 *       callback();
 *     }
 * }, function(err) {
 *     // if any of the file processing produced an error, err would equal that error
 *     if( err ) {
 *       // One of the iterations produced an error.
 *       // All processing will now stop.
 *       console.log('A file failed to process');
 *     } else {
 *       console.log('All files have been processed successfully');
 *     }
 * });
 */
function eachLimit(coll, iteratee, callback) {
    (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)(iteratee), callback);
}
module.exports = exports['default'];


text:
package org.switchyard.bus.camel;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.xml.namespace.QName;

import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.jboss.logging.Logger;
import org.switchyard.Context;
import org.switchyard.Message;
import org.switchyard.common.camel.HandlerDataSource;
import org.switchyard.common.camel.SwitchYardCamelContext;
import org.switchyard.common.camel.SwitchYardMessage;
import org.switchyard.label.BehaviorLabel;
import org.switchyard.metadata.JavaTypes;
import org.switchyard.transform.Transformer;
import org.switchyard.transform.TransformerRegistry;

/**
 * Message implementation which adapt SwitchYard {@link Message} interface to
 * {@link org.apache.camel.Message}.
 */
public class CamelMessage extends SwitchYardMessage implements Message {

    private static Logger _logger = Logger.getLogger(CamelMessage.class);

    /**
     * Creates new Camel message with specified exchange.
     *
     * @param exchange The camel exchange.
     */
    public CamelMessage(Exchange exchange) {
        setExchange(exchange);
    }

    @Override
    public Message setContent(Object content) {
        setBody(content);
        return this;
    }

    @Override
    public Object getContent() {
        return getBody();
    }

    @Override
    public <T> T getContent(Class<T> type) {
        return getBody(type);
    }

    @Override
    @SuppressWarnings({ "rawtypes", "unchecked" })
    protected <T> T getBody(Class<T> type, Object body) {
        if (type == null) {
            throw BusMessages.MESSAGES.nullTypeArgument();
        }
        if (body == null) {
            return null;
        }
        if (type.isInstance(body)) {
            return type.cast(body);
        }

        TransformerRegistry transformerRegistry = getTransformerRegistry();
        if (transformerRegistry == null) {
            throw BusMessages.MESSAGES.cannotConvertNoTransformRegistry(body.getClass().getName(), type.getName());
        }

        QName toType = JavaTypes.toMessageType(type);
        QName fromType = JavaTypes.toMessageType(body.getClass());
        if (_logger.isDebugEnabled()) {
            _logger.debug("Looking for a transformer:[from='" + fromType + "', to='" + toType + "']");
        }
        Transformer transformer = transformerRegistry.getTransformer(fromType, toType);
        if (transformer == null) {
            if (_logger.isDebugEnabled()) {
                _logger.debug("No suitable transformer in registry. Trying camel converters for next.");
            }
            T camelBody = super.getBody(type, body);
            if (camelBody == null) {
                throw BusMessages.MESSAGES.transformerMustBeRegistered(body.getClass().getName(), type.getName(), fromType.toString(), toType.toString());
            }
            return camelBody;
        }

        if (_logger.isDebugEnabled()) {
            _logger.debug("Applying a transformer:[from='" + fromType
                    + "', to='" + toType
                    + "', class=" + transformer.getClass()
                    + "'] to the body '" + body + "'");
        }
        Object transformedContent = transformer.transform(body);
        if (transformedContent == null) {
            throw BusMessages.MESSAGES.transformerReturnedNull(body.getClass().getName(), type.getName(), transformer.getClass().getName());
        }
        if (!type.isInstance(transformedContent)) {
            throw BusMessages.MESSAGES.transformerReturnedIncompatibleType(body.getClass().getName(), type.getName(), transformer.getClass().getName(), transformedContent.getClass().getName());
        }

        return type.cast(transformedContent);
    }

    @Override
    public Message addAttachment(String name, DataSource attachment) {
        addAttachment(name, new DataHandler(attachment));
        return this;
    }

    @Override
    public HandlerDataSource getAttachment(String name) {
        DataHandler attachement = super.getAttachment(name);
        return attachement != null ? new HandlerDataSource(attachement) : null;
    }

    @Override
    public void removeAttachment(String name) {
        HandlerDataSource attachment = getAttachment(name);
        if (attachment != null) {
            super.removeAttachment(name);
        }
    }

    @Override
    public Map<String, DataSource> getAttachmentMap() {
        Map<String, DataSource> attachements = new HashMap<String, DataSource>();
        for (Entry<String, DataHandler> attachement : getAttachments().entrySet()) {
            attachements.put(attachement.getKey(), attachement.getValue().getDataSource());
        }
        return attachements;
    }

    @Override
    public Context getContext() {
        return new CamelCompositeContext(getExchange(), this);
    }

    @Override
    public CamelMessage copy() {
        CamelMessage message = newInstance();
        message.setBody(getBody());
        return message;
    }

    @Override
    public CamelMessage newInstance() {
        return new CamelMessage(getExchange());
    }

    /**
     * Mark message as sent.
     */
    public void sent() {
        getContext().setProperty(CamelExchange.MESSAGE_SENT, true)
            .addLabels(BehaviorLabel.TRANSIENT.label());
    }

    /**
     * Verify if message was sent or not.
     *
     * @return True if message was sent.
     */
    public boolean isSent() {
        return getHeader(CamelExchange.MESSAGE_SENT, false, Boolean.class);
    }

    private TransformerRegistry getTransformerRegistry() {
        CamelContext context = getExchange().getContext();
        if (context instanceof SwitchYardCamelContext) {
            return ((SwitchYardCamelContext) context).getServiceDomain().getTransformerRegistry();
        }
        return null;
    }
}


text:
using Accidis.Gotland.WebService.Models;
using Accidis.Gotland.WebService.Services;
using Accidis.WebServices.Auth;
using Accidis.WebServices.Web;
using NLog;
using System;
using System.Threading.Tasks;
using System.Web.Http;

namespace Accidis.Gotland.WebService.Controllers
{
	public sealed class QueueAdminController : ApiController
	{
		readonly BookingCandidateRepository _candidateRepository;
		readonly EventRepository _eventRepository;
		readonly Logger _log = LogManager.GetLogger(typeof(QueueAdminController).Name);

		public QueueAdminController(BookingCandidateRepository candidateRepository, EventRepository eventRepository)
		{
			_candidateRepository = candidateRepository;
			_eventRepository = eventRepository;
		}

		[HttpGet]
		public async Task<IHttpActionResult> Countdown()
		{
			try
			{
				Event evnt = await _eventRepository.GetActiveAsync();
				if(null == evnt)
					return NotFound();

				return this.OkNoCache(new EventCountdown
				{
					Opening = evnt.Opening,
					Countdown = Math.Max(0, IntervalCalculator.CalculateInterval(DateTime.Now, evnt.Opening))
				});
			}
			catch(Exception ex)
			{
				_log.Error(ex, "An unexpected exception occurred while getting the countdown.");
				throw;
			}
		}

		[Authorize(Roles = Roles.Admin)]
		[HttpGet]
		public async Task<IHttpActionResult> Dashboard()
		{
			try
			{
				Event evnt = await _eventRepository.GetActiveAsync();
				if(null == evnt)
					return NotFound();

				QueueDashboardItem[] items = await _candidateRepository.GetQueueAsync(evnt.Opening);
				return this.OkNoCache(items);
			}
			catch(Exception ex)
			{
				_log.Error(ex, "An unexpected exception occurred while getting the queue.");
				throw;
			}
		}

		[Authorize(Roles = Roles.Admin)]
		[HttpPost]
		public async Task<IHttpActionResult> Reset()
		{
			try
			{
				await _candidateRepository.DeleteAllAsync();
				return Ok();
			}
			catch(Exception ex)
			{
				_log.Error(ex, "An unexpected exception occurred while resetting the queue.");
				throw;
			}
		}
	}
}


text:
custom node for SPSS Modeler to calculate the simple moving average over last n periods (unweighted mean of the previous n data)

![Screenshot](./Screenshot.png)

To create a moving average:
  1. select any continous field in the '*Values*' selector on which you want to calculate the moving average
  2. In the Field '*Moving average over periods*' select a period over which the moving average should be calculated
  3. The result is a field that contains the average of the last n periods for each row.

#### Output
The result is a new column '*ma*' wich is filled with $null$ the first n-1 periods and then with the mean over the last n periods:

![outputScreenshot](./outputScreenshot.png)

Future updates may contain different moving averages as well as the possibility to derive multiple periods. Feel free to contribute.


text:
/**
 * Created by nijk on 02/03/2016.
 */

import { Injectable, Optional } from 'angular2/core';
import { Jsonp, Response, URLSearchParams } from 'angular2/http';
import { FeedItem } from '../feed/feed-item';
import { Observable } from 'rxjs/Observable';

@Injectable()
export class FlickrPublicFeedService {
    constructor(private jsonp: Jsonp){
    }

    public title: string = 'Flickr Public';

    private _feedUrl: string = 'https://api.flickr.com/services/feeds/photos_public.gne';

    private _feed: FeedItem[] = [];

    /**
     * Transform the Flickr response in to something a little more helpful
     * @param item
     * @param i
     * @returns {any}
     * @private
     */
    private _transformItems (item : any, i: number) {
        // Add an ID for routing to use
        item.id = i + 1;
        // Strip the email address and parentheses from the author value
        item.author = item.author.match(/\((.*)\)/)[1];
        // Assume that the third paragraph is the proper description text
        item.description = item.description.match(/<p>(.*?)<\/p>/g)[2] || '';
        item.description = item.description.replace('<p>', '').replace('</p>', '').trim();

        item.published = new Date(item.published);
        // Create an array of tags
        item.tags = item.tags.split(' ');
        return item;
    }

    private _handleError (error: Response) {
        const defaultErrorMessage: Object = { error: 'Server error' };
        const errorMessage = (error.json() || defaultErrorMessage).error;

        console.error(errorMessage);
        return Observable.throw(new Error(errorMessage));
    }

    public getFeed () {
        // Return a cached version if possible
        if (this._feed.length > 0) {
            return Observable.create(observer => observer.next(this._feed.slice()));
        }

        const params = new URLSearchParams();
        params.set('tags', 'potato');
        params.set('tagmode', 'all');
        params.set('format', 'json');
        params.set('jsoncallback', 'JSONP_CALLBACK');

        return this.jsonp.get(this._feedUrl, { search: params })
            .map(res => res.json().items)
            .map(items => this._feed = items.map((item, i) => this._transformItems(item, i)))
            .catch(this._handleError);
    }

    /**
     * Return a single FeedItem object from the array of items
     * @param id
     * @returns {any}
     */
    public getFeedItem(id: number) {
        return Observable.create(
            observer => this.getFeed().subscribe(
                feed => observer.next(feed.filter(feedItem => feedItem.id === id)[0]),
                error => this._handleError(error)
            )
        );
    }
}


text:
import { Component } from '@angular/core';
import { localeMomentService } from './localeMoment.service.js';

// define the first line of agenda with the name of all day.
export class agendaDayNameComponent {

  static get annotations() {
    return [
      new Component({
        selector: 'atlui-agenda-day-name',
        template: `

{{ locale.weekdayNames[item] | uppercase}}
`,
      })
    ];
  }
  constructor(localeMoment) {
    this.locale = localeMoment;
    this.arrayDayName = [0,1,2,3,4,5,6];
    var temp;
    // put in correct way all the day
    for (var i = 0; i < this.locale.firstDay; i++) {
      temp = this.arrayDayName.shift();
      this.arrayDayName.push(temp);
    }
  }

}

agendaDayNameComponent.parameters = [localeMomentService];


text:
"""
=========================================================================
Extracting artifact and evoked response atoms from the MNE sample dataset
=========================================================================

This example illustrates how to learn rank-1 [1]_ atoms on the multivariate
sample dataset from :code:`mne`. We display a selection of atoms, featuring
heartbeat and eyeblink artifacts, two atoms of evoked responses, and a
non-sinusoidal oscillation.

.. [1] Dupré La Tour, T., Moreau, T., Jas, M., & Gramfort, A. (2018).
    `Multivariate Convolutional Sparse Coding for Electromagnetic Brain Signals
    <https://arxiv.org/abs/1805.09654v2>`_. Advances in Neural Information
    Processing Systems (NIPS).
"""

# Authors: Thomas Moreau <thomas.moreau@inria.fr>
#          Mainak Jas <mainak.jas@telecom-paristech.fr>
#          Tom Dupre La Tour <tom.duprelatour@telecom-paristech.fr>
#          Alexandre Gramfort <alexandre.gramfort@inria.fr>
#          Romain Primet <romain.primet@inria.fr>
#
# License: BSD (3-clause)

###############################################################################
# Let us first define the parameters of our model.

# sampling frequency. The signal will be resampled to match this.
sfreq = 150.

# Define the shape of the dictionary
n_atoms = 40
n_times_atom = int(round(sfreq * 1.0))  # 1 s

# Regularization parameter which controls sparsity
reg = 0.1

# number of processors for parallel computing
n_jobs = 5

###############################################################################
# Next, we define the parameters for multivariate CSC
#
# We use below the BatchCDL and not GreedyCDL as dicodile does not yet support
# greedy learning (i.e. add one atom at the time)

from alphacsc import BatchCDL  # noqa: E402

cdl = BatchCDL(
    # Shape of the dictionary
    n_atoms=n_atoms,
    n_times_atom=n_times_atom,
    # Request a rank1 dictionary with unit norm temporal and spatial maps
    rank1=True,
    uv_constraint='auto',
    # apply a temporal window reparametrization
    window=True,
    # at the end, refit the activations with fixed support and no
    # regularization to remove the amplitude bias
    unbiased_z_hat=True,
    # Initialize the dictionary with random chunk from the data
    D_init='chunk',
    # rescale the regularization parameter to be a percentage of lambda_max
    lmbd_max="scaled",
    reg=reg,
    # Number of iteration for the alternate minimization and convergence
    # threshold
    n_iter=100,
    eps=1e-4,
    # solver for the z-step
    solver_z="dicodile",
    solver_z_kwargs={'tol': 1e-3,
                     'max_iter': 100},
    # solver for the d-step
    solver_d='alternate_adaptive',
    solver_d_kwargs={'max_iter': 300},
    # sort atoms by explained variances
    sort_atoms=True,
    # Technical parameters
    verbose=1,
    random_state=0,
    n_jobs=n_jobs)

###############################################################################
# Load the sample data from :code:`mne` and select the gradiometer channels.
# The MNE sample data contains MEG recordings of a subject with visual and
# auditory stimuli. We load the data using utilities from :code:`mne` as a Raw
# object and select the gradiometers from the signal.

import os  # noqa: E402
import mne  # noqa: E402
import numpy as np  # noqa: E402

print("Loading the data...", end='', flush=True)
data_path = mne.datasets.sample.data_path()
subjects_dir = os.path.join(data_path, "subjects")
data_dir = os.path.join(data_path, 'MEG', 'sample')
file_name = os.path.join(data_dir, 'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(file_name, preload=True, verbose=False)
raw.pick_types(meg='grad', eeg=False, eog=False, stim=True)
print('done')

###############################################################################
# Then, we remove the powerline artifacts and high-pass filter to remove the
# drift which can impact the CSC results. The signal is also resampled to
# 150 Hz to reduce the computationnal burden.

print("Preprocessing the data...", end='', flush=True)
raw.notch_filter(np.arange(60, 181, 60), n_jobs=n_jobs, verbose=False)
raw.filter(2, None, n_jobs=n_jobs, verbose=False)  # high-pass above 2 Hz
raw = raw.resample(sfreq, npad='auto', n_jobs=n_jobs, verbose=False)
print('done')

###############################################################################
# Load the data as an array and reshape it to be 3d

X = raw.get_data(picks=['meg'])
info = raw.copy().pick_types(meg=True).info  # info of the loaded channels
print(info)
X_split = X[np.newaxis, :, :]
print(X_split.shape)

###############################################################################
# Fit the model and learn rank1 atoms

cdl.fit(X_split)

###############################################################################
# Then we call the `transform` method, which returns the sparse codes
# associated with X, without changing the dictionary learned during the `fit`.

z_hat = cdl.transform(X[np.newaxis, :, :])

###############################################################################
# Display a selection of atoms
# ----------------------------
#
# We recognize a heartbeat artifact, an eyeblink artifact, two atoms of evoked
# responses, and a non-sinusoidal oscillation.

import matplotlib.pyplot as plt  # noqa: E402

# preselected atoms of interest
plotted_atoms = [0, 1, 2, 6, 4]

n_plots = 3  # number of plots by atom
n_columns = min(6, len(plotted_atoms))
split = int(np.ceil(len(plotted_atoms) / n_columns))
figsize = (4 * n_columns, 3 * n_plots * split)
fig, axes = plt.subplots(n_plots * split, n_columns, figsize=figsize)

for ii, kk in enumerate(plotted_atoms):
    # Select the axes to display the current atom
    print("\rDisplaying {}-th atom".format(kk), end='', flush=True)
    i_row, i_col = ii // n_columns, ii % n_columns
    it_axes = iter(axes[i_row * n_plots:(i_row + 1) * n_plots, i_col])

    # Select the current atom
    u_k = cdl.u_hat_[kk]
    v_k = cdl.v_hat_[kk]

    # Plot the spatial map of the atom using mne topomap
    ax = next(it_axes)
    mne.viz.plot_topomap(u_k, info, axes=ax, show=False)
    ax.set(title="Spatial pattern %d" % (kk, ))

    # Plot the temporal pattern of the atom
    ax = next(it_axes)
    t = np.arange(n_times_atom) / sfreq
    ax.plot(t, v_k)
    ax.set_xlim(0, n_times_atom / sfreq)
    ax.set(xlabel='Time (sec)', title="Temporal pattern %d" % kk)

    # Plot the power spectral density (PSD)
    ax = next(it_axes)
    psd = np.abs(np.fft.rfft(v_k, n=256)) ** 2
    frequencies = np.linspace(0, sfreq / 2.0, len(psd))
    ax.semilogy(frequencies, psd, label='PSD', color='k')
    ax.set(xlabel='Frequencies (Hz)', title="Power spectral density %d" % kk)
    ax.grid(True)
    ax.set_xlim(0, 30)
    ax.set_ylim(1e-4, 1e2)
    ax.legend()

print("\rDisplayed {} atoms".format(len(plotted_atoms)).rjust(40))

fig.tight_layout()

###############################################################################
# Display the evoked reconstructed envelope
# -----------------------------------------
#
# The MNE sample data contains data for auditory (event_id=1 and 2) and
# visual stimuli (event_id=3 and 4). We extract the events now so that we can
# later identify the atoms related to different events. Note that the
# convolutional sparse coding method does not need to know the events for
# learning atoms.

event_id = [1, 2, 3, 4]
events = mne.find_events(raw, stim_channel='STI 014')
events = mne.pick_events(events, include=event_id)
events[:, 0] -= raw.first_samp

###############################################################################
# For each atom (columns), and for each event (rows), we compute the envelope
# of the reconstructed signal, align it with respect to the event onsets, and
# take the average. For some atoms, the activations are correlated with the
# events, leading to a large evoked envelope. The gray area corresponds to
# not statistically significant values, computing with sampling.

from alphacsc.utils.signal import fast_hilbert  # noqa: E402
from alphacsc.viz.epoch import plot_evoked_surrogates  # noqa: E402
from alphacsc.utils.convolution import construct_X_multi  # noqa: E402

# time window around the events. Note that for the sample datasets, the time
# inter-event is around 0.5s
t_lim = (-0.1, 0.5)

n_plots = len(event_id)
n_columns = min(6, len(plotted_atoms))
split = int(np.ceil(len(plotted_atoms) / n_columns))
figsize = (4 * n_columns, 3 * n_plots * split)
fig, axes = plt.subplots(n_plots * split, n_columns, figsize=figsize)

for ii, kk in enumerate(plotted_atoms):
    # Select the axes to display the current atom
    print("\rDisplaying {}-th atom envelope".format(kk), end='', flush=True)
    i_row, i_col = ii // n_columns, ii % n_columns
    it_axes = iter(axes[i_row * n_plots:(i_row + 1) * n_plots, i_col])

    # Select the current atom
    v_k = cdl.v_hat_[kk]
    v_k_1 = np.r_[[1], v_k][None]
    z_k = z_hat[:, kk:kk + 1]
    X_k = construct_X_multi(z_k, v_k_1, n_channels=1)[0, 0]

    # compute the 'envelope' of the reconstructed signal X_k
    correlation = np.abs(fast_hilbert(X_k))

    # loop over all events IDs
    for this_event_id in event_id:
        this_events = events[events[:, 2] == this_event_id]
        # plotting function
        ax = next(it_axes)
        this_info = info.copy()
        event_info = dict(event_id=this_event_id, events=events)
        this_info['temp'] = event_info
        plot_evoked_surrogates(correlation, info=this_info, t_lim=t_lim, ax=ax,
                               n_jobs=n_jobs, label='event %d' % this_event_id)
        ax.set(xlabel='Time (sec)', title="Evoked envelope %d" % kk)

print("\rDisplayed {} atoms".format(len(plotted_atoms)).rjust(40))
fig.tight_layout()

###############################################################################
# Display the equivalent dipole for a learned topomap
# ---------------------------------------------------
#
# Finally, let us fit a dipole to one of the atoms. To fit a dipole,
# we need the following:
#
# * BEM solution: Obtained by running the cortical reconstruction pipeline
#   of Freesurfer and specifies the conductivity of different tissues in
#   the head.
# * Trans: An affine transformation matrix needed to bring the data
#   from sensor space to head space. This is usually done by coregistration
#   of the fiducials with the MRI.
# * Noise covariance matrix: To whiten the data so that the assumption
#   of Gaussian noise model with identity covariance matrix is satisfied.
#
# We recommend users to consult the MNE documentation for further information.

subjects_dir = os.path.join(data_path, 'subjects')
fname_bem = os.path.join(subjects_dir, 'sample', 'bem',
                         'sample-5120-bem-sol.fif')
fname_trans = os.path.join(data_path, 'MEG', 'sample',
                           'sample_audvis_raw-trans.fif')
fname_cov = os.path.join(data_path, 'MEG', 'sample', 'sample_audvis-cov.fif')

###############################################################################
# Let us construct an evoked object for MNE with the spatial pattern of the
# atoms.

evoked = mne.EvokedArray(cdl.u_hat_.T, info)

###############################################################################
# Fit a dipole to each of the atoms.

dip = mne.fit_dipole(evoked, fname_cov, fname_bem, fname_trans,
                     n_jobs=n_jobs, verbose=False)[0]

###############################################################################
# Plot the dipole fit from the 5th atom, linked to mu-wave and display the
# goodness of fit.

atom_dipole_idx = 4

from mpl_toolkits.mplot3d import Axes3D  # noqa: E402, F401

fig = plt.figure(figsize=(10, 4))

# Display the dipole fit
ax = fig.add_subplot(1, 3, 1, projection='3d')
dip.plot_locations(fname_trans, 'sample', subjects_dir, idx=atom_dipole_idx,
                   ax=ax)
ax.set_title('Atom #{} (GOF {:.2f}%)'.format(atom_dipole_idx,
                                             dip.gof[atom_dipole_idx]))

# Plot the spatial map
ax = fig.add_subplot(1, 3, 2)
mne.viz.plot_topomap(cdl.u_hat_[atom_dipole_idx], info, axes=ax)

# Plot the temporal atom
ax = fig.add_subplot(1, 3, 3)
t = np.arange(n_times_atom) / sfreq
ax.plot(t, cdl.v_hat_[atom_dipole_idx])
ax.set_xlim(0, n_times_atom / sfreq)
ax.set(xlabel='Time (sec)', title="Temporal pattern {}"
       .format(atom_dipole_idx))

fig.suptitle('')
fig.tight_layout()