text:
package com.dmonsters.entityProjectile;

import java.util.ArrayList;
import java.util.List;

import com.dmonsters.entity.EntityZombieChicken;
import com.dmonsters.main.ModBlocks;
import com.dmonsters.main.ModItems;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;

public class EntityDagon extends EntityThrowable {

    public EntityDagon(World worldIn)
    {
        super(worldIn);
    }

    public EntityDagon(World worldIn, EntityLivingBase throwerIn)
    {
        super(worldIn, throwerIn);
    }

    public EntityDagon(World worldIn, double x, double y, double z)
    {
        super(worldIn, x, y, z);
    }

	@Override
	protected void onImpact(RayTraceResult result) {
        if (result.entityHit != null)
        {
            result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 5.0F);
        }

        if (!this.world.isRemote) {
        	ItemStack newItem = new ItemStack(ModItems.dagon, 1);
        	EntityItem item = new EntityItem(world, this.posX, this.posY, this.posZ, newItem);
        	world.spawnEntity(item);
        }

        double d0 = 0.08D;

        for (int k = 0; k < 8; ++k)
        {
            this.world.spawnParticle(EnumParticleTypes.CRIT_MAGIC, this.posX, this.posY, this.posZ, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, new int[] {Item.getIdFromItem(Items.EGG)});
        }

        if (!this.world.isRemote)
        {
            this.setDead();
        }
	}
}


text:
.class Lcom/android/server/display/WifiDisplayController$52;
.super Ljava/lang/Object;
.source "WifiDisplayController.java"

# interfaces
.implements Landroid/content/DialogInterface$OnCancelListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/android/server/display/WifiDisplayController;->prepareDialog(I)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/server/display/WifiDisplayController;

# direct methods
.method constructor <init>(Lcom/android/server/display/WifiDisplayController;)V
    .locals 0

    .prologue
    .line 3987
    iput-object p1, p0, Lcom/android/server/display/WifiDisplayController$52;->this$0:Lcom/android/server/display/WifiDisplayController;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onCancel(Landroid/content/DialogInterface;)V
    .locals 2
    .param p1, "arg0"    # Landroid/content/DialogInterface;

    .prologue
    .line 3990
    const-string v0, "WifiDisplayController"

    const-string v1, "[Wait connection]: no choice"

    invoke-static {v0, v1}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 3993
    iget-object v0, p0, Lcom/android/server/display/WifiDisplayController$52;->this$0:Lcom/android/server/display/WifiDisplayController;

    # invokes: Lcom/android/server/display/WifiDisplayController;->disconnectWfdSink()V
    invoke-static {v0}, Lcom/android/server/display/WifiDisplayController;->access$10300(Lcom/android/server/display/WifiDisplayController;)V

    .line 3994
    return-void
.end method

redpajama_set_name: RedPajamaGithub


text:
require 'spec_helper'

describe Post do
  it 'Update the post number of the topic when created' do
    topic = create :topic
    expect((create :post, topic: topic).post_number).to eq 1
    expect((create :post, topic: topic).post_number).to eq 2
  end
end


text:
import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { Routes, Route } from 'react-router-dom';
import Link from './Link';
import Thumbnail from './Thumbnail';
import Icon from './Icon';
import URILink from './URILink';
import TextField from './Fields/TextField';
import SpotifyAuthenticationFrame from './Fields/SpotifyAuthenticationFrame';
import LastfmAuthenticationFrame from './Fields/LastfmAuthenticationFrame';
import GeniusAuthenticationFrame from './Fields/GeniusAuthenticationFrame';
import Snapcast from './Snapcast';
import * as spotifyActions from '../services/spotify/actions';
import * as lastfmActions from '../services/lastfm/actions';
import * as geniusActions from '../services/genius/actions';
import { I18n } from '../locale';
import Button from './Button';
import { useSelector } from 'react-redux';

const SnapcastMenuItem = () => {
  const { enabled, connected } = useSelector(({ snapcast }) => snapcast);
  return (
    <Link
      className="menu-item menu-item--snapcast"
      activeClassName="menu-item--active"
      to="/settings/services/snapcast"
      scrollTo="#services-menu"
    >

        <Icon className="menu-item__icon" name="devices" />

          <I18n path="services.snapcast.title" />

        {!enabled && (

            <I18n path="settings.services.disabled" />

        )}
        {enabled && !connected && (

            <I18n path="settings.services.disconnected" />

        )}
        {enabled && connected && (

            <I18n path="settings.services.connected" />

        )}

    </Link>
  );
}

const SpotifyMenuItem = () => {
  const { enabled, authorization, me } = useSelector(({ spotify }) => spotify);
  const dispatch = useDispatch();

  useEffect(() => {
    if ((enabled || authorization) && !me) {
      dispatch(spotifyActions.getMe());
    }
  }, []);

  return (
    <Link
      className="menu-item menu-item--spotify"
      activeClassName="menu-item--active"
      to="/settings/services/spotify"
      scrollTo="#services-menu"
    >

        {me ? (
          <Thumbnail
            className="menu-item__thumbnail"
            circle
            size="small"
            images={me.images}
          />
        ) : (
          <Thumbnail className="menu-item__thumbnail" circle size="small" />
        )}

          <I18n path="services.spotify.title" />

        {authorization ? (

            <I18n path="settings.services.authorized" />

        ) : (

            <I18n path="settings.services.read_only" />

        )}

    </Link>
  );
}

const LastfmMenuItem = () => {
  const { authorization, me } = useSelector(({ lastfm }) => lastfm);
  const dispatch = useDispatch();

  useEffect(() => {
    if (authorization) dispatch(lastfmActions.getMe());
  }, []);

  return (
    <Link
      className="menu-item menu-item--lastfm"
      activeClassName="menu-item--active"
      to="/settings/services/lastfm"
      scrollTo="#services-menu"
    >

        {me ? (
          <Thumbnail
            className="menu-item__thumbnail"
            circle
            size="small"
            images={me.images}
          />
        ) : (
          <Icon type="fontawesome" name="lastfm" className="menu-item__icon" />
        )}

          <I18n path="services.lastfm.title" />

        {authorization ? (

            <I18n path="settings.services.authorized" />

        ) : (

            <I18n path="settings.services.read_only" />

        )}

    </Link>
  );
}

const GeniusMenuItem = () => {
  const { authorization, me } = useSelector(({ genius }) => genius);
  const dispatch = useDispatch();

  useEffect(() => {
    if (authorization && !me) dispatch(geniusActions.getMe());
  }, []);

  return (
    <Link
      className="menu-item menu-item--genius"
      activeClassName="menu-item--active"
      to="/settings/services/genius"
      scrollTo="#services-menu"
    >

        {me ? (
          <Thumbnail
            className="menu-item__thumbnail"
            circle
            size="small"
            images={me.images}
          />
        ) : (
          <Icon name="genius" type="svg" className="menu-item__icon" />
        )}

          <I18n path="services.genius.title" />

        {authorization ? (

            <I18n path="settings.services.authorized" />

        ) : (

            <I18n path="settings.services.unauthorized" />

        )}

    </Link>
  );
}

