text:
package org.apache.ignite.internal.processors.query.calcite.planner;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.function.Predicate;
import org.apache.calcite.plan.RelOptUtil;
import org.apache.calcite.plan.RelTraitSet;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rel.RelRoot;
import org.apache.calcite.rel.RelVisitor;
import org.apache.calcite.rel.type.RelDataTypeFactory;
import org.apache.calcite.schema.SchemaPlus;
import org.apache.calcite.sql.SqlNode;
import org.apache.calcite.util.ImmutableBitSet;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.query.calcite.QueryRegistryImpl;
import org.apache.ignite.internal.processors.query.calcite.exec.ArrayRowHandler;
import org.apache.ignite.internal.processors.query.calcite.exec.ExchangeServiceImpl;
import org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext;
import org.apache.ignite.internal.processors.query.calcite.exec.LogicalRelImplementor;
import org.apache.ignite.internal.processors.query.calcite.exec.MailboxRegistryImpl;
import org.apache.ignite.internal.processors.query.calcite.exec.QueryTaskExecutorImpl;
import org.apache.ignite.internal.processors.query.calcite.exec.rel.Node;
import org.apache.ignite.internal.processors.query.calcite.exec.rel.Outbox;
import org.apache.ignite.internal.processors.query.calcite.exec.rel.RootNode;
import org.apache.ignite.internal.processors.query.calcite.message.MessageServiceImpl;
import org.apache.ignite.internal.processors.query.calcite.message.TestIoManager;
import org.apache.ignite.internal.processors.query.calcite.metadata.ColocationGroup;
import org.apache.ignite.internal.processors.query.calcite.metadata.FragmentDescription;
import org.apache.ignite.internal.processors.query.calcite.metadata.cost.IgniteCostFactory;
import org.apache.ignite.internal.processors.query.calcite.prepare.BaseQueryContext;
import org.apache.ignite.internal.processors.query.calcite.prepare.Fragment;
import org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner;
import org.apache.ignite.internal.processors.query.calcite.prepare.MappingQueryContext;
import org.apache.ignite.internal.processors.query.calcite.prepare.MultiStepPlan;
import org.apache.ignite.internal.processors.query.calcite.prepare.MultiStepQueryPlan;
import org.apache.ignite.internal.processors.query.calcite.prepare.PlannerPhase;
import org.apache.ignite.internal.processors.query.calcite.prepare.PlanningContext;
import org.apache.ignite.internal.processors.query.calcite.prepare.QueryTemplate;
import org.apache.ignite.internal.processors.query.calcite.prepare.Splitter;
import org.apache.ignite.internal.processors.query.calcite.rel.IgniteConvention;
import org.apache.ignite.internal.processors.query.calcite.rel.IgniteFilter;
import org.apache.ignite.internal.processors.query.calcite.rel.IgniteRel;
import org.apache.ignite.internal.processors.query.calcite.schema.IgniteSchema;
import org.apache.ignite.internal.processors.query.calcite.trait.CorrelationTrait;
import org.apache.ignite.internal.processors.query.calcite.trait.IgniteDistribution;
import org.apache.ignite.internal.processors.query.calcite.trait.IgniteDistributions;
import org.apache.ignite.internal.processors.query.calcite.type.IgniteTypeFactory;
import org.apache.ignite.internal.processors.query.calcite.type.IgniteTypeSystem;
import org.apache.ignite.internal.processors.query.calcite.util.Commons;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.testframework.junits.GridTestKernalContext;
import org.apache.ignite.thread.IgniteStripedThreadPoolExecutor;
import org.junit.Assert;
import org.junit.Test;

import static org.apache.calcite.tools.Frameworks.createRootSchema;
import static org.apache.calcite.tools.Frameworks.newConfigBuilder;
import static org.apache.ignite.configuration.IgniteConfiguration.DFLT_THREAD_KEEP_ALIVE_TIME;
import static org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.FRAMEWORK_CONFIG;

/**
 *
 */
//@WithSystemProperty(key = "calcite.debug", value = "true")
@SuppressWarnings({"TooBroadScope", "FieldCanBeLocal", "TypeMayBeWeakened"})
public class PlannerTest extends AbstractPlannerTest {
    /**
     * @throws Exception If failed.
     */
    @Test
    public void testSplitterColocatedPartitionedPartitioned() throws Exception {
        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        TestTable developer = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("PROJECTID", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forAssignments(Arrays.asList(
                    select(nodes, 0, 1),
                    select(nodes, 1, 2),
                    select(nodes, 2, 0),
                    select(nodes, 0, 1),
                    select(nodes, 1, 2)
                ));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.affinity(0, "Developer", "hash");
            }
        };

