As I may have mentioned last week, Instagram has a rather active watch community. One of its members, Ethokin, also makes small leather goods including some rather dandy watch rolls under the Decamp Goods brand.
He was inspired by the idea of someone needing to depart quickly on a trip, not having enough time to decide what watch or watches to pack, and filling the watch roll to have some variety. Hence the name "Decamp" as in, "to depart suddenly." It is an elegant solution to the most watch-nerdy of all first world problems. As this blog has progressed, I have found that I often need to transport watches or straps for photo shoots, and a watch roll was just what the doctor ordered.
The Decamp roll is assembled from two pieces of leather, an large outer piece, and a smaller piece on the inside that forms the pouch. A leather cord holds it shut. Ethokin uses oil tanned top grain, or the slightly stiffer Latigo leather. Custom orders in denim, camouflage, or other materials are possible. Smaller pockets for tools or straps can also be accommodated. Seven pockets is the limit, after that it is just too thick. They are entirely handmade from the measuring, to the cutting, hole punching, and stitching. No machines are used.
I got a two pouch roll made from oil tanned, top grain leather. It is a gorgeous eggplant color outside with a saddle tan pouch. The leather is buttery soft with a suede underside that forms a scratch-free haven for the watches inside. The pouches are large enough to hold some fairly large watches (I carried two 45mm pilots without issue), but snug enough to keep smaller ones from sliding around. While clearly handmade, it exhibits careful craftsmanship. As Ethokin explained, "Someone commented that they look like something from "Game of Thrones" - which I loved." He says. "I feel like I've created timeless items and something that can be passed along to future generations along with the watches inside."
A single pocket "Jaunt Pouch" starts at $25-35 depending on the material used. A two pocket roll like mine is $45. After that, prices increase in $15-25 increments (3 pockets is $65, 4/$80 5/$100 6/$125 7/$150). Frankly, at these prices you would be crazy not to check them out. They say they don't make 'em like they used to? Well, this guy does. There is no Decamp website at this time, but examples may be seen on @Decamp_Goods on Instagram. For more information and orders, contact decampgoods@gmail.com.
Pro: Useful, beautiful, and affordable.
Con: Will encourage you to carry more watches.
Sum: If you carry watches anywhere, you need one of these. The Time Bum highly approves.


text:
D For Danger
Taupe - 95.00 AEDMehr - 95.00 AEDD For Danger - 95.00 AED
MAC Matte Lipstick is a creamy rich lipstick formula with high colour payoff in a no-shine matte finish.
How to apply : Apply to lips directly from the lipstick bullet or use a 316 Brush for more precision.
About M·A·C
M·A·C is the world's leading professional makeup authority because of our unrivalled expertise in makeup ARTISTRY.
M·A·C is at the forefront of fashion TRENDSETTING, collaborating with leading talents from fashion, art and popular culture. Our Artists create trends backstage at fashion weeks around the world.
Make-Up Art Cosmetics started life in Toronto, Canada. Makeup artist and photographer Frank Toskan and salon owner Frank Angelo became frustrated by the lack of makeup that photographed well, so they decided to create their own. At first, they made the cosmetics in their kitchen and sold them straight from the salon to fellow makeup artists, as well as models and photographers. Soon, stylists and fashion editors got in on the action. As the magazine credits racked up and word-of-mouth popularity grew, the duo launched M·A·C in March 1984 from a counter in a Toronto department store.
Check out how to be fabulous in 10 minutes by senior makeup artiste MAC

redpajama_set_name: RedPajamaCommonCrawl


text:
package org.apache.beam.runners.core.construction.graph;

import static com.google.common.collect.Iterables.getOnlyElement;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.emptyIterable;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.beam.model.pipeline.v1.RunnerApi;
import org.apache.beam.model.pipeline.v1.RunnerApi.Components;
import org.apache.beam.model.pipeline.v1.RunnerApi.Environment;
import org.apache.beam.model.pipeline.v1.RunnerApi.FunctionSpec;
import org.apache.beam.model.pipeline.v1.RunnerApi.PCollection;
import org.apache.beam.model.pipeline.v1.RunnerApi.PTransform;
import org.apache.beam.model.pipeline.v1.RunnerApi.ParDoPayload;
import org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline;
import org.apache.beam.model.pipeline.v1.RunnerApi.SdkFunctionSpec;
import org.apache.beam.model.pipeline.v1.RunnerApi.SideInput;
import org.apache.beam.model.pipeline.v1.RunnerApi.StateSpec;
import org.apache.beam.model.pipeline.v1.RunnerApi.TimerSpec;
import org.apache.beam.model.pipeline.v1.RunnerApi.WindowIntoPayload;
import org.apache.beam.runners.core.construction.PTransformTranslation;
import org.apache.beam.runners.core.construction.graph.PipelineNode.PCollectionNode;
import org.apache.beam.runners.core.construction.graph.PipelineNode.PTransformNode;
import org.hamcrest.Matchers;
import org.hamcrest.core.AnyOf;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Tests for {@link GreedyPipelineFuser}. */
@RunWith(JUnit4.class)
public class GreedyPipelineFuserTest {
  // Contains the 'go' and 'py' environments, and a default 'impulse' step and output.
  private Components partialComponents;