const Spotify = () => {
  const { authorization, me, refreshing_token } = useSelector(({ spotify }) => spotify);
  const { locale, country } = useSelector(({ spotify }) => spotify);
  const uri_schemes = useSelector(({ mopidy }) => mopidy.uri_schemes || []);
  const dispatch = useDispatch();

  const onChange = (name, value) => dispatch(spotifyActions.set({ [name]: value }))

  return (

      {uri_schemes.indexOf('spotify:') < 0 && (

            <I18n path="settings.services.spotify.mopidy_spotify_not_running" />

      )}

          <I18n path="settings.services.spotify.country.label" />

          <TextField
            onChange={(value) => onChange('country', value)}
            value={country}
            autosave
          />

            <I18n path="settings.services.spotify.country.description" />

          <I18n path="settings.services.spotify.locale.title" />

          <TextField
            onChange={(value) => onChange('locale', value)}
            value={locale}
            autosave
          />

            <I18n path="settings.services.spotify.locale.description" />

Current user

            {me ? (
              <URILink className="user" type="user" uri={me.uri}>
                <Thumbnail circle size="small" images={me.images} />

                  {me.name || me.id}
                  {!authorization && (

                      {'  '}
                      <I18n path="settings.services.limited_access" />

                  )}

              </URILink>
            ) : (
              <URILink className="user">
                <Thumbnail circle size="small" />

                  <I18n path="settings.services.unknown" />

              </URILink>
            )}

          <I18n path="settings.services.authorization" />

          <SpotifyAuthenticationFrame />
          <Button
            working={refreshing_token}
            onClick={() => dispatch(spotifyActions.refreshingToken())}
            tracking={{ category: 'Spotify', action: 'RefreshToken' }}
          >
            <I18n path="settings.services.refresh_token" />
          </Button>

  );
}

const Lastfm = () => {
  const { authorization, me } = useSelector(({ lastfm }) => lastfm);

  return (

      {authorization ? (

            <I18n path="settings.services.current_user" />

              {me ? (

                  <Thumbnail circle size="small" images={me.images} />

                    {me.name}

              ) : (

                  <Thumbnail circle size="small" />

                    <I18n path="settings.services.unknown" />

              )}

      ) : null}

          <I18n path="settings.services.authorization" />

          <LastfmAuthenticationFrame />

  );
}

const Genius = () => {
  const { authorization, me } = useSelector(({ genius }) => genius);

  return (

      {authorization && (

            <I18n path="settings.services.current_user" />

              {me ? (

                  <Thumbnail circle size="small" images={me.images} />

                    {me.name}

              ) : (

                  <Thumbnail circle size="small" />

                    <I18n path="settings.services.unknown" />

              )}

      )}

          <I18n path="settings.services.authorization" />

          <GeniusAuthenticationFrame />

  );
}

const Menu = () => (

      <SnapcastMenuItem />
      <SpotifyMenuItem />
      <LastfmMenuItem />
      <GeniusMenuItem />

);

const Services = () => (

    <Menu />
    <Routes>
      <Route path="services/spotify" element={<Spotify />} />
      <Route path="services/lastfm" element={<Lastfm />} />
      <Route path="services/genius" element={<Genius />} />
      <Route
        path="services/snapcast/"
        element={(

            <Snapcast />

        )}
      />
      <Route
        path="services/snapcast/:groupId"
        element={(

            <Snapcast />

        )}
      />
    </Routes>

);

export default Services;


text:
package com.spotify.docker;

import com.spotify.docker.client.AnsiProgressHandler;
import com.spotify.docker.client.DockerClient;
import com.spotify.docker.client.DockerException;
import com.spotify.docker.client.ProgressHandler;
import com.spotify.docker.client.messages.ProgressMessage;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import static com.google.common.base.Strings.isNullOrEmpty;
import static java.lang.Thread.sleep;

public class Utils {

  public static String[] parseImageName(String imageName) throws MojoExecutionException {
    if (isNullOrEmpty(imageName)) {
      throw new MojoExecutionException("You must specify an \"imageName\" in your "
                                       + "docker-maven-client's plugin configuration");
    }
    final int lastSlashIndex = imageName.lastIndexOf('/');
    final int lastColonIndex = imageName.lastIndexOf(':');

    // assume name doesn't contain tag by default
    String repo = imageName;
    String tag = null;

    // the name contains a tag if lastColonIndex > lastSlashIndex
    if (lastColonIndex > lastSlashIndex) {
      repo = imageName.substring(0, lastColonIndex);
      tag = imageName.substring(lastColonIndex + 1);
      // handle case where tag is empty string (e.g. 'repo:')
      if (tag.isEmpty()) {
        tag = null;
      }
    }

    return new String[] { repo, tag };
  }

  public static void pushImage(DockerClient docker, String imageName, Log log,
                               final DockerBuildInformation buildInfo,
                               int retryCount, int retryTimeout)
          throws MojoExecutionException, DockerException, IOException, InterruptedException {
    log.info("Pushing " + imageName);
    int attempt = 0;
    do {
      final AnsiProgressHandler ansiProgressHandler = new AnsiProgressHandler();
      final DigestExtractingProgressHandler handler = new DigestExtractingProgressHandler(
              ansiProgressHandler);

      try {
        docker.push(imageName, handler);
      } catch (DockerException e) {
        if (attempt < retryCount) {
          log.warn("Failed to push " + imageName + ", retrying in "
                  + retryTimeout / 1000 + " seconds");
          sleep(retryTimeout);
          continue;
        } else {
          throw e;
        }
      }
      if (buildInfo != null) {
        final String imageNameWithoutTag = parseImageName(imageName)[0];
        buildInfo.setDigest(imageNameWithoutTag + "@" + handler.digest());
      }
      break;
    } while (attempt++ <= retryCount);
  }

  public static void writeImageInfoFile(final DockerBuildInformation buildInfo,
                                        final String tagInfoFile) throws IOException {
    final Path imageInfoPath = Paths.get(tagInfoFile);
    if (imageInfoPath.getParent() != null) {
      Files.createDirectories(imageInfoPath.getParent());
    }
    Files.write(imageInfoPath, buildInfo.toJsonBytes());
  }

  private static class DigestExtractingProgressHandler implements ProgressHandler {

    private final ProgressHandler delegate;
    private String digest;

    DigestExtractingProgressHandler(final ProgressHandler delegate) {
      this.delegate = delegate;
    }

    @Override
    public void progress(final ProgressMessage message) throws DockerException {
      if (message.digest() != null) {
        digest = message.digest();
      }

      delegate.progress(message);
    }

    public String digest() {
      return digest;
    }
  }
}


text:
package org.xtuml.bp.als.oal.test;

import java.util.UUID;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.xtuml.bp.core.Block_c;
import org.xtuml.bp.core.InstanceHandle_c;
import org.xtuml.bp.core.InstanceSet_c;
import org.xtuml.bp.core.LiteralEnumerator_c;
import org.xtuml.bp.core.Statement_c;
import org.xtuml.bp.core.Value_c;
import org.xtuml.bp.core.Variable_c;
import org.xtuml.bp.test.common.BaseTest;
import org.xtuml.bp.test.common.OrderedRunner;

import antlr.RecognitionException;
import antlr.TokenStreamException;
import junit.framework.TestCase;

@RunWith(OrderedRunner.class)
public class TestStructuredDataType_Generics extends TestCase {

    // This test class just tests the *negative* cases where we expect to find
    // syntax errors.  The positive cases where no errors should be found it
    // covered by the "sdt_test.xtuml" model.  It fully exercises all valid
    // uses of SDTs in BP.  It is ran as part of the "Parse All" unit tests
    // defined in ParseAllInDomain.java.

    @Before
	public void setUp() throws Exception {
        super.setUp();
    }

    @After
	public void tearDown() throws Exception {
        try {
            super.tearDown();
            OalParserTest_Generics.tearDownActionData();
        } catch (RecognitionException re) {
            // do nothing
        } catch (TokenStreamException te) {
            // do nothing
        }
    }