        TestTable project = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("VER", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forAssignments(Arrays.asList(
                    select(nodes, 0, 1),
                    select(nodes, 1, 2),
                    select(nodes, 2, 0),
                    select(nodes, 0, 1),
                    select(nodes, 1, 2)));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.affinity(0, "Project", "hash");
            }
        };

        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        publicSchema.addTable("DEVELOPER", developer);
        publicSchema.addTable("PROJECT", project);

        SchemaPlus schema = createRootSchema(false)
            .add("PUBLIC", publicSchema);

        String sql = "SELECT d.id, d.name, d.projectId, p.id0, p.ver0 " +
            "FROM PUBLIC.Developer d JOIN (" +
            "SELECT pp.id as id0, pp.ver as ver0 FROM PUBLIC.Project pp" +
            ") p " +
            "ON d.id = p.id0";

        PlanningContext ctx = PlanningContext.builder()
            .parentContext(BaseQueryContext.builder()
                .logger(log)
                .frameworkConfig(newConfigBuilder(FRAMEWORK_CONFIG)
                    .defaultSchema(schema)
                    .build())
                .build())
            .query(sql)
            .parameters(2)
            .build();

        assertNotNull(ctx);

        IgniteRel phys = physicalPlan(ctx);

        assertNotNull(phys);

        MultiStepPlan plan = new MultiStepQueryPlan(new QueryTemplate(new Splitter().go(phys)), null);

        assertNotNull(plan);

        plan.init(this::intermediateMapping, Commons.mapContext(F.first(nodes), AffinityTopologyVersion.NONE));

        assertNotNull(plan);

        assertEquals(2, plan.fragments().size());
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testPhysicalPlan() throws Exception {
        executors = new ArrayList<>();

        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        TestTable developer = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("PROJECTID", f.createJavaType(Integer.class))
                .build()) {
            @Override public <Row> Iterable<Row> scan(
                ExecutionContext<Row> execCtx,
                ColocationGroup group,
                Predicate<Row> filter,
                Function<Row, Row> transformer,
                ImmutableBitSet requiredColumns
            ) {
                return Arrays.asList(
                    row(execCtx, requiredColumns, 0, "Igor", 0),
                    row(execCtx, requiredColumns, 1, "Roman", 0)
                );
            }

            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forNodes(select(nodes, 1));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        TestTable project = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("VER", f.createJavaType(Integer.class))
                .build()) {
            @Override public <Row> Iterable<Row> scan(
                ExecutionContext<Row> execCtx,
                ColocationGroup group,
                Predicate<Row> filter,
                Function<Row, Row> transformer,
                ImmutableBitSet requiredColumns
            ) {
                return Arrays.asList(
                    row(execCtx, requiredColumns, 0, "Calcite", 1),
                    row(execCtx, requiredColumns, 1, "Ignite", 1)
                );
            }

            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forNodes(select(nodes, 1));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        publicSchema.addTable("DEVELOPER", developer);
        publicSchema.addTable("PROJECT", project);

        SchemaPlus schema = createRootSchema(false)
            .add("PUBLIC", publicSchema);

        String sql = "SELECT d.id, d.name, d.projectId, p.name0, p.ver0 " +
            "FROM PUBLIC.Developer d JOIN (" +
            "SELECT pp.id as id0, pp.name as name0, pp.ver as ver0 FROM PUBLIC.Project pp" +
            ") p " +
            "ON d.projectId = p.id0 " +
            "WHERE (d.projectId + 1) > ?";

        BaseQueryContext qctx = BaseQueryContext.builder()
            .logger(log)
            .frameworkConfig(newConfigBuilder(FRAMEWORK_CONFIG)
                .defaultSchema(schema)
                .build())
            .build();

        PlanningContext ctx = PlanningContext.builder()
            .parentContext(qctx)
            .query(sql)
            .parameters(-10)
            .build();

        IgniteRel phys = physicalPlan(ctx);

        assertNotNull(phys);

        MultiStepPlan plan = new MultiStepQueryPlan(new QueryTemplate(new Splitter().go(phys)), null);

        assertNotNull(plan);

        plan.init(this::intermediateMapping, Commons.mapContext(F.first(nodes), AffinityTopologyVersion.NONE));

        List<Fragment> fragments = plan.fragments();
        assertEquals(2, fragments.size());

        UUID qryId = UUID.randomUUID();

        TestIoManager mgr = new TestIoManager();
        GridTestKernalContext kernal;
        QueryTaskExecutorImpl taskExecutor;
        MessageServiceImpl msgSvc;
        MailboxRegistryImpl mailboxRegistry;
        ExchangeServiceImpl exchangeSvc;
        ExecutionContext<Object[]> ectx;
        Node<Object[]> exec;

        //// Local part

        Fragment fragment = fragments.get(0);
        assert fragment.rootFragment();

        kernal = newContext();

        taskExecutor = new QueryTaskExecutorImpl(kernal);
        taskExecutor.stripedThreadPoolExecutor(new IgniteStripedThreadPoolExecutor(
            kernal.config().getQueryThreadPoolSize(),
            kernal.igniteInstanceName(),
            "calciteQry",
            (t, ex) -> {
                log().error(ex.getMessage(), ex);
                lastE = ex;
            },
            true,
            DFLT_THREAD_KEEP_ALIVE_TIME
        ));
        executors.add(taskExecutor);

        msgSvc = new TestMessageServiceImpl(kernal, mgr);

        msgSvc.localNodeId(nodes.get(0));
        msgSvc.taskExecutor(taskExecutor);
        mgr.register(msgSvc);

        mailboxRegistry = new MailboxRegistryImpl(kernal);

        exchangeSvc = new ExchangeServiceImpl(kernal);
        exchangeSvc.taskExecutor(taskExecutor);
        exchangeSvc.messageService(msgSvc);
        exchangeSvc.mailboxRegistry(mailboxRegistry);
        exchangeSvc.queryRegistry(new QueryRegistryImpl(kernal));
        exchangeSvc.init();

        ectx = new ExecutionContext<>(
            qctx,
            taskExecutor,
            qryId,
            F.first(nodes),
            F.first(nodes),
            AffinityTopologyVersion.NONE,
            new FragmentDescription(
                fragment.fragmentId(),
                fragment.mapping(),
                plan.target(fragment),
                plan.remotes(fragment)),
            ArrayRowHandler.INSTANCE,
            Commons.parametersMap(ctx.parameters())
        );

        exec = new LogicalRelImplementor<>(ectx, c1 -> r1 -> 0, mailboxRegistry, exchangeSvc,
            new TestFailureProcessor(kernal)).go(fragment.root());

        RootNode<Object[]> consumer = new RootNode<>(ectx, exec.rowType());
        consumer.register(exec);

        //// Remote part

        fragment = fragments.get(1);

        assert !fragment.rootFragment();

        kernal = newContext();

        taskExecutor = new QueryTaskExecutorImpl(kernal);
        taskExecutor.stripedThreadPoolExecutor(new IgniteStripedThreadPoolExecutor(
            kernal.config().getQueryThreadPoolSize(),
            kernal.igniteInstanceName(),
            "calciteQry",
            (t, ex) -> {
                log().error(ex.getMessage(), ex);
                lastE = ex;
            },
            true,
            DFLT_THREAD_KEEP_ALIVE_TIME
        ));
        executors.add(taskExecutor);

        msgSvc = new TestMessageServiceImpl(kernal, mgr);
        msgSvc.localNodeId(nodes.get(1));
        msgSvc.taskExecutor(taskExecutor);
        mgr.register(msgSvc);

        mailboxRegistry = new MailboxRegistryImpl(kernal);

        exchangeSvc = new ExchangeServiceImpl(kernal);
        exchangeSvc.taskExecutor(taskExecutor);
        exchangeSvc.messageService(msgSvc);
        exchangeSvc.mailboxRegistry(mailboxRegistry);
        exchangeSvc.queryRegistry(new QueryRegistryImpl(kernal));
        exchangeSvc.init();

        ectx = new ExecutionContext<>(
            qctx,
            taskExecutor,
            qryId,
            nodes.get(1),
            F.first(nodes),
            AffinityTopologyVersion.NONE,
            new FragmentDescription(
                fragment.fragmentId(),
                fragment.mapping(),
                plan.target(fragment),
                plan.remotes(fragment)),
            ArrayRowHandler.INSTANCE,
            Commons.parametersMap(ctx.parameters()));

        exec = new LogicalRelImplementor<>(ectx, c -> r -> 0, mailboxRegistry, exchangeSvc,
            new TestFailureProcessor(kernal)).go(fragment.root());

        //// Start execution

        assert exec instanceof Outbox;

        Outbox<Object[]> outbox = (Outbox<Object[]>)exec;

        exec.context().execute(outbox::init, outbox::onError);

        ArrayList<Object[]> res = new ArrayList<>();

        while (consumer.hasNext())
            res.add(consumer.next());

        assertFalse(res.isEmpty());

        Assert.assertArrayEquals(new Object[]{0, "Igor", 0, "Calcite", 1}, res.get(0));
        Assert.assertArrayEquals(new Object[]{1, "Roman", 0, "Calcite", 1}, res.get(1));
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testPhysicalPlan2() throws Exception {
        executors = new ArrayList<>();

        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        ThreadLocal<List<?>> checkRes = new ThreadLocal<>();

        TestTable testTbl = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID0", f.createJavaType(Integer.class))
                .add("ID1", f.createJavaType(Integer.class))
                .build()) {
            @Override public <Row> Iterable<Row> scan(
                ExecutionContext<Row> execCtx,
                ColocationGroup group,
                Predicate<Row> filter,
                Function<Row, Row> rowTransformer,
                ImmutableBitSet requiredColumns
            ) {
                List<Row> checkRes0 = new ArrayList<>();

                for (int i = 0; i < 10; ++i) {
                    int col = ThreadLocalRandom.current().nextInt(1_000);

                    Row r = row(execCtx, requiredColumns, col, col);

                    if (rowTransformer != null)
                        r = rowTransformer.apply(r);

                    checkRes0.add(r);
                }

                checkRes.set(checkRes0);

                return checkRes0;
            }

            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forNodes(select(nodes, 1));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        publicSchema.addTable("TEST_TABLE", testTbl);

        SchemaPlus schema = createRootSchema(false)
            .add("PUBLIC", publicSchema);

        String sql = "SELECT (ID0 + ID1) AS RES FROM PUBLIC.TEST_TABLE";

        BaseQueryContext qctx = BaseQueryContext.builder()
            .logger(log)
            .frameworkConfig(newConfigBuilder(FRAMEWORK_CONFIG)
                .defaultSchema(schema)
                .build())
            .build();

        PlanningContext ctx = PlanningContext.builder()
            .parentContext(qctx)
            .query(sql)
            .parameters(-10)
            .build();

        IgniteRel phys = physicalPlan(ctx);

        assertNotNull(phys);

        MultiStepPlan plan = new MultiStepQueryPlan(new QueryTemplate(new Splitter().go(phys)), null);

        assertNotNull(plan);

        plan.init(this::intermediateMapping, Commons.mapContext(F.first(nodes), AffinityTopologyVersion.NONE));

        List<Fragment> fragments = plan.fragments();
        assertEquals(2, fragments.size());

        UUID qryId = UUID.randomUUID();

        TestIoManager mgr = new TestIoManager();
        GridTestKernalContext kernal;
        QueryTaskExecutorImpl taskExecutor;
        MessageServiceImpl msgSvc;
        MailboxRegistryImpl mailboxRegistry;
        ExchangeServiceImpl exchangeSvc;
        ExecutionContext<Object[]> ectx;
        Node<Object[]> exec;

        //// Local part

        Fragment fragment = fragments.get(0);
        assert fragment.rootFragment();

        kernal = newContext();

        taskExecutor = new QueryTaskExecutorImpl(kernal);
        taskExecutor.stripedThreadPoolExecutor(new IgniteStripedThreadPoolExecutor(
            kernal.config().getQueryThreadPoolSize(),
            kernal.igniteInstanceName(),
            "calciteQry",
            (t, ex) -> {
                log().error(ex.getMessage(), ex);
                lastE = ex;
            },
            true,
            DFLT_THREAD_KEEP_ALIVE_TIME
        ));
        executors.add(taskExecutor);

        msgSvc = new TestMessageServiceImpl(kernal, mgr);

        msgSvc.localNodeId(nodes.get(0));
        msgSvc.taskExecutor(taskExecutor);
        mgr.register(msgSvc);

        mailboxRegistry = new MailboxRegistryImpl(kernal);

        exchangeSvc = new ExchangeServiceImpl(kernal);
        exchangeSvc.taskExecutor(taskExecutor);
        exchangeSvc.messageService(msgSvc);
        exchangeSvc.mailboxRegistry(mailboxRegistry);
        exchangeSvc.queryRegistry(new QueryRegistryImpl(kernal));
        exchangeSvc.init();

        ectx = new ExecutionContext<>(
            qctx,
            taskExecutor,
            qryId,
            F.first(nodes),
            F.first(nodes),
            AffinityTopologyVersion.NONE,
            new FragmentDescription(
                fragment.fragmentId(),
                fragment.mapping(),
                plan.target(fragment),
                plan.remotes(fragment)),
            ArrayRowHandler.INSTANCE,
            Commons.parametersMap(ctx.parameters()));

        exec = new LogicalRelImplementor<>(ectx, c1 -> r1 -> 0, mailboxRegistry, exchangeSvc,
            new TestFailureProcessor(kernal)).go(fragment.root());

        RootNode<Object[]> consumer = new RootNode<>(ectx, exec.rowType());
        consumer.register(exec);

        //// Remote part

        fragment = fragments.get(1);

        assert !fragment.rootFragment();

        kernal = newContext();

        taskExecutor = new QueryTaskExecutorImpl(kernal);
        taskExecutor.stripedThreadPoolExecutor(new IgniteStripedThreadPoolExecutor(
            kernal.config().getQueryThreadPoolSize(),
            kernal.igniteInstanceName(),
            "calciteQry",
            (t, ex) -> {
                log().error(ex.getMessage(), ex);
                lastE = ex;
            },
            true,
            DFLT_THREAD_KEEP_ALIVE_TIME
        ));
        executors.add(taskExecutor);

        msgSvc = new TestMessageServiceImpl(kernal, mgr);
        msgSvc.localNodeId(nodes.get(1));
        msgSvc.taskExecutor(taskExecutor);
        mgr.register(msgSvc);

        mailboxRegistry = new MailboxRegistryImpl(kernal);

        exchangeSvc = new ExchangeServiceImpl(kernal);
        exchangeSvc.taskExecutor(taskExecutor);
        exchangeSvc.messageService(msgSvc);
        exchangeSvc.mailboxRegistry(mailboxRegistry);
        exchangeSvc.queryRegistry(new QueryRegistryImpl(kernal));
        exchangeSvc.init();

        ectx = new ExecutionContext<>(
            qctx,
            taskExecutor,
            qryId,
            nodes.get(1),
            F.first(nodes),
            AffinityTopologyVersion.NONE,
            new FragmentDescription(
                fragment.fragmentId(),
                fragment.mapping(),
                plan.target(fragment),
                plan.remotes(fragment)),
            ArrayRowHandler.INSTANCE,
            Commons.parametersMap(ctx.parameters()));

        exec = new LogicalRelImplementor<>(ectx, c -> r -> 0, mailboxRegistry, exchangeSvc,
            new TestFailureProcessor(kernal)).go(fragment.root());

        //// Start execution

        assert exec instanceof Outbox;

        Outbox<Object[]> outbox = (Outbox<Object[]>)exec;

        exec.context().execute(outbox::init, outbox::onError);

        ArrayList<Object[]> res = new ArrayList<>();

        while (consumer.hasNext())
            res.add(consumer.next());

        assertFalse(res.isEmpty());

        int pos = 0;

        for (Object obj : checkRes.get())
            Assert.assertArrayEquals((Object[])obj, res.get(pos++));
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testSplitterColocatedReplicatedReplicated() throws Exception {
        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        TestTable developer = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("PROJECTID", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forNodes(select(nodes, 0, 1, 2, 3));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        TestTable project = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("VER", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forNodes(select(nodes, 0, 1, 2, 3));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        publicSchema.addTable("DEVELOPER", developer);
        publicSchema.addTable("PROJECT", project);

        SchemaPlus schema = createRootSchema(false)
            .add("PUBLIC", publicSchema);

        String sql = "SELECT d.id, (d.id + 1) as id2, d.name, d.projectId, p.id0, p.ver0 " +
            "FROM PUBLIC.Developer d JOIN (" +
            "SELECT pp.id as id0, pp.ver as ver0 FROM PUBLIC.Project pp" +
            ") p " +
            "ON d.id = p.id0 " +
            "WHERE (d.projectId + 1) > ?";

        PlanningContext ctx = PlanningContext.builder()
            .parentContext(BaseQueryContext.builder()
                .frameworkConfig(newConfigBuilder(FRAMEWORK_CONFIG)
                    .defaultSchema(schema)
                    .build())
                .logger(log)
                .build())
            .query(sql)
            .parameters(2)
            .build();

        IgniteRel phys = physicalPlan(ctx);

        assertNotNull(phys);

        MultiStepPlan plan = new MultiStepQueryPlan(new QueryTemplate(new Splitter().go(phys)), null);

        assertNotNull(plan);

        plan.init(this::intermediateMapping, Commons.mapContext(F.first(nodes), AffinityTopologyVersion.NONE));

        assertNotNull(plan);

        assertEquals(1, plan.fragments().size());
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testSplitterPartiallyColocatedReplicatedAndPartitioned() throws Exception {
        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        TestTable developer = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("PROJECTID", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forNodes(select(nodes, 0));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        TestTable project = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("VER", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forAssignments(Arrays.asList(
                    select(nodes, 1, 2),
                    select(nodes, 2, 3),
                    select(nodes, 3, 0),
                    select(nodes, 0, 1)
                ));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.affinity(0, "Project", "hash");
            }
        };

        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        publicSchema.addTable("DEVELOPER", developer);
        publicSchema.addTable("PROJECT", project);

        SchemaPlus schema = createRootSchema(false)
            .add("PUBLIC", publicSchema);

        String sql = "SELECT d.id, d.name, d.projectId, p.id0, p.ver0 " +
            "FROM PUBLIC.Developer d JOIN (" +
            "SELECT pp.id as id0, pp.ver as ver0 FROM PUBLIC.Project pp" +
            ") p " +
            "ON d.id = p.id0 " +
            "WHERE (d.projectId + 1) > ?";

        PlanningContext ctx = PlanningContext.builder()
            .parentContext(BaseQueryContext.builder()
                .frameworkConfig(newConfigBuilder(FRAMEWORK_CONFIG)
                    .defaultSchema(schema)
                    .build())
                .logger(log)
                .build())
            .query(sql)
            .parameters(2)
            .build();

        IgniteRel phys = physicalPlan(ctx);

        assertNotNull(phys);

        MultiStepPlan plan = new MultiStepQueryPlan(new QueryTemplate(new Splitter().go(phys)), null);

        assertNotNull(plan);

        plan.init(this::intermediateMapping, Commons.mapContext(F.first(nodes), AffinityTopologyVersion.NONE));

        assertEquals(3, plan.fragments().size());
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testSplitterPartiallyColocated1() throws Exception {
        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        TestTable developer = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("PROJECTID", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forNodes(select(nodes, 1, 2, 3));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        TestTable project = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("VER", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forAssignments(Arrays.asList(
                    select(nodes, 0),
                    select(nodes, 1),
                    select(nodes, 2)
                ));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.affinity(0, "Project", "hash");
            }
        };

        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        publicSchema.addTable("DEVELOPER", developer);
        publicSchema.addTable("PROJECT", project);

        SchemaPlus schema = createRootSchema(false)
            .add("PUBLIC", publicSchema);

        String sql = "SELECT d.id, d.name, d.projectId, p.id0, p.ver0 " +
            "FROM PUBLIC.Developer d JOIN (" +
            "SELECT pp.id as id0, pp.ver as ver0 FROM PUBLIC.Project pp" +
            ") p " +
            "ON d.projectId = p.id0 " +
            "WHERE (d.projectId + 1) > ?";

        PlanningContext ctx = PlanningContext.builder()
            .parentContext(BaseQueryContext.builder()
                .frameworkConfig(newConfigBuilder(FRAMEWORK_CONFIG)
                    .defaultSchema(schema)
                    .build())
                .logger(log)
                .build())
            .query(sql)
            .parameters(2)
            .build();

        IgniteRel phys = physicalPlan(ctx);

        assertNotNull(phys);

        MultiStepPlan plan = new MultiStepQueryPlan(new QueryTemplate(new Splitter().go(phys)), null);

        assertNotNull(plan);

        plan.init(this::intermediateMapping, Commons.mapContext(F.first(nodes), AffinityTopologyVersion.NONE));

        assertNotNull(plan);

        assertEquals(3, plan.fragments().size());
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testSplitterPartiallyColocated2() throws Exception {
        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        TestTable developer = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("PROJECTID", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forNodes(select(nodes, 0));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        TestTable project = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("VER", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forAssignments(Arrays.asList(
                    select(nodes, 1),
                    select(nodes, 2),
                    select(nodes, 3)
                ));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.affinity(0, "Project", "hash");
            }
        };

        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        publicSchema.addTable("DEVELOPER", developer);
        publicSchema.addTable("PROJECT", project);

        SchemaPlus schema = createRootSchema(false)
            .add("PUBLIC", publicSchema);

        String sql = "SELECT d.id, d.name, d.projectId, p.id0, p.ver0 " +
            "FROM PUBLIC.Developer d JOIN (" +
            "SELECT pp.id as id0, pp.ver as ver0 FROM PUBLIC.Project pp" +
            ") p " +
            "ON d.projectId = p.id0 " +
            "WHERE (d.projectId + 1) > ?";

        PlanningContext ctx = PlanningContext.builder()
            .parentContext(BaseQueryContext.builder()
                .frameworkConfig(newConfigBuilder(FRAMEWORK_CONFIG)
                    .defaultSchema(schema)
                    .build())
                .logger(log)
                .build())
            .query(sql)
            .parameters(2)
            .build();

        IgniteRel phys = physicalPlan(ctx);

        assertNotNull(phys);

        MultiStepPlan plan = new MultiStepQueryPlan(new QueryTemplate(new Splitter().go(phys)), null);

        assertNotNull(plan);

        plan.init(this::intermediateMapping, Commons.mapContext(F.first(nodes), AffinityTopologyVersion.NONE));

        assertEquals(3, plan.fragments().size());
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testSplitterNonColocated() throws Exception {
        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        TestTable developer = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("PROJECTID", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forNodes(select(nodes, 2));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        TestTable project = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("VER", f.createJavaType(Integer.class))
                .build()) {
            @Override public ColocationGroup colocationGroup(MappingQueryContext ctx) {
                return ColocationGroup.forNodes(select(nodes, 0, 1));
            }

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        publicSchema.addTable("DEVELOPER", developer);
        publicSchema.addTable("PROJECT", project);

        SchemaPlus schema = createRootSchema(false)
            .add("PUBLIC", publicSchema);

        String sql = "SELECT p.id0, d.id " +
            "FROM PUBLIC.Developer d JOIN (" +
            "SELECT pp.id as id0, pp.ver as ver0 FROM PUBLIC.Project pp" +
            ") p " +
            "ON d.projectId = p.ver0 " +
            "WHERE (d.projectId + 1) > ?";

        PlanningContext ctx = PlanningContext.builder()
            .parentContext(BaseQueryContext.builder()
                .logger(log)
                .frameworkConfig(newConfigBuilder(FRAMEWORK_CONFIG)
                    .defaultSchema(schema)
                    .build())
                .build())
            .query(sql)
            .parameters(2)
            .build();

        IgniteRel phys = physicalPlan(ctx);

        assertNotNull(phys);

        MultiStepPlan plan = new MultiStepQueryPlan(new QueryTemplate(new Splitter().go(phys)), null);

        assertNotNull(plan);

        plan.init(this::intermediateMapping, Commons.mapContext(F.first(nodes), AffinityTopologyVersion.NONE));

        assertNotNull(plan);

        assertEquals(2, plan.fragments().size());
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testMergeFilters() throws Exception {
        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        TestTable testTbl = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("VAL", f.createJavaType(String.class))
                .build()) {
            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.single();
            }
        };

        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        publicSchema.addTable("TEST", testTbl);

        String sql = "" +
            "SELECT val from (\n" +
            "   SELECT * \n" +
            "   FROM TEST \n" +
            "   WHERE VAL = 10) \n" +
            "WHERE VAL = 10";

        RelNode phys = physicalPlan(sql, publicSchema);

        assertNotNull(phys);

        AtomicInteger filterCnt = new AtomicInteger();

        // Counts filters af the plan.
        phys.childrenAccept(
            new RelVisitor() {
                @Override public void visit(RelNode node, int ordinal, RelNode parent) {
                    if (node instanceof IgniteFilter)
                        filterCnt.incrementAndGet();

                    super.visit(node, ordinal, parent);
                }
            }
        );

        // Checks that two filter merged into one filter.
        // Expected plan:
        // IgniteProject(VAL=[$1])
        //  IgniteProject(ID=[$0], VAL=[$1])
        //    IgniteFilter(condition=[=(CAST($1):INTEGER, 10)])
        //      IgniteTableScan(table=[[PUBLIC, TEST]])
        assertEquals(0, filterCnt.get());
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testJoinPushExpressionRule() throws Exception {
        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        TestTable emp = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("DEPTNO", f.createJavaType(Integer.class))
                .build()) {

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        TestTable dept = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("DEPTNO", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .build()) {

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        publicSchema.addTable("EMP", emp);
        publicSchema.addTable("DEPT", dept);

        SchemaPlus schema = createRootSchema(false)
            .add("PUBLIC", publicSchema);

        String sql = "select d.deptno, e.deptno " +
            "from dept d, emp e " +
            "where d.deptno + e.deptno = 2";

        PlanningContext ctx = PlanningContext.builder()
            .parentContext(BaseQueryContext.builder()
                .frameworkConfig(newConfigBuilder(FRAMEWORK_CONFIG)
                    .defaultSchema(schema)
                    .costFactory(new IgniteCostFactory(1, 100, 1, 1))
                    .build())
                .logger(log)
                .build()
            )
            .query(sql)
            .build();

        RelRoot relRoot;

        try (IgnitePlanner planner = ctx.planner()) {
            assertNotNull(planner);

            String qry = ctx.query();

            assertNotNull(qry);

            // Parse
            SqlNode sqlNode = planner.parse(qry);

            // Validate
            sqlNode = planner.validate(sqlNode);

            // Convert to Relational operators graph
            relRoot = planner.rel(sqlNode);

            RelNode rel = relRoot.rel;

            assertNotNull(rel);
            assertEquals("" +
                    "LogicalProject(DEPTNO=[$0], DEPTNO0=[$4])\n" +
                    "  LogicalFilter(condition=[=(CAST(+($0, $4)):INTEGER, 2)])\n" +
                    "    LogicalJoin(condition=[true], joinType=[inner])\n" +
                    "      IgniteLogicalTableScan(table=[[PUBLIC, DEPT]])\n" +
                    "      IgniteLogicalTableScan(table=[[PUBLIC, EMP]])\n",
                RelOptUtil.toString(rel));

            // Transformation chain
            RelTraitSet desired = rel.getCluster().traitSet()
                .replace(IgniteConvention.INSTANCE)
                .replace(IgniteDistributions.single())
                .replace(CorrelationTrait.UNCORRELATED)
                .simplify();

            IgniteRel phys = planner.transform(PlannerPhase.OPTIMIZATION, desired, rel);

            assertNotNull(phys);
            assertEquals(
                "Invalid plan:\n" + RelOptUtil.toString(phys),
                "IgniteProject(DEPTNO=[$3], DEPTNO0=[$2])\n" +
                    "  IgniteCorrelatedNestedLoopJoin(condition=[=(CAST(+($3, $2)):INTEGER, 2)], joinType=[inner], " +
                    "variablesSet=[[$cor2]], correlationVariables=[[$cor2]])\n" +
                    "    IgniteTableScan(table=[[PUBLIC, EMP]])\n" +
                    "    IgniteTableScan(table=[[PUBLIC, DEPT]], filters=[=(CAST(+($t0, $cor2.DEPTNO)):INTEGER, 2)])\n",
                RelOptUtil.toString(phys));

            checkSplitAndSerialization(phys, publicSchema);
        }
    }

    /** */
    @Test
    public void testMergeJoinIsNotAppliedForNonEquiJoin() throws Exception {
        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        TestTable emp = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("ID", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .add("DEPTNO", f.createJavaType(Integer.class))
                .build(), 1000) {

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        emp.addIndex("emp_idx", 1, 2);

        TestTable dept = new TestTable(
            new RelDataTypeFactory.Builder(f)
                .add("DEPTNO", f.createJavaType(Integer.class))
                .add("NAME", f.createJavaType(String.class))
                .build(), 100) {

            @Override public IgniteDistribution distribution() {
                return IgniteDistributions.broadcast();
            }
        };

        dept.addIndex("dep_idx", 1, 0);

        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        publicSchema.addTable("EMP", emp);
        publicSchema.addTable("DEPT", dept);

        String sql = "select d.deptno, d.name, e.id, e.name from dept d join emp e " +
            "on d.deptno = e.deptno and e.name >= d.name order by e.name, d.deptno";

        RelNode phys = physicalPlan(sql, publicSchema, "CorrelatedNestedLoopJoin");

        assertNotNull(phys);
        assertEquals("" +
                "IgniteSort(sort0=[$3], sort1=[$0], dir0=[ASC-nulls-first], dir1=[ASC-nulls-first])\n" +
                "  IgniteProject(DEPTNO=[$3], NAME=[$4], ID=[$0], NAME0=[$1])\n" +
                "    IgniteNestedLoopJoin(condition=[AND(=($3, $2), >=($1, $4))], joinType=[inner])\n" +
                "      IgniteTableScan(table=[[PUBLIC, EMP]])\n" +
                "      IgniteTableScan(table=[[PUBLIC, DEPT]])\n",
            RelOptUtil.toString(phys));
    }

    /** */
    @Test
    public void testNotStandardFunctions() throws Exception {
        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");
        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);

        publicSchema.addTable(
            "TEST",
            new TestTable(
                new RelDataTypeFactory.Builder(f)
                    .add("ID", f.createJavaType(Integer.class))
                    .add("VAL", f.createJavaType(String.class))
                    .build()) {

                @Override public IgniteDistribution distribution() {
                    return IgniteDistributions.affinity(0, "TEST", "hash");
                }
            }
        );

        String queries[] = {
            "select REVERSE(val) from TEST", // MYSQL
            "select DECODE(id, 0, val, '') from TEST" // ORACLE
        };

        for (String sql : queries) {
            IgniteRel phys = physicalPlan(
                sql,
                publicSchema
            );

            checkSplitAndSerialization(phys, publicSchema);
        }
    }

    /** */
    @Test
    public void testMinusDateSerialization() throws Exception {
        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");

        IgniteRel phys = physicalPlan("SELECT (DATE '2021-03-01' - DATE '2021-01-01') MONTHS", publicSchema);

        checkSplitAndSerialization(phys, publicSchema);
    }
}

redpajama_set_name: RedPajamaGithub


text:
Q: Plugin not saving values when placed in a folder within /wp-content/plugins Ive got the following code for a WordPRess plugin that essentially add two custom inputs on each page/post edit screen. The values are then saved and output in the header of the frontend page.
The code works fine if it is located inside a .php file and dropped straight into 'wp-content/plugins'. However, if I put it in its own folder inside plugins eg 'wp-content/plugins/myplugin' the input fields are not saved when saving the post/page via the edit screen. Additionally nothing it output to the frontend pages html head section.
It seems like this is an abandoned project so Ive been unable to work with the original developer to work out a solution. However, it would certainly seem that by something in the code needs to be updated to reflect that the code is placed insicde a plugin folder.
Heres the code.....
<?php

$clinical_post_types = array();
//add all post types
$post_types = get_post_types();
foreach ( $post_types as $post_type ) {
 $clinical_post_types[] = $post_type;
 //echo 'POST TYPES: ' .$post_type;
}

// Meta box
// -----------------------------------------------------------------
// Add the language metabox on every registered custom post type
function clinical_add_language_metaboxe() {
 global $clinical_post_types;
foreach ($clinical_post_types as $post_type) {
 add_meta_box('clinical_meta_box', __('Search Engine Optimization', 'clinical'), 'clinical_meta_custom_box', $post_type, 'normal', 'default');
 }
}

// The Post's meta fields Metabox
function clinical_meta_custom_box() {
 global $post;
 echo '<input type="hidden" name="clinicalmeta_noncename" '
 . 'id="clinicalmeta_noncename" value="'
 . wp_create_nonce( plugin_basename(__FILE__) ) . '/seo_fields.php" />';
 // Get the meta fields data if its already been entered
 $meta_title = get_post_meta($post->ID, '_clinical_meta_title', true);
 $meta_description = get_post_meta($post->ID, '_clinical_meta_description', true);
 // Echo out the field
 $html = '
'. __('Title', 'clinical') .'
';
 $html .= '
<input type="text" class="regular-text" name="_clinical_meta_title" id="clinical_meta_title" value="'. $meta_title .'" />
';
 $html .= '
'. __('Description', 'clinical') .'
';
 $html .= '
<textarea class="large-text" name="_clinical_meta_description" id="clinical_meta_description">'. $meta_description .'</textarea>
';
 echo $html;
}

// Save the metabox data
function clinical_save_post_meta($post_id, $post) {
 global $clinical_post_types;
 $key_title = '_clinical_meta_title';
 $key_description = '_clinical_meta_description';
 // if we're not in a clinical-enabled post type, skip.
if (in_array($post->post_type, $clinical_post_types))
 return $post;
// verify this came from our screen and with proper authorization,
// because save_post can be triggered at other times
if ((empty($_POST[$key_title]) && empty($_POST[$key_description])) || empty($_POST['clinicalmeta_noncename']) || !wp_verify_nonce($_POST['clinicalmeta_noncename'],   plugin_basename(__FILE__).'/seo_fields.php')
|| !current_user_can('edit_post', $post->ID)
) {
return $post->ID;
}
// OK, we're authenticated: we need to find and save the data
$title = $_POST[$key_title];
$description = $_POST[$key_description];
// set the post's meta title:
$updated_title = update_post_meta($post->ID, $key_title, $title);
$updated_description = update_post_meta($post->ID, $key_description, $description);
// Delete if blank:
if (!$title) delete_post_meta($post->ID, $key_title);
if (!$description) delete_post_meta($post->ID, $key_description);
}

// Filters
function clinical_wp_title_filter($title) {
 global $post;
 $seo_title = get_post_meta($post->ID, '_clinical_meta_title', true);
 if (!empty($seo_title))
  return $seo_title;
 return $title;
}

function clinical_wp_head_action() {
 global $post;
 $seo_description = get_post_meta($post->ID, '_clinical_meta_description', true);
 if (!empty($seo_description)) {
  echo '
  <meta name="description" content="'. esc_attr($seo_description) .'" />
  ';
 }
}

// Helpers
// Filters and Hooks
add_action('admin_init', 'clinical_add_language_metaboxe');
add_action('save_post', 'clinical_save_post_meta', 1, 2);
add_filter('wp_title', 'clinical_wp_title_filter');
add_action('wp_head', 'clinical_wp_head_action');

A: Here is the fixed and modified code which was having the nonce action issue.
<?php
/*
Plugin Name: Test Plugin
Plugin URI: Test
Description: Test
Author: Test
Version: 007
Author URI:
*/

// add all post types
$clinical_post_types = array();
$post_types          = get_post_types();
foreach ( $post_types as $post_type ) {
    $clinical_post_types[] = $post_type;
}

// Meta box
// Add the language metabox on every registered custom post type
function clinical_add_language_metaboxe() {
    global $clinical_post_types;
    foreach ( $clinical_post_types as $post_type ) {
        add_meta_box( 'clinical_meta_box', __( 'Search Engine Optimization', 'clinical' ), 'clinical_meta_custom_box', $post_type, 'normal', 'default' );
    }
}

// The Post's meta fields Metabox
function clinical_meta_custom_box() {
    global $post;

    // Get the meta fields data if its already been entered
    $meta_title       = get_post_meta( $post->ID, '_clinical_meta_title', true );
    $meta_description = get_post_meta( $post->ID, '_clinical_meta_description', true );

    echo '<input type="hidden" name="clinicalmeta_noncename" id="clinicalmeta_noncename" value="' . wp_create_nonce( "clinicalmeta_nonce_action" ) . '" />';

    // Echo out the field
    $html = '
' . __( 'Title', 'clinical' ) . '
';
    $html .= '
<input type="text" class="regular-text" name="_clinical_meta_title" id="clinical_meta_title" value="' . $meta_title . '" />
';
    $html .= '
' . __( 'Description', 'clinical' ) . '
';
    $html .= '
<textarea class="large-text" name="_clinical_meta_description" id="clinical_meta_description">' . $meta_description . '</textarea>
';
    echo $html;
}

// Save the metabox data
function clinical_save_post_meta( $post_id, $post ) {
    global $clinical_post_types;

    $key_title       = '_clinical_meta_title';
    $key_description = '_clinical_meta_description';

    // if we're not in a clinical-enabled post type, skip.
    if ( in_array( $post->post_type, $clinical_post_types ) ) {
        // return $post;
    }
    // verify this came from our screen and with proper authorization,
    // because save_post can be triggered at other times
    if ( ( empty( $_POST[ $key_title ] ) && empty( $_POST[ $key_description ] ) ) || empty( $_POST['clinicalmeta_noncename'] ) || ( ! wp_verify_nonce( $_POST['clinicalmeta_noncename'], "clinicalmeta_nonce_action" ) ) || ( ! current_user_can( 'edit_post', $post->ID ) ) ) {
        return $post->ID;
    }
    // OK, we're authenticated: we need to find and save the data
    $title       = $_POST[ $key_title ];
    $description = $_POST[ $key_description ];

    // set the post's meta title:
    $updated_title       = update_post_meta( $post->ID, $key_title, $title );
    $updated_description = update_post_meta( $post->ID, $key_description, $description );
    // Delete if blank:
    if ( empty( $title ) ) {
        delete_post_meta( $post->ID, $key_title );
    }
    if ( empty( $description ) ) {
        delete_post_meta( $post->ID, $key_description );
    }
}

// Filters
function clinical_wp_title_filter( $title ) {
    global $post;
    $seo_title = get_post_meta( $post->ID, '_clinical_meta_title', true );
    if ( ! empty( $seo_title ) ) {
        return $seo_title;
    }

    return $title;
}

function clinical_wp_head_action() {
    global $post;
    $seo_description = get_post_meta( $post->ID, '_clinical_meta_description', true );
    if ( ! empty( $seo_description ) ) {
        echo ' <meta name="description" content="' . esc_attr( $seo_description ) . '" /> ';
    }
}

// Helpers
// Filters and Hooks
add_action( 'admin_init', 'clinical_add_language_metaboxe' );
add_action( 'save_post', 'clinical_save_post_meta', 1, 2 );
add_filter( 'wp_title', 'clinical_wp_title_filter' );
add_action( 'wp_head', 'clinical_wp_head_action' );

A: This is an issue with the creation of the nonce.
wp_create_nonce( plugin_basename(__FILE__) ) . '/seo_fields.php" />

should probably be
wp_create_nonce( plugin_basename(__FILE__) . '/seo_fields.php' ) . '" />

because otherwise
!wp_verify_nonce($_POST['clinicalmeta_noncename'],   plugin_basename(__FILE__).'/seo_fields.php')

would not check for the same action.
See: https://codex.wordpress.org/Function_Reference/wp_verify_nonce#Parameters
drops mic

redpajama_set_name: RedPajamaStackExchange


Phil's funeral will be at St Peter's Church, East Bridgford, Nottingham, NG13 8PE on Tuesday 5th February at noon.
Phil Rech passed away on the 23 January. Phil tackled everything he worked on with enormous optimism and positivity, and he faced his illness with this same attitude. He died at home with his family, after being off work receiving treatment for most of the last 18 months. Phil will be greatly missed by all his colleagues at FPCR and those he worked with. Phil brought energy and enthusiasm to each job along with humour, being great fun to work alongside.


text:
News > News > Stop Polluters > Power Plant Cases
Power Plant Cases
11.25.19	:: Press Releases :: Energy
Riverkeeper demands NRC deny transfer of Indian Point's license to Holtec International
OSSINING, N.Y. — On Friday, Entergy, the operator of the Indian Point nuclear power plant, and Holtec International, a New Jersey-based firm with a scandalous corporate past, asked the Nuclear Regulatory Commission to approve a transfer of the plant's license and its $2 billion decommissioning trust fund to Holtec. Holtec's recent history makes it the wrong choice to take on the decommissioning of Indian Point. The company was caught bribing workers at the Tennessee Valley Authority, was suspended from contracting with TVA, and then lied about its corporate past to obtain tax breaks from […]
04.17.19	:: Press Releases :: Indian Point
Statement regarding Entergy's plan to sell the Indian Point nuclear plant to Holtec for decommissioning
Riverkeeper President Paul Gallay released this statement today: Riverkeeper has major concerns about Tuesday's announcement that Entergy will sell the Indian Point reactors to Holtec for decommissioning. Both Holtec and its intended partner, SNC-Lavalin, have problematic operating histories, including a bribery scandal in Canada that threatens to topple the Trudeau government. This proposed license transfer therefore needs careful scrutiny by New York State, and, ideally, by the Nuclear Regulatory Commission. The stated goal of decommissioning more rapidly than the 60 years allowed by the federal government is welcome, but that […]
10.14.18	:: Rvk in the Press :: The Riverdale Press
Closing Indian Point is good
08.03.18	:: Press Releases :: Pipelines
NYS DEC denies CPV fracked-gas plant an Air Quality Permit, effectively shutting down the plant
OSSINING, NY — New York State's Department of Environmental Conservation has denied the renewal of the Air Quality Permit for the Competitive Power Ventures (CPV) fracked-gas power plant located in the Town of Wawayanda in Orange County. Denial of the permit renewal effectively shuts down the plant that has been fiercely opposed by regional and statewide organizations for its devastating environmental impacts. The announcement by DEC comes after years of tireless work by community organizations to stop the plant's operation. Riverkeeper continues to support and work with Protect Orange County, […]
06.22.18	:: Indian Point
Ossining, NY — Late this afternoon, four New York State agencies released the executive summary of a long-awaited risk assessment of the Algonquin Incremental Market pipeline near Indian Point Energy Center in Westchester County. The agencies, the State Department of Homeland Security and Emergency Services, Department of Public Service, Department of Health, and the Department of Environmental Conservation, also wrote to the Chairman of the Federal Energy Regulatory Commission (FERC) requesting that the commission take additional action to mitigate and further investigate the potential risks posed by the pipelines. Riverkeeper […]
Riverkeeper joins regional and state lawmakers in calling on DEC to revoke CPV power plant permits
Goshen, NY — Riverkeeper joined with County and State lawmakers to seek the suspension or revocation of air quality permits for the Competitive Power Ventures (CPV) power plant. Riverkeeper and the elected officials filed the petition on Friday with the New York State Department of Environmental Conservation (DEC). In addition to co-signing this petition, Riverkeeper continues to support and work with Protect Orange County, which has led the fight to stop the natural-gas plant from going online and has, for years, been asking Governor Andrew M. Cuomo to address the […]
Indian Point is already too dangerous — it can't make do with a skeleton crew
Photo: Cliff Weathers
Amid the recurrent critical malfunctions, allowing "management" to expand their duties to fill the roles of multiple employees and directly operate the plant is asking for trouble. If workers are not available to operate the plant, the solution is simple. It should be taken offline until Entergy and the workers can resolve their differences.
Checking it twice: Grid operator says electric system reliable without Indian Point
The path forward to a safe, secure, low-carbon energy future without Indian Point is well lit.
12.15.17	:: Rvk in the Press :: Huffington Post
Riverkeeper statement regarding NYISO's Indian Point deactivation report
For immediate release: December 13, 2017 Contact: Cliff Weathers, Riverkeeper Communications Director cweathers@riverkeeper.org; 845-445-8257 Riverkeeper statement regarding NYISO's Indian Point deactivation report OSSINING — Today, the New York Independent System Operator released a report analyzing the retirement of the Indian Point nuclear plant and its impacts to the reliability of the electric system. The report found that system reliability criteria can be met with one or more types of solutions including generation, transmission, energy efficiency, and demand response measures. The report confirms a key finding in the 2017 report by […]
More Items »

redpajama_set_name: RedPajamaCommonCrawl


text:
|medically reviewed
The Anticipatory Hangover Cure + 6 Other Beauty Benefits Of Milk Thistle
Lindsay Cohn
Medical reviewer:
Molly Maloof, M.D.
By Lindsay Cohn
Lindsay Cohn is a freelance writer based in New York City. Her writing focuses on wellness, beauty, travel and design and has been featured in USA Today, Martha Stewart, Domino and several other publications.
Medical review by
Molly Maloof, M.D. is a medical doctor with expertise in biohacking and blood sugar control. She founded her first technology company focused on bringing continuous glucose monitoring to the masses to optimize nutrition and health.
Sure, you're familiar with the myriad benefits of turmeric, lavender, and cannabis. But what about milk thistle (Silybum marianum)? While lesser known than some other herbal remedies, it's certainly not a newcomer. In fact, quite the opposite is true. It's been used for over 2,000 years—most commonly to remedy liver disorders. One of the most researched medical herbs, its healing properties were first documented by Greek physician and botanist Dioscorides in A.D. 40.
Milk thistle is indigenous to the Mediterranean and is a member of the Asteraceae plant family (along with sunflowers and daisies). It's known for its violet thistle-like flowers and glossy green, white-veined leaves. The seeds and leaves are used to create a variety of forms, including extracts, pills, powders, tinctures, and teas. Its active ingredient, silymarin, is a flavonoid with powerful antioxidant and anti-inflammatory properties. This nutrient-rich herb possesses many magical powers when it comes to health and wellness.
1. Supports liver function
Unhealthy diet, alcohol, pollution, toxins, and stress can take a toll on our liver function. Studies show1 that milk thistle not only protects but actually helps repair toxin-induced liver damage2. Not surprisingly, it's commonly used to prevent and treat the symptoms of hangovers. When you drink, the alcohol in your body is broken down in the liver by an enzyme called alcoholdehydrogenase (ADH), which transforms it into a toxic compound called acetaldehyde, and studies have shown that the antioxidants in milk thistle can inhibit this process3. While it is by no means a definitive "cure" for hangovers, it anecdotally has been shown to alleviate some of those wretched symptoms when taken before and after nights out. Hum Wing Man contains a cocktail of high-potency milk thistle extract, dandelion root extract, and artichoke leaf flushes toxins and promotes liver detoxification. (For more product picks, check out our liver supplement roundup.)
2. Boosts skin health
Milk thistle is a mega-multitasker when it comes to your complexion (no matter your age or skin type). Its antioxidant abilities protect against free-radical damage, which can cause premature skin aging. Both its detoxifying and inflammatory properties make it particularly beneficial for those with acne, rosacea, psoriasis, and eczema. This milk thistle extract lends its skin-purifying, pore-purging properties to Sunday Riley U.F.O. Ultra-Clarifying Face Oil ($80).
3. Slows the aging process
When applied topically or ingested, its antioxidant benefits (comparable to vitamin C and E) protect against free-radical damage. Compounded with its abilities to flush the body of toxins, it can actually help slow the aging process and maintain healthy, youthful skin (think fewer dark spots, fine lines, and wrinkles), eyes, joints, and muscles.
4. Endocrine and gastrointestinal support
Milk thistle's detoxifying abilities extend beyond the liver. It helps support the endocrine and gastrointestinal systems by flushing the body of waste. It's also shown to help prevent gallstones and kidney stones and has been touted for centuries for its ability to soothe digestive issues. Stomachache? Brew a cup of Alvita Milk Thistle Herbal Tea ($5.43).
5. Protects against cancer and disease
Research from the University of Minnesota4 found "strong preclinical evidence for silymarin's hepatoprotective and anticarcinogenic effects." Here's how it works: Silymarin protects against depletion of glutathione, a powerful antioxidant that helps fight oxidative stress, which can lead to skin, breast, prostate and cervical cancer, diabetes, and heart disease.
Milk thistle extract offers cardioprotective properties. For starters, it reduces inflammation5, which is one of the leading causes of heart disease, according to the U.S. National Library of Medicine. And a 2008 study6 found that silymarin is capable of reducing LDL ("bad" cholesterol) levels associated with high-fat diets.
Overall, this herb is nothing short of magical when it comes to its health and beauty benefits. The next time you're in need of an herbal remedy (or maybe you're looking for anything that could possibly relieve a pounding hangover headache), you might want to add milk thistle to your herbal arsenal.
Lindsay Cohn is a freelance writer, wellness-enthusiast and yogi based in New York City. She studied creative writing at The University of Miami and most frequently writes about wellness, beauty, travel and design. Her work has been featured in USA Today, Martha Stewart, Domino, NBC Today, and more.


brickmould on door what profinish brickmould series double hung window vertical profinish brickmould series double hung window vertical.
brickmould on door how to install a storm door how to install a storm door removing brick mold youtube brickmold jeldwen wood doors front doors the home depot in x in lite unfinished wood prehung lefthand inswing.
brickmould on door jeld wen 30 in x 80 in 3 lite craftsman vanilla painted steel .
brickmould on door infinity 6 panel stained fiberglass woodgrain prehung front door with brickmould brick mould quirky storage space moulding front door anthonyjones brick mould quirky storage space moulding front door.
brickmould on door brick mould door with zip system r sheathing door window jamb extensions stonehaven life kitchen door section details.
brickmould on door product residential brick mould doors what is brickmold on exterior door.
brickmould on door door in x patina 1 2 lite unfinished smooth right brick mold what is brickmold what is brickmold on door seal backside of brick mold door trim what is brickmold on door seal backside of brick mold door trim brick mold door frame.
brickmould on door brick mould quirky storage space moulding front door how to install brickmould for patio doors youtube.
brickmould on door annotated image of how to measure an opening with brick mold brickmould vinyl windows and patio doors jeldwen windows doors doublehung singlehung tilt sash sliding windows.
brickmould on door brickmould vinyl 3 panel sliding patio door xoo mai doors marflsq square top lite with panel bottom exterior double door prehung.
brickmould on door brickmold door brickmold door definition door system components thermatru doors thermatru doors hinges.
brickmould on door brick mold molding dimensions cant miss holiday deals on masonite in x in avantguard masonite in x in avantguard sierra panel righthand.
brickmould on door 32 in x 80 in 9 lite unfinished wood prehung right hand inswing how to measure doors with brick mould retractable screens for annotated image of how to measure an opening with brick mold.
brickmould on door mmi door 60 in x 80 in classic left hand inswing 6 brick moulding moulding millwork the home depot remodel.
brickmould on door double hung single hung tilt sash sliding windows find the best deals on stanley doors in x in bellochio stanley doors in x in bellochio lefthand patina finished fiberglass.
brickmould on door jeld wen 32 in x 80 in 12 lite primed steel prehung exterior door buying guide an inswing is door.
brickmould on door door brick mold window brick mold window windows and doors presentation brick mold on exterior windows door brick mold how to install brickmould for patio doors youtube.
brickmould on door brick moulding is the exterior wooden trim that is applied on the exterior of the door unit to cover the connection point between the door frame and the brickmold jeldwen wood doors front doors the home depot in x in lite unfinished wood prehung lefthand inswing.
brickmould on door an inswing is door what is on a door what is brickmold on a door what is on a door garage door brick mold j channel against brick what is brickmold on a door name views residential brick mould door.
brickmould on door jeld wen 36 in x 80 in full lite cordova primed steel prehung pella windows and doors.
brickmould on door 36 in x 80 in 9 lite unfinished wood prehung left hand inswing brick mold photo of brick mold door on patio door replacement brick.
brickmould on door kitchen door section details brickmould vinyl panel sliding patio door xoo jeldwen windows brickmould vinyl panel sliding patio door xoo.
brickmould on door brick how to replace an exterior door the family handyman how to install a door.
brickmould on door jeld wen 36 in x 80 in 3 lite craftsman primed steel prehung residential brick mould door manufacturing and fabrication by elixir elixir door company is a leader in the prehung residential brick mould door industry with a wide range of available options and sizes our customers.
brickmould on door inkwell 3 lite clear glass painted fiberglass entry door with brickmould framesaver exterior door frame by endura prevent frame rot rotted door frame.
brickmould on door jeld wen 6 panel unfinished hemlock dutch entry door with primed white auralast jamb and brickmold o11687 at the home depot 37692 brickmold door buzzcomputersclub brickmold door wen in x in primed craftsman right hand lite brickmold door frame.
brickmould on door installing storm door on metal casing and no brick mould idlewild lite painted steel entry door with primed brickmold idlewild lite painted steel entry door with primed brickmold.
brickmould on door select an image to pin brickmold jeldwen wood doors front doors the home depot in x in lite unfinished wood prehung lefthand inswing.
brickmould on door elixir door company is a leader in the pre hung residential brick mould door industry with a wide range of available options and sizes our customers black fiberglass doors front doors the home depot what is brickmold brick.
brickmould on door is there something else i should do big deal on jeldwen in x in lite craftsman primed steel jeldwen in x in lite craftsman primed steel prehung.
brickmould on door brick mold corners garage door panel steel doors front doors the home depot in x in lefthand inswing classic panel primed.


text:
Home » News » World » 'We're Certainly Keeping an Eye': White House Says its Monitoring Musk-Owned Twitter for Misinformation
'We're Certainly Keeping an Eye': White House Says its Monitoring Musk-Owned Twitter for Misinformation
The White House urged social media websites to take steps to combat spread of hate, misinformation and disinformation on social media (Image: Reuters)
Karine Jean-Pierre said social media companies must prevent violence on its platforms towards individuals and any particular community
The White House said on Monday it was monitoring social media platform Twitter, now under the stewardship of new Chief Executive Elon Musk, for misinformation.
"This is something that we're certainly keeping an eye on," said White House spokesperson Karine Jean-Pierre, when asked about Twitter becoming a vector for misinformation.
Jean-Pierre said it was the responsibility of social media platforms to "make sure that when it comes to misinformation, when it comes to the hate that we're seeing, that… they take action, that they continue to take action."
Musk, who has reinstated a number of Twitter accounts that had been previously suspended, said at the weekend that new user signups were at an "all-time high." But there has been a mass exodus of advertisers over concerns about verification and hate speech that Musk blames on activist groups exerting pressure on companies.
"We're all keeping a close eye on this," Jean-Pierre told reporters at the White House. "Social media companies have a responsibility to prevent their platforms from being used by any user to incite violence, especially violence directed at individual communities."
Read all the Latest News here


West View Primary School is located at 31, Senja Road in Singapore 677742. It is enclosed within the Bukit Panjang Region.
Bukit Panjang New Town is situated at the western section of Singapore. It is very accessible to other towns because it sits near major highways like BKE and KJE.
Nearest MRT is Choa Chu Kang MRT and the closest bus interchange is Jurong East Bus Interchange. Amenities in the area include Bukit Panjang Plaza, Greenridge Shopping Center and Lot one Shopppers' Mall.
Some of the schools close by are Teck Whye Secondary School, West Spring Secondary School and Pioneer Junior College.


The R.E.M Lee Theatre Alive Society received close to $200,000 from the federal government to put toward the theatre's seating, lighting and soundboard upgrades, transforming the 40-year-old theatre into a state-of-the-art facility.
The investment through the government's Canada Cultural Spaces Fund will allow the organization to renovate the R.E.M Lee Theatre into a modernized multidisciplinary cultural centre for theatre, dance, music and film.
The society received news they were approved in December, leading them to exceed their $400,000 goal by an extra $60,000.
"We were all shell-shocked because our scope changes now," says Nancy Stone Archer, R.E.M Lee Theatre coordinator and Theatre Alive Society secretary.
The society began fundraising to update the theatre three years ago and has raised more than $260,000 through community fundraisers and various grants, including $100,000 from the BC Rural Dividend fund and $35,000 from the Northern Development Initiative Trust for a new soundboard and LED lighting system.
With this grant, she says renovation work can start immediately, starting with the replacement of the theatre's 40-year-old chairs.
"We can buy seats now — we have three sample seats arriving from shortlisted companies so we can see which ones we like and which ones are going to work in such a versatile place," Stone Archer says, adding that the seats should be installed by the fall.
Part of the work will include a plan to better stagger sightlines in the theatre, and a renovation to the front row, which will allow patrons with mobility issues better access to sit with their guests.
"Currently, I remove one bank of four seats and we ask that wheelchairs are placed there, which is not next to their family or with their people, so we would like to recraft the front row," says Stone Archer.
With more modern technical equipment, Stone Archer says the upgrades should also attract more touring musicians and artists to Terrace.
The theatre itself is a Coast Mountain School District building, but because of budget constraints, there is usually no money left over to upgrade the theatre's technical systems, seats or carpeting, Stone Archer says.


text:
WITT hosts Samoan MasterChef
Published on 1 September 2022
The sun was out, the music was playing, and there were plenty of 'must try dishes' at the Samoan MasterChef competition held at WITT on Saturday. Eight teams of two from the women's group at the Samoan Methodist Church cooked four meals over the course of the day in hope of coming away with the MasterChef title.
Contestants designed and created their own meals and had to incorporate one required ingredient into each meal from entrees having to include seafood, main dishes having to include pork, and a bonus dish including taro. Three WITT staff including two hospitality tutors were invited along to the day to judge and score the dishes.
The day was filled with cultural celebration as the contestants, and their fanau were welcomed to WITT with a pōwhiri run by ākonga from a Te Reo Māori (Level 1) class who were on campus for a weekend wānanga.
Daniel Fuemana, Director of School Trades, Training, Primary and Creative Industries, was invited to be a judge on the day. Daniel said that hosting the competition is only a small part of our kaupapa to open our doors to the Pasifika community on campus.
"The day has been a very special day for the WITT and the Pasifika community and I hope it is only the start of many."
"The Pasifika community in Taranaki have so much to offer and I hope we can continue to build our relationship with them. Not to mention the food that I have tried today has been absolutely exceptional."
Josh Robertson, trustee for the Taranaki Vaimoana Pasifika Charitable Trust, was the MC on the day and watched closely as his wife competed. "Today we have not only been integrating cultures but celebrating them."
"We're so grateful to WITT for using their hospitality facilities. Without access to kitchens like this, we wouldn't be able to have competitions," he said.
Josh said that these opportunities provide an awesome chance to help the community maintain cultural cuisines and practice them in a New Zealand context.
This story features Samoan spelling of words.


Pavlof Volcano (55° 25′N, 161° 54′W) exhibits two eruption styles: magmatic eruptions of one-to-two-days duration, and phreatic-phreatomagmatic activity lasting several days to two months. Thirty-four eruptions have occurred in historic times; of these the largest are Volcano Explosivity Index=3. Nine magmatic and 13 phreatomagmatic eruptions occurred between 1973–1983. All the magmatic eruptions occurred in the fall, between Sept. 9–Nov. 20. Four magmatic eruptions occurred during November 11–15, but in four different years. A 3-year-long period of eruptive activity between 1973–1976 bears striking resemblance to a period of activity between 1980–1983. No locatable shallow earthquakes (<50 km) have occurred within 30 km of Pavlof since 1973, which is quite unusual for an active island-arc volcano. Shallow events in the adjacent are segments have focal mechanisms with P-axes perpendicular to the arc (and parallel to plate convergence). Deep earthquakes (> 100 km) are clustered beneath Pavlof and several other volcanoes. Their T-axes show downdip tension within the slab. Deep teleseisms (> 160 km) mostly occurred between 1977–1979 when the volcano was not erupting. Catalogued volcanic activity throughout the Alaska/Aleutian arc shows a weak tendency to increase around the time of great (M > 7.8) earthquakes.
McNutt, Stephen R., "Eruption Characteristics and Cycles at Pavlof Volcano, Alaska, and Their Relation to Regional Earthquake Activity" (1987). School of Geosciences Faculty and Staff Publications. 256.


text:
Home / Games / IGN Games PC / IGN News / VideoGames / Kerbal Space Program: Rockets all over the world
Kerbal Space Program: Rockets all over the world
This interstellar sim cares not for new rocket scientists. There's no attempt to ease rookies in, and you'll struggle to get off the ground, never mind reach orbit and neighbouring planets. In fact, the whole concept will scare the space pants off most. But tame Kerbal's uncompromising ways and you're rewarded with an excellent adventure among the stars.
Even in its current Early access guise it's a rich experience. The trial-and-error stylings in career mode will see you make the type of decisions that would fluster the hardiest of NaSa employees. You micromanage everything as you build rockets and planes. It's easy enough to work out how to slap super-fast thrusters to a cockpit and head to the heavens, but place a parachute in the wrong part of the chain and you'll turn your vessel into a Catherine wheel of death.
"It may not be wInnIng a crown at any beauty pageants, but the game makes up for It wIth IncredIble depth"
Career mode objectives are simple: reach further into the darkness, research planets, and return with info to improve your next mission. Your Sim City-like base management can generate better technology through R&D, though it takes time and patience. For those looking for more immediate space exploration, Kerbal currently has a sandbox mode where all the parts are unlocked and you can build your ultimate spacecraft, and it feels much like playing with an intergalactic Lego set. Just see what we managed to do in our very own Gamesmaster space race.
It may not be winning a crown at any beauty pageants, but Kerbal makes up for this with its superb physics and incredible depth. You'll spend hours experimenting with your ships, just to see how far they'll go. Yes, it's unforgiving for newcomers, but it's worth staying the course. We're already looking forward to launch (launch!) day.


text:
Ron Given Returns to CEE with Deloitte Legal
David Stuckey
Previous Article New Law on Alternative Investment Funds Adopted
Next Article New Rules in Respect of Determination of Telecommunication and Electronic Services for VAT Purposes
Former Wolf Theiss Poland Co-Managing Partner Ron Given has joined Deloitte Legal as its CE Senior Legal Counsel, responsible for all of the firm's offices in 19 Central and Eastern European countries.
"I am absolutely delighted with this new role," Given told CEE Legal Matters. "Deloitte Legal is already a phenomenal regional success with over 370 lawyers in the CE region addressing the most significant matters of very discerning local and international clients. This success has been enabled by exceptional lawyers and a collaborative culture that have both impressed and attracted me. I look forward to helping my new colleagues and clients manage and grow their success."
"Although the number of lawyers and countries covered makes us the largest law firm in CE, our goal and plan is to better leverage the potential of regional focus and cooperation and to improve our profile to the law firm of the first choice within the region" said Jan Spacil, Deloitte Legal CE Leader. "I am really happy that Ron will help us to achieve our plans and strongly believe that his great experience in building successful legal practices across our region will enable us to significantly move towards our goals."
Given, who will be based in Prague, comes to Deloitte Legal from Wolf Theiss, where he spent ten years practicing and managing offices in Zagreb, Prague, Kyiv, and Warsaw. After leaving CEE in the spring of 2019 (as reported by CEE Legal Matters on February 11, 2019), he served as Wolf Theiss' U.S. Representative. Before moving to CEE in 2008, he was the general counsel of a NASDAQ-listed, Bermuda-based international insurance holding company and also had a long career as a corporate and banking partner with Mayer Brown.
Serbia Knowledge Partner
Karanovic & Partners is a regional legal practice in Southeast Europe with tradition spanning two decades and cooperating offices in Serbia, Croatia, Slovenia, Montenegro, Macedonia and Bosnia & Herzegovina. With more than 100 attorneys at law cooperating across the region, we take pride in our work, dedication and understanding of our clients' industries and needs.
We work with some of the most respected and reputable businesses in the world, banks, as well as governments, state-owned entities, startups and NGOs. We see our clients as long-term partners.
We focus on straightforward solutions and tailor-made advice. Lawyers cooperating with us are fully immersed in our clients' culture and industry to ensure that the work is delivered intelligently and reliably.
In our company culture, excellence is a must. We are reliable, adaptive and fast.
Karanovic & Partners operates under the "one team" principle, combining our regional reach and local know-how to deliver coordinated legal advice necessary for achieving our clients' goals.
All News about, and Legal Analysis by, Karanovic & Partners can be found here.
Firm's website: https://www.karanovicpartners.com/


text:
package org.instantlogic.designer.flow;

import org.instantlogic.designer.DesignerApplicationGenerator;
import org.instantlogic.designer.EntityDesignEntityGenerator;
import org.instantlogic.designer.FlowDesign;
import org.instantlogic.designer.SubFlowDesign;
import org.instantlogic.designer.event.AddAttributeEventGenerator;
import org.instantlogic.designer.event.AttributeDetailsEventGenerator;
import org.instantlogic.designer.event.EntityDetailsEventGenerator;
import org.instantlogic.designer.flow.entity.EntityDetailsPlaceGenerator;

public class EntityFlowGenerator extends FlowDesign {

	public static final EntityFlowGenerator FLOW = new EntityFlowGenerator();

	private EntityFlowGenerator() {
		DesignerApplicationGenerator.APPLICATION.addToFlows(this);
		setName("Entity");
	}

	@Override
	public void init() {
		addToParameters(EntityDesignEntityGenerator.ENTITY);

		SubFlowDesign addAttributeSubFlow = addSubFlow(AddAttributeFlowGenerator.FLOW);

		addToNodes(EntityDetailsPlaceGenerator.PLACE);

		newEdge()
			.setEvent(EntityDetailsEventGenerator.EVENT)
			.setEndNode(EntityDetailsPlaceGenerator.PLACE);

		newEdge()
			.setEvent(AddAttributeEventGenerator.EVENT)
			.setEndNode(addAttributeSubFlow);

		super.init();
	}
}


This is to inform you that MCA has come out with two important ROC compliance to be completed in the next month itself.
FAQs 1. ABC Pvt Ltd incorporated on 31st Dec 2017 whether it is required to do this compliance?
2. How to get longitude and Latitude?
For this purpose, you may download "GPS MAP CAMERA" or other Apps available on Google play store free of cost. 1. I registered a new company, am I required to update my KYC?
2. I am a partner in a LLP, am I required to get their KYC updated?
Yes, a person holding DIN/DPIN is required to get their KYC updated.
3. Can I do it on my own?
No. since a professional certification (by a CA/CS) is mandatory, this cannot be filed on your own.
4. Can I provide an alternate mobile number/email id not being used by me?
No, email id and mobile number must be personal of the concerned person, which shall also be verified by verified by an OTP.
Photograph of Registered Office showing external building and inside office also showing therein at least one director/ KMP who has affixed his/her Digital Signature to this form.


It's Sunday, which makes it a perfect time for a little blog housekeeping, especially about a feature that used to appear regularly on Fridays.
In the five weeks since I put YFDoW on hiatus, though, I've discovered one thing. I actually rather like the freedom to be able to write about whatever I feel like on Fridays. Looking back, I think YFDoW had become a bit of a straightjacket that I had come to feel obligated to do because it was expected and readers generally liked it, rather than because I wanted to do it anymore. Thursday nights would roll around, and I'd sometimes plow through the Folder of Woo only to find nothing much that really got me fired up. I think it was starting to show, too. Sometimes, something big would happen related to my favorite topics to blog about, and I'd have to delay writing about it. Now that I've given YFDoW up for a while, though, I actually rather miss doing the feature, which is why the time is coming when I'll almost certainly resurrect it in some form or another.
What I think I'll probably do is to bring the feature back sometime after Labor Day. However, it will no longer be a weekly feature. Instead, I'll only do an installment when some truly YFDoW-worthy bit of silliness comes to my attention. It may be once every other week; it may be once a month; it may be once a week. It all depends on the woo frequency of any given time. Of course, by sending me your best woo, you can potentially increase the frequency that I do the feature.


text:
require File.expand_path('../../spec_helper', __dir__)

module Selenium
  module WebDriver
    module Interactions
      describe KeyInput do
        let(:key_input) { KeyInput.new(:name) }
        let(:key) { 'a' }
        let(:interaction) { TypingInteraction.new(key_input, :up, 'a') }

        describe '#type' do
          it 'returns :key' do
            expect(key_input.type).to eq(:key)
          end
        end

        describe '#encode' do
          it 'returns nil if no actions' do
            expect(key_input.encode).to eq(nil)
          end

          it 'encodes each action' do
            allow(interaction).to receive(:encode).and_call_original
            2.times { key_input.add_action(interaction) }

            key_input.encode

            expect(interaction).to have_received(:encode).twice
          end
        end

        describe '#create_key_down' do
          it 'executes #add_action with created interaction' do
            allow(TypingInteraction).to receive(:new).with(key_input, :down, key).and_return(interaction)
            allow(key_input).to receive(:add_action).and_call_original

            key_input.create_key_down(key)

            expect(key_input).to have_received(:add_action).with(interaction)
          end
        end

        describe '#create_key_up' do
          it 'executes #add_action with created interaction' do
            allow(TypingInteraction).to receive(:new).with(key_input, :up, key).and_return(interaction)
            allow(key_input).to receive(:add_action).and_call_original

            key_input.create_key_up(key)

            expect(key_input).to have_received(:add_action).with(interaction)
          end
        end
      end
    end # Interactions
  end # WebDriver
end # Selenium


Since giving birth to baby Kulture, Cardi B hasn't been at any industry events. She interacted with her fans over social media but we haven't seen her out and about in a minute. Cardi B opened up the 2018 MTV VMA Awards last night where she fooled many, including Offset, that she was about to show her child's face for the first time. She ultimately didn't, but she did go on to win Best New Artist among other awards that evening. Afterwards, she hit up the VMA after-party and gave fans a preview of some new heat in the stash.
Whoever went to party with Cardi last night were in for a treat. Cardi was seen inside Tao NYC along with Quavo and Offset as well as her sister Hennessy Carolina for the Atlantic VMA after-party. Cardi dropped some new heat inside the club for anyone in attendance. Cardi interpolates Shawnna's "Gettin' Some Head" on the track.
It feels like Cardi B will be giving fans new music in the new future. She's previously said that she wants to put out a new project on September 1st, although that didn't seem to be a concrete date when she announced it. There's also been rumors that she'll be dropping a new song on the day that her collaboration with Fashion Nova comes out. Maybe this is the song that she's getting ready to drop.


By Harry Rowland: Tony Bellew has bitten off more than he can chew with this one, as David Haye trumps him in speed, power, strength, size, height, reach, weight, skill and experience. The only two attributes in Bellew's favor are age and activity. At 34, Bellew is only 2 years younger so this doesn't count for much. What does count however is the gap in recent activity. This factor is the one thing Bellew and his fans are clinging to as the only hope of an upset.
During Haye's inactivity over the last few years, Bellew has been plugging away and improving as a cruiserweight, whilst competing in world class company. Haye has been back in action for over a year now, albeit against two handpicked heavyweights that haven't managed to provide 3 full rounds workout between them. All of this becomes irrelevant when considering the huge gap in talent and physical attributes between the fighters. Haye has still been active and in training for well over a year, and knows himself well enough to know how to prepare correctly.
Haye will be too fast in his defenses for Bellew to form any sort of sustained attack. His superior footwork and head movement will cause Bellew fits. Add to this the speed of Hayes offense and its hard to see anyway of Bellew having a hope of connecting with any regularity. Haye will also be able to jab over the top of Bellew's to nullify him getting anything set up. The other major factor will be the disparity in power, yes, Bellew has power and this could carry to Heavyweight, but Hayes power is on another level.
Bellew's only hope is To make it a rough fight, taking it to Haye and turning it into a war where he might be able to land a left hook on the chin. This tactic would need to involve Haye obliging to a slugfest, which he doesn't need to, and at this stage of his career isn't foolish enough to. Despite Hayes comments he will be taking this fight very seriously and looking to cautiously set up a clean finish.
This is a mismatch, a manufactured money fight and the only people to blame for it's occurrence is the UK boxing fans. If there was no interest in the fight then it wouldn't be happening. David Haye would probably be fighting New Zealander Joseph Parker for the WBO title, instead of Hughie Fury. After beating the unheralded Mark De Mori and Arnold Gjergjaj, Haye was curiously ranked as the number one contender for the belt.
Due to public interest there was more money on the table to fight Bellew, and the belts can wait. It also gives Haye the opportunity to get some much needed rounds in, should Bellew turn out to be harder than expected. You can't blame Bellew for pushing for this fight either, as it is by far the biggest money fight available to him and the biggest of his career so far. In defeat he can go on to defend his WBC Cruiserweight belt against his mandatory challenger. On paper it is a no lose situation much as it was for Kell Brook to step up and fight Gennedy Golovkin, unless you are a fan of course.
This fight is a bit of history repeating itself for Haye, another domestic rival that he will be paid handsomely to dispatch within 6 rounds at the most. Back in 2010 Audley Harrison was the fodder and Haye made no bones about the ease of the task at hand then, as he is now. The Harrison fight not only let the fans down but also derailed the UK pay per view model at the time.
Despite Bellew being a natural Cruiserweight, he poses more of a threat than Harrison did, for this reason I think Haye will be keen to get him out of there as soon as possible, which I predict will be some point in the 2nd round.
Davies is quite rightly an overwhelming betting favorite in this one. He is unbeaten and has looked solid in his career so far, he is on the up having just stepped up in his last appearance, shutting out the capable Andrea Scarpa over 12. Matthews on the other hand is nearing the end of his career and coming off a stoppage loss to Luke Campbell. Add to this that Matthews is stepping up a division to Super Lightweight.
Matthews will struggle to close the distance against the rangy Davies, when he does he will find his opponent will be punching harder in the exchanges. Due to Davies' long limbs he doesn't like to fight on the inside, so Matthews can cause problems if he can take the fight to his foe. Should he manage such a feat it will likely take more out of Matthews than Davies, and I see him getting broken down as the fight goes on and possibly being stopped late.
I expect Matthews to make it to the final bell as Davies is lacking the killer instinct of Campbell at this stage of his career, he has looked very patient in recent fights which isn't a bad thing.
Davies to win a unanimous decision.
You could be mistaken for comparing this match up to that of Davies v Matthews, but the major difference is that Eggington although more experienced than Davies, is not as highly touted in talent, and Malignaggi has lifted world titles at two weights, whereas Matthews has fallen short at world level. Despite this I see the same outcome.
Coming off a stoppage win over domestic rival, and very tricky Frankie Gavin, Eggington has huge momentum and at 23 is still very fresh. Malignaggi has too many miles on the clock to counter Eggington's relentless onslaught. It won't be pretty but it will be an entertaining fight for as long as it lasts.
If he isn't completely shot and taken out early as he was against Shawn Porter, I can see Malignaggi using his wily skills and experience to hang on to the end.
Eggington to take a unanimous decision.


I get a lot of people who say hey let's fish together.
Long story short I showed up and we ventured out onto the ocean as strangers along with his buddy Chad. By the end of the day we had a cool little bond growing. That's how we Merica! We fish, we hunt, we love this country and the freedoms it provides.
Be sure to give this a thumbs up, subscribe to the channel, hit the bell for notifications…. who knows… we may just end up fishing together.
This entry was posted in Fishing, Outlaw Morgan. Bookmark the permalink.