  @Before
  public void setup() {
    partialComponents =
        Components.newBuilder()
            .putTransforms(
                "impulse",
                PTransform.newBuilder()
                    .putOutputs("output", "impulse.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.IMPULSE_TRANSFORM_URN))
                    .build())
            .putPcollections(
                "impulse.out", PCollection.newBuilder().setUniqueName("impulse.out").build())
            .putEnvironments("go", Environment.newBuilder().setUrl("go").build())
            .putEnvironments("py", Environment.newBuilder().setUrl("py").build())
            .build();
  }

  /*
   * impulse -> .out -> read -> .out -> parDo -> .out -> window -> .out
   * becomes
   * (impulse.out) -> read -> read.out -> parDo -> parDo.out -> window
   */
  @Test
  public void singleEnvironmentBecomesASingleStage() {
    Components components =
        partialComponents
            .toBuilder()
            .putTransforms(
                "read",
                PTransform.newBuilder()
                    .putInputs("input", "impulse.out")
                    .putOutputs("output", "read.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections("read.out", PCollection.newBuilder().setUniqueName("read.out").build())
            .putTransforms(
                "parDo",
                PTransform.newBuilder()
                    .putInputs("input", "read.out")
                    .putOutputs("output", "parDo.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections(
                "parDo.out", PCollection.newBuilder().setUniqueName("parDo.out").build())
            .putTransforms(
                "window",
                PTransform.newBuilder()
                    .putInputs("input", "parDo.out")
                    .putOutputs("output", "window.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.ASSIGN_WINDOWS_TRANSFORM_URN)
                            .setPayload(
                                WindowIntoPayload.newBuilder()
                                    .setWindowFn(
                                        SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections(
                "window.out", PCollection.newBuilder().setUniqueName("window.out").build())
            .build();
    FusedPipeline fused =
        GreedyPipelineFuser.fuse(Pipeline.newBuilder().setComponents(components).build());

    assertThat(
        fused.getRunnerExecutedTransforms(),
        contains(PipelineNode.pTransform("impulse", components.getTransformsOrThrow("impulse"))));
    assertThat(
        fused.getFusedStages(),
        contains(
            ExecutableStageMatcher.withInput("impulse.out")
                .withNoOutputs()
                .withTransforms("read", "parDo", "window")));
  }

  /*
   * impulse -> .out -> mystery -> .out
   *                 \
   *                  -> enigma -> .out
   * becomes all runner-executed
   */
  @Test
  public void unknownTransformsNoEnvironmentBecomeRunnerExecuted() {
    Components components =
        partialComponents
            .toBuilder()
            .putTransforms(
                "mystery",
                PTransform.newBuilder()
                    .putInputs("input", "impulse.out")
                    .putOutputs("output", "mystery.out")
                    .setSpec(FunctionSpec.newBuilder().setUrn("beam:transform:mystery:v1.4"))
                    .build())
            .putPcollections(
                "mystery.out", PCollection.newBuilder().setUniqueName("mystery.out").build())
            .putTransforms(
                "enigma",
                PTransform.newBuilder()
                    .putInputs("input", "impulse.out")
                    .putOutputs("output", "enigma.out")
                    .setSpec(FunctionSpec.newBuilder().setUrn("beam:transform:enigma:v1"))
                    .build())
            .putPcollections(
                "enigma.out", PCollection.newBuilder().setUniqueName("enigma.out").build())
            .build();
    FusedPipeline fused =
        GreedyPipelineFuser.fuse(Pipeline.newBuilder().setComponents(components).build());

    assertThat(
        fused.getRunnerExecutedTransforms(),
        containsInAnyOrder(
            PipelineNode.pTransform("impulse", components.getTransformsOrThrow("impulse")),
            PipelineNode.pTransform("mystery", components.getTransformsOrThrow("mystery")),
            PipelineNode.pTransform("enigma", components.getTransformsOrThrow("enigma"))));
    assertThat(fused.getFusedStages(), emptyIterable());
  }

  /*
   * impulse -> .out -> read -> .out -> groupByKey -> .out -> parDo -> .out
   * becomes
   * (impulse.out) -> read -> (read.out)
   * (groupByKey.out) -> parDo
   */
  @Test
  public void singleEnvironmentAcrossGroupByKeyMultipleStages() {
    Components components =
        partialComponents
            .toBuilder()
            .putTransforms(
                "read",
                PTransform.newBuilder()
                    .putInputs("input", "impulse.out")
                    .putOutputs("output", "read.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections("read.out", PCollection.newBuilder().setUniqueName("read.out").build())
            .putTransforms(
                "groupByKey",
                PTransform.newBuilder()
                    .putInputs("input", "read.out")
                    .putOutputs("output", "groupByKey.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.GROUP_BY_KEY_TRANSFORM_URN))
                    .build())
            .putPcollections(
                "groupByKey.out", PCollection.newBuilder().setUniqueName("groupByKey.out").build())
            .putTransforms(
                "parDo",
                PTransform.newBuilder()
                    .putInputs("input", "groupByKey.out")
                    .putOutputs("output", "parDo.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections(
                "parDo.out", PCollection.newBuilder().setUniqueName("parDo.out").build())
            .build();
    FusedPipeline fused =
        GreedyPipelineFuser.fuse(Pipeline.newBuilder().setComponents(components).build());

    assertThat(
        fused.getRunnerExecutedTransforms(),
        containsInAnyOrder(
            PipelineNode.pTransform("impulse", components.getTransformsOrThrow("impulse")),
            PipelineNode.pTransform("groupByKey", components.getTransformsOrThrow("groupByKey"))));
    assertThat(
        fused.getFusedStages(),
        containsInAnyOrder(
            ExecutableStageMatcher.withInput("impulse.out")
                .withOutputs("read.out")
                .withTransforms("read"),
            ExecutableStageMatcher.withInput("groupByKey.out")
                .withNoOutputs()
                .withTransforms("parDo")));
  }

  /*
   * impulse -> .out -> read -> .out --> goTransform -> .out
   *                                  \
   *                                   -> pyTransform -> .out
   * becomes (impulse.out) -> read -> (read.out)
   *         (read.out) -> goTransform
   *         (read.out) -> pyTransform
   */
  @Test
  public void multipleEnvironmentsBecomesMultipleStages() {
    Components components =
        partialComponents
            .toBuilder()
            .putTransforms(
                "read",
                PTransform.newBuilder()
                    .putInputs("input", "impulse.out")
                    .putOutputs("output", "read.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections("read.out", PCollection.newBuilder().setUniqueName("read.out").build())
            .putTransforms(
                "goTransform",
                PTransform.newBuilder()
                    .putInputs("input", "read.out")
                    .putOutputs("output", "go.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("go"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections("go.out", PCollection.newBuilder().setUniqueName("go.out").build())
            .putTransforms(
                "pyTransform",
                PTransform.newBuilder()
                    .putInputs("input", "read.out")
                    .putOutputs("output", "py.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.ASSIGN_WINDOWS_TRANSFORM_URN)
                            .setPayload(
                                WindowIntoPayload.newBuilder()
                                    .setWindowFn(
                                        SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections("py.out", PCollection.newBuilder().setUniqueName("py.out").build())
            .build();
    FusedPipeline fused =
        GreedyPipelineFuser.fuse(Pipeline.newBuilder().setComponents(components).build());

    // Impulse is the runner transform
    assertThat(fused.getRunnerExecutedTransforms(), hasSize(1));
    assertThat(fused.getFusedStages(), hasSize(3));
    assertThat(
        fused.getFusedStages(),
        containsInAnyOrder(
            ExecutableStageMatcher.withInput("impulse.out")
                .withOutputs("read.out")
                .withTransforms("read"),
            ExecutableStageMatcher.withInput("read.out")
                .withNoOutputs()
                .withTransforms("pyTransform"),
            ExecutableStageMatcher.withInput("read.out")
                .withNoOutputs()
                .withTransforms("goTransform")));
  }

  /*
   * goImpulse -> .out -> goRead -> .out \                    -> goParDo -> .out
   *                                      -> flatten -> .out |
   * pyImpulse -> .out -> pyRead -> .out /                    -> pyParDo -> .out
   *
   * becomes
   * (goImpulse.out) -> goRead -> goRead.out -> flatten -> (flatten.out_synthetic0)
   * (pyImpulse.out) -> pyRead -> pyRead.out -> flatten -> (flatten.out_synthetic1)
   * flatten.out_synthetic0 & flatten.out_synthetic1 -> synthetic_flatten -> flatten.out
   * (flatten.out) -> goParDo
   * (flatten.out) -> pyParDo
   */
  @Test
  public void flattenWithHeterogenousInputsAndOutputsEntirelyMaterialized() {
    Components components =
        Components.newBuilder()
            .putTransforms(
                "pyImpulse",
                PTransform.newBuilder()
                    .putOutputs("output", "pyImpulse.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.IMPULSE_TRANSFORM_URN))
                    .build())
            .putPcollections(
                "pyImpulse.out", PCollection.newBuilder().setUniqueName("pyImpulse.out").build())
            .putTransforms(
                "pyRead",
                PTransform.newBuilder()
                    .putInputs("input", "pyImpulse.out")
                    .putOutputs("output", "pyRead.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections(
                "pyRead.out", PCollection.newBuilder().setUniqueName("pyRead.out").build())
            .putTransforms(
                "goImpulse",
                PTransform.newBuilder()
                    .putOutputs("output", "goImpulse.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.IMPULSE_TRANSFORM_URN))
                    .build())
            .putPcollections(
                "goImpulse.out", PCollection.newBuilder().setUniqueName("goImpulse.out").build())
            .putTransforms(
                "goRead",
                PTransform.newBuilder()
                    .putInputs("input", "goImpulse.out")
                    .putOutputs("output", "goRead.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("go"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections(
                "goRead.out", PCollection.newBuilder().setUniqueName("goRead.out").build())
            .putTransforms(
                "flatten",
                PTransform.newBuilder()
                    .putInputs("goReadInput", "goRead.out")
                    .putInputs("pyReadInput", "pyRead.out")
                    .putOutputs("output", "flatten.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.FLATTEN_TRANSFORM_URN))
                    .build())
            .putPcollections(
                "flatten.out", PCollection.newBuilder().setUniqueName("flatten.out").build())
            .putTransforms(
                "pyParDo",
                PTransform.newBuilder()
                    .putInputs("input", "flatten.out")
                    .putOutputs("output", "pyParDo.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections(
                "pyParDo.out", PCollection.newBuilder().setUniqueName("pyParDo.out").build())
            .putTransforms(
                "goParDo",
                PTransform.newBuilder()
                    .putInputs("input", "flatten.out")
                    .putOutputs("output", "goParDo.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("go"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections(
                "goParDo.out", PCollection.newBuilder().setUniqueName("goParDo.out").build())
            .putEnvironments("go", Environment.newBuilder().setUrl("go").build())
            .putEnvironments("py", Environment.newBuilder().setUrl("py").build())
            .build();
    FusedPipeline fused =
        GreedyPipelineFuser.fuse(Pipeline.newBuilder().setComponents(components).build());

    assertThat(fused.getRunnerExecutedTransforms(), hasSize(3));
    assertThat(
        "The runner should include the impulses for both languages, plus an introduced flatten",
        fused.getRunnerExecutedTransforms(),
        hasItems(
            PipelineNode.pTransform("pyImpulse", components.getTransformsOrThrow("pyImpulse")),
            PipelineNode.pTransform("goImpulse", components.getTransformsOrThrow("goImpulse"))));

    PTransformNode flattenNode = null;
    for (PTransformNode runnerTransform : fused.getRunnerExecutedTransforms()) {
      if (getOnlyElement(runnerTransform.getTransform().getOutputsMap().values())
          .equals("flatten.out")) {
        flattenNode = runnerTransform;
      }
    }

    assertThat(flattenNode, not(nullValue()));
    assertThat(
        flattenNode.getTransform().getSpec().getUrn(),
        equalTo(PTransformTranslation.FLATTEN_TRANSFORM_URN));
    assertThat(new HashSet<>(flattenNode.getTransform().getInputsMap().values()), hasSize(2));

    Collection<String> introducedOutputs = flattenNode.getTransform().getInputsMap().values();
    AnyOf<String> anyIntroducedPCollection =
        anyOf(introducedOutputs.stream().map(Matchers::equalTo).collect(Collectors.toSet()));
    assertThat(
        fused.getFusedStages(),
        containsInAnyOrder(
            ExecutableStageMatcher.withInput("goImpulse.out")
                .withOutputs(anyIntroducedPCollection)
                .withTransforms("goRead", "flatten"),
            ExecutableStageMatcher.withInput("pyImpulse.out")
                .withOutputs(anyIntroducedPCollection)
                .withTransforms("pyRead", "flatten"),
            ExecutableStageMatcher.withInput("flatten.out")
                .withNoOutputs()
                .withTransforms("goParDo"),
            ExecutableStageMatcher.withInput("flatten.out")
                .withNoOutputs()
                .withTransforms("pyParDo")));
    Set<String> materializedStageOutputs =
        fused
            .getFusedStages()
            .stream()
            .flatMap(executableStage -> executableStage.getOutputPCollections().stream())
            .map(PCollectionNode::getId)
            .collect(Collectors.toSet());

    assertThat(
        "All materialized stage outputs should be flattened, and no more",
        materializedStageOutputs,
        containsInAnyOrder(
            flattenNode.getTransform().getInputsMap().values().toArray(new String[0])));
  }

  /*
   * impulseA -> .out -> goRead -> .out \
   *                                     -> flatten -> .out -> goParDo -> .out
   * impulseB -> .out -> pyRead -> .out /
   *
   * becomes
   * (impulseA.out) -> goRead -> goRead.out -> flatten -> flatten.out -> goParDo
   * (impulseB.out) -> pyRead -> pyRead.out -> flatten -> (flatten.out)
   * (flatten.out) -> goParDo
   */
  @Test
  public void flattenWithHeterogeneousInputsSingleEnvOutputPartiallyMaterialized() {
    Components components =
        Components.newBuilder()
            .putTransforms(
                "pyImpulse",
                PTransform.newBuilder()
                    .putOutputs("output", "pyImpulse.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.IMPULSE_TRANSFORM_URN))
                    .build())
            .putPcollections(
                "pyImpulse.out", PCollection.newBuilder().setUniqueName("pyImpulse.out").build())
            .putTransforms(
                "pyRead",
                PTransform.newBuilder()
                    .putInputs("input", "pyImpulse.out")
                    .putOutputs("output", "pyRead.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections(
                "pyRead.out", PCollection.newBuilder().setUniqueName("pyRead.out").build())
            .putTransforms(
                "goImpulse",
                PTransform.newBuilder()
                    .putOutputs("output", "goImpulse.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.IMPULSE_TRANSFORM_URN))
                    .build())
            .putPcollections(
                "goImpulse.out", PCollection.newBuilder().setUniqueName("goImpulse.out").build())
            .putTransforms(
                "goRead",
                PTransform.newBuilder()
                    .putInputs("input", "goImpulse.out")
                    .putOutputs("output", "goRead.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("go"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections(
                "goRead.out", PCollection.newBuilder().setUniqueName("goRead.out").build())
            .putTransforms(
                "flatten",
                PTransform.newBuilder()
                    .putInputs("goReadInput", "goRead.out")
                    .putInputs("pyReadInput", "pyRead.out")
                    .putOutputs("output", "flatten.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.FLATTEN_TRANSFORM_URN))
                    .build())
            .putPcollections(
                "flatten.out", PCollection.newBuilder().setUniqueName("flatten.out").build())
            .putTransforms(
                "goParDo",
                PTransform.newBuilder()
                    .putInputs("input", "flatten.out")
                    .putOutputs("output", "goParDo.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("go"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections(
                "goParDo.out", PCollection.newBuilder().setUniqueName("goParDo.out").build())
            .putEnvironments("go", Environment.newBuilder().setUrl("go").build())
            .putEnvironments("py", Environment.newBuilder().setUrl("py").build())
            .build();
    FusedPipeline fused =
        GreedyPipelineFuser.fuse(Pipeline.newBuilder().setComponents(components).build());

    assertThat(
        fused.getRunnerExecutedTransforms(),
        containsInAnyOrder(
            PipelineNode.pTransform("pyImpulse", components.getTransformsOrThrow("pyImpulse")),
            PipelineNode.pTransform("goImpulse", components.getTransformsOrThrow("goImpulse"))));

    assertThat(
        fused.getFusedStages(),
        containsInAnyOrder(
            ExecutableStageMatcher.withInput("goImpulse.out")
                .withNoOutputs()
                .withTransforms("goRead", "flatten", "goParDo"),
            ExecutableStageMatcher.withInput("pyImpulse.out")
                .withOutputs("flatten.out")
                .withTransforms("pyRead", "flatten"),
            ExecutableStageMatcher.withInput("flatten.out")
                .withNoOutputs()
                .withTransforms("goParDo")));
  }

  /*
   * impulseA -> .out -> flatten -> .out -> read -> .out -> parDo -> .out
   * becomes
   * (flatten.out) -> read -> parDo
   *
   * Flatten, specifically, doesn't fuse greedily into downstream environments or act as a sibling
   * to any of those nodes, but the routing is instead handled by the Runner.
   */
  @Test
  public void flattenAfterNoEnvDoesNotFuse() {
    Components components = partialComponents.toBuilder()
        .putTransforms("flatten",
            PTransform.newBuilder()
                .putInputs("impulseInput", "impulse.out")
                .putOutputs("output", "flatten.out")
                .setSpec(FunctionSpec.newBuilder()
                    .setUrn(PTransformTranslation.FLATTEN_TRANSFORM_URN)
                    .build())
                .build())
        .putPcollections("flatten.out",
            PCollection.newBuilder().setUniqueName("flatten.out").build())
        .putTransforms("read",
            PTransform.newBuilder()
                .putInputs("input", "flatten.out")
                .putOutputs("output", "read.out")
                .setSpec(FunctionSpec.newBuilder()
                    .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                    .setPayload(ParDoPayload.newBuilder()
                        .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                        .build()
                        .toByteString()))
                .build())
        .putPcollections("read.out", PCollection.newBuilder().setUniqueName("read.out").build())
        .putTransforms("parDo",
            PTransform.newBuilder()
                .putInputs("input", "read.out")
                .putOutputs("output", "parDo.out")
                .setSpec(FunctionSpec.newBuilder()
                    .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                    .setPayload(ParDoPayload.newBuilder()
                        .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py").build())
                        .build()
                        .toByteString()))
                .build())
        .putPcollections("parDo.out", PCollection.newBuilder().setUniqueName("parDo.out").build())
        .build();
    FusedPipeline fused =
        GreedyPipelineFuser.fuse(Pipeline.newBuilder().setComponents(components).build());

    assertThat(
        fused.getRunnerExecutedTransforms(),
        containsInAnyOrder(
            PipelineNode.pTransform("impulse", components.getTransformsOrThrow("impulse")),
            PipelineNode.pTransform("flatten", components.getTransformsOrThrow("flatten"))));
    assertThat(
        fused.getFusedStages(),
        contains(
            ExecutableStageMatcher.withInput("flatten.out")
                .withNoOutputs()
                .withTransforms("read", "parDo")));
  }

  /*
   * impulseA -> .out -> read -> .out -> leftParDo -> .out
   *                                  \ -> rightParDo -> .out
   *                                   ------> sideInputParDo -> .out
   *                                        /
   * impulseB -> .out -> side_read -> .out /
   *
   * becomes
   * (impulseA.out) -> read -> (read.out)
   * (read.out) -> leftParDo
   *            \
   *             -> rightParDo
   * (read.out) -> sideInputParDo
   * (impulseB.out) -> side_read
   */
  @Test
  public void sideInputRootsNewStage() {
    Components components =
        Components.newBuilder()
            .putTransforms(
                "mainImpulse",
                PTransform.newBuilder()
                    .putOutputs("output", "mainImpulse.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.IMPULSE_TRANSFORM_URN))
                    .build())
            .putPcollections(
                "mainImpulse.out",
                PCollection.newBuilder().setUniqueName("mainImpulse.out").build())
            .putTransforms(
                "read",
                PTransform.newBuilder()
                    .putInputs("input", "mainImpulse.out")
                    .putOutputs("output", "read.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections("read.out", PCollection.newBuilder().setUniqueName("read.out").build())
            .putTransforms(
                "sideImpulse",
                PTransform.newBuilder()
                    .putOutputs("output", "sideImpulse.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.IMPULSE_TRANSFORM_URN))
                    .build())
            .putPcollections(
                "sideImpulse.out",
                PCollection.newBuilder().setUniqueName("sideImpulse.out").build())
            .putTransforms(
                "sideRead",
                PTransform.newBuilder()
                    .putInputs("input", "sideImpulse.out")
                    .putOutputs("output", "sideRead.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections(
                "sideRead.out", PCollection.newBuilder().setUniqueName("sideRead.out").build())
            .putTransforms(
                "leftParDo",
                PTransform.newBuilder()
                    .putInputs("main", "read.out")
                    .putOutputs("output", "leftParDo.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString())
                            .build())
                    .build())
            .putPcollections(
                "leftParDo.out", PCollection.newBuilder().setUniqueName("leftParDo.out").build())
            .putTransforms(
                "rightParDo",
                PTransform.newBuilder()
                    .putInputs("main", "read.out")
                    .putOutputs("output", "rightParDo.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString())
                            .build())
                    .build())
            .putPcollections(
                "rightParDo.out", PCollection.newBuilder().setUniqueName("rightParDo.out").build())
            .putTransforms(
                "sideParDo",
                PTransform.newBuilder()
                    .putInputs("main", "read.out")
                    .putInputs("side", "sideRead.out")
                    .putOutputs("output", "sideParDo.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .putSideInputs("side", SideInput.getDefaultInstance())
                                    .build()
                                    .toByteString())
                            .build())
                    .build())
            .putPcollections(
                "sideParDo.out", PCollection.newBuilder().setUniqueName("sideParDo.out").build())
            .putEnvironments("py", Environment.newBuilder().setUrl("py").build())
            .build();

    FusedPipeline fused =
        GreedyPipelineFuser.fuse(Pipeline.newBuilder().setComponents(components).build());

    assertThat(
        fused.getRunnerExecutedTransforms(),
        containsInAnyOrder(
            PipelineNode.pTransform("mainImpulse", components.getTransformsOrThrow("mainImpulse")),
            PipelineNode.pTransform(
                "sideImpulse", components.getTransformsOrThrow("sideImpulse"))));
    assertThat(
        fused.getFusedStages(),
        containsInAnyOrder(
            ExecutableStageMatcher.withInput("mainImpulse.out")
                .withOutputs("read.out")
                .withTransforms("read"),
            ExecutableStageMatcher.withInput("read.out")
                .withNoOutputs()
                .withTransforms("leftParDo", "rightParDo"),
            ExecutableStageMatcher.withInput("read.out")
                .withSideInputs(
                    RunnerApi.ExecutableStagePayload.SideInputId.newBuilder()
                        .setTransformId("sideParDo")
                        .setLocalName("side")
                        .build())
                .withNoOutputs()
                .withTransforms("sideParDo"),
            ExecutableStageMatcher.withInput("sideImpulse.out")
                .withNoOutputs()
                .withTransforms("sideRead")));
  }

  /*
   * impulse -> .out -> parDo -> .out -> stateful -> .out
   * becomes
   * (impulse.out) -> parDo -> (parDo.out)
   * (parDo.out) -> stateful
   */
  @Test
  public void statefulParDoRootsStage() {
    // (impulse.out) -> parDo -> (parDo.out)
    // (parDo.out) -> stateful -> stateful.out
    // stateful has a state spec which prevents it from fusing with an upstream ParDo
    PTransform parDoTransform =
        PTransform.newBuilder()
            .putInputs("input", "impulse.out")
            .putOutputs("output", "parDo.out")
            .setSpec(
                FunctionSpec.newBuilder()
                    .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                    .setPayload(
                        ParDoPayload.newBuilder()
                            .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("common"))
                            .build()
                            .toByteString()))
            .build();
    PTransform statefulTransform =
        PTransform.newBuilder()
            .putInputs("input", "parDo.out")
            .putOutputs("output", "stateful.out")
            .setSpec(
                FunctionSpec.newBuilder()
                    .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                    .setPayload(
                        ParDoPayload.newBuilder()
                            .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("common"))
                            .putStateSpecs("state", StateSpec.getDefaultInstance())
                            .build()
                            .toByteString()))
            .build();

    Components components =
        partialComponents
            .toBuilder()
            .putTransforms("parDo", parDoTransform)
            .putPcollections(
                "parDo.out", PCollection.newBuilder().setUniqueName("parDo.out").build())
            .putTransforms("stateful", statefulTransform)
            .putPcollections(
                "stateful.out", PCollection.newBuilder().setUniqueName("stateful.out").build())
            .putEnvironments("common", Environment.newBuilder().setUrl("common").build())
            .build();
    FusedPipeline fused =
        GreedyPipelineFuser.fuse(Pipeline.newBuilder().setComponents(components).build());

    assertThat(
        fused.getRunnerExecutedTransforms(),
        containsInAnyOrder(
            PipelineNode.pTransform("impulse", components.getTransformsOrThrow("impulse"))));
    assertThat(
        fused.getFusedStages(),
        containsInAnyOrder(
            ExecutableStageMatcher.withInput("impulse.out")
                .withOutputs("parDo.out")
                .withTransforms("parDo"),
            ExecutableStageMatcher.withInput("parDo.out")
                .withNoOutputs()
                .withTransforms("stateful")));
  }

  /*
   * impulse -> .out -> parDo -> .out -> timer -> .out
   * becomes
   * (impulse.out) -> parDo -> (parDo.out)
   * (parDo.out) -> timer
   */
  @Test
  public void parDoWithTimerRootsStage() {
    // (impulse.out) -> parDo -> (parDo.out)
    // (parDo.out) -> timer -> timer.out
    // timer has a timer spec which prevents it from fusing with an upstream ParDo
    PTransform parDoTransform =
        PTransform.newBuilder()
            .putInputs("input", "impulse.out")
            .putOutputs("output", "parDo.out")
            .setSpec(
                FunctionSpec.newBuilder()
                    .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                    .setPayload(
                        ParDoPayload.newBuilder()
                            .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("common"))
                            .build()
                            .toByteString()))
            .build();
    PTransform timerTransform =
        PTransform.newBuilder()
            .putInputs("input", "parDo.out")
            .putOutputs("output", "timer.out")
            .setSpec(
                FunctionSpec.newBuilder()
                    .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                    .setPayload(
                        ParDoPayload.newBuilder()
                            .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("common"))
                            .putTimerSpecs("timer", TimerSpec.getDefaultInstance())
                            .build()
                            .toByteString()))
            .build();

    Components components =
        partialComponents
            .toBuilder()
            .putTransforms("parDo", parDoTransform)
            .putPcollections(
                "parDo.out", PCollection.newBuilder().setUniqueName("parDo.out").build())
            .putTransforms("timer", timerTransform)
            .putPcollections(
                "timer.out", PCollection.newBuilder().setUniqueName("timer.out").build())
            .putEnvironments("common", Environment.newBuilder().setUrl("common").build())
            .build();

    FusedPipeline fused =
        GreedyPipelineFuser.fuse(Pipeline.newBuilder().setComponents(components).build());

    assertThat(
        fused.getRunnerExecutedTransforms(),
        containsInAnyOrder(
            PipelineNode.pTransform("impulse", components.getTransformsOrThrow("impulse"))));
    assertThat(
        fused.getFusedStages(),
        containsInAnyOrder(
            ExecutableStageMatcher.withInput("impulse.out")
                .withOutputs("parDo.out")
                .withTransforms("parDo"),
            ExecutableStageMatcher.withInput("parDo.out")
                .withNoOutputs()
                .withTransforms("timer")));
  }

  /*
   * impulse -> .out -> ( read -> .out --> goTransform -> .out )
   *                                    \
   *                                     -> pyTransform -> .out )
   * becomes (impulse.out) -> read -> (read.out)
   *         (read.out) -> goTransform
   *         (read.out) -> pyTransform
   */
  @Test
  public void compositesIgnored() {
    Components components =
        partialComponents
            .toBuilder()
            .putTransforms(
                "read",
                PTransform.newBuilder()
                    .putInputs("input", "impulse.out")
                    .putOutputs("output", "read.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections("read.out", PCollection.newBuilder().setUniqueName("read.out").build())
            .putTransforms(
                "goTransform",
                PTransform.newBuilder()
                    .putInputs("input", "read.out")
                    .putOutputs("output", "go.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.PAR_DO_TRANSFORM_URN)
                            .setPayload(
                                ParDoPayload.newBuilder()
                                    .setDoFn(SdkFunctionSpec.newBuilder().setEnvironmentId("go"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections("go.out", PCollection.newBuilder().setUniqueName("go.out").build())
            .putTransforms(
                "pyTransform",
                PTransform.newBuilder()
                    .putInputs("input", "read.out")
                    .putOutputs("output", "py.out")
                    .setSpec(
                        FunctionSpec.newBuilder()
                            .setUrn(PTransformTranslation.ASSIGN_WINDOWS_TRANSFORM_URN)
                            .setPayload(
                                WindowIntoPayload.newBuilder()
                                    .setWindowFn(
                                        SdkFunctionSpec.newBuilder().setEnvironmentId("py"))
                                    .build()
                                    .toByteString()))
                    .build())
            .putPcollections("py.out", PCollection.newBuilder().setUniqueName("py.out").build())
            .putTransforms(
                "compositeMultiLang",
                PTransform.newBuilder()
                    .putInputs("input", "impulse.out")
                    .putOutputs("pyOut", "py.out")
                    .putOutputs("goOut", "go.out")
                    .addSubtransforms("read")
                    .addSubtransforms("goTransform")
                    .addSubtransforms("pyTransform")
                    .build())
            .build();
    FusedPipeline fused =
        GreedyPipelineFuser.fuse(
            Pipeline.newBuilder()
                .addRootTransformIds("impulse")
                .addRootTransformIds("compositeMultiLang")
                .setComponents(components)
                .build());

    // Impulse is the runner transform
    assertThat(fused.getRunnerExecutedTransforms(), hasSize(1));
    assertThat(fused.getFusedStages(), hasSize(3));
    assertThat(
        fused.getFusedStages(),
        containsInAnyOrder(
            ExecutableStageMatcher.withInput("impulse.out")
                .withOutputs("read.out")
                .withTransforms("read"),
            ExecutableStageMatcher.withInput("read.out")
                .withNoOutputs()
                .withTransforms("pyTransform"),
            ExecutableStageMatcher.withInput("read.out")
                .withNoOutputs()
                .withTransforms("goTransform")));
  }
}

redpajama_set_name: RedPajamaGithub


The size of annual dividends of Kospi-listed firms is likely to jump for the sixth consecutive year this year, partly spurred by the companies' efforts to enhance responsible shareholder engagement since 2017, data showed Tuesday.
The volume of dividends from ordinary shares and preferred shares trading on the Kospi throughout 2018 will unprecedentedly top a combined 30 trillion won ($26.6 billion), unless the year-end dividend shrinks by over 4 percent to 20.9 trillion won compared to the previous year, according to data from the Korea Exchange.
Of some 800 companies whose shares are traded on the Kospi, constituents of the benchmark Kospi 200 index, or the 200 blue-chip shares, are projected to hand out 26.9 trillion won of dividends to shareholders, according to an earlier estimate by Shinhan Financial Investment.
In 2017, the combined volume of interim and year-end dividends reached 26.4 trillion won, also setting an all-time high at the time. Over the past five years since 2012, total annual dividends skyrocketed by 229.5 percent, riding a constant uptrend.
Specifically, there has been a sudden upswing in interim dividends of companies trading on the Kospi. In 2018 alone, the total volume of midyear and quarterly dividends by 36 Kospi-traded companies, including Samsung Electronics, came to 9.1 trillion won. This was nearly double compared to a year prior at 4.6 trillion won and nearly 10 times higher than in 2016, according to data from the Financial Supervisory Service.
Since 1998, Korea has adopted a policy that allows publicly traded companies' midyear dividends. Quarterly dividend payout has been permitted since 2004.
But it was only since 2017 that the volume of interim dividends came under the spotlight.
Notably, market bellwether Samsung Electronics' interim dividend rose sharply, as the figure soared to 7.2 trillion won in 2018, up from 2.9 trillion won in 2017 and 141.6 billion won in 2016.
This comes in line with the tech firm's pledge early this year to raise dividends to some 9.6 trillion won as part of its stronger shareholder return policy, since liberal President Moon Jae-in took office in May 2017. Samsung Electronics distributed dividends worth 5.8 trillion won to investors through the financial year of 2017, up 46 percent compared to a year prior.
Meanwhile, the dividend yield in Korea is also expected to surge, due to high dividend payout coupled with a domestic market slump.
For the past 10 years since 2007, the average dividend yield on the Kospi market had hovered in the 1-1.7 percent range. Chang Hee-jong, an analyst at Hi Investment & Securities, estimated the dividend yield on the Kospi in 2018 to be 2.4 percent on average.
Investors in Korean stocks must obtain at least one share by Wednesday to be granted year-end dividends for the financial year of 2018.


text:
Lepton subtrigonum is een tweekleppigensoort uit de familie van de Lasaeidae. De wetenschappelijke naam van de soort is voor het eerst geldig gepubliceerd in 1873 door Jeffreys in de Folin & Périer.

Lasaeidae

redpajama_set_name: RedPajamaWikipedia


text:
Q: SF Movie containing a psychic girl, a time capsule that is unearthed (or buried?) and lots of numbers The movie was released probably in the latter half of the 2000-2010 period. There is a time capsule that is shown to have been buried earlier and is then unearthed (although I'm not sure of the unearthing part). There is an adolescent girl who encounters a huge set of numbers that mean gibberish to everyone except her and she starts screaming that people are going to die.
NOTE: I don't have a detailed recollection of that movie.

A: I think it's "Knowing" (2009) directed by Alex Proyas and starring Nicholas Cage.

A: This is the 2009 film Knowing, starring Nicolas Cage.
The time capsule was buried in 1959, and contains students' drawings of what the future will look like in fifty years' time. One student, a girl named Lucinda, fills her page with a seemingly nonsensical string of random numbers. When the capsule is opened in 2009, Lucinda's sheet is given to a current pupil at the school, whose father (played by Cage) realises it encodes the dates, locations, and death tolls of every major tragedy within the past fifty years - and some that have not yet occurred.

(Note: I started typing this answer before Martin posted his, and I'm posting it anyway as it's more complete.)

redpajama_set_name: RedPajamaStackExchange


text:
You are here: Home / Fiction / Korach: The Landow Case, by Joseph Cox
Korach: The Landow Case, by Joseph Cox
June 10, 2018 by Joseph Cox 2 Comments
Korach: The Landow Case
Emily Landow slowly walks towards the front of the court room. It isn't technically a court room, of course. It is just a chamber for a hearing. As befits such an administrative function, it isn't large or fancy. It is small, with plain walls and cheap office furniture. Fluorescent lights glare from the low ceiling. There is seating for only a few observers behind a makeshift barrier. In front of the barrier, there are two desks for the attorneys, a slightly raised desk for the judge and a small enclosure with a waist-high barrier meant to hold a witness for questioning. The stenographers that might once have graced such a proceeding have recently been replaced with audio recordings and AI transcriptions of witnesses' testimony.
There is no romance here, just cold, procedural, law.
As Emily walks the short distance to the witness stand, she suddenly identifies the smell that has been permeating her senses. It is the smell of dry rot mixed with human sweat. They have merged, as if the scents of physical and spiritual resignation have both been baked into the fabric of the building.
Emily takes her seat on the tired-looking chair in the witness box. The dull red fabric has worn through in a few places. She takes her seat and looks around the room from her new perspective. The lawyers are still there. The State's attorney looks almost bored. As far as he's concerned, this is just another custody hearing. They've experienced a million of those. Her own attorney looks mildly excited, but she suspects this is his first case.
She looks at the empty rows in the back of the room; there is nobody there to witness her testimony – not even her ex-husband. And then, finally, she looks at the judge. He looks back at her.
He is a large man, with a cold and just slightly disgusted expression.
As she sees his dislike, a chill runs through her. She realizes then that she has never in her life been afraid of a man. But she is afraid of this man. So much lies in the balance; and his power is immeasurable.
She raises her hand and takes her vow – as directed by an automated voice.
Then, the first of the attorneys, the man representing the State, steps forward. He is a haughty-faced middle-aged man who seems to resent her. She turns to face him, anger briefly flashing in her eyes. This is the man trying to take Ethan away from her. But despite her flash of anger, she is not filled with fire and fury. She is filled with prayer. She is praying, silently, that it will all work out.
She is praying because she has so little real hope.
"Is your name Emily Landow?" the attorney asks. It is a pro-forma question. He's been here before. He's done this before. He's just going through the motions.
"Yes," Emily answers, quietly.
"And what is your son's name?"
"Ethan," Emily says. She considers mentioning that she had three sons, but she certainly doesn't want to bring the others into this proceeding.
"Ethan… thank you," says the attorney, almost as if he hadn't known. It is possible he hadn't.
"And Ethan is a down-syndrome child?" continues the attorney.
"No." says Emily, flatly.
"Excuse me?" says the attorney.
The judge peers down at her and in a deep baritone he says, "May I remind you that you are under oath."
It isn't a question.
"Ethan is a child who has down syndrome," says Emily, "He is not a 'down-syndrome' child."
"Okay," says the attorney, glossing over the difference. He doesn't see the humanity in her boy. "How old is Ethan?"
"Six," says Emily.
"According to the records," says the attorney, flipping through a legal pad, "Ethan has had a number of medical issues."
"Yes," says Emily.
"Can you tell the court about a few of them?"
"Yes," says Emily. She'd been ready for this. "He had Tetrology of Fallot, and that has to be corrected every few years while his heart is growing. He has hearing and vision issues. He has a lower than normal intelligence in some respects, although he does some intellectual tasks on par with his peers. He has weight issues and a lack of muscle mass. But he is doing well, in general."
"I see," says the attorney, "Has he ever not 'done well.'"
"Can you tell us about the time he had pneumonia, when he was nine months old."
"Uh, yes," says Emily, "He got sick. He had had heart surgery only a few months before. He was still recovering. When Ethan developed a fever and a cough, I brought him to the hospital. They treated him with antibiotics, but they didn't help much – or at all. And he got quite a bit sicker. Just moving made him hurt. And he was tired and had a hard time breathing. But he came through. He recovered."
Emily ends on an almost hopeful note. She doesn't mention how high his fever had been. Or how bad the cough had been. Or how scared she'd been that he wouldn't live. And she doesn't mention that he'd just laid there, for days – too tired to even protest his pain. She doesn't mention that as she'd watched him, his pain tore at her. She cried then, constantly. And she prayed he would recover. 'Helpful' relatives came and suggested that maybe it would all be for the best if Ethan died. And she shouted at them, and she drove them away. She remembers all of that. But she shares none of it with the court.
"Hmm…" said the attorney, ignoring the positive tone of her voice. "Well, we've heard from medical experts – as have you – that down-syndrome children have weaker immune systems. Do you agree?"
"That's what I've read," says Emily, "But I'm not really an expert."
"But you are an expert on Ethan – on his state of mind?"
"I guess so," says Emily.
"Was Ethan in pain when he had pneumonia?"
"Yes," says Emily. She wants to lie, but she felt that pain. Just remembering it almost brings her to tears on the witness stand. Emily bites her lower lip, trying to bring herself back under control.
"And it is less likely he would have had pneumonia, if he hadn't had down syndrome."
"I suppose so," agrees Emily.
The lawyer flips a page, "Can you tell me about the heart surgery?"
"Was Ethan weak, before the surgery?"
"Can you describe more?"
"Yes," says Emily, reluctantly. She draws in a deep breath, trying to stay narrowly technical. "Ethan was diagnosed with the Tetrology when I was still pregnant with him. It showed up on the ultrasound. Tetrology involves a combination of four heart defects. They had to wait six months for him to be strong enough for the surgery. But then they operated on him, and they repaired the defect."
The attorney nods.
Emily remembers Ethan's time in the Neonatal Intensive Care Unit. He spent months there, hovering on the edge of survival. He was so weak. And he was growing so slowly. He couldn't grow faster. Even as it was, his skin had a bluish pallor, from a lack of oxygen. She prayed for him then, just as she had before. He had survived. As always, Ethan had survived.
"Was he in pain then as well?"
"I think so," says Emily, as flatly as she can manage.
"Does Ethan have intellectual issues?"
"He is different," says Emily.
"How?" demands the attorney.
"He doesn't learn like the other kids. He learns whole words. He sees things differently, that's all. So he doesn't test well, in a normal way."
"Can you tell the court his approximate IQ?"
"I have not let him take an IQ test."
The attorney seems genuinely surprised. "Why not?" he asks.
"Because I don't want to put him in a box. He isn't just a score on a test."
"But everybody else puts him in a box, right?"
"Not everybody."
"Almost everybody," the attorney insists, "How can they not? He looks different, he acts slow. He sticks out."
"Objection," mutters Emily's attorney from the back of the room, "I don't believe the attorney is the one testifying."
"Strike that," says the State's attorney, "Do some other children regard your son as being limited?"
"Do you feel he feels ostracized?"
"No," says Emily. But she knows she is lying. Ethan is the happiest person she knows. She loves to watch him cross a room. His smile is infectious. He is a warm and loving person. But she knows he feels alone. She's seem him crying and bashing the walls in frustration and anger and pain – not physical pain, but something far deeper and more damaging.
Emily closes her eyes, for just a moment.
And then she hears the next question.
"Does Ethan wears hearing aids and glasses?"
"Do his peers?"
"No," says Emily.
"Do you agree that he can't run, that his speech is unclear and that his body is shaped differently?"
"You are aware that State Psychiatric examination has found him to suffer from disruptive and oppositional behavioral patterns?"
"And you still don't think he feels ostracized?"
"No, I don't. He is loved by those who know him."
The attorney nods. He knows she hasn't answered his question.
"Has he been sick, since that pneumonia he had as a baby."
"According to my records, he has been hospitalized 15 times in the last five years. Is this correct?"
"And, in your opinion as his mother, has he been in pain?"
"Yes," says Emily, reluctantly.
"Mrs. Landow," says the attorney, "Are you aware of the TGRT therapy. The Trisome21 Genetic Repair Therapy."
"I am," says Emily.
"Can you describe it to the court?"
"Yes," says Emily. She pauses for a moment and then says, "The TGRT therapy removes the extra copy of chromosome 21 from individuals who have Down Syndrome."
"Does it cure Down Syndrome?"
"It removes it," says Emily.
"Emily," says the attorney, almost condescendingly, "The state is demanding custody of Ethan in order to administer TGRT. We want to cure his down syndrome. Why don't you want to cure his down syndrome?"
"Objection," comes the voice of Emily's attorney, "Leading."
Emily stifles a sigh of relief. For all of her fight against the imposition of TGRT, she doesn't know how to answer the State's attorney's question.
"I'll retract that," says the State's attorney. "My records show you have spent $430,000 – most of it the State's money – on therapy to deal with your son's various health and mental issues. Is this correct?"
"Yes," says Emily, "That seems about right."
"What are you aiming to fix, with all that therapy?"
"I want to help Ethan overcome his physical and mental challenges."
"But you won't allow the state to conduct TGRT therapy?"
"No," says Emily, flatly, "I will not allow it."
She doesn't want the lawyer to challenge her. She has no idea how she can justify her decision. She just feels like somehow, she is protecting her son.
"I want the court to note," the attorney says, turning to the judge, "That by Emily Landow's own admission, her son Ethan is often in pain, has mental challenges and has a wide range of physical disabilities including a severe and recurring heart defect. She also refuses to allow the administration of the TGRT therapy that could repair all of these issues. It is the State's position that this is precisely why Ethan should be placed in State custody, at least for the duration of the treatment and possibly permanently given the troubling and uncaring resistance towards Ethan's well-being that Emily Landow has shown… I have no further questions."
The attorney takes a step back. Emily breaths in again, holding her hands in lap, trying to keep her composure. Anger, fear and pain are all bubbling up against her poorly composed exterior. Somehow, although she can't explain it, she is failing her son.
Her own attorney steps forward. The man is working pro-bono, he is a rookie attorney for a small firm – sacrificing a day's work for a hopeless cause. He is all she could retain. Her hopes, in this impossible fight, rest on the shoulders of a man who looks like he's seventeen.
"I only have a few questions," her attorney states. His voice is high-pitched and immature.
"First," he continues, "Why didn't you abort your son?"
"What?" says Emily, shocked.
"You heard me," says her attorney, "I'm sure many people have asked you this question. Both at the time and now."
"Have you met Ethan?" she asks.
"Yes, briefly," says attorney.
For a moment Emily let's her anger show, "What kind of *** would want to kill that kid?"
"Thank you," says her attorney. Emily just looks at him, even more confused.
"And can you tell me," continues her attorney, "Why are you rejecting the Trisome21 Genetic Replacement Therapy?"
"I don't really know," says Emily. "It just doesn't seem right, somehow. I feel like I'm protecting my son."
Her attorney pauses. And then asks, "At the beginning of your testimony you drew a distinction. You said Ethan was a child who has Down Syndrome, not a Down Syndrome Child."
"Yes," Emily agrees.
"But isn't Down Syndrome a core part of who he is? Isn't a part of his human condition?"
Emily just stares at her attorney. At first, she's confused. But then she realizes that what he's saying is true. All the pain, all the challenges, all the disabilities and all the surgeries and all the fears. They're all a part of Ethan. She can fight them, one by one, but she can't simply repair them – she can't simply erase everything and be left with the same boy in the end.
"Yes," she says, slowly, "The Down Syndrome is a core part of who he is."
Her attorney continues, "So, do you feel that if you eliminate the Down Syndrome, you eliminate the child?"
"Yes," says Emily, surprising herself.
She hadn't thought of it before, but now she knows it. TGRT will kill her baby.
Her attorney asks, "Would you like to share any words, for the record, about what you think of those who want to force TGRT on your boy?"
Emily thinks for a moment. And then she realizes what the young man is asking for.
"Yeah," she says, "I'd like to ask him what kind of *** would want to kill that kid?"
The attorney just smiles.
"I have no more questions," he says, simply. And then he backs away from the bench.
He backs away from the bench and leaves the fate of Ethan Landow in the hands of the all-powerful judge.
In this Torah reading, Korach and his men of name foment a challenge to Moshe's rule. After ignoring the prophecies of Eldad and Meidad and defending Miriam for her gossip against him, Moshe pleads with G-d to reject Korach's usurpation. His specific claim is that he never took a single donkey from the people.
Why does Moshe defend against Korach when he allowed so many others to encroach on his authority? And why does he defend himself in this way?
With the Sin of the Calf, G-d says the people should be condemned because they are stiff-necked. He wants to eliminate them and replace them with a better people. But Moshe argues they should be saved for the same reason. In the simple reading, Moshe convinces Hashem they should be saved because are stiff-necked. Our stiff-necked nature both condemns and protects us.
Tellingly, after the sin of the Calf, we learn we must redeem a first-born donkey. If we fail to do so, we are commanded to axe the back of the donkey's neck. We are the donkey, the most stiff-necked of animals. If we do not redeem ourselves, then we serve no purpose and our necks should be severed.
We are the donkey, for both good and bad.
When Moshe argues that he has not taken one donkey from us, I think he is arguing that he has protected the donkey within us. He does not want us replaced. He wants us, with all our inbuilt shortcomings, to retain our essence.
Moshe fears that Korach and his men of name will not stand up for the imperfect people that we are. He fears that Korach will allow us to be replaced by something new and better – by something fundamentally different.
Moshe fought to have us improve ourselves in a million different ways – from Mitzvot (commandments) to blessings and curses. But when anybody threatens to replace us, Moshe plays the role of the protective mother – expressing his love for our flawed people and condemning those who would challenge our stiff-necked essence.
As we look back over the past 3,000 years, we can see a Jewish people who are small and weak and limited in so many ways. Our history is one of pain and near annihilation punctuated by brief periods of joy and success. Again and again, we have failed to hear G-d or see His miracles. The spiritual blood that pumps through our people does so imperfectly. We are ostracized by others and tortured by our own self-doubt. Even after 3,000 years of therapy, we are a deeply imperfect people.
We suffer from everything that Ethan suffers from.
But this is who we are. And it is only within that history, and it is only within the context of those fundamental challenges, that we can remain to carry out our destiny as the Children of Israel.
It is our obligation to overcome our challenges. But it is our obligation to overcome them, not to eliminate them. To do otherwise would be to erase the essence of our people.
May we see the coming of Moshiach speedily in our days.
p.s. I do not have a child who has Down Syndrome and even if I did, I do no think there would be a right response to the use of something such as TGRT. The appropriateness of even fictional interventions is as varied as the children, and parents, involved. I'm just using this one fictional case as an illustration of the challenges involved.
Joseph Cox lives in Modiin, Israel with his wife and six children and is the author of City on the Heights, a thriller about transforming the Middle East (available on Kindle and via Book Depository).
A teenage refugee flees for her life
and finds hope in the City on the Heights.
Before long, the future of the Middle
East rests on her shoulders.
Check it out at: www.CityontheHeights.com
About Joseph Cox
Rivka Levy says
This is a very powerful piece of writing, and you're an excellent writer. Thanks, Joseph
josephjcox says


text:
Asia Pacific Elections Politics World
Who Will Become the Prime Minister: Narendra Modi or Rahul Gandhi?
May 15, 2019 May 17, 2019 RMN News India, Narendra Modi, Rahul Gandhi
Rahul Gandhi. Photo: Congress
The integrated group of politicians and domain experts – say, the Supreme Council – will jointly take all the decisions in an open, democratic manner.
Even after 70 years of its independence, India continues to be an underdeveloped country. The main reason for India's sluggish progress has been the incompetence of the political class.
Most politicians in India are uneducated or they do not possess the domain expertise of different departments that they are supposed to manage. While ministers are dumb, they are excessively dependent on bureaucrats to handle the routine clerical work.
But bureaucrats are mostly corrupt and they also lack competence to provide the right governance to the Indian citizens who have been living in miserable conditions for the past over 7 decades.
Now it is being observed that India has become a kakistocracy where the government is under the control of the worst, least qualified, and most unscrupulous people.
Troubling Facts and Figures
– World's top magazine The Economist says "a penchant for criminality is an electoral asset in India." The magazine has published data about the political success of India's "accused murderers, blackmailers, thieves, and kidnappers," saying that 34% of India's members of parliament (MPs) in the Lok Sabha have criminal charges filed against them.
– A report by political think-tank Association for Democratic Reforms (ADR) and National Election Watch (NEW) reveals that 31% ministers in Prime Minister Narendra Modi's government have declared criminal cases (such as murder, attempt to murder, kidnapping and crimes against women) against them.
– The 2018 Corruption Perceptions Index (CPI) released by Transparency International reveals that India is among the most corrupt countries of the world.
– Most anti-corruption institutions such as the Central Vigilance Commission (CVC), Central Bureau of Investigation (CBI), and the Supreme Court of India exist as toothless outfits that have repeatedly failed to handle serious crime and corruption cases.
– The Global Slavery Index reveals that India has the maximum number of slaves with 18.35 million people, including men, women, and children, living in some form of slavery.
– A new AirVisual report, which covered 3,000 cities of the world, has revealed that Gurugram (a.k.a. Gurgaon), a suburb of the Indian capital New Delhi, is the most polluted city of the world while 22 of the top 30 polluted cities are in India.
– In World Bank's Human Capital Index released in October 2018, India's rank at 115 is worse than Bangladesh, Nepal, Myanmar, and Haiti.
– The global hunger index (GHI) report released by Washington-based International Food Policy Research Institute (IFPRI) has placed India at No. 100 among 119 developing countries. India's 2017 GHI score is at the high end of the serious category.
– According to World Food Programme, hunger is so severe in India that a quarter of all undernourished people worldwide live in this country.
– According to the World Bank, nearly 300 million people (about 25% of India's population) are so poor that they live on less than $1.25 per day.
– Over 300 million Indians, which is about 25% of India's population, have no access to electricity.
– According to the Inclusive Development Index (IDI), which measures the economic performance of a country and replaces GDP, India is ranked at a very low position of 62.
– As India's human development index (HDI) – which indicates the level of skills in a country – staggers at a dismal rank of 130 in the world – there is hardly any workforce in the country that is employable in any professional job.
– Out of nearly 500 million workers in India, over 94% work in unorganized sector as pushcart vendors, street hawkers, domestic servants, and so on. This means the education systems in India are so bad that they are not producing workforce employable for respectable jobs in the organized enterprises.
– Despite a lot of noise about Bollywood films in India, none of them could ever win the Oscar award.
– In the past four Olympics (2004, 2008, 2012, 2016), India sent 330 athletes who could win only 12 medals including only one gold medal.
– When the developed countries are embracing new employment models based on artificial intelligence (AI), the naive Indian politicians want Indian youth to become Pakora sellers, barbers, and carpenters.
New Governance Model
The facts and figures given above show that no politician and no government in India could achieve even the lowest level of socio-economic development for the country and India is still staggering at the bottom of the pyramid.
If now India wants to join the comity of developing nations, the country must completely change its political processes and governance models. At present, there is no political leader in India who has the ability to lead the country as its prime minister (PM) or head of the country.
New Governance Model for India
The existing governance model, therefore, needs to be overhauled to form a flatter government which will have a group of elected leaders at the same level instead of one person as the PM. While these leaders will not be in a position to provide the modern-day governance because of their naivety, they will be supported by domain experts in fields such as healthcare, education, technology, law, industry, economics, finance, and so on.
The integrated group of politicians and domain experts – say, the Supreme Council – will jointly take all the decisions in an open, democratic manner. They will be fully responsible for their decisions. Domain experts will have proven record of their work at the global level.
After implementing this model, the posts of President and Vice President of India can be terminated because they are a huge liability on the people of India. They are handpicked arbitrarily for these positions by the leader of the ruling party which attains power through a flawed electoral process.
Both President and Vice President are not qualified for the jobs and they squander public money as they keep roaming aimlessly in different parts of the world or keep attending useless award ceremonies. They have no role in the development of the country.
The new competence-based governance model will help ensure decentralization of powers to change the existing despotic system in which the powers are centralized and just one person – the prime minister – can bypass the parliament and take extreme decisions.
The same model can be replicated in different states of India.
← Why Kejriwal's AAP Must Not Win Even a Single Delhi Lok Sabha Seat
Germany to Achieve Carbon Neutrality by the Year 2050 →
Amit Shah Case: Lawyers Say Judge Loya Was Murdered
December 16, 2019 RMN News Comments Off on Amit Shah Case: Lawyers Say Judge Loya Was Murdered
Imran Khan Blames India for Human Rights Violations in Kashmir
July 26, 2018 RMN News Comments Off on Imran Khan Blames India for Human Rights Violations in Kashmir
Prices of Crops Raised by Modi Government: Dr Jitendra Singh
October 6, 2020 RMN News Comments Off on Prices of Crops Raised by Modi Government: Dr Jitendra Singh


We have been searching ahead to even better cooperation with overseas buyers dependant on mutual benefits. Be sure to really feel totally free to speak to us for Infusion Set Assembly Machine , Infusion Set Assembly Machines , Infusion Set Assemble Machine , common development and create a better future.
"We also offer product sourcing and flight consolidation services. We have our own factory and sourcing office. We can provide you with almost every type of product related to our product range for Infusion Set Assembly Machine , Infusion Set Assembly Machines , Infusion Set Assemble Machine , Selling our products and solutions causes no risks and brings high returns to your company instead. It is our consistent pursuit to create value for clients. Our company is looking for agents sincerely. What are you waiting for? Come and join us. Now or never.


Rene is great! If I were in the area I would definitely not miss this. He's a total virtuoso but a really great guy too.
The concert is tonight, TUESDAY APRIL 16. Not sure when that changed or if I had it mixed up all along. In any case, come out and see if you can spot a fellow Delcamper!
Mods, please change thread title if possible.


text:
Q: Determine the set of all values of $ x \in [0, 2 \pi] $
Determine the set of all values of $ x \in [0, 2 \pi] $ that simultaneously satisfy $ \frac {2 \sin ^ 2 x + \sin x-1} {\cos x-1} < 0 $ and $  \tan x + \sqrt {3} < (1+ \sqrt {3} \cot x) \cot x $

My ''solution'':
$\frac{2{{\sin }^{2}}x+\sin x-1}{\cos x-1}<0\Rightarrow 2{{\sin }^{2}}x+\sin x-1>0\Rightarrow \sin x\in \left( \frac{1}{2},1 \right]$ and $\tan x+\sqrt{3}<(1+\sqrt{3}\cot x)\cot x\Leftrightarrow \tan x+\sqrt{3}<\frac{\tan x+\sqrt{3}}{\tan x}\cot x\Leftrightarrow \tan x+\sqrt{3}<\left( \tan x+\sqrt{3} \right)\frac{{{\cos }^{2}}x}{{{\sin }^{2}}x}$

Am I right? Is there any better approach?

A: The first inequality,
$$ \frac {2 \sin ^ 2 x + \sin x-1} {\cos x-1}=\frac{(2\sin x -1)(\sin x+1)}{ \cos x-1}< 0 $$
Then,
$\sin x+1>0,\>\>\>\cos x-1<0 \implies \sin x > \frac12\implies x\in (\frac \pi6,\frac{5\pi}6)\tag{1}$
The second inequality,
$$\tan x+\sqrt{3}<\left( \tan x+\sqrt{3} \right)\cot^2x$$
Case 1.
$\tan x+\sqrt{3}>0,\>\>\>\cot^2x>1 \implies
x\in (0,\frac\pi4),\>(\frac{3\pi}4,\frac{5\pi}4),\>(\frac{7\pi}4,2\pi)\tag{2}$
Case 2.
$\tan x+\sqrt{3}<0,\>\>\>\cot^2x<1 \implies
x\in (\frac{\pi}2,\frac{2\pi}3),\>(\frac{3\pi}2,\frac{5\pi}3)\tag{3}$
Combine (2) and (3),
$x \in (0,\frac\pi4),(\frac\pi2,\frac{2\pi}3),(\frac{3\pi}4,\frac{5\pi}4),(\frac{3\pi}2,\frac{5\pi}3),(\frac{7\pi}4,2\pi)\tag{4}$
Thus, from (1) and (4), determine the set of all values
$$x \in (\frac\pi6,\frac\pi4),(\frac\pi2,\frac{2\pi}3),(\frac{3\pi}4,\frac{5\pi}6)$$


text:
*Duration : 20 mins*

*Persona : API Team / API Product Manager*

# Use case

You have a requirement to apply rate limits (quota limits) dynamically, such that you can package your APIs into different service levels, each with its own quota applied. For example, you want to be able to provide 'Platinum' level access that has a very high quota, and 'Bronze' level access that has a very low quota, both to the same underlying APIs.

# How can Apigee Edge help?

Apigee provides the capability to apply quotas to API Proxies to limit access to them as required.

Apigee also allows you to set API Quota settings at the 'API Product' level, allowing you to define multiple products for the same APIs, each with its own quota settings.

# Pre-requisites

You must have completed the *API Security - Securing APIs using API Keys* lab in order to run this lab.

# Instructions

Note: As you will have already completed the *API Security - Securing APIs using API Keys* lab and are familiar with how to setup API Products and Developer Apps, and how to use the test client to specify an API Key, detailed instructions for those steps will be omitted here. Refer back to the *API Security - Securing APIs using API Keys* lab if you need to see detailed instructions for those steps.

1. Login to Edge Management UI.

2. Open up the **Develop** tab of your Employees API that you used in the previous lab.

3. In the proxy request pre-flow add a **Quota policy** named *Q-EnforceQuotaPerKey* directly after the spike arrest policy. Use the following configuration (note that in the below configuration 'VAK-VerifyKey' refers to the name of the Verify API Key policy that you have in your proxy. If you are using a different name, you will need to replace all occurrences of 'VAK-VerifyKey' in this policy with the name you used for your API key policy):

```
<Quota continueOnError="false" enabled="true" name="Q-EnforceQuotaPerKey" type="calendar">
    <Allow count="10" countRef="verifyapikey.VAK-VerifyKey.apiproduct.developer.quota.limit"/>
    <Interval ref="verifyapikey.VAK-VerifyKey.apiproduct.developer.quota.interval">1</Interval>
    <TimeUnit ref="verifyapikey.VAK-VerifyKey.apiproduct.developer.quota.timeunit">minute</TimeUnit>
    <Identifier ref="verifyapikey.VAK-VerifyKey.client_id"/>
    <Distributed>true</Distributed>
    <Synchronous>true</Synchronous>
    <StartTime>2019-01-01 12:00:00</StartTime>
</Quota>
```

Note the *Identifier* field -- the quota will be enforced per client_id (API key). The *Allow*, *Interval*, and *TimeUnit* fields will take their values from the API product quota configuration.

Also add a condition to the policy that skips the quota check if the request verb is OPTIONS (this is for CORS -- see Lab 4):

```
        <Request>
            <Step>
                <Name>VAK-VerifyKey</Name>
                <Condition>request.verb != "OPTIONS"</Condition>
            </Step>
            <Step>
                <Name>SA-GlobalSpikeArrest</Name>
            </Step>
            <Step>
                <Name>Q-EnforceQuotaPerKey</Name>
                <Condition>request.verb != "OPTIONS"</Condition>
            </Step>
        </Request>
```

Your API Proxy should now look like this:

![image alt text](./media/image_1.png)

4. Press **Save** to save your proxy.

5. Edit the API product that was created before (Employee Product). This will now be the Bronze proxy. Change the display name to **Employee Product - Bronze**.

For the **Bronze** product, specify a quota limit of 1 request per minute:

![image alt text](./media/image_2.png)

Click **Save**.

6. Create a new API Product named **employee-product-platinum**.

Populate the following fields:

    * Section: Product Details

        * Name: employee-product-platinum

        * Display Name: Employee Product - Platinum

        * Description: Platinum Access to the Employee API

        * Environment: test

        * Access: Public

        * Quota: 1000 requests every 1 minute

    * Section: API Resources

        * Section: API Proxies

            * API Proxy: employees-v1

![image alt text](./media/image_3.png)

Click **Save**.

7. Register 2 new Developer Apps, one for each of your products. Record the API Keys for each App.

8. Launch the [REST Test client](https://apigee-restclient.appspot.com/) and run some tests using each API Key. Verify that with the *Bronze* API key that you cannot send in more than 1 request per minute without triggering a quota exceeded exception:

    ![image alt text](./media/image_4.png)

8. Verify with the *Platinum* key that you can send in more than 1 request per minute.

# Lab Video

If you like to learn by watching, here is a short video on setting up dynamic quotas [https://www.youtube.com/watch?v=f9jg1fJJTRE](https://www.youtube.com/watch?v=f9jg1fJJTRE)

# Earn Extra-points

Start a trace session for your API Proxy and use it to determine at what point the quota values specified in the API product are made available within the API Proxy.

# Quiz

1. What would happen if the Quota Policy were placed before the Verify API Key policy?

2. In the configuration we provided the 'Distributed' and 'Synchronous' attributes were both set to 'true'. What is the implication if we set these to 'false'?

3. How would you configure the quota so that POST calls are counted as 2 calls for the purposes of evaluating the quota?

4. What adverse effect could happen for the caller if the quota policy had been put before the spike arrest policy?

# Summary

That completes this hands-on lesson. In this simple lab you learned how to apply a quota to an API Proxy and use API Product configuration to dynamically alter the quota within different contexts.

# References

* Useful Apigee documentation links on quotas -

    * Quota Policy Reference - [https://docs.apigee.com/api-platform/reference/policies/quota-policy](https://docs.apigee.com/api-platform/reference/policies/quota-policy)

    * Community post on setting up dynamic quotas [https://community.apigee.com/questions/1488/how-do-the-quota-settings-on-an-api-product-intera.html](https://community.apigee.com/questions/1488/how-do-the-quota-settings-on-an-api-product-intera.html)

* Watch this 4 minute video on "Dynamic Quotas' - [https://youtu.be/z8Rj_VzSbh4](https://youtu.be/z8Rj_VzSbh4)

# Next step

Now to go [Lab-6](../Lab%206%20API%20Publishing%20-%20Documentation)


Some aspects of public education are in a battle: standardized testing, teacher evaluation, school choice, common core, class size, and more. Every solution is up for a great debate on Twitter, in the editorial section of newspapers, and blogs from Washington, D.C. to Los Angeles, C.A. and everywhere in between. Yet, as these battles take place, I'm worried that the best solutions are not making it to the table. Both sides are publicly seen as arrogant and unwilling to compromise, and this is hurting our kids.
The latest debate at the forefront is "no excuses" as a method to change school culture. Opponents of this school culture model claim that the no excuses approach ignores poverty's stranglehold on schools. Supporters of this model argue that students need to be taught to stop making excuses for their level of academic achievement by working hard, being nice and going to college. Somewhere in the middle is where the answer lies. Yet, again the public conversation is creating another polarizing argument that halts progress.
Opponents of No Excuses: Yes, poverty is the root cause of the problems ailing our nation's most struggling schools and communities. Yes, districts must provide schools with the basic wraparound services to provide an excellent education for our children. Nevertheless, I'm afraid what's missing from your public stance is the acknowledgement that school culture must change in many of our schools.
No excuses is not an approach to combat poverty. It is an attempt to create a positive school culture. If you do not agree with this approach to creating a positive school culture, you must then give solutions about how to create one. By simply saying, "No excuses ignores poverty," you lose a great opportunity to push the school culture debate further.
1. What is the vision of your school?
2. Does your current school culture support your vision of creating a college-going culture?
3. If not, how do we create a college culture in our schools that are not graduating students who go on to college in high numbers?
4. What mindsets do children need to succeed?
5. What does this look like on a whole- school level? Classroom level?
6. As a staff, what will we do to drastically improve our school culture so that are students expect to go to college?
7. What is holding your school back from creating a positive learning environment? Does your school have a whole-school behavior and incentive system? How are you improving attendance? How are you decreasing suspensions?
8. If your school does have an amazing school culture, share it, tweet it, blog about it. What are you doing to share your school's best practices?
Yes, schools must take daring moves to create learning environments that raise expectations and push students to believe college is their route to success in places where going to college is not the norm. Yes, school districts and school leaders have the power to create schools as safe havens that equip our students with the tools they need to beat the odds in their dilapidated neighborhoods. Yes, many schools do a poor job of creating positive learning environments for children.
Nevertheless, what's missing in your argument is the reality that it's not just college banners donning the hallways, college chants echoing from classrooms, or demerit systems that create school culture. Wraparound services, low student to teacher ratios, positive working environments that provide teacher leadership and professional development are also important pieces that work in synchronization to provide our students with the best conditions to achieve at high levels.
1. What is your definition of the "no excuses" approach?
2. How did you come up with this approach as the most effective way to change a school's culture?
3. What does this model look like at the school level? Classroom level?
4. What are the misconceptions of this approach?
5. What are the areas of improvement for the "no excuse" model?
6. How do you create buy-in of this model from staff, students and families?
7. What happens when children challenge this model?
8. What are your student attendance and suspension rates? Have you seen increased attendance and deceased suspensions with this model? If not, what are you doing to improve? If so, what best practices can you share?
Let's all agree to take this debate to the next level. The real work is the action happening in classrooms and schools. We all agree that for far too long we've allowed the children living in our nation's most impoverished neighborhoods to attend schools that have not produced enough students attending college. Although, poverty continues to plague our neighborhoods, and we may not be able to control all the outside factors, we can definitely control what our schools look and feel like once a child enters the doors. Let's discuss concrete solutions that schools can implement in their classrooms to create a school culture where students expect to attend college. Then put them into action. I'm ready to work!