    // Test some invalid assignments using SDTs
    @Test
	public void testAssignTypeMismatchBool2SDT() throws RecognitionException,
            TokenStreamException {
        UUID personId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Person");//$NON-NLS-1$
        UUID boolId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "boolean");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = t.sdt_identity;\ny = true;\nx = y;\n ",
                personId, boolId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchEnum2SDT() throws RecognitionException,
            TokenStreamException {
        UUID personId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Person");//$NON-NLS-1$
        UUID fruitId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "fruit");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = t.sdt_identity;\ny = fruit::apple;\nx = y;\n ",
                personId, fruitId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchInt2SDT() throws RecognitionException,
            TokenStreamException {
        UUID personId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Person");//$NON-NLS-1$
        UUID intId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "integer");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = t.sdt_identity;\ny = 12;\nx = y;\n ",
                personId, intId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchReal2SDT() throws RecognitionException,
            TokenStreamException {
        UUID personId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Person");//$NON-NLS-1$
        UUID realId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "real");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = t.sdt_identity;\ny = 2.2;\nx = y;\n ",
                personId, realId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchString2SDT() throws RecognitionException,
            TokenStreamException {
        UUID personId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Person");//$NON-NLS-1$
        UUID stringId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "string");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = t.sdt_identity;\ny = \"test\";\nx = y;\n ",
                personId, stringId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchString2UDT() throws RecognitionException,
            TokenStreamException {
        UUID personId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Person");//$NON-NLS-1$
        UUID udt_booleanId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "udt_boolean");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = t.sdt_identity;\ny = t.u_bool;\nx = y;\n ",
                personId, udt_booleanId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchSDT2Bool() throws RecognitionException,
            TokenStreamException {
        UUID boolId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "boolean");//$NON-NLS-1$
        UUID animalId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Animal");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = false;\ny = t.sdt_pet1;\nx = y;\n ",
                boolId, animalId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchSDT2Enum() throws RecognitionException,
            TokenStreamException {
        UUID fruitId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "fruit");//$NON-NLS-1$
        UUID animalId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Animal");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = fruit::orange;\ny = t.sdt_pet1;\nx = y;\n ",
                fruitId, animalId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchSDT2Int() throws RecognitionException,
            TokenStreamException {
        UUID intId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "integer");//$NON-NLS-1$
        UUID animalId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Animal");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = 1;\ny = t.sdt_pet1;\nx = y;\n ",
                intId, animalId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchSDT2Real() throws RecognitionException,
            TokenStreamException {
        UUID realId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "real");//$NON-NLS-1$
        UUID animalId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Animal");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = 12.2;\ny = t.sdt_pet1;\nx = y;\n ",
                realId, animalId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchSDT2String() throws RecognitionException,
            TokenStreamException {
        UUID stringId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "string");//$NON-NLS-1$
        UUID animalId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Animal");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = \"foo\";\ny = t.sdt_pet1;\nx = y;\n ",
                stringId, animalId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchSDT2UDT() throws RecognitionException,
            TokenStreamException {
        UUID udt_booleanId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "udt_boolean");//$NON-NLS-1$
        UUID animalId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Animal");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = t.u_bool;\ny = t.sdt_pet1;\nx = y;\n ",
                udt_booleanId, animalId, 2, 1, 0); //$NON-NLS-1$
    }
    @Test
	public void testAssignTypeMismatchSDT_A2SDT_B() throws RecognitionException,
            TokenStreamException {
        UUID personId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Person");//$NON-NLS-1$
        UUID animalId = BaseTest.getTypeID_Generic(OalParserTest_Generics.modelRoot, "Animal");//$NON-NLS-1$

        assignTypeMismatchTest(
                "select any t from instances of D_TST;\nx = t.sdt_identity;\n y = t.sdt_pet1;\nx = y;\n ",
                personId, animalId, 2, 1, 0); //$NON-NLS-1$
    }

    // Test invalid assignment of an SDT member
	@Test
	public void testAssignBool2SDTstring() throws RecognitionException, TokenStreamException {
        String act = "select any t from instances of D_TST;\nt.sdt_identity.name = false;"; //$NON-NLS-1$
		String x = OalParserTest_Generics.parseAction(act, OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM);
		String lines[] = x.split("\n");//$NON-NLS-1$
		assertEquals(2, lines.length);
		assertEquals(":2:23-27: Variable ->name<- already exists as a different type", lines[0]);//$NON-NLS-1$
		assertEquals("line 2:29: expecting Semicolon, found 'null'", lines[1]);//$NON-NLS-1$
		OalParserTest_Generics.validateBlkStmtVal( 1, 1, 3 );
		Variable_c [] vars = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
		assertEquals( 1, vars.length );
		OalParserTest_Generics.clearActionData(OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM);
	}
    @Test
	public void testAssignEnum2SDTstring() throws RecognitionException, TokenStreamException {
        String act = "select any t from instances of D_TST;\nt.sdt_identity.name = fruit::apple;"; //$NON-NLS-1$
        String x = OalParserTest_Generics.parseAction(act, OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM);
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(2, lines.length);
        assertEquals(":2:30-34: Variable ->name<- already exists as a different type", lines[0]);//$NON-NLS-1$
        assertEquals("line 2:36: expecting Semicolon, found 'null'", lines[1]);//$NON-NLS-1$
        OalParserTest_Generics.validateBlkStmtVal( 1, 1, 3 );
        Variable_c [] vars = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals( 1, vars.length );
        OalParserTest_Generics.clearActionData(OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM);
    }
    @Test
	public void testAssignInt2SDTstring() throws RecognitionException, TokenStreamException {
        String act = "select any t from instances of D_TST;\nt.sdt_identity.name = 1;"; //$NON-NLS-1$
        String x = OalParserTest_Generics.parseAction(act, OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM);
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(2, lines.length);
        assertEquals(":2:23-23: Variable ->name<- already exists as a different type", lines[0]);//$NON-NLS-1$
        assertEquals("line 2:25: expecting Semicolon, found 'null'", lines[1]);//$NON-NLS-1$
        OalParserTest_Generics.validateBlkStmtVal( 1, 1, 3 );
        Variable_c [] vars = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals( 1, vars.length );
        OalParserTest_Generics.clearActionData(OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM);
    }
    @Test
	public void testAssignReal2SDTstring() throws RecognitionException, TokenStreamException {
        String act = "select any t from instances of D_TST;\nt.sdt_identity.name = 2.0;"; //$NON-NLS-1$
        String x = OalParserTest_Generics.parseAction(act, OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM);
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(2, lines.length);
        assertEquals(":2:23-25: Variable ->name<- already exists as a different type", lines[0]);//$NON-NLS-1$
        assertEquals("line 2:27: expecting Semicolon, found 'null'", lines[1]);//$NON-NLS-1$
        OalParserTest_Generics.validateBlkStmtVal( 1, 1, 3 );
        Variable_c [] vars = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals( 1, vars.length );
        OalParserTest_Generics.clearActionData(OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM);
    }
    @Test
	public void testAssignUDT2SDTstring() throws RecognitionException, TokenStreamException {
        String act = "select any t from instances of D_TST;\nt.sdt_identity.name = t.u_bool;"; //$NON-NLS-1$
        String x = OalParserTest_Generics.parseAction(act, OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM);
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(2, lines.length);
        assertEquals(":2:25-30: Variable ->name<- already exists as a different type", lines[0]);//$NON-NLS-1$
        assertEquals("line 2:32: expecting Semicolon, found 'null'", lines[1]);//$NON-NLS-1$
        OalParserTest_Generics.validateBlkStmtVal( 1, 1, 4 );
        Variable_c [] vars = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals( 1, vars.length );
        OalParserTest_Generics.clearActionData(OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM);
    }

    // Test comparison operations on SDTs
    @Test
	public void testRelExprSDTNeOtherSDT() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics.parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity != t.sdt_pet1;", OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:25-32: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:34: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(3, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTEqOtherSDT() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics.parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity == t.sdt_pet1;",
                        OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:25-32: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:34: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(3, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTNeBool() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics.parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity != false;", OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:23-27: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:29: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTNeEnum() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics
                .parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity != fruit::orange;", OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:30-35: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:37: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTNeInt() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics
                .parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity != 1;", OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:23-23: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:25: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTNeReal() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics
                .parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity != 42.2;", OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:23-26: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:28: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTNeString() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics
                .parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity != \"foo\";", OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:23-27: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:29: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTNeUDT() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics
                .parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity != t.u_bool;", OalParserTest_Generics.ACTIVITY_TYPE_FUNC, OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:25-30: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:32: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(3, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTEqBool() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics
                .parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity == true;",
                        OalParserTest_Generics.ACTIVITY_TYPE_FUNC,
                        OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:23-26: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:28: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTEqEnum() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics
                .parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity == fruit::apple;",
                        OalParserTest_Generics.ACTIVITY_TYPE_FUNC,
                        OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:30-34: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:36: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTEqInt() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics.parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity == 42;",
                        OalParserTest_Generics.ACTIVITY_TYPE_FUNC,
                        OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:23-24: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:26: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTEqReal() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics
                .parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity == 42.3;",
                        OalParserTest_Generics.ACTIVITY_TYPE_FUNC,
                        OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:23-26: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:28: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTEqString() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics
                .parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity == \"bar\";",
                        OalParserTest_Generics.ACTIVITY_TYPE_FUNC,
                        OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:23-27: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:29: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }
    @Test
	public void testRelExprSDTEqUDT() throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics
                .parseAction(
                        "select any t from instances of D_TST;\nx = t.sdt_identity == t.u_bool;",
                        OalParserTest_Generics.ACTIVITY_TYPE_FUNC,
                        OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n");//$NON-NLS-1$
        assertEquals(
                ":2:25-30: Incompatible operands for relational expression", lines[0]); //$NON-NLS-1$
        assertEquals("line 2:32: expecting Semicolon, found 'null'", lines[1]); //$NON-NLS-1$
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(2, t.length);
        Value_c[] val = Value_c.ValueInstances(OalParserTest_Generics.modelRoot);
        assertEquals(3, val.length);
        LiteralEnumerator_c[] len = LiteralEnumerator_c
                .LiteralEnumeratorInstances(OalParserTest_Generics.modelRoot);
        assertEquals(0, len.length);
    }

    // Functions that support the tests above
    public void assignTypeMismatchTest(String stmts, UUID dt1, UUID dt2,
            int numTV, int numIRV, int numIRS) throws RecognitionException,
            TokenStreamException {
        String x = OalParserTest_Generics.parseAction(stmts,
                OalParserTest_Generics.ACTIVITY_TYPE_FUNC,
                OalParserTest_Generics.TEST_VOID_NO_PARM); //$NON-NLS-1$
        String lines[] = x.split("\n"); //$NON-NLS-1$
        assertEquals(
                ":4:5-5: Variable ->x<- already exists as a different type", lines[0]); //$NON-NLS-1$
        Block_c[] blk = Block_c.BlockInstances(OalParserTest_Generics.modelRoot);
        assertEquals(1, blk.length);
        Statement_c[] st = Statement_c
                .StatementInstances(OalParserTest_Generics.modelRoot);
        assertEquals(3, st.length);
        Variable_c[] t = Variable_c.VariableInstances(OalParserTest_Generics.modelRoot);
        assertEquals(3, t.length);
        assertEquals("x", t[1].getName()); //$NON-NLS-1$
        assertEquals("y", t[2].getName()); //$NON-NLS-1$

        InstanceHandle_c[] iv = InstanceHandle_c.InstanceHandleInstances(OalParserTest_Generics.modelRoot);
        assertEquals(numIRV, iv.length);
        InstanceSet_c[] isv = InstanceSet_c
                .InstanceSetInstances(OalParserTest_Generics.modelRoot);
        assertEquals(numIRS, isv.length);
    }

}


text:
//! Evaluates potential evapotranpiration (PET) using Priestley & Taylor formulation.
/*!

This implementation is based on models provided in the PRMS-IV, Version 4, see
pages 90-93, Equations 1-57 to 1-60

Requires the following dependencies:

.. _pet-priestley-taylor-evaluator-spec:
.. admonition:: pet-priestley-taylor-evaluator-spec:

   * `"include limiter`" ``[bool]`` **false** If true, multiply potential ET by
     a limiter to get an actual ET.
   * `"limiter number of dofs`" ``[int]`` **1** Area fractions are often used
     as limiters, and these have multiple dofs.  This provides how many.
   * `"limiter dof`" ``[int]`` **0** Area fractions are often used
     as limiters, and these have multiple dofs.  This provides which one to use.
   * `"include 1 - limiter`" ``[bool]`` **false** If true, multiply potential
     ET by 1 - a limiter (e.g. a limiter that partitions between two pools) to
     get actual ET.
   * `"1 - limiter number of dofs`" ``[int]`` **1** Area fractions are often used
     as limiters, and these have multiple dofs.  This provides how many.
   * `"1 - limiter dof`" ``[int]`` **0** Area fractions are often used
     as limiters, and these have multiple dofs.  This provides which one to use.
   * `"sublimate snow`" ``[bool]`` **false** If true, use latent heat of
      vaporization of snow, not water.

   KEYS:
   - `"air temperature`" **DOMAIN-air_temperature** Air temp, in [K]
   - `"surface temperature`" **DOMAIN-temperature** Ground or leaf temp, in [K].  Note this may be the
      same as air temperature.
   - `"relative humidity`" **DOMAIN-relative_humidity** [-]
   - `"elevation`" **DOMAIN-elevation** Elevation [m]
   - `"net radiation`" **DOMAIN-net_radiation** [W m^-2] Net radiation balance, positive to the ground.
   - `"limiter`" [-] See `"include limiter`" above.
   - `"1 - limiter`" [-] See `"include 1 - limiter`" above.

*/

#pragma once

#include "Factory.hh"
#include "EvaluatorSecondaryMonotype.hh"
#include "LandCover.hh"

namespace Amanzi {
namespace SurfaceBalance {
namespace Relations {

namespace PriestleyTaylor {

//
// PRMS-IV eqn 1-59, calculates ground heat flux density in units of
// [MJ m^-2 d^-1] given a daily-averaged ground and air temperature
// (in C or K).  We convert to W/m^2
//
double groundHeatFlux(double temp_ground, double temp_air);

//
// PRMS-IV eqn 1-58, calculates the slope of vapor pressure as a function of
// daily averaged air temperature [K], in [KPa C^-1]
//
double vaporPressureSlope(double temp_air);

//
// PRMS-IV eqn 1-57, calculates the psychrometric constant in [KPa C^-1] as a
// function of an elevation (lapse rate fixed) and a latent heat of
// vaporization in [cal gm^-1].
//
double psychrometricConstant(double lh_vap, double evel);

//
// PRMS-IV eqn 1-51, calculates the latent heat of vaporization [cal g^-1] as a
// function of the daily averaged air temperature [K] for liquid water
//
double latentHeatVaporization_water(double temp_air);

//
// PRMS-IV eqn 1-51, calculates the latent heat of vaporization [cal g^-1] as a
// function of the daily averaged air temperature [K] for snow -- note this is
// currently the same as the water value, but should get modified for snow!
//
double latentHeatVaporization_snow(double temp_air);

} // namespace PriestleyTaylor

class PETPriestleyTaylorEvaluator : public EvaluatorSecondaryMonotypeCV {

 public:
  explicit PETPriestleyTaylorEvaluator(Teuchos::ParameterList& plist);
  PETPriestleyTaylorEvaluator(const PETPriestleyTaylorEvaluator& other) = default;
  virtual Teuchos::RCP<Evaluator> Clone() const override {
    return Teuchos::rcp(new PETPriestleyTaylorEvaluator(*this));
  }

 protected:
  virtual void EnsureCompatibility_ToDeps_(State& S) override;

  // Required methods from EvaluatorSecondaryMonotypeCV
  virtual void Evaluate_(const State& S,
          const std::vector<CompositeVector*>& result) override;
  virtual void EvaluatePartialDerivative_(const State& S,
          const Key& wrt_key, const Tag& wrt_tag, const std::vector<CompositeVector*>& result) override;

 protected:
  Key domain_;
  Key evap_type_;
  Key air_temp_key_;
  Key surf_temp_key_;
  Key rel_hum_key_;
  Key elev_key_;
  Key rad_key_;
  Key limiter_key_;
  Key one_minus_limiter_key_;

  double pt_alpha_;
  bool limiter_, one_minus_limiter_;
  int limiter_nvecs_, one_minus_limiter_nvecs_;
  int limiter_dof_, one_minus_limiter_dof_;
  bool compatible_;

  LandCoverMap land_cover_;

 private:
  static Utils::RegisteredFactory<Evaluator,PETPriestleyTaylorEvaluator> reg_;

};

} //namespace
} //namespace
} //namespace


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.ai.metricsadvisor.implementation.models;

import com.azure.ai.metricsadvisor.models.AnomalyAlert;
import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The AlertResultList model. */
@Fluent
public final class AlertResultList {
    /*
     * The @nextLink property.
     */
    @JsonProperty(value = "@nextLink", access = JsonProperty.Access.WRITE_ONLY)
    private String nextLink;

    /*
     * The value property.
     */
    @JsonProperty(value = "value", required = true)
    private List<AnomalyAlert> value;

    /**
     * Get the nextLink property: The @nextLink property.
     *
     * @return the nextLink value.
     */
    public String getNextLink() {
        return this.nextLink;
    }

    /**
     * Get the value property: The value property.
     *
     * @return the value value.
     */
    public List<AnomalyAlert> getValue() {
        return this.value;
    }

    /**
     * Set the value property: The value property.
     *
     * @param value the value value to set.
     * @return the AlertResultList object itself.
     */
    public AlertResultList setValue(List<AnomalyAlert> value) {
        this.value = value;
        return this;
    }
}


text:
function Add-VSPinpointSegmentAttributeDimension {
    <#
    .SYNOPSIS
        Adds an AWS::Pinpoint::Segment.AttributeDimension resource property to the template. Specifies attribute-based criteria for including or excluding endpoints from a segment.

    .DESCRIPTION
        Adds an AWS::Pinpoint::Segment.AttributeDimension resource property to the template.
Specifies attribute-based criteria for including or excluding endpoints from a segment.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpoint-segment-attributedimension.html

    .PARAMETER AttributeType
        The type of segment dimension to use. Valid values are: INCLUSIVE, endpoints that match the criteria are included in the segment; and, EXCLUSIVE, endpoints that match the criteria are excluded from the segment.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpoint-segment-attributedimension.html#cfn-pinpoint-segment-attributedimension-attributetype
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Values
        The criteria values to use for the segment dimension. Depending on the value of the AttributeType property, endpoints are included or excluded from the segment if their attribute values match the criteria values.

        PrimitiveItemType: String
        Type: List
        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpoint-segment-attributedimension.html#cfn-pinpoint-segment-attributedimension-values
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>
    [OutputType('Vaporshell.Resource.Pinpoint.Segment.AttributeDimension')]
    [cmdletbinding()]
    Param
    (
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $AttributeType,
        [parameter(Mandatory = $false)]
        $Values
    )
    Begin {
        $obj = [PSCustomObject]@{}
        $commonParams = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable')
    }
    Process {
        foreach ($key in $PSBoundParameters.Keys | Where-Object {$commonParams -notcontains $_}) {
            switch ($key) {
                Default {
                    $obj | Add-Member -MemberType NoteProperty -Name $key -Value $PSBoundParameters.$key
                }
            }
        }
    }
    End {
        $obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.Pinpoint.Segment.AttributeDimension'
        Write-Verbose "Resulting JSON from $($MyInvocation.MyCommand): `n`n$($obj | ConvertTo-Json -Depth 5)`n"
    }
}


text:
package com.hn.nishant.nvhn.view.adapter;

import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.support.v4.util.ArrayMap;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.hn.nishant.nvhn.R;
import com.hn.nishant.nvhn.dao.StoryDao;
import com.hn.nishant.nvhn.model.Story;
import com.hn.nishant.nvhn.network.FireBaseImpl;
import com.hn.nishant.nvhn.view.activity.BrowseActivity;
import com.hn.nishant.nvhn.view.activity.CommentsActivty;
import com.hn.nishant.nvhn.view.custom.CommentCountView;

import org.greenrobot.eventbus.EventBus;

import java.util.List;

import io.realm.OrderedCollectionChangeSet;
import io.realm.OrderedRealmCollectionChangeListener;
import io.realm.RealmResults;

/**
 * Created by nishant on 15.03.17.
 */

public class StoryAdapter extends RecyclerView.Adapter<StoryAdapter.StoryHolder>
        implements OrderedRealmCollectionChangeListener<RealmResults<Story>> {

    private LayoutInflater inflater;

    protected RealmResults<Story> itemList;

    private ArrayMap<Integer, Integer> changeTracker = new ArrayMap<>();
    private ArrayMap<Integer, Integer> posTracker = new ArrayMap<>();

    public StoryAdapter(Context context, RealmResults<Story> itemList) {
        inflater = LayoutInflater.from(context);
        this.itemList = itemList;
        this.itemList.addChangeListener(this);
    }

    public void setNewData(RealmResults<Story> itemList){
        this.itemList = itemList;
        this.itemList.addChangeListener(this);
    }

    @Override
    public StoryHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        if (viewType == 2) {
            return new ProgressBarHolder(inflater.inflate(R.layout.progress_layout, parent, false));
        }
        return new StoryHolder(inflater.inflate(R.layout.drag_item_view, parent, false));
    }

    @Override
    public int getItemViewType(int position) {
        return itemList.get(position).getId() == StoryDao.DEFALUT_ITEM_ID ? 2 : 1;
    }

    @Override
    public void onBindViewHolder(StoryHolder holder, int position, List<Object> payloads) {
        if (payloads.size() == 0) {
            onBindViewHolder(holder, position);
        } else {
            holder.commentCountView.setCommentCount((Integer) payloads.get(0));
        }
    }

    @Override
    public void onBindViewHolder(final StoryHolder holder, int position) {
        if (holder instanceof ProgressBarHolder) {
            return;
        }
        Story story = itemList.get(position);
        holder.text.setText(itemList.get(position).getTitle());
        holder.time.setText(FireBaseImpl.getTimeDiff(story.getTime()) +" ago by " +
                itemList.get(position).getBy() +" with "+itemList.get(position).getScore()+" points");
        holder.commentCountView.setCommentCount(itemList.get(position).getDescendants());
    }

    @Override
    public long getItemId(int position) {
        return itemList.get(position).getId();
    }

    @Override
    public int getItemCount() {
        return itemList.size();
    }

    public class StoryHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

        TextView text;
        TextView time;
        public CommentCountView commentCountView;
        public View view;
        ImageView shareBtn;
        ImageView userDetailBtn;

        StoryHolder(View view) {
            super(view);
            commentCountView = (CommentCountView)view.findViewById(R.id.ivComment);
            text = (TextView) view.findViewById(R.id.article_title);
            time = (TextView) view.findViewById(R.id.article_time);
            shareBtn = (ImageView) view.findViewById(R.id.ivShare);
            userDetailBtn = (ImageView) view.findViewById(R.id.ivUpVote);
            userDetailBtn.setOnClickListener(this);
            shareBtn.setOnClickListener(this);
            commentCountView.setOnClickListener(this);
            this.view = view.findViewById(R.id.storyItemView);
            this.view.setOnClickListener(this);
        }

        @Override
        public void onClick(View v) {
            if(v.getId() == R.id.ivShare){
                Intent intent = new Intent();
                intent.setAction(Intent.ACTION_SEND);
                intent.putExtra(Intent.EXTRA_TEXT, itemList.get(getAdapterPosition()).getUrl());
                intent.setType("text/plain");
                v.getContext().startActivity(intent);
                return;
            }

            if(v.getId() == R.id.storyItemView){
                EventBus.getDefault().post(getItemAtPosition(getAdapterPosition()));
                return;
            }

            if(v.getId() == R.id.ivUpVote){
                EventBus.getDefault().post(getItemAtPosition(getAdapterPosition()).getBy());
                return;
            }
            Intent intent = new Intent(v.getContext(),CommentsActivty.class);
            intent.putExtra("storyId", getItemAtPosition(getAdapterPosition()).getId());
            v.getContext().startActivity(intent);
        }
    }

    class ProgressBarHolder extends StoryHolder {

        ProgressBar progressBar;

        ProgressBarHolder(View view) {
            super(view);
            progressBar = (ProgressBar) view.findViewById(R.id.progress);
        }
    }

    protected LayoutInflater getInflater() {
        return inflater;
    }

    protected Story getItemAtPosition(int pos) {
        return itemList.get(pos);
    }

    @Override
    public void onChange(final RealmResults<Story> collection, final OrderedCollectionChangeSet changeSet) {
        if (changeSet != null) {

            for (int i = changeSet.getDeletionRanges().length - 1; i >= 0; i--) {
                notifyItemRangeRemoved(changeSet.getDeletionRanges()[i].startIndex,
                        changeSet.getDeletionRanges()[i].length);
            }

            for (int i = 0; i < changeSet.getInsertionRanges().length; i++) {
                notifyItemRangeInserted(changeSet.getInsertionRanges()[i].startIndex,
                        changeSet.getInsertionRanges()[i].length);
            }

            for (int i = 0; i < changeSet.getChangeRanges().length; i++) {
                for (int j = changeSet.getChangeRanges()[i].startIndex; j < changeSet.getChangeRanges()[i].startIndex +
                        changeSet.getChangeRanges()[i].length && j <posTracker.size(); j++) {
                    System.out.println("index " +j + " pos tracker" +posTracker.size());
                    if (posTracker.get(j).intValue() == collection.get(j).getId()) {
                        if (isChanged(collection.get(j).getId(), collection.get(j).getDescendants())) {
                            notifyItemChanged(j, collection.get(j).getDescendants());
                        }
                    } else {
                        notifyItemChanged(j);
                    }
                }
            }

        } else {
            notifyDataSetChanged();
        }
        updateChangeTracker();
    }

    public void onDestroy() {
        itemList.removeChangeListener(this);
    }

    private void updateChangeTracker() {
        changeTracker.clear();
        posTracker.clear();
        for (int i = 0; i < itemList.size(); i++) {
            changeTracker.put(itemList.get(i).getId(), itemList.get(i).getDescendants());
            posTracker.put(i, itemList.get(i).getId());
        }
    }

    private boolean isChanged(int id, int newVal) {
        if (changeTracker.get(id) == null) {
            return true;
        }
        return changeTracker.get(id).intValue() != newVal;
    }

}


text:
package zhongqiu.common.base.thread;

//Volatile修饰符

//http://www.cnblogs.com/wangzhongqiu/p/6475357.html
/*
 * Volatile 修饰的成员变量在每次被线程访问时,都强制从共享内存中重新读取该成员变量的值。而且,当成员变量发生变化时,会强制线程将变化值回写到共享内存。
 * 这样在任何时刻,两个不同的线程总是看到某个成员变量的同一个值。
 * 一个 volatile 对象引用可能是 null。
*/

import zhongqiu.common.base.MathRandomDemo;

import java.util.Hashtable;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class VolatileDemo {
    /*
     * 常情况下,在一个线程调用 run() 方法(在 Runnable 开启的线程),在另一个线程调用 stop() 方法。 如果 第一行 中缓冲区的
     * active 值被使用,那么在 第二行 的 active 值为 false 时循环不会停止。 但是以上代码中我们使用了 volatile 修饰
     * active,所以该循环会停止。
     */
    public static Hashtable<String, Integer> num = new Hashtable<>();

    public static class Model {
        Integer a;
        Integer b;
    }

    public  Model model;

    public Model getModel() {
        return model;
    }

    public void setModel(Model model) {
        this.model = model;
    }

    public void init() {
        model.a = 1;
        model.b = 2;
    }

    public void change() {
        model.a = 3;
        model.b = model.a;
    }

    public void print() {
        String key = model.a.toString() + model.b.toString();
        if (num.keySet().contains(key)) {
            num.put(key, num.get(key) + 1);
        } else {
            num.put(key, 1);
        }
    }

    public static void test1() {
        final VolatileDemo test = new VolatileDemo();
        VolatileDemo.Model model = new VolatileDemo.Model();
        model.a = 1;
        model.b = 2;
        test.setModel(model);
        ExecutorService fixedThreadPool = Executors.newFixedThreadPool(1);
        ExecutorService fixedThreadPool1 = Executors.newFixedThreadPool(1);
        ExecutorService fixedThreadPool2 = Executors.newFixedThreadPool(1);
        for (int i = 0; i < 1; i++) {
            fixedThreadPool.execute(new Runnable() {
                @Override
                public void run() {
                    while (true) {
                        test.change();
                    }
                }
            });
            fixedThreadPool1.execute(new Runnable() {
                @Override
                public void run() {
                    while (true) {
                        test.init();
                    }
                }
            });
            fixedThreadPool2.execute(new Runnable() {
                @Override
                public void run() {
                    while (true) {
                        test.print();
                    }
                }
            });
        }
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        for (Map.Entry entry : num.entrySet()) {
            System.out.println("key:" + entry.getKey() + "--value:" + entry.getValue());
        }
    }

    public static void main(String[] args) {
        test1();
    }
}


text:
package us.dot.its.jpo.ode.eventlog;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class EventLogger {
	public final static Logger logger = LoggerFactory.getLogger(EventLogger.class);
}


text:
title: Delete Properties from a JavaScript Object
localeTitle: Удаление свойств из объекта JavaScript
---
## Удаление свойств из объекта JavaScript

### ПОДСКАЗКА: 1

*   измените свойства myDog с помощью точечной нотации

# ПРЕДУПРЕЖДЕНИЕ SPOILER: РЕШЕНИЕ ВПЕРЕДИ

```javascript
var ourDog = {
  "name": "Camper",
  "legs": 4,
  "tails": 1,
  "friends": ["everything!"],
  "bark": "bow-wow"
 };

 delete ourDog.bark;

 // Setup
 var myDog = {
  "name": "Happy Coder",
  "legs": 4,
  "tails": 1,
  "friends": ["freeCodeCamp Campers"],
  "bark": "woof"
 };

 // Only change code below this line.
 delete myDog.tails;

```


text:
cd "$(dirname "$0")"

# Build binary and sets $GITVERSION (example: v0.7-15-gf01f599)
source build.bash

# Set $ID (example: "fedora", "debian") and $VERSION_ID (example: "23", "8")
if [[ -e /etc/os-release ]]; then
	# Modern Debian and Fedora
	source /etc/os-release
elif [[ -e /etc/redhat-release ]]; then
	# RHEL and CentOS
	# "CentOS release 5.11 (Final)" -> "CentOS_release_5.11_Final"
	ID=$(cat /etc/redhat-release | tr ' ' '_' | tr -d '()')
	VERSION_ID=""
else
	echo "Could not get distribution version"
	ID=unknown
	VERSION_ID=.unknown
fi

ARCH=$(go env GOARCH)
# Build gocryptfs.1 man page
./Documentation/MANPAGE-render.bash > /dev/null
cp -a ./Documentation/gocryptfs.1 .

TARGZ=gocryptfs_${GITVERSION}_${ID}${VERSION_ID}_${ARCH}.tar.gz

tar --owner=root --group=root -czf $TARGZ gocryptfs gocryptfs.1

echo "Tar created."
echo "Hint for signing: gpg -u 23A02740 --armor --detach-sig $TARGZ"


text:
namespace ts
{

Type_System::Type_System()
    : m_root_scope(new Namespace(std::string()))
{

}

void Type_System::set_native_type(IType& type, std::string const& native_type)
{
    std::shared_ptr<IString_Value> value = create_specialized_value<IString_Value>("string");
    TS_ASSERT(value);
    auto result = value->construct();
    TS_ASSERT(result == success);
    result = value->set_value(native_type);
    TS_ASSERT(result == success);

    std::shared_ptr<ILiteral_Attribute> att = std::make_shared<Literal_Attribute>("native_type", value);
    result = type.add_attribute(att);
    TS_ASSERT(result == success);
}

void Type_System::populate_builtin_types()
{
    std::shared_ptr<IType> type = std::make_shared<String_Type>("string");
    auto sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);
    set_native_type(*type, "std::string");

    type = std::make_shared<Bool_Type>("bool");
    set_native_type(*type, "bool");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Int_Type>("int");
    set_native_type(*type, "int64_t");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Float_Type>("float");
    set_native_type(*type, "float");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Double_Type>("double");
    set_native_type(*type, "double");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Vec2f_Type>("vec2f");
    set_native_type(*type, "vec2f");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Vec2d_Type>("vec2d");
    set_native_type(*type, "vec2d");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Vec2i_Type>("vec2i");
    set_native_type(*type, "vec2i");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Vec3f_Type>("vec3f");
    set_native_type(*type, "vec3f");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Vec3d_Type>("vec3d");
    set_native_type(*type, "vec3d");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Vec3i_Type>("vec3i");
    set_native_type(*type, "vec3i");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Vec4f_Type>("vec4f");
    set_native_type(*type, "vec4f");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Vec4d_Type>("vec4d");
    set_native_type(*type, "vec4d");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);

    type = std::make_shared<Vec4i_Type>("vec4i");
    set_native_type(*type, "vec4i");
    sym_result = m_root_scope->add_symbol(type);
    TS_ASSERT(sym_result == success);
}

Result<std::shared_ptr<const ITemplated_Type>> Type_System::instantiate_template(std::string const& name, std::vector<std::shared_ptr<const ITemplate_Argument>> const& arguments)
{
    if (name.empty())
    {
        return Error("cannot instantiate an unnamed template");
    }
    std::string instanced_name = name;
    for (std::shared_ptr<const ITemplate_Argument> const& arg: arguments)
    {
        if (arg->get_template_instantiation_string().empty())
        {
            return Error("invalid template argument");
        }
        instanced_name += "#";
        instanced_name += arg->get_template_instantiation_string();
    }
    std::transform(instanced_name.begin(), instanced_name.end(), instanced_name.begin(), [](char c) { return c == ':' ? '_' : c; });

    std::shared_ptr<const ITemplated_Type> instance = m_root_scope->find_specialized_symbol_by_name<ITemplated_Type>(instanced_name);
    if (instance)
    {
        return instance;
    }

    std::shared_ptr<ts::ITemplated_Type> type;

    if (name == "vector")
    {
        type = std::make_shared<ts::Vector_Type>(instanced_name);
    }
    else if (name == "poly")
    {
        type = std::make_shared<ts::Poly_Type>(instanced_name);
    }
    else if (name == "variant")
    {
        type = std::make_shared<ts::Variant_Type>(instanced_name);
    }
    else if (name == "optional")
    {
        type = std::make_shared<ts::Optional_Type>(instanced_name);
    }
    else
    {
        return Error("Unknown template type '" + name + "'");
    }

    auto init_result = type->init(arguments);
    if (init_result != success)
    {
        return init_result.error();
    }
    auto add_result = m_root_scope->add_symbol(std::move(type));
    if (add_result != success)
    {
        return add_result.error();
    }
    return std::dynamic_pointer_cast<const ITemplated_Type>(add_result.payload());
}

std::shared_ptr<IValue> Type_System::create_value(Symbol_Path const& type_path) const
{
    std::shared_ptr<const ts::IType> type = m_root_scope->find_specialized_symbol_by_path<const ts::IType>(type_path);
    if (!type)
    {
        return nullptr;
    }
    return type->create_value();
}

std::shared_ptr<IDeclaration_Scope> Type_System::get_root_scope()
{
    return m_root_scope;
}
std::shared_ptr<const IDeclaration_Scope> Type_System::get_root_scope() const
{
    return m_root_scope;
}

}


text:
package types

// DO NOT EDIT. THIS FILE WAS AUTOMATICALLY GENERATED

import (
	time "time"
)

// SoftLayer_Container_Account_Historical_Summary_Detail_Uptime - Historical Summary Details Container
// for a host resource uptime
type SoftLayer_Container_Account_Historical_Summary_Detail_Uptime struct {

	// CloudComputingInstance - no documentation
	CloudComputingInstance *SoftLayer_Virtual_Guest `json:"cloudComputingInstance,omitempty"`

	// ConfigurationValue - no documentation
	ConfigurationValue *SoftLayer_Monitoring_Agent_Configuration_Value `json:"configurationValue,omitempty"`

	// Data - no documentation
	Data []*SoftLayer_Metric_Tracking_Object_Data `json:"data,omitempty"`

	// EndDate - no documentation
	EndDate *time.Time `json:"endDate,omitempty"`

	// Hardware - no documentation
	Hardware *SoftLayer_Hardware `json:"hardware,omitempty"`

	// StartDate - no documentation
	StartDate *time.Time `json:"startDate,omitempty"`
}

func (softlayer_container_account_historical_summary_detail_uptime *SoftLayer_Container_Account_Historical_Summary_Detail_Uptime) String() string {
	return "SoftLayer_Container_Account_Historical_Summary_Detail_Uptime"
}


text:
Pattern: `expect()` without `.to` or `.not_to`

Issue: -

## Description

This rule checks void `expect()`.

## Examples

```ruby
# bad
expect(something)

# good
expect(something).to be(1)
```

## Further Reading

* [RSpec - RSpec/VoidExpect](https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecvoidexpect)
* [http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VoidExpect](http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VoidExpect)


text:
package hello.converters;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.ReflectionUtils;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;

import java.lang.reflect.Method;

/**
 * Created by elili on 6/3/2016.
 */
public abstract class AbstractConverter<SOURCE, TARGET> implements Converter<SOURCE, TARGET>, Populator<SOURCE, TARGET>,InitializingBean,BeanNameAware
{
    private Class<TARGET> targetClass;

    @Override
    public TARGET convert(final SOURCE source) throws ConversionException
    {
        final TARGET target = targetClass == null ? createTarget() : createFromClass();
        populate(source, target);
        return target;
    }

    /**
     * @deprecated Do not call this method - only call the single argument {@link #convert(Object)} method.
     */
    @Override
    @Deprecated
    public TARGET convert(final SOURCE source, final TARGET prototype) throws ConversionException
    {
        populate(source, prototype);
        return prototype;
    }

    /**
     * Override this method to populate the target from the source
     *
     * @param source
     *           the source instance
     * @param target
     *           the target instance to fill
     *
     * @see #setTargetClass(Class)
     */
    @Override
    public abstract void populate(final SOURCE source, final TARGET target);

    /**
     * Allows to specify the target object class directly.
     *
     * Please use that instead of the deprecated <lookup-method name="createTarget" ref="bean"> approach, as it's way
     * faster.
     */
    public void setTargetClass(final Class<TARGET> targetClass)
    {
        this.targetClass = targetClass;

        // sanity check - can we instantiate that class ?
        if (targetClass != null)
        {
            createFromClass();
        }
    }

    protected TARGET createFromClass()
    {
        try
        {
            return targetClass.newInstance();
        }
        catch (InstantiationException | IllegalAccessException e)
        {
            throw new RuntimeException(e);
        }
    }

    /**
     * @deprecated please inject the target class directly, since it's way faster than the Spring <lookup-method>
     *             approach!
     */
    @Deprecated
    protected TARGET createTarget()
    {
        // optional - no longer requiring sub classes to implement this method
        throw new NotImplementedException();
    }

    // -------------------------------------------------------------------
    // --- Sanity check for the two different converter setups
    // -------------------------------------------------------------------

    private String myBeanName;

    /*
     * for sanity checks only
     */
    @Override
    public void setBeanName(final String name)
    {
        this.myBeanName = name;
    }

    /*
     * Ensures that either a class has been set or createTarget() has been overridden
     */
    @Override
    public void afterPropertiesSet() throws Exception
    {
        if (targetClass == null)
        {
            final Class<? extends AbstractConverter> cl = this.getClass();
            final Method createTargetMethod = ReflectionUtils.findMethod(cl, "createTarget");
            if (AbstractConverter.class.equals(createTargetMethod.getDeclaringClass()))
            {
                throw new IllegalStateException("Converter '" + myBeanName
                        + "' doesn't have a targetClass property nor does it override createTarget()!");
            }
        }
    }
}


text:
package org.eclipse.collections.impl.bag.immutable.primitive;

import org.eclipse.collections.impl.test.Verify;
import org.junit.Test;

public class ImmutableByteSingletonBagSerializationTest
{
    @Test
    public void serializedForm()
    {
        Verify.assertSerializedForm(
                1L,
                "rO0ABXNyAE5vcmcuZWNsaXBzZS5jb2xsZWN0aW9ucy5pbXBsLmJhZy5pbW11dGFibGUucHJpbWl0\n"
                        + "aXZlLkltbXV0YWJsZUJ5dGVTaW5nbGV0b25CYWcAAAAAAAAAAQIAAUIACGVsZW1lbnQxeHAB",
                new ImmutableByteSingletonBag((byte) 1));
    }
}


text:
while true; do
    read -p "Are you using Linux (y or n)? " yn
    case $yn in
        [Yy]* )
        	sudo -u postgres psql -c 'DROP DATABASE badroc'
			sudo -u postgres psql -c 'CREATE DATABASE badroc'
			sudo -u postgres psql -c 'CREATE USER badroc_admin'
			sudo -u postgres psql -c 'GRANT ALL PRIVILEGES ON DATABASE badroc TO badroc_admin'
			# sudo -u postgres psql -d badroc -c 'CREATE EXTENSION hstore'

			break;;
        [Nn]* )
			psql -c 'DROP DATABASE badroc'
			psql -c 'CREATE DATABASE badroc'
			psql -c 'CREATE USER badroc_admin'
			psql -c 'GRANT ALL PRIVILEGES ON DATABASE badroc TO badroc_admin'
			# psql -d badroc -c 'CREATE EXTENSION hstore'

			break;;
        * ) echo "Please answer yes or no.";;
    esac
done

python manage.py syncdb
python manage.py collectstatic --noinput


text:
using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace WeifenLuo.WinFormsUI.Docking
{
	[Flags]
	[Serializable]
	[Editor(typeof(DockAreasEditor), typeof(System.Drawing.Design.UITypeEditor))]
	public enum DockAreas
	{
		Float = 1,
		DockLeft = 2,
		DockRight = 4,
		DockTop = 8,
		DockBottom = 16,
		Document = 32
	}

	public enum DockState
	{
		Unknown = 0,
		Float = 1,
		DockTopAutoHide = 2,
		DockLeftAutoHide = 3,
		DockBottomAutoHide = 4,
		DockRightAutoHide = 5,
		Document = 6,
		DockTop = 7,
		DockLeft = 8,
		DockBottom = 9,
		DockRight = 10,
		Hidden = 11
	}

	public enum DockAlignment
	{
		Left,
		Right,
		Top,
		Bottom
	}

	public enum DocumentStyle
	{
		DockingMdi,
		DockingWindow,
		DockingSdi,
		SystemMdi,
	}

    /// <summary>
    /// The location to draw the DockPaneStrip for Document style windows.
    /// </summary>
    public enum DocumentTabStripLocation
    {
        Top,
        Bottom
    }
}


text:
"use strict";
/**
 * @ngdoc overview
 * @name gustav
 * @description Gustav shell application
 */
angular.module('gustav', [
        'angular-loading-bar',
        'ngcsas.core',
        'gustav.config', 'gustav.account', 'gustav.card', 'gustav.history', 'gustav.buildingSaving',
        'ngcsas.core.i18n', 'gustav.i18n', 'gustav.account.i18n', 'gustav.card.i18n', 'gustav.history.i18n', 'gustav.buildingSaving.i18n',

    ])
    .config(
        //Configure loading bar
        function(cfpLoadingBarProvider) {
            cfpLoadingBarProvider.includeSpinner = false;
        }
    )

    .config(function($stateProvider, $urlRouterProvider) {

        $urlRouterProvider
            .otherwise('/home');

        $stateProvider
            .state('home', {
                url: '/home',
                templateUrl: 'gustav/partials/home.html',
                controller: 'HomeCtrl',
                resolve: {
                    accounts: function(Account) {
                        return Account.load();
                    }
                }
            })
        .state('bye', {
            url: '/bye',
            templateUrl: 'gustav/partials/bye.html'
        });
    })
    .config(function(MenuProvider) {
        MenuProvider.insert({
            icon: 'glyphicon glyphicon-home',
            url: '/home',
            title: 'gustav.MENU_ITEM'
        });
    })
    .config(function($httpProvider, ENV) {
        $httpProvider.defaults.headers.common['WEB-API-key'] = ENV.apiKey;
        $httpProvider.defaults.headers.common['Authorization'] = 'Bearer ' + ENV.authToken; //jshint ignore:line
    });


text:
var express = require('express');
var router = express.Router();

var checkLogin = require('../middlewares/check').checkLogin;

router.get('/start', function (req, res, next) {
  req.jobManager.restartJobs();
  res.json("Jobs started by JobManager.restartJobs().");
  next();
});

module.exports = router;


text:
FactoryGirl.define do
  factory :template, :class => 'Smithy::Template' do
    name { FFaker::Lorem.words(5).join(' ') }
    content { FFaker::Lorem.paragraph }
    template_type 'template'
  end
end